diff --git a/.github/workflows/meson-ci.yml b/.github/workflows/meson-ci.yml index bea92d229..971850c5b 100644 --- a/.github/workflows/meson-ci.yml +++ b/.github/workflows/meson-ci.yml @@ -2,51 +2,51 @@ name: Meson Continuous Integration on: [push, pull_request] jobs: -# macos-latest: -# name: Build and Test on MacOS Latest -# runs-on: macos-latest -# steps: -## - name: Install MongoDB with Package Manager -## run: | -## brew tap mongodb/brew -## brew install mongodb-community -## brew services start mongodb-community -# - name: Create the TUN device with the interface name `ogstun`. + macos-latest: + name: Build and Test on MacOS Latest + runs-on: macos-latest + steps: +# - name: Install MongoDB with Package Manager # run: | -# sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255 -# sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255 -# - name: Install the dependencies for building the source code. -# run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson -# - name: Check out repository code -# uses: actions/checkout@main -# - name: Setup Meson Build -# run: PATH="/usr/local/opt/bison/bin:$PATH" PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" meson setup build -# env: -# CC: gcc -# - name : Build Open5GS -# run: ninja -C build -# - name: Test Open5GS -# run: sudo meson test -C build -v crypt unit -# +# brew tap mongodb/brew +# brew install mongodb-community +# brew services start mongodb-community + - name: Create the TUN device with the interface name `ogstun`. + run: | + sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255 + sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255 + - name: Install the dependencies for building the source code. + run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson + - name: Check out repository code + uses: actions/checkout@main + - name: Setup Meson Build + run: PATH="/usr/local/opt/bison/bin:$PATH" PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" meson setup build + env: + CC: gcc + - name : Build Open5GS + run: ninja -C build + - name: Test Open5GS + run: sudo meson test -C build -v crypt unit + ubuntu-latest: name: Build and Test on Ubuntu Latest runs-on: ubuntu-latest diff --git a/lib/asn1c/support/README.md b/lib/asn1c/support/README.md index c6c6e42d9..820984841 100644 --- a/lib/asn1c/support/README.md +++ b/lib/asn1c/support/README.md @@ -82,6 +82,29 @@ index 1df33a4d..a74f97ea 100644 }; #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */ +Check ExtIEs in ProtocolExtensionContainer +========================================== +diff --git a/src/smf/ngap-build.c b/src/smf/ngap-build.c +index 9554be276..051cb6e8a 100644 +--- a/src/smf/ngap-build.c ++++ b/src/smf/ngap-build.c +@@ -180,13 +180,13 @@ ogs_pkbuf_t *ngap_build_pdu_session_resource_setup_request_transfer( + + if (smf_self()->security_indication. + maximum_integrity_protected_data_rate_downlink) { +- NGAP_ProtocolExtensionContainer_9625P229_t *extContainer = NULL; ++ NGAP_ProtocolExtensionContainer_11905P297_t *extContainer = NULL; + NGAP_SecurityIndication_ExtIEs_t *extIe = NULL; + NGAP_MaximumIntegrityProtectedDataRate_t + *MaximumIntegrityProtectedDataRate = NULL; + + extContainer = CALLOC(1, +- sizeof(NGAP_ProtocolExtensionContainer_9625P229_t)); ++ sizeof(NGAP_ProtocolExtensionContainer_11905P297_t)); + ogs_assert(extContainer); + SecurityIndication->iE_Extensions = + (struct NGAP_ProtocolExtensionContainer *)extContainer; + Check common file =========================================== user@host ~/Documents/git/open5gs/lib/asn1c/common$ \ diff --git a/lib/sbi/openapi/.openapi-generator/VERSION b/lib/sbi/openapi/.openapi-generator/VERSION index 7cbea073b..c0be8a799 100644 --- a/lib/sbi/openapi/.openapi-generator/VERSION +++ b/lib/sbi/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -5.2.0 \ No newline at end of file +6.4.0 \ No newline at end of file diff --git a/lib/sbi/openapi/external/cJSON.c b/lib/sbi/openapi/external/cJSON.c index ec3a9dc05..2ebd75bf9 100644 --- a/lib/sbi/openapi/external/cJSON.c +++ b/lib/sbi/openapi/external/cJSON.c @@ -588,7 +588,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out } else { - /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ + /* Try 15 decimal places of precision to avoid insignificant nonzero digits */ length = sprintf((char*)number_buffer, "%1.15g", d); /* Check whether the original double can be recovered */ @@ -1679,7 +1679,7 @@ static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_bu buffer_skip_whitespace(input_buffer); if (!parse_string(current_item, input_buffer)) { - goto fail; /* failed to parse name */ + goto fail; /* fail to parse name */ } buffer_skip_whitespace(input_buffer); diff --git a/lib/sbi/openapi/meson.build b/lib/sbi/openapi/meson.build index f01466c03..2610fdeb4 100644 --- a/lib/sbi/openapi/meson.build +++ b/lib/sbi/openapi/meson.build @@ -151,6 +151,7 @@ libsbi_openapi_sources = files(''' model/cag_data.c model/cag_info_1.c model/cag_info.c + model/cancel_relocate_ue_context_request.c model/candidate_for_replacement.c model/cause.c model/ce_mode_b_ind.c @@ -181,6 +182,9 @@ libsbi_openapi_sources = files(''' model/context_data_sets.c model/context_info.c model/core_network_type.c + model/create_ue_context_201_response.c + model/create_ue_context_403_response.c + model/create_ue_context_request.c model/credit_management_status.c model/data_change_notify.c model/data_filter.c @@ -215,6 +219,7 @@ libsbi_openapi_sources = files(''' model/downlink_data_notification_control.c model/downlink_data_notification_control_rm.c model/dynamic5_qi.c + model/eap_auth_method_200_response.c model/eap_session.c model/ebi_arp_mapping.c model/ecgi_1.c @@ -284,6 +289,7 @@ libsbi_openapi_sources = files(''' model/gbr_qos_flow_information.c model/geographical_coordinates.c model/geographic_area.c + model/get_nf_instances_200_response.c model/global_ran_node_id_1.c model/global_ran_node_id.c model/gmlc_info.c @@ -310,12 +316,6 @@ libsbi_openapi_sources = files(''' model/imsi_range.c model/ims_vo_ps.c model/indirect_data_forwarding_tunnel_info.c - model/inline_object_1.c - model/inline_object_2.c - model/inline_object_3.c - model/inline_object_4.c - model/inline_object.c - model/inline_response_200.c model/integrity_algorithm.c model/interface_upf_info_item.c model/inter_freq_target_info_1.c @@ -395,6 +395,7 @@ libsbi_openapi_sources = files(''' model/model_5_gvn_group_configuration.c model/model_5_gvn_group_data.c model/modification_notification.c + model/modify_200_response.c model/mo_exp_data_counter.c model/monitoring_configuration.c model/mtc_provider.c @@ -412,6 +413,7 @@ libsbi_openapi_sources = files(''' model/n2_info_container.c model/n2_info_content.c model/n2_info_notification_rsp_data.c + model/n2_info_notify_handover_complete_200_response.c model/n2_info_notify_reason.c model/n2_information_class.c model/n2_information_notification.c @@ -458,8 +460,10 @@ libsbi_openapi_sources = files(''' model/nidd_information.c model/node_type.c model/non_dynamic5_qi.c + model/non_ue_n2_info_notify_request.c model/non_ue_n2_info_subscription_create_data.c model/non_ue_n2_info_subscription_created_data.c + model/non_ue_n2_message_transfer_request.c model/notif_condition.c model/notification_cause.c model/notification_control.c @@ -469,6 +473,7 @@ libsbi_openapi_sources = files(''' model/notification_item.c model/notification_type.c model/notify_item.c + model/npcf_af_event.c model/npn_access_info.c model/nrf_info.c model/nr_location.c @@ -648,6 +653,10 @@ libsbi_openapi_sources = files(''' model/registration_reason.c model/release_data.c model/released_data.c + model/release_pdu_session_200_response.c + model/release_pdu_session_request.c + model/release_sm_context_request.c + model/relocate_ue_context_request.c model/report_amount_mdt.c model/reporting_frequency.c model/reporting_level.c @@ -708,6 +717,7 @@ libsbi_openapi_sources = files(''' model/secondary_rat_usage_report.c model/security_result.c model/send_mo_data_req_data.c + model/send_mo_data_request.c model/sensor_measurement.c model/sequence_number.c model/serv_auth_info.c @@ -849,8 +859,10 @@ libsbi_openapi_sources = files(''' model/traffic_profile.c model/traffic_profile_rm.c model/transfer_mo_data_req_data.c + model/transfer_mo_data_request.c model/transfer_mt_data_add_info.c model/transfer_mt_data_error.c + model/transfer_mt_data_ismf_request.c model/transfer_mt_data_req_data.c model/transfer_policy.c model/transfer_reason.c @@ -872,8 +884,8 @@ libsbi_openapi_sources = files(''' model/udr_info.c model/udsf_info.c model/ue_auth.c - model/ue_authentication_ctx.c model/ue_authentication_ctx_5g_auth_data.c + model/ue_authentication_ctx.c model/ue_camping_rep.c model/ue_context.c model/ue_context_cancel_relocate_data.c @@ -889,7 +901,9 @@ libsbi_openapi_sources = files(''' model/ue_context_release.c model/ue_context_relocate_data.c model/ue_context_relocated_data.c + model/ue_context_transfer_200_response.c model/ue_context_transfer_req_data.c + model/ue_context_transfer_request.c model/ue_context_transfer_rsp_data.c model/ue_context_transfer_status.c model/ue_differentiation_info.c @@ -914,6 +928,12 @@ libsbi_openapi_sources = files(''' model/up_cnx_state.c model/up_confidentiality.c model/updated_item.c + model/update_pdu_session_200_response.c + model/update_pdu_session_400_response.c + model/update_pdu_session_request.c + model/update_sm_context_200_response.c + model/update_sm_context_400_response.c + model/update_sm_context_request.c model/upf_cond.c model/upf_info.c model/up_integrity.c diff --git a/lib/sbi/openapi/model/acc_net_ch_id.c b/lib/sbi/openapi/model/acc_net_ch_id.c index 2b285cdd3..72604f732 100644 --- a/lib/sbi/openapi/model/acc_net_ch_id.c +++ b/lib/sbi/openapi/model/acc_net_ch_id.c @@ -24,20 +24,25 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_create( void OpenAPI_acc_net_ch_id_free(OpenAPI_acc_net_ch_id_t *acc_net_ch_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == acc_net_ch_id) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, node) { - ogs_free(node->data); + if (acc_net_ch_id->ref_pcc_rule_ids) { + OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(acc_net_ch_id->ref_pcc_rule_ids); + acc_net_ch_id->ref_pcc_rule_ids = NULL; } - OpenAPI_list_free(acc_net_ch_id->ref_pcc_rule_ids); ogs_free(acc_net_ch_id); } cJSON *OpenAPI_acc_net_ch_id_convertToJSON(OpenAPI_acc_net_ch_id_t *acc_net_ch_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (acc_net_ch_id == NULL) { ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [AccNetChId]"); @@ -51,19 +56,17 @@ cJSON *OpenAPI_acc_net_ch_id_convertToJSON(OpenAPI_acc_net_ch_id_t *acc_net_ch_i } if (acc_net_ch_id->ref_pcc_rule_ids) { - cJSON *ref_pcc_rule_ids = cJSON_AddArrayToObject(item, "refPccRuleIds"); - if (ref_pcc_rule_ids == NULL) { + cJSON *ref_pcc_rule_idsList = cJSON_AddArrayToObject(item, "refPccRuleIds"); + if (ref_pcc_rule_idsList == NULL) { ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [ref_pcc_rule_ids]"); goto end; } - - OpenAPI_lnode_t *ref_pcc_rule_ids_node; - OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, ref_pcc_rule_ids_node) { - if (cJSON_AddStringToObject(ref_pcc_rule_ids, "", (char*)ref_pcc_rule_ids_node->data) == NULL) { - ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [ref_pcc_rule_ids]"); - goto end; + OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, node) { + if (cJSON_AddStringToObject(ref_pcc_rule_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [ref_pcc_rule_ids]"); + goto end; + } } - } } if (acc_net_ch_id->is_session_ch_scope) { @@ -80,39 +83,43 @@ end: OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_idJSON) { OpenAPI_acc_net_ch_id_t *acc_net_ch_id_local_var = NULL; - cJSON *acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "accNetChaIdValue"); + OpenAPI_lnode_t *node = NULL; + cJSON *acc_net_cha_id_value = NULL; + cJSON *ref_pcc_rule_ids = NULL; + OpenAPI_list_t *ref_pcc_rule_idsList = NULL; + cJSON *session_ch_scope = NULL; + acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "accNetChaIdValue"); if (!acc_net_cha_id_value) { ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [acc_net_cha_id_value]"); goto end; } - if (!cJSON_IsNumber(acc_net_cha_id_value)) { ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [acc_net_cha_id_value]"); goto end; } - cJSON *ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "refPccRuleIds"); - - OpenAPI_list_t *ref_pcc_rule_idsList; + ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "refPccRuleIds"); if (ref_pcc_rule_ids) { - cJSON *ref_pcc_rule_ids_local; - if (!cJSON_IsArray(ref_pcc_rule_ids)) { - ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [ref_pcc_rule_ids]"); - goto end; - } - ref_pcc_rule_idsList = OpenAPI_list_create(); + cJSON *ref_pcc_rule_ids_local = NULL; + if (!cJSON_IsArray(ref_pcc_rule_ids)) { + ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [ref_pcc_rule_ids]"); + goto end; + } - cJSON_ArrayForEach(ref_pcc_rule_ids_local, ref_pcc_rule_ids) { - if (!cJSON_IsString(ref_pcc_rule_ids_local)) { - ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [ref_pcc_rule_ids]"); - goto end; - } - OpenAPI_list_add(ref_pcc_rule_idsList, ogs_strdup(ref_pcc_rule_ids_local->valuestring)); - } + ref_pcc_rule_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_pcc_rule_ids_local, ref_pcc_rule_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_pcc_rule_ids_local)) { + ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [ref_pcc_rule_ids]"); + goto end; + } + OpenAPI_list_add(ref_pcc_rule_idsList, ogs_strdup(ref_pcc_rule_ids_local->valuestring)); + } } - cJSON *session_ch_scope = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "sessionChScope"); - + session_ch_scope = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "sessionChScope"); if (session_ch_scope) { if (!cJSON_IsBool(session_ch_scope)) { ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [session_ch_scope]"); @@ -130,6 +137,13 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_i return acc_net_ch_id_local_var; end: + if (ref_pcc_rule_idsList) { + OpenAPI_list_for_each(ref_pcc_rule_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_pcc_rule_idsList); + ref_pcc_rule_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/acc_net_charging_address.c b/lib/sbi/openapi/model/acc_net_charging_address.c index 5a80dc0b9..69f38417c 100644 --- a/lib/sbi/openapi/model/acc_net_charging_address.c +++ b/lib/sbi/openapi/model/acc_net_charging_address.c @@ -20,18 +20,26 @@ OpenAPI_acc_net_charging_address_t *OpenAPI_acc_net_charging_address_create( void OpenAPI_acc_net_charging_address_free(OpenAPI_acc_net_charging_address_t *acc_net_charging_address) { + OpenAPI_lnode_t *node = NULL; + if (NULL == acc_net_charging_address) { return; } - OpenAPI_lnode_t *node; - ogs_free(acc_net_charging_address->an_charg_ipv4_addr); - ogs_free(acc_net_charging_address->an_charg_ipv6_addr); + if (acc_net_charging_address->an_charg_ipv4_addr) { + ogs_free(acc_net_charging_address->an_charg_ipv4_addr); + acc_net_charging_address->an_charg_ipv4_addr = NULL; + } + if (acc_net_charging_address->an_charg_ipv6_addr) { + ogs_free(acc_net_charging_address->an_charg_ipv6_addr); + acc_net_charging_address->an_charg_ipv6_addr = NULL; + } ogs_free(acc_net_charging_address); } cJSON *OpenAPI_acc_net_charging_address_convertToJSON(OpenAPI_acc_net_charging_address_t *acc_net_charging_address) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (acc_net_charging_address == NULL) { ogs_error("OpenAPI_acc_net_charging_address_convertToJSON() failed [AccNetChargingAddress]"); @@ -60,27 +68,28 @@ end: OpenAPI_acc_net_charging_address_t *OpenAPI_acc_net_charging_address_parseFromJSON(cJSON *acc_net_charging_addressJSON) { OpenAPI_acc_net_charging_address_t *acc_net_charging_address_local_var = NULL; - cJSON *an_charg_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acc_net_charging_addressJSON, "anChargIpv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *an_charg_ipv4_addr = NULL; + cJSON *an_charg_ipv6_addr = NULL; + an_charg_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acc_net_charging_addressJSON, "anChargIpv4Addr"); if (an_charg_ipv4_addr) { - if (!cJSON_IsString(an_charg_ipv4_addr)) { + if (!cJSON_IsString(an_charg_ipv4_addr) && !cJSON_IsNull(an_charg_ipv4_addr)) { ogs_error("OpenAPI_acc_net_charging_address_parseFromJSON() failed [an_charg_ipv4_addr]"); goto end; } } - cJSON *an_charg_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acc_net_charging_addressJSON, "anChargIpv6Addr"); - + an_charg_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acc_net_charging_addressJSON, "anChargIpv6Addr"); if (an_charg_ipv6_addr) { - if (!cJSON_IsString(an_charg_ipv6_addr)) { + if (!cJSON_IsString(an_charg_ipv6_addr) && !cJSON_IsNull(an_charg_ipv6_addr)) { ogs_error("OpenAPI_acc_net_charging_address_parseFromJSON() failed [an_charg_ipv6_addr]"); goto end; } } acc_net_charging_address_local_var = OpenAPI_acc_net_charging_address_create ( - an_charg_ipv4_addr ? ogs_strdup(an_charg_ipv4_addr->valuestring) : NULL, - an_charg_ipv6_addr ? ogs_strdup(an_charg_ipv6_addr->valuestring) : NULL + an_charg_ipv4_addr && !cJSON_IsNull(an_charg_ipv4_addr) ? ogs_strdup(an_charg_ipv4_addr->valuestring) : NULL, + an_charg_ipv6_addr && !cJSON_IsNull(an_charg_ipv6_addr) ? ogs_strdup(an_charg_ipv6_addr->valuestring) : NULL ); return acc_net_charging_address_local_var; diff --git a/lib/sbi/openapi/model/acceptable_service_info.c b/lib/sbi/openapi/model/acceptable_service_info.c index 9222790a5..844ee189f 100644 --- a/lib/sbi/openapi/model/acceptable_service_info.c +++ b/lib/sbi/openapi/model/acceptable_service_info.c @@ -22,25 +22,36 @@ OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_create( void OpenAPI_acceptable_service_info_free(OpenAPI_acceptable_service_info_t *acceptable_service_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == acceptable_service_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(acceptable_service_info->acc_bw_med_comps, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_media_component_free(localKeyValue->value); - ogs_free(localKeyValue); + if (acceptable_service_info->acc_bw_med_comps) { + OpenAPI_list_for_each(acceptable_service_info->acc_bw_med_comps, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_component_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(acceptable_service_info->acc_bw_med_comps); + acceptable_service_info->acc_bw_med_comps = NULL; + } + if (acceptable_service_info->mar_bw_ul) { + ogs_free(acceptable_service_info->mar_bw_ul); + acceptable_service_info->mar_bw_ul = NULL; + } + if (acceptable_service_info->mar_bw_dl) { + ogs_free(acceptable_service_info->mar_bw_dl); + acceptable_service_info->mar_bw_dl = NULL; } - OpenAPI_list_free(acceptable_service_info->acc_bw_med_comps); - ogs_free(acceptable_service_info->mar_bw_ul); - ogs_free(acceptable_service_info->mar_bw_dl); ogs_free(acceptable_service_info); } cJSON *OpenAPI_acceptable_service_info_convertToJSON(OpenAPI_acceptable_service_info_t *acceptable_service_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (acceptable_service_info == NULL) { ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [AcceptableServiceInfo]"); @@ -55,21 +66,20 @@ cJSON *OpenAPI_acceptable_service_info_convertToJSON(OpenAPI_acceptable_service_ goto end; } cJSON *localMapObject = acc_bw_med_comps; - OpenAPI_lnode_t *acc_bw_med_comps_node; if (acceptable_service_info->acc_bw_med_comps) { - OpenAPI_list_for_each(acceptable_service_info->acc_bw_med_comps, acc_bw_med_comps_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)acc_bw_med_comps_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_media_component_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(acceptable_service_info->acc_bw_med_comps, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_media_component_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (acceptable_service_info->mar_bw_ul) { if (cJSON_AddStringToObject(item, "marBwUl", acceptable_service_info->mar_bw_ul) == NULL) { @@ -92,45 +102,48 @@ end: OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_parseFromJSON(cJSON *acceptable_service_infoJSON) { OpenAPI_acceptable_service_info_t *acceptable_service_info_local_var = NULL; - cJSON *acc_bw_med_comps = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "accBwMedComps"); - - OpenAPI_list_t *acc_bw_med_compsList; + OpenAPI_lnode_t *node = NULL; + cJSON *acc_bw_med_comps = NULL; + OpenAPI_list_t *acc_bw_med_compsList = NULL; + cJSON *mar_bw_ul = NULL; + cJSON *mar_bw_dl = NULL; + acc_bw_med_comps = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "accBwMedComps"); if (acc_bw_med_comps) { - cJSON *acc_bw_med_comps_local_map; - if (!cJSON_IsObject(acc_bw_med_comps)) { - ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [acc_bw_med_comps]"); - goto end; - } - acc_bw_med_compsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(acc_bw_med_comps_local_map, acc_bw_med_comps) { - cJSON *localMapObject = acc_bw_med_comps_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_media_component_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [inner]"); + cJSON *acc_bw_med_comps_local_map = NULL; + if (!cJSON_IsObject(acc_bw_med_comps) && !cJSON_IsNull(acc_bw_med_comps)) { + ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [acc_bw_med_comps]"); goto end; } - OpenAPI_list_add(acc_bw_med_compsList, localMapKeyPair); - } + if (cJSON_IsObject(acc_bw_med_comps)) { + acc_bw_med_compsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(acc_bw_med_comps_local_map, acc_bw_med_comps) { + cJSON *localMapObject = acc_bw_med_comps_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_media_component_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(acc_bw_med_compsList, localMapKeyPair); + } + } } - cJSON *mar_bw_ul = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwUl"); - + mar_bw_ul = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwUl"); if (mar_bw_ul) { - if (!cJSON_IsString(mar_bw_ul)) { + if (!cJSON_IsString(mar_bw_ul) && !cJSON_IsNull(mar_bw_ul)) { ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [mar_bw_ul]"); goto end; } } - cJSON *mar_bw_dl = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwDl"); - + mar_bw_dl = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwDl"); if (mar_bw_dl) { - if (!cJSON_IsString(mar_bw_dl)) { + if (!cJSON_IsString(mar_bw_dl) && !cJSON_IsNull(mar_bw_dl)) { ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [mar_bw_dl]"); goto end; } @@ -138,12 +151,22 @@ OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_parseFromJSON acceptable_service_info_local_var = OpenAPI_acceptable_service_info_create ( acc_bw_med_comps ? acc_bw_med_compsList : NULL, - mar_bw_ul ? ogs_strdup(mar_bw_ul->valuestring) : NULL, - mar_bw_dl ? ogs_strdup(mar_bw_dl->valuestring) : NULL + mar_bw_ul && !cJSON_IsNull(mar_bw_ul) ? ogs_strdup(mar_bw_ul->valuestring) : NULL, + mar_bw_dl && !cJSON_IsNull(mar_bw_dl) ? ogs_strdup(mar_bw_dl->valuestring) : NULL ); return acceptable_service_info_local_var; end: + if (acc_bw_med_compsList) { + OpenAPI_list_for_each(acc_bw_med_compsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_component_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(acc_bw_med_compsList); + acc_bw_med_compsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/access_and_mobility_data.c b/lib/sbi/openapi/model/access_and_mobility_data.c index 4ad1f213f..c86699976 100644 --- a/lib/sbi/openapi/model/access_and_mobility_data.c +++ b/lib/sbi/openapi/model/access_and_mobility_data.c @@ -58,39 +58,92 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create( void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *access_and_mobility_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_and_mobility_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_user_location_free(access_and_mobility_data->location); - ogs_free(access_and_mobility_data->location_ts); - ogs_free(access_and_mobility_data->time_zone); - ogs_free(access_and_mobility_data->time_zone_ts); - OpenAPI_list_for_each(access_and_mobility_data->reg_states, node) { - OpenAPI_rm_info_free(node->data); + if (access_and_mobility_data->location) { + OpenAPI_user_location_free(access_and_mobility_data->location); + access_and_mobility_data->location = NULL; } - OpenAPI_list_free(access_and_mobility_data->reg_states); - ogs_free(access_and_mobility_data->reg_states_ts); - OpenAPI_list_for_each(access_and_mobility_data->conn_states, node) { - OpenAPI_cm_info_free(node->data); + if (access_and_mobility_data->location_ts) { + ogs_free(access_and_mobility_data->location_ts); + access_and_mobility_data->location_ts = NULL; + } + if (access_and_mobility_data->time_zone) { + ogs_free(access_and_mobility_data->time_zone); + access_and_mobility_data->time_zone = NULL; + } + if (access_and_mobility_data->time_zone_ts) { + ogs_free(access_and_mobility_data->time_zone_ts); + access_and_mobility_data->time_zone_ts = NULL; + } + if (access_and_mobility_data->reg_states) { + OpenAPI_list_for_each(access_and_mobility_data->reg_states, node) { + OpenAPI_rm_info_free(node->data); + } + OpenAPI_list_free(access_and_mobility_data->reg_states); + access_and_mobility_data->reg_states = NULL; + } + if (access_and_mobility_data->reg_states_ts) { + ogs_free(access_and_mobility_data->reg_states_ts); + access_and_mobility_data->reg_states_ts = NULL; + } + if (access_and_mobility_data->conn_states) { + OpenAPI_list_for_each(access_and_mobility_data->conn_states, node) { + OpenAPI_cm_info_free(node->data); + } + OpenAPI_list_free(access_and_mobility_data->conn_states); + access_and_mobility_data->conn_states = NULL; + } + if (access_and_mobility_data->conn_states_ts) { + ogs_free(access_and_mobility_data->conn_states_ts); + access_and_mobility_data->conn_states_ts = NULL; + } + if (access_and_mobility_data->reachability_status) { + OpenAPI_ue_reachability_free(access_and_mobility_data->reachability_status); + access_and_mobility_data->reachability_status = NULL; + } + if (access_and_mobility_data->reachability_status_ts) { + ogs_free(access_and_mobility_data->reachability_status_ts); + access_and_mobility_data->reachability_status_ts = NULL; + } + if (access_and_mobility_data->sms_over_nas_status_ts) { + ogs_free(access_and_mobility_data->sms_over_nas_status_ts); + access_and_mobility_data->sms_over_nas_status_ts = NULL; + } + if (access_and_mobility_data->roaming_status_ts) { + ogs_free(access_and_mobility_data->roaming_status_ts); + access_and_mobility_data->roaming_status_ts = NULL; + } + if (access_and_mobility_data->current_plmn) { + OpenAPI_plmn_id_1_free(access_and_mobility_data->current_plmn); + access_and_mobility_data->current_plmn = NULL; + } + if (access_and_mobility_data->current_plmn_ts) { + ogs_free(access_and_mobility_data->current_plmn_ts); + access_and_mobility_data->current_plmn_ts = NULL; + } + if (access_and_mobility_data->rat_type) { + OpenAPI_list_free(access_and_mobility_data->rat_type); + access_and_mobility_data->rat_type = NULL; + } + if (access_and_mobility_data->rat_types_ts) { + ogs_free(access_and_mobility_data->rat_types_ts); + access_and_mobility_data->rat_types_ts = NULL; + } + if (access_and_mobility_data->supp_feat) { + ogs_free(access_and_mobility_data->supp_feat); + access_and_mobility_data->supp_feat = NULL; } - OpenAPI_list_free(access_and_mobility_data->conn_states); - ogs_free(access_and_mobility_data->conn_states_ts); - OpenAPI_ue_reachability_free(access_and_mobility_data->reachability_status); - ogs_free(access_and_mobility_data->reachability_status_ts); - ogs_free(access_and_mobility_data->sms_over_nas_status_ts); - ogs_free(access_and_mobility_data->roaming_status_ts); - OpenAPI_plmn_id_1_free(access_and_mobility_data->current_plmn); - ogs_free(access_and_mobility_data->current_plmn_ts); - OpenAPI_list_free(access_and_mobility_data->rat_type); - ogs_free(access_and_mobility_data->rat_types_ts); - ogs_free(access_and_mobility_data->supp_feat); ogs_free(access_and_mobility_data); } cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobility_data_t *access_and_mobility_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_and_mobility_data == NULL) { ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [AccessAndMobilityData]"); @@ -132,7 +185,7 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit } } - if (access_and_mobility_data->access_type) { + if (access_and_mobility_data->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(access_and_mobility_data->access_type)) == NULL) { ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [access_type]"); goto end; @@ -145,17 +198,13 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]"); goto end; } - - OpenAPI_lnode_t *reg_states_node; - if (access_and_mobility_data->reg_states) { - OpenAPI_list_for_each(access_and_mobility_data->reg_states, reg_states_node) { - cJSON *itemLocal = OpenAPI_rm_info_convertToJSON(reg_states_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]"); - goto end; - } - cJSON_AddItemToArray(reg_statesList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_data->reg_states, node) { + cJSON *itemLocal = OpenAPI_rm_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]"); + goto end; } + cJSON_AddItemToArray(reg_statesList, itemLocal); } } @@ -172,17 +221,13 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]"); goto end; } - - OpenAPI_lnode_t *conn_states_node; - if (access_and_mobility_data->conn_states) { - OpenAPI_list_for_each(access_and_mobility_data->conn_states, conn_states_node) { - cJSON *itemLocal = OpenAPI_cm_info_convertToJSON(conn_states_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]"); - goto end; - } - cJSON_AddItemToArray(conn_statesList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_data->conn_states, node) { + cJSON *itemLocal = OpenAPI_cm_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]"); + goto end; } + cJSON_AddItemToArray(conn_statesList, itemLocal); } } @@ -213,7 +258,7 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit } } - if (access_and_mobility_data->sms_over_nas_status) { + if (access_and_mobility_data->sms_over_nas_status != OpenAPI_sms_support_NULL) { if (cJSON_AddStringToObject(item, "smsOverNasStatus", OpenAPI_sms_support_ToString(access_and_mobility_data->sms_over_nas_status)) == NULL) { ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status]"); goto end; @@ -261,15 +306,14 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit } } - if (access_and_mobility_data->rat_type) { - cJSON *rat_type = cJSON_AddArrayToObject(item, "ratType"); - if (rat_type == NULL) { + if (access_and_mobility_data->rat_type != OpenAPI_rat_type_NULL) { + cJSON *rat_typeList = cJSON_AddArrayToObject(item, "ratType"); + if (rat_typeList == NULL) { ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]"); goto end; } - OpenAPI_lnode_t *rat_type_node; - OpenAPI_list_for_each(access_and_mobility_data->rat_type, rat_type_node) { - if (cJSON_AddStringToObject(rat_type, "", OpenAPI_rat_type_ToString((intptr_t)rat_type_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_data->rat_type, node) { + if (cJSON_AddStringToObject(rat_typeList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]"); goto end; } @@ -297,43 +341,65 @@ end: OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJSON(cJSON *access_and_mobility_dataJSON) { OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_var = NULL; - cJSON *location = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "location"); - + OpenAPI_lnode_t *node = NULL; + cJSON *location = NULL; OpenAPI_user_location_t *location_local_nonprim = NULL; + cJSON *location_ts = NULL; + cJSON *time_zone = NULL; + cJSON *time_zone_ts = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *reg_states = NULL; + OpenAPI_list_t *reg_statesList = NULL; + cJSON *reg_states_ts = NULL; + cJSON *conn_states = NULL; + OpenAPI_list_t *conn_statesList = NULL; + cJSON *conn_states_ts = NULL; + cJSON *reachability_status = NULL; + OpenAPI_ue_reachability_t *reachability_status_local_nonprim = NULL; + cJSON *reachability_status_ts = NULL; + cJSON *sms_over_nas_status = NULL; + OpenAPI_sms_support_e sms_over_nas_statusVariable = 0; + cJSON *sms_over_nas_status_ts = NULL; + cJSON *roaming_status = NULL; + cJSON *roaming_status_ts = NULL; + cJSON *current_plmn = NULL; + OpenAPI_plmn_id_1_t *current_plmn_local_nonprim = NULL; + cJSON *current_plmn_ts = NULL; + cJSON *rat_type = NULL; + OpenAPI_list_t *rat_typeList = NULL; + cJSON *rat_types_ts = NULL; + cJSON *supp_feat = NULL; + location = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "location"); if (location) { location_local_nonprim = OpenAPI_user_location_parseFromJSON(location); } - cJSON *location_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "locationTs"); - + location_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "locationTs"); if (location_ts) { - if (!cJSON_IsString(location_ts)) { + if (!cJSON_IsString(location_ts) && !cJSON_IsNull(location_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [location_ts]"); goto end; } } - cJSON *time_zone = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZone"); - + time_zone = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZone"); if (time_zone) { - if (!cJSON_IsString(time_zone)) { + if (!cJSON_IsString(time_zone) && !cJSON_IsNull(time_zone)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [time_zone]"); goto end; } } - cJSON *time_zone_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZoneTs"); - + time_zone_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZoneTs"); if (time_zone_ts) { - if (!cJSON_IsString(time_zone_ts)) { + if (!cJSON_IsString(time_zone_ts) && !cJSON_IsNull(time_zone_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [time_zone_ts]"); goto end; } } - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + access_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [access_type]"); @@ -342,101 +408,86 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *reg_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStates"); - - OpenAPI_list_t *reg_statesList; + reg_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStates"); if (reg_states) { - cJSON *reg_states_local_nonprimitive; - if (!cJSON_IsArray(reg_states)){ - ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states]"); - goto end; - } - - reg_statesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(reg_states_local_nonprimitive, reg_states ) { - if (!cJSON_IsObject(reg_states_local_nonprimitive)) { + cJSON *reg_states_local = NULL; + if (!cJSON_IsArray(reg_states)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states]"); goto end; } - OpenAPI_rm_info_t *reg_statesItem = OpenAPI_rm_info_parseFromJSON(reg_states_local_nonprimitive); - if (!reg_statesItem) { - ogs_error("No reg_statesItem"); - OpenAPI_list_free(reg_statesList); - goto end; + reg_statesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(reg_states_local, reg_states) { + if (!cJSON_IsObject(reg_states_local)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states]"); + goto end; + } + OpenAPI_rm_info_t *reg_statesItem = OpenAPI_rm_info_parseFromJSON(reg_states_local); + if (!reg_statesItem) { + ogs_error("No reg_statesItem"); + OpenAPI_list_free(reg_statesList); + goto end; + } + OpenAPI_list_add(reg_statesList, reg_statesItem); } - - OpenAPI_list_add(reg_statesList, reg_statesItem); - } } - cJSON *reg_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStatesTs"); - + reg_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStatesTs"); if (reg_states_ts) { - if (!cJSON_IsString(reg_states_ts)) { + if (!cJSON_IsString(reg_states_ts) && !cJSON_IsNull(reg_states_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states_ts]"); goto end; } } - cJSON *conn_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStates"); - - OpenAPI_list_t *conn_statesList; + conn_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStates"); if (conn_states) { - cJSON *conn_states_local_nonprimitive; - if (!cJSON_IsArray(conn_states)){ - ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states]"); - goto end; - } - - conn_statesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(conn_states_local_nonprimitive, conn_states ) { - if (!cJSON_IsObject(conn_states_local_nonprimitive)) { + cJSON *conn_states_local = NULL; + if (!cJSON_IsArray(conn_states)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states]"); goto end; } - OpenAPI_cm_info_t *conn_statesItem = OpenAPI_cm_info_parseFromJSON(conn_states_local_nonprimitive); - if (!conn_statesItem) { - ogs_error("No conn_statesItem"); - OpenAPI_list_free(conn_statesList); - goto end; + conn_statesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(conn_states_local, conn_states) { + if (!cJSON_IsObject(conn_states_local)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states]"); + goto end; + } + OpenAPI_cm_info_t *conn_statesItem = OpenAPI_cm_info_parseFromJSON(conn_states_local); + if (!conn_statesItem) { + ogs_error("No conn_statesItem"); + OpenAPI_list_free(conn_statesList); + goto end; + } + OpenAPI_list_add(conn_statesList, conn_statesItem); } - - OpenAPI_list_add(conn_statesList, conn_statesItem); - } } - cJSON *conn_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStatesTs"); - + conn_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStatesTs"); if (conn_states_ts) { - if (!cJSON_IsString(conn_states_ts)) { + if (!cJSON_IsString(conn_states_ts) && !cJSON_IsNull(conn_states_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states_ts]"); goto end; } } - cJSON *reachability_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatus"); - - OpenAPI_ue_reachability_t *reachability_status_local_nonprim = NULL; + reachability_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatus"); if (reachability_status) { reachability_status_local_nonprim = OpenAPI_ue_reachability_parseFromJSON(reachability_status); } - cJSON *reachability_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatusTs"); - + reachability_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatusTs"); if (reachability_status_ts) { - if (!cJSON_IsString(reachability_status_ts)) { + if (!cJSON_IsString(reachability_status_ts) && !cJSON_IsNull(reachability_status_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reachability_status_ts]"); goto end; } } - cJSON *sms_over_nas_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatus"); - - OpenAPI_sms_support_e sms_over_nas_statusVariable; + sms_over_nas_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatus"); if (sms_over_nas_status) { if (!cJSON_IsString(sms_over_nas_status)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [sms_over_nas_status]"); @@ -445,17 +496,15 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS sms_over_nas_statusVariable = OpenAPI_sms_support_FromString(sms_over_nas_status->valuestring); } - cJSON *sms_over_nas_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatusTs"); - + sms_over_nas_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatusTs"); if (sms_over_nas_status_ts) { - if (!cJSON_IsString(sms_over_nas_status_ts)) { + if (!cJSON_IsString(sms_over_nas_status_ts) && !cJSON_IsNull(sms_over_nas_status_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [sms_over_nas_status_ts]"); goto end; } } - cJSON *roaming_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatus"); - + roaming_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatus"); if (roaming_status) { if (!cJSON_IsBool(roaming_status)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status]"); @@ -463,66 +512,57 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS } } - cJSON *roaming_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatusTs"); - + roaming_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatusTs"); if (roaming_status_ts) { - if (!cJSON_IsString(roaming_status_ts)) { + if (!cJSON_IsString(roaming_status_ts) && !cJSON_IsNull(roaming_status_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status_ts]"); goto end; } } - cJSON *current_plmn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmn"); - - OpenAPI_plmn_id_1_t *current_plmn_local_nonprim = NULL; + current_plmn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmn"); if (current_plmn) { current_plmn_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(current_plmn); } - cJSON *current_plmn_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmnTs"); - + current_plmn_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmnTs"); if (current_plmn_ts) { - if (!cJSON_IsString(current_plmn_ts)) { + if (!cJSON_IsString(current_plmn_ts) && !cJSON_IsNull(current_plmn_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [current_plmn_ts]"); goto end; } } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratType"); - - OpenAPI_list_t *rat_typeList; + rat_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratType"); if (rat_type) { - cJSON *rat_type_local_nonprimitive; - if (!cJSON_IsArray(rat_type)) { - ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]"); - goto end; - } - - rat_typeList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rat_type_local_nonprimitive, rat_type ) { - if (!cJSON_IsString(rat_type_local_nonprimitive)){ + cJSON *rat_type_local = NULL; + if (!cJSON_IsArray(rat_type)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]"); goto end; } - OpenAPI_list_add(rat_typeList, (void *)OpenAPI_rat_type_FromString(rat_type_local_nonprimitive->valuestring)); - } + rat_typeList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rat_type_local, rat_type) { + if (!cJSON_IsString(rat_type_local)) { + ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]"); + goto end; + } + OpenAPI_list_add(rat_typeList, (void *)OpenAPI_rat_type_FromString(rat_type_local->valuestring)); + } } - cJSON *rat_types_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratTypesTs"); - + rat_types_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratTypesTs"); if (rat_types_ts) { - if (!cJSON_IsString(rat_types_ts)) { + if (!cJSON_IsString(rat_types_ts) && !cJSON_IsNull(rat_types_ts)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_types_ts]"); goto end; } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [supp_feat]"); goto end; } @@ -530,30 +570,60 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS access_and_mobility_data_local_var = OpenAPI_access_and_mobility_data_create ( location ? location_local_nonprim : NULL, - location_ts ? ogs_strdup(location_ts->valuestring) : NULL, - time_zone ? ogs_strdup(time_zone->valuestring) : NULL, - time_zone_ts ? ogs_strdup(time_zone_ts->valuestring) : NULL, + location_ts && !cJSON_IsNull(location_ts) ? ogs_strdup(location_ts->valuestring) : NULL, + time_zone && !cJSON_IsNull(time_zone) ? ogs_strdup(time_zone->valuestring) : NULL, + time_zone_ts && !cJSON_IsNull(time_zone_ts) ? ogs_strdup(time_zone_ts->valuestring) : NULL, access_type ? access_typeVariable : 0, reg_states ? reg_statesList : NULL, - reg_states_ts ? ogs_strdup(reg_states_ts->valuestring) : NULL, + reg_states_ts && !cJSON_IsNull(reg_states_ts) ? ogs_strdup(reg_states_ts->valuestring) : NULL, conn_states ? conn_statesList : NULL, - conn_states_ts ? ogs_strdup(conn_states_ts->valuestring) : NULL, + conn_states_ts && !cJSON_IsNull(conn_states_ts) ? ogs_strdup(conn_states_ts->valuestring) : NULL, reachability_status ? reachability_status_local_nonprim : NULL, - reachability_status_ts ? ogs_strdup(reachability_status_ts->valuestring) : NULL, + reachability_status_ts && !cJSON_IsNull(reachability_status_ts) ? ogs_strdup(reachability_status_ts->valuestring) : NULL, sms_over_nas_status ? sms_over_nas_statusVariable : 0, - sms_over_nas_status_ts ? ogs_strdup(sms_over_nas_status_ts->valuestring) : NULL, + sms_over_nas_status_ts && !cJSON_IsNull(sms_over_nas_status_ts) ? ogs_strdup(sms_over_nas_status_ts->valuestring) : NULL, roaming_status ? true : false, roaming_status ? roaming_status->valueint : 0, - roaming_status_ts ? ogs_strdup(roaming_status_ts->valuestring) : NULL, + roaming_status_ts && !cJSON_IsNull(roaming_status_ts) ? ogs_strdup(roaming_status_ts->valuestring) : NULL, current_plmn ? current_plmn_local_nonprim : NULL, - current_plmn_ts ? ogs_strdup(current_plmn_ts->valuestring) : NULL, + current_plmn_ts && !cJSON_IsNull(current_plmn_ts) ? ogs_strdup(current_plmn_ts->valuestring) : NULL, rat_type ? rat_typeList : NULL, - rat_types_ts ? ogs_strdup(rat_types_ts->valuestring) : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + rat_types_ts && !cJSON_IsNull(rat_types_ts) ? ogs_strdup(rat_types_ts->valuestring) : NULL, + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return access_and_mobility_data_local_var; end: + if (location_local_nonprim) { + OpenAPI_user_location_free(location_local_nonprim); + location_local_nonprim = NULL; + } + if (reg_statesList) { + OpenAPI_list_for_each(reg_statesList, node) { + OpenAPI_rm_info_free(node->data); + } + OpenAPI_list_free(reg_statesList); + reg_statesList = NULL; + } + if (conn_statesList) { + OpenAPI_list_for_each(conn_statesList, node) { + OpenAPI_cm_info_free(node->data); + } + OpenAPI_list_free(conn_statesList); + conn_statesList = NULL; + } + if (reachability_status_local_nonprim) { + OpenAPI_ue_reachability_free(reachability_status_local_nonprim); + reachability_status_local_nonprim = NULL; + } + if (current_plmn_local_nonprim) { + OpenAPI_plmn_id_1_free(current_plmn_local_nonprim); + current_plmn_local_nonprim = NULL; + } + if (rat_typeList) { + OpenAPI_list_free(rat_typeList); + rat_typeList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/access_and_mobility_subscription_data.c b/lib/sbi/openapi/model/access_and_mobility_subscription_data.c index bcc54ea31..c4bcf206c 100644 --- a/lib/sbi/openapi/model/access_and_mobility_subscription_data.c +++ b/lib/sbi/openapi/model/access_and_mobility_subscription_data.c @@ -43,7 +43,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub int service_gap_time, OpenAPI_mdt_user_consent_e mdt_user_consent, OpenAPI_mdt_configuration_t *mdt_configuration, - OpenAPI_trace_data_1_t *trace_data, + OpenAPI_trace_data_t *trace_data, OpenAPI_cag_data_t *cag_data, char *stn_sr, char *c_msisdn, @@ -134,75 +134,164 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_and_mobility_subscription_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(access_and_mobility_subscription_data->supported_features); - OpenAPI_list_for_each(access_and_mobility_subscription_data->gpsis, node) { - ogs_free(node->data); + if (access_and_mobility_subscription_data->supported_features) { + ogs_free(access_and_mobility_subscription_data->supported_features); + access_and_mobility_subscription_data->supported_features = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->gpsis); - OpenAPI_list_for_each(access_and_mobility_subscription_data->internal_group_ids, node) { - ogs_free(node->data); + if (access_and_mobility_subscription_data->gpsis) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->gpsis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->gpsis); + access_and_mobility_subscription_data->gpsis = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->internal_group_ids); - OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_vn_group_data_ids, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (access_and_mobility_subscription_data->internal_group_ids) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->internal_group_ids); + access_and_mobility_subscription_data->internal_group_ids = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->shared_vn_group_data_ids); - OpenAPI_ambr_rm_free(access_and_mobility_subscription_data->subscribed_ue_ambr); - OpenAPI_nssai_free(access_and_mobility_subscription_data->nssai); - OpenAPI_list_free(access_and_mobility_subscription_data->rat_restrictions); - OpenAPI_list_for_each(access_and_mobility_subscription_data->forbidden_areas, node) { - OpenAPI_area_free(node->data); + if (access_and_mobility_subscription_data->shared_vn_group_data_ids) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(access_and_mobility_subscription_data->shared_vn_group_data_ids); + access_and_mobility_subscription_data->shared_vn_group_data_ids = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->forbidden_areas); - OpenAPI_service_area_restriction_free(access_and_mobility_subscription_data->service_area_restriction); - OpenAPI_list_free(access_and_mobility_subscription_data->core_network_type_restrictions); - OpenAPI_sor_info_free(access_and_mobility_subscription_data->sor_info); - OpenAPI_list_free(access_and_mobility_subscription_data->sor_update_indicator_list); - OpenAPI_upu_info_free(access_and_mobility_subscription_data->upu_info); - OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_am_data_ids, node) { - ogs_free(node->data); + if (access_and_mobility_subscription_data->subscribed_ue_ambr) { + OpenAPI_ambr_rm_free(access_and_mobility_subscription_data->subscribed_ue_ambr); + access_and_mobility_subscription_data->subscribed_ue_ambr = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->shared_am_data_ids); - OpenAPI_list_for_each(access_and_mobility_subscription_data->subscribed_dnn_list, node) { - ogs_free(node->data); + if (access_and_mobility_subscription_data->nssai) { + OpenAPI_nssai_free(access_and_mobility_subscription_data->nssai); + access_and_mobility_subscription_data->nssai = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->subscribed_dnn_list); - OpenAPI_mdt_configuration_free(access_and_mobility_subscription_data->mdt_configuration); - OpenAPI_trace_data_1_free(access_and_mobility_subscription_data->trace_data); - OpenAPI_cag_data_free(access_and_mobility_subscription_data->cag_data); - ogs_free(access_and_mobility_subscription_data->stn_sr); - ogs_free(access_and_mobility_subscription_data->c_msisdn); - ogs_free(access_and_mobility_subscription_data->rg_wireline_characteristics); - OpenAPI_ec_restriction_data_wb_free(access_and_mobility_subscription_data->ec_restriction_data_wb); - OpenAPI_expected_ue_behaviour_data_free(access_and_mobility_subscription_data->expected_ue_behaviour_list); - OpenAPI_list_free(access_and_mobility_subscription_data->primary_rat_restrictions); - OpenAPI_list_free(access_and_mobility_subscription_data->secondary_rat_restrictions); - OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, node) { - OpenAPI_edrx_parameters_free(node->data); + if (access_and_mobility_subscription_data->rat_restrictions) { + OpenAPI_list_free(access_and_mobility_subscription_data->rat_restrictions); + access_and_mobility_subscription_data->rat_restrictions = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->edrx_parameters_list); - OpenAPI_list_for_each(access_and_mobility_subscription_data->ptw_parameters_list, node) { - OpenAPI_ptw_parameters_free(node->data); + if (access_and_mobility_subscription_data->forbidden_areas) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->forbidden_areas, node) { + OpenAPI_area_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->forbidden_areas); + access_and_mobility_subscription_data->forbidden_areas = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->ptw_parameters_list); - OpenAPI_list_for_each(access_and_mobility_subscription_data->wireline_forbidden_areas, node) { - OpenAPI_wireline_area_free(node->data); + if (access_and_mobility_subscription_data->service_area_restriction) { + OpenAPI_service_area_restriction_free(access_and_mobility_subscription_data->service_area_restriction); + access_and_mobility_subscription_data->service_area_restriction = NULL; + } + if (access_and_mobility_subscription_data->core_network_type_restrictions) { + OpenAPI_list_free(access_and_mobility_subscription_data->core_network_type_restrictions); + access_and_mobility_subscription_data->core_network_type_restrictions = NULL; + } + if (access_and_mobility_subscription_data->sor_info) { + OpenAPI_sor_info_free(access_and_mobility_subscription_data->sor_info); + access_and_mobility_subscription_data->sor_info = NULL; + } + if (access_and_mobility_subscription_data->sor_update_indicator_list) { + OpenAPI_list_free(access_and_mobility_subscription_data->sor_update_indicator_list); + access_and_mobility_subscription_data->sor_update_indicator_list = NULL; + } + if (access_and_mobility_subscription_data->upu_info) { + OpenAPI_upu_info_free(access_and_mobility_subscription_data->upu_info); + access_and_mobility_subscription_data->upu_info = NULL; + } + if (access_and_mobility_subscription_data->shared_am_data_ids) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_am_data_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->shared_am_data_ids); + access_and_mobility_subscription_data->shared_am_data_ids = NULL; + } + if (access_and_mobility_subscription_data->subscribed_dnn_list) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->subscribed_dnn_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->subscribed_dnn_list); + access_and_mobility_subscription_data->subscribed_dnn_list = NULL; + } + if (access_and_mobility_subscription_data->mdt_configuration) { + OpenAPI_mdt_configuration_free(access_and_mobility_subscription_data->mdt_configuration); + access_and_mobility_subscription_data->mdt_configuration = NULL; + } + if (access_and_mobility_subscription_data->trace_data) { + OpenAPI_trace_data_free(access_and_mobility_subscription_data->trace_data); + access_and_mobility_subscription_data->trace_data = NULL; + } + if (access_and_mobility_subscription_data->cag_data) { + OpenAPI_cag_data_free(access_and_mobility_subscription_data->cag_data); + access_and_mobility_subscription_data->cag_data = NULL; + } + if (access_and_mobility_subscription_data->stn_sr) { + ogs_free(access_and_mobility_subscription_data->stn_sr); + access_and_mobility_subscription_data->stn_sr = NULL; + } + if (access_and_mobility_subscription_data->c_msisdn) { + ogs_free(access_and_mobility_subscription_data->c_msisdn); + access_and_mobility_subscription_data->c_msisdn = NULL; + } + if (access_and_mobility_subscription_data->rg_wireline_characteristics) { + ogs_free(access_and_mobility_subscription_data->rg_wireline_characteristics); + access_and_mobility_subscription_data->rg_wireline_characteristics = NULL; + } + if (access_and_mobility_subscription_data->ec_restriction_data_wb) { + OpenAPI_ec_restriction_data_wb_free(access_and_mobility_subscription_data->ec_restriction_data_wb); + access_and_mobility_subscription_data->ec_restriction_data_wb = NULL; + } + if (access_and_mobility_subscription_data->expected_ue_behaviour_list) { + OpenAPI_expected_ue_behaviour_data_free(access_and_mobility_subscription_data->expected_ue_behaviour_list); + access_and_mobility_subscription_data->expected_ue_behaviour_list = NULL; + } + if (access_and_mobility_subscription_data->primary_rat_restrictions) { + OpenAPI_list_free(access_and_mobility_subscription_data->primary_rat_restrictions); + access_and_mobility_subscription_data->primary_rat_restrictions = NULL; + } + if (access_and_mobility_subscription_data->secondary_rat_restrictions) { + OpenAPI_list_free(access_and_mobility_subscription_data->secondary_rat_restrictions); + access_and_mobility_subscription_data->secondary_rat_restrictions = NULL; + } + if (access_and_mobility_subscription_data->edrx_parameters_list) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, node) { + OpenAPI_edrx_parameters_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->edrx_parameters_list); + access_and_mobility_subscription_data->edrx_parameters_list = NULL; + } + if (access_and_mobility_subscription_data->ptw_parameters_list) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->ptw_parameters_list, node) { + OpenAPI_ptw_parameters_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->ptw_parameters_list); + access_and_mobility_subscription_data->ptw_parameters_list = NULL; + } + if (access_and_mobility_subscription_data->wireline_forbidden_areas) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->wireline_forbidden_areas, node) { + OpenAPI_wireline_area_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data->wireline_forbidden_areas); + access_and_mobility_subscription_data->wireline_forbidden_areas = NULL; + } + if (access_and_mobility_subscription_data->wireline_service_area_restriction) { + OpenAPI_wireline_service_area_restriction_free(access_and_mobility_subscription_data->wireline_service_area_restriction); + access_and_mobility_subscription_data->wireline_service_area_restriction = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data->wireline_forbidden_areas); - OpenAPI_wireline_service_area_restriction_free(access_and_mobility_subscription_data->wireline_service_area_restriction); ogs_free(access_and_mobility_subscription_data); } cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_and_mobility_subscription_data == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [AccessAndMobilitySubscriptionData]"); @@ -218,35 +307,31 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } if (access_and_mobility_subscription_data->gpsis) { - cJSON *gpsis = cJSON_AddArrayToObject(item, "gpsis"); - if (gpsis == NULL) { + cJSON *gpsisList = cJSON_AddArrayToObject(item, "gpsis"); + if (gpsisList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [gpsis]"); goto end; } - - OpenAPI_lnode_t *gpsis_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->gpsis, gpsis_node) { - if (cJSON_AddStringToObject(gpsis, "", (char*)gpsis_node->data) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [gpsis]"); - goto end; + OpenAPI_list_for_each(access_and_mobility_subscription_data->gpsis, node) { + if (cJSON_AddStringToObject(gpsisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [gpsis]"); + goto end; + } } - } } if (access_and_mobility_subscription_data->internal_group_ids) { - cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); - if (internal_group_ids == NULL) { + cJSON *internal_group_idsList = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_idsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [internal_group_ids]"); goto end; } - - OpenAPI_lnode_t *internal_group_ids_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->internal_group_ids, internal_group_ids_node) { - if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [internal_group_ids]"); - goto end; + OpenAPI_list_for_each(access_and_mobility_subscription_data->internal_group_ids, node) { + if (cJSON_AddStringToObject(internal_group_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [internal_group_ids]"); + goto end; + } } - } } if (access_and_mobility_subscription_data->shared_vn_group_data_ids) { @@ -256,17 +341,16 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces goto end; } cJSON *localMapObject = shared_vn_group_data_ids; - OpenAPI_lnode_t *shared_vn_group_data_ids_node; if (access_and_mobility_subscription_data->shared_vn_group_data_ids) { - OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_vn_group_data_ids, shared_vn_group_data_ids_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_vn_group_data_ids_node->data; - if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [inner]"); + goto end; } } } + } if (access_and_mobility_subscription_data->subscribed_ue_ambr) { cJSON *subscribed_ue_ambr_local_JSON = OpenAPI_ambr_rm_convertToJSON(access_and_mobility_subscription_data->subscribed_ue_ambr); @@ -294,15 +378,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } } - if (access_and_mobility_subscription_data->rat_restrictions) { - cJSON *rat_restrictions = cJSON_AddArrayToObject(item, "ratRestrictions"); - if (rat_restrictions == NULL) { + if (access_and_mobility_subscription_data->rat_restrictions != OpenAPI_rat_type_NULL) { + cJSON *rat_restrictionsList = cJSON_AddArrayToObject(item, "ratRestrictions"); + if (rat_restrictionsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]"); goto end; } - OpenAPI_lnode_t *rat_restrictions_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, rat_restrictions_node) { - if (cJSON_AddStringToObject(rat_restrictions, "", OpenAPI_rat_type_ToString((intptr_t)rat_restrictions_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, node) { + if (cJSON_AddStringToObject(rat_restrictionsList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]"); goto end; } @@ -315,17 +398,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [forbidden_areas]"); goto end; } - - OpenAPI_lnode_t *forbidden_areas_node; - if (access_and_mobility_subscription_data->forbidden_areas) { - OpenAPI_list_for_each(access_and_mobility_subscription_data->forbidden_areas, forbidden_areas_node) { - cJSON *itemLocal = OpenAPI_area_convertToJSON(forbidden_areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [forbidden_areas]"); - goto end; - } - cJSON_AddItemToArray(forbidden_areasList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_subscription_data->forbidden_areas, node) { + cJSON *itemLocal = OpenAPI_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [forbidden_areas]"); + goto end; } + cJSON_AddItemToArray(forbidden_areasList, itemLocal); } } @@ -342,15 +421,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } } - if (access_and_mobility_subscription_data->core_network_type_restrictions) { - cJSON *core_network_type_restrictions = cJSON_AddArrayToObject(item, "coreNetworkTypeRestrictions"); - if (core_network_type_restrictions == NULL) { + if (access_and_mobility_subscription_data->core_network_type_restrictions != OpenAPI_core_network_type_NULL) { + cJSON *core_network_type_restrictionsList = cJSON_AddArrayToObject(item, "coreNetworkTypeRestrictions"); + if (core_network_type_restrictionsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [core_network_type_restrictions]"); goto end; } - OpenAPI_lnode_t *core_network_type_restrictions_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->core_network_type_restrictions, core_network_type_restrictions_node) { - if (cJSON_AddStringToObject(core_network_type_restrictions, "", OpenAPI_core_network_type_ToString((intptr_t)core_network_type_restrictions_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->core_network_type_restrictions, node) { + if (cJSON_AddStringToObject(core_network_type_restrictionsList, "", OpenAPI_core_network_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [core_network_type_restrictions]"); goto end; } @@ -426,15 +504,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } } - if (access_and_mobility_subscription_data->sor_update_indicator_list) { - cJSON *sor_update_indicator_list = cJSON_AddArrayToObject(item, "sorUpdateIndicatorList"); - if (sor_update_indicator_list == NULL) { + if (access_and_mobility_subscription_data->sor_update_indicator_list != OpenAPI_sor_update_indicator_NULL) { + cJSON *sor_update_indicator_listList = cJSON_AddArrayToObject(item, "sorUpdateIndicatorList"); + if (sor_update_indicator_listList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_update_indicator_list]"); goto end; } - OpenAPI_lnode_t *sor_update_indicator_list_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->sor_update_indicator_list, sor_update_indicator_list_node) { - if (cJSON_AddStringToObject(sor_update_indicator_list, "", OpenAPI_sor_update_indicator_ToString((intptr_t)sor_update_indicator_list_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->sor_update_indicator_list, node) { + if (cJSON_AddStringToObject(sor_update_indicator_listList, "", OpenAPI_sor_update_indicator_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_update_indicator_list]"); goto end; } @@ -462,22 +539,20 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } if (access_and_mobility_subscription_data->shared_am_data_ids) { - cJSON *shared_am_data_ids = cJSON_AddArrayToObject(item, "sharedAmDataIds"); - if (shared_am_data_ids == NULL) { + cJSON *shared_am_data_idsList = cJSON_AddArrayToObject(item, "sharedAmDataIds"); + if (shared_am_data_idsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [shared_am_data_ids]"); goto end; } - - OpenAPI_lnode_t *shared_am_data_ids_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_am_data_ids, shared_am_data_ids_node) { - if (cJSON_AddStringToObject(shared_am_data_ids, "", (char*)shared_am_data_ids_node->data) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [shared_am_data_ids]"); - goto end; + OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_am_data_ids, node) { + if (cJSON_AddStringToObject(shared_am_data_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [shared_am_data_ids]"); + goto end; + } } - } } - if (access_and_mobility_subscription_data->odb_packet_services) { + if (access_and_mobility_subscription_data->odb_packet_services != OpenAPI_odb_packet_services_NULL) { if (cJSON_AddStringToObject(item, "odbPacketServices", OpenAPI_odb_packet_services_ToString(access_and_mobility_subscription_data->odb_packet_services)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [odb_packet_services]"); goto end; @@ -485,19 +560,17 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } if (access_and_mobility_subscription_data->subscribed_dnn_list) { - cJSON *subscribed_dnn_list = cJSON_AddArrayToObject(item, "subscribedDnnList"); - if (subscribed_dnn_list == NULL) { + cJSON *subscribed_dnn_listList = cJSON_AddArrayToObject(item, "subscribedDnnList"); + if (subscribed_dnn_listList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [subscribed_dnn_list]"); goto end; } - - OpenAPI_lnode_t *subscribed_dnn_list_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->subscribed_dnn_list, subscribed_dnn_list_node) { - if (cJSON_AddStringToObject(subscribed_dnn_list, "", (char*)subscribed_dnn_list_node->data) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [subscribed_dnn_list]"); - goto end; + OpenAPI_list_for_each(access_and_mobility_subscription_data->subscribed_dnn_list, node) { + if (cJSON_AddStringToObject(subscribed_dnn_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [subscribed_dnn_list]"); + goto end; + } } - } } if (access_and_mobility_subscription_data->is_service_gap_time) { @@ -507,7 +580,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } } - if (access_and_mobility_subscription_data->mdt_user_consent) { + if (access_and_mobility_subscription_data->mdt_user_consent != OpenAPI_mdt_user_consent_NULL) { if (cJSON_AddStringToObject(item, "mdtUserConsent", OpenAPI_mdt_user_consent_ToString(access_and_mobility_subscription_data->mdt_user_consent)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mdt_user_consent]"); goto end; @@ -528,7 +601,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } if (access_and_mobility_subscription_data->trace_data) { - cJSON *trace_data_local_JSON = OpenAPI_trace_data_1_convertToJSON(access_and_mobility_subscription_data->trace_data); + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(access_and_mobility_subscription_data->trace_data); if (trace_data_local_JSON == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [trace_data]"); goto end; @@ -621,30 +694,28 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces } } - if (access_and_mobility_subscription_data->primary_rat_restrictions) { - cJSON *primary_rat_restrictions = cJSON_AddArrayToObject(item, "primaryRatRestrictions"); - if (primary_rat_restrictions == NULL) { + if (access_and_mobility_subscription_data->primary_rat_restrictions != OpenAPI_rat_type_NULL) { + cJSON *primary_rat_restrictionsList = cJSON_AddArrayToObject(item, "primaryRatRestrictions"); + if (primary_rat_restrictionsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]"); goto end; } - OpenAPI_lnode_t *primary_rat_restrictions_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, primary_rat_restrictions_node) { - if (cJSON_AddStringToObject(primary_rat_restrictions, "", OpenAPI_rat_type_ToString((intptr_t)primary_rat_restrictions_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, node) { + if (cJSON_AddStringToObject(primary_rat_restrictionsList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]"); goto end; } } } - if (access_and_mobility_subscription_data->secondary_rat_restrictions) { - cJSON *secondary_rat_restrictions = cJSON_AddArrayToObject(item, "secondaryRatRestrictions"); - if (secondary_rat_restrictions == NULL) { + if (access_and_mobility_subscription_data->secondary_rat_restrictions != OpenAPI_rat_type_NULL) { + cJSON *secondary_rat_restrictionsList = cJSON_AddArrayToObject(item, "secondaryRatRestrictions"); + if (secondary_rat_restrictionsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]"); goto end; } - OpenAPI_lnode_t *secondary_rat_restrictions_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, secondary_rat_restrictions_node) { - if (cJSON_AddStringToObject(secondary_rat_restrictions, "", OpenAPI_rat_type_ToString((intptr_t)secondary_rat_restrictions_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, node) { + if (cJSON_AddStringToObject(secondary_rat_restrictionsList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]"); goto end; } @@ -657,17 +728,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [edrx_parameters_list]"); goto end; } - - OpenAPI_lnode_t *edrx_parameters_list_node; - if (access_and_mobility_subscription_data->edrx_parameters_list) { - OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, edrx_parameters_list_node) { - cJSON *itemLocal = OpenAPI_edrx_parameters_convertToJSON(edrx_parameters_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [edrx_parameters_list]"); - goto end; - } - cJSON_AddItemToArray(edrx_parameters_listList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, node) { + cJSON *itemLocal = OpenAPI_edrx_parameters_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [edrx_parameters_list]"); + goto end; } + cJSON_AddItemToArray(edrx_parameters_listList, itemLocal); } } @@ -677,17 +744,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ptw_parameters_list]"); goto end; } - - OpenAPI_lnode_t *ptw_parameters_list_node; - if (access_and_mobility_subscription_data->ptw_parameters_list) { - OpenAPI_list_for_each(access_and_mobility_subscription_data->ptw_parameters_list, ptw_parameters_list_node) { - cJSON *itemLocal = OpenAPI_ptw_parameters_convertToJSON(ptw_parameters_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ptw_parameters_list]"); - goto end; - } - cJSON_AddItemToArray(ptw_parameters_listList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_subscription_data->ptw_parameters_list, node) { + cJSON *itemLocal = OpenAPI_ptw_parameters_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ptw_parameters_list]"); + goto end; } + cJSON_AddItemToArray(ptw_parameters_listList, itemLocal); } } @@ -704,17 +767,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [wireline_forbidden_areas]"); goto end; } - - OpenAPI_lnode_t *wireline_forbidden_areas_node; - if (access_and_mobility_subscription_data->wireline_forbidden_areas) { - OpenAPI_list_for_each(access_and_mobility_subscription_data->wireline_forbidden_areas, wireline_forbidden_areas_node) { - cJSON *itemLocal = OpenAPI_wireline_area_convertToJSON(wireline_forbidden_areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [wireline_forbidden_areas]"); - goto end; - } - cJSON_AddItemToArray(wireline_forbidden_areasList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_subscription_data->wireline_forbidden_areas, node) { + cJSON *itemLocal = OpenAPI_wireline_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [wireline_forbidden_areas]"); + goto end; } + cJSON_AddItemToArray(wireline_forbidden_areasList, itemLocal); } } @@ -738,173 +797,232 @@ end: OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_parseFromJSON(cJSON *access_and_mobility_subscription_dataJSON) { OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *gpsis = NULL; + OpenAPI_list_t *gpsisList = NULL; + cJSON *internal_group_ids = NULL; + OpenAPI_list_t *internal_group_idsList = NULL; + cJSON *shared_vn_group_data_ids = NULL; + OpenAPI_list_t *shared_vn_group_data_idsList = NULL; + cJSON *subscribed_ue_ambr = NULL; + OpenAPI_ambr_rm_t *subscribed_ue_ambr_local_nonprim = NULL; + cJSON *nssai = NULL; + OpenAPI_nssai_t *nssai_local_nonprim = NULL; + cJSON *rat_restrictions = NULL; + OpenAPI_list_t *rat_restrictionsList = NULL; + cJSON *forbidden_areas = NULL; + OpenAPI_list_t *forbidden_areasList = NULL; + cJSON *service_area_restriction = NULL; + OpenAPI_service_area_restriction_t *service_area_restriction_local_nonprim = NULL; + cJSON *core_network_type_restrictions = NULL; + OpenAPI_list_t *core_network_type_restrictionsList = NULL; + cJSON *rfsp_index = NULL; + cJSON *subs_reg_timer = NULL; + cJSON *ue_usage_type = NULL; + cJSON *mps_priority = NULL; + cJSON *mcs_priority = NULL; + cJSON *active_time = NULL; + cJSON *sor_info = NULL; + OpenAPI_sor_info_t *sor_info_local_nonprim = NULL; + cJSON *sor_info_expect_ind = NULL; + cJSON *soraf_retrieval = NULL; + cJSON *sor_update_indicator_list = NULL; + OpenAPI_list_t *sor_update_indicator_listList = NULL; + cJSON *upu_info = NULL; + OpenAPI_upu_info_t *upu_info_local_nonprim = NULL; + cJSON *mico_allowed = NULL; + cJSON *shared_am_data_ids = NULL; + OpenAPI_list_t *shared_am_data_idsList = NULL; + cJSON *odb_packet_services = NULL; + OpenAPI_odb_packet_services_e odb_packet_servicesVariable = 0; + cJSON *subscribed_dnn_list = NULL; + OpenAPI_list_t *subscribed_dnn_listList = NULL; + cJSON *service_gap_time = NULL; + cJSON *mdt_user_consent = NULL; + OpenAPI_mdt_user_consent_e mdt_user_consentVariable = 0; + cJSON *mdt_configuration = NULL; + OpenAPI_mdt_configuration_t *mdt_configuration_local_nonprim = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *cag_data = NULL; + OpenAPI_cag_data_t *cag_data_local_nonprim = NULL; + cJSON *stn_sr = NULL; + cJSON *c_msisdn = NULL; + cJSON *nb_io_tue_priority = NULL; + cJSON *nssai_inclusion_allowed = NULL; + cJSON *rg_wireline_characteristics = NULL; + cJSON *ec_restriction_data_wb = NULL; + OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL; + cJSON *ec_restriction_data_nb = NULL; + cJSON *expected_ue_behaviour_list = NULL; + OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_list_local_nonprim = NULL; + cJSON *primary_rat_restrictions = NULL; + OpenAPI_list_t *primary_rat_restrictionsList = NULL; + cJSON *secondary_rat_restrictions = NULL; + OpenAPI_list_t *secondary_rat_restrictionsList = NULL; + cJSON *edrx_parameters_list = NULL; + OpenAPI_list_t *edrx_parameters_listList = NULL; + cJSON *ptw_parameters_list = NULL; + OpenAPI_list_t *ptw_parameters_listList = NULL; + cJSON *iab_operation_allowed = NULL; + cJSON *wireline_forbidden_areas = NULL; + OpenAPI_list_t *wireline_forbidden_areasList = NULL; + cJSON *wireline_service_area_restriction = NULL; + OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction_local_nonprim = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *gpsis = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "gpsis"); - - OpenAPI_list_t *gpsisList; + gpsis = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "gpsis"); if (gpsis) { - cJSON *gpsis_local; - if (!cJSON_IsArray(gpsis)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [gpsis]"); - goto end; - } - gpsisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(gpsis_local, gpsis) { - if (!cJSON_IsString(gpsis_local)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [gpsis]"); - goto end; - } - OpenAPI_list_add(gpsisList, ogs_strdup(gpsis_local->valuestring)); - } - } - - cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "internalGroupIds"); - - OpenAPI_list_t *internal_group_idsList; - if (internal_group_ids) { - cJSON *internal_group_ids_local; - if (!cJSON_IsArray(internal_group_ids)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - internal_group_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { - if (!cJSON_IsString(internal_group_ids_local)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); - } - } - - cJSON *shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sharedVnGroupDataIds"); - - OpenAPI_list_t *shared_vn_group_data_idsList; - if (shared_vn_group_data_ids) { - cJSON *shared_vn_group_data_ids_local_map; - if (!cJSON_IsObject(shared_vn_group_data_ids)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_vn_group_data_ids]"); - goto end; - } - shared_vn_group_data_idsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { - cJSON *localMapObject = shared_vn_group_data_ids_local_map; - if (!cJSON_IsString(localMapObject)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [inner]"); + cJSON *gpsis_local = NULL; + if (!cJSON_IsArray(gpsis)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [gpsis]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); - } + + gpsisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsis_local, gpsis) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(gpsis_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [gpsis]"); + goto end; + } + OpenAPI_list_add(gpsisList, ogs_strdup(gpsis_local->valuestring)); + } } - cJSON *subscribed_ue_ambr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subscribedUeAmbr"); + internal_group_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "internalGroupIds"); + if (internal_group_ids) { + cJSON *internal_group_ids_local = NULL; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [internal_group_ids]"); + goto end; + } - OpenAPI_ambr_rm_t *subscribed_ue_ambr_local_nonprim = NULL; + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } + } + + shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sharedVnGroupDataIds"); + if (shared_vn_group_data_ids) { + cJSON *shared_vn_group_data_ids_local_map = NULL; + if (!cJSON_IsObject(shared_vn_group_data_ids) && !cJSON_IsNull(shared_vn_group_data_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_vn_group_data_ids]"); + goto end; + } + if (cJSON_IsObject(shared_vn_group_data_ids)) { + shared_vn_group_data_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { + cJSON *localMapObject = shared_vn_group_data_ids_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [inner]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); + } + } + } + + subscribed_ue_ambr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subscribedUeAmbr"); if (subscribed_ue_ambr) { subscribed_ue_ambr_local_nonprim = OpenAPI_ambr_rm_parseFromJSON(subscribed_ue_ambr); } - cJSON *nssai = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nssai"); - - OpenAPI_nssai_t *nssai_local_nonprim = NULL; + nssai = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nssai"); if (nssai) { nssai_local_nonprim = OpenAPI_nssai_parseFromJSON(nssai); } - cJSON *rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ratRestrictions"); - - OpenAPI_list_t *rat_restrictionsList; + rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ratRestrictions"); if (rat_restrictions) { - cJSON *rat_restrictions_local_nonprimitive; - if (!cJSON_IsArray(rat_restrictions)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rat_restrictions]"); - goto end; - } - - rat_restrictionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rat_restrictions_local_nonprimitive, rat_restrictions ) { - if (!cJSON_IsString(rat_restrictions_local_nonprimitive)){ + cJSON *rat_restrictions_local = NULL; + if (!cJSON_IsArray(rat_restrictions)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rat_restrictions]"); goto end; } - OpenAPI_list_add(rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(rat_restrictions_local_nonprimitive->valuestring)); - } + rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rat_restrictions_local, rat_restrictions) { + if (!cJSON_IsString(rat_restrictions_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rat_restrictions]"); + goto end; + } + OpenAPI_list_add(rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(rat_restrictions_local->valuestring)); + } } - cJSON *forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "forbiddenAreas"); - - OpenAPI_list_t *forbidden_areasList; + forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "forbiddenAreas"); if (forbidden_areas) { - cJSON *forbidden_areas_local_nonprimitive; - if (!cJSON_IsArray(forbidden_areas)){ - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [forbidden_areas]"); - goto end; - } - - forbidden_areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(forbidden_areas_local_nonprimitive, forbidden_areas ) { - if (!cJSON_IsObject(forbidden_areas_local_nonprimitive)) { + cJSON *forbidden_areas_local = NULL; + if (!cJSON_IsArray(forbidden_areas)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [forbidden_areas]"); goto end; } - OpenAPI_area_t *forbidden_areasItem = OpenAPI_area_parseFromJSON(forbidden_areas_local_nonprimitive); - if (!forbidden_areasItem) { - ogs_error("No forbidden_areasItem"); - OpenAPI_list_free(forbidden_areasList); - goto end; + forbidden_areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(forbidden_areas_local, forbidden_areas) { + if (!cJSON_IsObject(forbidden_areas_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [forbidden_areas]"); + goto end; + } + OpenAPI_area_t *forbidden_areasItem = OpenAPI_area_parseFromJSON(forbidden_areas_local); + if (!forbidden_areasItem) { + ogs_error("No forbidden_areasItem"); + OpenAPI_list_free(forbidden_areasList); + goto end; + } + OpenAPI_list_add(forbidden_areasList, forbidden_areasItem); } - - OpenAPI_list_add(forbidden_areasList, forbidden_areasItem); - } } - cJSON *service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "serviceAreaRestriction"); - - OpenAPI_service_area_restriction_t *service_area_restriction_local_nonprim = NULL; + service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "serviceAreaRestriction"); if (service_area_restriction) { service_area_restriction_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(service_area_restriction); } - cJSON *core_network_type_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "coreNetworkTypeRestrictions"); - - OpenAPI_list_t *core_network_type_restrictionsList; + core_network_type_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "coreNetworkTypeRestrictions"); if (core_network_type_restrictions) { - cJSON *core_network_type_restrictions_local_nonprimitive; - if (!cJSON_IsArray(core_network_type_restrictions)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [core_network_type_restrictions]"); - goto end; - } - - core_network_type_restrictionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(core_network_type_restrictions_local_nonprimitive, core_network_type_restrictions ) { - if (!cJSON_IsString(core_network_type_restrictions_local_nonprimitive)){ + cJSON *core_network_type_restrictions_local = NULL; + if (!cJSON_IsArray(core_network_type_restrictions)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [core_network_type_restrictions]"); goto end; } - OpenAPI_list_add(core_network_type_restrictionsList, (void *)OpenAPI_core_network_type_FromString(core_network_type_restrictions_local_nonprimitive->valuestring)); - } + core_network_type_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(core_network_type_restrictions_local, core_network_type_restrictions) { + if (!cJSON_IsString(core_network_type_restrictions_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [core_network_type_restrictions]"); + goto end; + } + OpenAPI_list_add(core_network_type_restrictionsList, (void *)OpenAPI_core_network_type_FromString(core_network_type_restrictions_local->valuestring)); + } } - cJSON *rfsp_index = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "rfspIndex"); - + rfsp_index = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "rfspIndex"); if (rfsp_index) { if (!cJSON_IsNumber(rfsp_index)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rfsp_index]"); @@ -912,8 +1030,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *subs_reg_timer = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subsRegTimer"); - + subs_reg_timer = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subsRegTimer"); if (subs_reg_timer) { if (!cJSON_IsNumber(subs_reg_timer)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [subs_reg_timer]"); @@ -921,8 +1038,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *ue_usage_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ueUsageType"); - + ue_usage_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ueUsageType"); if (ue_usage_type) { if (!cJSON_IsNumber(ue_usage_type)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ue_usage_type]"); @@ -930,8 +1046,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *mps_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mpsPriority"); - + mps_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mpsPriority"); if (mps_priority) { if (!cJSON_IsBool(mps_priority)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [mps_priority]"); @@ -939,8 +1054,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *mcs_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mcsPriority"); - + mcs_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mcsPriority"); if (mcs_priority) { if (!cJSON_IsBool(mcs_priority)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [mcs_priority]"); @@ -948,8 +1062,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *active_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "activeTime"); - + active_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "activeTime"); if (active_time) { if (!cJSON_IsNumber(active_time)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [active_time]"); @@ -957,15 +1070,12 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *sor_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorInfo"); - - OpenAPI_sor_info_t *sor_info_local_nonprim = NULL; + sor_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorInfo"); if (sor_info) { sor_info_local_nonprim = OpenAPI_sor_info_parseFromJSON(sor_info); } - cJSON *sor_info_expect_ind = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorInfoExpectInd"); - + sor_info_expect_ind = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorInfoExpectInd"); if (sor_info_expect_ind) { if (!cJSON_IsBool(sor_info_expect_ind)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [sor_info_expect_ind]"); @@ -973,8 +1083,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *soraf_retrieval = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorafRetrieval"); - + soraf_retrieval = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorafRetrieval"); if (soraf_retrieval) { if (!cJSON_IsBool(soraf_retrieval)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [soraf_retrieval]"); @@ -982,37 +1091,31 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *sor_update_indicator_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorUpdateIndicatorList"); - - OpenAPI_list_t *sor_update_indicator_listList; + sor_update_indicator_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorUpdateIndicatorList"); if (sor_update_indicator_list) { - cJSON *sor_update_indicator_list_local_nonprimitive; - if (!cJSON_IsArray(sor_update_indicator_list)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [sor_update_indicator_list]"); - goto end; - } - - sor_update_indicator_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sor_update_indicator_list_local_nonprimitive, sor_update_indicator_list ) { - if (!cJSON_IsString(sor_update_indicator_list_local_nonprimitive)){ + cJSON *sor_update_indicator_list_local = NULL; + if (!cJSON_IsArray(sor_update_indicator_list)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [sor_update_indicator_list]"); goto end; } - OpenAPI_list_add(sor_update_indicator_listList, (void *)OpenAPI_sor_update_indicator_FromString(sor_update_indicator_list_local_nonprimitive->valuestring)); - } + sor_update_indicator_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sor_update_indicator_list_local, sor_update_indicator_list) { + if (!cJSON_IsString(sor_update_indicator_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [sor_update_indicator_list]"); + goto end; + } + OpenAPI_list_add(sor_update_indicator_listList, (void *)OpenAPI_sor_update_indicator_FromString(sor_update_indicator_list_local->valuestring)); + } } - cJSON *upu_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "upuInfo"); - - OpenAPI_upu_info_t *upu_info_local_nonprim = NULL; + upu_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "upuInfo"); if (upu_info) { upu_info_local_nonprim = OpenAPI_upu_info_parseFromJSON(upu_info); } - cJSON *mico_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "micoAllowed"); - + mico_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "micoAllowed"); if (mico_allowed) { if (!cJSON_IsBool(mico_allowed)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [mico_allowed]"); @@ -1020,29 +1123,28 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *shared_am_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sharedAmDataIds"); - - OpenAPI_list_t *shared_am_data_idsList; + shared_am_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sharedAmDataIds"); if (shared_am_data_ids) { - cJSON *shared_am_data_ids_local; - if (!cJSON_IsArray(shared_am_data_ids)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_am_data_ids]"); - goto end; - } - shared_am_data_idsList = OpenAPI_list_create(); + cJSON *shared_am_data_ids_local = NULL; + if (!cJSON_IsArray(shared_am_data_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_am_data_ids]"); + goto end; + } - cJSON_ArrayForEach(shared_am_data_ids_local, shared_am_data_ids) { - if (!cJSON_IsString(shared_am_data_ids_local)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_am_data_ids]"); - goto end; - } - OpenAPI_list_add(shared_am_data_idsList, ogs_strdup(shared_am_data_ids_local->valuestring)); - } + shared_am_data_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(shared_am_data_ids_local, shared_am_data_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(shared_am_data_ids_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [shared_am_data_ids]"); + goto end; + } + OpenAPI_list_add(shared_am_data_idsList, ogs_strdup(shared_am_data_ids_local->valuestring)); + } } - cJSON *odb_packet_services = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "odbPacketServices"); - - OpenAPI_odb_packet_services_e odb_packet_servicesVariable; + odb_packet_services = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "odbPacketServices"); if (odb_packet_services) { if (!cJSON_IsString(odb_packet_services)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [odb_packet_services]"); @@ -1051,28 +1153,28 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub odb_packet_servicesVariable = OpenAPI_odb_packet_services_FromString(odb_packet_services->valuestring); } - cJSON *subscribed_dnn_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subscribedDnnList"); - - OpenAPI_list_t *subscribed_dnn_listList; + subscribed_dnn_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subscribedDnnList"); if (subscribed_dnn_list) { - cJSON *subscribed_dnn_list_local; - if (!cJSON_IsArray(subscribed_dnn_list)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [subscribed_dnn_list]"); - goto end; - } - subscribed_dnn_listList = OpenAPI_list_create(); + cJSON *subscribed_dnn_list_local = NULL; + if (!cJSON_IsArray(subscribed_dnn_list)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [subscribed_dnn_list]"); + goto end; + } - cJSON_ArrayForEach(subscribed_dnn_list_local, subscribed_dnn_list) { - if (!cJSON_IsString(subscribed_dnn_list_local)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [subscribed_dnn_list]"); - goto end; - } - OpenAPI_list_add(subscribed_dnn_listList, ogs_strdup(subscribed_dnn_list_local->valuestring)); - } + subscribed_dnn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscribed_dnn_list_local, subscribed_dnn_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(subscribed_dnn_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [subscribed_dnn_list]"); + goto end; + } + OpenAPI_list_add(subscribed_dnn_listList, ogs_strdup(subscribed_dnn_list_local->valuestring)); + } } - cJSON *service_gap_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "serviceGapTime"); - + service_gap_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "serviceGapTime"); if (service_gap_time) { if (!cJSON_IsNumber(service_gap_time)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [service_gap_time]"); @@ -1080,9 +1182,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *mdt_user_consent = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mdtUserConsent"); - - OpenAPI_mdt_user_consent_e mdt_user_consentVariable; + mdt_user_consent = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mdtUserConsent"); if (mdt_user_consent) { if (!cJSON_IsString(mdt_user_consent)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [mdt_user_consent]"); @@ -1091,47 +1191,38 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub mdt_user_consentVariable = OpenAPI_mdt_user_consent_FromString(mdt_user_consent->valuestring); } - cJSON *mdt_configuration = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mdtConfiguration"); - - OpenAPI_mdt_configuration_t *mdt_configuration_local_nonprim = NULL; + mdt_configuration = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mdtConfiguration"); if (mdt_configuration) { mdt_configuration_local_nonprim = OpenAPI_mdt_configuration_parseFromJSON(mdt_configuration); } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "traceData"); - - OpenAPI_trace_data_1_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "traceData"); if (trace_data) { - trace_data_local_nonprim = OpenAPI_trace_data_1_parseFromJSON(trace_data); + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *cag_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "cagData"); - - OpenAPI_cag_data_t *cag_data_local_nonprim = NULL; + cag_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "cagData"); if (cag_data) { cag_data_local_nonprim = OpenAPI_cag_data_parseFromJSON(cag_data); } - cJSON *stn_sr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "stnSr"); - + stn_sr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "stnSr"); if (stn_sr) { - if (!cJSON_IsString(stn_sr)) { + if (!cJSON_IsString(stn_sr) && !cJSON_IsNull(stn_sr)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [stn_sr]"); goto end; } } - cJSON *c_msisdn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "cMsisdn"); - + c_msisdn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "cMsisdn"); if (c_msisdn) { - if (!cJSON_IsString(c_msisdn)) { + if (!cJSON_IsString(c_msisdn) && !cJSON_IsNull(c_msisdn)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [c_msisdn]"); goto end; } } - cJSON *nb_io_tue_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nbIoTUePriority"); - + nb_io_tue_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nbIoTUePriority"); if (nb_io_tue_priority) { if (!cJSON_IsNumber(nb_io_tue_priority)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [nb_io_tue_priority]"); @@ -1139,8 +1230,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *nssai_inclusion_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nssaiInclusionAllowed"); - + nssai_inclusion_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nssaiInclusionAllowed"); if (nssai_inclusion_allowed) { if (!cJSON_IsBool(nssai_inclusion_allowed)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [nssai_inclusion_allowed]"); @@ -1148,24 +1238,20 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *rg_wireline_characteristics = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "rgWirelineCharacteristics"); - + rg_wireline_characteristics = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "rgWirelineCharacteristics"); if (rg_wireline_characteristics) { - if (!cJSON_IsString(rg_wireline_characteristics)) { + if (!cJSON_IsString(rg_wireline_characteristics) && !cJSON_IsNull(rg_wireline_characteristics)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rg_wireline_characteristics]"); goto end; } } - cJSON *ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ecRestrictionDataWb"); - - OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL; + ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ecRestrictionDataWb"); if (ec_restriction_data_wb) { ec_restriction_data_wb_local_nonprim = OpenAPI_ec_restriction_data_wb_parseFromJSON(ec_restriction_data_wb); } - cJSON *ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ecRestrictionDataNb"); - + ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ecRestrictionDataNb"); if (ec_restriction_data_nb) { if (!cJSON_IsBool(ec_restriction_data_nb)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ec_restriction_data_nb]"); @@ -1173,117 +1259,100 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *expected_ue_behaviour_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "expectedUeBehaviourList"); - - OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_list_local_nonprim = NULL; + expected_ue_behaviour_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "expectedUeBehaviourList"); if (expected_ue_behaviour_list) { expected_ue_behaviour_list_local_nonprim = OpenAPI_expected_ue_behaviour_data_parseFromJSON(expected_ue_behaviour_list); } - cJSON *primary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "primaryRatRestrictions"); - - OpenAPI_list_t *primary_rat_restrictionsList; + primary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "primaryRatRestrictions"); if (primary_rat_restrictions) { - cJSON *primary_rat_restrictions_local_nonprimitive; - if (!cJSON_IsArray(primary_rat_restrictions)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [primary_rat_restrictions]"); - goto end; - } - - primary_rat_restrictionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(primary_rat_restrictions_local_nonprimitive, primary_rat_restrictions ) { - if (!cJSON_IsString(primary_rat_restrictions_local_nonprimitive)){ + cJSON *primary_rat_restrictions_local = NULL; + if (!cJSON_IsArray(primary_rat_restrictions)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [primary_rat_restrictions]"); goto end; } - OpenAPI_list_add(primary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(primary_rat_restrictions_local_nonprimitive->valuestring)); - } + primary_rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(primary_rat_restrictions_local, primary_rat_restrictions) { + if (!cJSON_IsString(primary_rat_restrictions_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [primary_rat_restrictions]"); + goto end; + } + OpenAPI_list_add(primary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(primary_rat_restrictions_local->valuestring)); + } } - cJSON *secondary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "secondaryRatRestrictions"); - - OpenAPI_list_t *secondary_rat_restrictionsList; + secondary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "secondaryRatRestrictions"); if (secondary_rat_restrictions) { - cJSON *secondary_rat_restrictions_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_restrictions)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [secondary_rat_restrictions]"); - goto end; - } - - secondary_rat_restrictionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_restrictions_local_nonprimitive, secondary_rat_restrictions ) { - if (!cJSON_IsString(secondary_rat_restrictions_local_nonprimitive)){ + cJSON *secondary_rat_restrictions_local = NULL; + if (!cJSON_IsArray(secondary_rat_restrictions)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [secondary_rat_restrictions]"); goto end; } - OpenAPI_list_add(secondary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(secondary_rat_restrictions_local_nonprimitive->valuestring)); - } + secondary_rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_restrictions_local, secondary_rat_restrictions) { + if (!cJSON_IsString(secondary_rat_restrictions_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [secondary_rat_restrictions]"); + goto end; + } + OpenAPI_list_add(secondary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(secondary_rat_restrictions_local->valuestring)); + } } - cJSON *edrx_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "edrxParametersList"); - - OpenAPI_list_t *edrx_parameters_listList; + edrx_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "edrxParametersList"); if (edrx_parameters_list) { - cJSON *edrx_parameters_list_local_nonprimitive; - if (!cJSON_IsArray(edrx_parameters_list)){ - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [edrx_parameters_list]"); - goto end; - } - - edrx_parameters_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(edrx_parameters_list_local_nonprimitive, edrx_parameters_list ) { - if (!cJSON_IsObject(edrx_parameters_list_local_nonprimitive)) { + cJSON *edrx_parameters_list_local = NULL; + if (!cJSON_IsArray(edrx_parameters_list)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [edrx_parameters_list]"); goto end; } - OpenAPI_edrx_parameters_t *edrx_parameters_listItem = OpenAPI_edrx_parameters_parseFromJSON(edrx_parameters_list_local_nonprimitive); - if (!edrx_parameters_listItem) { - ogs_error("No edrx_parameters_listItem"); - OpenAPI_list_free(edrx_parameters_listList); - goto end; + edrx_parameters_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(edrx_parameters_list_local, edrx_parameters_list) { + if (!cJSON_IsObject(edrx_parameters_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [edrx_parameters_list]"); + goto end; + } + OpenAPI_edrx_parameters_t *edrx_parameters_listItem = OpenAPI_edrx_parameters_parseFromJSON(edrx_parameters_list_local); + if (!edrx_parameters_listItem) { + ogs_error("No edrx_parameters_listItem"); + OpenAPI_list_free(edrx_parameters_listList); + goto end; + } + OpenAPI_list_add(edrx_parameters_listList, edrx_parameters_listItem); } - - OpenAPI_list_add(edrx_parameters_listList, edrx_parameters_listItem); - } } - cJSON *ptw_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ptwParametersList"); - - OpenAPI_list_t *ptw_parameters_listList; + ptw_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ptwParametersList"); if (ptw_parameters_list) { - cJSON *ptw_parameters_list_local_nonprimitive; - if (!cJSON_IsArray(ptw_parameters_list)){ - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ptw_parameters_list]"); - goto end; - } - - ptw_parameters_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ptw_parameters_list_local_nonprimitive, ptw_parameters_list ) { - if (!cJSON_IsObject(ptw_parameters_list_local_nonprimitive)) { + cJSON *ptw_parameters_list_local = NULL; + if (!cJSON_IsArray(ptw_parameters_list)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ptw_parameters_list]"); goto end; } - OpenAPI_ptw_parameters_t *ptw_parameters_listItem = OpenAPI_ptw_parameters_parseFromJSON(ptw_parameters_list_local_nonprimitive); - if (!ptw_parameters_listItem) { - ogs_error("No ptw_parameters_listItem"); - OpenAPI_list_free(ptw_parameters_listList); - goto end; + ptw_parameters_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ptw_parameters_list_local, ptw_parameters_list) { + if (!cJSON_IsObject(ptw_parameters_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ptw_parameters_list]"); + goto end; + } + OpenAPI_ptw_parameters_t *ptw_parameters_listItem = OpenAPI_ptw_parameters_parseFromJSON(ptw_parameters_list_local); + if (!ptw_parameters_listItem) { + ogs_error("No ptw_parameters_listItem"); + OpenAPI_list_free(ptw_parameters_listList); + goto end; + } + OpenAPI_list_add(ptw_parameters_listList, ptw_parameters_listItem); } - - OpenAPI_list_add(ptw_parameters_listList, ptw_parameters_listItem); - } } - cJSON *iab_operation_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "iabOperationAllowed"); - + iab_operation_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "iabOperationAllowed"); if (iab_operation_allowed) { if (!cJSON_IsBool(iab_operation_allowed)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [iab_operation_allowed]"); @@ -1291,44 +1360,38 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub } } - cJSON *wireline_forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "wirelineForbiddenAreas"); - - OpenAPI_list_t *wireline_forbidden_areasList; + wireline_forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "wirelineForbiddenAreas"); if (wireline_forbidden_areas) { - cJSON *wireline_forbidden_areas_local_nonprimitive; - if (!cJSON_IsArray(wireline_forbidden_areas)){ - ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [wireline_forbidden_areas]"); - goto end; - } - - wireline_forbidden_areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(wireline_forbidden_areas_local_nonprimitive, wireline_forbidden_areas ) { - if (!cJSON_IsObject(wireline_forbidden_areas_local_nonprimitive)) { + cJSON *wireline_forbidden_areas_local = NULL; + if (!cJSON_IsArray(wireline_forbidden_areas)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [wireline_forbidden_areas]"); goto end; } - OpenAPI_wireline_area_t *wireline_forbidden_areasItem = OpenAPI_wireline_area_parseFromJSON(wireline_forbidden_areas_local_nonprimitive); - if (!wireline_forbidden_areasItem) { - ogs_error("No wireline_forbidden_areasItem"); - OpenAPI_list_free(wireline_forbidden_areasList); - goto end; + wireline_forbidden_areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(wireline_forbidden_areas_local, wireline_forbidden_areas) { + if (!cJSON_IsObject(wireline_forbidden_areas_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [wireline_forbidden_areas]"); + goto end; + } + OpenAPI_wireline_area_t *wireline_forbidden_areasItem = OpenAPI_wireline_area_parseFromJSON(wireline_forbidden_areas_local); + if (!wireline_forbidden_areasItem) { + ogs_error("No wireline_forbidden_areasItem"); + OpenAPI_list_free(wireline_forbidden_areasList); + goto end; + } + OpenAPI_list_add(wireline_forbidden_areasList, wireline_forbidden_areasItem); } - - OpenAPI_list_add(wireline_forbidden_areasList, wireline_forbidden_areasItem); - } } - cJSON *wireline_service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "wirelineServiceAreaRestriction"); - - OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction_local_nonprim = NULL; + wireline_service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "wirelineServiceAreaRestriction"); if (wireline_service_area_restriction) { wireline_service_area_restriction_local_nonprim = OpenAPI_wireline_service_area_restriction_parseFromJSON(wireline_service_area_restriction); } access_and_mobility_subscription_data_local_var = OpenAPI_access_and_mobility_subscription_data_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, gpsis ? gpsisList : NULL, internal_group_ids ? internal_group_idsList : NULL, shared_vn_group_data_ids ? shared_vn_group_data_idsList : NULL, @@ -1368,13 +1431,13 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub mdt_configuration ? mdt_configuration_local_nonprim : NULL, trace_data ? trace_data_local_nonprim : NULL, cag_data ? cag_data_local_nonprim : NULL, - stn_sr ? ogs_strdup(stn_sr->valuestring) : NULL, - c_msisdn ? ogs_strdup(c_msisdn->valuestring) : NULL, + stn_sr && !cJSON_IsNull(stn_sr) ? ogs_strdup(stn_sr->valuestring) : NULL, + c_msisdn && !cJSON_IsNull(c_msisdn) ? ogs_strdup(c_msisdn->valuestring) : NULL, nb_io_tue_priority ? true : false, nb_io_tue_priority ? nb_io_tue_priority->valuedouble : 0, nssai_inclusion_allowed ? true : false, nssai_inclusion_allowed ? nssai_inclusion_allowed->valueint : 0, - rg_wireline_characteristics ? ogs_strdup(rg_wireline_characteristics->valuestring) : NULL, + rg_wireline_characteristics && !cJSON_IsNull(rg_wireline_characteristics) ? ogs_strdup(rg_wireline_characteristics->valuestring) : NULL, ec_restriction_data_wb ? ec_restriction_data_wb_local_nonprim : NULL, ec_restriction_data_nb ? true : false, ec_restriction_data_nb ? ec_restriction_data_nb->valueint : 0, @@ -1391,6 +1454,136 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub return access_and_mobility_subscription_data_local_var; end: + if (gpsisList) { + OpenAPI_list_for_each(gpsisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(gpsisList); + gpsisList = NULL; + } + if (internal_group_idsList) { + OpenAPI_list_for_each(internal_group_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(internal_group_idsList); + internal_group_idsList = NULL; + } + if (shared_vn_group_data_idsList) { + OpenAPI_list_for_each(shared_vn_group_data_idsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_vn_group_data_idsList); + shared_vn_group_data_idsList = NULL; + } + if (subscribed_ue_ambr_local_nonprim) { + OpenAPI_ambr_rm_free(subscribed_ue_ambr_local_nonprim); + subscribed_ue_ambr_local_nonprim = NULL; + } + if (nssai_local_nonprim) { + OpenAPI_nssai_free(nssai_local_nonprim); + nssai_local_nonprim = NULL; + } + if (rat_restrictionsList) { + OpenAPI_list_free(rat_restrictionsList); + rat_restrictionsList = NULL; + } + if (forbidden_areasList) { + OpenAPI_list_for_each(forbidden_areasList, node) { + OpenAPI_area_free(node->data); + } + OpenAPI_list_free(forbidden_areasList); + forbidden_areasList = NULL; + } + if (service_area_restriction_local_nonprim) { + OpenAPI_service_area_restriction_free(service_area_restriction_local_nonprim); + service_area_restriction_local_nonprim = NULL; + } + if (core_network_type_restrictionsList) { + OpenAPI_list_free(core_network_type_restrictionsList); + core_network_type_restrictionsList = NULL; + } + if (sor_info_local_nonprim) { + OpenAPI_sor_info_free(sor_info_local_nonprim); + sor_info_local_nonprim = NULL; + } + if (sor_update_indicator_listList) { + OpenAPI_list_free(sor_update_indicator_listList); + sor_update_indicator_listList = NULL; + } + if (upu_info_local_nonprim) { + OpenAPI_upu_info_free(upu_info_local_nonprim); + upu_info_local_nonprim = NULL; + } + if (shared_am_data_idsList) { + OpenAPI_list_for_each(shared_am_data_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(shared_am_data_idsList); + shared_am_data_idsList = NULL; + } + if (subscribed_dnn_listList) { + OpenAPI_list_for_each(subscribed_dnn_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subscribed_dnn_listList); + subscribed_dnn_listList = NULL; + } + if (mdt_configuration_local_nonprim) { + OpenAPI_mdt_configuration_free(mdt_configuration_local_nonprim); + mdt_configuration_local_nonprim = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (cag_data_local_nonprim) { + OpenAPI_cag_data_free(cag_data_local_nonprim); + cag_data_local_nonprim = NULL; + } + if (ec_restriction_data_wb_local_nonprim) { + OpenAPI_ec_restriction_data_wb_free(ec_restriction_data_wb_local_nonprim); + ec_restriction_data_wb_local_nonprim = NULL; + } + if (expected_ue_behaviour_list_local_nonprim) { + OpenAPI_expected_ue_behaviour_data_free(expected_ue_behaviour_list_local_nonprim); + expected_ue_behaviour_list_local_nonprim = NULL; + } + if (primary_rat_restrictionsList) { + OpenAPI_list_free(primary_rat_restrictionsList); + primary_rat_restrictionsList = NULL; + } + if (secondary_rat_restrictionsList) { + OpenAPI_list_free(secondary_rat_restrictionsList); + secondary_rat_restrictionsList = NULL; + } + if (edrx_parameters_listList) { + OpenAPI_list_for_each(edrx_parameters_listList, node) { + OpenAPI_edrx_parameters_free(node->data); + } + OpenAPI_list_free(edrx_parameters_listList); + edrx_parameters_listList = NULL; + } + if (ptw_parameters_listList) { + OpenAPI_list_for_each(ptw_parameters_listList, node) { + OpenAPI_ptw_parameters_free(node->data); + } + OpenAPI_list_free(ptw_parameters_listList); + ptw_parameters_listList = NULL; + } + if (wireline_forbidden_areasList) { + OpenAPI_list_for_each(wireline_forbidden_areasList, node) { + OpenAPI_wireline_area_free(node->data); + } + OpenAPI_list_free(wireline_forbidden_areasList); + wireline_forbidden_areasList = NULL; + } + if (wireline_service_area_restriction_local_nonprim) { + OpenAPI_wireline_service_area_restriction_free(wireline_service_area_restriction_local_nonprim); + wireline_service_area_restriction_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/access_and_mobility_subscription_data.h b/lib/sbi/openapi/model/access_and_mobility_subscription_data.h index f617c880c..509e86ce6 100644 --- a/lib/sbi/openapi/model/access_and_mobility_subscription_data.h +++ b/lib/sbi/openapi/model/access_and_mobility_subscription_data.h @@ -28,7 +28,7 @@ #include "service_area_restriction.h" #include "sor_info.h" #include "sor_update_indicator.h" -#include "trace_data_1.h" +#include "trace_data.h" #include "upu_info.h" #include "wireline_area.h" #include "wireline_service_area_restriction.h" @@ -77,7 +77,7 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s { int service_gap_time; OpenAPI_mdt_user_consent_e mdt_user_consent; struct OpenAPI_mdt_configuration_s *mdt_configuration; - struct OpenAPI_trace_data_1_s *trace_data; + struct OpenAPI_trace_data_s *trace_data; struct OpenAPI_cag_data_s *cag_data; char *stn_sr; char *c_msisdn; @@ -139,7 +139,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub int service_gap_time, OpenAPI_mdt_user_consent_e mdt_user_consent, OpenAPI_mdt_configuration_t *mdt_configuration, - OpenAPI_trace_data_1_t *trace_data, + OpenAPI_trace_data_t *trace_data, OpenAPI_cag_data_t *cag_data, char *stn_sr, char *c_msisdn, diff --git a/lib/sbi/openapi/model/access_and_mobility_subscription_data_1.c b/lib/sbi/openapi/model/access_and_mobility_subscription_data_1.c index 74fe7bc13..2833e0194 100644 --- a/lib/sbi/openapi/model/access_and_mobility_subscription_data_1.c +++ b/lib/sbi/openapi/model/access_and_mobility_subscription_data_1.c @@ -134,75 +134,164 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s void OpenAPI_access_and_mobility_subscription_data_1_free(OpenAPI_access_and_mobility_subscription_data_1_t *access_and_mobility_subscription_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_and_mobility_subscription_data_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(access_and_mobility_subscription_data_1->supported_features); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->gpsis, node) { - ogs_free(node->data); + if (access_and_mobility_subscription_data_1->supported_features) { + ogs_free(access_and_mobility_subscription_data_1->supported_features); + access_and_mobility_subscription_data_1->supported_features = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->gpsis); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->internal_group_ids, node) { - ogs_free(node->data); + if (access_and_mobility_subscription_data_1->gpsis) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->gpsis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->gpsis); + access_and_mobility_subscription_data_1->gpsis = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->internal_group_ids); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_vn_group_data_ids, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (access_and_mobility_subscription_data_1->internal_group_ids) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->internal_group_ids); + access_and_mobility_subscription_data_1->internal_group_ids = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->shared_vn_group_data_ids); - OpenAPI_ambr_rm_free(access_and_mobility_subscription_data_1->subscribed_ue_ambr); - OpenAPI_nssai_1_free(access_and_mobility_subscription_data_1->nssai); - OpenAPI_list_free(access_and_mobility_subscription_data_1->rat_restrictions); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->forbidden_areas, node) { - OpenAPI_area_1_free(node->data); + if (access_and_mobility_subscription_data_1->shared_vn_group_data_ids) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->shared_vn_group_data_ids); + access_and_mobility_subscription_data_1->shared_vn_group_data_ids = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->forbidden_areas); - OpenAPI_service_area_restriction_1_free(access_and_mobility_subscription_data_1->service_area_restriction); - OpenAPI_list_free(access_and_mobility_subscription_data_1->core_network_type_restrictions); - OpenAPI_sor_info_1_free(access_and_mobility_subscription_data_1->sor_info); - OpenAPI_list_free(access_and_mobility_subscription_data_1->sor_update_indicator_list); - OpenAPI_upu_info_1_free(access_and_mobility_subscription_data_1->upu_info); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_am_data_ids, node) { - ogs_free(node->data); + if (access_and_mobility_subscription_data_1->subscribed_ue_ambr) { + OpenAPI_ambr_rm_free(access_and_mobility_subscription_data_1->subscribed_ue_ambr); + access_and_mobility_subscription_data_1->subscribed_ue_ambr = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->shared_am_data_ids); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->subscribed_dnn_list, node) { - ogs_free(node->data); + if (access_and_mobility_subscription_data_1->nssai) { + OpenAPI_nssai_1_free(access_and_mobility_subscription_data_1->nssai); + access_and_mobility_subscription_data_1->nssai = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->subscribed_dnn_list); - OpenAPI_mdt_configuration_1_free(access_and_mobility_subscription_data_1->mdt_configuration); - OpenAPI_trace_data_free(access_and_mobility_subscription_data_1->trace_data); - OpenAPI_cag_data_1_free(access_and_mobility_subscription_data_1->cag_data); - ogs_free(access_and_mobility_subscription_data_1->stn_sr); - ogs_free(access_and_mobility_subscription_data_1->c_msisdn); - ogs_free(access_and_mobility_subscription_data_1->rg_wireline_characteristics); - OpenAPI_ec_restriction_data_wb_free(access_and_mobility_subscription_data_1->ec_restriction_data_wb); - OpenAPI_expected_ue_behaviour_data_1_free(access_and_mobility_subscription_data_1->expected_ue_behaviour_list); - OpenAPI_list_free(access_and_mobility_subscription_data_1->primary_rat_restrictions); - OpenAPI_list_free(access_and_mobility_subscription_data_1->secondary_rat_restrictions); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->edrx_parameters_list, node) { - OpenAPI_edrx_parameters_1_free(node->data); + if (access_and_mobility_subscription_data_1->rat_restrictions) { + OpenAPI_list_free(access_and_mobility_subscription_data_1->rat_restrictions); + access_and_mobility_subscription_data_1->rat_restrictions = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->edrx_parameters_list); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->ptw_parameters_list, node) { - OpenAPI_ptw_parameters_1_free(node->data); + if (access_and_mobility_subscription_data_1->forbidden_areas) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->forbidden_areas, node) { + OpenAPI_area_1_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->forbidden_areas); + access_and_mobility_subscription_data_1->forbidden_areas = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->ptw_parameters_list); - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->wireline_forbidden_areas, node) { - OpenAPI_wireline_area_1_free(node->data); + if (access_and_mobility_subscription_data_1->service_area_restriction) { + OpenAPI_service_area_restriction_1_free(access_and_mobility_subscription_data_1->service_area_restriction); + access_and_mobility_subscription_data_1->service_area_restriction = NULL; + } + if (access_and_mobility_subscription_data_1->core_network_type_restrictions) { + OpenAPI_list_free(access_and_mobility_subscription_data_1->core_network_type_restrictions); + access_and_mobility_subscription_data_1->core_network_type_restrictions = NULL; + } + if (access_and_mobility_subscription_data_1->sor_info) { + OpenAPI_sor_info_1_free(access_and_mobility_subscription_data_1->sor_info); + access_and_mobility_subscription_data_1->sor_info = NULL; + } + if (access_and_mobility_subscription_data_1->sor_update_indicator_list) { + OpenAPI_list_free(access_and_mobility_subscription_data_1->sor_update_indicator_list); + access_and_mobility_subscription_data_1->sor_update_indicator_list = NULL; + } + if (access_and_mobility_subscription_data_1->upu_info) { + OpenAPI_upu_info_1_free(access_and_mobility_subscription_data_1->upu_info); + access_and_mobility_subscription_data_1->upu_info = NULL; + } + if (access_and_mobility_subscription_data_1->shared_am_data_ids) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_am_data_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->shared_am_data_ids); + access_and_mobility_subscription_data_1->shared_am_data_ids = NULL; + } + if (access_and_mobility_subscription_data_1->subscribed_dnn_list) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->subscribed_dnn_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->subscribed_dnn_list); + access_and_mobility_subscription_data_1->subscribed_dnn_list = NULL; + } + if (access_and_mobility_subscription_data_1->mdt_configuration) { + OpenAPI_mdt_configuration_1_free(access_and_mobility_subscription_data_1->mdt_configuration); + access_and_mobility_subscription_data_1->mdt_configuration = NULL; + } + if (access_and_mobility_subscription_data_1->trace_data) { + OpenAPI_trace_data_free(access_and_mobility_subscription_data_1->trace_data); + access_and_mobility_subscription_data_1->trace_data = NULL; + } + if (access_and_mobility_subscription_data_1->cag_data) { + OpenAPI_cag_data_1_free(access_and_mobility_subscription_data_1->cag_data); + access_and_mobility_subscription_data_1->cag_data = NULL; + } + if (access_and_mobility_subscription_data_1->stn_sr) { + ogs_free(access_and_mobility_subscription_data_1->stn_sr); + access_and_mobility_subscription_data_1->stn_sr = NULL; + } + if (access_and_mobility_subscription_data_1->c_msisdn) { + ogs_free(access_and_mobility_subscription_data_1->c_msisdn); + access_and_mobility_subscription_data_1->c_msisdn = NULL; + } + if (access_and_mobility_subscription_data_1->rg_wireline_characteristics) { + ogs_free(access_and_mobility_subscription_data_1->rg_wireline_characteristics); + access_and_mobility_subscription_data_1->rg_wireline_characteristics = NULL; + } + if (access_and_mobility_subscription_data_1->ec_restriction_data_wb) { + OpenAPI_ec_restriction_data_wb_free(access_and_mobility_subscription_data_1->ec_restriction_data_wb); + access_and_mobility_subscription_data_1->ec_restriction_data_wb = NULL; + } + if (access_and_mobility_subscription_data_1->expected_ue_behaviour_list) { + OpenAPI_expected_ue_behaviour_data_1_free(access_and_mobility_subscription_data_1->expected_ue_behaviour_list); + access_and_mobility_subscription_data_1->expected_ue_behaviour_list = NULL; + } + if (access_and_mobility_subscription_data_1->primary_rat_restrictions) { + OpenAPI_list_free(access_and_mobility_subscription_data_1->primary_rat_restrictions); + access_and_mobility_subscription_data_1->primary_rat_restrictions = NULL; + } + if (access_and_mobility_subscription_data_1->secondary_rat_restrictions) { + OpenAPI_list_free(access_and_mobility_subscription_data_1->secondary_rat_restrictions); + access_and_mobility_subscription_data_1->secondary_rat_restrictions = NULL; + } + if (access_and_mobility_subscription_data_1->edrx_parameters_list) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->edrx_parameters_list, node) { + OpenAPI_edrx_parameters_1_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->edrx_parameters_list); + access_and_mobility_subscription_data_1->edrx_parameters_list = NULL; + } + if (access_and_mobility_subscription_data_1->ptw_parameters_list) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->ptw_parameters_list, node) { + OpenAPI_ptw_parameters_1_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->ptw_parameters_list); + access_and_mobility_subscription_data_1->ptw_parameters_list = NULL; + } + if (access_and_mobility_subscription_data_1->wireline_forbidden_areas) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->wireline_forbidden_areas, node) { + OpenAPI_wireline_area_1_free(node->data); + } + OpenAPI_list_free(access_and_mobility_subscription_data_1->wireline_forbidden_areas); + access_and_mobility_subscription_data_1->wireline_forbidden_areas = NULL; + } + if (access_and_mobility_subscription_data_1->wireline_service_area_restriction) { + OpenAPI_wireline_service_area_restriction_1_free(access_and_mobility_subscription_data_1->wireline_service_area_restriction); + access_and_mobility_subscription_data_1->wireline_service_area_restriction = NULL; } - OpenAPI_list_free(access_and_mobility_subscription_data_1->wireline_forbidden_areas); - OpenAPI_wireline_service_area_restriction_1_free(access_and_mobility_subscription_data_1->wireline_service_area_restriction); ogs_free(access_and_mobility_subscription_data_1); } cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_access_and_mobility_subscription_data_1_t *access_and_mobility_subscription_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_and_mobility_subscription_data_1 == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [AccessAndMobilitySubscriptionData_1]"); @@ -218,35 +307,31 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc } if (access_and_mobility_subscription_data_1->gpsis) { - cJSON *gpsis = cJSON_AddArrayToObject(item, "gpsis"); - if (gpsis == NULL) { + cJSON *gpsisList = cJSON_AddArrayToObject(item, "gpsis"); + if (gpsisList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [gpsis]"); goto end; } - - OpenAPI_lnode_t *gpsis_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->gpsis, gpsis_node) { - if (cJSON_AddStringToObject(gpsis, "", (char*)gpsis_node->data) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [gpsis]"); - goto end; + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->gpsis, node) { + if (cJSON_AddStringToObject(gpsisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [gpsis]"); + goto end; + } } - } } if (access_and_mobility_subscription_data_1->internal_group_ids) { - cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); - if (internal_group_ids == NULL) { + cJSON *internal_group_idsList = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_idsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [internal_group_ids]"); goto end; } - - OpenAPI_lnode_t *internal_group_ids_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->internal_group_ids, internal_group_ids_node) { - if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [internal_group_ids]"); - goto end; + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->internal_group_ids, node) { + if (cJSON_AddStringToObject(internal_group_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [internal_group_ids]"); + goto end; + } } - } } if (access_and_mobility_subscription_data_1->shared_vn_group_data_ids) { @@ -256,17 +341,16 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc goto end; } cJSON *localMapObject = shared_vn_group_data_ids; - OpenAPI_lnode_t *shared_vn_group_data_ids_node; if (access_and_mobility_subscription_data_1->shared_vn_group_data_ids) { - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_vn_group_data_ids, shared_vn_group_data_ids_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_vn_group_data_ids_node->data; - if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [inner]"); + goto end; } } } + } if (access_and_mobility_subscription_data_1->subscribed_ue_ambr) { cJSON *subscribed_ue_ambr_local_JSON = OpenAPI_ambr_rm_convertToJSON(access_and_mobility_subscription_data_1->subscribed_ue_ambr); @@ -294,15 +378,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc } } - if (access_and_mobility_subscription_data_1->rat_restrictions) { - cJSON *rat_restrictions = cJSON_AddArrayToObject(item, "ratRestrictions"); - if (rat_restrictions == NULL) { + if (access_and_mobility_subscription_data_1->rat_restrictions != OpenAPI_rat_type_NULL) { + cJSON *rat_restrictionsList = cJSON_AddArrayToObject(item, "ratRestrictions"); + if (rat_restrictionsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [rat_restrictions]"); goto end; } - OpenAPI_lnode_t *rat_restrictions_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->rat_restrictions, rat_restrictions_node) { - if (cJSON_AddStringToObject(rat_restrictions, "", OpenAPI_rat_type_ToString((intptr_t)rat_restrictions_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->rat_restrictions, node) { + if (cJSON_AddStringToObject(rat_restrictionsList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [rat_restrictions]"); goto end; } @@ -315,17 +398,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [forbidden_areas]"); goto end; } - - OpenAPI_lnode_t *forbidden_areas_node; - if (access_and_mobility_subscription_data_1->forbidden_areas) { - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->forbidden_areas, forbidden_areas_node) { - cJSON *itemLocal = OpenAPI_area_1_convertToJSON(forbidden_areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [forbidden_areas]"); - goto end; - } - cJSON_AddItemToArray(forbidden_areasList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->forbidden_areas, node) { + cJSON *itemLocal = OpenAPI_area_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [forbidden_areas]"); + goto end; } + cJSON_AddItemToArray(forbidden_areasList, itemLocal); } } @@ -342,15 +421,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc } } - if (access_and_mobility_subscription_data_1->core_network_type_restrictions) { - cJSON *core_network_type_restrictions = cJSON_AddArrayToObject(item, "coreNetworkTypeRestrictions"); - if (core_network_type_restrictions == NULL) { + if (access_and_mobility_subscription_data_1->core_network_type_restrictions != OpenAPI_core_network_type_NULL) { + cJSON *core_network_type_restrictionsList = cJSON_AddArrayToObject(item, "coreNetworkTypeRestrictions"); + if (core_network_type_restrictionsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [core_network_type_restrictions]"); goto end; } - OpenAPI_lnode_t *core_network_type_restrictions_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->core_network_type_restrictions, core_network_type_restrictions_node) { - if (cJSON_AddStringToObject(core_network_type_restrictions, "", OpenAPI_core_network_type_ToString((intptr_t)core_network_type_restrictions_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->core_network_type_restrictions, node) { + if (cJSON_AddStringToObject(core_network_type_restrictionsList, "", OpenAPI_core_network_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [core_network_type_restrictions]"); goto end; } @@ -426,15 +504,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc } } - if (access_and_mobility_subscription_data_1->sor_update_indicator_list) { - cJSON *sor_update_indicator_list = cJSON_AddArrayToObject(item, "sorUpdateIndicatorList"); - if (sor_update_indicator_list == NULL) { + if (access_and_mobility_subscription_data_1->sor_update_indicator_list != OpenAPI_sor_update_indicator_NULL) { + cJSON *sor_update_indicator_listList = cJSON_AddArrayToObject(item, "sorUpdateIndicatorList"); + if (sor_update_indicator_listList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [sor_update_indicator_list]"); goto end; } - OpenAPI_lnode_t *sor_update_indicator_list_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->sor_update_indicator_list, sor_update_indicator_list_node) { - if (cJSON_AddStringToObject(sor_update_indicator_list, "", OpenAPI_sor_update_indicator_ToString((intptr_t)sor_update_indicator_list_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->sor_update_indicator_list, node) { + if (cJSON_AddStringToObject(sor_update_indicator_listList, "", OpenAPI_sor_update_indicator_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [sor_update_indicator_list]"); goto end; } @@ -462,22 +539,20 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc } if (access_and_mobility_subscription_data_1->shared_am_data_ids) { - cJSON *shared_am_data_ids = cJSON_AddArrayToObject(item, "sharedAmDataIds"); - if (shared_am_data_ids == NULL) { + cJSON *shared_am_data_idsList = cJSON_AddArrayToObject(item, "sharedAmDataIds"); + if (shared_am_data_idsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [shared_am_data_ids]"); goto end; } - - OpenAPI_lnode_t *shared_am_data_ids_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_am_data_ids, shared_am_data_ids_node) { - if (cJSON_AddStringToObject(shared_am_data_ids, "", (char*)shared_am_data_ids_node->data) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [shared_am_data_ids]"); - goto end; + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_am_data_ids, node) { + if (cJSON_AddStringToObject(shared_am_data_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [shared_am_data_ids]"); + goto end; + } } - } } - if (access_and_mobility_subscription_data_1->odb_packet_services) { + if (access_and_mobility_subscription_data_1->odb_packet_services != OpenAPI_odb_packet_services_NULL) { if (cJSON_AddStringToObject(item, "odbPacketServices", OpenAPI_odb_packet_services_ToString(access_and_mobility_subscription_data_1->odb_packet_services)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [odb_packet_services]"); goto end; @@ -485,19 +560,17 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc } if (access_and_mobility_subscription_data_1->subscribed_dnn_list) { - cJSON *subscribed_dnn_list = cJSON_AddArrayToObject(item, "subscribedDnnList"); - if (subscribed_dnn_list == NULL) { + cJSON *subscribed_dnn_listList = cJSON_AddArrayToObject(item, "subscribedDnnList"); + if (subscribed_dnn_listList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [subscribed_dnn_list]"); goto end; } - - OpenAPI_lnode_t *subscribed_dnn_list_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->subscribed_dnn_list, subscribed_dnn_list_node) { - if (cJSON_AddStringToObject(subscribed_dnn_list, "", (char*)subscribed_dnn_list_node->data) == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [subscribed_dnn_list]"); - goto end; + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->subscribed_dnn_list, node) { + if (cJSON_AddStringToObject(subscribed_dnn_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [subscribed_dnn_list]"); + goto end; + } } - } } if (access_and_mobility_subscription_data_1->is_service_gap_time) { @@ -507,7 +580,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc } } - if (access_and_mobility_subscription_data_1->mdt_user_consent) { + if (access_and_mobility_subscription_data_1->mdt_user_consent != OpenAPI_mdt_user_consent_NULL) { if (cJSON_AddStringToObject(item, "mdtUserConsent", OpenAPI_mdt_user_consent_ToString(access_and_mobility_subscription_data_1->mdt_user_consent)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [mdt_user_consent]"); goto end; @@ -621,30 +694,28 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc } } - if (access_and_mobility_subscription_data_1->primary_rat_restrictions) { - cJSON *primary_rat_restrictions = cJSON_AddArrayToObject(item, "primaryRatRestrictions"); - if (primary_rat_restrictions == NULL) { + if (access_and_mobility_subscription_data_1->primary_rat_restrictions != OpenAPI_rat_type_NULL) { + cJSON *primary_rat_restrictionsList = cJSON_AddArrayToObject(item, "primaryRatRestrictions"); + if (primary_rat_restrictionsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [primary_rat_restrictions]"); goto end; } - OpenAPI_lnode_t *primary_rat_restrictions_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->primary_rat_restrictions, primary_rat_restrictions_node) { - if (cJSON_AddStringToObject(primary_rat_restrictions, "", OpenAPI_rat_type_ToString((intptr_t)primary_rat_restrictions_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->primary_rat_restrictions, node) { + if (cJSON_AddStringToObject(primary_rat_restrictionsList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [primary_rat_restrictions]"); goto end; } } } - if (access_and_mobility_subscription_data_1->secondary_rat_restrictions) { - cJSON *secondary_rat_restrictions = cJSON_AddArrayToObject(item, "secondaryRatRestrictions"); - if (secondary_rat_restrictions == NULL) { + if (access_and_mobility_subscription_data_1->secondary_rat_restrictions != OpenAPI_rat_type_NULL) { + cJSON *secondary_rat_restrictionsList = cJSON_AddArrayToObject(item, "secondaryRatRestrictions"); + if (secondary_rat_restrictionsList == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [secondary_rat_restrictions]"); goto end; } - OpenAPI_lnode_t *secondary_rat_restrictions_node; - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->secondary_rat_restrictions, secondary_rat_restrictions_node) { - if (cJSON_AddStringToObject(secondary_rat_restrictions, "", OpenAPI_rat_type_ToString((intptr_t)secondary_rat_restrictions_node->data)) == NULL) { + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->secondary_rat_restrictions, node) { + if (cJSON_AddStringToObject(secondary_rat_restrictionsList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [secondary_rat_restrictions]"); goto end; } @@ -657,17 +728,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [edrx_parameters_list]"); goto end; } - - OpenAPI_lnode_t *edrx_parameters_list_node; - if (access_and_mobility_subscription_data_1->edrx_parameters_list) { - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->edrx_parameters_list, edrx_parameters_list_node) { - cJSON *itemLocal = OpenAPI_edrx_parameters_1_convertToJSON(edrx_parameters_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [edrx_parameters_list]"); - goto end; - } - cJSON_AddItemToArray(edrx_parameters_listList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->edrx_parameters_list, node) { + cJSON *itemLocal = OpenAPI_edrx_parameters_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [edrx_parameters_list]"); + goto end; } + cJSON_AddItemToArray(edrx_parameters_listList, itemLocal); } } @@ -677,17 +744,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [ptw_parameters_list]"); goto end; } - - OpenAPI_lnode_t *ptw_parameters_list_node; - if (access_and_mobility_subscription_data_1->ptw_parameters_list) { - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->ptw_parameters_list, ptw_parameters_list_node) { - cJSON *itemLocal = OpenAPI_ptw_parameters_1_convertToJSON(ptw_parameters_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [ptw_parameters_list]"); - goto end; - } - cJSON_AddItemToArray(ptw_parameters_listList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->ptw_parameters_list, node) { + cJSON *itemLocal = OpenAPI_ptw_parameters_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [ptw_parameters_list]"); + goto end; } + cJSON_AddItemToArray(ptw_parameters_listList, itemLocal); } } @@ -704,17 +767,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [wireline_forbidden_areas]"); goto end; } - - OpenAPI_lnode_t *wireline_forbidden_areas_node; - if (access_and_mobility_subscription_data_1->wireline_forbidden_areas) { - OpenAPI_list_for_each(access_and_mobility_subscription_data_1->wireline_forbidden_areas, wireline_forbidden_areas_node) { - cJSON *itemLocal = OpenAPI_wireline_area_1_convertToJSON(wireline_forbidden_areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [wireline_forbidden_areas]"); - goto end; - } - cJSON_AddItemToArray(wireline_forbidden_areasList, itemLocal); + OpenAPI_list_for_each(access_and_mobility_subscription_data_1->wireline_forbidden_areas, node) { + cJSON *itemLocal = OpenAPI_wireline_area_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [wireline_forbidden_areas]"); + goto end; } + cJSON_AddItemToArray(wireline_forbidden_areasList, itemLocal); } } @@ -738,173 +797,232 @@ end: OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON(cJSON *access_and_mobility_subscription_data_1JSON) { OpenAPI_access_and_mobility_subscription_data_1_t *access_and_mobility_subscription_data_1_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *gpsis = NULL; + OpenAPI_list_t *gpsisList = NULL; + cJSON *internal_group_ids = NULL; + OpenAPI_list_t *internal_group_idsList = NULL; + cJSON *shared_vn_group_data_ids = NULL; + OpenAPI_list_t *shared_vn_group_data_idsList = NULL; + cJSON *subscribed_ue_ambr = NULL; + OpenAPI_ambr_rm_t *subscribed_ue_ambr_local_nonprim = NULL; + cJSON *nssai = NULL; + OpenAPI_nssai_1_t *nssai_local_nonprim = NULL; + cJSON *rat_restrictions = NULL; + OpenAPI_list_t *rat_restrictionsList = NULL; + cJSON *forbidden_areas = NULL; + OpenAPI_list_t *forbidden_areasList = NULL; + cJSON *service_area_restriction = NULL; + OpenAPI_service_area_restriction_1_t *service_area_restriction_local_nonprim = NULL; + cJSON *core_network_type_restrictions = NULL; + OpenAPI_list_t *core_network_type_restrictionsList = NULL; + cJSON *rfsp_index = NULL; + cJSON *subs_reg_timer = NULL; + cJSON *ue_usage_type = NULL; + cJSON *mps_priority = NULL; + cJSON *mcs_priority = NULL; + cJSON *active_time = NULL; + cJSON *sor_info = NULL; + OpenAPI_sor_info_1_t *sor_info_local_nonprim = NULL; + cJSON *sor_info_expect_ind = NULL; + cJSON *soraf_retrieval = NULL; + cJSON *sor_update_indicator_list = NULL; + OpenAPI_list_t *sor_update_indicator_listList = NULL; + cJSON *upu_info = NULL; + OpenAPI_upu_info_1_t *upu_info_local_nonprim = NULL; + cJSON *mico_allowed = NULL; + cJSON *shared_am_data_ids = NULL; + OpenAPI_list_t *shared_am_data_idsList = NULL; + cJSON *odb_packet_services = NULL; + OpenAPI_odb_packet_services_e odb_packet_servicesVariable = 0; + cJSON *subscribed_dnn_list = NULL; + OpenAPI_list_t *subscribed_dnn_listList = NULL; + cJSON *service_gap_time = NULL; + cJSON *mdt_user_consent = NULL; + OpenAPI_mdt_user_consent_e mdt_user_consentVariable = 0; + cJSON *mdt_configuration = NULL; + OpenAPI_mdt_configuration_1_t *mdt_configuration_local_nonprim = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *cag_data = NULL; + OpenAPI_cag_data_1_t *cag_data_local_nonprim = NULL; + cJSON *stn_sr = NULL; + cJSON *c_msisdn = NULL; + cJSON *nb_io_tue_priority = NULL; + cJSON *nssai_inclusion_allowed = NULL; + cJSON *rg_wireline_characteristics = NULL; + cJSON *ec_restriction_data_wb = NULL; + OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL; + cJSON *ec_restriction_data_nb = NULL; + cJSON *expected_ue_behaviour_list = NULL; + OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_list_local_nonprim = NULL; + cJSON *primary_rat_restrictions = NULL; + OpenAPI_list_t *primary_rat_restrictionsList = NULL; + cJSON *secondary_rat_restrictions = NULL; + OpenAPI_list_t *secondary_rat_restrictionsList = NULL; + cJSON *edrx_parameters_list = NULL; + OpenAPI_list_t *edrx_parameters_listList = NULL; + cJSON *ptw_parameters_list = NULL; + OpenAPI_list_t *ptw_parameters_listList = NULL; + cJSON *iab_operation_allowed = NULL; + cJSON *wireline_forbidden_areas = NULL; + OpenAPI_list_t *wireline_forbidden_areasList = NULL; + cJSON *wireline_service_area_restriction = NULL; + OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction_local_nonprim = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *gpsis = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "gpsis"); - - OpenAPI_list_t *gpsisList; + gpsis = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "gpsis"); if (gpsis) { - cJSON *gpsis_local; - if (!cJSON_IsArray(gpsis)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [gpsis]"); - goto end; - } - gpsisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(gpsis_local, gpsis) { - if (!cJSON_IsString(gpsis_local)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [gpsis]"); - goto end; - } - OpenAPI_list_add(gpsisList, ogs_strdup(gpsis_local->valuestring)); - } - } - - cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "internalGroupIds"); - - OpenAPI_list_t *internal_group_idsList; - if (internal_group_ids) { - cJSON *internal_group_ids_local; - if (!cJSON_IsArray(internal_group_ids)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - internal_group_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { - if (!cJSON_IsString(internal_group_ids_local)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); - } - } - - cJSON *shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sharedVnGroupDataIds"); - - OpenAPI_list_t *shared_vn_group_data_idsList; - if (shared_vn_group_data_ids) { - cJSON *shared_vn_group_data_ids_local_map; - if (!cJSON_IsObject(shared_vn_group_data_ids)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [shared_vn_group_data_ids]"); - goto end; - } - shared_vn_group_data_idsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { - cJSON *localMapObject = shared_vn_group_data_ids_local_map; - if (!cJSON_IsString(localMapObject)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [inner]"); + cJSON *gpsis_local = NULL; + if (!cJSON_IsArray(gpsis)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [gpsis]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); - } + + gpsisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsis_local, gpsis) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(gpsis_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [gpsis]"); + goto end; + } + OpenAPI_list_add(gpsisList, ogs_strdup(gpsis_local->valuestring)); + } } - cJSON *subscribed_ue_ambr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "subscribedUeAmbr"); + internal_group_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "internalGroupIds"); + if (internal_group_ids) { + cJSON *internal_group_ids_local = NULL; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [internal_group_ids]"); + goto end; + } - OpenAPI_ambr_rm_t *subscribed_ue_ambr_local_nonprim = NULL; + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } + } + + shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sharedVnGroupDataIds"); + if (shared_vn_group_data_ids) { + cJSON *shared_vn_group_data_ids_local_map = NULL; + if (!cJSON_IsObject(shared_vn_group_data_ids) && !cJSON_IsNull(shared_vn_group_data_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [shared_vn_group_data_ids]"); + goto end; + } + if (cJSON_IsObject(shared_vn_group_data_ids)) { + shared_vn_group_data_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { + cJSON *localMapObject = shared_vn_group_data_ids_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [inner]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); + } + } + } + + subscribed_ue_ambr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "subscribedUeAmbr"); if (subscribed_ue_ambr) { subscribed_ue_ambr_local_nonprim = OpenAPI_ambr_rm_parseFromJSON(subscribed_ue_ambr); } - cJSON *nssai = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "nssai"); - - OpenAPI_nssai_1_t *nssai_local_nonprim = NULL; + nssai = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "nssai"); if (nssai) { nssai_local_nonprim = OpenAPI_nssai_1_parseFromJSON(nssai); } - cJSON *rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ratRestrictions"); - - OpenAPI_list_t *rat_restrictionsList; + rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ratRestrictions"); if (rat_restrictions) { - cJSON *rat_restrictions_local_nonprimitive; - if (!cJSON_IsArray(rat_restrictions)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [rat_restrictions]"); - goto end; - } - - rat_restrictionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rat_restrictions_local_nonprimitive, rat_restrictions ) { - if (!cJSON_IsString(rat_restrictions_local_nonprimitive)){ + cJSON *rat_restrictions_local = NULL; + if (!cJSON_IsArray(rat_restrictions)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [rat_restrictions]"); goto end; } - OpenAPI_list_add(rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(rat_restrictions_local_nonprimitive->valuestring)); - } + rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rat_restrictions_local, rat_restrictions) { + if (!cJSON_IsString(rat_restrictions_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [rat_restrictions]"); + goto end; + } + OpenAPI_list_add(rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(rat_restrictions_local->valuestring)); + } } - cJSON *forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "forbiddenAreas"); - - OpenAPI_list_t *forbidden_areasList; + forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "forbiddenAreas"); if (forbidden_areas) { - cJSON *forbidden_areas_local_nonprimitive; - if (!cJSON_IsArray(forbidden_areas)){ - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [forbidden_areas]"); - goto end; - } - - forbidden_areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(forbidden_areas_local_nonprimitive, forbidden_areas ) { - if (!cJSON_IsObject(forbidden_areas_local_nonprimitive)) { + cJSON *forbidden_areas_local = NULL; + if (!cJSON_IsArray(forbidden_areas)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [forbidden_areas]"); goto end; } - OpenAPI_area_1_t *forbidden_areasItem = OpenAPI_area_1_parseFromJSON(forbidden_areas_local_nonprimitive); - if (!forbidden_areasItem) { - ogs_error("No forbidden_areasItem"); - OpenAPI_list_free(forbidden_areasList); - goto end; + forbidden_areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(forbidden_areas_local, forbidden_areas) { + if (!cJSON_IsObject(forbidden_areas_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [forbidden_areas]"); + goto end; + } + OpenAPI_area_1_t *forbidden_areasItem = OpenAPI_area_1_parseFromJSON(forbidden_areas_local); + if (!forbidden_areasItem) { + ogs_error("No forbidden_areasItem"); + OpenAPI_list_free(forbidden_areasList); + goto end; + } + OpenAPI_list_add(forbidden_areasList, forbidden_areasItem); } - - OpenAPI_list_add(forbidden_areasList, forbidden_areasItem); - } } - cJSON *service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "serviceAreaRestriction"); - - OpenAPI_service_area_restriction_1_t *service_area_restriction_local_nonprim = NULL; + service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "serviceAreaRestriction"); if (service_area_restriction) { service_area_restriction_local_nonprim = OpenAPI_service_area_restriction_1_parseFromJSON(service_area_restriction); } - cJSON *core_network_type_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "coreNetworkTypeRestrictions"); - - OpenAPI_list_t *core_network_type_restrictionsList; + core_network_type_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "coreNetworkTypeRestrictions"); if (core_network_type_restrictions) { - cJSON *core_network_type_restrictions_local_nonprimitive; - if (!cJSON_IsArray(core_network_type_restrictions)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [core_network_type_restrictions]"); - goto end; - } - - core_network_type_restrictionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(core_network_type_restrictions_local_nonprimitive, core_network_type_restrictions ) { - if (!cJSON_IsString(core_network_type_restrictions_local_nonprimitive)){ + cJSON *core_network_type_restrictions_local = NULL; + if (!cJSON_IsArray(core_network_type_restrictions)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [core_network_type_restrictions]"); goto end; } - OpenAPI_list_add(core_network_type_restrictionsList, (void *)OpenAPI_core_network_type_FromString(core_network_type_restrictions_local_nonprimitive->valuestring)); - } + core_network_type_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(core_network_type_restrictions_local, core_network_type_restrictions) { + if (!cJSON_IsString(core_network_type_restrictions_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [core_network_type_restrictions]"); + goto end; + } + OpenAPI_list_add(core_network_type_restrictionsList, (void *)OpenAPI_core_network_type_FromString(core_network_type_restrictions_local->valuestring)); + } } - cJSON *rfsp_index = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "rfspIndex"); - + rfsp_index = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "rfspIndex"); if (rfsp_index) { if (!cJSON_IsNumber(rfsp_index)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [rfsp_index]"); @@ -912,8 +1030,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *subs_reg_timer = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "subsRegTimer"); - + subs_reg_timer = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "subsRegTimer"); if (subs_reg_timer) { if (!cJSON_IsNumber(subs_reg_timer)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [subs_reg_timer]"); @@ -921,8 +1038,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *ue_usage_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ueUsageType"); - + ue_usage_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ueUsageType"); if (ue_usage_type) { if (!cJSON_IsNumber(ue_usage_type)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [ue_usage_type]"); @@ -930,8 +1046,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *mps_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "mpsPriority"); - + mps_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "mpsPriority"); if (mps_priority) { if (!cJSON_IsBool(mps_priority)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [mps_priority]"); @@ -939,8 +1054,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *mcs_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "mcsPriority"); - + mcs_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "mcsPriority"); if (mcs_priority) { if (!cJSON_IsBool(mcs_priority)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [mcs_priority]"); @@ -948,8 +1062,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *active_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "activeTime"); - + active_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "activeTime"); if (active_time) { if (!cJSON_IsNumber(active_time)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [active_time]"); @@ -957,15 +1070,12 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *sor_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sorInfo"); - - OpenAPI_sor_info_1_t *sor_info_local_nonprim = NULL; + sor_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sorInfo"); if (sor_info) { sor_info_local_nonprim = OpenAPI_sor_info_1_parseFromJSON(sor_info); } - cJSON *sor_info_expect_ind = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sorInfoExpectInd"); - + sor_info_expect_ind = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sorInfoExpectInd"); if (sor_info_expect_ind) { if (!cJSON_IsBool(sor_info_expect_ind)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [sor_info_expect_ind]"); @@ -973,8 +1083,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *soraf_retrieval = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sorafRetrieval"); - + soraf_retrieval = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sorafRetrieval"); if (soraf_retrieval) { if (!cJSON_IsBool(soraf_retrieval)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [soraf_retrieval]"); @@ -982,37 +1091,31 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *sor_update_indicator_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sorUpdateIndicatorList"); - - OpenAPI_list_t *sor_update_indicator_listList; + sor_update_indicator_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sorUpdateIndicatorList"); if (sor_update_indicator_list) { - cJSON *sor_update_indicator_list_local_nonprimitive; - if (!cJSON_IsArray(sor_update_indicator_list)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [sor_update_indicator_list]"); - goto end; - } - - sor_update_indicator_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sor_update_indicator_list_local_nonprimitive, sor_update_indicator_list ) { - if (!cJSON_IsString(sor_update_indicator_list_local_nonprimitive)){ + cJSON *sor_update_indicator_list_local = NULL; + if (!cJSON_IsArray(sor_update_indicator_list)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [sor_update_indicator_list]"); goto end; } - OpenAPI_list_add(sor_update_indicator_listList, (void *)OpenAPI_sor_update_indicator_FromString(sor_update_indicator_list_local_nonprimitive->valuestring)); - } + sor_update_indicator_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sor_update_indicator_list_local, sor_update_indicator_list) { + if (!cJSON_IsString(sor_update_indicator_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [sor_update_indicator_list]"); + goto end; + } + OpenAPI_list_add(sor_update_indicator_listList, (void *)OpenAPI_sor_update_indicator_FromString(sor_update_indicator_list_local->valuestring)); + } } - cJSON *upu_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "upuInfo"); - - OpenAPI_upu_info_1_t *upu_info_local_nonprim = NULL; + upu_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "upuInfo"); if (upu_info) { upu_info_local_nonprim = OpenAPI_upu_info_1_parseFromJSON(upu_info); } - cJSON *mico_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "micoAllowed"); - + mico_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "micoAllowed"); if (mico_allowed) { if (!cJSON_IsBool(mico_allowed)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [mico_allowed]"); @@ -1020,29 +1123,28 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *shared_am_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sharedAmDataIds"); - - OpenAPI_list_t *shared_am_data_idsList; + shared_am_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "sharedAmDataIds"); if (shared_am_data_ids) { - cJSON *shared_am_data_ids_local; - if (!cJSON_IsArray(shared_am_data_ids)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [shared_am_data_ids]"); - goto end; - } - shared_am_data_idsList = OpenAPI_list_create(); + cJSON *shared_am_data_ids_local = NULL; + if (!cJSON_IsArray(shared_am_data_ids)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [shared_am_data_ids]"); + goto end; + } - cJSON_ArrayForEach(shared_am_data_ids_local, shared_am_data_ids) { - if (!cJSON_IsString(shared_am_data_ids_local)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [shared_am_data_ids]"); - goto end; - } - OpenAPI_list_add(shared_am_data_idsList, ogs_strdup(shared_am_data_ids_local->valuestring)); - } + shared_am_data_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(shared_am_data_ids_local, shared_am_data_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(shared_am_data_ids_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [shared_am_data_ids]"); + goto end; + } + OpenAPI_list_add(shared_am_data_idsList, ogs_strdup(shared_am_data_ids_local->valuestring)); + } } - cJSON *odb_packet_services = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "odbPacketServices"); - - OpenAPI_odb_packet_services_e odb_packet_servicesVariable; + odb_packet_services = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "odbPacketServices"); if (odb_packet_services) { if (!cJSON_IsString(odb_packet_services)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [odb_packet_services]"); @@ -1051,28 +1153,28 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s odb_packet_servicesVariable = OpenAPI_odb_packet_services_FromString(odb_packet_services->valuestring); } - cJSON *subscribed_dnn_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "subscribedDnnList"); - - OpenAPI_list_t *subscribed_dnn_listList; + subscribed_dnn_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "subscribedDnnList"); if (subscribed_dnn_list) { - cJSON *subscribed_dnn_list_local; - if (!cJSON_IsArray(subscribed_dnn_list)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [subscribed_dnn_list]"); - goto end; - } - subscribed_dnn_listList = OpenAPI_list_create(); + cJSON *subscribed_dnn_list_local = NULL; + if (!cJSON_IsArray(subscribed_dnn_list)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [subscribed_dnn_list]"); + goto end; + } - cJSON_ArrayForEach(subscribed_dnn_list_local, subscribed_dnn_list) { - if (!cJSON_IsString(subscribed_dnn_list_local)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [subscribed_dnn_list]"); - goto end; - } - OpenAPI_list_add(subscribed_dnn_listList, ogs_strdup(subscribed_dnn_list_local->valuestring)); - } + subscribed_dnn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscribed_dnn_list_local, subscribed_dnn_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(subscribed_dnn_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [subscribed_dnn_list]"); + goto end; + } + OpenAPI_list_add(subscribed_dnn_listList, ogs_strdup(subscribed_dnn_list_local->valuestring)); + } } - cJSON *service_gap_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "serviceGapTime"); - + service_gap_time = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "serviceGapTime"); if (service_gap_time) { if (!cJSON_IsNumber(service_gap_time)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [service_gap_time]"); @@ -1080,9 +1182,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *mdt_user_consent = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "mdtUserConsent"); - - OpenAPI_mdt_user_consent_e mdt_user_consentVariable; + mdt_user_consent = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "mdtUserConsent"); if (mdt_user_consent) { if (!cJSON_IsString(mdt_user_consent)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [mdt_user_consent]"); @@ -1091,47 +1191,38 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s mdt_user_consentVariable = OpenAPI_mdt_user_consent_FromString(mdt_user_consent->valuestring); } - cJSON *mdt_configuration = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "mdtConfiguration"); - - OpenAPI_mdt_configuration_1_t *mdt_configuration_local_nonprim = NULL; + mdt_configuration = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "mdtConfiguration"); if (mdt_configuration) { mdt_configuration_local_nonprim = OpenAPI_mdt_configuration_1_parseFromJSON(mdt_configuration); } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *cag_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "cagData"); - - OpenAPI_cag_data_1_t *cag_data_local_nonprim = NULL; + cag_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "cagData"); if (cag_data) { cag_data_local_nonprim = OpenAPI_cag_data_1_parseFromJSON(cag_data); } - cJSON *stn_sr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "stnSr"); - + stn_sr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "stnSr"); if (stn_sr) { - if (!cJSON_IsString(stn_sr)) { + if (!cJSON_IsString(stn_sr) && !cJSON_IsNull(stn_sr)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [stn_sr]"); goto end; } } - cJSON *c_msisdn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "cMsisdn"); - + c_msisdn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "cMsisdn"); if (c_msisdn) { - if (!cJSON_IsString(c_msisdn)) { + if (!cJSON_IsString(c_msisdn) && !cJSON_IsNull(c_msisdn)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [c_msisdn]"); goto end; } } - cJSON *nb_io_tue_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "nbIoTUePriority"); - + nb_io_tue_priority = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "nbIoTUePriority"); if (nb_io_tue_priority) { if (!cJSON_IsNumber(nb_io_tue_priority)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [nb_io_tue_priority]"); @@ -1139,8 +1230,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *nssai_inclusion_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "nssaiInclusionAllowed"); - + nssai_inclusion_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "nssaiInclusionAllowed"); if (nssai_inclusion_allowed) { if (!cJSON_IsBool(nssai_inclusion_allowed)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [nssai_inclusion_allowed]"); @@ -1148,24 +1238,20 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *rg_wireline_characteristics = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "rgWirelineCharacteristics"); - + rg_wireline_characteristics = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "rgWirelineCharacteristics"); if (rg_wireline_characteristics) { - if (!cJSON_IsString(rg_wireline_characteristics)) { + if (!cJSON_IsString(rg_wireline_characteristics) && !cJSON_IsNull(rg_wireline_characteristics)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [rg_wireline_characteristics]"); goto end; } } - cJSON *ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ecRestrictionDataWb"); - - OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL; + ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ecRestrictionDataWb"); if (ec_restriction_data_wb) { ec_restriction_data_wb_local_nonprim = OpenAPI_ec_restriction_data_wb_parseFromJSON(ec_restriction_data_wb); } - cJSON *ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ecRestrictionDataNb"); - + ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ecRestrictionDataNb"); if (ec_restriction_data_nb) { if (!cJSON_IsBool(ec_restriction_data_nb)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [ec_restriction_data_nb]"); @@ -1173,117 +1259,100 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *expected_ue_behaviour_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "expectedUeBehaviourList"); - - OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_list_local_nonprim = NULL; + expected_ue_behaviour_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "expectedUeBehaviourList"); if (expected_ue_behaviour_list) { expected_ue_behaviour_list_local_nonprim = OpenAPI_expected_ue_behaviour_data_1_parseFromJSON(expected_ue_behaviour_list); } - cJSON *primary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "primaryRatRestrictions"); - - OpenAPI_list_t *primary_rat_restrictionsList; + primary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "primaryRatRestrictions"); if (primary_rat_restrictions) { - cJSON *primary_rat_restrictions_local_nonprimitive; - if (!cJSON_IsArray(primary_rat_restrictions)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [primary_rat_restrictions]"); - goto end; - } - - primary_rat_restrictionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(primary_rat_restrictions_local_nonprimitive, primary_rat_restrictions ) { - if (!cJSON_IsString(primary_rat_restrictions_local_nonprimitive)){ + cJSON *primary_rat_restrictions_local = NULL; + if (!cJSON_IsArray(primary_rat_restrictions)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [primary_rat_restrictions]"); goto end; } - OpenAPI_list_add(primary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(primary_rat_restrictions_local_nonprimitive->valuestring)); - } + primary_rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(primary_rat_restrictions_local, primary_rat_restrictions) { + if (!cJSON_IsString(primary_rat_restrictions_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [primary_rat_restrictions]"); + goto end; + } + OpenAPI_list_add(primary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(primary_rat_restrictions_local->valuestring)); + } } - cJSON *secondary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "secondaryRatRestrictions"); - - OpenAPI_list_t *secondary_rat_restrictionsList; + secondary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "secondaryRatRestrictions"); if (secondary_rat_restrictions) { - cJSON *secondary_rat_restrictions_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_restrictions)) { - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [secondary_rat_restrictions]"); - goto end; - } - - secondary_rat_restrictionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_restrictions_local_nonprimitive, secondary_rat_restrictions ) { - if (!cJSON_IsString(secondary_rat_restrictions_local_nonprimitive)){ + cJSON *secondary_rat_restrictions_local = NULL; + if (!cJSON_IsArray(secondary_rat_restrictions)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [secondary_rat_restrictions]"); goto end; } - OpenAPI_list_add(secondary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(secondary_rat_restrictions_local_nonprimitive->valuestring)); - } + secondary_rat_restrictionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_restrictions_local, secondary_rat_restrictions) { + if (!cJSON_IsString(secondary_rat_restrictions_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [secondary_rat_restrictions]"); + goto end; + } + OpenAPI_list_add(secondary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(secondary_rat_restrictions_local->valuestring)); + } } - cJSON *edrx_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "edrxParametersList"); - - OpenAPI_list_t *edrx_parameters_listList; + edrx_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "edrxParametersList"); if (edrx_parameters_list) { - cJSON *edrx_parameters_list_local_nonprimitive; - if (!cJSON_IsArray(edrx_parameters_list)){ - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [edrx_parameters_list]"); - goto end; - } - - edrx_parameters_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(edrx_parameters_list_local_nonprimitive, edrx_parameters_list ) { - if (!cJSON_IsObject(edrx_parameters_list_local_nonprimitive)) { + cJSON *edrx_parameters_list_local = NULL; + if (!cJSON_IsArray(edrx_parameters_list)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [edrx_parameters_list]"); goto end; } - OpenAPI_edrx_parameters_1_t *edrx_parameters_listItem = OpenAPI_edrx_parameters_1_parseFromJSON(edrx_parameters_list_local_nonprimitive); - if (!edrx_parameters_listItem) { - ogs_error("No edrx_parameters_listItem"); - OpenAPI_list_free(edrx_parameters_listList); - goto end; + edrx_parameters_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(edrx_parameters_list_local, edrx_parameters_list) { + if (!cJSON_IsObject(edrx_parameters_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [edrx_parameters_list]"); + goto end; + } + OpenAPI_edrx_parameters_1_t *edrx_parameters_listItem = OpenAPI_edrx_parameters_1_parseFromJSON(edrx_parameters_list_local); + if (!edrx_parameters_listItem) { + ogs_error("No edrx_parameters_listItem"); + OpenAPI_list_free(edrx_parameters_listList); + goto end; + } + OpenAPI_list_add(edrx_parameters_listList, edrx_parameters_listItem); } - - OpenAPI_list_add(edrx_parameters_listList, edrx_parameters_listItem); - } } - cJSON *ptw_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ptwParametersList"); - - OpenAPI_list_t *ptw_parameters_listList; + ptw_parameters_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "ptwParametersList"); if (ptw_parameters_list) { - cJSON *ptw_parameters_list_local_nonprimitive; - if (!cJSON_IsArray(ptw_parameters_list)){ - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [ptw_parameters_list]"); - goto end; - } - - ptw_parameters_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ptw_parameters_list_local_nonprimitive, ptw_parameters_list ) { - if (!cJSON_IsObject(ptw_parameters_list_local_nonprimitive)) { + cJSON *ptw_parameters_list_local = NULL; + if (!cJSON_IsArray(ptw_parameters_list)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [ptw_parameters_list]"); goto end; } - OpenAPI_ptw_parameters_1_t *ptw_parameters_listItem = OpenAPI_ptw_parameters_1_parseFromJSON(ptw_parameters_list_local_nonprimitive); - if (!ptw_parameters_listItem) { - ogs_error("No ptw_parameters_listItem"); - OpenAPI_list_free(ptw_parameters_listList); - goto end; + ptw_parameters_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ptw_parameters_list_local, ptw_parameters_list) { + if (!cJSON_IsObject(ptw_parameters_list_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [ptw_parameters_list]"); + goto end; + } + OpenAPI_ptw_parameters_1_t *ptw_parameters_listItem = OpenAPI_ptw_parameters_1_parseFromJSON(ptw_parameters_list_local); + if (!ptw_parameters_listItem) { + ogs_error("No ptw_parameters_listItem"); + OpenAPI_list_free(ptw_parameters_listList); + goto end; + } + OpenAPI_list_add(ptw_parameters_listList, ptw_parameters_listItem); } - - OpenAPI_list_add(ptw_parameters_listList, ptw_parameters_listItem); - } } - cJSON *iab_operation_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "iabOperationAllowed"); - + iab_operation_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "iabOperationAllowed"); if (iab_operation_allowed) { if (!cJSON_IsBool(iab_operation_allowed)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [iab_operation_allowed]"); @@ -1291,44 +1360,38 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s } } - cJSON *wireline_forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "wirelineForbiddenAreas"); - - OpenAPI_list_t *wireline_forbidden_areasList; + wireline_forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "wirelineForbiddenAreas"); if (wireline_forbidden_areas) { - cJSON *wireline_forbidden_areas_local_nonprimitive; - if (!cJSON_IsArray(wireline_forbidden_areas)){ - ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [wireline_forbidden_areas]"); - goto end; - } - - wireline_forbidden_areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(wireline_forbidden_areas_local_nonprimitive, wireline_forbidden_areas ) { - if (!cJSON_IsObject(wireline_forbidden_areas_local_nonprimitive)) { + cJSON *wireline_forbidden_areas_local = NULL; + if (!cJSON_IsArray(wireline_forbidden_areas)) { ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [wireline_forbidden_areas]"); goto end; } - OpenAPI_wireline_area_1_t *wireline_forbidden_areasItem = OpenAPI_wireline_area_1_parseFromJSON(wireline_forbidden_areas_local_nonprimitive); - if (!wireline_forbidden_areasItem) { - ogs_error("No wireline_forbidden_areasItem"); - OpenAPI_list_free(wireline_forbidden_areasList); - goto end; + wireline_forbidden_areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(wireline_forbidden_areas_local, wireline_forbidden_areas) { + if (!cJSON_IsObject(wireline_forbidden_areas_local)) { + ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [wireline_forbidden_areas]"); + goto end; + } + OpenAPI_wireline_area_1_t *wireline_forbidden_areasItem = OpenAPI_wireline_area_1_parseFromJSON(wireline_forbidden_areas_local); + if (!wireline_forbidden_areasItem) { + ogs_error("No wireline_forbidden_areasItem"); + OpenAPI_list_free(wireline_forbidden_areasList); + goto end; + } + OpenAPI_list_add(wireline_forbidden_areasList, wireline_forbidden_areasItem); } - - OpenAPI_list_add(wireline_forbidden_areasList, wireline_forbidden_areasItem); - } } - cJSON *wireline_service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "wirelineServiceAreaRestriction"); - - OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction_local_nonprim = NULL; + wireline_service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "wirelineServiceAreaRestriction"); if (wireline_service_area_restriction) { wireline_service_area_restriction_local_nonprim = OpenAPI_wireline_service_area_restriction_1_parseFromJSON(wireline_service_area_restriction); } access_and_mobility_subscription_data_1_local_var = OpenAPI_access_and_mobility_subscription_data_1_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, gpsis ? gpsisList : NULL, internal_group_ids ? internal_group_idsList : NULL, shared_vn_group_data_ids ? shared_vn_group_data_idsList : NULL, @@ -1368,13 +1431,13 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s mdt_configuration ? mdt_configuration_local_nonprim : NULL, trace_data ? trace_data_local_nonprim : NULL, cag_data ? cag_data_local_nonprim : NULL, - stn_sr ? ogs_strdup(stn_sr->valuestring) : NULL, - c_msisdn ? ogs_strdup(c_msisdn->valuestring) : NULL, + stn_sr && !cJSON_IsNull(stn_sr) ? ogs_strdup(stn_sr->valuestring) : NULL, + c_msisdn && !cJSON_IsNull(c_msisdn) ? ogs_strdup(c_msisdn->valuestring) : NULL, nb_io_tue_priority ? true : false, nb_io_tue_priority ? nb_io_tue_priority->valuedouble : 0, nssai_inclusion_allowed ? true : false, nssai_inclusion_allowed ? nssai_inclusion_allowed->valueint : 0, - rg_wireline_characteristics ? ogs_strdup(rg_wireline_characteristics->valuestring) : NULL, + rg_wireline_characteristics && !cJSON_IsNull(rg_wireline_characteristics) ? ogs_strdup(rg_wireline_characteristics->valuestring) : NULL, ec_restriction_data_wb ? ec_restriction_data_wb_local_nonprim : NULL, ec_restriction_data_nb ? true : false, ec_restriction_data_nb ? ec_restriction_data_nb->valueint : 0, @@ -1391,6 +1454,136 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s return access_and_mobility_subscription_data_1_local_var; end: + if (gpsisList) { + OpenAPI_list_for_each(gpsisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(gpsisList); + gpsisList = NULL; + } + if (internal_group_idsList) { + OpenAPI_list_for_each(internal_group_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(internal_group_idsList); + internal_group_idsList = NULL; + } + if (shared_vn_group_data_idsList) { + OpenAPI_list_for_each(shared_vn_group_data_idsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_vn_group_data_idsList); + shared_vn_group_data_idsList = NULL; + } + if (subscribed_ue_ambr_local_nonprim) { + OpenAPI_ambr_rm_free(subscribed_ue_ambr_local_nonprim); + subscribed_ue_ambr_local_nonprim = NULL; + } + if (nssai_local_nonprim) { + OpenAPI_nssai_1_free(nssai_local_nonprim); + nssai_local_nonprim = NULL; + } + if (rat_restrictionsList) { + OpenAPI_list_free(rat_restrictionsList); + rat_restrictionsList = NULL; + } + if (forbidden_areasList) { + OpenAPI_list_for_each(forbidden_areasList, node) { + OpenAPI_area_1_free(node->data); + } + OpenAPI_list_free(forbidden_areasList); + forbidden_areasList = NULL; + } + if (service_area_restriction_local_nonprim) { + OpenAPI_service_area_restriction_1_free(service_area_restriction_local_nonprim); + service_area_restriction_local_nonprim = NULL; + } + if (core_network_type_restrictionsList) { + OpenAPI_list_free(core_network_type_restrictionsList); + core_network_type_restrictionsList = NULL; + } + if (sor_info_local_nonprim) { + OpenAPI_sor_info_1_free(sor_info_local_nonprim); + sor_info_local_nonprim = NULL; + } + if (sor_update_indicator_listList) { + OpenAPI_list_free(sor_update_indicator_listList); + sor_update_indicator_listList = NULL; + } + if (upu_info_local_nonprim) { + OpenAPI_upu_info_1_free(upu_info_local_nonprim); + upu_info_local_nonprim = NULL; + } + if (shared_am_data_idsList) { + OpenAPI_list_for_each(shared_am_data_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(shared_am_data_idsList); + shared_am_data_idsList = NULL; + } + if (subscribed_dnn_listList) { + OpenAPI_list_for_each(subscribed_dnn_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subscribed_dnn_listList); + subscribed_dnn_listList = NULL; + } + if (mdt_configuration_local_nonprim) { + OpenAPI_mdt_configuration_1_free(mdt_configuration_local_nonprim); + mdt_configuration_local_nonprim = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (cag_data_local_nonprim) { + OpenAPI_cag_data_1_free(cag_data_local_nonprim); + cag_data_local_nonprim = NULL; + } + if (ec_restriction_data_wb_local_nonprim) { + OpenAPI_ec_restriction_data_wb_free(ec_restriction_data_wb_local_nonprim); + ec_restriction_data_wb_local_nonprim = NULL; + } + if (expected_ue_behaviour_list_local_nonprim) { + OpenAPI_expected_ue_behaviour_data_1_free(expected_ue_behaviour_list_local_nonprim); + expected_ue_behaviour_list_local_nonprim = NULL; + } + if (primary_rat_restrictionsList) { + OpenAPI_list_free(primary_rat_restrictionsList); + primary_rat_restrictionsList = NULL; + } + if (secondary_rat_restrictionsList) { + OpenAPI_list_free(secondary_rat_restrictionsList); + secondary_rat_restrictionsList = NULL; + } + if (edrx_parameters_listList) { + OpenAPI_list_for_each(edrx_parameters_listList, node) { + OpenAPI_edrx_parameters_1_free(node->data); + } + OpenAPI_list_free(edrx_parameters_listList); + edrx_parameters_listList = NULL; + } + if (ptw_parameters_listList) { + OpenAPI_list_for_each(ptw_parameters_listList, node) { + OpenAPI_ptw_parameters_1_free(node->data); + } + OpenAPI_list_free(ptw_parameters_listList); + ptw_parameters_listList = NULL; + } + if (wireline_forbidden_areasList) { + OpenAPI_list_for_each(wireline_forbidden_areasList, node) { + OpenAPI_wireline_area_1_free(node->data); + } + OpenAPI_list_free(wireline_forbidden_areasList); + wireline_forbidden_areasList = NULL; + } + if (wireline_service_area_restriction_local_nonprim) { + OpenAPI_wireline_service_area_restriction_1_free(wireline_service_area_restriction_local_nonprim); + wireline_service_area_restriction_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/access_net_charging_identifier.c b/lib/sbi/openapi/model/access_net_charging_identifier.c index bc996db6e..a996d36da 100644 --- a/lib/sbi/openapi/model/access_net_charging_identifier.c +++ b/lib/sbi/openapi/model/access_net_charging_identifier.c @@ -20,20 +20,25 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier void OpenAPI_access_net_charging_identifier_free(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_net_charging_identifier) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(access_net_charging_identifier->flows, node) { - OpenAPI_flows_free(node->data); + if (access_net_charging_identifier->flows) { + OpenAPI_list_for_each(access_net_charging_identifier->flows, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(access_net_charging_identifier->flows); + access_net_charging_identifier->flows = NULL; } - OpenAPI_list_free(access_net_charging_identifier->flows); ogs_free(access_net_charging_identifier); } cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_net_charging_identifier == NULL) { ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [AccessNetChargingIdentifier]"); @@ -52,17 +57,13 @@ cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_c ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]"); goto end; } - - OpenAPI_lnode_t *flows_node; - if (access_net_charging_identifier->flows) { - OpenAPI_list_for_each(access_net_charging_identifier->flows, flows_node) { - cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]"); - goto end; - } - cJSON_AddItemToArray(flowsList, itemLocal); + OpenAPI_list_for_each(access_net_charging_identifier->flows, node) { + cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]"); + goto end; } + cJSON_AddItemToArray(flowsList, itemLocal); } } @@ -73,44 +74,43 @@ end: OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier_parseFromJSON(cJSON *access_net_charging_identifierJSON) { OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier_local_var = NULL; - cJSON *acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "accNetChaIdValue"); + OpenAPI_lnode_t *node = NULL; + cJSON *acc_net_cha_id_value = NULL; + cJSON *flows = NULL; + OpenAPI_list_t *flowsList = NULL; + acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "accNetChaIdValue"); if (!acc_net_cha_id_value) { ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_cha_id_value]"); goto end; } - if (!cJSON_IsNumber(acc_net_cha_id_value)) { ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_cha_id_value]"); goto end; } - cJSON *flows = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "flows"); - - OpenAPI_list_t *flowsList; + flows = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "flows"); if (flows) { - cJSON *flows_local_nonprimitive; - if (!cJSON_IsArray(flows)){ - ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]"); - goto end; - } - - flowsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(flows_local_nonprimitive, flows ) { - if (!cJSON_IsObject(flows_local_nonprimitive)) { + cJSON *flows_local = NULL; + if (!cJSON_IsArray(flows)) { ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]"); goto end; } - OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive); - if (!flowsItem) { - ogs_error("No flowsItem"); - OpenAPI_list_free(flowsList); - goto end; + flowsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flows_local, flows) { + if (!cJSON_IsObject(flows_local)) { + ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]"); + goto end; + } + OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local); + if (!flowsItem) { + ogs_error("No flowsItem"); + OpenAPI_list_free(flowsList); + goto end; + } + OpenAPI_list_add(flowsList, flowsItem); } - - OpenAPI_list_add(flowsList, flowsItem); - } } access_net_charging_identifier_local_var = OpenAPI_access_net_charging_identifier_create ( @@ -121,6 +121,13 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier return access_net_charging_identifier_local_var; end: + if (flowsList) { + OpenAPI_list_for_each(flowsList, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(flowsList); + flowsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/access_right_status.c b/lib/sbi/openapi/model/access_right_status.c index 142862deb..9f1011bbb 100644 --- a/lib/sbi/openapi/model/access_right_status.c +++ b/lib/sbi/openapi/model/access_right_status.c @@ -16,16 +16,18 @@ OpenAPI_access_right_status_t *OpenAPI_access_right_status_create( void OpenAPI_access_right_status_free(OpenAPI_access_right_status_t *access_right_status) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_right_status) { return; } - OpenAPI_lnode_t *node; ogs_free(access_right_status); } cJSON *OpenAPI_access_right_status_convertToJSON(OpenAPI_access_right_status_t *access_right_status) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_right_status == NULL) { ogs_error("OpenAPI_access_right_status_convertToJSON() failed [AccessRightStatus]"); @@ -40,6 +42,7 @@ end: OpenAPI_access_right_status_t *OpenAPI_access_right_status_parseFromJSON(cJSON *access_right_statusJSON) { OpenAPI_access_right_status_t *access_right_status_local_var = NULL; + OpenAPI_lnode_t *node = NULL; access_right_status_local_var = OpenAPI_access_right_status_create ( ); diff --git a/lib/sbi/openapi/model/access_tech.c b/lib/sbi/openapi/model/access_tech.c index 33e209ff4..5da1abd5b 100644 --- a/lib/sbi/openapi/model/access_tech.c +++ b/lib/sbi/openapi/model/access_tech.c @@ -16,16 +16,18 @@ OpenAPI_access_tech_t *OpenAPI_access_tech_create( void OpenAPI_access_tech_free(OpenAPI_access_tech_t *access_tech) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_tech) { return; } - OpenAPI_lnode_t *node; ogs_free(access_tech); } cJSON *OpenAPI_access_tech_convertToJSON(OpenAPI_access_tech_t *access_tech) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_tech == NULL) { ogs_error("OpenAPI_access_tech_convertToJSON() failed [AccessTech]"); @@ -40,6 +42,7 @@ end: OpenAPI_access_tech_t *OpenAPI_access_tech_parseFromJSON(cJSON *access_techJSON) { OpenAPI_access_tech_t *access_tech_local_var = NULL; + OpenAPI_lnode_t *node = NULL; access_tech_local_var = OpenAPI_access_tech_create ( ); diff --git a/lib/sbi/openapi/model/access_token_err.c b/lib/sbi/openapi/model/access_token_err.c index bf3e72895..1c8f0afb7 100644 --- a/lib/sbi/openapi/model/access_token_err.c +++ b/lib/sbi/openapi/model/access_token_err.c @@ -45,18 +45,26 @@ OpenAPI_access_token_err_t *OpenAPI_access_token_err_create( void OpenAPI_access_token_err_free(OpenAPI_access_token_err_t *access_token_err) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_token_err) { return; } - OpenAPI_lnode_t *node; - ogs_free(access_token_err->error_description); - ogs_free(access_token_err->error_uri); + if (access_token_err->error_description) { + ogs_free(access_token_err->error_description); + access_token_err->error_description = NULL; + } + if (access_token_err->error_uri) { + ogs_free(access_token_err->error_uri); + access_token_err->error_uri = NULL; + } ogs_free(access_token_err); } cJSON *OpenAPI_access_token_err_convertToJSON(OpenAPI_access_token_err_t *access_token_err) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_token_err == NULL) { ogs_error("OpenAPI_access_token_err_convertToJSON() failed [AccessTokenErr]"); @@ -64,6 +72,10 @@ cJSON *OpenAPI_access_token_err_convertToJSON(OpenAPI_access_token_err_t *access } item = cJSON_CreateObject(); + if (access_token_err->error == OpenAPI_access_token_err_ERROR_NULL) { + ogs_error("OpenAPI_access_token_err_convertToJSON() failed [error]"); + return NULL; + } if (cJSON_AddStringToObject(item, "error", OpenAPI_erroraccess_token_err_ToString(access_token_err->error)) == NULL) { ogs_error("OpenAPI_access_token_err_convertToJSON() failed [error]"); goto end; @@ -90,32 +102,33 @@ end: OpenAPI_access_token_err_t *OpenAPI_access_token_err_parseFromJSON(cJSON *access_token_errJSON) { OpenAPI_access_token_err_t *access_token_err_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_access_token_err_error_e errorVariable = 0; + cJSON *error_description = NULL; + cJSON *error_uri = NULL; + error = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error"); if (!error) { ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_access_token_err_error_e errorVariable; if (!cJSON_IsString(error)) { ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error]"); goto end; } errorVariable = OpenAPI_erroraccess_token_err_FromString(error->valuestring); - cJSON *error_description = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_description"); - + error_description = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_description"); if (error_description) { - if (!cJSON_IsString(error_description)) { + if (!cJSON_IsString(error_description) && !cJSON_IsNull(error_description)) { ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error_description]"); goto end; } } - cJSON *error_uri = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_uri"); - + error_uri = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_uri"); if (error_uri) { - if (!cJSON_IsString(error_uri)) { + if (!cJSON_IsString(error_uri) && !cJSON_IsNull(error_uri)) { ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error_uri]"); goto end; } @@ -123,8 +136,8 @@ OpenAPI_access_token_err_t *OpenAPI_access_token_err_parseFromJSON(cJSON *access access_token_err_local_var = OpenAPI_access_token_err_create ( errorVariable, - error_description ? ogs_strdup(error_description->valuestring) : NULL, - error_uri ? ogs_strdup(error_uri->valuestring) : NULL + error_description && !cJSON_IsNull(error_description) ? ogs_strdup(error_description->valuestring) : NULL, + error_uri && !cJSON_IsNull(error_uri) ? ogs_strdup(error_uri->valuestring) : NULL ); return access_token_err_local_var; diff --git a/lib/sbi/openapi/model/access_token_req.c b/lib/sbi/openapi/model/access_token_req.c index 2963267fe..6924a0a0e 100644 --- a/lib/sbi/openapi/model/access_token_req.c +++ b/lib/sbi/openapi/model/access_token_req.c @@ -71,44 +71,85 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_create( void OpenAPI_access_token_req_free(OpenAPI_access_token_req_t *access_token_req) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_token_req) { return; } - OpenAPI_lnode_t *node; - ogs_free(access_token_req->nf_instance_id); - ogs_free(access_token_req->scope); - ogs_free(access_token_req->target_nf_instance_id); - OpenAPI_plmn_id_free(access_token_req->requester_plmn); - OpenAPI_list_for_each(access_token_req->requester_plmn_list, node) { - OpenAPI_plmn_id_free(node->data); + if (access_token_req->nf_instance_id) { + ogs_free(access_token_req->nf_instance_id); + access_token_req->nf_instance_id = NULL; } - OpenAPI_list_free(access_token_req->requester_plmn_list); - OpenAPI_list_for_each(access_token_req->requester_snssai_list, node) { - OpenAPI_snssai_free(node->data); + if (access_token_req->scope) { + ogs_free(access_token_req->scope); + access_token_req->scope = NULL; } - OpenAPI_list_free(access_token_req->requester_snssai_list); - ogs_free(access_token_req->requester_fqdn); - OpenAPI_list_for_each(access_token_req->requester_snpn_list, node) { - OpenAPI_plmn_id_nid_free(node->data); + if (access_token_req->target_nf_instance_id) { + ogs_free(access_token_req->target_nf_instance_id); + access_token_req->target_nf_instance_id = NULL; } - OpenAPI_list_free(access_token_req->requester_snpn_list); - OpenAPI_plmn_id_free(access_token_req->target_plmn); - OpenAPI_list_for_each(access_token_req->target_snssai_list, node) { - OpenAPI_snssai_free(node->data); + if (access_token_req->requester_plmn) { + OpenAPI_plmn_id_free(access_token_req->requester_plmn); + access_token_req->requester_plmn = NULL; } - OpenAPI_list_free(access_token_req->target_snssai_list); - OpenAPI_list_for_each(access_token_req->target_nsi_list, node) { - ogs_free(node->data); + if (access_token_req->requester_plmn_list) { + OpenAPI_list_for_each(access_token_req->requester_plmn_list, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(access_token_req->requester_plmn_list); + access_token_req->requester_plmn_list = NULL; + } + if (access_token_req->requester_snssai_list) { + OpenAPI_list_for_each(access_token_req->requester_snssai_list, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(access_token_req->requester_snssai_list); + access_token_req->requester_snssai_list = NULL; + } + if (access_token_req->requester_fqdn) { + ogs_free(access_token_req->requester_fqdn); + access_token_req->requester_fqdn = NULL; + } + if (access_token_req->requester_snpn_list) { + OpenAPI_list_for_each(access_token_req->requester_snpn_list, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(access_token_req->requester_snpn_list); + access_token_req->requester_snpn_list = NULL; + } + if (access_token_req->target_plmn) { + OpenAPI_plmn_id_free(access_token_req->target_plmn); + access_token_req->target_plmn = NULL; + } + if (access_token_req->target_snssai_list) { + OpenAPI_list_for_each(access_token_req->target_snssai_list, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(access_token_req->target_snssai_list); + access_token_req->target_snssai_list = NULL; + } + if (access_token_req->target_nsi_list) { + OpenAPI_list_for_each(access_token_req->target_nsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(access_token_req->target_nsi_list); + access_token_req->target_nsi_list = NULL; + } + if (access_token_req->target_nf_set_id) { + ogs_free(access_token_req->target_nf_set_id); + access_token_req->target_nf_set_id = NULL; + } + if (access_token_req->target_nf_service_set_id) { + ogs_free(access_token_req->target_nf_service_set_id); + access_token_req->target_nf_service_set_id = NULL; } - OpenAPI_list_free(access_token_req->target_nsi_list); - ogs_free(access_token_req->target_nf_set_id); - ogs_free(access_token_req->target_nf_service_set_id); ogs_free(access_token_req); } cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access_token_req) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_token_req == NULL) { ogs_error("OpenAPI_access_token_req_convertToJSON() failed [AccessTokenReq]"); @@ -116,30 +157,42 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access } item = cJSON_CreateObject(); + if (access_token_req->grant_type == OpenAPI_access_token_req_GRANTTYPE_NULL) { + ogs_error("OpenAPI_access_token_req_convertToJSON() failed [grant_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "grant_type", OpenAPI_grant_typeaccess_token_req_ToString(access_token_req->grant_type)) == NULL) { ogs_error("OpenAPI_access_token_req_convertToJSON() failed [grant_type]"); goto end; } + if (!access_token_req->nf_instance_id) { + ogs_error("OpenAPI_access_token_req_convertToJSON() failed [nf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfInstanceId", access_token_req->nf_instance_id) == NULL) { ogs_error("OpenAPI_access_token_req_convertToJSON() failed [nf_instance_id]"); goto end; } - if (access_token_req->nf_type) { + if (access_token_req->nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "nfType", OpenAPI_nf_type_ToString(access_token_req->nf_type)) == NULL) { ogs_error("OpenAPI_access_token_req_convertToJSON() failed [nf_type]"); goto end; } } - if (access_token_req->target_nf_type) { + if (access_token_req->target_nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "targetNfType", OpenAPI_nf_type_ToString(access_token_req->target_nf_type)) == NULL) { ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nf_type]"); goto end; } } + if (!access_token_req->scope) { + ogs_error("OpenAPI_access_token_req_convertToJSON() failed [scope]"); + return NULL; + } if (cJSON_AddStringToObject(item, "scope", access_token_req->scope) == NULL) { ogs_error("OpenAPI_access_token_req_convertToJSON() failed [scope]"); goto end; @@ -171,17 +224,13 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_plmn_list]"); goto end; } - - OpenAPI_lnode_t *requester_plmn_list_node; - if (access_token_req->requester_plmn_list) { - OpenAPI_list_for_each(access_token_req->requester_plmn_list, requester_plmn_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(requester_plmn_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_plmn_list]"); - goto end; - } - cJSON_AddItemToArray(requester_plmn_listList, itemLocal); + OpenAPI_list_for_each(access_token_req->requester_plmn_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_plmn_list]"); + goto end; } + cJSON_AddItemToArray(requester_plmn_listList, itemLocal); } } @@ -191,17 +240,13 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snssai_list]"); goto end; } - - OpenAPI_lnode_t *requester_snssai_list_node; - if (access_token_req->requester_snssai_list) { - OpenAPI_list_for_each(access_token_req->requester_snssai_list, requester_snssai_list_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(requester_snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snssai_list]"); - goto end; - } - cJSON_AddItemToArray(requester_snssai_listList, itemLocal); + OpenAPI_list_for_each(access_token_req->requester_snssai_list, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snssai_list]"); + goto end; } + cJSON_AddItemToArray(requester_snssai_listList, itemLocal); } } @@ -218,17 +263,13 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snpn_list]"); goto end; } - - OpenAPI_lnode_t *requester_snpn_list_node; - if (access_token_req->requester_snpn_list) { - OpenAPI_list_for_each(access_token_req->requester_snpn_list, requester_snpn_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(requester_snpn_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snpn_list]"); - goto end; - } - cJSON_AddItemToArray(requester_snpn_listList, itemLocal); + OpenAPI_list_for_each(access_token_req->requester_snpn_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snpn_list]"); + goto end; } + cJSON_AddItemToArray(requester_snpn_listList, itemLocal); } } @@ -251,34 +292,28 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_snssai_list]"); goto end; } - - OpenAPI_lnode_t *target_snssai_list_node; - if (access_token_req->target_snssai_list) { - OpenAPI_list_for_each(access_token_req->target_snssai_list, target_snssai_list_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(target_snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_snssai_list]"); - goto end; - } - cJSON_AddItemToArray(target_snssai_listList, itemLocal); + OpenAPI_list_for_each(access_token_req->target_snssai_list, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_snssai_list]"); + goto end; } + cJSON_AddItemToArray(target_snssai_listList, itemLocal); } } if (access_token_req->target_nsi_list) { - cJSON *target_nsi_list = cJSON_AddArrayToObject(item, "targetNsiList"); - if (target_nsi_list == NULL) { + cJSON *target_nsi_listList = cJSON_AddArrayToObject(item, "targetNsiList"); + if (target_nsi_listList == NULL) { ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nsi_list]"); goto end; } - - OpenAPI_lnode_t *target_nsi_list_node; - OpenAPI_list_for_each(access_token_req->target_nsi_list, target_nsi_list_node) { - if (cJSON_AddStringToObject(target_nsi_list, "", (char*)target_nsi_list_node->data) == NULL) { - ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nsi_list]"); - goto end; + OpenAPI_list_for_each(access_token_req->target_nsi_list, node) { + if (cJSON_AddStringToObject(target_nsi_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nsi_list]"); + goto end; + } } - } } if (access_token_req->target_nf_set_id) { @@ -302,33 +337,55 @@ end: OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access_token_reqJSON) { OpenAPI_access_token_req_t *access_token_req_local_var = NULL; - cJSON *grant_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "grant_type"); + OpenAPI_lnode_t *node = NULL; + cJSON *grant_type = NULL; + OpenAPI_access_token_req_grant_type_e grant_typeVariable = 0; + cJSON *nf_instance_id = NULL; + cJSON *nf_type = NULL; + OpenAPI_nf_type_e nf_typeVariable = 0; + cJSON *target_nf_type = NULL; + OpenAPI_nf_type_e target_nf_typeVariable = 0; + cJSON *scope = NULL; + cJSON *target_nf_instance_id = NULL; + cJSON *requester_plmn = NULL; + OpenAPI_plmn_id_t *requester_plmn_local_nonprim = NULL; + cJSON *requester_plmn_list = NULL; + OpenAPI_list_t *requester_plmn_listList = NULL; + cJSON *requester_snssai_list = NULL; + OpenAPI_list_t *requester_snssai_listList = NULL; + cJSON *requester_fqdn = NULL; + cJSON *requester_snpn_list = NULL; + OpenAPI_list_t *requester_snpn_listList = NULL; + cJSON *target_plmn = NULL; + OpenAPI_plmn_id_t *target_plmn_local_nonprim = NULL; + cJSON *target_snssai_list = NULL; + OpenAPI_list_t *target_snssai_listList = NULL; + cJSON *target_nsi_list = NULL; + OpenAPI_list_t *target_nsi_listList = NULL; + cJSON *target_nf_set_id = NULL; + cJSON *target_nf_service_set_id = NULL; + grant_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "grant_type"); if (!grant_type) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [grant_type]"); goto end; } - - OpenAPI_access_token_req_grant_type_e grant_typeVariable; if (!cJSON_IsString(grant_type)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [grant_type]"); goto end; } grant_typeVariable = OpenAPI_grant_typeaccess_token_req_FromString(grant_type->valuestring); - cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "nfInstanceId"); + nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "nfInstanceId"); if (!nf_instance_id) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [nf_instance_id]"); goto end; } - if (!cJSON_IsString(nf_instance_id)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [nf_instance_id]"); goto end; } - cJSON *nf_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "nfType"); - - OpenAPI_nf_type_e nf_typeVariable; + nf_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "nfType"); if (nf_type) { if (!cJSON_IsString(nf_type)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [nf_type]"); @@ -337,9 +394,7 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access nf_typeVariable = OpenAPI_nf_type_FromString(nf_type->valuestring); } - cJSON *target_nf_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfType"); - - OpenAPI_nf_type_e target_nf_typeVariable; + target_nf_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfType"); if (target_nf_type) { if (!cJSON_IsString(target_nf_type)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_type]"); @@ -348,198 +403,174 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access target_nf_typeVariable = OpenAPI_nf_type_FromString(target_nf_type->valuestring); } - cJSON *scope = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "scope"); + scope = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "scope"); if (!scope) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [scope]"); goto end; } - if (!cJSON_IsString(scope)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [scope]"); goto end; } - cJSON *target_nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfInstanceId"); - + target_nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfInstanceId"); if (target_nf_instance_id) { - if (!cJSON_IsString(target_nf_instance_id)) { + if (!cJSON_IsString(target_nf_instance_id) && !cJSON_IsNull(target_nf_instance_id)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_instance_id]"); goto end; } } - cJSON *requester_plmn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterPlmn"); - - OpenAPI_plmn_id_t *requester_plmn_local_nonprim = NULL; + requester_plmn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterPlmn"); if (requester_plmn) { requester_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(requester_plmn); } - cJSON *requester_plmn_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterPlmnList"); - - OpenAPI_list_t *requester_plmn_listList; + requester_plmn_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterPlmnList"); if (requester_plmn_list) { - cJSON *requester_plmn_list_local_nonprimitive; - if (!cJSON_IsArray(requester_plmn_list)){ - ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_plmn_list]"); - goto end; - } - - requester_plmn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(requester_plmn_list_local_nonprimitive, requester_plmn_list ) { - if (!cJSON_IsObject(requester_plmn_list_local_nonprimitive)) { + cJSON *requester_plmn_list_local = NULL; + if (!cJSON_IsArray(requester_plmn_list)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_plmn_list]"); goto end; } - OpenAPI_plmn_id_t *requester_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(requester_plmn_list_local_nonprimitive); - if (!requester_plmn_listItem) { - ogs_error("No requester_plmn_listItem"); - OpenAPI_list_free(requester_plmn_listList); - goto end; + requester_plmn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(requester_plmn_list_local, requester_plmn_list) { + if (!cJSON_IsObject(requester_plmn_list_local)) { + ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_plmn_list]"); + goto end; + } + OpenAPI_plmn_id_t *requester_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(requester_plmn_list_local); + if (!requester_plmn_listItem) { + ogs_error("No requester_plmn_listItem"); + OpenAPI_list_free(requester_plmn_listList); + goto end; + } + OpenAPI_list_add(requester_plmn_listList, requester_plmn_listItem); } - - OpenAPI_list_add(requester_plmn_listList, requester_plmn_listItem); - } } - cJSON *requester_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterSnssaiList"); - - OpenAPI_list_t *requester_snssai_listList; + requester_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterSnssaiList"); if (requester_snssai_list) { - cJSON *requester_snssai_list_local_nonprimitive; - if (!cJSON_IsArray(requester_snssai_list)){ - ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snssai_list]"); - goto end; - } - - requester_snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(requester_snssai_list_local_nonprimitive, requester_snssai_list ) { - if (!cJSON_IsObject(requester_snssai_list_local_nonprimitive)) { + cJSON *requester_snssai_list_local = NULL; + if (!cJSON_IsArray(requester_snssai_list)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snssai_list]"); goto end; } - OpenAPI_snssai_t *requester_snssai_listItem = OpenAPI_snssai_parseFromJSON(requester_snssai_list_local_nonprimitive); - if (!requester_snssai_listItem) { - ogs_error("No requester_snssai_listItem"); - OpenAPI_list_free(requester_snssai_listList); - goto end; + requester_snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(requester_snssai_list_local, requester_snssai_list) { + if (!cJSON_IsObject(requester_snssai_list_local)) { + ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snssai_list]"); + goto end; + } + OpenAPI_snssai_t *requester_snssai_listItem = OpenAPI_snssai_parseFromJSON(requester_snssai_list_local); + if (!requester_snssai_listItem) { + ogs_error("No requester_snssai_listItem"); + OpenAPI_list_free(requester_snssai_listList); + goto end; + } + OpenAPI_list_add(requester_snssai_listList, requester_snssai_listItem); } - - OpenAPI_list_add(requester_snssai_listList, requester_snssai_listItem); - } } - cJSON *requester_fqdn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterFqdn"); - + requester_fqdn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterFqdn"); if (requester_fqdn) { - if (!cJSON_IsString(requester_fqdn)) { + if (!cJSON_IsString(requester_fqdn) && !cJSON_IsNull(requester_fqdn)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_fqdn]"); goto end; } } - cJSON *requester_snpn_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterSnpnList"); - - OpenAPI_list_t *requester_snpn_listList; + requester_snpn_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterSnpnList"); if (requester_snpn_list) { - cJSON *requester_snpn_list_local_nonprimitive; - if (!cJSON_IsArray(requester_snpn_list)){ - ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snpn_list]"); - goto end; - } - - requester_snpn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(requester_snpn_list_local_nonprimitive, requester_snpn_list ) { - if (!cJSON_IsObject(requester_snpn_list_local_nonprimitive)) { + cJSON *requester_snpn_list_local = NULL; + if (!cJSON_IsArray(requester_snpn_list)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snpn_list]"); goto end; } - OpenAPI_plmn_id_nid_t *requester_snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(requester_snpn_list_local_nonprimitive); - if (!requester_snpn_listItem) { - ogs_error("No requester_snpn_listItem"); - OpenAPI_list_free(requester_snpn_listList); - goto end; + requester_snpn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(requester_snpn_list_local, requester_snpn_list) { + if (!cJSON_IsObject(requester_snpn_list_local)) { + ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snpn_list]"); + goto end; + } + OpenAPI_plmn_id_nid_t *requester_snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(requester_snpn_list_local); + if (!requester_snpn_listItem) { + ogs_error("No requester_snpn_listItem"); + OpenAPI_list_free(requester_snpn_listList); + goto end; + } + OpenAPI_list_add(requester_snpn_listList, requester_snpn_listItem); } - - OpenAPI_list_add(requester_snpn_listList, requester_snpn_listItem); - } } - cJSON *target_plmn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetPlmn"); - - OpenAPI_plmn_id_t *target_plmn_local_nonprim = NULL; + target_plmn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetPlmn"); if (target_plmn) { target_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(target_plmn); } - cJSON *target_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetSnssaiList"); - - OpenAPI_list_t *target_snssai_listList; + target_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetSnssaiList"); if (target_snssai_list) { - cJSON *target_snssai_list_local_nonprimitive; - if (!cJSON_IsArray(target_snssai_list)){ - ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_snssai_list]"); - goto end; - } - - target_snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(target_snssai_list_local_nonprimitive, target_snssai_list ) { - if (!cJSON_IsObject(target_snssai_list_local_nonprimitive)) { + cJSON *target_snssai_list_local = NULL; + if (!cJSON_IsArray(target_snssai_list)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_snssai_list]"); goto end; } - OpenAPI_snssai_t *target_snssai_listItem = OpenAPI_snssai_parseFromJSON(target_snssai_list_local_nonprimitive); - if (!target_snssai_listItem) { - ogs_error("No target_snssai_listItem"); - OpenAPI_list_free(target_snssai_listList); + target_snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(target_snssai_list_local, target_snssai_list) { + if (!cJSON_IsObject(target_snssai_list_local)) { + ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_snssai_list]"); + goto end; + } + OpenAPI_snssai_t *target_snssai_listItem = OpenAPI_snssai_parseFromJSON(target_snssai_list_local); + if (!target_snssai_listItem) { + ogs_error("No target_snssai_listItem"); + OpenAPI_list_free(target_snssai_listList); + goto end; + } + OpenAPI_list_add(target_snssai_listList, target_snssai_listItem); + } + } + + target_nsi_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNsiList"); + if (target_nsi_list) { + cJSON *target_nsi_list_local = NULL; + if (!cJSON_IsArray(target_nsi_list)) { + ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nsi_list]"); goto end; } - OpenAPI_list_add(target_snssai_listList, target_snssai_listItem); - } + target_nsi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(target_nsi_list_local, target_nsi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(target_nsi_list_local)) { + ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nsi_list]"); + goto end; + } + OpenAPI_list_add(target_nsi_listList, ogs_strdup(target_nsi_list_local->valuestring)); + } } - cJSON *target_nsi_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNsiList"); - - OpenAPI_list_t *target_nsi_listList; - if (target_nsi_list) { - cJSON *target_nsi_list_local; - if (!cJSON_IsArray(target_nsi_list)) { - ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nsi_list]"); - goto end; - } - target_nsi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(target_nsi_list_local, target_nsi_list) { - if (!cJSON_IsString(target_nsi_list_local)) { - ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nsi_list]"); - goto end; - } - OpenAPI_list_add(target_nsi_listList, ogs_strdup(target_nsi_list_local->valuestring)); - } - } - - cJSON *target_nf_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfSetId"); - + target_nf_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfSetId"); if (target_nf_set_id) { - if (!cJSON_IsString(target_nf_set_id)) { + if (!cJSON_IsString(target_nf_set_id) && !cJSON_IsNull(target_nf_set_id)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_set_id]"); goto end; } } - cJSON *target_nf_service_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfServiceSetId"); - + target_nf_service_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfServiceSetId"); if (target_nf_service_set_id) { - if (!cJSON_IsString(target_nf_service_set_id)) { + if (!cJSON_IsString(target_nf_service_set_id) && !cJSON_IsNull(target_nf_service_set_id)) { ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_service_set_id]"); goto end; } @@ -551,21 +582,64 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access nf_type ? nf_typeVariable : 0, target_nf_type ? target_nf_typeVariable : 0, ogs_strdup(scope->valuestring), - target_nf_instance_id ? ogs_strdup(target_nf_instance_id->valuestring) : NULL, + target_nf_instance_id && !cJSON_IsNull(target_nf_instance_id) ? ogs_strdup(target_nf_instance_id->valuestring) : NULL, requester_plmn ? requester_plmn_local_nonprim : NULL, requester_plmn_list ? requester_plmn_listList : NULL, requester_snssai_list ? requester_snssai_listList : NULL, - requester_fqdn ? ogs_strdup(requester_fqdn->valuestring) : NULL, + requester_fqdn && !cJSON_IsNull(requester_fqdn) ? ogs_strdup(requester_fqdn->valuestring) : NULL, requester_snpn_list ? requester_snpn_listList : NULL, target_plmn ? target_plmn_local_nonprim : NULL, target_snssai_list ? target_snssai_listList : NULL, target_nsi_list ? target_nsi_listList : NULL, - target_nf_set_id ? ogs_strdup(target_nf_set_id->valuestring) : NULL, - target_nf_service_set_id ? ogs_strdup(target_nf_service_set_id->valuestring) : NULL + target_nf_set_id && !cJSON_IsNull(target_nf_set_id) ? ogs_strdup(target_nf_set_id->valuestring) : NULL, + target_nf_service_set_id && !cJSON_IsNull(target_nf_service_set_id) ? ogs_strdup(target_nf_service_set_id->valuestring) : NULL ); return access_token_req_local_var; end: + if (requester_plmn_local_nonprim) { + OpenAPI_plmn_id_free(requester_plmn_local_nonprim); + requester_plmn_local_nonprim = NULL; + } + if (requester_plmn_listList) { + OpenAPI_list_for_each(requester_plmn_listList, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(requester_plmn_listList); + requester_plmn_listList = NULL; + } + if (requester_snssai_listList) { + OpenAPI_list_for_each(requester_snssai_listList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(requester_snssai_listList); + requester_snssai_listList = NULL; + } + if (requester_snpn_listList) { + OpenAPI_list_for_each(requester_snpn_listList, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(requester_snpn_listList); + requester_snpn_listList = NULL; + } + if (target_plmn_local_nonprim) { + OpenAPI_plmn_id_free(target_plmn_local_nonprim); + target_plmn_local_nonprim = NULL; + } + if (target_snssai_listList) { + OpenAPI_list_for_each(target_snssai_listList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(target_snssai_listList); + target_snssai_listList = NULL; + } + if (target_nsi_listList) { + OpenAPI_list_for_each(target_nsi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(target_nsi_listList); + target_nsi_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/access_type_rm.c b/lib/sbi/openapi/model/access_type_rm.c index 52c06f8f1..5492cb023 100644 --- a/lib/sbi/openapi/model/access_type_rm.c +++ b/lib/sbi/openapi/model/access_type_rm.c @@ -16,16 +16,18 @@ OpenAPI_access_type_rm_t *OpenAPI_access_type_rm_create( void OpenAPI_access_type_rm_free(OpenAPI_access_type_rm_t *access_type_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == access_type_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(access_type_rm); } cJSON *OpenAPI_access_type_rm_convertToJSON(OpenAPI_access_type_rm_t *access_type_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (access_type_rm == NULL) { ogs_error("OpenAPI_access_type_rm_convertToJSON() failed [AccessTypeRm]"); @@ -40,6 +42,7 @@ end: OpenAPI_access_type_rm_t *OpenAPI_access_type_rm_parseFromJSON(cJSON *access_type_rmJSON) { OpenAPI_access_type_rm_t *access_type_rm_local_var = NULL; + OpenAPI_lnode_t *node = NULL; access_type_rm_local_var = OpenAPI_access_type_rm_create ( ); diff --git a/lib/sbi/openapi/model/accu_usage_report.c b/lib/sbi/openapi/model/accu_usage_report.c index 4d3777354..311facf6b 100644 --- a/lib/sbi/openapi/model/accu_usage_report.c +++ b/lib/sbi/openapi/model/accu_usage_report.c @@ -50,17 +50,22 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_create( void OpenAPI_accu_usage_report_free(OpenAPI_accu_usage_report_t *accu_usage_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == accu_usage_report) { return; } - OpenAPI_lnode_t *node; - ogs_free(accu_usage_report->ref_um_ids); + if (accu_usage_report->ref_um_ids) { + ogs_free(accu_usage_report->ref_um_ids); + accu_usage_report->ref_um_ids = NULL; + } ogs_free(accu_usage_report); } cJSON *OpenAPI_accu_usage_report_convertToJSON(OpenAPI_accu_usage_report_t *accu_usage_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (accu_usage_report == NULL) { ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [AccuUsageReport]"); @@ -68,6 +73,10 @@ cJSON *OpenAPI_accu_usage_report_convertToJSON(OpenAPI_accu_usage_report_t *accu } item = cJSON_CreateObject(); + if (!accu_usage_report->ref_um_ids) { + ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [ref_um_ids]"); + return NULL; + } if (cJSON_AddStringToObject(item, "refUmIds", accu_usage_report->ref_um_ids) == NULL) { ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [ref_um_ids]"); goto end; @@ -136,19 +145,27 @@ end: OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu_usage_reportJSON) { OpenAPI_accu_usage_report_t *accu_usage_report_local_var = NULL; - cJSON *ref_um_ids = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "refUmIds"); + OpenAPI_lnode_t *node = NULL; + cJSON *ref_um_ids = NULL; + cJSON *vol_usage = NULL; + cJSON *vol_usage_uplink = NULL; + cJSON *vol_usage_downlink = NULL; + cJSON *time_usage = NULL; + cJSON *next_vol_usage = NULL; + cJSON *next_vol_usage_uplink = NULL; + cJSON *next_vol_usage_downlink = NULL; + cJSON *next_time_usage = NULL; + ref_um_ids = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "refUmIds"); if (!ref_um_ids) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [ref_um_ids]"); goto end; } - if (!cJSON_IsString(ref_um_ids)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [ref_um_ids]"); goto end; } - cJSON *vol_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsage"); - + vol_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsage"); if (vol_usage) { if (!cJSON_IsNumber(vol_usage)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage]"); @@ -156,8 +173,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu } } - cJSON *vol_usage_uplink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsageUplink"); - + vol_usage_uplink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsageUplink"); if (vol_usage_uplink) { if (!cJSON_IsNumber(vol_usage_uplink)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage_uplink]"); @@ -165,8 +181,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu } } - cJSON *vol_usage_downlink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsageDownlink"); - + vol_usage_downlink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsageDownlink"); if (vol_usage_downlink) { if (!cJSON_IsNumber(vol_usage_downlink)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage_downlink]"); @@ -174,8 +189,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu } } - cJSON *time_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "timeUsage"); - + time_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "timeUsage"); if (time_usage) { if (!cJSON_IsNumber(time_usage)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [time_usage]"); @@ -183,8 +197,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu } } - cJSON *next_vol_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsage"); - + next_vol_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsage"); if (next_vol_usage) { if (!cJSON_IsNumber(next_vol_usage)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage]"); @@ -192,8 +205,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu } } - cJSON *next_vol_usage_uplink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsageUplink"); - + next_vol_usage_uplink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsageUplink"); if (next_vol_usage_uplink) { if (!cJSON_IsNumber(next_vol_usage_uplink)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage_uplink]"); @@ -201,8 +213,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu } } - cJSON *next_vol_usage_downlink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsageDownlink"); - + next_vol_usage_downlink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsageDownlink"); if (next_vol_usage_downlink) { if (!cJSON_IsNumber(next_vol_usage_downlink)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage_downlink]"); @@ -210,8 +221,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu } } - cJSON *next_time_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextTimeUsage"); - + next_time_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextTimeUsage"); if (next_time_usage) { if (!cJSON_IsNumber(next_time_usage)) { ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_time_usage]"); diff --git a/lib/sbi/openapi/model/accumulated_usage.c b/lib/sbi/openapi/model/accumulated_usage.c index 2c3a083bb..faaab2600 100644 --- a/lib/sbi/openapi/model/accumulated_usage.c +++ b/lib/sbi/openapi/model/accumulated_usage.c @@ -32,16 +32,18 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_create( void OpenAPI_accumulated_usage_free(OpenAPI_accumulated_usage_t *accumulated_usage) { + OpenAPI_lnode_t *node = NULL; + if (NULL == accumulated_usage) { return; } - OpenAPI_lnode_t *node; ogs_free(accumulated_usage); } cJSON *OpenAPI_accumulated_usage_convertToJSON(OpenAPI_accumulated_usage_t *accumulated_usage) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (accumulated_usage == NULL) { ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [AccumulatedUsage]"); @@ -84,8 +86,12 @@ end: OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accumulated_usageJSON) { OpenAPI_accumulated_usage_t *accumulated_usage_local_var = NULL; - cJSON *duration = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "duration"); - + OpenAPI_lnode_t *node = NULL; + cJSON *duration = NULL; + cJSON *total_volume = NULL; + cJSON *downlink_volume = NULL; + cJSON *uplink_volume = NULL; + duration = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "duration"); if (duration) { if (!cJSON_IsNumber(duration)) { ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [duration]"); @@ -93,8 +99,7 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accu } } - cJSON *total_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "totalVolume"); - + total_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "totalVolume"); if (total_volume) { if (!cJSON_IsNumber(total_volume)) { ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [total_volume]"); @@ -102,8 +107,7 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accu } } - cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "downlinkVolume"); - + downlink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "downlinkVolume"); if (downlink_volume) { if (!cJSON_IsNumber(downlink_volume)) { ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [downlink_volume]"); @@ -111,8 +115,7 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accu } } - cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "uplinkVolume"); - + uplink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "uplinkVolume"); if (uplink_volume) { if (!cJSON_IsNumber(uplink_volume)) { ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [uplink_volume]"); diff --git a/lib/sbi/openapi/model/acknowledge_info.c b/lib/sbi/openapi/model/acknowledge_info.c index 6a6e817a2..d5869db90 100644 --- a/lib/sbi/openapi/model/acknowledge_info.c +++ b/lib/sbi/openapi/model/acknowledge_info.c @@ -28,20 +28,34 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create( void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == acknowledge_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(acknowledge_info->sor_mac_iue); - ogs_free(acknowledge_info->upu_mac_iue); - ogs_free(acknowledge_info->secured_packet); - ogs_free(acknowledge_info->provisioning_time); + if (acknowledge_info->sor_mac_iue) { + ogs_free(acknowledge_info->sor_mac_iue); + acknowledge_info->sor_mac_iue = NULL; + } + if (acknowledge_info->upu_mac_iue) { + ogs_free(acknowledge_info->upu_mac_iue); + acknowledge_info->upu_mac_iue = NULL; + } + if (acknowledge_info->secured_packet) { + ogs_free(acknowledge_info->secured_packet); + acknowledge_info->secured_packet = NULL; + } + if (acknowledge_info->provisioning_time) { + ogs_free(acknowledge_info->provisioning_time); + acknowledge_info->provisioning_time = NULL; + } ogs_free(acknowledge_info); } cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknowledge_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (acknowledge_info == NULL) { ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [AcknowledgeInfo]"); @@ -70,6 +84,10 @@ cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknow } } + if (!acknowledge_info->provisioning_time) { + ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [provisioning_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "provisioningTime", acknowledge_info->provisioning_time) == NULL) { ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [provisioning_time]"); goto end; @@ -89,46 +107,47 @@ end: OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknowledge_infoJSON) { OpenAPI_acknowledge_info_t *acknowledge_info_local_var = NULL; - cJSON *sor_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "sorMacIue"); - + OpenAPI_lnode_t *node = NULL; + cJSON *sor_mac_iue = NULL; + cJSON *upu_mac_iue = NULL; + cJSON *secured_packet = NULL; + cJSON *provisioning_time = NULL; + cJSON *ue_not_reachable = NULL; + sor_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "sorMacIue"); if (sor_mac_iue) { - if (!cJSON_IsString(sor_mac_iue)) { + if (!cJSON_IsString(sor_mac_iue) && !cJSON_IsNull(sor_mac_iue)) { ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [sor_mac_iue]"); goto end; } } - cJSON *upu_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "upuMacIue"); - + upu_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "upuMacIue"); if (upu_mac_iue) { - if (!cJSON_IsString(upu_mac_iue)) { + if (!cJSON_IsString(upu_mac_iue) && !cJSON_IsNull(upu_mac_iue)) { ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [upu_mac_iue]"); goto end; } } - cJSON *secured_packet = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "securedPacket"); - + secured_packet = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "securedPacket"); if (secured_packet) { - if (!cJSON_IsString(secured_packet)) { + if (!cJSON_IsString(secured_packet) && !cJSON_IsNull(secured_packet)) { ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [secured_packet]"); goto end; } } - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "provisioningTime"); + provisioning_time = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "provisioningTime"); if (!provisioning_time) { ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [provisioning_time]"); goto end; } - - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [provisioning_time]"); goto end; } - cJSON *ue_not_reachable = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "ueNotReachable"); - + ue_not_reachable = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "ueNotReachable"); if (ue_not_reachable) { if (!cJSON_IsBool(ue_not_reachable)) { ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [ue_not_reachable]"); @@ -137,9 +156,9 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknow } acknowledge_info_local_var = OpenAPI_acknowledge_info_create ( - sor_mac_iue ? ogs_strdup(sor_mac_iue->valuestring) : NULL, - upu_mac_iue ? ogs_strdup(upu_mac_iue->valuestring) : NULL, - secured_packet ? ogs_strdup(secured_packet->valuestring) : NULL, + sor_mac_iue && !cJSON_IsNull(sor_mac_iue) ? ogs_strdup(sor_mac_iue->valuestring) : NULL, + upu_mac_iue && !cJSON_IsNull(upu_mac_iue) ? ogs_strdup(upu_mac_iue->valuestring) : NULL, + secured_packet && !cJSON_IsNull(secured_packet) ? ogs_strdup(secured_packet->valuestring) : NULL, ogs_strdup(provisioning_time->valuestring), ue_not_reachable ? true : false, ue_not_reachable ? ue_not_reachable->valueint : 0 diff --git a/lib/sbi/openapi/model/acs_info.c b/lib/sbi/openapi/model/acs_info.c index c43d7d373..d23a279d9 100644 --- a/lib/sbi/openapi/model/acs_info.c +++ b/lib/sbi/openapi/model/acs_info.c @@ -22,19 +22,30 @@ OpenAPI_acs_info_t *OpenAPI_acs_info_create( void OpenAPI_acs_info_free(OpenAPI_acs_info_t *acs_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == acs_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(acs_info->acs_url); - ogs_free(acs_info->acs_ipv4_addr); - ogs_free(acs_info->acs_ipv6_addr); + if (acs_info->acs_url) { + ogs_free(acs_info->acs_url); + acs_info->acs_url = NULL; + } + if (acs_info->acs_ipv4_addr) { + ogs_free(acs_info->acs_ipv4_addr); + acs_info->acs_ipv4_addr = NULL; + } + if (acs_info->acs_ipv6_addr) { + ogs_free(acs_info->acs_ipv6_addr); + acs_info->acs_ipv6_addr = NULL; + } ogs_free(acs_info); } cJSON *OpenAPI_acs_info_convertToJSON(OpenAPI_acs_info_t *acs_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (acs_info == NULL) { ogs_error("OpenAPI_acs_info_convertToJSON() failed [AcsInfo]"); @@ -70,37 +81,38 @@ end: OpenAPI_acs_info_t *OpenAPI_acs_info_parseFromJSON(cJSON *acs_infoJSON) { OpenAPI_acs_info_t *acs_info_local_var = NULL; - cJSON *acs_url = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsUrl"); - + OpenAPI_lnode_t *node = NULL; + cJSON *acs_url = NULL; + cJSON *acs_ipv4_addr = NULL; + cJSON *acs_ipv6_addr = NULL; + acs_url = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsUrl"); if (acs_url) { - if (!cJSON_IsString(acs_url)) { + if (!cJSON_IsString(acs_url) && !cJSON_IsNull(acs_url)) { ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_url]"); goto end; } } - cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv4Addr"); - + acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv4Addr"); if (acs_ipv4_addr) { - if (!cJSON_IsString(acs_ipv4_addr)) { + if (!cJSON_IsString(acs_ipv4_addr) && !cJSON_IsNull(acs_ipv4_addr)) { ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv4_addr]"); goto end; } } - cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv6Addr"); - + acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv6Addr"); if (acs_ipv6_addr) { - if (!cJSON_IsString(acs_ipv6_addr)) { + if (!cJSON_IsString(acs_ipv6_addr) && !cJSON_IsNull(acs_ipv6_addr)) { ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv6_addr]"); goto end; } } acs_info_local_var = OpenAPI_acs_info_create ( - acs_url ? ogs_strdup(acs_url->valuestring) : NULL, - acs_ipv4_addr ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL, - acs_ipv6_addr ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL + acs_url && !cJSON_IsNull(acs_url) ? ogs_strdup(acs_url->valuestring) : NULL, + acs_ipv4_addr && !cJSON_IsNull(acs_ipv4_addr) ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL, + acs_ipv6_addr && !cJSON_IsNull(acs_ipv6_addr) ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL ); return acs_info_local_var; diff --git a/lib/sbi/openapi/model/acs_info_1.c b/lib/sbi/openapi/model/acs_info_1.c index e2bc91bb7..d6de6aa01 100644 --- a/lib/sbi/openapi/model/acs_info_1.c +++ b/lib/sbi/openapi/model/acs_info_1.c @@ -22,19 +22,30 @@ OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_create( void OpenAPI_acs_info_1_free(OpenAPI_acs_info_1_t *acs_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == acs_info_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(acs_info_1->acs_url); - ogs_free(acs_info_1->acs_ipv4_addr); - ogs_free(acs_info_1->acs_ipv6_addr); + if (acs_info_1->acs_url) { + ogs_free(acs_info_1->acs_url); + acs_info_1->acs_url = NULL; + } + if (acs_info_1->acs_ipv4_addr) { + ogs_free(acs_info_1->acs_ipv4_addr); + acs_info_1->acs_ipv4_addr = NULL; + } + if (acs_info_1->acs_ipv6_addr) { + ogs_free(acs_info_1->acs_ipv6_addr); + acs_info_1->acs_ipv6_addr = NULL; + } ogs_free(acs_info_1); } cJSON *OpenAPI_acs_info_1_convertToJSON(OpenAPI_acs_info_1_t *acs_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (acs_info_1 == NULL) { ogs_error("OpenAPI_acs_info_1_convertToJSON() failed [AcsInfo_1]"); @@ -70,37 +81,38 @@ end: OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_parseFromJSON(cJSON *acs_info_1JSON) { OpenAPI_acs_info_1_t *acs_info_1_local_var = NULL; - cJSON *acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsUrl"); - + OpenAPI_lnode_t *node = NULL; + cJSON *acs_url = NULL; + cJSON *acs_ipv4_addr = NULL; + cJSON *acs_ipv6_addr = NULL; + acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsUrl"); if (acs_url) { - if (!cJSON_IsString(acs_url)) { + if (!cJSON_IsString(acs_url) && !cJSON_IsNull(acs_url)) { ogs_error("OpenAPI_acs_info_1_parseFromJSON() failed [acs_url]"); goto end; } } - cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv4Addr"); - + acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv4Addr"); if (acs_ipv4_addr) { - if (!cJSON_IsString(acs_ipv4_addr)) { + if (!cJSON_IsString(acs_ipv4_addr) && !cJSON_IsNull(acs_ipv4_addr)) { ogs_error("OpenAPI_acs_info_1_parseFromJSON() failed [acs_ipv4_addr]"); goto end; } } - cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv6Addr"); - + acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv6Addr"); if (acs_ipv6_addr) { - if (!cJSON_IsString(acs_ipv6_addr)) { + if (!cJSON_IsString(acs_ipv6_addr) && !cJSON_IsNull(acs_ipv6_addr)) { ogs_error("OpenAPI_acs_info_1_parseFromJSON() failed [acs_ipv6_addr]"); goto end; } } acs_info_1_local_var = OpenAPI_acs_info_1_create ( - acs_url ? ogs_strdup(acs_url->valuestring) : NULL, - acs_ipv4_addr ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL, - acs_ipv6_addr ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL + acs_url && !cJSON_IsNull(acs_url) ? ogs_strdup(acs_url->valuestring) : NULL, + acs_ipv4_addr && !cJSON_IsNull(acs_ipv4_addr) ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL, + acs_ipv6_addr && !cJSON_IsNull(acs_ipv6_addr) ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL ); return acs_info_1_local_var; diff --git a/lib/sbi/openapi/model/acs_info_rm.c b/lib/sbi/openapi/model/acs_info_rm.c index d5b189a55..8d86eeacb 100644 --- a/lib/sbi/openapi/model/acs_info_rm.c +++ b/lib/sbi/openapi/model/acs_info_rm.c @@ -22,19 +22,30 @@ OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_create( void OpenAPI_acs_info_rm_free(OpenAPI_acs_info_rm_t *acs_info_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == acs_info_rm) { return; } - OpenAPI_lnode_t *node; - ogs_free(acs_info_rm->acs_url); - ogs_free(acs_info_rm->acs_ipv4_addr); - ogs_free(acs_info_rm->acs_ipv6_addr); + if (acs_info_rm->acs_url) { + ogs_free(acs_info_rm->acs_url); + acs_info_rm->acs_url = NULL; + } + if (acs_info_rm->acs_ipv4_addr) { + ogs_free(acs_info_rm->acs_ipv4_addr); + acs_info_rm->acs_ipv4_addr = NULL; + } + if (acs_info_rm->acs_ipv6_addr) { + ogs_free(acs_info_rm->acs_ipv6_addr); + acs_info_rm->acs_ipv6_addr = NULL; + } ogs_free(acs_info_rm); } cJSON *OpenAPI_acs_info_rm_convertToJSON(OpenAPI_acs_info_rm_t *acs_info_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (acs_info_rm == NULL) { ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [AcsInfoRm]"); @@ -70,37 +81,38 @@ end: OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_parseFromJSON(cJSON *acs_info_rmJSON) { OpenAPI_acs_info_rm_t *acs_info_rm_local_var = NULL; - cJSON *acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsUrl"); - + OpenAPI_lnode_t *node = NULL; + cJSON *acs_url = NULL; + cJSON *acs_ipv4_addr = NULL; + cJSON *acs_ipv6_addr = NULL; + acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsUrl"); if (acs_url) { - if (!cJSON_IsString(acs_url)) { + if (!cJSON_IsString(acs_url) && !cJSON_IsNull(acs_url)) { ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_url]"); goto end; } } - cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv4Addr"); - + acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv4Addr"); if (acs_ipv4_addr) { - if (!cJSON_IsString(acs_ipv4_addr)) { + if (!cJSON_IsString(acs_ipv4_addr) && !cJSON_IsNull(acs_ipv4_addr)) { ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_ipv4_addr]"); goto end; } } - cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv6Addr"); - + acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv6Addr"); if (acs_ipv6_addr) { - if (!cJSON_IsString(acs_ipv6_addr)) { + if (!cJSON_IsString(acs_ipv6_addr) && !cJSON_IsNull(acs_ipv6_addr)) { ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_ipv6_addr]"); goto end; } } acs_info_rm_local_var = OpenAPI_acs_info_rm_create ( - acs_url ? ogs_strdup(acs_url->valuestring) : NULL, - acs_ipv4_addr ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL, - acs_ipv6_addr ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL + acs_url && !cJSON_IsNull(acs_url) ? ogs_strdup(acs_url->valuestring) : NULL, + acs_ipv4_addr && !cJSON_IsNull(acs_ipv4_addr) ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL, + acs_ipv6_addr && !cJSON_IsNull(acs_ipv6_addr) ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL ); return acs_info_rm_local_var; diff --git a/lib/sbi/openapi/model/additional_access_info.c b/lib/sbi/openapi/model/additional_access_info.c index 0ad13e04c..868b3b980 100644 --- a/lib/sbi/openapi/model/additional_access_info.c +++ b/lib/sbi/openapi/model/additional_access_info.c @@ -20,16 +20,18 @@ OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_create( void OpenAPI_additional_access_info_free(OpenAPI_additional_access_info_t *additional_access_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == additional_access_info) { return; } - OpenAPI_lnode_t *node; ogs_free(additional_access_info); } cJSON *OpenAPI_additional_access_info_convertToJSON(OpenAPI_additional_access_info_t *additional_access_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (additional_access_info == NULL) { ogs_error("OpenAPI_additional_access_info_convertToJSON() failed [AdditionalAccessInfo]"); @@ -37,12 +39,16 @@ cJSON *OpenAPI_additional_access_info_convertToJSON(OpenAPI_additional_access_in } item = cJSON_CreateObject(); + if (additional_access_info->access_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_additional_access_info_convertToJSON() failed [access_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(additional_access_info->access_type)) == NULL) { ogs_error("OpenAPI_additional_access_info_convertToJSON() failed [access_type]"); goto end; } - if (additional_access_info->rat_type) { + if (additional_access_info->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(additional_access_info->rat_type)) == NULL) { ogs_error("OpenAPI_additional_access_info_convertToJSON() failed [rat_type]"); goto end; @@ -56,22 +62,23 @@ end: OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_parseFromJSON(cJSON *additional_access_infoJSON) { OpenAPI_additional_access_info_t *additional_access_info_local_var = NULL; - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "accessType"); + OpenAPI_lnode_t *node = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + access_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "accessType"); if (!access_type) { ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [access_type]"); goto end; } - - OpenAPI_access_type_e access_typeVariable; if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [access_type]"); goto end; } access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [rat_type]"); diff --git a/lib/sbi/openapi/model/additional_snssai_data.c b/lib/sbi/openapi/model/additional_snssai_data.c index 58005bfff..1b085a4cc 100644 --- a/lib/sbi/openapi/model/additional_snssai_data.c +++ b/lib/sbi/openapi/model/additional_snssai_data.c @@ -20,16 +20,18 @@ OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create( void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *additional_snssai_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == additional_snssai_data) { return; } - OpenAPI_lnode_t *node; ogs_free(additional_snssai_data); } cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_data_t *additional_snssai_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (additional_snssai_data == NULL) { ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [AdditionalSnssaiData]"); @@ -51,8 +53,9 @@ end: OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(cJSON *additional_snssai_dataJSON) { OpenAPI_additional_snssai_data_t *additional_snssai_data_local_var = NULL; - cJSON *required_authn_authz = cJSON_GetObjectItemCaseSensitive(additional_snssai_dataJSON, "requiredAuthnAuthz"); - + OpenAPI_lnode_t *node = NULL; + cJSON *required_authn_authz = NULL; + required_authn_authz = cJSON_GetObjectItemCaseSensitive(additional_snssai_dataJSON, "requiredAuthnAuthz"); if (required_authn_authz) { if (!cJSON_IsBool(required_authn_authz)) { ogs_error("OpenAPI_additional_snssai_data_parseFromJSON() failed [required_authn_authz]"); diff --git a/lib/sbi/openapi/model/af_event.c b/lib/sbi/openapi/model/af_event.c index 8b6ed89f7..124111e8d 100644 --- a/lib/sbi/openapi/model/af_event.c +++ b/lib/sbi/openapi/model/af_event.c @@ -6,7 +6,7 @@ char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event) { - const char *af_eventArray[] = { "NULL", "ACCESS_TYPE_CHANGE", "ANI_REPORT", "CHARGING_CORRELATION", "EPS_FALLBACK", "FAILED_RESOURCES_ALLOCATION", "OUT_OF_CREDIT", "PLMN_CHG", "QOS_MONITORING", "QOS_NOTIF", "RAN_NAS_CAUSE", "REALLOCATION_OF_CREDIT", "SUCCESSFUL_RESOURCES_ALLOCATION", "TSN_BRIDGE_INFO", "USAGE_REPORT" }; + const char *af_eventArray[] = { "NULL", "SVC_EXPERIENCE", "UE_MOBILITY", "UE_COMM", "EXCEPTIONS" }; size_t sizeofArray = sizeof(af_eventArray) / sizeof(af_eventArray[0]); if (af_event < sizeofArray) return (char *)af_eventArray[af_event]; @@ -17,7 +17,7 @@ char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event) OpenAPI_af_event_e OpenAPI_af_event_FromString(char* af_event) { int stringToReturn = 0; - const char *af_eventArray[] = { "NULL", "ACCESS_TYPE_CHANGE", "ANI_REPORT", "CHARGING_CORRELATION", "EPS_FALLBACK", "FAILED_RESOURCES_ALLOCATION", "OUT_OF_CREDIT", "PLMN_CHG", "QOS_MONITORING", "QOS_NOTIF", "RAN_NAS_CAUSE", "REALLOCATION_OF_CREDIT", "SUCCESSFUL_RESOURCES_ALLOCATION", "TSN_BRIDGE_INFO", "USAGE_REPORT" }; + const char *af_eventArray[] = { "NULL", "SVC_EXPERIENCE", "UE_MOBILITY", "UE_COMM", "EXCEPTIONS" }; size_t sizeofArray = sizeof(af_eventArray) / sizeof(af_eventArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(af_event, af_eventArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/af_event.h b/lib/sbi/openapi/model/af_event.h index ed239a111..2279ba1ea 100644 --- a/lib/sbi/openapi/model/af_event.h +++ b/lib/sbi/openapi/model/af_event.h @@ -17,7 +17,7 @@ extern "C" { #endif -typedef enum { OpenAPI_af_event_NULL = 0, OpenAPI_af_event_ACCESS_TYPE_CHANGE, OpenAPI_af_event_ANI_REPORT, OpenAPI_af_event_CHARGING_CORRELATION, OpenAPI_af_event_EPS_FALLBACK, OpenAPI_af_event_FAILED_RESOURCES_ALLOCATION, OpenAPI_af_event_OUT_OF_CREDIT, OpenAPI_af_event_PLMN_CHG, OpenAPI_af_event_QOS_MONITORING, OpenAPI_af_event_QOS_NOTIF, OpenAPI_af_event_RAN_NAS_CAUSE, OpenAPI_af_event_REALLOCATION_OF_CREDIT, OpenAPI_af_event_SUCCESSFUL_RESOURCES_ALLOCATION, OpenAPI_af_event_TSN_BRIDGE_INFO, OpenAPI_af_event_USAGE_REPORT } OpenAPI_af_event_e; +typedef enum { OpenAPI_af_event_NULL = 0, OpenAPI_af_event_SVC_EXPERIENCE, OpenAPI_af_event_UE_MOBILITY, OpenAPI_af_event_UE_COMM, OpenAPI_af_event_EXCEPTIONS } OpenAPI_af_event_e; char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event); diff --git a/lib/sbi/openapi/model/af_event_exposure_data.c b/lib/sbi/openapi/model/af_event_exposure_data.c index a5b6004e9..47aa2d675 100644 --- a/lib/sbi/openapi/model/af_event_exposure_data.c +++ b/lib/sbi/openapi/model/af_event_exposure_data.c @@ -22,25 +22,36 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_create( void OpenAPI_af_event_exposure_data_free(OpenAPI_af_event_exposure_data_t *af_event_exposure_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == af_event_exposure_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(af_event_exposure_data->af_events); - OpenAPI_list_for_each(af_event_exposure_data->af_ids, node) { - ogs_free(node->data); + if (af_event_exposure_data->af_events) { + OpenAPI_list_free(af_event_exposure_data->af_events); + af_event_exposure_data->af_events = NULL; } - OpenAPI_list_free(af_event_exposure_data->af_ids); - OpenAPI_list_for_each(af_event_exposure_data->app_ids, node) { - ogs_free(node->data); + if (af_event_exposure_data->af_ids) { + OpenAPI_list_for_each(af_event_exposure_data->af_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(af_event_exposure_data->af_ids); + af_event_exposure_data->af_ids = NULL; + } + if (af_event_exposure_data->app_ids) { + OpenAPI_list_for_each(af_event_exposure_data->app_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(af_event_exposure_data->app_ids); + af_event_exposure_data->app_ids = NULL; } - OpenAPI_list_free(af_event_exposure_data->app_ids); ogs_free(af_event_exposure_data); } cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_data_t *af_event_exposure_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (af_event_exposure_data == NULL) { ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [AfEventExposureData]"); @@ -48,49 +59,48 @@ cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_da } item = cJSON_CreateObject(); - cJSON *af_events = cJSON_AddArrayToObject(item, "afEvents"); - if (af_events == NULL) { + if (af_event_exposure_data->af_events == OpenAPI_af_event_NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]"); + return NULL; + } + cJSON *af_eventsList = cJSON_AddArrayToObject(item, "afEvents"); + if (af_eventsList == NULL) { ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]"); goto end; } - OpenAPI_lnode_t *af_events_node; - OpenAPI_list_for_each(af_event_exposure_data->af_events, af_events_node) { - if (cJSON_AddStringToObject(af_events, "", OpenAPI_af_event_ToString((intptr_t)af_events_node->data)) == NULL) { + OpenAPI_list_for_each(af_event_exposure_data->af_events, node) { + if (cJSON_AddStringToObject(af_eventsList, "", OpenAPI_af_event_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]"); goto end; } } if (af_event_exposure_data->af_ids) { - cJSON *af_ids = cJSON_AddArrayToObject(item, "afIds"); - if (af_ids == NULL) { + cJSON *af_idsList = cJSON_AddArrayToObject(item, "afIds"); + if (af_idsList == NULL) { ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]"); goto end; } - - OpenAPI_lnode_t *af_ids_node; - OpenAPI_list_for_each(af_event_exposure_data->af_ids, af_ids_node) { - if (cJSON_AddStringToObject(af_ids, "", (char*)af_ids_node->data) == NULL) { - ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]"); - goto end; + OpenAPI_list_for_each(af_event_exposure_data->af_ids, node) { + if (cJSON_AddStringToObject(af_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]"); + goto end; + } } - } } if (af_event_exposure_data->app_ids) { - cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds"); - if (app_ids == NULL) { + cJSON *app_idsList = cJSON_AddArrayToObject(item, "appIds"); + if (app_idsList == NULL) { ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]"); goto end; } - - OpenAPI_lnode_t *app_ids_node; - OpenAPI_list_for_each(af_event_exposure_data->app_ids, app_ids_node) { - if (cJSON_AddStringToObject(app_ids, "", (char*)app_ids_node->data) == NULL) { - ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]"); - goto end; + OpenAPI_list_for_each(af_event_exposure_data->app_ids, node) { + if (cJSON_AddStringToObject(app_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]"); + goto end; + } } - } } end: @@ -100,68 +110,74 @@ end: OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(cJSON *af_event_exposure_dataJSON) { OpenAPI_af_event_exposure_data_t *af_event_exposure_data_local_var = NULL; - cJSON *af_events = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afEvents"); + OpenAPI_lnode_t *node = NULL; + cJSON *af_events = NULL; + OpenAPI_list_t *af_eventsList = NULL; + cJSON *af_ids = NULL; + OpenAPI_list_t *af_idsList = NULL; + cJSON *app_ids = NULL; + OpenAPI_list_t *app_idsList = NULL; + af_events = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afEvents"); if (!af_events) { ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]"); goto end; } - - OpenAPI_list_t *af_eventsList; - cJSON *af_events_local_nonprimitive; - if (!cJSON_IsArray(af_events)) { - ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]"); - goto end; - } - - af_eventsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(af_events_local_nonprimitive, af_events ) { - if (!cJSON_IsString(af_events_local_nonprimitive)){ + cJSON *af_events_local = NULL; + if (!cJSON_IsArray(af_events)) { ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]"); goto end; } - OpenAPI_list_add(af_eventsList, (void *)OpenAPI_af_event_FromString(af_events_local_nonprimitive->valuestring)); - } + af_eventsList = OpenAPI_list_create(); - cJSON *af_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afIds"); + cJSON_ArrayForEach(af_events_local, af_events) { + if (!cJSON_IsString(af_events_local)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]"); + goto end; + } + OpenAPI_list_add(af_eventsList, (void *)OpenAPI_af_event_FromString(af_events_local->valuestring)); + } - OpenAPI_list_t *af_idsList; + af_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afIds"); if (af_ids) { - cJSON *af_ids_local; - if (!cJSON_IsArray(af_ids)) { - ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]"); - goto end; - } - af_idsList = OpenAPI_list_create(); + cJSON *af_ids_local = NULL; + if (!cJSON_IsArray(af_ids)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]"); + goto end; + } - cJSON_ArrayForEach(af_ids_local, af_ids) { - if (!cJSON_IsString(af_ids_local)) { - ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]"); - goto end; - } - OpenAPI_list_add(af_idsList, ogs_strdup(af_ids_local->valuestring)); - } + af_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_ids_local, af_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(af_ids_local)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]"); + goto end; + } + OpenAPI_list_add(af_idsList, ogs_strdup(af_ids_local->valuestring)); + } } - cJSON *app_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "appIds"); - - OpenAPI_list_t *app_idsList; + app_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "appIds"); if (app_ids) { - cJSON *app_ids_local; - if (!cJSON_IsArray(app_ids)) { - ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]"); - goto end; - } - app_idsList = OpenAPI_list_create(); + cJSON *app_ids_local = NULL; + if (!cJSON_IsArray(app_ids)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]"); + goto end; + } - cJSON_ArrayForEach(app_ids_local, app_ids) { - if (!cJSON_IsString(app_ids_local)) { - ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]"); - goto end; - } - OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); - } + app_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_ids_local, app_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(app_ids_local)) { + ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]"); + goto end; + } + OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); + } } af_event_exposure_data_local_var = OpenAPI_af_event_exposure_data_create ( @@ -172,6 +188,24 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(c return af_event_exposure_data_local_var; end: + if (af_eventsList) { + OpenAPI_list_free(af_eventsList); + af_eventsList = NULL; + } + if (af_idsList) { + OpenAPI_list_for_each(af_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(af_idsList); + af_idsList = NULL; + } + if (app_idsList) { + OpenAPI_list_for_each(app_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(app_idsList); + app_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/af_event_notification.c b/lib/sbi/openapi/model/af_event_notification.c index 38b84ffb2..d273973d8 100644 --- a/lib/sbi/openapi/model/af_event_notification.c +++ b/lib/sbi/openapi/model/af_event_notification.c @@ -5,7 +5,7 @@ #include "af_event_notification.h" OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_create( - OpenAPI_af_event_e event, + OpenAPI_npcf_af_event_e event, OpenAPI_list_t *flows ) { @@ -20,20 +20,25 @@ OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_create( void OpenAPI_af_event_notification_free(OpenAPI_af_event_notification_t *af_event_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == af_event_notification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(af_event_notification->flows, node) { - OpenAPI_flows_free(node->data); + if (af_event_notification->flows) { + OpenAPI_list_for_each(af_event_notification->flows, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(af_event_notification->flows); + af_event_notification->flows = NULL; } - OpenAPI_list_free(af_event_notification->flows); ogs_free(af_event_notification); } cJSON *OpenAPI_af_event_notification_convertToJSON(OpenAPI_af_event_notification_t *af_event_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (af_event_notification == NULL) { ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [AfEventNotification]"); @@ -41,7 +46,11 @@ cJSON *OpenAPI_af_event_notification_convertToJSON(OpenAPI_af_event_notification } item = cJSON_CreateObject(); - if (cJSON_AddStringToObject(item, "event", OpenAPI_af_event_ToString(af_event_notification->event)) == NULL) { + if (af_event_notification->event == OpenAPI_npcf_af_event_NULL) { + ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [event]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "event", OpenAPI_npcf_af_event_ToString(af_event_notification->event)) == NULL) { ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [event]"); goto end; } @@ -52,17 +61,13 @@ cJSON *OpenAPI_af_event_notification_convertToJSON(OpenAPI_af_event_notification ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [flows]"); goto end; } - - OpenAPI_lnode_t *flows_node; - if (af_event_notification->flows) { - OpenAPI_list_for_each(af_event_notification->flows, flows_node) { - cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [flows]"); - goto end; - } - cJSON_AddItemToArray(flowsList, itemLocal); + OpenAPI_list_for_each(af_event_notification->flows, node) { + cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [flows]"); + goto end; } + cJSON_AddItemToArray(flowsList, itemLocal); } } @@ -73,46 +78,45 @@ end: OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_parseFromJSON(cJSON *af_event_notificationJSON) { OpenAPI_af_event_notification_t *af_event_notification_local_var = NULL; - cJSON *event = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "event"); + OpenAPI_lnode_t *node = NULL; + cJSON *event = NULL; + OpenAPI_npcf_af_event_e eventVariable = 0; + cJSON *flows = NULL; + OpenAPI_list_t *flowsList = NULL; + event = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "event"); if (!event) { ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [event]"); goto end; } - - OpenAPI_af_event_e eventVariable; if (!cJSON_IsString(event)) { ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [event]"); goto end; } - eventVariable = OpenAPI_af_event_FromString(event->valuestring); + eventVariable = OpenAPI_npcf_af_event_FromString(event->valuestring); - cJSON *flows = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "flows"); - - OpenAPI_list_t *flowsList; + flows = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "flows"); if (flows) { - cJSON *flows_local_nonprimitive; - if (!cJSON_IsArray(flows)){ - ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [flows]"); - goto end; - } - - flowsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(flows_local_nonprimitive, flows ) { - if (!cJSON_IsObject(flows_local_nonprimitive)) { + cJSON *flows_local = NULL; + if (!cJSON_IsArray(flows)) { ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [flows]"); goto end; } - OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive); - if (!flowsItem) { - ogs_error("No flowsItem"); - OpenAPI_list_free(flowsList); - goto end; + flowsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flows_local, flows) { + if (!cJSON_IsObject(flows_local)) { + ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [flows]"); + goto end; + } + OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local); + if (!flowsItem) { + ogs_error("No flowsItem"); + OpenAPI_list_free(flowsList); + goto end; + } + OpenAPI_list_add(flowsList, flowsItem); } - - OpenAPI_list_add(flowsList, flowsItem); - } } af_event_notification_local_var = OpenAPI_af_event_notification_create ( @@ -122,6 +126,13 @@ OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_parseFromJSON(cJS return af_event_notification_local_var; end: + if (flowsList) { + OpenAPI_list_for_each(flowsList, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(flowsList); + flowsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/af_event_notification.h b/lib/sbi/openapi/model/af_event_notification.h index 0b2de0cc5..e950bae69 100644 --- a/lib/sbi/openapi/model/af_event_notification.h +++ b/lib/sbi/openapi/model/af_event_notification.h @@ -12,8 +12,8 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "af_event.h" #include "flows.h" +#include "npcf_af_event.h" #ifdef __cplusplus extern "C" { @@ -21,12 +21,12 @@ extern "C" { typedef struct OpenAPI_af_event_notification_s OpenAPI_af_event_notification_t; typedef struct OpenAPI_af_event_notification_s { - OpenAPI_af_event_e event; + OpenAPI_npcf_af_event_e event; OpenAPI_list_t *flows; } OpenAPI_af_event_notification_t; OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_create( - OpenAPI_af_event_e event, + OpenAPI_npcf_af_event_e event, OpenAPI_list_t *flows ); void OpenAPI_af_event_notification_free(OpenAPI_af_event_notification_t *af_event_notification); diff --git a/lib/sbi/openapi/model/af_event_subscription.c b/lib/sbi/openapi/model/af_event_subscription.c index ac5dc02ac..6d5d3533a 100644 --- a/lib/sbi/openapi/model/af_event_subscription.c +++ b/lib/sbi/openapi/model/af_event_subscription.c @@ -5,7 +5,7 @@ #include "af_event_subscription.h" OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_create( - OpenAPI_af_event_e event, + OpenAPI_npcf_af_event_e event, OpenAPI_af_notif_method_e notif_method, bool is_rep_period, int rep_period, @@ -28,16 +28,18 @@ OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_create( void OpenAPI_af_event_subscription_free(OpenAPI_af_event_subscription_t *af_event_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == af_event_subscription) { return; } - OpenAPI_lnode_t *node; ogs_free(af_event_subscription); } cJSON *OpenAPI_af_event_subscription_convertToJSON(OpenAPI_af_event_subscription_t *af_event_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (af_event_subscription == NULL) { ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [AfEventSubscription]"); @@ -45,12 +47,16 @@ cJSON *OpenAPI_af_event_subscription_convertToJSON(OpenAPI_af_event_subscription } item = cJSON_CreateObject(); - if (cJSON_AddStringToObject(item, "event", OpenAPI_af_event_ToString(af_event_subscription->event)) == NULL) { + if (af_event_subscription->event == OpenAPI_npcf_af_event_NULL) { + ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [event]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "event", OpenAPI_npcf_af_event_ToString(af_event_subscription->event)) == NULL) { ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [event]"); goto end; } - if (af_event_subscription->notif_method) { + if (af_event_subscription->notif_method != OpenAPI_af_notif_method_NULL) { if (cJSON_AddStringToObject(item, "notifMethod", OpenAPI_af_notif_method_ToString(af_event_subscription->notif_method)) == NULL) { ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [notif_method]"); goto end; @@ -78,22 +84,25 @@ end: OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_parseFromJSON(cJSON *af_event_subscriptionJSON) { OpenAPI_af_event_subscription_t *af_event_subscription_local_var = NULL; - cJSON *event = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "event"); + OpenAPI_lnode_t *node = NULL; + cJSON *event = NULL; + OpenAPI_npcf_af_event_e eventVariable = 0; + cJSON *notif_method = NULL; + OpenAPI_af_notif_method_e notif_methodVariable = 0; + cJSON *rep_period = NULL; + cJSON *wait_time = NULL; + event = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "event"); if (!event) { ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [event]"); goto end; } - - OpenAPI_af_event_e eventVariable; if (!cJSON_IsString(event)) { ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [event]"); goto end; } - eventVariable = OpenAPI_af_event_FromString(event->valuestring); + eventVariable = OpenAPI_npcf_af_event_FromString(event->valuestring); - cJSON *notif_method = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "notifMethod"); - - OpenAPI_af_notif_method_e notif_methodVariable; + notif_method = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "notifMethod"); if (notif_method) { if (!cJSON_IsString(notif_method)) { ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [notif_method]"); @@ -102,8 +111,7 @@ OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_parseFromJSON(cJS notif_methodVariable = OpenAPI_af_notif_method_FromString(notif_method->valuestring); } - cJSON *rep_period = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "repPeriod"); - + rep_period = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "repPeriod"); if (rep_period) { if (!cJSON_IsNumber(rep_period)) { ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [rep_period]"); @@ -111,8 +119,7 @@ OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_parseFromJSON(cJS } } - cJSON *wait_time = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "waitTime"); - + wait_time = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "waitTime"); if (wait_time) { if (!cJSON_IsNumber(wait_time)) { ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [wait_time]"); diff --git a/lib/sbi/openapi/model/af_event_subscription.h b/lib/sbi/openapi/model/af_event_subscription.h index e649c6c52..96375bd01 100644 --- a/lib/sbi/openapi/model/af_event_subscription.h +++ b/lib/sbi/openapi/model/af_event_subscription.h @@ -12,8 +12,8 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "af_event.h" #include "af_notif_method.h" +#include "npcf_af_event.h" #ifdef __cplusplus extern "C" { @@ -21,7 +21,7 @@ extern "C" { typedef struct OpenAPI_af_event_subscription_s OpenAPI_af_event_subscription_t; typedef struct OpenAPI_af_event_subscription_s { - OpenAPI_af_event_e event; + OpenAPI_npcf_af_event_e event; OpenAPI_af_notif_method_e notif_method; bool is_rep_period; int rep_period; @@ -30,7 +30,7 @@ typedef struct OpenAPI_af_event_subscription_s { } OpenAPI_af_event_subscription_t; OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_create( - OpenAPI_af_event_e event, + OpenAPI_npcf_af_event_e event, OpenAPI_af_notif_method_e notif_method, bool is_rep_period, int rep_period, diff --git a/lib/sbi/openapi/model/af_external.c b/lib/sbi/openapi/model/af_external.c index 71470f494..293537313 100644 --- a/lib/sbi/openapi/model/af_external.c +++ b/lib/sbi/openapi/model/af_external.c @@ -24,22 +24,33 @@ OpenAPI_af_external_t *OpenAPI_af_external_create( void OpenAPI_af_external_free(OpenAPI_af_external_t *af_external) { + OpenAPI_lnode_t *node = NULL; + if (NULL == af_external) { return; } - OpenAPI_lnode_t *node; - ogs_free(af_external->af_id); - OpenAPI_list_for_each(af_external->allowed_geographic_area, node) { - OpenAPI_geographic_area_free(node->data); + if (af_external->af_id) { + ogs_free(af_external->af_id); + af_external->af_id = NULL; + } + if (af_external->allowed_geographic_area) { + OpenAPI_list_for_each(af_external->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(af_external->allowed_geographic_area); + af_external->allowed_geographic_area = NULL; + } + if (af_external->valid_time_period) { + OpenAPI_valid_time_period_free(af_external->valid_time_period); + af_external->valid_time_period = NULL; } - OpenAPI_list_free(af_external->allowed_geographic_area); - OpenAPI_valid_time_period_free(af_external->valid_time_period); ogs_free(af_external); } cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (af_external == NULL) { ogs_error("OpenAPI_af_external_convertToJSON() failed [AfExternal]"); @@ -60,21 +71,17 @@ cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external) ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]"); goto end; } - - OpenAPI_lnode_t *allowed_geographic_area_node; - if (af_external->allowed_geographic_area) { - OpenAPI_list_for_each(af_external->allowed_geographic_area, allowed_geographic_area_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]"); - goto end; - } - cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + OpenAPI_list_for_each(af_external->allowed_geographic_area, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); } } - if (af_external->privacy_check_related_action) { + if (af_external->privacy_check_related_action != OpenAPI_privacy_check_related_action_NULL) { if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(af_external->privacy_check_related_action)) == NULL) { ogs_error("OpenAPI_af_external_convertToJSON() failed [privacy_check_related_action]"); goto end; @@ -101,47 +108,48 @@ end: OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON) { OpenAPI_af_external_t *af_external_local_var = NULL; - cJSON *af_id = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "afId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *af_id = NULL; + cJSON *allowed_geographic_area = NULL; + OpenAPI_list_t *allowed_geographic_areaList = NULL; + cJSON *privacy_check_related_action = NULL; + OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + af_id = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "afId"); if (af_id) { - if (!cJSON_IsString(af_id)) { + if (!cJSON_IsString(af_id) && !cJSON_IsNull(af_id)) { ogs_error("OpenAPI_af_external_parseFromJSON() failed [af_id]"); goto end; } } - cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "allowedGeographicArea"); - - OpenAPI_list_t *allowed_geographic_areaList; + allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "allowedGeographicArea"); if (allowed_geographic_area) { - cJSON *allowed_geographic_area_local_nonprimitive; - if (!cJSON_IsArray(allowed_geographic_area)){ - ogs_error("OpenAPI_af_external_parseFromJSON() failed [allowed_geographic_area]"); - goto end; - } - - allowed_geographic_areaList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) { - if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) { + cJSON *allowed_geographic_area_local = NULL; + if (!cJSON_IsArray(allowed_geographic_area)) { ogs_error("OpenAPI_af_external_parseFromJSON() failed [allowed_geographic_area]"); goto end; } - OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive); - if (!allowed_geographic_areaItem) { - ogs_error("No allowed_geographic_areaItem"); - OpenAPI_list_free(allowed_geographic_areaList); - goto end; + allowed_geographic_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_geographic_area_local, allowed_geographic_area) { + if (!cJSON_IsObject(allowed_geographic_area_local)) { + ogs_error("OpenAPI_af_external_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local); + if (!allowed_geographic_areaItem) { + ogs_error("No allowed_geographic_areaItem"); + OpenAPI_list_free(allowed_geographic_areaList); + goto end; + } + OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); } - - OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); - } } - cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "privacyCheckRelatedAction"); - - OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable; + privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "privacyCheckRelatedAction"); if (privacy_check_related_action) { if (!cJSON_IsString(privacy_check_related_action)) { ogs_error("OpenAPI_af_external_parseFromJSON() failed [privacy_check_related_action]"); @@ -150,15 +158,13 @@ OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON) privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); } - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "validTimePeriod"); - - OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period); } af_external_local_var = OpenAPI_af_external_create ( - af_id ? ogs_strdup(af_id->valuestring) : NULL, + af_id && !cJSON_IsNull(af_id) ? ogs_strdup(af_id->valuestring) : NULL, allowed_geographic_area ? allowed_geographic_areaList : NULL, privacy_check_related_action ? privacy_check_related_actionVariable : 0, valid_time_period ? valid_time_period_local_nonprim : NULL @@ -166,6 +172,17 @@ OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON) return af_external_local_var; end: + if (allowed_geographic_areaList) { + OpenAPI_list_for_each(allowed_geographic_areaList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(allowed_geographic_areaList); + allowed_geographic_areaList = NULL; + } + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/af_routing_requirement.c b/lib/sbi/openapi/model/af_routing_requirement.c index 74739a8ed..9d903beb7 100644 --- a/lib/sbi/openapi/model/af_routing_requirement.c +++ b/lib/sbi/openapi/model/af_routing_requirement.c @@ -32,26 +32,40 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_create( void OpenAPI_af_routing_requirement_free(OpenAPI_af_routing_requirement_t *af_routing_requirement) { + OpenAPI_lnode_t *node = NULL; + if (NULL == af_routing_requirement) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(af_routing_requirement->route_to_locs, node) { - OpenAPI_route_to_location_free(node->data); + if (af_routing_requirement->route_to_locs) { + OpenAPI_list_for_each(af_routing_requirement->route_to_locs, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(af_routing_requirement->route_to_locs); + af_routing_requirement->route_to_locs = NULL; } - OpenAPI_list_free(af_routing_requirement->route_to_locs); - OpenAPI_spatial_validity_free(af_routing_requirement->sp_val); - OpenAPI_list_for_each(af_routing_requirement->temp_vals, node) { - OpenAPI_temporal_validity_free(node->data); + if (af_routing_requirement->sp_val) { + OpenAPI_spatial_validity_free(af_routing_requirement->sp_val); + af_routing_requirement->sp_val = NULL; + } + if (af_routing_requirement->temp_vals) { + OpenAPI_list_for_each(af_routing_requirement->temp_vals, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(af_routing_requirement->temp_vals); + af_routing_requirement->temp_vals = NULL; + } + if (af_routing_requirement->up_path_chg_sub) { + OpenAPI_up_path_chg_event_free(af_routing_requirement->up_path_chg_sub); + af_routing_requirement->up_path_chg_sub = NULL; } - OpenAPI_list_free(af_routing_requirement->temp_vals); - OpenAPI_up_path_chg_event_free(af_routing_requirement->up_path_chg_sub); ogs_free(af_routing_requirement); } cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requirement_t *af_routing_requirement) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (af_routing_requirement == NULL) { ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [AfRoutingRequirement]"); @@ -72,17 +86,13 @@ cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requireme ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [route_to_locs]"); goto end; } - - OpenAPI_lnode_t *route_to_locs_node; - if (af_routing_requirement->route_to_locs) { - OpenAPI_list_for_each(af_routing_requirement->route_to_locs, route_to_locs_node) { - cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(route_to_locs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [route_to_locs]"); - goto end; - } - cJSON_AddItemToArray(route_to_locsList, itemLocal); + OpenAPI_list_for_each(af_routing_requirement->route_to_locs, node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [route_to_locs]"); + goto end; } + cJSON_AddItemToArray(route_to_locsList, itemLocal); } } @@ -105,17 +115,13 @@ cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requireme ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [temp_vals]"); goto end; } - - OpenAPI_lnode_t *temp_vals_node; - if (af_routing_requirement->temp_vals) { - OpenAPI_list_for_each(af_routing_requirement->temp_vals, temp_vals_node) { - cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(temp_vals_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [temp_vals]"); - goto end; - } - cJSON_AddItemToArray(temp_valsList, itemLocal); + OpenAPI_list_for_each(af_routing_requirement->temp_vals, node) { + cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [temp_vals]"); + goto end; } + cJSON_AddItemToArray(temp_valsList, itemLocal); } } @@ -146,8 +152,18 @@ end: OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(cJSON *af_routing_requirementJSON) { OpenAPI_af_routing_requirement_t *af_routing_requirement_local_var = NULL; - cJSON *app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "appReloc"); - + OpenAPI_lnode_t *node = NULL; + cJSON *app_reloc = NULL; + cJSON *route_to_locs = NULL; + OpenAPI_list_t *route_to_locsList = NULL; + cJSON *sp_val = NULL; + OpenAPI_spatial_validity_t *sp_val_local_nonprim = NULL; + cJSON *temp_vals = NULL; + OpenAPI_list_t *temp_valsList = NULL; + cJSON *up_path_chg_sub = NULL; + OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL; + cJSON *addr_preser_ind = NULL; + app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "appReloc"); if (app_reloc) { if (!cJSON_IsBool(app_reloc)) { ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [app_reloc]"); @@ -155,80 +171,67 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c } } - cJSON *route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "routeToLocs"); - - OpenAPI_list_t *route_to_locsList; + route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "routeToLocs"); if (route_to_locs) { - cJSON *route_to_locs_local_nonprimitive; - if (!cJSON_IsArray(route_to_locs)){ - ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [route_to_locs]"); - goto end; - } - - route_to_locsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(route_to_locs_local_nonprimitive, route_to_locs ) { - if (!cJSON_IsObject(route_to_locs_local_nonprimitive)) { + cJSON *route_to_locs_local = NULL; + if (!cJSON_IsArray(route_to_locs)) { ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [route_to_locs]"); goto end; } - OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local_nonprimitive); - if (!route_to_locsItem) { - ogs_error("No route_to_locsItem"); - OpenAPI_list_free(route_to_locsList); - goto end; + route_to_locsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(route_to_locs_local, route_to_locs) { + if (!cJSON_IsObject(route_to_locs_local)) { + ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [route_to_locs]"); + goto end; + } + OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local); + if (!route_to_locsItem) { + ogs_error("No route_to_locsItem"); + OpenAPI_list_free(route_to_locsList); + goto end; + } + OpenAPI_list_add(route_to_locsList, route_to_locsItem); } - - OpenAPI_list_add(route_to_locsList, route_to_locsItem); - } } - cJSON *sp_val = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "spVal"); - - OpenAPI_spatial_validity_t *sp_val_local_nonprim = NULL; + sp_val = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "spVal"); if (sp_val) { sp_val_local_nonprim = OpenAPI_spatial_validity_parseFromJSON(sp_val); } - cJSON *temp_vals = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "tempVals"); - - OpenAPI_list_t *temp_valsList; + temp_vals = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "tempVals"); if (temp_vals) { - cJSON *temp_vals_local_nonprimitive; - if (!cJSON_IsArray(temp_vals)){ - ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [temp_vals]"); - goto end; - } - - temp_valsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(temp_vals_local_nonprimitive, temp_vals ) { - if (!cJSON_IsObject(temp_vals_local_nonprimitive)) { + cJSON *temp_vals_local = NULL; + if (!cJSON_IsArray(temp_vals)) { ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [temp_vals]"); goto end; } - OpenAPI_temporal_validity_t *temp_valsItem = OpenAPI_temporal_validity_parseFromJSON(temp_vals_local_nonprimitive); - if (!temp_valsItem) { - ogs_error("No temp_valsItem"); - OpenAPI_list_free(temp_valsList); - goto end; + temp_valsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(temp_vals_local, temp_vals) { + if (!cJSON_IsObject(temp_vals_local)) { + ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [temp_vals]"); + goto end; + } + OpenAPI_temporal_validity_t *temp_valsItem = OpenAPI_temporal_validity_parseFromJSON(temp_vals_local); + if (!temp_valsItem) { + ogs_error("No temp_valsItem"); + OpenAPI_list_free(temp_valsList); + goto end; + } + OpenAPI_list_add(temp_valsList, temp_valsItem); } - - OpenAPI_list_add(temp_valsList, temp_valsItem); - } } - cJSON *up_path_chg_sub = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "upPathChgSub"); - - OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL; + up_path_chg_sub = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "upPathChgSub"); if (up_path_chg_sub) { up_path_chg_sub_local_nonprim = OpenAPI_up_path_chg_event_parseFromJSON(up_path_chg_sub); } - cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "addrPreserInd"); - + addr_preser_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "addrPreserInd"); if (addr_preser_ind) { if (!cJSON_IsBool(addr_preser_ind)) { ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [addr_preser_ind]"); @@ -249,6 +252,28 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c return af_routing_requirement_local_var; end: + if (route_to_locsList) { + OpenAPI_list_for_each(route_to_locsList, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(route_to_locsList); + route_to_locsList = NULL; + } + if (sp_val_local_nonprim) { + OpenAPI_spatial_validity_free(sp_val_local_nonprim); + sp_val_local_nonprim = NULL; + } + if (temp_valsList) { + OpenAPI_list_for_each(temp_valsList, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(temp_valsList); + temp_valsList = NULL; + } + if (up_path_chg_sub_local_nonprim) { + OpenAPI_up_path_chg_event_free(up_path_chg_sub_local_nonprim); + up_path_chg_sub_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/af_routing_requirement_rm.c b/lib/sbi/openapi/model/af_routing_requirement_rm.c index 38110e612..a511ff138 100644 --- a/lib/sbi/openapi/model/af_routing_requirement_rm.c +++ b/lib/sbi/openapi/model/af_routing_requirement_rm.c @@ -32,26 +32,40 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_create( void OpenAPI_af_routing_requirement_rm_free(OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == af_routing_requirement_rm) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(af_routing_requirement_rm->route_to_locs, node) { - OpenAPI_route_to_location_free(node->data); + if (af_routing_requirement_rm->route_to_locs) { + OpenAPI_list_for_each(af_routing_requirement_rm->route_to_locs, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(af_routing_requirement_rm->route_to_locs); + af_routing_requirement_rm->route_to_locs = NULL; } - OpenAPI_list_free(af_routing_requirement_rm->route_to_locs); - OpenAPI_spatial_validity_rm_free(af_routing_requirement_rm->sp_val); - OpenAPI_list_for_each(af_routing_requirement_rm->temp_vals, node) { - OpenAPI_temporal_validity_free(node->data); + if (af_routing_requirement_rm->sp_val) { + OpenAPI_spatial_validity_rm_free(af_routing_requirement_rm->sp_val); + af_routing_requirement_rm->sp_val = NULL; + } + if (af_routing_requirement_rm->temp_vals) { + OpenAPI_list_for_each(af_routing_requirement_rm->temp_vals, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(af_routing_requirement_rm->temp_vals); + af_routing_requirement_rm->temp_vals = NULL; + } + if (af_routing_requirement_rm->up_path_chg_sub) { + OpenAPI_up_path_chg_event_free(af_routing_requirement_rm->up_path_chg_sub); + af_routing_requirement_rm->up_path_chg_sub = NULL; } - OpenAPI_list_free(af_routing_requirement_rm->temp_vals); - OpenAPI_up_path_chg_event_free(af_routing_requirement_rm->up_path_chg_sub); ogs_free(af_routing_requirement_rm); } cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (af_routing_requirement_rm == NULL) { ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [AfRoutingRequirementRm]"); @@ -72,17 +86,13 @@ cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requir ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [route_to_locs]"); goto end; } - - OpenAPI_lnode_t *route_to_locs_node; - if (af_routing_requirement_rm->route_to_locs) { - OpenAPI_list_for_each(af_routing_requirement_rm->route_to_locs, route_to_locs_node) { - cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(route_to_locs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [route_to_locs]"); - goto end; - } - cJSON_AddItemToArray(route_to_locsList, itemLocal); + OpenAPI_list_for_each(af_routing_requirement_rm->route_to_locs, node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [route_to_locs]"); + goto end; } + cJSON_AddItemToArray(route_to_locsList, itemLocal); } } @@ -105,17 +115,13 @@ cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requir ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [temp_vals]"); goto end; } - - OpenAPI_lnode_t *temp_vals_node; - if (af_routing_requirement_rm->temp_vals) { - OpenAPI_list_for_each(af_routing_requirement_rm->temp_vals, temp_vals_node) { - cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(temp_vals_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [temp_vals]"); - goto end; - } - cJSON_AddItemToArray(temp_valsList, itemLocal); + OpenAPI_list_for_each(af_routing_requirement_rm->temp_vals, node) { + cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [temp_vals]"); + goto end; } + cJSON_AddItemToArray(temp_valsList, itemLocal); } } @@ -146,8 +152,18 @@ end: OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFromJSON(cJSON *af_routing_requirement_rmJSON) { OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm_local_var = NULL; - cJSON *app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "appReloc"); - + OpenAPI_lnode_t *node = NULL; + cJSON *app_reloc = NULL; + cJSON *route_to_locs = NULL; + OpenAPI_list_t *route_to_locsList = NULL; + cJSON *sp_val = NULL; + OpenAPI_spatial_validity_rm_t *sp_val_local_nonprim = NULL; + cJSON *temp_vals = NULL; + OpenAPI_list_t *temp_valsList = NULL; + cJSON *up_path_chg_sub = NULL; + OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL; + cJSON *addr_preser_ind = NULL; + app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "appReloc"); if (app_reloc) { if (!cJSON_IsBool(app_reloc)) { ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [app_reloc]"); @@ -155,80 +171,67 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom } } - cJSON *route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "routeToLocs"); - - OpenAPI_list_t *route_to_locsList; + route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "routeToLocs"); if (route_to_locs) { - cJSON *route_to_locs_local_nonprimitive; - if (!cJSON_IsArray(route_to_locs)){ - ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [route_to_locs]"); - goto end; - } - - route_to_locsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(route_to_locs_local_nonprimitive, route_to_locs ) { - if (!cJSON_IsObject(route_to_locs_local_nonprimitive)) { + cJSON *route_to_locs_local = NULL; + if (!cJSON_IsArray(route_to_locs)) { ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [route_to_locs]"); goto end; } - OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local_nonprimitive); - if (!route_to_locsItem) { - ogs_error("No route_to_locsItem"); - OpenAPI_list_free(route_to_locsList); - goto end; + route_to_locsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(route_to_locs_local, route_to_locs) { + if (!cJSON_IsObject(route_to_locs_local)) { + ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [route_to_locs]"); + goto end; + } + OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local); + if (!route_to_locsItem) { + ogs_error("No route_to_locsItem"); + OpenAPI_list_free(route_to_locsList); + goto end; + } + OpenAPI_list_add(route_to_locsList, route_to_locsItem); } - - OpenAPI_list_add(route_to_locsList, route_to_locsItem); - } } - cJSON *sp_val = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "spVal"); - - OpenAPI_spatial_validity_rm_t *sp_val_local_nonprim = NULL; + sp_val = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "spVal"); if (sp_val) { sp_val_local_nonprim = OpenAPI_spatial_validity_rm_parseFromJSON(sp_val); } - cJSON *temp_vals = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "tempVals"); - - OpenAPI_list_t *temp_valsList; + temp_vals = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "tempVals"); if (temp_vals) { - cJSON *temp_vals_local_nonprimitive; - if (!cJSON_IsArray(temp_vals)){ - ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [temp_vals]"); - goto end; - } - - temp_valsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(temp_vals_local_nonprimitive, temp_vals ) { - if (!cJSON_IsObject(temp_vals_local_nonprimitive)) { + cJSON *temp_vals_local = NULL; + if (!cJSON_IsArray(temp_vals)) { ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [temp_vals]"); goto end; } - OpenAPI_temporal_validity_t *temp_valsItem = OpenAPI_temporal_validity_parseFromJSON(temp_vals_local_nonprimitive); - if (!temp_valsItem) { - ogs_error("No temp_valsItem"); - OpenAPI_list_free(temp_valsList); - goto end; + temp_valsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(temp_vals_local, temp_vals) { + if (!cJSON_IsObject(temp_vals_local)) { + ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [temp_vals]"); + goto end; + } + OpenAPI_temporal_validity_t *temp_valsItem = OpenAPI_temporal_validity_parseFromJSON(temp_vals_local); + if (!temp_valsItem) { + ogs_error("No temp_valsItem"); + OpenAPI_list_free(temp_valsList); + goto end; + } + OpenAPI_list_add(temp_valsList, temp_valsItem); } - - OpenAPI_list_add(temp_valsList, temp_valsItem); - } } - cJSON *up_path_chg_sub = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "upPathChgSub"); - - OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL; + up_path_chg_sub = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "upPathChgSub"); if (up_path_chg_sub) { up_path_chg_sub_local_nonprim = OpenAPI_up_path_chg_event_parseFromJSON(up_path_chg_sub); } - cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "addrPreserInd"); - + addr_preser_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "addrPreserInd"); if (addr_preser_ind) { if (!cJSON_IsBool(addr_preser_ind)) { ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [addr_preser_ind]"); @@ -249,6 +252,28 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom return af_routing_requirement_rm_local_var; end: + if (route_to_locsList) { + OpenAPI_list_for_each(route_to_locsList, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(route_to_locsList); + route_to_locsList = NULL; + } + if (sp_val_local_nonprim) { + OpenAPI_spatial_validity_rm_free(sp_val_local_nonprim); + sp_val_local_nonprim = NULL; + } + if (temp_valsList) { + OpenAPI_list_for_each(temp_valsList, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(temp_valsList); + temp_valsList = NULL; + } + if (up_path_chg_sub_local_nonprim) { + OpenAPI_up_path_chg_event_free(up_path_chg_sub_local_nonprim); + up_path_chg_sub_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/allowed_mtc_provider_info.c b/lib/sbi/openapi/model/allowed_mtc_provider_info.c index 618a53c07..290f77114 100644 --- a/lib/sbi/openapi/model/allowed_mtc_provider_info.c +++ b/lib/sbi/openapi/model/allowed_mtc_provider_info.c @@ -20,18 +20,26 @@ OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_create( void OpenAPI_allowed_mtc_provider_info_free(OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == allowed_mtc_provider_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(allowed_mtc_provider_info->mtc_provider_information); - ogs_free(allowed_mtc_provider_info->af_id); + if (allowed_mtc_provider_info->mtc_provider_information) { + ogs_free(allowed_mtc_provider_info->mtc_provider_information); + allowed_mtc_provider_info->mtc_provider_information = NULL; + } + if (allowed_mtc_provider_info->af_id) { + ogs_free(allowed_mtc_provider_info->af_id); + allowed_mtc_provider_info->af_id = NULL; + } ogs_free(allowed_mtc_provider_info); } cJSON *OpenAPI_allowed_mtc_provider_info_convertToJSON(OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (allowed_mtc_provider_info == NULL) { ogs_error("OpenAPI_allowed_mtc_provider_info_convertToJSON() failed [AllowedMtcProviderInfo]"); @@ -60,27 +68,28 @@ end: OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_parseFromJSON(cJSON *allowed_mtc_provider_infoJSON) { OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info_local_var = NULL; - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(allowed_mtc_provider_infoJSON, "mtcProviderInformation"); - + OpenAPI_lnode_t *node = NULL; + cJSON *mtc_provider_information = NULL; + cJSON *af_id = NULL; + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(allowed_mtc_provider_infoJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_allowed_mtc_provider_info_parseFromJSON() failed [mtc_provider_information]"); goto end; } } - cJSON *af_id = cJSON_GetObjectItemCaseSensitive(allowed_mtc_provider_infoJSON, "afId"); - + af_id = cJSON_GetObjectItemCaseSensitive(allowed_mtc_provider_infoJSON, "afId"); if (af_id) { - if (!cJSON_IsString(af_id)) { + if (!cJSON_IsString(af_id) && !cJSON_IsNull(af_id)) { ogs_error("OpenAPI_allowed_mtc_provider_info_parseFromJSON() failed [af_id]"); goto end; } } allowed_mtc_provider_info_local_var = OpenAPI_allowed_mtc_provider_info_create ( - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL, - af_id ? ogs_strdup(af_id->valuestring) : NULL + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL, + af_id && !cJSON_IsNull(af_id) ? ogs_strdup(af_id->valuestring) : NULL ); return allowed_mtc_provider_info_local_var; diff --git a/lib/sbi/openapi/model/allowed_nssai.c b/lib/sbi/openapi/model/allowed_nssai.c index 1e919ebfc..03e6269a7 100644 --- a/lib/sbi/openapi/model/allowed_nssai.c +++ b/lib/sbi/openapi/model/allowed_nssai.c @@ -20,20 +20,25 @@ OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_create( void OpenAPI_allowed_nssai_free(OpenAPI_allowed_nssai_t *allowed_nssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == allowed_nssai) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, node) { - OpenAPI_allowed_snssai_free(node->data); + if (allowed_nssai->allowed_snssai_list) { + OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, node) { + OpenAPI_allowed_snssai_free(node->data); + } + OpenAPI_list_free(allowed_nssai->allowed_snssai_list); + allowed_nssai->allowed_snssai_list = NULL; } - OpenAPI_list_free(allowed_nssai->allowed_snssai_list); ogs_free(allowed_nssai); } cJSON *OpenAPI_allowed_nssai_convertToJSON(OpenAPI_allowed_nssai_t *allowed_nssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (allowed_nssai == NULL) { ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [AllowedNssai]"); @@ -41,24 +46,28 @@ cJSON *OpenAPI_allowed_nssai_convertToJSON(OpenAPI_allowed_nssai_t *allowed_nssa } item = cJSON_CreateObject(); + if (!allowed_nssai->allowed_snssai_list) { + ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]"); + return NULL; + } cJSON *allowed_snssai_listList = cJSON_AddArrayToObject(item, "allowedSnssaiList"); if (allowed_snssai_listList == NULL) { ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]"); goto end; } - - OpenAPI_lnode_t *allowed_snssai_list_node; - if (allowed_nssai->allowed_snssai_list) { - OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, allowed_snssai_list_node) { - cJSON *itemLocal = OpenAPI_allowed_snssai_convertToJSON(allowed_snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]"); - goto end; - } - cJSON_AddItemToArray(allowed_snssai_listList, itemLocal); + OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, node) { + cJSON *itemLocal = OpenAPI_allowed_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]"); + goto end; } + cJSON_AddItemToArray(allowed_snssai_listList, itemLocal); } + if (allowed_nssai->access_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [access_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(allowed_nssai->access_type)) == NULL) { ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [access_type]"); goto end; @@ -71,44 +80,43 @@ end: OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssaiJSON) { OpenAPI_allowed_nssai_t *allowed_nssai_local_var = NULL; - cJSON *allowed_snssai_list = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "allowedSnssaiList"); + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_snssai_list = NULL; + OpenAPI_list_t *allowed_snssai_listList = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + allowed_snssai_list = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "allowedSnssaiList"); if (!allowed_snssai_list) { ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]"); goto end; } - - OpenAPI_list_t *allowed_snssai_listList; - cJSON *allowed_snssai_list_local_nonprimitive; - if (!cJSON_IsArray(allowed_snssai_list)){ - ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]"); - goto end; - } - - allowed_snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_snssai_list_local_nonprimitive, allowed_snssai_list ) { - if (!cJSON_IsObject(allowed_snssai_list_local_nonprimitive)) { + cJSON *allowed_snssai_list_local = NULL; + if (!cJSON_IsArray(allowed_snssai_list)) { ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]"); goto end; } - OpenAPI_allowed_snssai_t *allowed_snssai_listItem = OpenAPI_allowed_snssai_parseFromJSON(allowed_snssai_list_local_nonprimitive); - if (!allowed_snssai_listItem) { - ogs_error("No allowed_snssai_listItem"); - OpenAPI_list_free(allowed_snssai_listList); - goto end; + allowed_snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_snssai_list_local, allowed_snssai_list) { + if (!cJSON_IsObject(allowed_snssai_list_local)) { + ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]"); + goto end; + } + OpenAPI_allowed_snssai_t *allowed_snssai_listItem = OpenAPI_allowed_snssai_parseFromJSON(allowed_snssai_list_local); + if (!allowed_snssai_listItem) { + ogs_error("No allowed_snssai_listItem"); + OpenAPI_list_free(allowed_snssai_listList); + goto end; + } + OpenAPI_list_add(allowed_snssai_listList, allowed_snssai_listItem); } - OpenAPI_list_add(allowed_snssai_listList, allowed_snssai_listItem); - } - - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "accessType"); + access_type = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "accessType"); if (!access_type) { ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [access_type]"); goto end; } - - OpenAPI_access_type_e access_typeVariable; if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [access_type]"); goto end; @@ -122,6 +130,13 @@ OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssa return allowed_nssai_local_var; end: + if (allowed_snssai_listList) { + OpenAPI_list_for_each(allowed_snssai_listList, node) { + OpenAPI_allowed_snssai_free(node->data); + } + OpenAPI_list_free(allowed_snssai_listList); + allowed_snssai_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/allowed_snssai.c b/lib/sbi/openapi/model/allowed_snssai.c index a766f40cd..1df4d2510 100644 --- a/lib/sbi/openapi/model/allowed_snssai.c +++ b/lib/sbi/openapi/model/allowed_snssai.c @@ -22,22 +22,33 @@ OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_create( void OpenAPI_allowed_snssai_free(OpenAPI_allowed_snssai_t *allowed_snssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == allowed_snssai) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(allowed_snssai->allowed_snssai); - OpenAPI_list_for_each(allowed_snssai->nsi_information_list, node) { - OpenAPI_nsi_information_free(node->data); + if (allowed_snssai->allowed_snssai) { + OpenAPI_snssai_free(allowed_snssai->allowed_snssai); + allowed_snssai->allowed_snssai = NULL; + } + if (allowed_snssai->nsi_information_list) { + OpenAPI_list_for_each(allowed_snssai->nsi_information_list, node) { + OpenAPI_nsi_information_free(node->data); + } + OpenAPI_list_free(allowed_snssai->nsi_information_list); + allowed_snssai->nsi_information_list = NULL; + } + if (allowed_snssai->mapped_home_snssai) { + OpenAPI_snssai_free(allowed_snssai->mapped_home_snssai); + allowed_snssai->mapped_home_snssai = NULL; } - OpenAPI_list_free(allowed_snssai->nsi_information_list); - OpenAPI_snssai_free(allowed_snssai->mapped_home_snssai); ogs_free(allowed_snssai); } cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_snssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (allowed_snssai == NULL) { ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [AllowedSnssai]"); @@ -45,6 +56,10 @@ cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_sn } item = cJSON_CreateObject(); + if (!allowed_snssai->allowed_snssai) { + ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [allowed_snssai]"); + return NULL; + } cJSON *allowed_snssai_local_JSON = OpenAPI_snssai_convertToJSON(allowed_snssai->allowed_snssai); if (allowed_snssai_local_JSON == NULL) { ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [allowed_snssai]"); @@ -62,17 +77,13 @@ cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_sn ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]"); goto end; } - - OpenAPI_lnode_t *nsi_information_list_node; - if (allowed_snssai->nsi_information_list) { - OpenAPI_list_for_each(allowed_snssai->nsi_information_list, nsi_information_list_node) { - cJSON *itemLocal = OpenAPI_nsi_information_convertToJSON(nsi_information_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]"); - goto end; - } - cJSON_AddItemToArray(nsi_information_listList, itemLocal); + OpenAPI_list_for_each(allowed_snssai->nsi_information_list, node) { + cJSON *itemLocal = OpenAPI_nsi_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]"); + goto end; } + cJSON_AddItemToArray(nsi_information_listList, itemLocal); } } @@ -96,47 +107,46 @@ end: OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_parseFromJSON(cJSON *allowed_snssaiJSON) { OpenAPI_allowed_snssai_t *allowed_snssai_local_var = NULL; - cJSON *allowed_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "allowedSnssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_snssai = NULL; + OpenAPI_snssai_t *allowed_snssai_local_nonprim = NULL; + cJSON *nsi_information_list = NULL; + OpenAPI_list_t *nsi_information_listList = NULL; + cJSON *mapped_home_snssai = NULL; + OpenAPI_snssai_t *mapped_home_snssai_local_nonprim = NULL; + allowed_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "allowedSnssai"); if (!allowed_snssai) { ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [allowed_snssai]"); goto end; } - - OpenAPI_snssai_t *allowed_snssai_local_nonprim = NULL; allowed_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(allowed_snssai); - cJSON *nsi_information_list = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "nsiInformationList"); - - OpenAPI_list_t *nsi_information_listList; + nsi_information_list = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "nsiInformationList"); if (nsi_information_list) { - cJSON *nsi_information_list_local_nonprimitive; - if (!cJSON_IsArray(nsi_information_list)){ - ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [nsi_information_list]"); - goto end; - } - - nsi_information_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nsi_information_list_local_nonprimitive, nsi_information_list ) { - if (!cJSON_IsObject(nsi_information_list_local_nonprimitive)) { + cJSON *nsi_information_list_local = NULL; + if (!cJSON_IsArray(nsi_information_list)) { ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [nsi_information_list]"); goto end; } - OpenAPI_nsi_information_t *nsi_information_listItem = OpenAPI_nsi_information_parseFromJSON(nsi_information_list_local_nonprimitive); - if (!nsi_information_listItem) { - ogs_error("No nsi_information_listItem"); - OpenAPI_list_free(nsi_information_listList); - goto end; + nsi_information_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nsi_information_list_local, nsi_information_list) { + if (!cJSON_IsObject(nsi_information_list_local)) { + ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [nsi_information_list]"); + goto end; + } + OpenAPI_nsi_information_t *nsi_information_listItem = OpenAPI_nsi_information_parseFromJSON(nsi_information_list_local); + if (!nsi_information_listItem) { + ogs_error("No nsi_information_listItem"); + OpenAPI_list_free(nsi_information_listList); + goto end; + } + OpenAPI_list_add(nsi_information_listList, nsi_information_listItem); } - - OpenAPI_list_add(nsi_information_listList, nsi_information_listItem); - } } - cJSON *mapped_home_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "mappedHomeSnssai"); - - OpenAPI_snssai_t *mapped_home_snssai_local_nonprim = NULL; + mapped_home_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "mappedHomeSnssai"); if (mapped_home_snssai) { mapped_home_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(mapped_home_snssai); } @@ -149,6 +159,21 @@ OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_parseFromJSON(cJSON *allowed_sn return allowed_snssai_local_var; end: + if (allowed_snssai_local_nonprim) { + OpenAPI_snssai_free(allowed_snssai_local_nonprim); + allowed_snssai_local_nonprim = NULL; + } + if (nsi_information_listList) { + OpenAPI_list_for_each(nsi_information_listList, node) { + OpenAPI_nsi_information_free(node->data); + } + OpenAPI_list_free(nsi_information_listList); + nsi_information_listList = NULL; + } + if (mapped_home_snssai_local_nonprim) { + OpenAPI_snssai_free(mapped_home_snssai_local_nonprim); + mapped_home_snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/alternative_qos_profile.c b/lib/sbi/openapi/model/alternative_qos_profile.c index 6739c0e16..d82910cbf 100644 --- a/lib/sbi/openapi/model/alternative_qos_profile.c +++ b/lib/sbi/openapi/model/alternative_qos_profile.c @@ -28,19 +28,30 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_create( void OpenAPI_alternative_qos_profile_free(OpenAPI_alternative_qos_profile_t *alternative_qos_profile) { + OpenAPI_lnode_t *node = NULL; + if (NULL == alternative_qos_profile) { return; } - OpenAPI_lnode_t *node; - ogs_free(alternative_qos_profile->gua_fbr_dl); - ogs_free(alternative_qos_profile->gua_fbr_ul); - ogs_free(alternative_qos_profile->packet_err_rate); + if (alternative_qos_profile->gua_fbr_dl) { + ogs_free(alternative_qos_profile->gua_fbr_dl); + alternative_qos_profile->gua_fbr_dl = NULL; + } + if (alternative_qos_profile->gua_fbr_ul) { + ogs_free(alternative_qos_profile->gua_fbr_ul); + alternative_qos_profile->gua_fbr_ul = NULL; + } + if (alternative_qos_profile->packet_err_rate) { + ogs_free(alternative_qos_profile->packet_err_rate); + alternative_qos_profile->packet_err_rate = NULL; + } ogs_free(alternative_qos_profile); } cJSON *OpenAPI_alternative_qos_profile_convertToJSON(OpenAPI_alternative_qos_profile_t *alternative_qos_profile) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (alternative_qos_profile == NULL) { ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [AlternativeQosProfile]"); @@ -88,37 +99,39 @@ end: OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON(cJSON *alternative_qos_profileJSON) { OpenAPI_alternative_qos_profile_t *alternative_qos_profile_local_var = NULL; - cJSON *index = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "index"); + OpenAPI_lnode_t *node = NULL; + cJSON *index = NULL; + cJSON *gua_fbr_dl = NULL; + cJSON *gua_fbr_ul = NULL; + cJSON *packet_delay_budget = NULL; + cJSON *packet_err_rate = NULL; + index = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "index"); if (!index) { ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [index]"); goto end; } - if (!cJSON_IsNumber(index)) { ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [index]"); goto end; } - cJSON *gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrDl"); - + gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrDl"); if (gua_fbr_dl) { - if (!cJSON_IsString(gua_fbr_dl)) { + if (!cJSON_IsString(gua_fbr_dl) && !cJSON_IsNull(gua_fbr_dl)) { ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [gua_fbr_dl]"); goto end; } } - cJSON *gua_fbr_ul = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrUl"); - + gua_fbr_ul = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrUl"); if (gua_fbr_ul) { - if (!cJSON_IsString(gua_fbr_ul)) { + if (!cJSON_IsString(gua_fbr_ul) && !cJSON_IsNull(gua_fbr_ul)) { ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [gua_fbr_ul]"); goto end; } } - cJSON *packet_delay_budget = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetDelayBudget"); - + packet_delay_budget = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetDelayBudget"); if (packet_delay_budget) { if (!cJSON_IsNumber(packet_delay_budget)) { ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [packet_delay_budget]"); @@ -126,10 +139,9 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON } } - cJSON *packet_err_rate = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetErrRate"); - + packet_err_rate = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetErrRate"); if (packet_err_rate) { - if (!cJSON_IsString(packet_err_rate)) { + if (!cJSON_IsString(packet_err_rate) && !cJSON_IsNull(packet_err_rate)) { ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [packet_err_rate]"); goto end; } @@ -138,11 +150,11 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON alternative_qos_profile_local_var = OpenAPI_alternative_qos_profile_create ( index->valuedouble, - gua_fbr_dl ? ogs_strdup(gua_fbr_dl->valuestring) : NULL, - gua_fbr_ul ? ogs_strdup(gua_fbr_ul->valuestring) : NULL, + gua_fbr_dl && !cJSON_IsNull(gua_fbr_dl) ? ogs_strdup(gua_fbr_dl->valuestring) : NULL, + gua_fbr_ul && !cJSON_IsNull(gua_fbr_ul) ? ogs_strdup(gua_fbr_ul->valuestring) : NULL, packet_delay_budget ? true : false, packet_delay_budget ? packet_delay_budget->valuedouble : 0, - packet_err_rate ? ogs_strdup(packet_err_rate->valuestring) : NULL + packet_err_rate && !cJSON_IsNull(packet_err_rate) ? ogs_strdup(packet_err_rate->valuestring) : NULL ); return alternative_qos_profile_local_var; diff --git a/lib/sbi/openapi/model/am_policy_data.c b/lib/sbi/openapi/model/am_policy_data.c index b735ec43e..519440003 100644 --- a/lib/sbi/openapi/model/am_policy_data.c +++ b/lib/sbi/openapi/model/am_policy_data.c @@ -20,27 +20,35 @@ OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_create( void OpenAPI_am_policy_data_free(OpenAPI_am_policy_data_t *am_policy_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == am_policy_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(am_policy_data->pra_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (am_policy_data->pra_infos) { + OpenAPI_list_for_each(am_policy_data->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(am_policy_data->pra_infos); + am_policy_data->pra_infos = NULL; } - OpenAPI_list_free(am_policy_data->pra_infos); - OpenAPI_list_for_each(am_policy_data->subsc_cats, node) { - ogs_free(node->data); + if (am_policy_data->subsc_cats) { + OpenAPI_list_for_each(am_policy_data->subsc_cats, node) { + ogs_free(node->data); + } + OpenAPI_list_free(am_policy_data->subsc_cats); + am_policy_data->subsc_cats = NULL; } - OpenAPI_list_free(am_policy_data->subsc_cats); ogs_free(am_policy_data); } cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (am_policy_data == NULL) { ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [AmPolicyData]"); @@ -55,36 +63,33 @@ cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_ goto end; } cJSON *localMapObject = pra_infos; - OpenAPI_lnode_t *pra_infos_node; if (am_policy_data->pra_infos) { - OpenAPI_list_for_each(am_policy_data->pra_infos, pra_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(am_policy_data->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (am_policy_data->subsc_cats) { - cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats"); - if (subsc_cats == NULL) { + cJSON *subsc_catsList = cJSON_AddArrayToObject(item, "subscCats"); + if (subsc_catsList == NULL) { ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]"); goto end; } - - OpenAPI_lnode_t *subsc_cats_node; - OpenAPI_list_for_each(am_policy_data->subsc_cats, subsc_cats_node) { - if (cJSON_AddStringToObject(subsc_cats, "", (char*)subsc_cats_node->data) == NULL) { - ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]"); - goto end; + OpenAPI_list_for_each(am_policy_data->subsc_cats, node) { + if (cJSON_AddStringToObject(subsc_catsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]"); + goto end; + } } - } } end: @@ -94,50 +99,56 @@ end: OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_dataJSON) { OpenAPI_am_policy_data_t *am_policy_data_local_var = NULL; - cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "praInfos"); - - OpenAPI_list_t *pra_infosList; + OpenAPI_lnode_t *node = NULL; + cJSON *pra_infos = NULL; + OpenAPI_list_t *pra_infosList = NULL; + cJSON *subsc_cats = NULL; + OpenAPI_list_t *subsc_catsList = NULL; + pra_infos = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "praInfos"); if (pra_infos) { - cJSON *pra_infos_local_map; - if (!cJSON_IsObject(pra_infos)) { - ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [pra_infos]"); - goto end; - } - pra_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { - cJSON *localMapObject = pra_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [inner]"); + cJSON *pra_infos_local_map = NULL; + if (!cJSON_IsObject(pra_infos) && !cJSON_IsNull(pra_infos)) { + ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [pra_infos]"); goto end; } - OpenAPI_list_add(pra_infosList, localMapKeyPair); - } + if (cJSON_IsObject(pra_infos)) { + pra_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { + cJSON *localMapObject = pra_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pra_infosList, localMapKeyPair); + } + } } - cJSON *subsc_cats = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "subscCats"); - - OpenAPI_list_t *subsc_catsList; + subsc_cats = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "subscCats"); if (subsc_cats) { - cJSON *subsc_cats_local; - if (!cJSON_IsArray(subsc_cats)) { - ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]"); - goto end; - } - subsc_catsList = OpenAPI_list_create(); + cJSON *subsc_cats_local = NULL; + if (!cJSON_IsArray(subsc_cats)) { + ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]"); + goto end; + } - cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { - if (!cJSON_IsString(subsc_cats_local)) { - ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]"); - goto end; - } - OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); - } + subsc_catsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(subsc_cats_local)) { + ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]"); + goto end; + } + OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); + } } am_policy_data_local_var = OpenAPI_am_policy_data_create ( @@ -147,6 +158,23 @@ OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_ return am_policy_data_local_var; end: + if (pra_infosList) { + OpenAPI_list_for_each(pra_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pra_infosList); + pra_infosList = NULL; + } + if (subsc_catsList) { + OpenAPI_list_for_each(subsc_catsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subsc_catsList); + subsc_catsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ambr.c b/lib/sbi/openapi/model/ambr.c index b4f3812cb..cd1dabde1 100644 --- a/lib/sbi/openapi/model/ambr.c +++ b/lib/sbi/openapi/model/ambr.c @@ -20,18 +20,26 @@ OpenAPI_ambr_t *OpenAPI_ambr_create( void OpenAPI_ambr_free(OpenAPI_ambr_t *ambr) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ambr) { return; } - OpenAPI_lnode_t *node; - ogs_free(ambr->uplink); - ogs_free(ambr->downlink); + if (ambr->uplink) { + ogs_free(ambr->uplink); + ambr->uplink = NULL; + } + if (ambr->downlink) { + ogs_free(ambr->downlink); + ambr->downlink = NULL; + } ogs_free(ambr); } cJSON *OpenAPI_ambr_convertToJSON(OpenAPI_ambr_t *ambr) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ambr == NULL) { ogs_error("OpenAPI_ambr_convertToJSON() failed [Ambr]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_ambr_convertToJSON(OpenAPI_ambr_t *ambr) } item = cJSON_CreateObject(); + if (!ambr->uplink) { + ogs_error("OpenAPI_ambr_convertToJSON() failed [uplink]"); + return NULL; + } if (cJSON_AddStringToObject(item, "uplink", ambr->uplink) == NULL) { ogs_error("OpenAPI_ambr_convertToJSON() failed [uplink]"); goto end; } + if (!ambr->downlink) { + ogs_error("OpenAPI_ambr_convertToJSON() failed [downlink]"); + return NULL; + } if (cJSON_AddStringToObject(item, "downlink", ambr->downlink) == NULL) { ogs_error("OpenAPI_ambr_convertToJSON() failed [downlink]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON) { OpenAPI_ambr_t *ambr_local_var = NULL; - cJSON *uplink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "uplink"); + OpenAPI_lnode_t *node = NULL; + cJSON *uplink = NULL; + cJSON *downlink = NULL; + uplink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "uplink"); if (!uplink) { ogs_error("OpenAPI_ambr_parseFromJSON() failed [uplink]"); goto end; } - if (!cJSON_IsString(uplink)) { ogs_error("OpenAPI_ambr_parseFromJSON() failed [uplink]"); goto end; } - cJSON *downlink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "downlink"); + downlink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "downlink"); if (!downlink) { ogs_error("OpenAPI_ambr_parseFromJSON() failed [downlink]"); goto end; } - if (!cJSON_IsString(downlink)) { ogs_error("OpenAPI_ambr_parseFromJSON() failed [downlink]"); goto end; diff --git a/lib/sbi/openapi/model/ambr_1.c b/lib/sbi/openapi/model/ambr_1.c index fa2b32993..88e4b3105 100644 --- a/lib/sbi/openapi/model/ambr_1.c +++ b/lib/sbi/openapi/model/ambr_1.c @@ -20,18 +20,26 @@ OpenAPI_ambr_1_t *OpenAPI_ambr_1_create( void OpenAPI_ambr_1_free(OpenAPI_ambr_1_t *ambr_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ambr_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(ambr_1->uplink); - ogs_free(ambr_1->downlink); + if (ambr_1->uplink) { + ogs_free(ambr_1->uplink); + ambr_1->uplink = NULL; + } + if (ambr_1->downlink) { + ogs_free(ambr_1->downlink); + ambr_1->downlink = NULL; + } ogs_free(ambr_1); } cJSON *OpenAPI_ambr_1_convertToJSON(OpenAPI_ambr_1_t *ambr_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ambr_1 == NULL) { ogs_error("OpenAPI_ambr_1_convertToJSON() failed [Ambr_1]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_ambr_1_convertToJSON(OpenAPI_ambr_1_t *ambr_1) } item = cJSON_CreateObject(); + if (!ambr_1->uplink) { + ogs_error("OpenAPI_ambr_1_convertToJSON() failed [uplink]"); + return NULL; + } if (cJSON_AddStringToObject(item, "uplink", ambr_1->uplink) == NULL) { ogs_error("OpenAPI_ambr_1_convertToJSON() failed [uplink]"); goto end; } + if (!ambr_1->downlink) { + ogs_error("OpenAPI_ambr_1_convertToJSON() failed [downlink]"); + return NULL; + } if (cJSON_AddStringToObject(item, "downlink", ambr_1->downlink) == NULL) { ogs_error("OpenAPI_ambr_1_convertToJSON() failed [downlink]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_ambr_1_t *OpenAPI_ambr_1_parseFromJSON(cJSON *ambr_1JSON) { OpenAPI_ambr_1_t *ambr_1_local_var = NULL; - cJSON *uplink = cJSON_GetObjectItemCaseSensitive(ambr_1JSON, "uplink"); + OpenAPI_lnode_t *node = NULL; + cJSON *uplink = NULL; + cJSON *downlink = NULL; + uplink = cJSON_GetObjectItemCaseSensitive(ambr_1JSON, "uplink"); if (!uplink) { ogs_error("OpenAPI_ambr_1_parseFromJSON() failed [uplink]"); goto end; } - if (!cJSON_IsString(uplink)) { ogs_error("OpenAPI_ambr_1_parseFromJSON() failed [uplink]"); goto end; } - cJSON *downlink = cJSON_GetObjectItemCaseSensitive(ambr_1JSON, "downlink"); + downlink = cJSON_GetObjectItemCaseSensitive(ambr_1JSON, "downlink"); if (!downlink) { ogs_error("OpenAPI_ambr_1_parseFromJSON() failed [downlink]"); goto end; } - if (!cJSON_IsString(downlink)) { ogs_error("OpenAPI_ambr_1_parseFromJSON() failed [downlink]"); goto end; diff --git a/lib/sbi/openapi/model/ambr_rm.c b/lib/sbi/openapi/model/ambr_rm.c index 366f59cb6..c1e812b03 100644 --- a/lib/sbi/openapi/model/ambr_rm.c +++ b/lib/sbi/openapi/model/ambr_rm.c @@ -20,18 +20,26 @@ OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_create( void OpenAPI_ambr_rm_free(OpenAPI_ambr_rm_t *ambr_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ambr_rm) { return; } - OpenAPI_lnode_t *node; - ogs_free(ambr_rm->uplink); - ogs_free(ambr_rm->downlink); + if (ambr_rm->uplink) { + ogs_free(ambr_rm->uplink); + ambr_rm->uplink = NULL; + } + if (ambr_rm->downlink) { + ogs_free(ambr_rm->downlink); + ambr_rm->downlink = NULL; + } ogs_free(ambr_rm); } cJSON *OpenAPI_ambr_rm_convertToJSON(OpenAPI_ambr_rm_t *ambr_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ambr_rm == NULL) { ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [AmbrRm]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_ambr_rm_convertToJSON(OpenAPI_ambr_rm_t *ambr_rm) } item = cJSON_CreateObject(); + if (!ambr_rm->uplink) { + ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [uplink]"); + return NULL; + } if (cJSON_AddStringToObject(item, "uplink", ambr_rm->uplink) == NULL) { ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [uplink]"); goto end; } + if (!ambr_rm->downlink) { + ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [downlink]"); + return NULL; + } if (cJSON_AddStringToObject(item, "downlink", ambr_rm->downlink) == NULL) { ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [downlink]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON) { OpenAPI_ambr_rm_t *ambr_rm_local_var = NULL; - cJSON *uplink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "uplink"); + OpenAPI_lnode_t *node = NULL; + cJSON *uplink = NULL; + cJSON *downlink = NULL; + uplink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "uplink"); if (!uplink) { ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [uplink]"); goto end; } - if (!cJSON_IsString(uplink)) { ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [uplink]"); goto end; } - cJSON *downlink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "downlink"); + downlink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "downlink"); if (!downlink) { ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [downlink]"); goto end; } - if (!cJSON_IsString(downlink)) { ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [downlink]"); goto end; diff --git a/lib/sbi/openapi/model/amf3_gpp_access_registration.c b/lib/sbi/openapi/model/amf3_gpp_access_registration.c index fbbc90a4a..90b8e9d0f 100644 --- a/lib/sbi/openapi/model/amf3_gpp_access_registration.c +++ b/lib/sbi/openapi/model/amf3_gpp_access_registration.c @@ -74,34 +74,81 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf3_gpp_access_registration) { return; } - OpenAPI_lnode_t *node; - ogs_free(amf3_gpp_access_registration->amf_instance_id); - ogs_free(amf3_gpp_access_registration->supported_features); - ogs_free(amf3_gpp_access_registration->pei); - ogs_free(amf3_gpp_access_registration->dereg_callback_uri); - ogs_free(amf3_gpp_access_registration->amf_service_name_dereg); - ogs_free(amf3_gpp_access_registration->pcscf_restoration_callback_uri); - ogs_free(amf3_gpp_access_registration->amf_service_name_pcscf_rest); - OpenAPI_guami_free(amf3_gpp_access_registration->guami); - OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, node) { - OpenAPI_backup_amf_info_free(node->data); + if (amf3_gpp_access_registration->amf_instance_id) { + ogs_free(amf3_gpp_access_registration->amf_instance_id); + amf3_gpp_access_registration->amf_instance_id = NULL; + } + if (amf3_gpp_access_registration->supported_features) { + ogs_free(amf3_gpp_access_registration->supported_features); + amf3_gpp_access_registration->supported_features = NULL; + } + if (amf3_gpp_access_registration->pei) { + ogs_free(amf3_gpp_access_registration->pei); + amf3_gpp_access_registration->pei = NULL; + } + if (amf3_gpp_access_registration->dereg_callback_uri) { + ogs_free(amf3_gpp_access_registration->dereg_callback_uri); + amf3_gpp_access_registration->dereg_callback_uri = NULL; + } + if (amf3_gpp_access_registration->amf_service_name_dereg) { + ogs_free(amf3_gpp_access_registration->amf_service_name_dereg); + amf3_gpp_access_registration->amf_service_name_dereg = NULL; + } + if (amf3_gpp_access_registration->pcscf_restoration_callback_uri) { + ogs_free(amf3_gpp_access_registration->pcscf_restoration_callback_uri); + amf3_gpp_access_registration->pcscf_restoration_callback_uri = NULL; + } + if (amf3_gpp_access_registration->amf_service_name_pcscf_rest) { + ogs_free(amf3_gpp_access_registration->amf_service_name_pcscf_rest); + amf3_gpp_access_registration->amf_service_name_pcscf_rest = NULL; + } + if (amf3_gpp_access_registration->guami) { + OpenAPI_guami_free(amf3_gpp_access_registration->guami); + amf3_gpp_access_registration->guami = NULL; + } + if (amf3_gpp_access_registration->backup_amf_info) { + OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(amf3_gpp_access_registration->backup_amf_info); + amf3_gpp_access_registration->backup_amf_info = NULL; + } + if (amf3_gpp_access_registration->amf_ee_subscription_id) { + ogs_free(amf3_gpp_access_registration->amf_ee_subscription_id); + amf3_gpp_access_registration->amf_ee_subscription_id = NULL; + } + if (amf3_gpp_access_registration->eps_interworking_info) { + OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration->eps_interworking_info); + amf3_gpp_access_registration->eps_interworking_info = NULL; + } + if (amf3_gpp_access_registration->registration_time) { + ogs_free(amf3_gpp_access_registration->registration_time); + amf3_gpp_access_registration->registration_time = NULL; + } + if (amf3_gpp_access_registration->vgmlc_address) { + OpenAPI_vgmlc_address_free(amf3_gpp_access_registration->vgmlc_address); + amf3_gpp_access_registration->vgmlc_address = NULL; + } + if (amf3_gpp_access_registration->context_info) { + OpenAPI_context_info_free(amf3_gpp_access_registration->context_info); + amf3_gpp_access_registration->context_info = NULL; + } + if (amf3_gpp_access_registration->supi) { + ogs_free(amf3_gpp_access_registration->supi); + amf3_gpp_access_registration->supi = NULL; } - OpenAPI_list_free(amf3_gpp_access_registration->backup_amf_info); - ogs_free(amf3_gpp_access_registration->amf_ee_subscription_id); - OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration->eps_interworking_info); - ogs_free(amf3_gpp_access_registration->registration_time); - OpenAPI_vgmlc_address_free(amf3_gpp_access_registration->vgmlc_address); - OpenAPI_context_info_free(amf3_gpp_access_registration->context_info); - ogs_free(amf3_gpp_access_registration->supi); ogs_free(amf3_gpp_access_registration); } cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf3_gpp_access_registration == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [Amf3GppAccessRegistration]"); @@ -109,6 +156,10 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces } item = cJSON_CreateObject(); + if (!amf3_gpp_access_registration->amf_instance_id) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "amfInstanceId", amf3_gpp_access_registration->amf_instance_id) == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_instance_id]"); goto end; @@ -135,13 +186,17 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces } } - if (amf3_gpp_access_registration->ims_vo_ps) { + if (amf3_gpp_access_registration->ims_vo_ps != OpenAPI_ims_vo_ps_NULL) { if (cJSON_AddStringToObject(item, "imsVoPs", OpenAPI_ims_vo_ps_ToString(amf3_gpp_access_registration->ims_vo_ps)) == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]"); goto end; } } + if (!amf3_gpp_access_registration->dereg_callback_uri) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "deregCallbackUri", amf3_gpp_access_registration->dereg_callback_uri) == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]"); goto end; @@ -175,6 +230,10 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces } } + if (!amf3_gpp_access_registration->guami) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [guami]"); + return NULL; + } cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf3_gpp_access_registration->guami); if (guami_local_JSON == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [guami]"); @@ -192,17 +251,13 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); goto end; } - - OpenAPI_lnode_t *backup_amf_info_node; - if (amf3_gpp_access_registration->backup_amf_info) { - OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, backup_amf_info_node) { - cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); - goto end; - } - cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); + goto end; } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); } } @@ -213,6 +268,10 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces } } + if (amf3_gpp_access_registration->rat_type == OpenAPI_rat_type_NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(amf3_gpp_access_registration->rat_type)) == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]"); goto end; @@ -306,28 +365,56 @@ end: OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_parseFromJSON(cJSON *amf3_gpp_access_registrationJSON) { OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration_local_var = NULL; - cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *amf_instance_id = NULL; + cJSON *supported_features = NULL; + cJSON *purge_flag = NULL; + cJSON *pei = NULL; + cJSON *ims_vo_ps = NULL; + OpenAPI_ims_vo_ps_e ims_vo_psVariable = 0; + cJSON *dereg_callback_uri = NULL; + cJSON *amf_service_name_dereg = NULL; + cJSON *pcscf_restoration_callback_uri = NULL; + cJSON *amf_service_name_pcscf_rest = NULL; + cJSON *initial_registration_ind = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *backup_amf_info = NULL; + OpenAPI_list_t *backup_amf_infoList = NULL; + cJSON *dr_flag = NULL; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *urrp_indicator = NULL; + cJSON *amf_ee_subscription_id = NULL; + cJSON *eps_interworking_info = NULL; + OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL; + cJSON *ue_srvcc_capability = NULL; + cJSON *registration_time = NULL; + cJSON *vgmlc_address = NULL; + OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL; + cJSON *context_info = NULL; + OpenAPI_context_info_t *context_info_local_nonprim = NULL; + cJSON *no_ee_subscription_ind = NULL; + cJSON *supi = NULL; + amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfInstanceId"); if (!amf_instance_id) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]"); goto end; } - if (!cJSON_IsString(amf_instance_id)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]"); goto end; } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "purgeFlag"); - + purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "purgeFlag"); if (purge_flag) { if (!cJSON_IsBool(purge_flag)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [purge_flag]"); @@ -335,18 +422,15 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [pei]"); goto end; } } - cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "imsVoPs"); - - OpenAPI_ims_vo_ps_e ims_vo_psVariable; + ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "imsVoPs"); if (ims_vo_ps) { if (!cJSON_IsString(ims_vo_ps)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ims_vo_ps]"); @@ -355,46 +439,41 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring); } - cJSON *dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "deregCallbackUri"); + dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "deregCallbackUri"); if (!dereg_callback_uri) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]"); goto end; } - if (!cJSON_IsString(dereg_callback_uri)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]"); goto end; } - cJSON *amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNameDereg"); - + amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNameDereg"); if (amf_service_name_dereg) { - if (!cJSON_IsString(amf_service_name_dereg)) { + if (!cJSON_IsString(amf_service_name_dereg) && !cJSON_IsNull(amf_service_name_dereg)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_service_name_dereg]"); goto end; } } - cJSON *pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri"); - + pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri"); if (pcscf_restoration_callback_uri) { - if (!cJSON_IsString(pcscf_restoration_callback_uri)) { + if (!cJSON_IsString(pcscf_restoration_callback_uri) && !cJSON_IsNull(pcscf_restoration_callback_uri)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]"); goto end; } } - cJSON *amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNamePcscfRest"); - + amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNamePcscfRest"); if (amf_service_name_pcscf_rest) { - if (!cJSON_IsString(amf_service_name_pcscf_rest)) { + if (!cJSON_IsString(amf_service_name_pcscf_rest) && !cJSON_IsNull(amf_service_name_pcscf_rest)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_service_name_pcscf_rest]"); goto end; } } - cJSON *initial_registration_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "initialRegistrationInd"); - + initial_registration_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "initialRegistrationInd"); if (initial_registration_ind) { if (!cJSON_IsBool(initial_registration_ind)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [initial_registration_ind]"); @@ -402,46 +481,39 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "guami"); + guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "guami"); if (!guami) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [guami]"); goto end; } - - OpenAPI_guami_t *guami_local_nonprim = NULL; guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); - cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "backupAmfInfo"); - - OpenAPI_list_t *backup_amf_infoList; + backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "backupAmfInfo"); if (backup_amf_info) { - cJSON *backup_amf_info_local_nonprimitive; - if (!cJSON_IsArray(backup_amf_info)){ - ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); - goto end; - } - - backup_amf_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { - if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + cJSON *backup_amf_info_local = NULL; + if (!cJSON_IsArray(backup_amf_info)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); goto end; } - OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); - if (!backup_amf_infoItem) { - ogs_error("No backup_amf_infoItem"); - OpenAPI_list_free(backup_amf_infoList); - goto end; + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) { + if (!cJSON_IsObject(backup_amf_info_local)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local); + if (!backup_amf_infoItem) { + ogs_error("No backup_amf_infoItem"); + OpenAPI_list_free(backup_amf_infoList); + goto end; + } + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); } - - OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); - } } - cJSON *dr_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "drFlag"); - + dr_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "drFlag"); if (dr_flag) { if (!cJSON_IsBool(dr_flag)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dr_flag]"); @@ -449,21 +521,18 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par } } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ratType"); + rat_type = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ratType"); if (!rat_type) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [rat_type]"); goto end; } - - OpenAPI_rat_type_e rat_typeVariable; if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [rat_type]"); goto end; } rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); - cJSON *urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "urrpIndicator"); - + urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "urrpIndicator"); if (urrp_indicator) { if (!cJSON_IsBool(urrp_indicator)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [urrp_indicator]"); @@ -471,24 +540,20 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par } } - cJSON *amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfEeSubscriptionId"); - + amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfEeSubscriptionId"); if (amf_ee_subscription_id) { - if (!cJSON_IsString(amf_ee_subscription_id)) { + if (!cJSON_IsString(amf_ee_subscription_id) && !cJSON_IsNull(amf_ee_subscription_id)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_ee_subscription_id]"); goto end; } } - cJSON *eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "epsInterworkingInfo"); - - OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL; + eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "epsInterworkingInfo"); if (eps_interworking_info) { eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info); } - cJSON *ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ueSrvccCapability"); - + ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ueSrvccCapability"); if (ue_srvcc_capability) { if (!cJSON_IsBool(ue_srvcc_capability)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ue_srvcc_capability]"); @@ -496,31 +561,25 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par } } - cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "registrationTime"); - + registration_time = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "registrationTime"); if (registration_time) { - if (!cJSON_IsString(registration_time)) { + if (!cJSON_IsString(registration_time) && !cJSON_IsNull(registration_time)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [registration_time]"); goto end; } } - cJSON *vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddress"); - - OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL; + vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddress"); if (vgmlc_address) { vgmlc_address_local_nonprim = OpenAPI_vgmlc_address_parseFromJSON(vgmlc_address); } - cJSON *context_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "contextInfo"); - - OpenAPI_context_info_t *context_info_local_nonprim = NULL; + context_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "contextInfo"); if (context_info) { context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info); } - cJSON *no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "noEeSubscriptionInd"); - + no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "noEeSubscriptionInd"); if (no_ee_subscription_ind) { if (!cJSON_IsBool(no_ee_subscription_ind)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [no_ee_subscription_ind]"); @@ -528,10 +587,9 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [supi]"); goto end; } @@ -539,15 +597,15 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par amf3_gpp_access_registration_local_var = OpenAPI_amf3_gpp_access_registration_create ( ogs_strdup(amf_instance_id->valuestring), - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, purge_flag ? true : false, purge_flag ? purge_flag->valueint : 0, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, ims_vo_ps ? ims_vo_psVariable : 0, ogs_strdup(dereg_callback_uri->valuestring), - amf_service_name_dereg ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL, - pcscf_restoration_callback_uri ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, - amf_service_name_pcscf_rest ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL, + amf_service_name_dereg && !cJSON_IsNull(amf_service_name_dereg) ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL, + pcscf_restoration_callback_uri && !cJSON_IsNull(pcscf_restoration_callback_uri) ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, + amf_service_name_pcscf_rest && !cJSON_IsNull(amf_service_name_pcscf_rest) ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL, initial_registration_ind ? true : false, initial_registration_ind ? initial_registration_ind->valueint : 0, guami_local_nonprim, @@ -557,20 +615,43 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par rat_typeVariable, urrp_indicator ? true : false, urrp_indicator ? urrp_indicator->valueint : 0, - amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL, + amf_ee_subscription_id && !cJSON_IsNull(amf_ee_subscription_id) ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL, eps_interworking_info ? eps_interworking_info_local_nonprim : NULL, ue_srvcc_capability ? true : false, ue_srvcc_capability ? ue_srvcc_capability->valueint : 0, - registration_time ? ogs_strdup(registration_time->valuestring) : NULL, + registration_time && !cJSON_IsNull(registration_time) ? ogs_strdup(registration_time->valuestring) : NULL, vgmlc_address ? vgmlc_address_local_nonprim : NULL, context_info ? context_info_local_nonprim : NULL, no_ee_subscription_ind ? true : false, no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0, - supi ? ogs_strdup(supi->valuestring) : NULL + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL ); return amf3_gpp_access_registration_local_var; end: + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (backup_amf_infoList) { + OpenAPI_list_for_each(backup_amf_infoList, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(backup_amf_infoList); + backup_amf_infoList = NULL; + } + if (eps_interworking_info_local_nonprim) { + OpenAPI_eps_interworking_info_free(eps_interworking_info_local_nonprim); + eps_interworking_info_local_nonprim = NULL; + } + if (vgmlc_address_local_nonprim) { + OpenAPI_vgmlc_address_free(vgmlc_address_local_nonprim); + vgmlc_address_local_nonprim = NULL; + } + if (context_info_local_nonprim) { + OpenAPI_context_info_free(context_info_local_nonprim); + context_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.c b/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.c index 6eb20f6be..740893e56 100644 --- a/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.c +++ b/lib/sbi/openapi/model/amf3_gpp_access_registration_modification.c @@ -34,23 +34,37 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg void OpenAPI_amf3_gpp_access_registration_modification_free(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf3_gpp_access_registration_modification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_guami_free(amf3_gpp_access_registration_modification->guami); - ogs_free(amf3_gpp_access_registration_modification->pei); - OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, node) { - OpenAPI_backup_amf_info_free(node->data); + if (amf3_gpp_access_registration_modification->guami) { + OpenAPI_guami_free(amf3_gpp_access_registration_modification->guami); + amf3_gpp_access_registration_modification->guami = NULL; + } + if (amf3_gpp_access_registration_modification->pei) { + ogs_free(amf3_gpp_access_registration_modification->pei); + amf3_gpp_access_registration_modification->pei = NULL; + } + if (amf3_gpp_access_registration_modification->backup_amf_info) { + OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(amf3_gpp_access_registration_modification->backup_amf_info); + amf3_gpp_access_registration_modification->backup_amf_info = NULL; + } + if (amf3_gpp_access_registration_modification->eps_interworking_info) { + OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration_modification->eps_interworking_info); + amf3_gpp_access_registration_modification->eps_interworking_info = NULL; } - OpenAPI_list_free(amf3_gpp_access_registration_modification->backup_amf_info); - OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration_modification->eps_interworking_info); ogs_free(amf3_gpp_access_registration_modification); } cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf3_gpp_access_registration_modification == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [Amf3GppAccessRegistrationModification]"); @@ -58,6 +72,10 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a } item = cJSON_CreateObject(); + if (!amf3_gpp_access_registration_modification->guami) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [guami]"); + return NULL; + } cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf3_gpp_access_registration_modification->guami); if (guami_local_JSON == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [guami]"); @@ -83,7 +101,7 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a } } - if (amf3_gpp_access_registration_modification->ims_vo_ps) { + if (amf3_gpp_access_registration_modification->ims_vo_ps != OpenAPI_ims_vo_ps_NULL) { if (cJSON_AddStringToObject(item, "imsVoPs", OpenAPI_ims_vo_ps_ToString(amf3_gpp_access_registration_modification->ims_vo_ps)) == NULL) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ims_vo_ps]"); goto end; @@ -96,17 +114,13 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); goto end; } - - OpenAPI_lnode_t *backup_amf_info_node; - if (amf3_gpp_access_registration_modification->backup_amf_info) { - OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, backup_amf_info_node) { - cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); - goto end; - } - cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); + goto end; } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); } } @@ -137,17 +151,26 @@ end: OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(cJSON *amf3_gpp_access_registration_modificationJSON) { OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification_local_var = NULL; - cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "guami"); + OpenAPI_lnode_t *node = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *purge_flag = NULL; + cJSON *pei = NULL; + cJSON *ims_vo_ps = NULL; + OpenAPI_ims_vo_ps_e ims_vo_psVariable = 0; + cJSON *backup_amf_info = NULL; + OpenAPI_list_t *backup_amf_infoList = NULL; + cJSON *eps_interworking_info = NULL; + OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL; + cJSON *ue_srvcc_capability = NULL; + guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "guami"); if (!guami) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [guami]"); goto end; } - - OpenAPI_guami_t *guami_local_nonprim = NULL; guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); - cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "purgeFlag"); - + purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "purgeFlag"); if (purge_flag) { if (!cJSON_IsBool(purge_flag)) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [purge_flag]"); @@ -155,18 +178,15 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [pei]"); goto end; } } - cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "imsVoPs"); - - OpenAPI_ims_vo_ps_e ims_vo_psVariable; + ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "imsVoPs"); if (ims_vo_ps) { if (!cJSON_IsString(ims_vo_ps)) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ims_vo_ps]"); @@ -175,44 +195,37 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring); } - cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "backupAmfInfo"); - - OpenAPI_list_t *backup_amf_infoList; + backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "backupAmfInfo"); if (backup_amf_info) { - cJSON *backup_amf_info_local_nonprimitive; - if (!cJSON_IsArray(backup_amf_info)){ - ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); - goto end; - } - - backup_amf_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { - if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + cJSON *backup_amf_info_local = NULL; + if (!cJSON_IsArray(backup_amf_info)) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); goto end; } - OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); - if (!backup_amf_infoItem) { - ogs_error("No backup_amf_infoItem"); - OpenAPI_list_free(backup_amf_infoList); - goto end; + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) { + if (!cJSON_IsObject(backup_amf_info_local)) { + ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local); + if (!backup_amf_infoItem) { + ogs_error("No backup_amf_infoItem"); + OpenAPI_list_free(backup_amf_infoList); + goto end; + } + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); } - - OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); - } } - cJSON *eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "epsInterworkingInfo"); - - OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL; + eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "epsInterworkingInfo"); if (eps_interworking_info) { eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info); } - cJSON *ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "ueSrvccCapability"); - + ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "ueSrvccCapability"); if (ue_srvcc_capability) { if (!cJSON_IsBool(ue_srvcc_capability)) { ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ue_srvcc_capability]"); @@ -224,7 +237,7 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg guami_local_nonprim, purge_flag ? true : false, purge_flag ? purge_flag->valueint : 0, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, ims_vo_ps ? ims_vo_psVariable : 0, backup_amf_info ? backup_amf_infoList : NULL, eps_interworking_info ? eps_interworking_info_local_nonprim : NULL, @@ -234,6 +247,21 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg return amf3_gpp_access_registration_modification_local_var; end: + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (backup_amf_infoList) { + OpenAPI_list_for_each(backup_amf_infoList, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(backup_amf_infoList); + backup_amf_infoList = NULL; + } + if (eps_interworking_info_local_nonprim) { + OpenAPI_eps_interworking_info_free(eps_interworking_info_local_nonprim); + eps_interworking_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_cond.c b/lib/sbi/openapi/model/amf_cond.c index 446e7e594..829e1eddc 100644 --- a/lib/sbi/openapi/model/amf_cond.c +++ b/lib/sbi/openapi/model/amf_cond.c @@ -20,18 +20,26 @@ OpenAPI_amf_cond_t *OpenAPI_amf_cond_create( void OpenAPI_amf_cond_free(OpenAPI_amf_cond_t *amf_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_cond) { return; } - OpenAPI_lnode_t *node; - ogs_free(amf_cond->amf_set_id); - ogs_free(amf_cond->amf_region_id); + if (amf_cond->amf_set_id) { + ogs_free(amf_cond->amf_set_id); + amf_cond->amf_set_id = NULL; + } + if (amf_cond->amf_region_id) { + ogs_free(amf_cond->amf_region_id); + amf_cond->amf_region_id = NULL; + } ogs_free(amf_cond); } cJSON *OpenAPI_amf_cond_convertToJSON(OpenAPI_amf_cond_t *amf_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_cond == NULL) { ogs_error("OpenAPI_amf_cond_convertToJSON() failed [AmfCond]"); @@ -60,27 +68,28 @@ end: OpenAPI_amf_cond_t *OpenAPI_amf_cond_parseFromJSON(cJSON *amf_condJSON) { OpenAPI_amf_cond_t *amf_cond_local_var = NULL; - cJSON *amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfSetId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *amf_set_id = NULL; + cJSON *amf_region_id = NULL; + amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfSetId"); if (amf_set_id) { - if (!cJSON_IsString(amf_set_id)) { + if (!cJSON_IsString(amf_set_id) && !cJSON_IsNull(amf_set_id)) { ogs_error("OpenAPI_amf_cond_parseFromJSON() failed [amf_set_id]"); goto end; } } - cJSON *amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfRegionId"); - + amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfRegionId"); if (amf_region_id) { - if (!cJSON_IsString(amf_region_id)) { + if (!cJSON_IsString(amf_region_id) && !cJSON_IsNull(amf_region_id)) { ogs_error("OpenAPI_amf_cond_parseFromJSON() failed [amf_region_id]"); goto end; } } amf_cond_local_var = OpenAPI_amf_cond_create ( - amf_set_id ? ogs_strdup(amf_set_id->valuestring) : NULL, - amf_region_id ? ogs_strdup(amf_region_id->valuestring) : NULL + amf_set_id && !cJSON_IsNull(amf_set_id) ? ogs_strdup(amf_set_id->valuestring) : NULL, + amf_region_id && !cJSON_IsNull(amf_region_id) ? ogs_strdup(amf_region_id->valuestring) : NULL ); return amf_cond_local_var; diff --git a/lib/sbi/openapi/model/amf_dereg_info.c b/lib/sbi/openapi/model/amf_dereg_info.c index 2ce1c94d0..a826a4ba2 100644 --- a/lib/sbi/openapi/model/amf_dereg_info.c +++ b/lib/sbi/openapi/model/amf_dereg_info.c @@ -18,16 +18,18 @@ OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_create( void OpenAPI_amf_dereg_info_free(OpenAPI_amf_dereg_info_t *amf_dereg_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_dereg_info) { return; } - OpenAPI_lnode_t *node; ogs_free(amf_dereg_info); } cJSON *OpenAPI_amf_dereg_info_convertToJSON(OpenAPI_amf_dereg_info_t *amf_dereg_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_dereg_info == NULL) { ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [AmfDeregInfo]"); @@ -35,6 +37,10 @@ cJSON *OpenAPI_amf_dereg_info_convertToJSON(OpenAPI_amf_dereg_info_t *amf_dereg_ } item = cJSON_CreateObject(); + if (amf_dereg_info->dereg_reason == OpenAPI_deregistration_reason_NULL) { + ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [dereg_reason]"); + return NULL; + } if (cJSON_AddStringToObject(item, "deregReason", OpenAPI_deregistration_reason_ToString(amf_dereg_info->dereg_reason)) == NULL) { ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [dereg_reason]"); goto end; @@ -47,13 +53,14 @@ end: OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_parseFromJSON(cJSON *amf_dereg_infoJSON) { OpenAPI_amf_dereg_info_t *amf_dereg_info_local_var = NULL; - cJSON *dereg_reason = cJSON_GetObjectItemCaseSensitive(amf_dereg_infoJSON, "deregReason"); + OpenAPI_lnode_t *node = NULL; + cJSON *dereg_reason = NULL; + OpenAPI_deregistration_reason_e dereg_reasonVariable = 0; + dereg_reason = cJSON_GetObjectItemCaseSensitive(amf_dereg_infoJSON, "deregReason"); if (!dereg_reason) { ogs_error("OpenAPI_amf_dereg_info_parseFromJSON() failed [dereg_reason]"); goto end; } - - OpenAPI_deregistration_reason_e dereg_reasonVariable; if (!cJSON_IsString(dereg_reason)) { ogs_error("OpenAPI_amf_dereg_info_parseFromJSON() failed [dereg_reason]"); goto end; diff --git a/lib/sbi/openapi/model/amf_event.c b/lib/sbi/openapi/model/amf_event.c index c93095e04..4dd3b5bbe 100644 --- a/lib/sbi/openapi/model/amf_event.c +++ b/lib/sbi/openapi/model/amf_event.c @@ -46,30 +46,47 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_create( void OpenAPI_amf_event_free(OpenAPI_amf_event_t *amf_event) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_event) { return; } - OpenAPI_lnode_t *node; - OpenAPI_amf_event_type_free(amf_event->type); - OpenAPI_list_for_each(amf_event->area_list, node) { - OpenAPI_amf_event_area_free(node->data); + if (amf_event->type) { + OpenAPI_amf_event_type_free(amf_event->type); + amf_event->type = NULL; } - OpenAPI_list_free(amf_event->area_list); - OpenAPI_list_for_each(amf_event->location_filter_list, node) { - OpenAPI_location_filter_free(node->data); + if (amf_event->area_list) { + OpenAPI_list_for_each(amf_event->area_list, node) { + OpenAPI_amf_event_area_free(node->data); + } + OpenAPI_list_free(amf_event->area_list); + amf_event->area_list = NULL; } - OpenAPI_list_free(amf_event->location_filter_list); - OpenAPI_list_for_each(amf_event->traffic_descriptor_list, node) { - OpenAPI_traffic_descriptor_free(node->data); + if (amf_event->location_filter_list) { + OpenAPI_list_for_each(amf_event->location_filter_list, node) { + OpenAPI_location_filter_free(node->data); + } + OpenAPI_list_free(amf_event->location_filter_list); + amf_event->location_filter_list = NULL; + } + if (amf_event->traffic_descriptor_list) { + OpenAPI_list_for_each(amf_event->traffic_descriptor_list, node) { + OpenAPI_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(amf_event->traffic_descriptor_list); + amf_event->traffic_descriptor_list = NULL; + } + if (amf_event->reachability_filter) { + OpenAPI_reachability_filter_free(amf_event->reachability_filter); + amf_event->reachability_filter = NULL; } - OpenAPI_list_free(amf_event->traffic_descriptor_list); - OpenAPI_reachability_filter_free(amf_event->reachability_filter); ogs_free(amf_event); } cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_event == NULL) { ogs_error("OpenAPI_amf_event_convertToJSON() failed [AmfEvent]"); @@ -77,6 +94,10 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event) } item = cJSON_CreateObject(); + if (!amf_event->type) { + ogs_error("OpenAPI_amf_event_convertToJSON() failed [type]"); + return NULL; + } cJSON *type_local_JSON = OpenAPI_amf_event_type_convertToJSON(amf_event->type); if (type_local_JSON == NULL) { ogs_error("OpenAPI_amf_event_convertToJSON() failed [type]"); @@ -101,17 +122,13 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event) ogs_error("OpenAPI_amf_event_convertToJSON() failed [area_list]"); goto end; } - - OpenAPI_lnode_t *area_list_node; - if (amf_event->area_list) { - OpenAPI_list_for_each(amf_event->area_list, area_list_node) { - cJSON *itemLocal = OpenAPI_amf_event_area_convertToJSON(area_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_event_convertToJSON() failed [area_list]"); - goto end; - } - cJSON_AddItemToArray(area_listList, itemLocal); + OpenAPI_list_for_each(amf_event->area_list, node) { + cJSON *itemLocal = OpenAPI_amf_event_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_event_convertToJSON() failed [area_list]"); + goto end; } + cJSON_AddItemToArray(area_listList, itemLocal); } } @@ -121,17 +138,13 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event) ogs_error("OpenAPI_amf_event_convertToJSON() failed [location_filter_list]"); goto end; } - - OpenAPI_lnode_t *location_filter_list_node; - if (amf_event->location_filter_list) { - OpenAPI_list_for_each(amf_event->location_filter_list, location_filter_list_node) { - cJSON *itemLocal = OpenAPI_location_filter_convertToJSON(location_filter_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_event_convertToJSON() failed [location_filter_list]"); - goto end; - } - cJSON_AddItemToArray(location_filter_listList, itemLocal); + OpenAPI_list_for_each(amf_event->location_filter_list, node) { + cJSON *itemLocal = OpenAPI_location_filter_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_event_convertToJSON() failed [location_filter_list]"); + goto end; } + cJSON_AddItemToArray(location_filter_listList, itemLocal); } } @@ -148,17 +161,13 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event) ogs_error("OpenAPI_amf_event_convertToJSON() failed [traffic_descriptor_list]"); goto end; } - - OpenAPI_lnode_t *traffic_descriptor_list_node; - if (amf_event->traffic_descriptor_list) { - OpenAPI_list_for_each(amf_event->traffic_descriptor_list, traffic_descriptor_list_node) { - cJSON *itemLocal = OpenAPI_traffic_descriptor_convertToJSON(traffic_descriptor_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_event_convertToJSON() failed [traffic_descriptor_list]"); - goto end; - } - cJSON_AddItemToArray(traffic_descriptor_listList, itemLocal); + OpenAPI_list_for_each(amf_event->traffic_descriptor_list, node) { + cJSON *itemLocal = OpenAPI_traffic_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_event_convertToJSON() failed [traffic_descriptor_list]"); + goto end; } + cJSON_AddItemToArray(traffic_descriptor_listList, itemLocal); } } @@ -203,17 +212,30 @@ end: OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON) { OpenAPI_amf_event_t *amf_event_local_var = NULL; - cJSON *type = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "type"); + OpenAPI_lnode_t *node = NULL; + cJSON *type = NULL; + OpenAPI_amf_event_type_t *type_local_nonprim = NULL; + cJSON *immediate_flag = NULL; + cJSON *area_list = NULL; + OpenAPI_list_t *area_listList = NULL; + cJSON *location_filter_list = NULL; + OpenAPI_list_t *location_filter_listList = NULL; + cJSON *ref_id = NULL; + cJSON *traffic_descriptor_list = NULL; + OpenAPI_list_t *traffic_descriptor_listList = NULL; + cJSON *report_ue_reachable = NULL; + cJSON *reachability_filter = NULL; + OpenAPI_reachability_filter_t *reachability_filter_local_nonprim = NULL; + cJSON *max_reports = NULL; + cJSON *max_response_time = NULL; + type = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "type"); if (!type) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [type]"); goto end; } - - OpenAPI_amf_event_type_t *type_local_nonprim = NULL; type_local_nonprim = OpenAPI_amf_event_type_parseFromJSON(type); - cJSON *immediate_flag = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "immediateFlag"); - + immediate_flag = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "immediateFlag"); if (immediate_flag) { if (!cJSON_IsBool(immediate_flag)) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [immediate_flag]"); @@ -221,66 +243,57 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON) } } - cJSON *area_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "areaList"); - - OpenAPI_list_t *area_listList; + area_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "areaList"); if (area_list) { - cJSON *area_list_local_nonprimitive; - if (!cJSON_IsArray(area_list)){ - ogs_error("OpenAPI_amf_event_parseFromJSON() failed [area_list]"); - goto end; - } - - area_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(area_list_local_nonprimitive, area_list ) { - if (!cJSON_IsObject(area_list_local_nonprimitive)) { + cJSON *area_list_local = NULL; + if (!cJSON_IsArray(area_list)) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [area_list]"); goto end; } - OpenAPI_amf_event_area_t *area_listItem = OpenAPI_amf_event_area_parseFromJSON(area_list_local_nonprimitive); - if (!area_listItem) { - ogs_error("No area_listItem"); - OpenAPI_list_free(area_listList); - goto end; + area_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(area_list_local, area_list) { + if (!cJSON_IsObject(area_list_local)) { + ogs_error("OpenAPI_amf_event_parseFromJSON() failed [area_list]"); + goto end; + } + OpenAPI_amf_event_area_t *area_listItem = OpenAPI_amf_event_area_parseFromJSON(area_list_local); + if (!area_listItem) { + ogs_error("No area_listItem"); + OpenAPI_list_free(area_listList); + goto end; + } + OpenAPI_list_add(area_listList, area_listItem); } - - OpenAPI_list_add(area_listList, area_listItem); - } } - cJSON *location_filter_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "locationFilterList"); - - OpenAPI_list_t *location_filter_listList; + location_filter_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "locationFilterList"); if (location_filter_list) { - cJSON *location_filter_list_local_nonprimitive; - if (!cJSON_IsArray(location_filter_list)){ - ogs_error("OpenAPI_amf_event_parseFromJSON() failed [location_filter_list]"); - goto end; - } - - location_filter_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(location_filter_list_local_nonprimitive, location_filter_list ) { - if (!cJSON_IsObject(location_filter_list_local_nonprimitive)) { + cJSON *location_filter_list_local = NULL; + if (!cJSON_IsArray(location_filter_list)) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [location_filter_list]"); goto end; } - OpenAPI_location_filter_t *location_filter_listItem = OpenAPI_location_filter_parseFromJSON(location_filter_list_local_nonprimitive); - if (!location_filter_listItem) { - ogs_error("No location_filter_listItem"); - OpenAPI_list_free(location_filter_listList); - goto end; + location_filter_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(location_filter_list_local, location_filter_list) { + if (!cJSON_IsObject(location_filter_list_local)) { + ogs_error("OpenAPI_amf_event_parseFromJSON() failed [location_filter_list]"); + goto end; + } + OpenAPI_location_filter_t *location_filter_listItem = OpenAPI_location_filter_parseFromJSON(location_filter_list_local); + if (!location_filter_listItem) { + ogs_error("No location_filter_listItem"); + OpenAPI_list_free(location_filter_listList); + goto end; + } + OpenAPI_list_add(location_filter_listList, location_filter_listItem); } - - OpenAPI_list_add(location_filter_listList, location_filter_listItem); - } } - cJSON *ref_id = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "refId"); - + ref_id = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "refId"); if (ref_id) { if (!cJSON_IsNumber(ref_id)) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [ref_id]"); @@ -288,37 +301,32 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON) } } - cJSON *traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "trafficDescriptorList"); - - OpenAPI_list_t *traffic_descriptor_listList; + traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "trafficDescriptorList"); if (traffic_descriptor_list) { - cJSON *traffic_descriptor_list_local_nonprimitive; - if (!cJSON_IsArray(traffic_descriptor_list)){ - ogs_error("OpenAPI_amf_event_parseFromJSON() failed [traffic_descriptor_list]"); - goto end; - } - - traffic_descriptor_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(traffic_descriptor_list_local_nonprimitive, traffic_descriptor_list ) { - if (!cJSON_IsObject(traffic_descriptor_list_local_nonprimitive)) { + cJSON *traffic_descriptor_list_local = NULL; + if (!cJSON_IsArray(traffic_descriptor_list)) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [traffic_descriptor_list]"); goto end; } - OpenAPI_traffic_descriptor_t *traffic_descriptor_listItem = OpenAPI_traffic_descriptor_parseFromJSON(traffic_descriptor_list_local_nonprimitive); - if (!traffic_descriptor_listItem) { - ogs_error("No traffic_descriptor_listItem"); - OpenAPI_list_free(traffic_descriptor_listList); - goto end; + traffic_descriptor_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_descriptor_list_local, traffic_descriptor_list) { + if (!cJSON_IsObject(traffic_descriptor_list_local)) { + ogs_error("OpenAPI_amf_event_parseFromJSON() failed [traffic_descriptor_list]"); + goto end; + } + OpenAPI_traffic_descriptor_t *traffic_descriptor_listItem = OpenAPI_traffic_descriptor_parseFromJSON(traffic_descriptor_list_local); + if (!traffic_descriptor_listItem) { + ogs_error("No traffic_descriptor_listItem"); + OpenAPI_list_free(traffic_descriptor_listList); + goto end; + } + OpenAPI_list_add(traffic_descriptor_listList, traffic_descriptor_listItem); } - - OpenAPI_list_add(traffic_descriptor_listList, traffic_descriptor_listItem); - } } - cJSON *report_ue_reachable = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "reportUeReachable"); - + report_ue_reachable = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "reportUeReachable"); if (report_ue_reachable) { if (!cJSON_IsBool(report_ue_reachable)) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [report_ue_reachable]"); @@ -326,15 +334,12 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON) } } - cJSON *reachability_filter = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "reachabilityFilter"); - - OpenAPI_reachability_filter_t *reachability_filter_local_nonprim = NULL; + reachability_filter = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "reachabilityFilter"); if (reachability_filter) { reachability_filter_local_nonprim = OpenAPI_reachability_filter_parseFromJSON(reachability_filter); } - cJSON *max_reports = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxReports"); - + max_reports = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxReports"); if (max_reports) { if (!cJSON_IsNumber(max_reports)) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [max_reports]"); @@ -342,8 +347,7 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON) } } - cJSON *max_response_time = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxResponseTime"); - + max_response_time = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxResponseTime"); if (max_response_time) { if (!cJSON_IsNumber(max_response_time)) { ogs_error("OpenAPI_amf_event_parseFromJSON() failed [max_response_time]"); @@ -371,6 +375,35 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON) return amf_event_local_var; end: + if (type_local_nonprim) { + OpenAPI_amf_event_type_free(type_local_nonprim); + type_local_nonprim = NULL; + } + if (area_listList) { + OpenAPI_list_for_each(area_listList, node) { + OpenAPI_amf_event_area_free(node->data); + } + OpenAPI_list_free(area_listList); + area_listList = NULL; + } + if (location_filter_listList) { + OpenAPI_list_for_each(location_filter_listList, node) { + OpenAPI_location_filter_free(node->data); + } + OpenAPI_list_free(location_filter_listList); + location_filter_listList = NULL; + } + if (traffic_descriptor_listList) { + OpenAPI_list_for_each(traffic_descriptor_listList, node) { + OpenAPI_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(traffic_descriptor_listList); + traffic_descriptor_listList = NULL; + } + if (reachability_filter_local_nonprim) { + OpenAPI_reachability_filter_free(reachability_filter_local_nonprim); + reachability_filter_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_event_area.c b/lib/sbi/openapi/model/amf_event_area.c index f6d920e6b..6f22d715a 100644 --- a/lib/sbi/openapi/model/amf_event_area.c +++ b/lib/sbi/openapi/model/amf_event_area.c @@ -24,20 +24,34 @@ OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_create( void OpenAPI_amf_event_area_free(OpenAPI_amf_event_area_t *amf_event_area) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_event_area) { return; } - OpenAPI_lnode_t *node; - OpenAPI_presence_info_free(amf_event_area->presence_info); - OpenAPI_ladn_info_free(amf_event_area->ladn_info); - OpenAPI_snssai_free(amf_event_area->s_nssai); - ogs_free(amf_event_area->nsi_id); + if (amf_event_area->presence_info) { + OpenAPI_presence_info_free(amf_event_area->presence_info); + amf_event_area->presence_info = NULL; + } + if (amf_event_area->ladn_info) { + OpenAPI_ladn_info_free(amf_event_area->ladn_info); + amf_event_area->ladn_info = NULL; + } + if (amf_event_area->s_nssai) { + OpenAPI_snssai_free(amf_event_area->s_nssai); + amf_event_area->s_nssai = NULL; + } + if (amf_event_area->nsi_id) { + ogs_free(amf_event_area->nsi_id); + amf_event_area->nsi_id = NULL; + } ogs_free(amf_event_area); } cJSON *OpenAPI_amf_event_area_convertToJSON(OpenAPI_amf_event_area_t *amf_event_area) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_event_area == NULL) { ogs_error("OpenAPI_amf_event_area_convertToJSON() failed [AmfEventArea]"); @@ -98,31 +112,32 @@ end: OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_parseFromJSON(cJSON *amf_event_areaJSON) { OpenAPI_amf_event_area_t *amf_event_area_local_var = NULL; - cJSON *presence_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "presenceInfo"); - + OpenAPI_lnode_t *node = NULL; + cJSON *presence_info = NULL; OpenAPI_presence_info_t *presence_info_local_nonprim = NULL; + cJSON *ladn_info = NULL; + OpenAPI_ladn_info_t *ladn_info_local_nonprim = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *nsi_id = NULL; + presence_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "presenceInfo"); if (presence_info) { presence_info_local_nonprim = OpenAPI_presence_info_parseFromJSON(presence_info); } - cJSON *ladn_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "ladnInfo"); - - OpenAPI_ladn_info_t *ladn_info_local_nonprim = NULL; + ladn_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "ladnInfo"); if (ladn_info) { ladn_info_local_nonprim = OpenAPI_ladn_info_parseFromJSON(ladn_info); } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "sNssai"); - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "sNssai"); if (s_nssai) { s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); } - cJSON *nsi_id = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "nsiId"); - + nsi_id = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "nsiId"); if (nsi_id) { - if (!cJSON_IsString(nsi_id)) { + if (!cJSON_IsString(nsi_id) && !cJSON_IsNull(nsi_id)) { ogs_error("OpenAPI_amf_event_area_parseFromJSON() failed [nsi_id]"); goto end; } @@ -132,11 +147,23 @@ OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_parseFromJSON(cJSON *amf_event_ presence_info ? presence_info_local_nonprim : NULL, ladn_info ? ladn_info_local_nonprim : NULL, s_nssai ? s_nssai_local_nonprim : NULL, - nsi_id ? ogs_strdup(nsi_id->valuestring) : NULL + nsi_id && !cJSON_IsNull(nsi_id) ? ogs_strdup(nsi_id->valuestring) : NULL ); return amf_event_area_local_var; end: + if (presence_info_local_nonprim) { + OpenAPI_presence_info_free(presence_info_local_nonprim); + presence_info_local_nonprim = NULL; + } + if (ladn_info_local_nonprim) { + OpenAPI_ladn_info_free(ladn_info_local_nonprim); + ladn_info_local_nonprim = NULL; + } + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_event_mode.c b/lib/sbi/openapi/model/amf_event_mode.c index 82877de62..03baff570 100644 --- a/lib/sbi/openapi/model/amf_event_mode.c +++ b/lib/sbi/openapi/model/amf_event_mode.c @@ -32,18 +32,26 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create( void OpenAPI_amf_event_mode_free(OpenAPI_amf_event_mode_t *amf_event_mode) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_event_mode) { return; } - OpenAPI_lnode_t *node; - OpenAPI_amf_event_trigger_free(amf_event_mode->trigger); - ogs_free(amf_event_mode->expiry); + if (amf_event_mode->trigger) { + OpenAPI_amf_event_trigger_free(amf_event_mode->trigger); + amf_event_mode->trigger = NULL; + } + if (amf_event_mode->expiry) { + ogs_free(amf_event_mode->expiry); + amf_event_mode->expiry = NULL; + } ogs_free(amf_event_mode); } cJSON *OpenAPI_amf_event_mode_convertToJSON(OpenAPI_amf_event_mode_t *amf_event_mode) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_event_mode == NULL) { ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [AmfEventMode]"); @@ -51,6 +59,10 @@ cJSON *OpenAPI_amf_event_mode_convertToJSON(OpenAPI_amf_event_mode_t *amf_event_ } item = cJSON_CreateObject(); + if (!amf_event_mode->trigger) { + ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [trigger]"); + return NULL; + } cJSON *trigger_local_JSON = OpenAPI_amf_event_trigger_convertToJSON(amf_event_mode->trigger); if (trigger_local_JSON == NULL) { ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [trigger]"); @@ -97,17 +109,21 @@ end: OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_modeJSON) { OpenAPI_amf_event_mode_t *amf_event_mode_local_var = NULL; - cJSON *trigger = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "trigger"); + OpenAPI_lnode_t *node = NULL; + cJSON *trigger = NULL; + OpenAPI_amf_event_trigger_t *trigger_local_nonprim = NULL; + cJSON *max_reports = NULL; + cJSON *expiry = NULL; + cJSON *rep_period = NULL; + cJSON *samp_ratio = NULL; + trigger = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "trigger"); if (!trigger) { ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [trigger]"); goto end; } - - OpenAPI_amf_event_trigger_t *trigger_local_nonprim = NULL; trigger_local_nonprim = OpenAPI_amf_event_trigger_parseFromJSON(trigger); - cJSON *max_reports = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "maxReports"); - + max_reports = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "maxReports"); if (max_reports) { if (!cJSON_IsNumber(max_reports)) { ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [max_reports]"); @@ -115,17 +131,15 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_ } } - cJSON *expiry = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "expiry"); - + expiry = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "expiry"); if (expiry) { - if (!cJSON_IsString(expiry)) { + if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) { ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [expiry]"); goto end; } } - cJSON *rep_period = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "repPeriod"); - + rep_period = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "repPeriod"); if (rep_period) { if (!cJSON_IsNumber(rep_period)) { ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [rep_period]"); @@ -133,8 +147,7 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_ } } - cJSON *samp_ratio = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "sampRatio"); - + samp_ratio = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "sampRatio"); if (samp_ratio) { if (!cJSON_IsNumber(samp_ratio)) { ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [samp_ratio]"); @@ -146,7 +159,7 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_ trigger_local_nonprim, max_reports ? true : false, max_reports ? max_reports->valuedouble : 0, - expiry ? ogs_strdup(expiry->valuestring) : NULL, + expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL, rep_period ? true : false, rep_period ? rep_period->valuedouble : 0, samp_ratio ? true : false, @@ -155,6 +168,10 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_ return amf_event_mode_local_var; end: + if (trigger_local_nonprim) { + OpenAPI_amf_event_trigger_free(trigger_local_nonprim); + trigger_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_event_subscription.c b/lib/sbi/openapi/model/amf_event_subscription.c index 78d516697..bbff57c62 100644 --- a/lib/sbi/openapi/model/amf_event_subscription.c +++ b/lib/sbi/openapi/model/amf_event_subscription.c @@ -44,30 +44,65 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_create( void OpenAPI_amf_event_subscription_free(OpenAPI_amf_event_subscription_t *amf_event_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_event_subscription) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(amf_event_subscription->event_list, node) { - OpenAPI_amf_event_free(node->data); + if (amf_event_subscription->event_list) { + OpenAPI_list_for_each(amf_event_subscription->event_list, node) { + OpenAPI_amf_event_free(node->data); + } + OpenAPI_list_free(amf_event_subscription->event_list); + amf_event_subscription->event_list = NULL; + } + if (amf_event_subscription->event_notify_uri) { + ogs_free(amf_event_subscription->event_notify_uri); + amf_event_subscription->event_notify_uri = NULL; + } + if (amf_event_subscription->notify_correlation_id) { + ogs_free(amf_event_subscription->notify_correlation_id); + amf_event_subscription->notify_correlation_id = NULL; + } + if (amf_event_subscription->nf_id) { + ogs_free(amf_event_subscription->nf_id); + amf_event_subscription->nf_id = NULL; + } + if (amf_event_subscription->subs_change_notify_uri) { + ogs_free(amf_event_subscription->subs_change_notify_uri); + amf_event_subscription->subs_change_notify_uri = NULL; + } + if (amf_event_subscription->subs_change_notify_correlation_id) { + ogs_free(amf_event_subscription->subs_change_notify_correlation_id); + amf_event_subscription->subs_change_notify_correlation_id = NULL; + } + if (amf_event_subscription->supi) { + ogs_free(amf_event_subscription->supi); + amf_event_subscription->supi = NULL; + } + if (amf_event_subscription->group_id) { + ogs_free(amf_event_subscription->group_id); + amf_event_subscription->group_id = NULL; + } + if (amf_event_subscription->gpsi) { + ogs_free(amf_event_subscription->gpsi); + amf_event_subscription->gpsi = NULL; + } + if (amf_event_subscription->pei) { + ogs_free(amf_event_subscription->pei); + amf_event_subscription->pei = NULL; + } + if (amf_event_subscription->options) { + OpenAPI_amf_event_mode_free(amf_event_subscription->options); + amf_event_subscription->options = NULL; } - OpenAPI_list_free(amf_event_subscription->event_list); - ogs_free(amf_event_subscription->event_notify_uri); - ogs_free(amf_event_subscription->notify_correlation_id); - ogs_free(amf_event_subscription->nf_id); - ogs_free(amf_event_subscription->subs_change_notify_uri); - ogs_free(amf_event_subscription->subs_change_notify_correlation_id); - ogs_free(amf_event_subscription->supi); - ogs_free(amf_event_subscription->group_id); - ogs_free(amf_event_subscription->gpsi); - ogs_free(amf_event_subscription->pei); - OpenAPI_amf_event_mode_free(amf_event_subscription->options); ogs_free(amf_event_subscription); } cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscription_t *amf_event_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_event_subscription == NULL) { ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [AmfEventSubscription]"); @@ -75,34 +110,46 @@ cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscripti } item = cJSON_CreateObject(); + if (!amf_event_subscription->event_list) { + ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]"); + return NULL; + } cJSON *event_listList = cJSON_AddArrayToObject(item, "eventList"); if (event_listList == NULL) { ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]"); goto end; } - - OpenAPI_lnode_t *event_list_node; - if (amf_event_subscription->event_list) { - OpenAPI_list_for_each(amf_event_subscription->event_list, event_list_node) { - cJSON *itemLocal = OpenAPI_amf_event_convertToJSON(event_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]"); - goto end; - } - cJSON_AddItemToArray(event_listList, itemLocal); + OpenAPI_list_for_each(amf_event_subscription->event_list, node) { + cJSON *itemLocal = OpenAPI_amf_event_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]"); + goto end; } + cJSON_AddItemToArray(event_listList, itemLocal); } + if (!amf_event_subscription->event_notify_uri) { + ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_notify_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "eventNotifyUri", amf_event_subscription->event_notify_uri) == NULL) { ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_notify_uri]"); goto end; } + if (!amf_event_subscription->notify_correlation_id) { + ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [notify_correlation_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notifyCorrelationId", amf_event_subscription->notify_correlation_id) == NULL) { ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [notify_correlation_id]"); goto end; } + if (!amf_event_subscription->nf_id) { + ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [nf_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfId", amf_event_subscription->nf_id) == NULL) { ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [nf_id]"); goto end; @@ -170,7 +217,7 @@ cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscripti } } - if (amf_event_subscription->source_nf_type) { + if (amf_event_subscription->source_nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "sourceNfType", OpenAPI_nf_type_ToString(amf_event_subscription->source_nf_type)) == NULL) { ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [source_nf_type]"); goto end; @@ -184,126 +231,129 @@ end: OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(cJSON *amf_event_subscriptionJSON) { OpenAPI_amf_event_subscription_t *amf_event_subscription_local_var = NULL; - cJSON *event_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventList"); + OpenAPI_lnode_t *node = NULL; + cJSON *event_list = NULL; + OpenAPI_list_t *event_listList = NULL; + cJSON *event_notify_uri = NULL; + cJSON *notify_correlation_id = NULL; + cJSON *nf_id = NULL; + cJSON *subs_change_notify_uri = NULL; + cJSON *subs_change_notify_correlation_id = NULL; + cJSON *supi = NULL; + cJSON *group_id = NULL; + cJSON *gpsi = NULL; + cJSON *pei = NULL; + cJSON *any_ue = NULL; + cJSON *options = NULL; + OpenAPI_amf_event_mode_t *options_local_nonprim = NULL; + cJSON *source_nf_type = NULL; + OpenAPI_nf_type_e source_nf_typeVariable = 0; + event_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventList"); if (!event_list) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]"); goto end; } - - OpenAPI_list_t *event_listList; - cJSON *event_list_local_nonprimitive; - if (!cJSON_IsArray(event_list)){ - ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]"); - goto end; - } - - event_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(event_list_local_nonprimitive, event_list ) { - if (!cJSON_IsObject(event_list_local_nonprimitive)) { + cJSON *event_list_local = NULL; + if (!cJSON_IsArray(event_list)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]"); goto end; } - OpenAPI_amf_event_t *event_listItem = OpenAPI_amf_event_parseFromJSON(event_list_local_nonprimitive); - if (!event_listItem) { - ogs_error("No event_listItem"); - OpenAPI_list_free(event_listList); - goto end; + event_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(event_list_local, event_list) { + if (!cJSON_IsObject(event_list_local)) { + ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]"); + goto end; + } + OpenAPI_amf_event_t *event_listItem = OpenAPI_amf_event_parseFromJSON(event_list_local); + if (!event_listItem) { + ogs_error("No event_listItem"); + OpenAPI_list_free(event_listList); + goto end; + } + OpenAPI_list_add(event_listList, event_listItem); } - OpenAPI_list_add(event_listList, event_listItem); - } - - cJSON *event_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventNotifyUri"); + event_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventNotifyUri"); if (!event_notify_uri) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_notify_uri]"); goto end; } - if (!cJSON_IsString(event_notify_uri)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_notify_uri]"); goto end; } - cJSON *notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "notifyCorrelationId"); + notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "notifyCorrelationId"); if (!notify_correlation_id) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [notify_correlation_id]"); goto end; } - if (!cJSON_IsString(notify_correlation_id)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [notify_correlation_id]"); goto end; } - cJSON *nf_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "nfId"); + nf_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "nfId"); if (!nf_id) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [nf_id]"); goto end; } - if (!cJSON_IsString(nf_id)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [nf_id]"); goto end; } - cJSON *subs_change_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyUri"); - + subs_change_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyUri"); if (subs_change_notify_uri) { - if (!cJSON_IsString(subs_change_notify_uri)) { + if (!cJSON_IsString(subs_change_notify_uri) && !cJSON_IsNull(subs_change_notify_uri)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [subs_change_notify_uri]"); goto end; } } - cJSON *subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyCorrelationId"); - + subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyCorrelationId"); if (subs_change_notify_correlation_id) { - if (!cJSON_IsString(subs_change_notify_correlation_id)) { + if (!cJSON_IsString(subs_change_notify_correlation_id) && !cJSON_IsNull(subs_change_notify_correlation_id)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [subs_change_notify_correlation_id]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [supi]"); goto end; } } - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "groupId"); - + group_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [pei]"); goto end; } } - cJSON *any_ue = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "anyUE"); - + any_ue = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "anyUE"); if (any_ue) { if (!cJSON_IsBool(any_ue)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [any_ue]"); @@ -311,16 +361,12 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c } } - cJSON *options = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "options"); - - OpenAPI_amf_event_mode_t *options_local_nonprim = NULL; + options = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "options"); if (options) { options_local_nonprim = OpenAPI_amf_event_mode_parseFromJSON(options); } - cJSON *source_nf_type = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "sourceNfType"); - - OpenAPI_nf_type_e source_nf_typeVariable; + source_nf_type = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "sourceNfType"); if (source_nf_type) { if (!cJSON_IsString(source_nf_type)) { ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [source_nf_type]"); @@ -334,12 +380,12 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c ogs_strdup(event_notify_uri->valuestring), ogs_strdup(notify_correlation_id->valuestring), ogs_strdup(nf_id->valuestring), - subs_change_notify_uri ? ogs_strdup(subs_change_notify_uri->valuestring) : NULL, - subs_change_notify_correlation_id ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL, - group_id ? ogs_strdup(group_id->valuestring) : NULL, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - pei ? ogs_strdup(pei->valuestring) : NULL, + subs_change_notify_uri && !cJSON_IsNull(subs_change_notify_uri) ? ogs_strdup(subs_change_notify_uri->valuestring) : NULL, + subs_change_notify_correlation_id && !cJSON_IsNull(subs_change_notify_correlation_id) ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, any_ue ? true : false, any_ue ? any_ue->valueint : 0, options ? options_local_nonprim : NULL, @@ -348,6 +394,17 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c return amf_event_subscription_local_var; end: + if (event_listList) { + OpenAPI_list_for_each(event_listList, node) { + OpenAPI_amf_event_free(node->data); + } + OpenAPI_list_free(event_listList); + event_listList = NULL; + } + if (options_local_nonprim) { + OpenAPI_amf_event_mode_free(options_local_nonprim); + options_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_event_subscription_add_info.c b/lib/sbi/openapi/model/amf_event_subscription_add_info.c index 7738569f9..b6301867f 100644 --- a/lib/sbi/openapi/model/amf_event_subscription_add_info.c +++ b/lib/sbi/openapi/model/amf_event_subscription_add_info.c @@ -20,20 +20,25 @@ OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_in void OpenAPI_amf_event_subscription_add_info_free(OpenAPI_amf_event_subscription_add_info_t *amf_event_subscription_add_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_event_subscription_add_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(amf_event_subscription_add_info->binding_info, node) { - ogs_free(node->data); + if (amf_event_subscription_add_info->binding_info) { + OpenAPI_list_for_each(amf_event_subscription_add_info->binding_info, node) { + ogs_free(node->data); + } + OpenAPI_list_free(amf_event_subscription_add_info->binding_info); + amf_event_subscription_add_info->binding_info = NULL; } - OpenAPI_list_free(amf_event_subscription_add_info->binding_info); ogs_free(amf_event_subscription_add_info); } cJSON *OpenAPI_amf_event_subscription_add_info_convertToJSON(OpenAPI_amf_event_subscription_add_info_t *amf_event_subscription_add_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_event_subscription_add_info == NULL) { ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [AmfEventSubscriptionAddInfo]"); @@ -42,22 +47,20 @@ cJSON *OpenAPI_amf_event_subscription_add_info_convertToJSON(OpenAPI_amf_event_s item = cJSON_CreateObject(); if (amf_event_subscription_add_info->binding_info) { - cJSON *binding_info = cJSON_AddArrayToObject(item, "bindingInfo"); - if (binding_info == NULL) { + cJSON *binding_infoList = cJSON_AddArrayToObject(item, "bindingInfo"); + if (binding_infoList == NULL) { ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [binding_info]"); goto end; } - - OpenAPI_lnode_t *binding_info_node; - OpenAPI_list_for_each(amf_event_subscription_add_info->binding_info, binding_info_node) { - if (cJSON_AddStringToObject(binding_info, "", (char*)binding_info_node->data) == NULL) { - ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [binding_info]"); - goto end; + OpenAPI_list_for_each(amf_event_subscription_add_info->binding_info, node) { + if (cJSON_AddStringToObject(binding_infoList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [binding_info]"); + goto end; + } } - } } - if (amf_event_subscription_add_info->subscribing_nf_type) { + if (amf_event_subscription_add_info->subscribing_nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "subscribingNfType", OpenAPI_nf_type_ToString(amf_event_subscription_add_info->subscribing_nf_type)) == NULL) { ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [subscribing_nf_type]"); goto end; @@ -71,29 +74,33 @@ end: OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_info_parseFromJSON(cJSON *amf_event_subscription_add_infoJSON) { OpenAPI_amf_event_subscription_add_info_t *amf_event_subscription_add_info_local_var = NULL; - cJSON *binding_info = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "bindingInfo"); - - OpenAPI_list_t *binding_infoList; + OpenAPI_lnode_t *node = NULL; + cJSON *binding_info = NULL; + OpenAPI_list_t *binding_infoList = NULL; + cJSON *subscribing_nf_type = NULL; + OpenAPI_nf_type_e subscribing_nf_typeVariable = 0; + binding_info = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "bindingInfo"); if (binding_info) { - cJSON *binding_info_local; - if (!cJSON_IsArray(binding_info)) { - ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [binding_info]"); - goto end; - } - binding_infoList = OpenAPI_list_create(); + cJSON *binding_info_local = NULL; + if (!cJSON_IsArray(binding_info)) { + ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [binding_info]"); + goto end; + } - cJSON_ArrayForEach(binding_info_local, binding_info) { - if (!cJSON_IsString(binding_info_local)) { - ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [binding_info]"); - goto end; - } - OpenAPI_list_add(binding_infoList, ogs_strdup(binding_info_local->valuestring)); - } + binding_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(binding_info_local, binding_info) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(binding_info_local)) { + ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [binding_info]"); + goto end; + } + OpenAPI_list_add(binding_infoList, ogs_strdup(binding_info_local->valuestring)); + } } - cJSON *subscribing_nf_type = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "subscribingNfType"); - - OpenAPI_nf_type_e subscribing_nf_typeVariable; + subscribing_nf_type = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "subscribingNfType"); if (subscribing_nf_type) { if (!cJSON_IsString(subscribing_nf_type)) { ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [subscribing_nf_type]"); @@ -109,6 +116,13 @@ OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_in return amf_event_subscription_add_info_local_var; end: + if (binding_infoList) { + OpenAPI_list_for_each(binding_infoList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(binding_infoList); + binding_infoList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_event_trigger.c b/lib/sbi/openapi/model/amf_event_trigger.c index d6030181e..71158fe00 100644 --- a/lib/sbi/openapi/model/amf_event_trigger.c +++ b/lib/sbi/openapi/model/amf_event_trigger.c @@ -16,16 +16,18 @@ OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_create( void OpenAPI_amf_event_trigger_free(OpenAPI_amf_event_trigger_t *amf_event_trigger) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_event_trigger) { return; } - OpenAPI_lnode_t *node; ogs_free(amf_event_trigger); } cJSON *OpenAPI_amf_event_trigger_convertToJSON(OpenAPI_amf_event_trigger_t *amf_event_trigger) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_event_trigger == NULL) { ogs_error("OpenAPI_amf_event_trigger_convertToJSON() failed [AmfEventTrigger]"); @@ -40,6 +42,7 @@ end: OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_parseFromJSON(cJSON *amf_event_triggerJSON) { OpenAPI_amf_event_trigger_t *amf_event_trigger_local_var = NULL; + OpenAPI_lnode_t *node = NULL; amf_event_trigger_local_var = OpenAPI_amf_event_trigger_create ( ); diff --git a/lib/sbi/openapi/model/amf_event_type.c b/lib/sbi/openapi/model/amf_event_type.c index 3c6e0b39a..e0d5c0bf9 100644 --- a/lib/sbi/openapi/model/amf_event_type.c +++ b/lib/sbi/openapi/model/amf_event_type.c @@ -16,16 +16,18 @@ OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_create( void OpenAPI_amf_event_type_free(OpenAPI_amf_event_type_t *amf_event_type) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_event_type) { return; } - OpenAPI_lnode_t *node; ogs_free(amf_event_type); } cJSON *OpenAPI_amf_event_type_convertToJSON(OpenAPI_amf_event_type_t *amf_event_type) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_event_type == NULL) { ogs_error("OpenAPI_amf_event_type_convertToJSON() failed [AmfEventType]"); @@ -40,6 +42,7 @@ end: OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_parseFromJSON(cJSON *amf_event_typeJSON) { OpenAPI_amf_event_type_t *amf_event_type_local_var = NULL; + OpenAPI_lnode_t *node = NULL; amf_event_type_local_var = OpenAPI_amf_event_type_create ( ); diff --git a/lib/sbi/openapi/model/amf_event_type_any_of.c b/lib/sbi/openapi/model/amf_event_type_any_of.c index 737552a00..d93e9fe8d 100644 --- a/lib/sbi/openapi/model/amf_event_type_any_of.c +++ b/lib/sbi/openapi/model/amf_event_type_any_of.c @@ -6,7 +6,7 @@ char* OpenAPI_amf_event_type_any_of_ToString(OpenAPI_amf_event_type_any_of_e amf_event_type_any_of) { - const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "_5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" }; + const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" }; size_t sizeofArray = sizeof(amf_event_type_any_ofArray) / sizeof(amf_event_type_any_ofArray[0]); if (amf_event_type_any_of < sizeofArray) return (char *)amf_event_type_any_ofArray[amf_event_type_any_of]; @@ -17,7 +17,7 @@ char* OpenAPI_amf_event_type_any_of_ToString(OpenAPI_amf_event_type_any_of_e amf OpenAPI_amf_event_type_any_of_e OpenAPI_amf_event_type_any_of_FromString(char* amf_event_type_any_of) { int stringToReturn = 0; - const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "_5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" }; + const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" }; size_t sizeofArray = sizeof(amf_event_type_any_ofArray) / sizeof(amf_event_type_any_ofArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(amf_event_type_any_of, amf_event_type_any_ofArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/amf_info.c b/lib/sbi/openapi/model/amf_info.c index 19a652bf5..bccf38c3b 100644 --- a/lib/sbi/openapi/model/amf_info.c +++ b/lib/sbi/openapi/model/amf_info.c @@ -32,39 +32,65 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_create( void OpenAPI_amf_info_free(OpenAPI_amf_info_t *amf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(amf_info->amf_set_id); - ogs_free(amf_info->amf_region_id); - OpenAPI_list_for_each(amf_info->guami_list, node) { - OpenAPI_guami_free(node->data); + if (amf_info->amf_set_id) { + ogs_free(amf_info->amf_set_id); + amf_info->amf_set_id = NULL; } - OpenAPI_list_free(amf_info->guami_list); - OpenAPI_list_for_each(amf_info->tai_list, node) { - OpenAPI_tai_free(node->data); + if (amf_info->amf_region_id) { + ogs_free(amf_info->amf_region_id); + amf_info->amf_region_id = NULL; } - OpenAPI_list_free(amf_info->tai_list); - OpenAPI_list_for_each(amf_info->tai_range_list, node) { - OpenAPI_tai_range_free(node->data); + if (amf_info->guami_list) { + OpenAPI_list_for_each(amf_info->guami_list, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(amf_info->guami_list); + amf_info->guami_list = NULL; } - OpenAPI_list_free(amf_info->tai_range_list); - OpenAPI_list_for_each(amf_info->backup_info_amf_failure, node) { - OpenAPI_guami_free(node->data); + if (amf_info->tai_list) { + OpenAPI_list_for_each(amf_info->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(amf_info->tai_list); + amf_info->tai_list = NULL; } - OpenAPI_list_free(amf_info->backup_info_amf_failure); - OpenAPI_list_for_each(amf_info->backup_info_amf_removal, node) { - OpenAPI_guami_free(node->data); + if (amf_info->tai_range_list) { + OpenAPI_list_for_each(amf_info->tai_range_list, node) { + OpenAPI_tai_range_free(node->data); + } + OpenAPI_list_free(amf_info->tai_range_list); + amf_info->tai_range_list = NULL; + } + if (amf_info->backup_info_amf_failure) { + OpenAPI_list_for_each(amf_info->backup_info_amf_failure, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(amf_info->backup_info_amf_failure); + amf_info->backup_info_amf_failure = NULL; + } + if (amf_info->backup_info_amf_removal) { + OpenAPI_list_for_each(amf_info->backup_info_amf_removal, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(amf_info->backup_info_amf_removal); + amf_info->backup_info_amf_removal = NULL; + } + if (amf_info->n2_interface_amf_info) { + OpenAPI_n2_interface_amf_info_free(amf_info->n2_interface_amf_info); + amf_info->n2_interface_amf_info = NULL; } - OpenAPI_list_free(amf_info->backup_info_amf_removal); - OpenAPI_n2_interface_amf_info_free(amf_info->n2_interface_amf_info); ogs_free(amf_info); } cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_info == NULL) { ogs_error("OpenAPI_amf_info_convertToJSON() failed [AmfInfo]"); @@ -72,32 +98,40 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info) } item = cJSON_CreateObject(); + if (!amf_info->amf_set_id) { + ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_set_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "amfSetId", amf_info->amf_set_id) == NULL) { ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_set_id]"); goto end; } + if (!amf_info->amf_region_id) { + ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_region_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "amfRegionId", amf_info->amf_region_id) == NULL) { ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_region_id]"); goto end; } + if (!amf_info->guami_list) { + ogs_error("OpenAPI_amf_info_convertToJSON() failed [guami_list]"); + return NULL; + } cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList"); if (guami_listList == NULL) { ogs_error("OpenAPI_amf_info_convertToJSON() failed [guami_list]"); goto end; } - - OpenAPI_lnode_t *guami_list_node; - if (amf_info->guami_list) { - OpenAPI_list_for_each(amf_info->guami_list, guami_list_node) { - cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_info_convertToJSON() failed [guami_list]"); - goto end; - } - cJSON_AddItemToArray(guami_listList, itemLocal); + OpenAPI_list_for_each(amf_info->guami_list, node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_info_convertToJSON() failed [guami_list]"); + goto end; } + cJSON_AddItemToArray(guami_listList, itemLocal); } if (amf_info->tai_list) { @@ -106,17 +140,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info) ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (amf_info->tai_list) { - OpenAPI_list_for_each(amf_info->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(amf_info->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } } @@ -126,17 +156,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info) ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_range_list]"); goto end; } - - OpenAPI_lnode_t *tai_range_list_node; - if (amf_info->tai_range_list) { - OpenAPI_list_for_each(amf_info->tai_range_list, tai_range_list_node) { - cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(tai_range_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_range_list]"); - goto end; - } - cJSON_AddItemToArray(tai_range_listList, itemLocal); + OpenAPI_list_for_each(amf_info->tai_range_list, node) { + cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_range_list]"); + goto end; } + cJSON_AddItemToArray(tai_range_listList, itemLocal); } } @@ -146,17 +172,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info) ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_failure]"); goto end; } - - OpenAPI_lnode_t *backup_info_amf_failure_node; - if (amf_info->backup_info_amf_failure) { - OpenAPI_list_for_each(amf_info->backup_info_amf_failure, backup_info_amf_failure_node) { - cJSON *itemLocal = OpenAPI_guami_convertToJSON(backup_info_amf_failure_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_failure]"); - goto end; - } - cJSON_AddItemToArray(backup_info_amf_failureList, itemLocal); + OpenAPI_list_for_each(amf_info->backup_info_amf_failure, node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_failure]"); + goto end; } + cJSON_AddItemToArray(backup_info_amf_failureList, itemLocal); } } @@ -166,17 +188,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info) ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_removal]"); goto end; } - - OpenAPI_lnode_t *backup_info_amf_removal_node; - if (amf_info->backup_info_amf_removal) { - OpenAPI_list_for_each(amf_info->backup_info_amf_removal, backup_info_amf_removal_node) { - cJSON *itemLocal = OpenAPI_guami_convertToJSON(backup_info_amf_removal_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_removal]"); - goto end; - } - cJSON_AddItemToArray(backup_info_amf_removalList, itemLocal); + OpenAPI_list_for_each(amf_info->backup_info_amf_removal, node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_removal]"); + goto end; } + cJSON_AddItemToArray(backup_info_amf_removalList, itemLocal); } } @@ -200,178 +218,169 @@ end: OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON) { OpenAPI_amf_info_t *amf_info_local_var = NULL; - cJSON *amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfSetId"); + OpenAPI_lnode_t *node = NULL; + cJSON *amf_set_id = NULL; + cJSON *amf_region_id = NULL; + cJSON *guami_list = NULL; + OpenAPI_list_t *guami_listList = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + cJSON *tai_range_list = NULL; + OpenAPI_list_t *tai_range_listList = NULL; + cJSON *backup_info_amf_failure = NULL; + OpenAPI_list_t *backup_info_amf_failureList = NULL; + cJSON *backup_info_amf_removal = NULL; + OpenAPI_list_t *backup_info_amf_removalList = NULL; + cJSON *n2_interface_amf_info = NULL; + OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info_local_nonprim = NULL; + amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfSetId"); if (!amf_set_id) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_set_id]"); goto end; } - if (!cJSON_IsString(amf_set_id)) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_set_id]"); goto end; } - cJSON *amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfRegionId"); + amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfRegionId"); if (!amf_region_id) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_region_id]"); goto end; } - if (!cJSON_IsString(amf_region_id)) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_region_id]"); goto end; } - cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "guamiList"); + guami_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "guamiList"); if (!guami_list) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [guami_list]"); goto end; } - - OpenAPI_list_t *guami_listList; - cJSON *guami_list_local_nonprimitive; - if (!cJSON_IsArray(guami_list)){ - ogs_error("OpenAPI_amf_info_parseFromJSON() failed [guami_list]"); - goto end; - } - - guami_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) { - if (!cJSON_IsObject(guami_list_local_nonprimitive)) { + cJSON *guami_list_local = NULL; + if (!cJSON_IsArray(guami_list)) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [guami_list]"); goto end; } - OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive); - if (!guami_listItem) { - ogs_error("No guami_listItem"); - OpenAPI_list_free(guami_listList); - goto end; + guami_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(guami_list_local, guami_list) { + if (!cJSON_IsObject(guami_list_local)) { + ogs_error("OpenAPI_amf_info_parseFromJSON() failed [guami_list]"); + goto end; + } + OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local); + if (!guami_listItem) { + ogs_error("No guami_listItem"); + OpenAPI_list_free(guami_listList); + goto end; + } + OpenAPI_list_add(guami_listList, guami_listItem); } - OpenAPI_list_add(guami_listList, guami_listItem); - } - - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "taiList"); - - OpenAPI_list_t *tai_listList; + tai_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "taiList"); if (tai_list) { - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - - OpenAPI_list_add(tai_listList, tai_listItem); - } } - cJSON *tai_range_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "taiRangeList"); - - OpenAPI_list_t *tai_range_listList; + tai_range_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "taiRangeList"); if (tai_range_list) { - cJSON *tai_range_list_local_nonprimitive; - if (!cJSON_IsArray(tai_range_list)){ - ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_range_list]"); - goto end; - } - - tai_range_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_range_list_local_nonprimitive, tai_range_list ) { - if (!cJSON_IsObject(tai_range_list_local_nonprimitive)) { + cJSON *tai_range_list_local = NULL; + if (!cJSON_IsArray(tai_range_list)) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_range_list]"); goto end; } - OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local_nonprimitive); - if (!tai_range_listItem) { - ogs_error("No tai_range_listItem"); - OpenAPI_list_free(tai_range_listList); - goto end; + tai_range_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_range_list_local, tai_range_list) { + if (!cJSON_IsObject(tai_range_list_local)) { + ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_range_list]"); + goto end; + } + OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local); + if (!tai_range_listItem) { + ogs_error("No tai_range_listItem"); + OpenAPI_list_free(tai_range_listList); + goto end; + } + OpenAPI_list_add(tai_range_listList, tai_range_listItem); } - - OpenAPI_list_add(tai_range_listList, tai_range_listItem); - } } - cJSON *backup_info_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "backupInfoAmfFailure"); - - OpenAPI_list_t *backup_info_amf_failureList; + backup_info_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "backupInfoAmfFailure"); if (backup_info_amf_failure) { - cJSON *backup_info_amf_failure_local_nonprimitive; - if (!cJSON_IsArray(backup_info_amf_failure)){ - ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_failure]"); - goto end; - } - - backup_info_amf_failureList = OpenAPI_list_create(); - - cJSON_ArrayForEach(backup_info_amf_failure_local_nonprimitive, backup_info_amf_failure ) { - if (!cJSON_IsObject(backup_info_amf_failure_local_nonprimitive)) { + cJSON *backup_info_amf_failure_local = NULL; + if (!cJSON_IsArray(backup_info_amf_failure)) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_failure]"); goto end; } - OpenAPI_guami_t *backup_info_amf_failureItem = OpenAPI_guami_parseFromJSON(backup_info_amf_failure_local_nonprimitive); - if (!backup_info_amf_failureItem) { - ogs_error("No backup_info_amf_failureItem"); - OpenAPI_list_free(backup_info_amf_failureList); - goto end; + backup_info_amf_failureList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_info_amf_failure_local, backup_info_amf_failure) { + if (!cJSON_IsObject(backup_info_amf_failure_local)) { + ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_failure]"); + goto end; + } + OpenAPI_guami_t *backup_info_amf_failureItem = OpenAPI_guami_parseFromJSON(backup_info_amf_failure_local); + if (!backup_info_amf_failureItem) { + ogs_error("No backup_info_amf_failureItem"); + OpenAPI_list_free(backup_info_amf_failureList); + goto end; + } + OpenAPI_list_add(backup_info_amf_failureList, backup_info_amf_failureItem); } - - OpenAPI_list_add(backup_info_amf_failureList, backup_info_amf_failureItem); - } } - cJSON *backup_info_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "backupInfoAmfRemoval"); - - OpenAPI_list_t *backup_info_amf_removalList; + backup_info_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "backupInfoAmfRemoval"); if (backup_info_amf_removal) { - cJSON *backup_info_amf_removal_local_nonprimitive; - if (!cJSON_IsArray(backup_info_amf_removal)){ - ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_removal]"); - goto end; - } - - backup_info_amf_removalList = OpenAPI_list_create(); - - cJSON_ArrayForEach(backup_info_amf_removal_local_nonprimitive, backup_info_amf_removal ) { - if (!cJSON_IsObject(backup_info_amf_removal_local_nonprimitive)) { + cJSON *backup_info_amf_removal_local = NULL; + if (!cJSON_IsArray(backup_info_amf_removal)) { ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_removal]"); goto end; } - OpenAPI_guami_t *backup_info_amf_removalItem = OpenAPI_guami_parseFromJSON(backup_info_amf_removal_local_nonprimitive); - if (!backup_info_amf_removalItem) { - ogs_error("No backup_info_amf_removalItem"); - OpenAPI_list_free(backup_info_amf_removalList); - goto end; + backup_info_amf_removalList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_info_amf_removal_local, backup_info_amf_removal) { + if (!cJSON_IsObject(backup_info_amf_removal_local)) { + ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_removal]"); + goto end; + } + OpenAPI_guami_t *backup_info_amf_removalItem = OpenAPI_guami_parseFromJSON(backup_info_amf_removal_local); + if (!backup_info_amf_removalItem) { + ogs_error("No backup_info_amf_removalItem"); + OpenAPI_list_free(backup_info_amf_removalList); + goto end; + } + OpenAPI_list_add(backup_info_amf_removalList, backup_info_amf_removalItem); } - - OpenAPI_list_add(backup_info_amf_removalList, backup_info_amf_removalItem); - } } - cJSON *n2_interface_amf_info = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "n2InterfaceAmfInfo"); - - OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info_local_nonprim = NULL; + n2_interface_amf_info = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "n2InterfaceAmfInfo"); if (n2_interface_amf_info) { n2_interface_amf_info_local_nonprim = OpenAPI_n2_interface_amf_info_parseFromJSON(n2_interface_amf_info); } @@ -389,6 +398,45 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON) return amf_info_local_var; end: + if (guami_listList) { + OpenAPI_list_for_each(guami_listList, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(guami_listList); + guami_listList = NULL; + } + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } + if (tai_range_listList) { + OpenAPI_list_for_each(tai_range_listList, node) { + OpenAPI_tai_range_free(node->data); + } + OpenAPI_list_free(tai_range_listList); + tai_range_listList = NULL; + } + if (backup_info_amf_failureList) { + OpenAPI_list_for_each(backup_info_amf_failureList, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(backup_info_amf_failureList); + backup_info_amf_failureList = NULL; + } + if (backup_info_amf_removalList) { + OpenAPI_list_for_each(backup_info_amf_removalList, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(backup_info_amf_removalList); + backup_info_amf_removalList = NULL; + } + if (n2_interface_amf_info_local_nonprim) { + OpenAPI_n2_interface_amf_info_free(n2_interface_amf_info_local_nonprim); + n2_interface_amf_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_non3_gpp_access_registration.c b/lib/sbi/openapi/model/amf_non3_gpp_access_registration.c index d4a0b766d..25c2c0d23 100644 --- a/lib/sbi/openapi/model/amf_non3_gpp_access_registration.c +++ b/lib/sbi/openapi/model/amf_non3_gpp_access_registration.c @@ -60,33 +60,77 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_non3_gpp_access_registration) { return; } - OpenAPI_lnode_t *node; - ogs_free(amf_non3_gpp_access_registration->amf_instance_id); - ogs_free(amf_non3_gpp_access_registration->supported_features); - ogs_free(amf_non3_gpp_access_registration->pei); - ogs_free(amf_non3_gpp_access_registration->dereg_callback_uri); - ogs_free(amf_non3_gpp_access_registration->amf_service_name_dereg); - ogs_free(amf_non3_gpp_access_registration->pcscf_restoration_callback_uri); - ogs_free(amf_non3_gpp_access_registration->amf_service_name_pcscf_rest); - OpenAPI_guami_free(amf_non3_gpp_access_registration->guami); - OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, node) { - OpenAPI_backup_amf_info_free(node->data); + if (amf_non3_gpp_access_registration->amf_instance_id) { + ogs_free(amf_non3_gpp_access_registration->amf_instance_id); + amf_non3_gpp_access_registration->amf_instance_id = NULL; + } + if (amf_non3_gpp_access_registration->supported_features) { + ogs_free(amf_non3_gpp_access_registration->supported_features); + amf_non3_gpp_access_registration->supported_features = NULL; + } + if (amf_non3_gpp_access_registration->pei) { + ogs_free(amf_non3_gpp_access_registration->pei); + amf_non3_gpp_access_registration->pei = NULL; + } + if (amf_non3_gpp_access_registration->dereg_callback_uri) { + ogs_free(amf_non3_gpp_access_registration->dereg_callback_uri); + amf_non3_gpp_access_registration->dereg_callback_uri = NULL; + } + if (amf_non3_gpp_access_registration->amf_service_name_dereg) { + ogs_free(amf_non3_gpp_access_registration->amf_service_name_dereg); + amf_non3_gpp_access_registration->amf_service_name_dereg = NULL; + } + if (amf_non3_gpp_access_registration->pcscf_restoration_callback_uri) { + ogs_free(amf_non3_gpp_access_registration->pcscf_restoration_callback_uri); + amf_non3_gpp_access_registration->pcscf_restoration_callback_uri = NULL; + } + if (amf_non3_gpp_access_registration->amf_service_name_pcscf_rest) { + ogs_free(amf_non3_gpp_access_registration->amf_service_name_pcscf_rest); + amf_non3_gpp_access_registration->amf_service_name_pcscf_rest = NULL; + } + if (amf_non3_gpp_access_registration->guami) { + OpenAPI_guami_free(amf_non3_gpp_access_registration->guami); + amf_non3_gpp_access_registration->guami = NULL; + } + if (amf_non3_gpp_access_registration->backup_amf_info) { + OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(amf_non3_gpp_access_registration->backup_amf_info); + amf_non3_gpp_access_registration->backup_amf_info = NULL; + } + if (amf_non3_gpp_access_registration->amf_ee_subscription_id) { + ogs_free(amf_non3_gpp_access_registration->amf_ee_subscription_id); + amf_non3_gpp_access_registration->amf_ee_subscription_id = NULL; + } + if (amf_non3_gpp_access_registration->registration_time) { + ogs_free(amf_non3_gpp_access_registration->registration_time); + amf_non3_gpp_access_registration->registration_time = NULL; + } + if (amf_non3_gpp_access_registration->vgmlc_address) { + OpenAPI_vgmlc_address_free(amf_non3_gpp_access_registration->vgmlc_address); + amf_non3_gpp_access_registration->vgmlc_address = NULL; + } + if (amf_non3_gpp_access_registration->context_info) { + OpenAPI_context_info_free(amf_non3_gpp_access_registration->context_info); + amf_non3_gpp_access_registration->context_info = NULL; + } + if (amf_non3_gpp_access_registration->supi) { + ogs_free(amf_non3_gpp_access_registration->supi); + amf_non3_gpp_access_registration->supi = NULL; } - OpenAPI_list_free(amf_non3_gpp_access_registration->backup_amf_info); - ogs_free(amf_non3_gpp_access_registration->amf_ee_subscription_id); - ogs_free(amf_non3_gpp_access_registration->registration_time); - OpenAPI_vgmlc_address_free(amf_non3_gpp_access_registration->vgmlc_address); - OpenAPI_context_info_free(amf_non3_gpp_access_registration->context_info); - ogs_free(amf_non3_gpp_access_registration->supi); ogs_free(amf_non3_gpp_access_registration); } cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_non3_gpp_access_registration == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [AmfNon3GppAccessRegistration]"); @@ -94,6 +138,10 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g } item = cJSON_CreateObject(); + if (!amf_non3_gpp_access_registration->amf_instance_id) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "amfInstanceId", amf_non3_gpp_access_registration->amf_instance_id) == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_instance_id]"); goto end; @@ -120,11 +168,19 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g } } + if (amf_non3_gpp_access_registration->ims_vo_ps == OpenAPI_ims_vo_ps_NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]"); + return NULL; + } if (cJSON_AddStringToObject(item, "imsVoPs", OpenAPI_ims_vo_ps_ToString(amf_non3_gpp_access_registration->ims_vo_ps)) == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]"); goto end; } + if (!amf_non3_gpp_access_registration->dereg_callback_uri) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "deregCallbackUri", amf_non3_gpp_access_registration->dereg_callback_uri) == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]"); goto end; @@ -151,6 +207,10 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g } } + if (!amf_non3_gpp_access_registration->guami) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [guami]"); + return NULL; + } cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf_non3_gpp_access_registration->guami); if (guami_local_JSON == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [guami]"); @@ -168,20 +228,20 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); goto end; } - - OpenAPI_lnode_t *backup_amf_info_node; - if (amf_non3_gpp_access_registration->backup_amf_info) { - OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, backup_amf_info_node) { - cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); - goto end; - } - cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [backup_amf_info]"); + goto end; } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); } } + if (amf_non3_gpp_access_registration->rat_type == OpenAPI_rat_type_NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(amf_non3_gpp_access_registration->rat_type)) == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]"); goto end; @@ -255,28 +315,51 @@ end: OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(cJSON *amf_non3_gpp_access_registrationJSON) { OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration_local_var = NULL; - cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *amf_instance_id = NULL; + cJSON *supported_features = NULL; + cJSON *purge_flag = NULL; + cJSON *pei = NULL; + cJSON *ims_vo_ps = NULL; + OpenAPI_ims_vo_ps_e ims_vo_psVariable = 0; + cJSON *dereg_callback_uri = NULL; + cJSON *amf_service_name_dereg = NULL; + cJSON *pcscf_restoration_callback_uri = NULL; + cJSON *amf_service_name_pcscf_rest = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *backup_amf_info = NULL; + OpenAPI_list_t *backup_amf_infoList = NULL; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *urrp_indicator = NULL; + cJSON *amf_ee_subscription_id = NULL; + cJSON *registration_time = NULL; + cJSON *vgmlc_address = NULL; + OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL; + cJSON *context_info = NULL; + OpenAPI_context_info_t *context_info_local_nonprim = NULL; + cJSON *no_ee_subscription_ind = NULL; + cJSON *supi = NULL; + amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfInstanceId"); if (!amf_instance_id) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]"); goto end; } - if (!cJSON_IsString(amf_instance_id)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]"); goto end; } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "purgeFlag"); - + purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "purgeFlag"); if (purge_flag) { if (!cJSON_IsBool(purge_flag)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [purge_flag]"); @@ -284,119 +367,103 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [pei]"); goto end; } } - cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "imsVoPs"); + ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "imsVoPs"); if (!ims_vo_ps) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [ims_vo_ps]"); goto end; } - - OpenAPI_ims_vo_ps_e ims_vo_psVariable; if (!cJSON_IsString(ims_vo_ps)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [ims_vo_ps]"); goto end; } ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring); - cJSON *dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "deregCallbackUri"); + dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "deregCallbackUri"); if (!dereg_callback_uri) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]"); goto end; } - if (!cJSON_IsString(dereg_callback_uri)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]"); goto end; } - cJSON *amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNameDereg"); - + amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNameDereg"); if (amf_service_name_dereg) { - if (!cJSON_IsString(amf_service_name_dereg)) { + if (!cJSON_IsString(amf_service_name_dereg) && !cJSON_IsNull(amf_service_name_dereg)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_service_name_dereg]"); goto end; } } - cJSON *pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri"); - + pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri"); if (pcscf_restoration_callback_uri) { - if (!cJSON_IsString(pcscf_restoration_callback_uri)) { + if (!cJSON_IsString(pcscf_restoration_callback_uri) && !cJSON_IsNull(pcscf_restoration_callback_uri)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]"); goto end; } } - cJSON *amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNamePcscfRest"); - + amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNamePcscfRest"); if (amf_service_name_pcscf_rest) { - if (!cJSON_IsString(amf_service_name_pcscf_rest)) { + if (!cJSON_IsString(amf_service_name_pcscf_rest) && !cJSON_IsNull(amf_service_name_pcscf_rest)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_service_name_pcscf_rest]"); goto end; } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "guami"); + guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "guami"); if (!guami) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [guami]"); goto end; } - - OpenAPI_guami_t *guami_local_nonprim = NULL; guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); - cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "backupAmfInfo"); - - OpenAPI_list_t *backup_amf_infoList; + backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "backupAmfInfo"); if (backup_amf_info) { - cJSON *backup_amf_info_local_nonprimitive; - if (!cJSON_IsArray(backup_amf_info)){ - ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); - goto end; - } - - backup_amf_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { - if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + cJSON *backup_amf_info_local = NULL; + if (!cJSON_IsArray(backup_amf_info)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); goto end; } - OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); - if (!backup_amf_infoItem) { - ogs_error("No backup_amf_infoItem"); - OpenAPI_list_free(backup_amf_infoList); - goto end; + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) { + if (!cJSON_IsObject(backup_amf_info_local)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local); + if (!backup_amf_infoItem) { + ogs_error("No backup_amf_infoItem"); + OpenAPI_list_free(backup_amf_infoList); + goto end; + } + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); } - - OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); - } } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "ratType"); + rat_type = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "ratType"); if (!rat_type) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [rat_type]"); goto end; } - - OpenAPI_rat_type_e rat_typeVariable; if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [rat_type]"); goto end; } rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); - cJSON *urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "urrpIndicator"); - + urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "urrpIndicator"); if (urrp_indicator) { if (!cJSON_IsBool(urrp_indicator)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [urrp_indicator]"); @@ -404,40 +471,33 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra } } - cJSON *amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfEeSubscriptionId"); - + amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfEeSubscriptionId"); if (amf_ee_subscription_id) { - if (!cJSON_IsString(amf_ee_subscription_id)) { + if (!cJSON_IsString(amf_ee_subscription_id) && !cJSON_IsNull(amf_ee_subscription_id)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_ee_subscription_id]"); goto end; } } - cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "registrationTime"); - + registration_time = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "registrationTime"); if (registration_time) { - if (!cJSON_IsString(registration_time)) { + if (!cJSON_IsString(registration_time) && !cJSON_IsNull(registration_time)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [registration_time]"); goto end; } } - cJSON *vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddress"); - - OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL; + vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddress"); if (vgmlc_address) { vgmlc_address_local_nonprim = OpenAPI_vgmlc_address_parseFromJSON(vgmlc_address); } - cJSON *context_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "contextInfo"); - - OpenAPI_context_info_t *context_info_local_nonprim = NULL; + context_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "contextInfo"); if (context_info) { context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info); } - cJSON *no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "noEeSubscriptionInd"); - + no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "noEeSubscriptionInd"); if (no_ee_subscription_ind) { if (!cJSON_IsBool(no_ee_subscription_ind)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [no_ee_subscription_ind]"); @@ -445,10 +505,9 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [supi]"); goto end; } @@ -456,31 +515,50 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra amf_non3_gpp_access_registration_local_var = OpenAPI_amf_non3_gpp_access_registration_create ( ogs_strdup(amf_instance_id->valuestring), - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, purge_flag ? true : false, purge_flag ? purge_flag->valueint : 0, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, ims_vo_psVariable, ogs_strdup(dereg_callback_uri->valuestring), - amf_service_name_dereg ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL, - pcscf_restoration_callback_uri ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, - amf_service_name_pcscf_rest ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL, + amf_service_name_dereg && !cJSON_IsNull(amf_service_name_dereg) ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL, + pcscf_restoration_callback_uri && !cJSON_IsNull(pcscf_restoration_callback_uri) ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, + amf_service_name_pcscf_rest && !cJSON_IsNull(amf_service_name_pcscf_rest) ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL, guami_local_nonprim, backup_amf_info ? backup_amf_infoList : NULL, rat_typeVariable, urrp_indicator ? true : false, urrp_indicator ? urrp_indicator->valueint : 0, - amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL, - registration_time ? ogs_strdup(registration_time->valuestring) : NULL, + amf_ee_subscription_id && !cJSON_IsNull(amf_ee_subscription_id) ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL, + registration_time && !cJSON_IsNull(registration_time) ? ogs_strdup(registration_time->valuestring) : NULL, vgmlc_address ? vgmlc_address_local_nonprim : NULL, context_info ? context_info_local_nonprim : NULL, no_ee_subscription_ind ? true : false, no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0, - supi ? ogs_strdup(supi->valuestring) : NULL + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL ); return amf_non3_gpp_access_registration_local_var; end: + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (backup_amf_infoList) { + OpenAPI_list_for_each(backup_amf_infoList, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(backup_amf_infoList); + backup_amf_infoList = NULL; + } + if (vgmlc_address_local_nonprim) { + OpenAPI_vgmlc_address_free(vgmlc_address_local_nonprim); + vgmlc_address_local_nonprim = NULL; + } + if (context_info_local_nonprim) { + OpenAPI_context_info_free(context_info_local_nonprim); + context_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.c b/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.c index ba30506d8..05114b59d 100644 --- a/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.c +++ b/lib/sbi/openapi/model/amf_non3_gpp_access_registration_modification.c @@ -28,22 +28,33 @@ OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_ac void OpenAPI_amf_non3_gpp_access_registration_modification_free(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_non3_gpp_access_registration_modification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_guami_free(amf_non3_gpp_access_registration_modification->guami); - ogs_free(amf_non3_gpp_access_registration_modification->pei); - OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, node) { - OpenAPI_backup_amf_info_free(node->data); + if (amf_non3_gpp_access_registration_modification->guami) { + OpenAPI_guami_free(amf_non3_gpp_access_registration_modification->guami); + amf_non3_gpp_access_registration_modification->guami = NULL; + } + if (amf_non3_gpp_access_registration_modification->pei) { + ogs_free(amf_non3_gpp_access_registration_modification->pei); + amf_non3_gpp_access_registration_modification->pei = NULL; + } + if (amf_non3_gpp_access_registration_modification->backup_amf_info) { + OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(amf_non3_gpp_access_registration_modification->backup_amf_info); + amf_non3_gpp_access_registration_modification->backup_amf_info = NULL; } - OpenAPI_list_free(amf_non3_gpp_access_registration_modification->backup_amf_info); ogs_free(amf_non3_gpp_access_registration_modification); } cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_non3_gpp_access_registration_modification == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [AmfNon3GppAccessRegistrationModification]"); @@ -51,6 +62,10 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenA } item = cJSON_CreateObject(); + if (!amf_non3_gpp_access_registration_modification->guami) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [guami]"); + return NULL; + } cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf_non3_gpp_access_registration_modification->guami); if (guami_local_JSON == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [guami]"); @@ -76,7 +91,7 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenA } } - if (amf_non3_gpp_access_registration_modification->ims_vo_ps) { + if (amf_non3_gpp_access_registration_modification->ims_vo_ps != OpenAPI_ims_vo_ps_NULL) { if (cJSON_AddStringToObject(item, "imsVoPs", OpenAPI_ims_vo_ps_ToString(amf_non3_gpp_access_registration_modification->ims_vo_ps)) == NULL) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [ims_vo_ps]"); goto end; @@ -89,17 +104,13 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenA ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); goto end; } - - OpenAPI_lnode_t *backup_amf_info_node; - if (amf_non3_gpp_access_registration_modification->backup_amf_info) { - OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, backup_amf_info_node) { - cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); - goto end; - } - cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]"); + goto end; } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); } } @@ -110,17 +121,23 @@ end: OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON(cJSON *amf_non3_gpp_access_registration_modificationJSON) { OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification_local_var = NULL; - cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "guami"); + OpenAPI_lnode_t *node = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *purge_flag = NULL; + cJSON *pei = NULL; + cJSON *ims_vo_ps = NULL; + OpenAPI_ims_vo_ps_e ims_vo_psVariable = 0; + cJSON *backup_amf_info = NULL; + OpenAPI_list_t *backup_amf_infoList = NULL; + guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "guami"); if (!guami) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [guami]"); goto end; } - - OpenAPI_guami_t *guami_local_nonprim = NULL; guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); - cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "purgeFlag"); - + purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "purgeFlag"); if (purge_flag) { if (!cJSON_IsBool(purge_flag)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [purge_flag]"); @@ -128,18 +145,15 @@ OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_ac } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [pei]"); goto end; } } - cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "imsVoPs"); - - OpenAPI_ims_vo_ps_e ims_vo_psVariable; + ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "imsVoPs"); if (ims_vo_ps) { if (!cJSON_IsString(ims_vo_ps)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [ims_vo_ps]"); @@ -148,46 +162,53 @@ OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_ac ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring); } - cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "backupAmfInfo"); - - OpenAPI_list_t *backup_amf_infoList; + backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "backupAmfInfo"); if (backup_amf_info) { - cJSON *backup_amf_info_local_nonprimitive; - if (!cJSON_IsArray(backup_amf_info)){ - ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); - goto end; - } - - backup_amf_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { - if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + cJSON *backup_amf_info_local = NULL; + if (!cJSON_IsArray(backup_amf_info)) { ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); goto end; } - OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); - if (!backup_amf_infoItem) { - ogs_error("No backup_amf_infoItem"); - OpenAPI_list_free(backup_amf_infoList); - goto end; + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) { + if (!cJSON_IsObject(backup_amf_info_local)) { + ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local); + if (!backup_amf_infoItem) { + ogs_error("No backup_amf_infoItem"); + OpenAPI_list_free(backup_amf_infoList); + goto end; + } + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); } - - OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); - } } amf_non3_gpp_access_registration_modification_local_var = OpenAPI_amf_non3_gpp_access_registration_modification_create ( guami_local_nonprim, purge_flag ? true : false, purge_flag ? purge_flag->valueint : 0, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, ims_vo_ps ? ims_vo_psVariable : 0, backup_amf_info ? backup_amf_infoList : NULL ); return amf_non3_gpp_access_registration_modification_local_var; end: + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (backup_amf_infoList) { + OpenAPI_list_for_each(backup_amf_infoList, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(backup_amf_infoList); + backup_amf_infoList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_status_change_notification.c b/lib/sbi/openapi/model/amf_status_change_notification.c index d89f77d45..eee8699b8 100644 --- a/lib/sbi/openapi/model/amf_status_change_notification.c +++ b/lib/sbi/openapi/model/amf_status_change_notification.c @@ -18,20 +18,25 @@ OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification void OpenAPI_amf_status_change_notification_free(OpenAPI_amf_status_change_notification_t *amf_status_change_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_status_change_notification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) { - OpenAPI_amf_status_info_free(node->data); + if (amf_status_change_notification->amf_status_info_list) { + OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) { + OpenAPI_amf_status_info_free(node->data); + } + OpenAPI_list_free(amf_status_change_notification->amf_status_info_list); + amf_status_change_notification->amf_status_info_list = NULL; } - OpenAPI_list_free(amf_status_change_notification->amf_status_info_list); ogs_free(amf_status_change_notification); } cJSON *OpenAPI_amf_status_change_notification_convertToJSON(OpenAPI_amf_status_change_notification_t *amf_status_change_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_status_change_notification == NULL) { ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [AmfStatusChangeNotification]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_amf_status_change_notification_convertToJSON(OpenAPI_amf_status_c } item = cJSON_CreateObject(); + if (!amf_status_change_notification->amf_status_info_list) { + ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]"); + return NULL; + } cJSON *amf_status_info_listList = cJSON_AddArrayToObject(item, "amfStatusInfoList"); if (amf_status_info_listList == NULL) { ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]"); goto end; } - - OpenAPI_lnode_t *amf_status_info_list_node; - if (amf_status_change_notification->amf_status_info_list) { - OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, amf_status_info_list_node) { - cJSON *itemLocal = OpenAPI_amf_status_info_convertToJSON(amf_status_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]"); - goto end; - } - cJSON_AddItemToArray(amf_status_info_listList, itemLocal); + OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) { + cJSON *itemLocal = OpenAPI_amf_status_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]"); + goto end; } + cJSON_AddItemToArray(amf_status_info_listList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_parseFromJSON(cJSON *amf_status_change_notificationJSON) { OpenAPI_amf_status_change_notification_t *amf_status_change_notification_local_var = NULL; - cJSON *amf_status_info_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_notificationJSON, "amfStatusInfoList"); + OpenAPI_lnode_t *node = NULL; + cJSON *amf_status_info_list = NULL; + OpenAPI_list_t *amf_status_info_listList = NULL; + amf_status_info_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_notificationJSON, "amfStatusInfoList"); if (!amf_status_info_list) { ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]"); goto end; } - - OpenAPI_list_t *amf_status_info_listList; - cJSON *amf_status_info_list_local_nonprimitive; - if (!cJSON_IsArray(amf_status_info_list)){ - ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]"); - goto end; - } - - amf_status_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(amf_status_info_list_local_nonprimitive, amf_status_info_list ) { - if (!cJSON_IsObject(amf_status_info_list_local_nonprimitive)) { + cJSON *amf_status_info_list_local = NULL; + if (!cJSON_IsArray(amf_status_info_list)) { ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]"); goto end; } - OpenAPI_amf_status_info_t *amf_status_info_listItem = OpenAPI_amf_status_info_parseFromJSON(amf_status_info_list_local_nonprimitive); - if (!amf_status_info_listItem) { - ogs_error("No amf_status_info_listItem"); - OpenAPI_list_free(amf_status_info_listList); - goto end; + amf_status_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(amf_status_info_list_local, amf_status_info_list) { + if (!cJSON_IsObject(amf_status_info_list_local)) { + ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]"); + goto end; + } + OpenAPI_amf_status_info_t *amf_status_info_listItem = OpenAPI_amf_status_info_parseFromJSON(amf_status_info_list_local); + if (!amf_status_info_listItem) { + ogs_error("No amf_status_info_listItem"); + OpenAPI_list_free(amf_status_info_listList); + goto end; + } + OpenAPI_list_add(amf_status_info_listList, amf_status_info_listItem); } - OpenAPI_list_add(amf_status_info_listList, amf_status_info_listItem); - } - amf_status_change_notification_local_var = OpenAPI_amf_status_change_notification_create ( amf_status_info_listList ); return amf_status_change_notification_local_var; end: + if (amf_status_info_listList) { + OpenAPI_list_for_each(amf_status_info_listList, node) { + OpenAPI_amf_status_info_free(node->data); + } + OpenAPI_list_free(amf_status_info_listList); + amf_status_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_status_change_subscription_data.c b/lib/sbi/openapi/model/amf_status_change_subscription_data.c index 654b2b7a5..e32fc4190 100644 --- a/lib/sbi/openapi/model/amf_status_change_subscription_data.c +++ b/lib/sbi/openapi/model/amf_status_change_subscription_data.c @@ -20,21 +20,29 @@ OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscri void OpenAPI_amf_status_change_subscription_data_free(OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_status_change_subscription_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(amf_status_change_subscription_data->amf_status_uri); - OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, node) { - OpenAPI_guami_free(node->data); + if (amf_status_change_subscription_data->amf_status_uri) { + ogs_free(amf_status_change_subscription_data->amf_status_uri); + amf_status_change_subscription_data->amf_status_uri = NULL; + } + if (amf_status_change_subscription_data->guami_list) { + OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(amf_status_change_subscription_data->guami_list); + amf_status_change_subscription_data->guami_list = NULL; } - OpenAPI_list_free(amf_status_change_subscription_data->guami_list); ogs_free(amf_status_change_subscription_data); } cJSON *OpenAPI_amf_status_change_subscription_data_convertToJSON(OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_status_change_subscription_data == NULL) { ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [AMFStatusChangeSubscriptionData]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_amf_status_change_subscription_data_convertToJSON(OpenAPI_amf_sta } item = cJSON_CreateObject(); + if (!amf_status_change_subscription_data->amf_status_uri) { + ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [amf_status_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "amfStatusUri", amf_status_change_subscription_data->amf_status_uri) == NULL) { ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [amf_status_uri]"); goto end; @@ -53,17 +65,13 @@ cJSON *OpenAPI_amf_status_change_subscription_data_convertToJSON(OpenAPI_amf_sta ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [guami_list]"); goto end; } - - OpenAPI_lnode_t *guami_list_node; - if (amf_status_change_subscription_data->guami_list) { - OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, guami_list_node) { - cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [guami_list]"); - goto end; - } - cJSON_AddItemToArray(guami_listList, itemLocal); + OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [guami_list]"); + goto end; } + cJSON_AddItemToArray(guami_listList, itemLocal); } } @@ -74,44 +82,43 @@ end: OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscription_data_parseFromJSON(cJSON *amf_status_change_subscription_dataJSON) { OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data_local_var = NULL; - cJSON *amf_status_uri = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "amfStatusUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *amf_status_uri = NULL; + cJSON *guami_list = NULL; + OpenAPI_list_t *guami_listList = NULL; + amf_status_uri = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "amfStatusUri"); if (!amf_status_uri) { ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [amf_status_uri]"); goto end; } - if (!cJSON_IsString(amf_status_uri)) { ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [amf_status_uri]"); goto end; } - cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "guamiList"); - - OpenAPI_list_t *guami_listList; + guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "guamiList"); if (guami_list) { - cJSON *guami_list_local_nonprimitive; - if (!cJSON_IsArray(guami_list)){ - ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [guami_list]"); - goto end; - } - - guami_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) { - if (!cJSON_IsObject(guami_list_local_nonprimitive)) { + cJSON *guami_list_local = NULL; + if (!cJSON_IsArray(guami_list)) { ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [guami_list]"); goto end; } - OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive); - if (!guami_listItem) { - ogs_error("No guami_listItem"); - OpenAPI_list_free(guami_listList); - goto end; + guami_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(guami_list_local, guami_list) { + if (!cJSON_IsObject(guami_list_local)) { + ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [guami_list]"); + goto end; + } + OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local); + if (!guami_listItem) { + ogs_error("No guami_listItem"); + OpenAPI_list_free(guami_listList); + goto end; + } + OpenAPI_list_add(guami_listList, guami_listItem); } - - OpenAPI_list_add(guami_listList, guami_listItem); - } } amf_status_change_subscription_data_local_var = OpenAPI_amf_status_change_subscription_data_create ( @@ -121,6 +128,13 @@ OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscri return amf_status_change_subscription_data_local_var; end: + if (guami_listList) { + OpenAPI_list_for_each(guami_listList, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(guami_listList); + guami_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_status_info.c b/lib/sbi/openapi/model/amf_status_info.c index 5933c695c..07e793d65 100644 --- a/lib/sbi/openapi/model/amf_status_info.c +++ b/lib/sbi/openapi/model/amf_status_info.c @@ -24,22 +24,33 @@ OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_create( void OpenAPI_amf_status_info_free(OpenAPI_amf_status_info_t *amf_status_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_status_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(amf_status_info->guami_list, node) { - OpenAPI_guami_free(node->data); + if (amf_status_info->guami_list) { + OpenAPI_list_for_each(amf_status_info->guami_list, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(amf_status_info->guami_list); + amf_status_info->guami_list = NULL; + } + if (amf_status_info->target_amf_removal) { + ogs_free(amf_status_info->target_amf_removal); + amf_status_info->target_amf_removal = NULL; + } + if (amf_status_info->target_amf_failure) { + ogs_free(amf_status_info->target_amf_failure); + amf_status_info->target_amf_failure = NULL; } - OpenAPI_list_free(amf_status_info->guami_list); - ogs_free(amf_status_info->target_amf_removal); - ogs_free(amf_status_info->target_amf_failure); ogs_free(amf_status_info); } cJSON *OpenAPI_amf_status_info_convertToJSON(OpenAPI_amf_status_info_t *amf_status_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_status_info == NULL) { ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [AmfStatusInfo]"); @@ -47,24 +58,28 @@ cJSON *OpenAPI_amf_status_info_convertToJSON(OpenAPI_amf_status_info_t *amf_stat } item = cJSON_CreateObject(); + if (!amf_status_info->guami_list) { + ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]"); + return NULL; + } cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList"); if (guami_listList == NULL) { ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]"); goto end; } - - OpenAPI_lnode_t *guami_list_node; - if (amf_status_info->guami_list) { - OpenAPI_list_for_each(amf_status_info->guami_list, guami_list_node) { - cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]"); - goto end; - } - cJSON_AddItemToArray(guami_listList, itemLocal); + OpenAPI_list_for_each(amf_status_info->guami_list, node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]"); + goto end; } + cJSON_AddItemToArray(guami_listList, itemLocal); } + if (amf_status_info->status_change == OpenAPI_status_change_NULL) { + ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [status_change]"); + return NULL; + } if (cJSON_AddStringToObject(item, "statusChange", OpenAPI_status_change_ToString(amf_status_info->status_change)) == NULL) { ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [status_change]"); goto end; @@ -91,63 +106,62 @@ end: OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_parseFromJSON(cJSON *amf_status_infoJSON) { OpenAPI_amf_status_info_t *amf_status_info_local_var = NULL; - cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "guamiList"); + OpenAPI_lnode_t *node = NULL; + cJSON *guami_list = NULL; + OpenAPI_list_t *guami_listList = NULL; + cJSON *status_change = NULL; + OpenAPI_status_change_e status_changeVariable = 0; + cJSON *target_amf_removal = NULL; + cJSON *target_amf_failure = NULL; + guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "guamiList"); if (!guami_list) { ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]"); goto end; } - - OpenAPI_list_t *guami_listList; - cJSON *guami_list_local_nonprimitive; - if (!cJSON_IsArray(guami_list)){ - ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]"); - goto end; - } - - guami_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) { - if (!cJSON_IsObject(guami_list_local_nonprimitive)) { + cJSON *guami_list_local = NULL; + if (!cJSON_IsArray(guami_list)) { ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]"); goto end; } - OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive); - if (!guami_listItem) { - ogs_error("No guami_listItem"); - OpenAPI_list_free(guami_listList); - goto end; + guami_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(guami_list_local, guami_list) { + if (!cJSON_IsObject(guami_list_local)) { + ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]"); + goto end; + } + OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local); + if (!guami_listItem) { + ogs_error("No guami_listItem"); + OpenAPI_list_free(guami_listList); + goto end; + } + OpenAPI_list_add(guami_listList, guami_listItem); } - OpenAPI_list_add(guami_listList, guami_listItem); - } - - cJSON *status_change = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "statusChange"); + status_change = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "statusChange"); if (!status_change) { ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [status_change]"); goto end; } - - OpenAPI_status_change_e status_changeVariable; if (!cJSON_IsString(status_change)) { ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [status_change]"); goto end; } status_changeVariable = OpenAPI_status_change_FromString(status_change->valuestring); - cJSON *target_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfRemoval"); - + target_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfRemoval"); if (target_amf_removal) { - if (!cJSON_IsString(target_amf_removal)) { + if (!cJSON_IsString(target_amf_removal) && !cJSON_IsNull(target_amf_removal)) { ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [target_amf_removal]"); goto end; } } - cJSON *target_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfFailure"); - + target_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfFailure"); if (target_amf_failure) { - if (!cJSON_IsString(target_amf_failure)) { + if (!cJSON_IsString(target_amf_failure) && !cJSON_IsNull(target_amf_failure)) { ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [target_amf_failure]"); goto end; } @@ -156,12 +170,19 @@ OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_parseFromJSON(cJSON *amf_stat amf_status_info_local_var = OpenAPI_amf_status_info_create ( guami_listList, status_changeVariable, - target_amf_removal ? ogs_strdup(target_amf_removal->valuestring) : NULL, - target_amf_failure ? ogs_strdup(target_amf_failure->valuestring) : NULL + target_amf_removal && !cJSON_IsNull(target_amf_removal) ? ogs_strdup(target_amf_removal->valuestring) : NULL, + target_amf_failure && !cJSON_IsNull(target_amf_failure) ? ogs_strdup(target_amf_failure->valuestring) : NULL ); return amf_status_info_local_var; end: + if (guami_listList) { + OpenAPI_list_for_each(guami_listList, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(guami_listList); + guami_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/amf_subscription_info.c b/lib/sbi/openapi/model/amf_subscription_info.c index ca6fbff0f..999d8403c 100644 --- a/lib/sbi/openapi/model/amf_subscription_info.c +++ b/lib/sbi/openapi/model/amf_subscription_info.c @@ -22,19 +22,30 @@ OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_create( void OpenAPI_amf_subscription_info_free(OpenAPI_amf_subscription_info_t *amf_subscription_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == amf_subscription_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(amf_subscription_info->amf_instance_id); - ogs_free(amf_subscription_info->subscription_id); - ogs_free(amf_subscription_info->subs_change_notify_correlation_id); + if (amf_subscription_info->amf_instance_id) { + ogs_free(amf_subscription_info->amf_instance_id); + amf_subscription_info->amf_instance_id = NULL; + } + if (amf_subscription_info->subscription_id) { + ogs_free(amf_subscription_info->subscription_id); + amf_subscription_info->subscription_id = NULL; + } + if (amf_subscription_info->subs_change_notify_correlation_id) { + ogs_free(amf_subscription_info->subs_change_notify_correlation_id); + amf_subscription_info->subs_change_notify_correlation_id = NULL; + } ogs_free(amf_subscription_info); } cJSON *OpenAPI_amf_subscription_info_convertToJSON(OpenAPI_amf_subscription_info_t *amf_subscription_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (amf_subscription_info == NULL) { ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [AmfSubscriptionInfo]"); @@ -42,11 +53,19 @@ cJSON *OpenAPI_amf_subscription_info_convertToJSON(OpenAPI_amf_subscription_info } item = cJSON_CreateObject(); + if (!amf_subscription_info->amf_instance_id) { + ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [amf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "amfInstanceId", amf_subscription_info->amf_instance_id) == NULL) { ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [amf_instance_id]"); goto end; } + if (!amf_subscription_info->subscription_id) { + ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [subscription_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "subscriptionId", amf_subscription_info->subscription_id) == NULL) { ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [subscription_id]"); goto end; @@ -66,32 +85,33 @@ end: OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_parseFromJSON(cJSON *amf_subscription_infoJSON) { OpenAPI_amf_subscription_info_t *amf_subscription_info_local_var = NULL; - cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "amfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *amf_instance_id = NULL; + cJSON *subscription_id = NULL; + cJSON *subs_change_notify_correlation_id = NULL; + amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "amfInstanceId"); if (!amf_instance_id) { ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [amf_instance_id]"); goto end; } - if (!cJSON_IsString(amf_instance_id)) { ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [amf_instance_id]"); goto end; } - cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subscriptionId"); + subscription_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subscriptionId"); if (!subscription_id) { ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subscription_id]"); goto end; } - if (!cJSON_IsString(subscription_id)) { ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subscription_id]"); goto end; } - cJSON *subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subsChangeNotifyCorrelationId"); - + subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subsChangeNotifyCorrelationId"); if (subs_change_notify_correlation_id) { - if (!cJSON_IsString(subs_change_notify_correlation_id)) { + if (!cJSON_IsString(subs_change_notify_correlation_id) && !cJSON_IsNull(subs_change_notify_correlation_id)) { ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subs_change_notify_correlation_id]"); goto end; } @@ -100,7 +120,7 @@ OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_parseFromJSON(cJS amf_subscription_info_local_var = OpenAPI_amf_subscription_info_create ( ogs_strdup(amf_instance_id->valuestring), ogs_strdup(subscription_id->valuestring), - subs_change_notify_correlation_id ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL + subs_change_notify_correlation_id && !cJSON_IsNull(subs_change_notify_correlation_id) ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL ); return amf_subscription_info_local_var; diff --git a/lib/sbi/openapi/model/an_gw_address.c b/lib/sbi/openapi/model/an_gw_address.c index c0facc1ba..c15f154d9 100644 --- a/lib/sbi/openapi/model/an_gw_address.c +++ b/lib/sbi/openapi/model/an_gw_address.c @@ -20,18 +20,26 @@ OpenAPI_an_gw_address_t *OpenAPI_an_gw_address_create( void OpenAPI_an_gw_address_free(OpenAPI_an_gw_address_t *an_gw_address) { + OpenAPI_lnode_t *node = NULL; + if (NULL == an_gw_address) { return; } - OpenAPI_lnode_t *node; - ogs_free(an_gw_address->an_gw_ipv4_addr); - ogs_free(an_gw_address->an_gw_ipv6_addr); + if (an_gw_address->an_gw_ipv4_addr) { + ogs_free(an_gw_address->an_gw_ipv4_addr); + an_gw_address->an_gw_ipv4_addr = NULL; + } + if (an_gw_address->an_gw_ipv6_addr) { + ogs_free(an_gw_address->an_gw_ipv6_addr); + an_gw_address->an_gw_ipv6_addr = NULL; + } ogs_free(an_gw_address); } cJSON *OpenAPI_an_gw_address_convertToJSON(OpenAPI_an_gw_address_t *an_gw_address) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (an_gw_address == NULL) { ogs_error("OpenAPI_an_gw_address_convertToJSON() failed [AnGwAddress]"); @@ -60,27 +68,28 @@ end: OpenAPI_an_gw_address_t *OpenAPI_an_gw_address_parseFromJSON(cJSON *an_gw_addressJSON) { OpenAPI_an_gw_address_t *an_gw_address_local_var = NULL; - cJSON *an_gw_ipv4_addr = cJSON_GetObjectItemCaseSensitive(an_gw_addressJSON, "anGwIpv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *an_gw_ipv4_addr = NULL; + cJSON *an_gw_ipv6_addr = NULL; + an_gw_ipv4_addr = cJSON_GetObjectItemCaseSensitive(an_gw_addressJSON, "anGwIpv4Addr"); if (an_gw_ipv4_addr) { - if (!cJSON_IsString(an_gw_ipv4_addr)) { + if (!cJSON_IsString(an_gw_ipv4_addr) && !cJSON_IsNull(an_gw_ipv4_addr)) { ogs_error("OpenAPI_an_gw_address_parseFromJSON() failed [an_gw_ipv4_addr]"); goto end; } } - cJSON *an_gw_ipv6_addr = cJSON_GetObjectItemCaseSensitive(an_gw_addressJSON, "anGwIpv6Addr"); - + an_gw_ipv6_addr = cJSON_GetObjectItemCaseSensitive(an_gw_addressJSON, "anGwIpv6Addr"); if (an_gw_ipv6_addr) { - if (!cJSON_IsString(an_gw_ipv6_addr)) { + if (!cJSON_IsString(an_gw_ipv6_addr) && !cJSON_IsNull(an_gw_ipv6_addr)) { ogs_error("OpenAPI_an_gw_address_parseFromJSON() failed [an_gw_ipv6_addr]"); goto end; } } an_gw_address_local_var = OpenAPI_an_gw_address_create ( - an_gw_ipv4_addr ? ogs_strdup(an_gw_ipv4_addr->valuestring) : NULL, - an_gw_ipv6_addr ? ogs_strdup(an_gw_ipv6_addr->valuestring) : NULL + an_gw_ipv4_addr && !cJSON_IsNull(an_gw_ipv4_addr) ? ogs_strdup(an_gw_ipv4_addr->valuestring) : NULL, + an_gw_ipv6_addr && !cJSON_IsNull(an_gw_ipv6_addr) ? ogs_strdup(an_gw_ipv6_addr->valuestring) : NULL ); return an_gw_address_local_var; diff --git a/lib/sbi/openapi/model/apn_rate_status.c b/lib/sbi/openapi/model/apn_rate_status.c index 2e5cdae84..3d9158125 100644 --- a/lib/sbi/openapi/model/apn_rate_status.c +++ b/lib/sbi/openapi/model/apn_rate_status.c @@ -34,17 +34,22 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_create( void OpenAPI_apn_rate_status_free(OpenAPI_apn_rate_status_t *apn_rate_status) { + OpenAPI_lnode_t *node = NULL; + if (NULL == apn_rate_status) { return; } - OpenAPI_lnode_t *node; - ogs_free(apn_rate_status->validity_time); + if (apn_rate_status->validity_time) { + ogs_free(apn_rate_status->validity_time); + apn_rate_status->validity_time = NULL; + } ogs_free(apn_rate_status); } cJSON *OpenAPI_apn_rate_status_convertToJSON(OpenAPI_apn_rate_status_t *apn_rate_status) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (apn_rate_status == NULL) { ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed [ApnRateStatus]"); @@ -94,8 +99,13 @@ end: OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate_statusJSON) { OpenAPI_apn_rate_status_t *apn_rate_status_local_var = NULL; - cJSON *remain_packets_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsUl"); - + OpenAPI_lnode_t *node = NULL; + cJSON *remain_packets_ul = NULL; + cJSON *remain_packets_dl = NULL; + cJSON *validity_time = NULL; + cJSON *remain_ex_reports_ul = NULL; + cJSON *remain_ex_reports_dl = NULL; + remain_packets_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsUl"); if (remain_packets_ul) { if (!cJSON_IsNumber(remain_packets_ul)) { ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_packets_ul]"); @@ -103,8 +113,7 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate } } - cJSON *remain_packets_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsDl"); - + remain_packets_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsDl"); if (remain_packets_dl) { if (!cJSON_IsNumber(remain_packets_dl)) { ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_packets_dl]"); @@ -112,17 +121,15 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate } } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *remain_ex_reports_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsUl"); - + remain_ex_reports_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsUl"); if (remain_ex_reports_ul) { if (!cJSON_IsNumber(remain_ex_reports_ul)) { ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_ex_reports_ul]"); @@ -130,8 +137,7 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate } } - cJSON *remain_ex_reports_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsDl"); - + remain_ex_reports_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsDl"); if (remain_ex_reports_dl) { if (!cJSON_IsNumber(remain_ex_reports_dl)) { ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_ex_reports_dl]"); @@ -144,7 +150,7 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate remain_packets_ul ? remain_packets_ul->valuedouble : 0, remain_packets_dl ? true : false, remain_packets_dl ? remain_packets_dl->valuedouble : 0, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, remain_ex_reports_ul ? true : false, remain_ex_reports_ul ? remain_ex_reports_ul->valuedouble : 0, remain_ex_reports_dl ? true : false, diff --git a/lib/sbi/openapi/model/app_descriptor.c b/lib/sbi/openapi/model/app_descriptor.c index 72ae582dc..2e56d0dc3 100644 --- a/lib/sbi/openapi/model/app_descriptor.c +++ b/lib/sbi/openapi/model/app_descriptor.c @@ -20,18 +20,26 @@ OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_create( void OpenAPI_app_descriptor_free(OpenAPI_app_descriptor_t *app_descriptor) { + OpenAPI_lnode_t *node = NULL; + if (NULL == app_descriptor) { return; } - OpenAPI_lnode_t *node; - ogs_free(app_descriptor->os_id); - ogs_free(app_descriptor->app_id); + if (app_descriptor->os_id) { + ogs_free(app_descriptor->os_id); + app_descriptor->os_id = NULL; + } + if (app_descriptor->app_id) { + ogs_free(app_descriptor->app_id); + app_descriptor->app_id = NULL; + } ogs_free(app_descriptor); } cJSON *OpenAPI_app_descriptor_convertToJSON(OpenAPI_app_descriptor_t *app_descriptor) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (app_descriptor == NULL) { ogs_error("OpenAPI_app_descriptor_convertToJSON() failed [AppDescriptor]"); @@ -60,27 +68,28 @@ end: OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_parseFromJSON(cJSON *app_descriptorJSON) { OpenAPI_app_descriptor_t *app_descriptor_local_var = NULL; - cJSON *os_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "osId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *os_id = NULL; + cJSON *app_id = NULL; + os_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "osId"); if (os_id) { - if (!cJSON_IsString(os_id)) { + if (!cJSON_IsString(os_id) && !cJSON_IsNull(os_id)) { ogs_error("OpenAPI_app_descriptor_parseFromJSON() failed [os_id]"); goto end; } } - cJSON *app_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "appId"); - + app_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "appId"); if (app_id) { - if (!cJSON_IsString(app_id)) { + if (!cJSON_IsString(app_id) && !cJSON_IsNull(app_id)) { ogs_error("OpenAPI_app_descriptor_parseFromJSON() failed [app_id]"); goto end; } } app_descriptor_local_var = OpenAPI_app_descriptor_create ( - os_id ? ogs_strdup(os_id->valuestring) : NULL, - app_id ? ogs_strdup(app_id->valuestring) : NULL + os_id && !cJSON_IsNull(os_id) ? ogs_strdup(os_id->valuestring) : NULL, + app_id && !cJSON_IsNull(app_id) ? ogs_strdup(app_id->valuestring) : NULL ); return app_descriptor_local_var; diff --git a/lib/sbi/openapi/model/app_detection_info.c b/lib/sbi/openapi/model/app_detection_info.c index 5aa25d5a4..f5e719710 100644 --- a/lib/sbi/openapi/model/app_detection_info.c +++ b/lib/sbi/openapi/model/app_detection_info.c @@ -22,22 +22,33 @@ OpenAPI_app_detection_info_t *OpenAPI_app_detection_info_create( void OpenAPI_app_detection_info_free(OpenAPI_app_detection_info_t *app_detection_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == app_detection_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(app_detection_info->app_id); - ogs_free(app_detection_info->instance_id); - OpenAPI_list_for_each(app_detection_info->sdf_descriptions, node) { - OpenAPI_flow_information_free(node->data); + if (app_detection_info->app_id) { + ogs_free(app_detection_info->app_id); + app_detection_info->app_id = NULL; + } + if (app_detection_info->instance_id) { + ogs_free(app_detection_info->instance_id); + app_detection_info->instance_id = NULL; + } + if (app_detection_info->sdf_descriptions) { + OpenAPI_list_for_each(app_detection_info->sdf_descriptions, node) { + OpenAPI_flow_information_free(node->data); + } + OpenAPI_list_free(app_detection_info->sdf_descriptions); + app_detection_info->sdf_descriptions = NULL; } - OpenAPI_list_free(app_detection_info->sdf_descriptions); ogs_free(app_detection_info); } cJSON *OpenAPI_app_detection_info_convertToJSON(OpenAPI_app_detection_info_t *app_detection_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (app_detection_info == NULL) { ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [AppDetectionInfo]"); @@ -45,6 +56,10 @@ cJSON *OpenAPI_app_detection_info_convertToJSON(OpenAPI_app_detection_info_t *ap } item = cJSON_CreateObject(); + if (!app_detection_info->app_id) { + ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [app_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "appId", app_detection_info->app_id) == NULL) { ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [app_id]"); goto end; @@ -63,17 +78,13 @@ cJSON *OpenAPI_app_detection_info_convertToJSON(OpenAPI_app_detection_info_t *ap ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [sdf_descriptions]"); goto end; } - - OpenAPI_lnode_t *sdf_descriptions_node; - if (app_detection_info->sdf_descriptions) { - OpenAPI_list_for_each(app_detection_info->sdf_descriptions, sdf_descriptions_node) { - cJSON *itemLocal = OpenAPI_flow_information_convertToJSON(sdf_descriptions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [sdf_descriptions]"); - goto end; - } - cJSON_AddItemToArray(sdf_descriptionsList, itemLocal); + OpenAPI_list_for_each(app_detection_info->sdf_descriptions, node) { + cJSON *itemLocal = OpenAPI_flow_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [sdf_descriptions]"); + goto end; } + cJSON_AddItemToArray(sdf_descriptionsList, itemLocal); } } @@ -84,63 +95,69 @@ end: OpenAPI_app_detection_info_t *OpenAPI_app_detection_info_parseFromJSON(cJSON *app_detection_infoJSON) { OpenAPI_app_detection_info_t *app_detection_info_local_var = NULL; - cJSON *app_id = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "appId"); + OpenAPI_lnode_t *node = NULL; + cJSON *app_id = NULL; + cJSON *instance_id = NULL; + cJSON *sdf_descriptions = NULL; + OpenAPI_list_t *sdf_descriptionsList = NULL; + app_id = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "appId"); if (!app_id) { ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [app_id]"); goto end; } - if (!cJSON_IsString(app_id)) { ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [app_id]"); goto end; } - cJSON *instance_id = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "instanceId"); - + instance_id = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "instanceId"); if (instance_id) { - if (!cJSON_IsString(instance_id)) { + if (!cJSON_IsString(instance_id) && !cJSON_IsNull(instance_id)) { ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [instance_id]"); goto end; } } - cJSON *sdf_descriptions = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "sdfDescriptions"); - - OpenAPI_list_t *sdf_descriptionsList; + sdf_descriptions = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "sdfDescriptions"); if (sdf_descriptions) { - cJSON *sdf_descriptions_local_nonprimitive; - if (!cJSON_IsArray(sdf_descriptions)){ - ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [sdf_descriptions]"); - goto end; - } - - sdf_descriptionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sdf_descriptions_local_nonprimitive, sdf_descriptions ) { - if (!cJSON_IsObject(sdf_descriptions_local_nonprimitive)) { + cJSON *sdf_descriptions_local = NULL; + if (!cJSON_IsArray(sdf_descriptions)) { ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [sdf_descriptions]"); goto end; } - OpenAPI_flow_information_t *sdf_descriptionsItem = OpenAPI_flow_information_parseFromJSON(sdf_descriptions_local_nonprimitive); - if (!sdf_descriptionsItem) { - ogs_error("No sdf_descriptionsItem"); - OpenAPI_list_free(sdf_descriptionsList); - goto end; + sdf_descriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sdf_descriptions_local, sdf_descriptions) { + if (!cJSON_IsObject(sdf_descriptions_local)) { + ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [sdf_descriptions]"); + goto end; + } + OpenAPI_flow_information_t *sdf_descriptionsItem = OpenAPI_flow_information_parseFromJSON(sdf_descriptions_local); + if (!sdf_descriptionsItem) { + ogs_error("No sdf_descriptionsItem"); + OpenAPI_list_free(sdf_descriptionsList); + goto end; + } + OpenAPI_list_add(sdf_descriptionsList, sdf_descriptionsItem); } - - OpenAPI_list_add(sdf_descriptionsList, sdf_descriptionsItem); - } } app_detection_info_local_var = OpenAPI_app_detection_info_create ( ogs_strdup(app_id->valuestring), - instance_id ? ogs_strdup(instance_id->valuestring) : NULL, + instance_id && !cJSON_IsNull(instance_id) ? ogs_strdup(instance_id->valuestring) : NULL, sdf_descriptions ? sdf_descriptionsList : NULL ); return app_detection_info_local_var; end: + if (sdf_descriptionsList) { + OpenAPI_list_for_each(sdf_descriptionsList, node) { + OpenAPI_flow_information_free(node->data); + } + OpenAPI_list_free(sdf_descriptionsList); + sdf_descriptionsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/app_port_id.c b/lib/sbi/openapi/model/app_port_id.c index 56ed97a4c..d595cf71c 100644 --- a/lib/sbi/openapi/model/app_port_id.c +++ b/lib/sbi/openapi/model/app_port_id.c @@ -24,16 +24,18 @@ OpenAPI_app_port_id_t *OpenAPI_app_port_id_create( void OpenAPI_app_port_id_free(OpenAPI_app_port_id_t *app_port_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == app_port_id) { return; } - OpenAPI_lnode_t *node; ogs_free(app_port_id); } cJSON *OpenAPI_app_port_id_convertToJSON(OpenAPI_app_port_id_t *app_port_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (app_port_id == NULL) { ogs_error("OpenAPI_app_port_id_convertToJSON() failed [AppPortId]"); @@ -62,8 +64,10 @@ end: OpenAPI_app_port_id_t *OpenAPI_app_port_id_parseFromJSON(cJSON *app_port_idJSON) { OpenAPI_app_port_id_t *app_port_id_local_var = NULL; - cJSON *destination_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "destinationPort"); - + OpenAPI_lnode_t *node = NULL; + cJSON *destination_port = NULL; + cJSON *originator_port = NULL; + destination_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "destinationPort"); if (destination_port) { if (!cJSON_IsNumber(destination_port)) { ogs_error("OpenAPI_app_port_id_parseFromJSON() failed [destination_port]"); @@ -71,8 +75,7 @@ OpenAPI_app_port_id_t *OpenAPI_app_port_id_parseFromJSON(cJSON *app_port_idJSON) } } - cJSON *originator_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "originatorPort"); - + originator_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "originatorPort"); if (originator_port) { if (!cJSON_IsNumber(originator_port)) { ogs_error("OpenAPI_app_port_id_parseFromJSON() failed [originator_port]"); diff --git a/lib/sbi/openapi/model/app_session_context.c b/lib/sbi/openapi/model/app_session_context.c index fa668c8ff..8a5db4aff 100644 --- a/lib/sbi/openapi/model/app_session_context.c +++ b/lib/sbi/openapi/model/app_session_context.c @@ -22,19 +22,30 @@ OpenAPI_app_session_context_t *OpenAPI_app_session_context_create( void OpenAPI_app_session_context_free(OpenAPI_app_session_context_t *app_session_context) { + OpenAPI_lnode_t *node = NULL; + if (NULL == app_session_context) { return; } - OpenAPI_lnode_t *node; - OpenAPI_app_session_context_req_data_free(app_session_context->asc_req_data); - OpenAPI_app_session_context_resp_data_free(app_session_context->asc_resp_data); - OpenAPI_events_notification_free(app_session_context->evs_notif); + if (app_session_context->asc_req_data) { + OpenAPI_app_session_context_req_data_free(app_session_context->asc_req_data); + app_session_context->asc_req_data = NULL; + } + if (app_session_context->asc_resp_data) { + OpenAPI_app_session_context_resp_data_free(app_session_context->asc_resp_data); + app_session_context->asc_resp_data = NULL; + } + if (app_session_context->evs_notif) { + OpenAPI_events_notification_free(app_session_context->evs_notif); + app_session_context->evs_notif = NULL; + } ogs_free(app_session_context); } cJSON *OpenAPI_app_session_context_convertToJSON(OpenAPI_app_session_context_t *app_session_context) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (app_session_context == NULL) { ogs_error("OpenAPI_app_session_context_convertToJSON() failed [AppSessionContext]"); @@ -88,23 +99,24 @@ end: OpenAPI_app_session_context_t *OpenAPI_app_session_context_parseFromJSON(cJSON *app_session_contextJSON) { OpenAPI_app_session_context_t *app_session_context_local_var = NULL; - cJSON *asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascReqData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *asc_req_data = NULL; OpenAPI_app_session_context_req_data_t *asc_req_data_local_nonprim = NULL; + cJSON *asc_resp_data = NULL; + OpenAPI_app_session_context_resp_data_t *asc_resp_data_local_nonprim = NULL; + cJSON *evs_notif = NULL; + OpenAPI_events_notification_t *evs_notif_local_nonprim = NULL; + asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascReqData"); if (asc_req_data) { asc_req_data_local_nonprim = OpenAPI_app_session_context_req_data_parseFromJSON(asc_req_data); } - cJSON *asc_resp_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascRespData"); - - OpenAPI_app_session_context_resp_data_t *asc_resp_data_local_nonprim = NULL; + asc_resp_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascRespData"); if (asc_resp_data) { asc_resp_data_local_nonprim = OpenAPI_app_session_context_resp_data_parseFromJSON(asc_resp_data); } - cJSON *evs_notif = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "evsNotif"); - - OpenAPI_events_notification_t *evs_notif_local_nonprim = NULL; + evs_notif = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "evsNotif"); if (evs_notif) { evs_notif_local_nonprim = OpenAPI_events_notification_parseFromJSON(evs_notif); } @@ -117,6 +129,18 @@ OpenAPI_app_session_context_t *OpenAPI_app_session_context_parseFromJSON(cJSON * return app_session_context_local_var; end: + if (asc_req_data_local_nonprim) { + OpenAPI_app_session_context_req_data_free(asc_req_data_local_nonprim); + asc_req_data_local_nonprim = NULL; + } + if (asc_resp_data_local_nonprim) { + OpenAPI_app_session_context_resp_data_free(asc_resp_data_local_nonprim); + asc_resp_data_local_nonprim = NULL; + } + if (evs_notif_local_nonprim) { + OpenAPI_events_notification_free(evs_notif_local_nonprim); + evs_notif_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/app_session_context_req_data.c b/lib/sbi/openapi/model/app_session_context_req_data.c index 42ee198c5..75de48825 100644 --- a/lib/sbi/openapi/model/app_session_context_req_data.c +++ b/lib/sbi/openapi/model/app_session_context_req_data.c @@ -78,51 +78,131 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_cre void OpenAPI_app_session_context_req_data_free(OpenAPI_app_session_context_req_data_t *app_session_context_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == app_session_context_req_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(app_session_context_req_data->af_app_id); - ogs_free(app_session_context_req_data->af_charg_id); - OpenAPI_af_routing_requirement_free(app_session_context_req_data->af_rout_req); - ogs_free(app_session_context_req_data->asp_id); - ogs_free(app_session_context_req_data->bdt_ref_id); - ogs_free(app_session_context_req_data->dnn); - OpenAPI_events_subsc_req_data_free(app_session_context_req_data->ev_subsc); - ogs_free(app_session_context_req_data->mcptt_id); - ogs_free(app_session_context_req_data->mc_video_id); - OpenAPI_list_for_each(app_session_context_req_data->med_components, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_media_component_free(localKeyValue->value); - ogs_free(localKeyValue); + if (app_session_context_req_data->af_app_id) { + ogs_free(app_session_context_req_data->af_app_id); + app_session_context_req_data->af_app_id = NULL; } - OpenAPI_list_free(app_session_context_req_data->med_components); - ogs_free(app_session_context_req_data->ip_domain); - ogs_free(app_session_context_req_data->mps_id); - ogs_free(app_session_context_req_data->mcs_id); - ogs_free(app_session_context_req_data->notif_uri); - ogs_free(app_session_context_req_data->serv_urn); - OpenAPI_snssai_free(app_session_context_req_data->slice_info); - ogs_free(app_session_context_req_data->spon_id); - ogs_free(app_session_context_req_data->supi); - ogs_free(app_session_context_req_data->gpsi); - ogs_free(app_session_context_req_data->supp_feat); - ogs_free(app_session_context_req_data->ue_ipv4); - ogs_free(app_session_context_req_data->ue_ipv6); - ogs_free(app_session_context_req_data->ue_mac); - OpenAPI_bridge_management_container_free(app_session_context_req_data->tsn_bridge_man_cont); - OpenAPI_port_management_container_free(app_session_context_req_data->tsn_port_man_cont_dstt); - OpenAPI_list_for_each(app_session_context_req_data->tsn_port_man_cont_nwtts, node) { - OpenAPI_port_management_container_free(node->data); + if (app_session_context_req_data->af_charg_id) { + ogs_free(app_session_context_req_data->af_charg_id); + app_session_context_req_data->af_charg_id = NULL; + } + if (app_session_context_req_data->af_rout_req) { + OpenAPI_af_routing_requirement_free(app_session_context_req_data->af_rout_req); + app_session_context_req_data->af_rout_req = NULL; + } + if (app_session_context_req_data->asp_id) { + ogs_free(app_session_context_req_data->asp_id); + app_session_context_req_data->asp_id = NULL; + } + if (app_session_context_req_data->bdt_ref_id) { + ogs_free(app_session_context_req_data->bdt_ref_id); + app_session_context_req_data->bdt_ref_id = NULL; + } + if (app_session_context_req_data->dnn) { + ogs_free(app_session_context_req_data->dnn); + app_session_context_req_data->dnn = NULL; + } + if (app_session_context_req_data->ev_subsc) { + OpenAPI_events_subsc_req_data_free(app_session_context_req_data->ev_subsc); + app_session_context_req_data->ev_subsc = NULL; + } + if (app_session_context_req_data->mcptt_id) { + ogs_free(app_session_context_req_data->mcptt_id); + app_session_context_req_data->mcptt_id = NULL; + } + if (app_session_context_req_data->mc_video_id) { + ogs_free(app_session_context_req_data->mc_video_id); + app_session_context_req_data->mc_video_id = NULL; + } + if (app_session_context_req_data->med_components) { + OpenAPI_list_for_each(app_session_context_req_data->med_components, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_component_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(app_session_context_req_data->med_components); + app_session_context_req_data->med_components = NULL; + } + if (app_session_context_req_data->ip_domain) { + ogs_free(app_session_context_req_data->ip_domain); + app_session_context_req_data->ip_domain = NULL; + } + if (app_session_context_req_data->mps_id) { + ogs_free(app_session_context_req_data->mps_id); + app_session_context_req_data->mps_id = NULL; + } + if (app_session_context_req_data->mcs_id) { + ogs_free(app_session_context_req_data->mcs_id); + app_session_context_req_data->mcs_id = NULL; + } + if (app_session_context_req_data->notif_uri) { + ogs_free(app_session_context_req_data->notif_uri); + app_session_context_req_data->notif_uri = NULL; + } + if (app_session_context_req_data->serv_urn) { + ogs_free(app_session_context_req_data->serv_urn); + app_session_context_req_data->serv_urn = NULL; + } + if (app_session_context_req_data->slice_info) { + OpenAPI_snssai_free(app_session_context_req_data->slice_info); + app_session_context_req_data->slice_info = NULL; + } + if (app_session_context_req_data->spon_id) { + ogs_free(app_session_context_req_data->spon_id); + app_session_context_req_data->spon_id = NULL; + } + if (app_session_context_req_data->supi) { + ogs_free(app_session_context_req_data->supi); + app_session_context_req_data->supi = NULL; + } + if (app_session_context_req_data->gpsi) { + ogs_free(app_session_context_req_data->gpsi); + app_session_context_req_data->gpsi = NULL; + } + if (app_session_context_req_data->supp_feat) { + ogs_free(app_session_context_req_data->supp_feat); + app_session_context_req_data->supp_feat = NULL; + } + if (app_session_context_req_data->ue_ipv4) { + ogs_free(app_session_context_req_data->ue_ipv4); + app_session_context_req_data->ue_ipv4 = NULL; + } + if (app_session_context_req_data->ue_ipv6) { + ogs_free(app_session_context_req_data->ue_ipv6); + app_session_context_req_data->ue_ipv6 = NULL; + } + if (app_session_context_req_data->ue_mac) { + ogs_free(app_session_context_req_data->ue_mac); + app_session_context_req_data->ue_mac = NULL; + } + if (app_session_context_req_data->tsn_bridge_man_cont) { + OpenAPI_bridge_management_container_free(app_session_context_req_data->tsn_bridge_man_cont); + app_session_context_req_data->tsn_bridge_man_cont = NULL; + } + if (app_session_context_req_data->tsn_port_man_cont_dstt) { + OpenAPI_port_management_container_free(app_session_context_req_data->tsn_port_man_cont_dstt); + app_session_context_req_data->tsn_port_man_cont_dstt = NULL; + } + if (app_session_context_req_data->tsn_port_man_cont_nwtts) { + OpenAPI_list_for_each(app_session_context_req_data->tsn_port_man_cont_nwtts, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(app_session_context_req_data->tsn_port_man_cont_nwtts); + app_session_context_req_data->tsn_port_man_cont_nwtts = NULL; } - OpenAPI_list_free(app_session_context_req_data->tsn_port_man_cont_nwtts); ogs_free(app_session_context_req_data); } cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_context_req_data_t *app_session_context_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (app_session_context_req_data == NULL) { ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [AppSessionContextReqData]"); @@ -144,7 +224,7 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co } } - if (app_session_context_req_data->af_req_data) { + if (app_session_context_req_data->af_req_data != OpenAPI_af_requested_data_NULL) { if (cJSON_AddStringToObject(item, "afReqData", OpenAPI_af_requested_data_ToString(app_session_context_req_data->af_req_data)) == NULL) { ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [af_req_data]"); goto end; @@ -219,21 +299,20 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co goto end; } cJSON *localMapObject = med_components; - OpenAPI_lnode_t *med_components_node; if (app_session_context_req_data->med_components) { - OpenAPI_list_for_each(app_session_context_req_data->med_components, med_components_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)med_components_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_media_component_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(app_session_context_req_data->med_components, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_media_component_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (app_session_context_req_data->ip_domain) { if (cJSON_AddStringToObject(item, "ipDomain", app_session_context_req_data->ip_domain) == NULL) { @@ -256,27 +335,31 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co } } - if (app_session_context_req_data->preempt_control_info) { + if (app_session_context_req_data->preempt_control_info != OpenAPI_preemption_control_information_NULL) { if (cJSON_AddStringToObject(item, "preemptControlInfo", OpenAPI_preemption_control_information_ToString(app_session_context_req_data->preempt_control_info)) == NULL) { ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [preempt_control_info]"); goto end; } } - if (app_session_context_req_data->res_prio) { + if (app_session_context_req_data->res_prio != OpenAPI_reserv_priority_NULL) { if (cJSON_AddStringToObject(item, "resPrio", OpenAPI_reserv_priority_ToString(app_session_context_req_data->res_prio)) == NULL) { ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [res_prio]"); goto end; } } - if (app_session_context_req_data->serv_inf_status) { + if (app_session_context_req_data->serv_inf_status != OpenAPI_service_info_status_NULL) { if (cJSON_AddStringToObject(item, "servInfStatus", OpenAPI_service_info_status_ToString(app_session_context_req_data->serv_inf_status)) == NULL) { ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [serv_inf_status]"); goto end; } } + if (!app_session_context_req_data->notif_uri) { + ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [notif_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notifUri", app_session_context_req_data->notif_uri) == NULL) { ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [notif_uri]"); goto end; @@ -309,7 +392,7 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co } } - if (app_session_context_req_data->spon_status) { + if (app_session_context_req_data->spon_status != OpenAPI_sponsoring_status_NULL) { if (cJSON_AddStringToObject(item, "sponStatus", OpenAPI_sponsoring_status_ToString(app_session_context_req_data->spon_status)) == NULL) { ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [spon_status]"); goto end; @@ -330,6 +413,10 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co } } + if (!app_session_context_req_data->supp_feat) { + ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [supp_feat]"); + return NULL; + } if (cJSON_AddStringToObject(item, "suppFeat", app_session_context_req_data->supp_feat) == NULL) { ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [supp_feat]"); goto end; @@ -388,17 +475,13 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - - OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node; - if (app_session_context_req_data->tsn_port_man_cont_nwtts) { - OpenAPI_list_for_each(app_session_context_req_data->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) { - cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); + OpenAPI_list_for_each(app_session_context_req_data->tsn_port_man_cont_nwtts, node) { + cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; } + cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); } } @@ -409,27 +492,67 @@ end: OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_parseFromJSON(cJSON *app_session_context_req_dataJSON) { OpenAPI_app_session_context_req_data_t *app_session_context_req_data_local_var = NULL; - cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afAppId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *af_app_id = NULL; + cJSON *af_charg_id = NULL; + cJSON *af_req_data = NULL; + OpenAPI_af_requested_data_e af_req_dataVariable = 0; + cJSON *af_rout_req = NULL; + OpenAPI_af_routing_requirement_t *af_rout_req_local_nonprim = NULL; + cJSON *asp_id = NULL; + cJSON *bdt_ref_id = NULL; + cJSON *dnn = NULL; + cJSON *ev_subsc = NULL; + OpenAPI_events_subsc_req_data_t *ev_subsc_local_nonprim = NULL; + cJSON *mcptt_id = NULL; + cJSON *mc_video_id = NULL; + cJSON *med_components = NULL; + OpenAPI_list_t *med_componentsList = NULL; + cJSON *ip_domain = NULL; + cJSON *mps_id = NULL; + cJSON *mcs_id = NULL; + cJSON *preempt_control_info = NULL; + OpenAPI_preemption_control_information_e preempt_control_infoVariable = 0; + cJSON *res_prio = NULL; + OpenAPI_reserv_priority_e res_prioVariable = 0; + cJSON *serv_inf_status = NULL; + OpenAPI_service_info_status_e serv_inf_statusVariable = 0; + cJSON *notif_uri = NULL; + cJSON *serv_urn = NULL; + cJSON *slice_info = NULL; + OpenAPI_snssai_t *slice_info_local_nonprim = NULL; + cJSON *spon_id = NULL; + cJSON *spon_status = NULL; + OpenAPI_sponsoring_status_e spon_statusVariable = 0; + cJSON *supi = NULL; + cJSON *gpsi = NULL; + cJSON *supp_feat = NULL; + cJSON *ue_ipv4 = NULL; + cJSON *ue_ipv6 = NULL; + cJSON *ue_mac = NULL; + cJSON *tsn_bridge_man_cont = NULL; + OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + cJSON *tsn_port_man_cont_dstt = NULL; + OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + cJSON *tsn_port_man_cont_nwtts = NULL; + OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL; + af_app_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afAppId"); if (af_app_id) { - if (!cJSON_IsString(af_app_id)) { + if (!cJSON_IsString(af_app_id) && !cJSON_IsNull(af_app_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [af_app_id]"); goto end; } } - cJSON *af_charg_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afChargId"); - + af_charg_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afChargId"); if (af_charg_id) { - if (!cJSON_IsString(af_charg_id)) { + if (!cJSON_IsString(af_charg_id) && !cJSON_IsNull(af_charg_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [af_charg_id]"); goto end; } } - cJSON *af_req_data = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afReqData"); - - OpenAPI_af_requested_data_e af_req_dataVariable; + af_req_data = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afReqData"); if (af_req_data) { if (!cJSON_IsString(af_req_data)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [af_req_data]"); @@ -438,121 +561,107 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par af_req_dataVariable = OpenAPI_af_requested_data_FromString(af_req_data->valuestring); } - cJSON *af_rout_req = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afRoutReq"); - - OpenAPI_af_routing_requirement_t *af_rout_req_local_nonprim = NULL; + af_rout_req = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afRoutReq"); if (af_rout_req) { af_rout_req_local_nonprim = OpenAPI_af_routing_requirement_parseFromJSON(af_rout_req); } - cJSON *asp_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "aspId"); - + asp_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "aspId"); if (asp_id) { - if (!cJSON_IsString(asp_id)) { + if (!cJSON_IsString(asp_id) && !cJSON_IsNull(asp_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [asp_id]"); goto end; } } - cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "bdtRefId"); - + bdt_ref_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "bdtRefId"); if (bdt_ref_id) { - if (!cJSON_IsString(bdt_ref_id)) { + if (!cJSON_IsString(bdt_ref_id) && !cJSON_IsNull(bdt_ref_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [bdt_ref_id]"); goto end; } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *ev_subsc = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "evSubsc"); - - OpenAPI_events_subsc_req_data_t *ev_subsc_local_nonprim = NULL; + ev_subsc = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "evSubsc"); if (ev_subsc) { ev_subsc_local_nonprim = OpenAPI_events_subsc_req_data_parseFromJSON(ev_subsc); } - cJSON *mcptt_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcpttId"); - + mcptt_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcpttId"); if (mcptt_id) { - if (!cJSON_IsString(mcptt_id)) { + if (!cJSON_IsString(mcptt_id) && !cJSON_IsNull(mcptt_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [mcptt_id]"); goto end; } } - cJSON *mc_video_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcVideoId"); - + mc_video_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcVideoId"); if (mc_video_id) { - if (!cJSON_IsString(mc_video_id)) { + if (!cJSON_IsString(mc_video_id) && !cJSON_IsNull(mc_video_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [mc_video_id]"); goto end; } } - cJSON *med_components = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "medComponents"); - - OpenAPI_list_t *med_componentsList; + med_components = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "medComponents"); if (med_components) { - cJSON *med_components_local_map; - if (!cJSON_IsObject(med_components)) { - ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [med_components]"); - goto end; - } - med_componentsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(med_components_local_map, med_components) { - cJSON *localMapObject = med_components_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_media_component_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [inner]"); + cJSON *med_components_local_map = NULL; + if (!cJSON_IsObject(med_components) && !cJSON_IsNull(med_components)) { + ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [med_components]"); goto end; } - OpenAPI_list_add(med_componentsList, localMapKeyPair); - } + if (cJSON_IsObject(med_components)) { + med_componentsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(med_components_local_map, med_components) { + cJSON *localMapObject = med_components_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_media_component_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(med_componentsList, localMapKeyPair); + } + } } - cJSON *ip_domain = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ipDomain"); - + ip_domain = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ipDomain"); if (ip_domain) { - if (!cJSON_IsString(ip_domain)) { + if (!cJSON_IsString(ip_domain) && !cJSON_IsNull(ip_domain)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [ip_domain]"); goto end; } } - cJSON *mps_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mpsId"); - + mps_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mpsId"); if (mps_id) { - if (!cJSON_IsString(mps_id)) { + if (!cJSON_IsString(mps_id) && !cJSON_IsNull(mps_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [mps_id]"); goto end; } } - cJSON *mcs_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcsId"); - + mcs_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcsId"); if (mcs_id) { - if (!cJSON_IsString(mcs_id)) { + if (!cJSON_IsString(mcs_id) && !cJSON_IsNull(mcs_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [mcs_id]"); goto end; } } - cJSON *preempt_control_info = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "preemptControlInfo"); - - OpenAPI_preemption_control_information_e preempt_control_infoVariable; + preempt_control_info = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "preemptControlInfo"); if (preempt_control_info) { if (!cJSON_IsString(preempt_control_info)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [preempt_control_info]"); @@ -561,9 +670,7 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par preempt_control_infoVariable = OpenAPI_preemption_control_information_FromString(preempt_control_info->valuestring); } - cJSON *res_prio = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "resPrio"); - - OpenAPI_reserv_priority_e res_prioVariable; + res_prio = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "resPrio"); if (res_prio) { if (!cJSON_IsString(res_prio)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [res_prio]"); @@ -572,9 +679,7 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par res_prioVariable = OpenAPI_reserv_priority_FromString(res_prio->valuestring); } - cJSON *serv_inf_status = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "servInfStatus"); - - OpenAPI_service_info_status_e serv_inf_statusVariable; + serv_inf_status = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "servInfStatus"); if (serv_inf_status) { if (!cJSON_IsString(serv_inf_status)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [serv_inf_status]"); @@ -583,45 +688,38 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par serv_inf_statusVariable = OpenAPI_service_info_status_FromString(serv_inf_status->valuestring); } - cJSON *notif_uri = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "notifUri"); + notif_uri = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "notifUri"); if (!notif_uri) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [notif_uri]"); goto end; } - if (!cJSON_IsString(notif_uri)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [notif_uri]"); goto end; } - cJSON *serv_urn = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "servUrn"); - + serv_urn = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "servUrn"); if (serv_urn) { - if (!cJSON_IsString(serv_urn)) { + if (!cJSON_IsString(serv_urn) && !cJSON_IsNull(serv_urn)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [serv_urn]"); goto end; } } - cJSON *slice_info = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sliceInfo"); - - OpenAPI_snssai_t *slice_info_local_nonprim = NULL; + slice_info = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sliceInfo"); if (slice_info) { slice_info_local_nonprim = OpenAPI_snssai_parseFromJSON(slice_info); } - cJSON *spon_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sponId"); - + spon_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sponId"); if (spon_id) { - if (!cJSON_IsString(spon_id)) { + if (!cJSON_IsString(spon_id) && !cJSON_IsNull(spon_id)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [spon_id]"); goto end; } } - cJSON *spon_status = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sponStatus"); - - OpenAPI_sponsoring_status_e spon_statusVariable; + spon_status = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sponStatus"); if (spon_status) { if (!cJSON_IsString(spon_status)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [spon_status]"); @@ -630,134 +728,120 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par spon_statusVariable = OpenAPI_sponsoring_status_FromString(spon_status->valuestring); } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "suppFeat"); + supp_feat = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "suppFeat"); if (!supp_feat) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [supp_feat]"); goto end; } - if (!cJSON_IsString(supp_feat)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [supp_feat]"); goto end; } - cJSON *ue_ipv4 = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueIpv4"); - + ue_ipv4 = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueIpv4"); if (ue_ipv4) { - if (!cJSON_IsString(ue_ipv4)) { + if (!cJSON_IsString(ue_ipv4) && !cJSON_IsNull(ue_ipv4)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [ue_ipv4]"); goto end; } } - cJSON *ue_ipv6 = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueIpv6"); - + ue_ipv6 = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueIpv6"); if (ue_ipv6) { - if (!cJSON_IsString(ue_ipv6)) { + if (!cJSON_IsString(ue_ipv6) && !cJSON_IsNull(ue_ipv6)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [ue_ipv6]"); goto end; } } - cJSON *ue_mac = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueMac"); - + ue_mac = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueMac"); if (ue_mac) { - if (!cJSON_IsString(ue_mac)) { + if (!cJSON_IsString(ue_mac) && !cJSON_IsNull(ue_mac)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [ue_mac]"); goto end; } } - cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnBridgeManCont"); - - OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnBridgeManCont"); if (tsn_bridge_man_cont) { tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont); } - cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnPortManContDstt"); - - OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnPortManContDstt"); if (tsn_port_man_cont_dstt) { tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt); } - cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnPortManContNwtts"); - - OpenAPI_list_t *tsn_port_man_cont_nwttsList; + tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnPortManContNwtts"); if (tsn_port_man_cont_nwtts) { - cJSON *tsn_port_man_cont_nwtts_local_nonprimitive; - if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){ - ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - - tsn_port_man_cont_nwttsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) { - if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) { + cJSON *tsn_port_man_cont_nwtts_local = NULL; + if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) { ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive); - if (!tsn_port_man_cont_nwttsItem) { - ogs_error("No tsn_port_man_cont_nwttsItem"); - OpenAPI_list_free(tsn_port_man_cont_nwttsList); - goto end; + tsn_port_man_cont_nwttsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) { + if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) { + ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; + } + OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local); + if (!tsn_port_man_cont_nwttsItem) { + ogs_error("No tsn_port_man_cont_nwttsItem"); + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + goto end; + } + OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); } - - OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); - } } app_session_context_req_data_local_var = OpenAPI_app_session_context_req_data_create ( - af_app_id ? ogs_strdup(af_app_id->valuestring) : NULL, - af_charg_id ? ogs_strdup(af_charg_id->valuestring) : NULL, + af_app_id && !cJSON_IsNull(af_app_id) ? ogs_strdup(af_app_id->valuestring) : NULL, + af_charg_id && !cJSON_IsNull(af_charg_id) ? ogs_strdup(af_charg_id->valuestring) : NULL, af_req_data ? af_req_dataVariable : 0, af_rout_req ? af_rout_req_local_nonprim : NULL, - asp_id ? ogs_strdup(asp_id->valuestring) : NULL, - bdt_ref_id ? ogs_strdup(bdt_ref_id->valuestring) : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + asp_id && !cJSON_IsNull(asp_id) ? ogs_strdup(asp_id->valuestring) : NULL, + bdt_ref_id && !cJSON_IsNull(bdt_ref_id) ? ogs_strdup(bdt_ref_id->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, ev_subsc ? ev_subsc_local_nonprim : NULL, - mcptt_id ? ogs_strdup(mcptt_id->valuestring) : NULL, - mc_video_id ? ogs_strdup(mc_video_id->valuestring) : NULL, + mcptt_id && !cJSON_IsNull(mcptt_id) ? ogs_strdup(mcptt_id->valuestring) : NULL, + mc_video_id && !cJSON_IsNull(mc_video_id) ? ogs_strdup(mc_video_id->valuestring) : NULL, med_components ? med_componentsList : NULL, - ip_domain ? ogs_strdup(ip_domain->valuestring) : NULL, - mps_id ? ogs_strdup(mps_id->valuestring) : NULL, - mcs_id ? ogs_strdup(mcs_id->valuestring) : NULL, + ip_domain && !cJSON_IsNull(ip_domain) ? ogs_strdup(ip_domain->valuestring) : NULL, + mps_id && !cJSON_IsNull(mps_id) ? ogs_strdup(mps_id->valuestring) : NULL, + mcs_id && !cJSON_IsNull(mcs_id) ? ogs_strdup(mcs_id->valuestring) : NULL, preempt_control_info ? preempt_control_infoVariable : 0, res_prio ? res_prioVariable : 0, serv_inf_status ? serv_inf_statusVariable : 0, ogs_strdup(notif_uri->valuestring), - serv_urn ? ogs_strdup(serv_urn->valuestring) : NULL, + serv_urn && !cJSON_IsNull(serv_urn) ? ogs_strdup(serv_urn->valuestring) : NULL, slice_info ? slice_info_local_nonprim : NULL, - spon_id ? ogs_strdup(spon_id->valuestring) : NULL, + spon_id && !cJSON_IsNull(spon_id) ? ogs_strdup(spon_id->valuestring) : NULL, spon_status ? spon_statusVariable : 0, - supi ? ogs_strdup(supi->valuestring) : NULL, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, ogs_strdup(supp_feat->valuestring), - ue_ipv4 ? ogs_strdup(ue_ipv4->valuestring) : NULL, - ue_ipv6 ? ogs_strdup(ue_ipv6->valuestring) : NULL, - ue_mac ? ogs_strdup(ue_mac->valuestring) : NULL, + ue_ipv4 && !cJSON_IsNull(ue_ipv4) ? ogs_strdup(ue_ipv4->valuestring) : NULL, + ue_ipv6 && !cJSON_IsNull(ue_ipv6) ? ogs_strdup(ue_ipv6->valuestring) : NULL, + ue_mac && !cJSON_IsNull(ue_mac) ? ogs_strdup(ue_mac->valuestring) : NULL, tsn_bridge_man_cont ? tsn_bridge_man_cont_local_nonprim : NULL, tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL, tsn_port_man_cont_nwtts ? tsn_port_man_cont_nwttsList : NULL @@ -765,6 +849,43 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par return app_session_context_req_data_local_var; end: + if (af_rout_req_local_nonprim) { + OpenAPI_af_routing_requirement_free(af_rout_req_local_nonprim); + af_rout_req_local_nonprim = NULL; + } + if (ev_subsc_local_nonprim) { + OpenAPI_events_subsc_req_data_free(ev_subsc_local_nonprim); + ev_subsc_local_nonprim = NULL; + } + if (med_componentsList) { + OpenAPI_list_for_each(med_componentsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_component_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(med_componentsList); + med_componentsList = NULL; + } + if (slice_info_local_nonprim) { + OpenAPI_snssai_free(slice_info_local_nonprim); + slice_info_local_nonprim = NULL; + } + if (tsn_bridge_man_cont_local_nonprim) { + OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim); + tsn_bridge_man_cont_local_nonprim = NULL; + } + if (tsn_port_man_cont_dstt_local_nonprim) { + OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim); + tsn_port_man_cont_dstt_local_nonprim = NULL; + } + if (tsn_port_man_cont_nwttsList) { + OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + tsn_port_man_cont_nwttsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/app_session_context_resp_data.c b/lib/sbi/openapi/model/app_session_context_resp_data.c index 19f5522c4..111da488b 100644 --- a/lib/sbi/openapi/model/app_session_context_resp_data.c +++ b/lib/sbi/openapi/model/app_session_context_resp_data.c @@ -22,21 +22,29 @@ OpenAPI_app_session_context_resp_data_t *OpenAPI_app_session_context_resp_data_c void OpenAPI_app_session_context_resp_data_free(OpenAPI_app_session_context_resp_data_t *app_session_context_resp_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == app_session_context_resp_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(app_session_context_resp_data->ue_ids, node) { - OpenAPI_ue_identity_info_free(node->data); + if (app_session_context_resp_data->ue_ids) { + OpenAPI_list_for_each(app_session_context_resp_data->ue_ids, node) { + OpenAPI_ue_identity_info_free(node->data); + } + OpenAPI_list_free(app_session_context_resp_data->ue_ids); + app_session_context_resp_data->ue_ids = NULL; + } + if (app_session_context_resp_data->supp_feat) { + ogs_free(app_session_context_resp_data->supp_feat); + app_session_context_resp_data->supp_feat = NULL; } - OpenAPI_list_free(app_session_context_resp_data->ue_ids); - ogs_free(app_session_context_resp_data->supp_feat); ogs_free(app_session_context_resp_data); } cJSON *OpenAPI_app_session_context_resp_data_convertToJSON(OpenAPI_app_session_context_resp_data_t *app_session_context_resp_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (app_session_context_resp_data == NULL) { ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [AppSessionContextRespData]"); @@ -44,7 +52,7 @@ cJSON *OpenAPI_app_session_context_resp_data_convertToJSON(OpenAPI_app_session_c } item = cJSON_CreateObject(); - if (app_session_context_resp_data->serv_auth_info) { + if (app_session_context_resp_data->serv_auth_info != OpenAPI_serv_auth_info_NULL) { if (cJSON_AddStringToObject(item, "servAuthInfo", OpenAPI_serv_auth_info_ToString(app_session_context_resp_data->serv_auth_info)) == NULL) { ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [serv_auth_info]"); goto end; @@ -57,17 +65,13 @@ cJSON *OpenAPI_app_session_context_resp_data_convertToJSON(OpenAPI_app_session_c ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [ue_ids]"); goto end; } - - OpenAPI_lnode_t *ue_ids_node; - if (app_session_context_resp_data->ue_ids) { - OpenAPI_list_for_each(app_session_context_resp_data->ue_ids, ue_ids_node) { - cJSON *itemLocal = OpenAPI_ue_identity_info_convertToJSON(ue_ids_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [ue_ids]"); - goto end; - } - cJSON_AddItemToArray(ue_idsList, itemLocal); + OpenAPI_list_for_each(app_session_context_resp_data->ue_ids, node) { + cJSON *itemLocal = OpenAPI_ue_identity_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [ue_ids]"); + goto end; } + cJSON_AddItemToArray(ue_idsList, itemLocal); } } @@ -85,9 +89,13 @@ end: OpenAPI_app_session_context_resp_data_t *OpenAPI_app_session_context_resp_data_parseFromJSON(cJSON *app_session_context_resp_dataJSON) { OpenAPI_app_session_context_resp_data_t *app_session_context_resp_data_local_var = NULL; - cJSON *serv_auth_info = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "servAuthInfo"); - - OpenAPI_serv_auth_info_e serv_auth_infoVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *serv_auth_info = NULL; + OpenAPI_serv_auth_info_e serv_auth_infoVariable = 0; + cJSON *ue_ids = NULL; + OpenAPI_list_t *ue_idsList = NULL; + cJSON *supp_feat = NULL; + serv_auth_info = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "servAuthInfo"); if (serv_auth_info) { if (!cJSON_IsString(serv_auth_info)) { ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [serv_auth_info]"); @@ -96,39 +104,34 @@ OpenAPI_app_session_context_resp_data_t *OpenAPI_app_session_context_resp_data_p serv_auth_infoVariable = OpenAPI_serv_auth_info_FromString(serv_auth_info->valuestring); } - cJSON *ue_ids = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "ueIds"); - - OpenAPI_list_t *ue_idsList; + ue_ids = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "ueIds"); if (ue_ids) { - cJSON *ue_ids_local_nonprimitive; - if (!cJSON_IsArray(ue_ids)){ - ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [ue_ids]"); - goto end; - } - - ue_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ue_ids_local_nonprimitive, ue_ids ) { - if (!cJSON_IsObject(ue_ids_local_nonprimitive)) { + cJSON *ue_ids_local = NULL; + if (!cJSON_IsArray(ue_ids)) { ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [ue_ids]"); goto end; } - OpenAPI_ue_identity_info_t *ue_idsItem = OpenAPI_ue_identity_info_parseFromJSON(ue_ids_local_nonprimitive); - if (!ue_idsItem) { - ogs_error("No ue_idsItem"); - OpenAPI_list_free(ue_idsList); - goto end; + ue_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_ids_local, ue_ids) { + if (!cJSON_IsObject(ue_ids_local)) { + ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [ue_ids]"); + goto end; + } + OpenAPI_ue_identity_info_t *ue_idsItem = OpenAPI_ue_identity_info_parseFromJSON(ue_ids_local); + if (!ue_idsItem) { + ogs_error("No ue_idsItem"); + OpenAPI_list_free(ue_idsList); + goto end; + } + OpenAPI_list_add(ue_idsList, ue_idsItem); } - - OpenAPI_list_add(ue_idsList, ue_idsItem); - } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [supp_feat]"); goto end; } @@ -137,11 +140,18 @@ OpenAPI_app_session_context_resp_data_t *OpenAPI_app_session_context_resp_data_p app_session_context_resp_data_local_var = OpenAPI_app_session_context_resp_data_create ( serv_auth_info ? serv_auth_infoVariable : 0, ue_ids ? ue_idsList : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return app_session_context_resp_data_local_var; end: + if (ue_idsList) { + OpenAPI_list_for_each(ue_idsList, node) { + OpenAPI_ue_identity_info_free(node->data); + } + OpenAPI_list_free(ue_idsList); + ue_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/app_session_context_update_data.c b/lib/sbi/openapi/model/app_session_context_update_data.c index 2ba15eaed..30d0e9937 100644 --- a/lib/sbi/openapi/model/app_session_context_update_data.c +++ b/lib/sbi/openapi/model/app_session_context_update_data.c @@ -54,40 +54,87 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da void OpenAPI_app_session_context_update_data_free(OpenAPI_app_session_context_update_data_t *app_session_context_update_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == app_session_context_update_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(app_session_context_update_data->af_app_id); - OpenAPI_af_routing_requirement_rm_free(app_session_context_update_data->af_rout_req); - ogs_free(app_session_context_update_data->asp_id); - ogs_free(app_session_context_update_data->bdt_ref_id); - OpenAPI_events_subsc_req_data_rm_free(app_session_context_update_data->ev_subsc); - ogs_free(app_session_context_update_data->mcptt_id); - ogs_free(app_session_context_update_data->mc_video_id); - OpenAPI_list_for_each(app_session_context_update_data->med_components, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_media_component_rm_free(localKeyValue->value); - ogs_free(localKeyValue); + if (app_session_context_update_data->af_app_id) { + ogs_free(app_session_context_update_data->af_app_id); + app_session_context_update_data->af_app_id = NULL; } - OpenAPI_list_free(app_session_context_update_data->med_components); - ogs_free(app_session_context_update_data->mps_id); - ogs_free(app_session_context_update_data->mcs_id); - OpenAPI_preemption_control_information_rm_free(app_session_context_update_data->preempt_control_info); - ogs_free(app_session_context_update_data->spon_id); - OpenAPI_bridge_management_container_free(app_session_context_update_data->tsn_bridge_man_cont); - OpenAPI_port_management_container_free(app_session_context_update_data->tsn_port_man_cont_dstt); - OpenAPI_list_for_each(app_session_context_update_data->tsn_port_man_cont_nwtts, node) { - OpenAPI_port_management_container_free(node->data); + if (app_session_context_update_data->af_rout_req) { + OpenAPI_af_routing_requirement_rm_free(app_session_context_update_data->af_rout_req); + app_session_context_update_data->af_rout_req = NULL; + } + if (app_session_context_update_data->asp_id) { + ogs_free(app_session_context_update_data->asp_id); + app_session_context_update_data->asp_id = NULL; + } + if (app_session_context_update_data->bdt_ref_id) { + ogs_free(app_session_context_update_data->bdt_ref_id); + app_session_context_update_data->bdt_ref_id = NULL; + } + if (app_session_context_update_data->ev_subsc) { + OpenAPI_events_subsc_req_data_rm_free(app_session_context_update_data->ev_subsc); + app_session_context_update_data->ev_subsc = NULL; + } + if (app_session_context_update_data->mcptt_id) { + ogs_free(app_session_context_update_data->mcptt_id); + app_session_context_update_data->mcptt_id = NULL; + } + if (app_session_context_update_data->mc_video_id) { + ogs_free(app_session_context_update_data->mc_video_id); + app_session_context_update_data->mc_video_id = NULL; + } + if (app_session_context_update_data->med_components) { + OpenAPI_list_for_each(app_session_context_update_data->med_components, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_component_rm_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(app_session_context_update_data->med_components); + app_session_context_update_data->med_components = NULL; + } + if (app_session_context_update_data->mps_id) { + ogs_free(app_session_context_update_data->mps_id); + app_session_context_update_data->mps_id = NULL; + } + if (app_session_context_update_data->mcs_id) { + ogs_free(app_session_context_update_data->mcs_id); + app_session_context_update_data->mcs_id = NULL; + } + if (app_session_context_update_data->preempt_control_info) { + OpenAPI_preemption_control_information_rm_free(app_session_context_update_data->preempt_control_info); + app_session_context_update_data->preempt_control_info = NULL; + } + if (app_session_context_update_data->spon_id) { + ogs_free(app_session_context_update_data->spon_id); + app_session_context_update_data->spon_id = NULL; + } + if (app_session_context_update_data->tsn_bridge_man_cont) { + OpenAPI_bridge_management_container_free(app_session_context_update_data->tsn_bridge_man_cont); + app_session_context_update_data->tsn_bridge_man_cont = NULL; + } + if (app_session_context_update_data->tsn_port_man_cont_dstt) { + OpenAPI_port_management_container_free(app_session_context_update_data->tsn_port_man_cont_dstt); + app_session_context_update_data->tsn_port_man_cont_dstt = NULL; + } + if (app_session_context_update_data->tsn_port_man_cont_nwtts) { + OpenAPI_list_for_each(app_session_context_update_data->tsn_port_man_cont_nwtts, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(app_session_context_update_data->tsn_port_man_cont_nwtts); + app_session_context_update_data->tsn_port_man_cont_nwtts = NULL; } - OpenAPI_list_free(app_session_context_update_data->tsn_port_man_cont_nwtts); ogs_free(app_session_context_update_data); } cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session_context_update_data_t *app_session_context_update_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (app_session_context_update_data == NULL) { ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [AppSessionContextUpdateData]"); @@ -163,21 +210,20 @@ cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session goto end; } cJSON *localMapObject = med_components; - OpenAPI_lnode_t *med_components_node; if (app_session_context_update_data->med_components) { - OpenAPI_list_for_each(app_session_context_update_data->med_components, med_components_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)med_components_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_media_component_rm_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(app_session_context_update_data->med_components, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_media_component_rm_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (app_session_context_update_data->mps_id) { if (cJSON_AddStringToObject(item, "mpsId", app_session_context_update_data->mps_id) == NULL) { @@ -206,21 +252,21 @@ cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session } } - if (app_session_context_update_data->res_prio) { + if (app_session_context_update_data->res_prio != OpenAPI_reserv_priority_NULL) { if (cJSON_AddStringToObject(item, "resPrio", OpenAPI_reserv_priority_ToString(app_session_context_update_data->res_prio)) == NULL) { ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [res_prio]"); goto end; } } - if (app_session_context_update_data->serv_inf_status) { + if (app_session_context_update_data->serv_inf_status != OpenAPI_service_info_status_NULL) { if (cJSON_AddStringToObject(item, "servInfStatus", OpenAPI_service_info_status_ToString(app_session_context_update_data->serv_inf_status)) == NULL) { ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [serv_inf_status]"); goto end; } } - if (app_session_context_update_data->sip_fork_ind) { + if (app_session_context_update_data->sip_fork_ind != OpenAPI_sip_forking_indication_NULL) { if (cJSON_AddStringToObject(item, "sipForkInd", OpenAPI_sip_forking_indication_ToString(app_session_context_update_data->sip_fork_ind)) == NULL) { ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [sip_fork_ind]"); goto end; @@ -234,7 +280,7 @@ cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session } } - if (app_session_context_update_data->spon_status) { + if (app_session_context_update_data->spon_status != OpenAPI_sponsoring_status_NULL) { if (cJSON_AddStringToObject(item, "sponStatus", OpenAPI_sponsoring_status_ToString(app_session_context_update_data->spon_status)) == NULL) { ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [spon_status]"); goto end; @@ -273,17 +319,13 @@ cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - - OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node; - if (app_session_context_update_data->tsn_port_man_cont_nwtts) { - OpenAPI_list_for_each(app_session_context_update_data->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) { - cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); + OpenAPI_list_for_each(app_session_context_update_data->tsn_port_man_cont_nwtts, node) { + cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; } + cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); } } @@ -294,119 +336,135 @@ end: OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_data_parseFromJSON(cJSON *app_session_context_update_dataJSON) { OpenAPI_app_session_context_update_data_t *app_session_context_update_data_local_var = NULL; - cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "afAppId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *af_app_id = NULL; + cJSON *af_rout_req = NULL; + OpenAPI_af_routing_requirement_rm_t *af_rout_req_local_nonprim = NULL; + cJSON *asp_id = NULL; + cJSON *bdt_ref_id = NULL; + cJSON *ev_subsc = NULL; + OpenAPI_events_subsc_req_data_rm_t *ev_subsc_local_nonprim = NULL; + cJSON *mcptt_id = NULL; + cJSON *mc_video_id = NULL; + cJSON *med_components = NULL; + OpenAPI_list_t *med_componentsList = NULL; + cJSON *mps_id = NULL; + cJSON *mcs_id = NULL; + cJSON *preempt_control_info = NULL; + OpenAPI_preemption_control_information_rm_t *preempt_control_info_local_nonprim = NULL; + cJSON *res_prio = NULL; + OpenAPI_reserv_priority_e res_prioVariable = 0; + cJSON *serv_inf_status = NULL; + OpenAPI_service_info_status_e serv_inf_statusVariable = 0; + cJSON *sip_fork_ind = NULL; + OpenAPI_sip_forking_indication_e sip_fork_indVariable = 0; + cJSON *spon_id = NULL; + cJSON *spon_status = NULL; + OpenAPI_sponsoring_status_e spon_statusVariable = 0; + cJSON *tsn_bridge_man_cont = NULL; + OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + cJSON *tsn_port_man_cont_dstt = NULL; + OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + cJSON *tsn_port_man_cont_nwtts = NULL; + OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL; + af_app_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "afAppId"); if (af_app_id) { - if (!cJSON_IsString(af_app_id)) { + if (!cJSON_IsString(af_app_id) && !cJSON_IsNull(af_app_id)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [af_app_id]"); goto end; } } - cJSON *af_rout_req = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "afRoutReq"); - - OpenAPI_af_routing_requirement_rm_t *af_rout_req_local_nonprim = NULL; + af_rout_req = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "afRoutReq"); if (af_rout_req) { af_rout_req_local_nonprim = OpenAPI_af_routing_requirement_rm_parseFromJSON(af_rout_req); } - cJSON *asp_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "aspId"); - + asp_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "aspId"); if (asp_id) { - if (!cJSON_IsString(asp_id)) { + if (!cJSON_IsString(asp_id) && !cJSON_IsNull(asp_id)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [asp_id]"); goto end; } } - cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "bdtRefId"); - + bdt_ref_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "bdtRefId"); if (bdt_ref_id) { - if (!cJSON_IsString(bdt_ref_id)) { + if (!cJSON_IsString(bdt_ref_id) && !cJSON_IsNull(bdt_ref_id)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [bdt_ref_id]"); goto end; } } - cJSON *ev_subsc = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "evSubsc"); - - OpenAPI_events_subsc_req_data_rm_t *ev_subsc_local_nonprim = NULL; + ev_subsc = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "evSubsc"); if (ev_subsc) { ev_subsc_local_nonprim = OpenAPI_events_subsc_req_data_rm_parseFromJSON(ev_subsc); } - cJSON *mcptt_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcpttId"); - + mcptt_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcpttId"); if (mcptt_id) { - if (!cJSON_IsString(mcptt_id)) { + if (!cJSON_IsString(mcptt_id) && !cJSON_IsNull(mcptt_id)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [mcptt_id]"); goto end; } } - cJSON *mc_video_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcVideoId"); - + mc_video_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcVideoId"); if (mc_video_id) { - if (!cJSON_IsString(mc_video_id)) { + if (!cJSON_IsString(mc_video_id) && !cJSON_IsNull(mc_video_id)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [mc_video_id]"); goto end; } } - cJSON *med_components = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "medComponents"); - - OpenAPI_list_t *med_componentsList; + med_components = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "medComponents"); if (med_components) { - cJSON *med_components_local_map; - if (!cJSON_IsObject(med_components)) { - ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [med_components]"); - goto end; - } - med_componentsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(med_components_local_map, med_components) { - cJSON *localMapObject = med_components_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_media_component_rm_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [inner]"); + cJSON *med_components_local_map = NULL; + if (!cJSON_IsObject(med_components) && !cJSON_IsNull(med_components)) { + ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [med_components]"); goto end; } - OpenAPI_list_add(med_componentsList, localMapKeyPair); - } + if (cJSON_IsObject(med_components)) { + med_componentsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(med_components_local_map, med_components) { + cJSON *localMapObject = med_components_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_media_component_rm_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(med_componentsList, localMapKeyPair); + } + } } - cJSON *mps_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mpsId"); - + mps_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mpsId"); if (mps_id) { - if (!cJSON_IsString(mps_id)) { + if (!cJSON_IsString(mps_id) && !cJSON_IsNull(mps_id)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [mps_id]"); goto end; } } - cJSON *mcs_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcsId"); - + mcs_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcsId"); if (mcs_id) { - if (!cJSON_IsString(mcs_id)) { + if (!cJSON_IsString(mcs_id) && !cJSON_IsNull(mcs_id)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [mcs_id]"); goto end; } } - cJSON *preempt_control_info = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "preemptControlInfo"); - - OpenAPI_preemption_control_information_rm_t *preempt_control_info_local_nonprim = NULL; + preempt_control_info = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "preemptControlInfo"); if (preempt_control_info) { preempt_control_info_local_nonprim = OpenAPI_preemption_control_information_rm_parseFromJSON(preempt_control_info); } - cJSON *res_prio = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "resPrio"); - - OpenAPI_reserv_priority_e res_prioVariable; + res_prio = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "resPrio"); if (res_prio) { if (!cJSON_IsString(res_prio)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [res_prio]"); @@ -415,9 +473,7 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da res_prioVariable = OpenAPI_reserv_priority_FromString(res_prio->valuestring); } - cJSON *serv_inf_status = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "servInfStatus"); - - OpenAPI_service_info_status_e serv_inf_statusVariable; + serv_inf_status = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "servInfStatus"); if (serv_inf_status) { if (!cJSON_IsString(serv_inf_status)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [serv_inf_status]"); @@ -426,9 +482,7 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da serv_inf_statusVariable = OpenAPI_service_info_status_FromString(serv_inf_status->valuestring); } - cJSON *sip_fork_ind = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sipForkInd"); - - OpenAPI_sip_forking_indication_e sip_fork_indVariable; + sip_fork_ind = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sipForkInd"); if (sip_fork_ind) { if (!cJSON_IsString(sip_fork_ind)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [sip_fork_ind]"); @@ -437,18 +491,15 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da sip_fork_indVariable = OpenAPI_sip_forking_indication_FromString(sip_fork_ind->valuestring); } - cJSON *spon_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sponId"); - + spon_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sponId"); if (spon_id) { - if (!cJSON_IsString(spon_id)) { + if (!cJSON_IsString(spon_id) && !cJSON_IsNull(spon_id)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [spon_id]"); goto end; } } - cJSON *spon_status = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sponStatus"); - - OpenAPI_sponsoring_status_e spon_statusVariable; + spon_status = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sponStatus"); if (spon_status) { if (!cJSON_IsString(spon_status)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [spon_status]"); @@ -457,65 +508,57 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da spon_statusVariable = OpenAPI_sponsoring_status_FromString(spon_status->valuestring); } - cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnBridgeManCont"); - - OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnBridgeManCont"); if (tsn_bridge_man_cont) { tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont); } - cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnPortManContDstt"); - - OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnPortManContDstt"); if (tsn_port_man_cont_dstt) { tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt); } - cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnPortManContNwtts"); - - OpenAPI_list_t *tsn_port_man_cont_nwttsList; + tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnPortManContNwtts"); if (tsn_port_man_cont_nwtts) { - cJSON *tsn_port_man_cont_nwtts_local_nonprimitive; - if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){ - ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - - tsn_port_man_cont_nwttsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) { - if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) { + cJSON *tsn_port_man_cont_nwtts_local = NULL; + if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) { ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive); - if (!tsn_port_man_cont_nwttsItem) { - ogs_error("No tsn_port_man_cont_nwttsItem"); - OpenAPI_list_free(tsn_port_man_cont_nwttsList); - goto end; + tsn_port_man_cont_nwttsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) { + if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) { + ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; + } + OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local); + if (!tsn_port_man_cont_nwttsItem) { + ogs_error("No tsn_port_man_cont_nwttsItem"); + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + goto end; + } + OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); } - - OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); - } } app_session_context_update_data_local_var = OpenAPI_app_session_context_update_data_create ( - af_app_id ? ogs_strdup(af_app_id->valuestring) : NULL, + af_app_id && !cJSON_IsNull(af_app_id) ? ogs_strdup(af_app_id->valuestring) : NULL, af_rout_req ? af_rout_req_local_nonprim : NULL, - asp_id ? ogs_strdup(asp_id->valuestring) : NULL, - bdt_ref_id ? ogs_strdup(bdt_ref_id->valuestring) : NULL, + asp_id && !cJSON_IsNull(asp_id) ? ogs_strdup(asp_id->valuestring) : NULL, + bdt_ref_id && !cJSON_IsNull(bdt_ref_id) ? ogs_strdup(bdt_ref_id->valuestring) : NULL, ev_subsc ? ev_subsc_local_nonprim : NULL, - mcptt_id ? ogs_strdup(mcptt_id->valuestring) : NULL, - mc_video_id ? ogs_strdup(mc_video_id->valuestring) : NULL, + mcptt_id && !cJSON_IsNull(mcptt_id) ? ogs_strdup(mcptt_id->valuestring) : NULL, + mc_video_id && !cJSON_IsNull(mc_video_id) ? ogs_strdup(mc_video_id->valuestring) : NULL, med_components ? med_componentsList : NULL, - mps_id ? ogs_strdup(mps_id->valuestring) : NULL, - mcs_id ? ogs_strdup(mcs_id->valuestring) : NULL, + mps_id && !cJSON_IsNull(mps_id) ? ogs_strdup(mps_id->valuestring) : NULL, + mcs_id && !cJSON_IsNull(mcs_id) ? ogs_strdup(mcs_id->valuestring) : NULL, preempt_control_info ? preempt_control_info_local_nonprim : NULL, res_prio ? res_prioVariable : 0, serv_inf_status ? serv_inf_statusVariable : 0, sip_fork_ind ? sip_fork_indVariable : 0, - spon_id ? ogs_strdup(spon_id->valuestring) : NULL, + spon_id && !cJSON_IsNull(spon_id) ? ogs_strdup(spon_id->valuestring) : NULL, spon_status ? spon_statusVariable : 0, tsn_bridge_man_cont ? tsn_bridge_man_cont_local_nonprim : NULL, tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL, @@ -524,6 +567,43 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da return app_session_context_update_data_local_var; end: + if (af_rout_req_local_nonprim) { + OpenAPI_af_routing_requirement_rm_free(af_rout_req_local_nonprim); + af_rout_req_local_nonprim = NULL; + } + if (ev_subsc_local_nonprim) { + OpenAPI_events_subsc_req_data_rm_free(ev_subsc_local_nonprim); + ev_subsc_local_nonprim = NULL; + } + if (med_componentsList) { + OpenAPI_list_for_each(med_componentsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_component_rm_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(med_componentsList); + med_componentsList = NULL; + } + if (preempt_control_info_local_nonprim) { + OpenAPI_preemption_control_information_rm_free(preempt_control_info_local_nonprim); + preempt_control_info_local_nonprim = NULL; + } + if (tsn_bridge_man_cont_local_nonprim) { + OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim); + tsn_bridge_man_cont_local_nonprim = NULL; + } + if (tsn_port_man_cont_dstt_local_nonprim) { + OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim); + tsn_port_man_cont_dstt_local_nonprim = NULL; + } + if (tsn_port_man_cont_nwttsList) { + OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + tsn_port_man_cont_nwttsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/app_session_context_update_data_patch.c b/lib/sbi/openapi/model/app_session_context_update_data_patch.c index ab21acdab..9471391c0 100644 --- a/lib/sbi/openapi/model/app_session_context_update_data_patch.c +++ b/lib/sbi/openapi/model/app_session_context_update_data_patch.c @@ -18,17 +18,22 @@ OpenAPI_app_session_context_update_data_patch_t *OpenAPI_app_session_context_upd void OpenAPI_app_session_context_update_data_patch_free(OpenAPI_app_session_context_update_data_patch_t *app_session_context_update_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == app_session_context_update_data_patch) { return; } - OpenAPI_lnode_t *node; - OpenAPI_app_session_context_update_data_free(app_session_context_update_data_patch->asc_req_data); + if (app_session_context_update_data_patch->asc_req_data) { + OpenAPI_app_session_context_update_data_free(app_session_context_update_data_patch->asc_req_data); + app_session_context_update_data_patch->asc_req_data = NULL; + } ogs_free(app_session_context_update_data_patch); } cJSON *OpenAPI_app_session_context_update_data_patch_convertToJSON(OpenAPI_app_session_context_update_data_patch_t *app_session_context_update_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (app_session_context_update_data_patch == NULL) { ogs_error("OpenAPI_app_session_context_update_data_patch_convertToJSON() failed [AppSessionContextUpdateDataPatch]"); @@ -56,9 +61,10 @@ end: OpenAPI_app_session_context_update_data_patch_t *OpenAPI_app_session_context_update_data_patch_parseFromJSON(cJSON *app_session_context_update_data_patchJSON) { OpenAPI_app_session_context_update_data_patch_t *app_session_context_update_data_patch_local_var = NULL; - cJSON *asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_context_update_data_patchJSON, "ascReqData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *asc_req_data = NULL; OpenAPI_app_session_context_update_data_t *asc_req_data_local_nonprim = NULL; + asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_context_update_data_patchJSON, "ascReqData"); if (asc_req_data) { asc_req_data_local_nonprim = OpenAPI_app_session_context_update_data_parseFromJSON(asc_req_data); } @@ -69,6 +75,10 @@ OpenAPI_app_session_context_update_data_patch_t *OpenAPI_app_session_context_upd return app_session_context_update_data_patch_local_var; end: + if (asc_req_data_local_nonprim) { + OpenAPI_app_session_context_update_data_free(asc_req_data_local_nonprim); + asc_req_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/application_data_change_notif.c b/lib/sbi/openapi/model/application_data_change_notif.c index fc6dadfc1..48336e533 100644 --- a/lib/sbi/openapi/model/application_data_change_notif.c +++ b/lib/sbi/openapi/model/application_data_change_notif.c @@ -26,21 +26,38 @@ OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_c void OpenAPI_application_data_change_notif_free(OpenAPI_application_data_change_notif_t *application_data_change_notif) { + OpenAPI_lnode_t *node = NULL; + if (NULL == application_data_change_notif) { return; } - OpenAPI_lnode_t *node; - OpenAPI_iptv_config_data_free(application_data_change_notif->iptv_config_data); - OpenAPI_pfd_change_notification_free(application_data_change_notif->pfd_data); - OpenAPI_bdt_policy_data_free(application_data_change_notif->bdt_policy_data); - ogs_free(application_data_change_notif->res_uri); - OpenAPI_service_parameter_data_free(application_data_change_notif->ser_param_data); + if (application_data_change_notif->iptv_config_data) { + OpenAPI_iptv_config_data_free(application_data_change_notif->iptv_config_data); + application_data_change_notif->iptv_config_data = NULL; + } + if (application_data_change_notif->pfd_data) { + OpenAPI_pfd_change_notification_free(application_data_change_notif->pfd_data); + application_data_change_notif->pfd_data = NULL; + } + if (application_data_change_notif->bdt_policy_data) { + OpenAPI_bdt_policy_data_free(application_data_change_notif->bdt_policy_data); + application_data_change_notif->bdt_policy_data = NULL; + } + if (application_data_change_notif->res_uri) { + ogs_free(application_data_change_notif->res_uri); + application_data_change_notif->res_uri = NULL; + } + if (application_data_change_notif->ser_param_data) { + OpenAPI_service_parameter_data_free(application_data_change_notif->ser_param_data); + application_data_change_notif->ser_param_data = NULL; + } ogs_free(application_data_change_notif); } cJSON *OpenAPI_application_data_change_notif_convertToJSON(OpenAPI_application_data_change_notif_t *application_data_change_notif) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (application_data_change_notif == NULL) { ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [ApplicationDataChangeNotif]"); @@ -87,6 +104,10 @@ cJSON *OpenAPI_application_data_change_notif_convertToJSON(OpenAPI_application_d } } + if (!application_data_change_notif->res_uri) { + ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [res_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resUri", application_data_change_notif->res_uri) == NULL) { ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [res_uri]"); goto end; @@ -112,41 +133,42 @@ end: OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_parseFromJSON(cJSON *application_data_change_notifJSON) { OpenAPI_application_data_change_notif_t *application_data_change_notif_local_var = NULL; - cJSON *iptv_config_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "iptvConfigData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *iptv_config_data = NULL; OpenAPI_iptv_config_data_t *iptv_config_data_local_nonprim = NULL; + cJSON *pfd_data = NULL; + OpenAPI_pfd_change_notification_t *pfd_data_local_nonprim = NULL; + cJSON *bdt_policy_data = NULL; + OpenAPI_bdt_policy_data_t *bdt_policy_data_local_nonprim = NULL; + cJSON *res_uri = NULL; + cJSON *ser_param_data = NULL; + OpenAPI_service_parameter_data_t *ser_param_data_local_nonprim = NULL; + iptv_config_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "iptvConfigData"); if (iptv_config_data) { iptv_config_data_local_nonprim = OpenAPI_iptv_config_data_parseFromJSON(iptv_config_data); } - cJSON *pfd_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "pfdData"); - - OpenAPI_pfd_change_notification_t *pfd_data_local_nonprim = NULL; + pfd_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "pfdData"); if (pfd_data) { pfd_data_local_nonprim = OpenAPI_pfd_change_notification_parseFromJSON(pfd_data); } - cJSON *bdt_policy_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "bdtPolicyData"); - - OpenAPI_bdt_policy_data_t *bdt_policy_data_local_nonprim = NULL; + bdt_policy_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "bdtPolicyData"); if (bdt_policy_data) { bdt_policy_data_local_nonprim = OpenAPI_bdt_policy_data_parseFromJSON(bdt_policy_data); } - cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "resUri"); + res_uri = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "resUri"); if (!res_uri) { ogs_error("OpenAPI_application_data_change_notif_parseFromJSON() failed [res_uri]"); goto end; } - if (!cJSON_IsString(res_uri)) { ogs_error("OpenAPI_application_data_change_notif_parseFromJSON() failed [res_uri]"); goto end; } - cJSON *ser_param_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "serParamData"); - - OpenAPI_service_parameter_data_t *ser_param_data_local_nonprim = NULL; + ser_param_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "serParamData"); if (ser_param_data) { ser_param_data_local_nonprim = OpenAPI_service_parameter_data_parseFromJSON(ser_param_data); } @@ -161,6 +183,22 @@ OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_p return application_data_change_notif_local_var; end: + if (iptv_config_data_local_nonprim) { + OpenAPI_iptv_config_data_free(iptv_config_data_local_nonprim); + iptv_config_data_local_nonprim = NULL; + } + if (pfd_data_local_nonprim) { + OpenAPI_pfd_change_notification_free(pfd_data_local_nonprim); + pfd_data_local_nonprim = NULL; + } + if (bdt_policy_data_local_nonprim) { + OpenAPI_bdt_policy_data_free(bdt_policy_data_local_nonprim); + bdt_policy_data_local_nonprim = NULL; + } + if (ser_param_data_local_nonprim) { + OpenAPI_service_parameter_data_free(ser_param_data_local_nonprim); + ser_param_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/application_data_subs.c b/lib/sbi/openapi/model/application_data_subs.c index c8f462016..3e95f4a77 100644 --- a/lib/sbi/openapi/model/application_data_subs.c +++ b/lib/sbi/openapi/model/application_data_subs.c @@ -24,23 +24,37 @@ OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_create( void OpenAPI_application_data_subs_free(OpenAPI_application_data_subs_t *application_data_subs) { + OpenAPI_lnode_t *node = NULL; + if (NULL == application_data_subs) { return; } - OpenAPI_lnode_t *node; - ogs_free(application_data_subs->notification_uri); - OpenAPI_list_for_each(application_data_subs->data_filters, node) { - OpenAPI_data_filter_free(node->data); + if (application_data_subs->notification_uri) { + ogs_free(application_data_subs->notification_uri); + application_data_subs->notification_uri = NULL; + } + if (application_data_subs->data_filters) { + OpenAPI_list_for_each(application_data_subs->data_filters, node) { + OpenAPI_data_filter_free(node->data); + } + OpenAPI_list_free(application_data_subs->data_filters); + application_data_subs->data_filters = NULL; + } + if (application_data_subs->expiry) { + ogs_free(application_data_subs->expiry); + application_data_subs->expiry = NULL; + } + if (application_data_subs->supported_features) { + ogs_free(application_data_subs->supported_features); + application_data_subs->supported_features = NULL; } - OpenAPI_list_free(application_data_subs->data_filters); - ogs_free(application_data_subs->expiry); - ogs_free(application_data_subs->supported_features); ogs_free(application_data_subs); } cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs_t *application_data_subs) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (application_data_subs == NULL) { ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [ApplicationDataSubs]"); @@ -48,6 +62,10 @@ cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs } item = cJSON_CreateObject(); + if (!application_data_subs->notification_uri) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [notification_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationUri", application_data_subs->notification_uri) == NULL) { ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [notification_uri]"); goto end; @@ -59,17 +77,13 @@ cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [data_filters]"); goto end; } - - OpenAPI_lnode_t *data_filters_node; - if (application_data_subs->data_filters) { - OpenAPI_list_for_each(application_data_subs->data_filters, data_filters_node) { - cJSON *itemLocal = OpenAPI_data_filter_convertToJSON(data_filters_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [data_filters]"); - goto end; - } - cJSON_AddItemToArray(data_filtersList, itemLocal); + OpenAPI_list_for_each(application_data_subs->data_filters, node) { + cJSON *itemLocal = OpenAPI_data_filter_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [data_filters]"); + goto end; } + cJSON_AddItemToArray(data_filtersList, itemLocal); } } @@ -94,59 +108,58 @@ end: OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_parseFromJSON(cJSON *application_data_subsJSON) { OpenAPI_application_data_subs_t *application_data_subs_local_var = NULL; - cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "notificationUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *notification_uri = NULL; + cJSON *data_filters = NULL; + OpenAPI_list_t *data_filtersList = NULL; + cJSON *expiry = NULL; + cJSON *supported_features = NULL; + notification_uri = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "notificationUri"); if (!notification_uri) { ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [notification_uri]"); goto end; } - if (!cJSON_IsString(notification_uri)) { ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [notification_uri]"); goto end; } - cJSON *data_filters = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "dataFilters"); - - OpenAPI_list_t *data_filtersList; + data_filters = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "dataFilters"); if (data_filters) { - cJSON *data_filters_local_nonprimitive; - if (!cJSON_IsArray(data_filters)){ - ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [data_filters]"); - goto end; - } - - data_filtersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(data_filters_local_nonprimitive, data_filters ) { - if (!cJSON_IsObject(data_filters_local_nonprimitive)) { + cJSON *data_filters_local = NULL; + if (!cJSON_IsArray(data_filters)) { ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [data_filters]"); goto end; } - OpenAPI_data_filter_t *data_filtersItem = OpenAPI_data_filter_parseFromJSON(data_filters_local_nonprimitive); - if (!data_filtersItem) { - ogs_error("No data_filtersItem"); - OpenAPI_list_free(data_filtersList); - goto end; + data_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(data_filters_local, data_filters) { + if (!cJSON_IsObject(data_filters_local)) { + ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [data_filters]"); + goto end; + } + OpenAPI_data_filter_t *data_filtersItem = OpenAPI_data_filter_parseFromJSON(data_filters_local); + if (!data_filtersItem) { + ogs_error("No data_filtersItem"); + OpenAPI_list_free(data_filtersList); + goto end; + } + OpenAPI_list_add(data_filtersList, data_filtersItem); } - - OpenAPI_list_add(data_filtersList, data_filtersItem); - } } - cJSON *expiry = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "expiry"); - + expiry = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "expiry"); if (expiry) { - if (!cJSON_IsString(expiry)) { + if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) { ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [expiry]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [supported_features]"); goto end; } @@ -155,12 +168,19 @@ OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_parseFromJSON(cJS application_data_subs_local_var = OpenAPI_application_data_subs_create ( ogs_strdup(notification_uri->valuestring), data_filters ? data_filtersList : NULL, - expiry ? ogs_strdup(expiry->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return application_data_subs_local_var; end: + if (data_filtersList) { + OpenAPI_list_for_each(data_filtersList, node) { + OpenAPI_data_filter_free(node->data); + } + OpenAPI_list_free(data_filtersList); + data_filtersList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/area.c b/lib/sbi/openapi/model/area.c index b025b74ad..e451a3e82 100644 --- a/lib/sbi/openapi/model/area.c +++ b/lib/sbi/openapi/model/area.c @@ -20,21 +20,29 @@ OpenAPI_area_t *OpenAPI_area_create( void OpenAPI_area_free(OpenAPI_area_t *area) { + OpenAPI_lnode_t *node = NULL; + if (NULL == area) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(area->tacs, node) { - ogs_free(node->data); + if (area->tacs) { + OpenAPI_list_for_each(area->tacs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(area->tacs); + area->tacs = NULL; + } + if (area->area_code) { + ogs_free(area->area_code); + area->area_code = NULL; } - OpenAPI_list_free(area->tacs); - ogs_free(area->area_code); ogs_free(area); } cJSON *OpenAPI_area_convertToJSON(OpenAPI_area_t *area) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (area == NULL) { ogs_error("OpenAPI_area_convertToJSON() failed [Area]"); @@ -43,19 +51,17 @@ cJSON *OpenAPI_area_convertToJSON(OpenAPI_area_t *area) item = cJSON_CreateObject(); if (area->tacs) { - cJSON *tacs = cJSON_AddArrayToObject(item, "tacs"); - if (tacs == NULL) { + cJSON *tacsList = cJSON_AddArrayToObject(item, "tacs"); + if (tacsList == NULL) { ogs_error("OpenAPI_area_convertToJSON() failed [tacs]"); goto end; } - - OpenAPI_lnode_t *tacs_node; - OpenAPI_list_for_each(area->tacs, tacs_node) { - if (cJSON_AddStringToObject(tacs, "", (char*)tacs_node->data) == NULL) { - ogs_error("OpenAPI_area_convertToJSON() failed [tacs]"); - goto end; + OpenAPI_list_for_each(area->tacs, node) { + if (cJSON_AddStringToObject(tacsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_area_convertToJSON() failed [tacs]"); + goto end; + } } - } } if (area->area_code) { @@ -72,30 +78,34 @@ end: OpenAPI_area_t *OpenAPI_area_parseFromJSON(cJSON *areaJSON) { OpenAPI_area_t *area_local_var = NULL; - cJSON *tacs = cJSON_GetObjectItemCaseSensitive(areaJSON, "tacs"); - - OpenAPI_list_t *tacsList; + OpenAPI_lnode_t *node = NULL; + cJSON *tacs = NULL; + OpenAPI_list_t *tacsList = NULL; + cJSON *area_code = NULL; + tacs = cJSON_GetObjectItemCaseSensitive(areaJSON, "tacs"); if (tacs) { - cJSON *tacs_local; - if (!cJSON_IsArray(tacs)) { - ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]"); - goto end; - } - tacsList = OpenAPI_list_create(); + cJSON *tacs_local = NULL; + if (!cJSON_IsArray(tacs)) { + ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]"); + goto end; + } - cJSON_ArrayForEach(tacs_local, tacs) { - if (!cJSON_IsString(tacs_local)) { - ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]"); - goto end; - } - OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring)); - } + tacsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tacs_local, tacs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(tacs_local)) { + ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]"); + goto end; + } + OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring)); + } } - cJSON *area_code = cJSON_GetObjectItemCaseSensitive(areaJSON, "areaCode"); - + area_code = cJSON_GetObjectItemCaseSensitive(areaJSON, "areaCode"); if (area_code) { - if (!cJSON_IsString(area_code)) { + if (!cJSON_IsString(area_code) && !cJSON_IsNull(area_code)) { ogs_error("OpenAPI_area_parseFromJSON() failed [area_code]"); goto end; } @@ -103,11 +113,18 @@ OpenAPI_area_t *OpenAPI_area_parseFromJSON(cJSON *areaJSON) area_local_var = OpenAPI_area_create ( tacs ? tacsList : NULL, - area_code ? ogs_strdup(area_code->valuestring) : NULL + area_code && !cJSON_IsNull(area_code) ? ogs_strdup(area_code->valuestring) : NULL ); return area_local_var; end: + if (tacsList) { + OpenAPI_list_for_each(tacsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tacsList); + tacsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/area_1.c b/lib/sbi/openapi/model/area_1.c index 99dbea1d7..cc67b93ef 100644 --- a/lib/sbi/openapi/model/area_1.c +++ b/lib/sbi/openapi/model/area_1.c @@ -20,21 +20,29 @@ OpenAPI_area_1_t *OpenAPI_area_1_create( void OpenAPI_area_1_free(OpenAPI_area_1_t *area_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == area_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(area_1->tacs, node) { - ogs_free(node->data); + if (area_1->tacs) { + OpenAPI_list_for_each(area_1->tacs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(area_1->tacs); + area_1->tacs = NULL; + } + if (area_1->area_code) { + ogs_free(area_1->area_code); + area_1->area_code = NULL; } - OpenAPI_list_free(area_1->tacs); - ogs_free(area_1->area_code); ogs_free(area_1); } cJSON *OpenAPI_area_1_convertToJSON(OpenAPI_area_1_t *area_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (area_1 == NULL) { ogs_error("OpenAPI_area_1_convertToJSON() failed [Area_1]"); @@ -43,19 +51,17 @@ cJSON *OpenAPI_area_1_convertToJSON(OpenAPI_area_1_t *area_1) item = cJSON_CreateObject(); if (area_1->tacs) { - cJSON *tacs = cJSON_AddArrayToObject(item, "tacs"); - if (tacs == NULL) { + cJSON *tacsList = cJSON_AddArrayToObject(item, "tacs"); + if (tacsList == NULL) { ogs_error("OpenAPI_area_1_convertToJSON() failed [tacs]"); goto end; } - - OpenAPI_lnode_t *tacs_node; - OpenAPI_list_for_each(area_1->tacs, tacs_node) { - if (cJSON_AddStringToObject(tacs, "", (char*)tacs_node->data) == NULL) { - ogs_error("OpenAPI_area_1_convertToJSON() failed [tacs]"); - goto end; + OpenAPI_list_for_each(area_1->tacs, node) { + if (cJSON_AddStringToObject(tacsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_area_1_convertToJSON() failed [tacs]"); + goto end; + } } - } } if (area_1->area_code) { @@ -72,30 +78,34 @@ end: OpenAPI_area_1_t *OpenAPI_area_1_parseFromJSON(cJSON *area_1JSON) { OpenAPI_area_1_t *area_1_local_var = NULL; - cJSON *tacs = cJSON_GetObjectItemCaseSensitive(area_1JSON, "tacs"); - - OpenAPI_list_t *tacsList; + OpenAPI_lnode_t *node = NULL; + cJSON *tacs = NULL; + OpenAPI_list_t *tacsList = NULL; + cJSON *area_code = NULL; + tacs = cJSON_GetObjectItemCaseSensitive(area_1JSON, "tacs"); if (tacs) { - cJSON *tacs_local; - if (!cJSON_IsArray(tacs)) { - ogs_error("OpenAPI_area_1_parseFromJSON() failed [tacs]"); - goto end; - } - tacsList = OpenAPI_list_create(); + cJSON *tacs_local = NULL; + if (!cJSON_IsArray(tacs)) { + ogs_error("OpenAPI_area_1_parseFromJSON() failed [tacs]"); + goto end; + } - cJSON_ArrayForEach(tacs_local, tacs) { - if (!cJSON_IsString(tacs_local)) { - ogs_error("OpenAPI_area_1_parseFromJSON() failed [tacs]"); - goto end; - } - OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring)); - } + tacsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tacs_local, tacs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(tacs_local)) { + ogs_error("OpenAPI_area_1_parseFromJSON() failed [tacs]"); + goto end; + } + OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring)); + } } - cJSON *area_code = cJSON_GetObjectItemCaseSensitive(area_1JSON, "areaCode"); - + area_code = cJSON_GetObjectItemCaseSensitive(area_1JSON, "areaCode"); if (area_code) { - if (!cJSON_IsString(area_code)) { + if (!cJSON_IsString(area_code) && !cJSON_IsNull(area_code)) { ogs_error("OpenAPI_area_1_parseFromJSON() failed [area_code]"); goto end; } @@ -103,11 +113,18 @@ OpenAPI_area_1_t *OpenAPI_area_1_parseFromJSON(cJSON *area_1JSON) area_1_local_var = OpenAPI_area_1_create ( tacs ? tacsList : NULL, - area_code ? ogs_strdup(area_code->valuestring) : NULL + area_code && !cJSON_IsNull(area_code) ? ogs_strdup(area_code->valuestring) : NULL ); return area_1_local_var; end: + if (tacsList) { + OpenAPI_list_for_each(tacsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tacsList); + tacsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/area_of_validity.c b/lib/sbi/openapi/model/area_of_validity.c index d22217d77..51de8888f 100644 --- a/lib/sbi/openapi/model/area_of_validity.c +++ b/lib/sbi/openapi/model/area_of_validity.c @@ -18,20 +18,25 @@ OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_create( void OpenAPI_area_of_validity_free(OpenAPI_area_of_validity_t *area_of_validity) { + OpenAPI_lnode_t *node = NULL; + if (NULL == area_of_validity) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(area_of_validity->tai_list, node) { - OpenAPI_tai_free(node->data); + if (area_of_validity->tai_list) { + OpenAPI_list_for_each(area_of_validity->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(area_of_validity->tai_list); + area_of_validity->tai_list = NULL; } - OpenAPI_list_free(area_of_validity->tai_list); ogs_free(area_of_validity); } cJSON *OpenAPI_area_of_validity_convertToJSON(OpenAPI_area_of_validity_t *area_of_validity) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (area_of_validity == NULL) { ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [AreaOfValidity]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_area_of_validity_convertToJSON(OpenAPI_area_of_validity_t *area_o } item = cJSON_CreateObject(); + if (!area_of_validity->tai_list) { + ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]"); + return NULL; + } cJSON *tai_listList = cJSON_AddArrayToObject(item, "taiList"); if (tai_listList == NULL) { ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (area_of_validity->tai_list) { - OpenAPI_list_for_each(area_of_validity->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(area_of_validity->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_parseFromJSON(cJSON *area_of_validityJSON) { OpenAPI_area_of_validity_t *area_of_validity_local_var = NULL; - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(area_of_validityJSON, "taiList"); + OpenAPI_lnode_t *node = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + tai_list = cJSON_GetObjectItemCaseSensitive(area_of_validityJSON, "taiList"); if (!tai_list) { ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]"); goto end; } - - OpenAPI_list_t *tai_listList; - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - OpenAPI_list_add(tai_listList, tai_listItem); - } - area_of_validity_local_var = OpenAPI_area_of_validity_create ( tai_listList ); return area_of_validity_local_var; end: + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/area_scope.c b/lib/sbi/openapi/model/area_scope.c index cbb957cee..513f6959d 100644 --- a/lib/sbi/openapi/model/area_scope.c +++ b/lib/sbi/openapi/model/area_scope.c @@ -24,35 +24,49 @@ OpenAPI_area_scope_t *OpenAPI_area_scope_create( void OpenAPI_area_scope_free(OpenAPI_area_scope_t *area_scope) { + OpenAPI_lnode_t *node = NULL; + if (NULL == area_scope) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(area_scope->eutra_cell_id_list, node) { - ogs_free(node->data); + if (area_scope->eutra_cell_id_list) { + OpenAPI_list_for_each(area_scope->eutra_cell_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(area_scope->eutra_cell_id_list); + area_scope->eutra_cell_id_list = NULL; } - OpenAPI_list_free(area_scope->eutra_cell_id_list); - OpenAPI_list_for_each(area_scope->nr_cell_id_list, node) { - ogs_free(node->data); + if (area_scope->nr_cell_id_list) { + OpenAPI_list_for_each(area_scope->nr_cell_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(area_scope->nr_cell_id_list); + area_scope->nr_cell_id_list = NULL; } - OpenAPI_list_free(area_scope->nr_cell_id_list); - OpenAPI_list_for_each(area_scope->tac_list, node) { - ogs_free(node->data); + if (area_scope->tac_list) { + OpenAPI_list_for_each(area_scope->tac_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(area_scope->tac_list); + area_scope->tac_list = NULL; } - OpenAPI_list_free(area_scope->tac_list); - OpenAPI_list_for_each(area_scope->tac_info_per_plmn, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_tac_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (area_scope->tac_info_per_plmn) { + OpenAPI_list_for_each(area_scope->tac_info_per_plmn, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_tac_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(area_scope->tac_info_per_plmn); + area_scope->tac_info_per_plmn = NULL; } - OpenAPI_list_free(area_scope->tac_info_per_plmn); ogs_free(area_scope); } cJSON *OpenAPI_area_scope_convertToJSON(OpenAPI_area_scope_t *area_scope) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (area_scope == NULL) { ogs_error("OpenAPI_area_scope_convertToJSON() failed [AreaScope]"); @@ -61,51 +75,45 @@ cJSON *OpenAPI_area_scope_convertToJSON(OpenAPI_area_scope_t *area_scope) item = cJSON_CreateObject(); if (area_scope->eutra_cell_id_list) { - cJSON *eutra_cell_id_list = cJSON_AddArrayToObject(item, "eutraCellIdList"); - if (eutra_cell_id_list == NULL) { + cJSON *eutra_cell_id_listList = cJSON_AddArrayToObject(item, "eutraCellIdList"); + if (eutra_cell_id_listList == NULL) { ogs_error("OpenAPI_area_scope_convertToJSON() failed [eutra_cell_id_list]"); goto end; } - - OpenAPI_lnode_t *eutra_cell_id_list_node; - OpenAPI_list_for_each(area_scope->eutra_cell_id_list, eutra_cell_id_list_node) { - if (cJSON_AddStringToObject(eutra_cell_id_list, "", (char*)eutra_cell_id_list_node->data) == NULL) { - ogs_error("OpenAPI_area_scope_convertToJSON() failed [eutra_cell_id_list]"); - goto end; + OpenAPI_list_for_each(area_scope->eutra_cell_id_list, node) { + if (cJSON_AddStringToObject(eutra_cell_id_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_area_scope_convertToJSON() failed [eutra_cell_id_list]"); + goto end; + } } - } } if (area_scope->nr_cell_id_list) { - cJSON *nr_cell_id_list = cJSON_AddArrayToObject(item, "nrCellIdList"); - if (nr_cell_id_list == NULL) { + cJSON *nr_cell_id_listList = cJSON_AddArrayToObject(item, "nrCellIdList"); + if (nr_cell_id_listList == NULL) { ogs_error("OpenAPI_area_scope_convertToJSON() failed [nr_cell_id_list]"); goto end; } - - OpenAPI_lnode_t *nr_cell_id_list_node; - OpenAPI_list_for_each(area_scope->nr_cell_id_list, nr_cell_id_list_node) { - if (cJSON_AddStringToObject(nr_cell_id_list, "", (char*)nr_cell_id_list_node->data) == NULL) { - ogs_error("OpenAPI_area_scope_convertToJSON() failed [nr_cell_id_list]"); - goto end; + OpenAPI_list_for_each(area_scope->nr_cell_id_list, node) { + if (cJSON_AddStringToObject(nr_cell_id_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_area_scope_convertToJSON() failed [nr_cell_id_list]"); + goto end; + } } - } } if (area_scope->tac_list) { - cJSON *tac_list = cJSON_AddArrayToObject(item, "tacList"); - if (tac_list == NULL) { + cJSON *tac_listList = cJSON_AddArrayToObject(item, "tacList"); + if (tac_listList == NULL) { ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_list]"); goto end; } - - OpenAPI_lnode_t *tac_list_node; - OpenAPI_list_for_each(area_scope->tac_list, tac_list_node) { - if (cJSON_AddStringToObject(tac_list, "", (char*)tac_list_node->data) == NULL) { - ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_list]"); - goto end; + OpenAPI_list_for_each(area_scope->tac_list, node) { + if (cJSON_AddStringToObject(tac_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_list]"); + goto end; + } } - } } if (area_scope->tac_info_per_plmn) { @@ -115,21 +123,20 @@ cJSON *OpenAPI_area_scope_convertToJSON(OpenAPI_area_scope_t *area_scope) goto end; } cJSON *localMapObject = tac_info_per_plmn; - OpenAPI_lnode_t *tac_info_per_plmn_node; if (area_scope->tac_info_per_plmn) { - OpenAPI_list_for_each(area_scope->tac_info_per_plmn, tac_info_per_plmn_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)tac_info_per_plmn_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_tac_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_area_scope_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(area_scope->tac_info_per_plmn, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_tac_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_area_scope_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -138,90 +145,102 @@ end: OpenAPI_area_scope_t *OpenAPI_area_scope_parseFromJSON(cJSON *area_scopeJSON) { OpenAPI_area_scope_t *area_scope_local_var = NULL; - cJSON *eutra_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "eutraCellIdList"); - - OpenAPI_list_t *eutra_cell_id_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *eutra_cell_id_list = NULL; + OpenAPI_list_t *eutra_cell_id_listList = NULL; + cJSON *nr_cell_id_list = NULL; + OpenAPI_list_t *nr_cell_id_listList = NULL; + cJSON *tac_list = NULL; + OpenAPI_list_t *tac_listList = NULL; + cJSON *tac_info_per_plmn = NULL; + OpenAPI_list_t *tac_info_per_plmnList = NULL; + eutra_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "eutraCellIdList"); if (eutra_cell_id_list) { - cJSON *eutra_cell_id_list_local; - if (!cJSON_IsArray(eutra_cell_id_list)) { - ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]"); - goto end; - } - eutra_cell_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eutra_cell_id_list_local, eutra_cell_id_list) { - if (!cJSON_IsString(eutra_cell_id_list_local)) { - ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]"); - goto end; - } - OpenAPI_list_add(eutra_cell_id_listList, ogs_strdup(eutra_cell_id_list_local->valuestring)); - } - } - - cJSON *nr_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "nrCellIdList"); - - OpenAPI_list_t *nr_cell_id_listList; - if (nr_cell_id_list) { - cJSON *nr_cell_id_list_local; - if (!cJSON_IsArray(nr_cell_id_list)) { - ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]"); - goto end; - } - nr_cell_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nr_cell_id_list_local, nr_cell_id_list) { - if (!cJSON_IsString(nr_cell_id_list_local)) { - ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]"); - goto end; - } - OpenAPI_list_add(nr_cell_id_listList, ogs_strdup(nr_cell_id_list_local->valuestring)); - } - } - - cJSON *tac_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacList"); - - OpenAPI_list_t *tac_listList; - if (tac_list) { - cJSON *tac_list_local; - if (!cJSON_IsArray(tac_list)) { - ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]"); - goto end; - } - tac_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tac_list_local, tac_list) { - if (!cJSON_IsString(tac_list_local)) { - ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]"); - goto end; - } - OpenAPI_list_add(tac_listList, ogs_strdup(tac_list_local->valuestring)); - } - } - - cJSON *tac_info_per_plmn = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacInfoPerPlmn"); - - OpenAPI_list_t *tac_info_per_plmnList; - if (tac_info_per_plmn) { - cJSON *tac_info_per_plmn_local_map; - if (!cJSON_IsObject(tac_info_per_plmn)) { - ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_info_per_plmn]"); - goto end; - } - tac_info_per_plmnList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(tac_info_per_plmn_local_map, tac_info_per_plmn) { - cJSON *localMapObject = tac_info_per_plmn_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_tac_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_area_scope_parseFromJSON() failed [inner]"); + cJSON *eutra_cell_id_list_local = NULL; + if (!cJSON_IsArray(eutra_cell_id_list)) { + ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]"); goto end; } - OpenAPI_list_add(tac_info_per_plmnList, localMapKeyPair); + + eutra_cell_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eutra_cell_id_list_local, eutra_cell_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(eutra_cell_id_list_local)) { + ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]"); + goto end; + } + OpenAPI_list_add(eutra_cell_id_listList, ogs_strdup(eutra_cell_id_list_local->valuestring)); + } } + + nr_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "nrCellIdList"); + if (nr_cell_id_list) { + cJSON *nr_cell_id_list_local = NULL; + if (!cJSON_IsArray(nr_cell_id_list)) { + ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]"); + goto end; + } + + nr_cell_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nr_cell_id_list_local, nr_cell_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(nr_cell_id_list_local)) { + ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]"); + goto end; + } + OpenAPI_list_add(nr_cell_id_listList, ogs_strdup(nr_cell_id_list_local->valuestring)); + } + } + + tac_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacList"); + if (tac_list) { + cJSON *tac_list_local = NULL; + if (!cJSON_IsArray(tac_list)) { + ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]"); + goto end; + } + + tac_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tac_list_local, tac_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(tac_list_local)) { + ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]"); + goto end; + } + OpenAPI_list_add(tac_listList, ogs_strdup(tac_list_local->valuestring)); + } + } + + tac_info_per_plmn = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacInfoPerPlmn"); + if (tac_info_per_plmn) { + cJSON *tac_info_per_plmn_local_map = NULL; + if (!cJSON_IsObject(tac_info_per_plmn) && !cJSON_IsNull(tac_info_per_plmn)) { + ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_info_per_plmn]"); + goto end; + } + if (cJSON_IsObject(tac_info_per_plmn)) { + tac_info_per_plmnList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(tac_info_per_plmn_local_map, tac_info_per_plmn) { + cJSON *localMapObject = tac_info_per_plmn_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_tac_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_area_scope_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(tac_info_per_plmnList, localMapKeyPair); + } + } } area_scope_local_var = OpenAPI_area_scope_create ( @@ -233,6 +252,37 @@ OpenAPI_area_scope_t *OpenAPI_area_scope_parseFromJSON(cJSON *area_scopeJSON) return area_scope_local_var; end: + if (eutra_cell_id_listList) { + OpenAPI_list_for_each(eutra_cell_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(eutra_cell_id_listList); + eutra_cell_id_listList = NULL; + } + if (nr_cell_id_listList) { + OpenAPI_list_for_each(nr_cell_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nr_cell_id_listList); + nr_cell_id_listList = NULL; + } + if (tac_listList) { + OpenAPI_list_for_each(tac_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tac_listList); + tac_listList = NULL; + } + if (tac_info_per_plmnList) { + OpenAPI_list_for_each(tac_info_per_plmnList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_tac_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(tac_info_per_plmnList); + tac_info_per_plmnList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/arp.c b/lib/sbi/openapi/model/arp.c index e0539a9b4..14849a9d5 100644 --- a/lib/sbi/openapi/model/arp.c +++ b/lib/sbi/openapi/model/arp.c @@ -22,16 +22,18 @@ OpenAPI_arp_t *OpenAPI_arp_create( void OpenAPI_arp_free(OpenAPI_arp_t *arp) { + OpenAPI_lnode_t *node = NULL; + if (NULL == arp) { return; } - OpenAPI_lnode_t *node; ogs_free(arp); } cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (arp == NULL) { ogs_error("OpenAPI_arp_convertToJSON() failed [Arp]"); @@ -44,11 +46,19 @@ cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp) goto end; } + if (arp->preempt_cap == OpenAPI_preemption_capability_NULL) { + ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]"); + return NULL; + } if (cJSON_AddStringToObject(item, "preemptCap", OpenAPI_preemption_capability_ToString(arp->preempt_cap)) == NULL) { ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]"); goto end; } + if (arp->preempt_vuln == OpenAPI_preemption_vulnerability_NULL) { + ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]"); + return NULL; + } if (cJSON_AddStringToObject(item, "preemptVuln", OpenAPI_preemption_vulnerability_ToString(arp->preempt_vuln)) == NULL) { ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]"); goto end; @@ -61,37 +71,38 @@ end: OpenAPI_arp_t *OpenAPI_arp_parseFromJSON(cJSON *arpJSON) { OpenAPI_arp_t *arp_local_var = NULL; - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(arpJSON, "priorityLevel"); + OpenAPI_lnode_t *node = NULL; + cJSON *priority_level = NULL; + cJSON *preempt_cap = NULL; + OpenAPI_preemption_capability_e preempt_capVariable = 0; + cJSON *preempt_vuln = NULL; + OpenAPI_preemption_vulnerability_e preempt_vulnVariable = 0; + priority_level = cJSON_GetObjectItemCaseSensitive(arpJSON, "priorityLevel"); if (!priority_level) { ogs_error("OpenAPI_arp_parseFromJSON() failed [priority_level]"); goto end; } - if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_arp_parseFromJSON() failed [priority_level]"); goto end; } - cJSON *preempt_cap = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptCap"); + preempt_cap = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptCap"); if (!preempt_cap) { ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_cap]"); goto end; } - - OpenAPI_preemption_capability_e preempt_capVariable; if (!cJSON_IsString(preempt_cap)) { ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_cap]"); goto end; } preempt_capVariable = OpenAPI_preemption_capability_FromString(preempt_cap->valuestring); - cJSON *preempt_vuln = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptVuln"); + preempt_vuln = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptVuln"); if (!preempt_vuln) { ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_vuln]"); goto end; } - - OpenAPI_preemption_vulnerability_e preempt_vulnVariable; if (!cJSON_IsString(preempt_vuln)) { ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_vuln]"); goto end; diff --git a/lib/sbi/openapi/model/arp_1.c b/lib/sbi/openapi/model/arp_1.c index df2d2b9a5..9170fb22e 100644 --- a/lib/sbi/openapi/model/arp_1.c +++ b/lib/sbi/openapi/model/arp_1.c @@ -22,16 +22,18 @@ OpenAPI_arp_1_t *OpenAPI_arp_1_create( void OpenAPI_arp_1_free(OpenAPI_arp_1_t *arp_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == arp_1) { return; } - OpenAPI_lnode_t *node; ogs_free(arp_1); } cJSON *OpenAPI_arp_1_convertToJSON(OpenAPI_arp_1_t *arp_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (arp_1 == NULL) { ogs_error("OpenAPI_arp_1_convertToJSON() failed [Arp_1]"); @@ -44,11 +46,19 @@ cJSON *OpenAPI_arp_1_convertToJSON(OpenAPI_arp_1_t *arp_1) goto end; } + if (arp_1->preempt_cap == OpenAPI_preemption_capability_NULL) { + ogs_error("OpenAPI_arp_1_convertToJSON() failed [preempt_cap]"); + return NULL; + } if (cJSON_AddStringToObject(item, "preemptCap", OpenAPI_preemption_capability_ToString(arp_1->preempt_cap)) == NULL) { ogs_error("OpenAPI_arp_1_convertToJSON() failed [preempt_cap]"); goto end; } + if (arp_1->preempt_vuln == OpenAPI_preemption_vulnerability_NULL) { + ogs_error("OpenAPI_arp_1_convertToJSON() failed [preempt_vuln]"); + return NULL; + } if (cJSON_AddStringToObject(item, "preemptVuln", OpenAPI_preemption_vulnerability_ToString(arp_1->preempt_vuln)) == NULL) { ogs_error("OpenAPI_arp_1_convertToJSON() failed [preempt_vuln]"); goto end; @@ -61,37 +71,38 @@ end: OpenAPI_arp_1_t *OpenAPI_arp_1_parseFromJSON(cJSON *arp_1JSON) { OpenAPI_arp_1_t *arp_1_local_var = NULL; - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "priorityLevel"); + OpenAPI_lnode_t *node = NULL; + cJSON *priority_level = NULL; + cJSON *preempt_cap = NULL; + OpenAPI_preemption_capability_e preempt_capVariable = 0; + cJSON *preempt_vuln = NULL; + OpenAPI_preemption_vulnerability_e preempt_vulnVariable = 0; + priority_level = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "priorityLevel"); if (!priority_level) { ogs_error("OpenAPI_arp_1_parseFromJSON() failed [priority_level]"); goto end; } - if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_arp_1_parseFromJSON() failed [priority_level]"); goto end; } - cJSON *preempt_cap = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "preemptCap"); + preempt_cap = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "preemptCap"); if (!preempt_cap) { ogs_error("OpenAPI_arp_1_parseFromJSON() failed [preempt_cap]"); goto end; } - - OpenAPI_preemption_capability_e preempt_capVariable; if (!cJSON_IsString(preempt_cap)) { ogs_error("OpenAPI_arp_1_parseFromJSON() failed [preempt_cap]"); goto end; } preempt_capVariable = OpenAPI_preemption_capability_FromString(preempt_cap->valuestring); - cJSON *preempt_vuln = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "preemptVuln"); + preempt_vuln = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "preemptVuln"); if (!preempt_vuln) { ogs_error("OpenAPI_arp_1_parseFromJSON() failed [preempt_vuln]"); goto end; } - - OpenAPI_preemption_vulnerability_e preempt_vulnVariable; if (!cJSON_IsString(preempt_vuln)) { ogs_error("OpenAPI_arp_1_parseFromJSON() failed [preempt_vuln]"); goto end; diff --git a/lib/sbi/openapi/model/assign_ebi_data.c b/lib/sbi/openapi/model/assign_ebi_data.c index 91bc0fccc..94a1d1c47 100644 --- a/lib/sbi/openapi/model/assign_ebi_data.c +++ b/lib/sbi/openapi/model/assign_ebi_data.c @@ -24,25 +24,36 @@ OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_create( void OpenAPI_assign_ebi_data_free(OpenAPI_assign_ebi_data_t *assign_ebi_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == assign_ebi_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(assign_ebi_data->arp_list, node) { - OpenAPI_arp_free(node->data); + if (assign_ebi_data->arp_list) { + OpenAPI_list_for_each(assign_ebi_data->arp_list, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(assign_ebi_data->arp_list); + assign_ebi_data->arp_list = NULL; } - OpenAPI_list_free(assign_ebi_data->arp_list); - OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, node) { - ogs_free(node->data); + if (assign_ebi_data->released_ebi_list) { + OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(assign_ebi_data->released_ebi_list); + assign_ebi_data->released_ebi_list = NULL; + } + if (assign_ebi_data->old_guami) { + OpenAPI_guami_free(assign_ebi_data->old_guami); + assign_ebi_data->old_guami = NULL; } - OpenAPI_list_free(assign_ebi_data->released_ebi_list); - OpenAPI_guami_free(assign_ebi_data->old_guami); ogs_free(assign_ebi_data); } cJSON *OpenAPI_assign_ebi_data_convertToJSON(OpenAPI_assign_ebi_data_t *assign_ebi_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (assign_ebi_data == NULL) { ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [AssignEbiData]"); @@ -61,34 +72,28 @@ cJSON *OpenAPI_assign_ebi_data_convertToJSON(OpenAPI_assign_ebi_data_t *assign_e ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [arp_list]"); goto end; } - - OpenAPI_lnode_t *arp_list_node; - if (assign_ebi_data->arp_list) { - OpenAPI_list_for_each(assign_ebi_data->arp_list, arp_list_node) { - cJSON *itemLocal = OpenAPI_arp_convertToJSON(arp_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [arp_list]"); - goto end; - } - cJSON_AddItemToArray(arp_listList, itemLocal); + OpenAPI_list_for_each(assign_ebi_data->arp_list, node) { + cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [arp_list]"); + goto end; } + cJSON_AddItemToArray(arp_listList, itemLocal); } } if (assign_ebi_data->released_ebi_list) { - cJSON *released_ebi_list = cJSON_AddArrayToObject(item, "releasedEbiList"); - if (released_ebi_list == NULL) { + cJSON *released_ebi_listList = cJSON_AddArrayToObject(item, "releasedEbiList"); + if (released_ebi_listList == NULL) { ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [released_ebi_list]"); goto end; } - - OpenAPI_lnode_t *released_ebi_list_node; - OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, released_ebi_list_node) { - if (cJSON_AddNumberToObject(released_ebi_list, "", *(double *)released_ebi_list_node->data) == NULL) { - ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [released_ebi_list]"); - goto end; + OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, node) { + if (cJSON_AddNumberToObject(released_ebi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [released_ebi_list]"); + goto end; + } } - } } if (assign_ebi_data->old_guami) { @@ -111,69 +116,77 @@ end: OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_parseFromJSON(cJSON *assign_ebi_dataJSON) { OpenAPI_assign_ebi_data_t *assign_ebi_data_local_var = NULL; - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "pduSessionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_id = NULL; + cJSON *arp_list = NULL; + OpenAPI_list_t *arp_listList = NULL; + cJSON *released_ebi_list = NULL; + OpenAPI_list_t *released_ebi_listList = NULL; + cJSON *old_guami = NULL; + OpenAPI_guami_t *old_guami_local_nonprim = NULL; + pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "pduSessionId"); if (!pdu_session_id) { ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [pdu_session_id]"); goto end; } - if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [pdu_session_id]"); goto end; } - cJSON *arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "arpList"); - - OpenAPI_list_t *arp_listList; + arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "arpList"); if (arp_list) { - cJSON *arp_list_local_nonprimitive; - if (!cJSON_IsArray(arp_list)){ - ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [arp_list]"); - goto end; - } - - arp_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(arp_list_local_nonprimitive, arp_list ) { - if (!cJSON_IsObject(arp_list_local_nonprimitive)) { + cJSON *arp_list_local = NULL; + if (!cJSON_IsArray(arp_list)) { ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [arp_list]"); goto end; } - OpenAPI_arp_t *arp_listItem = OpenAPI_arp_parseFromJSON(arp_list_local_nonprimitive); - if (!arp_listItem) { - ogs_error("No arp_listItem"); - OpenAPI_list_free(arp_listList); + arp_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(arp_list_local, arp_list) { + if (!cJSON_IsObject(arp_list_local)) { + ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [arp_list]"); + goto end; + } + OpenAPI_arp_t *arp_listItem = OpenAPI_arp_parseFromJSON(arp_list_local); + if (!arp_listItem) { + ogs_error("No arp_listItem"); + OpenAPI_list_free(arp_listList); + goto end; + } + OpenAPI_list_add(arp_listList, arp_listItem); + } + } + + released_ebi_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "releasedEbiList"); + if (released_ebi_list) { + cJSON *released_ebi_list_local = NULL; + if (!cJSON_IsArray(released_ebi_list)) { + ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]"); goto end; } - OpenAPI_list_add(arp_listList, arp_listItem); - } + released_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(released_ebi_list_local)) { + ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]"); + goto end; + } + *localDouble = released_ebi_list_local->valuedouble; + OpenAPI_list_add(released_ebi_listList, localDouble); + } } - cJSON *released_ebi_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "releasedEbiList"); - - OpenAPI_list_t *released_ebi_listList; - if (released_ebi_list) { - cJSON *released_ebi_list_local; - if (!cJSON_IsArray(released_ebi_list)) { - ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]"); - goto end; - } - released_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) { - if (!cJSON_IsNumber(released_ebi_list_local)) { - ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]"); - goto end; - } - OpenAPI_list_add(released_ebi_listList, &released_ebi_list_local->valuedouble); - } - } - - cJSON *old_guami = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "oldGuami"); - - OpenAPI_guami_t *old_guami_local_nonprim = NULL; + old_guami = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "oldGuami"); if (old_guami) { old_guami_local_nonprim = OpenAPI_guami_parseFromJSON(old_guami); } @@ -188,6 +201,24 @@ OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_parseFromJSON(cJSON *assign_e return assign_ebi_data_local_var; end: + if (arp_listList) { + OpenAPI_list_for_each(arp_listList, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(arp_listList); + arp_listList = NULL; + } + if (released_ebi_listList) { + OpenAPI_list_for_each(released_ebi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(released_ebi_listList); + released_ebi_listList = NULL; + } + if (old_guami_local_nonprim) { + OpenAPI_guami_free(old_guami_local_nonprim); + old_guami_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/assign_ebi_error.c b/lib/sbi/openapi/model/assign_ebi_error.c index 7024ca38a..5a623fb10 100644 --- a/lib/sbi/openapi/model/assign_ebi_error.c +++ b/lib/sbi/openapi/model/assign_ebi_error.c @@ -20,18 +20,26 @@ OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_create( void OpenAPI_assign_ebi_error_free(OpenAPI_assign_ebi_error_t *assign_ebi_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == assign_ebi_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_problem_details_free(assign_ebi_error->error); - OpenAPI_assign_ebi_failed_free(assign_ebi_error->failure_details); + if (assign_ebi_error->error) { + OpenAPI_problem_details_free(assign_ebi_error->error); + assign_ebi_error->error = NULL; + } + if (assign_ebi_error->failure_details) { + OpenAPI_assign_ebi_failed_free(assign_ebi_error->failure_details); + assign_ebi_error->failure_details = NULL; + } ogs_free(assign_ebi_error); } cJSON *OpenAPI_assign_ebi_error_convertToJSON(OpenAPI_assign_ebi_error_t *assign_ebi_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (assign_ebi_error == NULL) { ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [AssignEbiError]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_assign_ebi_error_convertToJSON(OpenAPI_assign_ebi_error_t *assign } item = cJSON_CreateObject(); + if (!assign_ebi_error->error) { + ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(assign_ebi_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [error]"); @@ -50,6 +62,10 @@ cJSON *OpenAPI_assign_ebi_error_convertToJSON(OpenAPI_assign_ebi_error_t *assign goto end; } + if (!assign_ebi_error->failure_details) { + ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [failure_details]"); + return NULL; + } cJSON *failure_details_local_JSON = OpenAPI_assign_ebi_failed_convertToJSON(assign_ebi_error->failure_details); if (failure_details_local_JSON == NULL) { ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [failure_details]"); @@ -68,22 +84,23 @@ end: OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_parseFromJSON(cJSON *assign_ebi_errorJSON) { OpenAPI_assign_ebi_error_t *assign_ebi_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_problem_details_t *error_local_nonprim = NULL; + cJSON *failure_details = NULL; + OpenAPI_assign_ebi_failed_t *failure_details_local_nonprim = NULL; + error = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_assign_ebi_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error); - cJSON *failure_details = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "failureDetails"); + failure_details = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "failureDetails"); if (!failure_details) { ogs_error("OpenAPI_assign_ebi_error_parseFromJSON() failed [failure_details]"); goto end; } - - OpenAPI_assign_ebi_failed_t *failure_details_local_nonprim = NULL; failure_details_local_nonprim = OpenAPI_assign_ebi_failed_parseFromJSON(failure_details); assign_ebi_error_local_var = OpenAPI_assign_ebi_error_create ( @@ -93,6 +110,14 @@ OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_parseFromJSON(cJSON *assign return assign_ebi_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (failure_details_local_nonprim) { + OpenAPI_assign_ebi_failed_free(failure_details_local_nonprim); + failure_details_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/assign_ebi_failed.c b/lib/sbi/openapi/model/assign_ebi_failed.c index 911178f44..226db11ce 100644 --- a/lib/sbi/openapi/model/assign_ebi_failed.c +++ b/lib/sbi/openapi/model/assign_ebi_failed.c @@ -20,20 +20,25 @@ OpenAPI_assign_ebi_failed_t *OpenAPI_assign_ebi_failed_create( void OpenAPI_assign_ebi_failed_free(OpenAPI_assign_ebi_failed_t *assign_ebi_failed) { + OpenAPI_lnode_t *node = NULL; + if (NULL == assign_ebi_failed) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(assign_ebi_failed->failed_arp_list, node) { - OpenAPI_arp_free(node->data); + if (assign_ebi_failed->failed_arp_list) { + OpenAPI_list_for_each(assign_ebi_failed->failed_arp_list, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(assign_ebi_failed->failed_arp_list); + assign_ebi_failed->failed_arp_list = NULL; } - OpenAPI_list_free(assign_ebi_failed->failed_arp_list); ogs_free(assign_ebi_failed); } cJSON *OpenAPI_assign_ebi_failed_convertToJSON(OpenAPI_assign_ebi_failed_t *assign_ebi_failed) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (assign_ebi_failed == NULL) { ogs_error("OpenAPI_assign_ebi_failed_convertToJSON() failed [AssignEbiFailed]"); @@ -52,17 +57,13 @@ cJSON *OpenAPI_assign_ebi_failed_convertToJSON(OpenAPI_assign_ebi_failed_t *assi ogs_error("OpenAPI_assign_ebi_failed_convertToJSON() failed [failed_arp_list]"); goto end; } - - OpenAPI_lnode_t *failed_arp_list_node; - if (assign_ebi_failed->failed_arp_list) { - OpenAPI_list_for_each(assign_ebi_failed->failed_arp_list, failed_arp_list_node) { - cJSON *itemLocal = OpenAPI_arp_convertToJSON(failed_arp_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_assign_ebi_failed_convertToJSON() failed [failed_arp_list]"); - goto end; - } - cJSON_AddItemToArray(failed_arp_listList, itemLocal); + OpenAPI_list_for_each(assign_ebi_failed->failed_arp_list, node) { + cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_assign_ebi_failed_convertToJSON() failed [failed_arp_list]"); + goto end; } + cJSON_AddItemToArray(failed_arp_listList, itemLocal); } } @@ -73,44 +74,43 @@ end: OpenAPI_assign_ebi_failed_t *OpenAPI_assign_ebi_failed_parseFromJSON(cJSON *assign_ebi_failedJSON) { OpenAPI_assign_ebi_failed_t *assign_ebi_failed_local_var = NULL; - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_failedJSON, "pduSessionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_id = NULL; + cJSON *failed_arp_list = NULL; + OpenAPI_list_t *failed_arp_listList = NULL; + pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_failedJSON, "pduSessionId"); if (!pdu_session_id) { ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [pdu_session_id]"); goto end; } - if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [pdu_session_id]"); goto end; } - cJSON *failed_arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_failedJSON, "failedArpList"); - - OpenAPI_list_t *failed_arp_listList; + failed_arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_failedJSON, "failedArpList"); if (failed_arp_list) { - cJSON *failed_arp_list_local_nonprimitive; - if (!cJSON_IsArray(failed_arp_list)){ - ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [failed_arp_list]"); - goto end; - } - - failed_arp_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(failed_arp_list_local_nonprimitive, failed_arp_list ) { - if (!cJSON_IsObject(failed_arp_list_local_nonprimitive)) { + cJSON *failed_arp_list_local = NULL; + if (!cJSON_IsArray(failed_arp_list)) { ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [failed_arp_list]"); goto end; } - OpenAPI_arp_t *failed_arp_listItem = OpenAPI_arp_parseFromJSON(failed_arp_list_local_nonprimitive); - if (!failed_arp_listItem) { - ogs_error("No failed_arp_listItem"); - OpenAPI_list_free(failed_arp_listList); - goto end; + failed_arp_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(failed_arp_list_local, failed_arp_list) { + if (!cJSON_IsObject(failed_arp_list_local)) { + ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [failed_arp_list]"); + goto end; + } + OpenAPI_arp_t *failed_arp_listItem = OpenAPI_arp_parseFromJSON(failed_arp_list_local); + if (!failed_arp_listItem) { + ogs_error("No failed_arp_listItem"); + OpenAPI_list_free(failed_arp_listList); + goto end; + } + OpenAPI_list_add(failed_arp_listList, failed_arp_listItem); } - - OpenAPI_list_add(failed_arp_listList, failed_arp_listItem); - } } assign_ebi_failed_local_var = OpenAPI_assign_ebi_failed_create ( @@ -121,6 +121,13 @@ OpenAPI_assign_ebi_failed_t *OpenAPI_assign_ebi_failed_parseFromJSON(cJSON *assi return assign_ebi_failed_local_var; end: + if (failed_arp_listList) { + OpenAPI_list_for_each(failed_arp_listList, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(failed_arp_listList); + failed_arp_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/assigned_ebi_data.c b/lib/sbi/openapi/model/assigned_ebi_data.c index bfd2b4e66..3035738d0 100644 --- a/lib/sbi/openapi/model/assigned_ebi_data.c +++ b/lib/sbi/openapi/model/assigned_ebi_data.c @@ -24,28 +24,39 @@ OpenAPI_assigned_ebi_data_t *OpenAPI_assigned_ebi_data_create( void OpenAPI_assigned_ebi_data_free(OpenAPI_assigned_ebi_data_t *assigned_ebi_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == assigned_ebi_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(assigned_ebi_data->assigned_ebi_list, node) { - OpenAPI_ebi_arp_mapping_free(node->data); + if (assigned_ebi_data->assigned_ebi_list) { + OpenAPI_list_for_each(assigned_ebi_data->assigned_ebi_list, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(assigned_ebi_data->assigned_ebi_list); + assigned_ebi_data->assigned_ebi_list = NULL; } - OpenAPI_list_free(assigned_ebi_data->assigned_ebi_list); - OpenAPI_list_for_each(assigned_ebi_data->failed_arp_list, node) { - OpenAPI_arp_free(node->data); + if (assigned_ebi_data->failed_arp_list) { + OpenAPI_list_for_each(assigned_ebi_data->failed_arp_list, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(assigned_ebi_data->failed_arp_list); + assigned_ebi_data->failed_arp_list = NULL; } - OpenAPI_list_free(assigned_ebi_data->failed_arp_list); - OpenAPI_list_for_each(assigned_ebi_data->released_ebi_list, node) { - ogs_free(node->data); + if (assigned_ebi_data->released_ebi_list) { + OpenAPI_list_for_each(assigned_ebi_data->released_ebi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(assigned_ebi_data->released_ebi_list); + assigned_ebi_data->released_ebi_list = NULL; } - OpenAPI_list_free(assigned_ebi_data->released_ebi_list); ogs_free(assigned_ebi_data); } cJSON *OpenAPI_assigned_ebi_data_convertToJSON(OpenAPI_assigned_ebi_data_t *assigned_ebi_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (assigned_ebi_data == NULL) { ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [AssignedEbiData]"); @@ -58,22 +69,22 @@ cJSON *OpenAPI_assigned_ebi_data_convertToJSON(OpenAPI_assigned_ebi_data_t *assi goto end; } + if (!assigned_ebi_data->assigned_ebi_list) { + ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [assigned_ebi_list]"); + return NULL; + } cJSON *assigned_ebi_listList = cJSON_AddArrayToObject(item, "assignedEbiList"); if (assigned_ebi_listList == NULL) { ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [assigned_ebi_list]"); goto end; } - - OpenAPI_lnode_t *assigned_ebi_list_node; - if (assigned_ebi_data->assigned_ebi_list) { - OpenAPI_list_for_each(assigned_ebi_data->assigned_ebi_list, assigned_ebi_list_node) { - cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(assigned_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [assigned_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(assigned_ebi_listList, itemLocal); + OpenAPI_list_for_each(assigned_ebi_data->assigned_ebi_list, node) { + cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [assigned_ebi_list]"); + goto end; } + cJSON_AddItemToArray(assigned_ebi_listList, itemLocal); } if (assigned_ebi_data->failed_arp_list) { @@ -82,34 +93,28 @@ cJSON *OpenAPI_assigned_ebi_data_convertToJSON(OpenAPI_assigned_ebi_data_t *assi ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [failed_arp_list]"); goto end; } - - OpenAPI_lnode_t *failed_arp_list_node; - if (assigned_ebi_data->failed_arp_list) { - OpenAPI_list_for_each(assigned_ebi_data->failed_arp_list, failed_arp_list_node) { - cJSON *itemLocal = OpenAPI_arp_convertToJSON(failed_arp_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [failed_arp_list]"); - goto end; - } - cJSON_AddItemToArray(failed_arp_listList, itemLocal); + OpenAPI_list_for_each(assigned_ebi_data->failed_arp_list, node) { + cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [failed_arp_list]"); + goto end; } + cJSON_AddItemToArray(failed_arp_listList, itemLocal); } } if (assigned_ebi_data->released_ebi_list) { - cJSON *released_ebi_list = cJSON_AddArrayToObject(item, "releasedEbiList"); - if (released_ebi_list == NULL) { + cJSON *released_ebi_listList = cJSON_AddArrayToObject(item, "releasedEbiList"); + if (released_ebi_listList == NULL) { ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [released_ebi_list]"); goto end; } - - OpenAPI_lnode_t *released_ebi_list_node; - OpenAPI_list_for_each(assigned_ebi_data->released_ebi_list, released_ebi_list_node) { - if (cJSON_AddNumberToObject(released_ebi_list, "", *(double *)released_ebi_list_node->data) == NULL) { - ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [released_ebi_list]"); - goto end; + OpenAPI_list_for_each(assigned_ebi_data->released_ebi_list, node) { + if (cJSON_AddNumberToObject(released_ebi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [released_ebi_list]"); + goto end; + } } - } } end: @@ -119,95 +124,101 @@ end: OpenAPI_assigned_ebi_data_t *OpenAPI_assigned_ebi_data_parseFromJSON(cJSON *assigned_ebi_dataJSON) { OpenAPI_assigned_ebi_data_t *assigned_ebi_data_local_var = NULL; - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "pduSessionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_id = NULL; + cJSON *assigned_ebi_list = NULL; + OpenAPI_list_t *assigned_ebi_listList = NULL; + cJSON *failed_arp_list = NULL; + OpenAPI_list_t *failed_arp_listList = NULL; + cJSON *released_ebi_list = NULL; + OpenAPI_list_t *released_ebi_listList = NULL; + pdu_session_id = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "pduSessionId"); if (!pdu_session_id) { ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [pdu_session_id]"); goto end; } - if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [pdu_session_id]"); goto end; } - cJSON *assigned_ebi_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "assignedEbiList"); + assigned_ebi_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "assignedEbiList"); if (!assigned_ebi_list) { ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [assigned_ebi_list]"); goto end; } - - OpenAPI_list_t *assigned_ebi_listList; - cJSON *assigned_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(assigned_ebi_list)){ - ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [assigned_ebi_list]"); - goto end; - } - - assigned_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(assigned_ebi_list_local_nonprimitive, assigned_ebi_list ) { - if (!cJSON_IsObject(assigned_ebi_list_local_nonprimitive)) { + cJSON *assigned_ebi_list_local = NULL; + if (!cJSON_IsArray(assigned_ebi_list)) { ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [assigned_ebi_list]"); goto end; } - OpenAPI_ebi_arp_mapping_t *assigned_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(assigned_ebi_list_local_nonprimitive); - if (!assigned_ebi_listItem) { - ogs_error("No assigned_ebi_listItem"); - OpenAPI_list_free(assigned_ebi_listList); - goto end; + assigned_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(assigned_ebi_list_local, assigned_ebi_list) { + if (!cJSON_IsObject(assigned_ebi_list_local)) { + ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [assigned_ebi_list]"); + goto end; + } + OpenAPI_ebi_arp_mapping_t *assigned_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(assigned_ebi_list_local); + if (!assigned_ebi_listItem) { + ogs_error("No assigned_ebi_listItem"); + OpenAPI_list_free(assigned_ebi_listList); + goto end; + } + OpenAPI_list_add(assigned_ebi_listList, assigned_ebi_listItem); } - OpenAPI_list_add(assigned_ebi_listList, assigned_ebi_listItem); - } - - cJSON *failed_arp_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "failedArpList"); - - OpenAPI_list_t *failed_arp_listList; + failed_arp_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "failedArpList"); if (failed_arp_list) { - cJSON *failed_arp_list_local_nonprimitive; - if (!cJSON_IsArray(failed_arp_list)){ - ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [failed_arp_list]"); - goto end; - } - - failed_arp_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(failed_arp_list_local_nonprimitive, failed_arp_list ) { - if (!cJSON_IsObject(failed_arp_list_local_nonprimitive)) { + cJSON *failed_arp_list_local = NULL; + if (!cJSON_IsArray(failed_arp_list)) { ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [failed_arp_list]"); goto end; } - OpenAPI_arp_t *failed_arp_listItem = OpenAPI_arp_parseFromJSON(failed_arp_list_local_nonprimitive); - if (!failed_arp_listItem) { - ogs_error("No failed_arp_listItem"); - OpenAPI_list_free(failed_arp_listList); + failed_arp_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(failed_arp_list_local, failed_arp_list) { + if (!cJSON_IsObject(failed_arp_list_local)) { + ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [failed_arp_list]"); + goto end; + } + OpenAPI_arp_t *failed_arp_listItem = OpenAPI_arp_parseFromJSON(failed_arp_list_local); + if (!failed_arp_listItem) { + ogs_error("No failed_arp_listItem"); + OpenAPI_list_free(failed_arp_listList); + goto end; + } + OpenAPI_list_add(failed_arp_listList, failed_arp_listItem); + } + } + + released_ebi_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "releasedEbiList"); + if (released_ebi_list) { + cJSON *released_ebi_list_local = NULL; + if (!cJSON_IsArray(released_ebi_list)) { + ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]"); goto end; } - OpenAPI_list_add(failed_arp_listList, failed_arp_listItem); - } - } + released_ebi_listList = OpenAPI_list_create(); - cJSON *released_ebi_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "releasedEbiList"); - - OpenAPI_list_t *released_ebi_listList; - if (released_ebi_list) { - cJSON *released_ebi_list_local; - if (!cJSON_IsArray(released_ebi_list)) { - ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]"); - goto end; - } - released_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) { - if (!cJSON_IsNumber(released_ebi_list_local)) { - ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]"); - goto end; - } - OpenAPI_list_add(released_ebi_listList, &released_ebi_list_local->valuedouble); - } + cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(released_ebi_list_local)) { + ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]"); + goto end; + } + *localDouble = released_ebi_list_local->valuedouble; + OpenAPI_list_add(released_ebi_listList, localDouble); + } } assigned_ebi_data_local_var = OpenAPI_assigned_ebi_data_create ( @@ -220,6 +231,27 @@ OpenAPI_assigned_ebi_data_t *OpenAPI_assigned_ebi_data_parseFromJSON(cJSON *assi return assigned_ebi_data_local_var; end: + if (assigned_ebi_listList) { + OpenAPI_list_for_each(assigned_ebi_listList, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(assigned_ebi_listList); + assigned_ebi_listList = NULL; + } + if (failed_arp_listList) { + OpenAPI_list_for_each(failed_arp_listList, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(failed_arp_listList); + failed_arp_listList = NULL; + } + if (released_ebi_listList) { + OpenAPI_list_for_each(released_ebi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(released_ebi_listList); + released_ebi_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/association_type.c b/lib/sbi/openapi/model/association_type.c index 75e7bbd20..01901c12b 100644 --- a/lib/sbi/openapi/model/association_type.c +++ b/lib/sbi/openapi/model/association_type.c @@ -16,16 +16,18 @@ OpenAPI_association_type_t *OpenAPI_association_type_create( void OpenAPI_association_type_free(OpenAPI_association_type_t *association_type) { + OpenAPI_lnode_t *node = NULL; + if (NULL == association_type) { return; } - OpenAPI_lnode_t *node; ogs_free(association_type); } cJSON *OpenAPI_association_type_convertToJSON(OpenAPI_association_type_t *association_type) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (association_type == NULL) { ogs_error("OpenAPI_association_type_convertToJSON() failed [AssociationType]"); @@ -40,6 +42,7 @@ end: OpenAPI_association_type_t *OpenAPI_association_type_parseFromJSON(cJSON *association_typeJSON) { OpenAPI_association_type_t *association_type_local_var = NULL; + OpenAPI_lnode_t *node = NULL; association_type_local_var = OpenAPI_association_type_create ( ); diff --git a/lib/sbi/openapi/model/atom.c b/lib/sbi/openapi/model/atom.c index 863611195..5c6584bf9 100644 --- a/lib/sbi/openapi/model/atom.c +++ b/lib/sbi/openapi/model/atom.c @@ -24,18 +24,26 @@ OpenAPI_atom_t *OpenAPI_atom_create( void OpenAPI_atom_free(OpenAPI_atom_t *atom) { + OpenAPI_lnode_t *node = NULL; + if (NULL == atom) { return; } - OpenAPI_lnode_t *node; - ogs_free(atom->attr); - ogs_free(atom->value); + if (atom->attr) { + ogs_free(atom->attr); + atom->attr = NULL; + } + if (atom->value) { + ogs_free(atom->value); + atom->value = NULL; + } ogs_free(atom); } cJSON *OpenAPI_atom_convertToJSON(OpenAPI_atom_t *atom) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (atom == NULL) { ogs_error("OpenAPI_atom_convertToJSON() failed [Atom]"); @@ -43,11 +51,19 @@ cJSON *OpenAPI_atom_convertToJSON(OpenAPI_atom_t *atom) } item = cJSON_CreateObject(); + if (!atom->attr) { + ogs_error("OpenAPI_atom_convertToJSON() failed [attr]"); + return NULL; + } if (cJSON_AddStringToObject(item, "attr", atom->attr) == NULL) { ogs_error("OpenAPI_atom_convertToJSON() failed [attr]"); goto end; } + if (!atom->value) { + ogs_error("OpenAPI_atom_convertToJSON() failed [value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "value", atom->value) == NULL) { ogs_error("OpenAPI_atom_convertToJSON() failed [value]"); goto end; @@ -67,30 +83,31 @@ end: OpenAPI_atom_t *OpenAPI_atom_parseFromJSON(cJSON *atomJSON) { OpenAPI_atom_t *atom_local_var = NULL; - cJSON *attr = cJSON_GetObjectItemCaseSensitive(atomJSON, "attr"); + OpenAPI_lnode_t *node = NULL; + cJSON *attr = NULL; + cJSON *value = NULL; + cJSON *negative = NULL; + attr = cJSON_GetObjectItemCaseSensitive(atomJSON, "attr"); if (!attr) { ogs_error("OpenAPI_atom_parseFromJSON() failed [attr]"); goto end; } - if (!cJSON_IsString(attr)) { ogs_error("OpenAPI_atom_parseFromJSON() failed [attr]"); goto end; } - cJSON *value = cJSON_GetObjectItemCaseSensitive(atomJSON, "value"); + value = cJSON_GetObjectItemCaseSensitive(atomJSON, "value"); if (!value) { ogs_error("OpenAPI_atom_parseFromJSON() failed [value]"); goto end; } - if (!cJSON_IsString(value)) { ogs_error("OpenAPI_atom_parseFromJSON() failed [value]"); goto end; } - cJSON *negative = cJSON_GetObjectItemCaseSensitive(atomJSON, "negative"); - + negative = cJSON_GetObjectItemCaseSensitive(atomJSON, "negative"); if (negative) { if (!cJSON_IsBool(negative)) { ogs_error("OpenAPI_atom_parseFromJSON() failed [negative]"); diff --git a/lib/sbi/openapi/model/atsss_capability.c b/lib/sbi/openapi/model/atsss_capability.c index 40e00761e..c5eafe6d1 100644 --- a/lib/sbi/openapi/model/atsss_capability.c +++ b/lib/sbi/openapi/model/atsss_capability.c @@ -28,16 +28,18 @@ OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_create( void OpenAPI_atsss_capability_free(OpenAPI_atsss_capability_t *atsss_capability) { + OpenAPI_lnode_t *node = NULL; + if (NULL == atsss_capability) { return; } - OpenAPI_lnode_t *node; ogs_free(atsss_capability); } cJSON *OpenAPI_atsss_capability_convertToJSON(OpenAPI_atsss_capability_t *atsss_capability) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (atsss_capability == NULL) { ogs_error("OpenAPI_atsss_capability_convertToJSON() failed [AtsssCapability]"); @@ -73,8 +75,11 @@ end: OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_parseFromJSON(cJSON *atsss_capabilityJSON) { OpenAPI_atsss_capability_t *atsss_capability_local_var = NULL; - cJSON *atsss_ll = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "atsssLL"); - + OpenAPI_lnode_t *node = NULL; + cJSON *atsss_ll = NULL; + cJSON *mptcp = NULL; + cJSON *rtt_without_pmf = NULL; + atsss_ll = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "atsssLL"); if (atsss_ll) { if (!cJSON_IsBool(atsss_ll)) { ogs_error("OpenAPI_atsss_capability_parseFromJSON() failed [atsss_ll]"); @@ -82,8 +87,7 @@ OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_parseFromJSON(cJSON *atsss_ } } - cJSON *mptcp = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "mptcp"); - + mptcp = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "mptcp"); if (mptcp) { if (!cJSON_IsBool(mptcp)) { ogs_error("OpenAPI_atsss_capability_parseFromJSON() failed [mptcp]"); @@ -91,8 +95,7 @@ OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_parseFromJSON(cJSON *atsss_ } } - cJSON *rtt_without_pmf = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "rttWithoutPmf"); - + rtt_without_pmf = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "rttWithoutPmf"); if (rtt_without_pmf) { if (!cJSON_IsBool(rtt_without_pmf)) { ogs_error("OpenAPI_atsss_capability_parseFromJSON() failed [rtt_without_pmf]"); diff --git a/lib/sbi/openapi/model/ausf_info.c b/lib/sbi/openapi/model/ausf_info.c index 23cbff70d..0b330dc3b 100644 --- a/lib/sbi/openapi/model/ausf_info.c +++ b/lib/sbi/openapi/model/ausf_info.c @@ -22,25 +22,36 @@ OpenAPI_ausf_info_t *OpenAPI_ausf_info_create( void OpenAPI_ausf_info_free(OpenAPI_ausf_info_t *ausf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ausf_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(ausf_info->group_id); - OpenAPI_list_for_each(ausf_info->supi_ranges, node) { - OpenAPI_supi_range_free(node->data); + if (ausf_info->group_id) { + ogs_free(ausf_info->group_id); + ausf_info->group_id = NULL; } - OpenAPI_list_free(ausf_info->supi_ranges); - OpenAPI_list_for_each(ausf_info->routing_indicators, node) { - ogs_free(node->data); + if (ausf_info->supi_ranges) { + OpenAPI_list_for_each(ausf_info->supi_ranges, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(ausf_info->supi_ranges); + ausf_info->supi_ranges = NULL; + } + if (ausf_info->routing_indicators) { + OpenAPI_list_for_each(ausf_info->routing_indicators, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ausf_info->routing_indicators); + ausf_info->routing_indicators = NULL; } - OpenAPI_list_free(ausf_info->routing_indicators); ogs_free(ausf_info); } cJSON *OpenAPI_ausf_info_convertToJSON(OpenAPI_ausf_info_t *ausf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ausf_info == NULL) { ogs_error("OpenAPI_ausf_info_convertToJSON() failed [AusfInfo]"); @@ -61,34 +72,28 @@ cJSON *OpenAPI_ausf_info_convertToJSON(OpenAPI_ausf_info_t *ausf_info) ogs_error("OpenAPI_ausf_info_convertToJSON() failed [supi_ranges]"); goto end; } - - OpenAPI_lnode_t *supi_ranges_node; - if (ausf_info->supi_ranges) { - OpenAPI_list_for_each(ausf_info->supi_ranges, supi_ranges_node) { - cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(supi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ausf_info_convertToJSON() failed [supi_ranges]"); - goto end; - } - cJSON_AddItemToArray(supi_rangesList, itemLocal); + OpenAPI_list_for_each(ausf_info->supi_ranges, node) { + cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ausf_info_convertToJSON() failed [supi_ranges]"); + goto end; } + cJSON_AddItemToArray(supi_rangesList, itemLocal); } } if (ausf_info->routing_indicators) { - cJSON *routing_indicators = cJSON_AddArrayToObject(item, "routingIndicators"); - if (routing_indicators == NULL) { + cJSON *routing_indicatorsList = cJSON_AddArrayToObject(item, "routingIndicators"); + if (routing_indicatorsList == NULL) { ogs_error("OpenAPI_ausf_info_convertToJSON() failed [routing_indicators]"); goto end; } - - OpenAPI_lnode_t *routing_indicators_node; - OpenAPI_list_for_each(ausf_info->routing_indicators, routing_indicators_node) { - if (cJSON_AddStringToObject(routing_indicators, "", (char*)routing_indicators_node->data) == NULL) { - ogs_error("OpenAPI_ausf_info_convertToJSON() failed [routing_indicators]"); - goto end; + OpenAPI_list_for_each(ausf_info->routing_indicators, node) { + if (cJSON_AddStringToObject(routing_indicatorsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ausf_info_convertToJSON() failed [routing_indicators]"); + goto end; + } } - } } end: @@ -98,72 +103,88 @@ end: OpenAPI_ausf_info_t *OpenAPI_ausf_info_parseFromJSON(cJSON *ausf_infoJSON) { OpenAPI_ausf_info_t *ausf_info_local_var = NULL; - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "groupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *group_id = NULL; + cJSON *supi_ranges = NULL; + OpenAPI_list_t *supi_rangesList = NULL; + cJSON *routing_indicators = NULL; + OpenAPI_list_t *routing_indicatorsList = NULL; + group_id = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *supi_ranges = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "supiRanges"); - - OpenAPI_list_t *supi_rangesList; + supi_ranges = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "supiRanges"); if (supi_ranges) { - cJSON *supi_ranges_local_nonprimitive; - if (!cJSON_IsArray(supi_ranges)){ - ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [supi_ranges]"); - goto end; - } - - supi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(supi_ranges_local_nonprimitive, supi_ranges ) { - if (!cJSON_IsObject(supi_ranges_local_nonprimitive)) { + cJSON *supi_ranges_local = NULL; + if (!cJSON_IsArray(supi_ranges)) { ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [supi_ranges]"); goto end; } - OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local_nonprimitive); - if (!supi_rangesItem) { - ogs_error("No supi_rangesItem"); - OpenAPI_list_free(supi_rangesList); + supi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_ranges_local, supi_ranges) { + if (!cJSON_IsObject(supi_ranges_local)) { + ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [supi_ranges]"); + goto end; + } + OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local); + if (!supi_rangesItem) { + ogs_error("No supi_rangesItem"); + OpenAPI_list_free(supi_rangesList); + goto end; + } + OpenAPI_list_add(supi_rangesList, supi_rangesItem); + } + } + + routing_indicators = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "routingIndicators"); + if (routing_indicators) { + cJSON *routing_indicators_local = NULL; + if (!cJSON_IsArray(routing_indicators)) { + ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [routing_indicators]"); goto end; } - OpenAPI_list_add(supi_rangesList, supi_rangesItem); - } - } + routing_indicatorsList = OpenAPI_list_create(); - cJSON *routing_indicators = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "routingIndicators"); - - OpenAPI_list_t *routing_indicatorsList; - if (routing_indicators) { - cJSON *routing_indicators_local; - if (!cJSON_IsArray(routing_indicators)) { - ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [routing_indicators]"); - goto end; - } - routing_indicatorsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(routing_indicators_local, routing_indicators) { - if (!cJSON_IsString(routing_indicators_local)) { - ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [routing_indicators]"); - goto end; - } - OpenAPI_list_add(routing_indicatorsList, ogs_strdup(routing_indicators_local->valuestring)); - } + cJSON_ArrayForEach(routing_indicators_local, routing_indicators) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(routing_indicators_local)) { + ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [routing_indicators]"); + goto end; + } + OpenAPI_list_add(routing_indicatorsList, ogs_strdup(routing_indicators_local->valuestring)); + } } ausf_info_local_var = OpenAPI_ausf_info_create ( - group_id ? ogs_strdup(group_id->valuestring) : NULL, + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, supi_ranges ? supi_rangesList : NULL, routing_indicators ? routing_indicatorsList : NULL ); return ausf_info_local_var; end: + if (supi_rangesList) { + OpenAPI_list_for_each(supi_rangesList, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(supi_rangesList); + supi_rangesList = NULL; + } + if (routing_indicatorsList) { + OpenAPI_list_for_each(routing_indicatorsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(routing_indicatorsList); + routing_indicatorsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/auth_event.c b/lib/sbi/openapi/model/auth_event.c index 4438f7214..a4259b08f 100644 --- a/lib/sbi/openapi/model/auth_event.c +++ b/lib/sbi/openapi/model/auth_event.c @@ -30,19 +30,30 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_create( void OpenAPI_auth_event_free(OpenAPI_auth_event_t *auth_event) { + OpenAPI_lnode_t *node = NULL; + if (NULL == auth_event) { return; } - OpenAPI_lnode_t *node; - ogs_free(auth_event->nf_instance_id); - ogs_free(auth_event->time_stamp); - ogs_free(auth_event->serving_network_name); + if (auth_event->nf_instance_id) { + ogs_free(auth_event->nf_instance_id); + auth_event->nf_instance_id = NULL; + } + if (auth_event->time_stamp) { + ogs_free(auth_event->time_stamp); + auth_event->time_stamp = NULL; + } + if (auth_event->serving_network_name) { + ogs_free(auth_event->serving_network_name); + auth_event->serving_network_name = NULL; + } ogs_free(auth_event); } cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (auth_event == NULL) { ogs_error("OpenAPI_auth_event_convertToJSON() failed [AuthEvent]"); @@ -50,6 +61,10 @@ cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event) } item = cJSON_CreateObject(); + if (!auth_event->nf_instance_id) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [nf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfInstanceId", auth_event->nf_instance_id) == NULL) { ogs_error("OpenAPI_auth_event_convertToJSON() failed [nf_instance_id]"); goto end; @@ -60,16 +75,28 @@ cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event) goto end; } + if (!auth_event->time_stamp) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [time_stamp]"); + return NULL; + } if (cJSON_AddStringToObject(item, "timeStamp", auth_event->time_stamp) == NULL) { ogs_error("OpenAPI_auth_event_convertToJSON() failed [time_stamp]"); goto end; } + if (auth_event->auth_type == OpenAPI_auth_type_NULL) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [auth_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "authType", OpenAPI_auth_type_ToString(auth_event->auth_type)) == NULL) { ogs_error("OpenAPI_auth_event_convertToJSON() failed [auth_type]"); goto end; } + if (!auth_event->serving_network_name) { + ogs_error("OpenAPI_auth_event_convertToJSON() failed [serving_network_name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "servingNetworkName", auth_event->serving_network_name) == NULL) { ogs_error("OpenAPI_auth_event_convertToJSON() failed [serving_network_name]"); goto end; @@ -89,65 +116,66 @@ end: OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON) { OpenAPI_auth_event_t *auth_event_local_var = NULL; - cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "nfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instance_id = NULL; + cJSON *success = NULL; + cJSON *time_stamp = NULL; + cJSON *auth_type = NULL; + OpenAPI_auth_type_e auth_typeVariable = 0; + cJSON *serving_network_name = NULL; + cJSON *auth_removal_ind = NULL; + nf_instance_id = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "nfInstanceId"); if (!nf_instance_id) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [nf_instance_id]"); goto end; } - if (!cJSON_IsString(nf_instance_id)) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [nf_instance_id]"); goto end; } - cJSON *success = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "success"); + success = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "success"); if (!success) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [success]"); goto end; } - if (!cJSON_IsBool(success)) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [success]"); goto end; } - cJSON *time_stamp = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "timeStamp"); + time_stamp = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "timeStamp"); if (!time_stamp) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [time_stamp]"); goto end; } - - if (!cJSON_IsString(time_stamp)) { + if (!cJSON_IsString(time_stamp) && !cJSON_IsNull(time_stamp)) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [time_stamp]"); goto end; } - cJSON *auth_type = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authType"); + auth_type = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authType"); if (!auth_type) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_type]"); goto end; } - - OpenAPI_auth_type_e auth_typeVariable; if (!cJSON_IsString(auth_type)) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_type]"); goto end; } auth_typeVariable = OpenAPI_auth_type_FromString(auth_type->valuestring); - cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "servingNetworkName"); + serving_network_name = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "servingNetworkName"); if (!serving_network_name) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [serving_network_name]"); goto end; } - if (!cJSON_IsString(serving_network_name)) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [serving_network_name]"); goto end; } - cJSON *auth_removal_ind = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authRemovalInd"); - + auth_removal_ind = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authRemovalInd"); if (auth_removal_ind) { if (!cJSON_IsBool(auth_removal_ind)) { ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_removal_ind]"); diff --git a/lib/sbi/openapi/model/authentication_info.c b/lib/sbi/openapi/model/authentication_info.c index ae2ead2fe..73fdb98cf 100644 --- a/lib/sbi/openapi/model/authentication_info.c +++ b/lib/sbi/openapi/model/authentication_info.c @@ -38,28 +38,57 @@ OpenAPI_authentication_info_t *OpenAPI_authentication_info_create( void OpenAPI_authentication_info_free(OpenAPI_authentication_info_t *authentication_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == authentication_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(authentication_info->supi_or_suci); - ogs_free(authentication_info->serving_network_name); - OpenAPI_resynchronization_info_free(authentication_info->resynchronization_info); - ogs_free(authentication_info->pei); - OpenAPI_trace_data_free(authentication_info->trace_data); - ogs_free(authentication_info->udm_group_id); - ogs_free(authentication_info->routing_indicator); - OpenAPI_list_for_each(authentication_info->cell_cag_info, node) { - ogs_free(node->data); + if (authentication_info->supi_or_suci) { + ogs_free(authentication_info->supi_or_suci); + authentication_info->supi_or_suci = NULL; + } + if (authentication_info->serving_network_name) { + ogs_free(authentication_info->serving_network_name); + authentication_info->serving_network_name = NULL; + } + if (authentication_info->resynchronization_info) { + OpenAPI_resynchronization_info_free(authentication_info->resynchronization_info); + authentication_info->resynchronization_info = NULL; + } + if (authentication_info->pei) { + ogs_free(authentication_info->pei); + authentication_info->pei = NULL; + } + if (authentication_info->trace_data) { + OpenAPI_trace_data_free(authentication_info->trace_data); + authentication_info->trace_data = NULL; + } + if (authentication_info->udm_group_id) { + ogs_free(authentication_info->udm_group_id); + authentication_info->udm_group_id = NULL; + } + if (authentication_info->routing_indicator) { + ogs_free(authentication_info->routing_indicator); + authentication_info->routing_indicator = NULL; + } + if (authentication_info->cell_cag_info) { + OpenAPI_list_for_each(authentication_info->cell_cag_info, node) { + ogs_free(node->data); + } + OpenAPI_list_free(authentication_info->cell_cag_info); + authentication_info->cell_cag_info = NULL; + } + if (authentication_info->supported_features) { + ogs_free(authentication_info->supported_features); + authentication_info->supported_features = NULL; } - OpenAPI_list_free(authentication_info->cell_cag_info); - ogs_free(authentication_info->supported_features); ogs_free(authentication_info); } cJSON *OpenAPI_authentication_info_convertToJSON(OpenAPI_authentication_info_t *authentication_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (authentication_info == NULL) { ogs_error("OpenAPI_authentication_info_convertToJSON() failed [AuthenticationInfo]"); @@ -67,11 +96,19 @@ cJSON *OpenAPI_authentication_info_convertToJSON(OpenAPI_authentication_info_t * } item = cJSON_CreateObject(); + if (!authentication_info->supi_or_suci) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [supi_or_suci]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supiOrSuci", authentication_info->supi_or_suci) == NULL) { ogs_error("OpenAPI_authentication_info_convertToJSON() failed [supi_or_suci]"); goto end; } + if (!authentication_info->serving_network_name) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [serving_network_name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "servingNetworkName", authentication_info->serving_network_name) == NULL) { ogs_error("OpenAPI_authentication_info_convertToJSON() failed [serving_network_name]"); goto end; @@ -125,19 +162,17 @@ cJSON *OpenAPI_authentication_info_convertToJSON(OpenAPI_authentication_info_t * } if (authentication_info->cell_cag_info) { - cJSON *cell_cag_info = cJSON_AddArrayToObject(item, "cellCagInfo"); - if (cell_cag_info == NULL) { + cJSON *cell_cag_infoList = cJSON_AddArrayToObject(item, "cellCagInfo"); + if (cell_cag_infoList == NULL) { ogs_error("OpenAPI_authentication_info_convertToJSON() failed [cell_cag_info]"); goto end; } - - OpenAPI_lnode_t *cell_cag_info_node; - OpenAPI_list_for_each(authentication_info->cell_cag_info, cell_cag_info_node) { - if (cJSON_AddStringToObject(cell_cag_info, "", (char*)cell_cag_info_node->data) == NULL) { - ogs_error("OpenAPI_authentication_info_convertToJSON() failed [cell_cag_info]"); - goto end; + OpenAPI_list_for_each(authentication_info->cell_cag_info, node) { + if (cJSON_AddStringToObject(cell_cag_infoList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_authentication_info_convertToJSON() failed [cell_cag_info]"); + goto end; + } } - } } if (authentication_info->is_n5gc_ind) { @@ -161,91 +196,96 @@ end: OpenAPI_authentication_info_t *OpenAPI_authentication_info_parseFromJSON(cJSON *authentication_infoJSON) { OpenAPI_authentication_info_t *authentication_info_local_var = NULL; - cJSON *supi_or_suci = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supiOrSuci"); + OpenAPI_lnode_t *node = NULL; + cJSON *supi_or_suci = NULL; + cJSON *serving_network_name = NULL; + cJSON *resynchronization_info = NULL; + OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + cJSON *pei = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *udm_group_id = NULL; + cJSON *routing_indicator = NULL; + cJSON *cell_cag_info = NULL; + OpenAPI_list_t *cell_cag_infoList = NULL; + cJSON *n5gc_ind = NULL; + cJSON *supported_features = NULL; + supi_or_suci = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supiOrSuci"); if (!supi_or_suci) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [supi_or_suci]"); goto end; } - if (!cJSON_IsString(supi_or_suci)) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [supi_or_suci]"); goto end; } - cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "servingNetworkName"); + serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "servingNetworkName"); if (!serving_network_name) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [serving_network_name]"); goto end; } - if (!cJSON_IsString(serving_network_name)) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [serving_network_name]"); goto end; } - cJSON *resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "resynchronizationInfo"); - - OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "resynchronizationInfo"); if (resynchronization_info) { resynchronization_info_local_nonprim = OpenAPI_resynchronization_info_parseFromJSON(resynchronization_info); } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [pei]"); goto end; } } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *udm_group_id = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "udmGroupId"); - + udm_group_id = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "udmGroupId"); if (udm_group_id) { - if (!cJSON_IsString(udm_group_id)) { + if (!cJSON_IsString(udm_group_id) && !cJSON_IsNull(udm_group_id)) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [udm_group_id]"); goto end; } } - cJSON *routing_indicator = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "routingIndicator"); - + routing_indicator = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "routingIndicator"); if (routing_indicator) { - if (!cJSON_IsString(routing_indicator)) { + if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [routing_indicator]"); goto end; } } - cJSON *cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "cellCagInfo"); - - OpenAPI_list_t *cell_cag_infoList; + cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "cellCagInfo"); if (cell_cag_info) { - cJSON *cell_cag_info_local; - if (!cJSON_IsArray(cell_cag_info)) { - ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cell_cag_info]"); - goto end; - } - cell_cag_infoList = OpenAPI_list_create(); + cJSON *cell_cag_info_local = NULL; + if (!cJSON_IsArray(cell_cag_info)) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cell_cag_info]"); + goto end; + } - cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) { - if (!cJSON_IsString(cell_cag_info_local)) { - ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cell_cag_info]"); - goto end; - } - OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring)); - } + cell_cag_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(cell_cag_info_local)) { + ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cell_cag_info]"); + goto end; + } + OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring)); + } } - cJSON *n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "n5gcInd"); - + n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "n5gcInd"); if (n5gc_ind) { if (!cJSON_IsBool(n5gc_ind)) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [n5gc_ind]"); @@ -253,10 +293,9 @@ OpenAPI_authentication_info_t *OpenAPI_authentication_info_parseFromJSON(cJSON * } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [supported_features]"); goto end; } @@ -266,18 +305,33 @@ OpenAPI_authentication_info_t *OpenAPI_authentication_info_parseFromJSON(cJSON * ogs_strdup(supi_or_suci->valuestring), ogs_strdup(serving_network_name->valuestring), resynchronization_info ? resynchronization_info_local_nonprim : NULL, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, trace_data ? trace_data_local_nonprim : NULL, - udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL, - routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL, + udm_group_id && !cJSON_IsNull(udm_group_id) ? ogs_strdup(udm_group_id->valuestring) : NULL, + routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL, cell_cag_info ? cell_cag_infoList : NULL, n5gc_ind ? true : false, n5gc_ind ? n5gc_ind->valueint : 0, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return authentication_info_local_var; end: + if (resynchronization_info_local_nonprim) { + OpenAPI_resynchronization_info_free(resynchronization_info_local_nonprim); + resynchronization_info_local_nonprim = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (cell_cag_infoList) { + OpenAPI_list_for_each(cell_cag_infoList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cell_cag_infoList); + cell_cag_infoList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/authentication_info_request.c b/lib/sbi/openapi/model/authentication_info_request.c index 9e4e37845..9c03f27b5 100644 --- a/lib/sbi/openapi/model/authentication_info_request.c +++ b/lib/sbi/openapi/model/authentication_info_request.c @@ -30,24 +30,41 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_creat void OpenAPI_authentication_info_request_free(OpenAPI_authentication_info_request_t *authentication_info_request) { + OpenAPI_lnode_t *node = NULL; + if (NULL == authentication_info_request) { return; } - OpenAPI_lnode_t *node; - ogs_free(authentication_info_request->supported_features); - ogs_free(authentication_info_request->serving_network_name); - OpenAPI_resynchronization_info_free(authentication_info_request->resynchronization_info); - ogs_free(authentication_info_request->ausf_instance_id); - OpenAPI_list_for_each(authentication_info_request->cell_cag_info, node) { - ogs_free(node->data); + if (authentication_info_request->supported_features) { + ogs_free(authentication_info_request->supported_features); + authentication_info_request->supported_features = NULL; + } + if (authentication_info_request->serving_network_name) { + ogs_free(authentication_info_request->serving_network_name); + authentication_info_request->serving_network_name = NULL; + } + if (authentication_info_request->resynchronization_info) { + OpenAPI_resynchronization_info_free(authentication_info_request->resynchronization_info); + authentication_info_request->resynchronization_info = NULL; + } + if (authentication_info_request->ausf_instance_id) { + ogs_free(authentication_info_request->ausf_instance_id); + authentication_info_request->ausf_instance_id = NULL; + } + if (authentication_info_request->cell_cag_info) { + OpenAPI_list_for_each(authentication_info_request->cell_cag_info, node) { + ogs_free(node->data); + } + OpenAPI_list_free(authentication_info_request->cell_cag_info); + authentication_info_request->cell_cag_info = NULL; } - OpenAPI_list_free(authentication_info_request->cell_cag_info); ogs_free(authentication_info_request); } cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_info_request_t *authentication_info_request) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (authentication_info_request == NULL) { ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [AuthenticationInfoRequest]"); @@ -62,6 +79,10 @@ cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_ } } + if (!authentication_info_request->serving_network_name) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [serving_network_name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "servingNetworkName", authentication_info_request->serving_network_name) == NULL) { ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [serving_network_name]"); goto end; @@ -80,25 +101,27 @@ cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_ } } + if (!authentication_info_request->ausf_instance_id) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [ausf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ausfInstanceId", authentication_info_request->ausf_instance_id) == NULL) { ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [ausf_instance_id]"); goto end; } if (authentication_info_request->cell_cag_info) { - cJSON *cell_cag_info = cJSON_AddArrayToObject(item, "cellCagInfo"); - if (cell_cag_info == NULL) { + cJSON *cell_cag_infoList = cJSON_AddArrayToObject(item, "cellCagInfo"); + if (cell_cag_infoList == NULL) { ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cell_cag_info]"); goto end; } - - OpenAPI_lnode_t *cell_cag_info_node; - OpenAPI_list_for_each(authentication_info_request->cell_cag_info, cell_cag_info_node) { - if (cJSON_AddStringToObject(cell_cag_info, "", (char*)cell_cag_info_node->data) == NULL) { - ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cell_cag_info]"); - goto end; + OpenAPI_list_for_each(authentication_info_request->cell_cag_info, node) { + if (cJSON_AddStringToObject(cell_cag_infoList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cell_cag_info]"); + goto end; + } } - } } if (authentication_info_request->is_n5gc_ind) { @@ -115,66 +138,70 @@ end: OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parseFromJSON(cJSON *authentication_info_requestJSON) { OpenAPI_authentication_info_request_t *authentication_info_request_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *serving_network_name = NULL; + cJSON *resynchronization_info = NULL; + OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + cJSON *ausf_instance_id = NULL; + cJSON *cell_cag_info = NULL; + OpenAPI_list_t *cell_cag_infoList = NULL; + cJSON *n5gc_ind = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "servingNetworkName"); + serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "servingNetworkName"); if (!serving_network_name) { ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [serving_network_name]"); goto end; } - if (!cJSON_IsString(serving_network_name)) { ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [serving_network_name]"); goto end; } - cJSON *resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "resynchronizationInfo"); - - OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "resynchronizationInfo"); if (resynchronization_info) { resynchronization_info_local_nonprim = OpenAPI_resynchronization_info_parseFromJSON(resynchronization_info); } - cJSON *ausf_instance_id = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "ausfInstanceId"); + ausf_instance_id = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "ausfInstanceId"); if (!ausf_instance_id) { ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [ausf_instance_id]"); goto end; } - if (!cJSON_IsString(ausf_instance_id)) { ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [ausf_instance_id]"); goto end; } - cJSON *cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "cellCagInfo"); - - OpenAPI_list_t *cell_cag_infoList; + cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "cellCagInfo"); if (cell_cag_info) { - cJSON *cell_cag_info_local; - if (!cJSON_IsArray(cell_cag_info)) { - ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]"); - goto end; - } - cell_cag_infoList = OpenAPI_list_create(); + cJSON *cell_cag_info_local = NULL; + if (!cJSON_IsArray(cell_cag_info)) { + ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]"); + goto end; + } - cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) { - if (!cJSON_IsString(cell_cag_info_local)) { - ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]"); - goto end; - } - OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring)); - } + cell_cag_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(cell_cag_info_local)) { + ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]"); + goto end; + } + OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring)); + } } - cJSON *n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "n5gcInd"); - + n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "n5gcInd"); if (n5gc_ind) { if (!cJSON_IsBool(n5gc_ind)) { ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [n5gc_ind]"); @@ -183,7 +210,7 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parse } authentication_info_request_local_var = OpenAPI_authentication_info_request_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, ogs_strdup(serving_network_name->valuestring), resynchronization_info ? resynchronization_info_local_nonprim : NULL, ogs_strdup(ausf_instance_id->valuestring), @@ -194,6 +221,17 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parse return authentication_info_request_local_var; end: + if (resynchronization_info_local_nonprim) { + OpenAPI_resynchronization_info_free(resynchronization_info_local_nonprim); + resynchronization_info_local_nonprim = NULL; + } + if (cell_cag_infoList) { + OpenAPI_list_for_each(cell_cag_infoList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cell_cag_infoList); + cell_cag_infoList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/authentication_info_result.c b/lib/sbi/openapi/model/authentication_info_result.c index b8204cb6f..adaacea36 100644 --- a/lib/sbi/openapi/model/authentication_info_result.c +++ b/lib/sbi/openapi/model/authentication_info_result.c @@ -24,19 +24,30 @@ OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_create( void OpenAPI_authentication_info_result_free(OpenAPI_authentication_info_result_t *authentication_info_result) { + OpenAPI_lnode_t *node = NULL; + if (NULL == authentication_info_result) { return; } - OpenAPI_lnode_t *node; - ogs_free(authentication_info_result->supported_features); - OpenAPI_authentication_vector_free(authentication_info_result->authentication_vector); - ogs_free(authentication_info_result->supi); + if (authentication_info_result->supported_features) { + ogs_free(authentication_info_result->supported_features); + authentication_info_result->supported_features = NULL; + } + if (authentication_info_result->authentication_vector) { + OpenAPI_authentication_vector_free(authentication_info_result->authentication_vector); + authentication_info_result->authentication_vector = NULL; + } + if (authentication_info_result->supi) { + ogs_free(authentication_info_result->supi); + authentication_info_result->supi = NULL; + } ogs_free(authentication_info_result); } cJSON *OpenAPI_authentication_info_result_convertToJSON(OpenAPI_authentication_info_result_t *authentication_info_result) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (authentication_info_result == NULL) { ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [AuthenticationInfoResult]"); @@ -44,6 +55,10 @@ cJSON *OpenAPI_authentication_info_result_convertToJSON(OpenAPI_authentication_i } item = cJSON_CreateObject(); + if (authentication_info_result->auth_type == OpenAPI_auth_type_NULL) { + ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [auth_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "authType", OpenAPI_auth_type_ToString(authentication_info_result->auth_type)) == NULL) { ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [auth_type]"); goto end; @@ -83,39 +98,40 @@ end: OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_parseFromJSON(cJSON *authentication_info_resultJSON) { OpenAPI_authentication_info_result_t *authentication_info_result_local_var = NULL; - cJSON *auth_type = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authType"); + OpenAPI_lnode_t *node = NULL; + cJSON *auth_type = NULL; + OpenAPI_auth_type_e auth_typeVariable = 0; + cJSON *supported_features = NULL; + cJSON *authentication_vector = NULL; + OpenAPI_authentication_vector_t *authentication_vector_local_nonprim = NULL; + cJSON *supi = NULL; + auth_type = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authType"); if (!auth_type) { ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [auth_type]"); goto end; } - - OpenAPI_auth_type_e auth_typeVariable; if (!cJSON_IsString(auth_type)) { ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [auth_type]"); goto end; } auth_typeVariable = OpenAPI_auth_type_FromString(auth_type->valuestring); - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *authentication_vector = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authenticationVector"); - - OpenAPI_authentication_vector_t *authentication_vector_local_nonprim = NULL; + authentication_vector = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authenticationVector"); if (authentication_vector) { authentication_vector_local_nonprim = OpenAPI_authentication_vector_parseFromJSON(authentication_vector); } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [supi]"); goto end; } @@ -123,13 +139,17 @@ OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_parseFr authentication_info_result_local_var = OpenAPI_authentication_info_result_create ( auth_typeVariable, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, authentication_vector ? authentication_vector_local_nonprim : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL ); return authentication_info_result_local_var; end: + if (authentication_vector_local_nonprim) { + OpenAPI_authentication_vector_free(authentication_vector_local_nonprim); + authentication_vector_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/authentication_subscription.c b/lib/sbi/openapi/model/authentication_subscription.c index c4f42bac3..547aa5e84 100644 --- a/lib/sbi/openapi/model/authentication_subscription.c +++ b/lib/sbi/openapi/model/authentication_subscription.c @@ -44,24 +44,50 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_creat void OpenAPI_authentication_subscription_free(OpenAPI_authentication_subscription_t *authentication_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == authentication_subscription) { return; } - OpenAPI_lnode_t *node; - ogs_free(authentication_subscription->enc_permanent_key); - ogs_free(authentication_subscription->protection_parameter_id); - OpenAPI_sequence_number_free(authentication_subscription->sequence_number); - ogs_free(authentication_subscription->authentication_management_field); - ogs_free(authentication_subscription->algorithm_id); - ogs_free(authentication_subscription->enc_opc_key); - ogs_free(authentication_subscription->enc_topc_key); - ogs_free(authentication_subscription->supi); + if (authentication_subscription->enc_permanent_key) { + ogs_free(authentication_subscription->enc_permanent_key); + authentication_subscription->enc_permanent_key = NULL; + } + if (authentication_subscription->protection_parameter_id) { + ogs_free(authentication_subscription->protection_parameter_id); + authentication_subscription->protection_parameter_id = NULL; + } + if (authentication_subscription->sequence_number) { + OpenAPI_sequence_number_free(authentication_subscription->sequence_number); + authentication_subscription->sequence_number = NULL; + } + if (authentication_subscription->authentication_management_field) { + ogs_free(authentication_subscription->authentication_management_field); + authentication_subscription->authentication_management_field = NULL; + } + if (authentication_subscription->algorithm_id) { + ogs_free(authentication_subscription->algorithm_id); + authentication_subscription->algorithm_id = NULL; + } + if (authentication_subscription->enc_opc_key) { + ogs_free(authentication_subscription->enc_opc_key); + authentication_subscription->enc_opc_key = NULL; + } + if (authentication_subscription->enc_topc_key) { + ogs_free(authentication_subscription->enc_topc_key); + authentication_subscription->enc_topc_key = NULL; + } + if (authentication_subscription->supi) { + ogs_free(authentication_subscription->supi); + authentication_subscription->supi = NULL; + } ogs_free(authentication_subscription); } cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_subscription_t *authentication_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (authentication_subscription == NULL) { ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [AuthenticationSubscription]"); @@ -69,6 +95,10 @@ cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_ } item = cJSON_CreateObject(); + if (authentication_subscription->authentication_method == OpenAPI_auth_method_NULL) { + ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [authentication_method]"); + return NULL; + } if (cJSON_AddStringToObject(item, "authenticationMethod", OpenAPI_auth_method_ToString(authentication_subscription->authentication_method)) == NULL) { ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [authentication_method]"); goto end; @@ -136,7 +166,7 @@ cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_ } } - if (authentication_subscription->n5gc_auth_method) { + if (authentication_subscription->n5gc_auth_method != OpenAPI_auth_method_NULL) { if (cJSON_AddStringToObject(item, "n5gcAuthMethod", OpenAPI_auth_method_ToString(authentication_subscription->n5gc_auth_method)) == NULL) { ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [n5gc_auth_method]"); goto end; @@ -164,82 +194,87 @@ end: OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parseFromJSON(cJSON *authentication_subscriptionJSON) { OpenAPI_authentication_subscription_t *authentication_subscription_local_var = NULL; - cJSON *authentication_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationMethod"); + OpenAPI_lnode_t *node = NULL; + cJSON *authentication_method = NULL; + OpenAPI_auth_method_e authentication_methodVariable = 0; + cJSON *enc_permanent_key = NULL; + cJSON *protection_parameter_id = NULL; + cJSON *sequence_number = NULL; + OpenAPI_sequence_number_t *sequence_number_local_nonprim = NULL; + cJSON *authentication_management_field = NULL; + cJSON *algorithm_id = NULL; + cJSON *enc_opc_key = NULL; + cJSON *enc_topc_key = NULL; + cJSON *vector_generation_in_hss = NULL; + cJSON *n5gc_auth_method = NULL; + OpenAPI_auth_method_e n5gc_auth_methodVariable = 0; + cJSON *rg_authentication_ind = NULL; + cJSON *supi = NULL; + authentication_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationMethod"); if (!authentication_method) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_method]"); goto end; } - - OpenAPI_auth_method_e authentication_methodVariable; if (!cJSON_IsString(authentication_method)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_method]"); goto end; } authentication_methodVariable = OpenAPI_auth_method_FromString(authentication_method->valuestring); - cJSON *enc_permanent_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encPermanentKey"); - + enc_permanent_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encPermanentKey"); if (enc_permanent_key) { - if (!cJSON_IsString(enc_permanent_key)) { + if (!cJSON_IsString(enc_permanent_key) && !cJSON_IsNull(enc_permanent_key)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_permanent_key]"); goto end; } } - cJSON *protection_parameter_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "protectionParameterId"); - + protection_parameter_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "protectionParameterId"); if (protection_parameter_id) { - if (!cJSON_IsString(protection_parameter_id)) { + if (!cJSON_IsString(protection_parameter_id) && !cJSON_IsNull(protection_parameter_id)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [protection_parameter_id]"); goto end; } } - cJSON *sequence_number = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "sequenceNumber"); - - OpenAPI_sequence_number_t *sequence_number_local_nonprim = NULL; + sequence_number = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "sequenceNumber"); if (sequence_number) { sequence_number_local_nonprim = OpenAPI_sequence_number_parseFromJSON(sequence_number); } - cJSON *authentication_management_field = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationManagementField"); - + authentication_management_field = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationManagementField"); if (authentication_management_field) { - if (!cJSON_IsString(authentication_management_field)) { + if (!cJSON_IsString(authentication_management_field) && !cJSON_IsNull(authentication_management_field)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_management_field]"); goto end; } } - cJSON *algorithm_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "algorithmId"); - + algorithm_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "algorithmId"); if (algorithm_id) { - if (!cJSON_IsString(algorithm_id)) { + if (!cJSON_IsString(algorithm_id) && !cJSON_IsNull(algorithm_id)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [algorithm_id]"); goto end; } } - cJSON *enc_opc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encOpcKey"); - + enc_opc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encOpcKey"); if (enc_opc_key) { - if (!cJSON_IsString(enc_opc_key)) { + if (!cJSON_IsString(enc_opc_key) && !cJSON_IsNull(enc_opc_key)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_opc_key]"); goto end; } } - cJSON *enc_topc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encTopcKey"); - + enc_topc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encTopcKey"); if (enc_topc_key) { - if (!cJSON_IsString(enc_topc_key)) { + if (!cJSON_IsString(enc_topc_key) && !cJSON_IsNull(enc_topc_key)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_topc_key]"); goto end; } } - cJSON *vector_generation_in_hss = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "vectorGenerationInHss"); - + vector_generation_in_hss = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "vectorGenerationInHss"); if (vector_generation_in_hss) { if (!cJSON_IsBool(vector_generation_in_hss)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [vector_generation_in_hss]"); @@ -247,9 +282,7 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse } } - cJSON *n5gc_auth_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "n5gcAuthMethod"); - - OpenAPI_auth_method_e n5gc_auth_methodVariable; + n5gc_auth_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "n5gcAuthMethod"); if (n5gc_auth_method) { if (!cJSON_IsString(n5gc_auth_method)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [n5gc_auth_method]"); @@ -258,8 +291,7 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse n5gc_auth_methodVariable = OpenAPI_auth_method_FromString(n5gc_auth_method->valuestring); } - cJSON *rg_authentication_ind = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "rgAuthenticationInd"); - + rg_authentication_ind = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "rgAuthenticationInd"); if (rg_authentication_ind) { if (!cJSON_IsBool(rg_authentication_ind)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [rg_authentication_ind]"); @@ -267,10 +299,9 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [supi]"); goto end; } @@ -278,23 +309,27 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse authentication_subscription_local_var = OpenAPI_authentication_subscription_create ( authentication_methodVariable, - enc_permanent_key ? ogs_strdup(enc_permanent_key->valuestring) : NULL, - protection_parameter_id ? ogs_strdup(protection_parameter_id->valuestring) : NULL, + enc_permanent_key && !cJSON_IsNull(enc_permanent_key) ? ogs_strdup(enc_permanent_key->valuestring) : NULL, + protection_parameter_id && !cJSON_IsNull(protection_parameter_id) ? ogs_strdup(protection_parameter_id->valuestring) : NULL, sequence_number ? sequence_number_local_nonprim : NULL, - authentication_management_field ? ogs_strdup(authentication_management_field->valuestring) : NULL, - algorithm_id ? ogs_strdup(algorithm_id->valuestring) : NULL, - enc_opc_key ? ogs_strdup(enc_opc_key->valuestring) : NULL, - enc_topc_key ? ogs_strdup(enc_topc_key->valuestring) : NULL, + authentication_management_field && !cJSON_IsNull(authentication_management_field) ? ogs_strdup(authentication_management_field->valuestring) : NULL, + algorithm_id && !cJSON_IsNull(algorithm_id) ? ogs_strdup(algorithm_id->valuestring) : NULL, + enc_opc_key && !cJSON_IsNull(enc_opc_key) ? ogs_strdup(enc_opc_key->valuestring) : NULL, + enc_topc_key && !cJSON_IsNull(enc_topc_key) ? ogs_strdup(enc_topc_key->valuestring) : NULL, vector_generation_in_hss ? true : false, vector_generation_in_hss ? vector_generation_in_hss->valueint : 0, n5gc_auth_method ? n5gc_auth_methodVariable : 0, rg_authentication_ind ? true : false, rg_authentication_ind ? rg_authentication_ind->valueint : 0, - supi ? ogs_strdup(supi->valuestring) : NULL + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL ); return authentication_subscription_local_var; end: + if (sequence_number_local_nonprim) { + OpenAPI_sequence_number_free(sequence_number_local_nonprim); + sequence_number_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/authentication_vector.c b/lib/sbi/openapi/model/authentication_vector.c index 07453990c..681ad6c2c 100644 --- a/lib/sbi/openapi/model/authentication_vector.c +++ b/lib/sbi/openapi/model/authentication_vector.c @@ -32,23 +32,46 @@ OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_create( void OpenAPI_authentication_vector_free(OpenAPI_authentication_vector_t *authentication_vector) { + OpenAPI_lnode_t *node = NULL; + if (NULL == authentication_vector) { return; } - OpenAPI_lnode_t *node; - ogs_free(authentication_vector->rand); - ogs_free(authentication_vector->xres); - ogs_free(authentication_vector->autn); - ogs_free(authentication_vector->ck_prime); - ogs_free(authentication_vector->ik_prime); - ogs_free(authentication_vector->xres_star); - ogs_free(authentication_vector->kausf); + if (authentication_vector->rand) { + ogs_free(authentication_vector->rand); + authentication_vector->rand = NULL; + } + if (authentication_vector->xres) { + ogs_free(authentication_vector->xres); + authentication_vector->xres = NULL; + } + if (authentication_vector->autn) { + ogs_free(authentication_vector->autn); + authentication_vector->autn = NULL; + } + if (authentication_vector->ck_prime) { + ogs_free(authentication_vector->ck_prime); + authentication_vector->ck_prime = NULL; + } + if (authentication_vector->ik_prime) { + ogs_free(authentication_vector->ik_prime); + authentication_vector->ik_prime = NULL; + } + if (authentication_vector->xres_star) { + ogs_free(authentication_vector->xres_star); + authentication_vector->xres_star = NULL; + } + if (authentication_vector->kausf) { + ogs_free(authentication_vector->kausf); + authentication_vector->kausf = NULL; + } ogs_free(authentication_vector); } cJSON *OpenAPI_authentication_vector_convertToJSON(OpenAPI_authentication_vector_t *authentication_vector) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (authentication_vector == NULL) { ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [AuthenticationVector]"); @@ -56,11 +79,19 @@ cJSON *OpenAPI_authentication_vector_convertToJSON(OpenAPI_authentication_vector } item = cJSON_CreateObject(); + if (authentication_vector->av_type == OpenAPI_av_type_NULL) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [av_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "avType", OpenAPI_av_type_ToString(authentication_vector->av_type)) == NULL) { ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [av_type]"); goto end; } + if (!authentication_vector->rand) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [rand]"); + return NULL; + } if (cJSON_AddStringToObject(item, "rand", authentication_vector->rand) == NULL) { ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [rand]"); goto end; @@ -73,6 +104,10 @@ cJSON *OpenAPI_authentication_vector_convertToJSON(OpenAPI_authentication_vector } } + if (!authentication_vector->autn) { + ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [autn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "autn", authentication_vector->autn) == NULL) { ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [autn]"); goto end; @@ -113,81 +148,82 @@ end: OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_parseFromJSON(cJSON *authentication_vectorJSON) { OpenAPI_authentication_vector_t *authentication_vector_local_var = NULL; - cJSON *av_type = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "avType"); + OpenAPI_lnode_t *node = NULL; + cJSON *av_type = NULL; + OpenAPI_av_type_e av_typeVariable = 0; + cJSON *rand = NULL; + cJSON *xres = NULL; + cJSON *autn = NULL; + cJSON *ck_prime = NULL; + cJSON *ik_prime = NULL; + cJSON *xres_star = NULL; + cJSON *kausf = NULL; + av_type = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "avType"); if (!av_type) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [av_type]"); goto end; } - - OpenAPI_av_type_e av_typeVariable; if (!cJSON_IsString(av_type)) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [av_type]"); goto end; } av_typeVariable = OpenAPI_av_type_FromString(av_type->valuestring); - cJSON *rand = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "rand"); + rand = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "rand"); if (!rand) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [rand]"); goto end; } - if (!cJSON_IsString(rand)) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [rand]"); goto end; } - cJSON *xres = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xres"); - + xres = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xres"); if (xres) { - if (!cJSON_IsString(xres)) { + if (!cJSON_IsString(xres) && !cJSON_IsNull(xres)) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [xres]"); goto end; } } - cJSON *autn = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "autn"); + autn = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "autn"); if (!autn) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [autn]"); goto end; } - if (!cJSON_IsString(autn)) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [autn]"); goto end; } - cJSON *ck_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ckPrime"); - + ck_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ckPrime"); if (ck_prime) { - if (!cJSON_IsString(ck_prime)) { + if (!cJSON_IsString(ck_prime) && !cJSON_IsNull(ck_prime)) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [ck_prime]"); goto end; } } - cJSON *ik_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ikPrime"); - + ik_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ikPrime"); if (ik_prime) { - if (!cJSON_IsString(ik_prime)) { + if (!cJSON_IsString(ik_prime) && !cJSON_IsNull(ik_prime)) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [ik_prime]"); goto end; } } - cJSON *xres_star = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xresStar"); - + xres_star = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xresStar"); if (xres_star) { - if (!cJSON_IsString(xres_star)) { + if (!cJSON_IsString(xres_star) && !cJSON_IsNull(xres_star)) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [xres_star]"); goto end; } } - cJSON *kausf = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "kausf"); - + kausf = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "kausf"); if (kausf) { - if (!cJSON_IsString(kausf)) { + if (!cJSON_IsString(kausf) && !cJSON_IsNull(kausf)) { ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [kausf]"); goto end; } @@ -196,12 +232,12 @@ OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_parseFromJSON(cJS authentication_vector_local_var = OpenAPI_authentication_vector_create ( av_typeVariable, ogs_strdup(rand->valuestring), - xres ? ogs_strdup(xres->valuestring) : NULL, + xres && !cJSON_IsNull(xres) ? ogs_strdup(xres->valuestring) : NULL, ogs_strdup(autn->valuestring), - ck_prime ? ogs_strdup(ck_prime->valuestring) : NULL, - ik_prime ? ogs_strdup(ik_prime->valuestring) : NULL, - xres_star ? ogs_strdup(xres_star->valuestring) : NULL, - kausf ? ogs_strdup(kausf->valuestring) : NULL + ck_prime && !cJSON_IsNull(ck_prime) ? ogs_strdup(ck_prime->valuestring) : NULL, + ik_prime && !cJSON_IsNull(ik_prime) ? ogs_strdup(ik_prime->valuestring) : NULL, + xres_star && !cJSON_IsNull(xres_star) ? ogs_strdup(xres_star->valuestring) : NULL, + kausf && !cJSON_IsNull(kausf) ? ogs_strdup(kausf->valuestring) : NULL ); return authentication_vector_local_var; diff --git a/lib/sbi/openapi/model/authorization_data.c b/lib/sbi/openapi/model/authorization_data.c index 6219af06e..f61615be4 100644 --- a/lib/sbi/openapi/model/authorization_data.c +++ b/lib/sbi/openapi/model/authorization_data.c @@ -20,21 +20,29 @@ OpenAPI_authorization_data_t *OpenAPI_authorization_data_create( void OpenAPI_authorization_data_free(OpenAPI_authorization_data_t *authorization_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == authorization_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(authorization_data->authorization_data, node) { - OpenAPI_user_identifier_free(node->data); + if (authorization_data->authorization_data) { + OpenAPI_list_for_each(authorization_data->authorization_data, node) { + OpenAPI_user_identifier_free(node->data); + } + OpenAPI_list_free(authorization_data->authorization_data); + authorization_data->authorization_data = NULL; + } + if (authorization_data->validity_time) { + ogs_free(authorization_data->validity_time); + authorization_data->validity_time = NULL; } - OpenAPI_list_free(authorization_data->authorization_data); - ogs_free(authorization_data->validity_time); ogs_free(authorization_data); } cJSON *OpenAPI_authorization_data_convertToJSON(OpenAPI_authorization_data_t *authorization_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (authorization_data == NULL) { ogs_error("OpenAPI_authorization_data_convertToJSON() failed [AuthorizationData]"); @@ -42,22 +50,22 @@ cJSON *OpenAPI_authorization_data_convertToJSON(OpenAPI_authorization_data_t *au } item = cJSON_CreateObject(); + if (!authorization_data->authorization_data) { + ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]"); + return NULL; + } cJSON *authorization_dataList = cJSON_AddArrayToObject(item, "authorizationData"); if (authorization_dataList == NULL) { ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]"); goto end; } - - OpenAPI_lnode_t *authorization_data_node; - if (authorization_data->authorization_data) { - OpenAPI_list_for_each(authorization_data->authorization_data, authorization_data_node) { - cJSON *itemLocal = OpenAPI_user_identifier_convertToJSON(authorization_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]"); - goto end; - } - cJSON_AddItemToArray(authorization_dataList, itemLocal); + OpenAPI_list_for_each(authorization_data->authorization_data, node) { + cJSON *itemLocal = OpenAPI_user_identifier_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]"); + goto end; } + cJSON_AddItemToArray(authorization_dataList, itemLocal); } if (authorization_data->validity_time) { @@ -74,41 +82,40 @@ end: OpenAPI_authorization_data_t *OpenAPI_authorization_data_parseFromJSON(cJSON *authorization_dataJSON) { OpenAPI_authorization_data_t *authorization_data_local_var = NULL; - cJSON *authorization_data = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "authorizationData"); + OpenAPI_lnode_t *node = NULL; + cJSON *authorization_data = NULL; + OpenAPI_list_t *authorization_dataList = NULL; + cJSON *validity_time = NULL; + authorization_data = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "authorizationData"); if (!authorization_data) { ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]"); goto end; } - - OpenAPI_list_t *authorization_dataList; - cJSON *authorization_data_local_nonprimitive; - if (!cJSON_IsArray(authorization_data)){ - ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]"); - goto end; - } - - authorization_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(authorization_data_local_nonprimitive, authorization_data ) { - if (!cJSON_IsObject(authorization_data_local_nonprimitive)) { + cJSON *authorization_data_local = NULL; + if (!cJSON_IsArray(authorization_data)) { ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]"); goto end; } - OpenAPI_user_identifier_t *authorization_dataItem = OpenAPI_user_identifier_parseFromJSON(authorization_data_local_nonprimitive); - if (!authorization_dataItem) { - ogs_error("No authorization_dataItem"); - OpenAPI_list_free(authorization_dataList); - goto end; + authorization_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(authorization_data_local, authorization_data) { + if (!cJSON_IsObject(authorization_data_local)) { + ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]"); + goto end; + } + OpenAPI_user_identifier_t *authorization_dataItem = OpenAPI_user_identifier_parseFromJSON(authorization_data_local); + if (!authorization_dataItem) { + ogs_error("No authorization_dataItem"); + OpenAPI_list_free(authorization_dataList); + goto end; + } + OpenAPI_list_add(authorization_dataList, authorization_dataItem); } - OpenAPI_list_add(authorization_dataList, authorization_dataItem); - } - - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [validity_time]"); goto end; } @@ -116,11 +123,18 @@ OpenAPI_authorization_data_t *OpenAPI_authorization_data_parseFromJSON(cJSON *au authorization_data_local_var = OpenAPI_authorization_data_create ( authorization_dataList, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL ); return authorization_data_local_var; end: + if (authorization_dataList) { + OpenAPI_list_for_each(authorization_dataList, node) { + OpenAPI_user_identifier_free(node->data); + } + OpenAPI_list_free(authorization_dataList); + authorization_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/authorized_default_qos.c b/lib/sbi/openapi/model/authorized_default_qos.c index c89bf57c2..6299d7868 100644 --- a/lib/sbi/openapi/model/authorized_default_qos.c +++ b/lib/sbi/openapi/model/authorized_default_qos.c @@ -46,21 +46,38 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_create( void OpenAPI_authorized_default_qos_free(OpenAPI_authorized_default_qos_t *authorized_default_qos) { + OpenAPI_lnode_t *node = NULL; + if (NULL == authorized_default_qos) { return; } - OpenAPI_lnode_t *node; - OpenAPI_arp_free(authorized_default_qos->arp); - ogs_free(authorized_default_qos->maxbr_ul); - ogs_free(authorized_default_qos->maxbr_dl); - ogs_free(authorized_default_qos->gbr_ul); - ogs_free(authorized_default_qos->gbr_dl); + if (authorized_default_qos->arp) { + OpenAPI_arp_free(authorized_default_qos->arp); + authorized_default_qos->arp = NULL; + } + if (authorized_default_qos->maxbr_ul) { + ogs_free(authorized_default_qos->maxbr_ul); + authorized_default_qos->maxbr_ul = NULL; + } + if (authorized_default_qos->maxbr_dl) { + ogs_free(authorized_default_qos->maxbr_dl); + authorized_default_qos->maxbr_dl = NULL; + } + if (authorized_default_qos->gbr_ul) { + ogs_free(authorized_default_qos->gbr_ul); + authorized_default_qos->gbr_ul = NULL; + } + if (authorized_default_qos->gbr_dl) { + ogs_free(authorized_default_qos->gbr_dl); + authorized_default_qos->gbr_dl = NULL; + } ogs_free(authorized_default_qos); } cJSON *OpenAPI_authorized_default_qos_convertToJSON(OpenAPI_authorized_default_qos_t *authorized_default_qos) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (authorized_default_qos == NULL) { ogs_error("OpenAPI_authorized_default_qos_convertToJSON() failed [AuthorizedDefaultQos]"); @@ -151,8 +168,19 @@ end: OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(cJSON *authorized_default_qosJSON) { OpenAPI_authorized_default_qos_t *authorized_default_qos_local_var = NULL; - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "5qi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *_5qi = NULL; + cJSON *arp = NULL; + OpenAPI_arp_t *arp_local_nonprim = NULL; + cJSON *priority_level = NULL; + cJSON *aver_window = NULL; + cJSON *max_data_burst_vol = NULL; + cJSON *maxbr_ul = NULL; + cJSON *maxbr_dl = NULL; + cJSON *gbr_ul = NULL; + cJSON *gbr_dl = NULL; + cJSON *ext_max_data_burst_vol = NULL; + _5qi = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "5qi"); if (_5qi) { if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [_5qi]"); @@ -160,15 +188,12 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c } } - cJSON *arp = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "arp"); - - OpenAPI_arp_t *arp_local_nonprim = NULL; + arp = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "arp"); if (arp) { arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp); } - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "priorityLevel"); - + priority_level = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "priorityLevel"); if (priority_level) { if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [priority_level]"); @@ -176,8 +201,7 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c } } - cJSON *aver_window = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "averWindow"); - + aver_window = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "averWindow"); if (aver_window) { if (!cJSON_IsNumber(aver_window)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [aver_window]"); @@ -185,8 +209,7 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c } } - cJSON *max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxDataBurstVol"); - + max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxDataBurstVol"); if (max_data_burst_vol) { if (!cJSON_IsNumber(max_data_burst_vol)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [max_data_burst_vol]"); @@ -194,44 +217,39 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c } } - cJSON *maxbr_ul = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxbrUl"); - + maxbr_ul = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxbrUl"); if (maxbr_ul) { - if (!cJSON_IsString(maxbr_ul)) { + if (!cJSON_IsString(maxbr_ul) && !cJSON_IsNull(maxbr_ul)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [maxbr_ul]"); goto end; } } - cJSON *maxbr_dl = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxbrDl"); - + maxbr_dl = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxbrDl"); if (maxbr_dl) { - if (!cJSON_IsString(maxbr_dl)) { + if (!cJSON_IsString(maxbr_dl) && !cJSON_IsNull(maxbr_dl)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [maxbr_dl]"); goto end; } } - cJSON *gbr_ul = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "gbrUl"); - + gbr_ul = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "gbrUl"); if (gbr_ul) { - if (!cJSON_IsString(gbr_ul)) { + if (!cJSON_IsString(gbr_ul) && !cJSON_IsNull(gbr_ul)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [gbr_ul]"); goto end; } } - cJSON *gbr_dl = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "gbrDl"); - + gbr_dl = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "gbrDl"); if (gbr_dl) { - if (!cJSON_IsString(gbr_dl)) { + if (!cJSON_IsString(gbr_dl) && !cJSON_IsNull(gbr_dl)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [gbr_dl]"); goto end; } } - cJSON *ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "extMaxDataBurstVol"); - + ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "extMaxDataBurstVol"); if (ext_max_data_burst_vol) { if (!cJSON_IsNumber(ext_max_data_burst_vol)) { ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [ext_max_data_burst_vol]"); @@ -249,16 +267,20 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c aver_window ? aver_window->valuedouble : 0, max_data_burst_vol ? true : false, max_data_burst_vol ? max_data_burst_vol->valuedouble : 0, - maxbr_ul ? ogs_strdup(maxbr_ul->valuestring) : NULL, - maxbr_dl ? ogs_strdup(maxbr_dl->valuestring) : NULL, - gbr_ul ? ogs_strdup(gbr_ul->valuestring) : NULL, - gbr_dl ? ogs_strdup(gbr_dl->valuestring) : NULL, + maxbr_ul && !cJSON_IsNull(maxbr_ul) ? ogs_strdup(maxbr_ul->valuestring) : NULL, + maxbr_dl && !cJSON_IsNull(maxbr_dl) ? ogs_strdup(maxbr_dl->valuestring) : NULL, + gbr_ul && !cJSON_IsNull(gbr_ul) ? ogs_strdup(gbr_ul->valuestring) : NULL, + gbr_dl && !cJSON_IsNull(gbr_dl) ? ogs_strdup(gbr_dl->valuestring) : NULL, ext_max_data_burst_vol ? true : false, ext_max_data_burst_vol ? ext_max_data_burst_vol->valuedouble : 0 ); return authorized_default_qos_local_var; end: + if (arp_local_nonprim) { + OpenAPI_arp_free(arp_local_nonprim); + arp_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/authorized_network_slice_info.c b/lib/sbi/openapi/model/authorized_network_slice_info.c index 861af5038..138b777c9 100644 --- a/lib/sbi/openapi/model/authorized_network_slice_info.c +++ b/lib/sbi/openapi/model/authorized_network_slice_info.c @@ -40,43 +40,81 @@ OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_c void OpenAPI_authorized_network_slice_info_free(OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == authorized_network_slice_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, node) { - OpenAPI_allowed_nssai_free(node->data); + if (authorized_network_slice_info->allowed_nssai_list) { + OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, node) { + OpenAPI_allowed_nssai_free(node->data); + } + OpenAPI_list_free(authorized_network_slice_info->allowed_nssai_list); + authorized_network_slice_info->allowed_nssai_list = NULL; } - OpenAPI_list_free(authorized_network_slice_info->allowed_nssai_list); - OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, node) { - OpenAPI_configured_snssai_free(node->data); + if (authorized_network_slice_info->configured_nssai) { + OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, node) { + OpenAPI_configured_snssai_free(node->data); + } + OpenAPI_list_free(authorized_network_slice_info->configured_nssai); + authorized_network_slice_info->configured_nssai = NULL; } - OpenAPI_list_free(authorized_network_slice_info->configured_nssai); - ogs_free(authorized_network_slice_info->target_amf_set); - OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, node) { - ogs_free(node->data); + if (authorized_network_slice_info->target_amf_set) { + ogs_free(authorized_network_slice_info->target_amf_set); + authorized_network_slice_info->target_amf_set = NULL; } - OpenAPI_list_free(authorized_network_slice_info->candidate_amf_list); - OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, node) { - OpenAPI_snssai_free(node->data); + if (authorized_network_slice_info->candidate_amf_list) { + OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(authorized_network_slice_info->candidate_amf_list); + authorized_network_slice_info->candidate_amf_list = NULL; } - OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_plmn); - OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, node) { - OpenAPI_snssai_free(node->data); + if (authorized_network_slice_info->rejected_nssai_in_plmn) { + OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_plmn); + authorized_network_slice_info->rejected_nssai_in_plmn = NULL; + } + if (authorized_network_slice_info->rejected_nssai_in_ta) { + OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_ta); + authorized_network_slice_info->rejected_nssai_in_ta = NULL; + } + if (authorized_network_slice_info->nsi_information) { + OpenAPI_nsi_information_free(authorized_network_slice_info->nsi_information); + authorized_network_slice_info->nsi_information = NULL; + } + if (authorized_network_slice_info->supported_features) { + ogs_free(authorized_network_slice_info->supported_features); + authorized_network_slice_info->supported_features = NULL; + } + if (authorized_network_slice_info->nrf_amf_set) { + ogs_free(authorized_network_slice_info->nrf_amf_set); + authorized_network_slice_info->nrf_amf_set = NULL; + } + if (authorized_network_slice_info->nrf_amf_set_nf_mgt_uri) { + ogs_free(authorized_network_slice_info->nrf_amf_set_nf_mgt_uri); + authorized_network_slice_info->nrf_amf_set_nf_mgt_uri = NULL; + } + if (authorized_network_slice_info->nrf_amf_set_access_token_uri) { + ogs_free(authorized_network_slice_info->nrf_amf_set_access_token_uri); + authorized_network_slice_info->nrf_amf_set_access_token_uri = NULL; + } + if (authorized_network_slice_info->target_amf_service_set) { + ogs_free(authorized_network_slice_info->target_amf_service_set); + authorized_network_slice_info->target_amf_service_set = NULL; } - OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_ta); - OpenAPI_nsi_information_free(authorized_network_slice_info->nsi_information); - ogs_free(authorized_network_slice_info->supported_features); - ogs_free(authorized_network_slice_info->nrf_amf_set); - ogs_free(authorized_network_slice_info->nrf_amf_set_nf_mgt_uri); - ogs_free(authorized_network_slice_info->nrf_amf_set_access_token_uri); - ogs_free(authorized_network_slice_info->target_amf_service_set); ogs_free(authorized_network_slice_info); } cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (authorized_network_slice_info == NULL) { ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [AuthorizedNetworkSliceInfo]"); @@ -90,17 +128,13 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [allowed_nssai_list]"); goto end; } - - OpenAPI_lnode_t *allowed_nssai_list_node; - if (authorized_network_slice_info->allowed_nssai_list) { - OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, allowed_nssai_list_node) { - cJSON *itemLocal = OpenAPI_allowed_nssai_convertToJSON(allowed_nssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [allowed_nssai_list]"); - goto end; - } - cJSON_AddItemToArray(allowed_nssai_listList, itemLocal); + OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, node) { + cJSON *itemLocal = OpenAPI_allowed_nssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [allowed_nssai_list]"); + goto end; } + cJSON_AddItemToArray(allowed_nssai_listList, itemLocal); } } @@ -110,17 +144,13 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [configured_nssai]"); goto end; } - - OpenAPI_lnode_t *configured_nssai_node; - if (authorized_network_slice_info->configured_nssai) { - OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, configured_nssai_node) { - cJSON *itemLocal = OpenAPI_configured_snssai_convertToJSON(configured_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [configured_nssai]"); - goto end; - } - cJSON_AddItemToArray(configured_nssaiList, itemLocal); + OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, node) { + cJSON *itemLocal = OpenAPI_configured_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [configured_nssai]"); + goto end; } + cJSON_AddItemToArray(configured_nssaiList, itemLocal); } } @@ -132,19 +162,17 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne } if (authorized_network_slice_info->candidate_amf_list) { - cJSON *candidate_amf_list = cJSON_AddArrayToObject(item, "candidateAmfList"); - if (candidate_amf_list == NULL) { + cJSON *candidate_amf_listList = cJSON_AddArrayToObject(item, "candidateAmfList"); + if (candidate_amf_listList == NULL) { ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [candidate_amf_list]"); goto end; } - - OpenAPI_lnode_t *candidate_amf_list_node; - OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, candidate_amf_list_node) { - if (cJSON_AddStringToObject(candidate_amf_list, "", (char*)candidate_amf_list_node->data) == NULL) { - ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [candidate_amf_list]"); - goto end; + OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, node) { + if (cJSON_AddStringToObject(candidate_amf_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [candidate_amf_list]"); + goto end; + } } - } } if (authorized_network_slice_info->rejected_nssai_in_plmn) { @@ -153,17 +181,13 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_plmn]"); goto end; } - - OpenAPI_lnode_t *rejected_nssai_in_plmn_node; - if (authorized_network_slice_info->rejected_nssai_in_plmn) { - OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, rejected_nssai_in_plmn_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(rejected_nssai_in_plmn_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_plmn]"); - goto end; - } - cJSON_AddItemToArray(rejected_nssai_in_plmnList, itemLocal); + OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_plmn]"); + goto end; } + cJSON_AddItemToArray(rejected_nssai_in_plmnList, itemLocal); } } @@ -173,17 +197,13 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_ta]"); goto end; } - - OpenAPI_lnode_t *rejected_nssai_in_ta_node; - if (authorized_network_slice_info->rejected_nssai_in_ta) { - OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, rejected_nssai_in_ta_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(rejected_nssai_in_ta_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_ta]"); - goto end; - } - cJSON_AddItemToArray(rejected_nssai_in_taList, itemLocal); + OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_ta]"); + goto end; } + cJSON_AddItemToArray(rejected_nssai_in_taList, itemLocal); } } @@ -242,198 +262,194 @@ end: OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_parseFromJSON(cJSON *authorized_network_slice_infoJSON) { OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info_local_var = NULL; - cJSON *allowed_nssai_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "allowedNssaiList"); - - OpenAPI_list_t *allowed_nssai_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_nssai_list = NULL; + OpenAPI_list_t *allowed_nssai_listList = NULL; + cJSON *configured_nssai = NULL; + OpenAPI_list_t *configured_nssaiList = NULL; + cJSON *target_amf_set = NULL; + cJSON *candidate_amf_list = NULL; + OpenAPI_list_t *candidate_amf_listList = NULL; + cJSON *rejected_nssai_in_plmn = NULL; + OpenAPI_list_t *rejected_nssai_in_plmnList = NULL; + cJSON *rejected_nssai_in_ta = NULL; + OpenAPI_list_t *rejected_nssai_in_taList = NULL; + cJSON *nsi_information = NULL; + OpenAPI_nsi_information_t *nsi_information_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *nrf_amf_set = NULL; + cJSON *nrf_amf_set_nf_mgt_uri = NULL; + cJSON *nrf_amf_set_access_token_uri = NULL; + cJSON *target_amf_service_set = NULL; + allowed_nssai_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "allowedNssaiList"); if (allowed_nssai_list) { - cJSON *allowed_nssai_list_local_nonprimitive; - if (!cJSON_IsArray(allowed_nssai_list)){ - ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [allowed_nssai_list]"); - goto end; - } - - allowed_nssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_nssai_list_local_nonprimitive, allowed_nssai_list ) { - if (!cJSON_IsObject(allowed_nssai_list_local_nonprimitive)) { + cJSON *allowed_nssai_list_local = NULL; + if (!cJSON_IsArray(allowed_nssai_list)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [allowed_nssai_list]"); goto end; } - OpenAPI_allowed_nssai_t *allowed_nssai_listItem = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_list_local_nonprimitive); - if (!allowed_nssai_listItem) { - ogs_error("No allowed_nssai_listItem"); - OpenAPI_list_free(allowed_nssai_listList); - goto end; + allowed_nssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_nssai_list_local, allowed_nssai_list) { + if (!cJSON_IsObject(allowed_nssai_list_local)) { + ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [allowed_nssai_list]"); + goto end; + } + OpenAPI_allowed_nssai_t *allowed_nssai_listItem = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_list_local); + if (!allowed_nssai_listItem) { + ogs_error("No allowed_nssai_listItem"); + OpenAPI_list_free(allowed_nssai_listList); + goto end; + } + OpenAPI_list_add(allowed_nssai_listList, allowed_nssai_listItem); } - - OpenAPI_list_add(allowed_nssai_listList, allowed_nssai_listItem); - } } - cJSON *configured_nssai = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "configuredNssai"); - - OpenAPI_list_t *configured_nssaiList; + configured_nssai = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "configuredNssai"); if (configured_nssai) { - cJSON *configured_nssai_local_nonprimitive; - if (!cJSON_IsArray(configured_nssai)){ - ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [configured_nssai]"); - goto end; - } - - configured_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(configured_nssai_local_nonprimitive, configured_nssai ) { - if (!cJSON_IsObject(configured_nssai_local_nonprimitive)) { + cJSON *configured_nssai_local = NULL; + if (!cJSON_IsArray(configured_nssai)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [configured_nssai]"); goto end; } - OpenAPI_configured_snssai_t *configured_nssaiItem = OpenAPI_configured_snssai_parseFromJSON(configured_nssai_local_nonprimitive); - if (!configured_nssaiItem) { - ogs_error("No configured_nssaiItem"); - OpenAPI_list_free(configured_nssaiList); - goto end; + configured_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(configured_nssai_local, configured_nssai) { + if (!cJSON_IsObject(configured_nssai_local)) { + ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [configured_nssai]"); + goto end; + } + OpenAPI_configured_snssai_t *configured_nssaiItem = OpenAPI_configured_snssai_parseFromJSON(configured_nssai_local); + if (!configured_nssaiItem) { + ogs_error("No configured_nssaiItem"); + OpenAPI_list_free(configured_nssaiList); + goto end; + } + OpenAPI_list_add(configured_nssaiList, configured_nssaiItem); } - - OpenAPI_list_add(configured_nssaiList, configured_nssaiItem); - } } - cJSON *target_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfSet"); - + target_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfSet"); if (target_amf_set) { - if (!cJSON_IsString(target_amf_set)) { + if (!cJSON_IsString(target_amf_set) && !cJSON_IsNull(target_amf_set)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [target_amf_set]"); goto end; } } - cJSON *candidate_amf_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "candidateAmfList"); - - OpenAPI_list_t *candidate_amf_listList; + candidate_amf_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "candidateAmfList"); if (candidate_amf_list) { - cJSON *candidate_amf_list_local; - if (!cJSON_IsArray(candidate_amf_list)) { - ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]"); - goto end; - } - candidate_amf_listList = OpenAPI_list_create(); + cJSON *candidate_amf_list_local = NULL; + if (!cJSON_IsArray(candidate_amf_list)) { + ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]"); + goto end; + } - cJSON_ArrayForEach(candidate_amf_list_local, candidate_amf_list) { - if (!cJSON_IsString(candidate_amf_list_local)) { - ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]"); - goto end; - } - OpenAPI_list_add(candidate_amf_listList, ogs_strdup(candidate_amf_list_local->valuestring)); - } + candidate_amf_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(candidate_amf_list_local, candidate_amf_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(candidate_amf_list_local)) { + ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]"); + goto end; + } + OpenAPI_list_add(candidate_amf_listList, ogs_strdup(candidate_amf_list_local->valuestring)); + } } - cJSON *rejected_nssai_in_plmn = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInPlmn"); - - OpenAPI_list_t *rejected_nssai_in_plmnList; + rejected_nssai_in_plmn = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInPlmn"); if (rejected_nssai_in_plmn) { - cJSON *rejected_nssai_in_plmn_local_nonprimitive; - if (!cJSON_IsArray(rejected_nssai_in_plmn)){ - ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_plmn]"); - goto end; - } - - rejected_nssai_in_plmnList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rejected_nssai_in_plmn_local_nonprimitive, rejected_nssai_in_plmn ) { - if (!cJSON_IsObject(rejected_nssai_in_plmn_local_nonprimitive)) { + cJSON *rejected_nssai_in_plmn_local = NULL; + if (!cJSON_IsArray(rejected_nssai_in_plmn)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_plmn]"); goto end; } - OpenAPI_snssai_t *rejected_nssai_in_plmnItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_plmn_local_nonprimitive); - if (!rejected_nssai_in_plmnItem) { - ogs_error("No rejected_nssai_in_plmnItem"); - OpenAPI_list_free(rejected_nssai_in_plmnList); - goto end; + rejected_nssai_in_plmnList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rejected_nssai_in_plmn_local, rejected_nssai_in_plmn) { + if (!cJSON_IsObject(rejected_nssai_in_plmn_local)) { + ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_plmn]"); + goto end; + } + OpenAPI_snssai_t *rejected_nssai_in_plmnItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_plmn_local); + if (!rejected_nssai_in_plmnItem) { + ogs_error("No rejected_nssai_in_plmnItem"); + OpenAPI_list_free(rejected_nssai_in_plmnList); + goto end; + } + OpenAPI_list_add(rejected_nssai_in_plmnList, rejected_nssai_in_plmnItem); } - - OpenAPI_list_add(rejected_nssai_in_plmnList, rejected_nssai_in_plmnItem); - } } - cJSON *rejected_nssai_in_ta = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInTa"); - - OpenAPI_list_t *rejected_nssai_in_taList; + rejected_nssai_in_ta = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInTa"); if (rejected_nssai_in_ta) { - cJSON *rejected_nssai_in_ta_local_nonprimitive; - if (!cJSON_IsArray(rejected_nssai_in_ta)){ - ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_ta]"); - goto end; - } - - rejected_nssai_in_taList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rejected_nssai_in_ta_local_nonprimitive, rejected_nssai_in_ta ) { - if (!cJSON_IsObject(rejected_nssai_in_ta_local_nonprimitive)) { + cJSON *rejected_nssai_in_ta_local = NULL; + if (!cJSON_IsArray(rejected_nssai_in_ta)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_ta]"); goto end; } - OpenAPI_snssai_t *rejected_nssai_in_taItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_ta_local_nonprimitive); - if (!rejected_nssai_in_taItem) { - ogs_error("No rejected_nssai_in_taItem"); - OpenAPI_list_free(rejected_nssai_in_taList); - goto end; + rejected_nssai_in_taList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rejected_nssai_in_ta_local, rejected_nssai_in_ta) { + if (!cJSON_IsObject(rejected_nssai_in_ta_local)) { + ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_ta]"); + goto end; + } + OpenAPI_snssai_t *rejected_nssai_in_taItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_ta_local); + if (!rejected_nssai_in_taItem) { + ogs_error("No rejected_nssai_in_taItem"); + OpenAPI_list_free(rejected_nssai_in_taList); + goto end; + } + OpenAPI_list_add(rejected_nssai_in_taList, rejected_nssai_in_taItem); } - - OpenAPI_list_add(rejected_nssai_in_taList, rejected_nssai_in_taItem); - } } - cJSON *nsi_information = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nsiInformation"); - - OpenAPI_nsi_information_t *nsi_information_local_nonprim = NULL; + nsi_information = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nsiInformation"); if (nsi_information) { nsi_information_local_nonprim = OpenAPI_nsi_information_parseFromJSON(nsi_information); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *nrf_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSet"); - + nrf_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSet"); if (nrf_amf_set) { - if (!cJSON_IsString(nrf_amf_set)) { + if (!cJSON_IsString(nrf_amf_set) && !cJSON_IsNull(nrf_amf_set)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set]"); goto end; } } - cJSON *nrf_amf_set_nf_mgt_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetNfMgtUri"); - + nrf_amf_set_nf_mgt_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetNfMgtUri"); if (nrf_amf_set_nf_mgt_uri) { - if (!cJSON_IsString(nrf_amf_set_nf_mgt_uri)) { + if (!cJSON_IsString(nrf_amf_set_nf_mgt_uri) && !cJSON_IsNull(nrf_amf_set_nf_mgt_uri)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set_nf_mgt_uri]"); goto end; } } - cJSON *nrf_amf_set_access_token_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetAccessTokenUri"); - + nrf_amf_set_access_token_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetAccessTokenUri"); if (nrf_amf_set_access_token_uri) { - if (!cJSON_IsString(nrf_amf_set_access_token_uri)) { + if (!cJSON_IsString(nrf_amf_set_access_token_uri) && !cJSON_IsNull(nrf_amf_set_access_token_uri)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set_access_token_uri]"); goto end; } } - cJSON *target_amf_service_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfServiceSet"); - + target_amf_service_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfServiceSet"); if (target_amf_service_set) { - if (!cJSON_IsString(target_amf_service_set)) { + if (!cJSON_IsString(target_amf_service_set) && !cJSON_IsNull(target_amf_service_set)) { ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [target_amf_service_set]"); goto end; } @@ -442,20 +458,59 @@ OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_p authorized_network_slice_info_local_var = OpenAPI_authorized_network_slice_info_create ( allowed_nssai_list ? allowed_nssai_listList : NULL, configured_nssai ? configured_nssaiList : NULL, - target_amf_set ? ogs_strdup(target_amf_set->valuestring) : NULL, + target_amf_set && !cJSON_IsNull(target_amf_set) ? ogs_strdup(target_amf_set->valuestring) : NULL, candidate_amf_list ? candidate_amf_listList : NULL, rejected_nssai_in_plmn ? rejected_nssai_in_plmnList : NULL, rejected_nssai_in_ta ? rejected_nssai_in_taList : NULL, nsi_information ? nsi_information_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, - nrf_amf_set ? ogs_strdup(nrf_amf_set->valuestring) : NULL, - nrf_amf_set_nf_mgt_uri ? ogs_strdup(nrf_amf_set_nf_mgt_uri->valuestring) : NULL, - nrf_amf_set_access_token_uri ? ogs_strdup(nrf_amf_set_access_token_uri->valuestring) : NULL, - target_amf_service_set ? ogs_strdup(target_amf_service_set->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, + nrf_amf_set && !cJSON_IsNull(nrf_amf_set) ? ogs_strdup(nrf_amf_set->valuestring) : NULL, + nrf_amf_set_nf_mgt_uri && !cJSON_IsNull(nrf_amf_set_nf_mgt_uri) ? ogs_strdup(nrf_amf_set_nf_mgt_uri->valuestring) : NULL, + nrf_amf_set_access_token_uri && !cJSON_IsNull(nrf_amf_set_access_token_uri) ? ogs_strdup(nrf_amf_set_access_token_uri->valuestring) : NULL, + target_amf_service_set && !cJSON_IsNull(target_amf_service_set) ? ogs_strdup(target_amf_service_set->valuestring) : NULL ); return authorized_network_slice_info_local_var; end: + if (allowed_nssai_listList) { + OpenAPI_list_for_each(allowed_nssai_listList, node) { + OpenAPI_allowed_nssai_free(node->data); + } + OpenAPI_list_free(allowed_nssai_listList); + allowed_nssai_listList = NULL; + } + if (configured_nssaiList) { + OpenAPI_list_for_each(configured_nssaiList, node) { + OpenAPI_configured_snssai_free(node->data); + } + OpenAPI_list_free(configured_nssaiList); + configured_nssaiList = NULL; + } + if (candidate_amf_listList) { + OpenAPI_list_for_each(candidate_amf_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(candidate_amf_listList); + candidate_amf_listList = NULL; + } + if (rejected_nssai_in_plmnList) { + OpenAPI_list_for_each(rejected_nssai_in_plmnList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(rejected_nssai_in_plmnList); + rejected_nssai_in_plmnList = NULL; + } + if (rejected_nssai_in_taList) { + OpenAPI_list_for_each(rejected_nssai_in_taList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(rejected_nssai_in_taList); + rejected_nssai_in_taList = NULL; + } + if (nsi_information_local_nonprim) { + OpenAPI_nsi_information_free(nsi_information_local_nonprim); + nsi_information_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/av5_ghe_aka.c b/lib/sbi/openapi/model/av5_ghe_aka.c index e13cb5526..e0ba33864 100644 --- a/lib/sbi/openapi/model/av5_ghe_aka.c +++ b/lib/sbi/openapi/model/av5_ghe_aka.c @@ -26,20 +26,34 @@ OpenAPI_av5_ghe_aka_t *OpenAPI_av5_ghe_aka_create( void OpenAPI_av5_ghe_aka_free(OpenAPI_av5_ghe_aka_t *av5_ghe_aka) { + OpenAPI_lnode_t *node = NULL; + if (NULL == av5_ghe_aka) { return; } - OpenAPI_lnode_t *node; - ogs_free(av5_ghe_aka->rand); - ogs_free(av5_ghe_aka->xres_star); - ogs_free(av5_ghe_aka->autn); - ogs_free(av5_ghe_aka->kausf); + if (av5_ghe_aka->rand) { + ogs_free(av5_ghe_aka->rand); + av5_ghe_aka->rand = NULL; + } + if (av5_ghe_aka->xres_star) { + ogs_free(av5_ghe_aka->xres_star); + av5_ghe_aka->xres_star = NULL; + } + if (av5_ghe_aka->autn) { + ogs_free(av5_ghe_aka->autn); + av5_ghe_aka->autn = NULL; + } + if (av5_ghe_aka->kausf) { + ogs_free(av5_ghe_aka->kausf); + av5_ghe_aka->kausf = NULL; + } ogs_free(av5_ghe_aka); } cJSON *OpenAPI_av5_ghe_aka_convertToJSON(OpenAPI_av5_ghe_aka_t *av5_ghe_aka) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (av5_ghe_aka == NULL) { ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [Av5GHeAka]"); @@ -47,11 +61,19 @@ cJSON *OpenAPI_av5_ghe_aka_convertToJSON(OpenAPI_av5_ghe_aka_t *av5_ghe_aka) } item = cJSON_CreateObject(); + if (av5_ghe_aka->av_type == OpenAPI_av_type_NULL) { + ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [av_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "avType", OpenAPI_av_type_ToString(av5_ghe_aka->av_type)) == NULL) { ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [av_type]"); goto end; } + if (!av5_ghe_aka->rand) { + ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [rand]"); + return NULL; + } if (cJSON_AddStringToObject(item, "rand", av5_ghe_aka->rand) == NULL) { ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [rand]"); goto end; @@ -64,6 +86,10 @@ cJSON *OpenAPI_av5_ghe_aka_convertToJSON(OpenAPI_av5_ghe_aka_t *av5_ghe_aka) } } + if (!av5_ghe_aka->autn) { + ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [autn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "autn", av5_ghe_aka->autn) == NULL) { ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [autn]"); goto end; @@ -83,54 +109,55 @@ end: OpenAPI_av5_ghe_aka_t *OpenAPI_av5_ghe_aka_parseFromJSON(cJSON *av5_ghe_akaJSON) { OpenAPI_av5_ghe_aka_t *av5_ghe_aka_local_var = NULL; - cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "avType"); + OpenAPI_lnode_t *node = NULL; + cJSON *av_type = NULL; + OpenAPI_av_type_e av_typeVariable = 0; + cJSON *rand = NULL; + cJSON *xres_star = NULL; + cJSON *autn = NULL; + cJSON *kausf = NULL; + av_type = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "avType"); if (!av_type) { ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [av_type]"); goto end; } - - OpenAPI_av_type_e av_typeVariable; if (!cJSON_IsString(av_type)) { ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [av_type]"); goto end; } av_typeVariable = OpenAPI_av_type_FromString(av_type->valuestring); - cJSON *rand = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "rand"); + rand = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "rand"); if (!rand) { ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [rand]"); goto end; } - if (!cJSON_IsString(rand)) { ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [rand]"); goto end; } - cJSON *xres_star = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "xresStar"); - + xres_star = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "xresStar"); if (xres_star) { - if (!cJSON_IsString(xres_star)) { + if (!cJSON_IsString(xres_star) && !cJSON_IsNull(xres_star)) { ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [xres_star]"); goto end; } } - cJSON *autn = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "autn"); + autn = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "autn"); if (!autn) { ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [autn]"); goto end; } - if (!cJSON_IsString(autn)) { ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [autn]"); goto end; } - cJSON *kausf = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "kausf"); - + kausf = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "kausf"); if (kausf) { - if (!cJSON_IsString(kausf)) { + if (!cJSON_IsString(kausf) && !cJSON_IsNull(kausf)) { ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [kausf]"); goto end; } @@ -139,9 +166,9 @@ OpenAPI_av5_ghe_aka_t *OpenAPI_av5_ghe_aka_parseFromJSON(cJSON *av5_ghe_akaJSON) av5_ghe_aka_local_var = OpenAPI_av5_ghe_aka_create ( av_typeVariable, ogs_strdup(rand->valuestring), - xres_star ? ogs_strdup(xres_star->valuestring) : NULL, + xres_star && !cJSON_IsNull(xres_star) ? ogs_strdup(xres_star->valuestring) : NULL, ogs_strdup(autn->valuestring), - kausf ? ogs_strdup(kausf->valuestring) : NULL + kausf && !cJSON_IsNull(kausf) ? ogs_strdup(kausf->valuestring) : NULL ); return av5_ghe_aka_local_var; diff --git a/lib/sbi/openapi/model/av5g_aka.c b/lib/sbi/openapi/model/av5g_aka.c index 5436a98c2..341865ae1 100644 --- a/lib/sbi/openapi/model/av5g_aka.c +++ b/lib/sbi/openapi/model/av5g_aka.c @@ -22,19 +22,30 @@ OpenAPI_av5g_aka_t *OpenAPI_av5g_aka_create( void OpenAPI_av5g_aka_free(OpenAPI_av5g_aka_t *av5g_aka) { + OpenAPI_lnode_t *node = NULL; + if (NULL == av5g_aka) { return; } - OpenAPI_lnode_t *node; - ogs_free(av5g_aka->rand); - ogs_free(av5g_aka->hxres_star); - ogs_free(av5g_aka->autn); + if (av5g_aka->rand) { + ogs_free(av5g_aka->rand); + av5g_aka->rand = NULL; + } + if (av5g_aka->hxres_star) { + ogs_free(av5g_aka->hxres_star); + av5g_aka->hxres_star = NULL; + } + if (av5g_aka->autn) { + ogs_free(av5g_aka->autn); + av5g_aka->autn = NULL; + } ogs_free(av5g_aka); } cJSON *OpenAPI_av5g_aka_convertToJSON(OpenAPI_av5g_aka_t *av5g_aka) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (av5g_aka == NULL) { ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [Av5gAka]"); @@ -42,16 +53,28 @@ cJSON *OpenAPI_av5g_aka_convertToJSON(OpenAPI_av5g_aka_t *av5g_aka) } item = cJSON_CreateObject(); + if (!av5g_aka->rand) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [rand]"); + return NULL; + } if (cJSON_AddStringToObject(item, "rand", av5g_aka->rand) == NULL) { ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [rand]"); goto end; } + if (!av5g_aka->hxres_star) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [hxres_star]"); + return NULL; + } if (cJSON_AddStringToObject(item, "hxresStar", av5g_aka->hxres_star) == NULL) { ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [hxres_star]"); goto end; } + if (!av5g_aka->autn) { + ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [autn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "autn", av5g_aka->autn) == NULL) { ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [autn]"); goto end; @@ -64,34 +87,35 @@ end: OpenAPI_av5g_aka_t *OpenAPI_av5g_aka_parseFromJSON(cJSON *av5g_akaJSON) { OpenAPI_av5g_aka_t *av5g_aka_local_var = NULL; - cJSON *rand = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "rand"); + OpenAPI_lnode_t *node = NULL; + cJSON *rand = NULL; + cJSON *hxres_star = NULL; + cJSON *autn = NULL; + rand = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "rand"); if (!rand) { ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [rand]"); goto end; } - if (!cJSON_IsString(rand)) { ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [rand]"); goto end; } - cJSON *hxres_star = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "hxresStar"); + hxres_star = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "hxresStar"); if (!hxres_star) { ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [hxres_star]"); goto end; } - if (!cJSON_IsString(hxres_star)) { ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [hxres_star]"); goto end; } - cJSON *autn = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "autn"); + autn = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "autn"); if (!autn) { ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [autn]"); goto end; } - if (!cJSON_IsString(autn)) { ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [autn]"); goto end; diff --git a/lib/sbi/openapi/model/av_eap_aka_prime.c b/lib/sbi/openapi/model/av_eap_aka_prime.c index 0a788b47d..b91f95c2b 100644 --- a/lib/sbi/openapi/model/av_eap_aka_prime.c +++ b/lib/sbi/openapi/model/av_eap_aka_prime.c @@ -28,21 +28,38 @@ OpenAPI_av_eap_aka_prime_t *OpenAPI_av_eap_aka_prime_create( void OpenAPI_av_eap_aka_prime_free(OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime) { + OpenAPI_lnode_t *node = NULL; + if (NULL == av_eap_aka_prime) { return; } - OpenAPI_lnode_t *node; - ogs_free(av_eap_aka_prime->rand); - ogs_free(av_eap_aka_prime->xres); - ogs_free(av_eap_aka_prime->autn); - ogs_free(av_eap_aka_prime->ck_prime); - ogs_free(av_eap_aka_prime->ik_prime); + if (av_eap_aka_prime->rand) { + ogs_free(av_eap_aka_prime->rand); + av_eap_aka_prime->rand = NULL; + } + if (av_eap_aka_prime->xres) { + ogs_free(av_eap_aka_prime->xres); + av_eap_aka_prime->xres = NULL; + } + if (av_eap_aka_prime->autn) { + ogs_free(av_eap_aka_prime->autn); + av_eap_aka_prime->autn = NULL; + } + if (av_eap_aka_prime->ck_prime) { + ogs_free(av_eap_aka_prime->ck_prime); + av_eap_aka_prime->ck_prime = NULL; + } + if (av_eap_aka_prime->ik_prime) { + ogs_free(av_eap_aka_prime->ik_prime); + av_eap_aka_prime->ik_prime = NULL; + } ogs_free(av_eap_aka_prime); } cJSON *OpenAPI_av_eap_aka_prime_convertToJSON(OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (av_eap_aka_prime == NULL) { ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [AvEapAkaPrime]"); @@ -50,11 +67,19 @@ cJSON *OpenAPI_av_eap_aka_prime_convertToJSON(OpenAPI_av_eap_aka_prime_t *av_eap } item = cJSON_CreateObject(); + if (av_eap_aka_prime->av_type == OpenAPI_av_type_NULL) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [av_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "avType", OpenAPI_av_type_ToString(av_eap_aka_prime->av_type)) == NULL) { ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [av_type]"); goto end; } + if (!av_eap_aka_prime->rand) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [rand]"); + return NULL; + } if (cJSON_AddStringToObject(item, "rand", av_eap_aka_prime->rand) == NULL) { ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [rand]"); goto end; @@ -67,6 +92,10 @@ cJSON *OpenAPI_av_eap_aka_prime_convertToJSON(OpenAPI_av_eap_aka_prime_t *av_eap } } + if (!av_eap_aka_prime->autn) { + ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [autn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "autn", av_eap_aka_prime->autn) == NULL) { ogs_error("OpenAPI_av_eap_aka_prime_convertToJSON() failed [autn]"); goto end; @@ -93,63 +122,64 @@ end: OpenAPI_av_eap_aka_prime_t *OpenAPI_av_eap_aka_prime_parseFromJSON(cJSON *av_eap_aka_primeJSON) { OpenAPI_av_eap_aka_prime_t *av_eap_aka_prime_local_var = NULL; - cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "avType"); + OpenAPI_lnode_t *node = NULL; + cJSON *av_type = NULL; + OpenAPI_av_type_e av_typeVariable = 0; + cJSON *rand = NULL; + cJSON *xres = NULL; + cJSON *autn = NULL; + cJSON *ck_prime = NULL; + cJSON *ik_prime = NULL; + av_type = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "avType"); if (!av_type) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [av_type]"); goto end; } - - OpenAPI_av_type_e av_typeVariable; if (!cJSON_IsString(av_type)) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [av_type]"); goto end; } av_typeVariable = OpenAPI_av_type_FromString(av_type->valuestring); - cJSON *rand = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "rand"); + rand = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "rand"); if (!rand) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [rand]"); goto end; } - if (!cJSON_IsString(rand)) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [rand]"); goto end; } - cJSON *xres = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "xres"); - + xres = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "xres"); if (xres) { - if (!cJSON_IsString(xres)) { + if (!cJSON_IsString(xres) && !cJSON_IsNull(xres)) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [xres]"); goto end; } } - cJSON *autn = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "autn"); + autn = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "autn"); if (!autn) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [autn]"); goto end; } - if (!cJSON_IsString(autn)) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [autn]"); goto end; } - cJSON *ck_prime = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "ckPrime"); - + ck_prime = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "ckPrime"); if (ck_prime) { - if (!cJSON_IsString(ck_prime)) { + if (!cJSON_IsString(ck_prime) && !cJSON_IsNull(ck_prime)) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [ck_prime]"); goto end; } } - cJSON *ik_prime = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "ikPrime"); - + ik_prime = cJSON_GetObjectItemCaseSensitive(av_eap_aka_primeJSON, "ikPrime"); if (ik_prime) { - if (!cJSON_IsString(ik_prime)) { + if (!cJSON_IsString(ik_prime) && !cJSON_IsNull(ik_prime)) { ogs_error("OpenAPI_av_eap_aka_prime_parseFromJSON() failed [ik_prime]"); goto end; } @@ -158,10 +188,10 @@ OpenAPI_av_eap_aka_prime_t *OpenAPI_av_eap_aka_prime_parseFromJSON(cJSON *av_eap av_eap_aka_prime_local_var = OpenAPI_av_eap_aka_prime_create ( av_typeVariable, ogs_strdup(rand->valuestring), - xres ? ogs_strdup(xres->valuestring) : NULL, + xres && !cJSON_IsNull(xres) ? ogs_strdup(xres->valuestring) : NULL, ogs_strdup(autn->valuestring), - ck_prime ? ogs_strdup(ck_prime->valuestring) : NULL, - ik_prime ? ogs_strdup(ik_prime->valuestring) : NULL + ck_prime && !cJSON_IsNull(ck_prime) ? ogs_strdup(ck_prime->valuestring) : NULL, + ik_prime && !cJSON_IsNull(ik_prime) ? ogs_strdup(ik_prime->valuestring) : NULL ); return av_eap_aka_prime_local_var; diff --git a/lib/sbi/openapi/model/av_eps_aka.c b/lib/sbi/openapi/model/av_eps_aka.c index 33c3f153f..8717f4f88 100644 --- a/lib/sbi/openapi/model/av_eps_aka.c +++ b/lib/sbi/openapi/model/av_eps_aka.c @@ -26,20 +26,34 @@ OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_create( void OpenAPI_av_eps_aka_free(OpenAPI_av_eps_aka_t *av_eps_aka) { + OpenAPI_lnode_t *node = NULL; + if (NULL == av_eps_aka) { return; } - OpenAPI_lnode_t *node; - ogs_free(av_eps_aka->rand); - ogs_free(av_eps_aka->xres); - ogs_free(av_eps_aka->autn); - ogs_free(av_eps_aka->kasme); + if (av_eps_aka->rand) { + ogs_free(av_eps_aka->rand); + av_eps_aka->rand = NULL; + } + if (av_eps_aka->xres) { + ogs_free(av_eps_aka->xres); + av_eps_aka->xres = NULL; + } + if (av_eps_aka->autn) { + ogs_free(av_eps_aka->autn); + av_eps_aka->autn = NULL; + } + if (av_eps_aka->kasme) { + ogs_free(av_eps_aka->kasme); + av_eps_aka->kasme = NULL; + } ogs_free(av_eps_aka); } cJSON *OpenAPI_av_eps_aka_convertToJSON(OpenAPI_av_eps_aka_t *av_eps_aka) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (av_eps_aka == NULL) { ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [AvEpsAka]"); @@ -47,26 +61,46 @@ cJSON *OpenAPI_av_eps_aka_convertToJSON(OpenAPI_av_eps_aka_t *av_eps_aka) } item = cJSON_CreateObject(); + if (av_eps_aka->av_type == OpenAPI_hss_av_type_NULL) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [av_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "avType", OpenAPI_hss_av_type_ToString(av_eps_aka->av_type)) == NULL) { ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [av_type]"); goto end; } + if (!av_eps_aka->rand) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [rand]"); + return NULL; + } if (cJSON_AddStringToObject(item, "rand", av_eps_aka->rand) == NULL) { ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [rand]"); goto end; } + if (!av_eps_aka->xres) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [xres]"); + return NULL; + } if (cJSON_AddStringToObject(item, "xres", av_eps_aka->xres) == NULL) { ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [xres]"); goto end; } + if (!av_eps_aka->autn) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [autn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "autn", av_eps_aka->autn) == NULL) { ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [autn]"); goto end; } + if (!av_eps_aka->kasme) { + ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [kasme]"); + return NULL; + } if (cJSON_AddStringToObject(item, "kasme", av_eps_aka->kasme) == NULL) { ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [kasme]"); goto end; @@ -79,58 +113,59 @@ end: OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_parseFromJSON(cJSON *av_eps_akaJSON) { OpenAPI_av_eps_aka_t *av_eps_aka_local_var = NULL; - cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "avType"); + OpenAPI_lnode_t *node = NULL; + cJSON *av_type = NULL; + OpenAPI_hss_av_type_e av_typeVariable = 0; + cJSON *rand = NULL; + cJSON *xres = NULL; + cJSON *autn = NULL; + cJSON *kasme = NULL; + av_type = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "avType"); if (!av_type) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [av_type]"); goto end; } - - OpenAPI_hss_av_type_e av_typeVariable; if (!cJSON_IsString(av_type)) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [av_type]"); goto end; } av_typeVariable = OpenAPI_hss_av_type_FromString(av_type->valuestring); - cJSON *rand = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "rand"); + rand = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "rand"); if (!rand) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [rand]"); goto end; } - if (!cJSON_IsString(rand)) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [rand]"); goto end; } - cJSON *xres = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "xres"); + xres = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "xres"); if (!xres) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [xres]"); goto end; } - if (!cJSON_IsString(xres)) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [xres]"); goto end; } - cJSON *autn = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "autn"); + autn = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "autn"); if (!autn) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [autn]"); goto end; } - if (!cJSON_IsString(autn)) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [autn]"); goto end; } - cJSON *kasme = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "kasme"); + kasme = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "kasme"); if (!kasme) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [kasme]"); goto end; } - if (!cJSON_IsString(kasme)) { ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [kasme]"); goto end; diff --git a/lib/sbi/openapi/model/av_ims_gba_eap_aka.c b/lib/sbi/openapi/model/av_ims_gba_eap_aka.c index 31f29d18d..64a229a4c 100644 --- a/lib/sbi/openapi/model/av_ims_gba_eap_aka.c +++ b/lib/sbi/openapi/model/av_ims_gba_eap_aka.c @@ -28,21 +28,38 @@ OpenAPI_av_ims_gba_eap_aka_t *OpenAPI_av_ims_gba_eap_aka_create( void OpenAPI_av_ims_gba_eap_aka_free(OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka) { + OpenAPI_lnode_t *node = NULL; + if (NULL == av_ims_gba_eap_aka) { return; } - OpenAPI_lnode_t *node; - ogs_free(av_ims_gba_eap_aka->rand); - ogs_free(av_ims_gba_eap_aka->xres); - ogs_free(av_ims_gba_eap_aka->autn); - ogs_free(av_ims_gba_eap_aka->ck); - ogs_free(av_ims_gba_eap_aka->ik); + if (av_ims_gba_eap_aka->rand) { + ogs_free(av_ims_gba_eap_aka->rand); + av_ims_gba_eap_aka->rand = NULL; + } + if (av_ims_gba_eap_aka->xres) { + ogs_free(av_ims_gba_eap_aka->xres); + av_ims_gba_eap_aka->xres = NULL; + } + if (av_ims_gba_eap_aka->autn) { + ogs_free(av_ims_gba_eap_aka->autn); + av_ims_gba_eap_aka->autn = NULL; + } + if (av_ims_gba_eap_aka->ck) { + ogs_free(av_ims_gba_eap_aka->ck); + av_ims_gba_eap_aka->ck = NULL; + } + if (av_ims_gba_eap_aka->ik) { + ogs_free(av_ims_gba_eap_aka->ik); + av_ims_gba_eap_aka->ik = NULL; + } ogs_free(av_ims_gba_eap_aka); } cJSON *OpenAPI_av_ims_gba_eap_aka_convertToJSON(OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (av_ims_gba_eap_aka == NULL) { ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [AvImsGbaEapAka]"); @@ -50,31 +67,55 @@ cJSON *OpenAPI_av_ims_gba_eap_aka_convertToJSON(OpenAPI_av_ims_gba_eap_aka_t *av } item = cJSON_CreateObject(); + if (av_ims_gba_eap_aka->av_type == OpenAPI_hss_av_type_NULL) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [av_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "avType", OpenAPI_hss_av_type_ToString(av_ims_gba_eap_aka->av_type)) == NULL) { ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [av_type]"); goto end; } + if (!av_ims_gba_eap_aka->rand) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [rand]"); + return NULL; + } if (cJSON_AddStringToObject(item, "rand", av_ims_gba_eap_aka->rand) == NULL) { ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [rand]"); goto end; } + if (!av_ims_gba_eap_aka->xres) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [xres]"); + return NULL; + } if (cJSON_AddStringToObject(item, "xres", av_ims_gba_eap_aka->xres) == NULL) { ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [xres]"); goto end; } + if (!av_ims_gba_eap_aka->autn) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [autn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "autn", av_ims_gba_eap_aka->autn) == NULL) { ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [autn]"); goto end; } + if (!av_ims_gba_eap_aka->ck) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [ck]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ck", av_ims_gba_eap_aka->ck) == NULL) { ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [ck]"); goto end; } + if (!av_ims_gba_eap_aka->ik) { + ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [ik]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ik", av_ims_gba_eap_aka->ik) == NULL) { ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [ik]"); goto end; @@ -87,69 +128,70 @@ end: OpenAPI_av_ims_gba_eap_aka_t *OpenAPI_av_ims_gba_eap_aka_parseFromJSON(cJSON *av_ims_gba_eap_akaJSON) { OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_eap_aka_local_var = NULL; - cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "avType"); + OpenAPI_lnode_t *node = NULL; + cJSON *av_type = NULL; + OpenAPI_hss_av_type_e av_typeVariable = 0; + cJSON *rand = NULL; + cJSON *xres = NULL; + cJSON *autn = NULL; + cJSON *ck = NULL; + cJSON *ik = NULL; + av_type = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "avType"); if (!av_type) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [av_type]"); goto end; } - - OpenAPI_hss_av_type_e av_typeVariable; if (!cJSON_IsString(av_type)) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [av_type]"); goto end; } av_typeVariable = OpenAPI_hss_av_type_FromString(av_type->valuestring); - cJSON *rand = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "rand"); + rand = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "rand"); if (!rand) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [rand]"); goto end; } - if (!cJSON_IsString(rand)) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [rand]"); goto end; } - cJSON *xres = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "xres"); + xres = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "xres"); if (!xres) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [xres]"); goto end; } - if (!cJSON_IsString(xres)) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [xres]"); goto end; } - cJSON *autn = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "autn"); + autn = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "autn"); if (!autn) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [autn]"); goto end; } - if (!cJSON_IsString(autn)) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [autn]"); goto end; } - cJSON *ck = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "ck"); + ck = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "ck"); if (!ck) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [ck]"); goto end; } - if (!cJSON_IsString(ck)) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [ck]"); goto end; } - cJSON *ik = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "ik"); + ik = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "ik"); if (!ik) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [ik]"); goto end; } - if (!cJSON_IsString(ik)) { ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [ik]"); goto end; diff --git a/lib/sbi/openapi/model/backup_amf_info.c b/lib/sbi/openapi/model/backup_amf_info.c index 9732fe612..ae9901f33 100644 --- a/lib/sbi/openapi/model/backup_amf_info.c +++ b/lib/sbi/openapi/model/backup_amf_info.c @@ -20,21 +20,29 @@ OpenAPI_backup_amf_info_t *OpenAPI_backup_amf_info_create( void OpenAPI_backup_amf_info_free(OpenAPI_backup_amf_info_t *backup_amf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == backup_amf_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(backup_amf_info->backup_amf); - OpenAPI_list_for_each(backup_amf_info->guami_list, node) { - OpenAPI_guami_free(node->data); + if (backup_amf_info->backup_amf) { + ogs_free(backup_amf_info->backup_amf); + backup_amf_info->backup_amf = NULL; + } + if (backup_amf_info->guami_list) { + OpenAPI_list_for_each(backup_amf_info->guami_list, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(backup_amf_info->guami_list); + backup_amf_info->guami_list = NULL; } - OpenAPI_list_free(backup_amf_info->guami_list); ogs_free(backup_amf_info); } cJSON *OpenAPI_backup_amf_info_convertToJSON(OpenAPI_backup_amf_info_t *backup_amf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (backup_amf_info == NULL) { ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [BackupAmfInfo]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_backup_amf_info_convertToJSON(OpenAPI_backup_amf_info_t *backup_a } item = cJSON_CreateObject(); + if (!backup_amf_info->backup_amf) { + ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [backup_amf]"); + return NULL; + } if (cJSON_AddStringToObject(item, "backupAmf", backup_amf_info->backup_amf) == NULL) { ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [backup_amf]"); goto end; @@ -53,17 +65,13 @@ cJSON *OpenAPI_backup_amf_info_convertToJSON(OpenAPI_backup_amf_info_t *backup_a ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [guami_list]"); goto end; } - - OpenAPI_lnode_t *guami_list_node; - if (backup_amf_info->guami_list) { - OpenAPI_list_for_each(backup_amf_info->guami_list, guami_list_node) { - cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [guami_list]"); - goto end; - } - cJSON_AddItemToArray(guami_listList, itemLocal); + OpenAPI_list_for_each(backup_amf_info->guami_list, node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_backup_amf_info_convertToJSON() failed [guami_list]"); + goto end; } + cJSON_AddItemToArray(guami_listList, itemLocal); } } @@ -74,44 +82,43 @@ end: OpenAPI_backup_amf_info_t *OpenAPI_backup_amf_info_parseFromJSON(cJSON *backup_amf_infoJSON) { OpenAPI_backup_amf_info_t *backup_amf_info_local_var = NULL; - cJSON *backup_amf = cJSON_GetObjectItemCaseSensitive(backup_amf_infoJSON, "backupAmf"); + OpenAPI_lnode_t *node = NULL; + cJSON *backup_amf = NULL; + cJSON *guami_list = NULL; + OpenAPI_list_t *guami_listList = NULL; + backup_amf = cJSON_GetObjectItemCaseSensitive(backup_amf_infoJSON, "backupAmf"); if (!backup_amf) { ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [backup_amf]"); goto end; } - if (!cJSON_IsString(backup_amf)) { ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [backup_amf]"); goto end; } - cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(backup_amf_infoJSON, "guamiList"); - - OpenAPI_list_t *guami_listList; + guami_list = cJSON_GetObjectItemCaseSensitive(backup_amf_infoJSON, "guamiList"); if (guami_list) { - cJSON *guami_list_local_nonprimitive; - if (!cJSON_IsArray(guami_list)){ - ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [guami_list]"); - goto end; - } - - guami_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) { - if (!cJSON_IsObject(guami_list_local_nonprimitive)) { + cJSON *guami_list_local = NULL; + if (!cJSON_IsArray(guami_list)) { ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [guami_list]"); goto end; } - OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive); - if (!guami_listItem) { - ogs_error("No guami_listItem"); - OpenAPI_list_free(guami_listList); - goto end; + guami_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(guami_list_local, guami_list) { + if (!cJSON_IsObject(guami_list_local)) { + ogs_error("OpenAPI_backup_amf_info_parseFromJSON() failed [guami_list]"); + goto end; + } + OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local); + if (!guami_listItem) { + ogs_error("No guami_listItem"); + OpenAPI_list_free(guami_listList); + goto end; + } + OpenAPI_list_add(guami_listList, guami_listItem); } - - OpenAPI_list_add(guami_listList, guami_listItem); - } } backup_amf_info_local_var = OpenAPI_backup_amf_info_create ( @@ -121,6 +128,13 @@ OpenAPI_backup_amf_info_t *OpenAPI_backup_amf_info_parseFromJSON(cJSON *backup_a return backup_amf_info_local_var; end: + if (guami_listList) { + OpenAPI_list_for_each(guami_listList, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(guami_listList); + guami_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/battery_indication.c b/lib/sbi/openapi/model/battery_indication.c index c41566732..18ccd23d2 100644 --- a/lib/sbi/openapi/model/battery_indication.c +++ b/lib/sbi/openapi/model/battery_indication.c @@ -28,16 +28,18 @@ OpenAPI_battery_indication_t *OpenAPI_battery_indication_create( void OpenAPI_battery_indication_free(OpenAPI_battery_indication_t *battery_indication) { + OpenAPI_lnode_t *node = NULL; + if (NULL == battery_indication) { return; } - OpenAPI_lnode_t *node; ogs_free(battery_indication); } cJSON *OpenAPI_battery_indication_convertToJSON(OpenAPI_battery_indication_t *battery_indication) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (battery_indication == NULL) { ogs_error("OpenAPI_battery_indication_convertToJSON() failed [BatteryIndication]"); @@ -73,8 +75,11 @@ end: OpenAPI_battery_indication_t *OpenAPI_battery_indication_parseFromJSON(cJSON *battery_indicationJSON) { OpenAPI_battery_indication_t *battery_indication_local_var = NULL; - cJSON *battery_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "batteryInd"); - + OpenAPI_lnode_t *node = NULL; + cJSON *battery_ind = NULL; + cJSON *replaceable_ind = NULL; + cJSON *rechargeable_ind = NULL; + battery_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "batteryInd"); if (battery_ind) { if (!cJSON_IsBool(battery_ind)) { ogs_error("OpenAPI_battery_indication_parseFromJSON() failed [battery_ind]"); @@ -82,8 +87,7 @@ OpenAPI_battery_indication_t *OpenAPI_battery_indication_parseFromJSON(cJSON *ba } } - cJSON *replaceable_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "replaceableInd"); - + replaceable_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "replaceableInd"); if (replaceable_ind) { if (!cJSON_IsBool(replaceable_ind)) { ogs_error("OpenAPI_battery_indication_parseFromJSON() failed [replaceable_ind]"); @@ -91,8 +95,7 @@ OpenAPI_battery_indication_t *OpenAPI_battery_indication_parseFromJSON(cJSON *ba } } - cJSON *rechargeable_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "rechargeableInd"); - + rechargeable_ind = cJSON_GetObjectItemCaseSensitive(battery_indicationJSON, "rechargeableInd"); if (rechargeable_ind) { if (!cJSON_IsBool(rechargeable_ind)) { ogs_error("OpenAPI_battery_indication_parseFromJSON() failed [rechargeable_ind]"); diff --git a/lib/sbi/openapi/model/battery_indication_rm.c b/lib/sbi/openapi/model/battery_indication_rm.c index 5bc37ca82..1573e50f9 100644 --- a/lib/sbi/openapi/model/battery_indication_rm.c +++ b/lib/sbi/openapi/model/battery_indication_rm.c @@ -28,16 +28,18 @@ OpenAPI_battery_indication_rm_t *OpenAPI_battery_indication_rm_create( void OpenAPI_battery_indication_rm_free(OpenAPI_battery_indication_rm_t *battery_indication_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == battery_indication_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(battery_indication_rm); } cJSON *OpenAPI_battery_indication_rm_convertToJSON(OpenAPI_battery_indication_rm_t *battery_indication_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (battery_indication_rm == NULL) { ogs_error("OpenAPI_battery_indication_rm_convertToJSON() failed [BatteryIndicationRm]"); @@ -73,8 +75,11 @@ end: OpenAPI_battery_indication_rm_t *OpenAPI_battery_indication_rm_parseFromJSON(cJSON *battery_indication_rmJSON) { OpenAPI_battery_indication_rm_t *battery_indication_rm_local_var = NULL; - cJSON *battery_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "batteryInd"); - + OpenAPI_lnode_t *node = NULL; + cJSON *battery_ind = NULL; + cJSON *replaceable_ind = NULL; + cJSON *rechargeable_ind = NULL; + battery_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "batteryInd"); if (battery_ind) { if (!cJSON_IsBool(battery_ind)) { ogs_error("OpenAPI_battery_indication_rm_parseFromJSON() failed [battery_ind]"); @@ -82,8 +87,7 @@ OpenAPI_battery_indication_rm_t *OpenAPI_battery_indication_rm_parseFromJSON(cJS } } - cJSON *replaceable_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "replaceableInd"); - + replaceable_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "replaceableInd"); if (replaceable_ind) { if (!cJSON_IsBool(replaceable_ind)) { ogs_error("OpenAPI_battery_indication_rm_parseFromJSON() failed [replaceable_ind]"); @@ -91,8 +95,7 @@ OpenAPI_battery_indication_rm_t *OpenAPI_battery_indication_rm_parseFromJSON(cJS } } - cJSON *rechargeable_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "rechargeableInd"); - + rechargeable_ind = cJSON_GetObjectItemCaseSensitive(battery_indication_rmJSON, "rechargeableInd"); if (rechargeable_ind) { if (!cJSON_IsBool(rechargeable_ind)) { ogs_error("OpenAPI_battery_indication_rm_parseFromJSON() failed [rechargeable_ind]"); diff --git a/lib/sbi/openapi/model/bdt_data.c b/lib/sbi/openapi/model/bdt_data.c index 008c6116c..49aa6204a 100644 --- a/lib/sbi/openapi/model/bdt_data.c +++ b/lib/sbi/openapi/model/bdt_data.c @@ -40,26 +40,58 @@ OpenAPI_bdt_data_t *OpenAPI_bdt_data_create( void OpenAPI_bdt_data_free(OpenAPI_bdt_data_t *bdt_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == bdt_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(bdt_data->asp_id); - OpenAPI_transfer_policy_free(bdt_data->trans_policy); - ogs_free(bdt_data->bdt_ref_id); - OpenAPI_network_area_info_1_free(bdt_data->nw_area_info); - OpenAPI_usage_threshold_free(bdt_data->vol_per_ue); - ogs_free(bdt_data->dnn); - OpenAPI_snssai_free(bdt_data->snssai); - ogs_free(bdt_data->traffic_des); - OpenAPI_bdt_policy_status_free(bdt_data->bdtp_status); - ogs_free(bdt_data->supp_feat); + if (bdt_data->asp_id) { + ogs_free(bdt_data->asp_id); + bdt_data->asp_id = NULL; + } + if (bdt_data->trans_policy) { + OpenAPI_transfer_policy_free(bdt_data->trans_policy); + bdt_data->trans_policy = NULL; + } + if (bdt_data->bdt_ref_id) { + ogs_free(bdt_data->bdt_ref_id); + bdt_data->bdt_ref_id = NULL; + } + if (bdt_data->nw_area_info) { + OpenAPI_network_area_info_1_free(bdt_data->nw_area_info); + bdt_data->nw_area_info = NULL; + } + if (bdt_data->vol_per_ue) { + OpenAPI_usage_threshold_free(bdt_data->vol_per_ue); + bdt_data->vol_per_ue = NULL; + } + if (bdt_data->dnn) { + ogs_free(bdt_data->dnn); + bdt_data->dnn = NULL; + } + if (bdt_data->snssai) { + OpenAPI_snssai_free(bdt_data->snssai); + bdt_data->snssai = NULL; + } + if (bdt_data->traffic_des) { + ogs_free(bdt_data->traffic_des); + bdt_data->traffic_des = NULL; + } + if (bdt_data->bdtp_status) { + OpenAPI_bdt_policy_status_free(bdt_data->bdtp_status); + bdt_data->bdtp_status = NULL; + } + if (bdt_data->supp_feat) { + ogs_free(bdt_data->supp_feat); + bdt_data->supp_feat = NULL; + } ogs_free(bdt_data); } cJSON *OpenAPI_bdt_data_convertToJSON(OpenAPI_bdt_data_t *bdt_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (bdt_data == NULL) { ogs_error("OpenAPI_bdt_data_convertToJSON() failed [BdtData]"); @@ -67,11 +99,19 @@ cJSON *OpenAPI_bdt_data_convertToJSON(OpenAPI_bdt_data_t *bdt_data) } item = cJSON_CreateObject(); + if (!bdt_data->asp_id) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [asp_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "aspId", bdt_data->asp_id) == NULL) { ogs_error("OpenAPI_bdt_data_convertToJSON() failed [asp_id]"); goto end; } + if (!bdt_data->trans_policy) { + ogs_error("OpenAPI_bdt_data_convertToJSON() failed [trans_policy]"); + return NULL; + } cJSON *trans_policy_local_JSON = OpenAPI_transfer_policy_convertToJSON(bdt_data->trans_policy); if (trans_policy_local_JSON == NULL) { ogs_error("OpenAPI_bdt_data_convertToJSON() failed [trans_policy]"); @@ -177,44 +217,54 @@ end: OpenAPI_bdt_data_t *OpenAPI_bdt_data_parseFromJSON(cJSON *bdt_dataJSON) { OpenAPI_bdt_data_t *bdt_data_local_var = NULL; - cJSON *asp_id = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "aspId"); + OpenAPI_lnode_t *node = NULL; + cJSON *asp_id = NULL; + cJSON *trans_policy = NULL; + OpenAPI_transfer_policy_t *trans_policy_local_nonprim = NULL; + cJSON *bdt_ref_id = NULL; + cJSON *nw_area_info = NULL; + OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL; + cJSON *num_of_ues = NULL; + cJSON *vol_per_ue = NULL; + OpenAPI_usage_threshold_t *vol_per_ue_local_nonprim = NULL; + cJSON *dnn = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *traffic_des = NULL; + cJSON *bdtp_status = NULL; + OpenAPI_bdt_policy_status_t *bdtp_status_local_nonprim = NULL; + cJSON *supp_feat = NULL; + asp_id = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "aspId"); if (!asp_id) { ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [asp_id]"); goto end; } - if (!cJSON_IsString(asp_id)) { ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [asp_id]"); goto end; } - cJSON *trans_policy = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "transPolicy"); + trans_policy = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "transPolicy"); if (!trans_policy) { ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [trans_policy]"); goto end; } - - OpenAPI_transfer_policy_t *trans_policy_local_nonprim = NULL; trans_policy_local_nonprim = OpenAPI_transfer_policy_parseFromJSON(trans_policy); - cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "bdtRefId"); - + bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "bdtRefId"); if (bdt_ref_id) { - if (!cJSON_IsString(bdt_ref_id)) { + if (!cJSON_IsString(bdt_ref_id) && !cJSON_IsNull(bdt_ref_id)) { ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [bdt_ref_id]"); goto end; } } - cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "nwAreaInfo"); - - OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL; + nw_area_info = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "nwAreaInfo"); if (nw_area_info) { nw_area_info_local_nonprim = OpenAPI_network_area_info_1_parseFromJSON(nw_area_info); } - cJSON *num_of_ues = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "numOfUes"); - + num_of_ues = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "numOfUes"); if (num_of_ues) { if (!cJSON_IsNumber(num_of_ues)) { ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [num_of_ues]"); @@ -222,49 +272,40 @@ OpenAPI_bdt_data_t *OpenAPI_bdt_data_parseFromJSON(cJSON *bdt_dataJSON) } } - cJSON *vol_per_ue = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "volPerUe"); - - OpenAPI_usage_threshold_t *vol_per_ue_local_nonprim = NULL; + vol_per_ue = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "volPerUe"); if (vol_per_ue) { vol_per_ue_local_nonprim = OpenAPI_usage_threshold_parseFromJSON(vol_per_ue); } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "snssai"); - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "snssai"); if (snssai) { snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); } - cJSON *traffic_des = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "trafficDes"); - + traffic_des = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "trafficDes"); if (traffic_des) { - if (!cJSON_IsString(traffic_des)) { + if (!cJSON_IsString(traffic_des) && !cJSON_IsNull(traffic_des)) { ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [traffic_des]"); goto end; } } - cJSON *bdtp_status = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "bdtpStatus"); - - OpenAPI_bdt_policy_status_t *bdtp_status_local_nonprim = NULL; + bdtp_status = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "bdtpStatus"); if (bdtp_status) { bdtp_status_local_nonprim = OpenAPI_bdt_policy_status_parseFromJSON(bdtp_status); } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(bdt_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_bdt_data_parseFromJSON() failed [supp_feat]"); goto end; } @@ -273,20 +314,40 @@ OpenAPI_bdt_data_t *OpenAPI_bdt_data_parseFromJSON(cJSON *bdt_dataJSON) bdt_data_local_var = OpenAPI_bdt_data_create ( ogs_strdup(asp_id->valuestring), trans_policy_local_nonprim, - bdt_ref_id ? ogs_strdup(bdt_ref_id->valuestring) : NULL, + bdt_ref_id && !cJSON_IsNull(bdt_ref_id) ? ogs_strdup(bdt_ref_id->valuestring) : NULL, nw_area_info ? nw_area_info_local_nonprim : NULL, num_of_ues ? true : false, num_of_ues ? num_of_ues->valuedouble : 0, vol_per_ue ? vol_per_ue_local_nonprim : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, snssai ? snssai_local_nonprim : NULL, - traffic_des ? ogs_strdup(traffic_des->valuestring) : NULL, + traffic_des && !cJSON_IsNull(traffic_des) ? ogs_strdup(traffic_des->valuestring) : NULL, bdtp_status ? bdtp_status_local_nonprim : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return bdt_data_local_var; end: + if (trans_policy_local_nonprim) { + OpenAPI_transfer_policy_free(trans_policy_local_nonprim); + trans_policy_local_nonprim = NULL; + } + if (nw_area_info_local_nonprim) { + OpenAPI_network_area_info_1_free(nw_area_info_local_nonprim); + nw_area_info_local_nonprim = NULL; + } + if (vol_per_ue_local_nonprim) { + OpenAPI_usage_threshold_free(vol_per_ue_local_nonprim); + vol_per_ue_local_nonprim = NULL; + } + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (bdtp_status_local_nonprim) { + OpenAPI_bdt_policy_status_free(bdtp_status_local_nonprim); + bdtp_status_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/bdt_data_patch.c b/lib/sbi/openapi/model/bdt_data_patch.c index 352c261a9..e0047e90e 100644 --- a/lib/sbi/openapi/model/bdt_data_patch.c +++ b/lib/sbi/openapi/model/bdt_data_patch.c @@ -20,18 +20,26 @@ OpenAPI_bdt_data_patch_t *OpenAPI_bdt_data_patch_create( void OpenAPI_bdt_data_patch_free(OpenAPI_bdt_data_patch_t *bdt_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == bdt_data_patch) { return; } - OpenAPI_lnode_t *node; - OpenAPI_transfer_policy_free(bdt_data_patch->trans_policy); - OpenAPI_bdt_policy_status_free(bdt_data_patch->bdtp_status); + if (bdt_data_patch->trans_policy) { + OpenAPI_transfer_policy_free(bdt_data_patch->trans_policy); + bdt_data_patch->trans_policy = NULL; + } + if (bdt_data_patch->bdtp_status) { + OpenAPI_bdt_policy_status_free(bdt_data_patch->bdtp_status); + bdt_data_patch->bdtp_status = NULL; + } ogs_free(bdt_data_patch); } cJSON *OpenAPI_bdt_data_patch_convertToJSON(OpenAPI_bdt_data_patch_t *bdt_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (bdt_data_patch == NULL) { ogs_error("OpenAPI_bdt_data_patch_convertToJSON() failed [BdtDataPatch]"); @@ -72,16 +80,17 @@ end: OpenAPI_bdt_data_patch_t *OpenAPI_bdt_data_patch_parseFromJSON(cJSON *bdt_data_patchJSON) { OpenAPI_bdt_data_patch_t *bdt_data_patch_local_var = NULL; - cJSON *trans_policy = cJSON_GetObjectItemCaseSensitive(bdt_data_patchJSON, "transPolicy"); - + OpenAPI_lnode_t *node = NULL; + cJSON *trans_policy = NULL; OpenAPI_transfer_policy_t *trans_policy_local_nonprim = NULL; + cJSON *bdtp_status = NULL; + OpenAPI_bdt_policy_status_t *bdtp_status_local_nonprim = NULL; + trans_policy = cJSON_GetObjectItemCaseSensitive(bdt_data_patchJSON, "transPolicy"); if (trans_policy) { trans_policy_local_nonprim = OpenAPI_transfer_policy_parseFromJSON(trans_policy); } - cJSON *bdtp_status = cJSON_GetObjectItemCaseSensitive(bdt_data_patchJSON, "bdtpStatus"); - - OpenAPI_bdt_policy_status_t *bdtp_status_local_nonprim = NULL; + bdtp_status = cJSON_GetObjectItemCaseSensitive(bdt_data_patchJSON, "bdtpStatus"); if (bdtp_status) { bdtp_status_local_nonprim = OpenAPI_bdt_policy_status_parseFromJSON(bdtp_status); } @@ -93,6 +102,14 @@ OpenAPI_bdt_data_patch_t *OpenAPI_bdt_data_patch_parseFromJSON(cJSON *bdt_data_p return bdt_data_patch_local_var; end: + if (trans_policy_local_nonprim) { + OpenAPI_transfer_policy_free(trans_policy_local_nonprim); + trans_policy_local_nonprim = NULL; + } + if (bdtp_status_local_nonprim) { + OpenAPI_bdt_policy_status_free(bdtp_status_local_nonprim); + bdtp_status_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/bdt_policy_data.c b/lib/sbi/openapi/model/bdt_policy_data.c index 81b15d455..fb7774894 100644 --- a/lib/sbi/openapi/model/bdt_policy_data.c +++ b/lib/sbi/openapi/model/bdt_policy_data.c @@ -28,22 +28,42 @@ OpenAPI_bdt_policy_data_t *OpenAPI_bdt_policy_data_create( void OpenAPI_bdt_policy_data_free(OpenAPI_bdt_policy_data_t *bdt_policy_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == bdt_policy_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(bdt_policy_data->inter_group_id); - ogs_free(bdt_policy_data->supi); - ogs_free(bdt_policy_data->bdt_ref_id); - ogs_free(bdt_policy_data->dnn); - OpenAPI_snssai_free(bdt_policy_data->snssai); - ogs_free(bdt_policy_data->res_uri); + if (bdt_policy_data->inter_group_id) { + ogs_free(bdt_policy_data->inter_group_id); + bdt_policy_data->inter_group_id = NULL; + } + if (bdt_policy_data->supi) { + ogs_free(bdt_policy_data->supi); + bdt_policy_data->supi = NULL; + } + if (bdt_policy_data->bdt_ref_id) { + ogs_free(bdt_policy_data->bdt_ref_id); + bdt_policy_data->bdt_ref_id = NULL; + } + if (bdt_policy_data->dnn) { + ogs_free(bdt_policy_data->dnn); + bdt_policy_data->dnn = NULL; + } + if (bdt_policy_data->snssai) { + OpenAPI_snssai_free(bdt_policy_data->snssai); + bdt_policy_data->snssai = NULL; + } + if (bdt_policy_data->res_uri) { + ogs_free(bdt_policy_data->res_uri); + bdt_policy_data->res_uri = NULL; + } ogs_free(bdt_policy_data); } cJSON *OpenAPI_bdt_policy_data_convertToJSON(OpenAPI_bdt_policy_data_t *bdt_policy_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (bdt_policy_data == NULL) { ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [BdtPolicyData]"); @@ -65,6 +85,10 @@ cJSON *OpenAPI_bdt_policy_data_convertToJSON(OpenAPI_bdt_policy_data_t *bdt_poli } } + if (!bdt_policy_data->bdt_ref_id) { + ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [bdt_ref_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "bdtRefId", bdt_policy_data->bdt_ref_id) == NULL) { ogs_error("OpenAPI_bdt_policy_data_convertToJSON() failed [bdt_ref_id]"); goto end; @@ -104,71 +128,76 @@ end: OpenAPI_bdt_policy_data_t *OpenAPI_bdt_policy_data_parseFromJSON(cJSON *bdt_policy_dataJSON) { OpenAPI_bdt_policy_data_t *bdt_policy_data_local_var = NULL; - cJSON *inter_group_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "interGroupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *inter_group_id = NULL; + cJSON *supi = NULL; + cJSON *bdt_ref_id = NULL; + cJSON *dnn = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *res_uri = NULL; + inter_group_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "interGroupId"); if (inter_group_id) { - if (!cJSON_IsString(inter_group_id)) { + if (!cJSON_IsString(inter_group_id) && !cJSON_IsNull(inter_group_id)) { ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [inter_group_id]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "bdtRefId"); + bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "bdtRefId"); if (!bdt_ref_id) { ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [bdt_ref_id]"); goto end; } - if (!cJSON_IsString(bdt_ref_id)) { ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [bdt_ref_id]"); goto end; } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "snssai"); - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "snssai"); if (snssai) { snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); } - cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "resUri"); - + res_uri = cJSON_GetObjectItemCaseSensitive(bdt_policy_dataJSON, "resUri"); if (res_uri) { - if (!cJSON_IsString(res_uri)) { + if (!cJSON_IsString(res_uri) && !cJSON_IsNull(res_uri)) { ogs_error("OpenAPI_bdt_policy_data_parseFromJSON() failed [res_uri]"); goto end; } } bdt_policy_data_local_var = OpenAPI_bdt_policy_data_create ( - inter_group_id ? ogs_strdup(inter_group_id->valuestring) : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL, + inter_group_id && !cJSON_IsNull(inter_group_id) ? ogs_strdup(inter_group_id->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, ogs_strdup(bdt_ref_id->valuestring), - dnn ? ogs_strdup(dnn->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, snssai ? snssai_local_nonprim : NULL, - res_uri ? ogs_strdup(res_uri->valuestring) : NULL + res_uri && !cJSON_IsNull(res_uri) ? ogs_strdup(res_uri->valuestring) : NULL ); return bdt_policy_data_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/bdt_policy_data_patch.c b/lib/sbi/openapi/model/bdt_policy_data_patch.c index 3869c4ff9..9b91b7e8a 100644 --- a/lib/sbi/openapi/model/bdt_policy_data_patch.c +++ b/lib/sbi/openapi/model/bdt_policy_data_patch.c @@ -18,17 +18,22 @@ OpenAPI_bdt_policy_data_patch_t *OpenAPI_bdt_policy_data_patch_create( void OpenAPI_bdt_policy_data_patch_free(OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == bdt_policy_data_patch) { return; } - OpenAPI_lnode_t *node; - ogs_free(bdt_policy_data_patch->bdt_ref_id); + if (bdt_policy_data_patch->bdt_ref_id) { + ogs_free(bdt_policy_data_patch->bdt_ref_id); + bdt_policy_data_patch->bdt_ref_id = NULL; + } ogs_free(bdt_policy_data_patch); } cJSON *OpenAPI_bdt_policy_data_patch_convertToJSON(OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (bdt_policy_data_patch == NULL) { ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [BdtPolicyDataPatch]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_bdt_policy_data_patch_convertToJSON(OpenAPI_bdt_policy_data_patch } item = cJSON_CreateObject(); + if (!bdt_policy_data_patch->bdt_ref_id) { + ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [bdt_ref_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "bdtRefId", bdt_policy_data_patch->bdt_ref_id) == NULL) { ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [bdt_ref_id]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_bdt_policy_data_patch_t *OpenAPI_bdt_policy_data_patch_parseFromJSON(cJSON *bdt_policy_data_patchJSON) { OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch_local_var = NULL; - cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_data_patchJSON, "bdtRefId"); + OpenAPI_lnode_t *node = NULL; + cJSON *bdt_ref_id = NULL; + bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_data_patchJSON, "bdtRefId"); if (!bdt_ref_id) { ogs_error("OpenAPI_bdt_policy_data_patch_parseFromJSON() failed [bdt_ref_id]"); goto end; } - if (!cJSON_IsString(bdt_ref_id)) { ogs_error("OpenAPI_bdt_policy_data_patch_parseFromJSON() failed [bdt_ref_id]"); goto end; diff --git a/lib/sbi/openapi/model/bdt_policy_status.c b/lib/sbi/openapi/model/bdt_policy_status.c index 572d81c21..a03a10966 100644 --- a/lib/sbi/openapi/model/bdt_policy_status.c +++ b/lib/sbi/openapi/model/bdt_policy_status.c @@ -16,16 +16,18 @@ OpenAPI_bdt_policy_status_t *OpenAPI_bdt_policy_status_create( void OpenAPI_bdt_policy_status_free(OpenAPI_bdt_policy_status_t *bdt_policy_status) { + OpenAPI_lnode_t *node = NULL; + if (NULL == bdt_policy_status) { return; } - OpenAPI_lnode_t *node; ogs_free(bdt_policy_status); } cJSON *OpenAPI_bdt_policy_status_convertToJSON(OpenAPI_bdt_policy_status_t *bdt_policy_status) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (bdt_policy_status == NULL) { ogs_error("OpenAPI_bdt_policy_status_convertToJSON() failed [BdtPolicyStatus]"); @@ -40,6 +42,7 @@ end: OpenAPI_bdt_policy_status_t *OpenAPI_bdt_policy_status_parseFromJSON(cJSON *bdt_policy_statusJSON) { OpenAPI_bdt_policy_status_t *bdt_policy_status_local_var = NULL; + OpenAPI_lnode_t *node = NULL; bdt_policy_status_local_var = OpenAPI_bdt_policy_status_create ( ); diff --git a/lib/sbi/openapi/model/binding_resp.c b/lib/sbi/openapi/model/binding_resp.c index 4ca06ec32..166965bdc 100644 --- a/lib/sbi/openapi/model/binding_resp.c +++ b/lib/sbi/openapi/model/binding_resp.c @@ -20,21 +20,29 @@ OpenAPI_binding_resp_t *OpenAPI_binding_resp_create( void OpenAPI_binding_resp_free(OpenAPI_binding_resp_t *binding_resp) { + OpenAPI_lnode_t *node = NULL; + if (NULL == binding_resp) { return; } - OpenAPI_lnode_t *node; - ogs_free(binding_resp->pcf_sm_fqdn); - OpenAPI_list_for_each(binding_resp->pcf_sm_ip_end_points, node) { - OpenAPI_ip_end_point_free(node->data); + if (binding_resp->pcf_sm_fqdn) { + ogs_free(binding_resp->pcf_sm_fqdn); + binding_resp->pcf_sm_fqdn = NULL; + } + if (binding_resp->pcf_sm_ip_end_points) { + OpenAPI_list_for_each(binding_resp->pcf_sm_ip_end_points, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(binding_resp->pcf_sm_ip_end_points); + binding_resp->pcf_sm_ip_end_points = NULL; } - OpenAPI_list_free(binding_resp->pcf_sm_ip_end_points); ogs_free(binding_resp); } cJSON *OpenAPI_binding_resp_convertToJSON(OpenAPI_binding_resp_t *binding_resp) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (binding_resp == NULL) { ogs_error("OpenAPI_binding_resp_convertToJSON() failed [BindingResp]"); @@ -55,17 +63,13 @@ cJSON *OpenAPI_binding_resp_convertToJSON(OpenAPI_binding_resp_t *binding_resp) ogs_error("OpenAPI_binding_resp_convertToJSON() failed [pcf_sm_ip_end_points]"); goto end; } - - OpenAPI_lnode_t *pcf_sm_ip_end_points_node; - if (binding_resp->pcf_sm_ip_end_points) { - OpenAPI_list_for_each(binding_resp->pcf_sm_ip_end_points, pcf_sm_ip_end_points_node) { - cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(pcf_sm_ip_end_points_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_binding_resp_convertToJSON() failed [pcf_sm_ip_end_points]"); - goto end; - } - cJSON_AddItemToArray(pcf_sm_ip_end_pointsList, itemLocal); + OpenAPI_list_for_each(binding_resp->pcf_sm_ip_end_points, node) { + cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_binding_resp_convertToJSON() failed [pcf_sm_ip_end_points]"); + goto end; } + cJSON_AddItemToArray(pcf_sm_ip_end_pointsList, itemLocal); } } @@ -76,51 +80,57 @@ end: OpenAPI_binding_resp_t *OpenAPI_binding_resp_parseFromJSON(cJSON *binding_respJSON) { OpenAPI_binding_resp_t *binding_resp_local_var = NULL; - cJSON *pcf_sm_fqdn = cJSON_GetObjectItemCaseSensitive(binding_respJSON, "pcfSmFqdn"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pcf_sm_fqdn = NULL; + cJSON *pcf_sm_ip_end_points = NULL; + OpenAPI_list_t *pcf_sm_ip_end_pointsList = NULL; + pcf_sm_fqdn = cJSON_GetObjectItemCaseSensitive(binding_respJSON, "pcfSmFqdn"); if (pcf_sm_fqdn) { - if (!cJSON_IsString(pcf_sm_fqdn)) { + if (!cJSON_IsString(pcf_sm_fqdn) && !cJSON_IsNull(pcf_sm_fqdn)) { ogs_error("OpenAPI_binding_resp_parseFromJSON() failed [pcf_sm_fqdn]"); goto end; } } - cJSON *pcf_sm_ip_end_points = cJSON_GetObjectItemCaseSensitive(binding_respJSON, "pcfSmIpEndPoints"); - - OpenAPI_list_t *pcf_sm_ip_end_pointsList; + pcf_sm_ip_end_points = cJSON_GetObjectItemCaseSensitive(binding_respJSON, "pcfSmIpEndPoints"); if (pcf_sm_ip_end_points) { - cJSON *pcf_sm_ip_end_points_local_nonprimitive; - if (!cJSON_IsArray(pcf_sm_ip_end_points)){ - ogs_error("OpenAPI_binding_resp_parseFromJSON() failed [pcf_sm_ip_end_points]"); - goto end; - } - - pcf_sm_ip_end_pointsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pcf_sm_ip_end_points_local_nonprimitive, pcf_sm_ip_end_points ) { - if (!cJSON_IsObject(pcf_sm_ip_end_points_local_nonprimitive)) { + cJSON *pcf_sm_ip_end_points_local = NULL; + if (!cJSON_IsArray(pcf_sm_ip_end_points)) { ogs_error("OpenAPI_binding_resp_parseFromJSON() failed [pcf_sm_ip_end_points]"); goto end; } - OpenAPI_ip_end_point_t *pcf_sm_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(pcf_sm_ip_end_points_local_nonprimitive); - if (!pcf_sm_ip_end_pointsItem) { - ogs_error("No pcf_sm_ip_end_pointsItem"); - OpenAPI_list_free(pcf_sm_ip_end_pointsList); - goto end; + pcf_sm_ip_end_pointsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pcf_sm_ip_end_points_local, pcf_sm_ip_end_points) { + if (!cJSON_IsObject(pcf_sm_ip_end_points_local)) { + ogs_error("OpenAPI_binding_resp_parseFromJSON() failed [pcf_sm_ip_end_points]"); + goto end; + } + OpenAPI_ip_end_point_t *pcf_sm_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(pcf_sm_ip_end_points_local); + if (!pcf_sm_ip_end_pointsItem) { + ogs_error("No pcf_sm_ip_end_pointsItem"); + OpenAPI_list_free(pcf_sm_ip_end_pointsList); + goto end; + } + OpenAPI_list_add(pcf_sm_ip_end_pointsList, pcf_sm_ip_end_pointsItem); } - - OpenAPI_list_add(pcf_sm_ip_end_pointsList, pcf_sm_ip_end_pointsItem); - } } binding_resp_local_var = OpenAPI_binding_resp_create ( - pcf_sm_fqdn ? ogs_strdup(pcf_sm_fqdn->valuestring) : NULL, + pcf_sm_fqdn && !cJSON_IsNull(pcf_sm_fqdn) ? ogs_strdup(pcf_sm_fqdn->valuestring) : NULL, pcf_sm_ip_end_points ? pcf_sm_ip_end_pointsList : NULL ); return binding_resp_local_var; end: + if (pcf_sm_ip_end_pointsList) { + OpenAPI_list_for_each(pcf_sm_ip_end_pointsList, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(pcf_sm_ip_end_pointsList); + pcf_sm_ip_end_pointsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/bridge_management_container.c b/lib/sbi/openapi/model/bridge_management_container.c index 0317d66a6..e403babff 100644 --- a/lib/sbi/openapi/model/bridge_management_container.c +++ b/lib/sbi/openapi/model/bridge_management_container.c @@ -5,7 +5,7 @@ #include "bridge_management_container.h" OpenAPI_bridge_management_container_t *OpenAPI_bridge_management_container_create( - char bridge_man_cont + char *bridge_man_cont ) { OpenAPI_bridge_management_container_t *bridge_management_container_local_var = ogs_malloc(sizeof(OpenAPI_bridge_management_container_t)); @@ -18,16 +18,22 @@ OpenAPI_bridge_management_container_t *OpenAPI_bridge_management_container_creat void OpenAPI_bridge_management_container_free(OpenAPI_bridge_management_container_t *bridge_management_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == bridge_management_container) { return; } - OpenAPI_lnode_t *node; + if (bridge_management_container->bridge_man_cont) { + ogs_free(bridge_management_container->bridge_man_cont); + bridge_management_container->bridge_man_cont = NULL; + } ogs_free(bridge_management_container); } cJSON *OpenAPI_bridge_management_container_convertToJSON(OpenAPI_bridge_management_container_t *bridge_management_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (bridge_management_container == NULL) { ogs_error("OpenAPI_bridge_management_container_convertToJSON() failed [BridgeManagementContainer]"); @@ -35,7 +41,11 @@ cJSON *OpenAPI_bridge_management_container_convertToJSON(OpenAPI_bridge_manageme } item = cJSON_CreateObject(); - if (cJSON_AddNumberToObject(item, "bridgeManCont", bridge_management_container->bridge_man_cont) == NULL) { + if (!bridge_management_container->bridge_man_cont) { + ogs_error("OpenAPI_bridge_management_container_convertToJSON() failed [bridge_man_cont]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "bridgeManCont", bridge_management_container->bridge_man_cont) == NULL) { ogs_error("OpenAPI_bridge_management_container_convertToJSON() failed [bridge_man_cont]"); goto end; } @@ -47,19 +57,20 @@ end: OpenAPI_bridge_management_container_t *OpenAPI_bridge_management_container_parseFromJSON(cJSON *bridge_management_containerJSON) { OpenAPI_bridge_management_container_t *bridge_management_container_local_var = NULL; - cJSON *bridge_man_cont = cJSON_GetObjectItemCaseSensitive(bridge_management_containerJSON, "bridgeManCont"); + OpenAPI_lnode_t *node = NULL; + cJSON *bridge_man_cont = NULL; + bridge_man_cont = cJSON_GetObjectItemCaseSensitive(bridge_management_containerJSON, "bridgeManCont"); if (!bridge_man_cont) { ogs_error("OpenAPI_bridge_management_container_parseFromJSON() failed [bridge_man_cont]"); goto end; } - - if (!cJSON_IsNumber(bridge_man_cont)) { + if (!cJSON_IsString(bridge_man_cont)) { ogs_error("OpenAPI_bridge_management_container_parseFromJSON() failed [bridge_man_cont]"); goto end; } bridge_management_container_local_var = OpenAPI_bridge_management_container_create ( - bridge_man_cont->valueint + ogs_strdup(bridge_man_cont->valuestring) ); return bridge_management_container_local_var; diff --git a/lib/sbi/openapi/model/bridge_management_container.h b/lib/sbi/openapi/model/bridge_management_container.h index 2a80a48a1..af0be3b7b 100644 --- a/lib/sbi/openapi/model/bridge_management_container.h +++ b/lib/sbi/openapi/model/bridge_management_container.h @@ -19,11 +19,11 @@ extern "C" { typedef struct OpenAPI_bridge_management_container_s OpenAPI_bridge_management_container_t; typedef struct OpenAPI_bridge_management_container_s { - char bridge_man_cont; + char *bridge_man_cont; } OpenAPI_bridge_management_container_t; OpenAPI_bridge_management_container_t *OpenAPI_bridge_management_container_create( - char bridge_man_cont + char *bridge_man_cont ); void OpenAPI_bridge_management_container_free(OpenAPI_bridge_management_container_t *bridge_management_container); OpenAPI_bridge_management_container_t *OpenAPI_bridge_management_container_parseFromJSON(cJSON *bridge_management_containerJSON); diff --git a/lib/sbi/openapi/model/bsf_info.c b/lib/sbi/openapi/model/bsf_info.c index 5eb17d49d..b6f1b70a2 100644 --- a/lib/sbi/openapi/model/bsf_info.c +++ b/lib/sbi/openapi/model/bsf_info.c @@ -24,32 +24,46 @@ OpenAPI_bsf_info_t *OpenAPI_bsf_info_create( void OpenAPI_bsf_info_free(OpenAPI_bsf_info_t *bsf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == bsf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(bsf_info->dnn_list, node) { - ogs_free(node->data); + if (bsf_info->dnn_list) { + OpenAPI_list_for_each(bsf_info->dnn_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(bsf_info->dnn_list); + bsf_info->dnn_list = NULL; } - OpenAPI_list_free(bsf_info->dnn_list); - OpenAPI_list_for_each(bsf_info->ip_domain_list, node) { - ogs_free(node->data); + if (bsf_info->ip_domain_list) { + OpenAPI_list_for_each(bsf_info->ip_domain_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(bsf_info->ip_domain_list); + bsf_info->ip_domain_list = NULL; } - OpenAPI_list_free(bsf_info->ip_domain_list); - OpenAPI_list_for_each(bsf_info->ipv4_address_ranges, node) { - OpenAPI_ipv4_address_range_free(node->data); + if (bsf_info->ipv4_address_ranges) { + OpenAPI_list_for_each(bsf_info->ipv4_address_ranges, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(bsf_info->ipv4_address_ranges); + bsf_info->ipv4_address_ranges = NULL; } - OpenAPI_list_free(bsf_info->ipv4_address_ranges); - OpenAPI_list_for_each(bsf_info->ipv6_prefix_ranges, node) { - OpenAPI_ipv6_prefix_range_free(node->data); + if (bsf_info->ipv6_prefix_ranges) { + OpenAPI_list_for_each(bsf_info->ipv6_prefix_ranges, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(bsf_info->ipv6_prefix_ranges); + bsf_info->ipv6_prefix_ranges = NULL; } - OpenAPI_list_free(bsf_info->ipv6_prefix_ranges); ogs_free(bsf_info); } cJSON *OpenAPI_bsf_info_convertToJSON(OpenAPI_bsf_info_t *bsf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (bsf_info == NULL) { ogs_error("OpenAPI_bsf_info_convertToJSON() failed [BsfInfo]"); @@ -58,35 +72,31 @@ cJSON *OpenAPI_bsf_info_convertToJSON(OpenAPI_bsf_info_t *bsf_info) item = cJSON_CreateObject(); if (bsf_info->dnn_list) { - cJSON *dnn_list = cJSON_AddArrayToObject(item, "dnnList"); - if (dnn_list == NULL) { + cJSON *dnn_listList = cJSON_AddArrayToObject(item, "dnnList"); + if (dnn_listList == NULL) { ogs_error("OpenAPI_bsf_info_convertToJSON() failed [dnn_list]"); goto end; } - - OpenAPI_lnode_t *dnn_list_node; - OpenAPI_list_for_each(bsf_info->dnn_list, dnn_list_node) { - if (cJSON_AddStringToObject(dnn_list, "", (char*)dnn_list_node->data) == NULL) { - ogs_error("OpenAPI_bsf_info_convertToJSON() failed [dnn_list]"); - goto end; + OpenAPI_list_for_each(bsf_info->dnn_list, node) { + if (cJSON_AddStringToObject(dnn_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_bsf_info_convertToJSON() failed [dnn_list]"); + goto end; + } } - } } if (bsf_info->ip_domain_list) { - cJSON *ip_domain_list = cJSON_AddArrayToObject(item, "ipDomainList"); - if (ip_domain_list == NULL) { + cJSON *ip_domain_listList = cJSON_AddArrayToObject(item, "ipDomainList"); + if (ip_domain_listList == NULL) { ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ip_domain_list]"); goto end; } - - OpenAPI_lnode_t *ip_domain_list_node; - OpenAPI_list_for_each(bsf_info->ip_domain_list, ip_domain_list_node) { - if (cJSON_AddStringToObject(ip_domain_list, "", (char*)ip_domain_list_node->data) == NULL) { - ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ip_domain_list]"); - goto end; + OpenAPI_list_for_each(bsf_info->ip_domain_list, node) { + if (cJSON_AddStringToObject(ip_domain_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ip_domain_list]"); + goto end; + } } - } } if (bsf_info->ipv4_address_ranges) { @@ -95,17 +105,13 @@ cJSON *OpenAPI_bsf_info_convertToJSON(OpenAPI_bsf_info_t *bsf_info) ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ipv4_address_ranges]"); goto end; } - - OpenAPI_lnode_t *ipv4_address_ranges_node; - if (bsf_info->ipv4_address_ranges) { - OpenAPI_list_for_each(bsf_info->ipv4_address_ranges, ipv4_address_ranges_node) { - cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(ipv4_address_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ipv4_address_ranges]"); - goto end; - } - cJSON_AddItemToArray(ipv4_address_rangesList, itemLocal); + OpenAPI_list_for_each(bsf_info->ipv4_address_ranges, node) { + cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ipv4_address_ranges]"); + goto end; } + cJSON_AddItemToArray(ipv4_address_rangesList, itemLocal); } } @@ -115,17 +121,13 @@ cJSON *OpenAPI_bsf_info_convertToJSON(OpenAPI_bsf_info_t *bsf_info) ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ipv6_prefix_ranges]"); goto end; } - - OpenAPI_lnode_t *ipv6_prefix_ranges_node; - if (bsf_info->ipv6_prefix_ranges) { - OpenAPI_list_for_each(bsf_info->ipv6_prefix_ranges, ipv6_prefix_ranges_node) { - cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(ipv6_prefix_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ipv6_prefix_ranges]"); - goto end; - } - cJSON_AddItemToArray(ipv6_prefix_rangesList, itemLocal); + OpenAPI_list_for_each(bsf_info->ipv6_prefix_ranges, node) { + cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_bsf_info_convertToJSON() failed [ipv6_prefix_ranges]"); + goto end; } + cJSON_AddItemToArray(ipv6_prefix_rangesList, itemLocal); } } @@ -136,102 +138,105 @@ end: OpenAPI_bsf_info_t *OpenAPI_bsf_info_parseFromJSON(cJSON *bsf_infoJSON) { OpenAPI_bsf_info_t *bsf_info_local_var = NULL; - cJSON *dnn_list = cJSON_GetObjectItemCaseSensitive(bsf_infoJSON, "dnnList"); - - OpenAPI_list_t *dnn_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *dnn_list = NULL; + OpenAPI_list_t *dnn_listList = NULL; + cJSON *ip_domain_list = NULL; + OpenAPI_list_t *ip_domain_listList = NULL; + cJSON *ipv4_address_ranges = NULL; + OpenAPI_list_t *ipv4_address_rangesList = NULL; + cJSON *ipv6_prefix_ranges = NULL; + OpenAPI_list_t *ipv6_prefix_rangesList = NULL; + dnn_list = cJSON_GetObjectItemCaseSensitive(bsf_infoJSON, "dnnList"); if (dnn_list) { - cJSON *dnn_list_local; - if (!cJSON_IsArray(dnn_list)) { - ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [dnn_list]"); - goto end; - } - dnn_listList = OpenAPI_list_create(); + cJSON *dnn_list_local = NULL; + if (!cJSON_IsArray(dnn_list)) { + ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [dnn_list]"); + goto end; + } - cJSON_ArrayForEach(dnn_list_local, dnn_list) { - if (!cJSON_IsString(dnn_list_local)) { - ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [dnn_list]"); - goto end; - } - OpenAPI_list_add(dnn_listList, ogs_strdup(dnn_list_local->valuestring)); - } + dnn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_list_local, dnn_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnn_list_local)) { + ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [dnn_list]"); + goto end; + } + OpenAPI_list_add(dnn_listList, ogs_strdup(dnn_list_local->valuestring)); + } } - cJSON *ip_domain_list = cJSON_GetObjectItemCaseSensitive(bsf_infoJSON, "ipDomainList"); - - OpenAPI_list_t *ip_domain_listList; + ip_domain_list = cJSON_GetObjectItemCaseSensitive(bsf_infoJSON, "ipDomainList"); if (ip_domain_list) { - cJSON *ip_domain_list_local; - if (!cJSON_IsArray(ip_domain_list)) { - ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ip_domain_list]"); - goto end; - } - ip_domain_listList = OpenAPI_list_create(); + cJSON *ip_domain_list_local = NULL; + if (!cJSON_IsArray(ip_domain_list)) { + ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ip_domain_list]"); + goto end; + } - cJSON_ArrayForEach(ip_domain_list_local, ip_domain_list) { - if (!cJSON_IsString(ip_domain_list_local)) { - ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ip_domain_list]"); - goto end; - } - OpenAPI_list_add(ip_domain_listList, ogs_strdup(ip_domain_list_local->valuestring)); - } + ip_domain_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ip_domain_list_local, ip_domain_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ip_domain_list_local)) { + ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ip_domain_list]"); + goto end; + } + OpenAPI_list_add(ip_domain_listList, ogs_strdup(ip_domain_list_local->valuestring)); + } } - cJSON *ipv4_address_ranges = cJSON_GetObjectItemCaseSensitive(bsf_infoJSON, "ipv4AddressRanges"); - - OpenAPI_list_t *ipv4_address_rangesList; + ipv4_address_ranges = cJSON_GetObjectItemCaseSensitive(bsf_infoJSON, "ipv4AddressRanges"); if (ipv4_address_ranges) { - cJSON *ipv4_address_ranges_local_nonprimitive; - if (!cJSON_IsArray(ipv4_address_ranges)){ - ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ipv4_address_ranges]"); - goto end; - } - - ipv4_address_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv4_address_ranges_local_nonprimitive, ipv4_address_ranges ) { - if (!cJSON_IsObject(ipv4_address_ranges_local_nonprimitive)) { + cJSON *ipv4_address_ranges_local = NULL; + if (!cJSON_IsArray(ipv4_address_ranges)) { ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ipv4_address_ranges]"); goto end; } - OpenAPI_ipv4_address_range_t *ipv4_address_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(ipv4_address_ranges_local_nonprimitive); - if (!ipv4_address_rangesItem) { - ogs_error("No ipv4_address_rangesItem"); - OpenAPI_list_free(ipv4_address_rangesList); - goto end; + ipv4_address_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_address_ranges_local, ipv4_address_ranges) { + if (!cJSON_IsObject(ipv4_address_ranges_local)) { + ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ipv4_address_ranges]"); + goto end; + } + OpenAPI_ipv4_address_range_t *ipv4_address_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(ipv4_address_ranges_local); + if (!ipv4_address_rangesItem) { + ogs_error("No ipv4_address_rangesItem"); + OpenAPI_list_free(ipv4_address_rangesList); + goto end; + } + OpenAPI_list_add(ipv4_address_rangesList, ipv4_address_rangesItem); } - - OpenAPI_list_add(ipv4_address_rangesList, ipv4_address_rangesItem); - } } - cJSON *ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(bsf_infoJSON, "ipv6PrefixRanges"); - - OpenAPI_list_t *ipv6_prefix_rangesList; + ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(bsf_infoJSON, "ipv6PrefixRanges"); if (ipv6_prefix_ranges) { - cJSON *ipv6_prefix_ranges_local_nonprimitive; - if (!cJSON_IsArray(ipv6_prefix_ranges)){ - ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ipv6_prefix_ranges]"); - goto end; - } - - ipv6_prefix_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv6_prefix_ranges_local_nonprimitive, ipv6_prefix_ranges ) { - if (!cJSON_IsObject(ipv6_prefix_ranges_local_nonprimitive)) { + cJSON *ipv6_prefix_ranges_local = NULL; + if (!cJSON_IsArray(ipv6_prefix_ranges)) { ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ipv6_prefix_ranges]"); goto end; } - OpenAPI_ipv6_prefix_range_t *ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(ipv6_prefix_ranges_local_nonprimitive); - if (!ipv6_prefix_rangesItem) { - ogs_error("No ipv6_prefix_rangesItem"); - OpenAPI_list_free(ipv6_prefix_rangesList); - goto end; + ipv6_prefix_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_prefix_ranges_local, ipv6_prefix_ranges) { + if (!cJSON_IsObject(ipv6_prefix_ranges_local)) { + ogs_error("OpenAPI_bsf_info_parseFromJSON() failed [ipv6_prefix_ranges]"); + goto end; + } + OpenAPI_ipv6_prefix_range_t *ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(ipv6_prefix_ranges_local); + if (!ipv6_prefix_rangesItem) { + ogs_error("No ipv6_prefix_rangesItem"); + OpenAPI_list_free(ipv6_prefix_rangesList); + goto end; + } + OpenAPI_list_add(ipv6_prefix_rangesList, ipv6_prefix_rangesItem); } - - OpenAPI_list_add(ipv6_prefix_rangesList, ipv6_prefix_rangesItem); - } } bsf_info_local_var = OpenAPI_bsf_info_create ( @@ -243,6 +248,34 @@ OpenAPI_bsf_info_t *OpenAPI_bsf_info_parseFromJSON(cJSON *bsf_infoJSON) return bsf_info_local_var; end: + if (dnn_listList) { + OpenAPI_list_for_each(dnn_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnn_listList); + dnn_listList = NULL; + } + if (ip_domain_listList) { + OpenAPI_list_for_each(ip_domain_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ip_domain_listList); + ip_domain_listList = NULL; + } + if (ipv4_address_rangesList) { + OpenAPI_list_for_each(ipv4_address_rangesList, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(ipv4_address_rangesList); + ipv4_address_rangesList = NULL; + } + if (ipv6_prefix_rangesList) { + OpenAPI_list_for_each(ipv6_prefix_rangesList, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(ipv6_prefix_rangesList); + ipv6_prefix_rangesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cag_ack_data.c b/lib/sbi/openapi/model/cag_ack_data.c index 962c8832b..3d0ed749a 100644 --- a/lib/sbi/openapi/model/cag_ack_data.c +++ b/lib/sbi/openapi/model/cag_ack_data.c @@ -20,17 +20,22 @@ OpenAPI_cag_ack_data_t *OpenAPI_cag_ack_data_create( void OpenAPI_cag_ack_data_free(OpenAPI_cag_ack_data_t *cag_ack_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cag_ack_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(cag_ack_data->provisioning_time); + if (cag_ack_data->provisioning_time) { + ogs_free(cag_ack_data->provisioning_time); + cag_ack_data->provisioning_time = NULL; + } ogs_free(cag_ack_data); } cJSON *OpenAPI_cag_ack_data_convertToJSON(OpenAPI_cag_ack_data_t *cag_ack_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cag_ack_data == NULL) { ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [CagAckData]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_cag_ack_data_convertToJSON(OpenAPI_cag_ack_data_t *cag_ack_data) } item = cJSON_CreateObject(); + if (!cag_ack_data->provisioning_time) { + ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [provisioning_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "provisioningTime", cag_ack_data->provisioning_time) == NULL) { ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [provisioning_time]"); goto end; } + if (cag_ack_data->ue_update_status == OpenAPI_ue_update_status_NULL) { + ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [ue_update_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ueUpdateStatus", OpenAPI_ue_update_status_ToString(cag_ack_data->ue_update_status)) == NULL) { ogs_error("OpenAPI_cag_ack_data_convertToJSON() failed [ue_update_status]"); goto end; @@ -55,24 +68,25 @@ end: OpenAPI_cag_ack_data_t *OpenAPI_cag_ack_data_parseFromJSON(cJSON *cag_ack_dataJSON) { OpenAPI_cag_ack_data_t *cag_ack_data_local_var = NULL; - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(cag_ack_dataJSON, "provisioningTime"); + OpenAPI_lnode_t *node = NULL; + cJSON *provisioning_time = NULL; + cJSON *ue_update_status = NULL; + OpenAPI_ue_update_status_e ue_update_statusVariable = 0; + provisioning_time = cJSON_GetObjectItemCaseSensitive(cag_ack_dataJSON, "provisioningTime"); if (!provisioning_time) { ogs_error("OpenAPI_cag_ack_data_parseFromJSON() failed [provisioning_time]"); goto end; } - - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_cag_ack_data_parseFromJSON() failed [provisioning_time]"); goto end; } - cJSON *ue_update_status = cJSON_GetObjectItemCaseSensitive(cag_ack_dataJSON, "ueUpdateStatus"); + ue_update_status = cJSON_GetObjectItemCaseSensitive(cag_ack_dataJSON, "ueUpdateStatus"); if (!ue_update_status) { ogs_error("OpenAPI_cag_ack_data_parseFromJSON() failed [ue_update_status]"); goto end; } - - OpenAPI_ue_update_status_e ue_update_statusVariable; if (!cJSON_IsString(ue_update_status)) { ogs_error("OpenAPI_cag_ack_data_parseFromJSON() failed [ue_update_status]"); goto end; diff --git a/lib/sbi/openapi/model/cag_data.c b/lib/sbi/openapi/model/cag_data.c index 6c5615589..a0be981af 100644 --- a/lib/sbi/openapi/model/cag_data.c +++ b/lib/sbi/openapi/model/cag_data.c @@ -20,24 +20,32 @@ OpenAPI_cag_data_t *OpenAPI_cag_data_create( void OpenAPI_cag_data_free(OpenAPI_cag_data_t *cag_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cag_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(cag_data->cag_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_cag_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (cag_data->cag_infos) { + OpenAPI_list_for_each(cag_data->cag_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_cag_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(cag_data->cag_infos); + cag_data->cag_infos = NULL; + } + if (cag_data->provisioning_time) { + ogs_free(cag_data->provisioning_time); + cag_data->provisioning_time = NULL; } - OpenAPI_list_free(cag_data->cag_infos); - ogs_free(cag_data->provisioning_time); ogs_free(cag_data); } cJSON *OpenAPI_cag_data_convertToJSON(OpenAPI_cag_data_t *cag_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cag_data == NULL) { ogs_error("OpenAPI_cag_data_convertToJSON() failed [CagData]"); @@ -45,26 +53,29 @@ cJSON *OpenAPI_cag_data_convertToJSON(OpenAPI_cag_data_t *cag_data) } item = cJSON_CreateObject(); + if (!cag_data->cag_infos) { + ogs_error("OpenAPI_cag_data_convertToJSON() failed [cag_infos]"); + return NULL; + } cJSON *cag_infos = cJSON_AddObjectToObject(item, "cagInfos"); if (cag_infos == NULL) { ogs_error("OpenAPI_cag_data_convertToJSON() failed [cag_infos]"); goto end; } cJSON *localMapObject = cag_infos; - OpenAPI_lnode_t *cag_infos_node; if (cag_data->cag_infos) { - OpenAPI_list_for_each(cag_data->cag_infos, cag_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)cag_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_cag_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_cag_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(cag_data->cag_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_cag_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_cag_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } + } if (cag_data->provisioning_time) { if (cJSON_AddStringToObject(item, "provisioningTime", cag_data->provisioning_time) == NULL) { @@ -80,38 +91,41 @@ end: OpenAPI_cag_data_t *OpenAPI_cag_data_parseFromJSON(cJSON *cag_dataJSON) { OpenAPI_cag_data_t *cag_data_local_var = NULL; - cJSON *cag_infos = cJSON_GetObjectItemCaseSensitive(cag_dataJSON, "cagInfos"); + OpenAPI_lnode_t *node = NULL; + cJSON *cag_infos = NULL; + OpenAPI_list_t *cag_infosList = NULL; + cJSON *provisioning_time = NULL; + cag_infos = cJSON_GetObjectItemCaseSensitive(cag_dataJSON, "cagInfos"); if (!cag_infos) { ogs_error("OpenAPI_cag_data_parseFromJSON() failed [cag_infos]"); goto end; } - - OpenAPI_list_t *cag_infosList; - cJSON *cag_infos_local_map; - if (!cJSON_IsObject(cag_infos)) { - ogs_error("OpenAPI_cag_data_parseFromJSON() failed [cag_infos]"); - goto end; - } - cag_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(cag_infos_local_map, cag_infos) { - cJSON *localMapObject = cag_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_cag_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_cag_data_parseFromJSON() failed [inner]"); + cJSON *cag_infos_local_map = NULL; + if (!cJSON_IsObject(cag_infos) && !cJSON_IsNull(cag_infos)) { + ogs_error("OpenAPI_cag_data_parseFromJSON() failed [cag_infos]"); goto end; } - OpenAPI_list_add(cag_infosList, localMapKeyPair); - } - - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(cag_dataJSON, "provisioningTime"); + if (cJSON_IsObject(cag_infos)) { + cag_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(cag_infos_local_map, cag_infos) { + cJSON *localMapObject = cag_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_cag_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_cag_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(cag_infosList, localMapKeyPair); + } + } + provisioning_time = cJSON_GetObjectItemCaseSensitive(cag_dataJSON, "provisioningTime"); if (provisioning_time) { - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_cag_data_parseFromJSON() failed [provisioning_time]"); goto end; } @@ -119,11 +133,21 @@ OpenAPI_cag_data_t *OpenAPI_cag_data_parseFromJSON(cJSON *cag_dataJSON) cag_data_local_var = OpenAPI_cag_data_create ( cag_infosList, - provisioning_time ? ogs_strdup(provisioning_time->valuestring) : NULL + provisioning_time && !cJSON_IsNull(provisioning_time) ? ogs_strdup(provisioning_time->valuestring) : NULL ); return cag_data_local_var; end: + if (cag_infosList) { + OpenAPI_list_for_each(cag_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_cag_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(cag_infosList); + cag_infosList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cag_data_1.c b/lib/sbi/openapi/model/cag_data_1.c index 089ac727c..99c1be9ab 100644 --- a/lib/sbi/openapi/model/cag_data_1.c +++ b/lib/sbi/openapi/model/cag_data_1.c @@ -20,24 +20,32 @@ OpenAPI_cag_data_1_t *OpenAPI_cag_data_1_create( void OpenAPI_cag_data_1_free(OpenAPI_cag_data_1_t *cag_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cag_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(cag_data_1->cag_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_cag_info_1_free(localKeyValue->value); - ogs_free(localKeyValue); + if (cag_data_1->cag_infos) { + OpenAPI_list_for_each(cag_data_1->cag_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_cag_info_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(cag_data_1->cag_infos); + cag_data_1->cag_infos = NULL; + } + if (cag_data_1->provisioning_time) { + ogs_free(cag_data_1->provisioning_time); + cag_data_1->provisioning_time = NULL; } - OpenAPI_list_free(cag_data_1->cag_infos); - ogs_free(cag_data_1->provisioning_time); ogs_free(cag_data_1); } cJSON *OpenAPI_cag_data_1_convertToJSON(OpenAPI_cag_data_1_t *cag_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cag_data_1 == NULL) { ogs_error("OpenAPI_cag_data_1_convertToJSON() failed [CagData_1]"); @@ -45,26 +53,29 @@ cJSON *OpenAPI_cag_data_1_convertToJSON(OpenAPI_cag_data_1_t *cag_data_1) } item = cJSON_CreateObject(); + if (!cag_data_1->cag_infos) { + ogs_error("OpenAPI_cag_data_1_convertToJSON() failed [cag_infos]"); + return NULL; + } cJSON *cag_infos = cJSON_AddObjectToObject(item, "cagInfos"); if (cag_infos == NULL) { ogs_error("OpenAPI_cag_data_1_convertToJSON() failed [cag_infos]"); goto end; } cJSON *localMapObject = cag_infos; - OpenAPI_lnode_t *cag_infos_node; if (cag_data_1->cag_infos) { - OpenAPI_list_for_each(cag_data_1->cag_infos, cag_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)cag_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_cag_info_1_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_cag_data_1_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(cag_data_1->cag_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_cag_info_1_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_cag_data_1_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } + } if (cag_data_1->provisioning_time) { if (cJSON_AddStringToObject(item, "provisioningTime", cag_data_1->provisioning_time) == NULL) { @@ -80,38 +91,41 @@ end: OpenAPI_cag_data_1_t *OpenAPI_cag_data_1_parseFromJSON(cJSON *cag_data_1JSON) { OpenAPI_cag_data_1_t *cag_data_1_local_var = NULL; - cJSON *cag_infos = cJSON_GetObjectItemCaseSensitive(cag_data_1JSON, "cagInfos"); + OpenAPI_lnode_t *node = NULL; + cJSON *cag_infos = NULL; + OpenAPI_list_t *cag_infosList = NULL; + cJSON *provisioning_time = NULL; + cag_infos = cJSON_GetObjectItemCaseSensitive(cag_data_1JSON, "cagInfos"); if (!cag_infos) { ogs_error("OpenAPI_cag_data_1_parseFromJSON() failed [cag_infos]"); goto end; } - - OpenAPI_list_t *cag_infosList; - cJSON *cag_infos_local_map; - if (!cJSON_IsObject(cag_infos)) { - ogs_error("OpenAPI_cag_data_1_parseFromJSON() failed [cag_infos]"); - goto end; - } - cag_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(cag_infos_local_map, cag_infos) { - cJSON *localMapObject = cag_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_cag_info_1_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_cag_data_1_parseFromJSON() failed [inner]"); + cJSON *cag_infos_local_map = NULL; + if (!cJSON_IsObject(cag_infos) && !cJSON_IsNull(cag_infos)) { + ogs_error("OpenAPI_cag_data_1_parseFromJSON() failed [cag_infos]"); goto end; } - OpenAPI_list_add(cag_infosList, localMapKeyPair); - } - - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(cag_data_1JSON, "provisioningTime"); + if (cJSON_IsObject(cag_infos)) { + cag_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(cag_infos_local_map, cag_infos) { + cJSON *localMapObject = cag_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_cag_info_1_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_cag_data_1_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(cag_infosList, localMapKeyPair); + } + } + provisioning_time = cJSON_GetObjectItemCaseSensitive(cag_data_1JSON, "provisioningTime"); if (provisioning_time) { - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_cag_data_1_parseFromJSON() failed [provisioning_time]"); goto end; } @@ -119,11 +133,21 @@ OpenAPI_cag_data_1_t *OpenAPI_cag_data_1_parseFromJSON(cJSON *cag_data_1JSON) cag_data_1_local_var = OpenAPI_cag_data_1_create ( cag_infosList, - provisioning_time ? ogs_strdup(provisioning_time->valuestring) : NULL + provisioning_time && !cJSON_IsNull(provisioning_time) ? ogs_strdup(provisioning_time->valuestring) : NULL ); return cag_data_1_local_var; end: + if (cag_infosList) { + OpenAPI_list_for_each(cag_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_cag_info_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(cag_infosList); + cag_infosList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cag_info.c b/lib/sbi/openapi/model/cag_info.c index f6499dd9e..c1665c784 100644 --- a/lib/sbi/openapi/model/cag_info.c +++ b/lib/sbi/openapi/model/cag_info.c @@ -22,20 +22,25 @@ OpenAPI_cag_info_t *OpenAPI_cag_info_create( void OpenAPI_cag_info_free(OpenAPI_cag_info_t *cag_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cag_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(cag_info->allowed_cag_list, node) { - ogs_free(node->data); + if (cag_info->allowed_cag_list) { + OpenAPI_list_for_each(cag_info->allowed_cag_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cag_info->allowed_cag_list); + cag_info->allowed_cag_list = NULL; } - OpenAPI_list_free(cag_info->allowed_cag_list); ogs_free(cag_info); } cJSON *OpenAPI_cag_info_convertToJSON(OpenAPI_cag_info_t *cag_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cag_info == NULL) { ogs_error("OpenAPI_cag_info_convertToJSON() failed [CagInfo]"); @@ -43,19 +48,21 @@ cJSON *OpenAPI_cag_info_convertToJSON(OpenAPI_cag_info_t *cag_info) } item = cJSON_CreateObject(); - cJSON *allowed_cag_list = cJSON_AddArrayToObject(item, "allowedCagList"); - if (allowed_cag_list == NULL) { + if (!cag_info->allowed_cag_list) { + ogs_error("OpenAPI_cag_info_convertToJSON() failed [allowed_cag_list]"); + return NULL; + } + cJSON *allowed_cag_listList = cJSON_AddArrayToObject(item, "allowedCagList"); + if (allowed_cag_listList == NULL) { ogs_error("OpenAPI_cag_info_convertToJSON() failed [allowed_cag_list]"); goto end; } - - OpenAPI_lnode_t *allowed_cag_list_node; - OpenAPI_list_for_each(cag_info->allowed_cag_list, allowed_cag_list_node) { - if (cJSON_AddStringToObject(allowed_cag_list, "", (char*)allowed_cag_list_node->data) == NULL) { - ogs_error("OpenAPI_cag_info_convertToJSON() failed [allowed_cag_list]"); - goto end; + OpenAPI_list_for_each(cag_info->allowed_cag_list, node) { + if (cJSON_AddStringToObject(allowed_cag_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_cag_info_convertToJSON() failed [allowed_cag_list]"); + goto end; + } } - } if (cag_info->is_cag_only_indicator) { if (cJSON_AddBoolToObject(item, "cagOnlyIndicator", cag_info->cag_only_indicator) == NULL) { @@ -71,30 +78,34 @@ end: OpenAPI_cag_info_t *OpenAPI_cag_info_parseFromJSON(cJSON *cag_infoJSON) { OpenAPI_cag_info_t *cag_info_local_var = NULL; - cJSON *allowed_cag_list = cJSON_GetObjectItemCaseSensitive(cag_infoJSON, "allowedCagList"); + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_cag_list = NULL; + OpenAPI_list_t *allowed_cag_listList = NULL; + cJSON *cag_only_indicator = NULL; + allowed_cag_list = cJSON_GetObjectItemCaseSensitive(cag_infoJSON, "allowedCagList"); if (!allowed_cag_list) { ogs_error("OpenAPI_cag_info_parseFromJSON() failed [allowed_cag_list]"); goto end; } + cJSON *allowed_cag_list_local = NULL; + if (!cJSON_IsArray(allowed_cag_list)) { + ogs_error("OpenAPI_cag_info_parseFromJSON() failed [allowed_cag_list]"); + goto end; + } - OpenAPI_list_t *allowed_cag_listList; - cJSON *allowed_cag_list_local; - if (!cJSON_IsArray(allowed_cag_list)) { - ogs_error("OpenAPI_cag_info_parseFromJSON() failed [allowed_cag_list]"); - goto end; - } - allowed_cag_listList = OpenAPI_list_create(); + allowed_cag_listList = OpenAPI_list_create(); - cJSON_ArrayForEach(allowed_cag_list_local, allowed_cag_list) { - if (!cJSON_IsString(allowed_cag_list_local)) { - ogs_error("OpenAPI_cag_info_parseFromJSON() failed [allowed_cag_list]"); - goto end; - } - OpenAPI_list_add(allowed_cag_listList, ogs_strdup(allowed_cag_list_local->valuestring)); - } - - cJSON *cag_only_indicator = cJSON_GetObjectItemCaseSensitive(cag_infoJSON, "cagOnlyIndicator"); + cJSON_ArrayForEach(allowed_cag_list_local, allowed_cag_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(allowed_cag_list_local)) { + ogs_error("OpenAPI_cag_info_parseFromJSON() failed [allowed_cag_list]"); + goto end; + } + OpenAPI_list_add(allowed_cag_listList, ogs_strdup(allowed_cag_list_local->valuestring)); + } + cag_only_indicator = cJSON_GetObjectItemCaseSensitive(cag_infoJSON, "cagOnlyIndicator"); if (cag_only_indicator) { if (!cJSON_IsBool(cag_only_indicator)) { ogs_error("OpenAPI_cag_info_parseFromJSON() failed [cag_only_indicator]"); @@ -110,6 +121,13 @@ OpenAPI_cag_info_t *OpenAPI_cag_info_parseFromJSON(cJSON *cag_infoJSON) return cag_info_local_var; end: + if (allowed_cag_listList) { + OpenAPI_list_for_each(allowed_cag_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(allowed_cag_listList); + allowed_cag_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cag_info_1.c b/lib/sbi/openapi/model/cag_info_1.c index c123b719e..4958f2a46 100644 --- a/lib/sbi/openapi/model/cag_info_1.c +++ b/lib/sbi/openapi/model/cag_info_1.c @@ -22,20 +22,25 @@ OpenAPI_cag_info_1_t *OpenAPI_cag_info_1_create( void OpenAPI_cag_info_1_free(OpenAPI_cag_info_1_t *cag_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cag_info_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(cag_info_1->allowed_cag_list, node) { - ogs_free(node->data); + if (cag_info_1->allowed_cag_list) { + OpenAPI_list_for_each(cag_info_1->allowed_cag_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cag_info_1->allowed_cag_list); + cag_info_1->allowed_cag_list = NULL; } - OpenAPI_list_free(cag_info_1->allowed_cag_list); ogs_free(cag_info_1); } cJSON *OpenAPI_cag_info_1_convertToJSON(OpenAPI_cag_info_1_t *cag_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cag_info_1 == NULL) { ogs_error("OpenAPI_cag_info_1_convertToJSON() failed [CagInfo_1]"); @@ -43,19 +48,21 @@ cJSON *OpenAPI_cag_info_1_convertToJSON(OpenAPI_cag_info_1_t *cag_info_1) } item = cJSON_CreateObject(); - cJSON *allowed_cag_list = cJSON_AddArrayToObject(item, "allowedCagList"); - if (allowed_cag_list == NULL) { + if (!cag_info_1->allowed_cag_list) { + ogs_error("OpenAPI_cag_info_1_convertToJSON() failed [allowed_cag_list]"); + return NULL; + } + cJSON *allowed_cag_listList = cJSON_AddArrayToObject(item, "allowedCagList"); + if (allowed_cag_listList == NULL) { ogs_error("OpenAPI_cag_info_1_convertToJSON() failed [allowed_cag_list]"); goto end; } - - OpenAPI_lnode_t *allowed_cag_list_node; - OpenAPI_list_for_each(cag_info_1->allowed_cag_list, allowed_cag_list_node) { - if (cJSON_AddStringToObject(allowed_cag_list, "", (char*)allowed_cag_list_node->data) == NULL) { - ogs_error("OpenAPI_cag_info_1_convertToJSON() failed [allowed_cag_list]"); - goto end; + OpenAPI_list_for_each(cag_info_1->allowed_cag_list, node) { + if (cJSON_AddStringToObject(allowed_cag_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_cag_info_1_convertToJSON() failed [allowed_cag_list]"); + goto end; + } } - } if (cag_info_1->is_cag_only_indicator) { if (cJSON_AddBoolToObject(item, "cagOnlyIndicator", cag_info_1->cag_only_indicator) == NULL) { @@ -71,30 +78,34 @@ end: OpenAPI_cag_info_1_t *OpenAPI_cag_info_1_parseFromJSON(cJSON *cag_info_1JSON) { OpenAPI_cag_info_1_t *cag_info_1_local_var = NULL; - cJSON *allowed_cag_list = cJSON_GetObjectItemCaseSensitive(cag_info_1JSON, "allowedCagList"); + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_cag_list = NULL; + OpenAPI_list_t *allowed_cag_listList = NULL; + cJSON *cag_only_indicator = NULL; + allowed_cag_list = cJSON_GetObjectItemCaseSensitive(cag_info_1JSON, "allowedCagList"); if (!allowed_cag_list) { ogs_error("OpenAPI_cag_info_1_parseFromJSON() failed [allowed_cag_list]"); goto end; } + cJSON *allowed_cag_list_local = NULL; + if (!cJSON_IsArray(allowed_cag_list)) { + ogs_error("OpenAPI_cag_info_1_parseFromJSON() failed [allowed_cag_list]"); + goto end; + } - OpenAPI_list_t *allowed_cag_listList; - cJSON *allowed_cag_list_local; - if (!cJSON_IsArray(allowed_cag_list)) { - ogs_error("OpenAPI_cag_info_1_parseFromJSON() failed [allowed_cag_list]"); - goto end; - } - allowed_cag_listList = OpenAPI_list_create(); + allowed_cag_listList = OpenAPI_list_create(); - cJSON_ArrayForEach(allowed_cag_list_local, allowed_cag_list) { - if (!cJSON_IsString(allowed_cag_list_local)) { - ogs_error("OpenAPI_cag_info_1_parseFromJSON() failed [allowed_cag_list]"); - goto end; - } - OpenAPI_list_add(allowed_cag_listList, ogs_strdup(allowed_cag_list_local->valuestring)); - } - - cJSON *cag_only_indicator = cJSON_GetObjectItemCaseSensitive(cag_info_1JSON, "cagOnlyIndicator"); + cJSON_ArrayForEach(allowed_cag_list_local, allowed_cag_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(allowed_cag_list_local)) { + ogs_error("OpenAPI_cag_info_1_parseFromJSON() failed [allowed_cag_list]"); + goto end; + } + OpenAPI_list_add(allowed_cag_listList, ogs_strdup(allowed_cag_list_local->valuestring)); + } + cag_only_indicator = cJSON_GetObjectItemCaseSensitive(cag_info_1JSON, "cagOnlyIndicator"); if (cag_only_indicator) { if (!cJSON_IsBool(cag_only_indicator)) { ogs_error("OpenAPI_cag_info_1_parseFromJSON() failed [cag_only_indicator]"); @@ -110,6 +121,13 @@ OpenAPI_cag_info_1_t *OpenAPI_cag_info_1_parseFromJSON(cJSON *cag_info_1JSON) return cag_info_1_local_var; end: + if (allowed_cag_listList) { + OpenAPI_list_for_each(allowed_cag_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(allowed_cag_listList); + allowed_cag_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cancel_relocate_ue_context_request.c b/lib/sbi/openapi/model/cancel_relocate_ue_context_request.c new file mode 100644 index 000000000..5cfe1679a --- /dev/null +++ b/lib/sbi/openapi/model/cancel_relocate_ue_context_request.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "cancel_relocate_ue_context_request.h" + +OpenAPI_cancel_relocate_ue_context_request_t *OpenAPI_cancel_relocate_ue_context_request_create( + OpenAPI_ue_context_cancel_relocate_data_t *json_data, + OpenAPI_binary_t* binary_data_gtpc_message +) +{ + OpenAPI_cancel_relocate_ue_context_request_t *cancel_relocate_ue_context_request_local_var = ogs_malloc(sizeof(OpenAPI_cancel_relocate_ue_context_request_t)); + ogs_assert(cancel_relocate_ue_context_request_local_var); + + cancel_relocate_ue_context_request_local_var->json_data = json_data; + cancel_relocate_ue_context_request_local_var->binary_data_gtpc_message = binary_data_gtpc_message; + + return cancel_relocate_ue_context_request_local_var; +} + +void OpenAPI_cancel_relocate_ue_context_request_free(OpenAPI_cancel_relocate_ue_context_request_t *cancel_relocate_ue_context_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == cancel_relocate_ue_context_request) { + return; + } + if (cancel_relocate_ue_context_request->json_data) { + OpenAPI_ue_context_cancel_relocate_data_free(cancel_relocate_ue_context_request->json_data); + cancel_relocate_ue_context_request->json_data = NULL; + } + if (cancel_relocate_ue_context_request->binary_data_gtpc_message) { + ogs_free(cancel_relocate_ue_context_request->binary_data_gtpc_message->data); + cancel_relocate_ue_context_request->binary_data_gtpc_message = NULL; + } + ogs_free(cancel_relocate_ue_context_request); +} + +cJSON *OpenAPI_cancel_relocate_ue_context_request_convertToJSON(OpenAPI_cancel_relocate_ue_context_request_t *cancel_relocate_ue_context_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (cancel_relocate_ue_context_request == NULL) { + ogs_error("OpenAPI_cancel_relocate_ue_context_request_convertToJSON() failed [CancelRelocateUEContext_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (cancel_relocate_ue_context_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_ue_context_cancel_relocate_data_convertToJSON(cancel_relocate_ue_context_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_cancel_relocate_ue_context_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_cancel_relocate_ue_context_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (cancel_relocate_ue_context_request->binary_data_gtpc_message) { + char* encoded_str_binary_data_gtpc_message = OpenAPI_base64encode(cancel_relocate_ue_context_request->binary_data_gtpc_message->data,cancel_relocate_ue_context_request->binary_data_gtpc_message->len); + if (cJSON_AddStringToObject(item, "binaryDataGtpcMessage", encoded_str_binary_data_gtpc_message) == NULL) { + ogs_error("OpenAPI_cancel_relocate_ue_context_request_convertToJSON() failed [binary_data_gtpc_message]"); + goto end; + } + ogs_free(encoded_str_binary_data_gtpc_message); + } + +end: + return item; +} + +OpenAPI_cancel_relocate_ue_context_request_t *OpenAPI_cancel_relocate_ue_context_request_parseFromJSON(cJSON *cancel_relocate_ue_context_requestJSON) +{ + OpenAPI_cancel_relocate_ue_context_request_t *cancel_relocate_ue_context_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_ue_context_cancel_relocate_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_gtpc_message = NULL; + OpenAPI_binary_t *decoded_str_binary_data_gtpc_message = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(cancel_relocate_ue_context_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_ue_context_cancel_relocate_data_parseFromJSON(json_data); + } + + binary_data_gtpc_message = cJSON_GetObjectItemCaseSensitive(cancel_relocate_ue_context_requestJSON, "binaryDataGtpcMessage"); + if (binary_data_gtpc_message) { + decoded_str_binary_data_gtpc_message = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_gtpc_message); + if (!cJSON_IsString(binary_data_gtpc_message)) { + ogs_error("OpenAPI_cancel_relocate_ue_context_request_parseFromJSON() failed [binary_data_gtpc_message]"); + goto end; + } + decoded_str_binary_data_gtpc_message->data = OpenAPI_base64decode(binary_data_gtpc_message->valuestring, strlen(binary_data_gtpc_message->valuestring), &decoded_str_binary_data_gtpc_message->len); + if (!decoded_str_binary_data_gtpc_message->data) { + ogs_error("OpenAPI_cancel_relocate_ue_context_request_parseFromJSON() failed [binary_data_gtpc_message]"); + goto end; + } + } + + cancel_relocate_ue_context_request_local_var = OpenAPI_cancel_relocate_ue_context_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_gtpc_message ? decoded_str_binary_data_gtpc_message : NULL + ); + + return cancel_relocate_ue_context_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_ue_context_cancel_relocate_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_cancel_relocate_ue_context_request_t *OpenAPI_cancel_relocate_ue_context_request_copy(OpenAPI_cancel_relocate_ue_context_request_t *dst, OpenAPI_cancel_relocate_ue_context_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_cancel_relocate_ue_context_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_cancel_relocate_ue_context_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_cancel_relocate_ue_context_request_free(dst); + dst = OpenAPI_cancel_relocate_ue_context_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/cancel_relocate_ue_context_request.h b/lib/sbi/openapi/model/cancel_relocate_ue_context_request.h new file mode 100644 index 000000000..7791193c7 --- /dev/null +++ b/lib/sbi/openapi/model/cancel_relocate_ue_context_request.h @@ -0,0 +1,41 @@ +/* + * cancel_relocate_ue_context_request.h + * + * + */ + +#ifndef _OpenAPI_cancel_relocate_ue_context_request_H_ +#define _OpenAPI_cancel_relocate_ue_context_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_context_cancel_relocate_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_cancel_relocate_ue_context_request_s OpenAPI_cancel_relocate_ue_context_request_t; +typedef struct OpenAPI_cancel_relocate_ue_context_request_s { + struct OpenAPI_ue_context_cancel_relocate_data_s *json_data; + OpenAPI_binary_t* binary_data_gtpc_message; +} OpenAPI_cancel_relocate_ue_context_request_t; + +OpenAPI_cancel_relocate_ue_context_request_t *OpenAPI_cancel_relocate_ue_context_request_create( + OpenAPI_ue_context_cancel_relocate_data_t *json_data, + OpenAPI_binary_t* binary_data_gtpc_message +); +void OpenAPI_cancel_relocate_ue_context_request_free(OpenAPI_cancel_relocate_ue_context_request_t *cancel_relocate_ue_context_request); +OpenAPI_cancel_relocate_ue_context_request_t *OpenAPI_cancel_relocate_ue_context_request_parseFromJSON(cJSON *cancel_relocate_ue_context_requestJSON); +cJSON *OpenAPI_cancel_relocate_ue_context_request_convertToJSON(OpenAPI_cancel_relocate_ue_context_request_t *cancel_relocate_ue_context_request); +OpenAPI_cancel_relocate_ue_context_request_t *OpenAPI_cancel_relocate_ue_context_request_copy(OpenAPI_cancel_relocate_ue_context_request_t *dst, OpenAPI_cancel_relocate_ue_context_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_cancel_relocate_ue_context_request_H_ */ + diff --git a/lib/sbi/openapi/model/candidate_for_replacement.c b/lib/sbi/openapi/model/candidate_for_replacement.c index b537003bd..22ee3d7dd 100644 --- a/lib/sbi/openapi/model/candidate_for_replacement.c +++ b/lib/sbi/openapi/model/candidate_for_replacement.c @@ -20,21 +20,29 @@ OpenAPI_candidate_for_replacement_t *OpenAPI_candidate_for_replacement_create( void OpenAPI_candidate_for_replacement_free(OpenAPI_candidate_for_replacement_t *candidate_for_replacement) { + OpenAPI_lnode_t *node = NULL; + if (NULL == candidate_for_replacement) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(candidate_for_replacement->snssai); - OpenAPI_list_for_each(candidate_for_replacement->dnns, node) { - ogs_free(node->data); + if (candidate_for_replacement->snssai) { + OpenAPI_snssai_free(candidate_for_replacement->snssai); + candidate_for_replacement->snssai = NULL; + } + if (candidate_for_replacement->dnns) { + OpenAPI_list_for_each(candidate_for_replacement->dnns, node) { + ogs_free(node->data); + } + OpenAPI_list_free(candidate_for_replacement->dnns); + candidate_for_replacement->dnns = NULL; } - OpenAPI_list_free(candidate_for_replacement->dnns); ogs_free(candidate_for_replacement); } cJSON *OpenAPI_candidate_for_replacement_convertToJSON(OpenAPI_candidate_for_replacement_t *candidate_for_replacement) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (candidate_for_replacement == NULL) { ogs_error("OpenAPI_candidate_for_replacement_convertToJSON() failed [CandidateForReplacement]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_candidate_for_replacement_convertToJSON(OpenAPI_candidate_for_rep } item = cJSON_CreateObject(); + if (!candidate_for_replacement->snssai) { + ogs_error("OpenAPI_candidate_for_replacement_convertToJSON() failed [snssai]"); + return NULL; + } cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(candidate_for_replacement->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_candidate_for_replacement_convertToJSON() failed [snssai]"); @@ -54,19 +66,17 @@ cJSON *OpenAPI_candidate_for_replacement_convertToJSON(OpenAPI_candidate_for_rep } if (candidate_for_replacement->dnns) { - cJSON *dnns = cJSON_AddArrayToObject(item, "dnns"); - if (dnns == NULL) { + cJSON *dnnsList = cJSON_AddArrayToObject(item, "dnns"); + if (dnnsList == NULL) { ogs_error("OpenAPI_candidate_for_replacement_convertToJSON() failed [dnns]"); goto end; } - - OpenAPI_lnode_t *dnns_node; - OpenAPI_list_for_each(candidate_for_replacement->dnns, dnns_node) { - if (cJSON_AddStringToObject(dnns, "", (char*)dnns_node->data) == NULL) { - ogs_error("OpenAPI_candidate_for_replacement_convertToJSON() failed [dnns]"); - goto end; + OpenAPI_list_for_each(candidate_for_replacement->dnns, node) { + if (cJSON_AddStringToObject(dnnsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_candidate_for_replacement_convertToJSON() failed [dnns]"); + goto end; + } } - } } end: @@ -76,33 +86,37 @@ end: OpenAPI_candidate_for_replacement_t *OpenAPI_candidate_for_replacement_parseFromJSON(cJSON *candidate_for_replacementJSON) { OpenAPI_candidate_for_replacement_t *candidate_for_replacement_local_var = NULL; - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(candidate_for_replacementJSON, "snssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *dnns = NULL; + OpenAPI_list_t *dnnsList = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(candidate_for_replacementJSON, "snssai"); if (!snssai) { ogs_error("OpenAPI_candidate_for_replacement_parseFromJSON() failed [snssai]"); goto end; } - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); - cJSON *dnns = cJSON_GetObjectItemCaseSensitive(candidate_for_replacementJSON, "dnns"); - - OpenAPI_list_t *dnnsList; + dnns = cJSON_GetObjectItemCaseSensitive(candidate_for_replacementJSON, "dnns"); if (dnns) { - cJSON *dnns_local; - if (!cJSON_IsArray(dnns)) { - ogs_error("OpenAPI_candidate_for_replacement_parseFromJSON() failed [dnns]"); - goto end; - } - dnnsList = OpenAPI_list_create(); + cJSON *dnns_local = NULL; + if (!cJSON_IsArray(dnns)) { + ogs_error("OpenAPI_candidate_for_replacement_parseFromJSON() failed [dnns]"); + goto end; + } - cJSON_ArrayForEach(dnns_local, dnns) { - if (!cJSON_IsString(dnns_local)) { - ogs_error("OpenAPI_candidate_for_replacement_parseFromJSON() failed [dnns]"); - goto end; - } - OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); - } + dnnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnns_local, dnns) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnns_local)) { + ogs_error("OpenAPI_candidate_for_replacement_parseFromJSON() failed [dnns]"); + goto end; + } + OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); + } } candidate_for_replacement_local_var = OpenAPI_candidate_for_replacement_create ( @@ -112,6 +126,17 @@ OpenAPI_candidate_for_replacement_t *OpenAPI_candidate_for_replacement_parseFrom return candidate_for_replacement_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (dnnsList) { + OpenAPI_list_for_each(dnnsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnnsList); + dnnsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cause.c b/lib/sbi/openapi/model/cause.c index 9d5606f5c..bfcd13c74 100644 --- a/lib/sbi/openapi/model/cause.c +++ b/lib/sbi/openapi/model/cause.c @@ -6,7 +6,7 @@ char* OpenAPI_cause_ToString(OpenAPI_cause_e cause) { - const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "_5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS", "REL_DUE_TO_CP_ONLY_NOT_APPLICABLE", "NOT_SUPPORTED_WITH_ISMF", "CHANGED_ANCHOR_SMF", "CHANGED_INTERMEDIATE_SMF" }; + const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS", "REL_DUE_TO_CP_ONLY_NOT_APPLICABLE", "NOT_SUPPORTED_WITH_ISMF", "CHANGED_ANCHOR_SMF", "CHANGED_INTERMEDIATE_SMF" }; size_t sizeofArray = sizeof(causeArray) / sizeof(causeArray[0]); if (cause < sizeofArray) return (char *)causeArray[cause]; @@ -17,7 +17,7 @@ char* OpenAPI_cause_ToString(OpenAPI_cause_e cause) OpenAPI_cause_e OpenAPI_cause_FromString(char* cause) { int stringToReturn = 0; - const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "_5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS", "REL_DUE_TO_CP_ONLY_NOT_APPLICABLE", "NOT_SUPPORTED_WITH_ISMF", "CHANGED_ANCHOR_SMF", "CHANGED_INTERMEDIATE_SMF" }; + const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS", "REL_DUE_TO_CP_ONLY_NOT_APPLICABLE", "NOT_SUPPORTED_WITH_ISMF", "CHANGED_ANCHOR_SMF", "CHANGED_INTERMEDIATE_SMF" }; size_t sizeofArray = sizeof(causeArray) / sizeof(causeArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(cause, causeArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/ce_mode_b_ind.c b/lib/sbi/openapi/model/ce_mode_b_ind.c index 13334969b..a82aedb79 100644 --- a/lib/sbi/openapi/model/ce_mode_b_ind.c +++ b/lib/sbi/openapi/model/ce_mode_b_ind.c @@ -18,16 +18,18 @@ OpenAPI_ce_mode_b_ind_t *OpenAPI_ce_mode_b_ind_create( void OpenAPI_ce_mode_b_ind_free(OpenAPI_ce_mode_b_ind_t *ce_mode_b_ind) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ce_mode_b_ind) { return; } - OpenAPI_lnode_t *node; ogs_free(ce_mode_b_ind); } cJSON *OpenAPI_ce_mode_b_ind_convertToJSON(OpenAPI_ce_mode_b_ind_t *ce_mode_b_ind) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ce_mode_b_ind == NULL) { ogs_error("OpenAPI_ce_mode_b_ind_convertToJSON() failed [CeModeBInd]"); @@ -47,12 +49,13 @@ end: OpenAPI_ce_mode_b_ind_t *OpenAPI_ce_mode_b_ind_parseFromJSON(cJSON *ce_mode_b_indJSON) { OpenAPI_ce_mode_b_ind_t *ce_mode_b_ind_local_var = NULL; - cJSON *ce_mode_b_support_ind = cJSON_GetObjectItemCaseSensitive(ce_mode_b_indJSON, "ceModeBSupportInd"); + OpenAPI_lnode_t *node = NULL; + cJSON *ce_mode_b_support_ind = NULL; + ce_mode_b_support_ind = cJSON_GetObjectItemCaseSensitive(ce_mode_b_indJSON, "ceModeBSupportInd"); if (!ce_mode_b_support_ind) { ogs_error("OpenAPI_ce_mode_b_ind_parseFromJSON() failed [ce_mode_b_support_ind]"); goto end; } - if (!cJSON_IsBool(ce_mode_b_support_ind)) { ogs_error("OpenAPI_ce_mode_b_ind_parseFromJSON() failed [ce_mode_b_support_ind]"); goto end; diff --git a/lib/sbi/openapi/model/change_item.c b/lib/sbi/openapi/model/change_item.c index 512b1ed3e..0ff5db45d 100644 --- a/lib/sbi/openapi/model/change_item.c +++ b/lib/sbi/openapi/model/change_item.c @@ -26,20 +26,34 @@ OpenAPI_change_item_t *OpenAPI_change_item_create( void OpenAPI_change_item_free(OpenAPI_change_item_t *change_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == change_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(change_item->path); - ogs_free(change_item->from); - OpenAPI_any_type_free(change_item->orig_value); - OpenAPI_any_type_free(change_item->new_value); + if (change_item->path) { + ogs_free(change_item->path); + change_item->path = NULL; + } + if (change_item->from) { + ogs_free(change_item->from); + change_item->from = NULL; + } + if (change_item->orig_value) { + OpenAPI_any_type_free(change_item->orig_value); + change_item->orig_value = NULL; + } + if (change_item->new_value) { + OpenAPI_any_type_free(change_item->new_value); + change_item->new_value = NULL; + } ogs_free(change_item); } cJSON *OpenAPI_change_item_convertToJSON(OpenAPI_change_item_t *change_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (change_item == NULL) { ogs_error("OpenAPI_change_item_convertToJSON() failed [ChangeItem]"); @@ -47,11 +61,19 @@ cJSON *OpenAPI_change_item_convertToJSON(OpenAPI_change_item_t *change_item) } item = cJSON_CreateObject(); + if (change_item->op == OpenAPI_change_type_NULL) { + ogs_error("OpenAPI_change_item_convertToJSON() failed [op]"); + return NULL; + } if (cJSON_AddStringToObject(item, "op", OpenAPI_change_type_ToString(change_item->op)) == NULL) { ogs_error("OpenAPI_change_item_convertToJSON() failed [op]"); goto end; } + if (!change_item->path) { + ogs_error("OpenAPI_change_item_convertToJSON() failed [path]"); + return NULL; + } if (cJSON_AddStringToObject(item, "path", change_item->path) == NULL) { ogs_error("OpenAPI_change_item_convertToJSON() failed [path]"); goto end; @@ -97,49 +119,50 @@ end: OpenAPI_change_item_t *OpenAPI_change_item_parseFromJSON(cJSON *change_itemJSON) { OpenAPI_change_item_t *change_item_local_var = NULL; - cJSON *op = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "op"); + OpenAPI_lnode_t *node = NULL; + cJSON *op = NULL; + OpenAPI_change_type_e opVariable = 0; + cJSON *path = NULL; + cJSON *from = NULL; + cJSON *orig_value = NULL; + OpenAPI_any_type_t *orig_value_local_object = NULL; + cJSON *new_value = NULL; + OpenAPI_any_type_t *new_value_local_object = NULL; + op = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "op"); if (!op) { ogs_error("OpenAPI_change_item_parseFromJSON() failed [op]"); goto end; } - - OpenAPI_change_type_e opVariable; if (!cJSON_IsString(op)) { ogs_error("OpenAPI_change_item_parseFromJSON() failed [op]"); goto end; } opVariable = OpenAPI_change_type_FromString(op->valuestring); - cJSON *path = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "path"); + path = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "path"); if (!path) { ogs_error("OpenAPI_change_item_parseFromJSON() failed [path]"); goto end; } - if (!cJSON_IsString(path)) { ogs_error("OpenAPI_change_item_parseFromJSON() failed [path]"); goto end; } - cJSON *from = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "from"); - + from = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "from"); if (from) { - if (!cJSON_IsString(from)) { + if (!cJSON_IsString(from) && !cJSON_IsNull(from)) { ogs_error("OpenAPI_change_item_parseFromJSON() failed [from]"); goto end; } } - cJSON *orig_value = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "origValue"); - - OpenAPI_any_type_t *orig_value_local_object = NULL; + orig_value = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "origValue"); if (orig_value) { orig_value_local_object = OpenAPI_any_type_parseFromJSON(orig_value); } - cJSON *new_value = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "newValue"); - - OpenAPI_any_type_t *new_value_local_object = NULL; + new_value = cJSON_GetObjectItemCaseSensitive(change_itemJSON, "newValue"); if (new_value) { new_value_local_object = OpenAPI_any_type_parseFromJSON(new_value); } @@ -147,13 +170,21 @@ OpenAPI_change_item_t *OpenAPI_change_item_parseFromJSON(cJSON *change_itemJSON) change_item_local_var = OpenAPI_change_item_create ( opVariable, ogs_strdup(path->valuestring), - from ? ogs_strdup(from->valuestring) : NULL, + from && !cJSON_IsNull(from) ? ogs_strdup(from->valuestring) : NULL, orig_value ? orig_value_local_object : NULL, new_value ? new_value_local_object : NULL ); return change_item_local_var; end: + if (orig_value_local_object) { + OpenAPI_any_type_free(orig_value_local_object); + orig_value_local_object = NULL; + } + if (new_value_local_object) { + OpenAPI_any_type_free(new_value_local_object); + new_value_local_object = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/change_type.c b/lib/sbi/openapi/model/change_type.c index 96fc9a99e..871501252 100644 --- a/lib/sbi/openapi/model/change_type.c +++ b/lib/sbi/openapi/model/change_type.c @@ -6,7 +6,7 @@ char* OpenAPI_change_type_ToString(OpenAPI_change_type_e change_type) { - const char *change_typeArray[] = { "NULL", "ADD", "MOVE", "_REMOVE", "REPLACE" }; + const char *change_typeArray[] = { "NULL", "ADD", "MOVE", "REMOVE", "REPLACE" }; size_t sizeofArray = sizeof(change_typeArray) / sizeof(change_typeArray[0]); if (change_type < sizeofArray) return (char *)change_typeArray[change_type]; @@ -17,7 +17,7 @@ char* OpenAPI_change_type_ToString(OpenAPI_change_type_e change_type) OpenAPI_change_type_e OpenAPI_change_type_FromString(char* change_type) { int stringToReturn = 0; - const char *change_typeArray[] = { "NULL", "ADD", "MOVE", "_REMOVE", "REPLACE" }; + const char *change_typeArray[] = { "NULL", "ADD", "MOVE", "REMOVE", "REPLACE" }; size_t sizeofArray = sizeof(change_typeArray) / sizeof(change_typeArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(change_type, change_typeArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/charging_data.c b/lib/sbi/openapi/model/charging_data.c index f1d0ac23f..99399db66 100644 --- a/lib/sbi/openapi/model/charging_data.c +++ b/lib/sbi/openapi/model/charging_data.c @@ -52,20 +52,34 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_create( void OpenAPI_charging_data_free(OpenAPI_charging_data_t *charging_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == charging_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(charging_data->chg_id); - ogs_free(charging_data->sponsor_id); - ogs_free(charging_data->app_svc_prov_id); - ogs_free(charging_data->af_charg_id); + if (charging_data->chg_id) { + ogs_free(charging_data->chg_id); + charging_data->chg_id = NULL; + } + if (charging_data->sponsor_id) { + ogs_free(charging_data->sponsor_id); + charging_data->sponsor_id = NULL; + } + if (charging_data->app_svc_prov_id) { + ogs_free(charging_data->app_svc_prov_id); + charging_data->app_svc_prov_id = NULL; + } + if (charging_data->af_charg_id) { + ogs_free(charging_data->af_charg_id); + charging_data->af_charg_id = NULL; + } ogs_free(charging_data); } cJSON *OpenAPI_charging_data_convertToJSON(OpenAPI_charging_data_t *charging_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (charging_data == NULL) { ogs_error("OpenAPI_charging_data_convertToJSON() failed [ChargingData]"); @@ -73,12 +87,16 @@ cJSON *OpenAPI_charging_data_convertToJSON(OpenAPI_charging_data_t *charging_dat } item = cJSON_CreateObject(); + if (!charging_data->chg_id) { + ogs_error("OpenAPI_charging_data_convertToJSON() failed [chg_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "chgId", charging_data->chg_id) == NULL) { ogs_error("OpenAPI_charging_data_convertToJSON() failed [chg_id]"); goto end; } - if (charging_data->metering_method) { + if (charging_data->metering_method != OpenAPI_metering_method_NULL) { if (cJSON_AddStringToObject(item, "meteringMethod", OpenAPI_metering_method_ToString(charging_data->metering_method)) == NULL) { ogs_error("OpenAPI_charging_data_convertToJSON() failed [metering_method]"); goto end; @@ -113,7 +131,7 @@ cJSON *OpenAPI_charging_data_convertToJSON(OpenAPI_charging_data_t *charging_dat } } - if (charging_data->reporting_level) { + if (charging_data->reporting_level != OpenAPI_reporting_level_NULL) { if (cJSON_AddStringToObject(item, "reportingLevel", OpenAPI_reporting_level_ToString(charging_data->reporting_level)) == NULL) { ogs_error("OpenAPI_charging_data_convertToJSON() failed [reporting_level]"); goto end; @@ -162,20 +180,32 @@ end: OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dataJSON) { OpenAPI_charging_data_t *charging_data_local_var = NULL; - cJSON *chg_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "chgId"); + OpenAPI_lnode_t *node = NULL; + cJSON *chg_id = NULL; + cJSON *metering_method = NULL; + OpenAPI_metering_method_e metering_methodVariable = 0; + cJSON *offline = NULL; + cJSON *online = NULL; + cJSON *sdf_handl = NULL; + cJSON *rating_group = NULL; + cJSON *reporting_level = NULL; + OpenAPI_reporting_level_e reporting_levelVariable = 0; + cJSON *service_id = NULL; + cJSON *sponsor_id = NULL; + cJSON *app_svc_prov_id = NULL; + cJSON *af_charging_identifier = NULL; + cJSON *af_charg_id = NULL; + chg_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "chgId"); if (!chg_id) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [chg_id]"); goto end; } - if (!cJSON_IsString(chg_id)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [chg_id]"); goto end; } - cJSON *metering_method = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "meteringMethod"); - - OpenAPI_metering_method_e metering_methodVariable; + metering_method = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "meteringMethod"); if (metering_method) { if (!cJSON_IsString(metering_method)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [metering_method]"); @@ -184,8 +214,7 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat metering_methodVariable = OpenAPI_metering_method_FromString(metering_method->valuestring); } - cJSON *offline = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "offline"); - + offline = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "offline"); if (offline) { if (!cJSON_IsBool(offline)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [offline]"); @@ -193,8 +222,7 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat } } - cJSON *online = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "online"); - + online = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "online"); if (online) { if (!cJSON_IsBool(online)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [online]"); @@ -202,8 +230,7 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat } } - cJSON *sdf_handl = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "sdfHandl"); - + sdf_handl = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "sdfHandl"); if (sdf_handl) { if (!cJSON_IsBool(sdf_handl)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [sdf_handl]"); @@ -211,8 +238,7 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat } } - cJSON *rating_group = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "ratingGroup"); - + rating_group = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "ratingGroup"); if (rating_group) { if (!cJSON_IsNumber(rating_group)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [rating_group]"); @@ -220,9 +246,7 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat } } - cJSON *reporting_level = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "reportingLevel"); - - OpenAPI_reporting_level_e reporting_levelVariable; + reporting_level = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "reportingLevel"); if (reporting_level) { if (!cJSON_IsString(reporting_level)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [reporting_level]"); @@ -231,8 +255,7 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat reporting_levelVariable = OpenAPI_reporting_level_FromString(reporting_level->valuestring); } - cJSON *service_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "serviceId"); - + service_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "serviceId"); if (service_id) { if (!cJSON_IsNumber(service_id)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [service_id]"); @@ -240,26 +263,23 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat } } - cJSON *sponsor_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "sponsorId"); - + sponsor_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "sponsorId"); if (sponsor_id) { - if (!cJSON_IsString(sponsor_id)) { + if (!cJSON_IsString(sponsor_id) && !cJSON_IsNull(sponsor_id)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [sponsor_id]"); goto end; } } - cJSON *app_svc_prov_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "appSvcProvId"); - + app_svc_prov_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "appSvcProvId"); if (app_svc_prov_id) { - if (!cJSON_IsString(app_svc_prov_id)) { + if (!cJSON_IsString(app_svc_prov_id) && !cJSON_IsNull(app_svc_prov_id)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [app_svc_prov_id]"); goto end; } } - cJSON *af_charging_identifier = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "afChargingIdentifier"); - + af_charging_identifier = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "afChargingIdentifier"); if (af_charging_identifier) { if (!cJSON_IsNumber(af_charging_identifier)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [af_charging_identifier]"); @@ -267,10 +287,9 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat } } - cJSON *af_charg_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "afChargId"); - + af_charg_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "afChargId"); if (af_charg_id) { - if (!cJSON_IsString(af_charg_id)) { + if (!cJSON_IsString(af_charg_id) && !cJSON_IsNull(af_charg_id)) { ogs_error("OpenAPI_charging_data_parseFromJSON() failed [af_charg_id]"); goto end; } @@ -290,11 +309,11 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat reporting_level ? reporting_levelVariable : 0, service_id ? true : false, service_id ? service_id->valuedouble : 0, - sponsor_id ? ogs_strdup(sponsor_id->valuestring) : NULL, - app_svc_prov_id ? ogs_strdup(app_svc_prov_id->valuestring) : NULL, + sponsor_id && !cJSON_IsNull(sponsor_id) ? ogs_strdup(sponsor_id->valuestring) : NULL, + app_svc_prov_id && !cJSON_IsNull(app_svc_prov_id) ? ogs_strdup(app_svc_prov_id->valuestring) : NULL, af_charging_identifier ? true : false, af_charging_identifier ? af_charging_identifier->valuedouble : 0, - af_charg_id ? ogs_strdup(af_charg_id->valuestring) : NULL + af_charg_id && !cJSON_IsNull(af_charg_id) ? ogs_strdup(af_charg_id->valuestring) : NULL ); return charging_data_local_var; diff --git a/lib/sbi/openapi/model/charging_information.c b/lib/sbi/openapi/model/charging_information.c index f4eb604a5..a06b6d3bd 100644 --- a/lib/sbi/openapi/model/charging_information.c +++ b/lib/sbi/openapi/model/charging_information.c @@ -28,22 +28,42 @@ OpenAPI_charging_information_t *OpenAPI_charging_information_create( void OpenAPI_charging_information_free(OpenAPI_charging_information_t *charging_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == charging_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(charging_information->primary_chf_address); - ogs_free(charging_information->secondary_chf_address); - ogs_free(charging_information->primary_chf_set_id); - ogs_free(charging_information->primary_chf_instance_id); - ogs_free(charging_information->secondary_chf_set_id); - ogs_free(charging_information->secondary_chf_instance_id); + if (charging_information->primary_chf_address) { + ogs_free(charging_information->primary_chf_address); + charging_information->primary_chf_address = NULL; + } + if (charging_information->secondary_chf_address) { + ogs_free(charging_information->secondary_chf_address); + charging_information->secondary_chf_address = NULL; + } + if (charging_information->primary_chf_set_id) { + ogs_free(charging_information->primary_chf_set_id); + charging_information->primary_chf_set_id = NULL; + } + if (charging_information->primary_chf_instance_id) { + ogs_free(charging_information->primary_chf_instance_id); + charging_information->primary_chf_instance_id = NULL; + } + if (charging_information->secondary_chf_set_id) { + ogs_free(charging_information->secondary_chf_set_id); + charging_information->secondary_chf_set_id = NULL; + } + if (charging_information->secondary_chf_instance_id) { + ogs_free(charging_information->secondary_chf_instance_id); + charging_information->secondary_chf_instance_id = NULL; + } ogs_free(charging_information); } cJSON *OpenAPI_charging_information_convertToJSON(OpenAPI_charging_information_t *charging_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (charging_information == NULL) { ogs_error("OpenAPI_charging_information_convertToJSON() failed [ChargingInformation]"); @@ -51,11 +71,19 @@ cJSON *OpenAPI_charging_information_convertToJSON(OpenAPI_charging_information_t } item = cJSON_CreateObject(); + if (!charging_information->primary_chf_address) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [primary_chf_address]"); + return NULL; + } if (cJSON_AddStringToObject(item, "primaryChfAddress", charging_information->primary_chf_address) == NULL) { ogs_error("OpenAPI_charging_information_convertToJSON() failed [primary_chf_address]"); goto end; } + if (!charging_information->secondary_chf_address) { + ogs_error("OpenAPI_charging_information_convertToJSON() failed [secondary_chf_address]"); + return NULL; + } if (cJSON_AddStringToObject(item, "secondaryChfAddress", charging_information->secondary_chf_address) == NULL) { ogs_error("OpenAPI_charging_information_convertToJSON() failed [secondary_chf_address]"); goto end; @@ -96,59 +124,60 @@ end: OpenAPI_charging_information_t *OpenAPI_charging_information_parseFromJSON(cJSON *charging_informationJSON) { OpenAPI_charging_information_t *charging_information_local_var = NULL; - cJSON *primary_chf_address = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfAddress"); + OpenAPI_lnode_t *node = NULL; + cJSON *primary_chf_address = NULL; + cJSON *secondary_chf_address = NULL; + cJSON *primary_chf_set_id = NULL; + cJSON *primary_chf_instance_id = NULL; + cJSON *secondary_chf_set_id = NULL; + cJSON *secondary_chf_instance_id = NULL; + primary_chf_address = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfAddress"); if (!primary_chf_address) { ogs_error("OpenAPI_charging_information_parseFromJSON() failed [primary_chf_address]"); goto end; } - if (!cJSON_IsString(primary_chf_address)) { ogs_error("OpenAPI_charging_information_parseFromJSON() failed [primary_chf_address]"); goto end; } - cJSON *secondary_chf_address = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfAddress"); + secondary_chf_address = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfAddress"); if (!secondary_chf_address) { ogs_error("OpenAPI_charging_information_parseFromJSON() failed [secondary_chf_address]"); goto end; } - if (!cJSON_IsString(secondary_chf_address)) { ogs_error("OpenAPI_charging_information_parseFromJSON() failed [secondary_chf_address]"); goto end; } - cJSON *primary_chf_set_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfSetId"); - + primary_chf_set_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfSetId"); if (primary_chf_set_id) { - if (!cJSON_IsString(primary_chf_set_id)) { + if (!cJSON_IsString(primary_chf_set_id) && !cJSON_IsNull(primary_chf_set_id)) { ogs_error("OpenAPI_charging_information_parseFromJSON() failed [primary_chf_set_id]"); goto end; } } - cJSON *primary_chf_instance_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfInstanceId"); - + primary_chf_instance_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "primaryChfInstanceId"); if (primary_chf_instance_id) { - if (!cJSON_IsString(primary_chf_instance_id)) { + if (!cJSON_IsString(primary_chf_instance_id) && !cJSON_IsNull(primary_chf_instance_id)) { ogs_error("OpenAPI_charging_information_parseFromJSON() failed [primary_chf_instance_id]"); goto end; } } - cJSON *secondary_chf_set_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfSetId"); - + secondary_chf_set_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfSetId"); if (secondary_chf_set_id) { - if (!cJSON_IsString(secondary_chf_set_id)) { + if (!cJSON_IsString(secondary_chf_set_id) && !cJSON_IsNull(secondary_chf_set_id)) { ogs_error("OpenAPI_charging_information_parseFromJSON() failed [secondary_chf_set_id]"); goto end; } } - cJSON *secondary_chf_instance_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfInstanceId"); - + secondary_chf_instance_id = cJSON_GetObjectItemCaseSensitive(charging_informationJSON, "secondaryChfInstanceId"); if (secondary_chf_instance_id) { - if (!cJSON_IsString(secondary_chf_instance_id)) { + if (!cJSON_IsString(secondary_chf_instance_id) && !cJSON_IsNull(secondary_chf_instance_id)) { ogs_error("OpenAPI_charging_information_parseFromJSON() failed [secondary_chf_instance_id]"); goto end; } @@ -157,10 +186,10 @@ OpenAPI_charging_information_t *OpenAPI_charging_information_parseFromJSON(cJSON charging_information_local_var = OpenAPI_charging_information_create ( ogs_strdup(primary_chf_address->valuestring), ogs_strdup(secondary_chf_address->valuestring), - primary_chf_set_id ? ogs_strdup(primary_chf_set_id->valuestring) : NULL, - primary_chf_instance_id ? ogs_strdup(primary_chf_instance_id->valuestring) : NULL, - secondary_chf_set_id ? ogs_strdup(secondary_chf_set_id->valuestring) : NULL, - secondary_chf_instance_id ? ogs_strdup(secondary_chf_instance_id->valuestring) : NULL + primary_chf_set_id && !cJSON_IsNull(primary_chf_set_id) ? ogs_strdup(primary_chf_set_id->valuestring) : NULL, + primary_chf_instance_id && !cJSON_IsNull(primary_chf_instance_id) ? ogs_strdup(primary_chf_instance_id->valuestring) : NULL, + secondary_chf_set_id && !cJSON_IsNull(secondary_chf_set_id) ? ogs_strdup(secondary_chf_set_id->valuestring) : NULL, + secondary_chf_instance_id && !cJSON_IsNull(secondary_chf_instance_id) ? ogs_strdup(secondary_chf_instance_id->valuestring) : NULL ); return charging_information_local_var; diff --git a/lib/sbi/openapi/model/chf_info.c b/lib/sbi/openapi/model/chf_info.c index 60bc29b84..ae47e8fe0 100644 --- a/lib/sbi/openapi/model/chf_info.c +++ b/lib/sbi/openapi/model/chf_info.c @@ -28,31 +28,51 @@ OpenAPI_chf_info_t *OpenAPI_chf_info_create( void OpenAPI_chf_info_free(OpenAPI_chf_info_t *chf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == chf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(chf_info->supi_range_list, node) { - OpenAPI_supi_range_free(node->data); + if (chf_info->supi_range_list) { + OpenAPI_list_for_each(chf_info->supi_range_list, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(chf_info->supi_range_list); + chf_info->supi_range_list = NULL; } - OpenAPI_list_free(chf_info->supi_range_list); - OpenAPI_list_for_each(chf_info->gpsi_range_list, node) { - OpenAPI_identity_range_free(node->data); + if (chf_info->gpsi_range_list) { + OpenAPI_list_for_each(chf_info->gpsi_range_list, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(chf_info->gpsi_range_list); + chf_info->gpsi_range_list = NULL; } - OpenAPI_list_free(chf_info->gpsi_range_list); - OpenAPI_list_for_each(chf_info->plmn_range_list, node) { - OpenAPI_plmn_range_free(node->data); + if (chf_info->plmn_range_list) { + OpenAPI_list_for_each(chf_info->plmn_range_list, node) { + OpenAPI_plmn_range_free(node->data); + } + OpenAPI_list_free(chf_info->plmn_range_list); + chf_info->plmn_range_list = NULL; + } + if (chf_info->group_id) { + ogs_free(chf_info->group_id); + chf_info->group_id = NULL; + } + if (chf_info->primary_chf_instance) { + ogs_free(chf_info->primary_chf_instance); + chf_info->primary_chf_instance = NULL; + } + if (chf_info->secondary_chf_instance) { + ogs_free(chf_info->secondary_chf_instance); + chf_info->secondary_chf_instance = NULL; } - OpenAPI_list_free(chf_info->plmn_range_list); - ogs_free(chf_info->group_id); - ogs_free(chf_info->primary_chf_instance); - ogs_free(chf_info->secondary_chf_instance); ogs_free(chf_info); } cJSON *OpenAPI_chf_info_convertToJSON(OpenAPI_chf_info_t *chf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (chf_info == NULL) { ogs_error("OpenAPI_chf_info_convertToJSON() failed [ChfInfo]"); @@ -66,17 +86,13 @@ cJSON *OpenAPI_chf_info_convertToJSON(OpenAPI_chf_info_t *chf_info) ogs_error("OpenAPI_chf_info_convertToJSON() failed [supi_range_list]"); goto end; } - - OpenAPI_lnode_t *supi_range_list_node; - if (chf_info->supi_range_list) { - OpenAPI_list_for_each(chf_info->supi_range_list, supi_range_list_node) { - cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(supi_range_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_chf_info_convertToJSON() failed [supi_range_list]"); - goto end; - } - cJSON_AddItemToArray(supi_range_listList, itemLocal); + OpenAPI_list_for_each(chf_info->supi_range_list, node) { + cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_chf_info_convertToJSON() failed [supi_range_list]"); + goto end; } + cJSON_AddItemToArray(supi_range_listList, itemLocal); } } @@ -86,17 +102,13 @@ cJSON *OpenAPI_chf_info_convertToJSON(OpenAPI_chf_info_t *chf_info) ogs_error("OpenAPI_chf_info_convertToJSON() failed [gpsi_range_list]"); goto end; } - - OpenAPI_lnode_t *gpsi_range_list_node; - if (chf_info->gpsi_range_list) { - OpenAPI_list_for_each(chf_info->gpsi_range_list, gpsi_range_list_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(gpsi_range_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_chf_info_convertToJSON() failed [gpsi_range_list]"); - goto end; - } - cJSON_AddItemToArray(gpsi_range_listList, itemLocal); + OpenAPI_list_for_each(chf_info->gpsi_range_list, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_chf_info_convertToJSON() failed [gpsi_range_list]"); + goto end; } + cJSON_AddItemToArray(gpsi_range_listList, itemLocal); } } @@ -106,17 +118,13 @@ cJSON *OpenAPI_chf_info_convertToJSON(OpenAPI_chf_info_t *chf_info) ogs_error("OpenAPI_chf_info_convertToJSON() failed [plmn_range_list]"); goto end; } - - OpenAPI_lnode_t *plmn_range_list_node; - if (chf_info->plmn_range_list) { - OpenAPI_list_for_each(chf_info->plmn_range_list, plmn_range_list_node) { - cJSON *itemLocal = OpenAPI_plmn_range_convertToJSON(plmn_range_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_chf_info_convertToJSON() failed [plmn_range_list]"); - goto end; - } - cJSON_AddItemToArray(plmn_range_listList, itemLocal); + OpenAPI_list_for_each(chf_info->plmn_range_list, node) { + cJSON *itemLocal = OpenAPI_plmn_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_chf_info_convertToJSON() failed [plmn_range_list]"); + goto end; } + cJSON_AddItemToArray(plmn_range_listList, itemLocal); } } @@ -148,115 +156,110 @@ end: OpenAPI_chf_info_t *OpenAPI_chf_info_parseFromJSON(cJSON *chf_infoJSON) { OpenAPI_chf_info_t *chf_info_local_var = NULL; - cJSON *supi_range_list = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "supiRangeList"); - - OpenAPI_list_t *supi_range_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *supi_range_list = NULL; + OpenAPI_list_t *supi_range_listList = NULL; + cJSON *gpsi_range_list = NULL; + OpenAPI_list_t *gpsi_range_listList = NULL; + cJSON *plmn_range_list = NULL; + OpenAPI_list_t *plmn_range_listList = NULL; + cJSON *group_id = NULL; + cJSON *primary_chf_instance = NULL; + cJSON *secondary_chf_instance = NULL; + supi_range_list = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "supiRangeList"); if (supi_range_list) { - cJSON *supi_range_list_local_nonprimitive; - if (!cJSON_IsArray(supi_range_list)){ - ogs_error("OpenAPI_chf_info_parseFromJSON() failed [supi_range_list]"); - goto end; - } - - supi_range_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(supi_range_list_local_nonprimitive, supi_range_list ) { - if (!cJSON_IsObject(supi_range_list_local_nonprimitive)) { + cJSON *supi_range_list_local = NULL; + if (!cJSON_IsArray(supi_range_list)) { ogs_error("OpenAPI_chf_info_parseFromJSON() failed [supi_range_list]"); goto end; } - OpenAPI_supi_range_t *supi_range_listItem = OpenAPI_supi_range_parseFromJSON(supi_range_list_local_nonprimitive); - if (!supi_range_listItem) { - ogs_error("No supi_range_listItem"); - OpenAPI_list_free(supi_range_listList); - goto end; + supi_range_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_range_list_local, supi_range_list) { + if (!cJSON_IsObject(supi_range_list_local)) { + ogs_error("OpenAPI_chf_info_parseFromJSON() failed [supi_range_list]"); + goto end; + } + OpenAPI_supi_range_t *supi_range_listItem = OpenAPI_supi_range_parseFromJSON(supi_range_list_local); + if (!supi_range_listItem) { + ogs_error("No supi_range_listItem"); + OpenAPI_list_free(supi_range_listList); + goto end; + } + OpenAPI_list_add(supi_range_listList, supi_range_listItem); } - - OpenAPI_list_add(supi_range_listList, supi_range_listItem); - } } - cJSON *gpsi_range_list = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "gpsiRangeList"); - - OpenAPI_list_t *gpsi_range_listList; + gpsi_range_list = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "gpsiRangeList"); if (gpsi_range_list) { - cJSON *gpsi_range_list_local_nonprimitive; - if (!cJSON_IsArray(gpsi_range_list)){ - ogs_error("OpenAPI_chf_info_parseFromJSON() failed [gpsi_range_list]"); - goto end; - } - - gpsi_range_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(gpsi_range_list_local_nonprimitive, gpsi_range_list ) { - if (!cJSON_IsObject(gpsi_range_list_local_nonprimitive)) { + cJSON *gpsi_range_list_local = NULL; + if (!cJSON_IsArray(gpsi_range_list)) { ogs_error("OpenAPI_chf_info_parseFromJSON() failed [gpsi_range_list]"); goto end; } - OpenAPI_identity_range_t *gpsi_range_listItem = OpenAPI_identity_range_parseFromJSON(gpsi_range_list_local_nonprimitive); - if (!gpsi_range_listItem) { - ogs_error("No gpsi_range_listItem"); - OpenAPI_list_free(gpsi_range_listList); - goto end; + gpsi_range_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_range_list_local, gpsi_range_list) { + if (!cJSON_IsObject(gpsi_range_list_local)) { + ogs_error("OpenAPI_chf_info_parseFromJSON() failed [gpsi_range_list]"); + goto end; + } + OpenAPI_identity_range_t *gpsi_range_listItem = OpenAPI_identity_range_parseFromJSON(gpsi_range_list_local); + if (!gpsi_range_listItem) { + ogs_error("No gpsi_range_listItem"); + OpenAPI_list_free(gpsi_range_listList); + goto end; + } + OpenAPI_list_add(gpsi_range_listList, gpsi_range_listItem); } - - OpenAPI_list_add(gpsi_range_listList, gpsi_range_listItem); - } } - cJSON *plmn_range_list = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "plmnRangeList"); - - OpenAPI_list_t *plmn_range_listList; + plmn_range_list = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "plmnRangeList"); if (plmn_range_list) { - cJSON *plmn_range_list_local_nonprimitive; - if (!cJSON_IsArray(plmn_range_list)){ - ogs_error("OpenAPI_chf_info_parseFromJSON() failed [plmn_range_list]"); - goto end; - } - - plmn_range_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(plmn_range_list_local_nonprimitive, plmn_range_list ) { - if (!cJSON_IsObject(plmn_range_list_local_nonprimitive)) { + cJSON *plmn_range_list_local = NULL; + if (!cJSON_IsArray(plmn_range_list)) { ogs_error("OpenAPI_chf_info_parseFromJSON() failed [plmn_range_list]"); goto end; } - OpenAPI_plmn_range_t *plmn_range_listItem = OpenAPI_plmn_range_parseFromJSON(plmn_range_list_local_nonprimitive); - if (!plmn_range_listItem) { - ogs_error("No plmn_range_listItem"); - OpenAPI_list_free(plmn_range_listList); - goto end; + plmn_range_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_range_list_local, plmn_range_list) { + if (!cJSON_IsObject(plmn_range_list_local)) { + ogs_error("OpenAPI_chf_info_parseFromJSON() failed [plmn_range_list]"); + goto end; + } + OpenAPI_plmn_range_t *plmn_range_listItem = OpenAPI_plmn_range_parseFromJSON(plmn_range_list_local); + if (!plmn_range_listItem) { + ogs_error("No plmn_range_listItem"); + OpenAPI_list_free(plmn_range_listList); + goto end; + } + OpenAPI_list_add(plmn_range_listList, plmn_range_listItem); } - - OpenAPI_list_add(plmn_range_listList, plmn_range_listItem); - } } - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "groupId"); - + group_id = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_chf_info_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *primary_chf_instance = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "primaryChfInstance"); - + primary_chf_instance = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "primaryChfInstance"); if (primary_chf_instance) { - if (!cJSON_IsString(primary_chf_instance)) { + if (!cJSON_IsString(primary_chf_instance) && !cJSON_IsNull(primary_chf_instance)) { ogs_error("OpenAPI_chf_info_parseFromJSON() failed [primary_chf_instance]"); goto end; } } - cJSON *secondary_chf_instance = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "secondaryChfInstance"); - + secondary_chf_instance = cJSON_GetObjectItemCaseSensitive(chf_infoJSON, "secondaryChfInstance"); if (secondary_chf_instance) { - if (!cJSON_IsString(secondary_chf_instance)) { + if (!cJSON_IsString(secondary_chf_instance) && !cJSON_IsNull(secondary_chf_instance)) { ogs_error("OpenAPI_chf_info_parseFromJSON() failed [secondary_chf_instance]"); goto end; } @@ -266,13 +269,34 @@ OpenAPI_chf_info_t *OpenAPI_chf_info_parseFromJSON(cJSON *chf_infoJSON) supi_range_list ? supi_range_listList : NULL, gpsi_range_list ? gpsi_range_listList : NULL, plmn_range_list ? plmn_range_listList : NULL, - group_id ? ogs_strdup(group_id->valuestring) : NULL, - primary_chf_instance ? ogs_strdup(primary_chf_instance->valuestring) : NULL, - secondary_chf_instance ? ogs_strdup(secondary_chf_instance->valuestring) : NULL + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, + primary_chf_instance && !cJSON_IsNull(primary_chf_instance) ? ogs_strdup(primary_chf_instance->valuestring) : NULL, + secondary_chf_instance && !cJSON_IsNull(secondary_chf_instance) ? ogs_strdup(secondary_chf_instance->valuestring) : NULL ); return chf_info_local_var; end: + if (supi_range_listList) { + OpenAPI_list_for_each(supi_range_listList, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(supi_range_listList); + supi_range_listList = NULL; + } + if (gpsi_range_listList) { + OpenAPI_list_for_each(gpsi_range_listList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(gpsi_range_listList); + gpsi_range_listList = NULL; + } + if (plmn_range_listList) { + OpenAPI_list_for_each(plmn_range_listList, node) { + OpenAPI_plmn_range_free(node->data); + } + OpenAPI_list_free(plmn_range_listList); + plmn_range_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/civic_address.c b/lib/sbi/openapi/model/civic_address.c index 54542ed78..bdc649da9 100644 --- a/lib/sbi/openapi/model/civic_address.c +++ b/lib/sbi/openapi/model/civic_address.c @@ -84,50 +84,154 @@ OpenAPI_civic_address_t *OpenAPI_civic_address_create( void OpenAPI_civic_address_free(OpenAPI_civic_address_t *civic_address) { + OpenAPI_lnode_t *node = NULL; + if (NULL == civic_address) { return; } - OpenAPI_lnode_t *node; - ogs_free(civic_address->country); - ogs_free(civic_address->a1); - ogs_free(civic_address->a2); - ogs_free(civic_address->a3); - ogs_free(civic_address->a4); - ogs_free(civic_address->a5); - ogs_free(civic_address->a6); - ogs_free(civic_address->prd); - ogs_free(civic_address->pod); - ogs_free(civic_address->sts); - ogs_free(civic_address->hno); - ogs_free(civic_address->hns); - ogs_free(civic_address->lmk); - ogs_free(civic_address->loc); - ogs_free(civic_address->nam); - ogs_free(civic_address->pc); - ogs_free(civic_address->bld); - ogs_free(civic_address->unit); - ogs_free(civic_address->flr); - ogs_free(civic_address->room); - ogs_free(civic_address->plc); - ogs_free(civic_address->pcn); - ogs_free(civic_address->pobox); - ogs_free(civic_address->addcode); - ogs_free(civic_address->seat); - ogs_free(civic_address->rd); - ogs_free(civic_address->rdsec); - ogs_free(civic_address->rdbr); - ogs_free(civic_address->rdsubbr); - ogs_free(civic_address->prm); - ogs_free(civic_address->pom); - ogs_free(civic_address->usage_rules); - ogs_free(civic_address->method); - ogs_free(civic_address->provided_by); + if (civic_address->country) { + ogs_free(civic_address->country); + civic_address->country = NULL; + } + if (civic_address->a1) { + ogs_free(civic_address->a1); + civic_address->a1 = NULL; + } + if (civic_address->a2) { + ogs_free(civic_address->a2); + civic_address->a2 = NULL; + } + if (civic_address->a3) { + ogs_free(civic_address->a3); + civic_address->a3 = NULL; + } + if (civic_address->a4) { + ogs_free(civic_address->a4); + civic_address->a4 = NULL; + } + if (civic_address->a5) { + ogs_free(civic_address->a5); + civic_address->a5 = NULL; + } + if (civic_address->a6) { + ogs_free(civic_address->a6); + civic_address->a6 = NULL; + } + if (civic_address->prd) { + ogs_free(civic_address->prd); + civic_address->prd = NULL; + } + if (civic_address->pod) { + ogs_free(civic_address->pod); + civic_address->pod = NULL; + } + if (civic_address->sts) { + ogs_free(civic_address->sts); + civic_address->sts = NULL; + } + if (civic_address->hno) { + ogs_free(civic_address->hno); + civic_address->hno = NULL; + } + if (civic_address->hns) { + ogs_free(civic_address->hns); + civic_address->hns = NULL; + } + if (civic_address->lmk) { + ogs_free(civic_address->lmk); + civic_address->lmk = NULL; + } + if (civic_address->loc) { + ogs_free(civic_address->loc); + civic_address->loc = NULL; + } + if (civic_address->nam) { + ogs_free(civic_address->nam); + civic_address->nam = NULL; + } + if (civic_address->pc) { + ogs_free(civic_address->pc); + civic_address->pc = NULL; + } + if (civic_address->bld) { + ogs_free(civic_address->bld); + civic_address->bld = NULL; + } + if (civic_address->unit) { + ogs_free(civic_address->unit); + civic_address->unit = NULL; + } + if (civic_address->flr) { + ogs_free(civic_address->flr); + civic_address->flr = NULL; + } + if (civic_address->room) { + ogs_free(civic_address->room); + civic_address->room = NULL; + } + if (civic_address->plc) { + ogs_free(civic_address->plc); + civic_address->plc = NULL; + } + if (civic_address->pcn) { + ogs_free(civic_address->pcn); + civic_address->pcn = NULL; + } + if (civic_address->pobox) { + ogs_free(civic_address->pobox); + civic_address->pobox = NULL; + } + if (civic_address->addcode) { + ogs_free(civic_address->addcode); + civic_address->addcode = NULL; + } + if (civic_address->seat) { + ogs_free(civic_address->seat); + civic_address->seat = NULL; + } + if (civic_address->rd) { + ogs_free(civic_address->rd); + civic_address->rd = NULL; + } + if (civic_address->rdsec) { + ogs_free(civic_address->rdsec); + civic_address->rdsec = NULL; + } + if (civic_address->rdbr) { + ogs_free(civic_address->rdbr); + civic_address->rdbr = NULL; + } + if (civic_address->rdsubbr) { + ogs_free(civic_address->rdsubbr); + civic_address->rdsubbr = NULL; + } + if (civic_address->prm) { + ogs_free(civic_address->prm); + civic_address->prm = NULL; + } + if (civic_address->pom) { + ogs_free(civic_address->pom); + civic_address->pom = NULL; + } + if (civic_address->usage_rules) { + ogs_free(civic_address->usage_rules); + civic_address->usage_rules = NULL; + } + if (civic_address->method) { + ogs_free(civic_address->method); + civic_address->method = NULL; + } + if (civic_address->provided_by) { + ogs_free(civic_address->provided_by); + civic_address->provided_by = NULL; + } ogs_free(civic_address); } cJSON *OpenAPI_civic_address_convertToJSON(OpenAPI_civic_address_t *civic_address) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (civic_address == NULL) { ogs_error("OpenAPI_civic_address_convertToJSON() failed [CivicAddress]"); @@ -380,347 +484,348 @@ end: OpenAPI_civic_address_t *OpenAPI_civic_address_parseFromJSON(cJSON *civic_addressJSON) { OpenAPI_civic_address_t *civic_address_local_var = NULL; - cJSON *country = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "country"); - + OpenAPI_lnode_t *node = NULL; + cJSON *country = NULL; + cJSON *a1 = NULL; + cJSON *a2 = NULL; + cJSON *a3 = NULL; + cJSON *a4 = NULL; + cJSON *a5 = NULL; + cJSON *a6 = NULL; + cJSON *prd = NULL; + cJSON *pod = NULL; + cJSON *sts = NULL; + cJSON *hno = NULL; + cJSON *hns = NULL; + cJSON *lmk = NULL; + cJSON *loc = NULL; + cJSON *nam = NULL; + cJSON *pc = NULL; + cJSON *bld = NULL; + cJSON *unit = NULL; + cJSON *flr = NULL; + cJSON *room = NULL; + cJSON *plc = NULL; + cJSON *pcn = NULL; + cJSON *pobox = NULL; + cJSON *addcode = NULL; + cJSON *seat = NULL; + cJSON *rd = NULL; + cJSON *rdsec = NULL; + cJSON *rdbr = NULL; + cJSON *rdsubbr = NULL; + cJSON *prm = NULL; + cJSON *pom = NULL; + cJSON *usage_rules = NULL; + cJSON *method = NULL; + cJSON *provided_by = NULL; + country = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "country"); if (country) { - if (!cJSON_IsString(country)) { + if (!cJSON_IsString(country) && !cJSON_IsNull(country)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [country]"); goto end; } } - cJSON *a1 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A1"); - + a1 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A1"); if (a1) { - if (!cJSON_IsString(a1)) { + if (!cJSON_IsString(a1) && !cJSON_IsNull(a1)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a1]"); goto end; } } - cJSON *a2 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A2"); - + a2 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A2"); if (a2) { - if (!cJSON_IsString(a2)) { + if (!cJSON_IsString(a2) && !cJSON_IsNull(a2)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a2]"); goto end; } } - cJSON *a3 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A3"); - + a3 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A3"); if (a3) { - if (!cJSON_IsString(a3)) { + if (!cJSON_IsString(a3) && !cJSON_IsNull(a3)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a3]"); goto end; } } - cJSON *a4 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A4"); - + a4 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A4"); if (a4) { - if (!cJSON_IsString(a4)) { + if (!cJSON_IsString(a4) && !cJSON_IsNull(a4)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a4]"); goto end; } } - cJSON *a5 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A5"); - + a5 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A5"); if (a5) { - if (!cJSON_IsString(a5)) { + if (!cJSON_IsString(a5) && !cJSON_IsNull(a5)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a5]"); goto end; } } - cJSON *a6 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A6"); - + a6 = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "A6"); if (a6) { - if (!cJSON_IsString(a6)) { + if (!cJSON_IsString(a6) && !cJSON_IsNull(a6)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [a6]"); goto end; } } - cJSON *prd = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PRD"); - + prd = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PRD"); if (prd) { - if (!cJSON_IsString(prd)) { + if (!cJSON_IsString(prd) && !cJSON_IsNull(prd)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [prd]"); goto end; } } - cJSON *pod = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POD"); - + pod = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POD"); if (pod) { - if (!cJSON_IsString(pod)) { + if (!cJSON_IsString(pod) && !cJSON_IsNull(pod)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pod]"); goto end; } } - cJSON *sts = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "STS"); - + sts = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "STS"); if (sts) { - if (!cJSON_IsString(sts)) { + if (!cJSON_IsString(sts) && !cJSON_IsNull(sts)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [sts]"); goto end; } } - cJSON *hno = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "HNO"); - + hno = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "HNO"); if (hno) { - if (!cJSON_IsString(hno)) { + if (!cJSON_IsString(hno) && !cJSON_IsNull(hno)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [hno]"); goto end; } } - cJSON *hns = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "HNS"); - + hns = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "HNS"); if (hns) { - if (!cJSON_IsString(hns)) { + if (!cJSON_IsString(hns) && !cJSON_IsNull(hns)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [hns]"); goto end; } } - cJSON *lmk = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "LMK"); - + lmk = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "LMK"); if (lmk) { - if (!cJSON_IsString(lmk)) { + if (!cJSON_IsString(lmk) && !cJSON_IsNull(lmk)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [lmk]"); goto end; } } - cJSON *loc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "LOC"); - + loc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "LOC"); if (loc) { - if (!cJSON_IsString(loc)) { + if (!cJSON_IsString(loc) && !cJSON_IsNull(loc)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [loc]"); goto end; } } - cJSON *nam = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "NAM"); - + nam = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "NAM"); if (nam) { - if (!cJSON_IsString(nam)) { + if (!cJSON_IsString(nam) && !cJSON_IsNull(nam)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [nam]"); goto end; } } - cJSON *pc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PC"); - + pc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PC"); if (pc) { - if (!cJSON_IsString(pc)) { + if (!cJSON_IsString(pc) && !cJSON_IsNull(pc)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pc]"); goto end; } } - cJSON *bld = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "BLD"); - + bld = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "BLD"); if (bld) { - if (!cJSON_IsString(bld)) { + if (!cJSON_IsString(bld) && !cJSON_IsNull(bld)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [bld]"); goto end; } } - cJSON *unit = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "UNIT"); - + unit = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "UNIT"); if (unit) { - if (!cJSON_IsString(unit)) { + if (!cJSON_IsString(unit) && !cJSON_IsNull(unit)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [unit]"); goto end; } } - cJSON *flr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "FLR"); - + flr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "FLR"); if (flr) { - if (!cJSON_IsString(flr)) { + if (!cJSON_IsString(flr) && !cJSON_IsNull(flr)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [flr]"); goto end; } } - cJSON *room = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "ROOM"); - + room = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "ROOM"); if (room) { - if (!cJSON_IsString(room)) { + if (!cJSON_IsString(room) && !cJSON_IsNull(room)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [room]"); goto end; } } - cJSON *plc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PLC"); - + plc = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PLC"); if (plc) { - if (!cJSON_IsString(plc)) { + if (!cJSON_IsString(plc) && !cJSON_IsNull(plc)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [plc]"); goto end; } } - cJSON *pcn = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PCN"); - + pcn = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PCN"); if (pcn) { - if (!cJSON_IsString(pcn)) { + if (!cJSON_IsString(pcn) && !cJSON_IsNull(pcn)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pcn]"); goto end; } } - cJSON *pobox = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POBOX"); - + pobox = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POBOX"); if (pobox) { - if (!cJSON_IsString(pobox)) { + if (!cJSON_IsString(pobox) && !cJSON_IsNull(pobox)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pobox]"); goto end; } } - cJSON *addcode = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "ADDCODE"); - + addcode = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "ADDCODE"); if (addcode) { - if (!cJSON_IsString(addcode)) { + if (!cJSON_IsString(addcode) && !cJSON_IsNull(addcode)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [addcode]"); goto end; } } - cJSON *seat = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "SEAT"); - + seat = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "SEAT"); if (seat) { - if (!cJSON_IsString(seat)) { + if (!cJSON_IsString(seat) && !cJSON_IsNull(seat)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [seat]"); goto end; } } - cJSON *rd = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RD"); - + rd = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RD"); if (rd) { - if (!cJSON_IsString(rd)) { + if (!cJSON_IsString(rd) && !cJSON_IsNull(rd)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [rd]"); goto end; } } - cJSON *rdsec = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDSEC"); - + rdsec = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDSEC"); if (rdsec) { - if (!cJSON_IsString(rdsec)) { + if (!cJSON_IsString(rdsec) && !cJSON_IsNull(rdsec)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [rdsec]"); goto end; } } - cJSON *rdbr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDBR"); - + rdbr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDBR"); if (rdbr) { - if (!cJSON_IsString(rdbr)) { + if (!cJSON_IsString(rdbr) && !cJSON_IsNull(rdbr)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [rdbr]"); goto end; } } - cJSON *rdsubbr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDSUBBR"); - + rdsubbr = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "RDSUBBR"); if (rdsubbr) { - if (!cJSON_IsString(rdsubbr)) { + if (!cJSON_IsString(rdsubbr) && !cJSON_IsNull(rdsubbr)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [rdsubbr]"); goto end; } } - cJSON *prm = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PRM"); - + prm = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "PRM"); if (prm) { - if (!cJSON_IsString(prm)) { + if (!cJSON_IsString(prm) && !cJSON_IsNull(prm)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [prm]"); goto end; } } - cJSON *pom = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POM"); - + pom = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "POM"); if (pom) { - if (!cJSON_IsString(pom)) { + if (!cJSON_IsString(pom) && !cJSON_IsNull(pom)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [pom]"); goto end; } } - cJSON *usage_rules = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "usageRules"); - + usage_rules = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "usageRules"); if (usage_rules) { - if (!cJSON_IsString(usage_rules)) { + if (!cJSON_IsString(usage_rules) && !cJSON_IsNull(usage_rules)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [usage_rules]"); goto end; } } - cJSON *method = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "method"); - + method = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "method"); if (method) { - if (!cJSON_IsString(method)) { + if (!cJSON_IsString(method) && !cJSON_IsNull(method)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [method]"); goto end; } } - cJSON *provided_by = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "providedBy"); - + provided_by = cJSON_GetObjectItemCaseSensitive(civic_addressJSON, "providedBy"); if (provided_by) { - if (!cJSON_IsString(provided_by)) { + if (!cJSON_IsString(provided_by) && !cJSON_IsNull(provided_by)) { ogs_error("OpenAPI_civic_address_parseFromJSON() failed [provided_by]"); goto end; } } civic_address_local_var = OpenAPI_civic_address_create ( - country ? ogs_strdup(country->valuestring) : NULL, - a1 ? ogs_strdup(a1->valuestring) : NULL, - a2 ? ogs_strdup(a2->valuestring) : NULL, - a3 ? ogs_strdup(a3->valuestring) : NULL, - a4 ? ogs_strdup(a4->valuestring) : NULL, - a5 ? ogs_strdup(a5->valuestring) : NULL, - a6 ? ogs_strdup(a6->valuestring) : NULL, - prd ? ogs_strdup(prd->valuestring) : NULL, - pod ? ogs_strdup(pod->valuestring) : NULL, - sts ? ogs_strdup(sts->valuestring) : NULL, - hno ? ogs_strdup(hno->valuestring) : NULL, - hns ? ogs_strdup(hns->valuestring) : NULL, - lmk ? ogs_strdup(lmk->valuestring) : NULL, - loc ? ogs_strdup(loc->valuestring) : NULL, - nam ? ogs_strdup(nam->valuestring) : NULL, - pc ? ogs_strdup(pc->valuestring) : NULL, - bld ? ogs_strdup(bld->valuestring) : NULL, - unit ? ogs_strdup(unit->valuestring) : NULL, - flr ? ogs_strdup(flr->valuestring) : NULL, - room ? ogs_strdup(room->valuestring) : NULL, - plc ? ogs_strdup(plc->valuestring) : NULL, - pcn ? ogs_strdup(pcn->valuestring) : NULL, - pobox ? ogs_strdup(pobox->valuestring) : NULL, - addcode ? ogs_strdup(addcode->valuestring) : NULL, - seat ? ogs_strdup(seat->valuestring) : NULL, - rd ? ogs_strdup(rd->valuestring) : NULL, - rdsec ? ogs_strdup(rdsec->valuestring) : NULL, - rdbr ? ogs_strdup(rdbr->valuestring) : NULL, - rdsubbr ? ogs_strdup(rdsubbr->valuestring) : NULL, - prm ? ogs_strdup(prm->valuestring) : NULL, - pom ? ogs_strdup(pom->valuestring) : NULL, - usage_rules ? ogs_strdup(usage_rules->valuestring) : NULL, - method ? ogs_strdup(method->valuestring) : NULL, - provided_by ? ogs_strdup(provided_by->valuestring) : NULL + country && !cJSON_IsNull(country) ? ogs_strdup(country->valuestring) : NULL, + a1 && !cJSON_IsNull(a1) ? ogs_strdup(a1->valuestring) : NULL, + a2 && !cJSON_IsNull(a2) ? ogs_strdup(a2->valuestring) : NULL, + a3 && !cJSON_IsNull(a3) ? ogs_strdup(a3->valuestring) : NULL, + a4 && !cJSON_IsNull(a4) ? ogs_strdup(a4->valuestring) : NULL, + a5 && !cJSON_IsNull(a5) ? ogs_strdup(a5->valuestring) : NULL, + a6 && !cJSON_IsNull(a6) ? ogs_strdup(a6->valuestring) : NULL, + prd && !cJSON_IsNull(prd) ? ogs_strdup(prd->valuestring) : NULL, + pod && !cJSON_IsNull(pod) ? ogs_strdup(pod->valuestring) : NULL, + sts && !cJSON_IsNull(sts) ? ogs_strdup(sts->valuestring) : NULL, + hno && !cJSON_IsNull(hno) ? ogs_strdup(hno->valuestring) : NULL, + hns && !cJSON_IsNull(hns) ? ogs_strdup(hns->valuestring) : NULL, + lmk && !cJSON_IsNull(lmk) ? ogs_strdup(lmk->valuestring) : NULL, + loc && !cJSON_IsNull(loc) ? ogs_strdup(loc->valuestring) : NULL, + nam && !cJSON_IsNull(nam) ? ogs_strdup(nam->valuestring) : NULL, + pc && !cJSON_IsNull(pc) ? ogs_strdup(pc->valuestring) : NULL, + bld && !cJSON_IsNull(bld) ? ogs_strdup(bld->valuestring) : NULL, + unit && !cJSON_IsNull(unit) ? ogs_strdup(unit->valuestring) : NULL, + flr && !cJSON_IsNull(flr) ? ogs_strdup(flr->valuestring) : NULL, + room && !cJSON_IsNull(room) ? ogs_strdup(room->valuestring) : NULL, + plc && !cJSON_IsNull(plc) ? ogs_strdup(plc->valuestring) : NULL, + pcn && !cJSON_IsNull(pcn) ? ogs_strdup(pcn->valuestring) : NULL, + pobox && !cJSON_IsNull(pobox) ? ogs_strdup(pobox->valuestring) : NULL, + addcode && !cJSON_IsNull(addcode) ? ogs_strdup(addcode->valuestring) : NULL, + seat && !cJSON_IsNull(seat) ? ogs_strdup(seat->valuestring) : NULL, + rd && !cJSON_IsNull(rd) ? ogs_strdup(rd->valuestring) : NULL, + rdsec && !cJSON_IsNull(rdsec) ? ogs_strdup(rdsec->valuestring) : NULL, + rdbr && !cJSON_IsNull(rdbr) ? ogs_strdup(rdbr->valuestring) : NULL, + rdsubbr && !cJSON_IsNull(rdsubbr) ? ogs_strdup(rdsubbr->valuestring) : NULL, + prm && !cJSON_IsNull(prm) ? ogs_strdup(prm->valuestring) : NULL, + pom && !cJSON_IsNull(pom) ? ogs_strdup(pom->valuestring) : NULL, + usage_rules && !cJSON_IsNull(usage_rules) ? ogs_strdup(usage_rules->valuestring) : NULL, + method && !cJSON_IsNull(method) ? ogs_strdup(method->valuestring) : NULL, + provided_by && !cJSON_IsNull(provided_by) ? ogs_strdup(provided_by->valuestring) : NULL ); return civic_address_local_var; diff --git a/lib/sbi/openapi/model/cm_info.c b/lib/sbi/openapi/model/cm_info.c index 651dcd62a..709f5927e 100644 --- a/lib/sbi/openapi/model/cm_info.c +++ b/lib/sbi/openapi/model/cm_info.c @@ -20,17 +20,22 @@ OpenAPI_cm_info_t *OpenAPI_cm_info_create( void OpenAPI_cm_info_free(OpenAPI_cm_info_t *cm_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cm_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_cm_state_free(cm_info->cm_state); + if (cm_info->cm_state) { + OpenAPI_cm_state_free(cm_info->cm_state); + cm_info->cm_state = NULL; + } ogs_free(cm_info); } cJSON *OpenAPI_cm_info_convertToJSON(OpenAPI_cm_info_t *cm_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cm_info == NULL) { ogs_error("OpenAPI_cm_info_convertToJSON() failed [CmInfo]"); @@ -38,6 +43,10 @@ cJSON *OpenAPI_cm_info_convertToJSON(OpenAPI_cm_info_t *cm_info) } item = cJSON_CreateObject(); + if (!cm_info->cm_state) { + ogs_error("OpenAPI_cm_info_convertToJSON() failed [cm_state]"); + return NULL; + } cJSON *cm_state_local_JSON = OpenAPI_cm_state_convertToJSON(cm_info->cm_state); if (cm_state_local_JSON == NULL) { ogs_error("OpenAPI_cm_info_convertToJSON() failed [cm_state]"); @@ -49,6 +58,10 @@ cJSON *OpenAPI_cm_info_convertToJSON(OpenAPI_cm_info_t *cm_info) goto end; } + if (cm_info->access_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_cm_info_convertToJSON() failed [access_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(cm_info->access_type)) == NULL) { ogs_error("OpenAPI_cm_info_convertToJSON() failed [access_type]"); goto end; @@ -61,22 +74,23 @@ end: OpenAPI_cm_info_t *OpenAPI_cm_info_parseFromJSON(cJSON *cm_infoJSON) { OpenAPI_cm_info_t *cm_info_local_var = NULL; - cJSON *cm_state = cJSON_GetObjectItemCaseSensitive(cm_infoJSON, "cmState"); + OpenAPI_lnode_t *node = NULL; + cJSON *cm_state = NULL; + OpenAPI_cm_state_t *cm_state_local_nonprim = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cm_state = cJSON_GetObjectItemCaseSensitive(cm_infoJSON, "cmState"); if (!cm_state) { ogs_error("OpenAPI_cm_info_parseFromJSON() failed [cm_state]"); goto end; } - - OpenAPI_cm_state_t *cm_state_local_nonprim = NULL; cm_state_local_nonprim = OpenAPI_cm_state_parseFromJSON(cm_state); - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(cm_infoJSON, "accessType"); + access_type = cJSON_GetObjectItemCaseSensitive(cm_infoJSON, "accessType"); if (!access_type) { ogs_error("OpenAPI_cm_info_parseFromJSON() failed [access_type]"); goto end; } - - OpenAPI_access_type_e access_typeVariable; if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_cm_info_parseFromJSON() failed [access_type]"); goto end; @@ -90,6 +104,10 @@ OpenAPI_cm_info_t *OpenAPI_cm_info_parseFromJSON(cJSON *cm_infoJSON) return cm_info_local_var; end: + if (cm_state_local_nonprim) { + OpenAPI_cm_state_free(cm_state_local_nonprim); + cm_state_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cm_state.c b/lib/sbi/openapi/model/cm_state.c index 7f8ea7f0c..5c830adbb 100644 --- a/lib/sbi/openapi/model/cm_state.c +++ b/lib/sbi/openapi/model/cm_state.c @@ -16,16 +16,18 @@ OpenAPI_cm_state_t *OpenAPI_cm_state_create( void OpenAPI_cm_state_free(OpenAPI_cm_state_t *cm_state) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cm_state) { return; } - OpenAPI_lnode_t *node; ogs_free(cm_state); } cJSON *OpenAPI_cm_state_convertToJSON(OpenAPI_cm_state_t *cm_state) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cm_state == NULL) { ogs_error("OpenAPI_cm_state_convertToJSON() failed [CmState]"); @@ -40,6 +42,7 @@ end: OpenAPI_cm_state_t *OpenAPI_cm_state_parseFromJSON(cJSON *cm_stateJSON) { OpenAPI_cm_state_t *cm_state_local_var = NULL; + OpenAPI_lnode_t *node = NULL; cm_state_local_var = OpenAPI_cm_state_create ( ); diff --git a/lib/sbi/openapi/model/cn_assisted_ran_para.c b/lib/sbi/openapi/model/cn_assisted_ran_para.c index 05bfedff0..7965e35f4 100644 --- a/lib/sbi/openapi/model/cn_assisted_ran_para.c +++ b/lib/sbi/openapi/model/cn_assisted_ran_para.c @@ -34,18 +34,26 @@ OpenAPI_cn_assisted_ran_para_t *OpenAPI_cn_assisted_ran_para_create( void OpenAPI_cn_assisted_ran_para_free(OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cn_assisted_ran_para) { return; } - OpenAPI_lnode_t *node; - OpenAPI_scheduled_communication_time_free(cn_assisted_ran_para->scheduled_communication_time); - OpenAPI_battery_indication_free(cn_assisted_ran_para->battery_indication); + if (cn_assisted_ran_para->scheduled_communication_time) { + OpenAPI_scheduled_communication_time_free(cn_assisted_ran_para->scheduled_communication_time); + cn_assisted_ran_para->scheduled_communication_time = NULL; + } + if (cn_assisted_ran_para->battery_indication) { + OpenAPI_battery_indication_free(cn_assisted_ran_para->battery_indication); + cn_assisted_ran_para->battery_indication = NULL; + } ogs_free(cn_assisted_ran_para); } cJSON *OpenAPI_cn_assisted_ran_para_convertToJSON(OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cn_assisted_ran_para == NULL) { ogs_error("OpenAPI_cn_assisted_ran_para_convertToJSON() failed [CnAssistedRanPara]"); @@ -53,7 +61,7 @@ cJSON *OpenAPI_cn_assisted_ran_para_convertToJSON(OpenAPI_cn_assisted_ran_para_t } item = cJSON_CreateObject(); - if (cn_assisted_ran_para->stationary_indication) { + if (cn_assisted_ran_para->stationary_indication != OpenAPI_stationary_indication_NULL) { if (cJSON_AddStringToObject(item, "stationaryIndication", OpenAPI_stationary_indication_ToString(cn_assisted_ran_para->stationary_indication)) == NULL) { ogs_error("OpenAPI_cn_assisted_ran_para_convertToJSON() failed [stationary_indication]"); goto end; @@ -87,14 +95,14 @@ cJSON *OpenAPI_cn_assisted_ran_para_convertToJSON(OpenAPI_cn_assisted_ran_para_t } } - if (cn_assisted_ran_para->scheduled_communication_type) { + if (cn_assisted_ran_para->scheduled_communication_type != OpenAPI_scheduled_communication_type_NULL) { if (cJSON_AddStringToObject(item, "scheduledCommunicationType", OpenAPI_scheduled_communication_type_ToString(cn_assisted_ran_para->scheduled_communication_type)) == NULL) { ogs_error("OpenAPI_cn_assisted_ran_para_convertToJSON() failed [scheduled_communication_type]"); goto end; } } - if (cn_assisted_ran_para->traffic_profile) { + if (cn_assisted_ran_para->traffic_profile != OpenAPI_traffic_profile_NULL) { if (cJSON_AddStringToObject(item, "trafficProfile", OpenAPI_traffic_profile_ToString(cn_assisted_ran_para->traffic_profile)) == NULL) { ogs_error("OpenAPI_cn_assisted_ran_para_convertToJSON() failed [traffic_profile]"); goto end; @@ -121,9 +129,20 @@ end: OpenAPI_cn_assisted_ran_para_t *OpenAPI_cn_assisted_ran_para_parseFromJSON(cJSON *cn_assisted_ran_paraJSON) { OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para_local_var = NULL; - cJSON *stationary_indication = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "stationaryIndication"); - - OpenAPI_stationary_indication_e stationary_indicationVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *stationary_indication = NULL; + OpenAPI_stationary_indication_e stationary_indicationVariable = 0; + cJSON *communication_duration_time = NULL; + cJSON *periodic_time = NULL; + cJSON *scheduled_communication_time = NULL; + OpenAPI_scheduled_communication_time_t *scheduled_communication_time_local_nonprim = NULL; + cJSON *scheduled_communication_type = NULL; + OpenAPI_scheduled_communication_type_e scheduled_communication_typeVariable = 0; + cJSON *traffic_profile = NULL; + OpenAPI_traffic_profile_e traffic_profileVariable = 0; + cJSON *battery_indication = NULL; + OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL; + stationary_indication = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "stationaryIndication"); if (stationary_indication) { if (!cJSON_IsString(stationary_indication)) { ogs_error("OpenAPI_cn_assisted_ran_para_parseFromJSON() failed [stationary_indication]"); @@ -132,8 +151,7 @@ OpenAPI_cn_assisted_ran_para_t *OpenAPI_cn_assisted_ran_para_parseFromJSON(cJSON stationary_indicationVariable = OpenAPI_stationary_indication_FromString(stationary_indication->valuestring); } - cJSON *communication_duration_time = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "communicationDurationTime"); - + communication_duration_time = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "communicationDurationTime"); if (communication_duration_time) { if (!cJSON_IsNumber(communication_duration_time)) { ogs_error("OpenAPI_cn_assisted_ran_para_parseFromJSON() failed [communication_duration_time]"); @@ -141,8 +159,7 @@ OpenAPI_cn_assisted_ran_para_t *OpenAPI_cn_assisted_ran_para_parseFromJSON(cJSON } } - cJSON *periodic_time = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "periodicTime"); - + periodic_time = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "periodicTime"); if (periodic_time) { if (!cJSON_IsNumber(periodic_time)) { ogs_error("OpenAPI_cn_assisted_ran_para_parseFromJSON() failed [periodic_time]"); @@ -150,16 +167,12 @@ OpenAPI_cn_assisted_ran_para_t *OpenAPI_cn_assisted_ran_para_parseFromJSON(cJSON } } - cJSON *scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "scheduledCommunicationTime"); - - OpenAPI_scheduled_communication_time_t *scheduled_communication_time_local_nonprim = NULL; + scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "scheduledCommunicationTime"); if (scheduled_communication_time) { scheduled_communication_time_local_nonprim = OpenAPI_scheduled_communication_time_parseFromJSON(scheduled_communication_time); } - cJSON *scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "scheduledCommunicationType"); - - OpenAPI_scheduled_communication_type_e scheduled_communication_typeVariable; + scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "scheduledCommunicationType"); if (scheduled_communication_type) { if (!cJSON_IsString(scheduled_communication_type)) { ogs_error("OpenAPI_cn_assisted_ran_para_parseFromJSON() failed [scheduled_communication_type]"); @@ -168,9 +181,7 @@ OpenAPI_cn_assisted_ran_para_t *OpenAPI_cn_assisted_ran_para_parseFromJSON(cJSON scheduled_communication_typeVariable = OpenAPI_scheduled_communication_type_FromString(scheduled_communication_type->valuestring); } - cJSON *traffic_profile = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "trafficProfile"); - - OpenAPI_traffic_profile_e traffic_profileVariable; + traffic_profile = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "trafficProfile"); if (traffic_profile) { if (!cJSON_IsString(traffic_profile)) { ogs_error("OpenAPI_cn_assisted_ran_para_parseFromJSON() failed [traffic_profile]"); @@ -179,9 +190,7 @@ OpenAPI_cn_assisted_ran_para_t *OpenAPI_cn_assisted_ran_para_parseFromJSON(cJSON traffic_profileVariable = OpenAPI_traffic_profile_FromString(traffic_profile->valuestring); } - cJSON *battery_indication = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "batteryIndication"); - - OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL; + battery_indication = cJSON_GetObjectItemCaseSensitive(cn_assisted_ran_paraJSON, "batteryIndication"); if (battery_indication) { battery_indication_local_nonprim = OpenAPI_battery_indication_parseFromJSON(battery_indication); } @@ -200,6 +209,14 @@ OpenAPI_cn_assisted_ran_para_t *OpenAPI_cn_assisted_ran_para_parseFromJSON(cJSON return cn_assisted_ran_para_local_var; end: + if (scheduled_communication_time_local_nonprim) { + OpenAPI_scheduled_communication_time_free(scheduled_communication_time_local_nonprim); + scheduled_communication_time_local_nonprim = NULL; + } + if (battery_indication_local_nonprim) { + OpenAPI_battery_indication_free(battery_indication_local_nonprim); + battery_indication_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cnf.c b/lib/sbi/openapi/model/cnf.c index b5e122849..8158dafda 100644 --- a/lib/sbi/openapi/model/cnf.c +++ b/lib/sbi/openapi/model/cnf.c @@ -18,20 +18,25 @@ OpenAPI_cnf_t *OpenAPI_cnf_create( void OpenAPI_cnf_free(OpenAPI_cnf_t *cnf) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cnf) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(cnf->cnf_units, node) { - OpenAPI_cnf_unit_free(node->data); + if (cnf->cnf_units) { + OpenAPI_list_for_each(cnf->cnf_units, node) { + OpenAPI_cnf_unit_free(node->data); + } + OpenAPI_list_free(cnf->cnf_units); + cnf->cnf_units = NULL; } - OpenAPI_list_free(cnf->cnf_units); ogs_free(cnf); } cJSON *OpenAPI_cnf_convertToJSON(OpenAPI_cnf_t *cnf) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cnf == NULL) { ogs_error("OpenAPI_cnf_convertToJSON() failed [Cnf]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_cnf_convertToJSON(OpenAPI_cnf_t *cnf) } item = cJSON_CreateObject(); + if (!cnf->cnf_units) { + ogs_error("OpenAPI_cnf_convertToJSON() failed [cnf_units]"); + return NULL; + } cJSON *cnf_unitsList = cJSON_AddArrayToObject(item, "cnfUnits"); if (cnf_unitsList == NULL) { ogs_error("OpenAPI_cnf_convertToJSON() failed [cnf_units]"); goto end; } - - OpenAPI_lnode_t *cnf_units_node; - if (cnf->cnf_units) { - OpenAPI_list_for_each(cnf->cnf_units, cnf_units_node) { - cJSON *itemLocal = OpenAPI_cnf_unit_convertToJSON(cnf_units_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_cnf_convertToJSON() failed [cnf_units]"); - goto end; - } - cJSON_AddItemToArray(cnf_unitsList, itemLocal); + OpenAPI_list_for_each(cnf->cnf_units, node) { + cJSON *itemLocal = OpenAPI_cnf_unit_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_cnf_convertToJSON() failed [cnf_units]"); + goto end; } + cJSON_AddItemToArray(cnf_unitsList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_cnf_t *OpenAPI_cnf_parseFromJSON(cJSON *cnfJSON) { OpenAPI_cnf_t *cnf_local_var = NULL; - cJSON *cnf_units = cJSON_GetObjectItemCaseSensitive(cnfJSON, "cnfUnits"); + OpenAPI_lnode_t *node = NULL; + cJSON *cnf_units = NULL; + OpenAPI_list_t *cnf_unitsList = NULL; + cnf_units = cJSON_GetObjectItemCaseSensitive(cnfJSON, "cnfUnits"); if (!cnf_units) { ogs_error("OpenAPI_cnf_parseFromJSON() failed [cnf_units]"); goto end; } - - OpenAPI_list_t *cnf_unitsList; - cJSON *cnf_units_local_nonprimitive; - if (!cJSON_IsArray(cnf_units)){ - ogs_error("OpenAPI_cnf_parseFromJSON() failed [cnf_units]"); - goto end; - } - - cnf_unitsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(cnf_units_local_nonprimitive, cnf_units ) { - if (!cJSON_IsObject(cnf_units_local_nonprimitive)) { + cJSON *cnf_units_local = NULL; + if (!cJSON_IsArray(cnf_units)) { ogs_error("OpenAPI_cnf_parseFromJSON() failed [cnf_units]"); goto end; } - OpenAPI_cnf_unit_t *cnf_unitsItem = OpenAPI_cnf_unit_parseFromJSON(cnf_units_local_nonprimitive); - if (!cnf_unitsItem) { - ogs_error("No cnf_unitsItem"); - OpenAPI_list_free(cnf_unitsList); - goto end; + cnf_unitsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cnf_units_local, cnf_units) { + if (!cJSON_IsObject(cnf_units_local)) { + ogs_error("OpenAPI_cnf_parseFromJSON() failed [cnf_units]"); + goto end; + } + OpenAPI_cnf_unit_t *cnf_unitsItem = OpenAPI_cnf_unit_parseFromJSON(cnf_units_local); + if (!cnf_unitsItem) { + ogs_error("No cnf_unitsItem"); + OpenAPI_list_free(cnf_unitsList); + goto end; + } + OpenAPI_list_add(cnf_unitsList, cnf_unitsItem); } - OpenAPI_list_add(cnf_unitsList, cnf_unitsItem); - } - cnf_local_var = OpenAPI_cnf_create ( cnf_unitsList ); return cnf_local_var; end: + if (cnf_unitsList) { + OpenAPI_list_for_each(cnf_unitsList, node) { + OpenAPI_cnf_unit_free(node->data); + } + OpenAPI_list_free(cnf_unitsList); + cnf_unitsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/cnf_unit.c b/lib/sbi/openapi/model/cnf_unit.c index 825870c7b..189fca64c 100644 --- a/lib/sbi/openapi/model/cnf_unit.c +++ b/lib/sbi/openapi/model/cnf_unit.c @@ -18,20 +18,25 @@ OpenAPI_cnf_unit_t *OpenAPI_cnf_unit_create( void OpenAPI_cnf_unit_free(OpenAPI_cnf_unit_t *cnf_unit) { + OpenAPI_lnode_t *node = NULL; + if (NULL == cnf_unit) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(cnf_unit->cnf_unit, node) { - OpenAPI_atom_free(node->data); + if (cnf_unit->cnf_unit) { + OpenAPI_list_for_each(cnf_unit->cnf_unit, node) { + OpenAPI_atom_free(node->data); + } + OpenAPI_list_free(cnf_unit->cnf_unit); + cnf_unit->cnf_unit = NULL; } - OpenAPI_list_free(cnf_unit->cnf_unit); ogs_free(cnf_unit); } cJSON *OpenAPI_cnf_unit_convertToJSON(OpenAPI_cnf_unit_t *cnf_unit) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (cnf_unit == NULL) { ogs_error("OpenAPI_cnf_unit_convertToJSON() failed [CnfUnit]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_cnf_unit_convertToJSON(OpenAPI_cnf_unit_t *cnf_unit) } item = cJSON_CreateObject(); + if (!cnf_unit->cnf_unit) { + ogs_error("OpenAPI_cnf_unit_convertToJSON() failed [cnf_unit]"); + return NULL; + } cJSON *cnf_unitList = cJSON_AddArrayToObject(item, "cnfUnit"); if (cnf_unitList == NULL) { ogs_error("OpenAPI_cnf_unit_convertToJSON() failed [cnf_unit]"); goto end; } - - OpenAPI_lnode_t *cnf_unit_node; - if (cnf_unit->cnf_unit) { - OpenAPI_list_for_each(cnf_unit->cnf_unit, cnf_unit_node) { - cJSON *itemLocal = OpenAPI_atom_convertToJSON(cnf_unit_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_cnf_unit_convertToJSON() failed [cnf_unit]"); - goto end; - } - cJSON_AddItemToArray(cnf_unitList, itemLocal); + OpenAPI_list_for_each(cnf_unit->cnf_unit, node) { + cJSON *itemLocal = OpenAPI_atom_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_cnf_unit_convertToJSON() failed [cnf_unit]"); + goto end; } + cJSON_AddItemToArray(cnf_unitList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_cnf_unit_t *OpenAPI_cnf_unit_parseFromJSON(cJSON *cnf_unitJSON) { OpenAPI_cnf_unit_t *cnf_unit_local_var = NULL; - cJSON *cnf_unit = cJSON_GetObjectItemCaseSensitive(cnf_unitJSON, "cnfUnit"); + OpenAPI_lnode_t *node = NULL; + cJSON *cnf_unit = NULL; + OpenAPI_list_t *cnf_unitList = NULL; + cnf_unit = cJSON_GetObjectItemCaseSensitive(cnf_unitJSON, "cnfUnit"); if (!cnf_unit) { ogs_error("OpenAPI_cnf_unit_parseFromJSON() failed [cnf_unit]"); goto end; } - - OpenAPI_list_t *cnf_unitList; - cJSON *cnf_unit_local_nonprimitive; - if (!cJSON_IsArray(cnf_unit)){ - ogs_error("OpenAPI_cnf_unit_parseFromJSON() failed [cnf_unit]"); - goto end; - } - - cnf_unitList = OpenAPI_list_create(); - - cJSON_ArrayForEach(cnf_unit_local_nonprimitive, cnf_unit ) { - if (!cJSON_IsObject(cnf_unit_local_nonprimitive)) { + cJSON *cnf_unit_local = NULL; + if (!cJSON_IsArray(cnf_unit)) { ogs_error("OpenAPI_cnf_unit_parseFromJSON() failed [cnf_unit]"); goto end; } - OpenAPI_atom_t *cnf_unitItem = OpenAPI_atom_parseFromJSON(cnf_unit_local_nonprimitive); - if (!cnf_unitItem) { - ogs_error("No cnf_unitItem"); - OpenAPI_list_free(cnf_unitList); - goto end; + cnf_unitList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cnf_unit_local, cnf_unit) { + if (!cJSON_IsObject(cnf_unit_local)) { + ogs_error("OpenAPI_cnf_unit_parseFromJSON() failed [cnf_unit]"); + goto end; + } + OpenAPI_atom_t *cnf_unitItem = OpenAPI_atom_parseFromJSON(cnf_unit_local); + if (!cnf_unitItem) { + ogs_error("No cnf_unitItem"); + OpenAPI_list_free(cnf_unitList); + goto end; + } + OpenAPI_list_add(cnf_unitList, cnf_unitItem); } - OpenAPI_list_add(cnf_unitList, cnf_unitItem); - } - cnf_unit_local_var = OpenAPI_cnf_unit_create ( cnf_unitList ); return cnf_unit_local_var; end: + if (cnf_unitList) { + OpenAPI_list_for_each(cnf_unitList, node) { + OpenAPI_atom_free(node->data); + } + OpenAPI_list_free(cnf_unitList); + cnf_unitList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/collection_period_rmm_lte_mdt.c b/lib/sbi/openapi/model/collection_period_rmm_lte_mdt.c index 1f335626b..0d2de4476 100644 --- a/lib/sbi/openapi/model/collection_period_rmm_lte_mdt.c +++ b/lib/sbi/openapi/model/collection_period_rmm_lte_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_collection_period_rmm_lte_mdt_ToString(OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lte_mdt) { - const char *collection_period_rmm_lte_mdtArray[] = { "NULL", "_1024", "_1280", "_2048", "_2560", "_5120", "_10240", "_60000" }; + const char *collection_period_rmm_lte_mdtArray[] = { "NULL", "1024", "1280", "2048", "2560", "5120", "10240", "60000" }; size_t sizeofArray = sizeof(collection_period_rmm_lte_mdtArray) / sizeof(collection_period_rmm_lte_mdtArray[0]); if (collection_period_rmm_lte_mdt < sizeofArray) return (char *)collection_period_rmm_lte_mdtArray[collection_period_rmm_lte_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_collection_period_rmm_lte_mdt_ToString(OpenAPI_collection_period_r OpenAPI_collection_period_rmm_lte_mdt_e OpenAPI_collection_period_rmm_lte_mdt_FromString(char* collection_period_rmm_lte_mdt) { int stringToReturn = 0; - const char *collection_period_rmm_lte_mdtArray[] = { "NULL", "_1024", "_1280", "_2048", "_2560", "_5120", "_10240", "_60000" }; + const char *collection_period_rmm_lte_mdtArray[] = { "NULL", "1024", "1280", "2048", "2560", "5120", "10240", "60000" }; size_t sizeofArray = sizeof(collection_period_rmm_lte_mdtArray) / sizeof(collection_period_rmm_lte_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(collection_period_rmm_lte_mdt, collection_period_rmm_lte_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/collection_period_rmm_nr_mdt.c b/lib/sbi/openapi/model/collection_period_rmm_nr_mdt.c index bc5be6288..f5a4c846e 100644 --- a/lib/sbi/openapi/model/collection_period_rmm_nr_mdt.c +++ b/lib/sbi/openapi/model/collection_period_rmm_nr_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_collection_period_rmm_nr_mdt_ToString(OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nr_mdt) { - const char *collection_period_rmm_nr_mdtArray[] = { "NULL", "_1024", "_2048", "_5120", "_10240", "_60000" }; + const char *collection_period_rmm_nr_mdtArray[] = { "NULL", "1024", "2048", "5120", "10240", "60000" }; size_t sizeofArray = sizeof(collection_period_rmm_nr_mdtArray) / sizeof(collection_period_rmm_nr_mdtArray[0]); if (collection_period_rmm_nr_mdt < sizeofArray) return (char *)collection_period_rmm_nr_mdtArray[collection_period_rmm_nr_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_collection_period_rmm_nr_mdt_ToString(OpenAPI_collection_period_rm OpenAPI_collection_period_rmm_nr_mdt_e OpenAPI_collection_period_rmm_nr_mdt_FromString(char* collection_period_rmm_nr_mdt) { int stringToReturn = 0; - const char *collection_period_rmm_nr_mdtArray[] = { "NULL", "_1024", "_2048", "_5120", "_10240", "_60000" }; + const char *collection_period_rmm_nr_mdtArray[] = { "NULL", "1024", "2048", "5120", "10240", "60000" }; size_t sizeofArray = sizeof(collection_period_rmm_nr_mdtArray) / sizeof(collection_period_rmm_nr_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(collection_period_rmm_nr_mdt, collection_period_rmm_nr_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/communication_characteristics.c b/lib/sbi/openapi/model/communication_characteristics.c index 704a46da9..2fc002f73 100644 --- a/lib/sbi/openapi/model/communication_characteristics.c +++ b/lib/sbi/openapi/model/communication_characteristics.c @@ -30,21 +30,38 @@ OpenAPI_communication_characteristics_t *OpenAPI_communication_characteristics_c void OpenAPI_communication_characteristics_free(OpenAPI_communication_characteristics_t *communication_characteristics) { + OpenAPI_lnode_t *node = NULL; + if (NULL == communication_characteristics) { return; } - OpenAPI_lnode_t *node; - OpenAPI_pp_subs_reg_timer_free(communication_characteristics->pp_subs_reg_timer); - OpenAPI_pp_active_time_free(communication_characteristics->pp_active_time); - OpenAPI_pp_dl_packet_count_ext_free(communication_characteristics->pp_dl_packet_count_ext); - OpenAPI_pp_maximum_response_time_free(communication_characteristics->pp_maximum_response_time); - OpenAPI_pp_maximum_latency_free(communication_characteristics->pp_maximum_latency); + if (communication_characteristics->pp_subs_reg_timer) { + OpenAPI_pp_subs_reg_timer_free(communication_characteristics->pp_subs_reg_timer); + communication_characteristics->pp_subs_reg_timer = NULL; + } + if (communication_characteristics->pp_active_time) { + OpenAPI_pp_active_time_free(communication_characteristics->pp_active_time); + communication_characteristics->pp_active_time = NULL; + } + if (communication_characteristics->pp_dl_packet_count_ext) { + OpenAPI_pp_dl_packet_count_ext_free(communication_characteristics->pp_dl_packet_count_ext); + communication_characteristics->pp_dl_packet_count_ext = NULL; + } + if (communication_characteristics->pp_maximum_response_time) { + OpenAPI_pp_maximum_response_time_free(communication_characteristics->pp_maximum_response_time); + communication_characteristics->pp_maximum_response_time = NULL; + } + if (communication_characteristics->pp_maximum_latency) { + OpenAPI_pp_maximum_latency_free(communication_characteristics->pp_maximum_latency); + communication_characteristics->pp_maximum_latency = NULL; + } ogs_free(communication_characteristics); } cJSON *OpenAPI_communication_characteristics_convertToJSON(OpenAPI_communication_characteristics_t *communication_characteristics) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (communication_characteristics == NULL) { ogs_error("OpenAPI_communication_characteristics_convertToJSON() failed [CommunicationCharacteristics]"); @@ -131,22 +148,29 @@ end: OpenAPI_communication_characteristics_t *OpenAPI_communication_characteristics_parseFromJSON(cJSON *communication_characteristicsJSON) { OpenAPI_communication_characteristics_t *communication_characteristics_local_var = NULL; - cJSON *pp_subs_reg_timer = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppSubsRegTimer"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pp_subs_reg_timer = NULL; OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer_local_nonprim = NULL; + cJSON *pp_active_time = NULL; + OpenAPI_pp_active_time_t *pp_active_time_local_nonprim = NULL; + cJSON *pp_dl_packet_count = NULL; + cJSON *pp_dl_packet_count_ext = NULL; + OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext_local_nonprim = NULL; + cJSON *pp_maximum_response_time = NULL; + OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time_local_nonprim = NULL; + cJSON *pp_maximum_latency = NULL; + OpenAPI_pp_maximum_latency_t *pp_maximum_latency_local_nonprim = NULL; + pp_subs_reg_timer = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppSubsRegTimer"); if (pp_subs_reg_timer) { pp_subs_reg_timer_local_nonprim = OpenAPI_pp_subs_reg_timer_parseFromJSON(pp_subs_reg_timer); } - cJSON *pp_active_time = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppActiveTime"); - - OpenAPI_pp_active_time_t *pp_active_time_local_nonprim = NULL; + pp_active_time = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppActiveTime"); if (pp_active_time) { pp_active_time_local_nonprim = OpenAPI_pp_active_time_parseFromJSON(pp_active_time); } - cJSON *pp_dl_packet_count = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppDlPacketCount"); - + pp_dl_packet_count = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppDlPacketCount"); if (pp_dl_packet_count) { if (!cJSON_IsNumber(pp_dl_packet_count)) { ogs_error("OpenAPI_communication_characteristics_parseFromJSON() failed [pp_dl_packet_count]"); @@ -154,23 +178,17 @@ OpenAPI_communication_characteristics_t *OpenAPI_communication_characteristics_p } } - cJSON *pp_dl_packet_count_ext = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppDlPacketCountExt"); - - OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext_local_nonprim = NULL; + pp_dl_packet_count_ext = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppDlPacketCountExt"); if (pp_dl_packet_count_ext) { pp_dl_packet_count_ext_local_nonprim = OpenAPI_pp_dl_packet_count_ext_parseFromJSON(pp_dl_packet_count_ext); } - cJSON *pp_maximum_response_time = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppMaximumResponseTime"); - - OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time_local_nonprim = NULL; + pp_maximum_response_time = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppMaximumResponseTime"); if (pp_maximum_response_time) { pp_maximum_response_time_local_nonprim = OpenAPI_pp_maximum_response_time_parseFromJSON(pp_maximum_response_time); } - cJSON *pp_maximum_latency = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppMaximumLatency"); - - OpenAPI_pp_maximum_latency_t *pp_maximum_latency_local_nonprim = NULL; + pp_maximum_latency = cJSON_GetObjectItemCaseSensitive(communication_characteristicsJSON, "ppMaximumLatency"); if (pp_maximum_latency) { pp_maximum_latency_local_nonprim = OpenAPI_pp_maximum_latency_parseFromJSON(pp_maximum_latency); } @@ -187,6 +205,26 @@ OpenAPI_communication_characteristics_t *OpenAPI_communication_characteristics_p return communication_characteristics_local_var; end: + if (pp_subs_reg_timer_local_nonprim) { + OpenAPI_pp_subs_reg_timer_free(pp_subs_reg_timer_local_nonprim); + pp_subs_reg_timer_local_nonprim = NULL; + } + if (pp_active_time_local_nonprim) { + OpenAPI_pp_active_time_free(pp_active_time_local_nonprim); + pp_active_time_local_nonprim = NULL; + } + if (pp_dl_packet_count_ext_local_nonprim) { + OpenAPI_pp_dl_packet_count_ext_free(pp_dl_packet_count_ext_local_nonprim); + pp_dl_packet_count_ext_local_nonprim = NULL; + } + if (pp_maximum_response_time_local_nonprim) { + OpenAPI_pp_maximum_response_time_free(pp_maximum_response_time_local_nonprim); + pp_maximum_response_time_local_nonprim = NULL; + } + if (pp_maximum_latency_local_nonprim) { + OpenAPI_pp_maximum_latency_free(pp_maximum_latency_local_nonprim); + pp_maximum_latency_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/complex_query.c b/lib/sbi/openapi/model/complex_query.c index c36c9f445..04f10febd 100644 --- a/lib/sbi/openapi/model/complex_query.c +++ b/lib/sbi/openapi/model/complex_query.c @@ -20,24 +20,32 @@ OpenAPI_complex_query_t *OpenAPI_complex_query_create( void OpenAPI_complex_query_free(OpenAPI_complex_query_t *complex_query) { + OpenAPI_lnode_t *node = NULL; + if (NULL == complex_query) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(complex_query->cnf_units, node) { - OpenAPI_cnf_unit_free(node->data); + if (complex_query->cnf_units) { + OpenAPI_list_for_each(complex_query->cnf_units, node) { + OpenAPI_cnf_unit_free(node->data); + } + OpenAPI_list_free(complex_query->cnf_units); + complex_query->cnf_units = NULL; } - OpenAPI_list_free(complex_query->cnf_units); - OpenAPI_list_for_each(complex_query->dnf_units, node) { - OpenAPI_dnf_unit_free(node->data); + if (complex_query->dnf_units) { + OpenAPI_list_for_each(complex_query->dnf_units, node) { + OpenAPI_dnf_unit_free(node->data); + } + OpenAPI_list_free(complex_query->dnf_units); + complex_query->dnf_units = NULL; } - OpenAPI_list_free(complex_query->dnf_units); ogs_free(complex_query); } cJSON *OpenAPI_complex_query_convertToJSON(OpenAPI_complex_query_t *complex_query) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (complex_query == NULL) { ogs_error("OpenAPI_complex_query_convertToJSON() failed [ComplexQuery]"); @@ -45,40 +53,40 @@ cJSON *OpenAPI_complex_query_convertToJSON(OpenAPI_complex_query_t *complex_quer } item = cJSON_CreateObject(); + if (!complex_query->cnf_units) { + ogs_error("OpenAPI_complex_query_convertToJSON() failed [cnf_units]"); + return NULL; + } cJSON *cnf_unitsList = cJSON_AddArrayToObject(item, "cnfUnits"); if (cnf_unitsList == NULL) { ogs_error("OpenAPI_complex_query_convertToJSON() failed [cnf_units]"); goto end; } - - OpenAPI_lnode_t *cnf_units_node; - if (complex_query->cnf_units) { - OpenAPI_list_for_each(complex_query->cnf_units, cnf_units_node) { - cJSON *itemLocal = OpenAPI_cnf_unit_convertToJSON(cnf_units_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_complex_query_convertToJSON() failed [cnf_units]"); - goto end; - } - cJSON_AddItemToArray(cnf_unitsList, itemLocal); + OpenAPI_list_for_each(complex_query->cnf_units, node) { + cJSON *itemLocal = OpenAPI_cnf_unit_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_complex_query_convertToJSON() failed [cnf_units]"); + goto end; } + cJSON_AddItemToArray(cnf_unitsList, itemLocal); } + if (!complex_query->dnf_units) { + ogs_error("OpenAPI_complex_query_convertToJSON() failed [dnf_units]"); + return NULL; + } cJSON *dnf_unitsList = cJSON_AddArrayToObject(item, "dnfUnits"); if (dnf_unitsList == NULL) { ogs_error("OpenAPI_complex_query_convertToJSON() failed [dnf_units]"); goto end; } - - OpenAPI_lnode_t *dnf_units_node; - if (complex_query->dnf_units) { - OpenAPI_list_for_each(complex_query->dnf_units, dnf_units_node) { - cJSON *itemLocal = OpenAPI_dnf_unit_convertToJSON(dnf_units_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_complex_query_convertToJSON() failed [dnf_units]"); - goto end; - } - cJSON_AddItemToArray(dnf_unitsList, itemLocal); + OpenAPI_list_for_each(complex_query->dnf_units, node) { + cJSON *itemLocal = OpenAPI_dnf_unit_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_complex_query_convertToJSON() failed [dnf_units]"); + goto end; } + cJSON_AddItemToArray(dnf_unitsList, itemLocal); } end: @@ -88,68 +96,65 @@ end: OpenAPI_complex_query_t *OpenAPI_complex_query_parseFromJSON(cJSON *complex_queryJSON) { OpenAPI_complex_query_t *complex_query_local_var = NULL; - cJSON *cnf_units = cJSON_GetObjectItemCaseSensitive(complex_queryJSON, "cnfUnits"); + OpenAPI_lnode_t *node = NULL; + cJSON *cnf_units = NULL; + OpenAPI_list_t *cnf_unitsList = NULL; + cJSON *dnf_units = NULL; + OpenAPI_list_t *dnf_unitsList = NULL; + cnf_units = cJSON_GetObjectItemCaseSensitive(complex_queryJSON, "cnfUnits"); if (!cnf_units) { ogs_error("OpenAPI_complex_query_parseFromJSON() failed [cnf_units]"); goto end; } - - OpenAPI_list_t *cnf_unitsList; - cJSON *cnf_units_local_nonprimitive; - if (!cJSON_IsArray(cnf_units)){ - ogs_error("OpenAPI_complex_query_parseFromJSON() failed [cnf_units]"); - goto end; - } - - cnf_unitsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(cnf_units_local_nonprimitive, cnf_units ) { - if (!cJSON_IsObject(cnf_units_local_nonprimitive)) { + cJSON *cnf_units_local = NULL; + if (!cJSON_IsArray(cnf_units)) { ogs_error("OpenAPI_complex_query_parseFromJSON() failed [cnf_units]"); goto end; } - OpenAPI_cnf_unit_t *cnf_unitsItem = OpenAPI_cnf_unit_parseFromJSON(cnf_units_local_nonprimitive); - if (!cnf_unitsItem) { - ogs_error("No cnf_unitsItem"); - OpenAPI_list_free(cnf_unitsList); - goto end; + cnf_unitsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cnf_units_local, cnf_units) { + if (!cJSON_IsObject(cnf_units_local)) { + ogs_error("OpenAPI_complex_query_parseFromJSON() failed [cnf_units]"); + goto end; + } + OpenAPI_cnf_unit_t *cnf_unitsItem = OpenAPI_cnf_unit_parseFromJSON(cnf_units_local); + if (!cnf_unitsItem) { + ogs_error("No cnf_unitsItem"); + OpenAPI_list_free(cnf_unitsList); + goto end; + } + OpenAPI_list_add(cnf_unitsList, cnf_unitsItem); } - OpenAPI_list_add(cnf_unitsList, cnf_unitsItem); - } - - cJSON *dnf_units = cJSON_GetObjectItemCaseSensitive(complex_queryJSON, "dnfUnits"); + dnf_units = cJSON_GetObjectItemCaseSensitive(complex_queryJSON, "dnfUnits"); if (!dnf_units) { ogs_error("OpenAPI_complex_query_parseFromJSON() failed [dnf_units]"); goto end; } - - OpenAPI_list_t *dnf_unitsList; - cJSON *dnf_units_local_nonprimitive; - if (!cJSON_IsArray(dnf_units)){ - ogs_error("OpenAPI_complex_query_parseFromJSON() failed [dnf_units]"); - goto end; - } - - dnf_unitsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(dnf_units_local_nonprimitive, dnf_units ) { - if (!cJSON_IsObject(dnf_units_local_nonprimitive)) { + cJSON *dnf_units_local = NULL; + if (!cJSON_IsArray(dnf_units)) { ogs_error("OpenAPI_complex_query_parseFromJSON() failed [dnf_units]"); goto end; } - OpenAPI_dnf_unit_t *dnf_unitsItem = OpenAPI_dnf_unit_parseFromJSON(dnf_units_local_nonprimitive); - if (!dnf_unitsItem) { - ogs_error("No dnf_unitsItem"); - OpenAPI_list_free(dnf_unitsList); - goto end; + dnf_unitsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnf_units_local, dnf_units) { + if (!cJSON_IsObject(dnf_units_local)) { + ogs_error("OpenAPI_complex_query_parseFromJSON() failed [dnf_units]"); + goto end; + } + OpenAPI_dnf_unit_t *dnf_unitsItem = OpenAPI_dnf_unit_parseFromJSON(dnf_units_local); + if (!dnf_unitsItem) { + ogs_error("No dnf_unitsItem"); + OpenAPI_list_free(dnf_unitsList); + goto end; + } + OpenAPI_list_add(dnf_unitsList, dnf_unitsItem); } - OpenAPI_list_add(dnf_unitsList, dnf_unitsItem); - } - complex_query_local_var = OpenAPI_complex_query_create ( cnf_unitsList, dnf_unitsList @@ -157,6 +162,20 @@ OpenAPI_complex_query_t *OpenAPI_complex_query_parseFromJSON(cJSON *complex_quer return complex_query_local_var; end: + if (cnf_unitsList) { + OpenAPI_list_for_each(cnf_unitsList, node) { + OpenAPI_cnf_unit_free(node->data); + } + OpenAPI_list_free(cnf_unitsList); + cnf_unitsList = NULL; + } + if (dnf_unitsList) { + OpenAPI_list_for_each(dnf_unitsList, node) { + OpenAPI_dnf_unit_free(node->data); + } + OpenAPI_list_free(dnf_unitsList); + dnf_unitsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/condition_data.c b/lib/sbi/openapi/model/condition_data.c index cb5887042..40d535aed 100644 --- a/lib/sbi/openapi/model/condition_data.c +++ b/lib/sbi/openapi/model/condition_data.c @@ -26,19 +26,30 @@ OpenAPI_condition_data_t *OpenAPI_condition_data_create( void OpenAPI_condition_data_free(OpenAPI_condition_data_t *condition_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == condition_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(condition_data->cond_id); - ogs_free(condition_data->activation_time); - ogs_free(condition_data->deactivation_time); + if (condition_data->cond_id) { + ogs_free(condition_data->cond_id); + condition_data->cond_id = NULL; + } + if (condition_data->activation_time) { + ogs_free(condition_data->activation_time); + condition_data->activation_time = NULL; + } + if (condition_data->deactivation_time) { + ogs_free(condition_data->deactivation_time); + condition_data->deactivation_time = NULL; + } ogs_free(condition_data); } cJSON *OpenAPI_condition_data_convertToJSON(OpenAPI_condition_data_t *condition_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (condition_data == NULL) { ogs_error("OpenAPI_condition_data_convertToJSON() failed [ConditionData]"); @@ -46,6 +57,10 @@ cJSON *OpenAPI_condition_data_convertToJSON(OpenAPI_condition_data_t *condition_ } item = cJSON_CreateObject(); + if (!condition_data->cond_id) { + ogs_error("OpenAPI_condition_data_convertToJSON() failed [cond_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "condId", condition_data->cond_id) == NULL) { ogs_error("OpenAPI_condition_data_convertToJSON() failed [cond_id]"); goto end; @@ -65,14 +80,14 @@ cJSON *OpenAPI_condition_data_convertToJSON(OpenAPI_condition_data_t *condition_ } } - if (condition_data->access_type) { + if (condition_data->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(condition_data->access_type)) == NULL) { ogs_error("OpenAPI_condition_data_convertToJSON() failed [access_type]"); goto end; } } - if (condition_data->rat_type) { + if (condition_data->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(condition_data->rat_type)) == NULL) { ogs_error("OpenAPI_condition_data_convertToJSON() failed [rat_type]"); goto end; @@ -86,38 +101,41 @@ end: OpenAPI_condition_data_t *OpenAPI_condition_data_parseFromJSON(cJSON *condition_dataJSON) { OpenAPI_condition_data_t *condition_data_local_var = NULL; - cJSON *cond_id = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "condId"); + OpenAPI_lnode_t *node = NULL; + cJSON *cond_id = NULL; + cJSON *activation_time = NULL; + cJSON *deactivation_time = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cond_id = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "condId"); if (!cond_id) { ogs_error("OpenAPI_condition_data_parseFromJSON() failed [cond_id]"); goto end; } - if (!cJSON_IsString(cond_id)) { ogs_error("OpenAPI_condition_data_parseFromJSON() failed [cond_id]"); goto end; } - cJSON *activation_time = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "activationTime"); - + activation_time = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "activationTime"); if (activation_time) { - if (!cJSON_IsString(activation_time)) { + if (!cJSON_IsString(activation_time) && !cJSON_IsNull(activation_time)) { ogs_error("OpenAPI_condition_data_parseFromJSON() failed [activation_time]"); goto end; } } - cJSON *deactivation_time = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "deactivationTime"); - + deactivation_time = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "deactivationTime"); if (deactivation_time) { - if (!cJSON_IsString(deactivation_time)) { + if (!cJSON_IsString(deactivation_time) && !cJSON_IsNull(deactivation_time)) { ogs_error("OpenAPI_condition_data_parseFromJSON() failed [deactivation_time]"); goto end; } } - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + access_type = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_condition_data_parseFromJSON() failed [access_type]"); @@ -126,9 +144,7 @@ OpenAPI_condition_data_t *OpenAPI_condition_data_parseFromJSON(cJSON *condition_ access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(condition_dataJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_condition_data_parseFromJSON() failed [rat_type]"); @@ -139,8 +155,8 @@ OpenAPI_condition_data_t *OpenAPI_condition_data_parseFromJSON(cJSON *condition_ condition_data_local_var = OpenAPI_condition_data_create ( ogs_strdup(cond_id->valuestring), - activation_time ? ogs_strdup(activation_time->valuestring) : NULL, - deactivation_time ? ogs_strdup(deactivation_time->valuestring) : NULL, + activation_time && !cJSON_IsNull(activation_time) ? ogs_strdup(activation_time->valuestring) : NULL, + deactivation_time && !cJSON_IsNull(deactivation_time) ? ogs_strdup(deactivation_time->valuestring) : NULL, access_type ? access_typeVariable : 0, rat_type ? rat_typeVariable : 0 ); diff --git a/lib/sbi/openapi/model/configured_snssai.c b/lib/sbi/openapi/model/configured_snssai.c index 4db5f2df0..cfbb6115c 100644 --- a/lib/sbi/openapi/model/configured_snssai.c +++ b/lib/sbi/openapi/model/configured_snssai.c @@ -20,18 +20,26 @@ OpenAPI_configured_snssai_t *OpenAPI_configured_snssai_create( void OpenAPI_configured_snssai_free(OpenAPI_configured_snssai_t *configured_snssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == configured_snssai) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(configured_snssai->configured_snssai); - OpenAPI_snssai_free(configured_snssai->mapped_home_snssai); + if (configured_snssai->configured_snssai) { + OpenAPI_snssai_free(configured_snssai->configured_snssai); + configured_snssai->configured_snssai = NULL; + } + if (configured_snssai->mapped_home_snssai) { + OpenAPI_snssai_free(configured_snssai->mapped_home_snssai); + configured_snssai->mapped_home_snssai = NULL; + } ogs_free(configured_snssai); } cJSON *OpenAPI_configured_snssai_convertToJSON(OpenAPI_configured_snssai_t *configured_snssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (configured_snssai == NULL) { ogs_error("OpenAPI_configured_snssai_convertToJSON() failed [ConfiguredSnssai]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_configured_snssai_convertToJSON(OpenAPI_configured_snssai_t *conf } item = cJSON_CreateObject(); + if (!configured_snssai->configured_snssai) { + ogs_error("OpenAPI_configured_snssai_convertToJSON() failed [configured_snssai]"); + return NULL; + } cJSON *configured_snssai_local_JSON = OpenAPI_snssai_convertToJSON(configured_snssai->configured_snssai); if (configured_snssai_local_JSON == NULL) { ogs_error("OpenAPI_configured_snssai_convertToJSON() failed [configured_snssai]"); @@ -70,18 +82,19 @@ end: OpenAPI_configured_snssai_t *OpenAPI_configured_snssai_parseFromJSON(cJSON *configured_snssaiJSON) { OpenAPI_configured_snssai_t *configured_snssai_local_var = NULL; - cJSON *configured_snssai = cJSON_GetObjectItemCaseSensitive(configured_snssaiJSON, "configuredSnssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *configured_snssai = NULL; + OpenAPI_snssai_t *configured_snssai_local_nonprim = NULL; + cJSON *mapped_home_snssai = NULL; + OpenAPI_snssai_t *mapped_home_snssai_local_nonprim = NULL; + configured_snssai = cJSON_GetObjectItemCaseSensitive(configured_snssaiJSON, "configuredSnssai"); if (!configured_snssai) { ogs_error("OpenAPI_configured_snssai_parseFromJSON() failed [configured_snssai]"); goto end; } - - OpenAPI_snssai_t *configured_snssai_local_nonprim = NULL; configured_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(configured_snssai); - cJSON *mapped_home_snssai = cJSON_GetObjectItemCaseSensitive(configured_snssaiJSON, "mappedHomeSnssai"); - - OpenAPI_snssai_t *mapped_home_snssai_local_nonprim = NULL; + mapped_home_snssai = cJSON_GetObjectItemCaseSensitive(configured_snssaiJSON, "mappedHomeSnssai"); if (mapped_home_snssai) { mapped_home_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(mapped_home_snssai); } @@ -93,6 +106,14 @@ OpenAPI_configured_snssai_t *OpenAPI_configured_snssai_parseFromJSON(cJSON *conf return configured_snssai_local_var; end: + if (configured_snssai_local_nonprim) { + OpenAPI_snssai_free(configured_snssai_local_nonprim); + configured_snssai_local_nonprim = NULL; + } + if (mapped_home_snssai_local_nonprim) { + OpenAPI_snssai_free(mapped_home_snssai_local_nonprim); + mapped_home_snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/confirmation_data.c b/lib/sbi/openapi/model/confirmation_data.c index ee0845e86..c3dc93990 100644 --- a/lib/sbi/openapi/model/confirmation_data.c +++ b/lib/sbi/openapi/model/confirmation_data.c @@ -20,18 +20,26 @@ OpenAPI_confirmation_data_t *OpenAPI_confirmation_data_create( void OpenAPI_confirmation_data_free(OpenAPI_confirmation_data_t *confirmation_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == confirmation_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(confirmation_data->res_star); - ogs_free(confirmation_data->supported_features); + if (confirmation_data->res_star) { + ogs_free(confirmation_data->res_star); + confirmation_data->res_star = NULL; + } + if (confirmation_data->supported_features) { + ogs_free(confirmation_data->supported_features); + confirmation_data->supported_features = NULL; + } ogs_free(confirmation_data); } cJSON *OpenAPI_confirmation_data_convertToJSON(OpenAPI_confirmation_data_t *confirmation_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (confirmation_data == NULL) { ogs_error("OpenAPI_confirmation_data_convertToJSON() failed [ConfirmationData]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_confirmation_data_convertToJSON(OpenAPI_confirmation_data_t *conf } item = cJSON_CreateObject(); + if (!confirmation_data->res_star) { + ogs_error("OpenAPI_confirmation_data_convertToJSON() failed [res_star]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resStar", confirmation_data->res_star) == NULL) { ogs_error("OpenAPI_confirmation_data_convertToJSON() failed [res_star]"); goto end; @@ -58,21 +70,22 @@ end: OpenAPI_confirmation_data_t *OpenAPI_confirmation_data_parseFromJSON(cJSON *confirmation_dataJSON) { OpenAPI_confirmation_data_t *confirmation_data_local_var = NULL; - cJSON *res_star = cJSON_GetObjectItemCaseSensitive(confirmation_dataJSON, "resStar"); + OpenAPI_lnode_t *node = NULL; + cJSON *res_star = NULL; + cJSON *supported_features = NULL; + res_star = cJSON_GetObjectItemCaseSensitive(confirmation_dataJSON, "resStar"); if (!res_star) { ogs_error("OpenAPI_confirmation_data_parseFromJSON() failed [res_star]"); goto end; } - if (!cJSON_IsString(res_star)) { ogs_error("OpenAPI_confirmation_data_parseFromJSON() failed [res_star]"); goto end; } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(confirmation_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(confirmation_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_confirmation_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -80,7 +93,7 @@ OpenAPI_confirmation_data_t *OpenAPI_confirmation_data_parseFromJSON(cJSON *conf confirmation_data_local_var = OpenAPI_confirmation_data_create ( ogs_strdup(res_star->valuestring), - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return confirmation_data_local_var; diff --git a/lib/sbi/openapi/model/confirmation_data_response.c b/lib/sbi/openapi/model/confirmation_data_response.c index 214e29f9a..ed91f8304 100644 --- a/lib/sbi/openapi/model/confirmation_data_response.c +++ b/lib/sbi/openapi/model/confirmation_data_response.c @@ -22,18 +22,26 @@ OpenAPI_confirmation_data_response_t *OpenAPI_confirmation_data_response_create( void OpenAPI_confirmation_data_response_free(OpenAPI_confirmation_data_response_t *confirmation_data_response) { + OpenAPI_lnode_t *node = NULL; + if (NULL == confirmation_data_response) { return; } - OpenAPI_lnode_t *node; - ogs_free(confirmation_data_response->supi); - ogs_free(confirmation_data_response->kseaf); + if (confirmation_data_response->supi) { + ogs_free(confirmation_data_response->supi); + confirmation_data_response->supi = NULL; + } + if (confirmation_data_response->kseaf) { + ogs_free(confirmation_data_response->kseaf); + confirmation_data_response->kseaf = NULL; + } ogs_free(confirmation_data_response); } cJSON *OpenAPI_confirmation_data_response_convertToJSON(OpenAPI_confirmation_data_response_t *confirmation_data_response) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (confirmation_data_response == NULL) { ogs_error("OpenAPI_confirmation_data_response_convertToJSON() failed [ConfirmationDataResponse]"); @@ -41,6 +49,10 @@ cJSON *OpenAPI_confirmation_data_response_convertToJSON(OpenAPI_confirmation_dat } item = cJSON_CreateObject(); + if (confirmation_data_response->auth_result == OpenAPI_auth_result_NULL) { + ogs_error("OpenAPI_confirmation_data_response_convertToJSON() failed [auth_result]"); + return NULL; + } if (cJSON_AddStringToObject(item, "authResult", OpenAPI_auth_result_ToString(confirmation_data_response->auth_result)) == NULL) { ogs_error("OpenAPI_confirmation_data_response_convertToJSON() failed [auth_result]"); goto end; @@ -67,32 +79,33 @@ end: OpenAPI_confirmation_data_response_t *OpenAPI_confirmation_data_response_parseFromJSON(cJSON *confirmation_data_responseJSON) { OpenAPI_confirmation_data_response_t *confirmation_data_response_local_var = NULL; - cJSON *auth_result = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "authResult"); + OpenAPI_lnode_t *node = NULL; + cJSON *auth_result = NULL; + OpenAPI_auth_result_e auth_resultVariable = 0; + cJSON *supi = NULL; + cJSON *kseaf = NULL; + auth_result = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "authResult"); if (!auth_result) { ogs_error("OpenAPI_confirmation_data_response_parseFromJSON() failed [auth_result]"); goto end; } - - OpenAPI_auth_result_e auth_resultVariable; if (!cJSON_IsString(auth_result)) { ogs_error("OpenAPI_confirmation_data_response_parseFromJSON() failed [auth_result]"); goto end; } auth_resultVariable = OpenAPI_auth_result_FromString(auth_result->valuestring); - cJSON *supi = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_confirmation_data_response_parseFromJSON() failed [supi]"); goto end; } } - cJSON *kseaf = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "kseaf"); - + kseaf = cJSON_GetObjectItemCaseSensitive(confirmation_data_responseJSON, "kseaf"); if (kseaf) { - if (!cJSON_IsString(kseaf)) { + if (!cJSON_IsString(kseaf) && !cJSON_IsNull(kseaf)) { ogs_error("OpenAPI_confirmation_data_response_parseFromJSON() failed [kseaf]"); goto end; } @@ -100,8 +113,8 @@ OpenAPI_confirmation_data_response_t *OpenAPI_confirmation_data_response_parseFr confirmation_data_response_local_var = OpenAPI_confirmation_data_response_create ( auth_resultVariable, - supi ? ogs_strdup(supi->valuestring) : NULL, - kseaf ? ogs_strdup(kseaf->valuestring) : NULL + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + kseaf && !cJSON_IsNull(kseaf) ? ogs_strdup(kseaf->valuestring) : NULL ); return confirmation_data_response_local_var; diff --git a/lib/sbi/openapi/model/context_data_sets.c b/lib/sbi/openapi/model/context_data_sets.c index 0ab2dc5fd..9774ea31a 100644 --- a/lib/sbi/openapi/model/context_data_sets.c +++ b/lib/sbi/openapi/model/context_data_sets.c @@ -34,37 +34,66 @@ OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_create( void OpenAPI_context_data_sets_free(OpenAPI_context_data_sets_t *context_data_sets) { + OpenAPI_lnode_t *node = NULL; + if (NULL == context_data_sets) { return; } - OpenAPI_lnode_t *node; - OpenAPI_amf3_gpp_access_registration_free(context_data_sets->amf3_gpp); - OpenAPI_amf_non3_gpp_access_registration_free(context_data_sets->amf_non3_gpp); - OpenAPI_list_for_each(context_data_sets->sdm_subscriptions, node) { - OpenAPI_sdm_subscription_free(node->data); + if (context_data_sets->amf3_gpp) { + OpenAPI_amf3_gpp_access_registration_free(context_data_sets->amf3_gpp); + context_data_sets->amf3_gpp = NULL; } - OpenAPI_list_free(context_data_sets->sdm_subscriptions); - OpenAPI_list_for_each(context_data_sets->ee_subscriptions, node) { - OpenAPI_ee_subscription_free(node->data); + if (context_data_sets->amf_non3_gpp) { + OpenAPI_amf_non3_gpp_access_registration_free(context_data_sets->amf_non3_gpp); + context_data_sets->amf_non3_gpp = NULL; } - OpenAPI_list_free(context_data_sets->ee_subscriptions); - OpenAPI_smsf_registration_free(context_data_sets->smsf3_gpp_access); - OpenAPI_smsf_registration_free(context_data_sets->smsf_non3_gpp_access); - OpenAPI_list_for_each(context_data_sets->subscription_data_subscriptions, node) { - OpenAPI_subscription_data_subscriptions_free(node->data); + if (context_data_sets->sdm_subscriptions) { + OpenAPI_list_for_each(context_data_sets->sdm_subscriptions, node) { + OpenAPI_sdm_subscription_free(node->data); + } + OpenAPI_list_free(context_data_sets->sdm_subscriptions); + context_data_sets->sdm_subscriptions = NULL; } - OpenAPI_list_free(context_data_sets->subscription_data_subscriptions); - OpenAPI_list_for_each(context_data_sets->smf_registrations, node) { - OpenAPI_smf_registration_free(node->data); + if (context_data_sets->ee_subscriptions) { + OpenAPI_list_for_each(context_data_sets->ee_subscriptions, node) { + OpenAPI_ee_subscription_free(node->data); + } + OpenAPI_list_free(context_data_sets->ee_subscriptions); + context_data_sets->ee_subscriptions = NULL; + } + if (context_data_sets->smsf3_gpp_access) { + OpenAPI_smsf_registration_free(context_data_sets->smsf3_gpp_access); + context_data_sets->smsf3_gpp_access = NULL; + } + if (context_data_sets->smsf_non3_gpp_access) { + OpenAPI_smsf_registration_free(context_data_sets->smsf_non3_gpp_access); + context_data_sets->smsf_non3_gpp_access = NULL; + } + if (context_data_sets->subscription_data_subscriptions) { + OpenAPI_list_for_each(context_data_sets->subscription_data_subscriptions, node) { + OpenAPI_subscription_data_subscriptions_free(node->data); + } + OpenAPI_list_free(context_data_sets->subscription_data_subscriptions); + context_data_sets->subscription_data_subscriptions = NULL; + } + if (context_data_sets->smf_registrations) { + OpenAPI_list_for_each(context_data_sets->smf_registrations, node) { + OpenAPI_smf_registration_free(node->data); + } + OpenAPI_list_free(context_data_sets->smf_registrations); + context_data_sets->smf_registrations = NULL; + } + if (context_data_sets->ip_sm_gw) { + OpenAPI_ip_sm_gw_registration_free(context_data_sets->ip_sm_gw); + context_data_sets->ip_sm_gw = NULL; } - OpenAPI_list_free(context_data_sets->smf_registrations); - OpenAPI_ip_sm_gw_registration_free(context_data_sets->ip_sm_gw); ogs_free(context_data_sets); } cJSON *OpenAPI_context_data_sets_convertToJSON(OpenAPI_context_data_sets_t *context_data_sets) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (context_data_sets == NULL) { ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ContextDataSets]"); @@ -104,17 +133,13 @@ cJSON *OpenAPI_context_data_sets_convertToJSON(OpenAPI_context_data_sets_t *cont ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [sdm_subscriptions]"); goto end; } - - OpenAPI_lnode_t *sdm_subscriptions_node; - if (context_data_sets->sdm_subscriptions) { - OpenAPI_list_for_each(context_data_sets->sdm_subscriptions, sdm_subscriptions_node) { - cJSON *itemLocal = OpenAPI_sdm_subscription_convertToJSON(sdm_subscriptions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [sdm_subscriptions]"); - goto end; - } - cJSON_AddItemToArray(sdm_subscriptionsList, itemLocal); + OpenAPI_list_for_each(context_data_sets->sdm_subscriptions, node) { + cJSON *itemLocal = OpenAPI_sdm_subscription_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [sdm_subscriptions]"); + goto end; } + cJSON_AddItemToArray(sdm_subscriptionsList, itemLocal); } } @@ -124,17 +149,13 @@ cJSON *OpenAPI_context_data_sets_convertToJSON(OpenAPI_context_data_sets_t *cont ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ee_subscriptions]"); goto end; } - - OpenAPI_lnode_t *ee_subscriptions_node; - if (context_data_sets->ee_subscriptions) { - OpenAPI_list_for_each(context_data_sets->ee_subscriptions, ee_subscriptions_node) { - cJSON *itemLocal = OpenAPI_ee_subscription_convertToJSON(ee_subscriptions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ee_subscriptions]"); - goto end; - } - cJSON_AddItemToArray(ee_subscriptionsList, itemLocal); + OpenAPI_list_for_each(context_data_sets->ee_subscriptions, node) { + cJSON *itemLocal = OpenAPI_ee_subscription_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ee_subscriptions]"); + goto end; } + cJSON_AddItemToArray(ee_subscriptionsList, itemLocal); } } @@ -170,17 +191,13 @@ cJSON *OpenAPI_context_data_sets_convertToJSON(OpenAPI_context_data_sets_t *cont ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [subscription_data_subscriptions]"); goto end; } - - OpenAPI_lnode_t *subscription_data_subscriptions_node; - if (context_data_sets->subscription_data_subscriptions) { - OpenAPI_list_for_each(context_data_sets->subscription_data_subscriptions, subscription_data_subscriptions_node) { - cJSON *itemLocal = OpenAPI_subscription_data_subscriptions_convertToJSON(subscription_data_subscriptions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [subscription_data_subscriptions]"); - goto end; - } - cJSON_AddItemToArray(subscription_data_subscriptionsList, itemLocal); + OpenAPI_list_for_each(context_data_sets->subscription_data_subscriptions, node) { + cJSON *itemLocal = OpenAPI_subscription_data_subscriptions_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [subscription_data_subscriptions]"); + goto end; } + cJSON_AddItemToArray(subscription_data_subscriptionsList, itemLocal); } } @@ -190,17 +207,13 @@ cJSON *OpenAPI_context_data_sets_convertToJSON(OpenAPI_context_data_sets_t *cont ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smf_registrations]"); goto end; } - - OpenAPI_lnode_t *smf_registrations_node; - if (context_data_sets->smf_registrations) { - OpenAPI_list_for_each(context_data_sets->smf_registrations, smf_registrations_node) { - cJSON *itemLocal = OpenAPI_smf_registration_convertToJSON(smf_registrations_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smf_registrations]"); - goto end; - } - cJSON_AddItemToArray(smf_registrationsList, itemLocal); + OpenAPI_list_for_each(context_data_sets->smf_registrations, node) { + cJSON *itemLocal = OpenAPI_smf_registration_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [smf_registrations]"); + goto end; } + cJSON_AddItemToArray(smf_registrationsList, itemLocal); } } @@ -224,153 +237,146 @@ end: OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_parseFromJSON(cJSON *context_data_setsJSON) { OpenAPI_context_data_sets_t *context_data_sets_local_var = NULL; - cJSON *amf3_gpp = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "amf3Gpp"); - + OpenAPI_lnode_t *node = NULL; + cJSON *amf3_gpp = NULL; OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_local_nonprim = NULL; + cJSON *amf_non3_gpp = NULL; + OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_local_nonprim = NULL; + cJSON *sdm_subscriptions = NULL; + OpenAPI_list_t *sdm_subscriptionsList = NULL; + cJSON *ee_subscriptions = NULL; + OpenAPI_list_t *ee_subscriptionsList = NULL; + cJSON *smsf3_gpp_access = NULL; + OpenAPI_smsf_registration_t *smsf3_gpp_access_local_nonprim = NULL; + cJSON *smsf_non3_gpp_access = NULL; + OpenAPI_smsf_registration_t *smsf_non3_gpp_access_local_nonprim = NULL; + cJSON *subscription_data_subscriptions = NULL; + OpenAPI_list_t *subscription_data_subscriptionsList = NULL; + cJSON *smf_registrations = NULL; + OpenAPI_list_t *smf_registrationsList = NULL; + cJSON *ip_sm_gw = NULL; + OpenAPI_ip_sm_gw_registration_t *ip_sm_gw_local_nonprim = NULL; + amf3_gpp = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "amf3Gpp"); if (amf3_gpp) { amf3_gpp_local_nonprim = OpenAPI_amf3_gpp_access_registration_parseFromJSON(amf3_gpp); } - cJSON *amf_non3_gpp = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "amfNon3Gpp"); - - OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_local_nonprim = NULL; + amf_non3_gpp = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "amfNon3Gpp"); if (amf_non3_gpp) { amf_non3_gpp_local_nonprim = OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(amf_non3_gpp); } - cJSON *sdm_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "sdmSubscriptions"); - - OpenAPI_list_t *sdm_subscriptionsList; + sdm_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "sdmSubscriptions"); if (sdm_subscriptions) { - cJSON *sdm_subscriptions_local_nonprimitive; - if (!cJSON_IsArray(sdm_subscriptions)){ - ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [sdm_subscriptions]"); - goto end; - } - - sdm_subscriptionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sdm_subscriptions_local_nonprimitive, sdm_subscriptions ) { - if (!cJSON_IsObject(sdm_subscriptions_local_nonprimitive)) { + cJSON *sdm_subscriptions_local = NULL; + if (!cJSON_IsArray(sdm_subscriptions)) { ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [sdm_subscriptions]"); goto end; } - OpenAPI_sdm_subscription_t *sdm_subscriptionsItem = OpenAPI_sdm_subscription_parseFromJSON(sdm_subscriptions_local_nonprimitive); - if (!sdm_subscriptionsItem) { - ogs_error("No sdm_subscriptionsItem"); - OpenAPI_list_free(sdm_subscriptionsList); - goto end; + sdm_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sdm_subscriptions_local, sdm_subscriptions) { + if (!cJSON_IsObject(sdm_subscriptions_local)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [sdm_subscriptions]"); + goto end; + } + OpenAPI_sdm_subscription_t *sdm_subscriptionsItem = OpenAPI_sdm_subscription_parseFromJSON(sdm_subscriptions_local); + if (!sdm_subscriptionsItem) { + ogs_error("No sdm_subscriptionsItem"); + OpenAPI_list_free(sdm_subscriptionsList); + goto end; + } + OpenAPI_list_add(sdm_subscriptionsList, sdm_subscriptionsItem); } - - OpenAPI_list_add(sdm_subscriptionsList, sdm_subscriptionsItem); - } } - cJSON *ee_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "eeSubscriptions"); - - OpenAPI_list_t *ee_subscriptionsList; + ee_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "eeSubscriptions"); if (ee_subscriptions) { - cJSON *ee_subscriptions_local_nonprimitive; - if (!cJSON_IsArray(ee_subscriptions)){ - ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [ee_subscriptions]"); - goto end; - } - - ee_subscriptionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ee_subscriptions_local_nonprimitive, ee_subscriptions ) { - if (!cJSON_IsObject(ee_subscriptions_local_nonprimitive)) { + cJSON *ee_subscriptions_local = NULL; + if (!cJSON_IsArray(ee_subscriptions)) { ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [ee_subscriptions]"); goto end; } - OpenAPI_ee_subscription_t *ee_subscriptionsItem = OpenAPI_ee_subscription_parseFromJSON(ee_subscriptions_local_nonprimitive); - if (!ee_subscriptionsItem) { - ogs_error("No ee_subscriptionsItem"); - OpenAPI_list_free(ee_subscriptionsList); - goto end; + ee_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ee_subscriptions_local, ee_subscriptions) { + if (!cJSON_IsObject(ee_subscriptions_local)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [ee_subscriptions]"); + goto end; + } + OpenAPI_ee_subscription_t *ee_subscriptionsItem = OpenAPI_ee_subscription_parseFromJSON(ee_subscriptions_local); + if (!ee_subscriptionsItem) { + ogs_error("No ee_subscriptionsItem"); + OpenAPI_list_free(ee_subscriptionsList); + goto end; + } + OpenAPI_list_add(ee_subscriptionsList, ee_subscriptionsItem); } - - OpenAPI_list_add(ee_subscriptionsList, ee_subscriptionsItem); - } } - cJSON *smsf3_gpp_access = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smsf3GppAccess"); - - OpenAPI_smsf_registration_t *smsf3_gpp_access_local_nonprim = NULL; + smsf3_gpp_access = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smsf3GppAccess"); if (smsf3_gpp_access) { smsf3_gpp_access_local_nonprim = OpenAPI_smsf_registration_parseFromJSON(smsf3_gpp_access); } - cJSON *smsf_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smsfNon3GppAccess"); - - OpenAPI_smsf_registration_t *smsf_non3_gpp_access_local_nonprim = NULL; + smsf_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smsfNon3GppAccess"); if (smsf_non3_gpp_access) { smsf_non3_gpp_access_local_nonprim = OpenAPI_smsf_registration_parseFromJSON(smsf_non3_gpp_access); } - cJSON *subscription_data_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "subscriptionDataSubscriptions"); - - OpenAPI_list_t *subscription_data_subscriptionsList; + subscription_data_subscriptions = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "subscriptionDataSubscriptions"); if (subscription_data_subscriptions) { - cJSON *subscription_data_subscriptions_local_nonprimitive; - if (!cJSON_IsArray(subscription_data_subscriptions)){ - ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [subscription_data_subscriptions]"); - goto end; - } - - subscription_data_subscriptionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(subscription_data_subscriptions_local_nonprimitive, subscription_data_subscriptions ) { - if (!cJSON_IsObject(subscription_data_subscriptions_local_nonprimitive)) { + cJSON *subscription_data_subscriptions_local = NULL; + if (!cJSON_IsArray(subscription_data_subscriptions)) { ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [subscription_data_subscriptions]"); goto end; } - OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptionsItem = OpenAPI_subscription_data_subscriptions_parseFromJSON(subscription_data_subscriptions_local_nonprimitive); - if (!subscription_data_subscriptionsItem) { - ogs_error("No subscription_data_subscriptionsItem"); - OpenAPI_list_free(subscription_data_subscriptionsList); - goto end; + subscription_data_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscription_data_subscriptions_local, subscription_data_subscriptions) { + if (!cJSON_IsObject(subscription_data_subscriptions_local)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [subscription_data_subscriptions]"); + goto end; + } + OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptionsItem = OpenAPI_subscription_data_subscriptions_parseFromJSON(subscription_data_subscriptions_local); + if (!subscription_data_subscriptionsItem) { + ogs_error("No subscription_data_subscriptionsItem"); + OpenAPI_list_free(subscription_data_subscriptionsList); + goto end; + } + OpenAPI_list_add(subscription_data_subscriptionsList, subscription_data_subscriptionsItem); } - - OpenAPI_list_add(subscription_data_subscriptionsList, subscription_data_subscriptionsItem); - } } - cJSON *smf_registrations = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smfRegistrations"); - - OpenAPI_list_t *smf_registrationsList; + smf_registrations = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "smfRegistrations"); if (smf_registrations) { - cJSON *smf_registrations_local_nonprimitive; - if (!cJSON_IsArray(smf_registrations)){ - ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [smf_registrations]"); - goto end; - } - - smf_registrationsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(smf_registrations_local_nonprimitive, smf_registrations ) { - if (!cJSON_IsObject(smf_registrations_local_nonprimitive)) { + cJSON *smf_registrations_local = NULL; + if (!cJSON_IsArray(smf_registrations)) { ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [smf_registrations]"); goto end; } - OpenAPI_smf_registration_t *smf_registrationsItem = OpenAPI_smf_registration_parseFromJSON(smf_registrations_local_nonprimitive); - if (!smf_registrationsItem) { - ogs_error("No smf_registrationsItem"); - OpenAPI_list_free(smf_registrationsList); - goto end; + smf_registrationsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_registrations_local, smf_registrations) { + if (!cJSON_IsObject(smf_registrations_local)) { + ogs_error("OpenAPI_context_data_sets_parseFromJSON() failed [smf_registrations]"); + goto end; + } + OpenAPI_smf_registration_t *smf_registrationsItem = OpenAPI_smf_registration_parseFromJSON(smf_registrations_local); + if (!smf_registrationsItem) { + ogs_error("No smf_registrationsItem"); + OpenAPI_list_free(smf_registrationsList); + goto end; + } + OpenAPI_list_add(smf_registrationsList, smf_registrationsItem); } - - OpenAPI_list_add(smf_registrationsList, smf_registrationsItem); - } } - cJSON *ip_sm_gw = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "ipSmGw"); - - OpenAPI_ip_sm_gw_registration_t *ip_sm_gw_local_nonprim = NULL; + ip_sm_gw = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "ipSmGw"); if (ip_sm_gw) { ip_sm_gw_local_nonprim = OpenAPI_ip_sm_gw_registration_parseFromJSON(ip_sm_gw); } @@ -389,6 +395,54 @@ OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_parseFromJSON(cJSON *cont return context_data_sets_local_var; end: + if (amf3_gpp_local_nonprim) { + OpenAPI_amf3_gpp_access_registration_free(amf3_gpp_local_nonprim); + amf3_gpp_local_nonprim = NULL; + } + if (amf_non3_gpp_local_nonprim) { + OpenAPI_amf_non3_gpp_access_registration_free(amf_non3_gpp_local_nonprim); + amf_non3_gpp_local_nonprim = NULL; + } + if (sdm_subscriptionsList) { + OpenAPI_list_for_each(sdm_subscriptionsList, node) { + OpenAPI_sdm_subscription_free(node->data); + } + OpenAPI_list_free(sdm_subscriptionsList); + sdm_subscriptionsList = NULL; + } + if (ee_subscriptionsList) { + OpenAPI_list_for_each(ee_subscriptionsList, node) { + OpenAPI_ee_subscription_free(node->data); + } + OpenAPI_list_free(ee_subscriptionsList); + ee_subscriptionsList = NULL; + } + if (smsf3_gpp_access_local_nonprim) { + OpenAPI_smsf_registration_free(smsf3_gpp_access_local_nonprim); + smsf3_gpp_access_local_nonprim = NULL; + } + if (smsf_non3_gpp_access_local_nonprim) { + OpenAPI_smsf_registration_free(smsf_non3_gpp_access_local_nonprim); + smsf_non3_gpp_access_local_nonprim = NULL; + } + if (subscription_data_subscriptionsList) { + OpenAPI_list_for_each(subscription_data_subscriptionsList, node) { + OpenAPI_subscription_data_subscriptions_free(node->data); + } + OpenAPI_list_free(subscription_data_subscriptionsList); + subscription_data_subscriptionsList = NULL; + } + if (smf_registrationsList) { + OpenAPI_list_for_each(smf_registrationsList, node) { + OpenAPI_smf_registration_free(node->data); + } + OpenAPI_list_free(smf_registrationsList); + smf_registrationsList = NULL; + } + if (ip_sm_gw_local_nonprim) { + OpenAPI_ip_sm_gw_registration_free(ip_sm_gw_local_nonprim); + ip_sm_gw_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/context_info.c b/lib/sbi/openapi/model/context_info.c index 4d363cfb6..0f9b6ac25 100644 --- a/lib/sbi/openapi/model/context_info.c +++ b/lib/sbi/openapi/model/context_info.c @@ -18,20 +18,25 @@ OpenAPI_context_info_t *OpenAPI_context_info_create( void OpenAPI_context_info_free(OpenAPI_context_info_t *context_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == context_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(context_info->orig_headers, node) { - ogs_free(node->data); + if (context_info->orig_headers) { + OpenAPI_list_for_each(context_info->orig_headers, node) { + ogs_free(node->data); + } + OpenAPI_list_free(context_info->orig_headers); + context_info->orig_headers = NULL; } - OpenAPI_list_free(context_info->orig_headers); ogs_free(context_info); } cJSON *OpenAPI_context_info_convertToJSON(OpenAPI_context_info_t *context_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (context_info == NULL) { ogs_error("OpenAPI_context_info_convertToJSON() failed [ContextInfo]"); @@ -40,19 +45,17 @@ cJSON *OpenAPI_context_info_convertToJSON(OpenAPI_context_info_t *context_info) item = cJSON_CreateObject(); if (context_info->orig_headers) { - cJSON *orig_headers = cJSON_AddArrayToObject(item, "origHeaders"); - if (orig_headers == NULL) { + cJSON *orig_headersList = cJSON_AddArrayToObject(item, "origHeaders"); + if (orig_headersList == NULL) { ogs_error("OpenAPI_context_info_convertToJSON() failed [orig_headers]"); goto end; } - - OpenAPI_lnode_t *orig_headers_node; - OpenAPI_list_for_each(context_info->orig_headers, orig_headers_node) { - if (cJSON_AddStringToObject(orig_headers, "", (char*)orig_headers_node->data) == NULL) { - ogs_error("OpenAPI_context_info_convertToJSON() failed [orig_headers]"); - goto end; + OpenAPI_list_for_each(context_info->orig_headers, node) { + if (cJSON_AddStringToObject(orig_headersList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_context_info_convertToJSON() failed [orig_headers]"); + goto end; + } } - } } end: @@ -62,24 +65,28 @@ end: OpenAPI_context_info_t *OpenAPI_context_info_parseFromJSON(cJSON *context_infoJSON) { OpenAPI_context_info_t *context_info_local_var = NULL; - cJSON *orig_headers = cJSON_GetObjectItemCaseSensitive(context_infoJSON, "origHeaders"); - - OpenAPI_list_t *orig_headersList; + OpenAPI_lnode_t *node = NULL; + cJSON *orig_headers = NULL; + OpenAPI_list_t *orig_headersList = NULL; + orig_headers = cJSON_GetObjectItemCaseSensitive(context_infoJSON, "origHeaders"); if (orig_headers) { - cJSON *orig_headers_local; - if (!cJSON_IsArray(orig_headers)) { - ogs_error("OpenAPI_context_info_parseFromJSON() failed [orig_headers]"); - goto end; - } - orig_headersList = OpenAPI_list_create(); + cJSON *orig_headers_local = NULL; + if (!cJSON_IsArray(orig_headers)) { + ogs_error("OpenAPI_context_info_parseFromJSON() failed [orig_headers]"); + goto end; + } - cJSON_ArrayForEach(orig_headers_local, orig_headers) { - if (!cJSON_IsString(orig_headers_local)) { - ogs_error("OpenAPI_context_info_parseFromJSON() failed [orig_headers]"); - goto end; - } - OpenAPI_list_add(orig_headersList, ogs_strdup(orig_headers_local->valuestring)); - } + orig_headersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(orig_headers_local, orig_headers) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(orig_headers_local)) { + ogs_error("OpenAPI_context_info_parseFromJSON() failed [orig_headers]"); + goto end; + } + OpenAPI_list_add(orig_headersList, ogs_strdup(orig_headers_local->valuestring)); + } } context_info_local_var = OpenAPI_context_info_create ( @@ -88,6 +95,13 @@ OpenAPI_context_info_t *OpenAPI_context_info_parseFromJSON(cJSON *context_infoJS return context_info_local_var; end: + if (orig_headersList) { + OpenAPI_list_for_each(orig_headersList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(orig_headersList); + orig_headersList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/core_network_type.c b/lib/sbi/openapi/model/core_network_type.c index b1ea85ca4..bb3da0e1a 100644 --- a/lib/sbi/openapi/model/core_network_type.c +++ b/lib/sbi/openapi/model/core_network_type.c @@ -6,7 +6,7 @@ char* OpenAPI_core_network_type_ToString(OpenAPI_core_network_type_e core_network_type) { - const char *core_network_typeArray[] = { "NULL", "_5GC", "EPC" }; + const char *core_network_typeArray[] = { "NULL", "5GC", "EPC" }; size_t sizeofArray = sizeof(core_network_typeArray) / sizeof(core_network_typeArray[0]); if (core_network_type < sizeofArray) return (char *)core_network_typeArray[core_network_type]; @@ -17,7 +17,7 @@ char* OpenAPI_core_network_type_ToString(OpenAPI_core_network_type_e core_networ OpenAPI_core_network_type_e OpenAPI_core_network_type_FromString(char* core_network_type) { int stringToReturn = 0; - const char *core_network_typeArray[] = { "NULL", "_5GC", "EPC" }; + const char *core_network_typeArray[] = { "NULL", "5GC", "EPC" }; size_t sizeofArray = sizeof(core_network_typeArray) / sizeof(core_network_typeArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(core_network_type, core_network_typeArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/create_ue_context_201_response.c b/lib/sbi/openapi/model/create_ue_context_201_response.c new file mode 100644 index 000000000..bc9a440b5 --- /dev/null +++ b/lib/sbi/openapi/model/create_ue_context_201_response.c @@ -0,0 +1,646 @@ + +#include +#include +#include +#include "create_ue_context_201_response.h" + +OpenAPI_create_ue_context_201_response_t *OpenAPI_create_ue_context_201_response_create( + OpenAPI_ue_context_created_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information, + OpenAPI_binary_t* binary_data_n2_information_ext1, + OpenAPI_binary_t* binary_data_n2_information_ext2, + OpenAPI_binary_t* binary_data_n2_information_ext3, + OpenAPI_binary_t* binary_data_n2_information_ext4, + OpenAPI_binary_t* binary_data_n2_information_ext5, + OpenAPI_binary_t* binary_data_n2_information_ext6, + OpenAPI_binary_t* binary_data_n2_information_ext7, + OpenAPI_binary_t* binary_data_n2_information_ext8, + OpenAPI_binary_t* binary_data_n2_information_ext9, + OpenAPI_binary_t* binary_data_n2_information_ext10, + OpenAPI_binary_t* binary_data_n2_information_ext11, + OpenAPI_binary_t* binary_data_n2_information_ext12, + OpenAPI_binary_t* binary_data_n2_information_ext13, + OpenAPI_binary_t* binary_data_n2_information_ext14, + OpenAPI_binary_t* binary_data_n2_information_ext15 +) +{ + OpenAPI_create_ue_context_201_response_t *create_ue_context_201_response_local_var = ogs_malloc(sizeof(OpenAPI_create_ue_context_201_response_t)); + ogs_assert(create_ue_context_201_response_local_var); + + create_ue_context_201_response_local_var->json_data = json_data; + create_ue_context_201_response_local_var->binary_data_n2_information = binary_data_n2_information; + create_ue_context_201_response_local_var->binary_data_n2_information_ext1 = binary_data_n2_information_ext1; + create_ue_context_201_response_local_var->binary_data_n2_information_ext2 = binary_data_n2_information_ext2; + create_ue_context_201_response_local_var->binary_data_n2_information_ext3 = binary_data_n2_information_ext3; + create_ue_context_201_response_local_var->binary_data_n2_information_ext4 = binary_data_n2_information_ext4; + create_ue_context_201_response_local_var->binary_data_n2_information_ext5 = binary_data_n2_information_ext5; + create_ue_context_201_response_local_var->binary_data_n2_information_ext6 = binary_data_n2_information_ext6; + create_ue_context_201_response_local_var->binary_data_n2_information_ext7 = binary_data_n2_information_ext7; + create_ue_context_201_response_local_var->binary_data_n2_information_ext8 = binary_data_n2_information_ext8; + create_ue_context_201_response_local_var->binary_data_n2_information_ext9 = binary_data_n2_information_ext9; + create_ue_context_201_response_local_var->binary_data_n2_information_ext10 = binary_data_n2_information_ext10; + create_ue_context_201_response_local_var->binary_data_n2_information_ext11 = binary_data_n2_information_ext11; + create_ue_context_201_response_local_var->binary_data_n2_information_ext12 = binary_data_n2_information_ext12; + create_ue_context_201_response_local_var->binary_data_n2_information_ext13 = binary_data_n2_information_ext13; + create_ue_context_201_response_local_var->binary_data_n2_information_ext14 = binary_data_n2_information_ext14; + create_ue_context_201_response_local_var->binary_data_n2_information_ext15 = binary_data_n2_information_ext15; + + return create_ue_context_201_response_local_var; +} + +void OpenAPI_create_ue_context_201_response_free(OpenAPI_create_ue_context_201_response_t *create_ue_context_201_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == create_ue_context_201_response) { + return; + } + if (create_ue_context_201_response->json_data) { + OpenAPI_ue_context_created_data_free(create_ue_context_201_response->json_data); + create_ue_context_201_response->json_data = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information) { + ogs_free(create_ue_context_201_response->binary_data_n2_information->data); + create_ue_context_201_response->binary_data_n2_information = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext1) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext1->data); + create_ue_context_201_response->binary_data_n2_information_ext1 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext2) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext2->data); + create_ue_context_201_response->binary_data_n2_information_ext2 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext3) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext3->data); + create_ue_context_201_response->binary_data_n2_information_ext3 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext4) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext4->data); + create_ue_context_201_response->binary_data_n2_information_ext4 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext5) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext5->data); + create_ue_context_201_response->binary_data_n2_information_ext5 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext6) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext6->data); + create_ue_context_201_response->binary_data_n2_information_ext6 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext7) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext7->data); + create_ue_context_201_response->binary_data_n2_information_ext7 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext8) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext8->data); + create_ue_context_201_response->binary_data_n2_information_ext8 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext9) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext9->data); + create_ue_context_201_response->binary_data_n2_information_ext9 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext10) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext10->data); + create_ue_context_201_response->binary_data_n2_information_ext10 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext11) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext11->data); + create_ue_context_201_response->binary_data_n2_information_ext11 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext12) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext12->data); + create_ue_context_201_response->binary_data_n2_information_ext12 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext13) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext13->data); + create_ue_context_201_response->binary_data_n2_information_ext13 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext14) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext14->data); + create_ue_context_201_response->binary_data_n2_information_ext14 = NULL; + } + if (create_ue_context_201_response->binary_data_n2_information_ext15) { + ogs_free(create_ue_context_201_response->binary_data_n2_information_ext15->data); + create_ue_context_201_response->binary_data_n2_information_ext15 = NULL; + } + ogs_free(create_ue_context_201_response); +} + +cJSON *OpenAPI_create_ue_context_201_response_convertToJSON(OpenAPI_create_ue_context_201_response_t *create_ue_context_201_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (create_ue_context_201_response == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [CreateUEContext_201_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (create_ue_context_201_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_ue_context_created_data_convertToJSON(create_ue_context_201_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (create_ue_context_201_response->binary_data_n2_information) { + char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information->data,create_ue_context_201_response->binary_data_n2_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext1) { + char* encoded_str_binary_data_n2_information_ext1 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext1->data,create_ue_context_201_response->binary_data_n2_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt1", encoded_str_binary_data_n2_information_ext1) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext1); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext2) { + char* encoded_str_binary_data_n2_information_ext2 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext2->data,create_ue_context_201_response->binary_data_n2_information_ext2->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt2", encoded_str_binary_data_n2_information_ext2) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext2); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext3) { + char* encoded_str_binary_data_n2_information_ext3 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext3->data,create_ue_context_201_response->binary_data_n2_information_ext3->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt3", encoded_str_binary_data_n2_information_ext3) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext3); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext4) { + char* encoded_str_binary_data_n2_information_ext4 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext4->data,create_ue_context_201_response->binary_data_n2_information_ext4->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt4", encoded_str_binary_data_n2_information_ext4) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext4); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext5) { + char* encoded_str_binary_data_n2_information_ext5 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext5->data,create_ue_context_201_response->binary_data_n2_information_ext5->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt5", encoded_str_binary_data_n2_information_ext5) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext5); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext6) { + char* encoded_str_binary_data_n2_information_ext6 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext6->data,create_ue_context_201_response->binary_data_n2_information_ext6->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt6", encoded_str_binary_data_n2_information_ext6) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext6); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext7) { + char* encoded_str_binary_data_n2_information_ext7 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext7->data,create_ue_context_201_response->binary_data_n2_information_ext7->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt7", encoded_str_binary_data_n2_information_ext7) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext7); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext8) { + char* encoded_str_binary_data_n2_information_ext8 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext8->data,create_ue_context_201_response->binary_data_n2_information_ext8->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt8", encoded_str_binary_data_n2_information_ext8) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext8); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext9) { + char* encoded_str_binary_data_n2_information_ext9 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext9->data,create_ue_context_201_response->binary_data_n2_information_ext9->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt9", encoded_str_binary_data_n2_information_ext9) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext9); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext10) { + char* encoded_str_binary_data_n2_information_ext10 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext10->data,create_ue_context_201_response->binary_data_n2_information_ext10->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt10", encoded_str_binary_data_n2_information_ext10) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext10); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext11) { + char* encoded_str_binary_data_n2_information_ext11 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext11->data,create_ue_context_201_response->binary_data_n2_information_ext11->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt11", encoded_str_binary_data_n2_information_ext11) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext11); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext12) { + char* encoded_str_binary_data_n2_information_ext12 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext12->data,create_ue_context_201_response->binary_data_n2_information_ext12->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt12", encoded_str_binary_data_n2_information_ext12) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext12); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext13) { + char* encoded_str_binary_data_n2_information_ext13 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext13->data,create_ue_context_201_response->binary_data_n2_information_ext13->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt13", encoded_str_binary_data_n2_information_ext13) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext13); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext14) { + char* encoded_str_binary_data_n2_information_ext14 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext14->data,create_ue_context_201_response->binary_data_n2_information_ext14->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt14", encoded_str_binary_data_n2_information_ext14) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext14); + } + + if (create_ue_context_201_response->binary_data_n2_information_ext15) { + char* encoded_str_binary_data_n2_information_ext15 = OpenAPI_base64encode(create_ue_context_201_response->binary_data_n2_information_ext15->data,create_ue_context_201_response->binary_data_n2_information_ext15->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt15", encoded_str_binary_data_n2_information_ext15) == NULL) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext15); + } + +end: + return item; +} + +OpenAPI_create_ue_context_201_response_t *OpenAPI_create_ue_context_201_response_parseFromJSON(cJSON *create_ue_context_201_responseJSON) +{ + OpenAPI_create_ue_context_201_response_t *create_ue_context_201_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_ue_context_created_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n2_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information = NULL; + cJSON *binary_data_n2_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext1 = NULL; + cJSON *binary_data_n2_information_ext2 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext2 = NULL; + cJSON *binary_data_n2_information_ext3 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext3 = NULL; + cJSON *binary_data_n2_information_ext4 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext4 = NULL; + cJSON *binary_data_n2_information_ext5 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext5 = NULL; + cJSON *binary_data_n2_information_ext6 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext6 = NULL; + cJSON *binary_data_n2_information_ext7 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext7 = NULL; + cJSON *binary_data_n2_information_ext8 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext8 = NULL; + cJSON *binary_data_n2_information_ext9 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext9 = NULL; + cJSON *binary_data_n2_information_ext10 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext10 = NULL; + cJSON *binary_data_n2_information_ext11 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext11 = NULL; + cJSON *binary_data_n2_information_ext12 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext12 = NULL; + cJSON *binary_data_n2_information_ext13 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext13 = NULL; + cJSON *binary_data_n2_information_ext14 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext14 = NULL; + cJSON *binary_data_n2_information_ext15 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext15 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_ue_context_created_data_parseFromJSON(json_data); + } + + binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2Information"); + if (binary_data_n2_information) { + decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information); + if (!cJSON_IsString(binary_data_n2_information)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); + if (!decoded_str_binary_data_n2_information->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + } + + binary_data_n2_information_ext1 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt1"); + if (binary_data_n2_information_ext1) { + decoded_str_binary_data_n2_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext1); + if (!cJSON_IsString(binary_data_n2_information_ext1)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + decoded_str_binary_data_n2_information_ext1->data = OpenAPI_base64decode(binary_data_n2_information_ext1->valuestring, strlen(binary_data_n2_information_ext1->valuestring), &decoded_str_binary_data_n2_information_ext1->len); + if (!decoded_str_binary_data_n2_information_ext1->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + } + + binary_data_n2_information_ext2 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt2"); + if (binary_data_n2_information_ext2) { + decoded_str_binary_data_n2_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext2); + if (!cJSON_IsString(binary_data_n2_information_ext2)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + decoded_str_binary_data_n2_information_ext2->data = OpenAPI_base64decode(binary_data_n2_information_ext2->valuestring, strlen(binary_data_n2_information_ext2->valuestring), &decoded_str_binary_data_n2_information_ext2->len); + if (!decoded_str_binary_data_n2_information_ext2->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + } + + binary_data_n2_information_ext3 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt3"); + if (binary_data_n2_information_ext3) { + decoded_str_binary_data_n2_information_ext3 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext3); + if (!cJSON_IsString(binary_data_n2_information_ext3)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + decoded_str_binary_data_n2_information_ext3->data = OpenAPI_base64decode(binary_data_n2_information_ext3->valuestring, strlen(binary_data_n2_information_ext3->valuestring), &decoded_str_binary_data_n2_information_ext3->len); + if (!decoded_str_binary_data_n2_information_ext3->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + } + + binary_data_n2_information_ext4 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt4"); + if (binary_data_n2_information_ext4) { + decoded_str_binary_data_n2_information_ext4 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext4); + if (!cJSON_IsString(binary_data_n2_information_ext4)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + decoded_str_binary_data_n2_information_ext4->data = OpenAPI_base64decode(binary_data_n2_information_ext4->valuestring, strlen(binary_data_n2_information_ext4->valuestring), &decoded_str_binary_data_n2_information_ext4->len); + if (!decoded_str_binary_data_n2_information_ext4->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + } + + binary_data_n2_information_ext5 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt5"); + if (binary_data_n2_information_ext5) { + decoded_str_binary_data_n2_information_ext5 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext5); + if (!cJSON_IsString(binary_data_n2_information_ext5)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + decoded_str_binary_data_n2_information_ext5->data = OpenAPI_base64decode(binary_data_n2_information_ext5->valuestring, strlen(binary_data_n2_information_ext5->valuestring), &decoded_str_binary_data_n2_information_ext5->len); + if (!decoded_str_binary_data_n2_information_ext5->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + } + + binary_data_n2_information_ext6 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt6"); + if (binary_data_n2_information_ext6) { + decoded_str_binary_data_n2_information_ext6 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext6); + if (!cJSON_IsString(binary_data_n2_information_ext6)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + decoded_str_binary_data_n2_information_ext6->data = OpenAPI_base64decode(binary_data_n2_information_ext6->valuestring, strlen(binary_data_n2_information_ext6->valuestring), &decoded_str_binary_data_n2_information_ext6->len); + if (!decoded_str_binary_data_n2_information_ext6->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + } + + binary_data_n2_information_ext7 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt7"); + if (binary_data_n2_information_ext7) { + decoded_str_binary_data_n2_information_ext7 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext7); + if (!cJSON_IsString(binary_data_n2_information_ext7)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + decoded_str_binary_data_n2_information_ext7->data = OpenAPI_base64decode(binary_data_n2_information_ext7->valuestring, strlen(binary_data_n2_information_ext7->valuestring), &decoded_str_binary_data_n2_information_ext7->len); + if (!decoded_str_binary_data_n2_information_ext7->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + } + + binary_data_n2_information_ext8 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt8"); + if (binary_data_n2_information_ext8) { + decoded_str_binary_data_n2_information_ext8 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext8); + if (!cJSON_IsString(binary_data_n2_information_ext8)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + decoded_str_binary_data_n2_information_ext8->data = OpenAPI_base64decode(binary_data_n2_information_ext8->valuestring, strlen(binary_data_n2_information_ext8->valuestring), &decoded_str_binary_data_n2_information_ext8->len); + if (!decoded_str_binary_data_n2_information_ext8->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + } + + binary_data_n2_information_ext9 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt9"); + if (binary_data_n2_information_ext9) { + decoded_str_binary_data_n2_information_ext9 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext9); + if (!cJSON_IsString(binary_data_n2_information_ext9)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + decoded_str_binary_data_n2_information_ext9->data = OpenAPI_base64decode(binary_data_n2_information_ext9->valuestring, strlen(binary_data_n2_information_ext9->valuestring), &decoded_str_binary_data_n2_information_ext9->len); + if (!decoded_str_binary_data_n2_information_ext9->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + } + + binary_data_n2_information_ext10 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt10"); + if (binary_data_n2_information_ext10) { + decoded_str_binary_data_n2_information_ext10 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext10); + if (!cJSON_IsString(binary_data_n2_information_ext10)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + decoded_str_binary_data_n2_information_ext10->data = OpenAPI_base64decode(binary_data_n2_information_ext10->valuestring, strlen(binary_data_n2_information_ext10->valuestring), &decoded_str_binary_data_n2_information_ext10->len); + if (!decoded_str_binary_data_n2_information_ext10->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + } + + binary_data_n2_information_ext11 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt11"); + if (binary_data_n2_information_ext11) { + decoded_str_binary_data_n2_information_ext11 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext11); + if (!cJSON_IsString(binary_data_n2_information_ext11)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + decoded_str_binary_data_n2_information_ext11->data = OpenAPI_base64decode(binary_data_n2_information_ext11->valuestring, strlen(binary_data_n2_information_ext11->valuestring), &decoded_str_binary_data_n2_information_ext11->len); + if (!decoded_str_binary_data_n2_information_ext11->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + } + + binary_data_n2_information_ext12 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt12"); + if (binary_data_n2_information_ext12) { + decoded_str_binary_data_n2_information_ext12 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext12); + if (!cJSON_IsString(binary_data_n2_information_ext12)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + decoded_str_binary_data_n2_information_ext12->data = OpenAPI_base64decode(binary_data_n2_information_ext12->valuestring, strlen(binary_data_n2_information_ext12->valuestring), &decoded_str_binary_data_n2_information_ext12->len); + if (!decoded_str_binary_data_n2_information_ext12->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + } + + binary_data_n2_information_ext13 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt13"); + if (binary_data_n2_information_ext13) { + decoded_str_binary_data_n2_information_ext13 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext13); + if (!cJSON_IsString(binary_data_n2_information_ext13)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + decoded_str_binary_data_n2_information_ext13->data = OpenAPI_base64decode(binary_data_n2_information_ext13->valuestring, strlen(binary_data_n2_information_ext13->valuestring), &decoded_str_binary_data_n2_information_ext13->len); + if (!decoded_str_binary_data_n2_information_ext13->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + } + + binary_data_n2_information_ext14 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt14"); + if (binary_data_n2_information_ext14) { + decoded_str_binary_data_n2_information_ext14 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext14); + if (!cJSON_IsString(binary_data_n2_information_ext14)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + decoded_str_binary_data_n2_information_ext14->data = OpenAPI_base64decode(binary_data_n2_information_ext14->valuestring, strlen(binary_data_n2_information_ext14->valuestring), &decoded_str_binary_data_n2_information_ext14->len); + if (!decoded_str_binary_data_n2_information_ext14->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + } + + binary_data_n2_information_ext15 = cJSON_GetObjectItemCaseSensitive(create_ue_context_201_responseJSON, "binaryDataN2InformationExt15"); + if (binary_data_n2_information_ext15) { + decoded_str_binary_data_n2_information_ext15 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext15); + if (!cJSON_IsString(binary_data_n2_information_ext15)) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + decoded_str_binary_data_n2_information_ext15->data = OpenAPI_base64decode(binary_data_n2_information_ext15->valuestring, strlen(binary_data_n2_information_ext15->valuestring), &decoded_str_binary_data_n2_information_ext15->len); + if (!decoded_str_binary_data_n2_information_ext15->data) { + ogs_error("OpenAPI_create_ue_context_201_response_parseFromJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + } + + create_ue_context_201_response_local_var = OpenAPI_create_ue_context_201_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL, + binary_data_n2_information_ext1 ? decoded_str_binary_data_n2_information_ext1 : NULL, + binary_data_n2_information_ext2 ? decoded_str_binary_data_n2_information_ext2 : NULL, + binary_data_n2_information_ext3 ? decoded_str_binary_data_n2_information_ext3 : NULL, + binary_data_n2_information_ext4 ? decoded_str_binary_data_n2_information_ext4 : NULL, + binary_data_n2_information_ext5 ? decoded_str_binary_data_n2_information_ext5 : NULL, + binary_data_n2_information_ext6 ? decoded_str_binary_data_n2_information_ext6 : NULL, + binary_data_n2_information_ext7 ? decoded_str_binary_data_n2_information_ext7 : NULL, + binary_data_n2_information_ext8 ? decoded_str_binary_data_n2_information_ext8 : NULL, + binary_data_n2_information_ext9 ? decoded_str_binary_data_n2_information_ext9 : NULL, + binary_data_n2_information_ext10 ? decoded_str_binary_data_n2_information_ext10 : NULL, + binary_data_n2_information_ext11 ? decoded_str_binary_data_n2_information_ext11 : NULL, + binary_data_n2_information_ext12 ? decoded_str_binary_data_n2_information_ext12 : NULL, + binary_data_n2_information_ext13 ? decoded_str_binary_data_n2_information_ext13 : NULL, + binary_data_n2_information_ext14 ? decoded_str_binary_data_n2_information_ext14 : NULL, + binary_data_n2_information_ext15 ? decoded_str_binary_data_n2_information_ext15 : NULL + ); + + return create_ue_context_201_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_ue_context_created_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_create_ue_context_201_response_t *OpenAPI_create_ue_context_201_response_copy(OpenAPI_create_ue_context_201_response_t *dst, OpenAPI_create_ue_context_201_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_create_ue_context_201_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_create_ue_context_201_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_create_ue_context_201_response_free(dst); + dst = OpenAPI_create_ue_context_201_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/create_ue_context_201_response.h b/lib/sbi/openapi/model/create_ue_context_201_response.h new file mode 100644 index 000000000..5422a2fec --- /dev/null +++ b/lib/sbi/openapi/model/create_ue_context_201_response.h @@ -0,0 +1,71 @@ +/* + * create_ue_context_201_response.h + * + * + */ + +#ifndef _OpenAPI_create_ue_context_201_response_H_ +#define _OpenAPI_create_ue_context_201_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_context_created_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_create_ue_context_201_response_s OpenAPI_create_ue_context_201_response_t; +typedef struct OpenAPI_create_ue_context_201_response_s { + struct OpenAPI_ue_context_created_data_s *json_data; + OpenAPI_binary_t* binary_data_n2_information; + OpenAPI_binary_t* binary_data_n2_information_ext1; + OpenAPI_binary_t* binary_data_n2_information_ext2; + OpenAPI_binary_t* binary_data_n2_information_ext3; + OpenAPI_binary_t* binary_data_n2_information_ext4; + OpenAPI_binary_t* binary_data_n2_information_ext5; + OpenAPI_binary_t* binary_data_n2_information_ext6; + OpenAPI_binary_t* binary_data_n2_information_ext7; + OpenAPI_binary_t* binary_data_n2_information_ext8; + OpenAPI_binary_t* binary_data_n2_information_ext9; + OpenAPI_binary_t* binary_data_n2_information_ext10; + OpenAPI_binary_t* binary_data_n2_information_ext11; + OpenAPI_binary_t* binary_data_n2_information_ext12; + OpenAPI_binary_t* binary_data_n2_information_ext13; + OpenAPI_binary_t* binary_data_n2_information_ext14; + OpenAPI_binary_t* binary_data_n2_information_ext15; +} OpenAPI_create_ue_context_201_response_t; + +OpenAPI_create_ue_context_201_response_t *OpenAPI_create_ue_context_201_response_create( + OpenAPI_ue_context_created_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information, + OpenAPI_binary_t* binary_data_n2_information_ext1, + OpenAPI_binary_t* binary_data_n2_information_ext2, + OpenAPI_binary_t* binary_data_n2_information_ext3, + OpenAPI_binary_t* binary_data_n2_information_ext4, + OpenAPI_binary_t* binary_data_n2_information_ext5, + OpenAPI_binary_t* binary_data_n2_information_ext6, + OpenAPI_binary_t* binary_data_n2_information_ext7, + OpenAPI_binary_t* binary_data_n2_information_ext8, + OpenAPI_binary_t* binary_data_n2_information_ext9, + OpenAPI_binary_t* binary_data_n2_information_ext10, + OpenAPI_binary_t* binary_data_n2_information_ext11, + OpenAPI_binary_t* binary_data_n2_information_ext12, + OpenAPI_binary_t* binary_data_n2_information_ext13, + OpenAPI_binary_t* binary_data_n2_information_ext14, + OpenAPI_binary_t* binary_data_n2_information_ext15 +); +void OpenAPI_create_ue_context_201_response_free(OpenAPI_create_ue_context_201_response_t *create_ue_context_201_response); +OpenAPI_create_ue_context_201_response_t *OpenAPI_create_ue_context_201_response_parseFromJSON(cJSON *create_ue_context_201_responseJSON); +cJSON *OpenAPI_create_ue_context_201_response_convertToJSON(OpenAPI_create_ue_context_201_response_t *create_ue_context_201_response); +OpenAPI_create_ue_context_201_response_t *OpenAPI_create_ue_context_201_response_copy(OpenAPI_create_ue_context_201_response_t *dst, OpenAPI_create_ue_context_201_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_create_ue_context_201_response_H_ */ + diff --git a/lib/sbi/openapi/model/create_ue_context_403_response.c b/lib/sbi/openapi/model/create_ue_context_403_response.c new file mode 100644 index 000000000..ff4ad5e7a --- /dev/null +++ b/lib/sbi/openapi/model/create_ue_context_403_response.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "create_ue_context_403_response.h" + +OpenAPI_create_ue_context_403_response_t *OpenAPI_create_ue_context_403_response_create( + OpenAPI_ue_context_create_error_t *json_data, + OpenAPI_binary_t* binary_data_n2_information +) +{ + OpenAPI_create_ue_context_403_response_t *create_ue_context_403_response_local_var = ogs_malloc(sizeof(OpenAPI_create_ue_context_403_response_t)); + ogs_assert(create_ue_context_403_response_local_var); + + create_ue_context_403_response_local_var->json_data = json_data; + create_ue_context_403_response_local_var->binary_data_n2_information = binary_data_n2_information; + + return create_ue_context_403_response_local_var; +} + +void OpenAPI_create_ue_context_403_response_free(OpenAPI_create_ue_context_403_response_t *create_ue_context_403_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == create_ue_context_403_response) { + return; + } + if (create_ue_context_403_response->json_data) { + OpenAPI_ue_context_create_error_free(create_ue_context_403_response->json_data); + create_ue_context_403_response->json_data = NULL; + } + if (create_ue_context_403_response->binary_data_n2_information) { + ogs_free(create_ue_context_403_response->binary_data_n2_information->data); + create_ue_context_403_response->binary_data_n2_information = NULL; + } + ogs_free(create_ue_context_403_response); +} + +cJSON *OpenAPI_create_ue_context_403_response_convertToJSON(OpenAPI_create_ue_context_403_response_t *create_ue_context_403_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (create_ue_context_403_response == NULL) { + ogs_error("OpenAPI_create_ue_context_403_response_convertToJSON() failed [CreateUEContext_403_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (create_ue_context_403_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_ue_context_create_error_convertToJSON(create_ue_context_403_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_create_ue_context_403_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_create_ue_context_403_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (create_ue_context_403_response->binary_data_n2_information) { + char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(create_ue_context_403_response->binary_data_n2_information->data,create_ue_context_403_response->binary_data_n2_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { + ogs_error("OpenAPI_create_ue_context_403_response_convertToJSON() failed [binary_data_n2_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information); + } + +end: + return item; +} + +OpenAPI_create_ue_context_403_response_t *OpenAPI_create_ue_context_403_response_parseFromJSON(cJSON *create_ue_context_403_responseJSON) +{ + OpenAPI_create_ue_context_403_response_t *create_ue_context_403_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_ue_context_create_error_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n2_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(create_ue_context_403_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_ue_context_create_error_parseFromJSON(json_data); + } + + binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(create_ue_context_403_responseJSON, "binaryDataN2Information"); + if (binary_data_n2_information) { + decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information); + if (!cJSON_IsString(binary_data_n2_information)) { + ogs_error("OpenAPI_create_ue_context_403_response_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); + if (!decoded_str_binary_data_n2_information->data) { + ogs_error("OpenAPI_create_ue_context_403_response_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + } + + create_ue_context_403_response_local_var = OpenAPI_create_ue_context_403_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL + ); + + return create_ue_context_403_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_ue_context_create_error_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_create_ue_context_403_response_t *OpenAPI_create_ue_context_403_response_copy(OpenAPI_create_ue_context_403_response_t *dst, OpenAPI_create_ue_context_403_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_create_ue_context_403_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_create_ue_context_403_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_create_ue_context_403_response_free(dst); + dst = OpenAPI_create_ue_context_403_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/create_ue_context_403_response.h b/lib/sbi/openapi/model/create_ue_context_403_response.h new file mode 100644 index 000000000..e6eac5225 --- /dev/null +++ b/lib/sbi/openapi/model/create_ue_context_403_response.h @@ -0,0 +1,41 @@ +/* + * create_ue_context_403_response.h + * + * + */ + +#ifndef _OpenAPI_create_ue_context_403_response_H_ +#define _OpenAPI_create_ue_context_403_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_context_create_error.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_create_ue_context_403_response_s OpenAPI_create_ue_context_403_response_t; +typedef struct OpenAPI_create_ue_context_403_response_s { + struct OpenAPI_ue_context_create_error_s *json_data; + OpenAPI_binary_t* binary_data_n2_information; +} OpenAPI_create_ue_context_403_response_t; + +OpenAPI_create_ue_context_403_response_t *OpenAPI_create_ue_context_403_response_create( + OpenAPI_ue_context_create_error_t *json_data, + OpenAPI_binary_t* binary_data_n2_information +); +void OpenAPI_create_ue_context_403_response_free(OpenAPI_create_ue_context_403_response_t *create_ue_context_403_response); +OpenAPI_create_ue_context_403_response_t *OpenAPI_create_ue_context_403_response_parseFromJSON(cJSON *create_ue_context_403_responseJSON); +cJSON *OpenAPI_create_ue_context_403_response_convertToJSON(OpenAPI_create_ue_context_403_response_t *create_ue_context_403_response); +OpenAPI_create_ue_context_403_response_t *OpenAPI_create_ue_context_403_response_copy(OpenAPI_create_ue_context_403_response_t *dst, OpenAPI_create_ue_context_403_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_create_ue_context_403_response_H_ */ + diff --git a/lib/sbi/openapi/model/create_ue_context_request.c b/lib/sbi/openapi/model/create_ue_context_request.c new file mode 100644 index 000000000..a8eb83a02 --- /dev/null +++ b/lib/sbi/openapi/model/create_ue_context_request.c @@ -0,0 +1,679 @@ + +#include +#include +#include +#include "create_ue_context_request.h" + +OpenAPI_create_ue_context_request_t *OpenAPI_create_ue_context_request_create( + OpenAPI_ue_context_create_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information, + OpenAPI_binary_t* binary_data_n2_information_ext1, + OpenAPI_binary_t* binary_data_n2_information_ext2, + OpenAPI_binary_t* binary_data_n2_information_ext3, + OpenAPI_binary_t* binary_data_n2_information_ext4, + OpenAPI_binary_t* binary_data_n2_information_ext5, + OpenAPI_binary_t* binary_data_n2_information_ext6, + OpenAPI_binary_t* binary_data_n2_information_ext7, + OpenAPI_binary_t* binary_data_n2_information_ext8, + OpenAPI_binary_t* binary_data_n2_information_ext9, + OpenAPI_binary_t* binary_data_n2_information_ext10, + OpenAPI_binary_t* binary_data_n2_information_ext11, + OpenAPI_binary_t* binary_data_n2_information_ext12, + OpenAPI_binary_t* binary_data_n2_information_ext13, + OpenAPI_binary_t* binary_data_n2_information_ext14, + OpenAPI_binary_t* binary_data_n2_information_ext15, + OpenAPI_binary_t* binary_data_n2_information_ext16 +) +{ + OpenAPI_create_ue_context_request_t *create_ue_context_request_local_var = ogs_malloc(sizeof(OpenAPI_create_ue_context_request_t)); + ogs_assert(create_ue_context_request_local_var); + + create_ue_context_request_local_var->json_data = json_data; + create_ue_context_request_local_var->binary_data_n2_information = binary_data_n2_information; + create_ue_context_request_local_var->binary_data_n2_information_ext1 = binary_data_n2_information_ext1; + create_ue_context_request_local_var->binary_data_n2_information_ext2 = binary_data_n2_information_ext2; + create_ue_context_request_local_var->binary_data_n2_information_ext3 = binary_data_n2_information_ext3; + create_ue_context_request_local_var->binary_data_n2_information_ext4 = binary_data_n2_information_ext4; + create_ue_context_request_local_var->binary_data_n2_information_ext5 = binary_data_n2_information_ext5; + create_ue_context_request_local_var->binary_data_n2_information_ext6 = binary_data_n2_information_ext6; + create_ue_context_request_local_var->binary_data_n2_information_ext7 = binary_data_n2_information_ext7; + create_ue_context_request_local_var->binary_data_n2_information_ext8 = binary_data_n2_information_ext8; + create_ue_context_request_local_var->binary_data_n2_information_ext9 = binary_data_n2_information_ext9; + create_ue_context_request_local_var->binary_data_n2_information_ext10 = binary_data_n2_information_ext10; + create_ue_context_request_local_var->binary_data_n2_information_ext11 = binary_data_n2_information_ext11; + create_ue_context_request_local_var->binary_data_n2_information_ext12 = binary_data_n2_information_ext12; + create_ue_context_request_local_var->binary_data_n2_information_ext13 = binary_data_n2_information_ext13; + create_ue_context_request_local_var->binary_data_n2_information_ext14 = binary_data_n2_information_ext14; + create_ue_context_request_local_var->binary_data_n2_information_ext15 = binary_data_n2_information_ext15; + create_ue_context_request_local_var->binary_data_n2_information_ext16 = binary_data_n2_information_ext16; + + return create_ue_context_request_local_var; +} + +void OpenAPI_create_ue_context_request_free(OpenAPI_create_ue_context_request_t *create_ue_context_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == create_ue_context_request) { + return; + } + if (create_ue_context_request->json_data) { + OpenAPI_ue_context_create_data_free(create_ue_context_request->json_data); + create_ue_context_request->json_data = NULL; + } + if (create_ue_context_request->binary_data_n2_information) { + ogs_free(create_ue_context_request->binary_data_n2_information->data); + create_ue_context_request->binary_data_n2_information = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext1) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext1->data); + create_ue_context_request->binary_data_n2_information_ext1 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext2) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext2->data); + create_ue_context_request->binary_data_n2_information_ext2 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext3) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext3->data); + create_ue_context_request->binary_data_n2_information_ext3 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext4) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext4->data); + create_ue_context_request->binary_data_n2_information_ext4 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext5) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext5->data); + create_ue_context_request->binary_data_n2_information_ext5 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext6) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext6->data); + create_ue_context_request->binary_data_n2_information_ext6 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext7) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext7->data); + create_ue_context_request->binary_data_n2_information_ext7 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext8) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext8->data); + create_ue_context_request->binary_data_n2_information_ext8 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext9) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext9->data); + create_ue_context_request->binary_data_n2_information_ext9 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext10) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext10->data); + create_ue_context_request->binary_data_n2_information_ext10 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext11) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext11->data); + create_ue_context_request->binary_data_n2_information_ext11 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext12) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext12->data); + create_ue_context_request->binary_data_n2_information_ext12 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext13) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext13->data); + create_ue_context_request->binary_data_n2_information_ext13 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext14) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext14->data); + create_ue_context_request->binary_data_n2_information_ext14 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext15) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext15->data); + create_ue_context_request->binary_data_n2_information_ext15 = NULL; + } + if (create_ue_context_request->binary_data_n2_information_ext16) { + ogs_free(create_ue_context_request->binary_data_n2_information_ext16->data); + create_ue_context_request->binary_data_n2_information_ext16 = NULL; + } + ogs_free(create_ue_context_request); +} + +cJSON *OpenAPI_create_ue_context_request_convertToJSON(OpenAPI_create_ue_context_request_t *create_ue_context_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (create_ue_context_request == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [CreateUEContext_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (create_ue_context_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_ue_context_create_data_convertToJSON(create_ue_context_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (create_ue_context_request->binary_data_n2_information) { + char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information->data,create_ue_context_request->binary_data_n2_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information); + } + + if (create_ue_context_request->binary_data_n2_information_ext1) { + char* encoded_str_binary_data_n2_information_ext1 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext1->data,create_ue_context_request->binary_data_n2_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt1", encoded_str_binary_data_n2_information_ext1) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext1); + } + + if (create_ue_context_request->binary_data_n2_information_ext2) { + char* encoded_str_binary_data_n2_information_ext2 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext2->data,create_ue_context_request->binary_data_n2_information_ext2->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt2", encoded_str_binary_data_n2_information_ext2) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext2); + } + + if (create_ue_context_request->binary_data_n2_information_ext3) { + char* encoded_str_binary_data_n2_information_ext3 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext3->data,create_ue_context_request->binary_data_n2_information_ext3->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt3", encoded_str_binary_data_n2_information_ext3) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext3); + } + + if (create_ue_context_request->binary_data_n2_information_ext4) { + char* encoded_str_binary_data_n2_information_ext4 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext4->data,create_ue_context_request->binary_data_n2_information_ext4->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt4", encoded_str_binary_data_n2_information_ext4) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext4); + } + + if (create_ue_context_request->binary_data_n2_information_ext5) { + char* encoded_str_binary_data_n2_information_ext5 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext5->data,create_ue_context_request->binary_data_n2_information_ext5->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt5", encoded_str_binary_data_n2_information_ext5) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext5); + } + + if (create_ue_context_request->binary_data_n2_information_ext6) { + char* encoded_str_binary_data_n2_information_ext6 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext6->data,create_ue_context_request->binary_data_n2_information_ext6->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt6", encoded_str_binary_data_n2_information_ext6) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext6); + } + + if (create_ue_context_request->binary_data_n2_information_ext7) { + char* encoded_str_binary_data_n2_information_ext7 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext7->data,create_ue_context_request->binary_data_n2_information_ext7->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt7", encoded_str_binary_data_n2_information_ext7) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext7); + } + + if (create_ue_context_request->binary_data_n2_information_ext8) { + char* encoded_str_binary_data_n2_information_ext8 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext8->data,create_ue_context_request->binary_data_n2_information_ext8->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt8", encoded_str_binary_data_n2_information_ext8) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext8); + } + + if (create_ue_context_request->binary_data_n2_information_ext9) { + char* encoded_str_binary_data_n2_information_ext9 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext9->data,create_ue_context_request->binary_data_n2_information_ext9->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt9", encoded_str_binary_data_n2_information_ext9) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext9); + } + + if (create_ue_context_request->binary_data_n2_information_ext10) { + char* encoded_str_binary_data_n2_information_ext10 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext10->data,create_ue_context_request->binary_data_n2_information_ext10->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt10", encoded_str_binary_data_n2_information_ext10) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext10); + } + + if (create_ue_context_request->binary_data_n2_information_ext11) { + char* encoded_str_binary_data_n2_information_ext11 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext11->data,create_ue_context_request->binary_data_n2_information_ext11->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt11", encoded_str_binary_data_n2_information_ext11) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext11); + } + + if (create_ue_context_request->binary_data_n2_information_ext12) { + char* encoded_str_binary_data_n2_information_ext12 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext12->data,create_ue_context_request->binary_data_n2_information_ext12->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt12", encoded_str_binary_data_n2_information_ext12) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext12); + } + + if (create_ue_context_request->binary_data_n2_information_ext13) { + char* encoded_str_binary_data_n2_information_ext13 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext13->data,create_ue_context_request->binary_data_n2_information_ext13->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt13", encoded_str_binary_data_n2_information_ext13) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext13); + } + + if (create_ue_context_request->binary_data_n2_information_ext14) { + char* encoded_str_binary_data_n2_information_ext14 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext14->data,create_ue_context_request->binary_data_n2_information_ext14->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt14", encoded_str_binary_data_n2_information_ext14) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext14); + } + + if (create_ue_context_request->binary_data_n2_information_ext15) { + char* encoded_str_binary_data_n2_information_ext15 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext15->data,create_ue_context_request->binary_data_n2_information_ext15->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt15", encoded_str_binary_data_n2_information_ext15) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext15); + } + + if (create_ue_context_request->binary_data_n2_information_ext16) { + char* encoded_str_binary_data_n2_information_ext16 = OpenAPI_base64encode(create_ue_context_request->binary_data_n2_information_ext16->data,create_ue_context_request->binary_data_n2_information_ext16->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt16", encoded_str_binary_data_n2_information_ext16) == NULL) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext16]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext16); + } + +end: + return item; +} + +OpenAPI_create_ue_context_request_t *OpenAPI_create_ue_context_request_parseFromJSON(cJSON *create_ue_context_requestJSON) +{ + OpenAPI_create_ue_context_request_t *create_ue_context_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_ue_context_create_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n2_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information = NULL; + cJSON *binary_data_n2_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext1 = NULL; + cJSON *binary_data_n2_information_ext2 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext2 = NULL; + cJSON *binary_data_n2_information_ext3 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext3 = NULL; + cJSON *binary_data_n2_information_ext4 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext4 = NULL; + cJSON *binary_data_n2_information_ext5 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext5 = NULL; + cJSON *binary_data_n2_information_ext6 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext6 = NULL; + cJSON *binary_data_n2_information_ext7 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext7 = NULL; + cJSON *binary_data_n2_information_ext8 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext8 = NULL; + cJSON *binary_data_n2_information_ext9 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext9 = NULL; + cJSON *binary_data_n2_information_ext10 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext10 = NULL; + cJSON *binary_data_n2_information_ext11 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext11 = NULL; + cJSON *binary_data_n2_information_ext12 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext12 = NULL; + cJSON *binary_data_n2_information_ext13 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext13 = NULL; + cJSON *binary_data_n2_information_ext14 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext14 = NULL; + cJSON *binary_data_n2_information_ext15 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext15 = NULL; + cJSON *binary_data_n2_information_ext16 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext16 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_ue_context_create_data_parseFromJSON(json_data); + } + + binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2Information"); + if (binary_data_n2_information) { + decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information); + if (!cJSON_IsString(binary_data_n2_information)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); + if (!decoded_str_binary_data_n2_information->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + } + + binary_data_n2_information_ext1 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt1"); + if (binary_data_n2_information_ext1) { + decoded_str_binary_data_n2_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext1); + if (!cJSON_IsString(binary_data_n2_information_ext1)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + decoded_str_binary_data_n2_information_ext1->data = OpenAPI_base64decode(binary_data_n2_information_ext1->valuestring, strlen(binary_data_n2_information_ext1->valuestring), &decoded_str_binary_data_n2_information_ext1->len); + if (!decoded_str_binary_data_n2_information_ext1->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + } + + binary_data_n2_information_ext2 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt2"); + if (binary_data_n2_information_ext2) { + decoded_str_binary_data_n2_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext2); + if (!cJSON_IsString(binary_data_n2_information_ext2)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + decoded_str_binary_data_n2_information_ext2->data = OpenAPI_base64decode(binary_data_n2_information_ext2->valuestring, strlen(binary_data_n2_information_ext2->valuestring), &decoded_str_binary_data_n2_information_ext2->len); + if (!decoded_str_binary_data_n2_information_ext2->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + } + + binary_data_n2_information_ext3 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt3"); + if (binary_data_n2_information_ext3) { + decoded_str_binary_data_n2_information_ext3 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext3); + if (!cJSON_IsString(binary_data_n2_information_ext3)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + decoded_str_binary_data_n2_information_ext3->data = OpenAPI_base64decode(binary_data_n2_information_ext3->valuestring, strlen(binary_data_n2_information_ext3->valuestring), &decoded_str_binary_data_n2_information_ext3->len); + if (!decoded_str_binary_data_n2_information_ext3->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + } + + binary_data_n2_information_ext4 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt4"); + if (binary_data_n2_information_ext4) { + decoded_str_binary_data_n2_information_ext4 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext4); + if (!cJSON_IsString(binary_data_n2_information_ext4)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + decoded_str_binary_data_n2_information_ext4->data = OpenAPI_base64decode(binary_data_n2_information_ext4->valuestring, strlen(binary_data_n2_information_ext4->valuestring), &decoded_str_binary_data_n2_information_ext4->len); + if (!decoded_str_binary_data_n2_information_ext4->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + } + + binary_data_n2_information_ext5 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt5"); + if (binary_data_n2_information_ext5) { + decoded_str_binary_data_n2_information_ext5 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext5); + if (!cJSON_IsString(binary_data_n2_information_ext5)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + decoded_str_binary_data_n2_information_ext5->data = OpenAPI_base64decode(binary_data_n2_information_ext5->valuestring, strlen(binary_data_n2_information_ext5->valuestring), &decoded_str_binary_data_n2_information_ext5->len); + if (!decoded_str_binary_data_n2_information_ext5->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + } + + binary_data_n2_information_ext6 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt6"); + if (binary_data_n2_information_ext6) { + decoded_str_binary_data_n2_information_ext6 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext6); + if (!cJSON_IsString(binary_data_n2_information_ext6)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + decoded_str_binary_data_n2_information_ext6->data = OpenAPI_base64decode(binary_data_n2_information_ext6->valuestring, strlen(binary_data_n2_information_ext6->valuestring), &decoded_str_binary_data_n2_information_ext6->len); + if (!decoded_str_binary_data_n2_information_ext6->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + } + + binary_data_n2_information_ext7 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt7"); + if (binary_data_n2_information_ext7) { + decoded_str_binary_data_n2_information_ext7 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext7); + if (!cJSON_IsString(binary_data_n2_information_ext7)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + decoded_str_binary_data_n2_information_ext7->data = OpenAPI_base64decode(binary_data_n2_information_ext7->valuestring, strlen(binary_data_n2_information_ext7->valuestring), &decoded_str_binary_data_n2_information_ext7->len); + if (!decoded_str_binary_data_n2_information_ext7->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + } + + binary_data_n2_information_ext8 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt8"); + if (binary_data_n2_information_ext8) { + decoded_str_binary_data_n2_information_ext8 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext8); + if (!cJSON_IsString(binary_data_n2_information_ext8)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + decoded_str_binary_data_n2_information_ext8->data = OpenAPI_base64decode(binary_data_n2_information_ext8->valuestring, strlen(binary_data_n2_information_ext8->valuestring), &decoded_str_binary_data_n2_information_ext8->len); + if (!decoded_str_binary_data_n2_information_ext8->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + } + + binary_data_n2_information_ext9 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt9"); + if (binary_data_n2_information_ext9) { + decoded_str_binary_data_n2_information_ext9 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext9); + if (!cJSON_IsString(binary_data_n2_information_ext9)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + decoded_str_binary_data_n2_information_ext9->data = OpenAPI_base64decode(binary_data_n2_information_ext9->valuestring, strlen(binary_data_n2_information_ext9->valuestring), &decoded_str_binary_data_n2_information_ext9->len); + if (!decoded_str_binary_data_n2_information_ext9->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + } + + binary_data_n2_information_ext10 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt10"); + if (binary_data_n2_information_ext10) { + decoded_str_binary_data_n2_information_ext10 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext10); + if (!cJSON_IsString(binary_data_n2_information_ext10)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + decoded_str_binary_data_n2_information_ext10->data = OpenAPI_base64decode(binary_data_n2_information_ext10->valuestring, strlen(binary_data_n2_information_ext10->valuestring), &decoded_str_binary_data_n2_information_ext10->len); + if (!decoded_str_binary_data_n2_information_ext10->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + } + + binary_data_n2_information_ext11 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt11"); + if (binary_data_n2_information_ext11) { + decoded_str_binary_data_n2_information_ext11 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext11); + if (!cJSON_IsString(binary_data_n2_information_ext11)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + decoded_str_binary_data_n2_information_ext11->data = OpenAPI_base64decode(binary_data_n2_information_ext11->valuestring, strlen(binary_data_n2_information_ext11->valuestring), &decoded_str_binary_data_n2_information_ext11->len); + if (!decoded_str_binary_data_n2_information_ext11->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + } + + binary_data_n2_information_ext12 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt12"); + if (binary_data_n2_information_ext12) { + decoded_str_binary_data_n2_information_ext12 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext12); + if (!cJSON_IsString(binary_data_n2_information_ext12)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + decoded_str_binary_data_n2_information_ext12->data = OpenAPI_base64decode(binary_data_n2_information_ext12->valuestring, strlen(binary_data_n2_information_ext12->valuestring), &decoded_str_binary_data_n2_information_ext12->len); + if (!decoded_str_binary_data_n2_information_ext12->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + } + + binary_data_n2_information_ext13 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt13"); + if (binary_data_n2_information_ext13) { + decoded_str_binary_data_n2_information_ext13 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext13); + if (!cJSON_IsString(binary_data_n2_information_ext13)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + decoded_str_binary_data_n2_information_ext13->data = OpenAPI_base64decode(binary_data_n2_information_ext13->valuestring, strlen(binary_data_n2_information_ext13->valuestring), &decoded_str_binary_data_n2_information_ext13->len); + if (!decoded_str_binary_data_n2_information_ext13->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + } + + binary_data_n2_information_ext14 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt14"); + if (binary_data_n2_information_ext14) { + decoded_str_binary_data_n2_information_ext14 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext14); + if (!cJSON_IsString(binary_data_n2_information_ext14)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + decoded_str_binary_data_n2_information_ext14->data = OpenAPI_base64decode(binary_data_n2_information_ext14->valuestring, strlen(binary_data_n2_information_ext14->valuestring), &decoded_str_binary_data_n2_information_ext14->len); + if (!decoded_str_binary_data_n2_information_ext14->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + } + + binary_data_n2_information_ext15 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt15"); + if (binary_data_n2_information_ext15) { + decoded_str_binary_data_n2_information_ext15 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext15); + if (!cJSON_IsString(binary_data_n2_information_ext15)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + decoded_str_binary_data_n2_information_ext15->data = OpenAPI_base64decode(binary_data_n2_information_ext15->valuestring, strlen(binary_data_n2_information_ext15->valuestring), &decoded_str_binary_data_n2_information_ext15->len); + if (!decoded_str_binary_data_n2_information_ext15->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + } + + binary_data_n2_information_ext16 = cJSON_GetObjectItemCaseSensitive(create_ue_context_requestJSON, "binaryDataN2InformationExt16"); + if (binary_data_n2_information_ext16) { + decoded_str_binary_data_n2_information_ext16 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext16); + if (!cJSON_IsString(binary_data_n2_information_ext16)) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext16]"); + goto end; + } + decoded_str_binary_data_n2_information_ext16->data = OpenAPI_base64decode(binary_data_n2_information_ext16->valuestring, strlen(binary_data_n2_information_ext16->valuestring), &decoded_str_binary_data_n2_information_ext16->len); + if (!decoded_str_binary_data_n2_information_ext16->data) { + ogs_error("OpenAPI_create_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext16]"); + goto end; + } + } + + create_ue_context_request_local_var = OpenAPI_create_ue_context_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL, + binary_data_n2_information_ext1 ? decoded_str_binary_data_n2_information_ext1 : NULL, + binary_data_n2_information_ext2 ? decoded_str_binary_data_n2_information_ext2 : NULL, + binary_data_n2_information_ext3 ? decoded_str_binary_data_n2_information_ext3 : NULL, + binary_data_n2_information_ext4 ? decoded_str_binary_data_n2_information_ext4 : NULL, + binary_data_n2_information_ext5 ? decoded_str_binary_data_n2_information_ext5 : NULL, + binary_data_n2_information_ext6 ? decoded_str_binary_data_n2_information_ext6 : NULL, + binary_data_n2_information_ext7 ? decoded_str_binary_data_n2_information_ext7 : NULL, + binary_data_n2_information_ext8 ? decoded_str_binary_data_n2_information_ext8 : NULL, + binary_data_n2_information_ext9 ? decoded_str_binary_data_n2_information_ext9 : NULL, + binary_data_n2_information_ext10 ? decoded_str_binary_data_n2_information_ext10 : NULL, + binary_data_n2_information_ext11 ? decoded_str_binary_data_n2_information_ext11 : NULL, + binary_data_n2_information_ext12 ? decoded_str_binary_data_n2_information_ext12 : NULL, + binary_data_n2_information_ext13 ? decoded_str_binary_data_n2_information_ext13 : NULL, + binary_data_n2_information_ext14 ? decoded_str_binary_data_n2_information_ext14 : NULL, + binary_data_n2_information_ext15 ? decoded_str_binary_data_n2_information_ext15 : NULL, + binary_data_n2_information_ext16 ? decoded_str_binary_data_n2_information_ext16 : NULL + ); + + return create_ue_context_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_ue_context_create_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_create_ue_context_request_t *OpenAPI_create_ue_context_request_copy(OpenAPI_create_ue_context_request_t *dst, OpenAPI_create_ue_context_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_create_ue_context_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_create_ue_context_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_create_ue_context_request_free(dst); + dst = OpenAPI_create_ue_context_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/inline_object.h b/lib/sbi/openapi/model/create_ue_context_request.h similarity index 70% rename from lib/sbi/openapi/model/inline_object.h rename to lib/sbi/openapi/model/create_ue_context_request.h index 43fe619bb..e1c42ce89 100644 --- a/lib/sbi/openapi/model/inline_object.h +++ b/lib/sbi/openapi/model/create_ue_context_request.h @@ -1,11 +1,11 @@ /* - * inline_object.h + * create_ue_context_request.h * * */ -#ifndef _OpenAPI_inline_object_H_ -#define _OpenAPI_inline_object_H_ +#ifndef _OpenAPI_create_ue_context_request_H_ +#define _OpenAPI_create_ue_context_request_H_ #include #include "../external/cJSON.h" @@ -18,8 +18,8 @@ extern "C" { #endif -typedef struct OpenAPI_inline_object_s OpenAPI_inline_object_t; -typedef struct OpenAPI_inline_object_s { +typedef struct OpenAPI_create_ue_context_request_s OpenAPI_create_ue_context_request_t; +typedef struct OpenAPI_create_ue_context_request_s { struct OpenAPI_ue_context_create_data_s *json_data; OpenAPI_binary_t* binary_data_n2_information; OpenAPI_binary_t* binary_data_n2_information_ext1; @@ -38,9 +38,9 @@ typedef struct OpenAPI_inline_object_s { OpenAPI_binary_t* binary_data_n2_information_ext14; OpenAPI_binary_t* binary_data_n2_information_ext15; OpenAPI_binary_t* binary_data_n2_information_ext16; -} OpenAPI_inline_object_t; +} OpenAPI_create_ue_context_request_t; -OpenAPI_inline_object_t *OpenAPI_inline_object_create( +OpenAPI_create_ue_context_request_t *OpenAPI_create_ue_context_request_create( OpenAPI_ue_context_create_data_t *json_data, OpenAPI_binary_t* binary_data_n2_information, OpenAPI_binary_t* binary_data_n2_information_ext1, @@ -60,14 +60,14 @@ OpenAPI_inline_object_t *OpenAPI_inline_object_create( OpenAPI_binary_t* binary_data_n2_information_ext15, OpenAPI_binary_t* binary_data_n2_information_ext16 ); -void OpenAPI_inline_object_free(OpenAPI_inline_object_t *inline_object); -OpenAPI_inline_object_t *OpenAPI_inline_object_parseFromJSON(cJSON *inline_objectJSON); -cJSON *OpenAPI_inline_object_convertToJSON(OpenAPI_inline_object_t *inline_object); -OpenAPI_inline_object_t *OpenAPI_inline_object_copy(OpenAPI_inline_object_t *dst, OpenAPI_inline_object_t *src); +void OpenAPI_create_ue_context_request_free(OpenAPI_create_ue_context_request_t *create_ue_context_request); +OpenAPI_create_ue_context_request_t *OpenAPI_create_ue_context_request_parseFromJSON(cJSON *create_ue_context_requestJSON); +cJSON *OpenAPI_create_ue_context_request_convertToJSON(OpenAPI_create_ue_context_request_t *create_ue_context_request); +OpenAPI_create_ue_context_request_t *OpenAPI_create_ue_context_request_copy(OpenAPI_create_ue_context_request_t *dst, OpenAPI_create_ue_context_request_t *src); #ifdef __cplusplus } #endif -#endif /* _OpenAPI_inline_object_H_ */ +#endif /* _OpenAPI_create_ue_context_request_H_ */ diff --git a/lib/sbi/openapi/model/data_change_notify.c b/lib/sbi/openapi/model/data_change_notify.c index 1b299d8ab..69619c3e7 100644 --- a/lib/sbi/openapi/model/data_change_notify.c +++ b/lib/sbi/openapi/model/data_change_notify.c @@ -28,34 +28,54 @@ OpenAPI_data_change_notify_t *OpenAPI_data_change_notify_create( void OpenAPI_data_change_notify_free(OpenAPI_data_change_notify_t *data_change_notify) { + OpenAPI_lnode_t *node = NULL; + if (NULL == data_change_notify) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(data_change_notify->original_callback_reference, node) { - ogs_free(node->data); + if (data_change_notify->original_callback_reference) { + OpenAPI_list_for_each(data_change_notify->original_callback_reference, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_change_notify->original_callback_reference); + data_change_notify->original_callback_reference = NULL; } - OpenAPI_list_free(data_change_notify->original_callback_reference); - ogs_free(data_change_notify->ue_id); - OpenAPI_list_for_each(data_change_notify->notify_items, node) { - OpenAPI_notify_item_free(node->data); + if (data_change_notify->ue_id) { + ogs_free(data_change_notify->ue_id); + data_change_notify->ue_id = NULL; } - OpenAPI_list_free(data_change_notify->notify_items); - OpenAPI_sdm_subscription_1_free(data_change_notify->sdm_subscription); - OpenAPI_list_for_each(data_change_notify->additional_sdm_subscriptions, node) { - OpenAPI_sdm_subscription_1_free(node->data); + if (data_change_notify->notify_items) { + OpenAPI_list_for_each(data_change_notify->notify_items, node) { + OpenAPI_notify_item_free(node->data); + } + OpenAPI_list_free(data_change_notify->notify_items); + data_change_notify->notify_items = NULL; } - OpenAPI_list_free(data_change_notify->additional_sdm_subscriptions); - OpenAPI_list_for_each(data_change_notify->subscription_data_subscriptions, node) { - OpenAPI_subscription_data_subscriptions_free(node->data); + if (data_change_notify->sdm_subscription) { + OpenAPI_sdm_subscription_1_free(data_change_notify->sdm_subscription); + data_change_notify->sdm_subscription = NULL; + } + if (data_change_notify->additional_sdm_subscriptions) { + OpenAPI_list_for_each(data_change_notify->additional_sdm_subscriptions, node) { + OpenAPI_sdm_subscription_1_free(node->data); + } + OpenAPI_list_free(data_change_notify->additional_sdm_subscriptions); + data_change_notify->additional_sdm_subscriptions = NULL; + } + if (data_change_notify->subscription_data_subscriptions) { + OpenAPI_list_for_each(data_change_notify->subscription_data_subscriptions, node) { + OpenAPI_subscription_data_subscriptions_free(node->data); + } + OpenAPI_list_free(data_change_notify->subscription_data_subscriptions); + data_change_notify->subscription_data_subscriptions = NULL; } - OpenAPI_list_free(data_change_notify->subscription_data_subscriptions); ogs_free(data_change_notify); } cJSON *OpenAPI_data_change_notify_convertToJSON(OpenAPI_data_change_notify_t *data_change_notify) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (data_change_notify == NULL) { ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [DataChangeNotify]"); @@ -64,19 +84,17 @@ cJSON *OpenAPI_data_change_notify_convertToJSON(OpenAPI_data_change_notify_t *da item = cJSON_CreateObject(); if (data_change_notify->original_callback_reference) { - cJSON *original_callback_reference = cJSON_AddArrayToObject(item, "originalCallbackReference"); - if (original_callback_reference == NULL) { + cJSON *original_callback_referenceList = cJSON_AddArrayToObject(item, "originalCallbackReference"); + if (original_callback_referenceList == NULL) { ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [original_callback_reference]"); goto end; } - - OpenAPI_lnode_t *original_callback_reference_node; - OpenAPI_list_for_each(data_change_notify->original_callback_reference, original_callback_reference_node) { - if (cJSON_AddStringToObject(original_callback_reference, "", (char*)original_callback_reference_node->data) == NULL) { - ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [original_callback_reference]"); - goto end; + OpenAPI_list_for_each(data_change_notify->original_callback_reference, node) { + if (cJSON_AddStringToObject(original_callback_referenceList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [original_callback_reference]"); + goto end; + } } - } } if (data_change_notify->ue_id) { @@ -92,17 +110,13 @@ cJSON *OpenAPI_data_change_notify_convertToJSON(OpenAPI_data_change_notify_t *da ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [notify_items]"); goto end; } - - OpenAPI_lnode_t *notify_items_node; - if (data_change_notify->notify_items) { - OpenAPI_list_for_each(data_change_notify->notify_items, notify_items_node) { - cJSON *itemLocal = OpenAPI_notify_item_convertToJSON(notify_items_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [notify_items]"); - goto end; - } - cJSON_AddItemToArray(notify_itemsList, itemLocal); + OpenAPI_list_for_each(data_change_notify->notify_items, node) { + cJSON *itemLocal = OpenAPI_notify_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [notify_items]"); + goto end; } + cJSON_AddItemToArray(notify_itemsList, itemLocal); } } @@ -125,17 +139,13 @@ cJSON *OpenAPI_data_change_notify_convertToJSON(OpenAPI_data_change_notify_t *da ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [additional_sdm_subscriptions]"); goto end; } - - OpenAPI_lnode_t *additional_sdm_subscriptions_node; - if (data_change_notify->additional_sdm_subscriptions) { - OpenAPI_list_for_each(data_change_notify->additional_sdm_subscriptions, additional_sdm_subscriptions_node) { - cJSON *itemLocal = OpenAPI_sdm_subscription_1_convertToJSON(additional_sdm_subscriptions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [additional_sdm_subscriptions]"); - goto end; - } - cJSON_AddItemToArray(additional_sdm_subscriptionsList, itemLocal); + OpenAPI_list_for_each(data_change_notify->additional_sdm_subscriptions, node) { + cJSON *itemLocal = OpenAPI_sdm_subscription_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [additional_sdm_subscriptions]"); + goto end; } + cJSON_AddItemToArray(additional_sdm_subscriptionsList, itemLocal); } } @@ -145,17 +155,13 @@ cJSON *OpenAPI_data_change_notify_convertToJSON(OpenAPI_data_change_notify_t *da ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [subscription_data_subscriptions]"); goto end; } - - OpenAPI_lnode_t *subscription_data_subscriptions_node; - if (data_change_notify->subscription_data_subscriptions) { - OpenAPI_list_for_each(data_change_notify->subscription_data_subscriptions, subscription_data_subscriptions_node) { - cJSON *itemLocal = OpenAPI_subscription_data_subscriptions_convertToJSON(subscription_data_subscriptions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [subscription_data_subscriptions]"); - goto end; - } - cJSON_AddItemToArray(subscription_data_subscriptionsList, itemLocal); + OpenAPI_list_for_each(data_change_notify->subscription_data_subscriptions, node) { + cJSON *itemLocal = OpenAPI_subscription_data_subscriptions_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_data_change_notify_convertToJSON() failed [subscription_data_subscriptions]"); + goto end; } + cJSON_AddItemToArray(subscription_data_subscriptionsList, itemLocal); } } @@ -166,132 +172,130 @@ end: OpenAPI_data_change_notify_t *OpenAPI_data_change_notify_parseFromJSON(cJSON *data_change_notifyJSON) { OpenAPI_data_change_notify_t *data_change_notify_local_var = NULL; - cJSON *original_callback_reference = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "originalCallbackReference"); - - OpenAPI_list_t *original_callback_referenceList; + OpenAPI_lnode_t *node = NULL; + cJSON *original_callback_reference = NULL; + OpenAPI_list_t *original_callback_referenceList = NULL; + cJSON *ue_id = NULL; + cJSON *notify_items = NULL; + OpenAPI_list_t *notify_itemsList = NULL; + cJSON *sdm_subscription = NULL; + OpenAPI_sdm_subscription_1_t *sdm_subscription_local_nonprim = NULL; + cJSON *additional_sdm_subscriptions = NULL; + OpenAPI_list_t *additional_sdm_subscriptionsList = NULL; + cJSON *subscription_data_subscriptions = NULL; + OpenAPI_list_t *subscription_data_subscriptionsList = NULL; + original_callback_reference = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "originalCallbackReference"); if (original_callback_reference) { - cJSON *original_callback_reference_local; - if (!cJSON_IsArray(original_callback_reference)) { - ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [original_callback_reference]"); - goto end; - } - original_callback_referenceList = OpenAPI_list_create(); + cJSON *original_callback_reference_local = NULL; + if (!cJSON_IsArray(original_callback_reference)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [original_callback_reference]"); + goto end; + } - cJSON_ArrayForEach(original_callback_reference_local, original_callback_reference) { - if (!cJSON_IsString(original_callback_reference_local)) { - ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [original_callback_reference]"); - goto end; - } - OpenAPI_list_add(original_callback_referenceList, ogs_strdup(original_callback_reference_local->valuestring)); - } + original_callback_referenceList = OpenAPI_list_create(); + + cJSON_ArrayForEach(original_callback_reference_local, original_callback_reference) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(original_callback_reference_local)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [original_callback_reference]"); + goto end; + } + OpenAPI_list_add(original_callback_referenceList, ogs_strdup(original_callback_reference_local->valuestring)); + } } - cJSON *ue_id = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "ueId"); - + ue_id = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "ueId"); if (ue_id) { - if (!cJSON_IsString(ue_id)) { + if (!cJSON_IsString(ue_id) && !cJSON_IsNull(ue_id)) { ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [ue_id]"); goto end; } } - cJSON *notify_items = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "notifyItems"); - - OpenAPI_list_t *notify_itemsList; + notify_items = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "notifyItems"); if (notify_items) { - cJSON *notify_items_local_nonprimitive; - if (!cJSON_IsArray(notify_items)){ - ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [notify_items]"); - goto end; - } - - notify_itemsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(notify_items_local_nonprimitive, notify_items ) { - if (!cJSON_IsObject(notify_items_local_nonprimitive)) { + cJSON *notify_items_local = NULL; + if (!cJSON_IsArray(notify_items)) { ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [notify_items]"); goto end; } - OpenAPI_notify_item_t *notify_itemsItem = OpenAPI_notify_item_parseFromJSON(notify_items_local_nonprimitive); - if (!notify_itemsItem) { - ogs_error("No notify_itemsItem"); - OpenAPI_list_free(notify_itemsList); - goto end; + notify_itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notify_items_local, notify_items) { + if (!cJSON_IsObject(notify_items_local)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [notify_items]"); + goto end; + } + OpenAPI_notify_item_t *notify_itemsItem = OpenAPI_notify_item_parseFromJSON(notify_items_local); + if (!notify_itemsItem) { + ogs_error("No notify_itemsItem"); + OpenAPI_list_free(notify_itemsList); + goto end; + } + OpenAPI_list_add(notify_itemsList, notify_itemsItem); } - - OpenAPI_list_add(notify_itemsList, notify_itemsItem); - } } - cJSON *sdm_subscription = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "sdmSubscription"); - - OpenAPI_sdm_subscription_1_t *sdm_subscription_local_nonprim = NULL; + sdm_subscription = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "sdmSubscription"); if (sdm_subscription) { sdm_subscription_local_nonprim = OpenAPI_sdm_subscription_1_parseFromJSON(sdm_subscription); } - cJSON *additional_sdm_subscriptions = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "additionalSdmSubscriptions"); - - OpenAPI_list_t *additional_sdm_subscriptionsList; + additional_sdm_subscriptions = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "additionalSdmSubscriptions"); if (additional_sdm_subscriptions) { - cJSON *additional_sdm_subscriptions_local_nonprimitive; - if (!cJSON_IsArray(additional_sdm_subscriptions)){ - ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [additional_sdm_subscriptions]"); - goto end; - } - - additional_sdm_subscriptionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(additional_sdm_subscriptions_local_nonprimitive, additional_sdm_subscriptions ) { - if (!cJSON_IsObject(additional_sdm_subscriptions_local_nonprimitive)) { + cJSON *additional_sdm_subscriptions_local = NULL; + if (!cJSON_IsArray(additional_sdm_subscriptions)) { ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [additional_sdm_subscriptions]"); goto end; } - OpenAPI_sdm_subscription_1_t *additional_sdm_subscriptionsItem = OpenAPI_sdm_subscription_1_parseFromJSON(additional_sdm_subscriptions_local_nonprimitive); - if (!additional_sdm_subscriptionsItem) { - ogs_error("No additional_sdm_subscriptionsItem"); - OpenAPI_list_free(additional_sdm_subscriptionsList); - goto end; + additional_sdm_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(additional_sdm_subscriptions_local, additional_sdm_subscriptions) { + if (!cJSON_IsObject(additional_sdm_subscriptions_local)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [additional_sdm_subscriptions]"); + goto end; + } + OpenAPI_sdm_subscription_1_t *additional_sdm_subscriptionsItem = OpenAPI_sdm_subscription_1_parseFromJSON(additional_sdm_subscriptions_local); + if (!additional_sdm_subscriptionsItem) { + ogs_error("No additional_sdm_subscriptionsItem"); + OpenAPI_list_free(additional_sdm_subscriptionsList); + goto end; + } + OpenAPI_list_add(additional_sdm_subscriptionsList, additional_sdm_subscriptionsItem); } - - OpenAPI_list_add(additional_sdm_subscriptionsList, additional_sdm_subscriptionsItem); - } } - cJSON *subscription_data_subscriptions = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "subscriptionDataSubscriptions"); - - OpenAPI_list_t *subscription_data_subscriptionsList; + subscription_data_subscriptions = cJSON_GetObjectItemCaseSensitive(data_change_notifyJSON, "subscriptionDataSubscriptions"); if (subscription_data_subscriptions) { - cJSON *subscription_data_subscriptions_local_nonprimitive; - if (!cJSON_IsArray(subscription_data_subscriptions)){ - ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [subscription_data_subscriptions]"); - goto end; - } - - subscription_data_subscriptionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(subscription_data_subscriptions_local_nonprimitive, subscription_data_subscriptions ) { - if (!cJSON_IsObject(subscription_data_subscriptions_local_nonprimitive)) { + cJSON *subscription_data_subscriptions_local = NULL; + if (!cJSON_IsArray(subscription_data_subscriptions)) { ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [subscription_data_subscriptions]"); goto end; } - OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptionsItem = OpenAPI_subscription_data_subscriptions_parseFromJSON(subscription_data_subscriptions_local_nonprimitive); - if (!subscription_data_subscriptionsItem) { - ogs_error("No subscription_data_subscriptionsItem"); - OpenAPI_list_free(subscription_data_subscriptionsList); - goto end; + subscription_data_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscription_data_subscriptions_local, subscription_data_subscriptions) { + if (!cJSON_IsObject(subscription_data_subscriptions_local)) { + ogs_error("OpenAPI_data_change_notify_parseFromJSON() failed [subscription_data_subscriptions]"); + goto end; + } + OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptionsItem = OpenAPI_subscription_data_subscriptions_parseFromJSON(subscription_data_subscriptions_local); + if (!subscription_data_subscriptionsItem) { + ogs_error("No subscription_data_subscriptionsItem"); + OpenAPI_list_free(subscription_data_subscriptionsList); + goto end; + } + OpenAPI_list_add(subscription_data_subscriptionsList, subscription_data_subscriptionsItem); } - - OpenAPI_list_add(subscription_data_subscriptionsList, subscription_data_subscriptionsItem); - } } data_change_notify_local_var = OpenAPI_data_change_notify_create ( original_callback_reference ? original_callback_referenceList : NULL, - ue_id ? ogs_strdup(ue_id->valuestring) : NULL, + ue_id && !cJSON_IsNull(ue_id) ? ogs_strdup(ue_id->valuestring) : NULL, notify_items ? notify_itemsList : NULL, sdm_subscription ? sdm_subscription_local_nonprim : NULL, additional_sdm_subscriptions ? additional_sdm_subscriptionsList : NULL, @@ -300,6 +304,38 @@ OpenAPI_data_change_notify_t *OpenAPI_data_change_notify_parseFromJSON(cJSON *da return data_change_notify_local_var; end: + if (original_callback_referenceList) { + OpenAPI_list_for_each(original_callback_referenceList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(original_callback_referenceList); + original_callback_referenceList = NULL; + } + if (notify_itemsList) { + OpenAPI_list_for_each(notify_itemsList, node) { + OpenAPI_notify_item_free(node->data); + } + OpenAPI_list_free(notify_itemsList); + notify_itemsList = NULL; + } + if (sdm_subscription_local_nonprim) { + OpenAPI_sdm_subscription_1_free(sdm_subscription_local_nonprim); + sdm_subscription_local_nonprim = NULL; + } + if (additional_sdm_subscriptionsList) { + OpenAPI_list_for_each(additional_sdm_subscriptionsList, node) { + OpenAPI_sdm_subscription_1_free(node->data); + } + OpenAPI_list_free(additional_sdm_subscriptionsList); + additional_sdm_subscriptionsList = NULL; + } + if (subscription_data_subscriptionsList) { + OpenAPI_list_for_each(subscription_data_subscriptionsList, node) { + OpenAPI_subscription_data_subscriptions_free(node->data); + } + OpenAPI_list_free(subscription_data_subscriptionsList); + subscription_data_subscriptionsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/data_filter.c b/lib/sbi/openapi/model/data_filter.c index dd413d8b3..4e667ebec 100644 --- a/lib/sbi/openapi/model/data_filter.c +++ b/lib/sbi/openapi/model/data_filter.c @@ -34,49 +34,78 @@ OpenAPI_data_filter_t *OpenAPI_data_filter_create( void OpenAPI_data_filter_free(OpenAPI_data_filter_t *data_filter) { + OpenAPI_lnode_t *node = NULL; + if (NULL == data_filter) { return; } - OpenAPI_lnode_t *node; - OpenAPI_data_ind_free(data_filter->data_ind); - OpenAPI_list_for_each(data_filter->dnns, node) { - ogs_free(node->data); + if (data_filter->data_ind) { + OpenAPI_data_ind_free(data_filter->data_ind); + data_filter->data_ind = NULL; } - OpenAPI_list_free(data_filter->dnns); - OpenAPI_list_for_each(data_filter->snssais, node) { - OpenAPI_snssai_free(node->data); + if (data_filter->dnns) { + OpenAPI_list_for_each(data_filter->dnns, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->dnns); + data_filter->dnns = NULL; } - OpenAPI_list_free(data_filter->snssais); - OpenAPI_list_for_each(data_filter->internal_group_ids, node) { - ogs_free(node->data); + if (data_filter->snssais) { + OpenAPI_list_for_each(data_filter->snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(data_filter->snssais); + data_filter->snssais = NULL; } - OpenAPI_list_free(data_filter->internal_group_ids); - OpenAPI_list_for_each(data_filter->supis, node) { - ogs_free(node->data); + if (data_filter->internal_group_ids) { + OpenAPI_list_for_each(data_filter->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->internal_group_ids); + data_filter->internal_group_ids = NULL; } - OpenAPI_list_free(data_filter->supis); - OpenAPI_list_for_each(data_filter->app_ids, node) { - ogs_free(node->data); + if (data_filter->supis) { + OpenAPI_list_for_each(data_filter->supis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->supis); + data_filter->supis = NULL; } - OpenAPI_list_free(data_filter->app_ids); - OpenAPI_list_for_each(data_filter->ue_ipv4s, node) { - ogs_free(node->data); + if (data_filter->app_ids) { + OpenAPI_list_for_each(data_filter->app_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->app_ids); + data_filter->app_ids = NULL; } - OpenAPI_list_free(data_filter->ue_ipv4s); - OpenAPI_list_for_each(data_filter->ue_ipv6s, node) { - ogs_free(node->data); + if (data_filter->ue_ipv4s) { + OpenAPI_list_for_each(data_filter->ue_ipv4s, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->ue_ipv4s); + data_filter->ue_ipv4s = NULL; } - OpenAPI_list_free(data_filter->ue_ipv6s); - OpenAPI_list_for_each(data_filter->ue_macs, node) { - ogs_free(node->data); + if (data_filter->ue_ipv6s) { + OpenAPI_list_for_each(data_filter->ue_ipv6s, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->ue_ipv6s); + data_filter->ue_ipv6s = NULL; + } + if (data_filter->ue_macs) { + OpenAPI_list_for_each(data_filter->ue_macs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(data_filter->ue_macs); + data_filter->ue_macs = NULL; } - OpenAPI_list_free(data_filter->ue_macs); ogs_free(data_filter); } cJSON *OpenAPI_data_filter_convertToJSON(OpenAPI_data_filter_t *data_filter) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (data_filter == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [DataFilter]"); @@ -84,6 +113,10 @@ cJSON *OpenAPI_data_filter_convertToJSON(OpenAPI_data_filter_t *data_filter) } item = cJSON_CreateObject(); + if (!data_filter->data_ind) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [data_ind]"); + return NULL; + } cJSON *data_ind_local_JSON = OpenAPI_data_ind_convertToJSON(data_filter->data_ind); if (data_ind_local_JSON == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [data_ind]"); @@ -96,19 +129,17 @@ cJSON *OpenAPI_data_filter_convertToJSON(OpenAPI_data_filter_t *data_filter) } if (data_filter->dnns) { - cJSON *dnns = cJSON_AddArrayToObject(item, "dnns"); - if (dnns == NULL) { + cJSON *dnnsList = cJSON_AddArrayToObject(item, "dnns"); + if (dnnsList == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [dnns]"); goto end; } - - OpenAPI_lnode_t *dnns_node; - OpenAPI_list_for_each(data_filter->dnns, dnns_node) { - if (cJSON_AddStringToObject(dnns, "", (char*)dnns_node->data) == NULL) { - ogs_error("OpenAPI_data_filter_convertToJSON() failed [dnns]"); - goto end; + OpenAPI_list_for_each(data_filter->dnns, node) { + if (cJSON_AddStringToObject(dnnsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [dnns]"); + goto end; + } } - } } if (data_filter->snssais) { @@ -117,114 +148,98 @@ cJSON *OpenAPI_data_filter_convertToJSON(OpenAPI_data_filter_t *data_filter) ogs_error("OpenAPI_data_filter_convertToJSON() failed [snssais]"); goto end; } - - OpenAPI_lnode_t *snssais_node; - if (data_filter->snssais) { - OpenAPI_list_for_each(data_filter->snssais, snssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_data_filter_convertToJSON() failed [snssais]"); - goto end; - } - cJSON_AddItemToArray(snssaisList, itemLocal); + OpenAPI_list_for_each(data_filter->snssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [snssais]"); + goto end; } + cJSON_AddItemToArray(snssaisList, itemLocal); } } if (data_filter->internal_group_ids) { - cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); - if (internal_group_ids == NULL) { + cJSON *internal_group_idsList = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_idsList == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [internal_group_ids]"); goto end; } - - OpenAPI_lnode_t *internal_group_ids_node; - OpenAPI_list_for_each(data_filter->internal_group_ids, internal_group_ids_node) { - if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { - ogs_error("OpenAPI_data_filter_convertToJSON() failed [internal_group_ids]"); - goto end; + OpenAPI_list_for_each(data_filter->internal_group_ids, node) { + if (cJSON_AddStringToObject(internal_group_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [internal_group_ids]"); + goto end; + } } - } } if (data_filter->supis) { - cJSON *supis = cJSON_AddArrayToObject(item, "supis"); - if (supis == NULL) { + cJSON *supisList = cJSON_AddArrayToObject(item, "supis"); + if (supisList == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [supis]"); goto end; } - - OpenAPI_lnode_t *supis_node; - OpenAPI_list_for_each(data_filter->supis, supis_node) { - if (cJSON_AddStringToObject(supis, "", (char*)supis_node->data) == NULL) { - ogs_error("OpenAPI_data_filter_convertToJSON() failed [supis]"); - goto end; + OpenAPI_list_for_each(data_filter->supis, node) { + if (cJSON_AddStringToObject(supisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [supis]"); + goto end; + } } - } } if (data_filter->app_ids) { - cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds"); - if (app_ids == NULL) { + cJSON *app_idsList = cJSON_AddArrayToObject(item, "appIds"); + if (app_idsList == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [app_ids]"); goto end; } - - OpenAPI_lnode_t *app_ids_node; - OpenAPI_list_for_each(data_filter->app_ids, app_ids_node) { - if (cJSON_AddStringToObject(app_ids, "", (char*)app_ids_node->data) == NULL) { - ogs_error("OpenAPI_data_filter_convertToJSON() failed [app_ids]"); - goto end; + OpenAPI_list_for_each(data_filter->app_ids, node) { + if (cJSON_AddStringToObject(app_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [app_ids]"); + goto end; + } } - } } if (data_filter->ue_ipv4s) { - cJSON *ue_ipv4s = cJSON_AddArrayToObject(item, "ueIpv4s"); - if (ue_ipv4s == NULL) { + cJSON *ue_ipv4sList = cJSON_AddArrayToObject(item, "ueIpv4s"); + if (ue_ipv4sList == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv4s]"); goto end; } - - OpenAPI_lnode_t *ue_ipv4s_node; - OpenAPI_list_for_each(data_filter->ue_ipv4s, ue_ipv4s_node) { - if (cJSON_AddStringToObject(ue_ipv4s, "", (char*)ue_ipv4s_node->data) == NULL) { - ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv4s]"); - goto end; + OpenAPI_list_for_each(data_filter->ue_ipv4s, node) { + if (cJSON_AddStringToObject(ue_ipv4sList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv4s]"); + goto end; + } } - } } if (data_filter->ue_ipv6s) { - cJSON *ue_ipv6s = cJSON_AddArrayToObject(item, "ueIpv6s"); - if (ue_ipv6s == NULL) { + cJSON *ue_ipv6sList = cJSON_AddArrayToObject(item, "ueIpv6s"); + if (ue_ipv6sList == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv6s]"); goto end; } - - OpenAPI_lnode_t *ue_ipv6s_node; - OpenAPI_list_for_each(data_filter->ue_ipv6s, ue_ipv6s_node) { - if (cJSON_AddStringToObject(ue_ipv6s, "", (char*)ue_ipv6s_node->data) == NULL) { - ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv6s]"); - goto end; + OpenAPI_list_for_each(data_filter->ue_ipv6s, node) { + if (cJSON_AddStringToObject(ue_ipv6sList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_ipv6s]"); + goto end; + } } - } } if (data_filter->ue_macs) { - cJSON *ue_macs = cJSON_AddArrayToObject(item, "ueMacs"); - if (ue_macs == NULL) { + cJSON *ue_macsList = cJSON_AddArrayToObject(item, "ueMacs"); + if (ue_macsList == NULL) { ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_macs]"); goto end; } - - OpenAPI_lnode_t *ue_macs_node; - OpenAPI_list_for_each(data_filter->ue_macs, ue_macs_node) { - if (cJSON_AddStringToObject(ue_macs, "", (char*)ue_macs_node->data) == NULL) { - ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_macs]"); - goto end; + OpenAPI_list_for_each(data_filter->ue_macs, node) { + if (cJSON_AddStringToObject(ue_macsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_data_filter_convertToJSON() failed [ue_macs]"); + goto end; + } } - } } end: @@ -234,182 +249,202 @@ end: OpenAPI_data_filter_t *OpenAPI_data_filter_parseFromJSON(cJSON *data_filterJSON) { OpenAPI_data_filter_t *data_filter_local_var = NULL; - cJSON *data_ind = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "dataInd"); + OpenAPI_lnode_t *node = NULL; + cJSON *data_ind = NULL; + OpenAPI_data_ind_t *data_ind_local_nonprim = NULL; + cJSON *dnns = NULL; + OpenAPI_list_t *dnnsList = NULL; + cJSON *snssais = NULL; + OpenAPI_list_t *snssaisList = NULL; + cJSON *internal_group_ids = NULL; + OpenAPI_list_t *internal_group_idsList = NULL; + cJSON *supis = NULL; + OpenAPI_list_t *supisList = NULL; + cJSON *app_ids = NULL; + OpenAPI_list_t *app_idsList = NULL; + cJSON *ue_ipv4s = NULL; + OpenAPI_list_t *ue_ipv4sList = NULL; + cJSON *ue_ipv6s = NULL; + OpenAPI_list_t *ue_ipv6sList = NULL; + cJSON *ue_macs = NULL; + OpenAPI_list_t *ue_macsList = NULL; + data_ind = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "dataInd"); if (!data_ind) { ogs_error("OpenAPI_data_filter_parseFromJSON() failed [data_ind]"); goto end; } - - OpenAPI_data_ind_t *data_ind_local_nonprim = NULL; data_ind_local_nonprim = OpenAPI_data_ind_parseFromJSON(data_ind); - cJSON *dnns = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "dnns"); - - OpenAPI_list_t *dnnsList; + dnns = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "dnns"); if (dnns) { - cJSON *dnns_local; - if (!cJSON_IsArray(dnns)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [dnns]"); - goto end; - } - dnnsList = OpenAPI_list_create(); + cJSON *dnns_local = NULL; + if (!cJSON_IsArray(dnns)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [dnns]"); + goto end; + } - cJSON_ArrayForEach(dnns_local, dnns) { - if (!cJSON_IsString(dnns_local)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [dnns]"); - goto end; - } - OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); - } + dnnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnns_local, dnns) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnns_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [dnns]"); + goto end; + } + OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); + } } - cJSON *snssais = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "snssais"); - - OpenAPI_list_t *snssaisList; + snssais = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "snssais"); if (snssais) { - cJSON *snssais_local_nonprimitive; - if (!cJSON_IsArray(snssais)){ - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [snssais]"); - goto end; - } - - snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(snssais_local_nonprimitive, snssais ) { - if (!cJSON_IsObject(snssais_local_nonprimitive)) { + cJSON *snssais_local = NULL; + if (!cJSON_IsArray(snssais)) { ogs_error("OpenAPI_data_filter_parseFromJSON() failed [snssais]"); goto end; } - OpenAPI_snssai_t *snssaisItem = OpenAPI_snssai_parseFromJSON(snssais_local_nonprimitive); - if (!snssaisItem) { - ogs_error("No snssaisItem"); - OpenAPI_list_free(snssaisList); + snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssais_local, snssais) { + if (!cJSON_IsObject(snssais_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [snssais]"); + goto end; + } + OpenAPI_snssai_t *snssaisItem = OpenAPI_snssai_parseFromJSON(snssais_local); + if (!snssaisItem) { + ogs_error("No snssaisItem"); + OpenAPI_list_free(snssaisList); + goto end; + } + OpenAPI_list_add(snssaisList, snssaisItem); + } + } + + internal_group_ids = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "internalGroupIds"); + if (internal_group_ids) { + cJSON *internal_group_ids_local = NULL; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [internal_group_ids]"); goto end; } - OpenAPI_list_add(snssaisList, snssaisItem); - } + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } } - cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "internalGroupIds"); - - OpenAPI_list_t *internal_group_idsList; - if (internal_group_ids) { - cJSON *internal_group_ids_local; - if (!cJSON_IsArray(internal_group_ids)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - internal_group_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { - if (!cJSON_IsString(internal_group_ids_local)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); - } - } - - cJSON *supis = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "supis"); - - OpenAPI_list_t *supisList; + supis = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "supis"); if (supis) { - cJSON *supis_local; - if (!cJSON_IsArray(supis)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [supis]"); - goto end; - } - supisList = OpenAPI_list_create(); + cJSON *supis_local = NULL; + if (!cJSON_IsArray(supis)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [supis]"); + goto end; + } - cJSON_ArrayForEach(supis_local, supis) { - if (!cJSON_IsString(supis_local)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [supis]"); - goto end; - } - OpenAPI_list_add(supisList, ogs_strdup(supis_local->valuestring)); - } + supisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supis_local, supis) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(supis_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [supis]"); + goto end; + } + OpenAPI_list_add(supisList, ogs_strdup(supis_local->valuestring)); + } } - cJSON *app_ids = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "appIds"); - - OpenAPI_list_t *app_idsList; + app_ids = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "appIds"); if (app_ids) { - cJSON *app_ids_local; - if (!cJSON_IsArray(app_ids)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [app_ids]"); - goto end; - } - app_idsList = OpenAPI_list_create(); + cJSON *app_ids_local = NULL; + if (!cJSON_IsArray(app_ids)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [app_ids]"); + goto end; + } - cJSON_ArrayForEach(app_ids_local, app_ids) { - if (!cJSON_IsString(app_ids_local)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [app_ids]"); - goto end; - } - OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); - } + app_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_ids_local, app_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(app_ids_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [app_ids]"); + goto end; + } + OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); + } } - cJSON *ue_ipv4s = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueIpv4s"); - - OpenAPI_list_t *ue_ipv4sList; + ue_ipv4s = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueIpv4s"); if (ue_ipv4s) { - cJSON *ue_ipv4s_local; - if (!cJSON_IsArray(ue_ipv4s)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv4s]"); - goto end; - } - ue_ipv4sList = OpenAPI_list_create(); + cJSON *ue_ipv4s_local = NULL; + if (!cJSON_IsArray(ue_ipv4s)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv4s]"); + goto end; + } - cJSON_ArrayForEach(ue_ipv4s_local, ue_ipv4s) { - if (!cJSON_IsString(ue_ipv4s_local)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv4s]"); - goto end; - } - OpenAPI_list_add(ue_ipv4sList, ogs_strdup(ue_ipv4s_local->valuestring)); - } + ue_ipv4sList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_ipv4s_local, ue_ipv4s) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ue_ipv4s_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv4s]"); + goto end; + } + OpenAPI_list_add(ue_ipv4sList, ogs_strdup(ue_ipv4s_local->valuestring)); + } } - cJSON *ue_ipv6s = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueIpv6s"); - - OpenAPI_list_t *ue_ipv6sList; + ue_ipv6s = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueIpv6s"); if (ue_ipv6s) { - cJSON *ue_ipv6s_local; - if (!cJSON_IsArray(ue_ipv6s)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv6s]"); - goto end; - } - ue_ipv6sList = OpenAPI_list_create(); + cJSON *ue_ipv6s_local = NULL; + if (!cJSON_IsArray(ue_ipv6s)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv6s]"); + goto end; + } - cJSON_ArrayForEach(ue_ipv6s_local, ue_ipv6s) { - if (!cJSON_IsString(ue_ipv6s_local)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv6s]"); - goto end; - } - OpenAPI_list_add(ue_ipv6sList, ogs_strdup(ue_ipv6s_local->valuestring)); - } + ue_ipv6sList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_ipv6s_local, ue_ipv6s) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ue_ipv6s_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_ipv6s]"); + goto end; + } + OpenAPI_list_add(ue_ipv6sList, ogs_strdup(ue_ipv6s_local->valuestring)); + } } - cJSON *ue_macs = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueMacs"); - - OpenAPI_list_t *ue_macsList; + ue_macs = cJSON_GetObjectItemCaseSensitive(data_filterJSON, "ueMacs"); if (ue_macs) { - cJSON *ue_macs_local; - if (!cJSON_IsArray(ue_macs)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_macs]"); - goto end; - } - ue_macsList = OpenAPI_list_create(); + cJSON *ue_macs_local = NULL; + if (!cJSON_IsArray(ue_macs)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_macs]"); + goto end; + } - cJSON_ArrayForEach(ue_macs_local, ue_macs) { - if (!cJSON_IsString(ue_macs_local)) { - ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_macs]"); - goto end; - } - OpenAPI_list_add(ue_macsList, ogs_strdup(ue_macs_local->valuestring)); - } + ue_macsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_macs_local, ue_macs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ue_macs_local)) { + ogs_error("OpenAPI_data_filter_parseFromJSON() failed [ue_macs]"); + goto end; + } + OpenAPI_list_add(ue_macsList, ogs_strdup(ue_macs_local->valuestring)); + } } data_filter_local_var = OpenAPI_data_filter_create ( @@ -426,6 +461,66 @@ OpenAPI_data_filter_t *OpenAPI_data_filter_parseFromJSON(cJSON *data_filterJSON) return data_filter_local_var; end: + if (data_ind_local_nonprim) { + OpenAPI_data_ind_free(data_ind_local_nonprim); + data_ind_local_nonprim = NULL; + } + if (dnnsList) { + OpenAPI_list_for_each(dnnsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnnsList); + dnnsList = NULL; + } + if (snssaisList) { + OpenAPI_list_for_each(snssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(snssaisList); + snssaisList = NULL; + } + if (internal_group_idsList) { + OpenAPI_list_for_each(internal_group_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(internal_group_idsList); + internal_group_idsList = NULL; + } + if (supisList) { + OpenAPI_list_for_each(supisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(supisList); + supisList = NULL; + } + if (app_idsList) { + OpenAPI_list_for_each(app_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(app_idsList); + app_idsList = NULL; + } + if (ue_ipv4sList) { + OpenAPI_list_for_each(ue_ipv4sList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_ipv4sList); + ue_ipv4sList = NULL; + } + if (ue_ipv6sList) { + OpenAPI_list_for_each(ue_ipv6sList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_ipv6sList); + ue_ipv6sList = NULL; + } + if (ue_macsList) { + OpenAPI_list_for_each(ue_macsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_macsList); + ue_macsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/data_ind.c b/lib/sbi/openapi/model/data_ind.c index d71c0898c..25b7b543d 100644 --- a/lib/sbi/openapi/model/data_ind.c +++ b/lib/sbi/openapi/model/data_ind.c @@ -16,16 +16,18 @@ OpenAPI_data_ind_t *OpenAPI_data_ind_create( void OpenAPI_data_ind_free(OpenAPI_data_ind_t *data_ind) { + OpenAPI_lnode_t *node = NULL; + if (NULL == data_ind) { return; } - OpenAPI_lnode_t *node; ogs_free(data_ind); } cJSON *OpenAPI_data_ind_convertToJSON(OpenAPI_data_ind_t *data_ind) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (data_ind == NULL) { ogs_error("OpenAPI_data_ind_convertToJSON() failed [DataInd]"); @@ -40,6 +42,7 @@ end: OpenAPI_data_ind_t *OpenAPI_data_ind_parseFromJSON(cJSON *data_indJSON) { OpenAPI_data_ind_t *data_ind_local_var = NULL; + OpenAPI_lnode_t *node = NULL; data_ind_local_var = OpenAPI_data_ind_create ( ); diff --git a/lib/sbi/openapi/model/data_set_name.c b/lib/sbi/openapi/model/data_set_name.c index fdfae5280..8aa5b1c9b 100644 --- a/lib/sbi/openapi/model/data_set_name.c +++ b/lib/sbi/openapi/model/data_set_name.c @@ -6,7 +6,7 @@ char* OpenAPI_data_set_name_ToString(OpenAPI_data_set_name_e data_set_name) { - const char *data_set_nameArray[] = { "NULL", "AM", "SMF_SEL", "SMS_SUB", "SM", "TRACE", "SMS_MNG", "LCS_PRIVACY", "LCS_MO", "LCS_BCA", "V2X" }; + const char *data_set_nameArray[] = { "NULL", "AM", "SMF_SEL", "UEC_SMF", "UEC_SMSF", "SMS_SUB", "SM", "TRACE", "SMS_MNG", "LCS_PRIVACY", "LCS_MO", "UEC_AMF", "V2X" }; size_t sizeofArray = sizeof(data_set_nameArray) / sizeof(data_set_nameArray[0]); if (data_set_name < sizeofArray) return (char *)data_set_nameArray[data_set_name]; @@ -17,7 +17,7 @@ char* OpenAPI_data_set_name_ToString(OpenAPI_data_set_name_e data_set_name) OpenAPI_data_set_name_e OpenAPI_data_set_name_FromString(char* data_set_name) { int stringToReturn = 0; - const char *data_set_nameArray[] = { "NULL", "AM", "SMF_SEL", "SMS_SUB", "SM", "TRACE", "SMS_MNG", "LCS_PRIVACY", "LCS_MO", "LCS_BCA", "V2X" }; + const char *data_set_nameArray[] = { "NULL", "AM", "SMF_SEL", "UEC_SMF", "UEC_SMSF", "SMS_SUB", "SM", "TRACE", "SMS_MNG", "LCS_PRIVACY", "LCS_MO", "UEC_AMF", "V2X" }; size_t sizeofArray = sizeof(data_set_nameArray) / sizeof(data_set_nameArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(data_set_name, data_set_nameArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/data_set_name.h b/lib/sbi/openapi/model/data_set_name.h index 1ccc35dd4..c48699b9a 100644 --- a/lib/sbi/openapi/model/data_set_name.h +++ b/lib/sbi/openapi/model/data_set_name.h @@ -17,7 +17,7 @@ extern "C" { #endif -typedef enum { OpenAPI_data_set_name_NULL = 0, OpenAPI_data_set_name_AM, OpenAPI_data_set_name_SMF_SEL, OpenAPI_data_set_name_SMS_SUB, OpenAPI_data_set_name_SM, OpenAPI_data_set_name_TRACE, OpenAPI_data_set_name_SMS_MNG, OpenAPI_data_set_name_LCS_PRIVACY, OpenAPI_data_set_name_LCS_MO, OpenAPI_data_set_name_LCS_BCA, OpenAPI_data_set_name_V2X } OpenAPI_data_set_name_e; +typedef enum { OpenAPI_data_set_name_NULL = 0, OpenAPI_data_set_name_AM, OpenAPI_data_set_name_SMF_SEL, OpenAPI_data_set_name_UEC_SMF, OpenAPI_data_set_name_UEC_SMSF, OpenAPI_data_set_name_SMS_SUB, OpenAPI_data_set_name_SM, OpenAPI_data_set_name_TRACE, OpenAPI_data_set_name_SMS_MNG, OpenAPI_data_set_name_LCS_PRIVACY, OpenAPI_data_set_name_LCS_MO, OpenAPI_data_set_name_UEC_AMF, OpenAPI_data_set_name_V2X } OpenAPI_data_set_name_e; char* OpenAPI_data_set_name_ToString(OpenAPI_data_set_name_e data_set_name); diff --git a/lib/sbi/openapi/model/datalink_reporting_configuration.c b/lib/sbi/openapi/model/datalink_reporting_configuration.c index 51ebb59ad..d0109919d 100644 --- a/lib/sbi/openapi/model/datalink_reporting_configuration.c +++ b/lib/sbi/openapi/model/datalink_reporting_configuration.c @@ -24,23 +24,37 @@ OpenAPI_datalink_reporting_configuration_t *OpenAPI_datalink_reporting_configura void OpenAPI_datalink_reporting_configuration_free(OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == datalink_reporting_configuration) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(datalink_reporting_configuration->ddd_traffic_des, node) { - OpenAPI_ddd_traffic_descriptor_free(node->data); + if (datalink_reporting_configuration->ddd_traffic_des) { + OpenAPI_list_for_each(datalink_reporting_configuration->ddd_traffic_des, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(datalink_reporting_configuration->ddd_traffic_des); + datalink_reporting_configuration->ddd_traffic_des = NULL; + } + if (datalink_reporting_configuration->dnn) { + ogs_free(datalink_reporting_configuration->dnn); + datalink_reporting_configuration->dnn = NULL; + } + if (datalink_reporting_configuration->slice) { + OpenAPI_snssai_free(datalink_reporting_configuration->slice); + datalink_reporting_configuration->slice = NULL; + } + if (datalink_reporting_configuration->ddd_status_list) { + OpenAPI_list_free(datalink_reporting_configuration->ddd_status_list); + datalink_reporting_configuration->ddd_status_list = NULL; } - OpenAPI_list_free(datalink_reporting_configuration->ddd_traffic_des); - ogs_free(datalink_reporting_configuration->dnn); - OpenAPI_snssai_free(datalink_reporting_configuration->slice); - OpenAPI_list_free(datalink_reporting_configuration->ddd_status_list); ogs_free(datalink_reporting_configuration); } cJSON *OpenAPI_datalink_reporting_configuration_convertToJSON(OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (datalink_reporting_configuration == NULL) { ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [DatalinkReportingConfiguration]"); @@ -54,17 +68,13 @@ cJSON *OpenAPI_datalink_reporting_configuration_convertToJSON(OpenAPI_datalink_r ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_traffic_des]"); goto end; } - - OpenAPI_lnode_t *ddd_traffic_des_node; - if (datalink_reporting_configuration->ddd_traffic_des) { - OpenAPI_list_for_each(datalink_reporting_configuration->ddd_traffic_des, ddd_traffic_des_node) { - cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(ddd_traffic_des_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_traffic_des]"); - goto end; - } - cJSON_AddItemToArray(ddd_traffic_desList, itemLocal); + OpenAPI_list_for_each(datalink_reporting_configuration->ddd_traffic_des, node) { + cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_traffic_des]"); + goto end; } + cJSON_AddItemToArray(ddd_traffic_desList, itemLocal); } } @@ -88,15 +98,14 @@ cJSON *OpenAPI_datalink_reporting_configuration_convertToJSON(OpenAPI_datalink_r } } - if (datalink_reporting_configuration->ddd_status_list) { - cJSON *ddd_status_list = cJSON_AddArrayToObject(item, "dddStatusList"); - if (ddd_status_list == NULL) { + if (datalink_reporting_configuration->ddd_status_list != OpenAPI_dl_data_delivery_status_NULL) { + cJSON *ddd_status_listList = cJSON_AddArrayToObject(item, "dddStatusList"); + if (ddd_status_listList == NULL) { ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_status_list]"); goto end; } - OpenAPI_lnode_t *ddd_status_list_node; - OpenAPI_list_for_each(datalink_reporting_configuration->ddd_status_list, ddd_status_list_node) { - if (cJSON_AddStringToObject(ddd_status_list, "", OpenAPI_dl_data_delivery_status_ToString((intptr_t)ddd_status_list_node->data)) == NULL) { + OpenAPI_list_for_each(datalink_reporting_configuration->ddd_status_list, node) { + if (cJSON_AddStringToObject(ddd_status_listList, "", OpenAPI_dl_data_delivery_status_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_status_list]"); goto end; } @@ -110,82 +119,95 @@ end: OpenAPI_datalink_reporting_configuration_t *OpenAPI_datalink_reporting_configuration_parseFromJSON(cJSON *datalink_reporting_configurationJSON) { OpenAPI_datalink_reporting_configuration_t *datalink_reporting_configuration_local_var = NULL; - cJSON *ddd_traffic_des = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dddTrafficDes"); - - OpenAPI_list_t *ddd_traffic_desList; + OpenAPI_lnode_t *node = NULL; + cJSON *ddd_traffic_des = NULL; + OpenAPI_list_t *ddd_traffic_desList = NULL; + cJSON *dnn = NULL; + cJSON *slice = NULL; + OpenAPI_snssai_t *slice_local_nonprim = NULL; + cJSON *ddd_status_list = NULL; + OpenAPI_list_t *ddd_status_listList = NULL; + ddd_traffic_des = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dddTrafficDes"); if (ddd_traffic_des) { - cJSON *ddd_traffic_des_local_nonprimitive; - if (!cJSON_IsArray(ddd_traffic_des)){ - ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_traffic_des]"); - goto end; - } - - ddd_traffic_desList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ddd_traffic_des_local_nonprimitive, ddd_traffic_des ) { - if (!cJSON_IsObject(ddd_traffic_des_local_nonprimitive)) { + cJSON *ddd_traffic_des_local = NULL; + if (!cJSON_IsArray(ddd_traffic_des)) { ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_traffic_des]"); goto end; } - OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_desItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_des_local_nonprimitive); - if (!ddd_traffic_desItem) { - ogs_error("No ddd_traffic_desItem"); - OpenAPI_list_free(ddd_traffic_desList); - goto end; + ddd_traffic_desList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ddd_traffic_des_local, ddd_traffic_des) { + if (!cJSON_IsObject(ddd_traffic_des_local)) { + ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_traffic_des]"); + goto end; + } + OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_desItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_des_local); + if (!ddd_traffic_desItem) { + ogs_error("No ddd_traffic_desItem"); + OpenAPI_list_free(ddd_traffic_desList); + goto end; + } + OpenAPI_list_add(ddd_traffic_desList, ddd_traffic_desItem); } - - OpenAPI_list_add(ddd_traffic_desList, ddd_traffic_desItem); - } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *slice = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "slice"); - - OpenAPI_snssai_t *slice_local_nonprim = NULL; + slice = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "slice"); if (slice) { slice_local_nonprim = OpenAPI_snssai_parseFromJSON(slice); } - cJSON *ddd_status_list = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dddStatusList"); - - OpenAPI_list_t *ddd_status_listList; + ddd_status_list = cJSON_GetObjectItemCaseSensitive(datalink_reporting_configurationJSON, "dddStatusList"); if (ddd_status_list) { - cJSON *ddd_status_list_local_nonprimitive; - if (!cJSON_IsArray(ddd_status_list)) { - ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_status_list]"); - goto end; - } - - ddd_status_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ddd_status_list_local_nonprimitive, ddd_status_list ) { - if (!cJSON_IsString(ddd_status_list_local_nonprimitive)){ + cJSON *ddd_status_list_local = NULL; + if (!cJSON_IsArray(ddd_status_list)) { ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_status_list]"); goto end; } - OpenAPI_list_add(ddd_status_listList, (void *)OpenAPI_dl_data_delivery_status_FromString(ddd_status_list_local_nonprimitive->valuestring)); - } + ddd_status_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ddd_status_list_local, ddd_status_list) { + if (!cJSON_IsString(ddd_status_list_local)) { + ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_status_list]"); + goto end; + } + OpenAPI_list_add(ddd_status_listList, (void *)OpenAPI_dl_data_delivery_status_FromString(ddd_status_list_local->valuestring)); + } } datalink_reporting_configuration_local_var = OpenAPI_datalink_reporting_configuration_create ( ddd_traffic_des ? ddd_traffic_desList : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, slice ? slice_local_nonprim : NULL, ddd_status_list ? ddd_status_listList : NULL ); return datalink_reporting_configuration_local_var; end: + if (ddd_traffic_desList) { + OpenAPI_list_for_each(ddd_traffic_desList, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(ddd_traffic_desList); + ddd_traffic_desList = NULL; + } + if (slice_local_nonprim) { + OpenAPI_snssai_free(slice_local_nonprim); + slice_local_nonprim = NULL; + } + if (ddd_status_listList) { + OpenAPI_list_free(ddd_status_listList); + ddd_status_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ddd_traffic_descriptor.c b/lib/sbi/openapi/model/ddd_traffic_descriptor.c index 0761969e7..b306488ce 100644 --- a/lib/sbi/openapi/model/ddd_traffic_descriptor.c +++ b/lib/sbi/openapi/model/ddd_traffic_descriptor.c @@ -26,19 +26,30 @@ OpenAPI_ddd_traffic_descriptor_t *OpenAPI_ddd_traffic_descriptor_create( void OpenAPI_ddd_traffic_descriptor_free(OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ddd_traffic_descriptor) { return; } - OpenAPI_lnode_t *node; - ogs_free(ddd_traffic_descriptor->ipv4_addr); - ogs_free(ddd_traffic_descriptor->ipv6_addr); - ogs_free(ddd_traffic_descriptor->mac_addr); + if (ddd_traffic_descriptor->ipv4_addr) { + ogs_free(ddd_traffic_descriptor->ipv4_addr); + ddd_traffic_descriptor->ipv4_addr = NULL; + } + if (ddd_traffic_descriptor->ipv6_addr) { + ogs_free(ddd_traffic_descriptor->ipv6_addr); + ddd_traffic_descriptor->ipv6_addr = NULL; + } + if (ddd_traffic_descriptor->mac_addr) { + ogs_free(ddd_traffic_descriptor->mac_addr); + ddd_traffic_descriptor->mac_addr = NULL; + } ogs_free(ddd_traffic_descriptor); } cJSON *OpenAPI_ddd_traffic_descriptor_convertToJSON(OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ddd_traffic_descriptor == NULL) { ogs_error("OpenAPI_ddd_traffic_descriptor_convertToJSON() failed [DddTrafficDescriptor]"); @@ -81,26 +92,28 @@ end: OpenAPI_ddd_traffic_descriptor_t *OpenAPI_ddd_traffic_descriptor_parseFromJSON(cJSON *ddd_traffic_descriptorJSON) { OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_local_var = NULL; - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "ipv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ipv6_addr = NULL; + cJSON *port_number = NULL; + cJSON *mac_addr = NULL; + ipv4_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_ddd_traffic_descriptor_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "ipv6Addr"); - + ipv6_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "ipv6Addr"); if (ipv6_addr) { - if (!cJSON_IsString(ipv6_addr)) { + if (!cJSON_IsString(ipv6_addr) && !cJSON_IsNull(ipv6_addr)) { ogs_error("OpenAPI_ddd_traffic_descriptor_parseFromJSON() failed [ipv6_addr]"); goto end; } } - cJSON *port_number = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "portNumber"); - + port_number = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "portNumber"); if (port_number) { if (!cJSON_IsNumber(port_number)) { ogs_error("OpenAPI_ddd_traffic_descriptor_parseFromJSON() failed [port_number]"); @@ -108,21 +121,20 @@ OpenAPI_ddd_traffic_descriptor_t *OpenAPI_ddd_traffic_descriptor_parseFromJSON(c } } - cJSON *mac_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "macAddr"); - + mac_addr = cJSON_GetObjectItemCaseSensitive(ddd_traffic_descriptorJSON, "macAddr"); if (mac_addr) { - if (!cJSON_IsString(mac_addr)) { + if (!cJSON_IsString(mac_addr) && !cJSON_IsNull(mac_addr)) { ogs_error("OpenAPI_ddd_traffic_descriptor_parseFromJSON() failed [mac_addr]"); goto end; } } ddd_traffic_descriptor_local_var = OpenAPI_ddd_traffic_descriptor_create ( - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, - ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr && !cJSON_IsNull(ipv6_addr) ? ogs_strdup(ipv6_addr->valuestring) : NULL, port_number ? true : false, port_number ? port_number->valuedouble : 0, - mac_addr ? ogs_strdup(mac_addr->valuestring) : NULL + mac_addr && !cJSON_IsNull(mac_addr) ? ogs_strdup(mac_addr->valuestring) : NULL ); return ddd_traffic_descriptor_local_var; diff --git a/lib/sbi/openapi/model/ddn_failure_sub_info.c b/lib/sbi/openapi/model/ddn_failure_sub_info.c index b3dbea0fe..a134c38f5 100644 --- a/lib/sbi/openapi/model/ddn_failure_sub_info.c +++ b/lib/sbi/openapi/model/ddn_failure_sub_info.c @@ -20,21 +20,29 @@ OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_create( void OpenAPI_ddn_failure_sub_info_free(OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ddn_failure_sub_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(ddn_failure_sub_info->notify_correlation_id); - OpenAPI_list_for_each(ddn_failure_sub_info->ddd_traffic_descriptor_list, node) { - OpenAPI_ddd_traffic_descriptor_free(node->data); + if (ddn_failure_sub_info->notify_correlation_id) { + ogs_free(ddn_failure_sub_info->notify_correlation_id); + ddn_failure_sub_info->notify_correlation_id = NULL; + } + if (ddn_failure_sub_info->ddd_traffic_descriptor_list) { + OpenAPI_list_for_each(ddn_failure_sub_info->ddd_traffic_descriptor_list, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(ddn_failure_sub_info->ddd_traffic_descriptor_list); + ddn_failure_sub_info->ddd_traffic_descriptor_list = NULL; } - OpenAPI_list_free(ddn_failure_sub_info->ddd_traffic_descriptor_list); ogs_free(ddn_failure_sub_info); } cJSON *OpenAPI_ddn_failure_sub_info_convertToJSON(OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ddn_failure_sub_info == NULL) { ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [DdnFailureSubInfo]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_ddn_failure_sub_info_convertToJSON(OpenAPI_ddn_failure_sub_info_t } item = cJSON_CreateObject(); + if (!ddn_failure_sub_info->notify_correlation_id) { + ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [notify_correlation_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notifyCorrelationId", ddn_failure_sub_info->notify_correlation_id) == NULL) { ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [notify_correlation_id]"); goto end; @@ -53,17 +65,13 @@ cJSON *OpenAPI_ddn_failure_sub_info_convertToJSON(OpenAPI_ddn_failure_sub_info_t ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [ddd_traffic_descriptor_list]"); goto end; } - - OpenAPI_lnode_t *ddd_traffic_descriptor_list_node; - if (ddn_failure_sub_info->ddd_traffic_descriptor_list) { - OpenAPI_list_for_each(ddn_failure_sub_info->ddd_traffic_descriptor_list, ddd_traffic_descriptor_list_node) { - cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(ddd_traffic_descriptor_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [ddd_traffic_descriptor_list]"); - goto end; - } - cJSON_AddItemToArray(ddd_traffic_descriptor_listList, itemLocal); + OpenAPI_list_for_each(ddn_failure_sub_info->ddd_traffic_descriptor_list, node) { + cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [ddd_traffic_descriptor_list]"); + goto end; } + cJSON_AddItemToArray(ddd_traffic_descriptor_listList, itemLocal); } } @@ -74,44 +82,43 @@ end: OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_parseFromJSON(cJSON *ddn_failure_sub_infoJSON) { OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info_local_var = NULL; - cJSON *notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ddn_failure_sub_infoJSON, "notifyCorrelationId"); + OpenAPI_lnode_t *node = NULL; + cJSON *notify_correlation_id = NULL; + cJSON *ddd_traffic_descriptor_list = NULL; + OpenAPI_list_t *ddd_traffic_descriptor_listList = NULL; + notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ddn_failure_sub_infoJSON, "notifyCorrelationId"); if (!notify_correlation_id) { ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [notify_correlation_id]"); goto end; } - if (!cJSON_IsString(notify_correlation_id)) { ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [notify_correlation_id]"); goto end; } - cJSON *ddd_traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(ddn_failure_sub_infoJSON, "dddTrafficDescriptorList"); - - OpenAPI_list_t *ddd_traffic_descriptor_listList; + ddd_traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(ddn_failure_sub_infoJSON, "dddTrafficDescriptorList"); if (ddd_traffic_descriptor_list) { - cJSON *ddd_traffic_descriptor_list_local_nonprimitive; - if (!cJSON_IsArray(ddd_traffic_descriptor_list)){ - ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [ddd_traffic_descriptor_list]"); - goto end; - } - - ddd_traffic_descriptor_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ddd_traffic_descriptor_list_local_nonprimitive, ddd_traffic_descriptor_list ) { - if (!cJSON_IsObject(ddd_traffic_descriptor_list_local_nonprimitive)) { + cJSON *ddd_traffic_descriptor_list_local = NULL; + if (!cJSON_IsArray(ddd_traffic_descriptor_list)) { ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [ddd_traffic_descriptor_list]"); goto end; } - OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_listItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_descriptor_list_local_nonprimitive); - if (!ddd_traffic_descriptor_listItem) { - ogs_error("No ddd_traffic_descriptor_listItem"); - OpenAPI_list_free(ddd_traffic_descriptor_listList); - goto end; + ddd_traffic_descriptor_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ddd_traffic_descriptor_list_local, ddd_traffic_descriptor_list) { + if (!cJSON_IsObject(ddd_traffic_descriptor_list_local)) { + ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [ddd_traffic_descriptor_list]"); + goto end; + } + OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_listItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_descriptor_list_local); + if (!ddd_traffic_descriptor_listItem) { + ogs_error("No ddd_traffic_descriptor_listItem"); + OpenAPI_list_free(ddd_traffic_descriptor_listList); + goto end; + } + OpenAPI_list_add(ddd_traffic_descriptor_listList, ddd_traffic_descriptor_listItem); } - - OpenAPI_list_add(ddd_traffic_descriptor_listList, ddd_traffic_descriptor_listItem); - } } ddn_failure_sub_info_local_var = OpenAPI_ddn_failure_sub_info_create ( @@ -121,6 +128,13 @@ OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_parseFromJSON(cJSON return ddn_failure_sub_info_local_var; end: + if (ddd_traffic_descriptor_listList) { + OpenAPI_list_for_each(ddd_traffic_descriptor_listList, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(ddd_traffic_descriptor_listList); + ddd_traffic_descriptor_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ddn_failure_subs.c b/lib/sbi/openapi/model/ddn_failure_subs.c index ed4fcf0b4..f98cc343c 100644 --- a/lib/sbi/openapi/model/ddn_failure_subs.c +++ b/lib/sbi/openapi/model/ddn_failure_subs.c @@ -22,20 +22,25 @@ OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_create( void OpenAPI_ddn_failure_subs_free(OpenAPI_ddn_failure_subs_t *ddn_failure_subs) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ddn_failure_subs) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ddn_failure_subs->ddn_failure_subs_info_list, node) { - OpenAPI_ddn_failure_sub_info_free(node->data); + if (ddn_failure_subs->ddn_failure_subs_info_list) { + OpenAPI_list_for_each(ddn_failure_subs->ddn_failure_subs_info_list, node) { + OpenAPI_ddn_failure_sub_info_free(node->data); + } + OpenAPI_list_free(ddn_failure_subs->ddn_failure_subs_info_list); + ddn_failure_subs->ddn_failure_subs_info_list = NULL; } - OpenAPI_list_free(ddn_failure_subs->ddn_failure_subs_info_list); ogs_free(ddn_failure_subs); } cJSON *OpenAPI_ddn_failure_subs_convertToJSON(OpenAPI_ddn_failure_subs_t *ddn_failure_subs) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ddn_failure_subs == NULL) { ogs_error("OpenAPI_ddn_failure_subs_convertToJSON() failed [DdnFailureSubs]"); @@ -56,17 +61,13 @@ cJSON *OpenAPI_ddn_failure_subs_convertToJSON(OpenAPI_ddn_failure_subs_t *ddn_fa ogs_error("OpenAPI_ddn_failure_subs_convertToJSON() failed [ddn_failure_subs_info_list]"); goto end; } - - OpenAPI_lnode_t *ddn_failure_subs_info_list_node; - if (ddn_failure_subs->ddn_failure_subs_info_list) { - OpenAPI_list_for_each(ddn_failure_subs->ddn_failure_subs_info_list, ddn_failure_subs_info_list_node) { - cJSON *itemLocal = OpenAPI_ddn_failure_sub_info_convertToJSON(ddn_failure_subs_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ddn_failure_subs_convertToJSON() failed [ddn_failure_subs_info_list]"); - goto end; - } - cJSON_AddItemToArray(ddn_failure_subs_info_listList, itemLocal); + OpenAPI_list_for_each(ddn_failure_subs->ddn_failure_subs_info_list, node) { + cJSON *itemLocal = OpenAPI_ddn_failure_sub_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ddn_failure_subs_convertToJSON() failed [ddn_failure_subs_info_list]"); + goto end; } + cJSON_AddItemToArray(ddn_failure_subs_info_listList, itemLocal); } } @@ -77,8 +78,11 @@ end: OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_parseFromJSON(cJSON *ddn_failure_subsJSON) { OpenAPI_ddn_failure_subs_t *ddn_failure_subs_local_var = NULL; - cJSON *ddn_failure_subs_ind = cJSON_GetObjectItemCaseSensitive(ddn_failure_subsJSON, "ddnFailureSubsInd"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ddn_failure_subs_ind = NULL; + cJSON *ddn_failure_subs_info_list = NULL; + OpenAPI_list_t *ddn_failure_subs_info_listList = NULL; + ddn_failure_subs_ind = cJSON_GetObjectItemCaseSensitive(ddn_failure_subsJSON, "ddnFailureSubsInd"); if (ddn_failure_subs_ind) { if (!cJSON_IsBool(ddn_failure_subs_ind)) { ogs_error("OpenAPI_ddn_failure_subs_parseFromJSON() failed [ddn_failure_subs_ind]"); @@ -86,33 +90,29 @@ OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_parseFromJSON(cJSON *ddn_fa } } - cJSON *ddn_failure_subs_info_list = cJSON_GetObjectItemCaseSensitive(ddn_failure_subsJSON, "ddnFailureSubsInfoList"); - - OpenAPI_list_t *ddn_failure_subs_info_listList; + ddn_failure_subs_info_list = cJSON_GetObjectItemCaseSensitive(ddn_failure_subsJSON, "ddnFailureSubsInfoList"); if (ddn_failure_subs_info_list) { - cJSON *ddn_failure_subs_info_list_local_nonprimitive; - if (!cJSON_IsArray(ddn_failure_subs_info_list)){ - ogs_error("OpenAPI_ddn_failure_subs_parseFromJSON() failed [ddn_failure_subs_info_list]"); - goto end; - } - - ddn_failure_subs_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ddn_failure_subs_info_list_local_nonprimitive, ddn_failure_subs_info_list ) { - if (!cJSON_IsObject(ddn_failure_subs_info_list_local_nonprimitive)) { + cJSON *ddn_failure_subs_info_list_local = NULL; + if (!cJSON_IsArray(ddn_failure_subs_info_list)) { ogs_error("OpenAPI_ddn_failure_subs_parseFromJSON() failed [ddn_failure_subs_info_list]"); goto end; } - OpenAPI_ddn_failure_sub_info_t *ddn_failure_subs_info_listItem = OpenAPI_ddn_failure_sub_info_parseFromJSON(ddn_failure_subs_info_list_local_nonprimitive); - if (!ddn_failure_subs_info_listItem) { - ogs_error("No ddn_failure_subs_info_listItem"); - OpenAPI_list_free(ddn_failure_subs_info_listList); - goto end; + ddn_failure_subs_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ddn_failure_subs_info_list_local, ddn_failure_subs_info_list) { + if (!cJSON_IsObject(ddn_failure_subs_info_list_local)) { + ogs_error("OpenAPI_ddn_failure_subs_parseFromJSON() failed [ddn_failure_subs_info_list]"); + goto end; + } + OpenAPI_ddn_failure_sub_info_t *ddn_failure_subs_info_listItem = OpenAPI_ddn_failure_sub_info_parseFromJSON(ddn_failure_subs_info_list_local); + if (!ddn_failure_subs_info_listItem) { + ogs_error("No ddn_failure_subs_info_listItem"); + OpenAPI_list_free(ddn_failure_subs_info_listList); + goto end; + } + OpenAPI_list_add(ddn_failure_subs_info_listList, ddn_failure_subs_info_listItem); } - - OpenAPI_list_add(ddn_failure_subs_info_listList, ddn_failure_subs_info_listItem); - } } ddn_failure_subs_local_var = OpenAPI_ddn_failure_subs_create ( @@ -123,6 +123,13 @@ OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_parseFromJSON(cJSON *ddn_fa return ddn_failure_subs_local_var; end: + if (ddn_failure_subs_info_listList) { + OpenAPI_list_for_each(ddn_failure_subs_info_listList, node) { + OpenAPI_ddn_failure_sub_info_free(node->data); + } + OpenAPI_list_free(ddn_failure_subs_info_listList); + ddn_failure_subs_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/default_notification_subscription.c b/lib/sbi/openapi/model/default_notification_subscription.c index 202586bdc..ba655dfd2 100644 --- a/lib/sbi/openapi/model/default_notification_subscription.c +++ b/lib/sbi/openapi/model/default_notification_subscription.c @@ -28,22 +28,33 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr void OpenAPI_default_notification_subscription_free(OpenAPI_default_notification_subscription_t *default_notification_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == default_notification_subscription) { return; } - OpenAPI_lnode_t *node; - ogs_free(default_notification_subscription->callback_uri); - OpenAPI_list_for_each(default_notification_subscription->versions, node) { - ogs_free(node->data); + if (default_notification_subscription->callback_uri) { + ogs_free(default_notification_subscription->callback_uri); + default_notification_subscription->callback_uri = NULL; + } + if (default_notification_subscription->versions) { + OpenAPI_list_for_each(default_notification_subscription->versions, node) { + ogs_free(node->data); + } + OpenAPI_list_free(default_notification_subscription->versions); + default_notification_subscription->versions = NULL; + } + if (default_notification_subscription->binding) { + ogs_free(default_notification_subscription->binding); + default_notification_subscription->binding = NULL; } - OpenAPI_list_free(default_notification_subscription->versions); - ogs_free(default_notification_subscription->binding); ogs_free(default_notification_subscription); } cJSON *OpenAPI_default_notification_subscription_convertToJSON(OpenAPI_default_notification_subscription_t *default_notification_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (default_notification_subscription == NULL) { ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [DefaultNotificationSubscription]"); @@ -51,24 +62,32 @@ cJSON *OpenAPI_default_notification_subscription_convertToJSON(OpenAPI_default_n } item = cJSON_CreateObject(); + if (default_notification_subscription->notification_type == OpenAPI_notification_type_NULL) { + ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [notification_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationType", OpenAPI_notification_type_ToString(default_notification_subscription->notification_type)) == NULL) { ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [notification_type]"); goto end; } + if (!default_notification_subscription->callback_uri) { + ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [callback_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "callbackUri", default_notification_subscription->callback_uri) == NULL) { ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [callback_uri]"); goto end; } - if (default_notification_subscription->n1_message_class) { + if (default_notification_subscription->n1_message_class != OpenAPI_n1_message_class_NULL) { if (cJSON_AddStringToObject(item, "n1MessageClass", OpenAPI_n1_message_class_ToString(default_notification_subscription->n1_message_class)) == NULL) { ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [n1_message_class]"); goto end; } } - if (default_notification_subscription->n2_information_class) { + if (default_notification_subscription->n2_information_class != OpenAPI_n2_information_class_NULL) { if (cJSON_AddStringToObject(item, "n2InformationClass", OpenAPI_n2_information_class_ToString(default_notification_subscription->n2_information_class)) == NULL) { ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [n2_information_class]"); goto end; @@ -76,19 +95,17 @@ cJSON *OpenAPI_default_notification_subscription_convertToJSON(OpenAPI_default_n } if (default_notification_subscription->versions) { - cJSON *versions = cJSON_AddArrayToObject(item, "versions"); - if (versions == NULL) { + cJSON *versionsList = cJSON_AddArrayToObject(item, "versions"); + if (versionsList == NULL) { ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [versions]"); goto end; } - - OpenAPI_lnode_t *versions_node; - OpenAPI_list_for_each(default_notification_subscription->versions, versions_node) { - if (cJSON_AddStringToObject(versions, "", (char*)versions_node->data) == NULL) { - ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [versions]"); - goto end; + OpenAPI_list_for_each(default_notification_subscription->versions, node) { + if (cJSON_AddStringToObject(versionsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [versions]"); + goto end; + } } - } } if (default_notification_subscription->binding) { @@ -105,33 +122,39 @@ end: OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscription_parseFromJSON(cJSON *default_notification_subscriptionJSON) { OpenAPI_default_notification_subscription_t *default_notification_subscription_local_var = NULL; - cJSON *notification_type = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "notificationType"); + OpenAPI_lnode_t *node = NULL; + cJSON *notification_type = NULL; + OpenAPI_notification_type_e notification_typeVariable = 0; + cJSON *callback_uri = NULL; + cJSON *n1_message_class = NULL; + OpenAPI_n1_message_class_e n1_message_classVariable = 0; + cJSON *n2_information_class = NULL; + OpenAPI_n2_information_class_e n2_information_classVariable = 0; + cJSON *versions = NULL; + OpenAPI_list_t *versionsList = NULL; + cJSON *binding = NULL; + notification_type = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "notificationType"); if (!notification_type) { ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [notification_type]"); goto end; } - - OpenAPI_notification_type_e notification_typeVariable; if (!cJSON_IsString(notification_type)) { ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [notification_type]"); goto end; } notification_typeVariable = OpenAPI_notification_type_FromString(notification_type->valuestring); - cJSON *callback_uri = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "callbackUri"); + callback_uri = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "callbackUri"); if (!callback_uri) { ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [callback_uri]"); goto end; } - if (!cJSON_IsString(callback_uri)) { ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [callback_uri]"); goto end; } - cJSON *n1_message_class = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "n1MessageClass"); - - OpenAPI_n1_message_class_e n1_message_classVariable; + n1_message_class = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "n1MessageClass"); if (n1_message_class) { if (!cJSON_IsString(n1_message_class)) { ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [n1_message_class]"); @@ -140,9 +163,7 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr n1_message_classVariable = OpenAPI_n1_message_class_FromString(n1_message_class->valuestring); } - cJSON *n2_information_class = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "n2InformationClass"); - - OpenAPI_n2_information_class_e n2_information_classVariable; + n2_information_class = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "n2InformationClass"); if (n2_information_class) { if (!cJSON_IsString(n2_information_class)) { ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [n2_information_class]"); @@ -151,30 +172,30 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr n2_information_classVariable = OpenAPI_n2_information_class_FromString(n2_information_class->valuestring); } - cJSON *versions = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "versions"); - - OpenAPI_list_t *versionsList; + versions = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "versions"); if (versions) { - cJSON *versions_local; - if (!cJSON_IsArray(versions)) { - ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [versions]"); - goto end; - } - versionsList = OpenAPI_list_create(); + cJSON *versions_local = NULL; + if (!cJSON_IsArray(versions)) { + ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [versions]"); + goto end; + } - cJSON_ArrayForEach(versions_local, versions) { - if (!cJSON_IsString(versions_local)) { - ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [versions]"); - goto end; - } - OpenAPI_list_add(versionsList, ogs_strdup(versions_local->valuestring)); - } + versionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(versions_local, versions) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(versions_local)) { + ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [versions]"); + goto end; + } + OpenAPI_list_add(versionsList, ogs_strdup(versions_local->valuestring)); + } } - cJSON *binding = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "binding"); - + binding = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "binding"); if (binding) { - if (!cJSON_IsString(binding)) { + if (!cJSON_IsString(binding) && !cJSON_IsNull(binding)) { ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [binding]"); goto end; } @@ -186,11 +207,18 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr n1_message_class ? n1_message_classVariable : 0, n2_information_class ? n2_information_classVariable : 0, versions ? versionsList : NULL, - binding ? ogs_strdup(binding->valuestring) : NULL + binding && !cJSON_IsNull(binding) ? ogs_strdup(binding->valuestring) : NULL ); return default_notification_subscription_local_var; end: + if (versionsList) { + OpenAPI_list_for_each(versionsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(versionsList); + versionsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/default_unrelated_class.c b/lib/sbi/openapi/model/default_unrelated_class.c index 8321eee9d..f92b84f8f 100644 --- a/lib/sbi/openapi/model/default_unrelated_class.c +++ b/lib/sbi/openapi/model/default_unrelated_class.c @@ -26,25 +26,36 @@ OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_create( void OpenAPI_default_unrelated_class_free(OpenAPI_default_unrelated_class_t *default_unrelated_class) { + OpenAPI_lnode_t *node = NULL; + if (NULL == default_unrelated_class) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(default_unrelated_class->allowed_geographic_area, node) { - OpenAPI_geographic_area_free(node->data); + if (default_unrelated_class->allowed_geographic_area) { + OpenAPI_list_for_each(default_unrelated_class->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(default_unrelated_class->allowed_geographic_area); + default_unrelated_class->allowed_geographic_area = NULL; } - OpenAPI_list_free(default_unrelated_class->allowed_geographic_area); - OpenAPI_valid_time_period_free(default_unrelated_class->valid_time_period); - OpenAPI_list_for_each(default_unrelated_class->code_word_list, node) { - ogs_free(node->data); + if (default_unrelated_class->valid_time_period) { + OpenAPI_valid_time_period_free(default_unrelated_class->valid_time_period); + default_unrelated_class->valid_time_period = NULL; + } + if (default_unrelated_class->code_word_list) { + OpenAPI_list_for_each(default_unrelated_class->code_word_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(default_unrelated_class->code_word_list); + default_unrelated_class->code_word_list = NULL; } - OpenAPI_list_free(default_unrelated_class->code_word_list); ogs_free(default_unrelated_class); } cJSON *OpenAPI_default_unrelated_class_convertToJSON(OpenAPI_default_unrelated_class_t *default_unrelated_class) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (default_unrelated_class == NULL) { ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [DefaultUnrelatedClass]"); @@ -58,28 +69,24 @@ cJSON *OpenAPI_default_unrelated_class_convertToJSON(OpenAPI_default_unrelated_c ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [allowed_geographic_area]"); goto end; } - - OpenAPI_lnode_t *allowed_geographic_area_node; - if (default_unrelated_class->allowed_geographic_area) { - OpenAPI_list_for_each(default_unrelated_class->allowed_geographic_area, allowed_geographic_area_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [allowed_geographic_area]"); - goto end; - } - cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + OpenAPI_list_for_each(default_unrelated_class->allowed_geographic_area, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [allowed_geographic_area]"); + goto end; } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); } } - if (default_unrelated_class->privacy_check_related_action) { + if (default_unrelated_class->privacy_check_related_action != OpenAPI_privacy_check_related_action_NULL) { if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(default_unrelated_class->privacy_check_related_action)) == NULL) { ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [privacy_check_related_action]"); goto end; } } - if (default_unrelated_class->code_word_ind) { + if (default_unrelated_class->code_word_ind != OpenAPI_code_word_ind_NULL) { if (cJSON_AddStringToObject(item, "codeWordInd", OpenAPI_code_word_ind_ToString(default_unrelated_class->code_word_ind)) == NULL) { ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [code_word_ind]"); goto end; @@ -100,19 +107,17 @@ cJSON *OpenAPI_default_unrelated_class_convertToJSON(OpenAPI_default_unrelated_c } if (default_unrelated_class->code_word_list) { - cJSON *code_word_list = cJSON_AddArrayToObject(item, "codeWordList"); - if (code_word_list == NULL) { + cJSON *code_word_listList = cJSON_AddArrayToObject(item, "codeWordList"); + if (code_word_listList == NULL) { ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [code_word_list]"); goto end; } - - OpenAPI_lnode_t *code_word_list_node; - OpenAPI_list_for_each(default_unrelated_class->code_word_list, code_word_list_node) { - if (cJSON_AddStringToObject(code_word_list, "", (char*)code_word_list_node->data) == NULL) { - ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [code_word_list]"); - goto end; + OpenAPI_list_for_each(default_unrelated_class->code_word_list, node) { + if (cJSON_AddStringToObject(code_word_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [code_word_list]"); + goto end; + } } - } } end: @@ -122,38 +127,43 @@ end: OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_parseFromJSON(cJSON *default_unrelated_classJSON) { OpenAPI_default_unrelated_class_t *default_unrelated_class_local_var = NULL; - cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "allowedGeographicArea"); - - OpenAPI_list_t *allowed_geographic_areaList; + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_geographic_area = NULL; + OpenAPI_list_t *allowed_geographic_areaList = NULL; + cJSON *privacy_check_related_action = NULL; + OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable = 0; + cJSON *code_word_ind = NULL; + OpenAPI_code_word_ind_e code_word_indVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + cJSON *code_word_list = NULL; + OpenAPI_list_t *code_word_listList = NULL; + allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "allowedGeographicArea"); if (allowed_geographic_area) { - cJSON *allowed_geographic_area_local_nonprimitive; - if (!cJSON_IsArray(allowed_geographic_area)){ - ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [allowed_geographic_area]"); - goto end; - } - - allowed_geographic_areaList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) { - if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) { + cJSON *allowed_geographic_area_local = NULL; + if (!cJSON_IsArray(allowed_geographic_area)) { ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [allowed_geographic_area]"); goto end; } - OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive); - if (!allowed_geographic_areaItem) { - ogs_error("No allowed_geographic_areaItem"); - OpenAPI_list_free(allowed_geographic_areaList); - goto end; + allowed_geographic_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_geographic_area_local, allowed_geographic_area) { + if (!cJSON_IsObject(allowed_geographic_area_local)) { + ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local); + if (!allowed_geographic_areaItem) { + ogs_error("No allowed_geographic_areaItem"); + OpenAPI_list_free(allowed_geographic_areaList); + goto end; + } + OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); } - - OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); - } } - cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "privacyCheckRelatedAction"); - - OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable; + privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "privacyCheckRelatedAction"); if (privacy_check_related_action) { if (!cJSON_IsString(privacy_check_related_action)) { ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [privacy_check_related_action]"); @@ -162,9 +172,7 @@ OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_parseFromJSON privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); } - cJSON *code_word_ind = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "codeWordInd"); - - OpenAPI_code_word_ind_e code_word_indVariable; + code_word_ind = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "codeWordInd"); if (code_word_ind) { if (!cJSON_IsString(code_word_ind)) { ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [code_word_ind]"); @@ -173,31 +181,30 @@ OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_parseFromJSON code_word_indVariable = OpenAPI_code_word_ind_FromString(code_word_ind->valuestring); } - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "validTimePeriod"); - - OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period); } - cJSON *code_word_list = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "codeWordList"); - - OpenAPI_list_t *code_word_listList; + code_word_list = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "codeWordList"); if (code_word_list) { - cJSON *code_word_list_local; - if (!cJSON_IsArray(code_word_list)) { - ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [code_word_list]"); - goto end; - } - code_word_listList = OpenAPI_list_create(); + cJSON *code_word_list_local = NULL; + if (!cJSON_IsArray(code_word_list)) { + ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [code_word_list]"); + goto end; + } - cJSON_ArrayForEach(code_word_list_local, code_word_list) { - if (!cJSON_IsString(code_word_list_local)) { - ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [code_word_list]"); - goto end; - } - OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring)); - } + code_word_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(code_word_list_local, code_word_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(code_word_list_local)) { + ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [code_word_list]"); + goto end; + } + OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring)); + } } default_unrelated_class_local_var = OpenAPI_default_unrelated_class_create ( @@ -210,6 +217,24 @@ OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_parseFromJSON return default_unrelated_class_local_var; end: + if (allowed_geographic_areaList) { + OpenAPI_list_for_each(allowed_geographic_areaList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(allowed_geographic_areaList); + allowed_geographic_areaList = NULL; + } + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } + if (code_word_listList) { + OpenAPI_list_for_each(code_word_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(code_word_listList); + code_word_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/default_unrelated_class_1.c b/lib/sbi/openapi/model/default_unrelated_class_1.c index b1fc26c3a..e7b056aad 100644 --- a/lib/sbi/openapi/model/default_unrelated_class_1.c +++ b/lib/sbi/openapi/model/default_unrelated_class_1.c @@ -26,25 +26,36 @@ OpenAPI_default_unrelated_class_1_t *OpenAPI_default_unrelated_class_1_create( void OpenAPI_default_unrelated_class_1_free(OpenAPI_default_unrelated_class_1_t *default_unrelated_class_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == default_unrelated_class_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(default_unrelated_class_1->allowed_geographic_area, node) { - OpenAPI_geographic_area_free(node->data); + if (default_unrelated_class_1->allowed_geographic_area) { + OpenAPI_list_for_each(default_unrelated_class_1->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(default_unrelated_class_1->allowed_geographic_area); + default_unrelated_class_1->allowed_geographic_area = NULL; } - OpenAPI_list_free(default_unrelated_class_1->allowed_geographic_area); - OpenAPI_valid_time_period_1_free(default_unrelated_class_1->valid_time_period); - OpenAPI_list_for_each(default_unrelated_class_1->code_word_list, node) { - ogs_free(node->data); + if (default_unrelated_class_1->valid_time_period) { + OpenAPI_valid_time_period_1_free(default_unrelated_class_1->valid_time_period); + default_unrelated_class_1->valid_time_period = NULL; + } + if (default_unrelated_class_1->code_word_list) { + OpenAPI_list_for_each(default_unrelated_class_1->code_word_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(default_unrelated_class_1->code_word_list); + default_unrelated_class_1->code_word_list = NULL; } - OpenAPI_list_free(default_unrelated_class_1->code_word_list); ogs_free(default_unrelated_class_1); } cJSON *OpenAPI_default_unrelated_class_1_convertToJSON(OpenAPI_default_unrelated_class_1_t *default_unrelated_class_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (default_unrelated_class_1 == NULL) { ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [DefaultUnrelatedClass_1]"); @@ -58,28 +69,24 @@ cJSON *OpenAPI_default_unrelated_class_1_convertToJSON(OpenAPI_default_unrelated ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [allowed_geographic_area]"); goto end; } - - OpenAPI_lnode_t *allowed_geographic_area_node; - if (default_unrelated_class_1->allowed_geographic_area) { - OpenAPI_list_for_each(default_unrelated_class_1->allowed_geographic_area, allowed_geographic_area_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [allowed_geographic_area]"); - goto end; - } - cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + OpenAPI_list_for_each(default_unrelated_class_1->allowed_geographic_area, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [allowed_geographic_area]"); + goto end; } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); } } - if (default_unrelated_class_1->privacy_check_related_action) { + if (default_unrelated_class_1->privacy_check_related_action != OpenAPI_privacy_check_related_action_NULL) { if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(default_unrelated_class_1->privacy_check_related_action)) == NULL) { ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [privacy_check_related_action]"); goto end; } } - if (default_unrelated_class_1->code_word_ind) { + if (default_unrelated_class_1->code_word_ind != OpenAPI_code_word_ind_NULL) { if (cJSON_AddStringToObject(item, "codeWordInd", OpenAPI_code_word_ind_ToString(default_unrelated_class_1->code_word_ind)) == NULL) { ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [code_word_ind]"); goto end; @@ -100,19 +107,17 @@ cJSON *OpenAPI_default_unrelated_class_1_convertToJSON(OpenAPI_default_unrelated } if (default_unrelated_class_1->code_word_list) { - cJSON *code_word_list = cJSON_AddArrayToObject(item, "codeWordList"); - if (code_word_list == NULL) { + cJSON *code_word_listList = cJSON_AddArrayToObject(item, "codeWordList"); + if (code_word_listList == NULL) { ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [code_word_list]"); goto end; } - - OpenAPI_lnode_t *code_word_list_node; - OpenAPI_list_for_each(default_unrelated_class_1->code_word_list, code_word_list_node) { - if (cJSON_AddStringToObject(code_word_list, "", (char*)code_word_list_node->data) == NULL) { - ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [code_word_list]"); - goto end; + OpenAPI_list_for_each(default_unrelated_class_1->code_word_list, node) { + if (cJSON_AddStringToObject(code_word_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_default_unrelated_class_1_convertToJSON() failed [code_word_list]"); + goto end; + } } - } } end: @@ -122,38 +127,43 @@ end: OpenAPI_default_unrelated_class_1_t *OpenAPI_default_unrelated_class_1_parseFromJSON(cJSON *default_unrelated_class_1JSON) { OpenAPI_default_unrelated_class_1_t *default_unrelated_class_1_local_var = NULL; - cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "allowedGeographicArea"); - - OpenAPI_list_t *allowed_geographic_areaList; + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_geographic_area = NULL; + OpenAPI_list_t *allowed_geographic_areaList = NULL; + cJSON *privacy_check_related_action = NULL; + OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable = 0; + cJSON *code_word_ind = NULL; + OpenAPI_code_word_ind_e code_word_indVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_1_t *valid_time_period_local_nonprim = NULL; + cJSON *code_word_list = NULL; + OpenAPI_list_t *code_word_listList = NULL; + allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "allowedGeographicArea"); if (allowed_geographic_area) { - cJSON *allowed_geographic_area_local_nonprimitive; - if (!cJSON_IsArray(allowed_geographic_area)){ - ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [allowed_geographic_area]"); - goto end; - } - - allowed_geographic_areaList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) { - if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) { + cJSON *allowed_geographic_area_local = NULL; + if (!cJSON_IsArray(allowed_geographic_area)) { ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [allowed_geographic_area]"); goto end; } - OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive); - if (!allowed_geographic_areaItem) { - ogs_error("No allowed_geographic_areaItem"); - OpenAPI_list_free(allowed_geographic_areaList); - goto end; + allowed_geographic_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_geographic_area_local, allowed_geographic_area) { + if (!cJSON_IsObject(allowed_geographic_area_local)) { + ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local); + if (!allowed_geographic_areaItem) { + ogs_error("No allowed_geographic_areaItem"); + OpenAPI_list_free(allowed_geographic_areaList); + goto end; + } + OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); } - - OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); - } } - cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "privacyCheckRelatedAction"); - - OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable; + privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "privacyCheckRelatedAction"); if (privacy_check_related_action) { if (!cJSON_IsString(privacy_check_related_action)) { ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [privacy_check_related_action]"); @@ -162,9 +172,7 @@ OpenAPI_default_unrelated_class_1_t *OpenAPI_default_unrelated_class_1_parseFrom privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); } - cJSON *code_word_ind = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "codeWordInd"); - - OpenAPI_code_word_ind_e code_word_indVariable; + code_word_ind = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "codeWordInd"); if (code_word_ind) { if (!cJSON_IsString(code_word_ind)) { ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [code_word_ind]"); @@ -173,31 +181,30 @@ OpenAPI_default_unrelated_class_1_t *OpenAPI_default_unrelated_class_1_parseFrom code_word_indVariable = OpenAPI_code_word_ind_FromString(code_word_ind->valuestring); } - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "validTimePeriod"); - - OpenAPI_valid_time_period_1_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_1_parseFromJSON(valid_time_period); } - cJSON *code_word_list = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "codeWordList"); - - OpenAPI_list_t *code_word_listList; + code_word_list = cJSON_GetObjectItemCaseSensitive(default_unrelated_class_1JSON, "codeWordList"); if (code_word_list) { - cJSON *code_word_list_local; - if (!cJSON_IsArray(code_word_list)) { - ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [code_word_list]"); - goto end; - } - code_word_listList = OpenAPI_list_create(); + cJSON *code_word_list_local = NULL; + if (!cJSON_IsArray(code_word_list)) { + ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [code_word_list]"); + goto end; + } - cJSON_ArrayForEach(code_word_list_local, code_word_list) { - if (!cJSON_IsString(code_word_list_local)) { - ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [code_word_list]"); - goto end; - } - OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring)); - } + code_word_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(code_word_list_local, code_word_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(code_word_list_local)) { + ogs_error("OpenAPI_default_unrelated_class_1_parseFromJSON() failed [code_word_list]"); + goto end; + } + OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring)); + } } default_unrelated_class_1_local_var = OpenAPI_default_unrelated_class_1_create ( @@ -210,6 +217,24 @@ OpenAPI_default_unrelated_class_1_t *OpenAPI_default_unrelated_class_1_parseFrom return default_unrelated_class_1_local_var; end: + if (allowed_geographic_areaList) { + OpenAPI_list_for_each(allowed_geographic_areaList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(allowed_geographic_areaList); + allowed_geographic_areaList = NULL; + } + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_1_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } + if (code_word_listList) { + OpenAPI_list_for_each(code_word_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(code_word_listList); + code_word_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/deregistration_data.c b/lib/sbi/openapi/model/deregistration_data.c index 1fafa9d12..2f8b06f24 100644 --- a/lib/sbi/openapi/model/deregistration_data.c +++ b/lib/sbi/openapi/model/deregistration_data.c @@ -26,17 +26,22 @@ OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_create( void OpenAPI_deregistration_data_free(OpenAPI_deregistration_data_t *deregistration_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == deregistration_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(deregistration_data->new_smf_instance_id); + if (deregistration_data->new_smf_instance_id) { + ogs_free(deregistration_data->new_smf_instance_id); + deregistration_data->new_smf_instance_id = NULL; + } ogs_free(deregistration_data); } cJSON *OpenAPI_deregistration_data_convertToJSON(OpenAPI_deregistration_data_t *deregistration_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (deregistration_data == NULL) { ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [DeregistrationData]"); @@ -44,12 +49,16 @@ cJSON *OpenAPI_deregistration_data_convertToJSON(OpenAPI_deregistration_data_t * } item = cJSON_CreateObject(); + if (deregistration_data->dereg_reason == OpenAPI_deregistration_reason_NULL) { + ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [dereg_reason]"); + return NULL; + } if (cJSON_AddStringToObject(item, "deregReason", OpenAPI_deregistration_reason_ToString(deregistration_data->dereg_reason)) == NULL) { ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [dereg_reason]"); goto end; } - if (deregistration_data->access_type) { + if (deregistration_data->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(deregistration_data->access_type)) == NULL) { ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [access_type]"); goto end; @@ -77,22 +86,25 @@ end: OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_parseFromJSON(cJSON *deregistration_dataJSON) { OpenAPI_deregistration_data_t *deregistration_data_local_var = NULL; - cJSON *dereg_reason = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "deregReason"); + OpenAPI_lnode_t *node = NULL; + cJSON *dereg_reason = NULL; + OpenAPI_deregistration_reason_e dereg_reasonVariable = 0; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *pdu_session_id = NULL; + cJSON *new_smf_instance_id = NULL; + dereg_reason = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "deregReason"); if (!dereg_reason) { ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [dereg_reason]"); goto end; } - - OpenAPI_deregistration_reason_e dereg_reasonVariable; if (!cJSON_IsString(dereg_reason)) { ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [dereg_reason]"); goto end; } dereg_reasonVariable = OpenAPI_deregistration_reason_FromString(dereg_reason->valuestring); - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + access_type = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [access_type]"); @@ -101,8 +113,7 @@ OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_parseFromJSON(cJSON * access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "pduSessionId"); - + pdu_session_id = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "pduSessionId"); if (pdu_session_id) { if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [pdu_session_id]"); @@ -110,10 +121,9 @@ OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_parseFromJSON(cJSON * } } - cJSON *new_smf_instance_id = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "newSmfInstanceId"); - + new_smf_instance_id = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "newSmfInstanceId"); if (new_smf_instance_id) { - if (!cJSON_IsString(new_smf_instance_id)) { + if (!cJSON_IsString(new_smf_instance_id) && !cJSON_IsNull(new_smf_instance_id)) { ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [new_smf_instance_id]"); goto end; } @@ -124,7 +134,7 @@ OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_parseFromJSON(cJSON * access_type ? access_typeVariable : 0, pdu_session_id ? true : false, pdu_session_id ? pdu_session_id->valuedouble : 0, - new_smf_instance_id ? ogs_strdup(new_smf_instance_id->valuestring) : NULL + new_smf_instance_id && !cJSON_IsNull(new_smf_instance_id) ? ogs_strdup(new_smf_instance_id->valuestring) : NULL ); return deregistration_data_local_var; diff --git a/lib/sbi/openapi/model/deregistration_info.c b/lib/sbi/openapi/model/deregistration_info.c index 2c3ff123b..cc0bc7def 100644 --- a/lib/sbi/openapi/model/deregistration_info.c +++ b/lib/sbi/openapi/model/deregistration_info.c @@ -20,18 +20,26 @@ OpenAPI_deregistration_info_t *OpenAPI_deregistration_info_create( void OpenAPI_deregistration_info_free(OpenAPI_deregistration_info_t *deregistration_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == deregistration_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(deregistration_info->supi); - ogs_free(deregistration_info->supported_features); + if (deregistration_info->supi) { + ogs_free(deregistration_info->supi); + deregistration_info->supi = NULL; + } + if (deregistration_info->supported_features) { + ogs_free(deregistration_info->supported_features); + deregistration_info->supported_features = NULL; + } ogs_free(deregistration_info); } cJSON *OpenAPI_deregistration_info_convertToJSON(OpenAPI_deregistration_info_t *deregistration_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (deregistration_info == NULL) { ogs_error("OpenAPI_deregistration_info_convertToJSON() failed [DeregistrationInfo]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_deregistration_info_convertToJSON(OpenAPI_deregistration_info_t * } item = cJSON_CreateObject(); + if (!deregistration_info->supi) { + ogs_error("OpenAPI_deregistration_info_convertToJSON() failed [supi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supi", deregistration_info->supi) == NULL) { ogs_error("OpenAPI_deregistration_info_convertToJSON() failed [supi]"); goto end; @@ -58,21 +70,22 @@ end: OpenAPI_deregistration_info_t *OpenAPI_deregistration_info_parseFromJSON(cJSON *deregistration_infoJSON) { OpenAPI_deregistration_info_t *deregistration_info_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(deregistration_infoJSON, "supi"); + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *supported_features = NULL; + supi = cJSON_GetObjectItemCaseSensitive(deregistration_infoJSON, "supi"); if (!supi) { ogs_error("OpenAPI_deregistration_info_parseFromJSON() failed [supi]"); goto end; } - if (!cJSON_IsString(supi)) { ogs_error("OpenAPI_deregistration_info_parseFromJSON() failed [supi]"); goto end; } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(deregistration_infoJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(deregistration_infoJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_deregistration_info_parseFromJSON() failed [supported_features]"); goto end; } @@ -80,7 +93,7 @@ OpenAPI_deregistration_info_t *OpenAPI_deregistration_info_parseFromJSON(cJSON * deregistration_info_local_var = OpenAPI_deregistration_info_create ( ogs_strdup(supi->valuestring), - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return deregistration_info_local_var; diff --git a/lib/sbi/openapi/model/deregistration_reason.c b/lib/sbi/openapi/model/deregistration_reason.c index ebfed5953..b0a4cfd79 100644 --- a/lib/sbi/openapi/model/deregistration_reason.c +++ b/lib/sbi/openapi/model/deregistration_reason.c @@ -6,7 +6,7 @@ char* OpenAPI_deregistration_reason_ToString(OpenAPI_deregistration_reason_e deregistration_reason) { - const char *deregistration_reasonArray[] = { "NULL", "UE_INITIAL_REGISTRATION", "UE_REGISTRATION_AREA_CHANGE", "SUBSCRIPTION_WITHDRAWN", "_5GS_TO_EPS_MOBILITY", "_5GS_TO_EPS_MOBILITY_UE_INITIAL_REGISTRATION", "REREGISTRATION_REQUIRED", "SMF_CONTEXT_TRANSFERRED" }; + const char *deregistration_reasonArray[] = { "NULL", "UE_INITIAL_REGISTRATION", "UE_REGISTRATION_AREA_CHANGE", "SUBSCRIPTION_WITHDRAWN", "5GS_TO_EPS_MOBILITY", "5GS_TO_EPS_MOBILITY_UE_INITIAL_REGISTRATION", "REREGISTRATION_REQUIRED", "SMF_CONTEXT_TRANSFERRED" }; size_t sizeofArray = sizeof(deregistration_reasonArray) / sizeof(deregistration_reasonArray[0]); if (deregistration_reason < sizeofArray) return (char *)deregistration_reasonArray[deregistration_reason]; @@ -17,7 +17,7 @@ char* OpenAPI_deregistration_reason_ToString(OpenAPI_deregistration_reason_e der OpenAPI_deregistration_reason_e OpenAPI_deregistration_reason_FromString(char* deregistration_reason) { int stringToReturn = 0; - const char *deregistration_reasonArray[] = { "NULL", "UE_INITIAL_REGISTRATION", "UE_REGISTRATION_AREA_CHANGE", "SUBSCRIPTION_WITHDRAWN", "_5GS_TO_EPS_MOBILITY", "_5GS_TO_EPS_MOBILITY_UE_INITIAL_REGISTRATION", "REREGISTRATION_REQUIRED", "SMF_CONTEXT_TRANSFERRED" }; + const char *deregistration_reasonArray[] = { "NULL", "UE_INITIAL_REGISTRATION", "UE_REGISTRATION_AREA_CHANGE", "SUBSCRIPTION_WITHDRAWN", "5GS_TO_EPS_MOBILITY", "5GS_TO_EPS_MOBILITY_UE_INITIAL_REGISTRATION", "REREGISTRATION_REQUIRED", "SMF_CONTEXT_TRANSFERRED" }; size_t sizeofArray = sizeof(deregistration_reasonArray) / sizeof(deregistration_reasonArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(deregistration_reason, deregistration_reasonArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/dnai_information.c b/lib/sbi/openapi/model/dnai_information.c index 0a2c9308d..315f4ba84 100644 --- a/lib/sbi/openapi/model/dnai_information.c +++ b/lib/sbi/openapi/model/dnai_information.c @@ -26,17 +26,22 @@ OpenAPI_dnai_information_t *OpenAPI_dnai_information_create( void OpenAPI_dnai_information_free(OpenAPI_dnai_information_t *dnai_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnai_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(dnai_information->dnai); + if (dnai_information->dnai) { + ogs_free(dnai_information->dnai); + dnai_information->dnai = NULL; + } ogs_free(dnai_information); } cJSON *OpenAPI_dnai_information_convertToJSON(OpenAPI_dnai_information_t *dnai_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnai_information == NULL) { ogs_error("OpenAPI_dnai_information_convertToJSON() failed [DnaiInformation]"); @@ -44,6 +49,10 @@ cJSON *OpenAPI_dnai_information_convertToJSON(OpenAPI_dnai_information_t *dnai_i } item = cJSON_CreateObject(); + if (!dnai_information->dnai) { + ogs_error("OpenAPI_dnai_information_convertToJSON() failed [dnai]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnai", dnai_information->dnai) == NULL) { ogs_error("OpenAPI_dnai_information_convertToJSON() failed [dnai]"); goto end; @@ -70,19 +79,21 @@ end: OpenAPI_dnai_information_t *OpenAPI_dnai_information_parseFromJSON(cJSON *dnai_informationJSON) { OpenAPI_dnai_information_t *dnai_information_local_var = NULL; - cJSON *dnai = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "dnai"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnai = NULL; + cJSON *no_dnai_change_ind = NULL; + cJSON *no_local_psa_change_ind = NULL; + dnai = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "dnai"); if (!dnai) { ogs_error("OpenAPI_dnai_information_parseFromJSON() failed [dnai]"); goto end; } - if (!cJSON_IsString(dnai)) { ogs_error("OpenAPI_dnai_information_parseFromJSON() failed [dnai]"); goto end; } - cJSON *no_dnai_change_ind = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "noDnaiChangeInd"); - + no_dnai_change_ind = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "noDnaiChangeInd"); if (no_dnai_change_ind) { if (!cJSON_IsBool(no_dnai_change_ind)) { ogs_error("OpenAPI_dnai_information_parseFromJSON() failed [no_dnai_change_ind]"); @@ -90,8 +101,7 @@ OpenAPI_dnai_information_t *OpenAPI_dnai_information_parseFromJSON(cJSON *dnai_i } } - cJSON *no_local_psa_change_ind = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "noLocalPsaChangeInd"); - + no_local_psa_change_ind = cJSON_GetObjectItemCaseSensitive(dnai_informationJSON, "noLocalPsaChangeInd"); if (no_local_psa_change_ind) { if (!cJSON_IsBool(no_local_psa_change_ind)) { ogs_error("OpenAPI_dnai_information_parseFromJSON() failed [no_local_psa_change_ind]"); diff --git a/lib/sbi/openapi/model/dnf.c b/lib/sbi/openapi/model/dnf.c index 16b359476..393ba85ee 100644 --- a/lib/sbi/openapi/model/dnf.c +++ b/lib/sbi/openapi/model/dnf.c @@ -18,20 +18,25 @@ OpenAPI_dnf_t *OpenAPI_dnf_create( void OpenAPI_dnf_free(OpenAPI_dnf_t *dnf) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnf) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(dnf->dnf_units, node) { - OpenAPI_dnf_unit_free(node->data); + if (dnf->dnf_units) { + OpenAPI_list_for_each(dnf->dnf_units, node) { + OpenAPI_dnf_unit_free(node->data); + } + OpenAPI_list_free(dnf->dnf_units); + dnf->dnf_units = NULL; } - OpenAPI_list_free(dnf->dnf_units); ogs_free(dnf); } cJSON *OpenAPI_dnf_convertToJSON(OpenAPI_dnf_t *dnf) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnf == NULL) { ogs_error("OpenAPI_dnf_convertToJSON() failed [Dnf]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_dnf_convertToJSON(OpenAPI_dnf_t *dnf) } item = cJSON_CreateObject(); + if (!dnf->dnf_units) { + ogs_error("OpenAPI_dnf_convertToJSON() failed [dnf_units]"); + return NULL; + } cJSON *dnf_unitsList = cJSON_AddArrayToObject(item, "dnfUnits"); if (dnf_unitsList == NULL) { ogs_error("OpenAPI_dnf_convertToJSON() failed [dnf_units]"); goto end; } - - OpenAPI_lnode_t *dnf_units_node; - if (dnf->dnf_units) { - OpenAPI_list_for_each(dnf->dnf_units, dnf_units_node) { - cJSON *itemLocal = OpenAPI_dnf_unit_convertToJSON(dnf_units_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnf_convertToJSON() failed [dnf_units]"); - goto end; - } - cJSON_AddItemToArray(dnf_unitsList, itemLocal); + OpenAPI_list_for_each(dnf->dnf_units, node) { + cJSON *itemLocal = OpenAPI_dnf_unit_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnf_convertToJSON() failed [dnf_units]"); + goto end; } + cJSON_AddItemToArray(dnf_unitsList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_dnf_t *OpenAPI_dnf_parseFromJSON(cJSON *dnfJSON) { OpenAPI_dnf_t *dnf_local_var = NULL; - cJSON *dnf_units = cJSON_GetObjectItemCaseSensitive(dnfJSON, "dnfUnits"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnf_units = NULL; + OpenAPI_list_t *dnf_unitsList = NULL; + dnf_units = cJSON_GetObjectItemCaseSensitive(dnfJSON, "dnfUnits"); if (!dnf_units) { ogs_error("OpenAPI_dnf_parseFromJSON() failed [dnf_units]"); goto end; } - - OpenAPI_list_t *dnf_unitsList; - cJSON *dnf_units_local_nonprimitive; - if (!cJSON_IsArray(dnf_units)){ - ogs_error("OpenAPI_dnf_parseFromJSON() failed [dnf_units]"); - goto end; - } - - dnf_unitsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(dnf_units_local_nonprimitive, dnf_units ) { - if (!cJSON_IsObject(dnf_units_local_nonprimitive)) { + cJSON *dnf_units_local = NULL; + if (!cJSON_IsArray(dnf_units)) { ogs_error("OpenAPI_dnf_parseFromJSON() failed [dnf_units]"); goto end; } - OpenAPI_dnf_unit_t *dnf_unitsItem = OpenAPI_dnf_unit_parseFromJSON(dnf_units_local_nonprimitive); - if (!dnf_unitsItem) { - ogs_error("No dnf_unitsItem"); - OpenAPI_list_free(dnf_unitsList); - goto end; + dnf_unitsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnf_units_local, dnf_units) { + if (!cJSON_IsObject(dnf_units_local)) { + ogs_error("OpenAPI_dnf_parseFromJSON() failed [dnf_units]"); + goto end; + } + OpenAPI_dnf_unit_t *dnf_unitsItem = OpenAPI_dnf_unit_parseFromJSON(dnf_units_local); + if (!dnf_unitsItem) { + ogs_error("No dnf_unitsItem"); + OpenAPI_list_free(dnf_unitsList); + goto end; + } + OpenAPI_list_add(dnf_unitsList, dnf_unitsItem); } - OpenAPI_list_add(dnf_unitsList, dnf_unitsItem); - } - dnf_local_var = OpenAPI_dnf_create ( dnf_unitsList ); return dnf_local_var; end: + if (dnf_unitsList) { + OpenAPI_list_for_each(dnf_unitsList, node) { + OpenAPI_dnf_unit_free(node->data); + } + OpenAPI_list_free(dnf_unitsList); + dnf_unitsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/dnf_unit.c b/lib/sbi/openapi/model/dnf_unit.c index 6387b0c99..4cf196554 100644 --- a/lib/sbi/openapi/model/dnf_unit.c +++ b/lib/sbi/openapi/model/dnf_unit.c @@ -18,20 +18,25 @@ OpenAPI_dnf_unit_t *OpenAPI_dnf_unit_create( void OpenAPI_dnf_unit_free(OpenAPI_dnf_unit_t *dnf_unit) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnf_unit) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(dnf_unit->dnf_unit, node) { - OpenAPI_atom_free(node->data); + if (dnf_unit->dnf_unit) { + OpenAPI_list_for_each(dnf_unit->dnf_unit, node) { + OpenAPI_atom_free(node->data); + } + OpenAPI_list_free(dnf_unit->dnf_unit); + dnf_unit->dnf_unit = NULL; } - OpenAPI_list_free(dnf_unit->dnf_unit); ogs_free(dnf_unit); } cJSON *OpenAPI_dnf_unit_convertToJSON(OpenAPI_dnf_unit_t *dnf_unit) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnf_unit == NULL) { ogs_error("OpenAPI_dnf_unit_convertToJSON() failed [DnfUnit]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_dnf_unit_convertToJSON(OpenAPI_dnf_unit_t *dnf_unit) } item = cJSON_CreateObject(); + if (!dnf_unit->dnf_unit) { + ogs_error("OpenAPI_dnf_unit_convertToJSON() failed [dnf_unit]"); + return NULL; + } cJSON *dnf_unitList = cJSON_AddArrayToObject(item, "dnfUnit"); if (dnf_unitList == NULL) { ogs_error("OpenAPI_dnf_unit_convertToJSON() failed [dnf_unit]"); goto end; } - - OpenAPI_lnode_t *dnf_unit_node; - if (dnf_unit->dnf_unit) { - OpenAPI_list_for_each(dnf_unit->dnf_unit, dnf_unit_node) { - cJSON *itemLocal = OpenAPI_atom_convertToJSON(dnf_unit_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnf_unit_convertToJSON() failed [dnf_unit]"); - goto end; - } - cJSON_AddItemToArray(dnf_unitList, itemLocal); + OpenAPI_list_for_each(dnf_unit->dnf_unit, node) { + cJSON *itemLocal = OpenAPI_atom_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnf_unit_convertToJSON() failed [dnf_unit]"); + goto end; } + cJSON_AddItemToArray(dnf_unitList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_dnf_unit_t *OpenAPI_dnf_unit_parseFromJSON(cJSON *dnf_unitJSON) { OpenAPI_dnf_unit_t *dnf_unit_local_var = NULL; - cJSON *dnf_unit = cJSON_GetObjectItemCaseSensitive(dnf_unitJSON, "dnfUnit"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnf_unit = NULL; + OpenAPI_list_t *dnf_unitList = NULL; + dnf_unit = cJSON_GetObjectItemCaseSensitive(dnf_unitJSON, "dnfUnit"); if (!dnf_unit) { ogs_error("OpenAPI_dnf_unit_parseFromJSON() failed [dnf_unit]"); goto end; } - - OpenAPI_list_t *dnf_unitList; - cJSON *dnf_unit_local_nonprimitive; - if (!cJSON_IsArray(dnf_unit)){ - ogs_error("OpenAPI_dnf_unit_parseFromJSON() failed [dnf_unit]"); - goto end; - } - - dnf_unitList = OpenAPI_list_create(); - - cJSON_ArrayForEach(dnf_unit_local_nonprimitive, dnf_unit ) { - if (!cJSON_IsObject(dnf_unit_local_nonprimitive)) { + cJSON *dnf_unit_local = NULL; + if (!cJSON_IsArray(dnf_unit)) { ogs_error("OpenAPI_dnf_unit_parseFromJSON() failed [dnf_unit]"); goto end; } - OpenAPI_atom_t *dnf_unitItem = OpenAPI_atom_parseFromJSON(dnf_unit_local_nonprimitive); - if (!dnf_unitItem) { - ogs_error("No dnf_unitItem"); - OpenAPI_list_free(dnf_unitList); - goto end; + dnf_unitList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnf_unit_local, dnf_unit) { + if (!cJSON_IsObject(dnf_unit_local)) { + ogs_error("OpenAPI_dnf_unit_parseFromJSON() failed [dnf_unit]"); + goto end; + } + OpenAPI_atom_t *dnf_unitItem = OpenAPI_atom_parseFromJSON(dnf_unit_local); + if (!dnf_unitItem) { + ogs_error("No dnf_unitItem"); + OpenAPI_list_free(dnf_unitList); + goto end; + } + OpenAPI_list_add(dnf_unitList, dnf_unitItem); } - OpenAPI_list_add(dnf_unitList, dnf_unitItem); - } - dnf_unit_local_var = OpenAPI_dnf_unit_create ( dnf_unitList ); return dnf_unit_local_var; end: + if (dnf_unitList) { + OpenAPI_list_for_each(dnf_unitList, node) { + OpenAPI_atom_free(node->data); + } + OpenAPI_list_free(dnf_unitList); + dnf_unitList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/dnn_configuration.c b/lib/sbi/openapi/model/dnn_configuration.c index 2e9e4008f..94d313d5b 100644 --- a/lib/sbi/openapi/model/dnn_configuration.c +++ b/lib/sbi/openapi/model/dnn_configuration.c @@ -66,39 +66,83 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create( void OpenAPI_dnn_configuration_free(OpenAPI_dnn_configuration_t *dnn_configuration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnn_configuration) { return; } - OpenAPI_lnode_t *node; - OpenAPI_pdu_session_types_free(dnn_configuration->pdu_session_types); - OpenAPI_ssc_modes_free(dnn_configuration->ssc_modes); - OpenAPI_subscribed_default_qos_free(dnn_configuration->_5g_qos_profile); - OpenAPI_ambr_free(dnn_configuration->session_ambr); - ogs_free(dnn_configuration->_3gpp_charging_characteristics); - OpenAPI_list_for_each(dnn_configuration->static_ip_address, node) { - OpenAPI_ip_address_free(node->data); + if (dnn_configuration->pdu_session_types) { + OpenAPI_pdu_session_types_free(dnn_configuration->pdu_session_types); + dnn_configuration->pdu_session_types = NULL; } - OpenAPI_list_free(dnn_configuration->static_ip_address); - OpenAPI_up_security_free(dnn_configuration->up_security); - ogs_free(dnn_configuration->nidd_nef_id); - OpenAPI_nidd_information_free(dnn_configuration->nidd_info); - OpenAPI_acs_info_free(dnn_configuration->acs_info); - OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, node) { - OpenAPI_frame_route_info_free(node->data); + if (dnn_configuration->ssc_modes) { + OpenAPI_ssc_modes_free(dnn_configuration->ssc_modes); + dnn_configuration->ssc_modes = NULL; } - OpenAPI_list_free(dnn_configuration->ipv4_frame_route_list); - OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, node) { - OpenAPI_frame_route_info_free(node->data); + if (dnn_configuration->_5g_qos_profile) { + OpenAPI_subscribed_default_qos_free(dnn_configuration->_5g_qos_profile); + dnn_configuration->_5g_qos_profile = NULL; + } + if (dnn_configuration->session_ambr) { + OpenAPI_ambr_free(dnn_configuration->session_ambr); + dnn_configuration->session_ambr = NULL; + } + if (dnn_configuration->_3gpp_charging_characteristics) { + ogs_free(dnn_configuration->_3gpp_charging_characteristics); + dnn_configuration->_3gpp_charging_characteristics = NULL; + } + if (dnn_configuration->static_ip_address) { + OpenAPI_list_for_each(dnn_configuration->static_ip_address, node) { + OpenAPI_ip_address_free(node->data); + } + OpenAPI_list_free(dnn_configuration->static_ip_address); + dnn_configuration->static_ip_address = NULL; + } + if (dnn_configuration->up_security) { + OpenAPI_up_security_free(dnn_configuration->up_security); + dnn_configuration->up_security = NULL; + } + if (dnn_configuration->nidd_nef_id) { + ogs_free(dnn_configuration->nidd_nef_id); + dnn_configuration->nidd_nef_id = NULL; + } + if (dnn_configuration->nidd_info) { + OpenAPI_nidd_information_free(dnn_configuration->nidd_info); + dnn_configuration->nidd_info = NULL; + } + if (dnn_configuration->acs_info) { + OpenAPI_acs_info_free(dnn_configuration->acs_info); + dnn_configuration->acs_info = NULL; + } + if (dnn_configuration->ipv4_frame_route_list) { + OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, node) { + OpenAPI_frame_route_info_free(node->data); + } + OpenAPI_list_free(dnn_configuration->ipv4_frame_route_list); + dnn_configuration->ipv4_frame_route_list = NULL; + } + if (dnn_configuration->ipv6_frame_route_list) { + OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, node) { + OpenAPI_frame_route_info_free(node->data); + } + OpenAPI_list_free(dnn_configuration->ipv6_frame_route_list); + dnn_configuration->ipv6_frame_route_list = NULL; + } + if (dnn_configuration->dn_aaa_address) { + OpenAPI_ip_address_free(dnn_configuration->dn_aaa_address); + dnn_configuration->dn_aaa_address = NULL; + } + if (dnn_configuration->iptv_acc_ctrl_info) { + ogs_free(dnn_configuration->iptv_acc_ctrl_info); + dnn_configuration->iptv_acc_ctrl_info = NULL; } - OpenAPI_list_free(dnn_configuration->ipv6_frame_route_list); - OpenAPI_ip_address_free(dnn_configuration->dn_aaa_address); - ogs_free(dnn_configuration->iptv_acc_ctrl_info); ogs_free(dnn_configuration); } cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_configuration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnn_configuration == NULL) { ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [DnnConfiguration]"); @@ -106,6 +150,10 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_ } item = cJSON_CreateObject(); + if (!dnn_configuration->pdu_session_types) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_types]"); + return NULL; + } cJSON *pdu_session_types_local_JSON = OpenAPI_pdu_session_types_convertToJSON(dnn_configuration->pdu_session_types); if (pdu_session_types_local_JSON == NULL) { ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_types]"); @@ -117,6 +165,10 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_ goto end; } + if (!dnn_configuration->ssc_modes) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ssc_modes]"); + return NULL; + } cJSON *ssc_modes_local_JSON = OpenAPI_ssc_modes_convertToJSON(dnn_configuration->ssc_modes); if (ssc_modes_local_JSON == NULL) { ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ssc_modes]"); @@ -174,17 +226,13 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_ ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [static_ip_address]"); goto end; } - - OpenAPI_lnode_t *static_ip_address_node; - if (dnn_configuration->static_ip_address) { - OpenAPI_list_for_each(dnn_configuration->static_ip_address, static_ip_address_node) { - cJSON *itemLocal = OpenAPI_ip_address_convertToJSON(static_ip_address_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [static_ip_address]"); - goto end; - } - cJSON_AddItemToArray(static_ip_addressList, itemLocal); + OpenAPI_list_for_each(dnn_configuration->static_ip_address, node) { + cJSON *itemLocal = OpenAPI_ip_address_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [static_ip_address]"); + goto end; } + cJSON_AddItemToArray(static_ip_addressList, itemLocal); } } @@ -201,7 +249,7 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_ } } - if (dnn_configuration->pdu_session_continuity_ind) { + if (dnn_configuration->pdu_session_continuity_ind != OpenAPI_pdu_session_continuity_ind_NULL) { if (cJSON_AddStringToObject(item, "pduSessionContinuityInd", OpenAPI_pdu_session_continuity_ind_ToString(dnn_configuration->pdu_session_continuity_ind)) == NULL) { ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_continuity_ind]"); goto end; @@ -254,17 +302,13 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_ ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv4_frame_route_list]"); goto end; } - - OpenAPI_lnode_t *ipv4_frame_route_list_node; - if (dnn_configuration->ipv4_frame_route_list) { - OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, ipv4_frame_route_list_node) { - cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(ipv4_frame_route_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv4_frame_route_list]"); - goto end; - } - cJSON_AddItemToArray(ipv4_frame_route_listList, itemLocal); + OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, node) { + cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv4_frame_route_list]"); + goto end; } + cJSON_AddItemToArray(ipv4_frame_route_listList, itemLocal); } } @@ -274,17 +318,13 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_ ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv6_frame_route_list]"); goto end; } - - OpenAPI_lnode_t *ipv6_frame_route_list_node; - if (dnn_configuration->ipv6_frame_route_list) { - OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, ipv6_frame_route_list_node) { - cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(ipv6_frame_route_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv6_frame_route_list]"); - goto end; - } - cJSON_AddItemToArray(ipv6_frame_route_listList, itemLocal); + OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, node) { + cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv6_frame_route_list]"); + goto end; } + cJSON_AddItemToArray(ipv6_frame_route_listList, itemLocal); } } @@ -336,26 +376,54 @@ end: OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_configurationJSON) { OpenAPI_dnn_configuration_t *dnn_configuration_local_var = NULL; - cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionTypes"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_types = NULL; + OpenAPI_pdu_session_types_t *pdu_session_types_local_nonprim = NULL; + cJSON *ssc_modes = NULL; + OpenAPI_ssc_modes_t *ssc_modes_local_nonprim = NULL; + cJSON *iwk_eps_ind = NULL; + cJSON *_5g_qos_profile = NULL; + OpenAPI_subscribed_default_qos_t *_5g_qos_profile_local_nonprim = NULL; + cJSON *session_ambr = NULL; + OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + cJSON *_3gpp_charging_characteristics = NULL; + cJSON *static_ip_address = NULL; + OpenAPI_list_t *static_ip_addressList = NULL; + cJSON *up_security = NULL; + OpenAPI_up_security_t *up_security_local_nonprim = NULL; + cJSON *pdu_session_continuity_ind = NULL; + OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_indVariable = 0; + cJSON *nidd_nef_id = NULL; + cJSON *nidd_info = NULL; + OpenAPI_nidd_information_t *nidd_info_local_nonprim = NULL; + cJSON *redundant_session_allowed = NULL; + cJSON *acs_info = NULL; + OpenAPI_acs_info_t *acs_info_local_nonprim = NULL; + cJSON *ipv4_frame_route_list = NULL; + OpenAPI_list_t *ipv4_frame_route_listList = NULL; + cJSON *ipv6_frame_route_list = NULL; + OpenAPI_list_t *ipv6_frame_route_listList = NULL; + cJSON *atsss_allowed = NULL; + cJSON *secondary_auth = NULL; + cJSON *dn_aaa_ip_address_allocation = NULL; + cJSON *dn_aaa_address = NULL; + OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL; + cJSON *iptv_acc_ctrl_info = NULL; + pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionTypes"); if (!pdu_session_types) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [pdu_session_types]"); goto end; } - - OpenAPI_pdu_session_types_t *pdu_session_types_local_nonprim = NULL; pdu_session_types_local_nonprim = OpenAPI_pdu_session_types_parseFromJSON(pdu_session_types); - cJSON *ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sscModes"); + ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sscModes"); if (!ssc_modes) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ssc_modes]"); goto end; } - - OpenAPI_ssc_modes_t *ssc_modes_local_nonprim = NULL; ssc_modes_local_nonprim = OpenAPI_ssc_modes_parseFromJSON(ssc_modes); - cJSON *iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iwkEpsInd"); - + iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iwkEpsInd"); if (iwk_eps_ind) { if (!cJSON_IsBool(iwk_eps_ind)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [iwk_eps_ind]"); @@ -363,68 +431,55 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_ } } - cJSON *_5g_qos_profile = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "5gQosProfile"); - - OpenAPI_subscribed_default_qos_t *_5g_qos_profile_local_nonprim = NULL; + _5g_qos_profile = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "5gQosProfile"); if (_5g_qos_profile) { _5g_qos_profile_local_nonprim = OpenAPI_subscribed_default_qos_parseFromJSON(_5g_qos_profile); } - cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sessionAmbr"); - - OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + session_ambr = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sessionAmbr"); if (session_ambr) { session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr); } - cJSON *_3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "3gppChargingCharacteristics"); - + _3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "3gppChargingCharacteristics"); if (_3gpp_charging_characteristics) { - if (!cJSON_IsString(_3gpp_charging_characteristics)) { + if (!cJSON_IsString(_3gpp_charging_characteristics) && !cJSON_IsNull(_3gpp_charging_characteristics)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [_3gpp_charging_characteristics]"); goto end; } } - cJSON *static_ip_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "staticIpAddress"); - - OpenAPI_list_t *static_ip_addressList; + static_ip_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "staticIpAddress"); if (static_ip_address) { - cJSON *static_ip_address_local_nonprimitive; - if (!cJSON_IsArray(static_ip_address)){ - ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [static_ip_address]"); - goto end; - } - - static_ip_addressList = OpenAPI_list_create(); - - cJSON_ArrayForEach(static_ip_address_local_nonprimitive, static_ip_address ) { - if (!cJSON_IsObject(static_ip_address_local_nonprimitive)) { + cJSON *static_ip_address_local = NULL; + if (!cJSON_IsArray(static_ip_address)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [static_ip_address]"); goto end; } - OpenAPI_ip_address_t *static_ip_addressItem = OpenAPI_ip_address_parseFromJSON(static_ip_address_local_nonprimitive); - if (!static_ip_addressItem) { - ogs_error("No static_ip_addressItem"); - OpenAPI_list_free(static_ip_addressList); - goto end; + static_ip_addressList = OpenAPI_list_create(); + + cJSON_ArrayForEach(static_ip_address_local, static_ip_address) { + if (!cJSON_IsObject(static_ip_address_local)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [static_ip_address]"); + goto end; + } + OpenAPI_ip_address_t *static_ip_addressItem = OpenAPI_ip_address_parseFromJSON(static_ip_address_local); + if (!static_ip_addressItem) { + ogs_error("No static_ip_addressItem"); + OpenAPI_list_free(static_ip_addressList); + goto end; + } + OpenAPI_list_add(static_ip_addressList, static_ip_addressItem); } - - OpenAPI_list_add(static_ip_addressList, static_ip_addressItem); - } } - cJSON *up_security = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "upSecurity"); - - OpenAPI_up_security_t *up_security_local_nonprim = NULL; + up_security = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "upSecurity"); if (up_security) { up_security_local_nonprim = OpenAPI_up_security_parseFromJSON(up_security); } - cJSON *pdu_session_continuity_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionContinuityInd"); - - OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_indVariable; + pdu_session_continuity_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionContinuityInd"); if (pdu_session_continuity_ind) { if (!cJSON_IsString(pdu_session_continuity_ind)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [pdu_session_continuity_ind]"); @@ -433,24 +488,20 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_ pdu_session_continuity_indVariable = OpenAPI_pdu_session_continuity_ind_FromString(pdu_session_continuity_ind->valuestring); } - cJSON *nidd_nef_id = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddNefId"); - + nidd_nef_id = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddNefId"); if (nidd_nef_id) { - if (!cJSON_IsString(nidd_nef_id)) { + if (!cJSON_IsString(nidd_nef_id) && !cJSON_IsNull(nidd_nef_id)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [nidd_nef_id]"); goto end; } } - cJSON *nidd_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddInfo"); - - OpenAPI_nidd_information_t *nidd_info_local_nonprim = NULL; + nidd_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddInfo"); if (nidd_info) { nidd_info_local_nonprim = OpenAPI_nidd_information_parseFromJSON(nidd_info); } - cJSON *redundant_session_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "redundantSessionAllowed"); - + redundant_session_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "redundantSessionAllowed"); if (redundant_session_allowed) { if (!cJSON_IsBool(redundant_session_allowed)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [redundant_session_allowed]"); @@ -458,73 +509,62 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_ } } - cJSON *acs_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "acsInfo"); - - OpenAPI_acs_info_t *acs_info_local_nonprim = NULL; + acs_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "acsInfo"); if (acs_info) { acs_info_local_nonprim = OpenAPI_acs_info_parseFromJSON(acs_info); } - cJSON *ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv4FrameRouteList"); - - OpenAPI_list_t *ipv4_frame_route_listList; + ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv4FrameRouteList"); if (ipv4_frame_route_list) { - cJSON *ipv4_frame_route_list_local_nonprimitive; - if (!cJSON_IsArray(ipv4_frame_route_list)){ - ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv4_frame_route_list]"); - goto end; - } - - ipv4_frame_route_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv4_frame_route_list_local_nonprimitive, ipv4_frame_route_list ) { - if (!cJSON_IsObject(ipv4_frame_route_list_local_nonprimitive)) { + cJSON *ipv4_frame_route_list_local = NULL; + if (!cJSON_IsArray(ipv4_frame_route_list)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv4_frame_route_list]"); goto end; } - OpenAPI_frame_route_info_t *ipv4_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv4_frame_route_list_local_nonprimitive); - if (!ipv4_frame_route_listItem) { - ogs_error("No ipv4_frame_route_listItem"); - OpenAPI_list_free(ipv4_frame_route_listList); - goto end; + ipv4_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_frame_route_list_local, ipv4_frame_route_list) { + if (!cJSON_IsObject(ipv4_frame_route_list_local)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv4_frame_route_list]"); + goto end; + } + OpenAPI_frame_route_info_t *ipv4_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv4_frame_route_list_local); + if (!ipv4_frame_route_listItem) { + ogs_error("No ipv4_frame_route_listItem"); + OpenAPI_list_free(ipv4_frame_route_listList); + goto end; + } + OpenAPI_list_add(ipv4_frame_route_listList, ipv4_frame_route_listItem); } - - OpenAPI_list_add(ipv4_frame_route_listList, ipv4_frame_route_listItem); - } } - cJSON *ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv6FrameRouteList"); - - OpenAPI_list_t *ipv6_frame_route_listList; + ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv6FrameRouteList"); if (ipv6_frame_route_list) { - cJSON *ipv6_frame_route_list_local_nonprimitive; - if (!cJSON_IsArray(ipv6_frame_route_list)){ - ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv6_frame_route_list]"); - goto end; - } - - ipv6_frame_route_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv6_frame_route_list_local_nonprimitive, ipv6_frame_route_list ) { - if (!cJSON_IsObject(ipv6_frame_route_list_local_nonprimitive)) { + cJSON *ipv6_frame_route_list_local = NULL; + if (!cJSON_IsArray(ipv6_frame_route_list)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv6_frame_route_list]"); goto end; } - OpenAPI_frame_route_info_t *ipv6_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv6_frame_route_list_local_nonprimitive); - if (!ipv6_frame_route_listItem) { - ogs_error("No ipv6_frame_route_listItem"); - OpenAPI_list_free(ipv6_frame_route_listList); - goto end; + ipv6_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_frame_route_list_local, ipv6_frame_route_list) { + if (!cJSON_IsObject(ipv6_frame_route_list_local)) { + ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv6_frame_route_list]"); + goto end; + } + OpenAPI_frame_route_info_t *ipv6_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv6_frame_route_list_local); + if (!ipv6_frame_route_listItem) { + ogs_error("No ipv6_frame_route_listItem"); + OpenAPI_list_free(ipv6_frame_route_listList); + goto end; + } + OpenAPI_list_add(ipv6_frame_route_listList, ipv6_frame_route_listItem); } - - OpenAPI_list_add(ipv6_frame_route_listList, ipv6_frame_route_listItem); - } } - cJSON *atsss_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "atsssAllowed"); - + atsss_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "atsssAllowed"); if (atsss_allowed) { if (!cJSON_IsBool(atsss_allowed)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [atsss_allowed]"); @@ -532,8 +572,7 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_ } } - cJSON *secondary_auth = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "secondaryAuth"); - + secondary_auth = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "secondaryAuth"); if (secondary_auth) { if (!cJSON_IsBool(secondary_auth)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [secondary_auth]"); @@ -541,8 +580,7 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_ } } - cJSON *dn_aaa_ip_address_allocation = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaIpAddressAllocation"); - + dn_aaa_ip_address_allocation = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaIpAddressAllocation"); if (dn_aaa_ip_address_allocation) { if (!cJSON_IsBool(dn_aaa_ip_address_allocation)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [dn_aaa_ip_address_allocation]"); @@ -550,17 +588,14 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_ } } - cJSON *dn_aaa_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaAddress"); - - OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL; + dn_aaa_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaAddress"); if (dn_aaa_address) { dn_aaa_address_local_nonprim = OpenAPI_ip_address_parseFromJSON(dn_aaa_address); } - cJSON *iptv_acc_ctrl_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iptvAccCtrlInfo"); - + iptv_acc_ctrl_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iptvAccCtrlInfo"); if (iptv_acc_ctrl_info) { - if (!cJSON_IsString(iptv_acc_ctrl_info)) { + if (!cJSON_IsString(iptv_acc_ctrl_info) && !cJSON_IsNull(iptv_acc_ctrl_info)) { ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [iptv_acc_ctrl_info]"); goto end; } @@ -573,11 +608,11 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_ iwk_eps_ind ? iwk_eps_ind->valueint : 0, _5g_qos_profile ? _5g_qos_profile_local_nonprim : NULL, session_ambr ? session_ambr_local_nonprim : NULL, - _3gpp_charging_characteristics ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL, + _3gpp_charging_characteristics && !cJSON_IsNull(_3gpp_charging_characteristics) ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL, static_ip_address ? static_ip_addressList : NULL, up_security ? up_security_local_nonprim : NULL, pdu_session_continuity_ind ? pdu_session_continuity_indVariable : 0, - nidd_nef_id ? ogs_strdup(nidd_nef_id->valuestring) : NULL, + nidd_nef_id && !cJSON_IsNull(nidd_nef_id) ? ogs_strdup(nidd_nef_id->valuestring) : NULL, nidd_info ? nidd_info_local_nonprim : NULL, redundant_session_allowed ? true : false, redundant_session_allowed ? redundant_session_allowed->valueint : 0, @@ -591,11 +626,64 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_ dn_aaa_ip_address_allocation ? true : false, dn_aaa_ip_address_allocation ? dn_aaa_ip_address_allocation->valueint : 0, dn_aaa_address ? dn_aaa_address_local_nonprim : NULL, - iptv_acc_ctrl_info ? ogs_strdup(iptv_acc_ctrl_info->valuestring) : NULL + iptv_acc_ctrl_info && !cJSON_IsNull(iptv_acc_ctrl_info) ? ogs_strdup(iptv_acc_ctrl_info->valuestring) : NULL ); return dnn_configuration_local_var; end: + if (pdu_session_types_local_nonprim) { + OpenAPI_pdu_session_types_free(pdu_session_types_local_nonprim); + pdu_session_types_local_nonprim = NULL; + } + if (ssc_modes_local_nonprim) { + OpenAPI_ssc_modes_free(ssc_modes_local_nonprim); + ssc_modes_local_nonprim = NULL; + } + if (_5g_qos_profile_local_nonprim) { + OpenAPI_subscribed_default_qos_free(_5g_qos_profile_local_nonprim); + _5g_qos_profile_local_nonprim = NULL; + } + if (session_ambr_local_nonprim) { + OpenAPI_ambr_free(session_ambr_local_nonprim); + session_ambr_local_nonprim = NULL; + } + if (static_ip_addressList) { + OpenAPI_list_for_each(static_ip_addressList, node) { + OpenAPI_ip_address_free(node->data); + } + OpenAPI_list_free(static_ip_addressList); + static_ip_addressList = NULL; + } + if (up_security_local_nonprim) { + OpenAPI_up_security_free(up_security_local_nonprim); + up_security_local_nonprim = NULL; + } + if (nidd_info_local_nonprim) { + OpenAPI_nidd_information_free(nidd_info_local_nonprim); + nidd_info_local_nonprim = NULL; + } + if (acs_info_local_nonprim) { + OpenAPI_acs_info_free(acs_info_local_nonprim); + acs_info_local_nonprim = NULL; + } + if (ipv4_frame_route_listList) { + OpenAPI_list_for_each(ipv4_frame_route_listList, node) { + OpenAPI_frame_route_info_free(node->data); + } + OpenAPI_list_free(ipv4_frame_route_listList); + ipv4_frame_route_listList = NULL; + } + if (ipv6_frame_route_listList) { + OpenAPI_list_for_each(ipv6_frame_route_listList, node) { + OpenAPI_frame_route_info_free(node->data); + } + OpenAPI_list_free(ipv6_frame_route_listList); + ipv6_frame_route_listList = NULL; + } + if (dn_aaa_address_local_nonprim) { + OpenAPI_ip_address_free(dn_aaa_address_local_nonprim); + dn_aaa_address_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/dnn_configuration_1.c b/lib/sbi/openapi/model/dnn_configuration_1.c index 225f4e886..0aa7f83fd 100644 --- a/lib/sbi/openapi/model/dnn_configuration_1.c +++ b/lib/sbi/openapi/model/dnn_configuration_1.c @@ -66,39 +66,83 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_create( void OpenAPI_dnn_configuration_1_free(OpenAPI_dnn_configuration_1_t *dnn_configuration_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnn_configuration_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_pdu_session_types_1_free(dnn_configuration_1->pdu_session_types); - OpenAPI_ssc_modes_1_free(dnn_configuration_1->ssc_modes); - OpenAPI_subscribed_default_qos_1_free(dnn_configuration_1->_5g_qos_profile); - OpenAPI_ambr_1_free(dnn_configuration_1->session_ambr); - ogs_free(dnn_configuration_1->_3gpp_charging_characteristics); - OpenAPI_list_for_each(dnn_configuration_1->static_ip_address, node) { - OpenAPI_ip_address_1_free(node->data); + if (dnn_configuration_1->pdu_session_types) { + OpenAPI_pdu_session_types_1_free(dnn_configuration_1->pdu_session_types); + dnn_configuration_1->pdu_session_types = NULL; } - OpenAPI_list_free(dnn_configuration_1->static_ip_address); - OpenAPI_up_security_1_free(dnn_configuration_1->up_security); - ogs_free(dnn_configuration_1->nidd_nef_id); - OpenAPI_nidd_information_1_free(dnn_configuration_1->nidd_info); - OpenAPI_acs_info_1_free(dnn_configuration_1->acs_info); - OpenAPI_list_for_each(dnn_configuration_1->ipv4_frame_route_list, node) { - OpenAPI_frame_route_info_1_free(node->data); + if (dnn_configuration_1->ssc_modes) { + OpenAPI_ssc_modes_1_free(dnn_configuration_1->ssc_modes); + dnn_configuration_1->ssc_modes = NULL; } - OpenAPI_list_free(dnn_configuration_1->ipv4_frame_route_list); - OpenAPI_list_for_each(dnn_configuration_1->ipv6_frame_route_list, node) { - OpenAPI_frame_route_info_1_free(node->data); + if (dnn_configuration_1->_5g_qos_profile) { + OpenAPI_subscribed_default_qos_1_free(dnn_configuration_1->_5g_qos_profile); + dnn_configuration_1->_5g_qos_profile = NULL; + } + if (dnn_configuration_1->session_ambr) { + OpenAPI_ambr_1_free(dnn_configuration_1->session_ambr); + dnn_configuration_1->session_ambr = NULL; + } + if (dnn_configuration_1->_3gpp_charging_characteristics) { + ogs_free(dnn_configuration_1->_3gpp_charging_characteristics); + dnn_configuration_1->_3gpp_charging_characteristics = NULL; + } + if (dnn_configuration_1->static_ip_address) { + OpenAPI_list_for_each(dnn_configuration_1->static_ip_address, node) { + OpenAPI_ip_address_1_free(node->data); + } + OpenAPI_list_free(dnn_configuration_1->static_ip_address); + dnn_configuration_1->static_ip_address = NULL; + } + if (dnn_configuration_1->up_security) { + OpenAPI_up_security_1_free(dnn_configuration_1->up_security); + dnn_configuration_1->up_security = NULL; + } + if (dnn_configuration_1->nidd_nef_id) { + ogs_free(dnn_configuration_1->nidd_nef_id); + dnn_configuration_1->nidd_nef_id = NULL; + } + if (dnn_configuration_1->nidd_info) { + OpenAPI_nidd_information_1_free(dnn_configuration_1->nidd_info); + dnn_configuration_1->nidd_info = NULL; + } + if (dnn_configuration_1->acs_info) { + OpenAPI_acs_info_1_free(dnn_configuration_1->acs_info); + dnn_configuration_1->acs_info = NULL; + } + if (dnn_configuration_1->ipv4_frame_route_list) { + OpenAPI_list_for_each(dnn_configuration_1->ipv4_frame_route_list, node) { + OpenAPI_frame_route_info_1_free(node->data); + } + OpenAPI_list_free(dnn_configuration_1->ipv4_frame_route_list); + dnn_configuration_1->ipv4_frame_route_list = NULL; + } + if (dnn_configuration_1->ipv6_frame_route_list) { + OpenAPI_list_for_each(dnn_configuration_1->ipv6_frame_route_list, node) { + OpenAPI_frame_route_info_1_free(node->data); + } + OpenAPI_list_free(dnn_configuration_1->ipv6_frame_route_list); + dnn_configuration_1->ipv6_frame_route_list = NULL; + } + if (dnn_configuration_1->dn_aaa_address) { + OpenAPI_ip_address_1_free(dnn_configuration_1->dn_aaa_address); + dnn_configuration_1->dn_aaa_address = NULL; + } + if (dnn_configuration_1->iptv_acc_ctrl_info) { + ogs_free(dnn_configuration_1->iptv_acc_ctrl_info); + dnn_configuration_1->iptv_acc_ctrl_info = NULL; } - OpenAPI_list_free(dnn_configuration_1->ipv6_frame_route_list); - OpenAPI_ip_address_1_free(dnn_configuration_1->dn_aaa_address); - ogs_free(dnn_configuration_1->iptv_acc_ctrl_info); ogs_free(dnn_configuration_1); } cJSON *OpenAPI_dnn_configuration_1_convertToJSON(OpenAPI_dnn_configuration_1_t *dnn_configuration_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnn_configuration_1 == NULL) { ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [DnnConfiguration_1]"); @@ -106,6 +150,10 @@ cJSON *OpenAPI_dnn_configuration_1_convertToJSON(OpenAPI_dnn_configuration_1_t * } item = cJSON_CreateObject(); + if (!dnn_configuration_1->pdu_session_types) { + ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [pdu_session_types]"); + return NULL; + } cJSON *pdu_session_types_local_JSON = OpenAPI_pdu_session_types_1_convertToJSON(dnn_configuration_1->pdu_session_types); if (pdu_session_types_local_JSON == NULL) { ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [pdu_session_types]"); @@ -117,6 +165,10 @@ cJSON *OpenAPI_dnn_configuration_1_convertToJSON(OpenAPI_dnn_configuration_1_t * goto end; } + if (!dnn_configuration_1->ssc_modes) { + ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [ssc_modes]"); + return NULL; + } cJSON *ssc_modes_local_JSON = OpenAPI_ssc_modes_1_convertToJSON(dnn_configuration_1->ssc_modes); if (ssc_modes_local_JSON == NULL) { ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [ssc_modes]"); @@ -174,17 +226,13 @@ cJSON *OpenAPI_dnn_configuration_1_convertToJSON(OpenAPI_dnn_configuration_1_t * ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [static_ip_address]"); goto end; } - - OpenAPI_lnode_t *static_ip_address_node; - if (dnn_configuration_1->static_ip_address) { - OpenAPI_list_for_each(dnn_configuration_1->static_ip_address, static_ip_address_node) { - cJSON *itemLocal = OpenAPI_ip_address_1_convertToJSON(static_ip_address_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [static_ip_address]"); - goto end; - } - cJSON_AddItemToArray(static_ip_addressList, itemLocal); + OpenAPI_list_for_each(dnn_configuration_1->static_ip_address, node) { + cJSON *itemLocal = OpenAPI_ip_address_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [static_ip_address]"); + goto end; } + cJSON_AddItemToArray(static_ip_addressList, itemLocal); } } @@ -201,7 +249,7 @@ cJSON *OpenAPI_dnn_configuration_1_convertToJSON(OpenAPI_dnn_configuration_1_t * } } - if (dnn_configuration_1->pdu_session_continuity_ind) { + if (dnn_configuration_1->pdu_session_continuity_ind != OpenAPI_pdu_session_continuity_ind_NULL) { if (cJSON_AddStringToObject(item, "pduSessionContinuityInd", OpenAPI_pdu_session_continuity_ind_ToString(dnn_configuration_1->pdu_session_continuity_ind)) == NULL) { ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [pdu_session_continuity_ind]"); goto end; @@ -254,17 +302,13 @@ cJSON *OpenAPI_dnn_configuration_1_convertToJSON(OpenAPI_dnn_configuration_1_t * ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [ipv4_frame_route_list]"); goto end; } - - OpenAPI_lnode_t *ipv4_frame_route_list_node; - if (dnn_configuration_1->ipv4_frame_route_list) { - OpenAPI_list_for_each(dnn_configuration_1->ipv4_frame_route_list, ipv4_frame_route_list_node) { - cJSON *itemLocal = OpenAPI_frame_route_info_1_convertToJSON(ipv4_frame_route_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [ipv4_frame_route_list]"); - goto end; - } - cJSON_AddItemToArray(ipv4_frame_route_listList, itemLocal); + OpenAPI_list_for_each(dnn_configuration_1->ipv4_frame_route_list, node) { + cJSON *itemLocal = OpenAPI_frame_route_info_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [ipv4_frame_route_list]"); + goto end; } + cJSON_AddItemToArray(ipv4_frame_route_listList, itemLocal); } } @@ -274,17 +318,13 @@ cJSON *OpenAPI_dnn_configuration_1_convertToJSON(OpenAPI_dnn_configuration_1_t * ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [ipv6_frame_route_list]"); goto end; } - - OpenAPI_lnode_t *ipv6_frame_route_list_node; - if (dnn_configuration_1->ipv6_frame_route_list) { - OpenAPI_list_for_each(dnn_configuration_1->ipv6_frame_route_list, ipv6_frame_route_list_node) { - cJSON *itemLocal = OpenAPI_frame_route_info_1_convertToJSON(ipv6_frame_route_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [ipv6_frame_route_list]"); - goto end; - } - cJSON_AddItemToArray(ipv6_frame_route_listList, itemLocal); + OpenAPI_list_for_each(dnn_configuration_1->ipv6_frame_route_list, node) { + cJSON *itemLocal = OpenAPI_frame_route_info_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_configuration_1_convertToJSON() failed [ipv6_frame_route_list]"); + goto end; } + cJSON_AddItemToArray(ipv6_frame_route_listList, itemLocal); } } @@ -336,26 +376,54 @@ end: OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON *dnn_configuration_1JSON) { OpenAPI_dnn_configuration_1_t *dnn_configuration_1_local_var = NULL; - cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "pduSessionTypes"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_types = NULL; + OpenAPI_pdu_session_types_1_t *pdu_session_types_local_nonprim = NULL; + cJSON *ssc_modes = NULL; + OpenAPI_ssc_modes_1_t *ssc_modes_local_nonprim = NULL; + cJSON *iwk_eps_ind = NULL; + cJSON *_5g_qos_profile = NULL; + OpenAPI_subscribed_default_qos_1_t *_5g_qos_profile_local_nonprim = NULL; + cJSON *session_ambr = NULL; + OpenAPI_ambr_1_t *session_ambr_local_nonprim = NULL; + cJSON *_3gpp_charging_characteristics = NULL; + cJSON *static_ip_address = NULL; + OpenAPI_list_t *static_ip_addressList = NULL; + cJSON *up_security = NULL; + OpenAPI_up_security_1_t *up_security_local_nonprim = NULL; + cJSON *pdu_session_continuity_ind = NULL; + OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_indVariable = 0; + cJSON *nidd_nef_id = NULL; + cJSON *nidd_info = NULL; + OpenAPI_nidd_information_1_t *nidd_info_local_nonprim = NULL; + cJSON *redundant_session_allowed = NULL; + cJSON *acs_info = NULL; + OpenAPI_acs_info_1_t *acs_info_local_nonprim = NULL; + cJSON *ipv4_frame_route_list = NULL; + OpenAPI_list_t *ipv4_frame_route_listList = NULL; + cJSON *ipv6_frame_route_list = NULL; + OpenAPI_list_t *ipv6_frame_route_listList = NULL; + cJSON *atsss_allowed = NULL; + cJSON *secondary_auth = NULL; + cJSON *dn_aaa_ip_address_allocation = NULL; + cJSON *dn_aaa_address = NULL; + OpenAPI_ip_address_1_t *dn_aaa_address_local_nonprim = NULL; + cJSON *iptv_acc_ctrl_info = NULL; + pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "pduSessionTypes"); if (!pdu_session_types) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [pdu_session_types]"); goto end; } - - OpenAPI_pdu_session_types_1_t *pdu_session_types_local_nonprim = NULL; pdu_session_types_local_nonprim = OpenAPI_pdu_session_types_1_parseFromJSON(pdu_session_types); - cJSON *ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "sscModes"); + ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "sscModes"); if (!ssc_modes) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [ssc_modes]"); goto end; } - - OpenAPI_ssc_modes_1_t *ssc_modes_local_nonprim = NULL; ssc_modes_local_nonprim = OpenAPI_ssc_modes_1_parseFromJSON(ssc_modes); - cJSON *iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "iwkEpsInd"); - + iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "iwkEpsInd"); if (iwk_eps_ind) { if (!cJSON_IsBool(iwk_eps_ind)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [iwk_eps_ind]"); @@ -363,68 +431,55 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON * } } - cJSON *_5g_qos_profile = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "5gQosProfile"); - - OpenAPI_subscribed_default_qos_1_t *_5g_qos_profile_local_nonprim = NULL; + _5g_qos_profile = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "5gQosProfile"); if (_5g_qos_profile) { _5g_qos_profile_local_nonprim = OpenAPI_subscribed_default_qos_1_parseFromJSON(_5g_qos_profile); } - cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "sessionAmbr"); - - OpenAPI_ambr_1_t *session_ambr_local_nonprim = NULL; + session_ambr = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "sessionAmbr"); if (session_ambr) { session_ambr_local_nonprim = OpenAPI_ambr_1_parseFromJSON(session_ambr); } - cJSON *_3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "3gppChargingCharacteristics"); - + _3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "3gppChargingCharacteristics"); if (_3gpp_charging_characteristics) { - if (!cJSON_IsString(_3gpp_charging_characteristics)) { + if (!cJSON_IsString(_3gpp_charging_characteristics) && !cJSON_IsNull(_3gpp_charging_characteristics)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [_3gpp_charging_characteristics]"); goto end; } } - cJSON *static_ip_address = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "staticIpAddress"); - - OpenAPI_list_t *static_ip_addressList; + static_ip_address = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "staticIpAddress"); if (static_ip_address) { - cJSON *static_ip_address_local_nonprimitive; - if (!cJSON_IsArray(static_ip_address)){ - ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [static_ip_address]"); - goto end; - } - - static_ip_addressList = OpenAPI_list_create(); - - cJSON_ArrayForEach(static_ip_address_local_nonprimitive, static_ip_address ) { - if (!cJSON_IsObject(static_ip_address_local_nonprimitive)) { + cJSON *static_ip_address_local = NULL; + if (!cJSON_IsArray(static_ip_address)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [static_ip_address]"); goto end; } - OpenAPI_ip_address_1_t *static_ip_addressItem = OpenAPI_ip_address_1_parseFromJSON(static_ip_address_local_nonprimitive); - if (!static_ip_addressItem) { - ogs_error("No static_ip_addressItem"); - OpenAPI_list_free(static_ip_addressList); - goto end; + static_ip_addressList = OpenAPI_list_create(); + + cJSON_ArrayForEach(static_ip_address_local, static_ip_address) { + if (!cJSON_IsObject(static_ip_address_local)) { + ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [static_ip_address]"); + goto end; + } + OpenAPI_ip_address_1_t *static_ip_addressItem = OpenAPI_ip_address_1_parseFromJSON(static_ip_address_local); + if (!static_ip_addressItem) { + ogs_error("No static_ip_addressItem"); + OpenAPI_list_free(static_ip_addressList); + goto end; + } + OpenAPI_list_add(static_ip_addressList, static_ip_addressItem); } - - OpenAPI_list_add(static_ip_addressList, static_ip_addressItem); - } } - cJSON *up_security = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "upSecurity"); - - OpenAPI_up_security_1_t *up_security_local_nonprim = NULL; + up_security = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "upSecurity"); if (up_security) { up_security_local_nonprim = OpenAPI_up_security_1_parseFromJSON(up_security); } - cJSON *pdu_session_continuity_ind = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "pduSessionContinuityInd"); - - OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_indVariable; + pdu_session_continuity_ind = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "pduSessionContinuityInd"); if (pdu_session_continuity_ind) { if (!cJSON_IsString(pdu_session_continuity_ind)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [pdu_session_continuity_ind]"); @@ -433,24 +488,20 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON * pdu_session_continuity_indVariable = OpenAPI_pdu_session_continuity_ind_FromString(pdu_session_continuity_ind->valuestring); } - cJSON *nidd_nef_id = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "niddNefId"); - + nidd_nef_id = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "niddNefId"); if (nidd_nef_id) { - if (!cJSON_IsString(nidd_nef_id)) { + if (!cJSON_IsString(nidd_nef_id) && !cJSON_IsNull(nidd_nef_id)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [nidd_nef_id]"); goto end; } } - cJSON *nidd_info = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "niddInfo"); - - OpenAPI_nidd_information_1_t *nidd_info_local_nonprim = NULL; + nidd_info = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "niddInfo"); if (nidd_info) { nidd_info_local_nonprim = OpenAPI_nidd_information_1_parseFromJSON(nidd_info); } - cJSON *redundant_session_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "redundantSessionAllowed"); - + redundant_session_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "redundantSessionAllowed"); if (redundant_session_allowed) { if (!cJSON_IsBool(redundant_session_allowed)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [redundant_session_allowed]"); @@ -458,73 +509,62 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON * } } - cJSON *acs_info = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "acsInfo"); - - OpenAPI_acs_info_1_t *acs_info_local_nonprim = NULL; + acs_info = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "acsInfo"); if (acs_info) { acs_info_local_nonprim = OpenAPI_acs_info_1_parseFromJSON(acs_info); } - cJSON *ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "ipv4FrameRouteList"); - - OpenAPI_list_t *ipv4_frame_route_listList; + ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "ipv4FrameRouteList"); if (ipv4_frame_route_list) { - cJSON *ipv4_frame_route_list_local_nonprimitive; - if (!cJSON_IsArray(ipv4_frame_route_list)){ - ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [ipv4_frame_route_list]"); - goto end; - } - - ipv4_frame_route_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv4_frame_route_list_local_nonprimitive, ipv4_frame_route_list ) { - if (!cJSON_IsObject(ipv4_frame_route_list_local_nonprimitive)) { + cJSON *ipv4_frame_route_list_local = NULL; + if (!cJSON_IsArray(ipv4_frame_route_list)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [ipv4_frame_route_list]"); goto end; } - OpenAPI_frame_route_info_1_t *ipv4_frame_route_listItem = OpenAPI_frame_route_info_1_parseFromJSON(ipv4_frame_route_list_local_nonprimitive); - if (!ipv4_frame_route_listItem) { - ogs_error("No ipv4_frame_route_listItem"); - OpenAPI_list_free(ipv4_frame_route_listList); - goto end; + ipv4_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_frame_route_list_local, ipv4_frame_route_list) { + if (!cJSON_IsObject(ipv4_frame_route_list_local)) { + ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [ipv4_frame_route_list]"); + goto end; + } + OpenAPI_frame_route_info_1_t *ipv4_frame_route_listItem = OpenAPI_frame_route_info_1_parseFromJSON(ipv4_frame_route_list_local); + if (!ipv4_frame_route_listItem) { + ogs_error("No ipv4_frame_route_listItem"); + OpenAPI_list_free(ipv4_frame_route_listList); + goto end; + } + OpenAPI_list_add(ipv4_frame_route_listList, ipv4_frame_route_listItem); } - - OpenAPI_list_add(ipv4_frame_route_listList, ipv4_frame_route_listItem); - } } - cJSON *ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "ipv6FrameRouteList"); - - OpenAPI_list_t *ipv6_frame_route_listList; + ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "ipv6FrameRouteList"); if (ipv6_frame_route_list) { - cJSON *ipv6_frame_route_list_local_nonprimitive; - if (!cJSON_IsArray(ipv6_frame_route_list)){ - ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [ipv6_frame_route_list]"); - goto end; - } - - ipv6_frame_route_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv6_frame_route_list_local_nonprimitive, ipv6_frame_route_list ) { - if (!cJSON_IsObject(ipv6_frame_route_list_local_nonprimitive)) { + cJSON *ipv6_frame_route_list_local = NULL; + if (!cJSON_IsArray(ipv6_frame_route_list)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [ipv6_frame_route_list]"); goto end; } - OpenAPI_frame_route_info_1_t *ipv6_frame_route_listItem = OpenAPI_frame_route_info_1_parseFromJSON(ipv6_frame_route_list_local_nonprimitive); - if (!ipv6_frame_route_listItem) { - ogs_error("No ipv6_frame_route_listItem"); - OpenAPI_list_free(ipv6_frame_route_listList); - goto end; + ipv6_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_frame_route_list_local, ipv6_frame_route_list) { + if (!cJSON_IsObject(ipv6_frame_route_list_local)) { + ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [ipv6_frame_route_list]"); + goto end; + } + OpenAPI_frame_route_info_1_t *ipv6_frame_route_listItem = OpenAPI_frame_route_info_1_parseFromJSON(ipv6_frame_route_list_local); + if (!ipv6_frame_route_listItem) { + ogs_error("No ipv6_frame_route_listItem"); + OpenAPI_list_free(ipv6_frame_route_listList); + goto end; + } + OpenAPI_list_add(ipv6_frame_route_listList, ipv6_frame_route_listItem); } - - OpenAPI_list_add(ipv6_frame_route_listList, ipv6_frame_route_listItem); - } } - cJSON *atsss_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "atsssAllowed"); - + atsss_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "atsssAllowed"); if (atsss_allowed) { if (!cJSON_IsBool(atsss_allowed)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [atsss_allowed]"); @@ -532,8 +572,7 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON * } } - cJSON *secondary_auth = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "secondaryAuth"); - + secondary_auth = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "secondaryAuth"); if (secondary_auth) { if (!cJSON_IsBool(secondary_auth)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [secondary_auth]"); @@ -541,8 +580,7 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON * } } - cJSON *dn_aaa_ip_address_allocation = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "dnAaaIpAddressAllocation"); - + dn_aaa_ip_address_allocation = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "dnAaaIpAddressAllocation"); if (dn_aaa_ip_address_allocation) { if (!cJSON_IsBool(dn_aaa_ip_address_allocation)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [dn_aaa_ip_address_allocation]"); @@ -550,17 +588,14 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON * } } - cJSON *dn_aaa_address = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "dnAaaAddress"); - - OpenAPI_ip_address_1_t *dn_aaa_address_local_nonprim = NULL; + dn_aaa_address = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "dnAaaAddress"); if (dn_aaa_address) { dn_aaa_address_local_nonprim = OpenAPI_ip_address_1_parseFromJSON(dn_aaa_address); } - cJSON *iptv_acc_ctrl_info = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "iptvAccCtrlInfo"); - + iptv_acc_ctrl_info = cJSON_GetObjectItemCaseSensitive(dnn_configuration_1JSON, "iptvAccCtrlInfo"); if (iptv_acc_ctrl_info) { - if (!cJSON_IsString(iptv_acc_ctrl_info)) { + if (!cJSON_IsString(iptv_acc_ctrl_info) && !cJSON_IsNull(iptv_acc_ctrl_info)) { ogs_error("OpenAPI_dnn_configuration_1_parseFromJSON() failed [iptv_acc_ctrl_info]"); goto end; } @@ -573,11 +608,11 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON * iwk_eps_ind ? iwk_eps_ind->valueint : 0, _5g_qos_profile ? _5g_qos_profile_local_nonprim : NULL, session_ambr ? session_ambr_local_nonprim : NULL, - _3gpp_charging_characteristics ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL, + _3gpp_charging_characteristics && !cJSON_IsNull(_3gpp_charging_characteristics) ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL, static_ip_address ? static_ip_addressList : NULL, up_security ? up_security_local_nonprim : NULL, pdu_session_continuity_ind ? pdu_session_continuity_indVariable : 0, - nidd_nef_id ? ogs_strdup(nidd_nef_id->valuestring) : NULL, + nidd_nef_id && !cJSON_IsNull(nidd_nef_id) ? ogs_strdup(nidd_nef_id->valuestring) : NULL, nidd_info ? nidd_info_local_nonprim : NULL, redundant_session_allowed ? true : false, redundant_session_allowed ? redundant_session_allowed->valueint : 0, @@ -591,11 +626,64 @@ OpenAPI_dnn_configuration_1_t *OpenAPI_dnn_configuration_1_parseFromJSON(cJSON * dn_aaa_ip_address_allocation ? true : false, dn_aaa_ip_address_allocation ? dn_aaa_ip_address_allocation->valueint : 0, dn_aaa_address ? dn_aaa_address_local_nonprim : NULL, - iptv_acc_ctrl_info ? ogs_strdup(iptv_acc_ctrl_info->valuestring) : NULL + iptv_acc_ctrl_info && !cJSON_IsNull(iptv_acc_ctrl_info) ? ogs_strdup(iptv_acc_ctrl_info->valuestring) : NULL ); return dnn_configuration_1_local_var; end: + if (pdu_session_types_local_nonprim) { + OpenAPI_pdu_session_types_1_free(pdu_session_types_local_nonprim); + pdu_session_types_local_nonprim = NULL; + } + if (ssc_modes_local_nonprim) { + OpenAPI_ssc_modes_1_free(ssc_modes_local_nonprim); + ssc_modes_local_nonprim = NULL; + } + if (_5g_qos_profile_local_nonprim) { + OpenAPI_subscribed_default_qos_1_free(_5g_qos_profile_local_nonprim); + _5g_qos_profile_local_nonprim = NULL; + } + if (session_ambr_local_nonprim) { + OpenAPI_ambr_1_free(session_ambr_local_nonprim); + session_ambr_local_nonprim = NULL; + } + if (static_ip_addressList) { + OpenAPI_list_for_each(static_ip_addressList, node) { + OpenAPI_ip_address_1_free(node->data); + } + OpenAPI_list_free(static_ip_addressList); + static_ip_addressList = NULL; + } + if (up_security_local_nonprim) { + OpenAPI_up_security_1_free(up_security_local_nonprim); + up_security_local_nonprim = NULL; + } + if (nidd_info_local_nonprim) { + OpenAPI_nidd_information_1_free(nidd_info_local_nonprim); + nidd_info_local_nonprim = NULL; + } + if (acs_info_local_nonprim) { + OpenAPI_acs_info_1_free(acs_info_local_nonprim); + acs_info_local_nonprim = NULL; + } + if (ipv4_frame_route_listList) { + OpenAPI_list_for_each(ipv4_frame_route_listList, node) { + OpenAPI_frame_route_info_1_free(node->data); + } + OpenAPI_list_free(ipv4_frame_route_listList); + ipv4_frame_route_listList = NULL; + } + if (ipv6_frame_route_listList) { + OpenAPI_list_for_each(ipv6_frame_route_listList, node) { + OpenAPI_frame_route_info_1_free(node->data); + } + OpenAPI_list_free(ipv6_frame_route_listList); + ipv6_frame_route_listList = NULL; + } + if (dn_aaa_address_local_nonprim) { + OpenAPI_ip_address_1_free(dn_aaa_address_local_nonprim); + dn_aaa_address_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/dnn_info.c b/lib/sbi/openapi/model/dnn_info.c index a37fdf4f2..83fba365a 100644 --- a/lib/sbi/openapi/model/dnn_info.c +++ b/lib/sbi/openapi/model/dnn_info.c @@ -44,21 +44,29 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_create( void OpenAPI_dnn_info_free(OpenAPI_dnn_info_t *dnn_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnn_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(dnn_info->dnn); - OpenAPI_list_for_each(dnn_info->smf_list, node) { - ogs_free(node->data); + if (dnn_info->dnn) { + ogs_free(dnn_info->dnn); + dnn_info->dnn = NULL; + } + if (dnn_info->smf_list) { + OpenAPI_list_for_each(dnn_info->smf_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnn_info->smf_list); + dnn_info->smf_list = NULL; } - OpenAPI_list_free(dnn_info->smf_list); ogs_free(dnn_info); } cJSON *OpenAPI_dnn_info_convertToJSON(OpenAPI_dnn_info_t *dnn_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnn_info == NULL) { ogs_error("OpenAPI_dnn_info_convertToJSON() failed [DnnInfo]"); @@ -66,6 +74,10 @@ cJSON *OpenAPI_dnn_info_convertToJSON(OpenAPI_dnn_info_t *dnn_info) } item = cJSON_CreateObject(); + if (!dnn_info->dnn) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", dnn_info->dnn) == NULL) { ogs_error("OpenAPI_dnn_info_convertToJSON() failed [dnn]"); goto end; @@ -107,19 +119,17 @@ cJSON *OpenAPI_dnn_info_convertToJSON(OpenAPI_dnn_info_t *dnn_info) } if (dnn_info->smf_list) { - cJSON *smf_list = cJSON_AddArrayToObject(item, "smfList"); - if (smf_list == NULL) { + cJSON *smf_listList = cJSON_AddArrayToObject(item, "smfList"); + if (smf_listList == NULL) { ogs_error("OpenAPI_dnn_info_convertToJSON() failed [smf_list]"); goto end; } - - OpenAPI_lnode_t *smf_list_node; - OpenAPI_list_for_each(dnn_info->smf_list, smf_list_node) { - if (cJSON_AddStringToObject(smf_list, "", (char*)smf_list_node->data) == NULL) { - ogs_error("OpenAPI_dnn_info_convertToJSON() failed [smf_list]"); - goto end; + OpenAPI_list_for_each(dnn_info->smf_list, node) { + if (cJSON_AddStringToObject(smf_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_dnn_info_convertToJSON() failed [smf_list]"); + goto end; + } } - } } if (dnn_info->is_same_smf_ind) { @@ -136,19 +146,27 @@ end: OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON) { OpenAPI_dnn_info_t *dnn_info_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *default_dnn_indicator = NULL; + cJSON *lbo_roaming_allowed = NULL; + cJSON *iwk_eps_ind = NULL; + cJSON *dnn_barred = NULL; + cJSON *invoke_nef_ind = NULL; + cJSON *smf_list = NULL; + OpenAPI_list_t *smf_listList = NULL; + cJSON *same_smf_ind = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [dnn]"); goto end; } - cJSON *default_dnn_indicator = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "defaultDnnIndicator"); - + default_dnn_indicator = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "defaultDnnIndicator"); if (default_dnn_indicator) { if (!cJSON_IsBool(default_dnn_indicator)) { ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [default_dnn_indicator]"); @@ -156,8 +174,7 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON) } } - cJSON *lbo_roaming_allowed = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "lboRoamingAllowed"); - + lbo_roaming_allowed = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "lboRoamingAllowed"); if (lbo_roaming_allowed) { if (!cJSON_IsBool(lbo_roaming_allowed)) { ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [lbo_roaming_allowed]"); @@ -165,8 +182,7 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON) } } - cJSON *iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "iwkEpsInd"); - + iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "iwkEpsInd"); if (iwk_eps_ind) { if (!cJSON_IsBool(iwk_eps_ind)) { ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [iwk_eps_ind]"); @@ -174,8 +190,7 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON) } } - cJSON *dnn_barred = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "dnnBarred"); - + dnn_barred = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "dnnBarred"); if (dnn_barred) { if (!cJSON_IsBool(dnn_barred)) { ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [dnn_barred]"); @@ -183,8 +198,7 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON) } } - cJSON *invoke_nef_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "invokeNefInd"); - + invoke_nef_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "invokeNefInd"); if (invoke_nef_ind) { if (!cJSON_IsBool(invoke_nef_ind)) { ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [invoke_nef_ind]"); @@ -192,28 +206,28 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON) } } - cJSON *smf_list = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "smfList"); - - OpenAPI_list_t *smf_listList; + smf_list = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "smfList"); if (smf_list) { - cJSON *smf_list_local; - if (!cJSON_IsArray(smf_list)) { - ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [smf_list]"); - goto end; - } - smf_listList = OpenAPI_list_create(); + cJSON *smf_list_local = NULL; + if (!cJSON_IsArray(smf_list)) { + ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [smf_list]"); + goto end; + } - cJSON_ArrayForEach(smf_list_local, smf_list) { - if (!cJSON_IsString(smf_list_local)) { - ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [smf_list]"); - goto end; - } - OpenAPI_list_add(smf_listList, ogs_strdup(smf_list_local->valuestring)); - } + smf_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_list_local, smf_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(smf_list_local)) { + ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [smf_list]"); + goto end; + } + OpenAPI_list_add(smf_listList, ogs_strdup(smf_list_local->valuestring)); + } } - cJSON *same_smf_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "sameSmfInd"); - + same_smf_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "sameSmfInd"); if (same_smf_ind) { if (!cJSON_IsBool(same_smf_ind)) { ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [same_smf_ind]"); @@ -240,6 +254,13 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON) return dnn_info_local_var; end: + if (smf_listList) { + OpenAPI_list_for_each(smf_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(smf_listList); + smf_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/dnn_route_selection_descriptor.c b/lib/sbi/openapi/model/dnn_route_selection_descriptor.c index bb2676511..3430dbfb0 100644 --- a/lib/sbi/openapi/model/dnn_route_selection_descriptor.c +++ b/lib/sbi/openapi/model/dnn_route_selection_descriptor.c @@ -26,19 +26,30 @@ OpenAPI_dnn_route_selection_descriptor_t *OpenAPI_dnn_route_selection_descriptor void OpenAPI_dnn_route_selection_descriptor_free(OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnn_route_selection_descriptor) { return; } - OpenAPI_lnode_t *node; - ogs_free(dnn_route_selection_descriptor->dnn); - OpenAPI_list_free(dnn_route_selection_descriptor->ssc_modes); - OpenAPI_list_free(dnn_route_selection_descriptor->pdu_sess_types); + if (dnn_route_selection_descriptor->dnn) { + ogs_free(dnn_route_selection_descriptor->dnn); + dnn_route_selection_descriptor->dnn = NULL; + } + if (dnn_route_selection_descriptor->ssc_modes) { + OpenAPI_list_free(dnn_route_selection_descriptor->ssc_modes); + dnn_route_selection_descriptor->ssc_modes = NULL; + } + if (dnn_route_selection_descriptor->pdu_sess_types) { + OpenAPI_list_free(dnn_route_selection_descriptor->pdu_sess_types); + dnn_route_selection_descriptor->pdu_sess_types = NULL; + } ogs_free(dnn_route_selection_descriptor); } cJSON *OpenAPI_dnn_route_selection_descriptor_convertToJSON(OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnn_route_selection_descriptor == NULL) { ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [DnnRouteSelectionDescriptor]"); @@ -46,35 +57,37 @@ cJSON *OpenAPI_dnn_route_selection_descriptor_convertToJSON(OpenAPI_dnn_route_se } item = cJSON_CreateObject(); + if (!dnn_route_selection_descriptor->dnn) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", dnn_route_selection_descriptor->dnn) == NULL) { ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [dnn]"); goto end; } - if (dnn_route_selection_descriptor->ssc_modes) { - cJSON *ssc_modes = cJSON_AddArrayToObject(item, "sscModes"); - if (ssc_modes == NULL) { + if (dnn_route_selection_descriptor->ssc_modes != OpenAPI_ssc_mode_NULL) { + cJSON *ssc_modesList = cJSON_AddArrayToObject(item, "sscModes"); + if (ssc_modesList == NULL) { ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [ssc_modes]"); goto end; } - OpenAPI_lnode_t *ssc_modes_node; - OpenAPI_list_for_each(dnn_route_selection_descriptor->ssc_modes, ssc_modes_node) { - if (cJSON_AddStringToObject(ssc_modes, "", OpenAPI_ssc_mode_ToString((intptr_t)ssc_modes_node->data)) == NULL) { + OpenAPI_list_for_each(dnn_route_selection_descriptor->ssc_modes, node) { + if (cJSON_AddStringToObject(ssc_modesList, "", OpenAPI_ssc_mode_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [ssc_modes]"); goto end; } } } - if (dnn_route_selection_descriptor->pdu_sess_types) { - cJSON *pdu_sess_types = cJSON_AddArrayToObject(item, "pduSessTypes"); - if (pdu_sess_types == NULL) { + if (dnn_route_selection_descriptor->pdu_sess_types != OpenAPI_pdu_session_type_NULL) { + cJSON *pdu_sess_typesList = cJSON_AddArrayToObject(item, "pduSessTypes"); + if (pdu_sess_typesList == NULL) { ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [pdu_sess_types]"); goto end; } - OpenAPI_lnode_t *pdu_sess_types_node; - OpenAPI_list_for_each(dnn_route_selection_descriptor->pdu_sess_types, pdu_sess_types_node) { - if (cJSON_AddStringToObject(pdu_sess_types, "", OpenAPI_pdu_session_type_ToString((intptr_t)pdu_sess_types_node->data)) == NULL) { + OpenAPI_list_for_each(dnn_route_selection_descriptor->pdu_sess_types, node) { + if (cJSON_AddStringToObject(pdu_sess_typesList, "", OpenAPI_pdu_session_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_dnn_route_selection_descriptor_convertToJSON() failed [pdu_sess_types]"); goto end; } @@ -95,63 +108,62 @@ end: OpenAPI_dnn_route_selection_descriptor_t *OpenAPI_dnn_route_selection_descriptor_parseFromJSON(cJSON *dnn_route_selection_descriptorJSON) { OpenAPI_dnn_route_selection_descriptor_t *dnn_route_selection_descriptor_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *ssc_modes = NULL; + OpenAPI_list_t *ssc_modesList = NULL; + cJSON *pdu_sess_types = NULL; + OpenAPI_list_t *pdu_sess_typesList = NULL; + cJSON *atsss_info = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [dnn]"); goto end; } - cJSON *ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "sscModes"); - - OpenAPI_list_t *ssc_modesList; + ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "sscModes"); if (ssc_modes) { - cJSON *ssc_modes_local_nonprimitive; - if (!cJSON_IsArray(ssc_modes)) { - ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [ssc_modes]"); - goto end; - } - - ssc_modesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ssc_modes_local_nonprimitive, ssc_modes ) { - if (!cJSON_IsString(ssc_modes_local_nonprimitive)){ + cJSON *ssc_modes_local = NULL; + if (!cJSON_IsArray(ssc_modes)) { ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [ssc_modes]"); goto end; } - OpenAPI_list_add(ssc_modesList, (void *)OpenAPI_ssc_mode_FromString(ssc_modes_local_nonprimitive->valuestring)); - } + ssc_modesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ssc_modes_local, ssc_modes) { + if (!cJSON_IsString(ssc_modes_local)) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [ssc_modes]"); + goto end; + } + OpenAPI_list_add(ssc_modesList, (void *)OpenAPI_ssc_mode_FromString(ssc_modes_local->valuestring)); + } } - cJSON *pdu_sess_types = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "pduSessTypes"); - - OpenAPI_list_t *pdu_sess_typesList; + pdu_sess_types = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "pduSessTypes"); if (pdu_sess_types) { - cJSON *pdu_sess_types_local_nonprimitive; - if (!cJSON_IsArray(pdu_sess_types)) { - ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [pdu_sess_types]"); - goto end; - } - - pdu_sess_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_sess_types_local_nonprimitive, pdu_sess_types ) { - if (!cJSON_IsString(pdu_sess_types_local_nonprimitive)){ + cJSON *pdu_sess_types_local = NULL; + if (!cJSON_IsArray(pdu_sess_types)) { ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [pdu_sess_types]"); goto end; } - OpenAPI_list_add(pdu_sess_typesList, (void *)OpenAPI_pdu_session_type_FromString(pdu_sess_types_local_nonprimitive->valuestring)); - } + pdu_sess_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_sess_types_local, pdu_sess_types) { + if (!cJSON_IsString(pdu_sess_types_local)) { + ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [pdu_sess_types]"); + goto end; + } + OpenAPI_list_add(pdu_sess_typesList, (void *)OpenAPI_pdu_session_type_FromString(pdu_sess_types_local->valuestring)); + } } - cJSON *atsss_info = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "atsssInfo"); - + atsss_info = cJSON_GetObjectItemCaseSensitive(dnn_route_selection_descriptorJSON, "atsssInfo"); if (atsss_info) { if (!cJSON_IsBool(atsss_info)) { ogs_error("OpenAPI_dnn_route_selection_descriptor_parseFromJSON() failed [atsss_info]"); @@ -169,6 +181,14 @@ OpenAPI_dnn_route_selection_descriptor_t *OpenAPI_dnn_route_selection_descriptor return dnn_route_selection_descriptor_local_var; end: + if (ssc_modesList) { + OpenAPI_list_free(ssc_modesList); + ssc_modesList = NULL; + } + if (pdu_sess_typesList) { + OpenAPI_list_free(pdu_sess_typesList); + pdu_sess_typesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/dnn_smf_info_item.c b/lib/sbi/openapi/model/dnn_smf_info_item.c index a7ca35868..7d36937f3 100644 --- a/lib/sbi/openapi/model/dnn_smf_info_item.c +++ b/lib/sbi/openapi/model/dnn_smf_info_item.c @@ -18,17 +18,22 @@ OpenAPI_dnn_smf_info_item_t *OpenAPI_dnn_smf_info_item_create( void OpenAPI_dnn_smf_info_item_free(OpenAPI_dnn_smf_info_item_t *dnn_smf_info_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnn_smf_info_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(dnn_smf_info_item->dnn); + if (dnn_smf_info_item->dnn) { + ogs_free(dnn_smf_info_item->dnn); + dnn_smf_info_item->dnn = NULL; + } ogs_free(dnn_smf_info_item); } cJSON *OpenAPI_dnn_smf_info_item_convertToJSON(OpenAPI_dnn_smf_info_item_t *dnn_smf_info_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnn_smf_info_item == NULL) { ogs_error("OpenAPI_dnn_smf_info_item_convertToJSON() failed [DnnSmfInfoItem]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_dnn_smf_info_item_convertToJSON(OpenAPI_dnn_smf_info_item_t *dnn_ } item = cJSON_CreateObject(); + if (!dnn_smf_info_item->dnn) { + ogs_error("OpenAPI_dnn_smf_info_item_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", dnn_smf_info_item->dnn) == NULL) { ogs_error("OpenAPI_dnn_smf_info_item_convertToJSON() failed [dnn]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_dnn_smf_info_item_t *OpenAPI_dnn_smf_info_item_parseFromJSON(cJSON *dnn_smf_info_itemJSON) { OpenAPI_dnn_smf_info_item_t *dnn_smf_info_item_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(dnn_smf_info_itemJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(dnn_smf_info_itemJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_dnn_smf_info_item_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_dnn_smf_info_item_parseFromJSON() failed [dnn]"); goto end; diff --git a/lib/sbi/openapi/model/dnn_upf_info_item.c b/lib/sbi/openapi/model/dnn_upf_info_item.c index 918c5000b..a09a5dd25 100644 --- a/lib/sbi/openapi/model/dnn_upf_info_item.c +++ b/lib/sbi/openapi/model/dnn_upf_info_item.c @@ -28,37 +28,57 @@ OpenAPI_dnn_upf_info_item_t *OpenAPI_dnn_upf_info_item_create( void OpenAPI_dnn_upf_info_item_free(OpenAPI_dnn_upf_info_item_t *dnn_upf_info_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dnn_upf_info_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(dnn_upf_info_item->dnn); - OpenAPI_list_for_each(dnn_upf_info_item->dnai_list, node) { - ogs_free(node->data); + if (dnn_upf_info_item->dnn) { + ogs_free(dnn_upf_info_item->dnn); + dnn_upf_info_item->dnn = NULL; } - OpenAPI_list_free(dnn_upf_info_item->dnai_list); - OpenAPI_list_free(dnn_upf_info_item->pdu_session_types); - OpenAPI_list_for_each(dnn_upf_info_item->ipv4_address_ranges, node) { - OpenAPI_ipv4_address_range_free(node->data); + if (dnn_upf_info_item->dnai_list) { + OpenAPI_list_for_each(dnn_upf_info_item->dnai_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnn_upf_info_item->dnai_list); + dnn_upf_info_item->dnai_list = NULL; } - OpenAPI_list_free(dnn_upf_info_item->ipv4_address_ranges); - OpenAPI_list_for_each(dnn_upf_info_item->ipv6_prefix_ranges, node) { - OpenAPI_ipv6_prefix_range_free(node->data); + if (dnn_upf_info_item->pdu_session_types) { + OpenAPI_list_free(dnn_upf_info_item->pdu_session_types); + dnn_upf_info_item->pdu_session_types = NULL; } - OpenAPI_list_free(dnn_upf_info_item->ipv6_prefix_ranges); - OpenAPI_list_for_each(dnn_upf_info_item->dnai_nw_instance_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (dnn_upf_info_item->ipv4_address_ranges) { + OpenAPI_list_for_each(dnn_upf_info_item->ipv4_address_ranges, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(dnn_upf_info_item->ipv4_address_ranges); + dnn_upf_info_item->ipv4_address_ranges = NULL; + } + if (dnn_upf_info_item->ipv6_prefix_ranges) { + OpenAPI_list_for_each(dnn_upf_info_item->ipv6_prefix_ranges, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(dnn_upf_info_item->ipv6_prefix_ranges); + dnn_upf_info_item->ipv6_prefix_ranges = NULL; + } + if (dnn_upf_info_item->dnai_nw_instance_list) { + OpenAPI_list_for_each(dnn_upf_info_item->dnai_nw_instance_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(dnn_upf_info_item->dnai_nw_instance_list); + dnn_upf_info_item->dnai_nw_instance_list = NULL; } - OpenAPI_list_free(dnn_upf_info_item->dnai_nw_instance_list); ogs_free(dnn_upf_info_item); } cJSON *OpenAPI_dnn_upf_info_item_convertToJSON(OpenAPI_dnn_upf_info_item_t *dnn_upf_info_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dnn_upf_info_item == NULL) { ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [DnnUpfInfoItem]"); @@ -66,36 +86,37 @@ cJSON *OpenAPI_dnn_upf_info_item_convertToJSON(OpenAPI_dnn_upf_info_item_t *dnn_ } item = cJSON_CreateObject(); + if (!dnn_upf_info_item->dnn) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", dnn_upf_info_item->dnn) == NULL) { ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [dnn]"); goto end; } if (dnn_upf_info_item->dnai_list) { - cJSON *dnai_list = cJSON_AddArrayToObject(item, "dnaiList"); - if (dnai_list == NULL) { + cJSON *dnai_listList = cJSON_AddArrayToObject(item, "dnaiList"); + if (dnai_listList == NULL) { ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [dnai_list]"); goto end; } - - OpenAPI_lnode_t *dnai_list_node; - OpenAPI_list_for_each(dnn_upf_info_item->dnai_list, dnai_list_node) { - if (cJSON_AddStringToObject(dnai_list, "", (char*)dnai_list_node->data) == NULL) { - ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [dnai_list]"); - goto end; + OpenAPI_list_for_each(dnn_upf_info_item->dnai_list, node) { + if (cJSON_AddStringToObject(dnai_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [dnai_list]"); + goto end; + } } - } } - if (dnn_upf_info_item->pdu_session_types) { - cJSON *pdu_session_types = cJSON_AddArrayToObject(item, "pduSessionTypes"); - if (pdu_session_types == NULL) { + if (dnn_upf_info_item->pdu_session_types != OpenAPI_pdu_session_type_NULL) { + cJSON *pdu_session_typesList = cJSON_AddArrayToObject(item, "pduSessionTypes"); + if (pdu_session_typesList == NULL) { ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [pdu_session_types]"); goto end; } - OpenAPI_lnode_t *pdu_session_types_node; - OpenAPI_list_for_each(dnn_upf_info_item->pdu_session_types, pdu_session_types_node) { - if (cJSON_AddStringToObject(pdu_session_types, "", OpenAPI_pdu_session_type_ToString((intptr_t)pdu_session_types_node->data)) == NULL) { + OpenAPI_list_for_each(dnn_upf_info_item->pdu_session_types, node) { + if (cJSON_AddStringToObject(pdu_session_typesList, "", OpenAPI_pdu_session_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [pdu_session_types]"); goto end; } @@ -108,17 +129,13 @@ cJSON *OpenAPI_dnn_upf_info_item_convertToJSON(OpenAPI_dnn_upf_info_item_t *dnn_ ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv4_address_ranges]"); goto end; } - - OpenAPI_lnode_t *ipv4_address_ranges_node; - if (dnn_upf_info_item->ipv4_address_ranges) { - OpenAPI_list_for_each(dnn_upf_info_item->ipv4_address_ranges, ipv4_address_ranges_node) { - cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(ipv4_address_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv4_address_ranges]"); - goto end; - } - cJSON_AddItemToArray(ipv4_address_rangesList, itemLocal); + OpenAPI_list_for_each(dnn_upf_info_item->ipv4_address_ranges, node) { + cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv4_address_ranges]"); + goto end; } + cJSON_AddItemToArray(ipv4_address_rangesList, itemLocal); } } @@ -128,17 +145,13 @@ cJSON *OpenAPI_dnn_upf_info_item_convertToJSON(OpenAPI_dnn_upf_info_item_t *dnn_ ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv6_prefix_ranges]"); goto end; } - - OpenAPI_lnode_t *ipv6_prefix_ranges_node; - if (dnn_upf_info_item->ipv6_prefix_ranges) { - OpenAPI_list_for_each(dnn_upf_info_item->ipv6_prefix_ranges, ipv6_prefix_ranges_node) { - cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(ipv6_prefix_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv6_prefix_ranges]"); - goto end; - } - cJSON_AddItemToArray(ipv6_prefix_rangesList, itemLocal); + OpenAPI_list_for_each(dnn_upf_info_item->ipv6_prefix_ranges, node) { + cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [ipv6_prefix_ranges]"); + goto end; } + cJSON_AddItemToArray(ipv6_prefix_rangesList, itemLocal); } } @@ -149,17 +162,16 @@ cJSON *OpenAPI_dnn_upf_info_item_convertToJSON(OpenAPI_dnn_upf_info_item_t *dnn_ goto end; } cJSON *localMapObject = dnai_nw_instance_list; - OpenAPI_lnode_t *dnai_nw_instance_list_node; if (dnn_upf_info_item->dnai_nw_instance_list) { - OpenAPI_list_for_each(dnn_upf_info_item->dnai_nw_instance_list, dnai_nw_instance_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)dnai_nw_instance_list_node->data; - if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(dnn_upf_info_item->dnai_nw_instance_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_dnn_upf_info_item_convertToJSON() failed [inner]"); + goto end; } } } + } end: return item; @@ -168,137 +180,140 @@ end: OpenAPI_dnn_upf_info_item_t *OpenAPI_dnn_upf_info_item_parseFromJSON(cJSON *dnn_upf_info_itemJSON) { OpenAPI_dnn_upf_info_item_t *dnn_upf_info_item_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *dnai_list = NULL; + OpenAPI_list_t *dnai_listList = NULL; + cJSON *pdu_session_types = NULL; + OpenAPI_list_t *pdu_session_typesList = NULL; + cJSON *ipv4_address_ranges = NULL; + OpenAPI_list_t *ipv4_address_rangesList = NULL; + cJSON *ipv6_prefix_ranges = NULL; + OpenAPI_list_t *ipv6_prefix_rangesList = NULL; + cJSON *dnai_nw_instance_list = NULL; + OpenAPI_list_t *dnai_nw_instance_listList = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [dnn]"); goto end; } - cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "dnaiList"); - - OpenAPI_list_t *dnai_listList; + dnai_list = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "dnaiList"); if (dnai_list) { - cJSON *dnai_list_local; - if (!cJSON_IsArray(dnai_list)) { - ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [dnai_list]"); - goto end; - } - dnai_listList = OpenAPI_list_create(); + cJSON *dnai_list_local = NULL; + if (!cJSON_IsArray(dnai_list)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [dnai_list]"); + goto end; + } - cJSON_ArrayForEach(dnai_list_local, dnai_list) { - if (!cJSON_IsString(dnai_list_local)) { - ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [dnai_list]"); - goto end; - } - OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); - } + dnai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnai_list_local, dnai_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnai_list_local)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [dnai_list]"); + goto end; + } + OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); + } } - cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "pduSessionTypes"); - - OpenAPI_list_t *pdu_session_typesList; + pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "pduSessionTypes"); if (pdu_session_types) { - cJSON *pdu_session_types_local_nonprimitive; - if (!cJSON_IsArray(pdu_session_types)) { - ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [pdu_session_types]"); - goto end; - } - - pdu_session_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_session_types_local_nonprimitive, pdu_session_types ) { - if (!cJSON_IsString(pdu_session_types_local_nonprimitive)){ + cJSON *pdu_session_types_local = NULL; + if (!cJSON_IsArray(pdu_session_types)) { ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [pdu_session_types]"); goto end; } - OpenAPI_list_add(pdu_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(pdu_session_types_local_nonprimitive->valuestring)); - } + pdu_session_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_types_local, pdu_session_types) { + if (!cJSON_IsString(pdu_session_types_local)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [pdu_session_types]"); + goto end; + } + OpenAPI_list_add(pdu_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(pdu_session_types_local->valuestring)); + } } - cJSON *ipv4_address_ranges = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "ipv4AddressRanges"); - - OpenAPI_list_t *ipv4_address_rangesList; + ipv4_address_ranges = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "ipv4AddressRanges"); if (ipv4_address_ranges) { - cJSON *ipv4_address_ranges_local_nonprimitive; - if (!cJSON_IsArray(ipv4_address_ranges)){ - ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv4_address_ranges]"); - goto end; - } - - ipv4_address_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv4_address_ranges_local_nonprimitive, ipv4_address_ranges ) { - if (!cJSON_IsObject(ipv4_address_ranges_local_nonprimitive)) { + cJSON *ipv4_address_ranges_local = NULL; + if (!cJSON_IsArray(ipv4_address_ranges)) { ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv4_address_ranges]"); goto end; } - OpenAPI_ipv4_address_range_t *ipv4_address_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(ipv4_address_ranges_local_nonprimitive); - if (!ipv4_address_rangesItem) { - ogs_error("No ipv4_address_rangesItem"); - OpenAPI_list_free(ipv4_address_rangesList); - goto end; + ipv4_address_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_address_ranges_local, ipv4_address_ranges) { + if (!cJSON_IsObject(ipv4_address_ranges_local)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv4_address_ranges]"); + goto end; + } + OpenAPI_ipv4_address_range_t *ipv4_address_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(ipv4_address_ranges_local); + if (!ipv4_address_rangesItem) { + ogs_error("No ipv4_address_rangesItem"); + OpenAPI_list_free(ipv4_address_rangesList); + goto end; + } + OpenAPI_list_add(ipv4_address_rangesList, ipv4_address_rangesItem); } - - OpenAPI_list_add(ipv4_address_rangesList, ipv4_address_rangesItem); - } } - cJSON *ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "ipv6PrefixRanges"); - - OpenAPI_list_t *ipv6_prefix_rangesList; + ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "ipv6PrefixRanges"); if (ipv6_prefix_ranges) { - cJSON *ipv6_prefix_ranges_local_nonprimitive; - if (!cJSON_IsArray(ipv6_prefix_ranges)){ - ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv6_prefix_ranges]"); - goto end; - } - - ipv6_prefix_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv6_prefix_ranges_local_nonprimitive, ipv6_prefix_ranges ) { - if (!cJSON_IsObject(ipv6_prefix_ranges_local_nonprimitive)) { + cJSON *ipv6_prefix_ranges_local = NULL; + if (!cJSON_IsArray(ipv6_prefix_ranges)) { ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv6_prefix_ranges]"); goto end; } - OpenAPI_ipv6_prefix_range_t *ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(ipv6_prefix_ranges_local_nonprimitive); - if (!ipv6_prefix_rangesItem) { - ogs_error("No ipv6_prefix_rangesItem"); - OpenAPI_list_free(ipv6_prefix_rangesList); - goto end; + ipv6_prefix_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_prefix_ranges_local, ipv6_prefix_ranges) { + if (!cJSON_IsObject(ipv6_prefix_ranges_local)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [ipv6_prefix_ranges]"); + goto end; + } + OpenAPI_ipv6_prefix_range_t *ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(ipv6_prefix_ranges_local); + if (!ipv6_prefix_rangesItem) { + ogs_error("No ipv6_prefix_rangesItem"); + OpenAPI_list_free(ipv6_prefix_rangesList); + goto end; + } + OpenAPI_list_add(ipv6_prefix_rangesList, ipv6_prefix_rangesItem); } - - OpenAPI_list_add(ipv6_prefix_rangesList, ipv6_prefix_rangesItem); - } } - cJSON *dnai_nw_instance_list = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "dnaiNwInstanceList"); - - OpenAPI_list_t *dnai_nw_instance_listList; + dnai_nw_instance_list = cJSON_GetObjectItemCaseSensitive(dnn_upf_info_itemJSON, "dnaiNwInstanceList"); if (dnai_nw_instance_list) { - cJSON *dnai_nw_instance_list_local_map; - if (!cJSON_IsObject(dnai_nw_instance_list)) { - ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [dnai_nw_instance_list]"); - goto end; - } - dnai_nw_instance_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(dnai_nw_instance_list_local_map, dnai_nw_instance_list) { - cJSON *localMapObject = dnai_nw_instance_list_local_map; - if (!cJSON_IsString(localMapObject)) { - ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [inner]"); + cJSON *dnai_nw_instance_list_local_map = NULL; + if (!cJSON_IsObject(dnai_nw_instance_list) && !cJSON_IsNull(dnai_nw_instance_list)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [dnai_nw_instance_list]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - OpenAPI_list_add(dnai_nw_instance_listList, localMapKeyPair); - } + if (cJSON_IsObject(dnai_nw_instance_list)) { + dnai_nw_instance_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(dnai_nw_instance_list_local_map, dnai_nw_instance_list) { + cJSON *localMapObject = dnai_nw_instance_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_dnn_upf_info_item_parseFromJSON() failed [inner]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + OpenAPI_list_add(dnai_nw_instance_listList, localMapKeyPair); + } + } } dnn_upf_info_item_local_var = OpenAPI_dnn_upf_info_item_create ( @@ -312,6 +327,41 @@ OpenAPI_dnn_upf_info_item_t *OpenAPI_dnn_upf_info_item_parseFromJSON(cJSON *dnn_ return dnn_upf_info_item_local_var; end: + if (dnai_listList) { + OpenAPI_list_for_each(dnai_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnai_listList); + dnai_listList = NULL; + } + if (pdu_session_typesList) { + OpenAPI_list_free(pdu_session_typesList); + pdu_session_typesList = NULL; + } + if (ipv4_address_rangesList) { + OpenAPI_list_for_each(ipv4_address_rangesList, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(ipv4_address_rangesList); + ipv4_address_rangesList = NULL; + } + if (ipv6_prefix_rangesList) { + OpenAPI_list_for_each(ipv6_prefix_rangesList, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(ipv6_prefix_rangesList); + ipv6_prefix_rangesList = NULL; + } + if (dnai_nw_instance_listList) { + OpenAPI_list_for_each(dnai_nw_instance_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(dnai_nw_instance_listList); + dnai_nw_instance_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/domain_name_protocol.c b/lib/sbi/openapi/model/domain_name_protocol.c index 7939b48f6..0f6d5beb8 100644 --- a/lib/sbi/openapi/model/domain_name_protocol.c +++ b/lib/sbi/openapi/model/domain_name_protocol.c @@ -16,16 +16,18 @@ OpenAPI_domain_name_protocol_t *OpenAPI_domain_name_protocol_create( void OpenAPI_domain_name_protocol_free(OpenAPI_domain_name_protocol_t *domain_name_protocol) { + OpenAPI_lnode_t *node = NULL; + if (NULL == domain_name_protocol) { return; } - OpenAPI_lnode_t *node; ogs_free(domain_name_protocol); } cJSON *OpenAPI_domain_name_protocol_convertToJSON(OpenAPI_domain_name_protocol_t *domain_name_protocol) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (domain_name_protocol == NULL) { ogs_error("OpenAPI_domain_name_protocol_convertToJSON() failed [DomainNameProtocol]"); @@ -40,6 +42,7 @@ end: OpenAPI_domain_name_protocol_t *OpenAPI_domain_name_protocol_parseFromJSON(cJSON *domain_name_protocolJSON) { OpenAPI_domain_name_protocol_t *domain_name_protocol_local_var = NULL; + OpenAPI_lnode_t *node = NULL; domain_name_protocol_local_var = OpenAPI_domain_name_protocol_create ( ); diff --git a/lib/sbi/openapi/model/downlink_data_notification_control.c b/lib/sbi/openapi/model/downlink_data_notification_control.c index 8c13a5147..d3a12f6da 100644 --- a/lib/sbi/openapi/model/downlink_data_notification_control.c +++ b/lib/sbi/openapi/model/downlink_data_notification_control.c @@ -20,18 +20,26 @@ OpenAPI_downlink_data_notification_control_t *OpenAPI_downlink_data_notification void OpenAPI_downlink_data_notification_control_free(OpenAPI_downlink_data_notification_control_t *downlink_data_notification_control) { + OpenAPI_lnode_t *node = NULL; + if (NULL == downlink_data_notification_control) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(downlink_data_notification_control->notif_ctrl_inds); - OpenAPI_list_free(downlink_data_notification_control->types_of_notif); + if (downlink_data_notification_control->notif_ctrl_inds) { + OpenAPI_list_free(downlink_data_notification_control->notif_ctrl_inds); + downlink_data_notification_control->notif_ctrl_inds = NULL; + } + if (downlink_data_notification_control->types_of_notif) { + OpenAPI_list_free(downlink_data_notification_control->types_of_notif); + downlink_data_notification_control->types_of_notif = NULL; + } ogs_free(downlink_data_notification_control); } cJSON *OpenAPI_downlink_data_notification_control_convertToJSON(OpenAPI_downlink_data_notification_control_t *downlink_data_notification_control) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (downlink_data_notification_control == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_convertToJSON() failed [DownlinkDataNotificationControl]"); @@ -39,30 +47,28 @@ cJSON *OpenAPI_downlink_data_notification_control_convertToJSON(OpenAPI_downlink } item = cJSON_CreateObject(); - if (downlink_data_notification_control->notif_ctrl_inds) { - cJSON *notif_ctrl_inds = cJSON_AddArrayToObject(item, "notifCtrlInds"); - if (notif_ctrl_inds == NULL) { + if (downlink_data_notification_control->notif_ctrl_inds != OpenAPI_notification_control_indication_NULL) { + cJSON *notif_ctrl_indsList = cJSON_AddArrayToObject(item, "notifCtrlInds"); + if (notif_ctrl_indsList == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_convertToJSON() failed [notif_ctrl_inds]"); goto end; } - OpenAPI_lnode_t *notif_ctrl_inds_node; - OpenAPI_list_for_each(downlink_data_notification_control->notif_ctrl_inds, notif_ctrl_inds_node) { - if (cJSON_AddStringToObject(notif_ctrl_inds, "", OpenAPI_notification_control_indication_ToString((intptr_t)notif_ctrl_inds_node->data)) == NULL) { + OpenAPI_list_for_each(downlink_data_notification_control->notif_ctrl_inds, node) { + if (cJSON_AddStringToObject(notif_ctrl_indsList, "", OpenAPI_notification_control_indication_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_convertToJSON() failed [notif_ctrl_inds]"); goto end; } } } - if (downlink_data_notification_control->types_of_notif) { - cJSON *types_of_notif = cJSON_AddArrayToObject(item, "typesOfNotif"); - if (types_of_notif == NULL) { + if (downlink_data_notification_control->types_of_notif != OpenAPI_dl_data_delivery_status_NULL) { + cJSON *types_of_notifList = cJSON_AddArrayToObject(item, "typesOfNotif"); + if (types_of_notifList == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_convertToJSON() failed [types_of_notif]"); goto end; } - OpenAPI_lnode_t *types_of_notif_node; - OpenAPI_list_for_each(downlink_data_notification_control->types_of_notif, types_of_notif_node) { - if (cJSON_AddStringToObject(types_of_notif, "", OpenAPI_dl_data_delivery_status_ToString((intptr_t)types_of_notif_node->data)) == NULL) { + OpenAPI_list_for_each(downlink_data_notification_control->types_of_notif, node) { + if (cJSON_AddStringToObject(types_of_notifList, "", OpenAPI_dl_data_delivery_status_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_convertToJSON() failed [types_of_notif]"); goto end; } @@ -76,48 +82,47 @@ end: OpenAPI_downlink_data_notification_control_t *OpenAPI_downlink_data_notification_control_parseFromJSON(cJSON *downlink_data_notification_controlJSON) { OpenAPI_downlink_data_notification_control_t *downlink_data_notification_control_local_var = NULL; - cJSON *notif_ctrl_inds = cJSON_GetObjectItemCaseSensitive(downlink_data_notification_controlJSON, "notifCtrlInds"); - - OpenAPI_list_t *notif_ctrl_indsList; + OpenAPI_lnode_t *node = NULL; + cJSON *notif_ctrl_inds = NULL; + OpenAPI_list_t *notif_ctrl_indsList = NULL; + cJSON *types_of_notif = NULL; + OpenAPI_list_t *types_of_notifList = NULL; + notif_ctrl_inds = cJSON_GetObjectItemCaseSensitive(downlink_data_notification_controlJSON, "notifCtrlInds"); if (notif_ctrl_inds) { - cJSON *notif_ctrl_inds_local_nonprimitive; - if (!cJSON_IsArray(notif_ctrl_inds)) { - ogs_error("OpenAPI_downlink_data_notification_control_parseFromJSON() failed [notif_ctrl_inds]"); - goto end; - } - - notif_ctrl_indsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(notif_ctrl_inds_local_nonprimitive, notif_ctrl_inds ) { - if (!cJSON_IsString(notif_ctrl_inds_local_nonprimitive)){ + cJSON *notif_ctrl_inds_local = NULL; + if (!cJSON_IsArray(notif_ctrl_inds)) { ogs_error("OpenAPI_downlink_data_notification_control_parseFromJSON() failed [notif_ctrl_inds]"); goto end; } - OpenAPI_list_add(notif_ctrl_indsList, (void *)OpenAPI_notification_control_indication_FromString(notif_ctrl_inds_local_nonprimitive->valuestring)); - } + notif_ctrl_indsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notif_ctrl_inds_local, notif_ctrl_inds) { + if (!cJSON_IsString(notif_ctrl_inds_local)) { + ogs_error("OpenAPI_downlink_data_notification_control_parseFromJSON() failed [notif_ctrl_inds]"); + goto end; + } + OpenAPI_list_add(notif_ctrl_indsList, (void *)OpenAPI_notification_control_indication_FromString(notif_ctrl_inds_local->valuestring)); + } } - cJSON *types_of_notif = cJSON_GetObjectItemCaseSensitive(downlink_data_notification_controlJSON, "typesOfNotif"); - - OpenAPI_list_t *types_of_notifList; + types_of_notif = cJSON_GetObjectItemCaseSensitive(downlink_data_notification_controlJSON, "typesOfNotif"); if (types_of_notif) { - cJSON *types_of_notif_local_nonprimitive; - if (!cJSON_IsArray(types_of_notif)) { - ogs_error("OpenAPI_downlink_data_notification_control_parseFromJSON() failed [types_of_notif]"); - goto end; - } - - types_of_notifList = OpenAPI_list_create(); - - cJSON_ArrayForEach(types_of_notif_local_nonprimitive, types_of_notif ) { - if (!cJSON_IsString(types_of_notif_local_nonprimitive)){ + cJSON *types_of_notif_local = NULL; + if (!cJSON_IsArray(types_of_notif)) { ogs_error("OpenAPI_downlink_data_notification_control_parseFromJSON() failed [types_of_notif]"); goto end; } - OpenAPI_list_add(types_of_notifList, (void *)OpenAPI_dl_data_delivery_status_FromString(types_of_notif_local_nonprimitive->valuestring)); - } + types_of_notifList = OpenAPI_list_create(); + + cJSON_ArrayForEach(types_of_notif_local, types_of_notif) { + if (!cJSON_IsString(types_of_notif_local)) { + ogs_error("OpenAPI_downlink_data_notification_control_parseFromJSON() failed [types_of_notif]"); + goto end; + } + OpenAPI_list_add(types_of_notifList, (void *)OpenAPI_dl_data_delivery_status_FromString(types_of_notif_local->valuestring)); + } } downlink_data_notification_control_local_var = OpenAPI_downlink_data_notification_control_create ( @@ -127,6 +132,14 @@ OpenAPI_downlink_data_notification_control_t *OpenAPI_downlink_data_notification return downlink_data_notification_control_local_var; end: + if (notif_ctrl_indsList) { + OpenAPI_list_free(notif_ctrl_indsList); + notif_ctrl_indsList = NULL; + } + if (types_of_notifList) { + OpenAPI_list_free(types_of_notifList); + types_of_notifList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/downlink_data_notification_control_rm.c b/lib/sbi/openapi/model/downlink_data_notification_control_rm.c index 1b2ee2100..d602c1007 100644 --- a/lib/sbi/openapi/model/downlink_data_notification_control_rm.c +++ b/lib/sbi/openapi/model/downlink_data_notification_control_rm.c @@ -20,18 +20,26 @@ OpenAPI_downlink_data_notification_control_rm_t *OpenAPI_downlink_data_notificat void OpenAPI_downlink_data_notification_control_rm_free(OpenAPI_downlink_data_notification_control_rm_t *downlink_data_notification_control_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == downlink_data_notification_control_rm) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(downlink_data_notification_control_rm->notif_ctrl_inds); - OpenAPI_list_free(downlink_data_notification_control_rm->types_of_notif); + if (downlink_data_notification_control_rm->notif_ctrl_inds) { + OpenAPI_list_free(downlink_data_notification_control_rm->notif_ctrl_inds); + downlink_data_notification_control_rm->notif_ctrl_inds = NULL; + } + if (downlink_data_notification_control_rm->types_of_notif) { + OpenAPI_list_free(downlink_data_notification_control_rm->types_of_notif); + downlink_data_notification_control_rm->types_of_notif = NULL; + } ogs_free(downlink_data_notification_control_rm); } cJSON *OpenAPI_downlink_data_notification_control_rm_convertToJSON(OpenAPI_downlink_data_notification_control_rm_t *downlink_data_notification_control_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (downlink_data_notification_control_rm == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_rm_convertToJSON() failed [DownlinkDataNotificationControlRm]"); @@ -39,30 +47,28 @@ cJSON *OpenAPI_downlink_data_notification_control_rm_convertToJSON(OpenAPI_downl } item = cJSON_CreateObject(); - if (downlink_data_notification_control_rm->notif_ctrl_inds) { - cJSON *notif_ctrl_inds = cJSON_AddArrayToObject(item, "notifCtrlInds"); - if (notif_ctrl_inds == NULL) { + if (downlink_data_notification_control_rm->notif_ctrl_inds != OpenAPI_notification_control_indication_NULL) { + cJSON *notif_ctrl_indsList = cJSON_AddArrayToObject(item, "notifCtrlInds"); + if (notif_ctrl_indsList == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_rm_convertToJSON() failed [notif_ctrl_inds]"); goto end; } - OpenAPI_lnode_t *notif_ctrl_inds_node; - OpenAPI_list_for_each(downlink_data_notification_control_rm->notif_ctrl_inds, notif_ctrl_inds_node) { - if (cJSON_AddStringToObject(notif_ctrl_inds, "", OpenAPI_notification_control_indication_ToString((intptr_t)notif_ctrl_inds_node->data)) == NULL) { + OpenAPI_list_for_each(downlink_data_notification_control_rm->notif_ctrl_inds, node) { + if (cJSON_AddStringToObject(notif_ctrl_indsList, "", OpenAPI_notification_control_indication_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_rm_convertToJSON() failed [notif_ctrl_inds]"); goto end; } } } - if (downlink_data_notification_control_rm->types_of_notif) { - cJSON *types_of_notif = cJSON_AddArrayToObject(item, "typesOfNotif"); - if (types_of_notif == NULL) { + if (downlink_data_notification_control_rm->types_of_notif != OpenAPI_dl_data_delivery_status_NULL) { + cJSON *types_of_notifList = cJSON_AddArrayToObject(item, "typesOfNotif"); + if (types_of_notifList == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_rm_convertToJSON() failed [types_of_notif]"); goto end; } - OpenAPI_lnode_t *types_of_notif_node; - OpenAPI_list_for_each(downlink_data_notification_control_rm->types_of_notif, types_of_notif_node) { - if (cJSON_AddStringToObject(types_of_notif, "", OpenAPI_dl_data_delivery_status_ToString((intptr_t)types_of_notif_node->data)) == NULL) { + OpenAPI_list_for_each(downlink_data_notification_control_rm->types_of_notif, node) { + if (cJSON_AddStringToObject(types_of_notifList, "", OpenAPI_dl_data_delivery_status_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_downlink_data_notification_control_rm_convertToJSON() failed [types_of_notif]"); goto end; } @@ -76,48 +82,47 @@ end: OpenAPI_downlink_data_notification_control_rm_t *OpenAPI_downlink_data_notification_control_rm_parseFromJSON(cJSON *downlink_data_notification_control_rmJSON) { OpenAPI_downlink_data_notification_control_rm_t *downlink_data_notification_control_rm_local_var = NULL; - cJSON *notif_ctrl_inds = cJSON_GetObjectItemCaseSensitive(downlink_data_notification_control_rmJSON, "notifCtrlInds"); - - OpenAPI_list_t *notif_ctrl_indsList; + OpenAPI_lnode_t *node = NULL; + cJSON *notif_ctrl_inds = NULL; + OpenAPI_list_t *notif_ctrl_indsList = NULL; + cJSON *types_of_notif = NULL; + OpenAPI_list_t *types_of_notifList = NULL; + notif_ctrl_inds = cJSON_GetObjectItemCaseSensitive(downlink_data_notification_control_rmJSON, "notifCtrlInds"); if (notif_ctrl_inds) { - cJSON *notif_ctrl_inds_local_nonprimitive; - if (!cJSON_IsArray(notif_ctrl_inds)) { - ogs_error("OpenAPI_downlink_data_notification_control_rm_parseFromJSON() failed [notif_ctrl_inds]"); - goto end; - } - - notif_ctrl_indsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(notif_ctrl_inds_local_nonprimitive, notif_ctrl_inds ) { - if (!cJSON_IsString(notif_ctrl_inds_local_nonprimitive)){ + cJSON *notif_ctrl_inds_local = NULL; + if (!cJSON_IsArray(notif_ctrl_inds)) { ogs_error("OpenAPI_downlink_data_notification_control_rm_parseFromJSON() failed [notif_ctrl_inds]"); goto end; } - OpenAPI_list_add(notif_ctrl_indsList, (void *)OpenAPI_notification_control_indication_FromString(notif_ctrl_inds_local_nonprimitive->valuestring)); - } + notif_ctrl_indsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notif_ctrl_inds_local, notif_ctrl_inds) { + if (!cJSON_IsString(notif_ctrl_inds_local)) { + ogs_error("OpenAPI_downlink_data_notification_control_rm_parseFromJSON() failed [notif_ctrl_inds]"); + goto end; + } + OpenAPI_list_add(notif_ctrl_indsList, (void *)OpenAPI_notification_control_indication_FromString(notif_ctrl_inds_local->valuestring)); + } } - cJSON *types_of_notif = cJSON_GetObjectItemCaseSensitive(downlink_data_notification_control_rmJSON, "typesOfNotif"); - - OpenAPI_list_t *types_of_notifList; + types_of_notif = cJSON_GetObjectItemCaseSensitive(downlink_data_notification_control_rmJSON, "typesOfNotif"); if (types_of_notif) { - cJSON *types_of_notif_local_nonprimitive; - if (!cJSON_IsArray(types_of_notif)) { - ogs_error("OpenAPI_downlink_data_notification_control_rm_parseFromJSON() failed [types_of_notif]"); - goto end; - } - - types_of_notifList = OpenAPI_list_create(); - - cJSON_ArrayForEach(types_of_notif_local_nonprimitive, types_of_notif ) { - if (!cJSON_IsString(types_of_notif_local_nonprimitive)){ + cJSON *types_of_notif_local = NULL; + if (!cJSON_IsArray(types_of_notif)) { ogs_error("OpenAPI_downlink_data_notification_control_rm_parseFromJSON() failed [types_of_notif]"); goto end; } - OpenAPI_list_add(types_of_notifList, (void *)OpenAPI_dl_data_delivery_status_FromString(types_of_notif_local_nonprimitive->valuestring)); - } + types_of_notifList = OpenAPI_list_create(); + + cJSON_ArrayForEach(types_of_notif_local, types_of_notif) { + if (!cJSON_IsString(types_of_notif_local)) { + ogs_error("OpenAPI_downlink_data_notification_control_rm_parseFromJSON() failed [types_of_notif]"); + goto end; + } + OpenAPI_list_add(types_of_notifList, (void *)OpenAPI_dl_data_delivery_status_FromString(types_of_notif_local->valuestring)); + } } downlink_data_notification_control_rm_local_var = OpenAPI_downlink_data_notification_control_rm_create ( @@ -127,6 +132,14 @@ OpenAPI_downlink_data_notification_control_rm_t *OpenAPI_downlink_data_notificat return downlink_data_notification_control_rm_local_var; end: + if (notif_ctrl_indsList) { + OpenAPI_list_free(notif_ctrl_indsList); + notif_ctrl_indsList = NULL; + } + if (types_of_notifList) { + OpenAPI_list_free(types_of_notifList); + types_of_notifList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/dynamic5_qi.c b/lib/sbi/openapi/model/dynamic5_qi.c index 864f189b6..b96fb9eab 100644 --- a/lib/sbi/openapi/model/dynamic5_qi.c +++ b/lib/sbi/openapi/model/dynamic5_qi.c @@ -48,17 +48,22 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_create( void OpenAPI_dynamic5_qi_free(OpenAPI_dynamic5_qi_t *dynamic5_qi) { + OpenAPI_lnode_t *node = NULL; + if (NULL == dynamic5_qi) { return; } - OpenAPI_lnode_t *node; - ogs_free(dynamic5_qi->packet_err_rate); + if (dynamic5_qi->packet_err_rate) { + ogs_free(dynamic5_qi->packet_err_rate); + dynamic5_qi->packet_err_rate = NULL; + } ogs_free(dynamic5_qi); } cJSON *OpenAPI_dynamic5_qi_convertToJSON(OpenAPI_dynamic5_qi_t *dynamic5_qi) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (dynamic5_qi == NULL) { ogs_error("OpenAPI_dynamic5_qi_convertToJSON() failed [Dynamic5Qi]"); @@ -66,6 +71,10 @@ cJSON *OpenAPI_dynamic5_qi_convertToJSON(OpenAPI_dynamic5_qi_t *dynamic5_qi) } item = cJSON_CreateObject(); + if (dynamic5_qi->resource_type == OpenAPI_qos_resource_type_NULL) { + ogs_error("OpenAPI_dynamic5_qi_convertToJSON() failed [resource_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resourceType", OpenAPI_qos_resource_type_ToString(dynamic5_qi->resource_type)) == NULL) { ogs_error("OpenAPI_dynamic5_qi_convertToJSON() failed [resource_type]"); goto end; @@ -81,6 +90,10 @@ cJSON *OpenAPI_dynamic5_qi_convertToJSON(OpenAPI_dynamic5_qi_t *dynamic5_qi) goto end; } + if (!dynamic5_qi->packet_err_rate) { + ogs_error("OpenAPI_dynamic5_qi_convertToJSON() failed [packet_err_rate]"); + return NULL; + } if (cJSON_AddStringToObject(item, "packetErrRate", dynamic5_qi->packet_err_rate) == NULL) { ogs_error("OpenAPI_dynamic5_qi_convertToJSON() failed [packet_err_rate]"); goto end; @@ -135,54 +148,60 @@ end: OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON) { OpenAPI_dynamic5_qi_t *dynamic5_qi_local_var = NULL; - cJSON *resource_type = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "resourceType"); + OpenAPI_lnode_t *node = NULL; + cJSON *resource_type = NULL; + OpenAPI_qos_resource_type_e resource_typeVariable = 0; + cJSON *priority_level = NULL; + cJSON *packet_delay_budget = NULL; + cJSON *packet_err_rate = NULL; + cJSON *aver_window = NULL; + cJSON *max_data_burst_vol = NULL; + cJSON *ext_max_data_burst_vol = NULL; + cJSON *ext_packet_del_budget = NULL; + cJSON *cn_packet_delay_budget_dl = NULL; + cJSON *cn_packet_delay_budget_ul = NULL; + resource_type = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "resourceType"); if (!resource_type) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [resource_type]"); goto end; } - - OpenAPI_qos_resource_type_e resource_typeVariable; if (!cJSON_IsString(resource_type)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [resource_type]"); goto end; } resource_typeVariable = OpenAPI_qos_resource_type_FromString(resource_type->valuestring); - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "priorityLevel"); + priority_level = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "priorityLevel"); if (!priority_level) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [priority_level]"); goto end; } - if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [priority_level]"); goto end; } - cJSON *packet_delay_budget = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "packetDelayBudget"); + packet_delay_budget = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "packetDelayBudget"); if (!packet_delay_budget) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [packet_delay_budget]"); goto end; } - if (!cJSON_IsNumber(packet_delay_budget)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [packet_delay_budget]"); goto end; } - cJSON *packet_err_rate = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "packetErrRate"); + packet_err_rate = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "packetErrRate"); if (!packet_err_rate) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [packet_err_rate]"); goto end; } - if (!cJSON_IsString(packet_err_rate)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [packet_err_rate]"); goto end; } - cJSON *aver_window = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "averWindow"); - + aver_window = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "averWindow"); if (aver_window) { if (!cJSON_IsNumber(aver_window)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [aver_window]"); @@ -190,8 +209,7 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON) } } - cJSON *max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "maxDataBurstVol"); - + max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "maxDataBurstVol"); if (max_data_burst_vol) { if (!cJSON_IsNumber(max_data_burst_vol)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [max_data_burst_vol]"); @@ -199,8 +217,7 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON) } } - cJSON *ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "extMaxDataBurstVol"); - + ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "extMaxDataBurstVol"); if (ext_max_data_burst_vol) { if (!cJSON_IsNumber(ext_max_data_burst_vol)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [ext_max_data_burst_vol]"); @@ -208,8 +225,7 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON) } } - cJSON *ext_packet_del_budget = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "extPacketDelBudget"); - + ext_packet_del_budget = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "extPacketDelBudget"); if (ext_packet_del_budget) { if (!cJSON_IsNumber(ext_packet_del_budget)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [ext_packet_del_budget]"); @@ -217,8 +233,7 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON) } } - cJSON *cn_packet_delay_budget_dl = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "cnPacketDelayBudgetDl"); - + cn_packet_delay_budget_dl = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "cnPacketDelayBudgetDl"); if (cn_packet_delay_budget_dl) { if (!cJSON_IsNumber(cn_packet_delay_budget_dl)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [cn_packet_delay_budget_dl]"); @@ -226,8 +241,7 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON) } } - cJSON *cn_packet_delay_budget_ul = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "cnPacketDelayBudgetUl"); - + cn_packet_delay_budget_ul = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "cnPacketDelayBudgetUl"); if (cn_packet_delay_budget_ul) { if (!cJSON_IsNumber(cn_packet_delay_budget_ul)) { ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [cn_packet_delay_budget_ul]"); diff --git a/lib/sbi/openapi/model/eap_auth_method_200_response.c b/lib/sbi/openapi/model/eap_auth_method_200_response.c new file mode 100644 index 000000000..3261dc74d --- /dev/null +++ b/lib/sbi/openapi/model/eap_auth_method_200_response.c @@ -0,0 +1,191 @@ + +#include +#include +#include +#include "eap_auth_method_200_response.h" + +OpenAPI_eap_auth_method_200_response_t *OpenAPI_eap_auth_method_200_response_create( + char *eap_payload, + OpenAPI_list_t* _links +) +{ + OpenAPI_eap_auth_method_200_response_t *eap_auth_method_200_response_local_var = ogs_malloc(sizeof(OpenAPI_eap_auth_method_200_response_t)); + ogs_assert(eap_auth_method_200_response_local_var); + + eap_auth_method_200_response_local_var->eap_payload = eap_payload; + eap_auth_method_200_response_local_var->_links = _links; + + return eap_auth_method_200_response_local_var; +} + +void OpenAPI_eap_auth_method_200_response_free(OpenAPI_eap_auth_method_200_response_t *eap_auth_method_200_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == eap_auth_method_200_response) { + return; + } + if (eap_auth_method_200_response->eap_payload) { + ogs_free(eap_auth_method_200_response->eap_payload); + eap_auth_method_200_response->eap_payload = NULL; + } + if (eap_auth_method_200_response->_links) { + OpenAPI_list_for_each(eap_auth_method_200_response->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_links_value_schema_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(eap_auth_method_200_response->_links); + eap_auth_method_200_response->_links = NULL; + } + ogs_free(eap_auth_method_200_response); +} + +cJSON *OpenAPI_eap_auth_method_200_response_convertToJSON(OpenAPI_eap_auth_method_200_response_t *eap_auth_method_200_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (eap_auth_method_200_response == NULL) { + ogs_error("OpenAPI_eap_auth_method_200_response_convertToJSON() failed [EapAuthMethod_200_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!eap_auth_method_200_response->eap_payload) { + ogs_error("OpenAPI_eap_auth_method_200_response_convertToJSON() failed [eap_payload]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "eapPayload", eap_auth_method_200_response->eap_payload) == NULL) { + ogs_error("OpenAPI_eap_auth_method_200_response_convertToJSON() failed [eap_payload]"); + goto end; + } + + if (!eap_auth_method_200_response->_links) { + ogs_error("OpenAPI_eap_auth_method_200_response_convertToJSON() failed [_links]"); + return NULL; + } + cJSON *_links = cJSON_AddObjectToObject(item, "_links"); + if (_links == NULL) { + ogs_error("OpenAPI_eap_auth_method_200_response_convertToJSON() failed [_links]"); + goto end; + } + cJSON *localMapObject = _links; + if (eap_auth_method_200_response->_links) { + OpenAPI_list_for_each(eap_auth_method_200_response->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_links_value_schema_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_eap_auth_method_200_response_convertToJSON() failed [inner]"); + goto end; + } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + } + } + +end: + return item; +} + +OpenAPI_eap_auth_method_200_response_t *OpenAPI_eap_auth_method_200_response_parseFromJSON(cJSON *eap_auth_method_200_responseJSON) +{ + OpenAPI_eap_auth_method_200_response_t *eap_auth_method_200_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *eap_payload = NULL; + cJSON *_links = NULL; + OpenAPI_list_t *_linksList = NULL; + eap_payload = cJSON_GetObjectItemCaseSensitive(eap_auth_method_200_responseJSON, "eapPayload"); + if (!eap_payload) { + ogs_error("OpenAPI_eap_auth_method_200_response_parseFromJSON() failed [eap_payload]"); + goto end; + } + if (!cJSON_IsString(eap_payload)) { + ogs_error("OpenAPI_eap_auth_method_200_response_parseFromJSON() failed [eap_payload]"); + goto end; + } + + _links = cJSON_GetObjectItemCaseSensitive(eap_auth_method_200_responseJSON, "_links"); + if (!_links) { + ogs_error("OpenAPI_eap_auth_method_200_response_parseFromJSON() failed [_links]"); + goto end; + } + cJSON *_links_local_map = NULL; + if (!cJSON_IsObject(_links) && !cJSON_IsNull(_links)) { + ogs_error("OpenAPI_eap_auth_method_200_response_parseFromJSON() failed [_links]"); + goto end; + } + if (cJSON_IsObject(_links)) { + _linksList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(_links_local_map, _links) { + cJSON *localMapObject = _links_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_links_value_schema_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_eap_auth_method_200_response_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(_linksList, localMapKeyPair); + } + } + + eap_auth_method_200_response_local_var = OpenAPI_eap_auth_method_200_response_create ( + ogs_strdup(eap_payload->valuestring), + _linksList + ); + + return eap_auth_method_200_response_local_var; +end: + if (_linksList) { + OpenAPI_list_for_each(_linksList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_links_value_schema_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(_linksList); + _linksList = NULL; + } + return NULL; +} + +OpenAPI_eap_auth_method_200_response_t *OpenAPI_eap_auth_method_200_response_copy(OpenAPI_eap_auth_method_200_response_t *dst, OpenAPI_eap_auth_method_200_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_eap_auth_method_200_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_eap_auth_method_200_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_eap_auth_method_200_response_free(dst); + dst = OpenAPI_eap_auth_method_200_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/eap_auth_method_200_response.h b/lib/sbi/openapi/model/eap_auth_method_200_response.h new file mode 100644 index 000000000..061e195eb --- /dev/null +++ b/lib/sbi/openapi/model/eap_auth_method_200_response.h @@ -0,0 +1,41 @@ +/* + * eap_auth_method_200_response.h + * + * + */ + +#ifndef _OpenAPI_eap_auth_method_200_response_H_ +#define _OpenAPI_eap_auth_method_200_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "links_value_schema.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_eap_auth_method_200_response_s OpenAPI_eap_auth_method_200_response_t; +typedef struct OpenAPI_eap_auth_method_200_response_s { + char *eap_payload; + OpenAPI_list_t* _links; +} OpenAPI_eap_auth_method_200_response_t; + +OpenAPI_eap_auth_method_200_response_t *OpenAPI_eap_auth_method_200_response_create( + char *eap_payload, + OpenAPI_list_t* _links +); +void OpenAPI_eap_auth_method_200_response_free(OpenAPI_eap_auth_method_200_response_t *eap_auth_method_200_response); +OpenAPI_eap_auth_method_200_response_t *OpenAPI_eap_auth_method_200_response_parseFromJSON(cJSON *eap_auth_method_200_responseJSON); +cJSON *OpenAPI_eap_auth_method_200_response_convertToJSON(OpenAPI_eap_auth_method_200_response_t *eap_auth_method_200_response); +OpenAPI_eap_auth_method_200_response_t *OpenAPI_eap_auth_method_200_response_copy(OpenAPI_eap_auth_method_200_response_t *dst, OpenAPI_eap_auth_method_200_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_eap_auth_method_200_response_H_ */ + diff --git a/lib/sbi/openapi/model/eap_session.c b/lib/sbi/openapi/model/eap_session.c index c22702dfc..474108195 100644 --- a/lib/sbi/openapi/model/eap_session.c +++ b/lib/sbi/openapi/model/eap_session.c @@ -28,27 +28,44 @@ OpenAPI_eap_session_t *OpenAPI_eap_session_create( void OpenAPI_eap_session_free(OpenAPI_eap_session_t *eap_session) { + OpenAPI_lnode_t *node = NULL; + if (NULL == eap_session) { return; } - OpenAPI_lnode_t *node; - ogs_free(eap_session->eap_payload); - ogs_free(eap_session->k_seaf); - OpenAPI_list_for_each(eap_session->_links, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_links_value_schema_free(localKeyValue->value); - ogs_free(localKeyValue); + if (eap_session->eap_payload) { + ogs_free(eap_session->eap_payload); + eap_session->eap_payload = NULL; + } + if (eap_session->k_seaf) { + ogs_free(eap_session->k_seaf); + eap_session->k_seaf = NULL; + } + if (eap_session->_links) { + OpenAPI_list_for_each(eap_session->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_links_value_schema_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(eap_session->_links); + eap_session->_links = NULL; + } + if (eap_session->supi) { + ogs_free(eap_session->supi); + eap_session->supi = NULL; + } + if (eap_session->supported_features) { + ogs_free(eap_session->supported_features); + eap_session->supported_features = NULL; } - OpenAPI_list_free(eap_session->_links); - ogs_free(eap_session->supi); - ogs_free(eap_session->supported_features); ogs_free(eap_session); } cJSON *OpenAPI_eap_session_convertToJSON(OpenAPI_eap_session_t *eap_session) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (eap_session == NULL) { ogs_error("OpenAPI_eap_session_convertToJSON() failed [EapSession]"); @@ -56,6 +73,10 @@ cJSON *OpenAPI_eap_session_convertToJSON(OpenAPI_eap_session_t *eap_session) } item = cJSON_CreateObject(); + if (!eap_session->eap_payload) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [eap_payload]"); + return NULL; + } if (cJSON_AddStringToObject(item, "eapPayload", eap_session->eap_payload) == NULL) { ogs_error("OpenAPI_eap_session_convertToJSON() failed [eap_payload]"); goto end; @@ -75,23 +96,22 @@ cJSON *OpenAPI_eap_session_convertToJSON(OpenAPI_eap_session_t *eap_session) goto end; } cJSON *localMapObject = _links; - OpenAPI_lnode_t *_links_node; if (eap_session->_links) { - OpenAPI_list_for_each(eap_session->_links, _links_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)_links_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_links_value_schema_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_eap_session_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(eap_session->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_links_value_schema_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_eap_session_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } - if (eap_session->auth_result) { + if (eap_session->auth_result != OpenAPI_auth_result_NULL) { if (cJSON_AddStringToObject(item, "authResult", OpenAPI_auth_result_ToString(eap_session->auth_result)) == NULL) { ogs_error("OpenAPI_eap_session_convertToJSON() failed [auth_result]"); goto end; @@ -119,55 +139,60 @@ end: OpenAPI_eap_session_t *OpenAPI_eap_session_parseFromJSON(cJSON *eap_sessionJSON) { OpenAPI_eap_session_t *eap_session_local_var = NULL; - cJSON *eap_payload = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "eapPayload"); + OpenAPI_lnode_t *node = NULL; + cJSON *eap_payload = NULL; + cJSON *k_seaf = NULL; + cJSON *_links = NULL; + OpenAPI_list_t *_linksList = NULL; + cJSON *auth_result = NULL; + OpenAPI_auth_result_e auth_resultVariable = 0; + cJSON *supi = NULL; + cJSON *supported_features = NULL; + eap_payload = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "eapPayload"); if (!eap_payload) { ogs_error("OpenAPI_eap_session_parseFromJSON() failed [eap_payload]"); goto end; } - if (!cJSON_IsString(eap_payload)) { ogs_error("OpenAPI_eap_session_parseFromJSON() failed [eap_payload]"); goto end; } - cJSON *k_seaf = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "kSeaf"); - + k_seaf = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "kSeaf"); if (k_seaf) { - if (!cJSON_IsString(k_seaf)) { + if (!cJSON_IsString(k_seaf) && !cJSON_IsNull(k_seaf)) { ogs_error("OpenAPI_eap_session_parseFromJSON() failed [k_seaf]"); goto end; } } - cJSON *_links = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "_links"); - - OpenAPI_list_t *_linksList; + _links = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "_links"); if (_links) { - cJSON *_links_local_map; - if (!cJSON_IsObject(_links)) { - ogs_error("OpenAPI_eap_session_parseFromJSON() failed [_links]"); - goto end; - } - _linksList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(_links_local_map, _links) { - cJSON *localMapObject = _links_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_links_value_schema_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_eap_session_parseFromJSON() failed [inner]"); + cJSON *_links_local_map = NULL; + if (!cJSON_IsObject(_links) && !cJSON_IsNull(_links)) { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [_links]"); goto end; } - OpenAPI_list_add(_linksList, localMapKeyPair); - } + if (cJSON_IsObject(_links)) { + _linksList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(_links_local_map, _links) { + cJSON *localMapObject = _links_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_links_value_schema_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_eap_session_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(_linksList, localMapKeyPair); + } + } } - cJSON *auth_result = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "authResult"); - - OpenAPI_auth_result_e auth_resultVariable; + auth_result = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "authResult"); if (auth_result) { if (!cJSON_IsString(auth_result)) { ogs_error("OpenAPI_eap_session_parseFromJSON() failed [auth_result]"); @@ -176,19 +201,17 @@ OpenAPI_eap_session_t *OpenAPI_eap_session_parseFromJSON(cJSON *eap_sessionJSON) auth_resultVariable = OpenAPI_auth_result_FromString(auth_result->valuestring); } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_eap_session_parseFromJSON() failed [supi]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(eap_sessionJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_eap_session_parseFromJSON() failed [supported_features]"); goto end; } @@ -196,15 +219,25 @@ OpenAPI_eap_session_t *OpenAPI_eap_session_parseFromJSON(cJSON *eap_sessionJSON) eap_session_local_var = OpenAPI_eap_session_create ( ogs_strdup(eap_payload->valuestring), - k_seaf ? ogs_strdup(k_seaf->valuestring) : NULL, + k_seaf && !cJSON_IsNull(k_seaf) ? ogs_strdup(k_seaf->valuestring) : NULL, _links ? _linksList : NULL, auth_result ? auth_resultVariable : 0, - supi ? ogs_strdup(supi->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return eap_session_local_var; end: + if (_linksList) { + OpenAPI_list_for_each(_linksList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_links_value_schema_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(_linksList); + _linksList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ebi_arp_mapping.c b/lib/sbi/openapi/model/ebi_arp_mapping.c index 97dc7dc28..8104641d3 100644 --- a/lib/sbi/openapi/model/ebi_arp_mapping.c +++ b/lib/sbi/openapi/model/ebi_arp_mapping.c @@ -20,17 +20,22 @@ OpenAPI_ebi_arp_mapping_t *OpenAPI_ebi_arp_mapping_create( void OpenAPI_ebi_arp_mapping_free(OpenAPI_ebi_arp_mapping_t *ebi_arp_mapping) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ebi_arp_mapping) { return; } - OpenAPI_lnode_t *node; - OpenAPI_arp_free(ebi_arp_mapping->arp); + if (ebi_arp_mapping->arp) { + OpenAPI_arp_free(ebi_arp_mapping->arp); + ebi_arp_mapping->arp = NULL; + } ogs_free(ebi_arp_mapping); } cJSON *OpenAPI_ebi_arp_mapping_convertToJSON(OpenAPI_ebi_arp_mapping_t *ebi_arp_mapping) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ebi_arp_mapping == NULL) { ogs_error("OpenAPI_ebi_arp_mapping_convertToJSON() failed [EbiArpMapping]"); @@ -43,6 +48,10 @@ cJSON *OpenAPI_ebi_arp_mapping_convertToJSON(OpenAPI_ebi_arp_mapping_t *ebi_arp_ goto end; } + if (!ebi_arp_mapping->arp) { + ogs_error("OpenAPI_ebi_arp_mapping_convertToJSON() failed [arp]"); + return NULL; + } cJSON *arp_local_JSON = OpenAPI_arp_convertToJSON(ebi_arp_mapping->arp); if (arp_local_JSON == NULL) { ogs_error("OpenAPI_ebi_arp_mapping_convertToJSON() failed [arp]"); @@ -61,24 +70,25 @@ end: OpenAPI_ebi_arp_mapping_t *OpenAPI_ebi_arp_mapping_parseFromJSON(cJSON *ebi_arp_mappingJSON) { OpenAPI_ebi_arp_mapping_t *ebi_arp_mapping_local_var = NULL; - cJSON *eps_bearer_id = cJSON_GetObjectItemCaseSensitive(ebi_arp_mappingJSON, "epsBearerId"); + OpenAPI_lnode_t *node = NULL; + cJSON *eps_bearer_id = NULL; + cJSON *arp = NULL; + OpenAPI_arp_t *arp_local_nonprim = NULL; + eps_bearer_id = cJSON_GetObjectItemCaseSensitive(ebi_arp_mappingJSON, "epsBearerId"); if (!eps_bearer_id) { ogs_error("OpenAPI_ebi_arp_mapping_parseFromJSON() failed [eps_bearer_id]"); goto end; } - if (!cJSON_IsNumber(eps_bearer_id)) { ogs_error("OpenAPI_ebi_arp_mapping_parseFromJSON() failed [eps_bearer_id]"); goto end; } - cJSON *arp = cJSON_GetObjectItemCaseSensitive(ebi_arp_mappingJSON, "arp"); + arp = cJSON_GetObjectItemCaseSensitive(ebi_arp_mappingJSON, "arp"); if (!arp) { ogs_error("OpenAPI_ebi_arp_mapping_parseFromJSON() failed [arp]"); goto end; } - - OpenAPI_arp_t *arp_local_nonprim = NULL; arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp); ebi_arp_mapping_local_var = OpenAPI_ebi_arp_mapping_create ( @@ -89,6 +99,10 @@ OpenAPI_ebi_arp_mapping_t *OpenAPI_ebi_arp_mapping_parseFromJSON(cJSON *ebi_arp_ return ebi_arp_mapping_local_var; end: + if (arp_local_nonprim) { + OpenAPI_arp_free(arp_local_nonprim); + arp_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ec_restriction.c b/lib/sbi/openapi/model/ec_restriction.c index 47dec20dd..1f18cbae7 100644 --- a/lib/sbi/openapi/model/ec_restriction.c +++ b/lib/sbi/openapi/model/ec_restriction.c @@ -24,22 +24,33 @@ OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_create( void OpenAPI_ec_restriction_free(OpenAPI_ec_restriction_t *ec_restriction) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ec_restriction) { return; } - OpenAPI_lnode_t *node; - ogs_free(ec_restriction->af_instance_id); - OpenAPI_list_for_each(ec_restriction->plmn_ec_infos, node) { - OpenAPI_plmn_ec_info_free(node->data); + if (ec_restriction->af_instance_id) { + ogs_free(ec_restriction->af_instance_id); + ec_restriction->af_instance_id = NULL; + } + if (ec_restriction->plmn_ec_infos) { + OpenAPI_list_for_each(ec_restriction->plmn_ec_infos, node) { + OpenAPI_plmn_ec_info_free(node->data); + } + OpenAPI_list_free(ec_restriction->plmn_ec_infos); + ec_restriction->plmn_ec_infos = NULL; + } + if (ec_restriction->mtc_provider_information) { + ogs_free(ec_restriction->mtc_provider_information); + ec_restriction->mtc_provider_information = NULL; } - OpenAPI_list_free(ec_restriction->plmn_ec_infos); - ogs_free(ec_restriction->mtc_provider_information); ogs_free(ec_restriction); } cJSON *OpenAPI_ec_restriction_convertToJSON(OpenAPI_ec_restriction_t *ec_restriction) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ec_restriction == NULL) { ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [EcRestriction]"); @@ -47,6 +58,10 @@ cJSON *OpenAPI_ec_restriction_convertToJSON(OpenAPI_ec_restriction_t *ec_restric } item = cJSON_CreateObject(); + if (!ec_restriction->af_instance_id) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [af_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afInstanceId", ec_restriction->af_instance_id) == NULL) { ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [af_instance_id]"); goto end; @@ -63,17 +78,13 @@ cJSON *OpenAPI_ec_restriction_convertToJSON(OpenAPI_ec_restriction_t *ec_restric ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [plmn_ec_infos]"); goto end; } - - OpenAPI_lnode_t *plmn_ec_infos_node; - if (ec_restriction->plmn_ec_infos) { - OpenAPI_list_for_each(ec_restriction->plmn_ec_infos, plmn_ec_infos_node) { - cJSON *itemLocal = OpenAPI_plmn_ec_info_convertToJSON(plmn_ec_infos_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [plmn_ec_infos]"); - goto end; - } - cJSON_AddItemToArray(plmn_ec_infosList, itemLocal); + OpenAPI_list_for_each(ec_restriction->plmn_ec_infos, node) { + cJSON *itemLocal = OpenAPI_plmn_ec_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [plmn_ec_infos]"); + goto end; } + cJSON_AddItemToArray(plmn_ec_infosList, itemLocal); } } @@ -91,61 +102,60 @@ end: OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_parseFromJSON(cJSON *ec_restrictionJSON) { OpenAPI_ec_restriction_t *ec_restriction_local_var = NULL; - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "afInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *af_instance_id = NULL; + cJSON *reference_id = NULL; + cJSON *plmn_ec_infos = NULL; + OpenAPI_list_t *plmn_ec_infosList = NULL; + cJSON *mtc_provider_information = NULL; + af_instance_id = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "afInstanceId"); if (!af_instance_id) { ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [af_instance_id]"); goto end; } - if (!cJSON_IsString(af_instance_id)) { ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [af_instance_id]"); goto end; } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "referenceId"); + reference_id = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "referenceId"); if (!reference_id) { ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [reference_id]"); goto end; } - if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [reference_id]"); goto end; } - cJSON *plmn_ec_infos = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "plmnEcInfos"); - - OpenAPI_list_t *plmn_ec_infosList; + plmn_ec_infos = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "plmnEcInfos"); if (plmn_ec_infos) { - cJSON *plmn_ec_infos_local_nonprimitive; - if (!cJSON_IsArray(plmn_ec_infos)){ - ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [plmn_ec_infos]"); - goto end; - } - - plmn_ec_infosList = OpenAPI_list_create(); - - cJSON_ArrayForEach(plmn_ec_infos_local_nonprimitive, plmn_ec_infos ) { - if (!cJSON_IsObject(plmn_ec_infos_local_nonprimitive)) { + cJSON *plmn_ec_infos_local = NULL; + if (!cJSON_IsArray(plmn_ec_infos)) { ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [plmn_ec_infos]"); goto end; } - OpenAPI_plmn_ec_info_t *plmn_ec_infosItem = OpenAPI_plmn_ec_info_parseFromJSON(plmn_ec_infos_local_nonprimitive); - if (!plmn_ec_infosItem) { - ogs_error("No plmn_ec_infosItem"); - OpenAPI_list_free(plmn_ec_infosList); - goto end; + plmn_ec_infosList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_ec_infos_local, plmn_ec_infos) { + if (!cJSON_IsObject(plmn_ec_infos_local)) { + ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [plmn_ec_infos]"); + goto end; + } + OpenAPI_plmn_ec_info_t *plmn_ec_infosItem = OpenAPI_plmn_ec_info_parseFromJSON(plmn_ec_infos_local); + if (!plmn_ec_infosItem) { + ogs_error("No plmn_ec_infosItem"); + OpenAPI_list_free(plmn_ec_infosList); + goto end; + } + OpenAPI_list_add(plmn_ec_infosList, plmn_ec_infosItem); } - - OpenAPI_list_add(plmn_ec_infosList, plmn_ec_infosItem); - } } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [mtc_provider_information]"); goto end; } @@ -156,11 +166,18 @@ OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_parseFromJSON(cJSON *ec_restric reference_id->valuedouble, plmn_ec_infos ? plmn_ec_infosList : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return ec_restriction_local_var; end: + if (plmn_ec_infosList) { + OpenAPI_list_for_each(plmn_ec_infosList, node) { + OpenAPI_plmn_ec_info_free(node->data); + } + OpenAPI_list_free(plmn_ec_infosList); + plmn_ec_infosList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ec_restriction_data_wb.c b/lib/sbi/openapi/model/ec_restriction_data_wb.c index 9df321426..30633c7d6 100644 --- a/lib/sbi/openapi/model/ec_restriction_data_wb.c +++ b/lib/sbi/openapi/model/ec_restriction_data_wb.c @@ -22,16 +22,18 @@ OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_create( void OpenAPI_ec_restriction_data_wb_free(OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ec_restriction_data_wb) { return; } - OpenAPI_lnode_t *node; ogs_free(ec_restriction_data_wb); } cJSON *OpenAPI_ec_restriction_data_wb_convertToJSON(OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ec_restriction_data_wb == NULL) { ogs_error("OpenAPI_ec_restriction_data_wb_convertToJSON() failed [EcRestrictionDataWb]"); @@ -58,8 +60,10 @@ end: OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_parseFromJSON(cJSON *ec_restriction_data_wbJSON) { OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_var = NULL; - cJSON *ec_mode_a_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_data_wbJSON, "ecModeARestricted"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ec_mode_a_restricted = NULL; + cJSON *ec_mode_b_restricted = NULL; + ec_mode_a_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_data_wbJSON, "ecModeARestricted"); if (ec_mode_a_restricted) { if (!cJSON_IsBool(ec_mode_a_restricted)) { ogs_error("OpenAPI_ec_restriction_data_wb_parseFromJSON() failed [ec_mode_a_restricted]"); @@ -67,12 +71,11 @@ OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_parseFromJSON(c } } - cJSON *ec_mode_b_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_data_wbJSON, "ecModeBRestricted"); + ec_mode_b_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_data_wbJSON, "ecModeBRestricted"); if (!ec_mode_b_restricted) { ogs_error("OpenAPI_ec_restriction_data_wb_parseFromJSON() failed [ec_mode_b_restricted]"); goto end; } - if (!cJSON_IsBool(ec_mode_b_restricted)) { ogs_error("OpenAPI_ec_restriction_data_wb_parseFromJSON() failed [ec_mode_b_restricted]"); goto end; diff --git a/lib/sbi/openapi/model/ecgi.c b/lib/sbi/openapi/model/ecgi.c index 7bfd3294d..c00651c1b 100644 --- a/lib/sbi/openapi/model/ecgi.c +++ b/lib/sbi/openapi/model/ecgi.c @@ -22,19 +22,30 @@ OpenAPI_ecgi_t *OpenAPI_ecgi_create( void OpenAPI_ecgi_free(OpenAPI_ecgi_t *ecgi) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ecgi) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(ecgi->plmn_id); - ogs_free(ecgi->eutra_cell_id); - ogs_free(ecgi->nid); + if (ecgi->plmn_id) { + OpenAPI_plmn_id_free(ecgi->plmn_id); + ecgi->plmn_id = NULL; + } + if (ecgi->eutra_cell_id) { + ogs_free(ecgi->eutra_cell_id); + ecgi->eutra_cell_id = NULL; + } + if (ecgi->nid) { + ogs_free(ecgi->nid); + ecgi->nid = NULL; + } ogs_free(ecgi); } cJSON *OpenAPI_ecgi_convertToJSON(OpenAPI_ecgi_t *ecgi) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ecgi == NULL) { ogs_error("OpenAPI_ecgi_convertToJSON() failed [Ecgi]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_ecgi_convertToJSON(OpenAPI_ecgi_t *ecgi) } item = cJSON_CreateObject(); + if (!ecgi->plmn_id) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(ecgi->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_ecgi_convertToJSON() failed [plmn_id]"); @@ -53,6 +68,10 @@ cJSON *OpenAPI_ecgi_convertToJSON(OpenAPI_ecgi_t *ecgi) goto end; } + if (!ecgi->eutra_cell_id) { + ogs_error("OpenAPI_ecgi_convertToJSON() failed [eutra_cell_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "eutraCellId", ecgi->eutra_cell_id) == NULL) { ogs_error("OpenAPI_ecgi_convertToJSON() failed [eutra_cell_id]"); goto end; @@ -72,30 +91,31 @@ end: OpenAPI_ecgi_t *OpenAPI_ecgi_parseFromJSON(cJSON *ecgiJSON) { OpenAPI_ecgi_t *ecgi_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *eutra_cell_id = NULL; + cJSON *nid = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_ecgi_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *eutra_cell_id = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "eutraCellId"); + eutra_cell_id = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "eutraCellId"); if (!eutra_cell_id) { ogs_error("OpenAPI_ecgi_parseFromJSON() failed [eutra_cell_id]"); goto end; } - if (!cJSON_IsString(eutra_cell_id)) { ogs_error("OpenAPI_ecgi_parseFromJSON() failed [eutra_cell_id]"); goto end; } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(ecgiJSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_ecgi_parseFromJSON() failed [nid]"); goto end; } @@ -104,11 +124,15 @@ OpenAPI_ecgi_t *OpenAPI_ecgi_parseFromJSON(cJSON *ecgiJSON) ecgi_local_var = OpenAPI_ecgi_create ( plmn_id_local_nonprim, ogs_strdup(eutra_cell_id->valuestring), - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return ecgi_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ecgi_1.c b/lib/sbi/openapi/model/ecgi_1.c index ec5420123..041524b90 100644 --- a/lib/sbi/openapi/model/ecgi_1.c +++ b/lib/sbi/openapi/model/ecgi_1.c @@ -22,19 +22,30 @@ OpenAPI_ecgi_1_t *OpenAPI_ecgi_1_create( void OpenAPI_ecgi_1_free(OpenAPI_ecgi_1_t *ecgi_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ecgi_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_1_free(ecgi_1->plmn_id); - ogs_free(ecgi_1->eutra_cell_id); - ogs_free(ecgi_1->nid); + if (ecgi_1->plmn_id) { + OpenAPI_plmn_id_1_free(ecgi_1->plmn_id); + ecgi_1->plmn_id = NULL; + } + if (ecgi_1->eutra_cell_id) { + ogs_free(ecgi_1->eutra_cell_id); + ecgi_1->eutra_cell_id = NULL; + } + if (ecgi_1->nid) { + ogs_free(ecgi_1->nid); + ecgi_1->nid = NULL; + } ogs_free(ecgi_1); } cJSON *OpenAPI_ecgi_1_convertToJSON(OpenAPI_ecgi_1_t *ecgi_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ecgi_1 == NULL) { ogs_error("OpenAPI_ecgi_1_convertToJSON() failed [Ecgi_1]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_ecgi_1_convertToJSON(OpenAPI_ecgi_1_t *ecgi_1) } item = cJSON_CreateObject(); + if (!ecgi_1->plmn_id) { + ogs_error("OpenAPI_ecgi_1_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_1_convertToJSON(ecgi_1->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_ecgi_1_convertToJSON() failed [plmn_id]"); @@ -53,6 +68,10 @@ cJSON *OpenAPI_ecgi_1_convertToJSON(OpenAPI_ecgi_1_t *ecgi_1) goto end; } + if (!ecgi_1->eutra_cell_id) { + ogs_error("OpenAPI_ecgi_1_convertToJSON() failed [eutra_cell_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "eutraCellId", ecgi_1->eutra_cell_id) == NULL) { ogs_error("OpenAPI_ecgi_1_convertToJSON() failed [eutra_cell_id]"); goto end; @@ -72,30 +91,31 @@ end: OpenAPI_ecgi_1_t *OpenAPI_ecgi_1_parseFromJSON(cJSON *ecgi_1JSON) { OpenAPI_ecgi_1_t *ecgi_1_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(ecgi_1JSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + cJSON *eutra_cell_id = NULL; + cJSON *nid = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(ecgi_1JSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_ecgi_1_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); - cJSON *eutra_cell_id = cJSON_GetObjectItemCaseSensitive(ecgi_1JSON, "eutraCellId"); + eutra_cell_id = cJSON_GetObjectItemCaseSensitive(ecgi_1JSON, "eutraCellId"); if (!eutra_cell_id) { ogs_error("OpenAPI_ecgi_1_parseFromJSON() failed [eutra_cell_id]"); goto end; } - if (!cJSON_IsString(eutra_cell_id)) { ogs_error("OpenAPI_ecgi_1_parseFromJSON() failed [eutra_cell_id]"); goto end; } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(ecgi_1JSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(ecgi_1JSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_ecgi_1_parseFromJSON() failed [nid]"); goto end; } @@ -104,11 +124,15 @@ OpenAPI_ecgi_1_t *OpenAPI_ecgi_1_parseFromJSON(cJSON *ecgi_1JSON) ecgi_1_local_var = OpenAPI_ecgi_1_create ( plmn_id_local_nonprim, ogs_strdup(eutra_cell_id->valuestring), - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return ecgi_1_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/edrx_parameters.c b/lib/sbi/openapi/model/edrx_parameters.c index 9a3ad5a0e..07fc606b9 100644 --- a/lib/sbi/openapi/model/edrx_parameters.c +++ b/lib/sbi/openapi/model/edrx_parameters.c @@ -20,17 +20,22 @@ OpenAPI_edrx_parameters_t *OpenAPI_edrx_parameters_create( void OpenAPI_edrx_parameters_free(OpenAPI_edrx_parameters_t *edrx_parameters) { + OpenAPI_lnode_t *node = NULL; + if (NULL == edrx_parameters) { return; } - OpenAPI_lnode_t *node; - ogs_free(edrx_parameters->edrx_value); + if (edrx_parameters->edrx_value) { + ogs_free(edrx_parameters->edrx_value); + edrx_parameters->edrx_value = NULL; + } ogs_free(edrx_parameters); } cJSON *OpenAPI_edrx_parameters_convertToJSON(OpenAPI_edrx_parameters_t *edrx_parameters) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (edrx_parameters == NULL) { ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [EdrxParameters]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_edrx_parameters_convertToJSON(OpenAPI_edrx_parameters_t *edrx_par } item = cJSON_CreateObject(); + if (edrx_parameters->rat_type == OpenAPI_rat_type_NULL) { + ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [rat_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(edrx_parameters->rat_type)) == NULL) { ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [rat_type]"); goto end; } + if (!edrx_parameters->edrx_value) { + ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [edrx_value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "edrxValue", edrx_parameters->edrx_value) == NULL) { ogs_error("OpenAPI_edrx_parameters_convertToJSON() failed [edrx_value]"); goto end; @@ -55,25 +68,26 @@ end: OpenAPI_edrx_parameters_t *OpenAPI_edrx_parameters_parseFromJSON(cJSON *edrx_parametersJSON) { OpenAPI_edrx_parameters_t *edrx_parameters_local_var = NULL; - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(edrx_parametersJSON, "ratType"); + OpenAPI_lnode_t *node = NULL; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *edrx_value = NULL; + rat_type = cJSON_GetObjectItemCaseSensitive(edrx_parametersJSON, "ratType"); if (!rat_type) { ogs_error("OpenAPI_edrx_parameters_parseFromJSON() failed [rat_type]"); goto end; } - - OpenAPI_rat_type_e rat_typeVariable; if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_edrx_parameters_parseFromJSON() failed [rat_type]"); goto end; } rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); - cJSON *edrx_value = cJSON_GetObjectItemCaseSensitive(edrx_parametersJSON, "edrxValue"); + edrx_value = cJSON_GetObjectItemCaseSensitive(edrx_parametersJSON, "edrxValue"); if (!edrx_value) { ogs_error("OpenAPI_edrx_parameters_parseFromJSON() failed [edrx_value]"); goto end; } - if (!cJSON_IsString(edrx_value)) { ogs_error("OpenAPI_edrx_parameters_parseFromJSON() failed [edrx_value]"); goto end; diff --git a/lib/sbi/openapi/model/edrx_parameters_1.c b/lib/sbi/openapi/model/edrx_parameters_1.c index 16105142c..8540cf828 100644 --- a/lib/sbi/openapi/model/edrx_parameters_1.c +++ b/lib/sbi/openapi/model/edrx_parameters_1.c @@ -20,17 +20,22 @@ OpenAPI_edrx_parameters_1_t *OpenAPI_edrx_parameters_1_create( void OpenAPI_edrx_parameters_1_free(OpenAPI_edrx_parameters_1_t *edrx_parameters_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == edrx_parameters_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(edrx_parameters_1->edrx_value); + if (edrx_parameters_1->edrx_value) { + ogs_free(edrx_parameters_1->edrx_value); + edrx_parameters_1->edrx_value = NULL; + } ogs_free(edrx_parameters_1); } cJSON *OpenAPI_edrx_parameters_1_convertToJSON(OpenAPI_edrx_parameters_1_t *edrx_parameters_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (edrx_parameters_1 == NULL) { ogs_error("OpenAPI_edrx_parameters_1_convertToJSON() failed [EdrxParameters_1]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_edrx_parameters_1_convertToJSON(OpenAPI_edrx_parameters_1_t *edrx } item = cJSON_CreateObject(); + if (edrx_parameters_1->rat_type == OpenAPI_rat_type_NULL) { + ogs_error("OpenAPI_edrx_parameters_1_convertToJSON() failed [rat_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(edrx_parameters_1->rat_type)) == NULL) { ogs_error("OpenAPI_edrx_parameters_1_convertToJSON() failed [rat_type]"); goto end; } + if (!edrx_parameters_1->edrx_value) { + ogs_error("OpenAPI_edrx_parameters_1_convertToJSON() failed [edrx_value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "edrxValue", edrx_parameters_1->edrx_value) == NULL) { ogs_error("OpenAPI_edrx_parameters_1_convertToJSON() failed [edrx_value]"); goto end; @@ -55,25 +68,26 @@ end: OpenAPI_edrx_parameters_1_t *OpenAPI_edrx_parameters_1_parseFromJSON(cJSON *edrx_parameters_1JSON) { OpenAPI_edrx_parameters_1_t *edrx_parameters_1_local_var = NULL; - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(edrx_parameters_1JSON, "ratType"); + OpenAPI_lnode_t *node = NULL; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *edrx_value = NULL; + rat_type = cJSON_GetObjectItemCaseSensitive(edrx_parameters_1JSON, "ratType"); if (!rat_type) { ogs_error("OpenAPI_edrx_parameters_1_parseFromJSON() failed [rat_type]"); goto end; } - - OpenAPI_rat_type_e rat_typeVariable; if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_edrx_parameters_1_parseFromJSON() failed [rat_type]"); goto end; } rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); - cJSON *edrx_value = cJSON_GetObjectItemCaseSensitive(edrx_parameters_1JSON, "edrxValue"); + edrx_value = cJSON_GetObjectItemCaseSensitive(edrx_parameters_1JSON, "edrxValue"); if (!edrx_value) { ogs_error("OpenAPI_edrx_parameters_1_parseFromJSON() failed [edrx_value]"); goto end; } - if (!cJSON_IsString(edrx_value)) { ogs_error("OpenAPI_edrx_parameters_1_parseFromJSON() failed [edrx_value]"); goto end; diff --git a/lib/sbi/openapi/model/ee_group_profile_data.c b/lib/sbi/openapi/model/ee_group_profile_data.c index f29407e86..25cbbed05 100644 --- a/lib/sbi/openapi/model/ee_group_profile_data.c +++ b/lib/sbi/openapi/model/ee_group_profile_data.c @@ -22,28 +22,39 @@ OpenAPI_ee_group_profile_data_t *OpenAPI_ee_group_profile_data_create( void OpenAPI_ee_group_profile_data_free(OpenAPI_ee_group_profile_data_t *ee_group_profile_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ee_group_profile_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ee_group_profile_data->restricted_event_types, node) { - OpenAPI_event_type_free(node->data); + if (ee_group_profile_data->restricted_event_types) { + OpenAPI_list_for_each(ee_group_profile_data->restricted_event_types, node) { + OpenAPI_event_type_free(node->data); + } + OpenAPI_list_free(ee_group_profile_data->restricted_event_types); + ee_group_profile_data->restricted_event_types = NULL; } - OpenAPI_list_free(ee_group_profile_data->restricted_event_types); - OpenAPI_list_for_each(ee_group_profile_data->allowed_mtc_provider, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ee_group_profile_data->allowed_mtc_provider) { + OpenAPI_list_for_each(ee_group_profile_data->allowed_mtc_provider, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ee_group_profile_data->allowed_mtc_provider); + ee_group_profile_data->allowed_mtc_provider = NULL; + } + if (ee_group_profile_data->supported_features) { + ogs_free(ee_group_profile_data->supported_features); + ee_group_profile_data->supported_features = NULL; } - OpenAPI_list_free(ee_group_profile_data->allowed_mtc_provider); - ogs_free(ee_group_profile_data->supported_features); ogs_free(ee_group_profile_data); } cJSON *OpenAPI_ee_group_profile_data_convertToJSON(OpenAPI_ee_group_profile_data_t *ee_group_profile_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ee_group_profile_data == NULL) { ogs_error("OpenAPI_ee_group_profile_data_convertToJSON() failed [EeGroupProfileData]"); @@ -57,17 +68,13 @@ cJSON *OpenAPI_ee_group_profile_data_convertToJSON(OpenAPI_ee_group_profile_data ogs_error("OpenAPI_ee_group_profile_data_convertToJSON() failed [restricted_event_types]"); goto end; } - - OpenAPI_lnode_t *restricted_event_types_node; - if (ee_group_profile_data->restricted_event_types) { - OpenAPI_list_for_each(ee_group_profile_data->restricted_event_types, restricted_event_types_node) { - cJSON *itemLocal = OpenAPI_event_type_convertToJSON(restricted_event_types_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ee_group_profile_data_convertToJSON() failed [restricted_event_types]"); - goto end; - } - cJSON_AddItemToArray(restricted_event_typesList, itemLocal); + OpenAPI_list_for_each(ee_group_profile_data->restricted_event_types, node) { + cJSON *itemLocal = OpenAPI_event_type_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ee_group_profile_data_convertToJSON() failed [restricted_event_types]"); + goto end; } + cJSON_AddItemToArray(restricted_event_typesList, itemLocal); } } @@ -78,21 +85,20 @@ cJSON *OpenAPI_ee_group_profile_data_convertToJSON(OpenAPI_ee_group_profile_data goto end; } cJSON *localMapObject = allowed_mtc_provider; - OpenAPI_lnode_t *allowed_mtc_provider_node; if (ee_group_profile_data->allowed_mtc_provider) { - OpenAPI_list_for_each(ee_group_profile_data->allowed_mtc_provider, allowed_mtc_provider_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)allowed_mtc_provider_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_mtc_provider_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ee_group_profile_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ee_group_profile_data->allowed_mtc_provider, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_mtc_provider_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ee_group_profile_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (ee_group_profile_data->supported_features) { if (cJSON_AddStringToObject(item, "supportedFeatures", ee_group_profile_data->supported_features) == NULL) { @@ -108,65 +114,68 @@ end: OpenAPI_ee_group_profile_data_t *OpenAPI_ee_group_profile_data_parseFromJSON(cJSON *ee_group_profile_dataJSON) { OpenAPI_ee_group_profile_data_t *ee_group_profile_data_local_var = NULL; - cJSON *restricted_event_types = cJSON_GetObjectItemCaseSensitive(ee_group_profile_dataJSON, "restrictedEventTypes"); - - OpenAPI_list_t *restricted_event_typesList; + OpenAPI_lnode_t *node = NULL; + cJSON *restricted_event_types = NULL; + OpenAPI_list_t *restricted_event_typesList = NULL; + cJSON *allowed_mtc_provider = NULL; + OpenAPI_list_t *allowed_mtc_providerList = NULL; + cJSON *supported_features = NULL; + restricted_event_types = cJSON_GetObjectItemCaseSensitive(ee_group_profile_dataJSON, "restrictedEventTypes"); if (restricted_event_types) { - cJSON *restricted_event_types_local_nonprimitive; - if (!cJSON_IsArray(restricted_event_types)){ - ogs_error("OpenAPI_ee_group_profile_data_parseFromJSON() failed [restricted_event_types]"); - goto end; - } - - restricted_event_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(restricted_event_types_local_nonprimitive, restricted_event_types ) { - if (!cJSON_IsObject(restricted_event_types_local_nonprimitive)) { + cJSON *restricted_event_types_local = NULL; + if (!cJSON_IsArray(restricted_event_types)) { ogs_error("OpenAPI_ee_group_profile_data_parseFromJSON() failed [restricted_event_types]"); goto end; } - OpenAPI_event_type_t *restricted_event_typesItem = OpenAPI_event_type_parseFromJSON(restricted_event_types_local_nonprimitive); - if (!restricted_event_typesItem) { - ogs_error("No restricted_event_typesItem"); - OpenAPI_list_free(restricted_event_typesList); - goto end; + restricted_event_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(restricted_event_types_local, restricted_event_types) { + if (!cJSON_IsObject(restricted_event_types_local)) { + ogs_error("OpenAPI_ee_group_profile_data_parseFromJSON() failed [restricted_event_types]"); + goto end; + } + OpenAPI_event_type_t *restricted_event_typesItem = OpenAPI_event_type_parseFromJSON(restricted_event_types_local); + if (!restricted_event_typesItem) { + ogs_error("No restricted_event_typesItem"); + OpenAPI_list_free(restricted_event_typesList); + goto end; + } + OpenAPI_list_add(restricted_event_typesList, restricted_event_typesItem); } - - OpenAPI_list_add(restricted_event_typesList, restricted_event_typesItem); - } } - cJSON *allowed_mtc_provider = cJSON_GetObjectItemCaseSensitive(ee_group_profile_dataJSON, "allowedMtcProvider"); - - OpenAPI_list_t *allowed_mtc_providerList; + allowed_mtc_provider = cJSON_GetObjectItemCaseSensitive(ee_group_profile_dataJSON, "allowedMtcProvider"); if (allowed_mtc_provider) { - cJSON *allowed_mtc_provider_local_map; - if (!cJSON_IsObject(allowed_mtc_provider)) { - ogs_error("OpenAPI_ee_group_profile_data_parseFromJSON() failed [allowed_mtc_provider]"); - goto end; - } - allowed_mtc_providerList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(allowed_mtc_provider_local_map, allowed_mtc_provider) { - cJSON *localMapObject = allowed_mtc_provider_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_mtc_provider_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ee_group_profile_data_parseFromJSON() failed [inner]"); + cJSON *allowed_mtc_provider_local_map = NULL; + if (!cJSON_IsObject(allowed_mtc_provider) && !cJSON_IsNull(allowed_mtc_provider)) { + ogs_error("OpenAPI_ee_group_profile_data_parseFromJSON() failed [allowed_mtc_provider]"); goto end; } - OpenAPI_list_add(allowed_mtc_providerList, localMapKeyPair); - } + if (cJSON_IsObject(allowed_mtc_provider)) { + allowed_mtc_providerList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(allowed_mtc_provider_local_map, allowed_mtc_provider) { + cJSON *localMapObject = allowed_mtc_provider_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_mtc_provider_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ee_group_profile_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(allowed_mtc_providerList, localMapKeyPair); + } + } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ee_group_profile_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ee_group_profile_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ee_group_profile_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -175,11 +184,28 @@ OpenAPI_ee_group_profile_data_t *OpenAPI_ee_group_profile_data_parseFromJSON(cJS ee_group_profile_data_local_var = OpenAPI_ee_group_profile_data_create ( restricted_event_types ? restricted_event_typesList : NULL, allowed_mtc_provider ? allowed_mtc_providerList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return ee_group_profile_data_local_var; end: + if (restricted_event_typesList) { + OpenAPI_list_for_each(restricted_event_typesList, node) { + OpenAPI_event_type_free(node->data); + } + OpenAPI_list_free(restricted_event_typesList); + restricted_event_typesList = NULL; + } + if (allowed_mtc_providerList) { + OpenAPI_list_for_each(allowed_mtc_providerList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(allowed_mtc_providerList); + allowed_mtc_providerList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ee_profile_data.c b/lib/sbi/openapi/model/ee_profile_data.c index 52208b732..132bb2f6b 100644 --- a/lib/sbi/openapi/model/ee_profile_data.c +++ b/lib/sbi/openapi/model/ee_profile_data.c @@ -22,28 +22,39 @@ OpenAPI_ee_profile_data_t *OpenAPI_ee_profile_data_create( void OpenAPI_ee_profile_data_free(OpenAPI_ee_profile_data_t *ee_profile_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ee_profile_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ee_profile_data->restricted_event_types, node) { - OpenAPI_event_type_free(node->data); + if (ee_profile_data->restricted_event_types) { + OpenAPI_list_for_each(ee_profile_data->restricted_event_types, node) { + OpenAPI_event_type_free(node->data); + } + OpenAPI_list_free(ee_profile_data->restricted_event_types); + ee_profile_data->restricted_event_types = NULL; } - OpenAPI_list_free(ee_profile_data->restricted_event_types); - ogs_free(ee_profile_data->supported_features); - OpenAPI_list_for_each(ee_profile_data->allowed_mtc_provider, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ee_profile_data->supported_features) { + ogs_free(ee_profile_data->supported_features); + ee_profile_data->supported_features = NULL; + } + if (ee_profile_data->allowed_mtc_provider) { + OpenAPI_list_for_each(ee_profile_data->allowed_mtc_provider, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ee_profile_data->allowed_mtc_provider); + ee_profile_data->allowed_mtc_provider = NULL; } - OpenAPI_list_free(ee_profile_data->allowed_mtc_provider); ogs_free(ee_profile_data); } cJSON *OpenAPI_ee_profile_data_convertToJSON(OpenAPI_ee_profile_data_t *ee_profile_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ee_profile_data == NULL) { ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [EeProfileData]"); @@ -57,17 +68,13 @@ cJSON *OpenAPI_ee_profile_data_convertToJSON(OpenAPI_ee_profile_data_t *ee_profi ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [restricted_event_types]"); goto end; } - - OpenAPI_lnode_t *restricted_event_types_node; - if (ee_profile_data->restricted_event_types) { - OpenAPI_list_for_each(ee_profile_data->restricted_event_types, restricted_event_types_node) { - cJSON *itemLocal = OpenAPI_event_type_convertToJSON(restricted_event_types_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [restricted_event_types]"); - goto end; - } - cJSON_AddItemToArray(restricted_event_typesList, itemLocal); + OpenAPI_list_for_each(ee_profile_data->restricted_event_types, node) { + cJSON *itemLocal = OpenAPI_event_type_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [restricted_event_types]"); + goto end; } + cJSON_AddItemToArray(restricted_event_typesList, itemLocal); } } @@ -85,21 +92,20 @@ cJSON *OpenAPI_ee_profile_data_convertToJSON(OpenAPI_ee_profile_data_t *ee_profi goto end; } cJSON *localMapObject = allowed_mtc_provider; - OpenAPI_lnode_t *allowed_mtc_provider_node; if (ee_profile_data->allowed_mtc_provider) { - OpenAPI_list_for_each(ee_profile_data->allowed_mtc_provider, allowed_mtc_provider_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)allowed_mtc_provider_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_mtc_provider_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ee_profile_data->allowed_mtc_provider, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_mtc_provider_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ee_profile_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -108,78 +114,98 @@ end: OpenAPI_ee_profile_data_t *OpenAPI_ee_profile_data_parseFromJSON(cJSON *ee_profile_dataJSON) { OpenAPI_ee_profile_data_t *ee_profile_data_local_var = NULL; - cJSON *restricted_event_types = cJSON_GetObjectItemCaseSensitive(ee_profile_dataJSON, "restrictedEventTypes"); - - OpenAPI_list_t *restricted_event_typesList; + OpenAPI_lnode_t *node = NULL; + cJSON *restricted_event_types = NULL; + OpenAPI_list_t *restricted_event_typesList = NULL; + cJSON *supported_features = NULL; + cJSON *allowed_mtc_provider = NULL; + OpenAPI_list_t *allowed_mtc_providerList = NULL; + restricted_event_types = cJSON_GetObjectItemCaseSensitive(ee_profile_dataJSON, "restrictedEventTypes"); if (restricted_event_types) { - cJSON *restricted_event_types_local_nonprimitive; - if (!cJSON_IsArray(restricted_event_types)){ - ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [restricted_event_types]"); - goto end; - } - - restricted_event_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(restricted_event_types_local_nonprimitive, restricted_event_types ) { - if (!cJSON_IsObject(restricted_event_types_local_nonprimitive)) { + cJSON *restricted_event_types_local = NULL; + if (!cJSON_IsArray(restricted_event_types)) { ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [restricted_event_types]"); goto end; } - OpenAPI_event_type_t *restricted_event_typesItem = OpenAPI_event_type_parseFromJSON(restricted_event_types_local_nonprimitive); - if (!restricted_event_typesItem) { - ogs_error("No restricted_event_typesItem"); - OpenAPI_list_free(restricted_event_typesList); - goto end; + restricted_event_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(restricted_event_types_local, restricted_event_types) { + if (!cJSON_IsObject(restricted_event_types_local)) { + ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [restricted_event_types]"); + goto end; + } + OpenAPI_event_type_t *restricted_event_typesItem = OpenAPI_event_type_parseFromJSON(restricted_event_types_local); + if (!restricted_event_typesItem) { + ogs_error("No restricted_event_typesItem"); + OpenAPI_list_free(restricted_event_typesList); + goto end; + } + OpenAPI_list_add(restricted_event_typesList, restricted_event_typesItem); } - - OpenAPI_list_add(restricted_event_typesList, restricted_event_typesItem); - } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ee_profile_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ee_profile_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *allowed_mtc_provider = cJSON_GetObjectItemCaseSensitive(ee_profile_dataJSON, "allowedMtcProvider"); - - OpenAPI_list_t *allowed_mtc_providerList; + allowed_mtc_provider = cJSON_GetObjectItemCaseSensitive(ee_profile_dataJSON, "allowedMtcProvider"); if (allowed_mtc_provider) { - cJSON *allowed_mtc_provider_local_map; - if (!cJSON_IsObject(allowed_mtc_provider)) { - ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [allowed_mtc_provider]"); - goto end; - } - allowed_mtc_providerList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(allowed_mtc_provider_local_map, allowed_mtc_provider) { - cJSON *localMapObject = allowed_mtc_provider_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_mtc_provider_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [inner]"); + cJSON *allowed_mtc_provider_local_map = NULL; + if (!cJSON_IsObject(allowed_mtc_provider) && !cJSON_IsNull(allowed_mtc_provider)) { + ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [allowed_mtc_provider]"); goto end; } - OpenAPI_list_add(allowed_mtc_providerList, localMapKeyPair); - } + if (cJSON_IsObject(allowed_mtc_provider)) { + allowed_mtc_providerList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(allowed_mtc_provider_local_map, allowed_mtc_provider) { + cJSON *localMapObject = allowed_mtc_provider_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_mtc_provider_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ee_profile_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(allowed_mtc_providerList, localMapKeyPair); + } + } } ee_profile_data_local_var = OpenAPI_ee_profile_data_create ( restricted_event_types ? restricted_event_typesList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, allowed_mtc_provider ? allowed_mtc_providerList : NULL ); return ee_profile_data_local_var; end: + if (restricted_event_typesList) { + OpenAPI_list_for_each(restricted_event_typesList, node) { + OpenAPI_event_type_free(node->data); + } + OpenAPI_list_free(restricted_event_typesList); + restricted_event_typesList = NULL; + } + if (allowed_mtc_providerList) { + OpenAPI_list_for_each(allowed_mtc_providerList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(allowed_mtc_providerList); + allowed_mtc_providerList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ee_subscription.c b/lib/sbi/openapi/model/ee_subscription.c index 55cf3bb5a..01d0c2cc2 100644 --- a/lib/sbi/openapi/model/ee_subscription.c +++ b/lib/sbi/openapi/model/ee_subscription.c @@ -38,31 +38,60 @@ OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_create( void OpenAPI_ee_subscription_free(OpenAPI_ee_subscription_t *ee_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ee_subscription) { return; } - OpenAPI_lnode_t *node; - ogs_free(ee_subscription->callback_reference); - OpenAPI_list_for_each(ee_subscription->monitoring_configurations, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_monitoring_configuration_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ee_subscription->callback_reference) { + ogs_free(ee_subscription->callback_reference); + ee_subscription->callback_reference = NULL; + } + if (ee_subscription->monitoring_configurations) { + OpenAPI_list_for_each(ee_subscription->monitoring_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_monitoring_configuration_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ee_subscription->monitoring_configurations); + ee_subscription->monitoring_configurations = NULL; + } + if (ee_subscription->reporting_options) { + OpenAPI_reporting_options_free(ee_subscription->reporting_options); + ee_subscription->reporting_options = NULL; + } + if (ee_subscription->supported_features) { + ogs_free(ee_subscription->supported_features); + ee_subscription->supported_features = NULL; + } + if (ee_subscription->subscription_id) { + ogs_free(ee_subscription->subscription_id); + ee_subscription->subscription_id = NULL; + } + if (ee_subscription->context_info) { + OpenAPI_context_info_free(ee_subscription->context_info); + ee_subscription->context_info = NULL; + } + if (ee_subscription->scef_diam_host) { + ogs_free(ee_subscription->scef_diam_host); + ee_subscription->scef_diam_host = NULL; + } + if (ee_subscription->scef_diam_realm) { + ogs_free(ee_subscription->scef_diam_realm); + ee_subscription->scef_diam_realm = NULL; + } + if (ee_subscription->notify_correlation_id) { + ogs_free(ee_subscription->notify_correlation_id); + ee_subscription->notify_correlation_id = NULL; } - OpenAPI_list_free(ee_subscription->monitoring_configurations); - OpenAPI_reporting_options_free(ee_subscription->reporting_options); - ogs_free(ee_subscription->supported_features); - ogs_free(ee_subscription->subscription_id); - OpenAPI_context_info_free(ee_subscription->context_info); - ogs_free(ee_subscription->scef_diam_host); - ogs_free(ee_subscription->scef_diam_realm); - ogs_free(ee_subscription->notify_correlation_id); ogs_free(ee_subscription); } cJSON *OpenAPI_ee_subscription_convertToJSON(OpenAPI_ee_subscription_t *ee_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ee_subscription == NULL) { ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [EeSubscription]"); @@ -70,31 +99,38 @@ cJSON *OpenAPI_ee_subscription_convertToJSON(OpenAPI_ee_subscription_t *ee_subsc } item = cJSON_CreateObject(); + if (!ee_subscription->callback_reference) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [callback_reference]"); + return NULL; + } if (cJSON_AddStringToObject(item, "callbackReference", ee_subscription->callback_reference) == NULL) { ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [callback_reference]"); goto end; } + if (!ee_subscription->monitoring_configurations) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [monitoring_configurations]"); + return NULL; + } cJSON *monitoring_configurations = cJSON_AddObjectToObject(item, "monitoringConfigurations"); if (monitoring_configurations == NULL) { ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [monitoring_configurations]"); goto end; } cJSON *localMapObject = monitoring_configurations; - OpenAPI_lnode_t *monitoring_configurations_node; if (ee_subscription->monitoring_configurations) { - OpenAPI_list_for_each(ee_subscription->monitoring_configurations, monitoring_configurations_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)monitoring_configurations_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_monitoring_configuration_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ee_subscription->monitoring_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_monitoring_configuration_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } + } if (ee_subscription->reporting_options) { cJSON *reporting_options_local_JSON = OpenAPI_reporting_options_convertToJSON(ee_subscription->reporting_options); @@ -171,79 +207,85 @@ end: OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_parseFromJSON(cJSON *ee_subscriptionJSON) { OpenAPI_ee_subscription_t *ee_subscription_local_var = NULL; - cJSON *callback_reference = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "callbackReference"); + OpenAPI_lnode_t *node = NULL; + cJSON *callback_reference = NULL; + cJSON *monitoring_configurations = NULL; + OpenAPI_list_t *monitoring_configurationsList = NULL; + cJSON *reporting_options = NULL; + OpenAPI_reporting_options_t *reporting_options_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *subscription_id = NULL; + cJSON *context_info = NULL; + OpenAPI_context_info_t *context_info_local_nonprim = NULL; + cJSON *epc_applied_ind = NULL; + cJSON *scef_diam_host = NULL; + cJSON *scef_diam_realm = NULL; + cJSON *notify_correlation_id = NULL; + callback_reference = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "callbackReference"); if (!callback_reference) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [callback_reference]"); goto end; } - if (!cJSON_IsString(callback_reference)) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [callback_reference]"); goto end; } - cJSON *monitoring_configurations = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "monitoringConfigurations"); + monitoring_configurations = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "monitoringConfigurations"); if (!monitoring_configurations) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [monitoring_configurations]"); goto end; } - - OpenAPI_list_t *monitoring_configurationsList; - cJSON *monitoring_configurations_local_map; - if (!cJSON_IsObject(monitoring_configurations)) { - ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [monitoring_configurations]"); - goto end; - } - monitoring_configurationsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(monitoring_configurations_local_map, monitoring_configurations) { - cJSON *localMapObject = monitoring_configurations_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_monitoring_configuration_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [inner]"); + cJSON *monitoring_configurations_local_map = NULL; + if (!cJSON_IsObject(monitoring_configurations) && !cJSON_IsNull(monitoring_configurations)) { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [monitoring_configurations]"); goto end; } - OpenAPI_list_add(monitoring_configurationsList, localMapKeyPair); - } + if (cJSON_IsObject(monitoring_configurations)) { + monitoring_configurationsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(monitoring_configurations_local_map, monitoring_configurations) { + cJSON *localMapObject = monitoring_configurations_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_monitoring_configuration_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(monitoring_configurationsList, localMapKeyPair); + } + } - cJSON *reporting_options = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "reportingOptions"); - - OpenAPI_reporting_options_t *reporting_options_local_nonprim = NULL; + reporting_options = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "reportingOptions"); if (reporting_options) { reporting_options_local_nonprim = OpenAPI_reporting_options_parseFromJSON(reporting_options); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "subscriptionId"); - + subscription_id = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "subscriptionId"); if (subscription_id) { - if (!cJSON_IsString(subscription_id)) { + if (!cJSON_IsString(subscription_id) && !cJSON_IsNull(subscription_id)) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [subscription_id]"); goto end; } } - cJSON *context_info = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "contextInfo"); - - OpenAPI_context_info_t *context_info_local_nonprim = NULL; + context_info = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "contextInfo"); if (context_info) { context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info); } - cJSON *epc_applied_ind = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "epcAppliedInd"); - + epc_applied_ind = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "epcAppliedInd"); if (epc_applied_ind) { if (!cJSON_IsBool(epc_applied_ind)) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [epc_applied_ind]"); @@ -251,28 +293,25 @@ OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_parseFromJSON(cJSON *ee_subsc } } - cJSON *scef_diam_host = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "scefDiamHost"); - + scef_diam_host = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "scefDiamHost"); if (scef_diam_host) { - if (!cJSON_IsString(scef_diam_host)) { + if (!cJSON_IsString(scef_diam_host) && !cJSON_IsNull(scef_diam_host)) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [scef_diam_host]"); goto end; } } - cJSON *scef_diam_realm = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "scefDiamRealm"); - + scef_diam_realm = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "scefDiamRealm"); if (scef_diam_realm) { - if (!cJSON_IsString(scef_diam_realm)) { + if (!cJSON_IsString(scef_diam_realm) && !cJSON_IsNull(scef_diam_realm)) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [scef_diam_realm]"); goto end; } } - cJSON *notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "notifyCorrelationId"); - + notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "notifyCorrelationId"); if (notify_correlation_id) { - if (!cJSON_IsString(notify_correlation_id)) { + if (!cJSON_IsString(notify_correlation_id) && !cJSON_IsNull(notify_correlation_id)) { ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [notify_correlation_id]"); goto end; } @@ -282,18 +321,36 @@ OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_parseFromJSON(cJSON *ee_subsc ogs_strdup(callback_reference->valuestring), monitoring_configurationsList, reporting_options ? reporting_options_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, - subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, + subscription_id && !cJSON_IsNull(subscription_id) ? ogs_strdup(subscription_id->valuestring) : NULL, context_info ? context_info_local_nonprim : NULL, epc_applied_ind ? true : false, epc_applied_ind ? epc_applied_ind->valueint : 0, - scef_diam_host ? ogs_strdup(scef_diam_host->valuestring) : NULL, - scef_diam_realm ? ogs_strdup(scef_diam_realm->valuestring) : NULL, - notify_correlation_id ? ogs_strdup(notify_correlation_id->valuestring) : NULL + scef_diam_host && !cJSON_IsNull(scef_diam_host) ? ogs_strdup(scef_diam_host->valuestring) : NULL, + scef_diam_realm && !cJSON_IsNull(scef_diam_realm) ? ogs_strdup(scef_diam_realm->valuestring) : NULL, + notify_correlation_id && !cJSON_IsNull(notify_correlation_id) ? ogs_strdup(notify_correlation_id->valuestring) : NULL ); return ee_subscription_local_var; end: + if (monitoring_configurationsList) { + OpenAPI_list_for_each(monitoring_configurationsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_monitoring_configuration_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(monitoring_configurationsList); + monitoring_configurationsList = NULL; + } + if (reporting_options_local_nonprim) { + OpenAPI_reporting_options_free(reporting_options_local_nonprim); + reporting_options_local_nonprim = NULL; + } + if (context_info_local_nonprim) { + OpenAPI_context_info_free(context_info_local_nonprim); + context_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ellipsoid_arc.c b/lib/sbi/openapi/model/ellipsoid_arc.c index 88d650bf2..db38bd6fb 100644 --- a/lib/sbi/openapi/model/ellipsoid_arc.c +++ b/lib/sbi/openapi/model/ellipsoid_arc.c @@ -30,18 +30,26 @@ OpenAPI_ellipsoid_arc_t *OpenAPI_ellipsoid_arc_create( void OpenAPI_ellipsoid_arc_free(OpenAPI_ellipsoid_arc_t *ellipsoid_arc) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ellipsoid_arc) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(ellipsoid_arc->shape); - OpenAPI_geographical_coordinates_free(ellipsoid_arc->point); + if (ellipsoid_arc->shape) { + OpenAPI_supported_gad_shapes_free(ellipsoid_arc->shape); + ellipsoid_arc->shape = NULL; + } + if (ellipsoid_arc->point) { + OpenAPI_geographical_coordinates_free(ellipsoid_arc->point); + ellipsoid_arc->point = NULL; + } ogs_free(ellipsoid_arc); } cJSON *OpenAPI_ellipsoid_arc_convertToJSON(OpenAPI_ellipsoid_arc_t *ellipsoid_arc) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ellipsoid_arc == NULL) { ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [EllipsoidArc]"); @@ -49,6 +57,10 @@ cJSON *OpenAPI_ellipsoid_arc_convertToJSON(OpenAPI_ellipsoid_arc_t *ellipsoid_ar } item = cJSON_CreateObject(); + if (!ellipsoid_arc->shape) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(ellipsoid_arc->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [shape]"); @@ -60,6 +72,10 @@ cJSON *OpenAPI_ellipsoid_arc_convertToJSON(OpenAPI_ellipsoid_arc_t *ellipsoid_ar goto end; } + if (!ellipsoid_arc->point) { + ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(ellipsoid_arc->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_ellipsoid_arc_convertToJSON() failed [point]"); @@ -103,74 +119,75 @@ end: OpenAPI_ellipsoid_arc_t *OpenAPI_ellipsoid_arc_parseFromJSON(cJSON *ellipsoid_arcJSON) { OpenAPI_ellipsoid_arc_t *ellipsoid_arc_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *inner_radius = NULL; + cJSON *uncertainty_radius = NULL; + cJSON *offset_angle = NULL; + cJSON *included_angle = NULL; + cJSON *confidence = NULL; + shape = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "shape"); if (!shape) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); - cJSON *point = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "point"); + point = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "point"); if (!point) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *inner_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "innerRadius"); + inner_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "innerRadius"); if (!inner_radius) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [inner_radius]"); goto end; } - if (!cJSON_IsNumber(inner_radius)) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [inner_radius]"); goto end; } - cJSON *uncertainty_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "uncertaintyRadius"); + uncertainty_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "uncertaintyRadius"); if (!uncertainty_radius) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [uncertainty_radius]"); goto end; } - if (!cJSON_IsNumber(uncertainty_radius)) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [uncertainty_radius]"); goto end; } - cJSON *offset_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "offsetAngle"); + offset_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "offsetAngle"); if (!offset_angle) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [offset_angle]"); goto end; } - if (!cJSON_IsNumber(offset_angle)) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [offset_angle]"); goto end; } - cJSON *included_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "includedAngle"); + included_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "includedAngle"); if (!included_angle) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [included_angle]"); goto end; } - if (!cJSON_IsNumber(included_angle)) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [included_angle]"); goto end; } - cJSON *confidence = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "confidence"); + confidence = cJSON_GetObjectItemCaseSensitive(ellipsoid_arcJSON, "confidence"); if (!confidence) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [confidence]"); goto end; } - if (!cJSON_IsNumber(confidence)) { ogs_error("OpenAPI_ellipsoid_arc_parseFromJSON() failed [confidence]"); goto end; @@ -193,6 +210,14 @@ OpenAPI_ellipsoid_arc_t *OpenAPI_ellipsoid_arc_parseFromJSON(cJSON *ellipsoid_ar return ellipsoid_arc_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ellipsoid_arc.h b/lib/sbi/openapi/model/ellipsoid_arc.h index 6aa796f90..053d0e8d9 100644 --- a/lib/sbi/openapi/model/ellipsoid_arc.h +++ b/lib/sbi/openapi/model/ellipsoid_arc.h @@ -12,7 +12,6 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "ellipsoid_arc_all_of.h" #include "gad_shape.h" #include "geographical_coordinates.h" #include "supported_gad_shapes.h" diff --git a/lib/sbi/openapi/model/ellipsoid_arc_all_of.c b/lib/sbi/openapi/model/ellipsoid_arc_all_of.c index c884a6983..9d97fd4da 100644 --- a/lib/sbi/openapi/model/ellipsoid_arc_all_of.c +++ b/lib/sbi/openapi/model/ellipsoid_arc_all_of.c @@ -28,17 +28,22 @@ OpenAPI_ellipsoid_arc_all_of_t *OpenAPI_ellipsoid_arc_all_of_create( void OpenAPI_ellipsoid_arc_all_of_free(OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ellipsoid_arc_all_of) { return; } - OpenAPI_lnode_t *node; - OpenAPI_geographical_coordinates_free(ellipsoid_arc_all_of->point); + if (ellipsoid_arc_all_of->point) { + OpenAPI_geographical_coordinates_free(ellipsoid_arc_all_of->point); + ellipsoid_arc_all_of->point = NULL; + } ogs_free(ellipsoid_arc_all_of); } cJSON *OpenAPI_ellipsoid_arc_all_of_convertToJSON(OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ellipsoid_arc_all_of == NULL) { ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [EllipsoidArc_allOf]"); @@ -46,6 +51,10 @@ cJSON *OpenAPI_ellipsoid_arc_all_of_convertToJSON(OpenAPI_ellipsoid_arc_all_of_t } item = cJSON_CreateObject(); + if (!ellipsoid_arc_all_of->point) { + ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(ellipsoid_arc_all_of->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_ellipsoid_arc_all_of_convertToJSON() failed [point]"); @@ -89,65 +98,66 @@ end: OpenAPI_ellipsoid_arc_all_of_t *OpenAPI_ellipsoid_arc_all_of_parseFromJSON(cJSON *ellipsoid_arc_all_ofJSON) { OpenAPI_ellipsoid_arc_all_of_t *ellipsoid_arc_all_of_local_var = NULL; - cJSON *point = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "point"); + OpenAPI_lnode_t *node = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *inner_radius = NULL; + cJSON *uncertainty_radius = NULL; + cJSON *offset_angle = NULL; + cJSON *included_angle = NULL; + cJSON *confidence = NULL; + point = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "point"); if (!point) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *inner_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "innerRadius"); + inner_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "innerRadius"); if (!inner_radius) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [inner_radius]"); goto end; } - if (!cJSON_IsNumber(inner_radius)) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [inner_radius]"); goto end; } - cJSON *uncertainty_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "uncertaintyRadius"); + uncertainty_radius = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "uncertaintyRadius"); if (!uncertainty_radius) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [uncertainty_radius]"); goto end; } - if (!cJSON_IsNumber(uncertainty_radius)) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [uncertainty_radius]"); goto end; } - cJSON *offset_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "offsetAngle"); + offset_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "offsetAngle"); if (!offset_angle) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [offset_angle]"); goto end; } - if (!cJSON_IsNumber(offset_angle)) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [offset_angle]"); goto end; } - cJSON *included_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "includedAngle"); + included_angle = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "includedAngle"); if (!included_angle) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [included_angle]"); goto end; } - if (!cJSON_IsNumber(included_angle)) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [included_angle]"); goto end; } - cJSON *confidence = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "confidence"); + confidence = cJSON_GetObjectItemCaseSensitive(ellipsoid_arc_all_ofJSON, "confidence"); if (!confidence) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [confidence]"); goto end; } - if (!cJSON_IsNumber(confidence)) { ogs_error("OpenAPI_ellipsoid_arc_all_of_parseFromJSON() failed [confidence]"); goto end; @@ -169,6 +179,10 @@ OpenAPI_ellipsoid_arc_all_of_t *OpenAPI_ellipsoid_arc_all_of_parseFromJSON(cJSON return ellipsoid_arc_all_of_local_var; end: + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/emergency_info.c b/lib/sbi/openapi/model/emergency_info.c index 10801b88b..838122171 100644 --- a/lib/sbi/openapi/model/emergency_info.c +++ b/lib/sbi/openapi/model/emergency_info.c @@ -26,19 +26,30 @@ OpenAPI_emergency_info_t *OpenAPI_emergency_info_create( void OpenAPI_emergency_info_free(OpenAPI_emergency_info_t *emergency_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == emergency_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(emergency_info->pgw_fqdn); - OpenAPI_ip_address_free(emergency_info->pgw_ip_address); - ogs_free(emergency_info->smf_instance_id); + if (emergency_info->pgw_fqdn) { + ogs_free(emergency_info->pgw_fqdn); + emergency_info->pgw_fqdn = NULL; + } + if (emergency_info->pgw_ip_address) { + OpenAPI_ip_address_free(emergency_info->pgw_ip_address); + emergency_info->pgw_ip_address = NULL; + } + if (emergency_info->smf_instance_id) { + ogs_free(emergency_info->smf_instance_id); + emergency_info->smf_instance_id = NULL; + } ogs_free(emergency_info); } cJSON *OpenAPI_emergency_info_convertToJSON(OpenAPI_emergency_info_t *emergency_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (emergency_info == NULL) { ogs_error("OpenAPI_emergency_info_convertToJSON() failed [EmergencyInfo]"); @@ -87,33 +98,34 @@ end: OpenAPI_emergency_info_t *OpenAPI_emergency_info_parseFromJSON(cJSON *emergency_infoJSON) { OpenAPI_emergency_info_t *emergency_info_local_var = NULL; - cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "pgwFqdn"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pgw_fqdn = NULL; + cJSON *pgw_ip_address = NULL; + OpenAPI_ip_address_t *pgw_ip_address_local_nonprim = NULL; + cJSON *smf_instance_id = NULL; + cJSON *epdg_ind = NULL; + pgw_fqdn = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "pgwFqdn"); if (pgw_fqdn) { - if (!cJSON_IsString(pgw_fqdn)) { + if (!cJSON_IsString(pgw_fqdn) && !cJSON_IsNull(pgw_fqdn)) { ogs_error("OpenAPI_emergency_info_parseFromJSON() failed [pgw_fqdn]"); goto end; } } - cJSON *pgw_ip_address = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "pgwIpAddress"); - - OpenAPI_ip_address_t *pgw_ip_address_local_nonprim = NULL; + pgw_ip_address = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "pgwIpAddress"); if (pgw_ip_address) { pgw_ip_address_local_nonprim = OpenAPI_ip_address_parseFromJSON(pgw_ip_address); } - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "smfInstanceId"); - + smf_instance_id = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "smfInstanceId"); if (smf_instance_id) { - if (!cJSON_IsString(smf_instance_id)) { + if (!cJSON_IsString(smf_instance_id) && !cJSON_IsNull(smf_instance_id)) { ogs_error("OpenAPI_emergency_info_parseFromJSON() failed [smf_instance_id]"); goto end; } } - cJSON *epdg_ind = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "epdgInd"); - + epdg_ind = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "epdgInd"); if (epdg_ind) { if (!cJSON_IsBool(epdg_ind)) { ogs_error("OpenAPI_emergency_info_parseFromJSON() failed [epdg_ind]"); @@ -122,15 +134,19 @@ OpenAPI_emergency_info_t *OpenAPI_emergency_info_parseFromJSON(cJSON *emergency_ } emergency_info_local_var = OpenAPI_emergency_info_create ( - pgw_fqdn ? ogs_strdup(pgw_fqdn->valuestring) : NULL, + pgw_fqdn && !cJSON_IsNull(pgw_fqdn) ? ogs_strdup(pgw_fqdn->valuestring) : NULL, pgw_ip_address ? pgw_ip_address_local_nonprim : NULL, - smf_instance_id ? ogs_strdup(smf_instance_id->valuestring) : NULL, + smf_instance_id && !cJSON_IsNull(smf_instance_id) ? ogs_strdup(smf_instance_id->valuestring) : NULL, epdg_ind ? true : false, epdg_ind ? epdg_ind->valueint : 0 ); return emergency_info_local_var; end: + if (pgw_ip_address_local_nonprim) { + OpenAPI_ip_address_free(pgw_ip_address_local_nonprim); + pgw_ip_address_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/emergency_info_1.c b/lib/sbi/openapi/model/emergency_info_1.c index 77c5c74f8..5c2afbdf8 100644 --- a/lib/sbi/openapi/model/emergency_info_1.c +++ b/lib/sbi/openapi/model/emergency_info_1.c @@ -26,19 +26,30 @@ OpenAPI_emergency_info_1_t *OpenAPI_emergency_info_1_create( void OpenAPI_emergency_info_1_free(OpenAPI_emergency_info_1_t *emergency_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == emergency_info_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(emergency_info_1->pgw_fqdn); - OpenAPI_ip_address_1_free(emergency_info_1->pgw_ip_address); - ogs_free(emergency_info_1->smf_instance_id); + if (emergency_info_1->pgw_fqdn) { + ogs_free(emergency_info_1->pgw_fqdn); + emergency_info_1->pgw_fqdn = NULL; + } + if (emergency_info_1->pgw_ip_address) { + OpenAPI_ip_address_1_free(emergency_info_1->pgw_ip_address); + emergency_info_1->pgw_ip_address = NULL; + } + if (emergency_info_1->smf_instance_id) { + ogs_free(emergency_info_1->smf_instance_id); + emergency_info_1->smf_instance_id = NULL; + } ogs_free(emergency_info_1); } cJSON *OpenAPI_emergency_info_1_convertToJSON(OpenAPI_emergency_info_1_t *emergency_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (emergency_info_1 == NULL) { ogs_error("OpenAPI_emergency_info_1_convertToJSON() failed [EmergencyInfo_1]"); @@ -87,33 +98,34 @@ end: OpenAPI_emergency_info_1_t *OpenAPI_emergency_info_1_parseFromJSON(cJSON *emergency_info_1JSON) { OpenAPI_emergency_info_1_t *emergency_info_1_local_var = NULL; - cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(emergency_info_1JSON, "pgwFqdn"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pgw_fqdn = NULL; + cJSON *pgw_ip_address = NULL; + OpenAPI_ip_address_1_t *pgw_ip_address_local_nonprim = NULL; + cJSON *smf_instance_id = NULL; + cJSON *epdg_ind = NULL; + pgw_fqdn = cJSON_GetObjectItemCaseSensitive(emergency_info_1JSON, "pgwFqdn"); if (pgw_fqdn) { - if (!cJSON_IsString(pgw_fqdn)) { + if (!cJSON_IsString(pgw_fqdn) && !cJSON_IsNull(pgw_fqdn)) { ogs_error("OpenAPI_emergency_info_1_parseFromJSON() failed [pgw_fqdn]"); goto end; } } - cJSON *pgw_ip_address = cJSON_GetObjectItemCaseSensitive(emergency_info_1JSON, "pgwIpAddress"); - - OpenAPI_ip_address_1_t *pgw_ip_address_local_nonprim = NULL; + pgw_ip_address = cJSON_GetObjectItemCaseSensitive(emergency_info_1JSON, "pgwIpAddress"); if (pgw_ip_address) { pgw_ip_address_local_nonprim = OpenAPI_ip_address_1_parseFromJSON(pgw_ip_address); } - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(emergency_info_1JSON, "smfInstanceId"); - + smf_instance_id = cJSON_GetObjectItemCaseSensitive(emergency_info_1JSON, "smfInstanceId"); if (smf_instance_id) { - if (!cJSON_IsString(smf_instance_id)) { + if (!cJSON_IsString(smf_instance_id) && !cJSON_IsNull(smf_instance_id)) { ogs_error("OpenAPI_emergency_info_1_parseFromJSON() failed [smf_instance_id]"); goto end; } } - cJSON *epdg_ind = cJSON_GetObjectItemCaseSensitive(emergency_info_1JSON, "epdgInd"); - + epdg_ind = cJSON_GetObjectItemCaseSensitive(emergency_info_1JSON, "epdgInd"); if (epdg_ind) { if (!cJSON_IsBool(epdg_ind)) { ogs_error("OpenAPI_emergency_info_1_parseFromJSON() failed [epdg_ind]"); @@ -122,15 +134,19 @@ OpenAPI_emergency_info_1_t *OpenAPI_emergency_info_1_parseFromJSON(cJSON *emerge } emergency_info_1_local_var = OpenAPI_emergency_info_1_create ( - pgw_fqdn ? ogs_strdup(pgw_fqdn->valuestring) : NULL, + pgw_fqdn && !cJSON_IsNull(pgw_fqdn) ? ogs_strdup(pgw_fqdn->valuestring) : NULL, pgw_ip_address ? pgw_ip_address_local_nonprim : NULL, - smf_instance_id ? ogs_strdup(smf_instance_id->valuestring) : NULL, + smf_instance_id && !cJSON_IsNull(smf_instance_id) ? ogs_strdup(smf_instance_id->valuestring) : NULL, epdg_ind ? true : false, epdg_ind ? epdg_ind->valueint : 0 ); return emergency_info_1_local_var; end: + if (pgw_ip_address_local_nonprim) { + OpenAPI_ip_address_1_free(pgw_ip_address_local_nonprim); + pgw_ip_address_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/enhanced_coverage_restriction_data.c b/lib/sbi/openapi/model/enhanced_coverage_restriction_data.c index 39077c541..bab2403f1 100644 --- a/lib/sbi/openapi/model/enhanced_coverage_restriction_data.c +++ b/lib/sbi/openapi/model/enhanced_coverage_restriction_data.c @@ -18,20 +18,25 @@ OpenAPI_enhanced_coverage_restriction_data_t *OpenAPI_enhanced_coverage_restrict void OpenAPI_enhanced_coverage_restriction_data_free(OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == enhanced_coverage_restriction_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(enhanced_coverage_restriction_data->plmn_ec_info_list, node) { - OpenAPI_plmn_ec_info_free(node->data); + if (enhanced_coverage_restriction_data->plmn_ec_info_list) { + OpenAPI_list_for_each(enhanced_coverage_restriction_data->plmn_ec_info_list, node) { + OpenAPI_plmn_ec_info_free(node->data); + } + OpenAPI_list_free(enhanced_coverage_restriction_data->plmn_ec_info_list); + enhanced_coverage_restriction_data->plmn_ec_info_list = NULL; } - OpenAPI_list_free(enhanced_coverage_restriction_data->plmn_ec_info_list); ogs_free(enhanced_coverage_restriction_data); } cJSON *OpenAPI_enhanced_coverage_restriction_data_convertToJSON(OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (enhanced_coverage_restriction_data == NULL) { ogs_error("OpenAPI_enhanced_coverage_restriction_data_convertToJSON() failed [EnhancedCoverageRestrictionData]"); @@ -45,17 +50,13 @@ cJSON *OpenAPI_enhanced_coverage_restriction_data_convertToJSON(OpenAPI_enhanced ogs_error("OpenAPI_enhanced_coverage_restriction_data_convertToJSON() failed [plmn_ec_info_list]"); goto end; } - - OpenAPI_lnode_t *plmn_ec_info_list_node; - if (enhanced_coverage_restriction_data->plmn_ec_info_list) { - OpenAPI_list_for_each(enhanced_coverage_restriction_data->plmn_ec_info_list, plmn_ec_info_list_node) { - cJSON *itemLocal = OpenAPI_plmn_ec_info_convertToJSON(plmn_ec_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_enhanced_coverage_restriction_data_convertToJSON() failed [plmn_ec_info_list]"); - goto end; - } - cJSON_AddItemToArray(plmn_ec_info_listList, itemLocal); + OpenAPI_list_for_each(enhanced_coverage_restriction_data->plmn_ec_info_list, node) { + cJSON *itemLocal = OpenAPI_plmn_ec_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_enhanced_coverage_restriction_data_convertToJSON() failed [plmn_ec_info_list]"); + goto end; } + cJSON_AddItemToArray(plmn_ec_info_listList, itemLocal); } } @@ -66,33 +67,32 @@ end: OpenAPI_enhanced_coverage_restriction_data_t *OpenAPI_enhanced_coverage_restriction_data_parseFromJSON(cJSON *enhanced_coverage_restriction_dataJSON) { OpenAPI_enhanced_coverage_restriction_data_t *enhanced_coverage_restriction_data_local_var = NULL; - cJSON *plmn_ec_info_list = cJSON_GetObjectItemCaseSensitive(enhanced_coverage_restriction_dataJSON, "plmnEcInfoList"); - - OpenAPI_list_t *plmn_ec_info_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_ec_info_list = NULL; + OpenAPI_list_t *plmn_ec_info_listList = NULL; + plmn_ec_info_list = cJSON_GetObjectItemCaseSensitive(enhanced_coverage_restriction_dataJSON, "plmnEcInfoList"); if (plmn_ec_info_list) { - cJSON *plmn_ec_info_list_local_nonprimitive; - if (!cJSON_IsArray(plmn_ec_info_list)){ - ogs_error("OpenAPI_enhanced_coverage_restriction_data_parseFromJSON() failed [plmn_ec_info_list]"); - goto end; - } - - plmn_ec_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(plmn_ec_info_list_local_nonprimitive, plmn_ec_info_list ) { - if (!cJSON_IsObject(plmn_ec_info_list_local_nonprimitive)) { + cJSON *plmn_ec_info_list_local = NULL; + if (!cJSON_IsArray(plmn_ec_info_list)) { ogs_error("OpenAPI_enhanced_coverage_restriction_data_parseFromJSON() failed [plmn_ec_info_list]"); goto end; } - OpenAPI_plmn_ec_info_t *plmn_ec_info_listItem = OpenAPI_plmn_ec_info_parseFromJSON(plmn_ec_info_list_local_nonprimitive); - if (!plmn_ec_info_listItem) { - ogs_error("No plmn_ec_info_listItem"); - OpenAPI_list_free(plmn_ec_info_listList); - goto end; + plmn_ec_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_ec_info_list_local, plmn_ec_info_list) { + if (!cJSON_IsObject(plmn_ec_info_list_local)) { + ogs_error("OpenAPI_enhanced_coverage_restriction_data_parseFromJSON() failed [plmn_ec_info_list]"); + goto end; + } + OpenAPI_plmn_ec_info_t *plmn_ec_info_listItem = OpenAPI_plmn_ec_info_parseFromJSON(plmn_ec_info_list_local); + if (!plmn_ec_info_listItem) { + ogs_error("No plmn_ec_info_listItem"); + OpenAPI_list_free(plmn_ec_info_listList); + goto end; + } + OpenAPI_list_add(plmn_ec_info_listList, plmn_ec_info_listItem); } - - OpenAPI_list_add(plmn_ec_info_listList, plmn_ec_info_listItem); - } } enhanced_coverage_restriction_data_local_var = OpenAPI_enhanced_coverage_restriction_data_create ( @@ -101,6 +101,13 @@ OpenAPI_enhanced_coverage_restriction_data_t *OpenAPI_enhanced_coverage_restrict return enhanced_coverage_restriction_data_local_var; end: + if (plmn_ec_info_listList) { + OpenAPI_list_for_each(plmn_ec_info_listList, node) { + OpenAPI_plmn_ec_info_free(node->data); + } + OpenAPI_list_free(plmn_ec_info_listList); + plmn_ec_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/eps_bearer_info.c b/lib/sbi/openapi/model/eps_bearer_info.c index 81e9d3c5d..1935468a5 100644 --- a/lib/sbi/openapi/model/eps_bearer_info.c +++ b/lib/sbi/openapi/model/eps_bearer_info.c @@ -6,8 +6,8 @@ OpenAPI_eps_bearer_info_t *OpenAPI_eps_bearer_info_create( int ebi, - char pgw_s8u_fteid, - char bearer_level_qo_s + char *pgw_s8u_fteid, + char *bearer_level_qo_s ) { OpenAPI_eps_bearer_info_t *eps_bearer_info_local_var = ogs_malloc(sizeof(OpenAPI_eps_bearer_info_t)); @@ -22,16 +22,26 @@ OpenAPI_eps_bearer_info_t *OpenAPI_eps_bearer_info_create( void OpenAPI_eps_bearer_info_free(OpenAPI_eps_bearer_info_t *eps_bearer_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == eps_bearer_info) { return; } - OpenAPI_lnode_t *node; + if (eps_bearer_info->pgw_s8u_fteid) { + ogs_free(eps_bearer_info->pgw_s8u_fteid); + eps_bearer_info->pgw_s8u_fteid = NULL; + } + if (eps_bearer_info->bearer_level_qo_s) { + ogs_free(eps_bearer_info->bearer_level_qo_s); + eps_bearer_info->bearer_level_qo_s = NULL; + } ogs_free(eps_bearer_info); } cJSON *OpenAPI_eps_bearer_info_convertToJSON(OpenAPI_eps_bearer_info_t *eps_bearer_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (eps_bearer_info == NULL) { ogs_error("OpenAPI_eps_bearer_info_convertToJSON() failed [EpsBearerInfo]"); @@ -44,12 +54,20 @@ cJSON *OpenAPI_eps_bearer_info_convertToJSON(OpenAPI_eps_bearer_info_t *eps_bear goto end; } - if (cJSON_AddNumberToObject(item, "pgwS8uFteid", eps_bearer_info->pgw_s8u_fteid) == NULL) { + if (!eps_bearer_info->pgw_s8u_fteid) { + ogs_error("OpenAPI_eps_bearer_info_convertToJSON() failed [pgw_s8u_fteid]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "pgwS8uFteid", eps_bearer_info->pgw_s8u_fteid) == NULL) { ogs_error("OpenAPI_eps_bearer_info_convertToJSON() failed [pgw_s8u_fteid]"); goto end; } - if (cJSON_AddNumberToObject(item, "bearerLevelQoS", eps_bearer_info->bearer_level_qo_s) == NULL) { + if (!eps_bearer_info->bearer_level_qo_s) { + ogs_error("OpenAPI_eps_bearer_info_convertToJSON() failed [bearer_level_qo_s]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "bearerLevelQoS", eps_bearer_info->bearer_level_qo_s) == NULL) { ogs_error("OpenAPI_eps_bearer_info_convertToJSON() failed [bearer_level_qo_s]"); goto end; } @@ -61,35 +79,36 @@ end: OpenAPI_eps_bearer_info_t *OpenAPI_eps_bearer_info_parseFromJSON(cJSON *eps_bearer_infoJSON) { OpenAPI_eps_bearer_info_t *eps_bearer_info_local_var = NULL; - cJSON *ebi = cJSON_GetObjectItemCaseSensitive(eps_bearer_infoJSON, "ebi"); + OpenAPI_lnode_t *node = NULL; + cJSON *ebi = NULL; + cJSON *pgw_s8u_fteid = NULL; + cJSON *bearer_level_qo_s = NULL; + ebi = cJSON_GetObjectItemCaseSensitive(eps_bearer_infoJSON, "ebi"); if (!ebi) { ogs_error("OpenAPI_eps_bearer_info_parseFromJSON() failed [ebi]"); goto end; } - if (!cJSON_IsNumber(ebi)) { ogs_error("OpenAPI_eps_bearer_info_parseFromJSON() failed [ebi]"); goto end; } - cJSON *pgw_s8u_fteid = cJSON_GetObjectItemCaseSensitive(eps_bearer_infoJSON, "pgwS8uFteid"); + pgw_s8u_fteid = cJSON_GetObjectItemCaseSensitive(eps_bearer_infoJSON, "pgwS8uFteid"); if (!pgw_s8u_fteid) { ogs_error("OpenAPI_eps_bearer_info_parseFromJSON() failed [pgw_s8u_fteid]"); goto end; } - - if (!cJSON_IsNumber(pgw_s8u_fteid)) { + if (!cJSON_IsString(pgw_s8u_fteid)) { ogs_error("OpenAPI_eps_bearer_info_parseFromJSON() failed [pgw_s8u_fteid]"); goto end; } - cJSON *bearer_level_qo_s = cJSON_GetObjectItemCaseSensitive(eps_bearer_infoJSON, "bearerLevelQoS"); + bearer_level_qo_s = cJSON_GetObjectItemCaseSensitive(eps_bearer_infoJSON, "bearerLevelQoS"); if (!bearer_level_qo_s) { ogs_error("OpenAPI_eps_bearer_info_parseFromJSON() failed [bearer_level_qo_s]"); goto end; } - - if (!cJSON_IsNumber(bearer_level_qo_s)) { + if (!cJSON_IsString(bearer_level_qo_s)) { ogs_error("OpenAPI_eps_bearer_info_parseFromJSON() failed [bearer_level_qo_s]"); goto end; } @@ -97,8 +116,8 @@ OpenAPI_eps_bearer_info_t *OpenAPI_eps_bearer_info_parseFromJSON(cJSON *eps_bear eps_bearer_info_local_var = OpenAPI_eps_bearer_info_create ( ebi->valuedouble, - pgw_s8u_fteid->valueint, - bearer_level_qo_s->valueint + ogs_strdup(pgw_s8u_fteid->valuestring), + ogs_strdup(bearer_level_qo_s->valuestring) ); return eps_bearer_info_local_var; diff --git a/lib/sbi/openapi/model/eps_bearer_info.h b/lib/sbi/openapi/model/eps_bearer_info.h index 9a7e37f3c..b9c11a7b2 100644 --- a/lib/sbi/openapi/model/eps_bearer_info.h +++ b/lib/sbi/openapi/model/eps_bearer_info.h @@ -20,14 +20,14 @@ extern "C" { typedef struct OpenAPI_eps_bearer_info_s OpenAPI_eps_bearer_info_t; typedef struct OpenAPI_eps_bearer_info_s { int ebi; - char pgw_s8u_fteid; - char bearer_level_qo_s; + char *pgw_s8u_fteid; + char *bearer_level_qo_s; } OpenAPI_eps_bearer_info_t; OpenAPI_eps_bearer_info_t *OpenAPI_eps_bearer_info_create( int ebi, - char pgw_s8u_fteid, - char bearer_level_qo_s + char *pgw_s8u_fteid, + char *bearer_level_qo_s ); void OpenAPI_eps_bearer_info_free(OpenAPI_eps_bearer_info_t *eps_bearer_info); OpenAPI_eps_bearer_info_t *OpenAPI_eps_bearer_info_parseFromJSON(cJSON *eps_bearer_infoJSON); diff --git a/lib/sbi/openapi/model/eps_interworking_info.c b/lib/sbi/openapi/model/eps_interworking_info.c index 4a56aadb1..13891727c 100644 --- a/lib/sbi/openapi/model/eps_interworking_info.c +++ b/lib/sbi/openapi/model/eps_interworking_info.c @@ -18,23 +18,28 @@ OpenAPI_eps_interworking_info_t *OpenAPI_eps_interworking_info_create( void OpenAPI_eps_interworking_info_free(OpenAPI_eps_interworking_info_t *eps_interworking_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == eps_interworking_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(eps_interworking_info->eps_iwk_pgws, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_eps_iwk_pgw_free(localKeyValue->value); - ogs_free(localKeyValue); + if (eps_interworking_info->eps_iwk_pgws) { + OpenAPI_list_for_each(eps_interworking_info->eps_iwk_pgws, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_eps_iwk_pgw_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(eps_interworking_info->eps_iwk_pgws); + eps_interworking_info->eps_iwk_pgws = NULL; } - OpenAPI_list_free(eps_interworking_info->eps_iwk_pgws); ogs_free(eps_interworking_info); } cJSON *OpenAPI_eps_interworking_info_convertToJSON(OpenAPI_eps_interworking_info_t *eps_interworking_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (eps_interworking_info == NULL) { ogs_error("OpenAPI_eps_interworking_info_convertToJSON() failed [EpsInterworkingInfo]"); @@ -49,21 +54,20 @@ cJSON *OpenAPI_eps_interworking_info_convertToJSON(OpenAPI_eps_interworking_info goto end; } cJSON *localMapObject = eps_iwk_pgws; - OpenAPI_lnode_t *eps_iwk_pgws_node; if (eps_interworking_info->eps_iwk_pgws) { - OpenAPI_list_for_each(eps_interworking_info->eps_iwk_pgws, eps_iwk_pgws_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)eps_iwk_pgws_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_eps_iwk_pgw_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_eps_interworking_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(eps_interworking_info->eps_iwk_pgws, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_eps_iwk_pgw_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_eps_interworking_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -72,30 +76,33 @@ end: OpenAPI_eps_interworking_info_t *OpenAPI_eps_interworking_info_parseFromJSON(cJSON *eps_interworking_infoJSON) { OpenAPI_eps_interworking_info_t *eps_interworking_info_local_var = NULL; - cJSON *eps_iwk_pgws = cJSON_GetObjectItemCaseSensitive(eps_interworking_infoJSON, "epsIwkPgws"); - - OpenAPI_list_t *eps_iwk_pgwsList; + OpenAPI_lnode_t *node = NULL; + cJSON *eps_iwk_pgws = NULL; + OpenAPI_list_t *eps_iwk_pgwsList = NULL; + eps_iwk_pgws = cJSON_GetObjectItemCaseSensitive(eps_interworking_infoJSON, "epsIwkPgws"); if (eps_iwk_pgws) { - cJSON *eps_iwk_pgws_local_map; - if (!cJSON_IsObject(eps_iwk_pgws)) { - ogs_error("OpenAPI_eps_interworking_info_parseFromJSON() failed [eps_iwk_pgws]"); - goto end; - } - eps_iwk_pgwsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(eps_iwk_pgws_local_map, eps_iwk_pgws) { - cJSON *localMapObject = eps_iwk_pgws_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_eps_iwk_pgw_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_eps_interworking_info_parseFromJSON() failed [inner]"); + cJSON *eps_iwk_pgws_local_map = NULL; + if (!cJSON_IsObject(eps_iwk_pgws) && !cJSON_IsNull(eps_iwk_pgws)) { + ogs_error("OpenAPI_eps_interworking_info_parseFromJSON() failed [eps_iwk_pgws]"); goto end; } - OpenAPI_list_add(eps_iwk_pgwsList, localMapKeyPair); - } + if (cJSON_IsObject(eps_iwk_pgws)) { + eps_iwk_pgwsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(eps_iwk_pgws_local_map, eps_iwk_pgws) { + cJSON *localMapObject = eps_iwk_pgws_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_eps_iwk_pgw_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_eps_interworking_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(eps_iwk_pgwsList, localMapKeyPair); + } + } } eps_interworking_info_local_var = OpenAPI_eps_interworking_info_create ( @@ -104,6 +111,16 @@ OpenAPI_eps_interworking_info_t *OpenAPI_eps_interworking_info_parseFromJSON(cJS return eps_interworking_info_local_var; end: + if (eps_iwk_pgwsList) { + OpenAPI_list_for_each(eps_iwk_pgwsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_eps_iwk_pgw_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(eps_iwk_pgwsList); + eps_iwk_pgwsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/eps_iwk_pgw.c b/lib/sbi/openapi/model/eps_iwk_pgw.c index a5fbe4fcd..5a093c17e 100644 --- a/lib/sbi/openapi/model/eps_iwk_pgw.c +++ b/lib/sbi/openapi/model/eps_iwk_pgw.c @@ -20,18 +20,26 @@ OpenAPI_eps_iwk_pgw_t *OpenAPI_eps_iwk_pgw_create( void OpenAPI_eps_iwk_pgw_free(OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw) { + OpenAPI_lnode_t *node = NULL; + if (NULL == eps_iwk_pgw) { return; } - OpenAPI_lnode_t *node; - ogs_free(eps_iwk_pgw->pgw_fqdn); - ogs_free(eps_iwk_pgw->smf_instance_id); + if (eps_iwk_pgw->pgw_fqdn) { + ogs_free(eps_iwk_pgw->pgw_fqdn); + eps_iwk_pgw->pgw_fqdn = NULL; + } + if (eps_iwk_pgw->smf_instance_id) { + ogs_free(eps_iwk_pgw->smf_instance_id); + eps_iwk_pgw->smf_instance_id = NULL; + } ogs_free(eps_iwk_pgw); } cJSON *OpenAPI_eps_iwk_pgw_convertToJSON(OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (eps_iwk_pgw == NULL) { ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [EpsIwkPgw]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_eps_iwk_pgw_convertToJSON(OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw) } item = cJSON_CreateObject(); + if (!eps_iwk_pgw->pgw_fqdn) { + ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [pgw_fqdn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "pgwFqdn", eps_iwk_pgw->pgw_fqdn) == NULL) { ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [pgw_fqdn]"); goto end; } + if (!eps_iwk_pgw->smf_instance_id) { + ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [smf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smfInstanceId", eps_iwk_pgw->smf_instance_id) == NULL) { ogs_error("OpenAPI_eps_iwk_pgw_convertToJSON() failed [smf_instance_id]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_eps_iwk_pgw_t *OpenAPI_eps_iwk_pgw_parseFromJSON(cJSON *eps_iwk_pgwJSON) { OpenAPI_eps_iwk_pgw_t *eps_iwk_pgw_local_var = NULL; - cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(eps_iwk_pgwJSON, "pgwFqdn"); + OpenAPI_lnode_t *node = NULL; + cJSON *pgw_fqdn = NULL; + cJSON *smf_instance_id = NULL; + pgw_fqdn = cJSON_GetObjectItemCaseSensitive(eps_iwk_pgwJSON, "pgwFqdn"); if (!pgw_fqdn) { ogs_error("OpenAPI_eps_iwk_pgw_parseFromJSON() failed [pgw_fqdn]"); goto end; } - if (!cJSON_IsString(pgw_fqdn)) { ogs_error("OpenAPI_eps_iwk_pgw_parseFromJSON() failed [pgw_fqdn]"); goto end; } - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(eps_iwk_pgwJSON, "smfInstanceId"); + smf_instance_id = cJSON_GetObjectItemCaseSensitive(eps_iwk_pgwJSON, "smfInstanceId"); if (!smf_instance_id) { ogs_error("OpenAPI_eps_iwk_pgw_parseFromJSON() failed [smf_instance_id]"); goto end; } - if (!cJSON_IsString(smf_instance_id)) { ogs_error("OpenAPI_eps_iwk_pgw_parseFromJSON() failed [smf_instance_id]"); goto end; diff --git a/lib/sbi/openapi/model/eps_nas_security_mode.c b/lib/sbi/openapi/model/eps_nas_security_mode.c index 58fd2fc17..aa2d9299c 100644 --- a/lib/sbi/openapi/model/eps_nas_security_mode.c +++ b/lib/sbi/openapi/model/eps_nas_security_mode.c @@ -20,16 +20,18 @@ OpenAPI_eps_nas_security_mode_t *OpenAPI_eps_nas_security_mode_create( void OpenAPI_eps_nas_security_mode_free(OpenAPI_eps_nas_security_mode_t *eps_nas_security_mode) { + OpenAPI_lnode_t *node = NULL; + if (NULL == eps_nas_security_mode) { return; } - OpenAPI_lnode_t *node; ogs_free(eps_nas_security_mode); } cJSON *OpenAPI_eps_nas_security_mode_convertToJSON(OpenAPI_eps_nas_security_mode_t *eps_nas_security_mode) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (eps_nas_security_mode == NULL) { ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [EpsNasSecurityMode]"); @@ -37,11 +39,19 @@ cJSON *OpenAPI_eps_nas_security_mode_convertToJSON(OpenAPI_eps_nas_security_mode } item = cJSON_CreateObject(); + if (eps_nas_security_mode->integrity_algorithm == OpenAPI_eps_nas_integrity_algorithm_NULL) { + ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [integrity_algorithm]"); + return NULL; + } if (cJSON_AddStringToObject(item, "integrityAlgorithm", OpenAPI_eps_nas_integrity_algorithm_ToString(eps_nas_security_mode->integrity_algorithm)) == NULL) { ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [integrity_algorithm]"); goto end; } + if (eps_nas_security_mode->ciphering_algorithm == OpenAPI_eps_nas_ciphering_algorithm_NULL) { + ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [ciphering_algorithm]"); + return NULL; + } if (cJSON_AddStringToObject(item, "cipheringAlgorithm", OpenAPI_eps_nas_ciphering_algorithm_ToString(eps_nas_security_mode->ciphering_algorithm)) == NULL) { ogs_error("OpenAPI_eps_nas_security_mode_convertToJSON() failed [ciphering_algorithm]"); goto end; @@ -54,26 +64,27 @@ end: OpenAPI_eps_nas_security_mode_t *OpenAPI_eps_nas_security_mode_parseFromJSON(cJSON *eps_nas_security_modeJSON) { OpenAPI_eps_nas_security_mode_t *eps_nas_security_mode_local_var = NULL; - cJSON *integrity_algorithm = cJSON_GetObjectItemCaseSensitive(eps_nas_security_modeJSON, "integrityAlgorithm"); + OpenAPI_lnode_t *node = NULL; + cJSON *integrity_algorithm = NULL; + OpenAPI_eps_nas_integrity_algorithm_e integrity_algorithmVariable = 0; + cJSON *ciphering_algorithm = NULL; + OpenAPI_eps_nas_ciphering_algorithm_e ciphering_algorithmVariable = 0; + integrity_algorithm = cJSON_GetObjectItemCaseSensitive(eps_nas_security_modeJSON, "integrityAlgorithm"); if (!integrity_algorithm) { ogs_error("OpenAPI_eps_nas_security_mode_parseFromJSON() failed [integrity_algorithm]"); goto end; } - - OpenAPI_eps_nas_integrity_algorithm_e integrity_algorithmVariable; if (!cJSON_IsString(integrity_algorithm)) { ogs_error("OpenAPI_eps_nas_security_mode_parseFromJSON() failed [integrity_algorithm]"); goto end; } integrity_algorithmVariable = OpenAPI_eps_nas_integrity_algorithm_FromString(integrity_algorithm->valuestring); - cJSON *ciphering_algorithm = cJSON_GetObjectItemCaseSensitive(eps_nas_security_modeJSON, "cipheringAlgorithm"); + ciphering_algorithm = cJSON_GetObjectItemCaseSensitive(eps_nas_security_modeJSON, "cipheringAlgorithm"); if (!ciphering_algorithm) { ogs_error("OpenAPI_eps_nas_security_mode_parseFromJSON() failed [ciphering_algorithm]"); goto end; } - - OpenAPI_eps_nas_ciphering_algorithm_e ciphering_algorithmVariable; if (!cJSON_IsString(ciphering_algorithm)) { ogs_error("OpenAPI_eps_nas_security_mode_parseFromJSON() failed [ciphering_algorithm]"); goto end; diff --git a/lib/sbi/openapi/model/eps_pdn_cnx_info.c b/lib/sbi/openapi/model/eps_pdn_cnx_info.c index 7363686ad..b9fb35d41 100644 --- a/lib/sbi/openapi/model/eps_pdn_cnx_info.c +++ b/lib/sbi/openapi/model/eps_pdn_cnx_info.c @@ -5,8 +5,8 @@ #include "eps_pdn_cnx_info.h" OpenAPI_eps_pdn_cnx_info_t *OpenAPI_eps_pdn_cnx_info_create( - char pgw_s8c_fteid, - char pgw_node_name, + char *pgw_s8c_fteid, + char *pgw_node_name, bool is_linked_bearer_id, int linked_bearer_id ) @@ -24,16 +24,26 @@ OpenAPI_eps_pdn_cnx_info_t *OpenAPI_eps_pdn_cnx_info_create( void OpenAPI_eps_pdn_cnx_info_free(OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == eps_pdn_cnx_info) { return; } - OpenAPI_lnode_t *node; + if (eps_pdn_cnx_info->pgw_s8c_fteid) { + ogs_free(eps_pdn_cnx_info->pgw_s8c_fteid); + eps_pdn_cnx_info->pgw_s8c_fteid = NULL; + } + if (eps_pdn_cnx_info->pgw_node_name) { + ogs_free(eps_pdn_cnx_info->pgw_node_name); + eps_pdn_cnx_info->pgw_node_name = NULL; + } ogs_free(eps_pdn_cnx_info); } cJSON *OpenAPI_eps_pdn_cnx_info_convertToJSON(OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (eps_pdn_cnx_info == NULL) { ogs_error("OpenAPI_eps_pdn_cnx_info_convertToJSON() failed [EpsPdnCnxInfo]"); @@ -41,13 +51,17 @@ cJSON *OpenAPI_eps_pdn_cnx_info_convertToJSON(OpenAPI_eps_pdn_cnx_info_t *eps_pd } item = cJSON_CreateObject(); - if (cJSON_AddNumberToObject(item, "pgwS8cFteid", eps_pdn_cnx_info->pgw_s8c_fteid) == NULL) { + if (!eps_pdn_cnx_info->pgw_s8c_fteid) { + ogs_error("OpenAPI_eps_pdn_cnx_info_convertToJSON() failed [pgw_s8c_fteid]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "pgwS8cFteid", eps_pdn_cnx_info->pgw_s8c_fteid) == NULL) { ogs_error("OpenAPI_eps_pdn_cnx_info_convertToJSON() failed [pgw_s8c_fteid]"); goto end; } if (eps_pdn_cnx_info->pgw_node_name) { - if (cJSON_AddNumberToObject(item, "pgwNodeName", eps_pdn_cnx_info->pgw_node_name) == NULL) { + if (cJSON_AddStringToObject(item, "pgwNodeName", eps_pdn_cnx_info->pgw_node_name) == NULL) { ogs_error("OpenAPI_eps_pdn_cnx_info_convertToJSON() failed [pgw_node_name]"); goto end; } @@ -67,28 +81,29 @@ end: OpenAPI_eps_pdn_cnx_info_t *OpenAPI_eps_pdn_cnx_info_parseFromJSON(cJSON *eps_pdn_cnx_infoJSON) { OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_var = NULL; - cJSON *pgw_s8c_fteid = cJSON_GetObjectItemCaseSensitive(eps_pdn_cnx_infoJSON, "pgwS8cFteid"); + OpenAPI_lnode_t *node = NULL; + cJSON *pgw_s8c_fteid = NULL; + cJSON *pgw_node_name = NULL; + cJSON *linked_bearer_id = NULL; + pgw_s8c_fteid = cJSON_GetObjectItemCaseSensitive(eps_pdn_cnx_infoJSON, "pgwS8cFteid"); if (!pgw_s8c_fteid) { ogs_error("OpenAPI_eps_pdn_cnx_info_parseFromJSON() failed [pgw_s8c_fteid]"); goto end; } - - if (!cJSON_IsNumber(pgw_s8c_fteid)) { + if (!cJSON_IsString(pgw_s8c_fteid)) { ogs_error("OpenAPI_eps_pdn_cnx_info_parseFromJSON() failed [pgw_s8c_fteid]"); goto end; } - cJSON *pgw_node_name = cJSON_GetObjectItemCaseSensitive(eps_pdn_cnx_infoJSON, "pgwNodeName"); - + pgw_node_name = cJSON_GetObjectItemCaseSensitive(eps_pdn_cnx_infoJSON, "pgwNodeName"); if (pgw_node_name) { - if (!cJSON_IsNumber(pgw_node_name)) { + if (!cJSON_IsString(pgw_node_name) && !cJSON_IsNull(pgw_node_name)) { ogs_error("OpenAPI_eps_pdn_cnx_info_parseFromJSON() failed [pgw_node_name]"); goto end; } } - cJSON *linked_bearer_id = cJSON_GetObjectItemCaseSensitive(eps_pdn_cnx_infoJSON, "linkedBearerId"); - + linked_bearer_id = cJSON_GetObjectItemCaseSensitive(eps_pdn_cnx_infoJSON, "linkedBearerId"); if (linked_bearer_id) { if (!cJSON_IsNumber(linked_bearer_id)) { ogs_error("OpenAPI_eps_pdn_cnx_info_parseFromJSON() failed [linked_bearer_id]"); @@ -97,8 +112,8 @@ OpenAPI_eps_pdn_cnx_info_t *OpenAPI_eps_pdn_cnx_info_parseFromJSON(cJSON *eps_pd } eps_pdn_cnx_info_local_var = OpenAPI_eps_pdn_cnx_info_create ( - pgw_s8c_fteid->valueint, - pgw_node_name ? pgw_node_name->valueint : 0, + ogs_strdup(pgw_s8c_fteid->valuestring), + pgw_node_name && !cJSON_IsNull(pgw_node_name) ? ogs_strdup(pgw_node_name->valuestring) : NULL, linked_bearer_id ? true : false, linked_bearer_id ? linked_bearer_id->valuedouble : 0 ); diff --git a/lib/sbi/openapi/model/eps_pdn_cnx_info.h b/lib/sbi/openapi/model/eps_pdn_cnx_info.h index b94eeb5a8..2722da600 100644 --- a/lib/sbi/openapi/model/eps_pdn_cnx_info.h +++ b/lib/sbi/openapi/model/eps_pdn_cnx_info.h @@ -19,15 +19,15 @@ extern "C" { typedef struct OpenAPI_eps_pdn_cnx_info_s OpenAPI_eps_pdn_cnx_info_t; typedef struct OpenAPI_eps_pdn_cnx_info_s { - char pgw_s8c_fteid; - char pgw_node_name; + char *pgw_s8c_fteid; + char *pgw_node_name; bool is_linked_bearer_id; int linked_bearer_id; } OpenAPI_eps_pdn_cnx_info_t; OpenAPI_eps_pdn_cnx_info_t *OpenAPI_eps_pdn_cnx_info_create( - char pgw_s8c_fteid, - char pgw_node_name, + char *pgw_s8c_fteid, + char *pgw_node_name, bool is_linked_bearer_id, int linked_bearer_id ); diff --git a/lib/sbi/openapi/model/error_report.c b/lib/sbi/openapi/model/error_report.c index a56923af3..7cbf0bc94 100644 --- a/lib/sbi/openapi/model/error_report.c +++ b/lib/sbi/openapi/model/error_report.c @@ -26,27 +26,44 @@ OpenAPI_error_report_t *OpenAPI_error_report_create( void OpenAPI_error_report_free(OpenAPI_error_report_t *error_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == error_report) { return; } - OpenAPI_lnode_t *node; - OpenAPI_problem_details_free(error_report->error); - OpenAPI_list_for_each(error_report->rule_reports, node) { - OpenAPI_rule_report_free(node->data); + if (error_report->error) { + OpenAPI_problem_details_free(error_report->error); + error_report->error = NULL; } - OpenAPI_list_free(error_report->rule_reports); - OpenAPI_list_for_each(error_report->sess_rule_reports, node) { - OpenAPI_session_rule_report_free(node->data); + if (error_report->rule_reports) { + OpenAPI_list_for_each(error_report->rule_reports, node) { + OpenAPI_rule_report_free(node->data); + } + OpenAPI_list_free(error_report->rule_reports); + error_report->rule_reports = NULL; + } + if (error_report->sess_rule_reports) { + OpenAPI_list_for_each(error_report->sess_rule_reports, node) { + OpenAPI_session_rule_report_free(node->data); + } + OpenAPI_list_free(error_report->sess_rule_reports); + error_report->sess_rule_reports = NULL; + } + if (error_report->pol_dec_failure_reports) { + OpenAPI_list_free(error_report->pol_dec_failure_reports); + error_report->pol_dec_failure_reports = NULL; + } + if (error_report->alt_qos_param_id) { + ogs_free(error_report->alt_qos_param_id); + error_report->alt_qos_param_id = NULL; } - OpenAPI_list_free(error_report->sess_rule_reports); - OpenAPI_list_free(error_report->pol_dec_failure_reports); - ogs_free(error_report->alt_qos_param_id); ogs_free(error_report); } cJSON *OpenAPI_error_report_convertToJSON(OpenAPI_error_report_t *error_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (error_report == NULL) { ogs_error("OpenAPI_error_report_convertToJSON() failed [ErrorReport]"); @@ -73,17 +90,13 @@ cJSON *OpenAPI_error_report_convertToJSON(OpenAPI_error_report_t *error_report) ogs_error("OpenAPI_error_report_convertToJSON() failed [rule_reports]"); goto end; } - - OpenAPI_lnode_t *rule_reports_node; - if (error_report->rule_reports) { - OpenAPI_list_for_each(error_report->rule_reports, rule_reports_node) { - cJSON *itemLocal = OpenAPI_rule_report_convertToJSON(rule_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_error_report_convertToJSON() failed [rule_reports]"); - goto end; - } - cJSON_AddItemToArray(rule_reportsList, itemLocal); + OpenAPI_list_for_each(error_report->rule_reports, node) { + cJSON *itemLocal = OpenAPI_rule_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_error_report_convertToJSON() failed [rule_reports]"); + goto end; } + cJSON_AddItemToArray(rule_reportsList, itemLocal); } } @@ -93,29 +106,24 @@ cJSON *OpenAPI_error_report_convertToJSON(OpenAPI_error_report_t *error_report) ogs_error("OpenAPI_error_report_convertToJSON() failed [sess_rule_reports]"); goto end; } - - OpenAPI_lnode_t *sess_rule_reports_node; - if (error_report->sess_rule_reports) { - OpenAPI_list_for_each(error_report->sess_rule_reports, sess_rule_reports_node) { - cJSON *itemLocal = OpenAPI_session_rule_report_convertToJSON(sess_rule_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_error_report_convertToJSON() failed [sess_rule_reports]"); - goto end; - } - cJSON_AddItemToArray(sess_rule_reportsList, itemLocal); + OpenAPI_list_for_each(error_report->sess_rule_reports, node) { + cJSON *itemLocal = OpenAPI_session_rule_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_error_report_convertToJSON() failed [sess_rule_reports]"); + goto end; } + cJSON_AddItemToArray(sess_rule_reportsList, itemLocal); } } - if (error_report->pol_dec_failure_reports) { - cJSON *pol_dec_failure_reports = cJSON_AddArrayToObject(item, "polDecFailureReports"); - if (pol_dec_failure_reports == NULL) { + if (error_report->pol_dec_failure_reports != OpenAPI_policy_decision_failure_code_NULL) { + cJSON *pol_dec_failure_reportsList = cJSON_AddArrayToObject(item, "polDecFailureReports"); + if (pol_dec_failure_reportsList == NULL) { ogs_error("OpenAPI_error_report_convertToJSON() failed [pol_dec_failure_reports]"); goto end; } - OpenAPI_lnode_t *pol_dec_failure_reports_node; - OpenAPI_list_for_each(error_report->pol_dec_failure_reports, pol_dec_failure_reports_node) { - if (cJSON_AddStringToObject(pol_dec_failure_reports, "", OpenAPI_policy_decision_failure_code_ToString((intptr_t)pol_dec_failure_reports_node->data)) == NULL) { + OpenAPI_list_for_each(error_report->pol_dec_failure_reports, node) { + if (cJSON_AddStringToObject(pol_dec_failure_reportsList, "", OpenAPI_policy_decision_failure_code_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_error_report_convertToJSON() failed [pol_dec_failure_reports]"); goto end; } @@ -136,97 +144,93 @@ end: OpenAPI_error_report_t *OpenAPI_error_report_parseFromJSON(cJSON *error_reportJSON) { OpenAPI_error_report_t *error_report_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "error"); - + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; OpenAPI_problem_details_t *error_local_nonprim = NULL; + cJSON *rule_reports = NULL; + OpenAPI_list_t *rule_reportsList = NULL; + cJSON *sess_rule_reports = NULL; + OpenAPI_list_t *sess_rule_reportsList = NULL; + cJSON *pol_dec_failure_reports = NULL; + OpenAPI_list_t *pol_dec_failure_reportsList = NULL; + cJSON *alt_qos_param_id = NULL; + error = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "error"); if (error) { error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error); } - cJSON *rule_reports = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "ruleReports"); - - OpenAPI_list_t *rule_reportsList; + rule_reports = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "ruleReports"); if (rule_reports) { - cJSON *rule_reports_local_nonprimitive; - if (!cJSON_IsArray(rule_reports)){ - ogs_error("OpenAPI_error_report_parseFromJSON() failed [rule_reports]"); - goto end; - } - - rule_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rule_reports_local_nonprimitive, rule_reports ) { - if (!cJSON_IsObject(rule_reports_local_nonprimitive)) { + cJSON *rule_reports_local = NULL; + if (!cJSON_IsArray(rule_reports)) { ogs_error("OpenAPI_error_report_parseFromJSON() failed [rule_reports]"); goto end; } - OpenAPI_rule_report_t *rule_reportsItem = OpenAPI_rule_report_parseFromJSON(rule_reports_local_nonprimitive); - if (!rule_reportsItem) { - ogs_error("No rule_reportsItem"); - OpenAPI_list_free(rule_reportsList); - goto end; + rule_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rule_reports_local, rule_reports) { + if (!cJSON_IsObject(rule_reports_local)) { + ogs_error("OpenAPI_error_report_parseFromJSON() failed [rule_reports]"); + goto end; + } + OpenAPI_rule_report_t *rule_reportsItem = OpenAPI_rule_report_parseFromJSON(rule_reports_local); + if (!rule_reportsItem) { + ogs_error("No rule_reportsItem"); + OpenAPI_list_free(rule_reportsList); + goto end; + } + OpenAPI_list_add(rule_reportsList, rule_reportsItem); } - - OpenAPI_list_add(rule_reportsList, rule_reportsItem); - } } - cJSON *sess_rule_reports = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "sessRuleReports"); - - OpenAPI_list_t *sess_rule_reportsList; + sess_rule_reports = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "sessRuleReports"); if (sess_rule_reports) { - cJSON *sess_rule_reports_local_nonprimitive; - if (!cJSON_IsArray(sess_rule_reports)){ - ogs_error("OpenAPI_error_report_parseFromJSON() failed [sess_rule_reports]"); - goto end; - } - - sess_rule_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sess_rule_reports_local_nonprimitive, sess_rule_reports ) { - if (!cJSON_IsObject(sess_rule_reports_local_nonprimitive)) { + cJSON *sess_rule_reports_local = NULL; + if (!cJSON_IsArray(sess_rule_reports)) { ogs_error("OpenAPI_error_report_parseFromJSON() failed [sess_rule_reports]"); goto end; } - OpenAPI_session_rule_report_t *sess_rule_reportsItem = OpenAPI_session_rule_report_parseFromJSON(sess_rule_reports_local_nonprimitive); - if (!sess_rule_reportsItem) { - ogs_error("No sess_rule_reportsItem"); - OpenAPI_list_free(sess_rule_reportsList); - goto end; + sess_rule_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sess_rule_reports_local, sess_rule_reports) { + if (!cJSON_IsObject(sess_rule_reports_local)) { + ogs_error("OpenAPI_error_report_parseFromJSON() failed [sess_rule_reports]"); + goto end; + } + OpenAPI_session_rule_report_t *sess_rule_reportsItem = OpenAPI_session_rule_report_parseFromJSON(sess_rule_reports_local); + if (!sess_rule_reportsItem) { + ogs_error("No sess_rule_reportsItem"); + OpenAPI_list_free(sess_rule_reportsList); + goto end; + } + OpenAPI_list_add(sess_rule_reportsList, sess_rule_reportsItem); } - - OpenAPI_list_add(sess_rule_reportsList, sess_rule_reportsItem); - } } - cJSON *pol_dec_failure_reports = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "polDecFailureReports"); - - OpenAPI_list_t *pol_dec_failure_reportsList; + pol_dec_failure_reports = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "polDecFailureReports"); if (pol_dec_failure_reports) { - cJSON *pol_dec_failure_reports_local_nonprimitive; - if (!cJSON_IsArray(pol_dec_failure_reports)) { - ogs_error("OpenAPI_error_report_parseFromJSON() failed [pol_dec_failure_reports]"); - goto end; - } - - pol_dec_failure_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pol_dec_failure_reports_local_nonprimitive, pol_dec_failure_reports ) { - if (!cJSON_IsString(pol_dec_failure_reports_local_nonprimitive)){ + cJSON *pol_dec_failure_reports_local = NULL; + if (!cJSON_IsArray(pol_dec_failure_reports)) { ogs_error("OpenAPI_error_report_parseFromJSON() failed [pol_dec_failure_reports]"); goto end; } - OpenAPI_list_add(pol_dec_failure_reportsList, (void *)OpenAPI_policy_decision_failure_code_FromString(pol_dec_failure_reports_local_nonprimitive->valuestring)); - } + pol_dec_failure_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pol_dec_failure_reports_local, pol_dec_failure_reports) { + if (!cJSON_IsString(pol_dec_failure_reports_local)) { + ogs_error("OpenAPI_error_report_parseFromJSON() failed [pol_dec_failure_reports]"); + goto end; + } + OpenAPI_list_add(pol_dec_failure_reportsList, (void *)OpenAPI_policy_decision_failure_code_FromString(pol_dec_failure_reports_local->valuestring)); + } } - cJSON *alt_qos_param_id = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "altQosParamId"); - + alt_qos_param_id = cJSON_GetObjectItemCaseSensitive(error_reportJSON, "altQosParamId"); if (alt_qos_param_id) { - if (!cJSON_IsString(alt_qos_param_id)) { + if (!cJSON_IsString(alt_qos_param_id) && !cJSON_IsNull(alt_qos_param_id)) { ogs_error("OpenAPI_error_report_parseFromJSON() failed [alt_qos_param_id]"); goto end; } @@ -237,11 +241,33 @@ OpenAPI_error_report_t *OpenAPI_error_report_parseFromJSON(cJSON *error_reportJS rule_reports ? rule_reportsList : NULL, sess_rule_reports ? sess_rule_reportsList : NULL, pol_dec_failure_reports ? pol_dec_failure_reportsList : NULL, - alt_qos_param_id ? ogs_strdup(alt_qos_param_id->valuestring) : NULL + alt_qos_param_id && !cJSON_IsNull(alt_qos_param_id) ? ogs_strdup(alt_qos_param_id->valuestring) : NULL ); return error_report_local_var; end: + if (error_local_nonprim) { + OpenAPI_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (rule_reportsList) { + OpenAPI_list_for_each(rule_reportsList, node) { + OpenAPI_rule_report_free(node->data); + } + OpenAPI_list_free(rule_reportsList); + rule_reportsList = NULL; + } + if (sess_rule_reportsList) { + OpenAPI_list_for_each(sess_rule_reportsList, node) { + OpenAPI_session_rule_report_free(node->data); + } + OpenAPI_list_free(sess_rule_reportsList); + sess_rule_reportsList = NULL; + } + if (pol_dec_failure_reportsList) { + OpenAPI_list_free(pol_dec_failure_reportsList); + pol_dec_failure_reportsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/eth_flow_description.c b/lib/sbi/openapi/model/eth_flow_description.c index b6bb4a421..dbbb7aa0f 100644 --- a/lib/sbi/openapi/model/eth_flow_description.c +++ b/lib/sbi/openapi/model/eth_flow_description.c @@ -32,26 +32,49 @@ OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_create( void OpenAPI_eth_flow_description_free(OpenAPI_eth_flow_description_t *eth_flow_description) { + OpenAPI_lnode_t *node = NULL; + if (NULL == eth_flow_description) { return; } - OpenAPI_lnode_t *node; - ogs_free(eth_flow_description->dest_mac_addr); - ogs_free(eth_flow_description->eth_type); - ogs_free(eth_flow_description->f_desc); - ogs_free(eth_flow_description->source_mac_addr); - OpenAPI_list_for_each(eth_flow_description->vlan_tags, node) { - ogs_free(node->data); + if (eth_flow_description->dest_mac_addr) { + ogs_free(eth_flow_description->dest_mac_addr); + eth_flow_description->dest_mac_addr = NULL; + } + if (eth_flow_description->eth_type) { + ogs_free(eth_flow_description->eth_type); + eth_flow_description->eth_type = NULL; + } + if (eth_flow_description->f_desc) { + ogs_free(eth_flow_description->f_desc); + eth_flow_description->f_desc = NULL; + } + if (eth_flow_description->source_mac_addr) { + ogs_free(eth_flow_description->source_mac_addr); + eth_flow_description->source_mac_addr = NULL; + } + if (eth_flow_description->vlan_tags) { + OpenAPI_list_for_each(eth_flow_description->vlan_tags, node) { + ogs_free(node->data); + } + OpenAPI_list_free(eth_flow_description->vlan_tags); + eth_flow_description->vlan_tags = NULL; + } + if (eth_flow_description->src_mac_addr_end) { + ogs_free(eth_flow_description->src_mac_addr_end); + eth_flow_description->src_mac_addr_end = NULL; + } + if (eth_flow_description->dest_mac_addr_end) { + ogs_free(eth_flow_description->dest_mac_addr_end); + eth_flow_description->dest_mac_addr_end = NULL; } - OpenAPI_list_free(eth_flow_description->vlan_tags); - ogs_free(eth_flow_description->src_mac_addr_end); - ogs_free(eth_flow_description->dest_mac_addr_end); ogs_free(eth_flow_description); } cJSON *OpenAPI_eth_flow_description_convertToJSON(OpenAPI_eth_flow_description_t *eth_flow_description) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (eth_flow_description == NULL) { ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [EthFlowDescription]"); @@ -66,6 +89,10 @@ cJSON *OpenAPI_eth_flow_description_convertToJSON(OpenAPI_eth_flow_description_t } } + if (!eth_flow_description->eth_type) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [eth_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ethType", eth_flow_description->eth_type) == NULL) { ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [eth_type]"); goto end; @@ -78,7 +105,7 @@ cJSON *OpenAPI_eth_flow_description_convertToJSON(OpenAPI_eth_flow_description_t } } - if (eth_flow_description->f_dir) { + if (eth_flow_description->f_dir != OpenAPI_flow_direction_NULL) { if (cJSON_AddStringToObject(item, "fDir", OpenAPI_flow_direction_ToString(eth_flow_description->f_dir)) == NULL) { ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [f_dir]"); goto end; @@ -93,19 +120,17 @@ cJSON *OpenAPI_eth_flow_description_convertToJSON(OpenAPI_eth_flow_description_t } if (eth_flow_description->vlan_tags) { - cJSON *vlan_tags = cJSON_AddArrayToObject(item, "vlanTags"); - if (vlan_tags == NULL) { + cJSON *vlan_tagsList = cJSON_AddArrayToObject(item, "vlanTags"); + if (vlan_tagsList == NULL) { ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [vlan_tags]"); goto end; } - - OpenAPI_lnode_t *vlan_tags_node; - OpenAPI_list_for_each(eth_flow_description->vlan_tags, vlan_tags_node) { - if (cJSON_AddStringToObject(vlan_tags, "", (char*)vlan_tags_node->data) == NULL) { - ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [vlan_tags]"); - goto end; + OpenAPI_list_for_each(eth_flow_description->vlan_tags, node) { + if (cJSON_AddStringToObject(vlan_tagsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [vlan_tags]"); + goto end; + } } - } } if (eth_flow_description->src_mac_addr_end) { @@ -129,38 +154,44 @@ end: OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_parseFromJSON(cJSON *eth_flow_descriptionJSON) { OpenAPI_eth_flow_description_t *eth_flow_description_local_var = NULL; - cJSON *dest_mac_addr = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "destMacAddr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *dest_mac_addr = NULL; + cJSON *eth_type = NULL; + cJSON *f_desc = NULL; + cJSON *f_dir = NULL; + OpenAPI_flow_direction_e f_dirVariable = 0; + cJSON *source_mac_addr = NULL; + cJSON *vlan_tags = NULL; + OpenAPI_list_t *vlan_tagsList = NULL; + cJSON *src_mac_addr_end = NULL; + cJSON *dest_mac_addr_end = NULL; + dest_mac_addr = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "destMacAddr"); if (dest_mac_addr) { - if (!cJSON_IsString(dest_mac_addr)) { + if (!cJSON_IsString(dest_mac_addr) && !cJSON_IsNull(dest_mac_addr)) { ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [dest_mac_addr]"); goto end; } } - cJSON *eth_type = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "ethType"); + eth_type = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "ethType"); if (!eth_type) { ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [eth_type]"); goto end; } - if (!cJSON_IsString(eth_type)) { ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [eth_type]"); goto end; } - cJSON *f_desc = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "fDesc"); - + f_desc = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "fDesc"); if (f_desc) { - if (!cJSON_IsString(f_desc)) { + if (!cJSON_IsString(f_desc) && !cJSON_IsNull(f_desc)) { ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [f_desc]"); goto end; } } - cJSON *f_dir = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "fDir"); - - OpenAPI_flow_direction_e f_dirVariable; + f_dir = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "fDir"); if (f_dir) { if (!cJSON_IsString(f_dir)) { ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [f_dir]"); @@ -169,66 +200,71 @@ OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_parseFromJSON(cJSON f_dirVariable = OpenAPI_flow_direction_FromString(f_dir->valuestring); } - cJSON *source_mac_addr = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "sourceMacAddr"); - + source_mac_addr = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "sourceMacAddr"); if (source_mac_addr) { - if (!cJSON_IsString(source_mac_addr)) { + if (!cJSON_IsString(source_mac_addr) && !cJSON_IsNull(source_mac_addr)) { ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [source_mac_addr]"); goto end; } } - cJSON *vlan_tags = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "vlanTags"); - - OpenAPI_list_t *vlan_tagsList; + vlan_tags = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "vlanTags"); if (vlan_tags) { - cJSON *vlan_tags_local; - if (!cJSON_IsArray(vlan_tags)) { - ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [vlan_tags]"); - goto end; - } - vlan_tagsList = OpenAPI_list_create(); + cJSON *vlan_tags_local = NULL; + if (!cJSON_IsArray(vlan_tags)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [vlan_tags]"); + goto end; + } - cJSON_ArrayForEach(vlan_tags_local, vlan_tags) { - if (!cJSON_IsString(vlan_tags_local)) { - ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [vlan_tags]"); - goto end; - } - OpenAPI_list_add(vlan_tagsList, ogs_strdup(vlan_tags_local->valuestring)); - } + vlan_tagsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(vlan_tags_local, vlan_tags) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(vlan_tags_local)) { + ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [vlan_tags]"); + goto end; + } + OpenAPI_list_add(vlan_tagsList, ogs_strdup(vlan_tags_local->valuestring)); + } } - cJSON *src_mac_addr_end = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "srcMacAddrEnd"); - + src_mac_addr_end = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "srcMacAddrEnd"); if (src_mac_addr_end) { - if (!cJSON_IsString(src_mac_addr_end)) { + if (!cJSON_IsString(src_mac_addr_end) && !cJSON_IsNull(src_mac_addr_end)) { ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [src_mac_addr_end]"); goto end; } } - cJSON *dest_mac_addr_end = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "destMacAddrEnd"); - + dest_mac_addr_end = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "destMacAddrEnd"); if (dest_mac_addr_end) { - if (!cJSON_IsString(dest_mac_addr_end)) { + if (!cJSON_IsString(dest_mac_addr_end) && !cJSON_IsNull(dest_mac_addr_end)) { ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [dest_mac_addr_end]"); goto end; } } eth_flow_description_local_var = OpenAPI_eth_flow_description_create ( - dest_mac_addr ? ogs_strdup(dest_mac_addr->valuestring) : NULL, + dest_mac_addr && !cJSON_IsNull(dest_mac_addr) ? ogs_strdup(dest_mac_addr->valuestring) : NULL, ogs_strdup(eth_type->valuestring), - f_desc ? ogs_strdup(f_desc->valuestring) : NULL, + f_desc && !cJSON_IsNull(f_desc) ? ogs_strdup(f_desc->valuestring) : NULL, f_dir ? f_dirVariable : 0, - source_mac_addr ? ogs_strdup(source_mac_addr->valuestring) : NULL, + source_mac_addr && !cJSON_IsNull(source_mac_addr) ? ogs_strdup(source_mac_addr->valuestring) : NULL, vlan_tags ? vlan_tagsList : NULL, - src_mac_addr_end ? ogs_strdup(src_mac_addr_end->valuestring) : NULL, - dest_mac_addr_end ? ogs_strdup(dest_mac_addr_end->valuestring) : NULL + src_mac_addr_end && !cJSON_IsNull(src_mac_addr_end) ? ogs_strdup(src_mac_addr_end->valuestring) : NULL, + dest_mac_addr_end && !cJSON_IsNull(dest_mac_addr_end) ? ogs_strdup(dest_mac_addr_end->valuestring) : NULL ); return eth_flow_description_local_var; end: + if (vlan_tagsList) { + OpenAPI_list_for_each(vlan_tagsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(vlan_tagsList); + vlan_tagsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/eutra_location.c b/lib/sbi/openapi/model/eutra_location.c index e6f8ea51a..907edef07 100644 --- a/lib/sbi/openapi/model/eutra_location.c +++ b/lib/sbi/openapi/model/eutra_location.c @@ -42,23 +42,46 @@ OpenAPI_eutra_location_t *OpenAPI_eutra_location_create( void OpenAPI_eutra_location_free(OpenAPI_eutra_location_t *eutra_location) { + OpenAPI_lnode_t *node = NULL; + if (NULL == eutra_location) { return; } - OpenAPI_lnode_t *node; - OpenAPI_tai_free(eutra_location->tai); - OpenAPI_ecgi_free(eutra_location->ecgi); - ogs_free(eutra_location->ue_location_timestamp); - ogs_free(eutra_location->geographical_information); - ogs_free(eutra_location->geodetic_information); - OpenAPI_global_ran_node_id_free(eutra_location->global_ngenb_id); - OpenAPI_global_ran_node_id_free(eutra_location->global_enb_id); + if (eutra_location->tai) { + OpenAPI_tai_free(eutra_location->tai); + eutra_location->tai = NULL; + } + if (eutra_location->ecgi) { + OpenAPI_ecgi_free(eutra_location->ecgi); + eutra_location->ecgi = NULL; + } + if (eutra_location->ue_location_timestamp) { + ogs_free(eutra_location->ue_location_timestamp); + eutra_location->ue_location_timestamp = NULL; + } + if (eutra_location->geographical_information) { + ogs_free(eutra_location->geographical_information); + eutra_location->geographical_information = NULL; + } + if (eutra_location->geodetic_information) { + ogs_free(eutra_location->geodetic_information); + eutra_location->geodetic_information = NULL; + } + if (eutra_location->global_ngenb_id) { + OpenAPI_global_ran_node_id_free(eutra_location->global_ngenb_id); + eutra_location->global_ngenb_id = NULL; + } + if (eutra_location->global_enb_id) { + OpenAPI_global_ran_node_id_free(eutra_location->global_enb_id); + eutra_location->global_enb_id = NULL; + } ogs_free(eutra_location); } cJSON *OpenAPI_eutra_location_convertToJSON(OpenAPI_eutra_location_t *eutra_location) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (eutra_location == NULL) { ogs_error("OpenAPI_eutra_location_convertToJSON() failed [EutraLocation]"); @@ -66,6 +89,10 @@ cJSON *OpenAPI_eutra_location_convertToJSON(OpenAPI_eutra_location_t *eutra_loca } item = cJSON_CreateObject(); + if (!eutra_location->tai) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [tai]"); + return NULL; + } cJSON *tai_local_JSON = OpenAPI_tai_convertToJSON(eutra_location->tai); if (tai_local_JSON == NULL) { ogs_error("OpenAPI_eutra_location_convertToJSON() failed [tai]"); @@ -84,6 +111,10 @@ cJSON *OpenAPI_eutra_location_convertToJSON(OpenAPI_eutra_location_t *eutra_loca } } + if (!eutra_location->ecgi) { + ogs_error("OpenAPI_eutra_location_convertToJSON() failed [ecgi]"); + return NULL; + } cJSON *ecgi_local_JSON = OpenAPI_ecgi_convertToJSON(eutra_location->ecgi); if (ecgi_local_JSON == NULL) { ogs_error("OpenAPI_eutra_location_convertToJSON() failed [ecgi]"); @@ -163,17 +194,29 @@ end: OpenAPI_eutra_location_t *OpenAPI_eutra_location_parseFromJSON(cJSON *eutra_locationJSON) { OpenAPI_eutra_location_t *eutra_location_local_var = NULL; - cJSON *tai = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "tai"); + OpenAPI_lnode_t *node = NULL; + cJSON *tai = NULL; + OpenAPI_tai_t *tai_local_nonprim = NULL; + cJSON *ignore_tai = NULL; + cJSON *ecgi = NULL; + OpenAPI_ecgi_t *ecgi_local_nonprim = NULL; + cJSON *ignore_ecgi = NULL; + cJSON *age_of_location_information = NULL; + cJSON *ue_location_timestamp = NULL; + cJSON *geographical_information = NULL; + cJSON *geodetic_information = NULL; + cJSON *global_ngenb_id = NULL; + OpenAPI_global_ran_node_id_t *global_ngenb_id_local_nonprim = NULL; + cJSON *global_enb_id = NULL; + OpenAPI_global_ran_node_id_t *global_enb_id_local_nonprim = NULL; + tai = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "tai"); if (!tai) { ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [tai]"); goto end; } - - OpenAPI_tai_t *tai_local_nonprim = NULL; tai_local_nonprim = OpenAPI_tai_parseFromJSON(tai); - cJSON *ignore_tai = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ignoreTai"); - + ignore_tai = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ignoreTai"); if (ignore_tai) { if (!cJSON_IsBool(ignore_tai)) { ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [ignore_tai]"); @@ -181,17 +224,14 @@ OpenAPI_eutra_location_t *OpenAPI_eutra_location_parseFromJSON(cJSON *eutra_loca } } - cJSON *ecgi = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ecgi"); + ecgi = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ecgi"); if (!ecgi) { ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [ecgi]"); goto end; } - - OpenAPI_ecgi_t *ecgi_local_nonprim = NULL; ecgi_local_nonprim = OpenAPI_ecgi_parseFromJSON(ecgi); - cJSON *ignore_ecgi = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ignoreEcgi"); - + ignore_ecgi = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ignoreEcgi"); if (ignore_ecgi) { if (!cJSON_IsBool(ignore_ecgi)) { ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [ignore_ecgi]"); @@ -199,8 +239,7 @@ OpenAPI_eutra_location_t *OpenAPI_eutra_location_parseFromJSON(cJSON *eutra_loca } } - cJSON *age_of_location_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ageOfLocationInformation"); - + age_of_location_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ageOfLocationInformation"); if (age_of_location_information) { if (!cJSON_IsNumber(age_of_location_information)) { ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [age_of_location_information]"); @@ -208,43 +247,36 @@ OpenAPI_eutra_location_t *OpenAPI_eutra_location_parseFromJSON(cJSON *eutra_loca } } - cJSON *ue_location_timestamp = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ueLocationTimestamp"); - + ue_location_timestamp = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "ueLocationTimestamp"); if (ue_location_timestamp) { - if (!cJSON_IsString(ue_location_timestamp)) { + if (!cJSON_IsString(ue_location_timestamp) && !cJSON_IsNull(ue_location_timestamp)) { ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [ue_location_timestamp]"); goto end; } } - cJSON *geographical_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "geographicalInformation"); - + geographical_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "geographicalInformation"); if (geographical_information) { - if (!cJSON_IsString(geographical_information)) { + if (!cJSON_IsString(geographical_information) && !cJSON_IsNull(geographical_information)) { ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [geographical_information]"); goto end; } } - cJSON *geodetic_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "geodeticInformation"); - + geodetic_information = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "geodeticInformation"); if (geodetic_information) { - if (!cJSON_IsString(geodetic_information)) { + if (!cJSON_IsString(geodetic_information) && !cJSON_IsNull(geodetic_information)) { ogs_error("OpenAPI_eutra_location_parseFromJSON() failed [geodetic_information]"); goto end; } } - cJSON *global_ngenb_id = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "globalNgenbId"); - - OpenAPI_global_ran_node_id_t *global_ngenb_id_local_nonprim = NULL; + global_ngenb_id = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "globalNgenbId"); if (global_ngenb_id) { global_ngenb_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(global_ngenb_id); } - cJSON *global_enb_id = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "globalENbId"); - - OpenAPI_global_ran_node_id_t *global_enb_id_local_nonprim = NULL; + global_enb_id = cJSON_GetObjectItemCaseSensitive(eutra_locationJSON, "globalENbId"); if (global_enb_id) { global_enb_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(global_enb_id); } @@ -258,15 +290,31 @@ OpenAPI_eutra_location_t *OpenAPI_eutra_location_parseFromJSON(cJSON *eutra_loca ignore_ecgi ? ignore_ecgi->valueint : 0, age_of_location_information ? true : false, age_of_location_information ? age_of_location_information->valuedouble : 0, - ue_location_timestamp ? ogs_strdup(ue_location_timestamp->valuestring) : NULL, - geographical_information ? ogs_strdup(geographical_information->valuestring) : NULL, - geodetic_information ? ogs_strdup(geodetic_information->valuestring) : NULL, + ue_location_timestamp && !cJSON_IsNull(ue_location_timestamp) ? ogs_strdup(ue_location_timestamp->valuestring) : NULL, + geographical_information && !cJSON_IsNull(geographical_information) ? ogs_strdup(geographical_information->valuestring) : NULL, + geodetic_information && !cJSON_IsNull(geodetic_information) ? ogs_strdup(geodetic_information->valuestring) : NULL, global_ngenb_id ? global_ngenb_id_local_nonprim : NULL, global_enb_id ? global_enb_id_local_nonprim : NULL ); return eutra_location_local_var; end: + if (tai_local_nonprim) { + OpenAPI_tai_free(tai_local_nonprim); + tai_local_nonprim = NULL; + } + if (ecgi_local_nonprim) { + OpenAPI_ecgi_free(ecgi_local_nonprim); + ecgi_local_nonprim = NULL; + } + if (global_ngenb_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(global_ngenb_id_local_nonprim); + global_ngenb_id_local_nonprim = NULL; + } + if (global_enb_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(global_enb_id_local_nonprim); + global_enb_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/event_id.c b/lib/sbi/openapi/model/event_id.c index aedbb88ed..10c68f728 100644 --- a/lib/sbi/openapi/model/event_id.c +++ b/lib/sbi/openapi/model/event_id.c @@ -16,16 +16,18 @@ OpenAPI_event_id_t *OpenAPI_event_id_create( void OpenAPI_event_id_free(OpenAPI_event_id_t *event_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == event_id) { return; } - OpenAPI_lnode_t *node; ogs_free(event_id); } cJSON *OpenAPI_event_id_convertToJSON(OpenAPI_event_id_t *event_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (event_id == NULL) { ogs_error("OpenAPI_event_id_convertToJSON() failed [EventId]"); @@ -40,6 +42,7 @@ end: OpenAPI_event_id_t *OpenAPI_event_id_parseFromJSON(cJSON *event_idJSON) { OpenAPI_event_id_t *event_id_local_var = NULL; + OpenAPI_lnode_t *node = NULL; event_id_local_var = OpenAPI_event_id_create ( ); diff --git a/lib/sbi/openapi/model/event_report_mode.c b/lib/sbi/openapi/model/event_report_mode.c index aba0809f3..6a25412be 100644 --- a/lib/sbi/openapi/model/event_report_mode.c +++ b/lib/sbi/openapi/model/event_report_mode.c @@ -16,16 +16,18 @@ OpenAPI_event_report_mode_t *OpenAPI_event_report_mode_create( void OpenAPI_event_report_mode_free(OpenAPI_event_report_mode_t *event_report_mode) { + OpenAPI_lnode_t *node = NULL; + if (NULL == event_report_mode) { return; } - OpenAPI_lnode_t *node; ogs_free(event_report_mode); } cJSON *OpenAPI_event_report_mode_convertToJSON(OpenAPI_event_report_mode_t *event_report_mode) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (event_report_mode == NULL) { ogs_error("OpenAPI_event_report_mode_convertToJSON() failed [EventReportMode]"); @@ -40,6 +42,7 @@ end: OpenAPI_event_report_mode_t *OpenAPI_event_report_mode_parseFromJSON(cJSON *event_report_modeJSON) { OpenAPI_event_report_mode_t *event_report_mode_local_var = NULL; + OpenAPI_lnode_t *node = NULL; event_report_mode_local_var = OpenAPI_event_report_mode_create ( ); diff --git a/lib/sbi/openapi/model/event_type.c b/lib/sbi/openapi/model/event_type.c index 38e8130c5..09f616cf1 100644 --- a/lib/sbi/openapi/model/event_type.c +++ b/lib/sbi/openapi/model/event_type.c @@ -16,16 +16,18 @@ OpenAPI_event_type_t *OpenAPI_event_type_create( void OpenAPI_event_type_free(OpenAPI_event_type_t *event_type) { + OpenAPI_lnode_t *node = NULL; + if (NULL == event_type) { return; } - OpenAPI_lnode_t *node; ogs_free(event_type); } cJSON *OpenAPI_event_type_convertToJSON(OpenAPI_event_type_t *event_type) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (event_type == NULL) { ogs_error("OpenAPI_event_type_convertToJSON() failed [EventType]"); @@ -40,6 +42,7 @@ end: OpenAPI_event_type_t *OpenAPI_event_type_parseFromJSON(cJSON *event_typeJSON) { OpenAPI_event_type_t *event_type_local_var = NULL; + OpenAPI_lnode_t *node = NULL; event_type_local_var = OpenAPI_event_type_create ( ); diff --git a/lib/sbi/openapi/model/events_notification.c b/lib/sbi/openapi/model/events_notification.c index 900ed1fe1..3865eb2c5 100644 --- a/lib/sbi/openapi/model/events_notification.c +++ b/lib/sbi/openapi/model/events_notification.c @@ -62,63 +62,125 @@ OpenAPI_events_notification_t *OpenAPI_events_notification_create( void OpenAPI_events_notification_free(OpenAPI_events_notification_t *events_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == events_notification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_additional_access_info_free(events_notification->add_access_info); - OpenAPI_additional_access_info_free(events_notification->rel_access_info); - OpenAPI_acc_net_charging_address_free(events_notification->an_charg_addr); - OpenAPI_list_for_each(events_notification->an_charg_ids, node) { - OpenAPI_access_net_charging_identifier_free(node->data); + if (events_notification->add_access_info) { + OpenAPI_additional_access_info_free(events_notification->add_access_info); + events_notification->add_access_info = NULL; } - OpenAPI_list_free(events_notification->an_charg_ids); - OpenAPI_an_gw_address_free(events_notification->an_gw_addr); - ogs_free(events_notification->ev_subs_uri); - OpenAPI_list_for_each(events_notification->ev_notifs, node) { - OpenAPI_af_event_notification_free(node->data); + if (events_notification->rel_access_info) { + OpenAPI_additional_access_info_free(events_notification->rel_access_info); + events_notification->rel_access_info = NULL; } - OpenAPI_list_free(events_notification->ev_notifs); - OpenAPI_list_for_each(events_notification->failed_resourc_alloc_reports, node) { - OpenAPI_resources_allocation_info_free(node->data); + if (events_notification->an_charg_addr) { + OpenAPI_acc_net_charging_address_free(events_notification->an_charg_addr); + events_notification->an_charg_addr = NULL; } - OpenAPI_list_free(events_notification->failed_resourc_alloc_reports); - OpenAPI_list_for_each(events_notification->succ_resourc_alloc_reports, node) { - OpenAPI_resources_allocation_info_free(node->data); + if (events_notification->an_charg_ids) { + OpenAPI_list_for_each(events_notification->an_charg_ids, node) { + OpenAPI_access_net_charging_identifier_free(node->data); + } + OpenAPI_list_free(events_notification->an_charg_ids); + events_notification->an_charg_ids = NULL; } - OpenAPI_list_free(events_notification->succ_resourc_alloc_reports); - OpenAPI_list_for_each(events_notification->out_of_cred_reports, node) { - OpenAPI_out_of_credit_information_free(node->data); + if (events_notification->an_gw_addr) { + OpenAPI_an_gw_address_free(events_notification->an_gw_addr); + events_notification->an_gw_addr = NULL; } - OpenAPI_list_free(events_notification->out_of_cred_reports); - OpenAPI_plmn_id_nid_free(events_notification->plmn_id); - OpenAPI_list_for_each(events_notification->qnc_reports, node) { - OpenAPI_qos_notification_control_info_free(node->data); + if (events_notification->ev_subs_uri) { + ogs_free(events_notification->ev_subs_uri); + events_notification->ev_subs_uri = NULL; } - OpenAPI_list_free(events_notification->qnc_reports); - OpenAPI_list_for_each(events_notification->qos_mon_reports, node) { - OpenAPI_qos_monitoring_report_free(node->data); + if (events_notification->ev_notifs) { + OpenAPI_list_for_each(events_notification->ev_notifs, node) { + OpenAPI_af_event_notification_free(node->data); + } + OpenAPI_list_free(events_notification->ev_notifs); + events_notification->ev_notifs = NULL; } - OpenAPI_list_free(events_notification->qos_mon_reports); - OpenAPI_list_for_each(events_notification->ran_nas_rel_causes, node) { - OpenAPI_ran_nas_rel_cause_free(node->data); + if (events_notification->failed_resourc_alloc_reports) { + OpenAPI_list_for_each(events_notification->failed_resourc_alloc_reports, node) { + OpenAPI_resources_allocation_info_free(node->data); + } + OpenAPI_list_free(events_notification->failed_resourc_alloc_reports); + events_notification->failed_resourc_alloc_reports = NULL; } - OpenAPI_list_free(events_notification->ran_nas_rel_causes); - OpenAPI_user_location_free(events_notification->ue_loc); - ogs_free(events_notification->ue_time_zone); - OpenAPI_accumulated_usage_free(events_notification->usg_rep); - OpenAPI_bridge_management_container_free(events_notification->tsn_bridge_man_cont); - OpenAPI_port_management_container_free(events_notification->tsn_port_man_cont_dstt); - OpenAPI_list_for_each(events_notification->tsn_port_man_cont_nwtts, node) { - OpenAPI_port_management_container_free(node->data); + if (events_notification->succ_resourc_alloc_reports) { + OpenAPI_list_for_each(events_notification->succ_resourc_alloc_reports, node) { + OpenAPI_resources_allocation_info_free(node->data); + } + OpenAPI_list_free(events_notification->succ_resourc_alloc_reports); + events_notification->succ_resourc_alloc_reports = NULL; + } + if (events_notification->out_of_cred_reports) { + OpenAPI_list_for_each(events_notification->out_of_cred_reports, node) { + OpenAPI_out_of_credit_information_free(node->data); + } + OpenAPI_list_free(events_notification->out_of_cred_reports); + events_notification->out_of_cred_reports = NULL; + } + if (events_notification->plmn_id) { + OpenAPI_plmn_id_nid_free(events_notification->plmn_id); + events_notification->plmn_id = NULL; + } + if (events_notification->qnc_reports) { + OpenAPI_list_for_each(events_notification->qnc_reports, node) { + OpenAPI_qos_notification_control_info_free(node->data); + } + OpenAPI_list_free(events_notification->qnc_reports); + events_notification->qnc_reports = NULL; + } + if (events_notification->qos_mon_reports) { + OpenAPI_list_for_each(events_notification->qos_mon_reports, node) { + OpenAPI_qos_monitoring_report_free(node->data); + } + OpenAPI_list_free(events_notification->qos_mon_reports); + events_notification->qos_mon_reports = NULL; + } + if (events_notification->ran_nas_rel_causes) { + OpenAPI_list_for_each(events_notification->ran_nas_rel_causes, node) { + OpenAPI_ran_nas_rel_cause_free(node->data); + } + OpenAPI_list_free(events_notification->ran_nas_rel_causes); + events_notification->ran_nas_rel_causes = NULL; + } + if (events_notification->ue_loc) { + OpenAPI_user_location_free(events_notification->ue_loc); + events_notification->ue_loc = NULL; + } + if (events_notification->ue_time_zone) { + ogs_free(events_notification->ue_time_zone); + events_notification->ue_time_zone = NULL; + } + if (events_notification->usg_rep) { + OpenAPI_accumulated_usage_free(events_notification->usg_rep); + events_notification->usg_rep = NULL; + } + if (events_notification->tsn_bridge_man_cont) { + OpenAPI_bridge_management_container_free(events_notification->tsn_bridge_man_cont); + events_notification->tsn_bridge_man_cont = NULL; + } + if (events_notification->tsn_port_man_cont_dstt) { + OpenAPI_port_management_container_free(events_notification->tsn_port_man_cont_dstt); + events_notification->tsn_port_man_cont_dstt = NULL; + } + if (events_notification->tsn_port_man_cont_nwtts) { + OpenAPI_list_for_each(events_notification->tsn_port_man_cont_nwtts, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(events_notification->tsn_port_man_cont_nwtts); + events_notification->tsn_port_man_cont_nwtts = NULL; } - OpenAPI_list_free(events_notification->tsn_port_man_cont_nwtts); ogs_free(events_notification); } cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t *events_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (events_notification == NULL) { ogs_error("OpenAPI_events_notification_convertToJSON() failed [EventsNotification]"); @@ -126,7 +188,7 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * } item = cJSON_CreateObject(); - if (events_notification->access_type) { + if (events_notification->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(events_notification->access_type)) == NULL) { ogs_error("OpenAPI_events_notification_convertToJSON() failed [access_type]"); goto end; @@ -178,17 +240,13 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * ogs_error("OpenAPI_events_notification_convertToJSON() failed [an_charg_ids]"); goto end; } - - OpenAPI_lnode_t *an_charg_ids_node; - if (events_notification->an_charg_ids) { - OpenAPI_list_for_each(events_notification->an_charg_ids, an_charg_ids_node) { - cJSON *itemLocal = OpenAPI_access_net_charging_identifier_convertToJSON(an_charg_ids_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [an_charg_ids]"); - goto end; - } - cJSON_AddItemToArray(an_charg_idsList, itemLocal); + OpenAPI_list_for_each(events_notification->an_charg_ids, node) { + cJSON *itemLocal = OpenAPI_access_net_charging_identifier_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [an_charg_ids]"); + goto end; } + cJSON_AddItemToArray(an_charg_idsList, itemLocal); } } @@ -205,27 +263,31 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * } } + if (!events_notification->ev_subs_uri) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [ev_subs_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "evSubsUri", events_notification->ev_subs_uri) == NULL) { ogs_error("OpenAPI_events_notification_convertToJSON() failed [ev_subs_uri]"); goto end; } + if (!events_notification->ev_notifs) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [ev_notifs]"); + return NULL; + } cJSON *ev_notifsList = cJSON_AddArrayToObject(item, "evNotifs"); if (ev_notifsList == NULL) { ogs_error("OpenAPI_events_notification_convertToJSON() failed [ev_notifs]"); goto end; } - - OpenAPI_lnode_t *ev_notifs_node; - if (events_notification->ev_notifs) { - OpenAPI_list_for_each(events_notification->ev_notifs, ev_notifs_node) { - cJSON *itemLocal = OpenAPI_af_event_notification_convertToJSON(ev_notifs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [ev_notifs]"); - goto end; - } - cJSON_AddItemToArray(ev_notifsList, itemLocal); + OpenAPI_list_for_each(events_notification->ev_notifs, node) { + cJSON *itemLocal = OpenAPI_af_event_notification_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [ev_notifs]"); + goto end; } + cJSON_AddItemToArray(ev_notifsList, itemLocal); } if (events_notification->failed_resourc_alloc_reports) { @@ -234,17 +296,13 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * ogs_error("OpenAPI_events_notification_convertToJSON() failed [failed_resourc_alloc_reports]"); goto end; } - - OpenAPI_lnode_t *failed_resourc_alloc_reports_node; - if (events_notification->failed_resourc_alloc_reports) { - OpenAPI_list_for_each(events_notification->failed_resourc_alloc_reports, failed_resourc_alloc_reports_node) { - cJSON *itemLocal = OpenAPI_resources_allocation_info_convertToJSON(failed_resourc_alloc_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [failed_resourc_alloc_reports]"); - goto end; - } - cJSON_AddItemToArray(failed_resourc_alloc_reportsList, itemLocal); + OpenAPI_list_for_each(events_notification->failed_resourc_alloc_reports, node) { + cJSON *itemLocal = OpenAPI_resources_allocation_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [failed_resourc_alloc_reports]"); + goto end; } + cJSON_AddItemToArray(failed_resourc_alloc_reportsList, itemLocal); } } @@ -254,21 +312,17 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * ogs_error("OpenAPI_events_notification_convertToJSON() failed [succ_resourc_alloc_reports]"); goto end; } - - OpenAPI_lnode_t *succ_resourc_alloc_reports_node; - if (events_notification->succ_resourc_alloc_reports) { - OpenAPI_list_for_each(events_notification->succ_resourc_alloc_reports, succ_resourc_alloc_reports_node) { - cJSON *itemLocal = OpenAPI_resources_allocation_info_convertToJSON(succ_resourc_alloc_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [succ_resourc_alloc_reports]"); - goto end; - } - cJSON_AddItemToArray(succ_resourc_alloc_reportsList, itemLocal); + OpenAPI_list_for_each(events_notification->succ_resourc_alloc_reports, node) { + cJSON *itemLocal = OpenAPI_resources_allocation_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [succ_resourc_alloc_reports]"); + goto end; } + cJSON_AddItemToArray(succ_resourc_alloc_reportsList, itemLocal); } } - if (events_notification->no_net_loc_supp) { + if (events_notification->no_net_loc_supp != OpenAPI_net_loc_access_support_NULL) { if (cJSON_AddStringToObject(item, "noNetLocSupp", OpenAPI_net_loc_access_support_ToString(events_notification->no_net_loc_supp)) == NULL) { ogs_error("OpenAPI_events_notification_convertToJSON() failed [no_net_loc_supp]"); goto end; @@ -281,17 +335,13 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * ogs_error("OpenAPI_events_notification_convertToJSON() failed [out_of_cred_reports]"); goto end; } - - OpenAPI_lnode_t *out_of_cred_reports_node; - if (events_notification->out_of_cred_reports) { - OpenAPI_list_for_each(events_notification->out_of_cred_reports, out_of_cred_reports_node) { - cJSON *itemLocal = OpenAPI_out_of_credit_information_convertToJSON(out_of_cred_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [out_of_cred_reports]"); - goto end; - } - cJSON_AddItemToArray(out_of_cred_reportsList, itemLocal); + OpenAPI_list_for_each(events_notification->out_of_cred_reports, node) { + cJSON *itemLocal = OpenAPI_out_of_credit_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [out_of_cred_reports]"); + goto end; } + cJSON_AddItemToArray(out_of_cred_reportsList, itemLocal); } } @@ -314,17 +364,13 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * ogs_error("OpenAPI_events_notification_convertToJSON() failed [qnc_reports]"); goto end; } - - OpenAPI_lnode_t *qnc_reports_node; - if (events_notification->qnc_reports) { - OpenAPI_list_for_each(events_notification->qnc_reports, qnc_reports_node) { - cJSON *itemLocal = OpenAPI_qos_notification_control_info_convertToJSON(qnc_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [qnc_reports]"); - goto end; - } - cJSON_AddItemToArray(qnc_reportsList, itemLocal); + OpenAPI_list_for_each(events_notification->qnc_reports, node) { + cJSON *itemLocal = OpenAPI_qos_notification_control_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [qnc_reports]"); + goto end; } + cJSON_AddItemToArray(qnc_reportsList, itemLocal); } } @@ -334,17 +380,13 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * ogs_error("OpenAPI_events_notification_convertToJSON() failed [qos_mon_reports]"); goto end; } - - OpenAPI_lnode_t *qos_mon_reports_node; - if (events_notification->qos_mon_reports) { - OpenAPI_list_for_each(events_notification->qos_mon_reports, qos_mon_reports_node) { - cJSON *itemLocal = OpenAPI_qos_monitoring_report_convertToJSON(qos_mon_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [qos_mon_reports]"); - goto end; - } - cJSON_AddItemToArray(qos_mon_reportsList, itemLocal); + OpenAPI_list_for_each(events_notification->qos_mon_reports, node) { + cJSON *itemLocal = OpenAPI_qos_monitoring_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [qos_mon_reports]"); + goto end; } + cJSON_AddItemToArray(qos_mon_reportsList, itemLocal); } } @@ -354,21 +396,17 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * ogs_error("OpenAPI_events_notification_convertToJSON() failed [ran_nas_rel_causes]"); goto end; } - - OpenAPI_lnode_t *ran_nas_rel_causes_node; - if (events_notification->ran_nas_rel_causes) { - OpenAPI_list_for_each(events_notification->ran_nas_rel_causes, ran_nas_rel_causes_node) { - cJSON *itemLocal = OpenAPI_ran_nas_rel_cause_convertToJSON(ran_nas_rel_causes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [ran_nas_rel_causes]"); - goto end; - } - cJSON_AddItemToArray(ran_nas_rel_causesList, itemLocal); + OpenAPI_list_for_each(events_notification->ran_nas_rel_causes, node) { + cJSON *itemLocal = OpenAPI_ran_nas_rel_cause_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [ran_nas_rel_causes]"); + goto end; } + cJSON_AddItemToArray(ran_nas_rel_causesList, itemLocal); } } - if (events_notification->rat_type) { + if (events_notification->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(events_notification->rat_type)) == NULL) { ogs_error("OpenAPI_events_notification_convertToJSON() failed [rat_type]"); goto end; @@ -440,17 +478,13 @@ cJSON *OpenAPI_events_notification_convertToJSON(OpenAPI_events_notification_t * ogs_error("OpenAPI_events_notification_convertToJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - - OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node; - if (events_notification->tsn_port_man_cont_nwtts) { - OpenAPI_list_for_each(events_notification->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) { - cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_notification_convertToJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); + OpenAPI_list_for_each(events_notification->tsn_port_man_cont_nwtts, node) { + cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_notification_convertToJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; } + cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); } } @@ -461,9 +495,52 @@ end: OpenAPI_events_notification_t *OpenAPI_events_notification_parseFromJSON(cJSON *events_notificationJSON) { OpenAPI_events_notification_t *events_notification_local_var = NULL; - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *add_access_info = NULL; + OpenAPI_additional_access_info_t *add_access_info_local_nonprim = NULL; + cJSON *rel_access_info = NULL; + OpenAPI_additional_access_info_t *rel_access_info_local_nonprim = NULL; + cJSON *an_charg_addr = NULL; + OpenAPI_acc_net_charging_address_t *an_charg_addr_local_nonprim = NULL; + cJSON *an_charg_ids = NULL; + OpenAPI_list_t *an_charg_idsList = NULL; + cJSON *an_gw_addr = NULL; + OpenAPI_an_gw_address_t *an_gw_addr_local_nonprim = NULL; + cJSON *ev_subs_uri = NULL; + cJSON *ev_notifs = NULL; + OpenAPI_list_t *ev_notifsList = NULL; + cJSON *failed_resourc_alloc_reports = NULL; + OpenAPI_list_t *failed_resourc_alloc_reportsList = NULL; + cJSON *succ_resourc_alloc_reports = NULL; + OpenAPI_list_t *succ_resourc_alloc_reportsList = NULL; + cJSON *no_net_loc_supp = NULL; + OpenAPI_net_loc_access_support_e no_net_loc_suppVariable = 0; + cJSON *out_of_cred_reports = NULL; + OpenAPI_list_t *out_of_cred_reportsList = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_nid_t *plmn_id_local_nonprim = NULL; + cJSON *qnc_reports = NULL; + OpenAPI_list_t *qnc_reportsList = NULL; + cJSON *qos_mon_reports = NULL; + OpenAPI_list_t *qos_mon_reportsList = NULL; + cJSON *ran_nas_rel_causes = NULL; + OpenAPI_list_t *ran_nas_rel_causesList = NULL; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *ue_loc = NULL; + OpenAPI_user_location_t *ue_loc_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *usg_rep = NULL; + OpenAPI_accumulated_usage_t *usg_rep_local_nonprim = NULL; + cJSON *tsn_bridge_man_cont = NULL; + OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + cJSON *tsn_port_man_cont_dstt = NULL; + OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + cJSON *tsn_port_man_cont_nwtts = NULL; + OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL; + access_type = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [access_type]"); @@ -472,166 +549,139 @@ OpenAPI_events_notification_t *OpenAPI_events_notification_parseFromJSON(cJSON * access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *add_access_info = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "addAccessInfo"); - - OpenAPI_additional_access_info_t *add_access_info_local_nonprim = NULL; + add_access_info = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "addAccessInfo"); if (add_access_info) { add_access_info_local_nonprim = OpenAPI_additional_access_info_parseFromJSON(add_access_info); } - cJSON *rel_access_info = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "relAccessInfo"); - - OpenAPI_additional_access_info_t *rel_access_info_local_nonprim = NULL; + rel_access_info = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "relAccessInfo"); if (rel_access_info) { rel_access_info_local_nonprim = OpenAPI_additional_access_info_parseFromJSON(rel_access_info); } - cJSON *an_charg_addr = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "anChargAddr"); - - OpenAPI_acc_net_charging_address_t *an_charg_addr_local_nonprim = NULL; + an_charg_addr = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "anChargAddr"); if (an_charg_addr) { an_charg_addr_local_nonprim = OpenAPI_acc_net_charging_address_parseFromJSON(an_charg_addr); } - cJSON *an_charg_ids = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "anChargIds"); - - OpenAPI_list_t *an_charg_idsList; + an_charg_ids = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "anChargIds"); if (an_charg_ids) { - cJSON *an_charg_ids_local_nonprimitive; - if (!cJSON_IsArray(an_charg_ids)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [an_charg_ids]"); - goto end; - } - - an_charg_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(an_charg_ids_local_nonprimitive, an_charg_ids ) { - if (!cJSON_IsObject(an_charg_ids_local_nonprimitive)) { + cJSON *an_charg_ids_local = NULL; + if (!cJSON_IsArray(an_charg_ids)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [an_charg_ids]"); goto end; } - OpenAPI_access_net_charging_identifier_t *an_charg_idsItem = OpenAPI_access_net_charging_identifier_parseFromJSON(an_charg_ids_local_nonprimitive); - if (!an_charg_idsItem) { - ogs_error("No an_charg_idsItem"); - OpenAPI_list_free(an_charg_idsList); - goto end; + an_charg_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(an_charg_ids_local, an_charg_ids) { + if (!cJSON_IsObject(an_charg_ids_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [an_charg_ids]"); + goto end; + } + OpenAPI_access_net_charging_identifier_t *an_charg_idsItem = OpenAPI_access_net_charging_identifier_parseFromJSON(an_charg_ids_local); + if (!an_charg_idsItem) { + ogs_error("No an_charg_idsItem"); + OpenAPI_list_free(an_charg_idsList); + goto end; + } + OpenAPI_list_add(an_charg_idsList, an_charg_idsItem); } - - OpenAPI_list_add(an_charg_idsList, an_charg_idsItem); - } } - cJSON *an_gw_addr = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "anGwAddr"); - - OpenAPI_an_gw_address_t *an_gw_addr_local_nonprim = NULL; + an_gw_addr = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "anGwAddr"); if (an_gw_addr) { an_gw_addr_local_nonprim = OpenAPI_an_gw_address_parseFromJSON(an_gw_addr); } - cJSON *ev_subs_uri = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "evSubsUri"); + ev_subs_uri = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "evSubsUri"); if (!ev_subs_uri) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ev_subs_uri]"); goto end; } - if (!cJSON_IsString(ev_subs_uri)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ev_subs_uri]"); goto end; } - cJSON *ev_notifs = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "evNotifs"); + ev_notifs = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "evNotifs"); if (!ev_notifs) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ev_notifs]"); goto end; } - - OpenAPI_list_t *ev_notifsList; - cJSON *ev_notifs_local_nonprimitive; - if (!cJSON_IsArray(ev_notifs)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ev_notifs]"); - goto end; - } - - ev_notifsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ev_notifs_local_nonprimitive, ev_notifs ) { - if (!cJSON_IsObject(ev_notifs_local_nonprimitive)) { + cJSON *ev_notifs_local = NULL; + if (!cJSON_IsArray(ev_notifs)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ev_notifs]"); goto end; } - OpenAPI_af_event_notification_t *ev_notifsItem = OpenAPI_af_event_notification_parseFromJSON(ev_notifs_local_nonprimitive); - if (!ev_notifsItem) { - ogs_error("No ev_notifsItem"); - OpenAPI_list_free(ev_notifsList); - goto end; + ev_notifsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ev_notifs_local, ev_notifs) { + if (!cJSON_IsObject(ev_notifs_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ev_notifs]"); + goto end; + } + OpenAPI_af_event_notification_t *ev_notifsItem = OpenAPI_af_event_notification_parseFromJSON(ev_notifs_local); + if (!ev_notifsItem) { + ogs_error("No ev_notifsItem"); + OpenAPI_list_free(ev_notifsList); + goto end; + } + OpenAPI_list_add(ev_notifsList, ev_notifsItem); } - OpenAPI_list_add(ev_notifsList, ev_notifsItem); - } - - cJSON *failed_resourc_alloc_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "failedResourcAllocReports"); - - OpenAPI_list_t *failed_resourc_alloc_reportsList; + failed_resourc_alloc_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "failedResourcAllocReports"); if (failed_resourc_alloc_reports) { - cJSON *failed_resourc_alloc_reports_local_nonprimitive; - if (!cJSON_IsArray(failed_resourc_alloc_reports)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [failed_resourc_alloc_reports]"); - goto end; - } - - failed_resourc_alloc_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(failed_resourc_alloc_reports_local_nonprimitive, failed_resourc_alloc_reports ) { - if (!cJSON_IsObject(failed_resourc_alloc_reports_local_nonprimitive)) { + cJSON *failed_resourc_alloc_reports_local = NULL; + if (!cJSON_IsArray(failed_resourc_alloc_reports)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [failed_resourc_alloc_reports]"); goto end; } - OpenAPI_resources_allocation_info_t *failed_resourc_alloc_reportsItem = OpenAPI_resources_allocation_info_parseFromJSON(failed_resourc_alloc_reports_local_nonprimitive); - if (!failed_resourc_alloc_reportsItem) { - ogs_error("No failed_resourc_alloc_reportsItem"); - OpenAPI_list_free(failed_resourc_alloc_reportsList); - goto end; + failed_resourc_alloc_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(failed_resourc_alloc_reports_local, failed_resourc_alloc_reports) { + if (!cJSON_IsObject(failed_resourc_alloc_reports_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [failed_resourc_alloc_reports]"); + goto end; + } + OpenAPI_resources_allocation_info_t *failed_resourc_alloc_reportsItem = OpenAPI_resources_allocation_info_parseFromJSON(failed_resourc_alloc_reports_local); + if (!failed_resourc_alloc_reportsItem) { + ogs_error("No failed_resourc_alloc_reportsItem"); + OpenAPI_list_free(failed_resourc_alloc_reportsList); + goto end; + } + OpenAPI_list_add(failed_resourc_alloc_reportsList, failed_resourc_alloc_reportsItem); } - - OpenAPI_list_add(failed_resourc_alloc_reportsList, failed_resourc_alloc_reportsItem); - } } - cJSON *succ_resourc_alloc_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "succResourcAllocReports"); - - OpenAPI_list_t *succ_resourc_alloc_reportsList; + succ_resourc_alloc_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "succResourcAllocReports"); if (succ_resourc_alloc_reports) { - cJSON *succ_resourc_alloc_reports_local_nonprimitive; - if (!cJSON_IsArray(succ_resourc_alloc_reports)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [succ_resourc_alloc_reports]"); - goto end; - } - - succ_resourc_alloc_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(succ_resourc_alloc_reports_local_nonprimitive, succ_resourc_alloc_reports ) { - if (!cJSON_IsObject(succ_resourc_alloc_reports_local_nonprimitive)) { + cJSON *succ_resourc_alloc_reports_local = NULL; + if (!cJSON_IsArray(succ_resourc_alloc_reports)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [succ_resourc_alloc_reports]"); goto end; } - OpenAPI_resources_allocation_info_t *succ_resourc_alloc_reportsItem = OpenAPI_resources_allocation_info_parseFromJSON(succ_resourc_alloc_reports_local_nonprimitive); - if (!succ_resourc_alloc_reportsItem) { - ogs_error("No succ_resourc_alloc_reportsItem"); - OpenAPI_list_free(succ_resourc_alloc_reportsList); - goto end; + succ_resourc_alloc_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(succ_resourc_alloc_reports_local, succ_resourc_alloc_reports) { + if (!cJSON_IsObject(succ_resourc_alloc_reports_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [succ_resourc_alloc_reports]"); + goto end; + } + OpenAPI_resources_allocation_info_t *succ_resourc_alloc_reportsItem = OpenAPI_resources_allocation_info_parseFromJSON(succ_resourc_alloc_reports_local); + if (!succ_resourc_alloc_reportsItem) { + ogs_error("No succ_resourc_alloc_reportsItem"); + OpenAPI_list_free(succ_resourc_alloc_reportsList); + goto end; + } + OpenAPI_list_add(succ_resourc_alloc_reportsList, succ_resourc_alloc_reportsItem); } - - OpenAPI_list_add(succ_resourc_alloc_reportsList, succ_resourc_alloc_reportsItem); - } } - cJSON *no_net_loc_supp = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "noNetLocSupp"); - - OpenAPI_net_loc_access_support_e no_net_loc_suppVariable; + no_net_loc_supp = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "noNetLocSupp"); if (no_net_loc_supp) { if (!cJSON_IsString(no_net_loc_supp)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [no_net_loc_supp]"); @@ -640,132 +690,112 @@ OpenAPI_events_notification_t *OpenAPI_events_notification_parseFromJSON(cJSON * no_net_loc_suppVariable = OpenAPI_net_loc_access_support_FromString(no_net_loc_supp->valuestring); } - cJSON *out_of_cred_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "outOfCredReports"); - - OpenAPI_list_t *out_of_cred_reportsList; + out_of_cred_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "outOfCredReports"); if (out_of_cred_reports) { - cJSON *out_of_cred_reports_local_nonprimitive; - if (!cJSON_IsArray(out_of_cred_reports)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [out_of_cred_reports]"); - goto end; - } - - out_of_cred_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(out_of_cred_reports_local_nonprimitive, out_of_cred_reports ) { - if (!cJSON_IsObject(out_of_cred_reports_local_nonprimitive)) { + cJSON *out_of_cred_reports_local = NULL; + if (!cJSON_IsArray(out_of_cred_reports)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [out_of_cred_reports]"); goto end; } - OpenAPI_out_of_credit_information_t *out_of_cred_reportsItem = OpenAPI_out_of_credit_information_parseFromJSON(out_of_cred_reports_local_nonprimitive); - if (!out_of_cred_reportsItem) { - ogs_error("No out_of_cred_reportsItem"); - OpenAPI_list_free(out_of_cred_reportsList); - goto end; + out_of_cred_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(out_of_cred_reports_local, out_of_cred_reports) { + if (!cJSON_IsObject(out_of_cred_reports_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [out_of_cred_reports]"); + goto end; + } + OpenAPI_out_of_credit_information_t *out_of_cred_reportsItem = OpenAPI_out_of_credit_information_parseFromJSON(out_of_cred_reports_local); + if (!out_of_cred_reportsItem) { + ogs_error("No out_of_cred_reportsItem"); + OpenAPI_list_free(out_of_cred_reportsList); + goto end; + } + OpenAPI_list_add(out_of_cred_reportsList, out_of_cred_reportsItem); } - - OpenAPI_list_add(out_of_cred_reportsList, out_of_cred_reportsItem); - } } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "plmnId"); - - OpenAPI_plmn_id_nid_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(plmn_id); } - cJSON *qnc_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "qncReports"); - - OpenAPI_list_t *qnc_reportsList; + qnc_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "qncReports"); if (qnc_reports) { - cJSON *qnc_reports_local_nonprimitive; - if (!cJSON_IsArray(qnc_reports)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [qnc_reports]"); - goto end; - } - - qnc_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qnc_reports_local_nonprimitive, qnc_reports ) { - if (!cJSON_IsObject(qnc_reports_local_nonprimitive)) { + cJSON *qnc_reports_local = NULL; + if (!cJSON_IsArray(qnc_reports)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [qnc_reports]"); goto end; } - OpenAPI_qos_notification_control_info_t *qnc_reportsItem = OpenAPI_qos_notification_control_info_parseFromJSON(qnc_reports_local_nonprimitive); - if (!qnc_reportsItem) { - ogs_error("No qnc_reportsItem"); - OpenAPI_list_free(qnc_reportsList); - goto end; + qnc_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qnc_reports_local, qnc_reports) { + if (!cJSON_IsObject(qnc_reports_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [qnc_reports]"); + goto end; + } + OpenAPI_qos_notification_control_info_t *qnc_reportsItem = OpenAPI_qos_notification_control_info_parseFromJSON(qnc_reports_local); + if (!qnc_reportsItem) { + ogs_error("No qnc_reportsItem"); + OpenAPI_list_free(qnc_reportsList); + goto end; + } + OpenAPI_list_add(qnc_reportsList, qnc_reportsItem); } - - OpenAPI_list_add(qnc_reportsList, qnc_reportsItem); - } } - cJSON *qos_mon_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "qosMonReports"); - - OpenAPI_list_t *qos_mon_reportsList; + qos_mon_reports = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "qosMonReports"); if (qos_mon_reports) { - cJSON *qos_mon_reports_local_nonprimitive; - if (!cJSON_IsArray(qos_mon_reports)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [qos_mon_reports]"); - goto end; - } - - qos_mon_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_mon_reports_local_nonprimitive, qos_mon_reports ) { - if (!cJSON_IsObject(qos_mon_reports_local_nonprimitive)) { + cJSON *qos_mon_reports_local = NULL; + if (!cJSON_IsArray(qos_mon_reports)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [qos_mon_reports]"); goto end; } - OpenAPI_qos_monitoring_report_t *qos_mon_reportsItem = OpenAPI_qos_monitoring_report_parseFromJSON(qos_mon_reports_local_nonprimitive); - if (!qos_mon_reportsItem) { - ogs_error("No qos_mon_reportsItem"); - OpenAPI_list_free(qos_mon_reportsList); - goto end; + qos_mon_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_mon_reports_local, qos_mon_reports) { + if (!cJSON_IsObject(qos_mon_reports_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [qos_mon_reports]"); + goto end; + } + OpenAPI_qos_monitoring_report_t *qos_mon_reportsItem = OpenAPI_qos_monitoring_report_parseFromJSON(qos_mon_reports_local); + if (!qos_mon_reportsItem) { + ogs_error("No qos_mon_reportsItem"); + OpenAPI_list_free(qos_mon_reportsList); + goto end; + } + OpenAPI_list_add(qos_mon_reportsList, qos_mon_reportsItem); } - - OpenAPI_list_add(qos_mon_reportsList, qos_mon_reportsItem); - } } - cJSON *ran_nas_rel_causes = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "ranNasRelCauses"); - - OpenAPI_list_t *ran_nas_rel_causesList; + ran_nas_rel_causes = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "ranNasRelCauses"); if (ran_nas_rel_causes) { - cJSON *ran_nas_rel_causes_local_nonprimitive; - if (!cJSON_IsArray(ran_nas_rel_causes)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ran_nas_rel_causes]"); - goto end; - } - - ran_nas_rel_causesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ran_nas_rel_causes_local_nonprimitive, ran_nas_rel_causes ) { - if (!cJSON_IsObject(ran_nas_rel_causes_local_nonprimitive)) { + cJSON *ran_nas_rel_causes_local = NULL; + if (!cJSON_IsArray(ran_nas_rel_causes)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ran_nas_rel_causes]"); goto end; } - OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_causesItem = OpenAPI_ran_nas_rel_cause_parseFromJSON(ran_nas_rel_causes_local_nonprimitive); - if (!ran_nas_rel_causesItem) { - ogs_error("No ran_nas_rel_causesItem"); - OpenAPI_list_free(ran_nas_rel_causesList); - goto end; + ran_nas_rel_causesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ran_nas_rel_causes_local, ran_nas_rel_causes) { + if (!cJSON_IsObject(ran_nas_rel_causes_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ran_nas_rel_causes]"); + goto end; + } + OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_causesItem = OpenAPI_ran_nas_rel_cause_parseFromJSON(ran_nas_rel_causes_local); + if (!ran_nas_rel_causesItem) { + ogs_error("No ran_nas_rel_causesItem"); + OpenAPI_list_free(ran_nas_rel_causesList); + goto end; + } + OpenAPI_list_add(ran_nas_rel_causesList, ran_nas_rel_causesItem); } - - OpenAPI_list_add(ran_nas_rel_causesList, ran_nas_rel_causesItem); - } } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [rat_type]"); @@ -774,70 +804,57 @@ OpenAPI_events_notification_t *OpenAPI_events_notification_parseFromJSON(cJSON * rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *ue_loc = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "ueLoc"); - - OpenAPI_user_location_t *ue_loc_local_nonprim = NULL; + ue_loc = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "ueLoc"); if (ue_loc) { ue_loc_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_loc); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *usg_rep = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "usgRep"); - - OpenAPI_accumulated_usage_t *usg_rep_local_nonprim = NULL; + usg_rep = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "usgRep"); if (usg_rep) { usg_rep_local_nonprim = OpenAPI_accumulated_usage_parseFromJSON(usg_rep); } - cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "tsnBridgeManCont"); - - OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "tsnBridgeManCont"); if (tsn_bridge_man_cont) { tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont); } - cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "tsnPortManContDstt"); - - OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "tsnPortManContDstt"); if (tsn_port_man_cont_dstt) { tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt); } - cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "tsnPortManContNwtts"); - - OpenAPI_list_t *tsn_port_man_cont_nwttsList; + tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(events_notificationJSON, "tsnPortManContNwtts"); if (tsn_port_man_cont_nwtts) { - cJSON *tsn_port_man_cont_nwtts_local_nonprimitive; - if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){ - ogs_error("OpenAPI_events_notification_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - - tsn_port_man_cont_nwttsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) { - if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) { + cJSON *tsn_port_man_cont_nwtts_local = NULL; + if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) { ogs_error("OpenAPI_events_notification_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive); - if (!tsn_port_man_cont_nwttsItem) { - ogs_error("No tsn_port_man_cont_nwttsItem"); - OpenAPI_list_free(tsn_port_man_cont_nwttsList); - goto end; + tsn_port_man_cont_nwttsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) { + if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) { + ogs_error("OpenAPI_events_notification_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; + } + OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local); + if (!tsn_port_man_cont_nwttsItem) { + ogs_error("No tsn_port_man_cont_nwttsItem"); + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + goto end; + } + OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); } - - OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); - } } events_notification_local_var = OpenAPI_events_notification_create ( @@ -859,7 +876,7 @@ OpenAPI_events_notification_t *OpenAPI_events_notification_parseFromJSON(cJSON * ran_nas_rel_causes ? ran_nas_rel_causesList : NULL, rat_type ? rat_typeVariable : 0, ue_loc ? ue_loc_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, usg_rep ? usg_rep_local_nonprim : NULL, tsn_bridge_man_cont ? tsn_bridge_man_cont_local_nonprim : NULL, tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL, @@ -868,6 +885,105 @@ OpenAPI_events_notification_t *OpenAPI_events_notification_parseFromJSON(cJSON * return events_notification_local_var; end: + if (add_access_info_local_nonprim) { + OpenAPI_additional_access_info_free(add_access_info_local_nonprim); + add_access_info_local_nonprim = NULL; + } + if (rel_access_info_local_nonprim) { + OpenAPI_additional_access_info_free(rel_access_info_local_nonprim); + rel_access_info_local_nonprim = NULL; + } + if (an_charg_addr_local_nonprim) { + OpenAPI_acc_net_charging_address_free(an_charg_addr_local_nonprim); + an_charg_addr_local_nonprim = NULL; + } + if (an_charg_idsList) { + OpenAPI_list_for_each(an_charg_idsList, node) { + OpenAPI_access_net_charging_identifier_free(node->data); + } + OpenAPI_list_free(an_charg_idsList); + an_charg_idsList = NULL; + } + if (an_gw_addr_local_nonprim) { + OpenAPI_an_gw_address_free(an_gw_addr_local_nonprim); + an_gw_addr_local_nonprim = NULL; + } + if (ev_notifsList) { + OpenAPI_list_for_each(ev_notifsList, node) { + OpenAPI_af_event_notification_free(node->data); + } + OpenAPI_list_free(ev_notifsList); + ev_notifsList = NULL; + } + if (failed_resourc_alloc_reportsList) { + OpenAPI_list_for_each(failed_resourc_alloc_reportsList, node) { + OpenAPI_resources_allocation_info_free(node->data); + } + OpenAPI_list_free(failed_resourc_alloc_reportsList); + failed_resourc_alloc_reportsList = NULL; + } + if (succ_resourc_alloc_reportsList) { + OpenAPI_list_for_each(succ_resourc_alloc_reportsList, node) { + OpenAPI_resources_allocation_info_free(node->data); + } + OpenAPI_list_free(succ_resourc_alloc_reportsList); + succ_resourc_alloc_reportsList = NULL; + } + if (out_of_cred_reportsList) { + OpenAPI_list_for_each(out_of_cred_reportsList, node) { + OpenAPI_out_of_credit_information_free(node->data); + } + OpenAPI_list_free(out_of_cred_reportsList); + out_of_cred_reportsList = NULL; + } + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_nid_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (qnc_reportsList) { + OpenAPI_list_for_each(qnc_reportsList, node) { + OpenAPI_qos_notification_control_info_free(node->data); + } + OpenAPI_list_free(qnc_reportsList); + qnc_reportsList = NULL; + } + if (qos_mon_reportsList) { + OpenAPI_list_for_each(qos_mon_reportsList, node) { + OpenAPI_qos_monitoring_report_free(node->data); + } + OpenAPI_list_free(qos_mon_reportsList); + qos_mon_reportsList = NULL; + } + if (ran_nas_rel_causesList) { + OpenAPI_list_for_each(ran_nas_rel_causesList, node) { + OpenAPI_ran_nas_rel_cause_free(node->data); + } + OpenAPI_list_free(ran_nas_rel_causesList); + ran_nas_rel_causesList = NULL; + } + if (ue_loc_local_nonprim) { + OpenAPI_user_location_free(ue_loc_local_nonprim); + ue_loc_local_nonprim = NULL; + } + if (usg_rep_local_nonprim) { + OpenAPI_accumulated_usage_free(usg_rep_local_nonprim); + usg_rep_local_nonprim = NULL; + } + if (tsn_bridge_man_cont_local_nonprim) { + OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim); + tsn_bridge_man_cont_local_nonprim = NULL; + } + if (tsn_port_man_cont_dstt_local_nonprim) { + OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim); + tsn_port_man_cont_dstt_local_nonprim = NULL; + } + if (tsn_port_man_cont_nwttsList) { + OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + tsn_port_man_cont_nwttsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/events_subsc_put_data.c b/lib/sbi/openapi/model/events_subsc_put_data.c index c3073a13d..1e41a741f 100644 --- a/lib/sbi/openapi/model/events_subsc_put_data.c +++ b/lib/sbi/openapi/model/events_subsc_put_data.c @@ -76,73 +76,156 @@ OpenAPI_events_subsc_put_data_t *OpenAPI_events_subsc_put_data_create( void OpenAPI_events_subsc_put_data_free(OpenAPI_events_subsc_put_data_t *events_subsc_put_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == events_subsc_put_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(events_subsc_put_data->events, node) { - OpenAPI_af_event_subscription_free(node->data); + if (events_subsc_put_data->events) { + OpenAPI_list_for_each(events_subsc_put_data->events, node) { + OpenAPI_af_event_subscription_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->events); + events_subsc_put_data->events = NULL; } - OpenAPI_list_free(events_subsc_put_data->events); - ogs_free(events_subsc_put_data->notif_uri); - OpenAPI_list_free(events_subsc_put_data->req_qos_mon_params); - OpenAPI_qos_monitoring_information_free(events_subsc_put_data->qos_mon); - OpenAPI_list_free(events_subsc_put_data->req_anis); - OpenAPI_usage_threshold_free(events_subsc_put_data->usg_thres); - ogs_free(events_subsc_put_data->notif_corre_id); - OpenAPI_additional_access_info_free(events_subsc_put_data->add_access_info); - OpenAPI_additional_access_info_free(events_subsc_put_data->rel_access_info); - OpenAPI_acc_net_charging_address_free(events_subsc_put_data->an_charg_addr); - OpenAPI_list_for_each(events_subsc_put_data->an_charg_ids, node) { - OpenAPI_access_net_charging_identifier_free(node->data); + if (events_subsc_put_data->notif_uri) { + ogs_free(events_subsc_put_data->notif_uri); + events_subsc_put_data->notif_uri = NULL; } - OpenAPI_list_free(events_subsc_put_data->an_charg_ids); - OpenAPI_an_gw_address_free(events_subsc_put_data->an_gw_addr); - ogs_free(events_subsc_put_data->ev_subs_uri); - OpenAPI_list_for_each(events_subsc_put_data->ev_notifs, node) { - OpenAPI_af_event_notification_free(node->data); + if (events_subsc_put_data->req_qos_mon_params) { + OpenAPI_list_free(events_subsc_put_data->req_qos_mon_params); + events_subsc_put_data->req_qos_mon_params = NULL; } - OpenAPI_list_free(events_subsc_put_data->ev_notifs); - OpenAPI_list_for_each(events_subsc_put_data->failed_resourc_alloc_reports, node) { - OpenAPI_resources_allocation_info_free(node->data); + if (events_subsc_put_data->qos_mon) { + OpenAPI_qos_monitoring_information_free(events_subsc_put_data->qos_mon); + events_subsc_put_data->qos_mon = NULL; } - OpenAPI_list_free(events_subsc_put_data->failed_resourc_alloc_reports); - OpenAPI_list_for_each(events_subsc_put_data->succ_resourc_alloc_reports, node) { - OpenAPI_resources_allocation_info_free(node->data); + if (events_subsc_put_data->req_anis) { + OpenAPI_list_free(events_subsc_put_data->req_anis); + events_subsc_put_data->req_anis = NULL; } - OpenAPI_list_free(events_subsc_put_data->succ_resourc_alloc_reports); - OpenAPI_list_for_each(events_subsc_put_data->out_of_cred_reports, node) { - OpenAPI_out_of_credit_information_free(node->data); + if (events_subsc_put_data->usg_thres) { + OpenAPI_usage_threshold_free(events_subsc_put_data->usg_thres); + events_subsc_put_data->usg_thres = NULL; } - OpenAPI_list_free(events_subsc_put_data->out_of_cred_reports); - OpenAPI_plmn_id_nid_free(events_subsc_put_data->plmn_id); - OpenAPI_list_for_each(events_subsc_put_data->qnc_reports, node) { - OpenAPI_qos_notification_control_info_free(node->data); + if (events_subsc_put_data->notif_corre_id) { + ogs_free(events_subsc_put_data->notif_corre_id); + events_subsc_put_data->notif_corre_id = NULL; } - OpenAPI_list_free(events_subsc_put_data->qnc_reports); - OpenAPI_list_for_each(events_subsc_put_data->qos_mon_reports, node) { - OpenAPI_qos_monitoring_report_free(node->data); + if (events_subsc_put_data->add_access_info) { + OpenAPI_additional_access_info_free(events_subsc_put_data->add_access_info); + events_subsc_put_data->add_access_info = NULL; } - OpenAPI_list_free(events_subsc_put_data->qos_mon_reports); - OpenAPI_list_for_each(events_subsc_put_data->ran_nas_rel_causes, node) { - OpenAPI_ran_nas_rel_cause_free(node->data); + if (events_subsc_put_data->rel_access_info) { + OpenAPI_additional_access_info_free(events_subsc_put_data->rel_access_info); + events_subsc_put_data->rel_access_info = NULL; } - OpenAPI_list_free(events_subsc_put_data->ran_nas_rel_causes); - OpenAPI_user_location_free(events_subsc_put_data->ue_loc); - ogs_free(events_subsc_put_data->ue_time_zone); - OpenAPI_accumulated_usage_free(events_subsc_put_data->usg_rep); - OpenAPI_bridge_management_container_free(events_subsc_put_data->tsn_bridge_man_cont); - OpenAPI_port_management_container_free(events_subsc_put_data->tsn_port_man_cont_dstt); - OpenAPI_list_for_each(events_subsc_put_data->tsn_port_man_cont_nwtts, node) { - OpenAPI_port_management_container_free(node->data); + if (events_subsc_put_data->an_charg_addr) { + OpenAPI_acc_net_charging_address_free(events_subsc_put_data->an_charg_addr); + events_subsc_put_data->an_charg_addr = NULL; + } + if (events_subsc_put_data->an_charg_ids) { + OpenAPI_list_for_each(events_subsc_put_data->an_charg_ids, node) { + OpenAPI_access_net_charging_identifier_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->an_charg_ids); + events_subsc_put_data->an_charg_ids = NULL; + } + if (events_subsc_put_data->an_gw_addr) { + OpenAPI_an_gw_address_free(events_subsc_put_data->an_gw_addr); + events_subsc_put_data->an_gw_addr = NULL; + } + if (events_subsc_put_data->ev_subs_uri) { + ogs_free(events_subsc_put_data->ev_subs_uri); + events_subsc_put_data->ev_subs_uri = NULL; + } + if (events_subsc_put_data->ev_notifs) { + OpenAPI_list_for_each(events_subsc_put_data->ev_notifs, node) { + OpenAPI_af_event_notification_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->ev_notifs); + events_subsc_put_data->ev_notifs = NULL; + } + if (events_subsc_put_data->failed_resourc_alloc_reports) { + OpenAPI_list_for_each(events_subsc_put_data->failed_resourc_alloc_reports, node) { + OpenAPI_resources_allocation_info_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->failed_resourc_alloc_reports); + events_subsc_put_data->failed_resourc_alloc_reports = NULL; + } + if (events_subsc_put_data->succ_resourc_alloc_reports) { + OpenAPI_list_for_each(events_subsc_put_data->succ_resourc_alloc_reports, node) { + OpenAPI_resources_allocation_info_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->succ_resourc_alloc_reports); + events_subsc_put_data->succ_resourc_alloc_reports = NULL; + } + if (events_subsc_put_data->out_of_cred_reports) { + OpenAPI_list_for_each(events_subsc_put_data->out_of_cred_reports, node) { + OpenAPI_out_of_credit_information_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->out_of_cred_reports); + events_subsc_put_data->out_of_cred_reports = NULL; + } + if (events_subsc_put_data->plmn_id) { + OpenAPI_plmn_id_nid_free(events_subsc_put_data->plmn_id); + events_subsc_put_data->plmn_id = NULL; + } + if (events_subsc_put_data->qnc_reports) { + OpenAPI_list_for_each(events_subsc_put_data->qnc_reports, node) { + OpenAPI_qos_notification_control_info_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->qnc_reports); + events_subsc_put_data->qnc_reports = NULL; + } + if (events_subsc_put_data->qos_mon_reports) { + OpenAPI_list_for_each(events_subsc_put_data->qos_mon_reports, node) { + OpenAPI_qos_monitoring_report_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->qos_mon_reports); + events_subsc_put_data->qos_mon_reports = NULL; + } + if (events_subsc_put_data->ran_nas_rel_causes) { + OpenAPI_list_for_each(events_subsc_put_data->ran_nas_rel_causes, node) { + OpenAPI_ran_nas_rel_cause_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->ran_nas_rel_causes); + events_subsc_put_data->ran_nas_rel_causes = NULL; + } + if (events_subsc_put_data->ue_loc) { + OpenAPI_user_location_free(events_subsc_put_data->ue_loc); + events_subsc_put_data->ue_loc = NULL; + } + if (events_subsc_put_data->ue_time_zone) { + ogs_free(events_subsc_put_data->ue_time_zone); + events_subsc_put_data->ue_time_zone = NULL; + } + if (events_subsc_put_data->usg_rep) { + OpenAPI_accumulated_usage_free(events_subsc_put_data->usg_rep); + events_subsc_put_data->usg_rep = NULL; + } + if (events_subsc_put_data->tsn_bridge_man_cont) { + OpenAPI_bridge_management_container_free(events_subsc_put_data->tsn_bridge_man_cont); + events_subsc_put_data->tsn_bridge_man_cont = NULL; + } + if (events_subsc_put_data->tsn_port_man_cont_dstt) { + OpenAPI_port_management_container_free(events_subsc_put_data->tsn_port_man_cont_dstt); + events_subsc_put_data->tsn_port_man_cont_dstt = NULL; + } + if (events_subsc_put_data->tsn_port_man_cont_nwtts) { + OpenAPI_list_for_each(events_subsc_put_data->tsn_port_man_cont_nwtts, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(events_subsc_put_data->tsn_port_man_cont_nwtts); + events_subsc_put_data->tsn_port_man_cont_nwtts = NULL; } - OpenAPI_list_free(events_subsc_put_data->tsn_port_man_cont_nwtts); ogs_free(events_subsc_put_data); } cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data_t *events_subsc_put_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (events_subsc_put_data == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [EventsSubscPutData]"); @@ -150,22 +233,22 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data } item = cJSON_CreateObject(); + if (!events_subsc_put_data->events) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [events]"); + return NULL; + } cJSON *eventsList = cJSON_AddArrayToObject(item, "events"); if (eventsList == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [events]"); goto end; } - - OpenAPI_lnode_t *events_node; - if (events_subsc_put_data->events) { - OpenAPI_list_for_each(events_subsc_put_data->events, events_node) { - cJSON *itemLocal = OpenAPI_af_event_subscription_convertToJSON(events_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [events]"); - goto end; - } - cJSON_AddItemToArray(eventsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->events, node) { + cJSON *itemLocal = OpenAPI_af_event_subscription_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [events]"); + goto end; } + cJSON_AddItemToArray(eventsList, itemLocal); } if (events_subsc_put_data->notif_uri) { @@ -175,15 +258,14 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data } } - if (events_subsc_put_data->req_qos_mon_params) { - cJSON *req_qos_mon_params = cJSON_AddArrayToObject(item, "reqQosMonParams"); - if (req_qos_mon_params == NULL) { + if (events_subsc_put_data->req_qos_mon_params != OpenAPI_requested_qos_monitoring_parameter_NULL) { + cJSON *req_qos_mon_paramsList = cJSON_AddArrayToObject(item, "reqQosMonParams"); + if (req_qos_mon_paramsList == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [req_qos_mon_params]"); goto end; } - OpenAPI_lnode_t *req_qos_mon_params_node; - OpenAPI_list_for_each(events_subsc_put_data->req_qos_mon_params, req_qos_mon_params_node) { - if (cJSON_AddStringToObject(req_qos_mon_params, "", OpenAPI_requested_qos_monitoring_parameter_ToString((intptr_t)req_qos_mon_params_node->data)) == NULL) { + OpenAPI_list_for_each(events_subsc_put_data->req_qos_mon_params, node) { + if (cJSON_AddStringToObject(req_qos_mon_paramsList, "", OpenAPI_requested_qos_monitoring_parameter_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [req_qos_mon_params]"); goto end; } @@ -203,15 +285,14 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data } } - if (events_subsc_put_data->req_anis) { - cJSON *req_anis = cJSON_AddArrayToObject(item, "reqAnis"); - if (req_anis == NULL) { + if (events_subsc_put_data->req_anis != OpenAPI_required_access_info_NULL) { + cJSON *req_anisList = cJSON_AddArrayToObject(item, "reqAnis"); + if (req_anisList == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [req_anis]"); goto end; } - OpenAPI_lnode_t *req_anis_node; - OpenAPI_list_for_each(events_subsc_put_data->req_anis, req_anis_node) { - if (cJSON_AddStringToObject(req_anis, "", OpenAPI_required_access_info_ToString((intptr_t)req_anis_node->data)) == NULL) { + OpenAPI_list_for_each(events_subsc_put_data->req_anis, node) { + if (cJSON_AddStringToObject(req_anisList, "", OpenAPI_required_access_info_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [req_anis]"); goto end; } @@ -238,7 +319,7 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data } } - if (events_subsc_put_data->access_type) { + if (events_subsc_put_data->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(events_subsc_put_data->access_type)) == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [access_type]"); goto end; @@ -290,17 +371,13 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [an_charg_ids]"); goto end; } - - OpenAPI_lnode_t *an_charg_ids_node; - if (events_subsc_put_data->an_charg_ids) { - OpenAPI_list_for_each(events_subsc_put_data->an_charg_ids, an_charg_ids_node) { - cJSON *itemLocal = OpenAPI_access_net_charging_identifier_convertToJSON(an_charg_ids_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [an_charg_ids]"); - goto end; - } - cJSON_AddItemToArray(an_charg_idsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->an_charg_ids, node) { + cJSON *itemLocal = OpenAPI_access_net_charging_identifier_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [an_charg_ids]"); + goto end; } + cJSON_AddItemToArray(an_charg_idsList, itemLocal); } } @@ -317,27 +394,31 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data } } + if (!events_subsc_put_data->ev_subs_uri) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ev_subs_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "evSubsUri", events_subsc_put_data->ev_subs_uri) == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ev_subs_uri]"); goto end; } + if (!events_subsc_put_data->ev_notifs) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ev_notifs]"); + return NULL; + } cJSON *ev_notifsList = cJSON_AddArrayToObject(item, "evNotifs"); if (ev_notifsList == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ev_notifs]"); goto end; } - - OpenAPI_lnode_t *ev_notifs_node; - if (events_subsc_put_data->ev_notifs) { - OpenAPI_list_for_each(events_subsc_put_data->ev_notifs, ev_notifs_node) { - cJSON *itemLocal = OpenAPI_af_event_notification_convertToJSON(ev_notifs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ev_notifs]"); - goto end; - } - cJSON_AddItemToArray(ev_notifsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->ev_notifs, node) { + cJSON *itemLocal = OpenAPI_af_event_notification_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ev_notifs]"); + goto end; } + cJSON_AddItemToArray(ev_notifsList, itemLocal); } if (events_subsc_put_data->failed_resourc_alloc_reports) { @@ -346,17 +427,13 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [failed_resourc_alloc_reports]"); goto end; } - - OpenAPI_lnode_t *failed_resourc_alloc_reports_node; - if (events_subsc_put_data->failed_resourc_alloc_reports) { - OpenAPI_list_for_each(events_subsc_put_data->failed_resourc_alloc_reports, failed_resourc_alloc_reports_node) { - cJSON *itemLocal = OpenAPI_resources_allocation_info_convertToJSON(failed_resourc_alloc_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [failed_resourc_alloc_reports]"); - goto end; - } - cJSON_AddItemToArray(failed_resourc_alloc_reportsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->failed_resourc_alloc_reports, node) { + cJSON *itemLocal = OpenAPI_resources_allocation_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [failed_resourc_alloc_reports]"); + goto end; } + cJSON_AddItemToArray(failed_resourc_alloc_reportsList, itemLocal); } } @@ -366,21 +443,17 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [succ_resourc_alloc_reports]"); goto end; } - - OpenAPI_lnode_t *succ_resourc_alloc_reports_node; - if (events_subsc_put_data->succ_resourc_alloc_reports) { - OpenAPI_list_for_each(events_subsc_put_data->succ_resourc_alloc_reports, succ_resourc_alloc_reports_node) { - cJSON *itemLocal = OpenAPI_resources_allocation_info_convertToJSON(succ_resourc_alloc_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [succ_resourc_alloc_reports]"); - goto end; - } - cJSON_AddItemToArray(succ_resourc_alloc_reportsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->succ_resourc_alloc_reports, node) { + cJSON *itemLocal = OpenAPI_resources_allocation_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [succ_resourc_alloc_reports]"); + goto end; } + cJSON_AddItemToArray(succ_resourc_alloc_reportsList, itemLocal); } } - if (events_subsc_put_data->no_net_loc_supp) { + if (events_subsc_put_data->no_net_loc_supp != OpenAPI_net_loc_access_support_NULL) { if (cJSON_AddStringToObject(item, "noNetLocSupp", OpenAPI_net_loc_access_support_ToString(events_subsc_put_data->no_net_loc_supp)) == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [no_net_loc_supp]"); goto end; @@ -393,17 +466,13 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [out_of_cred_reports]"); goto end; } - - OpenAPI_lnode_t *out_of_cred_reports_node; - if (events_subsc_put_data->out_of_cred_reports) { - OpenAPI_list_for_each(events_subsc_put_data->out_of_cred_reports, out_of_cred_reports_node) { - cJSON *itemLocal = OpenAPI_out_of_credit_information_convertToJSON(out_of_cred_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [out_of_cred_reports]"); - goto end; - } - cJSON_AddItemToArray(out_of_cred_reportsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->out_of_cred_reports, node) { + cJSON *itemLocal = OpenAPI_out_of_credit_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [out_of_cred_reports]"); + goto end; } + cJSON_AddItemToArray(out_of_cred_reportsList, itemLocal); } } @@ -426,17 +495,13 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [qnc_reports]"); goto end; } - - OpenAPI_lnode_t *qnc_reports_node; - if (events_subsc_put_data->qnc_reports) { - OpenAPI_list_for_each(events_subsc_put_data->qnc_reports, qnc_reports_node) { - cJSON *itemLocal = OpenAPI_qos_notification_control_info_convertToJSON(qnc_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [qnc_reports]"); - goto end; - } - cJSON_AddItemToArray(qnc_reportsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->qnc_reports, node) { + cJSON *itemLocal = OpenAPI_qos_notification_control_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [qnc_reports]"); + goto end; } + cJSON_AddItemToArray(qnc_reportsList, itemLocal); } } @@ -446,17 +511,13 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [qos_mon_reports]"); goto end; } - - OpenAPI_lnode_t *qos_mon_reports_node; - if (events_subsc_put_data->qos_mon_reports) { - OpenAPI_list_for_each(events_subsc_put_data->qos_mon_reports, qos_mon_reports_node) { - cJSON *itemLocal = OpenAPI_qos_monitoring_report_convertToJSON(qos_mon_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [qos_mon_reports]"); - goto end; - } - cJSON_AddItemToArray(qos_mon_reportsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->qos_mon_reports, node) { + cJSON *itemLocal = OpenAPI_qos_monitoring_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [qos_mon_reports]"); + goto end; } + cJSON_AddItemToArray(qos_mon_reportsList, itemLocal); } } @@ -466,21 +527,17 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ran_nas_rel_causes]"); goto end; } - - OpenAPI_lnode_t *ran_nas_rel_causes_node; - if (events_subsc_put_data->ran_nas_rel_causes) { - OpenAPI_list_for_each(events_subsc_put_data->ran_nas_rel_causes, ran_nas_rel_causes_node) { - cJSON *itemLocal = OpenAPI_ran_nas_rel_cause_convertToJSON(ran_nas_rel_causes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ran_nas_rel_causes]"); - goto end; - } - cJSON_AddItemToArray(ran_nas_rel_causesList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->ran_nas_rel_causes, node) { + cJSON *itemLocal = OpenAPI_ran_nas_rel_cause_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [ran_nas_rel_causes]"); + goto end; } + cJSON_AddItemToArray(ran_nas_rel_causesList, itemLocal); } } - if (events_subsc_put_data->rat_type) { + if (events_subsc_put_data->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(events_subsc_put_data->rat_type)) == NULL) { ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [rat_type]"); goto end; @@ -552,17 +609,13 @@ cJSON *OpenAPI_events_subsc_put_data_convertToJSON(OpenAPI_events_subsc_put_data ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - - OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node; - if (events_subsc_put_data->tsn_port_man_cont_nwtts) { - OpenAPI_list_for_each(events_subsc_put_data->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) { - cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); + OpenAPI_list_for_each(events_subsc_put_data->tsn_port_man_cont_nwtts, node) { + cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_put_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; } + cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); } } @@ -573,116 +626,155 @@ end: OpenAPI_events_subsc_put_data_t *OpenAPI_events_subsc_put_data_parseFromJSON(cJSON *events_subsc_put_dataJSON) { OpenAPI_events_subsc_put_data_t *events_subsc_put_data_local_var = NULL; - cJSON *events = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "events"); + OpenAPI_lnode_t *node = NULL; + cJSON *events = NULL; + OpenAPI_list_t *eventsList = NULL; + cJSON *notif_uri = NULL; + cJSON *req_qos_mon_params = NULL; + OpenAPI_list_t *req_qos_mon_paramsList = NULL; + cJSON *qos_mon = NULL; + OpenAPI_qos_monitoring_information_t *qos_mon_local_nonprim = NULL; + cJSON *req_anis = NULL; + OpenAPI_list_t *req_anisList = NULL; + cJSON *usg_thres = NULL; + OpenAPI_usage_threshold_t *usg_thres_local_nonprim = NULL; + cJSON *notif_corre_id = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *add_access_info = NULL; + OpenAPI_additional_access_info_t *add_access_info_local_nonprim = NULL; + cJSON *rel_access_info = NULL; + OpenAPI_additional_access_info_t *rel_access_info_local_nonprim = NULL; + cJSON *an_charg_addr = NULL; + OpenAPI_acc_net_charging_address_t *an_charg_addr_local_nonprim = NULL; + cJSON *an_charg_ids = NULL; + OpenAPI_list_t *an_charg_idsList = NULL; + cJSON *an_gw_addr = NULL; + OpenAPI_an_gw_address_t *an_gw_addr_local_nonprim = NULL; + cJSON *ev_subs_uri = NULL; + cJSON *ev_notifs = NULL; + OpenAPI_list_t *ev_notifsList = NULL; + cJSON *failed_resourc_alloc_reports = NULL; + OpenAPI_list_t *failed_resourc_alloc_reportsList = NULL; + cJSON *succ_resourc_alloc_reports = NULL; + OpenAPI_list_t *succ_resourc_alloc_reportsList = NULL; + cJSON *no_net_loc_supp = NULL; + OpenAPI_net_loc_access_support_e no_net_loc_suppVariable = 0; + cJSON *out_of_cred_reports = NULL; + OpenAPI_list_t *out_of_cred_reportsList = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_nid_t *plmn_id_local_nonprim = NULL; + cJSON *qnc_reports = NULL; + OpenAPI_list_t *qnc_reportsList = NULL; + cJSON *qos_mon_reports = NULL; + OpenAPI_list_t *qos_mon_reportsList = NULL; + cJSON *ran_nas_rel_causes = NULL; + OpenAPI_list_t *ran_nas_rel_causesList = NULL; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *ue_loc = NULL; + OpenAPI_user_location_t *ue_loc_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *usg_rep = NULL; + OpenAPI_accumulated_usage_t *usg_rep_local_nonprim = NULL; + cJSON *tsn_bridge_man_cont = NULL; + OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + cJSON *tsn_port_man_cont_dstt = NULL; + OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + cJSON *tsn_port_man_cont_nwtts = NULL; + OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL; + events = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "events"); if (!events) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [events]"); goto end; } - - OpenAPI_list_t *eventsList; - cJSON *events_local_nonprimitive; - if (!cJSON_IsArray(events)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [events]"); - goto end; - } - - eventsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(events_local_nonprimitive, events ) { - if (!cJSON_IsObject(events_local_nonprimitive)) { + cJSON *events_local = NULL; + if (!cJSON_IsArray(events)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [events]"); goto end; } - OpenAPI_af_event_subscription_t *eventsItem = OpenAPI_af_event_subscription_parseFromJSON(events_local_nonprimitive); - if (!eventsItem) { - ogs_error("No eventsItem"); - OpenAPI_list_free(eventsList); - goto end; + eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(events_local, events) { + if (!cJSON_IsObject(events_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [events]"); + goto end; + } + OpenAPI_af_event_subscription_t *eventsItem = OpenAPI_af_event_subscription_parseFromJSON(events_local); + if (!eventsItem) { + ogs_error("No eventsItem"); + OpenAPI_list_free(eventsList); + goto end; + } + OpenAPI_list_add(eventsList, eventsItem); } - OpenAPI_list_add(eventsList, eventsItem); - } - - cJSON *notif_uri = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "notifUri"); - + notif_uri = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "notifUri"); if (notif_uri) { - if (!cJSON_IsString(notif_uri)) { + if (!cJSON_IsString(notif_uri) && !cJSON_IsNull(notif_uri)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [notif_uri]"); goto end; } } - cJSON *req_qos_mon_params = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "reqQosMonParams"); - - OpenAPI_list_t *req_qos_mon_paramsList; + req_qos_mon_params = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "reqQosMonParams"); if (req_qos_mon_params) { - cJSON *req_qos_mon_params_local_nonprimitive; - if (!cJSON_IsArray(req_qos_mon_params)) { - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [req_qos_mon_params]"); - goto end; - } - - req_qos_mon_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_qos_mon_params_local_nonprimitive, req_qos_mon_params ) { - if (!cJSON_IsString(req_qos_mon_params_local_nonprimitive)){ + cJSON *req_qos_mon_params_local = NULL; + if (!cJSON_IsArray(req_qos_mon_params)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [req_qos_mon_params]"); goto end; } - OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local_nonprimitive->valuestring)); - } + req_qos_mon_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_qos_mon_params_local, req_qos_mon_params) { + if (!cJSON_IsString(req_qos_mon_params_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [req_qos_mon_params]"); + goto end; + } + OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local->valuestring)); + } } - cJSON *qos_mon = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "qosMon"); - - OpenAPI_qos_monitoring_information_t *qos_mon_local_nonprim = NULL; + qos_mon = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "qosMon"); if (qos_mon) { qos_mon_local_nonprim = OpenAPI_qos_monitoring_information_parseFromJSON(qos_mon); } - cJSON *req_anis = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "reqAnis"); - - OpenAPI_list_t *req_anisList; + req_anis = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "reqAnis"); if (req_anis) { - cJSON *req_anis_local_nonprimitive; - if (!cJSON_IsArray(req_anis)) { - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [req_anis]"); - goto end; - } - - req_anisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_anis_local_nonprimitive, req_anis ) { - if (!cJSON_IsString(req_anis_local_nonprimitive)){ + cJSON *req_anis_local = NULL; + if (!cJSON_IsArray(req_anis)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [req_anis]"); goto end; } - OpenAPI_list_add(req_anisList, (void *)OpenAPI_required_access_info_FromString(req_anis_local_nonprimitive->valuestring)); - } + req_anisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_anis_local, req_anis) { + if (!cJSON_IsString(req_anis_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [req_anis]"); + goto end; + } + OpenAPI_list_add(req_anisList, (void *)OpenAPI_required_access_info_FromString(req_anis_local->valuestring)); + } } - cJSON *usg_thres = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "usgThres"); - - OpenAPI_usage_threshold_t *usg_thres_local_nonprim = NULL; + usg_thres = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "usgThres"); if (usg_thres) { usg_thres_local_nonprim = OpenAPI_usage_threshold_parseFromJSON(usg_thres); } - cJSON *notif_corre_id = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "notifCorreId"); - + notif_corre_id = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "notifCorreId"); if (notif_corre_id) { - if (!cJSON_IsString(notif_corre_id)) { + if (!cJSON_IsString(notif_corre_id) && !cJSON_IsNull(notif_corre_id)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [notif_corre_id]"); goto end; } } - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + access_type = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [access_type]"); @@ -691,166 +783,139 @@ OpenAPI_events_subsc_put_data_t *OpenAPI_events_subsc_put_data_parseFromJSON(cJS access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *add_access_info = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "addAccessInfo"); - - OpenAPI_additional_access_info_t *add_access_info_local_nonprim = NULL; + add_access_info = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "addAccessInfo"); if (add_access_info) { add_access_info_local_nonprim = OpenAPI_additional_access_info_parseFromJSON(add_access_info); } - cJSON *rel_access_info = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "relAccessInfo"); - - OpenAPI_additional_access_info_t *rel_access_info_local_nonprim = NULL; + rel_access_info = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "relAccessInfo"); if (rel_access_info) { rel_access_info_local_nonprim = OpenAPI_additional_access_info_parseFromJSON(rel_access_info); } - cJSON *an_charg_addr = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "anChargAddr"); - - OpenAPI_acc_net_charging_address_t *an_charg_addr_local_nonprim = NULL; + an_charg_addr = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "anChargAddr"); if (an_charg_addr) { an_charg_addr_local_nonprim = OpenAPI_acc_net_charging_address_parseFromJSON(an_charg_addr); } - cJSON *an_charg_ids = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "anChargIds"); - - OpenAPI_list_t *an_charg_idsList; + an_charg_ids = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "anChargIds"); if (an_charg_ids) { - cJSON *an_charg_ids_local_nonprimitive; - if (!cJSON_IsArray(an_charg_ids)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [an_charg_ids]"); - goto end; - } - - an_charg_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(an_charg_ids_local_nonprimitive, an_charg_ids ) { - if (!cJSON_IsObject(an_charg_ids_local_nonprimitive)) { + cJSON *an_charg_ids_local = NULL; + if (!cJSON_IsArray(an_charg_ids)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [an_charg_ids]"); goto end; } - OpenAPI_access_net_charging_identifier_t *an_charg_idsItem = OpenAPI_access_net_charging_identifier_parseFromJSON(an_charg_ids_local_nonprimitive); - if (!an_charg_idsItem) { - ogs_error("No an_charg_idsItem"); - OpenAPI_list_free(an_charg_idsList); - goto end; + an_charg_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(an_charg_ids_local, an_charg_ids) { + if (!cJSON_IsObject(an_charg_ids_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [an_charg_ids]"); + goto end; + } + OpenAPI_access_net_charging_identifier_t *an_charg_idsItem = OpenAPI_access_net_charging_identifier_parseFromJSON(an_charg_ids_local); + if (!an_charg_idsItem) { + ogs_error("No an_charg_idsItem"); + OpenAPI_list_free(an_charg_idsList); + goto end; + } + OpenAPI_list_add(an_charg_idsList, an_charg_idsItem); } - - OpenAPI_list_add(an_charg_idsList, an_charg_idsItem); - } } - cJSON *an_gw_addr = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "anGwAddr"); - - OpenAPI_an_gw_address_t *an_gw_addr_local_nonprim = NULL; + an_gw_addr = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "anGwAddr"); if (an_gw_addr) { an_gw_addr_local_nonprim = OpenAPI_an_gw_address_parseFromJSON(an_gw_addr); } - cJSON *ev_subs_uri = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "evSubsUri"); + ev_subs_uri = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "evSubsUri"); if (!ev_subs_uri) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ev_subs_uri]"); goto end; } - if (!cJSON_IsString(ev_subs_uri)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ev_subs_uri]"); goto end; } - cJSON *ev_notifs = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "evNotifs"); + ev_notifs = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "evNotifs"); if (!ev_notifs) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ev_notifs]"); goto end; } - - OpenAPI_list_t *ev_notifsList; - cJSON *ev_notifs_local_nonprimitive; - if (!cJSON_IsArray(ev_notifs)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ev_notifs]"); - goto end; - } - - ev_notifsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ev_notifs_local_nonprimitive, ev_notifs ) { - if (!cJSON_IsObject(ev_notifs_local_nonprimitive)) { + cJSON *ev_notifs_local = NULL; + if (!cJSON_IsArray(ev_notifs)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ev_notifs]"); goto end; } - OpenAPI_af_event_notification_t *ev_notifsItem = OpenAPI_af_event_notification_parseFromJSON(ev_notifs_local_nonprimitive); - if (!ev_notifsItem) { - ogs_error("No ev_notifsItem"); - OpenAPI_list_free(ev_notifsList); - goto end; + ev_notifsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ev_notifs_local, ev_notifs) { + if (!cJSON_IsObject(ev_notifs_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ev_notifs]"); + goto end; + } + OpenAPI_af_event_notification_t *ev_notifsItem = OpenAPI_af_event_notification_parseFromJSON(ev_notifs_local); + if (!ev_notifsItem) { + ogs_error("No ev_notifsItem"); + OpenAPI_list_free(ev_notifsList); + goto end; + } + OpenAPI_list_add(ev_notifsList, ev_notifsItem); } - OpenAPI_list_add(ev_notifsList, ev_notifsItem); - } - - cJSON *failed_resourc_alloc_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "failedResourcAllocReports"); - - OpenAPI_list_t *failed_resourc_alloc_reportsList; + failed_resourc_alloc_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "failedResourcAllocReports"); if (failed_resourc_alloc_reports) { - cJSON *failed_resourc_alloc_reports_local_nonprimitive; - if (!cJSON_IsArray(failed_resourc_alloc_reports)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [failed_resourc_alloc_reports]"); - goto end; - } - - failed_resourc_alloc_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(failed_resourc_alloc_reports_local_nonprimitive, failed_resourc_alloc_reports ) { - if (!cJSON_IsObject(failed_resourc_alloc_reports_local_nonprimitive)) { + cJSON *failed_resourc_alloc_reports_local = NULL; + if (!cJSON_IsArray(failed_resourc_alloc_reports)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [failed_resourc_alloc_reports]"); goto end; } - OpenAPI_resources_allocation_info_t *failed_resourc_alloc_reportsItem = OpenAPI_resources_allocation_info_parseFromJSON(failed_resourc_alloc_reports_local_nonprimitive); - if (!failed_resourc_alloc_reportsItem) { - ogs_error("No failed_resourc_alloc_reportsItem"); - OpenAPI_list_free(failed_resourc_alloc_reportsList); - goto end; + failed_resourc_alloc_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(failed_resourc_alloc_reports_local, failed_resourc_alloc_reports) { + if (!cJSON_IsObject(failed_resourc_alloc_reports_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [failed_resourc_alloc_reports]"); + goto end; + } + OpenAPI_resources_allocation_info_t *failed_resourc_alloc_reportsItem = OpenAPI_resources_allocation_info_parseFromJSON(failed_resourc_alloc_reports_local); + if (!failed_resourc_alloc_reportsItem) { + ogs_error("No failed_resourc_alloc_reportsItem"); + OpenAPI_list_free(failed_resourc_alloc_reportsList); + goto end; + } + OpenAPI_list_add(failed_resourc_alloc_reportsList, failed_resourc_alloc_reportsItem); } - - OpenAPI_list_add(failed_resourc_alloc_reportsList, failed_resourc_alloc_reportsItem); - } } - cJSON *succ_resourc_alloc_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "succResourcAllocReports"); - - OpenAPI_list_t *succ_resourc_alloc_reportsList; + succ_resourc_alloc_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "succResourcAllocReports"); if (succ_resourc_alloc_reports) { - cJSON *succ_resourc_alloc_reports_local_nonprimitive; - if (!cJSON_IsArray(succ_resourc_alloc_reports)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [succ_resourc_alloc_reports]"); - goto end; - } - - succ_resourc_alloc_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(succ_resourc_alloc_reports_local_nonprimitive, succ_resourc_alloc_reports ) { - if (!cJSON_IsObject(succ_resourc_alloc_reports_local_nonprimitive)) { + cJSON *succ_resourc_alloc_reports_local = NULL; + if (!cJSON_IsArray(succ_resourc_alloc_reports)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [succ_resourc_alloc_reports]"); goto end; } - OpenAPI_resources_allocation_info_t *succ_resourc_alloc_reportsItem = OpenAPI_resources_allocation_info_parseFromJSON(succ_resourc_alloc_reports_local_nonprimitive); - if (!succ_resourc_alloc_reportsItem) { - ogs_error("No succ_resourc_alloc_reportsItem"); - OpenAPI_list_free(succ_resourc_alloc_reportsList); - goto end; + succ_resourc_alloc_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(succ_resourc_alloc_reports_local, succ_resourc_alloc_reports) { + if (!cJSON_IsObject(succ_resourc_alloc_reports_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [succ_resourc_alloc_reports]"); + goto end; + } + OpenAPI_resources_allocation_info_t *succ_resourc_alloc_reportsItem = OpenAPI_resources_allocation_info_parseFromJSON(succ_resourc_alloc_reports_local); + if (!succ_resourc_alloc_reportsItem) { + ogs_error("No succ_resourc_alloc_reportsItem"); + OpenAPI_list_free(succ_resourc_alloc_reportsList); + goto end; + } + OpenAPI_list_add(succ_resourc_alloc_reportsList, succ_resourc_alloc_reportsItem); } - - OpenAPI_list_add(succ_resourc_alloc_reportsList, succ_resourc_alloc_reportsItem); - } } - cJSON *no_net_loc_supp = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "noNetLocSupp"); - - OpenAPI_net_loc_access_support_e no_net_loc_suppVariable; + no_net_loc_supp = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "noNetLocSupp"); if (no_net_loc_supp) { if (!cJSON_IsString(no_net_loc_supp)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [no_net_loc_supp]"); @@ -859,132 +924,112 @@ OpenAPI_events_subsc_put_data_t *OpenAPI_events_subsc_put_data_parseFromJSON(cJS no_net_loc_suppVariable = OpenAPI_net_loc_access_support_FromString(no_net_loc_supp->valuestring); } - cJSON *out_of_cred_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "outOfCredReports"); - - OpenAPI_list_t *out_of_cred_reportsList; + out_of_cred_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "outOfCredReports"); if (out_of_cred_reports) { - cJSON *out_of_cred_reports_local_nonprimitive; - if (!cJSON_IsArray(out_of_cred_reports)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [out_of_cred_reports]"); - goto end; - } - - out_of_cred_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(out_of_cred_reports_local_nonprimitive, out_of_cred_reports ) { - if (!cJSON_IsObject(out_of_cred_reports_local_nonprimitive)) { + cJSON *out_of_cred_reports_local = NULL; + if (!cJSON_IsArray(out_of_cred_reports)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [out_of_cred_reports]"); goto end; } - OpenAPI_out_of_credit_information_t *out_of_cred_reportsItem = OpenAPI_out_of_credit_information_parseFromJSON(out_of_cred_reports_local_nonprimitive); - if (!out_of_cred_reportsItem) { - ogs_error("No out_of_cred_reportsItem"); - OpenAPI_list_free(out_of_cred_reportsList); - goto end; + out_of_cred_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(out_of_cred_reports_local, out_of_cred_reports) { + if (!cJSON_IsObject(out_of_cred_reports_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [out_of_cred_reports]"); + goto end; + } + OpenAPI_out_of_credit_information_t *out_of_cred_reportsItem = OpenAPI_out_of_credit_information_parseFromJSON(out_of_cred_reports_local); + if (!out_of_cred_reportsItem) { + ogs_error("No out_of_cred_reportsItem"); + OpenAPI_list_free(out_of_cred_reportsList); + goto end; + } + OpenAPI_list_add(out_of_cred_reportsList, out_of_cred_reportsItem); } - - OpenAPI_list_add(out_of_cred_reportsList, out_of_cred_reportsItem); - } } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "plmnId"); - - OpenAPI_plmn_id_nid_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(plmn_id); } - cJSON *qnc_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "qncReports"); - - OpenAPI_list_t *qnc_reportsList; + qnc_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "qncReports"); if (qnc_reports) { - cJSON *qnc_reports_local_nonprimitive; - if (!cJSON_IsArray(qnc_reports)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [qnc_reports]"); - goto end; - } - - qnc_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qnc_reports_local_nonprimitive, qnc_reports ) { - if (!cJSON_IsObject(qnc_reports_local_nonprimitive)) { + cJSON *qnc_reports_local = NULL; + if (!cJSON_IsArray(qnc_reports)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [qnc_reports]"); goto end; } - OpenAPI_qos_notification_control_info_t *qnc_reportsItem = OpenAPI_qos_notification_control_info_parseFromJSON(qnc_reports_local_nonprimitive); - if (!qnc_reportsItem) { - ogs_error("No qnc_reportsItem"); - OpenAPI_list_free(qnc_reportsList); - goto end; + qnc_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qnc_reports_local, qnc_reports) { + if (!cJSON_IsObject(qnc_reports_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [qnc_reports]"); + goto end; + } + OpenAPI_qos_notification_control_info_t *qnc_reportsItem = OpenAPI_qos_notification_control_info_parseFromJSON(qnc_reports_local); + if (!qnc_reportsItem) { + ogs_error("No qnc_reportsItem"); + OpenAPI_list_free(qnc_reportsList); + goto end; + } + OpenAPI_list_add(qnc_reportsList, qnc_reportsItem); } - - OpenAPI_list_add(qnc_reportsList, qnc_reportsItem); - } } - cJSON *qos_mon_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "qosMonReports"); - - OpenAPI_list_t *qos_mon_reportsList; + qos_mon_reports = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "qosMonReports"); if (qos_mon_reports) { - cJSON *qos_mon_reports_local_nonprimitive; - if (!cJSON_IsArray(qos_mon_reports)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [qos_mon_reports]"); - goto end; - } - - qos_mon_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_mon_reports_local_nonprimitive, qos_mon_reports ) { - if (!cJSON_IsObject(qos_mon_reports_local_nonprimitive)) { + cJSON *qos_mon_reports_local = NULL; + if (!cJSON_IsArray(qos_mon_reports)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [qos_mon_reports]"); goto end; } - OpenAPI_qos_monitoring_report_t *qos_mon_reportsItem = OpenAPI_qos_monitoring_report_parseFromJSON(qos_mon_reports_local_nonprimitive); - if (!qos_mon_reportsItem) { - ogs_error("No qos_mon_reportsItem"); - OpenAPI_list_free(qos_mon_reportsList); - goto end; + qos_mon_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_mon_reports_local, qos_mon_reports) { + if (!cJSON_IsObject(qos_mon_reports_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [qos_mon_reports]"); + goto end; + } + OpenAPI_qos_monitoring_report_t *qos_mon_reportsItem = OpenAPI_qos_monitoring_report_parseFromJSON(qos_mon_reports_local); + if (!qos_mon_reportsItem) { + ogs_error("No qos_mon_reportsItem"); + OpenAPI_list_free(qos_mon_reportsList); + goto end; + } + OpenAPI_list_add(qos_mon_reportsList, qos_mon_reportsItem); } - - OpenAPI_list_add(qos_mon_reportsList, qos_mon_reportsItem); - } } - cJSON *ran_nas_rel_causes = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "ranNasRelCauses"); - - OpenAPI_list_t *ran_nas_rel_causesList; + ran_nas_rel_causes = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "ranNasRelCauses"); if (ran_nas_rel_causes) { - cJSON *ran_nas_rel_causes_local_nonprimitive; - if (!cJSON_IsArray(ran_nas_rel_causes)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ran_nas_rel_causes]"); - goto end; - } - - ran_nas_rel_causesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ran_nas_rel_causes_local_nonprimitive, ran_nas_rel_causes ) { - if (!cJSON_IsObject(ran_nas_rel_causes_local_nonprimitive)) { + cJSON *ran_nas_rel_causes_local = NULL; + if (!cJSON_IsArray(ran_nas_rel_causes)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ran_nas_rel_causes]"); goto end; } - OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_causesItem = OpenAPI_ran_nas_rel_cause_parseFromJSON(ran_nas_rel_causes_local_nonprimitive); - if (!ran_nas_rel_causesItem) { - ogs_error("No ran_nas_rel_causesItem"); - OpenAPI_list_free(ran_nas_rel_causesList); - goto end; + ran_nas_rel_causesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ran_nas_rel_causes_local, ran_nas_rel_causes) { + if (!cJSON_IsObject(ran_nas_rel_causes_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ran_nas_rel_causes]"); + goto end; + } + OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_causesItem = OpenAPI_ran_nas_rel_cause_parseFromJSON(ran_nas_rel_causes_local); + if (!ran_nas_rel_causesItem) { + ogs_error("No ran_nas_rel_causesItem"); + OpenAPI_list_free(ran_nas_rel_causesList); + goto end; + } + OpenAPI_list_add(ran_nas_rel_causesList, ran_nas_rel_causesItem); } - - OpenAPI_list_add(ran_nas_rel_causesList, ran_nas_rel_causesItem); - } } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [rat_type]"); @@ -993,80 +1038,67 @@ OpenAPI_events_subsc_put_data_t *OpenAPI_events_subsc_put_data_parseFromJSON(cJS rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *ue_loc = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "ueLoc"); - - OpenAPI_user_location_t *ue_loc_local_nonprim = NULL; + ue_loc = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "ueLoc"); if (ue_loc) { ue_loc_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_loc); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *usg_rep = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "usgRep"); - - OpenAPI_accumulated_usage_t *usg_rep_local_nonprim = NULL; + usg_rep = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "usgRep"); if (usg_rep) { usg_rep_local_nonprim = OpenAPI_accumulated_usage_parseFromJSON(usg_rep); } - cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "tsnBridgeManCont"); - - OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "tsnBridgeManCont"); if (tsn_bridge_man_cont) { tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont); } - cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "tsnPortManContDstt"); - - OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "tsnPortManContDstt"); if (tsn_port_man_cont_dstt) { tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt); } - cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "tsnPortManContNwtts"); - - OpenAPI_list_t *tsn_port_man_cont_nwttsList; + tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(events_subsc_put_dataJSON, "tsnPortManContNwtts"); if (tsn_port_man_cont_nwtts) { - cJSON *tsn_port_man_cont_nwtts_local_nonprimitive; - if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){ - ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - - tsn_port_man_cont_nwttsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) { - if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) { + cJSON *tsn_port_man_cont_nwtts_local = NULL; + if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) { ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive); - if (!tsn_port_man_cont_nwttsItem) { - ogs_error("No tsn_port_man_cont_nwttsItem"); - OpenAPI_list_free(tsn_port_man_cont_nwttsList); - goto end; + tsn_port_man_cont_nwttsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) { + if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) { + ogs_error("OpenAPI_events_subsc_put_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; + } + OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local); + if (!tsn_port_man_cont_nwttsItem) { + ogs_error("No tsn_port_man_cont_nwttsItem"); + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + goto end; + } + OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); } - - OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); - } } events_subsc_put_data_local_var = OpenAPI_events_subsc_put_data_create ( eventsList, - notif_uri ? ogs_strdup(notif_uri->valuestring) : NULL, + notif_uri && !cJSON_IsNull(notif_uri) ? ogs_strdup(notif_uri->valuestring) : NULL, req_qos_mon_params ? req_qos_mon_paramsList : NULL, qos_mon ? qos_mon_local_nonprim : NULL, req_anis ? req_anisList : NULL, usg_thres ? usg_thres_local_nonprim : NULL, - notif_corre_id ? ogs_strdup(notif_corre_id->valuestring) : NULL, + notif_corre_id && !cJSON_IsNull(notif_corre_id) ? ogs_strdup(notif_corre_id->valuestring) : NULL, access_type ? access_typeVariable : 0, add_access_info ? add_access_info_local_nonprim : NULL, rel_access_info ? rel_access_info_local_nonprim : NULL, @@ -1085,7 +1117,7 @@ OpenAPI_events_subsc_put_data_t *OpenAPI_events_subsc_put_data_parseFromJSON(cJS ran_nas_rel_causes ? ran_nas_rel_causesList : NULL, rat_type ? rat_typeVariable : 0, ue_loc ? ue_loc_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, usg_rep ? usg_rep_local_nonprim : NULL, tsn_bridge_man_cont ? tsn_bridge_man_cont_local_nonprim : NULL, tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL, @@ -1094,6 +1126,128 @@ OpenAPI_events_subsc_put_data_t *OpenAPI_events_subsc_put_data_parseFromJSON(cJS return events_subsc_put_data_local_var; end: + if (eventsList) { + OpenAPI_list_for_each(eventsList, node) { + OpenAPI_af_event_subscription_free(node->data); + } + OpenAPI_list_free(eventsList); + eventsList = NULL; + } + if (req_qos_mon_paramsList) { + OpenAPI_list_free(req_qos_mon_paramsList); + req_qos_mon_paramsList = NULL; + } + if (qos_mon_local_nonprim) { + OpenAPI_qos_monitoring_information_free(qos_mon_local_nonprim); + qos_mon_local_nonprim = NULL; + } + if (req_anisList) { + OpenAPI_list_free(req_anisList); + req_anisList = NULL; + } + if (usg_thres_local_nonprim) { + OpenAPI_usage_threshold_free(usg_thres_local_nonprim); + usg_thres_local_nonprim = NULL; + } + if (add_access_info_local_nonprim) { + OpenAPI_additional_access_info_free(add_access_info_local_nonprim); + add_access_info_local_nonprim = NULL; + } + if (rel_access_info_local_nonprim) { + OpenAPI_additional_access_info_free(rel_access_info_local_nonprim); + rel_access_info_local_nonprim = NULL; + } + if (an_charg_addr_local_nonprim) { + OpenAPI_acc_net_charging_address_free(an_charg_addr_local_nonprim); + an_charg_addr_local_nonprim = NULL; + } + if (an_charg_idsList) { + OpenAPI_list_for_each(an_charg_idsList, node) { + OpenAPI_access_net_charging_identifier_free(node->data); + } + OpenAPI_list_free(an_charg_idsList); + an_charg_idsList = NULL; + } + if (an_gw_addr_local_nonprim) { + OpenAPI_an_gw_address_free(an_gw_addr_local_nonprim); + an_gw_addr_local_nonprim = NULL; + } + if (ev_notifsList) { + OpenAPI_list_for_each(ev_notifsList, node) { + OpenAPI_af_event_notification_free(node->data); + } + OpenAPI_list_free(ev_notifsList); + ev_notifsList = NULL; + } + if (failed_resourc_alloc_reportsList) { + OpenAPI_list_for_each(failed_resourc_alloc_reportsList, node) { + OpenAPI_resources_allocation_info_free(node->data); + } + OpenAPI_list_free(failed_resourc_alloc_reportsList); + failed_resourc_alloc_reportsList = NULL; + } + if (succ_resourc_alloc_reportsList) { + OpenAPI_list_for_each(succ_resourc_alloc_reportsList, node) { + OpenAPI_resources_allocation_info_free(node->data); + } + OpenAPI_list_free(succ_resourc_alloc_reportsList); + succ_resourc_alloc_reportsList = NULL; + } + if (out_of_cred_reportsList) { + OpenAPI_list_for_each(out_of_cred_reportsList, node) { + OpenAPI_out_of_credit_information_free(node->data); + } + OpenAPI_list_free(out_of_cred_reportsList); + out_of_cred_reportsList = NULL; + } + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_nid_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (qnc_reportsList) { + OpenAPI_list_for_each(qnc_reportsList, node) { + OpenAPI_qos_notification_control_info_free(node->data); + } + OpenAPI_list_free(qnc_reportsList); + qnc_reportsList = NULL; + } + if (qos_mon_reportsList) { + OpenAPI_list_for_each(qos_mon_reportsList, node) { + OpenAPI_qos_monitoring_report_free(node->data); + } + OpenAPI_list_free(qos_mon_reportsList); + qos_mon_reportsList = NULL; + } + if (ran_nas_rel_causesList) { + OpenAPI_list_for_each(ran_nas_rel_causesList, node) { + OpenAPI_ran_nas_rel_cause_free(node->data); + } + OpenAPI_list_free(ran_nas_rel_causesList); + ran_nas_rel_causesList = NULL; + } + if (ue_loc_local_nonprim) { + OpenAPI_user_location_free(ue_loc_local_nonprim); + ue_loc_local_nonprim = NULL; + } + if (usg_rep_local_nonprim) { + OpenAPI_accumulated_usage_free(usg_rep_local_nonprim); + usg_rep_local_nonprim = NULL; + } + if (tsn_bridge_man_cont_local_nonprim) { + OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim); + tsn_bridge_man_cont_local_nonprim = NULL; + } + if (tsn_port_man_cont_dstt_local_nonprim) { + OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim); + tsn_port_man_cont_dstt_local_nonprim = NULL; + } + if (tsn_port_man_cont_nwttsList) { + OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + tsn_port_man_cont_nwttsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/events_subsc_req_data.c b/lib/sbi/openapi/model/events_subsc_req_data.c index 145832fbd..b5fbfdc51 100644 --- a/lib/sbi/openapi/model/events_subsc_req_data.c +++ b/lib/sbi/openapi/model/events_subsc_req_data.c @@ -30,26 +30,49 @@ OpenAPI_events_subsc_req_data_t *OpenAPI_events_subsc_req_data_create( void OpenAPI_events_subsc_req_data_free(OpenAPI_events_subsc_req_data_t *events_subsc_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == events_subsc_req_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(events_subsc_req_data->events, node) { - OpenAPI_af_event_subscription_free(node->data); + if (events_subsc_req_data->events) { + OpenAPI_list_for_each(events_subsc_req_data->events, node) { + OpenAPI_af_event_subscription_free(node->data); + } + OpenAPI_list_free(events_subsc_req_data->events); + events_subsc_req_data->events = NULL; + } + if (events_subsc_req_data->notif_uri) { + ogs_free(events_subsc_req_data->notif_uri); + events_subsc_req_data->notif_uri = NULL; + } + if (events_subsc_req_data->req_qos_mon_params) { + OpenAPI_list_free(events_subsc_req_data->req_qos_mon_params); + events_subsc_req_data->req_qos_mon_params = NULL; + } + if (events_subsc_req_data->qos_mon) { + OpenAPI_qos_monitoring_information_free(events_subsc_req_data->qos_mon); + events_subsc_req_data->qos_mon = NULL; + } + if (events_subsc_req_data->req_anis) { + OpenAPI_list_free(events_subsc_req_data->req_anis); + events_subsc_req_data->req_anis = NULL; + } + if (events_subsc_req_data->usg_thres) { + OpenAPI_usage_threshold_free(events_subsc_req_data->usg_thres); + events_subsc_req_data->usg_thres = NULL; + } + if (events_subsc_req_data->notif_corre_id) { + ogs_free(events_subsc_req_data->notif_corre_id); + events_subsc_req_data->notif_corre_id = NULL; } - OpenAPI_list_free(events_subsc_req_data->events); - ogs_free(events_subsc_req_data->notif_uri); - OpenAPI_list_free(events_subsc_req_data->req_qos_mon_params); - OpenAPI_qos_monitoring_information_free(events_subsc_req_data->qos_mon); - OpenAPI_list_free(events_subsc_req_data->req_anis); - OpenAPI_usage_threshold_free(events_subsc_req_data->usg_thres); - ogs_free(events_subsc_req_data->notif_corre_id); ogs_free(events_subsc_req_data); } cJSON *OpenAPI_events_subsc_req_data_convertToJSON(OpenAPI_events_subsc_req_data_t *events_subsc_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (events_subsc_req_data == NULL) { ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [EventsSubscReqData]"); @@ -57,22 +80,22 @@ cJSON *OpenAPI_events_subsc_req_data_convertToJSON(OpenAPI_events_subsc_req_data } item = cJSON_CreateObject(); + if (!events_subsc_req_data->events) { + ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [events]"); + return NULL; + } cJSON *eventsList = cJSON_AddArrayToObject(item, "events"); if (eventsList == NULL) { ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [events]"); goto end; } - - OpenAPI_lnode_t *events_node; - if (events_subsc_req_data->events) { - OpenAPI_list_for_each(events_subsc_req_data->events, events_node) { - cJSON *itemLocal = OpenAPI_af_event_subscription_convertToJSON(events_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [events]"); - goto end; - } - cJSON_AddItemToArray(eventsList, itemLocal); + OpenAPI_list_for_each(events_subsc_req_data->events, node) { + cJSON *itemLocal = OpenAPI_af_event_subscription_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [events]"); + goto end; } + cJSON_AddItemToArray(eventsList, itemLocal); } if (events_subsc_req_data->notif_uri) { @@ -82,15 +105,14 @@ cJSON *OpenAPI_events_subsc_req_data_convertToJSON(OpenAPI_events_subsc_req_data } } - if (events_subsc_req_data->req_qos_mon_params) { - cJSON *req_qos_mon_params = cJSON_AddArrayToObject(item, "reqQosMonParams"); - if (req_qos_mon_params == NULL) { + if (events_subsc_req_data->req_qos_mon_params != OpenAPI_requested_qos_monitoring_parameter_NULL) { + cJSON *req_qos_mon_paramsList = cJSON_AddArrayToObject(item, "reqQosMonParams"); + if (req_qos_mon_paramsList == NULL) { ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [req_qos_mon_params]"); goto end; } - OpenAPI_lnode_t *req_qos_mon_params_node; - OpenAPI_list_for_each(events_subsc_req_data->req_qos_mon_params, req_qos_mon_params_node) { - if (cJSON_AddStringToObject(req_qos_mon_params, "", OpenAPI_requested_qos_monitoring_parameter_ToString((intptr_t)req_qos_mon_params_node->data)) == NULL) { + OpenAPI_list_for_each(events_subsc_req_data->req_qos_mon_params, node) { + if (cJSON_AddStringToObject(req_qos_mon_paramsList, "", OpenAPI_requested_qos_monitoring_parameter_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [req_qos_mon_params]"); goto end; } @@ -110,15 +132,14 @@ cJSON *OpenAPI_events_subsc_req_data_convertToJSON(OpenAPI_events_subsc_req_data } } - if (events_subsc_req_data->req_anis) { - cJSON *req_anis = cJSON_AddArrayToObject(item, "reqAnis"); - if (req_anis == NULL) { + if (events_subsc_req_data->req_anis != OpenAPI_required_access_info_NULL) { + cJSON *req_anisList = cJSON_AddArrayToObject(item, "reqAnis"); + if (req_anisList == NULL) { ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [req_anis]"); goto end; } - OpenAPI_lnode_t *req_anis_node; - OpenAPI_list_for_each(events_subsc_req_data->req_anis, req_anis_node) { - if (cJSON_AddStringToObject(req_anis, "", OpenAPI_required_access_info_ToString((intptr_t)req_anis_node->data)) == NULL) { + OpenAPI_list_for_each(events_subsc_req_data->req_anis, node) { + if (cJSON_AddStringToObject(req_anisList, "", OpenAPI_required_access_info_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_events_subsc_req_data_convertToJSON() failed [req_anis]"); goto end; } @@ -152,108 +173,105 @@ end: OpenAPI_events_subsc_req_data_t *OpenAPI_events_subsc_req_data_parseFromJSON(cJSON *events_subsc_req_dataJSON) { OpenAPI_events_subsc_req_data_t *events_subsc_req_data_local_var = NULL; - cJSON *events = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "events"); + OpenAPI_lnode_t *node = NULL; + cJSON *events = NULL; + OpenAPI_list_t *eventsList = NULL; + cJSON *notif_uri = NULL; + cJSON *req_qos_mon_params = NULL; + OpenAPI_list_t *req_qos_mon_paramsList = NULL; + cJSON *qos_mon = NULL; + OpenAPI_qos_monitoring_information_t *qos_mon_local_nonprim = NULL; + cJSON *req_anis = NULL; + OpenAPI_list_t *req_anisList = NULL; + cJSON *usg_thres = NULL; + OpenAPI_usage_threshold_t *usg_thres_local_nonprim = NULL; + cJSON *notif_corre_id = NULL; + events = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "events"); if (!events) { ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [events]"); goto end; } - - OpenAPI_list_t *eventsList; - cJSON *events_local_nonprimitive; - if (!cJSON_IsArray(events)){ - ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [events]"); - goto end; - } - - eventsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(events_local_nonprimitive, events ) { - if (!cJSON_IsObject(events_local_nonprimitive)) { + cJSON *events_local = NULL; + if (!cJSON_IsArray(events)) { ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [events]"); goto end; } - OpenAPI_af_event_subscription_t *eventsItem = OpenAPI_af_event_subscription_parseFromJSON(events_local_nonprimitive); - if (!eventsItem) { - ogs_error("No eventsItem"); - OpenAPI_list_free(eventsList); - goto end; + eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(events_local, events) { + if (!cJSON_IsObject(events_local)) { + ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [events]"); + goto end; + } + OpenAPI_af_event_subscription_t *eventsItem = OpenAPI_af_event_subscription_parseFromJSON(events_local); + if (!eventsItem) { + ogs_error("No eventsItem"); + OpenAPI_list_free(eventsList); + goto end; + } + OpenAPI_list_add(eventsList, eventsItem); } - OpenAPI_list_add(eventsList, eventsItem); - } - - cJSON *notif_uri = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "notifUri"); - + notif_uri = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "notifUri"); if (notif_uri) { - if (!cJSON_IsString(notif_uri)) { + if (!cJSON_IsString(notif_uri) && !cJSON_IsNull(notif_uri)) { ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [notif_uri]"); goto end; } } - cJSON *req_qos_mon_params = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "reqQosMonParams"); - - OpenAPI_list_t *req_qos_mon_paramsList; + req_qos_mon_params = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "reqQosMonParams"); if (req_qos_mon_params) { - cJSON *req_qos_mon_params_local_nonprimitive; - if (!cJSON_IsArray(req_qos_mon_params)) { - ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [req_qos_mon_params]"); - goto end; - } - - req_qos_mon_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_qos_mon_params_local_nonprimitive, req_qos_mon_params ) { - if (!cJSON_IsString(req_qos_mon_params_local_nonprimitive)){ + cJSON *req_qos_mon_params_local = NULL; + if (!cJSON_IsArray(req_qos_mon_params)) { ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [req_qos_mon_params]"); goto end; } - OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local_nonprimitive->valuestring)); - } + req_qos_mon_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_qos_mon_params_local, req_qos_mon_params) { + if (!cJSON_IsString(req_qos_mon_params_local)) { + ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [req_qos_mon_params]"); + goto end; + } + OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local->valuestring)); + } } - cJSON *qos_mon = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "qosMon"); - - OpenAPI_qos_monitoring_information_t *qos_mon_local_nonprim = NULL; + qos_mon = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "qosMon"); if (qos_mon) { qos_mon_local_nonprim = OpenAPI_qos_monitoring_information_parseFromJSON(qos_mon); } - cJSON *req_anis = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "reqAnis"); - - OpenAPI_list_t *req_anisList; + req_anis = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "reqAnis"); if (req_anis) { - cJSON *req_anis_local_nonprimitive; - if (!cJSON_IsArray(req_anis)) { - ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [req_anis]"); - goto end; - } - - req_anisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_anis_local_nonprimitive, req_anis ) { - if (!cJSON_IsString(req_anis_local_nonprimitive)){ + cJSON *req_anis_local = NULL; + if (!cJSON_IsArray(req_anis)) { ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [req_anis]"); goto end; } - OpenAPI_list_add(req_anisList, (void *)OpenAPI_required_access_info_FromString(req_anis_local_nonprimitive->valuestring)); - } + req_anisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_anis_local, req_anis) { + if (!cJSON_IsString(req_anis_local)) { + ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [req_anis]"); + goto end; + } + OpenAPI_list_add(req_anisList, (void *)OpenAPI_required_access_info_FromString(req_anis_local->valuestring)); + } } - cJSON *usg_thres = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "usgThres"); - - OpenAPI_usage_threshold_t *usg_thres_local_nonprim = NULL; + usg_thres = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "usgThres"); if (usg_thres) { usg_thres_local_nonprim = OpenAPI_usage_threshold_parseFromJSON(usg_thres); } - cJSON *notif_corre_id = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "notifCorreId"); - + notif_corre_id = cJSON_GetObjectItemCaseSensitive(events_subsc_req_dataJSON, "notifCorreId"); if (notif_corre_id) { - if (!cJSON_IsString(notif_corre_id)) { + if (!cJSON_IsString(notif_corre_id) && !cJSON_IsNull(notif_corre_id)) { ogs_error("OpenAPI_events_subsc_req_data_parseFromJSON() failed [notif_corre_id]"); goto end; } @@ -261,16 +279,39 @@ OpenAPI_events_subsc_req_data_t *OpenAPI_events_subsc_req_data_parseFromJSON(cJS events_subsc_req_data_local_var = OpenAPI_events_subsc_req_data_create ( eventsList, - notif_uri ? ogs_strdup(notif_uri->valuestring) : NULL, + notif_uri && !cJSON_IsNull(notif_uri) ? ogs_strdup(notif_uri->valuestring) : NULL, req_qos_mon_params ? req_qos_mon_paramsList : NULL, qos_mon ? qos_mon_local_nonprim : NULL, req_anis ? req_anisList : NULL, usg_thres ? usg_thres_local_nonprim : NULL, - notif_corre_id ? ogs_strdup(notif_corre_id->valuestring) : NULL + notif_corre_id && !cJSON_IsNull(notif_corre_id) ? ogs_strdup(notif_corre_id->valuestring) : NULL ); return events_subsc_req_data_local_var; end: + if (eventsList) { + OpenAPI_list_for_each(eventsList, node) { + OpenAPI_af_event_subscription_free(node->data); + } + OpenAPI_list_free(eventsList); + eventsList = NULL; + } + if (req_qos_mon_paramsList) { + OpenAPI_list_free(req_qos_mon_paramsList); + req_qos_mon_paramsList = NULL; + } + if (qos_mon_local_nonprim) { + OpenAPI_qos_monitoring_information_free(qos_mon_local_nonprim); + qos_mon_local_nonprim = NULL; + } + if (req_anisList) { + OpenAPI_list_free(req_anisList); + req_anisList = NULL; + } + if (usg_thres_local_nonprim) { + OpenAPI_usage_threshold_free(usg_thres_local_nonprim); + usg_thres_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/events_subsc_req_data_rm.c b/lib/sbi/openapi/model/events_subsc_req_data_rm.c index da10d98e8..f1849ba91 100644 --- a/lib/sbi/openapi/model/events_subsc_req_data_rm.c +++ b/lib/sbi/openapi/model/events_subsc_req_data_rm.c @@ -30,26 +30,49 @@ OpenAPI_events_subsc_req_data_rm_t *OpenAPI_events_subsc_req_data_rm_create( void OpenAPI_events_subsc_req_data_rm_free(OpenAPI_events_subsc_req_data_rm_t *events_subsc_req_data_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == events_subsc_req_data_rm) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(events_subsc_req_data_rm->events, node) { - OpenAPI_af_event_subscription_free(node->data); + if (events_subsc_req_data_rm->events) { + OpenAPI_list_for_each(events_subsc_req_data_rm->events, node) { + OpenAPI_af_event_subscription_free(node->data); + } + OpenAPI_list_free(events_subsc_req_data_rm->events); + events_subsc_req_data_rm->events = NULL; + } + if (events_subsc_req_data_rm->notif_uri) { + ogs_free(events_subsc_req_data_rm->notif_uri); + events_subsc_req_data_rm->notif_uri = NULL; + } + if (events_subsc_req_data_rm->req_qos_mon_params) { + OpenAPI_list_free(events_subsc_req_data_rm->req_qos_mon_params); + events_subsc_req_data_rm->req_qos_mon_params = NULL; + } + if (events_subsc_req_data_rm->qos_mon) { + OpenAPI_qos_monitoring_information_rm_free(events_subsc_req_data_rm->qos_mon); + events_subsc_req_data_rm->qos_mon = NULL; + } + if (events_subsc_req_data_rm->req_anis) { + OpenAPI_list_free(events_subsc_req_data_rm->req_anis); + events_subsc_req_data_rm->req_anis = NULL; + } + if (events_subsc_req_data_rm->usg_thres) { + OpenAPI_usage_threshold_rm_free(events_subsc_req_data_rm->usg_thres); + events_subsc_req_data_rm->usg_thres = NULL; + } + if (events_subsc_req_data_rm->notif_corre_id) { + ogs_free(events_subsc_req_data_rm->notif_corre_id); + events_subsc_req_data_rm->notif_corre_id = NULL; } - OpenAPI_list_free(events_subsc_req_data_rm->events); - ogs_free(events_subsc_req_data_rm->notif_uri); - OpenAPI_list_free(events_subsc_req_data_rm->req_qos_mon_params); - OpenAPI_qos_monitoring_information_rm_free(events_subsc_req_data_rm->qos_mon); - OpenAPI_list_free(events_subsc_req_data_rm->req_anis); - OpenAPI_usage_threshold_rm_free(events_subsc_req_data_rm->usg_thres); - ogs_free(events_subsc_req_data_rm->notif_corre_id); ogs_free(events_subsc_req_data_rm); } cJSON *OpenAPI_events_subsc_req_data_rm_convertToJSON(OpenAPI_events_subsc_req_data_rm_t *events_subsc_req_data_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (events_subsc_req_data_rm == NULL) { ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [EventsSubscReqDataRm]"); @@ -57,22 +80,22 @@ cJSON *OpenAPI_events_subsc_req_data_rm_convertToJSON(OpenAPI_events_subsc_req_d } item = cJSON_CreateObject(); + if (!events_subsc_req_data_rm->events) { + ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [events]"); + return NULL; + } cJSON *eventsList = cJSON_AddArrayToObject(item, "events"); if (eventsList == NULL) { ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [events]"); goto end; } - - OpenAPI_lnode_t *events_node; - if (events_subsc_req_data_rm->events) { - OpenAPI_list_for_each(events_subsc_req_data_rm->events, events_node) { - cJSON *itemLocal = OpenAPI_af_event_subscription_convertToJSON(events_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [events]"); - goto end; - } - cJSON_AddItemToArray(eventsList, itemLocal); + OpenAPI_list_for_each(events_subsc_req_data_rm->events, node) { + cJSON *itemLocal = OpenAPI_af_event_subscription_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [events]"); + goto end; } + cJSON_AddItemToArray(eventsList, itemLocal); } if (events_subsc_req_data_rm->notif_uri) { @@ -82,15 +105,14 @@ cJSON *OpenAPI_events_subsc_req_data_rm_convertToJSON(OpenAPI_events_subsc_req_d } } - if (events_subsc_req_data_rm->req_qos_mon_params) { - cJSON *req_qos_mon_params = cJSON_AddArrayToObject(item, "reqQosMonParams"); - if (req_qos_mon_params == NULL) { + if (events_subsc_req_data_rm->req_qos_mon_params != OpenAPI_requested_qos_monitoring_parameter_NULL) { + cJSON *req_qos_mon_paramsList = cJSON_AddArrayToObject(item, "reqQosMonParams"); + if (req_qos_mon_paramsList == NULL) { ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [req_qos_mon_params]"); goto end; } - OpenAPI_lnode_t *req_qos_mon_params_node; - OpenAPI_list_for_each(events_subsc_req_data_rm->req_qos_mon_params, req_qos_mon_params_node) { - if (cJSON_AddStringToObject(req_qos_mon_params, "", OpenAPI_requested_qos_monitoring_parameter_ToString((intptr_t)req_qos_mon_params_node->data)) == NULL) { + OpenAPI_list_for_each(events_subsc_req_data_rm->req_qos_mon_params, node) { + if (cJSON_AddStringToObject(req_qos_mon_paramsList, "", OpenAPI_requested_qos_monitoring_parameter_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [req_qos_mon_params]"); goto end; } @@ -110,15 +132,14 @@ cJSON *OpenAPI_events_subsc_req_data_rm_convertToJSON(OpenAPI_events_subsc_req_d } } - if (events_subsc_req_data_rm->req_anis) { - cJSON *req_anis = cJSON_AddArrayToObject(item, "reqAnis"); - if (req_anis == NULL) { + if (events_subsc_req_data_rm->req_anis != OpenAPI_required_access_info_NULL) { + cJSON *req_anisList = cJSON_AddArrayToObject(item, "reqAnis"); + if (req_anisList == NULL) { ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [req_anis]"); goto end; } - OpenAPI_lnode_t *req_anis_node; - OpenAPI_list_for_each(events_subsc_req_data_rm->req_anis, req_anis_node) { - if (cJSON_AddStringToObject(req_anis, "", OpenAPI_required_access_info_ToString((intptr_t)req_anis_node->data)) == NULL) { + OpenAPI_list_for_each(events_subsc_req_data_rm->req_anis, node) { + if (cJSON_AddStringToObject(req_anisList, "", OpenAPI_required_access_info_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_events_subsc_req_data_rm_convertToJSON() failed [req_anis]"); goto end; } @@ -152,108 +173,105 @@ end: OpenAPI_events_subsc_req_data_rm_t *OpenAPI_events_subsc_req_data_rm_parseFromJSON(cJSON *events_subsc_req_data_rmJSON) { OpenAPI_events_subsc_req_data_rm_t *events_subsc_req_data_rm_local_var = NULL; - cJSON *events = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "events"); + OpenAPI_lnode_t *node = NULL; + cJSON *events = NULL; + OpenAPI_list_t *eventsList = NULL; + cJSON *notif_uri = NULL; + cJSON *req_qos_mon_params = NULL; + OpenAPI_list_t *req_qos_mon_paramsList = NULL; + cJSON *qos_mon = NULL; + OpenAPI_qos_monitoring_information_rm_t *qos_mon_local_nonprim = NULL; + cJSON *req_anis = NULL; + OpenAPI_list_t *req_anisList = NULL; + cJSON *usg_thres = NULL; + OpenAPI_usage_threshold_rm_t *usg_thres_local_nonprim = NULL; + cJSON *notif_corre_id = NULL; + events = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "events"); if (!events) { ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [events]"); goto end; } - - OpenAPI_list_t *eventsList; - cJSON *events_local_nonprimitive; - if (!cJSON_IsArray(events)){ - ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [events]"); - goto end; - } - - eventsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(events_local_nonprimitive, events ) { - if (!cJSON_IsObject(events_local_nonprimitive)) { + cJSON *events_local = NULL; + if (!cJSON_IsArray(events)) { ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [events]"); goto end; } - OpenAPI_af_event_subscription_t *eventsItem = OpenAPI_af_event_subscription_parseFromJSON(events_local_nonprimitive); - if (!eventsItem) { - ogs_error("No eventsItem"); - OpenAPI_list_free(eventsList); - goto end; + eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(events_local, events) { + if (!cJSON_IsObject(events_local)) { + ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [events]"); + goto end; + } + OpenAPI_af_event_subscription_t *eventsItem = OpenAPI_af_event_subscription_parseFromJSON(events_local); + if (!eventsItem) { + ogs_error("No eventsItem"); + OpenAPI_list_free(eventsList); + goto end; + } + OpenAPI_list_add(eventsList, eventsItem); } - OpenAPI_list_add(eventsList, eventsItem); - } - - cJSON *notif_uri = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "notifUri"); - + notif_uri = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "notifUri"); if (notif_uri) { - if (!cJSON_IsString(notif_uri)) { + if (!cJSON_IsString(notif_uri) && !cJSON_IsNull(notif_uri)) { ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [notif_uri]"); goto end; } } - cJSON *req_qos_mon_params = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "reqQosMonParams"); - - OpenAPI_list_t *req_qos_mon_paramsList; + req_qos_mon_params = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "reqQosMonParams"); if (req_qos_mon_params) { - cJSON *req_qos_mon_params_local_nonprimitive; - if (!cJSON_IsArray(req_qos_mon_params)) { - ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [req_qos_mon_params]"); - goto end; - } - - req_qos_mon_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_qos_mon_params_local_nonprimitive, req_qos_mon_params ) { - if (!cJSON_IsString(req_qos_mon_params_local_nonprimitive)){ + cJSON *req_qos_mon_params_local = NULL; + if (!cJSON_IsArray(req_qos_mon_params)) { ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [req_qos_mon_params]"); goto end; } - OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local_nonprimitive->valuestring)); - } + req_qos_mon_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_qos_mon_params_local, req_qos_mon_params) { + if (!cJSON_IsString(req_qos_mon_params_local)) { + ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [req_qos_mon_params]"); + goto end; + } + OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local->valuestring)); + } } - cJSON *qos_mon = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "qosMon"); - - OpenAPI_qos_monitoring_information_rm_t *qos_mon_local_nonprim = NULL; + qos_mon = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "qosMon"); if (qos_mon) { qos_mon_local_nonprim = OpenAPI_qos_monitoring_information_rm_parseFromJSON(qos_mon); } - cJSON *req_anis = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "reqAnis"); - - OpenAPI_list_t *req_anisList; + req_anis = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "reqAnis"); if (req_anis) { - cJSON *req_anis_local_nonprimitive; - if (!cJSON_IsArray(req_anis)) { - ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [req_anis]"); - goto end; - } - - req_anisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_anis_local_nonprimitive, req_anis ) { - if (!cJSON_IsString(req_anis_local_nonprimitive)){ + cJSON *req_anis_local = NULL; + if (!cJSON_IsArray(req_anis)) { ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [req_anis]"); goto end; } - OpenAPI_list_add(req_anisList, (void *)OpenAPI_required_access_info_FromString(req_anis_local_nonprimitive->valuestring)); - } + req_anisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_anis_local, req_anis) { + if (!cJSON_IsString(req_anis_local)) { + ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [req_anis]"); + goto end; + } + OpenAPI_list_add(req_anisList, (void *)OpenAPI_required_access_info_FromString(req_anis_local->valuestring)); + } } - cJSON *usg_thres = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "usgThres"); - - OpenAPI_usage_threshold_rm_t *usg_thres_local_nonprim = NULL; + usg_thres = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "usgThres"); if (usg_thres) { usg_thres_local_nonprim = OpenAPI_usage_threshold_rm_parseFromJSON(usg_thres); } - cJSON *notif_corre_id = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "notifCorreId"); - + notif_corre_id = cJSON_GetObjectItemCaseSensitive(events_subsc_req_data_rmJSON, "notifCorreId"); if (notif_corre_id) { - if (!cJSON_IsString(notif_corre_id)) { + if (!cJSON_IsString(notif_corre_id) && !cJSON_IsNull(notif_corre_id)) { ogs_error("OpenAPI_events_subsc_req_data_rm_parseFromJSON() failed [notif_corre_id]"); goto end; } @@ -261,16 +279,39 @@ OpenAPI_events_subsc_req_data_rm_t *OpenAPI_events_subsc_req_data_rm_parseFromJS events_subsc_req_data_rm_local_var = OpenAPI_events_subsc_req_data_rm_create ( eventsList, - notif_uri ? ogs_strdup(notif_uri->valuestring) : NULL, + notif_uri && !cJSON_IsNull(notif_uri) ? ogs_strdup(notif_uri->valuestring) : NULL, req_qos_mon_params ? req_qos_mon_paramsList : NULL, qos_mon ? qos_mon_local_nonprim : NULL, req_anis ? req_anisList : NULL, usg_thres ? usg_thres_local_nonprim : NULL, - notif_corre_id ? ogs_strdup(notif_corre_id->valuestring) : NULL + notif_corre_id && !cJSON_IsNull(notif_corre_id) ? ogs_strdup(notif_corre_id->valuestring) : NULL ); return events_subsc_req_data_rm_local_var; end: + if (eventsList) { + OpenAPI_list_for_each(eventsList, node) { + OpenAPI_af_event_subscription_free(node->data); + } + OpenAPI_list_free(eventsList); + eventsList = NULL; + } + if (req_qos_mon_paramsList) { + OpenAPI_list_free(req_qos_mon_paramsList); + req_qos_mon_paramsList = NULL; + } + if (qos_mon_local_nonprim) { + OpenAPI_qos_monitoring_information_rm_free(qos_mon_local_nonprim); + qos_mon_local_nonprim = NULL; + } + if (req_anisList) { + OpenAPI_list_free(req_anisList); + req_anisList = NULL; + } + if (usg_thres_local_nonprim) { + OpenAPI_usage_threshold_rm_free(usg_thres_local_nonprim); + usg_thres_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/exemption_ind.c b/lib/sbi/openapi/model/exemption_ind.c index d068fddd3..993c436b5 100644 --- a/lib/sbi/openapi/model/exemption_ind.c +++ b/lib/sbi/openapi/model/exemption_ind.c @@ -28,16 +28,18 @@ OpenAPI_exemption_ind_t *OpenAPI_exemption_ind_create( void OpenAPI_exemption_ind_free(OpenAPI_exemption_ind_t *exemption_ind) { + OpenAPI_lnode_t *node = NULL; + if (NULL == exemption_ind) { return; } - OpenAPI_lnode_t *node; ogs_free(exemption_ind); } cJSON *OpenAPI_exemption_ind_convertToJSON(OpenAPI_exemption_ind_t *exemption_ind) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (exemption_ind == NULL) { ogs_error("OpenAPI_exemption_ind_convertToJSON() failed [ExemptionInd]"); @@ -73,8 +75,11 @@ end: OpenAPI_exemption_ind_t *OpenAPI_exemption_ind_parseFromJSON(cJSON *exemption_indJSON) { OpenAPI_exemption_ind_t *exemption_ind_local_var = NULL; - cJSON *dnn_congestion = cJSON_GetObjectItemCaseSensitive(exemption_indJSON, "dnnCongestion"); - + OpenAPI_lnode_t *node = NULL; + cJSON *dnn_congestion = NULL; + cJSON *snssai_only_congestion = NULL; + cJSON *snssai_dnn_congestion = NULL; + dnn_congestion = cJSON_GetObjectItemCaseSensitive(exemption_indJSON, "dnnCongestion"); if (dnn_congestion) { if (!cJSON_IsBool(dnn_congestion)) { ogs_error("OpenAPI_exemption_ind_parseFromJSON() failed [dnn_congestion]"); @@ -82,8 +87,7 @@ OpenAPI_exemption_ind_t *OpenAPI_exemption_ind_parseFromJSON(cJSON *exemption_in } } - cJSON *snssai_only_congestion = cJSON_GetObjectItemCaseSensitive(exemption_indJSON, "snssaiOnlyCongestion"); - + snssai_only_congestion = cJSON_GetObjectItemCaseSensitive(exemption_indJSON, "snssaiOnlyCongestion"); if (snssai_only_congestion) { if (!cJSON_IsBool(snssai_only_congestion)) { ogs_error("OpenAPI_exemption_ind_parseFromJSON() failed [snssai_only_congestion]"); @@ -91,8 +95,7 @@ OpenAPI_exemption_ind_t *OpenAPI_exemption_ind_parseFromJSON(cJSON *exemption_in } } - cJSON *snssai_dnn_congestion = cJSON_GetObjectItemCaseSensitive(exemption_indJSON, "snssaiDnnCongestion"); - + snssai_dnn_congestion = cJSON_GetObjectItemCaseSensitive(exemption_indJSON, "snssaiDnnCongestion"); if (snssai_dnn_congestion) { if (!cJSON_IsBool(snssai_dnn_congestion)) { ogs_error("OpenAPI_exemption_ind_parseFromJSON() failed [snssai_dnn_congestion]"); diff --git a/lib/sbi/openapi/model/expected_ue_behavior.c b/lib/sbi/openapi/model/expected_ue_behavior.c index 109add3a7..e21b589a1 100644 --- a/lib/sbi/openapi/model/expected_ue_behavior.c +++ b/lib/sbi/openapi/model/expected_ue_behavior.c @@ -20,21 +20,29 @@ OpenAPI_expected_ue_behavior_t *OpenAPI_expected_ue_behavior_create( void OpenAPI_expected_ue_behavior_free(OpenAPI_expected_ue_behavior_t *expected_ue_behavior) { + OpenAPI_lnode_t *node = NULL; + if (NULL == expected_ue_behavior) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(expected_ue_behavior->exp_move_trajectory, node) { - OpenAPI_user_location_free(node->data); + if (expected_ue_behavior->exp_move_trajectory) { + OpenAPI_list_for_each(expected_ue_behavior->exp_move_trajectory, node) { + OpenAPI_user_location_free(node->data); + } + OpenAPI_list_free(expected_ue_behavior->exp_move_trajectory); + expected_ue_behavior->exp_move_trajectory = NULL; + } + if (expected_ue_behavior->validity_time) { + ogs_free(expected_ue_behavior->validity_time); + expected_ue_behavior->validity_time = NULL; } - OpenAPI_list_free(expected_ue_behavior->exp_move_trajectory); - ogs_free(expected_ue_behavior->validity_time); ogs_free(expected_ue_behavior); } cJSON *OpenAPI_expected_ue_behavior_convertToJSON(OpenAPI_expected_ue_behavior_t *expected_ue_behavior) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (expected_ue_behavior == NULL) { ogs_error("OpenAPI_expected_ue_behavior_convertToJSON() failed [ExpectedUeBehavior]"); @@ -42,24 +50,28 @@ cJSON *OpenAPI_expected_ue_behavior_convertToJSON(OpenAPI_expected_ue_behavior_t } item = cJSON_CreateObject(); + if (!expected_ue_behavior->exp_move_trajectory) { + ogs_error("OpenAPI_expected_ue_behavior_convertToJSON() failed [exp_move_trajectory]"); + return NULL; + } cJSON *exp_move_trajectoryList = cJSON_AddArrayToObject(item, "expMoveTrajectory"); if (exp_move_trajectoryList == NULL) { ogs_error("OpenAPI_expected_ue_behavior_convertToJSON() failed [exp_move_trajectory]"); goto end; } - - OpenAPI_lnode_t *exp_move_trajectory_node; - if (expected_ue_behavior->exp_move_trajectory) { - OpenAPI_list_for_each(expected_ue_behavior->exp_move_trajectory, exp_move_trajectory_node) { - cJSON *itemLocal = OpenAPI_user_location_convertToJSON(exp_move_trajectory_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_expected_ue_behavior_convertToJSON() failed [exp_move_trajectory]"); - goto end; - } - cJSON_AddItemToArray(exp_move_trajectoryList, itemLocal); + OpenAPI_list_for_each(expected_ue_behavior->exp_move_trajectory, node) { + cJSON *itemLocal = OpenAPI_user_location_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_expected_ue_behavior_convertToJSON() failed [exp_move_trajectory]"); + goto end; } + cJSON_AddItemToArray(exp_move_trajectoryList, itemLocal); } + if (!expected_ue_behavior->validity_time) { + ogs_error("OpenAPI_expected_ue_behavior_convertToJSON() failed [validity_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "validityTime", expected_ue_behavior->validity_time) == NULL) { ogs_error("OpenAPI_expected_ue_behavior_convertToJSON() failed [validity_time]"); goto end; @@ -72,44 +84,43 @@ end: OpenAPI_expected_ue_behavior_t *OpenAPI_expected_ue_behavior_parseFromJSON(cJSON *expected_ue_behaviorJSON) { OpenAPI_expected_ue_behavior_t *expected_ue_behavior_local_var = NULL; - cJSON *exp_move_trajectory = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviorJSON, "expMoveTrajectory"); + OpenAPI_lnode_t *node = NULL; + cJSON *exp_move_trajectory = NULL; + OpenAPI_list_t *exp_move_trajectoryList = NULL; + cJSON *validity_time = NULL; + exp_move_trajectory = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviorJSON, "expMoveTrajectory"); if (!exp_move_trajectory) { ogs_error("OpenAPI_expected_ue_behavior_parseFromJSON() failed [exp_move_trajectory]"); goto end; } - - OpenAPI_list_t *exp_move_trajectoryList; - cJSON *exp_move_trajectory_local_nonprimitive; - if (!cJSON_IsArray(exp_move_trajectory)){ - ogs_error("OpenAPI_expected_ue_behavior_parseFromJSON() failed [exp_move_trajectory]"); - goto end; - } - - exp_move_trajectoryList = OpenAPI_list_create(); - - cJSON_ArrayForEach(exp_move_trajectory_local_nonprimitive, exp_move_trajectory ) { - if (!cJSON_IsObject(exp_move_trajectory_local_nonprimitive)) { + cJSON *exp_move_trajectory_local = NULL; + if (!cJSON_IsArray(exp_move_trajectory)) { ogs_error("OpenAPI_expected_ue_behavior_parseFromJSON() failed [exp_move_trajectory]"); goto end; } - OpenAPI_user_location_t *exp_move_trajectoryItem = OpenAPI_user_location_parseFromJSON(exp_move_trajectory_local_nonprimitive); - if (!exp_move_trajectoryItem) { - ogs_error("No exp_move_trajectoryItem"); - OpenAPI_list_free(exp_move_trajectoryList); - goto end; + exp_move_trajectoryList = OpenAPI_list_create(); + + cJSON_ArrayForEach(exp_move_trajectory_local, exp_move_trajectory) { + if (!cJSON_IsObject(exp_move_trajectory_local)) { + ogs_error("OpenAPI_expected_ue_behavior_parseFromJSON() failed [exp_move_trajectory]"); + goto end; + } + OpenAPI_user_location_t *exp_move_trajectoryItem = OpenAPI_user_location_parseFromJSON(exp_move_trajectory_local); + if (!exp_move_trajectoryItem) { + ogs_error("No exp_move_trajectoryItem"); + OpenAPI_list_free(exp_move_trajectoryList); + goto end; + } + OpenAPI_list_add(exp_move_trajectoryList, exp_move_trajectoryItem); } - OpenAPI_list_add(exp_move_trajectoryList, exp_move_trajectoryItem); - } - - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviorJSON, "validityTime"); + validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviorJSON, "validityTime"); if (!validity_time) { ogs_error("OpenAPI_expected_ue_behavior_parseFromJSON() failed [validity_time]"); goto end; } - - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_expected_ue_behavior_parseFromJSON() failed [validity_time]"); goto end; } @@ -121,6 +132,13 @@ OpenAPI_expected_ue_behavior_t *OpenAPI_expected_ue_behavior_parseFromJSON(cJSON return expected_ue_behavior_local_var; end: + if (exp_move_trajectoryList) { + OpenAPI_list_for_each(exp_move_trajectoryList, node) { + OpenAPI_user_location_free(node->data); + } + OpenAPI_list_free(exp_move_trajectoryList); + exp_move_trajectoryList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/expected_ue_behaviour.c b/lib/sbi/openapi/model/expected_ue_behaviour.c index 075b360b2..6952bfb2f 100644 --- a/lib/sbi/openapi/model/expected_ue_behaviour.c +++ b/lib/sbi/openapi/model/expected_ue_behaviour.c @@ -44,28 +44,57 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_create( void OpenAPI_expected_ue_behaviour_free(OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour) { + OpenAPI_lnode_t *node = NULL; + if (NULL == expected_ue_behaviour) { return; } - OpenAPI_lnode_t *node; - ogs_free(expected_ue_behaviour->af_instance_id); - OpenAPI_stationary_indication_rm_free(expected_ue_behaviour->stationary_indication); - OpenAPI_scheduled_communication_type_rm_free(expected_ue_behaviour->scheduled_communication_type); - OpenAPI_scheduled_communication_time_rm_free(expected_ue_behaviour->scheduled_communication_time); - OpenAPI_list_for_each(expected_ue_behaviour->expected_umts, node) { - OpenAPI_location_area_free(node->data); + if (expected_ue_behaviour->af_instance_id) { + ogs_free(expected_ue_behaviour->af_instance_id); + expected_ue_behaviour->af_instance_id = NULL; + } + if (expected_ue_behaviour->stationary_indication) { + OpenAPI_stationary_indication_rm_free(expected_ue_behaviour->stationary_indication); + expected_ue_behaviour->stationary_indication = NULL; + } + if (expected_ue_behaviour->scheduled_communication_type) { + OpenAPI_scheduled_communication_type_rm_free(expected_ue_behaviour->scheduled_communication_type); + expected_ue_behaviour->scheduled_communication_type = NULL; + } + if (expected_ue_behaviour->scheduled_communication_time) { + OpenAPI_scheduled_communication_time_rm_free(expected_ue_behaviour->scheduled_communication_time); + expected_ue_behaviour->scheduled_communication_time = NULL; + } + if (expected_ue_behaviour->expected_umts) { + OpenAPI_list_for_each(expected_ue_behaviour->expected_umts, node) { + OpenAPI_location_area_free(node->data); + } + OpenAPI_list_free(expected_ue_behaviour->expected_umts); + expected_ue_behaviour->expected_umts = NULL; + } + if (expected_ue_behaviour->traffic_profile) { + OpenAPI_traffic_profile_rm_free(expected_ue_behaviour->traffic_profile); + expected_ue_behaviour->traffic_profile = NULL; + } + if (expected_ue_behaviour->battery_indication) { + OpenAPI_battery_indication_rm_free(expected_ue_behaviour->battery_indication); + expected_ue_behaviour->battery_indication = NULL; + } + if (expected_ue_behaviour->validity_time) { + ogs_free(expected_ue_behaviour->validity_time); + expected_ue_behaviour->validity_time = NULL; + } + if (expected_ue_behaviour->mtc_provider_information) { + ogs_free(expected_ue_behaviour->mtc_provider_information); + expected_ue_behaviour->mtc_provider_information = NULL; } - OpenAPI_list_free(expected_ue_behaviour->expected_umts); - OpenAPI_traffic_profile_rm_free(expected_ue_behaviour->traffic_profile); - OpenAPI_battery_indication_rm_free(expected_ue_behaviour->battery_indication); - ogs_free(expected_ue_behaviour->validity_time); - ogs_free(expected_ue_behaviour->mtc_provider_information); ogs_free(expected_ue_behaviour); } cJSON *OpenAPI_expected_ue_behaviour_convertToJSON(OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (expected_ue_behaviour == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [ExpectedUeBehaviour]"); @@ -73,6 +102,10 @@ cJSON *OpenAPI_expected_ue_behaviour_convertToJSON(OpenAPI_expected_ue_behaviour } item = cJSON_CreateObject(); + if (!expected_ue_behaviour->af_instance_id) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [af_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afInstanceId", expected_ue_behaviour->af_instance_id) == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [af_instance_id]"); goto end; @@ -142,17 +175,13 @@ cJSON *OpenAPI_expected_ue_behaviour_convertToJSON(OpenAPI_expected_ue_behaviour ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [expected_umts]"); goto end; } - - OpenAPI_lnode_t *expected_umts_node; - if (expected_ue_behaviour->expected_umts) { - OpenAPI_list_for_each(expected_ue_behaviour->expected_umts, expected_umts_node) { - cJSON *itemLocal = OpenAPI_location_area_convertToJSON(expected_umts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [expected_umts]"); - goto end; - } - cJSON_AddItemToArray(expected_umtsList, itemLocal); + OpenAPI_list_for_each(expected_ue_behaviour->expected_umts, node) { + cJSON *itemLocal = OpenAPI_location_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [expected_umts]"); + goto end; } + cJSON_AddItemToArray(expected_umtsList, itemLocal); } } @@ -203,37 +232,51 @@ end: OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_parseFromJSON(cJSON *expected_ue_behaviourJSON) { OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_local_var = NULL; - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "afInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *af_instance_id = NULL; + cJSON *reference_id = NULL; + cJSON *stationary_indication = NULL; + OpenAPI_stationary_indication_rm_t *stationary_indication_local_nonprim = NULL; + cJSON *communication_duration_time = NULL; + cJSON *scheduled_communication_type = NULL; + OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_local_nonprim = NULL; + cJSON *periodic_time = NULL; + cJSON *scheduled_communication_time = NULL; + OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_local_nonprim = NULL; + cJSON *expected_umts = NULL; + OpenAPI_list_t *expected_umtsList = NULL; + cJSON *traffic_profile = NULL; + OpenAPI_traffic_profile_rm_t *traffic_profile_local_nonprim = NULL; + cJSON *battery_indication = NULL; + OpenAPI_battery_indication_rm_t *battery_indication_local_nonprim = NULL; + cJSON *validity_time = NULL; + cJSON *mtc_provider_information = NULL; + af_instance_id = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "afInstanceId"); if (!af_instance_id) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [af_instance_id]"); goto end; } - if (!cJSON_IsString(af_instance_id)) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [af_instance_id]"); goto end; } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "referenceId"); + reference_id = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "referenceId"); if (!reference_id) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [reference_id]"); goto end; } - if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [reference_id]"); goto end; } - cJSON *stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "stationaryIndication"); - - OpenAPI_stationary_indication_rm_t *stationary_indication_local_nonprim = NULL; + stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "stationaryIndication"); if (stationary_indication) { stationary_indication_local_nonprim = OpenAPI_stationary_indication_rm_parseFromJSON(stationary_indication); } - cJSON *communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "communicationDurationTime"); - + communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "communicationDurationTime"); if (communication_duration_time) { if (!cJSON_IsNumber(communication_duration_time)) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [communication_duration_time]"); @@ -241,15 +284,12 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_parseFromJSON(cJS } } - cJSON *scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "scheduledCommunicationType"); - - OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_local_nonprim = NULL; + scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "scheduledCommunicationType"); if (scheduled_communication_type) { scheduled_communication_type_local_nonprim = OpenAPI_scheduled_communication_type_rm_parseFromJSON(scheduled_communication_type); } - cJSON *periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "periodicTime"); - + periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "periodicTime"); if (periodic_time) { if (!cJSON_IsNumber(periodic_time)) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [periodic_time]"); @@ -257,69 +297,57 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_parseFromJSON(cJS } } - cJSON *scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "scheduledCommunicationTime"); - - OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_local_nonprim = NULL; + scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "scheduledCommunicationTime"); if (scheduled_communication_time) { scheduled_communication_time_local_nonprim = OpenAPI_scheduled_communication_time_rm_parseFromJSON(scheduled_communication_time); } - cJSON *expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "expectedUmts"); - - OpenAPI_list_t *expected_umtsList; + expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "expectedUmts"); if (expected_umts) { - cJSON *expected_umts_local_nonprimitive; - if (!cJSON_IsArray(expected_umts)){ - ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [expected_umts]"); - goto end; - } - - expected_umtsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(expected_umts_local_nonprimitive, expected_umts ) { - if (!cJSON_IsObject(expected_umts_local_nonprimitive)) { + cJSON *expected_umts_local = NULL; + if (!cJSON_IsArray(expected_umts)) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [expected_umts]"); goto end; } - OpenAPI_location_area_t *expected_umtsItem = OpenAPI_location_area_parseFromJSON(expected_umts_local_nonprimitive); - if (!expected_umtsItem) { - ogs_error("No expected_umtsItem"); - OpenAPI_list_free(expected_umtsList); - goto end; + expected_umtsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(expected_umts_local, expected_umts) { + if (!cJSON_IsObject(expected_umts_local)) { + ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [expected_umts]"); + goto end; + } + OpenAPI_location_area_t *expected_umtsItem = OpenAPI_location_area_parseFromJSON(expected_umts_local); + if (!expected_umtsItem) { + ogs_error("No expected_umtsItem"); + OpenAPI_list_free(expected_umtsList); + goto end; + } + OpenAPI_list_add(expected_umtsList, expected_umtsItem); } - - OpenAPI_list_add(expected_umtsList, expected_umtsItem); - } } - cJSON *traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "trafficProfile"); - - OpenAPI_traffic_profile_rm_t *traffic_profile_local_nonprim = NULL; + traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "trafficProfile"); if (traffic_profile) { traffic_profile_local_nonprim = OpenAPI_traffic_profile_rm_parseFromJSON(traffic_profile); } - cJSON *battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "batteryIndication"); - - OpenAPI_battery_indication_rm_t *battery_indication_local_nonprim = NULL; + battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "batteryIndication"); if (battery_indication) { battery_indication_local_nonprim = OpenAPI_battery_indication_rm_parseFromJSON(battery_indication); } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [mtc_provider_information]"); goto end; } @@ -339,12 +367,39 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_parseFromJSON(cJS expected_umts ? expected_umtsList : NULL, traffic_profile ? traffic_profile_local_nonprim : NULL, battery_indication ? battery_indication_local_nonprim : NULL, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return expected_ue_behaviour_local_var; end: + if (stationary_indication_local_nonprim) { + OpenAPI_stationary_indication_rm_free(stationary_indication_local_nonprim); + stationary_indication_local_nonprim = NULL; + } + if (scheduled_communication_type_local_nonprim) { + OpenAPI_scheduled_communication_type_rm_free(scheduled_communication_type_local_nonprim); + scheduled_communication_type_local_nonprim = NULL; + } + if (scheduled_communication_time_local_nonprim) { + OpenAPI_scheduled_communication_time_rm_free(scheduled_communication_time_local_nonprim); + scheduled_communication_time_local_nonprim = NULL; + } + if (expected_umtsList) { + OpenAPI_list_for_each(expected_umtsList, node) { + OpenAPI_location_area_free(node->data); + } + OpenAPI_list_free(expected_umtsList); + expected_umtsList = NULL; + } + if (traffic_profile_local_nonprim) { + OpenAPI_traffic_profile_rm_free(traffic_profile_local_nonprim); + traffic_profile_local_nonprim = NULL; + } + if (battery_indication_local_nonprim) { + OpenAPI_battery_indication_rm_free(battery_indication_local_nonprim); + battery_indication_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/expected_ue_behaviour_data.c b/lib/sbi/openapi/model/expected_ue_behaviour_data.c index 3eef2cd34..9a75d3339 100644 --- a/lib/sbi/openapi/model/expected_ue_behaviour_data.c +++ b/lib/sbi/openapi/model/expected_ue_behaviour_data.c @@ -38,23 +38,37 @@ OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_create( void OpenAPI_expected_ue_behaviour_data_free(OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == expected_ue_behaviour_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_scheduled_communication_time_free(expected_ue_behaviour_data->scheduled_communication_time); - OpenAPI_list_for_each(expected_ue_behaviour_data->expected_umts, node) { - OpenAPI_location_area_free(node->data); + if (expected_ue_behaviour_data->scheduled_communication_time) { + OpenAPI_scheduled_communication_time_free(expected_ue_behaviour_data->scheduled_communication_time); + expected_ue_behaviour_data->scheduled_communication_time = NULL; + } + if (expected_ue_behaviour_data->expected_umts) { + OpenAPI_list_for_each(expected_ue_behaviour_data->expected_umts, node) { + OpenAPI_location_area_free(node->data); + } + OpenAPI_list_free(expected_ue_behaviour_data->expected_umts); + expected_ue_behaviour_data->expected_umts = NULL; + } + if (expected_ue_behaviour_data->battery_indication) { + OpenAPI_battery_indication_free(expected_ue_behaviour_data->battery_indication); + expected_ue_behaviour_data->battery_indication = NULL; + } + if (expected_ue_behaviour_data->validity_time) { + ogs_free(expected_ue_behaviour_data->validity_time); + expected_ue_behaviour_data->validity_time = NULL; } - OpenAPI_list_free(expected_ue_behaviour_data->expected_umts); - OpenAPI_battery_indication_free(expected_ue_behaviour_data->battery_indication); - ogs_free(expected_ue_behaviour_data->validity_time); ogs_free(expected_ue_behaviour_data); } cJSON *OpenAPI_expected_ue_behaviour_data_convertToJSON(OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (expected_ue_behaviour_data == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [ExpectedUeBehaviourData]"); @@ -62,7 +76,7 @@ cJSON *OpenAPI_expected_ue_behaviour_data_convertToJSON(OpenAPI_expected_ue_beha } item = cJSON_CreateObject(); - if (expected_ue_behaviour_data->stationary_indication) { + if (expected_ue_behaviour_data->stationary_indication != OpenAPI_stationary_indication_NULL) { if (cJSON_AddStringToObject(item, "stationaryIndication", OpenAPI_stationary_indication_ToString(expected_ue_behaviour_data->stationary_indication)) == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [stationary_indication]"); goto end; @@ -96,7 +110,7 @@ cJSON *OpenAPI_expected_ue_behaviour_data_convertToJSON(OpenAPI_expected_ue_beha } } - if (expected_ue_behaviour_data->scheduled_communication_type) { + if (expected_ue_behaviour_data->scheduled_communication_type != OpenAPI_scheduled_communication_type_NULL) { if (cJSON_AddStringToObject(item, "scheduledCommunicationType", OpenAPI_scheduled_communication_type_ToString(expected_ue_behaviour_data->scheduled_communication_type)) == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [scheduled_communication_type]"); goto end; @@ -109,21 +123,17 @@ cJSON *OpenAPI_expected_ue_behaviour_data_convertToJSON(OpenAPI_expected_ue_beha ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [expected_umts]"); goto end; } - - OpenAPI_lnode_t *expected_umts_node; - if (expected_ue_behaviour_data->expected_umts) { - OpenAPI_list_for_each(expected_ue_behaviour_data->expected_umts, expected_umts_node) { - cJSON *itemLocal = OpenAPI_location_area_convertToJSON(expected_umts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [expected_umts]"); - goto end; - } - cJSON_AddItemToArray(expected_umtsList, itemLocal); + OpenAPI_list_for_each(expected_ue_behaviour_data->expected_umts, node) { + cJSON *itemLocal = OpenAPI_location_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [expected_umts]"); + goto end; } + cJSON_AddItemToArray(expected_umtsList, itemLocal); } } - if (expected_ue_behaviour_data->traffic_profile) { + if (expected_ue_behaviour_data->traffic_profile != OpenAPI_traffic_profile_NULL) { if (cJSON_AddStringToObject(item, "trafficProfile", OpenAPI_traffic_profile_ToString(expected_ue_behaviour_data->traffic_profile)) == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_data_convertToJSON() failed [traffic_profile]"); goto end; @@ -157,9 +167,23 @@ end: OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFromJSON(cJSON *expected_ue_behaviour_dataJSON) { OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_data_local_var = NULL; - cJSON *stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "stationaryIndication"); - - OpenAPI_stationary_indication_e stationary_indicationVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *stationary_indication = NULL; + OpenAPI_stationary_indication_e stationary_indicationVariable = 0; + cJSON *communication_duration_time = NULL; + cJSON *periodic_time = NULL; + cJSON *scheduled_communication_time = NULL; + OpenAPI_scheduled_communication_time_t *scheduled_communication_time_local_nonprim = NULL; + cJSON *scheduled_communication_type = NULL; + OpenAPI_scheduled_communication_type_e scheduled_communication_typeVariable = 0; + cJSON *expected_umts = NULL; + OpenAPI_list_t *expected_umtsList = NULL; + cJSON *traffic_profile = NULL; + OpenAPI_traffic_profile_e traffic_profileVariable = 0; + cJSON *battery_indication = NULL; + OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL; + cJSON *validity_time = NULL; + stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "stationaryIndication"); if (stationary_indication) { if (!cJSON_IsString(stationary_indication)) { ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [stationary_indication]"); @@ -168,8 +192,7 @@ OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFr stationary_indicationVariable = OpenAPI_stationary_indication_FromString(stationary_indication->valuestring); } - cJSON *communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "communicationDurationTime"); - + communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "communicationDurationTime"); if (communication_duration_time) { if (!cJSON_IsNumber(communication_duration_time)) { ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [communication_duration_time]"); @@ -177,8 +200,7 @@ OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFr } } - cJSON *periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "periodicTime"); - + periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "periodicTime"); if (periodic_time) { if (!cJSON_IsNumber(periodic_time)) { ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [periodic_time]"); @@ -186,16 +208,12 @@ OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFr } } - cJSON *scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "scheduledCommunicationTime"); - - OpenAPI_scheduled_communication_time_t *scheduled_communication_time_local_nonprim = NULL; + scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "scheduledCommunicationTime"); if (scheduled_communication_time) { scheduled_communication_time_local_nonprim = OpenAPI_scheduled_communication_time_parseFromJSON(scheduled_communication_time); } - cJSON *scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "scheduledCommunicationType"); - - OpenAPI_scheduled_communication_type_e scheduled_communication_typeVariable; + scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "scheduledCommunicationType"); if (scheduled_communication_type) { if (!cJSON_IsString(scheduled_communication_type)) { ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [scheduled_communication_type]"); @@ -204,38 +222,32 @@ OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFr scheduled_communication_typeVariable = OpenAPI_scheduled_communication_type_FromString(scheduled_communication_type->valuestring); } - cJSON *expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "expectedUmts"); - - OpenAPI_list_t *expected_umtsList; + expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "expectedUmts"); if (expected_umts) { - cJSON *expected_umts_local_nonprimitive; - if (!cJSON_IsArray(expected_umts)){ - ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [expected_umts]"); - goto end; - } - - expected_umtsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(expected_umts_local_nonprimitive, expected_umts ) { - if (!cJSON_IsObject(expected_umts_local_nonprimitive)) { + cJSON *expected_umts_local = NULL; + if (!cJSON_IsArray(expected_umts)) { ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [expected_umts]"); goto end; } - OpenAPI_location_area_t *expected_umtsItem = OpenAPI_location_area_parseFromJSON(expected_umts_local_nonprimitive); - if (!expected_umtsItem) { - ogs_error("No expected_umtsItem"); - OpenAPI_list_free(expected_umtsList); - goto end; + expected_umtsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(expected_umts_local, expected_umts) { + if (!cJSON_IsObject(expected_umts_local)) { + ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [expected_umts]"); + goto end; + } + OpenAPI_location_area_t *expected_umtsItem = OpenAPI_location_area_parseFromJSON(expected_umts_local); + if (!expected_umtsItem) { + ogs_error("No expected_umtsItem"); + OpenAPI_list_free(expected_umtsList); + goto end; + } + OpenAPI_list_add(expected_umtsList, expected_umtsItem); } - - OpenAPI_list_add(expected_umtsList, expected_umtsItem); - } } - cJSON *traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "trafficProfile"); - - OpenAPI_traffic_profile_e traffic_profileVariable; + traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "trafficProfile"); if (traffic_profile) { if (!cJSON_IsString(traffic_profile)) { ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [traffic_profile]"); @@ -244,17 +256,14 @@ OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFr traffic_profileVariable = OpenAPI_traffic_profile_FromString(traffic_profile->valuestring); } - cJSON *battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "batteryIndication"); - - OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL; + battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "batteryIndication"); if (battery_indication) { battery_indication_local_nonprim = OpenAPI_battery_indication_parseFromJSON(battery_indication); } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_dataJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_expected_ue_behaviour_data_parseFromJSON() failed [validity_time]"); goto end; } @@ -271,11 +280,26 @@ OpenAPI_expected_ue_behaviour_data_t *OpenAPI_expected_ue_behaviour_data_parseFr expected_umts ? expected_umtsList : NULL, traffic_profile ? traffic_profileVariable : 0, battery_indication ? battery_indication_local_nonprim : NULL, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL ); return expected_ue_behaviour_data_local_var; end: + if (scheduled_communication_time_local_nonprim) { + OpenAPI_scheduled_communication_time_free(scheduled_communication_time_local_nonprim); + scheduled_communication_time_local_nonprim = NULL; + } + if (expected_umtsList) { + OpenAPI_list_for_each(expected_umtsList, node) { + OpenAPI_location_area_free(node->data); + } + OpenAPI_list_free(expected_umtsList); + expected_umtsList = NULL; + } + if (battery_indication_local_nonprim) { + OpenAPI_battery_indication_free(battery_indication_local_nonprim); + battery_indication_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/expected_ue_behaviour_data_1.c b/lib/sbi/openapi/model/expected_ue_behaviour_data_1.c index 82f1d2e26..755c97d8f 100644 --- a/lib/sbi/openapi/model/expected_ue_behaviour_data_1.c +++ b/lib/sbi/openapi/model/expected_ue_behaviour_data_1.c @@ -38,23 +38,37 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_cre void OpenAPI_expected_ue_behaviour_data_1_free(OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == expected_ue_behaviour_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_scheduled_communication_time_1_free(expected_ue_behaviour_data_1->scheduled_communication_time); - OpenAPI_list_for_each(expected_ue_behaviour_data_1->expected_umts, node) { - OpenAPI_location_area_1_free(node->data); + if (expected_ue_behaviour_data_1->scheduled_communication_time) { + OpenAPI_scheduled_communication_time_1_free(expected_ue_behaviour_data_1->scheduled_communication_time); + expected_ue_behaviour_data_1->scheduled_communication_time = NULL; + } + if (expected_ue_behaviour_data_1->expected_umts) { + OpenAPI_list_for_each(expected_ue_behaviour_data_1->expected_umts, node) { + OpenAPI_location_area_1_free(node->data); + } + OpenAPI_list_free(expected_ue_behaviour_data_1->expected_umts); + expected_ue_behaviour_data_1->expected_umts = NULL; + } + if (expected_ue_behaviour_data_1->battery_indication) { + OpenAPI_battery_indication_free(expected_ue_behaviour_data_1->battery_indication); + expected_ue_behaviour_data_1->battery_indication = NULL; + } + if (expected_ue_behaviour_data_1->validity_time) { + ogs_free(expected_ue_behaviour_data_1->validity_time); + expected_ue_behaviour_data_1->validity_time = NULL; } - OpenAPI_list_free(expected_ue_behaviour_data_1->expected_umts); - OpenAPI_battery_indication_free(expected_ue_behaviour_data_1->battery_indication); - ogs_free(expected_ue_behaviour_data_1->validity_time); ogs_free(expected_ue_behaviour_data_1); } cJSON *OpenAPI_expected_ue_behaviour_data_1_convertToJSON(OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (expected_ue_behaviour_data_1 == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [ExpectedUeBehaviourData_1]"); @@ -62,7 +76,7 @@ cJSON *OpenAPI_expected_ue_behaviour_data_1_convertToJSON(OpenAPI_expected_ue_be } item = cJSON_CreateObject(); - if (expected_ue_behaviour_data_1->stationary_indication) { + if (expected_ue_behaviour_data_1->stationary_indication != OpenAPI_stationary_indication_NULL) { if (cJSON_AddStringToObject(item, "stationaryIndication", OpenAPI_stationary_indication_ToString(expected_ue_behaviour_data_1->stationary_indication)) == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [stationary_indication]"); goto end; @@ -96,7 +110,7 @@ cJSON *OpenAPI_expected_ue_behaviour_data_1_convertToJSON(OpenAPI_expected_ue_be } } - if (expected_ue_behaviour_data_1->scheduled_communication_type) { + if (expected_ue_behaviour_data_1->scheduled_communication_type != OpenAPI_scheduled_communication_type_NULL) { if (cJSON_AddStringToObject(item, "scheduledCommunicationType", OpenAPI_scheduled_communication_type_ToString(expected_ue_behaviour_data_1->scheduled_communication_type)) == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [scheduled_communication_type]"); goto end; @@ -109,21 +123,17 @@ cJSON *OpenAPI_expected_ue_behaviour_data_1_convertToJSON(OpenAPI_expected_ue_be ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [expected_umts]"); goto end; } - - OpenAPI_lnode_t *expected_umts_node; - if (expected_ue_behaviour_data_1->expected_umts) { - OpenAPI_list_for_each(expected_ue_behaviour_data_1->expected_umts, expected_umts_node) { - cJSON *itemLocal = OpenAPI_location_area_1_convertToJSON(expected_umts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [expected_umts]"); - goto end; - } - cJSON_AddItemToArray(expected_umtsList, itemLocal); + OpenAPI_list_for_each(expected_ue_behaviour_data_1->expected_umts, node) { + cJSON *itemLocal = OpenAPI_location_area_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [expected_umts]"); + goto end; } + cJSON_AddItemToArray(expected_umtsList, itemLocal); } } - if (expected_ue_behaviour_data_1->traffic_profile) { + if (expected_ue_behaviour_data_1->traffic_profile != OpenAPI_traffic_profile_NULL) { if (cJSON_AddStringToObject(item, "trafficProfile", OpenAPI_traffic_profile_ToString(expected_ue_behaviour_data_1->traffic_profile)) == NULL) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [traffic_profile]"); goto end; @@ -157,9 +167,23 @@ end: OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_parseFromJSON(cJSON *expected_ue_behaviour_data_1JSON) { OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_data_1_local_var = NULL; - cJSON *stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "stationaryIndication"); - - OpenAPI_stationary_indication_e stationary_indicationVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *stationary_indication = NULL; + OpenAPI_stationary_indication_e stationary_indicationVariable = 0; + cJSON *communication_duration_time = NULL; + cJSON *periodic_time = NULL; + cJSON *scheduled_communication_time = NULL; + OpenAPI_scheduled_communication_time_1_t *scheduled_communication_time_local_nonprim = NULL; + cJSON *scheduled_communication_type = NULL; + OpenAPI_scheduled_communication_type_e scheduled_communication_typeVariable = 0; + cJSON *expected_umts = NULL; + OpenAPI_list_t *expected_umtsList = NULL; + cJSON *traffic_profile = NULL; + OpenAPI_traffic_profile_e traffic_profileVariable = 0; + cJSON *battery_indication = NULL; + OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL; + cJSON *validity_time = NULL; + stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "stationaryIndication"); if (stationary_indication) { if (!cJSON_IsString(stationary_indication)) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [stationary_indication]"); @@ -168,8 +192,7 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par stationary_indicationVariable = OpenAPI_stationary_indication_FromString(stationary_indication->valuestring); } - cJSON *communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "communicationDurationTime"); - + communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "communicationDurationTime"); if (communication_duration_time) { if (!cJSON_IsNumber(communication_duration_time)) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [communication_duration_time]"); @@ -177,8 +200,7 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par } } - cJSON *periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "periodicTime"); - + periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "periodicTime"); if (periodic_time) { if (!cJSON_IsNumber(periodic_time)) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [periodic_time]"); @@ -186,16 +208,12 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par } } - cJSON *scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "scheduledCommunicationTime"); - - OpenAPI_scheduled_communication_time_1_t *scheduled_communication_time_local_nonprim = NULL; + scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "scheduledCommunicationTime"); if (scheduled_communication_time) { scheduled_communication_time_local_nonprim = OpenAPI_scheduled_communication_time_1_parseFromJSON(scheduled_communication_time); } - cJSON *scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "scheduledCommunicationType"); - - OpenAPI_scheduled_communication_type_e scheduled_communication_typeVariable; + scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "scheduledCommunicationType"); if (scheduled_communication_type) { if (!cJSON_IsString(scheduled_communication_type)) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [scheduled_communication_type]"); @@ -204,38 +222,32 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par scheduled_communication_typeVariable = OpenAPI_scheduled_communication_type_FromString(scheduled_communication_type->valuestring); } - cJSON *expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "expectedUmts"); - - OpenAPI_list_t *expected_umtsList; + expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "expectedUmts"); if (expected_umts) { - cJSON *expected_umts_local_nonprimitive; - if (!cJSON_IsArray(expected_umts)){ - ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [expected_umts]"); - goto end; - } - - expected_umtsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(expected_umts_local_nonprimitive, expected_umts ) { - if (!cJSON_IsObject(expected_umts_local_nonprimitive)) { + cJSON *expected_umts_local = NULL; + if (!cJSON_IsArray(expected_umts)) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [expected_umts]"); goto end; } - OpenAPI_location_area_1_t *expected_umtsItem = OpenAPI_location_area_1_parseFromJSON(expected_umts_local_nonprimitive); - if (!expected_umtsItem) { - ogs_error("No expected_umtsItem"); - OpenAPI_list_free(expected_umtsList); - goto end; + expected_umtsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(expected_umts_local, expected_umts) { + if (!cJSON_IsObject(expected_umts_local)) { + ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [expected_umts]"); + goto end; + } + OpenAPI_location_area_1_t *expected_umtsItem = OpenAPI_location_area_1_parseFromJSON(expected_umts_local); + if (!expected_umtsItem) { + ogs_error("No expected_umtsItem"); + OpenAPI_list_free(expected_umtsList); + goto end; + } + OpenAPI_list_add(expected_umtsList, expected_umtsItem); } - - OpenAPI_list_add(expected_umtsList, expected_umtsItem); - } } - cJSON *traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "trafficProfile"); - - OpenAPI_traffic_profile_e traffic_profileVariable; + traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "trafficProfile"); if (traffic_profile) { if (!cJSON_IsString(traffic_profile)) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [traffic_profile]"); @@ -244,17 +256,14 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par traffic_profileVariable = OpenAPI_traffic_profile_FromString(traffic_profile->valuestring); } - cJSON *battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "batteryIndication"); - - OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL; + battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "batteryIndication"); if (battery_indication) { battery_indication_local_nonprim = OpenAPI_battery_indication_parseFromJSON(battery_indication); } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [validity_time]"); goto end; } @@ -271,11 +280,26 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par expected_umts ? expected_umtsList : NULL, traffic_profile ? traffic_profileVariable : 0, battery_indication ? battery_indication_local_nonprim : NULL, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL ); return expected_ue_behaviour_data_1_local_var; end: + if (scheduled_communication_time_local_nonprim) { + OpenAPI_scheduled_communication_time_1_free(scheduled_communication_time_local_nonprim); + scheduled_communication_time_local_nonprim = NULL; + } + if (expected_umtsList) { + OpenAPI_list_for_each(expected_umtsList, node) { + OpenAPI_location_area_1_free(node->data); + } + OpenAPI_list_free(expected_umtsList); + expected_umtsList = NULL; + } + if (battery_indication_local_nonprim) { + OpenAPI_battery_indication_free(battery_indication_local_nonprim); + battery_indication_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/exposure_data_change_notification.c b/lib/sbi/openapi/model/exposure_data_change_notification.c index fa77c3629..8b459a462 100644 --- a/lib/sbi/openapi/model/exposure_data_change_notification.c +++ b/lib/sbi/openapi/model/exposure_data_change_notification.c @@ -24,26 +24,40 @@ OpenAPI_exposure_data_change_notification_t *OpenAPI_exposure_data_change_notifi void OpenAPI_exposure_data_change_notification_free(OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == exposure_data_change_notification) { return; } - OpenAPI_lnode_t *node; - ogs_free(exposure_data_change_notification->ue_id); - OpenAPI_access_and_mobility_data_free(exposure_data_change_notification->access_and_mobility_data); - OpenAPI_list_for_each(exposure_data_change_notification->pdu_session_management_data, node) { - OpenAPI_pdu_session_management_data_free(node->data); + if (exposure_data_change_notification->ue_id) { + ogs_free(exposure_data_change_notification->ue_id); + exposure_data_change_notification->ue_id = NULL; } - OpenAPI_list_free(exposure_data_change_notification->pdu_session_management_data); - OpenAPI_list_for_each(exposure_data_change_notification->del_resources, node) { - ogs_free(node->data); + if (exposure_data_change_notification->access_and_mobility_data) { + OpenAPI_access_and_mobility_data_free(exposure_data_change_notification->access_and_mobility_data); + exposure_data_change_notification->access_and_mobility_data = NULL; + } + if (exposure_data_change_notification->pdu_session_management_data) { + OpenAPI_list_for_each(exposure_data_change_notification->pdu_session_management_data, node) { + OpenAPI_pdu_session_management_data_free(node->data); + } + OpenAPI_list_free(exposure_data_change_notification->pdu_session_management_data); + exposure_data_change_notification->pdu_session_management_data = NULL; + } + if (exposure_data_change_notification->del_resources) { + OpenAPI_list_for_each(exposure_data_change_notification->del_resources, node) { + ogs_free(node->data); + } + OpenAPI_list_free(exposure_data_change_notification->del_resources); + exposure_data_change_notification->del_resources = NULL; } - OpenAPI_list_free(exposure_data_change_notification->del_resources); ogs_free(exposure_data_change_notification); } cJSON *OpenAPI_exposure_data_change_notification_convertToJSON(OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (exposure_data_change_notification == NULL) { ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [ExposureDataChangeNotification]"); @@ -77,34 +91,28 @@ cJSON *OpenAPI_exposure_data_change_notification_convertToJSON(OpenAPI_exposure_ ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [pdu_session_management_data]"); goto end; } - - OpenAPI_lnode_t *pdu_session_management_data_node; - if (exposure_data_change_notification->pdu_session_management_data) { - OpenAPI_list_for_each(exposure_data_change_notification->pdu_session_management_data, pdu_session_management_data_node) { - cJSON *itemLocal = OpenAPI_pdu_session_management_data_convertToJSON(pdu_session_management_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [pdu_session_management_data]"); - goto end; - } - cJSON_AddItemToArray(pdu_session_management_dataList, itemLocal); + OpenAPI_list_for_each(exposure_data_change_notification->pdu_session_management_data, node) { + cJSON *itemLocal = OpenAPI_pdu_session_management_data_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [pdu_session_management_data]"); + goto end; } + cJSON_AddItemToArray(pdu_session_management_dataList, itemLocal); } } if (exposure_data_change_notification->del_resources) { - cJSON *del_resources = cJSON_AddArrayToObject(item, "delResources"); - if (del_resources == NULL) { + cJSON *del_resourcesList = cJSON_AddArrayToObject(item, "delResources"); + if (del_resourcesList == NULL) { ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [del_resources]"); goto end; } - - OpenAPI_lnode_t *del_resources_node; - OpenAPI_list_for_each(exposure_data_change_notification->del_resources, del_resources_node) { - if (cJSON_AddStringToObject(del_resources, "", (char*)del_resources_node->data) == NULL) { - ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [del_resources]"); - goto end; + OpenAPI_list_for_each(exposure_data_change_notification->del_resources, node) { + if (cJSON_AddStringToObject(del_resourcesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_exposure_data_change_notification_convertToJSON() failed [del_resources]"); + goto end; + } } - } } end: @@ -114,73 +122,75 @@ end: OpenAPI_exposure_data_change_notification_t *OpenAPI_exposure_data_change_notification_parseFromJSON(cJSON *exposure_data_change_notificationJSON) { OpenAPI_exposure_data_change_notification_t *exposure_data_change_notification_local_var = NULL; - cJSON *ue_id = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "ueId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ue_id = NULL; + cJSON *access_and_mobility_data = NULL; + OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_nonprim = NULL; + cJSON *pdu_session_management_data = NULL; + OpenAPI_list_t *pdu_session_management_dataList = NULL; + cJSON *del_resources = NULL; + OpenAPI_list_t *del_resourcesList = NULL; + ue_id = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "ueId"); if (ue_id) { - if (!cJSON_IsString(ue_id)) { + if (!cJSON_IsString(ue_id) && !cJSON_IsNull(ue_id)) { ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [ue_id]"); goto end; } } - cJSON *access_and_mobility_data = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "accessAndMobilityData"); - - OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_nonprim = NULL; + access_and_mobility_data = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "accessAndMobilityData"); if (access_and_mobility_data) { access_and_mobility_data_local_nonprim = OpenAPI_access_and_mobility_data_parseFromJSON(access_and_mobility_data); } - cJSON *pdu_session_management_data = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "pduSessionManagementData"); - - OpenAPI_list_t *pdu_session_management_dataList; + pdu_session_management_data = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "pduSessionManagementData"); if (pdu_session_management_data) { - cJSON *pdu_session_management_data_local_nonprimitive; - if (!cJSON_IsArray(pdu_session_management_data)){ - ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [pdu_session_management_data]"); - goto end; - } - - pdu_session_management_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_session_management_data_local_nonprimitive, pdu_session_management_data ) { - if (!cJSON_IsObject(pdu_session_management_data_local_nonprimitive)) { + cJSON *pdu_session_management_data_local = NULL; + if (!cJSON_IsArray(pdu_session_management_data)) { ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [pdu_session_management_data]"); goto end; } - OpenAPI_pdu_session_management_data_t *pdu_session_management_dataItem = OpenAPI_pdu_session_management_data_parseFromJSON(pdu_session_management_data_local_nonprimitive); - if (!pdu_session_management_dataItem) { - ogs_error("No pdu_session_management_dataItem"); - OpenAPI_list_free(pdu_session_management_dataList); + pdu_session_management_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_management_data_local, pdu_session_management_data) { + if (!cJSON_IsObject(pdu_session_management_data_local)) { + ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [pdu_session_management_data]"); + goto end; + } + OpenAPI_pdu_session_management_data_t *pdu_session_management_dataItem = OpenAPI_pdu_session_management_data_parseFromJSON(pdu_session_management_data_local); + if (!pdu_session_management_dataItem) { + ogs_error("No pdu_session_management_dataItem"); + OpenAPI_list_free(pdu_session_management_dataList); + goto end; + } + OpenAPI_list_add(pdu_session_management_dataList, pdu_session_management_dataItem); + } + } + + del_resources = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "delResources"); + if (del_resources) { + cJSON *del_resources_local = NULL; + if (!cJSON_IsArray(del_resources)) { + ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [del_resources]"); goto end; } - OpenAPI_list_add(pdu_session_management_dataList, pdu_session_management_dataItem); - } - } + del_resourcesList = OpenAPI_list_create(); - cJSON *del_resources = cJSON_GetObjectItemCaseSensitive(exposure_data_change_notificationJSON, "delResources"); - - OpenAPI_list_t *del_resourcesList; - if (del_resources) { - cJSON *del_resources_local; - if (!cJSON_IsArray(del_resources)) { - ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [del_resources]"); - goto end; - } - del_resourcesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(del_resources_local, del_resources) { - if (!cJSON_IsString(del_resources_local)) { - ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [del_resources]"); - goto end; - } - OpenAPI_list_add(del_resourcesList, ogs_strdup(del_resources_local->valuestring)); - } + cJSON_ArrayForEach(del_resources_local, del_resources) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(del_resources_local)) { + ogs_error("OpenAPI_exposure_data_change_notification_parseFromJSON() failed [del_resources]"); + goto end; + } + OpenAPI_list_add(del_resourcesList, ogs_strdup(del_resources_local->valuestring)); + } } exposure_data_change_notification_local_var = OpenAPI_exposure_data_change_notification_create ( - ue_id ? ogs_strdup(ue_id->valuestring) : NULL, + ue_id && !cJSON_IsNull(ue_id) ? ogs_strdup(ue_id->valuestring) : NULL, access_and_mobility_data ? access_and_mobility_data_local_nonprim : NULL, pdu_session_management_data ? pdu_session_management_dataList : NULL, del_resources ? del_resourcesList : NULL @@ -188,6 +198,24 @@ OpenAPI_exposure_data_change_notification_t *OpenAPI_exposure_data_change_notifi return exposure_data_change_notification_local_var; end: + if (access_and_mobility_data_local_nonprim) { + OpenAPI_access_and_mobility_data_free(access_and_mobility_data_local_nonprim); + access_and_mobility_data_local_nonprim = NULL; + } + if (pdu_session_management_dataList) { + OpenAPI_list_for_each(pdu_session_management_dataList, node) { + OpenAPI_pdu_session_management_data_free(node->data); + } + OpenAPI_list_free(pdu_session_management_dataList); + pdu_session_management_dataList = NULL; + } + if (del_resourcesList) { + OpenAPI_list_for_each(del_resourcesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(del_resourcesList); + del_resourcesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/exposure_data_subscription.c b/lib/sbi/openapi/model/exposure_data_subscription.c index 593aea89e..d02f692d3 100644 --- a/lib/sbi/openapi/model/exposure_data_subscription.c +++ b/lib/sbi/openapi/model/exposure_data_subscription.c @@ -24,23 +24,37 @@ OpenAPI_exposure_data_subscription_t *OpenAPI_exposure_data_subscription_create( void OpenAPI_exposure_data_subscription_free(OpenAPI_exposure_data_subscription_t *exposure_data_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == exposure_data_subscription) { return; } - OpenAPI_lnode_t *node; - ogs_free(exposure_data_subscription->notification_uri); - OpenAPI_list_for_each(exposure_data_subscription->monitored_resource_uris, node) { - ogs_free(node->data); + if (exposure_data_subscription->notification_uri) { + ogs_free(exposure_data_subscription->notification_uri); + exposure_data_subscription->notification_uri = NULL; + } + if (exposure_data_subscription->monitored_resource_uris) { + OpenAPI_list_for_each(exposure_data_subscription->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(exposure_data_subscription->monitored_resource_uris); + exposure_data_subscription->monitored_resource_uris = NULL; + } + if (exposure_data_subscription->expiry) { + ogs_free(exposure_data_subscription->expiry); + exposure_data_subscription->expiry = NULL; + } + if (exposure_data_subscription->supported_features) { + ogs_free(exposure_data_subscription->supported_features); + exposure_data_subscription->supported_features = NULL; } - OpenAPI_list_free(exposure_data_subscription->monitored_resource_uris); - ogs_free(exposure_data_subscription->expiry); - ogs_free(exposure_data_subscription->supported_features); ogs_free(exposure_data_subscription); } cJSON *OpenAPI_exposure_data_subscription_convertToJSON(OpenAPI_exposure_data_subscription_t *exposure_data_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (exposure_data_subscription == NULL) { ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [ExposureDataSubscription]"); @@ -48,24 +62,30 @@ cJSON *OpenAPI_exposure_data_subscription_convertToJSON(OpenAPI_exposure_data_su } item = cJSON_CreateObject(); + if (!exposure_data_subscription->notification_uri) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [notification_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationUri", exposure_data_subscription->notification_uri) == NULL) { ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [notification_uri]"); goto end; } - cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); - if (monitored_resource_uris == NULL) { + if (!exposure_data_subscription->monitored_resource_uris) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + return NULL; + } + cJSON *monitored_resource_urisList = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_urisList == NULL) { ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [monitored_resource_uris]"); goto end; } - - OpenAPI_lnode_t *monitored_resource_uris_node; - OpenAPI_list_for_each(exposure_data_subscription->monitored_resource_uris, monitored_resource_uris_node) { - if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { - ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [monitored_resource_uris]"); - goto end; + OpenAPI_list_for_each(exposure_data_subscription->monitored_resource_uris, node) { + if (cJSON_AddStringToObject(monitored_resource_urisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_exposure_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } } - } if (exposure_data_subscription->expiry) { if (cJSON_AddStringToObject(item, "expiry", exposure_data_subscription->expiry) == NULL) { @@ -88,52 +108,56 @@ end: OpenAPI_exposure_data_subscription_t *OpenAPI_exposure_data_subscription_parseFromJSON(cJSON *exposure_data_subscriptionJSON) { OpenAPI_exposure_data_subscription_t *exposure_data_subscription_local_var = NULL; - cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "notificationUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *notification_uri = NULL; + cJSON *monitored_resource_uris = NULL; + OpenAPI_list_t *monitored_resource_urisList = NULL; + cJSON *expiry = NULL; + cJSON *supported_features = NULL; + notification_uri = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "notificationUri"); if (!notification_uri) { ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [notification_uri]"); goto end; } - if (!cJSON_IsString(notification_uri)) { ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [notification_uri]"); goto end; } - cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "monitoredResourceUris"); + monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "monitoredResourceUris"); if (!monitored_resource_uris) { ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); goto end; } + cJSON *monitored_resource_uris_local = NULL; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } - OpenAPI_list_t *monitored_resource_urisList; - cJSON *monitored_resource_uris_local; - if (!cJSON_IsArray(monitored_resource_uris)) { - ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - monitored_resource_urisList = OpenAPI_list_create(); + monitored_resource_urisList = OpenAPI_list_create(); - cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { - if (!cJSON_IsString(monitored_resource_uris_local)) { - ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); - } - - cJSON *expiry = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "expiry"); + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } + expiry = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "expiry"); if (expiry) { - if (!cJSON_IsString(expiry)) { + if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) { ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [expiry]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(exposure_data_subscriptionJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_exposure_data_subscription_parseFromJSON() failed [supported_features]"); goto end; } @@ -142,12 +166,19 @@ OpenAPI_exposure_data_subscription_t *OpenAPI_exposure_data_subscription_parseFr exposure_data_subscription_local_var = OpenAPI_exposure_data_subscription_create ( ogs_strdup(notification_uri->valuestring), monitored_resource_urisList, - expiry ? ogs_strdup(expiry->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return exposure_data_subscription_local_var; end: + if (monitored_resource_urisList) { + OpenAPI_list_for_each(monitored_resource_urisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monitored_resource_urisList); + monitored_resource_urisList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ext_amf_event_subscription.c b/lib/sbi/openapi/model/ext_amf_event_subscription.c index 4b8150745..963b237c9 100644 --- a/lib/sbi/openapi/model/ext_amf_event_subscription.c +++ b/lib/sbi/openapi/model/ext_amf_event_subscription.c @@ -48,34 +48,72 @@ OpenAPI_ext_amf_event_subscription_t *OpenAPI_ext_amf_event_subscription_create( void OpenAPI_ext_amf_event_subscription_free(OpenAPI_ext_amf_event_subscription_t *ext_amf_event_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ext_amf_event_subscription) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ext_amf_event_subscription->event_list, node) { - OpenAPI_amf_event_free(node->data); + if (ext_amf_event_subscription->event_list) { + OpenAPI_list_for_each(ext_amf_event_subscription->event_list, node) { + OpenAPI_amf_event_free(node->data); + } + OpenAPI_list_free(ext_amf_event_subscription->event_list); + ext_amf_event_subscription->event_list = NULL; } - OpenAPI_list_free(ext_amf_event_subscription->event_list); - ogs_free(ext_amf_event_subscription->event_notify_uri); - ogs_free(ext_amf_event_subscription->notify_correlation_id); - ogs_free(ext_amf_event_subscription->nf_id); - ogs_free(ext_amf_event_subscription->subs_change_notify_uri); - ogs_free(ext_amf_event_subscription->subs_change_notify_correlation_id); - ogs_free(ext_amf_event_subscription->supi); - ogs_free(ext_amf_event_subscription->group_id); - ogs_free(ext_amf_event_subscription->gpsi); - ogs_free(ext_amf_event_subscription->pei); - OpenAPI_amf_event_mode_free(ext_amf_event_subscription->options); - OpenAPI_list_for_each(ext_amf_event_subscription->binding_info, node) { - ogs_free(node->data); + if (ext_amf_event_subscription->event_notify_uri) { + ogs_free(ext_amf_event_subscription->event_notify_uri); + ext_amf_event_subscription->event_notify_uri = NULL; + } + if (ext_amf_event_subscription->notify_correlation_id) { + ogs_free(ext_amf_event_subscription->notify_correlation_id); + ext_amf_event_subscription->notify_correlation_id = NULL; + } + if (ext_amf_event_subscription->nf_id) { + ogs_free(ext_amf_event_subscription->nf_id); + ext_amf_event_subscription->nf_id = NULL; + } + if (ext_amf_event_subscription->subs_change_notify_uri) { + ogs_free(ext_amf_event_subscription->subs_change_notify_uri); + ext_amf_event_subscription->subs_change_notify_uri = NULL; + } + if (ext_amf_event_subscription->subs_change_notify_correlation_id) { + ogs_free(ext_amf_event_subscription->subs_change_notify_correlation_id); + ext_amf_event_subscription->subs_change_notify_correlation_id = NULL; + } + if (ext_amf_event_subscription->supi) { + ogs_free(ext_amf_event_subscription->supi); + ext_amf_event_subscription->supi = NULL; + } + if (ext_amf_event_subscription->group_id) { + ogs_free(ext_amf_event_subscription->group_id); + ext_amf_event_subscription->group_id = NULL; + } + if (ext_amf_event_subscription->gpsi) { + ogs_free(ext_amf_event_subscription->gpsi); + ext_amf_event_subscription->gpsi = NULL; + } + if (ext_amf_event_subscription->pei) { + ogs_free(ext_amf_event_subscription->pei); + ext_amf_event_subscription->pei = NULL; + } + if (ext_amf_event_subscription->options) { + OpenAPI_amf_event_mode_free(ext_amf_event_subscription->options); + ext_amf_event_subscription->options = NULL; + } + if (ext_amf_event_subscription->binding_info) { + OpenAPI_list_for_each(ext_amf_event_subscription->binding_info, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ext_amf_event_subscription->binding_info); + ext_amf_event_subscription->binding_info = NULL; } - OpenAPI_list_free(ext_amf_event_subscription->binding_info); ogs_free(ext_amf_event_subscription); } cJSON *OpenAPI_ext_amf_event_subscription_convertToJSON(OpenAPI_ext_amf_event_subscription_t *ext_amf_event_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ext_amf_event_subscription == NULL) { ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [ExtAmfEventSubscription]"); @@ -83,34 +121,46 @@ cJSON *OpenAPI_ext_amf_event_subscription_convertToJSON(OpenAPI_ext_amf_event_su } item = cJSON_CreateObject(); + if (!ext_amf_event_subscription->event_list) { + ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [event_list]"); + return NULL; + } cJSON *event_listList = cJSON_AddArrayToObject(item, "eventList"); if (event_listList == NULL) { ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [event_list]"); goto end; } - - OpenAPI_lnode_t *event_list_node; - if (ext_amf_event_subscription->event_list) { - OpenAPI_list_for_each(ext_amf_event_subscription->event_list, event_list_node) { - cJSON *itemLocal = OpenAPI_amf_event_convertToJSON(event_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [event_list]"); - goto end; - } - cJSON_AddItemToArray(event_listList, itemLocal); + OpenAPI_list_for_each(ext_amf_event_subscription->event_list, node) { + cJSON *itemLocal = OpenAPI_amf_event_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [event_list]"); + goto end; } + cJSON_AddItemToArray(event_listList, itemLocal); } + if (!ext_amf_event_subscription->event_notify_uri) { + ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [event_notify_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "eventNotifyUri", ext_amf_event_subscription->event_notify_uri) == NULL) { ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [event_notify_uri]"); goto end; } + if (!ext_amf_event_subscription->notify_correlation_id) { + ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [notify_correlation_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notifyCorrelationId", ext_amf_event_subscription->notify_correlation_id) == NULL) { ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [notify_correlation_id]"); goto end; } + if (!ext_amf_event_subscription->nf_id) { + ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [nf_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfId", ext_amf_event_subscription->nf_id) == NULL) { ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [nf_id]"); goto end; @@ -178,7 +228,7 @@ cJSON *OpenAPI_ext_amf_event_subscription_convertToJSON(OpenAPI_ext_amf_event_su } } - if (ext_amf_event_subscription->source_nf_type) { + if (ext_amf_event_subscription->source_nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "sourceNfType", OpenAPI_nf_type_ToString(ext_amf_event_subscription->source_nf_type)) == NULL) { ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [source_nf_type]"); goto end; @@ -186,22 +236,20 @@ cJSON *OpenAPI_ext_amf_event_subscription_convertToJSON(OpenAPI_ext_amf_event_su } if (ext_amf_event_subscription->binding_info) { - cJSON *binding_info = cJSON_AddArrayToObject(item, "bindingInfo"); - if (binding_info == NULL) { + cJSON *binding_infoList = cJSON_AddArrayToObject(item, "bindingInfo"); + if (binding_infoList == NULL) { ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [binding_info]"); goto end; } - - OpenAPI_lnode_t *binding_info_node; - OpenAPI_list_for_each(ext_amf_event_subscription->binding_info, binding_info_node) { - if (cJSON_AddStringToObject(binding_info, "", (char*)binding_info_node->data) == NULL) { - ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [binding_info]"); - goto end; + OpenAPI_list_for_each(ext_amf_event_subscription->binding_info, node) { + if (cJSON_AddStringToObject(binding_infoList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [binding_info]"); + goto end; + } } - } } - if (ext_amf_event_subscription->subscribing_nf_type) { + if (ext_amf_event_subscription->subscribing_nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "subscribingNfType", OpenAPI_nf_type_ToString(ext_amf_event_subscription->subscribing_nf_type)) == NULL) { ogs_error("OpenAPI_ext_amf_event_subscription_convertToJSON() failed [subscribing_nf_type]"); goto end; @@ -215,126 +263,133 @@ end: OpenAPI_ext_amf_event_subscription_t *OpenAPI_ext_amf_event_subscription_parseFromJSON(cJSON *ext_amf_event_subscriptionJSON) { OpenAPI_ext_amf_event_subscription_t *ext_amf_event_subscription_local_var = NULL; - cJSON *event_list = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "eventList"); + OpenAPI_lnode_t *node = NULL; + cJSON *event_list = NULL; + OpenAPI_list_t *event_listList = NULL; + cJSON *event_notify_uri = NULL; + cJSON *notify_correlation_id = NULL; + cJSON *nf_id = NULL; + cJSON *subs_change_notify_uri = NULL; + cJSON *subs_change_notify_correlation_id = NULL; + cJSON *supi = NULL; + cJSON *group_id = NULL; + cJSON *gpsi = NULL; + cJSON *pei = NULL; + cJSON *any_ue = NULL; + cJSON *options = NULL; + OpenAPI_amf_event_mode_t *options_local_nonprim = NULL; + cJSON *source_nf_type = NULL; + OpenAPI_nf_type_e source_nf_typeVariable = 0; + cJSON *binding_info = NULL; + OpenAPI_list_t *binding_infoList = NULL; + cJSON *subscribing_nf_type = NULL; + OpenAPI_nf_type_e subscribing_nf_typeVariable = 0; + event_list = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "eventList"); if (!event_list) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [event_list]"); goto end; } - - OpenAPI_list_t *event_listList; - cJSON *event_list_local_nonprimitive; - if (!cJSON_IsArray(event_list)){ - ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [event_list]"); - goto end; - } - - event_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(event_list_local_nonprimitive, event_list ) { - if (!cJSON_IsObject(event_list_local_nonprimitive)) { + cJSON *event_list_local = NULL; + if (!cJSON_IsArray(event_list)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [event_list]"); goto end; } - OpenAPI_amf_event_t *event_listItem = OpenAPI_amf_event_parseFromJSON(event_list_local_nonprimitive); - if (!event_listItem) { - ogs_error("No event_listItem"); - OpenAPI_list_free(event_listList); - goto end; + event_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(event_list_local, event_list) { + if (!cJSON_IsObject(event_list_local)) { + ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [event_list]"); + goto end; + } + OpenAPI_amf_event_t *event_listItem = OpenAPI_amf_event_parseFromJSON(event_list_local); + if (!event_listItem) { + ogs_error("No event_listItem"); + OpenAPI_list_free(event_listList); + goto end; + } + OpenAPI_list_add(event_listList, event_listItem); } - OpenAPI_list_add(event_listList, event_listItem); - } - - cJSON *event_notify_uri = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "eventNotifyUri"); + event_notify_uri = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "eventNotifyUri"); if (!event_notify_uri) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [event_notify_uri]"); goto end; } - if (!cJSON_IsString(event_notify_uri)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [event_notify_uri]"); goto end; } - cJSON *notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "notifyCorrelationId"); + notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "notifyCorrelationId"); if (!notify_correlation_id) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [notify_correlation_id]"); goto end; } - if (!cJSON_IsString(notify_correlation_id)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [notify_correlation_id]"); goto end; } - cJSON *nf_id = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "nfId"); + nf_id = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "nfId"); if (!nf_id) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [nf_id]"); goto end; } - if (!cJSON_IsString(nf_id)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [nf_id]"); goto end; } - cJSON *subs_change_notify_uri = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "subsChangeNotifyUri"); - + subs_change_notify_uri = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "subsChangeNotifyUri"); if (subs_change_notify_uri) { - if (!cJSON_IsString(subs_change_notify_uri)) { + if (!cJSON_IsString(subs_change_notify_uri) && !cJSON_IsNull(subs_change_notify_uri)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [subs_change_notify_uri]"); goto end; } } - cJSON *subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "subsChangeNotifyCorrelationId"); - + subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "subsChangeNotifyCorrelationId"); if (subs_change_notify_correlation_id) { - if (!cJSON_IsString(subs_change_notify_correlation_id)) { + if (!cJSON_IsString(subs_change_notify_correlation_id) && !cJSON_IsNull(subs_change_notify_correlation_id)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [subs_change_notify_correlation_id]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [supi]"); goto end; } } - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "groupId"); - + group_id = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [pei]"); goto end; } } - cJSON *any_ue = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "anyUE"); - + any_ue = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "anyUE"); if (any_ue) { if (!cJSON_IsBool(any_ue)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [any_ue]"); @@ -342,16 +397,12 @@ OpenAPI_ext_amf_event_subscription_t *OpenAPI_ext_amf_event_subscription_parseFr } } - cJSON *options = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "options"); - - OpenAPI_amf_event_mode_t *options_local_nonprim = NULL; + options = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "options"); if (options) { options_local_nonprim = OpenAPI_amf_event_mode_parseFromJSON(options); } - cJSON *source_nf_type = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "sourceNfType"); - - OpenAPI_nf_type_e source_nf_typeVariable; + source_nf_type = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "sourceNfType"); if (source_nf_type) { if (!cJSON_IsString(source_nf_type)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [source_nf_type]"); @@ -360,29 +411,28 @@ OpenAPI_ext_amf_event_subscription_t *OpenAPI_ext_amf_event_subscription_parseFr source_nf_typeVariable = OpenAPI_nf_type_FromString(source_nf_type->valuestring); } - cJSON *binding_info = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "bindingInfo"); - - OpenAPI_list_t *binding_infoList; + binding_info = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "bindingInfo"); if (binding_info) { - cJSON *binding_info_local; - if (!cJSON_IsArray(binding_info)) { - ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [binding_info]"); - goto end; - } - binding_infoList = OpenAPI_list_create(); + cJSON *binding_info_local = NULL; + if (!cJSON_IsArray(binding_info)) { + ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [binding_info]"); + goto end; + } - cJSON_ArrayForEach(binding_info_local, binding_info) { - if (!cJSON_IsString(binding_info_local)) { - ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [binding_info]"); - goto end; - } - OpenAPI_list_add(binding_infoList, ogs_strdup(binding_info_local->valuestring)); - } + binding_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(binding_info_local, binding_info) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(binding_info_local)) { + ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [binding_info]"); + goto end; + } + OpenAPI_list_add(binding_infoList, ogs_strdup(binding_info_local->valuestring)); + } } - cJSON *subscribing_nf_type = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "subscribingNfType"); - - OpenAPI_nf_type_e subscribing_nf_typeVariable; + subscribing_nf_type = cJSON_GetObjectItemCaseSensitive(ext_amf_event_subscriptionJSON, "subscribingNfType"); if (subscribing_nf_type) { if (!cJSON_IsString(subscribing_nf_type)) { ogs_error("OpenAPI_ext_amf_event_subscription_parseFromJSON() failed [subscribing_nf_type]"); @@ -396,12 +446,12 @@ OpenAPI_ext_amf_event_subscription_t *OpenAPI_ext_amf_event_subscription_parseFr ogs_strdup(event_notify_uri->valuestring), ogs_strdup(notify_correlation_id->valuestring), ogs_strdup(nf_id->valuestring), - subs_change_notify_uri ? ogs_strdup(subs_change_notify_uri->valuestring) : NULL, - subs_change_notify_correlation_id ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL, - group_id ? ogs_strdup(group_id->valuestring) : NULL, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - pei ? ogs_strdup(pei->valuestring) : NULL, + subs_change_notify_uri && !cJSON_IsNull(subs_change_notify_uri) ? ogs_strdup(subs_change_notify_uri->valuestring) : NULL, + subs_change_notify_correlation_id && !cJSON_IsNull(subs_change_notify_correlation_id) ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, any_ue ? true : false, any_ue ? any_ue->valueint : 0, options ? options_local_nonprim : NULL, @@ -412,6 +462,24 @@ OpenAPI_ext_amf_event_subscription_t *OpenAPI_ext_amf_event_subscription_parseFr return ext_amf_event_subscription_local_var; end: + if (event_listList) { + OpenAPI_list_for_each(event_listList, node) { + OpenAPI_amf_event_free(node->data); + } + OpenAPI_list_free(event_listList); + event_listList = NULL; + } + if (options_local_nonprim) { + OpenAPI_amf_event_mode_free(options_local_nonprim); + options_local_nonprim = NULL; + } + if (binding_infoList) { + OpenAPI_list_for_each(binding_infoList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(binding_infoList); + binding_infoList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ext_amf_event_subscription.h b/lib/sbi/openapi/model/ext_amf_event_subscription.h index 0dde2a71f..f1317bee0 100644 --- a/lib/sbi/openapi/model/ext_amf_event_subscription.h +++ b/lib/sbi/openapi/model/ext_amf_event_subscription.h @@ -14,8 +14,6 @@ #include "../include/binary.h" #include "amf_event.h" #include "amf_event_mode.h" -#include "amf_event_subscription.h" -#include "amf_event_subscription_add_info.h" #include "nf_type.h" #ifdef __cplusplus diff --git a/lib/sbi/openapi/model/ext_problem_details.c b/lib/sbi/openapi/model/ext_problem_details.c index 8bf70a850..68cae8d21 100644 --- a/lib/sbi/openapi/model/ext_problem_details.c +++ b/lib/sbi/openapi/model/ext_problem_details.c @@ -44,29 +44,61 @@ OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_create( void OpenAPI_ext_problem_details_free(OpenAPI_ext_problem_details_t *ext_problem_details) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ext_problem_details) { return; } - OpenAPI_lnode_t *node; - ogs_free(ext_problem_details->type); - ogs_free(ext_problem_details->title); - ogs_free(ext_problem_details->detail); - ogs_free(ext_problem_details->instance); - ogs_free(ext_problem_details->cause); - OpenAPI_list_for_each(ext_problem_details->invalid_params, node) { - OpenAPI_invalid_param_free(node->data); + if (ext_problem_details->type) { + ogs_free(ext_problem_details->type); + ext_problem_details->type = NULL; + } + if (ext_problem_details->title) { + ogs_free(ext_problem_details->title); + ext_problem_details->title = NULL; + } + if (ext_problem_details->detail) { + ogs_free(ext_problem_details->detail); + ext_problem_details->detail = NULL; + } + if (ext_problem_details->instance) { + ogs_free(ext_problem_details->instance); + ext_problem_details->instance = NULL; + } + if (ext_problem_details->cause) { + ogs_free(ext_problem_details->cause); + ext_problem_details->cause = NULL; + } + if (ext_problem_details->invalid_params) { + OpenAPI_list_for_each(ext_problem_details->invalid_params, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(ext_problem_details->invalid_params); + ext_problem_details->invalid_params = NULL; + } + if (ext_problem_details->supported_features) { + ogs_free(ext_problem_details->supported_features); + ext_problem_details->supported_features = NULL; + } + if (ext_problem_details->access_token_error) { + OpenAPI_access_token_err_free(ext_problem_details->access_token_error); + ext_problem_details->access_token_error = NULL; + } + if (ext_problem_details->access_token_request) { + OpenAPI_access_token_req_free(ext_problem_details->access_token_request); + ext_problem_details->access_token_request = NULL; + } + if (ext_problem_details->nrf_id) { + ogs_free(ext_problem_details->nrf_id); + ext_problem_details->nrf_id = NULL; } - OpenAPI_list_free(ext_problem_details->invalid_params); - ogs_free(ext_problem_details->supported_features); - OpenAPI_access_token_err_free(ext_problem_details->access_token_error); - OpenAPI_access_token_req_free(ext_problem_details->access_token_request); - ogs_free(ext_problem_details->nrf_id); ogs_free(ext_problem_details); } cJSON *OpenAPI_ext_problem_details_convertToJSON(OpenAPI_ext_problem_details_t *ext_problem_details) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ext_problem_details == NULL) { ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [ExtProblemDetails]"); @@ -122,17 +154,13 @@ cJSON *OpenAPI_ext_problem_details_convertToJSON(OpenAPI_ext_problem_details_t * ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [invalid_params]"); goto end; } - - OpenAPI_lnode_t *invalid_params_node; - if (ext_problem_details->invalid_params) { - OpenAPI_list_for_each(ext_problem_details->invalid_params, invalid_params_node) { - cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(invalid_params_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [invalid_params]"); - goto end; - } - cJSON_AddItemToArray(invalid_paramsList, itemLocal); + OpenAPI_list_for_each(ext_problem_details->invalid_params, node) { + cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [invalid_params]"); + goto end; } + cJSON_AddItemToArray(invalid_paramsList, itemLocal); } } @@ -190,26 +218,39 @@ end: OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_parseFromJSON(cJSON *ext_problem_detailsJSON) { OpenAPI_ext_problem_details_t *ext_problem_details_local_var = NULL; - cJSON *type = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "type"); - + OpenAPI_lnode_t *node = NULL; + cJSON *type = NULL; + cJSON *title = NULL; + cJSON *status = NULL; + cJSON *detail = NULL; + cJSON *instance = NULL; + cJSON *cause = NULL; + cJSON *invalid_params = NULL; + OpenAPI_list_t *invalid_paramsList = NULL; + cJSON *supported_features = NULL; + cJSON *access_token_error = NULL; + OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + cJSON *access_token_request = NULL; + OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + cJSON *nrf_id = NULL; + cJSON *remote_error = NULL; + type = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "type"); if (type) { - if (!cJSON_IsString(type)) { + if (!cJSON_IsString(type) && !cJSON_IsNull(type)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [type]"); goto end; } } - cJSON *title = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "title"); - + title = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "title"); if (title) { - if (!cJSON_IsString(title)) { + if (!cJSON_IsString(title) && !cJSON_IsNull(title)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [title]"); goto end; } } - cJSON *status = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "status"); - + status = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "status"); if (status) { if (!cJSON_IsNumber(status)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [status]"); @@ -217,96 +258,82 @@ OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_parseFromJSON(cJSON * } } - cJSON *detail = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "detail"); - + detail = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "detail"); if (detail) { - if (!cJSON_IsString(detail)) { + if (!cJSON_IsString(detail) && !cJSON_IsNull(detail)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [detail]"); goto end; } } - cJSON *instance = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "instance"); - + instance = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "instance"); if (instance) { - if (!cJSON_IsString(instance)) { + if (!cJSON_IsString(instance) && !cJSON_IsNull(instance)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [instance]"); goto end; } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "cause"); - + cause = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "cause"); if (cause) { - if (!cJSON_IsString(cause)) { + if (!cJSON_IsString(cause) && !cJSON_IsNull(cause)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [cause]"); goto end; } } - cJSON *invalid_params = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "invalidParams"); - - OpenAPI_list_t *invalid_paramsList; + invalid_params = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "invalidParams"); if (invalid_params) { - cJSON *invalid_params_local_nonprimitive; - if (!cJSON_IsArray(invalid_params)){ - ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [invalid_params]"); - goto end; - } - - invalid_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(invalid_params_local_nonprimitive, invalid_params ) { - if (!cJSON_IsObject(invalid_params_local_nonprimitive)) { + cJSON *invalid_params_local = NULL; + if (!cJSON_IsArray(invalid_params)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [invalid_params]"); goto end; } - OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local_nonprimitive); - if (!invalid_paramsItem) { - ogs_error("No invalid_paramsItem"); - OpenAPI_list_free(invalid_paramsList); - goto end; + invalid_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(invalid_params_local, invalid_params) { + if (!cJSON_IsObject(invalid_params_local)) { + ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [invalid_params]"); + goto end; + } + OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local); + if (!invalid_paramsItem) { + ogs_error("No invalid_paramsItem"); + OpenAPI_list_free(invalid_paramsList); + goto end; + } + OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); } - - OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); - } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *access_token_error = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "accessTokenError"); - - OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + access_token_error = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "accessTokenError"); if (access_token_error) { access_token_error_local_nonprim = OpenAPI_access_token_err_parseFromJSON(access_token_error); } - cJSON *access_token_request = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "accessTokenRequest"); - - OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + access_token_request = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "accessTokenRequest"); if (access_token_request) { access_token_request_local_nonprim = OpenAPI_access_token_req_parseFromJSON(access_token_request); } - cJSON *nrf_id = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "nrfId"); - + nrf_id = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "nrfId"); if (nrf_id) { - if (!cJSON_IsString(nrf_id)) { + if (!cJSON_IsString(nrf_id) && !cJSON_IsNull(nrf_id)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [nrf_id]"); goto end; } } - cJSON *remote_error = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "remoteError"); - + remote_error = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "remoteError"); if (remote_error) { if (!cJSON_IsBool(remote_error)) { ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [remote_error]"); @@ -315,24 +342,39 @@ OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_parseFromJSON(cJSON * } ext_problem_details_local_var = OpenAPI_ext_problem_details_create ( - type ? ogs_strdup(type->valuestring) : NULL, - title ? ogs_strdup(title->valuestring) : NULL, + type && !cJSON_IsNull(type) ? ogs_strdup(type->valuestring) : NULL, + title && !cJSON_IsNull(title) ? ogs_strdup(title->valuestring) : NULL, status ? true : false, status ? status->valuedouble : 0, - detail ? ogs_strdup(detail->valuestring) : NULL, - instance ? ogs_strdup(instance->valuestring) : NULL, - cause ? ogs_strdup(cause->valuestring) : NULL, + detail && !cJSON_IsNull(detail) ? ogs_strdup(detail->valuestring) : NULL, + instance && !cJSON_IsNull(instance) ? ogs_strdup(instance->valuestring) : NULL, + cause && !cJSON_IsNull(cause) ? ogs_strdup(cause->valuestring) : NULL, invalid_params ? invalid_paramsList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, access_token_error ? access_token_error_local_nonprim : NULL, access_token_request ? access_token_request_local_nonprim : NULL, - nrf_id ? ogs_strdup(nrf_id->valuestring) : NULL, + nrf_id && !cJSON_IsNull(nrf_id) ? ogs_strdup(nrf_id->valuestring) : NULL, remote_error ? true : false, remote_error ? remote_error->valueint : 0 ); return ext_problem_details_local_var; end: + if (invalid_paramsList) { + OpenAPI_list_for_each(invalid_paramsList, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(invalid_paramsList); + invalid_paramsList = NULL; + } + if (access_token_error_local_nonprim) { + OpenAPI_access_token_err_free(access_token_error_local_nonprim); + access_token_error_local_nonprim = NULL; + } + if (access_token_request_local_nonprim) { + OpenAPI_access_token_req_free(access_token_request_local_nonprim); + access_token_request_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ext_problem_details.h b/lib/sbi/openapi/model/ext_problem_details.h index a27bae8eb..ce1314041 100644 --- a/lib/sbi/openapi/model/ext_problem_details.h +++ b/lib/sbi/openapi/model/ext_problem_details.h @@ -15,8 +15,6 @@ #include "access_token_err.h" #include "access_token_req.h" #include "invalid_param.h" -#include "problem_details.h" -#include "problem_details_add_info.h" #ifdef __cplusplus extern "C" { diff --git a/lib/sbi/openapi/model/ext_snssai.c b/lib/sbi/openapi/model/ext_snssai.c index 83c661f15..7eaffb8ec 100644 --- a/lib/sbi/openapi/model/ext_snssai.c +++ b/lib/sbi/openapi/model/ext_snssai.c @@ -26,21 +26,29 @@ OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_create( void OpenAPI_ext_snssai_free(OpenAPI_ext_snssai_t *ext_snssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ext_snssai) { return; } - OpenAPI_lnode_t *node; - ogs_free(ext_snssai->sd); - OpenAPI_list_for_each(ext_snssai->sd_ranges, node) { - OpenAPI_sd_range_free(node->data); + if (ext_snssai->sd) { + ogs_free(ext_snssai->sd); + ext_snssai->sd = NULL; + } + if (ext_snssai->sd_ranges) { + OpenAPI_list_for_each(ext_snssai->sd_ranges, node) { + OpenAPI_sd_range_free(node->data); + } + OpenAPI_list_free(ext_snssai->sd_ranges); + ext_snssai->sd_ranges = NULL; } - OpenAPI_list_free(ext_snssai->sd_ranges); ogs_free(ext_snssai); } cJSON *OpenAPI_ext_snssai_convertToJSON(OpenAPI_ext_snssai_t *ext_snssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ext_snssai == NULL) { ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [ExtSnssai]"); @@ -66,17 +74,13 @@ cJSON *OpenAPI_ext_snssai_convertToJSON(OpenAPI_ext_snssai_t *ext_snssai) ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [sd_ranges]"); goto end; } - - OpenAPI_lnode_t *sd_ranges_node; - if (ext_snssai->sd_ranges) { - OpenAPI_list_for_each(ext_snssai->sd_ranges, sd_ranges_node) { - cJSON *itemLocal = OpenAPI_sd_range_convertToJSON(sd_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [sd_ranges]"); - goto end; - } - cJSON_AddItemToArray(sd_rangesList, itemLocal); + OpenAPI_list_for_each(ext_snssai->sd_ranges, node) { + cJSON *itemLocal = OpenAPI_sd_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [sd_ranges]"); + goto end; } + cJSON_AddItemToArray(sd_rangesList, itemLocal); } } @@ -94,57 +98,56 @@ end: OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_parseFromJSON(cJSON *ext_snssaiJSON) { OpenAPI_ext_snssai_t *ext_snssai_local_var = NULL; - cJSON *sst = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sst"); + OpenAPI_lnode_t *node = NULL; + cJSON *sst = NULL; + cJSON *sd = NULL; + cJSON *sd_ranges = NULL; + OpenAPI_list_t *sd_rangesList = NULL; + cJSON *wildcard_sd = NULL; + sst = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sst"); if (!sst) { ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sst]"); goto end; } - if (!cJSON_IsNumber(sst)) { ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sst]"); goto end; } - cJSON *sd = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sd"); - + sd = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sd"); if (sd) { - if (!cJSON_IsString(sd)) { + if (!cJSON_IsString(sd) && !cJSON_IsNull(sd)) { ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sd]"); goto end; } } - cJSON *sd_ranges = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sdRanges"); - - OpenAPI_list_t *sd_rangesList; + sd_ranges = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sdRanges"); if (sd_ranges) { - cJSON *sd_ranges_local_nonprimitive; - if (!cJSON_IsArray(sd_ranges)){ - ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sd_ranges]"); - goto end; - } - - sd_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sd_ranges_local_nonprimitive, sd_ranges ) { - if (!cJSON_IsObject(sd_ranges_local_nonprimitive)) { + cJSON *sd_ranges_local = NULL; + if (!cJSON_IsArray(sd_ranges)) { ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sd_ranges]"); goto end; } - OpenAPI_sd_range_t *sd_rangesItem = OpenAPI_sd_range_parseFromJSON(sd_ranges_local_nonprimitive); - if (!sd_rangesItem) { - ogs_error("No sd_rangesItem"); - OpenAPI_list_free(sd_rangesList); - goto end; + sd_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sd_ranges_local, sd_ranges) { + if (!cJSON_IsObject(sd_ranges_local)) { + ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sd_ranges]"); + goto end; + } + OpenAPI_sd_range_t *sd_rangesItem = OpenAPI_sd_range_parseFromJSON(sd_ranges_local); + if (!sd_rangesItem) { + ogs_error("No sd_rangesItem"); + OpenAPI_list_free(sd_rangesList); + goto end; + } + OpenAPI_list_add(sd_rangesList, sd_rangesItem); } - - OpenAPI_list_add(sd_rangesList, sd_rangesItem); - } } - cJSON *wildcard_sd = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "wildcardSd"); - + wildcard_sd = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "wildcardSd"); if (wildcard_sd) { if (!cJSON_IsBool(wildcard_sd)) { ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [wildcard_sd]"); @@ -155,7 +158,7 @@ OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_parseFromJSON(cJSON *ext_snssaiJSON) ext_snssai_local_var = OpenAPI_ext_snssai_create ( sst->valuedouble, - sd ? ogs_strdup(sd->valuestring) : NULL, + sd && !cJSON_IsNull(sd) ? ogs_strdup(sd->valuestring) : NULL, sd_ranges ? sd_rangesList : NULL, wildcard_sd ? true : false, wildcard_sd ? wildcard_sd->valueint : 0 @@ -163,6 +166,13 @@ OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_parseFromJSON(cJSON *ext_snssaiJSON) return ext_snssai_local_var; end: + if (sd_rangesList) { + OpenAPI_list_for_each(sd_rangesList, node) { + OpenAPI_sd_range_free(node->data); + } + OpenAPI_list_free(sd_rangesList); + sd_rangesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ext_snssai.h b/lib/sbi/openapi/model/ext_snssai.h index ef54a48e1..726de69db 100644 --- a/lib/sbi/openapi/model/ext_snssai.h +++ b/lib/sbi/openapi/model/ext_snssai.h @@ -13,8 +13,6 @@ #include "../include/keyValuePair.h" #include "../include/binary.h" #include "sd_range.h" -#include "snssai.h" -#include "snssai_extension.h" #ifdef __cplusplus extern "C" { diff --git a/lib/sbi/openapi/model/extended_problem_details.c b/lib/sbi/openapi/model/extended_problem_details.c index b926eeafa..b0c8fd986 100644 --- a/lib/sbi/openapi/model/extended_problem_details.c +++ b/lib/sbi/openapi/model/extended_problem_details.c @@ -42,30 +42,65 @@ OpenAPI_extended_problem_details_t *OpenAPI_extended_problem_details_create( void OpenAPI_extended_problem_details_free(OpenAPI_extended_problem_details_t *extended_problem_details) { + OpenAPI_lnode_t *node = NULL; + if (NULL == extended_problem_details) { return; } - OpenAPI_lnode_t *node; - ogs_free(extended_problem_details->type); - ogs_free(extended_problem_details->title); - ogs_free(extended_problem_details->detail); - ogs_free(extended_problem_details->instance); - ogs_free(extended_problem_details->cause); - OpenAPI_list_for_each(extended_problem_details->invalid_params, node) { - OpenAPI_invalid_param_free(node->data); + if (extended_problem_details->type) { + ogs_free(extended_problem_details->type); + extended_problem_details->type = NULL; + } + if (extended_problem_details->title) { + ogs_free(extended_problem_details->title); + extended_problem_details->title = NULL; + } + if (extended_problem_details->detail) { + ogs_free(extended_problem_details->detail); + extended_problem_details->detail = NULL; + } + if (extended_problem_details->instance) { + ogs_free(extended_problem_details->instance); + extended_problem_details->instance = NULL; + } + if (extended_problem_details->cause) { + ogs_free(extended_problem_details->cause); + extended_problem_details->cause = NULL; + } + if (extended_problem_details->invalid_params) { + OpenAPI_list_for_each(extended_problem_details->invalid_params, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(extended_problem_details->invalid_params); + extended_problem_details->invalid_params = NULL; + } + if (extended_problem_details->supported_features) { + ogs_free(extended_problem_details->supported_features); + extended_problem_details->supported_features = NULL; + } + if (extended_problem_details->access_token_error) { + OpenAPI_access_token_err_free(extended_problem_details->access_token_error); + extended_problem_details->access_token_error = NULL; + } + if (extended_problem_details->access_token_request) { + OpenAPI_access_token_req_free(extended_problem_details->access_token_request); + extended_problem_details->access_token_request = NULL; + } + if (extended_problem_details->nrf_id) { + ogs_free(extended_problem_details->nrf_id); + extended_problem_details->nrf_id = NULL; + } + if (extended_problem_details->acceptable_serv_info) { + OpenAPI_acceptable_service_info_free(extended_problem_details->acceptable_serv_info); + extended_problem_details->acceptable_serv_info = NULL; } - OpenAPI_list_free(extended_problem_details->invalid_params); - ogs_free(extended_problem_details->supported_features); - OpenAPI_access_token_err_free(extended_problem_details->access_token_error); - OpenAPI_access_token_req_free(extended_problem_details->access_token_request); - ogs_free(extended_problem_details->nrf_id); - OpenAPI_acceptable_service_info_free(extended_problem_details->acceptable_serv_info); ogs_free(extended_problem_details); } cJSON *OpenAPI_extended_problem_details_convertToJSON(OpenAPI_extended_problem_details_t *extended_problem_details) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (extended_problem_details == NULL) { ogs_error("OpenAPI_extended_problem_details_convertToJSON() failed [ExtendedProblemDetails]"); @@ -121,17 +156,13 @@ cJSON *OpenAPI_extended_problem_details_convertToJSON(OpenAPI_extended_problem_d ogs_error("OpenAPI_extended_problem_details_convertToJSON() failed [invalid_params]"); goto end; } - - OpenAPI_lnode_t *invalid_params_node; - if (extended_problem_details->invalid_params) { - OpenAPI_list_for_each(extended_problem_details->invalid_params, invalid_params_node) { - cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(invalid_params_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_extended_problem_details_convertToJSON() failed [invalid_params]"); - goto end; - } - cJSON_AddItemToArray(invalid_paramsList, itemLocal); + OpenAPI_list_for_each(extended_problem_details->invalid_params, node) { + cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_extended_problem_details_convertToJSON() failed [invalid_params]"); + goto end; } + cJSON_AddItemToArray(invalid_paramsList, itemLocal); } } @@ -195,26 +226,40 @@ end: OpenAPI_extended_problem_details_t *OpenAPI_extended_problem_details_parseFromJSON(cJSON *extended_problem_detailsJSON) { OpenAPI_extended_problem_details_t *extended_problem_details_local_var = NULL; - cJSON *type = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "type"); - + OpenAPI_lnode_t *node = NULL; + cJSON *type = NULL; + cJSON *title = NULL; + cJSON *status = NULL; + cJSON *detail = NULL; + cJSON *instance = NULL; + cJSON *cause = NULL; + cJSON *invalid_params = NULL; + OpenAPI_list_t *invalid_paramsList = NULL; + cJSON *supported_features = NULL; + cJSON *access_token_error = NULL; + OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + cJSON *access_token_request = NULL; + OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + cJSON *nrf_id = NULL; + cJSON *acceptable_serv_info = NULL; + OpenAPI_acceptable_service_info_t *acceptable_serv_info_local_nonprim = NULL; + type = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "type"); if (type) { - if (!cJSON_IsString(type)) { + if (!cJSON_IsString(type) && !cJSON_IsNull(type)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [type]"); goto end; } } - cJSON *title = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "title"); - + title = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "title"); if (title) { - if (!cJSON_IsString(title)) { + if (!cJSON_IsString(title) && !cJSON_IsNull(title)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [title]"); goto end; } } - cJSON *status = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "status"); - + status = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "status"); if (status) { if (!cJSON_IsNumber(status)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [status]"); @@ -222,119 +267,123 @@ OpenAPI_extended_problem_details_t *OpenAPI_extended_problem_details_parseFromJS } } - cJSON *detail = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "detail"); - + detail = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "detail"); if (detail) { - if (!cJSON_IsString(detail)) { + if (!cJSON_IsString(detail) && !cJSON_IsNull(detail)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [detail]"); goto end; } } - cJSON *instance = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "instance"); - + instance = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "instance"); if (instance) { - if (!cJSON_IsString(instance)) { + if (!cJSON_IsString(instance) && !cJSON_IsNull(instance)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [instance]"); goto end; } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "cause"); - + cause = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "cause"); if (cause) { - if (!cJSON_IsString(cause)) { + if (!cJSON_IsString(cause) && !cJSON_IsNull(cause)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [cause]"); goto end; } } - cJSON *invalid_params = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "invalidParams"); - - OpenAPI_list_t *invalid_paramsList; + invalid_params = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "invalidParams"); if (invalid_params) { - cJSON *invalid_params_local_nonprimitive; - if (!cJSON_IsArray(invalid_params)){ - ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [invalid_params]"); - goto end; - } - - invalid_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(invalid_params_local_nonprimitive, invalid_params ) { - if (!cJSON_IsObject(invalid_params_local_nonprimitive)) { + cJSON *invalid_params_local = NULL; + if (!cJSON_IsArray(invalid_params)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [invalid_params]"); goto end; } - OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local_nonprimitive); - if (!invalid_paramsItem) { - ogs_error("No invalid_paramsItem"); - OpenAPI_list_free(invalid_paramsList); - goto end; + invalid_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(invalid_params_local, invalid_params) { + if (!cJSON_IsObject(invalid_params_local)) { + ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [invalid_params]"); + goto end; + } + OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local); + if (!invalid_paramsItem) { + ogs_error("No invalid_paramsItem"); + OpenAPI_list_free(invalid_paramsList); + goto end; + } + OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); } - - OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); - } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *access_token_error = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "accessTokenError"); - - OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + access_token_error = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "accessTokenError"); if (access_token_error) { access_token_error_local_nonprim = OpenAPI_access_token_err_parseFromJSON(access_token_error); } - cJSON *access_token_request = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "accessTokenRequest"); - - OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + access_token_request = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "accessTokenRequest"); if (access_token_request) { access_token_request_local_nonprim = OpenAPI_access_token_req_parseFromJSON(access_token_request); } - cJSON *nrf_id = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "nrfId"); - + nrf_id = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "nrfId"); if (nrf_id) { - if (!cJSON_IsString(nrf_id)) { + if (!cJSON_IsString(nrf_id) && !cJSON_IsNull(nrf_id)) { ogs_error("OpenAPI_extended_problem_details_parseFromJSON() failed [nrf_id]"); goto end; } } - cJSON *acceptable_serv_info = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "acceptableServInfo"); - - OpenAPI_acceptable_service_info_t *acceptable_serv_info_local_nonprim = NULL; + acceptable_serv_info = cJSON_GetObjectItemCaseSensitive(extended_problem_detailsJSON, "acceptableServInfo"); if (acceptable_serv_info) { acceptable_serv_info_local_nonprim = OpenAPI_acceptable_service_info_parseFromJSON(acceptable_serv_info); } extended_problem_details_local_var = OpenAPI_extended_problem_details_create ( - type ? ogs_strdup(type->valuestring) : NULL, - title ? ogs_strdup(title->valuestring) : NULL, + type && !cJSON_IsNull(type) ? ogs_strdup(type->valuestring) : NULL, + title && !cJSON_IsNull(title) ? ogs_strdup(title->valuestring) : NULL, status ? true : false, status ? status->valuedouble : 0, - detail ? ogs_strdup(detail->valuestring) : NULL, - instance ? ogs_strdup(instance->valuestring) : NULL, - cause ? ogs_strdup(cause->valuestring) : NULL, + detail && !cJSON_IsNull(detail) ? ogs_strdup(detail->valuestring) : NULL, + instance && !cJSON_IsNull(instance) ? ogs_strdup(instance->valuestring) : NULL, + cause && !cJSON_IsNull(cause) ? ogs_strdup(cause->valuestring) : NULL, invalid_params ? invalid_paramsList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, access_token_error ? access_token_error_local_nonprim : NULL, access_token_request ? access_token_request_local_nonprim : NULL, - nrf_id ? ogs_strdup(nrf_id->valuestring) : NULL, + nrf_id && !cJSON_IsNull(nrf_id) ? ogs_strdup(nrf_id->valuestring) : NULL, acceptable_serv_info ? acceptable_serv_info_local_nonprim : NULL ); return extended_problem_details_local_var; end: + if (invalid_paramsList) { + OpenAPI_list_for_each(invalid_paramsList, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(invalid_paramsList); + invalid_paramsList = NULL; + } + if (access_token_error_local_nonprim) { + OpenAPI_access_token_err_free(access_token_error_local_nonprim); + access_token_error_local_nonprim = NULL; + } + if (access_token_request_local_nonprim) { + OpenAPI_access_token_req_free(access_token_request_local_nonprim); + access_token_request_local_nonprim = NULL; + } + if (acceptable_serv_info_local_nonprim) { + OpenAPI_acceptable_service_info_free(acceptable_serv_info_local_nonprim); + acceptable_serv_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/extended_problem_details.h b/lib/sbi/openapi/model/extended_problem_details.h index 573c94793..9b03fc86f 100644 --- a/lib/sbi/openapi/model/extended_problem_details.h +++ b/lib/sbi/openapi/model/extended_problem_details.h @@ -15,9 +15,7 @@ #include "acceptable_service_info.h" #include "access_token_err.h" #include "access_token_req.h" -#include "extended_problem_details_all_of.h" #include "invalid_param.h" -#include "problem_details.h" #ifdef __cplusplus extern "C" { diff --git a/lib/sbi/openapi/model/extended_problem_details_all_of.c b/lib/sbi/openapi/model/extended_problem_details_all_of.c index 7442ed25b..c27a43025 100644 --- a/lib/sbi/openapi/model/extended_problem_details_all_of.c +++ b/lib/sbi/openapi/model/extended_problem_details_all_of.c @@ -18,17 +18,22 @@ OpenAPI_extended_problem_details_all_of_t *OpenAPI_extended_problem_details_all_ void OpenAPI_extended_problem_details_all_of_free(OpenAPI_extended_problem_details_all_of_t *extended_problem_details_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == extended_problem_details_all_of) { return; } - OpenAPI_lnode_t *node; - OpenAPI_acceptable_service_info_free(extended_problem_details_all_of->acceptable_serv_info); + if (extended_problem_details_all_of->acceptable_serv_info) { + OpenAPI_acceptable_service_info_free(extended_problem_details_all_of->acceptable_serv_info); + extended_problem_details_all_of->acceptable_serv_info = NULL; + } ogs_free(extended_problem_details_all_of); } cJSON *OpenAPI_extended_problem_details_all_of_convertToJSON(OpenAPI_extended_problem_details_all_of_t *extended_problem_details_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (extended_problem_details_all_of == NULL) { ogs_error("OpenAPI_extended_problem_details_all_of_convertToJSON() failed [ExtendedProblemDetails_allOf]"); @@ -56,9 +61,10 @@ end: OpenAPI_extended_problem_details_all_of_t *OpenAPI_extended_problem_details_all_of_parseFromJSON(cJSON *extended_problem_details_all_ofJSON) { OpenAPI_extended_problem_details_all_of_t *extended_problem_details_all_of_local_var = NULL; - cJSON *acceptable_serv_info = cJSON_GetObjectItemCaseSensitive(extended_problem_details_all_ofJSON, "acceptableServInfo"); - + OpenAPI_lnode_t *node = NULL; + cJSON *acceptable_serv_info = NULL; OpenAPI_acceptable_service_info_t *acceptable_serv_info_local_nonprim = NULL; + acceptable_serv_info = cJSON_GetObjectItemCaseSensitive(extended_problem_details_all_ofJSON, "acceptableServInfo"); if (acceptable_serv_info) { acceptable_serv_info_local_nonprim = OpenAPI_acceptable_service_info_parseFromJSON(acceptable_serv_info); } @@ -69,6 +75,10 @@ OpenAPI_extended_problem_details_all_of_t *OpenAPI_extended_problem_details_all_ return extended_problem_details_all_of_local_var; end: + if (acceptable_serv_info_local_nonprim) { + OpenAPI_acceptable_service_info_free(acceptable_serv_info_local_nonprim); + acceptable_serv_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/external_client_type.c b/lib/sbi/openapi/model/external_client_type.c index fec084248..84754a041 100644 --- a/lib/sbi/openapi/model/external_client_type.c +++ b/lib/sbi/openapi/model/external_client_type.c @@ -16,16 +16,18 @@ OpenAPI_external_client_type_t *OpenAPI_external_client_type_create( void OpenAPI_external_client_type_free(OpenAPI_external_client_type_t *external_client_type) { + OpenAPI_lnode_t *node = NULL; + if (NULL == external_client_type) { return; } - OpenAPI_lnode_t *node; ogs_free(external_client_type); } cJSON *OpenAPI_external_client_type_convertToJSON(OpenAPI_external_client_type_t *external_client_type) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (external_client_type == NULL) { ogs_error("OpenAPI_external_client_type_convertToJSON() failed [ExternalClientType]"); @@ -40,6 +42,7 @@ end: OpenAPI_external_client_type_t *OpenAPI_external_client_type_parseFromJSON(cJSON *external_client_typeJSON) { OpenAPI_external_client_type_t *external_client_type_local_var = NULL; + OpenAPI_lnode_t *node = NULL; external_client_type_local_var = OpenAPI_external_client_type_create ( ); diff --git a/lib/sbi/openapi/model/external_unrelated_class.c b/lib/sbi/openapi/model/external_unrelated_class.c index e235b1ac0..09e253618 100644 --- a/lib/sbi/openapi/model/external_unrelated_class.c +++ b/lib/sbi/openapi/model/external_unrelated_class.c @@ -22,28 +22,39 @@ OpenAPI_external_unrelated_class_t *OpenAPI_external_unrelated_class_create( void OpenAPI_external_unrelated_class_free(OpenAPI_external_unrelated_class_t *external_unrelated_class) { + OpenAPI_lnode_t *node = NULL; + if (NULL == external_unrelated_class) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(external_unrelated_class->lcs_client_externals, node) { - OpenAPI_lcs_client_external_free(node->data); + if (external_unrelated_class->lcs_client_externals) { + OpenAPI_list_for_each(external_unrelated_class->lcs_client_externals, node) { + OpenAPI_lcs_client_external_free(node->data); + } + OpenAPI_list_free(external_unrelated_class->lcs_client_externals); + external_unrelated_class->lcs_client_externals = NULL; } - OpenAPI_list_free(external_unrelated_class->lcs_client_externals); - OpenAPI_list_for_each(external_unrelated_class->af_externals, node) { - OpenAPI_af_external_free(node->data); + if (external_unrelated_class->af_externals) { + OpenAPI_list_for_each(external_unrelated_class->af_externals, node) { + OpenAPI_af_external_free(node->data); + } + OpenAPI_list_free(external_unrelated_class->af_externals); + external_unrelated_class->af_externals = NULL; } - OpenAPI_list_free(external_unrelated_class->af_externals); - OpenAPI_list_for_each(external_unrelated_class->lcs_client_group_externals, node) { - OpenAPI_lcs_client_group_external_free(node->data); + if (external_unrelated_class->lcs_client_group_externals) { + OpenAPI_list_for_each(external_unrelated_class->lcs_client_group_externals, node) { + OpenAPI_lcs_client_group_external_free(node->data); + } + OpenAPI_list_free(external_unrelated_class->lcs_client_group_externals); + external_unrelated_class->lcs_client_group_externals = NULL; } - OpenAPI_list_free(external_unrelated_class->lcs_client_group_externals); ogs_free(external_unrelated_class); } cJSON *OpenAPI_external_unrelated_class_convertToJSON(OpenAPI_external_unrelated_class_t *external_unrelated_class) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (external_unrelated_class == NULL) { ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [ExternalUnrelatedClass]"); @@ -57,17 +68,13 @@ cJSON *OpenAPI_external_unrelated_class_convertToJSON(OpenAPI_external_unrelated ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_externals]"); goto end; } - - OpenAPI_lnode_t *lcs_client_externals_node; - if (external_unrelated_class->lcs_client_externals) { - OpenAPI_list_for_each(external_unrelated_class->lcs_client_externals, lcs_client_externals_node) { - cJSON *itemLocal = OpenAPI_lcs_client_external_convertToJSON(lcs_client_externals_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_externals]"); - goto end; - } - cJSON_AddItemToArray(lcs_client_externalsList, itemLocal); + OpenAPI_list_for_each(external_unrelated_class->lcs_client_externals, node) { + cJSON *itemLocal = OpenAPI_lcs_client_external_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_externals]"); + goto end; } + cJSON_AddItemToArray(lcs_client_externalsList, itemLocal); } } @@ -77,17 +84,13 @@ cJSON *OpenAPI_external_unrelated_class_convertToJSON(OpenAPI_external_unrelated ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [af_externals]"); goto end; } - - OpenAPI_lnode_t *af_externals_node; - if (external_unrelated_class->af_externals) { - OpenAPI_list_for_each(external_unrelated_class->af_externals, af_externals_node) { - cJSON *itemLocal = OpenAPI_af_external_convertToJSON(af_externals_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [af_externals]"); - goto end; - } - cJSON_AddItemToArray(af_externalsList, itemLocal); + OpenAPI_list_for_each(external_unrelated_class->af_externals, node) { + cJSON *itemLocal = OpenAPI_af_external_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [af_externals]"); + goto end; } + cJSON_AddItemToArray(af_externalsList, itemLocal); } } @@ -97,17 +100,13 @@ cJSON *OpenAPI_external_unrelated_class_convertToJSON(OpenAPI_external_unrelated ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_group_externals]"); goto end; } - - OpenAPI_lnode_t *lcs_client_group_externals_node; - if (external_unrelated_class->lcs_client_group_externals) { - OpenAPI_list_for_each(external_unrelated_class->lcs_client_group_externals, lcs_client_group_externals_node) { - cJSON *itemLocal = OpenAPI_lcs_client_group_external_convertToJSON(lcs_client_group_externals_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_group_externals]"); - goto end; - } - cJSON_AddItemToArray(lcs_client_group_externalsList, itemLocal); + OpenAPI_list_for_each(external_unrelated_class->lcs_client_group_externals, node) { + cJSON *itemLocal = OpenAPI_lcs_client_group_external_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_external_unrelated_class_convertToJSON() failed [lcs_client_group_externals]"); + goto end; } + cJSON_AddItemToArray(lcs_client_group_externalsList, itemLocal); } } @@ -118,91 +117,86 @@ end: OpenAPI_external_unrelated_class_t *OpenAPI_external_unrelated_class_parseFromJSON(cJSON *external_unrelated_classJSON) { OpenAPI_external_unrelated_class_t *external_unrelated_class_local_var = NULL; - cJSON *lcs_client_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "lcsClientExternals"); - - OpenAPI_list_t *lcs_client_externalsList; + OpenAPI_lnode_t *node = NULL; + cJSON *lcs_client_externals = NULL; + OpenAPI_list_t *lcs_client_externalsList = NULL; + cJSON *af_externals = NULL; + OpenAPI_list_t *af_externalsList = NULL; + cJSON *lcs_client_group_externals = NULL; + OpenAPI_list_t *lcs_client_group_externalsList = NULL; + lcs_client_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "lcsClientExternals"); if (lcs_client_externals) { - cJSON *lcs_client_externals_local_nonprimitive; - if (!cJSON_IsArray(lcs_client_externals)){ - ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_externals]"); - goto end; - } - - lcs_client_externalsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(lcs_client_externals_local_nonprimitive, lcs_client_externals ) { - if (!cJSON_IsObject(lcs_client_externals_local_nonprimitive)) { + cJSON *lcs_client_externals_local = NULL; + if (!cJSON_IsArray(lcs_client_externals)) { ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_externals]"); goto end; } - OpenAPI_lcs_client_external_t *lcs_client_externalsItem = OpenAPI_lcs_client_external_parseFromJSON(lcs_client_externals_local_nonprimitive); - if (!lcs_client_externalsItem) { - ogs_error("No lcs_client_externalsItem"); - OpenAPI_list_free(lcs_client_externalsList); - goto end; + lcs_client_externalsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(lcs_client_externals_local, lcs_client_externals) { + if (!cJSON_IsObject(lcs_client_externals_local)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_externals]"); + goto end; + } + OpenAPI_lcs_client_external_t *lcs_client_externalsItem = OpenAPI_lcs_client_external_parseFromJSON(lcs_client_externals_local); + if (!lcs_client_externalsItem) { + ogs_error("No lcs_client_externalsItem"); + OpenAPI_list_free(lcs_client_externalsList); + goto end; + } + OpenAPI_list_add(lcs_client_externalsList, lcs_client_externalsItem); } - - OpenAPI_list_add(lcs_client_externalsList, lcs_client_externalsItem); - } } - cJSON *af_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "afExternals"); - - OpenAPI_list_t *af_externalsList; + af_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "afExternals"); if (af_externals) { - cJSON *af_externals_local_nonprimitive; - if (!cJSON_IsArray(af_externals)){ - ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [af_externals]"); - goto end; - } - - af_externalsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(af_externals_local_nonprimitive, af_externals ) { - if (!cJSON_IsObject(af_externals_local_nonprimitive)) { + cJSON *af_externals_local = NULL; + if (!cJSON_IsArray(af_externals)) { ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [af_externals]"); goto end; } - OpenAPI_af_external_t *af_externalsItem = OpenAPI_af_external_parseFromJSON(af_externals_local_nonprimitive); - if (!af_externalsItem) { - ogs_error("No af_externalsItem"); - OpenAPI_list_free(af_externalsList); - goto end; + af_externalsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_externals_local, af_externals) { + if (!cJSON_IsObject(af_externals_local)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [af_externals]"); + goto end; + } + OpenAPI_af_external_t *af_externalsItem = OpenAPI_af_external_parseFromJSON(af_externals_local); + if (!af_externalsItem) { + ogs_error("No af_externalsItem"); + OpenAPI_list_free(af_externalsList); + goto end; + } + OpenAPI_list_add(af_externalsList, af_externalsItem); } - - OpenAPI_list_add(af_externalsList, af_externalsItem); - } } - cJSON *lcs_client_group_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "lcsClientGroupExternals"); - - OpenAPI_list_t *lcs_client_group_externalsList; + lcs_client_group_externals = cJSON_GetObjectItemCaseSensitive(external_unrelated_classJSON, "lcsClientGroupExternals"); if (lcs_client_group_externals) { - cJSON *lcs_client_group_externals_local_nonprimitive; - if (!cJSON_IsArray(lcs_client_group_externals)){ - ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_group_externals]"); - goto end; - } - - lcs_client_group_externalsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(lcs_client_group_externals_local_nonprimitive, lcs_client_group_externals ) { - if (!cJSON_IsObject(lcs_client_group_externals_local_nonprimitive)) { + cJSON *lcs_client_group_externals_local = NULL; + if (!cJSON_IsArray(lcs_client_group_externals)) { ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_group_externals]"); goto end; } - OpenAPI_lcs_client_group_external_t *lcs_client_group_externalsItem = OpenAPI_lcs_client_group_external_parseFromJSON(lcs_client_group_externals_local_nonprimitive); - if (!lcs_client_group_externalsItem) { - ogs_error("No lcs_client_group_externalsItem"); - OpenAPI_list_free(lcs_client_group_externalsList); - goto end; + lcs_client_group_externalsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(lcs_client_group_externals_local, lcs_client_group_externals) { + if (!cJSON_IsObject(lcs_client_group_externals_local)) { + ogs_error("OpenAPI_external_unrelated_class_parseFromJSON() failed [lcs_client_group_externals]"); + goto end; + } + OpenAPI_lcs_client_group_external_t *lcs_client_group_externalsItem = OpenAPI_lcs_client_group_external_parseFromJSON(lcs_client_group_externals_local); + if (!lcs_client_group_externalsItem) { + ogs_error("No lcs_client_group_externalsItem"); + OpenAPI_list_free(lcs_client_group_externalsList); + goto end; + } + OpenAPI_list_add(lcs_client_group_externalsList, lcs_client_group_externalsItem); } - - OpenAPI_list_add(lcs_client_group_externalsList, lcs_client_group_externalsItem); - } } external_unrelated_class_local_var = OpenAPI_external_unrelated_class_create ( @@ -213,6 +207,27 @@ OpenAPI_external_unrelated_class_t *OpenAPI_external_unrelated_class_parseFromJS return external_unrelated_class_local_var; end: + if (lcs_client_externalsList) { + OpenAPI_list_for_each(lcs_client_externalsList, node) { + OpenAPI_lcs_client_external_free(node->data); + } + OpenAPI_list_free(lcs_client_externalsList); + lcs_client_externalsList = NULL; + } + if (af_externalsList) { + OpenAPI_list_for_each(af_externalsList, node) { + OpenAPI_af_external_free(node->data); + } + OpenAPI_list_free(af_externalsList); + af_externalsList = NULL; + } + if (lcs_client_group_externalsList) { + OpenAPI_list_for_each(lcs_client_group_externalsList, node) { + OpenAPI_lcs_client_group_external_free(node->data); + } + OpenAPI_list_free(lcs_client_group_externalsList); + lcs_client_group_externalsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/final_unit_action.c b/lib/sbi/openapi/model/final_unit_action.c index 26c001601..5980f1286 100644 --- a/lib/sbi/openapi/model/final_unit_action.c +++ b/lib/sbi/openapi/model/final_unit_action.c @@ -16,16 +16,18 @@ OpenAPI_final_unit_action_t *OpenAPI_final_unit_action_create( void OpenAPI_final_unit_action_free(OpenAPI_final_unit_action_t *final_unit_action) { + OpenAPI_lnode_t *node = NULL; + if (NULL == final_unit_action) { return; } - OpenAPI_lnode_t *node; ogs_free(final_unit_action); } cJSON *OpenAPI_final_unit_action_convertToJSON(OpenAPI_final_unit_action_t *final_unit_action) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (final_unit_action == NULL) { ogs_error("OpenAPI_final_unit_action_convertToJSON() failed [FinalUnitAction]"); @@ -40,6 +42,7 @@ end: OpenAPI_final_unit_action_t *OpenAPI_final_unit_action_parseFromJSON(cJSON *final_unit_actionJSON) { OpenAPI_final_unit_action_t *final_unit_action_local_var = NULL; + OpenAPI_lnode_t *node = NULL; final_unit_action_local_var = OpenAPI_final_unit_action_create ( ); diff --git a/lib/sbi/openapi/model/flow_info.c b/lib/sbi/openapi/model/flow_info.c index 72b46daf0..001637dfa 100644 --- a/lib/sbi/openapi/model/flow_info.c +++ b/lib/sbi/openapi/model/flow_info.c @@ -20,20 +20,25 @@ OpenAPI_flow_info_t *OpenAPI_flow_info_create( void OpenAPI_flow_info_free(OpenAPI_flow_info_t *flow_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == flow_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(flow_info->flow_descriptions, node) { - ogs_free(node->data); + if (flow_info->flow_descriptions) { + OpenAPI_list_for_each(flow_info->flow_descriptions, node) { + ogs_free(node->data); + } + OpenAPI_list_free(flow_info->flow_descriptions); + flow_info->flow_descriptions = NULL; } - OpenAPI_list_free(flow_info->flow_descriptions); ogs_free(flow_info); } cJSON *OpenAPI_flow_info_convertToJSON(OpenAPI_flow_info_t *flow_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (flow_info == NULL) { ogs_error("OpenAPI_flow_info_convertToJSON() failed [FlowInfo]"); @@ -47,19 +52,17 @@ cJSON *OpenAPI_flow_info_convertToJSON(OpenAPI_flow_info_t *flow_info) } if (flow_info->flow_descriptions) { - cJSON *flow_descriptions = cJSON_AddArrayToObject(item, "flowDescriptions"); - if (flow_descriptions == NULL) { + cJSON *flow_descriptionsList = cJSON_AddArrayToObject(item, "flowDescriptions"); + if (flow_descriptionsList == NULL) { ogs_error("OpenAPI_flow_info_convertToJSON() failed [flow_descriptions]"); goto end; } - - OpenAPI_lnode_t *flow_descriptions_node; - OpenAPI_list_for_each(flow_info->flow_descriptions, flow_descriptions_node) { - if (cJSON_AddStringToObject(flow_descriptions, "", (char*)flow_descriptions_node->data) == NULL) { - ogs_error("OpenAPI_flow_info_convertToJSON() failed [flow_descriptions]"); - goto end; + OpenAPI_list_for_each(flow_info->flow_descriptions, node) { + if (cJSON_AddStringToObject(flow_descriptionsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_flow_info_convertToJSON() failed [flow_descriptions]"); + goto end; + } } - } } end: @@ -69,35 +72,39 @@ end: OpenAPI_flow_info_t *OpenAPI_flow_info_parseFromJSON(cJSON *flow_infoJSON) { OpenAPI_flow_info_t *flow_info_local_var = NULL; - cJSON *flow_id = cJSON_GetObjectItemCaseSensitive(flow_infoJSON, "flowId"); + OpenAPI_lnode_t *node = NULL; + cJSON *flow_id = NULL; + cJSON *flow_descriptions = NULL; + OpenAPI_list_t *flow_descriptionsList = NULL; + flow_id = cJSON_GetObjectItemCaseSensitive(flow_infoJSON, "flowId"); if (!flow_id) { ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_id]"); goto end; } - if (!cJSON_IsNumber(flow_id)) { ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_id]"); goto end; } - cJSON *flow_descriptions = cJSON_GetObjectItemCaseSensitive(flow_infoJSON, "flowDescriptions"); - - OpenAPI_list_t *flow_descriptionsList; + flow_descriptions = cJSON_GetObjectItemCaseSensitive(flow_infoJSON, "flowDescriptions"); if (flow_descriptions) { - cJSON *flow_descriptions_local; - if (!cJSON_IsArray(flow_descriptions)) { - ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_descriptions]"); - goto end; - } - flow_descriptionsList = OpenAPI_list_create(); + cJSON *flow_descriptions_local = NULL; + if (!cJSON_IsArray(flow_descriptions)) { + ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_descriptions]"); + goto end; + } - cJSON_ArrayForEach(flow_descriptions_local, flow_descriptions) { - if (!cJSON_IsString(flow_descriptions_local)) { - ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_descriptions]"); - goto end; - } - OpenAPI_list_add(flow_descriptionsList, ogs_strdup(flow_descriptions_local->valuestring)); - } + flow_descriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flow_descriptions_local, flow_descriptions) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(flow_descriptions_local)) { + ogs_error("OpenAPI_flow_info_parseFromJSON() failed [flow_descriptions]"); + goto end; + } + OpenAPI_list_add(flow_descriptionsList, ogs_strdup(flow_descriptions_local->valuestring)); + } } flow_info_local_var = OpenAPI_flow_info_create ( @@ -108,6 +115,13 @@ OpenAPI_flow_info_t *OpenAPI_flow_info_parseFromJSON(cJSON *flow_infoJSON) return flow_info_local_var; end: + if (flow_descriptionsList) { + OpenAPI_list_for_each(flow_descriptionsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(flow_descriptionsList); + flow_descriptionsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/flow_information.c b/lib/sbi/openapi/model/flow_information.c index 9e07be934..d87f4ac04 100644 --- a/lib/sbi/openapi/model/flow_information.c +++ b/lib/sbi/openapi/model/flow_information.c @@ -34,22 +34,42 @@ OpenAPI_flow_information_t *OpenAPI_flow_information_create( void OpenAPI_flow_information_free(OpenAPI_flow_information_t *flow_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == flow_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(flow_information->flow_description); - OpenAPI_eth_flow_description_free(flow_information->eth_flow_description); - ogs_free(flow_information->pack_filt_id); - ogs_free(flow_information->tos_traffic_class); - ogs_free(flow_information->spi); - ogs_free(flow_information->flow_label); + if (flow_information->flow_description) { + ogs_free(flow_information->flow_description); + flow_information->flow_description = NULL; + } + if (flow_information->eth_flow_description) { + OpenAPI_eth_flow_description_free(flow_information->eth_flow_description); + flow_information->eth_flow_description = NULL; + } + if (flow_information->pack_filt_id) { + ogs_free(flow_information->pack_filt_id); + flow_information->pack_filt_id = NULL; + } + if (flow_information->tos_traffic_class) { + ogs_free(flow_information->tos_traffic_class); + flow_information->tos_traffic_class = NULL; + } + if (flow_information->spi) { + ogs_free(flow_information->spi); + flow_information->spi = NULL; + } + if (flow_information->flow_label) { + ogs_free(flow_information->flow_label); + flow_information->flow_label = NULL; + } ogs_free(flow_information); } cJSON *OpenAPI_flow_information_convertToJSON(OpenAPI_flow_information_t *flow_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (flow_information == NULL) { ogs_error("OpenAPI_flow_information_convertToJSON() failed [FlowInformation]"); @@ -112,7 +132,7 @@ cJSON *OpenAPI_flow_information_convertToJSON(OpenAPI_flow_information_t *flow_i } } - if (flow_information->flow_direction) { + if (flow_information->flow_direction != OpenAPI_flow_direction_NULL) { if (cJSON_AddStringToObject(item, "flowDirection", OpenAPI_flow_direction_ToString(flow_information->flow_direction)) == NULL) { ogs_error("OpenAPI_flow_information_convertToJSON() failed [flow_direction]"); goto end; @@ -126,33 +146,39 @@ end: OpenAPI_flow_information_t *OpenAPI_flow_information_parseFromJSON(cJSON *flow_informationJSON) { OpenAPI_flow_information_t *flow_information_local_var = NULL; - cJSON *flow_description = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "flowDescription"); - + OpenAPI_lnode_t *node = NULL; + cJSON *flow_description = NULL; + cJSON *eth_flow_description = NULL; + OpenAPI_eth_flow_description_t *eth_flow_description_local_nonprim = NULL; + cJSON *pack_filt_id = NULL; + cJSON *packet_filter_usage = NULL; + cJSON *tos_traffic_class = NULL; + cJSON *spi = NULL; + cJSON *flow_label = NULL; + cJSON *flow_direction = NULL; + OpenAPI_flow_direction_e flow_directionVariable = 0; + flow_description = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "flowDescription"); if (flow_description) { - if (!cJSON_IsString(flow_description)) { + if (!cJSON_IsString(flow_description) && !cJSON_IsNull(flow_description)) { ogs_error("OpenAPI_flow_information_parseFromJSON() failed [flow_description]"); goto end; } } - cJSON *eth_flow_description = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "ethFlowDescription"); - - OpenAPI_eth_flow_description_t *eth_flow_description_local_nonprim = NULL; + eth_flow_description = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "ethFlowDescription"); if (eth_flow_description) { eth_flow_description_local_nonprim = OpenAPI_eth_flow_description_parseFromJSON(eth_flow_description); } - cJSON *pack_filt_id = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "packFiltId"); - + pack_filt_id = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "packFiltId"); if (pack_filt_id) { - if (!cJSON_IsString(pack_filt_id)) { + if (!cJSON_IsString(pack_filt_id) && !cJSON_IsNull(pack_filt_id)) { ogs_error("OpenAPI_flow_information_parseFromJSON() failed [pack_filt_id]"); goto end; } } - cJSON *packet_filter_usage = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "packetFilterUsage"); - + packet_filter_usage = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "packetFilterUsage"); if (packet_filter_usage) { if (!cJSON_IsBool(packet_filter_usage)) { ogs_error("OpenAPI_flow_information_parseFromJSON() failed [packet_filter_usage]"); @@ -160,36 +186,31 @@ OpenAPI_flow_information_t *OpenAPI_flow_information_parseFromJSON(cJSON *flow_i } } - cJSON *tos_traffic_class = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "tosTrafficClass"); - + tos_traffic_class = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "tosTrafficClass"); if (tos_traffic_class) { - if (!cJSON_IsString(tos_traffic_class)) { + if (!cJSON_IsString(tos_traffic_class) && !cJSON_IsNull(tos_traffic_class)) { ogs_error("OpenAPI_flow_information_parseFromJSON() failed [tos_traffic_class]"); goto end; } } - cJSON *spi = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "spi"); - + spi = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "spi"); if (spi) { - if (!cJSON_IsString(spi)) { + if (!cJSON_IsString(spi) && !cJSON_IsNull(spi)) { ogs_error("OpenAPI_flow_information_parseFromJSON() failed [spi]"); goto end; } } - cJSON *flow_label = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "flowLabel"); - + flow_label = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "flowLabel"); if (flow_label) { - if (!cJSON_IsString(flow_label)) { + if (!cJSON_IsString(flow_label) && !cJSON_IsNull(flow_label)) { ogs_error("OpenAPI_flow_information_parseFromJSON() failed [flow_label]"); goto end; } } - cJSON *flow_direction = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "flowDirection"); - - OpenAPI_flow_direction_e flow_directionVariable; + flow_direction = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "flowDirection"); if (flow_direction) { if (!cJSON_IsString(flow_direction)) { ogs_error("OpenAPI_flow_information_parseFromJSON() failed [flow_direction]"); @@ -199,19 +220,23 @@ OpenAPI_flow_information_t *OpenAPI_flow_information_parseFromJSON(cJSON *flow_i } flow_information_local_var = OpenAPI_flow_information_create ( - flow_description ? ogs_strdup(flow_description->valuestring) : NULL, + flow_description && !cJSON_IsNull(flow_description) ? ogs_strdup(flow_description->valuestring) : NULL, eth_flow_description ? eth_flow_description_local_nonprim : NULL, - pack_filt_id ? ogs_strdup(pack_filt_id->valuestring) : NULL, + pack_filt_id && !cJSON_IsNull(pack_filt_id) ? ogs_strdup(pack_filt_id->valuestring) : NULL, packet_filter_usage ? true : false, packet_filter_usage ? packet_filter_usage->valueint : 0, - tos_traffic_class ? ogs_strdup(tos_traffic_class->valuestring) : NULL, - spi ? ogs_strdup(spi->valuestring) : NULL, - flow_label ? ogs_strdup(flow_label->valuestring) : NULL, + tos_traffic_class && !cJSON_IsNull(tos_traffic_class) ? ogs_strdup(tos_traffic_class->valuestring) : NULL, + spi && !cJSON_IsNull(spi) ? ogs_strdup(spi->valuestring) : NULL, + flow_label && !cJSON_IsNull(flow_label) ? ogs_strdup(flow_label->valuestring) : NULL, flow_direction ? flow_directionVariable : 0 ); return flow_information_local_var; end: + if (eth_flow_description_local_nonprim) { + OpenAPI_eth_flow_description_free(eth_flow_description_local_nonprim); + eth_flow_description_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/flow_status.c b/lib/sbi/openapi/model/flow_status.c index 2f64ba74f..00004b6b0 100644 --- a/lib/sbi/openapi/model/flow_status.c +++ b/lib/sbi/openapi/model/flow_status.c @@ -6,7 +6,7 @@ char* OpenAPI_flow_status_ToString(OpenAPI_flow_status_e flow_status) { - const char *flow_statusArray[] = { "NULL", "ENABLED_UPLINK", "ENABLED_DOWNLINK", "ENABLED", "DISABLED", "REMOVED" }; + const char *flow_statusArray[] = { "NULL", "ENABLED-UPLINK", "ENABLED-DOWNLINK", "ENABLED", "DISABLED", "REMOVED" }; size_t sizeofArray = sizeof(flow_statusArray) / sizeof(flow_statusArray[0]); if (flow_status < sizeofArray) return (char *)flow_statusArray[flow_status]; @@ -17,7 +17,7 @@ char* OpenAPI_flow_status_ToString(OpenAPI_flow_status_e flow_status) OpenAPI_flow_status_e OpenAPI_flow_status_FromString(char* flow_status) { int stringToReturn = 0; - const char *flow_statusArray[] = { "NULL", "ENABLED_UPLINK", "ENABLED_DOWNLINK", "ENABLED", "DISABLED", "REMOVED" }; + const char *flow_statusArray[] = { "NULL", "ENABLED-UPLINK", "ENABLED-DOWNLINK", "ENABLED", "DISABLED", "REMOVED" }; size_t sizeofArray = sizeof(flow_statusArray) / sizeof(flow_statusArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(flow_status, flow_statusArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/flows.c b/lib/sbi/openapi/model/flows.c index c56f4a791..35e48d80f 100644 --- a/lib/sbi/openapi/model/flows.c +++ b/lib/sbi/openapi/model/flows.c @@ -22,24 +22,32 @@ OpenAPI_flows_t *OpenAPI_flows_create( void OpenAPI_flows_free(OpenAPI_flows_t *flows) { + OpenAPI_lnode_t *node = NULL; + if (NULL == flows) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(flows->cont_vers, node) { - ogs_free(node->data); + if (flows->cont_vers) { + OpenAPI_list_for_each(flows->cont_vers, node) { + ogs_free(node->data); + } + OpenAPI_list_free(flows->cont_vers); + flows->cont_vers = NULL; } - OpenAPI_list_free(flows->cont_vers); - OpenAPI_list_for_each(flows->f_nums, node) { - ogs_free(node->data); + if (flows->f_nums) { + OpenAPI_list_for_each(flows->f_nums, node) { + ogs_free(node->data); + } + OpenAPI_list_free(flows->f_nums); + flows->f_nums = NULL; } - OpenAPI_list_free(flows->f_nums); ogs_free(flows); } cJSON *OpenAPI_flows_convertToJSON(OpenAPI_flows_t *flows) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (flows == NULL) { ogs_error("OpenAPI_flows_convertToJSON() failed [Flows]"); @@ -48,35 +56,31 @@ cJSON *OpenAPI_flows_convertToJSON(OpenAPI_flows_t *flows) item = cJSON_CreateObject(); if (flows->cont_vers) { - cJSON *cont_vers = cJSON_AddArrayToObject(item, "contVers"); - if (cont_vers == NULL) { + cJSON *cont_versList = cJSON_AddArrayToObject(item, "contVers"); + if (cont_versList == NULL) { ogs_error("OpenAPI_flows_convertToJSON() failed [cont_vers]"); goto end; } - - OpenAPI_lnode_t *cont_vers_node; - OpenAPI_list_for_each(flows->cont_vers, cont_vers_node) { - if (cJSON_AddNumberToObject(cont_vers, "", *(double *)cont_vers_node->data) == NULL) { - ogs_error("OpenAPI_flows_convertToJSON() failed [cont_vers]"); - goto end; + OpenAPI_list_for_each(flows->cont_vers, node) { + if (cJSON_AddNumberToObject(cont_versList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_flows_convertToJSON() failed [cont_vers]"); + goto end; + } } - } } if (flows->f_nums) { - cJSON *f_nums = cJSON_AddArrayToObject(item, "fNums"); - if (f_nums == NULL) { + cJSON *f_numsList = cJSON_AddArrayToObject(item, "fNums"); + if (f_numsList == NULL) { ogs_error("OpenAPI_flows_convertToJSON() failed [f_nums]"); goto end; } - - OpenAPI_lnode_t *f_nums_node; - OpenAPI_list_for_each(flows->f_nums, f_nums_node) { - if (cJSON_AddNumberToObject(f_nums, "", *(double *)f_nums_node->data) == NULL) { - ogs_error("OpenAPI_flows_convertToJSON() failed [f_nums]"); - goto end; + OpenAPI_list_for_each(flows->f_nums, node) { + if (cJSON_AddNumberToObject(f_numsList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_flows_convertToJSON() failed [f_nums]"); + goto end; + } } - } } if (cJSON_AddNumberToObject(item, "medCompN", flows->med_comp_n) == NULL) { @@ -91,52 +95,71 @@ end: OpenAPI_flows_t *OpenAPI_flows_parseFromJSON(cJSON *flowsJSON) { OpenAPI_flows_t *flows_local_var = NULL; - cJSON *cont_vers = cJSON_GetObjectItemCaseSensitive(flowsJSON, "contVers"); - - OpenAPI_list_t *cont_versList; + OpenAPI_lnode_t *node = NULL; + cJSON *cont_vers = NULL; + OpenAPI_list_t *cont_versList = NULL; + cJSON *f_nums = NULL; + OpenAPI_list_t *f_numsList = NULL; + cJSON *med_comp_n = NULL; + cont_vers = cJSON_GetObjectItemCaseSensitive(flowsJSON, "contVers"); if (cont_vers) { - cJSON *cont_vers_local; - if (!cJSON_IsArray(cont_vers)) { - ogs_error("OpenAPI_flows_parseFromJSON() failed [cont_vers]"); - goto end; - } - cont_versList = OpenAPI_list_create(); + cJSON *cont_vers_local = NULL; + if (!cJSON_IsArray(cont_vers)) { + ogs_error("OpenAPI_flows_parseFromJSON() failed [cont_vers]"); + goto end; + } - cJSON_ArrayForEach(cont_vers_local, cont_vers) { - if (!cJSON_IsNumber(cont_vers_local)) { - ogs_error("OpenAPI_flows_parseFromJSON() failed [cont_vers]"); - goto end; - } - OpenAPI_list_add(cont_versList, &cont_vers_local->valuedouble); - } + cont_versList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cont_vers_local, cont_vers) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(cont_vers_local)) { + ogs_error("OpenAPI_flows_parseFromJSON() failed [cont_vers]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_flows_parseFromJSON() failed [cont_vers]"); + goto end; + } + *localDouble = cont_vers_local->valuedouble; + OpenAPI_list_add(cont_versList, localDouble); + } } - cJSON *f_nums = cJSON_GetObjectItemCaseSensitive(flowsJSON, "fNums"); - - OpenAPI_list_t *f_numsList; + f_nums = cJSON_GetObjectItemCaseSensitive(flowsJSON, "fNums"); if (f_nums) { - cJSON *f_nums_local; - if (!cJSON_IsArray(f_nums)) { - ogs_error("OpenAPI_flows_parseFromJSON() failed [f_nums]"); - goto end; - } - f_numsList = OpenAPI_list_create(); + cJSON *f_nums_local = NULL; + if (!cJSON_IsArray(f_nums)) { + ogs_error("OpenAPI_flows_parseFromJSON() failed [f_nums]"); + goto end; + } - cJSON_ArrayForEach(f_nums_local, f_nums) { - if (!cJSON_IsNumber(f_nums_local)) { - ogs_error("OpenAPI_flows_parseFromJSON() failed [f_nums]"); - goto end; - } - OpenAPI_list_add(f_numsList, &f_nums_local->valuedouble); - } + f_numsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(f_nums_local, f_nums) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(f_nums_local)) { + ogs_error("OpenAPI_flows_parseFromJSON() failed [f_nums]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_flows_parseFromJSON() failed [f_nums]"); + goto end; + } + *localDouble = f_nums_local->valuedouble; + OpenAPI_list_add(f_numsList, localDouble); + } } - cJSON *med_comp_n = cJSON_GetObjectItemCaseSensitive(flowsJSON, "medCompN"); + med_comp_n = cJSON_GetObjectItemCaseSensitive(flowsJSON, "medCompN"); if (!med_comp_n) { ogs_error("OpenAPI_flows_parseFromJSON() failed [med_comp_n]"); goto end; } - if (!cJSON_IsNumber(med_comp_n)) { ogs_error("OpenAPI_flows_parseFromJSON() failed [med_comp_n]"); goto end; @@ -151,6 +174,20 @@ OpenAPI_flows_t *OpenAPI_flows_parseFromJSON(cJSON *flowsJSON) return flows_local_var; end: + if (cont_versList) { + OpenAPI_list_for_each(cont_versList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cont_versList); + cont_versList = NULL; + } + if (f_numsList) { + OpenAPI_list_for_each(f_numsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(f_numsList); + f_numsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/frame_route_info.c b/lib/sbi/openapi/model/frame_route_info.c index 95e87af28..7ed21924a 100644 --- a/lib/sbi/openapi/model/frame_route_info.c +++ b/lib/sbi/openapi/model/frame_route_info.c @@ -20,18 +20,26 @@ OpenAPI_frame_route_info_t *OpenAPI_frame_route_info_create( void OpenAPI_frame_route_info_free(OpenAPI_frame_route_info_t *frame_route_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == frame_route_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(frame_route_info->ipv4_mask); - ogs_free(frame_route_info->ipv6_prefix); + if (frame_route_info->ipv4_mask) { + ogs_free(frame_route_info->ipv4_mask); + frame_route_info->ipv4_mask = NULL; + } + if (frame_route_info->ipv6_prefix) { + ogs_free(frame_route_info->ipv6_prefix); + frame_route_info->ipv6_prefix = NULL; + } ogs_free(frame_route_info); } cJSON *OpenAPI_frame_route_info_convertToJSON(OpenAPI_frame_route_info_t *frame_route_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (frame_route_info == NULL) { ogs_error("OpenAPI_frame_route_info_convertToJSON() failed [FrameRouteInfo]"); @@ -60,27 +68,28 @@ end: OpenAPI_frame_route_info_t *OpenAPI_frame_route_info_parseFromJSON(cJSON *frame_route_infoJSON) { OpenAPI_frame_route_info_t *frame_route_info_local_var = NULL; - cJSON *ipv4_mask = cJSON_GetObjectItemCaseSensitive(frame_route_infoJSON, "ipv4Mask"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_mask = NULL; + cJSON *ipv6_prefix = NULL; + ipv4_mask = cJSON_GetObjectItemCaseSensitive(frame_route_infoJSON, "ipv4Mask"); if (ipv4_mask) { - if (!cJSON_IsString(ipv4_mask)) { + if (!cJSON_IsString(ipv4_mask) && !cJSON_IsNull(ipv4_mask)) { ogs_error("OpenAPI_frame_route_info_parseFromJSON() failed [ipv4_mask]"); goto end; } } - cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(frame_route_infoJSON, "ipv6Prefix"); - + ipv6_prefix = cJSON_GetObjectItemCaseSensitive(frame_route_infoJSON, "ipv6Prefix"); if (ipv6_prefix) { - if (!cJSON_IsString(ipv6_prefix)) { + if (!cJSON_IsString(ipv6_prefix) && !cJSON_IsNull(ipv6_prefix)) { ogs_error("OpenAPI_frame_route_info_parseFromJSON() failed [ipv6_prefix]"); goto end; } } frame_route_info_local_var = OpenAPI_frame_route_info_create ( - ipv4_mask ? ogs_strdup(ipv4_mask->valuestring) : NULL, - ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL + ipv4_mask && !cJSON_IsNull(ipv4_mask) ? ogs_strdup(ipv4_mask->valuestring) : NULL, + ipv6_prefix && !cJSON_IsNull(ipv6_prefix) ? ogs_strdup(ipv6_prefix->valuestring) : NULL ); return frame_route_info_local_var; diff --git a/lib/sbi/openapi/model/frame_route_info_1.c b/lib/sbi/openapi/model/frame_route_info_1.c index 9ec2a814f..8d5f91aaf 100644 --- a/lib/sbi/openapi/model/frame_route_info_1.c +++ b/lib/sbi/openapi/model/frame_route_info_1.c @@ -20,18 +20,26 @@ OpenAPI_frame_route_info_1_t *OpenAPI_frame_route_info_1_create( void OpenAPI_frame_route_info_1_free(OpenAPI_frame_route_info_1_t *frame_route_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == frame_route_info_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(frame_route_info_1->ipv4_mask); - ogs_free(frame_route_info_1->ipv6_prefix); + if (frame_route_info_1->ipv4_mask) { + ogs_free(frame_route_info_1->ipv4_mask); + frame_route_info_1->ipv4_mask = NULL; + } + if (frame_route_info_1->ipv6_prefix) { + ogs_free(frame_route_info_1->ipv6_prefix); + frame_route_info_1->ipv6_prefix = NULL; + } ogs_free(frame_route_info_1); } cJSON *OpenAPI_frame_route_info_1_convertToJSON(OpenAPI_frame_route_info_1_t *frame_route_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (frame_route_info_1 == NULL) { ogs_error("OpenAPI_frame_route_info_1_convertToJSON() failed [FrameRouteInfo_1]"); @@ -60,27 +68,28 @@ end: OpenAPI_frame_route_info_1_t *OpenAPI_frame_route_info_1_parseFromJSON(cJSON *frame_route_info_1JSON) { OpenAPI_frame_route_info_1_t *frame_route_info_1_local_var = NULL; - cJSON *ipv4_mask = cJSON_GetObjectItemCaseSensitive(frame_route_info_1JSON, "ipv4Mask"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_mask = NULL; + cJSON *ipv6_prefix = NULL; + ipv4_mask = cJSON_GetObjectItemCaseSensitive(frame_route_info_1JSON, "ipv4Mask"); if (ipv4_mask) { - if (!cJSON_IsString(ipv4_mask)) { + if (!cJSON_IsString(ipv4_mask) && !cJSON_IsNull(ipv4_mask)) { ogs_error("OpenAPI_frame_route_info_1_parseFromJSON() failed [ipv4_mask]"); goto end; } } - cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(frame_route_info_1JSON, "ipv6Prefix"); - + ipv6_prefix = cJSON_GetObjectItemCaseSensitive(frame_route_info_1JSON, "ipv6Prefix"); if (ipv6_prefix) { - if (!cJSON_IsString(ipv6_prefix)) { + if (!cJSON_IsString(ipv6_prefix) && !cJSON_IsNull(ipv6_prefix)) { ogs_error("OpenAPI_frame_route_info_1_parseFromJSON() failed [ipv6_prefix]"); goto end; } } frame_route_info_1_local_var = OpenAPI_frame_route_info_1_create ( - ipv4_mask ? ogs_strdup(ipv4_mask->valuestring) : NULL, - ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL + ipv4_mask && !cJSON_IsNull(ipv4_mask) ? ogs_strdup(ipv4_mask->valuestring) : NULL, + ipv6_prefix && !cJSON_IsNull(ipv6_prefix) ? ogs_strdup(ipv6_prefix->valuestring) : NULL ); return frame_route_info_1_local_var; diff --git a/lib/sbi/openapi/model/gad_shape.c b/lib/sbi/openapi/model/gad_shape.c index c963d0d3d..1cd110d12 100644 --- a/lib/sbi/openapi/model/gad_shape.c +++ b/lib/sbi/openapi/model/gad_shape.c @@ -18,17 +18,22 @@ OpenAPI_gad_shape_t *OpenAPI_gad_shape_create( void OpenAPI_gad_shape_free(OpenAPI_gad_shape_t *gad_shape) { + OpenAPI_lnode_t *node = NULL; + if (NULL == gad_shape) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(gad_shape->shape); + if (gad_shape->shape) { + OpenAPI_supported_gad_shapes_free(gad_shape->shape); + gad_shape->shape = NULL; + } ogs_free(gad_shape); } cJSON *OpenAPI_gad_shape_convertToJSON(OpenAPI_gad_shape_t *gad_shape) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (gad_shape == NULL) { ogs_error("OpenAPI_gad_shape_convertToJSON() failed [GADShape]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_gad_shape_convertToJSON(OpenAPI_gad_shape_t *gad_shape) } item = cJSON_CreateObject(); + if (!gad_shape->shape) { + ogs_error("OpenAPI_gad_shape_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(gad_shape->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_gad_shape_convertToJSON() failed [shape]"); @@ -54,13 +63,14 @@ end: OpenAPI_gad_shape_t *OpenAPI_gad_shape_parseFromJSON(cJSON *gad_shapeJSON) { OpenAPI_gad_shape_t *gad_shape_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(gad_shapeJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + shape = cJSON_GetObjectItemCaseSensitive(gad_shapeJSON, "shape"); if (!shape) { ogs_error("OpenAPI_gad_shape_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); gad_shape_local_var = OpenAPI_gad_shape_create ( @@ -69,6 +79,10 @@ OpenAPI_gad_shape_t *OpenAPI_gad_shape_parseFromJSON(cJSON *gad_shapeJSON) return gad_shape_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/gbr_qos_flow_information.c b/lib/sbi/openapi/model/gbr_qos_flow_information.c index a6f6c3373..f00c25a1b 100644 --- a/lib/sbi/openapi/model/gbr_qos_flow_information.c +++ b/lib/sbi/openapi/model/gbr_qos_flow_information.c @@ -36,24 +36,41 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_create( void OpenAPI_gbr_qos_flow_information_free(OpenAPI_gbr_qos_flow_information_t *gbr_qos_flow_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == gbr_qos_flow_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(gbr_qos_flow_information->max_fbr_dl); - ogs_free(gbr_qos_flow_information->max_fbr_ul); - ogs_free(gbr_qos_flow_information->gua_fbr_dl); - ogs_free(gbr_qos_flow_information->gua_fbr_ul); - OpenAPI_list_for_each(gbr_qos_flow_information->alternative_qos_profile_list, node) { - OpenAPI_alternative_qos_profile_free(node->data); + if (gbr_qos_flow_information->max_fbr_dl) { + ogs_free(gbr_qos_flow_information->max_fbr_dl); + gbr_qos_flow_information->max_fbr_dl = NULL; + } + if (gbr_qos_flow_information->max_fbr_ul) { + ogs_free(gbr_qos_flow_information->max_fbr_ul); + gbr_qos_flow_information->max_fbr_ul = NULL; + } + if (gbr_qos_flow_information->gua_fbr_dl) { + ogs_free(gbr_qos_flow_information->gua_fbr_dl); + gbr_qos_flow_information->gua_fbr_dl = NULL; + } + if (gbr_qos_flow_information->gua_fbr_ul) { + ogs_free(gbr_qos_flow_information->gua_fbr_ul); + gbr_qos_flow_information->gua_fbr_ul = NULL; + } + if (gbr_qos_flow_information->alternative_qos_profile_list) { + OpenAPI_list_for_each(gbr_qos_flow_information->alternative_qos_profile_list, node) { + OpenAPI_alternative_qos_profile_free(node->data); + } + OpenAPI_list_free(gbr_qos_flow_information->alternative_qos_profile_list); + gbr_qos_flow_information->alternative_qos_profile_list = NULL; } - OpenAPI_list_free(gbr_qos_flow_information->alternative_qos_profile_list); ogs_free(gbr_qos_flow_information); } cJSON *OpenAPI_gbr_qos_flow_information_convertToJSON(OpenAPI_gbr_qos_flow_information_t *gbr_qos_flow_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (gbr_qos_flow_information == NULL) { ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [GbrQosFlowInformation]"); @@ -61,27 +78,43 @@ cJSON *OpenAPI_gbr_qos_flow_information_convertToJSON(OpenAPI_gbr_qos_flow_infor } item = cJSON_CreateObject(); + if (!gbr_qos_flow_information->max_fbr_dl) { + ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [max_fbr_dl]"); + return NULL; + } if (cJSON_AddStringToObject(item, "maxFbrDl", gbr_qos_flow_information->max_fbr_dl) == NULL) { ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [max_fbr_dl]"); goto end; } + if (!gbr_qos_flow_information->max_fbr_ul) { + ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [max_fbr_ul]"); + return NULL; + } if (cJSON_AddStringToObject(item, "maxFbrUl", gbr_qos_flow_information->max_fbr_ul) == NULL) { ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [max_fbr_ul]"); goto end; } + if (!gbr_qos_flow_information->gua_fbr_dl) { + ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [gua_fbr_dl]"); + return NULL; + } if (cJSON_AddStringToObject(item, "guaFbrDl", gbr_qos_flow_information->gua_fbr_dl) == NULL) { ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [gua_fbr_dl]"); goto end; } + if (!gbr_qos_flow_information->gua_fbr_ul) { + ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [gua_fbr_ul]"); + return NULL; + } if (cJSON_AddStringToObject(item, "guaFbrUl", gbr_qos_flow_information->gua_fbr_ul) == NULL) { ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [gua_fbr_ul]"); goto end; } - if (gbr_qos_flow_information->notif_control) { + if (gbr_qos_flow_information->notif_control != OpenAPI_notification_control_NULL) { if (cJSON_AddStringToObject(item, "notifControl", OpenAPI_notification_control_ToString(gbr_qos_flow_information->notif_control)) == NULL) { ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [notif_control]"); goto end; @@ -108,17 +141,13 @@ cJSON *OpenAPI_gbr_qos_flow_information_convertToJSON(OpenAPI_gbr_qos_flow_infor ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [alternative_qos_profile_list]"); goto end; } - - OpenAPI_lnode_t *alternative_qos_profile_list_node; - if (gbr_qos_flow_information->alternative_qos_profile_list) { - OpenAPI_list_for_each(gbr_qos_flow_information->alternative_qos_profile_list, alternative_qos_profile_list_node) { - cJSON *itemLocal = OpenAPI_alternative_qos_profile_convertToJSON(alternative_qos_profile_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [alternative_qos_profile_list]"); - goto end; - } - cJSON_AddItemToArray(alternative_qos_profile_listList, itemLocal); + OpenAPI_list_for_each(gbr_qos_flow_information->alternative_qos_profile_list, node) { + cJSON *itemLocal = OpenAPI_alternative_qos_profile_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [alternative_qos_profile_list]"); + goto end; } + cJSON_AddItemToArray(alternative_qos_profile_listList, itemLocal); } } @@ -129,53 +158,58 @@ end: OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_parseFromJSON(cJSON *gbr_qos_flow_informationJSON) { OpenAPI_gbr_qos_flow_information_t *gbr_qos_flow_information_local_var = NULL; - cJSON *max_fbr_dl = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxFbrDl"); + OpenAPI_lnode_t *node = NULL; + cJSON *max_fbr_dl = NULL; + cJSON *max_fbr_ul = NULL; + cJSON *gua_fbr_dl = NULL; + cJSON *gua_fbr_ul = NULL; + cJSON *notif_control = NULL; + OpenAPI_notification_control_e notif_controlVariable = 0; + cJSON *max_packet_loss_rate_dl = NULL; + cJSON *max_packet_loss_rate_ul = NULL; + cJSON *alternative_qos_profile_list = NULL; + OpenAPI_list_t *alternative_qos_profile_listList = NULL; + max_fbr_dl = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxFbrDl"); if (!max_fbr_dl) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [max_fbr_dl]"); goto end; } - if (!cJSON_IsString(max_fbr_dl)) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [max_fbr_dl]"); goto end; } - cJSON *max_fbr_ul = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxFbrUl"); + max_fbr_ul = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxFbrUl"); if (!max_fbr_ul) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [max_fbr_ul]"); goto end; } - if (!cJSON_IsString(max_fbr_ul)) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [max_fbr_ul]"); goto end; } - cJSON *gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "guaFbrDl"); + gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "guaFbrDl"); if (!gua_fbr_dl) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [gua_fbr_dl]"); goto end; } - if (!cJSON_IsString(gua_fbr_dl)) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [gua_fbr_dl]"); goto end; } - cJSON *gua_fbr_ul = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "guaFbrUl"); + gua_fbr_ul = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "guaFbrUl"); if (!gua_fbr_ul) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [gua_fbr_ul]"); goto end; } - if (!cJSON_IsString(gua_fbr_ul)) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [gua_fbr_ul]"); goto end; } - cJSON *notif_control = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "notifControl"); - - OpenAPI_notification_control_e notif_controlVariable; + notif_control = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "notifControl"); if (notif_control) { if (!cJSON_IsString(notif_control)) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [notif_control]"); @@ -184,8 +218,7 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_parseFromJS notif_controlVariable = OpenAPI_notification_control_FromString(notif_control->valuestring); } - cJSON *max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxPacketLossRateDl"); - + max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxPacketLossRateDl"); if (max_packet_loss_rate_dl) { if (!cJSON_IsNumber(max_packet_loss_rate_dl)) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [max_packet_loss_rate_dl]"); @@ -193,8 +226,7 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_parseFromJS } } - cJSON *max_packet_loss_rate_ul = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxPacketLossRateUl"); - + max_packet_loss_rate_ul = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxPacketLossRateUl"); if (max_packet_loss_rate_ul) { if (!cJSON_IsNumber(max_packet_loss_rate_ul)) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [max_packet_loss_rate_ul]"); @@ -202,33 +234,29 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_parseFromJS } } - cJSON *alternative_qos_profile_list = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "alternativeQosProfileList"); - - OpenAPI_list_t *alternative_qos_profile_listList; + alternative_qos_profile_list = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "alternativeQosProfileList"); if (alternative_qos_profile_list) { - cJSON *alternative_qos_profile_list_local_nonprimitive; - if (!cJSON_IsArray(alternative_qos_profile_list)){ - ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [alternative_qos_profile_list]"); - goto end; - } - - alternative_qos_profile_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(alternative_qos_profile_list_local_nonprimitive, alternative_qos_profile_list ) { - if (!cJSON_IsObject(alternative_qos_profile_list_local_nonprimitive)) { + cJSON *alternative_qos_profile_list_local = NULL; + if (!cJSON_IsArray(alternative_qos_profile_list)) { ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [alternative_qos_profile_list]"); goto end; } - OpenAPI_alternative_qos_profile_t *alternative_qos_profile_listItem = OpenAPI_alternative_qos_profile_parseFromJSON(alternative_qos_profile_list_local_nonprimitive); - if (!alternative_qos_profile_listItem) { - ogs_error("No alternative_qos_profile_listItem"); - OpenAPI_list_free(alternative_qos_profile_listList); - goto end; + alternative_qos_profile_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alternative_qos_profile_list_local, alternative_qos_profile_list) { + if (!cJSON_IsObject(alternative_qos_profile_list_local)) { + ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [alternative_qos_profile_list]"); + goto end; + } + OpenAPI_alternative_qos_profile_t *alternative_qos_profile_listItem = OpenAPI_alternative_qos_profile_parseFromJSON(alternative_qos_profile_list_local); + if (!alternative_qos_profile_listItem) { + ogs_error("No alternative_qos_profile_listItem"); + OpenAPI_list_free(alternative_qos_profile_listList); + goto end; + } + OpenAPI_list_add(alternative_qos_profile_listList, alternative_qos_profile_listItem); } - - OpenAPI_list_add(alternative_qos_profile_listList, alternative_qos_profile_listItem); - } } gbr_qos_flow_information_local_var = OpenAPI_gbr_qos_flow_information_create ( @@ -246,6 +274,13 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_parseFromJS return gbr_qos_flow_information_local_var; end: + if (alternative_qos_profile_listList) { + OpenAPI_list_for_each(alternative_qos_profile_listList, node) { + OpenAPI_alternative_qos_profile_free(node->data); + } + OpenAPI_list_free(alternative_qos_profile_listList); + alternative_qos_profile_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/geographic_area.c b/lib/sbi/openapi/model/geographic_area.c index eebdd4023..d88b7962f 100644 --- a/lib/sbi/openapi/model/geographic_area.c +++ b/lib/sbi/openapi/model/geographic_area.c @@ -40,23 +40,37 @@ OpenAPI_geographic_area_t *OpenAPI_geographic_area_create( void OpenAPI_geographic_area_free(OpenAPI_geographic_area_t *geographic_area) { + OpenAPI_lnode_t *node = NULL; + if (NULL == geographic_area) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(geographic_area->shape); - OpenAPI_geographical_coordinates_free(geographic_area->point); - OpenAPI_uncertainty_ellipse_free(geographic_area->uncertainty_ellipse); - OpenAPI_list_for_each(geographic_area->point_list, node) { - OpenAPI_geographical_coordinates_free(node->data); + if (geographic_area->shape) { + OpenAPI_supported_gad_shapes_free(geographic_area->shape); + geographic_area->shape = NULL; + } + if (geographic_area->point) { + OpenAPI_geographical_coordinates_free(geographic_area->point); + geographic_area->point = NULL; + } + if (geographic_area->uncertainty_ellipse) { + OpenAPI_uncertainty_ellipse_free(geographic_area->uncertainty_ellipse); + geographic_area->uncertainty_ellipse = NULL; + } + if (geographic_area->point_list) { + OpenAPI_list_for_each(geographic_area->point_list, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(geographic_area->point_list); + geographic_area->point_list = NULL; } - OpenAPI_list_free(geographic_area->point_list); ogs_free(geographic_area); } cJSON *OpenAPI_geographic_area_convertToJSON(OpenAPI_geographic_area_t *geographic_area) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (geographic_area == NULL) { ogs_error("OpenAPI_geographic_area_convertToJSON() failed [GeographicArea]"); @@ -64,6 +78,10 @@ cJSON *OpenAPI_geographic_area_convertToJSON(OpenAPI_geographic_area_t *geograph } item = cJSON_CreateObject(); + if (!geographic_area->shape) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(geographic_area->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_geographic_area_convertToJSON() failed [shape]"); @@ -75,6 +93,10 @@ cJSON *OpenAPI_geographic_area_convertToJSON(OpenAPI_geographic_area_t *geograph goto end; } + if (!geographic_area->point) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(geographic_area->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point]"); @@ -91,6 +113,10 @@ cJSON *OpenAPI_geographic_area_convertToJSON(OpenAPI_geographic_area_t *geograph goto end; } + if (!geographic_area->uncertainty_ellipse) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_ellipse]"); + return NULL; + } cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(geographic_area->uncertainty_ellipse); if (uncertainty_ellipse_local_JSON == NULL) { ogs_error("OpenAPI_geographic_area_convertToJSON() failed [uncertainty_ellipse]"); @@ -107,22 +133,22 @@ cJSON *OpenAPI_geographic_area_convertToJSON(OpenAPI_geographic_area_t *geograph goto end; } + if (!geographic_area->point_list) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point_list]"); + return NULL; + } cJSON *point_listList = cJSON_AddArrayToObject(item, "pointList"); if (point_listList == NULL) { ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point_list]"); goto end; } - - OpenAPI_lnode_t *point_list_node; - if (geographic_area->point_list) { - OpenAPI_list_for_each(geographic_area->point_list, point_list_node) { - cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(point_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point_list]"); - goto end; - } - cJSON_AddItemToArray(point_listList, itemLocal); + OpenAPI_list_for_each(geographic_area->point_list, node) { + cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_geographic_area_convertToJSON() failed [point_list]"); + goto end; } + cJSON_AddItemToArray(point_listList, itemLocal); } if (cJSON_AddNumberToObject(item, "altitude", geographic_area->altitude) == NULL) { @@ -162,147 +188,146 @@ end: OpenAPI_geographic_area_t *OpenAPI_geographic_area_parseFromJSON(cJSON *geographic_areaJSON) { OpenAPI_geographic_area_t *geographic_area_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *uncertainty = NULL; + cJSON *uncertainty_ellipse = NULL; + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + cJSON *confidence = NULL; + cJSON *point_list = NULL; + OpenAPI_list_t *point_listList = NULL; + cJSON *altitude = NULL; + cJSON *uncertainty_altitude = NULL; + cJSON *inner_radius = NULL; + cJSON *uncertainty_radius = NULL; + cJSON *offset_angle = NULL; + cJSON *included_angle = NULL; + shape = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "shape"); if (!shape) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); - cJSON *point = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "point"); + point = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "point"); if (!point) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *uncertainty = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertainty"); + uncertainty = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertainty"); if (!uncertainty) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty]"); goto end; } - if (!cJSON_IsNumber(uncertainty)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty]"); goto end; } - cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyEllipse"); + uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyEllipse"); if (!uncertainty_ellipse) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_ellipse]"); goto end; } - - OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); - cJSON *confidence = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "confidence"); + confidence = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "confidence"); if (!confidence) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [confidence]"); goto end; } - if (!cJSON_IsNumber(confidence)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [confidence]"); goto end; } - cJSON *point_list = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "pointList"); + point_list = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "pointList"); if (!point_list) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point_list]"); goto end; } - - OpenAPI_list_t *point_listList; - cJSON *point_list_local_nonprimitive; - if (!cJSON_IsArray(point_list)){ - ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point_list]"); - goto end; - } - - point_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(point_list_local_nonprimitive, point_list ) { - if (!cJSON_IsObject(point_list_local_nonprimitive)) { + cJSON *point_list_local = NULL; + if (!cJSON_IsArray(point_list)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point_list]"); goto end; } - OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local_nonprimitive); - if (!point_listItem) { - ogs_error("No point_listItem"); - OpenAPI_list_free(point_listList); - goto end; + point_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(point_list_local, point_list) { + if (!cJSON_IsObject(point_list_local)) { + ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [point_list]"); + goto end; + } + OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local); + if (!point_listItem) { + ogs_error("No point_listItem"); + OpenAPI_list_free(point_listList); + goto end; + } + OpenAPI_list_add(point_listList, point_listItem); } - OpenAPI_list_add(point_listList, point_listItem); - } - - cJSON *altitude = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "altitude"); + altitude = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "altitude"); if (!altitude) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [altitude]"); goto end; } - if (!cJSON_IsNumber(altitude)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [altitude]"); goto end; } - cJSON *uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyAltitude"); + uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyAltitude"); if (!uncertainty_altitude) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_altitude]"); goto end; } - if (!cJSON_IsNumber(uncertainty_altitude)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_altitude]"); goto end; } - cJSON *inner_radius = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "innerRadius"); + inner_radius = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "innerRadius"); if (!inner_radius) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [inner_radius]"); goto end; } - if (!cJSON_IsNumber(inner_radius)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [inner_radius]"); goto end; } - cJSON *uncertainty_radius = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyRadius"); + uncertainty_radius = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "uncertaintyRadius"); if (!uncertainty_radius) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_radius]"); goto end; } - if (!cJSON_IsNumber(uncertainty_radius)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [uncertainty_radius]"); goto end; } - cJSON *offset_angle = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "offsetAngle"); + offset_angle = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "offsetAngle"); if (!offset_angle) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [offset_angle]"); goto end; } - if (!cJSON_IsNumber(offset_angle)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [offset_angle]"); goto end; } - cJSON *included_angle = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "includedAngle"); + included_angle = cJSON_GetObjectItemCaseSensitive(geographic_areaJSON, "includedAngle"); if (!included_angle) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [included_angle]"); goto end; } - if (!cJSON_IsNumber(included_angle)) { ogs_error("OpenAPI_geographic_area_parseFromJSON() failed [included_angle]"); goto end; @@ -333,6 +358,25 @@ OpenAPI_geographic_area_t *OpenAPI_geographic_area_parseFromJSON(cJSON *geograph return geographic_area_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } + if (uncertainty_ellipse_local_nonprim) { + OpenAPI_uncertainty_ellipse_free(uncertainty_ellipse_local_nonprim); + uncertainty_ellipse_local_nonprim = NULL; + } + if (point_listList) { + OpenAPI_list_for_each(point_listList, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(point_listList); + point_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/geographical_coordinates.c b/lib/sbi/openapi/model/geographical_coordinates.c index e8b948734..fdf82c655 100644 --- a/lib/sbi/openapi/model/geographical_coordinates.c +++ b/lib/sbi/openapi/model/geographical_coordinates.c @@ -20,16 +20,18 @@ OpenAPI_geographical_coordinates_t *OpenAPI_geographical_coordinates_create( void OpenAPI_geographical_coordinates_free(OpenAPI_geographical_coordinates_t *geographical_coordinates) { + OpenAPI_lnode_t *node = NULL; + if (NULL == geographical_coordinates) { return; } - OpenAPI_lnode_t *node; ogs_free(geographical_coordinates); } cJSON *OpenAPI_geographical_coordinates_convertToJSON(OpenAPI_geographical_coordinates_t *geographical_coordinates) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (geographical_coordinates == NULL) { ogs_error("OpenAPI_geographical_coordinates_convertToJSON() failed [GeographicalCoordinates]"); @@ -54,23 +56,24 @@ end: OpenAPI_geographical_coordinates_t *OpenAPI_geographical_coordinates_parseFromJSON(cJSON *geographical_coordinatesJSON) { OpenAPI_geographical_coordinates_t *geographical_coordinates_local_var = NULL; - cJSON *lon = cJSON_GetObjectItemCaseSensitive(geographical_coordinatesJSON, "lon"); + OpenAPI_lnode_t *node = NULL; + cJSON *lon = NULL; + cJSON *lat = NULL; + lon = cJSON_GetObjectItemCaseSensitive(geographical_coordinatesJSON, "lon"); if (!lon) { ogs_error("OpenAPI_geographical_coordinates_parseFromJSON() failed [lon]"); goto end; } - if (!cJSON_IsNumber(lon)) { ogs_error("OpenAPI_geographical_coordinates_parseFromJSON() failed [lon]"); goto end; } - cJSON *lat = cJSON_GetObjectItemCaseSensitive(geographical_coordinatesJSON, "lat"); + lat = cJSON_GetObjectItemCaseSensitive(geographical_coordinatesJSON, "lat"); if (!lat) { ogs_error("OpenAPI_geographical_coordinates_parseFromJSON() failed [lat]"); goto end; } - if (!cJSON_IsNumber(lat)) { ogs_error("OpenAPI_geographical_coordinates_parseFromJSON() failed [lat]"); goto end; diff --git a/lib/sbi/openapi/model/get_nf_instances_200_response.c b/lib/sbi/openapi/model/get_nf_instances_200_response.c new file mode 100644 index 000000000..0ea8a2b2b --- /dev/null +++ b/lib/sbi/openapi/model/get_nf_instances_200_response.c @@ -0,0 +1,160 @@ + +#include +#include +#include +#include "get_nf_instances_200_response.h" + +OpenAPI_get_nf_instances_200_response_t *OpenAPI_get_nf_instances_200_response_create( + OpenAPI_list_t* _links +) +{ + OpenAPI_get_nf_instances_200_response_t *get_nf_instances_200_response_local_var = ogs_malloc(sizeof(OpenAPI_get_nf_instances_200_response_t)); + ogs_assert(get_nf_instances_200_response_local_var); + + get_nf_instances_200_response_local_var->_links = _links; + + return get_nf_instances_200_response_local_var; +} + +void OpenAPI_get_nf_instances_200_response_free(OpenAPI_get_nf_instances_200_response_t *get_nf_instances_200_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == get_nf_instances_200_response) { + return; + } + if (get_nf_instances_200_response->_links) { + OpenAPI_list_for_each(get_nf_instances_200_response->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_links_value_schema_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(get_nf_instances_200_response->_links); + get_nf_instances_200_response->_links = NULL; + } + ogs_free(get_nf_instances_200_response); +} + +cJSON *OpenAPI_get_nf_instances_200_response_convertToJSON(OpenAPI_get_nf_instances_200_response_t *get_nf_instances_200_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (get_nf_instances_200_response == NULL) { + ogs_error("OpenAPI_get_nf_instances_200_response_convertToJSON() failed [GetNFInstances_200_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (get_nf_instances_200_response->_links) { + cJSON *_links = cJSON_AddObjectToObject(item, "_links"); + if (_links == NULL) { + ogs_error("OpenAPI_get_nf_instances_200_response_convertToJSON() failed [_links]"); + goto end; + } + cJSON *localMapObject = _links; + if (get_nf_instances_200_response->_links) { + OpenAPI_list_for_each(get_nf_instances_200_response->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_links_value_schema_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_get_nf_instances_200_response_convertToJSON() failed [inner]"); + goto end; + } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + } + } + } + +end: + return item; +} + +OpenAPI_get_nf_instances_200_response_t *OpenAPI_get_nf_instances_200_response_parseFromJSON(cJSON *get_nf_instances_200_responseJSON) +{ + OpenAPI_get_nf_instances_200_response_t *get_nf_instances_200_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *_links = NULL; + OpenAPI_list_t *_linksList = NULL; + _links = cJSON_GetObjectItemCaseSensitive(get_nf_instances_200_responseJSON, "_links"); + if (_links) { + cJSON *_links_local_map = NULL; + if (!cJSON_IsObject(_links) && !cJSON_IsNull(_links)) { + ogs_error("OpenAPI_get_nf_instances_200_response_parseFromJSON() failed [_links]"); + goto end; + } + if (cJSON_IsObject(_links)) { + _linksList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(_links_local_map, _links) { + cJSON *localMapObject = _links_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_links_value_schema_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_get_nf_instances_200_response_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(_linksList, localMapKeyPair); + } + } + } + + get_nf_instances_200_response_local_var = OpenAPI_get_nf_instances_200_response_create ( + _links ? _linksList : NULL + ); + + return get_nf_instances_200_response_local_var; +end: + if (_linksList) { + OpenAPI_list_for_each(_linksList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_links_value_schema_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(_linksList); + _linksList = NULL; + } + return NULL; +} + +OpenAPI_get_nf_instances_200_response_t *OpenAPI_get_nf_instances_200_response_copy(OpenAPI_get_nf_instances_200_response_t *dst, OpenAPI_get_nf_instances_200_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_get_nf_instances_200_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_get_nf_instances_200_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_get_nf_instances_200_response_free(dst); + dst = OpenAPI_get_nf_instances_200_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/get_nf_instances_200_response.h b/lib/sbi/openapi/model/get_nf_instances_200_response.h new file mode 100644 index 000000000..d488bd5e3 --- /dev/null +++ b/lib/sbi/openapi/model/get_nf_instances_200_response.h @@ -0,0 +1,39 @@ +/* + * get_nf_instances_200_response.h + * + * + */ + +#ifndef _OpenAPI_get_nf_instances_200_response_H_ +#define _OpenAPI_get_nf_instances_200_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "links_value_schema.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_get_nf_instances_200_response_s OpenAPI_get_nf_instances_200_response_t; +typedef struct OpenAPI_get_nf_instances_200_response_s { + OpenAPI_list_t* _links; +} OpenAPI_get_nf_instances_200_response_t; + +OpenAPI_get_nf_instances_200_response_t *OpenAPI_get_nf_instances_200_response_create( + OpenAPI_list_t* _links +); +void OpenAPI_get_nf_instances_200_response_free(OpenAPI_get_nf_instances_200_response_t *get_nf_instances_200_response); +OpenAPI_get_nf_instances_200_response_t *OpenAPI_get_nf_instances_200_response_parseFromJSON(cJSON *get_nf_instances_200_responseJSON); +cJSON *OpenAPI_get_nf_instances_200_response_convertToJSON(OpenAPI_get_nf_instances_200_response_t *get_nf_instances_200_response); +OpenAPI_get_nf_instances_200_response_t *OpenAPI_get_nf_instances_200_response_copy(OpenAPI_get_nf_instances_200_response_t *dst, OpenAPI_get_nf_instances_200_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_get_nf_instances_200_response_H_ */ + diff --git a/lib/sbi/openapi/model/global_ran_node_id.c b/lib/sbi/openapi/model/global_ran_node_id.c index c53e1d4f7..7d6a15f31 100644 --- a/lib/sbi/openapi/model/global_ran_node_id.c +++ b/lib/sbi/openapi/model/global_ran_node_id.c @@ -32,24 +32,50 @@ OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_create( void OpenAPI_global_ran_node_id_free(OpenAPI_global_ran_node_id_t *global_ran_node_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == global_ran_node_id) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(global_ran_node_id->plmn_id); - ogs_free(global_ran_node_id->n3_iwf_id); - OpenAPI_gnb_id_free(global_ran_node_id->g_nb_id); - ogs_free(global_ran_node_id->nge_nb_id); - ogs_free(global_ran_node_id->wagf_id); - ogs_free(global_ran_node_id->tngf_id); - ogs_free(global_ran_node_id->nid); - ogs_free(global_ran_node_id->e_nb_id); + if (global_ran_node_id->plmn_id) { + OpenAPI_plmn_id_free(global_ran_node_id->plmn_id); + global_ran_node_id->plmn_id = NULL; + } + if (global_ran_node_id->n3_iwf_id) { + ogs_free(global_ran_node_id->n3_iwf_id); + global_ran_node_id->n3_iwf_id = NULL; + } + if (global_ran_node_id->g_nb_id) { + OpenAPI_gnb_id_free(global_ran_node_id->g_nb_id); + global_ran_node_id->g_nb_id = NULL; + } + if (global_ran_node_id->nge_nb_id) { + ogs_free(global_ran_node_id->nge_nb_id); + global_ran_node_id->nge_nb_id = NULL; + } + if (global_ran_node_id->wagf_id) { + ogs_free(global_ran_node_id->wagf_id); + global_ran_node_id->wagf_id = NULL; + } + if (global_ran_node_id->tngf_id) { + ogs_free(global_ran_node_id->tngf_id); + global_ran_node_id->tngf_id = NULL; + } + if (global_ran_node_id->nid) { + ogs_free(global_ran_node_id->nid); + global_ran_node_id->nid = NULL; + } + if (global_ran_node_id->e_nb_id) { + ogs_free(global_ran_node_id->e_nb_id); + global_ran_node_id->e_nb_id = NULL; + } ogs_free(global_ran_node_id); } cJSON *OpenAPI_global_ran_node_id_convertToJSON(OpenAPI_global_ran_node_id_t *global_ran_node_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (global_ran_node_id == NULL) { ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [GlobalRanNodeId]"); @@ -57,6 +83,10 @@ cJSON *OpenAPI_global_ran_node_id_convertToJSON(OpenAPI_global_ran_node_id_t *gl } item = cJSON_CreateObject(); + if (!global_ran_node_id->plmn_id) { + ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(global_ran_node_id->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [plmn_id]"); @@ -130,71 +160,72 @@ end: OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_parseFromJSON(cJSON *global_ran_node_idJSON) { OpenAPI_global_ran_node_id_t *global_ran_node_id_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *n3_iwf_id = NULL; + cJSON *g_nb_id = NULL; + OpenAPI_gnb_id_t *g_nb_id_local_nonprim = NULL; + cJSON *nge_nb_id = NULL; + cJSON *wagf_id = NULL; + cJSON *tngf_id = NULL; + cJSON *nid = NULL; + cJSON *e_nb_id = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *n3_iwf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "n3IwfId"); - + n3_iwf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "n3IwfId"); if (n3_iwf_id) { - if (!cJSON_IsString(n3_iwf_id)) { + if (!cJSON_IsString(n3_iwf_id) && !cJSON_IsNull(n3_iwf_id)) { ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [n3_iwf_id]"); goto end; } } - cJSON *g_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "gNbId"); - - OpenAPI_gnb_id_t *g_nb_id_local_nonprim = NULL; + g_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "gNbId"); if (g_nb_id) { g_nb_id_local_nonprim = OpenAPI_gnb_id_parseFromJSON(g_nb_id); } - cJSON *nge_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "ngeNbId"); - + nge_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "ngeNbId"); if (nge_nb_id) { - if (!cJSON_IsString(nge_nb_id)) { + if (!cJSON_IsString(nge_nb_id) && !cJSON_IsNull(nge_nb_id)) { ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [nge_nb_id]"); goto end; } } - cJSON *wagf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "wagfId"); - + wagf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "wagfId"); if (wagf_id) { - if (!cJSON_IsString(wagf_id)) { + if (!cJSON_IsString(wagf_id) && !cJSON_IsNull(wagf_id)) { ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [wagf_id]"); goto end; } } - cJSON *tngf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "tngfId"); - + tngf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "tngfId"); if (tngf_id) { - if (!cJSON_IsString(tngf_id)) { + if (!cJSON_IsString(tngf_id) && !cJSON_IsNull(tngf_id)) { ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [tngf_id]"); goto end; } } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [nid]"); goto end; } } - cJSON *e_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "eNbId"); - + e_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "eNbId"); if (e_nb_id) { - if (!cJSON_IsString(e_nb_id)) { + if (!cJSON_IsString(e_nb_id) && !cJSON_IsNull(e_nb_id)) { ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [e_nb_id]"); goto end; } @@ -202,17 +233,25 @@ OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_parseFromJSON(cJSON *gl global_ran_node_id_local_var = OpenAPI_global_ran_node_id_create ( plmn_id_local_nonprim, - n3_iwf_id ? ogs_strdup(n3_iwf_id->valuestring) : NULL, + n3_iwf_id && !cJSON_IsNull(n3_iwf_id) ? ogs_strdup(n3_iwf_id->valuestring) : NULL, g_nb_id ? g_nb_id_local_nonprim : NULL, - nge_nb_id ? ogs_strdup(nge_nb_id->valuestring) : NULL, - wagf_id ? ogs_strdup(wagf_id->valuestring) : NULL, - tngf_id ? ogs_strdup(tngf_id->valuestring) : NULL, - nid ? ogs_strdup(nid->valuestring) : NULL, - e_nb_id ? ogs_strdup(e_nb_id->valuestring) : NULL + nge_nb_id && !cJSON_IsNull(nge_nb_id) ? ogs_strdup(nge_nb_id->valuestring) : NULL, + wagf_id && !cJSON_IsNull(wagf_id) ? ogs_strdup(wagf_id->valuestring) : NULL, + tngf_id && !cJSON_IsNull(tngf_id) ? ogs_strdup(tngf_id->valuestring) : NULL, + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL, + e_nb_id && !cJSON_IsNull(e_nb_id) ? ogs_strdup(e_nb_id->valuestring) : NULL ); return global_ran_node_id_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (g_nb_id_local_nonprim) { + OpenAPI_gnb_id_free(g_nb_id_local_nonprim); + g_nb_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/global_ran_node_id_1.c b/lib/sbi/openapi/model/global_ran_node_id_1.c index 7f62a5047..8bb88d380 100644 --- a/lib/sbi/openapi/model/global_ran_node_id_1.c +++ b/lib/sbi/openapi/model/global_ran_node_id_1.c @@ -32,24 +32,50 @@ OpenAPI_global_ran_node_id_1_t *OpenAPI_global_ran_node_id_1_create( void OpenAPI_global_ran_node_id_1_free(OpenAPI_global_ran_node_id_1_t *global_ran_node_id_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == global_ran_node_id_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_1_free(global_ran_node_id_1->plmn_id); - ogs_free(global_ran_node_id_1->n3_iwf_id); - OpenAPI_gnb_id_free(global_ran_node_id_1->g_nb_id); - ogs_free(global_ran_node_id_1->nge_nb_id); - ogs_free(global_ran_node_id_1->wagf_id); - ogs_free(global_ran_node_id_1->tngf_id); - ogs_free(global_ran_node_id_1->nid); - ogs_free(global_ran_node_id_1->e_nb_id); + if (global_ran_node_id_1->plmn_id) { + OpenAPI_plmn_id_1_free(global_ran_node_id_1->plmn_id); + global_ran_node_id_1->plmn_id = NULL; + } + if (global_ran_node_id_1->n3_iwf_id) { + ogs_free(global_ran_node_id_1->n3_iwf_id); + global_ran_node_id_1->n3_iwf_id = NULL; + } + if (global_ran_node_id_1->g_nb_id) { + OpenAPI_gnb_id_free(global_ran_node_id_1->g_nb_id); + global_ran_node_id_1->g_nb_id = NULL; + } + if (global_ran_node_id_1->nge_nb_id) { + ogs_free(global_ran_node_id_1->nge_nb_id); + global_ran_node_id_1->nge_nb_id = NULL; + } + if (global_ran_node_id_1->wagf_id) { + ogs_free(global_ran_node_id_1->wagf_id); + global_ran_node_id_1->wagf_id = NULL; + } + if (global_ran_node_id_1->tngf_id) { + ogs_free(global_ran_node_id_1->tngf_id); + global_ran_node_id_1->tngf_id = NULL; + } + if (global_ran_node_id_1->nid) { + ogs_free(global_ran_node_id_1->nid); + global_ran_node_id_1->nid = NULL; + } + if (global_ran_node_id_1->e_nb_id) { + ogs_free(global_ran_node_id_1->e_nb_id); + global_ran_node_id_1->e_nb_id = NULL; + } ogs_free(global_ran_node_id_1); } cJSON *OpenAPI_global_ran_node_id_1_convertToJSON(OpenAPI_global_ran_node_id_1_t *global_ran_node_id_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (global_ran_node_id_1 == NULL) { ogs_error("OpenAPI_global_ran_node_id_1_convertToJSON() failed [GlobalRanNodeId_1]"); @@ -57,6 +83,10 @@ cJSON *OpenAPI_global_ran_node_id_1_convertToJSON(OpenAPI_global_ran_node_id_1_t } item = cJSON_CreateObject(); + if (!global_ran_node_id_1->plmn_id) { + ogs_error("OpenAPI_global_ran_node_id_1_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_1_convertToJSON(global_ran_node_id_1->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_global_ran_node_id_1_convertToJSON() failed [plmn_id]"); @@ -130,71 +160,72 @@ end: OpenAPI_global_ran_node_id_1_t *OpenAPI_global_ran_node_id_1_parseFromJSON(cJSON *global_ran_node_id_1JSON) { OpenAPI_global_ran_node_id_1_t *global_ran_node_id_1_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + cJSON *n3_iwf_id = NULL; + cJSON *g_nb_id = NULL; + OpenAPI_gnb_id_t *g_nb_id_local_nonprim = NULL; + cJSON *nge_nb_id = NULL; + cJSON *wagf_id = NULL; + cJSON *tngf_id = NULL; + cJSON *nid = NULL; + cJSON *e_nb_id = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_global_ran_node_id_1_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); - cJSON *n3_iwf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "n3IwfId"); - + n3_iwf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "n3IwfId"); if (n3_iwf_id) { - if (!cJSON_IsString(n3_iwf_id)) { + if (!cJSON_IsString(n3_iwf_id) && !cJSON_IsNull(n3_iwf_id)) { ogs_error("OpenAPI_global_ran_node_id_1_parseFromJSON() failed [n3_iwf_id]"); goto end; } } - cJSON *g_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "gNbId"); - - OpenAPI_gnb_id_t *g_nb_id_local_nonprim = NULL; + g_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "gNbId"); if (g_nb_id) { g_nb_id_local_nonprim = OpenAPI_gnb_id_parseFromJSON(g_nb_id); } - cJSON *nge_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "ngeNbId"); - + nge_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "ngeNbId"); if (nge_nb_id) { - if (!cJSON_IsString(nge_nb_id)) { + if (!cJSON_IsString(nge_nb_id) && !cJSON_IsNull(nge_nb_id)) { ogs_error("OpenAPI_global_ran_node_id_1_parseFromJSON() failed [nge_nb_id]"); goto end; } } - cJSON *wagf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "wagfId"); - + wagf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "wagfId"); if (wagf_id) { - if (!cJSON_IsString(wagf_id)) { + if (!cJSON_IsString(wagf_id) && !cJSON_IsNull(wagf_id)) { ogs_error("OpenAPI_global_ran_node_id_1_parseFromJSON() failed [wagf_id]"); goto end; } } - cJSON *tngf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "tngfId"); - + tngf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "tngfId"); if (tngf_id) { - if (!cJSON_IsString(tngf_id)) { + if (!cJSON_IsString(tngf_id) && !cJSON_IsNull(tngf_id)) { ogs_error("OpenAPI_global_ran_node_id_1_parseFromJSON() failed [tngf_id]"); goto end; } } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_global_ran_node_id_1_parseFromJSON() failed [nid]"); goto end; } } - cJSON *e_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "eNbId"); - + e_nb_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_id_1JSON, "eNbId"); if (e_nb_id) { - if (!cJSON_IsString(e_nb_id)) { + if (!cJSON_IsString(e_nb_id) && !cJSON_IsNull(e_nb_id)) { ogs_error("OpenAPI_global_ran_node_id_1_parseFromJSON() failed [e_nb_id]"); goto end; } @@ -202,17 +233,25 @@ OpenAPI_global_ran_node_id_1_t *OpenAPI_global_ran_node_id_1_parseFromJSON(cJSON global_ran_node_id_1_local_var = OpenAPI_global_ran_node_id_1_create ( plmn_id_local_nonprim, - n3_iwf_id ? ogs_strdup(n3_iwf_id->valuestring) : NULL, + n3_iwf_id && !cJSON_IsNull(n3_iwf_id) ? ogs_strdup(n3_iwf_id->valuestring) : NULL, g_nb_id ? g_nb_id_local_nonprim : NULL, - nge_nb_id ? ogs_strdup(nge_nb_id->valuestring) : NULL, - wagf_id ? ogs_strdup(wagf_id->valuestring) : NULL, - tngf_id ? ogs_strdup(tngf_id->valuestring) : NULL, - nid ? ogs_strdup(nid->valuestring) : NULL, - e_nb_id ? ogs_strdup(e_nb_id->valuestring) : NULL + nge_nb_id && !cJSON_IsNull(nge_nb_id) ? ogs_strdup(nge_nb_id->valuestring) : NULL, + wagf_id && !cJSON_IsNull(wagf_id) ? ogs_strdup(wagf_id->valuestring) : NULL, + tngf_id && !cJSON_IsNull(tngf_id) ? ogs_strdup(tngf_id->valuestring) : NULL, + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL, + e_nb_id && !cJSON_IsNull(e_nb_id) ? ogs_strdup(e_nb_id->valuestring) : NULL ); return global_ran_node_id_1_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (g_nb_id_local_nonprim) { + OpenAPI_gnb_id_free(g_nb_id_local_nonprim); + g_nb_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/gmlc_info.c b/lib/sbi/openapi/model/gmlc_info.c index 86d3d5919..6b829acdb 100644 --- a/lib/sbi/openapi/model/gmlc_info.c +++ b/lib/sbi/openapi/model/gmlc_info.c @@ -18,20 +18,25 @@ OpenAPI_gmlc_info_t *OpenAPI_gmlc_info_create( void OpenAPI_gmlc_info_free(OpenAPI_gmlc_info_t *gmlc_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == gmlc_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(gmlc_info->serving_client_types, node) { - OpenAPI_external_client_type_free(node->data); + if (gmlc_info->serving_client_types) { + OpenAPI_list_for_each(gmlc_info->serving_client_types, node) { + OpenAPI_external_client_type_free(node->data); + } + OpenAPI_list_free(gmlc_info->serving_client_types); + gmlc_info->serving_client_types = NULL; } - OpenAPI_list_free(gmlc_info->serving_client_types); ogs_free(gmlc_info); } cJSON *OpenAPI_gmlc_info_convertToJSON(OpenAPI_gmlc_info_t *gmlc_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (gmlc_info == NULL) { ogs_error("OpenAPI_gmlc_info_convertToJSON() failed [GmlcInfo]"); @@ -45,17 +50,13 @@ cJSON *OpenAPI_gmlc_info_convertToJSON(OpenAPI_gmlc_info_t *gmlc_info) ogs_error("OpenAPI_gmlc_info_convertToJSON() failed [serving_client_types]"); goto end; } - - OpenAPI_lnode_t *serving_client_types_node; - if (gmlc_info->serving_client_types) { - OpenAPI_list_for_each(gmlc_info->serving_client_types, serving_client_types_node) { - cJSON *itemLocal = OpenAPI_external_client_type_convertToJSON(serving_client_types_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_gmlc_info_convertToJSON() failed [serving_client_types]"); - goto end; - } - cJSON_AddItemToArray(serving_client_typesList, itemLocal); + OpenAPI_list_for_each(gmlc_info->serving_client_types, node) { + cJSON *itemLocal = OpenAPI_external_client_type_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_gmlc_info_convertToJSON() failed [serving_client_types]"); + goto end; } + cJSON_AddItemToArray(serving_client_typesList, itemLocal); } } @@ -66,33 +67,32 @@ end: OpenAPI_gmlc_info_t *OpenAPI_gmlc_info_parseFromJSON(cJSON *gmlc_infoJSON) { OpenAPI_gmlc_info_t *gmlc_info_local_var = NULL; - cJSON *serving_client_types = cJSON_GetObjectItemCaseSensitive(gmlc_infoJSON, "servingClientTypes"); - - OpenAPI_list_t *serving_client_typesList; + OpenAPI_lnode_t *node = NULL; + cJSON *serving_client_types = NULL; + OpenAPI_list_t *serving_client_typesList = NULL; + serving_client_types = cJSON_GetObjectItemCaseSensitive(gmlc_infoJSON, "servingClientTypes"); if (serving_client_types) { - cJSON *serving_client_types_local_nonprimitive; - if (!cJSON_IsArray(serving_client_types)){ - ogs_error("OpenAPI_gmlc_info_parseFromJSON() failed [serving_client_types]"); - goto end; - } - - serving_client_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(serving_client_types_local_nonprimitive, serving_client_types ) { - if (!cJSON_IsObject(serving_client_types_local_nonprimitive)) { + cJSON *serving_client_types_local = NULL; + if (!cJSON_IsArray(serving_client_types)) { ogs_error("OpenAPI_gmlc_info_parseFromJSON() failed [serving_client_types]"); goto end; } - OpenAPI_external_client_type_t *serving_client_typesItem = OpenAPI_external_client_type_parseFromJSON(serving_client_types_local_nonprimitive); - if (!serving_client_typesItem) { - ogs_error("No serving_client_typesItem"); - OpenAPI_list_free(serving_client_typesList); - goto end; + serving_client_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_client_types_local, serving_client_types) { + if (!cJSON_IsObject(serving_client_types_local)) { + ogs_error("OpenAPI_gmlc_info_parseFromJSON() failed [serving_client_types]"); + goto end; + } + OpenAPI_external_client_type_t *serving_client_typesItem = OpenAPI_external_client_type_parseFromJSON(serving_client_types_local); + if (!serving_client_typesItem) { + ogs_error("No serving_client_typesItem"); + OpenAPI_list_free(serving_client_typesList); + goto end; + } + OpenAPI_list_add(serving_client_typesList, serving_client_typesItem); } - - OpenAPI_list_add(serving_client_typesList, serving_client_typesItem); - } } gmlc_info_local_var = OpenAPI_gmlc_info_create ( @@ -101,6 +101,13 @@ OpenAPI_gmlc_info_t *OpenAPI_gmlc_info_parseFromJSON(cJSON *gmlc_infoJSON) return gmlc_info_local_var; end: + if (serving_client_typesList) { + OpenAPI_list_for_each(serving_client_typesList, node) { + OpenAPI_external_client_type_free(node->data); + } + OpenAPI_list_free(serving_client_typesList); + serving_client_typesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/gnb_id.c b/lib/sbi/openapi/model/gnb_id.c index b1c77cb59..d57cec6a0 100644 --- a/lib/sbi/openapi/model/gnb_id.c +++ b/lib/sbi/openapi/model/gnb_id.c @@ -20,17 +20,22 @@ OpenAPI_gnb_id_t *OpenAPI_gnb_id_create( void OpenAPI_gnb_id_free(OpenAPI_gnb_id_t *gnb_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == gnb_id) { return; } - OpenAPI_lnode_t *node; - ogs_free(gnb_id->g_nb_value); + if (gnb_id->g_nb_value) { + ogs_free(gnb_id->g_nb_value); + gnb_id->g_nb_value = NULL; + } ogs_free(gnb_id); } cJSON *OpenAPI_gnb_id_convertToJSON(OpenAPI_gnb_id_t *gnb_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (gnb_id == NULL) { ogs_error("OpenAPI_gnb_id_convertToJSON() failed [GNbId]"); @@ -43,6 +48,10 @@ cJSON *OpenAPI_gnb_id_convertToJSON(OpenAPI_gnb_id_t *gnb_id) goto end; } + if (!gnb_id->g_nb_value) { + ogs_error("OpenAPI_gnb_id_convertToJSON() failed [g_nb_value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "gNBValue", gnb_id->g_nb_value) == NULL) { ogs_error("OpenAPI_gnb_id_convertToJSON() failed [g_nb_value]"); goto end; @@ -55,23 +64,24 @@ end: OpenAPI_gnb_id_t *OpenAPI_gnb_id_parseFromJSON(cJSON *gnb_idJSON) { OpenAPI_gnb_id_t *gnb_id_local_var = NULL; - cJSON *bit_length = cJSON_GetObjectItemCaseSensitive(gnb_idJSON, "bitLength"); + OpenAPI_lnode_t *node = NULL; + cJSON *bit_length = NULL; + cJSON *g_nb_value = NULL; + bit_length = cJSON_GetObjectItemCaseSensitive(gnb_idJSON, "bitLength"); if (!bit_length) { ogs_error("OpenAPI_gnb_id_parseFromJSON() failed [bit_length]"); goto end; } - if (!cJSON_IsNumber(bit_length)) { ogs_error("OpenAPI_gnb_id_parseFromJSON() failed [bit_length]"); goto end; } - cJSON *g_nb_value = cJSON_GetObjectItemCaseSensitive(gnb_idJSON, "gNBValue"); + g_nb_value = cJSON_GetObjectItemCaseSensitive(gnb_idJSON, "gNBValue"); if (!g_nb_value) { ogs_error("OpenAPI_gnb_id_parseFromJSON() failed [g_nb_value]"); goto end; } - if (!cJSON_IsString(g_nb_value)) { ogs_error("OpenAPI_gnb_id_parseFromJSON() failed [g_nb_value]"); goto end; diff --git a/lib/sbi/openapi/model/group_identifiers.c b/lib/sbi/openapi/model/group_identifiers.c index 5ecfe758d..099cb89c6 100644 --- a/lib/sbi/openapi/model/group_identifiers.c +++ b/lib/sbi/openapi/model/group_identifiers.c @@ -22,22 +22,33 @@ OpenAPI_group_identifiers_t *OpenAPI_group_identifiers_create( void OpenAPI_group_identifiers_free(OpenAPI_group_identifiers_t *group_identifiers) { + OpenAPI_lnode_t *node = NULL; + if (NULL == group_identifiers) { return; } - OpenAPI_lnode_t *node; - ogs_free(group_identifiers->ext_group_id); - ogs_free(group_identifiers->int_group_id); - OpenAPI_list_for_each(group_identifiers->ue_id_list, node) { - OpenAPI_ue_id_free(node->data); + if (group_identifiers->ext_group_id) { + ogs_free(group_identifiers->ext_group_id); + group_identifiers->ext_group_id = NULL; + } + if (group_identifiers->int_group_id) { + ogs_free(group_identifiers->int_group_id); + group_identifiers->int_group_id = NULL; + } + if (group_identifiers->ue_id_list) { + OpenAPI_list_for_each(group_identifiers->ue_id_list, node) { + OpenAPI_ue_id_free(node->data); + } + OpenAPI_list_free(group_identifiers->ue_id_list); + group_identifiers->ue_id_list = NULL; } - OpenAPI_list_free(group_identifiers->ue_id_list); ogs_free(group_identifiers); } cJSON *OpenAPI_group_identifiers_convertToJSON(OpenAPI_group_identifiers_t *group_identifiers) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (group_identifiers == NULL) { ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [GroupIdentifiers]"); @@ -65,17 +76,13 @@ cJSON *OpenAPI_group_identifiers_convertToJSON(OpenAPI_group_identifiers_t *grou ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [ue_id_list]"); goto end; } - - OpenAPI_lnode_t *ue_id_list_node; - if (group_identifiers->ue_id_list) { - OpenAPI_list_for_each(group_identifiers->ue_id_list, ue_id_list_node) { - cJSON *itemLocal = OpenAPI_ue_id_convertToJSON(ue_id_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [ue_id_list]"); - goto end; - } - cJSON_AddItemToArray(ue_id_listList, itemLocal); + OpenAPI_list_for_each(group_identifiers->ue_id_list, node) { + cJSON *itemLocal = OpenAPI_ue_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_group_identifiers_convertToJSON() failed [ue_id_list]"); + goto end; } + cJSON_AddItemToArray(ue_id_listList, itemLocal); } } @@ -86,61 +93,67 @@ end: OpenAPI_group_identifiers_t *OpenAPI_group_identifiers_parseFromJSON(cJSON *group_identifiersJSON) { OpenAPI_group_identifiers_t *group_identifiers_local_var = NULL; - cJSON *ext_group_id = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "extGroupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ext_group_id = NULL; + cJSON *int_group_id = NULL; + cJSON *ue_id_list = NULL; + OpenAPI_list_t *ue_id_listList = NULL; + ext_group_id = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "extGroupId"); if (ext_group_id) { - if (!cJSON_IsString(ext_group_id)) { + if (!cJSON_IsString(ext_group_id) && !cJSON_IsNull(ext_group_id)) { ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [ext_group_id]"); goto end; } } - cJSON *int_group_id = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "intGroupId"); - + int_group_id = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "intGroupId"); if (int_group_id) { - if (!cJSON_IsString(int_group_id)) { + if (!cJSON_IsString(int_group_id) && !cJSON_IsNull(int_group_id)) { ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [int_group_id]"); goto end; } } - cJSON *ue_id_list = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "ueIdList"); - - OpenAPI_list_t *ue_id_listList; + ue_id_list = cJSON_GetObjectItemCaseSensitive(group_identifiersJSON, "ueIdList"); if (ue_id_list) { - cJSON *ue_id_list_local_nonprimitive; - if (!cJSON_IsArray(ue_id_list)){ - ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [ue_id_list]"); - goto end; - } - - ue_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ue_id_list_local_nonprimitive, ue_id_list ) { - if (!cJSON_IsObject(ue_id_list_local_nonprimitive)) { + cJSON *ue_id_list_local = NULL; + if (!cJSON_IsArray(ue_id_list)) { ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [ue_id_list]"); goto end; } - OpenAPI_ue_id_t *ue_id_listItem = OpenAPI_ue_id_parseFromJSON(ue_id_list_local_nonprimitive); - if (!ue_id_listItem) { - ogs_error("No ue_id_listItem"); - OpenAPI_list_free(ue_id_listList); - goto end; + ue_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_id_list_local, ue_id_list) { + if (!cJSON_IsObject(ue_id_list_local)) { + ogs_error("OpenAPI_group_identifiers_parseFromJSON() failed [ue_id_list]"); + goto end; + } + OpenAPI_ue_id_t *ue_id_listItem = OpenAPI_ue_id_parseFromJSON(ue_id_list_local); + if (!ue_id_listItem) { + ogs_error("No ue_id_listItem"); + OpenAPI_list_free(ue_id_listList); + goto end; + } + OpenAPI_list_add(ue_id_listList, ue_id_listItem); } - - OpenAPI_list_add(ue_id_listList, ue_id_listItem); - } } group_identifiers_local_var = OpenAPI_group_identifiers_create ( - ext_group_id ? ogs_strdup(ext_group_id->valuestring) : NULL, - int_group_id ? ogs_strdup(int_group_id->valuestring) : NULL, + ext_group_id && !cJSON_IsNull(ext_group_id) ? ogs_strdup(ext_group_id->valuestring) : NULL, + int_group_id && !cJSON_IsNull(int_group_id) ? ogs_strdup(int_group_id->valuestring) : NULL, ue_id_list ? ue_id_listList : NULL ); return group_identifiers_local_var; end: + if (ue_id_listList) { + OpenAPI_list_for_each(ue_id_listList, node) { + OpenAPI_ue_id_free(node->data); + } + OpenAPI_list_free(ue_id_listList); + ue_id_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/guami.c b/lib/sbi/openapi/model/guami.c index 910e56e27..bf9aae7ac 100644 --- a/lib/sbi/openapi/model/guami.c +++ b/lib/sbi/openapi/model/guami.c @@ -20,18 +20,26 @@ OpenAPI_guami_t *OpenAPI_guami_create( void OpenAPI_guami_free(OpenAPI_guami_t *guami) { + OpenAPI_lnode_t *node = NULL; + if (NULL == guami) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_nid_free(guami->plmn_id); - ogs_free(guami->amf_id); + if (guami->plmn_id) { + OpenAPI_plmn_id_nid_free(guami->plmn_id); + guami->plmn_id = NULL; + } + if (guami->amf_id) { + ogs_free(guami->amf_id); + guami->amf_id = NULL; + } ogs_free(guami); } cJSON *OpenAPI_guami_convertToJSON(OpenAPI_guami_t *guami) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (guami == NULL) { ogs_error("OpenAPI_guami_convertToJSON() failed [Guami]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_guami_convertToJSON(OpenAPI_guami_t *guami) } item = cJSON_CreateObject(); + if (!guami->plmn_id) { + ogs_error("OpenAPI_guami_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_nid_convertToJSON(guami->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_guami_convertToJSON() failed [plmn_id]"); @@ -50,6 +62,10 @@ cJSON *OpenAPI_guami_convertToJSON(OpenAPI_guami_t *guami) goto end; } + if (!guami->amf_id) { + ogs_error("OpenAPI_guami_convertToJSON() failed [amf_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "amfId", guami->amf_id) == NULL) { ogs_error("OpenAPI_guami_convertToJSON() failed [amf_id]"); goto end; @@ -62,21 +78,22 @@ end: OpenAPI_guami_t *OpenAPI_guami_parseFromJSON(cJSON *guamiJSON) { OpenAPI_guami_t *guami_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(guamiJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_nid_t *plmn_id_local_nonprim = NULL; + cJSON *amf_id = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(guamiJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_guami_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_nid_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(plmn_id); - cJSON *amf_id = cJSON_GetObjectItemCaseSensitive(guamiJSON, "amfId"); + amf_id = cJSON_GetObjectItemCaseSensitive(guamiJSON, "amfId"); if (!amf_id) { ogs_error("OpenAPI_guami_parseFromJSON() failed [amf_id]"); goto end; } - if (!cJSON_IsString(amf_id)) { ogs_error("OpenAPI_guami_parseFromJSON() failed [amf_id]"); goto end; @@ -89,6 +106,10 @@ OpenAPI_guami_t *OpenAPI_guami_parseFromJSON(cJSON *guamiJSON) return guami_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_nid_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/guami_list_cond.c b/lib/sbi/openapi/model/guami_list_cond.c index 7fb48d2e2..a38953a1f 100644 --- a/lib/sbi/openapi/model/guami_list_cond.c +++ b/lib/sbi/openapi/model/guami_list_cond.c @@ -18,20 +18,25 @@ OpenAPI_guami_list_cond_t *OpenAPI_guami_list_cond_create( void OpenAPI_guami_list_cond_free(OpenAPI_guami_list_cond_t *guami_list_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == guami_list_cond) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(guami_list_cond->guami_list, node) { - OpenAPI_guami_free(node->data); + if (guami_list_cond->guami_list) { + OpenAPI_list_for_each(guami_list_cond->guami_list, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(guami_list_cond->guami_list); + guami_list_cond->guami_list = NULL; } - OpenAPI_list_free(guami_list_cond->guami_list); ogs_free(guami_list_cond); } cJSON *OpenAPI_guami_list_cond_convertToJSON(OpenAPI_guami_list_cond_t *guami_list_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (guami_list_cond == NULL) { ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [GuamiListCond]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_guami_list_cond_convertToJSON(OpenAPI_guami_list_cond_t *guami_li } item = cJSON_CreateObject(); + if (!guami_list_cond->guami_list) { + ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [guami_list]"); + return NULL; + } cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList"); if (guami_listList == NULL) { ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [guami_list]"); goto end; } - - OpenAPI_lnode_t *guami_list_node; - if (guami_list_cond->guami_list) { - OpenAPI_list_for_each(guami_list_cond->guami_list, guami_list_node) { - cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [guami_list]"); - goto end; - } - cJSON_AddItemToArray(guami_listList, itemLocal); + OpenAPI_list_for_each(guami_list_cond->guami_list, node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [guami_list]"); + goto end; } + cJSON_AddItemToArray(guami_listList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_guami_list_cond_t *OpenAPI_guami_list_cond_parseFromJSON(cJSON *guami_list_condJSON) { OpenAPI_guami_list_cond_t *guami_list_cond_local_var = NULL; - cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(guami_list_condJSON, "guamiList"); + OpenAPI_lnode_t *node = NULL; + cJSON *guami_list = NULL; + OpenAPI_list_t *guami_listList = NULL; + guami_list = cJSON_GetObjectItemCaseSensitive(guami_list_condJSON, "guamiList"); if (!guami_list) { ogs_error("OpenAPI_guami_list_cond_parseFromJSON() failed [guami_list]"); goto end; } - - OpenAPI_list_t *guami_listList; - cJSON *guami_list_local_nonprimitive; - if (!cJSON_IsArray(guami_list)){ - ogs_error("OpenAPI_guami_list_cond_parseFromJSON() failed [guami_list]"); - goto end; - } - - guami_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) { - if (!cJSON_IsObject(guami_list_local_nonprimitive)) { + cJSON *guami_list_local = NULL; + if (!cJSON_IsArray(guami_list)) { ogs_error("OpenAPI_guami_list_cond_parseFromJSON() failed [guami_list]"); goto end; } - OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive); - if (!guami_listItem) { - ogs_error("No guami_listItem"); - OpenAPI_list_free(guami_listList); - goto end; + guami_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(guami_list_local, guami_list) { + if (!cJSON_IsObject(guami_list_local)) { + ogs_error("OpenAPI_guami_list_cond_parseFromJSON() failed [guami_list]"); + goto end; + } + OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local); + if (!guami_listItem) { + ogs_error("No guami_listItem"); + OpenAPI_list_free(guami_listList); + goto end; + } + OpenAPI_list_add(guami_listList, guami_listItem); } - OpenAPI_list_add(guami_listList, guami_listItem); - } - guami_list_cond_local_var = OpenAPI_guami_list_cond_create ( guami_listList ); return guami_list_cond_local_var; end: + if (guami_listList) { + OpenAPI_list_for_each(guami_listList, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(guami_listList); + guami_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/hfc_node_id.c b/lib/sbi/openapi/model/hfc_node_id.c index d08d5d6d7..f23c718de 100644 --- a/lib/sbi/openapi/model/hfc_node_id.c +++ b/lib/sbi/openapi/model/hfc_node_id.c @@ -18,17 +18,22 @@ OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_create( void OpenAPI_hfc_node_id_free(OpenAPI_hfc_node_id_t *hfc_node_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == hfc_node_id) { return; } - OpenAPI_lnode_t *node; - ogs_free(hfc_node_id->hfc_nid); + if (hfc_node_id->hfc_nid) { + ogs_free(hfc_node_id->hfc_nid); + hfc_node_id->hfc_nid = NULL; + } ogs_free(hfc_node_id); } cJSON *OpenAPI_hfc_node_id_convertToJSON(OpenAPI_hfc_node_id_t *hfc_node_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (hfc_node_id == NULL) { ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [HfcNodeId]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_hfc_node_id_convertToJSON(OpenAPI_hfc_node_id_t *hfc_node_id) } item = cJSON_CreateObject(); + if (!hfc_node_id->hfc_nid) { + ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [hfc_nid]"); + return NULL; + } if (cJSON_AddStringToObject(item, "hfcNId", hfc_node_id->hfc_nid) == NULL) { ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [hfc_nid]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_parseFromJSON(cJSON *hfc_node_idJSON) { OpenAPI_hfc_node_id_t *hfc_node_id_local_var = NULL; - cJSON *hfc_nid = cJSON_GetObjectItemCaseSensitive(hfc_node_idJSON, "hfcNId"); + OpenAPI_lnode_t *node = NULL; + cJSON *hfc_nid = NULL; + hfc_nid = cJSON_GetObjectItemCaseSensitive(hfc_node_idJSON, "hfcNId"); if (!hfc_nid) { ogs_error("OpenAPI_hfc_node_id_parseFromJSON() failed [hfc_nid]"); goto end; } - if (!cJSON_IsString(hfc_nid)) { ogs_error("OpenAPI_hfc_node_id_parseFromJSON() failed [hfc_nid]"); goto end; diff --git a/lib/sbi/openapi/model/hsmf_update_data.c b/lib/sbi/openapi/model/hsmf_update_data.c index f74770171..8eaaa5f75 100644 --- a/lib/sbi/openapi/model/hsmf_update_data.c +++ b/lib/sbi/openapi/model/hsmf_update_data.c @@ -146,81 +146,197 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_create( void OpenAPI_hsmf_update_data_free(OpenAPI_hsmf_update_data_t *hsmf_update_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == hsmf_update_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(hsmf_update_data->pei); - OpenAPI_tunnel_info_free(hsmf_update_data->vcn_tunnel_info); - OpenAPI_tunnel_info_free(hsmf_update_data->icn_tunnel_info); - OpenAPI_tunnel_info_free(hsmf_update_data->additional_cn_tunnel_info); - OpenAPI_plmn_id_nid_free(hsmf_update_data->serving_network); - OpenAPI_user_location_free(hsmf_update_data->ue_location); - ogs_free(hsmf_update_data->ue_time_zone); - OpenAPI_user_location_free(hsmf_update_data->add_ue_location); - OpenAPI_ref_to_binary_data_free(hsmf_update_data->n1_sm_info_from_ue); - OpenAPI_ref_to_binary_data_free(hsmf_update_data->unknown_n1_sm_info); - OpenAPI_list_for_each(hsmf_update_data->qos_flows_rel_notify_list, node) { - OpenAPI_qos_flow_item_free(node->data); + if (hsmf_update_data->pei) { + ogs_free(hsmf_update_data->pei); + hsmf_update_data->pei = NULL; } - OpenAPI_list_free(hsmf_update_data->qos_flows_rel_notify_list); - OpenAPI_list_for_each(hsmf_update_data->qos_flows_notify_list, node) { - OpenAPI_qos_flow_notify_item_free(node->data); + if (hsmf_update_data->vcn_tunnel_info) { + OpenAPI_tunnel_info_free(hsmf_update_data->vcn_tunnel_info); + hsmf_update_data->vcn_tunnel_info = NULL; } - OpenAPI_list_free(hsmf_update_data->qos_flows_notify_list); - OpenAPI_list_for_each(hsmf_update_data->notify_list, node) { - OpenAPI_pdu_session_notify_item_free(node->data); + if (hsmf_update_data->icn_tunnel_info) { + OpenAPI_tunnel_info_free(hsmf_update_data->icn_tunnel_info); + hsmf_update_data->icn_tunnel_info = NULL; } - OpenAPI_list_free(hsmf_update_data->notify_list); - OpenAPI_list_for_each(hsmf_update_data->eps_bearer_id, node) { - ogs_free(node->data); + if (hsmf_update_data->additional_cn_tunnel_info) { + OpenAPI_tunnel_info_free(hsmf_update_data->additional_cn_tunnel_info); + hsmf_update_data->additional_cn_tunnel_info = NULL; } - OpenAPI_list_free(hsmf_update_data->eps_bearer_id); - OpenAPI_list_for_each(hsmf_update_data->revoke_ebi_list, node) { - ogs_free(node->data); + if (hsmf_update_data->serving_network) { + OpenAPI_plmn_id_nid_free(hsmf_update_data->serving_network); + hsmf_update_data->serving_network = NULL; } - OpenAPI_list_free(hsmf_update_data->revoke_ebi_list); - OpenAPI_ng_ap_cause_free(hsmf_update_data->ng_ap_cause); - OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_report, node) { - OpenAPI_secondary_rat_usage_report_free(node->data); + if (hsmf_update_data->ue_location) { + OpenAPI_user_location_free(hsmf_update_data->ue_location); + hsmf_update_data->ue_location = NULL; } - OpenAPI_list_free(hsmf_update_data->secondary_rat_usage_report); - OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_info, node) { - OpenAPI_secondary_rat_usage_info_free(node->data); + if (hsmf_update_data->ue_time_zone) { + ogs_free(hsmf_update_data->ue_time_zone); + hsmf_update_data->ue_time_zone = NULL; } - OpenAPI_list_free(hsmf_update_data->secondary_rat_usage_info); - OpenAPI_list_for_each(hsmf_update_data->psa_info, node) { - OpenAPI_psa_information_free(node->data); + if (hsmf_update_data->add_ue_location) { + OpenAPI_user_location_free(hsmf_update_data->add_ue_location); + hsmf_update_data->add_ue_location = NULL; } - OpenAPI_list_free(hsmf_update_data->psa_info); - OpenAPI_ulcl_bp_information_free(hsmf_update_data->ulcl_bp_info); - OpenAPI_n4_information_free(hsmf_update_data->n4_info); - OpenAPI_n4_information_free(hsmf_update_data->n4_info_ext1); - OpenAPI_n4_information_free(hsmf_update_data->n4_info_ext2); - ogs_free(hsmf_update_data->vsmf_pdu_session_uri); - ogs_free(hsmf_update_data->vsmf_id); - ogs_free(hsmf_update_data->v_smf_service_instance_id); - ogs_free(hsmf_update_data->ismf_pdu_session_uri); - ogs_free(hsmf_update_data->ismf_id); - ogs_free(hsmf_update_data->i_smf_service_instance_id); - OpenAPI_list_for_each(hsmf_update_data->dnai_list, node) { - ogs_free(node->data); + if (hsmf_update_data->n1_sm_info_from_ue) { + OpenAPI_ref_to_binary_data_free(hsmf_update_data->n1_sm_info_from_ue); + hsmf_update_data->n1_sm_info_from_ue = NULL; + } + if (hsmf_update_data->unknown_n1_sm_info) { + OpenAPI_ref_to_binary_data_free(hsmf_update_data->unknown_n1_sm_info); + hsmf_update_data->unknown_n1_sm_info = NULL; + } + if (hsmf_update_data->qos_flows_rel_notify_list) { + OpenAPI_list_for_each(hsmf_update_data->qos_flows_rel_notify_list, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->qos_flows_rel_notify_list); + hsmf_update_data->qos_flows_rel_notify_list = NULL; + } + if (hsmf_update_data->qos_flows_notify_list) { + OpenAPI_list_for_each(hsmf_update_data->qos_flows_notify_list, node) { + OpenAPI_qos_flow_notify_item_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->qos_flows_notify_list); + hsmf_update_data->qos_flows_notify_list = NULL; + } + if (hsmf_update_data->notify_list) { + OpenAPI_list_for_each(hsmf_update_data->notify_list, node) { + OpenAPI_pdu_session_notify_item_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->notify_list); + hsmf_update_data->notify_list = NULL; + } + if (hsmf_update_data->eps_bearer_id) { + OpenAPI_list_for_each(hsmf_update_data->eps_bearer_id, node) { + ogs_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->eps_bearer_id); + hsmf_update_data->eps_bearer_id = NULL; + } + if (hsmf_update_data->revoke_ebi_list) { + OpenAPI_list_for_each(hsmf_update_data->revoke_ebi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->revoke_ebi_list); + hsmf_update_data->revoke_ebi_list = NULL; + } + if (hsmf_update_data->ng_ap_cause) { + OpenAPI_ng_ap_cause_free(hsmf_update_data->ng_ap_cause); + hsmf_update_data->ng_ap_cause = NULL; + } + if (hsmf_update_data->secondary_rat_usage_report) { + OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_report, node) { + OpenAPI_secondary_rat_usage_report_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->secondary_rat_usage_report); + hsmf_update_data->secondary_rat_usage_report = NULL; + } + if (hsmf_update_data->secondary_rat_usage_info) { + OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_info, node) { + OpenAPI_secondary_rat_usage_info_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->secondary_rat_usage_info); + hsmf_update_data->secondary_rat_usage_info = NULL; + } + if (hsmf_update_data->psa_info) { + OpenAPI_list_for_each(hsmf_update_data->psa_info, node) { + OpenAPI_psa_information_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->psa_info); + hsmf_update_data->psa_info = NULL; + } + if (hsmf_update_data->ulcl_bp_info) { + OpenAPI_ulcl_bp_information_free(hsmf_update_data->ulcl_bp_info); + hsmf_update_data->ulcl_bp_info = NULL; + } + if (hsmf_update_data->n4_info) { + OpenAPI_n4_information_free(hsmf_update_data->n4_info); + hsmf_update_data->n4_info = NULL; + } + if (hsmf_update_data->n4_info_ext1) { + OpenAPI_n4_information_free(hsmf_update_data->n4_info_ext1); + hsmf_update_data->n4_info_ext1 = NULL; + } + if (hsmf_update_data->n4_info_ext2) { + OpenAPI_n4_information_free(hsmf_update_data->n4_info_ext2); + hsmf_update_data->n4_info_ext2 = NULL; + } + if (hsmf_update_data->vsmf_pdu_session_uri) { + ogs_free(hsmf_update_data->vsmf_pdu_session_uri); + hsmf_update_data->vsmf_pdu_session_uri = NULL; + } + if (hsmf_update_data->vsmf_id) { + ogs_free(hsmf_update_data->vsmf_id); + hsmf_update_data->vsmf_id = NULL; + } + if (hsmf_update_data->v_smf_service_instance_id) { + ogs_free(hsmf_update_data->v_smf_service_instance_id); + hsmf_update_data->v_smf_service_instance_id = NULL; + } + if (hsmf_update_data->ismf_pdu_session_uri) { + ogs_free(hsmf_update_data->ismf_pdu_session_uri); + hsmf_update_data->ismf_pdu_session_uri = NULL; + } + if (hsmf_update_data->ismf_id) { + ogs_free(hsmf_update_data->ismf_id); + hsmf_update_data->ismf_id = NULL; + } + if (hsmf_update_data->i_smf_service_instance_id) { + ogs_free(hsmf_update_data->i_smf_service_instance_id); + hsmf_update_data->i_smf_service_instance_id = NULL; + } + if (hsmf_update_data->dnai_list) { + OpenAPI_list_for_each(hsmf_update_data->dnai_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(hsmf_update_data->dnai_list); + hsmf_update_data->dnai_list = NULL; + } + if (hsmf_update_data->supported_features) { + ogs_free(hsmf_update_data->supported_features); + hsmf_update_data->supported_features = NULL; + } + if (hsmf_update_data->roaming_charging_profile) { + OpenAPI_roaming_charging_profile_free(hsmf_update_data->roaming_charging_profile); + hsmf_update_data->roaming_charging_profile = NULL; + } + if (hsmf_update_data->mo_exp_data_counter) { + OpenAPI_mo_exp_data_counter_free(hsmf_update_data->mo_exp_data_counter); + hsmf_update_data->mo_exp_data_counter = NULL; + } + if (hsmf_update_data->vplmn_qos) { + OpenAPI_vplmn_qos_free(hsmf_update_data->vplmn_qos); + hsmf_update_data->vplmn_qos = NULL; + } + if (hsmf_update_data->security_result) { + OpenAPI_security_result_free(hsmf_update_data->security_result); + hsmf_update_data->security_result = NULL; + } + if (hsmf_update_data->up_security_info) { + OpenAPI_up_security_info_free(hsmf_update_data->up_security_info); + hsmf_update_data->up_security_info = NULL; + } + if (hsmf_update_data->amf_nf_id) { + ogs_free(hsmf_update_data->amf_nf_id); + hsmf_update_data->amf_nf_id = NULL; + } + if (hsmf_update_data->guami) { + OpenAPI_guami_free(hsmf_update_data->guami); + hsmf_update_data->guami = NULL; } - OpenAPI_list_free(hsmf_update_data->dnai_list); - ogs_free(hsmf_update_data->supported_features); - OpenAPI_roaming_charging_profile_free(hsmf_update_data->roaming_charging_profile); - OpenAPI_mo_exp_data_counter_free(hsmf_update_data->mo_exp_data_counter); - OpenAPI_vplmn_qos_free(hsmf_update_data->vplmn_qos); - OpenAPI_security_result_free(hsmf_update_data->security_result); - OpenAPI_up_security_info_free(hsmf_update_data->up_security_info); - ogs_free(hsmf_update_data->amf_nf_id); - OpenAPI_guami_free(hsmf_update_data->guami); ogs_free(hsmf_update_data); } cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_update_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (hsmf_update_data == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [HsmfUpdateData]"); @@ -228,6 +344,10 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u } item = cJSON_CreateObject(); + if (hsmf_update_data->request_indication == OpenAPI_request_indication_NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [request_indication]"); + return NULL; + } if (cJSON_AddStringToObject(item, "requestIndication", OpenAPI_request_indication_ToString(hsmf_update_data->request_indication)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [request_indication]"); goto end; @@ -292,21 +412,21 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u } } - if (hsmf_update_data->an_type) { + if (hsmf_update_data->an_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "anType", OpenAPI_access_type_ToString(hsmf_update_data->an_type)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [an_type]"); goto end; } } - if (hsmf_update_data->additional_an_type) { + if (hsmf_update_data->additional_an_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "additionalAnType", OpenAPI_access_type_ToString(hsmf_update_data->additional_an_type)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [additional_an_type]"); goto end; } } - if (hsmf_update_data->rat_type) { + if (hsmf_update_data->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(hsmf_update_data->rat_type)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [rat_type]"); goto end; @@ -392,17 +512,13 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [qos_flows_rel_notify_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_rel_notify_list_node; - if (hsmf_update_data->qos_flows_rel_notify_list) { - OpenAPI_list_for_each(hsmf_update_data->qos_flows_rel_notify_list, qos_flows_rel_notify_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(qos_flows_rel_notify_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [qos_flows_rel_notify_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_rel_notify_listList, itemLocal); + OpenAPI_list_for_each(hsmf_update_data->qos_flows_rel_notify_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [qos_flows_rel_notify_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_rel_notify_listList, itemLocal); } } @@ -412,17 +528,13 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [qos_flows_notify_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_notify_list_node; - if (hsmf_update_data->qos_flows_notify_list) { - OpenAPI_list_for_each(hsmf_update_data->qos_flows_notify_list, qos_flows_notify_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_notify_item_convertToJSON(qos_flows_notify_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [qos_flows_notify_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_notify_listList, itemLocal); + OpenAPI_list_for_each(hsmf_update_data->qos_flows_notify_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_notify_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [qos_flows_notify_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_notify_listList, itemLocal); } } @@ -432,34 +544,28 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [notify_list]"); goto end; } - - OpenAPI_lnode_t *notify_list_node; - if (hsmf_update_data->notify_list) { - OpenAPI_list_for_each(hsmf_update_data->notify_list, notify_list_node) { - cJSON *itemLocal = OpenAPI_pdu_session_notify_item_convertToJSON(notify_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [notify_list]"); - goto end; - } - cJSON_AddItemToArray(notify_listList, itemLocal); + OpenAPI_list_for_each(hsmf_update_data->notify_list, node) { + cJSON *itemLocal = OpenAPI_pdu_session_notify_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [notify_list]"); + goto end; } + cJSON_AddItemToArray(notify_listList, itemLocal); } } if (hsmf_update_data->eps_bearer_id) { - cJSON *eps_bearer_id = cJSON_AddArrayToObject(item, "epsBearerId"); - if (eps_bearer_id == NULL) { + cJSON *eps_bearer_idList = cJSON_AddArrayToObject(item, "epsBearerId"); + if (eps_bearer_idList == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [eps_bearer_id]"); goto end; } - - OpenAPI_lnode_t *eps_bearer_id_node; - OpenAPI_list_for_each(hsmf_update_data->eps_bearer_id, eps_bearer_id_node) { - if (cJSON_AddNumberToObject(eps_bearer_id, "", *(double *)eps_bearer_id_node->data) == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [eps_bearer_id]"); - goto end; + OpenAPI_list_for_each(hsmf_update_data->eps_bearer_id, node) { + if (cJSON_AddNumberToObject(eps_bearer_idList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [eps_bearer_id]"); + goto end; + } } - } } if (hsmf_update_data->is_ho_preparation_indication) { @@ -470,22 +576,20 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u } if (hsmf_update_data->revoke_ebi_list) { - cJSON *revoke_ebi_list = cJSON_AddArrayToObject(item, "revokeEbiList"); - if (revoke_ebi_list == NULL) { + cJSON *revoke_ebi_listList = cJSON_AddArrayToObject(item, "revokeEbiList"); + if (revoke_ebi_listList == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [revoke_ebi_list]"); goto end; } - - OpenAPI_lnode_t *revoke_ebi_list_node; - OpenAPI_list_for_each(hsmf_update_data->revoke_ebi_list, revoke_ebi_list_node) { - if (cJSON_AddNumberToObject(revoke_ebi_list, "", *(double *)revoke_ebi_list_node->data) == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [revoke_ebi_list]"); - goto end; + OpenAPI_list_for_each(hsmf_update_data->revoke_ebi_list, node) { + if (cJSON_AddNumberToObject(revoke_ebi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [revoke_ebi_list]"); + goto end; + } } - } } - if (hsmf_update_data->cause) { + if (hsmf_update_data->cause != OpenAPI_cause_NULL) { if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(hsmf_update_data->cause)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [cause]"); goto end; @@ -519,7 +623,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u } } - if (hsmf_update_data->eps_interworking_ind) { + if (hsmf_update_data->eps_interworking_ind != OpenAPI_eps_interworking_indication_NULL) { if (cJSON_AddStringToObject(item, "epsInterworkingInd", OpenAPI_eps_interworking_indication_ToString(hsmf_update_data->eps_interworking_ind)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [eps_interworking_ind]"); goto end; @@ -532,17 +636,13 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [secondary_rat_usage_report]"); goto end; } - - OpenAPI_lnode_t *secondary_rat_usage_report_node; - if (hsmf_update_data->secondary_rat_usage_report) { - OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_report, secondary_rat_usage_report_node) { - cJSON *itemLocal = OpenAPI_secondary_rat_usage_report_convertToJSON(secondary_rat_usage_report_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [secondary_rat_usage_report]"); - goto end; - } - cJSON_AddItemToArray(secondary_rat_usage_reportList, itemLocal); + OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_report, node) { + cJSON *itemLocal = OpenAPI_secondary_rat_usage_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [secondary_rat_usage_report]"); + goto end; } + cJSON_AddItemToArray(secondary_rat_usage_reportList, itemLocal); } } @@ -552,17 +652,13 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [secondary_rat_usage_info]"); goto end; } - - OpenAPI_lnode_t *secondary_rat_usage_info_node; - if (hsmf_update_data->secondary_rat_usage_info) { - OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_info, secondary_rat_usage_info_node) { - cJSON *itemLocal = OpenAPI_secondary_rat_usage_info_convertToJSON(secondary_rat_usage_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [secondary_rat_usage_info]"); - goto end; - } - cJSON_AddItemToArray(secondary_rat_usage_infoList, itemLocal); + OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_info, node) { + cJSON *itemLocal = OpenAPI_secondary_rat_usage_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [secondary_rat_usage_info]"); + goto end; } + cJSON_AddItemToArray(secondary_rat_usage_infoList, itemLocal); } } @@ -573,7 +669,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u } } - if (hsmf_update_data->ma_release_ind) { + if (hsmf_update_data->ma_release_ind != OpenAPI_ma_release_indication_NULL) { if (cJSON_AddStringToObject(item, "maReleaseInd", OpenAPI_ma_release_indication_ToString(hsmf_update_data->ma_release_ind)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [ma_release_ind]"); goto end; @@ -594,7 +690,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u } } - if (hsmf_update_data->unavailable_access_ind) { + if (hsmf_update_data->unavailable_access_ind != OpenAPI_unavailable_access_indication_NULL) { if (cJSON_AddStringToObject(item, "unavailableAccessInd", OpenAPI_unavailable_access_indication_ToString(hsmf_update_data->unavailable_access_ind)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [unavailable_access_ind]"); goto end; @@ -607,17 +703,13 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [psa_info]"); goto end; } - - OpenAPI_lnode_t *psa_info_node; - if (hsmf_update_data->psa_info) { - OpenAPI_list_for_each(hsmf_update_data->psa_info, psa_info_node) { - cJSON *itemLocal = OpenAPI_psa_information_convertToJSON(psa_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [psa_info]"); - goto end; - } - cJSON_AddItemToArray(psa_infoList, itemLocal); + OpenAPI_list_for_each(hsmf_update_data->psa_info, node) { + cJSON *itemLocal = OpenAPI_psa_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [psa_info]"); + goto end; } + cJSON_AddItemToArray(psa_infoList, itemLocal); } } @@ -673,7 +765,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u } } - if (hsmf_update_data->presence_in_ladn) { + if (hsmf_update_data->presence_in_ladn != OpenAPI_presence_state_NULL) { if (cJSON_AddStringToObject(item, "presenceInLadn", OpenAPI_presence_state_ToString(hsmf_update_data->presence_in_ladn)) == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [presence_in_ladn]"); goto end; @@ -730,19 +822,17 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u } if (hsmf_update_data->dnai_list) { - cJSON *dnai_list = cJSON_AddArrayToObject(item, "dnaiList"); - if (dnai_list == NULL) { + cJSON *dnai_listList = cJSON_AddArrayToObject(item, "dnaiList"); + if (dnai_listList == NULL) { ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [dnai_list]"); goto end; } - - OpenAPI_lnode_t *dnai_list_node; - OpenAPI_list_for_each(hsmf_update_data->dnai_list, dnai_list_node) { - if (cJSON_AddStringToObject(dnai_list, "", (char*)dnai_list_node->data) == NULL) { - ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [dnai_list]"); - goto end; + OpenAPI_list_for_each(hsmf_update_data->dnai_list, node) { + if (cJSON_AddStringToObject(dnai_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [dnai_list]"); + goto end; + } } - } } if (hsmf_update_data->supported_features) { @@ -844,59 +934,140 @@ end: OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_update_dataJSON) { OpenAPI_hsmf_update_data_t *hsmf_update_data_local_var = NULL; - cJSON *request_indication = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "requestIndication"); + OpenAPI_lnode_t *node = NULL; + cJSON *request_indication = NULL; + OpenAPI_request_indication_e request_indicationVariable = 0; + cJSON *pei = NULL; + cJSON *vcn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *vcn_tunnel_info_local_nonprim = NULL; + cJSON *icn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *icn_tunnel_info_local_nonprim = NULL; + cJSON *additional_cn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *additional_cn_tunnel_info_local_nonprim = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + cJSON *an_type = NULL; + OpenAPI_access_type_e an_typeVariable = 0; + cJSON *additional_an_type = NULL; + OpenAPI_access_type_e additional_an_typeVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *add_ue_location = NULL; + OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + cJSON *pause_charging = NULL; + cJSON *pti = NULL; + cJSON *n1_sm_info_from_ue = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_info_from_ue_local_nonprim = NULL; + cJSON *unknown_n1_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *unknown_n1_sm_info_local_nonprim = NULL; + cJSON *qos_flows_rel_notify_list = NULL; + OpenAPI_list_t *qos_flows_rel_notify_listList = NULL; + cJSON *qos_flows_notify_list = NULL; + OpenAPI_list_t *qos_flows_notify_listList = NULL; + cJSON *notify_list = NULL; + OpenAPI_list_t *notify_listList = NULL; + cJSON *eps_bearer_id = NULL; + OpenAPI_list_t *eps_bearer_idList = NULL; + cJSON *ho_preparation_indication = NULL; + cJSON *revoke_ebi_list = NULL; + OpenAPI_list_t *revoke_ebi_listList = NULL; + cJSON *cause = NULL; + OpenAPI_cause_e causeVariable = 0; + cJSON *ng_ap_cause = NULL; + OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + cJSON *_5g_mm_cause_value = NULL; + cJSON *always_on_requested = NULL; + cJSON *eps_interworking_ind = NULL; + OpenAPI_eps_interworking_indication_e eps_interworking_indVariable = 0; + cJSON *secondary_rat_usage_report = NULL; + OpenAPI_list_t *secondary_rat_usage_reportList = NULL; + cJSON *secondary_rat_usage_info = NULL; + OpenAPI_list_t *secondary_rat_usage_infoList = NULL; + cJSON *an_type_can_be_changed = NULL; + cJSON *ma_release_ind = NULL; + OpenAPI_ma_release_indication_e ma_release_indVariable = 0; + cJSON *ma_nw_upgrade_ind = NULL; + cJSON *ma_request_ind = NULL; + cJSON *unavailable_access_ind = NULL; + OpenAPI_unavailable_access_indication_e unavailable_access_indVariable = 0; + cJSON *psa_info = NULL; + OpenAPI_list_t *psa_infoList = NULL; + cJSON *ulcl_bp_info = NULL; + OpenAPI_ulcl_bp_information_t *ulcl_bp_info_local_nonprim = NULL; + cJSON *n4_info = NULL; + OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + cJSON *n4_info_ext1 = NULL; + OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + cJSON *n4_info_ext2 = NULL; + OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + cJSON *presence_in_ladn = NULL; + OpenAPI_presence_state_e presence_in_ladnVariable = 0; + cJSON *vsmf_pdu_session_uri = NULL; + cJSON *vsmf_id = NULL; + cJSON *v_smf_service_instance_id = NULL; + cJSON *ismf_pdu_session_uri = NULL; + cJSON *ismf_id = NULL; + cJSON *i_smf_service_instance_id = NULL; + cJSON *dl_serving_plmn_rate_ctl = NULL; + cJSON *dnai_list = NULL; + OpenAPI_list_t *dnai_listList = NULL; + cJSON *supported_features = NULL; + cJSON *roaming_charging_profile = NULL; + OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + cJSON *mo_exp_data_counter = NULL; + OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + cJSON *vplmn_qos = NULL; + OpenAPI_vplmn_qos_t *vplmn_qos_local_nonprim = NULL; + cJSON *security_result = NULL; + OpenAPI_security_result_t *security_result_local_nonprim = NULL; + cJSON *up_security_info = NULL; + OpenAPI_up_security_info_t *up_security_info_local_nonprim = NULL; + cJSON *amf_nf_id = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + request_indication = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "requestIndication"); if (!request_indication) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [request_indication]"); goto end; } - - OpenAPI_request_indication_e request_indicationVariable; if (!cJSON_IsString(request_indication)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [request_indication]"); goto end; } request_indicationVariable = OpenAPI_request_indication_FromString(request_indication->valuestring); - cJSON *pei = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [pei]"); goto end; } } - cJSON *vcn_tunnel_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vcnTunnelInfo"); - - OpenAPI_tunnel_info_t *vcn_tunnel_info_local_nonprim = NULL; + vcn_tunnel_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vcnTunnelInfo"); if (vcn_tunnel_info) { vcn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(vcn_tunnel_info); } - cJSON *icn_tunnel_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "icnTunnelInfo"); - - OpenAPI_tunnel_info_t *icn_tunnel_info_local_nonprim = NULL; + icn_tunnel_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "icnTunnelInfo"); if (icn_tunnel_info) { icn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(icn_tunnel_info); } - cJSON *additional_cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "additionalCnTunnelInfo"); - - OpenAPI_tunnel_info_t *additional_cn_tunnel_info_local_nonprim = NULL; + additional_cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "additionalCnTunnelInfo"); if (additional_cn_tunnel_info) { additional_cn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(additional_cn_tunnel_info); } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "servingNetwork"); - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + serving_network = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "servingNetwork"); if (serving_network) { serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); } - cJSON *an_type = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "anType"); - - OpenAPI_access_type_e an_typeVariable; + an_type = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "anType"); if (an_type) { if (!cJSON_IsString(an_type)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [an_type]"); @@ -905,9 +1076,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u an_typeVariable = OpenAPI_access_type_FromString(an_type->valuestring); } - cJSON *additional_an_type = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "additionalAnType"); - - OpenAPI_access_type_e additional_an_typeVariable; + additional_an_type = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "additionalAnType"); if (additional_an_type) { if (!cJSON_IsString(additional_an_type)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [additional_an_type]"); @@ -916,9 +1085,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u additional_an_typeVariable = OpenAPI_access_type_FromString(additional_an_type->valuestring); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [rat_type]"); @@ -927,31 +1094,25 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *add_ue_location = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "addUeLocation"); - - OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + add_ue_location = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "addUeLocation"); if (add_ue_location) { add_ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(add_ue_location); } - cJSON *pause_charging = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "pauseCharging"); - + pause_charging = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "pauseCharging"); if (pause_charging) { if (!cJSON_IsBool(pause_charging)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [pause_charging]"); @@ -959,8 +1120,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *pti = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "pti"); - + pti = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "pti"); if (pti) { if (!cJSON_IsNumber(pti)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [pti]"); @@ -968,129 +1128,119 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "n1SmInfoFromUe"); - - OpenAPI_ref_to_binary_data_t *n1_sm_info_from_ue_local_nonprim = NULL; + n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "n1SmInfoFromUe"); if (n1_sm_info_from_ue) { n1_sm_info_from_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_from_ue); } - cJSON *unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "unknownN1SmInfo"); - - OpenAPI_ref_to_binary_data_t *unknown_n1_sm_info_local_nonprim = NULL; + unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "unknownN1SmInfo"); if (unknown_n1_sm_info) { unknown_n1_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(unknown_n1_sm_info); } - cJSON *qos_flows_rel_notify_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "qosFlowsRelNotifyList"); - - OpenAPI_list_t *qos_flows_rel_notify_listList; + qos_flows_rel_notify_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "qosFlowsRelNotifyList"); if (qos_flows_rel_notify_list) { - cJSON *qos_flows_rel_notify_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_rel_notify_list)){ - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [qos_flows_rel_notify_list]"); - goto end; - } - - qos_flows_rel_notify_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_rel_notify_list_local_nonprimitive, qos_flows_rel_notify_list ) { - if (!cJSON_IsObject(qos_flows_rel_notify_list_local_nonprimitive)) { + cJSON *qos_flows_rel_notify_list_local = NULL; + if (!cJSON_IsArray(qos_flows_rel_notify_list)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [qos_flows_rel_notify_list]"); goto end; } - OpenAPI_qos_flow_item_t *qos_flows_rel_notify_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_rel_notify_list_local_nonprimitive); - if (!qos_flows_rel_notify_listItem) { - ogs_error("No qos_flows_rel_notify_listItem"); - OpenAPI_list_free(qos_flows_rel_notify_listList); - goto end; + qos_flows_rel_notify_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_rel_notify_list_local, qos_flows_rel_notify_list) { + if (!cJSON_IsObject(qos_flows_rel_notify_list_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [qos_flows_rel_notify_list]"); + goto end; + } + OpenAPI_qos_flow_item_t *qos_flows_rel_notify_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_rel_notify_list_local); + if (!qos_flows_rel_notify_listItem) { + ogs_error("No qos_flows_rel_notify_listItem"); + OpenAPI_list_free(qos_flows_rel_notify_listList); + goto end; + } + OpenAPI_list_add(qos_flows_rel_notify_listList, qos_flows_rel_notify_listItem); } - - OpenAPI_list_add(qos_flows_rel_notify_listList, qos_flows_rel_notify_listItem); - } } - cJSON *qos_flows_notify_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "qosFlowsNotifyList"); - - OpenAPI_list_t *qos_flows_notify_listList; + qos_flows_notify_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "qosFlowsNotifyList"); if (qos_flows_notify_list) { - cJSON *qos_flows_notify_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_notify_list)){ - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [qos_flows_notify_list]"); - goto end; - } - - qos_flows_notify_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_notify_list_local_nonprimitive, qos_flows_notify_list ) { - if (!cJSON_IsObject(qos_flows_notify_list_local_nonprimitive)) { + cJSON *qos_flows_notify_list_local = NULL; + if (!cJSON_IsArray(qos_flows_notify_list)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [qos_flows_notify_list]"); goto end; } - OpenAPI_qos_flow_notify_item_t *qos_flows_notify_listItem = OpenAPI_qos_flow_notify_item_parseFromJSON(qos_flows_notify_list_local_nonprimitive); - if (!qos_flows_notify_listItem) { - ogs_error("No qos_flows_notify_listItem"); - OpenAPI_list_free(qos_flows_notify_listList); - goto end; + qos_flows_notify_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_notify_list_local, qos_flows_notify_list) { + if (!cJSON_IsObject(qos_flows_notify_list_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [qos_flows_notify_list]"); + goto end; + } + OpenAPI_qos_flow_notify_item_t *qos_flows_notify_listItem = OpenAPI_qos_flow_notify_item_parseFromJSON(qos_flows_notify_list_local); + if (!qos_flows_notify_listItem) { + ogs_error("No qos_flows_notify_listItem"); + OpenAPI_list_free(qos_flows_notify_listList); + goto end; + } + OpenAPI_list_add(qos_flows_notify_listList, qos_flows_notify_listItem); } - - OpenAPI_list_add(qos_flows_notify_listList, qos_flows_notify_listItem); - } } - cJSON *notify_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "NotifyList"); - - OpenAPI_list_t *notify_listList; + notify_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "NotifyList"); if (notify_list) { - cJSON *notify_list_local_nonprimitive; - if (!cJSON_IsArray(notify_list)){ - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [notify_list]"); - goto end; - } - - notify_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(notify_list_local_nonprimitive, notify_list ) { - if (!cJSON_IsObject(notify_list_local_nonprimitive)) { + cJSON *notify_list_local = NULL; + if (!cJSON_IsArray(notify_list)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [notify_list]"); goto end; } - OpenAPI_pdu_session_notify_item_t *notify_listItem = OpenAPI_pdu_session_notify_item_parseFromJSON(notify_list_local_nonprimitive); - if (!notify_listItem) { - ogs_error("No notify_listItem"); - OpenAPI_list_free(notify_listList); + notify_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notify_list_local, notify_list) { + if (!cJSON_IsObject(notify_list_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [notify_list]"); + goto end; + } + OpenAPI_pdu_session_notify_item_t *notify_listItem = OpenAPI_pdu_session_notify_item_parseFromJSON(notify_list_local); + if (!notify_listItem) { + ogs_error("No notify_listItem"); + OpenAPI_list_free(notify_listList); + goto end; + } + OpenAPI_list_add(notify_listList, notify_listItem); + } + } + + eps_bearer_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "epsBearerId"); + if (eps_bearer_id) { + cJSON *eps_bearer_id_local = NULL; + if (!cJSON_IsArray(eps_bearer_id)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [eps_bearer_id]"); goto end; } - OpenAPI_list_add(notify_listList, notify_listItem); - } + eps_bearer_idList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eps_bearer_id_local, eps_bearer_id) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(eps_bearer_id_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [eps_bearer_id]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [eps_bearer_id]"); + goto end; + } + *localDouble = eps_bearer_id_local->valuedouble; + OpenAPI_list_add(eps_bearer_idList, localDouble); + } } - cJSON *eps_bearer_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "epsBearerId"); - - OpenAPI_list_t *eps_bearer_idList; - if (eps_bearer_id) { - cJSON *eps_bearer_id_local; - if (!cJSON_IsArray(eps_bearer_id)) { - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [eps_bearer_id]"); - goto end; - } - eps_bearer_idList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eps_bearer_id_local, eps_bearer_id) { - if (!cJSON_IsNumber(eps_bearer_id_local)) { - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [eps_bearer_id]"); - goto end; - } - OpenAPI_list_add(eps_bearer_idList, &eps_bearer_id_local->valuedouble); - } - } - - cJSON *ho_preparation_indication = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "hoPreparationIndication"); - + ho_preparation_indication = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "hoPreparationIndication"); if (ho_preparation_indication) { if (!cJSON_IsBool(ho_preparation_indication)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [ho_preparation_indication]"); @@ -1098,29 +1248,34 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *revoke_ebi_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "revokeEbiList"); - - OpenAPI_list_t *revoke_ebi_listList; + revoke_ebi_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "revokeEbiList"); if (revoke_ebi_list) { - cJSON *revoke_ebi_list_local; - if (!cJSON_IsArray(revoke_ebi_list)) { - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); - goto end; - } - revoke_ebi_listList = OpenAPI_list_create(); + cJSON *revoke_ebi_list_local = NULL; + if (!cJSON_IsArray(revoke_ebi_list)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); + goto end; + } - cJSON_ArrayForEach(revoke_ebi_list_local, revoke_ebi_list) { - if (!cJSON_IsNumber(revoke_ebi_list_local)) { - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); - goto end; - } - OpenAPI_list_add(revoke_ebi_listList, &revoke_ebi_list_local->valuedouble); - } + revoke_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(revoke_ebi_list_local, revoke_ebi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(revoke_ebi_list_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); + goto end; + } + *localDouble = revoke_ebi_list_local->valuedouble; + OpenAPI_list_add(revoke_ebi_listList, localDouble); + } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "cause"); - - OpenAPI_cause_e causeVariable; + cause = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "cause"); if (cause) { if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [cause]"); @@ -1129,15 +1284,12 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u causeVariable = OpenAPI_cause_FromString(cause->valuestring); } - cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ngApCause"); - - OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + ng_ap_cause = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ngApCause"); if (ng_ap_cause) { ng_ap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ng_ap_cause); } - cJSON *_5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "5gMmCauseValue"); - + _5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "5gMmCauseValue"); if (_5g_mm_cause_value) { if (!cJSON_IsNumber(_5g_mm_cause_value)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [_5g_mm_cause_value]"); @@ -1145,8 +1297,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *always_on_requested = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "alwaysOnRequested"); - + always_on_requested = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "alwaysOnRequested"); if (always_on_requested) { if (!cJSON_IsBool(always_on_requested)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [always_on_requested]"); @@ -1154,9 +1305,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "epsInterworkingInd"); - - OpenAPI_eps_interworking_indication_e eps_interworking_indVariable; + eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "epsInterworkingInd"); if (eps_interworking_ind) { if (!cJSON_IsString(eps_interworking_ind)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [eps_interworking_ind]"); @@ -1165,66 +1314,57 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u eps_interworking_indVariable = OpenAPI_eps_interworking_indication_FromString(eps_interworking_ind->valuestring); } - cJSON *secondary_rat_usage_report = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "secondaryRatUsageReport"); - - OpenAPI_list_t *secondary_rat_usage_reportList; + secondary_rat_usage_report = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "secondaryRatUsageReport"); if (secondary_rat_usage_report) { - cJSON *secondary_rat_usage_report_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_usage_report)){ - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [secondary_rat_usage_report]"); - goto end; - } - - secondary_rat_usage_reportList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_usage_report_local_nonprimitive, secondary_rat_usage_report ) { - if (!cJSON_IsObject(secondary_rat_usage_report_local_nonprimitive)) { + cJSON *secondary_rat_usage_report_local = NULL; + if (!cJSON_IsArray(secondary_rat_usage_report)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [secondary_rat_usage_report]"); goto end; } - OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_reportItem = OpenAPI_secondary_rat_usage_report_parseFromJSON(secondary_rat_usage_report_local_nonprimitive); - if (!secondary_rat_usage_reportItem) { - ogs_error("No secondary_rat_usage_reportItem"); - OpenAPI_list_free(secondary_rat_usage_reportList); - goto end; + secondary_rat_usage_reportList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_usage_report_local, secondary_rat_usage_report) { + if (!cJSON_IsObject(secondary_rat_usage_report_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [secondary_rat_usage_report]"); + goto end; + } + OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_reportItem = OpenAPI_secondary_rat_usage_report_parseFromJSON(secondary_rat_usage_report_local); + if (!secondary_rat_usage_reportItem) { + ogs_error("No secondary_rat_usage_reportItem"); + OpenAPI_list_free(secondary_rat_usage_reportList); + goto end; + } + OpenAPI_list_add(secondary_rat_usage_reportList, secondary_rat_usage_reportItem); } - - OpenAPI_list_add(secondary_rat_usage_reportList, secondary_rat_usage_reportItem); - } } - cJSON *secondary_rat_usage_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "secondaryRatUsageInfo"); - - OpenAPI_list_t *secondary_rat_usage_infoList; + secondary_rat_usage_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "secondaryRatUsageInfo"); if (secondary_rat_usage_info) { - cJSON *secondary_rat_usage_info_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_usage_info)){ - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [secondary_rat_usage_info]"); - goto end; - } - - secondary_rat_usage_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_usage_info_local_nonprimitive, secondary_rat_usage_info ) { - if (!cJSON_IsObject(secondary_rat_usage_info_local_nonprimitive)) { + cJSON *secondary_rat_usage_info_local = NULL; + if (!cJSON_IsArray(secondary_rat_usage_info)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [secondary_rat_usage_info]"); goto end; } - OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_infoItem = OpenAPI_secondary_rat_usage_info_parseFromJSON(secondary_rat_usage_info_local_nonprimitive); - if (!secondary_rat_usage_infoItem) { - ogs_error("No secondary_rat_usage_infoItem"); - OpenAPI_list_free(secondary_rat_usage_infoList); - goto end; + secondary_rat_usage_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_usage_info_local, secondary_rat_usage_info) { + if (!cJSON_IsObject(secondary_rat_usage_info_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [secondary_rat_usage_info]"); + goto end; + } + OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_infoItem = OpenAPI_secondary_rat_usage_info_parseFromJSON(secondary_rat_usage_info_local); + if (!secondary_rat_usage_infoItem) { + ogs_error("No secondary_rat_usage_infoItem"); + OpenAPI_list_free(secondary_rat_usage_infoList); + goto end; + } + OpenAPI_list_add(secondary_rat_usage_infoList, secondary_rat_usage_infoItem); } - - OpenAPI_list_add(secondary_rat_usage_infoList, secondary_rat_usage_infoItem); - } } - cJSON *an_type_can_be_changed = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "anTypeCanBeChanged"); - + an_type_can_be_changed = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "anTypeCanBeChanged"); if (an_type_can_be_changed) { if (!cJSON_IsBool(an_type_can_be_changed)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [an_type_can_be_changed]"); @@ -1232,9 +1372,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *ma_release_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "maReleaseInd"); - - OpenAPI_ma_release_indication_e ma_release_indVariable; + ma_release_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "maReleaseInd"); if (ma_release_ind) { if (!cJSON_IsString(ma_release_ind)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [ma_release_ind]"); @@ -1243,8 +1381,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u ma_release_indVariable = OpenAPI_ma_release_indication_FromString(ma_release_ind->valuestring); } - cJSON *ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "maNwUpgradeInd"); - + ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "maNwUpgradeInd"); if (ma_nw_upgrade_ind) { if (!cJSON_IsBool(ma_nw_upgrade_ind)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [ma_nw_upgrade_ind]"); @@ -1252,8 +1389,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *ma_request_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "maRequestInd"); - + ma_request_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "maRequestInd"); if (ma_request_ind) { if (!cJSON_IsBool(ma_request_ind)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [ma_request_ind]"); @@ -1261,9 +1397,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *unavailable_access_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "unavailableAccessInd"); - - OpenAPI_unavailable_access_indication_e unavailable_access_indVariable; + unavailable_access_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "unavailableAccessInd"); if (unavailable_access_ind) { if (!cJSON_IsString(unavailable_access_ind)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [unavailable_access_ind]"); @@ -1272,66 +1406,52 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u unavailable_access_indVariable = OpenAPI_unavailable_access_indication_FromString(unavailable_access_ind->valuestring); } - cJSON *psa_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "psaInfo"); - - OpenAPI_list_t *psa_infoList; + psa_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "psaInfo"); if (psa_info) { - cJSON *psa_info_local_nonprimitive; - if (!cJSON_IsArray(psa_info)){ - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [psa_info]"); - goto end; - } - - psa_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(psa_info_local_nonprimitive, psa_info ) { - if (!cJSON_IsObject(psa_info_local_nonprimitive)) { + cJSON *psa_info_local = NULL; + if (!cJSON_IsArray(psa_info)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [psa_info]"); goto end; } - OpenAPI_psa_information_t *psa_infoItem = OpenAPI_psa_information_parseFromJSON(psa_info_local_nonprimitive); - if (!psa_infoItem) { - ogs_error("No psa_infoItem"); - OpenAPI_list_free(psa_infoList); - goto end; + psa_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(psa_info_local, psa_info) { + if (!cJSON_IsObject(psa_info_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [psa_info]"); + goto end; + } + OpenAPI_psa_information_t *psa_infoItem = OpenAPI_psa_information_parseFromJSON(psa_info_local); + if (!psa_infoItem) { + ogs_error("No psa_infoItem"); + OpenAPI_list_free(psa_infoList); + goto end; + } + OpenAPI_list_add(psa_infoList, psa_infoItem); } - - OpenAPI_list_add(psa_infoList, psa_infoItem); - } } - cJSON *ulcl_bp_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ulclBpInfo"); - - OpenAPI_ulcl_bp_information_t *ulcl_bp_info_local_nonprim = NULL; + ulcl_bp_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ulclBpInfo"); if (ulcl_bp_info) { ulcl_bp_info_local_nonprim = OpenAPI_ulcl_bp_information_parseFromJSON(ulcl_bp_info); } - cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "n4Info"); - - OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + n4_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "n4Info"); if (n4_info) { n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info); } - cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "n4InfoExt1"); - - OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "n4InfoExt1"); if (n4_info_ext1) { n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1); } - cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "n4InfoExt2"); - - OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "n4InfoExt2"); if (n4_info_ext2) { n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2); } - cJSON *presence_in_ladn = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "presenceInLadn"); - - OpenAPI_presence_state_e presence_in_ladnVariable; + presence_in_ladn = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "presenceInLadn"); if (presence_in_ladn) { if (!cJSON_IsString(presence_in_ladn)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [presence_in_ladn]"); @@ -1340,62 +1460,55 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u presence_in_ladnVariable = OpenAPI_presence_state_FromString(presence_in_ladn->valuestring); } - cJSON *vsmf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vsmfPduSessionUri"); - + vsmf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vsmfPduSessionUri"); if (vsmf_pdu_session_uri) { - if (!cJSON_IsString(vsmf_pdu_session_uri)) { + if (!cJSON_IsString(vsmf_pdu_session_uri) && !cJSON_IsNull(vsmf_pdu_session_uri)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [vsmf_pdu_session_uri]"); goto end; } } - cJSON *vsmf_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vsmfId"); - + vsmf_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vsmfId"); if (vsmf_id) { - if (!cJSON_IsString(vsmf_id)) { + if (!cJSON_IsString(vsmf_id) && !cJSON_IsNull(vsmf_id)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [vsmf_id]"); goto end; } } - cJSON *v_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vSmfServiceInstanceId"); - + v_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vSmfServiceInstanceId"); if (v_smf_service_instance_id) { - if (!cJSON_IsString(v_smf_service_instance_id)) { + if (!cJSON_IsString(v_smf_service_instance_id) && !cJSON_IsNull(v_smf_service_instance_id)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [v_smf_service_instance_id]"); goto end; } } - cJSON *ismf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ismfPduSessionUri"); - + ismf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ismfPduSessionUri"); if (ismf_pdu_session_uri) { - if (!cJSON_IsString(ismf_pdu_session_uri)) { + if (!cJSON_IsString(ismf_pdu_session_uri) && !cJSON_IsNull(ismf_pdu_session_uri)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [ismf_pdu_session_uri]"); goto end; } } - cJSON *ismf_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ismfId"); - + ismf_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ismfId"); if (ismf_id) { - if (!cJSON_IsString(ismf_id)) { + if (!cJSON_IsString(ismf_id) && !cJSON_IsNull(ismf_id)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [ismf_id]"); goto end; } } - cJSON *i_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "iSmfServiceInstanceId"); - + i_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "iSmfServiceInstanceId"); if (i_smf_service_instance_id) { - if (!cJSON_IsString(i_smf_service_instance_id)) { + if (!cJSON_IsString(i_smf_service_instance_id) && !cJSON_IsNull(i_smf_service_instance_id)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [i_smf_service_instance_id]"); goto end; } } - cJSON *dl_serving_plmn_rate_ctl = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "dlServingPlmnRateCtl"); - + dl_serving_plmn_rate_ctl = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "dlServingPlmnRateCtl"); if (dl_serving_plmn_rate_ctl) { if (!cJSON_IsNumber(dl_serving_plmn_rate_ctl)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [dl_serving_plmn_rate_ctl]"); @@ -1403,89 +1516,76 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u } } - cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "dnaiList"); - - OpenAPI_list_t *dnai_listList; + dnai_list = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "dnaiList"); if (dnai_list) { - cJSON *dnai_list_local; - if (!cJSON_IsArray(dnai_list)) { - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - dnai_listList = OpenAPI_list_create(); + cJSON *dnai_list_local = NULL; + if (!cJSON_IsArray(dnai_list)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [dnai_list]"); + goto end; + } - cJSON_ArrayForEach(dnai_list_local, dnai_list) { - if (!cJSON_IsString(dnai_list_local)) { - ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); - } + dnai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnai_list_local, dnai_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnai_list_local)) { + ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [dnai_list]"); + goto end; + } + OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); + } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "roamingChargingProfile"); - - OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "roamingChargingProfile"); if (roaming_charging_profile) { roaming_charging_profile_local_nonprim = OpenAPI_roaming_charging_profile_parseFromJSON(roaming_charging_profile); } - cJSON *mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "moExpDataCounter"); - - OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "moExpDataCounter"); if (mo_exp_data_counter) { mo_exp_data_counter_local_nonprim = OpenAPI_mo_exp_data_counter_parseFromJSON(mo_exp_data_counter); } - cJSON *vplmn_qos = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vplmnQos"); - - OpenAPI_vplmn_qos_t *vplmn_qos_local_nonprim = NULL; + vplmn_qos = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "vplmnQos"); if (vplmn_qos) { vplmn_qos_local_nonprim = OpenAPI_vplmn_qos_parseFromJSON(vplmn_qos); } - cJSON *security_result = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "securityResult"); - - OpenAPI_security_result_t *security_result_local_nonprim = NULL; + security_result = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "securityResult"); if (security_result) { security_result_local_nonprim = OpenAPI_security_result_parseFromJSON(security_result); } - cJSON *up_security_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "upSecurityInfo"); - - OpenAPI_up_security_info_t *up_security_info_local_nonprim = NULL; + up_security_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "upSecurityInfo"); if (up_security_info) { up_security_info_local_nonprim = OpenAPI_up_security_info_parseFromJSON(up_security_info); } - cJSON *amf_nf_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "amfNfId"); - + amf_nf_id = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "amfNfId"); if (amf_nf_id) { - if (!cJSON_IsString(amf_nf_id)) { + if (!cJSON_IsString(amf_nf_id) && !cJSON_IsNull(amf_nf_id)) { ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [amf_nf_id]"); goto end; } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } hsmf_update_data_local_var = OpenAPI_hsmf_update_data_create ( request_indicationVariable, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, vcn_tunnel_info ? vcn_tunnel_info_local_nonprim : NULL, icn_tunnel_info ? icn_tunnel_info_local_nonprim : NULL, additional_cn_tunnel_info ? additional_cn_tunnel_info_local_nonprim : NULL, @@ -1494,7 +1594,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u additional_an_type ? additional_an_typeVariable : 0, rat_type ? rat_typeVariable : 0, ue_location ? ue_location_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, add_ue_location ? add_ue_location_local_nonprim : NULL, pause_charging ? true : false, pause_charging ? pause_charging->valueint : 0, @@ -1532,27 +1632,166 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u n4_info_ext1 ? n4_info_ext1_local_nonprim : NULL, n4_info_ext2 ? n4_info_ext2_local_nonprim : NULL, presence_in_ladn ? presence_in_ladnVariable : 0, - vsmf_pdu_session_uri ? ogs_strdup(vsmf_pdu_session_uri->valuestring) : NULL, - vsmf_id ? ogs_strdup(vsmf_id->valuestring) : NULL, - v_smf_service_instance_id ? ogs_strdup(v_smf_service_instance_id->valuestring) : NULL, - ismf_pdu_session_uri ? ogs_strdup(ismf_pdu_session_uri->valuestring) : NULL, - ismf_id ? ogs_strdup(ismf_id->valuestring) : NULL, - i_smf_service_instance_id ? ogs_strdup(i_smf_service_instance_id->valuestring) : NULL, + vsmf_pdu_session_uri && !cJSON_IsNull(vsmf_pdu_session_uri) ? ogs_strdup(vsmf_pdu_session_uri->valuestring) : NULL, + vsmf_id && !cJSON_IsNull(vsmf_id) ? ogs_strdup(vsmf_id->valuestring) : NULL, + v_smf_service_instance_id && !cJSON_IsNull(v_smf_service_instance_id) ? ogs_strdup(v_smf_service_instance_id->valuestring) : NULL, + ismf_pdu_session_uri && !cJSON_IsNull(ismf_pdu_session_uri) ? ogs_strdup(ismf_pdu_session_uri->valuestring) : NULL, + ismf_id && !cJSON_IsNull(ismf_id) ? ogs_strdup(ismf_id->valuestring) : NULL, + i_smf_service_instance_id && !cJSON_IsNull(i_smf_service_instance_id) ? ogs_strdup(i_smf_service_instance_id->valuestring) : NULL, dl_serving_plmn_rate_ctl ? true : false, dl_serving_plmn_rate_ctl ? dl_serving_plmn_rate_ctl->valuedouble : 0, dnai_list ? dnai_listList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, roaming_charging_profile ? roaming_charging_profile_local_nonprim : NULL, mo_exp_data_counter ? mo_exp_data_counter_local_nonprim : NULL, vplmn_qos ? vplmn_qos_local_nonprim : NULL, security_result ? security_result_local_nonprim : NULL, up_security_info ? up_security_info_local_nonprim : NULL, - amf_nf_id ? ogs_strdup(amf_nf_id->valuestring) : NULL, + amf_nf_id && !cJSON_IsNull(amf_nf_id) ? ogs_strdup(amf_nf_id->valuestring) : NULL, guami ? guami_local_nonprim : NULL ); return hsmf_update_data_local_var; end: + if (vcn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(vcn_tunnel_info_local_nonprim); + vcn_tunnel_info_local_nonprim = NULL; + } + if (icn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(icn_tunnel_info_local_nonprim); + icn_tunnel_info_local_nonprim = NULL; + } + if (additional_cn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(additional_cn_tunnel_info_local_nonprim); + additional_cn_tunnel_info_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } + if (add_ue_location_local_nonprim) { + OpenAPI_user_location_free(add_ue_location_local_nonprim); + add_ue_location_local_nonprim = NULL; + } + if (n1_sm_info_from_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_from_ue_local_nonprim); + n1_sm_info_from_ue_local_nonprim = NULL; + } + if (unknown_n1_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(unknown_n1_sm_info_local_nonprim); + unknown_n1_sm_info_local_nonprim = NULL; + } + if (qos_flows_rel_notify_listList) { + OpenAPI_list_for_each(qos_flows_rel_notify_listList, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(qos_flows_rel_notify_listList); + qos_flows_rel_notify_listList = NULL; + } + if (qos_flows_notify_listList) { + OpenAPI_list_for_each(qos_flows_notify_listList, node) { + OpenAPI_qos_flow_notify_item_free(node->data); + } + OpenAPI_list_free(qos_flows_notify_listList); + qos_flows_notify_listList = NULL; + } + if (notify_listList) { + OpenAPI_list_for_each(notify_listList, node) { + OpenAPI_pdu_session_notify_item_free(node->data); + } + OpenAPI_list_free(notify_listList); + notify_listList = NULL; + } + if (eps_bearer_idList) { + OpenAPI_list_for_each(eps_bearer_idList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(eps_bearer_idList); + eps_bearer_idList = NULL; + } + if (revoke_ebi_listList) { + OpenAPI_list_for_each(revoke_ebi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(revoke_ebi_listList); + revoke_ebi_listList = NULL; + } + if (ng_ap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ng_ap_cause_local_nonprim); + ng_ap_cause_local_nonprim = NULL; + } + if (secondary_rat_usage_reportList) { + OpenAPI_list_for_each(secondary_rat_usage_reportList, node) { + OpenAPI_secondary_rat_usage_report_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_reportList); + secondary_rat_usage_reportList = NULL; + } + if (secondary_rat_usage_infoList) { + OpenAPI_list_for_each(secondary_rat_usage_infoList, node) { + OpenAPI_secondary_rat_usage_info_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_infoList); + secondary_rat_usage_infoList = NULL; + } + if (psa_infoList) { + OpenAPI_list_for_each(psa_infoList, node) { + OpenAPI_psa_information_free(node->data); + } + OpenAPI_list_free(psa_infoList); + psa_infoList = NULL; + } + if (ulcl_bp_info_local_nonprim) { + OpenAPI_ulcl_bp_information_free(ulcl_bp_info_local_nonprim); + ulcl_bp_info_local_nonprim = NULL; + } + if (n4_info_local_nonprim) { + OpenAPI_n4_information_free(n4_info_local_nonprim); + n4_info_local_nonprim = NULL; + } + if (n4_info_ext1_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext1_local_nonprim); + n4_info_ext1_local_nonprim = NULL; + } + if (n4_info_ext2_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext2_local_nonprim); + n4_info_ext2_local_nonprim = NULL; + } + if (dnai_listList) { + OpenAPI_list_for_each(dnai_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnai_listList); + dnai_listList = NULL; + } + if (roaming_charging_profile_local_nonprim) { + OpenAPI_roaming_charging_profile_free(roaming_charging_profile_local_nonprim); + roaming_charging_profile_local_nonprim = NULL; + } + if (mo_exp_data_counter_local_nonprim) { + OpenAPI_mo_exp_data_counter_free(mo_exp_data_counter_local_nonprim); + mo_exp_data_counter_local_nonprim = NULL; + } + if (vplmn_qos_local_nonprim) { + OpenAPI_vplmn_qos_free(vplmn_qos_local_nonprim); + vplmn_qos_local_nonprim = NULL; + } + if (security_result_local_nonprim) { + OpenAPI_security_result_free(security_result_local_nonprim); + security_result_local_nonprim = NULL; + } + if (up_security_info_local_nonprim) { + OpenAPI_up_security_info_free(up_security_info_local_nonprim); + up_security_info_local_nonprim = NULL; + } + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/hsmf_update_error.c b/lib/sbi/openapi/model/hsmf_update_error.c index 4c76caa51..01693fc6b 100644 --- a/lib/sbi/openapi/model/hsmf_update_error.c +++ b/lib/sbi/openapi/model/hsmf_update_error.c @@ -32,20 +32,34 @@ OpenAPI_hsmf_update_error_t *OpenAPI_hsmf_update_error_create( void OpenAPI_hsmf_update_error_free(OpenAPI_hsmf_update_error_t *hsmf_update_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == hsmf_update_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_problem_details_free(hsmf_update_error->error); - ogs_free(hsmf_update_error->n1sm_cause); - OpenAPI_ref_to_binary_data_free(hsmf_update_error->n1_sm_info_to_ue); - ogs_free(hsmf_update_error->recovery_time); + if (hsmf_update_error->error) { + OpenAPI_problem_details_free(hsmf_update_error->error); + hsmf_update_error->error = NULL; + } + if (hsmf_update_error->n1sm_cause) { + ogs_free(hsmf_update_error->n1sm_cause); + hsmf_update_error->n1sm_cause = NULL; + } + if (hsmf_update_error->n1_sm_info_to_ue) { + OpenAPI_ref_to_binary_data_free(hsmf_update_error->n1_sm_info_to_ue); + hsmf_update_error->n1_sm_info_to_ue = NULL; + } + if (hsmf_update_error->recovery_time) { + ogs_free(hsmf_update_error->recovery_time); + hsmf_update_error->recovery_time = NULL; + } ogs_free(hsmf_update_error); } cJSON *OpenAPI_hsmf_update_error_convertToJSON(OpenAPI_hsmf_update_error_t *hsmf_update_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (hsmf_update_error == NULL) { ogs_error("OpenAPI_hsmf_update_error_convertToJSON() failed [HsmfUpdateError]"); @@ -53,6 +67,10 @@ cJSON *OpenAPI_hsmf_update_error_convertToJSON(OpenAPI_hsmf_update_error_t *hsmf } item = cJSON_CreateObject(); + if (!hsmf_update_error->error) { + ogs_error("OpenAPI_hsmf_update_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(hsmf_update_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_hsmf_update_error_convertToJSON() failed [error]"); @@ -112,17 +130,23 @@ end: OpenAPI_hsmf_update_error_t *OpenAPI_hsmf_update_error_parseFromJSON(cJSON *hsmf_update_errorJSON) { OpenAPI_hsmf_update_error_t *hsmf_update_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_problem_details_t *error_local_nonprim = NULL; + cJSON *pti = NULL; + cJSON *n1sm_cause = NULL; + cJSON *n1_sm_info_to_ue = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + cJSON *back_off_timer = NULL; + cJSON *recovery_time = NULL; + error = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_hsmf_update_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error); - cJSON *pti = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "pti"); - + pti = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "pti"); if (pti) { if (!cJSON_IsNumber(pti)) { ogs_error("OpenAPI_hsmf_update_error_parseFromJSON() failed [pti]"); @@ -130,24 +154,20 @@ OpenAPI_hsmf_update_error_t *OpenAPI_hsmf_update_error_parseFromJSON(cJSON *hsmf } } - cJSON *n1sm_cause = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "n1smCause"); - + n1sm_cause = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "n1smCause"); if (n1sm_cause) { - if (!cJSON_IsString(n1sm_cause)) { + if (!cJSON_IsString(n1sm_cause) && !cJSON_IsNull(n1sm_cause)) { ogs_error("OpenAPI_hsmf_update_error_parseFromJSON() failed [n1sm_cause]"); goto end; } } - cJSON *n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "n1SmInfoToUe"); - - OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "n1SmInfoToUe"); if (n1_sm_info_to_ue) { n1_sm_info_to_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_to_ue); } - cJSON *back_off_timer = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "backOffTimer"); - + back_off_timer = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "backOffTimer"); if (back_off_timer) { if (!cJSON_IsNumber(back_off_timer)) { ogs_error("OpenAPI_hsmf_update_error_parseFromJSON() failed [back_off_timer]"); @@ -155,10 +175,9 @@ OpenAPI_hsmf_update_error_t *OpenAPI_hsmf_update_error_parseFromJSON(cJSON *hsmf } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(hsmf_update_errorJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_hsmf_update_error_parseFromJSON() failed [recovery_time]"); goto end; } @@ -168,15 +187,23 @@ OpenAPI_hsmf_update_error_t *OpenAPI_hsmf_update_error_parseFromJSON(cJSON *hsmf error_local_nonprim, pti ? true : false, pti ? pti->valuedouble : 0, - n1sm_cause ? ogs_strdup(n1sm_cause->valuestring) : NULL, + n1sm_cause && !cJSON_IsNull(n1sm_cause) ? ogs_strdup(n1sm_cause->valuestring) : NULL, n1_sm_info_to_ue ? n1_sm_info_to_ue_local_nonprim : NULL, back_off_timer ? true : false, back_off_timer ? back_off_timer->valuedouble : 0, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL ); return hsmf_update_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (n1_sm_info_to_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_to_ue_local_nonprim); + n1_sm_info_to_ue_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/hsmf_updated_data.c b/lib/sbi/openapi/model/hsmf_updated_data.c index e1f8c7b4e..8278623bc 100644 --- a/lib/sbi/openapi/model/hsmf_updated_data.c +++ b/lib/sbi/openapi/model/hsmf_updated_data.c @@ -52,37 +52,75 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_create( void OpenAPI_hsmf_updated_data_free(OpenAPI_hsmf_updated_data_t *hsmf_updated_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == hsmf_updated_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ref_to_binary_data_free(hsmf_updated_data->n1_sm_info_to_ue); - OpenAPI_n4_information_free(hsmf_updated_data->n4_info); - OpenAPI_n4_information_free(hsmf_updated_data->n4_info_ext1); - OpenAPI_n4_information_free(hsmf_updated_data->n4_info_ext2); - OpenAPI_list_for_each(hsmf_updated_data->dnai_list, node) { - ogs_free(node->data); + if (hsmf_updated_data->n1_sm_info_to_ue) { + OpenAPI_ref_to_binary_data_free(hsmf_updated_data->n1_sm_info_to_ue); + hsmf_updated_data->n1_sm_info_to_ue = NULL; } - OpenAPI_list_free(hsmf_updated_data->dnai_list); - ogs_free(hsmf_updated_data->supported_features); - OpenAPI_roaming_charging_profile_free(hsmf_updated_data->roaming_charging_profile); - OpenAPI_up_security_free(hsmf_updated_data->up_security); - OpenAPI_list_for_each(hsmf_updated_data->qos_flows_setup_list, node) { - OpenAPI_qos_flow_setup_item_free(node->data); + if (hsmf_updated_data->n4_info) { + OpenAPI_n4_information_free(hsmf_updated_data->n4_info); + hsmf_updated_data->n4_info = NULL; } - OpenAPI_list_free(hsmf_updated_data->qos_flows_setup_list); - OpenAPI_ambr_free(hsmf_updated_data->session_ambr); - OpenAPI_eps_pdn_cnx_info_free(hsmf_updated_data->eps_pdn_cnx_info); - OpenAPI_list_for_each(hsmf_updated_data->eps_bearer_info, node) { - OpenAPI_eps_bearer_info_free(node->data); + if (hsmf_updated_data->n4_info_ext1) { + OpenAPI_n4_information_free(hsmf_updated_data->n4_info_ext1); + hsmf_updated_data->n4_info_ext1 = NULL; + } + if (hsmf_updated_data->n4_info_ext2) { + OpenAPI_n4_information_free(hsmf_updated_data->n4_info_ext2); + hsmf_updated_data->n4_info_ext2 = NULL; + } + if (hsmf_updated_data->dnai_list) { + OpenAPI_list_for_each(hsmf_updated_data->dnai_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(hsmf_updated_data->dnai_list); + hsmf_updated_data->dnai_list = NULL; + } + if (hsmf_updated_data->supported_features) { + ogs_free(hsmf_updated_data->supported_features); + hsmf_updated_data->supported_features = NULL; + } + if (hsmf_updated_data->roaming_charging_profile) { + OpenAPI_roaming_charging_profile_free(hsmf_updated_data->roaming_charging_profile); + hsmf_updated_data->roaming_charging_profile = NULL; + } + if (hsmf_updated_data->up_security) { + OpenAPI_up_security_free(hsmf_updated_data->up_security); + hsmf_updated_data->up_security = NULL; + } + if (hsmf_updated_data->qos_flows_setup_list) { + OpenAPI_list_for_each(hsmf_updated_data->qos_flows_setup_list, node) { + OpenAPI_qos_flow_setup_item_free(node->data); + } + OpenAPI_list_free(hsmf_updated_data->qos_flows_setup_list); + hsmf_updated_data->qos_flows_setup_list = NULL; + } + if (hsmf_updated_data->session_ambr) { + OpenAPI_ambr_free(hsmf_updated_data->session_ambr); + hsmf_updated_data->session_ambr = NULL; + } + if (hsmf_updated_data->eps_pdn_cnx_info) { + OpenAPI_eps_pdn_cnx_info_free(hsmf_updated_data->eps_pdn_cnx_info); + hsmf_updated_data->eps_pdn_cnx_info = NULL; + } + if (hsmf_updated_data->eps_bearer_info) { + OpenAPI_list_for_each(hsmf_updated_data->eps_bearer_info, node) { + OpenAPI_eps_bearer_info_free(node->data); + } + OpenAPI_list_free(hsmf_updated_data->eps_bearer_info); + hsmf_updated_data->eps_bearer_info = NULL; } - OpenAPI_list_free(hsmf_updated_data->eps_bearer_info); ogs_free(hsmf_updated_data); } cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf_updated_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (hsmf_updated_data == NULL) { ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [HsmfUpdatedData]"); @@ -143,19 +181,17 @@ cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf } if (hsmf_updated_data->dnai_list) { - cJSON *dnai_list = cJSON_AddArrayToObject(item, "dnaiList"); - if (dnai_list == NULL) { + cJSON *dnai_listList = cJSON_AddArrayToObject(item, "dnaiList"); + if (dnai_listList == NULL) { ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [dnai_list]"); goto end; } - - OpenAPI_lnode_t *dnai_list_node; - OpenAPI_list_for_each(hsmf_updated_data->dnai_list, dnai_list_node) { - if (cJSON_AddStringToObject(dnai_list, "", (char*)dnai_list_node->data) == NULL) { - ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [dnai_list]"); - goto end; + OpenAPI_list_for_each(hsmf_updated_data->dnai_list, node) { + if (cJSON_AddStringToObject(dnai_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [dnai_list]"); + goto end; + } } - } } if (hsmf_updated_data->supported_features) { @@ -191,14 +227,14 @@ cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf } } - if (hsmf_updated_data->max_integrity_protected_data_rate_ul) { + if (hsmf_updated_data->max_integrity_protected_data_rate_ul != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateUl", OpenAPI_max_integrity_protected_data_rate_ToString(hsmf_updated_data->max_integrity_protected_data_rate_ul)) == NULL) { ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [max_integrity_protected_data_rate_ul]"); goto end; } } - if (hsmf_updated_data->max_integrity_protected_data_rate_dl) { + if (hsmf_updated_data->max_integrity_protected_data_rate_dl != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateDl", OpenAPI_max_integrity_protected_data_rate_ToString(hsmf_updated_data->max_integrity_protected_data_rate_dl)) == NULL) { ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [max_integrity_protected_data_rate_dl]"); goto end; @@ -218,17 +254,13 @@ cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [qos_flows_setup_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_setup_list_node; - if (hsmf_updated_data->qos_flows_setup_list) { - OpenAPI_list_for_each(hsmf_updated_data->qos_flows_setup_list, qos_flows_setup_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_setup_item_convertToJSON(qos_flows_setup_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [qos_flows_setup_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_setup_listList, itemLocal); + OpenAPI_list_for_each(hsmf_updated_data->qos_flows_setup_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_setup_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [qos_flows_setup_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_setup_listList, itemLocal); } } @@ -264,17 +296,13 @@ cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [eps_bearer_info]"); goto end; } - - OpenAPI_lnode_t *eps_bearer_info_node; - if (hsmf_updated_data->eps_bearer_info) { - OpenAPI_list_for_each(hsmf_updated_data->eps_bearer_info, eps_bearer_info_node) { - cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(eps_bearer_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [eps_bearer_info]"); - goto end; - } - cJSON_AddItemToArray(eps_bearer_infoList, itemLocal); + OpenAPI_list_for_each(hsmf_updated_data->eps_bearer_info, node) { + cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [eps_bearer_info]"); + goto end; } + cJSON_AddItemToArray(eps_bearer_infoList, itemLocal); } } @@ -292,80 +320,96 @@ end: OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf_updated_dataJSON) { OpenAPI_hsmf_updated_data_t *hsmf_updated_data_local_var = NULL; - cJSON *n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n1SmInfoToUe"); - + OpenAPI_lnode_t *node = NULL; + cJSON *n1_sm_info_to_ue = NULL; OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + cJSON *n4_info = NULL; + OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + cJSON *n4_info_ext1 = NULL; + OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + cJSON *n4_info_ext2 = NULL; + OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + cJSON *dnai_list = NULL; + OpenAPI_list_t *dnai_listList = NULL; + cJSON *supported_features = NULL; + cJSON *roaming_charging_profile = NULL; + OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + cJSON *up_security = NULL; + OpenAPI_up_security_t *up_security_local_nonprim = NULL; + cJSON *max_integrity_protected_data_rate_ul = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_ulVariable = 0; + cJSON *max_integrity_protected_data_rate_dl = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable = 0; + cJSON *ipv6_multi_homing_ind = NULL; + cJSON *qos_flows_setup_list = NULL; + OpenAPI_list_t *qos_flows_setup_listList = NULL; + cJSON *session_ambr = NULL; + OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + cJSON *eps_pdn_cnx_info = NULL; + OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_nonprim = NULL; + cJSON *eps_bearer_info = NULL; + OpenAPI_list_t *eps_bearer_infoList = NULL; + cJSON *pti = NULL; + n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n1SmInfoToUe"); if (n1_sm_info_to_ue) { n1_sm_info_to_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_to_ue); } - cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4Info"); - - OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + n4_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4Info"); if (n4_info) { n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info); } - cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4InfoExt1"); - - OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4InfoExt1"); if (n4_info_ext1) { n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1); } - cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4InfoExt2"); - - OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4InfoExt2"); if (n4_info_ext2) { n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2); } - cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "dnaiList"); - - OpenAPI_list_t *dnai_listList; + dnai_list = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "dnaiList"); if (dnai_list) { - cJSON *dnai_list_local; - if (!cJSON_IsArray(dnai_list)) { - ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - dnai_listList = OpenAPI_list_create(); + cJSON *dnai_list_local = NULL; + if (!cJSON_IsArray(dnai_list)) { + ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [dnai_list]"); + goto end; + } - cJSON_ArrayForEach(dnai_list_local, dnai_list) { - if (!cJSON_IsString(dnai_list_local)) { - ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); - } + dnai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnai_list_local, dnai_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnai_list_local)) { + ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [dnai_list]"); + goto end; + } + OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); + } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "roamingChargingProfile"); - - OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "roamingChargingProfile"); if (roaming_charging_profile) { roaming_charging_profile_local_nonprim = OpenAPI_roaming_charging_profile_parseFromJSON(roaming_charging_profile); } - cJSON *up_security = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "upSecurity"); - - OpenAPI_up_security_t *up_security_local_nonprim = NULL; + up_security = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "upSecurity"); if (up_security) { up_security_local_nonprim = OpenAPI_up_security_parseFromJSON(up_security); } - cJSON *max_integrity_protected_data_rate_ul = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "maxIntegrityProtectedDataRateUl"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_ulVariable; + max_integrity_protected_data_rate_ul = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "maxIntegrityProtectedDataRateUl"); if (max_integrity_protected_data_rate_ul) { if (!cJSON_IsString(max_integrity_protected_data_rate_ul)) { ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [max_integrity_protected_data_rate_ul]"); @@ -374,9 +418,7 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf max_integrity_protected_data_rate_ulVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_ul->valuestring); } - cJSON *max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "maxIntegrityProtectedDataRateDl"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable; + max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "maxIntegrityProtectedDataRateDl"); if (max_integrity_protected_data_rate_dl) { if (!cJSON_IsString(max_integrity_protected_data_rate_dl)) { ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [max_integrity_protected_data_rate_dl]"); @@ -385,8 +427,7 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf max_integrity_protected_data_rate_dlVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_dl->valuestring); } - cJSON *ipv6_multi_homing_ind = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "ipv6MultiHomingInd"); - + ipv6_multi_homing_ind = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "ipv6MultiHomingInd"); if (ipv6_multi_homing_ind) { if (!cJSON_IsBool(ipv6_multi_homing_ind)) { ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [ipv6_multi_homing_ind]"); @@ -394,80 +435,67 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf } } - cJSON *qos_flows_setup_list = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "qosFlowsSetupList"); - - OpenAPI_list_t *qos_flows_setup_listList; + qos_flows_setup_list = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "qosFlowsSetupList"); if (qos_flows_setup_list) { - cJSON *qos_flows_setup_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_setup_list)){ - ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [qos_flows_setup_list]"); - goto end; - } - - qos_flows_setup_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_setup_list_local_nonprimitive, qos_flows_setup_list ) { - if (!cJSON_IsObject(qos_flows_setup_list_local_nonprimitive)) { + cJSON *qos_flows_setup_list_local = NULL; + if (!cJSON_IsArray(qos_flows_setup_list)) { ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [qos_flows_setup_list]"); goto end; } - OpenAPI_qos_flow_setup_item_t *qos_flows_setup_listItem = OpenAPI_qos_flow_setup_item_parseFromJSON(qos_flows_setup_list_local_nonprimitive); - if (!qos_flows_setup_listItem) { - ogs_error("No qos_flows_setup_listItem"); - OpenAPI_list_free(qos_flows_setup_listList); - goto end; + qos_flows_setup_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_setup_list_local, qos_flows_setup_list) { + if (!cJSON_IsObject(qos_flows_setup_list_local)) { + ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [qos_flows_setup_list]"); + goto end; + } + OpenAPI_qos_flow_setup_item_t *qos_flows_setup_listItem = OpenAPI_qos_flow_setup_item_parseFromJSON(qos_flows_setup_list_local); + if (!qos_flows_setup_listItem) { + ogs_error("No qos_flows_setup_listItem"); + OpenAPI_list_free(qos_flows_setup_listList); + goto end; + } + OpenAPI_list_add(qos_flows_setup_listList, qos_flows_setup_listItem); } - - OpenAPI_list_add(qos_flows_setup_listList, qos_flows_setup_listItem); - } } - cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "sessionAmbr"); - - OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + session_ambr = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "sessionAmbr"); if (session_ambr) { session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr); } - cJSON *eps_pdn_cnx_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "epsPdnCnxInfo"); - - OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_nonprim = NULL; + eps_pdn_cnx_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "epsPdnCnxInfo"); if (eps_pdn_cnx_info) { eps_pdn_cnx_info_local_nonprim = OpenAPI_eps_pdn_cnx_info_parseFromJSON(eps_pdn_cnx_info); } - cJSON *eps_bearer_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "epsBearerInfo"); - - OpenAPI_list_t *eps_bearer_infoList; + eps_bearer_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "epsBearerInfo"); if (eps_bearer_info) { - cJSON *eps_bearer_info_local_nonprimitive; - if (!cJSON_IsArray(eps_bearer_info)){ - ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [eps_bearer_info]"); - goto end; - } - - eps_bearer_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eps_bearer_info_local_nonprimitive, eps_bearer_info ) { - if (!cJSON_IsObject(eps_bearer_info_local_nonprimitive)) { + cJSON *eps_bearer_info_local = NULL; + if (!cJSON_IsArray(eps_bearer_info)) { ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [eps_bearer_info]"); goto end; } - OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local_nonprimitive); - if (!eps_bearer_infoItem) { - ogs_error("No eps_bearer_infoItem"); - OpenAPI_list_free(eps_bearer_infoList); - goto end; + eps_bearer_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eps_bearer_info_local, eps_bearer_info) { + if (!cJSON_IsObject(eps_bearer_info_local)) { + ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [eps_bearer_info]"); + goto end; + } + OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local); + if (!eps_bearer_infoItem) { + ogs_error("No eps_bearer_infoItem"); + OpenAPI_list_free(eps_bearer_infoList); + goto end; + } + OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem); } - - OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem); - } } - cJSON *pti = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "pti"); - + pti = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "pti"); if (pti) { if (!cJSON_IsNumber(pti)) { ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [pti]"); @@ -481,7 +509,7 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf n4_info_ext1 ? n4_info_ext1_local_nonprim : NULL, n4_info_ext2 ? n4_info_ext2_local_nonprim : NULL, dnai_list ? dnai_listList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, roaming_charging_profile ? roaming_charging_profile_local_nonprim : NULL, up_security ? up_security_local_nonprim : NULL, max_integrity_protected_data_rate_ul ? max_integrity_protected_data_rate_ulVariable : 0, @@ -498,6 +526,59 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf return hsmf_updated_data_local_var; end: + if (n1_sm_info_to_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_to_ue_local_nonprim); + n1_sm_info_to_ue_local_nonprim = NULL; + } + if (n4_info_local_nonprim) { + OpenAPI_n4_information_free(n4_info_local_nonprim); + n4_info_local_nonprim = NULL; + } + if (n4_info_ext1_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext1_local_nonprim); + n4_info_ext1_local_nonprim = NULL; + } + if (n4_info_ext2_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext2_local_nonprim); + n4_info_ext2_local_nonprim = NULL; + } + if (dnai_listList) { + OpenAPI_list_for_each(dnai_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnai_listList); + dnai_listList = NULL; + } + if (roaming_charging_profile_local_nonprim) { + OpenAPI_roaming_charging_profile_free(roaming_charging_profile_local_nonprim); + roaming_charging_profile_local_nonprim = NULL; + } + if (up_security_local_nonprim) { + OpenAPI_up_security_free(up_security_local_nonprim); + up_security_local_nonprim = NULL; + } + if (qos_flows_setup_listList) { + OpenAPI_list_for_each(qos_flows_setup_listList, node) { + OpenAPI_qos_flow_setup_item_free(node->data); + } + OpenAPI_list_free(qos_flows_setup_listList); + qos_flows_setup_listList = NULL; + } + if (session_ambr_local_nonprim) { + OpenAPI_ambr_free(session_ambr_local_nonprim); + session_ambr_local_nonprim = NULL; + } + if (eps_pdn_cnx_info_local_nonprim) { + OpenAPI_eps_pdn_cnx_info_free(eps_pdn_cnx_info_local_nonprim); + eps_pdn_cnx_info_local_nonprim = NULL; + } + if (eps_bearer_infoList) { + OpenAPI_list_for_each(eps_bearer_infoList, node) { + OpenAPI_eps_bearer_info_free(node->data); + } + OpenAPI_list_free(eps_bearer_infoList); + eps_bearer_infoList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/hss_auth_type_in_uri.c b/lib/sbi/openapi/model/hss_auth_type_in_uri.c index 4996a93bf..b4cbb0221 100644 --- a/lib/sbi/openapi/model/hss_auth_type_in_uri.c +++ b/lib/sbi/openapi/model/hss_auth_type_in_uri.c @@ -6,7 +6,7 @@ char* OpenAPI_hss_auth_type_in_uri_ToString(OpenAPI_hss_auth_type_in_uri_e hss_auth_type_in_uri) { - const char *hss_auth_type_in_uriArray[] = { "NULL", "eps_aka", "eap_aka", "eap_aka_prime", "ims_aka", "gba_aka" }; + const char *hss_auth_type_in_uriArray[] = { "NULL", "eps-aka", "eap-aka", "eap-aka-prime", "ims-aka", "gba-aka" }; size_t sizeofArray = sizeof(hss_auth_type_in_uriArray) / sizeof(hss_auth_type_in_uriArray[0]); if (hss_auth_type_in_uri < sizeofArray) return (char *)hss_auth_type_in_uriArray[hss_auth_type_in_uri]; @@ -17,7 +17,7 @@ char* OpenAPI_hss_auth_type_in_uri_ToString(OpenAPI_hss_auth_type_in_uri_e hss_a OpenAPI_hss_auth_type_in_uri_e OpenAPI_hss_auth_type_in_uri_FromString(char* hss_auth_type_in_uri) { int stringToReturn = 0; - const char *hss_auth_type_in_uriArray[] = { "NULL", "eps_aka", "eap_aka", "eap_aka_prime", "ims_aka", "gba_aka" }; + const char *hss_auth_type_in_uriArray[] = { "NULL", "eps-aka", "eap-aka", "eap-aka-prime", "ims-aka", "gba-aka" }; size_t sizeofArray = sizeof(hss_auth_type_in_uriArray) / sizeof(hss_auth_type_in_uriArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(hss_auth_type_in_uri, hss_auth_type_in_uriArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/hss_authentication_info_request.c b/lib/sbi/openapi/model/hss_authentication_info_request.c index e49eddf01..b27553927 100644 --- a/lib/sbi/openapi/model/hss_authentication_info_request.c +++ b/lib/sbi/openapi/model/hss_authentication_info_request.c @@ -30,19 +30,30 @@ OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_reque void OpenAPI_hss_authentication_info_request_free(OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request) { + OpenAPI_lnode_t *node = NULL; + if (NULL == hss_authentication_info_request) { return; } - OpenAPI_lnode_t *node; - ogs_free(hss_authentication_info_request->supported_features); - OpenAPI_plmn_id_free(hss_authentication_info_request->serving_network_id); - OpenAPI_resynchronization_info_free(hss_authentication_info_request->resynchronization_info); + if (hss_authentication_info_request->supported_features) { + ogs_free(hss_authentication_info_request->supported_features); + hss_authentication_info_request->supported_features = NULL; + } + if (hss_authentication_info_request->serving_network_id) { + OpenAPI_plmn_id_free(hss_authentication_info_request->serving_network_id); + hss_authentication_info_request->serving_network_id = NULL; + } + if (hss_authentication_info_request->resynchronization_info) { + OpenAPI_resynchronization_info_free(hss_authentication_info_request->resynchronization_info); + hss_authentication_info_request->resynchronization_info = NULL; + } ogs_free(hss_authentication_info_request); } cJSON *OpenAPI_hss_authentication_info_request_convertToJSON(OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (hss_authentication_info_request == NULL) { ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [HssAuthenticationInfoRequest]"); @@ -57,6 +68,10 @@ cJSON *OpenAPI_hss_authentication_info_request_convertToJSON(OpenAPI_hss_authent } } + if (hss_authentication_info_request->hss_auth_type == OpenAPI_hss_auth_type_NULL) { + ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [hss_auth_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "hssAuthType", OpenAPI_hss_auth_type_ToString(hss_authentication_info_request->hss_auth_type)) == NULL) { ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [hss_auth_type]"); goto end; @@ -67,7 +82,7 @@ cJSON *OpenAPI_hss_authentication_info_request_convertToJSON(OpenAPI_hss_authent goto end; } - if (hss_authentication_info_request->requesting_node_type) { + if (hss_authentication_info_request->requesting_node_type != OpenAPI_node_type_NULL) { if (cJSON_AddStringToObject(item, "requestingNodeType", OpenAPI_node_type_ToString(hss_authentication_info_request->requesting_node_type)) == NULL) { ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [requesting_node_type]"); goto end; @@ -100,7 +115,7 @@ cJSON *OpenAPI_hss_authentication_info_request_convertToJSON(OpenAPI_hss_authent } } - if (hss_authentication_info_request->an_id) { + if (hss_authentication_info_request->an_id != OpenAPI_access_network_id_NULL) { if (cJSON_AddStringToObject(item, "anId", OpenAPI_access_network_id_ToString(hss_authentication_info_request->an_id)) == NULL) { ogs_error("OpenAPI_hss_authentication_info_request_convertToJSON() failed [an_id]"); goto end; @@ -114,42 +129,49 @@ end: OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_request_parseFromJSON(cJSON *hss_authentication_info_requestJSON) { OpenAPI_hss_authentication_info_request_t *hss_authentication_info_request_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *hss_auth_type = NULL; + OpenAPI_hss_auth_type_e hss_auth_typeVariable = 0; + cJSON *num_of_requested_vectors = NULL; + cJSON *requesting_node_type = NULL; + OpenAPI_node_type_e requesting_node_typeVariable = 0; + cJSON *serving_network_id = NULL; + OpenAPI_plmn_id_t *serving_network_id_local_nonprim = NULL; + cJSON *resynchronization_info = NULL; + OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + cJSON *an_id = NULL; + OpenAPI_access_network_id_e an_idVariable = 0; + supported_features = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *hss_auth_type = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "hssAuthType"); + hss_auth_type = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "hssAuthType"); if (!hss_auth_type) { ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [hss_auth_type]"); goto end; } - - OpenAPI_hss_auth_type_e hss_auth_typeVariable; if (!cJSON_IsString(hss_auth_type)) { ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [hss_auth_type]"); goto end; } hss_auth_typeVariable = OpenAPI_hss_auth_type_FromString(hss_auth_type->valuestring); - cJSON *num_of_requested_vectors = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "numOfRequestedVectors"); + num_of_requested_vectors = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "numOfRequestedVectors"); if (!num_of_requested_vectors) { ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [num_of_requested_vectors]"); goto end; } - if (!cJSON_IsNumber(num_of_requested_vectors)) { ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [num_of_requested_vectors]"); goto end; } - cJSON *requesting_node_type = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "requestingNodeType"); - - OpenAPI_node_type_e requesting_node_typeVariable; + requesting_node_type = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "requestingNodeType"); if (requesting_node_type) { if (!cJSON_IsString(requesting_node_type)) { ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [requesting_node_type]"); @@ -158,23 +180,17 @@ OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_reque requesting_node_typeVariable = OpenAPI_node_type_FromString(requesting_node_type->valuestring); } - cJSON *serving_network_id = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "servingNetworkId"); - - OpenAPI_plmn_id_t *serving_network_id_local_nonprim = NULL; + serving_network_id = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "servingNetworkId"); if (serving_network_id) { serving_network_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(serving_network_id); } - cJSON *resynchronization_info = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "resynchronizationInfo"); - - OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL; + resynchronization_info = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "resynchronizationInfo"); if (resynchronization_info) { resynchronization_info_local_nonprim = OpenAPI_resynchronization_info_parseFromJSON(resynchronization_info); } - cJSON *an_id = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "anId"); - - OpenAPI_access_network_id_e an_idVariable; + an_id = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_requestJSON, "anId"); if (an_id) { if (!cJSON_IsString(an_id)) { ogs_error("OpenAPI_hss_authentication_info_request_parseFromJSON() failed [an_id]"); @@ -184,7 +200,7 @@ OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_reque } hss_authentication_info_request_local_var = OpenAPI_hss_authentication_info_request_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, hss_auth_typeVariable, num_of_requested_vectors->valuedouble, @@ -196,6 +212,14 @@ OpenAPI_hss_authentication_info_request_t *OpenAPI_hss_authentication_info_reque return hss_authentication_info_request_local_var; end: + if (serving_network_id_local_nonprim) { + OpenAPI_plmn_id_free(serving_network_id_local_nonprim); + serving_network_id_local_nonprim = NULL; + } + if (resynchronization_info_local_nonprim) { + OpenAPI_resynchronization_info_free(resynchronization_info_local_nonprim); + resynchronization_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/hss_authentication_info_result.c b/lib/sbi/openapi/model/hss_authentication_info_result.c index 70fca9ffa..aa6948ed8 100644 --- a/lib/sbi/openapi/model/hss_authentication_info_result.c +++ b/lib/sbi/openapi/model/hss_authentication_info_result.c @@ -20,18 +20,26 @@ OpenAPI_hss_authentication_info_result_t *OpenAPI_hss_authentication_info_result void OpenAPI_hss_authentication_info_result_free(OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result) { + OpenAPI_lnode_t *node = NULL; + if (NULL == hss_authentication_info_result) { return; } - OpenAPI_lnode_t *node; - ogs_free(hss_authentication_info_result->supported_features); - OpenAPI_hss_authentication_vectors_free(hss_authentication_info_result->hss_authentication_vectors); + if (hss_authentication_info_result->supported_features) { + ogs_free(hss_authentication_info_result->supported_features); + hss_authentication_info_result->supported_features = NULL; + } + if (hss_authentication_info_result->hss_authentication_vectors) { + OpenAPI_hss_authentication_vectors_free(hss_authentication_info_result->hss_authentication_vectors); + hss_authentication_info_result->hss_authentication_vectors = NULL; + } ogs_free(hss_authentication_info_result); } cJSON *OpenAPI_hss_authentication_info_result_convertToJSON(OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (hss_authentication_info_result == NULL) { ogs_error("OpenAPI_hss_authentication_info_result_convertToJSON() failed [HssAuthenticationInfoResult]"); @@ -46,6 +54,10 @@ cJSON *OpenAPI_hss_authentication_info_result_convertToJSON(OpenAPI_hss_authenti } } + if (!hss_authentication_info_result->hss_authentication_vectors) { + ogs_error("OpenAPI_hss_authentication_info_result_convertToJSON() failed [hss_authentication_vectors]"); + return NULL; + } cJSON *hss_authentication_vectors_local_JSON = OpenAPI_hss_authentication_vectors_convertToJSON(hss_authentication_info_result->hss_authentication_vectors); if (hss_authentication_vectors_local_JSON == NULL) { ogs_error("OpenAPI_hss_authentication_info_result_convertToJSON() failed [hss_authentication_vectors]"); @@ -64,31 +76,36 @@ end: OpenAPI_hss_authentication_info_result_t *OpenAPI_hss_authentication_info_result_parseFromJSON(cJSON *hss_authentication_info_resultJSON) { OpenAPI_hss_authentication_info_result_t *hss_authentication_info_result_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_resultJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *hss_authentication_vectors = NULL; + OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors_local_nonprim = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_resultJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_hss_authentication_info_result_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *hss_authentication_vectors = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_resultJSON, "hssAuthenticationVectors"); + hss_authentication_vectors = cJSON_GetObjectItemCaseSensitive(hss_authentication_info_resultJSON, "hssAuthenticationVectors"); if (!hss_authentication_vectors) { ogs_error("OpenAPI_hss_authentication_info_result_parseFromJSON() failed [hss_authentication_vectors]"); goto end; } - - OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors_local_nonprim = NULL; hss_authentication_vectors_local_nonprim = OpenAPI_hss_authentication_vectors_parseFromJSON(hss_authentication_vectors); hss_authentication_info_result_local_var = OpenAPI_hss_authentication_info_result_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, hss_authentication_vectors_local_nonprim ); return hss_authentication_info_result_local_var; end: + if (hss_authentication_vectors_local_nonprim) { + OpenAPI_hss_authentication_vectors_free(hss_authentication_vectors_local_nonprim); + hss_authentication_vectors_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/hss_authentication_vectors.c b/lib/sbi/openapi/model/hss_authentication_vectors.c index c6ce0f122..d9d2b1b2d 100644 --- a/lib/sbi/openapi/model/hss_authentication_vectors.c +++ b/lib/sbi/openapi/model/hss_authentication_vectors.c @@ -16,16 +16,18 @@ OpenAPI_hss_authentication_vectors_t *OpenAPI_hss_authentication_vectors_create( void OpenAPI_hss_authentication_vectors_free(OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors) { + OpenAPI_lnode_t *node = NULL; + if (NULL == hss_authentication_vectors) { return; } - OpenAPI_lnode_t *node; ogs_free(hss_authentication_vectors); } cJSON *OpenAPI_hss_authentication_vectors_convertToJSON(OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (hss_authentication_vectors == NULL) { ogs_error("OpenAPI_hss_authentication_vectors_convertToJSON() failed [HssAuthenticationVectors]"); @@ -40,6 +42,7 @@ end: OpenAPI_hss_authentication_vectors_t *OpenAPI_hss_authentication_vectors_parseFromJSON(cJSON *hss_authentication_vectorsJSON) { OpenAPI_hss_authentication_vectors_t *hss_authentication_vectors_local_var = NULL; + OpenAPI_lnode_t *node = NULL; hss_authentication_vectors_local_var = OpenAPI_hss_authentication_vectors_create ( ); diff --git a/lib/sbi/openapi/model/hss_info.c b/lib/sbi/openapi/model/hss_info.c index 7541ee4c8..91781fa95 100644 --- a/lib/sbi/openapi/model/hss_info.c +++ b/lib/sbi/openapi/model/hss_info.c @@ -26,33 +26,50 @@ OpenAPI_hss_info_t *OpenAPI_hss_info_create( void OpenAPI_hss_info_free(OpenAPI_hss_info_t *hss_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == hss_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(hss_info->group_id); - OpenAPI_list_for_each(hss_info->imsi_ranges, node) { - OpenAPI_imsi_range_free(node->data); + if (hss_info->group_id) { + ogs_free(hss_info->group_id); + hss_info->group_id = NULL; } - OpenAPI_list_free(hss_info->imsi_ranges); - OpenAPI_list_for_each(hss_info->ims_private_identity_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (hss_info->imsi_ranges) { + OpenAPI_list_for_each(hss_info->imsi_ranges, node) { + OpenAPI_imsi_range_free(node->data); + } + OpenAPI_list_free(hss_info->imsi_ranges); + hss_info->imsi_ranges = NULL; } - OpenAPI_list_free(hss_info->ims_private_identity_ranges); - OpenAPI_list_for_each(hss_info->ims_public_identity_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (hss_info->ims_private_identity_ranges) { + OpenAPI_list_for_each(hss_info->ims_private_identity_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(hss_info->ims_private_identity_ranges); + hss_info->ims_private_identity_ranges = NULL; } - OpenAPI_list_free(hss_info->ims_public_identity_ranges); - OpenAPI_list_for_each(hss_info->msisdn_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (hss_info->ims_public_identity_ranges) { + OpenAPI_list_for_each(hss_info->ims_public_identity_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(hss_info->ims_public_identity_ranges); + hss_info->ims_public_identity_ranges = NULL; + } + if (hss_info->msisdn_ranges) { + OpenAPI_list_for_each(hss_info->msisdn_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(hss_info->msisdn_ranges); + hss_info->msisdn_ranges = NULL; } - OpenAPI_list_free(hss_info->msisdn_ranges); ogs_free(hss_info); } cJSON *OpenAPI_hss_info_convertToJSON(OpenAPI_hss_info_t *hss_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (hss_info == NULL) { ogs_error("OpenAPI_hss_info_convertToJSON() failed [HssInfo]"); @@ -73,17 +90,13 @@ cJSON *OpenAPI_hss_info_convertToJSON(OpenAPI_hss_info_t *hss_info) ogs_error("OpenAPI_hss_info_convertToJSON() failed [imsi_ranges]"); goto end; } - - OpenAPI_lnode_t *imsi_ranges_node; - if (hss_info->imsi_ranges) { - OpenAPI_list_for_each(hss_info->imsi_ranges, imsi_ranges_node) { - cJSON *itemLocal = OpenAPI_imsi_range_convertToJSON(imsi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hss_info_convertToJSON() failed [imsi_ranges]"); - goto end; - } - cJSON_AddItemToArray(imsi_rangesList, itemLocal); + OpenAPI_list_for_each(hss_info->imsi_ranges, node) { + cJSON *itemLocal = OpenAPI_imsi_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hss_info_convertToJSON() failed [imsi_ranges]"); + goto end; } + cJSON_AddItemToArray(imsi_rangesList, itemLocal); } } @@ -93,17 +106,13 @@ cJSON *OpenAPI_hss_info_convertToJSON(OpenAPI_hss_info_t *hss_info) ogs_error("OpenAPI_hss_info_convertToJSON() failed [ims_private_identity_ranges]"); goto end; } - - OpenAPI_lnode_t *ims_private_identity_ranges_node; - if (hss_info->ims_private_identity_ranges) { - OpenAPI_list_for_each(hss_info->ims_private_identity_ranges, ims_private_identity_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(ims_private_identity_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hss_info_convertToJSON() failed [ims_private_identity_ranges]"); - goto end; - } - cJSON_AddItemToArray(ims_private_identity_rangesList, itemLocal); + OpenAPI_list_for_each(hss_info->ims_private_identity_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hss_info_convertToJSON() failed [ims_private_identity_ranges]"); + goto end; } + cJSON_AddItemToArray(ims_private_identity_rangesList, itemLocal); } } @@ -113,17 +122,13 @@ cJSON *OpenAPI_hss_info_convertToJSON(OpenAPI_hss_info_t *hss_info) ogs_error("OpenAPI_hss_info_convertToJSON() failed [ims_public_identity_ranges]"); goto end; } - - OpenAPI_lnode_t *ims_public_identity_ranges_node; - if (hss_info->ims_public_identity_ranges) { - OpenAPI_list_for_each(hss_info->ims_public_identity_ranges, ims_public_identity_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(ims_public_identity_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hss_info_convertToJSON() failed [ims_public_identity_ranges]"); - goto end; - } - cJSON_AddItemToArray(ims_public_identity_rangesList, itemLocal); + OpenAPI_list_for_each(hss_info->ims_public_identity_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hss_info_convertToJSON() failed [ims_public_identity_ranges]"); + goto end; } + cJSON_AddItemToArray(ims_public_identity_rangesList, itemLocal); } } @@ -133,17 +138,13 @@ cJSON *OpenAPI_hss_info_convertToJSON(OpenAPI_hss_info_t *hss_info) ogs_error("OpenAPI_hss_info_convertToJSON() failed [msisdn_ranges]"); goto end; } - - OpenAPI_lnode_t *msisdn_ranges_node; - if (hss_info->msisdn_ranges) { - OpenAPI_list_for_each(hss_info->msisdn_ranges, msisdn_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(msisdn_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_hss_info_convertToJSON() failed [msisdn_ranges]"); - goto end; - } - cJSON_AddItemToArray(msisdn_rangesList, itemLocal); + OpenAPI_list_for_each(hss_info->msisdn_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_hss_info_convertToJSON() failed [msisdn_ranges]"); + goto end; } + cJSON_AddItemToArray(msisdn_rangesList, itemLocal); } } @@ -154,133 +155,126 @@ end: OpenAPI_hss_info_t *OpenAPI_hss_info_parseFromJSON(cJSON *hss_infoJSON) { OpenAPI_hss_info_t *hss_info_local_var = NULL; - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "groupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *group_id = NULL; + cJSON *imsi_ranges = NULL; + OpenAPI_list_t *imsi_rangesList = NULL; + cJSON *ims_private_identity_ranges = NULL; + OpenAPI_list_t *ims_private_identity_rangesList = NULL; + cJSON *ims_public_identity_ranges = NULL; + OpenAPI_list_t *ims_public_identity_rangesList = NULL; + cJSON *msisdn_ranges = NULL; + OpenAPI_list_t *msisdn_rangesList = NULL; + group_id = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_hss_info_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *imsi_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "imsiRanges"); - - OpenAPI_list_t *imsi_rangesList; + imsi_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "imsiRanges"); if (imsi_ranges) { - cJSON *imsi_ranges_local_nonprimitive; - if (!cJSON_IsArray(imsi_ranges)){ - ogs_error("OpenAPI_hss_info_parseFromJSON() failed [imsi_ranges]"); - goto end; - } - - imsi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(imsi_ranges_local_nonprimitive, imsi_ranges ) { - if (!cJSON_IsObject(imsi_ranges_local_nonprimitive)) { + cJSON *imsi_ranges_local = NULL; + if (!cJSON_IsArray(imsi_ranges)) { ogs_error("OpenAPI_hss_info_parseFromJSON() failed [imsi_ranges]"); goto end; } - OpenAPI_imsi_range_t *imsi_rangesItem = OpenAPI_imsi_range_parseFromJSON(imsi_ranges_local_nonprimitive); - if (!imsi_rangesItem) { - ogs_error("No imsi_rangesItem"); - OpenAPI_list_free(imsi_rangesList); - goto end; + imsi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(imsi_ranges_local, imsi_ranges) { + if (!cJSON_IsObject(imsi_ranges_local)) { + ogs_error("OpenAPI_hss_info_parseFromJSON() failed [imsi_ranges]"); + goto end; + } + OpenAPI_imsi_range_t *imsi_rangesItem = OpenAPI_imsi_range_parseFromJSON(imsi_ranges_local); + if (!imsi_rangesItem) { + ogs_error("No imsi_rangesItem"); + OpenAPI_list_free(imsi_rangesList); + goto end; + } + OpenAPI_list_add(imsi_rangesList, imsi_rangesItem); } - - OpenAPI_list_add(imsi_rangesList, imsi_rangesItem); - } } - cJSON *ims_private_identity_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "imsPrivateIdentityRanges"); - - OpenAPI_list_t *ims_private_identity_rangesList; + ims_private_identity_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "imsPrivateIdentityRanges"); if (ims_private_identity_ranges) { - cJSON *ims_private_identity_ranges_local_nonprimitive; - if (!cJSON_IsArray(ims_private_identity_ranges)){ - ogs_error("OpenAPI_hss_info_parseFromJSON() failed [ims_private_identity_ranges]"); - goto end; - } - - ims_private_identity_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ims_private_identity_ranges_local_nonprimitive, ims_private_identity_ranges ) { - if (!cJSON_IsObject(ims_private_identity_ranges_local_nonprimitive)) { + cJSON *ims_private_identity_ranges_local = NULL; + if (!cJSON_IsArray(ims_private_identity_ranges)) { ogs_error("OpenAPI_hss_info_parseFromJSON() failed [ims_private_identity_ranges]"); goto end; } - OpenAPI_identity_range_t *ims_private_identity_rangesItem = OpenAPI_identity_range_parseFromJSON(ims_private_identity_ranges_local_nonprimitive); - if (!ims_private_identity_rangesItem) { - ogs_error("No ims_private_identity_rangesItem"); - OpenAPI_list_free(ims_private_identity_rangesList); - goto end; + ims_private_identity_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ims_private_identity_ranges_local, ims_private_identity_ranges) { + if (!cJSON_IsObject(ims_private_identity_ranges_local)) { + ogs_error("OpenAPI_hss_info_parseFromJSON() failed [ims_private_identity_ranges]"); + goto end; + } + OpenAPI_identity_range_t *ims_private_identity_rangesItem = OpenAPI_identity_range_parseFromJSON(ims_private_identity_ranges_local); + if (!ims_private_identity_rangesItem) { + ogs_error("No ims_private_identity_rangesItem"); + OpenAPI_list_free(ims_private_identity_rangesList); + goto end; + } + OpenAPI_list_add(ims_private_identity_rangesList, ims_private_identity_rangesItem); } - - OpenAPI_list_add(ims_private_identity_rangesList, ims_private_identity_rangesItem); - } } - cJSON *ims_public_identity_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "imsPublicIdentityRanges"); - - OpenAPI_list_t *ims_public_identity_rangesList; + ims_public_identity_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "imsPublicIdentityRanges"); if (ims_public_identity_ranges) { - cJSON *ims_public_identity_ranges_local_nonprimitive; - if (!cJSON_IsArray(ims_public_identity_ranges)){ - ogs_error("OpenAPI_hss_info_parseFromJSON() failed [ims_public_identity_ranges]"); - goto end; - } - - ims_public_identity_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ims_public_identity_ranges_local_nonprimitive, ims_public_identity_ranges ) { - if (!cJSON_IsObject(ims_public_identity_ranges_local_nonprimitive)) { + cJSON *ims_public_identity_ranges_local = NULL; + if (!cJSON_IsArray(ims_public_identity_ranges)) { ogs_error("OpenAPI_hss_info_parseFromJSON() failed [ims_public_identity_ranges]"); goto end; } - OpenAPI_identity_range_t *ims_public_identity_rangesItem = OpenAPI_identity_range_parseFromJSON(ims_public_identity_ranges_local_nonprimitive); - if (!ims_public_identity_rangesItem) { - ogs_error("No ims_public_identity_rangesItem"); - OpenAPI_list_free(ims_public_identity_rangesList); - goto end; + ims_public_identity_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ims_public_identity_ranges_local, ims_public_identity_ranges) { + if (!cJSON_IsObject(ims_public_identity_ranges_local)) { + ogs_error("OpenAPI_hss_info_parseFromJSON() failed [ims_public_identity_ranges]"); + goto end; + } + OpenAPI_identity_range_t *ims_public_identity_rangesItem = OpenAPI_identity_range_parseFromJSON(ims_public_identity_ranges_local); + if (!ims_public_identity_rangesItem) { + ogs_error("No ims_public_identity_rangesItem"); + OpenAPI_list_free(ims_public_identity_rangesList); + goto end; + } + OpenAPI_list_add(ims_public_identity_rangesList, ims_public_identity_rangesItem); } - - OpenAPI_list_add(ims_public_identity_rangesList, ims_public_identity_rangesItem); - } } - cJSON *msisdn_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "msisdnRanges"); - - OpenAPI_list_t *msisdn_rangesList; + msisdn_ranges = cJSON_GetObjectItemCaseSensitive(hss_infoJSON, "msisdnRanges"); if (msisdn_ranges) { - cJSON *msisdn_ranges_local_nonprimitive; - if (!cJSON_IsArray(msisdn_ranges)){ - ogs_error("OpenAPI_hss_info_parseFromJSON() failed [msisdn_ranges]"); - goto end; - } - - msisdn_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(msisdn_ranges_local_nonprimitive, msisdn_ranges ) { - if (!cJSON_IsObject(msisdn_ranges_local_nonprimitive)) { + cJSON *msisdn_ranges_local = NULL; + if (!cJSON_IsArray(msisdn_ranges)) { ogs_error("OpenAPI_hss_info_parseFromJSON() failed [msisdn_ranges]"); goto end; } - OpenAPI_identity_range_t *msisdn_rangesItem = OpenAPI_identity_range_parseFromJSON(msisdn_ranges_local_nonprimitive); - if (!msisdn_rangesItem) { - ogs_error("No msisdn_rangesItem"); - OpenAPI_list_free(msisdn_rangesList); - goto end; + msisdn_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(msisdn_ranges_local, msisdn_ranges) { + if (!cJSON_IsObject(msisdn_ranges_local)) { + ogs_error("OpenAPI_hss_info_parseFromJSON() failed [msisdn_ranges]"); + goto end; + } + OpenAPI_identity_range_t *msisdn_rangesItem = OpenAPI_identity_range_parseFromJSON(msisdn_ranges_local); + if (!msisdn_rangesItem) { + ogs_error("No msisdn_rangesItem"); + OpenAPI_list_free(msisdn_rangesList); + goto end; + } + OpenAPI_list_add(msisdn_rangesList, msisdn_rangesItem); } - - OpenAPI_list_add(msisdn_rangesList, msisdn_rangesItem); - } } hss_info_local_var = OpenAPI_hss_info_create ( - group_id ? ogs_strdup(group_id->valuestring) : NULL, + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, imsi_ranges ? imsi_rangesList : NULL, ims_private_identity_ranges ? ims_private_identity_rangesList : NULL, ims_public_identity_ranges ? ims_public_identity_rangesList : NULL, @@ -289,6 +283,34 @@ OpenAPI_hss_info_t *OpenAPI_hss_info_parseFromJSON(cJSON *hss_infoJSON) return hss_info_local_var; end: + if (imsi_rangesList) { + OpenAPI_list_for_each(imsi_rangesList, node) { + OpenAPI_imsi_range_free(node->data); + } + OpenAPI_list_free(imsi_rangesList); + imsi_rangesList = NULL; + } + if (ims_private_identity_rangesList) { + OpenAPI_list_for_each(ims_private_identity_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(ims_private_identity_rangesList); + ims_private_identity_rangesList = NULL; + } + if (ims_public_identity_rangesList) { + OpenAPI_list_for_each(ims_public_identity_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(ims_public_identity_rangesList); + ims_public_identity_rangesList = NULL; + } + if (msisdn_rangesList) { + OpenAPI_list_for_each(msisdn_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(msisdn_rangesList); + msisdn_rangesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/id_translation_result.c b/lib/sbi/openapi/model/id_translation_result.c index 92764b3e0..5310cc349 100644 --- a/lib/sbi/openapi/model/id_translation_result.c +++ b/lib/sbi/openapi/model/id_translation_result.c @@ -22,19 +22,30 @@ OpenAPI_id_translation_result_t *OpenAPI_id_translation_result_create( void OpenAPI_id_translation_result_free(OpenAPI_id_translation_result_t *id_translation_result) { + OpenAPI_lnode_t *node = NULL; + if (NULL == id_translation_result) { return; } - OpenAPI_lnode_t *node; - ogs_free(id_translation_result->supported_features); - ogs_free(id_translation_result->supi); - ogs_free(id_translation_result->gpsi); + if (id_translation_result->supported_features) { + ogs_free(id_translation_result->supported_features); + id_translation_result->supported_features = NULL; + } + if (id_translation_result->supi) { + ogs_free(id_translation_result->supi); + id_translation_result->supi = NULL; + } + if (id_translation_result->gpsi) { + ogs_free(id_translation_result->gpsi); + id_translation_result->gpsi = NULL; + } ogs_free(id_translation_result); } cJSON *OpenAPI_id_translation_result_convertToJSON(OpenAPI_id_translation_result_t *id_translation_result) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (id_translation_result == NULL) { ogs_error("OpenAPI_id_translation_result_convertToJSON() failed [IdTranslationResult]"); @@ -49,6 +60,10 @@ cJSON *OpenAPI_id_translation_result_convertToJSON(OpenAPI_id_translation_result } } + if (!id_translation_result->supi) { + ogs_error("OpenAPI_id_translation_result_convertToJSON() failed [supi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supi", id_translation_result->supi) == NULL) { ogs_error("OpenAPI_id_translation_result_convertToJSON() failed [supi]"); goto end; @@ -68,39 +83,40 @@ end: OpenAPI_id_translation_result_t *OpenAPI_id_translation_result_parseFromJSON(cJSON *id_translation_resultJSON) { OpenAPI_id_translation_result_t *id_translation_result_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *supi = NULL; + cJSON *gpsi = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_id_translation_result_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "supi"); + supi = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "supi"); if (!supi) { ogs_error("OpenAPI_id_translation_result_parseFromJSON() failed [supi]"); goto end; } - if (!cJSON_IsString(supi)) { ogs_error("OpenAPI_id_translation_result_parseFromJSON() failed [supi]"); goto end; } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(id_translation_resultJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_id_translation_result_parseFromJSON() failed [gpsi]"); goto end; } } id_translation_result_local_var = OpenAPI_id_translation_result_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, ogs_strdup(supi->valuestring), - gpsi ? ogs_strdup(gpsi->valuestring) : NULL + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL ); return id_translation_result_local_var; diff --git a/lib/sbi/openapi/model/identity_data.c b/lib/sbi/openapi/model/identity_data.c index bbd2e9669..3a3ee1090 100644 --- a/lib/sbi/openapi/model/identity_data.c +++ b/lib/sbi/openapi/model/identity_data.c @@ -20,24 +20,32 @@ OpenAPI_identity_data_t *OpenAPI_identity_data_create( void OpenAPI_identity_data_free(OpenAPI_identity_data_t *identity_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == identity_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(identity_data->supi_list, node) { - ogs_free(node->data); + if (identity_data->supi_list) { + OpenAPI_list_for_each(identity_data->supi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(identity_data->supi_list); + identity_data->supi_list = NULL; } - OpenAPI_list_free(identity_data->supi_list); - OpenAPI_list_for_each(identity_data->gpsi_list, node) { - ogs_free(node->data); + if (identity_data->gpsi_list) { + OpenAPI_list_for_each(identity_data->gpsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(identity_data->gpsi_list); + identity_data->gpsi_list = NULL; } - OpenAPI_list_free(identity_data->gpsi_list); ogs_free(identity_data); } cJSON *OpenAPI_identity_data_convertToJSON(OpenAPI_identity_data_t *identity_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (identity_data == NULL) { ogs_error("OpenAPI_identity_data_convertToJSON() failed [IdentityData]"); @@ -46,35 +54,31 @@ cJSON *OpenAPI_identity_data_convertToJSON(OpenAPI_identity_data_t *identity_dat item = cJSON_CreateObject(); if (identity_data->supi_list) { - cJSON *supi_list = cJSON_AddArrayToObject(item, "supiList"); - if (supi_list == NULL) { + cJSON *supi_listList = cJSON_AddArrayToObject(item, "supiList"); + if (supi_listList == NULL) { ogs_error("OpenAPI_identity_data_convertToJSON() failed [supi_list]"); goto end; } - - OpenAPI_lnode_t *supi_list_node; - OpenAPI_list_for_each(identity_data->supi_list, supi_list_node) { - if (cJSON_AddStringToObject(supi_list, "", (char*)supi_list_node->data) == NULL) { - ogs_error("OpenAPI_identity_data_convertToJSON() failed [supi_list]"); - goto end; + OpenAPI_list_for_each(identity_data->supi_list, node) { + if (cJSON_AddStringToObject(supi_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_identity_data_convertToJSON() failed [supi_list]"); + goto end; + } } - } } if (identity_data->gpsi_list) { - cJSON *gpsi_list = cJSON_AddArrayToObject(item, "gpsiList"); - if (gpsi_list == NULL) { + cJSON *gpsi_listList = cJSON_AddArrayToObject(item, "gpsiList"); + if (gpsi_listList == NULL) { ogs_error("OpenAPI_identity_data_convertToJSON() failed [gpsi_list]"); goto end; } - - OpenAPI_lnode_t *gpsi_list_node; - OpenAPI_list_for_each(identity_data->gpsi_list, gpsi_list_node) { - if (cJSON_AddStringToObject(gpsi_list, "", (char*)gpsi_list_node->data) == NULL) { - ogs_error("OpenAPI_identity_data_convertToJSON() failed [gpsi_list]"); - goto end; + OpenAPI_list_for_each(identity_data->gpsi_list, node) { + if (cJSON_AddStringToObject(gpsi_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_identity_data_convertToJSON() failed [gpsi_list]"); + goto end; + } } - } } end: @@ -84,44 +88,51 @@ end: OpenAPI_identity_data_t *OpenAPI_identity_data_parseFromJSON(cJSON *identity_dataJSON) { OpenAPI_identity_data_t *identity_data_local_var = NULL; - cJSON *supi_list = cJSON_GetObjectItemCaseSensitive(identity_dataJSON, "supiList"); - - OpenAPI_list_t *supi_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *supi_list = NULL; + OpenAPI_list_t *supi_listList = NULL; + cJSON *gpsi_list = NULL; + OpenAPI_list_t *gpsi_listList = NULL; + supi_list = cJSON_GetObjectItemCaseSensitive(identity_dataJSON, "supiList"); if (supi_list) { - cJSON *supi_list_local; - if (!cJSON_IsArray(supi_list)) { - ogs_error("OpenAPI_identity_data_parseFromJSON() failed [supi_list]"); - goto end; - } - supi_listList = OpenAPI_list_create(); + cJSON *supi_list_local = NULL; + if (!cJSON_IsArray(supi_list)) { + ogs_error("OpenAPI_identity_data_parseFromJSON() failed [supi_list]"); + goto end; + } - cJSON_ArrayForEach(supi_list_local, supi_list) { - if (!cJSON_IsString(supi_list_local)) { - ogs_error("OpenAPI_identity_data_parseFromJSON() failed [supi_list]"); - goto end; - } - OpenAPI_list_add(supi_listList, ogs_strdup(supi_list_local->valuestring)); - } + supi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_list_local, supi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(supi_list_local)) { + ogs_error("OpenAPI_identity_data_parseFromJSON() failed [supi_list]"); + goto end; + } + OpenAPI_list_add(supi_listList, ogs_strdup(supi_list_local->valuestring)); + } } - cJSON *gpsi_list = cJSON_GetObjectItemCaseSensitive(identity_dataJSON, "gpsiList"); - - OpenAPI_list_t *gpsi_listList; + gpsi_list = cJSON_GetObjectItemCaseSensitive(identity_dataJSON, "gpsiList"); if (gpsi_list) { - cJSON *gpsi_list_local; - if (!cJSON_IsArray(gpsi_list)) { - ogs_error("OpenAPI_identity_data_parseFromJSON() failed [gpsi_list]"); - goto end; - } - gpsi_listList = OpenAPI_list_create(); + cJSON *gpsi_list_local = NULL; + if (!cJSON_IsArray(gpsi_list)) { + ogs_error("OpenAPI_identity_data_parseFromJSON() failed [gpsi_list]"); + goto end; + } - cJSON_ArrayForEach(gpsi_list_local, gpsi_list) { - if (!cJSON_IsString(gpsi_list_local)) { - ogs_error("OpenAPI_identity_data_parseFromJSON() failed [gpsi_list]"); - goto end; - } - OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring)); - } + gpsi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_list_local, gpsi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(gpsi_list_local)) { + ogs_error("OpenAPI_identity_data_parseFromJSON() failed [gpsi_list]"); + goto end; + } + OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring)); + } } identity_data_local_var = OpenAPI_identity_data_create ( @@ -131,6 +142,20 @@ OpenAPI_identity_data_t *OpenAPI_identity_data_parseFromJSON(cJSON *identity_dat return identity_data_local_var; end: + if (supi_listList) { + OpenAPI_list_for_each(supi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(supi_listList); + supi_listList = NULL; + } + if (gpsi_listList) { + OpenAPI_list_for_each(gpsi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(gpsi_listList); + gpsi_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/identity_range.c b/lib/sbi/openapi/model/identity_range.c index 242f30a00..856036672 100644 --- a/lib/sbi/openapi/model/identity_range.c +++ b/lib/sbi/openapi/model/identity_range.c @@ -22,19 +22,30 @@ OpenAPI_identity_range_t *OpenAPI_identity_range_create( void OpenAPI_identity_range_free(OpenAPI_identity_range_t *identity_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == identity_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(identity_range->start); - ogs_free(identity_range->end); - ogs_free(identity_range->pattern); + if (identity_range->start) { + ogs_free(identity_range->start); + identity_range->start = NULL; + } + if (identity_range->end) { + ogs_free(identity_range->end); + identity_range->end = NULL; + } + if (identity_range->pattern) { + ogs_free(identity_range->pattern); + identity_range->pattern = NULL; + } ogs_free(identity_range); } cJSON *OpenAPI_identity_range_convertToJSON(OpenAPI_identity_range_t *identity_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (identity_range == NULL) { ogs_error("OpenAPI_identity_range_convertToJSON() failed [IdentityRange]"); @@ -70,37 +81,38 @@ end: OpenAPI_identity_range_t *OpenAPI_identity_range_parseFromJSON(cJSON *identity_rangeJSON) { OpenAPI_identity_range_t *identity_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(identity_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + cJSON *pattern = NULL; + start = cJSON_GetObjectItemCaseSensitive(identity_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_identity_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(identity_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(identity_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_identity_range_parseFromJSON() failed [end]"); goto end; } } - cJSON *pattern = cJSON_GetObjectItemCaseSensitive(identity_rangeJSON, "pattern"); - + pattern = cJSON_GetObjectItemCaseSensitive(identity_rangeJSON, "pattern"); if (pattern) { - if (!cJSON_IsString(pattern)) { + if (!cJSON_IsString(pattern) && !cJSON_IsNull(pattern)) { ogs_error("OpenAPI_identity_range_parseFromJSON() failed [pattern]"); goto end; } } identity_range_local_var = OpenAPI_identity_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL, - pattern ? ogs_strdup(pattern->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL, + pattern && !cJSON_IsNull(pattern) ? ogs_strdup(pattern->valuestring) : NULL ); return identity_range_local_var; diff --git a/lib/sbi/openapi/model/immediate_mdt_conf.c b/lib/sbi/openapi/model/immediate_mdt_conf.c index b11c52d79..1682ebeef 100644 --- a/lib/sbi/openapi/model/immediate_mdt_conf.c +++ b/lib/sbi/openapi/model/immediate_mdt_conf.c @@ -62,26 +62,49 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_create( void OpenAPI_immediate_mdt_conf_free(OpenAPI_immediate_mdt_conf_t *immediate_mdt_conf) { + OpenAPI_lnode_t *node = NULL; + if (NULL == immediate_mdt_conf) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(immediate_mdt_conf->measurement_lte_list); - OpenAPI_list_free(immediate_mdt_conf->measurement_nr_list); - OpenAPI_list_free(immediate_mdt_conf->reporting_trigger_list); - OpenAPI_area_scope_free(immediate_mdt_conf->area_scope); - OpenAPI_list_free(immediate_mdt_conf->add_positioning_method_list); - OpenAPI_list_for_each(immediate_mdt_conf->mdt_allowed_plmn_id_list, node) { - OpenAPI_plmn_id_free(node->data); + if (immediate_mdt_conf->measurement_lte_list) { + OpenAPI_list_free(immediate_mdt_conf->measurement_lte_list); + immediate_mdt_conf->measurement_lte_list = NULL; + } + if (immediate_mdt_conf->measurement_nr_list) { + OpenAPI_list_free(immediate_mdt_conf->measurement_nr_list); + immediate_mdt_conf->measurement_nr_list = NULL; + } + if (immediate_mdt_conf->reporting_trigger_list) { + OpenAPI_list_free(immediate_mdt_conf->reporting_trigger_list); + immediate_mdt_conf->reporting_trigger_list = NULL; + } + if (immediate_mdt_conf->area_scope) { + OpenAPI_area_scope_free(immediate_mdt_conf->area_scope); + immediate_mdt_conf->area_scope = NULL; + } + if (immediate_mdt_conf->add_positioning_method_list) { + OpenAPI_list_free(immediate_mdt_conf->add_positioning_method_list); + immediate_mdt_conf->add_positioning_method_list = NULL; + } + if (immediate_mdt_conf->mdt_allowed_plmn_id_list) { + OpenAPI_list_for_each(immediate_mdt_conf->mdt_allowed_plmn_id_list, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(immediate_mdt_conf->mdt_allowed_plmn_id_list); + immediate_mdt_conf->mdt_allowed_plmn_id_list = NULL; + } + if (immediate_mdt_conf->sensor_measurement_list) { + OpenAPI_list_free(immediate_mdt_conf->sensor_measurement_list); + immediate_mdt_conf->sensor_measurement_list = NULL; } - OpenAPI_list_free(immediate_mdt_conf->mdt_allowed_plmn_id_list); - OpenAPI_list_free(immediate_mdt_conf->sensor_measurement_list); ogs_free(immediate_mdt_conf); } cJSON *OpenAPI_immediate_mdt_conf_convertToJSON(OpenAPI_immediate_mdt_conf_t *immediate_mdt_conf) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (immediate_mdt_conf == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [ImmediateMdtConf]"); @@ -89,71 +112,72 @@ cJSON *OpenAPI_immediate_mdt_conf_convertToJSON(OpenAPI_immediate_mdt_conf_t *im } item = cJSON_CreateObject(); + if (immediate_mdt_conf->job_type == OpenAPI_job_type_NULL) { + ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [job_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "jobType", OpenAPI_job_type_ToString(immediate_mdt_conf->job_type)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [job_type]"); goto end; } - if (immediate_mdt_conf->measurement_lte_list) { - cJSON *measurement_lte_list = cJSON_AddArrayToObject(item, "measurementLteList"); - if (measurement_lte_list == NULL) { + if (immediate_mdt_conf->measurement_lte_list != OpenAPI_measurement_lte_for_mdt_NULL) { + cJSON *measurement_lte_listList = cJSON_AddArrayToObject(item, "measurementLteList"); + if (measurement_lte_listList == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [measurement_lte_list]"); goto end; } - OpenAPI_lnode_t *measurement_lte_list_node; - OpenAPI_list_for_each(immediate_mdt_conf->measurement_lte_list, measurement_lte_list_node) { - if (cJSON_AddStringToObject(measurement_lte_list, "", OpenAPI_measurement_lte_for_mdt_ToString((intptr_t)measurement_lte_list_node->data)) == NULL) { + OpenAPI_list_for_each(immediate_mdt_conf->measurement_lte_list, node) { + if (cJSON_AddStringToObject(measurement_lte_listList, "", OpenAPI_measurement_lte_for_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [measurement_lte_list]"); goto end; } } } - if (immediate_mdt_conf->measurement_nr_list) { - cJSON *measurement_nr_list = cJSON_AddArrayToObject(item, "measurementNrList"); - if (measurement_nr_list == NULL) { + if (immediate_mdt_conf->measurement_nr_list != OpenAPI_measurement_nr_for_mdt_NULL) { + cJSON *measurement_nr_listList = cJSON_AddArrayToObject(item, "measurementNrList"); + if (measurement_nr_listList == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [measurement_nr_list]"); goto end; } - OpenAPI_lnode_t *measurement_nr_list_node; - OpenAPI_list_for_each(immediate_mdt_conf->measurement_nr_list, measurement_nr_list_node) { - if (cJSON_AddStringToObject(measurement_nr_list, "", OpenAPI_measurement_nr_for_mdt_ToString((intptr_t)measurement_nr_list_node->data)) == NULL) { + OpenAPI_list_for_each(immediate_mdt_conf->measurement_nr_list, node) { + if (cJSON_AddStringToObject(measurement_nr_listList, "", OpenAPI_measurement_nr_for_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [measurement_nr_list]"); goto end; } } } - if (immediate_mdt_conf->reporting_trigger_list) { - cJSON *reporting_trigger_list = cJSON_AddArrayToObject(item, "reportingTriggerList"); - if (reporting_trigger_list == NULL) { + if (immediate_mdt_conf->reporting_trigger_list != OpenAPI_reporting_trigger_NULL) { + cJSON *reporting_trigger_listList = cJSON_AddArrayToObject(item, "reportingTriggerList"); + if (reporting_trigger_listList == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [reporting_trigger_list]"); goto end; } - OpenAPI_lnode_t *reporting_trigger_list_node; - OpenAPI_list_for_each(immediate_mdt_conf->reporting_trigger_list, reporting_trigger_list_node) { - if (cJSON_AddStringToObject(reporting_trigger_list, "", OpenAPI_reporting_trigger_ToString((intptr_t)reporting_trigger_list_node->data)) == NULL) { + OpenAPI_list_for_each(immediate_mdt_conf->reporting_trigger_list, node) { + if (cJSON_AddStringToObject(reporting_trigger_listList, "", OpenAPI_reporting_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [reporting_trigger_list]"); goto end; } } } - if (immediate_mdt_conf->report_interval) { + if (immediate_mdt_conf->report_interval != OpenAPI_report_interval_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportInterval", OpenAPI_report_interval_mdt_ToString(immediate_mdt_conf->report_interval)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [report_interval]"); goto end; } } - if (immediate_mdt_conf->report_interval_nr) { + if (immediate_mdt_conf->report_interval_nr != OpenAPI_report_interval_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportIntervalNr", OpenAPI_report_interval_nr_mdt_ToString(immediate_mdt_conf->report_interval_nr)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [report_interval_nr]"); goto end; } } - if (immediate_mdt_conf->report_amount) { + if (immediate_mdt_conf->report_amount != OpenAPI_report_amount_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportAmount", OpenAPI_report_amount_mdt_ToString(immediate_mdt_conf->report_amount)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [report_amount]"); goto end; @@ -188,21 +212,21 @@ cJSON *OpenAPI_immediate_mdt_conf_convertToJSON(OpenAPI_immediate_mdt_conf_t *im } } - if (immediate_mdt_conf->collection_period_rmm_lte) { + if (immediate_mdt_conf->collection_period_rmm_lte != OpenAPI_collection_period_rmm_lte_mdt_NULL) { if (cJSON_AddStringToObject(item, "collectionPeriodRmmLte", OpenAPI_collection_period_rmm_lte_mdt_ToString(immediate_mdt_conf->collection_period_rmm_lte)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [collection_period_rmm_lte]"); goto end; } } - if (immediate_mdt_conf->collection_period_rmm_nr) { + if (immediate_mdt_conf->collection_period_rmm_nr != OpenAPI_collection_period_rmm_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "collectionPeriodRmmNr", OpenAPI_collection_period_rmm_nr_mdt_ToString(immediate_mdt_conf->collection_period_rmm_nr)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [collection_period_rmm_nr]"); goto end; } } - if (immediate_mdt_conf->measurement_period_lte) { + if (immediate_mdt_conf->measurement_period_lte != OpenAPI_measurement_period_lte_mdt_NULL) { if (cJSON_AddStringToObject(item, "measurementPeriodLte", OpenAPI_measurement_period_lte_mdt_ToString(immediate_mdt_conf->measurement_period_lte)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [measurement_period_lte]"); goto end; @@ -222,22 +246,21 @@ cJSON *OpenAPI_immediate_mdt_conf_convertToJSON(OpenAPI_immediate_mdt_conf_t *im } } - if (immediate_mdt_conf->positioning_method) { + if (immediate_mdt_conf->positioning_method != OpenAPI_positioning_method_mdt_NULL) { if (cJSON_AddStringToObject(item, "positioningMethod", OpenAPI_positioning_method_mdt_ToString(immediate_mdt_conf->positioning_method)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [positioning_method]"); goto end; } } - if (immediate_mdt_conf->add_positioning_method_list) { - cJSON *add_positioning_method_list = cJSON_AddArrayToObject(item, "addPositioningMethodList"); - if (add_positioning_method_list == NULL) { + if (immediate_mdt_conf->add_positioning_method_list != OpenAPI_positioning_method_mdt_NULL) { + cJSON *add_positioning_method_listList = cJSON_AddArrayToObject(item, "addPositioningMethodList"); + if (add_positioning_method_listList == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [add_positioning_method_list]"); goto end; } - OpenAPI_lnode_t *add_positioning_method_list_node; - OpenAPI_list_for_each(immediate_mdt_conf->add_positioning_method_list, add_positioning_method_list_node) { - if (cJSON_AddStringToObject(add_positioning_method_list, "", OpenAPI_positioning_method_mdt_ToString((intptr_t)add_positioning_method_list_node->data)) == NULL) { + OpenAPI_list_for_each(immediate_mdt_conf->add_positioning_method_list, node) { + if (cJSON_AddStringToObject(add_positioning_method_listList, "", OpenAPI_positioning_method_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [add_positioning_method_list]"); goto end; } @@ -250,29 +273,24 @@ cJSON *OpenAPI_immediate_mdt_conf_convertToJSON(OpenAPI_immediate_mdt_conf_t *im ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [mdt_allowed_plmn_id_list]"); goto end; } - - OpenAPI_lnode_t *mdt_allowed_plmn_id_list_node; - if (immediate_mdt_conf->mdt_allowed_plmn_id_list) { - OpenAPI_list_for_each(immediate_mdt_conf->mdt_allowed_plmn_id_list, mdt_allowed_plmn_id_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(mdt_allowed_plmn_id_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [mdt_allowed_plmn_id_list]"); - goto end; - } - cJSON_AddItemToArray(mdt_allowed_plmn_id_listList, itemLocal); + OpenAPI_list_for_each(immediate_mdt_conf->mdt_allowed_plmn_id_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [mdt_allowed_plmn_id_list]"); + goto end; } + cJSON_AddItemToArray(mdt_allowed_plmn_id_listList, itemLocal); } } - if (immediate_mdt_conf->sensor_measurement_list) { - cJSON *sensor_measurement_list = cJSON_AddArrayToObject(item, "sensorMeasurementList"); - if (sensor_measurement_list == NULL) { + if (immediate_mdt_conf->sensor_measurement_list != OpenAPI_sensor_measurement_NULL) { + cJSON *sensor_measurement_listList = cJSON_AddArrayToObject(item, "sensorMeasurementList"); + if (sensor_measurement_listList == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [sensor_measurement_list]"); goto end; } - OpenAPI_lnode_t *sensor_measurement_list_node; - OpenAPI_list_for_each(immediate_mdt_conf->sensor_measurement_list, sensor_measurement_list_node) { - if (cJSON_AddStringToObject(sensor_measurement_list, "", OpenAPI_sensor_measurement_ToString((intptr_t)sensor_measurement_list_node->data)) == NULL) { + OpenAPI_list_for_each(immediate_mdt_conf->sensor_measurement_list, node) { + if (cJSON_AddStringToObject(sensor_measurement_listList, "", OpenAPI_sensor_measurement_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_immediate_mdt_conf_convertToJSON() failed [sensor_measurement_list]"); goto end; } @@ -286,88 +304,110 @@ end: OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *immediate_mdt_confJSON) { OpenAPI_immediate_mdt_conf_t *immediate_mdt_conf_local_var = NULL; - cJSON *job_type = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "jobType"); + OpenAPI_lnode_t *node = NULL; + cJSON *job_type = NULL; + OpenAPI_job_type_e job_typeVariable = 0; + cJSON *measurement_lte_list = NULL; + OpenAPI_list_t *measurement_lte_listList = NULL; + cJSON *measurement_nr_list = NULL; + OpenAPI_list_t *measurement_nr_listList = NULL; + cJSON *reporting_trigger_list = NULL; + OpenAPI_list_t *reporting_trigger_listList = NULL; + cJSON *report_interval = NULL; + OpenAPI_report_interval_mdt_e report_intervalVariable = 0; + cJSON *report_interval_nr = NULL; + OpenAPI_report_interval_nr_mdt_e report_interval_nrVariable = 0; + cJSON *report_amount = NULL; + OpenAPI_report_amount_mdt_e report_amountVariable = 0; + cJSON *event_threshold_rsrp = NULL; + cJSON *event_threshold_rsrq = NULL; + cJSON *event_threshold_rsrp_nr = NULL; + cJSON *event_threshold_rsrq_nr = NULL; + cJSON *collection_period_rmm_lte = NULL; + OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lteVariable = 0; + cJSON *collection_period_rmm_nr = NULL; + OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nrVariable = 0; + cJSON *measurement_period_lte = NULL; + OpenAPI_measurement_period_lte_mdt_e measurement_period_lteVariable = 0; + cJSON *area_scope = NULL; + OpenAPI_area_scope_t *area_scope_local_nonprim = NULL; + cJSON *positioning_method = NULL; + OpenAPI_positioning_method_mdt_e positioning_methodVariable = 0; + cJSON *add_positioning_method_list = NULL; + OpenAPI_list_t *add_positioning_method_listList = NULL; + cJSON *mdt_allowed_plmn_id_list = NULL; + OpenAPI_list_t *mdt_allowed_plmn_id_listList = NULL; + cJSON *sensor_measurement_list = NULL; + OpenAPI_list_t *sensor_measurement_listList = NULL; + job_type = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "jobType"); if (!job_type) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [job_type]"); goto end; } - - OpenAPI_job_type_e job_typeVariable; if (!cJSON_IsString(job_type)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [job_type]"); goto end; } job_typeVariable = OpenAPI_job_type_FromString(job_type->valuestring); - cJSON *measurement_lte_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "measurementLteList"); - - OpenAPI_list_t *measurement_lte_listList; + measurement_lte_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "measurementLteList"); if (measurement_lte_list) { - cJSON *measurement_lte_list_local_nonprimitive; - if (!cJSON_IsArray(measurement_lte_list)) { - ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [measurement_lte_list]"); - goto end; - } - - measurement_lte_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(measurement_lte_list_local_nonprimitive, measurement_lte_list ) { - if (!cJSON_IsString(measurement_lte_list_local_nonprimitive)){ + cJSON *measurement_lte_list_local = NULL; + if (!cJSON_IsArray(measurement_lte_list)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [measurement_lte_list]"); goto end; } - OpenAPI_list_add(measurement_lte_listList, (void *)OpenAPI_measurement_lte_for_mdt_FromString(measurement_lte_list_local_nonprimitive->valuestring)); - } + measurement_lte_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(measurement_lte_list_local, measurement_lte_list) { + if (!cJSON_IsString(measurement_lte_list_local)) { + ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [measurement_lte_list]"); + goto end; + } + OpenAPI_list_add(measurement_lte_listList, (void *)OpenAPI_measurement_lte_for_mdt_FromString(measurement_lte_list_local->valuestring)); + } } - cJSON *measurement_nr_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "measurementNrList"); - - OpenAPI_list_t *measurement_nr_listList; + measurement_nr_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "measurementNrList"); if (measurement_nr_list) { - cJSON *measurement_nr_list_local_nonprimitive; - if (!cJSON_IsArray(measurement_nr_list)) { - ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [measurement_nr_list]"); - goto end; - } - - measurement_nr_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(measurement_nr_list_local_nonprimitive, measurement_nr_list ) { - if (!cJSON_IsString(measurement_nr_list_local_nonprimitive)){ + cJSON *measurement_nr_list_local = NULL; + if (!cJSON_IsArray(measurement_nr_list)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [measurement_nr_list]"); goto end; } - OpenAPI_list_add(measurement_nr_listList, (void *)OpenAPI_measurement_nr_for_mdt_FromString(measurement_nr_list_local_nonprimitive->valuestring)); - } + measurement_nr_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(measurement_nr_list_local, measurement_nr_list) { + if (!cJSON_IsString(measurement_nr_list_local)) { + ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [measurement_nr_list]"); + goto end; + } + OpenAPI_list_add(measurement_nr_listList, (void *)OpenAPI_measurement_nr_for_mdt_FromString(measurement_nr_list_local->valuestring)); + } } - cJSON *reporting_trigger_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "reportingTriggerList"); - - OpenAPI_list_t *reporting_trigger_listList; + reporting_trigger_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "reportingTriggerList"); if (reporting_trigger_list) { - cJSON *reporting_trigger_list_local_nonprimitive; - if (!cJSON_IsArray(reporting_trigger_list)) { - ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [reporting_trigger_list]"); - goto end; - } - - reporting_trigger_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(reporting_trigger_list_local_nonprimitive, reporting_trigger_list ) { - if (!cJSON_IsString(reporting_trigger_list_local_nonprimitive)){ + cJSON *reporting_trigger_list_local = NULL; + if (!cJSON_IsArray(reporting_trigger_list)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [reporting_trigger_list]"); goto end; } - OpenAPI_list_add(reporting_trigger_listList, (void *)OpenAPI_reporting_trigger_FromString(reporting_trigger_list_local_nonprimitive->valuestring)); - } + reporting_trigger_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(reporting_trigger_list_local, reporting_trigger_list) { + if (!cJSON_IsString(reporting_trigger_list_local)) { + ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [reporting_trigger_list]"); + goto end; + } + OpenAPI_list_add(reporting_trigger_listList, (void *)OpenAPI_reporting_trigger_FromString(reporting_trigger_list_local->valuestring)); + } } - cJSON *report_interval = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "reportInterval"); - - OpenAPI_report_interval_mdt_e report_intervalVariable; + report_interval = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "reportInterval"); if (report_interval) { if (!cJSON_IsString(report_interval)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [report_interval]"); @@ -376,9 +416,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im report_intervalVariable = OpenAPI_report_interval_mdt_FromString(report_interval->valuestring); } - cJSON *report_interval_nr = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "reportIntervalNr"); - - OpenAPI_report_interval_nr_mdt_e report_interval_nrVariable; + report_interval_nr = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "reportIntervalNr"); if (report_interval_nr) { if (!cJSON_IsString(report_interval_nr)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [report_interval_nr]"); @@ -387,9 +425,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im report_interval_nrVariable = OpenAPI_report_interval_nr_mdt_FromString(report_interval_nr->valuestring); } - cJSON *report_amount = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "reportAmount"); - - OpenAPI_report_amount_mdt_e report_amountVariable; + report_amount = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "reportAmount"); if (report_amount) { if (!cJSON_IsString(report_amount)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [report_amount]"); @@ -398,8 +434,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im report_amountVariable = OpenAPI_report_amount_mdt_FromString(report_amount->valuestring); } - cJSON *event_threshold_rsrp = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "eventThresholdRsrp"); - + event_threshold_rsrp = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "eventThresholdRsrp"); if (event_threshold_rsrp) { if (!cJSON_IsNumber(event_threshold_rsrp)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [event_threshold_rsrp]"); @@ -407,8 +442,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im } } - cJSON *event_threshold_rsrq = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "eventThresholdRsrq"); - + event_threshold_rsrq = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "eventThresholdRsrq"); if (event_threshold_rsrq) { if (!cJSON_IsNumber(event_threshold_rsrq)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [event_threshold_rsrq]"); @@ -416,8 +450,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im } } - cJSON *event_threshold_rsrp_nr = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "eventThresholdRsrpNr"); - + event_threshold_rsrp_nr = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "eventThresholdRsrpNr"); if (event_threshold_rsrp_nr) { if (!cJSON_IsNumber(event_threshold_rsrp_nr)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [event_threshold_rsrp_nr]"); @@ -425,8 +458,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im } } - cJSON *event_threshold_rsrq_nr = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "eventThresholdRsrqNr"); - + event_threshold_rsrq_nr = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "eventThresholdRsrqNr"); if (event_threshold_rsrq_nr) { if (!cJSON_IsNumber(event_threshold_rsrq_nr)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [event_threshold_rsrq_nr]"); @@ -434,9 +466,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im } } - cJSON *collection_period_rmm_lte = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "collectionPeriodRmmLte"); - - OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lteVariable; + collection_period_rmm_lte = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "collectionPeriodRmmLte"); if (collection_period_rmm_lte) { if (!cJSON_IsString(collection_period_rmm_lte)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [collection_period_rmm_lte]"); @@ -445,9 +475,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im collection_period_rmm_lteVariable = OpenAPI_collection_period_rmm_lte_mdt_FromString(collection_period_rmm_lte->valuestring); } - cJSON *collection_period_rmm_nr = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "collectionPeriodRmmNr"); - - OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nrVariable; + collection_period_rmm_nr = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "collectionPeriodRmmNr"); if (collection_period_rmm_nr) { if (!cJSON_IsString(collection_period_rmm_nr)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [collection_period_rmm_nr]"); @@ -456,9 +484,7 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im collection_period_rmm_nrVariable = OpenAPI_collection_period_rmm_nr_mdt_FromString(collection_period_rmm_nr->valuestring); } - cJSON *measurement_period_lte = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "measurementPeriodLte"); - - OpenAPI_measurement_period_lte_mdt_e measurement_period_lteVariable; + measurement_period_lte = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "measurementPeriodLte"); if (measurement_period_lte) { if (!cJSON_IsString(measurement_period_lte)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [measurement_period_lte]"); @@ -467,16 +493,12 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im measurement_period_lteVariable = OpenAPI_measurement_period_lte_mdt_FromString(measurement_period_lte->valuestring); } - cJSON *area_scope = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "areaScope"); - - OpenAPI_area_scope_t *area_scope_local_nonprim = NULL; + area_scope = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "areaScope"); if (area_scope) { area_scope_local_nonprim = OpenAPI_area_scope_parseFromJSON(area_scope); } - cJSON *positioning_method = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "positioningMethod"); - - OpenAPI_positioning_method_mdt_e positioning_methodVariable; + positioning_method = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "positioningMethod"); if (positioning_method) { if (!cJSON_IsString(positioning_method)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [positioning_method]"); @@ -485,77 +507,67 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im positioning_methodVariable = OpenAPI_positioning_method_mdt_FromString(positioning_method->valuestring); } - cJSON *add_positioning_method_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "addPositioningMethodList"); - - OpenAPI_list_t *add_positioning_method_listList; + add_positioning_method_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "addPositioningMethodList"); if (add_positioning_method_list) { - cJSON *add_positioning_method_list_local_nonprimitive; - if (!cJSON_IsArray(add_positioning_method_list)) { - ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [add_positioning_method_list]"); - goto end; - } - - add_positioning_method_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(add_positioning_method_list_local_nonprimitive, add_positioning_method_list ) { - if (!cJSON_IsString(add_positioning_method_list_local_nonprimitive)){ + cJSON *add_positioning_method_list_local = NULL; + if (!cJSON_IsArray(add_positioning_method_list)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [add_positioning_method_list]"); goto end; } - OpenAPI_list_add(add_positioning_method_listList, (void *)OpenAPI_positioning_method_mdt_FromString(add_positioning_method_list_local_nonprimitive->valuestring)); - } + add_positioning_method_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_positioning_method_list_local, add_positioning_method_list) { + if (!cJSON_IsString(add_positioning_method_list_local)) { + ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [add_positioning_method_list]"); + goto end; + } + OpenAPI_list_add(add_positioning_method_listList, (void *)OpenAPI_positioning_method_mdt_FromString(add_positioning_method_list_local->valuestring)); + } } - cJSON *mdt_allowed_plmn_id_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "mdtAllowedPlmnIdList"); - - OpenAPI_list_t *mdt_allowed_plmn_id_listList; + mdt_allowed_plmn_id_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "mdtAllowedPlmnIdList"); if (mdt_allowed_plmn_id_list) { - cJSON *mdt_allowed_plmn_id_list_local_nonprimitive; - if (!cJSON_IsArray(mdt_allowed_plmn_id_list)){ - ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); - goto end; - } - - mdt_allowed_plmn_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mdt_allowed_plmn_id_list_local_nonprimitive, mdt_allowed_plmn_id_list ) { - if (!cJSON_IsObject(mdt_allowed_plmn_id_list_local_nonprimitive)) { + cJSON *mdt_allowed_plmn_id_list_local = NULL; + if (!cJSON_IsArray(mdt_allowed_plmn_id_list)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); goto end; } - OpenAPI_plmn_id_t *mdt_allowed_plmn_id_listItem = OpenAPI_plmn_id_parseFromJSON(mdt_allowed_plmn_id_list_local_nonprimitive); - if (!mdt_allowed_plmn_id_listItem) { - ogs_error("No mdt_allowed_plmn_id_listItem"); - OpenAPI_list_free(mdt_allowed_plmn_id_listList); - goto end; + mdt_allowed_plmn_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mdt_allowed_plmn_id_list_local, mdt_allowed_plmn_id_list) { + if (!cJSON_IsObject(mdt_allowed_plmn_id_list_local)) { + ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); + goto end; + } + OpenAPI_plmn_id_t *mdt_allowed_plmn_id_listItem = OpenAPI_plmn_id_parseFromJSON(mdt_allowed_plmn_id_list_local); + if (!mdt_allowed_plmn_id_listItem) { + ogs_error("No mdt_allowed_plmn_id_listItem"); + OpenAPI_list_free(mdt_allowed_plmn_id_listList); + goto end; + } + OpenAPI_list_add(mdt_allowed_plmn_id_listList, mdt_allowed_plmn_id_listItem); } - - OpenAPI_list_add(mdt_allowed_plmn_id_listList, mdt_allowed_plmn_id_listItem); - } } - cJSON *sensor_measurement_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "sensorMeasurementList"); - - OpenAPI_list_t *sensor_measurement_listList; + sensor_measurement_list = cJSON_GetObjectItemCaseSensitive(immediate_mdt_confJSON, "sensorMeasurementList"); if (sensor_measurement_list) { - cJSON *sensor_measurement_list_local_nonprimitive; - if (!cJSON_IsArray(sensor_measurement_list)) { - ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [sensor_measurement_list]"); - goto end; - } - - sensor_measurement_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sensor_measurement_list_local_nonprimitive, sensor_measurement_list ) { - if (!cJSON_IsString(sensor_measurement_list_local_nonprimitive)){ + cJSON *sensor_measurement_list_local = NULL; + if (!cJSON_IsArray(sensor_measurement_list)) { ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [sensor_measurement_list]"); goto end; } - OpenAPI_list_add(sensor_measurement_listList, (void *)OpenAPI_sensor_measurement_FromString(sensor_measurement_list_local_nonprimitive->valuestring)); - } + sensor_measurement_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sensor_measurement_list_local, sensor_measurement_list) { + if (!cJSON_IsString(sensor_measurement_list_local)) { + ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON() failed [sensor_measurement_list]"); + goto end; + } + OpenAPI_list_add(sensor_measurement_listList, (void *)OpenAPI_sensor_measurement_FromString(sensor_measurement_list_local->valuestring)); + } } immediate_mdt_conf_local_var = OpenAPI_immediate_mdt_conf_create ( @@ -586,6 +598,37 @@ OpenAPI_immediate_mdt_conf_t *OpenAPI_immediate_mdt_conf_parseFromJSON(cJSON *im return immediate_mdt_conf_local_var; end: + if (measurement_lte_listList) { + OpenAPI_list_free(measurement_lte_listList); + measurement_lte_listList = NULL; + } + if (measurement_nr_listList) { + OpenAPI_list_free(measurement_nr_listList); + measurement_nr_listList = NULL; + } + if (reporting_trigger_listList) { + OpenAPI_list_free(reporting_trigger_listList); + reporting_trigger_listList = NULL; + } + if (area_scope_local_nonprim) { + OpenAPI_area_scope_free(area_scope_local_nonprim); + area_scope_local_nonprim = NULL; + } + if (add_positioning_method_listList) { + OpenAPI_list_free(add_positioning_method_listList); + add_positioning_method_listList = NULL; + } + if (mdt_allowed_plmn_id_listList) { + OpenAPI_list_for_each(mdt_allowed_plmn_id_listList, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(mdt_allowed_plmn_id_listList); + mdt_allowed_plmn_id_listList = NULL; + } + if (sensor_measurement_listList) { + OpenAPI_list_free(sensor_measurement_listList); + sensor_measurement_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/imsi_range.c b/lib/sbi/openapi/model/imsi_range.c index 17698bbe5..e81fc3400 100644 --- a/lib/sbi/openapi/model/imsi_range.c +++ b/lib/sbi/openapi/model/imsi_range.c @@ -22,19 +22,30 @@ OpenAPI_imsi_range_t *OpenAPI_imsi_range_create( void OpenAPI_imsi_range_free(OpenAPI_imsi_range_t *imsi_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == imsi_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(imsi_range->start); - ogs_free(imsi_range->end); - ogs_free(imsi_range->pattern); + if (imsi_range->start) { + ogs_free(imsi_range->start); + imsi_range->start = NULL; + } + if (imsi_range->end) { + ogs_free(imsi_range->end); + imsi_range->end = NULL; + } + if (imsi_range->pattern) { + ogs_free(imsi_range->pattern); + imsi_range->pattern = NULL; + } ogs_free(imsi_range); } cJSON *OpenAPI_imsi_range_convertToJSON(OpenAPI_imsi_range_t *imsi_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (imsi_range == NULL) { ogs_error("OpenAPI_imsi_range_convertToJSON() failed [ImsiRange]"); @@ -70,37 +81,38 @@ end: OpenAPI_imsi_range_t *OpenAPI_imsi_range_parseFromJSON(cJSON *imsi_rangeJSON) { OpenAPI_imsi_range_t *imsi_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + cJSON *pattern = NULL; + start = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_imsi_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_imsi_range_parseFromJSON() failed [end]"); goto end; } } - cJSON *pattern = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "pattern"); - + pattern = cJSON_GetObjectItemCaseSensitive(imsi_rangeJSON, "pattern"); if (pattern) { - if (!cJSON_IsString(pattern)) { + if (!cJSON_IsString(pattern) && !cJSON_IsNull(pattern)) { ogs_error("OpenAPI_imsi_range_parseFromJSON() failed [pattern]"); goto end; } } imsi_range_local_var = OpenAPI_imsi_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL, - pattern ? ogs_strdup(pattern->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL, + pattern && !cJSON_IsNull(pattern) ? ogs_strdup(pattern->valuestring) : NULL ); return imsi_range_local_var; diff --git a/lib/sbi/openapi/model/indirect_data_forwarding_tunnel_info.c b/lib/sbi/openapi/model/indirect_data_forwarding_tunnel_info.c index 305db69fd..4974ba4a7 100644 --- a/lib/sbi/openapi/model/indirect_data_forwarding_tunnel_info.c +++ b/lib/sbi/openapi/model/indirect_data_forwarding_tunnel_info.c @@ -30,19 +30,30 @@ OpenAPI_indirect_data_forwarding_tunnel_info_t *OpenAPI_indirect_data_forwarding void OpenAPI_indirect_data_forwarding_tunnel_info_free(OpenAPI_indirect_data_forwarding_tunnel_info_t *indirect_data_forwarding_tunnel_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == indirect_data_forwarding_tunnel_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(indirect_data_forwarding_tunnel_info->ipv4_addr); - ogs_free(indirect_data_forwarding_tunnel_info->ipv6_addr); - ogs_free(indirect_data_forwarding_tunnel_info->gtp_teid); + if (indirect_data_forwarding_tunnel_info->ipv4_addr) { + ogs_free(indirect_data_forwarding_tunnel_info->ipv4_addr); + indirect_data_forwarding_tunnel_info->ipv4_addr = NULL; + } + if (indirect_data_forwarding_tunnel_info->ipv6_addr) { + ogs_free(indirect_data_forwarding_tunnel_info->ipv6_addr); + indirect_data_forwarding_tunnel_info->ipv6_addr = NULL; + } + if (indirect_data_forwarding_tunnel_info->gtp_teid) { + ogs_free(indirect_data_forwarding_tunnel_info->gtp_teid); + indirect_data_forwarding_tunnel_info->gtp_teid = NULL; + } ogs_free(indirect_data_forwarding_tunnel_info); } cJSON *OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(OpenAPI_indirect_data_forwarding_tunnel_info_t *indirect_data_forwarding_tunnel_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (indirect_data_forwarding_tunnel_info == NULL) { ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON() failed [IndirectDataForwardingTunnelInfo]"); @@ -64,6 +75,10 @@ cJSON *OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(OpenAPI_indire } } + if (!indirect_data_forwarding_tunnel_info->gtp_teid) { + ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON() failed [gtp_teid]"); + return NULL; + } if (cJSON_AddStringToObject(item, "gtpTeid", indirect_data_forwarding_tunnel_info->gtp_teid) == NULL) { ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON() failed [gtp_teid]"); goto end; @@ -90,37 +105,39 @@ end: OpenAPI_indirect_data_forwarding_tunnel_info_t *OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(cJSON *indirect_data_forwarding_tunnel_infoJSON) { OpenAPI_indirect_data_forwarding_tunnel_info_t *indirect_data_forwarding_tunnel_info_local_var = NULL; - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "ipv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ipv6_addr = NULL; + cJSON *gtp_teid = NULL; + cJSON *drb_id = NULL; + cJSON *additional_tnl_nb = NULL; + ipv4_addr = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "ipv6Addr"); - + ipv6_addr = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "ipv6Addr"); if (ipv6_addr) { - if (!cJSON_IsString(ipv6_addr)) { + if (!cJSON_IsString(ipv6_addr) && !cJSON_IsNull(ipv6_addr)) { ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON() failed [ipv6_addr]"); goto end; } } - cJSON *gtp_teid = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "gtpTeid"); + gtp_teid = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "gtpTeid"); if (!gtp_teid) { ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON() failed [gtp_teid]"); goto end; } - if (!cJSON_IsString(gtp_teid)) { ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON() failed [gtp_teid]"); goto end; } - cJSON *drb_id = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "drbId"); - + drb_id = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "drbId"); if (drb_id) { if (!cJSON_IsNumber(drb_id)) { ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON() failed [drb_id]"); @@ -128,8 +145,7 @@ OpenAPI_indirect_data_forwarding_tunnel_info_t *OpenAPI_indirect_data_forwarding } } - cJSON *additional_tnl_nb = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "additionalTnlNb"); - + additional_tnl_nb = cJSON_GetObjectItemCaseSensitive(indirect_data_forwarding_tunnel_infoJSON, "additionalTnlNb"); if (additional_tnl_nb) { if (!cJSON_IsNumber(additional_tnl_nb)) { ogs_error("OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON() failed [additional_tnl_nb]"); @@ -138,8 +154,8 @@ OpenAPI_indirect_data_forwarding_tunnel_info_t *OpenAPI_indirect_data_forwarding } indirect_data_forwarding_tunnel_info_local_var = OpenAPI_indirect_data_forwarding_tunnel_info_create ( - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, - ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr && !cJSON_IsNull(ipv6_addr) ? ogs_strdup(ipv6_addr->valuestring) : NULL, ogs_strdup(gtp_teid->valuestring), drb_id ? true : false, drb_id ? drb_id->valuedouble : 0, diff --git a/lib/sbi/openapi/model/inline_object.c b/lib/sbi/openapi/model/inline_object.c deleted file mode 100644 index 5464ea096..000000000 --- a/lib/sbi/openapi/model/inline_object.c +++ /dev/null @@ -1,601 +0,0 @@ - -#include -#include -#include -#include "inline_object.h" - -OpenAPI_inline_object_t *OpenAPI_inline_object_create( - OpenAPI_ue_context_create_data_t *json_data, - OpenAPI_binary_t* binary_data_n2_information, - OpenAPI_binary_t* binary_data_n2_information_ext1, - OpenAPI_binary_t* binary_data_n2_information_ext2, - OpenAPI_binary_t* binary_data_n2_information_ext3, - OpenAPI_binary_t* binary_data_n2_information_ext4, - OpenAPI_binary_t* binary_data_n2_information_ext5, - OpenAPI_binary_t* binary_data_n2_information_ext6, - OpenAPI_binary_t* binary_data_n2_information_ext7, - OpenAPI_binary_t* binary_data_n2_information_ext8, - OpenAPI_binary_t* binary_data_n2_information_ext9, - OpenAPI_binary_t* binary_data_n2_information_ext10, - OpenAPI_binary_t* binary_data_n2_information_ext11, - OpenAPI_binary_t* binary_data_n2_information_ext12, - OpenAPI_binary_t* binary_data_n2_information_ext13, - OpenAPI_binary_t* binary_data_n2_information_ext14, - OpenAPI_binary_t* binary_data_n2_information_ext15, - OpenAPI_binary_t* binary_data_n2_information_ext16 -) -{ - OpenAPI_inline_object_t *inline_object_local_var = ogs_malloc(sizeof(OpenAPI_inline_object_t)); - ogs_assert(inline_object_local_var); - - inline_object_local_var->json_data = json_data; - inline_object_local_var->binary_data_n2_information = binary_data_n2_information; - inline_object_local_var->binary_data_n2_information_ext1 = binary_data_n2_information_ext1; - inline_object_local_var->binary_data_n2_information_ext2 = binary_data_n2_information_ext2; - inline_object_local_var->binary_data_n2_information_ext3 = binary_data_n2_information_ext3; - inline_object_local_var->binary_data_n2_information_ext4 = binary_data_n2_information_ext4; - inline_object_local_var->binary_data_n2_information_ext5 = binary_data_n2_information_ext5; - inline_object_local_var->binary_data_n2_information_ext6 = binary_data_n2_information_ext6; - inline_object_local_var->binary_data_n2_information_ext7 = binary_data_n2_information_ext7; - inline_object_local_var->binary_data_n2_information_ext8 = binary_data_n2_information_ext8; - inline_object_local_var->binary_data_n2_information_ext9 = binary_data_n2_information_ext9; - inline_object_local_var->binary_data_n2_information_ext10 = binary_data_n2_information_ext10; - inline_object_local_var->binary_data_n2_information_ext11 = binary_data_n2_information_ext11; - inline_object_local_var->binary_data_n2_information_ext12 = binary_data_n2_information_ext12; - inline_object_local_var->binary_data_n2_information_ext13 = binary_data_n2_information_ext13; - inline_object_local_var->binary_data_n2_information_ext14 = binary_data_n2_information_ext14; - inline_object_local_var->binary_data_n2_information_ext15 = binary_data_n2_information_ext15; - inline_object_local_var->binary_data_n2_information_ext16 = binary_data_n2_information_ext16; - - return inline_object_local_var; -} - -void OpenAPI_inline_object_free(OpenAPI_inline_object_t *inline_object) -{ - if (NULL == inline_object) { - return; - } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_create_data_free(inline_object->json_data); - ogs_free(inline_object->binary_data_n2_information->data); - ogs_free(inline_object->binary_data_n2_information_ext1->data); - ogs_free(inline_object->binary_data_n2_information_ext2->data); - ogs_free(inline_object->binary_data_n2_information_ext3->data); - ogs_free(inline_object->binary_data_n2_information_ext4->data); - ogs_free(inline_object->binary_data_n2_information_ext5->data); - ogs_free(inline_object->binary_data_n2_information_ext6->data); - ogs_free(inline_object->binary_data_n2_information_ext7->data); - ogs_free(inline_object->binary_data_n2_information_ext8->data); - ogs_free(inline_object->binary_data_n2_information_ext9->data); - ogs_free(inline_object->binary_data_n2_information_ext10->data); - ogs_free(inline_object->binary_data_n2_information_ext11->data); - ogs_free(inline_object->binary_data_n2_information_ext12->data); - ogs_free(inline_object->binary_data_n2_information_ext13->data); - ogs_free(inline_object->binary_data_n2_information_ext14->data); - ogs_free(inline_object->binary_data_n2_information_ext15->data); - ogs_free(inline_object->binary_data_n2_information_ext16->data); - ogs_free(inline_object); -} - -cJSON *OpenAPI_inline_object_convertToJSON(OpenAPI_inline_object_t *inline_object) -{ - cJSON *item = NULL; - - if (inline_object == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [inline_object]"); - return NULL; - } - - item = cJSON_CreateObject(); - if (inline_object->json_data) { - cJSON *json_data_local_JSON = OpenAPI_ue_context_create_data_convertToJSON(inline_object->json_data); - if (json_data_local_JSON == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [json_data]"); - goto end; - } - cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); - if (item->child == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [json_data]"); - goto end; - } - } - - if (inline_object->binary_data_n2_information) { - char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(inline_object->binary_data_n2_information->data,inline_object->binary_data_n2_information->len); - if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information); - } - - if (inline_object->binary_data_n2_information_ext1) { - char* encoded_str_binary_data_n2_information_ext1 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext1->data,inline_object->binary_data_n2_information_ext1->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt1", encoded_str_binary_data_n2_information_ext1) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext1]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext1); - } - - if (inline_object->binary_data_n2_information_ext2) { - char* encoded_str_binary_data_n2_information_ext2 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext2->data,inline_object->binary_data_n2_information_ext2->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt2", encoded_str_binary_data_n2_information_ext2) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext2]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext2); - } - - if (inline_object->binary_data_n2_information_ext3) { - char* encoded_str_binary_data_n2_information_ext3 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext3->data,inline_object->binary_data_n2_information_ext3->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt3", encoded_str_binary_data_n2_information_ext3) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext3]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext3); - } - - if (inline_object->binary_data_n2_information_ext4) { - char* encoded_str_binary_data_n2_information_ext4 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext4->data,inline_object->binary_data_n2_information_ext4->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt4", encoded_str_binary_data_n2_information_ext4) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext4]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext4); - } - - if (inline_object->binary_data_n2_information_ext5) { - char* encoded_str_binary_data_n2_information_ext5 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext5->data,inline_object->binary_data_n2_information_ext5->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt5", encoded_str_binary_data_n2_information_ext5) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext5]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext5); - } - - if (inline_object->binary_data_n2_information_ext6) { - char* encoded_str_binary_data_n2_information_ext6 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext6->data,inline_object->binary_data_n2_information_ext6->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt6", encoded_str_binary_data_n2_information_ext6) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext6]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext6); - } - - if (inline_object->binary_data_n2_information_ext7) { - char* encoded_str_binary_data_n2_information_ext7 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext7->data,inline_object->binary_data_n2_information_ext7->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt7", encoded_str_binary_data_n2_information_ext7) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext7]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext7); - } - - if (inline_object->binary_data_n2_information_ext8) { - char* encoded_str_binary_data_n2_information_ext8 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext8->data,inline_object->binary_data_n2_information_ext8->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt8", encoded_str_binary_data_n2_information_ext8) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext8]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext8); - } - - if (inline_object->binary_data_n2_information_ext9) { - char* encoded_str_binary_data_n2_information_ext9 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext9->data,inline_object->binary_data_n2_information_ext9->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt9", encoded_str_binary_data_n2_information_ext9) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext9]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext9); - } - - if (inline_object->binary_data_n2_information_ext10) { - char* encoded_str_binary_data_n2_information_ext10 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext10->data,inline_object->binary_data_n2_information_ext10->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt10", encoded_str_binary_data_n2_information_ext10) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext10]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext10); - } - - if (inline_object->binary_data_n2_information_ext11) { - char* encoded_str_binary_data_n2_information_ext11 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext11->data,inline_object->binary_data_n2_information_ext11->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt11", encoded_str_binary_data_n2_information_ext11) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext11]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext11); - } - - if (inline_object->binary_data_n2_information_ext12) { - char* encoded_str_binary_data_n2_information_ext12 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext12->data,inline_object->binary_data_n2_information_ext12->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt12", encoded_str_binary_data_n2_information_ext12) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext12]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext12); - } - - if (inline_object->binary_data_n2_information_ext13) { - char* encoded_str_binary_data_n2_information_ext13 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext13->data,inline_object->binary_data_n2_information_ext13->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt13", encoded_str_binary_data_n2_information_ext13) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext13]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext13); - } - - if (inline_object->binary_data_n2_information_ext14) { - char* encoded_str_binary_data_n2_information_ext14 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext14->data,inline_object->binary_data_n2_information_ext14->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt14", encoded_str_binary_data_n2_information_ext14) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext14]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext14); - } - - if (inline_object->binary_data_n2_information_ext15) { - char* encoded_str_binary_data_n2_information_ext15 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext15->data,inline_object->binary_data_n2_information_ext15->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt15", encoded_str_binary_data_n2_information_ext15) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext15]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext15); - } - - if (inline_object->binary_data_n2_information_ext16) { - char* encoded_str_binary_data_n2_information_ext16 = OpenAPI_base64encode(inline_object->binary_data_n2_information_ext16->data,inline_object->binary_data_n2_information_ext16->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt16", encoded_str_binary_data_n2_information_ext16) == NULL) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed [binary_data_n2_information_ext16]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext16); - } - -end: - return item; -} - -OpenAPI_inline_object_t *OpenAPI_inline_object_parseFromJSON(cJSON *inline_objectJSON) -{ - OpenAPI_inline_object_t *inline_object_local_var = NULL; - cJSON *json_data = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "jsonData"); - - OpenAPI_ue_context_create_data_t *json_data_local_nonprim = NULL; - if (json_data) { - json_data_local_nonprim = OpenAPI_ue_context_create_data_parseFromJSON(json_data); - } - - cJSON *binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2Information"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information); - if (binary_data_n2_information) { - if (!cJSON_IsString(binary_data_n2_information)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information]"); - goto end; - } - decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); - if (!decoded_str_binary_data_n2_information->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext1 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt1"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext1); - if (binary_data_n2_information_ext1) { - if (!cJSON_IsString(binary_data_n2_information_ext1)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext1]"); - goto end; - } - decoded_str_binary_data_n2_information_ext1->data = OpenAPI_base64decode(binary_data_n2_information_ext1->valuestring, strlen(binary_data_n2_information_ext1->valuestring), &decoded_str_binary_data_n2_information_ext1->len); - if (!decoded_str_binary_data_n2_information_ext1->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext1]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext2 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt2"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext2); - if (binary_data_n2_information_ext2) { - if (!cJSON_IsString(binary_data_n2_information_ext2)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext2]"); - goto end; - } - decoded_str_binary_data_n2_information_ext2->data = OpenAPI_base64decode(binary_data_n2_information_ext2->valuestring, strlen(binary_data_n2_information_ext2->valuestring), &decoded_str_binary_data_n2_information_ext2->len); - if (!decoded_str_binary_data_n2_information_ext2->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext2]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext3 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt3"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext3 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext3); - if (binary_data_n2_information_ext3) { - if (!cJSON_IsString(binary_data_n2_information_ext3)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext3]"); - goto end; - } - decoded_str_binary_data_n2_information_ext3->data = OpenAPI_base64decode(binary_data_n2_information_ext3->valuestring, strlen(binary_data_n2_information_ext3->valuestring), &decoded_str_binary_data_n2_information_ext3->len); - if (!decoded_str_binary_data_n2_information_ext3->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext3]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext4 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt4"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext4 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext4); - if (binary_data_n2_information_ext4) { - if (!cJSON_IsString(binary_data_n2_information_ext4)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext4]"); - goto end; - } - decoded_str_binary_data_n2_information_ext4->data = OpenAPI_base64decode(binary_data_n2_information_ext4->valuestring, strlen(binary_data_n2_information_ext4->valuestring), &decoded_str_binary_data_n2_information_ext4->len); - if (!decoded_str_binary_data_n2_information_ext4->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext4]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext5 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt5"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext5 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext5); - if (binary_data_n2_information_ext5) { - if (!cJSON_IsString(binary_data_n2_information_ext5)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext5]"); - goto end; - } - decoded_str_binary_data_n2_information_ext5->data = OpenAPI_base64decode(binary_data_n2_information_ext5->valuestring, strlen(binary_data_n2_information_ext5->valuestring), &decoded_str_binary_data_n2_information_ext5->len); - if (!decoded_str_binary_data_n2_information_ext5->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext5]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext6 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt6"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext6 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext6); - if (binary_data_n2_information_ext6) { - if (!cJSON_IsString(binary_data_n2_information_ext6)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext6]"); - goto end; - } - decoded_str_binary_data_n2_information_ext6->data = OpenAPI_base64decode(binary_data_n2_information_ext6->valuestring, strlen(binary_data_n2_information_ext6->valuestring), &decoded_str_binary_data_n2_information_ext6->len); - if (!decoded_str_binary_data_n2_information_ext6->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext6]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext7 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt7"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext7 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext7); - if (binary_data_n2_information_ext7) { - if (!cJSON_IsString(binary_data_n2_information_ext7)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext7]"); - goto end; - } - decoded_str_binary_data_n2_information_ext7->data = OpenAPI_base64decode(binary_data_n2_information_ext7->valuestring, strlen(binary_data_n2_information_ext7->valuestring), &decoded_str_binary_data_n2_information_ext7->len); - if (!decoded_str_binary_data_n2_information_ext7->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext7]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext8 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt8"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext8 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext8); - if (binary_data_n2_information_ext8) { - if (!cJSON_IsString(binary_data_n2_information_ext8)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext8]"); - goto end; - } - decoded_str_binary_data_n2_information_ext8->data = OpenAPI_base64decode(binary_data_n2_information_ext8->valuestring, strlen(binary_data_n2_information_ext8->valuestring), &decoded_str_binary_data_n2_information_ext8->len); - if (!decoded_str_binary_data_n2_information_ext8->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext8]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext9 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt9"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext9 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext9); - if (binary_data_n2_information_ext9) { - if (!cJSON_IsString(binary_data_n2_information_ext9)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext9]"); - goto end; - } - decoded_str_binary_data_n2_information_ext9->data = OpenAPI_base64decode(binary_data_n2_information_ext9->valuestring, strlen(binary_data_n2_information_ext9->valuestring), &decoded_str_binary_data_n2_information_ext9->len); - if (!decoded_str_binary_data_n2_information_ext9->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext9]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext10 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt10"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext10 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext10); - if (binary_data_n2_information_ext10) { - if (!cJSON_IsString(binary_data_n2_information_ext10)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext10]"); - goto end; - } - decoded_str_binary_data_n2_information_ext10->data = OpenAPI_base64decode(binary_data_n2_information_ext10->valuestring, strlen(binary_data_n2_information_ext10->valuestring), &decoded_str_binary_data_n2_information_ext10->len); - if (!decoded_str_binary_data_n2_information_ext10->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext10]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext11 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt11"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext11 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext11); - if (binary_data_n2_information_ext11) { - if (!cJSON_IsString(binary_data_n2_information_ext11)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext11]"); - goto end; - } - decoded_str_binary_data_n2_information_ext11->data = OpenAPI_base64decode(binary_data_n2_information_ext11->valuestring, strlen(binary_data_n2_information_ext11->valuestring), &decoded_str_binary_data_n2_information_ext11->len); - if (!decoded_str_binary_data_n2_information_ext11->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext11]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext12 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt12"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext12 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext12); - if (binary_data_n2_information_ext12) { - if (!cJSON_IsString(binary_data_n2_information_ext12)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext12]"); - goto end; - } - decoded_str_binary_data_n2_information_ext12->data = OpenAPI_base64decode(binary_data_n2_information_ext12->valuestring, strlen(binary_data_n2_information_ext12->valuestring), &decoded_str_binary_data_n2_information_ext12->len); - if (!decoded_str_binary_data_n2_information_ext12->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext12]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext13 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt13"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext13 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext13); - if (binary_data_n2_information_ext13) { - if (!cJSON_IsString(binary_data_n2_information_ext13)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext13]"); - goto end; - } - decoded_str_binary_data_n2_information_ext13->data = OpenAPI_base64decode(binary_data_n2_information_ext13->valuestring, strlen(binary_data_n2_information_ext13->valuestring), &decoded_str_binary_data_n2_information_ext13->len); - if (!decoded_str_binary_data_n2_information_ext13->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext13]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext14 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt14"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext14 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext14); - if (binary_data_n2_information_ext14) { - if (!cJSON_IsString(binary_data_n2_information_ext14)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext14]"); - goto end; - } - decoded_str_binary_data_n2_information_ext14->data = OpenAPI_base64decode(binary_data_n2_information_ext14->valuestring, strlen(binary_data_n2_information_ext14->valuestring), &decoded_str_binary_data_n2_information_ext14->len); - if (!decoded_str_binary_data_n2_information_ext14->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext14]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext15 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt15"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext15 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext15); - if (binary_data_n2_information_ext15) { - if (!cJSON_IsString(binary_data_n2_information_ext15)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext15]"); - goto end; - } - decoded_str_binary_data_n2_information_ext15->data = OpenAPI_base64decode(binary_data_n2_information_ext15->valuestring, strlen(binary_data_n2_information_ext15->valuestring), &decoded_str_binary_data_n2_information_ext15->len); - if (!decoded_str_binary_data_n2_information_ext15->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext15]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext16 = cJSON_GetObjectItemCaseSensitive(inline_objectJSON, "binaryDataN2InformationExt16"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext16 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext16); - if (binary_data_n2_information_ext16) { - if (!cJSON_IsString(binary_data_n2_information_ext16)) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext16]"); - goto end; - } - decoded_str_binary_data_n2_information_ext16->data = OpenAPI_base64decode(binary_data_n2_information_ext16->valuestring, strlen(binary_data_n2_information_ext16->valuestring), &decoded_str_binary_data_n2_information_ext16->len); - if (!decoded_str_binary_data_n2_information_ext16->data) { - ogs_error("OpenAPI_inline_object_parseFromJSON() failed [binary_data_n2_information_ext16]"); - goto end; - } - } - - inline_object_local_var = OpenAPI_inline_object_create ( - json_data ? json_data_local_nonprim : NULL, - binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL, - binary_data_n2_information_ext1 ? decoded_str_binary_data_n2_information_ext1 : NULL, - binary_data_n2_information_ext2 ? decoded_str_binary_data_n2_information_ext2 : NULL, - binary_data_n2_information_ext3 ? decoded_str_binary_data_n2_information_ext3 : NULL, - binary_data_n2_information_ext4 ? decoded_str_binary_data_n2_information_ext4 : NULL, - binary_data_n2_information_ext5 ? decoded_str_binary_data_n2_information_ext5 : NULL, - binary_data_n2_information_ext6 ? decoded_str_binary_data_n2_information_ext6 : NULL, - binary_data_n2_information_ext7 ? decoded_str_binary_data_n2_information_ext7 : NULL, - binary_data_n2_information_ext8 ? decoded_str_binary_data_n2_information_ext8 : NULL, - binary_data_n2_information_ext9 ? decoded_str_binary_data_n2_information_ext9 : NULL, - binary_data_n2_information_ext10 ? decoded_str_binary_data_n2_information_ext10 : NULL, - binary_data_n2_information_ext11 ? decoded_str_binary_data_n2_information_ext11 : NULL, - binary_data_n2_information_ext12 ? decoded_str_binary_data_n2_information_ext12 : NULL, - binary_data_n2_information_ext13 ? decoded_str_binary_data_n2_information_ext13 : NULL, - binary_data_n2_information_ext14 ? decoded_str_binary_data_n2_information_ext14 : NULL, - binary_data_n2_information_ext15 ? decoded_str_binary_data_n2_information_ext15 : NULL, - binary_data_n2_information_ext16 ? decoded_str_binary_data_n2_information_ext16 : NULL - ); - - return inline_object_local_var; -end: - return NULL; -} - -OpenAPI_inline_object_t *OpenAPI_inline_object_copy(OpenAPI_inline_object_t *dst, OpenAPI_inline_object_t *src) -{ - cJSON *item = NULL; - char *content = NULL; - - ogs_assert(src); - item = OpenAPI_inline_object_convertToJSON(src); - if (!item) { - ogs_error("OpenAPI_inline_object_convertToJSON() failed"); - return NULL; - } - - content = cJSON_Print(item); - cJSON_Delete(item); - - if (!content) { - ogs_error("cJSON_Print() failed"); - return NULL; - } - - item = cJSON_Parse(content); - ogs_free(content); - if (!item) { - ogs_error("cJSON_Parse() failed"); - return NULL; - } - - OpenAPI_inline_object_free(dst); - dst = OpenAPI_inline_object_parseFromJSON(item); - cJSON_Delete(item); - - return dst; -} - diff --git a/lib/sbi/openapi/model/inline_object_1.c b/lib/sbi/openapi/model/inline_object_1.c deleted file mode 100644 index b06d936ee..000000000 --- a/lib/sbi/openapi/model/inline_object_1.c +++ /dev/null @@ -1,630 +0,0 @@ - -#include -#include -#include -#include "inline_object_1.h" - -OpenAPI_inline_object_1_t *OpenAPI_inline_object_1_create( - OpenAPI_ue_context_relocate_data_t *json_data, - OpenAPI_binary_t* binary_data_gtpc_message, - OpenAPI_binary_t* binary_data_n2_information, - OpenAPI_binary_t* binary_data_n2_information_ext1, - OpenAPI_binary_t* binary_data_n2_information_ext2, - OpenAPI_binary_t* binary_data_n2_information_ext3, - OpenAPI_binary_t* binary_data_n2_information_ext4, - OpenAPI_binary_t* binary_data_n2_information_ext5, - OpenAPI_binary_t* binary_data_n2_information_ext6, - OpenAPI_binary_t* binary_data_n2_information_ext7, - OpenAPI_binary_t* binary_data_n2_information_ext8, - OpenAPI_binary_t* binary_data_n2_information_ext9, - OpenAPI_binary_t* binary_data_n2_information_ext10, - OpenAPI_binary_t* binary_data_n2_information_ext11, - OpenAPI_binary_t* binary_data_n2_information_ext12, - OpenAPI_binary_t* binary_data_n2_information_ext13, - OpenAPI_binary_t* binary_data_n2_information_ext14, - OpenAPI_binary_t* binary_data_n2_information_ext15, - OpenAPI_binary_t* binary_data_n2_information_ext16 -) -{ - OpenAPI_inline_object_1_t *inline_object_1_local_var = ogs_malloc(sizeof(OpenAPI_inline_object_1_t)); - ogs_assert(inline_object_1_local_var); - - inline_object_1_local_var->json_data = json_data; - inline_object_1_local_var->binary_data_gtpc_message = binary_data_gtpc_message; - inline_object_1_local_var->binary_data_n2_information = binary_data_n2_information; - inline_object_1_local_var->binary_data_n2_information_ext1 = binary_data_n2_information_ext1; - inline_object_1_local_var->binary_data_n2_information_ext2 = binary_data_n2_information_ext2; - inline_object_1_local_var->binary_data_n2_information_ext3 = binary_data_n2_information_ext3; - inline_object_1_local_var->binary_data_n2_information_ext4 = binary_data_n2_information_ext4; - inline_object_1_local_var->binary_data_n2_information_ext5 = binary_data_n2_information_ext5; - inline_object_1_local_var->binary_data_n2_information_ext6 = binary_data_n2_information_ext6; - inline_object_1_local_var->binary_data_n2_information_ext7 = binary_data_n2_information_ext7; - inline_object_1_local_var->binary_data_n2_information_ext8 = binary_data_n2_information_ext8; - inline_object_1_local_var->binary_data_n2_information_ext9 = binary_data_n2_information_ext9; - inline_object_1_local_var->binary_data_n2_information_ext10 = binary_data_n2_information_ext10; - inline_object_1_local_var->binary_data_n2_information_ext11 = binary_data_n2_information_ext11; - inline_object_1_local_var->binary_data_n2_information_ext12 = binary_data_n2_information_ext12; - inline_object_1_local_var->binary_data_n2_information_ext13 = binary_data_n2_information_ext13; - inline_object_1_local_var->binary_data_n2_information_ext14 = binary_data_n2_information_ext14; - inline_object_1_local_var->binary_data_n2_information_ext15 = binary_data_n2_information_ext15; - inline_object_1_local_var->binary_data_n2_information_ext16 = binary_data_n2_information_ext16; - - return inline_object_1_local_var; -} - -void OpenAPI_inline_object_1_free(OpenAPI_inline_object_1_t *inline_object_1) -{ - if (NULL == inline_object_1) { - return; - } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_relocate_data_free(inline_object_1->json_data); - ogs_free(inline_object_1->binary_data_gtpc_message->data); - ogs_free(inline_object_1->binary_data_n2_information->data); - ogs_free(inline_object_1->binary_data_n2_information_ext1->data); - ogs_free(inline_object_1->binary_data_n2_information_ext2->data); - ogs_free(inline_object_1->binary_data_n2_information_ext3->data); - ogs_free(inline_object_1->binary_data_n2_information_ext4->data); - ogs_free(inline_object_1->binary_data_n2_information_ext5->data); - ogs_free(inline_object_1->binary_data_n2_information_ext6->data); - ogs_free(inline_object_1->binary_data_n2_information_ext7->data); - ogs_free(inline_object_1->binary_data_n2_information_ext8->data); - ogs_free(inline_object_1->binary_data_n2_information_ext9->data); - ogs_free(inline_object_1->binary_data_n2_information_ext10->data); - ogs_free(inline_object_1->binary_data_n2_information_ext11->data); - ogs_free(inline_object_1->binary_data_n2_information_ext12->data); - ogs_free(inline_object_1->binary_data_n2_information_ext13->data); - ogs_free(inline_object_1->binary_data_n2_information_ext14->data); - ogs_free(inline_object_1->binary_data_n2_information_ext15->data); - ogs_free(inline_object_1->binary_data_n2_information_ext16->data); - ogs_free(inline_object_1); -} - -cJSON *OpenAPI_inline_object_1_convertToJSON(OpenAPI_inline_object_1_t *inline_object_1) -{ - cJSON *item = NULL; - - if (inline_object_1 == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [inline_object_1]"); - return NULL; - } - - item = cJSON_CreateObject(); - if (inline_object_1->json_data) { - cJSON *json_data_local_JSON = OpenAPI_ue_context_relocate_data_convertToJSON(inline_object_1->json_data); - if (json_data_local_JSON == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [json_data]"); - goto end; - } - cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); - if (item->child == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [json_data]"); - goto end; - } - } - - if (inline_object_1->binary_data_gtpc_message) { - char* encoded_str_binary_data_gtpc_message = OpenAPI_base64encode(inline_object_1->binary_data_gtpc_message->data,inline_object_1->binary_data_gtpc_message->len); - if (cJSON_AddStringToObject(item, "binaryDataGtpcMessage", encoded_str_binary_data_gtpc_message) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_gtpc_message]"); - goto end; - } - ogs_free(encoded_str_binary_data_gtpc_message); - } - - if (inline_object_1->binary_data_n2_information) { - char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(inline_object_1->binary_data_n2_information->data,inline_object_1->binary_data_n2_information->len); - if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information); - } - - if (inline_object_1->binary_data_n2_information_ext1) { - char* encoded_str_binary_data_n2_information_ext1 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext1->data,inline_object_1->binary_data_n2_information_ext1->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt1", encoded_str_binary_data_n2_information_ext1) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext1]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext1); - } - - if (inline_object_1->binary_data_n2_information_ext2) { - char* encoded_str_binary_data_n2_information_ext2 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext2->data,inline_object_1->binary_data_n2_information_ext2->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt2", encoded_str_binary_data_n2_information_ext2) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext2]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext2); - } - - if (inline_object_1->binary_data_n2_information_ext3) { - char* encoded_str_binary_data_n2_information_ext3 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext3->data,inline_object_1->binary_data_n2_information_ext3->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt3", encoded_str_binary_data_n2_information_ext3) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext3]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext3); - } - - if (inline_object_1->binary_data_n2_information_ext4) { - char* encoded_str_binary_data_n2_information_ext4 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext4->data,inline_object_1->binary_data_n2_information_ext4->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt4", encoded_str_binary_data_n2_information_ext4) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext4]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext4); - } - - if (inline_object_1->binary_data_n2_information_ext5) { - char* encoded_str_binary_data_n2_information_ext5 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext5->data,inline_object_1->binary_data_n2_information_ext5->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt5", encoded_str_binary_data_n2_information_ext5) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext5]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext5); - } - - if (inline_object_1->binary_data_n2_information_ext6) { - char* encoded_str_binary_data_n2_information_ext6 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext6->data,inline_object_1->binary_data_n2_information_ext6->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt6", encoded_str_binary_data_n2_information_ext6) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext6]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext6); - } - - if (inline_object_1->binary_data_n2_information_ext7) { - char* encoded_str_binary_data_n2_information_ext7 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext7->data,inline_object_1->binary_data_n2_information_ext7->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt7", encoded_str_binary_data_n2_information_ext7) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext7]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext7); - } - - if (inline_object_1->binary_data_n2_information_ext8) { - char* encoded_str_binary_data_n2_information_ext8 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext8->data,inline_object_1->binary_data_n2_information_ext8->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt8", encoded_str_binary_data_n2_information_ext8) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext8]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext8); - } - - if (inline_object_1->binary_data_n2_information_ext9) { - char* encoded_str_binary_data_n2_information_ext9 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext9->data,inline_object_1->binary_data_n2_information_ext9->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt9", encoded_str_binary_data_n2_information_ext9) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext9]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext9); - } - - if (inline_object_1->binary_data_n2_information_ext10) { - char* encoded_str_binary_data_n2_information_ext10 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext10->data,inline_object_1->binary_data_n2_information_ext10->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt10", encoded_str_binary_data_n2_information_ext10) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext10]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext10); - } - - if (inline_object_1->binary_data_n2_information_ext11) { - char* encoded_str_binary_data_n2_information_ext11 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext11->data,inline_object_1->binary_data_n2_information_ext11->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt11", encoded_str_binary_data_n2_information_ext11) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext11]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext11); - } - - if (inline_object_1->binary_data_n2_information_ext12) { - char* encoded_str_binary_data_n2_information_ext12 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext12->data,inline_object_1->binary_data_n2_information_ext12->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt12", encoded_str_binary_data_n2_information_ext12) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext12]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext12); - } - - if (inline_object_1->binary_data_n2_information_ext13) { - char* encoded_str_binary_data_n2_information_ext13 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext13->data,inline_object_1->binary_data_n2_information_ext13->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt13", encoded_str_binary_data_n2_information_ext13) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext13]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext13); - } - - if (inline_object_1->binary_data_n2_information_ext14) { - char* encoded_str_binary_data_n2_information_ext14 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext14->data,inline_object_1->binary_data_n2_information_ext14->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt14", encoded_str_binary_data_n2_information_ext14) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext14]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext14); - } - - if (inline_object_1->binary_data_n2_information_ext15) { - char* encoded_str_binary_data_n2_information_ext15 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext15->data,inline_object_1->binary_data_n2_information_ext15->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt15", encoded_str_binary_data_n2_information_ext15) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext15]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext15); - } - - if (inline_object_1->binary_data_n2_information_ext16) { - char* encoded_str_binary_data_n2_information_ext16 = OpenAPI_base64encode(inline_object_1->binary_data_n2_information_ext16->data,inline_object_1->binary_data_n2_information_ext16->len); - if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt16", encoded_str_binary_data_n2_information_ext16) == NULL) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed [binary_data_n2_information_ext16]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information_ext16); - } - -end: - return item; -} - -OpenAPI_inline_object_1_t *OpenAPI_inline_object_1_parseFromJSON(cJSON *inline_object_1JSON) -{ - OpenAPI_inline_object_1_t *inline_object_1_local_var = NULL; - cJSON *json_data = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "jsonData"); - - OpenAPI_ue_context_relocate_data_t *json_data_local_nonprim = NULL; - if (json_data) { - json_data_local_nonprim = OpenAPI_ue_context_relocate_data_parseFromJSON(json_data); - } - - cJSON *binary_data_gtpc_message = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataGtpcMessage"); - - OpenAPI_binary_t* decoded_str_binary_data_gtpc_message = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_gtpc_message); - if (binary_data_gtpc_message) { - if (!cJSON_IsString(binary_data_gtpc_message)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_gtpc_message]"); - goto end; - } - decoded_str_binary_data_gtpc_message->data = OpenAPI_base64decode(binary_data_gtpc_message->valuestring, strlen(binary_data_gtpc_message->valuestring), &decoded_str_binary_data_gtpc_message->len); - if (!decoded_str_binary_data_gtpc_message->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_gtpc_message]"); - goto end; - } - } - - cJSON *binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2Information"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information); - if (binary_data_n2_information) { - if (!cJSON_IsString(binary_data_n2_information)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information]"); - goto end; - } - decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); - if (!decoded_str_binary_data_n2_information->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext1 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt1"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext1); - if (binary_data_n2_information_ext1) { - if (!cJSON_IsString(binary_data_n2_information_ext1)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext1]"); - goto end; - } - decoded_str_binary_data_n2_information_ext1->data = OpenAPI_base64decode(binary_data_n2_information_ext1->valuestring, strlen(binary_data_n2_information_ext1->valuestring), &decoded_str_binary_data_n2_information_ext1->len); - if (!decoded_str_binary_data_n2_information_ext1->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext1]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext2 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt2"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext2); - if (binary_data_n2_information_ext2) { - if (!cJSON_IsString(binary_data_n2_information_ext2)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext2]"); - goto end; - } - decoded_str_binary_data_n2_information_ext2->data = OpenAPI_base64decode(binary_data_n2_information_ext2->valuestring, strlen(binary_data_n2_information_ext2->valuestring), &decoded_str_binary_data_n2_information_ext2->len); - if (!decoded_str_binary_data_n2_information_ext2->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext2]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext3 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt3"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext3 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext3); - if (binary_data_n2_information_ext3) { - if (!cJSON_IsString(binary_data_n2_information_ext3)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext3]"); - goto end; - } - decoded_str_binary_data_n2_information_ext3->data = OpenAPI_base64decode(binary_data_n2_information_ext3->valuestring, strlen(binary_data_n2_information_ext3->valuestring), &decoded_str_binary_data_n2_information_ext3->len); - if (!decoded_str_binary_data_n2_information_ext3->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext3]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext4 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt4"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext4 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext4); - if (binary_data_n2_information_ext4) { - if (!cJSON_IsString(binary_data_n2_information_ext4)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext4]"); - goto end; - } - decoded_str_binary_data_n2_information_ext4->data = OpenAPI_base64decode(binary_data_n2_information_ext4->valuestring, strlen(binary_data_n2_information_ext4->valuestring), &decoded_str_binary_data_n2_information_ext4->len); - if (!decoded_str_binary_data_n2_information_ext4->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext4]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext5 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt5"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext5 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext5); - if (binary_data_n2_information_ext5) { - if (!cJSON_IsString(binary_data_n2_information_ext5)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext5]"); - goto end; - } - decoded_str_binary_data_n2_information_ext5->data = OpenAPI_base64decode(binary_data_n2_information_ext5->valuestring, strlen(binary_data_n2_information_ext5->valuestring), &decoded_str_binary_data_n2_information_ext5->len); - if (!decoded_str_binary_data_n2_information_ext5->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext5]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext6 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt6"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext6 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext6); - if (binary_data_n2_information_ext6) { - if (!cJSON_IsString(binary_data_n2_information_ext6)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext6]"); - goto end; - } - decoded_str_binary_data_n2_information_ext6->data = OpenAPI_base64decode(binary_data_n2_information_ext6->valuestring, strlen(binary_data_n2_information_ext6->valuestring), &decoded_str_binary_data_n2_information_ext6->len); - if (!decoded_str_binary_data_n2_information_ext6->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext6]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext7 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt7"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext7 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext7); - if (binary_data_n2_information_ext7) { - if (!cJSON_IsString(binary_data_n2_information_ext7)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext7]"); - goto end; - } - decoded_str_binary_data_n2_information_ext7->data = OpenAPI_base64decode(binary_data_n2_information_ext7->valuestring, strlen(binary_data_n2_information_ext7->valuestring), &decoded_str_binary_data_n2_information_ext7->len); - if (!decoded_str_binary_data_n2_information_ext7->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext7]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext8 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt8"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext8 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext8); - if (binary_data_n2_information_ext8) { - if (!cJSON_IsString(binary_data_n2_information_ext8)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext8]"); - goto end; - } - decoded_str_binary_data_n2_information_ext8->data = OpenAPI_base64decode(binary_data_n2_information_ext8->valuestring, strlen(binary_data_n2_information_ext8->valuestring), &decoded_str_binary_data_n2_information_ext8->len); - if (!decoded_str_binary_data_n2_information_ext8->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext8]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext9 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt9"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext9 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext9); - if (binary_data_n2_information_ext9) { - if (!cJSON_IsString(binary_data_n2_information_ext9)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext9]"); - goto end; - } - decoded_str_binary_data_n2_information_ext9->data = OpenAPI_base64decode(binary_data_n2_information_ext9->valuestring, strlen(binary_data_n2_information_ext9->valuestring), &decoded_str_binary_data_n2_information_ext9->len); - if (!decoded_str_binary_data_n2_information_ext9->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext9]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext10 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt10"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext10 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext10); - if (binary_data_n2_information_ext10) { - if (!cJSON_IsString(binary_data_n2_information_ext10)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext10]"); - goto end; - } - decoded_str_binary_data_n2_information_ext10->data = OpenAPI_base64decode(binary_data_n2_information_ext10->valuestring, strlen(binary_data_n2_information_ext10->valuestring), &decoded_str_binary_data_n2_information_ext10->len); - if (!decoded_str_binary_data_n2_information_ext10->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext10]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext11 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt11"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext11 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext11); - if (binary_data_n2_information_ext11) { - if (!cJSON_IsString(binary_data_n2_information_ext11)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext11]"); - goto end; - } - decoded_str_binary_data_n2_information_ext11->data = OpenAPI_base64decode(binary_data_n2_information_ext11->valuestring, strlen(binary_data_n2_information_ext11->valuestring), &decoded_str_binary_data_n2_information_ext11->len); - if (!decoded_str_binary_data_n2_information_ext11->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext11]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext12 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt12"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext12 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext12); - if (binary_data_n2_information_ext12) { - if (!cJSON_IsString(binary_data_n2_information_ext12)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext12]"); - goto end; - } - decoded_str_binary_data_n2_information_ext12->data = OpenAPI_base64decode(binary_data_n2_information_ext12->valuestring, strlen(binary_data_n2_information_ext12->valuestring), &decoded_str_binary_data_n2_information_ext12->len); - if (!decoded_str_binary_data_n2_information_ext12->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext12]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext13 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt13"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext13 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext13); - if (binary_data_n2_information_ext13) { - if (!cJSON_IsString(binary_data_n2_information_ext13)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext13]"); - goto end; - } - decoded_str_binary_data_n2_information_ext13->data = OpenAPI_base64decode(binary_data_n2_information_ext13->valuestring, strlen(binary_data_n2_information_ext13->valuestring), &decoded_str_binary_data_n2_information_ext13->len); - if (!decoded_str_binary_data_n2_information_ext13->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext13]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext14 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt14"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext14 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext14); - if (binary_data_n2_information_ext14) { - if (!cJSON_IsString(binary_data_n2_information_ext14)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext14]"); - goto end; - } - decoded_str_binary_data_n2_information_ext14->data = OpenAPI_base64decode(binary_data_n2_information_ext14->valuestring, strlen(binary_data_n2_information_ext14->valuestring), &decoded_str_binary_data_n2_information_ext14->len); - if (!decoded_str_binary_data_n2_information_ext14->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext14]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext15 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt15"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext15 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext15); - if (binary_data_n2_information_ext15) { - if (!cJSON_IsString(binary_data_n2_information_ext15)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext15]"); - goto end; - } - decoded_str_binary_data_n2_information_ext15->data = OpenAPI_base64decode(binary_data_n2_information_ext15->valuestring, strlen(binary_data_n2_information_ext15->valuestring), &decoded_str_binary_data_n2_information_ext15->len); - if (!decoded_str_binary_data_n2_information_ext15->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext15]"); - goto end; - } - } - - cJSON *binary_data_n2_information_ext16 = cJSON_GetObjectItemCaseSensitive(inline_object_1JSON, "binaryDataN2InformationExt16"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information_ext16 = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information_ext16); - if (binary_data_n2_information_ext16) { - if (!cJSON_IsString(binary_data_n2_information_ext16)) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext16]"); - goto end; - } - decoded_str_binary_data_n2_information_ext16->data = OpenAPI_base64decode(binary_data_n2_information_ext16->valuestring, strlen(binary_data_n2_information_ext16->valuestring), &decoded_str_binary_data_n2_information_ext16->len); - if (!decoded_str_binary_data_n2_information_ext16->data) { - ogs_error("OpenAPI_inline_object_1_parseFromJSON() failed [binary_data_n2_information_ext16]"); - goto end; - } - } - - inline_object_1_local_var = OpenAPI_inline_object_1_create ( - json_data ? json_data_local_nonprim : NULL, - binary_data_gtpc_message ? decoded_str_binary_data_gtpc_message : NULL, - binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL, - binary_data_n2_information_ext1 ? decoded_str_binary_data_n2_information_ext1 : NULL, - binary_data_n2_information_ext2 ? decoded_str_binary_data_n2_information_ext2 : NULL, - binary_data_n2_information_ext3 ? decoded_str_binary_data_n2_information_ext3 : NULL, - binary_data_n2_information_ext4 ? decoded_str_binary_data_n2_information_ext4 : NULL, - binary_data_n2_information_ext5 ? decoded_str_binary_data_n2_information_ext5 : NULL, - binary_data_n2_information_ext6 ? decoded_str_binary_data_n2_information_ext6 : NULL, - binary_data_n2_information_ext7 ? decoded_str_binary_data_n2_information_ext7 : NULL, - binary_data_n2_information_ext8 ? decoded_str_binary_data_n2_information_ext8 : NULL, - binary_data_n2_information_ext9 ? decoded_str_binary_data_n2_information_ext9 : NULL, - binary_data_n2_information_ext10 ? decoded_str_binary_data_n2_information_ext10 : NULL, - binary_data_n2_information_ext11 ? decoded_str_binary_data_n2_information_ext11 : NULL, - binary_data_n2_information_ext12 ? decoded_str_binary_data_n2_information_ext12 : NULL, - binary_data_n2_information_ext13 ? decoded_str_binary_data_n2_information_ext13 : NULL, - binary_data_n2_information_ext14 ? decoded_str_binary_data_n2_information_ext14 : NULL, - binary_data_n2_information_ext15 ? decoded_str_binary_data_n2_information_ext15 : NULL, - binary_data_n2_information_ext16 ? decoded_str_binary_data_n2_information_ext16 : NULL - ); - - return inline_object_1_local_var; -end: - return NULL; -} - -OpenAPI_inline_object_1_t *OpenAPI_inline_object_1_copy(OpenAPI_inline_object_1_t *dst, OpenAPI_inline_object_1_t *src) -{ - cJSON *item = NULL; - char *content = NULL; - - ogs_assert(src); - item = OpenAPI_inline_object_1_convertToJSON(src); - if (!item) { - ogs_error("OpenAPI_inline_object_1_convertToJSON() failed"); - return NULL; - } - - content = cJSON_Print(item); - cJSON_Delete(item); - - if (!content) { - ogs_error("cJSON_Print() failed"); - return NULL; - } - - item = cJSON_Parse(content); - ogs_free(content); - if (!item) { - ogs_error("cJSON_Parse() failed"); - return NULL; - } - - OpenAPI_inline_object_1_free(dst); - dst = OpenAPI_inline_object_1_parseFromJSON(item); - cJSON_Delete(item); - - return dst; -} - diff --git a/lib/sbi/openapi/model/inline_object_2.c b/lib/sbi/openapi/model/inline_object_2.c deleted file mode 100644 index 7d6a19c56..000000000 --- a/lib/sbi/openapi/model/inline_object_2.c +++ /dev/null @@ -1,137 +0,0 @@ - -#include -#include -#include -#include "inline_object_2.h" - -OpenAPI_inline_object_2_t *OpenAPI_inline_object_2_create( - OpenAPI_ue_context_cancel_relocate_data_t *json_data, - OpenAPI_binary_t* binary_data_gtpc_message -) -{ - OpenAPI_inline_object_2_t *inline_object_2_local_var = ogs_malloc(sizeof(OpenAPI_inline_object_2_t)); - ogs_assert(inline_object_2_local_var); - - inline_object_2_local_var->json_data = json_data; - inline_object_2_local_var->binary_data_gtpc_message = binary_data_gtpc_message; - - return inline_object_2_local_var; -} - -void OpenAPI_inline_object_2_free(OpenAPI_inline_object_2_t *inline_object_2) -{ - if (NULL == inline_object_2) { - return; - } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_cancel_relocate_data_free(inline_object_2->json_data); - ogs_free(inline_object_2->binary_data_gtpc_message->data); - ogs_free(inline_object_2); -} - -cJSON *OpenAPI_inline_object_2_convertToJSON(OpenAPI_inline_object_2_t *inline_object_2) -{ - cJSON *item = NULL; - - if (inline_object_2 == NULL) { - ogs_error("OpenAPI_inline_object_2_convertToJSON() failed [inline_object_2]"); - return NULL; - } - - item = cJSON_CreateObject(); - if (inline_object_2->json_data) { - cJSON *json_data_local_JSON = OpenAPI_ue_context_cancel_relocate_data_convertToJSON(inline_object_2->json_data); - if (json_data_local_JSON == NULL) { - ogs_error("OpenAPI_inline_object_2_convertToJSON() failed [json_data]"); - goto end; - } - cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); - if (item->child == NULL) { - ogs_error("OpenAPI_inline_object_2_convertToJSON() failed [json_data]"); - goto end; - } - } - - if (inline_object_2->binary_data_gtpc_message) { - char* encoded_str_binary_data_gtpc_message = OpenAPI_base64encode(inline_object_2->binary_data_gtpc_message->data,inline_object_2->binary_data_gtpc_message->len); - if (cJSON_AddStringToObject(item, "binaryDataGtpcMessage", encoded_str_binary_data_gtpc_message) == NULL) { - ogs_error("OpenAPI_inline_object_2_convertToJSON() failed [binary_data_gtpc_message]"); - goto end; - } - ogs_free(encoded_str_binary_data_gtpc_message); - } - -end: - return item; -} - -OpenAPI_inline_object_2_t *OpenAPI_inline_object_2_parseFromJSON(cJSON *inline_object_2JSON) -{ - OpenAPI_inline_object_2_t *inline_object_2_local_var = NULL; - cJSON *json_data = cJSON_GetObjectItemCaseSensitive(inline_object_2JSON, "jsonData"); - - OpenAPI_ue_context_cancel_relocate_data_t *json_data_local_nonprim = NULL; - if (json_data) { - json_data_local_nonprim = OpenAPI_ue_context_cancel_relocate_data_parseFromJSON(json_data); - } - - cJSON *binary_data_gtpc_message = cJSON_GetObjectItemCaseSensitive(inline_object_2JSON, "binaryDataGtpcMessage"); - - OpenAPI_binary_t* decoded_str_binary_data_gtpc_message = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_gtpc_message); - if (binary_data_gtpc_message) { - if (!cJSON_IsString(binary_data_gtpc_message)) { - ogs_error("OpenAPI_inline_object_2_parseFromJSON() failed [binary_data_gtpc_message]"); - goto end; - } - decoded_str_binary_data_gtpc_message->data = OpenAPI_base64decode(binary_data_gtpc_message->valuestring, strlen(binary_data_gtpc_message->valuestring), &decoded_str_binary_data_gtpc_message->len); - if (!decoded_str_binary_data_gtpc_message->data) { - ogs_error("OpenAPI_inline_object_2_parseFromJSON() failed [binary_data_gtpc_message]"); - goto end; - } - } - - inline_object_2_local_var = OpenAPI_inline_object_2_create ( - json_data ? json_data_local_nonprim : NULL, - binary_data_gtpc_message ? decoded_str_binary_data_gtpc_message : NULL - ); - - return inline_object_2_local_var; -end: - return NULL; -} - -OpenAPI_inline_object_2_t *OpenAPI_inline_object_2_copy(OpenAPI_inline_object_2_t *dst, OpenAPI_inline_object_2_t *src) -{ - cJSON *item = NULL; - char *content = NULL; - - ogs_assert(src); - item = OpenAPI_inline_object_2_convertToJSON(src); - if (!item) { - ogs_error("OpenAPI_inline_object_2_convertToJSON() failed"); - return NULL; - } - - content = cJSON_Print(item); - cJSON_Delete(item); - - if (!content) { - ogs_error("cJSON_Print() failed"); - return NULL; - } - - item = cJSON_Parse(content); - ogs_free(content); - if (!item) { - ogs_error("cJSON_Parse() failed"); - return NULL; - } - - OpenAPI_inline_object_2_free(dst); - dst = OpenAPI_inline_object_2_parseFromJSON(item); - cJSON_Delete(item); - - return dst; -} - diff --git a/lib/sbi/openapi/model/inline_object_2.h b/lib/sbi/openapi/model/inline_object_2.h deleted file mode 100644 index 264e3c33c..000000000 --- a/lib/sbi/openapi/model/inline_object_2.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * inline_object_2.h - * - * - */ - -#ifndef _OpenAPI_inline_object_2_H_ -#define _OpenAPI_inline_object_2_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "ue_context_cancel_relocate_data.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct OpenAPI_inline_object_2_s OpenAPI_inline_object_2_t; -typedef struct OpenAPI_inline_object_2_s { - struct OpenAPI_ue_context_cancel_relocate_data_s *json_data; - OpenAPI_binary_t* binary_data_gtpc_message; -} OpenAPI_inline_object_2_t; - -OpenAPI_inline_object_2_t *OpenAPI_inline_object_2_create( - OpenAPI_ue_context_cancel_relocate_data_t *json_data, - OpenAPI_binary_t* binary_data_gtpc_message -); -void OpenAPI_inline_object_2_free(OpenAPI_inline_object_2_t *inline_object_2); -OpenAPI_inline_object_2_t *OpenAPI_inline_object_2_parseFromJSON(cJSON *inline_object_2JSON); -cJSON *OpenAPI_inline_object_2_convertToJSON(OpenAPI_inline_object_2_t *inline_object_2); -OpenAPI_inline_object_2_t *OpenAPI_inline_object_2_copy(OpenAPI_inline_object_2_t *dst, OpenAPI_inline_object_2_t *src); - -#ifdef __cplusplus -} -#endif - -#endif /* _OpenAPI_inline_object_2_H_ */ - diff --git a/lib/sbi/openapi/model/inline_object_3.c b/lib/sbi/openapi/model/inline_object_3.c deleted file mode 100644 index 98255503a..000000000 --- a/lib/sbi/openapi/model/inline_object_3.c +++ /dev/null @@ -1,137 +0,0 @@ - -#include -#include -#include -#include "inline_object_3.h" - -OpenAPI_inline_object_3_t *OpenAPI_inline_object_3_create( - OpenAPI_n1_message_notification_t *json_data, - OpenAPI_binary_t* binary_data_n1_message -) -{ - OpenAPI_inline_object_3_t *inline_object_3_local_var = ogs_malloc(sizeof(OpenAPI_inline_object_3_t)); - ogs_assert(inline_object_3_local_var); - - inline_object_3_local_var->json_data = json_data; - inline_object_3_local_var->binary_data_n1_message = binary_data_n1_message; - - return inline_object_3_local_var; -} - -void OpenAPI_inline_object_3_free(OpenAPI_inline_object_3_t *inline_object_3) -{ - if (NULL == inline_object_3) { - return; - } - OpenAPI_lnode_t *node; - OpenAPI_n1_message_notification_free(inline_object_3->json_data); - ogs_free(inline_object_3->binary_data_n1_message->data); - ogs_free(inline_object_3); -} - -cJSON *OpenAPI_inline_object_3_convertToJSON(OpenAPI_inline_object_3_t *inline_object_3) -{ - cJSON *item = NULL; - - if (inline_object_3 == NULL) { - ogs_error("OpenAPI_inline_object_3_convertToJSON() failed [inline_object_3]"); - return NULL; - } - - item = cJSON_CreateObject(); - if (inline_object_3->json_data) { - cJSON *json_data_local_JSON = OpenAPI_n1_message_notification_convertToJSON(inline_object_3->json_data); - if (json_data_local_JSON == NULL) { - ogs_error("OpenAPI_inline_object_3_convertToJSON() failed [json_data]"); - goto end; - } - cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); - if (item->child == NULL) { - ogs_error("OpenAPI_inline_object_3_convertToJSON() failed [json_data]"); - goto end; - } - } - - if (inline_object_3->binary_data_n1_message) { - char* encoded_str_binary_data_n1_message = OpenAPI_base64encode(inline_object_3->binary_data_n1_message->data,inline_object_3->binary_data_n1_message->len); - if (cJSON_AddStringToObject(item, "binaryDataN1Message", encoded_str_binary_data_n1_message) == NULL) { - ogs_error("OpenAPI_inline_object_3_convertToJSON() failed [binary_data_n1_message]"); - goto end; - } - ogs_free(encoded_str_binary_data_n1_message); - } - -end: - return item; -} - -OpenAPI_inline_object_3_t *OpenAPI_inline_object_3_parseFromJSON(cJSON *inline_object_3JSON) -{ - OpenAPI_inline_object_3_t *inline_object_3_local_var = NULL; - cJSON *json_data = cJSON_GetObjectItemCaseSensitive(inline_object_3JSON, "jsonData"); - - OpenAPI_n1_message_notification_t *json_data_local_nonprim = NULL; - if (json_data) { - json_data_local_nonprim = OpenAPI_n1_message_notification_parseFromJSON(json_data); - } - - cJSON *binary_data_n1_message = cJSON_GetObjectItemCaseSensitive(inline_object_3JSON, "binaryDataN1Message"); - - OpenAPI_binary_t* decoded_str_binary_data_n1_message = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n1_message); - if (binary_data_n1_message) { - if (!cJSON_IsString(binary_data_n1_message)) { - ogs_error("OpenAPI_inline_object_3_parseFromJSON() failed [binary_data_n1_message]"); - goto end; - } - decoded_str_binary_data_n1_message->data = OpenAPI_base64decode(binary_data_n1_message->valuestring, strlen(binary_data_n1_message->valuestring), &decoded_str_binary_data_n1_message->len); - if (!decoded_str_binary_data_n1_message->data) { - ogs_error("OpenAPI_inline_object_3_parseFromJSON() failed [binary_data_n1_message]"); - goto end; - } - } - - inline_object_3_local_var = OpenAPI_inline_object_3_create ( - json_data ? json_data_local_nonprim : NULL, - binary_data_n1_message ? decoded_str_binary_data_n1_message : NULL - ); - - return inline_object_3_local_var; -end: - return NULL; -} - -OpenAPI_inline_object_3_t *OpenAPI_inline_object_3_copy(OpenAPI_inline_object_3_t *dst, OpenAPI_inline_object_3_t *src) -{ - cJSON *item = NULL; - char *content = NULL; - - ogs_assert(src); - item = OpenAPI_inline_object_3_convertToJSON(src); - if (!item) { - ogs_error("OpenAPI_inline_object_3_convertToJSON() failed"); - return NULL; - } - - content = cJSON_Print(item); - cJSON_Delete(item); - - if (!content) { - ogs_error("cJSON_Print() failed"); - return NULL; - } - - item = cJSON_Parse(content); - ogs_free(content); - if (!item) { - ogs_error("cJSON_Parse() failed"); - return NULL; - } - - OpenAPI_inline_object_3_free(dst); - dst = OpenAPI_inline_object_3_parseFromJSON(item); - cJSON_Delete(item); - - return dst; -} - diff --git a/lib/sbi/openapi/model/inline_object_3.h b/lib/sbi/openapi/model/inline_object_3.h deleted file mode 100644 index f870346f6..000000000 --- a/lib/sbi/openapi/model/inline_object_3.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * inline_object_3.h - * - * - */ - -#ifndef _OpenAPI_inline_object_3_H_ -#define _OpenAPI_inline_object_3_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "n1_message_notification.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct OpenAPI_inline_object_3_s OpenAPI_inline_object_3_t; -typedef struct OpenAPI_inline_object_3_s { - struct OpenAPI_n1_message_notification_s *json_data; - OpenAPI_binary_t* binary_data_n1_message; -} OpenAPI_inline_object_3_t; - -OpenAPI_inline_object_3_t *OpenAPI_inline_object_3_create( - OpenAPI_n1_message_notification_t *json_data, - OpenAPI_binary_t* binary_data_n1_message -); -void OpenAPI_inline_object_3_free(OpenAPI_inline_object_3_t *inline_object_3); -OpenAPI_inline_object_3_t *OpenAPI_inline_object_3_parseFromJSON(cJSON *inline_object_3JSON); -cJSON *OpenAPI_inline_object_3_convertToJSON(OpenAPI_inline_object_3_t *inline_object_3); -OpenAPI_inline_object_3_t *OpenAPI_inline_object_3_copy(OpenAPI_inline_object_3_t *dst, OpenAPI_inline_object_3_t *src); - -#ifdef __cplusplus -} -#endif - -#endif /* _OpenAPI_inline_object_3_H_ */ - diff --git a/lib/sbi/openapi/model/inline_object_4.c b/lib/sbi/openapi/model/inline_object_4.c deleted file mode 100644 index 95933f204..000000000 --- a/lib/sbi/openapi/model/inline_object_4.c +++ /dev/null @@ -1,166 +0,0 @@ - -#include -#include -#include -#include "inline_object_4.h" - -OpenAPI_inline_object_4_t *OpenAPI_inline_object_4_create( - OpenAPI_n2_information_notification_t *json_data, - OpenAPI_binary_t* binary_data_n1_message, - OpenAPI_binary_t* binary_data_n2_information -) -{ - OpenAPI_inline_object_4_t *inline_object_4_local_var = ogs_malloc(sizeof(OpenAPI_inline_object_4_t)); - ogs_assert(inline_object_4_local_var); - - inline_object_4_local_var->json_data = json_data; - inline_object_4_local_var->binary_data_n1_message = binary_data_n1_message; - inline_object_4_local_var->binary_data_n2_information = binary_data_n2_information; - - return inline_object_4_local_var; -} - -void OpenAPI_inline_object_4_free(OpenAPI_inline_object_4_t *inline_object_4) -{ - if (NULL == inline_object_4) { - return; - } - OpenAPI_lnode_t *node; - OpenAPI_n2_information_notification_free(inline_object_4->json_data); - ogs_free(inline_object_4->binary_data_n1_message->data); - ogs_free(inline_object_4->binary_data_n2_information->data); - ogs_free(inline_object_4); -} - -cJSON *OpenAPI_inline_object_4_convertToJSON(OpenAPI_inline_object_4_t *inline_object_4) -{ - cJSON *item = NULL; - - if (inline_object_4 == NULL) { - ogs_error("OpenAPI_inline_object_4_convertToJSON() failed [inline_object_4]"); - return NULL; - } - - item = cJSON_CreateObject(); - if (inline_object_4->json_data) { - cJSON *json_data_local_JSON = OpenAPI_n2_information_notification_convertToJSON(inline_object_4->json_data); - if (json_data_local_JSON == NULL) { - ogs_error("OpenAPI_inline_object_4_convertToJSON() failed [json_data]"); - goto end; - } - cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); - if (item->child == NULL) { - ogs_error("OpenAPI_inline_object_4_convertToJSON() failed [json_data]"); - goto end; - } - } - - if (inline_object_4->binary_data_n1_message) { - char* encoded_str_binary_data_n1_message = OpenAPI_base64encode(inline_object_4->binary_data_n1_message->data,inline_object_4->binary_data_n1_message->len); - if (cJSON_AddStringToObject(item, "binaryDataN1Message", encoded_str_binary_data_n1_message) == NULL) { - ogs_error("OpenAPI_inline_object_4_convertToJSON() failed [binary_data_n1_message]"); - goto end; - } - ogs_free(encoded_str_binary_data_n1_message); - } - - if (inline_object_4->binary_data_n2_information) { - char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(inline_object_4->binary_data_n2_information->data,inline_object_4->binary_data_n2_information->len); - if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { - ogs_error("OpenAPI_inline_object_4_convertToJSON() failed [binary_data_n2_information]"); - goto end; - } - ogs_free(encoded_str_binary_data_n2_information); - } - -end: - return item; -} - -OpenAPI_inline_object_4_t *OpenAPI_inline_object_4_parseFromJSON(cJSON *inline_object_4JSON) -{ - OpenAPI_inline_object_4_t *inline_object_4_local_var = NULL; - cJSON *json_data = cJSON_GetObjectItemCaseSensitive(inline_object_4JSON, "jsonData"); - - OpenAPI_n2_information_notification_t *json_data_local_nonprim = NULL; - if (json_data) { - json_data_local_nonprim = OpenAPI_n2_information_notification_parseFromJSON(json_data); - } - - cJSON *binary_data_n1_message = cJSON_GetObjectItemCaseSensitive(inline_object_4JSON, "binaryDataN1Message"); - - OpenAPI_binary_t* decoded_str_binary_data_n1_message = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n1_message); - if (binary_data_n1_message) { - if (!cJSON_IsString(binary_data_n1_message)) { - ogs_error("OpenAPI_inline_object_4_parseFromJSON() failed [binary_data_n1_message]"); - goto end; - } - decoded_str_binary_data_n1_message->data = OpenAPI_base64decode(binary_data_n1_message->valuestring, strlen(binary_data_n1_message->valuestring), &decoded_str_binary_data_n1_message->len); - if (!decoded_str_binary_data_n1_message->data) { - ogs_error("OpenAPI_inline_object_4_parseFromJSON() failed [binary_data_n1_message]"); - goto end; - } - } - - cJSON *binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(inline_object_4JSON, "binaryDataN2Information"); - - OpenAPI_binary_t* decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); - ogs_assert(decoded_str_binary_data_n2_information); - if (binary_data_n2_information) { - if (!cJSON_IsString(binary_data_n2_information)) { - ogs_error("OpenAPI_inline_object_4_parseFromJSON() failed [binary_data_n2_information]"); - goto end; - } - decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); - if (!decoded_str_binary_data_n2_information->data) { - ogs_error("OpenAPI_inline_object_4_parseFromJSON() failed [binary_data_n2_information]"); - goto end; - } - } - - inline_object_4_local_var = OpenAPI_inline_object_4_create ( - json_data ? json_data_local_nonprim : NULL, - binary_data_n1_message ? decoded_str_binary_data_n1_message : NULL, - binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL - ); - - return inline_object_4_local_var; -end: - return NULL; -} - -OpenAPI_inline_object_4_t *OpenAPI_inline_object_4_copy(OpenAPI_inline_object_4_t *dst, OpenAPI_inline_object_4_t *src) -{ - cJSON *item = NULL; - char *content = NULL; - - ogs_assert(src); - item = OpenAPI_inline_object_4_convertToJSON(src); - if (!item) { - ogs_error("OpenAPI_inline_object_4_convertToJSON() failed"); - return NULL; - } - - content = cJSON_Print(item); - cJSON_Delete(item); - - if (!content) { - ogs_error("cJSON_Print() failed"); - return NULL; - } - - item = cJSON_Parse(content); - ogs_free(content); - if (!item) { - ogs_error("cJSON_Parse() failed"); - return NULL; - } - - OpenAPI_inline_object_4_free(dst); - dst = OpenAPI_inline_object_4_parseFromJSON(item); - cJSON_Delete(item); - - return dst; -} - diff --git a/lib/sbi/openapi/model/inline_object_4.h b/lib/sbi/openapi/model/inline_object_4.h deleted file mode 100644 index 5faadb993..000000000 --- a/lib/sbi/openapi/model/inline_object_4.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * inline_object_4.h - * - * - */ - -#ifndef _OpenAPI_inline_object_4_H_ -#define _OpenAPI_inline_object_4_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "n2_information_notification.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct OpenAPI_inline_object_4_s OpenAPI_inline_object_4_t; -typedef struct OpenAPI_inline_object_4_s { - struct OpenAPI_n2_information_notification_s *json_data; - OpenAPI_binary_t* binary_data_n1_message; - OpenAPI_binary_t* binary_data_n2_information; -} OpenAPI_inline_object_4_t; - -OpenAPI_inline_object_4_t *OpenAPI_inline_object_4_create( - OpenAPI_n2_information_notification_t *json_data, - OpenAPI_binary_t* binary_data_n1_message, - OpenAPI_binary_t* binary_data_n2_information -); -void OpenAPI_inline_object_4_free(OpenAPI_inline_object_4_t *inline_object_4); -OpenAPI_inline_object_4_t *OpenAPI_inline_object_4_parseFromJSON(cJSON *inline_object_4JSON); -cJSON *OpenAPI_inline_object_4_convertToJSON(OpenAPI_inline_object_4_t *inline_object_4); -OpenAPI_inline_object_4_t *OpenAPI_inline_object_4_copy(OpenAPI_inline_object_4_t *dst, OpenAPI_inline_object_4_t *src); - -#ifdef __cplusplus -} -#endif - -#endif /* _OpenAPI_inline_object_4_H_ */ - diff --git a/lib/sbi/openapi/model/inline_response_200.c b/lib/sbi/openapi/model/inline_response_200.c deleted file mode 100644 index b55378b41..000000000 --- a/lib/sbi/openapi/model/inline_response_200.c +++ /dev/null @@ -1,143 +0,0 @@ - -#include -#include -#include -#include "inline_response_200.h" - -OpenAPI_inline_response_200_t *OpenAPI_inline_response_200_create( - OpenAPI_list_t* _links -) -{ - OpenAPI_inline_response_200_t *inline_response_200_local_var = ogs_malloc(sizeof(OpenAPI_inline_response_200_t)); - ogs_assert(inline_response_200_local_var); - - inline_response_200_local_var->_links = _links; - - return inline_response_200_local_var; -} - -void OpenAPI_inline_response_200_free(OpenAPI_inline_response_200_t *inline_response_200) -{ - if (NULL == inline_response_200) { - return; - } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(inline_response_200->_links, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_links_value_schema_free(localKeyValue->value); - ogs_free(localKeyValue); - } - OpenAPI_list_free(inline_response_200->_links); - ogs_free(inline_response_200); -} - -cJSON *OpenAPI_inline_response_200_convertToJSON(OpenAPI_inline_response_200_t *inline_response_200) -{ - cJSON *item = NULL; - - if (inline_response_200 == NULL) { - ogs_error("OpenAPI_inline_response_200_convertToJSON() failed [inline_response_200]"); - return NULL; - } - - item = cJSON_CreateObject(); - if (inline_response_200->_links) { - cJSON *_links = cJSON_AddObjectToObject(item, "_links"); - if (_links == NULL) { - ogs_error("OpenAPI_inline_response_200_convertToJSON() failed [_links]"); - goto end; - } - cJSON *localMapObject = _links; - OpenAPI_lnode_t *_links_node; - if (inline_response_200->_links) { - OpenAPI_list_for_each(inline_response_200->_links, _links_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)_links_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_links_value_schema_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_inline_response_200_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); - } - } - } - -end: - return item; -} - -OpenAPI_inline_response_200_t *OpenAPI_inline_response_200_parseFromJSON(cJSON *inline_response_200JSON) -{ - OpenAPI_inline_response_200_t *inline_response_200_local_var = NULL; - cJSON *_links = cJSON_GetObjectItemCaseSensitive(inline_response_200JSON, "_links"); - - OpenAPI_list_t *_linksList; - if (_links) { - cJSON *_links_local_map; - if (!cJSON_IsObject(_links)) { - ogs_error("OpenAPI_inline_response_200_parseFromJSON() failed [_links]"); - goto end; - } - _linksList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(_links_local_map, _links) { - cJSON *localMapObject = _links_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_links_value_schema_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_inline_response_200_parseFromJSON() failed [inner]"); - goto end; - } - OpenAPI_list_add(_linksList, localMapKeyPair); - } - } - - inline_response_200_local_var = OpenAPI_inline_response_200_create ( - _links ? _linksList : NULL - ); - - return inline_response_200_local_var; -end: - return NULL; -} - -OpenAPI_inline_response_200_t *OpenAPI_inline_response_200_copy(OpenAPI_inline_response_200_t *dst, OpenAPI_inline_response_200_t *src) -{ - cJSON *item = NULL; - char *content = NULL; - - ogs_assert(src); - item = OpenAPI_inline_response_200_convertToJSON(src); - if (!item) { - ogs_error("OpenAPI_inline_response_200_convertToJSON() failed"); - return NULL; - } - - content = cJSON_Print(item); - cJSON_Delete(item); - - if (!content) { - ogs_error("cJSON_Print() failed"); - return NULL; - } - - item = cJSON_Parse(content); - ogs_free(content); - if (!item) { - ogs_error("cJSON_Parse() failed"); - return NULL; - } - - OpenAPI_inline_response_200_free(dst); - dst = OpenAPI_inline_response_200_parseFromJSON(item); - cJSON_Delete(item); - - return dst; -} - diff --git a/lib/sbi/openapi/model/inline_response_200.h b/lib/sbi/openapi/model/inline_response_200.h deleted file mode 100644 index cb723fbec..000000000 --- a/lib/sbi/openapi/model/inline_response_200.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * inline_response_200.h - * - * - */ - -#ifndef _OpenAPI_inline_response_200_H_ -#define _OpenAPI_inline_response_200_H_ - -#include -#include "../external/cJSON.h" -#include "../include/list.h" -#include "../include/keyValuePair.h" -#include "../include/binary.h" -#include "links_value_schema.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct OpenAPI_inline_response_200_s OpenAPI_inline_response_200_t; -typedef struct OpenAPI_inline_response_200_s { - OpenAPI_list_t* _links; -} OpenAPI_inline_response_200_t; - -OpenAPI_inline_response_200_t *OpenAPI_inline_response_200_create( - OpenAPI_list_t* _links -); -void OpenAPI_inline_response_200_free(OpenAPI_inline_response_200_t *inline_response_200); -OpenAPI_inline_response_200_t *OpenAPI_inline_response_200_parseFromJSON(cJSON *inline_response_200JSON); -cJSON *OpenAPI_inline_response_200_convertToJSON(OpenAPI_inline_response_200_t *inline_response_200); -OpenAPI_inline_response_200_t *OpenAPI_inline_response_200_copy(OpenAPI_inline_response_200_t *dst, OpenAPI_inline_response_200_t *src); - -#ifdef __cplusplus -} -#endif - -#endif /* _OpenAPI_inline_response_200_H_ */ - diff --git a/lib/sbi/openapi/model/inter_freq_target_info.c b/lib/sbi/openapi/model/inter_freq_target_info.c index b00818153..183b4bf96 100644 --- a/lib/sbi/openapi/model/inter_freq_target_info.c +++ b/lib/sbi/openapi/model/inter_freq_target_info.c @@ -20,20 +20,25 @@ OpenAPI_inter_freq_target_info_t *OpenAPI_inter_freq_target_info_create( void OpenAPI_inter_freq_target_info_free(OpenAPI_inter_freq_target_info_t *inter_freq_target_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == inter_freq_target_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(inter_freq_target_info->cell_id_list, node) { - ogs_free(node->data); + if (inter_freq_target_info->cell_id_list) { + OpenAPI_list_for_each(inter_freq_target_info->cell_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(inter_freq_target_info->cell_id_list); + inter_freq_target_info->cell_id_list = NULL; } - OpenAPI_list_free(inter_freq_target_info->cell_id_list); ogs_free(inter_freq_target_info); } cJSON *OpenAPI_inter_freq_target_info_convertToJSON(OpenAPI_inter_freq_target_info_t *inter_freq_target_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (inter_freq_target_info == NULL) { ogs_error("OpenAPI_inter_freq_target_info_convertToJSON() failed [InterFreqTargetInfo]"); @@ -47,19 +52,17 @@ cJSON *OpenAPI_inter_freq_target_info_convertToJSON(OpenAPI_inter_freq_target_in } if (inter_freq_target_info->cell_id_list) { - cJSON *cell_id_list = cJSON_AddArrayToObject(item, "cellIdList"); - if (cell_id_list == NULL) { + cJSON *cell_id_listList = cJSON_AddArrayToObject(item, "cellIdList"); + if (cell_id_listList == NULL) { ogs_error("OpenAPI_inter_freq_target_info_convertToJSON() failed [cell_id_list]"); goto end; } - - OpenAPI_lnode_t *cell_id_list_node; - OpenAPI_list_for_each(inter_freq_target_info->cell_id_list, cell_id_list_node) { - if (cJSON_AddNumberToObject(cell_id_list, "", *(double *)cell_id_list_node->data) == NULL) { - ogs_error("OpenAPI_inter_freq_target_info_convertToJSON() failed [cell_id_list]"); - goto end; + OpenAPI_list_for_each(inter_freq_target_info->cell_id_list, node) { + if (cJSON_AddNumberToObject(cell_id_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_inter_freq_target_info_convertToJSON() failed [cell_id_list]"); + goto end; + } } - } } end: @@ -69,35 +72,45 @@ end: OpenAPI_inter_freq_target_info_t *OpenAPI_inter_freq_target_info_parseFromJSON(cJSON *inter_freq_target_infoJSON) { OpenAPI_inter_freq_target_info_t *inter_freq_target_info_local_var = NULL; - cJSON *dl_carrier_freq = cJSON_GetObjectItemCaseSensitive(inter_freq_target_infoJSON, "dlCarrierFreq"); + OpenAPI_lnode_t *node = NULL; + cJSON *dl_carrier_freq = NULL; + cJSON *cell_id_list = NULL; + OpenAPI_list_t *cell_id_listList = NULL; + dl_carrier_freq = cJSON_GetObjectItemCaseSensitive(inter_freq_target_infoJSON, "dlCarrierFreq"); if (!dl_carrier_freq) { ogs_error("OpenAPI_inter_freq_target_info_parseFromJSON() failed [dl_carrier_freq]"); goto end; } - if (!cJSON_IsNumber(dl_carrier_freq)) { ogs_error("OpenAPI_inter_freq_target_info_parseFromJSON() failed [dl_carrier_freq]"); goto end; } - cJSON *cell_id_list = cJSON_GetObjectItemCaseSensitive(inter_freq_target_infoJSON, "cellIdList"); - - OpenAPI_list_t *cell_id_listList; + cell_id_list = cJSON_GetObjectItemCaseSensitive(inter_freq_target_infoJSON, "cellIdList"); if (cell_id_list) { - cJSON *cell_id_list_local; - if (!cJSON_IsArray(cell_id_list)) { - ogs_error("OpenAPI_inter_freq_target_info_parseFromJSON() failed [cell_id_list]"); - goto end; - } - cell_id_listList = OpenAPI_list_create(); + cJSON *cell_id_list_local = NULL; + if (!cJSON_IsArray(cell_id_list)) { + ogs_error("OpenAPI_inter_freq_target_info_parseFromJSON() failed [cell_id_list]"); + goto end; + } - cJSON_ArrayForEach(cell_id_list_local, cell_id_list) { - if (!cJSON_IsNumber(cell_id_list_local)) { - ogs_error("OpenAPI_inter_freq_target_info_parseFromJSON() failed [cell_id_list]"); - goto end; - } - OpenAPI_list_add(cell_id_listList, &cell_id_list_local->valuedouble); - } + cell_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cell_id_list_local, cell_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(cell_id_list_local)) { + ogs_error("OpenAPI_inter_freq_target_info_parseFromJSON() failed [cell_id_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_inter_freq_target_info_parseFromJSON() failed [cell_id_list]"); + goto end; + } + *localDouble = cell_id_list_local->valuedouble; + OpenAPI_list_add(cell_id_listList, localDouble); + } } inter_freq_target_info_local_var = OpenAPI_inter_freq_target_info_create ( @@ -108,6 +121,13 @@ OpenAPI_inter_freq_target_info_t *OpenAPI_inter_freq_target_info_parseFromJSON(c return inter_freq_target_info_local_var; end: + if (cell_id_listList) { + OpenAPI_list_for_each(cell_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cell_id_listList); + cell_id_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/inter_freq_target_info_1.c b/lib/sbi/openapi/model/inter_freq_target_info_1.c index 4b0fc98de..4555b0f0b 100644 --- a/lib/sbi/openapi/model/inter_freq_target_info_1.c +++ b/lib/sbi/openapi/model/inter_freq_target_info_1.c @@ -20,20 +20,25 @@ OpenAPI_inter_freq_target_info_1_t *OpenAPI_inter_freq_target_info_1_create( void OpenAPI_inter_freq_target_info_1_free(OpenAPI_inter_freq_target_info_1_t *inter_freq_target_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == inter_freq_target_info_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(inter_freq_target_info_1->cell_id_list, node) { - ogs_free(node->data); + if (inter_freq_target_info_1->cell_id_list) { + OpenAPI_list_for_each(inter_freq_target_info_1->cell_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(inter_freq_target_info_1->cell_id_list); + inter_freq_target_info_1->cell_id_list = NULL; } - OpenAPI_list_free(inter_freq_target_info_1->cell_id_list); ogs_free(inter_freq_target_info_1); } cJSON *OpenAPI_inter_freq_target_info_1_convertToJSON(OpenAPI_inter_freq_target_info_1_t *inter_freq_target_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (inter_freq_target_info_1 == NULL) { ogs_error("OpenAPI_inter_freq_target_info_1_convertToJSON() failed [InterFreqTargetInfo_1]"); @@ -47,19 +52,17 @@ cJSON *OpenAPI_inter_freq_target_info_1_convertToJSON(OpenAPI_inter_freq_target_ } if (inter_freq_target_info_1->cell_id_list) { - cJSON *cell_id_list = cJSON_AddArrayToObject(item, "cellIdList"); - if (cell_id_list == NULL) { + cJSON *cell_id_listList = cJSON_AddArrayToObject(item, "cellIdList"); + if (cell_id_listList == NULL) { ogs_error("OpenAPI_inter_freq_target_info_1_convertToJSON() failed [cell_id_list]"); goto end; } - - OpenAPI_lnode_t *cell_id_list_node; - OpenAPI_list_for_each(inter_freq_target_info_1->cell_id_list, cell_id_list_node) { - if (cJSON_AddNumberToObject(cell_id_list, "", *(double *)cell_id_list_node->data) == NULL) { - ogs_error("OpenAPI_inter_freq_target_info_1_convertToJSON() failed [cell_id_list]"); - goto end; + OpenAPI_list_for_each(inter_freq_target_info_1->cell_id_list, node) { + if (cJSON_AddNumberToObject(cell_id_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_inter_freq_target_info_1_convertToJSON() failed [cell_id_list]"); + goto end; + } } - } } end: @@ -69,35 +72,45 @@ end: OpenAPI_inter_freq_target_info_1_t *OpenAPI_inter_freq_target_info_1_parseFromJSON(cJSON *inter_freq_target_info_1JSON) { OpenAPI_inter_freq_target_info_1_t *inter_freq_target_info_1_local_var = NULL; - cJSON *dl_carrier_freq = cJSON_GetObjectItemCaseSensitive(inter_freq_target_info_1JSON, "dlCarrierFreq"); + OpenAPI_lnode_t *node = NULL; + cJSON *dl_carrier_freq = NULL; + cJSON *cell_id_list = NULL; + OpenAPI_list_t *cell_id_listList = NULL; + dl_carrier_freq = cJSON_GetObjectItemCaseSensitive(inter_freq_target_info_1JSON, "dlCarrierFreq"); if (!dl_carrier_freq) { ogs_error("OpenAPI_inter_freq_target_info_1_parseFromJSON() failed [dl_carrier_freq]"); goto end; } - if (!cJSON_IsNumber(dl_carrier_freq)) { ogs_error("OpenAPI_inter_freq_target_info_1_parseFromJSON() failed [dl_carrier_freq]"); goto end; } - cJSON *cell_id_list = cJSON_GetObjectItemCaseSensitive(inter_freq_target_info_1JSON, "cellIdList"); - - OpenAPI_list_t *cell_id_listList; + cell_id_list = cJSON_GetObjectItemCaseSensitive(inter_freq_target_info_1JSON, "cellIdList"); if (cell_id_list) { - cJSON *cell_id_list_local; - if (!cJSON_IsArray(cell_id_list)) { - ogs_error("OpenAPI_inter_freq_target_info_1_parseFromJSON() failed [cell_id_list]"); - goto end; - } - cell_id_listList = OpenAPI_list_create(); + cJSON *cell_id_list_local = NULL; + if (!cJSON_IsArray(cell_id_list)) { + ogs_error("OpenAPI_inter_freq_target_info_1_parseFromJSON() failed [cell_id_list]"); + goto end; + } - cJSON_ArrayForEach(cell_id_list_local, cell_id_list) { - if (!cJSON_IsNumber(cell_id_list_local)) { - ogs_error("OpenAPI_inter_freq_target_info_1_parseFromJSON() failed [cell_id_list]"); - goto end; - } - OpenAPI_list_add(cell_id_listList, &cell_id_list_local->valuedouble); - } + cell_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cell_id_list_local, cell_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(cell_id_list_local)) { + ogs_error("OpenAPI_inter_freq_target_info_1_parseFromJSON() failed [cell_id_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_inter_freq_target_info_1_parseFromJSON() failed [cell_id_list]"); + goto end; + } + *localDouble = cell_id_list_local->valuedouble; + OpenAPI_list_add(cell_id_listList, localDouble); + } } inter_freq_target_info_1_local_var = OpenAPI_inter_freq_target_info_1_create ( @@ -108,6 +121,13 @@ OpenAPI_inter_freq_target_info_1_t *OpenAPI_inter_freq_target_info_1_parseFromJS return inter_freq_target_info_1_local_var; end: + if (cell_id_listList) { + OpenAPI_list_for_each(cell_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cell_id_listList); + cell_id_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/interface_upf_info_item.c b/lib/sbi/openapi/model/interface_upf_info_item.c index f2b4482f0..1ab4758a0 100644 --- a/lib/sbi/openapi/model/interface_upf_info_item.c +++ b/lib/sbi/openapi/model/interface_upf_info_item.c @@ -26,26 +26,40 @@ OpenAPI_interface_upf_info_item_t *OpenAPI_interface_upf_info_item_create( void OpenAPI_interface_upf_info_item_free(OpenAPI_interface_upf_info_item_t *interface_upf_info_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == interface_upf_info_item) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(interface_upf_info_item->ipv4_endpoint_addresses, node) { - ogs_free(node->data); + if (interface_upf_info_item->ipv4_endpoint_addresses) { + OpenAPI_list_for_each(interface_upf_info_item->ipv4_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(interface_upf_info_item->ipv4_endpoint_addresses); + interface_upf_info_item->ipv4_endpoint_addresses = NULL; } - OpenAPI_list_free(interface_upf_info_item->ipv4_endpoint_addresses); - OpenAPI_list_for_each(interface_upf_info_item->ipv6_endpoint_addresses, node) { - ogs_free(node->data); + if (interface_upf_info_item->ipv6_endpoint_addresses) { + OpenAPI_list_for_each(interface_upf_info_item->ipv6_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(interface_upf_info_item->ipv6_endpoint_addresses); + interface_upf_info_item->ipv6_endpoint_addresses = NULL; + } + if (interface_upf_info_item->endpoint_fqdn) { + ogs_free(interface_upf_info_item->endpoint_fqdn); + interface_upf_info_item->endpoint_fqdn = NULL; + } + if (interface_upf_info_item->network_instance) { + ogs_free(interface_upf_info_item->network_instance); + interface_upf_info_item->network_instance = NULL; } - OpenAPI_list_free(interface_upf_info_item->ipv6_endpoint_addresses); - ogs_free(interface_upf_info_item->endpoint_fqdn); - ogs_free(interface_upf_info_item->network_instance); ogs_free(interface_upf_info_item); } cJSON *OpenAPI_interface_upf_info_item_convertToJSON(OpenAPI_interface_upf_info_item_t *interface_upf_info_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (interface_upf_info_item == NULL) { ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [InterfaceUpfInfoItem]"); @@ -53,41 +67,41 @@ cJSON *OpenAPI_interface_upf_info_item_convertToJSON(OpenAPI_interface_upf_info_ } item = cJSON_CreateObject(); + if (interface_upf_info_item->interface_type == OpenAPI_up_interface_type_NULL) { + ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [interface_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "interfaceType", OpenAPI_up_interface_type_ToString(interface_upf_info_item->interface_type)) == NULL) { ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [interface_type]"); goto end; } if (interface_upf_info_item->ipv4_endpoint_addresses) { - cJSON *ipv4_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); - if (ipv4_endpoint_addresses == NULL) { + cJSON *ipv4_endpoint_addressesList = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); + if (ipv4_endpoint_addressesList == NULL) { ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [ipv4_endpoint_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv4_endpoint_addresses_node; - OpenAPI_list_for_each(interface_upf_info_item->ipv4_endpoint_addresses, ipv4_endpoint_addresses_node) { - if (cJSON_AddStringToObject(ipv4_endpoint_addresses, "", (char*)ipv4_endpoint_addresses_node->data) == NULL) { - ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [ipv4_endpoint_addresses]"); - goto end; + OpenAPI_list_for_each(interface_upf_info_item->ipv4_endpoint_addresses, node) { + if (cJSON_AddStringToObject(ipv4_endpoint_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } } - } } if (interface_upf_info_item->ipv6_endpoint_addresses) { - cJSON *ipv6_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); - if (ipv6_endpoint_addresses == NULL) { + cJSON *ipv6_endpoint_addressesList = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); + if (ipv6_endpoint_addressesList == NULL) { ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [ipv6_endpoint_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv6_endpoint_addresses_node; - OpenAPI_list_for_each(interface_upf_info_item->ipv6_endpoint_addresses, ipv6_endpoint_addresses_node) { - if (cJSON_AddStringToObject(ipv6_endpoint_addresses, "", (char*)ipv6_endpoint_addresses_node->data) == NULL) { - ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [ipv6_endpoint_addresses]"); - goto end; + OpenAPI_list_for_each(interface_upf_info_item->ipv6_endpoint_addresses, node) { + if (cJSON_AddStringToObject(ipv6_endpoint_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_interface_upf_info_item_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } } - } } if (interface_upf_info_item->endpoint_fqdn) { @@ -111,72 +125,79 @@ end: OpenAPI_interface_upf_info_item_t *OpenAPI_interface_upf_info_item_parseFromJSON(cJSON *interface_upf_info_itemJSON) { OpenAPI_interface_upf_info_item_t *interface_upf_info_item_local_var = NULL; - cJSON *interface_type = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "interfaceType"); + OpenAPI_lnode_t *node = NULL; + cJSON *interface_type = NULL; + OpenAPI_up_interface_type_e interface_typeVariable = 0; + cJSON *ipv4_endpoint_addresses = NULL; + OpenAPI_list_t *ipv4_endpoint_addressesList = NULL; + cJSON *ipv6_endpoint_addresses = NULL; + OpenAPI_list_t *ipv6_endpoint_addressesList = NULL; + cJSON *endpoint_fqdn = NULL; + cJSON *network_instance = NULL; + interface_type = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "interfaceType"); if (!interface_type) { ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [interface_type]"); goto end; } - - OpenAPI_up_interface_type_e interface_typeVariable; if (!cJSON_IsString(interface_type)) { ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [interface_type]"); goto end; } interface_typeVariable = OpenAPI_up_interface_type_FromString(interface_type->valuestring); - cJSON *ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "ipv4EndpointAddresses"); - - OpenAPI_list_t *ipv4_endpoint_addressesList; + ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "ipv4EndpointAddresses"); if (ipv4_endpoint_addresses) { - cJSON *ipv4_endpoint_addresses_local; - if (!cJSON_IsArray(ipv4_endpoint_addresses)) { - ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [ipv4_endpoint_addresses]"); - goto end; - } - ipv4_endpoint_addressesList = OpenAPI_list_create(); + cJSON *ipv4_endpoint_addresses_local = NULL; + if (!cJSON_IsArray(ipv4_endpoint_addresses)) { + ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { - if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { - ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [ipv4_endpoint_addresses]"); - goto end; - } - OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); - } + ipv4_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { + ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); + } } - cJSON *ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "ipv6EndpointAddresses"); - - OpenAPI_list_t *ipv6_endpoint_addressesList; + ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "ipv6EndpointAddresses"); if (ipv6_endpoint_addresses) { - cJSON *ipv6_endpoint_addresses_local; - if (!cJSON_IsArray(ipv6_endpoint_addresses)) { - ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [ipv6_endpoint_addresses]"); - goto end; - } - ipv6_endpoint_addressesList = OpenAPI_list_create(); + cJSON *ipv6_endpoint_addresses_local = NULL; + if (!cJSON_IsArray(ipv6_endpoint_addresses)) { + ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { - if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { - ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [ipv6_endpoint_addresses]"); - goto end; - } - OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); - } + ipv6_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { + ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); + } } - cJSON *endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "endpointFqdn"); - + endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "endpointFqdn"); if (endpoint_fqdn) { - if (!cJSON_IsString(endpoint_fqdn)) { + if (!cJSON_IsString(endpoint_fqdn) && !cJSON_IsNull(endpoint_fqdn)) { ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [endpoint_fqdn]"); goto end; } } - cJSON *network_instance = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "networkInstance"); - + network_instance = cJSON_GetObjectItemCaseSensitive(interface_upf_info_itemJSON, "networkInstance"); if (network_instance) { - if (!cJSON_IsString(network_instance)) { + if (!cJSON_IsString(network_instance) && !cJSON_IsNull(network_instance)) { ogs_error("OpenAPI_interface_upf_info_item_parseFromJSON() failed [network_instance]"); goto end; } @@ -186,12 +207,26 @@ OpenAPI_interface_upf_info_item_t *OpenAPI_interface_upf_info_item_parseFromJSON interface_typeVariable, ipv4_endpoint_addresses ? ipv4_endpoint_addressesList : NULL, ipv6_endpoint_addresses ? ipv6_endpoint_addressesList : NULL, - endpoint_fqdn ? ogs_strdup(endpoint_fqdn->valuestring) : NULL, - network_instance ? ogs_strdup(network_instance->valuestring) : NULL + endpoint_fqdn && !cJSON_IsNull(endpoint_fqdn) ? ogs_strdup(endpoint_fqdn->valuestring) : NULL, + network_instance && !cJSON_IsNull(network_instance) ? ogs_strdup(network_instance->valuestring) : NULL ); return interface_upf_info_item_local_var; end: + if (ipv4_endpoint_addressesList) { + OpenAPI_list_for_each(ipv4_endpoint_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_endpoint_addressesList); + ipv4_endpoint_addressesList = NULL; + } + if (ipv6_endpoint_addressesList) { + OpenAPI_list_for_each(ipv6_endpoint_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_endpoint_addressesList); + ipv6_endpoint_addressesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/internal_group_id_range.c b/lib/sbi/openapi/model/internal_group_id_range.c index e4def16f5..20c3eafc0 100644 --- a/lib/sbi/openapi/model/internal_group_id_range.c +++ b/lib/sbi/openapi/model/internal_group_id_range.c @@ -22,19 +22,30 @@ OpenAPI_internal_group_id_range_t *OpenAPI_internal_group_id_range_create( void OpenAPI_internal_group_id_range_free(OpenAPI_internal_group_id_range_t *internal_group_id_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == internal_group_id_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(internal_group_id_range->start); - ogs_free(internal_group_id_range->end); - ogs_free(internal_group_id_range->pattern); + if (internal_group_id_range->start) { + ogs_free(internal_group_id_range->start); + internal_group_id_range->start = NULL; + } + if (internal_group_id_range->end) { + ogs_free(internal_group_id_range->end); + internal_group_id_range->end = NULL; + } + if (internal_group_id_range->pattern) { + ogs_free(internal_group_id_range->pattern); + internal_group_id_range->pattern = NULL; + } ogs_free(internal_group_id_range); } cJSON *OpenAPI_internal_group_id_range_convertToJSON(OpenAPI_internal_group_id_range_t *internal_group_id_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (internal_group_id_range == NULL) { ogs_error("OpenAPI_internal_group_id_range_convertToJSON() failed [InternalGroupIdRange]"); @@ -70,37 +81,38 @@ end: OpenAPI_internal_group_id_range_t *OpenAPI_internal_group_id_range_parseFromJSON(cJSON *internal_group_id_rangeJSON) { OpenAPI_internal_group_id_range_t *internal_group_id_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + cJSON *pattern = NULL; + start = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_internal_group_id_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_internal_group_id_range_parseFromJSON() failed [end]"); goto end; } } - cJSON *pattern = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "pattern"); - + pattern = cJSON_GetObjectItemCaseSensitive(internal_group_id_rangeJSON, "pattern"); if (pattern) { - if (!cJSON_IsString(pattern)) { + if (!cJSON_IsString(pattern) && !cJSON_IsNull(pattern)) { ogs_error("OpenAPI_internal_group_id_range_parseFromJSON() failed [pattern]"); goto end; } } internal_group_id_range_local_var = OpenAPI_internal_group_id_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL, - pattern ? ogs_strdup(pattern->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL, + pattern && !cJSON_IsNull(pattern) ? ogs_strdup(pattern->valuestring) : NULL ); return internal_group_id_range_local_var; diff --git a/lib/sbi/openapi/model/invalid_param.c b/lib/sbi/openapi/model/invalid_param.c index b52e93133..3f4aa012c 100644 --- a/lib/sbi/openapi/model/invalid_param.c +++ b/lib/sbi/openapi/model/invalid_param.c @@ -20,18 +20,26 @@ OpenAPI_invalid_param_t *OpenAPI_invalid_param_create( void OpenAPI_invalid_param_free(OpenAPI_invalid_param_t *invalid_param) { + OpenAPI_lnode_t *node = NULL; + if (NULL == invalid_param) { return; } - OpenAPI_lnode_t *node; - ogs_free(invalid_param->param); - ogs_free(invalid_param->reason); + if (invalid_param->param) { + ogs_free(invalid_param->param); + invalid_param->param = NULL; + } + if (invalid_param->reason) { + ogs_free(invalid_param->reason); + invalid_param->reason = NULL; + } ogs_free(invalid_param); } cJSON *OpenAPI_invalid_param_convertToJSON(OpenAPI_invalid_param_t *invalid_param) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (invalid_param == NULL) { ogs_error("OpenAPI_invalid_param_convertToJSON() failed [InvalidParam]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_invalid_param_convertToJSON(OpenAPI_invalid_param_t *invalid_para } item = cJSON_CreateObject(); + if (!invalid_param->param) { + ogs_error("OpenAPI_invalid_param_convertToJSON() failed [param]"); + return NULL; + } if (cJSON_AddStringToObject(item, "param", invalid_param->param) == NULL) { ogs_error("OpenAPI_invalid_param_convertToJSON() failed [param]"); goto end; @@ -58,21 +70,22 @@ end: OpenAPI_invalid_param_t *OpenAPI_invalid_param_parseFromJSON(cJSON *invalid_paramJSON) { OpenAPI_invalid_param_t *invalid_param_local_var = NULL; - cJSON *param = cJSON_GetObjectItemCaseSensitive(invalid_paramJSON, "param"); + OpenAPI_lnode_t *node = NULL; + cJSON *param = NULL; + cJSON *reason = NULL; + param = cJSON_GetObjectItemCaseSensitive(invalid_paramJSON, "param"); if (!param) { ogs_error("OpenAPI_invalid_param_parseFromJSON() failed [param]"); goto end; } - if (!cJSON_IsString(param)) { ogs_error("OpenAPI_invalid_param_parseFromJSON() failed [param]"); goto end; } - cJSON *reason = cJSON_GetObjectItemCaseSensitive(invalid_paramJSON, "reason"); - + reason = cJSON_GetObjectItemCaseSensitive(invalid_paramJSON, "reason"); if (reason) { - if (!cJSON_IsString(reason)) { + if (!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { ogs_error("OpenAPI_invalid_param_parseFromJSON() failed [reason]"); goto end; } @@ -80,7 +93,7 @@ OpenAPI_invalid_param_t *OpenAPI_invalid_param_parseFromJSON(cJSON *invalid_para invalid_param_local_var = OpenAPI_invalid_param_create ( ogs_strdup(param->valuestring), - reason ? ogs_strdup(reason->valuestring) : NULL + reason && !cJSON_IsNull(reason) ? ogs_strdup(reason->valuestring) : NULL ); return invalid_param_local_var; diff --git a/lib/sbi/openapi/model/invalid_param_1.c b/lib/sbi/openapi/model/invalid_param_1.c index d24ce1a5c..6354e4d87 100644 --- a/lib/sbi/openapi/model/invalid_param_1.c +++ b/lib/sbi/openapi/model/invalid_param_1.c @@ -20,18 +20,26 @@ OpenAPI_invalid_param_1_t *OpenAPI_invalid_param_1_create( void OpenAPI_invalid_param_1_free(OpenAPI_invalid_param_1_t *invalid_param_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == invalid_param_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(invalid_param_1->param); - ogs_free(invalid_param_1->reason); + if (invalid_param_1->param) { + ogs_free(invalid_param_1->param); + invalid_param_1->param = NULL; + } + if (invalid_param_1->reason) { + ogs_free(invalid_param_1->reason); + invalid_param_1->reason = NULL; + } ogs_free(invalid_param_1); } cJSON *OpenAPI_invalid_param_1_convertToJSON(OpenAPI_invalid_param_1_t *invalid_param_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (invalid_param_1 == NULL) { ogs_error("OpenAPI_invalid_param_1_convertToJSON() failed [InvalidParam_1]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_invalid_param_1_convertToJSON(OpenAPI_invalid_param_1_t *invalid_ } item = cJSON_CreateObject(); + if (!invalid_param_1->param) { + ogs_error("OpenAPI_invalid_param_1_convertToJSON() failed [param]"); + return NULL; + } if (cJSON_AddStringToObject(item, "param", invalid_param_1->param) == NULL) { ogs_error("OpenAPI_invalid_param_1_convertToJSON() failed [param]"); goto end; @@ -58,21 +70,22 @@ end: OpenAPI_invalid_param_1_t *OpenAPI_invalid_param_1_parseFromJSON(cJSON *invalid_param_1JSON) { OpenAPI_invalid_param_1_t *invalid_param_1_local_var = NULL; - cJSON *param = cJSON_GetObjectItemCaseSensitive(invalid_param_1JSON, "param"); + OpenAPI_lnode_t *node = NULL; + cJSON *param = NULL; + cJSON *reason = NULL; + param = cJSON_GetObjectItemCaseSensitive(invalid_param_1JSON, "param"); if (!param) { ogs_error("OpenAPI_invalid_param_1_parseFromJSON() failed [param]"); goto end; } - if (!cJSON_IsString(param)) { ogs_error("OpenAPI_invalid_param_1_parseFromJSON() failed [param]"); goto end; } - cJSON *reason = cJSON_GetObjectItemCaseSensitive(invalid_param_1JSON, "reason"); - + reason = cJSON_GetObjectItemCaseSensitive(invalid_param_1JSON, "reason"); if (reason) { - if (!cJSON_IsString(reason)) { + if (!cJSON_IsString(reason) && !cJSON_IsNull(reason)) { ogs_error("OpenAPI_invalid_param_1_parseFromJSON() failed [reason]"); goto end; } @@ -80,7 +93,7 @@ OpenAPI_invalid_param_1_t *OpenAPI_invalid_param_1_parseFromJSON(cJSON *invalid_ invalid_param_1_local_var = OpenAPI_invalid_param_1_create ( ogs_strdup(param->valuestring), - reason ? ogs_strdup(reason->valuestring) : NULL + reason && !cJSON_IsNull(reason) ? ogs_strdup(reason->valuestring) : NULL ); return invalid_param_1_local_var; diff --git a/lib/sbi/openapi/model/ip_address.c b/lib/sbi/openapi/model/ip_address.c index 454100677..4cb0102d4 100644 --- a/lib/sbi/openapi/model/ip_address.c +++ b/lib/sbi/openapi/model/ip_address.c @@ -22,19 +22,30 @@ OpenAPI_ip_address_t *OpenAPI_ip_address_create( void OpenAPI_ip_address_free(OpenAPI_ip_address_t *ip_address) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ip_address) { return; } - OpenAPI_lnode_t *node; - ogs_free(ip_address->ipv4_addr); - ogs_free(ip_address->ipv6_addr); - ogs_free(ip_address->ipv6_prefix); + if (ip_address->ipv4_addr) { + ogs_free(ip_address->ipv4_addr); + ip_address->ipv4_addr = NULL; + } + if (ip_address->ipv6_addr) { + ogs_free(ip_address->ipv6_addr); + ip_address->ipv6_addr = NULL; + } + if (ip_address->ipv6_prefix) { + ogs_free(ip_address->ipv6_prefix); + ip_address->ipv6_prefix = NULL; + } ogs_free(ip_address); } cJSON *OpenAPI_ip_address_convertToJSON(OpenAPI_ip_address_t *ip_address) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ip_address == NULL) { ogs_error("OpenAPI_ip_address_convertToJSON() failed [IpAddress]"); @@ -70,37 +81,38 @@ end: OpenAPI_ip_address_t *OpenAPI_ip_address_parseFromJSON(cJSON *ip_addressJSON) { OpenAPI_ip_address_t *ip_address_local_var = NULL; - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ipv6_addr = NULL; + cJSON *ipv6_prefix = NULL; + ipv4_addr = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_ip_address_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv6Addr"); - + ipv6_addr = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv6Addr"); if (ipv6_addr) { - if (!cJSON_IsString(ipv6_addr)) { + if (!cJSON_IsString(ipv6_addr) && !cJSON_IsNull(ipv6_addr)) { ogs_error("OpenAPI_ip_address_parseFromJSON() failed [ipv6_addr]"); goto end; } } - cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv6Prefix"); - + ipv6_prefix = cJSON_GetObjectItemCaseSensitive(ip_addressJSON, "ipv6Prefix"); if (ipv6_prefix) { - if (!cJSON_IsString(ipv6_prefix)) { + if (!cJSON_IsString(ipv6_prefix) && !cJSON_IsNull(ipv6_prefix)) { ogs_error("OpenAPI_ip_address_parseFromJSON() failed [ipv6_prefix]"); goto end; } } ip_address_local_var = OpenAPI_ip_address_create ( - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, - ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, - ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr && !cJSON_IsNull(ipv6_addr) ? ogs_strdup(ipv6_addr->valuestring) : NULL, + ipv6_prefix && !cJSON_IsNull(ipv6_prefix) ? ogs_strdup(ipv6_prefix->valuestring) : NULL ); return ip_address_local_var; diff --git a/lib/sbi/openapi/model/ip_address_1.c b/lib/sbi/openapi/model/ip_address_1.c index d930fdece..13478d47b 100644 --- a/lib/sbi/openapi/model/ip_address_1.c +++ b/lib/sbi/openapi/model/ip_address_1.c @@ -22,19 +22,30 @@ OpenAPI_ip_address_1_t *OpenAPI_ip_address_1_create( void OpenAPI_ip_address_1_free(OpenAPI_ip_address_1_t *ip_address_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ip_address_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(ip_address_1->ipv4_addr); - ogs_free(ip_address_1->ipv6_addr); - ogs_free(ip_address_1->ipv6_prefix); + if (ip_address_1->ipv4_addr) { + ogs_free(ip_address_1->ipv4_addr); + ip_address_1->ipv4_addr = NULL; + } + if (ip_address_1->ipv6_addr) { + ogs_free(ip_address_1->ipv6_addr); + ip_address_1->ipv6_addr = NULL; + } + if (ip_address_1->ipv6_prefix) { + ogs_free(ip_address_1->ipv6_prefix); + ip_address_1->ipv6_prefix = NULL; + } ogs_free(ip_address_1); } cJSON *OpenAPI_ip_address_1_convertToJSON(OpenAPI_ip_address_1_t *ip_address_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ip_address_1 == NULL) { ogs_error("OpenAPI_ip_address_1_convertToJSON() failed [IpAddress_1]"); @@ -70,37 +81,38 @@ end: OpenAPI_ip_address_1_t *OpenAPI_ip_address_1_parseFromJSON(cJSON *ip_address_1JSON) { OpenAPI_ip_address_1_t *ip_address_1_local_var = NULL; - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(ip_address_1JSON, "ipv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ipv6_addr = NULL; + cJSON *ipv6_prefix = NULL; + ipv4_addr = cJSON_GetObjectItemCaseSensitive(ip_address_1JSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_ip_address_1_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(ip_address_1JSON, "ipv6Addr"); - + ipv6_addr = cJSON_GetObjectItemCaseSensitive(ip_address_1JSON, "ipv6Addr"); if (ipv6_addr) { - if (!cJSON_IsString(ipv6_addr)) { + if (!cJSON_IsString(ipv6_addr) && !cJSON_IsNull(ipv6_addr)) { ogs_error("OpenAPI_ip_address_1_parseFromJSON() failed [ipv6_addr]"); goto end; } } - cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(ip_address_1JSON, "ipv6Prefix"); - + ipv6_prefix = cJSON_GetObjectItemCaseSensitive(ip_address_1JSON, "ipv6Prefix"); if (ipv6_prefix) { - if (!cJSON_IsString(ipv6_prefix)) { + if (!cJSON_IsString(ipv6_prefix) && !cJSON_IsNull(ipv6_prefix)) { ogs_error("OpenAPI_ip_address_1_parseFromJSON() failed [ipv6_prefix]"); goto end; } } ip_address_1_local_var = OpenAPI_ip_address_1_create ( - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, - ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, - ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr && !cJSON_IsNull(ipv6_addr) ? ogs_strdup(ipv6_addr->valuestring) : NULL, + ipv6_prefix && !cJSON_IsNull(ipv6_prefix) ? ogs_strdup(ipv6_prefix->valuestring) : NULL ); return ip_address_1_local_var; diff --git a/lib/sbi/openapi/model/ip_end_point.c b/lib/sbi/openapi/model/ip_end_point.c index b15c9245b..a3a941292 100644 --- a/lib/sbi/openapi/model/ip_end_point.c +++ b/lib/sbi/openapi/model/ip_end_point.c @@ -26,18 +26,26 @@ OpenAPI_ip_end_point_t *OpenAPI_ip_end_point_create( void OpenAPI_ip_end_point_free(OpenAPI_ip_end_point_t *ip_end_point) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ip_end_point) { return; } - OpenAPI_lnode_t *node; - ogs_free(ip_end_point->ipv4_address); - ogs_free(ip_end_point->ipv6_address); + if (ip_end_point->ipv4_address) { + ogs_free(ip_end_point->ipv4_address); + ip_end_point->ipv4_address = NULL; + } + if (ip_end_point->ipv6_address) { + ogs_free(ip_end_point->ipv6_address); + ip_end_point->ipv6_address = NULL; + } ogs_free(ip_end_point); } cJSON *OpenAPI_ip_end_point_convertToJSON(OpenAPI_ip_end_point_t *ip_end_point) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ip_end_point == NULL) { ogs_error("OpenAPI_ip_end_point_convertToJSON() failed [IpEndPoint]"); @@ -59,7 +67,7 @@ cJSON *OpenAPI_ip_end_point_convertToJSON(OpenAPI_ip_end_point_t *ip_end_point) } } - if (ip_end_point->transport) { + if (ip_end_point->transport != OpenAPI_transport_protocol_NULL) { if (cJSON_AddStringToObject(item, "transport", OpenAPI_transport_protocol_ToString(ip_end_point->transport)) == NULL) { ogs_error("OpenAPI_ip_end_point_convertToJSON() failed [transport]"); goto end; @@ -80,27 +88,29 @@ end: OpenAPI_ip_end_point_t *OpenAPI_ip_end_point_parseFromJSON(cJSON *ip_end_pointJSON) { OpenAPI_ip_end_point_t *ip_end_point_local_var = NULL; - cJSON *ipv4_address = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "ipv4Address"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_address = NULL; + cJSON *ipv6_address = NULL; + cJSON *transport = NULL; + OpenAPI_transport_protocol_e transportVariable = 0; + cJSON *port = NULL; + ipv4_address = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "ipv4Address"); if (ipv4_address) { - if (!cJSON_IsString(ipv4_address)) { + if (!cJSON_IsString(ipv4_address) && !cJSON_IsNull(ipv4_address)) { ogs_error("OpenAPI_ip_end_point_parseFromJSON() failed [ipv4_address]"); goto end; } } - cJSON *ipv6_address = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "ipv6Address"); - + ipv6_address = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "ipv6Address"); if (ipv6_address) { - if (!cJSON_IsString(ipv6_address)) { + if (!cJSON_IsString(ipv6_address) && !cJSON_IsNull(ipv6_address)) { ogs_error("OpenAPI_ip_end_point_parseFromJSON() failed [ipv6_address]"); goto end; } } - cJSON *transport = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "transport"); - - OpenAPI_transport_protocol_e transportVariable; + transport = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "transport"); if (transport) { if (!cJSON_IsString(transport)) { ogs_error("OpenAPI_ip_end_point_parseFromJSON() failed [transport]"); @@ -109,8 +119,7 @@ OpenAPI_ip_end_point_t *OpenAPI_ip_end_point_parseFromJSON(cJSON *ip_end_pointJS transportVariable = OpenAPI_transport_protocol_FromString(transport->valuestring); } - cJSON *port = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "port"); - + port = cJSON_GetObjectItemCaseSensitive(ip_end_pointJSON, "port"); if (port) { if (!cJSON_IsNumber(port)) { ogs_error("OpenAPI_ip_end_point_parseFromJSON() failed [port]"); @@ -119,8 +128,8 @@ OpenAPI_ip_end_point_t *OpenAPI_ip_end_point_parseFromJSON(cJSON *ip_end_pointJS } ip_end_point_local_var = OpenAPI_ip_end_point_create ( - ipv4_address ? ogs_strdup(ipv4_address->valuestring) : NULL, - ipv6_address ? ogs_strdup(ipv6_address->valuestring) : NULL, + ipv4_address && !cJSON_IsNull(ipv4_address) ? ogs_strdup(ipv4_address->valuestring) : NULL, + ipv6_address && !cJSON_IsNull(ipv6_address) ? ogs_strdup(ipv6_address->valuestring) : NULL, transport ? transportVariable : 0, port ? true : false, port ? port->valuedouble : 0 diff --git a/lib/sbi/openapi/model/ip_multicast_address_info.c b/lib/sbi/openapi/model/ip_multicast_address_info.c index 5c1b5d8ce..df32a7b4e 100644 --- a/lib/sbi/openapi/model/ip_multicast_address_info.c +++ b/lib/sbi/openapi/model/ip_multicast_address_info.c @@ -24,20 +24,34 @@ OpenAPI_ip_multicast_address_info_t *OpenAPI_ip_multicast_address_info_create( void OpenAPI_ip_multicast_address_info_free(OpenAPI_ip_multicast_address_info_t *ip_multicast_address_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ip_multicast_address_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(ip_multicast_address_info->src_ipv4_addr); - ogs_free(ip_multicast_address_info->ipv4_mul_addr); - ogs_free(ip_multicast_address_info->src_ipv6_addr); - ogs_free(ip_multicast_address_info->ipv6_mul_addr); + if (ip_multicast_address_info->src_ipv4_addr) { + ogs_free(ip_multicast_address_info->src_ipv4_addr); + ip_multicast_address_info->src_ipv4_addr = NULL; + } + if (ip_multicast_address_info->ipv4_mul_addr) { + ogs_free(ip_multicast_address_info->ipv4_mul_addr); + ip_multicast_address_info->ipv4_mul_addr = NULL; + } + if (ip_multicast_address_info->src_ipv6_addr) { + ogs_free(ip_multicast_address_info->src_ipv6_addr); + ip_multicast_address_info->src_ipv6_addr = NULL; + } + if (ip_multicast_address_info->ipv6_mul_addr) { + ogs_free(ip_multicast_address_info->ipv6_mul_addr); + ip_multicast_address_info->ipv6_mul_addr = NULL; + } ogs_free(ip_multicast_address_info); } cJSON *OpenAPI_ip_multicast_address_info_convertToJSON(OpenAPI_ip_multicast_address_info_t *ip_multicast_address_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ip_multicast_address_info == NULL) { ogs_error("OpenAPI_ip_multicast_address_info_convertToJSON() failed [IpMulticastAddressInfo]"); @@ -80,47 +94,48 @@ end: OpenAPI_ip_multicast_address_info_t *OpenAPI_ip_multicast_address_info_parseFromJSON(cJSON *ip_multicast_address_infoJSON) { OpenAPI_ip_multicast_address_info_t *ip_multicast_address_info_local_var = NULL; - cJSON *src_ipv4_addr = cJSON_GetObjectItemCaseSensitive(ip_multicast_address_infoJSON, "srcIpv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *src_ipv4_addr = NULL; + cJSON *ipv4_mul_addr = NULL; + cJSON *src_ipv6_addr = NULL; + cJSON *ipv6_mul_addr = NULL; + src_ipv4_addr = cJSON_GetObjectItemCaseSensitive(ip_multicast_address_infoJSON, "srcIpv4Addr"); if (src_ipv4_addr) { - if (!cJSON_IsString(src_ipv4_addr)) { + if (!cJSON_IsString(src_ipv4_addr) && !cJSON_IsNull(src_ipv4_addr)) { ogs_error("OpenAPI_ip_multicast_address_info_parseFromJSON() failed [src_ipv4_addr]"); goto end; } } - cJSON *ipv4_mul_addr = cJSON_GetObjectItemCaseSensitive(ip_multicast_address_infoJSON, "ipv4MulAddr"); - + ipv4_mul_addr = cJSON_GetObjectItemCaseSensitive(ip_multicast_address_infoJSON, "ipv4MulAddr"); if (ipv4_mul_addr) { - if (!cJSON_IsString(ipv4_mul_addr)) { + if (!cJSON_IsString(ipv4_mul_addr) && !cJSON_IsNull(ipv4_mul_addr)) { ogs_error("OpenAPI_ip_multicast_address_info_parseFromJSON() failed [ipv4_mul_addr]"); goto end; } } - cJSON *src_ipv6_addr = cJSON_GetObjectItemCaseSensitive(ip_multicast_address_infoJSON, "srcIpv6Addr"); - + src_ipv6_addr = cJSON_GetObjectItemCaseSensitive(ip_multicast_address_infoJSON, "srcIpv6Addr"); if (src_ipv6_addr) { - if (!cJSON_IsString(src_ipv6_addr)) { + if (!cJSON_IsString(src_ipv6_addr) && !cJSON_IsNull(src_ipv6_addr)) { ogs_error("OpenAPI_ip_multicast_address_info_parseFromJSON() failed [src_ipv6_addr]"); goto end; } } - cJSON *ipv6_mul_addr = cJSON_GetObjectItemCaseSensitive(ip_multicast_address_infoJSON, "ipv6MulAddr"); - + ipv6_mul_addr = cJSON_GetObjectItemCaseSensitive(ip_multicast_address_infoJSON, "ipv6MulAddr"); if (ipv6_mul_addr) { - if (!cJSON_IsString(ipv6_mul_addr)) { + if (!cJSON_IsString(ipv6_mul_addr) && !cJSON_IsNull(ipv6_mul_addr)) { ogs_error("OpenAPI_ip_multicast_address_info_parseFromJSON() failed [ipv6_mul_addr]"); goto end; } } ip_multicast_address_info_local_var = OpenAPI_ip_multicast_address_info_create ( - src_ipv4_addr ? ogs_strdup(src_ipv4_addr->valuestring) : NULL, - ipv4_mul_addr ? ogs_strdup(ipv4_mul_addr->valuestring) : NULL, - src_ipv6_addr ? ogs_strdup(src_ipv6_addr->valuestring) : NULL, - ipv6_mul_addr ? ogs_strdup(ipv6_mul_addr->valuestring) : NULL + src_ipv4_addr && !cJSON_IsNull(src_ipv4_addr) ? ogs_strdup(src_ipv4_addr->valuestring) : NULL, + ipv4_mul_addr && !cJSON_IsNull(ipv4_mul_addr) ? ogs_strdup(ipv4_mul_addr->valuestring) : NULL, + src_ipv6_addr && !cJSON_IsNull(src_ipv6_addr) ? ogs_strdup(src_ipv6_addr->valuestring) : NULL, + ipv6_mul_addr && !cJSON_IsNull(ipv6_mul_addr) ? ogs_strdup(ipv6_mul_addr->valuestring) : NULL ); return ip_multicast_address_info_local_var; diff --git a/lib/sbi/openapi/model/ip_sm_gw_registration.c b/lib/sbi/openapi/model/ip_sm_gw_registration.c index 33da695f4..dbd57c4c8 100644 --- a/lib/sbi/openapi/model/ip_sm_gw_registration.c +++ b/lib/sbi/openapi/model/ip_sm_gw_registration.c @@ -24,18 +24,26 @@ OpenAPI_ip_sm_gw_registration_t *OpenAPI_ip_sm_gw_registration_create( void OpenAPI_ip_sm_gw_registration_free(OpenAPI_ip_sm_gw_registration_t *ip_sm_gw_registration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ip_sm_gw_registration) { return; } - OpenAPI_lnode_t *node; - ogs_free(ip_sm_gw_registration->ip_sm_gw_map_address); - OpenAPI_network_node_diameter_address_free(ip_sm_gw_registration->ip_sm_gw_diameter_address); + if (ip_sm_gw_registration->ip_sm_gw_map_address) { + ogs_free(ip_sm_gw_registration->ip_sm_gw_map_address); + ip_sm_gw_registration->ip_sm_gw_map_address = NULL; + } + if (ip_sm_gw_registration->ip_sm_gw_diameter_address) { + OpenAPI_network_node_diameter_address_free(ip_sm_gw_registration->ip_sm_gw_diameter_address); + ip_sm_gw_registration->ip_sm_gw_diameter_address = NULL; + } ogs_free(ip_sm_gw_registration); } cJSON *OpenAPI_ip_sm_gw_registration_convertToJSON(OpenAPI_ip_sm_gw_registration_t *ip_sm_gw_registration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ip_sm_gw_registration == NULL) { ogs_error("OpenAPI_ip_sm_gw_registration_convertToJSON() failed [IpSmGwRegistration]"); @@ -77,24 +85,25 @@ end: OpenAPI_ip_sm_gw_registration_t *OpenAPI_ip_sm_gw_registration_parseFromJSON(cJSON *ip_sm_gw_registrationJSON) { OpenAPI_ip_sm_gw_registration_t *ip_sm_gw_registration_local_var = NULL; - cJSON *ip_sm_gw_map_address = cJSON_GetObjectItemCaseSensitive(ip_sm_gw_registrationJSON, "ipSmGwMapAddress"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ip_sm_gw_map_address = NULL; + cJSON *ip_sm_gw_diameter_address = NULL; + OpenAPI_network_node_diameter_address_t *ip_sm_gw_diameter_address_local_nonprim = NULL; + cJSON *unri_indicator = NULL; + ip_sm_gw_map_address = cJSON_GetObjectItemCaseSensitive(ip_sm_gw_registrationJSON, "ipSmGwMapAddress"); if (ip_sm_gw_map_address) { - if (!cJSON_IsString(ip_sm_gw_map_address)) { + if (!cJSON_IsString(ip_sm_gw_map_address) && !cJSON_IsNull(ip_sm_gw_map_address)) { ogs_error("OpenAPI_ip_sm_gw_registration_parseFromJSON() failed [ip_sm_gw_map_address]"); goto end; } } - cJSON *ip_sm_gw_diameter_address = cJSON_GetObjectItemCaseSensitive(ip_sm_gw_registrationJSON, "ipSmGwDiameterAddress"); - - OpenAPI_network_node_diameter_address_t *ip_sm_gw_diameter_address_local_nonprim = NULL; + ip_sm_gw_diameter_address = cJSON_GetObjectItemCaseSensitive(ip_sm_gw_registrationJSON, "ipSmGwDiameterAddress"); if (ip_sm_gw_diameter_address) { ip_sm_gw_diameter_address_local_nonprim = OpenAPI_network_node_diameter_address_parseFromJSON(ip_sm_gw_diameter_address); } - cJSON *unri_indicator = cJSON_GetObjectItemCaseSensitive(ip_sm_gw_registrationJSON, "unriIndicator"); - + unri_indicator = cJSON_GetObjectItemCaseSensitive(ip_sm_gw_registrationJSON, "unriIndicator"); if (unri_indicator) { if (!cJSON_IsBool(unri_indicator)) { ogs_error("OpenAPI_ip_sm_gw_registration_parseFromJSON() failed [unri_indicator]"); @@ -103,7 +112,7 @@ OpenAPI_ip_sm_gw_registration_t *OpenAPI_ip_sm_gw_registration_parseFromJSON(cJS } ip_sm_gw_registration_local_var = OpenAPI_ip_sm_gw_registration_create ( - ip_sm_gw_map_address ? ogs_strdup(ip_sm_gw_map_address->valuestring) : NULL, + ip_sm_gw_map_address && !cJSON_IsNull(ip_sm_gw_map_address) ? ogs_strdup(ip_sm_gw_map_address->valuestring) : NULL, ip_sm_gw_diameter_address ? ip_sm_gw_diameter_address_local_nonprim : NULL, unri_indicator ? true : false, unri_indicator ? unri_indicator->valueint : 0 @@ -111,6 +120,10 @@ OpenAPI_ip_sm_gw_registration_t *OpenAPI_ip_sm_gw_registration_parseFromJSON(cJS return ip_sm_gw_registration_local_var; end: + if (ip_sm_gw_diameter_address_local_nonprim) { + OpenAPI_network_node_diameter_address_free(ip_sm_gw_diameter_address_local_nonprim); + ip_sm_gw_diameter_address_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/iptv_config_data.c b/lib/sbi/openapi/model/iptv_config_data.c index 74d3ca153..9f3e3a460 100644 --- a/lib/sbi/openapi/model/iptv_config_data.c +++ b/lib/sbi/openapi/model/iptv_config_data.c @@ -32,30 +32,56 @@ OpenAPI_iptv_config_data_t *OpenAPI_iptv_config_data_create( void OpenAPI_iptv_config_data_free(OpenAPI_iptv_config_data_t *iptv_config_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == iptv_config_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(iptv_config_data->supi); - ogs_free(iptv_config_data->inter_group_id); - ogs_free(iptv_config_data->dnn); - OpenAPI_snssai_free(iptv_config_data->snssai); - ogs_free(iptv_config_data->af_app_id); - OpenAPI_list_for_each(iptv_config_data->multi_acc_ctrls, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_multicast_access_control_free(localKeyValue->value); - ogs_free(localKeyValue); + if (iptv_config_data->supi) { + ogs_free(iptv_config_data->supi); + iptv_config_data->supi = NULL; + } + if (iptv_config_data->inter_group_id) { + ogs_free(iptv_config_data->inter_group_id); + iptv_config_data->inter_group_id = NULL; + } + if (iptv_config_data->dnn) { + ogs_free(iptv_config_data->dnn); + iptv_config_data->dnn = NULL; + } + if (iptv_config_data->snssai) { + OpenAPI_snssai_free(iptv_config_data->snssai); + iptv_config_data->snssai = NULL; + } + if (iptv_config_data->af_app_id) { + ogs_free(iptv_config_data->af_app_id); + iptv_config_data->af_app_id = NULL; + } + if (iptv_config_data->multi_acc_ctrls) { + OpenAPI_list_for_each(iptv_config_data->multi_acc_ctrls, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_multicast_access_control_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(iptv_config_data->multi_acc_ctrls); + iptv_config_data->multi_acc_ctrls = NULL; + } + if (iptv_config_data->supp_feat) { + ogs_free(iptv_config_data->supp_feat); + iptv_config_data->supp_feat = NULL; + } + if (iptv_config_data->res_uri) { + ogs_free(iptv_config_data->res_uri); + iptv_config_data->res_uri = NULL; } - OpenAPI_list_free(iptv_config_data->multi_acc_ctrls); - ogs_free(iptv_config_data->supp_feat); - ogs_free(iptv_config_data->res_uri); ogs_free(iptv_config_data); } cJSON *OpenAPI_iptv_config_data_convertToJSON(OpenAPI_iptv_config_data_t *iptv_config_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (iptv_config_data == NULL) { ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [IptvConfigData]"); @@ -97,31 +123,38 @@ cJSON *OpenAPI_iptv_config_data_convertToJSON(OpenAPI_iptv_config_data_t *iptv_c } } + if (!iptv_config_data->af_app_id) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [af_app_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afAppId", iptv_config_data->af_app_id) == NULL) { ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [af_app_id]"); goto end; } + if (!iptv_config_data->multi_acc_ctrls) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [multi_acc_ctrls]"); + return NULL; + } cJSON *multi_acc_ctrls = cJSON_AddObjectToObject(item, "multiAccCtrls"); if (multi_acc_ctrls == NULL) { ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [multi_acc_ctrls]"); goto end; } cJSON *localMapObject = multi_acc_ctrls; - OpenAPI_lnode_t *multi_acc_ctrls_node; if (iptv_config_data->multi_acc_ctrls) { - OpenAPI_list_for_each(iptv_config_data->multi_acc_ctrls, multi_acc_ctrls_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)multi_acc_ctrls_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_multicast_access_control_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(iptv_config_data->multi_acc_ctrls, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_multicast_access_control_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_iptv_config_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } + } if (iptv_config_data->supp_feat) { if (cJSON_AddStringToObject(item, "suppFeat", iptv_config_data->supp_feat) == NULL) { @@ -144,110 +177,127 @@ end: OpenAPI_iptv_config_data_t *OpenAPI_iptv_config_data_parseFromJSON(cJSON *iptv_config_dataJSON) { OpenAPI_iptv_config_data_t *iptv_config_data_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *inter_group_id = NULL; + cJSON *dnn = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *af_app_id = NULL; + cJSON *multi_acc_ctrls = NULL; + OpenAPI_list_t *multi_acc_ctrlsList = NULL; + cJSON *supp_feat = NULL; + cJSON *res_uri = NULL; + supi = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *inter_group_id = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "interGroupId"); - + inter_group_id = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "interGroupId"); if (inter_group_id) { - if (!cJSON_IsString(inter_group_id)) { + if (!cJSON_IsString(inter_group_id) && !cJSON_IsNull(inter_group_id)) { ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [inter_group_id]"); goto end; } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "snssai"); - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "snssai"); if (snssai) { snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); } - cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "afAppId"); + af_app_id = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "afAppId"); if (!af_app_id) { ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [af_app_id]"); goto end; } - if (!cJSON_IsString(af_app_id)) { ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [af_app_id]"); goto end; } - cJSON *multi_acc_ctrls = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "multiAccCtrls"); + multi_acc_ctrls = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "multiAccCtrls"); if (!multi_acc_ctrls) { ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [multi_acc_ctrls]"); goto end; } - - OpenAPI_list_t *multi_acc_ctrlsList; - cJSON *multi_acc_ctrls_local_map; - if (!cJSON_IsObject(multi_acc_ctrls)) { - ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [multi_acc_ctrls]"); - goto end; - } - multi_acc_ctrlsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(multi_acc_ctrls_local_map, multi_acc_ctrls) { - cJSON *localMapObject = multi_acc_ctrls_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_multicast_access_control_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [inner]"); + cJSON *multi_acc_ctrls_local_map = NULL; + if (!cJSON_IsObject(multi_acc_ctrls) && !cJSON_IsNull(multi_acc_ctrls)) { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [multi_acc_ctrls]"); goto end; } - OpenAPI_list_add(multi_acc_ctrlsList, localMapKeyPair); - } - - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "suppFeat"); + if (cJSON_IsObject(multi_acc_ctrls)) { + multi_acc_ctrlsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(multi_acc_ctrls_local_map, multi_acc_ctrls) { + cJSON *localMapObject = multi_acc_ctrls_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_multicast_access_control_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(multi_acc_ctrlsList, localMapKeyPair); + } + } + supp_feat = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [supp_feat]"); goto end; } } - cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "resUri"); - + res_uri = cJSON_GetObjectItemCaseSensitive(iptv_config_dataJSON, "resUri"); if (res_uri) { - if (!cJSON_IsString(res_uri)) { + if (!cJSON_IsString(res_uri) && !cJSON_IsNull(res_uri)) { ogs_error("OpenAPI_iptv_config_data_parseFromJSON() failed [res_uri]"); goto end; } } iptv_config_data_local_var = OpenAPI_iptv_config_data_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, - inter_group_id ? ogs_strdup(inter_group_id->valuestring) : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + inter_group_id && !cJSON_IsNull(inter_group_id) ? ogs_strdup(inter_group_id->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, snssai ? snssai_local_nonprim : NULL, ogs_strdup(af_app_id->valuestring), multi_acc_ctrlsList, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL, - res_uri ? ogs_strdup(res_uri->valuestring) : NULL + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL, + res_uri && !cJSON_IsNull(res_uri) ? ogs_strdup(res_uri->valuestring) : NULL ); return iptv_config_data_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (multi_acc_ctrlsList) { + OpenAPI_list_for_each(multi_acc_ctrlsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_multicast_access_control_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(multi_acc_ctrlsList); + multi_acc_ctrlsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/iptv_config_data_patch.c b/lib/sbi/openapi/model/iptv_config_data_patch.c index dd10eb004..1e7d4bd03 100644 --- a/lib/sbi/openapi/model/iptv_config_data_patch.c +++ b/lib/sbi/openapi/model/iptv_config_data_patch.c @@ -18,23 +18,28 @@ OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_create( void OpenAPI_iptv_config_data_patch_free(OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == iptv_config_data_patch) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(iptv_config_data_patch->multi_acc_ctrls, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_multicast_access_control_free(localKeyValue->value); - ogs_free(localKeyValue); + if (iptv_config_data_patch->multi_acc_ctrls) { + OpenAPI_list_for_each(iptv_config_data_patch->multi_acc_ctrls, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_multicast_access_control_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(iptv_config_data_patch->multi_acc_ctrls); + iptv_config_data_patch->multi_acc_ctrls = NULL; } - OpenAPI_list_free(iptv_config_data_patch->multi_acc_ctrls); ogs_free(iptv_config_data_patch); } cJSON *OpenAPI_iptv_config_data_patch_convertToJSON(OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (iptv_config_data_patch == NULL) { ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [IptvConfigDataPatch]"); @@ -49,21 +54,20 @@ cJSON *OpenAPI_iptv_config_data_patch_convertToJSON(OpenAPI_iptv_config_data_pat goto end; } cJSON *localMapObject = multi_acc_ctrls; - OpenAPI_lnode_t *multi_acc_ctrls_node; if (iptv_config_data_patch->multi_acc_ctrls) { - OpenAPI_list_for_each(iptv_config_data_patch->multi_acc_ctrls, multi_acc_ctrls_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)multi_acc_ctrls_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_multicast_access_control_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(iptv_config_data_patch->multi_acc_ctrls, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_multicast_access_control_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -72,30 +76,33 @@ end: OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_parseFromJSON(cJSON *iptv_config_data_patchJSON) { OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch_local_var = NULL; - cJSON *multi_acc_ctrls = cJSON_GetObjectItemCaseSensitive(iptv_config_data_patchJSON, "multiAccCtrls"); - - OpenAPI_list_t *multi_acc_ctrlsList; + OpenAPI_lnode_t *node = NULL; + cJSON *multi_acc_ctrls = NULL; + OpenAPI_list_t *multi_acc_ctrlsList = NULL; + multi_acc_ctrls = cJSON_GetObjectItemCaseSensitive(iptv_config_data_patchJSON, "multiAccCtrls"); if (multi_acc_ctrls) { - cJSON *multi_acc_ctrls_local_map; - if (!cJSON_IsObject(multi_acc_ctrls)) { - ogs_error("OpenAPI_iptv_config_data_patch_parseFromJSON() failed [multi_acc_ctrls]"); - goto end; - } - multi_acc_ctrlsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(multi_acc_ctrls_local_map, multi_acc_ctrls) { - cJSON *localMapObject = multi_acc_ctrls_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_multicast_access_control_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_iptv_config_data_patch_parseFromJSON() failed [inner]"); + cJSON *multi_acc_ctrls_local_map = NULL; + if (!cJSON_IsObject(multi_acc_ctrls) && !cJSON_IsNull(multi_acc_ctrls)) { + ogs_error("OpenAPI_iptv_config_data_patch_parseFromJSON() failed [multi_acc_ctrls]"); goto end; } - OpenAPI_list_add(multi_acc_ctrlsList, localMapKeyPair); - } + if (cJSON_IsObject(multi_acc_ctrls)) { + multi_acc_ctrlsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(multi_acc_ctrls_local_map, multi_acc_ctrls) { + cJSON *localMapObject = multi_acc_ctrls_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_multicast_access_control_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_iptv_config_data_patch_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(multi_acc_ctrlsList, localMapKeyPair); + } + } } iptv_config_data_patch_local_var = OpenAPI_iptv_config_data_patch_create ( @@ -104,6 +111,16 @@ OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_parseFromJSON(c return iptv_config_data_patch_local_var; end: + if (multi_acc_ctrlsList) { + OpenAPI_list_for_each(multi_acc_ctrlsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_multicast_access_control_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(multi_acc_ctrlsList); + multi_acc_ctrlsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ipv4_address_range.c b/lib/sbi/openapi/model/ipv4_address_range.c index 3db010549..c447dbf27 100644 --- a/lib/sbi/openapi/model/ipv4_address_range.c +++ b/lib/sbi/openapi/model/ipv4_address_range.c @@ -20,18 +20,26 @@ OpenAPI_ipv4_address_range_t *OpenAPI_ipv4_address_range_create( void OpenAPI_ipv4_address_range_free(OpenAPI_ipv4_address_range_t *ipv4_address_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ipv4_address_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(ipv4_address_range->start); - ogs_free(ipv4_address_range->end); + if (ipv4_address_range->start) { + ogs_free(ipv4_address_range->start); + ipv4_address_range->start = NULL; + } + if (ipv4_address_range->end) { + ogs_free(ipv4_address_range->end); + ipv4_address_range->end = NULL; + } ogs_free(ipv4_address_range); } cJSON *OpenAPI_ipv4_address_range_convertToJSON(OpenAPI_ipv4_address_range_t *ipv4_address_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ipv4_address_range == NULL) { ogs_error("OpenAPI_ipv4_address_range_convertToJSON() failed [Ipv4AddressRange]"); @@ -60,27 +68,28 @@ end: OpenAPI_ipv4_address_range_t *OpenAPI_ipv4_address_range_parseFromJSON(cJSON *ipv4_address_rangeJSON) { OpenAPI_ipv4_address_range_t *ipv4_address_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(ipv4_address_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + start = cJSON_GetObjectItemCaseSensitive(ipv4_address_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_ipv4_address_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(ipv4_address_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(ipv4_address_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_ipv4_address_range_parseFromJSON() failed [end]"); goto end; } } ipv4_address_range_local_var = OpenAPI_ipv4_address_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL ); return ipv4_address_range_local_var; diff --git a/lib/sbi/openapi/model/ipv6_prefix_range.c b/lib/sbi/openapi/model/ipv6_prefix_range.c index 2df5ed09d..8ab2486a0 100644 --- a/lib/sbi/openapi/model/ipv6_prefix_range.c +++ b/lib/sbi/openapi/model/ipv6_prefix_range.c @@ -20,18 +20,26 @@ OpenAPI_ipv6_prefix_range_t *OpenAPI_ipv6_prefix_range_create( void OpenAPI_ipv6_prefix_range_free(OpenAPI_ipv6_prefix_range_t *ipv6_prefix_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ipv6_prefix_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(ipv6_prefix_range->start); - ogs_free(ipv6_prefix_range->end); + if (ipv6_prefix_range->start) { + ogs_free(ipv6_prefix_range->start); + ipv6_prefix_range->start = NULL; + } + if (ipv6_prefix_range->end) { + ogs_free(ipv6_prefix_range->end); + ipv6_prefix_range->end = NULL; + } ogs_free(ipv6_prefix_range); } cJSON *OpenAPI_ipv6_prefix_range_convertToJSON(OpenAPI_ipv6_prefix_range_t *ipv6_prefix_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ipv6_prefix_range == NULL) { ogs_error("OpenAPI_ipv6_prefix_range_convertToJSON() failed [Ipv6PrefixRange]"); @@ -60,27 +68,28 @@ end: OpenAPI_ipv6_prefix_range_t *OpenAPI_ipv6_prefix_range_parseFromJSON(cJSON *ipv6_prefix_rangeJSON) { OpenAPI_ipv6_prefix_range_t *ipv6_prefix_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(ipv6_prefix_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + start = cJSON_GetObjectItemCaseSensitive(ipv6_prefix_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_ipv6_prefix_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(ipv6_prefix_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(ipv6_prefix_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_ipv6_prefix_range_parseFromJSON() failed [end]"); goto end; } } ipv6_prefix_range_local_var = OpenAPI_ipv6_prefix_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL ); return ipv6_prefix_range_local_var; diff --git a/lib/sbi/openapi/model/key_amf.c b/lib/sbi/openapi/model/key_amf.c index 8e1b5cd05..5731553b0 100644 --- a/lib/sbi/openapi/model/key_amf.c +++ b/lib/sbi/openapi/model/key_amf.c @@ -20,17 +20,22 @@ OpenAPI_key_amf_t *OpenAPI_key_amf_create( void OpenAPI_key_amf_free(OpenAPI_key_amf_t *key_amf) { + OpenAPI_lnode_t *node = NULL; + if (NULL == key_amf) { return; } - OpenAPI_lnode_t *node; - ogs_free(key_amf->key_val); + if (key_amf->key_val) { + ogs_free(key_amf->key_val); + key_amf->key_val = NULL; + } ogs_free(key_amf); } cJSON *OpenAPI_key_amf_convertToJSON(OpenAPI_key_amf_t *key_amf) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (key_amf == NULL) { ogs_error("OpenAPI_key_amf_convertToJSON() failed [KeyAmf]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_key_amf_convertToJSON(OpenAPI_key_amf_t *key_amf) } item = cJSON_CreateObject(); + if (key_amf->key_type == OpenAPI_key_amf_type_NULL) { + ogs_error("OpenAPI_key_amf_convertToJSON() failed [key_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "keyType", OpenAPI_key_amf_type_ToString(key_amf->key_type)) == NULL) { ogs_error("OpenAPI_key_amf_convertToJSON() failed [key_type]"); goto end; } + if (!key_amf->key_val) { + ogs_error("OpenAPI_key_amf_convertToJSON() failed [key_val]"); + return NULL; + } if (cJSON_AddStringToObject(item, "keyVal", key_amf->key_val) == NULL) { ogs_error("OpenAPI_key_amf_convertToJSON() failed [key_val]"); goto end; @@ -55,25 +68,26 @@ end: OpenAPI_key_amf_t *OpenAPI_key_amf_parseFromJSON(cJSON *key_amfJSON) { OpenAPI_key_amf_t *key_amf_local_var = NULL; - cJSON *key_type = cJSON_GetObjectItemCaseSensitive(key_amfJSON, "keyType"); + OpenAPI_lnode_t *node = NULL; + cJSON *key_type = NULL; + OpenAPI_key_amf_type_e key_typeVariable = 0; + cJSON *key_val = NULL; + key_type = cJSON_GetObjectItemCaseSensitive(key_amfJSON, "keyType"); if (!key_type) { ogs_error("OpenAPI_key_amf_parseFromJSON() failed [key_type]"); goto end; } - - OpenAPI_key_amf_type_e key_typeVariable; if (!cJSON_IsString(key_type)) { ogs_error("OpenAPI_key_amf_parseFromJSON() failed [key_type]"); goto end; } key_typeVariable = OpenAPI_key_amf_type_FromString(key_type->valuestring); - cJSON *key_val = cJSON_GetObjectItemCaseSensitive(key_amfJSON, "keyVal"); + key_val = cJSON_GetObjectItemCaseSensitive(key_amfJSON, "keyVal"); if (!key_val) { ogs_error("OpenAPI_key_amf_parseFromJSON() failed [key_val]"); goto end; } - if (!cJSON_IsString(key_val)) { ogs_error("OpenAPI_key_amf_parseFromJSON() failed [key_val]"); goto end; diff --git a/lib/sbi/openapi/model/ladn_info.c b/lib/sbi/openapi/model/ladn_info.c index aa0d0d7b8..8cc09952a 100644 --- a/lib/sbi/openapi/model/ladn_info.c +++ b/lib/sbi/openapi/model/ladn_info.c @@ -20,17 +20,22 @@ OpenAPI_ladn_info_t *OpenAPI_ladn_info_create( void OpenAPI_ladn_info_free(OpenAPI_ladn_info_t *ladn_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ladn_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(ladn_info->ladn); + if (ladn_info->ladn) { + ogs_free(ladn_info->ladn); + ladn_info->ladn = NULL; + } ogs_free(ladn_info); } cJSON *OpenAPI_ladn_info_convertToJSON(OpenAPI_ladn_info_t *ladn_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ladn_info == NULL) { ogs_error("OpenAPI_ladn_info_convertToJSON() failed [LadnInfo]"); @@ -38,12 +43,16 @@ cJSON *OpenAPI_ladn_info_convertToJSON(OpenAPI_ladn_info_t *ladn_info) } item = cJSON_CreateObject(); + if (!ladn_info->ladn) { + ogs_error("OpenAPI_ladn_info_convertToJSON() failed [ladn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ladn", ladn_info->ladn) == NULL) { ogs_error("OpenAPI_ladn_info_convertToJSON() failed [ladn]"); goto end; } - if (ladn_info->presence) { + if (ladn_info->presence != OpenAPI_presence_state_NULL) { if (cJSON_AddStringToObject(item, "presence", OpenAPI_presence_state_ToString(ladn_info->presence)) == NULL) { ogs_error("OpenAPI_ladn_info_convertToJSON() failed [presence]"); goto end; @@ -57,20 +66,21 @@ end: OpenAPI_ladn_info_t *OpenAPI_ladn_info_parseFromJSON(cJSON *ladn_infoJSON) { OpenAPI_ladn_info_t *ladn_info_local_var = NULL; - cJSON *ladn = cJSON_GetObjectItemCaseSensitive(ladn_infoJSON, "ladn"); + OpenAPI_lnode_t *node = NULL; + cJSON *ladn = NULL; + cJSON *presence = NULL; + OpenAPI_presence_state_e presenceVariable = 0; + ladn = cJSON_GetObjectItemCaseSensitive(ladn_infoJSON, "ladn"); if (!ladn) { ogs_error("OpenAPI_ladn_info_parseFromJSON() failed [ladn]"); goto end; } - if (!cJSON_IsString(ladn)) { ogs_error("OpenAPI_ladn_info_parseFromJSON() failed [ladn]"); goto end; } - cJSON *presence = cJSON_GetObjectItemCaseSensitive(ladn_infoJSON, "presence"); - - OpenAPI_presence_state_e presenceVariable; + presence = cJSON_GetObjectItemCaseSensitive(ladn_infoJSON, "presence"); if (presence) { if (!cJSON_IsString(presence)) { ogs_error("OpenAPI_ladn_info_parseFromJSON() failed [presence]"); diff --git a/lib/sbi/openapi/model/lcs_broadcast_assistance_types_data.c b/lib/sbi/openapi/model/lcs_broadcast_assistance_types_data.c index 9375a08ce..4d4514620 100644 --- a/lib/sbi/openapi/model/lcs_broadcast_assistance_types_data.c +++ b/lib/sbi/openapi/model/lcs_broadcast_assistance_types_data.c @@ -18,20 +18,25 @@ OpenAPI_lcs_broadcast_assistance_types_data_t *OpenAPI_lcs_broadcast_assistance_ void OpenAPI_lcs_broadcast_assistance_types_data_free(OpenAPI_lcs_broadcast_assistance_types_data_t *lcs_broadcast_assistance_types_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lcs_broadcast_assistance_types_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(lcs_broadcast_assistance_types_data->location_assistance_type, node) { - ogs_free(node->data); + if (lcs_broadcast_assistance_types_data->location_assistance_type) { + OpenAPI_list_for_each(lcs_broadcast_assistance_types_data->location_assistance_type, node) { + ogs_free(node->data); + } + OpenAPI_list_free(lcs_broadcast_assistance_types_data->location_assistance_type); + lcs_broadcast_assistance_types_data->location_assistance_type = NULL; } - OpenAPI_list_free(lcs_broadcast_assistance_types_data->location_assistance_type); ogs_free(lcs_broadcast_assistance_types_data); } cJSON *OpenAPI_lcs_broadcast_assistance_types_data_convertToJSON(OpenAPI_lcs_broadcast_assistance_types_data_t *lcs_broadcast_assistance_types_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lcs_broadcast_assistance_types_data == NULL) { ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_convertToJSON() failed [LcsBroadcastAssistanceTypesData]"); @@ -39,15 +44,17 @@ cJSON *OpenAPI_lcs_broadcast_assistance_types_data_convertToJSON(OpenAPI_lcs_bro } item = cJSON_CreateObject(); - cJSON *location_assistance_type = cJSON_AddArrayToObject(item, "locationAssistanceType"); - if (location_assistance_type == NULL) { + if (!lcs_broadcast_assistance_types_data->location_assistance_type) { + ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_convertToJSON() failed [location_assistance_type]"); + return NULL; + } + cJSON *location_assistance_typeList = cJSON_AddArrayToObject(item, "locationAssistanceType"); + if (location_assistance_typeList == NULL) { ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_convertToJSON() failed [location_assistance_type]"); goto end; } - - OpenAPI_lnode_t *location_assistance_type_node; - OpenAPI_list_for_each(lcs_broadcast_assistance_types_data->location_assistance_type, location_assistance_type_node) { - } + OpenAPI_list_for_each(lcs_broadcast_assistance_types_data->location_assistance_type, node) { + } end: return item; @@ -56,22 +63,26 @@ end: OpenAPI_lcs_broadcast_assistance_types_data_t *OpenAPI_lcs_broadcast_assistance_types_data_parseFromJSON(cJSON *lcs_broadcast_assistance_types_dataJSON) { OpenAPI_lcs_broadcast_assistance_types_data_t *lcs_broadcast_assistance_types_data_local_var = NULL; - cJSON *location_assistance_type = cJSON_GetObjectItemCaseSensitive(lcs_broadcast_assistance_types_dataJSON, "locationAssistanceType"); + OpenAPI_lnode_t *node = NULL; + cJSON *location_assistance_type = NULL; + OpenAPI_list_t *location_assistance_typeList = NULL; + location_assistance_type = cJSON_GetObjectItemCaseSensitive(lcs_broadcast_assistance_types_dataJSON, "locationAssistanceType"); if (!location_assistance_type) { ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_parseFromJSON() failed [location_assistance_type]"); goto end; } + cJSON *location_assistance_type_local = NULL; + if (!cJSON_IsArray(location_assistance_type)) { + ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_parseFromJSON() failed [location_assistance_type]"); + goto end; + } - OpenAPI_list_t *location_assistance_typeList; - cJSON *location_assistance_type_local; - if (!cJSON_IsArray(location_assistance_type)) { - ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_parseFromJSON() failed [location_assistance_type]"); - goto end; - } - location_assistance_typeList = OpenAPI_list_create(); + location_assistance_typeList = OpenAPI_list_create(); - cJSON_ArrayForEach(location_assistance_type_local, location_assistance_type) { - } + cJSON_ArrayForEach(location_assistance_type_local, location_assistance_type) { + double *localDouble = NULL; + int *localInt = NULL; + } lcs_broadcast_assistance_types_data_local_var = OpenAPI_lcs_broadcast_assistance_types_data_create ( location_assistance_typeList @@ -79,6 +90,13 @@ OpenAPI_lcs_broadcast_assistance_types_data_t *OpenAPI_lcs_broadcast_assistance_ return lcs_broadcast_assistance_types_data_local_var; end: + if (location_assistance_typeList) { + OpenAPI_list_for_each(location_assistance_typeList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(location_assistance_typeList); + location_assistance_typeList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lcs_broadcast_assistance_types_data_1.c b/lib/sbi/openapi/model/lcs_broadcast_assistance_types_data_1.c index 3c822ac79..b989c2a6c 100644 --- a/lib/sbi/openapi/model/lcs_broadcast_assistance_types_data_1.c +++ b/lib/sbi/openapi/model/lcs_broadcast_assistance_types_data_1.c @@ -18,20 +18,25 @@ OpenAPI_lcs_broadcast_assistance_types_data_1_t *OpenAPI_lcs_broadcast_assistanc void OpenAPI_lcs_broadcast_assistance_types_data_1_free(OpenAPI_lcs_broadcast_assistance_types_data_1_t *lcs_broadcast_assistance_types_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lcs_broadcast_assistance_types_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(lcs_broadcast_assistance_types_data_1->location_assistance_type, node) { - ogs_free(node->data); + if (lcs_broadcast_assistance_types_data_1->location_assistance_type) { + OpenAPI_list_for_each(lcs_broadcast_assistance_types_data_1->location_assistance_type, node) { + ogs_free(node->data); + } + OpenAPI_list_free(lcs_broadcast_assistance_types_data_1->location_assistance_type); + lcs_broadcast_assistance_types_data_1->location_assistance_type = NULL; } - OpenAPI_list_free(lcs_broadcast_assistance_types_data_1->location_assistance_type); ogs_free(lcs_broadcast_assistance_types_data_1); } cJSON *OpenAPI_lcs_broadcast_assistance_types_data_1_convertToJSON(OpenAPI_lcs_broadcast_assistance_types_data_1_t *lcs_broadcast_assistance_types_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lcs_broadcast_assistance_types_data_1 == NULL) { ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_1_convertToJSON() failed [LcsBroadcastAssistanceTypesData_1]"); @@ -39,15 +44,17 @@ cJSON *OpenAPI_lcs_broadcast_assistance_types_data_1_convertToJSON(OpenAPI_lcs_b } item = cJSON_CreateObject(); - cJSON *location_assistance_type = cJSON_AddArrayToObject(item, "locationAssistanceType"); - if (location_assistance_type == NULL) { + if (!lcs_broadcast_assistance_types_data_1->location_assistance_type) { + ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_1_convertToJSON() failed [location_assistance_type]"); + return NULL; + } + cJSON *location_assistance_typeList = cJSON_AddArrayToObject(item, "locationAssistanceType"); + if (location_assistance_typeList == NULL) { ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_1_convertToJSON() failed [location_assistance_type]"); goto end; } - - OpenAPI_lnode_t *location_assistance_type_node; - OpenAPI_list_for_each(lcs_broadcast_assistance_types_data_1->location_assistance_type, location_assistance_type_node) { - } + OpenAPI_list_for_each(lcs_broadcast_assistance_types_data_1->location_assistance_type, node) { + } end: return item; @@ -56,22 +63,26 @@ end: OpenAPI_lcs_broadcast_assistance_types_data_1_t *OpenAPI_lcs_broadcast_assistance_types_data_1_parseFromJSON(cJSON *lcs_broadcast_assistance_types_data_1JSON) { OpenAPI_lcs_broadcast_assistance_types_data_1_t *lcs_broadcast_assistance_types_data_1_local_var = NULL; - cJSON *location_assistance_type = cJSON_GetObjectItemCaseSensitive(lcs_broadcast_assistance_types_data_1JSON, "locationAssistanceType"); + OpenAPI_lnode_t *node = NULL; + cJSON *location_assistance_type = NULL; + OpenAPI_list_t *location_assistance_typeList = NULL; + location_assistance_type = cJSON_GetObjectItemCaseSensitive(lcs_broadcast_assistance_types_data_1JSON, "locationAssistanceType"); if (!location_assistance_type) { ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_1_parseFromJSON() failed [location_assistance_type]"); goto end; } + cJSON *location_assistance_type_local = NULL; + if (!cJSON_IsArray(location_assistance_type)) { + ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_1_parseFromJSON() failed [location_assistance_type]"); + goto end; + } - OpenAPI_list_t *location_assistance_typeList; - cJSON *location_assistance_type_local; - if (!cJSON_IsArray(location_assistance_type)) { - ogs_error("OpenAPI_lcs_broadcast_assistance_types_data_1_parseFromJSON() failed [location_assistance_type]"); - goto end; - } - location_assistance_typeList = OpenAPI_list_create(); + location_assistance_typeList = OpenAPI_list_create(); - cJSON_ArrayForEach(location_assistance_type_local, location_assistance_type) { - } + cJSON_ArrayForEach(location_assistance_type_local, location_assistance_type) { + double *localDouble = NULL; + int *localInt = NULL; + } lcs_broadcast_assistance_types_data_1_local_var = OpenAPI_lcs_broadcast_assistance_types_data_1_create ( location_assistance_typeList @@ -79,6 +90,13 @@ OpenAPI_lcs_broadcast_assistance_types_data_1_t *OpenAPI_lcs_broadcast_assistanc return lcs_broadcast_assistance_types_data_1_local_var; end: + if (location_assistance_typeList) { + OpenAPI_list_for_each(location_assistance_typeList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(location_assistance_typeList); + location_assistance_typeList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lcs_client_external.c b/lib/sbi/openapi/model/lcs_client_external.c index e2ac2b816..d69300d34 100644 --- a/lib/sbi/openapi/model/lcs_client_external.c +++ b/lib/sbi/openapi/model/lcs_client_external.c @@ -22,21 +22,29 @@ OpenAPI_lcs_client_external_t *OpenAPI_lcs_client_external_create( void OpenAPI_lcs_client_external_free(OpenAPI_lcs_client_external_t *lcs_client_external) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lcs_client_external) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(lcs_client_external->allowed_geographic_area, node) { - OpenAPI_geographic_area_free(node->data); + if (lcs_client_external->allowed_geographic_area) { + OpenAPI_list_for_each(lcs_client_external->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(lcs_client_external->allowed_geographic_area); + lcs_client_external->allowed_geographic_area = NULL; + } + if (lcs_client_external->valid_time_period) { + OpenAPI_valid_time_period_free(lcs_client_external->valid_time_period); + lcs_client_external->valid_time_period = NULL; } - OpenAPI_list_free(lcs_client_external->allowed_geographic_area); - OpenAPI_valid_time_period_free(lcs_client_external->valid_time_period); ogs_free(lcs_client_external); } cJSON *OpenAPI_lcs_client_external_convertToJSON(OpenAPI_lcs_client_external_t *lcs_client_external) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lcs_client_external == NULL) { ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [LcsClientExternal]"); @@ -50,21 +58,17 @@ cJSON *OpenAPI_lcs_client_external_convertToJSON(OpenAPI_lcs_client_external_t * ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [allowed_geographic_area]"); goto end; } - - OpenAPI_lnode_t *allowed_geographic_area_node; - if (lcs_client_external->allowed_geographic_area) { - OpenAPI_list_for_each(lcs_client_external->allowed_geographic_area, allowed_geographic_area_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [allowed_geographic_area]"); - goto end; - } - cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + OpenAPI_list_for_each(lcs_client_external->allowed_geographic_area, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); } } - if (lcs_client_external->privacy_check_related_action) { + if (lcs_client_external->privacy_check_related_action != OpenAPI_privacy_check_related_action_NULL) { if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(lcs_client_external->privacy_check_related_action)) == NULL) { ogs_error("OpenAPI_lcs_client_external_convertToJSON() failed [privacy_check_related_action]"); goto end; @@ -91,38 +95,39 @@ end: OpenAPI_lcs_client_external_t *OpenAPI_lcs_client_external_parseFromJSON(cJSON *lcs_client_externalJSON) { OpenAPI_lcs_client_external_t *lcs_client_external_local_var = NULL; - cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(lcs_client_externalJSON, "allowedGeographicArea"); - - OpenAPI_list_t *allowed_geographic_areaList; + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_geographic_area = NULL; + OpenAPI_list_t *allowed_geographic_areaList = NULL; + cJSON *privacy_check_related_action = NULL; + OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(lcs_client_externalJSON, "allowedGeographicArea"); if (allowed_geographic_area) { - cJSON *allowed_geographic_area_local_nonprimitive; - if (!cJSON_IsArray(allowed_geographic_area)){ - ogs_error("OpenAPI_lcs_client_external_parseFromJSON() failed [allowed_geographic_area]"); - goto end; - } - - allowed_geographic_areaList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) { - if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) { + cJSON *allowed_geographic_area_local = NULL; + if (!cJSON_IsArray(allowed_geographic_area)) { ogs_error("OpenAPI_lcs_client_external_parseFromJSON() failed [allowed_geographic_area]"); goto end; } - OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive); - if (!allowed_geographic_areaItem) { - ogs_error("No allowed_geographic_areaItem"); - OpenAPI_list_free(allowed_geographic_areaList); - goto end; + allowed_geographic_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_geographic_area_local, allowed_geographic_area) { + if (!cJSON_IsObject(allowed_geographic_area_local)) { + ogs_error("OpenAPI_lcs_client_external_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local); + if (!allowed_geographic_areaItem) { + ogs_error("No allowed_geographic_areaItem"); + OpenAPI_list_free(allowed_geographic_areaList); + goto end; + } + OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); } - - OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); - } } - cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(lcs_client_externalJSON, "privacyCheckRelatedAction"); - - OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable; + privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(lcs_client_externalJSON, "privacyCheckRelatedAction"); if (privacy_check_related_action) { if (!cJSON_IsString(privacy_check_related_action)) { ogs_error("OpenAPI_lcs_client_external_parseFromJSON() failed [privacy_check_related_action]"); @@ -131,9 +136,7 @@ OpenAPI_lcs_client_external_t *OpenAPI_lcs_client_external_parseFromJSON(cJSON * privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); } - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(lcs_client_externalJSON, "validTimePeriod"); - - OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(lcs_client_externalJSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period); } @@ -146,6 +149,17 @@ OpenAPI_lcs_client_external_t *OpenAPI_lcs_client_external_parseFromJSON(cJSON * return lcs_client_external_local_var; end: + if (allowed_geographic_areaList) { + OpenAPI_list_for_each(allowed_geographic_areaList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(allowed_geographic_areaList); + allowed_geographic_areaList = NULL; + } + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lcs_client_group_external.c b/lib/sbi/openapi/model/lcs_client_group_external.c index 2d0f473da..3b64daf5b 100644 --- a/lib/sbi/openapi/model/lcs_client_group_external.c +++ b/lib/sbi/openapi/model/lcs_client_group_external.c @@ -24,22 +24,33 @@ OpenAPI_lcs_client_group_external_t *OpenAPI_lcs_client_group_external_create( void OpenAPI_lcs_client_group_external_free(OpenAPI_lcs_client_group_external_t *lcs_client_group_external) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lcs_client_group_external) { return; } - OpenAPI_lnode_t *node; - ogs_free(lcs_client_group_external->lcs_client_group_id); - OpenAPI_list_for_each(lcs_client_group_external->allowed_geographic_area, node) { - OpenAPI_geographic_area_free(node->data); + if (lcs_client_group_external->lcs_client_group_id) { + ogs_free(lcs_client_group_external->lcs_client_group_id); + lcs_client_group_external->lcs_client_group_id = NULL; + } + if (lcs_client_group_external->allowed_geographic_area) { + OpenAPI_list_for_each(lcs_client_group_external->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(lcs_client_group_external->allowed_geographic_area); + lcs_client_group_external->allowed_geographic_area = NULL; + } + if (lcs_client_group_external->valid_time_period) { + OpenAPI_valid_time_period_free(lcs_client_group_external->valid_time_period); + lcs_client_group_external->valid_time_period = NULL; } - OpenAPI_list_free(lcs_client_group_external->allowed_geographic_area); - OpenAPI_valid_time_period_free(lcs_client_group_external->valid_time_period); ogs_free(lcs_client_group_external); } cJSON *OpenAPI_lcs_client_group_external_convertToJSON(OpenAPI_lcs_client_group_external_t *lcs_client_group_external) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lcs_client_group_external == NULL) { ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [LcsClientGroupExternal]"); @@ -60,21 +71,17 @@ cJSON *OpenAPI_lcs_client_group_external_convertToJSON(OpenAPI_lcs_client_group_ ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [allowed_geographic_area]"); goto end; } - - OpenAPI_lnode_t *allowed_geographic_area_node; - if (lcs_client_group_external->allowed_geographic_area) { - OpenAPI_list_for_each(lcs_client_group_external->allowed_geographic_area, allowed_geographic_area_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [allowed_geographic_area]"); - goto end; - } - cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + OpenAPI_list_for_each(lcs_client_group_external->allowed_geographic_area, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [allowed_geographic_area]"); + goto end; } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); } } - if (lcs_client_group_external->privacy_check_related_action) { + if (lcs_client_group_external->privacy_check_related_action != OpenAPI_privacy_check_related_action_NULL) { if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(lcs_client_group_external->privacy_check_related_action)) == NULL) { ogs_error("OpenAPI_lcs_client_group_external_convertToJSON() failed [privacy_check_related_action]"); goto end; @@ -101,47 +108,48 @@ end: OpenAPI_lcs_client_group_external_t *OpenAPI_lcs_client_group_external_parseFromJSON(cJSON *lcs_client_group_externalJSON) { OpenAPI_lcs_client_group_external_t *lcs_client_group_external_local_var = NULL; - cJSON *lcs_client_group_id = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "lcsClientGroupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *lcs_client_group_id = NULL; + cJSON *allowed_geographic_area = NULL; + OpenAPI_list_t *allowed_geographic_areaList = NULL; + cJSON *privacy_check_related_action = NULL; + OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + lcs_client_group_id = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "lcsClientGroupId"); if (lcs_client_group_id) { - if (!cJSON_IsString(lcs_client_group_id)) { + if (!cJSON_IsString(lcs_client_group_id) && !cJSON_IsNull(lcs_client_group_id)) { ogs_error("OpenAPI_lcs_client_group_external_parseFromJSON() failed [lcs_client_group_id]"); goto end; } } - cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "allowedGeographicArea"); - - OpenAPI_list_t *allowed_geographic_areaList; + allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "allowedGeographicArea"); if (allowed_geographic_area) { - cJSON *allowed_geographic_area_local_nonprimitive; - if (!cJSON_IsArray(allowed_geographic_area)){ - ogs_error("OpenAPI_lcs_client_group_external_parseFromJSON() failed [allowed_geographic_area]"); - goto end; - } - - allowed_geographic_areaList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) { - if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) { + cJSON *allowed_geographic_area_local = NULL; + if (!cJSON_IsArray(allowed_geographic_area)) { ogs_error("OpenAPI_lcs_client_group_external_parseFromJSON() failed [allowed_geographic_area]"); goto end; } - OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive); - if (!allowed_geographic_areaItem) { - ogs_error("No allowed_geographic_areaItem"); - OpenAPI_list_free(allowed_geographic_areaList); - goto end; + allowed_geographic_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_geographic_area_local, allowed_geographic_area) { + if (!cJSON_IsObject(allowed_geographic_area_local)) { + ogs_error("OpenAPI_lcs_client_group_external_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local); + if (!allowed_geographic_areaItem) { + ogs_error("No allowed_geographic_areaItem"); + OpenAPI_list_free(allowed_geographic_areaList); + goto end; + } + OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); } - - OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); - } } - cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "privacyCheckRelatedAction"); - - OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable; + privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "privacyCheckRelatedAction"); if (privacy_check_related_action) { if (!cJSON_IsString(privacy_check_related_action)) { ogs_error("OpenAPI_lcs_client_group_external_parseFromJSON() failed [privacy_check_related_action]"); @@ -150,15 +158,13 @@ OpenAPI_lcs_client_group_external_t *OpenAPI_lcs_client_group_external_parseFrom privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); } - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "validTimePeriod"); - - OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(lcs_client_group_externalJSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period); } lcs_client_group_external_local_var = OpenAPI_lcs_client_group_external_create ( - lcs_client_group_id ? ogs_strdup(lcs_client_group_id->valuestring) : NULL, + lcs_client_group_id && !cJSON_IsNull(lcs_client_group_id) ? ogs_strdup(lcs_client_group_id->valuestring) : NULL, allowed_geographic_area ? allowed_geographic_areaList : NULL, privacy_check_related_action ? privacy_check_related_actionVariable : 0, valid_time_period ? valid_time_period_local_nonprim : NULL @@ -166,6 +172,17 @@ OpenAPI_lcs_client_group_external_t *OpenAPI_lcs_client_group_external_parseFrom return lcs_client_group_external_local_var; end: + if (allowed_geographic_areaList) { + OpenAPI_list_for_each(allowed_geographic_areaList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(allowed_geographic_areaList); + allowed_geographic_areaList = NULL; + } + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lcs_mo_data.c b/lib/sbi/openapi/model/lcs_mo_data.c index 0548643b4..6fd5e2fc5 100644 --- a/lib/sbi/openapi/model/lcs_mo_data.c +++ b/lib/sbi/openapi/model/lcs_mo_data.c @@ -18,17 +18,22 @@ OpenAPI_lcs_mo_data_t *OpenAPI_lcs_mo_data_create( void OpenAPI_lcs_mo_data_free(OpenAPI_lcs_mo_data_t *lcs_mo_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lcs_mo_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(lcs_mo_data->allowed_service_classes); + if (lcs_mo_data->allowed_service_classes) { + OpenAPI_list_free(lcs_mo_data->allowed_service_classes); + lcs_mo_data->allowed_service_classes = NULL; + } ogs_free(lcs_mo_data); } cJSON *OpenAPI_lcs_mo_data_convertToJSON(OpenAPI_lcs_mo_data_t *lcs_mo_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lcs_mo_data == NULL) { ogs_error("OpenAPI_lcs_mo_data_convertToJSON() failed [LcsMoData]"); @@ -36,14 +41,17 @@ cJSON *OpenAPI_lcs_mo_data_convertToJSON(OpenAPI_lcs_mo_data_t *lcs_mo_data) } item = cJSON_CreateObject(); - cJSON *allowed_service_classes = cJSON_AddArrayToObject(item, "allowedServiceClasses"); - if (allowed_service_classes == NULL) { + if (lcs_mo_data->allowed_service_classes == OpenAPI_lcs_mo_service_class_NULL) { + ogs_error("OpenAPI_lcs_mo_data_convertToJSON() failed [allowed_service_classes]"); + return NULL; + } + cJSON *allowed_service_classesList = cJSON_AddArrayToObject(item, "allowedServiceClasses"); + if (allowed_service_classesList == NULL) { ogs_error("OpenAPI_lcs_mo_data_convertToJSON() failed [allowed_service_classes]"); goto end; } - OpenAPI_lnode_t *allowed_service_classes_node; - OpenAPI_list_for_each(lcs_mo_data->allowed_service_classes, allowed_service_classes_node) { - if (cJSON_AddStringToObject(allowed_service_classes, "", OpenAPI_lcs_mo_service_class_ToString((intptr_t)allowed_service_classes_node->data)) == NULL) { + OpenAPI_list_for_each(lcs_mo_data->allowed_service_classes, node) { + if (cJSON_AddStringToObject(allowed_service_classesList, "", OpenAPI_lcs_mo_service_class_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_lcs_mo_data_convertToJSON() failed [allowed_service_classes]"); goto end; } @@ -56,29 +64,29 @@ end: OpenAPI_lcs_mo_data_t *OpenAPI_lcs_mo_data_parseFromJSON(cJSON *lcs_mo_dataJSON) { OpenAPI_lcs_mo_data_t *lcs_mo_data_local_var = NULL; - cJSON *allowed_service_classes = cJSON_GetObjectItemCaseSensitive(lcs_mo_dataJSON, "allowedServiceClasses"); + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_service_classes = NULL; + OpenAPI_list_t *allowed_service_classesList = NULL; + allowed_service_classes = cJSON_GetObjectItemCaseSensitive(lcs_mo_dataJSON, "allowedServiceClasses"); if (!allowed_service_classes) { ogs_error("OpenAPI_lcs_mo_data_parseFromJSON() failed [allowed_service_classes]"); goto end; } - - OpenAPI_list_t *allowed_service_classesList; - cJSON *allowed_service_classes_local_nonprimitive; - if (!cJSON_IsArray(allowed_service_classes)) { - ogs_error("OpenAPI_lcs_mo_data_parseFromJSON() failed [allowed_service_classes]"); - goto end; - } - - allowed_service_classesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_service_classes_local_nonprimitive, allowed_service_classes ) { - if (!cJSON_IsString(allowed_service_classes_local_nonprimitive)){ + cJSON *allowed_service_classes_local = NULL; + if (!cJSON_IsArray(allowed_service_classes)) { ogs_error("OpenAPI_lcs_mo_data_parseFromJSON() failed [allowed_service_classes]"); goto end; } - OpenAPI_list_add(allowed_service_classesList, (void *)OpenAPI_lcs_mo_service_class_FromString(allowed_service_classes_local_nonprimitive->valuestring)); - } + allowed_service_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_service_classes_local, allowed_service_classes) { + if (!cJSON_IsString(allowed_service_classes_local)) { + ogs_error("OpenAPI_lcs_mo_data_parseFromJSON() failed [allowed_service_classes]"); + goto end; + } + OpenAPI_list_add(allowed_service_classesList, (void *)OpenAPI_lcs_mo_service_class_FromString(allowed_service_classes_local->valuestring)); + } lcs_mo_data_local_var = OpenAPI_lcs_mo_data_create ( allowed_service_classesList @@ -86,6 +94,10 @@ OpenAPI_lcs_mo_data_t *OpenAPI_lcs_mo_data_parseFromJSON(cJSON *lcs_mo_dataJSON) return lcs_mo_data_local_var; end: + if (allowed_service_classesList) { + OpenAPI_list_free(allowed_service_classesList); + allowed_service_classesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lcs_privacy.c b/lib/sbi/openapi/model/lcs_privacy.c index bcc5d96ae..beac5c4c6 100644 --- a/lib/sbi/openapi/model/lcs_privacy.c +++ b/lib/sbi/openapi/model/lcs_privacy.c @@ -26,19 +26,30 @@ OpenAPI_lcs_privacy_t *OpenAPI_lcs_privacy_create( void OpenAPI_lcs_privacy_free(OpenAPI_lcs_privacy_t *lcs_privacy) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lcs_privacy) { return; } - OpenAPI_lnode_t *node; - ogs_free(lcs_privacy->af_instance_id); - OpenAPI_lpi_free(lcs_privacy->lpi); - ogs_free(lcs_privacy->mtc_provider_information); + if (lcs_privacy->af_instance_id) { + ogs_free(lcs_privacy->af_instance_id); + lcs_privacy->af_instance_id = NULL; + } + if (lcs_privacy->lpi) { + OpenAPI_lpi_free(lcs_privacy->lpi); + lcs_privacy->lpi = NULL; + } + if (lcs_privacy->mtc_provider_information) { + ogs_free(lcs_privacy->mtc_provider_information); + lcs_privacy->mtc_provider_information = NULL; + } ogs_free(lcs_privacy); } cJSON *OpenAPI_lcs_privacy_convertToJSON(OpenAPI_lcs_privacy_t *lcs_privacy) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lcs_privacy == NULL) { ogs_error("OpenAPI_lcs_privacy_convertToJSON() failed [LcsPrivacy]"); @@ -87,17 +98,21 @@ end: OpenAPI_lcs_privacy_t *OpenAPI_lcs_privacy_parseFromJSON(cJSON *lcs_privacyJSON) { OpenAPI_lcs_privacy_t *lcs_privacy_local_var = NULL; - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "afInstanceId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *af_instance_id = NULL; + cJSON *reference_id = NULL; + cJSON *lpi = NULL; + OpenAPI_lpi_t *lpi_local_nonprim = NULL; + cJSON *mtc_provider_information = NULL; + af_instance_id = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "afInstanceId"); if (af_instance_id) { - if (!cJSON_IsString(af_instance_id)) { + if (!cJSON_IsString(af_instance_id) && !cJSON_IsNull(af_instance_id)) { ogs_error("OpenAPI_lcs_privacy_parseFromJSON() failed [af_instance_id]"); goto end; } } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "referenceId"); - + reference_id = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "referenceId"); if (reference_id) { if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_lcs_privacy_parseFromJSON() failed [reference_id]"); @@ -105,32 +120,33 @@ OpenAPI_lcs_privacy_t *OpenAPI_lcs_privacy_parseFromJSON(cJSON *lcs_privacyJSON) } } - cJSON *lpi = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "lpi"); - - OpenAPI_lpi_t *lpi_local_nonprim = NULL; + lpi = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "lpi"); if (lpi) { lpi_local_nonprim = OpenAPI_lpi_parseFromJSON(lpi); } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(lcs_privacyJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_lcs_privacy_parseFromJSON() failed [mtc_provider_information]"); goto end; } } lcs_privacy_local_var = OpenAPI_lcs_privacy_create ( - af_instance_id ? ogs_strdup(af_instance_id->valuestring) : NULL, + af_instance_id && !cJSON_IsNull(af_instance_id) ? ogs_strdup(af_instance_id->valuestring) : NULL, reference_id ? true : false, reference_id ? reference_id->valuedouble : 0, lpi ? lpi_local_nonprim : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return lcs_privacy_local_var; end: + if (lpi_local_nonprim) { + OpenAPI_lpi_free(lpi_local_nonprim); + lpi_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lcs_privacy_data.c b/lib/sbi/openapi/model/lcs_privacy_data.c index 7cce1f2fc..474710c47 100644 --- a/lib/sbi/openapi/model/lcs_privacy_data.c +++ b/lib/sbi/openapi/model/lcs_privacy_data.c @@ -22,22 +22,33 @@ OpenAPI_lcs_privacy_data_t *OpenAPI_lcs_privacy_data_create( void OpenAPI_lcs_privacy_data_free(OpenAPI_lcs_privacy_data_t *lcs_privacy_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lcs_privacy_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_lpi_free(lcs_privacy_data->lpi); - OpenAPI_unrelated_class_free(lcs_privacy_data->unrelated_class); - OpenAPI_list_for_each(lcs_privacy_data->plmn_operator_classes, node) { - OpenAPI_plmn_operator_class_free(node->data); + if (lcs_privacy_data->lpi) { + OpenAPI_lpi_free(lcs_privacy_data->lpi); + lcs_privacy_data->lpi = NULL; + } + if (lcs_privacy_data->unrelated_class) { + OpenAPI_unrelated_class_free(lcs_privacy_data->unrelated_class); + lcs_privacy_data->unrelated_class = NULL; + } + if (lcs_privacy_data->plmn_operator_classes) { + OpenAPI_list_for_each(lcs_privacy_data->plmn_operator_classes, node) { + OpenAPI_plmn_operator_class_free(node->data); + } + OpenAPI_list_free(lcs_privacy_data->plmn_operator_classes); + lcs_privacy_data->plmn_operator_classes = NULL; } - OpenAPI_list_free(lcs_privacy_data->plmn_operator_classes); ogs_free(lcs_privacy_data); } cJSON *OpenAPI_lcs_privacy_data_convertToJSON(OpenAPI_lcs_privacy_data_t *lcs_privacy_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lcs_privacy_data == NULL) { ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [LcsPrivacyData]"); @@ -77,17 +88,13 @@ cJSON *OpenAPI_lcs_privacy_data_convertToJSON(OpenAPI_lcs_privacy_data_t *lcs_pr ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [plmn_operator_classes]"); goto end; } - - OpenAPI_lnode_t *plmn_operator_classes_node; - if (lcs_privacy_data->plmn_operator_classes) { - OpenAPI_list_for_each(lcs_privacy_data->plmn_operator_classes, plmn_operator_classes_node) { - cJSON *itemLocal = OpenAPI_plmn_operator_class_convertToJSON(plmn_operator_classes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [plmn_operator_classes]"); - goto end; - } - cJSON_AddItemToArray(plmn_operator_classesList, itemLocal); + OpenAPI_list_for_each(lcs_privacy_data->plmn_operator_classes, node) { + cJSON *itemLocal = OpenAPI_plmn_operator_class_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_convertToJSON() failed [plmn_operator_classes]"); + goto end; } + cJSON_AddItemToArray(plmn_operator_classesList, itemLocal); } } @@ -98,47 +105,46 @@ end: OpenAPI_lcs_privacy_data_t *OpenAPI_lcs_privacy_data_parseFromJSON(cJSON *lcs_privacy_dataJSON) { OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_var = NULL; - cJSON *lpi = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "lpi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *lpi = NULL; OpenAPI_lpi_t *lpi_local_nonprim = NULL; + cJSON *unrelated_class = NULL; + OpenAPI_unrelated_class_t *unrelated_class_local_nonprim = NULL; + cJSON *plmn_operator_classes = NULL; + OpenAPI_list_t *plmn_operator_classesList = NULL; + lpi = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "lpi"); if (lpi) { lpi_local_nonprim = OpenAPI_lpi_parseFromJSON(lpi); } - cJSON *unrelated_class = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "unrelatedClass"); - - OpenAPI_unrelated_class_t *unrelated_class_local_nonprim = NULL; + unrelated_class = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "unrelatedClass"); if (unrelated_class) { unrelated_class_local_nonprim = OpenAPI_unrelated_class_parseFromJSON(unrelated_class); } - cJSON *plmn_operator_classes = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "plmnOperatorClasses"); - - OpenAPI_list_t *plmn_operator_classesList; + plmn_operator_classes = cJSON_GetObjectItemCaseSensitive(lcs_privacy_dataJSON, "plmnOperatorClasses"); if (plmn_operator_classes) { - cJSON *plmn_operator_classes_local_nonprimitive; - if (!cJSON_IsArray(plmn_operator_classes)){ - ogs_error("OpenAPI_lcs_privacy_data_parseFromJSON() failed [plmn_operator_classes]"); - goto end; - } - - plmn_operator_classesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(plmn_operator_classes_local_nonprimitive, plmn_operator_classes ) { - if (!cJSON_IsObject(plmn_operator_classes_local_nonprimitive)) { + cJSON *plmn_operator_classes_local = NULL; + if (!cJSON_IsArray(plmn_operator_classes)) { ogs_error("OpenAPI_lcs_privacy_data_parseFromJSON() failed [plmn_operator_classes]"); goto end; } - OpenAPI_plmn_operator_class_t *plmn_operator_classesItem = OpenAPI_plmn_operator_class_parseFromJSON(plmn_operator_classes_local_nonprimitive); - if (!plmn_operator_classesItem) { - ogs_error("No plmn_operator_classesItem"); - OpenAPI_list_free(plmn_operator_classesList); - goto end; + plmn_operator_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_operator_classes_local, plmn_operator_classes) { + if (!cJSON_IsObject(plmn_operator_classes_local)) { + ogs_error("OpenAPI_lcs_privacy_data_parseFromJSON() failed [plmn_operator_classes]"); + goto end; + } + OpenAPI_plmn_operator_class_t *plmn_operator_classesItem = OpenAPI_plmn_operator_class_parseFromJSON(plmn_operator_classes_local); + if (!plmn_operator_classesItem) { + ogs_error("No plmn_operator_classesItem"); + OpenAPI_list_free(plmn_operator_classesList); + goto end; + } + OpenAPI_list_add(plmn_operator_classesList, plmn_operator_classesItem); } - - OpenAPI_list_add(plmn_operator_classesList, plmn_operator_classesItem); - } } lcs_privacy_data_local_var = OpenAPI_lcs_privacy_data_create ( @@ -149,6 +155,21 @@ OpenAPI_lcs_privacy_data_t *OpenAPI_lcs_privacy_data_parseFromJSON(cJSON *lcs_pr return lcs_privacy_data_local_var; end: + if (lpi_local_nonprim) { + OpenAPI_lpi_free(lpi_local_nonprim); + lpi_local_nonprim = NULL; + } + if (unrelated_class_local_nonprim) { + OpenAPI_unrelated_class_free(unrelated_class_local_nonprim); + unrelated_class_local_nonprim = NULL; + } + if (plmn_operator_classesList) { + OpenAPI_list_for_each(plmn_operator_classesList, node) { + OpenAPI_plmn_operator_class_free(node->data); + } + OpenAPI_list_free(plmn_operator_classesList); + plmn_operator_classesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lcs_privacy_data_1.c b/lib/sbi/openapi/model/lcs_privacy_data_1.c index 0266b360b..b4b8e5fef 100644 --- a/lib/sbi/openapi/model/lcs_privacy_data_1.c +++ b/lib/sbi/openapi/model/lcs_privacy_data_1.c @@ -22,22 +22,33 @@ OpenAPI_lcs_privacy_data_1_t *OpenAPI_lcs_privacy_data_1_create( void OpenAPI_lcs_privacy_data_1_free(OpenAPI_lcs_privacy_data_1_t *lcs_privacy_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lcs_privacy_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_lpi_1_free(lcs_privacy_data_1->lpi); - OpenAPI_unrelated_class_1_free(lcs_privacy_data_1->unrelated_class); - OpenAPI_list_for_each(lcs_privacy_data_1->plmn_operator_classes, node) { - OpenAPI_plmn_operator_class_1_free(node->data); + if (lcs_privacy_data_1->lpi) { + OpenAPI_lpi_1_free(lcs_privacy_data_1->lpi); + lcs_privacy_data_1->lpi = NULL; + } + if (lcs_privacy_data_1->unrelated_class) { + OpenAPI_unrelated_class_1_free(lcs_privacy_data_1->unrelated_class); + lcs_privacy_data_1->unrelated_class = NULL; + } + if (lcs_privacy_data_1->plmn_operator_classes) { + OpenAPI_list_for_each(lcs_privacy_data_1->plmn_operator_classes, node) { + OpenAPI_plmn_operator_class_1_free(node->data); + } + OpenAPI_list_free(lcs_privacy_data_1->plmn_operator_classes); + lcs_privacy_data_1->plmn_operator_classes = NULL; } - OpenAPI_list_free(lcs_privacy_data_1->plmn_operator_classes); ogs_free(lcs_privacy_data_1); } cJSON *OpenAPI_lcs_privacy_data_1_convertToJSON(OpenAPI_lcs_privacy_data_1_t *lcs_privacy_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lcs_privacy_data_1 == NULL) { ogs_error("OpenAPI_lcs_privacy_data_1_convertToJSON() failed [LcsPrivacyData_1]"); @@ -77,17 +88,13 @@ cJSON *OpenAPI_lcs_privacy_data_1_convertToJSON(OpenAPI_lcs_privacy_data_1_t *lc ogs_error("OpenAPI_lcs_privacy_data_1_convertToJSON() failed [plmn_operator_classes]"); goto end; } - - OpenAPI_lnode_t *plmn_operator_classes_node; - if (lcs_privacy_data_1->plmn_operator_classes) { - OpenAPI_list_for_each(lcs_privacy_data_1->plmn_operator_classes, plmn_operator_classes_node) { - cJSON *itemLocal = OpenAPI_plmn_operator_class_1_convertToJSON(plmn_operator_classes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_lcs_privacy_data_1_convertToJSON() failed [plmn_operator_classes]"); - goto end; - } - cJSON_AddItemToArray(plmn_operator_classesList, itemLocal); + OpenAPI_list_for_each(lcs_privacy_data_1->plmn_operator_classes, node) { + cJSON *itemLocal = OpenAPI_plmn_operator_class_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lcs_privacy_data_1_convertToJSON() failed [plmn_operator_classes]"); + goto end; } + cJSON_AddItemToArray(plmn_operator_classesList, itemLocal); } } @@ -98,47 +105,46 @@ end: OpenAPI_lcs_privacy_data_1_t *OpenAPI_lcs_privacy_data_1_parseFromJSON(cJSON *lcs_privacy_data_1JSON) { OpenAPI_lcs_privacy_data_1_t *lcs_privacy_data_1_local_var = NULL; - cJSON *lpi = cJSON_GetObjectItemCaseSensitive(lcs_privacy_data_1JSON, "lpi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *lpi = NULL; OpenAPI_lpi_1_t *lpi_local_nonprim = NULL; + cJSON *unrelated_class = NULL; + OpenAPI_unrelated_class_1_t *unrelated_class_local_nonprim = NULL; + cJSON *plmn_operator_classes = NULL; + OpenAPI_list_t *plmn_operator_classesList = NULL; + lpi = cJSON_GetObjectItemCaseSensitive(lcs_privacy_data_1JSON, "lpi"); if (lpi) { lpi_local_nonprim = OpenAPI_lpi_1_parseFromJSON(lpi); } - cJSON *unrelated_class = cJSON_GetObjectItemCaseSensitive(lcs_privacy_data_1JSON, "unrelatedClass"); - - OpenAPI_unrelated_class_1_t *unrelated_class_local_nonprim = NULL; + unrelated_class = cJSON_GetObjectItemCaseSensitive(lcs_privacy_data_1JSON, "unrelatedClass"); if (unrelated_class) { unrelated_class_local_nonprim = OpenAPI_unrelated_class_1_parseFromJSON(unrelated_class); } - cJSON *plmn_operator_classes = cJSON_GetObjectItemCaseSensitive(lcs_privacy_data_1JSON, "plmnOperatorClasses"); - - OpenAPI_list_t *plmn_operator_classesList; + plmn_operator_classes = cJSON_GetObjectItemCaseSensitive(lcs_privacy_data_1JSON, "plmnOperatorClasses"); if (plmn_operator_classes) { - cJSON *plmn_operator_classes_local_nonprimitive; - if (!cJSON_IsArray(plmn_operator_classes)){ - ogs_error("OpenAPI_lcs_privacy_data_1_parseFromJSON() failed [plmn_operator_classes]"); - goto end; - } - - plmn_operator_classesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(plmn_operator_classes_local_nonprimitive, plmn_operator_classes ) { - if (!cJSON_IsObject(plmn_operator_classes_local_nonprimitive)) { + cJSON *plmn_operator_classes_local = NULL; + if (!cJSON_IsArray(plmn_operator_classes)) { ogs_error("OpenAPI_lcs_privacy_data_1_parseFromJSON() failed [plmn_operator_classes]"); goto end; } - OpenAPI_plmn_operator_class_1_t *plmn_operator_classesItem = OpenAPI_plmn_operator_class_1_parseFromJSON(plmn_operator_classes_local_nonprimitive); - if (!plmn_operator_classesItem) { - ogs_error("No plmn_operator_classesItem"); - OpenAPI_list_free(plmn_operator_classesList); - goto end; + plmn_operator_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_operator_classes_local, plmn_operator_classes) { + if (!cJSON_IsObject(plmn_operator_classes_local)) { + ogs_error("OpenAPI_lcs_privacy_data_1_parseFromJSON() failed [plmn_operator_classes]"); + goto end; + } + OpenAPI_plmn_operator_class_1_t *plmn_operator_classesItem = OpenAPI_plmn_operator_class_1_parseFromJSON(plmn_operator_classes_local); + if (!plmn_operator_classesItem) { + ogs_error("No plmn_operator_classesItem"); + OpenAPI_list_free(plmn_operator_classesList); + goto end; + } + OpenAPI_list_add(plmn_operator_classesList, plmn_operator_classesItem); } - - OpenAPI_list_add(plmn_operator_classesList, plmn_operator_classesItem); - } } lcs_privacy_data_1_local_var = OpenAPI_lcs_privacy_data_1_create ( @@ -149,6 +155,21 @@ OpenAPI_lcs_privacy_data_1_t *OpenAPI_lcs_privacy_data_1_parseFromJSON(cJSON *lc return lcs_privacy_data_1_local_var; end: + if (lpi_local_nonprim) { + OpenAPI_lpi_1_free(lpi_local_nonprim); + lpi_local_nonprim = NULL; + } + if (unrelated_class_local_nonprim) { + OpenAPI_unrelated_class_1_free(unrelated_class_local_nonprim); + unrelated_class_local_nonprim = NULL; + } + if (plmn_operator_classesList) { + OpenAPI_list_for_each(plmn_operator_classesList, node) { + OpenAPI_plmn_operator_class_1_free(node->data); + } + OpenAPI_list_free(plmn_operator_classesList); + plmn_operator_classesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/limit_id_to_monitoring_key.c b/lib/sbi/openapi/model/limit_id_to_monitoring_key.c index 43c13e14c..1db494909 100644 --- a/lib/sbi/openapi/model/limit_id_to_monitoring_key.c +++ b/lib/sbi/openapi/model/limit_id_to_monitoring_key.c @@ -20,21 +20,29 @@ OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_create( void OpenAPI_limit_id_to_monitoring_key_free(OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key) { + OpenAPI_lnode_t *node = NULL; + if (NULL == limit_id_to_monitoring_key) { return; } - OpenAPI_lnode_t *node; - ogs_free(limit_id_to_monitoring_key->limit_id); - OpenAPI_list_for_each(limit_id_to_monitoring_key->monkey, node) { - ogs_free(node->data); + if (limit_id_to_monitoring_key->limit_id) { + ogs_free(limit_id_to_monitoring_key->limit_id); + limit_id_to_monitoring_key->limit_id = NULL; + } + if (limit_id_to_monitoring_key->monkey) { + OpenAPI_list_for_each(limit_id_to_monitoring_key->monkey, node) { + ogs_free(node->data); + } + OpenAPI_list_free(limit_id_to_monitoring_key->monkey); + limit_id_to_monitoring_key->monkey = NULL; } - OpenAPI_list_free(limit_id_to_monitoring_key->monkey); ogs_free(limit_id_to_monitoring_key); } cJSON *OpenAPI_limit_id_to_monitoring_key_convertToJSON(OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (limit_id_to_monitoring_key == NULL) { ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [LimitIdToMonitoringKey]"); @@ -42,25 +50,27 @@ cJSON *OpenAPI_limit_id_to_monitoring_key_convertToJSON(OpenAPI_limit_id_to_moni } item = cJSON_CreateObject(); + if (!limit_id_to_monitoring_key->limit_id) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [limit_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "limitId", limit_id_to_monitoring_key->limit_id) == NULL) { ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [limit_id]"); goto end; } if (limit_id_to_monitoring_key->monkey) { - cJSON *monkey = cJSON_AddArrayToObject(item, "monkey"); - if (monkey == NULL) { + cJSON *monkeyList = cJSON_AddArrayToObject(item, "monkey"); + if (monkeyList == NULL) { ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [monkey]"); goto end; } - - OpenAPI_lnode_t *monkey_node; - OpenAPI_list_for_each(limit_id_to_monitoring_key->monkey, monkey_node) { - if (cJSON_AddStringToObject(monkey, "", (char*)monkey_node->data) == NULL) { - ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [monkey]"); - goto end; + OpenAPI_list_for_each(limit_id_to_monitoring_key->monkey, node) { + if (cJSON_AddStringToObject(monkeyList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_convertToJSON() failed [monkey]"); + goto end; + } } - } } end: @@ -70,35 +80,39 @@ end: OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_parseFromJSON(cJSON *limit_id_to_monitoring_keyJSON) { OpenAPI_limit_id_to_monitoring_key_t *limit_id_to_monitoring_key_local_var = NULL; - cJSON *limit_id = cJSON_GetObjectItemCaseSensitive(limit_id_to_monitoring_keyJSON, "limitId"); + OpenAPI_lnode_t *node = NULL; + cJSON *limit_id = NULL; + cJSON *monkey = NULL; + OpenAPI_list_t *monkeyList = NULL; + limit_id = cJSON_GetObjectItemCaseSensitive(limit_id_to_monitoring_keyJSON, "limitId"); if (!limit_id) { ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [limit_id]"); goto end; } - if (!cJSON_IsString(limit_id)) { ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [limit_id]"); goto end; } - cJSON *monkey = cJSON_GetObjectItemCaseSensitive(limit_id_to_monitoring_keyJSON, "monkey"); - - OpenAPI_list_t *monkeyList; + monkey = cJSON_GetObjectItemCaseSensitive(limit_id_to_monitoring_keyJSON, "monkey"); if (monkey) { - cJSON *monkey_local; - if (!cJSON_IsArray(monkey)) { - ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [monkey]"); - goto end; - } - monkeyList = OpenAPI_list_create(); + cJSON *monkey_local = NULL; + if (!cJSON_IsArray(monkey)) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [monkey]"); + goto end; + } - cJSON_ArrayForEach(monkey_local, monkey) { - if (!cJSON_IsString(monkey_local)) { - ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [monkey]"); - goto end; - } - OpenAPI_list_add(monkeyList, ogs_strdup(monkey_local->valuestring)); - } + monkeyList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monkey_local, monkey) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monkey_local)) { + ogs_error("OpenAPI_limit_id_to_monitoring_key_parseFromJSON() failed [monkey]"); + goto end; + } + OpenAPI_list_add(monkeyList, ogs_strdup(monkey_local->valuestring)); + } } limit_id_to_monitoring_key_local_var = OpenAPI_limit_id_to_monitoring_key_create ( @@ -108,6 +122,13 @@ OpenAPI_limit_id_to_monitoring_key_t *OpenAPI_limit_id_to_monitoring_key_parseFr return limit_id_to_monitoring_key_local_var; end: + if (monkeyList) { + OpenAPI_list_for_each(monkeyList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monkeyList); + monkeyList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/link.c b/lib/sbi/openapi/model/link.c index d696ae716..adc6ffa84 100644 --- a/lib/sbi/openapi/model/link.c +++ b/lib/sbi/openapi/model/link.c @@ -18,17 +18,22 @@ OpenAPI_link_t *OpenAPI_link_create( void OpenAPI_link_free(OpenAPI_link_t *link) { + OpenAPI_lnode_t *node = NULL; + if (NULL == link) { return; } - OpenAPI_lnode_t *node; - ogs_free(link->href); + if (link->href) { + ogs_free(link->href); + link->href = NULL; + } ogs_free(link); } cJSON *OpenAPI_link_convertToJSON(OpenAPI_link_t *link) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (link == NULL) { ogs_error("OpenAPI_link_convertToJSON() failed [Link]"); @@ -50,17 +55,18 @@ end: OpenAPI_link_t *OpenAPI_link_parseFromJSON(cJSON *linkJSON) { OpenAPI_link_t *link_local_var = NULL; - cJSON *href = cJSON_GetObjectItemCaseSensitive(linkJSON, "href"); - + OpenAPI_lnode_t *node = NULL; + cJSON *href = NULL; + href = cJSON_GetObjectItemCaseSensitive(linkJSON, "href"); if (href) { - if (!cJSON_IsString(href)) { + if (!cJSON_IsString(href) && !cJSON_IsNull(href)) { ogs_error("OpenAPI_link_parseFromJSON() failed [href]"); goto end; } } link_local_var = OpenAPI_link_create ( - href ? ogs_strdup(href->valuestring) : NULL + href && !cJSON_IsNull(href) ? ogs_strdup(href->valuestring) : NULL ); return link_local_var; diff --git a/lib/sbi/openapi/model/links_value_schema.c b/lib/sbi/openapi/model/links_value_schema.c index 2a777be07..8239513f0 100644 --- a/lib/sbi/openapi/model/links_value_schema.c +++ b/lib/sbi/openapi/model/links_value_schema.c @@ -18,17 +18,22 @@ OpenAPI_links_value_schema_t *OpenAPI_links_value_schema_create( void OpenAPI_links_value_schema_free(OpenAPI_links_value_schema_t *links_value_schema) { + OpenAPI_lnode_t *node = NULL; + if (NULL == links_value_schema) { return; } - OpenAPI_lnode_t *node; - ogs_free(links_value_schema->href); + if (links_value_schema->href) { + ogs_free(links_value_schema->href); + links_value_schema->href = NULL; + } ogs_free(links_value_schema); } cJSON *OpenAPI_links_value_schema_convertToJSON(OpenAPI_links_value_schema_t *links_value_schema) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (links_value_schema == NULL) { ogs_error("OpenAPI_links_value_schema_convertToJSON() failed [LinksValueSchema]"); @@ -50,17 +55,18 @@ end: OpenAPI_links_value_schema_t *OpenAPI_links_value_schema_parseFromJSON(cJSON *links_value_schemaJSON) { OpenAPI_links_value_schema_t *links_value_schema_local_var = NULL; - cJSON *href = cJSON_GetObjectItemCaseSensitive(links_value_schemaJSON, "href"); - + OpenAPI_lnode_t *node = NULL; + cJSON *href = NULL; + href = cJSON_GetObjectItemCaseSensitive(links_value_schemaJSON, "href"); if (href) { - if (!cJSON_IsString(href)) { + if (!cJSON_IsString(href) && !cJSON_IsNull(href)) { ogs_error("OpenAPI_links_value_schema_parseFromJSON() failed [href]"); goto end; } } links_value_schema_local_var = OpenAPI_links_value_schema_create ( - href ? ogs_strdup(href->valuestring) : NULL + href && !cJSON_IsNull(href) ? ogs_strdup(href->valuestring) : NULL ); return links_value_schema_local_var; diff --git a/lib/sbi/openapi/model/lmf_info.c b/lib/sbi/openapi/model/lmf_info.c index 3e1aa64c8..275b38a48 100644 --- a/lib/sbi/openapi/model/lmf_info.c +++ b/lib/sbi/openapi/model/lmf_info.c @@ -26,24 +26,41 @@ OpenAPI_lmf_info_t *OpenAPI_lmf_info_create( void OpenAPI_lmf_info_free(OpenAPI_lmf_info_t *lmf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lmf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(lmf_info->serving_client_types, node) { - OpenAPI_external_client_type_free(node->data); + if (lmf_info->serving_client_types) { + OpenAPI_list_for_each(lmf_info->serving_client_types, node) { + OpenAPI_external_client_type_free(node->data); + } + OpenAPI_list_free(lmf_info->serving_client_types); + lmf_info->serving_client_types = NULL; + } + if (lmf_info->lmf_id) { + ogs_free(lmf_info->lmf_id); + lmf_info->lmf_id = NULL; + } + if (lmf_info->serving_access_types) { + OpenAPI_list_free(lmf_info->serving_access_types); + lmf_info->serving_access_types = NULL; + } + if (lmf_info->serving_an_node_types) { + OpenAPI_list_free(lmf_info->serving_an_node_types); + lmf_info->serving_an_node_types = NULL; + } + if (lmf_info->serving_rat_types) { + OpenAPI_list_free(lmf_info->serving_rat_types); + lmf_info->serving_rat_types = NULL; } - OpenAPI_list_free(lmf_info->serving_client_types); - ogs_free(lmf_info->lmf_id); - OpenAPI_list_free(lmf_info->serving_access_types); - OpenAPI_list_free(lmf_info->serving_an_node_types); - OpenAPI_list_free(lmf_info->serving_rat_types); ogs_free(lmf_info); } cJSON *OpenAPI_lmf_info_convertToJSON(OpenAPI_lmf_info_t *lmf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lmf_info == NULL) { ogs_error("OpenAPI_lmf_info_convertToJSON() failed [LmfInfo]"); @@ -57,17 +74,13 @@ cJSON *OpenAPI_lmf_info_convertToJSON(OpenAPI_lmf_info_t *lmf_info) ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_client_types]"); goto end; } - - OpenAPI_lnode_t *serving_client_types_node; - if (lmf_info->serving_client_types) { - OpenAPI_list_for_each(lmf_info->serving_client_types, serving_client_types_node) { - cJSON *itemLocal = OpenAPI_external_client_type_convertToJSON(serving_client_types_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_client_types]"); - goto end; - } - cJSON_AddItemToArray(serving_client_typesList, itemLocal); + OpenAPI_list_for_each(lmf_info->serving_client_types, node) { + cJSON *itemLocal = OpenAPI_external_client_type_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_client_types]"); + goto end; } + cJSON_AddItemToArray(serving_client_typesList, itemLocal); } } @@ -78,45 +91,42 @@ cJSON *OpenAPI_lmf_info_convertToJSON(OpenAPI_lmf_info_t *lmf_info) } } - if (lmf_info->serving_access_types) { - cJSON *serving_access_types = cJSON_AddArrayToObject(item, "servingAccessTypes"); - if (serving_access_types == NULL) { + if (lmf_info->serving_access_types != OpenAPI_access_type_NULL) { + cJSON *serving_access_typesList = cJSON_AddArrayToObject(item, "servingAccessTypes"); + if (serving_access_typesList == NULL) { ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_access_types]"); goto end; } - OpenAPI_lnode_t *serving_access_types_node; - OpenAPI_list_for_each(lmf_info->serving_access_types, serving_access_types_node) { - if (cJSON_AddStringToObject(serving_access_types, "", OpenAPI_access_type_ToString((intptr_t)serving_access_types_node->data)) == NULL) { + OpenAPI_list_for_each(lmf_info->serving_access_types, node) { + if (cJSON_AddStringToObject(serving_access_typesList, "", OpenAPI_access_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_access_types]"); goto end; } } } - if (lmf_info->serving_an_node_types) { - cJSON *serving_an_node_types = cJSON_AddArrayToObject(item, "servingAnNodeTypes"); - if (serving_an_node_types == NULL) { + if (lmf_info->serving_an_node_types != OpenAPI_an_node_type_NULL) { + cJSON *serving_an_node_typesList = cJSON_AddArrayToObject(item, "servingAnNodeTypes"); + if (serving_an_node_typesList == NULL) { ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_an_node_types]"); goto end; } - OpenAPI_lnode_t *serving_an_node_types_node; - OpenAPI_list_for_each(lmf_info->serving_an_node_types, serving_an_node_types_node) { - if (cJSON_AddStringToObject(serving_an_node_types, "", OpenAPI_an_node_type_ToString((intptr_t)serving_an_node_types_node->data)) == NULL) { + OpenAPI_list_for_each(lmf_info->serving_an_node_types, node) { + if (cJSON_AddStringToObject(serving_an_node_typesList, "", OpenAPI_an_node_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_an_node_types]"); goto end; } } } - if (lmf_info->serving_rat_types) { - cJSON *serving_rat_types = cJSON_AddArrayToObject(item, "servingRatTypes"); - if (serving_rat_types == NULL) { + if (lmf_info->serving_rat_types != OpenAPI_rat_type_NULL) { + cJSON *serving_rat_typesList = cJSON_AddArrayToObject(item, "servingRatTypes"); + if (serving_rat_typesList == NULL) { ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_rat_types]"); goto end; } - OpenAPI_lnode_t *serving_rat_types_node; - OpenAPI_list_for_each(lmf_info->serving_rat_types, serving_rat_types_node) { - if (cJSON_AddStringToObject(serving_rat_types, "", OpenAPI_rat_type_ToString((intptr_t)serving_rat_types_node->data)) == NULL) { + OpenAPI_list_for_each(lmf_info->serving_rat_types, node) { + if (cJSON_AddStringToObject(serving_rat_typesList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_rat_types]"); goto end; } @@ -130,113 +140,109 @@ end: OpenAPI_lmf_info_t *OpenAPI_lmf_info_parseFromJSON(cJSON *lmf_infoJSON) { OpenAPI_lmf_info_t *lmf_info_local_var = NULL; - cJSON *serving_client_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingClientTypes"); - - OpenAPI_list_t *serving_client_typesList; + OpenAPI_lnode_t *node = NULL; + cJSON *serving_client_types = NULL; + OpenAPI_list_t *serving_client_typesList = NULL; + cJSON *lmf_id = NULL; + cJSON *serving_access_types = NULL; + OpenAPI_list_t *serving_access_typesList = NULL; + cJSON *serving_an_node_types = NULL; + OpenAPI_list_t *serving_an_node_typesList = NULL; + cJSON *serving_rat_types = NULL; + OpenAPI_list_t *serving_rat_typesList = NULL; + serving_client_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingClientTypes"); if (serving_client_types) { - cJSON *serving_client_types_local_nonprimitive; - if (!cJSON_IsArray(serving_client_types)){ - ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_client_types]"); - goto end; - } - - serving_client_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(serving_client_types_local_nonprimitive, serving_client_types ) { - if (!cJSON_IsObject(serving_client_types_local_nonprimitive)) { + cJSON *serving_client_types_local = NULL; + if (!cJSON_IsArray(serving_client_types)) { ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_client_types]"); goto end; } - OpenAPI_external_client_type_t *serving_client_typesItem = OpenAPI_external_client_type_parseFromJSON(serving_client_types_local_nonprimitive); - if (!serving_client_typesItem) { - ogs_error("No serving_client_typesItem"); - OpenAPI_list_free(serving_client_typesList); - goto end; + serving_client_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_client_types_local, serving_client_types) { + if (!cJSON_IsObject(serving_client_types_local)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_client_types]"); + goto end; + } + OpenAPI_external_client_type_t *serving_client_typesItem = OpenAPI_external_client_type_parseFromJSON(serving_client_types_local); + if (!serving_client_typesItem) { + ogs_error("No serving_client_typesItem"); + OpenAPI_list_free(serving_client_typesList); + goto end; + } + OpenAPI_list_add(serving_client_typesList, serving_client_typesItem); } - - OpenAPI_list_add(serving_client_typesList, serving_client_typesItem); - } } - cJSON *lmf_id = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "lmfId"); - + lmf_id = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "lmfId"); if (lmf_id) { - if (!cJSON_IsString(lmf_id)) { + if (!cJSON_IsString(lmf_id) && !cJSON_IsNull(lmf_id)) { ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [lmf_id]"); goto end; } } - cJSON *serving_access_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingAccessTypes"); - - OpenAPI_list_t *serving_access_typesList; + serving_access_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingAccessTypes"); if (serving_access_types) { - cJSON *serving_access_types_local_nonprimitive; - if (!cJSON_IsArray(serving_access_types)) { - ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_access_types]"); - goto end; - } - - serving_access_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(serving_access_types_local_nonprimitive, serving_access_types ) { - if (!cJSON_IsString(serving_access_types_local_nonprimitive)){ + cJSON *serving_access_types_local = NULL; + if (!cJSON_IsArray(serving_access_types)) { ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_access_types]"); goto end; } - OpenAPI_list_add(serving_access_typesList, (void *)OpenAPI_access_type_FromString(serving_access_types_local_nonprimitive->valuestring)); - } + serving_access_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_access_types_local, serving_access_types) { + if (!cJSON_IsString(serving_access_types_local)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_access_types]"); + goto end; + } + OpenAPI_list_add(serving_access_typesList, (void *)OpenAPI_access_type_FromString(serving_access_types_local->valuestring)); + } } - cJSON *serving_an_node_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingAnNodeTypes"); - - OpenAPI_list_t *serving_an_node_typesList; + serving_an_node_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingAnNodeTypes"); if (serving_an_node_types) { - cJSON *serving_an_node_types_local_nonprimitive; - if (!cJSON_IsArray(serving_an_node_types)) { - ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_an_node_types]"); - goto end; - } - - serving_an_node_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(serving_an_node_types_local_nonprimitive, serving_an_node_types ) { - if (!cJSON_IsString(serving_an_node_types_local_nonprimitive)){ + cJSON *serving_an_node_types_local = NULL; + if (!cJSON_IsArray(serving_an_node_types)) { ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_an_node_types]"); goto end; } - OpenAPI_list_add(serving_an_node_typesList, (void *)OpenAPI_an_node_type_FromString(serving_an_node_types_local_nonprimitive->valuestring)); - } + serving_an_node_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_an_node_types_local, serving_an_node_types) { + if (!cJSON_IsString(serving_an_node_types_local)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_an_node_types]"); + goto end; + } + OpenAPI_list_add(serving_an_node_typesList, (void *)OpenAPI_an_node_type_FromString(serving_an_node_types_local->valuestring)); + } } - cJSON *serving_rat_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingRatTypes"); - - OpenAPI_list_t *serving_rat_typesList; + serving_rat_types = cJSON_GetObjectItemCaseSensitive(lmf_infoJSON, "servingRatTypes"); if (serving_rat_types) { - cJSON *serving_rat_types_local_nonprimitive; - if (!cJSON_IsArray(serving_rat_types)) { - ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_rat_types]"); - goto end; - } - - serving_rat_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(serving_rat_types_local_nonprimitive, serving_rat_types ) { - if (!cJSON_IsString(serving_rat_types_local_nonprimitive)){ + cJSON *serving_rat_types_local = NULL; + if (!cJSON_IsArray(serving_rat_types)) { ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_rat_types]"); goto end; } - OpenAPI_list_add(serving_rat_typesList, (void *)OpenAPI_rat_type_FromString(serving_rat_types_local_nonprimitive->valuestring)); - } + serving_rat_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_rat_types_local, serving_rat_types) { + if (!cJSON_IsString(serving_rat_types_local)) { + ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_rat_types]"); + goto end; + } + OpenAPI_list_add(serving_rat_typesList, (void *)OpenAPI_rat_type_FromString(serving_rat_types_local->valuestring)); + } } lmf_info_local_var = OpenAPI_lmf_info_create ( serving_client_types ? serving_client_typesList : NULL, - lmf_id ? ogs_strdup(lmf_id->valuestring) : NULL, + lmf_id && !cJSON_IsNull(lmf_id) ? ogs_strdup(lmf_id->valuestring) : NULL, serving_access_types ? serving_access_typesList : NULL, serving_an_node_types ? serving_an_node_typesList : NULL, serving_rat_types ? serving_rat_typesList : NULL @@ -244,6 +250,25 @@ OpenAPI_lmf_info_t *OpenAPI_lmf_info_parseFromJSON(cJSON *lmf_infoJSON) return lmf_info_local_var; end: + if (serving_client_typesList) { + OpenAPI_list_for_each(serving_client_typesList, node) { + OpenAPI_external_client_type_free(node->data); + } + OpenAPI_list_free(serving_client_typesList); + serving_client_typesList = NULL; + } + if (serving_access_typesList) { + OpenAPI_list_free(serving_access_typesList); + serving_access_typesList = NULL; + } + if (serving_an_node_typesList) { + OpenAPI_list_free(serving_an_node_typesList); + serving_an_node_typesList = NULL; + } + if (serving_rat_typesList) { + OpenAPI_list_free(serving_rat_typesList); + serving_rat_typesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/location_accuracy.c b/lib/sbi/openapi/model/location_accuracy.c index 5b3401fad..0748d05a4 100644 --- a/lib/sbi/openapi/model/location_accuracy.c +++ b/lib/sbi/openapi/model/location_accuracy.c @@ -16,16 +16,18 @@ OpenAPI_location_accuracy_t *OpenAPI_location_accuracy_create( void OpenAPI_location_accuracy_free(OpenAPI_location_accuracy_t *location_accuracy) { + OpenAPI_lnode_t *node = NULL; + if (NULL == location_accuracy) { return; } - OpenAPI_lnode_t *node; ogs_free(location_accuracy); } cJSON *OpenAPI_location_accuracy_convertToJSON(OpenAPI_location_accuracy_t *location_accuracy) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (location_accuracy == NULL) { ogs_error("OpenAPI_location_accuracy_convertToJSON() failed [LocationAccuracy]"); @@ -40,6 +42,7 @@ end: OpenAPI_location_accuracy_t *OpenAPI_location_accuracy_parseFromJSON(cJSON *location_accuracyJSON) { OpenAPI_location_accuracy_t *location_accuracy_local_var = NULL; + OpenAPI_lnode_t *node = NULL; location_accuracy_local_var = OpenAPI_location_accuracy_create ( ); diff --git a/lib/sbi/openapi/model/location_area.c b/lib/sbi/openapi/model/location_area.c index 15a1e887f..b429283e8 100644 --- a/lib/sbi/openapi/model/location_area.c +++ b/lib/sbi/openapi/model/location_area.c @@ -22,25 +22,36 @@ OpenAPI_location_area_t *OpenAPI_location_area_create( void OpenAPI_location_area_free(OpenAPI_location_area_t *location_area) { + OpenAPI_lnode_t *node = NULL; + if (NULL == location_area) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(location_area->geographic_areas, node) { - OpenAPI_geographic_area_free(node->data); + if (location_area->geographic_areas) { + OpenAPI_list_for_each(location_area->geographic_areas, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(location_area->geographic_areas); + location_area->geographic_areas = NULL; } - OpenAPI_list_free(location_area->geographic_areas); - OpenAPI_list_for_each(location_area->civic_addresses, node) { - OpenAPI_civic_address_free(node->data); + if (location_area->civic_addresses) { + OpenAPI_list_for_each(location_area->civic_addresses, node) { + OpenAPI_civic_address_free(node->data); + } + OpenAPI_list_free(location_area->civic_addresses); + location_area->civic_addresses = NULL; + } + if (location_area->nw_area_info) { + OpenAPI_network_area_info_free(location_area->nw_area_info); + location_area->nw_area_info = NULL; } - OpenAPI_list_free(location_area->civic_addresses); - OpenAPI_network_area_info_free(location_area->nw_area_info); ogs_free(location_area); } cJSON *OpenAPI_location_area_convertToJSON(OpenAPI_location_area_t *location_area) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (location_area == NULL) { ogs_error("OpenAPI_location_area_convertToJSON() failed [LocationArea]"); @@ -54,17 +65,13 @@ cJSON *OpenAPI_location_area_convertToJSON(OpenAPI_location_area_t *location_are ogs_error("OpenAPI_location_area_convertToJSON() failed [geographic_areas]"); goto end; } - - OpenAPI_lnode_t *geographic_areas_node; - if (location_area->geographic_areas) { - OpenAPI_list_for_each(location_area->geographic_areas, geographic_areas_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(geographic_areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_location_area_convertToJSON() failed [geographic_areas]"); - goto end; - } - cJSON_AddItemToArray(geographic_areasList, itemLocal); + OpenAPI_list_for_each(location_area->geographic_areas, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [geographic_areas]"); + goto end; } + cJSON_AddItemToArray(geographic_areasList, itemLocal); } } @@ -74,17 +81,13 @@ cJSON *OpenAPI_location_area_convertToJSON(OpenAPI_location_area_t *location_are ogs_error("OpenAPI_location_area_convertToJSON() failed [civic_addresses]"); goto end; } - - OpenAPI_lnode_t *civic_addresses_node; - if (location_area->civic_addresses) { - OpenAPI_list_for_each(location_area->civic_addresses, civic_addresses_node) { - cJSON *itemLocal = OpenAPI_civic_address_convertToJSON(civic_addresses_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_location_area_convertToJSON() failed [civic_addresses]"); - goto end; - } - cJSON_AddItemToArray(civic_addressesList, itemLocal); + OpenAPI_list_for_each(location_area->civic_addresses, node) { + cJSON *itemLocal = OpenAPI_civic_address_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_location_area_convertToJSON() failed [civic_addresses]"); + goto end; } + cJSON_AddItemToArray(civic_addressesList, itemLocal); } } @@ -108,67 +111,64 @@ end: OpenAPI_location_area_t *OpenAPI_location_area_parseFromJSON(cJSON *location_areaJSON) { OpenAPI_location_area_t *location_area_local_var = NULL; - cJSON *geographic_areas = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "geographicAreas"); - - OpenAPI_list_t *geographic_areasList; + OpenAPI_lnode_t *node = NULL; + cJSON *geographic_areas = NULL; + OpenAPI_list_t *geographic_areasList = NULL; + cJSON *civic_addresses = NULL; + OpenAPI_list_t *civic_addressesList = NULL; + cJSON *nw_area_info = NULL; + OpenAPI_network_area_info_t *nw_area_info_local_nonprim = NULL; + geographic_areas = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "geographicAreas"); if (geographic_areas) { - cJSON *geographic_areas_local_nonprimitive; - if (!cJSON_IsArray(geographic_areas)){ - ogs_error("OpenAPI_location_area_parseFromJSON() failed [geographic_areas]"); - goto end; - } - - geographic_areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(geographic_areas_local_nonprimitive, geographic_areas ) { - if (!cJSON_IsObject(geographic_areas_local_nonprimitive)) { + cJSON *geographic_areas_local = NULL; + if (!cJSON_IsArray(geographic_areas)) { ogs_error("OpenAPI_location_area_parseFromJSON() failed [geographic_areas]"); goto end; } - OpenAPI_geographic_area_t *geographic_areasItem = OpenAPI_geographic_area_parseFromJSON(geographic_areas_local_nonprimitive); - if (!geographic_areasItem) { - ogs_error("No geographic_areasItem"); - OpenAPI_list_free(geographic_areasList); - goto end; + geographic_areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(geographic_areas_local, geographic_areas) { + if (!cJSON_IsObject(geographic_areas_local)) { + ogs_error("OpenAPI_location_area_parseFromJSON() failed [geographic_areas]"); + goto end; + } + OpenAPI_geographic_area_t *geographic_areasItem = OpenAPI_geographic_area_parseFromJSON(geographic_areas_local); + if (!geographic_areasItem) { + ogs_error("No geographic_areasItem"); + OpenAPI_list_free(geographic_areasList); + goto end; + } + OpenAPI_list_add(geographic_areasList, geographic_areasItem); } - - OpenAPI_list_add(geographic_areasList, geographic_areasItem); - } } - cJSON *civic_addresses = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "civicAddresses"); - - OpenAPI_list_t *civic_addressesList; + civic_addresses = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "civicAddresses"); if (civic_addresses) { - cJSON *civic_addresses_local_nonprimitive; - if (!cJSON_IsArray(civic_addresses)){ - ogs_error("OpenAPI_location_area_parseFromJSON() failed [civic_addresses]"); - goto end; - } - - civic_addressesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(civic_addresses_local_nonprimitive, civic_addresses ) { - if (!cJSON_IsObject(civic_addresses_local_nonprimitive)) { + cJSON *civic_addresses_local = NULL; + if (!cJSON_IsArray(civic_addresses)) { ogs_error("OpenAPI_location_area_parseFromJSON() failed [civic_addresses]"); goto end; } - OpenAPI_civic_address_t *civic_addressesItem = OpenAPI_civic_address_parseFromJSON(civic_addresses_local_nonprimitive); - if (!civic_addressesItem) { - ogs_error("No civic_addressesItem"); - OpenAPI_list_free(civic_addressesList); - goto end; + civic_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(civic_addresses_local, civic_addresses) { + if (!cJSON_IsObject(civic_addresses_local)) { + ogs_error("OpenAPI_location_area_parseFromJSON() failed [civic_addresses]"); + goto end; + } + OpenAPI_civic_address_t *civic_addressesItem = OpenAPI_civic_address_parseFromJSON(civic_addresses_local); + if (!civic_addressesItem) { + ogs_error("No civic_addressesItem"); + OpenAPI_list_free(civic_addressesList); + goto end; + } + OpenAPI_list_add(civic_addressesList, civic_addressesItem); } - - OpenAPI_list_add(civic_addressesList, civic_addressesItem); - } } - cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "nwAreaInfo"); - - OpenAPI_network_area_info_t *nw_area_info_local_nonprim = NULL; + nw_area_info = cJSON_GetObjectItemCaseSensitive(location_areaJSON, "nwAreaInfo"); if (nw_area_info) { nw_area_info_local_nonprim = OpenAPI_network_area_info_parseFromJSON(nw_area_info); } @@ -181,6 +181,24 @@ OpenAPI_location_area_t *OpenAPI_location_area_parseFromJSON(cJSON *location_are return location_area_local_var; end: + if (geographic_areasList) { + OpenAPI_list_for_each(geographic_areasList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(geographic_areasList); + geographic_areasList = NULL; + } + if (civic_addressesList) { + OpenAPI_list_for_each(civic_addressesList, node) { + OpenAPI_civic_address_free(node->data); + } + OpenAPI_list_free(civic_addressesList); + civic_addressesList = NULL; + } + if (nw_area_info_local_nonprim) { + OpenAPI_network_area_info_free(nw_area_info_local_nonprim); + nw_area_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/location_area_1.c b/lib/sbi/openapi/model/location_area_1.c index 8c5a0cf43..347cd6654 100644 --- a/lib/sbi/openapi/model/location_area_1.c +++ b/lib/sbi/openapi/model/location_area_1.c @@ -22,25 +22,36 @@ OpenAPI_location_area_1_t *OpenAPI_location_area_1_create( void OpenAPI_location_area_1_free(OpenAPI_location_area_1_t *location_area_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == location_area_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(location_area_1->geographic_areas, node) { - OpenAPI_geographic_area_free(node->data); + if (location_area_1->geographic_areas) { + OpenAPI_list_for_each(location_area_1->geographic_areas, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(location_area_1->geographic_areas); + location_area_1->geographic_areas = NULL; } - OpenAPI_list_free(location_area_1->geographic_areas); - OpenAPI_list_for_each(location_area_1->civic_addresses, node) { - OpenAPI_civic_address_free(node->data); + if (location_area_1->civic_addresses) { + OpenAPI_list_for_each(location_area_1->civic_addresses, node) { + OpenAPI_civic_address_free(node->data); + } + OpenAPI_list_free(location_area_1->civic_addresses); + location_area_1->civic_addresses = NULL; + } + if (location_area_1->nw_area_info) { + OpenAPI_network_area_info_1_free(location_area_1->nw_area_info); + location_area_1->nw_area_info = NULL; } - OpenAPI_list_free(location_area_1->civic_addresses); - OpenAPI_network_area_info_1_free(location_area_1->nw_area_info); ogs_free(location_area_1); } cJSON *OpenAPI_location_area_1_convertToJSON(OpenAPI_location_area_1_t *location_area_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (location_area_1 == NULL) { ogs_error("OpenAPI_location_area_1_convertToJSON() failed [LocationArea_1]"); @@ -54,17 +65,13 @@ cJSON *OpenAPI_location_area_1_convertToJSON(OpenAPI_location_area_1_t *location ogs_error("OpenAPI_location_area_1_convertToJSON() failed [geographic_areas]"); goto end; } - - OpenAPI_lnode_t *geographic_areas_node; - if (location_area_1->geographic_areas) { - OpenAPI_list_for_each(location_area_1->geographic_areas, geographic_areas_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(geographic_areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_location_area_1_convertToJSON() failed [geographic_areas]"); - goto end; - } - cJSON_AddItemToArray(geographic_areasList, itemLocal); + OpenAPI_list_for_each(location_area_1->geographic_areas, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_location_area_1_convertToJSON() failed [geographic_areas]"); + goto end; } + cJSON_AddItemToArray(geographic_areasList, itemLocal); } } @@ -74,17 +81,13 @@ cJSON *OpenAPI_location_area_1_convertToJSON(OpenAPI_location_area_1_t *location ogs_error("OpenAPI_location_area_1_convertToJSON() failed [civic_addresses]"); goto end; } - - OpenAPI_lnode_t *civic_addresses_node; - if (location_area_1->civic_addresses) { - OpenAPI_list_for_each(location_area_1->civic_addresses, civic_addresses_node) { - cJSON *itemLocal = OpenAPI_civic_address_convertToJSON(civic_addresses_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_location_area_1_convertToJSON() failed [civic_addresses]"); - goto end; - } - cJSON_AddItemToArray(civic_addressesList, itemLocal); + OpenAPI_list_for_each(location_area_1->civic_addresses, node) { + cJSON *itemLocal = OpenAPI_civic_address_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_location_area_1_convertToJSON() failed [civic_addresses]"); + goto end; } + cJSON_AddItemToArray(civic_addressesList, itemLocal); } } @@ -108,67 +111,64 @@ end: OpenAPI_location_area_1_t *OpenAPI_location_area_1_parseFromJSON(cJSON *location_area_1JSON) { OpenAPI_location_area_1_t *location_area_1_local_var = NULL; - cJSON *geographic_areas = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "geographicAreas"); - - OpenAPI_list_t *geographic_areasList; + OpenAPI_lnode_t *node = NULL; + cJSON *geographic_areas = NULL; + OpenAPI_list_t *geographic_areasList = NULL; + cJSON *civic_addresses = NULL; + OpenAPI_list_t *civic_addressesList = NULL; + cJSON *nw_area_info = NULL; + OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL; + geographic_areas = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "geographicAreas"); if (geographic_areas) { - cJSON *geographic_areas_local_nonprimitive; - if (!cJSON_IsArray(geographic_areas)){ - ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [geographic_areas]"); - goto end; - } - - geographic_areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(geographic_areas_local_nonprimitive, geographic_areas ) { - if (!cJSON_IsObject(geographic_areas_local_nonprimitive)) { + cJSON *geographic_areas_local = NULL; + if (!cJSON_IsArray(geographic_areas)) { ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [geographic_areas]"); goto end; } - OpenAPI_geographic_area_t *geographic_areasItem = OpenAPI_geographic_area_parseFromJSON(geographic_areas_local_nonprimitive); - if (!geographic_areasItem) { - ogs_error("No geographic_areasItem"); - OpenAPI_list_free(geographic_areasList); - goto end; + geographic_areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(geographic_areas_local, geographic_areas) { + if (!cJSON_IsObject(geographic_areas_local)) { + ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [geographic_areas]"); + goto end; + } + OpenAPI_geographic_area_t *geographic_areasItem = OpenAPI_geographic_area_parseFromJSON(geographic_areas_local); + if (!geographic_areasItem) { + ogs_error("No geographic_areasItem"); + OpenAPI_list_free(geographic_areasList); + goto end; + } + OpenAPI_list_add(geographic_areasList, geographic_areasItem); } - - OpenAPI_list_add(geographic_areasList, geographic_areasItem); - } } - cJSON *civic_addresses = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "civicAddresses"); - - OpenAPI_list_t *civic_addressesList; + civic_addresses = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "civicAddresses"); if (civic_addresses) { - cJSON *civic_addresses_local_nonprimitive; - if (!cJSON_IsArray(civic_addresses)){ - ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [civic_addresses]"); - goto end; - } - - civic_addressesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(civic_addresses_local_nonprimitive, civic_addresses ) { - if (!cJSON_IsObject(civic_addresses_local_nonprimitive)) { + cJSON *civic_addresses_local = NULL; + if (!cJSON_IsArray(civic_addresses)) { ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [civic_addresses]"); goto end; } - OpenAPI_civic_address_t *civic_addressesItem = OpenAPI_civic_address_parseFromJSON(civic_addresses_local_nonprimitive); - if (!civic_addressesItem) { - ogs_error("No civic_addressesItem"); - OpenAPI_list_free(civic_addressesList); - goto end; + civic_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(civic_addresses_local, civic_addresses) { + if (!cJSON_IsObject(civic_addresses_local)) { + ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [civic_addresses]"); + goto end; + } + OpenAPI_civic_address_t *civic_addressesItem = OpenAPI_civic_address_parseFromJSON(civic_addresses_local); + if (!civic_addressesItem) { + ogs_error("No civic_addressesItem"); + OpenAPI_list_free(civic_addressesList); + goto end; + } + OpenAPI_list_add(civic_addressesList, civic_addressesItem); } - - OpenAPI_list_add(civic_addressesList, civic_addressesItem); - } } - cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "nwAreaInfo"); - - OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL; + nw_area_info = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "nwAreaInfo"); if (nw_area_info) { nw_area_info_local_nonprim = OpenAPI_network_area_info_1_parseFromJSON(nw_area_info); } @@ -181,6 +181,24 @@ OpenAPI_location_area_1_t *OpenAPI_location_area_1_parseFromJSON(cJSON *location return location_area_1_local_var; end: + if (geographic_areasList) { + OpenAPI_list_for_each(geographic_areasList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(geographic_areasList); + geographic_areasList = NULL; + } + if (civic_addressesList) { + OpenAPI_list_for_each(civic_addressesList, node) { + OpenAPI_civic_address_free(node->data); + } + OpenAPI_list_free(civic_addressesList); + civic_addressesList = NULL; + } + if (nw_area_info_local_nonprim) { + OpenAPI_network_area_info_1_free(nw_area_info_local_nonprim); + nw_area_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/location_filter.c b/lib/sbi/openapi/model/location_filter.c index 195566415..3d36f98de 100644 --- a/lib/sbi/openapi/model/location_filter.c +++ b/lib/sbi/openapi/model/location_filter.c @@ -16,16 +16,18 @@ OpenAPI_location_filter_t *OpenAPI_location_filter_create( void OpenAPI_location_filter_free(OpenAPI_location_filter_t *location_filter) { + OpenAPI_lnode_t *node = NULL; + if (NULL == location_filter) { return; } - OpenAPI_lnode_t *node; ogs_free(location_filter); } cJSON *OpenAPI_location_filter_convertToJSON(OpenAPI_location_filter_t *location_filter) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (location_filter == NULL) { ogs_error("OpenAPI_location_filter_convertToJSON() failed [LocationFilter]"); @@ -40,6 +42,7 @@ end: OpenAPI_location_filter_t *OpenAPI_location_filter_parseFromJSON(cJSON *location_filterJSON) { OpenAPI_location_filter_t *location_filter_local_var = NULL; + OpenAPI_lnode_t *node = NULL; location_filter_local_var = OpenAPI_location_filter_create ( ); diff --git a/lib/sbi/openapi/model/location_info.c b/lib/sbi/openapi/model/location_info.c index f2268bb84..23d200ec6 100644 --- a/lib/sbi/openapi/model/location_info.c +++ b/lib/sbi/openapi/model/location_info.c @@ -24,23 +24,37 @@ OpenAPI_location_info_t *OpenAPI_location_info_create( void OpenAPI_location_info_free(OpenAPI_location_info_t *location_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == location_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(location_info->supi); - ogs_free(location_info->gpsi); - OpenAPI_list_for_each(location_info->registration_location_info_list, node) { - OpenAPI_registration_location_info_free(node->data); + if (location_info->supi) { + ogs_free(location_info->supi); + location_info->supi = NULL; + } + if (location_info->gpsi) { + ogs_free(location_info->gpsi); + location_info->gpsi = NULL; + } + if (location_info->registration_location_info_list) { + OpenAPI_list_for_each(location_info->registration_location_info_list, node) { + OpenAPI_registration_location_info_free(node->data); + } + OpenAPI_list_free(location_info->registration_location_info_list); + location_info->registration_location_info_list = NULL; + } + if (location_info->supported_features) { + ogs_free(location_info->supported_features); + location_info->supported_features = NULL; } - OpenAPI_list_free(location_info->registration_location_info_list); - ogs_free(location_info->supported_features); ogs_free(location_info); } cJSON *OpenAPI_location_info_convertToJSON(OpenAPI_location_info_t *location_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (location_info == NULL) { ogs_error("OpenAPI_location_info_convertToJSON() failed [LocationInfo]"); @@ -62,22 +76,22 @@ cJSON *OpenAPI_location_info_convertToJSON(OpenAPI_location_info_t *location_inf } } + if (!location_info->registration_location_info_list) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [registration_location_info_list]"); + return NULL; + } cJSON *registration_location_info_listList = cJSON_AddArrayToObject(item, "registrationLocationInfoList"); if (registration_location_info_listList == NULL) { ogs_error("OpenAPI_location_info_convertToJSON() failed [registration_location_info_list]"); goto end; } - - OpenAPI_lnode_t *registration_location_info_list_node; - if (location_info->registration_location_info_list) { - OpenAPI_list_for_each(location_info->registration_location_info_list, registration_location_info_list_node) { - cJSON *itemLocal = OpenAPI_registration_location_info_convertToJSON(registration_location_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_location_info_convertToJSON() failed [registration_location_info_list]"); - goto end; - } - cJSON_AddItemToArray(registration_location_info_listList, itemLocal); + OpenAPI_list_for_each(location_info->registration_location_info_list, node) { + cJSON *itemLocal = OpenAPI_registration_location_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_location_info_convertToJSON() failed [registration_location_info_list]"); + goto end; } + cJSON_AddItemToArray(registration_location_info_listList, itemLocal); } if (location_info->supported_features) { @@ -94,73 +108,79 @@ end: OpenAPI_location_info_t *OpenAPI_location_info_parseFromJSON(cJSON *location_infoJSON) { OpenAPI_location_info_t *location_info_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *gpsi = NULL; + cJSON *registration_location_info_list = NULL; + OpenAPI_list_t *registration_location_info_listList = NULL; + cJSON *supported_features = NULL; + supi = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_location_info_parseFromJSON() failed [supi]"); goto end; } } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_location_info_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *registration_location_info_list = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "registrationLocationInfoList"); + registration_location_info_list = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "registrationLocationInfoList"); if (!registration_location_info_list) { ogs_error("OpenAPI_location_info_parseFromJSON() failed [registration_location_info_list]"); goto end; } - - OpenAPI_list_t *registration_location_info_listList; - cJSON *registration_location_info_list_local_nonprimitive; - if (!cJSON_IsArray(registration_location_info_list)){ - ogs_error("OpenAPI_location_info_parseFromJSON() failed [registration_location_info_list]"); - goto end; - } - - registration_location_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(registration_location_info_list_local_nonprimitive, registration_location_info_list ) { - if (!cJSON_IsObject(registration_location_info_list_local_nonprimitive)) { + cJSON *registration_location_info_list_local = NULL; + if (!cJSON_IsArray(registration_location_info_list)) { ogs_error("OpenAPI_location_info_parseFromJSON() failed [registration_location_info_list]"); goto end; } - OpenAPI_registration_location_info_t *registration_location_info_listItem = OpenAPI_registration_location_info_parseFromJSON(registration_location_info_list_local_nonprimitive); - if (!registration_location_info_listItem) { - ogs_error("No registration_location_info_listItem"); - OpenAPI_list_free(registration_location_info_listList); - goto end; + registration_location_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(registration_location_info_list_local, registration_location_info_list) { + if (!cJSON_IsObject(registration_location_info_list_local)) { + ogs_error("OpenAPI_location_info_parseFromJSON() failed [registration_location_info_list]"); + goto end; + } + OpenAPI_registration_location_info_t *registration_location_info_listItem = OpenAPI_registration_location_info_parseFromJSON(registration_location_info_list_local); + if (!registration_location_info_listItem) { + ogs_error("No registration_location_info_listItem"); + OpenAPI_list_free(registration_location_info_listList); + goto end; + } + OpenAPI_list_add(registration_location_info_listList, registration_location_info_listItem); } - OpenAPI_list_add(registration_location_info_listList, registration_location_info_listItem); - } - - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(location_infoJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_location_info_parseFromJSON() failed [supported_features]"); goto end; } } location_info_local_var = OpenAPI_location_info_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, registration_location_info_listList, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return location_info_local_var; end: + if (registration_location_info_listList) { + OpenAPI_list_for_each(registration_location_info_listList, node) { + OpenAPI_registration_location_info_free(node->data); + } + OpenAPI_list_free(registration_location_info_listList); + registration_location_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/location_reporting_configuration.c b/lib/sbi/openapi/model/location_reporting_configuration.c index 5660ad2c4..a969e24c8 100644 --- a/lib/sbi/openapi/model/location_reporting_configuration.c +++ b/lib/sbi/openapi/model/location_reporting_configuration.c @@ -26,18 +26,26 @@ OpenAPI_location_reporting_configuration_t *OpenAPI_location_reporting_configura void OpenAPI_location_reporting_configuration_free(OpenAPI_location_reporting_configuration_t *location_reporting_configuration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == location_reporting_configuration) { return; } - OpenAPI_lnode_t *node; - OpenAPI_location_accuracy_free(location_reporting_configuration->accuracy); - OpenAPI_location_accuracy_free(location_reporting_configuration->n3gpp_accuracy); + if (location_reporting_configuration->accuracy) { + OpenAPI_location_accuracy_free(location_reporting_configuration->accuracy); + location_reporting_configuration->accuracy = NULL; + } + if (location_reporting_configuration->n3gpp_accuracy) { + OpenAPI_location_accuracy_free(location_reporting_configuration->n3gpp_accuracy); + location_reporting_configuration->n3gpp_accuracy = NULL; + } ogs_free(location_reporting_configuration); } cJSON *OpenAPI_location_reporting_configuration_convertToJSON(OpenAPI_location_reporting_configuration_t *location_reporting_configuration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (location_reporting_configuration == NULL) { ogs_error("OpenAPI_location_reporting_configuration_convertToJSON() failed [LocationReportingConfiguration]"); @@ -90,19 +98,24 @@ end: OpenAPI_location_reporting_configuration_t *OpenAPI_location_reporting_configuration_parseFromJSON(cJSON *location_reporting_configurationJSON) { OpenAPI_location_reporting_configuration_t *location_reporting_configuration_local_var = NULL; - cJSON *current_location = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "currentLocation"); + OpenAPI_lnode_t *node = NULL; + cJSON *current_location = NULL; + cJSON *one_time = NULL; + cJSON *accuracy = NULL; + OpenAPI_location_accuracy_t *accuracy_local_nonprim = NULL; + cJSON *n3gpp_accuracy = NULL; + OpenAPI_location_accuracy_t *n3gpp_accuracy_local_nonprim = NULL; + current_location = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "currentLocation"); if (!current_location) { ogs_error("OpenAPI_location_reporting_configuration_parseFromJSON() failed [current_location]"); goto end; } - if (!cJSON_IsBool(current_location)) { ogs_error("OpenAPI_location_reporting_configuration_parseFromJSON() failed [current_location]"); goto end; } - cJSON *one_time = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "oneTime"); - + one_time = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "oneTime"); if (one_time) { if (!cJSON_IsBool(one_time)) { ogs_error("OpenAPI_location_reporting_configuration_parseFromJSON() failed [one_time]"); @@ -110,16 +123,12 @@ OpenAPI_location_reporting_configuration_t *OpenAPI_location_reporting_configura } } - cJSON *accuracy = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "accuracy"); - - OpenAPI_location_accuracy_t *accuracy_local_nonprim = NULL; + accuracy = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "accuracy"); if (accuracy) { accuracy_local_nonprim = OpenAPI_location_accuracy_parseFromJSON(accuracy); } - cJSON *n3gpp_accuracy = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "n3gppAccuracy"); - - OpenAPI_location_accuracy_t *n3gpp_accuracy_local_nonprim = NULL; + n3gpp_accuracy = cJSON_GetObjectItemCaseSensitive(location_reporting_configurationJSON, "n3gppAccuracy"); if (n3gpp_accuracy) { n3gpp_accuracy_local_nonprim = OpenAPI_location_accuracy_parseFromJSON(n3gpp_accuracy); } @@ -135,6 +144,14 @@ OpenAPI_location_reporting_configuration_t *OpenAPI_location_reporting_configura return location_reporting_configuration_local_var; end: + if (accuracy_local_nonprim) { + OpenAPI_location_accuracy_free(accuracy_local_nonprim); + accuracy_local_nonprim = NULL; + } + if (n3gpp_accuracy_local_nonprim) { + OpenAPI_location_accuracy_free(n3gpp_accuracy_local_nonprim); + n3gpp_accuracy_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/logging_duration_mdt.c b/lib/sbi/openapi/model/logging_duration_mdt.c index c33f25553..bb3d24d2e 100644 --- a/lib/sbi/openapi/model/logging_duration_mdt.c +++ b/lib/sbi/openapi/model/logging_duration_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_logging_duration_mdt_ToString(OpenAPI_logging_duration_mdt_e logging_duration_mdt) { - const char *logging_duration_mdtArray[] = { "NULL", "_600", "_1200", "_2400", "_3600", "_5400", "_7200" }; + const char *logging_duration_mdtArray[] = { "NULL", "600", "1200", "2400", "3600", "5400", "7200" }; size_t sizeofArray = sizeof(logging_duration_mdtArray) / sizeof(logging_duration_mdtArray[0]); if (logging_duration_mdt < sizeofArray) return (char *)logging_duration_mdtArray[logging_duration_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_logging_duration_mdt_ToString(OpenAPI_logging_duration_mdt_e loggi OpenAPI_logging_duration_mdt_e OpenAPI_logging_duration_mdt_FromString(char* logging_duration_mdt) { int stringToReturn = 0; - const char *logging_duration_mdtArray[] = { "NULL", "_600", "_1200", "_2400", "_3600", "_5400", "_7200" }; + const char *logging_duration_mdtArray[] = { "NULL", "600", "1200", "2400", "3600", "5400", "7200" }; size_t sizeofArray = sizeof(logging_duration_mdtArray) / sizeof(logging_duration_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(logging_duration_mdt, logging_duration_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/logging_duration_nr_mdt.c b/lib/sbi/openapi/model/logging_duration_nr_mdt.c index 9d8ab1a24..f250f99cd 100644 --- a/lib/sbi/openapi/model/logging_duration_nr_mdt.c +++ b/lib/sbi/openapi/model/logging_duration_nr_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_logging_duration_nr_mdt_ToString(OpenAPI_logging_duration_nr_mdt_e logging_duration_nr_mdt) { - const char *logging_duration_nr_mdtArray[] = { "NULL", "_600", "_1200", "_2400", "_3600", "_5400", "_7200" }; + const char *logging_duration_nr_mdtArray[] = { "NULL", "600", "1200", "2400", "3600", "5400", "7200" }; size_t sizeofArray = sizeof(logging_duration_nr_mdtArray) / sizeof(logging_duration_nr_mdtArray[0]); if (logging_duration_nr_mdt < sizeofArray) return (char *)logging_duration_nr_mdtArray[logging_duration_nr_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_logging_duration_nr_mdt_ToString(OpenAPI_logging_duration_nr_mdt_e OpenAPI_logging_duration_nr_mdt_e OpenAPI_logging_duration_nr_mdt_FromString(char* logging_duration_nr_mdt) { int stringToReturn = 0; - const char *logging_duration_nr_mdtArray[] = { "NULL", "_600", "_1200", "_2400", "_3600", "_5400", "_7200" }; + const char *logging_duration_nr_mdtArray[] = { "NULL", "600", "1200", "2400", "3600", "5400", "7200" }; size_t sizeofArray = sizeof(logging_duration_nr_mdtArray) / sizeof(logging_duration_nr_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(logging_duration_nr_mdt, logging_duration_nr_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/logging_interval_mdt.c b/lib/sbi/openapi/model/logging_interval_mdt.c index 3ddce87f4..871d7426c 100644 --- a/lib/sbi/openapi/model/logging_interval_mdt.c +++ b/lib/sbi/openapi/model/logging_interval_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_logging_interval_mdt_ToString(OpenAPI_logging_interval_mdt_e logging_interval_mdt) { - const char *logging_interval_mdtArray[] = { "NULL", "_128", "_256", "_512", "_1024", "_2048", "_3072", "_4096", "_6144" }; + const char *logging_interval_mdtArray[] = { "NULL", "128", "256", "512", "1024", "2048", "3072", "4096", "6144" }; size_t sizeofArray = sizeof(logging_interval_mdtArray) / sizeof(logging_interval_mdtArray[0]); if (logging_interval_mdt < sizeofArray) return (char *)logging_interval_mdtArray[logging_interval_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_logging_interval_mdt_ToString(OpenAPI_logging_interval_mdt_e loggi OpenAPI_logging_interval_mdt_e OpenAPI_logging_interval_mdt_FromString(char* logging_interval_mdt) { int stringToReturn = 0; - const char *logging_interval_mdtArray[] = { "NULL", "_128", "_256", "_512", "_1024", "_2048", "_3072", "_4096", "_6144" }; + const char *logging_interval_mdtArray[] = { "NULL", "128", "256", "512", "1024", "2048", "3072", "4096", "6144" }; size_t sizeofArray = sizeof(logging_interval_mdtArray) / sizeof(logging_interval_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(logging_interval_mdt, logging_interval_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/logging_interval_nr_mdt.c b/lib/sbi/openapi/model/logging_interval_nr_mdt.c index 1583bf172..ccd5e2272 100644 --- a/lib/sbi/openapi/model/logging_interval_nr_mdt.c +++ b/lib/sbi/openapi/model/logging_interval_nr_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_logging_interval_nr_mdt_ToString(OpenAPI_logging_interval_nr_mdt_e logging_interval_nr_mdt) { - const char *logging_interval_nr_mdtArray[] = { "NULL", "_128", "_256", "_512", "_1024", "_2048", "_3072", "_4096", "_6144", "_320", "_640", "infinity" }; + const char *logging_interval_nr_mdtArray[] = { "NULL", "128", "256", "512", "1024", "2048", "3072", "4096", "6144", "320", "640", "infinity" }; size_t sizeofArray = sizeof(logging_interval_nr_mdtArray) / sizeof(logging_interval_nr_mdtArray[0]); if (logging_interval_nr_mdt < sizeofArray) return (char *)logging_interval_nr_mdtArray[logging_interval_nr_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_logging_interval_nr_mdt_ToString(OpenAPI_logging_interval_nr_mdt_e OpenAPI_logging_interval_nr_mdt_e OpenAPI_logging_interval_nr_mdt_FromString(char* logging_interval_nr_mdt) { int stringToReturn = 0; - const char *logging_interval_nr_mdtArray[] = { "NULL", "_128", "_256", "_512", "_1024", "_2048", "_3072", "_4096", "_6144", "_320", "_640", "infinity" }; + const char *logging_interval_nr_mdtArray[] = { "NULL", "128", "256", "512", "1024", "2048", "3072", "4096", "6144", "320", "640", "infinity" }; size_t sizeofArray = sizeof(logging_interval_nr_mdtArray) / sizeof(logging_interval_nr_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(logging_interval_nr_mdt, logging_interval_nr_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/loss_connectivity_cfg.c b/lib/sbi/openapi/model/loss_connectivity_cfg.c index 27aed3901..d10ac2ccf 100644 --- a/lib/sbi/openapi/model/loss_connectivity_cfg.c +++ b/lib/sbi/openapi/model/loss_connectivity_cfg.c @@ -20,16 +20,18 @@ OpenAPI_loss_connectivity_cfg_t *OpenAPI_loss_connectivity_cfg_create( void OpenAPI_loss_connectivity_cfg_free(OpenAPI_loss_connectivity_cfg_t *loss_connectivity_cfg) { + OpenAPI_lnode_t *node = NULL; + if (NULL == loss_connectivity_cfg) { return; } - OpenAPI_lnode_t *node; ogs_free(loss_connectivity_cfg); } cJSON *OpenAPI_loss_connectivity_cfg_convertToJSON(OpenAPI_loss_connectivity_cfg_t *loss_connectivity_cfg) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (loss_connectivity_cfg == NULL) { ogs_error("OpenAPI_loss_connectivity_cfg_convertToJSON() failed [LossConnectivityCfg]"); @@ -51,8 +53,9 @@ end: OpenAPI_loss_connectivity_cfg_t *OpenAPI_loss_connectivity_cfg_parseFromJSON(cJSON *loss_connectivity_cfgJSON) { OpenAPI_loss_connectivity_cfg_t *loss_connectivity_cfg_local_var = NULL; - cJSON *max_detection_time = cJSON_GetObjectItemCaseSensitive(loss_connectivity_cfgJSON, "maxDetectionTime"); - + OpenAPI_lnode_t *node = NULL; + cJSON *max_detection_time = NULL; + max_detection_time = cJSON_GetObjectItemCaseSensitive(loss_connectivity_cfgJSON, "maxDetectionTime"); if (max_detection_time) { if (!cJSON_IsNumber(max_detection_time)) { ogs_error("OpenAPI_loss_connectivity_cfg_parseFromJSON() failed [max_detection_time]"); diff --git a/lib/sbi/openapi/model/lpi.c b/lib/sbi/openapi/model/lpi.c index b3a2e30a2..d9b66d673 100644 --- a/lib/sbi/openapi/model/lpi.c +++ b/lib/sbi/openapi/model/lpi.c @@ -20,17 +20,22 @@ OpenAPI_lpi_t *OpenAPI_lpi_create( void OpenAPI_lpi_free(OpenAPI_lpi_t *lpi) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lpi) { return; } - OpenAPI_lnode_t *node; - OpenAPI_valid_time_period_free(lpi->valid_time_period); + if (lpi->valid_time_period) { + OpenAPI_valid_time_period_free(lpi->valid_time_period); + lpi->valid_time_period = NULL; + } ogs_free(lpi); } cJSON *OpenAPI_lpi_convertToJSON(OpenAPI_lpi_t *lpi) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lpi == NULL) { ogs_error("OpenAPI_lpi_convertToJSON() failed [Lpi]"); @@ -38,6 +43,10 @@ cJSON *OpenAPI_lpi_convertToJSON(OpenAPI_lpi_t *lpi) } item = cJSON_CreateObject(); + if (lpi->location_privacy_ind == OpenAPI_location_privacy_ind_NULL) { + ogs_error("OpenAPI_lpi_convertToJSON() failed [location_privacy_ind]"); + return NULL; + } if (cJSON_AddStringToObject(item, "locationPrivacyInd", OpenAPI_location_privacy_ind_ToString(lpi->location_privacy_ind)) == NULL) { ogs_error("OpenAPI_lpi_convertToJSON() failed [location_privacy_ind]"); goto end; @@ -63,22 +72,23 @@ end: OpenAPI_lpi_t *OpenAPI_lpi_parseFromJSON(cJSON *lpiJSON) { OpenAPI_lpi_t *lpi_local_var = NULL; - cJSON *location_privacy_ind = cJSON_GetObjectItemCaseSensitive(lpiJSON, "locationPrivacyInd"); + OpenAPI_lnode_t *node = NULL; + cJSON *location_privacy_ind = NULL; + OpenAPI_location_privacy_ind_e location_privacy_indVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + location_privacy_ind = cJSON_GetObjectItemCaseSensitive(lpiJSON, "locationPrivacyInd"); if (!location_privacy_ind) { ogs_error("OpenAPI_lpi_parseFromJSON() failed [location_privacy_ind]"); goto end; } - - OpenAPI_location_privacy_ind_e location_privacy_indVariable; if (!cJSON_IsString(location_privacy_ind)) { ogs_error("OpenAPI_lpi_parseFromJSON() failed [location_privacy_ind]"); goto end; } location_privacy_indVariable = OpenAPI_location_privacy_ind_FromString(location_privacy_ind->valuestring); - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(lpiJSON, "validTimePeriod"); - - OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(lpiJSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period); } @@ -90,6 +100,10 @@ OpenAPI_lpi_t *OpenAPI_lpi_parseFromJSON(cJSON *lpiJSON) return lpi_local_var; end: + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lpi_1.c b/lib/sbi/openapi/model/lpi_1.c index 775ffc856..3a0fb534a 100644 --- a/lib/sbi/openapi/model/lpi_1.c +++ b/lib/sbi/openapi/model/lpi_1.c @@ -20,17 +20,22 @@ OpenAPI_lpi_1_t *OpenAPI_lpi_1_create( void OpenAPI_lpi_1_free(OpenAPI_lpi_1_t *lpi_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lpi_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_valid_time_period_1_free(lpi_1->valid_time_period); + if (lpi_1->valid_time_period) { + OpenAPI_valid_time_period_1_free(lpi_1->valid_time_period); + lpi_1->valid_time_period = NULL; + } ogs_free(lpi_1); } cJSON *OpenAPI_lpi_1_convertToJSON(OpenAPI_lpi_1_t *lpi_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lpi_1 == NULL) { ogs_error("OpenAPI_lpi_1_convertToJSON() failed [Lpi_1]"); @@ -38,6 +43,10 @@ cJSON *OpenAPI_lpi_1_convertToJSON(OpenAPI_lpi_1_t *lpi_1) } item = cJSON_CreateObject(); + if (lpi_1->location_privacy_ind == OpenAPI_location_privacy_ind_NULL) { + ogs_error("OpenAPI_lpi_1_convertToJSON() failed [location_privacy_ind]"); + return NULL; + } if (cJSON_AddStringToObject(item, "locationPrivacyInd", OpenAPI_location_privacy_ind_ToString(lpi_1->location_privacy_ind)) == NULL) { ogs_error("OpenAPI_lpi_1_convertToJSON() failed [location_privacy_ind]"); goto end; @@ -63,22 +72,23 @@ end: OpenAPI_lpi_1_t *OpenAPI_lpi_1_parseFromJSON(cJSON *lpi_1JSON) { OpenAPI_lpi_1_t *lpi_1_local_var = NULL; - cJSON *location_privacy_ind = cJSON_GetObjectItemCaseSensitive(lpi_1JSON, "locationPrivacyInd"); + OpenAPI_lnode_t *node = NULL; + cJSON *location_privacy_ind = NULL; + OpenAPI_location_privacy_ind_e location_privacy_indVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_1_t *valid_time_period_local_nonprim = NULL; + location_privacy_ind = cJSON_GetObjectItemCaseSensitive(lpi_1JSON, "locationPrivacyInd"); if (!location_privacy_ind) { ogs_error("OpenAPI_lpi_1_parseFromJSON() failed [location_privacy_ind]"); goto end; } - - OpenAPI_location_privacy_ind_e location_privacy_indVariable; if (!cJSON_IsString(location_privacy_ind)) { ogs_error("OpenAPI_lpi_1_parseFromJSON() failed [location_privacy_ind]"); goto end; } location_privacy_indVariable = OpenAPI_location_privacy_ind_FromString(location_privacy_ind->valuestring); - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(lpi_1JSON, "validTimePeriod"); - - OpenAPI_valid_time_period_1_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(lpi_1JSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_1_parseFromJSON(valid_time_period); } @@ -90,6 +100,10 @@ OpenAPI_lpi_1_t *OpenAPI_lpi_1_parseFromJSON(cJSON *lpi_1JSON) return lpi_1_local_var; end: + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_1_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/lte_m_ind.c b/lib/sbi/openapi/model/lte_m_ind.c index a5dc0be19..e5222f50e 100644 --- a/lib/sbi/openapi/model/lte_m_ind.c +++ b/lib/sbi/openapi/model/lte_m_ind.c @@ -18,16 +18,18 @@ OpenAPI_lte_m_ind_t *OpenAPI_lte_m_ind_create( void OpenAPI_lte_m_ind_free(OpenAPI_lte_m_ind_t *lte_m_ind) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lte_m_ind) { return; } - OpenAPI_lnode_t *node; ogs_free(lte_m_ind); } cJSON *OpenAPI_lte_m_ind_convertToJSON(OpenAPI_lte_m_ind_t *lte_m_ind) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lte_m_ind == NULL) { ogs_error("OpenAPI_lte_m_ind_convertToJSON() failed [LteMInd]"); @@ -47,12 +49,13 @@ end: OpenAPI_lte_m_ind_t *OpenAPI_lte_m_ind_parseFromJSON(cJSON *lte_m_indJSON) { OpenAPI_lte_m_ind_t *lte_m_ind_local_var = NULL; - cJSON *lte_cat_m_ind = cJSON_GetObjectItemCaseSensitive(lte_m_indJSON, "lteCatMInd"); + OpenAPI_lnode_t *node = NULL; + cJSON *lte_cat_m_ind = NULL; + lte_cat_m_ind = cJSON_GetObjectItemCaseSensitive(lte_m_indJSON, "lteCatMInd"); if (!lte_cat_m_ind) { ogs_error("OpenAPI_lte_m_ind_parseFromJSON() failed [lte_cat_m_ind]"); goto end; } - if (!cJSON_IsBool(lte_cat_m_ind)) { ogs_error("OpenAPI_lte_m_ind_parseFromJSON() failed [lte_cat_m_ind]"); goto end; diff --git a/lib/sbi/openapi/model/lte_v2x_auth.c b/lib/sbi/openapi/model/lte_v2x_auth.c index 822c6b72f..f5367a872 100644 --- a/lib/sbi/openapi/model/lte_v2x_auth.c +++ b/lib/sbi/openapi/model/lte_v2x_auth.c @@ -20,16 +20,18 @@ OpenAPI_lte_v2x_auth_t *OpenAPI_lte_v2x_auth_create( void OpenAPI_lte_v2x_auth_free(OpenAPI_lte_v2x_auth_t *lte_v2x_auth) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lte_v2x_auth) { return; } - OpenAPI_lnode_t *node; ogs_free(lte_v2x_auth); } cJSON *OpenAPI_lte_v2x_auth_convertToJSON(OpenAPI_lte_v2x_auth_t *lte_v2x_auth) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lte_v2x_auth == NULL) { ogs_error("OpenAPI_lte_v2x_auth_convertToJSON() failed [LteV2xAuth]"); @@ -37,14 +39,14 @@ cJSON *OpenAPI_lte_v2x_auth_convertToJSON(OpenAPI_lte_v2x_auth_t *lte_v2x_auth) } item = cJSON_CreateObject(); - if (lte_v2x_auth->vehicle_ue_auth) { + if (lte_v2x_auth->vehicle_ue_auth != OpenAPI_ue_auth_NULL) { if (cJSON_AddStringToObject(item, "vehicleUeAuth", OpenAPI_ue_auth_ToString(lte_v2x_auth->vehicle_ue_auth)) == NULL) { ogs_error("OpenAPI_lte_v2x_auth_convertToJSON() failed [vehicle_ue_auth]"); goto end; } } - if (lte_v2x_auth->pedestrian_ue_auth) { + if (lte_v2x_auth->pedestrian_ue_auth != OpenAPI_ue_auth_NULL) { if (cJSON_AddStringToObject(item, "pedestrianUeAuth", OpenAPI_ue_auth_ToString(lte_v2x_auth->pedestrian_ue_auth)) == NULL) { ogs_error("OpenAPI_lte_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]"); goto end; @@ -58,9 +60,12 @@ end: OpenAPI_lte_v2x_auth_t *OpenAPI_lte_v2x_auth_parseFromJSON(cJSON *lte_v2x_authJSON) { OpenAPI_lte_v2x_auth_t *lte_v2x_auth_local_var = NULL; - cJSON *vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_authJSON, "vehicleUeAuth"); - - OpenAPI_ue_auth_e vehicle_ue_authVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *vehicle_ue_auth = NULL; + OpenAPI_ue_auth_e vehicle_ue_authVariable = 0; + cJSON *pedestrian_ue_auth = NULL; + OpenAPI_ue_auth_e pedestrian_ue_authVariable = 0; + vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_authJSON, "vehicleUeAuth"); if (vehicle_ue_auth) { if (!cJSON_IsString(vehicle_ue_auth)) { ogs_error("OpenAPI_lte_v2x_auth_parseFromJSON() failed [vehicle_ue_auth]"); @@ -69,9 +74,7 @@ OpenAPI_lte_v2x_auth_t *OpenAPI_lte_v2x_auth_parseFromJSON(cJSON *lte_v2x_authJS vehicle_ue_authVariable = OpenAPI_ue_auth_FromString(vehicle_ue_auth->valuestring); } - cJSON *pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_authJSON, "pedestrianUeAuth"); - - OpenAPI_ue_auth_e pedestrian_ue_authVariable; + pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_authJSON, "pedestrianUeAuth"); if (pedestrian_ue_auth) { if (!cJSON_IsString(pedestrian_ue_auth)) { ogs_error("OpenAPI_lte_v2x_auth_parseFromJSON() failed [pedestrian_ue_auth]"); diff --git a/lib/sbi/openapi/model/lte_v2x_auth_1.c b/lib/sbi/openapi/model/lte_v2x_auth_1.c index 88f1a8700..6fee11d5c 100644 --- a/lib/sbi/openapi/model/lte_v2x_auth_1.c +++ b/lib/sbi/openapi/model/lte_v2x_auth_1.c @@ -20,16 +20,18 @@ OpenAPI_lte_v2x_auth_1_t *OpenAPI_lte_v2x_auth_1_create( void OpenAPI_lte_v2x_auth_1_free(OpenAPI_lte_v2x_auth_1_t *lte_v2x_auth_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == lte_v2x_auth_1) { return; } - OpenAPI_lnode_t *node; ogs_free(lte_v2x_auth_1); } cJSON *OpenAPI_lte_v2x_auth_1_convertToJSON(OpenAPI_lte_v2x_auth_1_t *lte_v2x_auth_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (lte_v2x_auth_1 == NULL) { ogs_error("OpenAPI_lte_v2x_auth_1_convertToJSON() failed [LteV2xAuth_1]"); @@ -37,14 +39,14 @@ cJSON *OpenAPI_lte_v2x_auth_1_convertToJSON(OpenAPI_lte_v2x_auth_1_t *lte_v2x_au } item = cJSON_CreateObject(); - if (lte_v2x_auth_1->vehicle_ue_auth) { + if (lte_v2x_auth_1->vehicle_ue_auth != OpenAPI_ue_auth_NULL) { if (cJSON_AddStringToObject(item, "vehicleUeAuth", OpenAPI_ue_auth_ToString(lte_v2x_auth_1->vehicle_ue_auth)) == NULL) { ogs_error("OpenAPI_lte_v2x_auth_1_convertToJSON() failed [vehicle_ue_auth]"); goto end; } } - if (lte_v2x_auth_1->pedestrian_ue_auth) { + if (lte_v2x_auth_1->pedestrian_ue_auth != OpenAPI_ue_auth_NULL) { if (cJSON_AddStringToObject(item, "pedestrianUeAuth", OpenAPI_ue_auth_ToString(lte_v2x_auth_1->pedestrian_ue_auth)) == NULL) { ogs_error("OpenAPI_lte_v2x_auth_1_convertToJSON() failed [pedestrian_ue_auth]"); goto end; @@ -58,9 +60,12 @@ end: OpenAPI_lte_v2x_auth_1_t *OpenAPI_lte_v2x_auth_1_parseFromJSON(cJSON *lte_v2x_auth_1JSON) { OpenAPI_lte_v2x_auth_1_t *lte_v2x_auth_1_local_var = NULL; - cJSON *vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_auth_1JSON, "vehicleUeAuth"); - - OpenAPI_ue_auth_e vehicle_ue_authVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *vehicle_ue_auth = NULL; + OpenAPI_ue_auth_e vehicle_ue_authVariable = 0; + cJSON *pedestrian_ue_auth = NULL; + OpenAPI_ue_auth_e pedestrian_ue_authVariable = 0; + vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_auth_1JSON, "vehicleUeAuth"); if (vehicle_ue_auth) { if (!cJSON_IsString(vehicle_ue_auth)) { ogs_error("OpenAPI_lte_v2x_auth_1_parseFromJSON() failed [vehicle_ue_auth]"); @@ -69,9 +74,7 @@ OpenAPI_lte_v2x_auth_1_t *OpenAPI_lte_v2x_auth_1_parseFromJSON(cJSON *lte_v2x_au vehicle_ue_authVariable = OpenAPI_ue_auth_FromString(vehicle_ue_auth->valuestring); } - cJSON *pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_auth_1JSON, "pedestrianUeAuth"); - - OpenAPI_ue_auth_e pedestrian_ue_authVariable; + pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(lte_v2x_auth_1JSON, "pedestrianUeAuth"); if (pedestrian_ue_auth) { if (!cJSON_IsString(pedestrian_ue_auth)) { ogs_error("OpenAPI_lte_v2x_auth_1_parseFromJSON() failed [pedestrian_ue_auth]"); diff --git a/lib/sbi/openapi/model/mapping_of_snssai.c b/lib/sbi/openapi/model/mapping_of_snssai.c index 484b2cd20..a34cca526 100644 --- a/lib/sbi/openapi/model/mapping_of_snssai.c +++ b/lib/sbi/openapi/model/mapping_of_snssai.c @@ -20,18 +20,26 @@ OpenAPI_mapping_of_snssai_t *OpenAPI_mapping_of_snssai_create( void OpenAPI_mapping_of_snssai_free(OpenAPI_mapping_of_snssai_t *mapping_of_snssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == mapping_of_snssai) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(mapping_of_snssai->serving_snssai); - OpenAPI_snssai_free(mapping_of_snssai->home_snssai); + if (mapping_of_snssai->serving_snssai) { + OpenAPI_snssai_free(mapping_of_snssai->serving_snssai); + mapping_of_snssai->serving_snssai = NULL; + } + if (mapping_of_snssai->home_snssai) { + OpenAPI_snssai_free(mapping_of_snssai->home_snssai); + mapping_of_snssai->home_snssai = NULL; + } ogs_free(mapping_of_snssai); } cJSON *OpenAPI_mapping_of_snssai_convertToJSON(OpenAPI_mapping_of_snssai_t *mapping_of_snssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (mapping_of_snssai == NULL) { ogs_error("OpenAPI_mapping_of_snssai_convertToJSON() failed [MappingOfSnssai]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_mapping_of_snssai_convertToJSON(OpenAPI_mapping_of_snssai_t *mapp } item = cJSON_CreateObject(); + if (!mapping_of_snssai->serving_snssai) { + ogs_error("OpenAPI_mapping_of_snssai_convertToJSON() failed [serving_snssai]"); + return NULL; + } cJSON *serving_snssai_local_JSON = OpenAPI_snssai_convertToJSON(mapping_of_snssai->serving_snssai); if (serving_snssai_local_JSON == NULL) { ogs_error("OpenAPI_mapping_of_snssai_convertToJSON() failed [serving_snssai]"); @@ -50,6 +62,10 @@ cJSON *OpenAPI_mapping_of_snssai_convertToJSON(OpenAPI_mapping_of_snssai_t *mapp goto end; } + if (!mapping_of_snssai->home_snssai) { + ogs_error("OpenAPI_mapping_of_snssai_convertToJSON() failed [home_snssai]"); + return NULL; + } cJSON *home_snssai_local_JSON = OpenAPI_snssai_convertToJSON(mapping_of_snssai->home_snssai); if (home_snssai_local_JSON == NULL) { ogs_error("OpenAPI_mapping_of_snssai_convertToJSON() failed [home_snssai]"); @@ -68,22 +84,23 @@ end: OpenAPI_mapping_of_snssai_t *OpenAPI_mapping_of_snssai_parseFromJSON(cJSON *mapping_of_snssaiJSON) { OpenAPI_mapping_of_snssai_t *mapping_of_snssai_local_var = NULL; - cJSON *serving_snssai = cJSON_GetObjectItemCaseSensitive(mapping_of_snssaiJSON, "servingSnssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *serving_snssai = NULL; + OpenAPI_snssai_t *serving_snssai_local_nonprim = NULL; + cJSON *home_snssai = NULL; + OpenAPI_snssai_t *home_snssai_local_nonprim = NULL; + serving_snssai = cJSON_GetObjectItemCaseSensitive(mapping_of_snssaiJSON, "servingSnssai"); if (!serving_snssai) { ogs_error("OpenAPI_mapping_of_snssai_parseFromJSON() failed [serving_snssai]"); goto end; } - - OpenAPI_snssai_t *serving_snssai_local_nonprim = NULL; serving_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(serving_snssai); - cJSON *home_snssai = cJSON_GetObjectItemCaseSensitive(mapping_of_snssaiJSON, "homeSnssai"); + home_snssai = cJSON_GetObjectItemCaseSensitive(mapping_of_snssaiJSON, "homeSnssai"); if (!home_snssai) { ogs_error("OpenAPI_mapping_of_snssai_parseFromJSON() failed [home_snssai]"); goto end; } - - OpenAPI_snssai_t *home_snssai_local_nonprim = NULL; home_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(home_snssai); mapping_of_snssai_local_var = OpenAPI_mapping_of_snssai_create ( @@ -93,6 +110,14 @@ OpenAPI_mapping_of_snssai_t *OpenAPI_mapping_of_snssai_parseFromJSON(cJSON *mapp return mapping_of_snssai_local_var; end: + if (serving_snssai_local_nonprim) { + OpenAPI_snssai_free(serving_snssai_local_nonprim); + serving_snssai_local_nonprim = NULL; + } + if (home_snssai_local_nonprim) { + OpenAPI_snssai_free(home_snssai_local_nonprim); + home_snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/max_integrity_protected_data_rate.c b/lib/sbi/openapi/model/max_integrity_protected_data_rate.c index 76488f6fb..88b53b019 100644 --- a/lib/sbi/openapi/model/max_integrity_protected_data_rate.c +++ b/lib/sbi/openapi/model/max_integrity_protected_data_rate.c @@ -6,7 +6,7 @@ char* OpenAPI_max_integrity_protected_data_rate_ToString(OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate) { - const char *max_integrity_protected_data_rateArray[] = { "NULL", "_64_KBPS", "MAX_UE_RATE" }; + const char *max_integrity_protected_data_rateArray[] = { "NULL", "64_KBPS", "MAX_UE_RATE" }; size_t sizeofArray = sizeof(max_integrity_protected_data_rateArray) / sizeof(max_integrity_protected_data_rateArray[0]); if (max_integrity_protected_data_rate < sizeofArray) return (char *)max_integrity_protected_data_rateArray[max_integrity_protected_data_rate]; @@ -17,7 +17,7 @@ char* OpenAPI_max_integrity_protected_data_rate_ToString(OpenAPI_max_integrity_p OpenAPI_max_integrity_protected_data_rate_e OpenAPI_max_integrity_protected_data_rate_FromString(char* max_integrity_protected_data_rate) { int stringToReturn = 0; - const char *max_integrity_protected_data_rateArray[] = { "NULL", "_64_KBPS", "MAX_UE_RATE" }; + const char *max_integrity_protected_data_rateArray[] = { "NULL", "64_KBPS", "MAX_UE_RATE" }; size_t sizeofArray = sizeof(max_integrity_protected_data_rateArray) / sizeof(max_integrity_protected_data_rateArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(max_integrity_protected_data_rate, max_integrity_protected_data_rateArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/mbsfn_area.c b/lib/sbi/openapi/model/mbsfn_area.c index d3b3243f4..6c6facbfb 100644 --- a/lib/sbi/openapi/model/mbsfn_area.c +++ b/lib/sbi/openapi/model/mbsfn_area.c @@ -24,16 +24,18 @@ OpenAPI_mbsfn_area_t *OpenAPI_mbsfn_area_create( void OpenAPI_mbsfn_area_free(OpenAPI_mbsfn_area_t *mbsfn_area) { + OpenAPI_lnode_t *node = NULL; + if (NULL == mbsfn_area) { return; } - OpenAPI_lnode_t *node; ogs_free(mbsfn_area); } cJSON *OpenAPI_mbsfn_area_convertToJSON(OpenAPI_mbsfn_area_t *mbsfn_area) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (mbsfn_area == NULL) { ogs_error("OpenAPI_mbsfn_area_convertToJSON() failed [MbsfnArea]"); @@ -62,8 +64,10 @@ end: OpenAPI_mbsfn_area_t *OpenAPI_mbsfn_area_parseFromJSON(cJSON *mbsfn_areaJSON) { OpenAPI_mbsfn_area_t *mbsfn_area_local_var = NULL; - cJSON *mbsfn_area_id = cJSON_GetObjectItemCaseSensitive(mbsfn_areaJSON, "mbsfnAreaId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *mbsfn_area_id = NULL; + cJSON *carrier_frequency = NULL; + mbsfn_area_id = cJSON_GetObjectItemCaseSensitive(mbsfn_areaJSON, "mbsfnAreaId"); if (mbsfn_area_id) { if (!cJSON_IsNumber(mbsfn_area_id)) { ogs_error("OpenAPI_mbsfn_area_parseFromJSON() failed [mbsfn_area_id]"); @@ -71,8 +75,7 @@ OpenAPI_mbsfn_area_t *OpenAPI_mbsfn_area_parseFromJSON(cJSON *mbsfn_areaJSON) } } - cJSON *carrier_frequency = cJSON_GetObjectItemCaseSensitive(mbsfn_areaJSON, "carrierFrequency"); - + carrier_frequency = cJSON_GetObjectItemCaseSensitive(mbsfn_areaJSON, "carrierFrequency"); if (carrier_frequency) { if (!cJSON_IsNumber(carrier_frequency)) { ogs_error("OpenAPI_mbsfn_area_parseFromJSON() failed [carrier_frequency]"); diff --git a/lib/sbi/openapi/model/mdt_configuration.c b/lib/sbi/openapi/model/mdt_configuration.c index 7e2c38800..41eb35c0a 100644 --- a/lib/sbi/openapi/model/mdt_configuration.c +++ b/lib/sbi/openapi/model/mdt_configuration.c @@ -78,35 +78,67 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_create( void OpenAPI_mdt_configuration_free(OpenAPI_mdt_configuration_t *mdt_configuration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == mdt_configuration) { return; } - OpenAPI_lnode_t *node; - OpenAPI_area_scope_free(mdt_configuration->area_scope); - OpenAPI_list_free(mdt_configuration->measurement_lte_list); - OpenAPI_list_free(mdt_configuration->measurement_nr_list); - OpenAPI_list_free(mdt_configuration->sensor_measurement_list); - OpenAPI_list_free(mdt_configuration->reporting_trigger_list); - OpenAPI_list_free(mdt_configuration->event_list); - OpenAPI_list_free(mdt_configuration->add_positioning_method_list); - OpenAPI_list_for_each(mdt_configuration->mdt_allowed_plmn_id_list, node) { - OpenAPI_plmn_id_free(node->data); + if (mdt_configuration->area_scope) { + OpenAPI_area_scope_free(mdt_configuration->area_scope); + mdt_configuration->area_scope = NULL; } - OpenAPI_list_free(mdt_configuration->mdt_allowed_plmn_id_list); - OpenAPI_list_for_each(mdt_configuration->mbsfn_area_list, node) { - OpenAPI_mbsfn_area_free(node->data); + if (mdt_configuration->measurement_lte_list) { + OpenAPI_list_free(mdt_configuration->measurement_lte_list); + mdt_configuration->measurement_lte_list = NULL; } - OpenAPI_list_free(mdt_configuration->mbsfn_area_list); - OpenAPI_list_for_each(mdt_configuration->inter_freq_target_list, node) { - OpenAPI_inter_freq_target_info_free(node->data); + if (mdt_configuration->measurement_nr_list) { + OpenAPI_list_free(mdt_configuration->measurement_nr_list); + mdt_configuration->measurement_nr_list = NULL; + } + if (mdt_configuration->sensor_measurement_list) { + OpenAPI_list_free(mdt_configuration->sensor_measurement_list); + mdt_configuration->sensor_measurement_list = NULL; + } + if (mdt_configuration->reporting_trigger_list) { + OpenAPI_list_free(mdt_configuration->reporting_trigger_list); + mdt_configuration->reporting_trigger_list = NULL; + } + if (mdt_configuration->event_list) { + OpenAPI_list_free(mdt_configuration->event_list); + mdt_configuration->event_list = NULL; + } + if (mdt_configuration->add_positioning_method_list) { + OpenAPI_list_free(mdt_configuration->add_positioning_method_list); + mdt_configuration->add_positioning_method_list = NULL; + } + if (mdt_configuration->mdt_allowed_plmn_id_list) { + OpenAPI_list_for_each(mdt_configuration->mdt_allowed_plmn_id_list, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(mdt_configuration->mdt_allowed_plmn_id_list); + mdt_configuration->mdt_allowed_plmn_id_list = NULL; + } + if (mdt_configuration->mbsfn_area_list) { + OpenAPI_list_for_each(mdt_configuration->mbsfn_area_list, node) { + OpenAPI_mbsfn_area_free(node->data); + } + OpenAPI_list_free(mdt_configuration->mbsfn_area_list); + mdt_configuration->mbsfn_area_list = NULL; + } + if (mdt_configuration->inter_freq_target_list) { + OpenAPI_list_for_each(mdt_configuration->inter_freq_target_list, node) { + OpenAPI_inter_freq_target_info_free(node->data); + } + OpenAPI_list_free(mdt_configuration->inter_freq_target_list); + mdt_configuration->inter_freq_target_list = NULL; } - OpenAPI_list_free(mdt_configuration->inter_freq_target_list); ogs_free(mdt_configuration); } cJSON *OpenAPI_mdt_configuration_convertToJSON(OpenAPI_mdt_configuration_t *mdt_configuration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (mdt_configuration == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [MdtConfiguration]"); @@ -114,12 +146,16 @@ cJSON *OpenAPI_mdt_configuration_convertToJSON(OpenAPI_mdt_configuration_t *mdt_ } item = cJSON_CreateObject(); + if (mdt_configuration->job_type == OpenAPI_job_type_NULL) { + ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [job_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "jobType", OpenAPI_job_type_ToString(mdt_configuration->job_type)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [job_type]"); goto end; } - if (mdt_configuration->report_type) { + if (mdt_configuration->report_type != OpenAPI_report_type_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportType", OpenAPI_report_type_mdt_ToString(mdt_configuration->report_type)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [report_type]"); goto end; @@ -139,81 +175,77 @@ cJSON *OpenAPI_mdt_configuration_convertToJSON(OpenAPI_mdt_configuration_t *mdt_ } } - if (mdt_configuration->measurement_lte_list) { - cJSON *measurement_lte_list = cJSON_AddArrayToObject(item, "measurementLteList"); - if (measurement_lte_list == NULL) { + if (mdt_configuration->measurement_lte_list != OpenAPI_measurement_lte_for_mdt_NULL) { + cJSON *measurement_lte_listList = cJSON_AddArrayToObject(item, "measurementLteList"); + if (measurement_lte_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [measurement_lte_list]"); goto end; } - OpenAPI_lnode_t *measurement_lte_list_node; - OpenAPI_list_for_each(mdt_configuration->measurement_lte_list, measurement_lte_list_node) { - if (cJSON_AddStringToObject(measurement_lte_list, "", OpenAPI_measurement_lte_for_mdt_ToString((intptr_t)measurement_lte_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration->measurement_lte_list, node) { + if (cJSON_AddStringToObject(measurement_lte_listList, "", OpenAPI_measurement_lte_for_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [measurement_lte_list]"); goto end; } } } - if (mdt_configuration->measurement_nr_list) { - cJSON *measurement_nr_list = cJSON_AddArrayToObject(item, "measurementNrList"); - if (measurement_nr_list == NULL) { + if (mdt_configuration->measurement_nr_list != OpenAPI_measurement_nr_for_mdt_NULL) { + cJSON *measurement_nr_listList = cJSON_AddArrayToObject(item, "measurementNrList"); + if (measurement_nr_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [measurement_nr_list]"); goto end; } - OpenAPI_lnode_t *measurement_nr_list_node; - OpenAPI_list_for_each(mdt_configuration->measurement_nr_list, measurement_nr_list_node) { - if (cJSON_AddStringToObject(measurement_nr_list, "", OpenAPI_measurement_nr_for_mdt_ToString((intptr_t)measurement_nr_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration->measurement_nr_list, node) { + if (cJSON_AddStringToObject(measurement_nr_listList, "", OpenAPI_measurement_nr_for_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [measurement_nr_list]"); goto end; } } } - if (mdt_configuration->sensor_measurement_list) { - cJSON *sensor_measurement_list = cJSON_AddArrayToObject(item, "sensorMeasurementList"); - if (sensor_measurement_list == NULL) { + if (mdt_configuration->sensor_measurement_list != OpenAPI_sensor_measurement_NULL) { + cJSON *sensor_measurement_listList = cJSON_AddArrayToObject(item, "sensorMeasurementList"); + if (sensor_measurement_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [sensor_measurement_list]"); goto end; } - OpenAPI_lnode_t *sensor_measurement_list_node; - OpenAPI_list_for_each(mdt_configuration->sensor_measurement_list, sensor_measurement_list_node) { - if (cJSON_AddStringToObject(sensor_measurement_list, "", OpenAPI_sensor_measurement_ToString((intptr_t)sensor_measurement_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration->sensor_measurement_list, node) { + if (cJSON_AddStringToObject(sensor_measurement_listList, "", OpenAPI_sensor_measurement_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [sensor_measurement_list]"); goto end; } } } - if (mdt_configuration->reporting_trigger_list) { - cJSON *reporting_trigger_list = cJSON_AddArrayToObject(item, "reportingTriggerList"); - if (reporting_trigger_list == NULL) { + if (mdt_configuration->reporting_trigger_list != OpenAPI_reporting_trigger_NULL) { + cJSON *reporting_trigger_listList = cJSON_AddArrayToObject(item, "reportingTriggerList"); + if (reporting_trigger_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [reporting_trigger_list]"); goto end; } - OpenAPI_lnode_t *reporting_trigger_list_node; - OpenAPI_list_for_each(mdt_configuration->reporting_trigger_list, reporting_trigger_list_node) { - if (cJSON_AddStringToObject(reporting_trigger_list, "", OpenAPI_reporting_trigger_ToString((intptr_t)reporting_trigger_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration->reporting_trigger_list, node) { + if (cJSON_AddStringToObject(reporting_trigger_listList, "", OpenAPI_reporting_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [reporting_trigger_list]"); goto end; } } } - if (mdt_configuration->report_interval) { + if (mdt_configuration->report_interval != OpenAPI_report_interval_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportInterval", OpenAPI_report_interval_mdt_ToString(mdt_configuration->report_interval)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [report_interval]"); goto end; } } - if (mdt_configuration->report_interval_nr) { + if (mdt_configuration->report_interval_nr != OpenAPI_report_interval_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportIntervalNr", OpenAPI_report_interval_nr_mdt_ToString(mdt_configuration->report_interval_nr)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [report_interval_nr]"); goto end; } } - if (mdt_configuration->report_amount) { + if (mdt_configuration->report_amount != OpenAPI_report_amount_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportAmount", OpenAPI_report_amount_mdt_ToString(mdt_configuration->report_amount)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [report_amount]"); goto end; @@ -248,86 +280,84 @@ cJSON *OpenAPI_mdt_configuration_convertToJSON(OpenAPI_mdt_configuration_t *mdt_ } } - if (mdt_configuration->event_list) { - cJSON *event_list = cJSON_AddArrayToObject(item, "eventList"); - if (event_list == NULL) { + if (mdt_configuration->event_list != OpenAPI_event_for_mdt_NULL) { + cJSON *event_listList = cJSON_AddArrayToObject(item, "eventList"); + if (event_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [event_list]"); goto end; } - OpenAPI_lnode_t *event_list_node; - OpenAPI_list_for_each(mdt_configuration->event_list, event_list_node) { - if (cJSON_AddStringToObject(event_list, "", OpenAPI_event_for_mdt_ToString((intptr_t)event_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration->event_list, node) { + if (cJSON_AddStringToObject(event_listList, "", OpenAPI_event_for_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [event_list]"); goto end; } } } - if (mdt_configuration->logging_interval) { + if (mdt_configuration->logging_interval != OpenAPI_logging_interval_mdt_NULL) { if (cJSON_AddStringToObject(item, "loggingInterval", OpenAPI_logging_interval_mdt_ToString(mdt_configuration->logging_interval)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [logging_interval]"); goto end; } } - if (mdt_configuration->logging_interval_nr) { + if (mdt_configuration->logging_interval_nr != OpenAPI_logging_interval_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "loggingIntervalNr", OpenAPI_logging_interval_nr_mdt_ToString(mdt_configuration->logging_interval_nr)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [logging_interval_nr]"); goto end; } } - if (mdt_configuration->logging_duration) { + if (mdt_configuration->logging_duration != OpenAPI_logging_duration_mdt_NULL) { if (cJSON_AddStringToObject(item, "loggingDuration", OpenAPI_logging_duration_mdt_ToString(mdt_configuration->logging_duration)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [logging_duration]"); goto end; } } - if (mdt_configuration->logging_duration_nr) { + if (mdt_configuration->logging_duration_nr != OpenAPI_logging_duration_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "loggingDurationNr", OpenAPI_logging_duration_nr_mdt_ToString(mdt_configuration->logging_duration_nr)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [logging_duration_nr]"); goto end; } } - if (mdt_configuration->positioning_method) { + if (mdt_configuration->positioning_method != OpenAPI_positioning_method_mdt_NULL) { if (cJSON_AddStringToObject(item, "positioningMethod", OpenAPI_positioning_method_mdt_ToString(mdt_configuration->positioning_method)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [positioning_method]"); goto end; } } - if (mdt_configuration->add_positioning_method_list) { - cJSON *add_positioning_method_list = cJSON_AddArrayToObject(item, "addPositioningMethodList"); - if (add_positioning_method_list == NULL) { + if (mdt_configuration->add_positioning_method_list != OpenAPI_positioning_method_mdt_NULL) { + cJSON *add_positioning_method_listList = cJSON_AddArrayToObject(item, "addPositioningMethodList"); + if (add_positioning_method_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [add_positioning_method_list]"); goto end; } - OpenAPI_lnode_t *add_positioning_method_list_node; - OpenAPI_list_for_each(mdt_configuration->add_positioning_method_list, add_positioning_method_list_node) { - if (cJSON_AddStringToObject(add_positioning_method_list, "", OpenAPI_positioning_method_mdt_ToString((intptr_t)add_positioning_method_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration->add_positioning_method_list, node) { + if (cJSON_AddStringToObject(add_positioning_method_listList, "", OpenAPI_positioning_method_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [add_positioning_method_list]"); goto end; } } } - if (mdt_configuration->collection_period_rmm_lte) { + if (mdt_configuration->collection_period_rmm_lte != OpenAPI_collection_period_rmm_lte_mdt_NULL) { if (cJSON_AddStringToObject(item, "collectionPeriodRmmLte", OpenAPI_collection_period_rmm_lte_mdt_ToString(mdt_configuration->collection_period_rmm_lte)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [collection_period_rmm_lte]"); goto end; } } - if (mdt_configuration->collection_period_rmm_nr) { + if (mdt_configuration->collection_period_rmm_nr != OpenAPI_collection_period_rmm_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "collectionPeriodRmmNr", OpenAPI_collection_period_rmm_nr_mdt_ToString(mdt_configuration->collection_period_rmm_nr)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [collection_period_rmm_nr]"); goto end; } } - if (mdt_configuration->measurement_period_lte) { + if (mdt_configuration->measurement_period_lte != OpenAPI_measurement_period_lte_mdt_NULL) { if (cJSON_AddStringToObject(item, "measurementPeriodLte", OpenAPI_measurement_period_lte_mdt_ToString(mdt_configuration->measurement_period_lte)) == NULL) { ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [measurement_period_lte]"); goto end; @@ -340,17 +370,13 @@ cJSON *OpenAPI_mdt_configuration_convertToJSON(OpenAPI_mdt_configuration_t *mdt_ ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [mdt_allowed_plmn_id_list]"); goto end; } - - OpenAPI_lnode_t *mdt_allowed_plmn_id_list_node; - if (mdt_configuration->mdt_allowed_plmn_id_list) { - OpenAPI_list_for_each(mdt_configuration->mdt_allowed_plmn_id_list, mdt_allowed_plmn_id_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(mdt_allowed_plmn_id_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [mdt_allowed_plmn_id_list]"); - goto end; - } - cJSON_AddItemToArray(mdt_allowed_plmn_id_listList, itemLocal); + OpenAPI_list_for_each(mdt_configuration->mdt_allowed_plmn_id_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [mdt_allowed_plmn_id_list]"); + goto end; } + cJSON_AddItemToArray(mdt_allowed_plmn_id_listList, itemLocal); } } @@ -360,17 +386,13 @@ cJSON *OpenAPI_mdt_configuration_convertToJSON(OpenAPI_mdt_configuration_t *mdt_ ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [mbsfn_area_list]"); goto end; } - - OpenAPI_lnode_t *mbsfn_area_list_node; - if (mdt_configuration->mbsfn_area_list) { - OpenAPI_list_for_each(mdt_configuration->mbsfn_area_list, mbsfn_area_list_node) { - cJSON *itemLocal = OpenAPI_mbsfn_area_convertToJSON(mbsfn_area_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [mbsfn_area_list]"); - goto end; - } - cJSON_AddItemToArray(mbsfn_area_listList, itemLocal); + OpenAPI_list_for_each(mdt_configuration->mbsfn_area_list, node) { + cJSON *itemLocal = OpenAPI_mbsfn_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [mbsfn_area_list]"); + goto end; } + cJSON_AddItemToArray(mbsfn_area_listList, itemLocal); } } @@ -380,17 +402,13 @@ cJSON *OpenAPI_mdt_configuration_convertToJSON(OpenAPI_mdt_configuration_t *mdt_ ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [inter_freq_target_list]"); goto end; } - - OpenAPI_lnode_t *inter_freq_target_list_node; - if (mdt_configuration->inter_freq_target_list) { - OpenAPI_list_for_each(mdt_configuration->inter_freq_target_list, inter_freq_target_list_node) { - cJSON *itemLocal = OpenAPI_inter_freq_target_info_convertToJSON(inter_freq_target_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [inter_freq_target_list]"); - goto end; - } - cJSON_AddItemToArray(inter_freq_target_listList, itemLocal); + OpenAPI_list_for_each(mdt_configuration->inter_freq_target_list, node) { + cJSON *itemLocal = OpenAPI_inter_freq_target_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mdt_configuration_convertToJSON() failed [inter_freq_target_list]"); + goto end; } + cJSON_AddItemToArray(inter_freq_target_listList, itemLocal); } } @@ -401,22 +419,69 @@ end: OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_configurationJSON) { OpenAPI_mdt_configuration_t *mdt_configuration_local_var = NULL; - cJSON *job_type = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "jobType"); + OpenAPI_lnode_t *node = NULL; + cJSON *job_type = NULL; + OpenAPI_job_type_e job_typeVariable = 0; + cJSON *report_type = NULL; + OpenAPI_report_type_mdt_e report_typeVariable = 0; + cJSON *area_scope = NULL; + OpenAPI_area_scope_t *area_scope_local_nonprim = NULL; + cJSON *measurement_lte_list = NULL; + OpenAPI_list_t *measurement_lte_listList = NULL; + cJSON *measurement_nr_list = NULL; + OpenAPI_list_t *measurement_nr_listList = NULL; + cJSON *sensor_measurement_list = NULL; + OpenAPI_list_t *sensor_measurement_listList = NULL; + cJSON *reporting_trigger_list = NULL; + OpenAPI_list_t *reporting_trigger_listList = NULL; + cJSON *report_interval = NULL; + OpenAPI_report_interval_mdt_e report_intervalVariable = 0; + cJSON *report_interval_nr = NULL; + OpenAPI_report_interval_nr_mdt_e report_interval_nrVariable = 0; + cJSON *report_amount = NULL; + OpenAPI_report_amount_mdt_e report_amountVariable = 0; + cJSON *event_threshold_rsrp = NULL; + cJSON *event_threshold_rsrp_nr = NULL; + cJSON *event_threshold_rsrq = NULL; + cJSON *event_threshold_rsrq_nr = NULL; + cJSON *event_list = NULL; + OpenAPI_list_t *event_listList = NULL; + cJSON *logging_interval = NULL; + OpenAPI_logging_interval_mdt_e logging_intervalVariable = 0; + cJSON *logging_interval_nr = NULL; + OpenAPI_logging_interval_nr_mdt_e logging_interval_nrVariable = 0; + cJSON *logging_duration = NULL; + OpenAPI_logging_duration_mdt_e logging_durationVariable = 0; + cJSON *logging_duration_nr = NULL; + OpenAPI_logging_duration_nr_mdt_e logging_duration_nrVariable = 0; + cJSON *positioning_method = NULL; + OpenAPI_positioning_method_mdt_e positioning_methodVariable = 0; + cJSON *add_positioning_method_list = NULL; + OpenAPI_list_t *add_positioning_method_listList = NULL; + cJSON *collection_period_rmm_lte = NULL; + OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lteVariable = 0; + cJSON *collection_period_rmm_nr = NULL; + OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nrVariable = 0; + cJSON *measurement_period_lte = NULL; + OpenAPI_measurement_period_lte_mdt_e measurement_period_lteVariable = 0; + cJSON *mdt_allowed_plmn_id_list = NULL; + OpenAPI_list_t *mdt_allowed_plmn_id_listList = NULL; + cJSON *mbsfn_area_list = NULL; + OpenAPI_list_t *mbsfn_area_listList = NULL; + cJSON *inter_freq_target_list = NULL; + OpenAPI_list_t *inter_freq_target_listList = NULL; + job_type = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "jobType"); if (!job_type) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [job_type]"); goto end; } - - OpenAPI_job_type_e job_typeVariable; if (!cJSON_IsString(job_type)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [job_type]"); goto end; } job_typeVariable = OpenAPI_job_type_FromString(job_type->valuestring); - cJSON *report_type = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportType"); - - OpenAPI_report_type_mdt_e report_typeVariable; + report_type = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportType"); if (report_type) { if (!cJSON_IsString(report_type)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [report_type]"); @@ -425,104 +490,88 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ report_typeVariable = OpenAPI_report_type_mdt_FromString(report_type->valuestring); } - cJSON *area_scope = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "areaScope"); - - OpenAPI_area_scope_t *area_scope_local_nonprim = NULL; + area_scope = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "areaScope"); if (area_scope) { area_scope_local_nonprim = OpenAPI_area_scope_parseFromJSON(area_scope); } - cJSON *measurement_lte_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "measurementLteList"); - - OpenAPI_list_t *measurement_lte_listList; + measurement_lte_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "measurementLteList"); if (measurement_lte_list) { - cJSON *measurement_lte_list_local_nonprimitive; - if (!cJSON_IsArray(measurement_lte_list)) { - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [measurement_lte_list]"); - goto end; - } - - measurement_lte_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(measurement_lte_list_local_nonprimitive, measurement_lte_list ) { - if (!cJSON_IsString(measurement_lte_list_local_nonprimitive)){ + cJSON *measurement_lte_list_local = NULL; + if (!cJSON_IsArray(measurement_lte_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [measurement_lte_list]"); goto end; } - OpenAPI_list_add(measurement_lte_listList, (void *)OpenAPI_measurement_lte_for_mdt_FromString(measurement_lte_list_local_nonprimitive->valuestring)); - } + measurement_lte_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(measurement_lte_list_local, measurement_lte_list) { + if (!cJSON_IsString(measurement_lte_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [measurement_lte_list]"); + goto end; + } + OpenAPI_list_add(measurement_lte_listList, (void *)OpenAPI_measurement_lte_for_mdt_FromString(measurement_lte_list_local->valuestring)); + } } - cJSON *measurement_nr_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "measurementNrList"); - - OpenAPI_list_t *measurement_nr_listList; + measurement_nr_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "measurementNrList"); if (measurement_nr_list) { - cJSON *measurement_nr_list_local_nonprimitive; - if (!cJSON_IsArray(measurement_nr_list)) { - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [measurement_nr_list]"); - goto end; - } - - measurement_nr_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(measurement_nr_list_local_nonprimitive, measurement_nr_list ) { - if (!cJSON_IsString(measurement_nr_list_local_nonprimitive)){ + cJSON *measurement_nr_list_local = NULL; + if (!cJSON_IsArray(measurement_nr_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [measurement_nr_list]"); goto end; } - OpenAPI_list_add(measurement_nr_listList, (void *)OpenAPI_measurement_nr_for_mdt_FromString(measurement_nr_list_local_nonprimitive->valuestring)); - } + measurement_nr_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(measurement_nr_list_local, measurement_nr_list) { + if (!cJSON_IsString(measurement_nr_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [measurement_nr_list]"); + goto end; + } + OpenAPI_list_add(measurement_nr_listList, (void *)OpenAPI_measurement_nr_for_mdt_FromString(measurement_nr_list_local->valuestring)); + } } - cJSON *sensor_measurement_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "sensorMeasurementList"); - - OpenAPI_list_t *sensor_measurement_listList; + sensor_measurement_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "sensorMeasurementList"); if (sensor_measurement_list) { - cJSON *sensor_measurement_list_local_nonprimitive; - if (!cJSON_IsArray(sensor_measurement_list)) { - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [sensor_measurement_list]"); - goto end; - } - - sensor_measurement_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sensor_measurement_list_local_nonprimitive, sensor_measurement_list ) { - if (!cJSON_IsString(sensor_measurement_list_local_nonprimitive)){ + cJSON *sensor_measurement_list_local = NULL; + if (!cJSON_IsArray(sensor_measurement_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [sensor_measurement_list]"); goto end; } - OpenAPI_list_add(sensor_measurement_listList, (void *)OpenAPI_sensor_measurement_FromString(sensor_measurement_list_local_nonprimitive->valuestring)); - } + sensor_measurement_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sensor_measurement_list_local, sensor_measurement_list) { + if (!cJSON_IsString(sensor_measurement_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [sensor_measurement_list]"); + goto end; + } + OpenAPI_list_add(sensor_measurement_listList, (void *)OpenAPI_sensor_measurement_FromString(sensor_measurement_list_local->valuestring)); + } } - cJSON *reporting_trigger_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportingTriggerList"); - - OpenAPI_list_t *reporting_trigger_listList; + reporting_trigger_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportingTriggerList"); if (reporting_trigger_list) { - cJSON *reporting_trigger_list_local_nonprimitive; - if (!cJSON_IsArray(reporting_trigger_list)) { - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [reporting_trigger_list]"); - goto end; - } - - reporting_trigger_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(reporting_trigger_list_local_nonprimitive, reporting_trigger_list ) { - if (!cJSON_IsString(reporting_trigger_list_local_nonprimitive)){ + cJSON *reporting_trigger_list_local = NULL; + if (!cJSON_IsArray(reporting_trigger_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [reporting_trigger_list]"); goto end; } - OpenAPI_list_add(reporting_trigger_listList, (void *)OpenAPI_reporting_trigger_FromString(reporting_trigger_list_local_nonprimitive->valuestring)); - } + reporting_trigger_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(reporting_trigger_list_local, reporting_trigger_list) { + if (!cJSON_IsString(reporting_trigger_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [reporting_trigger_list]"); + goto end; + } + OpenAPI_list_add(reporting_trigger_listList, (void *)OpenAPI_reporting_trigger_FromString(reporting_trigger_list_local->valuestring)); + } } - cJSON *report_interval = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportInterval"); - - OpenAPI_report_interval_mdt_e report_intervalVariable; + report_interval = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportInterval"); if (report_interval) { if (!cJSON_IsString(report_interval)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [report_interval]"); @@ -531,9 +580,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ report_intervalVariable = OpenAPI_report_interval_mdt_FromString(report_interval->valuestring); } - cJSON *report_interval_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportIntervalNr"); - - OpenAPI_report_interval_nr_mdt_e report_interval_nrVariable; + report_interval_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportIntervalNr"); if (report_interval_nr) { if (!cJSON_IsString(report_interval_nr)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [report_interval_nr]"); @@ -542,9 +589,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ report_interval_nrVariable = OpenAPI_report_interval_nr_mdt_FromString(report_interval_nr->valuestring); } - cJSON *report_amount = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportAmount"); - - OpenAPI_report_amount_mdt_e report_amountVariable; + report_amount = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "reportAmount"); if (report_amount) { if (!cJSON_IsString(report_amount)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [report_amount]"); @@ -553,8 +598,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ report_amountVariable = OpenAPI_report_amount_mdt_FromString(report_amount->valuestring); } - cJSON *event_threshold_rsrp = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventThresholdRsrp"); - + event_threshold_rsrp = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventThresholdRsrp"); if (event_threshold_rsrp) { if (!cJSON_IsNumber(event_threshold_rsrp)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [event_threshold_rsrp]"); @@ -562,8 +606,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ } } - cJSON *event_threshold_rsrp_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventThresholdRsrpNr"); - + event_threshold_rsrp_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventThresholdRsrpNr"); if (event_threshold_rsrp_nr) { if (!cJSON_IsNumber(event_threshold_rsrp_nr)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [event_threshold_rsrp_nr]"); @@ -571,8 +614,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ } } - cJSON *event_threshold_rsrq = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventThresholdRsrq"); - + event_threshold_rsrq = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventThresholdRsrq"); if (event_threshold_rsrq) { if (!cJSON_IsNumber(event_threshold_rsrq)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [event_threshold_rsrq]"); @@ -580,8 +622,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ } } - cJSON *event_threshold_rsrq_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventThresholdRsrqNr"); - + event_threshold_rsrq_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventThresholdRsrqNr"); if (event_threshold_rsrq_nr) { if (!cJSON_IsNumber(event_threshold_rsrq_nr)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [event_threshold_rsrq_nr]"); @@ -589,31 +630,26 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ } } - cJSON *event_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventList"); - - OpenAPI_list_t *event_listList; + event_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "eventList"); if (event_list) { - cJSON *event_list_local_nonprimitive; - if (!cJSON_IsArray(event_list)) { - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [event_list]"); - goto end; - } - - event_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(event_list_local_nonprimitive, event_list ) { - if (!cJSON_IsString(event_list_local_nonprimitive)){ + cJSON *event_list_local = NULL; + if (!cJSON_IsArray(event_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [event_list]"); goto end; } - OpenAPI_list_add(event_listList, (void *)OpenAPI_event_for_mdt_FromString(event_list_local_nonprimitive->valuestring)); - } + event_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(event_list_local, event_list) { + if (!cJSON_IsString(event_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [event_list]"); + goto end; + } + OpenAPI_list_add(event_listList, (void *)OpenAPI_event_for_mdt_FromString(event_list_local->valuestring)); + } } - cJSON *logging_interval = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "loggingInterval"); - - OpenAPI_logging_interval_mdt_e logging_intervalVariable; + logging_interval = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "loggingInterval"); if (logging_interval) { if (!cJSON_IsString(logging_interval)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [logging_interval]"); @@ -622,9 +658,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ logging_intervalVariable = OpenAPI_logging_interval_mdt_FromString(logging_interval->valuestring); } - cJSON *logging_interval_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "loggingIntervalNr"); - - OpenAPI_logging_interval_nr_mdt_e logging_interval_nrVariable; + logging_interval_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "loggingIntervalNr"); if (logging_interval_nr) { if (!cJSON_IsString(logging_interval_nr)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [logging_interval_nr]"); @@ -633,9 +667,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ logging_interval_nrVariable = OpenAPI_logging_interval_nr_mdt_FromString(logging_interval_nr->valuestring); } - cJSON *logging_duration = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "loggingDuration"); - - OpenAPI_logging_duration_mdt_e logging_durationVariable; + logging_duration = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "loggingDuration"); if (logging_duration) { if (!cJSON_IsString(logging_duration)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [logging_duration]"); @@ -644,9 +676,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ logging_durationVariable = OpenAPI_logging_duration_mdt_FromString(logging_duration->valuestring); } - cJSON *logging_duration_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "loggingDurationNr"); - - OpenAPI_logging_duration_nr_mdt_e logging_duration_nrVariable; + logging_duration_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "loggingDurationNr"); if (logging_duration_nr) { if (!cJSON_IsString(logging_duration_nr)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [logging_duration_nr]"); @@ -655,9 +685,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ logging_duration_nrVariable = OpenAPI_logging_duration_nr_mdt_FromString(logging_duration_nr->valuestring); } - cJSON *positioning_method = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "positioningMethod"); - - OpenAPI_positioning_method_mdt_e positioning_methodVariable; + positioning_method = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "positioningMethod"); if (positioning_method) { if (!cJSON_IsString(positioning_method)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [positioning_method]"); @@ -666,31 +694,26 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ positioning_methodVariable = OpenAPI_positioning_method_mdt_FromString(positioning_method->valuestring); } - cJSON *add_positioning_method_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "addPositioningMethodList"); - - OpenAPI_list_t *add_positioning_method_listList; + add_positioning_method_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "addPositioningMethodList"); if (add_positioning_method_list) { - cJSON *add_positioning_method_list_local_nonprimitive; - if (!cJSON_IsArray(add_positioning_method_list)) { - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [add_positioning_method_list]"); - goto end; - } - - add_positioning_method_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(add_positioning_method_list_local_nonprimitive, add_positioning_method_list ) { - if (!cJSON_IsString(add_positioning_method_list_local_nonprimitive)){ + cJSON *add_positioning_method_list_local = NULL; + if (!cJSON_IsArray(add_positioning_method_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [add_positioning_method_list]"); goto end; } - OpenAPI_list_add(add_positioning_method_listList, (void *)OpenAPI_positioning_method_mdt_FromString(add_positioning_method_list_local_nonprimitive->valuestring)); - } + add_positioning_method_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_positioning_method_list_local, add_positioning_method_list) { + if (!cJSON_IsString(add_positioning_method_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [add_positioning_method_list]"); + goto end; + } + OpenAPI_list_add(add_positioning_method_listList, (void *)OpenAPI_positioning_method_mdt_FromString(add_positioning_method_list_local->valuestring)); + } } - cJSON *collection_period_rmm_lte = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "collectionPeriodRmmLte"); - - OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lteVariable; + collection_period_rmm_lte = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "collectionPeriodRmmLte"); if (collection_period_rmm_lte) { if (!cJSON_IsString(collection_period_rmm_lte)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [collection_period_rmm_lte]"); @@ -699,9 +722,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ collection_period_rmm_lteVariable = OpenAPI_collection_period_rmm_lte_mdt_FromString(collection_period_rmm_lte->valuestring); } - cJSON *collection_period_rmm_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "collectionPeriodRmmNr"); - - OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nrVariable; + collection_period_rmm_nr = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "collectionPeriodRmmNr"); if (collection_period_rmm_nr) { if (!cJSON_IsString(collection_period_rmm_nr)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [collection_period_rmm_nr]"); @@ -710,9 +731,7 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ collection_period_rmm_nrVariable = OpenAPI_collection_period_rmm_nr_mdt_FromString(collection_period_rmm_nr->valuestring); } - cJSON *measurement_period_lte = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "measurementPeriodLte"); - - OpenAPI_measurement_period_lte_mdt_e measurement_period_lteVariable; + measurement_period_lte = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "measurementPeriodLte"); if (measurement_period_lte) { if (!cJSON_IsString(measurement_period_lte)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [measurement_period_lte]"); @@ -721,91 +740,79 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ measurement_period_lteVariable = OpenAPI_measurement_period_lte_mdt_FromString(measurement_period_lte->valuestring); } - cJSON *mdt_allowed_plmn_id_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "mdtAllowedPlmnIdList"); - - OpenAPI_list_t *mdt_allowed_plmn_id_listList; + mdt_allowed_plmn_id_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "mdtAllowedPlmnIdList"); if (mdt_allowed_plmn_id_list) { - cJSON *mdt_allowed_plmn_id_list_local_nonprimitive; - if (!cJSON_IsArray(mdt_allowed_plmn_id_list)){ - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); - goto end; - } - - mdt_allowed_plmn_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mdt_allowed_plmn_id_list_local_nonprimitive, mdt_allowed_plmn_id_list ) { - if (!cJSON_IsObject(mdt_allowed_plmn_id_list_local_nonprimitive)) { + cJSON *mdt_allowed_plmn_id_list_local = NULL; + if (!cJSON_IsArray(mdt_allowed_plmn_id_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); goto end; } - OpenAPI_plmn_id_t *mdt_allowed_plmn_id_listItem = OpenAPI_plmn_id_parseFromJSON(mdt_allowed_plmn_id_list_local_nonprimitive); - if (!mdt_allowed_plmn_id_listItem) { - ogs_error("No mdt_allowed_plmn_id_listItem"); - OpenAPI_list_free(mdt_allowed_plmn_id_listList); - goto end; + mdt_allowed_plmn_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mdt_allowed_plmn_id_list_local, mdt_allowed_plmn_id_list) { + if (!cJSON_IsObject(mdt_allowed_plmn_id_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); + goto end; + } + OpenAPI_plmn_id_t *mdt_allowed_plmn_id_listItem = OpenAPI_plmn_id_parseFromJSON(mdt_allowed_plmn_id_list_local); + if (!mdt_allowed_plmn_id_listItem) { + ogs_error("No mdt_allowed_plmn_id_listItem"); + OpenAPI_list_free(mdt_allowed_plmn_id_listList); + goto end; + } + OpenAPI_list_add(mdt_allowed_plmn_id_listList, mdt_allowed_plmn_id_listItem); } - - OpenAPI_list_add(mdt_allowed_plmn_id_listList, mdt_allowed_plmn_id_listItem); - } } - cJSON *mbsfn_area_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "mbsfnAreaList"); - - OpenAPI_list_t *mbsfn_area_listList; + mbsfn_area_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "mbsfnAreaList"); if (mbsfn_area_list) { - cJSON *mbsfn_area_list_local_nonprimitive; - if (!cJSON_IsArray(mbsfn_area_list)){ - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [mbsfn_area_list]"); - goto end; - } - - mbsfn_area_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mbsfn_area_list_local_nonprimitive, mbsfn_area_list ) { - if (!cJSON_IsObject(mbsfn_area_list_local_nonprimitive)) { + cJSON *mbsfn_area_list_local = NULL; + if (!cJSON_IsArray(mbsfn_area_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [mbsfn_area_list]"); goto end; } - OpenAPI_mbsfn_area_t *mbsfn_area_listItem = OpenAPI_mbsfn_area_parseFromJSON(mbsfn_area_list_local_nonprimitive); - if (!mbsfn_area_listItem) { - ogs_error("No mbsfn_area_listItem"); - OpenAPI_list_free(mbsfn_area_listList); - goto end; + mbsfn_area_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mbsfn_area_list_local, mbsfn_area_list) { + if (!cJSON_IsObject(mbsfn_area_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [mbsfn_area_list]"); + goto end; + } + OpenAPI_mbsfn_area_t *mbsfn_area_listItem = OpenAPI_mbsfn_area_parseFromJSON(mbsfn_area_list_local); + if (!mbsfn_area_listItem) { + ogs_error("No mbsfn_area_listItem"); + OpenAPI_list_free(mbsfn_area_listList); + goto end; + } + OpenAPI_list_add(mbsfn_area_listList, mbsfn_area_listItem); } - - OpenAPI_list_add(mbsfn_area_listList, mbsfn_area_listItem); - } } - cJSON *inter_freq_target_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "interFreqTargetList"); - - OpenAPI_list_t *inter_freq_target_listList; + inter_freq_target_list = cJSON_GetObjectItemCaseSensitive(mdt_configurationJSON, "interFreqTargetList"); if (inter_freq_target_list) { - cJSON *inter_freq_target_list_local_nonprimitive; - if (!cJSON_IsArray(inter_freq_target_list)){ - ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [inter_freq_target_list]"); - goto end; - } - - inter_freq_target_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(inter_freq_target_list_local_nonprimitive, inter_freq_target_list ) { - if (!cJSON_IsObject(inter_freq_target_list_local_nonprimitive)) { + cJSON *inter_freq_target_list_local = NULL; + if (!cJSON_IsArray(inter_freq_target_list)) { ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [inter_freq_target_list]"); goto end; } - OpenAPI_inter_freq_target_info_t *inter_freq_target_listItem = OpenAPI_inter_freq_target_info_parseFromJSON(inter_freq_target_list_local_nonprimitive); - if (!inter_freq_target_listItem) { - ogs_error("No inter_freq_target_listItem"); - OpenAPI_list_free(inter_freq_target_listList); - goto end; + inter_freq_target_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(inter_freq_target_list_local, inter_freq_target_list) { + if (!cJSON_IsObject(inter_freq_target_list_local)) { + ogs_error("OpenAPI_mdt_configuration_parseFromJSON() failed [inter_freq_target_list]"); + goto end; + } + OpenAPI_inter_freq_target_info_t *inter_freq_target_listItem = OpenAPI_inter_freq_target_info_parseFromJSON(inter_freq_target_list_local); + if (!inter_freq_target_listItem) { + ogs_error("No inter_freq_target_listItem"); + OpenAPI_list_free(inter_freq_target_listList); + goto end; + } + OpenAPI_list_add(inter_freq_target_listList, inter_freq_target_listItem); } - - OpenAPI_list_add(inter_freq_target_listList, inter_freq_target_listItem); - } } mdt_configuration_local_var = OpenAPI_mdt_configuration_create ( @@ -844,6 +851,55 @@ OpenAPI_mdt_configuration_t *OpenAPI_mdt_configuration_parseFromJSON(cJSON *mdt_ return mdt_configuration_local_var; end: + if (area_scope_local_nonprim) { + OpenAPI_area_scope_free(area_scope_local_nonprim); + area_scope_local_nonprim = NULL; + } + if (measurement_lte_listList) { + OpenAPI_list_free(measurement_lte_listList); + measurement_lte_listList = NULL; + } + if (measurement_nr_listList) { + OpenAPI_list_free(measurement_nr_listList); + measurement_nr_listList = NULL; + } + if (sensor_measurement_listList) { + OpenAPI_list_free(sensor_measurement_listList); + sensor_measurement_listList = NULL; + } + if (reporting_trigger_listList) { + OpenAPI_list_free(reporting_trigger_listList); + reporting_trigger_listList = NULL; + } + if (event_listList) { + OpenAPI_list_free(event_listList); + event_listList = NULL; + } + if (add_positioning_method_listList) { + OpenAPI_list_free(add_positioning_method_listList); + add_positioning_method_listList = NULL; + } + if (mdt_allowed_plmn_id_listList) { + OpenAPI_list_for_each(mdt_allowed_plmn_id_listList, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(mdt_allowed_plmn_id_listList); + mdt_allowed_plmn_id_listList = NULL; + } + if (mbsfn_area_listList) { + OpenAPI_list_for_each(mbsfn_area_listList, node) { + OpenAPI_mbsfn_area_free(node->data); + } + OpenAPI_list_free(mbsfn_area_listList); + mbsfn_area_listList = NULL; + } + if (inter_freq_target_listList) { + OpenAPI_list_for_each(inter_freq_target_listList, node) { + OpenAPI_inter_freq_target_info_free(node->data); + } + OpenAPI_list_free(inter_freq_target_listList); + inter_freq_target_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/mdt_configuration_1.c b/lib/sbi/openapi/model/mdt_configuration_1.c index 2eca03b55..736c89a4c 100644 --- a/lib/sbi/openapi/model/mdt_configuration_1.c +++ b/lib/sbi/openapi/model/mdt_configuration_1.c @@ -78,35 +78,67 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_create( void OpenAPI_mdt_configuration_1_free(OpenAPI_mdt_configuration_1_t *mdt_configuration_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == mdt_configuration_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_area_scope_free(mdt_configuration_1->area_scope); - OpenAPI_list_free(mdt_configuration_1->measurement_lte_list); - OpenAPI_list_free(mdt_configuration_1->measurement_nr_list); - OpenAPI_list_free(mdt_configuration_1->sensor_measurement_list); - OpenAPI_list_free(mdt_configuration_1->reporting_trigger_list); - OpenAPI_list_free(mdt_configuration_1->event_list); - OpenAPI_list_free(mdt_configuration_1->add_positioning_method_list); - OpenAPI_list_for_each(mdt_configuration_1->mdt_allowed_plmn_id_list, node) { - OpenAPI_plmn_id_1_free(node->data); + if (mdt_configuration_1->area_scope) { + OpenAPI_area_scope_free(mdt_configuration_1->area_scope); + mdt_configuration_1->area_scope = NULL; } - OpenAPI_list_free(mdt_configuration_1->mdt_allowed_plmn_id_list); - OpenAPI_list_for_each(mdt_configuration_1->mbsfn_area_list, node) { - OpenAPI_mbsfn_area_free(node->data); + if (mdt_configuration_1->measurement_lte_list) { + OpenAPI_list_free(mdt_configuration_1->measurement_lte_list); + mdt_configuration_1->measurement_lte_list = NULL; } - OpenAPI_list_free(mdt_configuration_1->mbsfn_area_list); - OpenAPI_list_for_each(mdt_configuration_1->inter_freq_target_list, node) { - OpenAPI_inter_freq_target_info_1_free(node->data); + if (mdt_configuration_1->measurement_nr_list) { + OpenAPI_list_free(mdt_configuration_1->measurement_nr_list); + mdt_configuration_1->measurement_nr_list = NULL; + } + if (mdt_configuration_1->sensor_measurement_list) { + OpenAPI_list_free(mdt_configuration_1->sensor_measurement_list); + mdt_configuration_1->sensor_measurement_list = NULL; + } + if (mdt_configuration_1->reporting_trigger_list) { + OpenAPI_list_free(mdt_configuration_1->reporting_trigger_list); + mdt_configuration_1->reporting_trigger_list = NULL; + } + if (mdt_configuration_1->event_list) { + OpenAPI_list_free(mdt_configuration_1->event_list); + mdt_configuration_1->event_list = NULL; + } + if (mdt_configuration_1->add_positioning_method_list) { + OpenAPI_list_free(mdt_configuration_1->add_positioning_method_list); + mdt_configuration_1->add_positioning_method_list = NULL; + } + if (mdt_configuration_1->mdt_allowed_plmn_id_list) { + OpenAPI_list_for_each(mdt_configuration_1->mdt_allowed_plmn_id_list, node) { + OpenAPI_plmn_id_1_free(node->data); + } + OpenAPI_list_free(mdt_configuration_1->mdt_allowed_plmn_id_list); + mdt_configuration_1->mdt_allowed_plmn_id_list = NULL; + } + if (mdt_configuration_1->mbsfn_area_list) { + OpenAPI_list_for_each(mdt_configuration_1->mbsfn_area_list, node) { + OpenAPI_mbsfn_area_free(node->data); + } + OpenAPI_list_free(mdt_configuration_1->mbsfn_area_list); + mdt_configuration_1->mbsfn_area_list = NULL; + } + if (mdt_configuration_1->inter_freq_target_list) { + OpenAPI_list_for_each(mdt_configuration_1->inter_freq_target_list, node) { + OpenAPI_inter_freq_target_info_1_free(node->data); + } + OpenAPI_list_free(mdt_configuration_1->inter_freq_target_list); + mdt_configuration_1->inter_freq_target_list = NULL; } - OpenAPI_list_free(mdt_configuration_1->inter_freq_target_list); ogs_free(mdt_configuration_1); } cJSON *OpenAPI_mdt_configuration_1_convertToJSON(OpenAPI_mdt_configuration_1_t *mdt_configuration_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (mdt_configuration_1 == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [MdtConfiguration_1]"); @@ -114,12 +146,16 @@ cJSON *OpenAPI_mdt_configuration_1_convertToJSON(OpenAPI_mdt_configuration_1_t * } item = cJSON_CreateObject(); + if (mdt_configuration_1->job_type == OpenAPI_job_type_NULL) { + ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [job_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "jobType", OpenAPI_job_type_ToString(mdt_configuration_1->job_type)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [job_type]"); goto end; } - if (mdt_configuration_1->report_type) { + if (mdt_configuration_1->report_type != OpenAPI_report_type_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportType", OpenAPI_report_type_mdt_ToString(mdt_configuration_1->report_type)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [report_type]"); goto end; @@ -139,81 +175,77 @@ cJSON *OpenAPI_mdt_configuration_1_convertToJSON(OpenAPI_mdt_configuration_1_t * } } - if (mdt_configuration_1->measurement_lte_list) { - cJSON *measurement_lte_list = cJSON_AddArrayToObject(item, "measurementLteList"); - if (measurement_lte_list == NULL) { + if (mdt_configuration_1->measurement_lte_list != OpenAPI_measurement_lte_for_mdt_NULL) { + cJSON *measurement_lte_listList = cJSON_AddArrayToObject(item, "measurementLteList"); + if (measurement_lte_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [measurement_lte_list]"); goto end; } - OpenAPI_lnode_t *measurement_lte_list_node; - OpenAPI_list_for_each(mdt_configuration_1->measurement_lte_list, measurement_lte_list_node) { - if (cJSON_AddStringToObject(measurement_lte_list, "", OpenAPI_measurement_lte_for_mdt_ToString((intptr_t)measurement_lte_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration_1->measurement_lte_list, node) { + if (cJSON_AddStringToObject(measurement_lte_listList, "", OpenAPI_measurement_lte_for_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [measurement_lte_list]"); goto end; } } } - if (mdt_configuration_1->measurement_nr_list) { - cJSON *measurement_nr_list = cJSON_AddArrayToObject(item, "measurementNrList"); - if (measurement_nr_list == NULL) { + if (mdt_configuration_1->measurement_nr_list != OpenAPI_measurement_nr_for_mdt_NULL) { + cJSON *measurement_nr_listList = cJSON_AddArrayToObject(item, "measurementNrList"); + if (measurement_nr_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [measurement_nr_list]"); goto end; } - OpenAPI_lnode_t *measurement_nr_list_node; - OpenAPI_list_for_each(mdt_configuration_1->measurement_nr_list, measurement_nr_list_node) { - if (cJSON_AddStringToObject(measurement_nr_list, "", OpenAPI_measurement_nr_for_mdt_ToString((intptr_t)measurement_nr_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration_1->measurement_nr_list, node) { + if (cJSON_AddStringToObject(measurement_nr_listList, "", OpenAPI_measurement_nr_for_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [measurement_nr_list]"); goto end; } } } - if (mdt_configuration_1->sensor_measurement_list) { - cJSON *sensor_measurement_list = cJSON_AddArrayToObject(item, "sensorMeasurementList"); - if (sensor_measurement_list == NULL) { + if (mdt_configuration_1->sensor_measurement_list != OpenAPI_sensor_measurement_NULL) { + cJSON *sensor_measurement_listList = cJSON_AddArrayToObject(item, "sensorMeasurementList"); + if (sensor_measurement_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [sensor_measurement_list]"); goto end; } - OpenAPI_lnode_t *sensor_measurement_list_node; - OpenAPI_list_for_each(mdt_configuration_1->sensor_measurement_list, sensor_measurement_list_node) { - if (cJSON_AddStringToObject(sensor_measurement_list, "", OpenAPI_sensor_measurement_ToString((intptr_t)sensor_measurement_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration_1->sensor_measurement_list, node) { + if (cJSON_AddStringToObject(sensor_measurement_listList, "", OpenAPI_sensor_measurement_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [sensor_measurement_list]"); goto end; } } } - if (mdt_configuration_1->reporting_trigger_list) { - cJSON *reporting_trigger_list = cJSON_AddArrayToObject(item, "reportingTriggerList"); - if (reporting_trigger_list == NULL) { + if (mdt_configuration_1->reporting_trigger_list != OpenAPI_reporting_trigger_NULL) { + cJSON *reporting_trigger_listList = cJSON_AddArrayToObject(item, "reportingTriggerList"); + if (reporting_trigger_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [reporting_trigger_list]"); goto end; } - OpenAPI_lnode_t *reporting_trigger_list_node; - OpenAPI_list_for_each(mdt_configuration_1->reporting_trigger_list, reporting_trigger_list_node) { - if (cJSON_AddStringToObject(reporting_trigger_list, "", OpenAPI_reporting_trigger_ToString((intptr_t)reporting_trigger_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration_1->reporting_trigger_list, node) { + if (cJSON_AddStringToObject(reporting_trigger_listList, "", OpenAPI_reporting_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [reporting_trigger_list]"); goto end; } } } - if (mdt_configuration_1->report_interval) { + if (mdt_configuration_1->report_interval != OpenAPI_report_interval_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportInterval", OpenAPI_report_interval_mdt_ToString(mdt_configuration_1->report_interval)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [report_interval]"); goto end; } } - if (mdt_configuration_1->report_interval_nr) { + if (mdt_configuration_1->report_interval_nr != OpenAPI_report_interval_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportIntervalNr", OpenAPI_report_interval_nr_mdt_ToString(mdt_configuration_1->report_interval_nr)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [report_interval_nr]"); goto end; } } - if (mdt_configuration_1->report_amount) { + if (mdt_configuration_1->report_amount != OpenAPI_report_amount_mdt_NULL) { if (cJSON_AddStringToObject(item, "reportAmount", OpenAPI_report_amount_mdt_ToString(mdt_configuration_1->report_amount)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [report_amount]"); goto end; @@ -248,86 +280,84 @@ cJSON *OpenAPI_mdt_configuration_1_convertToJSON(OpenAPI_mdt_configuration_1_t * } } - if (mdt_configuration_1->event_list) { - cJSON *event_list = cJSON_AddArrayToObject(item, "eventList"); - if (event_list == NULL) { + if (mdt_configuration_1->event_list != OpenAPI_event_for_mdt_NULL) { + cJSON *event_listList = cJSON_AddArrayToObject(item, "eventList"); + if (event_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [event_list]"); goto end; } - OpenAPI_lnode_t *event_list_node; - OpenAPI_list_for_each(mdt_configuration_1->event_list, event_list_node) { - if (cJSON_AddStringToObject(event_list, "", OpenAPI_event_for_mdt_ToString((intptr_t)event_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration_1->event_list, node) { + if (cJSON_AddStringToObject(event_listList, "", OpenAPI_event_for_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [event_list]"); goto end; } } } - if (mdt_configuration_1->logging_interval) { + if (mdt_configuration_1->logging_interval != OpenAPI_logging_interval_mdt_NULL) { if (cJSON_AddStringToObject(item, "loggingInterval", OpenAPI_logging_interval_mdt_ToString(mdt_configuration_1->logging_interval)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [logging_interval]"); goto end; } } - if (mdt_configuration_1->logging_interval_nr) { + if (mdt_configuration_1->logging_interval_nr != OpenAPI_logging_interval_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "loggingIntervalNr", OpenAPI_logging_interval_nr_mdt_ToString(mdt_configuration_1->logging_interval_nr)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [logging_interval_nr]"); goto end; } } - if (mdt_configuration_1->logging_duration) { + if (mdt_configuration_1->logging_duration != OpenAPI_logging_duration_mdt_NULL) { if (cJSON_AddStringToObject(item, "loggingDuration", OpenAPI_logging_duration_mdt_ToString(mdt_configuration_1->logging_duration)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [logging_duration]"); goto end; } } - if (mdt_configuration_1->logging_duration_nr) { + if (mdt_configuration_1->logging_duration_nr != OpenAPI_logging_duration_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "loggingDurationNr", OpenAPI_logging_duration_nr_mdt_ToString(mdt_configuration_1->logging_duration_nr)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [logging_duration_nr]"); goto end; } } - if (mdt_configuration_1->positioning_method) { + if (mdt_configuration_1->positioning_method != OpenAPI_positioning_method_mdt_NULL) { if (cJSON_AddStringToObject(item, "positioningMethod", OpenAPI_positioning_method_mdt_ToString(mdt_configuration_1->positioning_method)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [positioning_method]"); goto end; } } - if (mdt_configuration_1->add_positioning_method_list) { - cJSON *add_positioning_method_list = cJSON_AddArrayToObject(item, "addPositioningMethodList"); - if (add_positioning_method_list == NULL) { + if (mdt_configuration_1->add_positioning_method_list != OpenAPI_positioning_method_mdt_NULL) { + cJSON *add_positioning_method_listList = cJSON_AddArrayToObject(item, "addPositioningMethodList"); + if (add_positioning_method_listList == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [add_positioning_method_list]"); goto end; } - OpenAPI_lnode_t *add_positioning_method_list_node; - OpenAPI_list_for_each(mdt_configuration_1->add_positioning_method_list, add_positioning_method_list_node) { - if (cJSON_AddStringToObject(add_positioning_method_list, "", OpenAPI_positioning_method_mdt_ToString((intptr_t)add_positioning_method_list_node->data)) == NULL) { + OpenAPI_list_for_each(mdt_configuration_1->add_positioning_method_list, node) { + if (cJSON_AddStringToObject(add_positioning_method_listList, "", OpenAPI_positioning_method_mdt_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [add_positioning_method_list]"); goto end; } } } - if (mdt_configuration_1->collection_period_rmm_lte) { + if (mdt_configuration_1->collection_period_rmm_lte != OpenAPI_collection_period_rmm_lte_mdt_NULL) { if (cJSON_AddStringToObject(item, "collectionPeriodRmmLte", OpenAPI_collection_period_rmm_lte_mdt_ToString(mdt_configuration_1->collection_period_rmm_lte)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [collection_period_rmm_lte]"); goto end; } } - if (mdt_configuration_1->collection_period_rmm_nr) { + if (mdt_configuration_1->collection_period_rmm_nr != OpenAPI_collection_period_rmm_nr_mdt_NULL) { if (cJSON_AddStringToObject(item, "collectionPeriodRmmNr", OpenAPI_collection_period_rmm_nr_mdt_ToString(mdt_configuration_1->collection_period_rmm_nr)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [collection_period_rmm_nr]"); goto end; } } - if (mdt_configuration_1->measurement_period_lte) { + if (mdt_configuration_1->measurement_period_lte != OpenAPI_measurement_period_lte_mdt_NULL) { if (cJSON_AddStringToObject(item, "measurementPeriodLte", OpenAPI_measurement_period_lte_mdt_ToString(mdt_configuration_1->measurement_period_lte)) == NULL) { ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [measurement_period_lte]"); goto end; @@ -340,17 +370,13 @@ cJSON *OpenAPI_mdt_configuration_1_convertToJSON(OpenAPI_mdt_configuration_1_t * ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [mdt_allowed_plmn_id_list]"); goto end; } - - OpenAPI_lnode_t *mdt_allowed_plmn_id_list_node; - if (mdt_configuration_1->mdt_allowed_plmn_id_list) { - OpenAPI_list_for_each(mdt_configuration_1->mdt_allowed_plmn_id_list, mdt_allowed_plmn_id_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_1_convertToJSON(mdt_allowed_plmn_id_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [mdt_allowed_plmn_id_list]"); - goto end; - } - cJSON_AddItemToArray(mdt_allowed_plmn_id_listList, itemLocal); + OpenAPI_list_for_each(mdt_configuration_1->mdt_allowed_plmn_id_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [mdt_allowed_plmn_id_list]"); + goto end; } + cJSON_AddItemToArray(mdt_allowed_plmn_id_listList, itemLocal); } } @@ -360,17 +386,13 @@ cJSON *OpenAPI_mdt_configuration_1_convertToJSON(OpenAPI_mdt_configuration_1_t * ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [mbsfn_area_list]"); goto end; } - - OpenAPI_lnode_t *mbsfn_area_list_node; - if (mdt_configuration_1->mbsfn_area_list) { - OpenAPI_list_for_each(mdt_configuration_1->mbsfn_area_list, mbsfn_area_list_node) { - cJSON *itemLocal = OpenAPI_mbsfn_area_convertToJSON(mbsfn_area_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [mbsfn_area_list]"); - goto end; - } - cJSON_AddItemToArray(mbsfn_area_listList, itemLocal); + OpenAPI_list_for_each(mdt_configuration_1->mbsfn_area_list, node) { + cJSON *itemLocal = OpenAPI_mbsfn_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [mbsfn_area_list]"); + goto end; } + cJSON_AddItemToArray(mbsfn_area_listList, itemLocal); } } @@ -380,17 +402,13 @@ cJSON *OpenAPI_mdt_configuration_1_convertToJSON(OpenAPI_mdt_configuration_1_t * ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [inter_freq_target_list]"); goto end; } - - OpenAPI_lnode_t *inter_freq_target_list_node; - if (mdt_configuration_1->inter_freq_target_list) { - OpenAPI_list_for_each(mdt_configuration_1->inter_freq_target_list, inter_freq_target_list_node) { - cJSON *itemLocal = OpenAPI_inter_freq_target_info_1_convertToJSON(inter_freq_target_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [inter_freq_target_list]"); - goto end; - } - cJSON_AddItemToArray(inter_freq_target_listList, itemLocal); + OpenAPI_list_for_each(mdt_configuration_1->inter_freq_target_list, node) { + cJSON *itemLocal = OpenAPI_inter_freq_target_info_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mdt_configuration_1_convertToJSON() failed [inter_freq_target_list]"); + goto end; } + cJSON_AddItemToArray(inter_freq_target_listList, itemLocal); } } @@ -401,22 +419,69 @@ end: OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON *mdt_configuration_1JSON) { OpenAPI_mdt_configuration_1_t *mdt_configuration_1_local_var = NULL; - cJSON *job_type = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "jobType"); + OpenAPI_lnode_t *node = NULL; + cJSON *job_type = NULL; + OpenAPI_job_type_e job_typeVariable = 0; + cJSON *report_type = NULL; + OpenAPI_report_type_mdt_e report_typeVariable = 0; + cJSON *area_scope = NULL; + OpenAPI_area_scope_t *area_scope_local_nonprim = NULL; + cJSON *measurement_lte_list = NULL; + OpenAPI_list_t *measurement_lte_listList = NULL; + cJSON *measurement_nr_list = NULL; + OpenAPI_list_t *measurement_nr_listList = NULL; + cJSON *sensor_measurement_list = NULL; + OpenAPI_list_t *sensor_measurement_listList = NULL; + cJSON *reporting_trigger_list = NULL; + OpenAPI_list_t *reporting_trigger_listList = NULL; + cJSON *report_interval = NULL; + OpenAPI_report_interval_mdt_e report_intervalVariable = 0; + cJSON *report_interval_nr = NULL; + OpenAPI_report_interval_nr_mdt_e report_interval_nrVariable = 0; + cJSON *report_amount = NULL; + OpenAPI_report_amount_mdt_e report_amountVariable = 0; + cJSON *event_threshold_rsrp = NULL; + cJSON *event_threshold_rsrp_nr = NULL; + cJSON *event_threshold_rsrq = NULL; + cJSON *event_threshold_rsrq_nr = NULL; + cJSON *event_list = NULL; + OpenAPI_list_t *event_listList = NULL; + cJSON *logging_interval = NULL; + OpenAPI_logging_interval_mdt_e logging_intervalVariable = 0; + cJSON *logging_interval_nr = NULL; + OpenAPI_logging_interval_nr_mdt_e logging_interval_nrVariable = 0; + cJSON *logging_duration = NULL; + OpenAPI_logging_duration_mdt_e logging_durationVariable = 0; + cJSON *logging_duration_nr = NULL; + OpenAPI_logging_duration_nr_mdt_e logging_duration_nrVariable = 0; + cJSON *positioning_method = NULL; + OpenAPI_positioning_method_mdt_e positioning_methodVariable = 0; + cJSON *add_positioning_method_list = NULL; + OpenAPI_list_t *add_positioning_method_listList = NULL; + cJSON *collection_period_rmm_lte = NULL; + OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lteVariable = 0; + cJSON *collection_period_rmm_nr = NULL; + OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nrVariable = 0; + cJSON *measurement_period_lte = NULL; + OpenAPI_measurement_period_lte_mdt_e measurement_period_lteVariable = 0; + cJSON *mdt_allowed_plmn_id_list = NULL; + OpenAPI_list_t *mdt_allowed_plmn_id_listList = NULL; + cJSON *mbsfn_area_list = NULL; + OpenAPI_list_t *mbsfn_area_listList = NULL; + cJSON *inter_freq_target_list = NULL; + OpenAPI_list_t *inter_freq_target_listList = NULL; + job_type = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "jobType"); if (!job_type) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [job_type]"); goto end; } - - OpenAPI_job_type_e job_typeVariable; if (!cJSON_IsString(job_type)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [job_type]"); goto end; } job_typeVariable = OpenAPI_job_type_FromString(job_type->valuestring); - cJSON *report_type = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportType"); - - OpenAPI_report_type_mdt_e report_typeVariable; + report_type = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportType"); if (report_type) { if (!cJSON_IsString(report_type)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [report_type]"); @@ -425,104 +490,88 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * report_typeVariable = OpenAPI_report_type_mdt_FromString(report_type->valuestring); } - cJSON *area_scope = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "areaScope"); - - OpenAPI_area_scope_t *area_scope_local_nonprim = NULL; + area_scope = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "areaScope"); if (area_scope) { area_scope_local_nonprim = OpenAPI_area_scope_parseFromJSON(area_scope); } - cJSON *measurement_lte_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "measurementLteList"); - - OpenAPI_list_t *measurement_lte_listList; + measurement_lte_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "measurementLteList"); if (measurement_lte_list) { - cJSON *measurement_lte_list_local_nonprimitive; - if (!cJSON_IsArray(measurement_lte_list)) { - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [measurement_lte_list]"); - goto end; - } - - measurement_lte_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(measurement_lte_list_local_nonprimitive, measurement_lte_list ) { - if (!cJSON_IsString(measurement_lte_list_local_nonprimitive)){ + cJSON *measurement_lte_list_local = NULL; + if (!cJSON_IsArray(measurement_lte_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [measurement_lte_list]"); goto end; } - OpenAPI_list_add(measurement_lte_listList, (void *)OpenAPI_measurement_lte_for_mdt_FromString(measurement_lte_list_local_nonprimitive->valuestring)); - } + measurement_lte_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(measurement_lte_list_local, measurement_lte_list) { + if (!cJSON_IsString(measurement_lte_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [measurement_lte_list]"); + goto end; + } + OpenAPI_list_add(measurement_lte_listList, (void *)OpenAPI_measurement_lte_for_mdt_FromString(measurement_lte_list_local->valuestring)); + } } - cJSON *measurement_nr_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "measurementNrList"); - - OpenAPI_list_t *measurement_nr_listList; + measurement_nr_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "measurementNrList"); if (measurement_nr_list) { - cJSON *measurement_nr_list_local_nonprimitive; - if (!cJSON_IsArray(measurement_nr_list)) { - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [measurement_nr_list]"); - goto end; - } - - measurement_nr_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(measurement_nr_list_local_nonprimitive, measurement_nr_list ) { - if (!cJSON_IsString(measurement_nr_list_local_nonprimitive)){ + cJSON *measurement_nr_list_local = NULL; + if (!cJSON_IsArray(measurement_nr_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [measurement_nr_list]"); goto end; } - OpenAPI_list_add(measurement_nr_listList, (void *)OpenAPI_measurement_nr_for_mdt_FromString(measurement_nr_list_local_nonprimitive->valuestring)); - } + measurement_nr_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(measurement_nr_list_local, measurement_nr_list) { + if (!cJSON_IsString(measurement_nr_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [measurement_nr_list]"); + goto end; + } + OpenAPI_list_add(measurement_nr_listList, (void *)OpenAPI_measurement_nr_for_mdt_FromString(measurement_nr_list_local->valuestring)); + } } - cJSON *sensor_measurement_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "sensorMeasurementList"); - - OpenAPI_list_t *sensor_measurement_listList; + sensor_measurement_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "sensorMeasurementList"); if (sensor_measurement_list) { - cJSON *sensor_measurement_list_local_nonprimitive; - if (!cJSON_IsArray(sensor_measurement_list)) { - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [sensor_measurement_list]"); - goto end; - } - - sensor_measurement_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sensor_measurement_list_local_nonprimitive, sensor_measurement_list ) { - if (!cJSON_IsString(sensor_measurement_list_local_nonprimitive)){ + cJSON *sensor_measurement_list_local = NULL; + if (!cJSON_IsArray(sensor_measurement_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [sensor_measurement_list]"); goto end; } - OpenAPI_list_add(sensor_measurement_listList, (void *)OpenAPI_sensor_measurement_FromString(sensor_measurement_list_local_nonprimitive->valuestring)); - } + sensor_measurement_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sensor_measurement_list_local, sensor_measurement_list) { + if (!cJSON_IsString(sensor_measurement_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [sensor_measurement_list]"); + goto end; + } + OpenAPI_list_add(sensor_measurement_listList, (void *)OpenAPI_sensor_measurement_FromString(sensor_measurement_list_local->valuestring)); + } } - cJSON *reporting_trigger_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportingTriggerList"); - - OpenAPI_list_t *reporting_trigger_listList; + reporting_trigger_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportingTriggerList"); if (reporting_trigger_list) { - cJSON *reporting_trigger_list_local_nonprimitive; - if (!cJSON_IsArray(reporting_trigger_list)) { - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [reporting_trigger_list]"); - goto end; - } - - reporting_trigger_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(reporting_trigger_list_local_nonprimitive, reporting_trigger_list ) { - if (!cJSON_IsString(reporting_trigger_list_local_nonprimitive)){ + cJSON *reporting_trigger_list_local = NULL; + if (!cJSON_IsArray(reporting_trigger_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [reporting_trigger_list]"); goto end; } - OpenAPI_list_add(reporting_trigger_listList, (void *)OpenAPI_reporting_trigger_FromString(reporting_trigger_list_local_nonprimitive->valuestring)); - } + reporting_trigger_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(reporting_trigger_list_local, reporting_trigger_list) { + if (!cJSON_IsString(reporting_trigger_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [reporting_trigger_list]"); + goto end; + } + OpenAPI_list_add(reporting_trigger_listList, (void *)OpenAPI_reporting_trigger_FromString(reporting_trigger_list_local->valuestring)); + } } - cJSON *report_interval = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportInterval"); - - OpenAPI_report_interval_mdt_e report_intervalVariable; + report_interval = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportInterval"); if (report_interval) { if (!cJSON_IsString(report_interval)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [report_interval]"); @@ -531,9 +580,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * report_intervalVariable = OpenAPI_report_interval_mdt_FromString(report_interval->valuestring); } - cJSON *report_interval_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportIntervalNr"); - - OpenAPI_report_interval_nr_mdt_e report_interval_nrVariable; + report_interval_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportIntervalNr"); if (report_interval_nr) { if (!cJSON_IsString(report_interval_nr)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [report_interval_nr]"); @@ -542,9 +589,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * report_interval_nrVariable = OpenAPI_report_interval_nr_mdt_FromString(report_interval_nr->valuestring); } - cJSON *report_amount = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportAmount"); - - OpenAPI_report_amount_mdt_e report_amountVariable; + report_amount = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "reportAmount"); if (report_amount) { if (!cJSON_IsString(report_amount)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [report_amount]"); @@ -553,8 +598,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * report_amountVariable = OpenAPI_report_amount_mdt_FromString(report_amount->valuestring); } - cJSON *event_threshold_rsrp = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventThresholdRsrp"); - + event_threshold_rsrp = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventThresholdRsrp"); if (event_threshold_rsrp) { if (!cJSON_IsNumber(event_threshold_rsrp)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [event_threshold_rsrp]"); @@ -562,8 +606,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * } } - cJSON *event_threshold_rsrp_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventThresholdRsrpNr"); - + event_threshold_rsrp_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventThresholdRsrpNr"); if (event_threshold_rsrp_nr) { if (!cJSON_IsNumber(event_threshold_rsrp_nr)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [event_threshold_rsrp_nr]"); @@ -571,8 +614,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * } } - cJSON *event_threshold_rsrq = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventThresholdRsrq"); - + event_threshold_rsrq = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventThresholdRsrq"); if (event_threshold_rsrq) { if (!cJSON_IsNumber(event_threshold_rsrq)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [event_threshold_rsrq]"); @@ -580,8 +622,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * } } - cJSON *event_threshold_rsrq_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventThresholdRsrqNr"); - + event_threshold_rsrq_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventThresholdRsrqNr"); if (event_threshold_rsrq_nr) { if (!cJSON_IsNumber(event_threshold_rsrq_nr)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [event_threshold_rsrq_nr]"); @@ -589,31 +630,26 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * } } - cJSON *event_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventList"); - - OpenAPI_list_t *event_listList; + event_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "eventList"); if (event_list) { - cJSON *event_list_local_nonprimitive; - if (!cJSON_IsArray(event_list)) { - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [event_list]"); - goto end; - } - - event_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(event_list_local_nonprimitive, event_list ) { - if (!cJSON_IsString(event_list_local_nonprimitive)){ + cJSON *event_list_local = NULL; + if (!cJSON_IsArray(event_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [event_list]"); goto end; } - OpenAPI_list_add(event_listList, (void *)OpenAPI_event_for_mdt_FromString(event_list_local_nonprimitive->valuestring)); - } + event_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(event_list_local, event_list) { + if (!cJSON_IsString(event_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [event_list]"); + goto end; + } + OpenAPI_list_add(event_listList, (void *)OpenAPI_event_for_mdt_FromString(event_list_local->valuestring)); + } } - cJSON *logging_interval = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "loggingInterval"); - - OpenAPI_logging_interval_mdt_e logging_intervalVariable; + logging_interval = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "loggingInterval"); if (logging_interval) { if (!cJSON_IsString(logging_interval)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [logging_interval]"); @@ -622,9 +658,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * logging_intervalVariable = OpenAPI_logging_interval_mdt_FromString(logging_interval->valuestring); } - cJSON *logging_interval_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "loggingIntervalNr"); - - OpenAPI_logging_interval_nr_mdt_e logging_interval_nrVariable; + logging_interval_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "loggingIntervalNr"); if (logging_interval_nr) { if (!cJSON_IsString(logging_interval_nr)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [logging_interval_nr]"); @@ -633,9 +667,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * logging_interval_nrVariable = OpenAPI_logging_interval_nr_mdt_FromString(logging_interval_nr->valuestring); } - cJSON *logging_duration = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "loggingDuration"); - - OpenAPI_logging_duration_mdt_e logging_durationVariable; + logging_duration = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "loggingDuration"); if (logging_duration) { if (!cJSON_IsString(logging_duration)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [logging_duration]"); @@ -644,9 +676,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * logging_durationVariable = OpenAPI_logging_duration_mdt_FromString(logging_duration->valuestring); } - cJSON *logging_duration_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "loggingDurationNr"); - - OpenAPI_logging_duration_nr_mdt_e logging_duration_nrVariable; + logging_duration_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "loggingDurationNr"); if (logging_duration_nr) { if (!cJSON_IsString(logging_duration_nr)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [logging_duration_nr]"); @@ -655,9 +685,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * logging_duration_nrVariable = OpenAPI_logging_duration_nr_mdt_FromString(logging_duration_nr->valuestring); } - cJSON *positioning_method = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "positioningMethod"); - - OpenAPI_positioning_method_mdt_e positioning_methodVariable; + positioning_method = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "positioningMethod"); if (positioning_method) { if (!cJSON_IsString(positioning_method)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [positioning_method]"); @@ -666,31 +694,26 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * positioning_methodVariable = OpenAPI_positioning_method_mdt_FromString(positioning_method->valuestring); } - cJSON *add_positioning_method_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "addPositioningMethodList"); - - OpenAPI_list_t *add_positioning_method_listList; + add_positioning_method_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "addPositioningMethodList"); if (add_positioning_method_list) { - cJSON *add_positioning_method_list_local_nonprimitive; - if (!cJSON_IsArray(add_positioning_method_list)) { - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [add_positioning_method_list]"); - goto end; - } - - add_positioning_method_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(add_positioning_method_list_local_nonprimitive, add_positioning_method_list ) { - if (!cJSON_IsString(add_positioning_method_list_local_nonprimitive)){ + cJSON *add_positioning_method_list_local = NULL; + if (!cJSON_IsArray(add_positioning_method_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [add_positioning_method_list]"); goto end; } - OpenAPI_list_add(add_positioning_method_listList, (void *)OpenAPI_positioning_method_mdt_FromString(add_positioning_method_list_local_nonprimitive->valuestring)); - } + add_positioning_method_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_positioning_method_list_local, add_positioning_method_list) { + if (!cJSON_IsString(add_positioning_method_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [add_positioning_method_list]"); + goto end; + } + OpenAPI_list_add(add_positioning_method_listList, (void *)OpenAPI_positioning_method_mdt_FromString(add_positioning_method_list_local->valuestring)); + } } - cJSON *collection_period_rmm_lte = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "collectionPeriodRmmLte"); - - OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lteVariable; + collection_period_rmm_lte = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "collectionPeriodRmmLte"); if (collection_period_rmm_lte) { if (!cJSON_IsString(collection_period_rmm_lte)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [collection_period_rmm_lte]"); @@ -699,9 +722,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * collection_period_rmm_lteVariable = OpenAPI_collection_period_rmm_lte_mdt_FromString(collection_period_rmm_lte->valuestring); } - cJSON *collection_period_rmm_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "collectionPeriodRmmNr"); - - OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nrVariable; + collection_period_rmm_nr = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "collectionPeriodRmmNr"); if (collection_period_rmm_nr) { if (!cJSON_IsString(collection_period_rmm_nr)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [collection_period_rmm_nr]"); @@ -710,9 +731,7 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * collection_period_rmm_nrVariable = OpenAPI_collection_period_rmm_nr_mdt_FromString(collection_period_rmm_nr->valuestring); } - cJSON *measurement_period_lte = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "measurementPeriodLte"); - - OpenAPI_measurement_period_lte_mdt_e measurement_period_lteVariable; + measurement_period_lte = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "measurementPeriodLte"); if (measurement_period_lte) { if (!cJSON_IsString(measurement_period_lte)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [measurement_period_lte]"); @@ -721,91 +740,79 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * measurement_period_lteVariable = OpenAPI_measurement_period_lte_mdt_FromString(measurement_period_lte->valuestring); } - cJSON *mdt_allowed_plmn_id_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "mdtAllowedPlmnIdList"); - - OpenAPI_list_t *mdt_allowed_plmn_id_listList; + mdt_allowed_plmn_id_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "mdtAllowedPlmnIdList"); if (mdt_allowed_plmn_id_list) { - cJSON *mdt_allowed_plmn_id_list_local_nonprimitive; - if (!cJSON_IsArray(mdt_allowed_plmn_id_list)){ - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); - goto end; - } - - mdt_allowed_plmn_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mdt_allowed_plmn_id_list_local_nonprimitive, mdt_allowed_plmn_id_list ) { - if (!cJSON_IsObject(mdt_allowed_plmn_id_list_local_nonprimitive)) { + cJSON *mdt_allowed_plmn_id_list_local = NULL; + if (!cJSON_IsArray(mdt_allowed_plmn_id_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); goto end; } - OpenAPI_plmn_id_1_t *mdt_allowed_plmn_id_listItem = OpenAPI_plmn_id_1_parseFromJSON(mdt_allowed_plmn_id_list_local_nonprimitive); - if (!mdt_allowed_plmn_id_listItem) { - ogs_error("No mdt_allowed_plmn_id_listItem"); - OpenAPI_list_free(mdt_allowed_plmn_id_listList); - goto end; + mdt_allowed_plmn_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mdt_allowed_plmn_id_list_local, mdt_allowed_plmn_id_list) { + if (!cJSON_IsObject(mdt_allowed_plmn_id_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [mdt_allowed_plmn_id_list]"); + goto end; + } + OpenAPI_plmn_id_1_t *mdt_allowed_plmn_id_listItem = OpenAPI_plmn_id_1_parseFromJSON(mdt_allowed_plmn_id_list_local); + if (!mdt_allowed_plmn_id_listItem) { + ogs_error("No mdt_allowed_plmn_id_listItem"); + OpenAPI_list_free(mdt_allowed_plmn_id_listList); + goto end; + } + OpenAPI_list_add(mdt_allowed_plmn_id_listList, mdt_allowed_plmn_id_listItem); } - - OpenAPI_list_add(mdt_allowed_plmn_id_listList, mdt_allowed_plmn_id_listItem); - } } - cJSON *mbsfn_area_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "mbsfnAreaList"); - - OpenAPI_list_t *mbsfn_area_listList; + mbsfn_area_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "mbsfnAreaList"); if (mbsfn_area_list) { - cJSON *mbsfn_area_list_local_nonprimitive; - if (!cJSON_IsArray(mbsfn_area_list)){ - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [mbsfn_area_list]"); - goto end; - } - - mbsfn_area_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mbsfn_area_list_local_nonprimitive, mbsfn_area_list ) { - if (!cJSON_IsObject(mbsfn_area_list_local_nonprimitive)) { + cJSON *mbsfn_area_list_local = NULL; + if (!cJSON_IsArray(mbsfn_area_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [mbsfn_area_list]"); goto end; } - OpenAPI_mbsfn_area_t *mbsfn_area_listItem = OpenAPI_mbsfn_area_parseFromJSON(mbsfn_area_list_local_nonprimitive); - if (!mbsfn_area_listItem) { - ogs_error("No mbsfn_area_listItem"); - OpenAPI_list_free(mbsfn_area_listList); - goto end; + mbsfn_area_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mbsfn_area_list_local, mbsfn_area_list) { + if (!cJSON_IsObject(mbsfn_area_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [mbsfn_area_list]"); + goto end; + } + OpenAPI_mbsfn_area_t *mbsfn_area_listItem = OpenAPI_mbsfn_area_parseFromJSON(mbsfn_area_list_local); + if (!mbsfn_area_listItem) { + ogs_error("No mbsfn_area_listItem"); + OpenAPI_list_free(mbsfn_area_listList); + goto end; + } + OpenAPI_list_add(mbsfn_area_listList, mbsfn_area_listItem); } - - OpenAPI_list_add(mbsfn_area_listList, mbsfn_area_listItem); - } } - cJSON *inter_freq_target_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "interFreqTargetList"); - - OpenAPI_list_t *inter_freq_target_listList; + inter_freq_target_list = cJSON_GetObjectItemCaseSensitive(mdt_configuration_1JSON, "interFreqTargetList"); if (inter_freq_target_list) { - cJSON *inter_freq_target_list_local_nonprimitive; - if (!cJSON_IsArray(inter_freq_target_list)){ - ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [inter_freq_target_list]"); - goto end; - } - - inter_freq_target_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(inter_freq_target_list_local_nonprimitive, inter_freq_target_list ) { - if (!cJSON_IsObject(inter_freq_target_list_local_nonprimitive)) { + cJSON *inter_freq_target_list_local = NULL; + if (!cJSON_IsArray(inter_freq_target_list)) { ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [inter_freq_target_list]"); goto end; } - OpenAPI_inter_freq_target_info_1_t *inter_freq_target_listItem = OpenAPI_inter_freq_target_info_1_parseFromJSON(inter_freq_target_list_local_nonprimitive); - if (!inter_freq_target_listItem) { - ogs_error("No inter_freq_target_listItem"); - OpenAPI_list_free(inter_freq_target_listList); - goto end; + inter_freq_target_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(inter_freq_target_list_local, inter_freq_target_list) { + if (!cJSON_IsObject(inter_freq_target_list_local)) { + ogs_error("OpenAPI_mdt_configuration_1_parseFromJSON() failed [inter_freq_target_list]"); + goto end; + } + OpenAPI_inter_freq_target_info_1_t *inter_freq_target_listItem = OpenAPI_inter_freq_target_info_1_parseFromJSON(inter_freq_target_list_local); + if (!inter_freq_target_listItem) { + ogs_error("No inter_freq_target_listItem"); + OpenAPI_list_free(inter_freq_target_listList); + goto end; + } + OpenAPI_list_add(inter_freq_target_listList, inter_freq_target_listItem); } - - OpenAPI_list_add(inter_freq_target_listList, inter_freq_target_listItem); - } } mdt_configuration_1_local_var = OpenAPI_mdt_configuration_1_create ( @@ -844,6 +851,55 @@ OpenAPI_mdt_configuration_1_t *OpenAPI_mdt_configuration_1_parseFromJSON(cJSON * return mdt_configuration_1_local_var; end: + if (area_scope_local_nonprim) { + OpenAPI_area_scope_free(area_scope_local_nonprim); + area_scope_local_nonprim = NULL; + } + if (measurement_lte_listList) { + OpenAPI_list_free(measurement_lte_listList); + measurement_lte_listList = NULL; + } + if (measurement_nr_listList) { + OpenAPI_list_free(measurement_nr_listList); + measurement_nr_listList = NULL; + } + if (sensor_measurement_listList) { + OpenAPI_list_free(sensor_measurement_listList); + sensor_measurement_listList = NULL; + } + if (reporting_trigger_listList) { + OpenAPI_list_free(reporting_trigger_listList); + reporting_trigger_listList = NULL; + } + if (event_listList) { + OpenAPI_list_free(event_listList); + event_listList = NULL; + } + if (add_positioning_method_listList) { + OpenAPI_list_free(add_positioning_method_listList); + add_positioning_method_listList = NULL; + } + if (mdt_allowed_plmn_id_listList) { + OpenAPI_list_for_each(mdt_allowed_plmn_id_listList, node) { + OpenAPI_plmn_id_1_free(node->data); + } + OpenAPI_list_free(mdt_allowed_plmn_id_listList); + mdt_allowed_plmn_id_listList = NULL; + } + if (mbsfn_area_listList) { + OpenAPI_list_for_each(mbsfn_area_listList, node) { + OpenAPI_mbsfn_area_free(node->data); + } + OpenAPI_list_free(mbsfn_area_listList); + mbsfn_area_listList = NULL; + } + if (inter_freq_target_listList) { + OpenAPI_list_for_each(inter_freq_target_listList, node) { + OpenAPI_inter_freq_target_info_1_free(node->data); + } + OpenAPI_list_free(inter_freq_target_listList); + inter_freq_target_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/measurement_period_lte_mdt.c b/lib/sbi/openapi/model/measurement_period_lte_mdt.c index 42efc274f..d33fc8767 100644 --- a/lib/sbi/openapi/model/measurement_period_lte_mdt.c +++ b/lib/sbi/openapi/model/measurement_period_lte_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_measurement_period_lte_mdt_ToString(OpenAPI_measurement_period_lte_mdt_e measurement_period_lte_mdt) { - const char *measurement_period_lte_mdtArray[] = { "NULL", "_1024", "_1280", "_2048", "_2560", "_5120", "_10240", "_60000" }; + const char *measurement_period_lte_mdtArray[] = { "NULL", "1024", "1280", "2048", "2560", "5120", "10240", "60000" }; size_t sizeofArray = sizeof(measurement_period_lte_mdtArray) / sizeof(measurement_period_lte_mdtArray[0]); if (measurement_period_lte_mdt < sizeofArray) return (char *)measurement_period_lte_mdtArray[measurement_period_lte_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_measurement_period_lte_mdt_ToString(OpenAPI_measurement_period_lte OpenAPI_measurement_period_lte_mdt_e OpenAPI_measurement_period_lte_mdt_FromString(char* measurement_period_lte_mdt) { int stringToReturn = 0; - const char *measurement_period_lte_mdtArray[] = { "NULL", "_1024", "_1280", "_2048", "_2560", "_5120", "_10240", "_60000" }; + const char *measurement_period_lte_mdtArray[] = { "NULL", "1024", "1280", "2048", "2560", "5120", "10240", "60000" }; size_t sizeofArray = sizeof(measurement_period_lte_mdtArray) / sizeof(measurement_period_lte_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(measurement_period_lte_mdt, measurement_period_lte_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/media_component.c b/lib/sbi/openapi/model/media_component.c index 68b8962df..58cd194be 100644 --- a/lib/sbi/openapi/model/media_component.c +++ b/lib/sbi/openapi/model/media_component.c @@ -102,48 +102,110 @@ OpenAPI_media_component_t *OpenAPI_media_component_create( void OpenAPI_media_component_free(OpenAPI_media_component_t *media_component) { + OpenAPI_lnode_t *node = NULL; + if (NULL == media_component) { return; } - OpenAPI_lnode_t *node; - ogs_free(media_component->af_app_id); - OpenAPI_af_routing_requirement_free(media_component->af_rout_req); - ogs_free(media_component->qos_reference); - OpenAPI_list_for_each(media_component->alt_ser_reqs, node) { - ogs_free(node->data); + if (media_component->af_app_id) { + ogs_free(media_component->af_app_id); + media_component->af_app_id = NULL; } - OpenAPI_list_free(media_component->alt_ser_reqs); - OpenAPI_list_for_each(media_component->codecs, node) { - ogs_free(node->data); + if (media_component->af_rout_req) { + OpenAPI_af_routing_requirement_free(media_component->af_rout_req); + media_component->af_rout_req = NULL; } - OpenAPI_list_free(media_component->codecs); - ogs_free(media_component->flus_id); - ogs_free(media_component->mar_bw_dl); - ogs_free(media_component->mar_bw_ul); - ogs_free(media_component->max_supp_bw_dl); - ogs_free(media_component->max_supp_bw_ul); - OpenAPI_list_for_each(media_component->med_sub_comps, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_media_sub_component_free(localKeyValue->value); - ogs_free(localKeyValue); + if (media_component->qos_reference) { + ogs_free(media_component->qos_reference); + media_component->qos_reference = NULL; + } + if (media_component->alt_ser_reqs) { + OpenAPI_list_for_each(media_component->alt_ser_reqs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(media_component->alt_ser_reqs); + media_component->alt_ser_reqs = NULL; + } + if (media_component->codecs) { + OpenAPI_list_for_each(media_component->codecs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(media_component->codecs); + media_component->codecs = NULL; + } + if (media_component->flus_id) { + ogs_free(media_component->flus_id); + media_component->flus_id = NULL; + } + if (media_component->mar_bw_dl) { + ogs_free(media_component->mar_bw_dl); + media_component->mar_bw_dl = NULL; + } + if (media_component->mar_bw_ul) { + ogs_free(media_component->mar_bw_ul); + media_component->mar_bw_ul = NULL; + } + if (media_component->max_supp_bw_dl) { + ogs_free(media_component->max_supp_bw_dl); + media_component->max_supp_bw_dl = NULL; + } + if (media_component->max_supp_bw_ul) { + ogs_free(media_component->max_supp_bw_ul); + media_component->max_supp_bw_ul = NULL; + } + if (media_component->med_sub_comps) { + OpenAPI_list_for_each(media_component->med_sub_comps, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_sub_component_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(media_component->med_sub_comps); + media_component->med_sub_comps = NULL; + } + if (media_component->min_des_bw_dl) { + ogs_free(media_component->min_des_bw_dl); + media_component->min_des_bw_dl = NULL; + } + if (media_component->min_des_bw_ul) { + ogs_free(media_component->min_des_bw_ul); + media_component->min_des_bw_ul = NULL; + } + if (media_component->mir_bw_dl) { + ogs_free(media_component->mir_bw_dl); + media_component->mir_bw_dl = NULL; + } + if (media_component->mir_bw_ul) { + ogs_free(media_component->mir_bw_ul); + media_component->mir_bw_ul = NULL; + } + if (media_component->rr_bw) { + ogs_free(media_component->rr_bw); + media_component->rr_bw = NULL; + } + if (media_component->rs_bw) { + ogs_free(media_component->rs_bw); + media_component->rs_bw = NULL; + } + if (media_component->tsn_qos) { + OpenAPI_tsn_qos_container_free(media_component->tsn_qos); + media_component->tsn_qos = NULL; + } + if (media_component->tscai_input_dl) { + OpenAPI_tscai_input_container_free(media_component->tscai_input_dl); + media_component->tscai_input_dl = NULL; + } + if (media_component->tscai_input_ul) { + OpenAPI_tscai_input_container_free(media_component->tscai_input_ul); + media_component->tscai_input_ul = NULL; } - OpenAPI_list_free(media_component->med_sub_comps); - ogs_free(media_component->min_des_bw_dl); - ogs_free(media_component->min_des_bw_ul); - ogs_free(media_component->mir_bw_dl); - ogs_free(media_component->mir_bw_ul); - ogs_free(media_component->rr_bw); - ogs_free(media_component->rs_bw); - OpenAPI_tsn_qos_container_free(media_component->tsn_qos); - OpenAPI_tscai_input_container_free(media_component->tscai_input_dl); - OpenAPI_tscai_input_container_free(media_component->tscai_input_ul); ogs_free(media_component); } cJSON *OpenAPI_media_component_convertToJSON(OpenAPI_media_component_t *media_component) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (media_component == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [MediaComponent]"); @@ -186,19 +248,17 @@ cJSON *OpenAPI_media_component_convertToJSON(OpenAPI_media_component_t *media_co } if (media_component->alt_ser_reqs) { - cJSON *alt_ser_reqs = cJSON_AddArrayToObject(item, "altSerReqs"); - if (alt_ser_reqs == NULL) { + cJSON *alt_ser_reqsList = cJSON_AddArrayToObject(item, "altSerReqs"); + if (alt_ser_reqsList == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [alt_ser_reqs]"); goto end; } - - OpenAPI_lnode_t *alt_ser_reqs_node; - OpenAPI_list_for_each(media_component->alt_ser_reqs, alt_ser_reqs_node) { - if (cJSON_AddStringToObject(alt_ser_reqs, "", (char*)alt_ser_reqs_node->data) == NULL) { - ogs_error("OpenAPI_media_component_convertToJSON() failed [alt_ser_reqs]"); - goto end; + OpenAPI_list_for_each(media_component->alt_ser_reqs, node) { + if (cJSON_AddStringToObject(alt_ser_reqsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_media_component_convertToJSON() failed [alt_ser_reqs]"); + goto end; + } } - } } if (media_component->is_cont_ver) { @@ -209,19 +269,17 @@ cJSON *OpenAPI_media_component_convertToJSON(OpenAPI_media_component_t *media_co } if (media_component->codecs) { - cJSON *codecs = cJSON_AddArrayToObject(item, "codecs"); - if (codecs == NULL) { + cJSON *codecsList = cJSON_AddArrayToObject(item, "codecs"); + if (codecsList == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [codecs]"); goto end; } - - OpenAPI_lnode_t *codecs_node; - OpenAPI_list_for_each(media_component->codecs, codecs_node) { - if (cJSON_AddStringToObject(codecs, "", (char*)codecs_node->data) == NULL) { - ogs_error("OpenAPI_media_component_convertToJSON() failed [codecs]"); - goto end; + OpenAPI_list_for_each(media_component->codecs, node) { + if (cJSON_AddStringToObject(codecsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_media_component_convertToJSON() failed [codecs]"); + goto end; + } } - } } if (media_component->is_des_max_latency) { @@ -245,7 +303,7 @@ cJSON *OpenAPI_media_component_convertToJSON(OpenAPI_media_component_t *media_co } } - if (media_component->f_status) { + if (media_component->f_status != OpenAPI_flow_status_NULL) { if (cJSON_AddStringToObject(item, "fStatus", OpenAPI_flow_status_ToString(media_component->f_status)) == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [f_status]"); goto end; @@ -306,23 +364,22 @@ cJSON *OpenAPI_media_component_convertToJSON(OpenAPI_media_component_t *media_co goto end; } cJSON *localMapObject = med_sub_comps; - OpenAPI_lnode_t *med_sub_comps_node; if (media_component->med_sub_comps) { - OpenAPI_list_for_each(media_component->med_sub_comps, med_sub_comps_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)med_sub_comps_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_media_sub_component_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_media_component_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(media_component->med_sub_comps, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_media_sub_component_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_media_component_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } - if (media_component->med_type) { + if (media_component->med_type != OpenAPI_media_type_NULL) { if (cJSON_AddStringToObject(item, "medType", OpenAPI_media_type_ToString(media_component->med_type)) == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [med_type]"); goto end; @@ -357,28 +414,28 @@ cJSON *OpenAPI_media_component_convertToJSON(OpenAPI_media_component_t *media_co } } - if (media_component->preempt_cap) { + if (media_component->preempt_cap != OpenAPI_preemption_capability_NULL) { if (cJSON_AddStringToObject(item, "preemptCap", OpenAPI_preemption_capability_ToString(media_component->preempt_cap)) == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [preempt_cap]"); goto end; } } - if (media_component->preempt_vuln) { + if (media_component->preempt_vuln != OpenAPI_preemption_vulnerability_NULL) { if (cJSON_AddStringToObject(item, "preemptVuln", OpenAPI_preemption_vulnerability_ToString(media_component->preempt_vuln)) == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [preempt_vuln]"); goto end; } } - if (media_component->prio_sharing_ind) { + if (media_component->prio_sharing_ind != OpenAPI_priority_sharing_indicator_NULL) { if (cJSON_AddStringToObject(item, "prioSharingInd", OpenAPI_priority_sharing_indicator_ToString(media_component->prio_sharing_ind)) == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [prio_sharing_ind]"); goto end; } } - if (media_component->res_prio) { + if (media_component->res_prio != OpenAPI_reserv_priority_NULL) { if (cJSON_AddStringToObject(item, "resPrio", OpenAPI_reserv_priority_ToString(media_component->res_prio)) == NULL) { ogs_error("OpenAPI_media_component_convertToJSON() failed [res_prio]"); goto end; @@ -459,33 +516,77 @@ end: OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_componentJSON) { OpenAPI_media_component_t *media_component_local_var = NULL; - cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "afAppId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *af_app_id = NULL; + cJSON *af_rout_req = NULL; + OpenAPI_af_routing_requirement_t *af_rout_req_local_nonprim = NULL; + cJSON *qos_reference = NULL; + cJSON *dis_ue_notif = NULL; + cJSON *alt_ser_reqs = NULL; + OpenAPI_list_t *alt_ser_reqsList = NULL; + cJSON *cont_ver = NULL; + cJSON *codecs = NULL; + OpenAPI_list_t *codecsList = NULL; + cJSON *des_max_latency = NULL; + cJSON *des_max_loss = NULL; + cJSON *flus_id = NULL; + cJSON *f_status = NULL; + OpenAPI_flow_status_e f_statusVariable = 0; + cJSON *mar_bw_dl = NULL; + cJSON *mar_bw_ul = NULL; + cJSON *max_packet_loss_rate_dl = NULL; + cJSON *max_packet_loss_rate_ul = NULL; + cJSON *max_supp_bw_dl = NULL; + cJSON *max_supp_bw_ul = NULL; + cJSON *med_comp_n = NULL; + cJSON *med_sub_comps = NULL; + OpenAPI_list_t *med_sub_compsList = NULL; + cJSON *med_type = NULL; + OpenAPI_media_type_e med_typeVariable = 0; + cJSON *min_des_bw_dl = NULL; + cJSON *min_des_bw_ul = NULL; + cJSON *mir_bw_dl = NULL; + cJSON *mir_bw_ul = NULL; + cJSON *preempt_cap = NULL; + OpenAPI_preemption_capability_e preempt_capVariable = 0; + cJSON *preempt_vuln = NULL; + OpenAPI_preemption_vulnerability_e preempt_vulnVariable = 0; + cJSON *prio_sharing_ind = NULL; + OpenAPI_priority_sharing_indicator_e prio_sharing_indVariable = 0; + cJSON *res_prio = NULL; + OpenAPI_reserv_priority_e res_prioVariable = 0; + cJSON *rr_bw = NULL; + cJSON *rs_bw = NULL; + cJSON *sharing_key_dl = NULL; + cJSON *sharing_key_ul = NULL; + cJSON *tsn_qos = NULL; + OpenAPI_tsn_qos_container_t *tsn_qos_local_nonprim = NULL; + cJSON *tscai_input_dl = NULL; + OpenAPI_tscai_input_container_t *tscai_input_dl_local_nonprim = NULL; + cJSON *tscai_input_ul = NULL; + OpenAPI_tscai_input_container_t *tscai_input_ul_local_nonprim = NULL; + af_app_id = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "afAppId"); if (af_app_id) { - if (!cJSON_IsString(af_app_id)) { + if (!cJSON_IsString(af_app_id) && !cJSON_IsNull(af_app_id)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [af_app_id]"); goto end; } } - cJSON *af_rout_req = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "afRoutReq"); - - OpenAPI_af_routing_requirement_t *af_rout_req_local_nonprim = NULL; + af_rout_req = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "afRoutReq"); if (af_rout_req) { af_rout_req_local_nonprim = OpenAPI_af_routing_requirement_parseFromJSON(af_rout_req); } - cJSON *qos_reference = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "qosReference"); - + qos_reference = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "qosReference"); if (qos_reference) { - if (!cJSON_IsString(qos_reference)) { + if (!cJSON_IsString(qos_reference) && !cJSON_IsNull(qos_reference)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [qos_reference]"); goto end; } } - cJSON *dis_ue_notif = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "disUeNotif"); - + dis_ue_notif = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "disUeNotif"); if (dis_ue_notif) { if (!cJSON_IsBool(dis_ue_notif)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [dis_ue_notif]"); @@ -493,28 +594,28 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co } } - cJSON *alt_ser_reqs = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "altSerReqs"); - - OpenAPI_list_t *alt_ser_reqsList; + alt_ser_reqs = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "altSerReqs"); if (alt_ser_reqs) { - cJSON *alt_ser_reqs_local; - if (!cJSON_IsArray(alt_ser_reqs)) { - ogs_error("OpenAPI_media_component_parseFromJSON() failed [alt_ser_reqs]"); - goto end; - } - alt_ser_reqsList = OpenAPI_list_create(); + cJSON *alt_ser_reqs_local = NULL; + if (!cJSON_IsArray(alt_ser_reqs)) { + ogs_error("OpenAPI_media_component_parseFromJSON() failed [alt_ser_reqs]"); + goto end; + } - cJSON_ArrayForEach(alt_ser_reqs_local, alt_ser_reqs) { - if (!cJSON_IsString(alt_ser_reqs_local)) { - ogs_error("OpenAPI_media_component_parseFromJSON() failed [alt_ser_reqs]"); - goto end; - } - OpenAPI_list_add(alt_ser_reqsList, ogs_strdup(alt_ser_reqs_local->valuestring)); - } + alt_ser_reqsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alt_ser_reqs_local, alt_ser_reqs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(alt_ser_reqs_local)) { + ogs_error("OpenAPI_media_component_parseFromJSON() failed [alt_ser_reqs]"); + goto end; + } + OpenAPI_list_add(alt_ser_reqsList, ogs_strdup(alt_ser_reqs_local->valuestring)); + } } - cJSON *cont_ver = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "contVer"); - + cont_ver = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "contVer"); if (cont_ver) { if (!cJSON_IsNumber(cont_ver)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [cont_ver]"); @@ -522,28 +623,28 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co } } - cJSON *codecs = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "codecs"); - - OpenAPI_list_t *codecsList; + codecs = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "codecs"); if (codecs) { - cJSON *codecs_local; - if (!cJSON_IsArray(codecs)) { - ogs_error("OpenAPI_media_component_parseFromJSON() failed [codecs]"); - goto end; - } - codecsList = OpenAPI_list_create(); + cJSON *codecs_local = NULL; + if (!cJSON_IsArray(codecs)) { + ogs_error("OpenAPI_media_component_parseFromJSON() failed [codecs]"); + goto end; + } - cJSON_ArrayForEach(codecs_local, codecs) { - if (!cJSON_IsString(codecs_local)) { - ogs_error("OpenAPI_media_component_parseFromJSON() failed [codecs]"); - goto end; - } - OpenAPI_list_add(codecsList, ogs_strdup(codecs_local->valuestring)); - } + codecsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(codecs_local, codecs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(codecs_local)) { + ogs_error("OpenAPI_media_component_parseFromJSON() failed [codecs]"); + goto end; + } + OpenAPI_list_add(codecsList, ogs_strdup(codecs_local->valuestring)); + } } - cJSON *des_max_latency = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "desMaxLatency"); - + des_max_latency = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "desMaxLatency"); if (des_max_latency) { if (!cJSON_IsNumber(des_max_latency)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [des_max_latency]"); @@ -551,8 +652,7 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co } } - cJSON *des_max_loss = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "desMaxLoss"); - + des_max_loss = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "desMaxLoss"); if (des_max_loss) { if (!cJSON_IsNumber(des_max_loss)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [des_max_loss]"); @@ -560,18 +660,15 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co } } - cJSON *flus_id = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "flusId"); - + flus_id = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "flusId"); if (flus_id) { - if (!cJSON_IsString(flus_id)) { + if (!cJSON_IsString(flus_id) && !cJSON_IsNull(flus_id)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [flus_id]"); goto end; } } - cJSON *f_status = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "fStatus"); - - OpenAPI_flow_status_e f_statusVariable; + f_status = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "fStatus"); if (f_status) { if (!cJSON_IsString(f_status)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [f_status]"); @@ -580,26 +677,23 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co f_statusVariable = OpenAPI_flow_status_FromString(f_status->valuestring); } - cJSON *mar_bw_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "marBwDl"); - + mar_bw_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "marBwDl"); if (mar_bw_dl) { - if (!cJSON_IsString(mar_bw_dl)) { + if (!cJSON_IsString(mar_bw_dl) && !cJSON_IsNull(mar_bw_dl)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [mar_bw_dl]"); goto end; } } - cJSON *mar_bw_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "marBwUl"); - + mar_bw_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "marBwUl"); if (mar_bw_ul) { - if (!cJSON_IsString(mar_bw_ul)) { + if (!cJSON_IsString(mar_bw_ul) && !cJSON_IsNull(mar_bw_ul)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [mar_bw_ul]"); goto end; } } - cJSON *max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "maxPacketLossRateDl"); - + max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "maxPacketLossRateDl"); if (max_packet_loss_rate_dl) { if (!cJSON_IsNumber(max_packet_loss_rate_dl)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [max_packet_loss_rate_dl]"); @@ -607,8 +701,7 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co } } - cJSON *max_packet_loss_rate_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "maxPacketLossRateUl"); - + max_packet_loss_rate_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "maxPacketLossRateUl"); if (max_packet_loss_rate_ul) { if (!cJSON_IsNumber(max_packet_loss_rate_ul)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [max_packet_loss_rate_ul]"); @@ -616,64 +709,59 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co } } - cJSON *max_supp_bw_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "maxSuppBwDl"); - + max_supp_bw_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "maxSuppBwDl"); if (max_supp_bw_dl) { - if (!cJSON_IsString(max_supp_bw_dl)) { + if (!cJSON_IsString(max_supp_bw_dl) && !cJSON_IsNull(max_supp_bw_dl)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [max_supp_bw_dl]"); goto end; } } - cJSON *max_supp_bw_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "maxSuppBwUl"); - + max_supp_bw_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "maxSuppBwUl"); if (max_supp_bw_ul) { - if (!cJSON_IsString(max_supp_bw_ul)) { + if (!cJSON_IsString(max_supp_bw_ul) && !cJSON_IsNull(max_supp_bw_ul)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [max_supp_bw_ul]"); goto end; } } - cJSON *med_comp_n = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "medCompN"); + med_comp_n = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "medCompN"); if (!med_comp_n) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [med_comp_n]"); goto end; } - if (!cJSON_IsNumber(med_comp_n)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [med_comp_n]"); goto end; } - cJSON *med_sub_comps = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "medSubComps"); - - OpenAPI_list_t *med_sub_compsList; + med_sub_comps = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "medSubComps"); if (med_sub_comps) { - cJSON *med_sub_comps_local_map; - if (!cJSON_IsObject(med_sub_comps)) { - ogs_error("OpenAPI_media_component_parseFromJSON() failed [med_sub_comps]"); - goto end; - } - med_sub_compsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(med_sub_comps_local_map, med_sub_comps) { - cJSON *localMapObject = med_sub_comps_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_media_sub_component_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_media_component_parseFromJSON() failed [inner]"); + cJSON *med_sub_comps_local_map = NULL; + if (!cJSON_IsObject(med_sub_comps) && !cJSON_IsNull(med_sub_comps)) { + ogs_error("OpenAPI_media_component_parseFromJSON() failed [med_sub_comps]"); goto end; } - OpenAPI_list_add(med_sub_compsList, localMapKeyPair); - } + if (cJSON_IsObject(med_sub_comps)) { + med_sub_compsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(med_sub_comps_local_map, med_sub_comps) { + cJSON *localMapObject = med_sub_comps_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_media_sub_component_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_media_component_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(med_sub_compsList, localMapKeyPair); + } + } } - cJSON *med_type = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "medType"); - - OpenAPI_media_type_e med_typeVariable; + med_type = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "medType"); if (med_type) { if (!cJSON_IsString(med_type)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [med_type]"); @@ -682,45 +770,39 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co med_typeVariable = OpenAPI_media_type_FromString(med_type->valuestring); } - cJSON *min_des_bw_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "minDesBwDl"); - + min_des_bw_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "minDesBwDl"); if (min_des_bw_dl) { - if (!cJSON_IsString(min_des_bw_dl)) { + if (!cJSON_IsString(min_des_bw_dl) && !cJSON_IsNull(min_des_bw_dl)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [min_des_bw_dl]"); goto end; } } - cJSON *min_des_bw_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "minDesBwUl"); - + min_des_bw_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "minDesBwUl"); if (min_des_bw_ul) { - if (!cJSON_IsString(min_des_bw_ul)) { + if (!cJSON_IsString(min_des_bw_ul) && !cJSON_IsNull(min_des_bw_ul)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [min_des_bw_ul]"); goto end; } } - cJSON *mir_bw_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "mirBwDl"); - + mir_bw_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "mirBwDl"); if (mir_bw_dl) { - if (!cJSON_IsString(mir_bw_dl)) { + if (!cJSON_IsString(mir_bw_dl) && !cJSON_IsNull(mir_bw_dl)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [mir_bw_dl]"); goto end; } } - cJSON *mir_bw_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "mirBwUl"); - + mir_bw_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "mirBwUl"); if (mir_bw_ul) { - if (!cJSON_IsString(mir_bw_ul)) { + if (!cJSON_IsString(mir_bw_ul) && !cJSON_IsNull(mir_bw_ul)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [mir_bw_ul]"); goto end; } } - cJSON *preempt_cap = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "preemptCap"); - - OpenAPI_preemption_capability_e preempt_capVariable; + preempt_cap = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "preemptCap"); if (preempt_cap) { if (!cJSON_IsString(preempt_cap)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [preempt_cap]"); @@ -729,9 +811,7 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co preempt_capVariable = OpenAPI_preemption_capability_FromString(preempt_cap->valuestring); } - cJSON *preempt_vuln = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "preemptVuln"); - - OpenAPI_preemption_vulnerability_e preempt_vulnVariable; + preempt_vuln = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "preemptVuln"); if (preempt_vuln) { if (!cJSON_IsString(preempt_vuln)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [preempt_vuln]"); @@ -740,9 +820,7 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co preempt_vulnVariable = OpenAPI_preemption_vulnerability_FromString(preempt_vuln->valuestring); } - cJSON *prio_sharing_ind = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "prioSharingInd"); - - OpenAPI_priority_sharing_indicator_e prio_sharing_indVariable; + prio_sharing_ind = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "prioSharingInd"); if (prio_sharing_ind) { if (!cJSON_IsString(prio_sharing_ind)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [prio_sharing_ind]"); @@ -751,9 +829,7 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co prio_sharing_indVariable = OpenAPI_priority_sharing_indicator_FromString(prio_sharing_ind->valuestring); } - cJSON *res_prio = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "resPrio"); - - OpenAPI_reserv_priority_e res_prioVariable; + res_prio = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "resPrio"); if (res_prio) { if (!cJSON_IsString(res_prio)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [res_prio]"); @@ -762,26 +838,23 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co res_prioVariable = OpenAPI_reserv_priority_FromString(res_prio->valuestring); } - cJSON *rr_bw = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "rrBw"); - + rr_bw = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "rrBw"); if (rr_bw) { - if (!cJSON_IsString(rr_bw)) { + if (!cJSON_IsString(rr_bw) && !cJSON_IsNull(rr_bw)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [rr_bw]"); goto end; } } - cJSON *rs_bw = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "rsBw"); - + rs_bw = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "rsBw"); if (rs_bw) { - if (!cJSON_IsString(rs_bw)) { + if (!cJSON_IsString(rs_bw) && !cJSON_IsNull(rs_bw)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [rs_bw]"); goto end; } } - cJSON *sharing_key_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "sharingKeyDl"); - + sharing_key_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "sharingKeyDl"); if (sharing_key_dl) { if (!cJSON_IsNumber(sharing_key_dl)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [sharing_key_dl]"); @@ -789,8 +862,7 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co } } - cJSON *sharing_key_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "sharingKeyUl"); - + sharing_key_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "sharingKeyUl"); if (sharing_key_ul) { if (!cJSON_IsNumber(sharing_key_ul)) { ogs_error("OpenAPI_media_component_parseFromJSON() failed [sharing_key_ul]"); @@ -798,31 +870,25 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co } } - cJSON *tsn_qos = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "tsnQos"); - - OpenAPI_tsn_qos_container_t *tsn_qos_local_nonprim = NULL; + tsn_qos = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "tsnQos"); if (tsn_qos) { tsn_qos_local_nonprim = OpenAPI_tsn_qos_container_parseFromJSON(tsn_qos); } - cJSON *tscai_input_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "tscaiInputDl"); - - OpenAPI_tscai_input_container_t *tscai_input_dl_local_nonprim = NULL; + tscai_input_dl = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "tscaiInputDl"); if (tscai_input_dl) { tscai_input_dl_local_nonprim = OpenAPI_tscai_input_container_parseFromJSON(tscai_input_dl); } - cJSON *tscai_input_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "tscaiInputUl"); - - OpenAPI_tscai_input_container_t *tscai_input_ul_local_nonprim = NULL; + tscai_input_ul = cJSON_GetObjectItemCaseSensitive(media_componentJSON, "tscaiInputUl"); if (tscai_input_ul) { tscai_input_ul_local_nonprim = OpenAPI_tscai_input_container_parseFromJSON(tscai_input_ul); } media_component_local_var = OpenAPI_media_component_create ( - af_app_id ? ogs_strdup(af_app_id->valuestring) : NULL, + af_app_id && !cJSON_IsNull(af_app_id) ? ogs_strdup(af_app_id->valuestring) : NULL, af_rout_req ? af_rout_req_local_nonprim : NULL, - qos_reference ? ogs_strdup(qos_reference->valuestring) : NULL, + qos_reference && !cJSON_IsNull(qos_reference) ? ogs_strdup(qos_reference->valuestring) : NULL, dis_ue_notif ? true : false, dis_ue_notif ? dis_ue_notif->valueint : 0, alt_ser_reqs ? alt_ser_reqsList : NULL, @@ -833,30 +899,30 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co des_max_latency ? des_max_latency->valuedouble : 0, des_max_loss ? true : false, des_max_loss ? des_max_loss->valuedouble : 0, - flus_id ? ogs_strdup(flus_id->valuestring) : NULL, + flus_id && !cJSON_IsNull(flus_id) ? ogs_strdup(flus_id->valuestring) : NULL, f_status ? f_statusVariable : 0, - mar_bw_dl ? ogs_strdup(mar_bw_dl->valuestring) : NULL, - mar_bw_ul ? ogs_strdup(mar_bw_ul->valuestring) : NULL, + mar_bw_dl && !cJSON_IsNull(mar_bw_dl) ? ogs_strdup(mar_bw_dl->valuestring) : NULL, + mar_bw_ul && !cJSON_IsNull(mar_bw_ul) ? ogs_strdup(mar_bw_ul->valuestring) : NULL, max_packet_loss_rate_dl ? true : false, max_packet_loss_rate_dl ? max_packet_loss_rate_dl->valuedouble : 0, max_packet_loss_rate_ul ? true : false, max_packet_loss_rate_ul ? max_packet_loss_rate_ul->valuedouble : 0, - max_supp_bw_dl ? ogs_strdup(max_supp_bw_dl->valuestring) : NULL, - max_supp_bw_ul ? ogs_strdup(max_supp_bw_ul->valuestring) : NULL, + max_supp_bw_dl && !cJSON_IsNull(max_supp_bw_dl) ? ogs_strdup(max_supp_bw_dl->valuestring) : NULL, + max_supp_bw_ul && !cJSON_IsNull(max_supp_bw_ul) ? ogs_strdup(max_supp_bw_ul->valuestring) : NULL, med_comp_n->valuedouble, med_sub_comps ? med_sub_compsList : NULL, med_type ? med_typeVariable : 0, - min_des_bw_dl ? ogs_strdup(min_des_bw_dl->valuestring) : NULL, - min_des_bw_ul ? ogs_strdup(min_des_bw_ul->valuestring) : NULL, - mir_bw_dl ? ogs_strdup(mir_bw_dl->valuestring) : NULL, - mir_bw_ul ? ogs_strdup(mir_bw_ul->valuestring) : NULL, + min_des_bw_dl && !cJSON_IsNull(min_des_bw_dl) ? ogs_strdup(min_des_bw_dl->valuestring) : NULL, + min_des_bw_ul && !cJSON_IsNull(min_des_bw_ul) ? ogs_strdup(min_des_bw_ul->valuestring) : NULL, + mir_bw_dl && !cJSON_IsNull(mir_bw_dl) ? ogs_strdup(mir_bw_dl->valuestring) : NULL, + mir_bw_ul && !cJSON_IsNull(mir_bw_ul) ? ogs_strdup(mir_bw_ul->valuestring) : NULL, preempt_cap ? preempt_capVariable : 0, preempt_vuln ? preempt_vulnVariable : 0, prio_sharing_ind ? prio_sharing_indVariable : 0, res_prio ? res_prioVariable : 0, - rr_bw ? ogs_strdup(rr_bw->valuestring) : NULL, - rs_bw ? ogs_strdup(rs_bw->valuestring) : NULL, + rr_bw && !cJSON_IsNull(rr_bw) ? ogs_strdup(rr_bw->valuestring) : NULL, + rs_bw && !cJSON_IsNull(rs_bw) ? ogs_strdup(rs_bw->valuestring) : NULL, sharing_key_dl ? true : false, sharing_key_dl ? sharing_key_dl->valuedouble : 0, sharing_key_ul ? true : false, @@ -868,6 +934,46 @@ OpenAPI_media_component_t *OpenAPI_media_component_parseFromJSON(cJSON *media_co return media_component_local_var; end: + if (af_rout_req_local_nonprim) { + OpenAPI_af_routing_requirement_free(af_rout_req_local_nonprim); + af_rout_req_local_nonprim = NULL; + } + if (alt_ser_reqsList) { + OpenAPI_list_for_each(alt_ser_reqsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(alt_ser_reqsList); + alt_ser_reqsList = NULL; + } + if (codecsList) { + OpenAPI_list_for_each(codecsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(codecsList); + codecsList = NULL; + } + if (med_sub_compsList) { + OpenAPI_list_for_each(med_sub_compsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_sub_component_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(med_sub_compsList); + med_sub_compsList = NULL; + } + if (tsn_qos_local_nonprim) { + OpenAPI_tsn_qos_container_free(tsn_qos_local_nonprim); + tsn_qos_local_nonprim = NULL; + } + if (tscai_input_dl_local_nonprim) { + OpenAPI_tscai_input_container_free(tscai_input_dl_local_nonprim); + tscai_input_dl_local_nonprim = NULL; + } + if (tscai_input_ul_local_nonprim) { + OpenAPI_tscai_input_container_free(tscai_input_ul_local_nonprim); + tscai_input_ul_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/media_component_rm.c b/lib/sbi/openapi/model/media_component_rm.c index cd16245ee..f19c3d4a9 100644 --- a/lib/sbi/openapi/model/media_component_rm.c +++ b/lib/sbi/openapi/model/media_component_rm.c @@ -102,50 +102,118 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_create( void OpenAPI_media_component_rm_free(OpenAPI_media_component_rm_t *media_component_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == media_component_rm) { return; } - OpenAPI_lnode_t *node; - ogs_free(media_component_rm->af_app_id); - OpenAPI_af_routing_requirement_rm_free(media_component_rm->af_rout_req); - ogs_free(media_component_rm->qos_reference); - OpenAPI_list_for_each(media_component_rm->alt_ser_reqs, node) { - ogs_free(node->data); + if (media_component_rm->af_app_id) { + ogs_free(media_component_rm->af_app_id); + media_component_rm->af_app_id = NULL; } - OpenAPI_list_free(media_component_rm->alt_ser_reqs); - OpenAPI_list_for_each(media_component_rm->codecs, node) { - ogs_free(node->data); + if (media_component_rm->af_rout_req) { + OpenAPI_af_routing_requirement_rm_free(media_component_rm->af_rout_req); + media_component_rm->af_rout_req = NULL; } - OpenAPI_list_free(media_component_rm->codecs); - ogs_free(media_component_rm->flus_id); - ogs_free(media_component_rm->mar_bw_dl); - ogs_free(media_component_rm->mar_bw_ul); - ogs_free(media_component_rm->max_supp_bw_dl); - ogs_free(media_component_rm->max_supp_bw_ul); - OpenAPI_list_for_each(media_component_rm->med_sub_comps, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_media_sub_component_rm_free(localKeyValue->value); - ogs_free(localKeyValue); + if (media_component_rm->qos_reference) { + ogs_free(media_component_rm->qos_reference); + media_component_rm->qos_reference = NULL; + } + if (media_component_rm->alt_ser_reqs) { + OpenAPI_list_for_each(media_component_rm->alt_ser_reqs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(media_component_rm->alt_ser_reqs); + media_component_rm->alt_ser_reqs = NULL; + } + if (media_component_rm->codecs) { + OpenAPI_list_for_each(media_component_rm->codecs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(media_component_rm->codecs); + media_component_rm->codecs = NULL; + } + if (media_component_rm->flus_id) { + ogs_free(media_component_rm->flus_id); + media_component_rm->flus_id = NULL; + } + if (media_component_rm->mar_bw_dl) { + ogs_free(media_component_rm->mar_bw_dl); + media_component_rm->mar_bw_dl = NULL; + } + if (media_component_rm->mar_bw_ul) { + ogs_free(media_component_rm->mar_bw_ul); + media_component_rm->mar_bw_ul = NULL; + } + if (media_component_rm->max_supp_bw_dl) { + ogs_free(media_component_rm->max_supp_bw_dl); + media_component_rm->max_supp_bw_dl = NULL; + } + if (media_component_rm->max_supp_bw_ul) { + ogs_free(media_component_rm->max_supp_bw_ul); + media_component_rm->max_supp_bw_ul = NULL; + } + if (media_component_rm->med_sub_comps) { + OpenAPI_list_for_each(media_component_rm->med_sub_comps, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_sub_component_rm_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(media_component_rm->med_sub_comps); + media_component_rm->med_sub_comps = NULL; + } + if (media_component_rm->min_des_bw_dl) { + ogs_free(media_component_rm->min_des_bw_dl); + media_component_rm->min_des_bw_dl = NULL; + } + if (media_component_rm->min_des_bw_ul) { + ogs_free(media_component_rm->min_des_bw_ul); + media_component_rm->min_des_bw_ul = NULL; + } + if (media_component_rm->mir_bw_dl) { + ogs_free(media_component_rm->mir_bw_dl); + media_component_rm->mir_bw_dl = NULL; + } + if (media_component_rm->mir_bw_ul) { + ogs_free(media_component_rm->mir_bw_ul); + media_component_rm->mir_bw_ul = NULL; + } + if (media_component_rm->preempt_cap) { + OpenAPI_preemption_capability_rm_free(media_component_rm->preempt_cap); + media_component_rm->preempt_cap = NULL; + } + if (media_component_rm->preempt_vuln) { + OpenAPI_preemption_vulnerability_rm_free(media_component_rm->preempt_vuln); + media_component_rm->preempt_vuln = NULL; + } + if (media_component_rm->rr_bw) { + ogs_free(media_component_rm->rr_bw); + media_component_rm->rr_bw = NULL; + } + if (media_component_rm->rs_bw) { + ogs_free(media_component_rm->rs_bw); + media_component_rm->rs_bw = NULL; + } + if (media_component_rm->tsn_qos) { + OpenAPI_tsn_qos_container_rm_free(media_component_rm->tsn_qos); + media_component_rm->tsn_qos = NULL; + } + if (media_component_rm->tscai_input_dl) { + OpenAPI_tscai_input_container_free(media_component_rm->tscai_input_dl); + media_component_rm->tscai_input_dl = NULL; + } + if (media_component_rm->tscai_input_ul) { + OpenAPI_tscai_input_container_free(media_component_rm->tscai_input_ul); + media_component_rm->tscai_input_ul = NULL; } - OpenAPI_list_free(media_component_rm->med_sub_comps); - ogs_free(media_component_rm->min_des_bw_dl); - ogs_free(media_component_rm->min_des_bw_ul); - ogs_free(media_component_rm->mir_bw_dl); - ogs_free(media_component_rm->mir_bw_ul); - OpenAPI_preemption_capability_rm_free(media_component_rm->preempt_cap); - OpenAPI_preemption_vulnerability_rm_free(media_component_rm->preempt_vuln); - ogs_free(media_component_rm->rr_bw); - ogs_free(media_component_rm->rs_bw); - OpenAPI_tsn_qos_container_rm_free(media_component_rm->tsn_qos); - OpenAPI_tscai_input_container_free(media_component_rm->tscai_input_dl); - OpenAPI_tscai_input_container_free(media_component_rm->tscai_input_ul); ogs_free(media_component_rm); } cJSON *OpenAPI_media_component_rm_convertToJSON(OpenAPI_media_component_rm_t *media_component_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (media_component_rm == NULL) { ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [MediaComponentRm]"); @@ -181,19 +249,17 @@ cJSON *OpenAPI_media_component_rm_convertToJSON(OpenAPI_media_component_rm_t *me } if (media_component_rm->alt_ser_reqs) { - cJSON *alt_ser_reqs = cJSON_AddArrayToObject(item, "altSerReqs"); - if (alt_ser_reqs == NULL) { + cJSON *alt_ser_reqsList = cJSON_AddArrayToObject(item, "altSerReqs"); + if (alt_ser_reqsList == NULL) { ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [alt_ser_reqs]"); goto end; } - - OpenAPI_lnode_t *alt_ser_reqs_node; - OpenAPI_list_for_each(media_component_rm->alt_ser_reqs, alt_ser_reqs_node) { - if (cJSON_AddStringToObject(alt_ser_reqs, "", (char*)alt_ser_reqs_node->data) == NULL) { - ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [alt_ser_reqs]"); - goto end; + OpenAPI_list_for_each(media_component_rm->alt_ser_reqs, node) { + if (cJSON_AddStringToObject(alt_ser_reqsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [alt_ser_reqs]"); + goto end; + } } - } } if (media_component_rm->is_dis_ue_notif) { @@ -211,19 +277,17 @@ cJSON *OpenAPI_media_component_rm_convertToJSON(OpenAPI_media_component_rm_t *me } if (media_component_rm->codecs) { - cJSON *codecs = cJSON_AddArrayToObject(item, "codecs"); - if (codecs == NULL) { + cJSON *codecsList = cJSON_AddArrayToObject(item, "codecs"); + if (codecsList == NULL) { ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [codecs]"); goto end; } - - OpenAPI_lnode_t *codecs_node; - OpenAPI_list_for_each(media_component_rm->codecs, codecs_node) { - if (cJSON_AddStringToObject(codecs, "", (char*)codecs_node->data) == NULL) { - ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [codecs]"); - goto end; + OpenAPI_list_for_each(media_component_rm->codecs, node) { + if (cJSON_AddStringToObject(codecsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [codecs]"); + goto end; + } } - } } if (media_component_rm->is_des_max_latency) { @@ -247,7 +311,7 @@ cJSON *OpenAPI_media_component_rm_convertToJSON(OpenAPI_media_component_rm_t *me } } - if (media_component_rm->f_status) { + if (media_component_rm->f_status != OpenAPI_flow_status_NULL) { if (cJSON_AddStringToObject(item, "fStatus", OpenAPI_flow_status_ToString(media_component_rm->f_status)) == NULL) { ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [f_status]"); goto end; @@ -308,23 +372,22 @@ cJSON *OpenAPI_media_component_rm_convertToJSON(OpenAPI_media_component_rm_t *me goto end; } cJSON *localMapObject = med_sub_comps; - OpenAPI_lnode_t *med_sub_comps_node; if (media_component_rm->med_sub_comps) { - OpenAPI_list_for_each(media_component_rm->med_sub_comps, med_sub_comps_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)med_sub_comps_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_media_sub_component_rm_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(media_component_rm->med_sub_comps, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_media_sub_component_rm_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } - if (media_component_rm->med_type) { + if (media_component_rm->med_type != OpenAPI_media_type_NULL) { if (cJSON_AddStringToObject(item, "medType", OpenAPI_media_type_ToString(media_component_rm->med_type)) == NULL) { ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [med_type]"); goto end; @@ -385,14 +448,14 @@ cJSON *OpenAPI_media_component_rm_convertToJSON(OpenAPI_media_component_rm_t *me } } - if (media_component_rm->prio_sharing_ind) { + if (media_component_rm->prio_sharing_ind != OpenAPI_priority_sharing_indicator_NULL) { if (cJSON_AddStringToObject(item, "prioSharingInd", OpenAPI_priority_sharing_indicator_ToString(media_component_rm->prio_sharing_ind)) == NULL) { ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [prio_sharing_ind]"); goto end; } } - if (media_component_rm->res_prio) { + if (media_component_rm->res_prio != OpenAPI_reserv_priority_NULL) { if (cJSON_AddStringToObject(item, "resPrio", OpenAPI_reserv_priority_ToString(media_component_rm->res_prio)) == NULL) { ogs_error("OpenAPI_media_component_rm_convertToJSON() failed [res_prio]"); goto end; @@ -473,53 +536,98 @@ end: OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *media_component_rmJSON) { OpenAPI_media_component_rm_t *media_component_rm_local_var = NULL; - cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "afAppId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *af_app_id = NULL; + cJSON *af_rout_req = NULL; + OpenAPI_af_routing_requirement_rm_t *af_rout_req_local_nonprim = NULL; + cJSON *qos_reference = NULL; + cJSON *alt_ser_reqs = NULL; + OpenAPI_list_t *alt_ser_reqsList = NULL; + cJSON *dis_ue_notif = NULL; + cJSON *cont_ver = NULL; + cJSON *codecs = NULL; + OpenAPI_list_t *codecsList = NULL; + cJSON *des_max_latency = NULL; + cJSON *des_max_loss = NULL; + cJSON *flus_id = NULL; + cJSON *f_status = NULL; + OpenAPI_flow_status_e f_statusVariable = 0; + cJSON *mar_bw_dl = NULL; + cJSON *mar_bw_ul = NULL; + cJSON *max_packet_loss_rate_dl = NULL; + cJSON *max_packet_loss_rate_ul = NULL; + cJSON *max_supp_bw_dl = NULL; + cJSON *max_supp_bw_ul = NULL; + cJSON *med_comp_n = NULL; + cJSON *med_sub_comps = NULL; + OpenAPI_list_t *med_sub_compsList = NULL; + cJSON *med_type = NULL; + OpenAPI_media_type_e med_typeVariable = 0; + cJSON *min_des_bw_dl = NULL; + cJSON *min_des_bw_ul = NULL; + cJSON *mir_bw_dl = NULL; + cJSON *mir_bw_ul = NULL; + cJSON *preempt_cap = NULL; + OpenAPI_preemption_capability_rm_t *preempt_cap_local_nonprim = NULL; + cJSON *preempt_vuln = NULL; + OpenAPI_preemption_vulnerability_rm_t *preempt_vuln_local_nonprim = NULL; + cJSON *prio_sharing_ind = NULL; + OpenAPI_priority_sharing_indicator_e prio_sharing_indVariable = 0; + cJSON *res_prio = NULL; + OpenAPI_reserv_priority_e res_prioVariable = 0; + cJSON *rr_bw = NULL; + cJSON *rs_bw = NULL; + cJSON *sharing_key_dl = NULL; + cJSON *sharing_key_ul = NULL; + cJSON *tsn_qos = NULL; + OpenAPI_tsn_qos_container_rm_t *tsn_qos_local_nonprim = NULL; + cJSON *tscai_input_dl = NULL; + OpenAPI_tscai_input_container_t *tscai_input_dl_local_nonprim = NULL; + cJSON *tscai_input_ul = NULL; + OpenAPI_tscai_input_container_t *tscai_input_ul_local_nonprim = NULL; + af_app_id = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "afAppId"); if (af_app_id) { - if (!cJSON_IsString(af_app_id)) { + if (!cJSON_IsString(af_app_id) && !cJSON_IsNull(af_app_id)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [af_app_id]"); goto end; } } - cJSON *af_rout_req = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "afRoutReq"); - - OpenAPI_af_routing_requirement_rm_t *af_rout_req_local_nonprim = NULL; + af_rout_req = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "afRoutReq"); if (af_rout_req) { af_rout_req_local_nonprim = OpenAPI_af_routing_requirement_rm_parseFromJSON(af_rout_req); } - cJSON *qos_reference = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "qosReference"); - + qos_reference = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "qosReference"); if (qos_reference) { - if (!cJSON_IsString(qos_reference)) { + if (!cJSON_IsString(qos_reference) && !cJSON_IsNull(qos_reference)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [qos_reference]"); goto end; } } - cJSON *alt_ser_reqs = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "altSerReqs"); - - OpenAPI_list_t *alt_ser_reqsList; + alt_ser_reqs = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "altSerReqs"); if (alt_ser_reqs) { - cJSON *alt_ser_reqs_local; - if (!cJSON_IsArray(alt_ser_reqs)) { - ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [alt_ser_reqs]"); - goto end; - } - alt_ser_reqsList = OpenAPI_list_create(); + cJSON *alt_ser_reqs_local = NULL; + if (!cJSON_IsArray(alt_ser_reqs)) { + ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [alt_ser_reqs]"); + goto end; + } - cJSON_ArrayForEach(alt_ser_reqs_local, alt_ser_reqs) { - if (!cJSON_IsString(alt_ser_reqs_local)) { - ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [alt_ser_reqs]"); - goto end; - } - OpenAPI_list_add(alt_ser_reqsList, ogs_strdup(alt_ser_reqs_local->valuestring)); - } + alt_ser_reqsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alt_ser_reqs_local, alt_ser_reqs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(alt_ser_reqs_local)) { + ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [alt_ser_reqs]"); + goto end; + } + OpenAPI_list_add(alt_ser_reqsList, ogs_strdup(alt_ser_reqs_local->valuestring)); + } } - cJSON *dis_ue_notif = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "disUeNotif"); - + dis_ue_notif = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "disUeNotif"); if (dis_ue_notif) { if (!cJSON_IsBool(dis_ue_notif)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [dis_ue_notif]"); @@ -527,8 +635,7 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me } } - cJSON *cont_ver = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "contVer"); - + cont_ver = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "contVer"); if (cont_ver) { if (!cJSON_IsNumber(cont_ver)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [cont_ver]"); @@ -536,28 +643,28 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me } } - cJSON *codecs = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "codecs"); - - OpenAPI_list_t *codecsList; + codecs = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "codecs"); if (codecs) { - cJSON *codecs_local; - if (!cJSON_IsArray(codecs)) { - ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [codecs]"); - goto end; - } - codecsList = OpenAPI_list_create(); + cJSON *codecs_local = NULL; + if (!cJSON_IsArray(codecs)) { + ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [codecs]"); + goto end; + } - cJSON_ArrayForEach(codecs_local, codecs) { - if (!cJSON_IsString(codecs_local)) { - ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [codecs]"); - goto end; - } - OpenAPI_list_add(codecsList, ogs_strdup(codecs_local->valuestring)); - } + codecsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(codecs_local, codecs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(codecs_local)) { + ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [codecs]"); + goto end; + } + OpenAPI_list_add(codecsList, ogs_strdup(codecs_local->valuestring)); + } } - cJSON *des_max_latency = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "desMaxLatency"); - + des_max_latency = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "desMaxLatency"); if (des_max_latency) { if (!cJSON_IsNumber(des_max_latency)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [des_max_latency]"); @@ -565,8 +672,7 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me } } - cJSON *des_max_loss = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "desMaxLoss"); - + des_max_loss = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "desMaxLoss"); if (des_max_loss) { if (!cJSON_IsNumber(des_max_loss)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [des_max_loss]"); @@ -574,18 +680,15 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me } } - cJSON *flus_id = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "flusId"); - + flus_id = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "flusId"); if (flus_id) { - if (!cJSON_IsString(flus_id)) { + if (!cJSON_IsString(flus_id) && !cJSON_IsNull(flus_id)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [flus_id]"); goto end; } } - cJSON *f_status = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "fStatus"); - - OpenAPI_flow_status_e f_statusVariable; + f_status = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "fStatus"); if (f_status) { if (!cJSON_IsString(f_status)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [f_status]"); @@ -594,26 +697,23 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me f_statusVariable = OpenAPI_flow_status_FromString(f_status->valuestring); } - cJSON *mar_bw_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "marBwDl"); - + mar_bw_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "marBwDl"); if (mar_bw_dl) { - if (!cJSON_IsString(mar_bw_dl)) { + if (!cJSON_IsString(mar_bw_dl) && !cJSON_IsNull(mar_bw_dl)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [mar_bw_dl]"); goto end; } } - cJSON *mar_bw_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "marBwUl"); - + mar_bw_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "marBwUl"); if (mar_bw_ul) { - if (!cJSON_IsString(mar_bw_ul)) { + if (!cJSON_IsString(mar_bw_ul) && !cJSON_IsNull(mar_bw_ul)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [mar_bw_ul]"); goto end; } } - cJSON *max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "maxPacketLossRateDl"); - + max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "maxPacketLossRateDl"); if (max_packet_loss_rate_dl) { if (!cJSON_IsNumber(max_packet_loss_rate_dl)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [max_packet_loss_rate_dl]"); @@ -621,8 +721,7 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me } } - cJSON *max_packet_loss_rate_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "maxPacketLossRateUl"); - + max_packet_loss_rate_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "maxPacketLossRateUl"); if (max_packet_loss_rate_ul) { if (!cJSON_IsNumber(max_packet_loss_rate_ul)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [max_packet_loss_rate_ul]"); @@ -630,64 +729,59 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me } } - cJSON *max_supp_bw_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "maxSuppBwDl"); - + max_supp_bw_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "maxSuppBwDl"); if (max_supp_bw_dl) { - if (!cJSON_IsString(max_supp_bw_dl)) { + if (!cJSON_IsString(max_supp_bw_dl) && !cJSON_IsNull(max_supp_bw_dl)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [max_supp_bw_dl]"); goto end; } } - cJSON *max_supp_bw_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "maxSuppBwUl"); - + max_supp_bw_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "maxSuppBwUl"); if (max_supp_bw_ul) { - if (!cJSON_IsString(max_supp_bw_ul)) { + if (!cJSON_IsString(max_supp_bw_ul) && !cJSON_IsNull(max_supp_bw_ul)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [max_supp_bw_ul]"); goto end; } } - cJSON *med_comp_n = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "medCompN"); + med_comp_n = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "medCompN"); if (!med_comp_n) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [med_comp_n]"); goto end; } - if (!cJSON_IsNumber(med_comp_n)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [med_comp_n]"); goto end; } - cJSON *med_sub_comps = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "medSubComps"); - - OpenAPI_list_t *med_sub_compsList; + med_sub_comps = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "medSubComps"); if (med_sub_comps) { - cJSON *med_sub_comps_local_map; - if (!cJSON_IsObject(med_sub_comps)) { - ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [med_sub_comps]"); - goto end; - } - med_sub_compsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(med_sub_comps_local_map, med_sub_comps) { - cJSON *localMapObject = med_sub_comps_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_media_sub_component_rm_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [inner]"); + cJSON *med_sub_comps_local_map = NULL; + if (!cJSON_IsObject(med_sub_comps) && !cJSON_IsNull(med_sub_comps)) { + ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [med_sub_comps]"); goto end; } - OpenAPI_list_add(med_sub_compsList, localMapKeyPair); - } + if (cJSON_IsObject(med_sub_comps)) { + med_sub_compsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(med_sub_comps_local_map, med_sub_comps) { + cJSON *localMapObject = med_sub_comps_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_media_sub_component_rm_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(med_sub_compsList, localMapKeyPair); + } + } } - cJSON *med_type = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "medType"); - - OpenAPI_media_type_e med_typeVariable; + med_type = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "medType"); if (med_type) { if (!cJSON_IsString(med_type)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [med_type]"); @@ -696,59 +790,49 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me med_typeVariable = OpenAPI_media_type_FromString(med_type->valuestring); } - cJSON *min_des_bw_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "minDesBwDl"); - + min_des_bw_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "minDesBwDl"); if (min_des_bw_dl) { - if (!cJSON_IsString(min_des_bw_dl)) { + if (!cJSON_IsString(min_des_bw_dl) && !cJSON_IsNull(min_des_bw_dl)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [min_des_bw_dl]"); goto end; } } - cJSON *min_des_bw_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "minDesBwUl"); - + min_des_bw_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "minDesBwUl"); if (min_des_bw_ul) { - if (!cJSON_IsString(min_des_bw_ul)) { + if (!cJSON_IsString(min_des_bw_ul) && !cJSON_IsNull(min_des_bw_ul)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [min_des_bw_ul]"); goto end; } } - cJSON *mir_bw_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "mirBwDl"); - + mir_bw_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "mirBwDl"); if (mir_bw_dl) { - if (!cJSON_IsString(mir_bw_dl)) { + if (!cJSON_IsString(mir_bw_dl) && !cJSON_IsNull(mir_bw_dl)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [mir_bw_dl]"); goto end; } } - cJSON *mir_bw_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "mirBwUl"); - + mir_bw_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "mirBwUl"); if (mir_bw_ul) { - if (!cJSON_IsString(mir_bw_ul)) { + if (!cJSON_IsString(mir_bw_ul) && !cJSON_IsNull(mir_bw_ul)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [mir_bw_ul]"); goto end; } } - cJSON *preempt_cap = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "preemptCap"); - - OpenAPI_preemption_capability_rm_t *preempt_cap_local_nonprim = NULL; + preempt_cap = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "preemptCap"); if (preempt_cap) { preempt_cap_local_nonprim = OpenAPI_preemption_capability_rm_parseFromJSON(preempt_cap); } - cJSON *preempt_vuln = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "preemptVuln"); - - OpenAPI_preemption_vulnerability_rm_t *preempt_vuln_local_nonprim = NULL; + preempt_vuln = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "preemptVuln"); if (preempt_vuln) { preempt_vuln_local_nonprim = OpenAPI_preemption_vulnerability_rm_parseFromJSON(preempt_vuln); } - cJSON *prio_sharing_ind = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "prioSharingInd"); - - OpenAPI_priority_sharing_indicator_e prio_sharing_indVariable; + prio_sharing_ind = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "prioSharingInd"); if (prio_sharing_ind) { if (!cJSON_IsString(prio_sharing_ind)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [prio_sharing_ind]"); @@ -757,9 +841,7 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me prio_sharing_indVariable = OpenAPI_priority_sharing_indicator_FromString(prio_sharing_ind->valuestring); } - cJSON *res_prio = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "resPrio"); - - OpenAPI_reserv_priority_e res_prioVariable; + res_prio = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "resPrio"); if (res_prio) { if (!cJSON_IsString(res_prio)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [res_prio]"); @@ -768,26 +850,23 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me res_prioVariable = OpenAPI_reserv_priority_FromString(res_prio->valuestring); } - cJSON *rr_bw = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "rrBw"); - + rr_bw = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "rrBw"); if (rr_bw) { - if (!cJSON_IsString(rr_bw)) { + if (!cJSON_IsString(rr_bw) && !cJSON_IsNull(rr_bw)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [rr_bw]"); goto end; } } - cJSON *rs_bw = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "rsBw"); - + rs_bw = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "rsBw"); if (rs_bw) { - if (!cJSON_IsString(rs_bw)) { + if (!cJSON_IsString(rs_bw) && !cJSON_IsNull(rs_bw)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [rs_bw]"); goto end; } } - cJSON *sharing_key_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "sharingKeyDl"); - + sharing_key_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "sharingKeyDl"); if (sharing_key_dl) { if (!cJSON_IsNumber(sharing_key_dl)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [sharing_key_dl]"); @@ -795,8 +874,7 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me } } - cJSON *sharing_key_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "sharingKeyUl"); - + sharing_key_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "sharingKeyUl"); if (sharing_key_ul) { if (!cJSON_IsNumber(sharing_key_ul)) { ogs_error("OpenAPI_media_component_rm_parseFromJSON() failed [sharing_key_ul]"); @@ -804,31 +882,25 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me } } - cJSON *tsn_qos = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "tsnQos"); - - OpenAPI_tsn_qos_container_rm_t *tsn_qos_local_nonprim = NULL; + tsn_qos = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "tsnQos"); if (tsn_qos) { tsn_qos_local_nonprim = OpenAPI_tsn_qos_container_rm_parseFromJSON(tsn_qos); } - cJSON *tscai_input_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "tscaiInputDl"); - - OpenAPI_tscai_input_container_t *tscai_input_dl_local_nonprim = NULL; + tscai_input_dl = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "tscaiInputDl"); if (tscai_input_dl) { tscai_input_dl_local_nonprim = OpenAPI_tscai_input_container_parseFromJSON(tscai_input_dl); } - cJSON *tscai_input_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "tscaiInputUl"); - - OpenAPI_tscai_input_container_t *tscai_input_ul_local_nonprim = NULL; + tscai_input_ul = cJSON_GetObjectItemCaseSensitive(media_component_rmJSON, "tscaiInputUl"); if (tscai_input_ul) { tscai_input_ul_local_nonprim = OpenAPI_tscai_input_container_parseFromJSON(tscai_input_ul); } media_component_rm_local_var = OpenAPI_media_component_rm_create ( - af_app_id ? ogs_strdup(af_app_id->valuestring) : NULL, + af_app_id && !cJSON_IsNull(af_app_id) ? ogs_strdup(af_app_id->valuestring) : NULL, af_rout_req ? af_rout_req_local_nonprim : NULL, - qos_reference ? ogs_strdup(qos_reference->valuestring) : NULL, + qos_reference && !cJSON_IsNull(qos_reference) ? ogs_strdup(qos_reference->valuestring) : NULL, alt_ser_reqs ? alt_ser_reqsList : NULL, dis_ue_notif ? true : false, dis_ue_notif ? dis_ue_notif->valueint : 0, @@ -839,30 +911,30 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me des_max_latency ? des_max_latency->valuedouble : 0, des_max_loss ? true : false, des_max_loss ? des_max_loss->valuedouble : 0, - flus_id ? ogs_strdup(flus_id->valuestring) : NULL, + flus_id && !cJSON_IsNull(flus_id) ? ogs_strdup(flus_id->valuestring) : NULL, f_status ? f_statusVariable : 0, - mar_bw_dl ? ogs_strdup(mar_bw_dl->valuestring) : NULL, - mar_bw_ul ? ogs_strdup(mar_bw_ul->valuestring) : NULL, + mar_bw_dl && !cJSON_IsNull(mar_bw_dl) ? ogs_strdup(mar_bw_dl->valuestring) : NULL, + mar_bw_ul && !cJSON_IsNull(mar_bw_ul) ? ogs_strdup(mar_bw_ul->valuestring) : NULL, max_packet_loss_rate_dl ? true : false, max_packet_loss_rate_dl ? max_packet_loss_rate_dl->valuedouble : 0, max_packet_loss_rate_ul ? true : false, max_packet_loss_rate_ul ? max_packet_loss_rate_ul->valuedouble : 0, - max_supp_bw_dl ? ogs_strdup(max_supp_bw_dl->valuestring) : NULL, - max_supp_bw_ul ? ogs_strdup(max_supp_bw_ul->valuestring) : NULL, + max_supp_bw_dl && !cJSON_IsNull(max_supp_bw_dl) ? ogs_strdup(max_supp_bw_dl->valuestring) : NULL, + max_supp_bw_ul && !cJSON_IsNull(max_supp_bw_ul) ? ogs_strdup(max_supp_bw_ul->valuestring) : NULL, med_comp_n->valuedouble, med_sub_comps ? med_sub_compsList : NULL, med_type ? med_typeVariable : 0, - min_des_bw_dl ? ogs_strdup(min_des_bw_dl->valuestring) : NULL, - min_des_bw_ul ? ogs_strdup(min_des_bw_ul->valuestring) : NULL, - mir_bw_dl ? ogs_strdup(mir_bw_dl->valuestring) : NULL, - mir_bw_ul ? ogs_strdup(mir_bw_ul->valuestring) : NULL, + min_des_bw_dl && !cJSON_IsNull(min_des_bw_dl) ? ogs_strdup(min_des_bw_dl->valuestring) : NULL, + min_des_bw_ul && !cJSON_IsNull(min_des_bw_ul) ? ogs_strdup(min_des_bw_ul->valuestring) : NULL, + mir_bw_dl && !cJSON_IsNull(mir_bw_dl) ? ogs_strdup(mir_bw_dl->valuestring) : NULL, + mir_bw_ul && !cJSON_IsNull(mir_bw_ul) ? ogs_strdup(mir_bw_ul->valuestring) : NULL, preempt_cap ? preempt_cap_local_nonprim : NULL, preempt_vuln ? preempt_vuln_local_nonprim : NULL, prio_sharing_ind ? prio_sharing_indVariable : 0, res_prio ? res_prioVariable : 0, - rr_bw ? ogs_strdup(rr_bw->valuestring) : NULL, - rs_bw ? ogs_strdup(rs_bw->valuestring) : NULL, + rr_bw && !cJSON_IsNull(rr_bw) ? ogs_strdup(rr_bw->valuestring) : NULL, + rs_bw && !cJSON_IsNull(rs_bw) ? ogs_strdup(rs_bw->valuestring) : NULL, sharing_key_dl ? true : false, sharing_key_dl ? sharing_key_dl->valuedouble : 0, sharing_key_ul ? true : false, @@ -874,6 +946,54 @@ OpenAPI_media_component_rm_t *OpenAPI_media_component_rm_parseFromJSON(cJSON *me return media_component_rm_local_var; end: + if (af_rout_req_local_nonprim) { + OpenAPI_af_routing_requirement_rm_free(af_rout_req_local_nonprim); + af_rout_req_local_nonprim = NULL; + } + if (alt_ser_reqsList) { + OpenAPI_list_for_each(alt_ser_reqsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(alt_ser_reqsList); + alt_ser_reqsList = NULL; + } + if (codecsList) { + OpenAPI_list_for_each(codecsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(codecsList); + codecsList = NULL; + } + if (med_sub_compsList) { + OpenAPI_list_for_each(med_sub_compsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_media_sub_component_rm_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(med_sub_compsList); + med_sub_compsList = NULL; + } + if (preempt_cap_local_nonprim) { + OpenAPI_preemption_capability_rm_free(preempt_cap_local_nonprim); + preempt_cap_local_nonprim = NULL; + } + if (preempt_vuln_local_nonprim) { + OpenAPI_preemption_vulnerability_rm_free(preempt_vuln_local_nonprim); + preempt_vuln_local_nonprim = NULL; + } + if (tsn_qos_local_nonprim) { + OpenAPI_tsn_qos_container_rm_free(tsn_qos_local_nonprim); + tsn_qos_local_nonprim = NULL; + } + if (tscai_input_dl_local_nonprim) { + OpenAPI_tscai_input_container_free(tscai_input_dl_local_nonprim); + tscai_input_dl_local_nonprim = NULL; + } + if (tscai_input_ul_local_nonprim) { + OpenAPI_tscai_input_container_free(tscai_input_ul_local_nonprim); + tscai_input_ul_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/media_sub_component.c b/lib/sbi/openapi/model/media_sub_component.c index 5c008d59a..9ad792200 100644 --- a/lib/sbi/openapi/model/media_sub_component.c +++ b/lib/sbi/openapi/model/media_sub_component.c @@ -34,27 +34,44 @@ OpenAPI_media_sub_component_t *OpenAPI_media_sub_component_create( void OpenAPI_media_sub_component_free(OpenAPI_media_sub_component_t *media_sub_component) { + OpenAPI_lnode_t *node = NULL; + if (NULL == media_sub_component) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(media_sub_component->ethf_descs, node) { - OpenAPI_eth_flow_description_free(node->data); + if (media_sub_component->ethf_descs) { + OpenAPI_list_for_each(media_sub_component->ethf_descs, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(media_sub_component->ethf_descs); + media_sub_component->ethf_descs = NULL; } - OpenAPI_list_free(media_sub_component->ethf_descs); - OpenAPI_list_for_each(media_sub_component->f_descs, node) { - ogs_free(node->data); + if (media_sub_component->f_descs) { + OpenAPI_list_for_each(media_sub_component->f_descs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(media_sub_component->f_descs); + media_sub_component->f_descs = NULL; + } + if (media_sub_component->mar_bw_dl) { + ogs_free(media_sub_component->mar_bw_dl); + media_sub_component->mar_bw_dl = NULL; + } + if (media_sub_component->mar_bw_ul) { + ogs_free(media_sub_component->mar_bw_ul); + media_sub_component->mar_bw_ul = NULL; + } + if (media_sub_component->tos_tr_cl) { + ogs_free(media_sub_component->tos_tr_cl); + media_sub_component->tos_tr_cl = NULL; } - OpenAPI_list_free(media_sub_component->f_descs); - ogs_free(media_sub_component->mar_bw_dl); - ogs_free(media_sub_component->mar_bw_ul); - ogs_free(media_sub_component->tos_tr_cl); ogs_free(media_sub_component); } cJSON *OpenAPI_media_sub_component_convertToJSON(OpenAPI_media_sub_component_t *media_sub_component) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (media_sub_component == NULL) { ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [MediaSubComponent]"); @@ -62,7 +79,7 @@ cJSON *OpenAPI_media_sub_component_convertToJSON(OpenAPI_media_sub_component_t * } item = cJSON_CreateObject(); - if (media_sub_component->af_sig_protocol) { + if (media_sub_component->af_sig_protocol != OpenAPI_af_sig_protocol_NULL) { if (cJSON_AddStringToObject(item, "afSigProtocol", OpenAPI_af_sig_protocol_ToString(media_sub_component->af_sig_protocol)) == NULL) { ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [af_sig_protocol]"); goto end; @@ -75,17 +92,13 @@ cJSON *OpenAPI_media_sub_component_convertToJSON(OpenAPI_media_sub_component_t * ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [ethf_descs]"); goto end; } - - OpenAPI_lnode_t *ethf_descs_node; - if (media_sub_component->ethf_descs) { - OpenAPI_list_for_each(media_sub_component->ethf_descs, ethf_descs_node) { - cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(ethf_descs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [ethf_descs]"); - goto end; - } - cJSON_AddItemToArray(ethf_descsList, itemLocal); + OpenAPI_list_for_each(media_sub_component->ethf_descs, node) { + cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [ethf_descs]"); + goto end; } + cJSON_AddItemToArray(ethf_descsList, itemLocal); } } @@ -95,22 +108,20 @@ cJSON *OpenAPI_media_sub_component_convertToJSON(OpenAPI_media_sub_component_t * } if (media_sub_component->f_descs) { - cJSON *f_descs = cJSON_AddArrayToObject(item, "fDescs"); - if (f_descs == NULL) { + cJSON *f_descsList = cJSON_AddArrayToObject(item, "fDescs"); + if (f_descsList == NULL) { ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [f_descs]"); goto end; } - - OpenAPI_lnode_t *f_descs_node; - OpenAPI_list_for_each(media_sub_component->f_descs, f_descs_node) { - if (cJSON_AddStringToObject(f_descs, "", (char*)f_descs_node->data) == NULL) { - ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [f_descs]"); - goto end; + OpenAPI_list_for_each(media_sub_component->f_descs, node) { + if (cJSON_AddStringToObject(f_descsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [f_descs]"); + goto end; + } } - } } - if (media_sub_component->f_status) { + if (media_sub_component->f_status != OpenAPI_flow_status_NULL) { if (cJSON_AddStringToObject(item, "fStatus", OpenAPI_flow_status_ToString(media_sub_component->f_status)) == NULL) { ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [f_status]"); goto end; @@ -138,7 +149,7 @@ cJSON *OpenAPI_media_sub_component_convertToJSON(OpenAPI_media_sub_component_t * } } - if (media_sub_component->flow_usage) { + if (media_sub_component->flow_usage != OpenAPI_flow_usage_NULL) { if (cJSON_AddStringToObject(item, "flowUsage", OpenAPI_flow_usage_ToString(media_sub_component->flow_usage)) == NULL) { ogs_error("OpenAPI_media_sub_component_convertToJSON() failed [flow_usage]"); goto end; @@ -152,9 +163,22 @@ end: OpenAPI_media_sub_component_t *OpenAPI_media_sub_component_parseFromJSON(cJSON *media_sub_componentJSON) { OpenAPI_media_sub_component_t *media_sub_component_local_var = NULL; - cJSON *af_sig_protocol = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "afSigProtocol"); - - OpenAPI_af_sig_protocol_e af_sig_protocolVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *af_sig_protocol = NULL; + OpenAPI_af_sig_protocol_e af_sig_protocolVariable = 0; + cJSON *ethf_descs = NULL; + OpenAPI_list_t *ethf_descsList = NULL; + cJSON *f_num = NULL; + cJSON *f_descs = NULL; + OpenAPI_list_t *f_descsList = NULL; + cJSON *f_status = NULL; + OpenAPI_flow_status_e f_statusVariable = 0; + cJSON *mar_bw_dl = NULL; + cJSON *mar_bw_ul = NULL; + cJSON *tos_tr_cl = NULL; + cJSON *flow_usage = NULL; + OpenAPI_flow_usage_e flow_usageVariable = 0; + af_sig_protocol = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "afSigProtocol"); if (af_sig_protocol) { if (!cJSON_IsString(af_sig_protocol)) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [af_sig_protocol]"); @@ -163,69 +187,63 @@ OpenAPI_media_sub_component_t *OpenAPI_media_sub_component_parseFromJSON(cJSON * af_sig_protocolVariable = OpenAPI_af_sig_protocol_FromString(af_sig_protocol->valuestring); } - cJSON *ethf_descs = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "ethfDescs"); - - OpenAPI_list_t *ethf_descsList; + ethf_descs = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "ethfDescs"); if (ethf_descs) { - cJSON *ethf_descs_local_nonprimitive; - if (!cJSON_IsArray(ethf_descs)){ - ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [ethf_descs]"); - goto end; - } - - ethf_descsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ethf_descs_local_nonprimitive, ethf_descs ) { - if (!cJSON_IsObject(ethf_descs_local_nonprimitive)) { + cJSON *ethf_descs_local = NULL; + if (!cJSON_IsArray(ethf_descs)) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [ethf_descs]"); goto end; } - OpenAPI_eth_flow_description_t *ethf_descsItem = OpenAPI_eth_flow_description_parseFromJSON(ethf_descs_local_nonprimitive); - if (!ethf_descsItem) { - ogs_error("No ethf_descsItem"); - OpenAPI_list_free(ethf_descsList); - goto end; + ethf_descsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ethf_descs_local, ethf_descs) { + if (!cJSON_IsObject(ethf_descs_local)) { + ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [ethf_descs]"); + goto end; + } + OpenAPI_eth_flow_description_t *ethf_descsItem = OpenAPI_eth_flow_description_parseFromJSON(ethf_descs_local); + if (!ethf_descsItem) { + ogs_error("No ethf_descsItem"); + OpenAPI_list_free(ethf_descsList); + goto end; + } + OpenAPI_list_add(ethf_descsList, ethf_descsItem); } - - OpenAPI_list_add(ethf_descsList, ethf_descsItem); - } } - cJSON *f_num = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "fNum"); + f_num = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "fNum"); if (!f_num) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [f_num]"); goto end; } - if (!cJSON_IsNumber(f_num)) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [f_num]"); goto end; } - cJSON *f_descs = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "fDescs"); - - OpenAPI_list_t *f_descsList; + f_descs = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "fDescs"); if (f_descs) { - cJSON *f_descs_local; - if (!cJSON_IsArray(f_descs)) { - ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [f_descs]"); - goto end; - } - f_descsList = OpenAPI_list_create(); + cJSON *f_descs_local = NULL; + if (!cJSON_IsArray(f_descs)) { + ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [f_descs]"); + goto end; + } - cJSON_ArrayForEach(f_descs_local, f_descs) { - if (!cJSON_IsString(f_descs_local)) { - ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [f_descs]"); - goto end; - } - OpenAPI_list_add(f_descsList, ogs_strdup(f_descs_local->valuestring)); - } + f_descsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(f_descs_local, f_descs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(f_descs_local)) { + ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [f_descs]"); + goto end; + } + OpenAPI_list_add(f_descsList, ogs_strdup(f_descs_local->valuestring)); + } } - cJSON *f_status = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "fStatus"); - - OpenAPI_flow_status_e f_statusVariable; + f_status = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "fStatus"); if (f_status) { if (!cJSON_IsString(f_status)) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [f_status]"); @@ -234,36 +252,31 @@ OpenAPI_media_sub_component_t *OpenAPI_media_sub_component_parseFromJSON(cJSON * f_statusVariable = OpenAPI_flow_status_FromString(f_status->valuestring); } - cJSON *mar_bw_dl = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "marBwDl"); - + mar_bw_dl = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "marBwDl"); if (mar_bw_dl) { - if (!cJSON_IsString(mar_bw_dl)) { + if (!cJSON_IsString(mar_bw_dl) && !cJSON_IsNull(mar_bw_dl)) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [mar_bw_dl]"); goto end; } } - cJSON *mar_bw_ul = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "marBwUl"); - + mar_bw_ul = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "marBwUl"); if (mar_bw_ul) { - if (!cJSON_IsString(mar_bw_ul)) { + if (!cJSON_IsString(mar_bw_ul) && !cJSON_IsNull(mar_bw_ul)) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [mar_bw_ul]"); goto end; } } - cJSON *tos_tr_cl = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "tosTrCl"); - + tos_tr_cl = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "tosTrCl"); if (tos_tr_cl) { - if (!cJSON_IsString(tos_tr_cl)) { + if (!cJSON_IsString(tos_tr_cl) && !cJSON_IsNull(tos_tr_cl)) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [tos_tr_cl]"); goto end; } } - cJSON *flow_usage = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "flowUsage"); - - OpenAPI_flow_usage_e flow_usageVariable; + flow_usage = cJSON_GetObjectItemCaseSensitive(media_sub_componentJSON, "flowUsage"); if (flow_usage) { if (!cJSON_IsString(flow_usage)) { ogs_error("OpenAPI_media_sub_component_parseFromJSON() failed [flow_usage]"); @@ -279,14 +292,28 @@ OpenAPI_media_sub_component_t *OpenAPI_media_sub_component_parseFromJSON(cJSON * f_num->valuedouble, f_descs ? f_descsList : NULL, f_status ? f_statusVariable : 0, - mar_bw_dl ? ogs_strdup(mar_bw_dl->valuestring) : NULL, - mar_bw_ul ? ogs_strdup(mar_bw_ul->valuestring) : NULL, - tos_tr_cl ? ogs_strdup(tos_tr_cl->valuestring) : NULL, + mar_bw_dl && !cJSON_IsNull(mar_bw_dl) ? ogs_strdup(mar_bw_dl->valuestring) : NULL, + mar_bw_ul && !cJSON_IsNull(mar_bw_ul) ? ogs_strdup(mar_bw_ul->valuestring) : NULL, + tos_tr_cl && !cJSON_IsNull(tos_tr_cl) ? ogs_strdup(tos_tr_cl->valuestring) : NULL, flow_usage ? flow_usageVariable : 0 ); return media_sub_component_local_var; end: + if (ethf_descsList) { + OpenAPI_list_for_each(ethf_descsList, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(ethf_descsList); + ethf_descsList = NULL; + } + if (f_descsList) { + OpenAPI_list_for_each(f_descsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(f_descsList); + f_descsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/media_sub_component_rm.c b/lib/sbi/openapi/model/media_sub_component_rm.c index ef917cc7e..abee00798 100644 --- a/lib/sbi/openapi/model/media_sub_component_rm.c +++ b/lib/sbi/openapi/model/media_sub_component_rm.c @@ -34,27 +34,44 @@ OpenAPI_media_sub_component_rm_t *OpenAPI_media_sub_component_rm_create( void OpenAPI_media_sub_component_rm_free(OpenAPI_media_sub_component_rm_t *media_sub_component_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == media_sub_component_rm) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(media_sub_component_rm->ethf_descs, node) { - OpenAPI_eth_flow_description_free(node->data); + if (media_sub_component_rm->ethf_descs) { + OpenAPI_list_for_each(media_sub_component_rm->ethf_descs, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(media_sub_component_rm->ethf_descs); + media_sub_component_rm->ethf_descs = NULL; } - OpenAPI_list_free(media_sub_component_rm->ethf_descs); - OpenAPI_list_for_each(media_sub_component_rm->f_descs, node) { - ogs_free(node->data); + if (media_sub_component_rm->f_descs) { + OpenAPI_list_for_each(media_sub_component_rm->f_descs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(media_sub_component_rm->f_descs); + media_sub_component_rm->f_descs = NULL; + } + if (media_sub_component_rm->mar_bw_dl) { + ogs_free(media_sub_component_rm->mar_bw_dl); + media_sub_component_rm->mar_bw_dl = NULL; + } + if (media_sub_component_rm->mar_bw_ul) { + ogs_free(media_sub_component_rm->mar_bw_ul); + media_sub_component_rm->mar_bw_ul = NULL; + } + if (media_sub_component_rm->tos_tr_cl) { + ogs_free(media_sub_component_rm->tos_tr_cl); + media_sub_component_rm->tos_tr_cl = NULL; } - OpenAPI_list_free(media_sub_component_rm->f_descs); - ogs_free(media_sub_component_rm->mar_bw_dl); - ogs_free(media_sub_component_rm->mar_bw_ul); - ogs_free(media_sub_component_rm->tos_tr_cl); ogs_free(media_sub_component_rm); } cJSON *OpenAPI_media_sub_component_rm_convertToJSON(OpenAPI_media_sub_component_rm_t *media_sub_component_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (media_sub_component_rm == NULL) { ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [MediaSubComponentRm]"); @@ -62,7 +79,7 @@ cJSON *OpenAPI_media_sub_component_rm_convertToJSON(OpenAPI_media_sub_component_ } item = cJSON_CreateObject(); - if (media_sub_component_rm->af_sig_protocol) { + if (media_sub_component_rm->af_sig_protocol != OpenAPI_af_sig_protocol_NULL) { if (cJSON_AddStringToObject(item, "afSigProtocol", OpenAPI_af_sig_protocol_ToString(media_sub_component_rm->af_sig_protocol)) == NULL) { ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [af_sig_protocol]"); goto end; @@ -75,17 +92,13 @@ cJSON *OpenAPI_media_sub_component_rm_convertToJSON(OpenAPI_media_sub_component_ ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [ethf_descs]"); goto end; } - - OpenAPI_lnode_t *ethf_descs_node; - if (media_sub_component_rm->ethf_descs) { - OpenAPI_list_for_each(media_sub_component_rm->ethf_descs, ethf_descs_node) { - cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(ethf_descs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [ethf_descs]"); - goto end; - } - cJSON_AddItemToArray(ethf_descsList, itemLocal); + OpenAPI_list_for_each(media_sub_component_rm->ethf_descs, node) { + cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [ethf_descs]"); + goto end; } + cJSON_AddItemToArray(ethf_descsList, itemLocal); } } @@ -95,22 +108,20 @@ cJSON *OpenAPI_media_sub_component_rm_convertToJSON(OpenAPI_media_sub_component_ } if (media_sub_component_rm->f_descs) { - cJSON *f_descs = cJSON_AddArrayToObject(item, "fDescs"); - if (f_descs == NULL) { + cJSON *f_descsList = cJSON_AddArrayToObject(item, "fDescs"); + if (f_descsList == NULL) { ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [f_descs]"); goto end; } - - OpenAPI_lnode_t *f_descs_node; - OpenAPI_list_for_each(media_sub_component_rm->f_descs, f_descs_node) { - if (cJSON_AddStringToObject(f_descs, "", (char*)f_descs_node->data) == NULL) { - ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [f_descs]"); - goto end; + OpenAPI_list_for_each(media_sub_component_rm->f_descs, node) { + if (cJSON_AddStringToObject(f_descsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [f_descs]"); + goto end; + } } - } } - if (media_sub_component_rm->f_status) { + if (media_sub_component_rm->f_status != OpenAPI_flow_status_NULL) { if (cJSON_AddStringToObject(item, "fStatus", OpenAPI_flow_status_ToString(media_sub_component_rm->f_status)) == NULL) { ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [f_status]"); goto end; @@ -138,7 +149,7 @@ cJSON *OpenAPI_media_sub_component_rm_convertToJSON(OpenAPI_media_sub_component_ } } - if (media_sub_component_rm->flow_usage) { + if (media_sub_component_rm->flow_usage != OpenAPI_flow_usage_NULL) { if (cJSON_AddStringToObject(item, "flowUsage", OpenAPI_flow_usage_ToString(media_sub_component_rm->flow_usage)) == NULL) { ogs_error("OpenAPI_media_sub_component_rm_convertToJSON() failed [flow_usage]"); goto end; @@ -152,9 +163,22 @@ end: OpenAPI_media_sub_component_rm_t *OpenAPI_media_sub_component_rm_parseFromJSON(cJSON *media_sub_component_rmJSON) { OpenAPI_media_sub_component_rm_t *media_sub_component_rm_local_var = NULL; - cJSON *af_sig_protocol = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "afSigProtocol"); - - OpenAPI_af_sig_protocol_e af_sig_protocolVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *af_sig_protocol = NULL; + OpenAPI_af_sig_protocol_e af_sig_protocolVariable = 0; + cJSON *ethf_descs = NULL; + OpenAPI_list_t *ethf_descsList = NULL; + cJSON *f_num = NULL; + cJSON *f_descs = NULL; + OpenAPI_list_t *f_descsList = NULL; + cJSON *f_status = NULL; + OpenAPI_flow_status_e f_statusVariable = 0; + cJSON *mar_bw_dl = NULL; + cJSON *mar_bw_ul = NULL; + cJSON *tos_tr_cl = NULL; + cJSON *flow_usage = NULL; + OpenAPI_flow_usage_e flow_usageVariable = 0; + af_sig_protocol = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "afSigProtocol"); if (af_sig_protocol) { if (!cJSON_IsString(af_sig_protocol)) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [af_sig_protocol]"); @@ -163,69 +187,63 @@ OpenAPI_media_sub_component_rm_t *OpenAPI_media_sub_component_rm_parseFromJSON(c af_sig_protocolVariable = OpenAPI_af_sig_protocol_FromString(af_sig_protocol->valuestring); } - cJSON *ethf_descs = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "ethfDescs"); - - OpenAPI_list_t *ethf_descsList; + ethf_descs = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "ethfDescs"); if (ethf_descs) { - cJSON *ethf_descs_local_nonprimitive; - if (!cJSON_IsArray(ethf_descs)){ - ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [ethf_descs]"); - goto end; - } - - ethf_descsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ethf_descs_local_nonprimitive, ethf_descs ) { - if (!cJSON_IsObject(ethf_descs_local_nonprimitive)) { + cJSON *ethf_descs_local = NULL; + if (!cJSON_IsArray(ethf_descs)) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [ethf_descs]"); goto end; } - OpenAPI_eth_flow_description_t *ethf_descsItem = OpenAPI_eth_flow_description_parseFromJSON(ethf_descs_local_nonprimitive); - if (!ethf_descsItem) { - ogs_error("No ethf_descsItem"); - OpenAPI_list_free(ethf_descsList); - goto end; + ethf_descsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ethf_descs_local, ethf_descs) { + if (!cJSON_IsObject(ethf_descs_local)) { + ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [ethf_descs]"); + goto end; + } + OpenAPI_eth_flow_description_t *ethf_descsItem = OpenAPI_eth_flow_description_parseFromJSON(ethf_descs_local); + if (!ethf_descsItem) { + ogs_error("No ethf_descsItem"); + OpenAPI_list_free(ethf_descsList); + goto end; + } + OpenAPI_list_add(ethf_descsList, ethf_descsItem); } - - OpenAPI_list_add(ethf_descsList, ethf_descsItem); - } } - cJSON *f_num = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "fNum"); + f_num = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "fNum"); if (!f_num) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [f_num]"); goto end; } - if (!cJSON_IsNumber(f_num)) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [f_num]"); goto end; } - cJSON *f_descs = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "fDescs"); - - OpenAPI_list_t *f_descsList; + f_descs = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "fDescs"); if (f_descs) { - cJSON *f_descs_local; - if (!cJSON_IsArray(f_descs)) { - ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [f_descs]"); - goto end; - } - f_descsList = OpenAPI_list_create(); + cJSON *f_descs_local = NULL; + if (!cJSON_IsArray(f_descs)) { + ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [f_descs]"); + goto end; + } - cJSON_ArrayForEach(f_descs_local, f_descs) { - if (!cJSON_IsString(f_descs_local)) { - ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [f_descs]"); - goto end; - } - OpenAPI_list_add(f_descsList, ogs_strdup(f_descs_local->valuestring)); - } + f_descsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(f_descs_local, f_descs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(f_descs_local)) { + ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [f_descs]"); + goto end; + } + OpenAPI_list_add(f_descsList, ogs_strdup(f_descs_local->valuestring)); + } } - cJSON *f_status = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "fStatus"); - - OpenAPI_flow_status_e f_statusVariable; + f_status = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "fStatus"); if (f_status) { if (!cJSON_IsString(f_status)) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [f_status]"); @@ -234,36 +252,31 @@ OpenAPI_media_sub_component_rm_t *OpenAPI_media_sub_component_rm_parseFromJSON(c f_statusVariable = OpenAPI_flow_status_FromString(f_status->valuestring); } - cJSON *mar_bw_dl = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "marBwDl"); - + mar_bw_dl = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "marBwDl"); if (mar_bw_dl) { - if (!cJSON_IsString(mar_bw_dl)) { + if (!cJSON_IsString(mar_bw_dl) && !cJSON_IsNull(mar_bw_dl)) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [mar_bw_dl]"); goto end; } } - cJSON *mar_bw_ul = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "marBwUl"); - + mar_bw_ul = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "marBwUl"); if (mar_bw_ul) { - if (!cJSON_IsString(mar_bw_ul)) { + if (!cJSON_IsString(mar_bw_ul) && !cJSON_IsNull(mar_bw_ul)) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [mar_bw_ul]"); goto end; } } - cJSON *tos_tr_cl = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "tosTrCl"); - + tos_tr_cl = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "tosTrCl"); if (tos_tr_cl) { - if (!cJSON_IsString(tos_tr_cl)) { + if (!cJSON_IsString(tos_tr_cl) && !cJSON_IsNull(tos_tr_cl)) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [tos_tr_cl]"); goto end; } } - cJSON *flow_usage = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "flowUsage"); - - OpenAPI_flow_usage_e flow_usageVariable; + flow_usage = cJSON_GetObjectItemCaseSensitive(media_sub_component_rmJSON, "flowUsage"); if (flow_usage) { if (!cJSON_IsString(flow_usage)) { ogs_error("OpenAPI_media_sub_component_rm_parseFromJSON() failed [flow_usage]"); @@ -279,14 +292,28 @@ OpenAPI_media_sub_component_rm_t *OpenAPI_media_sub_component_rm_parseFromJSON(c f_num->valuedouble, f_descs ? f_descsList : NULL, f_status ? f_statusVariable : 0, - mar_bw_dl ? ogs_strdup(mar_bw_dl->valuestring) : NULL, - mar_bw_ul ? ogs_strdup(mar_bw_ul->valuestring) : NULL, - tos_tr_cl ? ogs_strdup(tos_tr_cl->valuestring) : NULL, + mar_bw_dl && !cJSON_IsNull(mar_bw_dl) ? ogs_strdup(mar_bw_dl->valuestring) : NULL, + mar_bw_ul && !cJSON_IsNull(mar_bw_ul) ? ogs_strdup(mar_bw_ul->valuestring) : NULL, + tos_tr_cl && !cJSON_IsNull(tos_tr_cl) ? ogs_strdup(tos_tr_cl->valuestring) : NULL, flow_usage ? flow_usageVariable : 0 ); return media_sub_component_rm_local_var; end: + if (ethf_descsList) { + OpenAPI_list_for_each(ethf_descsList, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(ethf_descsList); + ethf_descsList = NULL; + } + if (f_descsList) { + OpenAPI_list_for_each(f_descsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(f_descsList); + f_descsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/message_waiting_data.c b/lib/sbi/openapi/model/message_waiting_data.c index e60632cc3..d3c77ee80 100644 --- a/lib/sbi/openapi/model/message_waiting_data.c +++ b/lib/sbi/openapi/model/message_waiting_data.c @@ -18,20 +18,25 @@ OpenAPI_message_waiting_data_t *OpenAPI_message_waiting_data_create( void OpenAPI_message_waiting_data_free(OpenAPI_message_waiting_data_t *message_waiting_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == message_waiting_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(message_waiting_data->mwd_list, node) { - OpenAPI_smsc_data_free(node->data); + if (message_waiting_data->mwd_list) { + OpenAPI_list_for_each(message_waiting_data->mwd_list, node) { + OpenAPI_smsc_data_free(node->data); + } + OpenAPI_list_free(message_waiting_data->mwd_list); + message_waiting_data->mwd_list = NULL; } - OpenAPI_list_free(message_waiting_data->mwd_list); ogs_free(message_waiting_data); } cJSON *OpenAPI_message_waiting_data_convertToJSON(OpenAPI_message_waiting_data_t *message_waiting_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (message_waiting_data == NULL) { ogs_error("OpenAPI_message_waiting_data_convertToJSON() failed [MessageWaitingData]"); @@ -45,17 +50,13 @@ cJSON *OpenAPI_message_waiting_data_convertToJSON(OpenAPI_message_waiting_data_t ogs_error("OpenAPI_message_waiting_data_convertToJSON() failed [mwd_list]"); goto end; } - - OpenAPI_lnode_t *mwd_list_node; - if (message_waiting_data->mwd_list) { - OpenAPI_list_for_each(message_waiting_data->mwd_list, mwd_list_node) { - cJSON *itemLocal = OpenAPI_smsc_data_convertToJSON(mwd_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_message_waiting_data_convertToJSON() failed [mwd_list]"); - goto end; - } - cJSON_AddItemToArray(mwd_listList, itemLocal); + OpenAPI_list_for_each(message_waiting_data->mwd_list, node) { + cJSON *itemLocal = OpenAPI_smsc_data_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_message_waiting_data_convertToJSON() failed [mwd_list]"); + goto end; } + cJSON_AddItemToArray(mwd_listList, itemLocal); } } @@ -66,33 +67,32 @@ end: OpenAPI_message_waiting_data_t *OpenAPI_message_waiting_data_parseFromJSON(cJSON *message_waiting_dataJSON) { OpenAPI_message_waiting_data_t *message_waiting_data_local_var = NULL; - cJSON *mwd_list = cJSON_GetObjectItemCaseSensitive(message_waiting_dataJSON, "mwdList"); - - OpenAPI_list_t *mwd_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *mwd_list = NULL; + OpenAPI_list_t *mwd_listList = NULL; + mwd_list = cJSON_GetObjectItemCaseSensitive(message_waiting_dataJSON, "mwdList"); if (mwd_list) { - cJSON *mwd_list_local_nonprimitive; - if (!cJSON_IsArray(mwd_list)){ - ogs_error("OpenAPI_message_waiting_data_parseFromJSON() failed [mwd_list]"); - goto end; - } - - mwd_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mwd_list_local_nonprimitive, mwd_list ) { - if (!cJSON_IsObject(mwd_list_local_nonprimitive)) { + cJSON *mwd_list_local = NULL; + if (!cJSON_IsArray(mwd_list)) { ogs_error("OpenAPI_message_waiting_data_parseFromJSON() failed [mwd_list]"); goto end; } - OpenAPI_smsc_data_t *mwd_listItem = OpenAPI_smsc_data_parseFromJSON(mwd_list_local_nonprimitive); - if (!mwd_listItem) { - ogs_error("No mwd_listItem"); - OpenAPI_list_free(mwd_listList); - goto end; + mwd_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mwd_list_local, mwd_list) { + if (!cJSON_IsObject(mwd_list_local)) { + ogs_error("OpenAPI_message_waiting_data_parseFromJSON() failed [mwd_list]"); + goto end; + } + OpenAPI_smsc_data_t *mwd_listItem = OpenAPI_smsc_data_parseFromJSON(mwd_list_local); + if (!mwd_listItem) { + ogs_error("No mwd_listItem"); + OpenAPI_list_free(mwd_listList); + goto end; + } + OpenAPI_list_add(mwd_listList, mwd_listItem); } - - OpenAPI_list_add(mwd_listList, mwd_listItem); - } } message_waiting_data_local_var = OpenAPI_message_waiting_data_create ( @@ -101,6 +101,13 @@ OpenAPI_message_waiting_data_t *OpenAPI_message_waiting_data_parseFromJSON(cJSON return message_waiting_data_local_var; end: + if (mwd_listList) { + OpenAPI_list_for_each(mwd_listList, node) { + OpenAPI_smsc_data_free(node->data); + } + OpenAPI_list_free(mwd_listList); + mwd_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/mm_context.c b/lib/sbi/openapi/model/mm_context.c index f11e707a5..e2aa09f27 100644 --- a/lib/sbi/openapi/model/mm_context.c +++ b/lib/sbi/openapi/model/mm_context.c @@ -12,16 +12,16 @@ OpenAPI_mm_context_t *OpenAPI_mm_context_create( int nas_downlink_count, bool is_nas_uplink_count, int nas_uplink_count, - char ue_security_capability, - char s1_ue_network_capability, + char *ue_security_capability, + char *s1_ue_network_capability, OpenAPI_list_t *allowed_nssai, OpenAPI_list_t *nssai_mapping_list, OpenAPI_list_t *allowed_home_nssai, OpenAPI_list_t *ns_instance_list, OpenAPI_expected_ue_behavior_t *expected_u_ebehavior, OpenAPI_ue_differentiation_info_t *ue_differentiation_info, - char plmn_assi_ue_radio_cap_id, - char man_assi_ue_radio_cap_id, + char *plmn_assi_ue_radio_cap_id, + char *man_assi_ue_radio_cap_id, char *ucmf_dic_entry_id, OpenAPI_global_ran_node_id_t *n3_iwf_id, OpenAPI_global_ran_node_id_t *wagf_id, @@ -66,48 +66,108 @@ OpenAPI_mm_context_t *OpenAPI_mm_context_create( void OpenAPI_mm_context_free(OpenAPI_mm_context_t *mm_context) { + OpenAPI_lnode_t *node = NULL; + if (NULL == mm_context) { return; } - OpenAPI_lnode_t *node; - OpenAPI_nas_security_mode_free(mm_context->nas_security_mode); - OpenAPI_eps_nas_security_mode_free(mm_context->eps_nas_security_mode); - OpenAPI_list_for_each(mm_context->allowed_nssai, node) { - OpenAPI_snssai_free(node->data); + if (mm_context->nas_security_mode) { + OpenAPI_nas_security_mode_free(mm_context->nas_security_mode); + mm_context->nas_security_mode = NULL; } - OpenAPI_list_free(mm_context->allowed_nssai); - OpenAPI_list_for_each(mm_context->nssai_mapping_list, node) { - OpenAPI_nssai_mapping_free(node->data); + if (mm_context->eps_nas_security_mode) { + OpenAPI_eps_nas_security_mode_free(mm_context->eps_nas_security_mode); + mm_context->eps_nas_security_mode = NULL; } - OpenAPI_list_free(mm_context->nssai_mapping_list); - OpenAPI_list_for_each(mm_context->allowed_home_nssai, node) { - OpenAPI_snssai_free(node->data); + if (mm_context->ue_security_capability) { + ogs_free(mm_context->ue_security_capability); + mm_context->ue_security_capability = NULL; } - OpenAPI_list_free(mm_context->allowed_home_nssai); - OpenAPI_list_for_each(mm_context->ns_instance_list, node) { - ogs_free(node->data); + if (mm_context->s1_ue_network_capability) { + ogs_free(mm_context->s1_ue_network_capability); + mm_context->s1_ue_network_capability = NULL; } - OpenAPI_list_free(mm_context->ns_instance_list); - OpenAPI_expected_ue_behavior_free(mm_context->expected_u_ebehavior); - OpenAPI_ue_differentiation_info_free(mm_context->ue_differentiation_info); - ogs_free(mm_context->ucmf_dic_entry_id); - OpenAPI_global_ran_node_id_free(mm_context->n3_iwf_id); - OpenAPI_global_ran_node_id_free(mm_context->wagf_id); - OpenAPI_global_ran_node_id_free(mm_context->tngf_id); - OpenAPI_list_for_each(mm_context->nssaa_status_list, node) { - OpenAPI_nssaa_status_free(node->data); + if (mm_context->allowed_nssai) { + OpenAPI_list_for_each(mm_context->allowed_nssai, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(mm_context->allowed_nssai); + mm_context->allowed_nssai = NULL; } - OpenAPI_list_free(mm_context->nssaa_status_list); - OpenAPI_list_for_each(mm_context->pending_nssai_mapping_list, node) { - OpenAPI_nssai_mapping_free(node->data); + if (mm_context->nssai_mapping_list) { + OpenAPI_list_for_each(mm_context->nssai_mapping_list, node) { + OpenAPI_nssai_mapping_free(node->data); + } + OpenAPI_list_free(mm_context->nssai_mapping_list); + mm_context->nssai_mapping_list = NULL; + } + if (mm_context->allowed_home_nssai) { + OpenAPI_list_for_each(mm_context->allowed_home_nssai, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(mm_context->allowed_home_nssai); + mm_context->allowed_home_nssai = NULL; + } + if (mm_context->ns_instance_list) { + OpenAPI_list_for_each(mm_context->ns_instance_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(mm_context->ns_instance_list); + mm_context->ns_instance_list = NULL; + } + if (mm_context->expected_u_ebehavior) { + OpenAPI_expected_ue_behavior_free(mm_context->expected_u_ebehavior); + mm_context->expected_u_ebehavior = NULL; + } + if (mm_context->ue_differentiation_info) { + OpenAPI_ue_differentiation_info_free(mm_context->ue_differentiation_info); + mm_context->ue_differentiation_info = NULL; + } + if (mm_context->plmn_assi_ue_radio_cap_id) { + ogs_free(mm_context->plmn_assi_ue_radio_cap_id); + mm_context->plmn_assi_ue_radio_cap_id = NULL; + } + if (mm_context->man_assi_ue_radio_cap_id) { + ogs_free(mm_context->man_assi_ue_radio_cap_id); + mm_context->man_assi_ue_radio_cap_id = NULL; + } + if (mm_context->ucmf_dic_entry_id) { + ogs_free(mm_context->ucmf_dic_entry_id); + mm_context->ucmf_dic_entry_id = NULL; + } + if (mm_context->n3_iwf_id) { + OpenAPI_global_ran_node_id_free(mm_context->n3_iwf_id); + mm_context->n3_iwf_id = NULL; + } + if (mm_context->wagf_id) { + OpenAPI_global_ran_node_id_free(mm_context->wagf_id); + mm_context->wagf_id = NULL; + } + if (mm_context->tngf_id) { + OpenAPI_global_ran_node_id_free(mm_context->tngf_id); + mm_context->tngf_id = NULL; + } + if (mm_context->nssaa_status_list) { + OpenAPI_list_for_each(mm_context->nssaa_status_list, node) { + OpenAPI_nssaa_status_free(node->data); + } + OpenAPI_list_free(mm_context->nssaa_status_list); + mm_context->nssaa_status_list = NULL; + } + if (mm_context->pending_nssai_mapping_list) { + OpenAPI_list_for_each(mm_context->pending_nssai_mapping_list, node) { + OpenAPI_nssai_mapping_free(node->data); + } + OpenAPI_list_free(mm_context->pending_nssai_mapping_list); + mm_context->pending_nssai_mapping_list = NULL; } - OpenAPI_list_free(mm_context->pending_nssai_mapping_list); ogs_free(mm_context); } cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (mm_context == NULL) { ogs_error("OpenAPI_mm_context_convertToJSON() failed [MmContext]"); @@ -115,6 +175,10 @@ cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) } item = cJSON_CreateObject(); + if (mm_context->access_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_mm_context_convertToJSON() failed [access_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(mm_context->access_type)) == NULL) { ogs_error("OpenAPI_mm_context_convertToJSON() failed [access_type]"); goto end; @@ -161,14 +225,14 @@ cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) } if (mm_context->ue_security_capability) { - if (cJSON_AddNumberToObject(item, "ueSecurityCapability", mm_context->ue_security_capability) == NULL) { + if (cJSON_AddStringToObject(item, "ueSecurityCapability", mm_context->ue_security_capability) == NULL) { ogs_error("OpenAPI_mm_context_convertToJSON() failed [ue_security_capability]"); goto end; } } if (mm_context->s1_ue_network_capability) { - if (cJSON_AddNumberToObject(item, "s1UeNetworkCapability", mm_context->s1_ue_network_capability) == NULL) { + if (cJSON_AddStringToObject(item, "s1UeNetworkCapability", mm_context->s1_ue_network_capability) == NULL) { ogs_error("OpenAPI_mm_context_convertToJSON() failed [s1_ue_network_capability]"); goto end; } @@ -180,17 +244,13 @@ cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) ogs_error("OpenAPI_mm_context_convertToJSON() failed [allowed_nssai]"); goto end; } - - OpenAPI_lnode_t *allowed_nssai_node; - if (mm_context->allowed_nssai) { - OpenAPI_list_for_each(mm_context->allowed_nssai, allowed_nssai_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(allowed_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mm_context_convertToJSON() failed [allowed_nssai]"); - goto end; - } - cJSON_AddItemToArray(allowed_nssaiList, itemLocal); + OpenAPI_list_for_each(mm_context->allowed_nssai, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mm_context_convertToJSON() failed [allowed_nssai]"); + goto end; } + cJSON_AddItemToArray(allowed_nssaiList, itemLocal); } } @@ -200,17 +260,13 @@ cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) ogs_error("OpenAPI_mm_context_convertToJSON() failed [nssai_mapping_list]"); goto end; } - - OpenAPI_lnode_t *nssai_mapping_list_node; - if (mm_context->nssai_mapping_list) { - OpenAPI_list_for_each(mm_context->nssai_mapping_list, nssai_mapping_list_node) { - cJSON *itemLocal = OpenAPI_nssai_mapping_convertToJSON(nssai_mapping_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mm_context_convertToJSON() failed [nssai_mapping_list]"); - goto end; - } - cJSON_AddItemToArray(nssai_mapping_listList, itemLocal); + OpenAPI_list_for_each(mm_context->nssai_mapping_list, node) { + cJSON *itemLocal = OpenAPI_nssai_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mm_context_convertToJSON() failed [nssai_mapping_list]"); + goto end; } + cJSON_AddItemToArray(nssai_mapping_listList, itemLocal); } } @@ -220,34 +276,28 @@ cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) ogs_error("OpenAPI_mm_context_convertToJSON() failed [allowed_home_nssai]"); goto end; } - - OpenAPI_lnode_t *allowed_home_nssai_node; - if (mm_context->allowed_home_nssai) { - OpenAPI_list_for_each(mm_context->allowed_home_nssai, allowed_home_nssai_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(allowed_home_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mm_context_convertToJSON() failed [allowed_home_nssai]"); - goto end; - } - cJSON_AddItemToArray(allowed_home_nssaiList, itemLocal); + OpenAPI_list_for_each(mm_context->allowed_home_nssai, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mm_context_convertToJSON() failed [allowed_home_nssai]"); + goto end; } + cJSON_AddItemToArray(allowed_home_nssaiList, itemLocal); } } if (mm_context->ns_instance_list) { - cJSON *ns_instance_list = cJSON_AddArrayToObject(item, "nsInstanceList"); - if (ns_instance_list == NULL) { + cJSON *ns_instance_listList = cJSON_AddArrayToObject(item, "nsInstanceList"); + if (ns_instance_listList == NULL) { ogs_error("OpenAPI_mm_context_convertToJSON() failed [ns_instance_list]"); goto end; } - - OpenAPI_lnode_t *ns_instance_list_node; - OpenAPI_list_for_each(mm_context->ns_instance_list, ns_instance_list_node) { - if (cJSON_AddStringToObject(ns_instance_list, "", (char*)ns_instance_list_node->data) == NULL) { - ogs_error("OpenAPI_mm_context_convertToJSON() failed [ns_instance_list]"); - goto end; + OpenAPI_list_for_each(mm_context->ns_instance_list, node) { + if (cJSON_AddStringToObject(ns_instance_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_mm_context_convertToJSON() failed [ns_instance_list]"); + goto end; + } } - } } if (mm_context->expected_u_ebehavior) { @@ -277,14 +327,14 @@ cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) } if (mm_context->plmn_assi_ue_radio_cap_id) { - if (cJSON_AddNumberToObject(item, "plmnAssiUeRadioCapId", mm_context->plmn_assi_ue_radio_cap_id) == NULL) { + if (cJSON_AddStringToObject(item, "plmnAssiUeRadioCapId", mm_context->plmn_assi_ue_radio_cap_id) == NULL) { ogs_error("OpenAPI_mm_context_convertToJSON() failed [plmn_assi_ue_radio_cap_id]"); goto end; } } if (mm_context->man_assi_ue_radio_cap_id) { - if (cJSON_AddNumberToObject(item, "manAssiUeRadioCapId", mm_context->man_assi_ue_radio_cap_id) == NULL) { + if (cJSON_AddStringToObject(item, "manAssiUeRadioCapId", mm_context->man_assi_ue_radio_cap_id) == NULL) { ogs_error("OpenAPI_mm_context_convertToJSON() failed [man_assi_ue_radio_cap_id]"); goto end; } @@ -349,17 +399,13 @@ cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) ogs_error("OpenAPI_mm_context_convertToJSON() failed [nssaa_status_list]"); goto end; } - - OpenAPI_lnode_t *nssaa_status_list_node; - if (mm_context->nssaa_status_list) { - OpenAPI_list_for_each(mm_context->nssaa_status_list, nssaa_status_list_node) { - cJSON *itemLocal = OpenAPI_nssaa_status_convertToJSON(nssaa_status_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mm_context_convertToJSON() failed [nssaa_status_list]"); - goto end; - } - cJSON_AddItemToArray(nssaa_status_listList, itemLocal); + OpenAPI_list_for_each(mm_context->nssaa_status_list, node) { + cJSON *itemLocal = OpenAPI_nssaa_status_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mm_context_convertToJSON() failed [nssaa_status_list]"); + goto end; } + cJSON_AddItemToArray(nssaa_status_listList, itemLocal); } } @@ -369,17 +415,13 @@ cJSON *OpenAPI_mm_context_convertToJSON(OpenAPI_mm_context_t *mm_context) ogs_error("OpenAPI_mm_context_convertToJSON() failed [pending_nssai_mapping_list]"); goto end; } - - OpenAPI_lnode_t *pending_nssai_mapping_list_node; - if (mm_context->pending_nssai_mapping_list) { - OpenAPI_list_for_each(mm_context->pending_nssai_mapping_list, pending_nssai_mapping_list_node) { - cJSON *itemLocal = OpenAPI_nssai_mapping_convertToJSON(pending_nssai_mapping_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_mm_context_convertToJSON() failed [pending_nssai_mapping_list]"); - goto end; - } - cJSON_AddItemToArray(pending_nssai_mapping_listList, itemLocal); + OpenAPI_list_for_each(mm_context->pending_nssai_mapping_list, node) { + cJSON *itemLocal = OpenAPI_nssai_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_mm_context_convertToJSON() failed [pending_nssai_mapping_list]"); + goto end; } + cJSON_AddItemToArray(pending_nssai_mapping_listList, itemLocal); } } @@ -390,35 +432,65 @@ end: OpenAPI_mm_context_t *OpenAPI_mm_context_parseFromJSON(cJSON *mm_contextJSON) { OpenAPI_mm_context_t *mm_context_local_var = NULL; - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "accessType"); + OpenAPI_lnode_t *node = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *nas_security_mode = NULL; + OpenAPI_nas_security_mode_t *nas_security_mode_local_nonprim = NULL; + cJSON *eps_nas_security_mode = NULL; + OpenAPI_eps_nas_security_mode_t *eps_nas_security_mode_local_nonprim = NULL; + cJSON *nas_downlink_count = NULL; + cJSON *nas_uplink_count = NULL; + cJSON *ue_security_capability = NULL; + cJSON *s1_ue_network_capability = NULL; + cJSON *allowed_nssai = NULL; + OpenAPI_list_t *allowed_nssaiList = NULL; + cJSON *nssai_mapping_list = NULL; + OpenAPI_list_t *nssai_mapping_listList = NULL; + cJSON *allowed_home_nssai = NULL; + OpenAPI_list_t *allowed_home_nssaiList = NULL; + cJSON *ns_instance_list = NULL; + OpenAPI_list_t *ns_instance_listList = NULL; + cJSON *expected_u_ebehavior = NULL; + OpenAPI_expected_ue_behavior_t *expected_u_ebehavior_local_nonprim = NULL; + cJSON *ue_differentiation_info = NULL; + OpenAPI_ue_differentiation_info_t *ue_differentiation_info_local_nonprim = NULL; + cJSON *plmn_assi_ue_radio_cap_id = NULL; + cJSON *man_assi_ue_radio_cap_id = NULL; + cJSON *ucmf_dic_entry_id = NULL; + cJSON *n3_iwf_id = NULL; + OpenAPI_global_ran_node_id_t *n3_iwf_id_local_nonprim = NULL; + cJSON *wagf_id = NULL; + OpenAPI_global_ran_node_id_t *wagf_id_local_nonprim = NULL; + cJSON *tngf_id = NULL; + OpenAPI_global_ran_node_id_t *tngf_id_local_nonprim = NULL; + cJSON *an_n2_ap_id = NULL; + cJSON *nssaa_status_list = NULL; + OpenAPI_list_t *nssaa_status_listList = NULL; + cJSON *pending_nssai_mapping_list = NULL; + OpenAPI_list_t *pending_nssai_mapping_listList = NULL; + access_type = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "accessType"); if (!access_type) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [access_type]"); goto end; } - - OpenAPI_access_type_e access_typeVariable; if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [access_type]"); goto end; } access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); - cJSON *nas_security_mode = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nasSecurityMode"); - - OpenAPI_nas_security_mode_t *nas_security_mode_local_nonprim = NULL; + nas_security_mode = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nasSecurityMode"); if (nas_security_mode) { nas_security_mode_local_nonprim = OpenAPI_nas_security_mode_parseFromJSON(nas_security_mode); } - cJSON *eps_nas_security_mode = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "epsNasSecurityMode"); - - OpenAPI_eps_nas_security_mode_t *eps_nas_security_mode_local_nonprim = NULL; + eps_nas_security_mode = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "epsNasSecurityMode"); if (eps_nas_security_mode) { eps_nas_security_mode_local_nonprim = OpenAPI_eps_nas_security_mode_parseFromJSON(eps_nas_security_mode); } - cJSON *nas_downlink_count = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nasDownlinkCount"); - + nas_downlink_count = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nasDownlinkCount"); if (nas_downlink_count) { if (!cJSON_IsNumber(nas_downlink_count)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [nas_downlink_count]"); @@ -426,8 +498,7 @@ OpenAPI_mm_context_t *OpenAPI_mm_context_parseFromJSON(cJSON *mm_contextJSON) } } - cJSON *nas_uplink_count = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nasUplinkCount"); - + nas_uplink_count = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nasUplinkCount"); if (nas_uplink_count) { if (!cJSON_IsNumber(nas_uplink_count)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [nas_uplink_count]"); @@ -435,195 +506,168 @@ OpenAPI_mm_context_t *OpenAPI_mm_context_parseFromJSON(cJSON *mm_contextJSON) } } - cJSON *ue_security_capability = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "ueSecurityCapability"); - + ue_security_capability = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "ueSecurityCapability"); if (ue_security_capability) { - if (!cJSON_IsNumber(ue_security_capability)) { + if (!cJSON_IsString(ue_security_capability) && !cJSON_IsNull(ue_security_capability)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [ue_security_capability]"); goto end; } } - cJSON *s1_ue_network_capability = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "s1UeNetworkCapability"); - + s1_ue_network_capability = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "s1UeNetworkCapability"); if (s1_ue_network_capability) { - if (!cJSON_IsNumber(s1_ue_network_capability)) { + if (!cJSON_IsString(s1_ue_network_capability) && !cJSON_IsNull(s1_ue_network_capability)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [s1_ue_network_capability]"); goto end; } } - cJSON *allowed_nssai = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "allowedNssai"); - - OpenAPI_list_t *allowed_nssaiList; + allowed_nssai = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "allowedNssai"); if (allowed_nssai) { - cJSON *allowed_nssai_local_nonprimitive; - if (!cJSON_IsArray(allowed_nssai)){ - ogs_error("OpenAPI_mm_context_parseFromJSON() failed [allowed_nssai]"); - goto end; - } - - allowed_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_nssai_local_nonprimitive, allowed_nssai ) { - if (!cJSON_IsObject(allowed_nssai_local_nonprimitive)) { + cJSON *allowed_nssai_local = NULL; + if (!cJSON_IsArray(allowed_nssai)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [allowed_nssai]"); goto end; } - OpenAPI_snssai_t *allowed_nssaiItem = OpenAPI_snssai_parseFromJSON(allowed_nssai_local_nonprimitive); - if (!allowed_nssaiItem) { - ogs_error("No allowed_nssaiItem"); - OpenAPI_list_free(allowed_nssaiList); - goto end; + allowed_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_nssai_local, allowed_nssai) { + if (!cJSON_IsObject(allowed_nssai_local)) { + ogs_error("OpenAPI_mm_context_parseFromJSON() failed [allowed_nssai]"); + goto end; + } + OpenAPI_snssai_t *allowed_nssaiItem = OpenAPI_snssai_parseFromJSON(allowed_nssai_local); + if (!allowed_nssaiItem) { + ogs_error("No allowed_nssaiItem"); + OpenAPI_list_free(allowed_nssaiList); + goto end; + } + OpenAPI_list_add(allowed_nssaiList, allowed_nssaiItem); } - - OpenAPI_list_add(allowed_nssaiList, allowed_nssaiItem); - } } - cJSON *nssai_mapping_list = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nssaiMappingList"); - - OpenAPI_list_t *nssai_mapping_listList; + nssai_mapping_list = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nssaiMappingList"); if (nssai_mapping_list) { - cJSON *nssai_mapping_list_local_nonprimitive; - if (!cJSON_IsArray(nssai_mapping_list)){ - ogs_error("OpenAPI_mm_context_parseFromJSON() failed [nssai_mapping_list]"); - goto end; - } - - nssai_mapping_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nssai_mapping_list_local_nonprimitive, nssai_mapping_list ) { - if (!cJSON_IsObject(nssai_mapping_list_local_nonprimitive)) { + cJSON *nssai_mapping_list_local = NULL; + if (!cJSON_IsArray(nssai_mapping_list)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [nssai_mapping_list]"); goto end; } - OpenAPI_nssai_mapping_t *nssai_mapping_listItem = OpenAPI_nssai_mapping_parseFromJSON(nssai_mapping_list_local_nonprimitive); - if (!nssai_mapping_listItem) { - ogs_error("No nssai_mapping_listItem"); - OpenAPI_list_free(nssai_mapping_listList); - goto end; + nssai_mapping_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nssai_mapping_list_local, nssai_mapping_list) { + if (!cJSON_IsObject(nssai_mapping_list_local)) { + ogs_error("OpenAPI_mm_context_parseFromJSON() failed [nssai_mapping_list]"); + goto end; + } + OpenAPI_nssai_mapping_t *nssai_mapping_listItem = OpenAPI_nssai_mapping_parseFromJSON(nssai_mapping_list_local); + if (!nssai_mapping_listItem) { + ogs_error("No nssai_mapping_listItem"); + OpenAPI_list_free(nssai_mapping_listList); + goto end; + } + OpenAPI_list_add(nssai_mapping_listList, nssai_mapping_listItem); } - - OpenAPI_list_add(nssai_mapping_listList, nssai_mapping_listItem); - } } - cJSON *allowed_home_nssai = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "allowedHomeNssai"); - - OpenAPI_list_t *allowed_home_nssaiList; + allowed_home_nssai = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "allowedHomeNssai"); if (allowed_home_nssai) { - cJSON *allowed_home_nssai_local_nonprimitive; - if (!cJSON_IsArray(allowed_home_nssai)){ - ogs_error("OpenAPI_mm_context_parseFromJSON() failed [allowed_home_nssai]"); - goto end; - } - - allowed_home_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_home_nssai_local_nonprimitive, allowed_home_nssai ) { - if (!cJSON_IsObject(allowed_home_nssai_local_nonprimitive)) { + cJSON *allowed_home_nssai_local = NULL; + if (!cJSON_IsArray(allowed_home_nssai)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [allowed_home_nssai]"); goto end; } - OpenAPI_snssai_t *allowed_home_nssaiItem = OpenAPI_snssai_parseFromJSON(allowed_home_nssai_local_nonprimitive); - if (!allowed_home_nssaiItem) { - ogs_error("No allowed_home_nssaiItem"); - OpenAPI_list_free(allowed_home_nssaiList); + allowed_home_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_home_nssai_local, allowed_home_nssai) { + if (!cJSON_IsObject(allowed_home_nssai_local)) { + ogs_error("OpenAPI_mm_context_parseFromJSON() failed [allowed_home_nssai]"); + goto end; + } + OpenAPI_snssai_t *allowed_home_nssaiItem = OpenAPI_snssai_parseFromJSON(allowed_home_nssai_local); + if (!allowed_home_nssaiItem) { + ogs_error("No allowed_home_nssaiItem"); + OpenAPI_list_free(allowed_home_nssaiList); + goto end; + } + OpenAPI_list_add(allowed_home_nssaiList, allowed_home_nssaiItem); + } + } + + ns_instance_list = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nsInstanceList"); + if (ns_instance_list) { + cJSON *ns_instance_list_local = NULL; + if (!cJSON_IsArray(ns_instance_list)) { + ogs_error("OpenAPI_mm_context_parseFromJSON() failed [ns_instance_list]"); goto end; } - OpenAPI_list_add(allowed_home_nssaiList, allowed_home_nssaiItem); - } + ns_instance_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ns_instance_list_local, ns_instance_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ns_instance_list_local)) { + ogs_error("OpenAPI_mm_context_parseFromJSON() failed [ns_instance_list]"); + goto end; + } + OpenAPI_list_add(ns_instance_listList, ogs_strdup(ns_instance_list_local->valuestring)); + } } - cJSON *ns_instance_list = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nsInstanceList"); - - OpenAPI_list_t *ns_instance_listList; - if (ns_instance_list) { - cJSON *ns_instance_list_local; - if (!cJSON_IsArray(ns_instance_list)) { - ogs_error("OpenAPI_mm_context_parseFromJSON() failed [ns_instance_list]"); - goto end; - } - ns_instance_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ns_instance_list_local, ns_instance_list) { - if (!cJSON_IsString(ns_instance_list_local)) { - ogs_error("OpenAPI_mm_context_parseFromJSON() failed [ns_instance_list]"); - goto end; - } - OpenAPI_list_add(ns_instance_listList, ogs_strdup(ns_instance_list_local->valuestring)); - } - } - - cJSON *expected_u_ebehavior = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "expectedUEbehavior"); - - OpenAPI_expected_ue_behavior_t *expected_u_ebehavior_local_nonprim = NULL; + expected_u_ebehavior = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "expectedUEbehavior"); if (expected_u_ebehavior) { expected_u_ebehavior_local_nonprim = OpenAPI_expected_ue_behavior_parseFromJSON(expected_u_ebehavior); } - cJSON *ue_differentiation_info = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "ueDifferentiationInfo"); - - OpenAPI_ue_differentiation_info_t *ue_differentiation_info_local_nonprim = NULL; + ue_differentiation_info = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "ueDifferentiationInfo"); if (ue_differentiation_info) { ue_differentiation_info_local_nonprim = OpenAPI_ue_differentiation_info_parseFromJSON(ue_differentiation_info); } - cJSON *plmn_assi_ue_radio_cap_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "plmnAssiUeRadioCapId"); - + plmn_assi_ue_radio_cap_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "plmnAssiUeRadioCapId"); if (plmn_assi_ue_radio_cap_id) { - if (!cJSON_IsNumber(plmn_assi_ue_radio_cap_id)) { + if (!cJSON_IsString(plmn_assi_ue_radio_cap_id) && !cJSON_IsNull(plmn_assi_ue_radio_cap_id)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [plmn_assi_ue_radio_cap_id]"); goto end; } } - cJSON *man_assi_ue_radio_cap_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "manAssiUeRadioCapId"); - + man_assi_ue_radio_cap_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "manAssiUeRadioCapId"); if (man_assi_ue_radio_cap_id) { - if (!cJSON_IsNumber(man_assi_ue_radio_cap_id)) { + if (!cJSON_IsString(man_assi_ue_radio_cap_id) && !cJSON_IsNull(man_assi_ue_radio_cap_id)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [man_assi_ue_radio_cap_id]"); goto end; } } - cJSON *ucmf_dic_entry_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "ucmfDicEntryId"); - + ucmf_dic_entry_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "ucmfDicEntryId"); if (ucmf_dic_entry_id) { - if (!cJSON_IsString(ucmf_dic_entry_id)) { + if (!cJSON_IsString(ucmf_dic_entry_id) && !cJSON_IsNull(ucmf_dic_entry_id)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [ucmf_dic_entry_id]"); goto end; } } - cJSON *n3_iwf_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "n3IwfId"); - - OpenAPI_global_ran_node_id_t *n3_iwf_id_local_nonprim = NULL; + n3_iwf_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "n3IwfId"); if (n3_iwf_id) { n3_iwf_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(n3_iwf_id); } - cJSON *wagf_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "wagfId"); - - OpenAPI_global_ran_node_id_t *wagf_id_local_nonprim = NULL; + wagf_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "wagfId"); if (wagf_id) { wagf_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(wagf_id); } - cJSON *tngf_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "tngfId"); - - OpenAPI_global_ran_node_id_t *tngf_id_local_nonprim = NULL; + tngf_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "tngfId"); if (tngf_id) { tngf_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(tngf_id); } - cJSON *an_n2_ap_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "anN2ApId"); - + an_n2_ap_id = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "anN2ApId"); if (an_n2_ap_id) { if (!cJSON_IsNumber(an_n2_ap_id)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [an_n2_ap_id]"); @@ -631,62 +675,54 @@ OpenAPI_mm_context_t *OpenAPI_mm_context_parseFromJSON(cJSON *mm_contextJSON) } } - cJSON *nssaa_status_list = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nssaaStatusList"); - - OpenAPI_list_t *nssaa_status_listList; + nssaa_status_list = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "nssaaStatusList"); if (nssaa_status_list) { - cJSON *nssaa_status_list_local_nonprimitive; - if (!cJSON_IsArray(nssaa_status_list)){ - ogs_error("OpenAPI_mm_context_parseFromJSON() failed [nssaa_status_list]"); - goto end; - } - - nssaa_status_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nssaa_status_list_local_nonprimitive, nssaa_status_list ) { - if (!cJSON_IsObject(nssaa_status_list_local_nonprimitive)) { + cJSON *nssaa_status_list_local = NULL; + if (!cJSON_IsArray(nssaa_status_list)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [nssaa_status_list]"); goto end; } - OpenAPI_nssaa_status_t *nssaa_status_listItem = OpenAPI_nssaa_status_parseFromJSON(nssaa_status_list_local_nonprimitive); - if (!nssaa_status_listItem) { - ogs_error("No nssaa_status_listItem"); - OpenAPI_list_free(nssaa_status_listList); - goto end; + nssaa_status_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nssaa_status_list_local, nssaa_status_list) { + if (!cJSON_IsObject(nssaa_status_list_local)) { + ogs_error("OpenAPI_mm_context_parseFromJSON() failed [nssaa_status_list]"); + goto end; + } + OpenAPI_nssaa_status_t *nssaa_status_listItem = OpenAPI_nssaa_status_parseFromJSON(nssaa_status_list_local); + if (!nssaa_status_listItem) { + ogs_error("No nssaa_status_listItem"); + OpenAPI_list_free(nssaa_status_listList); + goto end; + } + OpenAPI_list_add(nssaa_status_listList, nssaa_status_listItem); } - - OpenAPI_list_add(nssaa_status_listList, nssaa_status_listItem); - } } - cJSON *pending_nssai_mapping_list = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "pendingNssaiMappingList"); - - OpenAPI_list_t *pending_nssai_mapping_listList; + pending_nssai_mapping_list = cJSON_GetObjectItemCaseSensitive(mm_contextJSON, "pendingNssaiMappingList"); if (pending_nssai_mapping_list) { - cJSON *pending_nssai_mapping_list_local_nonprimitive; - if (!cJSON_IsArray(pending_nssai_mapping_list)){ - ogs_error("OpenAPI_mm_context_parseFromJSON() failed [pending_nssai_mapping_list]"); - goto end; - } - - pending_nssai_mapping_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pending_nssai_mapping_list_local_nonprimitive, pending_nssai_mapping_list ) { - if (!cJSON_IsObject(pending_nssai_mapping_list_local_nonprimitive)) { + cJSON *pending_nssai_mapping_list_local = NULL; + if (!cJSON_IsArray(pending_nssai_mapping_list)) { ogs_error("OpenAPI_mm_context_parseFromJSON() failed [pending_nssai_mapping_list]"); goto end; } - OpenAPI_nssai_mapping_t *pending_nssai_mapping_listItem = OpenAPI_nssai_mapping_parseFromJSON(pending_nssai_mapping_list_local_nonprimitive); - if (!pending_nssai_mapping_listItem) { - ogs_error("No pending_nssai_mapping_listItem"); - OpenAPI_list_free(pending_nssai_mapping_listList); - goto end; + pending_nssai_mapping_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pending_nssai_mapping_list_local, pending_nssai_mapping_list) { + if (!cJSON_IsObject(pending_nssai_mapping_list_local)) { + ogs_error("OpenAPI_mm_context_parseFromJSON() failed [pending_nssai_mapping_list]"); + goto end; + } + OpenAPI_nssai_mapping_t *pending_nssai_mapping_listItem = OpenAPI_nssai_mapping_parseFromJSON(pending_nssai_mapping_list_local); + if (!pending_nssai_mapping_listItem) { + ogs_error("No pending_nssai_mapping_listItem"); + OpenAPI_list_free(pending_nssai_mapping_listList); + goto end; + } + OpenAPI_list_add(pending_nssai_mapping_listList, pending_nssai_mapping_listItem); } - - OpenAPI_list_add(pending_nssai_mapping_listList, pending_nssai_mapping_listItem); - } } mm_context_local_var = OpenAPI_mm_context_create ( @@ -697,17 +733,17 @@ OpenAPI_mm_context_t *OpenAPI_mm_context_parseFromJSON(cJSON *mm_contextJSON) nas_downlink_count ? nas_downlink_count->valuedouble : 0, nas_uplink_count ? true : false, nas_uplink_count ? nas_uplink_count->valuedouble : 0, - ue_security_capability ? ue_security_capability->valueint : 0, - s1_ue_network_capability ? s1_ue_network_capability->valueint : 0, + ue_security_capability && !cJSON_IsNull(ue_security_capability) ? ogs_strdup(ue_security_capability->valuestring) : NULL, + s1_ue_network_capability && !cJSON_IsNull(s1_ue_network_capability) ? ogs_strdup(s1_ue_network_capability->valuestring) : NULL, allowed_nssai ? allowed_nssaiList : NULL, nssai_mapping_list ? nssai_mapping_listList : NULL, allowed_home_nssai ? allowed_home_nssaiList : NULL, ns_instance_list ? ns_instance_listList : NULL, expected_u_ebehavior ? expected_u_ebehavior_local_nonprim : NULL, ue_differentiation_info ? ue_differentiation_info_local_nonprim : NULL, - plmn_assi_ue_radio_cap_id ? plmn_assi_ue_radio_cap_id->valueint : 0, - man_assi_ue_radio_cap_id ? man_assi_ue_radio_cap_id->valueint : 0, - ucmf_dic_entry_id ? ogs_strdup(ucmf_dic_entry_id->valuestring) : NULL, + plmn_assi_ue_radio_cap_id && !cJSON_IsNull(plmn_assi_ue_radio_cap_id) ? ogs_strdup(plmn_assi_ue_radio_cap_id->valuestring) : NULL, + man_assi_ue_radio_cap_id && !cJSON_IsNull(man_assi_ue_radio_cap_id) ? ogs_strdup(man_assi_ue_radio_cap_id->valuestring) : NULL, + ucmf_dic_entry_id && !cJSON_IsNull(ucmf_dic_entry_id) ? ogs_strdup(ucmf_dic_entry_id->valuestring) : NULL, n3_iwf_id ? n3_iwf_id_local_nonprim : NULL, wagf_id ? wagf_id_local_nonprim : NULL, tngf_id ? tngf_id_local_nonprim : NULL, @@ -719,6 +755,76 @@ OpenAPI_mm_context_t *OpenAPI_mm_context_parseFromJSON(cJSON *mm_contextJSON) return mm_context_local_var; end: + if (nas_security_mode_local_nonprim) { + OpenAPI_nas_security_mode_free(nas_security_mode_local_nonprim); + nas_security_mode_local_nonprim = NULL; + } + if (eps_nas_security_mode_local_nonprim) { + OpenAPI_eps_nas_security_mode_free(eps_nas_security_mode_local_nonprim); + eps_nas_security_mode_local_nonprim = NULL; + } + if (allowed_nssaiList) { + OpenAPI_list_for_each(allowed_nssaiList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(allowed_nssaiList); + allowed_nssaiList = NULL; + } + if (nssai_mapping_listList) { + OpenAPI_list_for_each(nssai_mapping_listList, node) { + OpenAPI_nssai_mapping_free(node->data); + } + OpenAPI_list_free(nssai_mapping_listList); + nssai_mapping_listList = NULL; + } + if (allowed_home_nssaiList) { + OpenAPI_list_for_each(allowed_home_nssaiList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(allowed_home_nssaiList); + allowed_home_nssaiList = NULL; + } + if (ns_instance_listList) { + OpenAPI_list_for_each(ns_instance_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ns_instance_listList); + ns_instance_listList = NULL; + } + if (expected_u_ebehavior_local_nonprim) { + OpenAPI_expected_ue_behavior_free(expected_u_ebehavior_local_nonprim); + expected_u_ebehavior_local_nonprim = NULL; + } + if (ue_differentiation_info_local_nonprim) { + OpenAPI_ue_differentiation_info_free(ue_differentiation_info_local_nonprim); + ue_differentiation_info_local_nonprim = NULL; + } + if (n3_iwf_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(n3_iwf_id_local_nonprim); + n3_iwf_id_local_nonprim = NULL; + } + if (wagf_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(wagf_id_local_nonprim); + wagf_id_local_nonprim = NULL; + } + if (tngf_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(tngf_id_local_nonprim); + tngf_id_local_nonprim = NULL; + } + if (nssaa_status_listList) { + OpenAPI_list_for_each(nssaa_status_listList, node) { + OpenAPI_nssaa_status_free(node->data); + } + OpenAPI_list_free(nssaa_status_listList); + nssaa_status_listList = NULL; + } + if (pending_nssai_mapping_listList) { + OpenAPI_list_for_each(pending_nssai_mapping_listList, node) { + OpenAPI_nssai_mapping_free(node->data); + } + OpenAPI_list_free(pending_nssai_mapping_listList); + pending_nssai_mapping_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/mm_context.h b/lib/sbi/openapi/model/mm_context.h index aea9512bf..7ccdc8ed0 100644 --- a/lib/sbi/openapi/model/mm_context.h +++ b/lib/sbi/openapi/model/mm_context.h @@ -35,16 +35,16 @@ typedef struct OpenAPI_mm_context_s { int nas_downlink_count; bool is_nas_uplink_count; int nas_uplink_count; - char ue_security_capability; - char s1_ue_network_capability; + char *ue_security_capability; + char *s1_ue_network_capability; OpenAPI_list_t *allowed_nssai; OpenAPI_list_t *nssai_mapping_list; OpenAPI_list_t *allowed_home_nssai; OpenAPI_list_t *ns_instance_list; struct OpenAPI_expected_ue_behavior_s *expected_u_ebehavior; struct OpenAPI_ue_differentiation_info_s *ue_differentiation_info; - char plmn_assi_ue_radio_cap_id; - char man_assi_ue_radio_cap_id; + char *plmn_assi_ue_radio_cap_id; + char *man_assi_ue_radio_cap_id; char *ucmf_dic_entry_id; struct OpenAPI_global_ran_node_id_s *n3_iwf_id; struct OpenAPI_global_ran_node_id_s *wagf_id; @@ -63,16 +63,16 @@ OpenAPI_mm_context_t *OpenAPI_mm_context_create( int nas_downlink_count, bool is_nas_uplink_count, int nas_uplink_count, - char ue_security_capability, - char s1_ue_network_capability, + char *ue_security_capability, + char *s1_ue_network_capability, OpenAPI_list_t *allowed_nssai, OpenAPI_list_t *nssai_mapping_list, OpenAPI_list_t *allowed_home_nssai, OpenAPI_list_t *ns_instance_list, OpenAPI_expected_ue_behavior_t *expected_u_ebehavior, OpenAPI_ue_differentiation_info_t *ue_differentiation_info, - char plmn_assi_ue_radio_cap_id, - char man_assi_ue_radio_cap_id, + char *plmn_assi_ue_radio_cap_id, + char *man_assi_ue_radio_cap_id, char *ucmf_dic_entry_id, OpenAPI_global_ran_node_id_t *n3_iwf_id, OpenAPI_global_ran_node_id_t *wagf_id, diff --git a/lib/sbi/openapi/model/mme_capabilities.c b/lib/sbi/openapi/model/mme_capabilities.c index 3d41e9461..cfd30bbe9 100644 --- a/lib/sbi/openapi/model/mme_capabilities.c +++ b/lib/sbi/openapi/model/mme_capabilities.c @@ -24,16 +24,18 @@ OpenAPI_mme_capabilities_t *OpenAPI_mme_capabilities_create( void OpenAPI_mme_capabilities_free(OpenAPI_mme_capabilities_t *mme_capabilities) { + OpenAPI_lnode_t *node = NULL; + if (NULL == mme_capabilities) { return; } - OpenAPI_lnode_t *node; ogs_free(mme_capabilities); } cJSON *OpenAPI_mme_capabilities_convertToJSON(OpenAPI_mme_capabilities_t *mme_capabilities) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (mme_capabilities == NULL) { ogs_error("OpenAPI_mme_capabilities_convertToJSON() failed [MmeCapabilities]"); @@ -62,8 +64,10 @@ end: OpenAPI_mme_capabilities_t *OpenAPI_mme_capabilities_parseFromJSON(cJSON *mme_capabilitiesJSON) { OpenAPI_mme_capabilities_t *mme_capabilities_local_var = NULL; - cJSON *non_ip_supported = cJSON_GetObjectItemCaseSensitive(mme_capabilitiesJSON, "nonIpSupported"); - + OpenAPI_lnode_t *node = NULL; + cJSON *non_ip_supported = NULL; + cJSON *ethernet_supported = NULL; + non_ip_supported = cJSON_GetObjectItemCaseSensitive(mme_capabilitiesJSON, "nonIpSupported"); if (non_ip_supported) { if (!cJSON_IsBool(non_ip_supported)) { ogs_error("OpenAPI_mme_capabilities_parseFromJSON() failed [non_ip_supported]"); @@ -71,8 +75,7 @@ OpenAPI_mme_capabilities_t *OpenAPI_mme_capabilities_parseFromJSON(cJSON *mme_ca } } - cJSON *ethernet_supported = cJSON_GetObjectItemCaseSensitive(mme_capabilitiesJSON, "ethernetSupported"); - + ethernet_supported = cJSON_GetObjectItemCaseSensitive(mme_capabilitiesJSON, "ethernetSupported"); if (ethernet_supported) { if (!cJSON_IsBool(ethernet_supported)) { ogs_error("OpenAPI_mme_capabilities_parseFromJSON() failed [ethernet_supported]"); diff --git a/lib/sbi/openapi/model/mo_exp_data_counter.c b/lib/sbi/openapi/model/mo_exp_data_counter.c index 5083340d0..4cec025df 100644 --- a/lib/sbi/openapi/model/mo_exp_data_counter.c +++ b/lib/sbi/openapi/model/mo_exp_data_counter.c @@ -20,17 +20,22 @@ OpenAPI_mo_exp_data_counter_t *OpenAPI_mo_exp_data_counter_create( void OpenAPI_mo_exp_data_counter_free(OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter) { + OpenAPI_lnode_t *node = NULL; + if (NULL == mo_exp_data_counter) { return; } - OpenAPI_lnode_t *node; - ogs_free(mo_exp_data_counter->time_stamp); + if (mo_exp_data_counter->time_stamp) { + ogs_free(mo_exp_data_counter->time_stamp); + mo_exp_data_counter->time_stamp = NULL; + } ogs_free(mo_exp_data_counter); } cJSON *OpenAPI_mo_exp_data_counter_convertToJSON(OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (mo_exp_data_counter == NULL) { ogs_error("OpenAPI_mo_exp_data_counter_convertToJSON() failed [MoExpDataCounter]"); @@ -57,21 +62,22 @@ end: OpenAPI_mo_exp_data_counter_t *OpenAPI_mo_exp_data_counter_parseFromJSON(cJSON *mo_exp_data_counterJSON) { OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_var = NULL; - cJSON *counter = cJSON_GetObjectItemCaseSensitive(mo_exp_data_counterJSON, "counter"); + OpenAPI_lnode_t *node = NULL; + cJSON *counter = NULL; + cJSON *time_stamp = NULL; + counter = cJSON_GetObjectItemCaseSensitive(mo_exp_data_counterJSON, "counter"); if (!counter) { ogs_error("OpenAPI_mo_exp_data_counter_parseFromJSON() failed [counter]"); goto end; } - if (!cJSON_IsNumber(counter)) { ogs_error("OpenAPI_mo_exp_data_counter_parseFromJSON() failed [counter]"); goto end; } - cJSON *time_stamp = cJSON_GetObjectItemCaseSensitive(mo_exp_data_counterJSON, "timeStamp"); - + time_stamp = cJSON_GetObjectItemCaseSensitive(mo_exp_data_counterJSON, "timeStamp"); if (time_stamp) { - if (!cJSON_IsString(time_stamp)) { + if (!cJSON_IsString(time_stamp) && !cJSON_IsNull(time_stamp)) { ogs_error("OpenAPI_mo_exp_data_counter_parseFromJSON() failed [time_stamp]"); goto end; } @@ -80,7 +86,7 @@ OpenAPI_mo_exp_data_counter_t *OpenAPI_mo_exp_data_counter_parseFromJSON(cJSON * mo_exp_data_counter_local_var = OpenAPI_mo_exp_data_counter_create ( counter->valuedouble, - time_stamp ? ogs_strdup(time_stamp->valuestring) : NULL + time_stamp && !cJSON_IsNull(time_stamp) ? ogs_strdup(time_stamp->valuestring) : NULL ); return mo_exp_data_counter_local_var; diff --git a/lib/sbi/openapi/model/model_5_gvn_group_configuration.c b/lib/sbi/openapi/model/model_5_gvn_group_configuration.c index 22aa67e8e..71ee26332 100644 --- a/lib/sbi/openapi/model/model_5_gvn_group_configuration.c +++ b/lib/sbi/openapi/model/model_5_gvn_group_configuration.c @@ -30,24 +30,41 @@ OpenAPI_model_5_gvn_group_configuration_t *OpenAPI_model_5_gvn_group_configurati void OpenAPI_model_5_gvn_group_configuration_free(OpenAPI_model_5_gvn_group_configuration_t *model_5_gvn_group_configuration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == model_5_gvn_group_configuration) { return; } - OpenAPI_lnode_t *node; - OpenAPI_model_5_gvn_group_data_free(model_5_gvn_group_configuration->_5g_vn_group_data); - OpenAPI_list_for_each(model_5_gvn_group_configuration->members, node) { - ogs_free(node->data); + if (model_5_gvn_group_configuration->_5g_vn_group_data) { + OpenAPI_model_5_gvn_group_data_free(model_5_gvn_group_configuration->_5g_vn_group_data); + model_5_gvn_group_configuration->_5g_vn_group_data = NULL; + } + if (model_5_gvn_group_configuration->members) { + OpenAPI_list_for_each(model_5_gvn_group_configuration->members, node) { + ogs_free(node->data); + } + OpenAPI_list_free(model_5_gvn_group_configuration->members); + model_5_gvn_group_configuration->members = NULL; + } + if (model_5_gvn_group_configuration->af_instance_id) { + ogs_free(model_5_gvn_group_configuration->af_instance_id); + model_5_gvn_group_configuration->af_instance_id = NULL; + } + if (model_5_gvn_group_configuration->internal_group_identifier) { + ogs_free(model_5_gvn_group_configuration->internal_group_identifier); + model_5_gvn_group_configuration->internal_group_identifier = NULL; + } + if (model_5_gvn_group_configuration->mtc_provider_information) { + ogs_free(model_5_gvn_group_configuration->mtc_provider_information); + model_5_gvn_group_configuration->mtc_provider_information = NULL; } - OpenAPI_list_free(model_5_gvn_group_configuration->members); - ogs_free(model_5_gvn_group_configuration->af_instance_id); - ogs_free(model_5_gvn_group_configuration->internal_group_identifier); - ogs_free(model_5_gvn_group_configuration->mtc_provider_information); ogs_free(model_5_gvn_group_configuration); } cJSON *OpenAPI_model_5_gvn_group_configuration_convertToJSON(OpenAPI_model_5_gvn_group_configuration_t *model_5_gvn_group_configuration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (model_5_gvn_group_configuration == NULL) { ogs_error("OpenAPI_model_5_gvn_group_configuration_convertToJSON() failed [5GVnGroupConfiguration]"); @@ -69,19 +86,17 @@ cJSON *OpenAPI_model_5_gvn_group_configuration_convertToJSON(OpenAPI_model_5_gvn } if (model_5_gvn_group_configuration->members) { - cJSON *members = cJSON_AddArrayToObject(item, "members"); - if (members == NULL) { + cJSON *membersList = cJSON_AddArrayToObject(item, "members"); + if (membersList == NULL) { ogs_error("OpenAPI_model_5_gvn_group_configuration_convertToJSON() failed [members]"); goto end; } - - OpenAPI_lnode_t *members_node; - OpenAPI_list_for_each(model_5_gvn_group_configuration->members, members_node) { - if (cJSON_AddStringToObject(members, "", (char*)members_node->data) == NULL) { - ogs_error("OpenAPI_model_5_gvn_group_configuration_convertToJSON() failed [members]"); - goto end; + OpenAPI_list_for_each(model_5_gvn_group_configuration->members, node) { + if (cJSON_AddStringToObject(membersList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_model_5_gvn_group_configuration_convertToJSON() failed [members]"); + goto end; + } } - } } if (model_5_gvn_group_configuration->is_reference_id) { @@ -119,35 +134,42 @@ end: OpenAPI_model_5_gvn_group_configuration_t *OpenAPI_model_5_gvn_group_configuration_parseFromJSON(cJSON *model_5_gvn_group_configurationJSON) { OpenAPI_model_5_gvn_group_configuration_t *model_5_gvn_group_configuration_local_var = NULL; - cJSON *_5g_vn_group_data = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "5gVnGroupData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *_5g_vn_group_data = NULL; OpenAPI_model_5_gvn_group_data_t *_5g_vn_group_data_local_nonprim = NULL; + cJSON *members = NULL; + OpenAPI_list_t *membersList = NULL; + cJSON *reference_id = NULL; + cJSON *af_instance_id = NULL; + cJSON *internal_group_identifier = NULL; + cJSON *mtc_provider_information = NULL; + _5g_vn_group_data = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "5gVnGroupData"); if (_5g_vn_group_data) { _5g_vn_group_data_local_nonprim = OpenAPI_model_5_gvn_group_data_parseFromJSON(_5g_vn_group_data); } - cJSON *members = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "members"); - - OpenAPI_list_t *membersList; + members = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "members"); if (members) { - cJSON *members_local; - if (!cJSON_IsArray(members)) { - ogs_error("OpenAPI_model_5_gvn_group_configuration_parseFromJSON() failed [members]"); - goto end; - } - membersList = OpenAPI_list_create(); + cJSON *members_local = NULL; + if (!cJSON_IsArray(members)) { + ogs_error("OpenAPI_model_5_gvn_group_configuration_parseFromJSON() failed [members]"); + goto end; + } - cJSON_ArrayForEach(members_local, members) { - if (!cJSON_IsString(members_local)) { - ogs_error("OpenAPI_model_5_gvn_group_configuration_parseFromJSON() failed [members]"); - goto end; - } - OpenAPI_list_add(membersList, ogs_strdup(members_local->valuestring)); - } + membersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(members_local, members) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(members_local)) { + ogs_error("OpenAPI_model_5_gvn_group_configuration_parseFromJSON() failed [members]"); + goto end; + } + OpenAPI_list_add(membersList, ogs_strdup(members_local->valuestring)); + } } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "referenceId"); - + reference_id = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "referenceId"); if (reference_id) { if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_model_5_gvn_group_configuration_parseFromJSON() failed [reference_id]"); @@ -155,28 +177,25 @@ OpenAPI_model_5_gvn_group_configuration_t *OpenAPI_model_5_gvn_group_configurati } } - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "afInstanceId"); - + af_instance_id = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "afInstanceId"); if (af_instance_id) { - if (!cJSON_IsString(af_instance_id)) { + if (!cJSON_IsString(af_instance_id) && !cJSON_IsNull(af_instance_id)) { ogs_error("OpenAPI_model_5_gvn_group_configuration_parseFromJSON() failed [af_instance_id]"); goto end; } } - cJSON *internal_group_identifier = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "internalGroupIdentifier"); - + internal_group_identifier = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "internalGroupIdentifier"); if (internal_group_identifier) { - if (!cJSON_IsString(internal_group_identifier)) { + if (!cJSON_IsString(internal_group_identifier) && !cJSON_IsNull(internal_group_identifier)) { ogs_error("OpenAPI_model_5_gvn_group_configuration_parseFromJSON() failed [internal_group_identifier]"); goto end; } } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_configurationJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_model_5_gvn_group_configuration_parseFromJSON() failed [mtc_provider_information]"); goto end; } @@ -187,13 +206,24 @@ OpenAPI_model_5_gvn_group_configuration_t *OpenAPI_model_5_gvn_group_configurati members ? membersList : NULL, reference_id ? true : false, reference_id ? reference_id->valuedouble : 0, - af_instance_id ? ogs_strdup(af_instance_id->valuestring) : NULL, - internal_group_identifier ? ogs_strdup(internal_group_identifier->valuestring) : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + af_instance_id && !cJSON_IsNull(af_instance_id) ? ogs_strdup(af_instance_id->valuestring) : NULL, + internal_group_identifier && !cJSON_IsNull(internal_group_identifier) ? ogs_strdup(internal_group_identifier->valuestring) : NULL, + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return model_5_gvn_group_configuration_local_var; end: + if (_5g_vn_group_data_local_nonprim) { + OpenAPI_model_5_gvn_group_data_free(_5g_vn_group_data_local_nonprim); + _5g_vn_group_data_local_nonprim = NULL; + } + if (membersList) { + OpenAPI_list_for_each(membersList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(membersList); + membersList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/model_5_gvn_group_data.c b/lib/sbi/openapi/model/model_5_gvn_group_data.c index 854ef1256..3d57791d5 100644 --- a/lib/sbi/openapi/model/model_5_gvn_group_data.c +++ b/lib/sbi/openapi/model/model_5_gvn_group_data.c @@ -30,24 +30,41 @@ OpenAPI_model_5_gvn_group_data_t *OpenAPI_model_5_gvn_group_data_create( void OpenAPI_model_5_gvn_group_data_free(OpenAPI_model_5_gvn_group_data_t *model_5_gvn_group_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == model_5_gvn_group_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(model_5_gvn_group_data->dnn); - OpenAPI_snssai_free(model_5_gvn_group_data->s_nssai); - OpenAPI_list_free(model_5_gvn_group_data->pdu_session_types); - OpenAPI_list_for_each(model_5_gvn_group_data->app_descriptors, node) { - OpenAPI_app_descriptor_free(node->data); + if (model_5_gvn_group_data->dnn) { + ogs_free(model_5_gvn_group_data->dnn); + model_5_gvn_group_data->dnn = NULL; + } + if (model_5_gvn_group_data->s_nssai) { + OpenAPI_snssai_free(model_5_gvn_group_data->s_nssai); + model_5_gvn_group_data->s_nssai = NULL; + } + if (model_5_gvn_group_data->pdu_session_types) { + OpenAPI_list_free(model_5_gvn_group_data->pdu_session_types); + model_5_gvn_group_data->pdu_session_types = NULL; + } + if (model_5_gvn_group_data->app_descriptors) { + OpenAPI_list_for_each(model_5_gvn_group_data->app_descriptors, node) { + OpenAPI_app_descriptor_free(node->data); + } + OpenAPI_list_free(model_5_gvn_group_data->app_descriptors); + model_5_gvn_group_data->app_descriptors = NULL; + } + if (model_5_gvn_group_data->dn_aaa_address) { + OpenAPI_ip_address_1_free(model_5_gvn_group_data->dn_aaa_address); + model_5_gvn_group_data->dn_aaa_address = NULL; } - OpenAPI_list_free(model_5_gvn_group_data->app_descriptors); - OpenAPI_ip_address_1_free(model_5_gvn_group_data->dn_aaa_address); ogs_free(model_5_gvn_group_data); } cJSON *OpenAPI_model_5_gvn_group_data_convertToJSON(OpenAPI_model_5_gvn_group_data_t *model_5_gvn_group_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (model_5_gvn_group_data == NULL) { ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [5GVnGroupData]"); @@ -55,11 +72,19 @@ cJSON *OpenAPI_model_5_gvn_group_data_convertToJSON(OpenAPI_model_5_gvn_group_da } item = cJSON_CreateObject(); + if (!model_5_gvn_group_data->dnn) { + ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", model_5_gvn_group_data->dnn) == NULL) { ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [dnn]"); goto end; } + if (!model_5_gvn_group_data->s_nssai) { + ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [s_nssai]"); + return NULL; + } cJSON *s_nssai_local_JSON = OpenAPI_snssai_convertToJSON(model_5_gvn_group_data->s_nssai); if (s_nssai_local_JSON == NULL) { ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [s_nssai]"); @@ -71,15 +96,14 @@ cJSON *OpenAPI_model_5_gvn_group_data_convertToJSON(OpenAPI_model_5_gvn_group_da goto end; } - if (model_5_gvn_group_data->pdu_session_types) { - cJSON *pdu_session_types = cJSON_AddArrayToObject(item, "pduSessionTypes"); - if (pdu_session_types == NULL) { + if (model_5_gvn_group_data->pdu_session_types != OpenAPI_pdu_session_type_NULL) { + cJSON *pdu_session_typesList = cJSON_AddArrayToObject(item, "pduSessionTypes"); + if (pdu_session_typesList == NULL) { ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [pdu_session_types]"); goto end; } - OpenAPI_lnode_t *pdu_session_types_node; - OpenAPI_list_for_each(model_5_gvn_group_data->pdu_session_types, pdu_session_types_node) { - if (cJSON_AddStringToObject(pdu_session_types, "", OpenAPI_pdu_session_type_ToString((intptr_t)pdu_session_types_node->data)) == NULL) { + OpenAPI_list_for_each(model_5_gvn_group_data->pdu_session_types, node) { + if (cJSON_AddStringToObject(pdu_session_typesList, "", OpenAPI_pdu_session_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [pdu_session_types]"); goto end; } @@ -92,17 +116,13 @@ cJSON *OpenAPI_model_5_gvn_group_data_convertToJSON(OpenAPI_model_5_gvn_group_da ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [app_descriptors]"); goto end; } - - OpenAPI_lnode_t *app_descriptors_node; - if (model_5_gvn_group_data->app_descriptors) { - OpenAPI_list_for_each(model_5_gvn_group_data->app_descriptors, app_descriptors_node) { - cJSON *itemLocal = OpenAPI_app_descriptor_convertToJSON(app_descriptors_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [app_descriptors]"); - goto end; - } - cJSON_AddItemToArray(app_descriptorsList, itemLocal); + OpenAPI_list_for_each(model_5_gvn_group_data->app_descriptors, node) { + cJSON *itemLocal = OpenAPI_app_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_model_5_gvn_group_data_convertToJSON() failed [app_descriptors]"); + goto end; } + cJSON_AddItemToArray(app_descriptorsList, itemLocal); } } @@ -133,79 +153,79 @@ end: OpenAPI_model_5_gvn_group_data_t *OpenAPI_model_5_gvn_group_data_parseFromJSON(cJSON *model_5_gvn_group_dataJSON) { OpenAPI_model_5_gvn_group_data_t *model_5_gvn_group_data_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *pdu_session_types = NULL; + OpenAPI_list_t *pdu_session_typesList = NULL; + cJSON *app_descriptors = NULL; + OpenAPI_list_t *app_descriptorsList = NULL; + cJSON *secondary_auth = NULL; + cJSON *dn_aaa_address = NULL; + OpenAPI_ip_address_1_t *dn_aaa_address_local_nonprim = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [dnn]"); goto end; } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "sNssai"); + s_nssai = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "sNssai"); if (!s_nssai) { ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [s_nssai]"); goto end; } - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); - cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "pduSessionTypes"); - - OpenAPI_list_t *pdu_session_typesList; + pdu_session_types = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "pduSessionTypes"); if (pdu_session_types) { - cJSON *pdu_session_types_local_nonprimitive; - if (!cJSON_IsArray(pdu_session_types)) { - ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [pdu_session_types]"); - goto end; - } - - pdu_session_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_session_types_local_nonprimitive, pdu_session_types ) { - if (!cJSON_IsString(pdu_session_types_local_nonprimitive)){ + cJSON *pdu_session_types_local = NULL; + if (!cJSON_IsArray(pdu_session_types)) { ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [pdu_session_types]"); goto end; } - OpenAPI_list_add(pdu_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(pdu_session_types_local_nonprimitive->valuestring)); - } + pdu_session_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_types_local, pdu_session_types) { + if (!cJSON_IsString(pdu_session_types_local)) { + ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [pdu_session_types]"); + goto end; + } + OpenAPI_list_add(pdu_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(pdu_session_types_local->valuestring)); + } } - cJSON *app_descriptors = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "appDescriptors"); - - OpenAPI_list_t *app_descriptorsList; + app_descriptors = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "appDescriptors"); if (app_descriptors) { - cJSON *app_descriptors_local_nonprimitive; - if (!cJSON_IsArray(app_descriptors)){ - ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [app_descriptors]"); - goto end; - } - - app_descriptorsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(app_descriptors_local_nonprimitive, app_descriptors ) { - if (!cJSON_IsObject(app_descriptors_local_nonprimitive)) { + cJSON *app_descriptors_local = NULL; + if (!cJSON_IsArray(app_descriptors)) { ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [app_descriptors]"); goto end; } - OpenAPI_app_descriptor_t *app_descriptorsItem = OpenAPI_app_descriptor_parseFromJSON(app_descriptors_local_nonprimitive); - if (!app_descriptorsItem) { - ogs_error("No app_descriptorsItem"); - OpenAPI_list_free(app_descriptorsList); - goto end; + app_descriptorsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_descriptors_local, app_descriptors) { + if (!cJSON_IsObject(app_descriptors_local)) { + ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [app_descriptors]"); + goto end; + } + OpenAPI_app_descriptor_t *app_descriptorsItem = OpenAPI_app_descriptor_parseFromJSON(app_descriptors_local); + if (!app_descriptorsItem) { + ogs_error("No app_descriptorsItem"); + OpenAPI_list_free(app_descriptorsList); + goto end; + } + OpenAPI_list_add(app_descriptorsList, app_descriptorsItem); } - - OpenAPI_list_add(app_descriptorsList, app_descriptorsItem); - } } - cJSON *secondary_auth = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "secondaryAuth"); - + secondary_auth = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "secondaryAuth"); if (secondary_auth) { if (!cJSON_IsBool(secondary_auth)) { ogs_error("OpenAPI_model_5_gvn_group_data_parseFromJSON() failed [secondary_auth]"); @@ -213,9 +233,7 @@ OpenAPI_model_5_gvn_group_data_t *OpenAPI_model_5_gvn_group_data_parseFromJSON(c } } - cJSON *dn_aaa_address = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "dnAaaAddress"); - - OpenAPI_ip_address_1_t *dn_aaa_address_local_nonprim = NULL; + dn_aaa_address = cJSON_GetObjectItemCaseSensitive(model_5_gvn_group_dataJSON, "dnAaaAddress"); if (dn_aaa_address) { dn_aaa_address_local_nonprim = OpenAPI_ip_address_1_parseFromJSON(dn_aaa_address); } @@ -232,6 +250,25 @@ OpenAPI_model_5_gvn_group_data_t *OpenAPI_model_5_gvn_group_data_parseFromJSON(c return model_5_gvn_group_data_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (pdu_session_typesList) { + OpenAPI_list_free(pdu_session_typesList); + pdu_session_typesList = NULL; + } + if (app_descriptorsList) { + OpenAPI_list_for_each(app_descriptorsList, node) { + OpenAPI_app_descriptor_free(node->data); + } + OpenAPI_list_free(app_descriptorsList); + app_descriptorsList = NULL; + } + if (dn_aaa_address_local_nonprim) { + OpenAPI_ip_address_1_free(dn_aaa_address_local_nonprim); + dn_aaa_address_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/modification_notification.c b/lib/sbi/openapi/model/modification_notification.c index e5fb2fc24..172fdae8e 100644 --- a/lib/sbi/openapi/model/modification_notification.c +++ b/lib/sbi/openapi/model/modification_notification.c @@ -18,20 +18,25 @@ OpenAPI_modification_notification_t *OpenAPI_modification_notification_create( void OpenAPI_modification_notification_free(OpenAPI_modification_notification_t *modification_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == modification_notification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(modification_notification->notify_items, node) { - OpenAPI_notify_item_free(node->data); + if (modification_notification->notify_items) { + OpenAPI_list_for_each(modification_notification->notify_items, node) { + OpenAPI_notify_item_free(node->data); + } + OpenAPI_list_free(modification_notification->notify_items); + modification_notification->notify_items = NULL; } - OpenAPI_list_free(modification_notification->notify_items); ogs_free(modification_notification); } cJSON *OpenAPI_modification_notification_convertToJSON(OpenAPI_modification_notification_t *modification_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (modification_notification == NULL) { ogs_error("OpenAPI_modification_notification_convertToJSON() failed [ModificationNotification]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_modification_notification_convertToJSON(OpenAPI_modification_noti } item = cJSON_CreateObject(); + if (!modification_notification->notify_items) { + ogs_error("OpenAPI_modification_notification_convertToJSON() failed [notify_items]"); + return NULL; + } cJSON *notify_itemsList = cJSON_AddArrayToObject(item, "notifyItems"); if (notify_itemsList == NULL) { ogs_error("OpenAPI_modification_notification_convertToJSON() failed [notify_items]"); goto end; } - - OpenAPI_lnode_t *notify_items_node; - if (modification_notification->notify_items) { - OpenAPI_list_for_each(modification_notification->notify_items, notify_items_node) { - cJSON *itemLocal = OpenAPI_notify_item_convertToJSON(notify_items_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_modification_notification_convertToJSON() failed [notify_items]"); - goto end; - } - cJSON_AddItemToArray(notify_itemsList, itemLocal); + OpenAPI_list_for_each(modification_notification->notify_items, node) { + cJSON *itemLocal = OpenAPI_notify_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_modification_notification_convertToJSON() failed [notify_items]"); + goto end; } + cJSON_AddItemToArray(notify_itemsList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_modification_notification_t *OpenAPI_modification_notification_parseFromJSON(cJSON *modification_notificationJSON) { OpenAPI_modification_notification_t *modification_notification_local_var = NULL; - cJSON *notify_items = cJSON_GetObjectItemCaseSensitive(modification_notificationJSON, "notifyItems"); + OpenAPI_lnode_t *node = NULL; + cJSON *notify_items = NULL; + OpenAPI_list_t *notify_itemsList = NULL; + notify_items = cJSON_GetObjectItemCaseSensitive(modification_notificationJSON, "notifyItems"); if (!notify_items) { ogs_error("OpenAPI_modification_notification_parseFromJSON() failed [notify_items]"); goto end; } - - OpenAPI_list_t *notify_itemsList; - cJSON *notify_items_local_nonprimitive; - if (!cJSON_IsArray(notify_items)){ - ogs_error("OpenAPI_modification_notification_parseFromJSON() failed [notify_items]"); - goto end; - } - - notify_itemsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(notify_items_local_nonprimitive, notify_items ) { - if (!cJSON_IsObject(notify_items_local_nonprimitive)) { + cJSON *notify_items_local = NULL; + if (!cJSON_IsArray(notify_items)) { ogs_error("OpenAPI_modification_notification_parseFromJSON() failed [notify_items]"); goto end; } - OpenAPI_notify_item_t *notify_itemsItem = OpenAPI_notify_item_parseFromJSON(notify_items_local_nonprimitive); - if (!notify_itemsItem) { - ogs_error("No notify_itemsItem"); - OpenAPI_list_free(notify_itemsList); - goto end; + notify_itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notify_items_local, notify_items) { + if (!cJSON_IsObject(notify_items_local)) { + ogs_error("OpenAPI_modification_notification_parseFromJSON() failed [notify_items]"); + goto end; + } + OpenAPI_notify_item_t *notify_itemsItem = OpenAPI_notify_item_parseFromJSON(notify_items_local); + if (!notify_itemsItem) { + ogs_error("No notify_itemsItem"); + OpenAPI_list_free(notify_itemsList); + goto end; + } + OpenAPI_list_add(notify_itemsList, notify_itemsItem); } - OpenAPI_list_add(notify_itemsList, notify_itemsItem); - } - modification_notification_local_var = OpenAPI_modification_notification_create ( notify_itemsList ); return modification_notification_local_var; end: + if (notify_itemsList) { + OpenAPI_list_for_each(notify_itemsList, node) { + OpenAPI_notify_item_free(node->data); + } + OpenAPI_list_free(notify_itemsList); + notify_itemsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/modify_200_response.c b/lib/sbi/openapi/model/modify_200_response.c new file mode 100644 index 000000000..e25a493b3 --- /dev/null +++ b/lib/sbi/openapi/model/modify_200_response.c @@ -0,0 +1,515 @@ + +#include +#include +#include +#include "modify_200_response.h" + +OpenAPI_modify_200_response_t *OpenAPI_modify_200_response_create( + char *nf_instance_id, + bool is_implicit_unsubscribe, + int implicit_unsubscribe, + char *expires, + char *callback_reference, + char *amf_service_name, + OpenAPI_list_t *monitored_resource_uris, + OpenAPI_snssai_t *single_nssai, + char *dnn, + char *subscription_id, + OpenAPI_plmn_id_t *plmn_id, + bool is_immediate_report, + int immediate_report, + OpenAPI_list_t *report, + char *supported_features, + OpenAPI_context_info_t *context_info +) +{ + OpenAPI_modify_200_response_t *modify_200_response_local_var = ogs_malloc(sizeof(OpenAPI_modify_200_response_t)); + ogs_assert(modify_200_response_local_var); + + modify_200_response_local_var->nf_instance_id = nf_instance_id; + modify_200_response_local_var->is_implicit_unsubscribe = is_implicit_unsubscribe; + modify_200_response_local_var->implicit_unsubscribe = implicit_unsubscribe; + modify_200_response_local_var->expires = expires; + modify_200_response_local_var->callback_reference = callback_reference; + modify_200_response_local_var->amf_service_name = amf_service_name; + modify_200_response_local_var->monitored_resource_uris = monitored_resource_uris; + modify_200_response_local_var->single_nssai = single_nssai; + modify_200_response_local_var->dnn = dnn; + modify_200_response_local_var->subscription_id = subscription_id; + modify_200_response_local_var->plmn_id = plmn_id; + modify_200_response_local_var->is_immediate_report = is_immediate_report; + modify_200_response_local_var->immediate_report = immediate_report; + modify_200_response_local_var->report = report; + modify_200_response_local_var->supported_features = supported_features; + modify_200_response_local_var->context_info = context_info; + + return modify_200_response_local_var; +} + +void OpenAPI_modify_200_response_free(OpenAPI_modify_200_response_t *modify_200_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == modify_200_response) { + return; + } + if (modify_200_response->nf_instance_id) { + ogs_free(modify_200_response->nf_instance_id); + modify_200_response->nf_instance_id = NULL; + } + if (modify_200_response->expires) { + ogs_free(modify_200_response->expires); + modify_200_response->expires = NULL; + } + if (modify_200_response->callback_reference) { + ogs_free(modify_200_response->callback_reference); + modify_200_response->callback_reference = NULL; + } + if (modify_200_response->amf_service_name) { + ogs_free(modify_200_response->amf_service_name); + modify_200_response->amf_service_name = NULL; + } + if (modify_200_response->monitored_resource_uris) { + OpenAPI_list_for_each(modify_200_response->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(modify_200_response->monitored_resource_uris); + modify_200_response->monitored_resource_uris = NULL; + } + if (modify_200_response->single_nssai) { + OpenAPI_snssai_free(modify_200_response->single_nssai); + modify_200_response->single_nssai = NULL; + } + if (modify_200_response->dnn) { + ogs_free(modify_200_response->dnn); + modify_200_response->dnn = NULL; + } + if (modify_200_response->subscription_id) { + ogs_free(modify_200_response->subscription_id); + modify_200_response->subscription_id = NULL; + } + if (modify_200_response->plmn_id) { + OpenAPI_plmn_id_free(modify_200_response->plmn_id); + modify_200_response->plmn_id = NULL; + } + if (modify_200_response->report) { + OpenAPI_list_for_each(modify_200_response->report, node) { + OpenAPI_report_item_free(node->data); + } + OpenAPI_list_free(modify_200_response->report); + modify_200_response->report = NULL; + } + if (modify_200_response->supported_features) { + ogs_free(modify_200_response->supported_features); + modify_200_response->supported_features = NULL; + } + if (modify_200_response->context_info) { + OpenAPI_context_info_free(modify_200_response->context_info); + modify_200_response->context_info = NULL; + } + ogs_free(modify_200_response); +} + +cJSON *OpenAPI_modify_200_response_convertToJSON(OpenAPI_modify_200_response_t *modify_200_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (modify_200_response == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [Modify_200_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (!modify_200_response->nf_instance_id) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [nf_instance_id]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "nfInstanceId", modify_200_response->nf_instance_id) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [nf_instance_id]"); + goto end; + } + + if (modify_200_response->is_implicit_unsubscribe) { + if (cJSON_AddBoolToObject(item, "implicitUnsubscribe", modify_200_response->implicit_unsubscribe) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [implicit_unsubscribe]"); + goto end; + } + } + + if (modify_200_response->expires) { + if (cJSON_AddStringToObject(item, "expires", modify_200_response->expires) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [expires]"); + goto end; + } + } + + if (!modify_200_response->callback_reference) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [callback_reference]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "callbackReference", modify_200_response->callback_reference) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [callback_reference]"); + goto end; + } + + if (modify_200_response->amf_service_name) { + if (cJSON_AddStringToObject(item, "amfServiceName", modify_200_response->amf_service_name) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [amf_service_name]"); + goto end; + } + } + + if (!modify_200_response->monitored_resource_uris) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [monitored_resource_uris]"); + return NULL; + } + cJSON *monitored_resource_urisList = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_urisList == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_for_each(modify_200_response->monitored_resource_uris, node) { + if (cJSON_AddStringToObject(monitored_resource_urisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } + } + + if (modify_200_response->single_nssai) { + cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(modify_200_response->single_nssai); + if (single_nssai_local_JSON == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [single_nssai]"); + goto end; + } + cJSON_AddItemToObject(item, "singleNssai", single_nssai_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [single_nssai]"); + goto end; + } + } + + if (modify_200_response->dnn) { + if (cJSON_AddStringToObject(item, "dnn", modify_200_response->dnn) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [dnn]"); + goto end; + } + } + + if (modify_200_response->subscription_id) { + if (cJSON_AddStringToObject(item, "subscriptionId", modify_200_response->subscription_id) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [subscription_id]"); + goto end; + } + } + + if (modify_200_response->plmn_id) { + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(modify_200_response->plmn_id); + if (plmn_id_local_JSON == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [plmn_id]"); + goto end; + } + cJSON_AddItemToObject(item, "plmnId", plmn_id_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [plmn_id]"); + goto end; + } + } + + if (modify_200_response->is_immediate_report) { + if (cJSON_AddBoolToObject(item, "immediateReport", modify_200_response->immediate_report) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [immediate_report]"); + goto end; + } + } + + if (!modify_200_response->report) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [report]"); + return NULL; + } + cJSON *reportList = cJSON_AddArrayToObject(item, "report"); + if (reportList == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [report]"); + goto end; + } + OpenAPI_list_for_each(modify_200_response->report, node) { + cJSON *itemLocal = OpenAPI_report_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [report]"); + goto end; + } + cJSON_AddItemToArray(reportList, itemLocal); + } + + if (modify_200_response->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", modify_200_response->supported_features) == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (modify_200_response->context_info) { + cJSON *context_info_local_JSON = OpenAPI_context_info_convertToJSON(modify_200_response->context_info); + if (context_info_local_JSON == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [context_info]"); + goto end; + } + cJSON_AddItemToObject(item, "contextInfo", context_info_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed [context_info]"); + goto end; + } + } + +end: + return item; +} + +OpenAPI_modify_200_response_t *OpenAPI_modify_200_response_parseFromJSON(cJSON *modify_200_responseJSON) +{ + OpenAPI_modify_200_response_t *modify_200_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instance_id = NULL; + cJSON *implicit_unsubscribe = NULL; + cJSON *expires = NULL; + cJSON *callback_reference = NULL; + cJSON *amf_service_name = NULL; + cJSON *monitored_resource_uris = NULL; + OpenAPI_list_t *monitored_resource_urisList = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + cJSON *dnn = NULL; + cJSON *subscription_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *immediate_report = NULL; + cJSON *report = NULL; + OpenAPI_list_t *reportList = NULL; + cJSON *supported_features = NULL; + cJSON *context_info = NULL; + OpenAPI_context_info_t *context_info_local_nonprim = NULL; + nf_instance_id = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "nfInstanceId"); + if (!nf_instance_id) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [nf_instance_id]"); + goto end; + } + if (!cJSON_IsString(nf_instance_id)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [nf_instance_id]"); + goto end; + } + + implicit_unsubscribe = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "implicitUnsubscribe"); + if (implicit_unsubscribe) { + if (!cJSON_IsBool(implicit_unsubscribe)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [implicit_unsubscribe]"); + goto end; + } + } + + expires = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "expires"); + if (expires) { + if (!cJSON_IsString(expires) && !cJSON_IsNull(expires)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [expires]"); + goto end; + } + } + + callback_reference = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "callbackReference"); + if (!callback_reference) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [callback_reference]"); + goto end; + } + if (!cJSON_IsString(callback_reference)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [callback_reference]"); + goto end; + } + + amf_service_name = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "amfServiceName"); + if (amf_service_name) { + if (!cJSON_IsString(amf_service_name) && !cJSON_IsNull(amf_service_name)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [amf_service_name]"); + goto end; + } + } + + monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "monitoredResourceUris"); + if (!monitored_resource_uris) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + cJSON *monitored_resource_uris_local = NULL; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + + monitored_resource_urisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } + + single_nssai = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "singleNssai"); + if (single_nssai) { + single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); + } + + dnn = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "dnn"); + if (dnn) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [dnn]"); + goto end; + } + } + + subscription_id = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "subscriptionId"); + if (subscription_id) { + if (!cJSON_IsString(subscription_id) && !cJSON_IsNull(subscription_id)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [subscription_id]"); + goto end; + } + } + + plmn_id = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "plmnId"); + if (plmn_id) { + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); + } + + immediate_report = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "immediateReport"); + if (immediate_report) { + if (!cJSON_IsBool(immediate_report)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [immediate_report]"); + goto end; + } + } + + report = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "report"); + if (!report) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [report]"); + goto end; + } + cJSON *report_local = NULL; + if (!cJSON_IsArray(report)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [report]"); + goto end; + } + + reportList = OpenAPI_list_create(); + + cJSON_ArrayForEach(report_local, report) { + if (!cJSON_IsObject(report_local)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [report]"); + goto end; + } + OpenAPI_report_item_t *reportItem = OpenAPI_report_item_parseFromJSON(report_local); + if (!reportItem) { + ogs_error("No reportItem"); + OpenAPI_list_free(reportList); + goto end; + } + OpenAPI_list_add(reportList, reportItem); + } + + supported_features = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "supportedFeatures"); + if (supported_features) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { + ogs_error("OpenAPI_modify_200_response_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + context_info = cJSON_GetObjectItemCaseSensitive(modify_200_responseJSON, "contextInfo"); + if (context_info) { + context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info); + } + + modify_200_response_local_var = OpenAPI_modify_200_response_create ( + ogs_strdup(nf_instance_id->valuestring), + implicit_unsubscribe ? true : false, + implicit_unsubscribe ? implicit_unsubscribe->valueint : 0, + expires && !cJSON_IsNull(expires) ? ogs_strdup(expires->valuestring) : NULL, + ogs_strdup(callback_reference->valuestring), + amf_service_name && !cJSON_IsNull(amf_service_name) ? ogs_strdup(amf_service_name->valuestring) : NULL, + monitored_resource_urisList, + single_nssai ? single_nssai_local_nonprim : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, + subscription_id && !cJSON_IsNull(subscription_id) ? ogs_strdup(subscription_id->valuestring) : NULL, + plmn_id ? plmn_id_local_nonprim : NULL, + immediate_report ? true : false, + immediate_report ? immediate_report->valueint : 0, + reportList, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, + context_info ? context_info_local_nonprim : NULL + ); + + return modify_200_response_local_var; +end: + if (monitored_resource_urisList) { + OpenAPI_list_for_each(monitored_resource_urisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monitored_resource_urisList); + monitored_resource_urisList = NULL; + } + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (reportList) { + OpenAPI_list_for_each(reportList, node) { + OpenAPI_report_item_free(node->data); + } + OpenAPI_list_free(reportList); + reportList = NULL; + } + if (context_info_local_nonprim) { + OpenAPI_context_info_free(context_info_local_nonprim); + context_info_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_modify_200_response_t *OpenAPI_modify_200_response_copy(OpenAPI_modify_200_response_t *dst, OpenAPI_modify_200_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_modify_200_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_modify_200_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_modify_200_response_free(dst); + dst = OpenAPI_modify_200_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/modify_200_response.h b/lib/sbi/openapi/model/modify_200_response.h new file mode 100644 index 000000000..b8e46ac05 --- /dev/null +++ b/lib/sbi/openapi/model/modify_200_response.h @@ -0,0 +1,74 @@ +/* + * modify_200_response.h + * + * + */ + +#ifndef _OpenAPI_modify_200_response_H_ +#define _OpenAPI_modify_200_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "context_info.h" +#include "patch_result.h" +#include "plmn_id.h" +#include "report_item.h" +#include "sdm_subscription.h" +#include "snssai.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_modify_200_response_s OpenAPI_modify_200_response_t; +typedef struct OpenAPI_modify_200_response_s { + char *nf_instance_id; + bool is_implicit_unsubscribe; + int implicit_unsubscribe; + char *expires; + char *callback_reference; + char *amf_service_name; + OpenAPI_list_t *monitored_resource_uris; + struct OpenAPI_snssai_s *single_nssai; + char *dnn; + char *subscription_id; + struct OpenAPI_plmn_id_s *plmn_id; + bool is_immediate_report; + int immediate_report; + OpenAPI_list_t *report; + char *supported_features; + struct OpenAPI_context_info_s *context_info; +} OpenAPI_modify_200_response_t; + +OpenAPI_modify_200_response_t *OpenAPI_modify_200_response_create( + char *nf_instance_id, + bool is_implicit_unsubscribe, + int implicit_unsubscribe, + char *expires, + char *callback_reference, + char *amf_service_name, + OpenAPI_list_t *monitored_resource_uris, + OpenAPI_snssai_t *single_nssai, + char *dnn, + char *subscription_id, + OpenAPI_plmn_id_t *plmn_id, + bool is_immediate_report, + int immediate_report, + OpenAPI_list_t *report, + char *supported_features, + OpenAPI_context_info_t *context_info +); +void OpenAPI_modify_200_response_free(OpenAPI_modify_200_response_t *modify_200_response); +OpenAPI_modify_200_response_t *OpenAPI_modify_200_response_parseFromJSON(cJSON *modify_200_responseJSON); +cJSON *OpenAPI_modify_200_response_convertToJSON(OpenAPI_modify_200_response_t *modify_200_response); +OpenAPI_modify_200_response_t *OpenAPI_modify_200_response_copy(OpenAPI_modify_200_response_t *dst, OpenAPI_modify_200_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_modify_200_response_H_ */ + diff --git a/lib/sbi/openapi/model/monitoring_configuration.c b/lib/sbi/openapi/model/monitoring_configuration.c index c30cca673..d955f51bb 100644 --- a/lib/sbi/openapi/model/monitoring_configuration.c +++ b/lib/sbi/openapi/model/monitoring_configuration.c @@ -50,25 +50,54 @@ OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_create( void OpenAPI_monitoring_configuration_free(OpenAPI_monitoring_configuration_t *monitoring_configuration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == monitoring_configuration) { return; } - OpenAPI_lnode_t *node; - OpenAPI_event_type_free(monitoring_configuration->event_type); - OpenAPI_location_reporting_configuration_free(monitoring_configuration->location_reporting_configuration); - OpenAPI_association_type_free(monitoring_configuration->association_type); - OpenAPI_datalink_reporting_configuration_free(monitoring_configuration->datalink_report_cfg); - OpenAPI_loss_connectivity_cfg_free(monitoring_configuration->loss_connectivity_cfg); - OpenAPI_pdu_session_status_cfg_free(monitoring_configuration->pdu_session_status_cfg); - OpenAPI_reachability_for_sms_configuration_free(monitoring_configuration->reachability_for_sms_cfg); - ogs_free(monitoring_configuration->mtc_provider_information); - ogs_free(monitoring_configuration->af_id); + if (monitoring_configuration->event_type) { + OpenAPI_event_type_free(monitoring_configuration->event_type); + monitoring_configuration->event_type = NULL; + } + if (monitoring_configuration->location_reporting_configuration) { + OpenAPI_location_reporting_configuration_free(monitoring_configuration->location_reporting_configuration); + monitoring_configuration->location_reporting_configuration = NULL; + } + if (monitoring_configuration->association_type) { + OpenAPI_association_type_free(monitoring_configuration->association_type); + monitoring_configuration->association_type = NULL; + } + if (monitoring_configuration->datalink_report_cfg) { + OpenAPI_datalink_reporting_configuration_free(monitoring_configuration->datalink_report_cfg); + monitoring_configuration->datalink_report_cfg = NULL; + } + if (monitoring_configuration->loss_connectivity_cfg) { + OpenAPI_loss_connectivity_cfg_free(monitoring_configuration->loss_connectivity_cfg); + monitoring_configuration->loss_connectivity_cfg = NULL; + } + if (monitoring_configuration->pdu_session_status_cfg) { + OpenAPI_pdu_session_status_cfg_free(monitoring_configuration->pdu_session_status_cfg); + monitoring_configuration->pdu_session_status_cfg = NULL; + } + if (monitoring_configuration->reachability_for_sms_cfg) { + OpenAPI_reachability_for_sms_configuration_free(monitoring_configuration->reachability_for_sms_cfg); + monitoring_configuration->reachability_for_sms_cfg = NULL; + } + if (monitoring_configuration->mtc_provider_information) { + ogs_free(monitoring_configuration->mtc_provider_information); + monitoring_configuration->mtc_provider_information = NULL; + } + if (monitoring_configuration->af_id) { + ogs_free(monitoring_configuration->af_id); + monitoring_configuration->af_id = NULL; + } ogs_free(monitoring_configuration); } cJSON *OpenAPI_monitoring_configuration_convertToJSON(OpenAPI_monitoring_configuration_t *monitoring_configuration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (monitoring_configuration == NULL) { ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [MonitoringConfiguration]"); @@ -76,6 +105,10 @@ cJSON *OpenAPI_monitoring_configuration_convertToJSON(OpenAPI_monitoring_configu } item = cJSON_CreateObject(); + if (!monitoring_configuration->event_type) { + ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [event_type]"); + return NULL; + } cJSON *event_type_local_JSON = OpenAPI_event_type_convertToJSON(monitoring_configuration->event_type); if (event_type_local_JSON == NULL) { ogs_error("OpenAPI_monitoring_configuration_convertToJSON() failed [event_type]"); @@ -214,17 +247,35 @@ end: OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_parseFromJSON(cJSON *monitoring_configurationJSON) { OpenAPI_monitoring_configuration_t *monitoring_configuration_local_var = NULL; - cJSON *event_type = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "eventType"); + OpenAPI_lnode_t *node = NULL; + cJSON *event_type = NULL; + OpenAPI_event_type_t *event_type_local_nonprim = NULL; + cJSON *immediate_flag = NULL; + cJSON *location_reporting_configuration = NULL; + OpenAPI_location_reporting_configuration_t *location_reporting_configuration_local_nonprim = NULL; + cJSON *association_type = NULL; + OpenAPI_association_type_t *association_type_local_nonprim = NULL; + cJSON *datalink_report_cfg = NULL; + OpenAPI_datalink_reporting_configuration_t *datalink_report_cfg_local_nonprim = NULL; + cJSON *loss_connectivity_cfg = NULL; + OpenAPI_loss_connectivity_cfg_t *loss_connectivity_cfg_local_nonprim = NULL; + cJSON *maximum_latency = NULL; + cJSON *maximum_response_time = NULL; + cJSON *suggested_packet_num_dl = NULL; + cJSON *pdu_session_status_cfg = NULL; + OpenAPI_pdu_session_status_cfg_t *pdu_session_status_cfg_local_nonprim = NULL; + cJSON *reachability_for_sms_cfg = NULL; + OpenAPI_reachability_for_sms_configuration_t *reachability_for_sms_cfg_local_nonprim = NULL; + cJSON *mtc_provider_information = NULL; + cJSON *af_id = NULL; + event_type = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "eventType"); if (!event_type) { ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [event_type]"); goto end; } - - OpenAPI_event_type_t *event_type_local_nonprim = NULL; event_type_local_nonprim = OpenAPI_event_type_parseFromJSON(event_type); - cJSON *immediate_flag = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "immediateFlag"); - + immediate_flag = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "immediateFlag"); if (immediate_flag) { if (!cJSON_IsBool(immediate_flag)) { ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [immediate_flag]"); @@ -232,36 +283,27 @@ OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_parseFromJS } } - cJSON *location_reporting_configuration = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "locationReportingConfiguration"); - - OpenAPI_location_reporting_configuration_t *location_reporting_configuration_local_nonprim = NULL; + location_reporting_configuration = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "locationReportingConfiguration"); if (location_reporting_configuration) { location_reporting_configuration_local_nonprim = OpenAPI_location_reporting_configuration_parseFromJSON(location_reporting_configuration); } - cJSON *association_type = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "associationType"); - - OpenAPI_association_type_t *association_type_local_nonprim = NULL; + association_type = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "associationType"); if (association_type) { association_type_local_nonprim = OpenAPI_association_type_parseFromJSON(association_type); } - cJSON *datalink_report_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "datalinkReportCfg"); - - OpenAPI_datalink_reporting_configuration_t *datalink_report_cfg_local_nonprim = NULL; + datalink_report_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "datalinkReportCfg"); if (datalink_report_cfg) { datalink_report_cfg_local_nonprim = OpenAPI_datalink_reporting_configuration_parseFromJSON(datalink_report_cfg); } - cJSON *loss_connectivity_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "lossConnectivityCfg"); - - OpenAPI_loss_connectivity_cfg_t *loss_connectivity_cfg_local_nonprim = NULL; + loss_connectivity_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "lossConnectivityCfg"); if (loss_connectivity_cfg) { loss_connectivity_cfg_local_nonprim = OpenAPI_loss_connectivity_cfg_parseFromJSON(loss_connectivity_cfg); } - cJSON *maximum_latency = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "maximumLatency"); - + maximum_latency = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "maximumLatency"); if (maximum_latency) { if (!cJSON_IsNumber(maximum_latency)) { ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [maximum_latency]"); @@ -269,8 +311,7 @@ OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_parseFromJS } } - cJSON *maximum_response_time = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "maximumResponseTime"); - + maximum_response_time = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "maximumResponseTime"); if (maximum_response_time) { if (!cJSON_IsNumber(maximum_response_time)) { ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [maximum_response_time]"); @@ -278,8 +319,7 @@ OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_parseFromJS } } - cJSON *suggested_packet_num_dl = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "suggestedPacketNumDl"); - + suggested_packet_num_dl = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "suggestedPacketNumDl"); if (suggested_packet_num_dl) { if (!cJSON_IsNumber(suggested_packet_num_dl)) { ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [suggested_packet_num_dl]"); @@ -287,33 +327,27 @@ OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_parseFromJS } } - cJSON *pdu_session_status_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "pduSessionStatusCfg"); - - OpenAPI_pdu_session_status_cfg_t *pdu_session_status_cfg_local_nonprim = NULL; + pdu_session_status_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "pduSessionStatusCfg"); if (pdu_session_status_cfg) { pdu_session_status_cfg_local_nonprim = OpenAPI_pdu_session_status_cfg_parseFromJSON(pdu_session_status_cfg); } - cJSON *reachability_for_sms_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "reachabilityForSmsCfg"); - - OpenAPI_reachability_for_sms_configuration_t *reachability_for_sms_cfg_local_nonprim = NULL; + reachability_for_sms_cfg = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "reachabilityForSmsCfg"); if (reachability_for_sms_cfg) { reachability_for_sms_cfg_local_nonprim = OpenAPI_reachability_for_sms_configuration_parseFromJSON(reachability_for_sms_cfg); } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [mtc_provider_information]"); goto end; } } - cJSON *af_id = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "afId"); - + af_id = cJSON_GetObjectItemCaseSensitive(monitoring_configurationJSON, "afId"); if (af_id) { - if (!cJSON_IsString(af_id)) { + if (!cJSON_IsString(af_id) && !cJSON_IsNull(af_id)) { ogs_error("OpenAPI_monitoring_configuration_parseFromJSON() failed [af_id]"); goto end; } @@ -335,12 +369,40 @@ OpenAPI_monitoring_configuration_t *OpenAPI_monitoring_configuration_parseFromJS suggested_packet_num_dl ? suggested_packet_num_dl->valuedouble : 0, pdu_session_status_cfg ? pdu_session_status_cfg_local_nonprim : NULL, reachability_for_sms_cfg ? reachability_for_sms_cfg_local_nonprim : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL, - af_id ? ogs_strdup(af_id->valuestring) : NULL + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL, + af_id && !cJSON_IsNull(af_id) ? ogs_strdup(af_id->valuestring) : NULL ); return monitoring_configuration_local_var; end: + if (event_type_local_nonprim) { + OpenAPI_event_type_free(event_type_local_nonprim); + event_type_local_nonprim = NULL; + } + if (location_reporting_configuration_local_nonprim) { + OpenAPI_location_reporting_configuration_free(location_reporting_configuration_local_nonprim); + location_reporting_configuration_local_nonprim = NULL; + } + if (association_type_local_nonprim) { + OpenAPI_association_type_free(association_type_local_nonprim); + association_type_local_nonprim = NULL; + } + if (datalink_report_cfg_local_nonprim) { + OpenAPI_datalink_reporting_configuration_free(datalink_report_cfg_local_nonprim); + datalink_report_cfg_local_nonprim = NULL; + } + if (loss_connectivity_cfg_local_nonprim) { + OpenAPI_loss_connectivity_cfg_free(loss_connectivity_cfg_local_nonprim); + loss_connectivity_cfg_local_nonprim = NULL; + } + if (pdu_session_status_cfg_local_nonprim) { + OpenAPI_pdu_session_status_cfg_free(pdu_session_status_cfg_local_nonprim); + pdu_session_status_cfg_local_nonprim = NULL; + } + if (reachability_for_sms_cfg_local_nonprim) { + OpenAPI_reachability_for_sms_configuration_free(reachability_for_sms_cfg_local_nonprim); + reachability_for_sms_cfg_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/mtc_provider.c b/lib/sbi/openapi/model/mtc_provider.c index 356a931a7..12fd6a5c0 100644 --- a/lib/sbi/openapi/model/mtc_provider.c +++ b/lib/sbi/openapi/model/mtc_provider.c @@ -20,18 +20,26 @@ OpenAPI_mtc_provider_t *OpenAPI_mtc_provider_create( void OpenAPI_mtc_provider_free(OpenAPI_mtc_provider_t *mtc_provider) { + OpenAPI_lnode_t *node = NULL; + if (NULL == mtc_provider) { return; } - OpenAPI_lnode_t *node; - ogs_free(mtc_provider->mtc_provider_information); - ogs_free(mtc_provider->af_id); + if (mtc_provider->mtc_provider_information) { + ogs_free(mtc_provider->mtc_provider_information); + mtc_provider->mtc_provider_information = NULL; + } + if (mtc_provider->af_id) { + ogs_free(mtc_provider->af_id); + mtc_provider->af_id = NULL; + } ogs_free(mtc_provider); } cJSON *OpenAPI_mtc_provider_convertToJSON(OpenAPI_mtc_provider_t *mtc_provider) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (mtc_provider == NULL) { ogs_error("OpenAPI_mtc_provider_convertToJSON() failed [MtcProvider]"); @@ -60,27 +68,28 @@ end: OpenAPI_mtc_provider_t *OpenAPI_mtc_provider_parseFromJSON(cJSON *mtc_providerJSON) { OpenAPI_mtc_provider_t *mtc_provider_local_var = NULL; - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(mtc_providerJSON, "mtcProviderInformation"); - + OpenAPI_lnode_t *node = NULL; + cJSON *mtc_provider_information = NULL; + cJSON *af_id = NULL; + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(mtc_providerJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_mtc_provider_parseFromJSON() failed [mtc_provider_information]"); goto end; } } - cJSON *af_id = cJSON_GetObjectItemCaseSensitive(mtc_providerJSON, "afId"); - + af_id = cJSON_GetObjectItemCaseSensitive(mtc_providerJSON, "afId"); if (af_id) { - if (!cJSON_IsString(af_id)) { + if (!cJSON_IsString(af_id) && !cJSON_IsNull(af_id)) { ogs_error("OpenAPI_mtc_provider_parseFromJSON() failed [af_id]"); goto end; } } mtc_provider_local_var = OpenAPI_mtc_provider_create ( - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL, - af_id ? ogs_strdup(af_id->valuestring) : NULL + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL, + af_id && !cJSON_IsNull(af_id) ? ogs_strdup(af_id->valuestring) : NULL ); return mtc_provider_local_var; diff --git a/lib/sbi/openapi/model/multicast_access_control.c b/lib/sbi/openapi/model/multicast_access_control.c index 3ac68ce41..e48676bc0 100644 --- a/lib/sbi/openapi/model/multicast_access_control.c +++ b/lib/sbi/openapi/model/multicast_access_control.c @@ -5,42 +5,29 @@ #include "multicast_access_control.h" OpenAPI_multicast_access_control_t *OpenAPI_multicast_access_control_create( - char *src_ipv4_addr, - char *src_ipv6_addr, - char *multicast_v4_addr, - char *multicast_v6_addr, - OpenAPI_access_right_status_t *acc_status ) { OpenAPI_multicast_access_control_t *multicast_access_control_local_var = ogs_malloc(sizeof(OpenAPI_multicast_access_control_t)); ogs_assert(multicast_access_control_local_var); - multicast_access_control_local_var->src_ipv4_addr = src_ipv4_addr; - multicast_access_control_local_var->src_ipv6_addr = src_ipv6_addr; - multicast_access_control_local_var->multicast_v4_addr = multicast_v4_addr; - multicast_access_control_local_var->multicast_v6_addr = multicast_v6_addr; - multicast_access_control_local_var->acc_status = acc_status; return multicast_access_control_local_var; } void OpenAPI_multicast_access_control_free(OpenAPI_multicast_access_control_t *multicast_access_control) { + OpenAPI_lnode_t *node = NULL; + if (NULL == multicast_access_control) { return; } - OpenAPI_lnode_t *node; - ogs_free(multicast_access_control->src_ipv4_addr); - ogs_free(multicast_access_control->src_ipv6_addr); - ogs_free(multicast_access_control->multicast_v4_addr); - ogs_free(multicast_access_control->multicast_v6_addr); - OpenAPI_access_right_status_free(multicast_access_control->acc_status); ogs_free(multicast_access_control); } cJSON *OpenAPI_multicast_access_control_convertToJSON(OpenAPI_multicast_access_control_t *multicast_access_control) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (multicast_access_control == NULL) { ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [MulticastAccessControl]"); @@ -48,45 +35,6 @@ cJSON *OpenAPI_multicast_access_control_convertToJSON(OpenAPI_multicast_access_c } item = cJSON_CreateObject(); - if (multicast_access_control->src_ipv4_addr) { - if (cJSON_AddStringToObject(item, "srcIpv4Addr", multicast_access_control->src_ipv4_addr) == NULL) { - ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [src_ipv4_addr]"); - goto end; - } - } - - if (multicast_access_control->src_ipv6_addr) { - if (cJSON_AddStringToObject(item, "srcIpv6Addr", multicast_access_control->src_ipv6_addr) == NULL) { - ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [src_ipv6_addr]"); - goto end; - } - } - - if (multicast_access_control->multicast_v4_addr) { - if (cJSON_AddStringToObject(item, "multicastV4Addr", multicast_access_control->multicast_v4_addr) == NULL) { - ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [multicast_v4_addr]"); - goto end; - } - } - - if (multicast_access_control->multicast_v6_addr) { - if (cJSON_AddStringToObject(item, "multicastV6Addr", multicast_access_control->multicast_v6_addr) == NULL) { - ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [multicast_v6_addr]"); - goto end; - } - } - - cJSON *acc_status_local_JSON = OpenAPI_access_right_status_convertToJSON(multicast_access_control->acc_status); - if (acc_status_local_JSON == NULL) { - ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [acc_status]"); - goto end; - } - cJSON_AddItemToObject(item, "accStatus", acc_status_local_JSON); - if (item->child == NULL) { - ogs_error("OpenAPI_multicast_access_control_convertToJSON() failed [acc_status]"); - goto end; - } - end: return item; } @@ -94,57 +42,8 @@ end: OpenAPI_multicast_access_control_t *OpenAPI_multicast_access_control_parseFromJSON(cJSON *multicast_access_controlJSON) { OpenAPI_multicast_access_control_t *multicast_access_control_local_var = NULL; - cJSON *src_ipv4_addr = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "srcIpv4Addr"); - - if (src_ipv4_addr) { - if (!cJSON_IsString(src_ipv4_addr)) { - ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [src_ipv4_addr]"); - goto end; - } - } - - cJSON *src_ipv6_addr = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "srcIpv6Addr"); - - if (src_ipv6_addr) { - if (!cJSON_IsString(src_ipv6_addr)) { - ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [src_ipv6_addr]"); - goto end; - } - } - - cJSON *multicast_v4_addr = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "multicastV4Addr"); - - if (multicast_v4_addr) { - if (!cJSON_IsString(multicast_v4_addr)) { - ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [multicast_v4_addr]"); - goto end; - } - } - - cJSON *multicast_v6_addr = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "multicastV6Addr"); - - if (multicast_v6_addr) { - if (!cJSON_IsString(multicast_v6_addr)) { - ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [multicast_v6_addr]"); - goto end; - } - } - - cJSON *acc_status = cJSON_GetObjectItemCaseSensitive(multicast_access_controlJSON, "accStatus"); - if (!acc_status) { - ogs_error("OpenAPI_multicast_access_control_parseFromJSON() failed [acc_status]"); - goto end; - } - - OpenAPI_access_right_status_t *acc_status_local_nonprim = NULL; - acc_status_local_nonprim = OpenAPI_access_right_status_parseFromJSON(acc_status); - + OpenAPI_lnode_t *node = NULL; multicast_access_control_local_var = OpenAPI_multicast_access_control_create ( - src_ipv4_addr ? ogs_strdup(src_ipv4_addr->valuestring) : NULL, - src_ipv6_addr ? ogs_strdup(src_ipv6_addr->valuestring) : NULL, - multicast_v4_addr ? ogs_strdup(multicast_v4_addr->valuestring) : NULL, - multicast_v6_addr ? ogs_strdup(multicast_v6_addr->valuestring) : NULL, - acc_status_local_nonprim ); return multicast_access_control_local_var; diff --git a/lib/sbi/openapi/model/multicast_access_control.h b/lib/sbi/openapi/model/multicast_access_control.h index d11bdc757..0e62905e5 100644 --- a/lib/sbi/openapi/model/multicast_access_control.h +++ b/lib/sbi/openapi/model/multicast_access_control.h @@ -12,7 +12,7 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "access_right_status.h" +#include "multicast_access_control_any_of.h" #ifdef __cplusplus extern "C" { @@ -20,19 +20,9 @@ extern "C" { typedef struct OpenAPI_multicast_access_control_s OpenAPI_multicast_access_control_t; typedef struct OpenAPI_multicast_access_control_s { - char *src_ipv4_addr; - char *src_ipv6_addr; - char *multicast_v4_addr; - char *multicast_v6_addr; - struct OpenAPI_access_right_status_s *acc_status; } OpenAPI_multicast_access_control_t; OpenAPI_multicast_access_control_t *OpenAPI_multicast_access_control_create( - char *src_ipv4_addr, - char *src_ipv6_addr, - char *multicast_v4_addr, - char *multicast_v6_addr, - OpenAPI_access_right_status_t *acc_status ); void OpenAPI_multicast_access_control_free(OpenAPI_multicast_access_control_t *multicast_access_control); OpenAPI_multicast_access_control_t *OpenAPI_multicast_access_control_parseFromJSON(cJSON *multicast_access_controlJSON); diff --git a/lib/sbi/openapi/model/n1_message_container.c b/lib/sbi/openapi/model/n1_message_container.c index 6d62e67e7..22e98f467 100644 --- a/lib/sbi/openapi/model/n1_message_container.c +++ b/lib/sbi/openapi/model/n1_message_container.c @@ -24,19 +24,30 @@ OpenAPI_n1_message_container_t *OpenAPI_n1_message_container_create( void OpenAPI_n1_message_container_free(OpenAPI_n1_message_container_t *n1_message_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n1_message_container) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ref_to_binary_data_free(n1_message_container->n1_message_content); - ogs_free(n1_message_container->nf_id); - ogs_free(n1_message_container->service_instance_id); + if (n1_message_container->n1_message_content) { + OpenAPI_ref_to_binary_data_free(n1_message_container->n1_message_content); + n1_message_container->n1_message_content = NULL; + } + if (n1_message_container->nf_id) { + ogs_free(n1_message_container->nf_id); + n1_message_container->nf_id = NULL; + } + if (n1_message_container->service_instance_id) { + ogs_free(n1_message_container->service_instance_id); + n1_message_container->service_instance_id = NULL; + } ogs_free(n1_message_container); } cJSON *OpenAPI_n1_message_container_convertToJSON(OpenAPI_n1_message_container_t *n1_message_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n1_message_container == NULL) { ogs_error("OpenAPI_n1_message_container_convertToJSON() failed [N1MessageContainer]"); @@ -44,11 +55,19 @@ cJSON *OpenAPI_n1_message_container_convertToJSON(OpenAPI_n1_message_container_t } item = cJSON_CreateObject(); + if (n1_message_container->n1_message_class == OpenAPI_n1_message_class_NULL) { + ogs_error("OpenAPI_n1_message_container_convertToJSON() failed [n1_message_class]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n1MessageClass", OpenAPI_n1_message_class_ToString(n1_message_container->n1_message_class)) == NULL) { ogs_error("OpenAPI_n1_message_container_convertToJSON() failed [n1_message_class]"); goto end; } + if (!n1_message_container->n1_message_content) { + ogs_error("OpenAPI_n1_message_container_convertToJSON() failed [n1_message_content]"); + return NULL; + } cJSON *n1_message_content_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(n1_message_container->n1_message_content); if (n1_message_content_local_JSON == NULL) { ogs_error("OpenAPI_n1_message_container_convertToJSON() failed [n1_message_content]"); @@ -81,41 +100,42 @@ end: OpenAPI_n1_message_container_t *OpenAPI_n1_message_container_parseFromJSON(cJSON *n1_message_containerJSON) { OpenAPI_n1_message_container_t *n1_message_container_local_var = NULL; - cJSON *n1_message_class = cJSON_GetObjectItemCaseSensitive(n1_message_containerJSON, "n1MessageClass"); + OpenAPI_lnode_t *node = NULL; + cJSON *n1_message_class = NULL; + OpenAPI_n1_message_class_e n1_message_classVariable = 0; + cJSON *n1_message_content = NULL; + OpenAPI_ref_to_binary_data_t *n1_message_content_local_nonprim = NULL; + cJSON *nf_id = NULL; + cJSON *service_instance_id = NULL; + n1_message_class = cJSON_GetObjectItemCaseSensitive(n1_message_containerJSON, "n1MessageClass"); if (!n1_message_class) { ogs_error("OpenAPI_n1_message_container_parseFromJSON() failed [n1_message_class]"); goto end; } - - OpenAPI_n1_message_class_e n1_message_classVariable; if (!cJSON_IsString(n1_message_class)) { ogs_error("OpenAPI_n1_message_container_parseFromJSON() failed [n1_message_class]"); goto end; } n1_message_classVariable = OpenAPI_n1_message_class_FromString(n1_message_class->valuestring); - cJSON *n1_message_content = cJSON_GetObjectItemCaseSensitive(n1_message_containerJSON, "n1MessageContent"); + n1_message_content = cJSON_GetObjectItemCaseSensitive(n1_message_containerJSON, "n1MessageContent"); if (!n1_message_content) { ogs_error("OpenAPI_n1_message_container_parseFromJSON() failed [n1_message_content]"); goto end; } - - OpenAPI_ref_to_binary_data_t *n1_message_content_local_nonprim = NULL; n1_message_content_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_message_content); - cJSON *nf_id = cJSON_GetObjectItemCaseSensitive(n1_message_containerJSON, "nfId"); - + nf_id = cJSON_GetObjectItemCaseSensitive(n1_message_containerJSON, "nfId"); if (nf_id) { - if (!cJSON_IsString(nf_id)) { + if (!cJSON_IsString(nf_id) && !cJSON_IsNull(nf_id)) { ogs_error("OpenAPI_n1_message_container_parseFromJSON() failed [nf_id]"); goto end; } } - cJSON *service_instance_id = cJSON_GetObjectItemCaseSensitive(n1_message_containerJSON, "serviceInstanceId"); - + service_instance_id = cJSON_GetObjectItemCaseSensitive(n1_message_containerJSON, "serviceInstanceId"); if (service_instance_id) { - if (!cJSON_IsString(service_instance_id)) { + if (!cJSON_IsString(service_instance_id) && !cJSON_IsNull(service_instance_id)) { ogs_error("OpenAPI_n1_message_container_parseFromJSON() failed [service_instance_id]"); goto end; } @@ -124,12 +144,16 @@ OpenAPI_n1_message_container_t *OpenAPI_n1_message_container_parseFromJSON(cJSON n1_message_container_local_var = OpenAPI_n1_message_container_create ( n1_message_classVariable, n1_message_content_local_nonprim, - nf_id ? ogs_strdup(nf_id->valuestring) : NULL, - service_instance_id ? ogs_strdup(service_instance_id->valuestring) : NULL + nf_id && !cJSON_IsNull(nf_id) ? ogs_strdup(nf_id->valuestring) : NULL, + service_instance_id && !cJSON_IsNull(service_instance_id) ? ogs_strdup(service_instance_id->valuestring) : NULL ); return n1_message_container_local_var; end: + if (n1_message_content_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_message_content_local_nonprim); + n1_message_content_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n1_message_notification.c b/lib/sbi/openapi/model/n1_message_notification.c index be8700449..45b4765dd 100644 --- a/lib/sbi/openapi/model/n1_message_notification.c +++ b/lib/sbi/openapi/model/n1_message_notification.c @@ -36,24 +36,50 @@ OpenAPI_n1_message_notification_t *OpenAPI_n1_message_notification_create( void OpenAPI_n1_message_notification_free(OpenAPI_n1_message_notification_t *n1_message_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n1_message_notification) { return; } - OpenAPI_lnode_t *node; - ogs_free(n1_message_notification->n1_notify_subscription_id); - OpenAPI_n1_message_container_free(n1_message_notification->n1_message_container); - ogs_free(n1_message_notification->lcs_correlation_id); - OpenAPI_registration_context_container_free(n1_message_notification->registration_ctxt_container); - ogs_free(n1_message_notification->new_lmf_identification); - OpenAPI_guami_free(n1_message_notification->guami); - OpenAPI_ecgi_free(n1_message_notification->ecgi); - OpenAPI_ncgi_free(n1_message_notification->ncgi); + if (n1_message_notification->n1_notify_subscription_id) { + ogs_free(n1_message_notification->n1_notify_subscription_id); + n1_message_notification->n1_notify_subscription_id = NULL; + } + if (n1_message_notification->n1_message_container) { + OpenAPI_n1_message_container_free(n1_message_notification->n1_message_container); + n1_message_notification->n1_message_container = NULL; + } + if (n1_message_notification->lcs_correlation_id) { + ogs_free(n1_message_notification->lcs_correlation_id); + n1_message_notification->lcs_correlation_id = NULL; + } + if (n1_message_notification->registration_ctxt_container) { + OpenAPI_registration_context_container_free(n1_message_notification->registration_ctxt_container); + n1_message_notification->registration_ctxt_container = NULL; + } + if (n1_message_notification->new_lmf_identification) { + ogs_free(n1_message_notification->new_lmf_identification); + n1_message_notification->new_lmf_identification = NULL; + } + if (n1_message_notification->guami) { + OpenAPI_guami_free(n1_message_notification->guami); + n1_message_notification->guami = NULL; + } + if (n1_message_notification->ecgi) { + OpenAPI_ecgi_free(n1_message_notification->ecgi); + n1_message_notification->ecgi = NULL; + } + if (n1_message_notification->ncgi) { + OpenAPI_ncgi_free(n1_message_notification->ncgi); + n1_message_notification->ncgi = NULL; + } ogs_free(n1_message_notification); } cJSON *OpenAPI_n1_message_notification_convertToJSON(OpenAPI_n1_message_notification_t *n1_message_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n1_message_notification == NULL) { ogs_error("OpenAPI_n1_message_notification_convertToJSON() failed [N1MessageNotification]"); @@ -68,6 +94,10 @@ cJSON *OpenAPI_n1_message_notification_convertToJSON(OpenAPI_n1_message_notifica } } + if (!n1_message_notification->n1_message_container) { + ogs_error("OpenAPI_n1_message_notification_convertToJSON() failed [n1_message_container]"); + return NULL; + } cJSON *n1_message_container_local_JSON = OpenAPI_n1_message_container_convertToJSON(n1_message_notification->n1_message_container); if (n1_message_container_local_JSON == NULL) { ogs_error("OpenAPI_n1_message_notification_convertToJSON() failed [n1_message_container]"); @@ -159,58 +189,63 @@ end: OpenAPI_n1_message_notification_t *OpenAPI_n1_message_notification_parseFromJSON(cJSON *n1_message_notificationJSON) { OpenAPI_n1_message_notification_t *n1_message_notification_local_var = NULL; - cJSON *n1_notify_subscription_id = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "n1NotifySubscriptionId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *n1_notify_subscription_id = NULL; + cJSON *n1_message_container = NULL; + OpenAPI_n1_message_container_t *n1_message_container_local_nonprim = NULL; + cJSON *lcs_correlation_id = NULL; + cJSON *registration_ctxt_container = NULL; + OpenAPI_registration_context_container_t *registration_ctxt_container_local_nonprim = NULL; + cJSON *new_lmf_identification = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *c_io_t5_gs_optimisation = NULL; + cJSON *ecgi = NULL; + OpenAPI_ecgi_t *ecgi_local_nonprim = NULL; + cJSON *ncgi = NULL; + OpenAPI_ncgi_t *ncgi_local_nonprim = NULL; + n1_notify_subscription_id = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "n1NotifySubscriptionId"); if (n1_notify_subscription_id) { - if (!cJSON_IsString(n1_notify_subscription_id)) { + if (!cJSON_IsString(n1_notify_subscription_id) && !cJSON_IsNull(n1_notify_subscription_id)) { ogs_error("OpenAPI_n1_message_notification_parseFromJSON() failed [n1_notify_subscription_id]"); goto end; } } - cJSON *n1_message_container = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "n1MessageContainer"); + n1_message_container = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "n1MessageContainer"); if (!n1_message_container) { ogs_error("OpenAPI_n1_message_notification_parseFromJSON() failed [n1_message_container]"); goto end; } - - OpenAPI_n1_message_container_t *n1_message_container_local_nonprim = NULL; n1_message_container_local_nonprim = OpenAPI_n1_message_container_parseFromJSON(n1_message_container); - cJSON *lcs_correlation_id = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "lcsCorrelationId"); - + lcs_correlation_id = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "lcsCorrelationId"); if (lcs_correlation_id) { - if (!cJSON_IsString(lcs_correlation_id)) { + if (!cJSON_IsString(lcs_correlation_id) && !cJSON_IsNull(lcs_correlation_id)) { ogs_error("OpenAPI_n1_message_notification_parseFromJSON() failed [lcs_correlation_id]"); goto end; } } - cJSON *registration_ctxt_container = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "registrationCtxtContainer"); - - OpenAPI_registration_context_container_t *registration_ctxt_container_local_nonprim = NULL; + registration_ctxt_container = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "registrationCtxtContainer"); if (registration_ctxt_container) { registration_ctxt_container_local_nonprim = OpenAPI_registration_context_container_parseFromJSON(registration_ctxt_container); } - cJSON *new_lmf_identification = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "newLmfIdentification"); - + new_lmf_identification = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "newLmfIdentification"); if (new_lmf_identification) { - if (!cJSON_IsString(new_lmf_identification)) { + if (!cJSON_IsString(new_lmf_identification) && !cJSON_IsNull(new_lmf_identification)) { ogs_error("OpenAPI_n1_message_notification_parseFromJSON() failed [new_lmf_identification]"); goto end; } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } - cJSON *c_io_t5_gs_optimisation = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "cIoT5GSOptimisation"); - + c_io_t5_gs_optimisation = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "cIoT5GSOptimisation"); if (c_io_t5_gs_optimisation) { if (!cJSON_IsBool(c_io_t5_gs_optimisation)) { ogs_error("OpenAPI_n1_message_notification_parseFromJSON() failed [c_io_t5_gs_optimisation]"); @@ -218,26 +253,22 @@ OpenAPI_n1_message_notification_t *OpenAPI_n1_message_notification_parseFromJSON } } - cJSON *ecgi = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "ecgi"); - - OpenAPI_ecgi_t *ecgi_local_nonprim = NULL; + ecgi = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "ecgi"); if (ecgi) { ecgi_local_nonprim = OpenAPI_ecgi_parseFromJSON(ecgi); } - cJSON *ncgi = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "ncgi"); - - OpenAPI_ncgi_t *ncgi_local_nonprim = NULL; + ncgi = cJSON_GetObjectItemCaseSensitive(n1_message_notificationJSON, "ncgi"); if (ncgi) { ncgi_local_nonprim = OpenAPI_ncgi_parseFromJSON(ncgi); } n1_message_notification_local_var = OpenAPI_n1_message_notification_create ( - n1_notify_subscription_id ? ogs_strdup(n1_notify_subscription_id->valuestring) : NULL, + n1_notify_subscription_id && !cJSON_IsNull(n1_notify_subscription_id) ? ogs_strdup(n1_notify_subscription_id->valuestring) : NULL, n1_message_container_local_nonprim, - lcs_correlation_id ? ogs_strdup(lcs_correlation_id->valuestring) : NULL, + lcs_correlation_id && !cJSON_IsNull(lcs_correlation_id) ? ogs_strdup(lcs_correlation_id->valuestring) : NULL, registration_ctxt_container ? registration_ctxt_container_local_nonprim : NULL, - new_lmf_identification ? ogs_strdup(new_lmf_identification->valuestring) : NULL, + new_lmf_identification && !cJSON_IsNull(new_lmf_identification) ? ogs_strdup(new_lmf_identification->valuestring) : NULL, guami ? guami_local_nonprim : NULL, c_io_t5_gs_optimisation ? true : false, c_io_t5_gs_optimisation ? c_io_t5_gs_optimisation->valueint : 0, @@ -247,6 +278,26 @@ OpenAPI_n1_message_notification_t *OpenAPI_n1_message_notification_parseFromJSON return n1_message_notification_local_var; end: + if (n1_message_container_local_nonprim) { + OpenAPI_n1_message_container_free(n1_message_container_local_nonprim); + n1_message_container_local_nonprim = NULL; + } + if (registration_ctxt_container_local_nonprim) { + OpenAPI_registration_context_container_free(registration_ctxt_container_local_nonprim); + registration_ctxt_container_local_nonprim = NULL; + } + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (ecgi_local_nonprim) { + OpenAPI_ecgi_free(ecgi_local_nonprim); + ecgi_local_nonprim = NULL; + } + if (ncgi_local_nonprim) { + OpenAPI_ncgi_free(ncgi_local_nonprim); + ncgi_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n1_n2_message_transfer_error.c b/lib/sbi/openapi/model/n1_n2_message_transfer_error.c index 27f0af496..7831fdc80 100644 --- a/lib/sbi/openapi/model/n1_n2_message_transfer_error.c +++ b/lib/sbi/openapi/model/n1_n2_message_transfer_error.c @@ -20,18 +20,26 @@ OpenAPI_n1_n2_message_transfer_error_t *OpenAPI_n1_n2_message_transfer_error_cre void OpenAPI_n1_n2_message_transfer_error_free(OpenAPI_n1_n2_message_transfer_error_t *n1_n2_message_transfer_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n1_n2_message_transfer_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_problem_details_free(n1_n2_message_transfer_error->error); - OpenAPI_n1_n2_msg_txfr_err_detail_free(n1_n2_message_transfer_error->err_info); + if (n1_n2_message_transfer_error->error) { + OpenAPI_problem_details_free(n1_n2_message_transfer_error->error); + n1_n2_message_transfer_error->error = NULL; + } + if (n1_n2_message_transfer_error->err_info) { + OpenAPI_n1_n2_msg_txfr_err_detail_free(n1_n2_message_transfer_error->err_info); + n1_n2_message_transfer_error->err_info = NULL; + } ogs_free(n1_n2_message_transfer_error); } cJSON *OpenAPI_n1_n2_message_transfer_error_convertToJSON(OpenAPI_n1_n2_message_transfer_error_t *n1_n2_message_transfer_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n1_n2_message_transfer_error == NULL) { ogs_error("OpenAPI_n1_n2_message_transfer_error_convertToJSON() failed [N1N2MessageTransferError]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_n1_n2_message_transfer_error_convertToJSON(OpenAPI_n1_n2_message_ } item = cJSON_CreateObject(); + if (!n1_n2_message_transfer_error->error) { + ogs_error("OpenAPI_n1_n2_message_transfer_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(n1_n2_message_transfer_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_n1_n2_message_transfer_error_convertToJSON() failed [error]"); @@ -70,18 +82,19 @@ end: OpenAPI_n1_n2_message_transfer_error_t *OpenAPI_n1_n2_message_transfer_error_parseFromJSON(cJSON *n1_n2_message_transfer_errorJSON) { OpenAPI_n1_n2_message_transfer_error_t *n1_n2_message_transfer_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_problem_details_t *error_local_nonprim = NULL; + cJSON *err_info = NULL; + OpenAPI_n1_n2_msg_txfr_err_detail_t *err_info_local_nonprim = NULL; + error = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_n1_n2_message_transfer_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error); - cJSON *err_info = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_errorJSON, "errInfo"); - - OpenAPI_n1_n2_msg_txfr_err_detail_t *err_info_local_nonprim = NULL; + err_info = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_errorJSON, "errInfo"); if (err_info) { err_info_local_nonprim = OpenAPI_n1_n2_msg_txfr_err_detail_parseFromJSON(err_info); } @@ -93,6 +106,14 @@ OpenAPI_n1_n2_message_transfer_error_t *OpenAPI_n1_n2_message_transfer_error_par return n1_n2_message_transfer_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (err_info_local_nonprim) { + OpenAPI_n1_n2_msg_txfr_err_detail_free(err_info_local_nonprim); + err_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n1_n2_message_transfer_req_data.c b/lib/sbi/openapi/model/n1_n2_message_transfer_req_data.c index 6a33bf965..b94b59acf 100644 --- a/lib/sbi/openapi/model/n1_n2_message_transfer_req_data.c +++ b/lib/sbi/openapi/model/n1_n2_message_transfer_req_data.c @@ -68,25 +68,54 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da void OpenAPI_n1_n2_message_transfer_req_data_free(OpenAPI_n1_n2_message_transfer_req_data_t *n1_n2_message_transfer_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n1_n2_message_transfer_req_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_n1_message_container_free(n1_n2_message_transfer_req_data->n1_message_container); - OpenAPI_n2_info_container_free(n1_n2_message_transfer_req_data->n2_info_container); - OpenAPI_ref_to_binary_data_free(n1_n2_message_transfer_req_data->mt_data); - ogs_free(n1_n2_message_transfer_req_data->lcs_correlation_id); - OpenAPI_arp_free(n1_n2_message_transfer_req_data->arp); - ogs_free(n1_n2_message_transfer_req_data->n1n2_failure_txf_notif_uri); - OpenAPI_area_of_validity_free(n1_n2_message_transfer_req_data->area_of_validity); - ogs_free(n1_n2_message_transfer_req_data->supported_features); - OpenAPI_guami_free(n1_n2_message_transfer_req_data->old_guami); + if (n1_n2_message_transfer_req_data->n1_message_container) { + OpenAPI_n1_message_container_free(n1_n2_message_transfer_req_data->n1_message_container); + n1_n2_message_transfer_req_data->n1_message_container = NULL; + } + if (n1_n2_message_transfer_req_data->n2_info_container) { + OpenAPI_n2_info_container_free(n1_n2_message_transfer_req_data->n2_info_container); + n1_n2_message_transfer_req_data->n2_info_container = NULL; + } + if (n1_n2_message_transfer_req_data->mt_data) { + OpenAPI_ref_to_binary_data_free(n1_n2_message_transfer_req_data->mt_data); + n1_n2_message_transfer_req_data->mt_data = NULL; + } + if (n1_n2_message_transfer_req_data->lcs_correlation_id) { + ogs_free(n1_n2_message_transfer_req_data->lcs_correlation_id); + n1_n2_message_transfer_req_data->lcs_correlation_id = NULL; + } + if (n1_n2_message_transfer_req_data->arp) { + OpenAPI_arp_free(n1_n2_message_transfer_req_data->arp); + n1_n2_message_transfer_req_data->arp = NULL; + } + if (n1_n2_message_transfer_req_data->n1n2_failure_txf_notif_uri) { + ogs_free(n1_n2_message_transfer_req_data->n1n2_failure_txf_notif_uri); + n1_n2_message_transfer_req_data->n1n2_failure_txf_notif_uri = NULL; + } + if (n1_n2_message_transfer_req_data->area_of_validity) { + OpenAPI_area_of_validity_free(n1_n2_message_transfer_req_data->area_of_validity); + n1_n2_message_transfer_req_data->area_of_validity = NULL; + } + if (n1_n2_message_transfer_req_data->supported_features) { + ogs_free(n1_n2_message_transfer_req_data->supported_features); + n1_n2_message_transfer_req_data->supported_features = NULL; + } + if (n1_n2_message_transfer_req_data->old_guami) { + OpenAPI_guami_free(n1_n2_message_transfer_req_data->old_guami); + n1_n2_message_transfer_req_data->old_guami = NULL; + } ogs_free(n1_n2_message_transfer_req_data); } cJSON *OpenAPI_n1_n2_message_transfer_req_data_convertToJSON(OpenAPI_n1_n2_message_transfer_req_data_t *n1_n2_message_transfer_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n1_n2_message_transfer_req_data == NULL) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_convertToJSON() failed [N1N2MessageTransferReqData]"); @@ -249,7 +278,7 @@ cJSON *OpenAPI_n1_n2_message_transfer_req_data_convertToJSON(OpenAPI_n1_n2_messa } } - if (n1_n2_message_transfer_req_data->target_access) { + if (n1_n2_message_transfer_req_data->target_access != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "targetAccess", OpenAPI_access_type_ToString(n1_n2_message_transfer_req_data->target_access)) == NULL) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_convertToJSON() failed [target_access]"); goto end; @@ -263,29 +292,48 @@ end: OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON(cJSON *n1_n2_message_transfer_req_dataJSON) { OpenAPI_n1_n2_message_transfer_req_data_t *n1_n2_message_transfer_req_data_local_var = NULL; - cJSON *n1_message_container = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "n1MessageContainer"); - + OpenAPI_lnode_t *node = NULL; + cJSON *n1_message_container = NULL; OpenAPI_n1_message_container_t *n1_message_container_local_nonprim = NULL; + cJSON *n2_info_container = NULL; + OpenAPI_n2_info_container_t *n2_info_container_local_nonprim = NULL; + cJSON *mt_data = NULL; + OpenAPI_ref_to_binary_data_t *mt_data_local_nonprim = NULL; + cJSON *skip_ind = NULL; + cJSON *last_msg_indication = NULL; + cJSON *pdu_session_id = NULL; + cJSON *lcs_correlation_id = NULL; + cJSON *ppi = NULL; + cJSON *arp = NULL; + OpenAPI_arp_t *arp_local_nonprim = NULL; + cJSON *_5qi = NULL; + cJSON *n1n2_failure_txf_notif_uri = NULL; + cJSON *smf_reallocation_ind = NULL; + cJSON *area_of_validity = NULL; + OpenAPI_area_of_validity_t *area_of_validity_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *old_guami = NULL; + OpenAPI_guami_t *old_guami_local_nonprim = NULL; + cJSON *ma_accepted_ind = NULL; + cJSON *ext_buf_support = NULL; + cJSON *target_access = NULL; + OpenAPI_access_type_e target_accessVariable = 0; + n1_message_container = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "n1MessageContainer"); if (n1_message_container) { n1_message_container_local_nonprim = OpenAPI_n1_message_container_parseFromJSON(n1_message_container); } - cJSON *n2_info_container = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "n2InfoContainer"); - - OpenAPI_n2_info_container_t *n2_info_container_local_nonprim = NULL; + n2_info_container = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "n2InfoContainer"); if (n2_info_container) { n2_info_container_local_nonprim = OpenAPI_n2_info_container_parseFromJSON(n2_info_container); } - cJSON *mt_data = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "mtData"); - - OpenAPI_ref_to_binary_data_t *mt_data_local_nonprim = NULL; + mt_data = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "mtData"); if (mt_data) { mt_data_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(mt_data); } - cJSON *skip_ind = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "skipInd"); - + skip_ind = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "skipInd"); if (skip_ind) { if (!cJSON_IsBool(skip_ind)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [skip_ind]"); @@ -293,8 +341,7 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da } } - cJSON *last_msg_indication = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "lastMsgIndication"); - + last_msg_indication = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "lastMsgIndication"); if (last_msg_indication) { if (!cJSON_IsBool(last_msg_indication)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [last_msg_indication]"); @@ -302,8 +349,7 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da } } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "pduSessionId"); - + pdu_session_id = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "pduSessionId"); if (pdu_session_id) { if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [pdu_session_id]"); @@ -311,17 +357,15 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da } } - cJSON *lcs_correlation_id = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "lcsCorrelationId"); - + lcs_correlation_id = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "lcsCorrelationId"); if (lcs_correlation_id) { - if (!cJSON_IsString(lcs_correlation_id)) { + if (!cJSON_IsString(lcs_correlation_id) && !cJSON_IsNull(lcs_correlation_id)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [lcs_correlation_id]"); goto end; } } - cJSON *ppi = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "ppi"); - + ppi = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "ppi"); if (ppi) { if (!cJSON_IsNumber(ppi)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [ppi]"); @@ -329,15 +373,12 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da } } - cJSON *arp = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "arp"); - - OpenAPI_arp_t *arp_local_nonprim = NULL; + arp = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "arp"); if (arp) { arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp); } - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "5qi"); - + _5qi = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "5qi"); if (_5qi) { if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [_5qi]"); @@ -345,17 +386,15 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da } } - cJSON *n1n2_failure_txf_notif_uri = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "n1n2FailureTxfNotifURI"); - + n1n2_failure_txf_notif_uri = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "n1n2FailureTxfNotifURI"); if (n1n2_failure_txf_notif_uri) { - if (!cJSON_IsString(n1n2_failure_txf_notif_uri)) { + if (!cJSON_IsString(n1n2_failure_txf_notif_uri) && !cJSON_IsNull(n1n2_failure_txf_notif_uri)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [n1n2_failure_txf_notif_uri]"); goto end; } } - cJSON *smf_reallocation_ind = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "smfReallocationInd"); - + smf_reallocation_ind = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "smfReallocationInd"); if (smf_reallocation_ind) { if (!cJSON_IsBool(smf_reallocation_ind)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [smf_reallocation_ind]"); @@ -363,31 +402,25 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da } } - cJSON *area_of_validity = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "areaOfValidity"); - - OpenAPI_area_of_validity_t *area_of_validity_local_nonprim = NULL; + area_of_validity = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "areaOfValidity"); if (area_of_validity) { area_of_validity_local_nonprim = OpenAPI_area_of_validity_parseFromJSON(area_of_validity); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *old_guami = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "oldGuami"); - - OpenAPI_guami_t *old_guami_local_nonprim = NULL; + old_guami = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "oldGuami"); if (old_guami) { old_guami_local_nonprim = OpenAPI_guami_parseFromJSON(old_guami); } - cJSON *ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "maAcceptedInd"); - + ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "maAcceptedInd"); if (ma_accepted_ind) { if (!cJSON_IsBool(ma_accepted_ind)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [ma_accepted_ind]"); @@ -395,8 +428,7 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da } } - cJSON *ext_buf_support = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "extBufSupport"); - + ext_buf_support = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "extBufSupport"); if (ext_buf_support) { if (!cJSON_IsBool(ext_buf_support)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [ext_buf_support]"); @@ -404,9 +436,7 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da } } - cJSON *target_access = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "targetAccess"); - - OpenAPI_access_type_e target_accessVariable; + target_access = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_req_dataJSON, "targetAccess"); if (target_access) { if (!cJSON_IsString(target_access)) { ogs_error("OpenAPI_n1_n2_message_transfer_req_data_parseFromJSON() failed [target_access]"); @@ -425,17 +455,17 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da last_msg_indication ? last_msg_indication->valueint : 0, pdu_session_id ? true : false, pdu_session_id ? pdu_session_id->valuedouble : 0, - lcs_correlation_id ? ogs_strdup(lcs_correlation_id->valuestring) : NULL, + lcs_correlation_id && !cJSON_IsNull(lcs_correlation_id) ? ogs_strdup(lcs_correlation_id->valuestring) : NULL, ppi ? true : false, ppi ? ppi->valuedouble : 0, arp ? arp_local_nonprim : NULL, _5qi ? true : false, _5qi ? _5qi->valuedouble : 0, - n1n2_failure_txf_notif_uri ? ogs_strdup(n1n2_failure_txf_notif_uri->valuestring) : NULL, + n1n2_failure_txf_notif_uri && !cJSON_IsNull(n1n2_failure_txf_notif_uri) ? ogs_strdup(n1n2_failure_txf_notif_uri->valuestring) : NULL, smf_reallocation_ind ? true : false, smf_reallocation_ind ? smf_reallocation_ind->valueint : 0, area_of_validity ? area_of_validity_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, old_guami ? old_guami_local_nonprim : NULL, ma_accepted_ind ? true : false, ma_accepted_ind ? ma_accepted_ind->valueint : 0, @@ -446,6 +476,30 @@ OpenAPI_n1_n2_message_transfer_req_data_t *OpenAPI_n1_n2_message_transfer_req_da return n1_n2_message_transfer_req_data_local_var; end: + if (n1_message_container_local_nonprim) { + OpenAPI_n1_message_container_free(n1_message_container_local_nonprim); + n1_message_container_local_nonprim = NULL; + } + if (n2_info_container_local_nonprim) { + OpenAPI_n2_info_container_free(n2_info_container_local_nonprim); + n2_info_container_local_nonprim = NULL; + } + if (mt_data_local_nonprim) { + OpenAPI_ref_to_binary_data_free(mt_data_local_nonprim); + mt_data_local_nonprim = NULL; + } + if (arp_local_nonprim) { + OpenAPI_arp_free(arp_local_nonprim); + arp_local_nonprim = NULL; + } + if (area_of_validity_local_nonprim) { + OpenAPI_area_of_validity_free(area_of_validity_local_nonprim); + area_of_validity_local_nonprim = NULL; + } + if (old_guami_local_nonprim) { + OpenAPI_guami_free(old_guami_local_nonprim); + old_guami_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n1_n2_message_transfer_rsp_data.c b/lib/sbi/openapi/model/n1_n2_message_transfer_rsp_data.c index e46752113..1acf7ec9d 100644 --- a/lib/sbi/openapi/model/n1_n2_message_transfer_rsp_data.c +++ b/lib/sbi/openapi/model/n1_n2_message_transfer_rsp_data.c @@ -20,17 +20,22 @@ OpenAPI_n1_n2_message_transfer_rsp_data_t *OpenAPI_n1_n2_message_transfer_rsp_da void OpenAPI_n1_n2_message_transfer_rsp_data_free(OpenAPI_n1_n2_message_transfer_rsp_data_t *n1_n2_message_transfer_rsp_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n1_n2_message_transfer_rsp_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(n1_n2_message_transfer_rsp_data->supported_features); + if (n1_n2_message_transfer_rsp_data->supported_features) { + ogs_free(n1_n2_message_transfer_rsp_data->supported_features); + n1_n2_message_transfer_rsp_data->supported_features = NULL; + } ogs_free(n1_n2_message_transfer_rsp_data); } cJSON *OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON(OpenAPI_n1_n2_message_transfer_rsp_data_t *n1_n2_message_transfer_rsp_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n1_n2_message_transfer_rsp_data == NULL) { ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON() failed [N1N2MessageTransferRspData]"); @@ -38,6 +43,10 @@ cJSON *OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON(OpenAPI_n1_n2_messa } item = cJSON_CreateObject(); + if (n1_n2_message_transfer_rsp_data->cause == OpenAPI_n1_n2_message_transfer_cause_NULL) { + ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON() failed [cause]"); + return NULL; + } if (cJSON_AddStringToObject(item, "cause", OpenAPI_n1_n2_message_transfer_cause_ToString(n1_n2_message_transfer_rsp_data->cause)) == NULL) { ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_convertToJSON() failed [cause]"); goto end; @@ -57,23 +66,24 @@ end: OpenAPI_n1_n2_message_transfer_rsp_data_t *OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON(cJSON *n1_n2_message_transfer_rsp_dataJSON) { OpenAPI_n1_n2_message_transfer_rsp_data_t *n1_n2_message_transfer_rsp_data_local_var = NULL; - cJSON *cause = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_rsp_dataJSON, "cause"); + OpenAPI_lnode_t *node = NULL; + cJSON *cause = NULL; + OpenAPI_n1_n2_message_transfer_cause_e causeVariable = 0; + cJSON *supported_features = NULL; + cause = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_rsp_dataJSON, "cause"); if (!cause) { ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON() failed [cause]"); goto end; } - - OpenAPI_n1_n2_message_transfer_cause_e causeVariable; if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON() failed [cause]"); goto end; } causeVariable = OpenAPI_n1_n2_message_transfer_cause_FromString(cause->valuestring); - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_rsp_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(n1_n2_message_transfer_rsp_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_n1_n2_message_transfer_rsp_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -81,7 +91,7 @@ OpenAPI_n1_n2_message_transfer_rsp_data_t *OpenAPI_n1_n2_message_transfer_rsp_da n1_n2_message_transfer_rsp_data_local_var = OpenAPI_n1_n2_message_transfer_rsp_data_create ( causeVariable, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return n1_n2_message_transfer_rsp_data_local_var; diff --git a/lib/sbi/openapi/model/n1_n2_msg_txfr_err_detail.c b/lib/sbi/openapi/model/n1_n2_msg_txfr_err_detail.c index bbf6e56db..dd3184e80 100644 --- a/lib/sbi/openapi/model/n1_n2_msg_txfr_err_detail.c +++ b/lib/sbi/openapi/model/n1_n2_msg_txfr_err_detail.c @@ -26,17 +26,22 @@ OpenAPI_n1_n2_msg_txfr_err_detail_t *OpenAPI_n1_n2_msg_txfr_err_detail_create( void OpenAPI_n1_n2_msg_txfr_err_detail_free(OpenAPI_n1_n2_msg_txfr_err_detail_t *n1_n2_msg_txfr_err_detail) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n1_n2_msg_txfr_err_detail) { return; } - OpenAPI_lnode_t *node; - OpenAPI_arp_free(n1_n2_msg_txfr_err_detail->highest_prio_arp); + if (n1_n2_msg_txfr_err_detail->highest_prio_arp) { + OpenAPI_arp_free(n1_n2_msg_txfr_err_detail->highest_prio_arp); + n1_n2_msg_txfr_err_detail->highest_prio_arp = NULL; + } ogs_free(n1_n2_msg_txfr_err_detail); } cJSON *OpenAPI_n1_n2_msg_txfr_err_detail_convertToJSON(OpenAPI_n1_n2_msg_txfr_err_detail_t *n1_n2_msg_txfr_err_detail) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n1_n2_msg_txfr_err_detail == NULL) { ogs_error("OpenAPI_n1_n2_msg_txfr_err_detail_convertToJSON() failed [N1N2MsgTxfrErrDetail]"); @@ -78,8 +83,12 @@ end: OpenAPI_n1_n2_msg_txfr_err_detail_t *OpenAPI_n1_n2_msg_txfr_err_detail_parseFromJSON(cJSON *n1_n2_msg_txfr_err_detailJSON) { OpenAPI_n1_n2_msg_txfr_err_detail_t *n1_n2_msg_txfr_err_detail_local_var = NULL; - cJSON *retry_after = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_err_detailJSON, "retryAfter"); - + OpenAPI_lnode_t *node = NULL; + cJSON *retry_after = NULL; + cJSON *highest_prio_arp = NULL; + OpenAPI_arp_t *highest_prio_arp_local_nonprim = NULL; + cJSON *max_waiting_time = NULL; + retry_after = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_err_detailJSON, "retryAfter"); if (retry_after) { if (!cJSON_IsNumber(retry_after)) { ogs_error("OpenAPI_n1_n2_msg_txfr_err_detail_parseFromJSON() failed [retry_after]"); @@ -87,15 +96,12 @@ OpenAPI_n1_n2_msg_txfr_err_detail_t *OpenAPI_n1_n2_msg_txfr_err_detail_parseFrom } } - cJSON *highest_prio_arp = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_err_detailJSON, "highestPrioArp"); - - OpenAPI_arp_t *highest_prio_arp_local_nonprim = NULL; + highest_prio_arp = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_err_detailJSON, "highestPrioArp"); if (highest_prio_arp) { highest_prio_arp_local_nonprim = OpenAPI_arp_parseFromJSON(highest_prio_arp); } - cJSON *max_waiting_time = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_err_detailJSON, "maxWaitingTime"); - + max_waiting_time = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_err_detailJSON, "maxWaitingTime"); if (max_waiting_time) { if (!cJSON_IsNumber(max_waiting_time)) { ogs_error("OpenAPI_n1_n2_msg_txfr_err_detail_parseFromJSON() failed [max_waiting_time]"); @@ -113,6 +119,10 @@ OpenAPI_n1_n2_msg_txfr_err_detail_t *OpenAPI_n1_n2_msg_txfr_err_detail_parseFrom return n1_n2_msg_txfr_err_detail_local_var; end: + if (highest_prio_arp_local_nonprim) { + OpenAPI_arp_free(highest_prio_arp_local_nonprim); + highest_prio_arp_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n1_n2_msg_txfr_failure_notification.c b/lib/sbi/openapi/model/n1_n2_msg_txfr_failure_notification.c index 692742f31..200048cea 100644 --- a/lib/sbi/openapi/model/n1_n2_msg_txfr_failure_notification.c +++ b/lib/sbi/openapi/model/n1_n2_msg_txfr_failure_notification.c @@ -20,17 +20,22 @@ OpenAPI_n1_n2_msg_txfr_failure_notification_t *OpenAPI_n1_n2_msg_txfr_failure_no void OpenAPI_n1_n2_msg_txfr_failure_notification_free(OpenAPI_n1_n2_msg_txfr_failure_notification_t *n1_n2_msg_txfr_failure_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n1_n2_msg_txfr_failure_notification) { return; } - OpenAPI_lnode_t *node; - ogs_free(n1_n2_msg_txfr_failure_notification->n1n2_msg_data_uri); + if (n1_n2_msg_txfr_failure_notification->n1n2_msg_data_uri) { + ogs_free(n1_n2_msg_txfr_failure_notification->n1n2_msg_data_uri); + n1_n2_msg_txfr_failure_notification->n1n2_msg_data_uri = NULL; + } ogs_free(n1_n2_msg_txfr_failure_notification); } cJSON *OpenAPI_n1_n2_msg_txfr_failure_notification_convertToJSON(OpenAPI_n1_n2_msg_txfr_failure_notification_t *n1_n2_msg_txfr_failure_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n1_n2_msg_txfr_failure_notification == NULL) { ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_convertToJSON() failed [N1N2MsgTxfrFailureNotification]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_n1_n2_msg_txfr_failure_notification_convertToJSON(OpenAPI_n1_n2_m } item = cJSON_CreateObject(); + if (n1_n2_msg_txfr_failure_notification->cause == OpenAPI_n1_n2_message_transfer_cause_NULL) { + ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_convertToJSON() failed [cause]"); + return NULL; + } if (cJSON_AddStringToObject(item, "cause", OpenAPI_n1_n2_message_transfer_cause_ToString(n1_n2_msg_txfr_failure_notification->cause)) == NULL) { ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_convertToJSON() failed [cause]"); goto end; } + if (!n1_n2_msg_txfr_failure_notification->n1n2_msg_data_uri) { + ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_convertToJSON() failed [n1n2_msg_data_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n1n2MsgDataUri", n1_n2_msg_txfr_failure_notification->n1n2_msg_data_uri) == NULL) { ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_convertToJSON() failed [n1n2_msg_data_uri]"); goto end; @@ -55,25 +68,26 @@ end: OpenAPI_n1_n2_msg_txfr_failure_notification_t *OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON(cJSON *n1_n2_msg_txfr_failure_notificationJSON) { OpenAPI_n1_n2_msg_txfr_failure_notification_t *n1_n2_msg_txfr_failure_notification_local_var = NULL; - cJSON *cause = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_failure_notificationJSON, "cause"); + OpenAPI_lnode_t *node = NULL; + cJSON *cause = NULL; + OpenAPI_n1_n2_message_transfer_cause_e causeVariable = 0; + cJSON *n1n2_msg_data_uri = NULL; + cause = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_failure_notificationJSON, "cause"); if (!cause) { ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON() failed [cause]"); goto end; } - - OpenAPI_n1_n2_message_transfer_cause_e causeVariable; if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON() failed [cause]"); goto end; } causeVariable = OpenAPI_n1_n2_message_transfer_cause_FromString(cause->valuestring); - cJSON *n1n2_msg_data_uri = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_failure_notificationJSON, "n1n2MsgDataUri"); + n1n2_msg_data_uri = cJSON_GetObjectItemCaseSensitive(n1_n2_msg_txfr_failure_notificationJSON, "n1n2MsgDataUri"); if (!n1n2_msg_data_uri) { ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON() failed [n1n2_msg_data_uri]"); goto end; } - if (!cJSON_IsString(n1n2_msg_data_uri)) { ogs_error("OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON() failed [n1n2_msg_data_uri]"); goto end; diff --git a/lib/sbi/openapi/model/n2_info_container.c b/lib/sbi/openapi/model/n2_info_container.c index 905ba5a92..46d568f1d 100644 --- a/lib/sbi/openapi/model/n2_info_container.c +++ b/lib/sbi/openapi/model/n2_info_container.c @@ -28,21 +28,38 @@ OpenAPI_n2_info_container_t *OpenAPI_n2_info_container_create( void OpenAPI_n2_info_container_free(OpenAPI_n2_info_container_t *n2_info_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_info_container) { return; } - OpenAPI_lnode_t *node; - OpenAPI_n2_sm_information_free(n2_info_container->sm_info); - OpenAPI_n2_ran_information_free(n2_info_container->ran_info); - OpenAPI_nrppa_information_free(n2_info_container->nrppa_info); - OpenAPI_pws_information_free(n2_info_container->pws_info); - OpenAPI_v2x_information_free(n2_info_container->v2x_info); + if (n2_info_container->sm_info) { + OpenAPI_n2_sm_information_free(n2_info_container->sm_info); + n2_info_container->sm_info = NULL; + } + if (n2_info_container->ran_info) { + OpenAPI_n2_ran_information_free(n2_info_container->ran_info); + n2_info_container->ran_info = NULL; + } + if (n2_info_container->nrppa_info) { + OpenAPI_nrppa_information_free(n2_info_container->nrppa_info); + n2_info_container->nrppa_info = NULL; + } + if (n2_info_container->pws_info) { + OpenAPI_pws_information_free(n2_info_container->pws_info); + n2_info_container->pws_info = NULL; + } + if (n2_info_container->v2x_info) { + OpenAPI_v2x_information_free(n2_info_container->v2x_info); + n2_info_container->v2x_info = NULL; + } ogs_free(n2_info_container); } cJSON *OpenAPI_n2_info_container_convertToJSON(OpenAPI_n2_info_container_t *n2_info_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_info_container == NULL) { ogs_error("OpenAPI_n2_info_container_convertToJSON() failed [N2InfoContainer]"); @@ -50,6 +67,10 @@ cJSON *OpenAPI_n2_info_container_convertToJSON(OpenAPI_n2_info_container_t *n2_i } item = cJSON_CreateObject(); + if (n2_info_container->n2_information_class == OpenAPI_n2_information_class_NULL) { + ogs_error("OpenAPI_n2_info_container_convertToJSON() failed [n2_information_class]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n2InformationClass", OpenAPI_n2_information_class_ToString(n2_info_container->n2_information_class)) == NULL) { ogs_error("OpenAPI_n2_info_container_convertToJSON() failed [n2_information_class]"); goto end; @@ -127,50 +148,51 @@ end: OpenAPI_n2_info_container_t *OpenAPI_n2_info_container_parseFromJSON(cJSON *n2_info_containerJSON) { OpenAPI_n2_info_container_t *n2_info_container_local_var = NULL; - cJSON *n2_information_class = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "n2InformationClass"); + OpenAPI_lnode_t *node = NULL; + cJSON *n2_information_class = NULL; + OpenAPI_n2_information_class_e n2_information_classVariable = 0; + cJSON *sm_info = NULL; + OpenAPI_n2_sm_information_t *sm_info_local_nonprim = NULL; + cJSON *ran_info = NULL; + OpenAPI_n2_ran_information_t *ran_info_local_nonprim = NULL; + cJSON *nrppa_info = NULL; + OpenAPI_nrppa_information_t *nrppa_info_local_nonprim = NULL; + cJSON *pws_info = NULL; + OpenAPI_pws_information_t *pws_info_local_nonprim = NULL; + cJSON *v2x_info = NULL; + OpenAPI_v2x_information_t *v2x_info_local_nonprim = NULL; + n2_information_class = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "n2InformationClass"); if (!n2_information_class) { ogs_error("OpenAPI_n2_info_container_parseFromJSON() failed [n2_information_class]"); goto end; } - - OpenAPI_n2_information_class_e n2_information_classVariable; if (!cJSON_IsString(n2_information_class)) { ogs_error("OpenAPI_n2_info_container_parseFromJSON() failed [n2_information_class]"); goto end; } n2_information_classVariable = OpenAPI_n2_information_class_FromString(n2_information_class->valuestring); - cJSON *sm_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "smInfo"); - - OpenAPI_n2_sm_information_t *sm_info_local_nonprim = NULL; + sm_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "smInfo"); if (sm_info) { sm_info_local_nonprim = OpenAPI_n2_sm_information_parseFromJSON(sm_info); } - cJSON *ran_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "ranInfo"); - - OpenAPI_n2_ran_information_t *ran_info_local_nonprim = NULL; + ran_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "ranInfo"); if (ran_info) { ran_info_local_nonprim = OpenAPI_n2_ran_information_parseFromJSON(ran_info); } - cJSON *nrppa_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "nrppaInfo"); - - OpenAPI_nrppa_information_t *nrppa_info_local_nonprim = NULL; + nrppa_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "nrppaInfo"); if (nrppa_info) { nrppa_info_local_nonprim = OpenAPI_nrppa_information_parseFromJSON(nrppa_info); } - cJSON *pws_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "pwsInfo"); - - OpenAPI_pws_information_t *pws_info_local_nonprim = NULL; + pws_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "pwsInfo"); if (pws_info) { pws_info_local_nonprim = OpenAPI_pws_information_parseFromJSON(pws_info); } - cJSON *v2x_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "v2xInfo"); - - OpenAPI_v2x_information_t *v2x_info_local_nonprim = NULL; + v2x_info = cJSON_GetObjectItemCaseSensitive(n2_info_containerJSON, "v2xInfo"); if (v2x_info) { v2x_info_local_nonprim = OpenAPI_v2x_information_parseFromJSON(v2x_info); } @@ -186,6 +208,26 @@ OpenAPI_n2_info_container_t *OpenAPI_n2_info_container_parseFromJSON(cJSON *n2_i return n2_info_container_local_var; end: + if (sm_info_local_nonprim) { + OpenAPI_n2_sm_information_free(sm_info_local_nonprim); + sm_info_local_nonprim = NULL; + } + if (ran_info_local_nonprim) { + OpenAPI_n2_ran_information_free(ran_info_local_nonprim); + ran_info_local_nonprim = NULL; + } + if (nrppa_info_local_nonprim) { + OpenAPI_nrppa_information_free(nrppa_info_local_nonprim); + nrppa_info_local_nonprim = NULL; + } + if (pws_info_local_nonprim) { + OpenAPI_pws_information_free(pws_info_local_nonprim); + pws_info_local_nonprim = NULL; + } + if (v2x_info_local_nonprim) { + OpenAPI_v2x_information_free(v2x_info_local_nonprim); + v2x_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_info_content.c b/lib/sbi/openapi/model/n2_info_content.c index a081bb45f..e07985862 100644 --- a/lib/sbi/openapi/model/n2_info_content.c +++ b/lib/sbi/openapi/model/n2_info_content.c @@ -24,17 +24,22 @@ OpenAPI_n2_info_content_t *OpenAPI_n2_info_content_create( void OpenAPI_n2_info_content_free(OpenAPI_n2_info_content_t *n2_info_content) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_info_content) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ref_to_binary_data_free(n2_info_content->ngap_data); + if (n2_info_content->ngap_data) { + OpenAPI_ref_to_binary_data_free(n2_info_content->ngap_data); + n2_info_content->ngap_data = NULL; + } ogs_free(n2_info_content); } cJSON *OpenAPI_n2_info_content_convertToJSON(OpenAPI_n2_info_content_t *n2_info_content) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_info_content == NULL) { ogs_error("OpenAPI_n2_info_content_convertToJSON() failed [N2InfoContent]"); @@ -49,13 +54,17 @@ cJSON *OpenAPI_n2_info_content_convertToJSON(OpenAPI_n2_info_content_t *n2_info_ } } - if (n2_info_content->ngap_ie_type) { + if (n2_info_content->ngap_ie_type != OpenAPI_ngap_ie_type_NULL) { if (cJSON_AddStringToObject(item, "ngapIeType", OpenAPI_ngap_ie_type_ToString(n2_info_content->ngap_ie_type)) == NULL) { ogs_error("OpenAPI_n2_info_content_convertToJSON() failed [ngap_ie_type]"); goto end; } } + if (!n2_info_content->ngap_data) { + ogs_error("OpenAPI_n2_info_content_convertToJSON() failed [ngap_data]"); + return NULL; + } cJSON *ngap_data_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(n2_info_content->ngap_data); if (ngap_data_local_JSON == NULL) { ogs_error("OpenAPI_n2_info_content_convertToJSON() failed [ngap_data]"); @@ -74,8 +83,13 @@ end: OpenAPI_n2_info_content_t *OpenAPI_n2_info_content_parseFromJSON(cJSON *n2_info_contentJSON) { OpenAPI_n2_info_content_t *n2_info_content_local_var = NULL; - cJSON *ngap_message_type = cJSON_GetObjectItemCaseSensitive(n2_info_contentJSON, "ngapMessageType"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ngap_message_type = NULL; + cJSON *ngap_ie_type = NULL; + OpenAPI_ngap_ie_type_e ngap_ie_typeVariable = 0; + cJSON *ngap_data = NULL; + OpenAPI_ref_to_binary_data_t *ngap_data_local_nonprim = NULL; + ngap_message_type = cJSON_GetObjectItemCaseSensitive(n2_info_contentJSON, "ngapMessageType"); if (ngap_message_type) { if (!cJSON_IsNumber(ngap_message_type)) { ogs_error("OpenAPI_n2_info_content_parseFromJSON() failed [ngap_message_type]"); @@ -83,9 +97,7 @@ OpenAPI_n2_info_content_t *OpenAPI_n2_info_content_parseFromJSON(cJSON *n2_info_ } } - cJSON *ngap_ie_type = cJSON_GetObjectItemCaseSensitive(n2_info_contentJSON, "ngapIeType"); - - OpenAPI_ngap_ie_type_e ngap_ie_typeVariable; + ngap_ie_type = cJSON_GetObjectItemCaseSensitive(n2_info_contentJSON, "ngapIeType"); if (ngap_ie_type) { if (!cJSON_IsString(ngap_ie_type)) { ogs_error("OpenAPI_n2_info_content_parseFromJSON() failed [ngap_ie_type]"); @@ -94,13 +106,11 @@ OpenAPI_n2_info_content_t *OpenAPI_n2_info_content_parseFromJSON(cJSON *n2_info_ ngap_ie_typeVariable = OpenAPI_ngap_ie_type_FromString(ngap_ie_type->valuestring); } - cJSON *ngap_data = cJSON_GetObjectItemCaseSensitive(n2_info_contentJSON, "ngapData"); + ngap_data = cJSON_GetObjectItemCaseSensitive(n2_info_contentJSON, "ngapData"); if (!ngap_data) { ogs_error("OpenAPI_n2_info_content_parseFromJSON() failed [ngap_data]"); goto end; } - - OpenAPI_ref_to_binary_data_t *ngap_data_local_nonprim = NULL; ngap_data_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(ngap_data); n2_info_content_local_var = OpenAPI_n2_info_content_create ( @@ -112,6 +122,10 @@ OpenAPI_n2_info_content_t *OpenAPI_n2_info_content_parseFromJSON(cJSON *n2_info_ return n2_info_content_local_var; end: + if (ngap_data_local_nonprim) { + OpenAPI_ref_to_binary_data_free(ngap_data_local_nonprim); + ngap_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_info_notification_rsp_data.c b/lib/sbi/openapi/model/n2_info_notification_rsp_data.c index c83cf0d3a..4db0673c4 100644 --- a/lib/sbi/openapi/model/n2_info_notification_rsp_data.c +++ b/lib/sbi/openapi/model/n2_info_notification_rsp_data.c @@ -18,17 +18,22 @@ OpenAPI_n2_info_notification_rsp_data_t *OpenAPI_n2_info_notification_rsp_data_c void OpenAPI_n2_info_notification_rsp_data_free(OpenAPI_n2_info_notification_rsp_data_t *n2_info_notification_rsp_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_info_notification_rsp_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_n2_info_content_free(n2_info_notification_rsp_data->n2_info_content); + if (n2_info_notification_rsp_data->n2_info_content) { + OpenAPI_n2_info_content_free(n2_info_notification_rsp_data->n2_info_content); + n2_info_notification_rsp_data->n2_info_content = NULL; + } ogs_free(n2_info_notification_rsp_data); } cJSON *OpenAPI_n2_info_notification_rsp_data_convertToJSON(OpenAPI_n2_info_notification_rsp_data_t *n2_info_notification_rsp_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_info_notification_rsp_data == NULL) { ogs_error("OpenAPI_n2_info_notification_rsp_data_convertToJSON() failed [N2InfoNotificationRspData]"); @@ -56,9 +61,10 @@ end: OpenAPI_n2_info_notification_rsp_data_t *OpenAPI_n2_info_notification_rsp_data_parseFromJSON(cJSON *n2_info_notification_rsp_dataJSON) { OpenAPI_n2_info_notification_rsp_data_t *n2_info_notification_rsp_data_local_var = NULL; - cJSON *n2_info_content = cJSON_GetObjectItemCaseSensitive(n2_info_notification_rsp_dataJSON, "n2InfoContent"); - + OpenAPI_lnode_t *node = NULL; + cJSON *n2_info_content = NULL; OpenAPI_n2_info_content_t *n2_info_content_local_nonprim = NULL; + n2_info_content = cJSON_GetObjectItemCaseSensitive(n2_info_notification_rsp_dataJSON, "n2InfoContent"); if (n2_info_content) { n2_info_content_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(n2_info_content); } @@ -69,6 +75,10 @@ OpenAPI_n2_info_notification_rsp_data_t *OpenAPI_n2_info_notification_rsp_data_p return n2_info_notification_rsp_data_local_var; end: + if (n2_info_content_local_nonprim) { + OpenAPI_n2_info_content_free(n2_info_content_local_nonprim); + n2_info_content_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_info_notify_handover_complete_200_response.c b/lib/sbi/openapi/model/n2_info_notify_handover_complete_200_response.c new file mode 100644 index 000000000..7882cc87d --- /dev/null +++ b/lib/sbi/openapi/model/n2_info_notify_handover_complete_200_response.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "n2_info_notify_handover_complete_200_response.h" + +OpenAPI_n2_info_notify_handover_complete_200_response_t *OpenAPI_n2_info_notify_handover_complete_200_response_create( + OpenAPI_n2_info_notification_rsp_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information +) +{ + OpenAPI_n2_info_notify_handover_complete_200_response_t *n2_info_notify_handover_complete_200_response_local_var = ogs_malloc(sizeof(OpenAPI_n2_info_notify_handover_complete_200_response_t)); + ogs_assert(n2_info_notify_handover_complete_200_response_local_var); + + n2_info_notify_handover_complete_200_response_local_var->json_data = json_data; + n2_info_notify_handover_complete_200_response_local_var->binary_data_n2_information = binary_data_n2_information; + + return n2_info_notify_handover_complete_200_response_local_var; +} + +void OpenAPI_n2_info_notify_handover_complete_200_response_free(OpenAPI_n2_info_notify_handover_complete_200_response_t *n2_info_notify_handover_complete_200_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == n2_info_notify_handover_complete_200_response) { + return; + } + if (n2_info_notify_handover_complete_200_response->json_data) { + OpenAPI_n2_info_notification_rsp_data_free(n2_info_notify_handover_complete_200_response->json_data); + n2_info_notify_handover_complete_200_response->json_data = NULL; + } + if (n2_info_notify_handover_complete_200_response->binary_data_n2_information) { + ogs_free(n2_info_notify_handover_complete_200_response->binary_data_n2_information->data); + n2_info_notify_handover_complete_200_response->binary_data_n2_information = NULL; + } + ogs_free(n2_info_notify_handover_complete_200_response); +} + +cJSON *OpenAPI_n2_info_notify_handover_complete_200_response_convertToJSON(OpenAPI_n2_info_notify_handover_complete_200_response_t *n2_info_notify_handover_complete_200_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (n2_info_notify_handover_complete_200_response == NULL) { + ogs_error("OpenAPI_n2_info_notify_handover_complete_200_response_convertToJSON() failed [N2InfoNotifyHandoverComplete_200_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (n2_info_notify_handover_complete_200_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_n2_info_notification_rsp_data_convertToJSON(n2_info_notify_handover_complete_200_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_n2_info_notify_handover_complete_200_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_n2_info_notify_handover_complete_200_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (n2_info_notify_handover_complete_200_response->binary_data_n2_information) { + char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(n2_info_notify_handover_complete_200_response->binary_data_n2_information->data,n2_info_notify_handover_complete_200_response->binary_data_n2_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { + ogs_error("OpenAPI_n2_info_notify_handover_complete_200_response_convertToJSON() failed [binary_data_n2_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information); + } + +end: + return item; +} + +OpenAPI_n2_info_notify_handover_complete_200_response_t *OpenAPI_n2_info_notify_handover_complete_200_response_parseFromJSON(cJSON *n2_info_notify_handover_complete_200_responseJSON) +{ + OpenAPI_n2_info_notify_handover_complete_200_response_t *n2_info_notify_handover_complete_200_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_n2_info_notification_rsp_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n2_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(n2_info_notify_handover_complete_200_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_n2_info_notification_rsp_data_parseFromJSON(json_data); + } + + binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(n2_info_notify_handover_complete_200_responseJSON, "binaryDataN2Information"); + if (binary_data_n2_information) { + decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information); + if (!cJSON_IsString(binary_data_n2_information)) { + ogs_error("OpenAPI_n2_info_notify_handover_complete_200_response_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); + if (!decoded_str_binary_data_n2_information->data) { + ogs_error("OpenAPI_n2_info_notify_handover_complete_200_response_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + } + + n2_info_notify_handover_complete_200_response_local_var = OpenAPI_n2_info_notify_handover_complete_200_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL + ); + + return n2_info_notify_handover_complete_200_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_n2_info_notification_rsp_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_n2_info_notify_handover_complete_200_response_t *OpenAPI_n2_info_notify_handover_complete_200_response_copy(OpenAPI_n2_info_notify_handover_complete_200_response_t *dst, OpenAPI_n2_info_notify_handover_complete_200_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_n2_info_notify_handover_complete_200_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_n2_info_notify_handover_complete_200_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_n2_info_notify_handover_complete_200_response_free(dst); + dst = OpenAPI_n2_info_notify_handover_complete_200_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/n2_info_notify_handover_complete_200_response.h b/lib/sbi/openapi/model/n2_info_notify_handover_complete_200_response.h new file mode 100644 index 000000000..01b3b2fa9 --- /dev/null +++ b/lib/sbi/openapi/model/n2_info_notify_handover_complete_200_response.h @@ -0,0 +1,41 @@ +/* + * n2_info_notify_handover_complete_200_response.h + * + * + */ + +#ifndef _OpenAPI_n2_info_notify_handover_complete_200_response_H_ +#define _OpenAPI_n2_info_notify_handover_complete_200_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "n2_info_notification_rsp_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_n2_info_notify_handover_complete_200_response_s OpenAPI_n2_info_notify_handover_complete_200_response_t; +typedef struct OpenAPI_n2_info_notify_handover_complete_200_response_s { + struct OpenAPI_n2_info_notification_rsp_data_s *json_data; + OpenAPI_binary_t* binary_data_n2_information; +} OpenAPI_n2_info_notify_handover_complete_200_response_t; + +OpenAPI_n2_info_notify_handover_complete_200_response_t *OpenAPI_n2_info_notify_handover_complete_200_response_create( + OpenAPI_n2_info_notification_rsp_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information +); +void OpenAPI_n2_info_notify_handover_complete_200_response_free(OpenAPI_n2_info_notify_handover_complete_200_response_t *n2_info_notify_handover_complete_200_response); +OpenAPI_n2_info_notify_handover_complete_200_response_t *OpenAPI_n2_info_notify_handover_complete_200_response_parseFromJSON(cJSON *n2_info_notify_handover_complete_200_responseJSON); +cJSON *OpenAPI_n2_info_notify_handover_complete_200_response_convertToJSON(OpenAPI_n2_info_notify_handover_complete_200_response_t *n2_info_notify_handover_complete_200_response); +OpenAPI_n2_info_notify_handover_complete_200_response_t *OpenAPI_n2_info_notify_handover_complete_200_response_copy(OpenAPI_n2_info_notify_handover_complete_200_response_t *dst, OpenAPI_n2_info_notify_handover_complete_200_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_n2_info_notify_handover_complete_200_response_H_ */ + diff --git a/lib/sbi/openapi/model/n2_information_class.c b/lib/sbi/openapi/model/n2_information_class.c index 6eb816db8..bff2df613 100644 --- a/lib/sbi/openapi/model/n2_information_class.c +++ b/lib/sbi/openapi/model/n2_information_class.c @@ -6,7 +6,7 @@ char* OpenAPI_n2_information_class_ToString(OpenAPI_n2_information_class_e n2_information_class) { - const char *n2_information_classArray[] = { "NULL", "SM", "NRPPa", "PWS", "PWS_BCAL", "PWS_RF", "RAN", "V2X" }; + const char *n2_information_classArray[] = { "NULL", "SM", "NRPPa", "PWS", "PWS-BCAL", "PWS-RF", "RAN", "V2X" }; size_t sizeofArray = sizeof(n2_information_classArray) / sizeof(n2_information_classArray[0]); if (n2_information_class < sizeofArray) return (char *)n2_information_classArray[n2_information_class]; @@ -17,7 +17,7 @@ char* OpenAPI_n2_information_class_ToString(OpenAPI_n2_information_class_e n2_in OpenAPI_n2_information_class_e OpenAPI_n2_information_class_FromString(char* n2_information_class) { int stringToReturn = 0; - const char *n2_information_classArray[] = { "NULL", "SM", "NRPPa", "PWS", "PWS_BCAL", "PWS_RF", "RAN", "V2X" }; + const char *n2_information_classArray[] = { "NULL", "SM", "NRPPa", "PWS", "PWS-BCAL", "PWS-RF", "RAN", "V2X" }; size_t sizeofArray = sizeof(n2_information_classArray) / sizeof(n2_information_classArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(n2_information_class, n2_information_classArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/n2_information_notification.c b/lib/sbi/openapi/model/n2_information_notification.c index 0ece88dd5..a7a8100c8 100644 --- a/lib/sbi/openapi/model/n2_information_notification.c +++ b/lib/sbi/openapi/model/n2_information_notification.c @@ -42,32 +42,64 @@ OpenAPI_n2_information_notification_t *OpenAPI_n2_information_notification_creat void OpenAPI_n2_information_notification_free(OpenAPI_n2_information_notification_t *n2_information_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_information_notification) { return; } - OpenAPI_lnode_t *node; - ogs_free(n2_information_notification->n2_notify_subscription_id); - OpenAPI_n2_info_container_free(n2_information_notification->n2_info_container); - OpenAPI_list_for_each(n2_information_notification->to_release_session_list, node) { - ogs_free(node->data); + if (n2_information_notification->n2_notify_subscription_id) { + ogs_free(n2_information_notification->n2_notify_subscription_id); + n2_information_notification->n2_notify_subscription_id = NULL; } - OpenAPI_list_free(n2_information_notification->to_release_session_list); - ogs_free(n2_information_notification->lcs_correlation_id); - OpenAPI_list_for_each(n2_information_notification->smf_change_info_list, node) { - OpenAPI_smf_change_info_free(node->data); + if (n2_information_notification->n2_info_container) { + OpenAPI_n2_info_container_free(n2_information_notification->n2_info_container); + n2_information_notification->n2_info_container = NULL; + } + if (n2_information_notification->to_release_session_list) { + OpenAPI_list_for_each(n2_information_notification->to_release_session_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(n2_information_notification->to_release_session_list); + n2_information_notification->to_release_session_list = NULL; + } + if (n2_information_notification->lcs_correlation_id) { + ogs_free(n2_information_notification->lcs_correlation_id); + n2_information_notification->lcs_correlation_id = NULL; + } + if (n2_information_notification->smf_change_info_list) { + OpenAPI_list_for_each(n2_information_notification->smf_change_info_list, node) { + OpenAPI_smf_change_info_free(node->data); + } + OpenAPI_list_free(n2_information_notification->smf_change_info_list); + n2_information_notification->smf_change_info_list = NULL; + } + if (n2_information_notification->ran_node_id) { + OpenAPI_global_ran_node_id_free(n2_information_notification->ran_node_id); + n2_information_notification->ran_node_id = NULL; + } + if (n2_information_notification->initial_amf_name) { + ogs_free(n2_information_notification->initial_amf_name); + n2_information_notification->initial_amf_name = NULL; + } + if (n2_information_notification->an_n2_ipv4_addr) { + ogs_free(n2_information_notification->an_n2_ipv4_addr); + n2_information_notification->an_n2_ipv4_addr = NULL; + } + if (n2_information_notification->an_n2_ipv6_addr) { + ogs_free(n2_information_notification->an_n2_ipv6_addr); + n2_information_notification->an_n2_ipv6_addr = NULL; + } + if (n2_information_notification->guami) { + OpenAPI_guami_free(n2_information_notification->guami); + n2_information_notification->guami = NULL; } - OpenAPI_list_free(n2_information_notification->smf_change_info_list); - OpenAPI_global_ran_node_id_free(n2_information_notification->ran_node_id); - ogs_free(n2_information_notification->initial_amf_name); - ogs_free(n2_information_notification->an_n2_ipv4_addr); - ogs_free(n2_information_notification->an_n2_ipv6_addr); - OpenAPI_guami_free(n2_information_notification->guami); ogs_free(n2_information_notification); } cJSON *OpenAPI_n2_information_notification_convertToJSON(OpenAPI_n2_information_notification_t *n2_information_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_information_notification == NULL) { ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [N2InformationNotification]"); @@ -75,6 +107,10 @@ cJSON *OpenAPI_n2_information_notification_convertToJSON(OpenAPI_n2_information_ } item = cJSON_CreateObject(); + if (!n2_information_notification->n2_notify_subscription_id) { + ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [n2_notify_subscription_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n2NotifySubscriptionId", n2_information_notification->n2_notify_subscription_id) == NULL) { ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [n2_notify_subscription_id]"); goto end; @@ -94,19 +130,17 @@ cJSON *OpenAPI_n2_information_notification_convertToJSON(OpenAPI_n2_information_ } if (n2_information_notification->to_release_session_list) { - cJSON *to_release_session_list = cJSON_AddArrayToObject(item, "toReleaseSessionList"); - if (to_release_session_list == NULL) { + cJSON *to_release_session_listList = cJSON_AddArrayToObject(item, "toReleaseSessionList"); + if (to_release_session_listList == NULL) { ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [to_release_session_list]"); goto end; } - - OpenAPI_lnode_t *to_release_session_list_node; - OpenAPI_list_for_each(n2_information_notification->to_release_session_list, to_release_session_list_node) { - if (cJSON_AddNumberToObject(to_release_session_list, "", *(double *)to_release_session_list_node->data) == NULL) { - ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [to_release_session_list]"); - goto end; + OpenAPI_list_for_each(n2_information_notification->to_release_session_list, node) { + if (cJSON_AddNumberToObject(to_release_session_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [to_release_session_list]"); + goto end; + } } - } } if (n2_information_notification->lcs_correlation_id) { @@ -116,7 +150,7 @@ cJSON *OpenAPI_n2_information_notification_convertToJSON(OpenAPI_n2_information_ } } - if (n2_information_notification->notify_reason) { + if (n2_information_notification->notify_reason != OpenAPI_n2_info_notify_reason_NULL) { if (cJSON_AddStringToObject(item, "notifyReason", OpenAPI_n2_info_notify_reason_ToString(n2_information_notification->notify_reason)) == NULL) { ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [notify_reason]"); goto end; @@ -129,17 +163,13 @@ cJSON *OpenAPI_n2_information_notification_convertToJSON(OpenAPI_n2_information_ ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [smf_change_info_list]"); goto end; } - - OpenAPI_lnode_t *smf_change_info_list_node; - if (n2_information_notification->smf_change_info_list) { - OpenAPI_list_for_each(n2_information_notification->smf_change_info_list, smf_change_info_list_node) { - cJSON *itemLocal = OpenAPI_smf_change_info_convertToJSON(smf_change_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [smf_change_info_list]"); - goto end; - } - cJSON_AddItemToArray(smf_change_info_listList, itemLocal); + OpenAPI_list_for_each(n2_information_notification->smf_change_info_list, node) { + cJSON *itemLocal = OpenAPI_smf_change_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_n2_information_notification_convertToJSON() failed [smf_change_info_list]"); + goto end; } + cJSON_AddItemToArray(smf_change_info_listList, itemLocal); } } @@ -204,56 +234,76 @@ end: OpenAPI_n2_information_notification_t *OpenAPI_n2_information_notification_parseFromJSON(cJSON *n2_information_notificationJSON) { OpenAPI_n2_information_notification_t *n2_information_notification_local_var = NULL; - cJSON *n2_notify_subscription_id = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "n2NotifySubscriptionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *n2_notify_subscription_id = NULL; + cJSON *n2_info_container = NULL; + OpenAPI_n2_info_container_t *n2_info_container_local_nonprim = NULL; + cJSON *to_release_session_list = NULL; + OpenAPI_list_t *to_release_session_listList = NULL; + cJSON *lcs_correlation_id = NULL; + cJSON *notify_reason = NULL; + OpenAPI_n2_info_notify_reason_e notify_reasonVariable = 0; + cJSON *smf_change_info_list = NULL; + OpenAPI_list_t *smf_change_info_listList = NULL; + cJSON *ran_node_id = NULL; + OpenAPI_global_ran_node_id_t *ran_node_id_local_nonprim = NULL; + cJSON *initial_amf_name = NULL; + cJSON *an_n2_ipv4_addr = NULL; + cJSON *an_n2_ipv6_addr = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *notify_source_ng_ran = NULL; + n2_notify_subscription_id = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "n2NotifySubscriptionId"); if (!n2_notify_subscription_id) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [n2_notify_subscription_id]"); goto end; } - if (!cJSON_IsString(n2_notify_subscription_id)) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [n2_notify_subscription_id]"); goto end; } - cJSON *n2_info_container = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "n2InfoContainer"); - - OpenAPI_n2_info_container_t *n2_info_container_local_nonprim = NULL; + n2_info_container = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "n2InfoContainer"); if (n2_info_container) { n2_info_container_local_nonprim = OpenAPI_n2_info_container_parseFromJSON(n2_info_container); } - cJSON *to_release_session_list = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "toReleaseSessionList"); - - OpenAPI_list_t *to_release_session_listList; + to_release_session_list = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "toReleaseSessionList"); if (to_release_session_list) { - cJSON *to_release_session_list_local; - if (!cJSON_IsArray(to_release_session_list)) { - ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [to_release_session_list]"); - goto end; - } - to_release_session_listList = OpenAPI_list_create(); + cJSON *to_release_session_list_local = NULL; + if (!cJSON_IsArray(to_release_session_list)) { + ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [to_release_session_list]"); + goto end; + } - cJSON_ArrayForEach(to_release_session_list_local, to_release_session_list) { - if (!cJSON_IsNumber(to_release_session_list_local)) { - ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [to_release_session_list]"); - goto end; - } - OpenAPI_list_add(to_release_session_listList, &to_release_session_list_local->valuedouble); - } + to_release_session_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(to_release_session_list_local, to_release_session_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(to_release_session_list_local)) { + ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [to_release_session_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [to_release_session_list]"); + goto end; + } + *localDouble = to_release_session_list_local->valuedouble; + OpenAPI_list_add(to_release_session_listList, localDouble); + } } - cJSON *lcs_correlation_id = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "lcsCorrelationId"); - + lcs_correlation_id = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "lcsCorrelationId"); if (lcs_correlation_id) { - if (!cJSON_IsString(lcs_correlation_id)) { + if (!cJSON_IsString(lcs_correlation_id) && !cJSON_IsNull(lcs_correlation_id)) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [lcs_correlation_id]"); goto end; } } - cJSON *notify_reason = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "notifyReason"); - - OpenAPI_n2_info_notify_reason_e notify_reasonVariable; + notify_reason = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "notifyReason"); if (notify_reason) { if (!cJSON_IsString(notify_reason)) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [notify_reason]"); @@ -262,78 +312,66 @@ OpenAPI_n2_information_notification_t *OpenAPI_n2_information_notification_parse notify_reasonVariable = OpenAPI_n2_info_notify_reason_FromString(notify_reason->valuestring); } - cJSON *smf_change_info_list = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "smfChangeInfoList"); - - OpenAPI_list_t *smf_change_info_listList; + smf_change_info_list = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "smfChangeInfoList"); if (smf_change_info_list) { - cJSON *smf_change_info_list_local_nonprimitive; - if (!cJSON_IsArray(smf_change_info_list)){ - ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [smf_change_info_list]"); - goto end; - } - - smf_change_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(smf_change_info_list_local_nonprimitive, smf_change_info_list ) { - if (!cJSON_IsObject(smf_change_info_list_local_nonprimitive)) { + cJSON *smf_change_info_list_local = NULL; + if (!cJSON_IsArray(smf_change_info_list)) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [smf_change_info_list]"); goto end; } - OpenAPI_smf_change_info_t *smf_change_info_listItem = OpenAPI_smf_change_info_parseFromJSON(smf_change_info_list_local_nonprimitive); - if (!smf_change_info_listItem) { - ogs_error("No smf_change_info_listItem"); - OpenAPI_list_free(smf_change_info_listList); - goto end; + smf_change_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_change_info_list_local, smf_change_info_list) { + if (!cJSON_IsObject(smf_change_info_list_local)) { + ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [smf_change_info_list]"); + goto end; + } + OpenAPI_smf_change_info_t *smf_change_info_listItem = OpenAPI_smf_change_info_parseFromJSON(smf_change_info_list_local); + if (!smf_change_info_listItem) { + ogs_error("No smf_change_info_listItem"); + OpenAPI_list_free(smf_change_info_listList); + goto end; + } + OpenAPI_list_add(smf_change_info_listList, smf_change_info_listItem); } - - OpenAPI_list_add(smf_change_info_listList, smf_change_info_listItem); - } } - cJSON *ran_node_id = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "ranNodeId"); - - OpenAPI_global_ran_node_id_t *ran_node_id_local_nonprim = NULL; + ran_node_id = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "ranNodeId"); if (ran_node_id) { ran_node_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(ran_node_id); } - cJSON *initial_amf_name = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "initialAmfName"); - + initial_amf_name = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "initialAmfName"); if (initial_amf_name) { - if (!cJSON_IsString(initial_amf_name)) { + if (!cJSON_IsString(initial_amf_name) && !cJSON_IsNull(initial_amf_name)) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [initial_amf_name]"); goto end; } } - cJSON *an_n2_ipv4_addr = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "anN2IPv4Addr"); - + an_n2_ipv4_addr = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "anN2IPv4Addr"); if (an_n2_ipv4_addr) { - if (!cJSON_IsString(an_n2_ipv4_addr)) { + if (!cJSON_IsString(an_n2_ipv4_addr) && !cJSON_IsNull(an_n2_ipv4_addr)) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [an_n2_ipv4_addr]"); goto end; } } - cJSON *an_n2_ipv6_addr = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "anN2IPv6Addr"); - + an_n2_ipv6_addr = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "anN2IPv6Addr"); if (an_n2_ipv6_addr) { - if (!cJSON_IsString(an_n2_ipv6_addr)) { + if (!cJSON_IsString(an_n2_ipv6_addr) && !cJSON_IsNull(an_n2_ipv6_addr)) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [an_n2_ipv6_addr]"); goto end; } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } - cJSON *notify_source_ng_ran = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "notifySourceNgRan"); - + notify_source_ng_ran = cJSON_GetObjectItemCaseSensitive(n2_information_notificationJSON, "notifySourceNgRan"); if (notify_source_ng_ran) { if (!cJSON_IsBool(notify_source_ng_ran)) { ogs_error("OpenAPI_n2_information_notification_parseFromJSON() failed [notify_source_ng_ran]"); @@ -345,13 +383,13 @@ OpenAPI_n2_information_notification_t *OpenAPI_n2_information_notification_parse ogs_strdup(n2_notify_subscription_id->valuestring), n2_info_container ? n2_info_container_local_nonprim : NULL, to_release_session_list ? to_release_session_listList : NULL, - lcs_correlation_id ? ogs_strdup(lcs_correlation_id->valuestring) : NULL, + lcs_correlation_id && !cJSON_IsNull(lcs_correlation_id) ? ogs_strdup(lcs_correlation_id->valuestring) : NULL, notify_reason ? notify_reasonVariable : 0, smf_change_info_list ? smf_change_info_listList : NULL, ran_node_id ? ran_node_id_local_nonprim : NULL, - initial_amf_name ? ogs_strdup(initial_amf_name->valuestring) : NULL, - an_n2_ipv4_addr ? ogs_strdup(an_n2_ipv4_addr->valuestring) : NULL, - an_n2_ipv6_addr ? ogs_strdup(an_n2_ipv6_addr->valuestring) : NULL, + initial_amf_name && !cJSON_IsNull(initial_amf_name) ? ogs_strdup(initial_amf_name->valuestring) : NULL, + an_n2_ipv4_addr && !cJSON_IsNull(an_n2_ipv4_addr) ? ogs_strdup(an_n2_ipv4_addr->valuestring) : NULL, + an_n2_ipv6_addr && !cJSON_IsNull(an_n2_ipv6_addr) ? ogs_strdup(an_n2_ipv6_addr->valuestring) : NULL, guami ? guami_local_nonprim : NULL, notify_source_ng_ran ? true : false, notify_source_ng_ran ? notify_source_ng_ran->valueint : 0 @@ -359,6 +397,32 @@ OpenAPI_n2_information_notification_t *OpenAPI_n2_information_notification_parse return n2_information_notification_local_var; end: + if (n2_info_container_local_nonprim) { + OpenAPI_n2_info_container_free(n2_info_container_local_nonprim); + n2_info_container_local_nonprim = NULL; + } + if (to_release_session_listList) { + OpenAPI_list_for_each(to_release_session_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(to_release_session_listList); + to_release_session_listList = NULL; + } + if (smf_change_info_listList) { + OpenAPI_list_for_each(smf_change_info_listList, node) { + OpenAPI_smf_change_info_free(node->data); + } + OpenAPI_list_free(smf_change_info_listList); + smf_change_info_listList = NULL; + } + if (ran_node_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(ran_node_id_local_nonprim); + ran_node_id_local_nonprim = NULL; + } + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_information_transfer_error.c b/lib/sbi/openapi/model/n2_information_transfer_error.c index 939faf576..8c6d1cfaa 100644 --- a/lib/sbi/openapi/model/n2_information_transfer_error.c +++ b/lib/sbi/openapi/model/n2_information_transfer_error.c @@ -20,18 +20,26 @@ OpenAPI_n2_information_transfer_error_t *OpenAPI_n2_information_transfer_error_c void OpenAPI_n2_information_transfer_error_free(OpenAPI_n2_information_transfer_error_t *n2_information_transfer_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_information_transfer_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_problem_details_free(n2_information_transfer_error->error); - OpenAPI_pws_error_data_free(n2_information_transfer_error->pws_error_info); + if (n2_information_transfer_error->error) { + OpenAPI_problem_details_free(n2_information_transfer_error->error); + n2_information_transfer_error->error = NULL; + } + if (n2_information_transfer_error->pws_error_info) { + OpenAPI_pws_error_data_free(n2_information_transfer_error->pws_error_info); + n2_information_transfer_error->pws_error_info = NULL; + } ogs_free(n2_information_transfer_error); } cJSON *OpenAPI_n2_information_transfer_error_convertToJSON(OpenAPI_n2_information_transfer_error_t *n2_information_transfer_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_information_transfer_error == NULL) { ogs_error("OpenAPI_n2_information_transfer_error_convertToJSON() failed [N2InformationTransferError]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_n2_information_transfer_error_convertToJSON(OpenAPI_n2_informatio } item = cJSON_CreateObject(); + if (!n2_information_transfer_error->error) { + ogs_error("OpenAPI_n2_information_transfer_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(n2_information_transfer_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_n2_information_transfer_error_convertToJSON() failed [error]"); @@ -70,18 +82,19 @@ end: OpenAPI_n2_information_transfer_error_t *OpenAPI_n2_information_transfer_error_parseFromJSON(cJSON *n2_information_transfer_errorJSON) { OpenAPI_n2_information_transfer_error_t *n2_information_transfer_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_problem_details_t *error_local_nonprim = NULL; + cJSON *pws_error_info = NULL; + OpenAPI_pws_error_data_t *pws_error_info_local_nonprim = NULL; + error = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_n2_information_transfer_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error); - cJSON *pws_error_info = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_errorJSON, "pwsErrorInfo"); - - OpenAPI_pws_error_data_t *pws_error_info_local_nonprim = NULL; + pws_error_info = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_errorJSON, "pwsErrorInfo"); if (pws_error_info) { pws_error_info_local_nonprim = OpenAPI_pws_error_data_parseFromJSON(pws_error_info); } @@ -93,6 +106,14 @@ OpenAPI_n2_information_transfer_error_t *OpenAPI_n2_information_transfer_error_p return n2_information_transfer_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (pws_error_info_local_nonprim) { + OpenAPI_pws_error_data_free(pws_error_info_local_nonprim); + pws_error_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_information_transfer_req_data.c b/lib/sbi/openapi/model/n2_information_transfer_req_data.c index 4b69a9887..69d3e1c25 100644 --- a/lib/sbi/openapi/model/n2_information_transfer_req_data.c +++ b/lib/sbi/openapi/model/n2_information_transfer_req_data.c @@ -26,26 +26,40 @@ OpenAPI_n2_information_transfer_req_data_t *OpenAPI_n2_information_transfer_req_ void OpenAPI_n2_information_transfer_req_data_free(OpenAPI_n2_information_transfer_req_data_t *n2_information_transfer_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_information_transfer_req_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(n2_information_transfer_req_data->tai_list, node) { - OpenAPI_tai_free(node->data); + if (n2_information_transfer_req_data->tai_list) { + OpenAPI_list_for_each(n2_information_transfer_req_data->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(n2_information_transfer_req_data->tai_list); + n2_information_transfer_req_data->tai_list = NULL; } - OpenAPI_list_free(n2_information_transfer_req_data->tai_list); - OpenAPI_list_for_each(n2_information_transfer_req_data->global_ran_node_list, node) { - OpenAPI_global_ran_node_id_free(node->data); + if (n2_information_transfer_req_data->global_ran_node_list) { + OpenAPI_list_for_each(n2_information_transfer_req_data->global_ran_node_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(n2_information_transfer_req_data->global_ran_node_list); + n2_information_transfer_req_data->global_ran_node_list = NULL; + } + if (n2_information_transfer_req_data->n2_information) { + OpenAPI_n2_info_container_free(n2_information_transfer_req_data->n2_information); + n2_information_transfer_req_data->n2_information = NULL; + } + if (n2_information_transfer_req_data->supported_features) { + ogs_free(n2_information_transfer_req_data->supported_features); + n2_information_transfer_req_data->supported_features = NULL; } - OpenAPI_list_free(n2_information_transfer_req_data->global_ran_node_list); - OpenAPI_n2_info_container_free(n2_information_transfer_req_data->n2_information); - ogs_free(n2_information_transfer_req_data->supported_features); ogs_free(n2_information_transfer_req_data); } cJSON *OpenAPI_n2_information_transfer_req_data_convertToJSON(OpenAPI_n2_information_transfer_req_data_t *n2_information_transfer_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_information_transfer_req_data == NULL) { ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [N2InformationTransferReqData]"); @@ -59,21 +73,17 @@ cJSON *OpenAPI_n2_information_transfer_req_data_convertToJSON(OpenAPI_n2_informa ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (n2_information_transfer_req_data->tai_list) { - OpenAPI_list_for_each(n2_information_transfer_req_data->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(n2_information_transfer_req_data->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } } - if (n2_information_transfer_req_data->rat_selector) { + if (n2_information_transfer_req_data->rat_selector != OpenAPI_rat_selector_NULL) { if (cJSON_AddStringToObject(item, "ratSelector", OpenAPI_rat_selector_ToString(n2_information_transfer_req_data->rat_selector)) == NULL) { ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [rat_selector]"); goto end; @@ -86,20 +96,20 @@ cJSON *OpenAPI_n2_information_transfer_req_data_convertToJSON(OpenAPI_n2_informa ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [global_ran_node_list]"); goto end; } - - OpenAPI_lnode_t *global_ran_node_list_node; - if (n2_information_transfer_req_data->global_ran_node_list) { - OpenAPI_list_for_each(n2_information_transfer_req_data->global_ran_node_list, global_ran_node_list_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(global_ran_node_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [global_ran_node_list]"); - goto end; - } - cJSON_AddItemToArray(global_ran_node_listList, itemLocal); + OpenAPI_list_for_each(n2_information_transfer_req_data->global_ran_node_list, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [global_ran_node_list]"); + goto end; } + cJSON_AddItemToArray(global_ran_node_listList, itemLocal); } } + if (!n2_information_transfer_req_data->n2_information) { + ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [n2_information]"); + return NULL; + } cJSON *n2_information_local_JSON = OpenAPI_n2_info_container_convertToJSON(n2_information_transfer_req_data->n2_information); if (n2_information_local_JSON == NULL) { ogs_error("OpenAPI_n2_information_transfer_req_data_convertToJSON() failed [n2_information]"); @@ -125,38 +135,42 @@ end: OpenAPI_n2_information_transfer_req_data_t *OpenAPI_n2_information_transfer_req_data_parseFromJSON(cJSON *n2_information_transfer_req_dataJSON) { OpenAPI_n2_information_transfer_req_data_t *n2_information_transfer_req_data_local_var = NULL; - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "taiList"); - - OpenAPI_list_t *tai_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + cJSON *rat_selector = NULL; + OpenAPI_rat_selector_e rat_selectorVariable = 0; + cJSON *global_ran_node_list = NULL; + OpenAPI_list_t *global_ran_node_listList = NULL; + cJSON *n2_information = NULL; + OpenAPI_n2_info_container_t *n2_information_local_nonprim = NULL; + cJSON *supported_features = NULL; + tai_list = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "taiList"); if (tai_list) { - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - - OpenAPI_list_add(tai_listList, tai_listItem); - } } - cJSON *rat_selector = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "ratSelector"); - - OpenAPI_rat_selector_e rat_selectorVariable; + rat_selector = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "ratSelector"); if (rat_selector) { if (!cJSON_IsString(rat_selector)) { ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [rat_selector]"); @@ -165,48 +179,41 @@ OpenAPI_n2_information_transfer_req_data_t *OpenAPI_n2_information_transfer_req_ rat_selectorVariable = OpenAPI_rat_selector_FromString(rat_selector->valuestring); } - cJSON *global_ran_node_list = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "globalRanNodeList"); - - OpenAPI_list_t *global_ran_node_listList; + global_ran_node_list = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "globalRanNodeList"); if (global_ran_node_list) { - cJSON *global_ran_node_list_local_nonprimitive; - if (!cJSON_IsArray(global_ran_node_list)){ - ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [global_ran_node_list]"); - goto end; - } - - global_ran_node_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(global_ran_node_list_local_nonprimitive, global_ran_node_list ) { - if (!cJSON_IsObject(global_ran_node_list_local_nonprimitive)) { + cJSON *global_ran_node_list_local = NULL; + if (!cJSON_IsArray(global_ran_node_list)) { ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [global_ran_node_list]"); goto end; } - OpenAPI_global_ran_node_id_t *global_ran_node_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_list_local_nonprimitive); - if (!global_ran_node_listItem) { - ogs_error("No global_ran_node_listItem"); - OpenAPI_list_free(global_ran_node_listList); - goto end; + global_ran_node_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(global_ran_node_list_local, global_ran_node_list) { + if (!cJSON_IsObject(global_ran_node_list_local)) { + ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [global_ran_node_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *global_ran_node_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_list_local); + if (!global_ran_node_listItem) { + ogs_error("No global_ran_node_listItem"); + OpenAPI_list_free(global_ran_node_listList); + goto end; + } + OpenAPI_list_add(global_ran_node_listList, global_ran_node_listItem); } - - OpenAPI_list_add(global_ran_node_listList, global_ran_node_listItem); - } } - cJSON *n2_information = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "n2Information"); + n2_information = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "n2Information"); if (!n2_information) { ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [n2_information]"); goto end; } - - OpenAPI_n2_info_container_t *n2_information_local_nonprim = NULL; n2_information_local_nonprim = OpenAPI_n2_info_container_parseFromJSON(n2_information); - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_req_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_n2_information_transfer_req_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -217,11 +224,29 @@ OpenAPI_n2_information_transfer_req_data_t *OpenAPI_n2_information_transfer_req_ rat_selector ? rat_selectorVariable : 0, global_ran_node_list ? global_ran_node_listList : NULL, n2_information_local_nonprim, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return n2_information_transfer_req_data_local_var; end: + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } + if (global_ran_node_listList) { + OpenAPI_list_for_each(global_ran_node_listList, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(global_ran_node_listList); + global_ran_node_listList = NULL; + } + if (n2_information_local_nonprim) { + OpenAPI_n2_info_container_free(n2_information_local_nonprim); + n2_information_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_information_transfer_rsp_data.c b/lib/sbi/openapi/model/n2_information_transfer_rsp_data.c index 15375c776..320ba4c09 100644 --- a/lib/sbi/openapi/model/n2_information_transfer_rsp_data.c +++ b/lib/sbi/openapi/model/n2_information_transfer_rsp_data.c @@ -22,18 +22,26 @@ OpenAPI_n2_information_transfer_rsp_data_t *OpenAPI_n2_information_transfer_rsp_ void OpenAPI_n2_information_transfer_rsp_data_free(OpenAPI_n2_information_transfer_rsp_data_t *n2_information_transfer_rsp_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_information_transfer_rsp_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_pws_response_data_free(n2_information_transfer_rsp_data->pws_rsp_data); - ogs_free(n2_information_transfer_rsp_data->supported_features); + if (n2_information_transfer_rsp_data->pws_rsp_data) { + OpenAPI_pws_response_data_free(n2_information_transfer_rsp_data->pws_rsp_data); + n2_information_transfer_rsp_data->pws_rsp_data = NULL; + } + if (n2_information_transfer_rsp_data->supported_features) { + ogs_free(n2_information_transfer_rsp_data->supported_features); + n2_information_transfer_rsp_data->supported_features = NULL; + } ogs_free(n2_information_transfer_rsp_data); } cJSON *OpenAPI_n2_information_transfer_rsp_data_convertToJSON(OpenAPI_n2_information_transfer_rsp_data_t *n2_information_transfer_rsp_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_information_transfer_rsp_data == NULL) { ogs_error("OpenAPI_n2_information_transfer_rsp_data_convertToJSON() failed [N2InformationTransferRspData]"); @@ -41,6 +49,10 @@ cJSON *OpenAPI_n2_information_transfer_rsp_data_convertToJSON(OpenAPI_n2_informa } item = cJSON_CreateObject(); + if (n2_information_transfer_rsp_data->result == OpenAPI_n2_information_transfer_result_NULL) { + ogs_error("OpenAPI_n2_information_transfer_rsp_data_convertToJSON() failed [result]"); + return NULL; + } if (cJSON_AddStringToObject(item, "result", OpenAPI_n2_information_transfer_result_ToString(n2_information_transfer_rsp_data->result)) == NULL) { ogs_error("OpenAPI_n2_information_transfer_rsp_data_convertToJSON() failed [result]"); goto end; @@ -73,30 +85,31 @@ end: OpenAPI_n2_information_transfer_rsp_data_t *OpenAPI_n2_information_transfer_rsp_data_parseFromJSON(cJSON *n2_information_transfer_rsp_dataJSON) { OpenAPI_n2_information_transfer_rsp_data_t *n2_information_transfer_rsp_data_local_var = NULL; - cJSON *result = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_rsp_dataJSON, "result"); + OpenAPI_lnode_t *node = NULL; + cJSON *result = NULL; + OpenAPI_n2_information_transfer_result_e resultVariable = 0; + cJSON *pws_rsp_data = NULL; + OpenAPI_pws_response_data_t *pws_rsp_data_local_nonprim = NULL; + cJSON *supported_features = NULL; + result = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_rsp_dataJSON, "result"); if (!result) { ogs_error("OpenAPI_n2_information_transfer_rsp_data_parseFromJSON() failed [result]"); goto end; } - - OpenAPI_n2_information_transfer_result_e resultVariable; if (!cJSON_IsString(result)) { ogs_error("OpenAPI_n2_information_transfer_rsp_data_parseFromJSON() failed [result]"); goto end; } resultVariable = OpenAPI_n2_information_transfer_result_FromString(result->valuestring); - cJSON *pws_rsp_data = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_rsp_dataJSON, "pwsRspData"); - - OpenAPI_pws_response_data_t *pws_rsp_data_local_nonprim = NULL; + pws_rsp_data = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_rsp_dataJSON, "pwsRspData"); if (pws_rsp_data) { pws_rsp_data_local_nonprim = OpenAPI_pws_response_data_parseFromJSON(pws_rsp_data); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_rsp_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(n2_information_transfer_rsp_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_n2_information_transfer_rsp_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -105,11 +118,15 @@ OpenAPI_n2_information_transfer_rsp_data_t *OpenAPI_n2_information_transfer_rsp_ n2_information_transfer_rsp_data_local_var = OpenAPI_n2_information_transfer_rsp_data_create ( resultVariable, pws_rsp_data ? pws_rsp_data_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return n2_information_transfer_rsp_data_local_var; end: + if (pws_rsp_data_local_nonprim) { + OpenAPI_pws_response_data_free(pws_rsp_data_local_nonprim); + pws_rsp_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_interface_amf_info.c b/lib/sbi/openapi/model/n2_interface_amf_info.c index 501a5b30f..d3def0bf8 100644 --- a/lib/sbi/openapi/model/n2_interface_amf_info.c +++ b/lib/sbi/openapi/model/n2_interface_amf_info.c @@ -22,25 +22,36 @@ OpenAPI_n2_interface_amf_info_t *OpenAPI_n2_interface_amf_info_create( void OpenAPI_n2_interface_amf_info_free(OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_interface_amf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(n2_interface_amf_info->ipv4_endpoint_address, node) { - ogs_free(node->data); + if (n2_interface_amf_info->ipv4_endpoint_address) { + OpenAPI_list_for_each(n2_interface_amf_info->ipv4_endpoint_address, node) { + ogs_free(node->data); + } + OpenAPI_list_free(n2_interface_amf_info->ipv4_endpoint_address); + n2_interface_amf_info->ipv4_endpoint_address = NULL; } - OpenAPI_list_free(n2_interface_amf_info->ipv4_endpoint_address); - OpenAPI_list_for_each(n2_interface_amf_info->ipv6_endpoint_address, node) { - ogs_free(node->data); + if (n2_interface_amf_info->ipv6_endpoint_address) { + OpenAPI_list_for_each(n2_interface_amf_info->ipv6_endpoint_address, node) { + ogs_free(node->data); + } + OpenAPI_list_free(n2_interface_amf_info->ipv6_endpoint_address); + n2_interface_amf_info->ipv6_endpoint_address = NULL; + } + if (n2_interface_amf_info->amf_name) { + ogs_free(n2_interface_amf_info->amf_name); + n2_interface_amf_info->amf_name = NULL; } - OpenAPI_list_free(n2_interface_amf_info->ipv6_endpoint_address); - ogs_free(n2_interface_amf_info->amf_name); ogs_free(n2_interface_amf_info); } cJSON *OpenAPI_n2_interface_amf_info_convertToJSON(OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_interface_amf_info == NULL) { ogs_error("OpenAPI_n2_interface_amf_info_convertToJSON() failed [N2InterfaceAmfInfo]"); @@ -49,35 +60,31 @@ cJSON *OpenAPI_n2_interface_amf_info_convertToJSON(OpenAPI_n2_interface_amf_info item = cJSON_CreateObject(); if (n2_interface_amf_info->ipv4_endpoint_address) { - cJSON *ipv4_endpoint_address = cJSON_AddArrayToObject(item, "ipv4EndpointAddress"); - if (ipv4_endpoint_address == NULL) { + cJSON *ipv4_endpoint_addressList = cJSON_AddArrayToObject(item, "ipv4EndpointAddress"); + if (ipv4_endpoint_addressList == NULL) { ogs_error("OpenAPI_n2_interface_amf_info_convertToJSON() failed [ipv4_endpoint_address]"); goto end; } - - OpenAPI_lnode_t *ipv4_endpoint_address_node; - OpenAPI_list_for_each(n2_interface_amf_info->ipv4_endpoint_address, ipv4_endpoint_address_node) { - if (cJSON_AddStringToObject(ipv4_endpoint_address, "", (char*)ipv4_endpoint_address_node->data) == NULL) { - ogs_error("OpenAPI_n2_interface_amf_info_convertToJSON() failed [ipv4_endpoint_address]"); - goto end; + OpenAPI_list_for_each(n2_interface_amf_info->ipv4_endpoint_address, node) { + if (cJSON_AddStringToObject(ipv4_endpoint_addressList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_n2_interface_amf_info_convertToJSON() failed [ipv4_endpoint_address]"); + goto end; + } } - } } if (n2_interface_amf_info->ipv6_endpoint_address) { - cJSON *ipv6_endpoint_address = cJSON_AddArrayToObject(item, "ipv6EndpointAddress"); - if (ipv6_endpoint_address == NULL) { + cJSON *ipv6_endpoint_addressList = cJSON_AddArrayToObject(item, "ipv6EndpointAddress"); + if (ipv6_endpoint_addressList == NULL) { ogs_error("OpenAPI_n2_interface_amf_info_convertToJSON() failed [ipv6_endpoint_address]"); goto end; } - - OpenAPI_lnode_t *ipv6_endpoint_address_node; - OpenAPI_list_for_each(n2_interface_amf_info->ipv6_endpoint_address, ipv6_endpoint_address_node) { - if (cJSON_AddStringToObject(ipv6_endpoint_address, "", (char*)ipv6_endpoint_address_node->data) == NULL) { - ogs_error("OpenAPI_n2_interface_amf_info_convertToJSON() failed [ipv6_endpoint_address]"); - goto end; + OpenAPI_list_for_each(n2_interface_amf_info->ipv6_endpoint_address, node) { + if (cJSON_AddStringToObject(ipv6_endpoint_addressList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_n2_interface_amf_info_convertToJSON() failed [ipv6_endpoint_address]"); + goto end; + } } - } } if (n2_interface_amf_info->amf_name) { @@ -94,50 +101,57 @@ end: OpenAPI_n2_interface_amf_info_t *OpenAPI_n2_interface_amf_info_parseFromJSON(cJSON *n2_interface_amf_infoJSON) { OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info_local_var = NULL; - cJSON *ipv4_endpoint_address = cJSON_GetObjectItemCaseSensitive(n2_interface_amf_infoJSON, "ipv4EndpointAddress"); - - OpenAPI_list_t *ipv4_endpoint_addressList; + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_endpoint_address = NULL; + OpenAPI_list_t *ipv4_endpoint_addressList = NULL; + cJSON *ipv6_endpoint_address = NULL; + OpenAPI_list_t *ipv6_endpoint_addressList = NULL; + cJSON *amf_name = NULL; + ipv4_endpoint_address = cJSON_GetObjectItemCaseSensitive(n2_interface_amf_infoJSON, "ipv4EndpointAddress"); if (ipv4_endpoint_address) { - cJSON *ipv4_endpoint_address_local; - if (!cJSON_IsArray(ipv4_endpoint_address)) { - ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [ipv4_endpoint_address]"); - goto end; - } - ipv4_endpoint_addressList = OpenAPI_list_create(); + cJSON *ipv4_endpoint_address_local = NULL; + if (!cJSON_IsArray(ipv4_endpoint_address)) { + ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [ipv4_endpoint_address]"); + goto end; + } - cJSON_ArrayForEach(ipv4_endpoint_address_local, ipv4_endpoint_address) { - if (!cJSON_IsString(ipv4_endpoint_address_local)) { - ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [ipv4_endpoint_address]"); - goto end; - } - OpenAPI_list_add(ipv4_endpoint_addressList, ogs_strdup(ipv4_endpoint_address_local->valuestring)); - } + ipv4_endpoint_addressList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_endpoint_address_local, ipv4_endpoint_address) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_endpoint_address_local)) { + ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [ipv4_endpoint_address]"); + goto end; + } + OpenAPI_list_add(ipv4_endpoint_addressList, ogs_strdup(ipv4_endpoint_address_local->valuestring)); + } } - cJSON *ipv6_endpoint_address = cJSON_GetObjectItemCaseSensitive(n2_interface_amf_infoJSON, "ipv6EndpointAddress"); - - OpenAPI_list_t *ipv6_endpoint_addressList; + ipv6_endpoint_address = cJSON_GetObjectItemCaseSensitive(n2_interface_amf_infoJSON, "ipv6EndpointAddress"); if (ipv6_endpoint_address) { - cJSON *ipv6_endpoint_address_local; - if (!cJSON_IsArray(ipv6_endpoint_address)) { - ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [ipv6_endpoint_address]"); - goto end; - } - ipv6_endpoint_addressList = OpenAPI_list_create(); + cJSON *ipv6_endpoint_address_local = NULL; + if (!cJSON_IsArray(ipv6_endpoint_address)) { + ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [ipv6_endpoint_address]"); + goto end; + } - cJSON_ArrayForEach(ipv6_endpoint_address_local, ipv6_endpoint_address) { - if (!cJSON_IsString(ipv6_endpoint_address_local)) { - ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [ipv6_endpoint_address]"); - goto end; - } - OpenAPI_list_add(ipv6_endpoint_addressList, ogs_strdup(ipv6_endpoint_address_local->valuestring)); - } + ipv6_endpoint_addressList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_endpoint_address_local, ipv6_endpoint_address) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_endpoint_address_local)) { + ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [ipv6_endpoint_address]"); + goto end; + } + OpenAPI_list_add(ipv6_endpoint_addressList, ogs_strdup(ipv6_endpoint_address_local->valuestring)); + } } - cJSON *amf_name = cJSON_GetObjectItemCaseSensitive(n2_interface_amf_infoJSON, "amfName"); - + amf_name = cJSON_GetObjectItemCaseSensitive(n2_interface_amf_infoJSON, "amfName"); if (amf_name) { - if (!cJSON_IsString(amf_name)) { + if (!cJSON_IsString(amf_name) && !cJSON_IsNull(amf_name)) { ogs_error("OpenAPI_n2_interface_amf_info_parseFromJSON() failed [amf_name]"); goto end; } @@ -146,11 +160,25 @@ OpenAPI_n2_interface_amf_info_t *OpenAPI_n2_interface_amf_info_parseFromJSON(cJS n2_interface_amf_info_local_var = OpenAPI_n2_interface_amf_info_create ( ipv4_endpoint_address ? ipv4_endpoint_addressList : NULL, ipv6_endpoint_address ? ipv6_endpoint_addressList : NULL, - amf_name ? ogs_strdup(amf_name->valuestring) : NULL + amf_name && !cJSON_IsNull(amf_name) ? ogs_strdup(amf_name->valuestring) : NULL ); return n2_interface_amf_info_local_var; end: + if (ipv4_endpoint_addressList) { + OpenAPI_list_for_each(ipv4_endpoint_addressList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_endpoint_addressList); + ipv4_endpoint_addressList = NULL; + } + if (ipv6_endpoint_addressList) { + OpenAPI_list_for_each(ipv6_endpoint_addressList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_endpoint_addressList); + ipv6_endpoint_addressList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_ran_information.c b/lib/sbi/openapi/model/n2_ran_information.c index 3f4044c81..db324d95b 100644 --- a/lib/sbi/openapi/model/n2_ran_information.c +++ b/lib/sbi/openapi/model/n2_ran_information.c @@ -18,17 +18,22 @@ OpenAPI_n2_ran_information_t *OpenAPI_n2_ran_information_create( void OpenAPI_n2_ran_information_free(OpenAPI_n2_ran_information_t *n2_ran_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_ran_information) { return; } - OpenAPI_lnode_t *node; - OpenAPI_n2_info_content_free(n2_ran_information->n2_info_content); + if (n2_ran_information->n2_info_content) { + OpenAPI_n2_info_content_free(n2_ran_information->n2_info_content); + n2_ran_information->n2_info_content = NULL; + } ogs_free(n2_ran_information); } cJSON *OpenAPI_n2_ran_information_convertToJSON(OpenAPI_n2_ran_information_t *n2_ran_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_ran_information == NULL) { ogs_error("OpenAPI_n2_ran_information_convertToJSON() failed [N2RanInformation]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_n2_ran_information_convertToJSON(OpenAPI_n2_ran_information_t *n2 } item = cJSON_CreateObject(); + if (!n2_ran_information->n2_info_content) { + ogs_error("OpenAPI_n2_ran_information_convertToJSON() failed [n2_info_content]"); + return NULL; + } cJSON *n2_info_content_local_JSON = OpenAPI_n2_info_content_convertToJSON(n2_ran_information->n2_info_content); if (n2_info_content_local_JSON == NULL) { ogs_error("OpenAPI_n2_ran_information_convertToJSON() failed [n2_info_content]"); @@ -54,13 +63,14 @@ end: OpenAPI_n2_ran_information_t *OpenAPI_n2_ran_information_parseFromJSON(cJSON *n2_ran_informationJSON) { OpenAPI_n2_ran_information_t *n2_ran_information_local_var = NULL; - cJSON *n2_info_content = cJSON_GetObjectItemCaseSensitive(n2_ran_informationJSON, "n2InfoContent"); + OpenAPI_lnode_t *node = NULL; + cJSON *n2_info_content = NULL; + OpenAPI_n2_info_content_t *n2_info_content_local_nonprim = NULL; + n2_info_content = cJSON_GetObjectItemCaseSensitive(n2_ran_informationJSON, "n2InfoContent"); if (!n2_info_content) { ogs_error("OpenAPI_n2_ran_information_parseFromJSON() failed [n2_info_content]"); goto end; } - - OpenAPI_n2_info_content_t *n2_info_content_local_nonprim = NULL; n2_info_content_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(n2_info_content); n2_ran_information_local_var = OpenAPI_n2_ran_information_create ( @@ -69,6 +79,10 @@ OpenAPI_n2_ran_information_t *OpenAPI_n2_ran_information_parseFromJSON(cJSON *n2 return n2_ran_information_local_var; end: + if (n2_info_content_local_nonprim) { + OpenAPI_n2_info_content_free(n2_info_content_local_nonprim); + n2_info_content_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n2_sm_information.c b/lib/sbi/openapi/model/n2_sm_information.c index f50657f38..c5fbe911c 100644 --- a/lib/sbi/openapi/model/n2_sm_information.c +++ b/lib/sbi/openapi/model/n2_sm_information.c @@ -30,20 +30,34 @@ OpenAPI_n2_sm_information_t *OpenAPI_n2_sm_information_create( void OpenAPI_n2_sm_information_free(OpenAPI_n2_sm_information_t *n2_sm_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n2_sm_information) { return; } - OpenAPI_lnode_t *node; - OpenAPI_n2_info_content_free(n2_sm_information->n2_info_content); - OpenAPI_snssai_free(n2_sm_information->s_nssai); - OpenAPI_snssai_free(n2_sm_information->home_plmn_snssai); - OpenAPI_snssai_free(n2_sm_information->iwk_snssai); + if (n2_sm_information->n2_info_content) { + OpenAPI_n2_info_content_free(n2_sm_information->n2_info_content); + n2_sm_information->n2_info_content = NULL; + } + if (n2_sm_information->s_nssai) { + OpenAPI_snssai_free(n2_sm_information->s_nssai); + n2_sm_information->s_nssai = NULL; + } + if (n2_sm_information->home_plmn_snssai) { + OpenAPI_snssai_free(n2_sm_information->home_plmn_snssai); + n2_sm_information->home_plmn_snssai = NULL; + } + if (n2_sm_information->iwk_snssai) { + OpenAPI_snssai_free(n2_sm_information->iwk_snssai); + n2_sm_information->iwk_snssai = NULL; + } ogs_free(n2_sm_information); } cJSON *OpenAPI_n2_sm_information_convertToJSON(OpenAPI_n2_sm_information_t *n2_sm_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n2_sm_information == NULL) { ogs_error("OpenAPI_n2_sm_information_convertToJSON() failed [N2SmInformation]"); @@ -122,47 +136,48 @@ end: OpenAPI_n2_sm_information_t *OpenAPI_n2_sm_information_parseFromJSON(cJSON *n2_sm_informationJSON) { OpenAPI_n2_sm_information_t *n2_sm_information_local_var = NULL; - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "pduSessionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_id = NULL; + cJSON *n2_info_content = NULL; + OpenAPI_n2_info_content_t *n2_info_content_local_nonprim = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *home_plmn_snssai = NULL; + OpenAPI_snssai_t *home_plmn_snssai_local_nonprim = NULL; + cJSON *iwk_snssai = NULL; + OpenAPI_snssai_t *iwk_snssai_local_nonprim = NULL; + cJSON *subject_to_ho = NULL; + pdu_session_id = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "pduSessionId"); if (!pdu_session_id) { ogs_error("OpenAPI_n2_sm_information_parseFromJSON() failed [pdu_session_id]"); goto end; } - if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_n2_sm_information_parseFromJSON() failed [pdu_session_id]"); goto end; } - cJSON *n2_info_content = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "n2InfoContent"); - - OpenAPI_n2_info_content_t *n2_info_content_local_nonprim = NULL; + n2_info_content = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "n2InfoContent"); if (n2_info_content) { n2_info_content_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(n2_info_content); } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "sNssai"); - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "sNssai"); if (s_nssai) { s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); } - cJSON *home_plmn_snssai = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "homePlmnSnssai"); - - OpenAPI_snssai_t *home_plmn_snssai_local_nonprim = NULL; + home_plmn_snssai = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "homePlmnSnssai"); if (home_plmn_snssai) { home_plmn_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(home_plmn_snssai); } - cJSON *iwk_snssai = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "iwkSnssai"); - - OpenAPI_snssai_t *iwk_snssai_local_nonprim = NULL; + iwk_snssai = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "iwkSnssai"); if (iwk_snssai) { iwk_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(iwk_snssai); } - cJSON *subject_to_ho = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "subjectToHo"); - + subject_to_ho = cJSON_GetObjectItemCaseSensitive(n2_sm_informationJSON, "subjectToHo"); if (subject_to_ho) { if (!cJSON_IsBool(subject_to_ho)) { ogs_error("OpenAPI_n2_sm_information_parseFromJSON() failed [subject_to_ho]"); @@ -183,6 +198,22 @@ OpenAPI_n2_sm_information_t *OpenAPI_n2_sm_information_parseFromJSON(cJSON *n2_s return n2_sm_information_local_var; end: + if (n2_info_content_local_nonprim) { + OpenAPI_n2_info_content_free(n2_info_content_local_nonprim); + n2_info_content_local_nonprim = NULL; + } + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (home_plmn_snssai_local_nonprim) { + OpenAPI_snssai_free(home_plmn_snssai_local_nonprim); + home_plmn_snssai_local_nonprim = NULL; + } + if (iwk_snssai_local_nonprim) { + OpenAPI_snssai_free(iwk_snssai_local_nonprim); + iwk_snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n3ga_location.c b/lib/sbi/openapi/model/n3ga_location.c index acac8a95c..ad79fe725 100644 --- a/lib/sbi/openapi/model/n3ga_location.c +++ b/lib/sbi/openapi/model/n3ga_location.c @@ -40,25 +40,54 @@ OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_create( void OpenAPI_n3ga_location_free(OpenAPI_n3ga_location_t *n3ga_location) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n3ga_location) { return; } - OpenAPI_lnode_t *node; - OpenAPI_tai_free(n3ga_location->n3gpp_tai); - ogs_free(n3ga_location->n3_iwf_id); - ogs_free(n3ga_location->ue_ipv4_addr); - ogs_free(n3ga_location->ue_ipv6_addr); - OpenAPI_tnap_id_free(n3ga_location->tnap_id); - OpenAPI_twap_id_free(n3ga_location->twap_id); - OpenAPI_hfc_node_id_free(n3ga_location->hfc_node_id); - ogs_free(n3ga_location->gli); - ogs_free(n3ga_location->gci); + if (n3ga_location->n3gpp_tai) { + OpenAPI_tai_free(n3ga_location->n3gpp_tai); + n3ga_location->n3gpp_tai = NULL; + } + if (n3ga_location->n3_iwf_id) { + ogs_free(n3ga_location->n3_iwf_id); + n3ga_location->n3_iwf_id = NULL; + } + if (n3ga_location->ue_ipv4_addr) { + ogs_free(n3ga_location->ue_ipv4_addr); + n3ga_location->ue_ipv4_addr = NULL; + } + if (n3ga_location->ue_ipv6_addr) { + ogs_free(n3ga_location->ue_ipv6_addr); + n3ga_location->ue_ipv6_addr = NULL; + } + if (n3ga_location->tnap_id) { + OpenAPI_tnap_id_free(n3ga_location->tnap_id); + n3ga_location->tnap_id = NULL; + } + if (n3ga_location->twap_id) { + OpenAPI_twap_id_free(n3ga_location->twap_id); + n3ga_location->twap_id = NULL; + } + if (n3ga_location->hfc_node_id) { + OpenAPI_hfc_node_id_free(n3ga_location->hfc_node_id); + n3ga_location->hfc_node_id = NULL; + } + if (n3ga_location->gli) { + ogs_free(n3ga_location->gli); + n3ga_location->gli = NULL; + } + if (n3ga_location->gci) { + ogs_free(n3ga_location->gci); + n3ga_location->gci = NULL; + } ogs_free(n3ga_location); } cJSON *OpenAPI_n3ga_location_convertToJSON(OpenAPI_n3ga_location_t *n3ga_location) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n3ga_location == NULL) { ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [N3gaLocation]"); @@ -153,7 +182,7 @@ cJSON *OpenAPI_n3ga_location_convertToJSON(OpenAPI_n3ga_location_t *n3ga_locatio } } - if (n3ga_location->w5gban_line_type) { + if (n3ga_location->w5gban_line_type != OpenAPI_line_type_NULL) { if (cJSON_AddStringToObject(item, "w5gbanLineType", OpenAPI_line_type_ToString(n3ga_location->w5gban_line_type)) == NULL) { ogs_error("OpenAPI_n3ga_location_convertToJSON() failed [w5gban_line_type]"); goto end; @@ -174,42 +203,53 @@ end: OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_parseFromJSON(cJSON *n3ga_locationJSON) { OpenAPI_n3ga_location_t *n3ga_location_local_var = NULL; - cJSON *n3gpp_tai = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "n3gppTai"); - + OpenAPI_lnode_t *node = NULL; + cJSON *n3gpp_tai = NULL; OpenAPI_tai_t *n3gpp_tai_local_nonprim = NULL; + cJSON *n3_iwf_id = NULL; + cJSON *ue_ipv4_addr = NULL; + cJSON *ue_ipv6_addr = NULL; + cJSON *port_number = NULL; + cJSON *tnap_id = NULL; + OpenAPI_tnap_id_t *tnap_id_local_nonprim = NULL; + cJSON *twap_id = NULL; + OpenAPI_twap_id_t *twap_id_local_nonprim = NULL; + cJSON *hfc_node_id = NULL; + OpenAPI_hfc_node_id_t *hfc_node_id_local_nonprim = NULL; + cJSON *gli = NULL; + cJSON *w5gban_line_type = NULL; + OpenAPI_line_type_e w5gban_line_typeVariable = 0; + cJSON *gci = NULL; + n3gpp_tai = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "n3gppTai"); if (n3gpp_tai) { n3gpp_tai_local_nonprim = OpenAPI_tai_parseFromJSON(n3gpp_tai); } - cJSON *n3_iwf_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "n3IwfId"); - + n3_iwf_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "n3IwfId"); if (n3_iwf_id) { - if (!cJSON_IsString(n3_iwf_id)) { + if (!cJSON_IsString(n3_iwf_id) && !cJSON_IsNull(n3_iwf_id)) { ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [n3_iwf_id]"); goto end; } } - cJSON *ue_ipv4_addr = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "ueIpv4Addr"); - + ue_ipv4_addr = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "ueIpv4Addr"); if (ue_ipv4_addr) { - if (!cJSON_IsString(ue_ipv4_addr)) { + if (!cJSON_IsString(ue_ipv4_addr) && !cJSON_IsNull(ue_ipv4_addr)) { ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [ue_ipv4_addr]"); goto end; } } - cJSON *ue_ipv6_addr = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "ueIpv6Addr"); - + ue_ipv6_addr = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "ueIpv6Addr"); if (ue_ipv6_addr) { - if (!cJSON_IsString(ue_ipv6_addr)) { + if (!cJSON_IsString(ue_ipv6_addr) && !cJSON_IsNull(ue_ipv6_addr)) { ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [ue_ipv6_addr]"); goto end; } } - cJSON *port_number = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "portNumber"); - + port_number = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "portNumber"); if (port_number) { if (!cJSON_IsNumber(port_number)) { ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [port_number]"); @@ -217,39 +257,30 @@ OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_parseFromJSON(cJSON *n3ga_locatio } } - cJSON *tnap_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "tnapId"); - - OpenAPI_tnap_id_t *tnap_id_local_nonprim = NULL; + tnap_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "tnapId"); if (tnap_id) { tnap_id_local_nonprim = OpenAPI_tnap_id_parseFromJSON(tnap_id); } - cJSON *twap_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "twapId"); - - OpenAPI_twap_id_t *twap_id_local_nonprim = NULL; + twap_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "twapId"); if (twap_id) { twap_id_local_nonprim = OpenAPI_twap_id_parseFromJSON(twap_id); } - cJSON *hfc_node_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "hfcNodeId"); - - OpenAPI_hfc_node_id_t *hfc_node_id_local_nonprim = NULL; + hfc_node_id = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "hfcNodeId"); if (hfc_node_id) { hfc_node_id_local_nonprim = OpenAPI_hfc_node_id_parseFromJSON(hfc_node_id); } - cJSON *gli = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "gli"); - + gli = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "gli"); if (gli) { - if (!cJSON_IsString(gli)) { + if (!cJSON_IsString(gli) && !cJSON_IsNull(gli)) { ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [gli]"); goto end; } } - cJSON *w5gban_line_type = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "w5gbanLineType"); - - OpenAPI_line_type_e w5gban_line_typeVariable; + w5gban_line_type = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "w5gbanLineType"); if (w5gban_line_type) { if (!cJSON_IsString(w5gban_line_type)) { ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [w5gban_line_type]"); @@ -258,10 +289,9 @@ OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_parseFromJSON(cJSON *n3ga_locatio w5gban_line_typeVariable = OpenAPI_line_type_FromString(w5gban_line_type->valuestring); } - cJSON *gci = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "gci"); - + gci = cJSON_GetObjectItemCaseSensitive(n3ga_locationJSON, "gci"); if (gci) { - if (!cJSON_IsString(gci)) { + if (!cJSON_IsString(gci) && !cJSON_IsNull(gci)) { ogs_error("OpenAPI_n3ga_location_parseFromJSON() failed [gci]"); goto end; } @@ -269,21 +299,37 @@ OpenAPI_n3ga_location_t *OpenAPI_n3ga_location_parseFromJSON(cJSON *n3ga_locatio n3ga_location_local_var = OpenAPI_n3ga_location_create ( n3gpp_tai ? n3gpp_tai_local_nonprim : NULL, - n3_iwf_id ? ogs_strdup(n3_iwf_id->valuestring) : NULL, - ue_ipv4_addr ? ogs_strdup(ue_ipv4_addr->valuestring) : NULL, - ue_ipv6_addr ? ogs_strdup(ue_ipv6_addr->valuestring) : NULL, + n3_iwf_id && !cJSON_IsNull(n3_iwf_id) ? ogs_strdup(n3_iwf_id->valuestring) : NULL, + ue_ipv4_addr && !cJSON_IsNull(ue_ipv4_addr) ? ogs_strdup(ue_ipv4_addr->valuestring) : NULL, + ue_ipv6_addr && !cJSON_IsNull(ue_ipv6_addr) ? ogs_strdup(ue_ipv6_addr->valuestring) : NULL, port_number ? true : false, port_number ? port_number->valuedouble : 0, tnap_id ? tnap_id_local_nonprim : NULL, twap_id ? twap_id_local_nonprim : NULL, hfc_node_id ? hfc_node_id_local_nonprim : NULL, - gli ? ogs_strdup(gli->valuestring) : NULL, + gli && !cJSON_IsNull(gli) ? ogs_strdup(gli->valuestring) : NULL, w5gban_line_type ? w5gban_line_typeVariable : 0, - gci ? ogs_strdup(gci->valuestring) : NULL + gci && !cJSON_IsNull(gci) ? ogs_strdup(gci->valuestring) : NULL ); return n3ga_location_local_var; end: + if (n3gpp_tai_local_nonprim) { + OpenAPI_tai_free(n3gpp_tai_local_nonprim); + n3gpp_tai_local_nonprim = NULL; + } + if (tnap_id_local_nonprim) { + OpenAPI_tnap_id_free(tnap_id_local_nonprim); + tnap_id_local_nonprim = NULL; + } + if (twap_id_local_nonprim) { + OpenAPI_twap_id_free(twap_id_local_nonprim); + twap_id_local_nonprim = NULL; + } + if (hfc_node_id_local_nonprim) { + OpenAPI_hfc_node_id_free(hfc_node_id_local_nonprim); + hfc_node_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/n4_information.c b/lib/sbi/openapi/model/n4_information.c index bab866717..999c3273f 100644 --- a/lib/sbi/openapi/model/n4_information.c +++ b/lib/sbi/openapi/model/n4_information.c @@ -22,18 +22,26 @@ OpenAPI_n4_information_t *OpenAPI_n4_information_create( void OpenAPI_n4_information_free(OpenAPI_n4_information_t *n4_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == n4_information) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ref_to_binary_data_free(n4_information->n4_message_payload); - OpenAPI_dnai_information_free(n4_information->n4_dnai_info); + if (n4_information->n4_message_payload) { + OpenAPI_ref_to_binary_data_free(n4_information->n4_message_payload); + n4_information->n4_message_payload = NULL; + } + if (n4_information->n4_dnai_info) { + OpenAPI_dnai_information_free(n4_information->n4_dnai_info); + n4_information->n4_dnai_info = NULL; + } ogs_free(n4_information); } cJSON *OpenAPI_n4_information_convertToJSON(OpenAPI_n4_information_t *n4_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (n4_information == NULL) { ogs_error("OpenAPI_n4_information_convertToJSON() failed [N4Information]"); @@ -41,11 +49,19 @@ cJSON *OpenAPI_n4_information_convertToJSON(OpenAPI_n4_information_t *n4_informa } item = cJSON_CreateObject(); + if (n4_information->n4_message_type == OpenAPI_n4_message_type_NULL) { + ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n4MessageType", OpenAPI_n4_message_type_ToString(n4_information->n4_message_type)) == NULL) { ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_type]"); goto end; } + if (!n4_information->n4_message_payload) { + ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_payload]"); + return NULL; + } cJSON *n4_message_payload_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(n4_information->n4_message_payload); if (n4_message_payload_local_JSON == NULL) { ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_payload]"); @@ -77,31 +93,32 @@ end: OpenAPI_n4_information_t *OpenAPI_n4_information_parseFromJSON(cJSON *n4_informationJSON) { OpenAPI_n4_information_t *n4_information_local_var = NULL; - cJSON *n4_message_type = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessageType"); + OpenAPI_lnode_t *node = NULL; + cJSON *n4_message_type = NULL; + OpenAPI_n4_message_type_e n4_message_typeVariable = 0; + cJSON *n4_message_payload = NULL; + OpenAPI_ref_to_binary_data_t *n4_message_payload_local_nonprim = NULL; + cJSON *n4_dnai_info = NULL; + OpenAPI_dnai_information_t *n4_dnai_info_local_nonprim = NULL; + n4_message_type = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessageType"); if (!n4_message_type) { ogs_error("OpenAPI_n4_information_parseFromJSON() failed [n4_message_type]"); goto end; } - - OpenAPI_n4_message_type_e n4_message_typeVariable; if (!cJSON_IsString(n4_message_type)) { ogs_error("OpenAPI_n4_information_parseFromJSON() failed [n4_message_type]"); goto end; } n4_message_typeVariable = OpenAPI_n4_message_type_FromString(n4_message_type->valuestring); - cJSON *n4_message_payload = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessagePayload"); + n4_message_payload = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessagePayload"); if (!n4_message_payload) { ogs_error("OpenAPI_n4_information_parseFromJSON() failed [n4_message_payload]"); goto end; } - - OpenAPI_ref_to_binary_data_t *n4_message_payload_local_nonprim = NULL; n4_message_payload_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n4_message_payload); - cJSON *n4_dnai_info = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4DnaiInfo"); - - OpenAPI_dnai_information_t *n4_dnai_info_local_nonprim = NULL; + n4_dnai_info = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4DnaiInfo"); if (n4_dnai_info) { n4_dnai_info_local_nonprim = OpenAPI_dnai_information_parseFromJSON(n4_dnai_info); } @@ -114,6 +131,14 @@ OpenAPI_n4_information_t *OpenAPI_n4_information_parseFromJSON(cJSON *n4_informa return n4_information_local_var; end: + if (n4_message_payload_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n4_message_payload_local_nonprim); + n4_message_payload_local_nonprim = NULL; + } + if (n4_dnai_info_local_nonprim) { + OpenAPI_dnai_information_free(n4_dnai_info_local_nonprim); + n4_dnai_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nas_security_mode.c b/lib/sbi/openapi/model/nas_security_mode.c index 18a564e69..b6da85c87 100644 --- a/lib/sbi/openapi/model/nas_security_mode.c +++ b/lib/sbi/openapi/model/nas_security_mode.c @@ -20,16 +20,18 @@ OpenAPI_nas_security_mode_t *OpenAPI_nas_security_mode_create( void OpenAPI_nas_security_mode_free(OpenAPI_nas_security_mode_t *nas_security_mode) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nas_security_mode) { return; } - OpenAPI_lnode_t *node; ogs_free(nas_security_mode); } cJSON *OpenAPI_nas_security_mode_convertToJSON(OpenAPI_nas_security_mode_t *nas_security_mode) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nas_security_mode == NULL) { ogs_error("OpenAPI_nas_security_mode_convertToJSON() failed [NasSecurityMode]"); @@ -37,11 +39,19 @@ cJSON *OpenAPI_nas_security_mode_convertToJSON(OpenAPI_nas_security_mode_t *nas_ } item = cJSON_CreateObject(); + if (nas_security_mode->integrity_algorithm == OpenAPI_integrity_algorithm_NULL) { + ogs_error("OpenAPI_nas_security_mode_convertToJSON() failed [integrity_algorithm]"); + return NULL; + } if (cJSON_AddStringToObject(item, "integrityAlgorithm", OpenAPI_integrity_algorithm_ToString(nas_security_mode->integrity_algorithm)) == NULL) { ogs_error("OpenAPI_nas_security_mode_convertToJSON() failed [integrity_algorithm]"); goto end; } + if (nas_security_mode->ciphering_algorithm == OpenAPI_ciphering_algorithm_NULL) { + ogs_error("OpenAPI_nas_security_mode_convertToJSON() failed [ciphering_algorithm]"); + return NULL; + } if (cJSON_AddStringToObject(item, "cipheringAlgorithm", OpenAPI_ciphering_algorithm_ToString(nas_security_mode->ciphering_algorithm)) == NULL) { ogs_error("OpenAPI_nas_security_mode_convertToJSON() failed [ciphering_algorithm]"); goto end; @@ -54,26 +64,27 @@ end: OpenAPI_nas_security_mode_t *OpenAPI_nas_security_mode_parseFromJSON(cJSON *nas_security_modeJSON) { OpenAPI_nas_security_mode_t *nas_security_mode_local_var = NULL; - cJSON *integrity_algorithm = cJSON_GetObjectItemCaseSensitive(nas_security_modeJSON, "integrityAlgorithm"); + OpenAPI_lnode_t *node = NULL; + cJSON *integrity_algorithm = NULL; + OpenAPI_integrity_algorithm_e integrity_algorithmVariable = 0; + cJSON *ciphering_algorithm = NULL; + OpenAPI_ciphering_algorithm_e ciphering_algorithmVariable = 0; + integrity_algorithm = cJSON_GetObjectItemCaseSensitive(nas_security_modeJSON, "integrityAlgorithm"); if (!integrity_algorithm) { ogs_error("OpenAPI_nas_security_mode_parseFromJSON() failed [integrity_algorithm]"); goto end; } - - OpenAPI_integrity_algorithm_e integrity_algorithmVariable; if (!cJSON_IsString(integrity_algorithm)) { ogs_error("OpenAPI_nas_security_mode_parseFromJSON() failed [integrity_algorithm]"); goto end; } integrity_algorithmVariable = OpenAPI_integrity_algorithm_FromString(integrity_algorithm->valuestring); - cJSON *ciphering_algorithm = cJSON_GetObjectItemCaseSensitive(nas_security_modeJSON, "cipheringAlgorithm"); + ciphering_algorithm = cJSON_GetObjectItemCaseSensitive(nas_security_modeJSON, "cipheringAlgorithm"); if (!ciphering_algorithm) { ogs_error("OpenAPI_nas_security_mode_parseFromJSON() failed [ciphering_algorithm]"); goto end; } - - OpenAPI_ciphering_algorithm_e ciphering_algorithmVariable; if (!cJSON_IsString(ciphering_algorithm)) { ogs_error("OpenAPI_nas_security_mode_parseFromJSON() failed [ciphering_algorithm]"); goto end; diff --git a/lib/sbi/openapi/model/ncgi.c b/lib/sbi/openapi/model/ncgi.c index 13657ec4e..fc8fe2b5d 100644 --- a/lib/sbi/openapi/model/ncgi.c +++ b/lib/sbi/openapi/model/ncgi.c @@ -22,19 +22,30 @@ OpenAPI_ncgi_t *OpenAPI_ncgi_create( void OpenAPI_ncgi_free(OpenAPI_ncgi_t *ncgi) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ncgi) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(ncgi->plmn_id); - ogs_free(ncgi->nr_cell_id); - ogs_free(ncgi->nid); + if (ncgi->plmn_id) { + OpenAPI_plmn_id_free(ncgi->plmn_id); + ncgi->plmn_id = NULL; + } + if (ncgi->nr_cell_id) { + ogs_free(ncgi->nr_cell_id); + ncgi->nr_cell_id = NULL; + } + if (ncgi->nid) { + ogs_free(ncgi->nid); + ncgi->nid = NULL; + } ogs_free(ncgi); } cJSON *OpenAPI_ncgi_convertToJSON(OpenAPI_ncgi_t *ncgi) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ncgi == NULL) { ogs_error("OpenAPI_ncgi_convertToJSON() failed [Ncgi]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_ncgi_convertToJSON(OpenAPI_ncgi_t *ncgi) } item = cJSON_CreateObject(); + if (!ncgi->plmn_id) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(ncgi->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_ncgi_convertToJSON() failed [plmn_id]"); @@ -53,6 +68,10 @@ cJSON *OpenAPI_ncgi_convertToJSON(OpenAPI_ncgi_t *ncgi) goto end; } + if (!ncgi->nr_cell_id) { + ogs_error("OpenAPI_ncgi_convertToJSON() failed [nr_cell_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nrCellId", ncgi->nr_cell_id) == NULL) { ogs_error("OpenAPI_ncgi_convertToJSON() failed [nr_cell_id]"); goto end; @@ -72,30 +91,31 @@ end: OpenAPI_ncgi_t *OpenAPI_ncgi_parseFromJSON(cJSON *ncgiJSON) { OpenAPI_ncgi_t *ncgi_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *nr_cell_id = NULL; + cJSON *nid = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_ncgi_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *nr_cell_id = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "nrCellId"); + nr_cell_id = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "nrCellId"); if (!nr_cell_id) { ogs_error("OpenAPI_ncgi_parseFromJSON() failed [nr_cell_id]"); goto end; } - if (!cJSON_IsString(nr_cell_id)) { ogs_error("OpenAPI_ncgi_parseFromJSON() failed [nr_cell_id]"); goto end; } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(ncgiJSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_ncgi_parseFromJSON() failed [nid]"); goto end; } @@ -104,11 +124,15 @@ OpenAPI_ncgi_t *OpenAPI_ncgi_parseFromJSON(cJSON *ncgiJSON) ncgi_local_var = OpenAPI_ncgi_create ( plmn_id_local_nonprim, ogs_strdup(nr_cell_id->valuestring), - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return ncgi_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ncgi_1.c b/lib/sbi/openapi/model/ncgi_1.c index d7ebf5d22..a0e3e6edb 100644 --- a/lib/sbi/openapi/model/ncgi_1.c +++ b/lib/sbi/openapi/model/ncgi_1.c @@ -22,19 +22,30 @@ OpenAPI_ncgi_1_t *OpenAPI_ncgi_1_create( void OpenAPI_ncgi_1_free(OpenAPI_ncgi_1_t *ncgi_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ncgi_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_1_free(ncgi_1->plmn_id); - ogs_free(ncgi_1->nr_cell_id); - ogs_free(ncgi_1->nid); + if (ncgi_1->plmn_id) { + OpenAPI_plmn_id_1_free(ncgi_1->plmn_id); + ncgi_1->plmn_id = NULL; + } + if (ncgi_1->nr_cell_id) { + ogs_free(ncgi_1->nr_cell_id); + ncgi_1->nr_cell_id = NULL; + } + if (ncgi_1->nid) { + ogs_free(ncgi_1->nid); + ncgi_1->nid = NULL; + } ogs_free(ncgi_1); } cJSON *OpenAPI_ncgi_1_convertToJSON(OpenAPI_ncgi_1_t *ncgi_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ncgi_1 == NULL) { ogs_error("OpenAPI_ncgi_1_convertToJSON() failed [Ncgi_1]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_ncgi_1_convertToJSON(OpenAPI_ncgi_1_t *ncgi_1) } item = cJSON_CreateObject(); + if (!ncgi_1->plmn_id) { + ogs_error("OpenAPI_ncgi_1_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_1_convertToJSON(ncgi_1->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_ncgi_1_convertToJSON() failed [plmn_id]"); @@ -53,6 +68,10 @@ cJSON *OpenAPI_ncgi_1_convertToJSON(OpenAPI_ncgi_1_t *ncgi_1) goto end; } + if (!ncgi_1->nr_cell_id) { + ogs_error("OpenAPI_ncgi_1_convertToJSON() failed [nr_cell_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nrCellId", ncgi_1->nr_cell_id) == NULL) { ogs_error("OpenAPI_ncgi_1_convertToJSON() failed [nr_cell_id]"); goto end; @@ -72,30 +91,31 @@ end: OpenAPI_ncgi_1_t *OpenAPI_ncgi_1_parseFromJSON(cJSON *ncgi_1JSON) { OpenAPI_ncgi_1_t *ncgi_1_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(ncgi_1JSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + cJSON *nr_cell_id = NULL; + cJSON *nid = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(ncgi_1JSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_ncgi_1_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); - cJSON *nr_cell_id = cJSON_GetObjectItemCaseSensitive(ncgi_1JSON, "nrCellId"); + nr_cell_id = cJSON_GetObjectItemCaseSensitive(ncgi_1JSON, "nrCellId"); if (!nr_cell_id) { ogs_error("OpenAPI_ncgi_1_parseFromJSON() failed [nr_cell_id]"); goto end; } - if (!cJSON_IsString(nr_cell_id)) { ogs_error("OpenAPI_ncgi_1_parseFromJSON() failed [nr_cell_id]"); goto end; } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(ncgi_1JSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(ncgi_1JSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_ncgi_1_parseFromJSON() failed [nid]"); goto end; } @@ -104,11 +124,15 @@ OpenAPI_ncgi_1_t *OpenAPI_ncgi_1_parseFromJSON(cJSON *ncgi_1JSON) ncgi_1_local_var = OpenAPI_ncgi_1_create ( plmn_id_local_nonprim, ogs_strdup(nr_cell_id->valuestring), - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return ncgi_1_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nef_cond.c b/lib/sbi/openapi/model/nef_cond.c index 0e8be859f..f1c9174a0 100644 --- a/lib/sbi/openapi/model/nef_cond.c +++ b/lib/sbi/openapi/model/nef_cond.c @@ -53,34 +53,54 @@ OpenAPI_nef_cond_t *OpenAPI_nef_cond_create( void OpenAPI_nef_cond_free(OpenAPI_nef_cond_t *nef_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nef_cond) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(nef_cond->af_events); - OpenAPI_list_for_each(nef_cond->snssai_list, node) { - OpenAPI_snssai_free(node->data); + if (nef_cond->af_events) { + OpenAPI_list_free(nef_cond->af_events); + nef_cond->af_events = NULL; } - OpenAPI_list_free(nef_cond->snssai_list); - OpenAPI_pfd_data_free(nef_cond->pfd_data); - OpenAPI_list_for_each(nef_cond->gpsi_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (nef_cond->snssai_list) { + OpenAPI_list_for_each(nef_cond->snssai_list, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nef_cond->snssai_list); + nef_cond->snssai_list = NULL; } - OpenAPI_list_free(nef_cond->gpsi_ranges); - OpenAPI_list_for_each(nef_cond->external_group_identifiers_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (nef_cond->pfd_data) { + OpenAPI_pfd_data_free(nef_cond->pfd_data); + nef_cond->pfd_data = NULL; } - OpenAPI_list_free(nef_cond->external_group_identifiers_ranges); - OpenAPI_list_for_each(nef_cond->served_fqdn_list, node) { - ogs_free(node->data); + if (nef_cond->gpsi_ranges) { + OpenAPI_list_for_each(nef_cond->gpsi_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(nef_cond->gpsi_ranges); + nef_cond->gpsi_ranges = NULL; + } + if (nef_cond->external_group_identifiers_ranges) { + OpenAPI_list_for_each(nef_cond->external_group_identifiers_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(nef_cond->external_group_identifiers_ranges); + nef_cond->external_group_identifiers_ranges = NULL; + } + if (nef_cond->served_fqdn_list) { + OpenAPI_list_for_each(nef_cond->served_fqdn_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nef_cond->served_fqdn_list); + nef_cond->served_fqdn_list = NULL; } - OpenAPI_list_free(nef_cond->served_fqdn_list); ogs_free(nef_cond); } cJSON *OpenAPI_nef_cond_convertToJSON(OpenAPI_nef_cond_t *nef_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nef_cond == NULL) { ogs_error("OpenAPI_nef_cond_convertToJSON() failed [NefCond]"); @@ -88,20 +108,23 @@ cJSON *OpenAPI_nef_cond_convertToJSON(OpenAPI_nef_cond_t *nef_cond) } item = cJSON_CreateObject(); + if (nef_cond->condition_type == OpenAPI_nef_cond_CONDITIONTYPE_NULL) { + ogs_error("OpenAPI_nef_cond_convertToJSON() failed [condition_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "conditionType", OpenAPI_condition_typenef_cond_ToString(nef_cond->condition_type)) == NULL) { ogs_error("OpenAPI_nef_cond_convertToJSON() failed [condition_type]"); goto end; } - if (nef_cond->af_events) { - cJSON *af_events = cJSON_AddArrayToObject(item, "afEvents"); - if (af_events == NULL) { + if (nef_cond->af_events != OpenAPI_af_event_NULL) { + cJSON *af_eventsList = cJSON_AddArrayToObject(item, "afEvents"); + if (af_eventsList == NULL) { ogs_error("OpenAPI_nef_cond_convertToJSON() failed [af_events]"); goto end; } - OpenAPI_lnode_t *af_events_node; - OpenAPI_list_for_each(nef_cond->af_events, af_events_node) { - if (cJSON_AddStringToObject(af_events, "", OpenAPI_af_event_ToString((intptr_t)af_events_node->data)) == NULL) { + OpenAPI_list_for_each(nef_cond->af_events, node) { + if (cJSON_AddStringToObject(af_eventsList, "", OpenAPI_af_event_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_nef_cond_convertToJSON() failed [af_events]"); goto end; } @@ -114,17 +137,13 @@ cJSON *OpenAPI_nef_cond_convertToJSON(OpenAPI_nef_cond_t *nef_cond) ogs_error("OpenAPI_nef_cond_convertToJSON() failed [snssai_list]"); goto end; } - - OpenAPI_lnode_t *snssai_list_node; - if (nef_cond->snssai_list) { - OpenAPI_list_for_each(nef_cond->snssai_list, snssai_list_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nef_cond_convertToJSON() failed [snssai_list]"); - goto end; - } - cJSON_AddItemToArray(snssai_listList, itemLocal); + OpenAPI_list_for_each(nef_cond->snssai_list, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nef_cond_convertToJSON() failed [snssai_list]"); + goto end; } + cJSON_AddItemToArray(snssai_listList, itemLocal); } } @@ -147,17 +166,13 @@ cJSON *OpenAPI_nef_cond_convertToJSON(OpenAPI_nef_cond_t *nef_cond) ogs_error("OpenAPI_nef_cond_convertToJSON() failed [gpsi_ranges]"); goto end; } - - OpenAPI_lnode_t *gpsi_ranges_node; - if (nef_cond->gpsi_ranges) { - OpenAPI_list_for_each(nef_cond->gpsi_ranges, gpsi_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(gpsi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nef_cond_convertToJSON() failed [gpsi_ranges]"); - goto end; - } - cJSON_AddItemToArray(gpsi_rangesList, itemLocal); + OpenAPI_list_for_each(nef_cond->gpsi_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nef_cond_convertToJSON() failed [gpsi_ranges]"); + goto end; } + cJSON_AddItemToArray(gpsi_rangesList, itemLocal); } } @@ -167,34 +182,28 @@ cJSON *OpenAPI_nef_cond_convertToJSON(OpenAPI_nef_cond_t *nef_cond) ogs_error("OpenAPI_nef_cond_convertToJSON() failed [external_group_identifiers_ranges]"); goto end; } - - OpenAPI_lnode_t *external_group_identifiers_ranges_node; - if (nef_cond->external_group_identifiers_ranges) { - OpenAPI_list_for_each(nef_cond->external_group_identifiers_ranges, external_group_identifiers_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(external_group_identifiers_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nef_cond_convertToJSON() failed [external_group_identifiers_ranges]"); - goto end; - } - cJSON_AddItemToArray(external_group_identifiers_rangesList, itemLocal); + OpenAPI_list_for_each(nef_cond->external_group_identifiers_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nef_cond_convertToJSON() failed [external_group_identifiers_ranges]"); + goto end; } + cJSON_AddItemToArray(external_group_identifiers_rangesList, itemLocal); } } if (nef_cond->served_fqdn_list) { - cJSON *served_fqdn_list = cJSON_AddArrayToObject(item, "servedFqdnList"); - if (served_fqdn_list == NULL) { + cJSON *served_fqdn_listList = cJSON_AddArrayToObject(item, "servedFqdnList"); + if (served_fqdn_listList == NULL) { ogs_error("OpenAPI_nef_cond_convertToJSON() failed [served_fqdn_list]"); goto end; } - - OpenAPI_lnode_t *served_fqdn_list_node; - OpenAPI_list_for_each(nef_cond->served_fqdn_list, served_fqdn_list_node) { - if (cJSON_AddStringToObject(served_fqdn_list, "", (char*)served_fqdn_list_node->data) == NULL) { - ogs_error("OpenAPI_nef_cond_convertToJSON() failed [served_fqdn_list]"); - goto end; + OpenAPI_list_for_each(nef_cond->served_fqdn_list, node) { + if (cJSON_AddStringToObject(served_fqdn_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nef_cond_convertToJSON() failed [served_fqdn_list]"); + goto end; + } } - } } end: @@ -204,153 +213,150 @@ end: OpenAPI_nef_cond_t *OpenAPI_nef_cond_parseFromJSON(cJSON *nef_condJSON) { OpenAPI_nef_cond_t *nef_cond_local_var = NULL; - cJSON *condition_type = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "conditionType"); + OpenAPI_lnode_t *node = NULL; + cJSON *condition_type = NULL; + OpenAPI_nef_cond_condition_type_e condition_typeVariable = 0; + cJSON *af_events = NULL; + OpenAPI_list_t *af_eventsList = NULL; + cJSON *snssai_list = NULL; + OpenAPI_list_t *snssai_listList = NULL; + cJSON *pfd_data = NULL; + OpenAPI_pfd_data_t *pfd_data_local_nonprim = NULL; + cJSON *gpsi_ranges = NULL; + OpenAPI_list_t *gpsi_rangesList = NULL; + cJSON *external_group_identifiers_ranges = NULL; + OpenAPI_list_t *external_group_identifiers_rangesList = NULL; + cJSON *served_fqdn_list = NULL; + OpenAPI_list_t *served_fqdn_listList = NULL; + condition_type = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "conditionType"); if (!condition_type) { ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [condition_type]"); goto end; } - - OpenAPI_nef_cond_condition_type_e condition_typeVariable; if (!cJSON_IsString(condition_type)) { ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [condition_type]"); goto end; } condition_typeVariable = OpenAPI_condition_typenef_cond_FromString(condition_type->valuestring); - cJSON *af_events = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "afEvents"); - - OpenAPI_list_t *af_eventsList; + af_events = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "afEvents"); if (af_events) { - cJSON *af_events_local_nonprimitive; - if (!cJSON_IsArray(af_events)) { - ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [af_events]"); - goto end; - } - - af_eventsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(af_events_local_nonprimitive, af_events ) { - if (!cJSON_IsString(af_events_local_nonprimitive)){ + cJSON *af_events_local = NULL; + if (!cJSON_IsArray(af_events)) { ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [af_events]"); goto end; } - OpenAPI_list_add(af_eventsList, (void *)OpenAPI_af_event_FromString(af_events_local_nonprimitive->valuestring)); - } + af_eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_events_local, af_events) { + if (!cJSON_IsString(af_events_local)) { + ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [af_events]"); + goto end; + } + OpenAPI_list_add(af_eventsList, (void *)OpenAPI_af_event_FromString(af_events_local->valuestring)); + } } - cJSON *snssai_list = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "snssaiList"); - - OpenAPI_list_t *snssai_listList; + snssai_list = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "snssaiList"); if (snssai_list) { - cJSON *snssai_list_local_nonprimitive; - if (!cJSON_IsArray(snssai_list)){ - ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [snssai_list]"); - goto end; - } - - snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(snssai_list_local_nonprimitive, snssai_list ) { - if (!cJSON_IsObject(snssai_list_local_nonprimitive)) { + cJSON *snssai_list_local = NULL; + if (!cJSON_IsArray(snssai_list)) { ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [snssai_list]"); goto end; } - OpenAPI_snssai_t *snssai_listItem = OpenAPI_snssai_parseFromJSON(snssai_list_local_nonprimitive); - if (!snssai_listItem) { - ogs_error("No snssai_listItem"); - OpenAPI_list_free(snssai_listList); - goto end; + snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssai_list_local, snssai_list) { + if (!cJSON_IsObject(snssai_list_local)) { + ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [snssai_list]"); + goto end; + } + OpenAPI_snssai_t *snssai_listItem = OpenAPI_snssai_parseFromJSON(snssai_list_local); + if (!snssai_listItem) { + ogs_error("No snssai_listItem"); + OpenAPI_list_free(snssai_listList); + goto end; + } + OpenAPI_list_add(snssai_listList, snssai_listItem); } - - OpenAPI_list_add(snssai_listList, snssai_listItem); - } } - cJSON *pfd_data = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "pfdData"); - - OpenAPI_pfd_data_t *pfd_data_local_nonprim = NULL; + pfd_data = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "pfdData"); if (pfd_data) { pfd_data_local_nonprim = OpenAPI_pfd_data_parseFromJSON(pfd_data); } - cJSON *gpsi_ranges = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "gpsiRanges"); - - OpenAPI_list_t *gpsi_rangesList; + gpsi_ranges = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "gpsiRanges"); if (gpsi_ranges) { - cJSON *gpsi_ranges_local_nonprimitive; - if (!cJSON_IsArray(gpsi_ranges)){ - ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [gpsi_ranges]"); - goto end; - } - - gpsi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(gpsi_ranges_local_nonprimitive, gpsi_ranges ) { - if (!cJSON_IsObject(gpsi_ranges_local_nonprimitive)) { + cJSON *gpsi_ranges_local = NULL; + if (!cJSON_IsArray(gpsi_ranges)) { ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [gpsi_ranges]"); goto end; } - OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local_nonprimitive); - if (!gpsi_rangesItem) { - ogs_error("No gpsi_rangesItem"); - OpenAPI_list_free(gpsi_rangesList); - goto end; + gpsi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_ranges_local, gpsi_ranges) { + if (!cJSON_IsObject(gpsi_ranges_local)) { + ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [gpsi_ranges]"); + goto end; + } + OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local); + if (!gpsi_rangesItem) { + ogs_error("No gpsi_rangesItem"); + OpenAPI_list_free(gpsi_rangesList); + goto end; + } + OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); } - - OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); - } } - cJSON *external_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "externalGroupIdentifiersRanges"); - - OpenAPI_list_t *external_group_identifiers_rangesList; + external_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "externalGroupIdentifiersRanges"); if (external_group_identifiers_ranges) { - cJSON *external_group_identifiers_ranges_local_nonprimitive; - if (!cJSON_IsArray(external_group_identifiers_ranges)){ - ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [external_group_identifiers_ranges]"); - goto end; - } - - external_group_identifiers_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(external_group_identifiers_ranges_local_nonprimitive, external_group_identifiers_ranges ) { - if (!cJSON_IsObject(external_group_identifiers_ranges_local_nonprimitive)) { + cJSON *external_group_identifiers_ranges_local = NULL; + if (!cJSON_IsArray(external_group_identifiers_ranges)) { ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [external_group_identifiers_ranges]"); goto end; } - OpenAPI_identity_range_t *external_group_identifiers_rangesItem = OpenAPI_identity_range_parseFromJSON(external_group_identifiers_ranges_local_nonprimitive); - if (!external_group_identifiers_rangesItem) { - ogs_error("No external_group_identifiers_rangesItem"); - OpenAPI_list_free(external_group_identifiers_rangesList); + external_group_identifiers_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(external_group_identifiers_ranges_local, external_group_identifiers_ranges) { + if (!cJSON_IsObject(external_group_identifiers_ranges_local)) { + ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [external_group_identifiers_ranges]"); + goto end; + } + OpenAPI_identity_range_t *external_group_identifiers_rangesItem = OpenAPI_identity_range_parseFromJSON(external_group_identifiers_ranges_local); + if (!external_group_identifiers_rangesItem) { + ogs_error("No external_group_identifiers_rangesItem"); + OpenAPI_list_free(external_group_identifiers_rangesList); + goto end; + } + OpenAPI_list_add(external_group_identifiers_rangesList, external_group_identifiers_rangesItem); + } + } + + served_fqdn_list = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "servedFqdnList"); + if (served_fqdn_list) { + cJSON *served_fqdn_list_local = NULL; + if (!cJSON_IsArray(served_fqdn_list)) { + ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [served_fqdn_list]"); goto end; } - OpenAPI_list_add(external_group_identifiers_rangesList, external_group_identifiers_rangesItem); - } - } + served_fqdn_listList = OpenAPI_list_create(); - cJSON *served_fqdn_list = cJSON_GetObjectItemCaseSensitive(nef_condJSON, "servedFqdnList"); - - OpenAPI_list_t *served_fqdn_listList; - if (served_fqdn_list) { - cJSON *served_fqdn_list_local; - if (!cJSON_IsArray(served_fqdn_list)) { - ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [served_fqdn_list]"); - goto end; - } - served_fqdn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(served_fqdn_list_local, served_fqdn_list) { - if (!cJSON_IsString(served_fqdn_list_local)) { - ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [served_fqdn_list]"); - goto end; - } - OpenAPI_list_add(served_fqdn_listList, ogs_strdup(served_fqdn_list_local->valuestring)); - } + cJSON_ArrayForEach(served_fqdn_list_local, served_fqdn_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(served_fqdn_list_local)) { + ogs_error("OpenAPI_nef_cond_parseFromJSON() failed [served_fqdn_list]"); + goto end; + } + OpenAPI_list_add(served_fqdn_listList, ogs_strdup(served_fqdn_list_local->valuestring)); + } } nef_cond_local_var = OpenAPI_nef_cond_create ( @@ -365,6 +371,42 @@ OpenAPI_nef_cond_t *OpenAPI_nef_cond_parseFromJSON(cJSON *nef_condJSON) return nef_cond_local_var; end: + if (af_eventsList) { + OpenAPI_list_free(af_eventsList); + af_eventsList = NULL; + } + if (snssai_listList) { + OpenAPI_list_for_each(snssai_listList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(snssai_listList); + snssai_listList = NULL; + } + if (pfd_data_local_nonprim) { + OpenAPI_pfd_data_free(pfd_data_local_nonprim); + pfd_data_local_nonprim = NULL; + } + if (gpsi_rangesList) { + OpenAPI_list_for_each(gpsi_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(gpsi_rangesList); + gpsi_rangesList = NULL; + } + if (external_group_identifiers_rangesList) { + OpenAPI_list_for_each(external_group_identifiers_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(external_group_identifiers_rangesList); + external_group_identifiers_rangesList = NULL; + } + if (served_fqdn_listList) { + OpenAPI_list_for_each(served_fqdn_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(served_fqdn_listList); + served_fqdn_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nef_info.c b/lib/sbi/openapi/model/nef_info.c index 07c1011c2..1a1297890 100644 --- a/lib/sbi/openapi/model/nef_info.c +++ b/lib/sbi/openapi/model/nef_info.c @@ -28,31 +28,51 @@ OpenAPI_nef_info_t *OpenAPI_nef_info_create( void OpenAPI_nef_info_free(OpenAPI_nef_info_t *nef_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nef_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(nef_info->nef_id); - OpenAPI_pfd_data_free(nef_info->pfd_data); - OpenAPI_af_event_exposure_data_free(nef_info->af_ee_data); - OpenAPI_list_for_each(nef_info->gpsi_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (nef_info->nef_id) { + ogs_free(nef_info->nef_id); + nef_info->nef_id = NULL; } - OpenAPI_list_free(nef_info->gpsi_ranges); - OpenAPI_list_for_each(nef_info->external_group_identifiers_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (nef_info->pfd_data) { + OpenAPI_pfd_data_free(nef_info->pfd_data); + nef_info->pfd_data = NULL; } - OpenAPI_list_free(nef_info->external_group_identifiers_ranges); - OpenAPI_list_for_each(nef_info->served_fqdn_list, node) { - ogs_free(node->data); + if (nef_info->af_ee_data) { + OpenAPI_af_event_exposure_data_free(nef_info->af_ee_data); + nef_info->af_ee_data = NULL; + } + if (nef_info->gpsi_ranges) { + OpenAPI_list_for_each(nef_info->gpsi_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(nef_info->gpsi_ranges); + nef_info->gpsi_ranges = NULL; + } + if (nef_info->external_group_identifiers_ranges) { + OpenAPI_list_for_each(nef_info->external_group_identifiers_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(nef_info->external_group_identifiers_ranges); + nef_info->external_group_identifiers_ranges = NULL; + } + if (nef_info->served_fqdn_list) { + OpenAPI_list_for_each(nef_info->served_fqdn_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nef_info->served_fqdn_list); + nef_info->served_fqdn_list = NULL; } - OpenAPI_list_free(nef_info->served_fqdn_list); ogs_free(nef_info); } cJSON *OpenAPI_nef_info_convertToJSON(OpenAPI_nef_info_t *nef_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nef_info == NULL) { ogs_error("OpenAPI_nef_info_convertToJSON() failed [NefInfo]"); @@ -99,17 +119,13 @@ cJSON *OpenAPI_nef_info_convertToJSON(OpenAPI_nef_info_t *nef_info) ogs_error("OpenAPI_nef_info_convertToJSON() failed [gpsi_ranges]"); goto end; } - - OpenAPI_lnode_t *gpsi_ranges_node; - if (nef_info->gpsi_ranges) { - OpenAPI_list_for_each(nef_info->gpsi_ranges, gpsi_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(gpsi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nef_info_convertToJSON() failed [gpsi_ranges]"); - goto end; - } - cJSON_AddItemToArray(gpsi_rangesList, itemLocal); + OpenAPI_list_for_each(nef_info->gpsi_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [gpsi_ranges]"); + goto end; } + cJSON_AddItemToArray(gpsi_rangesList, itemLocal); } } @@ -119,34 +135,28 @@ cJSON *OpenAPI_nef_info_convertToJSON(OpenAPI_nef_info_t *nef_info) ogs_error("OpenAPI_nef_info_convertToJSON() failed [external_group_identifiers_ranges]"); goto end; } - - OpenAPI_lnode_t *external_group_identifiers_ranges_node; - if (nef_info->external_group_identifiers_ranges) { - OpenAPI_list_for_each(nef_info->external_group_identifiers_ranges, external_group_identifiers_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(external_group_identifiers_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nef_info_convertToJSON() failed [external_group_identifiers_ranges]"); - goto end; - } - cJSON_AddItemToArray(external_group_identifiers_rangesList, itemLocal); + OpenAPI_list_for_each(nef_info->external_group_identifiers_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [external_group_identifiers_ranges]"); + goto end; } + cJSON_AddItemToArray(external_group_identifiers_rangesList, itemLocal); } } if (nef_info->served_fqdn_list) { - cJSON *served_fqdn_list = cJSON_AddArrayToObject(item, "servedFqdnList"); - if (served_fqdn_list == NULL) { + cJSON *served_fqdn_listList = cJSON_AddArrayToObject(item, "servedFqdnList"); + if (served_fqdn_listList == NULL) { ogs_error("OpenAPI_nef_info_convertToJSON() failed [served_fqdn_list]"); goto end; } - - OpenAPI_lnode_t *served_fqdn_list_node; - OpenAPI_list_for_each(nef_info->served_fqdn_list, served_fqdn_list_node) { - if (cJSON_AddStringToObject(served_fqdn_list, "", (char*)served_fqdn_list_node->data) == NULL) { - ogs_error("OpenAPI_nef_info_convertToJSON() failed [served_fqdn_list]"); - goto end; + OpenAPI_list_for_each(nef_info->served_fqdn_list, node) { + if (cJSON_AddStringToObject(served_fqdn_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nef_info_convertToJSON() failed [served_fqdn_list]"); + goto end; + } } - } } end: @@ -156,109 +166,109 @@ end: OpenAPI_nef_info_t *OpenAPI_nef_info_parseFromJSON(cJSON *nef_infoJSON) { OpenAPI_nef_info_t *nef_info_local_var = NULL; - cJSON *nef_id = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "nefId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *nef_id = NULL; + cJSON *pfd_data = NULL; + OpenAPI_pfd_data_t *pfd_data_local_nonprim = NULL; + cJSON *af_ee_data = NULL; + OpenAPI_af_event_exposure_data_t *af_ee_data_local_nonprim = NULL; + cJSON *gpsi_ranges = NULL; + OpenAPI_list_t *gpsi_rangesList = NULL; + cJSON *external_group_identifiers_ranges = NULL; + OpenAPI_list_t *external_group_identifiers_rangesList = NULL; + cJSON *served_fqdn_list = NULL; + OpenAPI_list_t *served_fqdn_listList = NULL; + nef_id = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "nefId"); if (nef_id) { - if (!cJSON_IsString(nef_id)) { + if (!cJSON_IsString(nef_id) && !cJSON_IsNull(nef_id)) { ogs_error("OpenAPI_nef_info_parseFromJSON() failed [nef_id]"); goto end; } } - cJSON *pfd_data = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "pfdData"); - - OpenAPI_pfd_data_t *pfd_data_local_nonprim = NULL; + pfd_data = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "pfdData"); if (pfd_data) { pfd_data_local_nonprim = OpenAPI_pfd_data_parseFromJSON(pfd_data); } - cJSON *af_ee_data = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "afEeData"); - - OpenAPI_af_event_exposure_data_t *af_ee_data_local_nonprim = NULL; + af_ee_data = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "afEeData"); if (af_ee_data) { af_ee_data_local_nonprim = OpenAPI_af_event_exposure_data_parseFromJSON(af_ee_data); } - cJSON *gpsi_ranges = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "gpsiRanges"); - - OpenAPI_list_t *gpsi_rangesList; + gpsi_ranges = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "gpsiRanges"); if (gpsi_ranges) { - cJSON *gpsi_ranges_local_nonprimitive; - if (!cJSON_IsArray(gpsi_ranges)){ - ogs_error("OpenAPI_nef_info_parseFromJSON() failed [gpsi_ranges]"); - goto end; - } - - gpsi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(gpsi_ranges_local_nonprimitive, gpsi_ranges ) { - if (!cJSON_IsObject(gpsi_ranges_local_nonprimitive)) { + cJSON *gpsi_ranges_local = NULL; + if (!cJSON_IsArray(gpsi_ranges)) { ogs_error("OpenAPI_nef_info_parseFromJSON() failed [gpsi_ranges]"); goto end; } - OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local_nonprimitive); - if (!gpsi_rangesItem) { - ogs_error("No gpsi_rangesItem"); - OpenAPI_list_free(gpsi_rangesList); - goto end; + gpsi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_ranges_local, gpsi_ranges) { + if (!cJSON_IsObject(gpsi_ranges_local)) { + ogs_error("OpenAPI_nef_info_parseFromJSON() failed [gpsi_ranges]"); + goto end; + } + OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local); + if (!gpsi_rangesItem) { + ogs_error("No gpsi_rangesItem"); + OpenAPI_list_free(gpsi_rangesList); + goto end; + } + OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); } - - OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); - } } - cJSON *external_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "externalGroupIdentifiersRanges"); - - OpenAPI_list_t *external_group_identifiers_rangesList; + external_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "externalGroupIdentifiersRanges"); if (external_group_identifiers_ranges) { - cJSON *external_group_identifiers_ranges_local_nonprimitive; - if (!cJSON_IsArray(external_group_identifiers_ranges)){ - ogs_error("OpenAPI_nef_info_parseFromJSON() failed [external_group_identifiers_ranges]"); - goto end; - } - - external_group_identifiers_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(external_group_identifiers_ranges_local_nonprimitive, external_group_identifiers_ranges ) { - if (!cJSON_IsObject(external_group_identifiers_ranges_local_nonprimitive)) { + cJSON *external_group_identifiers_ranges_local = NULL; + if (!cJSON_IsArray(external_group_identifiers_ranges)) { ogs_error("OpenAPI_nef_info_parseFromJSON() failed [external_group_identifiers_ranges]"); goto end; } - OpenAPI_identity_range_t *external_group_identifiers_rangesItem = OpenAPI_identity_range_parseFromJSON(external_group_identifiers_ranges_local_nonprimitive); - if (!external_group_identifiers_rangesItem) { - ogs_error("No external_group_identifiers_rangesItem"); - OpenAPI_list_free(external_group_identifiers_rangesList); + external_group_identifiers_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(external_group_identifiers_ranges_local, external_group_identifiers_ranges) { + if (!cJSON_IsObject(external_group_identifiers_ranges_local)) { + ogs_error("OpenAPI_nef_info_parseFromJSON() failed [external_group_identifiers_ranges]"); + goto end; + } + OpenAPI_identity_range_t *external_group_identifiers_rangesItem = OpenAPI_identity_range_parseFromJSON(external_group_identifiers_ranges_local); + if (!external_group_identifiers_rangesItem) { + ogs_error("No external_group_identifiers_rangesItem"); + OpenAPI_list_free(external_group_identifiers_rangesList); + goto end; + } + OpenAPI_list_add(external_group_identifiers_rangesList, external_group_identifiers_rangesItem); + } + } + + served_fqdn_list = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "servedFqdnList"); + if (served_fqdn_list) { + cJSON *served_fqdn_list_local = NULL; + if (!cJSON_IsArray(served_fqdn_list)) { + ogs_error("OpenAPI_nef_info_parseFromJSON() failed [served_fqdn_list]"); goto end; } - OpenAPI_list_add(external_group_identifiers_rangesList, external_group_identifiers_rangesItem); - } - } + served_fqdn_listList = OpenAPI_list_create(); - cJSON *served_fqdn_list = cJSON_GetObjectItemCaseSensitive(nef_infoJSON, "servedFqdnList"); - - OpenAPI_list_t *served_fqdn_listList; - if (served_fqdn_list) { - cJSON *served_fqdn_list_local; - if (!cJSON_IsArray(served_fqdn_list)) { - ogs_error("OpenAPI_nef_info_parseFromJSON() failed [served_fqdn_list]"); - goto end; - } - served_fqdn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(served_fqdn_list_local, served_fqdn_list) { - if (!cJSON_IsString(served_fqdn_list_local)) { - ogs_error("OpenAPI_nef_info_parseFromJSON() failed [served_fqdn_list]"); - goto end; - } - OpenAPI_list_add(served_fqdn_listList, ogs_strdup(served_fqdn_list_local->valuestring)); - } + cJSON_ArrayForEach(served_fqdn_list_local, served_fqdn_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(served_fqdn_list_local)) { + ogs_error("OpenAPI_nef_info_parseFromJSON() failed [served_fqdn_list]"); + goto end; + } + OpenAPI_list_add(served_fqdn_listList, ogs_strdup(served_fqdn_list_local->valuestring)); + } } nef_info_local_var = OpenAPI_nef_info_create ( - nef_id ? ogs_strdup(nef_id->valuestring) : NULL, + nef_id && !cJSON_IsNull(nef_id) ? ogs_strdup(nef_id->valuestring) : NULL, pfd_data ? pfd_data_local_nonprim : NULL, af_ee_data ? af_ee_data_local_nonprim : NULL, gpsi_ranges ? gpsi_rangesList : NULL, @@ -268,6 +278,35 @@ OpenAPI_nef_info_t *OpenAPI_nef_info_parseFromJSON(cJSON *nef_infoJSON) return nef_info_local_var; end: + if (pfd_data_local_nonprim) { + OpenAPI_pfd_data_free(pfd_data_local_nonprim); + pfd_data_local_nonprim = NULL; + } + if (af_ee_data_local_nonprim) { + OpenAPI_af_event_exposure_data_free(af_ee_data_local_nonprim); + af_ee_data_local_nonprim = NULL; + } + if (gpsi_rangesList) { + OpenAPI_list_for_each(gpsi_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(gpsi_rangesList); + gpsi_rangesList = NULL; + } + if (external_group_identifiers_rangesList) { + OpenAPI_list_for_each(external_group_identifiers_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(external_group_identifiers_rangesList); + external_group_identifiers_rangesList = NULL; + } + if (served_fqdn_listList) { + OpenAPI_list_for_each(served_fqdn_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(served_fqdn_listList); + served_fqdn_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/network_area_info.c b/lib/sbi/openapi/model/network_area_info.c index be820272e..65d903504 100644 --- a/lib/sbi/openapi/model/network_area_info.c +++ b/lib/sbi/openapi/model/network_area_info.c @@ -24,32 +24,46 @@ OpenAPI_network_area_info_t *OpenAPI_network_area_info_create( void OpenAPI_network_area_info_free(OpenAPI_network_area_info_t *network_area_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == network_area_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(network_area_info->ecgis, node) { - OpenAPI_ecgi_free(node->data); + if (network_area_info->ecgis) { + OpenAPI_list_for_each(network_area_info->ecgis, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(network_area_info->ecgis); + network_area_info->ecgis = NULL; } - OpenAPI_list_free(network_area_info->ecgis); - OpenAPI_list_for_each(network_area_info->ncgis, node) { - OpenAPI_ncgi_free(node->data); + if (network_area_info->ncgis) { + OpenAPI_list_for_each(network_area_info->ncgis, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(network_area_info->ncgis); + network_area_info->ncgis = NULL; } - OpenAPI_list_free(network_area_info->ncgis); - OpenAPI_list_for_each(network_area_info->g_ran_node_ids, node) { - OpenAPI_global_ran_node_id_free(node->data); + if (network_area_info->g_ran_node_ids) { + OpenAPI_list_for_each(network_area_info->g_ran_node_ids, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(network_area_info->g_ran_node_ids); + network_area_info->g_ran_node_ids = NULL; } - OpenAPI_list_free(network_area_info->g_ran_node_ids); - OpenAPI_list_for_each(network_area_info->tais, node) { - OpenAPI_tai_free(node->data); + if (network_area_info->tais) { + OpenAPI_list_for_each(network_area_info->tais, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(network_area_info->tais); + network_area_info->tais = NULL; } - OpenAPI_list_free(network_area_info->tais); ogs_free(network_area_info); } cJSON *OpenAPI_network_area_info_convertToJSON(OpenAPI_network_area_info_t *network_area_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (network_area_info == NULL) { ogs_error("OpenAPI_network_area_info_convertToJSON() failed [NetworkAreaInfo]"); @@ -63,17 +77,13 @@ cJSON *OpenAPI_network_area_info_convertToJSON(OpenAPI_network_area_info_t *netw ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ecgis]"); goto end; } - - OpenAPI_lnode_t *ecgis_node; - if (network_area_info->ecgis) { - OpenAPI_list_for_each(network_area_info->ecgis, ecgis_node) { - cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(ecgis_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ecgis]"); - goto end; - } - cJSON_AddItemToArray(ecgisList, itemLocal); + OpenAPI_list_for_each(network_area_info->ecgis, node) { + cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ecgis]"); + goto end; } + cJSON_AddItemToArray(ecgisList, itemLocal); } } @@ -83,17 +93,13 @@ cJSON *OpenAPI_network_area_info_convertToJSON(OpenAPI_network_area_info_t *netw ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ncgis]"); goto end; } - - OpenAPI_lnode_t *ncgis_node; - if (network_area_info->ncgis) { - OpenAPI_list_for_each(network_area_info->ncgis, ncgis_node) { - cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(ncgis_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ncgis]"); - goto end; - } - cJSON_AddItemToArray(ncgisList, itemLocal); + OpenAPI_list_for_each(network_area_info->ncgis, node) { + cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [ncgis]"); + goto end; } + cJSON_AddItemToArray(ncgisList, itemLocal); } } @@ -103,17 +109,13 @@ cJSON *OpenAPI_network_area_info_convertToJSON(OpenAPI_network_area_info_t *netw ogs_error("OpenAPI_network_area_info_convertToJSON() failed [g_ran_node_ids]"); goto end; } - - OpenAPI_lnode_t *g_ran_node_ids_node; - if (network_area_info->g_ran_node_ids) { - OpenAPI_list_for_each(network_area_info->g_ran_node_ids, g_ran_node_ids_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(g_ran_node_ids_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_area_info_convertToJSON() failed [g_ran_node_ids]"); - goto end; - } - cJSON_AddItemToArray(g_ran_node_idsList, itemLocal); + OpenAPI_list_for_each(network_area_info->g_ran_node_ids, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [g_ran_node_ids]"); + goto end; } + cJSON_AddItemToArray(g_ran_node_idsList, itemLocal); } } @@ -123,17 +125,13 @@ cJSON *OpenAPI_network_area_info_convertToJSON(OpenAPI_network_area_info_t *netw ogs_error("OpenAPI_network_area_info_convertToJSON() failed [tais]"); goto end; } - - OpenAPI_lnode_t *tais_node; - if (network_area_info->tais) { - OpenAPI_list_for_each(network_area_info->tais, tais_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_area_info_convertToJSON() failed [tais]"); - goto end; - } - cJSON_AddItemToArray(taisList, itemLocal); + OpenAPI_list_for_each(network_area_info->tais, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_convertToJSON() failed [tais]"); + goto end; } + cJSON_AddItemToArray(taisList, itemLocal); } } @@ -144,120 +142,113 @@ end: OpenAPI_network_area_info_t *OpenAPI_network_area_info_parseFromJSON(cJSON *network_area_infoJSON) { OpenAPI_network_area_info_t *network_area_info_local_var = NULL; - cJSON *ecgis = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "ecgis"); - - OpenAPI_list_t *ecgisList; + OpenAPI_lnode_t *node = NULL; + cJSON *ecgis = NULL; + OpenAPI_list_t *ecgisList = NULL; + cJSON *ncgis = NULL; + OpenAPI_list_t *ncgisList = NULL; + cJSON *g_ran_node_ids = NULL; + OpenAPI_list_t *g_ran_node_idsList = NULL; + cJSON *tais = NULL; + OpenAPI_list_t *taisList = NULL; + ecgis = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "ecgis"); if (ecgis) { - cJSON *ecgis_local_nonprimitive; - if (!cJSON_IsArray(ecgis)){ - ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ecgis]"); - goto end; - } - - ecgisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ecgis_local_nonprimitive, ecgis ) { - if (!cJSON_IsObject(ecgis_local_nonprimitive)) { + cJSON *ecgis_local = NULL; + if (!cJSON_IsArray(ecgis)) { ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ecgis]"); goto end; } - OpenAPI_ecgi_t *ecgisItem = OpenAPI_ecgi_parseFromJSON(ecgis_local_nonprimitive); - if (!ecgisItem) { - ogs_error("No ecgisItem"); - OpenAPI_list_free(ecgisList); - goto end; + ecgisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ecgis_local, ecgis) { + if (!cJSON_IsObject(ecgis_local)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ecgis]"); + goto end; + } + OpenAPI_ecgi_t *ecgisItem = OpenAPI_ecgi_parseFromJSON(ecgis_local); + if (!ecgisItem) { + ogs_error("No ecgisItem"); + OpenAPI_list_free(ecgisList); + goto end; + } + OpenAPI_list_add(ecgisList, ecgisItem); } - - OpenAPI_list_add(ecgisList, ecgisItem); - } } - cJSON *ncgis = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "ncgis"); - - OpenAPI_list_t *ncgisList; + ncgis = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "ncgis"); if (ncgis) { - cJSON *ncgis_local_nonprimitive; - if (!cJSON_IsArray(ncgis)){ - ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ncgis]"); - goto end; - } - - ncgisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ncgis_local_nonprimitive, ncgis ) { - if (!cJSON_IsObject(ncgis_local_nonprimitive)) { + cJSON *ncgis_local = NULL; + if (!cJSON_IsArray(ncgis)) { ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ncgis]"); goto end; } - OpenAPI_ncgi_t *ncgisItem = OpenAPI_ncgi_parseFromJSON(ncgis_local_nonprimitive); - if (!ncgisItem) { - ogs_error("No ncgisItem"); - OpenAPI_list_free(ncgisList); - goto end; + ncgisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ncgis_local, ncgis) { + if (!cJSON_IsObject(ncgis_local)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [ncgis]"); + goto end; + } + OpenAPI_ncgi_t *ncgisItem = OpenAPI_ncgi_parseFromJSON(ncgis_local); + if (!ncgisItem) { + ogs_error("No ncgisItem"); + OpenAPI_list_free(ncgisList); + goto end; + } + OpenAPI_list_add(ncgisList, ncgisItem); } - - OpenAPI_list_add(ncgisList, ncgisItem); - } } - cJSON *g_ran_node_ids = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "gRanNodeIds"); - - OpenAPI_list_t *g_ran_node_idsList; + g_ran_node_ids = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "gRanNodeIds"); if (g_ran_node_ids) { - cJSON *g_ran_node_ids_local_nonprimitive; - if (!cJSON_IsArray(g_ran_node_ids)){ - ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [g_ran_node_ids]"); - goto end; - } - - g_ran_node_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(g_ran_node_ids_local_nonprimitive, g_ran_node_ids ) { - if (!cJSON_IsObject(g_ran_node_ids_local_nonprimitive)) { + cJSON *g_ran_node_ids_local = NULL; + if (!cJSON_IsArray(g_ran_node_ids)) { ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [g_ran_node_ids]"); goto end; } - OpenAPI_global_ran_node_id_t *g_ran_node_idsItem = OpenAPI_global_ran_node_id_parseFromJSON(g_ran_node_ids_local_nonprimitive); - if (!g_ran_node_idsItem) { - ogs_error("No g_ran_node_idsItem"); - OpenAPI_list_free(g_ran_node_idsList); - goto end; + g_ran_node_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(g_ran_node_ids_local, g_ran_node_ids) { + if (!cJSON_IsObject(g_ran_node_ids_local)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [g_ran_node_ids]"); + goto end; + } + OpenAPI_global_ran_node_id_t *g_ran_node_idsItem = OpenAPI_global_ran_node_id_parseFromJSON(g_ran_node_ids_local); + if (!g_ran_node_idsItem) { + ogs_error("No g_ran_node_idsItem"); + OpenAPI_list_free(g_ran_node_idsList); + goto end; + } + OpenAPI_list_add(g_ran_node_idsList, g_ran_node_idsItem); } - - OpenAPI_list_add(g_ran_node_idsList, g_ran_node_idsItem); - } } - cJSON *tais = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "tais"); - - OpenAPI_list_t *taisList; + tais = cJSON_GetObjectItemCaseSensitive(network_area_infoJSON, "tais"); if (tais) { - cJSON *tais_local_nonprimitive; - if (!cJSON_IsArray(tais)){ - ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [tais]"); - goto end; - } - - taisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tais_local_nonprimitive, tais ) { - if (!cJSON_IsObject(tais_local_nonprimitive)) { + cJSON *tais_local = NULL; + if (!cJSON_IsArray(tais)) { ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [tais]"); goto end; } - OpenAPI_tai_t *taisItem = OpenAPI_tai_parseFromJSON(tais_local_nonprimitive); - if (!taisItem) { - ogs_error("No taisItem"); - OpenAPI_list_free(taisList); - goto end; + taisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tais_local, tais) { + if (!cJSON_IsObject(tais_local)) { + ogs_error("OpenAPI_network_area_info_parseFromJSON() failed [tais]"); + goto end; + } + OpenAPI_tai_t *taisItem = OpenAPI_tai_parseFromJSON(tais_local); + if (!taisItem) { + ogs_error("No taisItem"); + OpenAPI_list_free(taisList); + goto end; + } + OpenAPI_list_add(taisList, taisItem); } - - OpenAPI_list_add(taisList, taisItem); - } } network_area_info_local_var = OpenAPI_network_area_info_create ( @@ -269,6 +260,34 @@ OpenAPI_network_area_info_t *OpenAPI_network_area_info_parseFromJSON(cJSON *netw return network_area_info_local_var; end: + if (ecgisList) { + OpenAPI_list_for_each(ecgisList, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(ecgisList); + ecgisList = NULL; + } + if (ncgisList) { + OpenAPI_list_for_each(ncgisList, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(ncgisList); + ncgisList = NULL; + } + if (g_ran_node_idsList) { + OpenAPI_list_for_each(g_ran_node_idsList, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(g_ran_node_idsList); + g_ran_node_idsList = NULL; + } + if (taisList) { + OpenAPI_list_for_each(taisList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(taisList); + taisList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/network_area_info_1.c b/lib/sbi/openapi/model/network_area_info_1.c index fbd0db15b..015ada69a 100644 --- a/lib/sbi/openapi/model/network_area_info_1.c +++ b/lib/sbi/openapi/model/network_area_info_1.c @@ -24,32 +24,46 @@ OpenAPI_network_area_info_1_t *OpenAPI_network_area_info_1_create( void OpenAPI_network_area_info_1_free(OpenAPI_network_area_info_1_t *network_area_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == network_area_info_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(network_area_info_1->ecgis, node) { - OpenAPI_ecgi_1_free(node->data); + if (network_area_info_1->ecgis) { + OpenAPI_list_for_each(network_area_info_1->ecgis, node) { + OpenAPI_ecgi_1_free(node->data); + } + OpenAPI_list_free(network_area_info_1->ecgis); + network_area_info_1->ecgis = NULL; } - OpenAPI_list_free(network_area_info_1->ecgis); - OpenAPI_list_for_each(network_area_info_1->ncgis, node) { - OpenAPI_ncgi_1_free(node->data); + if (network_area_info_1->ncgis) { + OpenAPI_list_for_each(network_area_info_1->ncgis, node) { + OpenAPI_ncgi_1_free(node->data); + } + OpenAPI_list_free(network_area_info_1->ncgis); + network_area_info_1->ncgis = NULL; } - OpenAPI_list_free(network_area_info_1->ncgis); - OpenAPI_list_for_each(network_area_info_1->g_ran_node_ids, node) { - OpenAPI_global_ran_node_id_1_free(node->data); + if (network_area_info_1->g_ran_node_ids) { + OpenAPI_list_for_each(network_area_info_1->g_ran_node_ids, node) { + OpenAPI_global_ran_node_id_1_free(node->data); + } + OpenAPI_list_free(network_area_info_1->g_ran_node_ids); + network_area_info_1->g_ran_node_ids = NULL; } - OpenAPI_list_free(network_area_info_1->g_ran_node_ids); - OpenAPI_list_for_each(network_area_info_1->tais, node) { - OpenAPI_tai_1_free(node->data); + if (network_area_info_1->tais) { + OpenAPI_list_for_each(network_area_info_1->tais, node) { + OpenAPI_tai_1_free(node->data); + } + OpenAPI_list_free(network_area_info_1->tais); + network_area_info_1->tais = NULL; } - OpenAPI_list_free(network_area_info_1->tais); ogs_free(network_area_info_1); } cJSON *OpenAPI_network_area_info_1_convertToJSON(OpenAPI_network_area_info_1_t *network_area_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (network_area_info_1 == NULL) { ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [NetworkAreaInfo_1]"); @@ -63,17 +77,13 @@ cJSON *OpenAPI_network_area_info_1_convertToJSON(OpenAPI_network_area_info_1_t * ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [ecgis]"); goto end; } - - OpenAPI_lnode_t *ecgis_node; - if (network_area_info_1->ecgis) { - OpenAPI_list_for_each(network_area_info_1->ecgis, ecgis_node) { - cJSON *itemLocal = OpenAPI_ecgi_1_convertToJSON(ecgis_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [ecgis]"); - goto end; - } - cJSON_AddItemToArray(ecgisList, itemLocal); + OpenAPI_list_for_each(network_area_info_1->ecgis, node) { + cJSON *itemLocal = OpenAPI_ecgi_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [ecgis]"); + goto end; } + cJSON_AddItemToArray(ecgisList, itemLocal); } } @@ -83,17 +93,13 @@ cJSON *OpenAPI_network_area_info_1_convertToJSON(OpenAPI_network_area_info_1_t * ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [ncgis]"); goto end; } - - OpenAPI_lnode_t *ncgis_node; - if (network_area_info_1->ncgis) { - OpenAPI_list_for_each(network_area_info_1->ncgis, ncgis_node) { - cJSON *itemLocal = OpenAPI_ncgi_1_convertToJSON(ncgis_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [ncgis]"); - goto end; - } - cJSON_AddItemToArray(ncgisList, itemLocal); + OpenAPI_list_for_each(network_area_info_1->ncgis, node) { + cJSON *itemLocal = OpenAPI_ncgi_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [ncgis]"); + goto end; } + cJSON_AddItemToArray(ncgisList, itemLocal); } } @@ -103,17 +109,13 @@ cJSON *OpenAPI_network_area_info_1_convertToJSON(OpenAPI_network_area_info_1_t * ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [g_ran_node_ids]"); goto end; } - - OpenAPI_lnode_t *g_ran_node_ids_node; - if (network_area_info_1->g_ran_node_ids) { - OpenAPI_list_for_each(network_area_info_1->g_ran_node_ids, g_ran_node_ids_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_1_convertToJSON(g_ran_node_ids_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [g_ran_node_ids]"); - goto end; - } - cJSON_AddItemToArray(g_ran_node_idsList, itemLocal); + OpenAPI_list_for_each(network_area_info_1->g_ran_node_ids, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [g_ran_node_ids]"); + goto end; } + cJSON_AddItemToArray(g_ran_node_idsList, itemLocal); } } @@ -123,17 +125,13 @@ cJSON *OpenAPI_network_area_info_1_convertToJSON(OpenAPI_network_area_info_1_t * ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [tais]"); goto end; } - - OpenAPI_lnode_t *tais_node; - if (network_area_info_1->tais) { - OpenAPI_list_for_each(network_area_info_1->tais, tais_node) { - cJSON *itemLocal = OpenAPI_tai_1_convertToJSON(tais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [tais]"); - goto end; - } - cJSON_AddItemToArray(taisList, itemLocal); + OpenAPI_list_for_each(network_area_info_1->tais, node) { + cJSON *itemLocal = OpenAPI_tai_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_area_info_1_convertToJSON() failed [tais]"); + goto end; } + cJSON_AddItemToArray(taisList, itemLocal); } } @@ -144,120 +142,113 @@ end: OpenAPI_network_area_info_1_t *OpenAPI_network_area_info_1_parseFromJSON(cJSON *network_area_info_1JSON) { OpenAPI_network_area_info_1_t *network_area_info_1_local_var = NULL; - cJSON *ecgis = cJSON_GetObjectItemCaseSensitive(network_area_info_1JSON, "ecgis"); - - OpenAPI_list_t *ecgisList; + OpenAPI_lnode_t *node = NULL; + cJSON *ecgis = NULL; + OpenAPI_list_t *ecgisList = NULL; + cJSON *ncgis = NULL; + OpenAPI_list_t *ncgisList = NULL; + cJSON *g_ran_node_ids = NULL; + OpenAPI_list_t *g_ran_node_idsList = NULL; + cJSON *tais = NULL; + OpenAPI_list_t *taisList = NULL; + ecgis = cJSON_GetObjectItemCaseSensitive(network_area_info_1JSON, "ecgis"); if (ecgis) { - cJSON *ecgis_local_nonprimitive; - if (!cJSON_IsArray(ecgis)){ - ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [ecgis]"); - goto end; - } - - ecgisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ecgis_local_nonprimitive, ecgis ) { - if (!cJSON_IsObject(ecgis_local_nonprimitive)) { + cJSON *ecgis_local = NULL; + if (!cJSON_IsArray(ecgis)) { ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [ecgis]"); goto end; } - OpenAPI_ecgi_1_t *ecgisItem = OpenAPI_ecgi_1_parseFromJSON(ecgis_local_nonprimitive); - if (!ecgisItem) { - ogs_error("No ecgisItem"); - OpenAPI_list_free(ecgisList); - goto end; + ecgisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ecgis_local, ecgis) { + if (!cJSON_IsObject(ecgis_local)) { + ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [ecgis]"); + goto end; + } + OpenAPI_ecgi_1_t *ecgisItem = OpenAPI_ecgi_1_parseFromJSON(ecgis_local); + if (!ecgisItem) { + ogs_error("No ecgisItem"); + OpenAPI_list_free(ecgisList); + goto end; + } + OpenAPI_list_add(ecgisList, ecgisItem); } - - OpenAPI_list_add(ecgisList, ecgisItem); - } } - cJSON *ncgis = cJSON_GetObjectItemCaseSensitive(network_area_info_1JSON, "ncgis"); - - OpenAPI_list_t *ncgisList; + ncgis = cJSON_GetObjectItemCaseSensitive(network_area_info_1JSON, "ncgis"); if (ncgis) { - cJSON *ncgis_local_nonprimitive; - if (!cJSON_IsArray(ncgis)){ - ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [ncgis]"); - goto end; - } - - ncgisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ncgis_local_nonprimitive, ncgis ) { - if (!cJSON_IsObject(ncgis_local_nonprimitive)) { + cJSON *ncgis_local = NULL; + if (!cJSON_IsArray(ncgis)) { ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [ncgis]"); goto end; } - OpenAPI_ncgi_1_t *ncgisItem = OpenAPI_ncgi_1_parseFromJSON(ncgis_local_nonprimitive); - if (!ncgisItem) { - ogs_error("No ncgisItem"); - OpenAPI_list_free(ncgisList); - goto end; + ncgisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ncgis_local, ncgis) { + if (!cJSON_IsObject(ncgis_local)) { + ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [ncgis]"); + goto end; + } + OpenAPI_ncgi_1_t *ncgisItem = OpenAPI_ncgi_1_parseFromJSON(ncgis_local); + if (!ncgisItem) { + ogs_error("No ncgisItem"); + OpenAPI_list_free(ncgisList); + goto end; + } + OpenAPI_list_add(ncgisList, ncgisItem); } - - OpenAPI_list_add(ncgisList, ncgisItem); - } } - cJSON *g_ran_node_ids = cJSON_GetObjectItemCaseSensitive(network_area_info_1JSON, "gRanNodeIds"); - - OpenAPI_list_t *g_ran_node_idsList; + g_ran_node_ids = cJSON_GetObjectItemCaseSensitive(network_area_info_1JSON, "gRanNodeIds"); if (g_ran_node_ids) { - cJSON *g_ran_node_ids_local_nonprimitive; - if (!cJSON_IsArray(g_ran_node_ids)){ - ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [g_ran_node_ids]"); - goto end; - } - - g_ran_node_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(g_ran_node_ids_local_nonprimitive, g_ran_node_ids ) { - if (!cJSON_IsObject(g_ran_node_ids_local_nonprimitive)) { + cJSON *g_ran_node_ids_local = NULL; + if (!cJSON_IsArray(g_ran_node_ids)) { ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [g_ran_node_ids]"); goto end; } - OpenAPI_global_ran_node_id_1_t *g_ran_node_idsItem = OpenAPI_global_ran_node_id_1_parseFromJSON(g_ran_node_ids_local_nonprimitive); - if (!g_ran_node_idsItem) { - ogs_error("No g_ran_node_idsItem"); - OpenAPI_list_free(g_ran_node_idsList); - goto end; + g_ran_node_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(g_ran_node_ids_local, g_ran_node_ids) { + if (!cJSON_IsObject(g_ran_node_ids_local)) { + ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [g_ran_node_ids]"); + goto end; + } + OpenAPI_global_ran_node_id_1_t *g_ran_node_idsItem = OpenAPI_global_ran_node_id_1_parseFromJSON(g_ran_node_ids_local); + if (!g_ran_node_idsItem) { + ogs_error("No g_ran_node_idsItem"); + OpenAPI_list_free(g_ran_node_idsList); + goto end; + } + OpenAPI_list_add(g_ran_node_idsList, g_ran_node_idsItem); } - - OpenAPI_list_add(g_ran_node_idsList, g_ran_node_idsItem); - } } - cJSON *tais = cJSON_GetObjectItemCaseSensitive(network_area_info_1JSON, "tais"); - - OpenAPI_list_t *taisList; + tais = cJSON_GetObjectItemCaseSensitive(network_area_info_1JSON, "tais"); if (tais) { - cJSON *tais_local_nonprimitive; - if (!cJSON_IsArray(tais)){ - ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [tais]"); - goto end; - } - - taisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tais_local_nonprimitive, tais ) { - if (!cJSON_IsObject(tais_local_nonprimitive)) { + cJSON *tais_local = NULL; + if (!cJSON_IsArray(tais)) { ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [tais]"); goto end; } - OpenAPI_tai_1_t *taisItem = OpenAPI_tai_1_parseFromJSON(tais_local_nonprimitive); - if (!taisItem) { - ogs_error("No taisItem"); - OpenAPI_list_free(taisList); - goto end; + taisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tais_local, tais) { + if (!cJSON_IsObject(tais_local)) { + ogs_error("OpenAPI_network_area_info_1_parseFromJSON() failed [tais]"); + goto end; + } + OpenAPI_tai_1_t *taisItem = OpenAPI_tai_1_parseFromJSON(tais_local); + if (!taisItem) { + ogs_error("No taisItem"); + OpenAPI_list_free(taisList); + goto end; + } + OpenAPI_list_add(taisList, taisItem); } - - OpenAPI_list_add(taisList, taisItem); - } } network_area_info_1_local_var = OpenAPI_network_area_info_1_create ( @@ -269,6 +260,34 @@ OpenAPI_network_area_info_1_t *OpenAPI_network_area_info_1_parseFromJSON(cJSON * return network_area_info_1_local_var; end: + if (ecgisList) { + OpenAPI_list_for_each(ecgisList, node) { + OpenAPI_ecgi_1_free(node->data); + } + OpenAPI_list_free(ecgisList); + ecgisList = NULL; + } + if (ncgisList) { + OpenAPI_list_for_each(ncgisList, node) { + OpenAPI_ncgi_1_free(node->data); + } + OpenAPI_list_free(ncgisList); + ncgisList = NULL; + } + if (g_ran_node_idsList) { + OpenAPI_list_for_each(g_ran_node_idsList, node) { + OpenAPI_global_ran_node_id_1_free(node->data); + } + OpenAPI_list_free(g_ran_node_idsList); + g_ran_node_idsList = NULL; + } + if (taisList) { + OpenAPI_list_for_each(taisList, node) { + OpenAPI_tai_1_free(node->data); + } + OpenAPI_list_free(taisList); + taisList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/network_node_diameter_address.c b/lib/sbi/openapi/model/network_node_diameter_address.c index 70bba1df7..fcc2ab60c 100644 --- a/lib/sbi/openapi/model/network_node_diameter_address.c +++ b/lib/sbi/openapi/model/network_node_diameter_address.c @@ -20,18 +20,26 @@ OpenAPI_network_node_diameter_address_t *OpenAPI_network_node_diameter_address_c void OpenAPI_network_node_diameter_address_free(OpenAPI_network_node_diameter_address_t *network_node_diameter_address) { + OpenAPI_lnode_t *node = NULL; + if (NULL == network_node_diameter_address) { return; } - OpenAPI_lnode_t *node; - ogs_free(network_node_diameter_address->name); - ogs_free(network_node_diameter_address->realm); + if (network_node_diameter_address->name) { + ogs_free(network_node_diameter_address->name); + network_node_diameter_address->name = NULL; + } + if (network_node_diameter_address->realm) { + ogs_free(network_node_diameter_address->realm); + network_node_diameter_address->realm = NULL; + } ogs_free(network_node_diameter_address); } cJSON *OpenAPI_network_node_diameter_address_convertToJSON(OpenAPI_network_node_diameter_address_t *network_node_diameter_address) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (network_node_diameter_address == NULL) { ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [NetworkNodeDiameterAddress]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_network_node_diameter_address_convertToJSON(OpenAPI_network_node_ } item = cJSON_CreateObject(); + if (!network_node_diameter_address->name) { + ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "name", network_node_diameter_address->name) == NULL) { ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [name]"); goto end; } + if (!network_node_diameter_address->realm) { + ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [realm]"); + return NULL; + } if (cJSON_AddStringToObject(item, "realm", network_node_diameter_address->realm) == NULL) { ogs_error("OpenAPI_network_node_diameter_address_convertToJSON() failed [realm]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_network_node_diameter_address_t *OpenAPI_network_node_diameter_address_parseFromJSON(cJSON *network_node_diameter_addressJSON) { OpenAPI_network_node_diameter_address_t *network_node_diameter_address_local_var = NULL; - cJSON *name = cJSON_GetObjectItemCaseSensitive(network_node_diameter_addressJSON, "name"); + OpenAPI_lnode_t *node = NULL; + cJSON *name = NULL; + cJSON *realm = NULL; + name = cJSON_GetObjectItemCaseSensitive(network_node_diameter_addressJSON, "name"); if (!name) { ogs_error("OpenAPI_network_node_diameter_address_parseFromJSON() failed [name]"); goto end; } - if (!cJSON_IsString(name)) { ogs_error("OpenAPI_network_node_diameter_address_parseFromJSON() failed [name]"); goto end; } - cJSON *realm = cJSON_GetObjectItemCaseSensitive(network_node_diameter_addressJSON, "realm"); + realm = cJSON_GetObjectItemCaseSensitive(network_node_diameter_addressJSON, "realm"); if (!realm) { ogs_error("OpenAPI_network_node_diameter_address_parseFromJSON() failed [realm]"); goto end; } - if (!cJSON_IsString(realm)) { ogs_error("OpenAPI_network_node_diameter_address_parseFromJSON() failed [realm]"); goto end; diff --git a/lib/sbi/openapi/model/network_node_diameter_address_1.c b/lib/sbi/openapi/model/network_node_diameter_address_1.c index 074d455d6..2f7d05b02 100644 --- a/lib/sbi/openapi/model/network_node_diameter_address_1.c +++ b/lib/sbi/openapi/model/network_node_diameter_address_1.c @@ -20,18 +20,26 @@ OpenAPI_network_node_diameter_address_1_t *OpenAPI_network_node_diameter_address void OpenAPI_network_node_diameter_address_1_free(OpenAPI_network_node_diameter_address_1_t *network_node_diameter_address_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == network_node_diameter_address_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(network_node_diameter_address_1->name); - ogs_free(network_node_diameter_address_1->realm); + if (network_node_diameter_address_1->name) { + ogs_free(network_node_diameter_address_1->name); + network_node_diameter_address_1->name = NULL; + } + if (network_node_diameter_address_1->realm) { + ogs_free(network_node_diameter_address_1->realm); + network_node_diameter_address_1->realm = NULL; + } ogs_free(network_node_diameter_address_1); } cJSON *OpenAPI_network_node_diameter_address_1_convertToJSON(OpenAPI_network_node_diameter_address_1_t *network_node_diameter_address_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (network_node_diameter_address_1 == NULL) { ogs_error("OpenAPI_network_node_diameter_address_1_convertToJSON() failed [NetworkNodeDiameterAddress_1]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_network_node_diameter_address_1_convertToJSON(OpenAPI_network_nod } item = cJSON_CreateObject(); + if (!network_node_diameter_address_1->name) { + ogs_error("OpenAPI_network_node_diameter_address_1_convertToJSON() failed [name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "name", network_node_diameter_address_1->name) == NULL) { ogs_error("OpenAPI_network_node_diameter_address_1_convertToJSON() failed [name]"); goto end; } + if (!network_node_diameter_address_1->realm) { + ogs_error("OpenAPI_network_node_diameter_address_1_convertToJSON() failed [realm]"); + return NULL; + } if (cJSON_AddStringToObject(item, "realm", network_node_diameter_address_1->realm) == NULL) { ogs_error("OpenAPI_network_node_diameter_address_1_convertToJSON() failed [realm]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_network_node_diameter_address_1_t *OpenAPI_network_node_diameter_address_1_parseFromJSON(cJSON *network_node_diameter_address_1JSON) { OpenAPI_network_node_diameter_address_1_t *network_node_diameter_address_1_local_var = NULL; - cJSON *name = cJSON_GetObjectItemCaseSensitive(network_node_diameter_address_1JSON, "name"); + OpenAPI_lnode_t *node = NULL; + cJSON *name = NULL; + cJSON *realm = NULL; + name = cJSON_GetObjectItemCaseSensitive(network_node_diameter_address_1JSON, "name"); if (!name) { ogs_error("OpenAPI_network_node_diameter_address_1_parseFromJSON() failed [name]"); goto end; } - if (!cJSON_IsString(name)) { ogs_error("OpenAPI_network_node_diameter_address_1_parseFromJSON() failed [name]"); goto end; } - cJSON *realm = cJSON_GetObjectItemCaseSensitive(network_node_diameter_address_1JSON, "realm"); + realm = cJSON_GetObjectItemCaseSensitive(network_node_diameter_address_1JSON, "realm"); if (!realm) { ogs_error("OpenAPI_network_node_diameter_address_1_parseFromJSON() failed [realm]"); goto end; } - if (!cJSON_IsString(realm)) { ogs_error("OpenAPI_network_node_diameter_address_1_parseFromJSON() failed [realm]"); goto end; diff --git a/lib/sbi/openapi/model/network_slice_cond.c b/lib/sbi/openapi/model/network_slice_cond.c index d8c874e76..af234d2c3 100644 --- a/lib/sbi/openapi/model/network_slice_cond.c +++ b/lib/sbi/openapi/model/network_slice_cond.c @@ -20,24 +20,32 @@ OpenAPI_network_slice_cond_t *OpenAPI_network_slice_cond_create( void OpenAPI_network_slice_cond_free(OpenAPI_network_slice_cond_t *network_slice_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == network_slice_cond) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(network_slice_cond->snssai_list, node) { - OpenAPI_snssai_free(node->data); + if (network_slice_cond->snssai_list) { + OpenAPI_list_for_each(network_slice_cond->snssai_list, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(network_slice_cond->snssai_list); + network_slice_cond->snssai_list = NULL; } - OpenAPI_list_free(network_slice_cond->snssai_list); - OpenAPI_list_for_each(network_slice_cond->nsi_list, node) { - ogs_free(node->data); + if (network_slice_cond->nsi_list) { + OpenAPI_list_for_each(network_slice_cond->nsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(network_slice_cond->nsi_list); + network_slice_cond->nsi_list = NULL; } - OpenAPI_list_free(network_slice_cond->nsi_list); ogs_free(network_slice_cond); } cJSON *OpenAPI_network_slice_cond_convertToJSON(OpenAPI_network_slice_cond_t *network_slice_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (network_slice_cond == NULL) { ogs_error("OpenAPI_network_slice_cond_convertToJSON() failed [NetworkSliceCond]"); @@ -45,38 +53,36 @@ cJSON *OpenAPI_network_slice_cond_convertToJSON(OpenAPI_network_slice_cond_t *ne } item = cJSON_CreateObject(); + if (!network_slice_cond->snssai_list) { + ogs_error("OpenAPI_network_slice_cond_convertToJSON() failed [snssai_list]"); + return NULL; + } cJSON *snssai_listList = cJSON_AddArrayToObject(item, "snssaiList"); if (snssai_listList == NULL) { ogs_error("OpenAPI_network_slice_cond_convertToJSON() failed [snssai_list]"); goto end; } - - OpenAPI_lnode_t *snssai_list_node; - if (network_slice_cond->snssai_list) { - OpenAPI_list_for_each(network_slice_cond->snssai_list, snssai_list_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_network_slice_cond_convertToJSON() failed [snssai_list]"); - goto end; - } - cJSON_AddItemToArray(snssai_listList, itemLocal); + OpenAPI_list_for_each(network_slice_cond->snssai_list, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_network_slice_cond_convertToJSON() failed [snssai_list]"); + goto end; } + cJSON_AddItemToArray(snssai_listList, itemLocal); } if (network_slice_cond->nsi_list) { - cJSON *nsi_list = cJSON_AddArrayToObject(item, "nsiList"); - if (nsi_list == NULL) { + cJSON *nsi_listList = cJSON_AddArrayToObject(item, "nsiList"); + if (nsi_listList == NULL) { ogs_error("OpenAPI_network_slice_cond_convertToJSON() failed [nsi_list]"); goto end; } - - OpenAPI_lnode_t *nsi_list_node; - OpenAPI_list_for_each(network_slice_cond->nsi_list, nsi_list_node) { - if (cJSON_AddStringToObject(nsi_list, "", (char*)nsi_list_node->data) == NULL) { - ogs_error("OpenAPI_network_slice_cond_convertToJSON() failed [nsi_list]"); - goto end; + OpenAPI_list_for_each(network_slice_cond->nsi_list, node) { + if (cJSON_AddStringToObject(nsi_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_network_slice_cond_convertToJSON() failed [nsi_list]"); + goto end; + } } - } } end: @@ -86,55 +92,57 @@ end: OpenAPI_network_slice_cond_t *OpenAPI_network_slice_cond_parseFromJSON(cJSON *network_slice_condJSON) { OpenAPI_network_slice_cond_t *network_slice_cond_local_var = NULL; - cJSON *snssai_list = cJSON_GetObjectItemCaseSensitive(network_slice_condJSON, "snssaiList"); + OpenAPI_lnode_t *node = NULL; + cJSON *snssai_list = NULL; + OpenAPI_list_t *snssai_listList = NULL; + cJSON *nsi_list = NULL; + OpenAPI_list_t *nsi_listList = NULL; + snssai_list = cJSON_GetObjectItemCaseSensitive(network_slice_condJSON, "snssaiList"); if (!snssai_list) { ogs_error("OpenAPI_network_slice_cond_parseFromJSON() failed [snssai_list]"); goto end; } - - OpenAPI_list_t *snssai_listList; - cJSON *snssai_list_local_nonprimitive; - if (!cJSON_IsArray(snssai_list)){ - ogs_error("OpenAPI_network_slice_cond_parseFromJSON() failed [snssai_list]"); - goto end; - } - - snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(snssai_list_local_nonprimitive, snssai_list ) { - if (!cJSON_IsObject(snssai_list_local_nonprimitive)) { + cJSON *snssai_list_local = NULL; + if (!cJSON_IsArray(snssai_list)) { ogs_error("OpenAPI_network_slice_cond_parseFromJSON() failed [snssai_list]"); goto end; } - OpenAPI_snssai_t *snssai_listItem = OpenAPI_snssai_parseFromJSON(snssai_list_local_nonprimitive); - if (!snssai_listItem) { - ogs_error("No snssai_listItem"); - OpenAPI_list_free(snssai_listList); + snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssai_list_local, snssai_list) { + if (!cJSON_IsObject(snssai_list_local)) { + ogs_error("OpenAPI_network_slice_cond_parseFromJSON() failed [snssai_list]"); + goto end; + } + OpenAPI_snssai_t *snssai_listItem = OpenAPI_snssai_parseFromJSON(snssai_list_local); + if (!snssai_listItem) { + ogs_error("No snssai_listItem"); + OpenAPI_list_free(snssai_listList); + goto end; + } + OpenAPI_list_add(snssai_listList, snssai_listItem); + } + + nsi_list = cJSON_GetObjectItemCaseSensitive(network_slice_condJSON, "nsiList"); + if (nsi_list) { + cJSON *nsi_list_local = NULL; + if (!cJSON_IsArray(nsi_list)) { + ogs_error("OpenAPI_network_slice_cond_parseFromJSON() failed [nsi_list]"); goto end; } - OpenAPI_list_add(snssai_listList, snssai_listItem); - } + nsi_listList = OpenAPI_list_create(); - cJSON *nsi_list = cJSON_GetObjectItemCaseSensitive(network_slice_condJSON, "nsiList"); - - OpenAPI_list_t *nsi_listList; - if (nsi_list) { - cJSON *nsi_list_local; - if (!cJSON_IsArray(nsi_list)) { - ogs_error("OpenAPI_network_slice_cond_parseFromJSON() failed [nsi_list]"); - goto end; - } - nsi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nsi_list_local, nsi_list) { - if (!cJSON_IsString(nsi_list_local)) { - ogs_error("OpenAPI_network_slice_cond_parseFromJSON() failed [nsi_list]"); - goto end; - } - OpenAPI_list_add(nsi_listList, ogs_strdup(nsi_list_local->valuestring)); - } + cJSON_ArrayForEach(nsi_list_local, nsi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(nsi_list_local)) { + ogs_error("OpenAPI_network_slice_cond_parseFromJSON() failed [nsi_list]"); + goto end; + } + OpenAPI_list_add(nsi_listList, ogs_strdup(nsi_list_local->valuestring)); + } } network_slice_cond_local_var = OpenAPI_network_slice_cond_create ( @@ -144,6 +152,20 @@ OpenAPI_network_slice_cond_t *OpenAPI_network_slice_cond_parseFromJSON(cJSON *ne return network_slice_cond_local_var; end: + if (snssai_listList) { + OpenAPI_list_for_each(snssai_listList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(snssai_listList); + snssai_listList = NULL; + } + if (nsi_listList) { + OpenAPI_list_for_each(nsi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nsi_listList); + nsi_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nf_group_cond.c b/lib/sbi/openapi/model/nf_group_cond.c index 018d47c20..82246ffa9 100644 --- a/lib/sbi/openapi/model/nf_group_cond.c +++ b/lib/sbi/openapi/model/nf_group_cond.c @@ -43,17 +43,22 @@ OpenAPI_nf_group_cond_t *OpenAPI_nf_group_cond_create( void OpenAPI_nf_group_cond_free(OpenAPI_nf_group_cond_t *nf_group_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_group_cond) { return; } - OpenAPI_lnode_t *node; - ogs_free(nf_group_cond->nf_group_id); + if (nf_group_cond->nf_group_id) { + ogs_free(nf_group_cond->nf_group_id); + nf_group_cond->nf_group_id = NULL; + } ogs_free(nf_group_cond); } cJSON *OpenAPI_nf_group_cond_convertToJSON(OpenAPI_nf_group_cond_t *nf_group_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_group_cond == NULL) { ogs_error("OpenAPI_nf_group_cond_convertToJSON() failed [NfGroupCond]"); @@ -61,11 +66,19 @@ cJSON *OpenAPI_nf_group_cond_convertToJSON(OpenAPI_nf_group_cond_t *nf_group_con } item = cJSON_CreateObject(); + if (nf_group_cond->nf_type == OpenAPI_nf_group_cond_NFTYPE_NULL) { + ogs_error("OpenAPI_nf_group_cond_convertToJSON() failed [nf_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfType", OpenAPI_nf_typenf_group_cond_ToString(nf_group_cond->nf_type)) == NULL) { ogs_error("OpenAPI_nf_group_cond_convertToJSON() failed [nf_type]"); goto end; } + if (!nf_group_cond->nf_group_id) { + ogs_error("OpenAPI_nf_group_cond_convertToJSON() failed [nf_group_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfGroupId", nf_group_cond->nf_group_id) == NULL) { ogs_error("OpenAPI_nf_group_cond_convertToJSON() failed [nf_group_id]"); goto end; @@ -78,25 +91,26 @@ end: OpenAPI_nf_group_cond_t *OpenAPI_nf_group_cond_parseFromJSON(cJSON *nf_group_condJSON) { OpenAPI_nf_group_cond_t *nf_group_cond_local_var = NULL; - cJSON *nf_type = cJSON_GetObjectItemCaseSensitive(nf_group_condJSON, "nfType"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_type = NULL; + OpenAPI_nf_group_cond_nf_type_e nf_typeVariable = 0; + cJSON *nf_group_id = NULL; + nf_type = cJSON_GetObjectItemCaseSensitive(nf_group_condJSON, "nfType"); if (!nf_type) { ogs_error("OpenAPI_nf_group_cond_parseFromJSON() failed [nf_type]"); goto end; } - - OpenAPI_nf_group_cond_nf_type_e nf_typeVariable; if (!cJSON_IsString(nf_type)) { ogs_error("OpenAPI_nf_group_cond_parseFromJSON() failed [nf_type]"); goto end; } nf_typeVariable = OpenAPI_nf_typenf_group_cond_FromString(nf_type->valuestring); - cJSON *nf_group_id = cJSON_GetObjectItemCaseSensitive(nf_group_condJSON, "nfGroupId"); + nf_group_id = cJSON_GetObjectItemCaseSensitive(nf_group_condJSON, "nfGroupId"); if (!nf_group_id) { ogs_error("OpenAPI_nf_group_cond_parseFromJSON() failed [nf_group_id]"); goto end; } - if (!cJSON_IsString(nf_group_id)) { ogs_error("OpenAPI_nf_group_cond_parseFromJSON() failed [nf_group_id]"); goto end; diff --git a/lib/sbi/openapi/model/nf_info.c b/lib/sbi/openapi/model/nf_info.c index bdba28ee1..7a75ddd8e 100644 --- a/lib/sbi/openapi/model/nf_info.c +++ b/lib/sbi/openapi/model/nf_info.c @@ -18,16 +18,18 @@ OpenAPI_nf_info_t *OpenAPI_nf_info_create( void OpenAPI_nf_info_free(OpenAPI_nf_info_t *nf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_info) { return; } - OpenAPI_lnode_t *node; ogs_free(nf_info); } cJSON *OpenAPI_nf_info_convertToJSON(OpenAPI_nf_info_t *nf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_info == NULL) { ogs_error("OpenAPI_nf_info_convertToJSON() failed [NfInfo]"); @@ -35,7 +37,7 @@ cJSON *OpenAPI_nf_info_convertToJSON(OpenAPI_nf_info_t *nf_info) } item = cJSON_CreateObject(); - if (nf_info->nf_type) { + if (nf_info->nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "nfType", OpenAPI_nf_type_ToString(nf_info->nf_type)) == NULL) { ogs_error("OpenAPI_nf_info_convertToJSON() failed [nf_type]"); goto end; @@ -49,9 +51,10 @@ end: OpenAPI_nf_info_t *OpenAPI_nf_info_parseFromJSON(cJSON *nf_infoJSON) { OpenAPI_nf_info_t *nf_info_local_var = NULL; - cJSON *nf_type = cJSON_GetObjectItemCaseSensitive(nf_infoJSON, "nfType"); - - OpenAPI_nf_type_e nf_typeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *nf_type = NULL; + OpenAPI_nf_type_e nf_typeVariable = 0; + nf_type = cJSON_GetObjectItemCaseSensitive(nf_infoJSON, "nfType"); if (nf_type) { if (!cJSON_IsString(nf_type)) { ogs_error("OpenAPI_nf_info_parseFromJSON() failed [nf_type]"); diff --git a/lib/sbi/openapi/model/nf_instance_id_cond.c b/lib/sbi/openapi/model/nf_instance_id_cond.c index 2c45cf5bb..586af9058 100644 --- a/lib/sbi/openapi/model/nf_instance_id_cond.c +++ b/lib/sbi/openapi/model/nf_instance_id_cond.c @@ -18,17 +18,22 @@ OpenAPI_nf_instance_id_cond_t *OpenAPI_nf_instance_id_cond_create( void OpenAPI_nf_instance_id_cond_free(OpenAPI_nf_instance_id_cond_t *nf_instance_id_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_instance_id_cond) { return; } - OpenAPI_lnode_t *node; - ogs_free(nf_instance_id_cond->nf_instance_id); + if (nf_instance_id_cond->nf_instance_id) { + ogs_free(nf_instance_id_cond->nf_instance_id); + nf_instance_id_cond->nf_instance_id = NULL; + } ogs_free(nf_instance_id_cond); } cJSON *OpenAPI_nf_instance_id_cond_convertToJSON(OpenAPI_nf_instance_id_cond_t *nf_instance_id_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_instance_id_cond == NULL) { ogs_error("OpenAPI_nf_instance_id_cond_convertToJSON() failed [NfInstanceIdCond]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_nf_instance_id_cond_convertToJSON(OpenAPI_nf_instance_id_cond_t * } item = cJSON_CreateObject(); + if (!nf_instance_id_cond->nf_instance_id) { + ogs_error("OpenAPI_nf_instance_id_cond_convertToJSON() failed [nf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfInstanceId", nf_instance_id_cond->nf_instance_id) == NULL) { ogs_error("OpenAPI_nf_instance_id_cond_convertToJSON() failed [nf_instance_id]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_nf_instance_id_cond_t *OpenAPI_nf_instance_id_cond_parseFromJSON(cJSON *nf_instance_id_condJSON) { OpenAPI_nf_instance_id_cond_t *nf_instance_id_cond_local_var = NULL; - cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(nf_instance_id_condJSON, "nfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instance_id = NULL; + nf_instance_id = cJSON_GetObjectItemCaseSensitive(nf_instance_id_condJSON, "nfInstanceId"); if (!nf_instance_id) { ogs_error("OpenAPI_nf_instance_id_cond_parseFromJSON() failed [nf_instance_id]"); goto end; } - if (!cJSON_IsString(nf_instance_id)) { ogs_error("OpenAPI_nf_instance_id_cond_parseFromJSON() failed [nf_instance_id]"); goto end; diff --git a/lib/sbi/openapi/model/nf_instance_id_list_cond.c b/lib/sbi/openapi/model/nf_instance_id_list_cond.c index 55dd844ab..8b5b5175e 100644 --- a/lib/sbi/openapi/model/nf_instance_id_list_cond.c +++ b/lib/sbi/openapi/model/nf_instance_id_list_cond.c @@ -18,20 +18,25 @@ OpenAPI_nf_instance_id_list_cond_t *OpenAPI_nf_instance_id_list_cond_create( void OpenAPI_nf_instance_id_list_cond_free(OpenAPI_nf_instance_id_list_cond_t *nf_instance_id_list_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_instance_id_list_cond) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(nf_instance_id_list_cond->nf_instance_id_list, node) { - ogs_free(node->data); + if (nf_instance_id_list_cond->nf_instance_id_list) { + OpenAPI_list_for_each(nf_instance_id_list_cond->nf_instance_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_instance_id_list_cond->nf_instance_id_list); + nf_instance_id_list_cond->nf_instance_id_list = NULL; } - OpenAPI_list_free(nf_instance_id_list_cond->nf_instance_id_list); ogs_free(nf_instance_id_list_cond); } cJSON *OpenAPI_nf_instance_id_list_cond_convertToJSON(OpenAPI_nf_instance_id_list_cond_t *nf_instance_id_list_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_instance_id_list_cond == NULL) { ogs_error("OpenAPI_nf_instance_id_list_cond_convertToJSON() failed [NfInstanceIdListCond]"); @@ -39,19 +44,21 @@ cJSON *OpenAPI_nf_instance_id_list_cond_convertToJSON(OpenAPI_nf_instance_id_lis } item = cJSON_CreateObject(); - cJSON *nf_instance_id_list = cJSON_AddArrayToObject(item, "nfInstanceIdList"); - if (nf_instance_id_list == NULL) { + if (!nf_instance_id_list_cond->nf_instance_id_list) { + ogs_error("OpenAPI_nf_instance_id_list_cond_convertToJSON() failed [nf_instance_id_list]"); + return NULL; + } + cJSON *nf_instance_id_listList = cJSON_AddArrayToObject(item, "nfInstanceIdList"); + if (nf_instance_id_listList == NULL) { ogs_error("OpenAPI_nf_instance_id_list_cond_convertToJSON() failed [nf_instance_id_list]"); goto end; } - - OpenAPI_lnode_t *nf_instance_id_list_node; - OpenAPI_list_for_each(nf_instance_id_list_cond->nf_instance_id_list, nf_instance_id_list_node) { - if (cJSON_AddStringToObject(nf_instance_id_list, "", (char*)nf_instance_id_list_node->data) == NULL) { - ogs_error("OpenAPI_nf_instance_id_list_cond_convertToJSON() failed [nf_instance_id_list]"); - goto end; + OpenAPI_list_for_each(nf_instance_id_list_cond->nf_instance_id_list, node) { + if (cJSON_AddStringToObject(nf_instance_id_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_instance_id_list_cond_convertToJSON() failed [nf_instance_id_list]"); + goto end; + } } - } end: return item; @@ -60,27 +67,31 @@ end: OpenAPI_nf_instance_id_list_cond_t *OpenAPI_nf_instance_id_list_cond_parseFromJSON(cJSON *nf_instance_id_list_condJSON) { OpenAPI_nf_instance_id_list_cond_t *nf_instance_id_list_cond_local_var = NULL; - cJSON *nf_instance_id_list = cJSON_GetObjectItemCaseSensitive(nf_instance_id_list_condJSON, "nfInstanceIdList"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instance_id_list = NULL; + OpenAPI_list_t *nf_instance_id_listList = NULL; + nf_instance_id_list = cJSON_GetObjectItemCaseSensitive(nf_instance_id_list_condJSON, "nfInstanceIdList"); if (!nf_instance_id_list) { ogs_error("OpenAPI_nf_instance_id_list_cond_parseFromJSON() failed [nf_instance_id_list]"); goto end; } + cJSON *nf_instance_id_list_local = NULL; + if (!cJSON_IsArray(nf_instance_id_list)) { + ogs_error("OpenAPI_nf_instance_id_list_cond_parseFromJSON() failed [nf_instance_id_list]"); + goto end; + } - OpenAPI_list_t *nf_instance_id_listList; - cJSON *nf_instance_id_list_local; - if (!cJSON_IsArray(nf_instance_id_list)) { - ogs_error("OpenAPI_nf_instance_id_list_cond_parseFromJSON() failed [nf_instance_id_list]"); - goto end; - } - nf_instance_id_listList = OpenAPI_list_create(); + nf_instance_id_listList = OpenAPI_list_create(); - cJSON_ArrayForEach(nf_instance_id_list_local, nf_instance_id_list) { - if (!cJSON_IsString(nf_instance_id_list_local)) { - ogs_error("OpenAPI_nf_instance_id_list_cond_parseFromJSON() failed [nf_instance_id_list]"); - goto end; - } - OpenAPI_list_add(nf_instance_id_listList, ogs_strdup(nf_instance_id_list_local->valuestring)); - } + cJSON_ArrayForEach(nf_instance_id_list_local, nf_instance_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(nf_instance_id_list_local)) { + ogs_error("OpenAPI_nf_instance_id_list_cond_parseFromJSON() failed [nf_instance_id_list]"); + goto end; + } + OpenAPI_list_add(nf_instance_id_listList, ogs_strdup(nf_instance_id_list_local->valuestring)); + } nf_instance_id_list_cond_local_var = OpenAPI_nf_instance_id_list_cond_create ( nf_instance_id_listList @@ -88,6 +99,13 @@ OpenAPI_nf_instance_id_list_cond_t *OpenAPI_nf_instance_id_list_cond_parseFromJS return nf_instance_id_list_cond_local_var; end: + if (nf_instance_id_listList) { + OpenAPI_list_for_each(nf_instance_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_instance_id_listList); + nf_instance_id_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nf_profile.c b/lib/sbi/openapi/model/nf_profile.c index c1963dbba..67e877acc 100644 --- a/lib/sbi/openapi/model/nf_profile.c +++ b/lib/sbi/openapi/model/nf_profile.c @@ -168,210 +168,380 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_create( void OpenAPI_nf_profile_free(OpenAPI_nf_profile_t *nf_profile) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_profile) { return; } - OpenAPI_lnode_t *node; - ogs_free(nf_profile->nf_instance_id); - ogs_free(nf_profile->nf_instance_name); - OpenAPI_list_for_each(nf_profile->plmn_list, node) { - OpenAPI_plmn_id_free(node->data); + if (nf_profile->nf_instance_id) { + ogs_free(nf_profile->nf_instance_id); + nf_profile->nf_instance_id = NULL; } - OpenAPI_list_free(nf_profile->plmn_list); - OpenAPI_list_for_each(nf_profile->snpn_list, node) { - OpenAPI_plmn_id_nid_free(node->data); + if (nf_profile->nf_instance_name) { + ogs_free(nf_profile->nf_instance_name); + nf_profile->nf_instance_name = NULL; } - OpenAPI_list_free(nf_profile->snpn_list); - OpenAPI_list_for_each(nf_profile->s_nssais, node) { - OpenAPI_ext_snssai_free(node->data); + if (nf_profile->plmn_list) { + OpenAPI_list_for_each(nf_profile->plmn_list, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(nf_profile->plmn_list); + nf_profile->plmn_list = NULL; } - OpenAPI_list_free(nf_profile->s_nssais); - OpenAPI_list_for_each(nf_profile->per_plmn_snssai_list, node) { - OpenAPI_plmn_snssai_free(node->data); + if (nf_profile->snpn_list) { + OpenAPI_list_for_each(nf_profile->snpn_list, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(nf_profile->snpn_list); + nf_profile->snpn_list = NULL; } - OpenAPI_list_free(nf_profile->per_plmn_snssai_list); - OpenAPI_list_for_each(nf_profile->nsi_list, node) { - ogs_free(node->data); + if (nf_profile->s_nssais) { + OpenAPI_list_for_each(nf_profile->s_nssais, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(nf_profile->s_nssais); + nf_profile->s_nssais = NULL; } - OpenAPI_list_free(nf_profile->nsi_list); - ogs_free(nf_profile->fqdn); - ogs_free(nf_profile->inter_plmn_fqdn); - OpenAPI_list_for_each(nf_profile->ipv4_addresses, node) { - ogs_free(node->data); + if (nf_profile->per_plmn_snssai_list) { + OpenAPI_list_for_each(nf_profile->per_plmn_snssai_list, node) { + OpenAPI_plmn_snssai_free(node->data); + } + OpenAPI_list_free(nf_profile->per_plmn_snssai_list); + nf_profile->per_plmn_snssai_list = NULL; } - OpenAPI_list_free(nf_profile->ipv4_addresses); - OpenAPI_list_for_each(nf_profile->ipv6_addresses, node) { - ogs_free(node->data); + if (nf_profile->nsi_list) { + OpenAPI_list_for_each(nf_profile->nsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->nsi_list); + nf_profile->nsi_list = NULL; } - OpenAPI_list_free(nf_profile->ipv6_addresses); - OpenAPI_list_for_each(nf_profile->allowed_plmns, node) { - OpenAPI_plmn_id_free(node->data); + if (nf_profile->fqdn) { + ogs_free(nf_profile->fqdn); + nf_profile->fqdn = NULL; } - OpenAPI_list_free(nf_profile->allowed_plmns); - OpenAPI_list_for_each(nf_profile->allowed_snpns, node) { - OpenAPI_plmn_id_nid_free(node->data); + if (nf_profile->inter_plmn_fqdn) { + ogs_free(nf_profile->inter_plmn_fqdn); + nf_profile->inter_plmn_fqdn = NULL; } - OpenAPI_list_free(nf_profile->allowed_snpns); - OpenAPI_list_free(nf_profile->allowed_nf_types); - OpenAPI_list_for_each(nf_profile->allowed_nf_domains, node) { - ogs_free(node->data); + if (nf_profile->ipv4_addresses) { + OpenAPI_list_for_each(nf_profile->ipv4_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->ipv4_addresses); + nf_profile->ipv4_addresses = NULL; } - OpenAPI_list_free(nf_profile->allowed_nf_domains); - OpenAPI_list_for_each(nf_profile->allowed_nssais, node) { - OpenAPI_ext_snssai_free(node->data); + if (nf_profile->ipv6_addresses) { + OpenAPI_list_for_each(nf_profile->ipv6_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->ipv6_addresses); + nf_profile->ipv6_addresses = NULL; } - OpenAPI_list_free(nf_profile->allowed_nssais); - ogs_free(nf_profile->load_time_stamp); - ogs_free(nf_profile->locality); - OpenAPI_udr_info_free(nf_profile->udr_info); - OpenAPI_list_for_each(nf_profile->udr_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_udr_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->allowed_plmns) { + OpenAPI_list_for_each(nf_profile->allowed_plmns, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(nf_profile->allowed_plmns); + nf_profile->allowed_plmns = NULL; } - OpenAPI_list_free(nf_profile->udr_info_list); - OpenAPI_udm_info_free(nf_profile->udm_info); - OpenAPI_list_for_each(nf_profile->udm_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_udm_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->allowed_snpns) { + OpenAPI_list_for_each(nf_profile->allowed_snpns, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(nf_profile->allowed_snpns); + nf_profile->allowed_snpns = NULL; } - OpenAPI_list_free(nf_profile->udm_info_list); - OpenAPI_ausf_info_free(nf_profile->ausf_info); - OpenAPI_list_for_each(nf_profile->ausf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_ausf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->allowed_nf_types) { + OpenAPI_list_free(nf_profile->allowed_nf_types); + nf_profile->allowed_nf_types = NULL; } - OpenAPI_list_free(nf_profile->ausf_info_list); - OpenAPI_amf_info_free(nf_profile->amf_info); - OpenAPI_list_for_each(nf_profile->amf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_amf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->allowed_nf_domains) { + OpenAPI_list_for_each(nf_profile->allowed_nf_domains, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->allowed_nf_domains); + nf_profile->allowed_nf_domains = NULL; } - OpenAPI_list_free(nf_profile->amf_info_list); - OpenAPI_smf_info_free(nf_profile->smf_info); - OpenAPI_list_for_each(nf_profile->smf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_smf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->allowed_nssais) { + OpenAPI_list_for_each(nf_profile->allowed_nssais, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(nf_profile->allowed_nssais); + nf_profile->allowed_nssais = NULL; } - OpenAPI_list_free(nf_profile->smf_info_list); - OpenAPI_upf_info_free(nf_profile->upf_info); - OpenAPI_list_for_each(nf_profile->upf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_upf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->load_time_stamp) { + ogs_free(nf_profile->load_time_stamp); + nf_profile->load_time_stamp = NULL; } - OpenAPI_list_free(nf_profile->upf_info_list); - OpenAPI_pcf_info_free(nf_profile->pcf_info); - OpenAPI_list_for_each(nf_profile->pcf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_pcf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->locality) { + ogs_free(nf_profile->locality); + nf_profile->locality = NULL; } - OpenAPI_list_free(nf_profile->pcf_info_list); - OpenAPI_bsf_info_free(nf_profile->bsf_info); - OpenAPI_list_for_each(nf_profile->bsf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_bsf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->udr_info) { + OpenAPI_udr_info_free(nf_profile->udr_info); + nf_profile->udr_info = NULL; } - OpenAPI_list_free(nf_profile->bsf_info_list); - OpenAPI_chf_info_free(nf_profile->chf_info); - OpenAPI_list_for_each(nf_profile->chf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_chf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->udr_info_list) { + OpenAPI_list_for_each(nf_profile->udr_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_udr_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->udr_info_list); + nf_profile->udr_info_list = NULL; } - OpenAPI_list_free(nf_profile->chf_info_list); - OpenAPI_nef_info_free(nf_profile->nef_info); - OpenAPI_nrf_info_free(nf_profile->nrf_info); - OpenAPI_udsf_info_free(nf_profile->udsf_info); - OpenAPI_list_for_each(nf_profile->udsf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_udsf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->udm_info) { + OpenAPI_udm_info_free(nf_profile->udm_info); + nf_profile->udm_info = NULL; } - OpenAPI_list_free(nf_profile->udsf_info_list); - OpenAPI_nwdaf_info_free(nf_profile->nwdaf_info); - OpenAPI_list_for_each(nf_profile->pcscf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_pcscf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->udm_info_list) { + OpenAPI_list_for_each(nf_profile->udm_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_udm_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->udm_info_list); + nf_profile->udm_info_list = NULL; } - OpenAPI_list_free(nf_profile->pcscf_info_list); - OpenAPI_list_for_each(nf_profile->hss_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_hss_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->ausf_info) { + OpenAPI_ausf_info_free(nf_profile->ausf_info); + nf_profile->ausf_info = NULL; } - OpenAPI_list_free(nf_profile->hss_info_list); - OpenAPI_object_free(nf_profile->custom_info); - ogs_free(nf_profile->recovery_time); - OpenAPI_list_for_each(nf_profile->nf_services, node) { - OpenAPI_nf_service_free(node->data); + if (nf_profile->ausf_info_list) { + OpenAPI_list_for_each(nf_profile->ausf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_ausf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->ausf_info_list); + nf_profile->ausf_info_list = NULL; } - OpenAPI_list_free(nf_profile->nf_services); - OpenAPI_list_for_each(nf_profile->nf_service_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_nf_service_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->amf_info) { + OpenAPI_amf_info_free(nf_profile->amf_info); + nf_profile->amf_info = NULL; } - OpenAPI_list_free(nf_profile->nf_service_list); - OpenAPI_list_for_each(nf_profile->default_notification_subscriptions, node) { - OpenAPI_default_notification_subscription_free(node->data); + if (nf_profile->amf_info_list) { + OpenAPI_list_for_each(nf_profile->amf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_amf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->amf_info_list); + nf_profile->amf_info_list = NULL; } - OpenAPI_list_free(nf_profile->default_notification_subscriptions); - OpenAPI_lmf_info_free(nf_profile->lmf_info); - OpenAPI_gmlc_info_free(nf_profile->gmlc_info); - OpenAPI_list_for_each(nf_profile->nf_set_id_list, node) { - ogs_free(node->data); + if (nf_profile->smf_info) { + OpenAPI_smf_info_free(nf_profile->smf_info); + nf_profile->smf_info = NULL; } - OpenAPI_list_free(nf_profile->nf_set_id_list); - OpenAPI_list_for_each(nf_profile->serving_scope, node) { - ogs_free(node->data); + if (nf_profile->smf_info_list) { + OpenAPI_list_for_each(nf_profile->smf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_smf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->smf_info_list); + nf_profile->smf_info_list = NULL; } - OpenAPI_list_free(nf_profile->serving_scope); - OpenAPI_list_for_each(nf_profile->nf_set_recovery_time_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->upf_info) { + OpenAPI_upf_info_free(nf_profile->upf_info); + nf_profile->upf_info = NULL; } - OpenAPI_list_free(nf_profile->nf_set_recovery_time_list); - OpenAPI_list_for_each(nf_profile->service_set_recovery_time_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_profile->upf_info_list) { + OpenAPI_list_for_each(nf_profile->upf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_upf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->upf_info_list); + nf_profile->upf_info_list = NULL; } - OpenAPI_list_free(nf_profile->service_set_recovery_time_list); - OpenAPI_list_for_each(nf_profile->scp_domains, node) { - ogs_free(node->data); + if (nf_profile->pcf_info) { + OpenAPI_pcf_info_free(nf_profile->pcf_info); + nf_profile->pcf_info = NULL; + } + if (nf_profile->pcf_info_list) { + OpenAPI_list_for_each(nf_profile->pcf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_pcf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->pcf_info_list); + nf_profile->pcf_info_list = NULL; + } + if (nf_profile->bsf_info) { + OpenAPI_bsf_info_free(nf_profile->bsf_info); + nf_profile->bsf_info = NULL; + } + if (nf_profile->bsf_info_list) { + OpenAPI_list_for_each(nf_profile->bsf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_bsf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->bsf_info_list); + nf_profile->bsf_info_list = NULL; + } + if (nf_profile->chf_info) { + OpenAPI_chf_info_free(nf_profile->chf_info); + nf_profile->chf_info = NULL; + } + if (nf_profile->chf_info_list) { + OpenAPI_list_for_each(nf_profile->chf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_chf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->chf_info_list); + nf_profile->chf_info_list = NULL; + } + if (nf_profile->nef_info) { + OpenAPI_nef_info_free(nf_profile->nef_info); + nf_profile->nef_info = NULL; + } + if (nf_profile->nrf_info) { + OpenAPI_nrf_info_free(nf_profile->nrf_info); + nf_profile->nrf_info = NULL; + } + if (nf_profile->udsf_info) { + OpenAPI_udsf_info_free(nf_profile->udsf_info); + nf_profile->udsf_info = NULL; + } + if (nf_profile->udsf_info_list) { + OpenAPI_list_for_each(nf_profile->udsf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_udsf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->udsf_info_list); + nf_profile->udsf_info_list = NULL; + } + if (nf_profile->nwdaf_info) { + OpenAPI_nwdaf_info_free(nf_profile->nwdaf_info); + nf_profile->nwdaf_info = NULL; + } + if (nf_profile->pcscf_info_list) { + OpenAPI_list_for_each(nf_profile->pcscf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_pcscf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->pcscf_info_list); + nf_profile->pcscf_info_list = NULL; + } + if (nf_profile->hss_info_list) { + OpenAPI_list_for_each(nf_profile->hss_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_hss_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->hss_info_list); + nf_profile->hss_info_list = NULL; + } + if (nf_profile->custom_info) { + OpenAPI_object_free(nf_profile->custom_info); + nf_profile->custom_info = NULL; + } + if (nf_profile->recovery_time) { + ogs_free(nf_profile->recovery_time); + nf_profile->recovery_time = NULL; + } + if (nf_profile->nf_services) { + OpenAPI_list_for_each(nf_profile->nf_services, node) { + OpenAPI_nf_service_free(node->data); + } + OpenAPI_list_free(nf_profile->nf_services); + nf_profile->nf_services = NULL; + } + if (nf_profile->nf_service_list) { + OpenAPI_list_for_each(nf_profile->nf_service_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_nf_service_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->nf_service_list); + nf_profile->nf_service_list = NULL; + } + if (nf_profile->default_notification_subscriptions) { + OpenAPI_list_for_each(nf_profile->default_notification_subscriptions, node) { + OpenAPI_default_notification_subscription_free(node->data); + } + OpenAPI_list_free(nf_profile->default_notification_subscriptions); + nf_profile->default_notification_subscriptions = NULL; + } + if (nf_profile->lmf_info) { + OpenAPI_lmf_info_free(nf_profile->lmf_info); + nf_profile->lmf_info = NULL; + } + if (nf_profile->gmlc_info) { + OpenAPI_gmlc_info_free(nf_profile->gmlc_info); + nf_profile->gmlc_info = NULL; + } + if (nf_profile->nf_set_id_list) { + OpenAPI_list_for_each(nf_profile->nf_set_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->nf_set_id_list); + nf_profile->nf_set_id_list = NULL; + } + if (nf_profile->serving_scope) { + OpenAPI_list_for_each(nf_profile->serving_scope, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->serving_scope); + nf_profile->serving_scope = NULL; + } + if (nf_profile->nf_set_recovery_time_list) { + OpenAPI_list_for_each(nf_profile->nf_set_recovery_time_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->nf_set_recovery_time_list); + nf_profile->nf_set_recovery_time_list = NULL; + } + if (nf_profile->service_set_recovery_time_list) { + OpenAPI_list_for_each(nf_profile->service_set_recovery_time_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_profile->service_set_recovery_time_list); + nf_profile->service_set_recovery_time_list = NULL; + } + if (nf_profile->scp_domains) { + OpenAPI_list_for_each(nf_profile->scp_domains, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_profile->scp_domains); + nf_profile->scp_domains = NULL; + } + if (nf_profile->scp_info) { + OpenAPI_scp_info_free(nf_profile->scp_info); + nf_profile->scp_info = NULL; } - OpenAPI_list_free(nf_profile->scp_domains); - OpenAPI_scp_info_free(nf_profile->scp_info); ogs_free(nf_profile); } cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_profile == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [NFProfile]"); @@ -379,6 +549,10 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } item = cJSON_CreateObject(); + if (!nf_profile->nf_instance_id) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfInstanceId", nf_profile->nf_instance_id) == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_instance_id]"); goto end; @@ -391,11 +565,19 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } } + if (nf_profile->nf_type == OpenAPI_nf_type_NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfType", OpenAPI_nf_type_ToString(nf_profile->nf_type)) == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_type]"); goto end; } + if (nf_profile->nf_status == OpenAPI_nf_status_NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfStatus", OpenAPI_nf_status_ToString(nf_profile->nf_status)) == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_status]"); goto end; @@ -414,17 +596,13 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [plmn_list]"); goto end; } - - OpenAPI_lnode_t *plmn_list_node; - if (nf_profile->plmn_list) { - OpenAPI_list_for_each(nf_profile->plmn_list, plmn_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(plmn_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [plmn_list]"); - goto end; - } - cJSON_AddItemToArray(plmn_listList, itemLocal); + OpenAPI_list_for_each(nf_profile->plmn_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [plmn_list]"); + goto end; } + cJSON_AddItemToArray(plmn_listList, itemLocal); } } @@ -434,17 +612,13 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [snpn_list]"); goto end; } - - OpenAPI_lnode_t *snpn_list_node; - if (nf_profile->snpn_list) { - OpenAPI_list_for_each(nf_profile->snpn_list, snpn_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(snpn_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [snpn_list]"); - goto end; - } - cJSON_AddItemToArray(snpn_listList, itemLocal); + OpenAPI_list_for_each(nf_profile->snpn_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [snpn_list]"); + goto end; } + cJSON_AddItemToArray(snpn_listList, itemLocal); } } @@ -454,17 +628,13 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [s_nssais]"); goto end; } - - OpenAPI_lnode_t *s_nssais_node; - if (nf_profile->s_nssais) { - OpenAPI_list_for_each(nf_profile->s_nssais, s_nssais_node) { - cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(s_nssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [s_nssais]"); - goto end; - } - cJSON_AddItemToArray(s_nssaisList, itemLocal); + OpenAPI_list_for_each(nf_profile->s_nssais, node) { + cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [s_nssais]"); + goto end; } + cJSON_AddItemToArray(s_nssaisList, itemLocal); } } @@ -474,34 +644,28 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [per_plmn_snssai_list]"); goto end; } - - OpenAPI_lnode_t *per_plmn_snssai_list_node; - if (nf_profile->per_plmn_snssai_list) { - OpenAPI_list_for_each(nf_profile->per_plmn_snssai_list, per_plmn_snssai_list_node) { - cJSON *itemLocal = OpenAPI_plmn_snssai_convertToJSON(per_plmn_snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [per_plmn_snssai_list]"); - goto end; - } - cJSON_AddItemToArray(per_plmn_snssai_listList, itemLocal); + OpenAPI_list_for_each(nf_profile->per_plmn_snssai_list, node) { + cJSON *itemLocal = OpenAPI_plmn_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [per_plmn_snssai_list]"); + goto end; } + cJSON_AddItemToArray(per_plmn_snssai_listList, itemLocal); } } if (nf_profile->nsi_list) { - cJSON *nsi_list = cJSON_AddArrayToObject(item, "nsiList"); - if (nsi_list == NULL) { + cJSON *nsi_listList = cJSON_AddArrayToObject(item, "nsiList"); + if (nsi_listList == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nsi_list]"); goto end; } - - OpenAPI_lnode_t *nsi_list_node; - OpenAPI_list_for_each(nf_profile->nsi_list, nsi_list_node) { - if (cJSON_AddStringToObject(nsi_list, "", (char*)nsi_list_node->data) == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nsi_list]"); - goto end; + OpenAPI_list_for_each(nf_profile->nsi_list, node) { + if (cJSON_AddStringToObject(nsi_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nsi_list]"); + goto end; + } } - } } if (nf_profile->fqdn) { @@ -519,35 +683,31 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } if (nf_profile->ipv4_addresses) { - cJSON *ipv4_addresses = cJSON_AddArrayToObject(item, "ipv4Addresses"); - if (ipv4_addresses == NULL) { + cJSON *ipv4_addressesList = cJSON_AddArrayToObject(item, "ipv4Addresses"); + if (ipv4_addressesList == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [ipv4_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv4_addresses_node; - OpenAPI_list_for_each(nf_profile->ipv4_addresses, ipv4_addresses_node) { - if (cJSON_AddStringToObject(ipv4_addresses, "", (char*)ipv4_addresses_node->data) == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [ipv4_addresses]"); - goto end; + OpenAPI_list_for_each(nf_profile->ipv4_addresses, node) { + if (cJSON_AddStringToObject(ipv4_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [ipv4_addresses]"); + goto end; + } } - } } if (nf_profile->ipv6_addresses) { - cJSON *ipv6_addresses = cJSON_AddArrayToObject(item, "ipv6Addresses"); - if (ipv6_addresses == NULL) { + cJSON *ipv6_addressesList = cJSON_AddArrayToObject(item, "ipv6Addresses"); + if (ipv6_addressesList == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [ipv6_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv6_addresses_node; - OpenAPI_list_for_each(nf_profile->ipv6_addresses, ipv6_addresses_node) { - if (cJSON_AddStringToObject(ipv6_addresses, "", (char*)ipv6_addresses_node->data) == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [ipv6_addresses]"); - goto end; + OpenAPI_list_for_each(nf_profile->ipv6_addresses, node) { + if (cJSON_AddStringToObject(ipv6_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [ipv6_addresses]"); + goto end; + } } - } } if (nf_profile->allowed_plmns) { @@ -556,17 +716,13 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_plmns]"); goto end; } - - OpenAPI_lnode_t *allowed_plmns_node; - if (nf_profile->allowed_plmns) { - OpenAPI_list_for_each(nf_profile->allowed_plmns, allowed_plmns_node) { - cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(allowed_plmns_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_plmns]"); - goto end; - } - cJSON_AddItemToArray(allowed_plmnsList, itemLocal); + OpenAPI_list_for_each(nf_profile->allowed_plmns, node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_plmns]"); + goto end; } + cJSON_AddItemToArray(allowed_plmnsList, itemLocal); } } @@ -576,29 +732,24 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_snpns]"); goto end; } - - OpenAPI_lnode_t *allowed_snpns_node; - if (nf_profile->allowed_snpns) { - OpenAPI_list_for_each(nf_profile->allowed_snpns, allowed_snpns_node) { - cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(allowed_snpns_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_snpns]"); - goto end; - } - cJSON_AddItemToArray(allowed_snpnsList, itemLocal); + OpenAPI_list_for_each(nf_profile->allowed_snpns, node) { + cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_snpns]"); + goto end; } + cJSON_AddItemToArray(allowed_snpnsList, itemLocal); } } - if (nf_profile->allowed_nf_types) { - cJSON *allowed_nf_types = cJSON_AddArrayToObject(item, "allowedNfTypes"); - if (allowed_nf_types == NULL) { + if (nf_profile->allowed_nf_types != OpenAPI_nf_type_NULL) { + cJSON *allowed_nf_typesList = cJSON_AddArrayToObject(item, "allowedNfTypes"); + if (allowed_nf_typesList == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_nf_types]"); goto end; } - OpenAPI_lnode_t *allowed_nf_types_node; - OpenAPI_list_for_each(nf_profile->allowed_nf_types, allowed_nf_types_node) { - if (cJSON_AddStringToObject(allowed_nf_types, "", OpenAPI_nf_type_ToString((intptr_t)allowed_nf_types_node->data)) == NULL) { + OpenAPI_list_for_each(nf_profile->allowed_nf_types, node) { + if (cJSON_AddStringToObject(allowed_nf_typesList, "", OpenAPI_nf_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_nf_types]"); goto end; } @@ -606,19 +757,17 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } if (nf_profile->allowed_nf_domains) { - cJSON *allowed_nf_domains = cJSON_AddArrayToObject(item, "allowedNfDomains"); - if (allowed_nf_domains == NULL) { + cJSON *allowed_nf_domainsList = cJSON_AddArrayToObject(item, "allowedNfDomains"); + if (allowed_nf_domainsList == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_nf_domains]"); goto end; } - - OpenAPI_lnode_t *allowed_nf_domains_node; - OpenAPI_list_for_each(nf_profile->allowed_nf_domains, allowed_nf_domains_node) { - if (cJSON_AddStringToObject(allowed_nf_domains, "", (char*)allowed_nf_domains_node->data) == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_nf_domains]"); - goto end; + OpenAPI_list_for_each(nf_profile->allowed_nf_domains, node) { + if (cJSON_AddStringToObject(allowed_nf_domainsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_nf_domains]"); + goto end; + } } - } } if (nf_profile->allowed_nssais) { @@ -627,17 +776,13 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_nssais]"); goto end; } - - OpenAPI_lnode_t *allowed_nssais_node; - if (nf_profile->allowed_nssais) { - OpenAPI_list_for_each(nf_profile->allowed_nssais, allowed_nssais_node) { - cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(allowed_nssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_nssais]"); - goto end; - } - cJSON_AddItemToArray(allowed_nssaisList, itemLocal); + OpenAPI_list_for_each(nf_profile->allowed_nssais, node) { + cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [allowed_nssais]"); + goto end; } + cJSON_AddItemToArray(allowed_nssaisList, itemLocal); } } @@ -696,21 +841,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = udr_info_list; - OpenAPI_lnode_t *udr_info_list_node; if (nf_profile->udr_info_list) { - OpenAPI_list_for_each(nf_profile->udr_info_list, udr_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)udr_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udr_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->udr_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udr_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->udm_info) { cJSON *udm_info_local_JSON = OpenAPI_udm_info_convertToJSON(nf_profile->udm_info); @@ -732,21 +876,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = udm_info_list; - OpenAPI_lnode_t *udm_info_list_node; if (nf_profile->udm_info_list) { - OpenAPI_list_for_each(nf_profile->udm_info_list, udm_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)udm_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udm_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->udm_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udm_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->ausf_info) { cJSON *ausf_info_local_JSON = OpenAPI_ausf_info_convertToJSON(nf_profile->ausf_info); @@ -768,21 +911,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = ausf_info_list; - OpenAPI_lnode_t *ausf_info_list_node; if (nf_profile->ausf_info_list) { - OpenAPI_list_for_each(nf_profile->ausf_info_list, ausf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)ausf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_ausf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->ausf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_ausf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->amf_info) { cJSON *amf_info_local_JSON = OpenAPI_amf_info_convertToJSON(nf_profile->amf_info); @@ -804,21 +946,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = amf_info_list; - OpenAPI_lnode_t *amf_info_list_node; if (nf_profile->amf_info_list) { - OpenAPI_list_for_each(nf_profile->amf_info_list, amf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)amf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_amf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->amf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_amf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->smf_info) { cJSON *smf_info_local_JSON = OpenAPI_smf_info_convertToJSON(nf_profile->smf_info); @@ -840,21 +981,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = smf_info_list; - OpenAPI_lnode_t *smf_info_list_node; if (nf_profile->smf_info_list) { - OpenAPI_list_for_each(nf_profile->smf_info_list, smf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)smf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_smf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->smf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_smf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->upf_info) { cJSON *upf_info_local_JSON = OpenAPI_upf_info_convertToJSON(nf_profile->upf_info); @@ -876,21 +1016,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = upf_info_list; - OpenAPI_lnode_t *upf_info_list_node; if (nf_profile->upf_info_list) { - OpenAPI_list_for_each(nf_profile->upf_info_list, upf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)upf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_upf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->upf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_upf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->pcf_info) { cJSON *pcf_info_local_JSON = OpenAPI_pcf_info_convertToJSON(nf_profile->pcf_info); @@ -912,21 +1051,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = pcf_info_list; - OpenAPI_lnode_t *pcf_info_list_node; if (nf_profile->pcf_info_list) { - OpenAPI_list_for_each(nf_profile->pcf_info_list, pcf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pcf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_pcf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->pcf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_pcf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->bsf_info) { cJSON *bsf_info_local_JSON = OpenAPI_bsf_info_convertToJSON(nf_profile->bsf_info); @@ -948,21 +1086,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = bsf_info_list; - OpenAPI_lnode_t *bsf_info_list_node; if (nf_profile->bsf_info_list) { - OpenAPI_list_for_each(nf_profile->bsf_info_list, bsf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)bsf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_bsf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->bsf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_bsf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->chf_info) { cJSON *chf_info_local_JSON = OpenAPI_chf_info_convertToJSON(nf_profile->chf_info); @@ -984,21 +1121,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = chf_info_list; - OpenAPI_lnode_t *chf_info_list_node; if (nf_profile->chf_info_list) { - OpenAPI_list_for_each(nf_profile->chf_info_list, chf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)chf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_chf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->chf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_chf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->nef_info) { cJSON *nef_info_local_JSON = OpenAPI_nef_info_convertToJSON(nf_profile->nef_info); @@ -1046,21 +1182,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = udsf_info_list; - OpenAPI_lnode_t *udsf_info_list_node; if (nf_profile->udsf_info_list) { - OpenAPI_list_for_each(nf_profile->udsf_info_list, udsf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)udsf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udsf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->udsf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udsf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->nwdaf_info) { cJSON *nwdaf_info_local_JSON = OpenAPI_nwdaf_info_convertToJSON(nf_profile->nwdaf_info); @@ -1082,21 +1217,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = pcscf_info_list; - OpenAPI_lnode_t *pcscf_info_list_node; if (nf_profile->pcscf_info_list) { - OpenAPI_list_for_each(nf_profile->pcscf_info_list, pcscf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pcscf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_pcscf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->pcscf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_pcscf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->hss_info_list) { cJSON *hss_info_list = cJSON_AddObjectToObject(item, "hssInfoList"); @@ -1105,21 +1239,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = hss_info_list; - OpenAPI_lnode_t *hss_info_list_node; if (nf_profile->hss_info_list) { - OpenAPI_list_for_each(nf_profile->hss_info_list, hss_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)hss_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_hss_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->hss_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_hss_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->custom_info) { cJSON *custom_info_object = OpenAPI_object_convertToJSON(nf_profile->custom_info); @@ -1154,17 +1287,13 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_services]"); goto end; } - - OpenAPI_lnode_t *nf_services_node; - if (nf_profile->nf_services) { - OpenAPI_list_for_each(nf_profile->nf_services, nf_services_node) { - cJSON *itemLocal = OpenAPI_nf_service_convertToJSON(nf_services_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_services]"); - goto end; - } - cJSON_AddItemToArray(nf_servicesList, itemLocal); + OpenAPI_list_for_each(nf_profile->nf_services, node) { + cJSON *itemLocal = OpenAPI_nf_service_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_services]"); + goto end; } + cJSON_AddItemToArray(nf_servicesList, itemLocal); } } @@ -1175,21 +1304,20 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = nf_service_list; - OpenAPI_lnode_t *nf_service_list_node; if (nf_profile->nf_service_list) { - OpenAPI_list_for_each(nf_profile->nf_service_list, nf_service_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)nf_service_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_nf_service_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_profile->nf_service_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_nf_service_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_profile->is_nf_profile_changes_support_ind) { if (cJSON_AddBoolToObject(item, "nfProfileChangesSupportInd", nf_profile->nf_profile_changes_support_ind) == NULL) { @@ -1211,17 +1339,13 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) ogs_error("OpenAPI_nf_profile_convertToJSON() failed [default_notification_subscriptions]"); goto end; } - - OpenAPI_lnode_t *default_notification_subscriptions_node; - if (nf_profile->default_notification_subscriptions) { - OpenAPI_list_for_each(nf_profile->default_notification_subscriptions, default_notification_subscriptions_node) { - cJSON *itemLocal = OpenAPI_default_notification_subscription_convertToJSON(default_notification_subscriptions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [default_notification_subscriptions]"); - goto end; - } - cJSON_AddItemToArray(default_notification_subscriptionsList, itemLocal); + OpenAPI_list_for_each(nf_profile->default_notification_subscriptions, node) { + cJSON *itemLocal = OpenAPI_default_notification_subscription_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [default_notification_subscriptions]"); + goto end; } + cJSON_AddItemToArray(default_notification_subscriptionsList, itemLocal); } } @@ -1252,35 +1376,31 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) } if (nf_profile->nf_set_id_list) { - cJSON *nf_set_id_list = cJSON_AddArrayToObject(item, "nfSetIdList"); - if (nf_set_id_list == NULL) { + cJSON *nf_set_id_listList = cJSON_AddArrayToObject(item, "nfSetIdList"); + if (nf_set_id_listList == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_set_id_list]"); goto end; } - - OpenAPI_lnode_t *nf_set_id_list_node; - OpenAPI_list_for_each(nf_profile->nf_set_id_list, nf_set_id_list_node) { - if (cJSON_AddStringToObject(nf_set_id_list, "", (char*)nf_set_id_list_node->data) == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_set_id_list]"); - goto end; + OpenAPI_list_for_each(nf_profile->nf_set_id_list, node) { + if (cJSON_AddStringToObject(nf_set_id_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [nf_set_id_list]"); + goto end; + } } - } } if (nf_profile->serving_scope) { - cJSON *serving_scope = cJSON_AddArrayToObject(item, "servingScope"); - if (serving_scope == NULL) { + cJSON *serving_scopeList = cJSON_AddArrayToObject(item, "servingScope"); + if (serving_scopeList == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [serving_scope]"); goto end; } - - OpenAPI_lnode_t *serving_scope_node; - OpenAPI_list_for_each(nf_profile->serving_scope, serving_scope_node) { - if (cJSON_AddStringToObject(serving_scope, "", (char*)serving_scope_node->data) == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [serving_scope]"); - goto end; + OpenAPI_list_for_each(nf_profile->serving_scope, node) { + if (cJSON_AddStringToObject(serving_scopeList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [serving_scope]"); + goto end; + } } - } } if (nf_profile->is_lc_h_support_ind) { @@ -1304,13 +1424,12 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = nf_set_recovery_time_list; - OpenAPI_lnode_t *nf_set_recovery_time_list_node; if (nf_profile->nf_set_recovery_time_list) { - OpenAPI_list_for_each(nf_profile->nf_set_recovery_time_list, nf_set_recovery_time_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)nf_set_recovery_time_list_node->data; - } + OpenAPI_list_for_each(nf_profile->nf_set_recovery_time_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; } } + } if (nf_profile->service_set_recovery_time_list) { cJSON *service_set_recovery_time_list = cJSON_AddObjectToObject(item, "serviceSetRecoveryTimeList"); @@ -1319,28 +1438,25 @@ cJSON *OpenAPI_nf_profile_convertToJSON(OpenAPI_nf_profile_t *nf_profile) goto end; } cJSON *localMapObject = service_set_recovery_time_list; - OpenAPI_lnode_t *service_set_recovery_time_list_node; if (nf_profile->service_set_recovery_time_list) { - OpenAPI_list_for_each(nf_profile->service_set_recovery_time_list, service_set_recovery_time_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)service_set_recovery_time_list_node->data; - } + OpenAPI_list_for_each(nf_profile->service_set_recovery_time_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; } } + } if (nf_profile->scp_domains) { - cJSON *scp_domains = cJSON_AddArrayToObject(item, "scpDomains"); - if (scp_domains == NULL) { + cJSON *scp_domainsList = cJSON_AddArrayToObject(item, "scpDomains"); + if (scp_domainsList == NULL) { ogs_error("OpenAPI_nf_profile_convertToJSON() failed [scp_domains]"); goto end; } - - OpenAPI_lnode_t *scp_domains_node; - OpenAPI_list_for_each(nf_profile->scp_domains, scp_domains_node) { - if (cJSON_AddStringToObject(scp_domains, "", (char*)scp_domains_node->data) == NULL) { - ogs_error("OpenAPI_nf_profile_convertToJSON() failed [scp_domains]"); - goto end; + OpenAPI_list_for_each(nf_profile->scp_domains, node) { + if (cJSON_AddStringToObject(scp_domainsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_profile_convertToJSON() failed [scp_domains]"); + goto end; + } } - } } if (nf_profile->scp_info) { @@ -1363,54 +1479,166 @@ end: OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) { OpenAPI_nf_profile_t *nf_profile_local_var = NULL; - cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instance_id = NULL; + cJSON *nf_instance_name = NULL; + cJSON *nf_type = NULL; + OpenAPI_nf_type_e nf_typeVariable = 0; + cJSON *nf_status = NULL; + OpenAPI_nf_status_e nf_statusVariable = 0; + cJSON *heart_beat_timer = NULL; + cJSON *plmn_list = NULL; + OpenAPI_list_t *plmn_listList = NULL; + cJSON *snpn_list = NULL; + OpenAPI_list_t *snpn_listList = NULL; + cJSON *s_nssais = NULL; + OpenAPI_list_t *s_nssaisList = NULL; + cJSON *per_plmn_snssai_list = NULL; + OpenAPI_list_t *per_plmn_snssai_listList = NULL; + cJSON *nsi_list = NULL; + OpenAPI_list_t *nsi_listList = NULL; + cJSON *fqdn = NULL; + cJSON *inter_plmn_fqdn = NULL; + cJSON *ipv4_addresses = NULL; + OpenAPI_list_t *ipv4_addressesList = NULL; + cJSON *ipv6_addresses = NULL; + OpenAPI_list_t *ipv6_addressesList = NULL; + cJSON *allowed_plmns = NULL; + OpenAPI_list_t *allowed_plmnsList = NULL; + cJSON *allowed_snpns = NULL; + OpenAPI_list_t *allowed_snpnsList = NULL; + cJSON *allowed_nf_types = NULL; + OpenAPI_list_t *allowed_nf_typesList = NULL; + cJSON *allowed_nf_domains = NULL; + OpenAPI_list_t *allowed_nf_domainsList = NULL; + cJSON *allowed_nssais = NULL; + OpenAPI_list_t *allowed_nssaisList = NULL; + cJSON *priority = NULL; + cJSON *capacity = NULL; + cJSON *load = NULL; + cJSON *load_time_stamp = NULL; + cJSON *locality = NULL; + cJSON *udr_info = NULL; + OpenAPI_udr_info_t *udr_info_local_nonprim = NULL; + cJSON *udr_info_list = NULL; + OpenAPI_list_t *udr_info_listList = NULL; + cJSON *udm_info = NULL; + OpenAPI_udm_info_t *udm_info_local_nonprim = NULL; + cJSON *udm_info_list = NULL; + OpenAPI_list_t *udm_info_listList = NULL; + cJSON *ausf_info = NULL; + OpenAPI_ausf_info_t *ausf_info_local_nonprim = NULL; + cJSON *ausf_info_list = NULL; + OpenAPI_list_t *ausf_info_listList = NULL; + cJSON *amf_info = NULL; + OpenAPI_amf_info_t *amf_info_local_nonprim = NULL; + cJSON *amf_info_list = NULL; + OpenAPI_list_t *amf_info_listList = NULL; + cJSON *smf_info = NULL; + OpenAPI_smf_info_t *smf_info_local_nonprim = NULL; + cJSON *smf_info_list = NULL; + OpenAPI_list_t *smf_info_listList = NULL; + cJSON *upf_info = NULL; + OpenAPI_upf_info_t *upf_info_local_nonprim = NULL; + cJSON *upf_info_list = NULL; + OpenAPI_list_t *upf_info_listList = NULL; + cJSON *pcf_info = NULL; + OpenAPI_pcf_info_t *pcf_info_local_nonprim = NULL; + cJSON *pcf_info_list = NULL; + OpenAPI_list_t *pcf_info_listList = NULL; + cJSON *bsf_info = NULL; + OpenAPI_bsf_info_t *bsf_info_local_nonprim = NULL; + cJSON *bsf_info_list = NULL; + OpenAPI_list_t *bsf_info_listList = NULL; + cJSON *chf_info = NULL; + OpenAPI_chf_info_t *chf_info_local_nonprim = NULL; + cJSON *chf_info_list = NULL; + OpenAPI_list_t *chf_info_listList = NULL; + cJSON *nef_info = NULL; + OpenAPI_nef_info_t *nef_info_local_nonprim = NULL; + cJSON *nrf_info = NULL; + OpenAPI_nrf_info_t *nrf_info_local_nonprim = NULL; + cJSON *udsf_info = NULL; + OpenAPI_udsf_info_t *udsf_info_local_nonprim = NULL; + cJSON *udsf_info_list = NULL; + OpenAPI_list_t *udsf_info_listList = NULL; + cJSON *nwdaf_info = NULL; + OpenAPI_nwdaf_info_t *nwdaf_info_local_nonprim = NULL; + cJSON *pcscf_info_list = NULL; + OpenAPI_list_t *pcscf_info_listList = NULL; + cJSON *hss_info_list = NULL; + OpenAPI_list_t *hss_info_listList = NULL; + cJSON *custom_info = NULL; + OpenAPI_object_t *custom_info_local_object = NULL; + cJSON *recovery_time = NULL; + cJSON *nf_service_persistence = NULL; + cJSON *nf_services = NULL; + OpenAPI_list_t *nf_servicesList = NULL; + cJSON *nf_service_list = NULL; + OpenAPI_list_t *nf_service_listList = NULL; + cJSON *nf_profile_changes_support_ind = NULL; + cJSON *nf_profile_changes_ind = NULL; + cJSON *default_notification_subscriptions = NULL; + OpenAPI_list_t *default_notification_subscriptionsList = NULL; + cJSON *lmf_info = NULL; + OpenAPI_lmf_info_t *lmf_info_local_nonprim = NULL; + cJSON *gmlc_info = NULL; + OpenAPI_gmlc_info_t *gmlc_info_local_nonprim = NULL; + cJSON *nf_set_id_list = NULL; + OpenAPI_list_t *nf_set_id_listList = NULL; + cJSON *serving_scope = NULL; + OpenAPI_list_t *serving_scopeList = NULL; + cJSON *lc_h_support_ind = NULL; + cJSON *olc_h_support_ind = NULL; + cJSON *nf_set_recovery_time_list = NULL; + OpenAPI_list_t *nf_set_recovery_time_listList = NULL; + cJSON *service_set_recovery_time_list = NULL; + OpenAPI_list_t *service_set_recovery_time_listList = NULL; + cJSON *scp_domains = NULL; + OpenAPI_list_t *scp_domainsList = NULL; + cJSON *scp_info = NULL; + OpenAPI_scp_info_t *scp_info_local_nonprim = NULL; + nf_instance_id = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfInstanceId"); if (!nf_instance_id) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_instance_id]"); goto end; } - if (!cJSON_IsString(nf_instance_id)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_instance_id]"); goto end; } - cJSON *nf_instance_name = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfInstanceName"); - + nf_instance_name = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfInstanceName"); if (nf_instance_name) { - if (!cJSON_IsString(nf_instance_name)) { + if (!cJSON_IsString(nf_instance_name) && !cJSON_IsNull(nf_instance_name)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_instance_name]"); goto end; } } - cJSON *nf_type = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfType"); + nf_type = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfType"); if (!nf_type) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_type]"); goto end; } - - OpenAPI_nf_type_e nf_typeVariable; if (!cJSON_IsString(nf_type)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_type]"); goto end; } nf_typeVariable = OpenAPI_nf_type_FromString(nf_type->valuestring); - cJSON *nf_status = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfStatus"); + nf_status = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfStatus"); if (!nf_status) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_status]"); goto end; } - - OpenAPI_nf_status_e nf_statusVariable; if (!cJSON_IsString(nf_status)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_status]"); goto end; } nf_statusVariable = OpenAPI_nf_status_FromString(nf_status->valuestring); - cJSON *heart_beat_timer = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "heartBeatTimer"); - + heart_beat_timer = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "heartBeatTimer"); if (heart_beat_timer) { if (!cJSON_IsNumber(heart_beat_timer)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [heart_beat_timer]"); @@ -1418,331 +1646,301 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *plmn_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "plmnList"); - - OpenAPI_list_t *plmn_listList; + plmn_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "plmnList"); if (plmn_list) { - cJSON *plmn_list_local_nonprimitive; - if (!cJSON_IsArray(plmn_list)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [plmn_list]"); - goto end; - } - - plmn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(plmn_list_local_nonprimitive, plmn_list ) { - if (!cJSON_IsObject(plmn_list_local_nonprimitive)) { + cJSON *plmn_list_local = NULL; + if (!cJSON_IsArray(plmn_list)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [plmn_list]"); goto end; } - OpenAPI_plmn_id_t *plmn_listItem = OpenAPI_plmn_id_parseFromJSON(plmn_list_local_nonprimitive); - if (!plmn_listItem) { - ogs_error("No plmn_listItem"); - OpenAPI_list_free(plmn_listList); - goto end; + plmn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(plmn_list_local, plmn_list) { + if (!cJSON_IsObject(plmn_list_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [plmn_list]"); + goto end; + } + OpenAPI_plmn_id_t *plmn_listItem = OpenAPI_plmn_id_parseFromJSON(plmn_list_local); + if (!plmn_listItem) { + ogs_error("No plmn_listItem"); + OpenAPI_list_free(plmn_listList); + goto end; + } + OpenAPI_list_add(plmn_listList, plmn_listItem); } - - OpenAPI_list_add(plmn_listList, plmn_listItem); - } } - cJSON *snpn_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "snpnList"); - - OpenAPI_list_t *snpn_listList; + snpn_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "snpnList"); if (snpn_list) { - cJSON *snpn_list_local_nonprimitive; - if (!cJSON_IsArray(snpn_list)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [snpn_list]"); - goto end; - } - - snpn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(snpn_list_local_nonprimitive, snpn_list ) { - if (!cJSON_IsObject(snpn_list_local_nonprimitive)) { + cJSON *snpn_list_local = NULL; + if (!cJSON_IsArray(snpn_list)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [snpn_list]"); goto end; } - OpenAPI_plmn_id_nid_t *snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(snpn_list_local_nonprimitive); - if (!snpn_listItem) { - ogs_error("No snpn_listItem"); - OpenAPI_list_free(snpn_listList); - goto end; + snpn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snpn_list_local, snpn_list) { + if (!cJSON_IsObject(snpn_list_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [snpn_list]"); + goto end; + } + OpenAPI_plmn_id_nid_t *snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(snpn_list_local); + if (!snpn_listItem) { + ogs_error("No snpn_listItem"); + OpenAPI_list_free(snpn_listList); + goto end; + } + OpenAPI_list_add(snpn_listList, snpn_listItem); } - - OpenAPI_list_add(snpn_listList, snpn_listItem); - } } - cJSON *s_nssais = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "sNssais"); - - OpenAPI_list_t *s_nssaisList; + s_nssais = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "sNssais"); if (s_nssais) { - cJSON *s_nssais_local_nonprimitive; - if (!cJSON_IsArray(s_nssais)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [s_nssais]"); - goto end; - } - - s_nssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(s_nssais_local_nonprimitive, s_nssais ) { - if (!cJSON_IsObject(s_nssais_local_nonprimitive)) { + cJSON *s_nssais_local = NULL; + if (!cJSON_IsArray(s_nssais)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [s_nssais]"); goto end; } - OpenAPI_ext_snssai_t *s_nssaisItem = OpenAPI_ext_snssai_parseFromJSON(s_nssais_local_nonprimitive); - if (!s_nssaisItem) { - ogs_error("No s_nssaisItem"); - OpenAPI_list_free(s_nssaisList); - goto end; + s_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(s_nssais_local, s_nssais) { + if (!cJSON_IsObject(s_nssais_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [s_nssais]"); + goto end; + } + OpenAPI_ext_snssai_t *s_nssaisItem = OpenAPI_ext_snssai_parseFromJSON(s_nssais_local); + if (!s_nssaisItem) { + ogs_error("No s_nssaisItem"); + OpenAPI_list_free(s_nssaisList); + goto end; + } + OpenAPI_list_add(s_nssaisList, s_nssaisItem); } - - OpenAPI_list_add(s_nssaisList, s_nssaisItem); - } } - cJSON *per_plmn_snssai_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "perPlmnSnssaiList"); - - OpenAPI_list_t *per_plmn_snssai_listList; + per_plmn_snssai_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "perPlmnSnssaiList"); if (per_plmn_snssai_list) { - cJSON *per_plmn_snssai_list_local_nonprimitive; - if (!cJSON_IsArray(per_plmn_snssai_list)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [per_plmn_snssai_list]"); - goto end; - } - - per_plmn_snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(per_plmn_snssai_list_local_nonprimitive, per_plmn_snssai_list ) { - if (!cJSON_IsObject(per_plmn_snssai_list_local_nonprimitive)) { + cJSON *per_plmn_snssai_list_local = NULL; + if (!cJSON_IsArray(per_plmn_snssai_list)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [per_plmn_snssai_list]"); goto end; } - OpenAPI_plmn_snssai_t *per_plmn_snssai_listItem = OpenAPI_plmn_snssai_parseFromJSON(per_plmn_snssai_list_local_nonprimitive); - if (!per_plmn_snssai_listItem) { - ogs_error("No per_plmn_snssai_listItem"); - OpenAPI_list_free(per_plmn_snssai_listList); + per_plmn_snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(per_plmn_snssai_list_local, per_plmn_snssai_list) { + if (!cJSON_IsObject(per_plmn_snssai_list_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [per_plmn_snssai_list]"); + goto end; + } + OpenAPI_plmn_snssai_t *per_plmn_snssai_listItem = OpenAPI_plmn_snssai_parseFromJSON(per_plmn_snssai_list_local); + if (!per_plmn_snssai_listItem) { + ogs_error("No per_plmn_snssai_listItem"); + OpenAPI_list_free(per_plmn_snssai_listList); + goto end; + } + OpenAPI_list_add(per_plmn_snssai_listList, per_plmn_snssai_listItem); + } + } + + nsi_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nsiList"); + if (nsi_list) { + cJSON *nsi_list_local = NULL; + if (!cJSON_IsArray(nsi_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nsi_list]"); goto end; } - OpenAPI_list_add(per_plmn_snssai_listList, per_plmn_snssai_listItem); - } + nsi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nsi_list_local, nsi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(nsi_list_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nsi_list]"); + goto end; + } + OpenAPI_list_add(nsi_listList, ogs_strdup(nsi_list_local->valuestring)); + } } - cJSON *nsi_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nsiList"); - - OpenAPI_list_t *nsi_listList; - if (nsi_list) { - cJSON *nsi_list_local; - if (!cJSON_IsArray(nsi_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nsi_list]"); - goto end; - } - nsi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nsi_list_local, nsi_list) { - if (!cJSON_IsString(nsi_list_local)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nsi_list]"); - goto end; - } - OpenAPI_list_add(nsi_listList, ogs_strdup(nsi_list_local->valuestring)); - } - } - - cJSON *fqdn = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "fqdn"); - + fqdn = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "fqdn"); if (fqdn) { - if (!cJSON_IsString(fqdn)) { + if (!cJSON_IsString(fqdn) && !cJSON_IsNull(fqdn)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [fqdn]"); goto end; } } - cJSON *inter_plmn_fqdn = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "interPlmnFqdn"); - + inter_plmn_fqdn = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "interPlmnFqdn"); if (inter_plmn_fqdn) { - if (!cJSON_IsString(inter_plmn_fqdn)) { + if (!cJSON_IsString(inter_plmn_fqdn) && !cJSON_IsNull(inter_plmn_fqdn)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inter_plmn_fqdn]"); goto end; } } - cJSON *ipv4_addresses = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "ipv4Addresses"); - - OpenAPI_list_t *ipv4_addressesList; + ipv4_addresses = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "ipv4Addresses"); if (ipv4_addresses) { - cJSON *ipv4_addresses_local; - if (!cJSON_IsArray(ipv4_addresses)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ipv4_addresses]"); - goto end; - } - ipv4_addressesList = OpenAPI_list_create(); + cJSON *ipv4_addresses_local = NULL; + if (!cJSON_IsArray(ipv4_addresses)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ipv4_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv4_addresses_local, ipv4_addresses) { - if (!cJSON_IsString(ipv4_addresses_local)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ipv4_addresses]"); - goto end; - } - OpenAPI_list_add(ipv4_addressesList, ogs_strdup(ipv4_addresses_local->valuestring)); - } + ipv4_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_addresses_local, ipv4_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_addresses_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ipv4_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_addressesList, ogs_strdup(ipv4_addresses_local->valuestring)); + } } - cJSON *ipv6_addresses = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "ipv6Addresses"); - - OpenAPI_list_t *ipv6_addressesList; + ipv6_addresses = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "ipv6Addresses"); if (ipv6_addresses) { - cJSON *ipv6_addresses_local; - if (!cJSON_IsArray(ipv6_addresses)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ipv6_addresses]"); - goto end; - } - ipv6_addressesList = OpenAPI_list_create(); + cJSON *ipv6_addresses_local = NULL; + if (!cJSON_IsArray(ipv6_addresses)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ipv6_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv6_addresses_local, ipv6_addresses) { - if (!cJSON_IsString(ipv6_addresses_local)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ipv6_addresses]"); - goto end; - } - OpenAPI_list_add(ipv6_addressesList, ogs_strdup(ipv6_addresses_local->valuestring)); - } + ipv6_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_addresses_local, ipv6_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_addresses_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ipv6_addresses]"); + goto end; + } + OpenAPI_list_add(ipv6_addressesList, ogs_strdup(ipv6_addresses_local->valuestring)); + } } - cJSON *allowed_plmns = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedPlmns"); - - OpenAPI_list_t *allowed_plmnsList; + allowed_plmns = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedPlmns"); if (allowed_plmns) { - cJSON *allowed_plmns_local_nonprimitive; - if (!cJSON_IsArray(allowed_plmns)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_plmns]"); - goto end; - } - - allowed_plmnsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_plmns_local_nonprimitive, allowed_plmns ) { - if (!cJSON_IsObject(allowed_plmns_local_nonprimitive)) { + cJSON *allowed_plmns_local = NULL; + if (!cJSON_IsArray(allowed_plmns)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_plmns]"); goto end; } - OpenAPI_plmn_id_t *allowed_plmnsItem = OpenAPI_plmn_id_parseFromJSON(allowed_plmns_local_nonprimitive); - if (!allowed_plmnsItem) { - ogs_error("No allowed_plmnsItem"); - OpenAPI_list_free(allowed_plmnsList); - goto end; + allowed_plmnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_plmns_local, allowed_plmns) { + if (!cJSON_IsObject(allowed_plmns_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_plmns]"); + goto end; + } + OpenAPI_plmn_id_t *allowed_plmnsItem = OpenAPI_plmn_id_parseFromJSON(allowed_plmns_local); + if (!allowed_plmnsItem) { + ogs_error("No allowed_plmnsItem"); + OpenAPI_list_free(allowed_plmnsList); + goto end; + } + OpenAPI_list_add(allowed_plmnsList, allowed_plmnsItem); } - - OpenAPI_list_add(allowed_plmnsList, allowed_plmnsItem); - } } - cJSON *allowed_snpns = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedSnpns"); - - OpenAPI_list_t *allowed_snpnsList; + allowed_snpns = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedSnpns"); if (allowed_snpns) { - cJSON *allowed_snpns_local_nonprimitive; - if (!cJSON_IsArray(allowed_snpns)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_snpns]"); - goto end; - } - - allowed_snpnsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_snpns_local_nonprimitive, allowed_snpns ) { - if (!cJSON_IsObject(allowed_snpns_local_nonprimitive)) { + cJSON *allowed_snpns_local = NULL; + if (!cJSON_IsArray(allowed_snpns)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_snpns]"); goto end; } - OpenAPI_plmn_id_nid_t *allowed_snpnsItem = OpenAPI_plmn_id_nid_parseFromJSON(allowed_snpns_local_nonprimitive); - if (!allowed_snpnsItem) { - ogs_error("No allowed_snpnsItem"); - OpenAPI_list_free(allowed_snpnsList); - goto end; + allowed_snpnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_snpns_local, allowed_snpns) { + if (!cJSON_IsObject(allowed_snpns_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_snpns]"); + goto end; + } + OpenAPI_plmn_id_nid_t *allowed_snpnsItem = OpenAPI_plmn_id_nid_parseFromJSON(allowed_snpns_local); + if (!allowed_snpnsItem) { + ogs_error("No allowed_snpnsItem"); + OpenAPI_list_free(allowed_snpnsList); + goto end; + } + OpenAPI_list_add(allowed_snpnsList, allowed_snpnsItem); } - - OpenAPI_list_add(allowed_snpnsList, allowed_snpnsItem); - } } - cJSON *allowed_nf_types = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedNfTypes"); - - OpenAPI_list_t *allowed_nf_typesList; + allowed_nf_types = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedNfTypes"); if (allowed_nf_types) { - cJSON *allowed_nf_types_local_nonprimitive; - if (!cJSON_IsArray(allowed_nf_types)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nf_types]"); - goto end; - } - - allowed_nf_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_nf_types_local_nonprimitive, allowed_nf_types ) { - if (!cJSON_IsString(allowed_nf_types_local_nonprimitive)){ + cJSON *allowed_nf_types_local = NULL; + if (!cJSON_IsArray(allowed_nf_types)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nf_types]"); goto end; } - OpenAPI_list_add(allowed_nf_typesList, (void *)OpenAPI_nf_type_FromString(allowed_nf_types_local_nonprimitive->valuestring)); - } + allowed_nf_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_nf_types_local, allowed_nf_types) { + if (!cJSON_IsString(allowed_nf_types_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nf_types]"); + goto end; + } + OpenAPI_list_add(allowed_nf_typesList, (void *)OpenAPI_nf_type_FromString(allowed_nf_types_local->valuestring)); + } } - cJSON *allowed_nf_domains = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedNfDomains"); - - OpenAPI_list_t *allowed_nf_domainsList; + allowed_nf_domains = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedNfDomains"); if (allowed_nf_domains) { - cJSON *allowed_nf_domains_local; - if (!cJSON_IsArray(allowed_nf_domains)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nf_domains]"); - goto end; - } - allowed_nf_domainsList = OpenAPI_list_create(); + cJSON *allowed_nf_domains_local = NULL; + if (!cJSON_IsArray(allowed_nf_domains)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nf_domains]"); + goto end; + } - cJSON_ArrayForEach(allowed_nf_domains_local, allowed_nf_domains) { - if (!cJSON_IsString(allowed_nf_domains_local)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nf_domains]"); - goto end; - } - OpenAPI_list_add(allowed_nf_domainsList, ogs_strdup(allowed_nf_domains_local->valuestring)); - } + allowed_nf_domainsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_nf_domains_local, allowed_nf_domains) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(allowed_nf_domains_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nf_domains]"); + goto end; + } + OpenAPI_list_add(allowed_nf_domainsList, ogs_strdup(allowed_nf_domains_local->valuestring)); + } } - cJSON *allowed_nssais = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedNssais"); - - OpenAPI_list_t *allowed_nssaisList; + allowed_nssais = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "allowedNssais"); if (allowed_nssais) { - cJSON *allowed_nssais_local_nonprimitive; - if (!cJSON_IsArray(allowed_nssais)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nssais]"); - goto end; - } - - allowed_nssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_nssais_local_nonprimitive, allowed_nssais ) { - if (!cJSON_IsObject(allowed_nssais_local_nonprimitive)) { + cJSON *allowed_nssais_local = NULL; + if (!cJSON_IsArray(allowed_nssais)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nssais]"); goto end; } - OpenAPI_ext_snssai_t *allowed_nssaisItem = OpenAPI_ext_snssai_parseFromJSON(allowed_nssais_local_nonprimitive); - if (!allowed_nssaisItem) { - ogs_error("No allowed_nssaisItem"); - OpenAPI_list_free(allowed_nssaisList); - goto end; + allowed_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_nssais_local, allowed_nssais) { + if (!cJSON_IsObject(allowed_nssais_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [allowed_nssais]"); + goto end; + } + OpenAPI_ext_snssai_t *allowed_nssaisItem = OpenAPI_ext_snssai_parseFromJSON(allowed_nssais_local); + if (!allowed_nssaisItem) { + ogs_error("No allowed_nssaisItem"); + OpenAPI_list_free(allowed_nssaisList); + goto end; + } + OpenAPI_list_add(allowed_nssaisList, allowed_nssaisItem); } - - OpenAPI_list_add(allowed_nssaisList, allowed_nssaisItem); - } } - cJSON *priority = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "priority"); - + priority = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "priority"); if (priority) { if (!cJSON_IsNumber(priority)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [priority]"); @@ -1750,8 +1948,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *capacity = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "capacity"); - + capacity = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "capacity"); if (capacity) { if (!cJSON_IsNumber(capacity)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [capacity]"); @@ -1759,8 +1956,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *load = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "load"); - + load = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "load"); if (load) { if (!cJSON_IsNumber(load)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [load]"); @@ -1768,430 +1964,400 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *load_time_stamp = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "loadTimeStamp"); - + load_time_stamp = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "loadTimeStamp"); if (load_time_stamp) { - if (!cJSON_IsString(load_time_stamp)) { + if (!cJSON_IsString(load_time_stamp) && !cJSON_IsNull(load_time_stamp)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [load_time_stamp]"); goto end; } } - cJSON *locality = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "locality"); - + locality = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "locality"); if (locality) { - if (!cJSON_IsString(locality)) { + if (!cJSON_IsString(locality) && !cJSON_IsNull(locality)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [locality]"); goto end; } } - cJSON *udr_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udrInfo"); - - OpenAPI_udr_info_t *udr_info_local_nonprim = NULL; + udr_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udrInfo"); if (udr_info) { udr_info_local_nonprim = OpenAPI_udr_info_parseFromJSON(udr_info); } - cJSON *udr_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udrInfoList"); - - OpenAPI_list_t *udr_info_listList; + udr_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udrInfoList"); if (udr_info_list) { - cJSON *udr_info_list_local_map; - if (!cJSON_IsObject(udr_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [udr_info_list]"); - goto end; - } - udr_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(udr_info_list_local_map, udr_info_list) { - cJSON *localMapObject = udr_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udr_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *udr_info_list_local_map = NULL; + if (!cJSON_IsObject(udr_info_list) && !cJSON_IsNull(udr_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [udr_info_list]"); goto end; } - OpenAPI_list_add(udr_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(udr_info_list)) { + udr_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(udr_info_list_local_map, udr_info_list) { + cJSON *localMapObject = udr_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udr_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(udr_info_listList, localMapKeyPair); + } + } } - cJSON *udm_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udmInfo"); - - OpenAPI_udm_info_t *udm_info_local_nonprim = NULL; + udm_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udmInfo"); if (udm_info) { udm_info_local_nonprim = OpenAPI_udm_info_parseFromJSON(udm_info); } - cJSON *udm_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udmInfoList"); - - OpenAPI_list_t *udm_info_listList; + udm_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udmInfoList"); if (udm_info_list) { - cJSON *udm_info_list_local_map; - if (!cJSON_IsObject(udm_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [udm_info_list]"); - goto end; - } - udm_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(udm_info_list_local_map, udm_info_list) { - cJSON *localMapObject = udm_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udm_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *udm_info_list_local_map = NULL; + if (!cJSON_IsObject(udm_info_list) && !cJSON_IsNull(udm_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [udm_info_list]"); goto end; } - OpenAPI_list_add(udm_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(udm_info_list)) { + udm_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(udm_info_list_local_map, udm_info_list) { + cJSON *localMapObject = udm_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udm_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(udm_info_listList, localMapKeyPair); + } + } } - cJSON *ausf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "ausfInfo"); - - OpenAPI_ausf_info_t *ausf_info_local_nonprim = NULL; + ausf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "ausfInfo"); if (ausf_info) { ausf_info_local_nonprim = OpenAPI_ausf_info_parseFromJSON(ausf_info); } - cJSON *ausf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "ausfInfoList"); - - OpenAPI_list_t *ausf_info_listList; + ausf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "ausfInfoList"); if (ausf_info_list) { - cJSON *ausf_info_list_local_map; - if (!cJSON_IsObject(ausf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ausf_info_list]"); - goto end; - } - ausf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(ausf_info_list_local_map, ausf_info_list) { - cJSON *localMapObject = ausf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_ausf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *ausf_info_list_local_map = NULL; + if (!cJSON_IsObject(ausf_info_list) && !cJSON_IsNull(ausf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [ausf_info_list]"); goto end; } - OpenAPI_list_add(ausf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(ausf_info_list)) { + ausf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(ausf_info_list_local_map, ausf_info_list) { + cJSON *localMapObject = ausf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_ausf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(ausf_info_listList, localMapKeyPair); + } + } } - cJSON *amf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "amfInfo"); - - OpenAPI_amf_info_t *amf_info_local_nonprim = NULL; + amf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "amfInfo"); if (amf_info) { amf_info_local_nonprim = OpenAPI_amf_info_parseFromJSON(amf_info); } - cJSON *amf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "amfInfoList"); - - OpenAPI_list_t *amf_info_listList; + amf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "amfInfoList"); if (amf_info_list) { - cJSON *amf_info_list_local_map; - if (!cJSON_IsObject(amf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [amf_info_list]"); - goto end; - } - amf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(amf_info_list_local_map, amf_info_list) { - cJSON *localMapObject = amf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_amf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *amf_info_list_local_map = NULL; + if (!cJSON_IsObject(amf_info_list) && !cJSON_IsNull(amf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [amf_info_list]"); goto end; } - OpenAPI_list_add(amf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(amf_info_list)) { + amf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(amf_info_list_local_map, amf_info_list) { + cJSON *localMapObject = amf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_amf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(amf_info_listList, localMapKeyPair); + } + } } - cJSON *smf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "smfInfo"); - - OpenAPI_smf_info_t *smf_info_local_nonprim = NULL; + smf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "smfInfo"); if (smf_info) { smf_info_local_nonprim = OpenAPI_smf_info_parseFromJSON(smf_info); } - cJSON *smf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "smfInfoList"); - - OpenAPI_list_t *smf_info_listList; + smf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "smfInfoList"); if (smf_info_list) { - cJSON *smf_info_list_local_map; - if (!cJSON_IsObject(smf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [smf_info_list]"); - goto end; - } - smf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(smf_info_list_local_map, smf_info_list) { - cJSON *localMapObject = smf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_smf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *smf_info_list_local_map = NULL; + if (!cJSON_IsObject(smf_info_list) && !cJSON_IsNull(smf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [smf_info_list]"); goto end; } - OpenAPI_list_add(smf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(smf_info_list)) { + smf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(smf_info_list_local_map, smf_info_list) { + cJSON *localMapObject = smf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_smf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(smf_info_listList, localMapKeyPair); + } + } } - cJSON *upf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "upfInfo"); - - OpenAPI_upf_info_t *upf_info_local_nonprim = NULL; + upf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "upfInfo"); if (upf_info) { upf_info_local_nonprim = OpenAPI_upf_info_parseFromJSON(upf_info); } - cJSON *upf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "upfInfoList"); - - OpenAPI_list_t *upf_info_listList; + upf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "upfInfoList"); if (upf_info_list) { - cJSON *upf_info_list_local_map; - if (!cJSON_IsObject(upf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [upf_info_list]"); - goto end; - } - upf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(upf_info_list_local_map, upf_info_list) { - cJSON *localMapObject = upf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_upf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *upf_info_list_local_map = NULL; + if (!cJSON_IsObject(upf_info_list) && !cJSON_IsNull(upf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [upf_info_list]"); goto end; } - OpenAPI_list_add(upf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(upf_info_list)) { + upf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(upf_info_list_local_map, upf_info_list) { + cJSON *localMapObject = upf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_upf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(upf_info_listList, localMapKeyPair); + } + } } - cJSON *pcf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "pcfInfo"); - - OpenAPI_pcf_info_t *pcf_info_local_nonprim = NULL; + pcf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "pcfInfo"); if (pcf_info) { pcf_info_local_nonprim = OpenAPI_pcf_info_parseFromJSON(pcf_info); } - cJSON *pcf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "pcfInfoList"); - - OpenAPI_list_t *pcf_info_listList; + pcf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "pcfInfoList"); if (pcf_info_list) { - cJSON *pcf_info_list_local_map; - if (!cJSON_IsObject(pcf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [pcf_info_list]"); - goto end; - } - pcf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pcf_info_list_local_map, pcf_info_list) { - cJSON *localMapObject = pcf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_pcf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *pcf_info_list_local_map = NULL; + if (!cJSON_IsObject(pcf_info_list) && !cJSON_IsNull(pcf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [pcf_info_list]"); goto end; } - OpenAPI_list_add(pcf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(pcf_info_list)) { + pcf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pcf_info_list_local_map, pcf_info_list) { + cJSON *localMapObject = pcf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_pcf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pcf_info_listList, localMapKeyPair); + } + } } - cJSON *bsf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "bsfInfo"); - - OpenAPI_bsf_info_t *bsf_info_local_nonprim = NULL; + bsf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "bsfInfo"); if (bsf_info) { bsf_info_local_nonprim = OpenAPI_bsf_info_parseFromJSON(bsf_info); } - cJSON *bsf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "bsfInfoList"); - - OpenAPI_list_t *bsf_info_listList; + bsf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "bsfInfoList"); if (bsf_info_list) { - cJSON *bsf_info_list_local_map; - if (!cJSON_IsObject(bsf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [bsf_info_list]"); - goto end; - } - bsf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(bsf_info_list_local_map, bsf_info_list) { - cJSON *localMapObject = bsf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_bsf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *bsf_info_list_local_map = NULL; + if (!cJSON_IsObject(bsf_info_list) && !cJSON_IsNull(bsf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [bsf_info_list]"); goto end; } - OpenAPI_list_add(bsf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(bsf_info_list)) { + bsf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(bsf_info_list_local_map, bsf_info_list) { + cJSON *localMapObject = bsf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_bsf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(bsf_info_listList, localMapKeyPair); + } + } } - cJSON *chf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "chfInfo"); - - OpenAPI_chf_info_t *chf_info_local_nonprim = NULL; + chf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "chfInfo"); if (chf_info) { chf_info_local_nonprim = OpenAPI_chf_info_parseFromJSON(chf_info); } - cJSON *chf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "chfInfoList"); - - OpenAPI_list_t *chf_info_listList; + chf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "chfInfoList"); if (chf_info_list) { - cJSON *chf_info_list_local_map; - if (!cJSON_IsObject(chf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [chf_info_list]"); - goto end; - } - chf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(chf_info_list_local_map, chf_info_list) { - cJSON *localMapObject = chf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_chf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *chf_info_list_local_map = NULL; + if (!cJSON_IsObject(chf_info_list) && !cJSON_IsNull(chf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [chf_info_list]"); goto end; } - OpenAPI_list_add(chf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(chf_info_list)) { + chf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(chf_info_list_local_map, chf_info_list) { + cJSON *localMapObject = chf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_chf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(chf_info_listList, localMapKeyPair); + } + } } - cJSON *nef_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nefInfo"); - - OpenAPI_nef_info_t *nef_info_local_nonprim = NULL; + nef_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nefInfo"); if (nef_info) { nef_info_local_nonprim = OpenAPI_nef_info_parseFromJSON(nef_info); } - cJSON *nrf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nrfInfo"); - - OpenAPI_nrf_info_t *nrf_info_local_nonprim = NULL; + nrf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nrfInfo"); if (nrf_info) { nrf_info_local_nonprim = OpenAPI_nrf_info_parseFromJSON(nrf_info); } - cJSON *udsf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udsfInfo"); - - OpenAPI_udsf_info_t *udsf_info_local_nonprim = NULL; + udsf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udsfInfo"); if (udsf_info) { udsf_info_local_nonprim = OpenAPI_udsf_info_parseFromJSON(udsf_info); } - cJSON *udsf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udsfInfoList"); - - OpenAPI_list_t *udsf_info_listList; + udsf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "udsfInfoList"); if (udsf_info_list) { - cJSON *udsf_info_list_local_map; - if (!cJSON_IsObject(udsf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [udsf_info_list]"); - goto end; - } - udsf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(udsf_info_list_local_map, udsf_info_list) { - cJSON *localMapObject = udsf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udsf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *udsf_info_list_local_map = NULL; + if (!cJSON_IsObject(udsf_info_list) && !cJSON_IsNull(udsf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [udsf_info_list]"); goto end; } - OpenAPI_list_add(udsf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(udsf_info_list)) { + udsf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(udsf_info_list_local_map, udsf_info_list) { + cJSON *localMapObject = udsf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udsf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(udsf_info_listList, localMapKeyPair); + } + } } - cJSON *nwdaf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nwdafInfo"); - - OpenAPI_nwdaf_info_t *nwdaf_info_local_nonprim = NULL; + nwdaf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nwdafInfo"); if (nwdaf_info) { nwdaf_info_local_nonprim = OpenAPI_nwdaf_info_parseFromJSON(nwdaf_info); } - cJSON *pcscf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "pcscfInfoList"); - - OpenAPI_list_t *pcscf_info_listList; + pcscf_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "pcscfInfoList"); if (pcscf_info_list) { - cJSON *pcscf_info_list_local_map; - if (!cJSON_IsObject(pcscf_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [pcscf_info_list]"); - goto end; - } - pcscf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pcscf_info_list_local_map, pcscf_info_list) { - cJSON *localMapObject = pcscf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_pcscf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *pcscf_info_list_local_map = NULL; + if (!cJSON_IsObject(pcscf_info_list) && !cJSON_IsNull(pcscf_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [pcscf_info_list]"); goto end; } - OpenAPI_list_add(pcscf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(pcscf_info_list)) { + pcscf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pcscf_info_list_local_map, pcscf_info_list) { + cJSON *localMapObject = pcscf_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_pcscf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pcscf_info_listList, localMapKeyPair); + } + } } - cJSON *hss_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "hssInfoList"); - - OpenAPI_list_t *hss_info_listList; + hss_info_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "hssInfoList"); if (hss_info_list) { - cJSON *hss_info_list_local_map; - if (!cJSON_IsObject(hss_info_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [hss_info_list]"); - goto end; - } - hss_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(hss_info_list_local_map, hss_info_list) { - cJSON *localMapObject = hss_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_hss_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *hss_info_list_local_map = NULL; + if (!cJSON_IsObject(hss_info_list) && !cJSON_IsNull(hss_info_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [hss_info_list]"); goto end; } - OpenAPI_list_add(hss_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(hss_info_list)) { + hss_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(hss_info_list_local_map, hss_info_list) { + cJSON *localMapObject = hss_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_hss_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(hss_info_listList, localMapKeyPair); + } + } } - cJSON *custom_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "customInfo"); - - OpenAPI_object_t *custom_info_local_object = NULL; + custom_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "customInfo"); if (custom_info) { if (!cJSON_IsObject(custom_info)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [custom_info]"); @@ -2200,17 +2366,15 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) custom_info_local_object = OpenAPI_object_parseFromJSON(custom_info); } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *nf_service_persistence = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfServicePersistence"); - + nf_service_persistence = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfServicePersistence"); if (nf_service_persistence) { if (!cJSON_IsBool(nf_service_persistence)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_service_persistence]"); @@ -2218,63 +2382,58 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *nf_services = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfServices"); - - OpenAPI_list_t *nf_servicesList; + nf_services = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfServices"); if (nf_services) { - cJSON *nf_services_local_nonprimitive; - if (!cJSON_IsArray(nf_services)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_services]"); - goto end; - } - - nf_servicesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nf_services_local_nonprimitive, nf_services ) { - if (!cJSON_IsObject(nf_services_local_nonprimitive)) { + cJSON *nf_services_local = NULL; + if (!cJSON_IsArray(nf_services)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_services]"); goto end; } - OpenAPI_nf_service_t *nf_servicesItem = OpenAPI_nf_service_parseFromJSON(nf_services_local_nonprimitive); - if (!nf_servicesItem) { - ogs_error("No nf_servicesItem"); - OpenAPI_list_free(nf_servicesList); - goto end; + nf_servicesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nf_services_local, nf_services) { + if (!cJSON_IsObject(nf_services_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_services]"); + goto end; + } + OpenAPI_nf_service_t *nf_servicesItem = OpenAPI_nf_service_parseFromJSON(nf_services_local); + if (!nf_servicesItem) { + ogs_error("No nf_servicesItem"); + OpenAPI_list_free(nf_servicesList); + goto end; + } + OpenAPI_list_add(nf_servicesList, nf_servicesItem); } - - OpenAPI_list_add(nf_servicesList, nf_servicesItem); - } } - cJSON *nf_service_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfServiceList"); - - OpenAPI_list_t *nf_service_listList; + nf_service_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfServiceList"); if (nf_service_list) { - cJSON *nf_service_list_local_map; - if (!cJSON_IsObject(nf_service_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_service_list]"); - goto end; - } - nf_service_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(nf_service_list_local_map, nf_service_list) { - cJSON *localMapObject = nf_service_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_nf_service_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + cJSON *nf_service_list_local_map = NULL; + if (!cJSON_IsObject(nf_service_list) && !cJSON_IsNull(nf_service_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_service_list]"); goto end; } - OpenAPI_list_add(nf_service_listList, localMapKeyPair); - } + if (cJSON_IsObject(nf_service_list)) { + nf_service_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(nf_service_list_local_map, nf_service_list) { + cJSON *localMapObject = nf_service_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_nf_service_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(nf_service_listList, localMapKeyPair); + } + } } - cJSON *nf_profile_changes_support_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfProfileChangesSupportInd"); - + nf_profile_changes_support_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfProfileChangesSupportInd"); if (nf_profile_changes_support_ind) { if (!cJSON_IsBool(nf_profile_changes_support_ind)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_profile_changes_support_ind]"); @@ -2282,8 +2441,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *nf_profile_changes_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfProfileChangesInd"); - + nf_profile_changes_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfProfileChangesInd"); if (nf_profile_changes_ind) { if (!cJSON_IsBool(nf_profile_changes_ind)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_profile_changes_ind]"); @@ -2291,91 +2449,84 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *default_notification_subscriptions = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "defaultNotificationSubscriptions"); - - OpenAPI_list_t *default_notification_subscriptionsList; + default_notification_subscriptions = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "defaultNotificationSubscriptions"); if (default_notification_subscriptions) { - cJSON *default_notification_subscriptions_local_nonprimitive; - if (!cJSON_IsArray(default_notification_subscriptions)){ - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [default_notification_subscriptions]"); - goto end; - } - - default_notification_subscriptionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(default_notification_subscriptions_local_nonprimitive, default_notification_subscriptions ) { - if (!cJSON_IsObject(default_notification_subscriptions_local_nonprimitive)) { + cJSON *default_notification_subscriptions_local = NULL; + if (!cJSON_IsArray(default_notification_subscriptions)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [default_notification_subscriptions]"); goto end; } - OpenAPI_default_notification_subscription_t *default_notification_subscriptionsItem = OpenAPI_default_notification_subscription_parseFromJSON(default_notification_subscriptions_local_nonprimitive); - if (!default_notification_subscriptionsItem) { - ogs_error("No default_notification_subscriptionsItem"); - OpenAPI_list_free(default_notification_subscriptionsList); - goto end; + default_notification_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_notification_subscriptions_local, default_notification_subscriptions) { + if (!cJSON_IsObject(default_notification_subscriptions_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [default_notification_subscriptions]"); + goto end; + } + OpenAPI_default_notification_subscription_t *default_notification_subscriptionsItem = OpenAPI_default_notification_subscription_parseFromJSON(default_notification_subscriptions_local); + if (!default_notification_subscriptionsItem) { + ogs_error("No default_notification_subscriptionsItem"); + OpenAPI_list_free(default_notification_subscriptionsList); + goto end; + } + OpenAPI_list_add(default_notification_subscriptionsList, default_notification_subscriptionsItem); } - - OpenAPI_list_add(default_notification_subscriptionsList, default_notification_subscriptionsItem); - } } - cJSON *lmf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "lmfInfo"); - - OpenAPI_lmf_info_t *lmf_info_local_nonprim = NULL; + lmf_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "lmfInfo"); if (lmf_info) { lmf_info_local_nonprim = OpenAPI_lmf_info_parseFromJSON(lmf_info); } - cJSON *gmlc_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "gmlcInfo"); - - OpenAPI_gmlc_info_t *gmlc_info_local_nonprim = NULL; + gmlc_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "gmlcInfo"); if (gmlc_info) { gmlc_info_local_nonprim = OpenAPI_gmlc_info_parseFromJSON(gmlc_info); } - cJSON *nf_set_id_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfSetIdList"); - - OpenAPI_list_t *nf_set_id_listList; + nf_set_id_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfSetIdList"); if (nf_set_id_list) { - cJSON *nf_set_id_list_local; - if (!cJSON_IsArray(nf_set_id_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_set_id_list]"); - goto end; - } - nf_set_id_listList = OpenAPI_list_create(); + cJSON *nf_set_id_list_local = NULL; + if (!cJSON_IsArray(nf_set_id_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_set_id_list]"); + goto end; + } - cJSON_ArrayForEach(nf_set_id_list_local, nf_set_id_list) { - if (!cJSON_IsString(nf_set_id_list_local)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_set_id_list]"); - goto end; - } - OpenAPI_list_add(nf_set_id_listList, ogs_strdup(nf_set_id_list_local->valuestring)); - } + nf_set_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nf_set_id_list_local, nf_set_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(nf_set_id_list_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_set_id_list]"); + goto end; + } + OpenAPI_list_add(nf_set_id_listList, ogs_strdup(nf_set_id_list_local->valuestring)); + } } - cJSON *serving_scope = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "servingScope"); - - OpenAPI_list_t *serving_scopeList; + serving_scope = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "servingScope"); if (serving_scope) { - cJSON *serving_scope_local; - if (!cJSON_IsArray(serving_scope)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [serving_scope]"); - goto end; - } - serving_scopeList = OpenAPI_list_create(); + cJSON *serving_scope_local = NULL; + if (!cJSON_IsArray(serving_scope)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [serving_scope]"); + goto end; + } - cJSON_ArrayForEach(serving_scope_local, serving_scope) { - if (!cJSON_IsString(serving_scope_local)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [serving_scope]"); - goto end; - } - OpenAPI_list_add(serving_scopeList, ogs_strdup(serving_scope_local->valuestring)); - } + serving_scopeList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_scope_local, serving_scope) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(serving_scope_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [serving_scope]"); + goto end; + } + OpenAPI_list_add(serving_scopeList, ogs_strdup(serving_scope_local->valuestring)); + } } - cJSON *lc_h_support_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "lcHSupportInd"); - + lc_h_support_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "lcHSupportInd"); if (lc_h_support_ind) { if (!cJSON_IsBool(lc_h_support_ind)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [lc_h_support_ind]"); @@ -2383,8 +2534,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *olc_h_support_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "olcHSupportInd"); - + olc_h_support_ind = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "olcHSupportInd"); if (olc_h_support_ind) { if (!cJSON_IsBool(olc_h_support_ind)) { ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [olc_h_support_ind]"); @@ -2392,70 +2542,73 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) } } - cJSON *nf_set_recovery_time_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfSetRecoveryTimeList"); - - OpenAPI_list_t *nf_set_recovery_time_listList; + nf_set_recovery_time_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "nfSetRecoveryTimeList"); if (nf_set_recovery_time_list) { - cJSON *nf_set_recovery_time_list_local_map; - if (!cJSON_IsObject(nf_set_recovery_time_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_set_recovery_time_list]"); - goto end; - } - nf_set_recovery_time_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(nf_set_recovery_time_list_local_map, nf_set_recovery_time_list) { - cJSON *localMapObject = nf_set_recovery_time_list_local_map; - OpenAPI_list_add(nf_set_recovery_time_listList, localMapKeyPair); - } + cJSON *nf_set_recovery_time_list_local_map = NULL; + if (!cJSON_IsObject(nf_set_recovery_time_list) && !cJSON_IsNull(nf_set_recovery_time_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [nf_set_recovery_time_list]"); + goto end; + } + if (cJSON_IsObject(nf_set_recovery_time_list)) { + nf_set_recovery_time_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(nf_set_recovery_time_list_local_map, nf_set_recovery_time_list) { + cJSON *localMapObject = nf_set_recovery_time_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + OpenAPI_list_add(nf_set_recovery_time_listList, localMapKeyPair); + } + } } - cJSON *service_set_recovery_time_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "serviceSetRecoveryTimeList"); - - OpenAPI_list_t *service_set_recovery_time_listList; + service_set_recovery_time_list = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "serviceSetRecoveryTimeList"); if (service_set_recovery_time_list) { - cJSON *service_set_recovery_time_list_local_map; - if (!cJSON_IsObject(service_set_recovery_time_list)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [service_set_recovery_time_list]"); - goto end; - } - service_set_recovery_time_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(service_set_recovery_time_list_local_map, service_set_recovery_time_list) { - cJSON *localMapObject = service_set_recovery_time_list_local_map; - OpenAPI_list_add(service_set_recovery_time_listList, localMapKeyPair); - } + cJSON *service_set_recovery_time_list_local_map = NULL; + if (!cJSON_IsObject(service_set_recovery_time_list) && !cJSON_IsNull(service_set_recovery_time_list)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [service_set_recovery_time_list]"); + goto end; + } + if (cJSON_IsObject(service_set_recovery_time_list)) { + service_set_recovery_time_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(service_set_recovery_time_list_local_map, service_set_recovery_time_list) { + cJSON *localMapObject = service_set_recovery_time_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + OpenAPI_list_add(service_set_recovery_time_listList, localMapKeyPair); + } + } } - cJSON *scp_domains = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "scpDomains"); - - OpenAPI_list_t *scp_domainsList; + scp_domains = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "scpDomains"); if (scp_domains) { - cJSON *scp_domains_local; - if (!cJSON_IsArray(scp_domains)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [scp_domains]"); - goto end; - } - scp_domainsList = OpenAPI_list_create(); + cJSON *scp_domains_local = NULL; + if (!cJSON_IsArray(scp_domains)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [scp_domains]"); + goto end; + } - cJSON_ArrayForEach(scp_domains_local, scp_domains) { - if (!cJSON_IsString(scp_domains_local)) { - ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [scp_domains]"); - goto end; - } - OpenAPI_list_add(scp_domainsList, ogs_strdup(scp_domains_local->valuestring)); - } + scp_domainsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(scp_domains_local, scp_domains) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(scp_domains_local)) { + ogs_error("OpenAPI_nf_profile_parseFromJSON() failed [scp_domains]"); + goto end; + } + OpenAPI_list_add(scp_domainsList, ogs_strdup(scp_domains_local->valuestring)); + } } - cJSON *scp_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "scpInfo"); - - OpenAPI_scp_info_t *scp_info_local_nonprim = NULL; + scp_info = cJSON_GetObjectItemCaseSensitive(nf_profileJSON, "scpInfo"); if (scp_info) { scp_info_local_nonprim = OpenAPI_scp_info_parseFromJSON(scp_info); } nf_profile_local_var = OpenAPI_nf_profile_create ( ogs_strdup(nf_instance_id->valuestring), - nf_instance_name ? ogs_strdup(nf_instance_name->valuestring) : NULL, + nf_instance_name && !cJSON_IsNull(nf_instance_name) ? ogs_strdup(nf_instance_name->valuestring) : NULL, nf_typeVariable, nf_statusVariable, heart_beat_timer ? true : false, @@ -2465,8 +2618,8 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) s_nssais ? s_nssaisList : NULL, per_plmn_snssai_list ? per_plmn_snssai_listList : NULL, nsi_list ? nsi_listList : NULL, - fqdn ? ogs_strdup(fqdn->valuestring) : NULL, - inter_plmn_fqdn ? ogs_strdup(inter_plmn_fqdn->valuestring) : NULL, + fqdn && !cJSON_IsNull(fqdn) ? ogs_strdup(fqdn->valuestring) : NULL, + inter_plmn_fqdn && !cJSON_IsNull(inter_plmn_fqdn) ? ogs_strdup(inter_plmn_fqdn->valuestring) : NULL, ipv4_addresses ? ipv4_addressesList : NULL, ipv6_addresses ? ipv6_addressesList : NULL, allowed_plmns ? allowed_plmnsList : NULL, @@ -2480,8 +2633,8 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) capacity ? capacity->valuedouble : 0, load ? true : false, load ? load->valuedouble : 0, - load_time_stamp ? ogs_strdup(load_time_stamp->valuestring) : NULL, - locality ? ogs_strdup(locality->valuestring) : NULL, + load_time_stamp && !cJSON_IsNull(load_time_stamp) ? ogs_strdup(load_time_stamp->valuestring) : NULL, + locality && !cJSON_IsNull(locality) ? ogs_strdup(locality->valuestring) : NULL, udr_info ? udr_info_local_nonprim : NULL, udr_info_list ? udr_info_listList : NULL, udm_info ? udm_info_local_nonprim : NULL, @@ -2508,7 +2661,7 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) pcscf_info_list ? pcscf_info_listList : NULL, hss_info_list ? hss_info_listList : NULL, custom_info ? custom_info_local_object : NULL, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, nf_service_persistence ? true : false, nf_service_persistence ? nf_service_persistence->valueint : 0, nf_services ? nf_servicesList : NULL, @@ -2534,6 +2687,340 @@ OpenAPI_nf_profile_t *OpenAPI_nf_profile_parseFromJSON(cJSON *nf_profileJSON) return nf_profile_local_var; end: + if (plmn_listList) { + OpenAPI_list_for_each(plmn_listList, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(plmn_listList); + plmn_listList = NULL; + } + if (snpn_listList) { + OpenAPI_list_for_each(snpn_listList, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(snpn_listList); + snpn_listList = NULL; + } + if (s_nssaisList) { + OpenAPI_list_for_each(s_nssaisList, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(s_nssaisList); + s_nssaisList = NULL; + } + if (per_plmn_snssai_listList) { + OpenAPI_list_for_each(per_plmn_snssai_listList, node) { + OpenAPI_plmn_snssai_free(node->data); + } + OpenAPI_list_free(per_plmn_snssai_listList); + per_plmn_snssai_listList = NULL; + } + if (nsi_listList) { + OpenAPI_list_for_each(nsi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nsi_listList); + nsi_listList = NULL; + } + if (ipv4_addressesList) { + OpenAPI_list_for_each(ipv4_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_addressesList); + ipv4_addressesList = NULL; + } + if (ipv6_addressesList) { + OpenAPI_list_for_each(ipv6_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_addressesList); + ipv6_addressesList = NULL; + } + if (allowed_plmnsList) { + OpenAPI_list_for_each(allowed_plmnsList, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(allowed_plmnsList); + allowed_plmnsList = NULL; + } + if (allowed_snpnsList) { + OpenAPI_list_for_each(allowed_snpnsList, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(allowed_snpnsList); + allowed_snpnsList = NULL; + } + if (allowed_nf_typesList) { + OpenAPI_list_free(allowed_nf_typesList); + allowed_nf_typesList = NULL; + } + if (allowed_nf_domainsList) { + OpenAPI_list_for_each(allowed_nf_domainsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(allowed_nf_domainsList); + allowed_nf_domainsList = NULL; + } + if (allowed_nssaisList) { + OpenAPI_list_for_each(allowed_nssaisList, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(allowed_nssaisList); + allowed_nssaisList = NULL; + } + if (udr_info_local_nonprim) { + OpenAPI_udr_info_free(udr_info_local_nonprim); + udr_info_local_nonprim = NULL; + } + if (udr_info_listList) { + OpenAPI_list_for_each(udr_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_udr_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(udr_info_listList); + udr_info_listList = NULL; + } + if (udm_info_local_nonprim) { + OpenAPI_udm_info_free(udm_info_local_nonprim); + udm_info_local_nonprim = NULL; + } + if (udm_info_listList) { + OpenAPI_list_for_each(udm_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_udm_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(udm_info_listList); + udm_info_listList = NULL; + } + if (ausf_info_local_nonprim) { + OpenAPI_ausf_info_free(ausf_info_local_nonprim); + ausf_info_local_nonprim = NULL; + } + if (ausf_info_listList) { + OpenAPI_list_for_each(ausf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_ausf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ausf_info_listList); + ausf_info_listList = NULL; + } + if (amf_info_local_nonprim) { + OpenAPI_amf_info_free(amf_info_local_nonprim); + amf_info_local_nonprim = NULL; + } + if (amf_info_listList) { + OpenAPI_list_for_each(amf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_amf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(amf_info_listList); + amf_info_listList = NULL; + } + if (smf_info_local_nonprim) { + OpenAPI_smf_info_free(smf_info_local_nonprim); + smf_info_local_nonprim = NULL; + } + if (smf_info_listList) { + OpenAPI_list_for_each(smf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_smf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(smf_info_listList); + smf_info_listList = NULL; + } + if (upf_info_local_nonprim) { + OpenAPI_upf_info_free(upf_info_local_nonprim); + upf_info_local_nonprim = NULL; + } + if (upf_info_listList) { + OpenAPI_list_for_each(upf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_upf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(upf_info_listList); + upf_info_listList = NULL; + } + if (pcf_info_local_nonprim) { + OpenAPI_pcf_info_free(pcf_info_local_nonprim); + pcf_info_local_nonprim = NULL; + } + if (pcf_info_listList) { + OpenAPI_list_for_each(pcf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_pcf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pcf_info_listList); + pcf_info_listList = NULL; + } + if (bsf_info_local_nonprim) { + OpenAPI_bsf_info_free(bsf_info_local_nonprim); + bsf_info_local_nonprim = NULL; + } + if (bsf_info_listList) { + OpenAPI_list_for_each(bsf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_bsf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(bsf_info_listList); + bsf_info_listList = NULL; + } + if (chf_info_local_nonprim) { + OpenAPI_chf_info_free(chf_info_local_nonprim); + chf_info_local_nonprim = NULL; + } + if (chf_info_listList) { + OpenAPI_list_for_each(chf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_chf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(chf_info_listList); + chf_info_listList = NULL; + } + if (nef_info_local_nonprim) { + OpenAPI_nef_info_free(nef_info_local_nonprim); + nef_info_local_nonprim = NULL; + } + if (nrf_info_local_nonprim) { + OpenAPI_nrf_info_free(nrf_info_local_nonprim); + nrf_info_local_nonprim = NULL; + } + if (udsf_info_local_nonprim) { + OpenAPI_udsf_info_free(udsf_info_local_nonprim); + udsf_info_local_nonprim = NULL; + } + if (udsf_info_listList) { + OpenAPI_list_for_each(udsf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_udsf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(udsf_info_listList); + udsf_info_listList = NULL; + } + if (nwdaf_info_local_nonprim) { + OpenAPI_nwdaf_info_free(nwdaf_info_local_nonprim); + nwdaf_info_local_nonprim = NULL; + } + if (pcscf_info_listList) { + OpenAPI_list_for_each(pcscf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_pcscf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pcscf_info_listList); + pcscf_info_listList = NULL; + } + if (hss_info_listList) { + OpenAPI_list_for_each(hss_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_hss_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(hss_info_listList); + hss_info_listList = NULL; + } + if (custom_info_local_object) { + OpenAPI_object_free(custom_info_local_object); + custom_info_local_object = NULL; + } + if (nf_servicesList) { + OpenAPI_list_for_each(nf_servicesList, node) { + OpenAPI_nf_service_free(node->data); + } + OpenAPI_list_free(nf_servicesList); + nf_servicesList = NULL; + } + if (nf_service_listList) { + OpenAPI_list_for_each(nf_service_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_nf_service_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_service_listList); + nf_service_listList = NULL; + } + if (default_notification_subscriptionsList) { + OpenAPI_list_for_each(default_notification_subscriptionsList, node) { + OpenAPI_default_notification_subscription_free(node->data); + } + OpenAPI_list_free(default_notification_subscriptionsList); + default_notification_subscriptionsList = NULL; + } + if (lmf_info_local_nonprim) { + OpenAPI_lmf_info_free(lmf_info_local_nonprim); + lmf_info_local_nonprim = NULL; + } + if (gmlc_info_local_nonprim) { + OpenAPI_gmlc_info_free(gmlc_info_local_nonprim); + gmlc_info_local_nonprim = NULL; + } + if (nf_set_id_listList) { + OpenAPI_list_for_each(nf_set_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_set_id_listList); + nf_set_id_listList = NULL; + } + if (serving_scopeList) { + OpenAPI_list_for_each(serving_scopeList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(serving_scopeList); + serving_scopeList = NULL; + } + if (nf_set_recovery_time_listList) { + OpenAPI_list_for_each(nf_set_recovery_time_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_set_recovery_time_listList); + nf_set_recovery_time_listList = NULL; + } + if (service_set_recovery_time_listList) { + OpenAPI_list_for_each(service_set_recovery_time_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(service_set_recovery_time_listList); + service_set_recovery_time_listList = NULL; + } + if (scp_domainsList) { + OpenAPI_list_for_each(scp_domainsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scp_domainsList); + scp_domainsList = NULL; + } + if (scp_info_local_nonprim) { + OpenAPI_scp_info_free(scp_info_local_nonprim); + scp_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nf_service.c b/lib/sbi/openapi/model/nf_service.c index e27135d1a..cf55599f6 100644 --- a/lib/sbi/openapi/model/nf_service.c +++ b/lib/sbi/openapi/model/nf_service.c @@ -82,87 +82,158 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_create( void OpenAPI_nf_service_free(OpenAPI_nf_service_t *nf_service) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_service) { return; } - OpenAPI_lnode_t *node; - ogs_free(nf_service->service_instance_id); - ogs_free(nf_service->service_name); - OpenAPI_list_for_each(nf_service->versions, node) { - OpenAPI_nf_service_version_free(node->data); + if (nf_service->service_instance_id) { + ogs_free(nf_service->service_instance_id); + nf_service->service_instance_id = NULL; } - OpenAPI_list_free(nf_service->versions); - ogs_free(nf_service->fqdn); - ogs_free(nf_service->inter_plmn_fqdn); - OpenAPI_list_for_each(nf_service->ip_end_points, node) { - OpenAPI_ip_end_point_free(node->data); + if (nf_service->service_name) { + ogs_free(nf_service->service_name); + nf_service->service_name = NULL; } - OpenAPI_list_free(nf_service->ip_end_points); - ogs_free(nf_service->api_prefix); - OpenAPI_list_for_each(nf_service->default_notification_subscriptions, node) { - OpenAPI_default_notification_subscription_free(node->data); + if (nf_service->versions) { + OpenAPI_list_for_each(nf_service->versions, node) { + OpenAPI_nf_service_version_free(node->data); + } + OpenAPI_list_free(nf_service->versions); + nf_service->versions = NULL; } - OpenAPI_list_free(nf_service->default_notification_subscriptions); - OpenAPI_list_for_each(nf_service->allowed_plmns, node) { - OpenAPI_plmn_id_free(node->data); + if (nf_service->fqdn) { + ogs_free(nf_service->fqdn); + nf_service->fqdn = NULL; } - OpenAPI_list_free(nf_service->allowed_plmns); - OpenAPI_list_for_each(nf_service->allowed_snpns, node) { - OpenAPI_plmn_id_nid_free(node->data); + if (nf_service->inter_plmn_fqdn) { + ogs_free(nf_service->inter_plmn_fqdn); + nf_service->inter_plmn_fqdn = NULL; } - OpenAPI_list_free(nf_service->allowed_snpns); - OpenAPI_list_free(nf_service->allowed_nf_types); - OpenAPI_list_for_each(nf_service->allowed_nf_domains, node) { - ogs_free(node->data); + if (nf_service->ip_end_points) { + OpenAPI_list_for_each(nf_service->ip_end_points, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(nf_service->ip_end_points); + nf_service->ip_end_points = NULL; } - OpenAPI_list_free(nf_service->allowed_nf_domains); - OpenAPI_list_for_each(nf_service->allowed_nssais, node) { - OpenAPI_ext_snssai_free(node->data); + if (nf_service->api_prefix) { + ogs_free(nf_service->api_prefix); + nf_service->api_prefix = NULL; } - OpenAPI_list_free(nf_service->allowed_nssais); - OpenAPI_list_for_each(nf_service->allowed_operations_per_nf_type, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_service->default_notification_subscriptions) { + OpenAPI_list_for_each(nf_service->default_notification_subscriptions, node) { + OpenAPI_default_notification_subscription_free(node->data); + } + OpenAPI_list_free(nf_service->default_notification_subscriptions); + nf_service->default_notification_subscriptions = NULL; } - OpenAPI_list_free(nf_service->allowed_operations_per_nf_type); - OpenAPI_list_for_each(nf_service->allowed_operations_per_nf_instance, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_service->allowed_plmns) { + OpenAPI_list_for_each(nf_service->allowed_plmns, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(nf_service->allowed_plmns); + nf_service->allowed_plmns = NULL; } - OpenAPI_list_free(nf_service->allowed_operations_per_nf_instance); - ogs_free(nf_service->load_time_stamp); - ogs_free(nf_service->recovery_time); - ogs_free(nf_service->supported_features); - OpenAPI_list_for_each(nf_service->nf_service_set_id_list, node) { - ogs_free(node->data); + if (nf_service->allowed_snpns) { + OpenAPI_list_for_each(nf_service->allowed_snpns, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(nf_service->allowed_snpns); + nf_service->allowed_snpns = NULL; } - OpenAPI_list_free(nf_service->nf_service_set_id_list); - OpenAPI_list_for_each(nf_service->s_nssais, node) { - OpenAPI_ext_snssai_free(node->data); + if (nf_service->allowed_nf_types) { + OpenAPI_list_free(nf_service->allowed_nf_types); + nf_service->allowed_nf_types = NULL; } - OpenAPI_list_free(nf_service->s_nssais); - OpenAPI_list_for_each(nf_service->per_plmn_snssai_list, node) { - OpenAPI_plmn_snssai_free(node->data); + if (nf_service->allowed_nf_domains) { + OpenAPI_list_for_each(nf_service->allowed_nf_domains, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_service->allowed_nf_domains); + nf_service->allowed_nf_domains = NULL; } - OpenAPI_list_free(nf_service->per_plmn_snssai_list); - ogs_free(nf_service->vendor_id); - OpenAPI_list_for_each(nf_service->supported_vendor_specific_features, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nf_service->allowed_nssais) { + OpenAPI_list_for_each(nf_service->allowed_nssais, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(nf_service->allowed_nssais); + nf_service->allowed_nssais = NULL; + } + if (nf_service->allowed_operations_per_nf_type) { + OpenAPI_list_for_each(nf_service->allowed_operations_per_nf_type, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_service->allowed_operations_per_nf_type); + nf_service->allowed_operations_per_nf_type = NULL; + } + if (nf_service->allowed_operations_per_nf_instance) { + OpenAPI_list_for_each(nf_service->allowed_operations_per_nf_instance, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_service->allowed_operations_per_nf_instance); + nf_service->allowed_operations_per_nf_instance = NULL; + } + if (nf_service->load_time_stamp) { + ogs_free(nf_service->load_time_stamp); + nf_service->load_time_stamp = NULL; + } + if (nf_service->recovery_time) { + ogs_free(nf_service->recovery_time); + nf_service->recovery_time = NULL; + } + if (nf_service->supported_features) { + ogs_free(nf_service->supported_features); + nf_service->supported_features = NULL; + } + if (nf_service->nf_service_set_id_list) { + OpenAPI_list_for_each(nf_service->nf_service_set_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_service->nf_service_set_id_list); + nf_service->nf_service_set_id_list = NULL; + } + if (nf_service->s_nssais) { + OpenAPI_list_for_each(nf_service->s_nssais, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(nf_service->s_nssais); + nf_service->s_nssais = NULL; + } + if (nf_service->per_plmn_snssai_list) { + OpenAPI_list_for_each(nf_service->per_plmn_snssai_list, node) { + OpenAPI_plmn_snssai_free(node->data); + } + OpenAPI_list_free(nf_service->per_plmn_snssai_list); + nf_service->per_plmn_snssai_list = NULL; + } + if (nf_service->vendor_id) { + ogs_free(nf_service->vendor_id); + nf_service->vendor_id = NULL; + } + if (nf_service->supported_vendor_specific_features) { + OpenAPI_list_for_each(nf_service->supported_vendor_specific_features, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nf_service->supported_vendor_specific_features); + nf_service->supported_vendor_specific_features = NULL; } - OpenAPI_list_free(nf_service->supported_vendor_specific_features); ogs_free(nf_service); } cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_service == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [NFService]"); @@ -170,39 +241,55 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) } item = cJSON_CreateObject(); + if (!nf_service->service_instance_id) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [service_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "serviceInstanceId", nf_service->service_instance_id) == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [service_instance_id]"); goto end; } + if (!nf_service->service_name) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [service_name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "serviceName", nf_service->service_name) == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [service_name]"); goto end; } + if (!nf_service->versions) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [versions]"); + return NULL; + } cJSON *versionsList = cJSON_AddArrayToObject(item, "versions"); if (versionsList == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [versions]"); goto end; } - - OpenAPI_lnode_t *versions_node; - if (nf_service->versions) { - OpenAPI_list_for_each(nf_service->versions, versions_node) { - cJSON *itemLocal = OpenAPI_nf_service_version_convertToJSON(versions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [versions]"); - goto end; - } - cJSON_AddItemToArray(versionsList, itemLocal); + OpenAPI_list_for_each(nf_service->versions, node) { + cJSON *itemLocal = OpenAPI_nf_service_version_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [versions]"); + goto end; } + cJSON_AddItemToArray(versionsList, itemLocal); } + if (nf_service->scheme == OpenAPI_uri_scheme_NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [scheme]"); + return NULL; + } if (cJSON_AddStringToObject(item, "scheme", OpenAPI_uri_scheme_ToString(nf_service->scheme)) == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [scheme]"); goto end; } + if (nf_service->nf_service_status == OpenAPI_nf_service_status_NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [nf_service_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfServiceStatus", OpenAPI_nf_service_status_ToString(nf_service->nf_service_status)) == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [nf_service_status]"); goto end; @@ -228,17 +315,13 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) ogs_error("OpenAPI_nf_service_convertToJSON() failed [ip_end_points]"); goto end; } - - OpenAPI_lnode_t *ip_end_points_node; - if (nf_service->ip_end_points) { - OpenAPI_list_for_each(nf_service->ip_end_points, ip_end_points_node) { - cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(ip_end_points_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [ip_end_points]"); - goto end; - } - cJSON_AddItemToArray(ip_end_pointsList, itemLocal); + OpenAPI_list_for_each(nf_service->ip_end_points, node) { + cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [ip_end_points]"); + goto end; } + cJSON_AddItemToArray(ip_end_pointsList, itemLocal); } } @@ -255,17 +338,13 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) ogs_error("OpenAPI_nf_service_convertToJSON() failed [default_notification_subscriptions]"); goto end; } - - OpenAPI_lnode_t *default_notification_subscriptions_node; - if (nf_service->default_notification_subscriptions) { - OpenAPI_list_for_each(nf_service->default_notification_subscriptions, default_notification_subscriptions_node) { - cJSON *itemLocal = OpenAPI_default_notification_subscription_convertToJSON(default_notification_subscriptions_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [default_notification_subscriptions]"); - goto end; - } - cJSON_AddItemToArray(default_notification_subscriptionsList, itemLocal); + OpenAPI_list_for_each(nf_service->default_notification_subscriptions, node) { + cJSON *itemLocal = OpenAPI_default_notification_subscription_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [default_notification_subscriptions]"); + goto end; } + cJSON_AddItemToArray(default_notification_subscriptionsList, itemLocal); } } @@ -275,17 +354,13 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_plmns]"); goto end; } - - OpenAPI_lnode_t *allowed_plmns_node; - if (nf_service->allowed_plmns) { - OpenAPI_list_for_each(nf_service->allowed_plmns, allowed_plmns_node) { - cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(allowed_plmns_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_plmns]"); - goto end; - } - cJSON_AddItemToArray(allowed_plmnsList, itemLocal); + OpenAPI_list_for_each(nf_service->allowed_plmns, node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_plmns]"); + goto end; } + cJSON_AddItemToArray(allowed_plmnsList, itemLocal); } } @@ -295,29 +370,24 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_snpns]"); goto end; } - - OpenAPI_lnode_t *allowed_snpns_node; - if (nf_service->allowed_snpns) { - OpenAPI_list_for_each(nf_service->allowed_snpns, allowed_snpns_node) { - cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(allowed_snpns_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_snpns]"); - goto end; - } - cJSON_AddItemToArray(allowed_snpnsList, itemLocal); + OpenAPI_list_for_each(nf_service->allowed_snpns, node) { + cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_snpns]"); + goto end; } + cJSON_AddItemToArray(allowed_snpnsList, itemLocal); } } - if (nf_service->allowed_nf_types) { - cJSON *allowed_nf_types = cJSON_AddArrayToObject(item, "allowedNfTypes"); - if (allowed_nf_types == NULL) { + if (nf_service->allowed_nf_types != OpenAPI_nf_type_NULL) { + cJSON *allowed_nf_typesList = cJSON_AddArrayToObject(item, "allowedNfTypes"); + if (allowed_nf_typesList == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_nf_types]"); goto end; } - OpenAPI_lnode_t *allowed_nf_types_node; - OpenAPI_list_for_each(nf_service->allowed_nf_types, allowed_nf_types_node) { - if (cJSON_AddStringToObject(allowed_nf_types, "", OpenAPI_nf_type_ToString((intptr_t)allowed_nf_types_node->data)) == NULL) { + OpenAPI_list_for_each(nf_service->allowed_nf_types, node) { + if (cJSON_AddStringToObject(allowed_nf_typesList, "", OpenAPI_nf_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_nf_types]"); goto end; } @@ -325,19 +395,17 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) } if (nf_service->allowed_nf_domains) { - cJSON *allowed_nf_domains = cJSON_AddArrayToObject(item, "allowedNfDomains"); - if (allowed_nf_domains == NULL) { + cJSON *allowed_nf_domainsList = cJSON_AddArrayToObject(item, "allowedNfDomains"); + if (allowed_nf_domainsList == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_nf_domains]"); goto end; } - - OpenAPI_lnode_t *allowed_nf_domains_node; - OpenAPI_list_for_each(nf_service->allowed_nf_domains, allowed_nf_domains_node) { - if (cJSON_AddStringToObject(allowed_nf_domains, "", (char*)allowed_nf_domains_node->data) == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_nf_domains]"); - goto end; + OpenAPI_list_for_each(nf_service->allowed_nf_domains, node) { + if (cJSON_AddStringToObject(allowed_nf_domainsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_nf_domains]"); + goto end; + } } - } } if (nf_service->allowed_nssais) { @@ -346,17 +414,13 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_nssais]"); goto end; } - - OpenAPI_lnode_t *allowed_nssais_node; - if (nf_service->allowed_nssais) { - OpenAPI_list_for_each(nf_service->allowed_nssais, allowed_nssais_node) { - cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(allowed_nssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_nssais]"); - goto end; - } - cJSON_AddItemToArray(allowed_nssaisList, itemLocal); + OpenAPI_list_for_each(nf_service->allowed_nssais, node) { + cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [allowed_nssais]"); + goto end; } + cJSON_AddItemToArray(allowed_nssaisList, itemLocal); } } @@ -367,13 +431,12 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) goto end; } cJSON *localMapObject = allowed_operations_per_nf_type; - OpenAPI_lnode_t *allowed_operations_per_nf_type_node; if (nf_service->allowed_operations_per_nf_type) { - OpenAPI_list_for_each(nf_service->allowed_operations_per_nf_type, allowed_operations_per_nf_type_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)allowed_operations_per_nf_type_node->data; - } + OpenAPI_list_for_each(nf_service->allowed_operations_per_nf_type, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; } } + } if (nf_service->allowed_operations_per_nf_instance) { cJSON *allowed_operations_per_nf_instance = cJSON_AddObjectToObject(item, "allowedOperationsPerNfInstance"); @@ -382,13 +445,12 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) goto end; } cJSON *localMapObject = allowed_operations_per_nf_instance; - OpenAPI_lnode_t *allowed_operations_per_nf_instance_node; if (nf_service->allowed_operations_per_nf_instance) { - OpenAPI_list_for_each(nf_service->allowed_operations_per_nf_instance, allowed_operations_per_nf_instance_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)allowed_operations_per_nf_instance_node->data; - } + OpenAPI_list_for_each(nf_service->allowed_operations_per_nf_instance, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; } } + } if (nf_service->is_priority) { if (cJSON_AddNumberToObject(item, "priority", nf_service->priority) == NULL) { @@ -433,19 +495,17 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) } if (nf_service->nf_service_set_id_list) { - cJSON *nf_service_set_id_list = cJSON_AddArrayToObject(item, "nfServiceSetIdList"); - if (nf_service_set_id_list == NULL) { + cJSON *nf_service_set_id_listList = cJSON_AddArrayToObject(item, "nfServiceSetIdList"); + if (nf_service_set_id_listList == NULL) { ogs_error("OpenAPI_nf_service_convertToJSON() failed [nf_service_set_id_list]"); goto end; } - - OpenAPI_lnode_t *nf_service_set_id_list_node; - OpenAPI_list_for_each(nf_service->nf_service_set_id_list, nf_service_set_id_list_node) { - if (cJSON_AddStringToObject(nf_service_set_id_list, "", (char*)nf_service_set_id_list_node->data) == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [nf_service_set_id_list]"); - goto end; + OpenAPI_list_for_each(nf_service->nf_service_set_id_list, node) { + if (cJSON_AddStringToObject(nf_service_set_id_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [nf_service_set_id_list]"); + goto end; + } } - } } if (nf_service->s_nssais) { @@ -454,17 +514,13 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) ogs_error("OpenAPI_nf_service_convertToJSON() failed [s_nssais]"); goto end; } - - OpenAPI_lnode_t *s_nssais_node; - if (nf_service->s_nssais) { - OpenAPI_list_for_each(nf_service->s_nssais, s_nssais_node) { - cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(s_nssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [s_nssais]"); - goto end; - } - cJSON_AddItemToArray(s_nssaisList, itemLocal); + OpenAPI_list_for_each(nf_service->s_nssais, node) { + cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [s_nssais]"); + goto end; } + cJSON_AddItemToArray(s_nssaisList, itemLocal); } } @@ -474,17 +530,13 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) ogs_error("OpenAPI_nf_service_convertToJSON() failed [per_plmn_snssai_list]"); goto end; } - - OpenAPI_lnode_t *per_plmn_snssai_list_node; - if (nf_service->per_plmn_snssai_list) { - OpenAPI_list_for_each(nf_service->per_plmn_snssai_list, per_plmn_snssai_list_node) { - cJSON *itemLocal = OpenAPI_plmn_snssai_convertToJSON(per_plmn_snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [per_plmn_snssai_list]"); - goto end; - } - cJSON_AddItemToArray(per_plmn_snssai_listList, itemLocal); + OpenAPI_list_for_each(nf_service->per_plmn_snssai_list, node) { + cJSON *itemLocal = OpenAPI_plmn_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [per_plmn_snssai_list]"); + goto end; } + cJSON_AddItemToArray(per_plmn_snssai_listList, itemLocal); } } @@ -502,21 +554,20 @@ cJSON *OpenAPI_nf_service_convertToJSON(OpenAPI_nf_service_t *nf_service) goto end; } cJSON *localMapObject = supported_vendor_specific_features; - OpenAPI_lnode_t *supported_vendor_specific_features_node; if (nf_service->supported_vendor_specific_features) { - OpenAPI_list_for_each(nf_service->supported_vendor_specific_features, supported_vendor_specific_features_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)supported_vendor_specific_features_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_vendor_specific_feature_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nf_service_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nf_service->supported_vendor_specific_features, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_vendor_specific_feature_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nf_service_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nf_service->is_oauth2_required) { if (cJSON_AddBoolToObject(item, "oauth2Required", nf_service->oauth2_required) == NULL) { @@ -532,335 +583,349 @@ end: OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) { OpenAPI_nf_service_t *nf_service_local_var = NULL; - cJSON *service_instance_id = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "serviceInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *service_instance_id = NULL; + cJSON *service_name = NULL; + cJSON *versions = NULL; + OpenAPI_list_t *versionsList = NULL; + cJSON *scheme = NULL; + OpenAPI_uri_scheme_e schemeVariable = 0; + cJSON *nf_service_status = NULL; + OpenAPI_nf_service_status_e nf_service_statusVariable = 0; + cJSON *fqdn = NULL; + cJSON *inter_plmn_fqdn = NULL; + cJSON *ip_end_points = NULL; + OpenAPI_list_t *ip_end_pointsList = NULL; + cJSON *api_prefix = NULL; + cJSON *default_notification_subscriptions = NULL; + OpenAPI_list_t *default_notification_subscriptionsList = NULL; + cJSON *allowed_plmns = NULL; + OpenAPI_list_t *allowed_plmnsList = NULL; + cJSON *allowed_snpns = NULL; + OpenAPI_list_t *allowed_snpnsList = NULL; + cJSON *allowed_nf_types = NULL; + OpenAPI_list_t *allowed_nf_typesList = NULL; + cJSON *allowed_nf_domains = NULL; + OpenAPI_list_t *allowed_nf_domainsList = NULL; + cJSON *allowed_nssais = NULL; + OpenAPI_list_t *allowed_nssaisList = NULL; + cJSON *allowed_operations_per_nf_type = NULL; + OpenAPI_list_t *allowed_operations_per_nf_typeList = NULL; + cJSON *allowed_operations_per_nf_instance = NULL; + OpenAPI_list_t *allowed_operations_per_nf_instanceList = NULL; + cJSON *priority = NULL; + cJSON *capacity = NULL; + cJSON *load = NULL; + cJSON *load_time_stamp = NULL; + cJSON *recovery_time = NULL; + cJSON *supported_features = NULL; + cJSON *nf_service_set_id_list = NULL; + OpenAPI_list_t *nf_service_set_id_listList = NULL; + cJSON *s_nssais = NULL; + OpenAPI_list_t *s_nssaisList = NULL; + cJSON *per_plmn_snssai_list = NULL; + OpenAPI_list_t *per_plmn_snssai_listList = NULL; + cJSON *vendor_id = NULL; + cJSON *supported_vendor_specific_features = NULL; + OpenAPI_list_t *supported_vendor_specific_featuresList = NULL; + cJSON *oauth2_required = NULL; + service_instance_id = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "serviceInstanceId"); if (!service_instance_id) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [service_instance_id]"); goto end; } - if (!cJSON_IsString(service_instance_id)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [service_instance_id]"); goto end; } - cJSON *service_name = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "serviceName"); + service_name = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "serviceName"); if (!service_name) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [service_name]"); goto end; } - if (!cJSON_IsString(service_name)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [service_name]"); goto end; } - cJSON *versions = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "versions"); + versions = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "versions"); if (!versions) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [versions]"); goto end; } - - OpenAPI_list_t *versionsList; - cJSON *versions_local_nonprimitive; - if (!cJSON_IsArray(versions)){ - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [versions]"); - goto end; - } - - versionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(versions_local_nonprimitive, versions ) { - if (!cJSON_IsObject(versions_local_nonprimitive)) { + cJSON *versions_local = NULL; + if (!cJSON_IsArray(versions)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [versions]"); goto end; } - OpenAPI_nf_service_version_t *versionsItem = OpenAPI_nf_service_version_parseFromJSON(versions_local_nonprimitive); - if (!versionsItem) { - ogs_error("No versionsItem"); - OpenAPI_list_free(versionsList); - goto end; + versionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(versions_local, versions) { + if (!cJSON_IsObject(versions_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [versions]"); + goto end; + } + OpenAPI_nf_service_version_t *versionsItem = OpenAPI_nf_service_version_parseFromJSON(versions_local); + if (!versionsItem) { + ogs_error("No versionsItem"); + OpenAPI_list_free(versionsList); + goto end; + } + OpenAPI_list_add(versionsList, versionsItem); } - OpenAPI_list_add(versionsList, versionsItem); - } - - cJSON *scheme = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "scheme"); + scheme = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "scheme"); if (!scheme) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [scheme]"); goto end; } - - OpenAPI_uri_scheme_e schemeVariable; if (!cJSON_IsString(scheme)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [scheme]"); goto end; } schemeVariable = OpenAPI_uri_scheme_FromString(scheme->valuestring); - cJSON *nf_service_status = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "nfServiceStatus"); + nf_service_status = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "nfServiceStatus"); if (!nf_service_status) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [nf_service_status]"); goto end; } - - OpenAPI_nf_service_status_e nf_service_statusVariable; if (!cJSON_IsString(nf_service_status)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [nf_service_status]"); goto end; } nf_service_statusVariable = OpenAPI_nf_service_status_FromString(nf_service_status->valuestring); - cJSON *fqdn = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "fqdn"); - + fqdn = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "fqdn"); if (fqdn) { - if (!cJSON_IsString(fqdn)) { + if (!cJSON_IsString(fqdn) && !cJSON_IsNull(fqdn)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [fqdn]"); goto end; } } - cJSON *inter_plmn_fqdn = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "interPlmnFqdn"); - + inter_plmn_fqdn = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "interPlmnFqdn"); if (inter_plmn_fqdn) { - if (!cJSON_IsString(inter_plmn_fqdn)) { + if (!cJSON_IsString(inter_plmn_fqdn) && !cJSON_IsNull(inter_plmn_fqdn)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [inter_plmn_fqdn]"); goto end; } } - cJSON *ip_end_points = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "ipEndPoints"); - - OpenAPI_list_t *ip_end_pointsList; + ip_end_points = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "ipEndPoints"); if (ip_end_points) { - cJSON *ip_end_points_local_nonprimitive; - if (!cJSON_IsArray(ip_end_points)){ - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [ip_end_points]"); - goto end; - } - - ip_end_pointsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ip_end_points_local_nonprimitive, ip_end_points ) { - if (!cJSON_IsObject(ip_end_points_local_nonprimitive)) { + cJSON *ip_end_points_local = NULL; + if (!cJSON_IsArray(ip_end_points)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [ip_end_points]"); goto end; } - OpenAPI_ip_end_point_t *ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(ip_end_points_local_nonprimitive); - if (!ip_end_pointsItem) { - ogs_error("No ip_end_pointsItem"); - OpenAPI_list_free(ip_end_pointsList); - goto end; + ip_end_pointsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ip_end_points_local, ip_end_points) { + if (!cJSON_IsObject(ip_end_points_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [ip_end_points]"); + goto end; + } + OpenAPI_ip_end_point_t *ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(ip_end_points_local); + if (!ip_end_pointsItem) { + ogs_error("No ip_end_pointsItem"); + OpenAPI_list_free(ip_end_pointsList); + goto end; + } + OpenAPI_list_add(ip_end_pointsList, ip_end_pointsItem); } - - OpenAPI_list_add(ip_end_pointsList, ip_end_pointsItem); - } } - cJSON *api_prefix = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "apiPrefix"); - + api_prefix = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "apiPrefix"); if (api_prefix) { - if (!cJSON_IsString(api_prefix)) { + if (!cJSON_IsString(api_prefix) && !cJSON_IsNull(api_prefix)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [api_prefix]"); goto end; } } - cJSON *default_notification_subscriptions = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "defaultNotificationSubscriptions"); - - OpenAPI_list_t *default_notification_subscriptionsList; + default_notification_subscriptions = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "defaultNotificationSubscriptions"); if (default_notification_subscriptions) { - cJSON *default_notification_subscriptions_local_nonprimitive; - if (!cJSON_IsArray(default_notification_subscriptions)){ - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [default_notification_subscriptions]"); - goto end; - } - - default_notification_subscriptionsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(default_notification_subscriptions_local_nonprimitive, default_notification_subscriptions ) { - if (!cJSON_IsObject(default_notification_subscriptions_local_nonprimitive)) { + cJSON *default_notification_subscriptions_local = NULL; + if (!cJSON_IsArray(default_notification_subscriptions)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [default_notification_subscriptions]"); goto end; } - OpenAPI_default_notification_subscription_t *default_notification_subscriptionsItem = OpenAPI_default_notification_subscription_parseFromJSON(default_notification_subscriptions_local_nonprimitive); - if (!default_notification_subscriptionsItem) { - ogs_error("No default_notification_subscriptionsItem"); - OpenAPI_list_free(default_notification_subscriptionsList); - goto end; + default_notification_subscriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_notification_subscriptions_local, default_notification_subscriptions) { + if (!cJSON_IsObject(default_notification_subscriptions_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [default_notification_subscriptions]"); + goto end; + } + OpenAPI_default_notification_subscription_t *default_notification_subscriptionsItem = OpenAPI_default_notification_subscription_parseFromJSON(default_notification_subscriptions_local); + if (!default_notification_subscriptionsItem) { + ogs_error("No default_notification_subscriptionsItem"); + OpenAPI_list_free(default_notification_subscriptionsList); + goto end; + } + OpenAPI_list_add(default_notification_subscriptionsList, default_notification_subscriptionsItem); } - - OpenAPI_list_add(default_notification_subscriptionsList, default_notification_subscriptionsItem); - } } - cJSON *allowed_plmns = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedPlmns"); - - OpenAPI_list_t *allowed_plmnsList; + allowed_plmns = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedPlmns"); if (allowed_plmns) { - cJSON *allowed_plmns_local_nonprimitive; - if (!cJSON_IsArray(allowed_plmns)){ - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_plmns]"); - goto end; - } - - allowed_plmnsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_plmns_local_nonprimitive, allowed_plmns ) { - if (!cJSON_IsObject(allowed_plmns_local_nonprimitive)) { + cJSON *allowed_plmns_local = NULL; + if (!cJSON_IsArray(allowed_plmns)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_plmns]"); goto end; } - OpenAPI_plmn_id_t *allowed_plmnsItem = OpenAPI_plmn_id_parseFromJSON(allowed_plmns_local_nonprimitive); - if (!allowed_plmnsItem) { - ogs_error("No allowed_plmnsItem"); - OpenAPI_list_free(allowed_plmnsList); - goto end; + allowed_plmnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_plmns_local, allowed_plmns) { + if (!cJSON_IsObject(allowed_plmns_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_plmns]"); + goto end; + } + OpenAPI_plmn_id_t *allowed_plmnsItem = OpenAPI_plmn_id_parseFromJSON(allowed_plmns_local); + if (!allowed_plmnsItem) { + ogs_error("No allowed_plmnsItem"); + OpenAPI_list_free(allowed_plmnsList); + goto end; + } + OpenAPI_list_add(allowed_plmnsList, allowed_plmnsItem); } - - OpenAPI_list_add(allowed_plmnsList, allowed_plmnsItem); - } } - cJSON *allowed_snpns = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedSnpns"); - - OpenAPI_list_t *allowed_snpnsList; + allowed_snpns = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedSnpns"); if (allowed_snpns) { - cJSON *allowed_snpns_local_nonprimitive; - if (!cJSON_IsArray(allowed_snpns)){ - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_snpns]"); - goto end; - } - - allowed_snpnsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_snpns_local_nonprimitive, allowed_snpns ) { - if (!cJSON_IsObject(allowed_snpns_local_nonprimitive)) { + cJSON *allowed_snpns_local = NULL; + if (!cJSON_IsArray(allowed_snpns)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_snpns]"); goto end; } - OpenAPI_plmn_id_nid_t *allowed_snpnsItem = OpenAPI_plmn_id_nid_parseFromJSON(allowed_snpns_local_nonprimitive); - if (!allowed_snpnsItem) { - ogs_error("No allowed_snpnsItem"); - OpenAPI_list_free(allowed_snpnsList); - goto end; + allowed_snpnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_snpns_local, allowed_snpns) { + if (!cJSON_IsObject(allowed_snpns_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_snpns]"); + goto end; + } + OpenAPI_plmn_id_nid_t *allowed_snpnsItem = OpenAPI_plmn_id_nid_parseFromJSON(allowed_snpns_local); + if (!allowed_snpnsItem) { + ogs_error("No allowed_snpnsItem"); + OpenAPI_list_free(allowed_snpnsList); + goto end; + } + OpenAPI_list_add(allowed_snpnsList, allowed_snpnsItem); } - - OpenAPI_list_add(allowed_snpnsList, allowed_snpnsItem); - } } - cJSON *allowed_nf_types = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedNfTypes"); - - OpenAPI_list_t *allowed_nf_typesList; + allowed_nf_types = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedNfTypes"); if (allowed_nf_types) { - cJSON *allowed_nf_types_local_nonprimitive; - if (!cJSON_IsArray(allowed_nf_types)) { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nf_types]"); - goto end; - } - - allowed_nf_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_nf_types_local_nonprimitive, allowed_nf_types ) { - if (!cJSON_IsString(allowed_nf_types_local_nonprimitive)){ + cJSON *allowed_nf_types_local = NULL; + if (!cJSON_IsArray(allowed_nf_types)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nf_types]"); goto end; } - OpenAPI_list_add(allowed_nf_typesList, (void *)OpenAPI_nf_type_FromString(allowed_nf_types_local_nonprimitive->valuestring)); - } + allowed_nf_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_nf_types_local, allowed_nf_types) { + if (!cJSON_IsString(allowed_nf_types_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nf_types]"); + goto end; + } + OpenAPI_list_add(allowed_nf_typesList, (void *)OpenAPI_nf_type_FromString(allowed_nf_types_local->valuestring)); + } } - cJSON *allowed_nf_domains = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedNfDomains"); - - OpenAPI_list_t *allowed_nf_domainsList; + allowed_nf_domains = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedNfDomains"); if (allowed_nf_domains) { - cJSON *allowed_nf_domains_local; - if (!cJSON_IsArray(allowed_nf_domains)) { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nf_domains]"); - goto end; - } - allowed_nf_domainsList = OpenAPI_list_create(); + cJSON *allowed_nf_domains_local = NULL; + if (!cJSON_IsArray(allowed_nf_domains)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nf_domains]"); + goto end; + } - cJSON_ArrayForEach(allowed_nf_domains_local, allowed_nf_domains) { - if (!cJSON_IsString(allowed_nf_domains_local)) { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nf_domains]"); - goto end; - } - OpenAPI_list_add(allowed_nf_domainsList, ogs_strdup(allowed_nf_domains_local->valuestring)); - } + allowed_nf_domainsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_nf_domains_local, allowed_nf_domains) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(allowed_nf_domains_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nf_domains]"); + goto end; + } + OpenAPI_list_add(allowed_nf_domainsList, ogs_strdup(allowed_nf_domains_local->valuestring)); + } } - cJSON *allowed_nssais = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedNssais"); - - OpenAPI_list_t *allowed_nssaisList; + allowed_nssais = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedNssais"); if (allowed_nssais) { - cJSON *allowed_nssais_local_nonprimitive; - if (!cJSON_IsArray(allowed_nssais)){ - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nssais]"); - goto end; - } - - allowed_nssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_nssais_local_nonprimitive, allowed_nssais ) { - if (!cJSON_IsObject(allowed_nssais_local_nonprimitive)) { + cJSON *allowed_nssais_local = NULL; + if (!cJSON_IsArray(allowed_nssais)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nssais]"); goto end; } - OpenAPI_ext_snssai_t *allowed_nssaisItem = OpenAPI_ext_snssai_parseFromJSON(allowed_nssais_local_nonprimitive); - if (!allowed_nssaisItem) { - ogs_error("No allowed_nssaisItem"); - OpenAPI_list_free(allowed_nssaisList); + allowed_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_nssais_local, allowed_nssais) { + if (!cJSON_IsObject(allowed_nssais_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_nssais]"); + goto end; + } + OpenAPI_ext_snssai_t *allowed_nssaisItem = OpenAPI_ext_snssai_parseFromJSON(allowed_nssais_local); + if (!allowed_nssaisItem) { + ogs_error("No allowed_nssaisItem"); + OpenAPI_list_free(allowed_nssaisList); + goto end; + } + OpenAPI_list_add(allowed_nssaisList, allowed_nssaisItem); + } + } + + allowed_operations_per_nf_type = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedOperationsPerNfType"); + if (allowed_operations_per_nf_type) { + cJSON *allowed_operations_per_nf_type_local_map = NULL; + if (!cJSON_IsObject(allowed_operations_per_nf_type) && !cJSON_IsNull(allowed_operations_per_nf_type)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_operations_per_nf_type]"); goto end; } - - OpenAPI_list_add(allowed_nssaisList, allowed_nssaisItem); - } + if (cJSON_IsObject(allowed_operations_per_nf_type)) { + allowed_operations_per_nf_typeList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(allowed_operations_per_nf_type_local_map, allowed_operations_per_nf_type) { + cJSON *localMapObject = allowed_operations_per_nf_type_local_map; + double *localDouble = NULL; + int *localInt = NULL; + OpenAPI_list_add(allowed_operations_per_nf_typeList, localMapKeyPair); + } + } } - cJSON *allowed_operations_per_nf_type = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedOperationsPerNfType"); - - OpenAPI_list_t *allowed_operations_per_nf_typeList; - if (allowed_operations_per_nf_type) { - cJSON *allowed_operations_per_nf_type_local_map; - if (!cJSON_IsObject(allowed_operations_per_nf_type)) { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_operations_per_nf_type]"); - goto end; - } - allowed_operations_per_nf_typeList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(allowed_operations_per_nf_type_local_map, allowed_operations_per_nf_type) { - cJSON *localMapObject = allowed_operations_per_nf_type_local_map; - OpenAPI_list_add(allowed_operations_per_nf_typeList, localMapKeyPair); - } - } - - cJSON *allowed_operations_per_nf_instance = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedOperationsPerNfInstance"); - - OpenAPI_list_t *allowed_operations_per_nf_instanceList; + allowed_operations_per_nf_instance = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "allowedOperationsPerNfInstance"); if (allowed_operations_per_nf_instance) { - cJSON *allowed_operations_per_nf_instance_local_map; - if (!cJSON_IsObject(allowed_operations_per_nf_instance)) { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_operations_per_nf_instance]"); - goto end; - } - allowed_operations_per_nf_instanceList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(allowed_operations_per_nf_instance_local_map, allowed_operations_per_nf_instance) { - cJSON *localMapObject = allowed_operations_per_nf_instance_local_map; - OpenAPI_list_add(allowed_operations_per_nf_instanceList, localMapKeyPair); - } + cJSON *allowed_operations_per_nf_instance_local_map = NULL; + if (!cJSON_IsObject(allowed_operations_per_nf_instance) && !cJSON_IsNull(allowed_operations_per_nf_instance)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [allowed_operations_per_nf_instance]"); + goto end; + } + if (cJSON_IsObject(allowed_operations_per_nf_instance)) { + allowed_operations_per_nf_instanceList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(allowed_operations_per_nf_instance_local_map, allowed_operations_per_nf_instance) { + cJSON *localMapObject = allowed_operations_per_nf_instance_local_map; + double *localDouble = NULL; + int *localInt = NULL; + OpenAPI_list_add(allowed_operations_per_nf_instanceList, localMapKeyPair); + } + } } - cJSON *priority = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "priority"); - + priority = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "priority"); if (priority) { if (!cJSON_IsNumber(priority)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [priority]"); @@ -868,8 +933,7 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) } } - cJSON *capacity = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "capacity"); - + capacity = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "capacity"); if (capacity) { if (!cJSON_IsNumber(capacity)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [capacity]"); @@ -877,8 +941,7 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) } } - cJSON *load = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "load"); - + load = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "load"); if (load) { if (!cJSON_IsNumber(load)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [load]"); @@ -886,148 +949,138 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) } } - cJSON *load_time_stamp = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "loadTimeStamp"); - + load_time_stamp = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "loadTimeStamp"); if (load_time_stamp) { - if (!cJSON_IsString(load_time_stamp)) { + if (!cJSON_IsString(load_time_stamp) && !cJSON_IsNull(load_time_stamp)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [load_time_stamp]"); goto end; } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *nf_service_set_id_list = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "nfServiceSetIdList"); - - OpenAPI_list_t *nf_service_set_id_listList; + nf_service_set_id_list = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "nfServiceSetIdList"); if (nf_service_set_id_list) { - cJSON *nf_service_set_id_list_local; - if (!cJSON_IsArray(nf_service_set_id_list)) { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [nf_service_set_id_list]"); - goto end; - } - nf_service_set_id_listList = OpenAPI_list_create(); + cJSON *nf_service_set_id_list_local = NULL; + if (!cJSON_IsArray(nf_service_set_id_list)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [nf_service_set_id_list]"); + goto end; + } - cJSON_ArrayForEach(nf_service_set_id_list_local, nf_service_set_id_list) { - if (!cJSON_IsString(nf_service_set_id_list_local)) { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [nf_service_set_id_list]"); - goto end; - } - OpenAPI_list_add(nf_service_set_id_listList, ogs_strdup(nf_service_set_id_list_local->valuestring)); - } + nf_service_set_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nf_service_set_id_list_local, nf_service_set_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(nf_service_set_id_list_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [nf_service_set_id_list]"); + goto end; + } + OpenAPI_list_add(nf_service_set_id_listList, ogs_strdup(nf_service_set_id_list_local->valuestring)); + } } - cJSON *s_nssais = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "sNssais"); - - OpenAPI_list_t *s_nssaisList; + s_nssais = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "sNssais"); if (s_nssais) { - cJSON *s_nssais_local_nonprimitive; - if (!cJSON_IsArray(s_nssais)){ - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [s_nssais]"); - goto end; - } - - s_nssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(s_nssais_local_nonprimitive, s_nssais ) { - if (!cJSON_IsObject(s_nssais_local_nonprimitive)) { + cJSON *s_nssais_local = NULL; + if (!cJSON_IsArray(s_nssais)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [s_nssais]"); goto end; } - OpenAPI_ext_snssai_t *s_nssaisItem = OpenAPI_ext_snssai_parseFromJSON(s_nssais_local_nonprimitive); - if (!s_nssaisItem) { - ogs_error("No s_nssaisItem"); - OpenAPI_list_free(s_nssaisList); - goto end; + s_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(s_nssais_local, s_nssais) { + if (!cJSON_IsObject(s_nssais_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [s_nssais]"); + goto end; + } + OpenAPI_ext_snssai_t *s_nssaisItem = OpenAPI_ext_snssai_parseFromJSON(s_nssais_local); + if (!s_nssaisItem) { + ogs_error("No s_nssaisItem"); + OpenAPI_list_free(s_nssaisList); + goto end; + } + OpenAPI_list_add(s_nssaisList, s_nssaisItem); } - - OpenAPI_list_add(s_nssaisList, s_nssaisItem); - } } - cJSON *per_plmn_snssai_list = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "perPlmnSnssaiList"); - - OpenAPI_list_t *per_plmn_snssai_listList; + per_plmn_snssai_list = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "perPlmnSnssaiList"); if (per_plmn_snssai_list) { - cJSON *per_plmn_snssai_list_local_nonprimitive; - if (!cJSON_IsArray(per_plmn_snssai_list)){ - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [per_plmn_snssai_list]"); - goto end; - } - - per_plmn_snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(per_plmn_snssai_list_local_nonprimitive, per_plmn_snssai_list ) { - if (!cJSON_IsObject(per_plmn_snssai_list_local_nonprimitive)) { + cJSON *per_plmn_snssai_list_local = NULL; + if (!cJSON_IsArray(per_plmn_snssai_list)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [per_plmn_snssai_list]"); goto end; } - OpenAPI_plmn_snssai_t *per_plmn_snssai_listItem = OpenAPI_plmn_snssai_parseFromJSON(per_plmn_snssai_list_local_nonprimitive); - if (!per_plmn_snssai_listItem) { - ogs_error("No per_plmn_snssai_listItem"); - OpenAPI_list_free(per_plmn_snssai_listList); - goto end; + per_plmn_snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(per_plmn_snssai_list_local, per_plmn_snssai_list) { + if (!cJSON_IsObject(per_plmn_snssai_list_local)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [per_plmn_snssai_list]"); + goto end; + } + OpenAPI_plmn_snssai_t *per_plmn_snssai_listItem = OpenAPI_plmn_snssai_parseFromJSON(per_plmn_snssai_list_local); + if (!per_plmn_snssai_listItem) { + ogs_error("No per_plmn_snssai_listItem"); + OpenAPI_list_free(per_plmn_snssai_listList); + goto end; + } + OpenAPI_list_add(per_plmn_snssai_listList, per_plmn_snssai_listItem); } - - OpenAPI_list_add(per_plmn_snssai_listList, per_plmn_snssai_listItem); - } } - cJSON *vendor_id = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "vendorId"); - + vendor_id = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "vendorId"); if (vendor_id) { - if (!cJSON_IsString(vendor_id)) { + if (!cJSON_IsString(vendor_id) && !cJSON_IsNull(vendor_id)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [vendor_id]"); goto end; } } - cJSON *supported_vendor_specific_features = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "supportedVendorSpecificFeatures"); - - OpenAPI_list_t *supported_vendor_specific_featuresList; + supported_vendor_specific_features = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "supportedVendorSpecificFeatures"); if (supported_vendor_specific_features) { - cJSON *supported_vendor_specific_features_local_map; - if (!cJSON_IsObject(supported_vendor_specific_features)) { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [supported_vendor_specific_features]"); - goto end; - } - supported_vendor_specific_featuresList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(supported_vendor_specific_features_local_map, supported_vendor_specific_features) { - cJSON *localMapObject = supported_vendor_specific_features_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_vendor_specific_feature_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nf_service_parseFromJSON() failed [inner]"); + cJSON *supported_vendor_specific_features_local_map = NULL; + if (!cJSON_IsObject(supported_vendor_specific_features) && !cJSON_IsNull(supported_vendor_specific_features)) { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [supported_vendor_specific_features]"); goto end; } - OpenAPI_list_add(supported_vendor_specific_featuresList, localMapKeyPair); - } + if (cJSON_IsObject(supported_vendor_specific_features)) { + supported_vendor_specific_featuresList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(supported_vendor_specific_features_local_map, supported_vendor_specific_features) { + cJSON *localMapObject = supported_vendor_specific_features_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_vendor_specific_feature_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nf_service_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(supported_vendor_specific_featuresList, localMapKeyPair); + } + } } - cJSON *oauth2_required = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "oauth2Required"); - + oauth2_required = cJSON_GetObjectItemCaseSensitive(nf_serviceJSON, "oauth2Required"); if (oauth2_required) { if (!cJSON_IsBool(oauth2_required)) { ogs_error("OpenAPI_nf_service_parseFromJSON() failed [oauth2_required]"); @@ -1041,10 +1094,10 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) versionsList, schemeVariable, nf_service_statusVariable, - fqdn ? ogs_strdup(fqdn->valuestring) : NULL, - inter_plmn_fqdn ? ogs_strdup(inter_plmn_fqdn->valuestring) : NULL, + fqdn && !cJSON_IsNull(fqdn) ? ogs_strdup(fqdn->valuestring) : NULL, + inter_plmn_fqdn && !cJSON_IsNull(inter_plmn_fqdn) ? ogs_strdup(inter_plmn_fqdn->valuestring) : NULL, ip_end_points ? ip_end_pointsList : NULL, - api_prefix ? ogs_strdup(api_prefix->valuestring) : NULL, + api_prefix && !cJSON_IsNull(api_prefix) ? ogs_strdup(api_prefix->valuestring) : NULL, default_notification_subscriptions ? default_notification_subscriptionsList : NULL, allowed_plmns ? allowed_plmnsList : NULL, allowed_snpns ? allowed_snpnsList : NULL, @@ -1059,13 +1112,13 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) capacity ? capacity->valuedouble : 0, load ? true : false, load ? load->valuedouble : 0, - load_time_stamp ? ogs_strdup(load_time_stamp->valuestring) : NULL, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + load_time_stamp && !cJSON_IsNull(load_time_stamp) ? ogs_strdup(load_time_stamp->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, nf_service_set_id_list ? nf_service_set_id_listList : NULL, s_nssais ? s_nssaisList : NULL, per_plmn_snssai_list ? per_plmn_snssai_listList : NULL, - vendor_id ? ogs_strdup(vendor_id->valuestring) : NULL, + vendor_id && !cJSON_IsNull(vendor_id) ? ogs_strdup(vendor_id->valuestring) : NULL, supported_vendor_specific_features ? supported_vendor_specific_featuresList : NULL, oauth2_required ? true : false, oauth2_required ? oauth2_required->valueint : 0 @@ -1073,6 +1126,110 @@ OpenAPI_nf_service_t *OpenAPI_nf_service_parseFromJSON(cJSON *nf_serviceJSON) return nf_service_local_var; end: + if (versionsList) { + OpenAPI_list_for_each(versionsList, node) { + OpenAPI_nf_service_version_free(node->data); + } + OpenAPI_list_free(versionsList); + versionsList = NULL; + } + if (ip_end_pointsList) { + OpenAPI_list_for_each(ip_end_pointsList, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(ip_end_pointsList); + ip_end_pointsList = NULL; + } + if (default_notification_subscriptionsList) { + OpenAPI_list_for_each(default_notification_subscriptionsList, node) { + OpenAPI_default_notification_subscription_free(node->data); + } + OpenAPI_list_free(default_notification_subscriptionsList); + default_notification_subscriptionsList = NULL; + } + if (allowed_plmnsList) { + OpenAPI_list_for_each(allowed_plmnsList, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(allowed_plmnsList); + allowed_plmnsList = NULL; + } + if (allowed_snpnsList) { + OpenAPI_list_for_each(allowed_snpnsList, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(allowed_snpnsList); + allowed_snpnsList = NULL; + } + if (allowed_nf_typesList) { + OpenAPI_list_free(allowed_nf_typesList); + allowed_nf_typesList = NULL; + } + if (allowed_nf_domainsList) { + OpenAPI_list_for_each(allowed_nf_domainsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(allowed_nf_domainsList); + allowed_nf_domainsList = NULL; + } + if (allowed_nssaisList) { + OpenAPI_list_for_each(allowed_nssaisList, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(allowed_nssaisList); + allowed_nssaisList = NULL; + } + if (allowed_operations_per_nf_typeList) { + OpenAPI_list_for_each(allowed_operations_per_nf_typeList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(allowed_operations_per_nf_typeList); + allowed_operations_per_nf_typeList = NULL; + } + if (allowed_operations_per_nf_instanceList) { + OpenAPI_list_for_each(allowed_operations_per_nf_instanceList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(allowed_operations_per_nf_instanceList); + allowed_operations_per_nf_instanceList = NULL; + } + if (nf_service_set_id_listList) { + OpenAPI_list_for_each(nf_service_set_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nf_service_set_id_listList); + nf_service_set_id_listList = NULL; + } + if (s_nssaisList) { + OpenAPI_list_for_each(s_nssaisList, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(s_nssaisList); + s_nssaisList = NULL; + } + if (per_plmn_snssai_listList) { + OpenAPI_list_for_each(per_plmn_snssai_listList, node) { + OpenAPI_plmn_snssai_free(node->data); + } + OpenAPI_list_free(per_plmn_snssai_listList); + per_plmn_snssai_listList = NULL; + } + if (supported_vendor_specific_featuresList) { + OpenAPI_list_for_each(supported_vendor_specific_featuresList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(supported_vendor_specific_featuresList); + supported_vendor_specific_featuresList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nf_service_set_cond.c b/lib/sbi/openapi/model/nf_service_set_cond.c index ff24bf7b3..da223db9b 100644 --- a/lib/sbi/openapi/model/nf_service_set_cond.c +++ b/lib/sbi/openapi/model/nf_service_set_cond.c @@ -18,17 +18,22 @@ OpenAPI_nf_service_set_cond_t *OpenAPI_nf_service_set_cond_create( void OpenAPI_nf_service_set_cond_free(OpenAPI_nf_service_set_cond_t *nf_service_set_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_service_set_cond) { return; } - OpenAPI_lnode_t *node; - ogs_free(nf_service_set_cond->nf_service_set_id); + if (nf_service_set_cond->nf_service_set_id) { + ogs_free(nf_service_set_cond->nf_service_set_id); + nf_service_set_cond->nf_service_set_id = NULL; + } ogs_free(nf_service_set_cond); } cJSON *OpenAPI_nf_service_set_cond_convertToJSON(OpenAPI_nf_service_set_cond_t *nf_service_set_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_service_set_cond == NULL) { ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [NfServiceSetCond]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_nf_service_set_cond_convertToJSON(OpenAPI_nf_service_set_cond_t * } item = cJSON_CreateObject(); + if (!nf_service_set_cond->nf_service_set_id) { + ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [nf_service_set_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfServiceSetId", nf_service_set_cond->nf_service_set_id) == NULL) { ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [nf_service_set_id]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_nf_service_set_cond_t *OpenAPI_nf_service_set_cond_parseFromJSON(cJSON *nf_service_set_condJSON) { OpenAPI_nf_service_set_cond_t *nf_service_set_cond_local_var = NULL; - cJSON *nf_service_set_id = cJSON_GetObjectItemCaseSensitive(nf_service_set_condJSON, "nfServiceSetId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_service_set_id = NULL; + nf_service_set_id = cJSON_GetObjectItemCaseSensitive(nf_service_set_condJSON, "nfServiceSetId"); if (!nf_service_set_id) { ogs_error("OpenAPI_nf_service_set_cond_parseFromJSON() failed [nf_service_set_id]"); goto end; } - if (!cJSON_IsString(nf_service_set_id)) { ogs_error("OpenAPI_nf_service_set_cond_parseFromJSON() failed [nf_service_set_id]"); goto end; diff --git a/lib/sbi/openapi/model/nf_service_version.c b/lib/sbi/openapi/model/nf_service_version.c index e0e268e24..41d3049c6 100644 --- a/lib/sbi/openapi/model/nf_service_version.c +++ b/lib/sbi/openapi/model/nf_service_version.c @@ -22,19 +22,30 @@ OpenAPI_nf_service_version_t *OpenAPI_nf_service_version_create( void OpenAPI_nf_service_version_free(OpenAPI_nf_service_version_t *nf_service_version) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_service_version) { return; } - OpenAPI_lnode_t *node; - ogs_free(nf_service_version->api_version_in_uri); - ogs_free(nf_service_version->api_full_version); - ogs_free(nf_service_version->expiry); + if (nf_service_version->api_version_in_uri) { + ogs_free(nf_service_version->api_version_in_uri); + nf_service_version->api_version_in_uri = NULL; + } + if (nf_service_version->api_full_version) { + ogs_free(nf_service_version->api_full_version); + nf_service_version->api_full_version = NULL; + } + if (nf_service_version->expiry) { + ogs_free(nf_service_version->expiry); + nf_service_version->expiry = NULL; + } ogs_free(nf_service_version); } cJSON *OpenAPI_nf_service_version_convertToJSON(OpenAPI_nf_service_version_t *nf_service_version) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_service_version == NULL) { ogs_error("OpenAPI_nf_service_version_convertToJSON() failed [NFServiceVersion]"); @@ -42,11 +53,19 @@ cJSON *OpenAPI_nf_service_version_convertToJSON(OpenAPI_nf_service_version_t *nf } item = cJSON_CreateObject(); + if (!nf_service_version->api_version_in_uri) { + ogs_error("OpenAPI_nf_service_version_convertToJSON() failed [api_version_in_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "apiVersionInUri", nf_service_version->api_version_in_uri) == NULL) { ogs_error("OpenAPI_nf_service_version_convertToJSON() failed [api_version_in_uri]"); goto end; } + if (!nf_service_version->api_full_version) { + ogs_error("OpenAPI_nf_service_version_convertToJSON() failed [api_full_version]"); + return NULL; + } if (cJSON_AddStringToObject(item, "apiFullVersion", nf_service_version->api_full_version) == NULL) { ogs_error("OpenAPI_nf_service_version_convertToJSON() failed [api_full_version]"); goto end; @@ -66,32 +85,33 @@ end: OpenAPI_nf_service_version_t *OpenAPI_nf_service_version_parseFromJSON(cJSON *nf_service_versionJSON) { OpenAPI_nf_service_version_t *nf_service_version_local_var = NULL; - cJSON *api_version_in_uri = cJSON_GetObjectItemCaseSensitive(nf_service_versionJSON, "apiVersionInUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *api_version_in_uri = NULL; + cJSON *api_full_version = NULL; + cJSON *expiry = NULL; + api_version_in_uri = cJSON_GetObjectItemCaseSensitive(nf_service_versionJSON, "apiVersionInUri"); if (!api_version_in_uri) { ogs_error("OpenAPI_nf_service_version_parseFromJSON() failed [api_version_in_uri]"); goto end; } - if (!cJSON_IsString(api_version_in_uri)) { ogs_error("OpenAPI_nf_service_version_parseFromJSON() failed [api_version_in_uri]"); goto end; } - cJSON *api_full_version = cJSON_GetObjectItemCaseSensitive(nf_service_versionJSON, "apiFullVersion"); + api_full_version = cJSON_GetObjectItemCaseSensitive(nf_service_versionJSON, "apiFullVersion"); if (!api_full_version) { ogs_error("OpenAPI_nf_service_version_parseFromJSON() failed [api_full_version]"); goto end; } - if (!cJSON_IsString(api_full_version)) { ogs_error("OpenAPI_nf_service_version_parseFromJSON() failed [api_full_version]"); goto end; } - cJSON *expiry = cJSON_GetObjectItemCaseSensitive(nf_service_versionJSON, "expiry"); - + expiry = cJSON_GetObjectItemCaseSensitive(nf_service_versionJSON, "expiry"); if (expiry) { - if (!cJSON_IsString(expiry)) { + if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) { ogs_error("OpenAPI_nf_service_version_parseFromJSON() failed [expiry]"); goto end; } @@ -100,7 +120,7 @@ OpenAPI_nf_service_version_t *OpenAPI_nf_service_version_parseFromJSON(cJSON *nf nf_service_version_local_var = OpenAPI_nf_service_version_create ( ogs_strdup(api_version_in_uri->valuestring), ogs_strdup(api_full_version->valuestring), - expiry ? ogs_strdup(expiry->valuestring) : NULL + expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL ); return nf_service_version_local_var; diff --git a/lib/sbi/openapi/model/nf_set_cond.c b/lib/sbi/openapi/model/nf_set_cond.c index e38735d9c..67545539b 100644 --- a/lib/sbi/openapi/model/nf_set_cond.c +++ b/lib/sbi/openapi/model/nf_set_cond.c @@ -18,17 +18,22 @@ OpenAPI_nf_set_cond_t *OpenAPI_nf_set_cond_create( void OpenAPI_nf_set_cond_free(OpenAPI_nf_set_cond_t *nf_set_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_set_cond) { return; } - OpenAPI_lnode_t *node; - ogs_free(nf_set_cond->nf_set_id); + if (nf_set_cond->nf_set_id) { + ogs_free(nf_set_cond->nf_set_id); + nf_set_cond->nf_set_id = NULL; + } ogs_free(nf_set_cond); } cJSON *OpenAPI_nf_set_cond_convertToJSON(OpenAPI_nf_set_cond_t *nf_set_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_set_cond == NULL) { ogs_error("OpenAPI_nf_set_cond_convertToJSON() failed [NfSetCond]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_nf_set_cond_convertToJSON(OpenAPI_nf_set_cond_t *nf_set_cond) } item = cJSON_CreateObject(); + if (!nf_set_cond->nf_set_id) { + ogs_error("OpenAPI_nf_set_cond_convertToJSON() failed [nf_set_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfSetId", nf_set_cond->nf_set_id) == NULL) { ogs_error("OpenAPI_nf_set_cond_convertToJSON() failed [nf_set_id]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_nf_set_cond_t *OpenAPI_nf_set_cond_parseFromJSON(cJSON *nf_set_condJSON) { OpenAPI_nf_set_cond_t *nf_set_cond_local_var = NULL; - cJSON *nf_set_id = cJSON_GetObjectItemCaseSensitive(nf_set_condJSON, "nfSetId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_set_id = NULL; + nf_set_id = cJSON_GetObjectItemCaseSensitive(nf_set_condJSON, "nfSetId"); if (!nf_set_id) { ogs_error("OpenAPI_nf_set_cond_parseFromJSON() failed [nf_set_id]"); goto end; } - if (!cJSON_IsString(nf_set_id)) { ogs_error("OpenAPI_nf_set_cond_parseFromJSON() failed [nf_set_id]"); goto end; diff --git a/lib/sbi/openapi/model/nf_type_cond.c b/lib/sbi/openapi/model/nf_type_cond.c index 6550c5a28..2cefbf696 100644 --- a/lib/sbi/openapi/model/nf_type_cond.c +++ b/lib/sbi/openapi/model/nf_type_cond.c @@ -18,16 +18,18 @@ OpenAPI_nf_type_cond_t *OpenAPI_nf_type_cond_create( void OpenAPI_nf_type_cond_free(OpenAPI_nf_type_cond_t *nf_type_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nf_type_cond) { return; } - OpenAPI_lnode_t *node; ogs_free(nf_type_cond); } cJSON *OpenAPI_nf_type_cond_convertToJSON(OpenAPI_nf_type_cond_t *nf_type_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nf_type_cond == NULL) { ogs_error("OpenAPI_nf_type_cond_convertToJSON() failed [NfTypeCond]"); @@ -35,6 +37,10 @@ cJSON *OpenAPI_nf_type_cond_convertToJSON(OpenAPI_nf_type_cond_t *nf_type_cond) } item = cJSON_CreateObject(); + if (nf_type_cond->nf_type == OpenAPI_nf_type_NULL) { + ogs_error("OpenAPI_nf_type_cond_convertToJSON() failed [nf_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfType", OpenAPI_nf_type_ToString(nf_type_cond->nf_type)) == NULL) { ogs_error("OpenAPI_nf_type_cond_convertToJSON() failed [nf_type]"); goto end; @@ -47,13 +53,14 @@ end: OpenAPI_nf_type_cond_t *OpenAPI_nf_type_cond_parseFromJSON(cJSON *nf_type_condJSON) { OpenAPI_nf_type_cond_t *nf_type_cond_local_var = NULL; - cJSON *nf_type = cJSON_GetObjectItemCaseSensitive(nf_type_condJSON, "nfType"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_type = NULL; + OpenAPI_nf_type_e nf_typeVariable = 0; + nf_type = cJSON_GetObjectItemCaseSensitive(nf_type_condJSON, "nfType"); if (!nf_type) { ogs_error("OpenAPI_nf_type_cond_parseFromJSON() failed [nf_type]"); goto end; } - - OpenAPI_nf_type_e nf_typeVariable; if (!cJSON_IsString(nf_type)) { ogs_error("OpenAPI_nf_type_cond_parseFromJSON() failed [nf_type]"); goto end; diff --git a/lib/sbi/openapi/model/ng_ap_cause.c b/lib/sbi/openapi/model/ng_ap_cause.c index 898a3d908..6e6fd6239 100644 --- a/lib/sbi/openapi/model/ng_ap_cause.c +++ b/lib/sbi/openapi/model/ng_ap_cause.c @@ -20,16 +20,18 @@ OpenAPI_ng_ap_cause_t *OpenAPI_ng_ap_cause_create( void OpenAPI_ng_ap_cause_free(OpenAPI_ng_ap_cause_t *ng_ap_cause) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ng_ap_cause) { return; } - OpenAPI_lnode_t *node; ogs_free(ng_ap_cause); } cJSON *OpenAPI_ng_ap_cause_convertToJSON(OpenAPI_ng_ap_cause_t *ng_ap_cause) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ng_ap_cause == NULL) { ogs_error("OpenAPI_ng_ap_cause_convertToJSON() failed [NgApCause]"); @@ -54,23 +56,24 @@ end: OpenAPI_ng_ap_cause_t *OpenAPI_ng_ap_cause_parseFromJSON(cJSON *ng_ap_causeJSON) { OpenAPI_ng_ap_cause_t *ng_ap_cause_local_var = NULL; - cJSON *group = cJSON_GetObjectItemCaseSensitive(ng_ap_causeJSON, "group"); + OpenAPI_lnode_t *node = NULL; + cJSON *group = NULL; + cJSON *value = NULL; + group = cJSON_GetObjectItemCaseSensitive(ng_ap_causeJSON, "group"); if (!group) { ogs_error("OpenAPI_ng_ap_cause_parseFromJSON() failed [group]"); goto end; } - if (!cJSON_IsNumber(group)) { ogs_error("OpenAPI_ng_ap_cause_parseFromJSON() failed [group]"); goto end; } - cJSON *value = cJSON_GetObjectItemCaseSensitive(ng_ap_causeJSON, "value"); + value = cJSON_GetObjectItemCaseSensitive(ng_ap_causeJSON, "value"); if (!value) { ogs_error("OpenAPI_ng_ap_cause_parseFromJSON() failed [value]"); goto end; } - if (!cJSON_IsNumber(value)) { ogs_error("OpenAPI_ng_ap_cause_parseFromJSON() failed [value]"); goto end; diff --git a/lib/sbi/openapi/model/ng_ksi.c b/lib/sbi/openapi/model/ng_ksi.c index c6449bf58..4a4076ad4 100644 --- a/lib/sbi/openapi/model/ng_ksi.c +++ b/lib/sbi/openapi/model/ng_ksi.c @@ -20,16 +20,18 @@ OpenAPI_ng_ksi_t *OpenAPI_ng_ksi_create( void OpenAPI_ng_ksi_free(OpenAPI_ng_ksi_t *ng_ksi) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ng_ksi) { return; } - OpenAPI_lnode_t *node; ogs_free(ng_ksi); } cJSON *OpenAPI_ng_ksi_convertToJSON(OpenAPI_ng_ksi_t *ng_ksi) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ng_ksi == NULL) { ogs_error("OpenAPI_ng_ksi_convertToJSON() failed [NgKsi]"); @@ -37,6 +39,10 @@ cJSON *OpenAPI_ng_ksi_convertToJSON(OpenAPI_ng_ksi_t *ng_ksi) } item = cJSON_CreateObject(); + if (ng_ksi->tsc == OpenAPI_sc_type_NULL) { + ogs_error("OpenAPI_ng_ksi_convertToJSON() failed [tsc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "tsc", OpenAPI_sc_type_ToString(ng_ksi->tsc)) == NULL) { ogs_error("OpenAPI_ng_ksi_convertToJSON() failed [tsc]"); goto end; @@ -54,25 +60,26 @@ end: OpenAPI_ng_ksi_t *OpenAPI_ng_ksi_parseFromJSON(cJSON *ng_ksiJSON) { OpenAPI_ng_ksi_t *ng_ksi_local_var = NULL; - cJSON *tsc = cJSON_GetObjectItemCaseSensitive(ng_ksiJSON, "tsc"); + OpenAPI_lnode_t *node = NULL; + cJSON *tsc = NULL; + OpenAPI_sc_type_e tscVariable = 0; + cJSON *ksi = NULL; + tsc = cJSON_GetObjectItemCaseSensitive(ng_ksiJSON, "tsc"); if (!tsc) { ogs_error("OpenAPI_ng_ksi_parseFromJSON() failed [tsc]"); goto end; } - - OpenAPI_sc_type_e tscVariable; if (!cJSON_IsString(tsc)) { ogs_error("OpenAPI_ng_ksi_parseFromJSON() failed [tsc]"); goto end; } tscVariable = OpenAPI_sc_type_FromString(tsc->valuestring); - cJSON *ksi = cJSON_GetObjectItemCaseSensitive(ng_ksiJSON, "ksi"); + ksi = cJSON_GetObjectItemCaseSensitive(ng_ksiJSON, "ksi"); if (!ksi) { ogs_error("OpenAPI_ng_ksi_parseFromJSON() failed [ksi]"); goto end; } - if (!cJSON_IsNumber(ksi)) { ogs_error("OpenAPI_ng_ksi_parseFromJSON() failed [ksi]"); goto end; diff --git a/lib/sbi/openapi/model/ng_ran_target_id.c b/lib/sbi/openapi/model/ng_ran_target_id.c index 4ad11eeb5..2c2b0627c 100644 --- a/lib/sbi/openapi/model/ng_ran_target_id.c +++ b/lib/sbi/openapi/model/ng_ran_target_id.c @@ -20,18 +20,26 @@ OpenAPI_ng_ran_target_id_t *OpenAPI_ng_ran_target_id_create( void OpenAPI_ng_ran_target_id_free(OpenAPI_ng_ran_target_id_t *ng_ran_target_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ng_ran_target_id) { return; } - OpenAPI_lnode_t *node; - OpenAPI_global_ran_node_id_free(ng_ran_target_id->ran_node_id); - OpenAPI_tai_free(ng_ran_target_id->tai); + if (ng_ran_target_id->ran_node_id) { + OpenAPI_global_ran_node_id_free(ng_ran_target_id->ran_node_id); + ng_ran_target_id->ran_node_id = NULL; + } + if (ng_ran_target_id->tai) { + OpenAPI_tai_free(ng_ran_target_id->tai); + ng_ran_target_id->tai = NULL; + } ogs_free(ng_ran_target_id); } cJSON *OpenAPI_ng_ran_target_id_convertToJSON(OpenAPI_ng_ran_target_id_t *ng_ran_target_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ng_ran_target_id == NULL) { ogs_error("OpenAPI_ng_ran_target_id_convertToJSON() failed [NgRanTargetId]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_ng_ran_target_id_convertToJSON(OpenAPI_ng_ran_target_id_t *ng_ran } item = cJSON_CreateObject(); + if (!ng_ran_target_id->ran_node_id) { + ogs_error("OpenAPI_ng_ran_target_id_convertToJSON() failed [ran_node_id]"); + return NULL; + } cJSON *ran_node_id_local_JSON = OpenAPI_global_ran_node_id_convertToJSON(ng_ran_target_id->ran_node_id); if (ran_node_id_local_JSON == NULL) { ogs_error("OpenAPI_ng_ran_target_id_convertToJSON() failed [ran_node_id]"); @@ -50,6 +62,10 @@ cJSON *OpenAPI_ng_ran_target_id_convertToJSON(OpenAPI_ng_ran_target_id_t *ng_ran goto end; } + if (!ng_ran_target_id->tai) { + ogs_error("OpenAPI_ng_ran_target_id_convertToJSON() failed [tai]"); + return NULL; + } cJSON *tai_local_JSON = OpenAPI_tai_convertToJSON(ng_ran_target_id->tai); if (tai_local_JSON == NULL) { ogs_error("OpenAPI_ng_ran_target_id_convertToJSON() failed [tai]"); @@ -68,22 +84,23 @@ end: OpenAPI_ng_ran_target_id_t *OpenAPI_ng_ran_target_id_parseFromJSON(cJSON *ng_ran_target_idJSON) { OpenAPI_ng_ran_target_id_t *ng_ran_target_id_local_var = NULL; - cJSON *ran_node_id = cJSON_GetObjectItemCaseSensitive(ng_ran_target_idJSON, "ranNodeId"); + OpenAPI_lnode_t *node = NULL; + cJSON *ran_node_id = NULL; + OpenAPI_global_ran_node_id_t *ran_node_id_local_nonprim = NULL; + cJSON *tai = NULL; + OpenAPI_tai_t *tai_local_nonprim = NULL; + ran_node_id = cJSON_GetObjectItemCaseSensitive(ng_ran_target_idJSON, "ranNodeId"); if (!ran_node_id) { ogs_error("OpenAPI_ng_ran_target_id_parseFromJSON() failed [ran_node_id]"); goto end; } - - OpenAPI_global_ran_node_id_t *ran_node_id_local_nonprim = NULL; ran_node_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(ran_node_id); - cJSON *tai = cJSON_GetObjectItemCaseSensitive(ng_ran_target_idJSON, "tai"); + tai = cJSON_GetObjectItemCaseSensitive(ng_ran_target_idJSON, "tai"); if (!tai) { ogs_error("OpenAPI_ng_ran_target_id_parseFromJSON() failed [tai]"); goto end; } - - OpenAPI_tai_t *tai_local_nonprim = NULL; tai_local_nonprim = OpenAPI_tai_parseFromJSON(tai); ng_ran_target_id_local_var = OpenAPI_ng_ran_target_id_create ( @@ -93,6 +110,14 @@ OpenAPI_ng_ran_target_id_t *OpenAPI_ng_ran_target_id_parseFromJSON(cJSON *ng_ran return ng_ran_target_id_local_var; end: + if (ran_node_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(ran_node_id_local_nonprim); + ran_node_id_local_nonprim = NULL; + } + if (tai_local_nonprim) { + OpenAPI_tai_free(tai_local_nonprim); + tai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nidd_information.c b/lib/sbi/openapi/model/nidd_information.c index 94e8b8668..1cd3c23a5 100644 --- a/lib/sbi/openapi/model/nidd_information.c +++ b/lib/sbi/openapi/model/nidd_information.c @@ -22,19 +22,30 @@ OpenAPI_nidd_information_t *OpenAPI_nidd_information_create( void OpenAPI_nidd_information_free(OpenAPI_nidd_information_t *nidd_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nidd_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(nidd_information->af_id); - ogs_free(nidd_information->gpsi); - ogs_free(nidd_information->ext_group_id); + if (nidd_information->af_id) { + ogs_free(nidd_information->af_id); + nidd_information->af_id = NULL; + } + if (nidd_information->gpsi) { + ogs_free(nidd_information->gpsi); + nidd_information->gpsi = NULL; + } + if (nidd_information->ext_group_id) { + ogs_free(nidd_information->ext_group_id); + nidd_information->ext_group_id = NULL; + } ogs_free(nidd_information); } cJSON *OpenAPI_nidd_information_convertToJSON(OpenAPI_nidd_information_t *nidd_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nidd_information == NULL) { ogs_error("OpenAPI_nidd_information_convertToJSON() failed [NiddInformation]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_nidd_information_convertToJSON(OpenAPI_nidd_information_t *nidd_i } item = cJSON_CreateObject(); + if (!nidd_information->af_id) { + ogs_error("OpenAPI_nidd_information_convertToJSON() failed [af_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afId", nidd_information->af_id) == NULL) { ogs_error("OpenAPI_nidd_information_convertToJSON() failed [af_id]"); goto end; @@ -68,30 +83,31 @@ end: OpenAPI_nidd_information_t *OpenAPI_nidd_information_parseFromJSON(cJSON *nidd_informationJSON) { OpenAPI_nidd_information_t *nidd_information_local_var = NULL; - cJSON *af_id = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "afId"); + OpenAPI_lnode_t *node = NULL; + cJSON *af_id = NULL; + cJSON *gpsi = NULL; + cJSON *ext_group_id = NULL; + af_id = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "afId"); if (!af_id) { ogs_error("OpenAPI_nidd_information_parseFromJSON() failed [af_id]"); goto end; } - if (!cJSON_IsString(af_id)) { ogs_error("OpenAPI_nidd_information_parseFromJSON() failed [af_id]"); goto end; } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_nidd_information_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *ext_group_id = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "extGroupId"); - + ext_group_id = cJSON_GetObjectItemCaseSensitive(nidd_informationJSON, "extGroupId"); if (ext_group_id) { - if (!cJSON_IsString(ext_group_id)) { + if (!cJSON_IsString(ext_group_id) && !cJSON_IsNull(ext_group_id)) { ogs_error("OpenAPI_nidd_information_parseFromJSON() failed [ext_group_id]"); goto end; } @@ -99,8 +115,8 @@ OpenAPI_nidd_information_t *OpenAPI_nidd_information_parseFromJSON(cJSON *nidd_i nidd_information_local_var = OpenAPI_nidd_information_create ( ogs_strdup(af_id->valuestring), - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - ext_group_id ? ogs_strdup(ext_group_id->valuestring) : NULL + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + ext_group_id && !cJSON_IsNull(ext_group_id) ? ogs_strdup(ext_group_id->valuestring) : NULL ); return nidd_information_local_var; diff --git a/lib/sbi/openapi/model/nidd_information_1.c b/lib/sbi/openapi/model/nidd_information_1.c index bedb81574..bb4fde30b 100644 --- a/lib/sbi/openapi/model/nidd_information_1.c +++ b/lib/sbi/openapi/model/nidd_information_1.c @@ -22,19 +22,30 @@ OpenAPI_nidd_information_1_t *OpenAPI_nidd_information_1_create( void OpenAPI_nidd_information_1_free(OpenAPI_nidd_information_1_t *nidd_information_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nidd_information_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(nidd_information_1->af_id); - ogs_free(nidd_information_1->gpsi); - ogs_free(nidd_information_1->ext_group_id); + if (nidd_information_1->af_id) { + ogs_free(nidd_information_1->af_id); + nidd_information_1->af_id = NULL; + } + if (nidd_information_1->gpsi) { + ogs_free(nidd_information_1->gpsi); + nidd_information_1->gpsi = NULL; + } + if (nidd_information_1->ext_group_id) { + ogs_free(nidd_information_1->ext_group_id); + nidd_information_1->ext_group_id = NULL; + } ogs_free(nidd_information_1); } cJSON *OpenAPI_nidd_information_1_convertToJSON(OpenAPI_nidd_information_1_t *nidd_information_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nidd_information_1 == NULL) { ogs_error("OpenAPI_nidd_information_1_convertToJSON() failed [NiddInformation_1]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_nidd_information_1_convertToJSON(OpenAPI_nidd_information_1_t *ni } item = cJSON_CreateObject(); + if (!nidd_information_1->af_id) { + ogs_error("OpenAPI_nidd_information_1_convertToJSON() failed [af_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afId", nidd_information_1->af_id) == NULL) { ogs_error("OpenAPI_nidd_information_1_convertToJSON() failed [af_id]"); goto end; @@ -68,30 +83,31 @@ end: OpenAPI_nidd_information_1_t *OpenAPI_nidd_information_1_parseFromJSON(cJSON *nidd_information_1JSON) { OpenAPI_nidd_information_1_t *nidd_information_1_local_var = NULL; - cJSON *af_id = cJSON_GetObjectItemCaseSensitive(nidd_information_1JSON, "afId"); + OpenAPI_lnode_t *node = NULL; + cJSON *af_id = NULL; + cJSON *gpsi = NULL; + cJSON *ext_group_id = NULL; + af_id = cJSON_GetObjectItemCaseSensitive(nidd_information_1JSON, "afId"); if (!af_id) { ogs_error("OpenAPI_nidd_information_1_parseFromJSON() failed [af_id]"); goto end; } - if (!cJSON_IsString(af_id)) { ogs_error("OpenAPI_nidd_information_1_parseFromJSON() failed [af_id]"); goto end; } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(nidd_information_1JSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(nidd_information_1JSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_nidd_information_1_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *ext_group_id = cJSON_GetObjectItemCaseSensitive(nidd_information_1JSON, "extGroupId"); - + ext_group_id = cJSON_GetObjectItemCaseSensitive(nidd_information_1JSON, "extGroupId"); if (ext_group_id) { - if (!cJSON_IsString(ext_group_id)) { + if (!cJSON_IsString(ext_group_id) && !cJSON_IsNull(ext_group_id)) { ogs_error("OpenAPI_nidd_information_1_parseFromJSON() failed [ext_group_id]"); goto end; } @@ -99,8 +115,8 @@ OpenAPI_nidd_information_1_t *OpenAPI_nidd_information_1_parseFromJSON(cJSON *ni nidd_information_1_local_var = OpenAPI_nidd_information_1_create ( ogs_strdup(af_id->valuestring), - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - ext_group_id ? ogs_strdup(ext_group_id->valuestring) : NULL + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + ext_group_id && !cJSON_IsNull(ext_group_id) ? ogs_strdup(ext_group_id->valuestring) : NULL ); return nidd_information_1_local_var; diff --git a/lib/sbi/openapi/model/non_dynamic5_qi.c b/lib/sbi/openapi/model/non_dynamic5_qi.c index b4473c629..6799efa5d 100644 --- a/lib/sbi/openapi/model/non_dynamic5_qi.c +++ b/lib/sbi/openapi/model/non_dynamic5_qi.c @@ -40,16 +40,18 @@ OpenAPI_non_dynamic5_qi_t *OpenAPI_non_dynamic5_qi_create( void OpenAPI_non_dynamic5_qi_free(OpenAPI_non_dynamic5_qi_t *non_dynamic5_qi) { + OpenAPI_lnode_t *node = NULL; + if (NULL == non_dynamic5_qi) { return; } - OpenAPI_lnode_t *node; ogs_free(non_dynamic5_qi); } cJSON *OpenAPI_non_dynamic5_qi_convertToJSON(OpenAPI_non_dynamic5_qi_t *non_dynamic5_qi) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (non_dynamic5_qi == NULL) { ogs_error("OpenAPI_non_dynamic5_qi_convertToJSON() failed [NonDynamic5Qi]"); @@ -106,8 +108,14 @@ end: OpenAPI_non_dynamic5_qi_t *OpenAPI_non_dynamic5_qi_parseFromJSON(cJSON *non_dynamic5_qiJSON) { OpenAPI_non_dynamic5_qi_t *non_dynamic5_qi_local_var = NULL; - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "priorityLevel"); - + OpenAPI_lnode_t *node = NULL; + cJSON *priority_level = NULL; + cJSON *aver_window = NULL; + cJSON *max_data_burst_vol = NULL; + cJSON *ext_max_data_burst_vol = NULL; + cJSON *cn_packet_delay_budget_dl = NULL; + cJSON *cn_packet_delay_budget_ul = NULL; + priority_level = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "priorityLevel"); if (priority_level) { if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_non_dynamic5_qi_parseFromJSON() failed [priority_level]"); @@ -115,8 +123,7 @@ OpenAPI_non_dynamic5_qi_t *OpenAPI_non_dynamic5_qi_parseFromJSON(cJSON *non_dyna } } - cJSON *aver_window = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "averWindow"); - + aver_window = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "averWindow"); if (aver_window) { if (!cJSON_IsNumber(aver_window)) { ogs_error("OpenAPI_non_dynamic5_qi_parseFromJSON() failed [aver_window]"); @@ -124,8 +131,7 @@ OpenAPI_non_dynamic5_qi_t *OpenAPI_non_dynamic5_qi_parseFromJSON(cJSON *non_dyna } } - cJSON *max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "maxDataBurstVol"); - + max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "maxDataBurstVol"); if (max_data_burst_vol) { if (!cJSON_IsNumber(max_data_burst_vol)) { ogs_error("OpenAPI_non_dynamic5_qi_parseFromJSON() failed [max_data_burst_vol]"); @@ -133,8 +139,7 @@ OpenAPI_non_dynamic5_qi_t *OpenAPI_non_dynamic5_qi_parseFromJSON(cJSON *non_dyna } } - cJSON *ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "extMaxDataBurstVol"); - + ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "extMaxDataBurstVol"); if (ext_max_data_burst_vol) { if (!cJSON_IsNumber(ext_max_data_burst_vol)) { ogs_error("OpenAPI_non_dynamic5_qi_parseFromJSON() failed [ext_max_data_burst_vol]"); @@ -142,8 +147,7 @@ OpenAPI_non_dynamic5_qi_t *OpenAPI_non_dynamic5_qi_parseFromJSON(cJSON *non_dyna } } - cJSON *cn_packet_delay_budget_dl = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "cnPacketDelayBudgetDl"); - + cn_packet_delay_budget_dl = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "cnPacketDelayBudgetDl"); if (cn_packet_delay_budget_dl) { if (!cJSON_IsNumber(cn_packet_delay_budget_dl)) { ogs_error("OpenAPI_non_dynamic5_qi_parseFromJSON() failed [cn_packet_delay_budget_dl]"); @@ -151,8 +155,7 @@ OpenAPI_non_dynamic5_qi_t *OpenAPI_non_dynamic5_qi_parseFromJSON(cJSON *non_dyna } } - cJSON *cn_packet_delay_budget_ul = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "cnPacketDelayBudgetUl"); - + cn_packet_delay_budget_ul = cJSON_GetObjectItemCaseSensitive(non_dynamic5_qiJSON, "cnPacketDelayBudgetUl"); if (cn_packet_delay_budget_ul) { if (!cJSON_IsNumber(cn_packet_delay_budget_ul)) { ogs_error("OpenAPI_non_dynamic5_qi_parseFromJSON() failed [cn_packet_delay_budget_ul]"); diff --git a/lib/sbi/openapi/model/non_ue_n2_info_notify_request.c b/lib/sbi/openapi/model/non_ue_n2_info_notify_request.c new file mode 100644 index 000000000..d8e908702 --- /dev/null +++ b/lib/sbi/openapi/model/non_ue_n2_info_notify_request.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "non_ue_n2_info_notify_request.h" + +OpenAPI_non_ue_n2_info_notify_request_t *OpenAPI_non_ue_n2_info_notify_request_create( + OpenAPI_n2_information_notification_t *json_data, + OpenAPI_binary_t* binary_data_n2_information +) +{ + OpenAPI_non_ue_n2_info_notify_request_t *non_ue_n2_info_notify_request_local_var = ogs_malloc(sizeof(OpenAPI_non_ue_n2_info_notify_request_t)); + ogs_assert(non_ue_n2_info_notify_request_local_var); + + non_ue_n2_info_notify_request_local_var->json_data = json_data; + non_ue_n2_info_notify_request_local_var->binary_data_n2_information = binary_data_n2_information; + + return non_ue_n2_info_notify_request_local_var; +} + +void OpenAPI_non_ue_n2_info_notify_request_free(OpenAPI_non_ue_n2_info_notify_request_t *non_ue_n2_info_notify_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == non_ue_n2_info_notify_request) { + return; + } + if (non_ue_n2_info_notify_request->json_data) { + OpenAPI_n2_information_notification_free(non_ue_n2_info_notify_request->json_data); + non_ue_n2_info_notify_request->json_data = NULL; + } + if (non_ue_n2_info_notify_request->binary_data_n2_information) { + ogs_free(non_ue_n2_info_notify_request->binary_data_n2_information->data); + non_ue_n2_info_notify_request->binary_data_n2_information = NULL; + } + ogs_free(non_ue_n2_info_notify_request); +} + +cJSON *OpenAPI_non_ue_n2_info_notify_request_convertToJSON(OpenAPI_non_ue_n2_info_notify_request_t *non_ue_n2_info_notify_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (non_ue_n2_info_notify_request == NULL) { + ogs_error("OpenAPI_non_ue_n2_info_notify_request_convertToJSON() failed [NonUeN2InfoNotify_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (non_ue_n2_info_notify_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_n2_information_notification_convertToJSON(non_ue_n2_info_notify_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_non_ue_n2_info_notify_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_non_ue_n2_info_notify_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (non_ue_n2_info_notify_request->binary_data_n2_information) { + char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(non_ue_n2_info_notify_request->binary_data_n2_information->data,non_ue_n2_info_notify_request->binary_data_n2_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { + ogs_error("OpenAPI_non_ue_n2_info_notify_request_convertToJSON() failed [binary_data_n2_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information); + } + +end: + return item; +} + +OpenAPI_non_ue_n2_info_notify_request_t *OpenAPI_non_ue_n2_info_notify_request_parseFromJSON(cJSON *non_ue_n2_info_notify_requestJSON) +{ + OpenAPI_non_ue_n2_info_notify_request_t *non_ue_n2_info_notify_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_n2_information_notification_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n2_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_notify_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_n2_information_notification_parseFromJSON(json_data); + } + + binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_notify_requestJSON, "binaryDataN2Information"); + if (binary_data_n2_information) { + decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information); + if (!cJSON_IsString(binary_data_n2_information)) { + ogs_error("OpenAPI_non_ue_n2_info_notify_request_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); + if (!decoded_str_binary_data_n2_information->data) { + ogs_error("OpenAPI_non_ue_n2_info_notify_request_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + } + + non_ue_n2_info_notify_request_local_var = OpenAPI_non_ue_n2_info_notify_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL + ); + + return non_ue_n2_info_notify_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_n2_information_notification_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_non_ue_n2_info_notify_request_t *OpenAPI_non_ue_n2_info_notify_request_copy(OpenAPI_non_ue_n2_info_notify_request_t *dst, OpenAPI_non_ue_n2_info_notify_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_non_ue_n2_info_notify_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_non_ue_n2_info_notify_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_non_ue_n2_info_notify_request_free(dst); + dst = OpenAPI_non_ue_n2_info_notify_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/non_ue_n2_info_notify_request.h b/lib/sbi/openapi/model/non_ue_n2_info_notify_request.h new file mode 100644 index 000000000..48bc15a80 --- /dev/null +++ b/lib/sbi/openapi/model/non_ue_n2_info_notify_request.h @@ -0,0 +1,41 @@ +/* + * non_ue_n2_info_notify_request.h + * + * + */ + +#ifndef _OpenAPI_non_ue_n2_info_notify_request_H_ +#define _OpenAPI_non_ue_n2_info_notify_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "n2_information_notification.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_non_ue_n2_info_notify_request_s OpenAPI_non_ue_n2_info_notify_request_t; +typedef struct OpenAPI_non_ue_n2_info_notify_request_s { + struct OpenAPI_n2_information_notification_s *json_data; + OpenAPI_binary_t* binary_data_n2_information; +} OpenAPI_non_ue_n2_info_notify_request_t; + +OpenAPI_non_ue_n2_info_notify_request_t *OpenAPI_non_ue_n2_info_notify_request_create( + OpenAPI_n2_information_notification_t *json_data, + OpenAPI_binary_t* binary_data_n2_information +); +void OpenAPI_non_ue_n2_info_notify_request_free(OpenAPI_non_ue_n2_info_notify_request_t *non_ue_n2_info_notify_request); +OpenAPI_non_ue_n2_info_notify_request_t *OpenAPI_non_ue_n2_info_notify_request_parseFromJSON(cJSON *non_ue_n2_info_notify_requestJSON); +cJSON *OpenAPI_non_ue_n2_info_notify_request_convertToJSON(OpenAPI_non_ue_n2_info_notify_request_t *non_ue_n2_info_notify_request); +OpenAPI_non_ue_n2_info_notify_request_t *OpenAPI_non_ue_n2_info_notify_request_copy(OpenAPI_non_ue_n2_info_notify_request_t *dst, OpenAPI_non_ue_n2_info_notify_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_non_ue_n2_info_notify_request_H_ */ + diff --git a/lib/sbi/openapi/model/non_ue_n2_info_subscription_create_data.c b/lib/sbi/openapi/model/non_ue_n2_info_subscription_create_data.c index 68282bc80..45b60bb8d 100644 --- a/lib/sbi/openapi/model/non_ue_n2_info_subscription_create_data.c +++ b/lib/sbi/openapi/model/non_ue_n2_info_subscription_create_data.c @@ -28,24 +28,41 @@ OpenAPI_non_ue_n2_info_subscription_create_data_t *OpenAPI_non_ue_n2_info_subscr void OpenAPI_non_ue_n2_info_subscription_create_data_free(OpenAPI_non_ue_n2_info_subscription_create_data_t *non_ue_n2_info_subscription_create_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == non_ue_n2_info_subscription_create_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(non_ue_n2_info_subscription_create_data->global_ran_node_list, node) { - OpenAPI_global_ran_node_id_free(node->data); + if (non_ue_n2_info_subscription_create_data->global_ran_node_list) { + OpenAPI_list_for_each(non_ue_n2_info_subscription_create_data->global_ran_node_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(non_ue_n2_info_subscription_create_data->global_ran_node_list); + non_ue_n2_info_subscription_create_data->global_ran_node_list = NULL; + } + if (non_ue_n2_info_subscription_create_data->an_type_list) { + OpenAPI_list_free(non_ue_n2_info_subscription_create_data->an_type_list); + non_ue_n2_info_subscription_create_data->an_type_list = NULL; + } + if (non_ue_n2_info_subscription_create_data->n2_notify_callback_uri) { + ogs_free(non_ue_n2_info_subscription_create_data->n2_notify_callback_uri); + non_ue_n2_info_subscription_create_data->n2_notify_callback_uri = NULL; + } + if (non_ue_n2_info_subscription_create_data->nf_id) { + ogs_free(non_ue_n2_info_subscription_create_data->nf_id); + non_ue_n2_info_subscription_create_data->nf_id = NULL; + } + if (non_ue_n2_info_subscription_create_data->supported_features) { + ogs_free(non_ue_n2_info_subscription_create_data->supported_features); + non_ue_n2_info_subscription_create_data->supported_features = NULL; } - OpenAPI_list_free(non_ue_n2_info_subscription_create_data->global_ran_node_list); - OpenAPI_list_free(non_ue_n2_info_subscription_create_data->an_type_list); - ogs_free(non_ue_n2_info_subscription_create_data->n2_notify_callback_uri); - ogs_free(non_ue_n2_info_subscription_create_data->nf_id); - ogs_free(non_ue_n2_info_subscription_create_data->supported_features); ogs_free(non_ue_n2_info_subscription_create_data); } cJSON *OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON(OpenAPI_non_ue_n2_info_subscription_create_data_t *non_ue_n2_info_subscription_create_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (non_ue_n2_info_subscription_create_data == NULL) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [NonUeN2InfoSubscriptionCreateData]"); @@ -59,40 +76,43 @@ cJSON *OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON(OpenAPI_non ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [global_ran_node_list]"); goto end; } - - OpenAPI_lnode_t *global_ran_node_list_node; - if (non_ue_n2_info_subscription_create_data->global_ran_node_list) { - OpenAPI_list_for_each(non_ue_n2_info_subscription_create_data->global_ran_node_list, global_ran_node_list_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(global_ran_node_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [global_ran_node_list]"); - goto end; - } - cJSON_AddItemToArray(global_ran_node_listList, itemLocal); + OpenAPI_list_for_each(non_ue_n2_info_subscription_create_data->global_ran_node_list, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [global_ran_node_list]"); + goto end; } + cJSON_AddItemToArray(global_ran_node_listList, itemLocal); } } - if (non_ue_n2_info_subscription_create_data->an_type_list) { - cJSON *an_type_list = cJSON_AddArrayToObject(item, "anTypeList"); - if (an_type_list == NULL) { + if (non_ue_n2_info_subscription_create_data->an_type_list != OpenAPI_access_type_NULL) { + cJSON *an_type_listList = cJSON_AddArrayToObject(item, "anTypeList"); + if (an_type_listList == NULL) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [an_type_list]"); goto end; } - OpenAPI_lnode_t *an_type_list_node; - OpenAPI_list_for_each(non_ue_n2_info_subscription_create_data->an_type_list, an_type_list_node) { - if (cJSON_AddStringToObject(an_type_list, "", OpenAPI_access_type_ToString((intptr_t)an_type_list_node->data)) == NULL) { + OpenAPI_list_for_each(non_ue_n2_info_subscription_create_data->an_type_list, node) { + if (cJSON_AddStringToObject(an_type_listList, "", OpenAPI_access_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [an_type_list]"); goto end; } } } + if (non_ue_n2_info_subscription_create_data->n2_information_class == OpenAPI_n2_information_class_NULL) { + ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [n2_information_class]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n2InformationClass", OpenAPI_n2_information_class_ToString(non_ue_n2_info_subscription_create_data->n2_information_class)) == NULL) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [n2_information_class]"); goto end; } + if (!non_ue_n2_info_subscription_create_data->n2_notify_callback_uri) { + ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [n2_notify_callback_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n2NotifyCallbackUri", non_ue_n2_info_subscription_create_data->n2_notify_callback_uri) == NULL) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_convertToJSON() failed [n2_notify_callback_uri]"); goto end; @@ -119,94 +139,92 @@ end: OpenAPI_non_ue_n2_info_subscription_create_data_t *OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON(cJSON *non_ue_n2_info_subscription_create_dataJSON) { OpenAPI_non_ue_n2_info_subscription_create_data_t *non_ue_n2_info_subscription_create_data_local_var = NULL; - cJSON *global_ran_node_list = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "globalRanNodeList"); - - OpenAPI_list_t *global_ran_node_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *global_ran_node_list = NULL; + OpenAPI_list_t *global_ran_node_listList = NULL; + cJSON *an_type_list = NULL; + OpenAPI_list_t *an_type_listList = NULL; + cJSON *n2_information_class = NULL; + OpenAPI_n2_information_class_e n2_information_classVariable = 0; + cJSON *n2_notify_callback_uri = NULL; + cJSON *nf_id = NULL; + cJSON *supported_features = NULL; + global_ran_node_list = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "globalRanNodeList"); if (global_ran_node_list) { - cJSON *global_ran_node_list_local_nonprimitive; - if (!cJSON_IsArray(global_ran_node_list)){ - ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [global_ran_node_list]"); - goto end; - } - - global_ran_node_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(global_ran_node_list_local_nonprimitive, global_ran_node_list ) { - if (!cJSON_IsObject(global_ran_node_list_local_nonprimitive)) { + cJSON *global_ran_node_list_local = NULL; + if (!cJSON_IsArray(global_ran_node_list)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [global_ran_node_list]"); goto end; } - OpenAPI_global_ran_node_id_t *global_ran_node_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_list_local_nonprimitive); - if (!global_ran_node_listItem) { - ogs_error("No global_ran_node_listItem"); - OpenAPI_list_free(global_ran_node_listList); - goto end; + global_ran_node_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(global_ran_node_list_local, global_ran_node_list) { + if (!cJSON_IsObject(global_ran_node_list_local)) { + ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [global_ran_node_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *global_ran_node_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_list_local); + if (!global_ran_node_listItem) { + ogs_error("No global_ran_node_listItem"); + OpenAPI_list_free(global_ran_node_listList); + goto end; + } + OpenAPI_list_add(global_ran_node_listList, global_ran_node_listItem); } - - OpenAPI_list_add(global_ran_node_listList, global_ran_node_listItem); - } } - cJSON *an_type_list = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "anTypeList"); - - OpenAPI_list_t *an_type_listList; + an_type_list = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "anTypeList"); if (an_type_list) { - cJSON *an_type_list_local_nonprimitive; - if (!cJSON_IsArray(an_type_list)) { - ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [an_type_list]"); - goto end; - } - - an_type_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(an_type_list_local_nonprimitive, an_type_list ) { - if (!cJSON_IsString(an_type_list_local_nonprimitive)){ + cJSON *an_type_list_local = NULL; + if (!cJSON_IsArray(an_type_list)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [an_type_list]"); goto end; } - OpenAPI_list_add(an_type_listList, (void *)OpenAPI_access_type_FromString(an_type_list_local_nonprimitive->valuestring)); - } + an_type_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(an_type_list_local, an_type_list) { + if (!cJSON_IsString(an_type_list_local)) { + ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [an_type_list]"); + goto end; + } + OpenAPI_list_add(an_type_listList, (void *)OpenAPI_access_type_FromString(an_type_list_local->valuestring)); + } } - cJSON *n2_information_class = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "n2InformationClass"); + n2_information_class = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "n2InformationClass"); if (!n2_information_class) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [n2_information_class]"); goto end; } - - OpenAPI_n2_information_class_e n2_information_classVariable; if (!cJSON_IsString(n2_information_class)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [n2_information_class]"); goto end; } n2_information_classVariable = OpenAPI_n2_information_class_FromString(n2_information_class->valuestring); - cJSON *n2_notify_callback_uri = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "n2NotifyCallbackUri"); + n2_notify_callback_uri = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "n2NotifyCallbackUri"); if (!n2_notify_callback_uri) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [n2_notify_callback_uri]"); goto end; } - if (!cJSON_IsString(n2_notify_callback_uri)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [n2_notify_callback_uri]"); goto end; } - cJSON *nf_id = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "nfId"); - + nf_id = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "nfId"); if (nf_id) { - if (!cJSON_IsString(nf_id)) { + if (!cJSON_IsString(nf_id) && !cJSON_IsNull(nf_id)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [nf_id]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_create_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_create_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -217,12 +235,23 @@ OpenAPI_non_ue_n2_info_subscription_create_data_t *OpenAPI_non_ue_n2_info_subscr an_type_list ? an_type_listList : NULL, n2_information_classVariable, ogs_strdup(n2_notify_callback_uri->valuestring), - nf_id ? ogs_strdup(nf_id->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + nf_id && !cJSON_IsNull(nf_id) ? ogs_strdup(nf_id->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return non_ue_n2_info_subscription_create_data_local_var; end: + if (global_ran_node_listList) { + OpenAPI_list_for_each(global_ran_node_listList, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(global_ran_node_listList); + global_ran_node_listList = NULL; + } + if (an_type_listList) { + OpenAPI_list_free(an_type_listList); + an_type_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/non_ue_n2_info_subscription_created_data.c b/lib/sbi/openapi/model/non_ue_n2_info_subscription_created_data.c index 94305621b..7c682db5d 100644 --- a/lib/sbi/openapi/model/non_ue_n2_info_subscription_created_data.c +++ b/lib/sbi/openapi/model/non_ue_n2_info_subscription_created_data.c @@ -22,18 +22,26 @@ OpenAPI_non_ue_n2_info_subscription_created_data_t *OpenAPI_non_ue_n2_info_subsc void OpenAPI_non_ue_n2_info_subscription_created_data_free(OpenAPI_non_ue_n2_info_subscription_created_data_t *non_ue_n2_info_subscription_created_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == non_ue_n2_info_subscription_created_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(non_ue_n2_info_subscription_created_data->n2_notify_subscription_id); - ogs_free(non_ue_n2_info_subscription_created_data->supported_features); + if (non_ue_n2_info_subscription_created_data->n2_notify_subscription_id) { + ogs_free(non_ue_n2_info_subscription_created_data->n2_notify_subscription_id); + non_ue_n2_info_subscription_created_data->n2_notify_subscription_id = NULL; + } + if (non_ue_n2_info_subscription_created_data->supported_features) { + ogs_free(non_ue_n2_info_subscription_created_data->supported_features); + non_ue_n2_info_subscription_created_data->supported_features = NULL; + } ogs_free(non_ue_n2_info_subscription_created_data); } cJSON *OpenAPI_non_ue_n2_info_subscription_created_data_convertToJSON(OpenAPI_non_ue_n2_info_subscription_created_data_t *non_ue_n2_info_subscription_created_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (non_ue_n2_info_subscription_created_data == NULL) { ogs_error("OpenAPI_non_ue_n2_info_subscription_created_data_convertToJSON() failed [NonUeN2InfoSubscriptionCreatedData]"); @@ -41,6 +49,10 @@ cJSON *OpenAPI_non_ue_n2_info_subscription_created_data_convertToJSON(OpenAPI_no } item = cJSON_CreateObject(); + if (!non_ue_n2_info_subscription_created_data->n2_notify_subscription_id) { + ogs_error("OpenAPI_non_ue_n2_info_subscription_created_data_convertToJSON() failed [n2_notify_subscription_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n2NotifySubscriptionId", non_ue_n2_info_subscription_created_data->n2_notify_subscription_id) == NULL) { ogs_error("OpenAPI_non_ue_n2_info_subscription_created_data_convertToJSON() failed [n2_notify_subscription_id]"); goto end; @@ -53,7 +65,7 @@ cJSON *OpenAPI_non_ue_n2_info_subscription_created_data_convertToJSON(OpenAPI_no } } - if (non_ue_n2_info_subscription_created_data->n2_information_class) { + if (non_ue_n2_info_subscription_created_data->n2_information_class != OpenAPI_n2_information_class_NULL) { if (cJSON_AddStringToObject(item, "n2InformationClass", OpenAPI_n2_information_class_ToString(non_ue_n2_info_subscription_created_data->n2_information_class)) == NULL) { ogs_error("OpenAPI_non_ue_n2_info_subscription_created_data_convertToJSON() failed [n2_information_class]"); goto end; @@ -67,29 +79,30 @@ end: OpenAPI_non_ue_n2_info_subscription_created_data_t *OpenAPI_non_ue_n2_info_subscription_created_data_parseFromJSON(cJSON *non_ue_n2_info_subscription_created_dataJSON) { OpenAPI_non_ue_n2_info_subscription_created_data_t *non_ue_n2_info_subscription_created_data_local_var = NULL; - cJSON *n2_notify_subscription_id = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_created_dataJSON, "n2NotifySubscriptionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *n2_notify_subscription_id = NULL; + cJSON *supported_features = NULL; + cJSON *n2_information_class = NULL; + OpenAPI_n2_information_class_e n2_information_classVariable = 0; + n2_notify_subscription_id = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_created_dataJSON, "n2NotifySubscriptionId"); if (!n2_notify_subscription_id) { ogs_error("OpenAPI_non_ue_n2_info_subscription_created_data_parseFromJSON() failed [n2_notify_subscription_id]"); goto end; } - if (!cJSON_IsString(n2_notify_subscription_id)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_created_data_parseFromJSON() failed [n2_notify_subscription_id]"); goto end; } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_created_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_created_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_created_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *n2_information_class = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_created_dataJSON, "n2InformationClass"); - - OpenAPI_n2_information_class_e n2_information_classVariable; + n2_information_class = cJSON_GetObjectItemCaseSensitive(non_ue_n2_info_subscription_created_dataJSON, "n2InformationClass"); if (n2_information_class) { if (!cJSON_IsString(n2_information_class)) { ogs_error("OpenAPI_non_ue_n2_info_subscription_created_data_parseFromJSON() failed [n2_information_class]"); @@ -100,7 +113,7 @@ OpenAPI_non_ue_n2_info_subscription_created_data_t *OpenAPI_non_ue_n2_info_subsc non_ue_n2_info_subscription_created_data_local_var = OpenAPI_non_ue_n2_info_subscription_created_data_create ( ogs_strdup(n2_notify_subscription_id->valuestring), - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, n2_information_class ? n2_information_classVariable : 0 ); diff --git a/lib/sbi/openapi/model/non_ue_n2_message_transfer_request.c b/lib/sbi/openapi/model/non_ue_n2_message_transfer_request.c new file mode 100644 index 000000000..1e1e1109e --- /dev/null +++ b/lib/sbi/openapi/model/non_ue_n2_message_transfer_request.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "non_ue_n2_message_transfer_request.h" + +OpenAPI_non_ue_n2_message_transfer_request_t *OpenAPI_non_ue_n2_message_transfer_request_create( + OpenAPI_n2_information_transfer_req_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information +) +{ + OpenAPI_non_ue_n2_message_transfer_request_t *non_ue_n2_message_transfer_request_local_var = ogs_malloc(sizeof(OpenAPI_non_ue_n2_message_transfer_request_t)); + ogs_assert(non_ue_n2_message_transfer_request_local_var); + + non_ue_n2_message_transfer_request_local_var->json_data = json_data; + non_ue_n2_message_transfer_request_local_var->binary_data_n2_information = binary_data_n2_information; + + return non_ue_n2_message_transfer_request_local_var; +} + +void OpenAPI_non_ue_n2_message_transfer_request_free(OpenAPI_non_ue_n2_message_transfer_request_t *non_ue_n2_message_transfer_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == non_ue_n2_message_transfer_request) { + return; + } + if (non_ue_n2_message_transfer_request->json_data) { + OpenAPI_n2_information_transfer_req_data_free(non_ue_n2_message_transfer_request->json_data); + non_ue_n2_message_transfer_request->json_data = NULL; + } + if (non_ue_n2_message_transfer_request->binary_data_n2_information) { + ogs_free(non_ue_n2_message_transfer_request->binary_data_n2_information->data); + non_ue_n2_message_transfer_request->binary_data_n2_information = NULL; + } + ogs_free(non_ue_n2_message_transfer_request); +} + +cJSON *OpenAPI_non_ue_n2_message_transfer_request_convertToJSON(OpenAPI_non_ue_n2_message_transfer_request_t *non_ue_n2_message_transfer_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (non_ue_n2_message_transfer_request == NULL) { + ogs_error("OpenAPI_non_ue_n2_message_transfer_request_convertToJSON() failed [NonUeN2MessageTransfer_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (non_ue_n2_message_transfer_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_n2_information_transfer_req_data_convertToJSON(non_ue_n2_message_transfer_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_non_ue_n2_message_transfer_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_non_ue_n2_message_transfer_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (non_ue_n2_message_transfer_request->binary_data_n2_information) { + char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(non_ue_n2_message_transfer_request->binary_data_n2_information->data,non_ue_n2_message_transfer_request->binary_data_n2_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { + ogs_error("OpenAPI_non_ue_n2_message_transfer_request_convertToJSON() failed [binary_data_n2_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information); + } + +end: + return item; +} + +OpenAPI_non_ue_n2_message_transfer_request_t *OpenAPI_non_ue_n2_message_transfer_request_parseFromJSON(cJSON *non_ue_n2_message_transfer_requestJSON) +{ + OpenAPI_non_ue_n2_message_transfer_request_t *non_ue_n2_message_transfer_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_n2_information_transfer_req_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n2_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(non_ue_n2_message_transfer_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_n2_information_transfer_req_data_parseFromJSON(json_data); + } + + binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(non_ue_n2_message_transfer_requestJSON, "binaryDataN2Information"); + if (binary_data_n2_information) { + decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information); + if (!cJSON_IsString(binary_data_n2_information)) { + ogs_error("OpenAPI_non_ue_n2_message_transfer_request_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); + if (!decoded_str_binary_data_n2_information->data) { + ogs_error("OpenAPI_non_ue_n2_message_transfer_request_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + } + + non_ue_n2_message_transfer_request_local_var = OpenAPI_non_ue_n2_message_transfer_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL + ); + + return non_ue_n2_message_transfer_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_n2_information_transfer_req_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_non_ue_n2_message_transfer_request_t *OpenAPI_non_ue_n2_message_transfer_request_copy(OpenAPI_non_ue_n2_message_transfer_request_t *dst, OpenAPI_non_ue_n2_message_transfer_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_non_ue_n2_message_transfer_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_non_ue_n2_message_transfer_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_non_ue_n2_message_transfer_request_free(dst); + dst = OpenAPI_non_ue_n2_message_transfer_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/non_ue_n2_message_transfer_request.h b/lib/sbi/openapi/model/non_ue_n2_message_transfer_request.h new file mode 100644 index 000000000..1d1aa14ee --- /dev/null +++ b/lib/sbi/openapi/model/non_ue_n2_message_transfer_request.h @@ -0,0 +1,41 @@ +/* + * non_ue_n2_message_transfer_request.h + * + * + */ + +#ifndef _OpenAPI_non_ue_n2_message_transfer_request_H_ +#define _OpenAPI_non_ue_n2_message_transfer_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "n2_information_transfer_req_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_non_ue_n2_message_transfer_request_s OpenAPI_non_ue_n2_message_transfer_request_t; +typedef struct OpenAPI_non_ue_n2_message_transfer_request_s { + struct OpenAPI_n2_information_transfer_req_data_s *json_data; + OpenAPI_binary_t* binary_data_n2_information; +} OpenAPI_non_ue_n2_message_transfer_request_t; + +OpenAPI_non_ue_n2_message_transfer_request_t *OpenAPI_non_ue_n2_message_transfer_request_create( + OpenAPI_n2_information_transfer_req_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information +); +void OpenAPI_non_ue_n2_message_transfer_request_free(OpenAPI_non_ue_n2_message_transfer_request_t *non_ue_n2_message_transfer_request); +OpenAPI_non_ue_n2_message_transfer_request_t *OpenAPI_non_ue_n2_message_transfer_request_parseFromJSON(cJSON *non_ue_n2_message_transfer_requestJSON); +cJSON *OpenAPI_non_ue_n2_message_transfer_request_convertToJSON(OpenAPI_non_ue_n2_message_transfer_request_t *non_ue_n2_message_transfer_request); +OpenAPI_non_ue_n2_message_transfer_request_t *OpenAPI_non_ue_n2_message_transfer_request_copy(OpenAPI_non_ue_n2_message_transfer_request_t *dst, OpenAPI_non_ue_n2_message_transfer_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_non_ue_n2_message_transfer_request_H_ */ + diff --git a/lib/sbi/openapi/model/notif_condition.c b/lib/sbi/openapi/model/notif_condition.c index c15b49042..1ffce7024 100644 --- a/lib/sbi/openapi/model/notif_condition.c +++ b/lib/sbi/openapi/model/notif_condition.c @@ -20,24 +20,32 @@ OpenAPI_notif_condition_t *OpenAPI_notif_condition_create( void OpenAPI_notif_condition_free(OpenAPI_notif_condition_t *notif_condition) { + OpenAPI_lnode_t *node = NULL; + if (NULL == notif_condition) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(notif_condition->monitored_attributes, node) { - ogs_free(node->data); + if (notif_condition->monitored_attributes) { + OpenAPI_list_for_each(notif_condition->monitored_attributes, node) { + ogs_free(node->data); + } + OpenAPI_list_free(notif_condition->monitored_attributes); + notif_condition->monitored_attributes = NULL; } - OpenAPI_list_free(notif_condition->monitored_attributes); - OpenAPI_list_for_each(notif_condition->unmonitored_attributes, node) { - ogs_free(node->data); + if (notif_condition->unmonitored_attributes) { + OpenAPI_list_for_each(notif_condition->unmonitored_attributes, node) { + ogs_free(node->data); + } + OpenAPI_list_free(notif_condition->unmonitored_attributes); + notif_condition->unmonitored_attributes = NULL; } - OpenAPI_list_free(notif_condition->unmonitored_attributes); ogs_free(notif_condition); } cJSON *OpenAPI_notif_condition_convertToJSON(OpenAPI_notif_condition_t *notif_condition) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (notif_condition == NULL) { ogs_error("OpenAPI_notif_condition_convertToJSON() failed [NotifCondition]"); @@ -46,35 +54,31 @@ cJSON *OpenAPI_notif_condition_convertToJSON(OpenAPI_notif_condition_t *notif_co item = cJSON_CreateObject(); if (notif_condition->monitored_attributes) { - cJSON *monitored_attributes = cJSON_AddArrayToObject(item, "monitoredAttributes"); - if (monitored_attributes == NULL) { + cJSON *monitored_attributesList = cJSON_AddArrayToObject(item, "monitoredAttributes"); + if (monitored_attributesList == NULL) { ogs_error("OpenAPI_notif_condition_convertToJSON() failed [monitored_attributes]"); goto end; } - - OpenAPI_lnode_t *monitored_attributes_node; - OpenAPI_list_for_each(notif_condition->monitored_attributes, monitored_attributes_node) { - if (cJSON_AddStringToObject(monitored_attributes, "", (char*)monitored_attributes_node->data) == NULL) { - ogs_error("OpenAPI_notif_condition_convertToJSON() failed [monitored_attributes]"); - goto end; + OpenAPI_list_for_each(notif_condition->monitored_attributes, node) { + if (cJSON_AddStringToObject(monitored_attributesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_notif_condition_convertToJSON() failed [monitored_attributes]"); + goto end; + } } - } } if (notif_condition->unmonitored_attributes) { - cJSON *unmonitored_attributes = cJSON_AddArrayToObject(item, "unmonitoredAttributes"); - if (unmonitored_attributes == NULL) { + cJSON *unmonitored_attributesList = cJSON_AddArrayToObject(item, "unmonitoredAttributes"); + if (unmonitored_attributesList == NULL) { ogs_error("OpenAPI_notif_condition_convertToJSON() failed [unmonitored_attributes]"); goto end; } - - OpenAPI_lnode_t *unmonitored_attributes_node; - OpenAPI_list_for_each(notif_condition->unmonitored_attributes, unmonitored_attributes_node) { - if (cJSON_AddStringToObject(unmonitored_attributes, "", (char*)unmonitored_attributes_node->data) == NULL) { - ogs_error("OpenAPI_notif_condition_convertToJSON() failed [unmonitored_attributes]"); - goto end; + OpenAPI_list_for_each(notif_condition->unmonitored_attributes, node) { + if (cJSON_AddStringToObject(unmonitored_attributesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_notif_condition_convertToJSON() failed [unmonitored_attributes]"); + goto end; + } } - } } end: @@ -84,44 +88,51 @@ end: OpenAPI_notif_condition_t *OpenAPI_notif_condition_parseFromJSON(cJSON *notif_conditionJSON) { OpenAPI_notif_condition_t *notif_condition_local_var = NULL; - cJSON *monitored_attributes = cJSON_GetObjectItemCaseSensitive(notif_conditionJSON, "monitoredAttributes"); - - OpenAPI_list_t *monitored_attributesList; + OpenAPI_lnode_t *node = NULL; + cJSON *monitored_attributes = NULL; + OpenAPI_list_t *monitored_attributesList = NULL; + cJSON *unmonitored_attributes = NULL; + OpenAPI_list_t *unmonitored_attributesList = NULL; + monitored_attributes = cJSON_GetObjectItemCaseSensitive(notif_conditionJSON, "monitoredAttributes"); if (monitored_attributes) { - cJSON *monitored_attributes_local; - if (!cJSON_IsArray(monitored_attributes)) { - ogs_error("OpenAPI_notif_condition_parseFromJSON() failed [monitored_attributes]"); - goto end; - } - monitored_attributesList = OpenAPI_list_create(); + cJSON *monitored_attributes_local = NULL; + if (!cJSON_IsArray(monitored_attributes)) { + ogs_error("OpenAPI_notif_condition_parseFromJSON() failed [monitored_attributes]"); + goto end; + } - cJSON_ArrayForEach(monitored_attributes_local, monitored_attributes) { - if (!cJSON_IsString(monitored_attributes_local)) { - ogs_error("OpenAPI_notif_condition_parseFromJSON() failed [monitored_attributes]"); - goto end; - } - OpenAPI_list_add(monitored_attributesList, ogs_strdup(monitored_attributes_local->valuestring)); - } + monitored_attributesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monitored_attributes_local, monitored_attributes) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monitored_attributes_local)) { + ogs_error("OpenAPI_notif_condition_parseFromJSON() failed [monitored_attributes]"); + goto end; + } + OpenAPI_list_add(monitored_attributesList, ogs_strdup(monitored_attributes_local->valuestring)); + } } - cJSON *unmonitored_attributes = cJSON_GetObjectItemCaseSensitive(notif_conditionJSON, "unmonitoredAttributes"); - - OpenAPI_list_t *unmonitored_attributesList; + unmonitored_attributes = cJSON_GetObjectItemCaseSensitive(notif_conditionJSON, "unmonitoredAttributes"); if (unmonitored_attributes) { - cJSON *unmonitored_attributes_local; - if (!cJSON_IsArray(unmonitored_attributes)) { - ogs_error("OpenAPI_notif_condition_parseFromJSON() failed [unmonitored_attributes]"); - goto end; - } - unmonitored_attributesList = OpenAPI_list_create(); + cJSON *unmonitored_attributes_local = NULL; + if (!cJSON_IsArray(unmonitored_attributes)) { + ogs_error("OpenAPI_notif_condition_parseFromJSON() failed [unmonitored_attributes]"); + goto end; + } - cJSON_ArrayForEach(unmonitored_attributes_local, unmonitored_attributes) { - if (!cJSON_IsString(unmonitored_attributes_local)) { - ogs_error("OpenAPI_notif_condition_parseFromJSON() failed [unmonitored_attributes]"); - goto end; - } - OpenAPI_list_add(unmonitored_attributesList, ogs_strdup(unmonitored_attributes_local->valuestring)); - } + unmonitored_attributesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(unmonitored_attributes_local, unmonitored_attributes) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(unmonitored_attributes_local)) { + ogs_error("OpenAPI_notif_condition_parseFromJSON() failed [unmonitored_attributes]"); + goto end; + } + OpenAPI_list_add(unmonitored_attributesList, ogs_strdup(unmonitored_attributes_local->valuestring)); + } } notif_condition_local_var = OpenAPI_notif_condition_create ( @@ -131,6 +142,20 @@ OpenAPI_notif_condition_t *OpenAPI_notif_condition_parseFromJSON(cJSON *notif_co return notif_condition_local_var; end: + if (monitored_attributesList) { + OpenAPI_list_for_each(monitored_attributesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monitored_attributesList); + monitored_attributesList = NULL; + } + if (unmonitored_attributesList) { + OpenAPI_list_for_each(unmonitored_attributesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(unmonitored_attributesList); + unmonitored_attributesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/notification_data.c b/lib/sbi/openapi/model/notification_data.c index 9b10a8422..0d9d5b5fc 100644 --- a/lib/sbi/openapi/model/notification_data.c +++ b/lib/sbi/openapi/model/notification_data.c @@ -26,22 +26,33 @@ OpenAPI_notification_data_t *OpenAPI_notification_data_create( void OpenAPI_notification_data_free(OpenAPI_notification_data_t *notification_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == notification_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(notification_data->nf_instance_uri); - OpenAPI_nf_profile_free(notification_data->nf_profile); - OpenAPI_list_for_each(notification_data->profile_changes, node) { - OpenAPI_change_item_free(node->data); + if (notification_data->nf_instance_uri) { + ogs_free(notification_data->nf_instance_uri); + notification_data->nf_instance_uri = NULL; + } + if (notification_data->nf_profile) { + OpenAPI_nf_profile_free(notification_data->nf_profile); + notification_data->nf_profile = NULL; + } + if (notification_data->profile_changes) { + OpenAPI_list_for_each(notification_data->profile_changes, node) { + OpenAPI_change_item_free(node->data); + } + OpenAPI_list_free(notification_data->profile_changes); + notification_data->profile_changes = NULL; } - OpenAPI_list_free(notification_data->profile_changes); ogs_free(notification_data); } cJSON *OpenAPI_notification_data_convertToJSON(OpenAPI_notification_data_t *notification_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (notification_data == NULL) { ogs_error("OpenAPI_notification_data_convertToJSON() failed [NotificationData]"); @@ -49,11 +60,19 @@ cJSON *OpenAPI_notification_data_convertToJSON(OpenAPI_notification_data_t *noti } item = cJSON_CreateObject(); + if (notification_data->event == OpenAPI_notification_event_type_NULL) { + ogs_error("OpenAPI_notification_data_convertToJSON() failed [event]"); + return NULL; + } if (cJSON_AddStringToObject(item, "event", OpenAPI_notification_event_type_ToString(notification_data->event)) == NULL) { ogs_error("OpenAPI_notification_data_convertToJSON() failed [event]"); goto end; } + if (!notification_data->nf_instance_uri) { + ogs_error("OpenAPI_notification_data_convertToJSON() failed [nf_instance_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfInstanceUri", notification_data->nf_instance_uri) == NULL) { ogs_error("OpenAPI_notification_data_convertToJSON() failed [nf_instance_uri]"); goto end; @@ -78,21 +97,17 @@ cJSON *OpenAPI_notification_data_convertToJSON(OpenAPI_notification_data_t *noti ogs_error("OpenAPI_notification_data_convertToJSON() failed [profile_changes]"); goto end; } - - OpenAPI_lnode_t *profile_changes_node; - if (notification_data->profile_changes) { - OpenAPI_list_for_each(notification_data->profile_changes, profile_changes_node) { - cJSON *itemLocal = OpenAPI_change_item_convertToJSON(profile_changes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_notification_data_convertToJSON() failed [profile_changes]"); - goto end; - } - cJSON_AddItemToArray(profile_changesList, itemLocal); + OpenAPI_list_for_each(notification_data->profile_changes, node) { + cJSON *itemLocal = OpenAPI_change_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_notification_data_convertToJSON() failed [profile_changes]"); + goto end; } + cJSON_AddItemToArray(profile_changesList, itemLocal); } } - if (notification_data->condition_event) { + if (notification_data->condition_event != OpenAPI_condition_event_type_NULL) { if (cJSON_AddStringToObject(item, "conditionEvent", OpenAPI_condition_event_type_ToString(notification_data->condition_event)) == NULL) { ogs_error("OpenAPI_notification_data_convertToJSON() failed [condition_event]"); goto end; @@ -106,69 +121,68 @@ end: OpenAPI_notification_data_t *OpenAPI_notification_data_parseFromJSON(cJSON *notification_dataJSON) { OpenAPI_notification_data_t *notification_data_local_var = NULL; - cJSON *event = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "event"); + OpenAPI_lnode_t *node = NULL; + cJSON *event = NULL; + OpenAPI_notification_event_type_e eventVariable = 0; + cJSON *nf_instance_uri = NULL; + cJSON *nf_profile = NULL; + OpenAPI_nf_profile_t *nf_profile_local_nonprim = NULL; + cJSON *profile_changes = NULL; + OpenAPI_list_t *profile_changesList = NULL; + cJSON *condition_event = NULL; + OpenAPI_condition_event_type_e condition_eventVariable = 0; + event = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "event"); if (!event) { ogs_error("OpenAPI_notification_data_parseFromJSON() failed [event]"); goto end; } - - OpenAPI_notification_event_type_e eventVariable; if (!cJSON_IsString(event)) { ogs_error("OpenAPI_notification_data_parseFromJSON() failed [event]"); goto end; } eventVariable = OpenAPI_notification_event_type_FromString(event->valuestring); - cJSON *nf_instance_uri = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "nfInstanceUri"); + nf_instance_uri = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "nfInstanceUri"); if (!nf_instance_uri) { ogs_error("OpenAPI_notification_data_parseFromJSON() failed [nf_instance_uri]"); goto end; } - if (!cJSON_IsString(nf_instance_uri)) { ogs_error("OpenAPI_notification_data_parseFromJSON() failed [nf_instance_uri]"); goto end; } - cJSON *nf_profile = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "nfProfile"); - - OpenAPI_nf_profile_t *nf_profile_local_nonprim = NULL; + nf_profile = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "nfProfile"); if (nf_profile) { nf_profile_local_nonprim = OpenAPI_nf_profile_parseFromJSON(nf_profile); } - cJSON *profile_changes = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "profileChanges"); - - OpenAPI_list_t *profile_changesList; + profile_changes = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "profileChanges"); if (profile_changes) { - cJSON *profile_changes_local_nonprimitive; - if (!cJSON_IsArray(profile_changes)){ - ogs_error("OpenAPI_notification_data_parseFromJSON() failed [profile_changes]"); - goto end; - } - - profile_changesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(profile_changes_local_nonprimitive, profile_changes ) { - if (!cJSON_IsObject(profile_changes_local_nonprimitive)) { + cJSON *profile_changes_local = NULL; + if (!cJSON_IsArray(profile_changes)) { ogs_error("OpenAPI_notification_data_parseFromJSON() failed [profile_changes]"); goto end; } - OpenAPI_change_item_t *profile_changesItem = OpenAPI_change_item_parseFromJSON(profile_changes_local_nonprimitive); - if (!profile_changesItem) { - ogs_error("No profile_changesItem"); - OpenAPI_list_free(profile_changesList); - goto end; + profile_changesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(profile_changes_local, profile_changes) { + if (!cJSON_IsObject(profile_changes_local)) { + ogs_error("OpenAPI_notification_data_parseFromJSON() failed [profile_changes]"); + goto end; + } + OpenAPI_change_item_t *profile_changesItem = OpenAPI_change_item_parseFromJSON(profile_changes_local); + if (!profile_changesItem) { + ogs_error("No profile_changesItem"); + OpenAPI_list_free(profile_changesList); + goto end; + } + OpenAPI_list_add(profile_changesList, profile_changesItem); } - - OpenAPI_list_add(profile_changesList, profile_changesItem); - } } - cJSON *condition_event = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "conditionEvent"); - - OpenAPI_condition_event_type_e condition_eventVariable; + condition_event = cJSON_GetObjectItemCaseSensitive(notification_dataJSON, "conditionEvent"); if (condition_event) { if (!cJSON_IsString(condition_event)) { ogs_error("OpenAPI_notification_data_parseFromJSON() failed [condition_event]"); @@ -187,6 +201,17 @@ OpenAPI_notification_data_t *OpenAPI_notification_data_parseFromJSON(cJSON *noti return notification_data_local_var; end: + if (nf_profile_local_nonprim) { + OpenAPI_nf_profile_free(nf_profile_local_nonprim); + nf_profile_local_nonprim = NULL; + } + if (profile_changesList) { + OpenAPI_list_for_each(profile_changesList, node) { + OpenAPI_change_item_free(node->data); + } + OpenAPI_list_free(profile_changesList); + profile_changesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/notification_item.c b/lib/sbi/openapi/model/notification_item.c index 213dd5189..16d29fbf9 100644 --- a/lib/sbi/openapi/model/notification_item.c +++ b/lib/sbi/openapi/model/notification_item.c @@ -20,21 +20,29 @@ OpenAPI_notification_item_t *OpenAPI_notification_item_create( void OpenAPI_notification_item_free(OpenAPI_notification_item_t *notification_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == notification_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(notification_item->resource_id); - OpenAPI_list_for_each(notification_item->notif_items, node) { - OpenAPI_updated_item_free(node->data); + if (notification_item->resource_id) { + ogs_free(notification_item->resource_id); + notification_item->resource_id = NULL; + } + if (notification_item->notif_items) { + OpenAPI_list_for_each(notification_item->notif_items, node) { + OpenAPI_updated_item_free(node->data); + } + OpenAPI_list_free(notification_item->notif_items); + notification_item->notif_items = NULL; } - OpenAPI_list_free(notification_item->notif_items); ogs_free(notification_item); } cJSON *OpenAPI_notification_item_convertToJSON(OpenAPI_notification_item_t *notification_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (notification_item == NULL) { ogs_error("OpenAPI_notification_item_convertToJSON() failed [NotificationItem]"); @@ -42,27 +50,31 @@ cJSON *OpenAPI_notification_item_convertToJSON(OpenAPI_notification_item_t *noti } item = cJSON_CreateObject(); + if (!notification_item->resource_id) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [resource_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resourceId", notification_item->resource_id) == NULL) { ogs_error("OpenAPI_notification_item_convertToJSON() failed [resource_id]"); goto end; } + if (!notification_item->notif_items) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [notif_items]"); + return NULL; + } cJSON *notif_itemsList = cJSON_AddArrayToObject(item, "notifItems"); if (notif_itemsList == NULL) { ogs_error("OpenAPI_notification_item_convertToJSON() failed [notif_items]"); goto end; } - - OpenAPI_lnode_t *notif_items_node; - if (notification_item->notif_items) { - OpenAPI_list_for_each(notification_item->notif_items, notif_items_node) { - cJSON *itemLocal = OpenAPI_updated_item_convertToJSON(notif_items_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_notification_item_convertToJSON() failed [notif_items]"); - goto end; - } - cJSON_AddItemToArray(notif_itemsList, itemLocal); + OpenAPI_list_for_each(notification_item->notif_items, node) { + cJSON *itemLocal = OpenAPI_updated_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_notification_item_convertToJSON() failed [notif_items]"); + goto end; } + cJSON_AddItemToArray(notif_itemsList, itemLocal); } end: @@ -72,48 +84,47 @@ end: OpenAPI_notification_item_t *OpenAPI_notification_item_parseFromJSON(cJSON *notification_itemJSON) { OpenAPI_notification_item_t *notification_item_local_var = NULL; - cJSON *resource_id = cJSON_GetObjectItemCaseSensitive(notification_itemJSON, "resourceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *resource_id = NULL; + cJSON *notif_items = NULL; + OpenAPI_list_t *notif_itemsList = NULL; + resource_id = cJSON_GetObjectItemCaseSensitive(notification_itemJSON, "resourceId"); if (!resource_id) { ogs_error("OpenAPI_notification_item_parseFromJSON() failed [resource_id]"); goto end; } - if (!cJSON_IsString(resource_id)) { ogs_error("OpenAPI_notification_item_parseFromJSON() failed [resource_id]"); goto end; } - cJSON *notif_items = cJSON_GetObjectItemCaseSensitive(notification_itemJSON, "notifItems"); + notif_items = cJSON_GetObjectItemCaseSensitive(notification_itemJSON, "notifItems"); if (!notif_items) { ogs_error("OpenAPI_notification_item_parseFromJSON() failed [notif_items]"); goto end; } - - OpenAPI_list_t *notif_itemsList; - cJSON *notif_items_local_nonprimitive; - if (!cJSON_IsArray(notif_items)){ - ogs_error("OpenAPI_notification_item_parseFromJSON() failed [notif_items]"); - goto end; - } - - notif_itemsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(notif_items_local_nonprimitive, notif_items ) { - if (!cJSON_IsObject(notif_items_local_nonprimitive)) { + cJSON *notif_items_local = NULL; + if (!cJSON_IsArray(notif_items)) { ogs_error("OpenAPI_notification_item_parseFromJSON() failed [notif_items]"); goto end; } - OpenAPI_updated_item_t *notif_itemsItem = OpenAPI_updated_item_parseFromJSON(notif_items_local_nonprimitive); - if (!notif_itemsItem) { - ogs_error("No notif_itemsItem"); - OpenAPI_list_free(notif_itemsList); - goto end; + notif_itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notif_items_local, notif_items) { + if (!cJSON_IsObject(notif_items_local)) { + ogs_error("OpenAPI_notification_item_parseFromJSON() failed [notif_items]"); + goto end; + } + OpenAPI_updated_item_t *notif_itemsItem = OpenAPI_updated_item_parseFromJSON(notif_items_local); + if (!notif_itemsItem) { + ogs_error("No notif_itemsItem"); + OpenAPI_list_free(notif_itemsList); + goto end; + } + OpenAPI_list_add(notif_itemsList, notif_itemsItem); } - OpenAPI_list_add(notif_itemsList, notif_itemsItem); - } - notification_item_local_var = OpenAPI_notification_item_create ( ogs_strdup(resource_id->valuestring), notif_itemsList @@ -121,6 +132,13 @@ OpenAPI_notification_item_t *OpenAPI_notification_item_parseFromJSON(cJSON *noti return notification_item_local_var; end: + if (notif_itemsList) { + OpenAPI_list_for_each(notif_itemsList, node) { + OpenAPI_updated_item_free(node->data); + } + OpenAPI_list_free(notif_itemsList); + notif_itemsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/notify_item.c b/lib/sbi/openapi/model/notify_item.c index 517c7e2fd..6d41dc516 100644 --- a/lib/sbi/openapi/model/notify_item.c +++ b/lib/sbi/openapi/model/notify_item.c @@ -20,21 +20,29 @@ OpenAPI_notify_item_t *OpenAPI_notify_item_create( void OpenAPI_notify_item_free(OpenAPI_notify_item_t *notify_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == notify_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(notify_item->resource_id); - OpenAPI_list_for_each(notify_item->changes, node) { - OpenAPI_change_item_free(node->data); + if (notify_item->resource_id) { + ogs_free(notify_item->resource_id); + notify_item->resource_id = NULL; + } + if (notify_item->changes) { + OpenAPI_list_for_each(notify_item->changes, node) { + OpenAPI_change_item_free(node->data); + } + OpenAPI_list_free(notify_item->changes); + notify_item->changes = NULL; } - OpenAPI_list_free(notify_item->changes); ogs_free(notify_item); } cJSON *OpenAPI_notify_item_convertToJSON(OpenAPI_notify_item_t *notify_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (notify_item == NULL) { ogs_error("OpenAPI_notify_item_convertToJSON() failed [NotifyItem]"); @@ -42,27 +50,31 @@ cJSON *OpenAPI_notify_item_convertToJSON(OpenAPI_notify_item_t *notify_item) } item = cJSON_CreateObject(); + if (!notify_item->resource_id) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [resource_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resourceId", notify_item->resource_id) == NULL) { ogs_error("OpenAPI_notify_item_convertToJSON() failed [resource_id]"); goto end; } + if (!notify_item->changes) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [changes]"); + return NULL; + } cJSON *changesList = cJSON_AddArrayToObject(item, "changes"); if (changesList == NULL) { ogs_error("OpenAPI_notify_item_convertToJSON() failed [changes]"); goto end; } - - OpenAPI_lnode_t *changes_node; - if (notify_item->changes) { - OpenAPI_list_for_each(notify_item->changes, changes_node) { - cJSON *itemLocal = OpenAPI_change_item_convertToJSON(changes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_notify_item_convertToJSON() failed [changes]"); - goto end; - } - cJSON_AddItemToArray(changesList, itemLocal); + OpenAPI_list_for_each(notify_item->changes, node) { + cJSON *itemLocal = OpenAPI_change_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_notify_item_convertToJSON() failed [changes]"); + goto end; } + cJSON_AddItemToArray(changesList, itemLocal); } end: @@ -72,48 +84,47 @@ end: OpenAPI_notify_item_t *OpenAPI_notify_item_parseFromJSON(cJSON *notify_itemJSON) { OpenAPI_notify_item_t *notify_item_local_var = NULL; - cJSON *resource_id = cJSON_GetObjectItemCaseSensitive(notify_itemJSON, "resourceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *resource_id = NULL; + cJSON *changes = NULL; + OpenAPI_list_t *changesList = NULL; + resource_id = cJSON_GetObjectItemCaseSensitive(notify_itemJSON, "resourceId"); if (!resource_id) { ogs_error("OpenAPI_notify_item_parseFromJSON() failed [resource_id]"); goto end; } - if (!cJSON_IsString(resource_id)) { ogs_error("OpenAPI_notify_item_parseFromJSON() failed [resource_id]"); goto end; } - cJSON *changes = cJSON_GetObjectItemCaseSensitive(notify_itemJSON, "changes"); + changes = cJSON_GetObjectItemCaseSensitive(notify_itemJSON, "changes"); if (!changes) { ogs_error("OpenAPI_notify_item_parseFromJSON() failed [changes]"); goto end; } - - OpenAPI_list_t *changesList; - cJSON *changes_local_nonprimitive; - if (!cJSON_IsArray(changes)){ - ogs_error("OpenAPI_notify_item_parseFromJSON() failed [changes]"); - goto end; - } - - changesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(changes_local_nonprimitive, changes ) { - if (!cJSON_IsObject(changes_local_nonprimitive)) { + cJSON *changes_local = NULL; + if (!cJSON_IsArray(changes)) { ogs_error("OpenAPI_notify_item_parseFromJSON() failed [changes]"); goto end; } - OpenAPI_change_item_t *changesItem = OpenAPI_change_item_parseFromJSON(changes_local_nonprimitive); - if (!changesItem) { - ogs_error("No changesItem"); - OpenAPI_list_free(changesList); - goto end; + changesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(changes_local, changes) { + if (!cJSON_IsObject(changes_local)) { + ogs_error("OpenAPI_notify_item_parseFromJSON() failed [changes]"); + goto end; + } + OpenAPI_change_item_t *changesItem = OpenAPI_change_item_parseFromJSON(changes_local); + if (!changesItem) { + ogs_error("No changesItem"); + OpenAPI_list_free(changesList); + goto end; + } + OpenAPI_list_add(changesList, changesItem); } - OpenAPI_list_add(changesList, changesItem); - } - notify_item_local_var = OpenAPI_notify_item_create ( ogs_strdup(resource_id->valuestring), changesList @@ -121,6 +132,13 @@ OpenAPI_notify_item_t *OpenAPI_notify_item_parseFromJSON(cJSON *notify_itemJSON) return notify_item_local_var; end: + if (changesList) { + OpenAPI_list_for_each(changesList, node) { + OpenAPI_change_item_free(node->data); + } + OpenAPI_list_free(changesList); + changesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/npcf_af_event.c b/lib/sbi/openapi/model/npcf_af_event.c new file mode 100644 index 000000000..4c47d48e4 --- /dev/null +++ b/lib/sbi/openapi/model/npcf_af_event.c @@ -0,0 +1,30 @@ + +#include +#include +#include +#include "npcf_af_event.h" + +char* OpenAPI_npcf_af_event_ToString(OpenAPI_npcf_af_event_e npcf_af_event) +{ + const char *npcf_af_eventArray[] = { "NULL", "ACCESS_TYPE_CHANGE", "ANI_REPORT", "CHARGING_CORRELATION", "EPS_FALLBACK", "FAILED_RESOURCES_ALLOCATION", "OUT_OF_CREDIT", "PLMN_CHG", "QOS_MONITORING", "QOS_NOTIF", "RAN_NAS_CAUSE", "REALLOCATION_OF_CREDIT", "SUCCESSFUL_RESOURCES_ALLOCATION", "TSN_BRIDGE_INFO", "USAGE_REPORT" }; + size_t sizeofArray = sizeof(npcf_af_eventArray) / sizeof(npcf_af_eventArray[0]); + if (npcf_af_event < sizeofArray) + return (char *)npcf_af_eventArray[npcf_af_event]; + else + return (char *)"Unknown"; +} + +OpenAPI_npcf_af_event_e OpenAPI_npcf_af_event_FromString(char* npcf_af_event) +{ + int stringToReturn = 0; + const char *npcf_af_eventArray[] = { "NULL", "ACCESS_TYPE_CHANGE", "ANI_REPORT", "CHARGING_CORRELATION", "EPS_FALLBACK", "FAILED_RESOURCES_ALLOCATION", "OUT_OF_CREDIT", "PLMN_CHG", "QOS_MONITORING", "QOS_NOTIF", "RAN_NAS_CAUSE", "REALLOCATION_OF_CREDIT", "SUCCESSFUL_RESOURCES_ALLOCATION", "TSN_BRIDGE_INFO", "USAGE_REPORT" }; + size_t sizeofArray = sizeof(npcf_af_eventArray) / sizeof(npcf_af_eventArray[0]); + while (stringToReturn < sizeofArray) { + if (strcmp(npcf_af_event, npcf_af_eventArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + diff --git a/lib/sbi/openapi/model/npcf_af_event.h b/lib/sbi/openapi/model/npcf_af_event.h new file mode 100644 index 000000000..eabbcfd3c --- /dev/null +++ b/lib/sbi/openapi/model/npcf_af_event.h @@ -0,0 +1,31 @@ +/* + * npcf_af_event.h + * + * + */ + +#ifndef _OpenAPI_npcf_af_event_H_ +#define _OpenAPI_npcf_af_event_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { OpenAPI_npcf_af_event_NULL = 0, OpenAPI_npcf_af_event_ACCESS_TYPE_CHANGE, OpenAPI_npcf_af_event_ANI_REPORT, OpenAPI_npcf_af_event_CHARGING_CORRELATION, OpenAPI_npcf_af_event_EPS_FALLBACK, OpenAPI_npcf_af_event_FAILED_RESOURCES_ALLOCATION, OpenAPI_npcf_af_event_OUT_OF_CREDIT, OpenAPI_npcf_af_event_PLMN_CHG, OpenAPI_npcf_af_event_QOS_MONITORING, OpenAPI_npcf_af_event_QOS_NOTIF, OpenAPI_npcf_af_event_RAN_NAS_CAUSE, OpenAPI_npcf_af_event_REALLOCATION_OF_CREDIT, OpenAPI_npcf_af_event_SUCCESSFUL_RESOURCES_ALLOCATION, OpenAPI_npcf_af_event_TSN_BRIDGE_INFO, OpenAPI_npcf_af_event_USAGE_REPORT } OpenAPI_npcf_af_event_e; + +char* OpenAPI_npcf_af_event_ToString(OpenAPI_npcf_af_event_e npcf_af_event); + +OpenAPI_npcf_af_event_e OpenAPI_npcf_af_event_FromString(char* npcf_af_event); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_npcf_af_event_H_ */ + diff --git a/lib/sbi/openapi/model/npn_access_info.c b/lib/sbi/openapi/model/npn_access_info.c index d2c091143..3f47632cb 100644 --- a/lib/sbi/openapi/model/npn_access_info.c +++ b/lib/sbi/openapi/model/npn_access_info.c @@ -18,20 +18,25 @@ OpenAPI_npn_access_info_t *OpenAPI_npn_access_info_create( void OpenAPI_npn_access_info_free(OpenAPI_npn_access_info_t *npn_access_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == npn_access_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(npn_access_info->cell_cag_info, node) { - ogs_free(node->data); + if (npn_access_info->cell_cag_info) { + OpenAPI_list_for_each(npn_access_info->cell_cag_info, node) { + ogs_free(node->data); + } + OpenAPI_list_free(npn_access_info->cell_cag_info); + npn_access_info->cell_cag_info = NULL; } - OpenAPI_list_free(npn_access_info->cell_cag_info); ogs_free(npn_access_info); } cJSON *OpenAPI_npn_access_info_convertToJSON(OpenAPI_npn_access_info_t *npn_access_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (npn_access_info == NULL) { ogs_error("OpenAPI_npn_access_info_convertToJSON() failed [NpnAccessInfo]"); @@ -40,19 +45,17 @@ cJSON *OpenAPI_npn_access_info_convertToJSON(OpenAPI_npn_access_info_t *npn_acce item = cJSON_CreateObject(); if (npn_access_info->cell_cag_info) { - cJSON *cell_cag_info = cJSON_AddArrayToObject(item, "cellCagInfo"); - if (cell_cag_info == NULL) { + cJSON *cell_cag_infoList = cJSON_AddArrayToObject(item, "cellCagInfo"); + if (cell_cag_infoList == NULL) { ogs_error("OpenAPI_npn_access_info_convertToJSON() failed [cell_cag_info]"); goto end; } - - OpenAPI_lnode_t *cell_cag_info_node; - OpenAPI_list_for_each(npn_access_info->cell_cag_info, cell_cag_info_node) { - if (cJSON_AddStringToObject(cell_cag_info, "", (char*)cell_cag_info_node->data) == NULL) { - ogs_error("OpenAPI_npn_access_info_convertToJSON() failed [cell_cag_info]"); - goto end; + OpenAPI_list_for_each(npn_access_info->cell_cag_info, node) { + if (cJSON_AddStringToObject(cell_cag_infoList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_npn_access_info_convertToJSON() failed [cell_cag_info]"); + goto end; + } } - } } end: @@ -62,24 +65,28 @@ end: OpenAPI_npn_access_info_t *OpenAPI_npn_access_info_parseFromJSON(cJSON *npn_access_infoJSON) { OpenAPI_npn_access_info_t *npn_access_info_local_var = NULL; - cJSON *cell_cag_info = cJSON_GetObjectItemCaseSensitive(npn_access_infoJSON, "cellCagInfo"); - - OpenAPI_list_t *cell_cag_infoList; + OpenAPI_lnode_t *node = NULL; + cJSON *cell_cag_info = NULL; + OpenAPI_list_t *cell_cag_infoList = NULL; + cell_cag_info = cJSON_GetObjectItemCaseSensitive(npn_access_infoJSON, "cellCagInfo"); if (cell_cag_info) { - cJSON *cell_cag_info_local; - if (!cJSON_IsArray(cell_cag_info)) { - ogs_error("OpenAPI_npn_access_info_parseFromJSON() failed [cell_cag_info]"); - goto end; - } - cell_cag_infoList = OpenAPI_list_create(); + cJSON *cell_cag_info_local = NULL; + if (!cJSON_IsArray(cell_cag_info)) { + ogs_error("OpenAPI_npn_access_info_parseFromJSON() failed [cell_cag_info]"); + goto end; + } - cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) { - if (!cJSON_IsString(cell_cag_info_local)) { - ogs_error("OpenAPI_npn_access_info_parseFromJSON() failed [cell_cag_info]"); - goto end; - } - OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring)); - } + cell_cag_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(cell_cag_info_local)) { + ogs_error("OpenAPI_npn_access_info_parseFromJSON() failed [cell_cag_info]"); + goto end; + } + OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring)); + } } npn_access_info_local_var = OpenAPI_npn_access_info_create ( @@ -88,6 +95,13 @@ OpenAPI_npn_access_info_t *OpenAPI_npn_access_info_parseFromJSON(cJSON *npn_acce return npn_access_info_local_var; end: + if (cell_cag_infoList) { + OpenAPI_list_for_each(cell_cag_infoList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cell_cag_infoList); + cell_cag_infoList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nr_location.c b/lib/sbi/openapi/model/nr_location.c index 2a95046b7..d2bb5ca83 100644 --- a/lib/sbi/openapi/model/nr_location.c +++ b/lib/sbi/openapi/model/nr_location.c @@ -32,22 +32,42 @@ OpenAPI_nr_location_t *OpenAPI_nr_location_create( void OpenAPI_nr_location_free(OpenAPI_nr_location_t *nr_location) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nr_location) { return; } - OpenAPI_lnode_t *node; - OpenAPI_tai_free(nr_location->tai); - OpenAPI_ncgi_free(nr_location->ncgi); - ogs_free(nr_location->ue_location_timestamp); - ogs_free(nr_location->geographical_information); - ogs_free(nr_location->geodetic_information); - OpenAPI_global_ran_node_id_free(nr_location->global_gnb_id); + if (nr_location->tai) { + OpenAPI_tai_free(nr_location->tai); + nr_location->tai = NULL; + } + if (nr_location->ncgi) { + OpenAPI_ncgi_free(nr_location->ncgi); + nr_location->ncgi = NULL; + } + if (nr_location->ue_location_timestamp) { + ogs_free(nr_location->ue_location_timestamp); + nr_location->ue_location_timestamp = NULL; + } + if (nr_location->geographical_information) { + ogs_free(nr_location->geographical_information); + nr_location->geographical_information = NULL; + } + if (nr_location->geodetic_information) { + ogs_free(nr_location->geodetic_information); + nr_location->geodetic_information = NULL; + } + if (nr_location->global_gnb_id) { + OpenAPI_global_ran_node_id_free(nr_location->global_gnb_id); + nr_location->global_gnb_id = NULL; + } ogs_free(nr_location); } cJSON *OpenAPI_nr_location_convertToJSON(OpenAPI_nr_location_t *nr_location) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nr_location == NULL) { ogs_error("OpenAPI_nr_location_convertToJSON() failed [NrLocation]"); @@ -55,6 +75,10 @@ cJSON *OpenAPI_nr_location_convertToJSON(OpenAPI_nr_location_t *nr_location) } item = cJSON_CreateObject(); + if (!nr_location->tai) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [tai]"); + return NULL; + } cJSON *tai_local_JSON = OpenAPI_tai_convertToJSON(nr_location->tai); if (tai_local_JSON == NULL) { ogs_error("OpenAPI_nr_location_convertToJSON() failed [tai]"); @@ -66,6 +90,10 @@ cJSON *OpenAPI_nr_location_convertToJSON(OpenAPI_nr_location_t *nr_location) goto end; } + if (!nr_location->ncgi) { + ogs_error("OpenAPI_nr_location_convertToJSON() failed [ncgi]"); + return NULL; + } cJSON *ncgi_local_JSON = OpenAPI_ncgi_convertToJSON(nr_location->ncgi); if (ncgi_local_JSON == NULL) { ogs_error("OpenAPI_nr_location_convertToJSON() failed [ncgi]"); @@ -125,26 +153,32 @@ end: OpenAPI_nr_location_t *OpenAPI_nr_location_parseFromJSON(cJSON *nr_locationJSON) { OpenAPI_nr_location_t *nr_location_local_var = NULL; - cJSON *tai = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "tai"); + OpenAPI_lnode_t *node = NULL; + cJSON *tai = NULL; + OpenAPI_tai_t *tai_local_nonprim = NULL; + cJSON *ncgi = NULL; + OpenAPI_ncgi_t *ncgi_local_nonprim = NULL; + cJSON *age_of_location_information = NULL; + cJSON *ue_location_timestamp = NULL; + cJSON *geographical_information = NULL; + cJSON *geodetic_information = NULL; + cJSON *global_gnb_id = NULL; + OpenAPI_global_ran_node_id_t *global_gnb_id_local_nonprim = NULL; + tai = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "tai"); if (!tai) { ogs_error("OpenAPI_nr_location_parseFromJSON() failed [tai]"); goto end; } - - OpenAPI_tai_t *tai_local_nonprim = NULL; tai_local_nonprim = OpenAPI_tai_parseFromJSON(tai); - cJSON *ncgi = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ncgi"); + ncgi = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ncgi"); if (!ncgi) { ogs_error("OpenAPI_nr_location_parseFromJSON() failed [ncgi]"); goto end; } - - OpenAPI_ncgi_t *ncgi_local_nonprim = NULL; ncgi_local_nonprim = OpenAPI_ncgi_parseFromJSON(ncgi); - cJSON *age_of_location_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ageOfLocationInformation"); - + age_of_location_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ageOfLocationInformation"); if (age_of_location_information) { if (!cJSON_IsNumber(age_of_location_information)) { ogs_error("OpenAPI_nr_location_parseFromJSON() failed [age_of_location_information]"); @@ -152,36 +186,31 @@ OpenAPI_nr_location_t *OpenAPI_nr_location_parseFromJSON(cJSON *nr_locationJSON) } } - cJSON *ue_location_timestamp = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ueLocationTimestamp"); - + ue_location_timestamp = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "ueLocationTimestamp"); if (ue_location_timestamp) { - if (!cJSON_IsString(ue_location_timestamp)) { + if (!cJSON_IsString(ue_location_timestamp) && !cJSON_IsNull(ue_location_timestamp)) { ogs_error("OpenAPI_nr_location_parseFromJSON() failed [ue_location_timestamp]"); goto end; } } - cJSON *geographical_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "geographicalInformation"); - + geographical_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "geographicalInformation"); if (geographical_information) { - if (!cJSON_IsString(geographical_information)) { + if (!cJSON_IsString(geographical_information) && !cJSON_IsNull(geographical_information)) { ogs_error("OpenAPI_nr_location_parseFromJSON() failed [geographical_information]"); goto end; } } - cJSON *geodetic_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "geodeticInformation"); - + geodetic_information = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "geodeticInformation"); if (geodetic_information) { - if (!cJSON_IsString(geodetic_information)) { + if (!cJSON_IsString(geodetic_information) && !cJSON_IsNull(geodetic_information)) { ogs_error("OpenAPI_nr_location_parseFromJSON() failed [geodetic_information]"); goto end; } } - cJSON *global_gnb_id = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "globalGnbId"); - - OpenAPI_global_ran_node_id_t *global_gnb_id_local_nonprim = NULL; + global_gnb_id = cJSON_GetObjectItemCaseSensitive(nr_locationJSON, "globalGnbId"); if (global_gnb_id) { global_gnb_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(global_gnb_id); } @@ -191,14 +220,26 @@ OpenAPI_nr_location_t *OpenAPI_nr_location_parseFromJSON(cJSON *nr_locationJSON) ncgi_local_nonprim, age_of_location_information ? true : false, age_of_location_information ? age_of_location_information->valuedouble : 0, - ue_location_timestamp ? ogs_strdup(ue_location_timestamp->valuestring) : NULL, - geographical_information ? ogs_strdup(geographical_information->valuestring) : NULL, - geodetic_information ? ogs_strdup(geodetic_information->valuestring) : NULL, + ue_location_timestamp && !cJSON_IsNull(ue_location_timestamp) ? ogs_strdup(ue_location_timestamp->valuestring) : NULL, + geographical_information && !cJSON_IsNull(geographical_information) ? ogs_strdup(geographical_information->valuestring) : NULL, + geodetic_information && !cJSON_IsNull(geodetic_information) ? ogs_strdup(geodetic_information->valuestring) : NULL, global_gnb_id ? global_gnb_id_local_nonprim : NULL ); return nr_location_local_var; end: + if (tai_local_nonprim) { + OpenAPI_tai_free(tai_local_nonprim); + tai_local_nonprim = NULL; + } + if (ncgi_local_nonprim) { + OpenAPI_ncgi_free(ncgi_local_nonprim); + ncgi_local_nonprim = NULL; + } + if (global_gnb_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(global_gnb_id_local_nonprim); + global_gnb_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nr_v2x_auth.c b/lib/sbi/openapi/model/nr_v2x_auth.c index 6dc64bbf9..de165bcf9 100644 --- a/lib/sbi/openapi/model/nr_v2x_auth.c +++ b/lib/sbi/openapi/model/nr_v2x_auth.c @@ -20,16 +20,18 @@ OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_create( void OpenAPI_nr_v2x_auth_free(OpenAPI_nr_v2x_auth_t *nr_v2x_auth) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nr_v2x_auth) { return; } - OpenAPI_lnode_t *node; ogs_free(nr_v2x_auth); } cJSON *OpenAPI_nr_v2x_auth_convertToJSON(OpenAPI_nr_v2x_auth_t *nr_v2x_auth) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nr_v2x_auth == NULL) { ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [NrV2xAuth]"); @@ -37,14 +39,14 @@ cJSON *OpenAPI_nr_v2x_auth_convertToJSON(OpenAPI_nr_v2x_auth_t *nr_v2x_auth) } item = cJSON_CreateObject(); - if (nr_v2x_auth->vehicle_ue_auth) { + if (nr_v2x_auth->vehicle_ue_auth != OpenAPI_ue_auth_NULL) { if (cJSON_AddStringToObject(item, "vehicleUeAuth", OpenAPI_ue_auth_ToString(nr_v2x_auth->vehicle_ue_auth)) == NULL) { ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [vehicle_ue_auth]"); goto end; } } - if (nr_v2x_auth->pedestrian_ue_auth) { + if (nr_v2x_auth->pedestrian_ue_auth != OpenAPI_ue_auth_NULL) { if (cJSON_AddStringToObject(item, "pedestrianUeAuth", OpenAPI_ue_auth_ToString(nr_v2x_auth->pedestrian_ue_auth)) == NULL) { ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]"); goto end; @@ -58,9 +60,12 @@ end: OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_parseFromJSON(cJSON *nr_v2x_authJSON) { OpenAPI_nr_v2x_auth_t *nr_v2x_auth_local_var = NULL; - cJSON *vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "vehicleUeAuth"); - - OpenAPI_ue_auth_e vehicle_ue_authVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *vehicle_ue_auth = NULL; + OpenAPI_ue_auth_e vehicle_ue_authVariable = 0; + cJSON *pedestrian_ue_auth = NULL; + OpenAPI_ue_auth_e pedestrian_ue_authVariable = 0; + vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "vehicleUeAuth"); if (vehicle_ue_auth) { if (!cJSON_IsString(vehicle_ue_auth)) { ogs_error("OpenAPI_nr_v2x_auth_parseFromJSON() failed [vehicle_ue_auth]"); @@ -69,9 +74,7 @@ OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_parseFromJSON(cJSON *nr_v2x_authJSON) vehicle_ue_authVariable = OpenAPI_ue_auth_FromString(vehicle_ue_auth->valuestring); } - cJSON *pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "pedestrianUeAuth"); - - OpenAPI_ue_auth_e pedestrian_ue_authVariable; + pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "pedestrianUeAuth"); if (pedestrian_ue_auth) { if (!cJSON_IsString(pedestrian_ue_auth)) { ogs_error("OpenAPI_nr_v2x_auth_parseFromJSON() failed [pedestrian_ue_auth]"); diff --git a/lib/sbi/openapi/model/nr_v2x_auth_1.c b/lib/sbi/openapi/model/nr_v2x_auth_1.c index cd7df49b7..7ecc4ceb9 100644 --- a/lib/sbi/openapi/model/nr_v2x_auth_1.c +++ b/lib/sbi/openapi/model/nr_v2x_auth_1.c @@ -20,16 +20,18 @@ OpenAPI_nr_v2x_auth_1_t *OpenAPI_nr_v2x_auth_1_create( void OpenAPI_nr_v2x_auth_1_free(OpenAPI_nr_v2x_auth_1_t *nr_v2x_auth_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nr_v2x_auth_1) { return; } - OpenAPI_lnode_t *node; ogs_free(nr_v2x_auth_1); } cJSON *OpenAPI_nr_v2x_auth_1_convertToJSON(OpenAPI_nr_v2x_auth_1_t *nr_v2x_auth_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nr_v2x_auth_1 == NULL) { ogs_error("OpenAPI_nr_v2x_auth_1_convertToJSON() failed [NrV2xAuth_1]"); @@ -37,14 +39,14 @@ cJSON *OpenAPI_nr_v2x_auth_1_convertToJSON(OpenAPI_nr_v2x_auth_1_t *nr_v2x_auth_ } item = cJSON_CreateObject(); - if (nr_v2x_auth_1->vehicle_ue_auth) { + if (nr_v2x_auth_1->vehicle_ue_auth != OpenAPI_ue_auth_NULL) { if (cJSON_AddStringToObject(item, "vehicleUeAuth", OpenAPI_ue_auth_ToString(nr_v2x_auth_1->vehicle_ue_auth)) == NULL) { ogs_error("OpenAPI_nr_v2x_auth_1_convertToJSON() failed [vehicle_ue_auth]"); goto end; } } - if (nr_v2x_auth_1->pedestrian_ue_auth) { + if (nr_v2x_auth_1->pedestrian_ue_auth != OpenAPI_ue_auth_NULL) { if (cJSON_AddStringToObject(item, "pedestrianUeAuth", OpenAPI_ue_auth_ToString(nr_v2x_auth_1->pedestrian_ue_auth)) == NULL) { ogs_error("OpenAPI_nr_v2x_auth_1_convertToJSON() failed [pedestrian_ue_auth]"); goto end; @@ -58,9 +60,12 @@ end: OpenAPI_nr_v2x_auth_1_t *OpenAPI_nr_v2x_auth_1_parseFromJSON(cJSON *nr_v2x_auth_1JSON) { OpenAPI_nr_v2x_auth_1_t *nr_v2x_auth_1_local_var = NULL; - cJSON *vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_auth_1JSON, "vehicleUeAuth"); - - OpenAPI_ue_auth_e vehicle_ue_authVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *vehicle_ue_auth = NULL; + OpenAPI_ue_auth_e vehicle_ue_authVariable = 0; + cJSON *pedestrian_ue_auth = NULL; + OpenAPI_ue_auth_e pedestrian_ue_authVariable = 0; + vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_auth_1JSON, "vehicleUeAuth"); if (vehicle_ue_auth) { if (!cJSON_IsString(vehicle_ue_auth)) { ogs_error("OpenAPI_nr_v2x_auth_1_parseFromJSON() failed [vehicle_ue_auth]"); @@ -69,9 +74,7 @@ OpenAPI_nr_v2x_auth_1_t *OpenAPI_nr_v2x_auth_1_parseFromJSON(cJSON *nr_v2x_auth_ vehicle_ue_authVariable = OpenAPI_ue_auth_FromString(vehicle_ue_auth->valuestring); } - cJSON *pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_auth_1JSON, "pedestrianUeAuth"); - - OpenAPI_ue_auth_e pedestrian_ue_authVariable; + pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_auth_1JSON, "pedestrianUeAuth"); if (pedestrian_ue_auth) { if (!cJSON_IsString(pedestrian_ue_auth)) { ogs_error("OpenAPI_nr_v2x_auth_1_parseFromJSON() failed [pedestrian_ue_auth]"); diff --git a/lib/sbi/openapi/model/nrf_info.c b/lib/sbi/openapi/model/nrf_info.c index 1ee481a2b..4bf9e64ec 100644 --- a/lib/sbi/openapi/model/nrf_info.c +++ b/lib/sbi/openapi/model/nrf_info.c @@ -72,212 +72,298 @@ OpenAPI_nrf_info_t *OpenAPI_nrf_info_create( void OpenAPI_nrf_info_free(OpenAPI_nrf_info_t *nrf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nrf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(nrf_info->served_udr_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_udr_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_udr_info) { + OpenAPI_list_for_each(nrf_info->served_udr_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_udr_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_udr_info); + nrf_info->served_udr_info = NULL; } - OpenAPI_list_free(nrf_info->served_udr_info); - OpenAPI_list_for_each(nrf_info->served_udr_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_udr_info_list) { + OpenAPI_list_for_each(nrf_info->served_udr_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_udr_info_list); + nrf_info->served_udr_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_udr_info_list); - OpenAPI_list_for_each(nrf_info->served_udm_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_udm_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_udm_info) { + OpenAPI_list_for_each(nrf_info->served_udm_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_udm_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_udm_info); + nrf_info->served_udm_info = NULL; } - OpenAPI_list_free(nrf_info->served_udm_info); - OpenAPI_list_for_each(nrf_info->served_udm_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_udm_info_list) { + OpenAPI_list_for_each(nrf_info->served_udm_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_udm_info_list); + nrf_info->served_udm_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_udm_info_list); - OpenAPI_list_for_each(nrf_info->served_ausf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_ausf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_ausf_info) { + OpenAPI_list_for_each(nrf_info->served_ausf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_ausf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_ausf_info); + nrf_info->served_ausf_info = NULL; } - OpenAPI_list_free(nrf_info->served_ausf_info); - OpenAPI_list_for_each(nrf_info->served_ausf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_ausf_info_list) { + OpenAPI_list_for_each(nrf_info->served_ausf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_ausf_info_list); + nrf_info->served_ausf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_ausf_info_list); - OpenAPI_list_for_each(nrf_info->served_amf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_amf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_amf_info) { + OpenAPI_list_for_each(nrf_info->served_amf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_amf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_amf_info); + nrf_info->served_amf_info = NULL; } - OpenAPI_list_free(nrf_info->served_amf_info); - OpenAPI_list_for_each(nrf_info->served_amf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_amf_info_list) { + OpenAPI_list_for_each(nrf_info->served_amf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_amf_info_list); + nrf_info->served_amf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_amf_info_list); - OpenAPI_list_for_each(nrf_info->served_smf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_smf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_smf_info) { + OpenAPI_list_for_each(nrf_info->served_smf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_smf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_smf_info); + nrf_info->served_smf_info = NULL; } - OpenAPI_list_free(nrf_info->served_smf_info); - OpenAPI_list_for_each(nrf_info->served_smf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_smf_info_list) { + OpenAPI_list_for_each(nrf_info->served_smf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_smf_info_list); + nrf_info->served_smf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_smf_info_list); - OpenAPI_list_for_each(nrf_info->served_upf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_upf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_upf_info) { + OpenAPI_list_for_each(nrf_info->served_upf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_upf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_upf_info); + nrf_info->served_upf_info = NULL; } - OpenAPI_list_free(nrf_info->served_upf_info); - OpenAPI_list_for_each(nrf_info->served_upf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_upf_info_list) { + OpenAPI_list_for_each(nrf_info->served_upf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_upf_info_list); + nrf_info->served_upf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_upf_info_list); - OpenAPI_list_for_each(nrf_info->served_pcf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_pcf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_pcf_info) { + OpenAPI_list_for_each(nrf_info->served_pcf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_pcf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_pcf_info); + nrf_info->served_pcf_info = NULL; } - OpenAPI_list_free(nrf_info->served_pcf_info); - OpenAPI_list_for_each(nrf_info->served_pcf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_pcf_info_list) { + OpenAPI_list_for_each(nrf_info->served_pcf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_pcf_info_list); + nrf_info->served_pcf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_pcf_info_list); - OpenAPI_list_for_each(nrf_info->served_bsf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_bsf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_bsf_info) { + OpenAPI_list_for_each(nrf_info->served_bsf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_bsf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_bsf_info); + nrf_info->served_bsf_info = NULL; } - OpenAPI_list_free(nrf_info->served_bsf_info); - OpenAPI_list_for_each(nrf_info->served_bsf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_bsf_info_list) { + OpenAPI_list_for_each(nrf_info->served_bsf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_bsf_info_list); + nrf_info->served_bsf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_bsf_info_list); - OpenAPI_list_for_each(nrf_info->served_chf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_chf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_chf_info) { + OpenAPI_list_for_each(nrf_info->served_chf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_chf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_chf_info); + nrf_info->served_chf_info = NULL; } - OpenAPI_list_free(nrf_info->served_chf_info); - OpenAPI_list_for_each(nrf_info->served_chf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_chf_info_list) { + OpenAPI_list_for_each(nrf_info->served_chf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_chf_info_list); + nrf_info->served_chf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_chf_info_list); - OpenAPI_list_for_each(nrf_info->served_nef_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_nef_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_nef_info) { + OpenAPI_list_for_each(nrf_info->served_nef_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_nef_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_nef_info); + nrf_info->served_nef_info = NULL; } - OpenAPI_list_free(nrf_info->served_nef_info); - OpenAPI_list_for_each(nrf_info->served_nwdaf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_nwdaf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_nwdaf_info) { + OpenAPI_list_for_each(nrf_info->served_nwdaf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_nwdaf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_nwdaf_info); + nrf_info->served_nwdaf_info = NULL; } - OpenAPI_list_free(nrf_info->served_nwdaf_info); - OpenAPI_list_for_each(nrf_info->served_pcscf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_pcscf_info_list) { + OpenAPI_list_for_each(nrf_info->served_pcscf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_pcscf_info_list); + nrf_info->served_pcscf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_pcscf_info_list); - OpenAPI_list_for_each(nrf_info->served_gmlc_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_gmlc_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_gmlc_info) { + OpenAPI_list_for_each(nrf_info->served_gmlc_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_gmlc_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_gmlc_info); + nrf_info->served_gmlc_info = NULL; } - OpenAPI_list_free(nrf_info->served_gmlc_info); - OpenAPI_list_for_each(nrf_info->served_lmf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_lmf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_lmf_info) { + OpenAPI_list_for_each(nrf_info->served_lmf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_lmf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_lmf_info); + nrf_info->served_lmf_info = NULL; } - OpenAPI_list_free(nrf_info->served_lmf_info); - OpenAPI_list_for_each(nrf_info->served_nf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_nf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_nf_info) { + OpenAPI_list_for_each(nrf_info->served_nf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_nf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_nf_info); + nrf_info->served_nf_info = NULL; } - OpenAPI_list_free(nrf_info->served_nf_info); - OpenAPI_list_for_each(nrf_info->served_hss_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_hss_info_list) { + OpenAPI_list_for_each(nrf_info->served_hss_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_hss_info_list); + nrf_info->served_hss_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_hss_info_list); - OpenAPI_list_for_each(nrf_info->served_udsf_info, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_udsf_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_udsf_info) { + OpenAPI_list_for_each(nrf_info->served_udsf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_udsf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_udsf_info); + nrf_info->served_udsf_info = NULL; } - OpenAPI_list_free(nrf_info->served_udsf_info); - OpenAPI_list_for_each(nrf_info->served_udsf_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_udsf_info_list) { + OpenAPI_list_for_each(nrf_info->served_udsf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_udsf_info_list); + nrf_info->served_udsf_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_udsf_info_list); - OpenAPI_list_for_each(nrf_info->served_scp_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_scp_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nrf_info->served_scp_info_list) { + OpenAPI_list_for_each(nrf_info->served_scp_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_scp_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nrf_info->served_scp_info_list); + nrf_info->served_scp_info_list = NULL; } - OpenAPI_list_free(nrf_info->served_scp_info_list); ogs_free(nrf_info); } cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nrf_info == NULL) { ogs_error("OpenAPI_nrf_info_convertToJSON() failed [NrfInfo]"); @@ -292,21 +378,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_udr_info; - OpenAPI_lnode_t *served_udr_info_node; if (nrf_info->served_udr_info) { - OpenAPI_list_for_each(nrf_info->served_udr_info, served_udr_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_udr_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udr_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_udr_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udr_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_udr_info_list) { cJSON *served_udr_info_list = cJSON_AddObjectToObject(item, "servedUdrInfoList"); @@ -315,21 +400,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_udr_info_list; - OpenAPI_lnode_t *served_udr_info_list_node; if (nrf_info->served_udr_info_list) { - OpenAPI_list_for_each(nrf_info->served_udr_info_list, served_udr_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_udr_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udr_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_udr_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udr_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_udm_info) { cJSON *served_udm_info = cJSON_AddObjectToObject(item, "servedUdmInfo"); @@ -338,21 +422,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_udm_info; - OpenAPI_lnode_t *served_udm_info_node; if (nrf_info->served_udm_info) { - OpenAPI_list_for_each(nrf_info->served_udm_info, served_udm_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_udm_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udm_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_udm_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udm_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_udm_info_list) { cJSON *served_udm_info_list = cJSON_AddObjectToObject(item, "servedUdmInfoList"); @@ -361,21 +444,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_udm_info_list; - OpenAPI_lnode_t *served_udm_info_list_node; if (nrf_info->served_udm_info_list) { - OpenAPI_list_for_each(nrf_info->served_udm_info_list, served_udm_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_udm_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udm_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_udm_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udm_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_ausf_info) { cJSON *served_ausf_info = cJSON_AddObjectToObject(item, "servedAusfInfo"); @@ -384,21 +466,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_ausf_info; - OpenAPI_lnode_t *served_ausf_info_node; if (nrf_info->served_ausf_info) { - OpenAPI_list_for_each(nrf_info->served_ausf_info, served_ausf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_ausf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_ausf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_ausf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_ausf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_ausf_info_list) { cJSON *served_ausf_info_list = cJSON_AddObjectToObject(item, "servedAusfInfoList"); @@ -407,21 +488,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_ausf_info_list; - OpenAPI_lnode_t *served_ausf_info_list_node; if (nrf_info->served_ausf_info_list) { - OpenAPI_list_for_each(nrf_info->served_ausf_info_list, served_ausf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_ausf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_ausf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_ausf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_ausf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_amf_info) { cJSON *served_amf_info = cJSON_AddObjectToObject(item, "servedAmfInfo"); @@ -430,21 +510,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_amf_info; - OpenAPI_lnode_t *served_amf_info_node; if (nrf_info->served_amf_info) { - OpenAPI_list_for_each(nrf_info->served_amf_info, served_amf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_amf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_amf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_amf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_amf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_amf_info_list) { cJSON *served_amf_info_list = cJSON_AddObjectToObject(item, "servedAmfInfoList"); @@ -453,21 +532,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_amf_info_list; - OpenAPI_lnode_t *served_amf_info_list_node; if (nrf_info->served_amf_info_list) { - OpenAPI_list_for_each(nrf_info->served_amf_info_list, served_amf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_amf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_amf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_amf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_amf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_smf_info) { cJSON *served_smf_info = cJSON_AddObjectToObject(item, "servedSmfInfo"); @@ -476,21 +554,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_smf_info; - OpenAPI_lnode_t *served_smf_info_node; if (nrf_info->served_smf_info) { - OpenAPI_list_for_each(nrf_info->served_smf_info, served_smf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_smf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_smf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_smf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_smf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_smf_info_list) { cJSON *served_smf_info_list = cJSON_AddObjectToObject(item, "servedSmfInfoList"); @@ -499,21 +576,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_smf_info_list; - OpenAPI_lnode_t *served_smf_info_list_node; if (nrf_info->served_smf_info_list) { - OpenAPI_list_for_each(nrf_info->served_smf_info_list, served_smf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_smf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_smf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_smf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_smf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_upf_info) { cJSON *served_upf_info = cJSON_AddObjectToObject(item, "servedUpfInfo"); @@ -522,21 +598,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_upf_info; - OpenAPI_lnode_t *served_upf_info_node; if (nrf_info->served_upf_info) { - OpenAPI_list_for_each(nrf_info->served_upf_info, served_upf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_upf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_upf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_upf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_upf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_upf_info_list) { cJSON *served_upf_info_list = cJSON_AddObjectToObject(item, "servedUpfInfoList"); @@ -545,21 +620,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_upf_info_list; - OpenAPI_lnode_t *served_upf_info_list_node; if (nrf_info->served_upf_info_list) { - OpenAPI_list_for_each(nrf_info->served_upf_info_list, served_upf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_upf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_upf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_upf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_upf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_pcf_info) { cJSON *served_pcf_info = cJSON_AddObjectToObject(item, "servedPcfInfo"); @@ -568,21 +642,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_pcf_info; - OpenAPI_lnode_t *served_pcf_info_node; if (nrf_info->served_pcf_info) { - OpenAPI_list_for_each(nrf_info->served_pcf_info, served_pcf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_pcf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_pcf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_pcf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_pcf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_pcf_info_list) { cJSON *served_pcf_info_list = cJSON_AddObjectToObject(item, "servedPcfInfoList"); @@ -591,21 +664,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_pcf_info_list; - OpenAPI_lnode_t *served_pcf_info_list_node; if (nrf_info->served_pcf_info_list) { - OpenAPI_list_for_each(nrf_info->served_pcf_info_list, served_pcf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_pcf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_pcf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_pcf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_pcf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_bsf_info) { cJSON *served_bsf_info = cJSON_AddObjectToObject(item, "servedBsfInfo"); @@ -614,21 +686,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_bsf_info; - OpenAPI_lnode_t *served_bsf_info_node; if (nrf_info->served_bsf_info) { - OpenAPI_list_for_each(nrf_info->served_bsf_info, served_bsf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_bsf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_bsf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_bsf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_bsf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_bsf_info_list) { cJSON *served_bsf_info_list = cJSON_AddObjectToObject(item, "servedBsfInfoList"); @@ -637,21 +708,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_bsf_info_list; - OpenAPI_lnode_t *served_bsf_info_list_node; if (nrf_info->served_bsf_info_list) { - OpenAPI_list_for_each(nrf_info->served_bsf_info_list, served_bsf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_bsf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_bsf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_bsf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_bsf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_chf_info) { cJSON *served_chf_info = cJSON_AddObjectToObject(item, "servedChfInfo"); @@ -660,21 +730,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_chf_info; - OpenAPI_lnode_t *served_chf_info_node; if (nrf_info->served_chf_info) { - OpenAPI_list_for_each(nrf_info->served_chf_info, served_chf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_chf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_chf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_chf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_chf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_chf_info_list) { cJSON *served_chf_info_list = cJSON_AddObjectToObject(item, "servedChfInfoList"); @@ -683,21 +752,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_chf_info_list; - OpenAPI_lnode_t *served_chf_info_list_node; if (nrf_info->served_chf_info_list) { - OpenAPI_list_for_each(nrf_info->served_chf_info_list, served_chf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_chf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_chf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_chf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_chf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_nef_info) { cJSON *served_nef_info = cJSON_AddObjectToObject(item, "servedNefInfo"); @@ -706,21 +774,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_nef_info; - OpenAPI_lnode_t *served_nef_info_node; if (nrf_info->served_nef_info) { - OpenAPI_list_for_each(nrf_info->served_nef_info, served_nef_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_nef_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_nef_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_nef_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_nef_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_nwdaf_info) { cJSON *served_nwdaf_info = cJSON_AddObjectToObject(item, "servedNwdafInfo"); @@ -729,21 +796,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_nwdaf_info; - OpenAPI_lnode_t *served_nwdaf_info_node; if (nrf_info->served_nwdaf_info) { - OpenAPI_list_for_each(nrf_info->served_nwdaf_info, served_nwdaf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_nwdaf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_nwdaf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_nwdaf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_nwdaf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_pcscf_info_list) { cJSON *served_pcscf_info_list = cJSON_AddObjectToObject(item, "servedPcscfInfoList"); @@ -752,21 +818,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_pcscf_info_list; - OpenAPI_lnode_t *served_pcscf_info_list_node; if (nrf_info->served_pcscf_info_list) { - OpenAPI_list_for_each(nrf_info->served_pcscf_info_list, served_pcscf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_pcscf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_pcscf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_pcscf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_pcscf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_gmlc_info) { cJSON *served_gmlc_info = cJSON_AddObjectToObject(item, "servedGmlcInfo"); @@ -775,21 +840,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_gmlc_info; - OpenAPI_lnode_t *served_gmlc_info_node; if (nrf_info->served_gmlc_info) { - OpenAPI_list_for_each(nrf_info->served_gmlc_info, served_gmlc_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_gmlc_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_gmlc_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_gmlc_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_gmlc_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_lmf_info) { cJSON *served_lmf_info = cJSON_AddObjectToObject(item, "servedLmfInfo"); @@ -798,21 +862,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_lmf_info; - OpenAPI_lnode_t *served_lmf_info_node; if (nrf_info->served_lmf_info) { - OpenAPI_list_for_each(nrf_info->served_lmf_info, served_lmf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_lmf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_lmf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_lmf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_lmf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_nf_info) { cJSON *served_nf_info = cJSON_AddObjectToObject(item, "servedNfInfo"); @@ -821,21 +884,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_nf_info; - OpenAPI_lnode_t *served_nf_info_node; if (nrf_info->served_nf_info) { - OpenAPI_list_for_each(nrf_info->served_nf_info, served_nf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_nf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_nf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_nf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_nf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_hss_info_list) { cJSON *served_hss_info_list = cJSON_AddObjectToObject(item, "servedHssInfoList"); @@ -844,21 +906,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_hss_info_list; - OpenAPI_lnode_t *served_hss_info_list_node; if (nrf_info->served_hss_info_list) { - OpenAPI_list_for_each(nrf_info->served_hss_info_list, served_hss_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_hss_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_hss_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_hss_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_hss_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_udsf_info) { cJSON *served_udsf_info = cJSON_AddObjectToObject(item, "servedUdsfInfo"); @@ -867,21 +928,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_udsf_info; - OpenAPI_lnode_t *served_udsf_info_node; if (nrf_info->served_udsf_info) { - OpenAPI_list_for_each(nrf_info->served_udsf_info, served_udsf_info_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_udsf_info_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udsf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_udsf_info, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udsf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_udsf_info_list) { cJSON *served_udsf_info_list = cJSON_AddObjectToObject(item, "servedUdsfInfoList"); @@ -890,21 +950,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_udsf_info_list; - OpenAPI_lnode_t *served_udsf_info_list_node; if (nrf_info->served_udsf_info_list) { - OpenAPI_list_for_each(nrf_info->served_udsf_info_list, served_udsf_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_udsf_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_udsf_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_udsf_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_udsf_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (nrf_info->served_scp_info_list) { cJSON *served_scp_info_list = cJSON_AddObjectToObject(item, "servedScpInfoList"); @@ -913,21 +972,20 @@ cJSON *OpenAPI_nrf_info_convertToJSON(OpenAPI_nrf_info_t *nrf_info) goto end; } cJSON *localMapObject = served_scp_info_list; - OpenAPI_lnode_t *served_scp_info_list_node; if (nrf_info->served_scp_info_list) { - OpenAPI_list_for_each(nrf_info->served_scp_info_list, served_scp_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)served_scp_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_scp_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nrf_info->served_scp_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_scp_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nrf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -936,732 +994,813 @@ end: OpenAPI_nrf_info_t *OpenAPI_nrf_info_parseFromJSON(cJSON *nrf_infoJSON) { OpenAPI_nrf_info_t *nrf_info_local_var = NULL; - cJSON *served_udr_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdrInfo"); - - OpenAPI_list_t *served_udr_infoList; + OpenAPI_lnode_t *node = NULL; + cJSON *served_udr_info = NULL; + OpenAPI_list_t *served_udr_infoList = NULL; + cJSON *served_udr_info_list = NULL; + OpenAPI_list_t *served_udr_info_listList = NULL; + cJSON *served_udm_info = NULL; + OpenAPI_list_t *served_udm_infoList = NULL; + cJSON *served_udm_info_list = NULL; + OpenAPI_list_t *served_udm_info_listList = NULL; + cJSON *served_ausf_info = NULL; + OpenAPI_list_t *served_ausf_infoList = NULL; + cJSON *served_ausf_info_list = NULL; + OpenAPI_list_t *served_ausf_info_listList = NULL; + cJSON *served_amf_info = NULL; + OpenAPI_list_t *served_amf_infoList = NULL; + cJSON *served_amf_info_list = NULL; + OpenAPI_list_t *served_amf_info_listList = NULL; + cJSON *served_smf_info = NULL; + OpenAPI_list_t *served_smf_infoList = NULL; + cJSON *served_smf_info_list = NULL; + OpenAPI_list_t *served_smf_info_listList = NULL; + cJSON *served_upf_info = NULL; + OpenAPI_list_t *served_upf_infoList = NULL; + cJSON *served_upf_info_list = NULL; + OpenAPI_list_t *served_upf_info_listList = NULL; + cJSON *served_pcf_info = NULL; + OpenAPI_list_t *served_pcf_infoList = NULL; + cJSON *served_pcf_info_list = NULL; + OpenAPI_list_t *served_pcf_info_listList = NULL; + cJSON *served_bsf_info = NULL; + OpenAPI_list_t *served_bsf_infoList = NULL; + cJSON *served_bsf_info_list = NULL; + OpenAPI_list_t *served_bsf_info_listList = NULL; + cJSON *served_chf_info = NULL; + OpenAPI_list_t *served_chf_infoList = NULL; + cJSON *served_chf_info_list = NULL; + OpenAPI_list_t *served_chf_info_listList = NULL; + cJSON *served_nef_info = NULL; + OpenAPI_list_t *served_nef_infoList = NULL; + cJSON *served_nwdaf_info = NULL; + OpenAPI_list_t *served_nwdaf_infoList = NULL; + cJSON *served_pcscf_info_list = NULL; + OpenAPI_list_t *served_pcscf_info_listList = NULL; + cJSON *served_gmlc_info = NULL; + OpenAPI_list_t *served_gmlc_infoList = NULL; + cJSON *served_lmf_info = NULL; + OpenAPI_list_t *served_lmf_infoList = NULL; + cJSON *served_nf_info = NULL; + OpenAPI_list_t *served_nf_infoList = NULL; + cJSON *served_hss_info_list = NULL; + OpenAPI_list_t *served_hss_info_listList = NULL; + cJSON *served_udsf_info = NULL; + OpenAPI_list_t *served_udsf_infoList = NULL; + cJSON *served_udsf_info_list = NULL; + OpenAPI_list_t *served_udsf_info_listList = NULL; + cJSON *served_scp_info_list = NULL; + OpenAPI_list_t *served_scp_info_listList = NULL; + served_udr_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdrInfo"); if (served_udr_info) { - cJSON *served_udr_info_local_map; - if (!cJSON_IsObject(served_udr_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udr_info]"); - goto end; - } - served_udr_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_udr_info_local_map, served_udr_info) { - cJSON *localMapObject = served_udr_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udr_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_udr_info_local_map = NULL; + if (!cJSON_IsObject(served_udr_info) && !cJSON_IsNull(served_udr_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udr_info]"); goto end; } - OpenAPI_list_add(served_udr_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_udr_info)) { + served_udr_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_udr_info_local_map, served_udr_info) { + cJSON *localMapObject = served_udr_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udr_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_udr_infoList, localMapKeyPair); + } + } } - cJSON *served_udr_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdrInfoList"); - - OpenAPI_list_t *served_udr_info_listList; + served_udr_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdrInfoList"); if (served_udr_info_list) { - cJSON *served_udr_info_list_local_map; - if (!cJSON_IsObject(served_udr_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udr_info_list]"); - goto end; - } - served_udr_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_udr_info_list_local_map, served_udr_info_list) { - cJSON *localMapObject = served_udr_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udr_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_udr_info_list_local_map = NULL; + if (!cJSON_IsObject(served_udr_info_list) && !cJSON_IsNull(served_udr_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udr_info_list]"); goto end; } - OpenAPI_list_add(served_udr_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_udr_info_list)) { + served_udr_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_udr_info_list_local_map, served_udr_info_list) { + cJSON *localMapObject = served_udr_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udr_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_udr_info_listList, localMapKeyPair); + } + } } - cJSON *served_udm_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdmInfo"); - - OpenAPI_list_t *served_udm_infoList; + served_udm_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdmInfo"); if (served_udm_info) { - cJSON *served_udm_info_local_map; - if (!cJSON_IsObject(served_udm_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udm_info]"); - goto end; - } - served_udm_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_udm_info_local_map, served_udm_info) { - cJSON *localMapObject = served_udm_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udm_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_udm_info_local_map = NULL; + if (!cJSON_IsObject(served_udm_info) && !cJSON_IsNull(served_udm_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udm_info]"); goto end; } - OpenAPI_list_add(served_udm_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_udm_info)) { + served_udm_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_udm_info_local_map, served_udm_info) { + cJSON *localMapObject = served_udm_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udm_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_udm_infoList, localMapKeyPair); + } + } } - cJSON *served_udm_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdmInfoList"); - - OpenAPI_list_t *served_udm_info_listList; + served_udm_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdmInfoList"); if (served_udm_info_list) { - cJSON *served_udm_info_list_local_map; - if (!cJSON_IsObject(served_udm_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udm_info_list]"); - goto end; - } - served_udm_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_udm_info_list_local_map, served_udm_info_list) { - cJSON *localMapObject = served_udm_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udm_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_udm_info_list_local_map = NULL; + if (!cJSON_IsObject(served_udm_info_list) && !cJSON_IsNull(served_udm_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udm_info_list]"); goto end; } - OpenAPI_list_add(served_udm_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_udm_info_list)) { + served_udm_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_udm_info_list_local_map, served_udm_info_list) { + cJSON *localMapObject = served_udm_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udm_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_udm_info_listList, localMapKeyPair); + } + } } - cJSON *served_ausf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedAusfInfo"); - - OpenAPI_list_t *served_ausf_infoList; + served_ausf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedAusfInfo"); if (served_ausf_info) { - cJSON *served_ausf_info_local_map; - if (!cJSON_IsObject(served_ausf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_ausf_info]"); - goto end; - } - served_ausf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_ausf_info_local_map, served_ausf_info) { - cJSON *localMapObject = served_ausf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_ausf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_ausf_info_local_map = NULL; + if (!cJSON_IsObject(served_ausf_info) && !cJSON_IsNull(served_ausf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_ausf_info]"); goto end; } - OpenAPI_list_add(served_ausf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_ausf_info)) { + served_ausf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_ausf_info_local_map, served_ausf_info) { + cJSON *localMapObject = served_ausf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_ausf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_ausf_infoList, localMapKeyPair); + } + } } - cJSON *served_ausf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedAusfInfoList"); - - OpenAPI_list_t *served_ausf_info_listList; + served_ausf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedAusfInfoList"); if (served_ausf_info_list) { - cJSON *served_ausf_info_list_local_map; - if (!cJSON_IsObject(served_ausf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_ausf_info_list]"); - goto end; - } - served_ausf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_ausf_info_list_local_map, served_ausf_info_list) { - cJSON *localMapObject = served_ausf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_ausf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_ausf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_ausf_info_list) && !cJSON_IsNull(served_ausf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_ausf_info_list]"); goto end; } - OpenAPI_list_add(served_ausf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_ausf_info_list)) { + served_ausf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_ausf_info_list_local_map, served_ausf_info_list) { + cJSON *localMapObject = served_ausf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_ausf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_ausf_info_listList, localMapKeyPair); + } + } } - cJSON *served_amf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedAmfInfo"); - - OpenAPI_list_t *served_amf_infoList; + served_amf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedAmfInfo"); if (served_amf_info) { - cJSON *served_amf_info_local_map; - if (!cJSON_IsObject(served_amf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_amf_info]"); - goto end; - } - served_amf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_amf_info_local_map, served_amf_info) { - cJSON *localMapObject = served_amf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_amf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_amf_info_local_map = NULL; + if (!cJSON_IsObject(served_amf_info) && !cJSON_IsNull(served_amf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_amf_info]"); goto end; } - OpenAPI_list_add(served_amf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_amf_info)) { + served_amf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_amf_info_local_map, served_amf_info) { + cJSON *localMapObject = served_amf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_amf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_amf_infoList, localMapKeyPair); + } + } } - cJSON *served_amf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedAmfInfoList"); - - OpenAPI_list_t *served_amf_info_listList; + served_amf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedAmfInfoList"); if (served_amf_info_list) { - cJSON *served_amf_info_list_local_map; - if (!cJSON_IsObject(served_amf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_amf_info_list]"); - goto end; - } - served_amf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_amf_info_list_local_map, served_amf_info_list) { - cJSON *localMapObject = served_amf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_amf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_amf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_amf_info_list) && !cJSON_IsNull(served_amf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_amf_info_list]"); goto end; } - OpenAPI_list_add(served_amf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_amf_info_list)) { + served_amf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_amf_info_list_local_map, served_amf_info_list) { + cJSON *localMapObject = served_amf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_amf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_amf_info_listList, localMapKeyPair); + } + } } - cJSON *served_smf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedSmfInfo"); - - OpenAPI_list_t *served_smf_infoList; + served_smf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedSmfInfo"); if (served_smf_info) { - cJSON *served_smf_info_local_map; - if (!cJSON_IsObject(served_smf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_smf_info]"); - goto end; - } - served_smf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_smf_info_local_map, served_smf_info) { - cJSON *localMapObject = served_smf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_smf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_smf_info_local_map = NULL; + if (!cJSON_IsObject(served_smf_info) && !cJSON_IsNull(served_smf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_smf_info]"); goto end; } - OpenAPI_list_add(served_smf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_smf_info)) { + served_smf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_smf_info_local_map, served_smf_info) { + cJSON *localMapObject = served_smf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_smf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_smf_infoList, localMapKeyPair); + } + } } - cJSON *served_smf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedSmfInfoList"); - - OpenAPI_list_t *served_smf_info_listList; + served_smf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedSmfInfoList"); if (served_smf_info_list) { - cJSON *served_smf_info_list_local_map; - if (!cJSON_IsObject(served_smf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_smf_info_list]"); - goto end; - } - served_smf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_smf_info_list_local_map, served_smf_info_list) { - cJSON *localMapObject = served_smf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_smf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_smf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_smf_info_list) && !cJSON_IsNull(served_smf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_smf_info_list]"); goto end; } - OpenAPI_list_add(served_smf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_smf_info_list)) { + served_smf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_smf_info_list_local_map, served_smf_info_list) { + cJSON *localMapObject = served_smf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_smf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_smf_info_listList, localMapKeyPair); + } + } } - cJSON *served_upf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUpfInfo"); - - OpenAPI_list_t *served_upf_infoList; + served_upf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUpfInfo"); if (served_upf_info) { - cJSON *served_upf_info_local_map; - if (!cJSON_IsObject(served_upf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_upf_info]"); - goto end; - } - served_upf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_upf_info_local_map, served_upf_info) { - cJSON *localMapObject = served_upf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_upf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_upf_info_local_map = NULL; + if (!cJSON_IsObject(served_upf_info) && !cJSON_IsNull(served_upf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_upf_info]"); goto end; } - OpenAPI_list_add(served_upf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_upf_info)) { + served_upf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_upf_info_local_map, served_upf_info) { + cJSON *localMapObject = served_upf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_upf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_upf_infoList, localMapKeyPair); + } + } } - cJSON *served_upf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUpfInfoList"); - - OpenAPI_list_t *served_upf_info_listList; + served_upf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUpfInfoList"); if (served_upf_info_list) { - cJSON *served_upf_info_list_local_map; - if (!cJSON_IsObject(served_upf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_upf_info_list]"); - goto end; - } - served_upf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_upf_info_list_local_map, served_upf_info_list) { - cJSON *localMapObject = served_upf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_upf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_upf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_upf_info_list) && !cJSON_IsNull(served_upf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_upf_info_list]"); goto end; } - OpenAPI_list_add(served_upf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_upf_info_list)) { + served_upf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_upf_info_list_local_map, served_upf_info_list) { + cJSON *localMapObject = served_upf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_upf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_upf_info_listList, localMapKeyPair); + } + } } - cJSON *served_pcf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedPcfInfo"); - - OpenAPI_list_t *served_pcf_infoList; + served_pcf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedPcfInfo"); if (served_pcf_info) { - cJSON *served_pcf_info_local_map; - if (!cJSON_IsObject(served_pcf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_pcf_info]"); - goto end; - } - served_pcf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_pcf_info_local_map, served_pcf_info) { - cJSON *localMapObject = served_pcf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_pcf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_pcf_info_local_map = NULL; + if (!cJSON_IsObject(served_pcf_info) && !cJSON_IsNull(served_pcf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_pcf_info]"); goto end; } - OpenAPI_list_add(served_pcf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_pcf_info)) { + served_pcf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_pcf_info_local_map, served_pcf_info) { + cJSON *localMapObject = served_pcf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_pcf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_pcf_infoList, localMapKeyPair); + } + } } - cJSON *served_pcf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedPcfInfoList"); - - OpenAPI_list_t *served_pcf_info_listList; + served_pcf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedPcfInfoList"); if (served_pcf_info_list) { - cJSON *served_pcf_info_list_local_map; - if (!cJSON_IsObject(served_pcf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_pcf_info_list]"); - goto end; - } - served_pcf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_pcf_info_list_local_map, served_pcf_info_list) { - cJSON *localMapObject = served_pcf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_pcf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_pcf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_pcf_info_list) && !cJSON_IsNull(served_pcf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_pcf_info_list]"); goto end; } - OpenAPI_list_add(served_pcf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_pcf_info_list)) { + served_pcf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_pcf_info_list_local_map, served_pcf_info_list) { + cJSON *localMapObject = served_pcf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_pcf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_pcf_info_listList, localMapKeyPair); + } + } } - cJSON *served_bsf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedBsfInfo"); - - OpenAPI_list_t *served_bsf_infoList; + served_bsf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedBsfInfo"); if (served_bsf_info) { - cJSON *served_bsf_info_local_map; - if (!cJSON_IsObject(served_bsf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_bsf_info]"); - goto end; - } - served_bsf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_bsf_info_local_map, served_bsf_info) { - cJSON *localMapObject = served_bsf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_bsf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_bsf_info_local_map = NULL; + if (!cJSON_IsObject(served_bsf_info) && !cJSON_IsNull(served_bsf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_bsf_info]"); goto end; } - OpenAPI_list_add(served_bsf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_bsf_info)) { + served_bsf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_bsf_info_local_map, served_bsf_info) { + cJSON *localMapObject = served_bsf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_bsf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_bsf_infoList, localMapKeyPair); + } + } } - cJSON *served_bsf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedBsfInfoList"); - - OpenAPI_list_t *served_bsf_info_listList; + served_bsf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedBsfInfoList"); if (served_bsf_info_list) { - cJSON *served_bsf_info_list_local_map; - if (!cJSON_IsObject(served_bsf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_bsf_info_list]"); - goto end; - } - served_bsf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_bsf_info_list_local_map, served_bsf_info_list) { - cJSON *localMapObject = served_bsf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_bsf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_bsf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_bsf_info_list) && !cJSON_IsNull(served_bsf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_bsf_info_list]"); goto end; } - OpenAPI_list_add(served_bsf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_bsf_info_list)) { + served_bsf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_bsf_info_list_local_map, served_bsf_info_list) { + cJSON *localMapObject = served_bsf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_bsf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_bsf_info_listList, localMapKeyPair); + } + } } - cJSON *served_chf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedChfInfo"); - - OpenAPI_list_t *served_chf_infoList; + served_chf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedChfInfo"); if (served_chf_info) { - cJSON *served_chf_info_local_map; - if (!cJSON_IsObject(served_chf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_chf_info]"); - goto end; - } - served_chf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_chf_info_local_map, served_chf_info) { - cJSON *localMapObject = served_chf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_chf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_chf_info_local_map = NULL; + if (!cJSON_IsObject(served_chf_info) && !cJSON_IsNull(served_chf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_chf_info]"); goto end; } - OpenAPI_list_add(served_chf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_chf_info)) { + served_chf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_chf_info_local_map, served_chf_info) { + cJSON *localMapObject = served_chf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_chf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_chf_infoList, localMapKeyPair); + } + } } - cJSON *served_chf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedChfInfoList"); - - OpenAPI_list_t *served_chf_info_listList; + served_chf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedChfInfoList"); if (served_chf_info_list) { - cJSON *served_chf_info_list_local_map; - if (!cJSON_IsObject(served_chf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_chf_info_list]"); - goto end; - } - served_chf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_chf_info_list_local_map, served_chf_info_list) { - cJSON *localMapObject = served_chf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_chf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_chf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_chf_info_list) && !cJSON_IsNull(served_chf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_chf_info_list]"); goto end; } - OpenAPI_list_add(served_chf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_chf_info_list)) { + served_chf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_chf_info_list_local_map, served_chf_info_list) { + cJSON *localMapObject = served_chf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_chf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_chf_info_listList, localMapKeyPair); + } + } } - cJSON *served_nef_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNefInfo"); - - OpenAPI_list_t *served_nef_infoList; + served_nef_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNefInfo"); if (served_nef_info) { - cJSON *served_nef_info_local_map; - if (!cJSON_IsObject(served_nef_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nef_info]"); - goto end; - } - served_nef_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_nef_info_local_map, served_nef_info) { - cJSON *localMapObject = served_nef_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_nef_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_nef_info_local_map = NULL; + if (!cJSON_IsObject(served_nef_info) && !cJSON_IsNull(served_nef_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nef_info]"); goto end; } - OpenAPI_list_add(served_nef_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_nef_info)) { + served_nef_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_nef_info_local_map, served_nef_info) { + cJSON *localMapObject = served_nef_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_nef_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_nef_infoList, localMapKeyPair); + } + } } - cJSON *served_nwdaf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNwdafInfo"); - - OpenAPI_list_t *served_nwdaf_infoList; + served_nwdaf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNwdafInfo"); if (served_nwdaf_info) { - cJSON *served_nwdaf_info_local_map; - if (!cJSON_IsObject(served_nwdaf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nwdaf_info]"); - goto end; - } - served_nwdaf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_nwdaf_info_local_map, served_nwdaf_info) { - cJSON *localMapObject = served_nwdaf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_nwdaf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_nwdaf_info_local_map = NULL; + if (!cJSON_IsObject(served_nwdaf_info) && !cJSON_IsNull(served_nwdaf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nwdaf_info]"); goto end; } - OpenAPI_list_add(served_nwdaf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_nwdaf_info)) { + served_nwdaf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_nwdaf_info_local_map, served_nwdaf_info) { + cJSON *localMapObject = served_nwdaf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_nwdaf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_nwdaf_infoList, localMapKeyPair); + } + } } - cJSON *served_pcscf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedPcscfInfoList"); - - OpenAPI_list_t *served_pcscf_info_listList; + served_pcscf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedPcscfInfoList"); if (served_pcscf_info_list) { - cJSON *served_pcscf_info_list_local_map; - if (!cJSON_IsObject(served_pcscf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_pcscf_info_list]"); - goto end; - } - served_pcscf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_pcscf_info_list_local_map, served_pcscf_info_list) { - cJSON *localMapObject = served_pcscf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_pcscf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_pcscf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_pcscf_info_list) && !cJSON_IsNull(served_pcscf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_pcscf_info_list]"); goto end; } - OpenAPI_list_add(served_pcscf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_pcscf_info_list)) { + served_pcscf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_pcscf_info_list_local_map, served_pcscf_info_list) { + cJSON *localMapObject = served_pcscf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_pcscf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_pcscf_info_listList, localMapKeyPair); + } + } } - cJSON *served_gmlc_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedGmlcInfo"); - - OpenAPI_list_t *served_gmlc_infoList; + served_gmlc_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedGmlcInfo"); if (served_gmlc_info) { - cJSON *served_gmlc_info_local_map; - if (!cJSON_IsObject(served_gmlc_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_gmlc_info]"); - goto end; - } - served_gmlc_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_gmlc_info_local_map, served_gmlc_info) { - cJSON *localMapObject = served_gmlc_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_gmlc_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_gmlc_info_local_map = NULL; + if (!cJSON_IsObject(served_gmlc_info) && !cJSON_IsNull(served_gmlc_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_gmlc_info]"); goto end; } - OpenAPI_list_add(served_gmlc_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_gmlc_info)) { + served_gmlc_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_gmlc_info_local_map, served_gmlc_info) { + cJSON *localMapObject = served_gmlc_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_gmlc_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_gmlc_infoList, localMapKeyPair); + } + } } - cJSON *served_lmf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedLmfInfo"); - - OpenAPI_list_t *served_lmf_infoList; + served_lmf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedLmfInfo"); if (served_lmf_info) { - cJSON *served_lmf_info_local_map; - if (!cJSON_IsObject(served_lmf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_lmf_info]"); - goto end; - } - served_lmf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_lmf_info_local_map, served_lmf_info) { - cJSON *localMapObject = served_lmf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_lmf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_lmf_info_local_map = NULL; + if (!cJSON_IsObject(served_lmf_info) && !cJSON_IsNull(served_lmf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_lmf_info]"); goto end; } - OpenAPI_list_add(served_lmf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_lmf_info)) { + served_lmf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_lmf_info_local_map, served_lmf_info) { + cJSON *localMapObject = served_lmf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_lmf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_lmf_infoList, localMapKeyPair); + } + } } - cJSON *served_nf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNfInfo"); - - OpenAPI_list_t *served_nf_infoList; + served_nf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedNfInfo"); if (served_nf_info) { - cJSON *served_nf_info_local_map; - if (!cJSON_IsObject(served_nf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nf_info]"); - goto end; - } - served_nf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_nf_info_local_map, served_nf_info) { - cJSON *localMapObject = served_nf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_nf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_nf_info_local_map = NULL; + if (!cJSON_IsObject(served_nf_info) && !cJSON_IsNull(served_nf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_nf_info]"); goto end; } - OpenAPI_list_add(served_nf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_nf_info)) { + served_nf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_nf_info_local_map, served_nf_info) { + cJSON *localMapObject = served_nf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_nf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_nf_infoList, localMapKeyPair); + } + } } - cJSON *served_hss_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedHssInfoList"); - - OpenAPI_list_t *served_hss_info_listList; + served_hss_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedHssInfoList"); if (served_hss_info_list) { - cJSON *served_hss_info_list_local_map; - if (!cJSON_IsObject(served_hss_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_hss_info_list]"); - goto end; - } - served_hss_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_hss_info_list_local_map, served_hss_info_list) { - cJSON *localMapObject = served_hss_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_hss_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_hss_info_list_local_map = NULL; + if (!cJSON_IsObject(served_hss_info_list) && !cJSON_IsNull(served_hss_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_hss_info_list]"); goto end; } - OpenAPI_list_add(served_hss_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_hss_info_list)) { + served_hss_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_hss_info_list_local_map, served_hss_info_list) { + cJSON *localMapObject = served_hss_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_hss_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_hss_info_listList, localMapKeyPair); + } + } } - cJSON *served_udsf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdsfInfo"); - - OpenAPI_list_t *served_udsf_infoList; + served_udsf_info = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdsfInfo"); if (served_udsf_info) { - cJSON *served_udsf_info_local_map; - if (!cJSON_IsObject(served_udsf_info)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udsf_info]"); - goto end; - } - served_udsf_infoList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_udsf_info_local_map, served_udsf_info) { - cJSON *localMapObject = served_udsf_info_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udsf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_udsf_info_local_map = NULL; + if (!cJSON_IsObject(served_udsf_info) && !cJSON_IsNull(served_udsf_info)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udsf_info]"); goto end; } - OpenAPI_list_add(served_udsf_infoList, localMapKeyPair); - } + if (cJSON_IsObject(served_udsf_info)) { + served_udsf_infoList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_udsf_info_local_map, served_udsf_info) { + cJSON *localMapObject = served_udsf_info_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udsf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_udsf_infoList, localMapKeyPair); + } + } } - cJSON *served_udsf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdsfInfoList"); - - OpenAPI_list_t *served_udsf_info_listList; + served_udsf_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedUdsfInfoList"); if (served_udsf_info_list) { - cJSON *served_udsf_info_list_local_map; - if (!cJSON_IsObject(served_udsf_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udsf_info_list]"); - goto end; - } - served_udsf_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_udsf_info_list_local_map, served_udsf_info_list) { - cJSON *localMapObject = served_udsf_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_udsf_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_udsf_info_list_local_map = NULL; + if (!cJSON_IsObject(served_udsf_info_list) && !cJSON_IsNull(served_udsf_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_udsf_info_list]"); goto end; } - OpenAPI_list_add(served_udsf_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_udsf_info_list)) { + served_udsf_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_udsf_info_list_local_map, served_udsf_info_list) { + cJSON *localMapObject = served_udsf_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_udsf_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_udsf_info_listList, localMapKeyPair); + } + } } - cJSON *served_scp_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedScpInfoList"); - - OpenAPI_list_t *served_scp_info_listList; + served_scp_info_list = cJSON_GetObjectItemCaseSensitive(nrf_infoJSON, "servedScpInfoList"); if (served_scp_info_list) { - cJSON *served_scp_info_list_local_map; - if (!cJSON_IsObject(served_scp_info_list)) { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_scp_info_list]"); - goto end; - } - served_scp_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(served_scp_info_list_local_map, served_scp_info_list) { - cJSON *localMapObject = served_scp_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_scp_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + cJSON *served_scp_info_list_local_map = NULL; + if (!cJSON_IsObject(served_scp_info_list) && !cJSON_IsNull(served_scp_info_list)) { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [served_scp_info_list]"); goto end; } - OpenAPI_list_add(served_scp_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(served_scp_info_list)) { + served_scp_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(served_scp_info_list_local_map, served_scp_info_list) { + cJSON *localMapObject = served_scp_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_scp_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nrf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(served_scp_info_listList, localMapKeyPair); + } + } } nrf_info_local_var = OpenAPI_nrf_info_create ( @@ -1697,6 +1836,286 @@ OpenAPI_nrf_info_t *OpenAPI_nrf_info_parseFromJSON(cJSON *nrf_infoJSON) return nrf_info_local_var; end: + if (served_udr_infoList) { + OpenAPI_list_for_each(served_udr_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_udr_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_udr_infoList); + served_udr_infoList = NULL; + } + if (served_udr_info_listList) { + OpenAPI_list_for_each(served_udr_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_udr_info_listList); + served_udr_info_listList = NULL; + } + if (served_udm_infoList) { + OpenAPI_list_for_each(served_udm_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_udm_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_udm_infoList); + served_udm_infoList = NULL; + } + if (served_udm_info_listList) { + OpenAPI_list_for_each(served_udm_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_udm_info_listList); + served_udm_info_listList = NULL; + } + if (served_ausf_infoList) { + OpenAPI_list_for_each(served_ausf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_ausf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_ausf_infoList); + served_ausf_infoList = NULL; + } + if (served_ausf_info_listList) { + OpenAPI_list_for_each(served_ausf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_ausf_info_listList); + served_ausf_info_listList = NULL; + } + if (served_amf_infoList) { + OpenAPI_list_for_each(served_amf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_amf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_amf_infoList); + served_amf_infoList = NULL; + } + if (served_amf_info_listList) { + OpenAPI_list_for_each(served_amf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_amf_info_listList); + served_amf_info_listList = NULL; + } + if (served_smf_infoList) { + OpenAPI_list_for_each(served_smf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_smf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_smf_infoList); + served_smf_infoList = NULL; + } + if (served_smf_info_listList) { + OpenAPI_list_for_each(served_smf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_smf_info_listList); + served_smf_info_listList = NULL; + } + if (served_upf_infoList) { + OpenAPI_list_for_each(served_upf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_upf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_upf_infoList); + served_upf_infoList = NULL; + } + if (served_upf_info_listList) { + OpenAPI_list_for_each(served_upf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_upf_info_listList); + served_upf_info_listList = NULL; + } + if (served_pcf_infoList) { + OpenAPI_list_for_each(served_pcf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_pcf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_pcf_infoList); + served_pcf_infoList = NULL; + } + if (served_pcf_info_listList) { + OpenAPI_list_for_each(served_pcf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_pcf_info_listList); + served_pcf_info_listList = NULL; + } + if (served_bsf_infoList) { + OpenAPI_list_for_each(served_bsf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_bsf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_bsf_infoList); + served_bsf_infoList = NULL; + } + if (served_bsf_info_listList) { + OpenAPI_list_for_each(served_bsf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_bsf_info_listList); + served_bsf_info_listList = NULL; + } + if (served_chf_infoList) { + OpenAPI_list_for_each(served_chf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_chf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_chf_infoList); + served_chf_infoList = NULL; + } + if (served_chf_info_listList) { + OpenAPI_list_for_each(served_chf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_chf_info_listList); + served_chf_info_listList = NULL; + } + if (served_nef_infoList) { + OpenAPI_list_for_each(served_nef_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_nef_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_nef_infoList); + served_nef_infoList = NULL; + } + if (served_nwdaf_infoList) { + OpenAPI_list_for_each(served_nwdaf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_nwdaf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_nwdaf_infoList); + served_nwdaf_infoList = NULL; + } + if (served_pcscf_info_listList) { + OpenAPI_list_for_each(served_pcscf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_pcscf_info_listList); + served_pcscf_info_listList = NULL; + } + if (served_gmlc_infoList) { + OpenAPI_list_for_each(served_gmlc_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_gmlc_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_gmlc_infoList); + served_gmlc_infoList = NULL; + } + if (served_lmf_infoList) { + OpenAPI_list_for_each(served_lmf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_lmf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_lmf_infoList); + served_lmf_infoList = NULL; + } + if (served_nf_infoList) { + OpenAPI_list_for_each(served_nf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_nf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_nf_infoList); + served_nf_infoList = NULL; + } + if (served_hss_info_listList) { + OpenAPI_list_for_each(served_hss_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_hss_info_listList); + served_hss_info_listList = NULL; + } + if (served_udsf_infoList) { + OpenAPI_list_for_each(served_udsf_infoList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_udsf_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_udsf_infoList); + served_udsf_infoList = NULL; + } + if (served_udsf_info_listList) { + OpenAPI_list_for_each(served_udsf_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_udsf_info_listList); + served_udsf_info_listList = NULL; + } + if (served_scp_info_listList) { + OpenAPI_list_for_each(served_scp_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_scp_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(served_scp_info_listList); + served_scp_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nrppa_information.c b/lib/sbi/openapi/model/nrppa_information.c index 0bbaad769..f8127226f 100644 --- a/lib/sbi/openapi/model/nrppa_information.c +++ b/lib/sbi/openapi/model/nrppa_information.c @@ -22,19 +22,30 @@ OpenAPI_nrppa_information_t *OpenAPI_nrppa_information_create( void OpenAPI_nrppa_information_free(OpenAPI_nrppa_information_t *nrppa_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nrppa_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(nrppa_information->nf_id); - OpenAPI_n2_info_content_free(nrppa_information->nrppa_pdu); - ogs_free(nrppa_information->service_instance_id); + if (nrppa_information->nf_id) { + ogs_free(nrppa_information->nf_id); + nrppa_information->nf_id = NULL; + } + if (nrppa_information->nrppa_pdu) { + OpenAPI_n2_info_content_free(nrppa_information->nrppa_pdu); + nrppa_information->nrppa_pdu = NULL; + } + if (nrppa_information->service_instance_id) { + ogs_free(nrppa_information->service_instance_id); + nrppa_information->service_instance_id = NULL; + } ogs_free(nrppa_information); } cJSON *OpenAPI_nrppa_information_convertToJSON(OpenAPI_nrppa_information_t *nrppa_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nrppa_information == NULL) { ogs_error("OpenAPI_nrppa_information_convertToJSON() failed [NrppaInformation]"); @@ -42,11 +53,19 @@ cJSON *OpenAPI_nrppa_information_convertToJSON(OpenAPI_nrppa_information_t *nrpp } item = cJSON_CreateObject(); + if (!nrppa_information->nf_id) { + ogs_error("OpenAPI_nrppa_information_convertToJSON() failed [nf_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfId", nrppa_information->nf_id) == NULL) { ogs_error("OpenAPI_nrppa_information_convertToJSON() failed [nf_id]"); goto end; } + if (!nrppa_information->nrppa_pdu) { + ogs_error("OpenAPI_nrppa_information_convertToJSON() failed [nrppa_pdu]"); + return NULL; + } cJSON *nrppa_pdu_local_JSON = OpenAPI_n2_info_content_convertToJSON(nrppa_information->nrppa_pdu); if (nrppa_pdu_local_JSON == NULL) { ogs_error("OpenAPI_nrppa_information_convertToJSON() failed [nrppa_pdu]"); @@ -72,30 +91,31 @@ end: OpenAPI_nrppa_information_t *OpenAPI_nrppa_information_parseFromJSON(cJSON *nrppa_informationJSON) { OpenAPI_nrppa_information_t *nrppa_information_local_var = NULL; - cJSON *nf_id = cJSON_GetObjectItemCaseSensitive(nrppa_informationJSON, "nfId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_id = NULL; + cJSON *nrppa_pdu = NULL; + OpenAPI_n2_info_content_t *nrppa_pdu_local_nonprim = NULL; + cJSON *service_instance_id = NULL; + nf_id = cJSON_GetObjectItemCaseSensitive(nrppa_informationJSON, "nfId"); if (!nf_id) { ogs_error("OpenAPI_nrppa_information_parseFromJSON() failed [nf_id]"); goto end; } - if (!cJSON_IsString(nf_id)) { ogs_error("OpenAPI_nrppa_information_parseFromJSON() failed [nf_id]"); goto end; } - cJSON *nrppa_pdu = cJSON_GetObjectItemCaseSensitive(nrppa_informationJSON, "nrppaPdu"); + nrppa_pdu = cJSON_GetObjectItemCaseSensitive(nrppa_informationJSON, "nrppaPdu"); if (!nrppa_pdu) { ogs_error("OpenAPI_nrppa_information_parseFromJSON() failed [nrppa_pdu]"); goto end; } - - OpenAPI_n2_info_content_t *nrppa_pdu_local_nonprim = NULL; nrppa_pdu_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(nrppa_pdu); - cJSON *service_instance_id = cJSON_GetObjectItemCaseSensitive(nrppa_informationJSON, "serviceInstanceId"); - + service_instance_id = cJSON_GetObjectItemCaseSensitive(nrppa_informationJSON, "serviceInstanceId"); if (service_instance_id) { - if (!cJSON_IsString(service_instance_id)) { + if (!cJSON_IsString(service_instance_id) && !cJSON_IsNull(service_instance_id)) { ogs_error("OpenAPI_nrppa_information_parseFromJSON() failed [service_instance_id]"); goto end; } @@ -104,11 +124,15 @@ OpenAPI_nrppa_information_t *OpenAPI_nrppa_information_parseFromJSON(cJSON *nrpp nrppa_information_local_var = OpenAPI_nrppa_information_create ( ogs_strdup(nf_id->valuestring), nrppa_pdu_local_nonprim, - service_instance_id ? ogs_strdup(service_instance_id->valuestring) : NULL + service_instance_id && !cJSON_IsNull(service_instance_id) ? ogs_strdup(service_instance_id->valuestring) : NULL ); return nrppa_information_local_var; end: + if (nrppa_pdu_local_nonprim) { + OpenAPI_n2_info_content_free(nrppa_pdu_local_nonprim); + nrppa_pdu_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nsi_information.c b/lib/sbi/openapi/model/nsi_information.c index 04efbe6ea..cec0465fc 100644 --- a/lib/sbi/openapi/model/nsi_information.c +++ b/lib/sbi/openapi/model/nsi_information.c @@ -24,20 +24,34 @@ OpenAPI_nsi_information_t *OpenAPI_nsi_information_create( void OpenAPI_nsi_information_free(OpenAPI_nsi_information_t *nsi_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nsi_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(nsi_information->nrf_id); - ogs_free(nsi_information->nsi_id); - ogs_free(nsi_information->nrf_nf_mgt_uri); - ogs_free(nsi_information->nrf_access_token_uri); + if (nsi_information->nrf_id) { + ogs_free(nsi_information->nrf_id); + nsi_information->nrf_id = NULL; + } + if (nsi_information->nsi_id) { + ogs_free(nsi_information->nsi_id); + nsi_information->nsi_id = NULL; + } + if (nsi_information->nrf_nf_mgt_uri) { + ogs_free(nsi_information->nrf_nf_mgt_uri); + nsi_information->nrf_nf_mgt_uri = NULL; + } + if (nsi_information->nrf_access_token_uri) { + ogs_free(nsi_information->nrf_access_token_uri); + nsi_information->nrf_access_token_uri = NULL; + } ogs_free(nsi_information); } cJSON *OpenAPI_nsi_information_convertToJSON(OpenAPI_nsi_information_t *nsi_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nsi_information == NULL) { ogs_error("OpenAPI_nsi_information_convertToJSON() failed [NsiInformation]"); @@ -45,6 +59,10 @@ cJSON *OpenAPI_nsi_information_convertToJSON(OpenAPI_nsi_information_t *nsi_info } item = cJSON_CreateObject(); + if (!nsi_information->nrf_id) { + ogs_error("OpenAPI_nsi_information_convertToJSON() failed [nrf_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nrfId", nsi_information->nrf_id) == NULL) { ogs_error("OpenAPI_nsi_information_convertToJSON() failed [nrf_id]"); goto end; @@ -78,39 +96,40 @@ end: OpenAPI_nsi_information_t *OpenAPI_nsi_information_parseFromJSON(cJSON *nsi_informationJSON) { OpenAPI_nsi_information_t *nsi_information_local_var = NULL; - cJSON *nrf_id = cJSON_GetObjectItemCaseSensitive(nsi_informationJSON, "nrfId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nrf_id = NULL; + cJSON *nsi_id = NULL; + cJSON *nrf_nf_mgt_uri = NULL; + cJSON *nrf_access_token_uri = NULL; + nrf_id = cJSON_GetObjectItemCaseSensitive(nsi_informationJSON, "nrfId"); if (!nrf_id) { ogs_error("OpenAPI_nsi_information_parseFromJSON() failed [nrf_id]"); goto end; } - if (!cJSON_IsString(nrf_id)) { ogs_error("OpenAPI_nsi_information_parseFromJSON() failed [nrf_id]"); goto end; } - cJSON *nsi_id = cJSON_GetObjectItemCaseSensitive(nsi_informationJSON, "nsiId"); - + nsi_id = cJSON_GetObjectItemCaseSensitive(nsi_informationJSON, "nsiId"); if (nsi_id) { - if (!cJSON_IsString(nsi_id)) { + if (!cJSON_IsString(nsi_id) && !cJSON_IsNull(nsi_id)) { ogs_error("OpenAPI_nsi_information_parseFromJSON() failed [nsi_id]"); goto end; } } - cJSON *nrf_nf_mgt_uri = cJSON_GetObjectItemCaseSensitive(nsi_informationJSON, "nrfNfMgtUri"); - + nrf_nf_mgt_uri = cJSON_GetObjectItemCaseSensitive(nsi_informationJSON, "nrfNfMgtUri"); if (nrf_nf_mgt_uri) { - if (!cJSON_IsString(nrf_nf_mgt_uri)) { + if (!cJSON_IsString(nrf_nf_mgt_uri) && !cJSON_IsNull(nrf_nf_mgt_uri)) { ogs_error("OpenAPI_nsi_information_parseFromJSON() failed [nrf_nf_mgt_uri]"); goto end; } } - cJSON *nrf_access_token_uri = cJSON_GetObjectItemCaseSensitive(nsi_informationJSON, "nrfAccessTokenUri"); - + nrf_access_token_uri = cJSON_GetObjectItemCaseSensitive(nsi_informationJSON, "nrfAccessTokenUri"); if (nrf_access_token_uri) { - if (!cJSON_IsString(nrf_access_token_uri)) { + if (!cJSON_IsString(nrf_access_token_uri) && !cJSON_IsNull(nrf_access_token_uri)) { ogs_error("OpenAPI_nsi_information_parseFromJSON() failed [nrf_access_token_uri]"); goto end; } @@ -118,9 +137,9 @@ OpenAPI_nsi_information_t *OpenAPI_nsi_information_parseFromJSON(cJSON *nsi_info nsi_information_local_var = OpenAPI_nsi_information_create ( ogs_strdup(nrf_id->valuestring), - nsi_id ? ogs_strdup(nsi_id->valuestring) : NULL, - nrf_nf_mgt_uri ? ogs_strdup(nrf_nf_mgt_uri->valuestring) : NULL, - nrf_access_token_uri ? ogs_strdup(nrf_access_token_uri->valuestring) : NULL + nsi_id && !cJSON_IsNull(nsi_id) ? ogs_strdup(nsi_id->valuestring) : NULL, + nrf_nf_mgt_uri && !cJSON_IsNull(nrf_nf_mgt_uri) ? ogs_strdup(nrf_nf_mgt_uri->valuestring) : NULL, + nrf_access_token_uri && !cJSON_IsNull(nrf_access_token_uri) ? ogs_strdup(nrf_access_token_uri->valuestring) : NULL ); return nsi_information_local_var; diff --git a/lib/sbi/openapi/model/nssaa_status.c b/lib/sbi/openapi/model/nssaa_status.c index 6a63b0fa1..5eaafb77d 100644 --- a/lib/sbi/openapi/model/nssaa_status.c +++ b/lib/sbi/openapi/model/nssaa_status.c @@ -20,17 +20,22 @@ OpenAPI_nssaa_status_t *OpenAPI_nssaa_status_create( void OpenAPI_nssaa_status_free(OpenAPI_nssaa_status_t *nssaa_status) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nssaa_status) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(nssaa_status->snssai); + if (nssaa_status->snssai) { + OpenAPI_snssai_free(nssaa_status->snssai); + nssaa_status->snssai = NULL; + } ogs_free(nssaa_status); } cJSON *OpenAPI_nssaa_status_convertToJSON(OpenAPI_nssaa_status_t *nssaa_status) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nssaa_status == NULL) { ogs_error("OpenAPI_nssaa_status_convertToJSON() failed [NssaaStatus]"); @@ -38,6 +43,10 @@ cJSON *OpenAPI_nssaa_status_convertToJSON(OpenAPI_nssaa_status_t *nssaa_status) } item = cJSON_CreateObject(); + if (!nssaa_status->snssai) { + ogs_error("OpenAPI_nssaa_status_convertToJSON() failed [snssai]"); + return NULL; + } cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(nssaa_status->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_nssaa_status_convertToJSON() failed [snssai]"); @@ -49,6 +58,10 @@ cJSON *OpenAPI_nssaa_status_convertToJSON(OpenAPI_nssaa_status_t *nssaa_status) goto end; } + if (nssaa_status->status == OpenAPI_auth_status_NULL) { + ogs_error("OpenAPI_nssaa_status_convertToJSON() failed [status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "status", OpenAPI_auth_status_ToString(nssaa_status->status)) == NULL) { ogs_error("OpenAPI_nssaa_status_convertToJSON() failed [status]"); goto end; @@ -61,22 +74,23 @@ end: OpenAPI_nssaa_status_t *OpenAPI_nssaa_status_parseFromJSON(cJSON *nssaa_statusJSON) { OpenAPI_nssaa_status_t *nssaa_status_local_var = NULL; - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(nssaa_statusJSON, "snssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *status = NULL; + OpenAPI_auth_status_e statusVariable = 0; + snssai = cJSON_GetObjectItemCaseSensitive(nssaa_statusJSON, "snssai"); if (!snssai) { ogs_error("OpenAPI_nssaa_status_parseFromJSON() failed [snssai]"); goto end; } - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); - cJSON *status = cJSON_GetObjectItemCaseSensitive(nssaa_statusJSON, "status"); + status = cJSON_GetObjectItemCaseSensitive(nssaa_statusJSON, "status"); if (!status) { ogs_error("OpenAPI_nssaa_status_parseFromJSON() failed [status]"); goto end; } - - OpenAPI_auth_status_e statusVariable; if (!cJSON_IsString(status)) { ogs_error("OpenAPI_nssaa_status_parseFromJSON() failed [status]"); goto end; @@ -90,6 +104,10 @@ OpenAPI_nssaa_status_t *OpenAPI_nssaa_status_parseFromJSON(cJSON *nssaa_statusJS return nssaa_status_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nssai.c b/lib/sbi/openapi/model/nssai.c index d2e7eb0c9..8d63db51a 100644 --- a/lib/sbi/openapi/model/nssai.c +++ b/lib/sbi/openapi/model/nssai.c @@ -26,33 +26,50 @@ OpenAPI_nssai_t *OpenAPI_nssai_create( void OpenAPI_nssai_free(OpenAPI_nssai_t *nssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nssai) { return; } - OpenAPI_lnode_t *node; - ogs_free(nssai->supported_features); - OpenAPI_list_for_each(nssai->default_single_nssais, node) { - OpenAPI_snssai_free(node->data); + if (nssai->supported_features) { + ogs_free(nssai->supported_features); + nssai->supported_features = NULL; } - OpenAPI_list_free(nssai->default_single_nssais); - OpenAPI_list_for_each(nssai->single_nssais, node) { - OpenAPI_snssai_free(node->data); + if (nssai->default_single_nssais) { + OpenAPI_list_for_each(nssai->default_single_nssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nssai->default_single_nssais); + nssai->default_single_nssais = NULL; } - OpenAPI_list_free(nssai->single_nssais); - ogs_free(nssai->provisioning_time); - OpenAPI_list_for_each(nssai->additional_snssai_data, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_additional_snssai_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nssai->single_nssais) { + OpenAPI_list_for_each(nssai->single_nssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nssai->single_nssais); + nssai->single_nssais = NULL; + } + if (nssai->provisioning_time) { + ogs_free(nssai->provisioning_time); + nssai->provisioning_time = NULL; + } + if (nssai->additional_snssai_data) { + OpenAPI_list_for_each(nssai->additional_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_additional_snssai_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nssai->additional_snssai_data); + nssai->additional_snssai_data = NULL; } - OpenAPI_list_free(nssai->additional_snssai_data); ogs_free(nssai); } cJSON *OpenAPI_nssai_convertToJSON(OpenAPI_nssai_t *nssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nssai == NULL) { ogs_error("OpenAPI_nssai_convertToJSON() failed [Nssai]"); @@ -67,22 +84,22 @@ cJSON *OpenAPI_nssai_convertToJSON(OpenAPI_nssai_t *nssai) } } + if (!nssai->default_single_nssais) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [default_single_nssais]"); + return NULL; + } cJSON *default_single_nssaisList = cJSON_AddArrayToObject(item, "defaultSingleNssais"); if (default_single_nssaisList == NULL) { ogs_error("OpenAPI_nssai_convertToJSON() failed [default_single_nssais]"); goto end; } - - OpenAPI_lnode_t *default_single_nssais_node; - if (nssai->default_single_nssais) { - OpenAPI_list_for_each(nssai->default_single_nssais, default_single_nssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(default_single_nssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nssai_convertToJSON() failed [default_single_nssais]"); - goto end; - } - cJSON_AddItemToArray(default_single_nssaisList, itemLocal); + OpenAPI_list_for_each(nssai->default_single_nssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [default_single_nssais]"); + goto end; } + cJSON_AddItemToArray(default_single_nssaisList, itemLocal); } if (nssai->single_nssais) { @@ -91,17 +108,13 @@ cJSON *OpenAPI_nssai_convertToJSON(OpenAPI_nssai_t *nssai) ogs_error("OpenAPI_nssai_convertToJSON() failed [single_nssais]"); goto end; } - - OpenAPI_lnode_t *single_nssais_node; - if (nssai->single_nssais) { - OpenAPI_list_for_each(nssai->single_nssais, single_nssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(single_nssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nssai_convertToJSON() failed [single_nssais]"); - goto end; - } - cJSON_AddItemToArray(single_nssaisList, itemLocal); + OpenAPI_list_for_each(nssai->single_nssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [single_nssais]"); + goto end; } + cJSON_AddItemToArray(single_nssaisList, itemLocal); } } @@ -119,21 +132,20 @@ cJSON *OpenAPI_nssai_convertToJSON(OpenAPI_nssai_t *nssai) goto end; } cJSON *localMapObject = additional_snssai_data; - OpenAPI_lnode_t *additional_snssai_data_node; if (nssai->additional_snssai_data) { - OpenAPI_list_for_each(nssai->additional_snssai_data, additional_snssai_data_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)additional_snssai_data_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_additional_snssai_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nssai_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nssai->additional_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_additional_snssai_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -142,120 +154,143 @@ end: OpenAPI_nssai_t *OpenAPI_nssai_parseFromJSON(cJSON *nssaiJSON) { OpenAPI_nssai_t *nssai_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *default_single_nssais = NULL; + OpenAPI_list_t *default_single_nssaisList = NULL; + cJSON *single_nssais = NULL; + OpenAPI_list_t *single_nssaisList = NULL; + cJSON *provisioning_time = NULL; + cJSON *additional_snssai_data = NULL; + OpenAPI_list_t *additional_snssai_dataList = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_nssai_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *default_single_nssais = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "defaultSingleNssais"); + default_single_nssais = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "defaultSingleNssais"); if (!default_single_nssais) { ogs_error("OpenAPI_nssai_parseFromJSON() failed [default_single_nssais]"); goto end; } - - OpenAPI_list_t *default_single_nssaisList; - cJSON *default_single_nssais_local_nonprimitive; - if (!cJSON_IsArray(default_single_nssais)){ - ogs_error("OpenAPI_nssai_parseFromJSON() failed [default_single_nssais]"); - goto end; - } - - default_single_nssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(default_single_nssais_local_nonprimitive, default_single_nssais ) { - if (!cJSON_IsObject(default_single_nssais_local_nonprimitive)) { + cJSON *default_single_nssais_local = NULL; + if (!cJSON_IsArray(default_single_nssais)) { ogs_error("OpenAPI_nssai_parseFromJSON() failed [default_single_nssais]"); goto end; } - OpenAPI_snssai_t *default_single_nssaisItem = OpenAPI_snssai_parseFromJSON(default_single_nssais_local_nonprimitive); - if (!default_single_nssaisItem) { - ogs_error("No default_single_nssaisItem"); - OpenAPI_list_free(default_single_nssaisList); - goto end; + default_single_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_single_nssais_local, default_single_nssais) { + if (!cJSON_IsObject(default_single_nssais_local)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [default_single_nssais]"); + goto end; + } + OpenAPI_snssai_t *default_single_nssaisItem = OpenAPI_snssai_parseFromJSON(default_single_nssais_local); + if (!default_single_nssaisItem) { + ogs_error("No default_single_nssaisItem"); + OpenAPI_list_free(default_single_nssaisList); + goto end; + } + OpenAPI_list_add(default_single_nssaisList, default_single_nssaisItem); } - OpenAPI_list_add(default_single_nssaisList, default_single_nssaisItem); - } - - cJSON *single_nssais = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "singleNssais"); - - OpenAPI_list_t *single_nssaisList; + single_nssais = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "singleNssais"); if (single_nssais) { - cJSON *single_nssais_local_nonprimitive; - if (!cJSON_IsArray(single_nssais)){ - ogs_error("OpenAPI_nssai_parseFromJSON() failed [single_nssais]"); - goto end; - } - - single_nssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(single_nssais_local_nonprimitive, single_nssais ) { - if (!cJSON_IsObject(single_nssais_local_nonprimitive)) { + cJSON *single_nssais_local = NULL; + if (!cJSON_IsArray(single_nssais)) { ogs_error("OpenAPI_nssai_parseFromJSON() failed [single_nssais]"); goto end; } - OpenAPI_snssai_t *single_nssaisItem = OpenAPI_snssai_parseFromJSON(single_nssais_local_nonprimitive); - if (!single_nssaisItem) { - ogs_error("No single_nssaisItem"); - OpenAPI_list_free(single_nssaisList); - goto end; + single_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(single_nssais_local, single_nssais) { + if (!cJSON_IsObject(single_nssais_local)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [single_nssais]"); + goto end; + } + OpenAPI_snssai_t *single_nssaisItem = OpenAPI_snssai_parseFromJSON(single_nssais_local); + if (!single_nssaisItem) { + ogs_error("No single_nssaisItem"); + OpenAPI_list_free(single_nssaisList); + goto end; + } + OpenAPI_list_add(single_nssaisList, single_nssaisItem); } - - OpenAPI_list_add(single_nssaisList, single_nssaisItem); - } } - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "provisioningTime"); - + provisioning_time = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "provisioningTime"); if (provisioning_time) { - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_nssai_parseFromJSON() failed [provisioning_time]"); goto end; } } - cJSON *additional_snssai_data = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "additionalSnssaiData"); - - OpenAPI_list_t *additional_snssai_dataList; + additional_snssai_data = cJSON_GetObjectItemCaseSensitive(nssaiJSON, "additionalSnssaiData"); if (additional_snssai_data) { - cJSON *additional_snssai_data_local_map; - if (!cJSON_IsObject(additional_snssai_data)) { - ogs_error("OpenAPI_nssai_parseFromJSON() failed [additional_snssai_data]"); - goto end; - } - additional_snssai_dataList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(additional_snssai_data_local_map, additional_snssai_data) { - cJSON *localMapObject = additional_snssai_data_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_additional_snssai_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nssai_parseFromJSON() failed [inner]"); + cJSON *additional_snssai_data_local_map = NULL; + if (!cJSON_IsObject(additional_snssai_data) && !cJSON_IsNull(additional_snssai_data)) { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [additional_snssai_data]"); goto end; } - OpenAPI_list_add(additional_snssai_dataList, localMapKeyPair); - } + if (cJSON_IsObject(additional_snssai_data)) { + additional_snssai_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(additional_snssai_data_local_map, additional_snssai_data) { + cJSON *localMapObject = additional_snssai_data_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_additional_snssai_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nssai_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(additional_snssai_dataList, localMapKeyPair); + } + } } nssai_local_var = OpenAPI_nssai_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, default_single_nssaisList, single_nssais ? single_nssaisList : NULL, - provisioning_time ? ogs_strdup(provisioning_time->valuestring) : NULL, + provisioning_time && !cJSON_IsNull(provisioning_time) ? ogs_strdup(provisioning_time->valuestring) : NULL, additional_snssai_data ? additional_snssai_dataList : NULL ); return nssai_local_var; end: + if (default_single_nssaisList) { + OpenAPI_list_for_each(default_single_nssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(default_single_nssaisList); + default_single_nssaisList = NULL; + } + if (single_nssaisList) { + OpenAPI_list_for_each(single_nssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(single_nssaisList); + single_nssaisList = NULL; + } + if (additional_snssai_dataList) { + OpenAPI_list_for_each(additional_snssai_dataList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_additional_snssai_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(additional_snssai_dataList); + additional_snssai_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nssai_1.c b/lib/sbi/openapi/model/nssai_1.c index 15a7ad5f4..dc8805693 100644 --- a/lib/sbi/openapi/model/nssai_1.c +++ b/lib/sbi/openapi/model/nssai_1.c @@ -26,33 +26,50 @@ OpenAPI_nssai_1_t *OpenAPI_nssai_1_create( void OpenAPI_nssai_1_free(OpenAPI_nssai_1_t *nssai_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nssai_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(nssai_1->supported_features); - OpenAPI_list_for_each(nssai_1->default_single_nssais, node) { - OpenAPI_snssai_free(node->data); + if (nssai_1->supported_features) { + ogs_free(nssai_1->supported_features); + nssai_1->supported_features = NULL; } - OpenAPI_list_free(nssai_1->default_single_nssais); - OpenAPI_list_for_each(nssai_1->single_nssais, node) { - OpenAPI_snssai_free(node->data); + if (nssai_1->default_single_nssais) { + OpenAPI_list_for_each(nssai_1->default_single_nssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nssai_1->default_single_nssais); + nssai_1->default_single_nssais = NULL; } - OpenAPI_list_free(nssai_1->single_nssais); - ogs_free(nssai_1->provisioning_time); - OpenAPI_list_for_each(nssai_1->additional_snssai_data, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_additional_snssai_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (nssai_1->single_nssais) { + OpenAPI_list_for_each(nssai_1->single_nssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nssai_1->single_nssais); + nssai_1->single_nssais = NULL; + } + if (nssai_1->provisioning_time) { + ogs_free(nssai_1->provisioning_time); + nssai_1->provisioning_time = NULL; + } + if (nssai_1->additional_snssai_data) { + OpenAPI_list_for_each(nssai_1->additional_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_additional_snssai_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(nssai_1->additional_snssai_data); + nssai_1->additional_snssai_data = NULL; } - OpenAPI_list_free(nssai_1->additional_snssai_data); ogs_free(nssai_1); } cJSON *OpenAPI_nssai_1_convertToJSON(OpenAPI_nssai_1_t *nssai_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nssai_1 == NULL) { ogs_error("OpenAPI_nssai_1_convertToJSON() failed [Nssai_1]"); @@ -67,22 +84,22 @@ cJSON *OpenAPI_nssai_1_convertToJSON(OpenAPI_nssai_1_t *nssai_1) } } + if (!nssai_1->default_single_nssais) { + ogs_error("OpenAPI_nssai_1_convertToJSON() failed [default_single_nssais]"); + return NULL; + } cJSON *default_single_nssaisList = cJSON_AddArrayToObject(item, "defaultSingleNssais"); if (default_single_nssaisList == NULL) { ogs_error("OpenAPI_nssai_1_convertToJSON() failed [default_single_nssais]"); goto end; } - - OpenAPI_lnode_t *default_single_nssais_node; - if (nssai_1->default_single_nssais) { - OpenAPI_list_for_each(nssai_1->default_single_nssais, default_single_nssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(default_single_nssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nssai_1_convertToJSON() failed [default_single_nssais]"); - goto end; - } - cJSON_AddItemToArray(default_single_nssaisList, itemLocal); + OpenAPI_list_for_each(nssai_1->default_single_nssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_1_convertToJSON() failed [default_single_nssais]"); + goto end; } + cJSON_AddItemToArray(default_single_nssaisList, itemLocal); } if (nssai_1->single_nssais) { @@ -91,17 +108,13 @@ cJSON *OpenAPI_nssai_1_convertToJSON(OpenAPI_nssai_1_t *nssai_1) ogs_error("OpenAPI_nssai_1_convertToJSON() failed [single_nssais]"); goto end; } - - OpenAPI_lnode_t *single_nssais_node; - if (nssai_1->single_nssais) { - OpenAPI_list_for_each(nssai_1->single_nssais, single_nssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(single_nssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nssai_1_convertToJSON() failed [single_nssais]"); - goto end; - } - cJSON_AddItemToArray(single_nssaisList, itemLocal); + OpenAPI_list_for_each(nssai_1->single_nssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_1_convertToJSON() failed [single_nssais]"); + goto end; } + cJSON_AddItemToArray(single_nssaisList, itemLocal); } } @@ -119,21 +132,20 @@ cJSON *OpenAPI_nssai_1_convertToJSON(OpenAPI_nssai_1_t *nssai_1) goto end; } cJSON *localMapObject = additional_snssai_data; - OpenAPI_lnode_t *additional_snssai_data_node; if (nssai_1->additional_snssai_data) { - OpenAPI_list_for_each(nssai_1->additional_snssai_data, additional_snssai_data_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)additional_snssai_data_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_additional_snssai_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nssai_1_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(nssai_1->additional_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_additional_snssai_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nssai_1_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -142,120 +154,143 @@ end: OpenAPI_nssai_1_t *OpenAPI_nssai_1_parseFromJSON(cJSON *nssai_1JSON) { OpenAPI_nssai_1_t *nssai_1_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *default_single_nssais = NULL; + OpenAPI_list_t *default_single_nssaisList = NULL; + cJSON *single_nssais = NULL; + OpenAPI_list_t *single_nssaisList = NULL; + cJSON *provisioning_time = NULL; + cJSON *additional_snssai_data = NULL; + OpenAPI_list_t *additional_snssai_dataList = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *default_single_nssais = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "defaultSingleNssais"); + default_single_nssais = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "defaultSingleNssais"); if (!default_single_nssais) { ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [default_single_nssais]"); goto end; } - - OpenAPI_list_t *default_single_nssaisList; - cJSON *default_single_nssais_local_nonprimitive; - if (!cJSON_IsArray(default_single_nssais)){ - ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [default_single_nssais]"); - goto end; - } - - default_single_nssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(default_single_nssais_local_nonprimitive, default_single_nssais ) { - if (!cJSON_IsObject(default_single_nssais_local_nonprimitive)) { + cJSON *default_single_nssais_local = NULL; + if (!cJSON_IsArray(default_single_nssais)) { ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [default_single_nssais]"); goto end; } - OpenAPI_snssai_t *default_single_nssaisItem = OpenAPI_snssai_parseFromJSON(default_single_nssais_local_nonprimitive); - if (!default_single_nssaisItem) { - ogs_error("No default_single_nssaisItem"); - OpenAPI_list_free(default_single_nssaisList); - goto end; + default_single_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_single_nssais_local, default_single_nssais) { + if (!cJSON_IsObject(default_single_nssais_local)) { + ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [default_single_nssais]"); + goto end; + } + OpenAPI_snssai_t *default_single_nssaisItem = OpenAPI_snssai_parseFromJSON(default_single_nssais_local); + if (!default_single_nssaisItem) { + ogs_error("No default_single_nssaisItem"); + OpenAPI_list_free(default_single_nssaisList); + goto end; + } + OpenAPI_list_add(default_single_nssaisList, default_single_nssaisItem); } - OpenAPI_list_add(default_single_nssaisList, default_single_nssaisItem); - } - - cJSON *single_nssais = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "singleNssais"); - - OpenAPI_list_t *single_nssaisList; + single_nssais = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "singleNssais"); if (single_nssais) { - cJSON *single_nssais_local_nonprimitive; - if (!cJSON_IsArray(single_nssais)){ - ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [single_nssais]"); - goto end; - } - - single_nssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(single_nssais_local_nonprimitive, single_nssais ) { - if (!cJSON_IsObject(single_nssais_local_nonprimitive)) { + cJSON *single_nssais_local = NULL; + if (!cJSON_IsArray(single_nssais)) { ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [single_nssais]"); goto end; } - OpenAPI_snssai_t *single_nssaisItem = OpenAPI_snssai_parseFromJSON(single_nssais_local_nonprimitive); - if (!single_nssaisItem) { - ogs_error("No single_nssaisItem"); - OpenAPI_list_free(single_nssaisList); - goto end; + single_nssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(single_nssais_local, single_nssais) { + if (!cJSON_IsObject(single_nssais_local)) { + ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [single_nssais]"); + goto end; + } + OpenAPI_snssai_t *single_nssaisItem = OpenAPI_snssai_parseFromJSON(single_nssais_local); + if (!single_nssaisItem) { + ogs_error("No single_nssaisItem"); + OpenAPI_list_free(single_nssaisList); + goto end; + } + OpenAPI_list_add(single_nssaisList, single_nssaisItem); } - - OpenAPI_list_add(single_nssaisList, single_nssaisItem); - } } - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "provisioningTime"); - + provisioning_time = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "provisioningTime"); if (provisioning_time) { - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [provisioning_time]"); goto end; } } - cJSON *additional_snssai_data = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "additionalSnssaiData"); - - OpenAPI_list_t *additional_snssai_dataList; + additional_snssai_data = cJSON_GetObjectItemCaseSensitive(nssai_1JSON, "additionalSnssaiData"); if (additional_snssai_data) { - cJSON *additional_snssai_data_local_map; - if (!cJSON_IsObject(additional_snssai_data)) { - ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [additional_snssai_data]"); - goto end; - } - additional_snssai_dataList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(additional_snssai_data_local_map, additional_snssai_data) { - cJSON *localMapObject = additional_snssai_data_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_additional_snssai_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [inner]"); + cJSON *additional_snssai_data_local_map = NULL; + if (!cJSON_IsObject(additional_snssai_data) && !cJSON_IsNull(additional_snssai_data)) { + ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [additional_snssai_data]"); goto end; } - OpenAPI_list_add(additional_snssai_dataList, localMapKeyPair); - } + if (cJSON_IsObject(additional_snssai_data)) { + additional_snssai_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(additional_snssai_data_local_map, additional_snssai_data) { + cJSON *localMapObject = additional_snssai_data_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_additional_snssai_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_nssai_1_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(additional_snssai_dataList, localMapKeyPair); + } + } } nssai_1_local_var = OpenAPI_nssai_1_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, default_single_nssaisList, single_nssais ? single_nssaisList : NULL, - provisioning_time ? ogs_strdup(provisioning_time->valuestring) : NULL, + provisioning_time && !cJSON_IsNull(provisioning_time) ? ogs_strdup(provisioning_time->valuestring) : NULL, additional_snssai_data ? additional_snssai_dataList : NULL ); return nssai_1_local_var; end: + if (default_single_nssaisList) { + OpenAPI_list_for_each(default_single_nssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(default_single_nssaisList); + default_single_nssaisList = NULL; + } + if (single_nssaisList) { + OpenAPI_list_for_each(single_nssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(single_nssaisList); + single_nssaisList = NULL; + } + if (additional_snssai_dataList) { + OpenAPI_list_for_each(additional_snssai_dataList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_additional_snssai_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(additional_snssai_dataList); + additional_snssai_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nssai_ack_data.c b/lib/sbi/openapi/model/nssai_ack_data.c index feb7f1ebb..a74f4ea5c 100644 --- a/lib/sbi/openapi/model/nssai_ack_data.c +++ b/lib/sbi/openapi/model/nssai_ack_data.c @@ -20,17 +20,22 @@ OpenAPI_nssai_ack_data_t *OpenAPI_nssai_ack_data_create( void OpenAPI_nssai_ack_data_free(OpenAPI_nssai_ack_data_t *nssai_ack_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nssai_ack_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(nssai_ack_data->provisioning_time); + if (nssai_ack_data->provisioning_time) { + ogs_free(nssai_ack_data->provisioning_time); + nssai_ack_data->provisioning_time = NULL; + } ogs_free(nssai_ack_data); } cJSON *OpenAPI_nssai_ack_data_convertToJSON(OpenAPI_nssai_ack_data_t *nssai_ack_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nssai_ack_data == NULL) { ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [NssaiAckData]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_nssai_ack_data_convertToJSON(OpenAPI_nssai_ack_data_t *nssai_ack_ } item = cJSON_CreateObject(); + if (!nssai_ack_data->provisioning_time) { + ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [provisioning_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "provisioningTime", nssai_ack_data->provisioning_time) == NULL) { ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [provisioning_time]"); goto end; } + if (nssai_ack_data->ue_update_status == OpenAPI_ue_update_status_NULL) { + ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [ue_update_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ueUpdateStatus", OpenAPI_ue_update_status_ToString(nssai_ack_data->ue_update_status)) == NULL) { ogs_error("OpenAPI_nssai_ack_data_convertToJSON() failed [ue_update_status]"); goto end; @@ -55,24 +68,25 @@ end: OpenAPI_nssai_ack_data_t *OpenAPI_nssai_ack_data_parseFromJSON(cJSON *nssai_ack_dataJSON) { OpenAPI_nssai_ack_data_t *nssai_ack_data_local_var = NULL; - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(nssai_ack_dataJSON, "provisioningTime"); + OpenAPI_lnode_t *node = NULL; + cJSON *provisioning_time = NULL; + cJSON *ue_update_status = NULL; + OpenAPI_ue_update_status_e ue_update_statusVariable = 0; + provisioning_time = cJSON_GetObjectItemCaseSensitive(nssai_ack_dataJSON, "provisioningTime"); if (!provisioning_time) { ogs_error("OpenAPI_nssai_ack_data_parseFromJSON() failed [provisioning_time]"); goto end; } - - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_nssai_ack_data_parseFromJSON() failed [provisioning_time]"); goto end; } - cJSON *ue_update_status = cJSON_GetObjectItemCaseSensitive(nssai_ack_dataJSON, "ueUpdateStatus"); + ue_update_status = cJSON_GetObjectItemCaseSensitive(nssai_ack_dataJSON, "ueUpdateStatus"); if (!ue_update_status) { ogs_error("OpenAPI_nssai_ack_data_parseFromJSON() failed [ue_update_status]"); goto end; } - - OpenAPI_ue_update_status_e ue_update_statusVariable; if (!cJSON_IsString(ue_update_status)) { ogs_error("OpenAPI_nssai_ack_data_parseFromJSON() failed [ue_update_status]"); goto end; diff --git a/lib/sbi/openapi/model/nssai_mapping.c b/lib/sbi/openapi/model/nssai_mapping.c index 7988c94cb..f02f6e657 100644 --- a/lib/sbi/openapi/model/nssai_mapping.c +++ b/lib/sbi/openapi/model/nssai_mapping.c @@ -20,18 +20,26 @@ OpenAPI_nssai_mapping_t *OpenAPI_nssai_mapping_create( void OpenAPI_nssai_mapping_free(OpenAPI_nssai_mapping_t *nssai_mapping) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nssai_mapping) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(nssai_mapping->mapped_snssai); - OpenAPI_snssai_free(nssai_mapping->h_snssai); + if (nssai_mapping->mapped_snssai) { + OpenAPI_snssai_free(nssai_mapping->mapped_snssai); + nssai_mapping->mapped_snssai = NULL; + } + if (nssai_mapping->h_snssai) { + OpenAPI_snssai_free(nssai_mapping->h_snssai); + nssai_mapping->h_snssai = NULL; + } ogs_free(nssai_mapping); } cJSON *OpenAPI_nssai_mapping_convertToJSON(OpenAPI_nssai_mapping_t *nssai_mapping) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nssai_mapping == NULL) { ogs_error("OpenAPI_nssai_mapping_convertToJSON() failed [NssaiMapping]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_nssai_mapping_convertToJSON(OpenAPI_nssai_mapping_t *nssai_mappin } item = cJSON_CreateObject(); + if (!nssai_mapping->mapped_snssai) { + ogs_error("OpenAPI_nssai_mapping_convertToJSON() failed [mapped_snssai]"); + return NULL; + } cJSON *mapped_snssai_local_JSON = OpenAPI_snssai_convertToJSON(nssai_mapping->mapped_snssai); if (mapped_snssai_local_JSON == NULL) { ogs_error("OpenAPI_nssai_mapping_convertToJSON() failed [mapped_snssai]"); @@ -50,6 +62,10 @@ cJSON *OpenAPI_nssai_mapping_convertToJSON(OpenAPI_nssai_mapping_t *nssai_mappin goto end; } + if (!nssai_mapping->h_snssai) { + ogs_error("OpenAPI_nssai_mapping_convertToJSON() failed [h_snssai]"); + return NULL; + } cJSON *h_snssai_local_JSON = OpenAPI_snssai_convertToJSON(nssai_mapping->h_snssai); if (h_snssai_local_JSON == NULL) { ogs_error("OpenAPI_nssai_mapping_convertToJSON() failed [h_snssai]"); @@ -68,22 +84,23 @@ end: OpenAPI_nssai_mapping_t *OpenAPI_nssai_mapping_parseFromJSON(cJSON *nssai_mappingJSON) { OpenAPI_nssai_mapping_t *nssai_mapping_local_var = NULL; - cJSON *mapped_snssai = cJSON_GetObjectItemCaseSensitive(nssai_mappingJSON, "mappedSnssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *mapped_snssai = NULL; + OpenAPI_snssai_t *mapped_snssai_local_nonprim = NULL; + cJSON *h_snssai = NULL; + OpenAPI_snssai_t *h_snssai_local_nonprim = NULL; + mapped_snssai = cJSON_GetObjectItemCaseSensitive(nssai_mappingJSON, "mappedSnssai"); if (!mapped_snssai) { ogs_error("OpenAPI_nssai_mapping_parseFromJSON() failed [mapped_snssai]"); goto end; } - - OpenAPI_snssai_t *mapped_snssai_local_nonprim = NULL; mapped_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(mapped_snssai); - cJSON *h_snssai = cJSON_GetObjectItemCaseSensitive(nssai_mappingJSON, "hSnssai"); + h_snssai = cJSON_GetObjectItemCaseSensitive(nssai_mappingJSON, "hSnssai"); if (!h_snssai) { ogs_error("OpenAPI_nssai_mapping_parseFromJSON() failed [h_snssai]"); goto end; } - - OpenAPI_snssai_t *h_snssai_local_nonprim = NULL; h_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(h_snssai); nssai_mapping_local_var = OpenAPI_nssai_mapping_create ( @@ -93,6 +110,14 @@ OpenAPI_nssai_mapping_t *OpenAPI_nssai_mapping_parseFromJSON(cJSON *nssai_mappin return nssai_mapping_local_var; end: + if (mapped_snssai_local_nonprim) { + OpenAPI_snssai_free(mapped_snssai_local_nonprim); + mapped_snssai_local_nonprim = NULL; + } + if (h_snssai_local_nonprim) { + OpenAPI_snssai_free(h_snssai_local_nonprim); + h_snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/null_value.c b/lib/sbi/openapi/model/null_value.c index d19d78d70..0faccee23 100644 --- a/lib/sbi/openapi/model/null_value.c +++ b/lib/sbi/openapi/model/null_value.c @@ -6,7 +6,7 @@ char* OpenAPI_null_value_ToString(OpenAPI_null_value_e null_value) { - const char *null_valueArray[] = { "NULL", "null" }; + const char *null_valueArray[] = { "NULL", "" }; size_t sizeofArray = sizeof(null_valueArray) / sizeof(null_valueArray[0]); if (null_value < sizeofArray) return (char *)null_valueArray[null_value]; @@ -17,7 +17,7 @@ char* OpenAPI_null_value_ToString(OpenAPI_null_value_e null_value) OpenAPI_null_value_e OpenAPI_null_value_FromString(char* null_value) { int stringToReturn = 0; - const char *null_valueArray[] = { "NULL", "null" }; + const char *null_valueArray[] = { "NULL", "" }; size_t sizeofArray = sizeof(null_valueArray) / sizeof(null_valueArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(null_value, null_valueArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/nwdaf_cond.c b/lib/sbi/openapi/model/nwdaf_cond.c index 21a6eed5c..cee7713f9 100644 --- a/lib/sbi/openapi/model/nwdaf_cond.c +++ b/lib/sbi/openapi/model/nwdaf_cond.c @@ -49,32 +49,46 @@ OpenAPI_nwdaf_cond_t *OpenAPI_nwdaf_cond_create( void OpenAPI_nwdaf_cond_free(OpenAPI_nwdaf_cond_t *nwdaf_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nwdaf_cond) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(nwdaf_cond->analytics_ids, node) { - ogs_free(node->data); + if (nwdaf_cond->analytics_ids) { + OpenAPI_list_for_each(nwdaf_cond->analytics_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nwdaf_cond->analytics_ids); + nwdaf_cond->analytics_ids = NULL; } - OpenAPI_list_free(nwdaf_cond->analytics_ids); - OpenAPI_list_for_each(nwdaf_cond->snssai_list, node) { - OpenAPI_snssai_free(node->data); + if (nwdaf_cond->snssai_list) { + OpenAPI_list_for_each(nwdaf_cond->snssai_list, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(nwdaf_cond->snssai_list); + nwdaf_cond->snssai_list = NULL; } - OpenAPI_list_free(nwdaf_cond->snssai_list); - OpenAPI_list_for_each(nwdaf_cond->tai_list, node) { - OpenAPI_tai_free(node->data); + if (nwdaf_cond->tai_list) { + OpenAPI_list_for_each(nwdaf_cond->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(nwdaf_cond->tai_list); + nwdaf_cond->tai_list = NULL; } - OpenAPI_list_free(nwdaf_cond->tai_list); - OpenAPI_list_for_each(nwdaf_cond->tai_range_list, node) { - OpenAPI_tai_range_free(node->data); + if (nwdaf_cond->tai_range_list) { + OpenAPI_list_for_each(nwdaf_cond->tai_range_list, node) { + OpenAPI_tai_range_free(node->data); + } + OpenAPI_list_free(nwdaf_cond->tai_range_list); + nwdaf_cond->tai_range_list = NULL; } - OpenAPI_list_free(nwdaf_cond->tai_range_list); ogs_free(nwdaf_cond); } cJSON *OpenAPI_nwdaf_cond_convertToJSON(OpenAPI_nwdaf_cond_t *nwdaf_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nwdaf_cond == NULL) { ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [NwdafCond]"); @@ -82,25 +96,27 @@ cJSON *OpenAPI_nwdaf_cond_convertToJSON(OpenAPI_nwdaf_cond_t *nwdaf_cond) } item = cJSON_CreateObject(); + if (nwdaf_cond->condition_type == OpenAPI_nwdaf_cond_CONDITIONTYPE_NULL) { + ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [condition_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "conditionType", OpenAPI_condition_typenwdaf_cond_ToString(nwdaf_cond->condition_type)) == NULL) { ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [condition_type]"); goto end; } if (nwdaf_cond->analytics_ids) { - cJSON *analytics_ids = cJSON_AddArrayToObject(item, "analyticsIds"); - if (analytics_ids == NULL) { + cJSON *analytics_idsList = cJSON_AddArrayToObject(item, "analyticsIds"); + if (analytics_idsList == NULL) { ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [analytics_ids]"); goto end; } - - OpenAPI_lnode_t *analytics_ids_node; - OpenAPI_list_for_each(nwdaf_cond->analytics_ids, analytics_ids_node) { - if (cJSON_AddStringToObject(analytics_ids, "", (char*)analytics_ids_node->data) == NULL) { - ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [analytics_ids]"); - goto end; + OpenAPI_list_for_each(nwdaf_cond->analytics_ids, node) { + if (cJSON_AddStringToObject(analytics_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [analytics_ids]"); + goto end; + } } - } } if (nwdaf_cond->snssai_list) { @@ -109,17 +125,13 @@ cJSON *OpenAPI_nwdaf_cond_convertToJSON(OpenAPI_nwdaf_cond_t *nwdaf_cond) ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [snssai_list]"); goto end; } - - OpenAPI_lnode_t *snssai_list_node; - if (nwdaf_cond->snssai_list) { - OpenAPI_list_for_each(nwdaf_cond->snssai_list, snssai_list_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [snssai_list]"); - goto end; - } - cJSON_AddItemToArray(snssai_listList, itemLocal); + OpenAPI_list_for_each(nwdaf_cond->snssai_list, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [snssai_list]"); + goto end; } + cJSON_AddItemToArray(snssai_listList, itemLocal); } } @@ -129,17 +141,13 @@ cJSON *OpenAPI_nwdaf_cond_convertToJSON(OpenAPI_nwdaf_cond_t *nwdaf_cond) ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (nwdaf_cond->tai_list) { - OpenAPI_list_for_each(nwdaf_cond->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(nwdaf_cond->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } } @@ -149,17 +157,13 @@ cJSON *OpenAPI_nwdaf_cond_convertToJSON(OpenAPI_nwdaf_cond_t *nwdaf_cond) ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [tai_range_list]"); goto end; } - - OpenAPI_lnode_t *tai_range_list_node; - if (nwdaf_cond->tai_range_list) { - OpenAPI_list_for_each(nwdaf_cond->tai_range_list, tai_range_list_node) { - cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(tai_range_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [tai_range_list]"); - goto end; - } - cJSON_AddItemToArray(tai_range_listList, itemLocal); + OpenAPI_list_for_each(nwdaf_cond->tai_range_list, node) { + cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nwdaf_cond_convertToJSON() failed [tai_range_list]"); + goto end; } + cJSON_AddItemToArray(tai_range_listList, itemLocal); } } @@ -170,124 +174,122 @@ end: OpenAPI_nwdaf_cond_t *OpenAPI_nwdaf_cond_parseFromJSON(cJSON *nwdaf_condJSON) { OpenAPI_nwdaf_cond_t *nwdaf_cond_local_var = NULL; - cJSON *condition_type = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "conditionType"); + OpenAPI_lnode_t *node = NULL; + cJSON *condition_type = NULL; + OpenAPI_nwdaf_cond_condition_type_e condition_typeVariable = 0; + cJSON *analytics_ids = NULL; + OpenAPI_list_t *analytics_idsList = NULL; + cJSON *snssai_list = NULL; + OpenAPI_list_t *snssai_listList = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + cJSON *tai_range_list = NULL; + OpenAPI_list_t *tai_range_listList = NULL; + condition_type = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "conditionType"); if (!condition_type) { ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [condition_type]"); goto end; } - - OpenAPI_nwdaf_cond_condition_type_e condition_typeVariable; if (!cJSON_IsString(condition_type)) { ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [condition_type]"); goto end; } condition_typeVariable = OpenAPI_condition_typenwdaf_cond_FromString(condition_type->valuestring); - cJSON *analytics_ids = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "analyticsIds"); - - OpenAPI_list_t *analytics_idsList; + analytics_ids = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "analyticsIds"); if (analytics_ids) { - cJSON *analytics_ids_local; - if (!cJSON_IsArray(analytics_ids)) { - ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [analytics_ids]"); - goto end; - } - analytics_idsList = OpenAPI_list_create(); + cJSON *analytics_ids_local = NULL; + if (!cJSON_IsArray(analytics_ids)) { + ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [analytics_ids]"); + goto end; + } - cJSON_ArrayForEach(analytics_ids_local, analytics_ids) { - if (!cJSON_IsString(analytics_ids_local)) { - ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [analytics_ids]"); - goto end; - } - OpenAPI_list_add(analytics_idsList, ogs_strdup(analytics_ids_local->valuestring)); - } + analytics_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(analytics_ids_local, analytics_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(analytics_ids_local)) { + ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [analytics_ids]"); + goto end; + } + OpenAPI_list_add(analytics_idsList, ogs_strdup(analytics_ids_local->valuestring)); + } } - cJSON *snssai_list = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "snssaiList"); - - OpenAPI_list_t *snssai_listList; + snssai_list = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "snssaiList"); if (snssai_list) { - cJSON *snssai_list_local_nonprimitive; - if (!cJSON_IsArray(snssai_list)){ - ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [snssai_list]"); - goto end; - } - - snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(snssai_list_local_nonprimitive, snssai_list ) { - if (!cJSON_IsObject(snssai_list_local_nonprimitive)) { + cJSON *snssai_list_local = NULL; + if (!cJSON_IsArray(snssai_list)) { ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [snssai_list]"); goto end; } - OpenAPI_snssai_t *snssai_listItem = OpenAPI_snssai_parseFromJSON(snssai_list_local_nonprimitive); - if (!snssai_listItem) { - ogs_error("No snssai_listItem"); - OpenAPI_list_free(snssai_listList); - goto end; + snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssai_list_local, snssai_list) { + if (!cJSON_IsObject(snssai_list_local)) { + ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [snssai_list]"); + goto end; + } + OpenAPI_snssai_t *snssai_listItem = OpenAPI_snssai_parseFromJSON(snssai_list_local); + if (!snssai_listItem) { + ogs_error("No snssai_listItem"); + OpenAPI_list_free(snssai_listList); + goto end; + } + OpenAPI_list_add(snssai_listList, snssai_listItem); } - - OpenAPI_list_add(snssai_listList, snssai_listItem); - } } - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "taiList"); - - OpenAPI_list_t *tai_listList; + tai_list = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "taiList"); if (tai_list) { - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - - OpenAPI_list_add(tai_listList, tai_listItem); - } } - cJSON *tai_range_list = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "taiRangeList"); - - OpenAPI_list_t *tai_range_listList; + tai_range_list = cJSON_GetObjectItemCaseSensitive(nwdaf_condJSON, "taiRangeList"); if (tai_range_list) { - cJSON *tai_range_list_local_nonprimitive; - if (!cJSON_IsArray(tai_range_list)){ - ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [tai_range_list]"); - goto end; - } - - tai_range_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_range_list_local_nonprimitive, tai_range_list ) { - if (!cJSON_IsObject(tai_range_list_local_nonprimitive)) { + cJSON *tai_range_list_local = NULL; + if (!cJSON_IsArray(tai_range_list)) { ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [tai_range_list]"); goto end; } - OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local_nonprimitive); - if (!tai_range_listItem) { - ogs_error("No tai_range_listItem"); - OpenAPI_list_free(tai_range_listList); - goto end; + tai_range_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_range_list_local, tai_range_list) { + if (!cJSON_IsObject(tai_range_list_local)) { + ogs_error("OpenAPI_nwdaf_cond_parseFromJSON() failed [tai_range_list]"); + goto end; + } + OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local); + if (!tai_range_listItem) { + ogs_error("No tai_range_listItem"); + OpenAPI_list_free(tai_range_listList); + goto end; + } + OpenAPI_list_add(tai_range_listList, tai_range_listItem); } - - OpenAPI_list_add(tai_range_listList, tai_range_listItem); - } } nwdaf_cond_local_var = OpenAPI_nwdaf_cond_create ( @@ -300,6 +302,34 @@ OpenAPI_nwdaf_cond_t *OpenAPI_nwdaf_cond_parseFromJSON(cJSON *nwdaf_condJSON) return nwdaf_cond_local_var; end: + if (analytics_idsList) { + OpenAPI_list_for_each(analytics_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(analytics_idsList); + analytics_idsList = NULL; + } + if (snssai_listList) { + OpenAPI_list_for_each(snssai_listList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(snssai_listList); + snssai_listList = NULL; + } + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } + if (tai_range_listList) { + OpenAPI_list_for_each(tai_range_listList, node) { + OpenAPI_tai_range_free(node->data); + } + OpenAPI_list_free(tai_range_listList); + tai_range_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/nwdaf_event.c b/lib/sbi/openapi/model/nwdaf_event.c index 2faf81759..855314eca 100644 --- a/lib/sbi/openapi/model/nwdaf_event.c +++ b/lib/sbi/openapi/model/nwdaf_event.c @@ -16,16 +16,18 @@ OpenAPI_nwdaf_event_t *OpenAPI_nwdaf_event_create( void OpenAPI_nwdaf_event_free(OpenAPI_nwdaf_event_t *nwdaf_event) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nwdaf_event) { return; } - OpenAPI_lnode_t *node; ogs_free(nwdaf_event); } cJSON *OpenAPI_nwdaf_event_convertToJSON(OpenAPI_nwdaf_event_t *nwdaf_event) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nwdaf_event == NULL) { ogs_error("OpenAPI_nwdaf_event_convertToJSON() failed [NwdafEvent]"); @@ -40,6 +42,7 @@ end: OpenAPI_nwdaf_event_t *OpenAPI_nwdaf_event_parseFromJSON(cJSON *nwdaf_eventJSON) { OpenAPI_nwdaf_event_t *nwdaf_event_local_var = NULL; + OpenAPI_lnode_t *node = NULL; nwdaf_event_local_var = OpenAPI_nwdaf_event_create ( ); diff --git a/lib/sbi/openapi/model/nwdaf_info.c b/lib/sbi/openapi/model/nwdaf_info.c index ac29a383f..1055e6681 100644 --- a/lib/sbi/openapi/model/nwdaf_info.c +++ b/lib/sbi/openapi/model/nwdaf_info.c @@ -24,32 +24,46 @@ OpenAPI_nwdaf_info_t *OpenAPI_nwdaf_info_create( void OpenAPI_nwdaf_info_free(OpenAPI_nwdaf_info_t *nwdaf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == nwdaf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(nwdaf_info->event_ids, node) { - OpenAPI_event_id_free(node->data); + if (nwdaf_info->event_ids) { + OpenAPI_list_for_each(nwdaf_info->event_ids, node) { + OpenAPI_event_id_free(node->data); + } + OpenAPI_list_free(nwdaf_info->event_ids); + nwdaf_info->event_ids = NULL; } - OpenAPI_list_free(nwdaf_info->event_ids); - OpenAPI_list_for_each(nwdaf_info->nwdaf_events, node) { - OpenAPI_nwdaf_event_free(node->data); + if (nwdaf_info->nwdaf_events) { + OpenAPI_list_for_each(nwdaf_info->nwdaf_events, node) { + OpenAPI_nwdaf_event_free(node->data); + } + OpenAPI_list_free(nwdaf_info->nwdaf_events); + nwdaf_info->nwdaf_events = NULL; } - OpenAPI_list_free(nwdaf_info->nwdaf_events); - OpenAPI_list_for_each(nwdaf_info->tai_list, node) { - OpenAPI_tai_free(node->data); + if (nwdaf_info->tai_list) { + OpenAPI_list_for_each(nwdaf_info->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(nwdaf_info->tai_list); + nwdaf_info->tai_list = NULL; } - OpenAPI_list_free(nwdaf_info->tai_list); - OpenAPI_list_for_each(nwdaf_info->tai_range_list, node) { - OpenAPI_tai_range_free(node->data); + if (nwdaf_info->tai_range_list) { + OpenAPI_list_for_each(nwdaf_info->tai_range_list, node) { + OpenAPI_tai_range_free(node->data); + } + OpenAPI_list_free(nwdaf_info->tai_range_list); + nwdaf_info->tai_range_list = NULL; } - OpenAPI_list_free(nwdaf_info->tai_range_list); ogs_free(nwdaf_info); } cJSON *OpenAPI_nwdaf_info_convertToJSON(OpenAPI_nwdaf_info_t *nwdaf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (nwdaf_info == NULL) { ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [NwdafInfo]"); @@ -63,17 +77,13 @@ cJSON *OpenAPI_nwdaf_info_convertToJSON(OpenAPI_nwdaf_info_t *nwdaf_info) ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [event_ids]"); goto end; } - - OpenAPI_lnode_t *event_ids_node; - if (nwdaf_info->event_ids) { - OpenAPI_list_for_each(nwdaf_info->event_ids, event_ids_node) { - cJSON *itemLocal = OpenAPI_event_id_convertToJSON(event_ids_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [event_ids]"); - goto end; - } - cJSON_AddItemToArray(event_idsList, itemLocal); + OpenAPI_list_for_each(nwdaf_info->event_ids, node) { + cJSON *itemLocal = OpenAPI_event_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [event_ids]"); + goto end; } + cJSON_AddItemToArray(event_idsList, itemLocal); } } @@ -83,17 +93,13 @@ cJSON *OpenAPI_nwdaf_info_convertToJSON(OpenAPI_nwdaf_info_t *nwdaf_info) ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [nwdaf_events]"); goto end; } - - OpenAPI_lnode_t *nwdaf_events_node; - if (nwdaf_info->nwdaf_events) { - OpenAPI_list_for_each(nwdaf_info->nwdaf_events, nwdaf_events_node) { - cJSON *itemLocal = OpenAPI_nwdaf_event_convertToJSON(nwdaf_events_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [nwdaf_events]"); - goto end; - } - cJSON_AddItemToArray(nwdaf_eventsList, itemLocal); + OpenAPI_list_for_each(nwdaf_info->nwdaf_events, node) { + cJSON *itemLocal = OpenAPI_nwdaf_event_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [nwdaf_events]"); + goto end; } + cJSON_AddItemToArray(nwdaf_eventsList, itemLocal); } } @@ -103,17 +109,13 @@ cJSON *OpenAPI_nwdaf_info_convertToJSON(OpenAPI_nwdaf_info_t *nwdaf_info) ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (nwdaf_info->tai_list) { - OpenAPI_list_for_each(nwdaf_info->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(nwdaf_info->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } } @@ -123,17 +125,13 @@ cJSON *OpenAPI_nwdaf_info_convertToJSON(OpenAPI_nwdaf_info_t *nwdaf_info) ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [tai_range_list]"); goto end; } - - OpenAPI_lnode_t *tai_range_list_node; - if (nwdaf_info->tai_range_list) { - OpenAPI_list_for_each(nwdaf_info->tai_range_list, tai_range_list_node) { - cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(tai_range_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [tai_range_list]"); - goto end; - } - cJSON_AddItemToArray(tai_range_listList, itemLocal); + OpenAPI_list_for_each(nwdaf_info->tai_range_list, node) { + cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_nwdaf_info_convertToJSON() failed [tai_range_list]"); + goto end; } + cJSON_AddItemToArray(tai_range_listList, itemLocal); } } @@ -144,120 +142,113 @@ end: OpenAPI_nwdaf_info_t *OpenAPI_nwdaf_info_parseFromJSON(cJSON *nwdaf_infoJSON) { OpenAPI_nwdaf_info_t *nwdaf_info_local_var = NULL; - cJSON *event_ids = cJSON_GetObjectItemCaseSensitive(nwdaf_infoJSON, "eventIds"); - - OpenAPI_list_t *event_idsList; + OpenAPI_lnode_t *node = NULL; + cJSON *event_ids = NULL; + OpenAPI_list_t *event_idsList = NULL; + cJSON *nwdaf_events = NULL; + OpenAPI_list_t *nwdaf_eventsList = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + cJSON *tai_range_list = NULL; + OpenAPI_list_t *tai_range_listList = NULL; + event_ids = cJSON_GetObjectItemCaseSensitive(nwdaf_infoJSON, "eventIds"); if (event_ids) { - cJSON *event_ids_local_nonprimitive; - if (!cJSON_IsArray(event_ids)){ - ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [event_ids]"); - goto end; - } - - event_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(event_ids_local_nonprimitive, event_ids ) { - if (!cJSON_IsObject(event_ids_local_nonprimitive)) { + cJSON *event_ids_local = NULL; + if (!cJSON_IsArray(event_ids)) { ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [event_ids]"); goto end; } - OpenAPI_event_id_t *event_idsItem = OpenAPI_event_id_parseFromJSON(event_ids_local_nonprimitive); - if (!event_idsItem) { - ogs_error("No event_idsItem"); - OpenAPI_list_free(event_idsList); - goto end; + event_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(event_ids_local, event_ids) { + if (!cJSON_IsObject(event_ids_local)) { + ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [event_ids]"); + goto end; + } + OpenAPI_event_id_t *event_idsItem = OpenAPI_event_id_parseFromJSON(event_ids_local); + if (!event_idsItem) { + ogs_error("No event_idsItem"); + OpenAPI_list_free(event_idsList); + goto end; + } + OpenAPI_list_add(event_idsList, event_idsItem); } - - OpenAPI_list_add(event_idsList, event_idsItem); - } } - cJSON *nwdaf_events = cJSON_GetObjectItemCaseSensitive(nwdaf_infoJSON, "nwdafEvents"); - - OpenAPI_list_t *nwdaf_eventsList; + nwdaf_events = cJSON_GetObjectItemCaseSensitive(nwdaf_infoJSON, "nwdafEvents"); if (nwdaf_events) { - cJSON *nwdaf_events_local_nonprimitive; - if (!cJSON_IsArray(nwdaf_events)){ - ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [nwdaf_events]"); - goto end; - } - - nwdaf_eventsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nwdaf_events_local_nonprimitive, nwdaf_events ) { - if (!cJSON_IsObject(nwdaf_events_local_nonprimitive)) { + cJSON *nwdaf_events_local = NULL; + if (!cJSON_IsArray(nwdaf_events)) { ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [nwdaf_events]"); goto end; } - OpenAPI_nwdaf_event_t *nwdaf_eventsItem = OpenAPI_nwdaf_event_parseFromJSON(nwdaf_events_local_nonprimitive); - if (!nwdaf_eventsItem) { - ogs_error("No nwdaf_eventsItem"); - OpenAPI_list_free(nwdaf_eventsList); - goto end; + nwdaf_eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nwdaf_events_local, nwdaf_events) { + if (!cJSON_IsObject(nwdaf_events_local)) { + ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [nwdaf_events]"); + goto end; + } + OpenAPI_nwdaf_event_t *nwdaf_eventsItem = OpenAPI_nwdaf_event_parseFromJSON(nwdaf_events_local); + if (!nwdaf_eventsItem) { + ogs_error("No nwdaf_eventsItem"); + OpenAPI_list_free(nwdaf_eventsList); + goto end; + } + OpenAPI_list_add(nwdaf_eventsList, nwdaf_eventsItem); } - - OpenAPI_list_add(nwdaf_eventsList, nwdaf_eventsItem); - } } - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(nwdaf_infoJSON, "taiList"); - - OpenAPI_list_t *tai_listList; + tai_list = cJSON_GetObjectItemCaseSensitive(nwdaf_infoJSON, "taiList"); if (tai_list) { - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - - OpenAPI_list_add(tai_listList, tai_listItem); - } } - cJSON *tai_range_list = cJSON_GetObjectItemCaseSensitive(nwdaf_infoJSON, "taiRangeList"); - - OpenAPI_list_t *tai_range_listList; + tai_range_list = cJSON_GetObjectItemCaseSensitive(nwdaf_infoJSON, "taiRangeList"); if (tai_range_list) { - cJSON *tai_range_list_local_nonprimitive; - if (!cJSON_IsArray(tai_range_list)){ - ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [tai_range_list]"); - goto end; - } - - tai_range_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_range_list_local_nonprimitive, tai_range_list ) { - if (!cJSON_IsObject(tai_range_list_local_nonprimitive)) { + cJSON *tai_range_list_local = NULL; + if (!cJSON_IsArray(tai_range_list)) { ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [tai_range_list]"); goto end; } - OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local_nonprimitive); - if (!tai_range_listItem) { - ogs_error("No tai_range_listItem"); - OpenAPI_list_free(tai_range_listList); - goto end; + tai_range_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_range_list_local, tai_range_list) { + if (!cJSON_IsObject(tai_range_list_local)) { + ogs_error("OpenAPI_nwdaf_info_parseFromJSON() failed [tai_range_list]"); + goto end; + } + OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local); + if (!tai_range_listItem) { + ogs_error("No tai_range_listItem"); + OpenAPI_list_free(tai_range_listList); + goto end; + } + OpenAPI_list_add(tai_range_listList, tai_range_listItem); } - - OpenAPI_list_add(tai_range_listList, tai_range_listItem); - } } nwdaf_info_local_var = OpenAPI_nwdaf_info_create ( @@ -269,6 +260,34 @@ OpenAPI_nwdaf_info_t *OpenAPI_nwdaf_info_parseFromJSON(cJSON *nwdaf_infoJSON) return nwdaf_info_local_var; end: + if (event_idsList) { + OpenAPI_list_for_each(event_idsList, node) { + OpenAPI_event_id_free(node->data); + } + OpenAPI_list_free(event_idsList); + event_idsList = NULL; + } + if (nwdaf_eventsList) { + OpenAPI_list_for_each(nwdaf_eventsList, node) { + OpenAPI_nwdaf_event_free(node->data); + } + OpenAPI_list_free(nwdaf_eventsList); + nwdaf_eventsList = NULL; + } + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } + if (tai_range_listList) { + OpenAPI_list_for_each(tai_range_listList, node) { + OpenAPI_tai_range_free(node->data); + } + OpenAPI_list_free(tai_range_listList); + tai_range_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/object.c b/lib/sbi/openapi/model/object.c index b68c4bbec..5192c6593 100644 --- a/lib/sbi/openapi/model/object.c +++ b/lib/sbi/openapi/model/object.c @@ -5,32 +5,51 @@ OpenAPI_object_t *OpenAPI_object_create(void) { - OpenAPI_object_t *object = ogs_malloc(sizeof(OpenAPI_object_t)); - ogs_assert(object); + OpenAPI_object_t *object = ogs_calloc(1, sizeof(OpenAPI_object_t)); return object; } void OpenAPI_object_free(OpenAPI_object_t *object) { + if (!object) { + return; + } + + if (object->temporary) { + ogs_free(object->temporary); + object->temporary = NULL; + } + ogs_free (object); } cJSON *OpenAPI_object_convertToJSON(OpenAPI_object_t *object) { - cJSON *item = cJSON_CreateObject(); + if (!object) { + return NULL; + } - return item; -fail: - cJSON_Delete(item); - return NULL; + if (!object->temporary) { + return cJSON_Parse("{}"); + } + + return cJSON_Parse(object->temporary); } -OpenAPI_object_t *OpenAPI_object_parseFromJSON(cJSON *objectJSON) +OpenAPI_object_t *OpenAPI_object_parseFromJSON(cJSON *json) { - OpenAPI_object_t *object = NULL; + if (!json) { + goto end; + } + OpenAPI_object_t *object = OpenAPI_object_create(); + if (!object) { + goto end; + } + object->temporary = cJSON_Print(json); return object; + end: return NULL; } diff --git a/lib/sbi/openapi/model/object.h b/lib/sbi/openapi/model/object.h index bc874ce50..8b5e45ad3 100644 --- a/lib/sbi/openapi/model/object.h +++ b/lib/sbi/openapi/model/object.h @@ -19,7 +19,7 @@ OpenAPI_object_t *OpenAPI_object_create(void); void OpenAPI_object_free(OpenAPI_object_t *object); -OpenAPI_object_t *OpenAPI_object_parseFromJSON(cJSON *objectJSON); +OpenAPI_object_t *OpenAPI_object_parseFromJSON(cJSON *json); cJSON *OpenAPI_object_convertToJSON(OpenAPI_object_t *object); diff --git a/lib/sbi/openapi/model/odb_data.c b/lib/sbi/openapi/model/odb_data.c index 708edfec6..f97a85746 100644 --- a/lib/sbi/openapi/model/odb_data.c +++ b/lib/sbi/openapi/model/odb_data.c @@ -18,16 +18,18 @@ OpenAPI_odb_data_t *OpenAPI_odb_data_create( void OpenAPI_odb_data_free(OpenAPI_odb_data_t *odb_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == odb_data) { return; } - OpenAPI_lnode_t *node; ogs_free(odb_data); } cJSON *OpenAPI_odb_data_convertToJSON(OpenAPI_odb_data_t *odb_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (odb_data == NULL) { ogs_error("OpenAPI_odb_data_convertToJSON() failed [OdbData]"); @@ -35,7 +37,7 @@ cJSON *OpenAPI_odb_data_convertToJSON(OpenAPI_odb_data_t *odb_data) } item = cJSON_CreateObject(); - if (odb_data->roaming_odb) { + if (odb_data->roaming_odb != OpenAPI_roaming_odb_NULL) { if (cJSON_AddStringToObject(item, "roamingOdb", OpenAPI_roaming_odb_ToString(odb_data->roaming_odb)) == NULL) { ogs_error("OpenAPI_odb_data_convertToJSON() failed [roaming_odb]"); goto end; @@ -49,9 +51,10 @@ end: OpenAPI_odb_data_t *OpenAPI_odb_data_parseFromJSON(cJSON *odb_dataJSON) { OpenAPI_odb_data_t *odb_data_local_var = NULL; - cJSON *roaming_odb = cJSON_GetObjectItemCaseSensitive(odb_dataJSON, "roamingOdb"); - - OpenAPI_roaming_odb_e roaming_odbVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *roaming_odb = NULL; + OpenAPI_roaming_odb_e roaming_odbVariable = 0; + roaming_odb = cJSON_GetObjectItemCaseSensitive(odb_dataJSON, "roamingOdb"); if (roaming_odb) { if (!cJSON_IsString(roaming_odb)) { ogs_error("OpenAPI_odb_data_parseFromJSON() failed [roaming_odb]"); diff --git a/lib/sbi/openapi/model/operator_specific_data_container.c b/lib/sbi/openapi/model/operator_specific_data_container.c index d3210ab7d..f0549a949 100644 --- a/lib/sbi/openapi/model/operator_specific_data_container.c +++ b/lib/sbi/openapi/model/operator_specific_data_container.c @@ -24,20 +24,34 @@ OpenAPI_operator_specific_data_container_t *OpenAPI_operator_specific_data_conta void OpenAPI_operator_specific_data_container_free(OpenAPI_operator_specific_data_container_t *operator_specific_data_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == operator_specific_data_container) { return; } - OpenAPI_lnode_t *node; - ogs_free(operator_specific_data_container->data_type); - ogs_free(operator_specific_data_container->data_type_definition); - ogs_free(operator_specific_data_container->value); - ogs_free(operator_specific_data_container->supported_features); + if (operator_specific_data_container->data_type) { + ogs_free(operator_specific_data_container->data_type); + operator_specific_data_container->data_type = NULL; + } + if (operator_specific_data_container->data_type_definition) { + ogs_free(operator_specific_data_container->data_type_definition); + operator_specific_data_container->data_type_definition = NULL; + } + if (operator_specific_data_container->value) { + ogs_free(operator_specific_data_container->value); + operator_specific_data_container->value = NULL; + } + if (operator_specific_data_container->supported_features) { + ogs_free(operator_specific_data_container->supported_features); + operator_specific_data_container->supported_features = NULL; + } ogs_free(operator_specific_data_container); } cJSON *OpenAPI_operator_specific_data_container_convertToJSON(OpenAPI_operator_specific_data_container_t *operator_specific_data_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (operator_specific_data_container == NULL) { ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [OperatorSpecificDataContainer]"); @@ -45,6 +59,10 @@ cJSON *OpenAPI_operator_specific_data_container_convertToJSON(OpenAPI_operator_s } item = cJSON_CreateObject(); + if (!operator_specific_data_container->data_type) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [data_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dataType", operator_specific_data_container->data_type) == NULL) { ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [data_type]"); goto end; @@ -57,6 +75,10 @@ cJSON *OpenAPI_operator_specific_data_container_convertToJSON(OpenAPI_operator_s } } + if (!operator_specific_data_container->value) { + ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "value", operator_specific_data_container->value) == NULL) { ogs_error("OpenAPI_operator_specific_data_container_convertToJSON() failed [value]"); goto end; @@ -76,41 +98,42 @@ end: OpenAPI_operator_specific_data_container_t *OpenAPI_operator_specific_data_container_parseFromJSON(cJSON *operator_specific_data_containerJSON) { OpenAPI_operator_specific_data_container_t *operator_specific_data_container_local_var = NULL; - cJSON *data_type = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "dataType"); + OpenAPI_lnode_t *node = NULL; + cJSON *data_type = NULL; + cJSON *data_type_definition = NULL; + cJSON *value = NULL; + cJSON *supported_features = NULL; + data_type = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "dataType"); if (!data_type) { ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [data_type]"); goto end; } - if (!cJSON_IsString(data_type)) { ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [data_type]"); goto end; } - cJSON *data_type_definition = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "dataTypeDefinition"); - + data_type_definition = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "dataTypeDefinition"); if (data_type_definition) { - if (!cJSON_IsString(data_type_definition)) { + if (!cJSON_IsString(data_type_definition) && !cJSON_IsNull(data_type_definition)) { ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [data_type_definition]"); goto end; } } - cJSON *value = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "value"); + value = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "value"); if (!value) { ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [value]"); goto end; } - if (!cJSON_IsString(value)) { ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [value]"); goto end; } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(operator_specific_data_containerJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_operator_specific_data_container_parseFromJSON() failed [supported_features]"); goto end; } @@ -118,9 +141,9 @@ OpenAPI_operator_specific_data_container_t *OpenAPI_operator_specific_data_conta operator_specific_data_container_local_var = OpenAPI_operator_specific_data_container_create ( ogs_strdup(data_type->valuestring), - data_type_definition ? ogs_strdup(data_type_definition->valuestring) : NULL, + data_type_definition && !cJSON_IsNull(data_type_definition) ? ogs_strdup(data_type_definition->valuestring) : NULL, ogs_strdup(value->valuestring), - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return operator_specific_data_container_local_var; diff --git a/lib/sbi/openapi/model/options_response.c b/lib/sbi/openapi/model/options_response.c index 2a0b22ba8..6f2f65645 100644 --- a/lib/sbi/openapi/model/options_response.c +++ b/lib/sbi/openapi/model/options_response.c @@ -18,17 +18,22 @@ OpenAPI_options_response_t *OpenAPI_options_response_create( void OpenAPI_options_response_free(OpenAPI_options_response_t *options_response) { + OpenAPI_lnode_t *node = NULL; + if (NULL == options_response) { return; } - OpenAPI_lnode_t *node; - ogs_free(options_response->supported_features); + if (options_response->supported_features) { + ogs_free(options_response->supported_features); + options_response->supported_features = NULL; + } ogs_free(options_response); } cJSON *OpenAPI_options_response_convertToJSON(OpenAPI_options_response_t *options_response) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (options_response == NULL) { ogs_error("OpenAPI_options_response_convertToJSON() failed [OptionsResponse]"); @@ -50,17 +55,18 @@ end: OpenAPI_options_response_t *OpenAPI_options_response_parseFromJSON(cJSON *options_responseJSON) { OpenAPI_options_response_t *options_response_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(options_responseJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(options_responseJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_options_response_parseFromJSON() failed [supported_features]"); goto end; } } options_response_local_var = OpenAPI_options_response_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return options_response_local_var; diff --git a/lib/sbi/openapi/model/out_of_credit_information.c b/lib/sbi/openapi/model/out_of_credit_information.c index 1f059135b..2aab530d9 100644 --- a/lib/sbi/openapi/model/out_of_credit_information.c +++ b/lib/sbi/openapi/model/out_of_credit_information.c @@ -20,21 +20,29 @@ OpenAPI_out_of_credit_information_t *OpenAPI_out_of_credit_information_create( void OpenAPI_out_of_credit_information_free(OpenAPI_out_of_credit_information_t *out_of_credit_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == out_of_credit_information) { return; } - OpenAPI_lnode_t *node; - OpenAPI_final_unit_action_free(out_of_credit_information->fin_unit_act); - OpenAPI_list_for_each(out_of_credit_information->flows, node) { - OpenAPI_flows_free(node->data); + if (out_of_credit_information->fin_unit_act) { + OpenAPI_final_unit_action_free(out_of_credit_information->fin_unit_act); + out_of_credit_information->fin_unit_act = NULL; + } + if (out_of_credit_information->flows) { + OpenAPI_list_for_each(out_of_credit_information->flows, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(out_of_credit_information->flows); + out_of_credit_information->flows = NULL; } - OpenAPI_list_free(out_of_credit_information->flows); ogs_free(out_of_credit_information); } cJSON *OpenAPI_out_of_credit_information_convertToJSON(OpenAPI_out_of_credit_information_t *out_of_credit_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (out_of_credit_information == NULL) { ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [OutOfCreditInformation]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_out_of_credit_information_convertToJSON(OpenAPI_out_of_credit_inf } item = cJSON_CreateObject(); + if (!out_of_credit_information->fin_unit_act) { + ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [fin_unit_act]"); + return NULL; + } cJSON *fin_unit_act_local_JSON = OpenAPI_final_unit_action_convertToJSON(out_of_credit_information->fin_unit_act); if (fin_unit_act_local_JSON == NULL) { ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [fin_unit_act]"); @@ -59,17 +71,13 @@ cJSON *OpenAPI_out_of_credit_information_convertToJSON(OpenAPI_out_of_credit_inf ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [flows]"); goto end; } - - OpenAPI_lnode_t *flows_node; - if (out_of_credit_information->flows) { - OpenAPI_list_for_each(out_of_credit_information->flows, flows_node) { - cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [flows]"); - goto end; - } - cJSON_AddItemToArray(flowsList, itemLocal); + OpenAPI_list_for_each(out_of_credit_information->flows, node) { + cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [flows]"); + goto end; } + cJSON_AddItemToArray(flowsList, itemLocal); } } @@ -80,42 +88,41 @@ end: OpenAPI_out_of_credit_information_t *OpenAPI_out_of_credit_information_parseFromJSON(cJSON *out_of_credit_informationJSON) { OpenAPI_out_of_credit_information_t *out_of_credit_information_local_var = NULL; - cJSON *fin_unit_act = cJSON_GetObjectItemCaseSensitive(out_of_credit_informationJSON, "finUnitAct"); + OpenAPI_lnode_t *node = NULL; + cJSON *fin_unit_act = NULL; + OpenAPI_final_unit_action_t *fin_unit_act_local_nonprim = NULL; + cJSON *flows = NULL; + OpenAPI_list_t *flowsList = NULL; + fin_unit_act = cJSON_GetObjectItemCaseSensitive(out_of_credit_informationJSON, "finUnitAct"); if (!fin_unit_act) { ogs_error("OpenAPI_out_of_credit_information_parseFromJSON() failed [fin_unit_act]"); goto end; } - - OpenAPI_final_unit_action_t *fin_unit_act_local_nonprim = NULL; fin_unit_act_local_nonprim = OpenAPI_final_unit_action_parseFromJSON(fin_unit_act); - cJSON *flows = cJSON_GetObjectItemCaseSensitive(out_of_credit_informationJSON, "flows"); - - OpenAPI_list_t *flowsList; + flows = cJSON_GetObjectItemCaseSensitive(out_of_credit_informationJSON, "flows"); if (flows) { - cJSON *flows_local_nonprimitive; - if (!cJSON_IsArray(flows)){ - ogs_error("OpenAPI_out_of_credit_information_parseFromJSON() failed [flows]"); - goto end; - } - - flowsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(flows_local_nonprimitive, flows ) { - if (!cJSON_IsObject(flows_local_nonprimitive)) { + cJSON *flows_local = NULL; + if (!cJSON_IsArray(flows)) { ogs_error("OpenAPI_out_of_credit_information_parseFromJSON() failed [flows]"); goto end; } - OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive); - if (!flowsItem) { - ogs_error("No flowsItem"); - OpenAPI_list_free(flowsList); - goto end; + flowsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flows_local, flows) { + if (!cJSON_IsObject(flows_local)) { + ogs_error("OpenAPI_out_of_credit_information_parseFromJSON() failed [flows]"); + goto end; + } + OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local); + if (!flowsItem) { + ogs_error("No flowsItem"); + OpenAPI_list_free(flowsList); + goto end; + } + OpenAPI_list_add(flowsList, flowsItem); } - - OpenAPI_list_add(flowsList, flowsItem); - } } out_of_credit_information_local_var = OpenAPI_out_of_credit_information_create ( @@ -125,6 +132,17 @@ OpenAPI_out_of_credit_information_t *OpenAPI_out_of_credit_information_parseFrom return out_of_credit_information_local_var; end: + if (fin_unit_act_local_nonprim) { + OpenAPI_final_unit_action_free(fin_unit_act_local_nonprim); + fin_unit_act_local_nonprim = NULL; + } + if (flowsList) { + OpenAPI_list_for_each(flowsList, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(flowsList); + flowsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/packet_filter_info.c b/lib/sbi/openapi/model/packet_filter_info.c index 846911626..bf73bcf9f 100644 --- a/lib/sbi/openapi/model/packet_filter_info.c +++ b/lib/sbi/openapi/model/packet_filter_info.c @@ -28,21 +28,38 @@ OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_create( void OpenAPI_packet_filter_info_free(OpenAPI_packet_filter_info_t *packet_filter_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == packet_filter_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(packet_filter_info->pack_filt_id); - ogs_free(packet_filter_info->pack_filt_cont); - ogs_free(packet_filter_info->tos_traffic_class); - ogs_free(packet_filter_info->spi); - ogs_free(packet_filter_info->flow_label); + if (packet_filter_info->pack_filt_id) { + ogs_free(packet_filter_info->pack_filt_id); + packet_filter_info->pack_filt_id = NULL; + } + if (packet_filter_info->pack_filt_cont) { + ogs_free(packet_filter_info->pack_filt_cont); + packet_filter_info->pack_filt_cont = NULL; + } + if (packet_filter_info->tos_traffic_class) { + ogs_free(packet_filter_info->tos_traffic_class); + packet_filter_info->tos_traffic_class = NULL; + } + if (packet_filter_info->spi) { + ogs_free(packet_filter_info->spi); + packet_filter_info->spi = NULL; + } + if (packet_filter_info->flow_label) { + ogs_free(packet_filter_info->flow_label); + packet_filter_info->flow_label = NULL; + } ogs_free(packet_filter_info); } cJSON *OpenAPI_packet_filter_info_convertToJSON(OpenAPI_packet_filter_info_t *packet_filter_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (packet_filter_info == NULL) { ogs_error("OpenAPI_packet_filter_info_convertToJSON() failed [PacketFilterInfo]"); @@ -85,7 +102,7 @@ cJSON *OpenAPI_packet_filter_info_convertToJSON(OpenAPI_packet_filter_info_t *pa } } - if (packet_filter_info->flow_direction) { + if (packet_filter_info->flow_direction != OpenAPI_flow_direction_NULL) { if (cJSON_AddStringToObject(item, "flowDirection", OpenAPI_flow_direction_ToString(packet_filter_info->flow_direction)) == NULL) { ogs_error("OpenAPI_packet_filter_info_convertToJSON() failed [flow_direction]"); goto end; @@ -99,54 +116,55 @@ end: OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_parseFromJSON(cJSON *packet_filter_infoJSON) { OpenAPI_packet_filter_info_t *packet_filter_info_local_var = NULL; - cJSON *pack_filt_id = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "packFiltId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pack_filt_id = NULL; + cJSON *pack_filt_cont = NULL; + cJSON *tos_traffic_class = NULL; + cJSON *spi = NULL; + cJSON *flow_label = NULL; + cJSON *flow_direction = NULL; + OpenAPI_flow_direction_e flow_directionVariable = 0; + pack_filt_id = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "packFiltId"); if (pack_filt_id) { - if (!cJSON_IsString(pack_filt_id)) { + if (!cJSON_IsString(pack_filt_id) && !cJSON_IsNull(pack_filt_id)) { ogs_error("OpenAPI_packet_filter_info_parseFromJSON() failed [pack_filt_id]"); goto end; } } - cJSON *pack_filt_cont = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "packFiltCont"); - + pack_filt_cont = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "packFiltCont"); if (pack_filt_cont) { - if (!cJSON_IsString(pack_filt_cont)) { + if (!cJSON_IsString(pack_filt_cont) && !cJSON_IsNull(pack_filt_cont)) { ogs_error("OpenAPI_packet_filter_info_parseFromJSON() failed [pack_filt_cont]"); goto end; } } - cJSON *tos_traffic_class = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "tosTrafficClass"); - + tos_traffic_class = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "tosTrafficClass"); if (tos_traffic_class) { - if (!cJSON_IsString(tos_traffic_class)) { + if (!cJSON_IsString(tos_traffic_class) && !cJSON_IsNull(tos_traffic_class)) { ogs_error("OpenAPI_packet_filter_info_parseFromJSON() failed [tos_traffic_class]"); goto end; } } - cJSON *spi = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "spi"); - + spi = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "spi"); if (spi) { - if (!cJSON_IsString(spi)) { + if (!cJSON_IsString(spi) && !cJSON_IsNull(spi)) { ogs_error("OpenAPI_packet_filter_info_parseFromJSON() failed [spi]"); goto end; } } - cJSON *flow_label = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "flowLabel"); - + flow_label = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "flowLabel"); if (flow_label) { - if (!cJSON_IsString(flow_label)) { + if (!cJSON_IsString(flow_label) && !cJSON_IsNull(flow_label)) { ogs_error("OpenAPI_packet_filter_info_parseFromJSON() failed [flow_label]"); goto end; } } - cJSON *flow_direction = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "flowDirection"); - - OpenAPI_flow_direction_e flow_directionVariable; + flow_direction = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "flowDirection"); if (flow_direction) { if (!cJSON_IsString(flow_direction)) { ogs_error("OpenAPI_packet_filter_info_parseFromJSON() failed [flow_direction]"); @@ -156,11 +174,11 @@ OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_parseFromJSON(cJSON *pa } packet_filter_info_local_var = OpenAPI_packet_filter_info_create ( - pack_filt_id ? ogs_strdup(pack_filt_id->valuestring) : NULL, - pack_filt_cont ? ogs_strdup(pack_filt_cont->valuestring) : NULL, - tos_traffic_class ? ogs_strdup(tos_traffic_class->valuestring) : NULL, - spi ? ogs_strdup(spi->valuestring) : NULL, - flow_label ? ogs_strdup(flow_label->valuestring) : NULL, + pack_filt_id && !cJSON_IsNull(pack_filt_id) ? ogs_strdup(pack_filt_id->valuestring) : NULL, + pack_filt_cont && !cJSON_IsNull(pack_filt_cont) ? ogs_strdup(pack_filt_cont->valuestring) : NULL, + tos_traffic_class && !cJSON_IsNull(tos_traffic_class) ? ogs_strdup(tos_traffic_class->valuestring) : NULL, + spi && !cJSON_IsNull(spi) ? ogs_strdup(spi->valuestring) : NULL, + flow_label && !cJSON_IsNull(flow_label) ? ogs_strdup(flow_label->valuestring) : NULL, flow_direction ? flow_directionVariable : 0 ); diff --git a/lib/sbi/openapi/model/parameter_combination.c b/lib/sbi/openapi/model/parameter_combination.c index 06aba7257..62c1e4cb0 100644 --- a/lib/sbi/openapi/model/parameter_combination.c +++ b/lib/sbi/openapi/model/parameter_combination.c @@ -22,19 +22,30 @@ OpenAPI_parameter_combination_t *OpenAPI_parameter_combination_create( void OpenAPI_parameter_combination_free(OpenAPI_parameter_combination_t *parameter_combination) { + OpenAPI_lnode_t *node = NULL; + if (NULL == parameter_combination) { return; } - OpenAPI_lnode_t *node; - ogs_free(parameter_combination->supi); - ogs_free(parameter_combination->dnn); - OpenAPI_snssai_free(parameter_combination->snssai); + if (parameter_combination->supi) { + ogs_free(parameter_combination->supi); + parameter_combination->supi = NULL; + } + if (parameter_combination->dnn) { + ogs_free(parameter_combination->dnn); + parameter_combination->dnn = NULL; + } + if (parameter_combination->snssai) { + OpenAPI_snssai_free(parameter_combination->snssai); + parameter_combination->snssai = NULL; + } ogs_free(parameter_combination); } cJSON *OpenAPI_parameter_combination_convertToJSON(OpenAPI_parameter_combination_t *parameter_combination) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (parameter_combination == NULL) { ogs_error("OpenAPI_parameter_combination_convertToJSON() failed [ParameterCombination]"); @@ -76,39 +87,44 @@ end: OpenAPI_parameter_combination_t *OpenAPI_parameter_combination_parseFromJSON(cJSON *parameter_combinationJSON) { OpenAPI_parameter_combination_t *parameter_combination_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(parameter_combinationJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *dnn = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + supi = cJSON_GetObjectItemCaseSensitive(parameter_combinationJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_parameter_combination_parseFromJSON() failed [supi]"); goto end; } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(parameter_combinationJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(parameter_combinationJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_parameter_combination_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(parameter_combinationJSON, "snssai"); - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(parameter_combinationJSON, "snssai"); if (snssai) { snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); } parameter_combination_local_var = OpenAPI_parameter_combination_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, snssai ? snssai_local_nonprim : NULL ); return parameter_combination_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/partial_record_method.c b/lib/sbi/openapi/model/partial_record_method.c index b37bc29d3..80ea7aab4 100644 --- a/lib/sbi/openapi/model/partial_record_method.c +++ b/lib/sbi/openapi/model/partial_record_method.c @@ -16,16 +16,18 @@ OpenAPI_partial_record_method_t *OpenAPI_partial_record_method_create( void OpenAPI_partial_record_method_free(OpenAPI_partial_record_method_t *partial_record_method) { + OpenAPI_lnode_t *node = NULL; + if (NULL == partial_record_method) { return; } - OpenAPI_lnode_t *node; ogs_free(partial_record_method); } cJSON *OpenAPI_partial_record_method_convertToJSON(OpenAPI_partial_record_method_t *partial_record_method) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (partial_record_method == NULL) { ogs_error("OpenAPI_partial_record_method_convertToJSON() failed [PartialRecordMethod]"); @@ -40,6 +42,7 @@ end: OpenAPI_partial_record_method_t *OpenAPI_partial_record_method_parseFromJSON(cJSON *partial_record_methodJSON) { OpenAPI_partial_record_method_t *partial_record_method_local_var = NULL; + OpenAPI_lnode_t *node = NULL; partial_record_method_local_var = OpenAPI_partial_record_method_create ( ); diff --git a/lib/sbi/openapi/model/partial_record_method_any_of.c b/lib/sbi/openapi/model/partial_record_method_any_of.c index bd18ddabc..2ed5116c5 100644 --- a/lib/sbi/openapi/model/partial_record_method_any_of.c +++ b/lib/sbi/openapi/model/partial_record_method_any_of.c @@ -6,7 +6,7 @@ char* OpenAPI_partial_record_method_any_of_ToString(OpenAPI_partial_record_method_any_of_e partial_record_method_any_of) { - const char *partial_record_method_any_ofArray[] = { "NULL", "_DEFAULT", "INDIVIDUAL" }; + const char *partial_record_method_any_ofArray[] = { "NULL", "DEFAULT", "INDIVIDUAL" }; size_t sizeofArray = sizeof(partial_record_method_any_ofArray) / sizeof(partial_record_method_any_ofArray[0]); if (partial_record_method_any_of < sizeofArray) return (char *)partial_record_method_any_ofArray[partial_record_method_any_of]; @@ -17,7 +17,7 @@ char* OpenAPI_partial_record_method_any_of_ToString(OpenAPI_partial_record_metho OpenAPI_partial_record_method_any_of_e OpenAPI_partial_record_method_any_of_FromString(char* partial_record_method_any_of) { int stringToReturn = 0; - const char *partial_record_method_any_ofArray[] = { "NULL", "_DEFAULT", "INDIVIDUAL" }; + const char *partial_record_method_any_ofArray[] = { "NULL", "DEFAULT", "INDIVIDUAL" }; size_t sizeofArray = sizeof(partial_record_method_any_ofArray) / sizeof(partial_record_method_any_ofArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(partial_record_method_any_of, partial_record_method_any_ofArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/partial_success_report.c b/lib/sbi/openapi/model/partial_success_report.c index b170d7d67..7a5232879 100644 --- a/lib/sbi/openapi/model/partial_success_report.c +++ b/lib/sbi/openapi/model/partial_success_report.c @@ -26,26 +26,40 @@ OpenAPI_partial_success_report_t *OpenAPI_partial_success_report_create( void OpenAPI_partial_success_report_free(OpenAPI_partial_success_report_t *partial_success_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == partial_success_report) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(partial_success_report->rule_reports, node) { - OpenAPI_rule_report_free(node->data); + if (partial_success_report->rule_reports) { + OpenAPI_list_for_each(partial_success_report->rule_reports, node) { + OpenAPI_rule_report_free(node->data); + } + OpenAPI_list_free(partial_success_report->rule_reports); + partial_success_report->rule_reports = NULL; } - OpenAPI_list_free(partial_success_report->rule_reports); - OpenAPI_list_for_each(partial_success_report->sess_rule_reports, node) { - OpenAPI_session_rule_report_free(node->data); + if (partial_success_report->sess_rule_reports) { + OpenAPI_list_for_each(partial_success_report->sess_rule_reports, node) { + OpenAPI_session_rule_report_free(node->data); + } + OpenAPI_list_free(partial_success_report->sess_rule_reports); + partial_success_report->sess_rule_reports = NULL; + } + if (partial_success_report->ue_camping_rep) { + OpenAPI_ue_camping_rep_free(partial_success_report->ue_camping_rep); + partial_success_report->ue_camping_rep = NULL; + } + if (partial_success_report->policy_dec_failure_reports) { + OpenAPI_list_free(partial_success_report->policy_dec_failure_reports); + partial_success_report->policy_dec_failure_reports = NULL; } - OpenAPI_list_free(partial_success_report->sess_rule_reports); - OpenAPI_ue_camping_rep_free(partial_success_report->ue_camping_rep); - OpenAPI_list_free(partial_success_report->policy_dec_failure_reports); ogs_free(partial_success_report); } cJSON *OpenAPI_partial_success_report_convertToJSON(OpenAPI_partial_success_report_t *partial_success_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (partial_success_report == NULL) { ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [PartialSuccessReport]"); @@ -53,6 +67,10 @@ cJSON *OpenAPI_partial_success_report_convertToJSON(OpenAPI_partial_success_repo } item = cJSON_CreateObject(); + if (partial_success_report->failure_cause == OpenAPI_failure_cause_NULL) { + ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [failure_cause]"); + return NULL; + } if (cJSON_AddStringToObject(item, "failureCause", OpenAPI_failure_cause_ToString(partial_success_report->failure_cause)) == NULL) { ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [failure_cause]"); goto end; @@ -64,17 +82,13 @@ cJSON *OpenAPI_partial_success_report_convertToJSON(OpenAPI_partial_success_repo ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [rule_reports]"); goto end; } - - OpenAPI_lnode_t *rule_reports_node; - if (partial_success_report->rule_reports) { - OpenAPI_list_for_each(partial_success_report->rule_reports, rule_reports_node) { - cJSON *itemLocal = OpenAPI_rule_report_convertToJSON(rule_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [rule_reports]"); - goto end; - } - cJSON_AddItemToArray(rule_reportsList, itemLocal); + OpenAPI_list_for_each(partial_success_report->rule_reports, node) { + cJSON *itemLocal = OpenAPI_rule_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [rule_reports]"); + goto end; } + cJSON_AddItemToArray(rule_reportsList, itemLocal); } } @@ -84,17 +98,13 @@ cJSON *OpenAPI_partial_success_report_convertToJSON(OpenAPI_partial_success_repo ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [sess_rule_reports]"); goto end; } - - OpenAPI_lnode_t *sess_rule_reports_node; - if (partial_success_report->sess_rule_reports) { - OpenAPI_list_for_each(partial_success_report->sess_rule_reports, sess_rule_reports_node) { - cJSON *itemLocal = OpenAPI_session_rule_report_convertToJSON(sess_rule_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [sess_rule_reports]"); - goto end; - } - cJSON_AddItemToArray(sess_rule_reportsList, itemLocal); + OpenAPI_list_for_each(partial_success_report->sess_rule_reports, node) { + cJSON *itemLocal = OpenAPI_session_rule_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [sess_rule_reports]"); + goto end; } + cJSON_AddItemToArray(sess_rule_reportsList, itemLocal); } } @@ -111,15 +121,14 @@ cJSON *OpenAPI_partial_success_report_convertToJSON(OpenAPI_partial_success_repo } } - if (partial_success_report->policy_dec_failure_reports) { - cJSON *policy_dec_failure_reports = cJSON_AddArrayToObject(item, "policyDecFailureReports"); - if (policy_dec_failure_reports == NULL) { + if (partial_success_report->policy_dec_failure_reports != OpenAPI_policy_decision_failure_code_NULL) { + cJSON *policy_dec_failure_reportsList = cJSON_AddArrayToObject(item, "policyDecFailureReports"); + if (policy_dec_failure_reportsList == NULL) { ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [policy_dec_failure_reports]"); goto end; } - OpenAPI_lnode_t *policy_dec_failure_reports_node; - OpenAPI_list_for_each(partial_success_report->policy_dec_failure_reports, policy_dec_failure_reports_node) { - if (cJSON_AddStringToObject(policy_dec_failure_reports, "", OpenAPI_policy_decision_failure_code_ToString((intptr_t)policy_dec_failure_reports_node->data)) == NULL) { + OpenAPI_list_for_each(partial_success_report->policy_dec_failure_reports, node) { + if (cJSON_AddStringToObject(policy_dec_failure_reportsList, "", OpenAPI_policy_decision_failure_code_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [policy_dec_failure_reports]"); goto end; } @@ -133,104 +142,100 @@ end: OpenAPI_partial_success_report_t *OpenAPI_partial_success_report_parseFromJSON(cJSON *partial_success_reportJSON) { OpenAPI_partial_success_report_t *partial_success_report_local_var = NULL; - cJSON *failure_cause = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "failureCause"); + OpenAPI_lnode_t *node = NULL; + cJSON *failure_cause = NULL; + OpenAPI_failure_cause_e failure_causeVariable = 0; + cJSON *rule_reports = NULL; + OpenAPI_list_t *rule_reportsList = NULL; + cJSON *sess_rule_reports = NULL; + OpenAPI_list_t *sess_rule_reportsList = NULL; + cJSON *ue_camping_rep = NULL; + OpenAPI_ue_camping_rep_t *ue_camping_rep_local_nonprim = NULL; + cJSON *policy_dec_failure_reports = NULL; + OpenAPI_list_t *policy_dec_failure_reportsList = NULL; + failure_cause = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "failureCause"); if (!failure_cause) { ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [failure_cause]"); goto end; } - - OpenAPI_failure_cause_e failure_causeVariable; if (!cJSON_IsString(failure_cause)) { ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [failure_cause]"); goto end; } failure_causeVariable = OpenAPI_failure_cause_FromString(failure_cause->valuestring); - cJSON *rule_reports = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "ruleReports"); - - OpenAPI_list_t *rule_reportsList; + rule_reports = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "ruleReports"); if (rule_reports) { - cJSON *rule_reports_local_nonprimitive; - if (!cJSON_IsArray(rule_reports)){ - ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [rule_reports]"); - goto end; - } - - rule_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rule_reports_local_nonprimitive, rule_reports ) { - if (!cJSON_IsObject(rule_reports_local_nonprimitive)) { + cJSON *rule_reports_local = NULL; + if (!cJSON_IsArray(rule_reports)) { ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [rule_reports]"); goto end; } - OpenAPI_rule_report_t *rule_reportsItem = OpenAPI_rule_report_parseFromJSON(rule_reports_local_nonprimitive); - if (!rule_reportsItem) { - ogs_error("No rule_reportsItem"); - OpenAPI_list_free(rule_reportsList); - goto end; + rule_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rule_reports_local, rule_reports) { + if (!cJSON_IsObject(rule_reports_local)) { + ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [rule_reports]"); + goto end; + } + OpenAPI_rule_report_t *rule_reportsItem = OpenAPI_rule_report_parseFromJSON(rule_reports_local); + if (!rule_reportsItem) { + ogs_error("No rule_reportsItem"); + OpenAPI_list_free(rule_reportsList); + goto end; + } + OpenAPI_list_add(rule_reportsList, rule_reportsItem); } - - OpenAPI_list_add(rule_reportsList, rule_reportsItem); - } } - cJSON *sess_rule_reports = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "sessRuleReports"); - - OpenAPI_list_t *sess_rule_reportsList; + sess_rule_reports = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "sessRuleReports"); if (sess_rule_reports) { - cJSON *sess_rule_reports_local_nonprimitive; - if (!cJSON_IsArray(sess_rule_reports)){ - ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [sess_rule_reports]"); - goto end; - } - - sess_rule_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sess_rule_reports_local_nonprimitive, sess_rule_reports ) { - if (!cJSON_IsObject(sess_rule_reports_local_nonprimitive)) { + cJSON *sess_rule_reports_local = NULL; + if (!cJSON_IsArray(sess_rule_reports)) { ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [sess_rule_reports]"); goto end; } - OpenAPI_session_rule_report_t *sess_rule_reportsItem = OpenAPI_session_rule_report_parseFromJSON(sess_rule_reports_local_nonprimitive); - if (!sess_rule_reportsItem) { - ogs_error("No sess_rule_reportsItem"); - OpenAPI_list_free(sess_rule_reportsList); - goto end; + sess_rule_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sess_rule_reports_local, sess_rule_reports) { + if (!cJSON_IsObject(sess_rule_reports_local)) { + ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [sess_rule_reports]"); + goto end; + } + OpenAPI_session_rule_report_t *sess_rule_reportsItem = OpenAPI_session_rule_report_parseFromJSON(sess_rule_reports_local); + if (!sess_rule_reportsItem) { + ogs_error("No sess_rule_reportsItem"); + OpenAPI_list_free(sess_rule_reportsList); + goto end; + } + OpenAPI_list_add(sess_rule_reportsList, sess_rule_reportsItem); } - - OpenAPI_list_add(sess_rule_reportsList, sess_rule_reportsItem); - } } - cJSON *ue_camping_rep = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "ueCampingRep"); - - OpenAPI_ue_camping_rep_t *ue_camping_rep_local_nonprim = NULL; + ue_camping_rep = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "ueCampingRep"); if (ue_camping_rep) { ue_camping_rep_local_nonprim = OpenAPI_ue_camping_rep_parseFromJSON(ue_camping_rep); } - cJSON *policy_dec_failure_reports = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "policyDecFailureReports"); - - OpenAPI_list_t *policy_dec_failure_reportsList; + policy_dec_failure_reports = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "policyDecFailureReports"); if (policy_dec_failure_reports) { - cJSON *policy_dec_failure_reports_local_nonprimitive; - if (!cJSON_IsArray(policy_dec_failure_reports)) { - ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [policy_dec_failure_reports]"); - goto end; - } - - policy_dec_failure_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(policy_dec_failure_reports_local_nonprimitive, policy_dec_failure_reports ) { - if (!cJSON_IsString(policy_dec_failure_reports_local_nonprimitive)){ + cJSON *policy_dec_failure_reports_local = NULL; + if (!cJSON_IsArray(policy_dec_failure_reports)) { ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [policy_dec_failure_reports]"); goto end; } - OpenAPI_list_add(policy_dec_failure_reportsList, (void *)OpenAPI_policy_decision_failure_code_FromString(policy_dec_failure_reports_local_nonprimitive->valuestring)); - } + policy_dec_failure_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(policy_dec_failure_reports_local, policy_dec_failure_reports) { + if (!cJSON_IsString(policy_dec_failure_reports_local)) { + ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [policy_dec_failure_reports]"); + goto end; + } + OpenAPI_list_add(policy_dec_failure_reportsList, (void *)OpenAPI_policy_decision_failure_code_FromString(policy_dec_failure_reports_local->valuestring)); + } } partial_success_report_local_var = OpenAPI_partial_success_report_create ( @@ -243,6 +248,28 @@ OpenAPI_partial_success_report_t *OpenAPI_partial_success_report_parseFromJSON(c return partial_success_report_local_var; end: + if (rule_reportsList) { + OpenAPI_list_for_each(rule_reportsList, node) { + OpenAPI_rule_report_free(node->data); + } + OpenAPI_list_free(rule_reportsList); + rule_reportsList = NULL; + } + if (sess_rule_reportsList) { + OpenAPI_list_for_each(sess_rule_reportsList, node) { + OpenAPI_session_rule_report_free(node->data); + } + OpenAPI_list_free(sess_rule_reportsList); + sess_rule_reportsList = NULL; + } + if (ue_camping_rep_local_nonprim) { + OpenAPI_ue_camping_rep_free(ue_camping_rep_local_nonprim); + ue_camping_rep_local_nonprim = NULL; + } + if (policy_dec_failure_reportsList) { + OpenAPI_list_free(policy_dec_failure_reportsList); + policy_dec_failure_reportsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/patch_item.c b/lib/sbi/openapi/model/patch_item.c index 60b15607e..0815420b1 100644 --- a/lib/sbi/openapi/model/patch_item.c +++ b/lib/sbi/openapi/model/patch_item.c @@ -24,19 +24,30 @@ OpenAPI_patch_item_t *OpenAPI_patch_item_create( void OpenAPI_patch_item_free(OpenAPI_patch_item_t *patch_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == patch_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(patch_item->path); - ogs_free(patch_item->from); - OpenAPI_any_type_free(patch_item->value); + if (patch_item->path) { + ogs_free(patch_item->path); + patch_item->path = NULL; + } + if (patch_item->from) { + ogs_free(patch_item->from); + patch_item->from = NULL; + } + if (patch_item->value) { + OpenAPI_any_type_free(patch_item->value); + patch_item->value = NULL; + } ogs_free(patch_item); } cJSON *OpenAPI_patch_item_convertToJSON(OpenAPI_patch_item_t *patch_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (patch_item == NULL) { ogs_error("OpenAPI_patch_item_convertToJSON() failed [PatchItem]"); @@ -44,11 +55,19 @@ cJSON *OpenAPI_patch_item_convertToJSON(OpenAPI_patch_item_t *patch_item) } item = cJSON_CreateObject(); + if (patch_item->op == OpenAPI_patch_operation_NULL) { + ogs_error("OpenAPI_patch_item_convertToJSON() failed [op]"); + return NULL; + } if (cJSON_AddStringToObject(item, "op", OpenAPI_patch_operation_ToString(patch_item->op)) == NULL) { ogs_error("OpenAPI_patch_item_convertToJSON() failed [op]"); goto end; } + if (!patch_item->path) { + ogs_error("OpenAPI_patch_item_convertToJSON() failed [path]"); + return NULL; + } if (cJSON_AddStringToObject(item, "path", patch_item->path) == NULL) { ogs_error("OpenAPI_patch_item_convertToJSON() failed [path]"); goto end; @@ -81,42 +100,43 @@ end: OpenAPI_patch_item_t *OpenAPI_patch_item_parseFromJSON(cJSON *patch_itemJSON) { OpenAPI_patch_item_t *patch_item_local_var = NULL; - cJSON *op = cJSON_GetObjectItemCaseSensitive(patch_itemJSON, "op"); + OpenAPI_lnode_t *node = NULL; + cJSON *op = NULL; + OpenAPI_patch_operation_e opVariable = 0; + cJSON *path = NULL; + cJSON *from = NULL; + cJSON *value = NULL; + OpenAPI_any_type_t *value_local_object = NULL; + op = cJSON_GetObjectItemCaseSensitive(patch_itemJSON, "op"); if (!op) { ogs_error("OpenAPI_patch_item_parseFromJSON() failed [op]"); goto end; } - - OpenAPI_patch_operation_e opVariable; if (!cJSON_IsString(op)) { ogs_error("OpenAPI_patch_item_parseFromJSON() failed [op]"); goto end; } opVariable = OpenAPI_patch_operation_FromString(op->valuestring); - cJSON *path = cJSON_GetObjectItemCaseSensitive(patch_itemJSON, "path"); + path = cJSON_GetObjectItemCaseSensitive(patch_itemJSON, "path"); if (!path) { ogs_error("OpenAPI_patch_item_parseFromJSON() failed [path]"); goto end; } - if (!cJSON_IsString(path)) { ogs_error("OpenAPI_patch_item_parseFromJSON() failed [path]"); goto end; } - cJSON *from = cJSON_GetObjectItemCaseSensitive(patch_itemJSON, "from"); - + from = cJSON_GetObjectItemCaseSensitive(patch_itemJSON, "from"); if (from) { - if (!cJSON_IsString(from)) { + if (!cJSON_IsString(from) && !cJSON_IsNull(from)) { ogs_error("OpenAPI_patch_item_parseFromJSON() failed [from]"); goto end; } } - cJSON *value = cJSON_GetObjectItemCaseSensitive(patch_itemJSON, "value"); - - OpenAPI_any_type_t *value_local_object = NULL; + value = cJSON_GetObjectItemCaseSensitive(patch_itemJSON, "value"); if (value) { value_local_object = OpenAPI_any_type_parseFromJSON(value); } @@ -124,12 +144,16 @@ OpenAPI_patch_item_t *OpenAPI_patch_item_parseFromJSON(cJSON *patch_itemJSON) patch_item_local_var = OpenAPI_patch_item_create ( opVariable, ogs_strdup(path->valuestring), - from ? ogs_strdup(from->valuestring) : NULL, + from && !cJSON_IsNull(from) ? ogs_strdup(from->valuestring) : NULL, value ? value_local_object : NULL ); return patch_item_local_var; end: + if (value_local_object) { + OpenAPI_any_type_free(value_local_object); + value_local_object = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/patch_operation.c b/lib/sbi/openapi/model/patch_operation.c index 2e725acb8..5861a52d5 100644 --- a/lib/sbi/openapi/model/patch_operation.c +++ b/lib/sbi/openapi/model/patch_operation.c @@ -6,7 +6,7 @@ char* OpenAPI_patch_operation_ToString(OpenAPI_patch_operation_e patch_operation) { - const char *patch_operationArray[] = { "NULL", "add", "copy", "move", "_remove", "replace", "test" }; + const char *patch_operationArray[] = { "NULL", "add", "copy", "move", "remove", "replace", "test" }; size_t sizeofArray = sizeof(patch_operationArray) / sizeof(patch_operationArray[0]); if (patch_operation < sizeofArray) return (char *)patch_operationArray[patch_operation]; @@ -17,7 +17,7 @@ char* OpenAPI_patch_operation_ToString(OpenAPI_patch_operation_e patch_operation OpenAPI_patch_operation_e OpenAPI_patch_operation_FromString(char* patch_operation) { int stringToReturn = 0; - const char *patch_operationArray[] = { "NULL", "add", "copy", "move", "_remove", "replace", "test" }; + const char *patch_operationArray[] = { "NULL", "add", "copy", "move", "remove", "replace", "test" }; size_t sizeofArray = sizeof(patch_operationArray) / sizeof(patch_operationArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(patch_operation, patch_operationArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/patch_result.c b/lib/sbi/openapi/model/patch_result.c index 4343193cb..fe37bf2eb 100644 --- a/lib/sbi/openapi/model/patch_result.c +++ b/lib/sbi/openapi/model/patch_result.c @@ -18,20 +18,25 @@ OpenAPI_patch_result_t *OpenAPI_patch_result_create( void OpenAPI_patch_result_free(OpenAPI_patch_result_t *patch_result) { + OpenAPI_lnode_t *node = NULL; + if (NULL == patch_result) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(patch_result->report, node) { - OpenAPI_report_item_free(node->data); + if (patch_result->report) { + OpenAPI_list_for_each(patch_result->report, node) { + OpenAPI_report_item_free(node->data); + } + OpenAPI_list_free(patch_result->report); + patch_result->report = NULL; } - OpenAPI_list_free(patch_result->report); ogs_free(patch_result); } cJSON *OpenAPI_patch_result_convertToJSON(OpenAPI_patch_result_t *patch_result) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (patch_result == NULL) { ogs_error("OpenAPI_patch_result_convertToJSON() failed [PatchResult]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_patch_result_convertToJSON(OpenAPI_patch_result_t *patch_result) } item = cJSON_CreateObject(); + if (!patch_result->report) { + ogs_error("OpenAPI_patch_result_convertToJSON() failed [report]"); + return NULL; + } cJSON *reportList = cJSON_AddArrayToObject(item, "report"); if (reportList == NULL) { ogs_error("OpenAPI_patch_result_convertToJSON() failed [report]"); goto end; } - - OpenAPI_lnode_t *report_node; - if (patch_result->report) { - OpenAPI_list_for_each(patch_result->report, report_node) { - cJSON *itemLocal = OpenAPI_report_item_convertToJSON(report_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_patch_result_convertToJSON() failed [report]"); - goto end; - } - cJSON_AddItemToArray(reportList, itemLocal); + OpenAPI_list_for_each(patch_result->report, node) { + cJSON *itemLocal = OpenAPI_report_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_patch_result_convertToJSON() failed [report]"); + goto end; } + cJSON_AddItemToArray(reportList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_patch_result_t *OpenAPI_patch_result_parseFromJSON(cJSON *patch_resultJSON) { OpenAPI_patch_result_t *patch_result_local_var = NULL; - cJSON *report = cJSON_GetObjectItemCaseSensitive(patch_resultJSON, "report"); + OpenAPI_lnode_t *node = NULL; + cJSON *report = NULL; + OpenAPI_list_t *reportList = NULL; + report = cJSON_GetObjectItemCaseSensitive(patch_resultJSON, "report"); if (!report) { ogs_error("OpenAPI_patch_result_parseFromJSON() failed [report]"); goto end; } - - OpenAPI_list_t *reportList; - cJSON *report_local_nonprimitive; - if (!cJSON_IsArray(report)){ - ogs_error("OpenAPI_patch_result_parseFromJSON() failed [report]"); - goto end; - } - - reportList = OpenAPI_list_create(); - - cJSON_ArrayForEach(report_local_nonprimitive, report ) { - if (!cJSON_IsObject(report_local_nonprimitive)) { + cJSON *report_local = NULL; + if (!cJSON_IsArray(report)) { ogs_error("OpenAPI_patch_result_parseFromJSON() failed [report]"); goto end; } - OpenAPI_report_item_t *reportItem = OpenAPI_report_item_parseFromJSON(report_local_nonprimitive); - if (!reportItem) { - ogs_error("No reportItem"); - OpenAPI_list_free(reportList); - goto end; + reportList = OpenAPI_list_create(); + + cJSON_ArrayForEach(report_local, report) { + if (!cJSON_IsObject(report_local)) { + ogs_error("OpenAPI_patch_result_parseFromJSON() failed [report]"); + goto end; + } + OpenAPI_report_item_t *reportItem = OpenAPI_report_item_parseFromJSON(report_local); + if (!reportItem) { + ogs_error("No reportItem"); + OpenAPI_list_free(reportList); + goto end; + } + OpenAPI_list_add(reportList, reportItem); } - OpenAPI_list_add(reportList, reportItem); - } - patch_result_local_var = OpenAPI_patch_result_create ( reportList ); return patch_result_local_var; end: + if (reportList) { + OpenAPI_list_for_each(reportList, node) { + OpenAPI_report_item_free(node->data); + } + OpenAPI_list_free(reportList); + reportList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pc5_flow_bit_rates.c b/lib/sbi/openapi/model/pc5_flow_bit_rates.c index 0c7ccddfd..31570a237 100644 --- a/lib/sbi/openapi/model/pc5_flow_bit_rates.c +++ b/lib/sbi/openapi/model/pc5_flow_bit_rates.c @@ -20,18 +20,26 @@ OpenAPI_pc5_flow_bit_rates_t *OpenAPI_pc5_flow_bit_rates_create( void OpenAPI_pc5_flow_bit_rates_free(OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pc5_flow_bit_rates) { return; } - OpenAPI_lnode_t *node; - ogs_free(pc5_flow_bit_rates->gua_fbr); - ogs_free(pc5_flow_bit_rates->max_fbr); + if (pc5_flow_bit_rates->gua_fbr) { + ogs_free(pc5_flow_bit_rates->gua_fbr); + pc5_flow_bit_rates->gua_fbr = NULL; + } + if (pc5_flow_bit_rates->max_fbr) { + ogs_free(pc5_flow_bit_rates->max_fbr); + pc5_flow_bit_rates->max_fbr = NULL; + } ogs_free(pc5_flow_bit_rates); } cJSON *OpenAPI_pc5_flow_bit_rates_convertToJSON(OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pc5_flow_bit_rates == NULL) { ogs_error("OpenAPI_pc5_flow_bit_rates_convertToJSON() failed [Pc5FlowBitRates]"); @@ -60,27 +68,28 @@ end: OpenAPI_pc5_flow_bit_rates_t *OpenAPI_pc5_flow_bit_rates_parseFromJSON(cJSON *pc5_flow_bit_ratesJSON) { OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates_local_var = NULL; - cJSON *gua_fbr = cJSON_GetObjectItemCaseSensitive(pc5_flow_bit_ratesJSON, "guaFbr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *gua_fbr = NULL; + cJSON *max_fbr = NULL; + gua_fbr = cJSON_GetObjectItemCaseSensitive(pc5_flow_bit_ratesJSON, "guaFbr"); if (gua_fbr) { - if (!cJSON_IsString(gua_fbr)) { + if (!cJSON_IsString(gua_fbr) && !cJSON_IsNull(gua_fbr)) { ogs_error("OpenAPI_pc5_flow_bit_rates_parseFromJSON() failed [gua_fbr]"); goto end; } } - cJSON *max_fbr = cJSON_GetObjectItemCaseSensitive(pc5_flow_bit_ratesJSON, "maxFbr"); - + max_fbr = cJSON_GetObjectItemCaseSensitive(pc5_flow_bit_ratesJSON, "maxFbr"); if (max_fbr) { - if (!cJSON_IsString(max_fbr)) { + if (!cJSON_IsString(max_fbr) && !cJSON_IsNull(max_fbr)) { ogs_error("OpenAPI_pc5_flow_bit_rates_parseFromJSON() failed [max_fbr]"); goto end; } } pc5_flow_bit_rates_local_var = OpenAPI_pc5_flow_bit_rates_create ( - gua_fbr ? ogs_strdup(gua_fbr->valuestring) : NULL, - max_fbr ? ogs_strdup(max_fbr->valuestring) : NULL + gua_fbr && !cJSON_IsNull(gua_fbr) ? ogs_strdup(gua_fbr->valuestring) : NULL, + max_fbr && !cJSON_IsNull(max_fbr) ? ogs_strdup(max_fbr->valuestring) : NULL ); return pc5_flow_bit_rates_local_var; diff --git a/lib/sbi/openapi/model/pc5_qo_s_para.c b/lib/sbi/openapi/model/pc5_qo_s_para.c index 9be83ba11..c7e4e5499 100644 --- a/lib/sbi/openapi/model/pc5_qo_s_para.c +++ b/lib/sbi/openapi/model/pc5_qo_s_para.c @@ -20,21 +20,29 @@ OpenAPI_pc5_qo_s_para_t *OpenAPI_pc5_qo_s_para_create( void OpenAPI_pc5_qo_s_para_free(OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pc5_qo_s_para) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(pc5_qo_s_para->pc5_qos_flow_list, node) { - OpenAPI_pc5_qos_flow_item_free(node->data); + if (pc5_qo_s_para->pc5_qos_flow_list) { + OpenAPI_list_for_each(pc5_qo_s_para->pc5_qos_flow_list, node) { + OpenAPI_pc5_qos_flow_item_free(node->data); + } + OpenAPI_list_free(pc5_qo_s_para->pc5_qos_flow_list); + pc5_qo_s_para->pc5_qos_flow_list = NULL; + } + if (pc5_qo_s_para->pc5_link_ambr) { + ogs_free(pc5_qo_s_para->pc5_link_ambr); + pc5_qo_s_para->pc5_link_ambr = NULL; } - OpenAPI_list_free(pc5_qo_s_para->pc5_qos_flow_list); - ogs_free(pc5_qo_s_para->pc5_link_ambr); ogs_free(pc5_qo_s_para); } cJSON *OpenAPI_pc5_qo_s_para_convertToJSON(OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pc5_qo_s_para == NULL) { ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [Pc5QoSPara]"); @@ -42,22 +50,22 @@ cJSON *OpenAPI_pc5_qo_s_para_convertToJSON(OpenAPI_pc5_qo_s_para_t *pc5_qo_s_par } item = cJSON_CreateObject(); + if (!pc5_qo_s_para->pc5_qos_flow_list) { + ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [pc5_qos_flow_list]"); + return NULL; + } cJSON *pc5_qos_flow_listList = cJSON_AddArrayToObject(item, "pc5QosFlowList"); if (pc5_qos_flow_listList == NULL) { ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [pc5_qos_flow_list]"); goto end; } - - OpenAPI_lnode_t *pc5_qos_flow_list_node; - if (pc5_qo_s_para->pc5_qos_flow_list) { - OpenAPI_list_for_each(pc5_qo_s_para->pc5_qos_flow_list, pc5_qos_flow_list_node) { - cJSON *itemLocal = OpenAPI_pc5_qos_flow_item_convertToJSON(pc5_qos_flow_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [pc5_qos_flow_list]"); - goto end; - } - cJSON_AddItemToArray(pc5_qos_flow_listList, itemLocal); + OpenAPI_list_for_each(pc5_qo_s_para->pc5_qos_flow_list, node) { + cJSON *itemLocal = OpenAPI_pc5_qos_flow_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pc5_qo_s_para_convertToJSON() failed [pc5_qos_flow_list]"); + goto end; } + cJSON_AddItemToArray(pc5_qos_flow_listList, itemLocal); } if (pc5_qo_s_para->pc5_link_ambr) { @@ -74,41 +82,40 @@ end: OpenAPI_pc5_qo_s_para_t *OpenAPI_pc5_qo_s_para_parseFromJSON(cJSON *pc5_qo_s_paraJSON) { OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para_local_var = NULL; - cJSON *pc5_qos_flow_list = cJSON_GetObjectItemCaseSensitive(pc5_qo_s_paraJSON, "pc5QosFlowList"); + OpenAPI_lnode_t *node = NULL; + cJSON *pc5_qos_flow_list = NULL; + OpenAPI_list_t *pc5_qos_flow_listList = NULL; + cJSON *pc5_link_ambr = NULL; + pc5_qos_flow_list = cJSON_GetObjectItemCaseSensitive(pc5_qo_s_paraJSON, "pc5QosFlowList"); if (!pc5_qos_flow_list) { ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_qos_flow_list]"); goto end; } - - OpenAPI_list_t *pc5_qos_flow_listList; - cJSON *pc5_qos_flow_list_local_nonprimitive; - if (!cJSON_IsArray(pc5_qos_flow_list)){ - ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_qos_flow_list]"); - goto end; - } - - pc5_qos_flow_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pc5_qos_flow_list_local_nonprimitive, pc5_qos_flow_list ) { - if (!cJSON_IsObject(pc5_qos_flow_list_local_nonprimitive)) { + cJSON *pc5_qos_flow_list_local = NULL; + if (!cJSON_IsArray(pc5_qos_flow_list)) { ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_qos_flow_list]"); goto end; } - OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_listItem = OpenAPI_pc5_qos_flow_item_parseFromJSON(pc5_qos_flow_list_local_nonprimitive); - if (!pc5_qos_flow_listItem) { - ogs_error("No pc5_qos_flow_listItem"); - OpenAPI_list_free(pc5_qos_flow_listList); - goto end; + pc5_qos_flow_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pc5_qos_flow_list_local, pc5_qos_flow_list) { + if (!cJSON_IsObject(pc5_qos_flow_list_local)) { + ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_qos_flow_list]"); + goto end; + } + OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_listItem = OpenAPI_pc5_qos_flow_item_parseFromJSON(pc5_qos_flow_list_local); + if (!pc5_qos_flow_listItem) { + ogs_error("No pc5_qos_flow_listItem"); + OpenAPI_list_free(pc5_qos_flow_listList); + goto end; + } + OpenAPI_list_add(pc5_qos_flow_listList, pc5_qos_flow_listItem); } - OpenAPI_list_add(pc5_qos_flow_listList, pc5_qos_flow_listItem); - } - - cJSON *pc5_link_ambr = cJSON_GetObjectItemCaseSensitive(pc5_qo_s_paraJSON, "pc5LinkAmbr"); - + pc5_link_ambr = cJSON_GetObjectItemCaseSensitive(pc5_qo_s_paraJSON, "pc5LinkAmbr"); if (pc5_link_ambr) { - if (!cJSON_IsString(pc5_link_ambr)) { + if (!cJSON_IsString(pc5_link_ambr) && !cJSON_IsNull(pc5_link_ambr)) { ogs_error("OpenAPI_pc5_qo_s_para_parseFromJSON() failed [pc5_link_ambr]"); goto end; } @@ -116,11 +123,18 @@ OpenAPI_pc5_qo_s_para_t *OpenAPI_pc5_qo_s_para_parseFromJSON(cJSON *pc5_qo_s_par pc5_qo_s_para_local_var = OpenAPI_pc5_qo_s_para_create ( pc5_qos_flow_listList, - pc5_link_ambr ? ogs_strdup(pc5_link_ambr->valuestring) : NULL + pc5_link_ambr && !cJSON_IsNull(pc5_link_ambr) ? ogs_strdup(pc5_link_ambr->valuestring) : NULL ); return pc5_qo_s_para_local_var; end: + if (pc5_qos_flow_listList) { + OpenAPI_list_for_each(pc5_qos_flow_listList, node) { + OpenAPI_pc5_qos_flow_item_free(node->data); + } + OpenAPI_list_free(pc5_qos_flow_listList); + pc5_qos_flow_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pc5_qos_flow_item.c b/lib/sbi/openapi/model/pc5_qos_flow_item.c index 78499f4e6..2a7d2cead 100644 --- a/lib/sbi/openapi/model/pc5_qos_flow_item.c +++ b/lib/sbi/openapi/model/pc5_qos_flow_item.c @@ -24,17 +24,22 @@ OpenAPI_pc5_qos_flow_item_t *OpenAPI_pc5_qos_flow_item_create( void OpenAPI_pc5_qos_flow_item_free(OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pc5_qos_flow_item) { return; } - OpenAPI_lnode_t *node; - OpenAPI_pc5_flow_bit_rates_free(pc5_qos_flow_item->pc5_flow_bit_rates); + if (pc5_qos_flow_item->pc5_flow_bit_rates) { + OpenAPI_pc5_flow_bit_rates_free(pc5_qos_flow_item->pc5_flow_bit_rates); + pc5_qos_flow_item->pc5_flow_bit_rates = NULL; + } ogs_free(pc5_qos_flow_item); } cJSON *OpenAPI_pc5_qos_flow_item_convertToJSON(OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pc5_qos_flow_item == NULL) { ogs_error("OpenAPI_pc5_qos_flow_item_convertToJSON() failed [Pc5QosFlowItem]"); @@ -74,26 +79,27 @@ end: OpenAPI_pc5_qos_flow_item_t *OpenAPI_pc5_qos_flow_item_parseFromJSON(cJSON *pc5_qos_flow_itemJSON) { OpenAPI_pc5_qos_flow_item_t *pc5_qos_flow_item_local_var = NULL; - cJSON *pqi = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "pqi"); + OpenAPI_lnode_t *node = NULL; + cJSON *pqi = NULL; + cJSON *pc5_flow_bit_rates = NULL; + OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates_local_nonprim = NULL; + cJSON *range = NULL; + pqi = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "pqi"); if (!pqi) { ogs_error("OpenAPI_pc5_qos_flow_item_parseFromJSON() failed [pqi]"); goto end; } - if (!cJSON_IsNumber(pqi)) { ogs_error("OpenAPI_pc5_qos_flow_item_parseFromJSON() failed [pqi]"); goto end; } - cJSON *pc5_flow_bit_rates = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "pc5FlowBitRates"); - - OpenAPI_pc5_flow_bit_rates_t *pc5_flow_bit_rates_local_nonprim = NULL; + pc5_flow_bit_rates = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "pc5FlowBitRates"); if (pc5_flow_bit_rates) { pc5_flow_bit_rates_local_nonprim = OpenAPI_pc5_flow_bit_rates_parseFromJSON(pc5_flow_bit_rates); } - cJSON *range = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "range"); - + range = cJSON_GetObjectItemCaseSensitive(pc5_qos_flow_itemJSON, "range"); if (range) { if (!cJSON_IsNumber(range)) { ogs_error("OpenAPI_pc5_qos_flow_item_parseFromJSON() failed [range]"); @@ -111,6 +117,10 @@ OpenAPI_pc5_qos_flow_item_t *OpenAPI_pc5_qos_flow_item_parseFromJSON(cJSON *pc5_ return pc5_qos_flow_item_local_var; end: + if (pc5_flow_bit_rates_local_nonprim) { + OpenAPI_pc5_flow_bit_rates_free(pc5_flow_bit_rates_local_nonprim); + pc5_flow_bit_rates_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pcc_rule.c b/lib/sbi/openapi/model/pcc_rule.c index c857ce952..004f15d7d 100644 --- a/lib/sbi/openapi/model/pcc_rule.c +++ b/lib/sbi/openapi/model/pcc_rule.c @@ -7,7 +7,7 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_create( OpenAPI_list_t *flow_infos, char *app_id, - char app_descriptor, + char *app_descriptor, bool is_cont_ver, int cont_ver, char *pcc_rule_id, @@ -72,59 +72,113 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_create( void OpenAPI_pcc_rule_free(OpenAPI_pcc_rule_t *pcc_rule) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pcc_rule) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(pcc_rule->flow_infos, node) { - OpenAPI_flow_information_free(node->data); + if (pcc_rule->flow_infos) { + OpenAPI_list_for_each(pcc_rule->flow_infos, node) { + OpenAPI_flow_information_free(node->data); + } + OpenAPI_list_free(pcc_rule->flow_infos); + pcc_rule->flow_infos = NULL; } - OpenAPI_list_free(pcc_rule->flow_infos); - ogs_free(pcc_rule->app_id); - ogs_free(pcc_rule->pcc_rule_id); - OpenAPI_list_for_each(pcc_rule->ref_qos_data, node) { - ogs_free(node->data); + if (pcc_rule->app_id) { + ogs_free(pcc_rule->app_id); + pcc_rule->app_id = NULL; } - OpenAPI_list_free(pcc_rule->ref_qos_data); - OpenAPI_list_for_each(pcc_rule->ref_alt_qos_params, node) { - ogs_free(node->data); + if (pcc_rule->app_descriptor) { + ogs_free(pcc_rule->app_descriptor); + pcc_rule->app_descriptor = NULL; } - OpenAPI_list_free(pcc_rule->ref_alt_qos_params); - OpenAPI_list_for_each(pcc_rule->ref_tc_data, node) { - ogs_free(node->data); + if (pcc_rule->pcc_rule_id) { + ogs_free(pcc_rule->pcc_rule_id); + pcc_rule->pcc_rule_id = NULL; } - OpenAPI_list_free(pcc_rule->ref_tc_data); - OpenAPI_list_for_each(pcc_rule->ref_chg_data, node) { - ogs_free(node->data); + if (pcc_rule->ref_qos_data) { + OpenAPI_list_for_each(pcc_rule->ref_qos_data, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule->ref_qos_data); + pcc_rule->ref_qos_data = NULL; } - OpenAPI_list_free(pcc_rule->ref_chg_data); - OpenAPI_list_for_each(pcc_rule->ref_chg_n3g_data, node) { - ogs_free(node->data); + if (pcc_rule->ref_alt_qos_params) { + OpenAPI_list_for_each(pcc_rule->ref_alt_qos_params, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule->ref_alt_qos_params); + pcc_rule->ref_alt_qos_params = NULL; } - OpenAPI_list_free(pcc_rule->ref_chg_n3g_data); - OpenAPI_list_for_each(pcc_rule->ref_um_data, node) { - ogs_free(node->data); + if (pcc_rule->ref_tc_data) { + OpenAPI_list_for_each(pcc_rule->ref_tc_data, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule->ref_tc_data); + pcc_rule->ref_tc_data = NULL; } - OpenAPI_list_free(pcc_rule->ref_um_data); - OpenAPI_list_for_each(pcc_rule->ref_um_n3g_data, node) { - ogs_free(node->data); + if (pcc_rule->ref_chg_data) { + OpenAPI_list_for_each(pcc_rule->ref_chg_data, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule->ref_chg_data); + pcc_rule->ref_chg_data = NULL; } - OpenAPI_list_free(pcc_rule->ref_um_n3g_data); - ogs_free(pcc_rule->ref_cond_data); - OpenAPI_list_for_each(pcc_rule->ref_qos_mon, node) { - ogs_free(node->data); + if (pcc_rule->ref_chg_n3g_data) { + OpenAPI_list_for_each(pcc_rule->ref_chg_n3g_data, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule->ref_chg_n3g_data); + pcc_rule->ref_chg_n3g_data = NULL; + } + if (pcc_rule->ref_um_data) { + OpenAPI_list_for_each(pcc_rule->ref_um_data, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule->ref_um_data); + pcc_rule->ref_um_data = NULL; + } + if (pcc_rule->ref_um_n3g_data) { + OpenAPI_list_for_each(pcc_rule->ref_um_n3g_data, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule->ref_um_n3g_data); + pcc_rule->ref_um_n3g_data = NULL; + } + if (pcc_rule->ref_cond_data) { + ogs_free(pcc_rule->ref_cond_data); + pcc_rule->ref_cond_data = NULL; + } + if (pcc_rule->ref_qos_mon) { + OpenAPI_list_for_each(pcc_rule->ref_qos_mon, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule->ref_qos_mon); + pcc_rule->ref_qos_mon = NULL; + } + if (pcc_rule->tscai_input_dl) { + OpenAPI_tscai_input_container_free(pcc_rule->tscai_input_dl); + pcc_rule->tscai_input_dl = NULL; + } + if (pcc_rule->tscai_input_ul) { + OpenAPI_tscai_input_container_free(pcc_rule->tscai_input_ul); + pcc_rule->tscai_input_ul = NULL; + } + if (pcc_rule->dd_notif_ctrl) { + OpenAPI_downlink_data_notification_control_free(pcc_rule->dd_notif_ctrl); + pcc_rule->dd_notif_ctrl = NULL; + } + if (pcc_rule->dd_notif_ctrl2) { + OpenAPI_downlink_data_notification_control_rm_free(pcc_rule->dd_notif_ctrl2); + pcc_rule->dd_notif_ctrl2 = NULL; } - OpenAPI_list_free(pcc_rule->ref_qos_mon); - OpenAPI_tscai_input_container_free(pcc_rule->tscai_input_dl); - OpenAPI_tscai_input_container_free(pcc_rule->tscai_input_ul); - OpenAPI_downlink_data_notification_control_free(pcc_rule->dd_notif_ctrl); - OpenAPI_downlink_data_notification_control_rm_free(pcc_rule->dd_notif_ctrl2); ogs_free(pcc_rule); } cJSON *OpenAPI_pcc_rule_convertToJSON(OpenAPI_pcc_rule_t *pcc_rule) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pcc_rule == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [PccRule]"); @@ -138,17 +192,13 @@ cJSON *OpenAPI_pcc_rule_convertToJSON(OpenAPI_pcc_rule_t *pcc_rule) ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [flow_infos]"); goto end; } - - OpenAPI_lnode_t *flow_infos_node; - if (pcc_rule->flow_infos) { - OpenAPI_list_for_each(pcc_rule->flow_infos, flow_infos_node) { - cJSON *itemLocal = OpenAPI_flow_information_convertToJSON(flow_infos_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [flow_infos]"); - goto end; - } - cJSON_AddItemToArray(flow_infosList, itemLocal); + OpenAPI_list_for_each(pcc_rule->flow_infos, node) { + cJSON *itemLocal = OpenAPI_flow_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [flow_infos]"); + goto end; } + cJSON_AddItemToArray(flow_infosList, itemLocal); } } @@ -160,7 +210,7 @@ cJSON *OpenAPI_pcc_rule_convertToJSON(OpenAPI_pcc_rule_t *pcc_rule) } if (pcc_rule->app_descriptor) { - if (cJSON_AddNumberToObject(item, "appDescriptor", pcc_rule->app_descriptor) == NULL) { + if (cJSON_AddStringToObject(item, "appDescriptor", pcc_rule->app_descriptor) == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [app_descriptor]"); goto end; } @@ -173,6 +223,10 @@ cJSON *OpenAPI_pcc_rule_convertToJSON(OpenAPI_pcc_rule_t *pcc_rule) } } + if (!pcc_rule->pcc_rule_id) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [pcc_rule_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "pccRuleId", pcc_rule->pcc_rule_id) == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [pcc_rule_id]"); goto end; @@ -185,7 +239,7 @@ cJSON *OpenAPI_pcc_rule_convertToJSON(OpenAPI_pcc_rule_t *pcc_rule) } } - if (pcc_rule->af_sig_protocol) { + if (pcc_rule->af_sig_protocol != OpenAPI_af_sig_protocol_NULL) { if (cJSON_AddStringToObject(item, "afSigProtocol", OpenAPI_af_sig_protocol_ToString(pcc_rule->af_sig_protocol)) == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [af_sig_protocol]"); goto end; @@ -200,115 +254,101 @@ cJSON *OpenAPI_pcc_rule_convertToJSON(OpenAPI_pcc_rule_t *pcc_rule) } if (pcc_rule->ref_qos_data) { - cJSON *ref_qos_data = cJSON_AddArrayToObject(item, "refQosData"); - if (ref_qos_data == NULL) { + cJSON *ref_qos_dataList = cJSON_AddArrayToObject(item, "refQosData"); + if (ref_qos_dataList == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_qos_data]"); goto end; } - - OpenAPI_lnode_t *ref_qos_data_node; - OpenAPI_list_for_each(pcc_rule->ref_qos_data, ref_qos_data_node) { - if (cJSON_AddStringToObject(ref_qos_data, "", (char*)ref_qos_data_node->data) == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_qos_data]"); - goto end; + OpenAPI_list_for_each(pcc_rule->ref_qos_data, node) { + if (cJSON_AddStringToObject(ref_qos_dataList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_qos_data]"); + goto end; + } } - } } if (pcc_rule->ref_alt_qos_params) { - cJSON *ref_alt_qos_params = cJSON_AddArrayToObject(item, "refAltQosParams"); - if (ref_alt_qos_params == NULL) { + cJSON *ref_alt_qos_paramsList = cJSON_AddArrayToObject(item, "refAltQosParams"); + if (ref_alt_qos_paramsList == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_alt_qos_params]"); goto end; } - - OpenAPI_lnode_t *ref_alt_qos_params_node; - OpenAPI_list_for_each(pcc_rule->ref_alt_qos_params, ref_alt_qos_params_node) { - if (cJSON_AddStringToObject(ref_alt_qos_params, "", (char*)ref_alt_qos_params_node->data) == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_alt_qos_params]"); - goto end; + OpenAPI_list_for_each(pcc_rule->ref_alt_qos_params, node) { + if (cJSON_AddStringToObject(ref_alt_qos_paramsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_alt_qos_params]"); + goto end; + } } - } } if (pcc_rule->ref_tc_data) { - cJSON *ref_tc_data = cJSON_AddArrayToObject(item, "refTcData"); - if (ref_tc_data == NULL) { + cJSON *ref_tc_dataList = cJSON_AddArrayToObject(item, "refTcData"); + if (ref_tc_dataList == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_tc_data]"); goto end; } - - OpenAPI_lnode_t *ref_tc_data_node; - OpenAPI_list_for_each(pcc_rule->ref_tc_data, ref_tc_data_node) { - if (cJSON_AddStringToObject(ref_tc_data, "", (char*)ref_tc_data_node->data) == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_tc_data]"); - goto end; + OpenAPI_list_for_each(pcc_rule->ref_tc_data, node) { + if (cJSON_AddStringToObject(ref_tc_dataList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_tc_data]"); + goto end; + } } - } } if (pcc_rule->ref_chg_data) { - cJSON *ref_chg_data = cJSON_AddArrayToObject(item, "refChgData"); - if (ref_chg_data == NULL) { + cJSON *ref_chg_dataList = cJSON_AddArrayToObject(item, "refChgData"); + if (ref_chg_dataList == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_chg_data]"); goto end; } - - OpenAPI_lnode_t *ref_chg_data_node; - OpenAPI_list_for_each(pcc_rule->ref_chg_data, ref_chg_data_node) { - if (cJSON_AddStringToObject(ref_chg_data, "", (char*)ref_chg_data_node->data) == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_chg_data]"); - goto end; + OpenAPI_list_for_each(pcc_rule->ref_chg_data, node) { + if (cJSON_AddStringToObject(ref_chg_dataList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_chg_data]"); + goto end; + } } - } } if (pcc_rule->ref_chg_n3g_data) { - cJSON *ref_chg_n3g_data = cJSON_AddArrayToObject(item, "refChgN3gData"); - if (ref_chg_n3g_data == NULL) { + cJSON *ref_chg_n3g_dataList = cJSON_AddArrayToObject(item, "refChgN3gData"); + if (ref_chg_n3g_dataList == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_chg_n3g_data]"); goto end; } - - OpenAPI_lnode_t *ref_chg_n3g_data_node; - OpenAPI_list_for_each(pcc_rule->ref_chg_n3g_data, ref_chg_n3g_data_node) { - if (cJSON_AddStringToObject(ref_chg_n3g_data, "", (char*)ref_chg_n3g_data_node->data) == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_chg_n3g_data]"); - goto end; + OpenAPI_list_for_each(pcc_rule->ref_chg_n3g_data, node) { + if (cJSON_AddStringToObject(ref_chg_n3g_dataList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_chg_n3g_data]"); + goto end; + } } - } } if (pcc_rule->ref_um_data) { - cJSON *ref_um_data = cJSON_AddArrayToObject(item, "refUmData"); - if (ref_um_data == NULL) { + cJSON *ref_um_dataList = cJSON_AddArrayToObject(item, "refUmData"); + if (ref_um_dataList == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_um_data]"); goto end; } - - OpenAPI_lnode_t *ref_um_data_node; - OpenAPI_list_for_each(pcc_rule->ref_um_data, ref_um_data_node) { - if (cJSON_AddStringToObject(ref_um_data, "", (char*)ref_um_data_node->data) == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_um_data]"); - goto end; + OpenAPI_list_for_each(pcc_rule->ref_um_data, node) { + if (cJSON_AddStringToObject(ref_um_dataList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_um_data]"); + goto end; + } } - } } if (pcc_rule->ref_um_n3g_data) { - cJSON *ref_um_n3g_data = cJSON_AddArrayToObject(item, "refUmN3gData"); - if (ref_um_n3g_data == NULL) { + cJSON *ref_um_n3g_dataList = cJSON_AddArrayToObject(item, "refUmN3gData"); + if (ref_um_n3g_dataList == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_um_n3g_data]"); goto end; } - - OpenAPI_lnode_t *ref_um_n3g_data_node; - OpenAPI_list_for_each(pcc_rule->ref_um_n3g_data, ref_um_n3g_data_node) { - if (cJSON_AddStringToObject(ref_um_n3g_data, "", (char*)ref_um_n3g_data_node->data) == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_um_n3g_data]"); - goto end; + OpenAPI_list_for_each(pcc_rule->ref_um_n3g_data, node) { + if (cJSON_AddStringToObject(ref_um_n3g_dataList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_um_n3g_data]"); + goto end; + } } - } } if (pcc_rule->ref_cond_data) { @@ -319,19 +359,17 @@ cJSON *OpenAPI_pcc_rule_convertToJSON(OpenAPI_pcc_rule_t *pcc_rule) } if (pcc_rule->ref_qos_mon) { - cJSON *ref_qos_mon = cJSON_AddArrayToObject(item, "refQosMon"); - if (ref_qos_mon == NULL) { + cJSON *ref_qos_monList = cJSON_AddArrayToObject(item, "refQosMon"); + if (ref_qos_monList == NULL) { ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_qos_mon]"); goto end; } - - OpenAPI_lnode_t *ref_qos_mon_node; - OpenAPI_list_for_each(pcc_rule->ref_qos_mon, ref_qos_mon_node) { - if (cJSON_AddStringToObject(ref_qos_mon, "", (char*)ref_qos_mon_node->data) == NULL) { - ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_qos_mon]"); - goto end; + OpenAPI_list_for_each(pcc_rule->ref_qos_mon, node) { + if (cJSON_AddStringToObject(ref_qos_monList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [ref_qos_mon]"); + goto end; + } } - } } if (pcc_rule->is_addr_preser_ind) { @@ -407,55 +445,86 @@ end: OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) { OpenAPI_pcc_rule_t *pcc_rule_local_var = NULL; - cJSON *flow_infos = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "flowInfos"); - - OpenAPI_list_t *flow_infosList; + OpenAPI_lnode_t *node = NULL; + cJSON *flow_infos = NULL; + OpenAPI_list_t *flow_infosList = NULL; + cJSON *app_id = NULL; + cJSON *app_descriptor = NULL; + cJSON *cont_ver = NULL; + cJSON *pcc_rule_id = NULL; + cJSON *precedence = NULL; + cJSON *af_sig_protocol = NULL; + OpenAPI_af_sig_protocol_e af_sig_protocolVariable = 0; + cJSON *app_reloc = NULL; + cJSON *ref_qos_data = NULL; + OpenAPI_list_t *ref_qos_dataList = NULL; + cJSON *ref_alt_qos_params = NULL; + OpenAPI_list_t *ref_alt_qos_paramsList = NULL; + cJSON *ref_tc_data = NULL; + OpenAPI_list_t *ref_tc_dataList = NULL; + cJSON *ref_chg_data = NULL; + OpenAPI_list_t *ref_chg_dataList = NULL; + cJSON *ref_chg_n3g_data = NULL; + OpenAPI_list_t *ref_chg_n3g_dataList = NULL; + cJSON *ref_um_data = NULL; + OpenAPI_list_t *ref_um_dataList = NULL; + cJSON *ref_um_n3g_data = NULL; + OpenAPI_list_t *ref_um_n3g_dataList = NULL; + cJSON *ref_cond_data = NULL; + cJSON *ref_qos_mon = NULL; + OpenAPI_list_t *ref_qos_monList = NULL; + cJSON *addr_preser_ind = NULL; + cJSON *tscai_input_dl = NULL; + OpenAPI_tscai_input_container_t *tscai_input_dl_local_nonprim = NULL; + cJSON *tscai_input_ul = NULL; + OpenAPI_tscai_input_container_t *tscai_input_ul_local_nonprim = NULL; + cJSON *dd_notif_ctrl = NULL; + OpenAPI_downlink_data_notification_control_t *dd_notif_ctrl_local_nonprim = NULL; + cJSON *dd_notif_ctrl2 = NULL; + OpenAPI_downlink_data_notification_control_rm_t *dd_notif_ctrl2_local_nonprim = NULL; + cJSON *dis_ue_notif = NULL; + flow_infos = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "flowInfos"); if (flow_infos) { - cJSON *flow_infos_local_nonprimitive; - if (!cJSON_IsArray(flow_infos)){ - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [flow_infos]"); - goto end; - } - - flow_infosList = OpenAPI_list_create(); - - cJSON_ArrayForEach(flow_infos_local_nonprimitive, flow_infos ) { - if (!cJSON_IsObject(flow_infos_local_nonprimitive)) { + cJSON *flow_infos_local = NULL; + if (!cJSON_IsArray(flow_infos)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [flow_infos]"); goto end; } - OpenAPI_flow_information_t *flow_infosItem = OpenAPI_flow_information_parseFromJSON(flow_infos_local_nonprimitive); - if (!flow_infosItem) { - ogs_error("No flow_infosItem"); - OpenAPI_list_free(flow_infosList); - goto end; + flow_infosList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flow_infos_local, flow_infos) { + if (!cJSON_IsObject(flow_infos_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [flow_infos]"); + goto end; + } + OpenAPI_flow_information_t *flow_infosItem = OpenAPI_flow_information_parseFromJSON(flow_infos_local); + if (!flow_infosItem) { + ogs_error("No flow_infosItem"); + OpenAPI_list_free(flow_infosList); + goto end; + } + OpenAPI_list_add(flow_infosList, flow_infosItem); } - - OpenAPI_list_add(flow_infosList, flow_infosItem); - } } - cJSON *app_id = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "appId"); - + app_id = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "appId"); if (app_id) { - if (!cJSON_IsString(app_id)) { + if (!cJSON_IsString(app_id) && !cJSON_IsNull(app_id)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [app_id]"); goto end; } } - cJSON *app_descriptor = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "appDescriptor"); - + app_descriptor = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "appDescriptor"); if (app_descriptor) { - if (!cJSON_IsNumber(app_descriptor)) { + if (!cJSON_IsString(app_descriptor) && !cJSON_IsNull(app_descriptor)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [app_descriptor]"); goto end; } } - cJSON *cont_ver = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "contVer"); - + cont_ver = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "contVer"); if (cont_ver) { if (!cJSON_IsNumber(cont_ver)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [cont_ver]"); @@ -463,19 +532,17 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) } } - cJSON *pcc_rule_id = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "pccRuleId"); + pcc_rule_id = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "pccRuleId"); if (!pcc_rule_id) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [pcc_rule_id]"); goto end; } - if (!cJSON_IsString(pcc_rule_id)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [pcc_rule_id]"); goto end; } - cJSON *precedence = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "precedence"); - + precedence = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "precedence"); if (precedence) { if (!cJSON_IsNumber(precedence)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [precedence]"); @@ -483,9 +550,7 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) } } - cJSON *af_sig_protocol = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "afSigProtocol"); - - OpenAPI_af_sig_protocol_e af_sig_protocolVariable; + af_sig_protocol = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "afSigProtocol"); if (af_sig_protocol) { if (!cJSON_IsString(af_sig_protocol)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [af_sig_protocol]"); @@ -494,8 +559,7 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) af_sig_protocolVariable = OpenAPI_af_sig_protocol_FromString(af_sig_protocol->valuestring); } - cJSON *app_reloc = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "appReloc"); - + app_reloc = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "appReloc"); if (app_reloc) { if (!cJSON_IsBool(app_reloc)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [app_reloc]"); @@ -503,177 +567,183 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) } } - cJSON *ref_qos_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refQosData"); - - OpenAPI_list_t *ref_qos_dataList; + ref_qos_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refQosData"); if (ref_qos_data) { - cJSON *ref_qos_data_local; - if (!cJSON_IsArray(ref_qos_data)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_qos_data]"); - goto end; - } - ref_qos_dataList = OpenAPI_list_create(); + cJSON *ref_qos_data_local = NULL; + if (!cJSON_IsArray(ref_qos_data)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_qos_data]"); + goto end; + } - cJSON_ArrayForEach(ref_qos_data_local, ref_qos_data) { - if (!cJSON_IsString(ref_qos_data_local)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_qos_data]"); - goto end; - } - OpenAPI_list_add(ref_qos_dataList, ogs_strdup(ref_qos_data_local->valuestring)); - } + ref_qos_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_qos_data_local, ref_qos_data) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_qos_data_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_qos_data]"); + goto end; + } + OpenAPI_list_add(ref_qos_dataList, ogs_strdup(ref_qos_data_local->valuestring)); + } } - cJSON *ref_alt_qos_params = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refAltQosParams"); - - OpenAPI_list_t *ref_alt_qos_paramsList; + ref_alt_qos_params = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refAltQosParams"); if (ref_alt_qos_params) { - cJSON *ref_alt_qos_params_local; - if (!cJSON_IsArray(ref_alt_qos_params)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_alt_qos_params]"); - goto end; - } - ref_alt_qos_paramsList = OpenAPI_list_create(); + cJSON *ref_alt_qos_params_local = NULL; + if (!cJSON_IsArray(ref_alt_qos_params)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_alt_qos_params]"); + goto end; + } - cJSON_ArrayForEach(ref_alt_qos_params_local, ref_alt_qos_params) { - if (!cJSON_IsString(ref_alt_qos_params_local)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_alt_qos_params]"); - goto end; - } - OpenAPI_list_add(ref_alt_qos_paramsList, ogs_strdup(ref_alt_qos_params_local->valuestring)); - } + ref_alt_qos_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_alt_qos_params_local, ref_alt_qos_params) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_alt_qos_params_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_alt_qos_params]"); + goto end; + } + OpenAPI_list_add(ref_alt_qos_paramsList, ogs_strdup(ref_alt_qos_params_local->valuestring)); + } } - cJSON *ref_tc_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refTcData"); - - OpenAPI_list_t *ref_tc_dataList; + ref_tc_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refTcData"); if (ref_tc_data) { - cJSON *ref_tc_data_local; - if (!cJSON_IsArray(ref_tc_data)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_tc_data]"); - goto end; - } - ref_tc_dataList = OpenAPI_list_create(); + cJSON *ref_tc_data_local = NULL; + if (!cJSON_IsArray(ref_tc_data)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_tc_data]"); + goto end; + } - cJSON_ArrayForEach(ref_tc_data_local, ref_tc_data) { - if (!cJSON_IsString(ref_tc_data_local)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_tc_data]"); - goto end; - } - OpenAPI_list_add(ref_tc_dataList, ogs_strdup(ref_tc_data_local->valuestring)); - } + ref_tc_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_tc_data_local, ref_tc_data) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_tc_data_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_tc_data]"); + goto end; + } + OpenAPI_list_add(ref_tc_dataList, ogs_strdup(ref_tc_data_local->valuestring)); + } } - cJSON *ref_chg_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refChgData"); - - OpenAPI_list_t *ref_chg_dataList; + ref_chg_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refChgData"); if (ref_chg_data) { - cJSON *ref_chg_data_local; - if (!cJSON_IsArray(ref_chg_data)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_chg_data]"); - goto end; - } - ref_chg_dataList = OpenAPI_list_create(); + cJSON *ref_chg_data_local = NULL; + if (!cJSON_IsArray(ref_chg_data)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_chg_data]"); + goto end; + } - cJSON_ArrayForEach(ref_chg_data_local, ref_chg_data) { - if (!cJSON_IsString(ref_chg_data_local)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_chg_data]"); - goto end; - } - OpenAPI_list_add(ref_chg_dataList, ogs_strdup(ref_chg_data_local->valuestring)); - } + ref_chg_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_chg_data_local, ref_chg_data) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_chg_data_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_chg_data]"); + goto end; + } + OpenAPI_list_add(ref_chg_dataList, ogs_strdup(ref_chg_data_local->valuestring)); + } } - cJSON *ref_chg_n3g_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refChgN3gData"); - - OpenAPI_list_t *ref_chg_n3g_dataList; + ref_chg_n3g_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refChgN3gData"); if (ref_chg_n3g_data) { - cJSON *ref_chg_n3g_data_local; - if (!cJSON_IsArray(ref_chg_n3g_data)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_chg_n3g_data]"); - goto end; - } - ref_chg_n3g_dataList = OpenAPI_list_create(); + cJSON *ref_chg_n3g_data_local = NULL; + if (!cJSON_IsArray(ref_chg_n3g_data)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_chg_n3g_data]"); + goto end; + } - cJSON_ArrayForEach(ref_chg_n3g_data_local, ref_chg_n3g_data) { - if (!cJSON_IsString(ref_chg_n3g_data_local)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_chg_n3g_data]"); - goto end; - } - OpenAPI_list_add(ref_chg_n3g_dataList, ogs_strdup(ref_chg_n3g_data_local->valuestring)); - } + ref_chg_n3g_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_chg_n3g_data_local, ref_chg_n3g_data) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_chg_n3g_data_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_chg_n3g_data]"); + goto end; + } + OpenAPI_list_add(ref_chg_n3g_dataList, ogs_strdup(ref_chg_n3g_data_local->valuestring)); + } } - cJSON *ref_um_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refUmData"); - - OpenAPI_list_t *ref_um_dataList; + ref_um_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refUmData"); if (ref_um_data) { - cJSON *ref_um_data_local; - if (!cJSON_IsArray(ref_um_data)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_um_data]"); - goto end; - } - ref_um_dataList = OpenAPI_list_create(); + cJSON *ref_um_data_local = NULL; + if (!cJSON_IsArray(ref_um_data)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_um_data]"); + goto end; + } - cJSON_ArrayForEach(ref_um_data_local, ref_um_data) { - if (!cJSON_IsString(ref_um_data_local)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_um_data]"); - goto end; - } - OpenAPI_list_add(ref_um_dataList, ogs_strdup(ref_um_data_local->valuestring)); - } + ref_um_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_um_data_local, ref_um_data) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_um_data_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_um_data]"); + goto end; + } + OpenAPI_list_add(ref_um_dataList, ogs_strdup(ref_um_data_local->valuestring)); + } } - cJSON *ref_um_n3g_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refUmN3gData"); - - OpenAPI_list_t *ref_um_n3g_dataList; + ref_um_n3g_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refUmN3gData"); if (ref_um_n3g_data) { - cJSON *ref_um_n3g_data_local; - if (!cJSON_IsArray(ref_um_n3g_data)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_um_n3g_data]"); - goto end; - } - ref_um_n3g_dataList = OpenAPI_list_create(); + cJSON *ref_um_n3g_data_local = NULL; + if (!cJSON_IsArray(ref_um_n3g_data)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_um_n3g_data]"); + goto end; + } - cJSON_ArrayForEach(ref_um_n3g_data_local, ref_um_n3g_data) { - if (!cJSON_IsString(ref_um_n3g_data_local)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_um_n3g_data]"); - goto end; - } - OpenAPI_list_add(ref_um_n3g_dataList, ogs_strdup(ref_um_n3g_data_local->valuestring)); - } + ref_um_n3g_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_um_n3g_data_local, ref_um_n3g_data) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_um_n3g_data_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_um_n3g_data]"); + goto end; + } + OpenAPI_list_add(ref_um_n3g_dataList, ogs_strdup(ref_um_n3g_data_local->valuestring)); + } } - cJSON *ref_cond_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refCondData"); - + ref_cond_data = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refCondData"); if (ref_cond_data) { - if (!cJSON_IsString(ref_cond_data)) { + if (!cJSON_IsString(ref_cond_data) && !cJSON_IsNull(ref_cond_data)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_cond_data]"); goto end; } } - cJSON *ref_qos_mon = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refQosMon"); - - OpenAPI_list_t *ref_qos_monList; + ref_qos_mon = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "refQosMon"); if (ref_qos_mon) { - cJSON *ref_qos_mon_local; - if (!cJSON_IsArray(ref_qos_mon)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_qos_mon]"); - goto end; - } - ref_qos_monList = OpenAPI_list_create(); + cJSON *ref_qos_mon_local = NULL; + if (!cJSON_IsArray(ref_qos_mon)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_qos_mon]"); + goto end; + } - cJSON_ArrayForEach(ref_qos_mon_local, ref_qos_mon) { - if (!cJSON_IsString(ref_qos_mon_local)) { - ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_qos_mon]"); - goto end; - } - OpenAPI_list_add(ref_qos_monList, ogs_strdup(ref_qos_mon_local->valuestring)); - } + ref_qos_monList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_qos_mon_local, ref_qos_mon) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_qos_mon_local)) { + ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [ref_qos_mon]"); + goto end; + } + OpenAPI_list_add(ref_qos_monList, ogs_strdup(ref_qos_mon_local->valuestring)); + } } - cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "addrPreserInd"); - + addr_preser_ind = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "addrPreserInd"); if (addr_preser_ind) { if (!cJSON_IsBool(addr_preser_ind)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [addr_preser_ind]"); @@ -681,36 +751,27 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) } } - cJSON *tscai_input_dl = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "tscaiInputDl"); - - OpenAPI_tscai_input_container_t *tscai_input_dl_local_nonprim = NULL; + tscai_input_dl = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "tscaiInputDl"); if (tscai_input_dl) { tscai_input_dl_local_nonprim = OpenAPI_tscai_input_container_parseFromJSON(tscai_input_dl); } - cJSON *tscai_input_ul = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "tscaiInputUl"); - - OpenAPI_tscai_input_container_t *tscai_input_ul_local_nonprim = NULL; + tscai_input_ul = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "tscaiInputUl"); if (tscai_input_ul) { tscai_input_ul_local_nonprim = OpenAPI_tscai_input_container_parseFromJSON(tscai_input_ul); } - cJSON *dd_notif_ctrl = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "ddNotifCtrl"); - - OpenAPI_downlink_data_notification_control_t *dd_notif_ctrl_local_nonprim = NULL; + dd_notif_ctrl = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "ddNotifCtrl"); if (dd_notif_ctrl) { dd_notif_ctrl_local_nonprim = OpenAPI_downlink_data_notification_control_parseFromJSON(dd_notif_ctrl); } - cJSON *dd_notif_ctrl2 = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "ddNotifCtrl2"); - - OpenAPI_downlink_data_notification_control_rm_t *dd_notif_ctrl2_local_nonprim = NULL; + dd_notif_ctrl2 = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "ddNotifCtrl2"); if (dd_notif_ctrl2) { dd_notif_ctrl2_local_nonprim = OpenAPI_downlink_data_notification_control_rm_parseFromJSON(dd_notif_ctrl2); } - cJSON *dis_ue_notif = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "disUeNotif"); - + dis_ue_notif = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "disUeNotif"); if (dis_ue_notif) { if (!cJSON_IsBool(dis_ue_notif)) { ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [dis_ue_notif]"); @@ -720,8 +781,8 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) pcc_rule_local_var = OpenAPI_pcc_rule_create ( flow_infos ? flow_infosList : NULL, - app_id ? ogs_strdup(app_id->valuestring) : NULL, - app_descriptor ? app_descriptor->valueint : 0, + app_id && !cJSON_IsNull(app_id) ? ogs_strdup(app_id->valuestring) : NULL, + app_descriptor && !cJSON_IsNull(app_descriptor) ? ogs_strdup(app_descriptor->valuestring) : NULL, cont_ver ? true : false, cont_ver ? cont_ver->valuedouble : 0, ogs_strdup(pcc_rule_id->valuestring), @@ -737,7 +798,7 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) ref_chg_n3g_data ? ref_chg_n3g_dataList : NULL, ref_um_data ? ref_um_dataList : NULL, ref_um_n3g_data ? ref_um_n3g_dataList : NULL, - ref_cond_data ? ogs_strdup(ref_cond_data->valuestring) : NULL, + ref_cond_data && !cJSON_IsNull(ref_cond_data) ? ogs_strdup(ref_cond_data->valuestring) : NULL, ref_qos_mon ? ref_qos_monList : NULL, addr_preser_ind ? true : false, addr_preser_ind ? addr_preser_ind->valueint : 0, @@ -751,6 +812,85 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON) return pcc_rule_local_var; end: + if (flow_infosList) { + OpenAPI_list_for_each(flow_infosList, node) { + OpenAPI_flow_information_free(node->data); + } + OpenAPI_list_free(flow_infosList); + flow_infosList = NULL; + } + if (ref_qos_dataList) { + OpenAPI_list_for_each(ref_qos_dataList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_qos_dataList); + ref_qos_dataList = NULL; + } + if (ref_alt_qos_paramsList) { + OpenAPI_list_for_each(ref_alt_qos_paramsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_alt_qos_paramsList); + ref_alt_qos_paramsList = NULL; + } + if (ref_tc_dataList) { + OpenAPI_list_for_each(ref_tc_dataList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_tc_dataList); + ref_tc_dataList = NULL; + } + if (ref_chg_dataList) { + OpenAPI_list_for_each(ref_chg_dataList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_chg_dataList); + ref_chg_dataList = NULL; + } + if (ref_chg_n3g_dataList) { + OpenAPI_list_for_each(ref_chg_n3g_dataList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_chg_n3g_dataList); + ref_chg_n3g_dataList = NULL; + } + if (ref_um_dataList) { + OpenAPI_list_for_each(ref_um_dataList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_um_dataList); + ref_um_dataList = NULL; + } + if (ref_um_n3g_dataList) { + OpenAPI_list_for_each(ref_um_n3g_dataList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_um_n3g_dataList); + ref_um_n3g_dataList = NULL; + } + if (ref_qos_monList) { + OpenAPI_list_for_each(ref_qos_monList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_qos_monList); + ref_qos_monList = NULL; + } + if (tscai_input_dl_local_nonprim) { + OpenAPI_tscai_input_container_free(tscai_input_dl_local_nonprim); + tscai_input_dl_local_nonprim = NULL; + } + if (tscai_input_ul_local_nonprim) { + OpenAPI_tscai_input_container_free(tscai_input_ul_local_nonprim); + tscai_input_ul_local_nonprim = NULL; + } + if (dd_notif_ctrl_local_nonprim) { + OpenAPI_downlink_data_notification_control_free(dd_notif_ctrl_local_nonprim); + dd_notif_ctrl_local_nonprim = NULL; + } + if (dd_notif_ctrl2_local_nonprim) { + OpenAPI_downlink_data_notification_control_rm_free(dd_notif_ctrl2_local_nonprim); + dd_notif_ctrl2_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pcc_rule.h b/lib/sbi/openapi/model/pcc_rule.h index aebdc98dd..52b0cd389 100644 --- a/lib/sbi/openapi/model/pcc_rule.h +++ b/lib/sbi/openapi/model/pcc_rule.h @@ -26,7 +26,7 @@ typedef struct OpenAPI_pcc_rule_s OpenAPI_pcc_rule_t; typedef struct OpenAPI_pcc_rule_s { OpenAPI_list_t *flow_infos; char *app_id; - char app_descriptor; + char *app_descriptor; bool is_cont_ver; int cont_ver; char *pcc_rule_id; @@ -57,7 +57,7 @@ typedef struct OpenAPI_pcc_rule_s { OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_create( OpenAPI_list_t *flow_infos, char *app_id, - char app_descriptor, + char *app_descriptor, bool is_cont_ver, int cont_ver, char *pcc_rule_id, diff --git a/lib/sbi/openapi/model/pcf_binding.c b/lib/sbi/openapi/model/pcf_binding.c index 7ab68797b..f5a0a0823 100644 --- a/lib/sbi/openapi/model/pcf_binding.c +++ b/lib/sbi/openapi/model/pcf_binding.c @@ -64,57 +64,128 @@ OpenAPI_pcf_binding_t *OpenAPI_pcf_binding_create( void OpenAPI_pcf_binding_free(OpenAPI_pcf_binding_t *pcf_binding) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pcf_binding) { return; } - OpenAPI_lnode_t *node; - ogs_free(pcf_binding->supi); - ogs_free(pcf_binding->gpsi); - ogs_free(pcf_binding->ipv4_addr); - ogs_free(pcf_binding->ipv6_prefix); - OpenAPI_list_for_each(pcf_binding->add_ipv6_prefixes, node) { - ogs_free(node->data); + if (pcf_binding->supi) { + ogs_free(pcf_binding->supi); + pcf_binding->supi = NULL; } - OpenAPI_list_free(pcf_binding->add_ipv6_prefixes); - ogs_free(pcf_binding->ip_domain); - ogs_free(pcf_binding->mac_addr48); - OpenAPI_list_for_each(pcf_binding->add_mac_addrs, node) { - ogs_free(node->data); + if (pcf_binding->gpsi) { + ogs_free(pcf_binding->gpsi); + pcf_binding->gpsi = NULL; } - OpenAPI_list_free(pcf_binding->add_mac_addrs); - ogs_free(pcf_binding->dnn); - ogs_free(pcf_binding->pcf_fqdn); - OpenAPI_list_for_each(pcf_binding->pcf_ip_end_points, node) { - OpenAPI_ip_end_point_free(node->data); + if (pcf_binding->ipv4_addr) { + ogs_free(pcf_binding->ipv4_addr); + pcf_binding->ipv4_addr = NULL; } - OpenAPI_list_free(pcf_binding->pcf_ip_end_points); - ogs_free(pcf_binding->pcf_diam_host); - ogs_free(pcf_binding->pcf_diam_realm); - ogs_free(pcf_binding->pcf_sm_fqdn); - OpenAPI_list_for_each(pcf_binding->pcf_sm_ip_end_points, node) { - OpenAPI_ip_end_point_free(node->data); + if (pcf_binding->ipv6_prefix) { + ogs_free(pcf_binding->ipv6_prefix); + pcf_binding->ipv6_prefix = NULL; } - OpenAPI_list_free(pcf_binding->pcf_sm_ip_end_points); - OpenAPI_snssai_free(pcf_binding->snssai); - ogs_free(pcf_binding->supp_feat); - ogs_free(pcf_binding->pcf_id); - ogs_free(pcf_binding->pcf_set_id); - ogs_free(pcf_binding->recovery_time); - OpenAPI_parameter_combination_free(pcf_binding->para_com); - OpenAPI_list_for_each(pcf_binding->ipv4_frame_route_list, node) { - ogs_free(node->data); + if (pcf_binding->add_ipv6_prefixes) { + OpenAPI_list_for_each(pcf_binding->add_ipv6_prefixes, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcf_binding->add_ipv6_prefixes); + pcf_binding->add_ipv6_prefixes = NULL; } - OpenAPI_list_free(pcf_binding->ipv4_frame_route_list); - OpenAPI_list_for_each(pcf_binding->ipv6_frame_route_list, node) { - ogs_free(node->data); + if (pcf_binding->ip_domain) { + ogs_free(pcf_binding->ip_domain); + pcf_binding->ip_domain = NULL; + } + if (pcf_binding->mac_addr48) { + ogs_free(pcf_binding->mac_addr48); + pcf_binding->mac_addr48 = NULL; + } + if (pcf_binding->add_mac_addrs) { + OpenAPI_list_for_each(pcf_binding->add_mac_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcf_binding->add_mac_addrs); + pcf_binding->add_mac_addrs = NULL; + } + if (pcf_binding->dnn) { + ogs_free(pcf_binding->dnn); + pcf_binding->dnn = NULL; + } + if (pcf_binding->pcf_fqdn) { + ogs_free(pcf_binding->pcf_fqdn); + pcf_binding->pcf_fqdn = NULL; + } + if (pcf_binding->pcf_ip_end_points) { + OpenAPI_list_for_each(pcf_binding->pcf_ip_end_points, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(pcf_binding->pcf_ip_end_points); + pcf_binding->pcf_ip_end_points = NULL; + } + if (pcf_binding->pcf_diam_host) { + ogs_free(pcf_binding->pcf_diam_host); + pcf_binding->pcf_diam_host = NULL; + } + if (pcf_binding->pcf_diam_realm) { + ogs_free(pcf_binding->pcf_diam_realm); + pcf_binding->pcf_diam_realm = NULL; + } + if (pcf_binding->pcf_sm_fqdn) { + ogs_free(pcf_binding->pcf_sm_fqdn); + pcf_binding->pcf_sm_fqdn = NULL; + } + if (pcf_binding->pcf_sm_ip_end_points) { + OpenAPI_list_for_each(pcf_binding->pcf_sm_ip_end_points, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(pcf_binding->pcf_sm_ip_end_points); + pcf_binding->pcf_sm_ip_end_points = NULL; + } + if (pcf_binding->snssai) { + OpenAPI_snssai_free(pcf_binding->snssai); + pcf_binding->snssai = NULL; + } + if (pcf_binding->supp_feat) { + ogs_free(pcf_binding->supp_feat); + pcf_binding->supp_feat = NULL; + } + if (pcf_binding->pcf_id) { + ogs_free(pcf_binding->pcf_id); + pcf_binding->pcf_id = NULL; + } + if (pcf_binding->pcf_set_id) { + ogs_free(pcf_binding->pcf_set_id); + pcf_binding->pcf_set_id = NULL; + } + if (pcf_binding->recovery_time) { + ogs_free(pcf_binding->recovery_time); + pcf_binding->recovery_time = NULL; + } + if (pcf_binding->para_com) { + OpenAPI_parameter_combination_free(pcf_binding->para_com); + pcf_binding->para_com = NULL; + } + if (pcf_binding->ipv4_frame_route_list) { + OpenAPI_list_for_each(pcf_binding->ipv4_frame_route_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcf_binding->ipv4_frame_route_list); + pcf_binding->ipv4_frame_route_list = NULL; + } + if (pcf_binding->ipv6_frame_route_list) { + OpenAPI_list_for_each(pcf_binding->ipv6_frame_route_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcf_binding->ipv6_frame_route_list); + pcf_binding->ipv6_frame_route_list = NULL; } - OpenAPI_list_free(pcf_binding->ipv6_frame_route_list); ogs_free(pcf_binding); } cJSON *OpenAPI_pcf_binding_convertToJSON(OpenAPI_pcf_binding_t *pcf_binding) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pcf_binding == NULL) { ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [PcfBinding]"); @@ -151,19 +222,17 @@ cJSON *OpenAPI_pcf_binding_convertToJSON(OpenAPI_pcf_binding_t *pcf_binding) } if (pcf_binding->add_ipv6_prefixes) { - cJSON *add_ipv6_prefixes = cJSON_AddArrayToObject(item, "addIpv6Prefixes"); - if (add_ipv6_prefixes == NULL) { + cJSON *add_ipv6_prefixesList = cJSON_AddArrayToObject(item, "addIpv6Prefixes"); + if (add_ipv6_prefixesList == NULL) { ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [add_ipv6_prefixes]"); goto end; } - - OpenAPI_lnode_t *add_ipv6_prefixes_node; - OpenAPI_list_for_each(pcf_binding->add_ipv6_prefixes, add_ipv6_prefixes_node) { - if (cJSON_AddStringToObject(add_ipv6_prefixes, "", (char*)add_ipv6_prefixes_node->data) == NULL) { - ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [add_ipv6_prefixes]"); - goto end; + OpenAPI_list_for_each(pcf_binding->add_ipv6_prefixes, node) { + if (cJSON_AddStringToObject(add_ipv6_prefixesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [add_ipv6_prefixes]"); + goto end; + } } - } } if (pcf_binding->ip_domain) { @@ -181,21 +250,23 @@ cJSON *OpenAPI_pcf_binding_convertToJSON(OpenAPI_pcf_binding_t *pcf_binding) } if (pcf_binding->add_mac_addrs) { - cJSON *add_mac_addrs = cJSON_AddArrayToObject(item, "addMacAddrs"); - if (add_mac_addrs == NULL) { + cJSON *add_mac_addrsList = cJSON_AddArrayToObject(item, "addMacAddrs"); + if (add_mac_addrsList == NULL) { ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [add_mac_addrs]"); goto end; } - - OpenAPI_lnode_t *add_mac_addrs_node; - OpenAPI_list_for_each(pcf_binding->add_mac_addrs, add_mac_addrs_node) { - if (cJSON_AddStringToObject(add_mac_addrs, "", (char*)add_mac_addrs_node->data) == NULL) { - ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [add_mac_addrs]"); - goto end; + OpenAPI_list_for_each(pcf_binding->add_mac_addrs, node) { + if (cJSON_AddStringToObject(add_mac_addrsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [add_mac_addrs]"); + goto end; + } } - } } + if (!pcf_binding->dnn) { + ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", pcf_binding->dnn) == NULL) { ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [dnn]"); goto end; @@ -214,17 +285,13 @@ cJSON *OpenAPI_pcf_binding_convertToJSON(OpenAPI_pcf_binding_t *pcf_binding) ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [pcf_ip_end_points]"); goto end; } - - OpenAPI_lnode_t *pcf_ip_end_points_node; - if (pcf_binding->pcf_ip_end_points) { - OpenAPI_list_for_each(pcf_binding->pcf_ip_end_points, pcf_ip_end_points_node) { - cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(pcf_ip_end_points_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [pcf_ip_end_points]"); - goto end; - } - cJSON_AddItemToArray(pcf_ip_end_pointsList, itemLocal); + OpenAPI_list_for_each(pcf_binding->pcf_ip_end_points, node) { + cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [pcf_ip_end_points]"); + goto end; } + cJSON_AddItemToArray(pcf_ip_end_pointsList, itemLocal); } } @@ -255,20 +322,20 @@ cJSON *OpenAPI_pcf_binding_convertToJSON(OpenAPI_pcf_binding_t *pcf_binding) ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [pcf_sm_ip_end_points]"); goto end; } - - OpenAPI_lnode_t *pcf_sm_ip_end_points_node; - if (pcf_binding->pcf_sm_ip_end_points) { - OpenAPI_list_for_each(pcf_binding->pcf_sm_ip_end_points, pcf_sm_ip_end_points_node) { - cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(pcf_sm_ip_end_points_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [pcf_sm_ip_end_points]"); - goto end; - } - cJSON_AddItemToArray(pcf_sm_ip_end_pointsList, itemLocal); + OpenAPI_list_for_each(pcf_binding->pcf_sm_ip_end_points, node) { + cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [pcf_sm_ip_end_points]"); + goto end; } + cJSON_AddItemToArray(pcf_sm_ip_end_pointsList, itemLocal); } } + if (!pcf_binding->snssai) { + ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [snssai]"); + return NULL; + } cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(pcf_binding->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [snssai]"); @@ -321,7 +388,7 @@ cJSON *OpenAPI_pcf_binding_convertToJSON(OpenAPI_pcf_binding_t *pcf_binding) } } - if (pcf_binding->bind_level) { + if (pcf_binding->bind_level != OpenAPI_binding_level_NULL) { if (cJSON_AddStringToObject(item, "bindLevel", OpenAPI_binding_level_ToString(pcf_binding->bind_level)) == NULL) { ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [bind_level]"); goto end; @@ -329,35 +396,31 @@ cJSON *OpenAPI_pcf_binding_convertToJSON(OpenAPI_pcf_binding_t *pcf_binding) } if (pcf_binding->ipv4_frame_route_list) { - cJSON *ipv4_frame_route_list = cJSON_AddArrayToObject(item, "ipv4FrameRouteList"); - if (ipv4_frame_route_list == NULL) { + cJSON *ipv4_frame_route_listList = cJSON_AddArrayToObject(item, "ipv4FrameRouteList"); + if (ipv4_frame_route_listList == NULL) { ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [ipv4_frame_route_list]"); goto end; } - - OpenAPI_lnode_t *ipv4_frame_route_list_node; - OpenAPI_list_for_each(pcf_binding->ipv4_frame_route_list, ipv4_frame_route_list_node) { - if (cJSON_AddStringToObject(ipv4_frame_route_list, "", (char*)ipv4_frame_route_list_node->data) == NULL) { - ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [ipv4_frame_route_list]"); - goto end; + OpenAPI_list_for_each(pcf_binding->ipv4_frame_route_list, node) { + if (cJSON_AddStringToObject(ipv4_frame_route_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [ipv4_frame_route_list]"); + goto end; + } } - } } if (pcf_binding->ipv6_frame_route_list) { - cJSON *ipv6_frame_route_list = cJSON_AddArrayToObject(item, "ipv6FrameRouteList"); - if (ipv6_frame_route_list == NULL) { + cJSON *ipv6_frame_route_listList = cJSON_AddArrayToObject(item, "ipv6FrameRouteList"); + if (ipv6_frame_route_listList == NULL) { ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [ipv6_frame_route_list]"); goto end; } - - OpenAPI_lnode_t *ipv6_frame_route_list_node; - OpenAPI_list_for_each(pcf_binding->ipv6_frame_route_list, ipv6_frame_route_list_node) { - if (cJSON_AddStringToObject(ipv6_frame_route_list, "", (char*)ipv6_frame_route_list_node->data) == NULL) { - ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [ipv6_frame_route_list]"); - goto end; + OpenAPI_list_for_each(pcf_binding->ipv6_frame_route_list, node) { + if (cJSON_AddStringToObject(ipv6_frame_route_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcf_binding_convertToJSON() failed [ipv6_frame_route_list]"); + goto end; + } } - } } end: @@ -367,260 +430,267 @@ end: OpenAPI_pcf_binding_t *OpenAPI_pcf_binding_parseFromJSON(cJSON *pcf_bindingJSON) { OpenAPI_pcf_binding_t *pcf_binding_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *gpsi = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ipv6_prefix = NULL; + cJSON *add_ipv6_prefixes = NULL; + OpenAPI_list_t *add_ipv6_prefixesList = NULL; + cJSON *ip_domain = NULL; + cJSON *mac_addr48 = NULL; + cJSON *add_mac_addrs = NULL; + OpenAPI_list_t *add_mac_addrsList = NULL; + cJSON *dnn = NULL; + cJSON *pcf_fqdn = NULL; + cJSON *pcf_ip_end_points = NULL; + OpenAPI_list_t *pcf_ip_end_pointsList = NULL; + cJSON *pcf_diam_host = NULL; + cJSON *pcf_diam_realm = NULL; + cJSON *pcf_sm_fqdn = NULL; + cJSON *pcf_sm_ip_end_points = NULL; + OpenAPI_list_t *pcf_sm_ip_end_pointsList = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *supp_feat = NULL; + cJSON *pcf_id = NULL; + cJSON *pcf_set_id = NULL; + cJSON *recovery_time = NULL; + cJSON *para_com = NULL; + OpenAPI_parameter_combination_t *para_com_local_nonprim = NULL; + cJSON *bind_level = NULL; + OpenAPI_binding_level_e bind_levelVariable = 0; + cJSON *ipv4_frame_route_list = NULL; + OpenAPI_list_t *ipv4_frame_route_listList = NULL; + cJSON *ipv6_frame_route_list = NULL; + OpenAPI_list_t *ipv6_frame_route_listList = NULL; + supi = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [supi]"); goto end; } } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipv4Addr"); - + ipv4_addr = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipv6Prefix"); - + ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipv6Prefix"); if (ipv6_prefix) { - if (!cJSON_IsString(ipv6_prefix)) { + if (!cJSON_IsString(ipv6_prefix) && !cJSON_IsNull(ipv6_prefix)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv6_prefix]"); goto end; } } - cJSON *add_ipv6_prefixes = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "addIpv6Prefixes"); - - OpenAPI_list_t *add_ipv6_prefixesList; + add_ipv6_prefixes = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "addIpv6Prefixes"); if (add_ipv6_prefixes) { - cJSON *add_ipv6_prefixes_local; - if (!cJSON_IsArray(add_ipv6_prefixes)) { - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [add_ipv6_prefixes]"); - goto end; - } - add_ipv6_prefixesList = OpenAPI_list_create(); + cJSON *add_ipv6_prefixes_local = NULL; + if (!cJSON_IsArray(add_ipv6_prefixes)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [add_ipv6_prefixes]"); + goto end; + } - cJSON_ArrayForEach(add_ipv6_prefixes_local, add_ipv6_prefixes) { - if (!cJSON_IsString(add_ipv6_prefixes_local)) { - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [add_ipv6_prefixes]"); - goto end; - } - OpenAPI_list_add(add_ipv6_prefixesList, ogs_strdup(add_ipv6_prefixes_local->valuestring)); - } + add_ipv6_prefixesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_ipv6_prefixes_local, add_ipv6_prefixes) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(add_ipv6_prefixes_local)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [add_ipv6_prefixes]"); + goto end; + } + OpenAPI_list_add(add_ipv6_prefixesList, ogs_strdup(add_ipv6_prefixes_local->valuestring)); + } } - cJSON *ip_domain = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipDomain"); - + ip_domain = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipDomain"); if (ip_domain) { - if (!cJSON_IsString(ip_domain)) { + if (!cJSON_IsString(ip_domain) && !cJSON_IsNull(ip_domain)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ip_domain]"); goto end; } } - cJSON *mac_addr48 = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "macAddr48"); - + mac_addr48 = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "macAddr48"); if (mac_addr48) { - if (!cJSON_IsString(mac_addr48)) { + if (!cJSON_IsString(mac_addr48) && !cJSON_IsNull(mac_addr48)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [mac_addr48]"); goto end; } } - cJSON *add_mac_addrs = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "addMacAddrs"); - - OpenAPI_list_t *add_mac_addrsList; + add_mac_addrs = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "addMacAddrs"); if (add_mac_addrs) { - cJSON *add_mac_addrs_local; - if (!cJSON_IsArray(add_mac_addrs)) { - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [add_mac_addrs]"); - goto end; - } - add_mac_addrsList = OpenAPI_list_create(); + cJSON *add_mac_addrs_local = NULL; + if (!cJSON_IsArray(add_mac_addrs)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [add_mac_addrs]"); + goto end; + } - cJSON_ArrayForEach(add_mac_addrs_local, add_mac_addrs) { - if (!cJSON_IsString(add_mac_addrs_local)) { - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [add_mac_addrs]"); - goto end; - } - OpenAPI_list_add(add_mac_addrsList, ogs_strdup(add_mac_addrs_local->valuestring)); - } + add_mac_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_mac_addrs_local, add_mac_addrs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(add_mac_addrs_local)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [add_mac_addrs]"); + goto end; + } + OpenAPI_list_add(add_mac_addrsList, ogs_strdup(add_mac_addrs_local->valuestring)); + } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "dnn"); + dnn = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [dnn]"); goto end; } - cJSON *pcf_fqdn = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfFqdn"); - + pcf_fqdn = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfFqdn"); if (pcf_fqdn) { - if (!cJSON_IsString(pcf_fqdn)) { + if (!cJSON_IsString(pcf_fqdn) && !cJSON_IsNull(pcf_fqdn)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_fqdn]"); goto end; } } - cJSON *pcf_ip_end_points = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfIpEndPoints"); - - OpenAPI_list_t *pcf_ip_end_pointsList; + pcf_ip_end_points = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfIpEndPoints"); if (pcf_ip_end_points) { - cJSON *pcf_ip_end_points_local_nonprimitive; - if (!cJSON_IsArray(pcf_ip_end_points)){ - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_ip_end_points]"); - goto end; - } - - pcf_ip_end_pointsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pcf_ip_end_points_local_nonprimitive, pcf_ip_end_points ) { - if (!cJSON_IsObject(pcf_ip_end_points_local_nonprimitive)) { + cJSON *pcf_ip_end_points_local = NULL; + if (!cJSON_IsArray(pcf_ip_end_points)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_ip_end_points]"); goto end; } - OpenAPI_ip_end_point_t *pcf_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(pcf_ip_end_points_local_nonprimitive); - if (!pcf_ip_end_pointsItem) { - ogs_error("No pcf_ip_end_pointsItem"); - OpenAPI_list_free(pcf_ip_end_pointsList); - goto end; + pcf_ip_end_pointsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pcf_ip_end_points_local, pcf_ip_end_points) { + if (!cJSON_IsObject(pcf_ip_end_points_local)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_ip_end_points]"); + goto end; + } + OpenAPI_ip_end_point_t *pcf_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(pcf_ip_end_points_local); + if (!pcf_ip_end_pointsItem) { + ogs_error("No pcf_ip_end_pointsItem"); + OpenAPI_list_free(pcf_ip_end_pointsList); + goto end; + } + OpenAPI_list_add(pcf_ip_end_pointsList, pcf_ip_end_pointsItem); } - - OpenAPI_list_add(pcf_ip_end_pointsList, pcf_ip_end_pointsItem); - } } - cJSON *pcf_diam_host = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfDiamHost"); - + pcf_diam_host = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfDiamHost"); if (pcf_diam_host) { - if (!cJSON_IsString(pcf_diam_host)) { + if (!cJSON_IsString(pcf_diam_host) && !cJSON_IsNull(pcf_diam_host)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_diam_host]"); goto end; } } - cJSON *pcf_diam_realm = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfDiamRealm"); - + pcf_diam_realm = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfDiamRealm"); if (pcf_diam_realm) { - if (!cJSON_IsString(pcf_diam_realm)) { + if (!cJSON_IsString(pcf_diam_realm) && !cJSON_IsNull(pcf_diam_realm)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_diam_realm]"); goto end; } } - cJSON *pcf_sm_fqdn = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfSmFqdn"); - + pcf_sm_fqdn = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfSmFqdn"); if (pcf_sm_fqdn) { - if (!cJSON_IsString(pcf_sm_fqdn)) { + if (!cJSON_IsString(pcf_sm_fqdn) && !cJSON_IsNull(pcf_sm_fqdn)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_sm_fqdn]"); goto end; } } - cJSON *pcf_sm_ip_end_points = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfSmIpEndPoints"); - - OpenAPI_list_t *pcf_sm_ip_end_pointsList; + pcf_sm_ip_end_points = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfSmIpEndPoints"); if (pcf_sm_ip_end_points) { - cJSON *pcf_sm_ip_end_points_local_nonprimitive; - if (!cJSON_IsArray(pcf_sm_ip_end_points)){ - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_sm_ip_end_points]"); - goto end; - } - - pcf_sm_ip_end_pointsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pcf_sm_ip_end_points_local_nonprimitive, pcf_sm_ip_end_points ) { - if (!cJSON_IsObject(pcf_sm_ip_end_points_local_nonprimitive)) { + cJSON *pcf_sm_ip_end_points_local = NULL; + if (!cJSON_IsArray(pcf_sm_ip_end_points)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_sm_ip_end_points]"); goto end; } - OpenAPI_ip_end_point_t *pcf_sm_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(pcf_sm_ip_end_points_local_nonprimitive); - if (!pcf_sm_ip_end_pointsItem) { - ogs_error("No pcf_sm_ip_end_pointsItem"); - OpenAPI_list_free(pcf_sm_ip_end_pointsList); - goto end; + pcf_sm_ip_end_pointsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pcf_sm_ip_end_points_local, pcf_sm_ip_end_points) { + if (!cJSON_IsObject(pcf_sm_ip_end_points_local)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_sm_ip_end_points]"); + goto end; + } + OpenAPI_ip_end_point_t *pcf_sm_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(pcf_sm_ip_end_points_local); + if (!pcf_sm_ip_end_pointsItem) { + ogs_error("No pcf_sm_ip_end_pointsItem"); + OpenAPI_list_free(pcf_sm_ip_end_pointsList); + goto end; + } + OpenAPI_list_add(pcf_sm_ip_end_pointsList, pcf_sm_ip_end_pointsItem); } - - OpenAPI_list_add(pcf_sm_ip_end_pointsList, pcf_sm_ip_end_pointsItem); - } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "snssai"); + snssai = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "snssai"); if (!snssai) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [snssai]"); goto end; } - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [supp_feat]"); goto end; } } - cJSON *pcf_id = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfId"); - + pcf_id = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfId"); if (pcf_id) { - if (!cJSON_IsString(pcf_id)) { + if (!cJSON_IsString(pcf_id) && !cJSON_IsNull(pcf_id)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_id]"); goto end; } } - cJSON *pcf_set_id = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfSetId"); - + pcf_set_id = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "pcfSetId"); if (pcf_set_id) { - if (!cJSON_IsString(pcf_set_id)) { + if (!cJSON_IsString(pcf_set_id) && !cJSON_IsNull(pcf_set_id)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [pcf_set_id]"); goto end; } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *para_com = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "paraCom"); - - OpenAPI_parameter_combination_t *para_com_local_nonprim = NULL; + para_com = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "paraCom"); if (para_com) { para_com_local_nonprim = OpenAPI_parameter_combination_parseFromJSON(para_com); } - cJSON *bind_level = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "bindLevel"); - - OpenAPI_binding_level_e bind_levelVariable; + bind_level = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "bindLevel"); if (bind_level) { if (!cJSON_IsString(bind_level)) { ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [bind_level]"); @@ -629,67 +699,69 @@ OpenAPI_pcf_binding_t *OpenAPI_pcf_binding_parseFromJSON(cJSON *pcf_bindingJSON) bind_levelVariable = OpenAPI_binding_level_FromString(bind_level->valuestring); } - cJSON *ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipv4FrameRouteList"); - - OpenAPI_list_t *ipv4_frame_route_listList; + ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipv4FrameRouteList"); if (ipv4_frame_route_list) { - cJSON *ipv4_frame_route_list_local; - if (!cJSON_IsArray(ipv4_frame_route_list)) { - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv4_frame_route_list]"); - goto end; - } - ipv4_frame_route_listList = OpenAPI_list_create(); + cJSON *ipv4_frame_route_list_local = NULL; + if (!cJSON_IsArray(ipv4_frame_route_list)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv4_frame_route_list]"); + goto end; + } - cJSON_ArrayForEach(ipv4_frame_route_list_local, ipv4_frame_route_list) { - if (!cJSON_IsString(ipv4_frame_route_list_local)) { - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv4_frame_route_list]"); - goto end; - } - OpenAPI_list_add(ipv4_frame_route_listList, ogs_strdup(ipv4_frame_route_list_local->valuestring)); - } + ipv4_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_frame_route_list_local, ipv4_frame_route_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_frame_route_list_local)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv4_frame_route_list]"); + goto end; + } + OpenAPI_list_add(ipv4_frame_route_listList, ogs_strdup(ipv4_frame_route_list_local->valuestring)); + } } - cJSON *ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipv6FrameRouteList"); - - OpenAPI_list_t *ipv6_frame_route_listList; + ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(pcf_bindingJSON, "ipv6FrameRouteList"); if (ipv6_frame_route_list) { - cJSON *ipv6_frame_route_list_local; - if (!cJSON_IsArray(ipv6_frame_route_list)) { - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv6_frame_route_list]"); - goto end; - } - ipv6_frame_route_listList = OpenAPI_list_create(); + cJSON *ipv6_frame_route_list_local = NULL; + if (!cJSON_IsArray(ipv6_frame_route_list)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv6_frame_route_list]"); + goto end; + } - cJSON_ArrayForEach(ipv6_frame_route_list_local, ipv6_frame_route_list) { - if (!cJSON_IsString(ipv6_frame_route_list_local)) { - ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv6_frame_route_list]"); - goto end; - } - OpenAPI_list_add(ipv6_frame_route_listList, ogs_strdup(ipv6_frame_route_list_local->valuestring)); - } + ipv6_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_frame_route_list_local, ipv6_frame_route_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_frame_route_list_local)) { + ogs_error("OpenAPI_pcf_binding_parseFromJSON() failed [ipv6_frame_route_list]"); + goto end; + } + OpenAPI_list_add(ipv6_frame_route_listList, ogs_strdup(ipv6_frame_route_list_local->valuestring)); + } } pcf_binding_local_var = OpenAPI_pcf_binding_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, - ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_prefix && !cJSON_IsNull(ipv6_prefix) ? ogs_strdup(ipv6_prefix->valuestring) : NULL, add_ipv6_prefixes ? add_ipv6_prefixesList : NULL, - ip_domain ? ogs_strdup(ip_domain->valuestring) : NULL, - mac_addr48 ? ogs_strdup(mac_addr48->valuestring) : NULL, + ip_domain && !cJSON_IsNull(ip_domain) ? ogs_strdup(ip_domain->valuestring) : NULL, + mac_addr48 && !cJSON_IsNull(mac_addr48) ? ogs_strdup(mac_addr48->valuestring) : NULL, add_mac_addrs ? add_mac_addrsList : NULL, ogs_strdup(dnn->valuestring), - pcf_fqdn ? ogs_strdup(pcf_fqdn->valuestring) : NULL, + pcf_fqdn && !cJSON_IsNull(pcf_fqdn) ? ogs_strdup(pcf_fqdn->valuestring) : NULL, pcf_ip_end_points ? pcf_ip_end_pointsList : NULL, - pcf_diam_host ? ogs_strdup(pcf_diam_host->valuestring) : NULL, - pcf_diam_realm ? ogs_strdup(pcf_diam_realm->valuestring) : NULL, - pcf_sm_fqdn ? ogs_strdup(pcf_sm_fqdn->valuestring) : NULL, + pcf_diam_host && !cJSON_IsNull(pcf_diam_host) ? ogs_strdup(pcf_diam_host->valuestring) : NULL, + pcf_diam_realm && !cJSON_IsNull(pcf_diam_realm) ? ogs_strdup(pcf_diam_realm->valuestring) : NULL, + pcf_sm_fqdn && !cJSON_IsNull(pcf_sm_fqdn) ? ogs_strdup(pcf_sm_fqdn->valuestring) : NULL, pcf_sm_ip_end_points ? pcf_sm_ip_end_pointsList : NULL, snssai_local_nonprim, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL, - pcf_id ? ogs_strdup(pcf_id->valuestring) : NULL, - pcf_set_id ? ogs_strdup(pcf_set_id->valuestring) : NULL, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL, + pcf_id && !cJSON_IsNull(pcf_id) ? ogs_strdup(pcf_id->valuestring) : NULL, + pcf_set_id && !cJSON_IsNull(pcf_set_id) ? ogs_strdup(pcf_set_id->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, para_com ? para_com_local_nonprim : NULL, bind_level ? bind_levelVariable : 0, ipv4_frame_route_list ? ipv4_frame_route_listList : NULL, @@ -698,6 +770,56 @@ OpenAPI_pcf_binding_t *OpenAPI_pcf_binding_parseFromJSON(cJSON *pcf_bindingJSON) return pcf_binding_local_var; end: + if (add_ipv6_prefixesList) { + OpenAPI_list_for_each(add_ipv6_prefixesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(add_ipv6_prefixesList); + add_ipv6_prefixesList = NULL; + } + if (add_mac_addrsList) { + OpenAPI_list_for_each(add_mac_addrsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(add_mac_addrsList); + add_mac_addrsList = NULL; + } + if (pcf_ip_end_pointsList) { + OpenAPI_list_for_each(pcf_ip_end_pointsList, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(pcf_ip_end_pointsList); + pcf_ip_end_pointsList = NULL; + } + if (pcf_sm_ip_end_pointsList) { + OpenAPI_list_for_each(pcf_sm_ip_end_pointsList, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(pcf_sm_ip_end_pointsList); + pcf_sm_ip_end_pointsList = NULL; + } + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (para_com_local_nonprim) { + OpenAPI_parameter_combination_free(para_com_local_nonprim); + para_com_local_nonprim = NULL; + } + if (ipv4_frame_route_listList) { + OpenAPI_list_for_each(ipv4_frame_route_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_frame_route_listList); + ipv4_frame_route_listList = NULL; + } + if (ipv6_frame_route_listList) { + OpenAPI_list_for_each(ipv6_frame_route_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_frame_route_listList); + ipv6_frame_route_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pcf_binding_patch.c b/lib/sbi/openapi/model/pcf_binding_patch.c index 5bab4b995..3cb8adf65 100644 --- a/lib/sbi/openapi/model/pcf_binding_patch.c +++ b/lib/sbi/openapi/model/pcf_binding_patch.c @@ -38,36 +38,71 @@ OpenAPI_pcf_binding_patch_t *OpenAPI_pcf_binding_patch_create( void OpenAPI_pcf_binding_patch_free(OpenAPI_pcf_binding_patch_t *pcf_binding_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pcf_binding_patch) { return; } - OpenAPI_lnode_t *node; - ogs_free(pcf_binding_patch->ipv4_addr); - ogs_free(pcf_binding_patch->ip_domain); - ogs_free(pcf_binding_patch->ipv6_prefix); - OpenAPI_list_for_each(pcf_binding_patch->add_ipv6_prefixes, node) { - ogs_free(node->data); + if (pcf_binding_patch->ipv4_addr) { + ogs_free(pcf_binding_patch->ipv4_addr); + pcf_binding_patch->ipv4_addr = NULL; } - OpenAPI_list_free(pcf_binding_patch->add_ipv6_prefixes); - ogs_free(pcf_binding_patch->mac_addr48); - OpenAPI_list_for_each(pcf_binding_patch->add_mac_addrs, node) { - ogs_free(node->data); + if (pcf_binding_patch->ip_domain) { + ogs_free(pcf_binding_patch->ip_domain); + pcf_binding_patch->ip_domain = NULL; } - OpenAPI_list_free(pcf_binding_patch->add_mac_addrs); - ogs_free(pcf_binding_patch->pcf_id); - ogs_free(pcf_binding_patch->pcf_fqdn); - OpenAPI_list_for_each(pcf_binding_patch->pcf_ip_end_points, node) { - OpenAPI_ip_end_point_free(node->data); + if (pcf_binding_patch->ipv6_prefix) { + ogs_free(pcf_binding_patch->ipv6_prefix); + pcf_binding_patch->ipv6_prefix = NULL; + } + if (pcf_binding_patch->add_ipv6_prefixes) { + OpenAPI_list_for_each(pcf_binding_patch->add_ipv6_prefixes, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcf_binding_patch->add_ipv6_prefixes); + pcf_binding_patch->add_ipv6_prefixes = NULL; + } + if (pcf_binding_patch->mac_addr48) { + ogs_free(pcf_binding_patch->mac_addr48); + pcf_binding_patch->mac_addr48 = NULL; + } + if (pcf_binding_patch->add_mac_addrs) { + OpenAPI_list_for_each(pcf_binding_patch->add_mac_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcf_binding_patch->add_mac_addrs); + pcf_binding_patch->add_mac_addrs = NULL; + } + if (pcf_binding_patch->pcf_id) { + ogs_free(pcf_binding_patch->pcf_id); + pcf_binding_patch->pcf_id = NULL; + } + if (pcf_binding_patch->pcf_fqdn) { + ogs_free(pcf_binding_patch->pcf_fqdn); + pcf_binding_patch->pcf_fqdn = NULL; + } + if (pcf_binding_patch->pcf_ip_end_points) { + OpenAPI_list_for_each(pcf_binding_patch->pcf_ip_end_points, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(pcf_binding_patch->pcf_ip_end_points); + pcf_binding_patch->pcf_ip_end_points = NULL; + } + if (pcf_binding_patch->pcf_diam_host) { + ogs_free(pcf_binding_patch->pcf_diam_host); + pcf_binding_patch->pcf_diam_host = NULL; + } + if (pcf_binding_patch->pcf_diam_realm) { + ogs_free(pcf_binding_patch->pcf_diam_realm); + pcf_binding_patch->pcf_diam_realm = NULL; } - OpenAPI_list_free(pcf_binding_patch->pcf_ip_end_points); - ogs_free(pcf_binding_patch->pcf_diam_host); - ogs_free(pcf_binding_patch->pcf_diam_realm); ogs_free(pcf_binding_patch); } cJSON *OpenAPI_pcf_binding_patch_convertToJSON(OpenAPI_pcf_binding_patch_t *pcf_binding_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pcf_binding_patch == NULL) { ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [PcfBindingPatch]"); @@ -97,19 +132,17 @@ cJSON *OpenAPI_pcf_binding_patch_convertToJSON(OpenAPI_pcf_binding_patch_t *pcf_ } if (pcf_binding_patch->add_ipv6_prefixes) { - cJSON *add_ipv6_prefixes = cJSON_AddArrayToObject(item, "addIpv6Prefixes"); - if (add_ipv6_prefixes == NULL) { + cJSON *add_ipv6_prefixesList = cJSON_AddArrayToObject(item, "addIpv6Prefixes"); + if (add_ipv6_prefixesList == NULL) { ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [add_ipv6_prefixes]"); goto end; } - - OpenAPI_lnode_t *add_ipv6_prefixes_node; - OpenAPI_list_for_each(pcf_binding_patch->add_ipv6_prefixes, add_ipv6_prefixes_node) { - if (cJSON_AddStringToObject(add_ipv6_prefixes, "", (char*)add_ipv6_prefixes_node->data) == NULL) { - ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [add_ipv6_prefixes]"); - goto end; + OpenAPI_list_for_each(pcf_binding_patch->add_ipv6_prefixes, node) { + if (cJSON_AddStringToObject(add_ipv6_prefixesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [add_ipv6_prefixes]"); + goto end; + } } - } } if (pcf_binding_patch->mac_addr48) { @@ -120,19 +153,17 @@ cJSON *OpenAPI_pcf_binding_patch_convertToJSON(OpenAPI_pcf_binding_patch_t *pcf_ } if (pcf_binding_patch->add_mac_addrs) { - cJSON *add_mac_addrs = cJSON_AddArrayToObject(item, "addMacAddrs"); - if (add_mac_addrs == NULL) { + cJSON *add_mac_addrsList = cJSON_AddArrayToObject(item, "addMacAddrs"); + if (add_mac_addrsList == NULL) { ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [add_mac_addrs]"); goto end; } - - OpenAPI_lnode_t *add_mac_addrs_node; - OpenAPI_list_for_each(pcf_binding_patch->add_mac_addrs, add_mac_addrs_node) { - if (cJSON_AddStringToObject(add_mac_addrs, "", (char*)add_mac_addrs_node->data) == NULL) { - ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [add_mac_addrs]"); - goto end; + OpenAPI_list_for_each(pcf_binding_patch->add_mac_addrs, node) { + if (cJSON_AddStringToObject(add_mac_addrsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [add_mac_addrs]"); + goto end; + } } - } } if (pcf_binding_patch->pcf_id) { @@ -155,17 +186,13 @@ cJSON *OpenAPI_pcf_binding_patch_convertToJSON(OpenAPI_pcf_binding_patch_t *pcf_ ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [pcf_ip_end_points]"); goto end; } - - OpenAPI_lnode_t *pcf_ip_end_points_node; - if (pcf_binding_patch->pcf_ip_end_points) { - OpenAPI_list_for_each(pcf_binding_patch->pcf_ip_end_points, pcf_ip_end_points_node) { - cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(pcf_ip_end_points_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [pcf_ip_end_points]"); - goto end; - } - cJSON_AddItemToArray(pcf_ip_end_pointsList, itemLocal); + OpenAPI_list_for_each(pcf_binding_patch->pcf_ip_end_points, node) { + cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pcf_binding_patch_convertToJSON() failed [pcf_ip_end_points]"); + goto end; } + cJSON_AddItemToArray(pcf_ip_end_pointsList, itemLocal); } } @@ -190,163 +217,189 @@ end: OpenAPI_pcf_binding_patch_t *OpenAPI_pcf_binding_patch_parseFromJSON(cJSON *pcf_binding_patchJSON) { OpenAPI_pcf_binding_patch_t *pcf_binding_patch_local_var = NULL; - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "ipv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ip_domain = NULL; + cJSON *ipv6_prefix = NULL; + cJSON *add_ipv6_prefixes = NULL; + OpenAPI_list_t *add_ipv6_prefixesList = NULL; + cJSON *mac_addr48 = NULL; + cJSON *add_mac_addrs = NULL; + OpenAPI_list_t *add_mac_addrsList = NULL; + cJSON *pcf_id = NULL; + cJSON *pcf_fqdn = NULL; + cJSON *pcf_ip_end_points = NULL; + OpenAPI_list_t *pcf_ip_end_pointsList = NULL; + cJSON *pcf_diam_host = NULL; + cJSON *pcf_diam_realm = NULL; + ipv4_addr = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ip_domain = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "ipDomain"); - + ip_domain = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "ipDomain"); if (ip_domain) { - if (!cJSON_IsString(ip_domain)) { + if (!cJSON_IsString(ip_domain) && !cJSON_IsNull(ip_domain)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [ip_domain]"); goto end; } } - cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "ipv6Prefix"); - + ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "ipv6Prefix"); if (ipv6_prefix) { - if (!cJSON_IsString(ipv6_prefix)) { + if (!cJSON_IsString(ipv6_prefix) && !cJSON_IsNull(ipv6_prefix)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [ipv6_prefix]"); goto end; } } - cJSON *add_ipv6_prefixes = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "addIpv6Prefixes"); - - OpenAPI_list_t *add_ipv6_prefixesList; + add_ipv6_prefixes = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "addIpv6Prefixes"); if (add_ipv6_prefixes) { - cJSON *add_ipv6_prefixes_local; - if (!cJSON_IsArray(add_ipv6_prefixes)) { - ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [add_ipv6_prefixes]"); - goto end; - } - add_ipv6_prefixesList = OpenAPI_list_create(); + cJSON *add_ipv6_prefixes_local = NULL; + if (!cJSON_IsArray(add_ipv6_prefixes)) { + ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [add_ipv6_prefixes]"); + goto end; + } - cJSON_ArrayForEach(add_ipv6_prefixes_local, add_ipv6_prefixes) { - if (!cJSON_IsString(add_ipv6_prefixes_local)) { - ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [add_ipv6_prefixes]"); - goto end; - } - OpenAPI_list_add(add_ipv6_prefixesList, ogs_strdup(add_ipv6_prefixes_local->valuestring)); - } + add_ipv6_prefixesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_ipv6_prefixes_local, add_ipv6_prefixes) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(add_ipv6_prefixes_local)) { + ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [add_ipv6_prefixes]"); + goto end; + } + OpenAPI_list_add(add_ipv6_prefixesList, ogs_strdup(add_ipv6_prefixes_local->valuestring)); + } } - cJSON *mac_addr48 = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "macAddr48"); - + mac_addr48 = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "macAddr48"); if (mac_addr48) { - if (!cJSON_IsString(mac_addr48)) { + if (!cJSON_IsString(mac_addr48) && !cJSON_IsNull(mac_addr48)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [mac_addr48]"); goto end; } } - cJSON *add_mac_addrs = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "addMacAddrs"); - - OpenAPI_list_t *add_mac_addrsList; + add_mac_addrs = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "addMacAddrs"); if (add_mac_addrs) { - cJSON *add_mac_addrs_local; - if (!cJSON_IsArray(add_mac_addrs)) { - ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [add_mac_addrs]"); - goto end; - } - add_mac_addrsList = OpenAPI_list_create(); + cJSON *add_mac_addrs_local = NULL; + if (!cJSON_IsArray(add_mac_addrs)) { + ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [add_mac_addrs]"); + goto end; + } - cJSON_ArrayForEach(add_mac_addrs_local, add_mac_addrs) { - if (!cJSON_IsString(add_mac_addrs_local)) { - ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [add_mac_addrs]"); - goto end; - } - OpenAPI_list_add(add_mac_addrsList, ogs_strdup(add_mac_addrs_local->valuestring)); - } + add_mac_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_mac_addrs_local, add_mac_addrs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(add_mac_addrs_local)) { + ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [add_mac_addrs]"); + goto end; + } + OpenAPI_list_add(add_mac_addrsList, ogs_strdup(add_mac_addrs_local->valuestring)); + } } - cJSON *pcf_id = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfId"); - + pcf_id = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfId"); if (pcf_id) { - if (!cJSON_IsString(pcf_id)) { + if (!cJSON_IsString(pcf_id) && !cJSON_IsNull(pcf_id)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [pcf_id]"); goto end; } } - cJSON *pcf_fqdn = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfFqdn"); - + pcf_fqdn = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfFqdn"); if (pcf_fqdn) { - if (!cJSON_IsString(pcf_fqdn)) { + if (!cJSON_IsString(pcf_fqdn) && !cJSON_IsNull(pcf_fqdn)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [pcf_fqdn]"); goto end; } } - cJSON *pcf_ip_end_points = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfIpEndPoints"); - - OpenAPI_list_t *pcf_ip_end_pointsList; + pcf_ip_end_points = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfIpEndPoints"); if (pcf_ip_end_points) { - cJSON *pcf_ip_end_points_local_nonprimitive; - if (!cJSON_IsArray(pcf_ip_end_points)){ - ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [pcf_ip_end_points]"); - goto end; - } - - pcf_ip_end_pointsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pcf_ip_end_points_local_nonprimitive, pcf_ip_end_points ) { - if (!cJSON_IsObject(pcf_ip_end_points_local_nonprimitive)) { + cJSON *pcf_ip_end_points_local = NULL; + if (!cJSON_IsArray(pcf_ip_end_points)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [pcf_ip_end_points]"); goto end; } - OpenAPI_ip_end_point_t *pcf_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(pcf_ip_end_points_local_nonprimitive); - if (!pcf_ip_end_pointsItem) { - ogs_error("No pcf_ip_end_pointsItem"); - OpenAPI_list_free(pcf_ip_end_pointsList); - goto end; + pcf_ip_end_pointsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pcf_ip_end_points_local, pcf_ip_end_points) { + if (!cJSON_IsObject(pcf_ip_end_points_local)) { + ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [pcf_ip_end_points]"); + goto end; + } + OpenAPI_ip_end_point_t *pcf_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(pcf_ip_end_points_local); + if (!pcf_ip_end_pointsItem) { + ogs_error("No pcf_ip_end_pointsItem"); + OpenAPI_list_free(pcf_ip_end_pointsList); + goto end; + } + OpenAPI_list_add(pcf_ip_end_pointsList, pcf_ip_end_pointsItem); } - - OpenAPI_list_add(pcf_ip_end_pointsList, pcf_ip_end_pointsItem); - } } - cJSON *pcf_diam_host = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfDiamHost"); - + pcf_diam_host = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfDiamHost"); if (pcf_diam_host) { - if (!cJSON_IsString(pcf_diam_host)) { + if (!cJSON_IsString(pcf_diam_host) && !cJSON_IsNull(pcf_diam_host)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [pcf_diam_host]"); goto end; } } - cJSON *pcf_diam_realm = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfDiamRealm"); - + pcf_diam_realm = cJSON_GetObjectItemCaseSensitive(pcf_binding_patchJSON, "pcfDiamRealm"); if (pcf_diam_realm) { - if (!cJSON_IsString(pcf_diam_realm)) { + if (!cJSON_IsString(pcf_diam_realm) && !cJSON_IsNull(pcf_diam_realm)) { ogs_error("OpenAPI_pcf_binding_patch_parseFromJSON() failed [pcf_diam_realm]"); goto end; } } pcf_binding_patch_local_var = OpenAPI_pcf_binding_patch_create ( - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, - ip_domain ? ogs_strdup(ip_domain->valuestring) : NULL, - ipv6_prefix ? ogs_strdup(ipv6_prefix->valuestring) : NULL, + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ip_domain && !cJSON_IsNull(ip_domain) ? ogs_strdup(ip_domain->valuestring) : NULL, + ipv6_prefix && !cJSON_IsNull(ipv6_prefix) ? ogs_strdup(ipv6_prefix->valuestring) : NULL, add_ipv6_prefixes ? add_ipv6_prefixesList : NULL, - mac_addr48 ? ogs_strdup(mac_addr48->valuestring) : NULL, + mac_addr48 && !cJSON_IsNull(mac_addr48) ? ogs_strdup(mac_addr48->valuestring) : NULL, add_mac_addrs ? add_mac_addrsList : NULL, - pcf_id ? ogs_strdup(pcf_id->valuestring) : NULL, - pcf_fqdn ? ogs_strdup(pcf_fqdn->valuestring) : NULL, + pcf_id && !cJSON_IsNull(pcf_id) ? ogs_strdup(pcf_id->valuestring) : NULL, + pcf_fqdn && !cJSON_IsNull(pcf_fqdn) ? ogs_strdup(pcf_fqdn->valuestring) : NULL, pcf_ip_end_points ? pcf_ip_end_pointsList : NULL, - pcf_diam_host ? ogs_strdup(pcf_diam_host->valuestring) : NULL, - pcf_diam_realm ? ogs_strdup(pcf_diam_realm->valuestring) : NULL + pcf_diam_host && !cJSON_IsNull(pcf_diam_host) ? ogs_strdup(pcf_diam_host->valuestring) : NULL, + pcf_diam_realm && !cJSON_IsNull(pcf_diam_realm) ? ogs_strdup(pcf_diam_realm->valuestring) : NULL ); return pcf_binding_patch_local_var; end: + if (add_ipv6_prefixesList) { + OpenAPI_list_for_each(add_ipv6_prefixesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(add_ipv6_prefixesList); + add_ipv6_prefixesList = NULL; + } + if (add_mac_addrsList) { + OpenAPI_list_for_each(add_mac_addrsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(add_mac_addrsList); + add_mac_addrsList = NULL; + } + if (pcf_ip_end_pointsList) { + OpenAPI_list_for_each(pcf_ip_end_pointsList, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(pcf_ip_end_pointsList); + pcf_ip_end_pointsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pcf_info.c b/lib/sbi/openapi/model/pcf_info.c index 146d73007..3982586ba 100644 --- a/lib/sbi/openapi/model/pcf_info.c +++ b/lib/sbi/openapi/model/pcf_info.c @@ -32,31 +32,51 @@ OpenAPI_pcf_info_t *OpenAPI_pcf_info_create( void OpenAPI_pcf_info_free(OpenAPI_pcf_info_t *pcf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pcf_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(pcf_info->group_id); - OpenAPI_list_for_each(pcf_info->dnn_list, node) { - ogs_free(node->data); + if (pcf_info->group_id) { + ogs_free(pcf_info->group_id); + pcf_info->group_id = NULL; } - OpenAPI_list_free(pcf_info->dnn_list); - OpenAPI_list_for_each(pcf_info->supi_ranges, node) { - OpenAPI_supi_range_free(node->data); + if (pcf_info->dnn_list) { + OpenAPI_list_for_each(pcf_info->dnn_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcf_info->dnn_list); + pcf_info->dnn_list = NULL; } - OpenAPI_list_free(pcf_info->supi_ranges); - OpenAPI_list_for_each(pcf_info->gpsi_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (pcf_info->supi_ranges) { + OpenAPI_list_for_each(pcf_info->supi_ranges, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(pcf_info->supi_ranges); + pcf_info->supi_ranges = NULL; + } + if (pcf_info->gpsi_ranges) { + OpenAPI_list_for_each(pcf_info->gpsi_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(pcf_info->gpsi_ranges); + pcf_info->gpsi_ranges = NULL; + } + if (pcf_info->rx_diam_host) { + ogs_free(pcf_info->rx_diam_host); + pcf_info->rx_diam_host = NULL; + } + if (pcf_info->rx_diam_realm) { + ogs_free(pcf_info->rx_diam_realm); + pcf_info->rx_diam_realm = NULL; } - OpenAPI_list_free(pcf_info->gpsi_ranges); - ogs_free(pcf_info->rx_diam_host); - ogs_free(pcf_info->rx_diam_realm); ogs_free(pcf_info); } cJSON *OpenAPI_pcf_info_convertToJSON(OpenAPI_pcf_info_t *pcf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pcf_info == NULL) { ogs_error("OpenAPI_pcf_info_convertToJSON() failed [PcfInfo]"); @@ -72,19 +92,17 @@ cJSON *OpenAPI_pcf_info_convertToJSON(OpenAPI_pcf_info_t *pcf_info) } if (pcf_info->dnn_list) { - cJSON *dnn_list = cJSON_AddArrayToObject(item, "dnnList"); - if (dnn_list == NULL) { + cJSON *dnn_listList = cJSON_AddArrayToObject(item, "dnnList"); + if (dnn_listList == NULL) { ogs_error("OpenAPI_pcf_info_convertToJSON() failed [dnn_list]"); goto end; } - - OpenAPI_lnode_t *dnn_list_node; - OpenAPI_list_for_each(pcf_info->dnn_list, dnn_list_node) { - if (cJSON_AddStringToObject(dnn_list, "", (char*)dnn_list_node->data) == NULL) { - ogs_error("OpenAPI_pcf_info_convertToJSON() failed [dnn_list]"); - goto end; + OpenAPI_list_for_each(pcf_info->dnn_list, node) { + if (cJSON_AddStringToObject(dnn_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcf_info_convertToJSON() failed [dnn_list]"); + goto end; + } } - } } if (pcf_info->supi_ranges) { @@ -93,17 +111,13 @@ cJSON *OpenAPI_pcf_info_convertToJSON(OpenAPI_pcf_info_t *pcf_info) ogs_error("OpenAPI_pcf_info_convertToJSON() failed [supi_ranges]"); goto end; } - - OpenAPI_lnode_t *supi_ranges_node; - if (pcf_info->supi_ranges) { - OpenAPI_list_for_each(pcf_info->supi_ranges, supi_ranges_node) { - cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(supi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pcf_info_convertToJSON() failed [supi_ranges]"); - goto end; - } - cJSON_AddItemToArray(supi_rangesList, itemLocal); + OpenAPI_list_for_each(pcf_info->supi_ranges, node) { + cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pcf_info_convertToJSON() failed [supi_ranges]"); + goto end; } + cJSON_AddItemToArray(supi_rangesList, itemLocal); } } @@ -113,17 +127,13 @@ cJSON *OpenAPI_pcf_info_convertToJSON(OpenAPI_pcf_info_t *pcf_info) ogs_error("OpenAPI_pcf_info_convertToJSON() failed [gpsi_ranges]"); goto end; } - - OpenAPI_lnode_t *gpsi_ranges_node; - if (pcf_info->gpsi_ranges) { - OpenAPI_list_for_each(pcf_info->gpsi_ranges, gpsi_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(gpsi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pcf_info_convertToJSON() failed [gpsi_ranges]"); - goto end; - } - cJSON_AddItemToArray(gpsi_rangesList, itemLocal); + OpenAPI_list_for_each(pcf_info->gpsi_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pcf_info_convertToJSON() failed [gpsi_ranges]"); + goto end; } + cJSON_AddItemToArray(gpsi_rangesList, itemLocal); } } @@ -155,113 +165,113 @@ end: OpenAPI_pcf_info_t *OpenAPI_pcf_info_parseFromJSON(cJSON *pcf_infoJSON) { OpenAPI_pcf_info_t *pcf_info_local_var = NULL; - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "groupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *group_id = NULL; + cJSON *dnn_list = NULL; + OpenAPI_list_t *dnn_listList = NULL; + cJSON *supi_ranges = NULL; + OpenAPI_list_t *supi_rangesList = NULL; + cJSON *gpsi_ranges = NULL; + OpenAPI_list_t *gpsi_rangesList = NULL; + cJSON *rx_diam_host = NULL; + cJSON *rx_diam_realm = NULL; + cJSON *v2x_support_ind = NULL; + group_id = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *dnn_list = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "dnnList"); - - OpenAPI_list_t *dnn_listList; + dnn_list = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "dnnList"); if (dnn_list) { - cJSON *dnn_list_local; - if (!cJSON_IsArray(dnn_list)) { - ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [dnn_list]"); - goto end; - } - dnn_listList = OpenAPI_list_create(); + cJSON *dnn_list_local = NULL; + if (!cJSON_IsArray(dnn_list)) { + ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [dnn_list]"); + goto end; + } - cJSON_ArrayForEach(dnn_list_local, dnn_list) { - if (!cJSON_IsString(dnn_list_local)) { - ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [dnn_list]"); - goto end; - } - OpenAPI_list_add(dnn_listList, ogs_strdup(dnn_list_local->valuestring)); - } + dnn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_list_local, dnn_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnn_list_local)) { + ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [dnn_list]"); + goto end; + } + OpenAPI_list_add(dnn_listList, ogs_strdup(dnn_list_local->valuestring)); + } } - cJSON *supi_ranges = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "supiRanges"); - - OpenAPI_list_t *supi_rangesList; + supi_ranges = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "supiRanges"); if (supi_ranges) { - cJSON *supi_ranges_local_nonprimitive; - if (!cJSON_IsArray(supi_ranges)){ - ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [supi_ranges]"); - goto end; - } - - supi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(supi_ranges_local_nonprimitive, supi_ranges ) { - if (!cJSON_IsObject(supi_ranges_local_nonprimitive)) { + cJSON *supi_ranges_local = NULL; + if (!cJSON_IsArray(supi_ranges)) { ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [supi_ranges]"); goto end; } - OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local_nonprimitive); - if (!supi_rangesItem) { - ogs_error("No supi_rangesItem"); - OpenAPI_list_free(supi_rangesList); - goto end; + supi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_ranges_local, supi_ranges) { + if (!cJSON_IsObject(supi_ranges_local)) { + ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [supi_ranges]"); + goto end; + } + OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local); + if (!supi_rangesItem) { + ogs_error("No supi_rangesItem"); + OpenAPI_list_free(supi_rangesList); + goto end; + } + OpenAPI_list_add(supi_rangesList, supi_rangesItem); } - - OpenAPI_list_add(supi_rangesList, supi_rangesItem); - } } - cJSON *gpsi_ranges = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "gpsiRanges"); - - OpenAPI_list_t *gpsi_rangesList; + gpsi_ranges = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "gpsiRanges"); if (gpsi_ranges) { - cJSON *gpsi_ranges_local_nonprimitive; - if (!cJSON_IsArray(gpsi_ranges)){ - ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [gpsi_ranges]"); - goto end; - } - - gpsi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(gpsi_ranges_local_nonprimitive, gpsi_ranges ) { - if (!cJSON_IsObject(gpsi_ranges_local_nonprimitive)) { + cJSON *gpsi_ranges_local = NULL; + if (!cJSON_IsArray(gpsi_ranges)) { ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [gpsi_ranges]"); goto end; } - OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local_nonprimitive); - if (!gpsi_rangesItem) { - ogs_error("No gpsi_rangesItem"); - OpenAPI_list_free(gpsi_rangesList); - goto end; + gpsi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_ranges_local, gpsi_ranges) { + if (!cJSON_IsObject(gpsi_ranges_local)) { + ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [gpsi_ranges]"); + goto end; + } + OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local); + if (!gpsi_rangesItem) { + ogs_error("No gpsi_rangesItem"); + OpenAPI_list_free(gpsi_rangesList); + goto end; + } + OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); } - - OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); - } } - cJSON *rx_diam_host = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "rxDiamHost"); - + rx_diam_host = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "rxDiamHost"); if (rx_diam_host) { - if (!cJSON_IsString(rx_diam_host)) { + if (!cJSON_IsString(rx_diam_host) && !cJSON_IsNull(rx_diam_host)) { ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [rx_diam_host]"); goto end; } } - cJSON *rx_diam_realm = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "rxDiamRealm"); - + rx_diam_realm = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "rxDiamRealm"); if (rx_diam_realm) { - if (!cJSON_IsString(rx_diam_realm)) { + if (!cJSON_IsString(rx_diam_realm) && !cJSON_IsNull(rx_diam_realm)) { ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [rx_diam_realm]"); goto end; } } - cJSON *v2x_support_ind = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "v2xSupportInd"); - + v2x_support_ind = cJSON_GetObjectItemCaseSensitive(pcf_infoJSON, "v2xSupportInd"); if (v2x_support_ind) { if (!cJSON_IsBool(v2x_support_ind)) { ogs_error("OpenAPI_pcf_info_parseFromJSON() failed [v2x_support_ind]"); @@ -270,18 +280,39 @@ OpenAPI_pcf_info_t *OpenAPI_pcf_info_parseFromJSON(cJSON *pcf_infoJSON) } pcf_info_local_var = OpenAPI_pcf_info_create ( - group_id ? ogs_strdup(group_id->valuestring) : NULL, + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, dnn_list ? dnn_listList : NULL, supi_ranges ? supi_rangesList : NULL, gpsi_ranges ? gpsi_rangesList : NULL, - rx_diam_host ? ogs_strdup(rx_diam_host->valuestring) : NULL, - rx_diam_realm ? ogs_strdup(rx_diam_realm->valuestring) : NULL, + rx_diam_host && !cJSON_IsNull(rx_diam_host) ? ogs_strdup(rx_diam_host->valuestring) : NULL, + rx_diam_realm && !cJSON_IsNull(rx_diam_realm) ? ogs_strdup(rx_diam_realm->valuestring) : NULL, v2x_support_ind ? true : false, v2x_support_ind ? v2x_support_ind->valueint : 0 ); return pcf_info_local_var; end: + if (dnn_listList) { + OpenAPI_list_for_each(dnn_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnn_listList); + dnn_listList = NULL; + } + if (supi_rangesList) { + OpenAPI_list_for_each(supi_rangesList, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(supi_rangesList); + supi_rangesList = NULL; + } + if (gpsi_rangesList) { + OpenAPI_list_for_each(gpsi_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(gpsi_rangesList); + gpsi_rangesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pcscf_info.c b/lib/sbi/openapi/model/pcscf_info.c index ca60e1662..9e0564662 100644 --- a/lib/sbi/openapi/model/pcscf_info.c +++ b/lib/sbi/openapi/model/pcscf_info.c @@ -30,38 +30,61 @@ OpenAPI_pcscf_info_t *OpenAPI_pcscf_info_create( void OpenAPI_pcscf_info_free(OpenAPI_pcscf_info_t *pcscf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pcscf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(pcscf_info->access_type); - OpenAPI_list_for_each(pcscf_info->dnn_list, node) { - ogs_free(node->data); + if (pcscf_info->access_type) { + OpenAPI_list_free(pcscf_info->access_type); + pcscf_info->access_type = NULL; } - OpenAPI_list_free(pcscf_info->dnn_list); - ogs_free(pcscf_info->gm_fqdn); - OpenAPI_list_for_each(pcscf_info->gm_ipv4_addresses, node) { - ogs_free(node->data); + if (pcscf_info->dnn_list) { + OpenAPI_list_for_each(pcscf_info->dnn_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcscf_info->dnn_list); + pcscf_info->dnn_list = NULL; } - OpenAPI_list_free(pcscf_info->gm_ipv4_addresses); - OpenAPI_list_for_each(pcscf_info->gm_ipv6_addresses, node) { - ogs_free(node->data); + if (pcscf_info->gm_fqdn) { + ogs_free(pcscf_info->gm_fqdn); + pcscf_info->gm_fqdn = NULL; } - OpenAPI_list_free(pcscf_info->gm_ipv6_addresses); - OpenAPI_list_for_each(pcscf_info->served_ipv4_address_ranges, node) { - OpenAPI_ipv4_address_range_free(node->data); + if (pcscf_info->gm_ipv4_addresses) { + OpenAPI_list_for_each(pcscf_info->gm_ipv4_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcscf_info->gm_ipv4_addresses); + pcscf_info->gm_ipv4_addresses = NULL; } - OpenAPI_list_free(pcscf_info->served_ipv4_address_ranges); - OpenAPI_list_for_each(pcscf_info->served_ipv6_prefix_ranges, node) { - OpenAPI_ipv6_prefix_range_free(node->data); + if (pcscf_info->gm_ipv6_addresses) { + OpenAPI_list_for_each(pcscf_info->gm_ipv6_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcscf_info->gm_ipv6_addresses); + pcscf_info->gm_ipv6_addresses = NULL; + } + if (pcscf_info->served_ipv4_address_ranges) { + OpenAPI_list_for_each(pcscf_info->served_ipv4_address_ranges, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(pcscf_info->served_ipv4_address_ranges); + pcscf_info->served_ipv4_address_ranges = NULL; + } + if (pcscf_info->served_ipv6_prefix_ranges) { + OpenAPI_list_for_each(pcscf_info->served_ipv6_prefix_ranges, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(pcscf_info->served_ipv6_prefix_ranges); + pcscf_info->served_ipv6_prefix_ranges = NULL; } - OpenAPI_list_free(pcscf_info->served_ipv6_prefix_ranges); ogs_free(pcscf_info); } cJSON *OpenAPI_pcscf_info_convertToJSON(OpenAPI_pcscf_info_t *pcscf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pcscf_info == NULL) { ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [PcscfInfo]"); @@ -69,15 +92,14 @@ cJSON *OpenAPI_pcscf_info_convertToJSON(OpenAPI_pcscf_info_t *pcscf_info) } item = cJSON_CreateObject(); - if (pcscf_info->access_type) { - cJSON *access_type = cJSON_AddArrayToObject(item, "accessType"); - if (access_type == NULL) { + if (pcscf_info->access_type != OpenAPI_access_type_NULL) { + cJSON *access_typeList = cJSON_AddArrayToObject(item, "accessType"); + if (access_typeList == NULL) { ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [access_type]"); goto end; } - OpenAPI_lnode_t *access_type_node; - OpenAPI_list_for_each(pcscf_info->access_type, access_type_node) { - if (cJSON_AddStringToObject(access_type, "", OpenAPI_access_type_ToString((intptr_t)access_type_node->data)) == NULL) { + OpenAPI_list_for_each(pcscf_info->access_type, node) { + if (cJSON_AddStringToObject(access_typeList, "", OpenAPI_access_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [access_type]"); goto end; } @@ -85,19 +107,17 @@ cJSON *OpenAPI_pcscf_info_convertToJSON(OpenAPI_pcscf_info_t *pcscf_info) } if (pcscf_info->dnn_list) { - cJSON *dnn_list = cJSON_AddArrayToObject(item, "dnnList"); - if (dnn_list == NULL) { + cJSON *dnn_listList = cJSON_AddArrayToObject(item, "dnnList"); + if (dnn_listList == NULL) { ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [dnn_list]"); goto end; } - - OpenAPI_lnode_t *dnn_list_node; - OpenAPI_list_for_each(pcscf_info->dnn_list, dnn_list_node) { - if (cJSON_AddStringToObject(dnn_list, "", (char*)dnn_list_node->data) == NULL) { - ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [dnn_list]"); - goto end; + OpenAPI_list_for_each(pcscf_info->dnn_list, node) { + if (cJSON_AddStringToObject(dnn_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [dnn_list]"); + goto end; + } } - } } if (pcscf_info->gm_fqdn) { @@ -108,35 +128,31 @@ cJSON *OpenAPI_pcscf_info_convertToJSON(OpenAPI_pcscf_info_t *pcscf_info) } if (pcscf_info->gm_ipv4_addresses) { - cJSON *gm_ipv4_addresses = cJSON_AddArrayToObject(item, "gmIpv4Addresses"); - if (gm_ipv4_addresses == NULL) { + cJSON *gm_ipv4_addressesList = cJSON_AddArrayToObject(item, "gmIpv4Addresses"); + if (gm_ipv4_addressesList == NULL) { ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [gm_ipv4_addresses]"); goto end; } - - OpenAPI_lnode_t *gm_ipv4_addresses_node; - OpenAPI_list_for_each(pcscf_info->gm_ipv4_addresses, gm_ipv4_addresses_node) { - if (cJSON_AddStringToObject(gm_ipv4_addresses, "", (char*)gm_ipv4_addresses_node->data) == NULL) { - ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [gm_ipv4_addresses]"); - goto end; + OpenAPI_list_for_each(pcscf_info->gm_ipv4_addresses, node) { + if (cJSON_AddStringToObject(gm_ipv4_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [gm_ipv4_addresses]"); + goto end; + } } - } } if (pcscf_info->gm_ipv6_addresses) { - cJSON *gm_ipv6_addresses = cJSON_AddArrayToObject(item, "gmIpv6Addresses"); - if (gm_ipv6_addresses == NULL) { + cJSON *gm_ipv6_addressesList = cJSON_AddArrayToObject(item, "gmIpv6Addresses"); + if (gm_ipv6_addressesList == NULL) { ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [gm_ipv6_addresses]"); goto end; } - - OpenAPI_lnode_t *gm_ipv6_addresses_node; - OpenAPI_list_for_each(pcscf_info->gm_ipv6_addresses, gm_ipv6_addresses_node) { - if (cJSON_AddStringToObject(gm_ipv6_addresses, "", (char*)gm_ipv6_addresses_node->data) == NULL) { - ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [gm_ipv6_addresses]"); - goto end; + OpenAPI_list_for_each(pcscf_info->gm_ipv6_addresses, node) { + if (cJSON_AddStringToObject(gm_ipv6_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [gm_ipv6_addresses]"); + goto end; + } } - } } if (pcscf_info->served_ipv4_address_ranges) { @@ -145,17 +161,13 @@ cJSON *OpenAPI_pcscf_info_convertToJSON(OpenAPI_pcscf_info_t *pcscf_info) ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [served_ipv4_address_ranges]"); goto end; } - - OpenAPI_lnode_t *served_ipv4_address_ranges_node; - if (pcscf_info->served_ipv4_address_ranges) { - OpenAPI_list_for_each(pcscf_info->served_ipv4_address_ranges, served_ipv4_address_ranges_node) { - cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(served_ipv4_address_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [served_ipv4_address_ranges]"); - goto end; - } - cJSON_AddItemToArray(served_ipv4_address_rangesList, itemLocal); + OpenAPI_list_for_each(pcscf_info->served_ipv4_address_ranges, node) { + cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [served_ipv4_address_ranges]"); + goto end; } + cJSON_AddItemToArray(served_ipv4_address_rangesList, itemLocal); } } @@ -165,17 +177,13 @@ cJSON *OpenAPI_pcscf_info_convertToJSON(OpenAPI_pcscf_info_t *pcscf_info) ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [served_ipv6_prefix_ranges]"); goto end; } - - OpenAPI_lnode_t *served_ipv6_prefix_ranges_node; - if (pcscf_info->served_ipv6_prefix_ranges) { - OpenAPI_list_for_each(pcscf_info->served_ipv6_prefix_ranges, served_ipv6_prefix_ranges_node) { - cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(served_ipv6_prefix_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [served_ipv6_prefix_ranges]"); - goto end; - } - cJSON_AddItemToArray(served_ipv6_prefix_rangesList, itemLocal); + OpenAPI_list_for_each(pcscf_info->served_ipv6_prefix_ranges, node) { + cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pcscf_info_convertToJSON() failed [served_ipv6_prefix_ranges]"); + goto end; } + cJSON_AddItemToArray(served_ipv6_prefix_rangesList, itemLocal); } } @@ -186,159 +194,164 @@ end: OpenAPI_pcscf_info_t *OpenAPI_pcscf_info_parseFromJSON(cJSON *pcscf_infoJSON) { OpenAPI_pcscf_info_t *pcscf_info_local_var = NULL; - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "accessType"); - - OpenAPI_list_t *access_typeList; + OpenAPI_lnode_t *node = NULL; + cJSON *access_type = NULL; + OpenAPI_list_t *access_typeList = NULL; + cJSON *dnn_list = NULL; + OpenAPI_list_t *dnn_listList = NULL; + cJSON *gm_fqdn = NULL; + cJSON *gm_ipv4_addresses = NULL; + OpenAPI_list_t *gm_ipv4_addressesList = NULL; + cJSON *gm_ipv6_addresses = NULL; + OpenAPI_list_t *gm_ipv6_addressesList = NULL; + cJSON *served_ipv4_address_ranges = NULL; + OpenAPI_list_t *served_ipv4_address_rangesList = NULL; + cJSON *served_ipv6_prefix_ranges = NULL; + OpenAPI_list_t *served_ipv6_prefix_rangesList = NULL; + access_type = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "accessType"); if (access_type) { - cJSON *access_type_local_nonprimitive; - if (!cJSON_IsArray(access_type)) { - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [access_type]"); - goto end; - } - - access_typeList = OpenAPI_list_create(); - - cJSON_ArrayForEach(access_type_local_nonprimitive, access_type ) { - if (!cJSON_IsString(access_type_local_nonprimitive)){ + cJSON *access_type_local = NULL; + if (!cJSON_IsArray(access_type)) { ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [access_type]"); goto end; } - OpenAPI_list_add(access_typeList, (void *)OpenAPI_access_type_FromString(access_type_local_nonprimitive->valuestring)); - } + access_typeList = OpenAPI_list_create(); + + cJSON_ArrayForEach(access_type_local, access_type) { + if (!cJSON_IsString(access_type_local)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [access_type]"); + goto end; + } + OpenAPI_list_add(access_typeList, (void *)OpenAPI_access_type_FromString(access_type_local->valuestring)); + } } - cJSON *dnn_list = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "dnnList"); - - OpenAPI_list_t *dnn_listList; + dnn_list = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "dnnList"); if (dnn_list) { - cJSON *dnn_list_local; - if (!cJSON_IsArray(dnn_list)) { - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [dnn_list]"); - goto end; - } - dnn_listList = OpenAPI_list_create(); + cJSON *dnn_list_local = NULL; + if (!cJSON_IsArray(dnn_list)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [dnn_list]"); + goto end; + } - cJSON_ArrayForEach(dnn_list_local, dnn_list) { - if (!cJSON_IsString(dnn_list_local)) { - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [dnn_list]"); - goto end; - } - OpenAPI_list_add(dnn_listList, ogs_strdup(dnn_list_local->valuestring)); - } + dnn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_list_local, dnn_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnn_list_local)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [dnn_list]"); + goto end; + } + OpenAPI_list_add(dnn_listList, ogs_strdup(dnn_list_local->valuestring)); + } } - cJSON *gm_fqdn = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "gmFqdn"); - + gm_fqdn = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "gmFqdn"); if (gm_fqdn) { - if (!cJSON_IsString(gm_fqdn)) { + if (!cJSON_IsString(gm_fqdn) && !cJSON_IsNull(gm_fqdn)) { ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_fqdn]"); goto end; } } - cJSON *gm_ipv4_addresses = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "gmIpv4Addresses"); - - OpenAPI_list_t *gm_ipv4_addressesList; + gm_ipv4_addresses = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "gmIpv4Addresses"); if (gm_ipv4_addresses) { - cJSON *gm_ipv4_addresses_local; - if (!cJSON_IsArray(gm_ipv4_addresses)) { - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_ipv4_addresses]"); - goto end; - } - gm_ipv4_addressesList = OpenAPI_list_create(); + cJSON *gm_ipv4_addresses_local = NULL; + if (!cJSON_IsArray(gm_ipv4_addresses)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_ipv4_addresses]"); + goto end; + } - cJSON_ArrayForEach(gm_ipv4_addresses_local, gm_ipv4_addresses) { - if (!cJSON_IsString(gm_ipv4_addresses_local)) { - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_ipv4_addresses]"); - goto end; - } - OpenAPI_list_add(gm_ipv4_addressesList, ogs_strdup(gm_ipv4_addresses_local->valuestring)); - } + gm_ipv4_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gm_ipv4_addresses_local, gm_ipv4_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(gm_ipv4_addresses_local)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_ipv4_addresses]"); + goto end; + } + OpenAPI_list_add(gm_ipv4_addressesList, ogs_strdup(gm_ipv4_addresses_local->valuestring)); + } } - cJSON *gm_ipv6_addresses = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "gmIpv6Addresses"); - - OpenAPI_list_t *gm_ipv6_addressesList; + gm_ipv6_addresses = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "gmIpv6Addresses"); if (gm_ipv6_addresses) { - cJSON *gm_ipv6_addresses_local; - if (!cJSON_IsArray(gm_ipv6_addresses)) { - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_ipv6_addresses]"); - goto end; - } - gm_ipv6_addressesList = OpenAPI_list_create(); + cJSON *gm_ipv6_addresses_local = NULL; + if (!cJSON_IsArray(gm_ipv6_addresses)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_ipv6_addresses]"); + goto end; + } - cJSON_ArrayForEach(gm_ipv6_addresses_local, gm_ipv6_addresses) { - if (!cJSON_IsString(gm_ipv6_addresses_local)) { - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_ipv6_addresses]"); - goto end; - } - OpenAPI_list_add(gm_ipv6_addressesList, ogs_strdup(gm_ipv6_addresses_local->valuestring)); - } + gm_ipv6_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gm_ipv6_addresses_local, gm_ipv6_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(gm_ipv6_addresses_local)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [gm_ipv6_addresses]"); + goto end; + } + OpenAPI_list_add(gm_ipv6_addressesList, ogs_strdup(gm_ipv6_addresses_local->valuestring)); + } } - cJSON *served_ipv4_address_ranges = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "servedIpv4AddressRanges"); - - OpenAPI_list_t *served_ipv4_address_rangesList; + served_ipv4_address_ranges = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "servedIpv4AddressRanges"); if (served_ipv4_address_ranges) { - cJSON *served_ipv4_address_ranges_local_nonprimitive; - if (!cJSON_IsArray(served_ipv4_address_ranges)){ - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [served_ipv4_address_ranges]"); - goto end; - } - - served_ipv4_address_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(served_ipv4_address_ranges_local_nonprimitive, served_ipv4_address_ranges ) { - if (!cJSON_IsObject(served_ipv4_address_ranges_local_nonprimitive)) { + cJSON *served_ipv4_address_ranges_local = NULL; + if (!cJSON_IsArray(served_ipv4_address_ranges)) { ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [served_ipv4_address_ranges]"); goto end; } - OpenAPI_ipv4_address_range_t *served_ipv4_address_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(served_ipv4_address_ranges_local_nonprimitive); - if (!served_ipv4_address_rangesItem) { - ogs_error("No served_ipv4_address_rangesItem"); - OpenAPI_list_free(served_ipv4_address_rangesList); - goto end; + served_ipv4_address_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(served_ipv4_address_ranges_local, served_ipv4_address_ranges) { + if (!cJSON_IsObject(served_ipv4_address_ranges_local)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [served_ipv4_address_ranges]"); + goto end; + } + OpenAPI_ipv4_address_range_t *served_ipv4_address_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(served_ipv4_address_ranges_local); + if (!served_ipv4_address_rangesItem) { + ogs_error("No served_ipv4_address_rangesItem"); + OpenAPI_list_free(served_ipv4_address_rangesList); + goto end; + } + OpenAPI_list_add(served_ipv4_address_rangesList, served_ipv4_address_rangesItem); } - - OpenAPI_list_add(served_ipv4_address_rangesList, served_ipv4_address_rangesItem); - } } - cJSON *served_ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "servedIpv6PrefixRanges"); - - OpenAPI_list_t *served_ipv6_prefix_rangesList; + served_ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(pcscf_infoJSON, "servedIpv6PrefixRanges"); if (served_ipv6_prefix_ranges) { - cJSON *served_ipv6_prefix_ranges_local_nonprimitive; - if (!cJSON_IsArray(served_ipv6_prefix_ranges)){ - ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [served_ipv6_prefix_ranges]"); - goto end; - } - - served_ipv6_prefix_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(served_ipv6_prefix_ranges_local_nonprimitive, served_ipv6_prefix_ranges ) { - if (!cJSON_IsObject(served_ipv6_prefix_ranges_local_nonprimitive)) { + cJSON *served_ipv6_prefix_ranges_local = NULL; + if (!cJSON_IsArray(served_ipv6_prefix_ranges)) { ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [served_ipv6_prefix_ranges]"); goto end; } - OpenAPI_ipv6_prefix_range_t *served_ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(served_ipv6_prefix_ranges_local_nonprimitive); - if (!served_ipv6_prefix_rangesItem) { - ogs_error("No served_ipv6_prefix_rangesItem"); - OpenAPI_list_free(served_ipv6_prefix_rangesList); - goto end; + served_ipv6_prefix_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(served_ipv6_prefix_ranges_local, served_ipv6_prefix_ranges) { + if (!cJSON_IsObject(served_ipv6_prefix_ranges_local)) { + ogs_error("OpenAPI_pcscf_info_parseFromJSON() failed [served_ipv6_prefix_ranges]"); + goto end; + } + OpenAPI_ipv6_prefix_range_t *served_ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(served_ipv6_prefix_ranges_local); + if (!served_ipv6_prefix_rangesItem) { + ogs_error("No served_ipv6_prefix_rangesItem"); + OpenAPI_list_free(served_ipv6_prefix_rangesList); + goto end; + } + OpenAPI_list_add(served_ipv6_prefix_rangesList, served_ipv6_prefix_rangesItem); } - - OpenAPI_list_add(served_ipv6_prefix_rangesList, served_ipv6_prefix_rangesItem); - } } pcscf_info_local_var = OpenAPI_pcscf_info_create ( access_type ? access_typeList : NULL, dnn_list ? dnn_listList : NULL, - gm_fqdn ? ogs_strdup(gm_fqdn->valuestring) : NULL, + gm_fqdn && !cJSON_IsNull(gm_fqdn) ? ogs_strdup(gm_fqdn->valuestring) : NULL, gm_ipv4_addresses ? gm_ipv4_addressesList : NULL, gm_ipv6_addresses ? gm_ipv6_addressesList : NULL, served_ipv4_address_ranges ? served_ipv4_address_rangesList : NULL, @@ -347,6 +360,45 @@ OpenAPI_pcscf_info_t *OpenAPI_pcscf_info_parseFromJSON(cJSON *pcscf_infoJSON) return pcscf_info_local_var; end: + if (access_typeList) { + OpenAPI_list_free(access_typeList); + access_typeList = NULL; + } + if (dnn_listList) { + OpenAPI_list_for_each(dnn_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnn_listList); + dnn_listList = NULL; + } + if (gm_ipv4_addressesList) { + OpenAPI_list_for_each(gm_ipv4_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(gm_ipv4_addressesList); + gm_ipv4_addressesList = NULL; + } + if (gm_ipv6_addressesList) { + OpenAPI_list_for_each(gm_ipv6_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(gm_ipv6_addressesList); + gm_ipv6_addressesList = NULL; + } + if (served_ipv4_address_rangesList) { + OpenAPI_list_for_each(served_ipv4_address_rangesList, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(served_ipv4_address_rangesList); + served_ipv4_address_rangesList = NULL; + } + if (served_ipv6_prefix_rangesList) { + OpenAPI_list_for_each(served_ipv6_prefix_rangesList, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(served_ipv6_prefix_rangesList); + served_ipv6_prefix_rangesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pcscf_restoration_notification.c b/lib/sbi/openapi/model/pcscf_restoration_notification.c index ecf39577d..c2374908a 100644 --- a/lib/sbi/openapi/model/pcscf_restoration_notification.c +++ b/lib/sbi/openapi/model/pcscf_restoration_notification.c @@ -18,17 +18,22 @@ OpenAPI_pcscf_restoration_notification_t *OpenAPI_pcscf_restoration_notification void OpenAPI_pcscf_restoration_notification_free(OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pcscf_restoration_notification) { return; } - OpenAPI_lnode_t *node; - ogs_free(pcscf_restoration_notification->supi); + if (pcscf_restoration_notification->supi) { + ogs_free(pcscf_restoration_notification->supi); + pcscf_restoration_notification->supi = NULL; + } ogs_free(pcscf_restoration_notification); } cJSON *OpenAPI_pcscf_restoration_notification_convertToJSON(OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pcscf_restoration_notification == NULL) { ogs_error("OpenAPI_pcscf_restoration_notification_convertToJSON() failed [PcscfRestorationNotification]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_pcscf_restoration_notification_convertToJSON(OpenAPI_pcscf_restor } item = cJSON_CreateObject(); + if (!pcscf_restoration_notification->supi) { + ogs_error("OpenAPI_pcscf_restoration_notification_convertToJSON() failed [supi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supi", pcscf_restoration_notification->supi) == NULL) { ogs_error("OpenAPI_pcscf_restoration_notification_convertToJSON() failed [supi]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_pcscf_restoration_notification_t *OpenAPI_pcscf_restoration_notification_parseFromJSON(cJSON *pcscf_restoration_notificationJSON) { OpenAPI_pcscf_restoration_notification_t *pcscf_restoration_notification_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_notificationJSON, "supi"); + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + supi = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_notificationJSON, "supi"); if (!supi) { ogs_error("OpenAPI_pcscf_restoration_notification_parseFromJSON() failed [supi]"); goto end; } - if (!cJSON_IsString(supi)) { ogs_error("OpenAPI_pcscf_restoration_notification_parseFromJSON() failed [supi]"); goto end; diff --git a/lib/sbi/openapi/model/pcscf_restoration_request_data.c b/lib/sbi/openapi/model/pcscf_restoration_request_data.c index 8b7328dec..e706bf084 100644 --- a/lib/sbi/openapi/model/pcscf_restoration_request_data.c +++ b/lib/sbi/openapi/model/pcscf_restoration_request_data.c @@ -28,22 +28,42 @@ OpenAPI_pcscf_restoration_request_data_t *OpenAPI_pcscf_restoration_request_data void OpenAPI_pcscf_restoration_request_data_free(OpenAPI_pcscf_restoration_request_data_t *pcscf_restoration_request_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pcscf_restoration_request_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(pcscf_restoration_request_data->dnn); - ogs_free(pcscf_restoration_request_data->ip_domain); - OpenAPI_snssai_free(pcscf_restoration_request_data->slice_info); - ogs_free(pcscf_restoration_request_data->supi); - ogs_free(pcscf_restoration_request_data->ue_ipv4); - ogs_free(pcscf_restoration_request_data->ue_ipv6); + if (pcscf_restoration_request_data->dnn) { + ogs_free(pcscf_restoration_request_data->dnn); + pcscf_restoration_request_data->dnn = NULL; + } + if (pcscf_restoration_request_data->ip_domain) { + ogs_free(pcscf_restoration_request_data->ip_domain); + pcscf_restoration_request_data->ip_domain = NULL; + } + if (pcscf_restoration_request_data->slice_info) { + OpenAPI_snssai_free(pcscf_restoration_request_data->slice_info); + pcscf_restoration_request_data->slice_info = NULL; + } + if (pcscf_restoration_request_data->supi) { + ogs_free(pcscf_restoration_request_data->supi); + pcscf_restoration_request_data->supi = NULL; + } + if (pcscf_restoration_request_data->ue_ipv4) { + ogs_free(pcscf_restoration_request_data->ue_ipv4); + pcscf_restoration_request_data->ue_ipv4 = NULL; + } + if (pcscf_restoration_request_data->ue_ipv6) { + ogs_free(pcscf_restoration_request_data->ue_ipv6); + pcscf_restoration_request_data->ue_ipv6 = NULL; + } ogs_free(pcscf_restoration_request_data); } cJSON *OpenAPI_pcscf_restoration_request_data_convertToJSON(OpenAPI_pcscf_restoration_request_data_t *pcscf_restoration_request_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pcscf_restoration_request_data == NULL) { ogs_error("OpenAPI_pcscf_restoration_request_data_convertToJSON() failed [PcscfRestorationRequestData]"); @@ -106,69 +126,74 @@ end: OpenAPI_pcscf_restoration_request_data_t *OpenAPI_pcscf_restoration_request_data_parseFromJSON(cJSON *pcscf_restoration_request_dataJSON) { OpenAPI_pcscf_restoration_request_data_t *pcscf_restoration_request_data_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "dnn"); - + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *ip_domain = NULL; + cJSON *slice_info = NULL; + OpenAPI_snssai_t *slice_info_local_nonprim = NULL; + cJSON *supi = NULL; + cJSON *ue_ipv4 = NULL; + cJSON *ue_ipv6 = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_pcscf_restoration_request_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *ip_domain = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "ipDomain"); - + ip_domain = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "ipDomain"); if (ip_domain) { - if (!cJSON_IsString(ip_domain)) { + if (!cJSON_IsString(ip_domain) && !cJSON_IsNull(ip_domain)) { ogs_error("OpenAPI_pcscf_restoration_request_data_parseFromJSON() failed [ip_domain]"); goto end; } } - cJSON *slice_info = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "sliceInfo"); - - OpenAPI_snssai_t *slice_info_local_nonprim = NULL; + slice_info = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "sliceInfo"); if (slice_info) { slice_info_local_nonprim = OpenAPI_snssai_parseFromJSON(slice_info); } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_pcscf_restoration_request_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *ue_ipv4 = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "ueIpv4"); - + ue_ipv4 = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "ueIpv4"); if (ue_ipv4) { - if (!cJSON_IsString(ue_ipv4)) { + if (!cJSON_IsString(ue_ipv4) && !cJSON_IsNull(ue_ipv4)) { ogs_error("OpenAPI_pcscf_restoration_request_data_parseFromJSON() failed [ue_ipv4]"); goto end; } } - cJSON *ue_ipv6 = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "ueIpv6"); - + ue_ipv6 = cJSON_GetObjectItemCaseSensitive(pcscf_restoration_request_dataJSON, "ueIpv6"); if (ue_ipv6) { - if (!cJSON_IsString(ue_ipv6)) { + if (!cJSON_IsString(ue_ipv6) && !cJSON_IsNull(ue_ipv6)) { ogs_error("OpenAPI_pcscf_restoration_request_data_parseFromJSON() failed [ue_ipv6]"); goto end; } } pcscf_restoration_request_data_local_var = OpenAPI_pcscf_restoration_request_data_create ( - dnn ? ogs_strdup(dnn->valuestring) : NULL, - ip_domain ? ogs_strdup(ip_domain->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, + ip_domain && !cJSON_IsNull(ip_domain) ? ogs_strdup(ip_domain->valuestring) : NULL, slice_info ? slice_info_local_nonprim : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL, - ue_ipv4 ? ogs_strdup(ue_ipv4->valuestring) : NULL, - ue_ipv6 ? ogs_strdup(ue_ipv6->valuestring) : NULL + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + ue_ipv4 && !cJSON_IsNull(ue_ipv4) ? ogs_strdup(ue_ipv4->valuestring) : NULL, + ue_ipv6 && !cJSON_IsNull(ue_ipv6) ? ogs_strdup(ue_ipv6->valuestring) : NULL ); return pcscf_restoration_request_data_local_var; end: + if (slice_info_local_nonprim) { + OpenAPI_snssai_free(slice_info_local_nonprim); + slice_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session.c b/lib/sbi/openapi/model/pdu_session.c index 3a1b0fd4c..b329bbf6e 100644 --- a/lib/sbi/openapi/model/pdu_session.c +++ b/lib/sbi/openapi/model/pdu_session.c @@ -24,20 +24,34 @@ OpenAPI_pdu_session_t *OpenAPI_pdu_session_create( void OpenAPI_pdu_session_free(OpenAPI_pdu_session_t *pdu_session) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session) { return; } - OpenAPI_lnode_t *node; - ogs_free(pdu_session->dnn); - ogs_free(pdu_session->smf_instance_id); - OpenAPI_plmn_id_free(pdu_session->plmn_id); - OpenAPI_snssai_free(pdu_session->single_nssai); + if (pdu_session->dnn) { + ogs_free(pdu_session->dnn); + pdu_session->dnn = NULL; + } + if (pdu_session->smf_instance_id) { + ogs_free(pdu_session->smf_instance_id); + pdu_session->smf_instance_id = NULL; + } + if (pdu_session->plmn_id) { + OpenAPI_plmn_id_free(pdu_session->plmn_id); + pdu_session->plmn_id = NULL; + } + if (pdu_session->single_nssai) { + OpenAPI_snssai_free(pdu_session->single_nssai); + pdu_session->single_nssai = NULL; + } ogs_free(pdu_session); } cJSON *OpenAPI_pdu_session_convertToJSON(OpenAPI_pdu_session_t *pdu_session) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session == NULL) { ogs_error("OpenAPI_pdu_session_convertToJSON() failed [PduSession]"); @@ -45,16 +59,28 @@ cJSON *OpenAPI_pdu_session_convertToJSON(OpenAPI_pdu_session_t *pdu_session) } item = cJSON_CreateObject(); + if (!pdu_session->dnn) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", pdu_session->dnn) == NULL) { ogs_error("OpenAPI_pdu_session_convertToJSON() failed [dnn]"); goto end; } + if (!pdu_session->smf_instance_id) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [smf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smfInstanceId", pdu_session->smf_instance_id) == NULL) { ogs_error("OpenAPI_pdu_session_convertToJSON() failed [smf_instance_id]"); goto end; } + if (!pdu_session->plmn_id) { + ogs_error("OpenAPI_pdu_session_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(pdu_session->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_pdu_session_convertToJSON() failed [plmn_id]"); @@ -86,40 +112,41 @@ end: OpenAPI_pdu_session_t *OpenAPI_pdu_session_parseFromJSON(cJSON *pdu_sessionJSON) { OpenAPI_pdu_session_t *pdu_session_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *smf_instance_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [dnn]"); goto end; } - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "smfInstanceId"); + smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "smfInstanceId"); if (!smf_instance_id) { ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [smf_instance_id]"); goto end; } - if (!cJSON_IsString(smf_instance_id)) { ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [smf_instance_id]"); goto end; } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "plmnId"); + plmn_id = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_pdu_session_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "singleNssai"); - - OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + single_nssai = cJSON_GetObjectItemCaseSensitive(pdu_sessionJSON, "singleNssai"); if (single_nssai) { single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); } @@ -133,6 +160,14 @@ OpenAPI_pdu_session_t *OpenAPI_pdu_session_parseFromJSON(cJSON *pdu_sessionJSON) return pdu_session_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_1.c b/lib/sbi/openapi/model/pdu_session_1.c index ae44be18b..c8e529037 100644 --- a/lib/sbi/openapi/model/pdu_session_1.c +++ b/lib/sbi/openapi/model/pdu_session_1.c @@ -24,20 +24,34 @@ OpenAPI_pdu_session_1_t *OpenAPI_pdu_session_1_create( void OpenAPI_pdu_session_1_free(OpenAPI_pdu_session_1_t *pdu_session_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(pdu_session_1->dnn); - ogs_free(pdu_session_1->smf_instance_id); - OpenAPI_plmn_id_1_free(pdu_session_1->plmn_id); - OpenAPI_snssai_free(pdu_session_1->single_nssai); + if (pdu_session_1->dnn) { + ogs_free(pdu_session_1->dnn); + pdu_session_1->dnn = NULL; + } + if (pdu_session_1->smf_instance_id) { + ogs_free(pdu_session_1->smf_instance_id); + pdu_session_1->smf_instance_id = NULL; + } + if (pdu_session_1->plmn_id) { + OpenAPI_plmn_id_1_free(pdu_session_1->plmn_id); + pdu_session_1->plmn_id = NULL; + } + if (pdu_session_1->single_nssai) { + OpenAPI_snssai_free(pdu_session_1->single_nssai); + pdu_session_1->single_nssai = NULL; + } ogs_free(pdu_session_1); } cJSON *OpenAPI_pdu_session_1_convertToJSON(OpenAPI_pdu_session_1_t *pdu_session_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_1 == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [PduSession_1]"); @@ -45,16 +59,28 @@ cJSON *OpenAPI_pdu_session_1_convertToJSON(OpenAPI_pdu_session_1_t *pdu_session_ } item = cJSON_CreateObject(); + if (!pdu_session_1->dnn) { + ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", pdu_session_1->dnn) == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [dnn]"); goto end; } + if (!pdu_session_1->smf_instance_id) { + ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [smf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smfInstanceId", pdu_session_1->smf_instance_id) == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [smf_instance_id]"); goto end; } + if (!pdu_session_1->plmn_id) { + ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_1_convertToJSON(pdu_session_1->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_pdu_session_1_convertToJSON() failed [plmn_id]"); @@ -86,40 +112,41 @@ end: OpenAPI_pdu_session_1_t *OpenAPI_pdu_session_1_parseFromJSON(cJSON *pdu_session_1JSON) { OpenAPI_pdu_session_1_t *pdu_session_1_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *smf_instance_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [dnn]"); goto end; } - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "smfInstanceId"); + smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "smfInstanceId"); if (!smf_instance_id) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [smf_instance_id]"); goto end; } - if (!cJSON_IsString(smf_instance_id)) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [smf_instance_id]"); goto end; } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "plmnId"); + plmn_id = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_pdu_session_1_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); - cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "singleNssai"); - - OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + single_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_1JSON, "singleNssai"); if (single_nssai) { single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); } @@ -133,6 +160,14 @@ OpenAPI_pdu_session_1_t *OpenAPI_pdu_session_1_parseFromJSON(cJSON *pdu_session_ return pdu_session_1_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_context.c b/lib/sbi/openapi/model/pdu_session_context.c index 6372cb807..1371034d7 100644 --- a/lib/sbi/openapi/model/pdu_session_context.c +++ b/lib/sbi/openapi/model/pdu_session_context.c @@ -66,36 +66,89 @@ OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_create( void OpenAPI_pdu_session_context_free(OpenAPI_pdu_session_context_t *pdu_session_context) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_context) { return; } - OpenAPI_lnode_t *node; - ogs_free(pdu_session_context->sm_context_ref); - OpenAPI_snssai_free(pdu_session_context->s_nssai); - ogs_free(pdu_session_context->dnn); - ogs_free(pdu_session_context->selected_dnn); - OpenAPI_list_for_each(pdu_session_context->allocated_ebi_list, node) { - OpenAPI_ebi_arp_mapping_free(node->data); + if (pdu_session_context->sm_context_ref) { + ogs_free(pdu_session_context->sm_context_ref); + pdu_session_context->sm_context_ref = NULL; + } + if (pdu_session_context->s_nssai) { + OpenAPI_snssai_free(pdu_session_context->s_nssai); + pdu_session_context->s_nssai = NULL; + } + if (pdu_session_context->dnn) { + ogs_free(pdu_session_context->dnn); + pdu_session_context->dnn = NULL; + } + if (pdu_session_context->selected_dnn) { + ogs_free(pdu_session_context->selected_dnn); + pdu_session_context->selected_dnn = NULL; + } + if (pdu_session_context->allocated_ebi_list) { + OpenAPI_list_for_each(pdu_session_context->allocated_ebi_list, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(pdu_session_context->allocated_ebi_list); + pdu_session_context->allocated_ebi_list = NULL; + } + if (pdu_session_context->hsmf_id) { + ogs_free(pdu_session_context->hsmf_id); + pdu_session_context->hsmf_id = NULL; + } + if (pdu_session_context->hsmf_set_id) { + ogs_free(pdu_session_context->hsmf_set_id); + pdu_session_context->hsmf_set_id = NULL; + } + if (pdu_session_context->hsmf_service_set_id) { + ogs_free(pdu_session_context->hsmf_service_set_id); + pdu_session_context->hsmf_service_set_id = NULL; + } + if (pdu_session_context->vsmf_id) { + ogs_free(pdu_session_context->vsmf_id); + pdu_session_context->vsmf_id = NULL; + } + if (pdu_session_context->vsmf_set_id) { + ogs_free(pdu_session_context->vsmf_set_id); + pdu_session_context->vsmf_set_id = NULL; + } + if (pdu_session_context->vsmf_service_set_id) { + ogs_free(pdu_session_context->vsmf_service_set_id); + pdu_session_context->vsmf_service_set_id = NULL; + } + if (pdu_session_context->ismf_id) { + ogs_free(pdu_session_context->ismf_id); + pdu_session_context->ismf_id = NULL; + } + if (pdu_session_context->ismf_set_id) { + ogs_free(pdu_session_context->ismf_set_id); + pdu_session_context->ismf_set_id = NULL; + } + if (pdu_session_context->ismf_service_set_id) { + ogs_free(pdu_session_context->ismf_service_set_id); + pdu_session_context->ismf_service_set_id = NULL; + } + if (pdu_session_context->ns_instance) { + ogs_free(pdu_session_context->ns_instance); + pdu_session_context->ns_instance = NULL; + } + if (pdu_session_context->smf_service_instance_id) { + ogs_free(pdu_session_context->smf_service_instance_id); + pdu_session_context->smf_service_instance_id = NULL; + } + if (pdu_session_context->cn_assisted_ran_para) { + OpenAPI_cn_assisted_ran_para_free(pdu_session_context->cn_assisted_ran_para); + pdu_session_context->cn_assisted_ran_para = NULL; } - OpenAPI_list_free(pdu_session_context->allocated_ebi_list); - ogs_free(pdu_session_context->hsmf_id); - ogs_free(pdu_session_context->hsmf_set_id); - ogs_free(pdu_session_context->hsmf_service_set_id); - ogs_free(pdu_session_context->vsmf_id); - ogs_free(pdu_session_context->vsmf_set_id); - ogs_free(pdu_session_context->vsmf_service_set_id); - ogs_free(pdu_session_context->ismf_id); - ogs_free(pdu_session_context->ismf_set_id); - ogs_free(pdu_session_context->ismf_service_set_id); - ogs_free(pdu_session_context->ns_instance); - ogs_free(pdu_session_context->smf_service_instance_id); - OpenAPI_cn_assisted_ran_para_free(pdu_session_context->cn_assisted_ran_para); ogs_free(pdu_session_context); } cJSON *OpenAPI_pdu_session_context_convertToJSON(OpenAPI_pdu_session_context_t *pdu_session_context) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_context == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [PduSessionContext]"); @@ -108,11 +161,19 @@ cJSON *OpenAPI_pdu_session_context_convertToJSON(OpenAPI_pdu_session_context_t * goto end; } + if (!pdu_session_context->sm_context_ref) { + ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [sm_context_ref]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smContextRef", pdu_session_context->sm_context_ref) == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [sm_context_ref]"); goto end; } + if (!pdu_session_context->s_nssai) { + ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [s_nssai]"); + return NULL; + } cJSON *s_nssai_local_JSON = OpenAPI_snssai_convertToJSON(pdu_session_context->s_nssai); if (s_nssai_local_JSON == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [s_nssai]"); @@ -124,6 +185,10 @@ cJSON *OpenAPI_pdu_session_context_convertToJSON(OpenAPI_pdu_session_context_t * goto end; } + if (!pdu_session_context->dnn) { + ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", pdu_session_context->dnn) == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [dnn]"); goto end; @@ -136,12 +201,16 @@ cJSON *OpenAPI_pdu_session_context_convertToJSON(OpenAPI_pdu_session_context_t * } } + if (pdu_session_context->access_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [access_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(pdu_session_context->access_type)) == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [access_type]"); goto end; } - if (pdu_session_context->additional_access_type) { + if (pdu_session_context->additional_access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "additionalAccessType", OpenAPI_access_type_ToString(pdu_session_context->additional_access_type)) == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [additional_access_type]"); goto end; @@ -154,17 +223,13 @@ cJSON *OpenAPI_pdu_session_context_convertToJSON(OpenAPI_pdu_session_context_t * ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [allocated_ebi_list]"); goto end; } - - OpenAPI_lnode_t *allocated_ebi_list_node; - if (pdu_session_context->allocated_ebi_list) { - OpenAPI_list_for_each(pdu_session_context->allocated_ebi_list, allocated_ebi_list_node) { - cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(allocated_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [allocated_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(allocated_ebi_listList, itemLocal); + OpenAPI_list_for_each(pdu_session_context->allocated_ebi_list, node) { + cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [allocated_ebi_list]"); + goto end; } + cJSON_AddItemToArray(allocated_ebi_listList, itemLocal); } } @@ -189,7 +254,7 @@ cJSON *OpenAPI_pdu_session_context_convertToJSON(OpenAPI_pdu_session_context_t * } } - if (pdu_session_context->smf_binding) { + if (pdu_session_context->smf_binding != OpenAPI_sbi_binding_level_NULL) { if (cJSON_AddStringToObject(item, "smfBinding", OpenAPI_sbi_binding_level_ToString(pdu_session_context->smf_binding)) == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [smf_binding]"); goto end; @@ -217,7 +282,7 @@ cJSON *OpenAPI_pdu_session_context_convertToJSON(OpenAPI_pdu_session_context_t * } } - if (pdu_session_context->vsmf_binding) { + if (pdu_session_context->vsmf_binding != OpenAPI_sbi_binding_level_NULL) { if (cJSON_AddStringToObject(item, "vsmfBinding", OpenAPI_sbi_binding_level_ToString(pdu_session_context->vsmf_binding)) == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [vsmf_binding]"); goto end; @@ -245,7 +310,7 @@ cJSON *OpenAPI_pdu_session_context_convertToJSON(OpenAPI_pdu_session_context_t * } } - if (pdu_session_context->ismf_binding) { + if (pdu_session_context->ismf_binding != OpenAPI_sbi_binding_level_NULL) { if (cJSON_AddStringToObject(item, "ismfBinding", OpenAPI_sbi_binding_level_ToString(pdu_session_context->ismf_binding)) == NULL) { ogs_error("OpenAPI_pdu_session_context_convertToJSON() failed [ismf_binding]"); goto end; @@ -293,73 +358,96 @@ end: OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_parseFromJSON(cJSON *pdu_session_contextJSON) { OpenAPI_pdu_session_context_t *pdu_session_context_local_var = NULL; - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "pduSessionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_id = NULL; + cJSON *sm_context_ref = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *dnn = NULL; + cJSON *selected_dnn = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *additional_access_type = NULL; + OpenAPI_access_type_e additional_access_typeVariable = 0; + cJSON *allocated_ebi_list = NULL; + OpenAPI_list_t *allocated_ebi_listList = NULL; + cJSON *hsmf_id = NULL; + cJSON *hsmf_set_id = NULL; + cJSON *hsmf_service_set_id = NULL; + cJSON *smf_binding = NULL; + OpenAPI_sbi_binding_level_e smf_bindingVariable = 0; + cJSON *vsmf_id = NULL; + cJSON *vsmf_set_id = NULL; + cJSON *vsmf_service_set_id = NULL; + cJSON *vsmf_binding = NULL; + OpenAPI_sbi_binding_level_e vsmf_bindingVariable = 0; + cJSON *ismf_id = NULL; + cJSON *ismf_set_id = NULL; + cJSON *ismf_service_set_id = NULL; + cJSON *ismf_binding = NULL; + OpenAPI_sbi_binding_level_e ismf_bindingVariable = 0; + cJSON *ns_instance = NULL; + cJSON *smf_service_instance_id = NULL; + cJSON *ma_pdu_session = NULL; + cJSON *cn_assisted_ran_para = NULL; + OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para_local_nonprim = NULL; + pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "pduSessionId"); if (!pdu_session_id) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [pdu_session_id]"); goto end; } - if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [pdu_session_id]"); goto end; } - cJSON *sm_context_ref = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "smContextRef"); + sm_context_ref = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "smContextRef"); if (!sm_context_ref) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [sm_context_ref]"); goto end; } - if (!cJSON_IsString(sm_context_ref)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [sm_context_ref]"); goto end; } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "sNssai"); + s_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "sNssai"); if (!s_nssai) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [s_nssai]"); goto end; } - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "dnn"); + dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [dnn]"); goto end; } - cJSON *selected_dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "selectedDnn"); - + selected_dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "selectedDnn"); if (selected_dnn) { - if (!cJSON_IsString(selected_dnn)) { + if (!cJSON_IsString(selected_dnn) && !cJSON_IsNull(selected_dnn)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [selected_dnn]"); goto end; } } - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "accessType"); + access_type = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "accessType"); if (!access_type) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [access_type]"); goto end; } - - OpenAPI_access_type_e access_typeVariable; if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [access_type]"); goto end; } access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); - cJSON *additional_access_type = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "additionalAccessType"); - - OpenAPI_access_type_e additional_access_typeVariable; + additional_access_type = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "additionalAccessType"); if (additional_access_type) { if (!cJSON_IsString(additional_access_type)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [additional_access_type]"); @@ -368,65 +456,56 @@ OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_parseFromJSON(cJSON * additional_access_typeVariable = OpenAPI_access_type_FromString(additional_access_type->valuestring); } - cJSON *allocated_ebi_list = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "allocatedEbiList"); - - OpenAPI_list_t *allocated_ebi_listList; + allocated_ebi_list = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "allocatedEbiList"); if (allocated_ebi_list) { - cJSON *allocated_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(allocated_ebi_list)){ - ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [allocated_ebi_list]"); - goto end; - } - - allocated_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allocated_ebi_list_local_nonprimitive, allocated_ebi_list ) { - if (!cJSON_IsObject(allocated_ebi_list_local_nonprimitive)) { + cJSON *allocated_ebi_list_local = NULL; + if (!cJSON_IsArray(allocated_ebi_list)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [allocated_ebi_list]"); goto end; } - OpenAPI_ebi_arp_mapping_t *allocated_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(allocated_ebi_list_local_nonprimitive); - if (!allocated_ebi_listItem) { - ogs_error("No allocated_ebi_listItem"); - OpenAPI_list_free(allocated_ebi_listList); - goto end; + allocated_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allocated_ebi_list_local, allocated_ebi_list) { + if (!cJSON_IsObject(allocated_ebi_list_local)) { + ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [allocated_ebi_list]"); + goto end; + } + OpenAPI_ebi_arp_mapping_t *allocated_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(allocated_ebi_list_local); + if (!allocated_ebi_listItem) { + ogs_error("No allocated_ebi_listItem"); + OpenAPI_list_free(allocated_ebi_listList); + goto end; + } + OpenAPI_list_add(allocated_ebi_listList, allocated_ebi_listItem); } - - OpenAPI_list_add(allocated_ebi_listList, allocated_ebi_listItem); - } } - cJSON *hsmf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "hsmfId"); - + hsmf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "hsmfId"); if (hsmf_id) { - if (!cJSON_IsString(hsmf_id)) { + if (!cJSON_IsString(hsmf_id) && !cJSON_IsNull(hsmf_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [hsmf_id]"); goto end; } } - cJSON *hsmf_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "hsmfSetId"); - + hsmf_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "hsmfSetId"); if (hsmf_set_id) { - if (!cJSON_IsString(hsmf_set_id)) { + if (!cJSON_IsString(hsmf_set_id) && !cJSON_IsNull(hsmf_set_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [hsmf_set_id]"); goto end; } } - cJSON *hsmf_service_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "hsmfServiceSetId"); - + hsmf_service_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "hsmfServiceSetId"); if (hsmf_service_set_id) { - if (!cJSON_IsString(hsmf_service_set_id)) { + if (!cJSON_IsString(hsmf_service_set_id) && !cJSON_IsNull(hsmf_service_set_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [hsmf_service_set_id]"); goto end; } } - cJSON *smf_binding = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "smfBinding"); - - OpenAPI_sbi_binding_level_e smf_bindingVariable; + smf_binding = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "smfBinding"); if (smf_binding) { if (!cJSON_IsString(smf_binding)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [smf_binding]"); @@ -435,36 +514,31 @@ OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_parseFromJSON(cJSON * smf_bindingVariable = OpenAPI_sbi_binding_level_FromString(smf_binding->valuestring); } - cJSON *vsmf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "vsmfId"); - + vsmf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "vsmfId"); if (vsmf_id) { - if (!cJSON_IsString(vsmf_id)) { + if (!cJSON_IsString(vsmf_id) && !cJSON_IsNull(vsmf_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [vsmf_id]"); goto end; } } - cJSON *vsmf_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "vsmfSetId"); - + vsmf_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "vsmfSetId"); if (vsmf_set_id) { - if (!cJSON_IsString(vsmf_set_id)) { + if (!cJSON_IsString(vsmf_set_id) && !cJSON_IsNull(vsmf_set_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [vsmf_set_id]"); goto end; } } - cJSON *vsmf_service_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "vsmfServiceSetId"); - + vsmf_service_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "vsmfServiceSetId"); if (vsmf_service_set_id) { - if (!cJSON_IsString(vsmf_service_set_id)) { + if (!cJSON_IsString(vsmf_service_set_id) && !cJSON_IsNull(vsmf_service_set_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [vsmf_service_set_id]"); goto end; } } - cJSON *vsmf_binding = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "vsmfBinding"); - - OpenAPI_sbi_binding_level_e vsmf_bindingVariable; + vsmf_binding = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "vsmfBinding"); if (vsmf_binding) { if (!cJSON_IsString(vsmf_binding)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [vsmf_binding]"); @@ -473,36 +547,31 @@ OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_parseFromJSON(cJSON * vsmf_bindingVariable = OpenAPI_sbi_binding_level_FromString(vsmf_binding->valuestring); } - cJSON *ismf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "ismfId"); - + ismf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "ismfId"); if (ismf_id) { - if (!cJSON_IsString(ismf_id)) { + if (!cJSON_IsString(ismf_id) && !cJSON_IsNull(ismf_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [ismf_id]"); goto end; } } - cJSON *ismf_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "ismfSetId"); - + ismf_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "ismfSetId"); if (ismf_set_id) { - if (!cJSON_IsString(ismf_set_id)) { + if (!cJSON_IsString(ismf_set_id) && !cJSON_IsNull(ismf_set_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [ismf_set_id]"); goto end; } } - cJSON *ismf_service_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "ismfServiceSetId"); - + ismf_service_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "ismfServiceSetId"); if (ismf_service_set_id) { - if (!cJSON_IsString(ismf_service_set_id)) { + if (!cJSON_IsString(ismf_service_set_id) && !cJSON_IsNull(ismf_service_set_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [ismf_service_set_id]"); goto end; } } - cJSON *ismf_binding = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "ismfBinding"); - - OpenAPI_sbi_binding_level_e ismf_bindingVariable; + ismf_binding = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "ismfBinding"); if (ismf_binding) { if (!cJSON_IsString(ismf_binding)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [ismf_binding]"); @@ -511,26 +580,23 @@ OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_parseFromJSON(cJSON * ismf_bindingVariable = OpenAPI_sbi_binding_level_FromString(ismf_binding->valuestring); } - cJSON *ns_instance = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "nsInstance"); - + ns_instance = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "nsInstance"); if (ns_instance) { - if (!cJSON_IsString(ns_instance)) { + if (!cJSON_IsString(ns_instance) && !cJSON_IsNull(ns_instance)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [ns_instance]"); goto end; } } - cJSON *smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "smfServiceInstanceId"); - + smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "smfServiceInstanceId"); if (smf_service_instance_id) { - if (!cJSON_IsString(smf_service_instance_id)) { + if (!cJSON_IsString(smf_service_instance_id) && !cJSON_IsNull(smf_service_instance_id)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [smf_service_instance_id]"); goto end; } } - cJSON *ma_pdu_session = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "maPduSession"); - + ma_pdu_session = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "maPduSession"); if (ma_pdu_session) { if (!cJSON_IsBool(ma_pdu_session)) { ogs_error("OpenAPI_pdu_session_context_parseFromJSON() failed [ma_pdu_session]"); @@ -538,9 +604,7 @@ OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_parseFromJSON(cJSON * } } - cJSON *cn_assisted_ran_para = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "cnAssistedRanPara"); - - OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para_local_nonprim = NULL; + cn_assisted_ran_para = cJSON_GetObjectItemCaseSensitive(pdu_session_contextJSON, "cnAssistedRanPara"); if (cn_assisted_ran_para) { cn_assisted_ran_para_local_nonprim = OpenAPI_cn_assisted_ran_para_parseFromJSON(cn_assisted_ran_para); } @@ -551,24 +615,24 @@ OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_parseFromJSON(cJSON * ogs_strdup(sm_context_ref->valuestring), s_nssai_local_nonprim, ogs_strdup(dnn->valuestring), - selected_dnn ? ogs_strdup(selected_dnn->valuestring) : NULL, + selected_dnn && !cJSON_IsNull(selected_dnn) ? ogs_strdup(selected_dnn->valuestring) : NULL, access_typeVariable, additional_access_type ? additional_access_typeVariable : 0, allocated_ebi_list ? allocated_ebi_listList : NULL, - hsmf_id ? ogs_strdup(hsmf_id->valuestring) : NULL, - hsmf_set_id ? ogs_strdup(hsmf_set_id->valuestring) : NULL, - hsmf_service_set_id ? ogs_strdup(hsmf_service_set_id->valuestring) : NULL, + hsmf_id && !cJSON_IsNull(hsmf_id) ? ogs_strdup(hsmf_id->valuestring) : NULL, + hsmf_set_id && !cJSON_IsNull(hsmf_set_id) ? ogs_strdup(hsmf_set_id->valuestring) : NULL, + hsmf_service_set_id && !cJSON_IsNull(hsmf_service_set_id) ? ogs_strdup(hsmf_service_set_id->valuestring) : NULL, smf_binding ? smf_bindingVariable : 0, - vsmf_id ? ogs_strdup(vsmf_id->valuestring) : NULL, - vsmf_set_id ? ogs_strdup(vsmf_set_id->valuestring) : NULL, - vsmf_service_set_id ? ogs_strdup(vsmf_service_set_id->valuestring) : NULL, + vsmf_id && !cJSON_IsNull(vsmf_id) ? ogs_strdup(vsmf_id->valuestring) : NULL, + vsmf_set_id && !cJSON_IsNull(vsmf_set_id) ? ogs_strdup(vsmf_set_id->valuestring) : NULL, + vsmf_service_set_id && !cJSON_IsNull(vsmf_service_set_id) ? ogs_strdup(vsmf_service_set_id->valuestring) : NULL, vsmf_binding ? vsmf_bindingVariable : 0, - ismf_id ? ogs_strdup(ismf_id->valuestring) : NULL, - ismf_set_id ? ogs_strdup(ismf_set_id->valuestring) : NULL, - ismf_service_set_id ? ogs_strdup(ismf_service_set_id->valuestring) : NULL, + ismf_id && !cJSON_IsNull(ismf_id) ? ogs_strdup(ismf_id->valuestring) : NULL, + ismf_set_id && !cJSON_IsNull(ismf_set_id) ? ogs_strdup(ismf_set_id->valuestring) : NULL, + ismf_service_set_id && !cJSON_IsNull(ismf_service_set_id) ? ogs_strdup(ismf_service_set_id->valuestring) : NULL, ismf_binding ? ismf_bindingVariable : 0, - ns_instance ? ogs_strdup(ns_instance->valuestring) : NULL, - smf_service_instance_id ? ogs_strdup(smf_service_instance_id->valuestring) : NULL, + ns_instance && !cJSON_IsNull(ns_instance) ? ogs_strdup(ns_instance->valuestring) : NULL, + smf_service_instance_id && !cJSON_IsNull(smf_service_instance_id) ? ogs_strdup(smf_service_instance_id->valuestring) : NULL, ma_pdu_session ? true : false, ma_pdu_session ? ma_pdu_session->valueint : 0, cn_assisted_ran_para ? cn_assisted_ran_para_local_nonprim : NULL @@ -576,6 +640,21 @@ OpenAPI_pdu_session_context_t *OpenAPI_pdu_session_context_parseFromJSON(cJSON * return pdu_session_context_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (allocated_ebi_listList) { + OpenAPI_list_for_each(allocated_ebi_listList, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(allocated_ebi_listList); + allocated_ebi_listList = NULL; + } + if (cn_assisted_ran_para_local_nonprim) { + OpenAPI_cn_assisted_ran_para_free(cn_assisted_ran_para_local_nonprim); + cn_assisted_ran_para_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_create_data.c b/lib/sbi/openapi/model/pdu_session_create_data.c index 2f1ea3431..81b9cc91d 100644 --- a/lib/sbi/openapi/model/pdu_session_create_data.c +++ b/lib/sbi/openapi/model/pdu_session_create_data.c @@ -19,7 +19,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_create( OpenAPI_plmn_id_nid_t *serving_network, OpenAPI_request_type_e request_type, OpenAPI_list_t *eps_bearer_id, - char pgw_s8c_fteid, + char *pgw_s8c_fteid, char *vsmf_pdu_session_uri, char *ismf_pdu_session_uri, OpenAPI_tunnel_info_t *vcn_tunnel_info, @@ -164,67 +164,199 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_create( void OpenAPI_pdu_session_create_data_free(OpenAPI_pdu_session_create_data_t *pdu_session_create_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_create_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(pdu_session_create_data->supi); - ogs_free(pdu_session_create_data->pei); - ogs_free(pdu_session_create_data->dnn); - ogs_free(pdu_session_create_data->selected_dnn); - OpenAPI_snssai_free(pdu_session_create_data->s_nssai); - ogs_free(pdu_session_create_data->vsmf_id); - ogs_free(pdu_session_create_data->ismf_id); - OpenAPI_plmn_id_nid_free(pdu_session_create_data->serving_network); - OpenAPI_list_for_each(pdu_session_create_data->eps_bearer_id, node) { - ogs_free(node->data); + if (pdu_session_create_data->supi) { + ogs_free(pdu_session_create_data->supi); + pdu_session_create_data->supi = NULL; } - OpenAPI_list_free(pdu_session_create_data->eps_bearer_id); - ogs_free(pdu_session_create_data->vsmf_pdu_session_uri); - ogs_free(pdu_session_create_data->ismf_pdu_session_uri); - OpenAPI_tunnel_info_free(pdu_session_create_data->vcn_tunnel_info); - OpenAPI_tunnel_info_free(pdu_session_create_data->icn_tunnel_info); - OpenAPI_tunnel_info_free(pdu_session_create_data->n9_forwarding_tunnel_info); - OpenAPI_tunnel_info_free(pdu_session_create_data->additional_cn_tunnel_info); - OpenAPI_user_location_free(pdu_session_create_data->ue_location); - ogs_free(pdu_session_create_data->ue_time_zone); - OpenAPI_user_location_free(pdu_session_create_data->add_ue_location); - ogs_free(pdu_session_create_data->gpsi); - OpenAPI_ref_to_binary_data_free(pdu_session_create_data->n1_sm_info_from_ue); - OpenAPI_ref_to_binary_data_free(pdu_session_create_data->unknown_n1_sm_info); - ogs_free(pdu_session_create_data->supported_features); - ogs_free(pdu_session_create_data->h_pcf_id); - ogs_free(pdu_session_create_data->pcf_id); - ogs_free(pdu_session_create_data->pcf_group_id); - ogs_free(pdu_session_create_data->pcf_set_id); - ogs_free(pdu_session_create_data->udm_group_id); - ogs_free(pdu_session_create_data->routing_indicator); - ogs_free(pdu_session_create_data->v_smf_service_instance_id); - ogs_free(pdu_session_create_data->i_smf_service_instance_id); - ogs_free(pdu_session_create_data->recovery_time); - OpenAPI_roaming_charging_profile_free(pdu_session_create_data->roaming_charging_profile); - ogs_free(pdu_session_create_data->charging_id); - ogs_free(pdu_session_create_data->eps_bearer_ctx_status); - ogs_free(pdu_session_create_data->amf_nf_id); - OpenAPI_guami_free(pdu_session_create_data->guami); - OpenAPI_list_for_each(pdu_session_create_data->dnai_list, node) { - ogs_free(node->data); + if (pdu_session_create_data->pei) { + ogs_free(pdu_session_create_data->pei); + pdu_session_create_data->pei = NULL; } - OpenAPI_list_free(pdu_session_create_data->dnai_list); - OpenAPI_list_for_each(pdu_session_create_data->secondary_rat_usage_info, node) { - OpenAPI_secondary_rat_usage_info_free(node->data); + if (pdu_session_create_data->dnn) { + ogs_free(pdu_session_create_data->dnn); + pdu_session_create_data->dnn = NULL; + } + if (pdu_session_create_data->selected_dnn) { + ogs_free(pdu_session_create_data->selected_dnn); + pdu_session_create_data->selected_dnn = NULL; + } + if (pdu_session_create_data->s_nssai) { + OpenAPI_snssai_free(pdu_session_create_data->s_nssai); + pdu_session_create_data->s_nssai = NULL; + } + if (pdu_session_create_data->vsmf_id) { + ogs_free(pdu_session_create_data->vsmf_id); + pdu_session_create_data->vsmf_id = NULL; + } + if (pdu_session_create_data->ismf_id) { + ogs_free(pdu_session_create_data->ismf_id); + pdu_session_create_data->ismf_id = NULL; + } + if (pdu_session_create_data->serving_network) { + OpenAPI_plmn_id_nid_free(pdu_session_create_data->serving_network); + pdu_session_create_data->serving_network = NULL; + } + if (pdu_session_create_data->eps_bearer_id) { + OpenAPI_list_for_each(pdu_session_create_data->eps_bearer_id, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_session_create_data->eps_bearer_id); + pdu_session_create_data->eps_bearer_id = NULL; + } + if (pdu_session_create_data->pgw_s8c_fteid) { + ogs_free(pdu_session_create_data->pgw_s8c_fteid); + pdu_session_create_data->pgw_s8c_fteid = NULL; + } + if (pdu_session_create_data->vsmf_pdu_session_uri) { + ogs_free(pdu_session_create_data->vsmf_pdu_session_uri); + pdu_session_create_data->vsmf_pdu_session_uri = NULL; + } + if (pdu_session_create_data->ismf_pdu_session_uri) { + ogs_free(pdu_session_create_data->ismf_pdu_session_uri); + pdu_session_create_data->ismf_pdu_session_uri = NULL; + } + if (pdu_session_create_data->vcn_tunnel_info) { + OpenAPI_tunnel_info_free(pdu_session_create_data->vcn_tunnel_info); + pdu_session_create_data->vcn_tunnel_info = NULL; + } + if (pdu_session_create_data->icn_tunnel_info) { + OpenAPI_tunnel_info_free(pdu_session_create_data->icn_tunnel_info); + pdu_session_create_data->icn_tunnel_info = NULL; + } + if (pdu_session_create_data->n9_forwarding_tunnel_info) { + OpenAPI_tunnel_info_free(pdu_session_create_data->n9_forwarding_tunnel_info); + pdu_session_create_data->n9_forwarding_tunnel_info = NULL; + } + if (pdu_session_create_data->additional_cn_tunnel_info) { + OpenAPI_tunnel_info_free(pdu_session_create_data->additional_cn_tunnel_info); + pdu_session_create_data->additional_cn_tunnel_info = NULL; + } + if (pdu_session_create_data->ue_location) { + OpenAPI_user_location_free(pdu_session_create_data->ue_location); + pdu_session_create_data->ue_location = NULL; + } + if (pdu_session_create_data->ue_time_zone) { + ogs_free(pdu_session_create_data->ue_time_zone); + pdu_session_create_data->ue_time_zone = NULL; + } + if (pdu_session_create_data->add_ue_location) { + OpenAPI_user_location_free(pdu_session_create_data->add_ue_location); + pdu_session_create_data->add_ue_location = NULL; + } + if (pdu_session_create_data->gpsi) { + ogs_free(pdu_session_create_data->gpsi); + pdu_session_create_data->gpsi = NULL; + } + if (pdu_session_create_data->n1_sm_info_from_ue) { + OpenAPI_ref_to_binary_data_free(pdu_session_create_data->n1_sm_info_from_ue); + pdu_session_create_data->n1_sm_info_from_ue = NULL; + } + if (pdu_session_create_data->unknown_n1_sm_info) { + OpenAPI_ref_to_binary_data_free(pdu_session_create_data->unknown_n1_sm_info); + pdu_session_create_data->unknown_n1_sm_info = NULL; + } + if (pdu_session_create_data->supported_features) { + ogs_free(pdu_session_create_data->supported_features); + pdu_session_create_data->supported_features = NULL; + } + if (pdu_session_create_data->h_pcf_id) { + ogs_free(pdu_session_create_data->h_pcf_id); + pdu_session_create_data->h_pcf_id = NULL; + } + if (pdu_session_create_data->pcf_id) { + ogs_free(pdu_session_create_data->pcf_id); + pdu_session_create_data->pcf_id = NULL; + } + if (pdu_session_create_data->pcf_group_id) { + ogs_free(pdu_session_create_data->pcf_group_id); + pdu_session_create_data->pcf_group_id = NULL; + } + if (pdu_session_create_data->pcf_set_id) { + ogs_free(pdu_session_create_data->pcf_set_id); + pdu_session_create_data->pcf_set_id = NULL; + } + if (pdu_session_create_data->udm_group_id) { + ogs_free(pdu_session_create_data->udm_group_id); + pdu_session_create_data->udm_group_id = NULL; + } + if (pdu_session_create_data->routing_indicator) { + ogs_free(pdu_session_create_data->routing_indicator); + pdu_session_create_data->routing_indicator = NULL; + } + if (pdu_session_create_data->v_smf_service_instance_id) { + ogs_free(pdu_session_create_data->v_smf_service_instance_id); + pdu_session_create_data->v_smf_service_instance_id = NULL; + } + if (pdu_session_create_data->i_smf_service_instance_id) { + ogs_free(pdu_session_create_data->i_smf_service_instance_id); + pdu_session_create_data->i_smf_service_instance_id = NULL; + } + if (pdu_session_create_data->recovery_time) { + ogs_free(pdu_session_create_data->recovery_time); + pdu_session_create_data->recovery_time = NULL; + } + if (pdu_session_create_data->roaming_charging_profile) { + OpenAPI_roaming_charging_profile_free(pdu_session_create_data->roaming_charging_profile); + pdu_session_create_data->roaming_charging_profile = NULL; + } + if (pdu_session_create_data->charging_id) { + ogs_free(pdu_session_create_data->charging_id); + pdu_session_create_data->charging_id = NULL; + } + if (pdu_session_create_data->eps_bearer_ctx_status) { + ogs_free(pdu_session_create_data->eps_bearer_ctx_status); + pdu_session_create_data->eps_bearer_ctx_status = NULL; + } + if (pdu_session_create_data->amf_nf_id) { + ogs_free(pdu_session_create_data->amf_nf_id); + pdu_session_create_data->amf_nf_id = NULL; + } + if (pdu_session_create_data->guami) { + OpenAPI_guami_free(pdu_session_create_data->guami); + pdu_session_create_data->guami = NULL; + } + if (pdu_session_create_data->dnai_list) { + OpenAPI_list_for_each(pdu_session_create_data->dnai_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_session_create_data->dnai_list); + pdu_session_create_data->dnai_list = NULL; + } + if (pdu_session_create_data->secondary_rat_usage_info) { + OpenAPI_list_for_each(pdu_session_create_data->secondary_rat_usage_info, node) { + OpenAPI_secondary_rat_usage_info_free(node->data); + } + OpenAPI_list_free(pdu_session_create_data->secondary_rat_usage_info); + pdu_session_create_data->secondary_rat_usage_info = NULL; + } + if (pdu_session_create_data->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(pdu_session_create_data->small_data_rate_status); + pdu_session_create_data->small_data_rate_status = NULL; + } + if (pdu_session_create_data->apn_rate_status) { + OpenAPI_apn_rate_status_free(pdu_session_create_data->apn_rate_status); + pdu_session_create_data->apn_rate_status = NULL; + } + if (pdu_session_create_data->up_security_info) { + OpenAPI_up_security_info_free(pdu_session_create_data->up_security_info); + pdu_session_create_data->up_security_info = NULL; + } + if (pdu_session_create_data->vplmn_qos) { + OpenAPI_vplmn_qos_free(pdu_session_create_data->vplmn_qos); + pdu_session_create_data->vplmn_qos = NULL; } - OpenAPI_list_free(pdu_session_create_data->secondary_rat_usage_info); - OpenAPI_small_data_rate_status_free(pdu_session_create_data->small_data_rate_status); - OpenAPI_apn_rate_status_free(pdu_session_create_data->apn_rate_status); - OpenAPI_up_security_info_free(pdu_session_create_data->up_security_info); - OpenAPI_vplmn_qos_free(pdu_session_create_data->vplmn_qos); ogs_free(pdu_session_create_data); } cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_data_t *pdu_session_create_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_create_data == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [PduSessionCreateData]"); @@ -260,6 +392,10 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ } } + if (!pdu_session_create_data->dnn) { + ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", pdu_session_create_data->dnn) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [dnn]"); goto end; @@ -299,6 +435,10 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ } } + if (!pdu_session_create_data->serving_network) { + ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [serving_network]"); + return NULL; + } cJSON *serving_network_local_JSON = OpenAPI_plmn_id_nid_convertToJSON(pdu_session_create_data->serving_network); if (serving_network_local_JSON == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [serving_network]"); @@ -310,7 +450,7 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ goto end; } - if (pdu_session_create_data->request_type) { + if (pdu_session_create_data->request_type != OpenAPI_request_type_NULL) { if (cJSON_AddStringToObject(item, "requestType", OpenAPI_request_type_ToString(pdu_session_create_data->request_type)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [request_type]"); goto end; @@ -318,23 +458,21 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ } if (pdu_session_create_data->eps_bearer_id) { - cJSON *eps_bearer_id = cJSON_AddArrayToObject(item, "epsBearerId"); - if (eps_bearer_id == NULL) { + cJSON *eps_bearer_idList = cJSON_AddArrayToObject(item, "epsBearerId"); + if (eps_bearer_idList == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [eps_bearer_id]"); goto end; } - - OpenAPI_lnode_t *eps_bearer_id_node; - OpenAPI_list_for_each(pdu_session_create_data->eps_bearer_id, eps_bearer_id_node) { - if (cJSON_AddNumberToObject(eps_bearer_id, "", *(double *)eps_bearer_id_node->data) == NULL) { - ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [eps_bearer_id]"); - goto end; + OpenAPI_list_for_each(pdu_session_create_data->eps_bearer_id, node) { + if (cJSON_AddNumberToObject(eps_bearer_idList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [eps_bearer_id]"); + goto end; + } } - } } if (pdu_session_create_data->pgw_s8c_fteid) { - if (cJSON_AddNumberToObject(item, "pgwS8cFteid", pdu_session_create_data->pgw_s8c_fteid) == NULL) { + if (cJSON_AddStringToObject(item, "pgwS8cFteid", pdu_session_create_data->pgw_s8c_fteid) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [pgw_s8c_fteid]"); goto end; } @@ -406,19 +544,23 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ } } + if (pdu_session_create_data->an_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [an_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "anType", OpenAPI_access_type_ToString(pdu_session_create_data->an_type)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [an_type]"); goto end; } - if (pdu_session_create_data->additional_an_type) { + if (pdu_session_create_data->additional_an_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "additionalAnType", OpenAPI_access_type_ToString(pdu_session_create_data->additional_an_type)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [additional_an_type]"); goto end; } } - if (pdu_session_create_data->rat_type) { + if (pdu_session_create_data->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(pdu_session_create_data->rat_type)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [rat_type]"); goto end; @@ -533,7 +675,7 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ } } - if (pdu_session_create_data->sel_mode) { + if (pdu_session_create_data->sel_mode != OpenAPI_dnn_selection_mode_NULL) { if (cJSON_AddStringToObject(item, "selMode", OpenAPI_dnn_selection_mode_ToString(pdu_session_create_data->sel_mode)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [sel_mode]"); goto end; @@ -561,7 +703,7 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ } } - if (pdu_session_create_data->eps_interworking_ind) { + if (pdu_session_create_data->eps_interworking_ind != OpenAPI_eps_interworking_indication_NULL) { if (cJSON_AddStringToObject(item, "epsInterworkingInd", OpenAPI_eps_interworking_indication_ToString(pdu_session_create_data->eps_interworking_ind)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [eps_interworking_ind]"); goto end; @@ -643,14 +785,14 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ } } - if (pdu_session_create_data->max_integrity_protected_data_rate_ul) { + if (pdu_session_create_data->max_integrity_protected_data_rate_ul != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateUl", OpenAPI_max_integrity_protected_data_rate_ToString(pdu_session_create_data->max_integrity_protected_data_rate_ul)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [max_integrity_protected_data_rate_ul]"); goto end; } } - if (pdu_session_create_data->max_integrity_protected_data_rate_dl) { + if (pdu_session_create_data->max_integrity_protected_data_rate_dl != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateDl", OpenAPI_max_integrity_protected_data_rate_ToString(pdu_session_create_data->max_integrity_protected_data_rate_dl)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [max_integrity_protected_data_rate_dl]"); goto end; @@ -693,22 +835,20 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ } if (pdu_session_create_data->dnai_list) { - cJSON *dnai_list = cJSON_AddArrayToObject(item, "dnaiList"); - if (dnai_list == NULL) { + cJSON *dnai_listList = cJSON_AddArrayToObject(item, "dnaiList"); + if (dnai_listList == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [dnai_list]"); goto end; } - - OpenAPI_lnode_t *dnai_list_node; - OpenAPI_list_for_each(pdu_session_create_data->dnai_list, dnai_list_node) { - if (cJSON_AddStringToObject(dnai_list, "", (char*)dnai_list_node->data) == NULL) { - ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [dnai_list]"); - goto end; + OpenAPI_list_for_each(pdu_session_create_data->dnai_list, node) { + if (cJSON_AddStringToObject(dnai_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [dnai_list]"); + goto end; + } } - } } - if (pdu_session_create_data->presence_in_ladn) { + if (pdu_session_create_data->presence_in_ladn != OpenAPI_presence_state_NULL) { if (cJSON_AddStringToObject(item, "presenceInLadn", OpenAPI_presence_state_ToString(pdu_session_create_data->presence_in_ladn)) == NULL) { ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [presence_in_ladn]"); goto end; @@ -721,17 +861,13 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_ ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [secondary_rat_usage_info]"); goto end; } - - OpenAPI_lnode_t *secondary_rat_usage_info_node; - if (pdu_session_create_data->secondary_rat_usage_info) { - OpenAPI_list_for_each(pdu_session_create_data->secondary_rat_usage_info, secondary_rat_usage_info_node) { - cJSON *itemLocal = OpenAPI_secondary_rat_usage_info_convertToJSON(secondary_rat_usage_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [secondary_rat_usage_info]"); - goto end; - } - cJSON_AddItemToArray(secondary_rat_usage_infoList, itemLocal); + OpenAPI_list_for_each(pdu_session_create_data->secondary_rat_usage_info, node) { + cJSON *itemLocal = OpenAPI_secondary_rat_usage_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [secondary_rat_usage_info]"); + goto end; } + cJSON_AddItemToArray(secondary_rat_usage_infoList, itemLocal); } } @@ -801,17 +937,107 @@ end: OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON(cJSON *pdu_session_create_dataJSON) { OpenAPI_pdu_session_create_data_t *pdu_session_create_data_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *unauthenticated_supi = NULL; + cJSON *pei = NULL; + cJSON *pdu_session_id = NULL; + cJSON *dnn = NULL; + cJSON *selected_dnn = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *vsmf_id = NULL; + cJSON *ismf_id = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + cJSON *request_type = NULL; + OpenAPI_request_type_e request_typeVariable = 0; + cJSON *eps_bearer_id = NULL; + OpenAPI_list_t *eps_bearer_idList = NULL; + cJSON *pgw_s8c_fteid = NULL; + cJSON *vsmf_pdu_session_uri = NULL; + cJSON *ismf_pdu_session_uri = NULL; + cJSON *vcn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *vcn_tunnel_info_local_nonprim = NULL; + cJSON *icn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *icn_tunnel_info_local_nonprim = NULL; + cJSON *n9_forwarding_tunnel_info = NULL; + OpenAPI_tunnel_info_t *n9_forwarding_tunnel_info_local_nonprim = NULL; + cJSON *additional_cn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *additional_cn_tunnel_info_local_nonprim = NULL; + cJSON *an_type = NULL; + OpenAPI_access_type_e an_typeVariable = 0; + cJSON *additional_an_type = NULL; + OpenAPI_access_type_e additional_an_typeVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *add_ue_location = NULL; + OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + cJSON *gpsi = NULL; + cJSON *n1_sm_info_from_ue = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_info_from_ue_local_nonprim = NULL; + cJSON *unknown_n1_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *unknown_n1_sm_info_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *h_pcf_id = NULL; + cJSON *pcf_id = NULL; + cJSON *pcf_group_id = NULL; + cJSON *pcf_set_id = NULL; + cJSON *ho_preparation_indication = NULL; + cJSON *sel_mode = NULL; + OpenAPI_dnn_selection_mode_e sel_modeVariable = 0; + cJSON *always_on_requested = NULL; + cJSON *udm_group_id = NULL; + cJSON *routing_indicator = NULL; + cJSON *eps_interworking_ind = NULL; + OpenAPI_eps_interworking_indication_e eps_interworking_indVariable = 0; + cJSON *v_smf_service_instance_id = NULL; + cJSON *i_smf_service_instance_id = NULL; + cJSON *recovery_time = NULL; + cJSON *roaming_charging_profile = NULL; + OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + cJSON *charging_id = NULL; + cJSON *old_pdu_session_id = NULL; + cJSON *eps_bearer_ctx_status = NULL; + cJSON *amf_nf_id = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *max_integrity_protected_data_rate_ul = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_ulVariable = 0; + cJSON *max_integrity_protected_data_rate_dl = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable = 0; + cJSON *cp_ciot_enabled = NULL; + cJSON *cp_only_ind = NULL; + cJSON *invoke_nef = NULL; + cJSON *ma_request_ind = NULL; + cJSON *ma_nw_upgrade_ind = NULL; + cJSON *dnai_list = NULL; + OpenAPI_list_t *dnai_listList = NULL; + cJSON *presence_in_ladn = NULL; + OpenAPI_presence_state_e presence_in_ladnVariable = 0; + cJSON *secondary_rat_usage_info = NULL; + OpenAPI_list_t *secondary_rat_usage_infoList = NULL; + cJSON *small_data_rate_status = NULL; + OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + cJSON *apn_rate_status = NULL; + OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + cJSON *dl_serving_plmn_rate_ctl = NULL; + cJSON *up_security_info = NULL; + OpenAPI_up_security_info_t *up_security_info_local_nonprim = NULL; + cJSON *vplmn_qos = NULL; + OpenAPI_vplmn_qos_t *vplmn_qos_local_nonprim = NULL; + supi = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *unauthenticated_supi = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "unauthenticatedSupi"); - + unauthenticated_supi = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "unauthenticatedSupi"); if (unauthenticated_supi) { if (!cJSON_IsBool(unauthenticated_supi)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [unauthenticated_supi]"); @@ -819,17 +1045,15 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [pei]"); goto end; } } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pduSessionId"); - + pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pduSessionId"); if (pdu_session_id) { if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [pdu_session_id]"); @@ -837,63 +1061,53 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "dnn"); + dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [dnn]"); goto end; } - cJSON *selected_dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "selectedDnn"); - + selected_dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "selectedDnn"); if (selected_dnn) { - if (!cJSON_IsString(selected_dnn)) { + if (!cJSON_IsString(selected_dnn) && !cJSON_IsNull(selected_dnn)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [selected_dnn]"); goto end; } } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "sNssai"); - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "sNssai"); if (s_nssai) { s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); } - cJSON *vsmf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vsmfId"); - + vsmf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vsmfId"); if (vsmf_id) { - if (!cJSON_IsString(vsmf_id)) { + if (!cJSON_IsString(vsmf_id) && !cJSON_IsNull(vsmf_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [vsmf_id]"); goto end; } } - cJSON *ismf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ismfId"); - + ismf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ismfId"); if (ismf_id) { - if (!cJSON_IsString(ismf_id)) { + if (!cJSON_IsString(ismf_id) && !cJSON_IsNull(ismf_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [ismf_id]"); goto end; } } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "servingNetwork"); + serving_network = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "servingNetwork"); if (!serving_network) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [serving_network]"); goto end; } - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); - cJSON *request_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "requestType"); - - OpenAPI_request_type_e request_typeVariable; + request_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "requestType"); if (request_type) { if (!cJSON_IsString(request_type)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [request_type]"); @@ -902,97 +1116,89 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON request_typeVariable = OpenAPI_request_type_FromString(request_type->valuestring); } - cJSON *eps_bearer_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "epsBearerId"); - - OpenAPI_list_t *eps_bearer_idList; + eps_bearer_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "epsBearerId"); if (eps_bearer_id) { - cJSON *eps_bearer_id_local; - if (!cJSON_IsArray(eps_bearer_id)) { - ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [eps_bearer_id]"); - goto end; - } - eps_bearer_idList = OpenAPI_list_create(); + cJSON *eps_bearer_id_local = NULL; + if (!cJSON_IsArray(eps_bearer_id)) { + ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [eps_bearer_id]"); + goto end; + } - cJSON_ArrayForEach(eps_bearer_id_local, eps_bearer_id) { - if (!cJSON_IsNumber(eps_bearer_id_local)) { - ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [eps_bearer_id]"); - goto end; - } - OpenAPI_list_add(eps_bearer_idList, &eps_bearer_id_local->valuedouble); - } + eps_bearer_idList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eps_bearer_id_local, eps_bearer_id) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(eps_bearer_id_local)) { + ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [eps_bearer_id]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [eps_bearer_id]"); + goto end; + } + *localDouble = eps_bearer_id_local->valuedouble; + OpenAPI_list_add(eps_bearer_idList, localDouble); + } } - cJSON *pgw_s8c_fteid = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pgwS8cFteid"); - + pgw_s8c_fteid = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pgwS8cFteid"); if (pgw_s8c_fteid) { - if (!cJSON_IsNumber(pgw_s8c_fteid)) { + if (!cJSON_IsString(pgw_s8c_fteid) && !cJSON_IsNull(pgw_s8c_fteid)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [pgw_s8c_fteid]"); goto end; } } - cJSON *vsmf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vsmfPduSessionUri"); - + vsmf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vsmfPduSessionUri"); if (vsmf_pdu_session_uri) { - if (!cJSON_IsString(vsmf_pdu_session_uri)) { + if (!cJSON_IsString(vsmf_pdu_session_uri) && !cJSON_IsNull(vsmf_pdu_session_uri)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [vsmf_pdu_session_uri]"); goto end; } } - cJSON *ismf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ismfPduSessionUri"); - + ismf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ismfPduSessionUri"); if (ismf_pdu_session_uri) { - if (!cJSON_IsString(ismf_pdu_session_uri)) { + if (!cJSON_IsString(ismf_pdu_session_uri) && !cJSON_IsNull(ismf_pdu_session_uri)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [ismf_pdu_session_uri]"); goto end; } } - cJSON *vcn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vcnTunnelInfo"); - - OpenAPI_tunnel_info_t *vcn_tunnel_info_local_nonprim = NULL; + vcn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vcnTunnelInfo"); if (vcn_tunnel_info) { vcn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(vcn_tunnel_info); } - cJSON *icn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "icnTunnelInfo"); - - OpenAPI_tunnel_info_t *icn_tunnel_info_local_nonprim = NULL; + icn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "icnTunnelInfo"); if (icn_tunnel_info) { icn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(icn_tunnel_info); } - cJSON *n9_forwarding_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "n9ForwardingTunnelInfo"); - - OpenAPI_tunnel_info_t *n9_forwarding_tunnel_info_local_nonprim = NULL; + n9_forwarding_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "n9ForwardingTunnelInfo"); if (n9_forwarding_tunnel_info) { n9_forwarding_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(n9_forwarding_tunnel_info); } - cJSON *additional_cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "additionalCnTunnelInfo"); - - OpenAPI_tunnel_info_t *additional_cn_tunnel_info_local_nonprim = NULL; + additional_cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "additionalCnTunnelInfo"); if (additional_cn_tunnel_info) { additional_cn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(additional_cn_tunnel_info); } - cJSON *an_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "anType"); + an_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "anType"); if (!an_type) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [an_type]"); goto end; } - - OpenAPI_access_type_e an_typeVariable; if (!cJSON_IsString(an_type)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [an_type]"); goto end; } an_typeVariable = OpenAPI_access_type_FromString(an_type->valuestring); - cJSON *additional_an_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "additionalAnType"); - - OpenAPI_access_type_e additional_an_typeVariable; + additional_an_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "additionalAnType"); if (additional_an_type) { if (!cJSON_IsString(additional_an_type)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [additional_an_type]"); @@ -1001,9 +1207,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON additional_an_typeVariable = OpenAPI_access_type_FromString(additional_an_type->valuestring); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [rat_type]"); @@ -1012,99 +1216,83 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *add_ue_location = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "addUeLocation"); - - OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + add_ue_location = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "addUeLocation"); if (add_ue_location) { add_ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(add_ue_location); } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "n1SmInfoFromUe"); - - OpenAPI_ref_to_binary_data_t *n1_sm_info_from_ue_local_nonprim = NULL; + n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "n1SmInfoFromUe"); if (n1_sm_info_from_ue) { n1_sm_info_from_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_from_ue); } - cJSON *unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "unknownN1SmInfo"); - - OpenAPI_ref_to_binary_data_t *unknown_n1_sm_info_local_nonprim = NULL; + unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "unknownN1SmInfo"); if (unknown_n1_sm_info) { unknown_n1_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(unknown_n1_sm_info); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *h_pcf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "hPcfId"); - + h_pcf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "hPcfId"); if (h_pcf_id) { - if (!cJSON_IsString(h_pcf_id)) { + if (!cJSON_IsString(h_pcf_id) && !cJSON_IsNull(h_pcf_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [h_pcf_id]"); goto end; } } - cJSON *pcf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pcfId"); - + pcf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pcfId"); if (pcf_id) { - if (!cJSON_IsString(pcf_id)) { + if (!cJSON_IsString(pcf_id) && !cJSON_IsNull(pcf_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [pcf_id]"); goto end; } } - cJSON *pcf_group_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pcfGroupId"); - + pcf_group_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pcfGroupId"); if (pcf_group_id) { - if (!cJSON_IsString(pcf_group_id)) { + if (!cJSON_IsString(pcf_group_id) && !cJSON_IsNull(pcf_group_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [pcf_group_id]"); goto end; } } - cJSON *pcf_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pcfSetId"); - + pcf_set_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "pcfSetId"); if (pcf_set_id) { - if (!cJSON_IsString(pcf_set_id)) { + if (!cJSON_IsString(pcf_set_id) && !cJSON_IsNull(pcf_set_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [pcf_set_id]"); goto end; } } - cJSON *ho_preparation_indication = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "hoPreparationIndication"); - + ho_preparation_indication = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "hoPreparationIndication"); if (ho_preparation_indication) { if (!cJSON_IsBool(ho_preparation_indication)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [ho_preparation_indication]"); @@ -1112,9 +1300,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *sel_mode = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "selMode"); - - OpenAPI_dnn_selection_mode_e sel_modeVariable; + sel_mode = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "selMode"); if (sel_mode) { if (!cJSON_IsString(sel_mode)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [sel_mode]"); @@ -1123,8 +1309,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON sel_modeVariable = OpenAPI_dnn_selection_mode_FromString(sel_mode->valuestring); } - cJSON *always_on_requested = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "alwaysOnRequested"); - + always_on_requested = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "alwaysOnRequested"); if (always_on_requested) { if (!cJSON_IsBool(always_on_requested)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [always_on_requested]"); @@ -1132,27 +1317,23 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *udm_group_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "udmGroupId"); - + udm_group_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "udmGroupId"); if (udm_group_id) { - if (!cJSON_IsString(udm_group_id)) { + if (!cJSON_IsString(udm_group_id) && !cJSON_IsNull(udm_group_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [udm_group_id]"); goto end; } } - cJSON *routing_indicator = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "routingIndicator"); - + routing_indicator = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "routingIndicator"); if (routing_indicator) { - if (!cJSON_IsString(routing_indicator)) { + if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [routing_indicator]"); goto end; } } - cJSON *eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "epsInterworkingInd"); - - OpenAPI_eps_interworking_indication_e eps_interworking_indVariable; + eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "epsInterworkingInd"); if (eps_interworking_ind) { if (!cJSON_IsString(eps_interworking_ind)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [eps_interworking_ind]"); @@ -1161,51 +1342,44 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON eps_interworking_indVariable = OpenAPI_eps_interworking_indication_FromString(eps_interworking_ind->valuestring); } - cJSON *v_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vSmfServiceInstanceId"); - + v_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vSmfServiceInstanceId"); if (v_smf_service_instance_id) { - if (!cJSON_IsString(v_smf_service_instance_id)) { + if (!cJSON_IsString(v_smf_service_instance_id) && !cJSON_IsNull(v_smf_service_instance_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [v_smf_service_instance_id]"); goto end; } } - cJSON *i_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "iSmfServiceInstanceId"); - + i_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "iSmfServiceInstanceId"); if (i_smf_service_instance_id) { - if (!cJSON_IsString(i_smf_service_instance_id)) { + if (!cJSON_IsString(i_smf_service_instance_id) && !cJSON_IsNull(i_smf_service_instance_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [i_smf_service_instance_id]"); goto end; } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "roamingChargingProfile"); - - OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "roamingChargingProfile"); if (roaming_charging_profile) { roaming_charging_profile_local_nonprim = OpenAPI_roaming_charging_profile_parseFromJSON(roaming_charging_profile); } - cJSON *charging_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "chargingId"); - + charging_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "chargingId"); if (charging_id) { - if (!cJSON_IsString(charging_id)) { + if (!cJSON_IsString(charging_id) && !cJSON_IsNull(charging_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [charging_id]"); goto end; } } - cJSON *old_pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "oldPduSessionId"); - + old_pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "oldPduSessionId"); if (old_pdu_session_id) { if (!cJSON_IsNumber(old_pdu_session_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [old_pdu_session_id]"); @@ -1213,34 +1387,28 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *eps_bearer_ctx_status = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "epsBearerCtxStatus"); - + eps_bearer_ctx_status = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "epsBearerCtxStatus"); if (eps_bearer_ctx_status) { - if (!cJSON_IsString(eps_bearer_ctx_status)) { + if (!cJSON_IsString(eps_bearer_ctx_status) && !cJSON_IsNull(eps_bearer_ctx_status)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [eps_bearer_ctx_status]"); goto end; } } - cJSON *amf_nf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "amfNfId"); - + amf_nf_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "amfNfId"); if (amf_nf_id) { - if (!cJSON_IsString(amf_nf_id)) { + if (!cJSON_IsString(amf_nf_id) && !cJSON_IsNull(amf_nf_id)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [amf_nf_id]"); goto end; } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } - cJSON *max_integrity_protected_data_rate_ul = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "maxIntegrityProtectedDataRateUl"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_ulVariable; + max_integrity_protected_data_rate_ul = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "maxIntegrityProtectedDataRateUl"); if (max_integrity_protected_data_rate_ul) { if (!cJSON_IsString(max_integrity_protected_data_rate_ul)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [max_integrity_protected_data_rate_ul]"); @@ -1249,9 +1417,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON max_integrity_protected_data_rate_ulVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_ul->valuestring); } - cJSON *max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "maxIntegrityProtectedDataRateDl"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable; + max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "maxIntegrityProtectedDataRateDl"); if (max_integrity_protected_data_rate_dl) { if (!cJSON_IsString(max_integrity_protected_data_rate_dl)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [max_integrity_protected_data_rate_dl]"); @@ -1260,8 +1426,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON max_integrity_protected_data_rate_dlVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_dl->valuestring); } - cJSON *cp_ciot_enabled = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "cpCiotEnabled"); - + cp_ciot_enabled = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "cpCiotEnabled"); if (cp_ciot_enabled) { if (!cJSON_IsBool(cp_ciot_enabled)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [cp_ciot_enabled]"); @@ -1269,8 +1434,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *cp_only_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "cpOnlyInd"); - + cp_only_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "cpOnlyInd"); if (cp_only_ind) { if (!cJSON_IsBool(cp_only_ind)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [cp_only_ind]"); @@ -1278,8 +1442,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *invoke_nef = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "invokeNef"); - + invoke_nef = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "invokeNef"); if (invoke_nef) { if (!cJSON_IsBool(invoke_nef)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [invoke_nef]"); @@ -1287,8 +1450,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *ma_request_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "maRequestInd"); - + ma_request_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "maRequestInd"); if (ma_request_ind) { if (!cJSON_IsBool(ma_request_ind)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [ma_request_ind]"); @@ -1296,8 +1458,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "maNwUpgradeInd"); - + ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "maNwUpgradeInd"); if (ma_nw_upgrade_ind) { if (!cJSON_IsBool(ma_nw_upgrade_ind)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [ma_nw_upgrade_ind]"); @@ -1305,29 +1466,28 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "dnaiList"); - - OpenAPI_list_t *dnai_listList; + dnai_list = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "dnaiList"); if (dnai_list) { - cJSON *dnai_list_local; - if (!cJSON_IsArray(dnai_list)) { - ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - dnai_listList = OpenAPI_list_create(); + cJSON *dnai_list_local = NULL; + if (!cJSON_IsArray(dnai_list)) { + ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [dnai_list]"); + goto end; + } - cJSON_ArrayForEach(dnai_list_local, dnai_list) { - if (!cJSON_IsString(dnai_list_local)) { - ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); - } + dnai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnai_list_local, dnai_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnai_list_local)) { + ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [dnai_list]"); + goto end; + } + OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); + } } - cJSON *presence_in_ladn = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "presenceInLadn"); - - OpenAPI_presence_state_e presence_in_ladnVariable; + presence_in_ladn = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "presenceInLadn"); if (presence_in_ladn) { if (!cJSON_IsString(presence_in_ladn)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [presence_in_ladn]"); @@ -1336,51 +1496,42 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON presence_in_ladnVariable = OpenAPI_presence_state_FromString(presence_in_ladn->valuestring); } - cJSON *secondary_rat_usage_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "secondaryRatUsageInfo"); - - OpenAPI_list_t *secondary_rat_usage_infoList; + secondary_rat_usage_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "secondaryRatUsageInfo"); if (secondary_rat_usage_info) { - cJSON *secondary_rat_usage_info_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_usage_info)){ - ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [secondary_rat_usage_info]"); - goto end; - } - - secondary_rat_usage_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_usage_info_local_nonprimitive, secondary_rat_usage_info ) { - if (!cJSON_IsObject(secondary_rat_usage_info_local_nonprimitive)) { + cJSON *secondary_rat_usage_info_local = NULL; + if (!cJSON_IsArray(secondary_rat_usage_info)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [secondary_rat_usage_info]"); goto end; } - OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_infoItem = OpenAPI_secondary_rat_usage_info_parseFromJSON(secondary_rat_usage_info_local_nonprimitive); - if (!secondary_rat_usage_infoItem) { - ogs_error("No secondary_rat_usage_infoItem"); - OpenAPI_list_free(secondary_rat_usage_infoList); - goto end; + secondary_rat_usage_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_usage_info_local, secondary_rat_usage_info) { + if (!cJSON_IsObject(secondary_rat_usage_info_local)) { + ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [secondary_rat_usage_info]"); + goto end; + } + OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_infoItem = OpenAPI_secondary_rat_usage_info_parseFromJSON(secondary_rat_usage_info_local); + if (!secondary_rat_usage_infoItem) { + ogs_error("No secondary_rat_usage_infoItem"); + OpenAPI_list_free(secondary_rat_usage_infoList); + goto end; + } + OpenAPI_list_add(secondary_rat_usage_infoList, secondary_rat_usage_infoItem); } - - OpenAPI_list_add(secondary_rat_usage_infoList, secondary_rat_usage_infoItem); - } } - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "smallDataRateStatus"); - - OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "smallDataRateStatus"); if (small_data_rate_status) { small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); } - cJSON *apn_rate_status = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "apnRateStatus"); - - OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + apn_rate_status = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "apnRateStatus"); if (apn_rate_status) { apn_rate_status_local_nonprim = OpenAPI_apn_rate_status_parseFromJSON(apn_rate_status); } - cJSON *dl_serving_plmn_rate_ctl = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "dlServingPlmnRateCtl"); - + dl_serving_plmn_rate_ctl = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "dlServingPlmnRateCtl"); if (dl_serving_plmn_rate_ctl) { if (!cJSON_IsNumber(dl_serving_plmn_rate_ctl)) { ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [dl_serving_plmn_rate_ctl]"); @@ -1388,38 +1539,34 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON } } - cJSON *up_security_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "upSecurityInfo"); - - OpenAPI_up_security_info_t *up_security_info_local_nonprim = NULL; + up_security_info = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "upSecurityInfo"); if (up_security_info) { up_security_info_local_nonprim = OpenAPI_up_security_info_parseFromJSON(up_security_info); } - cJSON *vplmn_qos = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vplmnQos"); - - OpenAPI_vplmn_qos_t *vplmn_qos_local_nonprim = NULL; + vplmn_qos = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vplmnQos"); if (vplmn_qos) { vplmn_qos_local_nonprim = OpenAPI_vplmn_qos_parseFromJSON(vplmn_qos); } pdu_session_create_data_local_var = OpenAPI_pdu_session_create_data_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, unauthenticated_supi ? true : false, unauthenticated_supi ? unauthenticated_supi->valueint : 0, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, pdu_session_id ? true : false, pdu_session_id ? pdu_session_id->valuedouble : 0, ogs_strdup(dnn->valuestring), - selected_dnn ? ogs_strdup(selected_dnn->valuestring) : NULL, + selected_dnn && !cJSON_IsNull(selected_dnn) ? ogs_strdup(selected_dnn->valuestring) : NULL, s_nssai ? s_nssai_local_nonprim : NULL, - vsmf_id ? ogs_strdup(vsmf_id->valuestring) : NULL, - ismf_id ? ogs_strdup(ismf_id->valuestring) : NULL, + vsmf_id && !cJSON_IsNull(vsmf_id) ? ogs_strdup(vsmf_id->valuestring) : NULL, + ismf_id && !cJSON_IsNull(ismf_id) ? ogs_strdup(ismf_id->valuestring) : NULL, serving_network_local_nonprim, request_type ? request_typeVariable : 0, eps_bearer_id ? eps_bearer_idList : NULL, - pgw_s8c_fteid ? pgw_s8c_fteid->valueint : 0, - vsmf_pdu_session_uri ? ogs_strdup(vsmf_pdu_session_uri->valuestring) : NULL, - ismf_pdu_session_uri ? ogs_strdup(ismf_pdu_session_uri->valuestring) : NULL, + pgw_s8c_fteid && !cJSON_IsNull(pgw_s8c_fteid) ? ogs_strdup(pgw_s8c_fteid->valuestring) : NULL, + vsmf_pdu_session_uri && !cJSON_IsNull(vsmf_pdu_session_uri) ? ogs_strdup(vsmf_pdu_session_uri->valuestring) : NULL, + ismf_pdu_session_uri && !cJSON_IsNull(ismf_pdu_session_uri) ? ogs_strdup(ismf_pdu_session_uri->valuestring) : NULL, vcn_tunnel_info ? vcn_tunnel_info_local_nonprim : NULL, icn_tunnel_info ? icn_tunnel_info_local_nonprim : NULL, n9_forwarding_tunnel_info ? n9_forwarding_tunnel_info_local_nonprim : NULL, @@ -1428,33 +1575,33 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON additional_an_type ? additional_an_typeVariable : 0, rat_type ? rat_typeVariable : 0, ue_location ? ue_location_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, add_ue_location ? add_ue_location_local_nonprim : NULL, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, n1_sm_info_from_ue ? n1_sm_info_from_ue_local_nonprim : NULL, unknown_n1_sm_info ? unknown_n1_sm_info_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, - h_pcf_id ? ogs_strdup(h_pcf_id->valuestring) : NULL, - pcf_id ? ogs_strdup(pcf_id->valuestring) : NULL, - pcf_group_id ? ogs_strdup(pcf_group_id->valuestring) : NULL, - pcf_set_id ? ogs_strdup(pcf_set_id->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, + h_pcf_id && !cJSON_IsNull(h_pcf_id) ? ogs_strdup(h_pcf_id->valuestring) : NULL, + pcf_id && !cJSON_IsNull(pcf_id) ? ogs_strdup(pcf_id->valuestring) : NULL, + pcf_group_id && !cJSON_IsNull(pcf_group_id) ? ogs_strdup(pcf_group_id->valuestring) : NULL, + pcf_set_id && !cJSON_IsNull(pcf_set_id) ? ogs_strdup(pcf_set_id->valuestring) : NULL, ho_preparation_indication ? true : false, ho_preparation_indication ? ho_preparation_indication->valueint : 0, sel_mode ? sel_modeVariable : 0, always_on_requested ? true : false, always_on_requested ? always_on_requested->valueint : 0, - udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL, - routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL, + udm_group_id && !cJSON_IsNull(udm_group_id) ? ogs_strdup(udm_group_id->valuestring) : NULL, + routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL, eps_interworking_ind ? eps_interworking_indVariable : 0, - v_smf_service_instance_id ? ogs_strdup(v_smf_service_instance_id->valuestring) : NULL, - i_smf_service_instance_id ? ogs_strdup(i_smf_service_instance_id->valuestring) : NULL, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, + v_smf_service_instance_id && !cJSON_IsNull(v_smf_service_instance_id) ? ogs_strdup(v_smf_service_instance_id->valuestring) : NULL, + i_smf_service_instance_id && !cJSON_IsNull(i_smf_service_instance_id) ? ogs_strdup(i_smf_service_instance_id->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, roaming_charging_profile ? roaming_charging_profile_local_nonprim : NULL, - charging_id ? ogs_strdup(charging_id->valuestring) : NULL, + charging_id && !cJSON_IsNull(charging_id) ? ogs_strdup(charging_id->valuestring) : NULL, old_pdu_session_id ? true : false, old_pdu_session_id ? old_pdu_session_id->valuedouble : 0, - eps_bearer_ctx_status ? ogs_strdup(eps_bearer_ctx_status->valuestring) : NULL, - amf_nf_id ? ogs_strdup(amf_nf_id->valuestring) : NULL, + eps_bearer_ctx_status && !cJSON_IsNull(eps_bearer_ctx_status) ? ogs_strdup(eps_bearer_ctx_status->valuestring) : NULL, + amf_nf_id && !cJSON_IsNull(amf_nf_id) ? ogs_strdup(amf_nf_id->valuestring) : NULL, guami ? guami_local_nonprim : NULL, max_integrity_protected_data_rate_ul ? max_integrity_protected_data_rate_ulVariable : 0, max_integrity_protected_data_rate_dl ? max_integrity_protected_data_rate_dlVariable : 0, @@ -1481,6 +1628,91 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON return pdu_session_create_data_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (eps_bearer_idList) { + OpenAPI_list_for_each(eps_bearer_idList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(eps_bearer_idList); + eps_bearer_idList = NULL; + } + if (vcn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(vcn_tunnel_info_local_nonprim); + vcn_tunnel_info_local_nonprim = NULL; + } + if (icn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(icn_tunnel_info_local_nonprim); + icn_tunnel_info_local_nonprim = NULL; + } + if (n9_forwarding_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(n9_forwarding_tunnel_info_local_nonprim); + n9_forwarding_tunnel_info_local_nonprim = NULL; + } + if (additional_cn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(additional_cn_tunnel_info_local_nonprim); + additional_cn_tunnel_info_local_nonprim = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } + if (add_ue_location_local_nonprim) { + OpenAPI_user_location_free(add_ue_location_local_nonprim); + add_ue_location_local_nonprim = NULL; + } + if (n1_sm_info_from_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_from_ue_local_nonprim); + n1_sm_info_from_ue_local_nonprim = NULL; + } + if (unknown_n1_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(unknown_n1_sm_info_local_nonprim); + unknown_n1_sm_info_local_nonprim = NULL; + } + if (roaming_charging_profile_local_nonprim) { + OpenAPI_roaming_charging_profile_free(roaming_charging_profile_local_nonprim); + roaming_charging_profile_local_nonprim = NULL; + } + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (dnai_listList) { + OpenAPI_list_for_each(dnai_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnai_listList); + dnai_listList = NULL; + } + if (secondary_rat_usage_infoList) { + OpenAPI_list_for_each(secondary_rat_usage_infoList, node) { + OpenAPI_secondary_rat_usage_info_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_infoList); + secondary_rat_usage_infoList = NULL; + } + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } + if (apn_rate_status_local_nonprim) { + OpenAPI_apn_rate_status_free(apn_rate_status_local_nonprim); + apn_rate_status_local_nonprim = NULL; + } + if (up_security_info_local_nonprim) { + OpenAPI_up_security_info_free(up_security_info_local_nonprim); + up_security_info_local_nonprim = NULL; + } + if (vplmn_qos_local_nonprim) { + OpenAPI_vplmn_qos_free(vplmn_qos_local_nonprim); + vplmn_qos_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_create_data.h b/lib/sbi/openapi/model/pdu_session_create_data.h index b61d0f13c..a5d602afc 100644 --- a/lib/sbi/openapi/model/pdu_session_create_data.h +++ b/lib/sbi/openapi/model/pdu_session_create_data.h @@ -52,7 +52,7 @@ typedef struct OpenAPI_pdu_session_create_data_s { struct OpenAPI_plmn_id_nid_s *serving_network; OpenAPI_request_type_e request_type; OpenAPI_list_t *eps_bearer_id; - char pgw_s8c_fteid; + char *pgw_s8c_fteid; char *vsmf_pdu_session_uri; char *ismf_pdu_session_uri; struct OpenAPI_tunnel_info_s *vcn_tunnel_info; @@ -129,7 +129,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_create( OpenAPI_plmn_id_nid_t *serving_network, OpenAPI_request_type_e request_type, OpenAPI_list_t *eps_bearer_id, - char pgw_s8c_fteid, + char *pgw_s8c_fteid, char *vsmf_pdu_session_uri, char *ismf_pdu_session_uri, OpenAPI_tunnel_info_t *vcn_tunnel_info, diff --git a/lib/sbi/openapi/model/pdu_session_create_error.c b/lib/sbi/openapi/model/pdu_session_create_error.c index 2c4e5effa..fb854bd5b 100644 --- a/lib/sbi/openapi/model/pdu_session_create_error.c +++ b/lib/sbi/openapi/model/pdu_session_create_error.c @@ -28,20 +28,34 @@ OpenAPI_pdu_session_create_error_t *OpenAPI_pdu_session_create_error_create( void OpenAPI_pdu_session_create_error_free(OpenAPI_pdu_session_create_error_t *pdu_session_create_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_create_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_problem_details_free(pdu_session_create_error->error); - ogs_free(pdu_session_create_error->n1sm_cause); - OpenAPI_ref_to_binary_data_free(pdu_session_create_error->n1_sm_info_to_ue); - ogs_free(pdu_session_create_error->recovery_time); + if (pdu_session_create_error->error) { + OpenAPI_problem_details_free(pdu_session_create_error->error); + pdu_session_create_error->error = NULL; + } + if (pdu_session_create_error->n1sm_cause) { + ogs_free(pdu_session_create_error->n1sm_cause); + pdu_session_create_error->n1sm_cause = NULL; + } + if (pdu_session_create_error->n1_sm_info_to_ue) { + OpenAPI_ref_to_binary_data_free(pdu_session_create_error->n1_sm_info_to_ue); + pdu_session_create_error->n1_sm_info_to_ue = NULL; + } + if (pdu_session_create_error->recovery_time) { + ogs_free(pdu_session_create_error->recovery_time); + pdu_session_create_error->recovery_time = NULL; + } ogs_free(pdu_session_create_error); } cJSON *OpenAPI_pdu_session_create_error_convertToJSON(OpenAPI_pdu_session_create_error_t *pdu_session_create_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_create_error == NULL) { ogs_error("OpenAPI_pdu_session_create_error_convertToJSON() failed [PduSessionCreateError]"); @@ -49,6 +63,10 @@ cJSON *OpenAPI_pdu_session_create_error_convertToJSON(OpenAPI_pdu_session_create } item = cJSON_CreateObject(); + if (!pdu_session_create_error->error) { + ogs_error("OpenAPI_pdu_session_create_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(pdu_session_create_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_pdu_session_create_error_convertToJSON() failed [error]"); @@ -101,33 +119,35 @@ end: OpenAPI_pdu_session_create_error_t *OpenAPI_pdu_session_create_error_parseFromJSON(cJSON *pdu_session_create_errorJSON) { OpenAPI_pdu_session_create_error_t *pdu_session_create_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_problem_details_t *error_local_nonprim = NULL; + cJSON *n1sm_cause = NULL; + cJSON *n1_sm_info_to_ue = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + cJSON *back_off_timer = NULL; + cJSON *recovery_time = NULL; + error = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_pdu_session_create_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error); - cJSON *n1sm_cause = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "n1smCause"); - + n1sm_cause = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "n1smCause"); if (n1sm_cause) { - if (!cJSON_IsString(n1sm_cause)) { + if (!cJSON_IsString(n1sm_cause) && !cJSON_IsNull(n1sm_cause)) { ogs_error("OpenAPI_pdu_session_create_error_parseFromJSON() failed [n1sm_cause]"); goto end; } } - cJSON *n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "n1SmInfoToUe"); - - OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "n1SmInfoToUe"); if (n1_sm_info_to_ue) { n1_sm_info_to_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_to_ue); } - cJSON *back_off_timer = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "backOffTimer"); - + back_off_timer = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "backOffTimer"); if (back_off_timer) { if (!cJSON_IsNumber(back_off_timer)) { ogs_error("OpenAPI_pdu_session_create_error_parseFromJSON() failed [back_off_timer]"); @@ -135,10 +155,9 @@ OpenAPI_pdu_session_create_error_t *OpenAPI_pdu_session_create_error_parseFromJS } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(pdu_session_create_errorJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_pdu_session_create_error_parseFromJSON() failed [recovery_time]"); goto end; } @@ -146,15 +165,23 @@ OpenAPI_pdu_session_create_error_t *OpenAPI_pdu_session_create_error_parseFromJS pdu_session_create_error_local_var = OpenAPI_pdu_session_create_error_create ( error_local_nonprim, - n1sm_cause ? ogs_strdup(n1sm_cause->valuestring) : NULL, + n1sm_cause && !cJSON_IsNull(n1sm_cause) ? ogs_strdup(n1sm_cause->valuestring) : NULL, n1_sm_info_to_ue ? n1_sm_info_to_ue_local_nonprim : NULL, back_off_timer ? true : false, back_off_timer ? back_off_timer->valuedouble : 0, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL ); return pdu_session_create_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (n1_sm_info_to_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_to_ue_local_nonprim); + n1_sm_info_to_ue_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_created_data.c b/lib/sbi/openapi/model/pdu_session_created_data.c index b700e5826..d8702fd3e 100644 --- a/lib/sbi/openapi/model/pdu_session_created_data.c +++ b/lib/sbi/openapi/model/pdu_session_created_data.c @@ -106,51 +106,131 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_create( void OpenAPI_pdu_session_created_data_free(OpenAPI_pdu_session_created_data_t *pdu_session_created_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_created_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(pdu_session_created_data->ssc_mode); - OpenAPI_tunnel_info_free(pdu_session_created_data->hcn_tunnel_info); - OpenAPI_tunnel_info_free(pdu_session_created_data->cn_tunnel_info); - OpenAPI_tunnel_info_free(pdu_session_created_data->additional_cn_tunnel_info); - OpenAPI_ambr_free(pdu_session_created_data->session_ambr); - OpenAPI_list_for_each(pdu_session_created_data->qos_flows_setup_list, node) { - OpenAPI_qos_flow_setup_item_free(node->data); + if (pdu_session_created_data->ssc_mode) { + ogs_free(pdu_session_created_data->ssc_mode); + pdu_session_created_data->ssc_mode = NULL; } - OpenAPI_list_free(pdu_session_created_data->qos_flows_setup_list); - ogs_free(pdu_session_created_data->h_smf_instance_id); - ogs_free(pdu_session_created_data->smf_instance_id); - OpenAPI_snssai_free(pdu_session_created_data->s_nssai); - ogs_free(pdu_session_created_data->ue_ipv4_address); - ogs_free(pdu_session_created_data->ue_ipv6_prefix); - OpenAPI_ref_to_binary_data_free(pdu_session_created_data->n1_sm_info_to_ue); - OpenAPI_eps_pdn_cnx_info_free(pdu_session_created_data->eps_pdn_cnx_info); - OpenAPI_list_for_each(pdu_session_created_data->eps_bearer_info, node) { - OpenAPI_eps_bearer_info_free(node->data); + if (pdu_session_created_data->hcn_tunnel_info) { + OpenAPI_tunnel_info_free(pdu_session_created_data->hcn_tunnel_info); + pdu_session_created_data->hcn_tunnel_info = NULL; } - OpenAPI_list_free(pdu_session_created_data->eps_bearer_info); - ogs_free(pdu_session_created_data->supported_features); - ogs_free(pdu_session_created_data->gpsi); - OpenAPI_up_security_free(pdu_session_created_data->up_security); - OpenAPI_roaming_charging_profile_free(pdu_session_created_data->roaming_charging_profile); - ogs_free(pdu_session_created_data->h_smf_service_instance_id); - ogs_free(pdu_session_created_data->smf_service_instance_id); - ogs_free(pdu_session_created_data->recovery_time); - OpenAPI_list_for_each(pdu_session_created_data->dnai_list, node) { - ogs_free(node->data); + if (pdu_session_created_data->cn_tunnel_info) { + OpenAPI_tunnel_info_free(pdu_session_created_data->cn_tunnel_info); + pdu_session_created_data->cn_tunnel_info = NULL; + } + if (pdu_session_created_data->additional_cn_tunnel_info) { + OpenAPI_tunnel_info_free(pdu_session_created_data->additional_cn_tunnel_info); + pdu_session_created_data->additional_cn_tunnel_info = NULL; + } + if (pdu_session_created_data->session_ambr) { + OpenAPI_ambr_free(pdu_session_created_data->session_ambr); + pdu_session_created_data->session_ambr = NULL; + } + if (pdu_session_created_data->qos_flows_setup_list) { + OpenAPI_list_for_each(pdu_session_created_data->qos_flows_setup_list, node) { + OpenAPI_qos_flow_setup_item_free(node->data); + } + OpenAPI_list_free(pdu_session_created_data->qos_flows_setup_list); + pdu_session_created_data->qos_flows_setup_list = NULL; + } + if (pdu_session_created_data->h_smf_instance_id) { + ogs_free(pdu_session_created_data->h_smf_instance_id); + pdu_session_created_data->h_smf_instance_id = NULL; + } + if (pdu_session_created_data->smf_instance_id) { + ogs_free(pdu_session_created_data->smf_instance_id); + pdu_session_created_data->smf_instance_id = NULL; + } + if (pdu_session_created_data->s_nssai) { + OpenAPI_snssai_free(pdu_session_created_data->s_nssai); + pdu_session_created_data->s_nssai = NULL; + } + if (pdu_session_created_data->ue_ipv4_address) { + ogs_free(pdu_session_created_data->ue_ipv4_address); + pdu_session_created_data->ue_ipv4_address = NULL; + } + if (pdu_session_created_data->ue_ipv6_prefix) { + ogs_free(pdu_session_created_data->ue_ipv6_prefix); + pdu_session_created_data->ue_ipv6_prefix = NULL; + } + if (pdu_session_created_data->n1_sm_info_to_ue) { + OpenAPI_ref_to_binary_data_free(pdu_session_created_data->n1_sm_info_to_ue); + pdu_session_created_data->n1_sm_info_to_ue = NULL; + } + if (pdu_session_created_data->eps_pdn_cnx_info) { + OpenAPI_eps_pdn_cnx_info_free(pdu_session_created_data->eps_pdn_cnx_info); + pdu_session_created_data->eps_pdn_cnx_info = NULL; + } + if (pdu_session_created_data->eps_bearer_info) { + OpenAPI_list_for_each(pdu_session_created_data->eps_bearer_info, node) { + OpenAPI_eps_bearer_info_free(node->data); + } + OpenAPI_list_free(pdu_session_created_data->eps_bearer_info); + pdu_session_created_data->eps_bearer_info = NULL; + } + if (pdu_session_created_data->supported_features) { + ogs_free(pdu_session_created_data->supported_features); + pdu_session_created_data->supported_features = NULL; + } + if (pdu_session_created_data->gpsi) { + ogs_free(pdu_session_created_data->gpsi); + pdu_session_created_data->gpsi = NULL; + } + if (pdu_session_created_data->up_security) { + OpenAPI_up_security_free(pdu_session_created_data->up_security); + pdu_session_created_data->up_security = NULL; + } + if (pdu_session_created_data->roaming_charging_profile) { + OpenAPI_roaming_charging_profile_free(pdu_session_created_data->roaming_charging_profile); + pdu_session_created_data->roaming_charging_profile = NULL; + } + if (pdu_session_created_data->h_smf_service_instance_id) { + ogs_free(pdu_session_created_data->h_smf_service_instance_id); + pdu_session_created_data->h_smf_service_instance_id = NULL; + } + if (pdu_session_created_data->smf_service_instance_id) { + ogs_free(pdu_session_created_data->smf_service_instance_id); + pdu_session_created_data->smf_service_instance_id = NULL; + } + if (pdu_session_created_data->recovery_time) { + ogs_free(pdu_session_created_data->recovery_time); + pdu_session_created_data->recovery_time = NULL; + } + if (pdu_session_created_data->dnai_list) { + OpenAPI_list_for_each(pdu_session_created_data->dnai_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_session_created_data->dnai_list); + pdu_session_created_data->dnai_list = NULL; + } + if (pdu_session_created_data->home_provided_charging_id) { + ogs_free(pdu_session_created_data->home_provided_charging_id); + pdu_session_created_data->home_provided_charging_id = NULL; + } + if (pdu_session_created_data->ue_ipv6_interface_id) { + ogs_free(pdu_session_created_data->ue_ipv6_interface_id); + pdu_session_created_data->ue_ipv6_interface_id = NULL; + } + if (pdu_session_created_data->dn_aaa_address) { + OpenAPI_ip_address_free(pdu_session_created_data->dn_aaa_address); + pdu_session_created_data->dn_aaa_address = NULL; + } + if (pdu_session_created_data->redundant_pdu_session_info) { + OpenAPI_redundant_pdu_session_information_free(pdu_session_created_data->redundant_pdu_session_info); + pdu_session_created_data->redundant_pdu_session_info = NULL; } - OpenAPI_list_free(pdu_session_created_data->dnai_list); - ogs_free(pdu_session_created_data->home_provided_charging_id); - ogs_free(pdu_session_created_data->ue_ipv6_interface_id); - OpenAPI_ip_address_free(pdu_session_created_data->dn_aaa_address); - OpenAPI_redundant_pdu_session_information_free(pdu_session_created_data->redundant_pdu_session_info); ogs_free(pdu_session_created_data); } cJSON *OpenAPI_pdu_session_created_data_convertToJSON(OpenAPI_pdu_session_created_data_t *pdu_session_created_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_created_data == NULL) { ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [PduSessionCreatedData]"); @@ -158,11 +238,19 @@ cJSON *OpenAPI_pdu_session_created_data_convertToJSON(OpenAPI_pdu_session_create } item = cJSON_CreateObject(); + if (pdu_session_created_data->pdu_session_type == OpenAPI_pdu_session_type_NULL) { + ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [pdu_session_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "pduSessionType", OpenAPI_pdu_session_type_ToString(pdu_session_created_data->pdu_session_type)) == NULL) { ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [pdu_session_type]"); goto end; } + if (!pdu_session_created_data->ssc_mode) { + ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [ssc_mode]"); + return NULL; + } if (cJSON_AddStringToObject(item, "sscMode", pdu_session_created_data->ssc_mode) == NULL) { ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [ssc_mode]"); goto end; @@ -226,17 +314,13 @@ cJSON *OpenAPI_pdu_session_created_data_convertToJSON(OpenAPI_pdu_session_create ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [qos_flows_setup_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_setup_list_node; - if (pdu_session_created_data->qos_flows_setup_list) { - OpenAPI_list_for_each(pdu_session_created_data->qos_flows_setup_list, qos_flows_setup_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_setup_item_convertToJSON(qos_flows_setup_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [qos_flows_setup_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_setup_listList, itemLocal); + OpenAPI_list_for_each(pdu_session_created_data->qos_flows_setup_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_setup_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [qos_flows_setup_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_setup_listList, itemLocal); } } @@ -327,17 +411,13 @@ cJSON *OpenAPI_pdu_session_created_data_convertToJSON(OpenAPI_pdu_session_create ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [eps_bearer_info]"); goto end; } - - OpenAPI_lnode_t *eps_bearer_info_node; - if (pdu_session_created_data->eps_bearer_info) { - OpenAPI_list_for_each(pdu_session_created_data->eps_bearer_info, eps_bearer_info_node) { - cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(eps_bearer_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [eps_bearer_info]"); - goto end; - } - cJSON_AddItemToArray(eps_bearer_infoList, itemLocal); + OpenAPI_list_for_each(pdu_session_created_data->eps_bearer_info, node) { + cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [eps_bearer_info]"); + goto end; } + cJSON_AddItemToArray(eps_bearer_infoList, itemLocal); } } @@ -348,14 +428,14 @@ cJSON *OpenAPI_pdu_session_created_data_convertToJSON(OpenAPI_pdu_session_create } } - if (pdu_session_created_data->max_integrity_protected_data_rate) { + if (pdu_session_created_data->max_integrity_protected_data_rate != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRate", OpenAPI_max_integrity_protected_data_rate_ToString(pdu_session_created_data->max_integrity_protected_data_rate)) == NULL) { ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [max_integrity_protected_data_rate]"); goto end; } } - if (pdu_session_created_data->max_integrity_protected_data_rate_dl) { + if (pdu_session_created_data->max_integrity_protected_data_rate_dl != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateDl", OpenAPI_max_integrity_protected_data_rate_ToString(pdu_session_created_data->max_integrity_protected_data_rate_dl)) == NULL) { ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [max_integrity_protected_data_rate_dl]"); goto end; @@ -424,19 +504,17 @@ cJSON *OpenAPI_pdu_session_created_data_convertToJSON(OpenAPI_pdu_session_create } if (pdu_session_created_data->dnai_list) { - cJSON *dnai_list = cJSON_AddArrayToObject(item, "dnaiList"); - if (dnai_list == NULL) { + cJSON *dnai_listList = cJSON_AddArrayToObject(item, "dnaiList"); + if (dnai_listList == NULL) { ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [dnai_list]"); goto end; } - - OpenAPI_lnode_t *dnai_list_node; - OpenAPI_list_for_each(pdu_session_created_data->dnai_list, dnai_list_node) { - if (cJSON_AddStringToObject(dnai_list, "", (char*)dnai_list_node->data) == NULL) { - ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [dnai_list]"); - goto end; + OpenAPI_list_for_each(pdu_session_created_data->dnai_list, node) { + if (cJSON_AddStringToObject(dnai_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [dnai_list]"); + goto end; + } } - } } if (pdu_session_created_data->is_ipv6_multi_homing_ind) { @@ -521,107 +599,144 @@ end: OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJSON(cJSON *pdu_session_created_dataJSON) { OpenAPI_pdu_session_created_data_t *pdu_session_created_data_local_var = NULL; - cJSON *pdu_session_type = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "pduSessionType"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_type = NULL; + OpenAPI_pdu_session_type_e pdu_session_typeVariable = 0; + cJSON *ssc_mode = NULL; + cJSON *hcn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *hcn_tunnel_info_local_nonprim = NULL; + cJSON *cn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *cn_tunnel_info_local_nonprim = NULL; + cJSON *additional_cn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *additional_cn_tunnel_info_local_nonprim = NULL; + cJSON *session_ambr = NULL; + OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + cJSON *qos_flows_setup_list = NULL; + OpenAPI_list_t *qos_flows_setup_listList = NULL; + cJSON *h_smf_instance_id = NULL; + cJSON *smf_instance_id = NULL; + cJSON *pdu_session_id = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *enable_pause_charging = NULL; + cJSON *ue_ipv4_address = NULL; + cJSON *ue_ipv6_prefix = NULL; + cJSON *n1_sm_info_to_ue = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + cJSON *eps_pdn_cnx_info = NULL; + OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_nonprim = NULL; + cJSON *eps_bearer_info = NULL; + OpenAPI_list_t *eps_bearer_infoList = NULL; + cJSON *supported_features = NULL; + cJSON *max_integrity_protected_data_rate = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rateVariable = 0; + cJSON *max_integrity_protected_data_rate_dl = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable = 0; + cJSON *always_on_granted = NULL; + cJSON *gpsi = NULL; + cJSON *up_security = NULL; + OpenAPI_up_security_t *up_security_local_nonprim = NULL; + cJSON *roaming_charging_profile = NULL; + OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + cJSON *h_smf_service_instance_id = NULL; + cJSON *smf_service_instance_id = NULL; + cJSON *recovery_time = NULL; + cJSON *dnai_list = NULL; + OpenAPI_list_t *dnai_listList = NULL; + cJSON *ipv6_multi_homing_ind = NULL; + cJSON *ma_accepted_ind = NULL; + cJSON *home_provided_charging_id = NULL; + cJSON *nef_ext_buf_support_ind = NULL; + cJSON *small_data_rate_control_enabled = NULL; + cJSON *ue_ipv6_interface_id = NULL; + cJSON *ipv6_index = NULL; + cJSON *dn_aaa_address = NULL; + OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL; + cJSON *redundant_pdu_session_info = NULL; + OpenAPI_redundant_pdu_session_information_t *redundant_pdu_session_info_local_nonprim = NULL; + pdu_session_type = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "pduSessionType"); if (!pdu_session_type) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [pdu_session_type]"); goto end; } - - OpenAPI_pdu_session_type_e pdu_session_typeVariable; if (!cJSON_IsString(pdu_session_type)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [pdu_session_type]"); goto end; } pdu_session_typeVariable = OpenAPI_pdu_session_type_FromString(pdu_session_type->valuestring); - cJSON *ssc_mode = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "sscMode"); + ssc_mode = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "sscMode"); if (!ssc_mode) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [ssc_mode]"); goto end; } - if (!cJSON_IsString(ssc_mode)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [ssc_mode]"); goto end; } - cJSON *hcn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "hcnTunnelInfo"); - - OpenAPI_tunnel_info_t *hcn_tunnel_info_local_nonprim = NULL; + hcn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "hcnTunnelInfo"); if (hcn_tunnel_info) { hcn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(hcn_tunnel_info); } - cJSON *cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "cnTunnelInfo"); - - OpenAPI_tunnel_info_t *cn_tunnel_info_local_nonprim = NULL; + cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "cnTunnelInfo"); if (cn_tunnel_info) { cn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(cn_tunnel_info); } - cJSON *additional_cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "additionalCnTunnelInfo"); - - OpenAPI_tunnel_info_t *additional_cn_tunnel_info_local_nonprim = NULL; + additional_cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "additionalCnTunnelInfo"); if (additional_cn_tunnel_info) { additional_cn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(additional_cn_tunnel_info); } - cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "sessionAmbr"); - - OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + session_ambr = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "sessionAmbr"); if (session_ambr) { session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr); } - cJSON *qos_flows_setup_list = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "qosFlowsSetupList"); - - OpenAPI_list_t *qos_flows_setup_listList; + qos_flows_setup_list = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "qosFlowsSetupList"); if (qos_flows_setup_list) { - cJSON *qos_flows_setup_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_setup_list)){ - ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [qos_flows_setup_list]"); - goto end; - } - - qos_flows_setup_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_setup_list_local_nonprimitive, qos_flows_setup_list ) { - if (!cJSON_IsObject(qos_flows_setup_list_local_nonprimitive)) { + cJSON *qos_flows_setup_list_local = NULL; + if (!cJSON_IsArray(qos_flows_setup_list)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [qos_flows_setup_list]"); goto end; } - OpenAPI_qos_flow_setup_item_t *qos_flows_setup_listItem = OpenAPI_qos_flow_setup_item_parseFromJSON(qos_flows_setup_list_local_nonprimitive); - if (!qos_flows_setup_listItem) { - ogs_error("No qos_flows_setup_listItem"); - OpenAPI_list_free(qos_flows_setup_listList); - goto end; + qos_flows_setup_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_setup_list_local, qos_flows_setup_list) { + if (!cJSON_IsObject(qos_flows_setup_list_local)) { + ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [qos_flows_setup_list]"); + goto end; + } + OpenAPI_qos_flow_setup_item_t *qos_flows_setup_listItem = OpenAPI_qos_flow_setup_item_parseFromJSON(qos_flows_setup_list_local); + if (!qos_flows_setup_listItem) { + ogs_error("No qos_flows_setup_listItem"); + OpenAPI_list_free(qos_flows_setup_listList); + goto end; + } + OpenAPI_list_add(qos_flows_setup_listList, qos_flows_setup_listItem); } - - OpenAPI_list_add(qos_flows_setup_listList, qos_flows_setup_listItem); - } } - cJSON *h_smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "hSmfInstanceId"); - + h_smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "hSmfInstanceId"); if (h_smf_instance_id) { - if (!cJSON_IsString(h_smf_instance_id)) { + if (!cJSON_IsString(h_smf_instance_id) && !cJSON_IsNull(h_smf_instance_id)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [h_smf_instance_id]"); goto end; } } - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "smfInstanceId"); - + smf_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "smfInstanceId"); if (smf_instance_id) { - if (!cJSON_IsString(smf_instance_id)) { + if (!cJSON_IsString(smf_instance_id) && !cJSON_IsNull(smf_instance_id)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [smf_instance_id]"); goto end; } } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "pduSessionId"); - + pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "pduSessionId"); if (pdu_session_id) { if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [pdu_session_id]"); @@ -629,15 +744,12 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS } } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "sNssai"); - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "sNssai"); if (s_nssai) { s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); } - cJSON *enable_pause_charging = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "enablePauseCharging"); - + enable_pause_charging = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "enablePauseCharging"); if (enable_pause_charging) { if (!cJSON_IsBool(enable_pause_charging)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [enable_pause_charging]"); @@ -645,79 +757,66 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS } } - cJSON *ue_ipv4_address = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ueIpv4Address"); - + ue_ipv4_address = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ueIpv4Address"); if (ue_ipv4_address) { - if (!cJSON_IsString(ue_ipv4_address)) { + if (!cJSON_IsString(ue_ipv4_address) && !cJSON_IsNull(ue_ipv4_address)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [ue_ipv4_address]"); goto end; } } - cJSON *ue_ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ueIpv6Prefix"); - + ue_ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ueIpv6Prefix"); if (ue_ipv6_prefix) { - if (!cJSON_IsString(ue_ipv6_prefix)) { + if (!cJSON_IsString(ue_ipv6_prefix) && !cJSON_IsNull(ue_ipv6_prefix)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [ue_ipv6_prefix]"); goto end; } } - cJSON *n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "n1SmInfoToUe"); - - OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "n1SmInfoToUe"); if (n1_sm_info_to_ue) { n1_sm_info_to_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_to_ue); } - cJSON *eps_pdn_cnx_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "epsPdnCnxInfo"); - - OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_nonprim = NULL; + eps_pdn_cnx_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "epsPdnCnxInfo"); if (eps_pdn_cnx_info) { eps_pdn_cnx_info_local_nonprim = OpenAPI_eps_pdn_cnx_info_parseFromJSON(eps_pdn_cnx_info); } - cJSON *eps_bearer_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "epsBearerInfo"); - - OpenAPI_list_t *eps_bearer_infoList; + eps_bearer_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "epsBearerInfo"); if (eps_bearer_info) { - cJSON *eps_bearer_info_local_nonprimitive; - if (!cJSON_IsArray(eps_bearer_info)){ - ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [eps_bearer_info]"); - goto end; - } - - eps_bearer_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eps_bearer_info_local_nonprimitive, eps_bearer_info ) { - if (!cJSON_IsObject(eps_bearer_info_local_nonprimitive)) { + cJSON *eps_bearer_info_local = NULL; + if (!cJSON_IsArray(eps_bearer_info)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [eps_bearer_info]"); goto end; } - OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local_nonprimitive); - if (!eps_bearer_infoItem) { - ogs_error("No eps_bearer_infoItem"); - OpenAPI_list_free(eps_bearer_infoList); - goto end; + eps_bearer_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eps_bearer_info_local, eps_bearer_info) { + if (!cJSON_IsObject(eps_bearer_info_local)) { + ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [eps_bearer_info]"); + goto end; + } + OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local); + if (!eps_bearer_infoItem) { + ogs_error("No eps_bearer_infoItem"); + OpenAPI_list_free(eps_bearer_infoList); + goto end; + } + OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem); } - - OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem); - } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *max_integrity_protected_data_rate = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "maxIntegrityProtectedDataRate"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rateVariable; + max_integrity_protected_data_rate = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "maxIntegrityProtectedDataRate"); if (max_integrity_protected_data_rate) { if (!cJSON_IsString(max_integrity_protected_data_rate)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [max_integrity_protected_data_rate]"); @@ -726,9 +825,7 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS max_integrity_protected_data_rateVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate->valuestring); } - cJSON *max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "maxIntegrityProtectedDataRateDl"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable; + max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "maxIntegrityProtectedDataRateDl"); if (max_integrity_protected_data_rate_dl) { if (!cJSON_IsString(max_integrity_protected_data_rate_dl)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [max_integrity_protected_data_rate_dl]"); @@ -737,8 +834,7 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS max_integrity_protected_data_rate_dlVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_dl->valuestring); } - cJSON *always_on_granted = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "alwaysOnGranted"); - + always_on_granted = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "alwaysOnGranted"); if (always_on_granted) { if (!cJSON_IsBool(always_on_granted)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [always_on_granted]"); @@ -746,78 +842,70 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS } } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *up_security = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "upSecurity"); - - OpenAPI_up_security_t *up_security_local_nonprim = NULL; + up_security = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "upSecurity"); if (up_security) { up_security_local_nonprim = OpenAPI_up_security_parseFromJSON(up_security); } - cJSON *roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "roamingChargingProfile"); - - OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "roamingChargingProfile"); if (roaming_charging_profile) { roaming_charging_profile_local_nonprim = OpenAPI_roaming_charging_profile_parseFromJSON(roaming_charging_profile); } - cJSON *h_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "hSmfServiceInstanceId"); - + h_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "hSmfServiceInstanceId"); if (h_smf_service_instance_id) { - if (!cJSON_IsString(h_smf_service_instance_id)) { + if (!cJSON_IsString(h_smf_service_instance_id) && !cJSON_IsNull(h_smf_service_instance_id)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [h_smf_service_instance_id]"); goto end; } } - cJSON *smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "smfServiceInstanceId"); - + smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "smfServiceInstanceId"); if (smf_service_instance_id) { - if (!cJSON_IsString(smf_service_instance_id)) { + if (!cJSON_IsString(smf_service_instance_id) && !cJSON_IsNull(smf_service_instance_id)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [smf_service_instance_id]"); goto end; } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "dnaiList"); - - OpenAPI_list_t *dnai_listList; + dnai_list = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "dnaiList"); if (dnai_list) { - cJSON *dnai_list_local; - if (!cJSON_IsArray(dnai_list)) { - ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - dnai_listList = OpenAPI_list_create(); + cJSON *dnai_list_local = NULL; + if (!cJSON_IsArray(dnai_list)) { + ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [dnai_list]"); + goto end; + } - cJSON_ArrayForEach(dnai_list_local, dnai_list) { - if (!cJSON_IsString(dnai_list_local)) { - ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); - } + dnai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnai_list_local, dnai_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnai_list_local)) { + ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [dnai_list]"); + goto end; + } + OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); + } } - cJSON *ipv6_multi_homing_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ipv6MultiHomingInd"); - + ipv6_multi_homing_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ipv6MultiHomingInd"); if (ipv6_multi_homing_ind) { if (!cJSON_IsBool(ipv6_multi_homing_ind)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [ipv6_multi_homing_ind]"); @@ -825,8 +913,7 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS } } - cJSON *ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "maAcceptedInd"); - + ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "maAcceptedInd"); if (ma_accepted_ind) { if (!cJSON_IsBool(ma_accepted_ind)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [ma_accepted_ind]"); @@ -834,17 +921,15 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS } } - cJSON *home_provided_charging_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "homeProvidedChargingId"); - + home_provided_charging_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "homeProvidedChargingId"); if (home_provided_charging_id) { - if (!cJSON_IsString(home_provided_charging_id)) { + if (!cJSON_IsString(home_provided_charging_id) && !cJSON_IsNull(home_provided_charging_id)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [home_provided_charging_id]"); goto end; } } - cJSON *nef_ext_buf_support_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "nefExtBufSupportInd"); - + nef_ext_buf_support_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "nefExtBufSupportInd"); if (nef_ext_buf_support_ind) { if (!cJSON_IsBool(nef_ext_buf_support_ind)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [nef_ext_buf_support_ind]"); @@ -852,8 +937,7 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS } } - cJSON *small_data_rate_control_enabled = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "smallDataRateControlEnabled"); - + small_data_rate_control_enabled = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "smallDataRateControlEnabled"); if (small_data_rate_control_enabled) { if (!cJSON_IsBool(small_data_rate_control_enabled)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [small_data_rate_control_enabled]"); @@ -861,17 +945,15 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS } } - cJSON *ue_ipv6_interface_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ueIpv6InterfaceId"); - + ue_ipv6_interface_id = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ueIpv6InterfaceId"); if (ue_ipv6_interface_id) { - if (!cJSON_IsString(ue_ipv6_interface_id)) { + if (!cJSON_IsString(ue_ipv6_interface_id) && !cJSON_IsNull(ue_ipv6_interface_id)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [ue_ipv6_interface_id]"); goto end; } } - cJSON *ipv6_index = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ipv6Index"); - + ipv6_index = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "ipv6Index"); if (ipv6_index) { if (!cJSON_IsNumber(ipv6_index)) { ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [ipv6_index]"); @@ -879,16 +961,12 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS } } - cJSON *dn_aaa_address = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "dnAaaAddress"); - - OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL; + dn_aaa_address = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "dnAaaAddress"); if (dn_aaa_address) { dn_aaa_address_local_nonprim = OpenAPI_ip_address_parseFromJSON(dn_aaa_address); } - cJSON *redundant_pdu_session_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "redundantPduSessionInfo"); - - OpenAPI_redundant_pdu_session_information_t *redundant_pdu_session_info_local_nonprim = NULL; + redundant_pdu_session_info = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "redundantPduSessionInfo"); if (redundant_pdu_session_info) { redundant_pdu_session_info_local_nonprim = OpenAPI_redundant_pdu_session_information_parseFromJSON(redundant_pdu_session_info); } @@ -901,40 +979,40 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS additional_cn_tunnel_info ? additional_cn_tunnel_info_local_nonprim : NULL, session_ambr ? session_ambr_local_nonprim : NULL, qos_flows_setup_list ? qos_flows_setup_listList : NULL, - h_smf_instance_id ? ogs_strdup(h_smf_instance_id->valuestring) : NULL, - smf_instance_id ? ogs_strdup(smf_instance_id->valuestring) : NULL, + h_smf_instance_id && !cJSON_IsNull(h_smf_instance_id) ? ogs_strdup(h_smf_instance_id->valuestring) : NULL, + smf_instance_id && !cJSON_IsNull(smf_instance_id) ? ogs_strdup(smf_instance_id->valuestring) : NULL, pdu_session_id ? true : false, pdu_session_id ? pdu_session_id->valuedouble : 0, s_nssai ? s_nssai_local_nonprim : NULL, enable_pause_charging ? true : false, enable_pause_charging ? enable_pause_charging->valueint : 0, - ue_ipv4_address ? ogs_strdup(ue_ipv4_address->valuestring) : NULL, - ue_ipv6_prefix ? ogs_strdup(ue_ipv6_prefix->valuestring) : NULL, + ue_ipv4_address && !cJSON_IsNull(ue_ipv4_address) ? ogs_strdup(ue_ipv4_address->valuestring) : NULL, + ue_ipv6_prefix && !cJSON_IsNull(ue_ipv6_prefix) ? ogs_strdup(ue_ipv6_prefix->valuestring) : NULL, n1_sm_info_to_ue ? n1_sm_info_to_ue_local_nonprim : NULL, eps_pdn_cnx_info ? eps_pdn_cnx_info_local_nonprim : NULL, eps_bearer_info ? eps_bearer_infoList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, max_integrity_protected_data_rate ? max_integrity_protected_data_rateVariable : 0, max_integrity_protected_data_rate_dl ? max_integrity_protected_data_rate_dlVariable : 0, always_on_granted ? true : false, always_on_granted ? always_on_granted->valueint : 0, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, up_security ? up_security_local_nonprim : NULL, roaming_charging_profile ? roaming_charging_profile_local_nonprim : NULL, - h_smf_service_instance_id ? ogs_strdup(h_smf_service_instance_id->valuestring) : NULL, - smf_service_instance_id ? ogs_strdup(smf_service_instance_id->valuestring) : NULL, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, + h_smf_service_instance_id && !cJSON_IsNull(h_smf_service_instance_id) ? ogs_strdup(h_smf_service_instance_id->valuestring) : NULL, + smf_service_instance_id && !cJSON_IsNull(smf_service_instance_id) ? ogs_strdup(smf_service_instance_id->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, dnai_list ? dnai_listList : NULL, ipv6_multi_homing_ind ? true : false, ipv6_multi_homing_ind ? ipv6_multi_homing_ind->valueint : 0, ma_accepted_ind ? true : false, ma_accepted_ind ? ma_accepted_ind->valueint : 0, - home_provided_charging_id ? ogs_strdup(home_provided_charging_id->valuestring) : NULL, + home_provided_charging_id && !cJSON_IsNull(home_provided_charging_id) ? ogs_strdup(home_provided_charging_id->valuestring) : NULL, nef_ext_buf_support_ind ? true : false, nef_ext_buf_support_ind ? nef_ext_buf_support_ind->valueint : 0, small_data_rate_control_enabled ? true : false, small_data_rate_control_enabled ? small_data_rate_control_enabled->valueint : 0, - ue_ipv6_interface_id ? ogs_strdup(ue_ipv6_interface_id->valuestring) : NULL, + ue_ipv6_interface_id && !cJSON_IsNull(ue_ipv6_interface_id) ? ogs_strdup(ue_ipv6_interface_id->valuestring) : NULL, ipv6_index ? true : false, ipv6_index ? ipv6_index->valuedouble : 0, dn_aaa_address ? dn_aaa_address_local_nonprim : NULL, @@ -943,6 +1021,71 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS return pdu_session_created_data_local_var; end: + if (hcn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(hcn_tunnel_info_local_nonprim); + hcn_tunnel_info_local_nonprim = NULL; + } + if (cn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(cn_tunnel_info_local_nonprim); + cn_tunnel_info_local_nonprim = NULL; + } + if (additional_cn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(additional_cn_tunnel_info_local_nonprim); + additional_cn_tunnel_info_local_nonprim = NULL; + } + if (session_ambr_local_nonprim) { + OpenAPI_ambr_free(session_ambr_local_nonprim); + session_ambr_local_nonprim = NULL; + } + if (qos_flows_setup_listList) { + OpenAPI_list_for_each(qos_flows_setup_listList, node) { + OpenAPI_qos_flow_setup_item_free(node->data); + } + OpenAPI_list_free(qos_flows_setup_listList); + qos_flows_setup_listList = NULL; + } + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (n1_sm_info_to_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_to_ue_local_nonprim); + n1_sm_info_to_ue_local_nonprim = NULL; + } + if (eps_pdn_cnx_info_local_nonprim) { + OpenAPI_eps_pdn_cnx_info_free(eps_pdn_cnx_info_local_nonprim); + eps_pdn_cnx_info_local_nonprim = NULL; + } + if (eps_bearer_infoList) { + OpenAPI_list_for_each(eps_bearer_infoList, node) { + OpenAPI_eps_bearer_info_free(node->data); + } + OpenAPI_list_free(eps_bearer_infoList); + eps_bearer_infoList = NULL; + } + if (up_security_local_nonprim) { + OpenAPI_up_security_free(up_security_local_nonprim); + up_security_local_nonprim = NULL; + } + if (roaming_charging_profile_local_nonprim) { + OpenAPI_roaming_charging_profile_free(roaming_charging_profile_local_nonprim); + roaming_charging_profile_local_nonprim = NULL; + } + if (dnai_listList) { + OpenAPI_list_for_each(dnai_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnai_listList); + dnai_listList = NULL; + } + if (dn_aaa_address_local_nonprim) { + OpenAPI_ip_address_free(dn_aaa_address_local_nonprim); + dn_aaa_address_local_nonprim = NULL; + } + if (redundant_pdu_session_info_local_nonprim) { + OpenAPI_redundant_pdu_session_information_free(redundant_pdu_session_info_local_nonprim); + redundant_pdu_session_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_management_data.c b/lib/sbi/openapi/model/pdu_session_management_data.c index d87a01c00..a6854eea1 100644 --- a/lib/sbi/openapi/model/pdu_session_management_data.c +++ b/lib/sbi/openapi/model/pdu_session_management_data.c @@ -46,37 +46,75 @@ OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_creat void OpenAPI_pdu_session_management_data_free(OpenAPI_pdu_session_management_data_t *pdu_session_management_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_management_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_pdu_session_status_free(pdu_session_management_data->pdu_session_status); - ogs_free(pdu_session_management_data->pdu_session_status_ts); - ogs_free(pdu_session_management_data->dnai); - ogs_free(pdu_session_management_data->dnai_ts); - OpenAPI_list_for_each(pdu_session_management_data->n6_traffic_routing_info, node) { - OpenAPI_route_to_location_free(node->data); + if (pdu_session_management_data->pdu_session_status) { + OpenAPI_pdu_session_status_free(pdu_session_management_data->pdu_session_status); + pdu_session_management_data->pdu_session_status = NULL; } - OpenAPI_list_free(pdu_session_management_data->n6_traffic_routing_info); - ogs_free(pdu_session_management_data->n6_traffic_routing_info_ts); - ogs_free(pdu_session_management_data->ipv4_addr); - OpenAPI_list_for_each(pdu_session_management_data->ipv6_prefix, node) { - ogs_free(node->data); + if (pdu_session_management_data->pdu_session_status_ts) { + ogs_free(pdu_session_management_data->pdu_session_status_ts); + pdu_session_management_data->pdu_session_status_ts = NULL; } - OpenAPI_list_free(pdu_session_management_data->ipv6_prefix); - OpenAPI_list_for_each(pdu_session_management_data->ipv6_addrs, node) { - ogs_free(node->data); + if (pdu_session_management_data->dnai) { + ogs_free(pdu_session_management_data->dnai); + pdu_session_management_data->dnai = NULL; + } + if (pdu_session_management_data->dnai_ts) { + ogs_free(pdu_session_management_data->dnai_ts); + pdu_session_management_data->dnai_ts = NULL; + } + if (pdu_session_management_data->n6_traffic_routing_info) { + OpenAPI_list_for_each(pdu_session_management_data->n6_traffic_routing_info, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(pdu_session_management_data->n6_traffic_routing_info); + pdu_session_management_data->n6_traffic_routing_info = NULL; + } + if (pdu_session_management_data->n6_traffic_routing_info_ts) { + ogs_free(pdu_session_management_data->n6_traffic_routing_info_ts); + pdu_session_management_data->n6_traffic_routing_info_ts = NULL; + } + if (pdu_session_management_data->ipv4_addr) { + ogs_free(pdu_session_management_data->ipv4_addr); + pdu_session_management_data->ipv4_addr = NULL; + } + if (pdu_session_management_data->ipv6_prefix) { + OpenAPI_list_for_each(pdu_session_management_data->ipv6_prefix, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_session_management_data->ipv6_prefix); + pdu_session_management_data->ipv6_prefix = NULL; + } + if (pdu_session_management_data->ipv6_addrs) { + OpenAPI_list_for_each(pdu_session_management_data->ipv6_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_session_management_data->ipv6_addrs); + pdu_session_management_data->ipv6_addrs = NULL; + } + if (pdu_session_management_data->ip_addr_ts) { + ogs_free(pdu_session_management_data->ip_addr_ts); + pdu_session_management_data->ip_addr_ts = NULL; + } + if (pdu_session_management_data->dnn) { + ogs_free(pdu_session_management_data->dnn); + pdu_session_management_data->dnn = NULL; + } + if (pdu_session_management_data->supp_feat) { + ogs_free(pdu_session_management_data->supp_feat); + pdu_session_management_data->supp_feat = NULL; } - OpenAPI_list_free(pdu_session_management_data->ipv6_addrs); - ogs_free(pdu_session_management_data->ip_addr_ts); - ogs_free(pdu_session_management_data->dnn); - ogs_free(pdu_session_management_data->supp_feat); ogs_free(pdu_session_management_data); } cJSON *OpenAPI_pdu_session_management_data_convertToJSON(OpenAPI_pdu_session_management_data_t *pdu_session_management_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_management_data == NULL) { ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [PduSessionManagementData]"); @@ -124,17 +162,13 @@ cJSON *OpenAPI_pdu_session_management_data_convertToJSON(OpenAPI_pdu_session_man ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [n6_traffic_routing_info]"); goto end; } - - OpenAPI_lnode_t *n6_traffic_routing_info_node; - if (pdu_session_management_data->n6_traffic_routing_info) { - OpenAPI_list_for_each(pdu_session_management_data->n6_traffic_routing_info, n6_traffic_routing_info_node) { - cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(n6_traffic_routing_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [n6_traffic_routing_info]"); - goto end; - } - cJSON_AddItemToArray(n6_traffic_routing_infoList, itemLocal); + OpenAPI_list_for_each(pdu_session_management_data->n6_traffic_routing_info, node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [n6_traffic_routing_info]"); + goto end; } + cJSON_AddItemToArray(n6_traffic_routing_infoList, itemLocal); } } @@ -153,38 +187,34 @@ cJSON *OpenAPI_pdu_session_management_data_convertToJSON(OpenAPI_pdu_session_man } if (pdu_session_management_data->ipv6_prefix) { - cJSON *ipv6_prefix = cJSON_AddArrayToObject(item, "ipv6Prefix"); - if (ipv6_prefix == NULL) { + cJSON *ipv6_prefixList = cJSON_AddArrayToObject(item, "ipv6Prefix"); + if (ipv6_prefixList == NULL) { ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_prefix]"); goto end; } - - OpenAPI_lnode_t *ipv6_prefix_node; - OpenAPI_list_for_each(pdu_session_management_data->ipv6_prefix, ipv6_prefix_node) { - if (cJSON_AddStringToObject(ipv6_prefix, "", (char*)ipv6_prefix_node->data) == NULL) { - ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_prefix]"); - goto end; + OpenAPI_list_for_each(pdu_session_management_data->ipv6_prefix, node) { + if (cJSON_AddStringToObject(ipv6_prefixList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_prefix]"); + goto end; + } } - } } if (pdu_session_management_data->ipv6_addrs) { - cJSON *ipv6_addrs = cJSON_AddArrayToObject(item, "ipv6Addrs"); - if (ipv6_addrs == NULL) { + cJSON *ipv6_addrsList = cJSON_AddArrayToObject(item, "ipv6Addrs"); + if (ipv6_addrsList == NULL) { ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_addrs]"); goto end; } - - OpenAPI_lnode_t *ipv6_addrs_node; - OpenAPI_list_for_each(pdu_session_management_data->ipv6_addrs, ipv6_addrs_node) { - if (cJSON_AddStringToObject(ipv6_addrs, "", (char*)ipv6_addrs_node->data) == NULL) { - ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_addrs]"); - goto end; + OpenAPI_list_for_each(pdu_session_management_data->ipv6_addrs, node) { + if (cJSON_AddStringToObject(ipv6_addrsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [ipv6_addrs]"); + goto end; + } } - } } - if (pdu_session_management_data->pdu_sess_type) { + if (pdu_session_management_data->pdu_sess_type != OpenAPI_pdu_session_type_NULL) { if (cJSON_AddStringToObject(item, "pduSessType", OpenAPI_pdu_session_type_ToString(pdu_session_management_data->pdu_sess_type)) == NULL) { ogs_error("OpenAPI_pdu_session_management_data_convertToJSON() failed [pdu_sess_type]"); goto end; @@ -226,130 +256,139 @@ end: OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_parseFromJSON(cJSON *pdu_session_management_dataJSON) { OpenAPI_pdu_session_management_data_t *pdu_session_management_data_local_var = NULL; - cJSON *pdu_session_status = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionStatus"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_status = NULL; OpenAPI_pdu_session_status_t *pdu_session_status_local_nonprim = NULL; + cJSON *pdu_session_status_ts = NULL; + cJSON *dnai = NULL; + cJSON *dnai_ts = NULL; + cJSON *n6_traffic_routing_info = NULL; + OpenAPI_list_t *n6_traffic_routing_infoList = NULL; + cJSON *n6_traffic_routing_info_ts = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ipv6_prefix = NULL; + OpenAPI_list_t *ipv6_prefixList = NULL; + cJSON *ipv6_addrs = NULL; + OpenAPI_list_t *ipv6_addrsList = NULL; + cJSON *pdu_sess_type = NULL; + OpenAPI_pdu_session_type_e pdu_sess_typeVariable = 0; + cJSON *ip_addr_ts = NULL; + cJSON *dnn = NULL; + cJSON *pdu_session_id = NULL; + cJSON *supp_feat = NULL; + pdu_session_status = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionStatus"); if (pdu_session_status) { pdu_session_status_local_nonprim = OpenAPI_pdu_session_status_parseFromJSON(pdu_session_status); } - cJSON *pdu_session_status_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionStatusTs"); - + pdu_session_status_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionStatusTs"); if (pdu_session_status_ts) { - if (!cJSON_IsString(pdu_session_status_ts)) { + if (!cJSON_IsString(pdu_session_status_ts) && !cJSON_IsNull(pdu_session_status_ts)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [pdu_session_status_ts]"); goto end; } } - cJSON *dnai = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnai"); - + dnai = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnai"); if (dnai) { - if (!cJSON_IsString(dnai)) { + if (!cJSON_IsString(dnai) && !cJSON_IsNull(dnai)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [dnai]"); goto end; } } - cJSON *dnai_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnaiTs"); - + dnai_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnaiTs"); if (dnai_ts) { - if (!cJSON_IsString(dnai_ts)) { + if (!cJSON_IsString(dnai_ts) && !cJSON_IsNull(dnai_ts)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [dnai_ts]"); goto end; } } - cJSON *n6_traffic_routing_info = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "n6TrafficRoutingInfo"); - - OpenAPI_list_t *n6_traffic_routing_infoList; + n6_traffic_routing_info = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "n6TrafficRoutingInfo"); if (n6_traffic_routing_info) { - cJSON *n6_traffic_routing_info_local_nonprimitive; - if (!cJSON_IsArray(n6_traffic_routing_info)){ - ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [n6_traffic_routing_info]"); - goto end; - } - - n6_traffic_routing_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(n6_traffic_routing_info_local_nonprimitive, n6_traffic_routing_info ) { - if (!cJSON_IsObject(n6_traffic_routing_info_local_nonprimitive)) { + cJSON *n6_traffic_routing_info_local = NULL; + if (!cJSON_IsArray(n6_traffic_routing_info)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [n6_traffic_routing_info]"); goto end; } - OpenAPI_route_to_location_t *n6_traffic_routing_infoItem = OpenAPI_route_to_location_parseFromJSON(n6_traffic_routing_info_local_nonprimitive); - if (!n6_traffic_routing_infoItem) { - ogs_error("No n6_traffic_routing_infoItem"); - OpenAPI_list_free(n6_traffic_routing_infoList); - goto end; + n6_traffic_routing_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(n6_traffic_routing_info_local, n6_traffic_routing_info) { + if (!cJSON_IsObject(n6_traffic_routing_info_local)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [n6_traffic_routing_info]"); + goto end; + } + OpenAPI_route_to_location_t *n6_traffic_routing_infoItem = OpenAPI_route_to_location_parseFromJSON(n6_traffic_routing_info_local); + if (!n6_traffic_routing_infoItem) { + ogs_error("No n6_traffic_routing_infoItem"); + OpenAPI_list_free(n6_traffic_routing_infoList); + goto end; + } + OpenAPI_list_add(n6_traffic_routing_infoList, n6_traffic_routing_infoItem); } - - OpenAPI_list_add(n6_traffic_routing_infoList, n6_traffic_routing_infoItem); - } } - cJSON *n6_traffic_routing_info_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "n6TrafficRoutingInfoTs"); - + n6_traffic_routing_info_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "n6TrafficRoutingInfoTs"); if (n6_traffic_routing_info_ts) { - if (!cJSON_IsString(n6_traffic_routing_info_ts)) { + if (!cJSON_IsString(n6_traffic_routing_info_ts) && !cJSON_IsNull(n6_traffic_routing_info_ts)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [n6_traffic_routing_info_ts]"); goto end; } } - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv4Addr"); - + ipv4_addr = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv6Prefix"); - - OpenAPI_list_t *ipv6_prefixList; + ipv6_prefix = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv6Prefix"); if (ipv6_prefix) { - cJSON *ipv6_prefix_local; - if (!cJSON_IsArray(ipv6_prefix)) { - ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_prefix]"); - goto end; - } - ipv6_prefixList = OpenAPI_list_create(); + cJSON *ipv6_prefix_local = NULL; + if (!cJSON_IsArray(ipv6_prefix)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_prefix]"); + goto end; + } - cJSON_ArrayForEach(ipv6_prefix_local, ipv6_prefix) { - if (!cJSON_IsString(ipv6_prefix_local)) { - ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_prefix]"); - goto end; - } - OpenAPI_list_add(ipv6_prefixList, ogs_strdup(ipv6_prefix_local->valuestring)); - } + ipv6_prefixList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_prefix_local, ipv6_prefix) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_prefix_local)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_prefix]"); + goto end; + } + OpenAPI_list_add(ipv6_prefixList, ogs_strdup(ipv6_prefix_local->valuestring)); + } } - cJSON *ipv6_addrs = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv6Addrs"); - - OpenAPI_list_t *ipv6_addrsList; + ipv6_addrs = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipv6Addrs"); if (ipv6_addrs) { - cJSON *ipv6_addrs_local; - if (!cJSON_IsArray(ipv6_addrs)) { - ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_addrs]"); - goto end; - } - ipv6_addrsList = OpenAPI_list_create(); + cJSON *ipv6_addrs_local = NULL; + if (!cJSON_IsArray(ipv6_addrs)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_addrs]"); + goto end; + } - cJSON_ArrayForEach(ipv6_addrs_local, ipv6_addrs) { - if (!cJSON_IsString(ipv6_addrs_local)) { - ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_addrs]"); - goto end; - } - OpenAPI_list_add(ipv6_addrsList, ogs_strdup(ipv6_addrs_local->valuestring)); - } + ipv6_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_addrs_local, ipv6_addrs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_addrs_local)) { + ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ipv6_addrs]"); + goto end; + } + OpenAPI_list_add(ipv6_addrsList, ogs_strdup(ipv6_addrs_local->valuestring)); + } } - cJSON *pdu_sess_type = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessType"); - - OpenAPI_pdu_session_type_e pdu_sess_typeVariable; + pdu_sess_type = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessType"); if (pdu_sess_type) { if (!cJSON_IsString(pdu_sess_type)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [pdu_sess_type]"); @@ -358,26 +397,23 @@ OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_parse pdu_sess_typeVariable = OpenAPI_pdu_session_type_FromString(pdu_sess_type->valuestring); } - cJSON *ip_addr_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipAddrTs"); - + ip_addr_ts = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "ipAddrTs"); if (ip_addr_ts) { - if (!cJSON_IsString(ip_addr_ts)) { + if (!cJSON_IsString(ip_addr_ts) && !cJSON_IsNull(ip_addr_ts)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [ip_addr_ts]"); goto end; } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionId"); - + pdu_session_id = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "pduSessionId"); if (pdu_session_id) { if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [pdu_session_id]"); @@ -385,10 +421,9 @@ OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_parse } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(pdu_session_management_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_pdu_session_management_data_parseFromJSON() failed [supp_feat]"); goto end; } @@ -396,24 +431,49 @@ OpenAPI_pdu_session_management_data_t *OpenAPI_pdu_session_management_data_parse pdu_session_management_data_local_var = OpenAPI_pdu_session_management_data_create ( pdu_session_status ? pdu_session_status_local_nonprim : NULL, - pdu_session_status_ts ? ogs_strdup(pdu_session_status_ts->valuestring) : NULL, - dnai ? ogs_strdup(dnai->valuestring) : NULL, - dnai_ts ? ogs_strdup(dnai_ts->valuestring) : NULL, + pdu_session_status_ts && !cJSON_IsNull(pdu_session_status_ts) ? ogs_strdup(pdu_session_status_ts->valuestring) : NULL, + dnai && !cJSON_IsNull(dnai) ? ogs_strdup(dnai->valuestring) : NULL, + dnai_ts && !cJSON_IsNull(dnai_ts) ? ogs_strdup(dnai_ts->valuestring) : NULL, n6_traffic_routing_info ? n6_traffic_routing_infoList : NULL, - n6_traffic_routing_info_ts ? ogs_strdup(n6_traffic_routing_info_ts->valuestring) : NULL, - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, + n6_traffic_routing_info_ts && !cJSON_IsNull(n6_traffic_routing_info_ts) ? ogs_strdup(n6_traffic_routing_info_ts->valuestring) : NULL, + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, ipv6_prefix ? ipv6_prefixList : NULL, ipv6_addrs ? ipv6_addrsList : NULL, pdu_sess_type ? pdu_sess_typeVariable : 0, - ip_addr_ts ? ogs_strdup(ip_addr_ts->valuestring) : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + ip_addr_ts && !cJSON_IsNull(ip_addr_ts) ? ogs_strdup(ip_addr_ts->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, pdu_session_id ? true : false, pdu_session_id ? pdu_session_id->valuedouble : 0, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return pdu_session_management_data_local_var; end: + if (pdu_session_status_local_nonprim) { + OpenAPI_pdu_session_status_free(pdu_session_status_local_nonprim); + pdu_session_status_local_nonprim = NULL; + } + if (n6_traffic_routing_infoList) { + OpenAPI_list_for_each(n6_traffic_routing_infoList, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(n6_traffic_routing_infoList); + n6_traffic_routing_infoList = NULL; + } + if (ipv6_prefixList) { + OpenAPI_list_for_each(ipv6_prefixList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_prefixList); + ipv6_prefixList = NULL; + } + if (ipv6_addrsList) { + OpenAPI_list_for_each(ipv6_addrsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_addrsList); + ipv6_addrsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_notify_item.c b/lib/sbi/openapi/model/pdu_session_notify_item.c index 04f97c8d7..b95b57d35 100644 --- a/lib/sbi/openapi/model/pdu_session_notify_item.c +++ b/lib/sbi/openapi/model/pdu_session_notify_item.c @@ -18,16 +18,18 @@ OpenAPI_pdu_session_notify_item_t *OpenAPI_pdu_session_notify_item_create( void OpenAPI_pdu_session_notify_item_free(OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_notify_item) { return; } - OpenAPI_lnode_t *node; ogs_free(pdu_session_notify_item); } cJSON *OpenAPI_pdu_session_notify_item_convertToJSON(OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_notify_item == NULL) { ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed [PduSessionNotifyItem]"); @@ -35,6 +37,10 @@ cJSON *OpenAPI_pdu_session_notify_item_convertToJSON(OpenAPI_pdu_session_notify_ } item = cJSON_CreateObject(); + if (pdu_session_notify_item->notification_cause == OpenAPI_notification_cause_NULL) { + ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed [notification_cause]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationCause", OpenAPI_notification_cause_ToString(pdu_session_notify_item->notification_cause)) == NULL) { ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed [notification_cause]"); goto end; @@ -47,13 +53,14 @@ end: OpenAPI_pdu_session_notify_item_t *OpenAPI_pdu_session_notify_item_parseFromJSON(cJSON *pdu_session_notify_itemJSON) { OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item_local_var = NULL; - cJSON *notification_cause = cJSON_GetObjectItemCaseSensitive(pdu_session_notify_itemJSON, "notificationCause"); + OpenAPI_lnode_t *node = NULL; + cJSON *notification_cause = NULL; + OpenAPI_notification_cause_e notification_causeVariable = 0; + notification_cause = cJSON_GetObjectItemCaseSensitive(pdu_session_notify_itemJSON, "notificationCause"); if (!notification_cause) { ogs_error("OpenAPI_pdu_session_notify_item_parseFromJSON() failed [notification_cause]"); goto end; } - - OpenAPI_notification_cause_e notification_causeVariable; if (!cJSON_IsString(notification_cause)) { ogs_error("OpenAPI_pdu_session_notify_item_parseFromJSON() failed [notification_cause]"); goto end; diff --git a/lib/sbi/openapi/model/pdu_session_status.c b/lib/sbi/openapi/model/pdu_session_status.c index f15c13ea7..96832270d 100644 --- a/lib/sbi/openapi/model/pdu_session_status.c +++ b/lib/sbi/openapi/model/pdu_session_status.c @@ -16,16 +16,18 @@ OpenAPI_pdu_session_status_t *OpenAPI_pdu_session_status_create( void OpenAPI_pdu_session_status_free(OpenAPI_pdu_session_status_t *pdu_session_status) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_status) { return; } - OpenAPI_lnode_t *node; ogs_free(pdu_session_status); } cJSON *OpenAPI_pdu_session_status_convertToJSON(OpenAPI_pdu_session_status_t *pdu_session_status) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_status == NULL) { ogs_error("OpenAPI_pdu_session_status_convertToJSON() failed [PduSessionStatus]"); @@ -40,6 +42,7 @@ end: OpenAPI_pdu_session_status_t *OpenAPI_pdu_session_status_parseFromJSON(cJSON *pdu_session_statusJSON) { OpenAPI_pdu_session_status_t *pdu_session_status_local_var = NULL; + OpenAPI_lnode_t *node = NULL; pdu_session_status_local_var = OpenAPI_pdu_session_status_create ( ); diff --git a/lib/sbi/openapi/model/pdu_session_status_cfg.c b/lib/sbi/openapi/model/pdu_session_status_cfg.c index 895918f25..821d78b6e 100644 --- a/lib/sbi/openapi/model/pdu_session_status_cfg.c +++ b/lib/sbi/openapi/model/pdu_session_status_cfg.c @@ -18,17 +18,22 @@ OpenAPI_pdu_session_status_cfg_t *OpenAPI_pdu_session_status_cfg_create( void OpenAPI_pdu_session_status_cfg_free(OpenAPI_pdu_session_status_cfg_t *pdu_session_status_cfg) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_status_cfg) { return; } - OpenAPI_lnode_t *node; - ogs_free(pdu_session_status_cfg->dnn); + if (pdu_session_status_cfg->dnn) { + ogs_free(pdu_session_status_cfg->dnn); + pdu_session_status_cfg->dnn = NULL; + } ogs_free(pdu_session_status_cfg); } cJSON *OpenAPI_pdu_session_status_cfg_convertToJSON(OpenAPI_pdu_session_status_cfg_t *pdu_session_status_cfg) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_status_cfg == NULL) { ogs_error("OpenAPI_pdu_session_status_cfg_convertToJSON() failed [PduSessionStatusCfg]"); @@ -50,17 +55,18 @@ end: OpenAPI_pdu_session_status_cfg_t *OpenAPI_pdu_session_status_cfg_parseFromJSON(cJSON *pdu_session_status_cfgJSON) { OpenAPI_pdu_session_status_cfg_t *pdu_session_status_cfg_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_status_cfgJSON, "dnn"); - + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(pdu_session_status_cfgJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_pdu_session_status_cfg_parseFromJSON() failed [dnn]"); goto end; } } pdu_session_status_cfg_local_var = OpenAPI_pdu_session_status_cfg_create ( - dnn ? ogs_strdup(dnn->valuestring) : NULL + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL ); return pdu_session_status_cfg_local_var; diff --git a/lib/sbi/openapi/model/pdu_session_tsn_bridge.c b/lib/sbi/openapi/model/pdu_session_tsn_bridge.c index b00a42852..637050bc4 100644 --- a/lib/sbi/openapi/model/pdu_session_tsn_bridge.c +++ b/lib/sbi/openapi/model/pdu_session_tsn_bridge.c @@ -24,23 +24,37 @@ OpenAPI_pdu_session_tsn_bridge_t *OpenAPI_pdu_session_tsn_bridge_create( void OpenAPI_pdu_session_tsn_bridge_free(OpenAPI_pdu_session_tsn_bridge_t *pdu_session_tsn_bridge) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_tsn_bridge) { return; } - OpenAPI_lnode_t *node; - OpenAPI_tsn_bridge_info_free(pdu_session_tsn_bridge->tsn_bridge_info); - OpenAPI_bridge_management_container_free(pdu_session_tsn_bridge->tsn_bridge_man_cont); - OpenAPI_port_management_container_free(pdu_session_tsn_bridge->tsn_port_man_cont_dstt); - OpenAPI_list_for_each(pdu_session_tsn_bridge->tsn_port_man_cont_nwtts, node) { - OpenAPI_port_management_container_free(node->data); + if (pdu_session_tsn_bridge->tsn_bridge_info) { + OpenAPI_tsn_bridge_info_free(pdu_session_tsn_bridge->tsn_bridge_info); + pdu_session_tsn_bridge->tsn_bridge_info = NULL; + } + if (pdu_session_tsn_bridge->tsn_bridge_man_cont) { + OpenAPI_bridge_management_container_free(pdu_session_tsn_bridge->tsn_bridge_man_cont); + pdu_session_tsn_bridge->tsn_bridge_man_cont = NULL; + } + if (pdu_session_tsn_bridge->tsn_port_man_cont_dstt) { + OpenAPI_port_management_container_free(pdu_session_tsn_bridge->tsn_port_man_cont_dstt); + pdu_session_tsn_bridge->tsn_port_man_cont_dstt = NULL; + } + if (pdu_session_tsn_bridge->tsn_port_man_cont_nwtts) { + OpenAPI_list_for_each(pdu_session_tsn_bridge->tsn_port_man_cont_nwtts, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(pdu_session_tsn_bridge->tsn_port_man_cont_nwtts); + pdu_session_tsn_bridge->tsn_port_man_cont_nwtts = NULL; } - OpenAPI_list_free(pdu_session_tsn_bridge->tsn_port_man_cont_nwtts); ogs_free(pdu_session_tsn_bridge); } cJSON *OpenAPI_pdu_session_tsn_bridge_convertToJSON(OpenAPI_pdu_session_tsn_bridge_t *pdu_session_tsn_bridge) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_tsn_bridge == NULL) { ogs_error("OpenAPI_pdu_session_tsn_bridge_convertToJSON() failed [PduSessionTsnBridge]"); @@ -48,6 +62,10 @@ cJSON *OpenAPI_pdu_session_tsn_bridge_convertToJSON(OpenAPI_pdu_session_tsn_brid } item = cJSON_CreateObject(); + if (!pdu_session_tsn_bridge->tsn_bridge_info) { + ogs_error("OpenAPI_pdu_session_tsn_bridge_convertToJSON() failed [tsn_bridge_info]"); + return NULL; + } cJSON *tsn_bridge_info_local_JSON = OpenAPI_tsn_bridge_info_convertToJSON(pdu_session_tsn_bridge->tsn_bridge_info); if (tsn_bridge_info_local_JSON == NULL) { ogs_error("OpenAPI_pdu_session_tsn_bridge_convertToJSON() failed [tsn_bridge_info]"); @@ -91,17 +109,13 @@ cJSON *OpenAPI_pdu_session_tsn_bridge_convertToJSON(OpenAPI_pdu_session_tsn_brid ogs_error("OpenAPI_pdu_session_tsn_bridge_convertToJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - - OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node; - if (pdu_session_tsn_bridge->tsn_port_man_cont_nwtts) { - OpenAPI_list_for_each(pdu_session_tsn_bridge->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) { - cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pdu_session_tsn_bridge_convertToJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); + OpenAPI_list_for_each(pdu_session_tsn_bridge->tsn_port_man_cont_nwtts, node) { + cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pdu_session_tsn_bridge_convertToJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; } + cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); } } @@ -112,56 +126,55 @@ end: OpenAPI_pdu_session_tsn_bridge_t *OpenAPI_pdu_session_tsn_bridge_parseFromJSON(cJSON *pdu_session_tsn_bridgeJSON) { OpenAPI_pdu_session_tsn_bridge_t *pdu_session_tsn_bridge_local_var = NULL; - cJSON *tsn_bridge_info = cJSON_GetObjectItemCaseSensitive(pdu_session_tsn_bridgeJSON, "tsnBridgeInfo"); + OpenAPI_lnode_t *node = NULL; + cJSON *tsn_bridge_info = NULL; + OpenAPI_tsn_bridge_info_t *tsn_bridge_info_local_nonprim = NULL; + cJSON *tsn_bridge_man_cont = NULL; + OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + cJSON *tsn_port_man_cont_dstt = NULL; + OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + cJSON *tsn_port_man_cont_nwtts = NULL; + OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL; + tsn_bridge_info = cJSON_GetObjectItemCaseSensitive(pdu_session_tsn_bridgeJSON, "tsnBridgeInfo"); if (!tsn_bridge_info) { ogs_error("OpenAPI_pdu_session_tsn_bridge_parseFromJSON() failed [tsn_bridge_info]"); goto end; } - - OpenAPI_tsn_bridge_info_t *tsn_bridge_info_local_nonprim = NULL; tsn_bridge_info_local_nonprim = OpenAPI_tsn_bridge_info_parseFromJSON(tsn_bridge_info); - cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(pdu_session_tsn_bridgeJSON, "tsnBridgeManCont"); - - OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(pdu_session_tsn_bridgeJSON, "tsnBridgeManCont"); if (tsn_bridge_man_cont) { tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont); } - cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(pdu_session_tsn_bridgeJSON, "tsnPortManContDstt"); - - OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(pdu_session_tsn_bridgeJSON, "tsnPortManContDstt"); if (tsn_port_man_cont_dstt) { tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt); } - cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(pdu_session_tsn_bridgeJSON, "tsnPortManContNwtts"); - - OpenAPI_list_t *tsn_port_man_cont_nwttsList; + tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(pdu_session_tsn_bridgeJSON, "tsnPortManContNwtts"); if (tsn_port_man_cont_nwtts) { - cJSON *tsn_port_man_cont_nwtts_local_nonprimitive; - if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){ - ogs_error("OpenAPI_pdu_session_tsn_bridge_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - - tsn_port_man_cont_nwttsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) { - if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) { + cJSON *tsn_port_man_cont_nwtts_local = NULL; + if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) { ogs_error("OpenAPI_pdu_session_tsn_bridge_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive); - if (!tsn_port_man_cont_nwttsItem) { - ogs_error("No tsn_port_man_cont_nwttsItem"); - OpenAPI_list_free(tsn_port_man_cont_nwttsList); - goto end; + tsn_port_man_cont_nwttsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) { + if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) { + ogs_error("OpenAPI_pdu_session_tsn_bridge_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; + } + OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local); + if (!tsn_port_man_cont_nwttsItem) { + ogs_error("No tsn_port_man_cont_nwttsItem"); + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + goto end; + } + OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); } - - OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); - } } pdu_session_tsn_bridge_local_var = OpenAPI_pdu_session_tsn_bridge_create ( @@ -173,6 +186,25 @@ OpenAPI_pdu_session_tsn_bridge_t *OpenAPI_pdu_session_tsn_bridge_parseFromJSON(c return pdu_session_tsn_bridge_local_var; end: + if (tsn_bridge_info_local_nonprim) { + OpenAPI_tsn_bridge_info_free(tsn_bridge_info_local_nonprim); + tsn_bridge_info_local_nonprim = NULL; + } + if (tsn_bridge_man_cont_local_nonprim) { + OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim); + tsn_bridge_man_cont_local_nonprim = NULL; + } + if (tsn_port_man_cont_dstt_local_nonprim) { + OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim); + tsn_port_man_cont_dstt_local_nonprim = NULL; + } + if (tsn_port_man_cont_nwttsList) { + OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + tsn_port_man_cont_nwttsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_types.c b/lib/sbi/openapi/model/pdu_session_types.c index 14e129250..3fc80d6cc 100644 --- a/lib/sbi/openapi/model/pdu_session_types.c +++ b/lib/sbi/openapi/model/pdu_session_types.c @@ -20,17 +20,22 @@ OpenAPI_pdu_session_types_t *OpenAPI_pdu_session_types_create( void OpenAPI_pdu_session_types_free(OpenAPI_pdu_session_types_t *pdu_session_types) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_types) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(pdu_session_types->allowed_session_types); + if (pdu_session_types->allowed_session_types) { + OpenAPI_list_free(pdu_session_types->allowed_session_types); + pdu_session_types->allowed_session_types = NULL; + } ogs_free(pdu_session_types); } cJSON *OpenAPI_pdu_session_types_convertToJSON(OpenAPI_pdu_session_types_t *pdu_session_types) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_types == NULL) { ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [PduSessionTypes]"); @@ -38,20 +43,23 @@ cJSON *OpenAPI_pdu_session_types_convertToJSON(OpenAPI_pdu_session_types_t *pdu_ } item = cJSON_CreateObject(); + if (pdu_session_types->default_session_type == OpenAPI_pdu_session_type_NULL) { + ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [default_session_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "defaultSessionType", OpenAPI_pdu_session_type_ToString(pdu_session_types->default_session_type)) == NULL) { ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [default_session_type]"); goto end; } - if (pdu_session_types->allowed_session_types) { - cJSON *allowed_session_types = cJSON_AddArrayToObject(item, "allowedSessionTypes"); - if (allowed_session_types == NULL) { + if (pdu_session_types->allowed_session_types != OpenAPI_pdu_session_type_NULL) { + cJSON *allowed_session_typesList = cJSON_AddArrayToObject(item, "allowedSessionTypes"); + if (allowed_session_typesList == NULL) { ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [allowed_session_types]"); goto end; } - OpenAPI_lnode_t *allowed_session_types_node; - OpenAPI_list_for_each(pdu_session_types->allowed_session_types, allowed_session_types_node) { - if (cJSON_AddStringToObject(allowed_session_types, "", OpenAPI_pdu_session_type_ToString((intptr_t)allowed_session_types_node->data)) == NULL) { + OpenAPI_list_for_each(pdu_session_types->allowed_session_types, node) { + if (cJSON_AddStringToObject(allowed_session_typesList, "", OpenAPI_pdu_session_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_pdu_session_types_convertToJSON() failed [allowed_session_types]"); goto end; } @@ -65,39 +73,39 @@ end: OpenAPI_pdu_session_types_t *OpenAPI_pdu_session_types_parseFromJSON(cJSON *pdu_session_typesJSON) { OpenAPI_pdu_session_types_t *pdu_session_types_local_var = NULL; - cJSON *default_session_type = cJSON_GetObjectItemCaseSensitive(pdu_session_typesJSON, "defaultSessionType"); + OpenAPI_lnode_t *node = NULL; + cJSON *default_session_type = NULL; + OpenAPI_pdu_session_type_e default_session_typeVariable = 0; + cJSON *allowed_session_types = NULL; + OpenAPI_list_t *allowed_session_typesList = NULL; + default_session_type = cJSON_GetObjectItemCaseSensitive(pdu_session_typesJSON, "defaultSessionType"); if (!default_session_type) { ogs_error("OpenAPI_pdu_session_types_parseFromJSON() failed [default_session_type]"); goto end; } - - OpenAPI_pdu_session_type_e default_session_typeVariable; if (!cJSON_IsString(default_session_type)) { ogs_error("OpenAPI_pdu_session_types_parseFromJSON() failed [default_session_type]"); goto end; } default_session_typeVariable = OpenAPI_pdu_session_type_FromString(default_session_type->valuestring); - cJSON *allowed_session_types = cJSON_GetObjectItemCaseSensitive(pdu_session_typesJSON, "allowedSessionTypes"); - - OpenAPI_list_t *allowed_session_typesList; + allowed_session_types = cJSON_GetObjectItemCaseSensitive(pdu_session_typesJSON, "allowedSessionTypes"); if (allowed_session_types) { - cJSON *allowed_session_types_local_nonprimitive; - if (!cJSON_IsArray(allowed_session_types)) { - ogs_error("OpenAPI_pdu_session_types_parseFromJSON() failed [allowed_session_types]"); - goto end; - } - - allowed_session_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_session_types_local_nonprimitive, allowed_session_types ) { - if (!cJSON_IsString(allowed_session_types_local_nonprimitive)){ + cJSON *allowed_session_types_local = NULL; + if (!cJSON_IsArray(allowed_session_types)) { ogs_error("OpenAPI_pdu_session_types_parseFromJSON() failed [allowed_session_types]"); goto end; } - OpenAPI_list_add(allowed_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(allowed_session_types_local_nonprimitive->valuestring)); - } + allowed_session_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_session_types_local, allowed_session_types) { + if (!cJSON_IsString(allowed_session_types_local)) { + ogs_error("OpenAPI_pdu_session_types_parseFromJSON() failed [allowed_session_types]"); + goto end; + } + OpenAPI_list_add(allowed_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(allowed_session_types_local->valuestring)); + } } pdu_session_types_local_var = OpenAPI_pdu_session_types_create ( @@ -107,6 +115,10 @@ OpenAPI_pdu_session_types_t *OpenAPI_pdu_session_types_parseFromJSON(cJSON *pdu_ return pdu_session_types_local_var; end: + if (allowed_session_typesList) { + OpenAPI_list_free(allowed_session_typesList); + allowed_session_typesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pdu_session_types_1.c b/lib/sbi/openapi/model/pdu_session_types_1.c index 8d1eb5815..0658aa721 100644 --- a/lib/sbi/openapi/model/pdu_session_types_1.c +++ b/lib/sbi/openapi/model/pdu_session_types_1.c @@ -20,17 +20,22 @@ OpenAPI_pdu_session_types_1_t *OpenAPI_pdu_session_types_1_create( void OpenAPI_pdu_session_types_1_free(OpenAPI_pdu_session_types_1_t *pdu_session_types_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pdu_session_types_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(pdu_session_types_1->allowed_session_types); + if (pdu_session_types_1->allowed_session_types) { + OpenAPI_list_free(pdu_session_types_1->allowed_session_types); + pdu_session_types_1->allowed_session_types = NULL; + } ogs_free(pdu_session_types_1); } cJSON *OpenAPI_pdu_session_types_1_convertToJSON(OpenAPI_pdu_session_types_1_t *pdu_session_types_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pdu_session_types_1 == NULL) { ogs_error("OpenAPI_pdu_session_types_1_convertToJSON() failed [PduSessionTypes_1]"); @@ -38,20 +43,23 @@ cJSON *OpenAPI_pdu_session_types_1_convertToJSON(OpenAPI_pdu_session_types_1_t * } item = cJSON_CreateObject(); + if (pdu_session_types_1->default_session_type == OpenAPI_pdu_session_type_NULL) { + ogs_error("OpenAPI_pdu_session_types_1_convertToJSON() failed [default_session_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "defaultSessionType", OpenAPI_pdu_session_type_ToString(pdu_session_types_1->default_session_type)) == NULL) { ogs_error("OpenAPI_pdu_session_types_1_convertToJSON() failed [default_session_type]"); goto end; } - if (pdu_session_types_1->allowed_session_types) { - cJSON *allowed_session_types = cJSON_AddArrayToObject(item, "allowedSessionTypes"); - if (allowed_session_types == NULL) { + if (pdu_session_types_1->allowed_session_types != OpenAPI_pdu_session_type_NULL) { + cJSON *allowed_session_typesList = cJSON_AddArrayToObject(item, "allowedSessionTypes"); + if (allowed_session_typesList == NULL) { ogs_error("OpenAPI_pdu_session_types_1_convertToJSON() failed [allowed_session_types]"); goto end; } - OpenAPI_lnode_t *allowed_session_types_node; - OpenAPI_list_for_each(pdu_session_types_1->allowed_session_types, allowed_session_types_node) { - if (cJSON_AddStringToObject(allowed_session_types, "", OpenAPI_pdu_session_type_ToString((intptr_t)allowed_session_types_node->data)) == NULL) { + OpenAPI_list_for_each(pdu_session_types_1->allowed_session_types, node) { + if (cJSON_AddStringToObject(allowed_session_typesList, "", OpenAPI_pdu_session_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_pdu_session_types_1_convertToJSON() failed [allowed_session_types]"); goto end; } @@ -65,39 +73,39 @@ end: OpenAPI_pdu_session_types_1_t *OpenAPI_pdu_session_types_1_parseFromJSON(cJSON *pdu_session_types_1JSON) { OpenAPI_pdu_session_types_1_t *pdu_session_types_1_local_var = NULL; - cJSON *default_session_type = cJSON_GetObjectItemCaseSensitive(pdu_session_types_1JSON, "defaultSessionType"); + OpenAPI_lnode_t *node = NULL; + cJSON *default_session_type = NULL; + OpenAPI_pdu_session_type_e default_session_typeVariable = 0; + cJSON *allowed_session_types = NULL; + OpenAPI_list_t *allowed_session_typesList = NULL; + default_session_type = cJSON_GetObjectItemCaseSensitive(pdu_session_types_1JSON, "defaultSessionType"); if (!default_session_type) { ogs_error("OpenAPI_pdu_session_types_1_parseFromJSON() failed [default_session_type]"); goto end; } - - OpenAPI_pdu_session_type_e default_session_typeVariable; if (!cJSON_IsString(default_session_type)) { ogs_error("OpenAPI_pdu_session_types_1_parseFromJSON() failed [default_session_type]"); goto end; } default_session_typeVariable = OpenAPI_pdu_session_type_FromString(default_session_type->valuestring); - cJSON *allowed_session_types = cJSON_GetObjectItemCaseSensitive(pdu_session_types_1JSON, "allowedSessionTypes"); - - OpenAPI_list_t *allowed_session_typesList; + allowed_session_types = cJSON_GetObjectItemCaseSensitive(pdu_session_types_1JSON, "allowedSessionTypes"); if (allowed_session_types) { - cJSON *allowed_session_types_local_nonprimitive; - if (!cJSON_IsArray(allowed_session_types)) { - ogs_error("OpenAPI_pdu_session_types_1_parseFromJSON() failed [allowed_session_types]"); - goto end; - } - - allowed_session_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_session_types_local_nonprimitive, allowed_session_types ) { - if (!cJSON_IsString(allowed_session_types_local_nonprimitive)){ + cJSON *allowed_session_types_local = NULL; + if (!cJSON_IsArray(allowed_session_types)) { ogs_error("OpenAPI_pdu_session_types_1_parseFromJSON() failed [allowed_session_types]"); goto end; } - OpenAPI_list_add(allowed_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(allowed_session_types_local_nonprimitive->valuestring)); - } + allowed_session_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_session_types_local, allowed_session_types) { + if (!cJSON_IsString(allowed_session_types_local)) { + ogs_error("OpenAPI_pdu_session_types_1_parseFromJSON() failed [allowed_session_types]"); + goto end; + } + OpenAPI_list_add(allowed_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(allowed_session_types_local->valuestring)); + } } pdu_session_types_1_local_var = OpenAPI_pdu_session_types_1_create ( @@ -107,6 +115,10 @@ OpenAPI_pdu_session_types_1_t *OpenAPI_pdu_session_types_1_parseFromJSON(cJSON * return pdu_session_types_1_local_var; end: + if (allowed_session_typesList) { + OpenAPI_list_free(allowed_session_typesList); + allowed_session_typesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pei_update_info.c b/lib/sbi/openapi/model/pei_update_info.c index 339a1db83..69ab3727c 100644 --- a/lib/sbi/openapi/model/pei_update_info.c +++ b/lib/sbi/openapi/model/pei_update_info.c @@ -18,17 +18,22 @@ OpenAPI_pei_update_info_t *OpenAPI_pei_update_info_create( void OpenAPI_pei_update_info_free(OpenAPI_pei_update_info_t *pei_update_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pei_update_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(pei_update_info->pei); + if (pei_update_info->pei) { + ogs_free(pei_update_info->pei); + pei_update_info->pei = NULL; + } ogs_free(pei_update_info); } cJSON *OpenAPI_pei_update_info_convertToJSON(OpenAPI_pei_update_info_t *pei_update_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pei_update_info == NULL) { ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [PeiUpdateInfo]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_pei_update_info_convertToJSON(OpenAPI_pei_update_info_t *pei_upda } item = cJSON_CreateObject(); + if (!pei_update_info->pei) { + ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [pei]"); + return NULL; + } if (cJSON_AddStringToObject(item, "pei", pei_update_info->pei) == NULL) { ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [pei]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_pei_update_info_t *OpenAPI_pei_update_info_parseFromJSON(cJSON *pei_update_infoJSON) { OpenAPI_pei_update_info_t *pei_update_info_local_var = NULL; - cJSON *pei = cJSON_GetObjectItemCaseSensitive(pei_update_infoJSON, "pei"); + OpenAPI_lnode_t *node = NULL; + cJSON *pei = NULL; + pei = cJSON_GetObjectItemCaseSensitive(pei_update_infoJSON, "pei"); if (!pei) { ogs_error("OpenAPI_pei_update_info_parseFromJSON() failed [pei]"); goto end; } - if (!cJSON_IsString(pei)) { ogs_error("OpenAPI_pei_update_info_parseFromJSON() failed [pei]"); goto end; diff --git a/lib/sbi/openapi/model/periodicity.c b/lib/sbi/openapi/model/periodicity.c index 5af84a287..6305441aa 100644 --- a/lib/sbi/openapi/model/periodicity.c +++ b/lib/sbi/openapi/model/periodicity.c @@ -16,16 +16,18 @@ OpenAPI_periodicity_t *OpenAPI_periodicity_create( void OpenAPI_periodicity_free(OpenAPI_periodicity_t *periodicity) { + OpenAPI_lnode_t *node = NULL; + if (NULL == periodicity) { return; } - OpenAPI_lnode_t *node; ogs_free(periodicity); } cJSON *OpenAPI_periodicity_convertToJSON(OpenAPI_periodicity_t *periodicity) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (periodicity == NULL) { ogs_error("OpenAPI_periodicity_convertToJSON() failed [Periodicity]"); @@ -40,6 +42,7 @@ end: OpenAPI_periodicity_t *OpenAPI_periodicity_parseFromJSON(cJSON *periodicityJSON) { OpenAPI_periodicity_t *periodicity_local_var = NULL; + OpenAPI_lnode_t *node = NULL; periodicity_local_var = OpenAPI_periodicity_create ( ); diff --git a/lib/sbi/openapi/model/pfd_change_notification.c b/lib/sbi/openapi/model/pfd_change_notification.c index 9c904f61d..c5a79b205 100644 --- a/lib/sbi/openapi/model/pfd_change_notification.c +++ b/lib/sbi/openapi/model/pfd_change_notification.c @@ -28,21 +28,29 @@ OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_create( void OpenAPI_pfd_change_notification_free(OpenAPI_pfd_change_notification_t *pfd_change_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pfd_change_notification) { return; } - OpenAPI_lnode_t *node; - ogs_free(pfd_change_notification->application_id); - OpenAPI_list_for_each(pfd_change_notification->pfds, node) { - OpenAPI_pfd_content_free(node->data); + if (pfd_change_notification->application_id) { + ogs_free(pfd_change_notification->application_id); + pfd_change_notification->application_id = NULL; + } + if (pfd_change_notification->pfds) { + OpenAPI_list_for_each(pfd_change_notification->pfds, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfd_change_notification->pfds); + pfd_change_notification->pfds = NULL; } - OpenAPI_list_free(pfd_change_notification->pfds); ogs_free(pfd_change_notification); } cJSON *OpenAPI_pfd_change_notification_convertToJSON(OpenAPI_pfd_change_notification_t *pfd_change_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pfd_change_notification == NULL) { ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [PfdChangeNotification]"); @@ -50,6 +58,10 @@ cJSON *OpenAPI_pfd_change_notification_convertToJSON(OpenAPI_pfd_change_notifica } item = cJSON_CreateObject(); + if (!pfd_change_notification->application_id) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [application_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "applicationId", pfd_change_notification->application_id) == NULL) { ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [application_id]"); goto end; @@ -75,17 +87,13 @@ cJSON *OpenAPI_pfd_change_notification_convertToJSON(OpenAPI_pfd_change_notifica ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [pfds]"); goto end; } - - OpenAPI_lnode_t *pfds_node; - if (pfd_change_notification->pfds) { - OpenAPI_list_for_each(pfd_change_notification->pfds, pfds_node) { - cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(pfds_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [pfds]"); - goto end; - } - cJSON_AddItemToArray(pfdsList, itemLocal); + OpenAPI_list_for_each(pfd_change_notification->pfds, node) { + cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pfd_change_notification_convertToJSON() failed [pfds]"); + goto end; } + cJSON_AddItemToArray(pfdsList, itemLocal); } } @@ -96,19 +104,23 @@ end: OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_parseFromJSON(cJSON *pfd_change_notificationJSON) { OpenAPI_pfd_change_notification_t *pfd_change_notification_local_var = NULL; - cJSON *application_id = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "applicationId"); + OpenAPI_lnode_t *node = NULL; + cJSON *application_id = NULL; + cJSON *removal_flag = NULL; + cJSON *partial_flag = NULL; + cJSON *pfds = NULL; + OpenAPI_list_t *pfdsList = NULL; + application_id = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "applicationId"); if (!application_id) { ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [application_id]"); goto end; } - if (!cJSON_IsString(application_id)) { ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [application_id]"); goto end; } - cJSON *removal_flag = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "removalFlag"); - + removal_flag = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "removalFlag"); if (removal_flag) { if (!cJSON_IsBool(removal_flag)) { ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [removal_flag]"); @@ -116,8 +128,7 @@ OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_parseFromJSON } } - cJSON *partial_flag = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "partialFlag"); - + partial_flag = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "partialFlag"); if (partial_flag) { if (!cJSON_IsBool(partial_flag)) { ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [partial_flag]"); @@ -125,33 +136,29 @@ OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_parseFromJSON } } - cJSON *pfds = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "pfds"); - - OpenAPI_list_t *pfdsList; + pfds = cJSON_GetObjectItemCaseSensitive(pfd_change_notificationJSON, "pfds"); if (pfds) { - cJSON *pfds_local_nonprimitive; - if (!cJSON_IsArray(pfds)){ - ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [pfds]"); - goto end; - } - - pfdsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pfds_local_nonprimitive, pfds ) { - if (!cJSON_IsObject(pfds_local_nonprimitive)) { + cJSON *pfds_local = NULL; + if (!cJSON_IsArray(pfds)) { ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [pfds]"); goto end; } - OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local_nonprimitive); - if (!pfdsItem) { - ogs_error("No pfdsItem"); - OpenAPI_list_free(pfdsList); - goto end; + pfdsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pfds_local, pfds) { + if (!cJSON_IsObject(pfds_local)) { + ogs_error("OpenAPI_pfd_change_notification_parseFromJSON() failed [pfds]"); + goto end; + } + OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local); + if (!pfdsItem) { + ogs_error("No pfdsItem"); + OpenAPI_list_free(pfdsList); + goto end; + } + OpenAPI_list_add(pfdsList, pfdsItem); } - - OpenAPI_list_add(pfdsList, pfdsItem); - } } pfd_change_notification_local_var = OpenAPI_pfd_change_notification_create ( @@ -165,6 +172,13 @@ OpenAPI_pfd_change_notification_t *OpenAPI_pfd_change_notification_parseFromJSON return pfd_change_notification_local_var; end: + if (pfdsList) { + OpenAPI_list_for_each(pfdsList, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfdsList); + pfdsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pfd_content.c b/lib/sbi/openapi/model/pfd_content.c index d3092a2c7..84fb3ba5a 100644 --- a/lib/sbi/openapi/model/pfd_content.c +++ b/lib/sbi/openapi/model/pfd_content.c @@ -26,30 +26,47 @@ OpenAPI_pfd_content_t *OpenAPI_pfd_content_create( void OpenAPI_pfd_content_free(OpenAPI_pfd_content_t *pfd_content) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pfd_content) { return; } - OpenAPI_lnode_t *node; - ogs_free(pfd_content->pfd_id); - OpenAPI_list_for_each(pfd_content->flow_descriptions, node) { - ogs_free(node->data); + if (pfd_content->pfd_id) { + ogs_free(pfd_content->pfd_id); + pfd_content->pfd_id = NULL; } - OpenAPI_list_free(pfd_content->flow_descriptions); - OpenAPI_list_for_each(pfd_content->urls, node) { - ogs_free(node->data); + if (pfd_content->flow_descriptions) { + OpenAPI_list_for_each(pfd_content->flow_descriptions, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_content->flow_descriptions); + pfd_content->flow_descriptions = NULL; } - OpenAPI_list_free(pfd_content->urls); - OpenAPI_list_for_each(pfd_content->domain_names, node) { - ogs_free(node->data); + if (pfd_content->urls) { + OpenAPI_list_for_each(pfd_content->urls, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_content->urls); + pfd_content->urls = NULL; + } + if (pfd_content->domain_names) { + OpenAPI_list_for_each(pfd_content->domain_names, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_content->domain_names); + pfd_content->domain_names = NULL; + } + if (pfd_content->dn_protocol) { + OpenAPI_domain_name_protocol_free(pfd_content->dn_protocol); + pfd_content->dn_protocol = NULL; } - OpenAPI_list_free(pfd_content->domain_names); - OpenAPI_domain_name_protocol_free(pfd_content->dn_protocol); ogs_free(pfd_content); } cJSON *OpenAPI_pfd_content_convertToJSON(OpenAPI_pfd_content_t *pfd_content) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pfd_content == NULL) { ogs_error("OpenAPI_pfd_content_convertToJSON() failed [PfdContent]"); @@ -65,51 +82,45 @@ cJSON *OpenAPI_pfd_content_convertToJSON(OpenAPI_pfd_content_t *pfd_content) } if (pfd_content->flow_descriptions) { - cJSON *flow_descriptions = cJSON_AddArrayToObject(item, "flowDescriptions"); - if (flow_descriptions == NULL) { + cJSON *flow_descriptionsList = cJSON_AddArrayToObject(item, "flowDescriptions"); + if (flow_descriptionsList == NULL) { ogs_error("OpenAPI_pfd_content_convertToJSON() failed [flow_descriptions]"); goto end; } - - OpenAPI_lnode_t *flow_descriptions_node; - OpenAPI_list_for_each(pfd_content->flow_descriptions, flow_descriptions_node) { - if (cJSON_AddStringToObject(flow_descriptions, "", (char*)flow_descriptions_node->data) == NULL) { - ogs_error("OpenAPI_pfd_content_convertToJSON() failed [flow_descriptions]"); - goto end; + OpenAPI_list_for_each(pfd_content->flow_descriptions, node) { + if (cJSON_AddStringToObject(flow_descriptionsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [flow_descriptions]"); + goto end; + } } - } } if (pfd_content->urls) { - cJSON *urls = cJSON_AddArrayToObject(item, "urls"); - if (urls == NULL) { + cJSON *urlsList = cJSON_AddArrayToObject(item, "urls"); + if (urlsList == NULL) { ogs_error("OpenAPI_pfd_content_convertToJSON() failed [urls]"); goto end; } - - OpenAPI_lnode_t *urls_node; - OpenAPI_list_for_each(pfd_content->urls, urls_node) { - if (cJSON_AddStringToObject(urls, "", (char*)urls_node->data) == NULL) { - ogs_error("OpenAPI_pfd_content_convertToJSON() failed [urls]"); - goto end; + OpenAPI_list_for_each(pfd_content->urls, node) { + if (cJSON_AddStringToObject(urlsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [urls]"); + goto end; + } } - } } if (pfd_content->domain_names) { - cJSON *domain_names = cJSON_AddArrayToObject(item, "domainNames"); - if (domain_names == NULL) { + cJSON *domain_namesList = cJSON_AddArrayToObject(item, "domainNames"); + if (domain_namesList == NULL) { ogs_error("OpenAPI_pfd_content_convertToJSON() failed [domain_names]"); goto end; } - - OpenAPI_lnode_t *domain_names_node; - OpenAPI_list_for_each(pfd_content->domain_names, domain_names_node) { - if (cJSON_AddStringToObject(domain_names, "", (char*)domain_names_node->data) == NULL) { - ogs_error("OpenAPI_pfd_content_convertToJSON() failed [domain_names]"); - goto end; + OpenAPI_list_for_each(pfd_content->domain_names, node) { + if (cJSON_AddStringToObject(domain_namesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pfd_content_convertToJSON() failed [domain_names]"); + goto end; + } } - } } if (pfd_content->dn_protocol) { @@ -132,84 +143,94 @@ end: OpenAPI_pfd_content_t *OpenAPI_pfd_content_parseFromJSON(cJSON *pfd_contentJSON) { OpenAPI_pfd_content_t *pfd_content_local_var = NULL; - cJSON *pfd_id = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "pfdId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pfd_id = NULL; + cJSON *flow_descriptions = NULL; + OpenAPI_list_t *flow_descriptionsList = NULL; + cJSON *urls = NULL; + OpenAPI_list_t *urlsList = NULL; + cJSON *domain_names = NULL; + OpenAPI_list_t *domain_namesList = NULL; + cJSON *dn_protocol = NULL; + OpenAPI_domain_name_protocol_t *dn_protocol_local_nonprim = NULL; + pfd_id = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "pfdId"); if (pfd_id) { - if (!cJSON_IsString(pfd_id)) { + if (!cJSON_IsString(pfd_id) && !cJSON_IsNull(pfd_id)) { ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [pfd_id]"); goto end; } } - cJSON *flow_descriptions = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "flowDescriptions"); - - OpenAPI_list_t *flow_descriptionsList; + flow_descriptions = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "flowDescriptions"); if (flow_descriptions) { - cJSON *flow_descriptions_local; - if (!cJSON_IsArray(flow_descriptions)) { - ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [flow_descriptions]"); - goto end; - } - flow_descriptionsList = OpenAPI_list_create(); + cJSON *flow_descriptions_local = NULL; + if (!cJSON_IsArray(flow_descriptions)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [flow_descriptions]"); + goto end; + } - cJSON_ArrayForEach(flow_descriptions_local, flow_descriptions) { - if (!cJSON_IsString(flow_descriptions_local)) { - ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [flow_descriptions]"); - goto end; - } - OpenAPI_list_add(flow_descriptionsList, ogs_strdup(flow_descriptions_local->valuestring)); - } + flow_descriptionsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flow_descriptions_local, flow_descriptions) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(flow_descriptions_local)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [flow_descriptions]"); + goto end; + } + OpenAPI_list_add(flow_descriptionsList, ogs_strdup(flow_descriptions_local->valuestring)); + } } - cJSON *urls = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "urls"); - - OpenAPI_list_t *urlsList; + urls = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "urls"); if (urls) { - cJSON *urls_local; - if (!cJSON_IsArray(urls)) { - ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [urls]"); - goto end; - } - urlsList = OpenAPI_list_create(); + cJSON *urls_local = NULL; + if (!cJSON_IsArray(urls)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [urls]"); + goto end; + } - cJSON_ArrayForEach(urls_local, urls) { - if (!cJSON_IsString(urls_local)) { - ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [urls]"); - goto end; - } - OpenAPI_list_add(urlsList, ogs_strdup(urls_local->valuestring)); - } + urlsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(urls_local, urls) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(urls_local)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [urls]"); + goto end; + } + OpenAPI_list_add(urlsList, ogs_strdup(urls_local->valuestring)); + } } - cJSON *domain_names = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "domainNames"); - - OpenAPI_list_t *domain_namesList; + domain_names = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "domainNames"); if (domain_names) { - cJSON *domain_names_local; - if (!cJSON_IsArray(domain_names)) { - ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [domain_names]"); - goto end; - } - domain_namesList = OpenAPI_list_create(); + cJSON *domain_names_local = NULL; + if (!cJSON_IsArray(domain_names)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [domain_names]"); + goto end; + } - cJSON_ArrayForEach(domain_names_local, domain_names) { - if (!cJSON_IsString(domain_names_local)) { - ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [domain_names]"); - goto end; - } - OpenAPI_list_add(domain_namesList, ogs_strdup(domain_names_local->valuestring)); - } + domain_namesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(domain_names_local, domain_names) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(domain_names_local)) { + ogs_error("OpenAPI_pfd_content_parseFromJSON() failed [domain_names]"); + goto end; + } + OpenAPI_list_add(domain_namesList, ogs_strdup(domain_names_local->valuestring)); + } } - cJSON *dn_protocol = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "dnProtocol"); - - OpenAPI_domain_name_protocol_t *dn_protocol_local_nonprim = NULL; + dn_protocol = cJSON_GetObjectItemCaseSensitive(pfd_contentJSON, "dnProtocol"); if (dn_protocol) { dn_protocol_local_nonprim = OpenAPI_domain_name_protocol_parseFromJSON(dn_protocol); } pfd_content_local_var = OpenAPI_pfd_content_create ( - pfd_id ? ogs_strdup(pfd_id->valuestring) : NULL, + pfd_id && !cJSON_IsNull(pfd_id) ? ogs_strdup(pfd_id->valuestring) : NULL, flow_descriptions ? flow_descriptionsList : NULL, urls ? urlsList : NULL, domain_names ? domain_namesList : NULL, @@ -218,6 +239,31 @@ OpenAPI_pfd_content_t *OpenAPI_pfd_content_parseFromJSON(cJSON *pfd_contentJSON) return pfd_content_local_var; end: + if (flow_descriptionsList) { + OpenAPI_list_for_each(flow_descriptionsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(flow_descriptionsList); + flow_descriptionsList = NULL; + } + if (urlsList) { + OpenAPI_list_for_each(urlsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(urlsList); + urlsList = NULL; + } + if (domain_namesList) { + OpenAPI_list_for_each(domain_namesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(domain_namesList); + domain_namesList = NULL; + } + if (dn_protocol_local_nonprim) { + OpenAPI_domain_name_protocol_free(dn_protocol_local_nonprim); + dn_protocol_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pfd_data.c b/lib/sbi/openapi/model/pfd_data.c index bb9388756..b7342d122 100644 --- a/lib/sbi/openapi/model/pfd_data.c +++ b/lib/sbi/openapi/model/pfd_data.c @@ -20,24 +20,32 @@ OpenAPI_pfd_data_t *OpenAPI_pfd_data_create( void OpenAPI_pfd_data_free(OpenAPI_pfd_data_t *pfd_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pfd_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(pfd_data->app_ids, node) { - ogs_free(node->data); + if (pfd_data->app_ids) { + OpenAPI_list_for_each(pfd_data->app_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_data->app_ids); + pfd_data->app_ids = NULL; } - OpenAPI_list_free(pfd_data->app_ids); - OpenAPI_list_for_each(pfd_data->af_ids, node) { - ogs_free(node->data); + if (pfd_data->af_ids) { + OpenAPI_list_for_each(pfd_data->af_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pfd_data->af_ids); + pfd_data->af_ids = NULL; } - OpenAPI_list_free(pfd_data->af_ids); ogs_free(pfd_data); } cJSON *OpenAPI_pfd_data_convertToJSON(OpenAPI_pfd_data_t *pfd_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pfd_data == NULL) { ogs_error("OpenAPI_pfd_data_convertToJSON() failed [PfdData]"); @@ -46,35 +54,31 @@ cJSON *OpenAPI_pfd_data_convertToJSON(OpenAPI_pfd_data_t *pfd_data) item = cJSON_CreateObject(); if (pfd_data->app_ids) { - cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds"); - if (app_ids == NULL) { + cJSON *app_idsList = cJSON_AddArrayToObject(item, "appIds"); + if (app_idsList == NULL) { ogs_error("OpenAPI_pfd_data_convertToJSON() failed [app_ids]"); goto end; } - - OpenAPI_lnode_t *app_ids_node; - OpenAPI_list_for_each(pfd_data->app_ids, app_ids_node) { - if (cJSON_AddStringToObject(app_ids, "", (char*)app_ids_node->data) == NULL) { - ogs_error("OpenAPI_pfd_data_convertToJSON() failed [app_ids]"); - goto end; + OpenAPI_list_for_each(pfd_data->app_ids, node) { + if (cJSON_AddStringToObject(app_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pfd_data_convertToJSON() failed [app_ids]"); + goto end; + } } - } } if (pfd_data->af_ids) { - cJSON *af_ids = cJSON_AddArrayToObject(item, "afIds"); - if (af_ids == NULL) { + cJSON *af_idsList = cJSON_AddArrayToObject(item, "afIds"); + if (af_idsList == NULL) { ogs_error("OpenAPI_pfd_data_convertToJSON() failed [af_ids]"); goto end; } - - OpenAPI_lnode_t *af_ids_node; - OpenAPI_list_for_each(pfd_data->af_ids, af_ids_node) { - if (cJSON_AddStringToObject(af_ids, "", (char*)af_ids_node->data) == NULL) { - ogs_error("OpenAPI_pfd_data_convertToJSON() failed [af_ids]"); - goto end; + OpenAPI_list_for_each(pfd_data->af_ids, node) { + if (cJSON_AddStringToObject(af_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_pfd_data_convertToJSON() failed [af_ids]"); + goto end; + } } - } } end: @@ -84,44 +88,51 @@ end: OpenAPI_pfd_data_t *OpenAPI_pfd_data_parseFromJSON(cJSON *pfd_dataJSON) { OpenAPI_pfd_data_t *pfd_data_local_var = NULL; - cJSON *app_ids = cJSON_GetObjectItemCaseSensitive(pfd_dataJSON, "appIds"); - - OpenAPI_list_t *app_idsList; + OpenAPI_lnode_t *node = NULL; + cJSON *app_ids = NULL; + OpenAPI_list_t *app_idsList = NULL; + cJSON *af_ids = NULL; + OpenAPI_list_t *af_idsList = NULL; + app_ids = cJSON_GetObjectItemCaseSensitive(pfd_dataJSON, "appIds"); if (app_ids) { - cJSON *app_ids_local; - if (!cJSON_IsArray(app_ids)) { - ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [app_ids]"); - goto end; - } - app_idsList = OpenAPI_list_create(); + cJSON *app_ids_local = NULL; + if (!cJSON_IsArray(app_ids)) { + ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [app_ids]"); + goto end; + } - cJSON_ArrayForEach(app_ids_local, app_ids) { - if (!cJSON_IsString(app_ids_local)) { - ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [app_ids]"); - goto end; - } - OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); - } + app_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_ids_local, app_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(app_ids_local)) { + ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [app_ids]"); + goto end; + } + OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring)); + } } - cJSON *af_ids = cJSON_GetObjectItemCaseSensitive(pfd_dataJSON, "afIds"); - - OpenAPI_list_t *af_idsList; + af_ids = cJSON_GetObjectItemCaseSensitive(pfd_dataJSON, "afIds"); if (af_ids) { - cJSON *af_ids_local; - if (!cJSON_IsArray(af_ids)) { - ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [af_ids]"); - goto end; - } - af_idsList = OpenAPI_list_create(); + cJSON *af_ids_local = NULL; + if (!cJSON_IsArray(af_ids)) { + ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [af_ids]"); + goto end; + } - cJSON_ArrayForEach(af_ids_local, af_ids) { - if (!cJSON_IsString(af_ids_local)) { - ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [af_ids]"); - goto end; - } - OpenAPI_list_add(af_idsList, ogs_strdup(af_ids_local->valuestring)); - } + af_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(af_ids_local, af_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(af_ids_local)) { + ogs_error("OpenAPI_pfd_data_parseFromJSON() failed [af_ids]"); + goto end; + } + OpenAPI_list_add(af_idsList, ogs_strdup(af_ids_local->valuestring)); + } } pfd_data_local_var = OpenAPI_pfd_data_create ( @@ -131,6 +142,20 @@ OpenAPI_pfd_data_t *OpenAPI_pfd_data_parseFromJSON(cJSON *pfd_dataJSON) return pfd_data_local_var; end: + if (app_idsList) { + OpenAPI_list_for_each(app_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(app_idsList); + app_idsList = NULL; + } + if (af_idsList) { + OpenAPI_list_for_each(af_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(af_idsList); + af_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pfd_data_for_app.c b/lib/sbi/openapi/model/pfd_data_for_app.c index 288e4e099..c3f32b2cc 100644 --- a/lib/sbi/openapi/model/pfd_data_for_app.c +++ b/lib/sbi/openapi/model/pfd_data_for_app.c @@ -22,22 +22,33 @@ OpenAPI_pfd_data_for_app_t *OpenAPI_pfd_data_for_app_create( void OpenAPI_pfd_data_for_app_free(OpenAPI_pfd_data_for_app_t *pfd_data_for_app) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pfd_data_for_app) { return; } - OpenAPI_lnode_t *node; - ogs_free(pfd_data_for_app->application_id); - OpenAPI_list_for_each(pfd_data_for_app->pfds, node) { - OpenAPI_pfd_content_free(node->data); + if (pfd_data_for_app->application_id) { + ogs_free(pfd_data_for_app->application_id); + pfd_data_for_app->application_id = NULL; + } + if (pfd_data_for_app->pfds) { + OpenAPI_list_for_each(pfd_data_for_app->pfds, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfd_data_for_app->pfds); + pfd_data_for_app->pfds = NULL; + } + if (pfd_data_for_app->caching_time) { + ogs_free(pfd_data_for_app->caching_time); + pfd_data_for_app->caching_time = NULL; } - OpenAPI_list_free(pfd_data_for_app->pfds); - ogs_free(pfd_data_for_app->caching_time); ogs_free(pfd_data_for_app); } cJSON *OpenAPI_pfd_data_for_app_convertToJSON(OpenAPI_pfd_data_for_app_t *pfd_data_for_app) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pfd_data_for_app == NULL) { ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [PfdDataForApp]"); @@ -45,27 +56,31 @@ cJSON *OpenAPI_pfd_data_for_app_convertToJSON(OpenAPI_pfd_data_for_app_t *pfd_da } item = cJSON_CreateObject(); + if (!pfd_data_for_app->application_id) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [application_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "applicationId", pfd_data_for_app->application_id) == NULL) { ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [application_id]"); goto end; } + if (!pfd_data_for_app->pfds) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [pfds]"); + return NULL; + } cJSON *pfdsList = cJSON_AddArrayToObject(item, "pfds"); if (pfdsList == NULL) { ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [pfds]"); goto end; } - - OpenAPI_lnode_t *pfds_node; - if (pfd_data_for_app->pfds) { - OpenAPI_list_for_each(pfd_data_for_app->pfds, pfds_node) { - cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(pfds_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [pfds]"); - goto end; - } - cJSON_AddItemToArray(pfdsList, itemLocal); + OpenAPI_list_for_each(pfd_data_for_app->pfds, node) { + cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_convertToJSON() failed [pfds]"); + goto end; } + cJSON_AddItemToArray(pfdsList, itemLocal); } if (pfd_data_for_app->caching_time) { @@ -82,52 +97,51 @@ end: OpenAPI_pfd_data_for_app_t *OpenAPI_pfd_data_for_app_parseFromJSON(cJSON *pfd_data_for_appJSON) { OpenAPI_pfd_data_for_app_t *pfd_data_for_app_local_var = NULL; - cJSON *application_id = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "applicationId"); + OpenAPI_lnode_t *node = NULL; + cJSON *application_id = NULL; + cJSON *pfds = NULL; + OpenAPI_list_t *pfdsList = NULL; + cJSON *caching_time = NULL; + application_id = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "applicationId"); if (!application_id) { ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [application_id]"); goto end; } - if (!cJSON_IsString(application_id)) { ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [application_id]"); goto end; } - cJSON *pfds = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "pfds"); + pfds = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "pfds"); if (!pfds) { ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [pfds]"); goto end; } - - OpenAPI_list_t *pfdsList; - cJSON *pfds_local_nonprimitive; - if (!cJSON_IsArray(pfds)){ - ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [pfds]"); - goto end; - } - - pfdsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pfds_local_nonprimitive, pfds ) { - if (!cJSON_IsObject(pfds_local_nonprimitive)) { + cJSON *pfds_local = NULL; + if (!cJSON_IsArray(pfds)) { ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [pfds]"); goto end; } - OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local_nonprimitive); - if (!pfdsItem) { - ogs_error("No pfdsItem"); - OpenAPI_list_free(pfdsList); - goto end; + pfdsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pfds_local, pfds) { + if (!cJSON_IsObject(pfds_local)) { + ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [pfds]"); + goto end; + } + OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local); + if (!pfdsItem) { + ogs_error("No pfdsItem"); + OpenAPI_list_free(pfdsList); + goto end; + } + OpenAPI_list_add(pfdsList, pfdsItem); } - OpenAPI_list_add(pfdsList, pfdsItem); - } - - cJSON *caching_time = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "cachingTime"); - + caching_time = cJSON_GetObjectItemCaseSensitive(pfd_data_for_appJSON, "cachingTime"); if (caching_time) { - if (!cJSON_IsString(caching_time)) { + if (!cJSON_IsString(caching_time) && !cJSON_IsNull(caching_time)) { ogs_error("OpenAPI_pfd_data_for_app_parseFromJSON() failed [caching_time]"); goto end; } @@ -136,11 +150,18 @@ OpenAPI_pfd_data_for_app_t *OpenAPI_pfd_data_for_app_parseFromJSON(cJSON *pfd_da pfd_data_for_app_local_var = OpenAPI_pfd_data_for_app_create ( ogs_strdup(application_id->valuestring), pfdsList, - caching_time ? ogs_strdup(caching_time->valuestring) : NULL + caching_time && !cJSON_IsNull(caching_time) ? ogs_strdup(caching_time->valuestring) : NULL ); return pfd_data_for_app_local_var; end: + if (pfdsList) { + OpenAPI_list_for_each(pfdsList, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfdsList); + pfdsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pfd_data_for_app_ext.c b/lib/sbi/openapi/model/pfd_data_for_app_ext.c index 515b2fb98..2f36fc4a9 100644 --- a/lib/sbi/openapi/model/pfd_data_for_app_ext.c +++ b/lib/sbi/openapi/model/pfd_data_for_app_ext.c @@ -24,23 +24,37 @@ OpenAPI_pfd_data_for_app_ext_t *OpenAPI_pfd_data_for_app_ext_create( void OpenAPI_pfd_data_for_app_ext_free(OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pfd_data_for_app_ext) { return; } - OpenAPI_lnode_t *node; - ogs_free(pfd_data_for_app_ext->application_id); - OpenAPI_list_for_each(pfd_data_for_app_ext->pfds, node) { - OpenAPI_pfd_content_free(node->data); + if (pfd_data_for_app_ext->application_id) { + ogs_free(pfd_data_for_app_ext->application_id); + pfd_data_for_app_ext->application_id = NULL; + } + if (pfd_data_for_app_ext->pfds) { + OpenAPI_list_for_each(pfd_data_for_app_ext->pfds, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfd_data_for_app_ext->pfds); + pfd_data_for_app_ext->pfds = NULL; + } + if (pfd_data_for_app_ext->caching_time) { + ogs_free(pfd_data_for_app_ext->caching_time); + pfd_data_for_app_ext->caching_time = NULL; + } + if (pfd_data_for_app_ext->supp_feat) { + ogs_free(pfd_data_for_app_ext->supp_feat); + pfd_data_for_app_ext->supp_feat = NULL; } - OpenAPI_list_free(pfd_data_for_app_ext->pfds); - ogs_free(pfd_data_for_app_ext->caching_time); - ogs_free(pfd_data_for_app_ext->supp_feat); ogs_free(pfd_data_for_app_ext); } cJSON *OpenAPI_pfd_data_for_app_ext_convertToJSON(OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pfd_data_for_app_ext == NULL) { ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [PfdDataForAppExt]"); @@ -48,27 +62,31 @@ cJSON *OpenAPI_pfd_data_for_app_ext_convertToJSON(OpenAPI_pfd_data_for_app_ext_t } item = cJSON_CreateObject(); + if (!pfd_data_for_app_ext->application_id) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [application_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "applicationId", pfd_data_for_app_ext->application_id) == NULL) { ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [application_id]"); goto end; } + if (!pfd_data_for_app_ext->pfds) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [pfds]"); + return NULL; + } cJSON *pfdsList = cJSON_AddArrayToObject(item, "pfds"); if (pfdsList == NULL) { ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [pfds]"); goto end; } - - OpenAPI_lnode_t *pfds_node; - if (pfd_data_for_app_ext->pfds) { - OpenAPI_list_for_each(pfd_data_for_app_ext->pfds, pfds_node) { - cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(pfds_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [pfds]"); - goto end; - } - cJSON_AddItemToArray(pfdsList, itemLocal); + OpenAPI_list_for_each(pfd_data_for_app_ext->pfds, node) { + cJSON *itemLocal = OpenAPI_pfd_content_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pfd_data_for_app_ext_convertToJSON() failed [pfds]"); + goto end; } + cJSON_AddItemToArray(pfdsList, itemLocal); } if (pfd_data_for_app_ext->caching_time) { @@ -92,61 +110,60 @@ end: OpenAPI_pfd_data_for_app_ext_t *OpenAPI_pfd_data_for_app_ext_parseFromJSON(cJSON *pfd_data_for_app_extJSON) { OpenAPI_pfd_data_for_app_ext_t *pfd_data_for_app_ext_local_var = NULL; - cJSON *application_id = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "applicationId"); + OpenAPI_lnode_t *node = NULL; + cJSON *application_id = NULL; + cJSON *pfds = NULL; + OpenAPI_list_t *pfdsList = NULL; + cJSON *caching_time = NULL; + cJSON *supp_feat = NULL; + application_id = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "applicationId"); if (!application_id) { ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [application_id]"); goto end; } - if (!cJSON_IsString(application_id)) { ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [application_id]"); goto end; } - cJSON *pfds = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "pfds"); + pfds = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "pfds"); if (!pfds) { ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [pfds]"); goto end; } - - OpenAPI_list_t *pfdsList; - cJSON *pfds_local_nonprimitive; - if (!cJSON_IsArray(pfds)){ - ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [pfds]"); - goto end; - } - - pfdsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pfds_local_nonprimitive, pfds ) { - if (!cJSON_IsObject(pfds_local_nonprimitive)) { + cJSON *pfds_local = NULL; + if (!cJSON_IsArray(pfds)) { ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [pfds]"); goto end; } - OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local_nonprimitive); - if (!pfdsItem) { - ogs_error("No pfdsItem"); - OpenAPI_list_free(pfdsList); - goto end; + pfdsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pfds_local, pfds) { + if (!cJSON_IsObject(pfds_local)) { + ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [pfds]"); + goto end; + } + OpenAPI_pfd_content_t *pfdsItem = OpenAPI_pfd_content_parseFromJSON(pfds_local); + if (!pfdsItem) { + ogs_error("No pfdsItem"); + OpenAPI_list_free(pfdsList); + goto end; + } + OpenAPI_list_add(pfdsList, pfdsItem); } - OpenAPI_list_add(pfdsList, pfdsItem); - } - - cJSON *caching_time = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "cachingTime"); - + caching_time = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "cachingTime"); if (caching_time) { - if (!cJSON_IsString(caching_time)) { + if (!cJSON_IsString(caching_time) && !cJSON_IsNull(caching_time)) { ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [caching_time]"); goto end; } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_extJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_pfd_data_for_app_ext_parseFromJSON() failed [supp_feat]"); goto end; } @@ -155,12 +172,19 @@ OpenAPI_pfd_data_for_app_ext_t *OpenAPI_pfd_data_for_app_ext_parseFromJSON(cJSON pfd_data_for_app_ext_local_var = OpenAPI_pfd_data_for_app_ext_create ( ogs_strdup(application_id->valuestring), pfdsList, - caching_time ? ogs_strdup(caching_time->valuestring) : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + caching_time && !cJSON_IsNull(caching_time) ? ogs_strdup(caching_time->valuestring) : NULL, + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return pfd_data_for_app_ext_local_var; end: + if (pfdsList) { + OpenAPI_list_for_each(pfdsList, node) { + OpenAPI_pfd_content_free(node->data); + } + OpenAPI_list_free(pfdsList); + pfdsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pfd_data_for_app_ext.h b/lib/sbi/openapi/model/pfd_data_for_app_ext.h index 99ef9b6b3..2ec0ea71a 100644 --- a/lib/sbi/openapi/model/pfd_data_for_app_ext.h +++ b/lib/sbi/openapi/model/pfd_data_for_app_ext.h @@ -13,8 +13,6 @@ #include "../include/keyValuePair.h" #include "../include/binary.h" #include "pfd_content.h" -#include "pfd_data_for_app.h" -#include "pfd_data_for_app_ext_all_of.h" #ifdef __cplusplus extern "C" { diff --git a/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.c b/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.c index 6a2358b6c..142d45631 100644 --- a/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.c +++ b/lib/sbi/openapi/model/pfd_data_for_app_ext_all_of.c @@ -18,17 +18,22 @@ OpenAPI_pfd_data_for_app_ext_all_of_t *OpenAPI_pfd_data_for_app_ext_all_of_creat void OpenAPI_pfd_data_for_app_ext_all_of_free(OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pfd_data_for_app_ext_all_of) { return; } - OpenAPI_lnode_t *node; - ogs_free(pfd_data_for_app_ext_all_of->supp_feat); + if (pfd_data_for_app_ext_all_of->supp_feat) { + ogs_free(pfd_data_for_app_ext_all_of->supp_feat); + pfd_data_for_app_ext_all_of->supp_feat = NULL; + } ogs_free(pfd_data_for_app_ext_all_of); } cJSON *OpenAPI_pfd_data_for_app_ext_all_of_convertToJSON(OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pfd_data_for_app_ext_all_of == NULL) { ogs_error("OpenAPI_pfd_data_for_app_ext_all_of_convertToJSON() failed [PfdDataForAppExt_allOf]"); @@ -50,17 +55,18 @@ end: OpenAPI_pfd_data_for_app_ext_all_of_t *OpenAPI_pfd_data_for_app_ext_all_of_parseFromJSON(cJSON *pfd_data_for_app_ext_all_ofJSON) { OpenAPI_pfd_data_for_app_ext_all_of_t *pfd_data_for_app_ext_all_of_local_var = NULL; - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_ext_all_ofJSON, "suppFeat"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supp_feat = NULL; + supp_feat = cJSON_GetObjectItemCaseSensitive(pfd_data_for_app_ext_all_ofJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_pfd_data_for_app_ext_all_of_parseFromJSON() failed [supp_feat]"); goto end; } } pfd_data_for_app_ext_all_of_local_var = OpenAPI_pfd_data_for_app_ext_all_of_create ( - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return pfd_data_for_app_ext_all_of_local_var; diff --git a/lib/sbi/openapi/model/pgw_info.c b/lib/sbi/openapi/model/pgw_info.c index 32f6aae98..5145aa0d7 100644 --- a/lib/sbi/openapi/model/pgw_info.c +++ b/lib/sbi/openapi/model/pgw_info.c @@ -26,19 +26,30 @@ OpenAPI_pgw_info_t *OpenAPI_pgw_info_create( void OpenAPI_pgw_info_free(OpenAPI_pgw_info_t *pgw_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pgw_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(pgw_info->dnn); - ogs_free(pgw_info->pgw_fqdn); - OpenAPI_plmn_id_free(pgw_info->plmn_id); + if (pgw_info->dnn) { + ogs_free(pgw_info->dnn); + pgw_info->dnn = NULL; + } + if (pgw_info->pgw_fqdn) { + ogs_free(pgw_info->pgw_fqdn); + pgw_info->pgw_fqdn = NULL; + } + if (pgw_info->plmn_id) { + OpenAPI_plmn_id_free(pgw_info->plmn_id); + pgw_info->plmn_id = NULL; + } ogs_free(pgw_info); } cJSON *OpenAPI_pgw_info_convertToJSON(OpenAPI_pgw_info_t *pgw_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pgw_info == NULL) { ogs_error("OpenAPI_pgw_info_convertToJSON() failed [PgwInfo]"); @@ -46,11 +57,19 @@ cJSON *OpenAPI_pgw_info_convertToJSON(OpenAPI_pgw_info_t *pgw_info) } item = cJSON_CreateObject(); + if (!pgw_info->dnn) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", pgw_info->dnn) == NULL) { ogs_error("OpenAPI_pgw_info_convertToJSON() failed [dnn]"); goto end; } + if (!pgw_info->pgw_fqdn) { + ogs_error("OpenAPI_pgw_info_convertToJSON() failed [pgw_fqdn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "pgwFqdn", pgw_info->pgw_fqdn) == NULL) { ogs_error("OpenAPI_pgw_info_convertToJSON() failed [pgw_fqdn]"); goto end; @@ -83,37 +102,38 @@ end: OpenAPI_pgw_info_t *OpenAPI_pgw_info_parseFromJSON(cJSON *pgw_infoJSON) { OpenAPI_pgw_info_t *pgw_info_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *pgw_fqdn = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *epdg_ind = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [dnn]"); goto end; } - cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "pgwFqdn"); + pgw_fqdn = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "pgwFqdn"); if (!pgw_fqdn) { ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [pgw_fqdn]"); goto end; } - if (!cJSON_IsString(pgw_fqdn)) { ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [pgw_fqdn]"); goto end; } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "plmnId"); - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); } - cJSON *epdg_ind = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "epdgInd"); - + epdg_ind = cJSON_GetObjectItemCaseSensitive(pgw_infoJSON, "epdgInd"); if (epdg_ind) { if (!cJSON_IsBool(epdg_ind)) { ogs_error("OpenAPI_pgw_info_parseFromJSON() failed [epdg_ind]"); @@ -131,6 +151,10 @@ OpenAPI_pgw_info_t *OpenAPI_pgw_info_parseFromJSON(cJSON *pgw_infoJSON) return pgw_info_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pgw_info_1.c b/lib/sbi/openapi/model/pgw_info_1.c index 708d2ccf7..ac2fac36e 100644 --- a/lib/sbi/openapi/model/pgw_info_1.c +++ b/lib/sbi/openapi/model/pgw_info_1.c @@ -26,19 +26,30 @@ OpenAPI_pgw_info_1_t *OpenAPI_pgw_info_1_create( void OpenAPI_pgw_info_1_free(OpenAPI_pgw_info_1_t *pgw_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pgw_info_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(pgw_info_1->dnn); - ogs_free(pgw_info_1->pgw_fqdn); - OpenAPI_plmn_id_1_free(pgw_info_1->plmn_id); + if (pgw_info_1->dnn) { + ogs_free(pgw_info_1->dnn); + pgw_info_1->dnn = NULL; + } + if (pgw_info_1->pgw_fqdn) { + ogs_free(pgw_info_1->pgw_fqdn); + pgw_info_1->pgw_fqdn = NULL; + } + if (pgw_info_1->plmn_id) { + OpenAPI_plmn_id_1_free(pgw_info_1->plmn_id); + pgw_info_1->plmn_id = NULL; + } ogs_free(pgw_info_1); } cJSON *OpenAPI_pgw_info_1_convertToJSON(OpenAPI_pgw_info_1_t *pgw_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pgw_info_1 == NULL) { ogs_error("OpenAPI_pgw_info_1_convertToJSON() failed [PgwInfo_1]"); @@ -46,11 +57,19 @@ cJSON *OpenAPI_pgw_info_1_convertToJSON(OpenAPI_pgw_info_1_t *pgw_info_1) } item = cJSON_CreateObject(); + if (!pgw_info_1->dnn) { + ogs_error("OpenAPI_pgw_info_1_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", pgw_info_1->dnn) == NULL) { ogs_error("OpenAPI_pgw_info_1_convertToJSON() failed [dnn]"); goto end; } + if (!pgw_info_1->pgw_fqdn) { + ogs_error("OpenAPI_pgw_info_1_convertToJSON() failed [pgw_fqdn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "pgwFqdn", pgw_info_1->pgw_fqdn) == NULL) { ogs_error("OpenAPI_pgw_info_1_convertToJSON() failed [pgw_fqdn]"); goto end; @@ -83,37 +102,38 @@ end: OpenAPI_pgw_info_1_t *OpenAPI_pgw_info_1_parseFromJSON(cJSON *pgw_info_1JSON) { OpenAPI_pgw_info_1_t *pgw_info_1_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(pgw_info_1JSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *pgw_fqdn = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + cJSON *epdg_ind = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(pgw_info_1JSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_pgw_info_1_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_pgw_info_1_parseFromJSON() failed [dnn]"); goto end; } - cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(pgw_info_1JSON, "pgwFqdn"); + pgw_fqdn = cJSON_GetObjectItemCaseSensitive(pgw_info_1JSON, "pgwFqdn"); if (!pgw_fqdn) { ogs_error("OpenAPI_pgw_info_1_parseFromJSON() failed [pgw_fqdn]"); goto end; } - if (!cJSON_IsString(pgw_fqdn)) { ogs_error("OpenAPI_pgw_info_1_parseFromJSON() failed [pgw_fqdn]"); goto end; } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(pgw_info_1JSON, "plmnId"); - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(pgw_info_1JSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); } - cJSON *epdg_ind = cJSON_GetObjectItemCaseSensitive(pgw_info_1JSON, "epdgInd"); - + epdg_ind = cJSON_GetObjectItemCaseSensitive(pgw_info_1JSON, "epdgInd"); if (epdg_ind) { if (!cJSON_IsBool(epdg_ind)) { ogs_error("OpenAPI_pgw_info_1_parseFromJSON() failed [epdg_ind]"); @@ -131,6 +151,10 @@ OpenAPI_pgw_info_1_t *OpenAPI_pgw_info_1_parseFromJSON(cJSON *pgw_info_1JSON) return pgw_info_1_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/plmn_ec_info.c b/lib/sbi/openapi/model/plmn_ec_info.c index 2a2b43787..5be194e1a 100644 --- a/lib/sbi/openapi/model/plmn_ec_info.c +++ b/lib/sbi/openapi/model/plmn_ec_info.c @@ -24,18 +24,26 @@ OpenAPI_plmn_ec_info_t *OpenAPI_plmn_ec_info_create( void OpenAPI_plmn_ec_info_free(OpenAPI_plmn_ec_info_t *plmn_ec_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_ec_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(plmn_ec_info->plmn_id); - OpenAPI_ec_restriction_data_wb_free(plmn_ec_info->ec_restriction_data_wb); + if (plmn_ec_info->plmn_id) { + OpenAPI_plmn_id_free(plmn_ec_info->plmn_id); + plmn_ec_info->plmn_id = NULL; + } + if (plmn_ec_info->ec_restriction_data_wb) { + OpenAPI_ec_restriction_data_wb_free(plmn_ec_info->ec_restriction_data_wb); + plmn_ec_info->ec_restriction_data_wb = NULL; + } ogs_free(plmn_ec_info); } cJSON *OpenAPI_plmn_ec_info_convertToJSON(OpenAPI_plmn_ec_info_t *plmn_ec_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_ec_info == NULL) { ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [PlmnEcInfo]"); @@ -43,6 +51,10 @@ cJSON *OpenAPI_plmn_ec_info_convertToJSON(OpenAPI_plmn_ec_info_t *plmn_ec_info) } item = cJSON_CreateObject(); + if (!plmn_ec_info->plmn_id) { + ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(plmn_ec_info->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_plmn_ec_info_convertToJSON() failed [plmn_id]"); @@ -81,24 +93,25 @@ end: OpenAPI_plmn_ec_info_t *OpenAPI_plmn_ec_info_parseFromJSON(cJSON *plmn_ec_infoJSON) { OpenAPI_plmn_ec_info_t *plmn_ec_info_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *ec_restriction_data_wb = NULL; + OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL; + cJSON *ec_restriction_data_nb = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_plmn_ec_info_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "ecRestrictionDataWb"); - - OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL; + ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "ecRestrictionDataWb"); if (ec_restriction_data_wb) { ec_restriction_data_wb_local_nonprim = OpenAPI_ec_restriction_data_wb_parseFromJSON(ec_restriction_data_wb); } - cJSON *ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "ecRestrictionDataNb"); - + ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(plmn_ec_infoJSON, "ecRestrictionDataNb"); if (ec_restriction_data_nb) { if (!cJSON_IsBool(ec_restriction_data_nb)) { ogs_error("OpenAPI_plmn_ec_info_parseFromJSON() failed [ec_restriction_data_nb]"); @@ -115,6 +128,14 @@ OpenAPI_plmn_ec_info_t *OpenAPI_plmn_ec_info_parseFromJSON(cJSON *plmn_ec_infoJS return plmn_ec_info_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (ec_restriction_data_wb_local_nonprim) { + OpenAPI_ec_restriction_data_wb_free(ec_restriction_data_wb_local_nonprim); + ec_restriction_data_wb_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/plmn_id.c b/lib/sbi/openapi/model/plmn_id.c index bc975cdb7..9c51bc0e5 100644 --- a/lib/sbi/openapi/model/plmn_id.c +++ b/lib/sbi/openapi/model/plmn_id.c @@ -20,18 +20,26 @@ OpenAPI_plmn_id_t *OpenAPI_plmn_id_create( void OpenAPI_plmn_id_free(OpenAPI_plmn_id_t *plmn_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_id) { return; } - OpenAPI_lnode_t *node; - ogs_free(plmn_id->mcc); - ogs_free(plmn_id->mnc); + if (plmn_id->mcc) { + ogs_free(plmn_id->mcc); + plmn_id->mcc = NULL; + } + if (plmn_id->mnc) { + ogs_free(plmn_id->mnc); + plmn_id->mnc = NULL; + } ogs_free(plmn_id); } cJSON *OpenAPI_plmn_id_convertToJSON(OpenAPI_plmn_id_t *plmn_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_id == NULL) { ogs_error("OpenAPI_plmn_id_convertToJSON() failed [PlmnId]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_plmn_id_convertToJSON(OpenAPI_plmn_id_t *plmn_id) } item = cJSON_CreateObject(); + if (!plmn_id->mcc) { + ogs_error("OpenAPI_plmn_id_convertToJSON() failed [mcc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "mcc", plmn_id->mcc) == NULL) { ogs_error("OpenAPI_plmn_id_convertToJSON() failed [mcc]"); goto end; } + if (!plmn_id->mnc) { + ogs_error("OpenAPI_plmn_id_convertToJSON() failed [mnc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "mnc", plmn_id->mnc) == NULL) { ogs_error("OpenAPI_plmn_id_convertToJSON() failed [mnc]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_plmn_id_t *OpenAPI_plmn_id_parseFromJSON(cJSON *plmn_idJSON) { OpenAPI_plmn_id_t *plmn_id_local_var = NULL; - cJSON *mcc = cJSON_GetObjectItemCaseSensitive(plmn_idJSON, "mcc"); + OpenAPI_lnode_t *node = NULL; + cJSON *mcc = NULL; + cJSON *mnc = NULL; + mcc = cJSON_GetObjectItemCaseSensitive(plmn_idJSON, "mcc"); if (!mcc) { ogs_error("OpenAPI_plmn_id_parseFromJSON() failed [mcc]"); goto end; } - if (!cJSON_IsString(mcc)) { ogs_error("OpenAPI_plmn_id_parseFromJSON() failed [mcc]"); goto end; } - cJSON *mnc = cJSON_GetObjectItemCaseSensitive(plmn_idJSON, "mnc"); + mnc = cJSON_GetObjectItemCaseSensitive(plmn_idJSON, "mnc"); if (!mnc) { ogs_error("OpenAPI_plmn_id_parseFromJSON() failed [mnc]"); goto end; } - if (!cJSON_IsString(mnc)) { ogs_error("OpenAPI_plmn_id_parseFromJSON() failed [mnc]"); goto end; diff --git a/lib/sbi/openapi/model/plmn_id_1.c b/lib/sbi/openapi/model/plmn_id_1.c index c56fe2d37..5b37c1576 100644 --- a/lib/sbi/openapi/model/plmn_id_1.c +++ b/lib/sbi/openapi/model/plmn_id_1.c @@ -20,18 +20,26 @@ OpenAPI_plmn_id_1_t *OpenAPI_plmn_id_1_create( void OpenAPI_plmn_id_1_free(OpenAPI_plmn_id_1_t *plmn_id_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_id_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(plmn_id_1->mcc); - ogs_free(plmn_id_1->mnc); + if (plmn_id_1->mcc) { + ogs_free(plmn_id_1->mcc); + plmn_id_1->mcc = NULL; + } + if (plmn_id_1->mnc) { + ogs_free(plmn_id_1->mnc); + plmn_id_1->mnc = NULL; + } ogs_free(plmn_id_1); } cJSON *OpenAPI_plmn_id_1_convertToJSON(OpenAPI_plmn_id_1_t *plmn_id_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_id_1 == NULL) { ogs_error("OpenAPI_plmn_id_1_convertToJSON() failed [PlmnId_1]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_plmn_id_1_convertToJSON(OpenAPI_plmn_id_1_t *plmn_id_1) } item = cJSON_CreateObject(); + if (!plmn_id_1->mcc) { + ogs_error("OpenAPI_plmn_id_1_convertToJSON() failed [mcc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "mcc", plmn_id_1->mcc) == NULL) { ogs_error("OpenAPI_plmn_id_1_convertToJSON() failed [mcc]"); goto end; } + if (!plmn_id_1->mnc) { + ogs_error("OpenAPI_plmn_id_1_convertToJSON() failed [mnc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "mnc", plmn_id_1->mnc) == NULL) { ogs_error("OpenAPI_plmn_id_1_convertToJSON() failed [mnc]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_plmn_id_1_t *OpenAPI_plmn_id_1_parseFromJSON(cJSON *plmn_id_1JSON) { OpenAPI_plmn_id_1_t *plmn_id_1_local_var = NULL; - cJSON *mcc = cJSON_GetObjectItemCaseSensitive(plmn_id_1JSON, "mcc"); + OpenAPI_lnode_t *node = NULL; + cJSON *mcc = NULL; + cJSON *mnc = NULL; + mcc = cJSON_GetObjectItemCaseSensitive(plmn_id_1JSON, "mcc"); if (!mcc) { ogs_error("OpenAPI_plmn_id_1_parseFromJSON() failed [mcc]"); goto end; } - if (!cJSON_IsString(mcc)) { ogs_error("OpenAPI_plmn_id_1_parseFromJSON() failed [mcc]"); goto end; } - cJSON *mnc = cJSON_GetObjectItemCaseSensitive(plmn_id_1JSON, "mnc"); + mnc = cJSON_GetObjectItemCaseSensitive(plmn_id_1JSON, "mnc"); if (!mnc) { ogs_error("OpenAPI_plmn_id_1_parseFromJSON() failed [mnc]"); goto end; } - if (!cJSON_IsString(mnc)) { ogs_error("OpenAPI_plmn_id_1_parseFromJSON() failed [mnc]"); goto end; diff --git a/lib/sbi/openapi/model/plmn_id_nid.c b/lib/sbi/openapi/model/plmn_id_nid.c index bd8f2c349..ec0deb978 100644 --- a/lib/sbi/openapi/model/plmn_id_nid.c +++ b/lib/sbi/openapi/model/plmn_id_nid.c @@ -22,19 +22,30 @@ OpenAPI_plmn_id_nid_t *OpenAPI_plmn_id_nid_create( void OpenAPI_plmn_id_nid_free(OpenAPI_plmn_id_nid_t *plmn_id_nid) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_id_nid) { return; } - OpenAPI_lnode_t *node; - ogs_free(plmn_id_nid->mcc); - ogs_free(plmn_id_nid->mnc); - ogs_free(plmn_id_nid->nid); + if (plmn_id_nid->mcc) { + ogs_free(plmn_id_nid->mcc); + plmn_id_nid->mcc = NULL; + } + if (plmn_id_nid->mnc) { + ogs_free(plmn_id_nid->mnc); + plmn_id_nid->mnc = NULL; + } + if (plmn_id_nid->nid) { + ogs_free(plmn_id_nid->nid); + plmn_id_nid->nid = NULL; + } ogs_free(plmn_id_nid); } cJSON *OpenAPI_plmn_id_nid_convertToJSON(OpenAPI_plmn_id_nid_t *plmn_id_nid) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_id_nid == NULL) { ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [PlmnIdNid]"); @@ -42,11 +53,19 @@ cJSON *OpenAPI_plmn_id_nid_convertToJSON(OpenAPI_plmn_id_nid_t *plmn_id_nid) } item = cJSON_CreateObject(); + if (!plmn_id_nid->mcc) { + ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [mcc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "mcc", plmn_id_nid->mcc) == NULL) { ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [mcc]"); goto end; } + if (!plmn_id_nid->mnc) { + ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [mnc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "mnc", plmn_id_nid->mnc) == NULL) { ogs_error("OpenAPI_plmn_id_nid_convertToJSON() failed [mnc]"); goto end; @@ -66,32 +85,33 @@ end: OpenAPI_plmn_id_nid_t *OpenAPI_plmn_id_nid_parseFromJSON(cJSON *plmn_id_nidJSON) { OpenAPI_plmn_id_nid_t *plmn_id_nid_local_var = NULL; - cJSON *mcc = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "mcc"); + OpenAPI_lnode_t *node = NULL; + cJSON *mcc = NULL; + cJSON *mnc = NULL; + cJSON *nid = NULL; + mcc = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "mcc"); if (!mcc) { ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [mcc]"); goto end; } - if (!cJSON_IsString(mcc)) { ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [mcc]"); goto end; } - cJSON *mnc = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "mnc"); + mnc = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "mnc"); if (!mnc) { ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [mnc]"); goto end; } - if (!cJSON_IsString(mnc)) { ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [mnc]"); goto end; } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(plmn_id_nidJSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_plmn_id_nid_parseFromJSON() failed [nid]"); goto end; } @@ -100,7 +120,7 @@ OpenAPI_plmn_id_nid_t *OpenAPI_plmn_id_nid_parseFromJSON(cJSON *plmn_id_nidJSON) plmn_id_nid_local_var = OpenAPI_plmn_id_nid_create ( ogs_strdup(mcc->valuestring), ogs_strdup(mnc->valuestring), - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return plmn_id_nid_local_var; diff --git a/lib/sbi/openapi/model/plmn_id_nid_1.c b/lib/sbi/openapi/model/plmn_id_nid_1.c index 7740dd13e..90f4993bc 100644 --- a/lib/sbi/openapi/model/plmn_id_nid_1.c +++ b/lib/sbi/openapi/model/plmn_id_nid_1.c @@ -22,19 +22,30 @@ OpenAPI_plmn_id_nid_1_t *OpenAPI_plmn_id_nid_1_create( void OpenAPI_plmn_id_nid_1_free(OpenAPI_plmn_id_nid_1_t *plmn_id_nid_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_id_nid_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(plmn_id_nid_1->mcc); - ogs_free(plmn_id_nid_1->mnc); - ogs_free(plmn_id_nid_1->nid); + if (plmn_id_nid_1->mcc) { + ogs_free(plmn_id_nid_1->mcc); + plmn_id_nid_1->mcc = NULL; + } + if (plmn_id_nid_1->mnc) { + ogs_free(plmn_id_nid_1->mnc); + plmn_id_nid_1->mnc = NULL; + } + if (plmn_id_nid_1->nid) { + ogs_free(plmn_id_nid_1->nid); + plmn_id_nid_1->nid = NULL; + } ogs_free(plmn_id_nid_1); } cJSON *OpenAPI_plmn_id_nid_1_convertToJSON(OpenAPI_plmn_id_nid_1_t *plmn_id_nid_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_id_nid_1 == NULL) { ogs_error("OpenAPI_plmn_id_nid_1_convertToJSON() failed [PlmnIdNid_1]"); @@ -42,11 +53,19 @@ cJSON *OpenAPI_plmn_id_nid_1_convertToJSON(OpenAPI_plmn_id_nid_1_t *plmn_id_nid_ } item = cJSON_CreateObject(); + if (!plmn_id_nid_1->mcc) { + ogs_error("OpenAPI_plmn_id_nid_1_convertToJSON() failed [mcc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "mcc", plmn_id_nid_1->mcc) == NULL) { ogs_error("OpenAPI_plmn_id_nid_1_convertToJSON() failed [mcc]"); goto end; } + if (!plmn_id_nid_1->mnc) { + ogs_error("OpenAPI_plmn_id_nid_1_convertToJSON() failed [mnc]"); + return NULL; + } if (cJSON_AddStringToObject(item, "mnc", plmn_id_nid_1->mnc) == NULL) { ogs_error("OpenAPI_plmn_id_nid_1_convertToJSON() failed [mnc]"); goto end; @@ -66,32 +85,33 @@ end: OpenAPI_plmn_id_nid_1_t *OpenAPI_plmn_id_nid_1_parseFromJSON(cJSON *plmn_id_nid_1JSON) { OpenAPI_plmn_id_nid_1_t *plmn_id_nid_1_local_var = NULL; - cJSON *mcc = cJSON_GetObjectItemCaseSensitive(plmn_id_nid_1JSON, "mcc"); + OpenAPI_lnode_t *node = NULL; + cJSON *mcc = NULL; + cJSON *mnc = NULL; + cJSON *nid = NULL; + mcc = cJSON_GetObjectItemCaseSensitive(plmn_id_nid_1JSON, "mcc"); if (!mcc) { ogs_error("OpenAPI_plmn_id_nid_1_parseFromJSON() failed [mcc]"); goto end; } - if (!cJSON_IsString(mcc)) { ogs_error("OpenAPI_plmn_id_nid_1_parseFromJSON() failed [mcc]"); goto end; } - cJSON *mnc = cJSON_GetObjectItemCaseSensitive(plmn_id_nid_1JSON, "mnc"); + mnc = cJSON_GetObjectItemCaseSensitive(plmn_id_nid_1JSON, "mnc"); if (!mnc) { ogs_error("OpenAPI_plmn_id_nid_1_parseFromJSON() failed [mnc]"); goto end; } - if (!cJSON_IsString(mnc)) { ogs_error("OpenAPI_plmn_id_nid_1_parseFromJSON() failed [mnc]"); goto end; } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(plmn_id_nid_1JSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(plmn_id_nid_1JSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_plmn_id_nid_1_parseFromJSON() failed [nid]"); goto end; } @@ -100,7 +120,7 @@ OpenAPI_plmn_id_nid_1_t *OpenAPI_plmn_id_nid_1_parseFromJSON(cJSON *plmn_id_nid_ plmn_id_nid_1_local_var = OpenAPI_plmn_id_nid_1_create ( ogs_strdup(mcc->valuestring), ogs_strdup(mnc->valuestring), - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return plmn_id_nid_1_local_var; diff --git a/lib/sbi/openapi/model/plmn_operator_class.c b/lib/sbi/openapi/model/plmn_operator_class.c index 8c29373a9..c1130c250 100644 --- a/lib/sbi/openapi/model/plmn_operator_class.c +++ b/lib/sbi/openapi/model/plmn_operator_class.c @@ -20,20 +20,25 @@ OpenAPI_plmn_operator_class_t *OpenAPI_plmn_operator_class_create( void OpenAPI_plmn_operator_class_free(OpenAPI_plmn_operator_class_t *plmn_operator_class) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_operator_class) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(plmn_operator_class->lcs_client_ids, node) { - ogs_free(node->data); + if (plmn_operator_class->lcs_client_ids) { + OpenAPI_list_for_each(plmn_operator_class->lcs_client_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(plmn_operator_class->lcs_client_ids); + plmn_operator_class->lcs_client_ids = NULL; } - OpenAPI_list_free(plmn_operator_class->lcs_client_ids); ogs_free(plmn_operator_class); } cJSON *OpenAPI_plmn_operator_class_convertToJSON(OpenAPI_plmn_operator_class_t *plmn_operator_class) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_operator_class == NULL) { ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [PlmnOperatorClass]"); @@ -41,24 +46,30 @@ cJSON *OpenAPI_plmn_operator_class_convertToJSON(OpenAPI_plmn_operator_class_t * } item = cJSON_CreateObject(); + if (plmn_operator_class->lcs_client_class == OpenAPI_lcs_client_class_NULL) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_class]"); + return NULL; + } if (cJSON_AddStringToObject(item, "lcsClientClass", OpenAPI_lcs_client_class_ToString(plmn_operator_class->lcs_client_class)) == NULL) { ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_class]"); goto end; } - cJSON *lcs_client_ids = cJSON_AddArrayToObject(item, "lcsClientIds"); - if (lcs_client_ids == NULL) { + if (!plmn_operator_class->lcs_client_ids) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_ids]"); + return NULL; + } + cJSON *lcs_client_idsList = cJSON_AddArrayToObject(item, "lcsClientIds"); + if (lcs_client_idsList == NULL) { ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_ids]"); goto end; } - - OpenAPI_lnode_t *lcs_client_ids_node; - OpenAPI_list_for_each(plmn_operator_class->lcs_client_ids, lcs_client_ids_node) { - if (cJSON_AddStringToObject(lcs_client_ids, "", (char*)lcs_client_ids_node->data) == NULL) { - ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_ids]"); - goto end; + OpenAPI_list_for_each(plmn_operator_class->lcs_client_ids, node) { + if (cJSON_AddStringToObject(lcs_client_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_plmn_operator_class_convertToJSON() failed [lcs_client_ids]"); + goto end; + } } - } end: return item; @@ -67,40 +78,44 @@ end: OpenAPI_plmn_operator_class_t *OpenAPI_plmn_operator_class_parseFromJSON(cJSON *plmn_operator_classJSON) { OpenAPI_plmn_operator_class_t *plmn_operator_class_local_var = NULL; - cJSON *lcs_client_class = cJSON_GetObjectItemCaseSensitive(plmn_operator_classJSON, "lcsClientClass"); + OpenAPI_lnode_t *node = NULL; + cJSON *lcs_client_class = NULL; + OpenAPI_lcs_client_class_e lcs_client_classVariable = 0; + cJSON *lcs_client_ids = NULL; + OpenAPI_list_t *lcs_client_idsList = NULL; + lcs_client_class = cJSON_GetObjectItemCaseSensitive(plmn_operator_classJSON, "lcsClientClass"); if (!lcs_client_class) { ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_class]"); goto end; } - - OpenAPI_lcs_client_class_e lcs_client_classVariable; if (!cJSON_IsString(lcs_client_class)) { ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_class]"); goto end; } lcs_client_classVariable = OpenAPI_lcs_client_class_FromString(lcs_client_class->valuestring); - cJSON *lcs_client_ids = cJSON_GetObjectItemCaseSensitive(plmn_operator_classJSON, "lcsClientIds"); + lcs_client_ids = cJSON_GetObjectItemCaseSensitive(plmn_operator_classJSON, "lcsClientIds"); if (!lcs_client_ids) { ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_ids]"); goto end; } + cJSON *lcs_client_ids_local = NULL; + if (!cJSON_IsArray(lcs_client_ids)) { + ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_ids]"); + goto end; + } - OpenAPI_list_t *lcs_client_idsList; - cJSON *lcs_client_ids_local; - if (!cJSON_IsArray(lcs_client_ids)) { - ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_ids]"); - goto end; - } - lcs_client_idsList = OpenAPI_list_create(); + lcs_client_idsList = OpenAPI_list_create(); - cJSON_ArrayForEach(lcs_client_ids_local, lcs_client_ids) { - if (!cJSON_IsString(lcs_client_ids_local)) { - ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_ids]"); - goto end; - } - OpenAPI_list_add(lcs_client_idsList, ogs_strdup(lcs_client_ids_local->valuestring)); - } + cJSON_ArrayForEach(lcs_client_ids_local, lcs_client_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(lcs_client_ids_local)) { + ogs_error("OpenAPI_plmn_operator_class_parseFromJSON() failed [lcs_client_ids]"); + goto end; + } + OpenAPI_list_add(lcs_client_idsList, ogs_strdup(lcs_client_ids_local->valuestring)); + } plmn_operator_class_local_var = OpenAPI_plmn_operator_class_create ( lcs_client_classVariable, @@ -109,6 +124,13 @@ OpenAPI_plmn_operator_class_t *OpenAPI_plmn_operator_class_parseFromJSON(cJSON * return plmn_operator_class_local_var; end: + if (lcs_client_idsList) { + OpenAPI_list_for_each(lcs_client_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(lcs_client_idsList); + lcs_client_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/plmn_operator_class_1.c b/lib/sbi/openapi/model/plmn_operator_class_1.c index b77a24d0a..e52e99fe2 100644 --- a/lib/sbi/openapi/model/plmn_operator_class_1.c +++ b/lib/sbi/openapi/model/plmn_operator_class_1.c @@ -20,20 +20,25 @@ OpenAPI_plmn_operator_class_1_t *OpenAPI_plmn_operator_class_1_create( void OpenAPI_plmn_operator_class_1_free(OpenAPI_plmn_operator_class_1_t *plmn_operator_class_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_operator_class_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(plmn_operator_class_1->lcs_client_ids, node) { - ogs_free(node->data); + if (plmn_operator_class_1->lcs_client_ids) { + OpenAPI_list_for_each(plmn_operator_class_1->lcs_client_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(plmn_operator_class_1->lcs_client_ids); + plmn_operator_class_1->lcs_client_ids = NULL; } - OpenAPI_list_free(plmn_operator_class_1->lcs_client_ids); ogs_free(plmn_operator_class_1); } cJSON *OpenAPI_plmn_operator_class_1_convertToJSON(OpenAPI_plmn_operator_class_1_t *plmn_operator_class_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_operator_class_1 == NULL) { ogs_error("OpenAPI_plmn_operator_class_1_convertToJSON() failed [PlmnOperatorClass_1]"); @@ -41,24 +46,30 @@ cJSON *OpenAPI_plmn_operator_class_1_convertToJSON(OpenAPI_plmn_operator_class_1 } item = cJSON_CreateObject(); + if (plmn_operator_class_1->lcs_client_class == OpenAPI_lcs_client_class_NULL) { + ogs_error("OpenAPI_plmn_operator_class_1_convertToJSON() failed [lcs_client_class]"); + return NULL; + } if (cJSON_AddStringToObject(item, "lcsClientClass", OpenAPI_lcs_client_class_ToString(plmn_operator_class_1->lcs_client_class)) == NULL) { ogs_error("OpenAPI_plmn_operator_class_1_convertToJSON() failed [lcs_client_class]"); goto end; } - cJSON *lcs_client_ids = cJSON_AddArrayToObject(item, "lcsClientIds"); - if (lcs_client_ids == NULL) { + if (!plmn_operator_class_1->lcs_client_ids) { + ogs_error("OpenAPI_plmn_operator_class_1_convertToJSON() failed [lcs_client_ids]"); + return NULL; + } + cJSON *lcs_client_idsList = cJSON_AddArrayToObject(item, "lcsClientIds"); + if (lcs_client_idsList == NULL) { ogs_error("OpenAPI_plmn_operator_class_1_convertToJSON() failed [lcs_client_ids]"); goto end; } - - OpenAPI_lnode_t *lcs_client_ids_node; - OpenAPI_list_for_each(plmn_operator_class_1->lcs_client_ids, lcs_client_ids_node) { - if (cJSON_AddStringToObject(lcs_client_ids, "", (char*)lcs_client_ids_node->data) == NULL) { - ogs_error("OpenAPI_plmn_operator_class_1_convertToJSON() failed [lcs_client_ids]"); - goto end; + OpenAPI_list_for_each(plmn_operator_class_1->lcs_client_ids, node) { + if (cJSON_AddStringToObject(lcs_client_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_plmn_operator_class_1_convertToJSON() failed [lcs_client_ids]"); + goto end; + } } - } end: return item; @@ -67,40 +78,44 @@ end: OpenAPI_plmn_operator_class_1_t *OpenAPI_plmn_operator_class_1_parseFromJSON(cJSON *plmn_operator_class_1JSON) { OpenAPI_plmn_operator_class_1_t *plmn_operator_class_1_local_var = NULL; - cJSON *lcs_client_class = cJSON_GetObjectItemCaseSensitive(plmn_operator_class_1JSON, "lcsClientClass"); + OpenAPI_lnode_t *node = NULL; + cJSON *lcs_client_class = NULL; + OpenAPI_lcs_client_class_e lcs_client_classVariable = 0; + cJSON *lcs_client_ids = NULL; + OpenAPI_list_t *lcs_client_idsList = NULL; + lcs_client_class = cJSON_GetObjectItemCaseSensitive(plmn_operator_class_1JSON, "lcsClientClass"); if (!lcs_client_class) { ogs_error("OpenAPI_plmn_operator_class_1_parseFromJSON() failed [lcs_client_class]"); goto end; } - - OpenAPI_lcs_client_class_e lcs_client_classVariable; if (!cJSON_IsString(lcs_client_class)) { ogs_error("OpenAPI_plmn_operator_class_1_parseFromJSON() failed [lcs_client_class]"); goto end; } lcs_client_classVariable = OpenAPI_lcs_client_class_FromString(lcs_client_class->valuestring); - cJSON *lcs_client_ids = cJSON_GetObjectItemCaseSensitive(plmn_operator_class_1JSON, "lcsClientIds"); + lcs_client_ids = cJSON_GetObjectItemCaseSensitive(plmn_operator_class_1JSON, "lcsClientIds"); if (!lcs_client_ids) { ogs_error("OpenAPI_plmn_operator_class_1_parseFromJSON() failed [lcs_client_ids]"); goto end; } + cJSON *lcs_client_ids_local = NULL; + if (!cJSON_IsArray(lcs_client_ids)) { + ogs_error("OpenAPI_plmn_operator_class_1_parseFromJSON() failed [lcs_client_ids]"); + goto end; + } - OpenAPI_list_t *lcs_client_idsList; - cJSON *lcs_client_ids_local; - if (!cJSON_IsArray(lcs_client_ids)) { - ogs_error("OpenAPI_plmn_operator_class_1_parseFromJSON() failed [lcs_client_ids]"); - goto end; - } - lcs_client_idsList = OpenAPI_list_create(); + lcs_client_idsList = OpenAPI_list_create(); - cJSON_ArrayForEach(lcs_client_ids_local, lcs_client_ids) { - if (!cJSON_IsString(lcs_client_ids_local)) { - ogs_error("OpenAPI_plmn_operator_class_1_parseFromJSON() failed [lcs_client_ids]"); - goto end; - } - OpenAPI_list_add(lcs_client_idsList, ogs_strdup(lcs_client_ids_local->valuestring)); - } + cJSON_ArrayForEach(lcs_client_ids_local, lcs_client_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(lcs_client_ids_local)) { + ogs_error("OpenAPI_plmn_operator_class_1_parseFromJSON() failed [lcs_client_ids]"); + goto end; + } + OpenAPI_list_add(lcs_client_idsList, ogs_strdup(lcs_client_ids_local->valuestring)); + } plmn_operator_class_1_local_var = OpenAPI_plmn_operator_class_1_create ( lcs_client_classVariable, @@ -109,6 +124,13 @@ OpenAPI_plmn_operator_class_1_t *OpenAPI_plmn_operator_class_1_parseFromJSON(cJS return plmn_operator_class_1_local_var; end: + if (lcs_client_idsList) { + OpenAPI_list_for_each(lcs_client_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(lcs_client_idsList); + lcs_client_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/plmn_range.c b/lib/sbi/openapi/model/plmn_range.c index 427abf524..d8a08eeb5 100644 --- a/lib/sbi/openapi/model/plmn_range.c +++ b/lib/sbi/openapi/model/plmn_range.c @@ -22,19 +22,30 @@ OpenAPI_plmn_range_t *OpenAPI_plmn_range_create( void OpenAPI_plmn_range_free(OpenAPI_plmn_range_t *plmn_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(plmn_range->start); - ogs_free(plmn_range->end); - ogs_free(plmn_range->pattern); + if (plmn_range->start) { + ogs_free(plmn_range->start); + plmn_range->start = NULL; + } + if (plmn_range->end) { + ogs_free(plmn_range->end); + plmn_range->end = NULL; + } + if (plmn_range->pattern) { + ogs_free(plmn_range->pattern); + plmn_range->pattern = NULL; + } ogs_free(plmn_range); } cJSON *OpenAPI_plmn_range_convertToJSON(OpenAPI_plmn_range_t *plmn_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_range == NULL) { ogs_error("OpenAPI_plmn_range_convertToJSON() failed [PlmnRange]"); @@ -70,37 +81,38 @@ end: OpenAPI_plmn_range_t *OpenAPI_plmn_range_parseFromJSON(cJSON *plmn_rangeJSON) { OpenAPI_plmn_range_t *plmn_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(plmn_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + cJSON *pattern = NULL; + start = cJSON_GetObjectItemCaseSensitive(plmn_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_plmn_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(plmn_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(plmn_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_plmn_range_parseFromJSON() failed [end]"); goto end; } } - cJSON *pattern = cJSON_GetObjectItemCaseSensitive(plmn_rangeJSON, "pattern"); - + pattern = cJSON_GetObjectItemCaseSensitive(plmn_rangeJSON, "pattern"); if (pattern) { - if (!cJSON_IsString(pattern)) { + if (!cJSON_IsString(pattern) && !cJSON_IsNull(pattern)) { ogs_error("OpenAPI_plmn_range_parseFromJSON() failed [pattern]"); goto end; } } plmn_range_local_var = OpenAPI_plmn_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL, - pattern ? ogs_strdup(pattern->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL, + pattern && !cJSON_IsNull(pattern) ? ogs_strdup(pattern->valuestring) : NULL ); return plmn_range_local_var; diff --git a/lib/sbi/openapi/model/plmn_route_selection_descriptor.c b/lib/sbi/openapi/model/plmn_route_selection_descriptor.c index 2853ca65a..3e2d697e0 100644 --- a/lib/sbi/openapi/model/plmn_route_selection_descriptor.c +++ b/lib/sbi/openapi/model/plmn_route_selection_descriptor.c @@ -20,21 +20,29 @@ OpenAPI_plmn_route_selection_descriptor_t *OpenAPI_plmn_route_selection_descript void OpenAPI_plmn_route_selection_descriptor_free(OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_route_selection_descriptor) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_1_free(plmn_route_selection_descriptor->serving_plmn); - OpenAPI_list_for_each(plmn_route_selection_descriptor->snssai_route_sel_descs, node) { - OpenAPI_snssai_route_selection_descriptor_free(node->data); + if (plmn_route_selection_descriptor->serving_plmn) { + OpenAPI_plmn_id_1_free(plmn_route_selection_descriptor->serving_plmn); + plmn_route_selection_descriptor->serving_plmn = NULL; + } + if (plmn_route_selection_descriptor->snssai_route_sel_descs) { + OpenAPI_list_for_each(plmn_route_selection_descriptor->snssai_route_sel_descs, node) { + OpenAPI_snssai_route_selection_descriptor_free(node->data); + } + OpenAPI_list_free(plmn_route_selection_descriptor->snssai_route_sel_descs); + plmn_route_selection_descriptor->snssai_route_sel_descs = NULL; } - OpenAPI_list_free(plmn_route_selection_descriptor->snssai_route_sel_descs); ogs_free(plmn_route_selection_descriptor); } cJSON *OpenAPI_plmn_route_selection_descriptor_convertToJSON(OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_route_selection_descriptor == NULL) { ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [PlmnRouteSelectionDescriptor]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_plmn_route_selection_descriptor_convertToJSON(OpenAPI_plmn_route_ } item = cJSON_CreateObject(); + if (!plmn_route_selection_descriptor->serving_plmn) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [serving_plmn]"); + return NULL; + } cJSON *serving_plmn_local_JSON = OpenAPI_plmn_id_1_convertToJSON(plmn_route_selection_descriptor->serving_plmn); if (serving_plmn_local_JSON == NULL) { ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [serving_plmn]"); @@ -59,17 +71,13 @@ cJSON *OpenAPI_plmn_route_selection_descriptor_convertToJSON(OpenAPI_plmn_route_ ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [snssai_route_sel_descs]"); goto end; } - - OpenAPI_lnode_t *snssai_route_sel_descs_node; - if (plmn_route_selection_descriptor->snssai_route_sel_descs) { - OpenAPI_list_for_each(plmn_route_selection_descriptor->snssai_route_sel_descs, snssai_route_sel_descs_node) { - cJSON *itemLocal = OpenAPI_snssai_route_selection_descriptor_convertToJSON(snssai_route_sel_descs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [snssai_route_sel_descs]"); - goto end; - } - cJSON_AddItemToArray(snssai_route_sel_descsList, itemLocal); + OpenAPI_list_for_each(plmn_route_selection_descriptor->snssai_route_sel_descs, node) { + cJSON *itemLocal = OpenAPI_snssai_route_selection_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_convertToJSON() failed [snssai_route_sel_descs]"); + goto end; } + cJSON_AddItemToArray(snssai_route_sel_descsList, itemLocal); } } @@ -80,42 +88,41 @@ end: OpenAPI_plmn_route_selection_descriptor_t *OpenAPI_plmn_route_selection_descriptor_parseFromJSON(cJSON *plmn_route_selection_descriptorJSON) { OpenAPI_plmn_route_selection_descriptor_t *plmn_route_selection_descriptor_local_var = NULL; - cJSON *serving_plmn = cJSON_GetObjectItemCaseSensitive(plmn_route_selection_descriptorJSON, "servingPlmn"); + OpenAPI_lnode_t *node = NULL; + cJSON *serving_plmn = NULL; + OpenAPI_plmn_id_1_t *serving_plmn_local_nonprim = NULL; + cJSON *snssai_route_sel_descs = NULL; + OpenAPI_list_t *snssai_route_sel_descsList = NULL; + serving_plmn = cJSON_GetObjectItemCaseSensitive(plmn_route_selection_descriptorJSON, "servingPlmn"); if (!serving_plmn) { ogs_error("OpenAPI_plmn_route_selection_descriptor_parseFromJSON() failed [serving_plmn]"); goto end; } - - OpenAPI_plmn_id_1_t *serving_plmn_local_nonprim = NULL; serving_plmn_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(serving_plmn); - cJSON *snssai_route_sel_descs = cJSON_GetObjectItemCaseSensitive(plmn_route_selection_descriptorJSON, "snssaiRouteSelDescs"); - - OpenAPI_list_t *snssai_route_sel_descsList; + snssai_route_sel_descs = cJSON_GetObjectItemCaseSensitive(plmn_route_selection_descriptorJSON, "snssaiRouteSelDescs"); if (snssai_route_sel_descs) { - cJSON *snssai_route_sel_descs_local_nonprimitive; - if (!cJSON_IsArray(snssai_route_sel_descs)){ - ogs_error("OpenAPI_plmn_route_selection_descriptor_parseFromJSON() failed [snssai_route_sel_descs]"); - goto end; - } - - snssai_route_sel_descsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(snssai_route_sel_descs_local_nonprimitive, snssai_route_sel_descs ) { - if (!cJSON_IsObject(snssai_route_sel_descs_local_nonprimitive)) { + cJSON *snssai_route_sel_descs_local = NULL; + if (!cJSON_IsArray(snssai_route_sel_descs)) { ogs_error("OpenAPI_plmn_route_selection_descriptor_parseFromJSON() failed [snssai_route_sel_descs]"); goto end; } - OpenAPI_snssai_route_selection_descriptor_t *snssai_route_sel_descsItem = OpenAPI_snssai_route_selection_descriptor_parseFromJSON(snssai_route_sel_descs_local_nonprimitive); - if (!snssai_route_sel_descsItem) { - ogs_error("No snssai_route_sel_descsItem"); - OpenAPI_list_free(snssai_route_sel_descsList); - goto end; + snssai_route_sel_descsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssai_route_sel_descs_local, snssai_route_sel_descs) { + if (!cJSON_IsObject(snssai_route_sel_descs_local)) { + ogs_error("OpenAPI_plmn_route_selection_descriptor_parseFromJSON() failed [snssai_route_sel_descs]"); + goto end; + } + OpenAPI_snssai_route_selection_descriptor_t *snssai_route_sel_descsItem = OpenAPI_snssai_route_selection_descriptor_parseFromJSON(snssai_route_sel_descs_local); + if (!snssai_route_sel_descsItem) { + ogs_error("No snssai_route_sel_descsItem"); + OpenAPI_list_free(snssai_route_sel_descsList); + goto end; + } + OpenAPI_list_add(snssai_route_sel_descsList, snssai_route_sel_descsItem); } - - OpenAPI_list_add(snssai_route_sel_descsList, snssai_route_sel_descsItem); - } } plmn_route_selection_descriptor_local_var = OpenAPI_plmn_route_selection_descriptor_create ( @@ -125,6 +132,17 @@ OpenAPI_plmn_route_selection_descriptor_t *OpenAPI_plmn_route_selection_descript return plmn_route_selection_descriptor_local_var; end: + if (serving_plmn_local_nonprim) { + OpenAPI_plmn_id_1_free(serving_plmn_local_nonprim); + serving_plmn_local_nonprim = NULL; + } + if (snssai_route_sel_descsList) { + OpenAPI_list_for_each(snssai_route_sel_descsList, node) { + OpenAPI_snssai_route_selection_descriptor_free(node->data); + } + OpenAPI_list_free(snssai_route_sel_descsList); + snssai_route_sel_descsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/plmn_snssai.c b/lib/sbi/openapi/model/plmn_snssai.c index e8190e8ff..603e2612e 100644 --- a/lib/sbi/openapi/model/plmn_snssai.c +++ b/lib/sbi/openapi/model/plmn_snssai.c @@ -22,22 +22,33 @@ OpenAPI_plmn_snssai_t *OpenAPI_plmn_snssai_create( void OpenAPI_plmn_snssai_free(OpenAPI_plmn_snssai_t *plmn_snssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == plmn_snssai) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(plmn_snssai->plmn_id); - OpenAPI_list_for_each(plmn_snssai->s_nssai_list, node) { - OpenAPI_ext_snssai_free(node->data); + if (plmn_snssai->plmn_id) { + OpenAPI_plmn_id_free(plmn_snssai->plmn_id); + plmn_snssai->plmn_id = NULL; + } + if (plmn_snssai->s_nssai_list) { + OpenAPI_list_for_each(plmn_snssai->s_nssai_list, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(plmn_snssai->s_nssai_list); + plmn_snssai->s_nssai_list = NULL; + } + if (plmn_snssai->nid) { + ogs_free(plmn_snssai->nid); + plmn_snssai->nid = NULL; } - OpenAPI_list_free(plmn_snssai->s_nssai_list); - ogs_free(plmn_snssai->nid); ogs_free(plmn_snssai); } cJSON *OpenAPI_plmn_snssai_convertToJSON(OpenAPI_plmn_snssai_t *plmn_snssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (plmn_snssai == NULL) { ogs_error("OpenAPI_plmn_snssai_convertToJSON() failed [PlmnSnssai]"); @@ -45,6 +56,10 @@ cJSON *OpenAPI_plmn_snssai_convertToJSON(OpenAPI_plmn_snssai_t *plmn_snssai) } item = cJSON_CreateObject(); + if (!plmn_snssai->plmn_id) { + ogs_error("OpenAPI_plmn_snssai_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(plmn_snssai->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_plmn_snssai_convertToJSON() failed [plmn_id]"); @@ -56,22 +71,22 @@ cJSON *OpenAPI_plmn_snssai_convertToJSON(OpenAPI_plmn_snssai_t *plmn_snssai) goto end; } + if (!plmn_snssai->s_nssai_list) { + ogs_error("OpenAPI_plmn_snssai_convertToJSON() failed [s_nssai_list]"); + return NULL; + } cJSON *s_nssai_listList = cJSON_AddArrayToObject(item, "sNssaiList"); if (s_nssai_listList == NULL) { ogs_error("OpenAPI_plmn_snssai_convertToJSON() failed [s_nssai_list]"); goto end; } - - OpenAPI_lnode_t *s_nssai_list_node; - if (plmn_snssai->s_nssai_list) { - OpenAPI_list_for_each(plmn_snssai->s_nssai_list, s_nssai_list_node) { - cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(s_nssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_plmn_snssai_convertToJSON() failed [s_nssai_list]"); - goto end; - } - cJSON_AddItemToArray(s_nssai_listList, itemLocal); + OpenAPI_list_for_each(plmn_snssai->s_nssai_list, node) { + cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_plmn_snssai_convertToJSON() failed [s_nssai_list]"); + goto end; } + cJSON_AddItemToArray(s_nssai_listList, itemLocal); } if (plmn_snssai->nid) { @@ -88,50 +103,49 @@ end: OpenAPI_plmn_snssai_t *OpenAPI_plmn_snssai_parseFromJSON(cJSON *plmn_snssaiJSON) { OpenAPI_plmn_snssai_t *plmn_snssai_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(plmn_snssaiJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *s_nssai_list = NULL; + OpenAPI_list_t *s_nssai_listList = NULL; + cJSON *nid = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(plmn_snssaiJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_plmn_snssai_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *s_nssai_list = cJSON_GetObjectItemCaseSensitive(plmn_snssaiJSON, "sNssaiList"); + s_nssai_list = cJSON_GetObjectItemCaseSensitive(plmn_snssaiJSON, "sNssaiList"); if (!s_nssai_list) { ogs_error("OpenAPI_plmn_snssai_parseFromJSON() failed [s_nssai_list]"); goto end; } - - OpenAPI_list_t *s_nssai_listList; - cJSON *s_nssai_list_local_nonprimitive; - if (!cJSON_IsArray(s_nssai_list)){ - ogs_error("OpenAPI_plmn_snssai_parseFromJSON() failed [s_nssai_list]"); - goto end; - } - - s_nssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(s_nssai_list_local_nonprimitive, s_nssai_list ) { - if (!cJSON_IsObject(s_nssai_list_local_nonprimitive)) { + cJSON *s_nssai_list_local = NULL; + if (!cJSON_IsArray(s_nssai_list)) { ogs_error("OpenAPI_plmn_snssai_parseFromJSON() failed [s_nssai_list]"); goto end; } - OpenAPI_ext_snssai_t *s_nssai_listItem = OpenAPI_ext_snssai_parseFromJSON(s_nssai_list_local_nonprimitive); - if (!s_nssai_listItem) { - ogs_error("No s_nssai_listItem"); - OpenAPI_list_free(s_nssai_listList); - goto end; + s_nssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(s_nssai_list_local, s_nssai_list) { + if (!cJSON_IsObject(s_nssai_list_local)) { + ogs_error("OpenAPI_plmn_snssai_parseFromJSON() failed [s_nssai_list]"); + goto end; + } + OpenAPI_ext_snssai_t *s_nssai_listItem = OpenAPI_ext_snssai_parseFromJSON(s_nssai_list_local); + if (!s_nssai_listItem) { + ogs_error("No s_nssai_listItem"); + OpenAPI_list_free(s_nssai_listList); + goto end; + } + OpenAPI_list_add(s_nssai_listList, s_nssai_listItem); } - OpenAPI_list_add(s_nssai_listList, s_nssai_listItem); - } - - cJSON *nid = cJSON_GetObjectItemCaseSensitive(plmn_snssaiJSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(plmn_snssaiJSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_plmn_snssai_parseFromJSON() failed [nid]"); goto end; } @@ -140,11 +154,22 @@ OpenAPI_plmn_snssai_t *OpenAPI_plmn_snssai_parseFromJSON(cJSON *plmn_snssaiJSON) plmn_snssai_local_var = OpenAPI_plmn_snssai_create ( plmn_id_local_nonprim, s_nssai_listList, - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return plmn_snssai_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (s_nssai_listList) { + OpenAPI_list_for_each(s_nssai_listList, node) { + OpenAPI_ext_snssai_free(node->data); + } + OpenAPI_list_free(s_nssai_listList); + s_nssai_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point.c b/lib/sbi/openapi/model/point.c index 94b398907..acd2144f2 100644 --- a/lib/sbi/openapi/model/point.c +++ b/lib/sbi/openapi/model/point.c @@ -20,18 +20,26 @@ OpenAPI_point_t *OpenAPI_point_create( void OpenAPI_point_free(OpenAPI_point_t *point) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(point->shape); - OpenAPI_geographical_coordinates_free(point->point); + if (point->shape) { + OpenAPI_supported_gad_shapes_free(point->shape); + point->shape = NULL; + } + if (point->point) { + OpenAPI_geographical_coordinates_free(point->point); + point->point = NULL; + } ogs_free(point); } cJSON *OpenAPI_point_convertToJSON(OpenAPI_point_t *point) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point == NULL) { ogs_error("OpenAPI_point_convertToJSON() failed [Point]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_point_convertToJSON(OpenAPI_point_t *point) } item = cJSON_CreateObject(); + if (!point->shape) { + ogs_error("OpenAPI_point_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_point_convertToJSON() failed [shape]"); @@ -50,6 +62,10 @@ cJSON *OpenAPI_point_convertToJSON(OpenAPI_point_t *point) goto end; } + if (!point->point) { + ogs_error("OpenAPI_point_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_convertToJSON() failed [point]"); @@ -68,22 +84,23 @@ end: OpenAPI_point_t *OpenAPI_point_parseFromJSON(cJSON *pointJSON) { OpenAPI_point_t *point_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(pointJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + shape = cJSON_GetObjectItemCaseSensitive(pointJSON, "shape"); if (!shape) { ogs_error("OpenAPI_point_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); - cJSON *point = cJSON_GetObjectItemCaseSensitive(pointJSON, "point"); + point = cJSON_GetObjectItemCaseSensitive(pointJSON, "point"); if (!point) { ogs_error("OpenAPI_point_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); point_local_var = OpenAPI_point_create ( @@ -93,6 +110,14 @@ OpenAPI_point_t *OpenAPI_point_parseFromJSON(cJSON *pointJSON) return point_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point.h b/lib/sbi/openapi/model/point.h index ebf66cb32..93acc3932 100644 --- a/lib/sbi/openapi/model/point.h +++ b/lib/sbi/openapi/model/point.h @@ -14,7 +14,6 @@ #include "../include/binary.h" #include "gad_shape.h" #include "geographical_coordinates.h" -#include "point_all_of.h" #include "supported_gad_shapes.h" #ifdef __cplusplus diff --git a/lib/sbi/openapi/model/point_all_of.c b/lib/sbi/openapi/model/point_all_of.c index 393ee3556..ddc3cabce 100644 --- a/lib/sbi/openapi/model/point_all_of.c +++ b/lib/sbi/openapi/model/point_all_of.c @@ -18,17 +18,22 @@ OpenAPI_point_all_of_t *OpenAPI_point_all_of_create( void OpenAPI_point_all_of_free(OpenAPI_point_all_of_t *point_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_all_of) { return; } - OpenAPI_lnode_t *node; - OpenAPI_geographical_coordinates_free(point_all_of->point); + if (point_all_of->point) { + OpenAPI_geographical_coordinates_free(point_all_of->point); + point_all_of->point = NULL; + } ogs_free(point_all_of); } cJSON *OpenAPI_point_all_of_convertToJSON(OpenAPI_point_all_of_t *point_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_all_of == NULL) { ogs_error("OpenAPI_point_all_of_convertToJSON() failed [Point_allOf]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_point_all_of_convertToJSON(OpenAPI_point_all_of_t *point_all_of) } item = cJSON_CreateObject(); + if (!point_all_of->point) { + ogs_error("OpenAPI_point_all_of_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_all_of->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_all_of_convertToJSON() failed [point]"); @@ -54,13 +63,14 @@ end: OpenAPI_point_all_of_t *OpenAPI_point_all_of_parseFromJSON(cJSON *point_all_ofJSON) { OpenAPI_point_all_of_t *point_all_of_local_var = NULL; - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_all_ofJSON, "point"); + OpenAPI_lnode_t *node = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + point = cJSON_GetObjectItemCaseSensitive(point_all_ofJSON, "point"); if (!point) { ogs_error("OpenAPI_point_all_of_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); point_all_of_local_var = OpenAPI_point_all_of_create ( @@ -69,6 +79,10 @@ OpenAPI_point_all_of_t *OpenAPI_point_all_of_parseFromJSON(cJSON *point_all_ofJS return point_all_of_local_var; end: + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point_altitude.c b/lib/sbi/openapi/model/point_altitude.c index 11bc0385f..c924da9f7 100644 --- a/lib/sbi/openapi/model/point_altitude.c +++ b/lib/sbi/openapi/model/point_altitude.c @@ -22,18 +22,26 @@ OpenAPI_point_altitude_t *OpenAPI_point_altitude_create( void OpenAPI_point_altitude_free(OpenAPI_point_altitude_t *point_altitude) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_altitude) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(point_altitude->shape); - OpenAPI_geographical_coordinates_free(point_altitude->point); + if (point_altitude->shape) { + OpenAPI_supported_gad_shapes_free(point_altitude->shape); + point_altitude->shape = NULL; + } + if (point_altitude->point) { + OpenAPI_geographical_coordinates_free(point_altitude->point); + point_altitude->point = NULL; + } ogs_free(point_altitude); } cJSON *OpenAPI_point_altitude_convertToJSON(OpenAPI_point_altitude_t *point_altitude) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_altitude == NULL) { ogs_error("OpenAPI_point_altitude_convertToJSON() failed [PointAltitude]"); @@ -41,6 +49,10 @@ cJSON *OpenAPI_point_altitude_convertToJSON(OpenAPI_point_altitude_t *point_alti } item = cJSON_CreateObject(); + if (!point_altitude->shape) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_altitude->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_point_altitude_convertToJSON() failed [shape]"); @@ -52,6 +64,10 @@ cJSON *OpenAPI_point_altitude_convertToJSON(OpenAPI_point_altitude_t *point_alti goto end; } + if (!point_altitude->point) { + ogs_error("OpenAPI_point_altitude_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_altitude->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_altitude_convertToJSON() failed [point]"); @@ -75,30 +91,31 @@ end: OpenAPI_point_altitude_t *OpenAPI_point_altitude_parseFromJSON(cJSON *point_altitudeJSON) { OpenAPI_point_altitude_t *point_altitude_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *altitude = NULL; + shape = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "shape"); if (!shape) { ogs_error("OpenAPI_point_altitude_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "point"); + point = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "point"); if (!point) { ogs_error("OpenAPI_point_altitude_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *altitude = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "altitude"); + altitude = cJSON_GetObjectItemCaseSensitive(point_altitudeJSON, "altitude"); if (!altitude) { ogs_error("OpenAPI_point_altitude_parseFromJSON() failed [altitude]"); goto end; } - if (!cJSON_IsNumber(altitude)) { ogs_error("OpenAPI_point_altitude_parseFromJSON() failed [altitude]"); goto end; @@ -113,6 +130,14 @@ OpenAPI_point_altitude_t *OpenAPI_point_altitude_parseFromJSON(cJSON *point_alti return point_altitude_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point_altitude.h b/lib/sbi/openapi/model/point_altitude.h index 19bc28618..e28acc458 100644 --- a/lib/sbi/openapi/model/point_altitude.h +++ b/lib/sbi/openapi/model/point_altitude.h @@ -14,7 +14,6 @@ #include "../include/binary.h" #include "gad_shape.h" #include "geographical_coordinates.h" -#include "point_altitude_all_of.h" #include "supported_gad_shapes.h" #ifdef __cplusplus diff --git a/lib/sbi/openapi/model/point_altitude_all_of.c b/lib/sbi/openapi/model/point_altitude_all_of.c index 9af2e3c27..5cd1847d7 100644 --- a/lib/sbi/openapi/model/point_altitude_all_of.c +++ b/lib/sbi/openapi/model/point_altitude_all_of.c @@ -20,17 +20,22 @@ OpenAPI_point_altitude_all_of_t *OpenAPI_point_altitude_all_of_create( void OpenAPI_point_altitude_all_of_free(OpenAPI_point_altitude_all_of_t *point_altitude_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_altitude_all_of) { return; } - OpenAPI_lnode_t *node; - OpenAPI_geographical_coordinates_free(point_altitude_all_of->point); + if (point_altitude_all_of->point) { + OpenAPI_geographical_coordinates_free(point_altitude_all_of->point); + point_altitude_all_of->point = NULL; + } ogs_free(point_altitude_all_of); } cJSON *OpenAPI_point_altitude_all_of_convertToJSON(OpenAPI_point_altitude_all_of_t *point_altitude_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_altitude_all_of == NULL) { ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [PointAltitude_allOf]"); @@ -38,6 +43,10 @@ cJSON *OpenAPI_point_altitude_all_of_convertToJSON(OpenAPI_point_altitude_all_of } item = cJSON_CreateObject(); + if (!point_altitude_all_of->point) { + ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_altitude_all_of->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_altitude_all_of_convertToJSON() failed [point]"); @@ -61,21 +70,22 @@ end: OpenAPI_point_altitude_all_of_t *OpenAPI_point_altitude_all_of_parseFromJSON(cJSON *point_altitude_all_ofJSON) { OpenAPI_point_altitude_all_of_t *point_altitude_all_of_local_var = NULL; - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_altitude_all_ofJSON, "point"); + OpenAPI_lnode_t *node = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *altitude = NULL; + point = cJSON_GetObjectItemCaseSensitive(point_altitude_all_ofJSON, "point"); if (!point) { ogs_error("OpenAPI_point_altitude_all_of_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_all_ofJSON, "altitude"); + altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_all_ofJSON, "altitude"); if (!altitude) { ogs_error("OpenAPI_point_altitude_all_of_parseFromJSON() failed [altitude]"); goto end; } - if (!cJSON_IsNumber(altitude)) { ogs_error("OpenAPI_point_altitude_all_of_parseFromJSON() failed [altitude]"); goto end; @@ -89,6 +99,10 @@ OpenAPI_point_altitude_all_of_t *OpenAPI_point_altitude_all_of_parseFromJSON(cJS return point_altitude_all_of_local_var; end: + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point_altitude_uncertainty.c b/lib/sbi/openapi/model/point_altitude_uncertainty.c index 57072b713..a33589a08 100644 --- a/lib/sbi/openapi/model/point_altitude_uncertainty.c +++ b/lib/sbi/openapi/model/point_altitude_uncertainty.c @@ -28,19 +28,30 @@ OpenAPI_point_altitude_uncertainty_t *OpenAPI_point_altitude_uncertainty_create( void OpenAPI_point_altitude_uncertainty_free(OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_altitude_uncertainty) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(point_altitude_uncertainty->shape); - OpenAPI_geographical_coordinates_free(point_altitude_uncertainty->point); - OpenAPI_uncertainty_ellipse_free(point_altitude_uncertainty->uncertainty_ellipse); + if (point_altitude_uncertainty->shape) { + OpenAPI_supported_gad_shapes_free(point_altitude_uncertainty->shape); + point_altitude_uncertainty->shape = NULL; + } + if (point_altitude_uncertainty->point) { + OpenAPI_geographical_coordinates_free(point_altitude_uncertainty->point); + point_altitude_uncertainty->point = NULL; + } + if (point_altitude_uncertainty->uncertainty_ellipse) { + OpenAPI_uncertainty_ellipse_free(point_altitude_uncertainty->uncertainty_ellipse); + point_altitude_uncertainty->uncertainty_ellipse = NULL; + } ogs_free(point_altitude_uncertainty); } cJSON *OpenAPI_point_altitude_uncertainty_convertToJSON(OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_altitude_uncertainty == NULL) { ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [PointAltitudeUncertainty]"); @@ -48,6 +59,10 @@ cJSON *OpenAPI_point_altitude_uncertainty_convertToJSON(OpenAPI_point_altitude_u } item = cJSON_CreateObject(); + if (!point_altitude_uncertainty->shape) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_altitude_uncertainty->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [shape]"); @@ -59,6 +74,10 @@ cJSON *OpenAPI_point_altitude_uncertainty_convertToJSON(OpenAPI_point_altitude_u goto end; } + if (!point_altitude_uncertainty->point) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_altitude_uncertainty->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [point]"); @@ -75,6 +94,10 @@ cJSON *OpenAPI_point_altitude_uncertainty_convertToJSON(OpenAPI_point_altitude_u goto end; } + if (!point_altitude_uncertainty->uncertainty_ellipse) { + ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [uncertainty_ellipse]"); + return NULL; + } cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(point_altitude_uncertainty->uncertainty_ellipse); if (uncertainty_ellipse_local_JSON == NULL) { ogs_error("OpenAPI_point_altitude_uncertainty_convertToJSON() failed [uncertainty_ellipse]"); @@ -103,61 +126,62 @@ end: OpenAPI_point_altitude_uncertainty_t *OpenAPI_point_altitude_uncertainty_parseFromJSON(cJSON *point_altitude_uncertaintyJSON) { OpenAPI_point_altitude_uncertainty_t *point_altitude_uncertainty_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *altitude = NULL; + cJSON *uncertainty_ellipse = NULL; + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + cJSON *uncertainty_altitude = NULL; + cJSON *confidence = NULL; + shape = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "shape"); if (!shape) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "point"); + point = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "point"); if (!point) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "altitude"); + altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "altitude"); if (!altitude) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [altitude]"); goto end; } - if (!cJSON_IsNumber(altitude)) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [altitude]"); goto end; } - cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "uncertaintyEllipse"); + uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "uncertaintyEllipse"); if (!uncertainty_ellipse) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [uncertainty_ellipse]"); goto end; } - - OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); - cJSON *uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "uncertaintyAltitude"); + uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "uncertaintyAltitude"); if (!uncertainty_altitude) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [uncertainty_altitude]"); goto end; } - if (!cJSON_IsNumber(uncertainty_altitude)) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [uncertainty_altitude]"); goto end; } - cJSON *confidence = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "confidence"); + confidence = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertaintyJSON, "confidence"); if (!confidence) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [confidence]"); goto end; } - if (!cJSON_IsNumber(confidence)) { ogs_error("OpenAPI_point_altitude_uncertainty_parseFromJSON() failed [confidence]"); goto end; @@ -177,6 +201,18 @@ OpenAPI_point_altitude_uncertainty_t *OpenAPI_point_altitude_uncertainty_parseFr return point_altitude_uncertainty_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } + if (uncertainty_ellipse_local_nonprim) { + OpenAPI_uncertainty_ellipse_free(uncertainty_ellipse_local_nonprim); + uncertainty_ellipse_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point_altitude_uncertainty.h b/lib/sbi/openapi/model/point_altitude_uncertainty.h index 9b7dd9e67..16414d176 100644 --- a/lib/sbi/openapi/model/point_altitude_uncertainty.h +++ b/lib/sbi/openapi/model/point_altitude_uncertainty.h @@ -14,7 +14,6 @@ #include "../include/binary.h" #include "gad_shape.h" #include "geographical_coordinates.h" -#include "point_altitude_uncertainty_all_of.h" #include "supported_gad_shapes.h" #include "uncertainty_ellipse.h" diff --git a/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.c b/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.c index bf771a76b..e3a3d1568 100644 --- a/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.c +++ b/lib/sbi/openapi/model/point_altitude_uncertainty_all_of.c @@ -26,18 +26,26 @@ OpenAPI_point_altitude_uncertainty_all_of_t *OpenAPI_point_altitude_uncertainty_ void OpenAPI_point_altitude_uncertainty_all_of_free(OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_altitude_uncertainty_all_of) { return; } - OpenAPI_lnode_t *node; - OpenAPI_geographical_coordinates_free(point_altitude_uncertainty_all_of->point); - OpenAPI_uncertainty_ellipse_free(point_altitude_uncertainty_all_of->uncertainty_ellipse); + if (point_altitude_uncertainty_all_of->point) { + OpenAPI_geographical_coordinates_free(point_altitude_uncertainty_all_of->point); + point_altitude_uncertainty_all_of->point = NULL; + } + if (point_altitude_uncertainty_all_of->uncertainty_ellipse) { + OpenAPI_uncertainty_ellipse_free(point_altitude_uncertainty_all_of->uncertainty_ellipse); + point_altitude_uncertainty_all_of->uncertainty_ellipse = NULL; + } ogs_free(point_altitude_uncertainty_all_of); } cJSON *OpenAPI_point_altitude_uncertainty_all_of_convertToJSON(OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_altitude_uncertainty_all_of == NULL) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [PointAltitudeUncertainty_allOf]"); @@ -45,6 +53,10 @@ cJSON *OpenAPI_point_altitude_uncertainty_all_of_convertToJSON(OpenAPI_point_alt } item = cJSON_CreateObject(); + if (!point_altitude_uncertainty_all_of->point) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_altitude_uncertainty_all_of->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [point]"); @@ -61,6 +73,10 @@ cJSON *OpenAPI_point_altitude_uncertainty_all_of_convertToJSON(OpenAPI_point_alt goto end; } + if (!point_altitude_uncertainty_all_of->uncertainty_ellipse) { + ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [uncertainty_ellipse]"); + return NULL; + } cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(point_altitude_uncertainty_all_of->uncertainty_ellipse); if (uncertainty_ellipse_local_JSON == NULL) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_convertToJSON() failed [uncertainty_ellipse]"); @@ -89,52 +105,53 @@ end: OpenAPI_point_altitude_uncertainty_all_of_t *OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON(cJSON *point_altitude_uncertainty_all_ofJSON) { OpenAPI_point_altitude_uncertainty_all_of_t *point_altitude_uncertainty_all_of_local_var = NULL; - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "point"); + OpenAPI_lnode_t *node = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *altitude = NULL; + cJSON *uncertainty_ellipse = NULL; + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + cJSON *uncertainty_altitude = NULL; + cJSON *confidence = NULL; + point = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "point"); if (!point) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "altitude"); + altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "altitude"); if (!altitude) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [altitude]"); goto end; } - if (!cJSON_IsNumber(altitude)) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [altitude]"); goto end; } - cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "uncertaintyEllipse"); + uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "uncertaintyEllipse"); if (!uncertainty_ellipse) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [uncertainty_ellipse]"); goto end; } - - OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); - cJSON *uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "uncertaintyAltitude"); + uncertainty_altitude = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "uncertaintyAltitude"); if (!uncertainty_altitude) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [uncertainty_altitude]"); goto end; } - if (!cJSON_IsNumber(uncertainty_altitude)) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [uncertainty_altitude]"); goto end; } - cJSON *confidence = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "confidence"); + confidence = cJSON_GetObjectItemCaseSensitive(point_altitude_uncertainty_all_ofJSON, "confidence"); if (!confidence) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [confidence]"); goto end; } - if (!cJSON_IsNumber(confidence)) { ogs_error("OpenAPI_point_altitude_uncertainty_all_of_parseFromJSON() failed [confidence]"); goto end; @@ -153,6 +170,14 @@ OpenAPI_point_altitude_uncertainty_all_of_t *OpenAPI_point_altitude_uncertainty_ return point_altitude_uncertainty_all_of_local_var; end: + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } + if (uncertainty_ellipse_local_nonprim) { + OpenAPI_uncertainty_ellipse_free(uncertainty_ellipse_local_nonprim); + uncertainty_ellipse_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point_uncertainty_circle.c b/lib/sbi/openapi/model/point_uncertainty_circle.c index 11c046bf2..228f5ea0f 100644 --- a/lib/sbi/openapi/model/point_uncertainty_circle.c +++ b/lib/sbi/openapi/model/point_uncertainty_circle.c @@ -22,18 +22,26 @@ OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_create( void OpenAPI_point_uncertainty_circle_free(OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_uncertainty_circle) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(point_uncertainty_circle->shape); - OpenAPI_geographical_coordinates_free(point_uncertainty_circle->point); + if (point_uncertainty_circle->shape) { + OpenAPI_supported_gad_shapes_free(point_uncertainty_circle->shape); + point_uncertainty_circle->shape = NULL; + } + if (point_uncertainty_circle->point) { + OpenAPI_geographical_coordinates_free(point_uncertainty_circle->point); + point_uncertainty_circle->point = NULL; + } ogs_free(point_uncertainty_circle); } cJSON *OpenAPI_point_uncertainty_circle_convertToJSON(OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_uncertainty_circle == NULL) { ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [PointUncertaintyCircle]"); @@ -41,6 +49,10 @@ cJSON *OpenAPI_point_uncertainty_circle_convertToJSON(OpenAPI_point_uncertainty_ } item = cJSON_CreateObject(); + if (!point_uncertainty_circle->shape) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_uncertainty_circle->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [shape]"); @@ -52,6 +64,10 @@ cJSON *OpenAPI_point_uncertainty_circle_convertToJSON(OpenAPI_point_uncertainty_ goto end; } + if (!point_uncertainty_circle->point) { + ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_circle->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_uncertainty_circle_convertToJSON() failed [point]"); @@ -75,30 +91,31 @@ end: OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_parseFromJSON(cJSON *point_uncertainty_circleJSON) { OpenAPI_point_uncertainty_circle_t *point_uncertainty_circle_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *uncertainty = NULL; + shape = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "shape"); if (!shape) { ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "point"); + point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "point"); if (!point) { ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *uncertainty = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "uncertainty"); + uncertainty = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circleJSON, "uncertainty"); if (!uncertainty) { ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [uncertainty]"); goto end; } - if (!cJSON_IsNumber(uncertainty)) { ogs_error("OpenAPI_point_uncertainty_circle_parseFromJSON() failed [uncertainty]"); goto end; @@ -113,6 +130,14 @@ OpenAPI_point_uncertainty_circle_t *OpenAPI_point_uncertainty_circle_parseFromJS return point_uncertainty_circle_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point_uncertainty_circle.h b/lib/sbi/openapi/model/point_uncertainty_circle.h index f598f03e1..945bc02b4 100644 --- a/lib/sbi/openapi/model/point_uncertainty_circle.h +++ b/lib/sbi/openapi/model/point_uncertainty_circle.h @@ -14,7 +14,6 @@ #include "../include/binary.h" #include "gad_shape.h" #include "geographical_coordinates.h" -#include "point_uncertainty_circle_all_of.h" #include "supported_gad_shapes.h" #ifdef __cplusplus diff --git a/lib/sbi/openapi/model/point_uncertainty_circle_all_of.c b/lib/sbi/openapi/model/point_uncertainty_circle_all_of.c index 7cea3759e..6b25b9a85 100644 --- a/lib/sbi/openapi/model/point_uncertainty_circle_all_of.c +++ b/lib/sbi/openapi/model/point_uncertainty_circle_all_of.c @@ -20,17 +20,22 @@ OpenAPI_point_uncertainty_circle_all_of_t *OpenAPI_point_uncertainty_circle_all_ void OpenAPI_point_uncertainty_circle_all_of_free(OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_uncertainty_circle_all_of) { return; } - OpenAPI_lnode_t *node; - OpenAPI_geographical_coordinates_free(point_uncertainty_circle_all_of->point); + if (point_uncertainty_circle_all_of->point) { + OpenAPI_geographical_coordinates_free(point_uncertainty_circle_all_of->point); + point_uncertainty_circle_all_of->point = NULL; + } ogs_free(point_uncertainty_circle_all_of); } cJSON *OpenAPI_point_uncertainty_circle_all_of_convertToJSON(OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_uncertainty_circle_all_of == NULL) { ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [PointUncertaintyCircle_allOf]"); @@ -38,6 +43,10 @@ cJSON *OpenAPI_point_uncertainty_circle_all_of_convertToJSON(OpenAPI_point_uncer } item = cJSON_CreateObject(); + if (!point_uncertainty_circle_all_of->point) { + ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_circle_all_of->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_uncertainty_circle_all_of_convertToJSON() failed [point]"); @@ -61,21 +70,22 @@ end: OpenAPI_point_uncertainty_circle_all_of_t *OpenAPI_point_uncertainty_circle_all_of_parseFromJSON(cJSON *point_uncertainty_circle_all_ofJSON) { OpenAPI_point_uncertainty_circle_all_of_t *point_uncertainty_circle_all_of_local_var = NULL; - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circle_all_ofJSON, "point"); + OpenAPI_lnode_t *node = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *uncertainty = NULL; + point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circle_all_ofJSON, "point"); if (!point) { ogs_error("OpenAPI_point_uncertainty_circle_all_of_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *uncertainty = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circle_all_ofJSON, "uncertainty"); + uncertainty = cJSON_GetObjectItemCaseSensitive(point_uncertainty_circle_all_ofJSON, "uncertainty"); if (!uncertainty) { ogs_error("OpenAPI_point_uncertainty_circle_all_of_parseFromJSON() failed [uncertainty]"); goto end; } - if (!cJSON_IsNumber(uncertainty)) { ogs_error("OpenAPI_point_uncertainty_circle_all_of_parseFromJSON() failed [uncertainty]"); goto end; @@ -89,6 +99,10 @@ OpenAPI_point_uncertainty_circle_all_of_t *OpenAPI_point_uncertainty_circle_all_ return point_uncertainty_circle_all_of_local_var; end: + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point_uncertainty_ellipse.c b/lib/sbi/openapi/model/point_uncertainty_ellipse.c index 7be8573fb..477353015 100644 --- a/lib/sbi/openapi/model/point_uncertainty_ellipse.c +++ b/lib/sbi/openapi/model/point_uncertainty_ellipse.c @@ -24,19 +24,30 @@ OpenAPI_point_uncertainty_ellipse_t *OpenAPI_point_uncertainty_ellipse_create( void OpenAPI_point_uncertainty_ellipse_free(OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_uncertainty_ellipse) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(point_uncertainty_ellipse->shape); - OpenAPI_geographical_coordinates_free(point_uncertainty_ellipse->point); - OpenAPI_uncertainty_ellipse_free(point_uncertainty_ellipse->uncertainty_ellipse); + if (point_uncertainty_ellipse->shape) { + OpenAPI_supported_gad_shapes_free(point_uncertainty_ellipse->shape); + point_uncertainty_ellipse->shape = NULL; + } + if (point_uncertainty_ellipse->point) { + OpenAPI_geographical_coordinates_free(point_uncertainty_ellipse->point); + point_uncertainty_ellipse->point = NULL; + } + if (point_uncertainty_ellipse->uncertainty_ellipse) { + OpenAPI_uncertainty_ellipse_free(point_uncertainty_ellipse->uncertainty_ellipse); + point_uncertainty_ellipse->uncertainty_ellipse = NULL; + } ogs_free(point_uncertainty_ellipse); } cJSON *OpenAPI_point_uncertainty_ellipse_convertToJSON(OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_uncertainty_ellipse == NULL) { ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [PointUncertaintyEllipse]"); @@ -44,6 +55,10 @@ cJSON *OpenAPI_point_uncertainty_ellipse_convertToJSON(OpenAPI_point_uncertainty } item = cJSON_CreateObject(); + if (!point_uncertainty_ellipse->shape) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(point_uncertainty_ellipse->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [shape]"); @@ -55,6 +70,10 @@ cJSON *OpenAPI_point_uncertainty_ellipse_convertToJSON(OpenAPI_point_uncertainty goto end; } + if (!point_uncertainty_ellipse->point) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_ellipse->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [point]"); @@ -66,6 +85,10 @@ cJSON *OpenAPI_point_uncertainty_ellipse_convertToJSON(OpenAPI_point_uncertainty goto end; } + if (!point_uncertainty_ellipse->uncertainty_ellipse) { + ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [uncertainty_ellipse]"); + return NULL; + } cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(point_uncertainty_ellipse->uncertainty_ellipse); if (uncertainty_ellipse_local_JSON == NULL) { ogs_error("OpenAPI_point_uncertainty_ellipse_convertToJSON() failed [uncertainty_ellipse]"); @@ -89,39 +112,40 @@ end: OpenAPI_point_uncertainty_ellipse_t *OpenAPI_point_uncertainty_ellipse_parseFromJSON(cJSON *point_uncertainty_ellipseJSON) { OpenAPI_point_uncertainty_ellipse_t *point_uncertainty_ellipse_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *uncertainty_ellipse = NULL; + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + cJSON *confidence = NULL; + shape = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "shape"); if (!shape) { ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "point"); + point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "point"); if (!point) { ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "uncertaintyEllipse"); + uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "uncertaintyEllipse"); if (!uncertainty_ellipse) { ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [uncertainty_ellipse]"); goto end; } - - OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); - cJSON *confidence = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "confidence"); + confidence = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipseJSON, "confidence"); if (!confidence) { ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [confidence]"); goto end; } - if (!cJSON_IsNumber(confidence)) { ogs_error("OpenAPI_point_uncertainty_ellipse_parseFromJSON() failed [confidence]"); goto end; @@ -137,6 +161,18 @@ OpenAPI_point_uncertainty_ellipse_t *OpenAPI_point_uncertainty_ellipse_parseFrom return point_uncertainty_ellipse_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } + if (uncertainty_ellipse_local_nonprim) { + OpenAPI_uncertainty_ellipse_free(uncertainty_ellipse_local_nonprim); + uncertainty_ellipse_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/point_uncertainty_ellipse.h b/lib/sbi/openapi/model/point_uncertainty_ellipse.h index 4538309fb..20801cd5a 100644 --- a/lib/sbi/openapi/model/point_uncertainty_ellipse.h +++ b/lib/sbi/openapi/model/point_uncertainty_ellipse.h @@ -14,7 +14,6 @@ #include "../include/binary.h" #include "gad_shape.h" #include "geographical_coordinates.h" -#include "point_uncertainty_ellipse_all_of.h" #include "supported_gad_shapes.h" #include "uncertainty_ellipse.h" diff --git a/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.c b/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.c index 323ac70a2..40e941447 100644 --- a/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.c +++ b/lib/sbi/openapi/model/point_uncertainty_ellipse_all_of.c @@ -22,18 +22,26 @@ OpenAPI_point_uncertainty_ellipse_all_of_t *OpenAPI_point_uncertainty_ellipse_al void OpenAPI_point_uncertainty_ellipse_all_of_free(OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == point_uncertainty_ellipse_all_of) { return; } - OpenAPI_lnode_t *node; - OpenAPI_geographical_coordinates_free(point_uncertainty_ellipse_all_of->point); - OpenAPI_uncertainty_ellipse_free(point_uncertainty_ellipse_all_of->uncertainty_ellipse); + if (point_uncertainty_ellipse_all_of->point) { + OpenAPI_geographical_coordinates_free(point_uncertainty_ellipse_all_of->point); + point_uncertainty_ellipse_all_of->point = NULL; + } + if (point_uncertainty_ellipse_all_of->uncertainty_ellipse) { + OpenAPI_uncertainty_ellipse_free(point_uncertainty_ellipse_all_of->uncertainty_ellipse); + point_uncertainty_ellipse_all_of->uncertainty_ellipse = NULL; + } ogs_free(point_uncertainty_ellipse_all_of); } cJSON *OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON(OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (point_uncertainty_ellipse_all_of == NULL) { ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [PointUncertaintyEllipse_allOf]"); @@ -41,6 +49,10 @@ cJSON *OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON(OpenAPI_point_unce } item = cJSON_CreateObject(); + if (!point_uncertainty_ellipse_all_of->point) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [point]"); + return NULL; + } cJSON *point_local_JSON = OpenAPI_geographical_coordinates_convertToJSON(point_uncertainty_ellipse_all_of->point); if (point_local_JSON == NULL) { ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [point]"); @@ -52,6 +64,10 @@ cJSON *OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON(OpenAPI_point_unce goto end; } + if (!point_uncertainty_ellipse_all_of->uncertainty_ellipse) { + ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [uncertainty_ellipse]"); + return NULL; + } cJSON *uncertainty_ellipse_local_JSON = OpenAPI_uncertainty_ellipse_convertToJSON(point_uncertainty_ellipse_all_of->uncertainty_ellipse); if (uncertainty_ellipse_local_JSON == NULL) { ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_convertToJSON() failed [uncertainty_ellipse]"); @@ -75,30 +91,31 @@ end: OpenAPI_point_uncertainty_ellipse_all_of_t *OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON(cJSON *point_uncertainty_ellipse_all_ofJSON) { OpenAPI_point_uncertainty_ellipse_all_of_t *point_uncertainty_ellipse_all_of_local_var = NULL; - cJSON *point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "point"); + OpenAPI_lnode_t *node = NULL; + cJSON *point = NULL; + OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; + cJSON *uncertainty_ellipse = NULL; + OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; + cJSON *confidence = NULL; + point = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "point"); if (!point) { ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON() failed [point]"); goto end; } - - OpenAPI_geographical_coordinates_t *point_local_nonprim = NULL; point_local_nonprim = OpenAPI_geographical_coordinates_parseFromJSON(point); - cJSON *uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "uncertaintyEllipse"); + uncertainty_ellipse = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "uncertaintyEllipse"); if (!uncertainty_ellipse) { ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON() failed [uncertainty_ellipse]"); goto end; } - - OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_nonprim = NULL; uncertainty_ellipse_local_nonprim = OpenAPI_uncertainty_ellipse_parseFromJSON(uncertainty_ellipse); - cJSON *confidence = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "confidence"); + confidence = cJSON_GetObjectItemCaseSensitive(point_uncertainty_ellipse_all_ofJSON, "confidence"); if (!confidence) { ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON() failed [confidence]"); goto end; } - if (!cJSON_IsNumber(confidence)) { ogs_error("OpenAPI_point_uncertainty_ellipse_all_of_parseFromJSON() failed [confidence]"); goto end; @@ -113,6 +130,14 @@ OpenAPI_point_uncertainty_ellipse_all_of_t *OpenAPI_point_uncertainty_ellipse_al return point_uncertainty_ellipse_all_of_local_var; end: + if (point_local_nonprim) { + OpenAPI_geographical_coordinates_free(point_local_nonprim); + point_local_nonprim = NULL; + } + if (uncertainty_ellipse_local_nonprim) { + OpenAPI_uncertainty_ellipse_free(uncertainty_ellipse_local_nonprim); + uncertainty_ellipse_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/policy_association.c b/lib/sbi/openapi/model/policy_association.c index 27e357a33..591635c53 100644 --- a/lib/sbi/openapi/model/policy_association.c +++ b/lib/sbi/openapi/model/policy_association.c @@ -36,30 +36,56 @@ OpenAPI_policy_association_t *OpenAPI_policy_association_create( void OpenAPI_policy_association_free(OpenAPI_policy_association_t *policy_association) { + OpenAPI_lnode_t *node = NULL; + if (NULL == policy_association) { return; } - OpenAPI_lnode_t *node; - OpenAPI_policy_association_request_free(policy_association->request); - OpenAPI_list_free(policy_association->triggers); - OpenAPI_service_area_restriction_free(policy_association->serv_area_res); - OpenAPI_wireline_service_area_restriction_free(policy_association->wl_serv_area_res); - OpenAPI_smf_selection_data_free(policy_association->smf_sel_info); - OpenAPI_ambr_free(policy_association->ue_ambr); - OpenAPI_list_for_each(policy_association->pras, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (policy_association->request) { + OpenAPI_policy_association_request_free(policy_association->request); + policy_association->request = NULL; + } + if (policy_association->triggers) { + OpenAPI_list_free(policy_association->triggers); + policy_association->triggers = NULL; + } + if (policy_association->serv_area_res) { + OpenAPI_service_area_restriction_free(policy_association->serv_area_res); + policy_association->serv_area_res = NULL; + } + if (policy_association->wl_serv_area_res) { + OpenAPI_wireline_service_area_restriction_free(policy_association->wl_serv_area_res); + policy_association->wl_serv_area_res = NULL; + } + if (policy_association->smf_sel_info) { + OpenAPI_smf_selection_data_free(policy_association->smf_sel_info); + policy_association->smf_sel_info = NULL; + } + if (policy_association->ue_ambr) { + OpenAPI_ambr_free(policy_association->ue_ambr); + policy_association->ue_ambr = NULL; + } + if (policy_association->pras) { + OpenAPI_list_for_each(policy_association->pras, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(policy_association->pras); + policy_association->pras = NULL; + } + if (policy_association->supp_feat) { + ogs_free(policy_association->supp_feat); + policy_association->supp_feat = NULL; } - OpenAPI_list_free(policy_association->pras); - ogs_free(policy_association->supp_feat); ogs_free(policy_association); } cJSON *OpenAPI_policy_association_convertToJSON(OpenAPI_policy_association_t *policy_association) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (policy_association == NULL) { ogs_error("OpenAPI_policy_association_convertToJSON() failed [PolicyAssociation]"); @@ -80,15 +106,14 @@ cJSON *OpenAPI_policy_association_convertToJSON(OpenAPI_policy_association_t *po } } - if (policy_association->triggers) { - cJSON *triggers = cJSON_AddArrayToObject(item, "triggers"); - if (triggers == NULL) { + if (policy_association->triggers != OpenAPI_request_trigger_NULL) { + cJSON *triggersList = cJSON_AddArrayToObject(item, "triggers"); + if (triggersList == NULL) { ogs_error("OpenAPI_policy_association_convertToJSON() failed [triggers]"); goto end; } - OpenAPI_lnode_t *triggers_node; - OpenAPI_list_for_each(policy_association->triggers, triggers_node) { - if (cJSON_AddStringToObject(triggers, "", OpenAPI_request_trigger_ToString((intptr_t)triggers_node->data)) == NULL) { + OpenAPI_list_for_each(policy_association->triggers, node) { + if (cJSON_AddStringToObject(triggersList, "", OpenAPI_request_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_policy_association_convertToJSON() failed [triggers]"); goto end; } @@ -161,22 +186,25 @@ cJSON *OpenAPI_policy_association_convertToJSON(OpenAPI_policy_association_t *po goto end; } cJSON *localMapObject = pras; - OpenAPI_lnode_t *pras_node; if (policy_association->pras) { - OpenAPI_list_for_each(policy_association->pras, pras_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pras_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_association_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(policy_association->pras, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_association_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } + if (!policy_association->supp_feat) { + ogs_error("OpenAPI_policy_association_convertToJSON() failed [supp_feat]"); + return NULL; + } if (cJSON_AddStringToObject(item, "suppFeat", policy_association->supp_feat) == NULL) { ogs_error("OpenAPI_policy_association_convertToJSON() failed [supp_feat]"); goto end; @@ -189,51 +217,58 @@ end: OpenAPI_policy_association_t *OpenAPI_policy_association_parseFromJSON(cJSON *policy_associationJSON) { OpenAPI_policy_association_t *policy_association_local_var = NULL; - cJSON *request = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "request"); - + OpenAPI_lnode_t *node = NULL; + cJSON *request = NULL; OpenAPI_policy_association_request_t *request_local_nonprim = NULL; + cJSON *triggers = NULL; + OpenAPI_list_t *triggersList = NULL; + cJSON *serv_area_res = NULL; + OpenAPI_service_area_restriction_t *serv_area_res_local_nonprim = NULL; + cJSON *wl_serv_area_res = NULL; + OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL; + cJSON *rfsp = NULL; + cJSON *smf_sel_info = NULL; + OpenAPI_smf_selection_data_t *smf_sel_info_local_nonprim = NULL; + cJSON *ue_ambr = NULL; + OpenAPI_ambr_t *ue_ambr_local_nonprim = NULL; + cJSON *pras = NULL; + OpenAPI_list_t *prasList = NULL; + cJSON *supp_feat = NULL; + request = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "request"); if (request) { request_local_nonprim = OpenAPI_policy_association_request_parseFromJSON(request); } - cJSON *triggers = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "triggers"); - - OpenAPI_list_t *triggersList; + triggers = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "triggers"); if (triggers) { - cJSON *triggers_local_nonprimitive; - if (!cJSON_IsArray(triggers)) { - ogs_error("OpenAPI_policy_association_parseFromJSON() failed [triggers]"); - goto end; - } - - triggersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(triggers_local_nonprimitive, triggers ) { - if (!cJSON_IsString(triggers_local_nonprimitive)){ + cJSON *triggers_local = NULL; + if (!cJSON_IsArray(triggers)) { ogs_error("OpenAPI_policy_association_parseFromJSON() failed [triggers]"); goto end; } - OpenAPI_list_add(triggersList, (void *)OpenAPI_request_trigger_FromString(triggers_local_nonprimitive->valuestring)); - } + triggersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(triggers_local, triggers) { + if (!cJSON_IsString(triggers_local)) { + ogs_error("OpenAPI_policy_association_parseFromJSON() failed [triggers]"); + goto end; + } + OpenAPI_list_add(triggersList, (void *)OpenAPI_request_trigger_FromString(triggers_local->valuestring)); + } } - cJSON *serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "servAreaRes"); - - OpenAPI_service_area_restriction_t *serv_area_res_local_nonprim = NULL; + serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "servAreaRes"); if (serv_area_res) { serv_area_res_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(serv_area_res); } - cJSON *wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "wlServAreaRes"); - - OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL; + wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "wlServAreaRes"); if (wl_serv_area_res) { wl_serv_area_res_local_nonprim = OpenAPI_wireline_service_area_restriction_parseFromJSON(wl_serv_area_res); } - cJSON *rfsp = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "rfsp"); - + rfsp = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "rfsp"); if (rfsp) { if (!cJSON_IsNumber(rfsp)) { ogs_error("OpenAPI_policy_association_parseFromJSON() failed [rfsp]"); @@ -241,52 +276,47 @@ OpenAPI_policy_association_t *OpenAPI_policy_association_parseFromJSON(cJSON *po } } - cJSON *smf_sel_info = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "smfSelInfo"); - - OpenAPI_smf_selection_data_t *smf_sel_info_local_nonprim = NULL; + smf_sel_info = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "smfSelInfo"); if (smf_sel_info) { smf_sel_info_local_nonprim = OpenAPI_smf_selection_data_parseFromJSON(smf_sel_info); } - cJSON *ue_ambr = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "ueAmbr"); - - OpenAPI_ambr_t *ue_ambr_local_nonprim = NULL; + ue_ambr = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "ueAmbr"); if (ue_ambr) { ue_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(ue_ambr); } - cJSON *pras = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "pras"); - - OpenAPI_list_t *prasList; + pras = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "pras"); if (pras) { - cJSON *pras_local_map; - if (!cJSON_IsObject(pras)) { - ogs_error("OpenAPI_policy_association_parseFromJSON() failed [pras]"); - goto end; - } - prasList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pras_local_map, pras) { - cJSON *localMapObject = pras_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_policy_association_parseFromJSON() failed [inner]"); + cJSON *pras_local_map = NULL; + if (!cJSON_IsObject(pras) && !cJSON_IsNull(pras)) { + ogs_error("OpenAPI_policy_association_parseFromJSON() failed [pras]"); goto end; } - OpenAPI_list_add(prasList, localMapKeyPair); - } + if (cJSON_IsObject(pras)) { + prasList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pras_local_map, pras) { + cJSON *localMapObject = pras_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_policy_association_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(prasList, localMapKeyPair); + } + } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "suppFeat"); + supp_feat = cJSON_GetObjectItemCaseSensitive(policy_associationJSON, "suppFeat"); if (!supp_feat) { ogs_error("OpenAPI_policy_association_parseFromJSON() failed [supp_feat]"); goto end; } - if (!cJSON_IsString(supp_feat)) { ogs_error("OpenAPI_policy_association_parseFromJSON() failed [supp_feat]"); goto end; @@ -307,6 +337,40 @@ OpenAPI_policy_association_t *OpenAPI_policy_association_parseFromJSON(cJSON *po return policy_association_local_var; end: + if (request_local_nonprim) { + OpenAPI_policy_association_request_free(request_local_nonprim); + request_local_nonprim = NULL; + } + if (triggersList) { + OpenAPI_list_free(triggersList); + triggersList = NULL; + } + if (serv_area_res_local_nonprim) { + OpenAPI_service_area_restriction_free(serv_area_res_local_nonprim); + serv_area_res_local_nonprim = NULL; + } + if (wl_serv_area_res_local_nonprim) { + OpenAPI_wireline_service_area_restriction_free(wl_serv_area_res_local_nonprim); + wl_serv_area_res_local_nonprim = NULL; + } + if (smf_sel_info_local_nonprim) { + OpenAPI_smf_selection_data_free(smf_sel_info_local_nonprim); + smf_sel_info_local_nonprim = NULL; + } + if (ue_ambr_local_nonprim) { + OpenAPI_ambr_free(ue_ambr_local_nonprim); + ue_ambr_local_nonprim = NULL; + } + if (prasList) { + OpenAPI_list_for_each(prasList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(prasList); + prasList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/policy_association_request.c b/lib/sbi/openapi/model/policy_association_request.c index 6a46c114a..4eec4af6d 100644 --- a/lib/sbi/openapi/model/policy_association_request.c +++ b/lib/sbi/openapi/model/policy_association_request.c @@ -70,60 +70,131 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_create( void OpenAPI_policy_association_request_free(OpenAPI_policy_association_request_t *policy_association_request) { + OpenAPI_lnode_t *node = NULL; + if (NULL == policy_association_request) { return; } - OpenAPI_lnode_t *node; - ogs_free(policy_association_request->notification_uri); - OpenAPI_list_for_each(policy_association_request->alt_notif_ipv4_addrs, node) { - ogs_free(node->data); + if (policy_association_request->notification_uri) { + ogs_free(policy_association_request->notification_uri); + policy_association_request->notification_uri = NULL; } - OpenAPI_list_free(policy_association_request->alt_notif_ipv4_addrs); - OpenAPI_list_for_each(policy_association_request->alt_notif_ipv6_addrs, node) { - ogs_free(node->data); + if (policy_association_request->alt_notif_ipv4_addrs) { + OpenAPI_list_for_each(policy_association_request->alt_notif_ipv4_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_association_request->alt_notif_ipv4_addrs); + policy_association_request->alt_notif_ipv4_addrs = NULL; } - OpenAPI_list_free(policy_association_request->alt_notif_ipv6_addrs); - OpenAPI_list_for_each(policy_association_request->alt_notif_fqdns, node) { - ogs_free(node->data); + if (policy_association_request->alt_notif_ipv6_addrs) { + OpenAPI_list_for_each(policy_association_request->alt_notif_ipv6_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_association_request->alt_notif_ipv6_addrs); + policy_association_request->alt_notif_ipv6_addrs = NULL; } - OpenAPI_list_free(policy_association_request->alt_notif_fqdns); - ogs_free(policy_association_request->supi); - ogs_free(policy_association_request->gpsi); - OpenAPI_list_free(policy_association_request->access_types); - ogs_free(policy_association_request->pei); - OpenAPI_user_location_free(policy_association_request->user_loc); - ogs_free(policy_association_request->time_zone); - OpenAPI_plmn_id_nid_free(policy_association_request->serving_plmn); - OpenAPI_list_free(policy_association_request->rat_types); - OpenAPI_list_for_each(policy_association_request->group_ids, node) { - ogs_free(node->data); + if (policy_association_request->alt_notif_fqdns) { + OpenAPI_list_for_each(policy_association_request->alt_notif_fqdns, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_association_request->alt_notif_fqdns); + policy_association_request->alt_notif_fqdns = NULL; } - OpenAPI_list_free(policy_association_request->group_ids); - OpenAPI_service_area_restriction_free(policy_association_request->serv_area_res); - OpenAPI_wireline_service_area_restriction_free(policy_association_request->wl_serv_area_res); - OpenAPI_ambr_free(policy_association_request->ue_ambr); - OpenAPI_list_for_each(policy_association_request->allowed_snssais, node) { - OpenAPI_snssai_free(node->data); + if (policy_association_request->supi) { + ogs_free(policy_association_request->supi); + policy_association_request->supi = NULL; } - OpenAPI_list_free(policy_association_request->allowed_snssais); - OpenAPI_list_for_each(policy_association_request->mapping_snssais, node) { - OpenAPI_mapping_of_snssai_free(node->data); + if (policy_association_request->gpsi) { + ogs_free(policy_association_request->gpsi); + policy_association_request->gpsi = NULL; } - OpenAPI_list_free(policy_association_request->mapping_snssais); - OpenAPI_list_for_each(policy_association_request->n3g_allowed_snssais, node) { - OpenAPI_snssai_free(node->data); + if (policy_association_request->access_types) { + OpenAPI_list_free(policy_association_request->access_types); + policy_association_request->access_types = NULL; + } + if (policy_association_request->pei) { + ogs_free(policy_association_request->pei); + policy_association_request->pei = NULL; + } + if (policy_association_request->user_loc) { + OpenAPI_user_location_free(policy_association_request->user_loc); + policy_association_request->user_loc = NULL; + } + if (policy_association_request->time_zone) { + ogs_free(policy_association_request->time_zone); + policy_association_request->time_zone = NULL; + } + if (policy_association_request->serving_plmn) { + OpenAPI_plmn_id_nid_free(policy_association_request->serving_plmn); + policy_association_request->serving_plmn = NULL; + } + if (policy_association_request->rat_types) { + OpenAPI_list_free(policy_association_request->rat_types); + policy_association_request->rat_types = NULL; + } + if (policy_association_request->group_ids) { + OpenAPI_list_for_each(policy_association_request->group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_association_request->group_ids); + policy_association_request->group_ids = NULL; + } + if (policy_association_request->serv_area_res) { + OpenAPI_service_area_restriction_free(policy_association_request->serv_area_res); + policy_association_request->serv_area_res = NULL; + } + if (policy_association_request->wl_serv_area_res) { + OpenAPI_wireline_service_area_restriction_free(policy_association_request->wl_serv_area_res); + policy_association_request->wl_serv_area_res = NULL; + } + if (policy_association_request->ue_ambr) { + OpenAPI_ambr_free(policy_association_request->ue_ambr); + policy_association_request->ue_ambr = NULL; + } + if (policy_association_request->allowed_snssais) { + OpenAPI_list_for_each(policy_association_request->allowed_snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(policy_association_request->allowed_snssais); + policy_association_request->allowed_snssais = NULL; + } + if (policy_association_request->mapping_snssais) { + OpenAPI_list_for_each(policy_association_request->mapping_snssais, node) { + OpenAPI_mapping_of_snssai_free(node->data); + } + OpenAPI_list_free(policy_association_request->mapping_snssais); + policy_association_request->mapping_snssais = NULL; + } + if (policy_association_request->n3g_allowed_snssais) { + OpenAPI_list_for_each(policy_association_request->n3g_allowed_snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(policy_association_request->n3g_allowed_snssais); + policy_association_request->n3g_allowed_snssais = NULL; + } + if (policy_association_request->guami) { + OpenAPI_guami_free(policy_association_request->guami); + policy_association_request->guami = NULL; + } + if (policy_association_request->service_name) { + ogs_free(policy_association_request->service_name); + policy_association_request->service_name = NULL; + } + if (policy_association_request->trace_req) { + OpenAPI_trace_data_free(policy_association_request->trace_req); + policy_association_request->trace_req = NULL; + } + if (policy_association_request->supp_feat) { + ogs_free(policy_association_request->supp_feat); + policy_association_request->supp_feat = NULL; } - OpenAPI_list_free(policy_association_request->n3g_allowed_snssais); - OpenAPI_guami_free(policy_association_request->guami); - ogs_free(policy_association_request->service_name); - OpenAPI_trace_data_free(policy_association_request->trace_req); - ogs_free(policy_association_request->supp_feat); ogs_free(policy_association_request); } cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_association_request_t *policy_association_request) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (policy_association_request == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [PolicyAssociationRequest]"); @@ -131,59 +202,61 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati } item = cJSON_CreateObject(); + if (!policy_association_request->notification_uri) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [notification_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationUri", policy_association_request->notification_uri) == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [notification_uri]"); goto end; } if (policy_association_request->alt_notif_ipv4_addrs) { - cJSON *alt_notif_ipv4_addrs = cJSON_AddArrayToObject(item, "altNotifIpv4Addrs"); - if (alt_notif_ipv4_addrs == NULL) { + cJSON *alt_notif_ipv4_addrsList = cJSON_AddArrayToObject(item, "altNotifIpv4Addrs"); + if (alt_notif_ipv4_addrsList == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_ipv4_addrs]"); goto end; } - - OpenAPI_lnode_t *alt_notif_ipv4_addrs_node; - OpenAPI_list_for_each(policy_association_request->alt_notif_ipv4_addrs, alt_notif_ipv4_addrs_node) { - if (cJSON_AddStringToObject(alt_notif_ipv4_addrs, "", (char*)alt_notif_ipv4_addrs_node->data) == NULL) { - ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_ipv4_addrs]"); - goto end; + OpenAPI_list_for_each(policy_association_request->alt_notif_ipv4_addrs, node) { + if (cJSON_AddStringToObject(alt_notif_ipv4_addrsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_ipv4_addrs]"); + goto end; + } } - } } if (policy_association_request->alt_notif_ipv6_addrs) { - cJSON *alt_notif_ipv6_addrs = cJSON_AddArrayToObject(item, "altNotifIpv6Addrs"); - if (alt_notif_ipv6_addrs == NULL) { + cJSON *alt_notif_ipv6_addrsList = cJSON_AddArrayToObject(item, "altNotifIpv6Addrs"); + if (alt_notif_ipv6_addrsList == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_ipv6_addrs]"); goto end; } - - OpenAPI_lnode_t *alt_notif_ipv6_addrs_node; - OpenAPI_list_for_each(policy_association_request->alt_notif_ipv6_addrs, alt_notif_ipv6_addrs_node) { - if (cJSON_AddStringToObject(alt_notif_ipv6_addrs, "", (char*)alt_notif_ipv6_addrs_node->data) == NULL) { - ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_ipv6_addrs]"); - goto end; + OpenAPI_list_for_each(policy_association_request->alt_notif_ipv6_addrs, node) { + if (cJSON_AddStringToObject(alt_notif_ipv6_addrsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_ipv6_addrs]"); + goto end; + } } - } } if (policy_association_request->alt_notif_fqdns) { - cJSON *alt_notif_fqdns = cJSON_AddArrayToObject(item, "altNotifFqdns"); - if (alt_notif_fqdns == NULL) { + cJSON *alt_notif_fqdnsList = cJSON_AddArrayToObject(item, "altNotifFqdns"); + if (alt_notif_fqdnsList == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_fqdns]"); goto end; } - - OpenAPI_lnode_t *alt_notif_fqdns_node; - OpenAPI_list_for_each(policy_association_request->alt_notif_fqdns, alt_notif_fqdns_node) { - if (cJSON_AddStringToObject(alt_notif_fqdns, "", (char*)alt_notif_fqdns_node->data) == NULL) { - ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_fqdns]"); - goto end; + OpenAPI_list_for_each(policy_association_request->alt_notif_fqdns, node) { + if (cJSON_AddStringToObject(alt_notif_fqdnsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [alt_notif_fqdns]"); + goto end; + } } - } } + if (!policy_association_request->supi) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [supi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supi", policy_association_request->supi) == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [supi]"); goto end; @@ -196,22 +269,21 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati } } - if (policy_association_request->access_type) { + if (policy_association_request->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(policy_association_request->access_type)) == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [access_type]"); goto end; } } - if (policy_association_request->access_types) { - cJSON *access_types = cJSON_AddArrayToObject(item, "accessTypes"); - if (access_types == NULL) { + if (policy_association_request->access_types != OpenAPI_access_type_NULL) { + cJSON *access_typesList = cJSON_AddArrayToObject(item, "accessTypes"); + if (access_typesList == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [access_types]"); goto end; } - OpenAPI_lnode_t *access_types_node; - OpenAPI_list_for_each(policy_association_request->access_types, access_types_node) { - if (cJSON_AddStringToObject(access_types, "", OpenAPI_access_type_ToString((intptr_t)access_types_node->data)) == NULL) { + OpenAPI_list_for_each(policy_association_request->access_types, node) { + if (cJSON_AddStringToObject(access_typesList, "", OpenAPI_access_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [access_types]"); goto end; } @@ -258,22 +330,21 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati } } - if (policy_association_request->rat_type) { + if (policy_association_request->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(policy_association_request->rat_type)) == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [rat_type]"); goto end; } } - if (policy_association_request->rat_types) { - cJSON *rat_types = cJSON_AddArrayToObject(item, "ratTypes"); - if (rat_types == NULL) { + if (policy_association_request->rat_types != OpenAPI_rat_type_NULL) { + cJSON *rat_typesList = cJSON_AddArrayToObject(item, "ratTypes"); + if (rat_typesList == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [rat_types]"); goto end; } - OpenAPI_lnode_t *rat_types_node; - OpenAPI_list_for_each(policy_association_request->rat_types, rat_types_node) { - if (cJSON_AddStringToObject(rat_types, "", OpenAPI_rat_type_ToString((intptr_t)rat_types_node->data)) == NULL) { + OpenAPI_list_for_each(policy_association_request->rat_types, node) { + if (cJSON_AddStringToObject(rat_typesList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [rat_types]"); goto end; } @@ -281,19 +352,17 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati } if (policy_association_request->group_ids) { - cJSON *group_ids = cJSON_AddArrayToObject(item, "groupIds"); - if (group_ids == NULL) { + cJSON *group_idsList = cJSON_AddArrayToObject(item, "groupIds"); + if (group_idsList == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [group_ids]"); goto end; } - - OpenAPI_lnode_t *group_ids_node; - OpenAPI_list_for_each(policy_association_request->group_ids, group_ids_node) { - if (cJSON_AddStringToObject(group_ids, "", (char*)group_ids_node->data) == NULL) { - ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [group_ids]"); - goto end; + OpenAPI_list_for_each(policy_association_request->group_ids, node) { + if (cJSON_AddStringToObject(group_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [group_ids]"); + goto end; + } } - } } if (policy_association_request->serv_area_res) { @@ -348,17 +417,13 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [allowed_snssais]"); goto end; } - - OpenAPI_lnode_t *allowed_snssais_node; - if (policy_association_request->allowed_snssais) { - OpenAPI_list_for_each(policy_association_request->allowed_snssais, allowed_snssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(allowed_snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [allowed_snssais]"); - goto end; - } - cJSON_AddItemToArray(allowed_snssaisList, itemLocal); + OpenAPI_list_for_each(policy_association_request->allowed_snssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [allowed_snssais]"); + goto end; } + cJSON_AddItemToArray(allowed_snssaisList, itemLocal); } } @@ -368,17 +433,13 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [mapping_snssais]"); goto end; } - - OpenAPI_lnode_t *mapping_snssais_node; - if (policy_association_request->mapping_snssais) { - OpenAPI_list_for_each(policy_association_request->mapping_snssais, mapping_snssais_node) { - cJSON *itemLocal = OpenAPI_mapping_of_snssai_convertToJSON(mapping_snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [mapping_snssais]"); - goto end; - } - cJSON_AddItemToArray(mapping_snssaisList, itemLocal); + OpenAPI_list_for_each(policy_association_request->mapping_snssais, node) { + cJSON *itemLocal = OpenAPI_mapping_of_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [mapping_snssais]"); + goto end; } + cJSON_AddItemToArray(mapping_snssaisList, itemLocal); } } @@ -388,17 +449,13 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [n3g_allowed_snssais]"); goto end; } - - OpenAPI_lnode_t *n3g_allowed_snssais_node; - if (policy_association_request->n3g_allowed_snssais) { - OpenAPI_list_for_each(policy_association_request->n3g_allowed_snssais, n3g_allowed_snssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(n3g_allowed_snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [n3g_allowed_snssais]"); - goto end; - } - cJSON_AddItemToArray(n3g_allowed_snssaisList, itemLocal); + OpenAPI_list_for_each(policy_association_request->n3g_allowed_snssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [n3g_allowed_snssais]"); + goto end; } + cJSON_AddItemToArray(n3g_allowed_snssaisList, itemLocal); } } @@ -435,6 +492,10 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati } } + if (!policy_association_request->supp_feat) { + ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [supp_feat]"); + return NULL; + } if (cJSON_AddStringToObject(item, "suppFeat", policy_association_request->supp_feat) == NULL) { ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [supp_feat]"); goto end; @@ -447,100 +508,143 @@ end: OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_parseFromJSON(cJSON *policy_association_requestJSON) { OpenAPI_policy_association_request_t *policy_association_request_local_var = NULL; - cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "notificationUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *notification_uri = NULL; + cJSON *alt_notif_ipv4_addrs = NULL; + OpenAPI_list_t *alt_notif_ipv4_addrsList = NULL; + cJSON *alt_notif_ipv6_addrs = NULL; + OpenAPI_list_t *alt_notif_ipv6_addrsList = NULL; + cJSON *alt_notif_fqdns = NULL; + OpenAPI_list_t *alt_notif_fqdnsList = NULL; + cJSON *supi = NULL; + cJSON *gpsi = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *access_types = NULL; + OpenAPI_list_t *access_typesList = NULL; + cJSON *pei = NULL; + cJSON *user_loc = NULL; + OpenAPI_user_location_t *user_loc_local_nonprim = NULL; + cJSON *time_zone = NULL; + cJSON *serving_plmn = NULL; + OpenAPI_plmn_id_nid_t *serving_plmn_local_nonprim = NULL; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *rat_types = NULL; + OpenAPI_list_t *rat_typesList = NULL; + cJSON *group_ids = NULL; + OpenAPI_list_t *group_idsList = NULL; + cJSON *serv_area_res = NULL; + OpenAPI_service_area_restriction_t *serv_area_res_local_nonprim = NULL; + cJSON *wl_serv_area_res = NULL; + OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL; + cJSON *rfsp = NULL; + cJSON *ue_ambr = NULL; + OpenAPI_ambr_t *ue_ambr_local_nonprim = NULL; + cJSON *allowed_snssais = NULL; + OpenAPI_list_t *allowed_snssaisList = NULL; + cJSON *mapping_snssais = NULL; + OpenAPI_list_t *mapping_snssaisList = NULL; + cJSON *n3g_allowed_snssais = NULL; + OpenAPI_list_t *n3g_allowed_snssaisList = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *service_name = NULL; + cJSON *trace_req = NULL; + OpenAPI_trace_data_t *trace_req_local_nonprim = NULL; + cJSON *supp_feat = NULL; + notification_uri = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "notificationUri"); if (!notification_uri) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [notification_uri]"); goto end; } - if (!cJSON_IsString(notification_uri)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [notification_uri]"); goto end; } - cJSON *alt_notif_ipv4_addrs = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "altNotifIpv4Addrs"); - - OpenAPI_list_t *alt_notif_ipv4_addrsList; + alt_notif_ipv4_addrs = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "altNotifIpv4Addrs"); if (alt_notif_ipv4_addrs) { - cJSON *alt_notif_ipv4_addrs_local; - if (!cJSON_IsArray(alt_notif_ipv4_addrs)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_ipv4_addrs]"); - goto end; - } - alt_notif_ipv4_addrsList = OpenAPI_list_create(); + cJSON *alt_notif_ipv4_addrs_local = NULL; + if (!cJSON_IsArray(alt_notif_ipv4_addrs)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_ipv4_addrs]"); + goto end; + } - cJSON_ArrayForEach(alt_notif_ipv4_addrs_local, alt_notif_ipv4_addrs) { - if (!cJSON_IsString(alt_notif_ipv4_addrs_local)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_ipv4_addrs]"); - goto end; - } - OpenAPI_list_add(alt_notif_ipv4_addrsList, ogs_strdup(alt_notif_ipv4_addrs_local->valuestring)); - } + alt_notif_ipv4_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alt_notif_ipv4_addrs_local, alt_notif_ipv4_addrs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(alt_notif_ipv4_addrs_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_ipv4_addrs]"); + goto end; + } + OpenAPI_list_add(alt_notif_ipv4_addrsList, ogs_strdup(alt_notif_ipv4_addrs_local->valuestring)); + } } - cJSON *alt_notif_ipv6_addrs = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "altNotifIpv6Addrs"); - - OpenAPI_list_t *alt_notif_ipv6_addrsList; + alt_notif_ipv6_addrs = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "altNotifIpv6Addrs"); if (alt_notif_ipv6_addrs) { - cJSON *alt_notif_ipv6_addrs_local; - if (!cJSON_IsArray(alt_notif_ipv6_addrs)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_ipv6_addrs]"); - goto end; - } - alt_notif_ipv6_addrsList = OpenAPI_list_create(); + cJSON *alt_notif_ipv6_addrs_local = NULL; + if (!cJSON_IsArray(alt_notif_ipv6_addrs)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_ipv6_addrs]"); + goto end; + } - cJSON_ArrayForEach(alt_notif_ipv6_addrs_local, alt_notif_ipv6_addrs) { - if (!cJSON_IsString(alt_notif_ipv6_addrs_local)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_ipv6_addrs]"); - goto end; - } - OpenAPI_list_add(alt_notif_ipv6_addrsList, ogs_strdup(alt_notif_ipv6_addrs_local->valuestring)); - } + alt_notif_ipv6_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alt_notif_ipv6_addrs_local, alt_notif_ipv6_addrs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(alt_notif_ipv6_addrs_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_ipv6_addrs]"); + goto end; + } + OpenAPI_list_add(alt_notif_ipv6_addrsList, ogs_strdup(alt_notif_ipv6_addrs_local->valuestring)); + } } - cJSON *alt_notif_fqdns = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "altNotifFqdns"); - - OpenAPI_list_t *alt_notif_fqdnsList; + alt_notif_fqdns = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "altNotifFqdns"); if (alt_notif_fqdns) { - cJSON *alt_notif_fqdns_local; - if (!cJSON_IsArray(alt_notif_fqdns)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_fqdns]"); - goto end; - } - alt_notif_fqdnsList = OpenAPI_list_create(); + cJSON *alt_notif_fqdns_local = NULL; + if (!cJSON_IsArray(alt_notif_fqdns)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_fqdns]"); + goto end; + } - cJSON_ArrayForEach(alt_notif_fqdns_local, alt_notif_fqdns) { - if (!cJSON_IsString(alt_notif_fqdns_local)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_fqdns]"); - goto end; - } - OpenAPI_list_add(alt_notif_fqdnsList, ogs_strdup(alt_notif_fqdns_local->valuestring)); - } + alt_notif_fqdnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alt_notif_fqdns_local, alt_notif_fqdns) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(alt_notif_fqdns_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [alt_notif_fqdns]"); + goto end; + } + OpenAPI_list_add(alt_notif_fqdnsList, ogs_strdup(alt_notif_fqdns_local->valuestring)); + } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "supi"); + supi = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "supi"); if (!supi) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [supi]"); goto end; } - if (!cJSON_IsString(supi)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [supi]"); goto end; } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + access_type = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [access_type]"); @@ -549,63 +653,52 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_parseFr access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *access_types = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "accessTypes"); - - OpenAPI_list_t *access_typesList; + access_types = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "accessTypes"); if (access_types) { - cJSON *access_types_local_nonprimitive; - if (!cJSON_IsArray(access_types)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [access_types]"); - goto end; - } - - access_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(access_types_local_nonprimitive, access_types ) { - if (!cJSON_IsString(access_types_local_nonprimitive)){ + cJSON *access_types_local = NULL; + if (!cJSON_IsArray(access_types)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [access_types]"); goto end; } - OpenAPI_list_add(access_typesList, (void *)OpenAPI_access_type_FromString(access_types_local_nonprimitive->valuestring)); - } + access_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(access_types_local, access_types) { + if (!cJSON_IsString(access_types_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [access_types]"); + goto end; + } + OpenAPI_list_add(access_typesList, (void *)OpenAPI_access_type_FromString(access_types_local->valuestring)); + } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [pei]"); goto end; } } - cJSON *user_loc = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "userLoc"); - - OpenAPI_user_location_t *user_loc_local_nonprim = NULL; + user_loc = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "userLoc"); if (user_loc) { user_loc_local_nonprim = OpenAPI_user_location_parseFromJSON(user_loc); } - cJSON *time_zone = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "timeZone"); - + time_zone = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "timeZone"); if (time_zone) { - if (!cJSON_IsString(time_zone)) { + if (!cJSON_IsString(time_zone) && !cJSON_IsNull(time_zone)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [time_zone]"); goto end; } } - cJSON *serving_plmn = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "servingPlmn"); - - OpenAPI_plmn_id_nid_t *serving_plmn_local_nonprim = NULL; + serving_plmn = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "servingPlmn"); if (serving_plmn) { serving_plmn_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_plmn); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [rat_type]"); @@ -614,64 +707,57 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_parseFr rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *rat_types = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "ratTypes"); - - OpenAPI_list_t *rat_typesList; + rat_types = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "ratTypes"); if (rat_types) { - cJSON *rat_types_local_nonprimitive; - if (!cJSON_IsArray(rat_types)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [rat_types]"); - goto end; - } - - rat_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rat_types_local_nonprimitive, rat_types ) { - if (!cJSON_IsString(rat_types_local_nonprimitive)){ + cJSON *rat_types_local = NULL; + if (!cJSON_IsArray(rat_types)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [rat_types]"); goto end; } - OpenAPI_list_add(rat_typesList, (void *)OpenAPI_rat_type_FromString(rat_types_local_nonprimitive->valuestring)); - } + rat_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rat_types_local, rat_types) { + if (!cJSON_IsString(rat_types_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [rat_types]"); + goto end; + } + OpenAPI_list_add(rat_typesList, (void *)OpenAPI_rat_type_FromString(rat_types_local->valuestring)); + } } - cJSON *group_ids = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "groupIds"); - - OpenAPI_list_t *group_idsList; + group_ids = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "groupIds"); if (group_ids) { - cJSON *group_ids_local; - if (!cJSON_IsArray(group_ids)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [group_ids]"); - goto end; - } - group_idsList = OpenAPI_list_create(); + cJSON *group_ids_local = NULL; + if (!cJSON_IsArray(group_ids)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [group_ids]"); + goto end; + } - cJSON_ArrayForEach(group_ids_local, group_ids) { - if (!cJSON_IsString(group_ids_local)) { - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [group_ids]"); - goto end; - } - OpenAPI_list_add(group_idsList, ogs_strdup(group_ids_local->valuestring)); - } + group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(group_ids_local, group_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(group_ids_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [group_ids]"); + goto end; + } + OpenAPI_list_add(group_idsList, ogs_strdup(group_ids_local->valuestring)); + } } - cJSON *serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "servAreaRes"); - - OpenAPI_service_area_restriction_t *serv_area_res_local_nonprim = NULL; + serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "servAreaRes"); if (serv_area_res) { serv_area_res_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(serv_area_res); } - cJSON *wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "wlServAreaRes"); - - OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL; + wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "wlServAreaRes"); if (wl_serv_area_res) { wl_serv_area_res_local_nonprim = OpenAPI_wireline_service_area_restriction_parseFromJSON(wl_serv_area_res); } - cJSON *rfsp = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "rfsp"); - + rfsp = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "rfsp"); if (rfsp) { if (!cJSON_IsNumber(rfsp)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [rfsp]"); @@ -679,129 +765,109 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_parseFr } } - cJSON *ue_ambr = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "ueAmbr"); - - OpenAPI_ambr_t *ue_ambr_local_nonprim = NULL; + ue_ambr = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "ueAmbr"); if (ue_ambr) { ue_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(ue_ambr); } - cJSON *allowed_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "allowedSnssais"); - - OpenAPI_list_t *allowed_snssaisList; + allowed_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "allowedSnssais"); if (allowed_snssais) { - cJSON *allowed_snssais_local_nonprimitive; - if (!cJSON_IsArray(allowed_snssais)){ - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [allowed_snssais]"); - goto end; - } - - allowed_snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_snssais_local_nonprimitive, allowed_snssais ) { - if (!cJSON_IsObject(allowed_snssais_local_nonprimitive)) { + cJSON *allowed_snssais_local = NULL; + if (!cJSON_IsArray(allowed_snssais)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [allowed_snssais]"); goto end; } - OpenAPI_snssai_t *allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(allowed_snssais_local_nonprimitive); - if (!allowed_snssaisItem) { - ogs_error("No allowed_snssaisItem"); - OpenAPI_list_free(allowed_snssaisList); - goto end; + allowed_snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_snssais_local, allowed_snssais) { + if (!cJSON_IsObject(allowed_snssais_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [allowed_snssais]"); + goto end; + } + OpenAPI_snssai_t *allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(allowed_snssais_local); + if (!allowed_snssaisItem) { + ogs_error("No allowed_snssaisItem"); + OpenAPI_list_free(allowed_snssaisList); + goto end; + } + OpenAPI_list_add(allowed_snssaisList, allowed_snssaisItem); } - - OpenAPI_list_add(allowed_snssaisList, allowed_snssaisItem); - } } - cJSON *mapping_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "mappingSnssais"); - - OpenAPI_list_t *mapping_snssaisList; + mapping_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "mappingSnssais"); if (mapping_snssais) { - cJSON *mapping_snssais_local_nonprimitive; - if (!cJSON_IsArray(mapping_snssais)){ - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [mapping_snssais]"); - goto end; - } - - mapping_snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mapping_snssais_local_nonprimitive, mapping_snssais ) { - if (!cJSON_IsObject(mapping_snssais_local_nonprimitive)) { + cJSON *mapping_snssais_local = NULL; + if (!cJSON_IsArray(mapping_snssais)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [mapping_snssais]"); goto end; } - OpenAPI_mapping_of_snssai_t *mapping_snssaisItem = OpenAPI_mapping_of_snssai_parseFromJSON(mapping_snssais_local_nonprimitive); - if (!mapping_snssaisItem) { - ogs_error("No mapping_snssaisItem"); - OpenAPI_list_free(mapping_snssaisList); - goto end; + mapping_snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mapping_snssais_local, mapping_snssais) { + if (!cJSON_IsObject(mapping_snssais_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [mapping_snssais]"); + goto end; + } + OpenAPI_mapping_of_snssai_t *mapping_snssaisItem = OpenAPI_mapping_of_snssai_parseFromJSON(mapping_snssais_local); + if (!mapping_snssaisItem) { + ogs_error("No mapping_snssaisItem"); + OpenAPI_list_free(mapping_snssaisList); + goto end; + } + OpenAPI_list_add(mapping_snssaisList, mapping_snssaisItem); } - - OpenAPI_list_add(mapping_snssaisList, mapping_snssaisItem); - } } - cJSON *n3g_allowed_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "n3gAllowedSnssais"); - - OpenAPI_list_t *n3g_allowed_snssaisList; + n3g_allowed_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "n3gAllowedSnssais"); if (n3g_allowed_snssais) { - cJSON *n3g_allowed_snssais_local_nonprimitive; - if (!cJSON_IsArray(n3g_allowed_snssais)){ - ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [n3g_allowed_snssais]"); - goto end; - } - - n3g_allowed_snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(n3g_allowed_snssais_local_nonprimitive, n3g_allowed_snssais ) { - if (!cJSON_IsObject(n3g_allowed_snssais_local_nonprimitive)) { + cJSON *n3g_allowed_snssais_local = NULL; + if (!cJSON_IsArray(n3g_allowed_snssais)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [n3g_allowed_snssais]"); goto end; } - OpenAPI_snssai_t *n3g_allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(n3g_allowed_snssais_local_nonprimitive); - if (!n3g_allowed_snssaisItem) { - ogs_error("No n3g_allowed_snssaisItem"); - OpenAPI_list_free(n3g_allowed_snssaisList); - goto end; + n3g_allowed_snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(n3g_allowed_snssais_local, n3g_allowed_snssais) { + if (!cJSON_IsObject(n3g_allowed_snssais_local)) { + ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [n3g_allowed_snssais]"); + goto end; + } + OpenAPI_snssai_t *n3g_allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(n3g_allowed_snssais_local); + if (!n3g_allowed_snssaisItem) { + ogs_error("No n3g_allowed_snssaisItem"); + OpenAPI_list_free(n3g_allowed_snssaisList); + goto end; + } + OpenAPI_list_add(n3g_allowed_snssaisList, n3g_allowed_snssaisItem); } - - OpenAPI_list_add(n3g_allowed_snssaisList, n3g_allowed_snssaisItem); - } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } - cJSON *service_name = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "serviceName"); - + service_name = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "serviceName"); if (service_name) { - if (!cJSON_IsString(service_name)) { + if (!cJSON_IsString(service_name) && !cJSON_IsNull(service_name)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [service_name]"); goto end; } } - cJSON *trace_req = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "traceReq"); - - OpenAPI_trace_data_t *trace_req_local_nonprim = NULL; + trace_req = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "traceReq"); if (trace_req) { trace_req_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_req); } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "suppFeat"); + supp_feat = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "suppFeat"); if (!supp_feat) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [supp_feat]"); goto end; } - if (!cJSON_IsString(supp_feat)) { ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [supp_feat]"); goto end; @@ -813,12 +879,12 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_parseFr alt_notif_ipv6_addrs ? alt_notif_ipv6_addrsList : NULL, alt_notif_fqdns ? alt_notif_fqdnsList : NULL, ogs_strdup(supi->valuestring), - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, access_type ? access_typeVariable : 0, access_types ? access_typesList : NULL, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, user_loc ? user_loc_local_nonprim : NULL, - time_zone ? ogs_strdup(time_zone->valuestring) : NULL, + time_zone && !cJSON_IsNull(time_zone) ? ogs_strdup(time_zone->valuestring) : NULL, serving_plmn ? serving_plmn_local_nonprim : NULL, rat_type ? rat_typeVariable : 0, rat_types ? rat_typesList : NULL, @@ -832,13 +898,98 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_parseFr mapping_snssais ? mapping_snssaisList : NULL, n3g_allowed_snssais ? n3g_allowed_snssaisList : NULL, guami ? guami_local_nonprim : NULL, - service_name ? ogs_strdup(service_name->valuestring) : NULL, + service_name && !cJSON_IsNull(service_name) ? ogs_strdup(service_name->valuestring) : NULL, trace_req ? trace_req_local_nonprim : NULL, ogs_strdup(supp_feat->valuestring) ); return policy_association_request_local_var; end: + if (alt_notif_ipv4_addrsList) { + OpenAPI_list_for_each(alt_notif_ipv4_addrsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(alt_notif_ipv4_addrsList); + alt_notif_ipv4_addrsList = NULL; + } + if (alt_notif_ipv6_addrsList) { + OpenAPI_list_for_each(alt_notif_ipv6_addrsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(alt_notif_ipv6_addrsList); + alt_notif_ipv6_addrsList = NULL; + } + if (alt_notif_fqdnsList) { + OpenAPI_list_for_each(alt_notif_fqdnsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(alt_notif_fqdnsList); + alt_notif_fqdnsList = NULL; + } + if (access_typesList) { + OpenAPI_list_free(access_typesList); + access_typesList = NULL; + } + if (user_loc_local_nonprim) { + OpenAPI_user_location_free(user_loc_local_nonprim); + user_loc_local_nonprim = NULL; + } + if (serving_plmn_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_plmn_local_nonprim); + serving_plmn_local_nonprim = NULL; + } + if (rat_typesList) { + OpenAPI_list_free(rat_typesList); + rat_typesList = NULL; + } + if (group_idsList) { + OpenAPI_list_for_each(group_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(group_idsList); + group_idsList = NULL; + } + if (serv_area_res_local_nonprim) { + OpenAPI_service_area_restriction_free(serv_area_res_local_nonprim); + serv_area_res_local_nonprim = NULL; + } + if (wl_serv_area_res_local_nonprim) { + OpenAPI_wireline_service_area_restriction_free(wl_serv_area_res_local_nonprim); + wl_serv_area_res_local_nonprim = NULL; + } + if (ue_ambr_local_nonprim) { + OpenAPI_ambr_free(ue_ambr_local_nonprim); + ue_ambr_local_nonprim = NULL; + } + if (allowed_snssaisList) { + OpenAPI_list_for_each(allowed_snssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(allowed_snssaisList); + allowed_snssaisList = NULL; + } + if (mapping_snssaisList) { + OpenAPI_list_for_each(mapping_snssaisList, node) { + OpenAPI_mapping_of_snssai_free(node->data); + } + OpenAPI_list_free(mapping_snssaisList); + mapping_snssaisList = NULL; + } + if (n3g_allowed_snssaisList) { + OpenAPI_list_for_each(n3g_allowed_snssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(n3g_allowed_snssaisList); + n3g_allowed_snssaisList = NULL; + } + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (trace_req_local_nonprim) { + OpenAPI_trace_data_free(trace_req_local_nonprim); + trace_req_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/policy_association_update_request.c b/lib/sbi/openapi/model/policy_association_update_request.c index d5294c513..f3ff789c4 100644 --- a/lib/sbi/openapi/model/policy_association_update_request.c +++ b/lib/sbi/openapi/model/policy_association_update_request.c @@ -56,58 +56,114 @@ OpenAPI_policy_association_update_request_t *OpenAPI_policy_association_update_r void OpenAPI_policy_association_update_request_free(OpenAPI_policy_association_update_request_t *policy_association_update_request) { + OpenAPI_lnode_t *node = NULL; + if (NULL == policy_association_update_request) { return; } - OpenAPI_lnode_t *node; - ogs_free(policy_association_update_request->notification_uri); - OpenAPI_list_for_each(policy_association_update_request->alt_notif_ipv4_addrs, node) { - ogs_free(node->data); + if (policy_association_update_request->notification_uri) { + ogs_free(policy_association_update_request->notification_uri); + policy_association_update_request->notification_uri = NULL; } - OpenAPI_list_free(policy_association_update_request->alt_notif_ipv4_addrs); - OpenAPI_list_for_each(policy_association_update_request->alt_notif_ipv6_addrs, node) { - ogs_free(node->data); + if (policy_association_update_request->alt_notif_ipv4_addrs) { + OpenAPI_list_for_each(policy_association_update_request->alt_notif_ipv4_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_association_update_request->alt_notif_ipv4_addrs); + policy_association_update_request->alt_notif_ipv4_addrs = NULL; } - OpenAPI_list_free(policy_association_update_request->alt_notif_ipv6_addrs); - OpenAPI_list_for_each(policy_association_update_request->alt_notif_fqdns, node) { - ogs_free(node->data); + if (policy_association_update_request->alt_notif_ipv6_addrs) { + OpenAPI_list_for_each(policy_association_update_request->alt_notif_ipv6_addrs, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_association_update_request->alt_notif_ipv6_addrs); + policy_association_update_request->alt_notif_ipv6_addrs = NULL; } - OpenAPI_list_free(policy_association_update_request->alt_notif_fqdns); - OpenAPI_list_free(policy_association_update_request->triggers); - OpenAPI_service_area_restriction_free(policy_association_update_request->serv_area_res); - OpenAPI_wireline_service_area_restriction_free(policy_association_update_request->wl_serv_area_res); - OpenAPI_smf_selection_data_free(policy_association_update_request->smf_sel_info); - OpenAPI_ambr_free(policy_association_update_request->ue_ambr); - OpenAPI_list_for_each(policy_association_update_request->pra_statuses, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (policy_association_update_request->alt_notif_fqdns) { + OpenAPI_list_for_each(policy_association_update_request->alt_notif_fqdns, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_association_update_request->alt_notif_fqdns); + policy_association_update_request->alt_notif_fqdns = NULL; } - OpenAPI_list_free(policy_association_update_request->pra_statuses); - OpenAPI_user_location_free(policy_association_update_request->user_loc); - OpenAPI_list_for_each(policy_association_update_request->allowed_snssais, node) { - OpenAPI_snssai_free(node->data); + if (policy_association_update_request->triggers) { + OpenAPI_list_free(policy_association_update_request->triggers); + policy_association_update_request->triggers = NULL; } - OpenAPI_list_free(policy_association_update_request->allowed_snssais); - OpenAPI_list_for_each(policy_association_update_request->mapping_snssais, node) { - OpenAPI_mapping_of_snssai_free(node->data); + if (policy_association_update_request->serv_area_res) { + OpenAPI_service_area_restriction_free(policy_association_update_request->serv_area_res); + policy_association_update_request->serv_area_res = NULL; } - OpenAPI_list_free(policy_association_update_request->mapping_snssais); - OpenAPI_list_free(policy_association_update_request->access_types); - OpenAPI_list_free(policy_association_update_request->rat_types); - OpenAPI_list_for_each(policy_association_update_request->n3g_allowed_snssais, node) { - OpenAPI_snssai_free(node->data); + if (policy_association_update_request->wl_serv_area_res) { + OpenAPI_wireline_service_area_restriction_free(policy_association_update_request->wl_serv_area_res); + policy_association_update_request->wl_serv_area_res = NULL; + } + if (policy_association_update_request->smf_sel_info) { + OpenAPI_smf_selection_data_free(policy_association_update_request->smf_sel_info); + policy_association_update_request->smf_sel_info = NULL; + } + if (policy_association_update_request->ue_ambr) { + OpenAPI_ambr_free(policy_association_update_request->ue_ambr); + policy_association_update_request->ue_ambr = NULL; + } + if (policy_association_update_request->pra_statuses) { + OpenAPI_list_for_each(policy_association_update_request->pra_statuses, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(policy_association_update_request->pra_statuses); + policy_association_update_request->pra_statuses = NULL; + } + if (policy_association_update_request->user_loc) { + OpenAPI_user_location_free(policy_association_update_request->user_loc); + policy_association_update_request->user_loc = NULL; + } + if (policy_association_update_request->allowed_snssais) { + OpenAPI_list_for_each(policy_association_update_request->allowed_snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(policy_association_update_request->allowed_snssais); + policy_association_update_request->allowed_snssais = NULL; + } + if (policy_association_update_request->mapping_snssais) { + OpenAPI_list_for_each(policy_association_update_request->mapping_snssais, node) { + OpenAPI_mapping_of_snssai_free(node->data); + } + OpenAPI_list_free(policy_association_update_request->mapping_snssais); + policy_association_update_request->mapping_snssais = NULL; + } + if (policy_association_update_request->access_types) { + OpenAPI_list_free(policy_association_update_request->access_types); + policy_association_update_request->access_types = NULL; + } + if (policy_association_update_request->rat_types) { + OpenAPI_list_free(policy_association_update_request->rat_types); + policy_association_update_request->rat_types = NULL; + } + if (policy_association_update_request->n3g_allowed_snssais) { + OpenAPI_list_for_each(policy_association_update_request->n3g_allowed_snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(policy_association_update_request->n3g_allowed_snssais); + policy_association_update_request->n3g_allowed_snssais = NULL; + } + if (policy_association_update_request->trace_req) { + OpenAPI_trace_data_free(policy_association_update_request->trace_req); + policy_association_update_request->trace_req = NULL; + } + if (policy_association_update_request->guami) { + OpenAPI_guami_free(policy_association_update_request->guami); + policy_association_update_request->guami = NULL; } - OpenAPI_list_free(policy_association_update_request->n3g_allowed_snssais); - OpenAPI_trace_data_free(policy_association_update_request->trace_req); - OpenAPI_guami_free(policy_association_update_request->guami); ogs_free(policy_association_update_request); } cJSON *OpenAPI_policy_association_update_request_convertToJSON(OpenAPI_policy_association_update_request_t *policy_association_update_request) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (policy_association_update_request == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [PolicyAssociationUpdateRequest]"); @@ -123,62 +179,55 @@ cJSON *OpenAPI_policy_association_update_request_convertToJSON(OpenAPI_policy_as } if (policy_association_update_request->alt_notif_ipv4_addrs) { - cJSON *alt_notif_ipv4_addrs = cJSON_AddArrayToObject(item, "altNotifIpv4Addrs"); - if (alt_notif_ipv4_addrs == NULL) { + cJSON *alt_notif_ipv4_addrsList = cJSON_AddArrayToObject(item, "altNotifIpv4Addrs"); + if (alt_notif_ipv4_addrsList == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_ipv4_addrs]"); goto end; } - - OpenAPI_lnode_t *alt_notif_ipv4_addrs_node; - OpenAPI_list_for_each(policy_association_update_request->alt_notif_ipv4_addrs, alt_notif_ipv4_addrs_node) { - if (cJSON_AddStringToObject(alt_notif_ipv4_addrs, "", (char*)alt_notif_ipv4_addrs_node->data) == NULL) { - ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_ipv4_addrs]"); - goto end; + OpenAPI_list_for_each(policy_association_update_request->alt_notif_ipv4_addrs, node) { + if (cJSON_AddStringToObject(alt_notif_ipv4_addrsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_ipv4_addrs]"); + goto end; + } } - } } if (policy_association_update_request->alt_notif_ipv6_addrs) { - cJSON *alt_notif_ipv6_addrs = cJSON_AddArrayToObject(item, "altNotifIpv6Addrs"); - if (alt_notif_ipv6_addrs == NULL) { + cJSON *alt_notif_ipv6_addrsList = cJSON_AddArrayToObject(item, "altNotifIpv6Addrs"); + if (alt_notif_ipv6_addrsList == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_ipv6_addrs]"); goto end; } - - OpenAPI_lnode_t *alt_notif_ipv6_addrs_node; - OpenAPI_list_for_each(policy_association_update_request->alt_notif_ipv6_addrs, alt_notif_ipv6_addrs_node) { - if (cJSON_AddStringToObject(alt_notif_ipv6_addrs, "", (char*)alt_notif_ipv6_addrs_node->data) == NULL) { - ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_ipv6_addrs]"); - goto end; + OpenAPI_list_for_each(policy_association_update_request->alt_notif_ipv6_addrs, node) { + if (cJSON_AddStringToObject(alt_notif_ipv6_addrsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_ipv6_addrs]"); + goto end; + } } - } } if (policy_association_update_request->alt_notif_fqdns) { - cJSON *alt_notif_fqdns = cJSON_AddArrayToObject(item, "altNotifFqdns"); - if (alt_notif_fqdns == NULL) { + cJSON *alt_notif_fqdnsList = cJSON_AddArrayToObject(item, "altNotifFqdns"); + if (alt_notif_fqdnsList == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_fqdns]"); goto end; } - - OpenAPI_lnode_t *alt_notif_fqdns_node; - OpenAPI_list_for_each(policy_association_update_request->alt_notif_fqdns, alt_notif_fqdns_node) { - if (cJSON_AddStringToObject(alt_notif_fqdns, "", (char*)alt_notif_fqdns_node->data) == NULL) { - ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_fqdns]"); - goto end; + OpenAPI_list_for_each(policy_association_update_request->alt_notif_fqdns, node) { + if (cJSON_AddStringToObject(alt_notif_fqdnsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [alt_notif_fqdns]"); + goto end; + } } - } } - if (policy_association_update_request->triggers) { - cJSON *triggers = cJSON_AddArrayToObject(item, "triggers"); - if (triggers == NULL) { + if (policy_association_update_request->triggers != OpenAPI_request_trigger_NULL) { + cJSON *triggersList = cJSON_AddArrayToObject(item, "triggers"); + if (triggersList == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [triggers]"); goto end; } - OpenAPI_lnode_t *triggers_node; - OpenAPI_list_for_each(policy_association_update_request->triggers, triggers_node) { - if (cJSON_AddStringToObject(triggers, "", OpenAPI_request_trigger_ToString((intptr_t)triggers_node->data)) == NULL) { + OpenAPI_list_for_each(policy_association_update_request->triggers, node) { + if (cJSON_AddStringToObject(triggersList, "", OpenAPI_request_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [triggers]"); goto end; } @@ -251,21 +300,20 @@ cJSON *OpenAPI_policy_association_update_request_convertToJSON(OpenAPI_policy_as goto end; } cJSON *localMapObject = pra_statuses; - OpenAPI_lnode_t *pra_statuses_node; if (policy_association_update_request->pra_statuses) { - OpenAPI_list_for_each(policy_association_update_request->pra_statuses, pra_statuses_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_statuses_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(policy_association_update_request->pra_statuses, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (policy_association_update_request->user_loc) { cJSON *user_loc_local_JSON = OpenAPI_user_location_convertToJSON(policy_association_update_request->user_loc); @@ -286,17 +334,13 @@ cJSON *OpenAPI_policy_association_update_request_convertToJSON(OpenAPI_policy_as ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [allowed_snssais]"); goto end; } - - OpenAPI_lnode_t *allowed_snssais_node; - if (policy_association_update_request->allowed_snssais) { - OpenAPI_list_for_each(policy_association_update_request->allowed_snssais, allowed_snssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(allowed_snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [allowed_snssais]"); - goto end; - } - cJSON_AddItemToArray(allowed_snssaisList, itemLocal); + OpenAPI_list_for_each(policy_association_update_request->allowed_snssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [allowed_snssais]"); + goto end; } + cJSON_AddItemToArray(allowed_snssaisList, itemLocal); } } @@ -306,44 +350,38 @@ cJSON *OpenAPI_policy_association_update_request_convertToJSON(OpenAPI_policy_as ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [mapping_snssais]"); goto end; } - - OpenAPI_lnode_t *mapping_snssais_node; - if (policy_association_update_request->mapping_snssais) { - OpenAPI_list_for_each(policy_association_update_request->mapping_snssais, mapping_snssais_node) { - cJSON *itemLocal = OpenAPI_mapping_of_snssai_convertToJSON(mapping_snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [mapping_snssais]"); - goto end; - } - cJSON_AddItemToArray(mapping_snssaisList, itemLocal); + OpenAPI_list_for_each(policy_association_update_request->mapping_snssais, node) { + cJSON *itemLocal = OpenAPI_mapping_of_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [mapping_snssais]"); + goto end; } + cJSON_AddItemToArray(mapping_snssaisList, itemLocal); } } - if (policy_association_update_request->access_types) { - cJSON *access_types = cJSON_AddArrayToObject(item, "accessTypes"); - if (access_types == NULL) { + if (policy_association_update_request->access_types != OpenAPI_access_type_NULL) { + cJSON *access_typesList = cJSON_AddArrayToObject(item, "accessTypes"); + if (access_typesList == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [access_types]"); goto end; } - OpenAPI_lnode_t *access_types_node; - OpenAPI_list_for_each(policy_association_update_request->access_types, access_types_node) { - if (cJSON_AddStringToObject(access_types, "", OpenAPI_access_type_ToString((intptr_t)access_types_node->data)) == NULL) { + OpenAPI_list_for_each(policy_association_update_request->access_types, node) { + if (cJSON_AddStringToObject(access_typesList, "", OpenAPI_access_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [access_types]"); goto end; } } } - if (policy_association_update_request->rat_types) { - cJSON *rat_types = cJSON_AddArrayToObject(item, "ratTypes"); - if (rat_types == NULL) { + if (policy_association_update_request->rat_types != OpenAPI_rat_type_NULL) { + cJSON *rat_typesList = cJSON_AddArrayToObject(item, "ratTypes"); + if (rat_typesList == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [rat_types]"); goto end; } - OpenAPI_lnode_t *rat_types_node; - OpenAPI_list_for_each(policy_association_update_request->rat_types, rat_types_node) { - if (cJSON_AddStringToObject(rat_types, "", OpenAPI_rat_type_ToString((intptr_t)rat_types_node->data)) == NULL) { + OpenAPI_list_for_each(policy_association_update_request->rat_types, node) { + if (cJSON_AddStringToObject(rat_typesList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [rat_types]"); goto end; } @@ -356,17 +394,13 @@ cJSON *OpenAPI_policy_association_update_request_convertToJSON(OpenAPI_policy_as ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [n3g_allowed_snssais]"); goto end; } - - OpenAPI_lnode_t *n3g_allowed_snssais_node; - if (policy_association_update_request->n3g_allowed_snssais) { - OpenAPI_list_for_each(policy_association_update_request->n3g_allowed_snssais, n3g_allowed_snssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(n3g_allowed_snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [n3g_allowed_snssais]"); - goto end; - } - cJSON_AddItemToArray(n3g_allowed_snssaisList, itemLocal); + OpenAPI_list_for_each(policy_association_update_request->n3g_allowed_snssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_association_update_request_convertToJSON() failed [n3g_allowed_snssais]"); + goto end; } + cJSON_AddItemToArray(n3g_allowed_snssaisList, itemLocal); } } @@ -403,113 +437,144 @@ end: OpenAPI_policy_association_update_request_t *OpenAPI_policy_association_update_request_parseFromJSON(cJSON *policy_association_update_requestJSON) { OpenAPI_policy_association_update_request_t *policy_association_update_request_local_var = NULL; - cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "notificationUri"); - + OpenAPI_lnode_t *node = NULL; + cJSON *notification_uri = NULL; + cJSON *alt_notif_ipv4_addrs = NULL; + OpenAPI_list_t *alt_notif_ipv4_addrsList = NULL; + cJSON *alt_notif_ipv6_addrs = NULL; + OpenAPI_list_t *alt_notif_ipv6_addrsList = NULL; + cJSON *alt_notif_fqdns = NULL; + OpenAPI_list_t *alt_notif_fqdnsList = NULL; + cJSON *triggers = NULL; + OpenAPI_list_t *triggersList = NULL; + cJSON *serv_area_res = NULL; + OpenAPI_service_area_restriction_t *serv_area_res_local_nonprim = NULL; + cJSON *wl_serv_area_res = NULL; + OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL; + cJSON *rfsp = NULL; + cJSON *smf_sel_info = NULL; + OpenAPI_smf_selection_data_t *smf_sel_info_local_nonprim = NULL; + cJSON *ue_ambr = NULL; + OpenAPI_ambr_t *ue_ambr_local_nonprim = NULL; + cJSON *pra_statuses = NULL; + OpenAPI_list_t *pra_statusesList = NULL; + cJSON *user_loc = NULL; + OpenAPI_user_location_t *user_loc_local_nonprim = NULL; + cJSON *allowed_snssais = NULL; + OpenAPI_list_t *allowed_snssaisList = NULL; + cJSON *mapping_snssais = NULL; + OpenAPI_list_t *mapping_snssaisList = NULL; + cJSON *access_types = NULL; + OpenAPI_list_t *access_typesList = NULL; + cJSON *rat_types = NULL; + OpenAPI_list_t *rat_typesList = NULL; + cJSON *n3g_allowed_snssais = NULL; + OpenAPI_list_t *n3g_allowed_snssaisList = NULL; + cJSON *trace_req = NULL; + OpenAPI_trace_data_t *trace_req_local_nonprim = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + notification_uri = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "notificationUri"); if (notification_uri) { - if (!cJSON_IsString(notification_uri)) { + if (!cJSON_IsString(notification_uri) && !cJSON_IsNull(notification_uri)) { ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [notification_uri]"); goto end; } } - cJSON *alt_notif_ipv4_addrs = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "altNotifIpv4Addrs"); - - OpenAPI_list_t *alt_notif_ipv4_addrsList; + alt_notif_ipv4_addrs = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "altNotifIpv4Addrs"); if (alt_notif_ipv4_addrs) { - cJSON *alt_notif_ipv4_addrs_local; - if (!cJSON_IsArray(alt_notif_ipv4_addrs)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_ipv4_addrs]"); - goto end; - } - alt_notif_ipv4_addrsList = OpenAPI_list_create(); + cJSON *alt_notif_ipv4_addrs_local = NULL; + if (!cJSON_IsArray(alt_notif_ipv4_addrs)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_ipv4_addrs]"); + goto end; + } - cJSON_ArrayForEach(alt_notif_ipv4_addrs_local, alt_notif_ipv4_addrs) { - if (!cJSON_IsString(alt_notif_ipv4_addrs_local)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_ipv4_addrs]"); - goto end; - } - OpenAPI_list_add(alt_notif_ipv4_addrsList, ogs_strdup(alt_notif_ipv4_addrs_local->valuestring)); - } + alt_notif_ipv4_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alt_notif_ipv4_addrs_local, alt_notif_ipv4_addrs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(alt_notif_ipv4_addrs_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_ipv4_addrs]"); + goto end; + } + OpenAPI_list_add(alt_notif_ipv4_addrsList, ogs_strdup(alt_notif_ipv4_addrs_local->valuestring)); + } } - cJSON *alt_notif_ipv6_addrs = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "altNotifIpv6Addrs"); - - OpenAPI_list_t *alt_notif_ipv6_addrsList; + alt_notif_ipv6_addrs = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "altNotifIpv6Addrs"); if (alt_notif_ipv6_addrs) { - cJSON *alt_notif_ipv6_addrs_local; - if (!cJSON_IsArray(alt_notif_ipv6_addrs)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_ipv6_addrs]"); - goto end; - } - alt_notif_ipv6_addrsList = OpenAPI_list_create(); + cJSON *alt_notif_ipv6_addrs_local = NULL; + if (!cJSON_IsArray(alt_notif_ipv6_addrs)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_ipv6_addrs]"); + goto end; + } - cJSON_ArrayForEach(alt_notif_ipv6_addrs_local, alt_notif_ipv6_addrs) { - if (!cJSON_IsString(alt_notif_ipv6_addrs_local)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_ipv6_addrs]"); - goto end; - } - OpenAPI_list_add(alt_notif_ipv6_addrsList, ogs_strdup(alt_notif_ipv6_addrs_local->valuestring)); - } + alt_notif_ipv6_addrsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alt_notif_ipv6_addrs_local, alt_notif_ipv6_addrs) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(alt_notif_ipv6_addrs_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_ipv6_addrs]"); + goto end; + } + OpenAPI_list_add(alt_notif_ipv6_addrsList, ogs_strdup(alt_notif_ipv6_addrs_local->valuestring)); + } } - cJSON *alt_notif_fqdns = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "altNotifFqdns"); - - OpenAPI_list_t *alt_notif_fqdnsList; + alt_notif_fqdns = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "altNotifFqdns"); if (alt_notif_fqdns) { - cJSON *alt_notif_fqdns_local; - if (!cJSON_IsArray(alt_notif_fqdns)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_fqdns]"); - goto end; - } - alt_notif_fqdnsList = OpenAPI_list_create(); + cJSON *alt_notif_fqdns_local = NULL; + if (!cJSON_IsArray(alt_notif_fqdns)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_fqdns]"); + goto end; + } - cJSON_ArrayForEach(alt_notif_fqdns_local, alt_notif_fqdns) { - if (!cJSON_IsString(alt_notif_fqdns_local)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_fqdns]"); - goto end; - } - OpenAPI_list_add(alt_notif_fqdnsList, ogs_strdup(alt_notif_fqdns_local->valuestring)); - } + alt_notif_fqdnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(alt_notif_fqdns_local, alt_notif_fqdns) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(alt_notif_fqdns_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [alt_notif_fqdns]"); + goto end; + } + OpenAPI_list_add(alt_notif_fqdnsList, ogs_strdup(alt_notif_fqdns_local->valuestring)); + } } - cJSON *triggers = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "triggers"); - - OpenAPI_list_t *triggersList; + triggers = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "triggers"); if (triggers) { - cJSON *triggers_local_nonprimitive; - if (!cJSON_IsArray(triggers)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [triggers]"); - goto end; - } - - triggersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(triggers_local_nonprimitive, triggers ) { - if (!cJSON_IsString(triggers_local_nonprimitive)){ + cJSON *triggers_local = NULL; + if (!cJSON_IsArray(triggers)) { ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [triggers]"); goto end; } - OpenAPI_list_add(triggersList, (void *)OpenAPI_request_trigger_FromString(triggers_local_nonprimitive->valuestring)); - } + triggersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(triggers_local, triggers) { + if (!cJSON_IsString(triggers_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [triggers]"); + goto end; + } + OpenAPI_list_add(triggersList, (void *)OpenAPI_request_trigger_FromString(triggers_local->valuestring)); + } } - cJSON *serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "servAreaRes"); - - OpenAPI_service_area_restriction_t *serv_area_res_local_nonprim = NULL; + serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "servAreaRes"); if (serv_area_res) { serv_area_res_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(serv_area_res); } - cJSON *wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "wlServAreaRes"); - - OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL; + wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "wlServAreaRes"); if (wl_serv_area_res) { wl_serv_area_res_local_nonprim = OpenAPI_wireline_service_area_restriction_parseFromJSON(wl_serv_area_res); } - cJSON *rfsp = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "rfsp"); - + rfsp = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "rfsp"); if (rfsp) { if (!cJSON_IsNumber(rfsp)) { ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [rfsp]"); @@ -517,200 +582,172 @@ OpenAPI_policy_association_update_request_t *OpenAPI_policy_association_update_r } } - cJSON *smf_sel_info = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "smfSelInfo"); - - OpenAPI_smf_selection_data_t *smf_sel_info_local_nonprim = NULL; + smf_sel_info = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "smfSelInfo"); if (smf_sel_info) { smf_sel_info_local_nonprim = OpenAPI_smf_selection_data_parseFromJSON(smf_sel_info); } - cJSON *ue_ambr = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "ueAmbr"); - - OpenAPI_ambr_t *ue_ambr_local_nonprim = NULL; + ue_ambr = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "ueAmbr"); if (ue_ambr) { ue_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(ue_ambr); } - cJSON *pra_statuses = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "praStatuses"); - - OpenAPI_list_t *pra_statusesList; + pra_statuses = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "praStatuses"); if (pra_statuses) { - cJSON *pra_statuses_local_map; - if (!cJSON_IsObject(pra_statuses)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [pra_statuses]"); - goto end; - } - pra_statusesList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pra_statuses_local_map, pra_statuses) { - cJSON *localMapObject = pra_statuses_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [inner]"); + cJSON *pra_statuses_local_map = NULL; + if (!cJSON_IsObject(pra_statuses) && !cJSON_IsNull(pra_statuses)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [pra_statuses]"); goto end; } - OpenAPI_list_add(pra_statusesList, localMapKeyPair); - } + if (cJSON_IsObject(pra_statuses)) { + pra_statusesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pra_statuses_local_map, pra_statuses) { + cJSON *localMapObject = pra_statuses_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pra_statusesList, localMapKeyPair); + } + } } - cJSON *user_loc = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "userLoc"); - - OpenAPI_user_location_t *user_loc_local_nonprim = NULL; + user_loc = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "userLoc"); if (user_loc) { user_loc_local_nonprim = OpenAPI_user_location_parseFromJSON(user_loc); } - cJSON *allowed_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "allowedSnssais"); - - OpenAPI_list_t *allowed_snssaisList; + allowed_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "allowedSnssais"); if (allowed_snssais) { - cJSON *allowed_snssais_local_nonprimitive; - if (!cJSON_IsArray(allowed_snssais)){ - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [allowed_snssais]"); - goto end; - } - - allowed_snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_snssais_local_nonprimitive, allowed_snssais ) { - if (!cJSON_IsObject(allowed_snssais_local_nonprimitive)) { + cJSON *allowed_snssais_local = NULL; + if (!cJSON_IsArray(allowed_snssais)) { ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [allowed_snssais]"); goto end; } - OpenAPI_snssai_t *allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(allowed_snssais_local_nonprimitive); - if (!allowed_snssaisItem) { - ogs_error("No allowed_snssaisItem"); - OpenAPI_list_free(allowed_snssaisList); - goto end; + allowed_snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_snssais_local, allowed_snssais) { + if (!cJSON_IsObject(allowed_snssais_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [allowed_snssais]"); + goto end; + } + OpenAPI_snssai_t *allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(allowed_snssais_local); + if (!allowed_snssaisItem) { + ogs_error("No allowed_snssaisItem"); + OpenAPI_list_free(allowed_snssaisList); + goto end; + } + OpenAPI_list_add(allowed_snssaisList, allowed_snssaisItem); } - - OpenAPI_list_add(allowed_snssaisList, allowed_snssaisItem); - } } - cJSON *mapping_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "mappingSnssais"); - - OpenAPI_list_t *mapping_snssaisList; + mapping_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "mappingSnssais"); if (mapping_snssais) { - cJSON *mapping_snssais_local_nonprimitive; - if (!cJSON_IsArray(mapping_snssais)){ - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [mapping_snssais]"); - goto end; - } - - mapping_snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mapping_snssais_local_nonprimitive, mapping_snssais ) { - if (!cJSON_IsObject(mapping_snssais_local_nonprimitive)) { + cJSON *mapping_snssais_local = NULL; + if (!cJSON_IsArray(mapping_snssais)) { ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [mapping_snssais]"); goto end; } - OpenAPI_mapping_of_snssai_t *mapping_snssaisItem = OpenAPI_mapping_of_snssai_parseFromJSON(mapping_snssais_local_nonprimitive); - if (!mapping_snssaisItem) { - ogs_error("No mapping_snssaisItem"); - OpenAPI_list_free(mapping_snssaisList); - goto end; + mapping_snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mapping_snssais_local, mapping_snssais) { + if (!cJSON_IsObject(mapping_snssais_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [mapping_snssais]"); + goto end; + } + OpenAPI_mapping_of_snssai_t *mapping_snssaisItem = OpenAPI_mapping_of_snssai_parseFromJSON(mapping_snssais_local); + if (!mapping_snssaisItem) { + ogs_error("No mapping_snssaisItem"); + OpenAPI_list_free(mapping_snssaisList); + goto end; + } + OpenAPI_list_add(mapping_snssaisList, mapping_snssaisItem); } - - OpenAPI_list_add(mapping_snssaisList, mapping_snssaisItem); - } } - cJSON *access_types = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "accessTypes"); - - OpenAPI_list_t *access_typesList; + access_types = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "accessTypes"); if (access_types) { - cJSON *access_types_local_nonprimitive; - if (!cJSON_IsArray(access_types)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [access_types]"); - goto end; - } - - access_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(access_types_local_nonprimitive, access_types ) { - if (!cJSON_IsString(access_types_local_nonprimitive)){ + cJSON *access_types_local = NULL; + if (!cJSON_IsArray(access_types)) { ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [access_types]"); goto end; } - OpenAPI_list_add(access_typesList, (void *)OpenAPI_access_type_FromString(access_types_local_nonprimitive->valuestring)); - } + access_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(access_types_local, access_types) { + if (!cJSON_IsString(access_types_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [access_types]"); + goto end; + } + OpenAPI_list_add(access_typesList, (void *)OpenAPI_access_type_FromString(access_types_local->valuestring)); + } } - cJSON *rat_types = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "ratTypes"); - - OpenAPI_list_t *rat_typesList; + rat_types = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "ratTypes"); if (rat_types) { - cJSON *rat_types_local_nonprimitive; - if (!cJSON_IsArray(rat_types)) { - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [rat_types]"); - goto end; - } - - rat_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rat_types_local_nonprimitive, rat_types ) { - if (!cJSON_IsString(rat_types_local_nonprimitive)){ + cJSON *rat_types_local = NULL; + if (!cJSON_IsArray(rat_types)) { ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [rat_types]"); goto end; } - OpenAPI_list_add(rat_typesList, (void *)OpenAPI_rat_type_FromString(rat_types_local_nonprimitive->valuestring)); - } + rat_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rat_types_local, rat_types) { + if (!cJSON_IsString(rat_types_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [rat_types]"); + goto end; + } + OpenAPI_list_add(rat_typesList, (void *)OpenAPI_rat_type_FromString(rat_types_local->valuestring)); + } } - cJSON *n3g_allowed_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "n3gAllowedSnssais"); - - OpenAPI_list_t *n3g_allowed_snssaisList; + n3g_allowed_snssais = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "n3gAllowedSnssais"); if (n3g_allowed_snssais) { - cJSON *n3g_allowed_snssais_local_nonprimitive; - if (!cJSON_IsArray(n3g_allowed_snssais)){ - ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [n3g_allowed_snssais]"); - goto end; - } - - n3g_allowed_snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(n3g_allowed_snssais_local_nonprimitive, n3g_allowed_snssais ) { - if (!cJSON_IsObject(n3g_allowed_snssais_local_nonprimitive)) { + cJSON *n3g_allowed_snssais_local = NULL; + if (!cJSON_IsArray(n3g_allowed_snssais)) { ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [n3g_allowed_snssais]"); goto end; } - OpenAPI_snssai_t *n3g_allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(n3g_allowed_snssais_local_nonprimitive); - if (!n3g_allowed_snssaisItem) { - ogs_error("No n3g_allowed_snssaisItem"); - OpenAPI_list_free(n3g_allowed_snssaisList); - goto end; + n3g_allowed_snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(n3g_allowed_snssais_local, n3g_allowed_snssais) { + if (!cJSON_IsObject(n3g_allowed_snssais_local)) { + ogs_error("OpenAPI_policy_association_update_request_parseFromJSON() failed [n3g_allowed_snssais]"); + goto end; + } + OpenAPI_snssai_t *n3g_allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(n3g_allowed_snssais_local); + if (!n3g_allowed_snssaisItem) { + ogs_error("No n3g_allowed_snssaisItem"); + OpenAPI_list_free(n3g_allowed_snssaisList); + goto end; + } + OpenAPI_list_add(n3g_allowed_snssaisList, n3g_allowed_snssaisItem); } - - OpenAPI_list_add(n3g_allowed_snssaisList, n3g_allowed_snssaisItem); - } } - cJSON *trace_req = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "traceReq"); - - OpenAPI_trace_data_t *trace_req_local_nonprim = NULL; + trace_req = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "traceReq"); if (trace_req) { trace_req_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_req); } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(policy_association_update_requestJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } policy_association_update_request_local_var = OpenAPI_policy_association_update_request_create ( - notification_uri ? ogs_strdup(notification_uri->valuestring) : NULL, + notification_uri && !cJSON_IsNull(notification_uri) ? ogs_strdup(notification_uri->valuestring) : NULL, alt_notif_ipv4_addrs ? alt_notif_ipv4_addrsList : NULL, alt_notif_ipv6_addrs ? alt_notif_ipv6_addrsList : NULL, alt_notif_fqdns ? alt_notif_fqdnsList : NULL, @@ -734,6 +771,98 @@ OpenAPI_policy_association_update_request_t *OpenAPI_policy_association_update_r return policy_association_update_request_local_var; end: + if (alt_notif_ipv4_addrsList) { + OpenAPI_list_for_each(alt_notif_ipv4_addrsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(alt_notif_ipv4_addrsList); + alt_notif_ipv4_addrsList = NULL; + } + if (alt_notif_ipv6_addrsList) { + OpenAPI_list_for_each(alt_notif_ipv6_addrsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(alt_notif_ipv6_addrsList); + alt_notif_ipv6_addrsList = NULL; + } + if (alt_notif_fqdnsList) { + OpenAPI_list_for_each(alt_notif_fqdnsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(alt_notif_fqdnsList); + alt_notif_fqdnsList = NULL; + } + if (triggersList) { + OpenAPI_list_free(triggersList); + triggersList = NULL; + } + if (serv_area_res_local_nonprim) { + OpenAPI_service_area_restriction_free(serv_area_res_local_nonprim); + serv_area_res_local_nonprim = NULL; + } + if (wl_serv_area_res_local_nonprim) { + OpenAPI_wireline_service_area_restriction_free(wl_serv_area_res_local_nonprim); + wl_serv_area_res_local_nonprim = NULL; + } + if (smf_sel_info_local_nonprim) { + OpenAPI_smf_selection_data_free(smf_sel_info_local_nonprim); + smf_sel_info_local_nonprim = NULL; + } + if (ue_ambr_local_nonprim) { + OpenAPI_ambr_free(ue_ambr_local_nonprim); + ue_ambr_local_nonprim = NULL; + } + if (pra_statusesList) { + OpenAPI_list_for_each(pra_statusesList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pra_statusesList); + pra_statusesList = NULL; + } + if (user_loc_local_nonprim) { + OpenAPI_user_location_free(user_loc_local_nonprim); + user_loc_local_nonprim = NULL; + } + if (allowed_snssaisList) { + OpenAPI_list_for_each(allowed_snssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(allowed_snssaisList); + allowed_snssaisList = NULL; + } + if (mapping_snssaisList) { + OpenAPI_list_for_each(mapping_snssaisList, node) { + OpenAPI_mapping_of_snssai_free(node->data); + } + OpenAPI_list_free(mapping_snssaisList); + mapping_snssaisList = NULL; + } + if (access_typesList) { + OpenAPI_list_free(access_typesList); + access_typesList = NULL; + } + if (rat_typesList) { + OpenAPI_list_free(rat_typesList); + rat_typesList = NULL; + } + if (n3g_allowed_snssaisList) { + OpenAPI_list_for_each(n3g_allowed_snssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(n3g_allowed_snssaisList); + n3g_allowed_snssaisList = NULL; + } + if (trace_req_local_nonprim) { + OpenAPI_trace_data_free(trace_req_local_nonprim); + trace_req_local_nonprim = NULL; + } + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/policy_control_request_trigger.c b/lib/sbi/openapi/model/policy_control_request_trigger.c index 3b1a7e9c1..179be1a09 100644 --- a/lib/sbi/openapi/model/policy_control_request_trigger.c +++ b/lib/sbi/openapi/model/policy_control_request_trigger.c @@ -6,7 +6,7 @@ char* OpenAPI_policy_control_request_trigger_ToString(OpenAPI_policy_control_request_trigger_e policy_control_request_trigger) { - const char *policy_control_request_triggerArray[] = { "NULL", "PLMN_CH", "RES_MO_RE", "AC_TY_CH", "UE_IP_CH", "UE_MAC_CH", "AN_CH_COR", "US_RE", "APP_STA", "APP_STO", "AN_INFO", "CM_SES_FAIL", "PS_DA_OFF", "DEF_QOS_CH", "SE_AMBR_CH", "QOS_NOTIF", "NO_CREDIT", "REALLO_OF_CREDIT", "PRA_CH", "SAREA_CH", "SCNN_CH", "RE_TIMEOUT", "RES_RELEASE", "SUCC_RES_ALLO", "RAT_TY_CH", "REF_QOS_IND_CH", "NUM_OF_PACKET_FILTER", "UE_STATUS_RESUME", "UE_TZ_CH", "AUTH_PROF_CH", "QOS_MONITORING", "SCELL_CH", "EPS_FALLBACK", "MA_PDU", "TSN_BRIDGE_INFO", "_5G_RG_JOIN", "_5G_RG_LEAVE", "DDN_FAILURE", "DDN_DELIVERY_STATUS", "GROUP_ID_LIST_CHG", "DDN_FAILURE_CANCELLATION", "DDN_DELIVERY_STATUS_CANCELLATION", "VPLMN_QOS_CH" }; + const char *policy_control_request_triggerArray[] = { "NULL", "PLMN_CH", "RES_MO_RE", "AC_TY_CH", "UE_IP_CH", "UE_MAC_CH", "AN_CH_COR", "US_RE", "APP_STA", "APP_STO", "AN_INFO", "CM_SES_FAIL", "PS_DA_OFF", "DEF_QOS_CH", "SE_AMBR_CH", "QOS_NOTIF", "NO_CREDIT", "REALLO_OF_CREDIT", "PRA_CH", "SAREA_CH", "SCNN_CH", "RE_TIMEOUT", "RES_RELEASE", "SUCC_RES_ALLO", "RAT_TY_CH", "REF_QOS_IND_CH", "NUM_OF_PACKET_FILTER", "UE_STATUS_RESUME", "UE_TZ_CH", "AUTH_PROF_CH", "QOS_MONITORING", "SCELL_CH", "EPS_FALLBACK", "MA_PDU", "TSN_BRIDGE_INFO", "5G_RG_JOIN", "5G_RG_LEAVE", "DDN_FAILURE", "DDN_DELIVERY_STATUS", "GROUP_ID_LIST_CHG", "DDN_FAILURE_CANCELLATION", "DDN_DELIVERY_STATUS_CANCELLATION", "VPLMN_QOS_CH" }; size_t sizeofArray = sizeof(policy_control_request_triggerArray) / sizeof(policy_control_request_triggerArray[0]); if (policy_control_request_trigger < sizeofArray) return (char *)policy_control_request_triggerArray[policy_control_request_trigger]; @@ -17,7 +17,7 @@ char* OpenAPI_policy_control_request_trigger_ToString(OpenAPI_policy_control_req OpenAPI_policy_control_request_trigger_e OpenAPI_policy_control_request_trigger_FromString(char* policy_control_request_trigger) { int stringToReturn = 0; - const char *policy_control_request_triggerArray[] = { "NULL", "PLMN_CH", "RES_MO_RE", "AC_TY_CH", "UE_IP_CH", "UE_MAC_CH", "AN_CH_COR", "US_RE", "APP_STA", "APP_STO", "AN_INFO", "CM_SES_FAIL", "PS_DA_OFF", "DEF_QOS_CH", "SE_AMBR_CH", "QOS_NOTIF", "NO_CREDIT", "REALLO_OF_CREDIT", "PRA_CH", "SAREA_CH", "SCNN_CH", "RE_TIMEOUT", "RES_RELEASE", "SUCC_RES_ALLO", "RAT_TY_CH", "REF_QOS_IND_CH", "NUM_OF_PACKET_FILTER", "UE_STATUS_RESUME", "UE_TZ_CH", "AUTH_PROF_CH", "QOS_MONITORING", "SCELL_CH", "EPS_FALLBACK", "MA_PDU", "TSN_BRIDGE_INFO", "_5G_RG_JOIN", "_5G_RG_LEAVE", "DDN_FAILURE", "DDN_DELIVERY_STATUS", "GROUP_ID_LIST_CHG", "DDN_FAILURE_CANCELLATION", "DDN_DELIVERY_STATUS_CANCELLATION", "VPLMN_QOS_CH" }; + const char *policy_control_request_triggerArray[] = { "NULL", "PLMN_CH", "RES_MO_RE", "AC_TY_CH", "UE_IP_CH", "UE_MAC_CH", "AN_CH_COR", "US_RE", "APP_STA", "APP_STO", "AN_INFO", "CM_SES_FAIL", "PS_DA_OFF", "DEF_QOS_CH", "SE_AMBR_CH", "QOS_NOTIF", "NO_CREDIT", "REALLO_OF_CREDIT", "PRA_CH", "SAREA_CH", "SCNN_CH", "RE_TIMEOUT", "RES_RELEASE", "SUCC_RES_ALLO", "RAT_TY_CH", "REF_QOS_IND_CH", "NUM_OF_PACKET_FILTER", "UE_STATUS_RESUME", "UE_TZ_CH", "AUTH_PROF_CH", "QOS_MONITORING", "SCELL_CH", "EPS_FALLBACK", "MA_PDU", "TSN_BRIDGE_INFO", "5G_RG_JOIN", "5G_RG_LEAVE", "DDN_FAILURE", "DDN_DELIVERY_STATUS", "GROUP_ID_LIST_CHG", "DDN_FAILURE_CANCELLATION", "DDN_DELIVERY_STATUS_CANCELLATION", "VPLMN_QOS_CH" }; size_t sizeofArray = sizeof(policy_control_request_triggerArray) / sizeof(policy_control_request_triggerArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(policy_control_request_trigger, policy_control_request_triggerArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/policy_data_change_notification.c b/lib/sbi/openapi/model/policy_data_change_notification.c index 166968644..2949c75f0 100644 --- a/lib/sbi/openapi/model/policy_data_change_notification.c +++ b/lib/sbi/openapi/model/policy_data_change_notification.c @@ -50,45 +50,98 @@ OpenAPI_policy_data_change_notification_t *OpenAPI_policy_data_change_notificati void OpenAPI_policy_data_change_notification_free(OpenAPI_policy_data_change_notification_t *policy_data_change_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == policy_data_change_notification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_am_policy_data_free(policy_data_change_notification->am_policy_data); - OpenAPI_ue_policy_set_free(policy_data_change_notification->ue_policy_set); - OpenAPI_ue_policy_set_free(policy_data_change_notification->plmn_ue_policy_set); - OpenAPI_sm_policy_data_free(policy_data_change_notification->sm_policy_data); - OpenAPI_usage_mon_data_free(policy_data_change_notification->usage_mon_data); - OpenAPI_sponsor_connectivity_data_free(policy_data_change_notification->sponsor_connectivity_data); - OpenAPI_bdt_data_free(policy_data_change_notification->bdt_data); - OpenAPI_operator_specific_data_container_free(policy_data_change_notification->op_spec_data); - OpenAPI_list_for_each(policy_data_change_notification->op_spec_data_map, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_operator_specific_data_container_free(localKeyValue->value); - ogs_free(localKeyValue); + if (policy_data_change_notification->am_policy_data) { + OpenAPI_am_policy_data_free(policy_data_change_notification->am_policy_data); + policy_data_change_notification->am_policy_data = NULL; } - OpenAPI_list_free(policy_data_change_notification->op_spec_data_map); - ogs_free(policy_data_change_notification->ue_id); - ogs_free(policy_data_change_notification->sponsor_id); - ogs_free(policy_data_change_notification->bdt_ref_id); - ogs_free(policy_data_change_notification->usage_mon_id); - OpenAPI_plmn_id_1_free(policy_data_change_notification->plmn_id); - OpenAPI_list_for_each(policy_data_change_notification->del_resources, node) { - ogs_free(node->data); + if (policy_data_change_notification->ue_policy_set) { + OpenAPI_ue_policy_set_free(policy_data_change_notification->ue_policy_set); + policy_data_change_notification->ue_policy_set = NULL; } - OpenAPI_list_free(policy_data_change_notification->del_resources); - ogs_free(policy_data_change_notification->notif_id); - OpenAPI_list_for_each(policy_data_change_notification->reported_fragments, node) { - OpenAPI_notification_item_free(node->data); + if (policy_data_change_notification->plmn_ue_policy_set) { + OpenAPI_ue_policy_set_free(policy_data_change_notification->plmn_ue_policy_set); + policy_data_change_notification->plmn_ue_policy_set = NULL; + } + if (policy_data_change_notification->sm_policy_data) { + OpenAPI_sm_policy_data_free(policy_data_change_notification->sm_policy_data); + policy_data_change_notification->sm_policy_data = NULL; + } + if (policy_data_change_notification->usage_mon_data) { + OpenAPI_usage_mon_data_free(policy_data_change_notification->usage_mon_data); + policy_data_change_notification->usage_mon_data = NULL; + } + if (policy_data_change_notification->sponsor_connectivity_data) { + OpenAPI_sponsor_connectivity_data_free(policy_data_change_notification->sponsor_connectivity_data); + policy_data_change_notification->sponsor_connectivity_data = NULL; + } + if (policy_data_change_notification->bdt_data) { + OpenAPI_bdt_data_free(policy_data_change_notification->bdt_data); + policy_data_change_notification->bdt_data = NULL; + } + if (policy_data_change_notification->op_spec_data) { + OpenAPI_operator_specific_data_container_free(policy_data_change_notification->op_spec_data); + policy_data_change_notification->op_spec_data = NULL; + } + if (policy_data_change_notification->op_spec_data_map) { + OpenAPI_list_for_each(policy_data_change_notification->op_spec_data_map, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_operator_specific_data_container_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(policy_data_change_notification->op_spec_data_map); + policy_data_change_notification->op_spec_data_map = NULL; + } + if (policy_data_change_notification->ue_id) { + ogs_free(policy_data_change_notification->ue_id); + policy_data_change_notification->ue_id = NULL; + } + if (policy_data_change_notification->sponsor_id) { + ogs_free(policy_data_change_notification->sponsor_id); + policy_data_change_notification->sponsor_id = NULL; + } + if (policy_data_change_notification->bdt_ref_id) { + ogs_free(policy_data_change_notification->bdt_ref_id); + policy_data_change_notification->bdt_ref_id = NULL; + } + if (policy_data_change_notification->usage_mon_id) { + ogs_free(policy_data_change_notification->usage_mon_id); + policy_data_change_notification->usage_mon_id = NULL; + } + if (policy_data_change_notification->plmn_id) { + OpenAPI_plmn_id_1_free(policy_data_change_notification->plmn_id); + policy_data_change_notification->plmn_id = NULL; + } + if (policy_data_change_notification->del_resources) { + OpenAPI_list_for_each(policy_data_change_notification->del_resources, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_data_change_notification->del_resources); + policy_data_change_notification->del_resources = NULL; + } + if (policy_data_change_notification->notif_id) { + ogs_free(policy_data_change_notification->notif_id); + policy_data_change_notification->notif_id = NULL; + } + if (policy_data_change_notification->reported_fragments) { + OpenAPI_list_for_each(policy_data_change_notification->reported_fragments, node) { + OpenAPI_notification_item_free(node->data); + } + OpenAPI_list_free(policy_data_change_notification->reported_fragments); + policy_data_change_notification->reported_fragments = NULL; } - OpenAPI_list_free(policy_data_change_notification->reported_fragments); ogs_free(policy_data_change_notification); } cJSON *OpenAPI_policy_data_change_notification_convertToJSON(OpenAPI_policy_data_change_notification_t *policy_data_change_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (policy_data_change_notification == NULL) { ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [PolicyDataChangeNotification]"); @@ -207,21 +260,20 @@ cJSON *OpenAPI_policy_data_change_notification_convertToJSON(OpenAPI_policy_data goto end; } cJSON *localMapObject = op_spec_data_map; - OpenAPI_lnode_t *op_spec_data_map_node; if (policy_data_change_notification->op_spec_data_map) { - OpenAPI_list_for_each(policy_data_change_notification->op_spec_data_map, op_spec_data_map_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)op_spec_data_map_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_operator_specific_data_container_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(policy_data_change_notification->op_spec_data_map, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_operator_specific_data_container_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (policy_data_change_notification->ue_id) { if (cJSON_AddStringToObject(item, "ueId", policy_data_change_notification->ue_id) == NULL) { @@ -265,19 +317,17 @@ cJSON *OpenAPI_policy_data_change_notification_convertToJSON(OpenAPI_policy_data } if (policy_data_change_notification->del_resources) { - cJSON *del_resources = cJSON_AddArrayToObject(item, "delResources"); - if (del_resources == NULL) { + cJSON *del_resourcesList = cJSON_AddArrayToObject(item, "delResources"); + if (del_resourcesList == NULL) { ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [del_resources]"); goto end; } - - OpenAPI_lnode_t *del_resources_node; - OpenAPI_list_for_each(policy_data_change_notification->del_resources, del_resources_node) { - if (cJSON_AddStringToObject(del_resources, "", (char*)del_resources_node->data) == NULL) { - ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [del_resources]"); - goto end; + OpenAPI_list_for_each(policy_data_change_notification->del_resources, node) { + if (cJSON_AddStringToObject(del_resourcesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [del_resources]"); + goto end; + } } - } } if (policy_data_change_notification->notif_id) { @@ -293,17 +343,13 @@ cJSON *OpenAPI_policy_data_change_notification_convertToJSON(OpenAPI_policy_data ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [reported_fragments]"); goto end; } - - OpenAPI_lnode_t *reported_fragments_node; - if (policy_data_change_notification->reported_fragments) { - OpenAPI_list_for_each(policy_data_change_notification->reported_fragments, reported_fragments_node) { - cJSON *itemLocal = OpenAPI_notification_item_convertToJSON(reported_fragments_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [reported_fragments]"); - goto end; - } - cJSON_AddItemToArray(reported_fragmentsList, itemLocal); + OpenAPI_list_for_each(policy_data_change_notification->reported_fragments, node) { + cJSON *itemLocal = OpenAPI_notification_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_data_change_notification_convertToJSON() failed [reported_fragments]"); + goto end; } + cJSON_AddItemToArray(reported_fragmentsList, itemLocal); } } @@ -314,187 +360,191 @@ end: OpenAPI_policy_data_change_notification_t *OpenAPI_policy_data_change_notification_parseFromJSON(cJSON *policy_data_change_notificationJSON) { OpenAPI_policy_data_change_notification_t *policy_data_change_notification_local_var = NULL; - cJSON *am_policy_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "amPolicyData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *am_policy_data = NULL; OpenAPI_am_policy_data_t *am_policy_data_local_nonprim = NULL; + cJSON *ue_policy_set = NULL; + OpenAPI_ue_policy_set_t *ue_policy_set_local_nonprim = NULL; + cJSON *plmn_ue_policy_set = NULL; + OpenAPI_ue_policy_set_t *plmn_ue_policy_set_local_nonprim = NULL; + cJSON *sm_policy_data = NULL; + OpenAPI_sm_policy_data_t *sm_policy_data_local_nonprim = NULL; + cJSON *usage_mon_data = NULL; + OpenAPI_usage_mon_data_t *usage_mon_data_local_nonprim = NULL; + cJSON *sponsor_connectivity_data = NULL; + OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data_local_nonprim = NULL; + cJSON *bdt_data = NULL; + OpenAPI_bdt_data_t *bdt_data_local_nonprim = NULL; + cJSON *op_spec_data = NULL; + OpenAPI_operator_specific_data_container_t *op_spec_data_local_nonprim = NULL; + cJSON *op_spec_data_map = NULL; + OpenAPI_list_t *op_spec_data_mapList = NULL; + cJSON *ue_id = NULL; + cJSON *sponsor_id = NULL; + cJSON *bdt_ref_id = NULL; + cJSON *usage_mon_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + cJSON *del_resources = NULL; + OpenAPI_list_t *del_resourcesList = NULL; + cJSON *notif_id = NULL; + cJSON *reported_fragments = NULL; + OpenAPI_list_t *reported_fragmentsList = NULL; + am_policy_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "amPolicyData"); if (am_policy_data) { am_policy_data_local_nonprim = OpenAPI_am_policy_data_parseFromJSON(am_policy_data); } - cJSON *ue_policy_set = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "uePolicySet"); - - OpenAPI_ue_policy_set_t *ue_policy_set_local_nonprim = NULL; + ue_policy_set = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "uePolicySet"); if (ue_policy_set) { ue_policy_set_local_nonprim = OpenAPI_ue_policy_set_parseFromJSON(ue_policy_set); } - cJSON *plmn_ue_policy_set = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "plmnUePolicySet"); - - OpenAPI_ue_policy_set_t *plmn_ue_policy_set_local_nonprim = NULL; + plmn_ue_policy_set = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "plmnUePolicySet"); if (plmn_ue_policy_set) { plmn_ue_policy_set_local_nonprim = OpenAPI_ue_policy_set_parseFromJSON(plmn_ue_policy_set); } - cJSON *sm_policy_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "smPolicyData"); - - OpenAPI_sm_policy_data_t *sm_policy_data_local_nonprim = NULL; + sm_policy_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "smPolicyData"); if (sm_policy_data) { sm_policy_data_local_nonprim = OpenAPI_sm_policy_data_parseFromJSON(sm_policy_data); } - cJSON *usage_mon_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "usageMonData"); - - OpenAPI_usage_mon_data_t *usage_mon_data_local_nonprim = NULL; + usage_mon_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "usageMonData"); if (usage_mon_data) { usage_mon_data_local_nonprim = OpenAPI_usage_mon_data_parseFromJSON(usage_mon_data); } - cJSON *sponsor_connectivity_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "SponsorConnectivityData"); - - OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data_local_nonprim = NULL; + sponsor_connectivity_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "SponsorConnectivityData"); if (sponsor_connectivity_data) { sponsor_connectivity_data_local_nonprim = OpenAPI_sponsor_connectivity_data_parseFromJSON(sponsor_connectivity_data); } - cJSON *bdt_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "bdtData"); - - OpenAPI_bdt_data_t *bdt_data_local_nonprim = NULL; + bdt_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "bdtData"); if (bdt_data) { bdt_data_local_nonprim = OpenAPI_bdt_data_parseFromJSON(bdt_data); } - cJSON *op_spec_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "opSpecData"); - - OpenAPI_operator_specific_data_container_t *op_spec_data_local_nonprim = NULL; + op_spec_data = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "opSpecData"); if (op_spec_data) { op_spec_data_local_nonprim = OpenAPI_operator_specific_data_container_parseFromJSON(op_spec_data); } - cJSON *op_spec_data_map = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "opSpecDataMap"); - - OpenAPI_list_t *op_spec_data_mapList; + op_spec_data_map = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "opSpecDataMap"); if (op_spec_data_map) { - cJSON *op_spec_data_map_local_map; - if (!cJSON_IsObject(op_spec_data_map)) { - ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [op_spec_data_map]"); - goto end; - } - op_spec_data_mapList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(op_spec_data_map_local_map, op_spec_data_map) { - cJSON *localMapObject = op_spec_data_map_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_operator_specific_data_container_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [inner]"); + cJSON *op_spec_data_map_local_map = NULL; + if (!cJSON_IsObject(op_spec_data_map) && !cJSON_IsNull(op_spec_data_map)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [op_spec_data_map]"); goto end; } - OpenAPI_list_add(op_spec_data_mapList, localMapKeyPair); - } + if (cJSON_IsObject(op_spec_data_map)) { + op_spec_data_mapList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(op_spec_data_map_local_map, op_spec_data_map) { + cJSON *localMapObject = op_spec_data_map_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_operator_specific_data_container_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(op_spec_data_mapList, localMapKeyPair); + } + } } - cJSON *ue_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "ueId"); - + ue_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "ueId"); if (ue_id) { - if (!cJSON_IsString(ue_id)) { + if (!cJSON_IsString(ue_id) && !cJSON_IsNull(ue_id)) { ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [ue_id]"); goto end; } } - cJSON *sponsor_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "sponsorId"); - + sponsor_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "sponsorId"); if (sponsor_id) { - if (!cJSON_IsString(sponsor_id)) { + if (!cJSON_IsString(sponsor_id) && !cJSON_IsNull(sponsor_id)) { ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [sponsor_id]"); goto end; } } - cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "bdtRefId"); - + bdt_ref_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "bdtRefId"); if (bdt_ref_id) { - if (!cJSON_IsString(bdt_ref_id)) { + if (!cJSON_IsString(bdt_ref_id) && !cJSON_IsNull(bdt_ref_id)) { ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [bdt_ref_id]"); goto end; } } - cJSON *usage_mon_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "usageMonId"); - + usage_mon_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "usageMonId"); if (usage_mon_id) { - if (!cJSON_IsString(usage_mon_id)) { + if (!cJSON_IsString(usage_mon_id) && !cJSON_IsNull(usage_mon_id)) { ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [usage_mon_id]"); goto end; } } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "plmnId"); - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); } - cJSON *del_resources = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "delResources"); - - OpenAPI_list_t *del_resourcesList; + del_resources = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "delResources"); if (del_resources) { - cJSON *del_resources_local; - if (!cJSON_IsArray(del_resources)) { - ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [del_resources]"); - goto end; - } - del_resourcesList = OpenAPI_list_create(); + cJSON *del_resources_local = NULL; + if (!cJSON_IsArray(del_resources)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [del_resources]"); + goto end; + } - cJSON_ArrayForEach(del_resources_local, del_resources) { - if (!cJSON_IsString(del_resources_local)) { - ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [del_resources]"); - goto end; - } - OpenAPI_list_add(del_resourcesList, ogs_strdup(del_resources_local->valuestring)); - } + del_resourcesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(del_resources_local, del_resources) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(del_resources_local)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [del_resources]"); + goto end; + } + OpenAPI_list_add(del_resourcesList, ogs_strdup(del_resources_local->valuestring)); + } } - cJSON *notif_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "notifId"); - + notif_id = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "notifId"); if (notif_id) { - if (!cJSON_IsString(notif_id)) { + if (!cJSON_IsString(notif_id) && !cJSON_IsNull(notif_id)) { ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [notif_id]"); goto end; } } - cJSON *reported_fragments = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "reportedFragments"); - - OpenAPI_list_t *reported_fragmentsList; + reported_fragments = cJSON_GetObjectItemCaseSensitive(policy_data_change_notificationJSON, "reportedFragments"); if (reported_fragments) { - cJSON *reported_fragments_local_nonprimitive; - if (!cJSON_IsArray(reported_fragments)){ - ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [reported_fragments]"); - goto end; - } - - reported_fragmentsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(reported_fragments_local_nonprimitive, reported_fragments ) { - if (!cJSON_IsObject(reported_fragments_local_nonprimitive)) { + cJSON *reported_fragments_local = NULL; + if (!cJSON_IsArray(reported_fragments)) { ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [reported_fragments]"); goto end; } - OpenAPI_notification_item_t *reported_fragmentsItem = OpenAPI_notification_item_parseFromJSON(reported_fragments_local_nonprimitive); - if (!reported_fragmentsItem) { - ogs_error("No reported_fragmentsItem"); - OpenAPI_list_free(reported_fragmentsList); - goto end; + reported_fragmentsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(reported_fragments_local, reported_fragments) { + if (!cJSON_IsObject(reported_fragments_local)) { + ogs_error("OpenAPI_policy_data_change_notification_parseFromJSON() failed [reported_fragments]"); + goto end; + } + OpenAPI_notification_item_t *reported_fragmentsItem = OpenAPI_notification_item_parseFromJSON(reported_fragments_local); + if (!reported_fragmentsItem) { + ogs_error("No reported_fragmentsItem"); + OpenAPI_list_free(reported_fragmentsList); + goto end; + } + OpenAPI_list_add(reported_fragmentsList, reported_fragmentsItem); } - - OpenAPI_list_add(reported_fragmentsList, reported_fragmentsItem); - } } policy_data_change_notification_local_var = OpenAPI_policy_data_change_notification_create ( @@ -507,18 +557,78 @@ OpenAPI_policy_data_change_notification_t *OpenAPI_policy_data_change_notificati bdt_data ? bdt_data_local_nonprim : NULL, op_spec_data ? op_spec_data_local_nonprim : NULL, op_spec_data_map ? op_spec_data_mapList : NULL, - ue_id ? ogs_strdup(ue_id->valuestring) : NULL, - sponsor_id ? ogs_strdup(sponsor_id->valuestring) : NULL, - bdt_ref_id ? ogs_strdup(bdt_ref_id->valuestring) : NULL, - usage_mon_id ? ogs_strdup(usage_mon_id->valuestring) : NULL, + ue_id && !cJSON_IsNull(ue_id) ? ogs_strdup(ue_id->valuestring) : NULL, + sponsor_id && !cJSON_IsNull(sponsor_id) ? ogs_strdup(sponsor_id->valuestring) : NULL, + bdt_ref_id && !cJSON_IsNull(bdt_ref_id) ? ogs_strdup(bdt_ref_id->valuestring) : NULL, + usage_mon_id && !cJSON_IsNull(usage_mon_id) ? ogs_strdup(usage_mon_id->valuestring) : NULL, plmn_id ? plmn_id_local_nonprim : NULL, del_resources ? del_resourcesList : NULL, - notif_id ? ogs_strdup(notif_id->valuestring) : NULL, + notif_id && !cJSON_IsNull(notif_id) ? ogs_strdup(notif_id->valuestring) : NULL, reported_fragments ? reported_fragmentsList : NULL ); return policy_data_change_notification_local_var; end: + if (am_policy_data_local_nonprim) { + OpenAPI_am_policy_data_free(am_policy_data_local_nonprim); + am_policy_data_local_nonprim = NULL; + } + if (ue_policy_set_local_nonprim) { + OpenAPI_ue_policy_set_free(ue_policy_set_local_nonprim); + ue_policy_set_local_nonprim = NULL; + } + if (plmn_ue_policy_set_local_nonprim) { + OpenAPI_ue_policy_set_free(plmn_ue_policy_set_local_nonprim); + plmn_ue_policy_set_local_nonprim = NULL; + } + if (sm_policy_data_local_nonprim) { + OpenAPI_sm_policy_data_free(sm_policy_data_local_nonprim); + sm_policy_data_local_nonprim = NULL; + } + if (usage_mon_data_local_nonprim) { + OpenAPI_usage_mon_data_free(usage_mon_data_local_nonprim); + usage_mon_data_local_nonprim = NULL; + } + if (sponsor_connectivity_data_local_nonprim) { + OpenAPI_sponsor_connectivity_data_free(sponsor_connectivity_data_local_nonprim); + sponsor_connectivity_data_local_nonprim = NULL; + } + if (bdt_data_local_nonprim) { + OpenAPI_bdt_data_free(bdt_data_local_nonprim); + bdt_data_local_nonprim = NULL; + } + if (op_spec_data_local_nonprim) { + OpenAPI_operator_specific_data_container_free(op_spec_data_local_nonprim); + op_spec_data_local_nonprim = NULL; + } + if (op_spec_data_mapList) { + OpenAPI_list_for_each(op_spec_data_mapList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_operator_specific_data_container_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(op_spec_data_mapList); + op_spec_data_mapList = NULL; + } + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (del_resourcesList) { + OpenAPI_list_for_each(del_resourcesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(del_resourcesList); + del_resourcesList = NULL; + } + if (reported_fragmentsList) { + OpenAPI_list_for_each(reported_fragmentsList, node) { + OpenAPI_notification_item_free(node->data); + } + OpenAPI_list_free(reported_fragmentsList); + reported_fragmentsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/policy_data_subscription.c b/lib/sbi/openapi/model/policy_data_subscription.c index 09b6b0044..5675c9c91 100644 --- a/lib/sbi/openapi/model/policy_data_subscription.c +++ b/lib/sbi/openapi/model/policy_data_subscription.c @@ -28,28 +28,48 @@ OpenAPI_policy_data_subscription_t *OpenAPI_policy_data_subscription_create( void OpenAPI_policy_data_subscription_free(OpenAPI_policy_data_subscription_t *policy_data_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == policy_data_subscription) { return; } - OpenAPI_lnode_t *node; - ogs_free(policy_data_subscription->notification_uri); - ogs_free(policy_data_subscription->notif_id); - OpenAPI_list_for_each(policy_data_subscription->monitored_resource_uris, node) { - ogs_free(node->data); + if (policy_data_subscription->notification_uri) { + ogs_free(policy_data_subscription->notification_uri); + policy_data_subscription->notification_uri = NULL; } - OpenAPI_list_free(policy_data_subscription->monitored_resource_uris); - OpenAPI_list_for_each(policy_data_subscription->mon_res_items, node) { - OpenAPI_resource_item_free(node->data); + if (policy_data_subscription->notif_id) { + ogs_free(policy_data_subscription->notif_id); + policy_data_subscription->notif_id = NULL; + } + if (policy_data_subscription->monitored_resource_uris) { + OpenAPI_list_for_each(policy_data_subscription->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(policy_data_subscription->monitored_resource_uris); + policy_data_subscription->monitored_resource_uris = NULL; + } + if (policy_data_subscription->mon_res_items) { + OpenAPI_list_for_each(policy_data_subscription->mon_res_items, node) { + OpenAPI_resource_item_free(node->data); + } + OpenAPI_list_free(policy_data_subscription->mon_res_items); + policy_data_subscription->mon_res_items = NULL; + } + if (policy_data_subscription->expiry) { + ogs_free(policy_data_subscription->expiry); + policy_data_subscription->expiry = NULL; + } + if (policy_data_subscription->supported_features) { + ogs_free(policy_data_subscription->supported_features); + policy_data_subscription->supported_features = NULL; } - OpenAPI_list_free(policy_data_subscription->mon_res_items); - ogs_free(policy_data_subscription->expiry); - ogs_free(policy_data_subscription->supported_features); ogs_free(policy_data_subscription); } cJSON *OpenAPI_policy_data_subscription_convertToJSON(OpenAPI_policy_data_subscription_t *policy_data_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (policy_data_subscription == NULL) { ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [PolicyDataSubscription]"); @@ -57,6 +77,10 @@ cJSON *OpenAPI_policy_data_subscription_convertToJSON(OpenAPI_policy_data_subscr } item = cJSON_CreateObject(); + if (!policy_data_subscription->notification_uri) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [notification_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationUri", policy_data_subscription->notification_uri) == NULL) { ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [notification_uri]"); goto end; @@ -69,19 +93,21 @@ cJSON *OpenAPI_policy_data_subscription_convertToJSON(OpenAPI_policy_data_subscr } } - cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); - if (monitored_resource_uris == NULL) { + if (!policy_data_subscription->monitored_resource_uris) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + return NULL; + } + cJSON *monitored_resource_urisList = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_urisList == NULL) { ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [monitored_resource_uris]"); goto end; } - - OpenAPI_lnode_t *monitored_resource_uris_node; - OpenAPI_list_for_each(policy_data_subscription->monitored_resource_uris, monitored_resource_uris_node) { - if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { - ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [monitored_resource_uris]"); - goto end; + OpenAPI_list_for_each(policy_data_subscription->monitored_resource_uris, node) { + if (cJSON_AddStringToObject(monitored_resource_urisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } } - } if (policy_data_subscription->mon_res_items) { cJSON *mon_res_itemsList = cJSON_AddArrayToObject(item, "monResItems"); @@ -89,17 +115,13 @@ cJSON *OpenAPI_policy_data_subscription_convertToJSON(OpenAPI_policy_data_subscr ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [mon_res_items]"); goto end; } - - OpenAPI_lnode_t *mon_res_items_node; - if (policy_data_subscription->mon_res_items) { - OpenAPI_list_for_each(policy_data_subscription->mon_res_items, mon_res_items_node) { - cJSON *itemLocal = OpenAPI_resource_item_convertToJSON(mon_res_items_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [mon_res_items]"); - goto end; - } - cJSON_AddItemToArray(mon_res_itemsList, itemLocal); + OpenAPI_list_for_each(policy_data_subscription->mon_res_items, node) { + cJSON *itemLocal = OpenAPI_resource_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_data_subscription_convertToJSON() failed [mon_res_items]"); + goto end; } + cJSON_AddItemToArray(mon_res_itemsList, itemLocal); } } @@ -124,90 +146,92 @@ end: OpenAPI_policy_data_subscription_t *OpenAPI_policy_data_subscription_parseFromJSON(cJSON *policy_data_subscriptionJSON) { OpenAPI_policy_data_subscription_t *policy_data_subscription_local_var = NULL; - cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "notificationUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *notification_uri = NULL; + cJSON *notif_id = NULL; + cJSON *monitored_resource_uris = NULL; + OpenAPI_list_t *monitored_resource_urisList = NULL; + cJSON *mon_res_items = NULL; + OpenAPI_list_t *mon_res_itemsList = NULL; + cJSON *expiry = NULL; + cJSON *supported_features = NULL; + notification_uri = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "notificationUri"); if (!notification_uri) { ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [notification_uri]"); goto end; } - if (!cJSON_IsString(notification_uri)) { ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [notification_uri]"); goto end; } - cJSON *notif_id = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "notifId"); - + notif_id = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "notifId"); if (notif_id) { - if (!cJSON_IsString(notif_id)) { + if (!cJSON_IsString(notif_id) && !cJSON_IsNull(notif_id)) { ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [notif_id]"); goto end; } } - cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "monitoredResourceUris"); + monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "monitoredResourceUris"); if (!monitored_resource_uris) { ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); goto end; } + cJSON *monitored_resource_uris_local = NULL; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } - OpenAPI_list_t *monitored_resource_urisList; - cJSON *monitored_resource_uris_local; - if (!cJSON_IsArray(monitored_resource_uris)) { - ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - monitored_resource_urisList = OpenAPI_list_create(); + monitored_resource_urisList = OpenAPI_list_create(); - cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { - if (!cJSON_IsString(monitored_resource_uris_local)) { - ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); - } + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } - cJSON *mon_res_items = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "monResItems"); - - OpenAPI_list_t *mon_res_itemsList; + mon_res_items = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "monResItems"); if (mon_res_items) { - cJSON *mon_res_items_local_nonprimitive; - if (!cJSON_IsArray(mon_res_items)){ - ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [mon_res_items]"); - goto end; - } - - mon_res_itemsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mon_res_items_local_nonprimitive, mon_res_items ) { - if (!cJSON_IsObject(mon_res_items_local_nonprimitive)) { + cJSON *mon_res_items_local = NULL; + if (!cJSON_IsArray(mon_res_items)) { ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [mon_res_items]"); goto end; } - OpenAPI_resource_item_t *mon_res_itemsItem = OpenAPI_resource_item_parseFromJSON(mon_res_items_local_nonprimitive); - if (!mon_res_itemsItem) { - ogs_error("No mon_res_itemsItem"); - OpenAPI_list_free(mon_res_itemsList); - goto end; + mon_res_itemsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mon_res_items_local, mon_res_items) { + if (!cJSON_IsObject(mon_res_items_local)) { + ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [mon_res_items]"); + goto end; + } + OpenAPI_resource_item_t *mon_res_itemsItem = OpenAPI_resource_item_parseFromJSON(mon_res_items_local); + if (!mon_res_itemsItem) { + ogs_error("No mon_res_itemsItem"); + OpenAPI_list_free(mon_res_itemsList); + goto end; + } + OpenAPI_list_add(mon_res_itemsList, mon_res_itemsItem); } - - OpenAPI_list_add(mon_res_itemsList, mon_res_itemsItem); - } } - cJSON *expiry = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "expiry"); - + expiry = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "expiry"); if (expiry) { - if (!cJSON_IsString(expiry)) { + if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) { ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [expiry]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(policy_data_subscriptionJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_policy_data_subscription_parseFromJSON() failed [supported_features]"); goto end; } @@ -215,15 +239,29 @@ OpenAPI_policy_data_subscription_t *OpenAPI_policy_data_subscription_parseFromJS policy_data_subscription_local_var = OpenAPI_policy_data_subscription_create ( ogs_strdup(notification_uri->valuestring), - notif_id ? ogs_strdup(notif_id->valuestring) : NULL, + notif_id && !cJSON_IsNull(notif_id) ? ogs_strdup(notif_id->valuestring) : NULL, monitored_resource_urisList, mon_res_items ? mon_res_itemsList : NULL, - expiry ? ogs_strdup(expiry->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return policy_data_subscription_local_var; end: + if (monitored_resource_urisList) { + OpenAPI_list_for_each(monitored_resource_urisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monitored_resource_urisList); + monitored_resource_urisList = NULL; + } + if (mon_res_itemsList) { + OpenAPI_list_for_each(mon_res_itemsList, node) { + OpenAPI_resource_item_free(node->data); + } + OpenAPI_list_free(mon_res_itemsList); + mon_res_itemsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/policy_update.c b/lib/sbi/openapi/model/policy_update.c index da176db6a..7fd5eae34 100644 --- a/lib/sbi/openapi/model/policy_update.c +++ b/lib/sbi/openapi/model/policy_update.c @@ -34,29 +34,52 @@ OpenAPI_policy_update_t *OpenAPI_policy_update_create( void OpenAPI_policy_update_free(OpenAPI_policy_update_t *policy_update) { + OpenAPI_lnode_t *node = NULL; + if (NULL == policy_update) { return; } - OpenAPI_lnode_t *node; - ogs_free(policy_update->resource_uri); - OpenAPI_list_free(policy_update->triggers); - OpenAPI_service_area_restriction_free(policy_update->serv_area_res); - OpenAPI_wireline_service_area_restriction_free(policy_update->wl_serv_area_res); - OpenAPI_smf_selection_data_free(policy_update->smf_sel_info); - OpenAPI_ambr_free(policy_update->ue_ambr); - OpenAPI_list_for_each(policy_update->pras, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_rm_free(localKeyValue->value); - ogs_free(localKeyValue); + if (policy_update->resource_uri) { + ogs_free(policy_update->resource_uri); + policy_update->resource_uri = NULL; + } + if (policy_update->triggers) { + OpenAPI_list_free(policy_update->triggers); + policy_update->triggers = NULL; + } + if (policy_update->serv_area_res) { + OpenAPI_service_area_restriction_free(policy_update->serv_area_res); + policy_update->serv_area_res = NULL; + } + if (policy_update->wl_serv_area_res) { + OpenAPI_wireline_service_area_restriction_free(policy_update->wl_serv_area_res); + policy_update->wl_serv_area_res = NULL; + } + if (policy_update->smf_sel_info) { + OpenAPI_smf_selection_data_free(policy_update->smf_sel_info); + policy_update->smf_sel_info = NULL; + } + if (policy_update->ue_ambr) { + OpenAPI_ambr_free(policy_update->ue_ambr); + policy_update->ue_ambr = NULL; + } + if (policy_update->pras) { + OpenAPI_list_for_each(policy_update->pras, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_rm_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(policy_update->pras); + policy_update->pras = NULL; } - OpenAPI_list_free(policy_update->pras); ogs_free(policy_update); } cJSON *OpenAPI_policy_update_convertToJSON(OpenAPI_policy_update_t *policy_update) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (policy_update == NULL) { ogs_error("OpenAPI_policy_update_convertToJSON() failed [PolicyUpdate]"); @@ -64,20 +87,23 @@ cJSON *OpenAPI_policy_update_convertToJSON(OpenAPI_policy_update_t *policy_updat } item = cJSON_CreateObject(); + if (!policy_update->resource_uri) { + ogs_error("OpenAPI_policy_update_convertToJSON() failed [resource_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resourceUri", policy_update->resource_uri) == NULL) { ogs_error("OpenAPI_policy_update_convertToJSON() failed [resource_uri]"); goto end; } - if (policy_update->triggers) { - cJSON *triggers = cJSON_AddArrayToObject(item, "triggers"); - if (triggers == NULL) { + if (policy_update->triggers != OpenAPI_request_trigger_NULL) { + cJSON *triggersList = cJSON_AddArrayToObject(item, "triggers"); + if (triggersList == NULL) { ogs_error("OpenAPI_policy_update_convertToJSON() failed [triggers]"); goto end; } - OpenAPI_lnode_t *triggers_node; - OpenAPI_list_for_each(policy_update->triggers, triggers_node) { - if (cJSON_AddStringToObject(triggers, "", OpenAPI_request_trigger_ToString((intptr_t)triggers_node->data)) == NULL) { + OpenAPI_list_for_each(policy_update->triggers, node) { + if (cJSON_AddStringToObject(triggersList, "", OpenAPI_request_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_policy_update_convertToJSON() failed [triggers]"); goto end; } @@ -150,21 +176,20 @@ cJSON *OpenAPI_policy_update_convertToJSON(OpenAPI_policy_update_t *policy_updat goto end; } cJSON *localMapObject = pras; - OpenAPI_lnode_t *pras_node; if (policy_update->pras) { - OpenAPI_list_for_each(policy_update->pras, pras_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pras_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_rm_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_policy_update_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(policy_update->pras, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_rm_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_policy_update_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -173,55 +198,61 @@ end: OpenAPI_policy_update_t *OpenAPI_policy_update_parseFromJSON(cJSON *policy_updateJSON) { OpenAPI_policy_update_t *policy_update_local_var = NULL; - cJSON *resource_uri = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "resourceUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *resource_uri = NULL; + cJSON *triggers = NULL; + OpenAPI_list_t *triggersList = NULL; + cJSON *serv_area_res = NULL; + OpenAPI_service_area_restriction_t *serv_area_res_local_nonprim = NULL; + cJSON *wl_serv_area_res = NULL; + OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL; + cJSON *rfsp = NULL; + cJSON *smf_sel_info = NULL; + OpenAPI_smf_selection_data_t *smf_sel_info_local_nonprim = NULL; + cJSON *ue_ambr = NULL; + OpenAPI_ambr_t *ue_ambr_local_nonprim = NULL; + cJSON *pras = NULL; + OpenAPI_list_t *prasList = NULL; + resource_uri = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "resourceUri"); if (!resource_uri) { ogs_error("OpenAPI_policy_update_parseFromJSON() failed [resource_uri]"); goto end; } - if (!cJSON_IsString(resource_uri)) { ogs_error("OpenAPI_policy_update_parseFromJSON() failed [resource_uri]"); goto end; } - cJSON *triggers = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "triggers"); - - OpenAPI_list_t *triggersList; + triggers = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "triggers"); if (triggers) { - cJSON *triggers_local_nonprimitive; - if (!cJSON_IsArray(triggers)) { - ogs_error("OpenAPI_policy_update_parseFromJSON() failed [triggers]"); - goto end; - } - - triggersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(triggers_local_nonprimitive, triggers ) { - if (!cJSON_IsString(triggers_local_nonprimitive)){ + cJSON *triggers_local = NULL; + if (!cJSON_IsArray(triggers)) { ogs_error("OpenAPI_policy_update_parseFromJSON() failed [triggers]"); goto end; } - OpenAPI_list_add(triggersList, (void *)OpenAPI_request_trigger_FromString(triggers_local_nonprimitive->valuestring)); - } + triggersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(triggers_local, triggers) { + if (!cJSON_IsString(triggers_local)) { + ogs_error("OpenAPI_policy_update_parseFromJSON() failed [triggers]"); + goto end; + } + OpenAPI_list_add(triggersList, (void *)OpenAPI_request_trigger_FromString(triggers_local->valuestring)); + } } - cJSON *serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "servAreaRes"); - - OpenAPI_service_area_restriction_t *serv_area_res_local_nonprim = NULL; + serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "servAreaRes"); if (serv_area_res) { serv_area_res_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(serv_area_res); } - cJSON *wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "wlServAreaRes"); - - OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL; + wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "wlServAreaRes"); if (wl_serv_area_res) { wl_serv_area_res_local_nonprim = OpenAPI_wireline_service_area_restriction_parseFromJSON(wl_serv_area_res); } - cJSON *rfsp = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "rfsp"); - + rfsp = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "rfsp"); if (rfsp) { if (!cJSON_IsNumber(rfsp)) { ogs_error("OpenAPI_policy_update_parseFromJSON() failed [rfsp]"); @@ -229,44 +260,40 @@ OpenAPI_policy_update_t *OpenAPI_policy_update_parseFromJSON(cJSON *policy_updat } } - cJSON *smf_sel_info = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "smfSelInfo"); - - OpenAPI_smf_selection_data_t *smf_sel_info_local_nonprim = NULL; + smf_sel_info = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "smfSelInfo"); if (smf_sel_info) { smf_sel_info_local_nonprim = OpenAPI_smf_selection_data_parseFromJSON(smf_sel_info); } - cJSON *ue_ambr = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "ueAmbr"); - - OpenAPI_ambr_t *ue_ambr_local_nonprim = NULL; + ue_ambr = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "ueAmbr"); if (ue_ambr) { ue_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(ue_ambr); } - cJSON *pras = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "pras"); - - OpenAPI_list_t *prasList; + pras = cJSON_GetObjectItemCaseSensitive(policy_updateJSON, "pras"); if (pras) { - cJSON *pras_local_map; - if (!cJSON_IsObject(pras)) { - ogs_error("OpenAPI_policy_update_parseFromJSON() failed [pras]"); - goto end; - } - prasList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pras_local_map, pras) { - cJSON *localMapObject = pras_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_rm_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_policy_update_parseFromJSON() failed [inner]"); + cJSON *pras_local_map = NULL; + if (!cJSON_IsObject(pras) && !cJSON_IsNull(pras)) { + ogs_error("OpenAPI_policy_update_parseFromJSON() failed [pras]"); goto end; } - OpenAPI_list_add(prasList, localMapKeyPair); - } + if (cJSON_IsObject(pras)) { + prasList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pras_local_map, pras) { + cJSON *localMapObject = pras_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_rm_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_policy_update_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(prasList, localMapKeyPair); + } + } } policy_update_local_var = OpenAPI_policy_update_create ( @@ -283,6 +310,36 @@ OpenAPI_policy_update_t *OpenAPI_policy_update_parseFromJSON(cJSON *policy_updat return policy_update_local_var; end: + if (triggersList) { + OpenAPI_list_free(triggersList); + triggersList = NULL; + } + if (serv_area_res_local_nonprim) { + OpenAPI_service_area_restriction_free(serv_area_res_local_nonprim); + serv_area_res_local_nonprim = NULL; + } + if (wl_serv_area_res_local_nonprim) { + OpenAPI_wireline_service_area_restriction_free(wl_serv_area_res_local_nonprim); + wl_serv_area_res_local_nonprim = NULL; + } + if (smf_sel_info_local_nonprim) { + OpenAPI_smf_selection_data_free(smf_sel_info_local_nonprim); + smf_sel_info_local_nonprim = NULL; + } + if (ue_ambr_local_nonprim) { + OpenAPI_ambr_free(ue_ambr_local_nonprim); + ue_ambr_local_nonprim = NULL; + } + if (prasList) { + OpenAPI_list_for_each(prasList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_rm_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(prasList); + prasList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/polygon.c b/lib/sbi/openapi/model/polygon.c index 65bd9ac0b..42001032f 100644 --- a/lib/sbi/openapi/model/polygon.c +++ b/lib/sbi/openapi/model/polygon.c @@ -20,21 +20,29 @@ OpenAPI_polygon_t *OpenAPI_polygon_create( void OpenAPI_polygon_free(OpenAPI_polygon_t *polygon) { + OpenAPI_lnode_t *node = NULL; + if (NULL == polygon) { return; } - OpenAPI_lnode_t *node; - OpenAPI_supported_gad_shapes_free(polygon->shape); - OpenAPI_list_for_each(polygon->point_list, node) { - OpenAPI_geographical_coordinates_free(node->data); + if (polygon->shape) { + OpenAPI_supported_gad_shapes_free(polygon->shape); + polygon->shape = NULL; + } + if (polygon->point_list) { + OpenAPI_list_for_each(polygon->point_list, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(polygon->point_list); + polygon->point_list = NULL; } - OpenAPI_list_free(polygon->point_list); ogs_free(polygon); } cJSON *OpenAPI_polygon_convertToJSON(OpenAPI_polygon_t *polygon) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (polygon == NULL) { ogs_error("OpenAPI_polygon_convertToJSON() failed [Polygon]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_polygon_convertToJSON(OpenAPI_polygon_t *polygon) } item = cJSON_CreateObject(); + if (!polygon->shape) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [shape]"); + return NULL; + } cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(polygon->shape); if (shape_local_JSON == NULL) { ogs_error("OpenAPI_polygon_convertToJSON() failed [shape]"); @@ -53,22 +65,22 @@ cJSON *OpenAPI_polygon_convertToJSON(OpenAPI_polygon_t *polygon) goto end; } + if (!polygon->point_list) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [point_list]"); + return NULL; + } cJSON *point_listList = cJSON_AddArrayToObject(item, "pointList"); if (point_listList == NULL) { ogs_error("OpenAPI_polygon_convertToJSON() failed [point_list]"); goto end; } - - OpenAPI_lnode_t *point_list_node; - if (polygon->point_list) { - OpenAPI_list_for_each(polygon->point_list, point_list_node) { - cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(point_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_polygon_convertToJSON() failed [point_list]"); - goto end; - } - cJSON_AddItemToArray(point_listList, itemLocal); + OpenAPI_list_for_each(polygon->point_list, node) { + cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_polygon_convertToJSON() failed [point_list]"); + goto end; } + cJSON_AddItemToArray(point_listList, itemLocal); } end: @@ -78,46 +90,45 @@ end: OpenAPI_polygon_t *OpenAPI_polygon_parseFromJSON(cJSON *polygonJSON) { OpenAPI_polygon_t *polygon_local_var = NULL; - cJSON *shape = cJSON_GetObjectItemCaseSensitive(polygonJSON, "shape"); + OpenAPI_lnode_t *node = NULL; + cJSON *shape = NULL; + OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; + cJSON *point_list = NULL; + OpenAPI_list_t *point_listList = NULL; + shape = cJSON_GetObjectItemCaseSensitive(polygonJSON, "shape"); if (!shape) { ogs_error("OpenAPI_polygon_parseFromJSON() failed [shape]"); goto end; } - - OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL; shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape); - cJSON *point_list = cJSON_GetObjectItemCaseSensitive(polygonJSON, "pointList"); + point_list = cJSON_GetObjectItemCaseSensitive(polygonJSON, "pointList"); if (!point_list) { ogs_error("OpenAPI_polygon_parseFromJSON() failed [point_list]"); goto end; } - - OpenAPI_list_t *point_listList; - cJSON *point_list_local_nonprimitive; - if (!cJSON_IsArray(point_list)){ - ogs_error("OpenAPI_polygon_parseFromJSON() failed [point_list]"); - goto end; - } - - point_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(point_list_local_nonprimitive, point_list ) { - if (!cJSON_IsObject(point_list_local_nonprimitive)) { + cJSON *point_list_local = NULL; + if (!cJSON_IsArray(point_list)) { ogs_error("OpenAPI_polygon_parseFromJSON() failed [point_list]"); goto end; } - OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local_nonprimitive); - if (!point_listItem) { - ogs_error("No point_listItem"); - OpenAPI_list_free(point_listList); - goto end; + point_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(point_list_local, point_list) { + if (!cJSON_IsObject(point_list_local)) { + ogs_error("OpenAPI_polygon_parseFromJSON() failed [point_list]"); + goto end; + } + OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local); + if (!point_listItem) { + ogs_error("No point_listItem"); + OpenAPI_list_free(point_listList); + goto end; + } + OpenAPI_list_add(point_listList, point_listItem); } - OpenAPI_list_add(point_listList, point_listItem); - } - polygon_local_var = OpenAPI_polygon_create ( shape_local_nonprim, point_listList @@ -125,6 +136,17 @@ OpenAPI_polygon_t *OpenAPI_polygon_parseFromJSON(cJSON *polygonJSON) return polygon_local_var; end: + if (shape_local_nonprim) { + OpenAPI_supported_gad_shapes_free(shape_local_nonprim); + shape_local_nonprim = NULL; + } + if (point_listList) { + OpenAPI_list_for_each(point_listList, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(point_listList); + point_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/polygon.h b/lib/sbi/openapi/model/polygon.h index 34f8d698b..56faca4a6 100644 --- a/lib/sbi/openapi/model/polygon.h +++ b/lib/sbi/openapi/model/polygon.h @@ -14,7 +14,6 @@ #include "../include/binary.h" #include "gad_shape.h" #include "geographical_coordinates.h" -#include "polygon_all_of.h" #include "supported_gad_shapes.h" #ifdef __cplusplus diff --git a/lib/sbi/openapi/model/polygon_all_of.c b/lib/sbi/openapi/model/polygon_all_of.c index 15f46d391..44994b481 100644 --- a/lib/sbi/openapi/model/polygon_all_of.c +++ b/lib/sbi/openapi/model/polygon_all_of.c @@ -18,20 +18,25 @@ OpenAPI_polygon_all_of_t *OpenAPI_polygon_all_of_create( void OpenAPI_polygon_all_of_free(OpenAPI_polygon_all_of_t *polygon_all_of) { + OpenAPI_lnode_t *node = NULL; + if (NULL == polygon_all_of) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(polygon_all_of->point_list, node) { - OpenAPI_geographical_coordinates_free(node->data); + if (polygon_all_of->point_list) { + OpenAPI_list_for_each(polygon_all_of->point_list, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(polygon_all_of->point_list); + polygon_all_of->point_list = NULL; } - OpenAPI_list_free(polygon_all_of->point_list); ogs_free(polygon_all_of); } cJSON *OpenAPI_polygon_all_of_convertToJSON(OpenAPI_polygon_all_of_t *polygon_all_of) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (polygon_all_of == NULL) { ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [Polygon_allOf]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_polygon_all_of_convertToJSON(OpenAPI_polygon_all_of_t *polygon_al } item = cJSON_CreateObject(); + if (!polygon_all_of->point_list) { + ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [point_list]"); + return NULL; + } cJSON *point_listList = cJSON_AddArrayToObject(item, "pointList"); if (point_listList == NULL) { ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [point_list]"); goto end; } - - OpenAPI_lnode_t *point_list_node; - if (polygon_all_of->point_list) { - OpenAPI_list_for_each(polygon_all_of->point_list, point_list_node) { - cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(point_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [point_list]"); - goto end; - } - cJSON_AddItemToArray(point_listList, itemLocal); + OpenAPI_list_for_each(polygon_all_of->point_list, node) { + cJSON *itemLocal = OpenAPI_geographical_coordinates_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_polygon_all_of_convertToJSON() failed [point_list]"); + goto end; } + cJSON_AddItemToArray(point_listList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_polygon_all_of_t *OpenAPI_polygon_all_of_parseFromJSON(cJSON *polygon_all_ofJSON) { OpenAPI_polygon_all_of_t *polygon_all_of_local_var = NULL; - cJSON *point_list = cJSON_GetObjectItemCaseSensitive(polygon_all_ofJSON, "pointList"); + OpenAPI_lnode_t *node = NULL; + cJSON *point_list = NULL; + OpenAPI_list_t *point_listList = NULL; + point_list = cJSON_GetObjectItemCaseSensitive(polygon_all_ofJSON, "pointList"); if (!point_list) { ogs_error("OpenAPI_polygon_all_of_parseFromJSON() failed [point_list]"); goto end; } - - OpenAPI_list_t *point_listList; - cJSON *point_list_local_nonprimitive; - if (!cJSON_IsArray(point_list)){ - ogs_error("OpenAPI_polygon_all_of_parseFromJSON() failed [point_list]"); - goto end; - } - - point_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(point_list_local_nonprimitive, point_list ) { - if (!cJSON_IsObject(point_list_local_nonprimitive)) { + cJSON *point_list_local = NULL; + if (!cJSON_IsArray(point_list)) { ogs_error("OpenAPI_polygon_all_of_parseFromJSON() failed [point_list]"); goto end; } - OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local_nonprimitive); - if (!point_listItem) { - ogs_error("No point_listItem"); - OpenAPI_list_free(point_listList); - goto end; + point_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(point_list_local, point_list) { + if (!cJSON_IsObject(point_list_local)) { + ogs_error("OpenAPI_polygon_all_of_parseFromJSON() failed [point_list]"); + goto end; + } + OpenAPI_geographical_coordinates_t *point_listItem = OpenAPI_geographical_coordinates_parseFromJSON(point_list_local); + if (!point_listItem) { + ogs_error("No point_listItem"); + OpenAPI_list_free(point_listList); + goto end; + } + OpenAPI_list_add(point_listList, point_listItem); } - OpenAPI_list_add(point_listList, point_listItem); - } - polygon_all_of_local_var = OpenAPI_polygon_all_of_create ( point_listList ); return polygon_all_of_local_var; end: + if (point_listList) { + OpenAPI_list_for_each(point_listList, node) { + OpenAPI_geographical_coordinates_free(node->data); + } + OpenAPI_list_free(point_listList); + point_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/port_management_container.c b/lib/sbi/openapi/model/port_management_container.c index 6cdc85135..3a110363e 100644 --- a/lib/sbi/openapi/model/port_management_container.c +++ b/lib/sbi/openapi/model/port_management_container.c @@ -5,7 +5,7 @@ #include "port_management_container.h" OpenAPI_port_management_container_t *OpenAPI_port_management_container_create( - char port_man_cont, + char *port_man_cont, int port_num ) { @@ -20,16 +20,22 @@ OpenAPI_port_management_container_t *OpenAPI_port_management_container_create( void OpenAPI_port_management_container_free(OpenAPI_port_management_container_t *port_management_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == port_management_container) { return; } - OpenAPI_lnode_t *node; + if (port_management_container->port_man_cont) { + ogs_free(port_management_container->port_man_cont); + port_management_container->port_man_cont = NULL; + } ogs_free(port_management_container); } cJSON *OpenAPI_port_management_container_convertToJSON(OpenAPI_port_management_container_t *port_management_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (port_management_container == NULL) { ogs_error("OpenAPI_port_management_container_convertToJSON() failed [PortManagementContainer]"); @@ -37,7 +43,11 @@ cJSON *OpenAPI_port_management_container_convertToJSON(OpenAPI_port_management_c } item = cJSON_CreateObject(); - if (cJSON_AddNumberToObject(item, "portManCont", port_management_container->port_man_cont) == NULL) { + if (!port_management_container->port_man_cont) { + ogs_error("OpenAPI_port_management_container_convertToJSON() failed [port_man_cont]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "portManCont", port_management_container->port_man_cont) == NULL) { ogs_error("OpenAPI_port_management_container_convertToJSON() failed [port_man_cont]"); goto end; } @@ -54,30 +64,31 @@ end: OpenAPI_port_management_container_t *OpenAPI_port_management_container_parseFromJSON(cJSON *port_management_containerJSON) { OpenAPI_port_management_container_t *port_management_container_local_var = NULL; - cJSON *port_man_cont = cJSON_GetObjectItemCaseSensitive(port_management_containerJSON, "portManCont"); + OpenAPI_lnode_t *node = NULL; + cJSON *port_man_cont = NULL; + cJSON *port_num = NULL; + port_man_cont = cJSON_GetObjectItemCaseSensitive(port_management_containerJSON, "portManCont"); if (!port_man_cont) { ogs_error("OpenAPI_port_management_container_parseFromJSON() failed [port_man_cont]"); goto end; } - - if (!cJSON_IsNumber(port_man_cont)) { + if (!cJSON_IsString(port_man_cont)) { ogs_error("OpenAPI_port_management_container_parseFromJSON() failed [port_man_cont]"); goto end; } - cJSON *port_num = cJSON_GetObjectItemCaseSensitive(port_management_containerJSON, "portNum"); + port_num = cJSON_GetObjectItemCaseSensitive(port_management_containerJSON, "portNum"); if (!port_num) { ogs_error("OpenAPI_port_management_container_parseFromJSON() failed [port_num]"); goto end; } - if (!cJSON_IsNumber(port_num)) { ogs_error("OpenAPI_port_management_container_parseFromJSON() failed [port_num]"); goto end; } port_management_container_local_var = OpenAPI_port_management_container_create ( - port_man_cont->valueint, + ogs_strdup(port_man_cont->valuestring), port_num->valuedouble ); diff --git a/lib/sbi/openapi/model/port_management_container.h b/lib/sbi/openapi/model/port_management_container.h index 59fc37c8c..d561ff3b2 100644 --- a/lib/sbi/openapi/model/port_management_container.h +++ b/lib/sbi/openapi/model/port_management_container.h @@ -19,12 +19,12 @@ extern "C" { typedef struct OpenAPI_port_management_container_s OpenAPI_port_management_container_t; typedef struct OpenAPI_port_management_container_s { - char port_man_cont; + char *port_man_cont; int port_num; } OpenAPI_port_management_container_t; OpenAPI_port_management_container_t *OpenAPI_port_management_container_create( - char port_man_cont, + char *port_man_cont, int port_num ); void OpenAPI_port_management_container_free(OpenAPI_port_management_container_t *port_management_container); diff --git a/lib/sbi/openapi/model/pp5g_vn_group_profile_data.c b/lib/sbi/openapi/model/pp5g_vn_group_profile_data.c index 1cdf38b93..8044f500d 100644 --- a/lib/sbi/openapi/model/pp5g_vn_group_profile_data.c +++ b/lib/sbi/openapi/model/pp5g_vn_group_profile_data.c @@ -20,24 +20,32 @@ OpenAPI_pp5g_vn_group_profile_data_t *OpenAPI_pp5g_vn_group_profile_data_create( void OpenAPI_pp5g_vn_group_profile_data_free(OpenAPI_pp5g_vn_group_profile_data_t *pp5g_vn_group_profile_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pp5g_vn_group_profile_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(pp5g_vn_group_profile_data->allowed_mtc_providers, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (pp5g_vn_group_profile_data->allowed_mtc_providers) { + OpenAPI_list_for_each(pp5g_vn_group_profile_data->allowed_mtc_providers, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pp5g_vn_group_profile_data->allowed_mtc_providers); + pp5g_vn_group_profile_data->allowed_mtc_providers = NULL; + } + if (pp5g_vn_group_profile_data->supported_features) { + ogs_free(pp5g_vn_group_profile_data->supported_features); + pp5g_vn_group_profile_data->supported_features = NULL; } - OpenAPI_list_free(pp5g_vn_group_profile_data->allowed_mtc_providers); - ogs_free(pp5g_vn_group_profile_data->supported_features); ogs_free(pp5g_vn_group_profile_data); } cJSON *OpenAPI_pp5g_vn_group_profile_data_convertToJSON(OpenAPI_pp5g_vn_group_profile_data_t *pp5g_vn_group_profile_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pp5g_vn_group_profile_data == NULL) { ogs_error("OpenAPI_pp5g_vn_group_profile_data_convertToJSON() failed [Pp5gVnGroupProfileData]"); @@ -52,21 +60,20 @@ cJSON *OpenAPI_pp5g_vn_group_profile_data_convertToJSON(OpenAPI_pp5g_vn_group_pr goto end; } cJSON *localMapObject = allowed_mtc_providers; - OpenAPI_lnode_t *allowed_mtc_providers_node; if (pp5g_vn_group_profile_data->allowed_mtc_providers) { - OpenAPI_list_for_each(pp5g_vn_group_profile_data->allowed_mtc_providers, allowed_mtc_providers_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)allowed_mtc_providers_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_allowed_mtc_provider_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pp5g_vn_group_profile_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(pp5g_vn_group_profile_data->allowed_mtc_providers, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_allowed_mtc_provider_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pp5g_vn_group_profile_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (pp5g_vn_group_profile_data->supported_features) { if (cJSON_AddStringToObject(item, "supportedFeatures", pp5g_vn_group_profile_data->supported_features) == NULL) { @@ -82,36 +89,41 @@ end: OpenAPI_pp5g_vn_group_profile_data_t *OpenAPI_pp5g_vn_group_profile_data_parseFromJSON(cJSON *pp5g_vn_group_profile_dataJSON) { OpenAPI_pp5g_vn_group_profile_data_t *pp5g_vn_group_profile_data_local_var = NULL; - cJSON *allowed_mtc_providers = cJSON_GetObjectItemCaseSensitive(pp5g_vn_group_profile_dataJSON, "allowedMtcProviders"); - - OpenAPI_list_t *allowed_mtc_providersList; + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_mtc_providers = NULL; + OpenAPI_list_t *allowed_mtc_providersList = NULL; + cJSON *supported_features = NULL; + allowed_mtc_providers = cJSON_GetObjectItemCaseSensitive(pp5g_vn_group_profile_dataJSON, "allowedMtcProviders"); if (allowed_mtc_providers) { - cJSON *allowed_mtc_providers_local_map; - if (!cJSON_IsObject(allowed_mtc_providers)) { - ogs_error("OpenAPI_pp5g_vn_group_profile_data_parseFromJSON() failed [allowed_mtc_providers]"); - goto end; - } - allowed_mtc_providersList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(allowed_mtc_providers_local_map, allowed_mtc_providers) { - cJSON *localMapObject = allowed_mtc_providers_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_allowed_mtc_provider_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_pp5g_vn_group_profile_data_parseFromJSON() failed [inner]"); + cJSON *allowed_mtc_providers_local_map = NULL; + if (!cJSON_IsObject(allowed_mtc_providers) && !cJSON_IsNull(allowed_mtc_providers)) { + ogs_error("OpenAPI_pp5g_vn_group_profile_data_parseFromJSON() failed [allowed_mtc_providers]"); goto end; } - OpenAPI_list_add(allowed_mtc_providersList, localMapKeyPair); - } + if (cJSON_IsObject(allowed_mtc_providers)) { + allowed_mtc_providersList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(allowed_mtc_providers_local_map, allowed_mtc_providers) { + cJSON *localMapObject = allowed_mtc_providers_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_allowed_mtc_provider_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_pp5g_vn_group_profile_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(allowed_mtc_providersList, localMapKeyPair); + } + } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(pp5g_vn_group_profile_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(pp5g_vn_group_profile_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_pp5g_vn_group_profile_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -119,11 +131,21 @@ OpenAPI_pp5g_vn_group_profile_data_t *OpenAPI_pp5g_vn_group_profile_data_parseFr pp5g_vn_group_profile_data_local_var = OpenAPI_pp5g_vn_group_profile_data_create ( allowed_mtc_providers ? allowed_mtc_providersList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return pp5g_vn_group_profile_data_local_var; end: + if (allowed_mtc_providersList) { + OpenAPI_list_for_each(allowed_mtc_providersList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(allowed_mtc_providersList); + allowed_mtc_providersList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pp_active_time.c b/lib/sbi/openapi/model/pp_active_time.c index c2e0a5b68..a46d8a9f1 100644 --- a/lib/sbi/openapi/model/pp_active_time.c +++ b/lib/sbi/openapi/model/pp_active_time.c @@ -26,19 +26,30 @@ OpenAPI_pp_active_time_t *OpenAPI_pp_active_time_create( void OpenAPI_pp_active_time_free(OpenAPI_pp_active_time_t *pp_active_time) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pp_active_time) { return; } - OpenAPI_lnode_t *node; - ogs_free(pp_active_time->af_instance_id); - ogs_free(pp_active_time->validity_time); - ogs_free(pp_active_time->mtc_provider_information); + if (pp_active_time->af_instance_id) { + ogs_free(pp_active_time->af_instance_id); + pp_active_time->af_instance_id = NULL; + } + if (pp_active_time->validity_time) { + ogs_free(pp_active_time->validity_time); + pp_active_time->validity_time = NULL; + } + if (pp_active_time->mtc_provider_information) { + ogs_free(pp_active_time->mtc_provider_information); + pp_active_time->mtc_provider_information = NULL; + } ogs_free(pp_active_time); } cJSON *OpenAPI_pp_active_time_convertToJSON(OpenAPI_pp_active_time_t *pp_active_time) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pp_active_time == NULL) { ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [PpActiveTime]"); @@ -51,6 +62,10 @@ cJSON *OpenAPI_pp_active_time_convertToJSON(OpenAPI_pp_active_time_t *pp_active_ goto end; } + if (!pp_active_time->af_instance_id) { + ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [af_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afInstanceId", pp_active_time->af_instance_id) == NULL) { ogs_error("OpenAPI_pp_active_time_convertToJSON() failed [af_instance_id]"); goto end; @@ -82,52 +97,53 @@ end: OpenAPI_pp_active_time_t *OpenAPI_pp_active_time_parseFromJSON(cJSON *pp_active_timeJSON) { OpenAPI_pp_active_time_t *pp_active_time_local_var = NULL; - cJSON *active_time = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "activeTime"); + OpenAPI_lnode_t *node = NULL; + cJSON *active_time = NULL; + cJSON *af_instance_id = NULL; + cJSON *reference_id = NULL; + cJSON *validity_time = NULL; + cJSON *mtc_provider_information = NULL; + active_time = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "activeTime"); if (!active_time) { ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [active_time]"); goto end; } - if (!cJSON_IsNumber(active_time)) { ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [active_time]"); goto end; } - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "afInstanceId"); + af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "afInstanceId"); if (!af_instance_id) { ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [af_instance_id]"); goto end; } - if (!cJSON_IsString(af_instance_id)) { ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [af_instance_id]"); goto end; } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "referenceId"); + reference_id = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "referenceId"); if (!reference_id) { ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [reference_id]"); goto end; } - if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [reference_id]"); goto end; } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_active_timeJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_pp_active_time_parseFromJSON() failed [mtc_provider_information]"); goto end; } @@ -139,8 +155,8 @@ OpenAPI_pp_active_time_t *OpenAPI_pp_active_time_parseFromJSON(cJSON *pp_active_ ogs_strdup(af_instance_id->valuestring), reference_id->valuedouble, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return pp_active_time_local_var; diff --git a/lib/sbi/openapi/model/pp_data.c b/lib/sbi/openapi/model/pp_data.c index ab63b75d9..88f2d5510 100644 --- a/lib/sbi/openapi/model/pp_data.c +++ b/lib/sbi/openapi/model/pp_data.c @@ -32,24 +32,50 @@ OpenAPI_pp_data_t *OpenAPI_pp_data_create( void OpenAPI_pp_data_free(OpenAPI_pp_data_t *pp_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pp_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_communication_characteristics_free(pp_data->communication_characteristics); - ogs_free(pp_data->supported_features); - OpenAPI_expected_ue_behaviour_free(pp_data->expected_ue_behaviour_parameters); - OpenAPI_ec_restriction_free(pp_data->ec_restriction); - OpenAPI_acs_info_rm_free(pp_data->acs_info); - ogs_free(pp_data->stn_sr); - OpenAPI_lcs_privacy_free(pp_data->lcs_privacy); - OpenAPI_sor_info_free(pp_data->sor_info); + if (pp_data->communication_characteristics) { + OpenAPI_communication_characteristics_free(pp_data->communication_characteristics); + pp_data->communication_characteristics = NULL; + } + if (pp_data->supported_features) { + ogs_free(pp_data->supported_features); + pp_data->supported_features = NULL; + } + if (pp_data->expected_ue_behaviour_parameters) { + OpenAPI_expected_ue_behaviour_free(pp_data->expected_ue_behaviour_parameters); + pp_data->expected_ue_behaviour_parameters = NULL; + } + if (pp_data->ec_restriction) { + OpenAPI_ec_restriction_free(pp_data->ec_restriction); + pp_data->ec_restriction = NULL; + } + if (pp_data->acs_info) { + OpenAPI_acs_info_rm_free(pp_data->acs_info); + pp_data->acs_info = NULL; + } + if (pp_data->stn_sr) { + ogs_free(pp_data->stn_sr); + pp_data->stn_sr = NULL; + } + if (pp_data->lcs_privacy) { + OpenAPI_lcs_privacy_free(pp_data->lcs_privacy); + pp_data->lcs_privacy = NULL; + } + if (pp_data->sor_info) { + OpenAPI_sor_info_free(pp_data->sor_info); + pp_data->sor_info = NULL; + } ogs_free(pp_data); } cJSON *OpenAPI_pp_data_convertToJSON(OpenAPI_pp_data_t *pp_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pp_data == NULL) { ogs_error("OpenAPI_pp_data_convertToJSON() failed [PpData]"); @@ -156,79 +182,104 @@ end: OpenAPI_pp_data_t *OpenAPI_pp_data_parseFromJSON(cJSON *pp_dataJSON) { OpenAPI_pp_data_t *pp_data_local_var = NULL; - cJSON *communication_characteristics = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "communicationCharacteristics"); - + OpenAPI_lnode_t *node = NULL; + cJSON *communication_characteristics = NULL; OpenAPI_communication_characteristics_t *communication_characteristics_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *expected_ue_behaviour_parameters = NULL; + OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters_local_nonprim = NULL; + cJSON *ec_restriction = NULL; + OpenAPI_ec_restriction_t *ec_restriction_local_nonprim = NULL; + cJSON *acs_info = NULL; + OpenAPI_acs_info_rm_t *acs_info_local_nonprim = NULL; + cJSON *stn_sr = NULL; + cJSON *lcs_privacy = NULL; + OpenAPI_lcs_privacy_t *lcs_privacy_local_nonprim = NULL; + cJSON *sor_info = NULL; + OpenAPI_sor_info_t *sor_info_local_nonprim = NULL; + communication_characteristics = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "communicationCharacteristics"); if (communication_characteristics) { communication_characteristics_local_nonprim = OpenAPI_communication_characteristics_parseFromJSON(communication_characteristics); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_pp_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *expected_ue_behaviour_parameters = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "expectedUeBehaviourParameters"); - - OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters_local_nonprim = NULL; + expected_ue_behaviour_parameters = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "expectedUeBehaviourParameters"); if (expected_ue_behaviour_parameters) { expected_ue_behaviour_parameters_local_nonprim = OpenAPI_expected_ue_behaviour_parseFromJSON(expected_ue_behaviour_parameters); } - cJSON *ec_restriction = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "ecRestriction"); - - OpenAPI_ec_restriction_t *ec_restriction_local_nonprim = NULL; + ec_restriction = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "ecRestriction"); if (ec_restriction) { ec_restriction_local_nonprim = OpenAPI_ec_restriction_parseFromJSON(ec_restriction); } - cJSON *acs_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "acsInfo"); - - OpenAPI_acs_info_rm_t *acs_info_local_nonprim = NULL; + acs_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "acsInfo"); if (acs_info) { acs_info_local_nonprim = OpenAPI_acs_info_rm_parseFromJSON(acs_info); } - cJSON *stn_sr = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "stnSr"); - + stn_sr = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "stnSr"); if (stn_sr) { - if (!cJSON_IsString(stn_sr)) { + if (!cJSON_IsString(stn_sr) && !cJSON_IsNull(stn_sr)) { ogs_error("OpenAPI_pp_data_parseFromJSON() failed [stn_sr]"); goto end; } } - cJSON *lcs_privacy = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "lcsPrivacy"); - - OpenAPI_lcs_privacy_t *lcs_privacy_local_nonprim = NULL; + lcs_privacy = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "lcsPrivacy"); if (lcs_privacy) { lcs_privacy_local_nonprim = OpenAPI_lcs_privacy_parseFromJSON(lcs_privacy); } - cJSON *sor_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "sorInfo"); - - OpenAPI_sor_info_t *sor_info_local_nonprim = NULL; + sor_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "sorInfo"); if (sor_info) { sor_info_local_nonprim = OpenAPI_sor_info_parseFromJSON(sor_info); } pp_data_local_var = OpenAPI_pp_data_create ( communication_characteristics ? communication_characteristics_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, expected_ue_behaviour_parameters ? expected_ue_behaviour_parameters_local_nonprim : NULL, ec_restriction ? ec_restriction_local_nonprim : NULL, acs_info ? acs_info_local_nonprim : NULL, - stn_sr ? ogs_strdup(stn_sr->valuestring) : NULL, + stn_sr && !cJSON_IsNull(stn_sr) ? ogs_strdup(stn_sr->valuestring) : NULL, lcs_privacy ? lcs_privacy_local_nonprim : NULL, sor_info ? sor_info_local_nonprim : NULL ); return pp_data_local_var; end: + if (communication_characteristics_local_nonprim) { + OpenAPI_communication_characteristics_free(communication_characteristics_local_nonprim); + communication_characteristics_local_nonprim = NULL; + } + if (expected_ue_behaviour_parameters_local_nonprim) { + OpenAPI_expected_ue_behaviour_free(expected_ue_behaviour_parameters_local_nonprim); + expected_ue_behaviour_parameters_local_nonprim = NULL; + } + if (ec_restriction_local_nonprim) { + OpenAPI_ec_restriction_free(ec_restriction_local_nonprim); + ec_restriction_local_nonprim = NULL; + } + if (acs_info_local_nonprim) { + OpenAPI_acs_info_rm_free(acs_info_local_nonprim); + acs_info_local_nonprim = NULL; + } + if (lcs_privacy_local_nonprim) { + OpenAPI_lcs_privacy_free(lcs_privacy_local_nonprim); + lcs_privacy_local_nonprim = NULL; + } + if (sor_info_local_nonprim) { + OpenAPI_sor_info_free(sor_info_local_nonprim); + sor_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pp_dl_packet_count_ext.c b/lib/sbi/openapi/model/pp_dl_packet_count_ext.c index b55fd8064..9cb929a0b 100644 --- a/lib/sbi/openapi/model/pp_dl_packet_count_ext.c +++ b/lib/sbi/openapi/model/pp_dl_packet_count_ext.c @@ -24,19 +24,30 @@ OpenAPI_pp_dl_packet_count_ext_t *OpenAPI_pp_dl_packet_count_ext_create( void OpenAPI_pp_dl_packet_count_ext_free(OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pp_dl_packet_count_ext) { return; } - OpenAPI_lnode_t *node; - ogs_free(pp_dl_packet_count_ext->af_instance_id); - ogs_free(pp_dl_packet_count_ext->validity_time); - ogs_free(pp_dl_packet_count_ext->mtc_provider_information); + if (pp_dl_packet_count_ext->af_instance_id) { + ogs_free(pp_dl_packet_count_ext->af_instance_id); + pp_dl_packet_count_ext->af_instance_id = NULL; + } + if (pp_dl_packet_count_ext->validity_time) { + ogs_free(pp_dl_packet_count_ext->validity_time); + pp_dl_packet_count_ext->validity_time = NULL; + } + if (pp_dl_packet_count_ext->mtc_provider_information) { + ogs_free(pp_dl_packet_count_ext->mtc_provider_information); + pp_dl_packet_count_ext->mtc_provider_information = NULL; + } ogs_free(pp_dl_packet_count_ext); } cJSON *OpenAPI_pp_dl_packet_count_ext_convertToJSON(OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pp_dl_packet_count_ext == NULL) { ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [PpDlPacketCountExt]"); @@ -44,6 +55,10 @@ cJSON *OpenAPI_pp_dl_packet_count_ext_convertToJSON(OpenAPI_pp_dl_packet_count_e } item = cJSON_CreateObject(); + if (!pp_dl_packet_count_ext->af_instance_id) { + ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [af_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afInstanceId", pp_dl_packet_count_ext->af_instance_id) == NULL) { ogs_error("OpenAPI_pp_dl_packet_count_ext_convertToJSON() failed [af_instance_id]"); goto end; @@ -75,41 +90,42 @@ end: OpenAPI_pp_dl_packet_count_ext_t *OpenAPI_pp_dl_packet_count_ext_parseFromJSON(cJSON *pp_dl_packet_count_extJSON) { OpenAPI_pp_dl_packet_count_ext_t *pp_dl_packet_count_ext_local_var = NULL; - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "afInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *af_instance_id = NULL; + cJSON *reference_id = NULL; + cJSON *validity_time = NULL; + cJSON *mtc_provider_information = NULL; + af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "afInstanceId"); if (!af_instance_id) { ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [af_instance_id]"); goto end; } - if (!cJSON_IsString(af_instance_id)) { ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [af_instance_id]"); goto end; } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "referenceId"); + reference_id = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "referenceId"); if (!reference_id) { ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [reference_id]"); goto end; } - if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [reference_id]"); goto end; } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_dl_packet_count_extJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_pp_dl_packet_count_ext_parseFromJSON() failed [mtc_provider_information]"); goto end; } @@ -119,8 +135,8 @@ OpenAPI_pp_dl_packet_count_ext_t *OpenAPI_pp_dl_packet_count_ext_parseFromJSON(c ogs_strdup(af_instance_id->valuestring), reference_id->valuedouble, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return pp_dl_packet_count_ext_local_var; diff --git a/lib/sbi/openapi/model/pp_maximum_latency.c b/lib/sbi/openapi/model/pp_maximum_latency.c index f3f41c6ee..8863e3fd3 100644 --- a/lib/sbi/openapi/model/pp_maximum_latency.c +++ b/lib/sbi/openapi/model/pp_maximum_latency.c @@ -26,19 +26,30 @@ OpenAPI_pp_maximum_latency_t *OpenAPI_pp_maximum_latency_create( void OpenAPI_pp_maximum_latency_free(OpenAPI_pp_maximum_latency_t *pp_maximum_latency) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pp_maximum_latency) { return; } - OpenAPI_lnode_t *node; - ogs_free(pp_maximum_latency->af_instance_id); - ogs_free(pp_maximum_latency->validity_time); - ogs_free(pp_maximum_latency->mtc_provider_information); + if (pp_maximum_latency->af_instance_id) { + ogs_free(pp_maximum_latency->af_instance_id); + pp_maximum_latency->af_instance_id = NULL; + } + if (pp_maximum_latency->validity_time) { + ogs_free(pp_maximum_latency->validity_time); + pp_maximum_latency->validity_time = NULL; + } + if (pp_maximum_latency->mtc_provider_information) { + ogs_free(pp_maximum_latency->mtc_provider_information); + pp_maximum_latency->mtc_provider_information = NULL; + } ogs_free(pp_maximum_latency); } cJSON *OpenAPI_pp_maximum_latency_convertToJSON(OpenAPI_pp_maximum_latency_t *pp_maximum_latency) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pp_maximum_latency == NULL) { ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [PpMaximumLatency]"); @@ -51,6 +62,10 @@ cJSON *OpenAPI_pp_maximum_latency_convertToJSON(OpenAPI_pp_maximum_latency_t *pp goto end; } + if (!pp_maximum_latency->af_instance_id) { + ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [af_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afInstanceId", pp_maximum_latency->af_instance_id) == NULL) { ogs_error("OpenAPI_pp_maximum_latency_convertToJSON() failed [af_instance_id]"); goto end; @@ -82,52 +97,53 @@ end: OpenAPI_pp_maximum_latency_t *OpenAPI_pp_maximum_latency_parseFromJSON(cJSON *pp_maximum_latencyJSON) { OpenAPI_pp_maximum_latency_t *pp_maximum_latency_local_var = NULL; - cJSON *maximum_latency = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "maximumLatency"); + OpenAPI_lnode_t *node = NULL; + cJSON *maximum_latency = NULL; + cJSON *af_instance_id = NULL; + cJSON *reference_id = NULL; + cJSON *validity_time = NULL; + cJSON *mtc_provider_information = NULL; + maximum_latency = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "maximumLatency"); if (!maximum_latency) { ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [maximum_latency]"); goto end; } - if (!cJSON_IsNumber(maximum_latency)) { ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [maximum_latency]"); goto end; } - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "afInstanceId"); + af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "afInstanceId"); if (!af_instance_id) { ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [af_instance_id]"); goto end; } - if (!cJSON_IsString(af_instance_id)) { ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [af_instance_id]"); goto end; } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "referenceId"); + reference_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "referenceId"); if (!reference_id) { ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [reference_id]"); goto end; } - if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [reference_id]"); goto end; } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_maximum_latencyJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_pp_maximum_latency_parseFromJSON() failed [mtc_provider_information]"); goto end; } @@ -139,8 +155,8 @@ OpenAPI_pp_maximum_latency_t *OpenAPI_pp_maximum_latency_parseFromJSON(cJSON *pp ogs_strdup(af_instance_id->valuestring), reference_id->valuedouble, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return pp_maximum_latency_local_var; diff --git a/lib/sbi/openapi/model/pp_maximum_response_time.c b/lib/sbi/openapi/model/pp_maximum_response_time.c index ee548359b..4af0bdd45 100644 --- a/lib/sbi/openapi/model/pp_maximum_response_time.c +++ b/lib/sbi/openapi/model/pp_maximum_response_time.c @@ -26,19 +26,30 @@ OpenAPI_pp_maximum_response_time_t *OpenAPI_pp_maximum_response_time_create( void OpenAPI_pp_maximum_response_time_free(OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pp_maximum_response_time) { return; } - OpenAPI_lnode_t *node; - ogs_free(pp_maximum_response_time->af_instance_id); - ogs_free(pp_maximum_response_time->validity_time); - ogs_free(pp_maximum_response_time->mtc_provider_information); + if (pp_maximum_response_time->af_instance_id) { + ogs_free(pp_maximum_response_time->af_instance_id); + pp_maximum_response_time->af_instance_id = NULL; + } + if (pp_maximum_response_time->validity_time) { + ogs_free(pp_maximum_response_time->validity_time); + pp_maximum_response_time->validity_time = NULL; + } + if (pp_maximum_response_time->mtc_provider_information) { + ogs_free(pp_maximum_response_time->mtc_provider_information); + pp_maximum_response_time->mtc_provider_information = NULL; + } ogs_free(pp_maximum_response_time); } cJSON *OpenAPI_pp_maximum_response_time_convertToJSON(OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pp_maximum_response_time == NULL) { ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [PpMaximumResponseTime]"); @@ -51,6 +62,10 @@ cJSON *OpenAPI_pp_maximum_response_time_convertToJSON(OpenAPI_pp_maximum_respons goto end; } + if (!pp_maximum_response_time->af_instance_id) { + ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [af_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afInstanceId", pp_maximum_response_time->af_instance_id) == NULL) { ogs_error("OpenAPI_pp_maximum_response_time_convertToJSON() failed [af_instance_id]"); goto end; @@ -82,52 +97,53 @@ end: OpenAPI_pp_maximum_response_time_t *OpenAPI_pp_maximum_response_time_parseFromJSON(cJSON *pp_maximum_response_timeJSON) { OpenAPI_pp_maximum_response_time_t *pp_maximum_response_time_local_var = NULL; - cJSON *maximum_response_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "maximumResponseTime"); + OpenAPI_lnode_t *node = NULL; + cJSON *maximum_response_time = NULL; + cJSON *af_instance_id = NULL; + cJSON *reference_id = NULL; + cJSON *validity_time = NULL; + cJSON *mtc_provider_information = NULL; + maximum_response_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "maximumResponseTime"); if (!maximum_response_time) { ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [maximum_response_time]"); goto end; } - if (!cJSON_IsNumber(maximum_response_time)) { ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [maximum_response_time]"); goto end; } - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "afInstanceId"); + af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "afInstanceId"); if (!af_instance_id) { ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [af_instance_id]"); goto end; } - if (!cJSON_IsString(af_instance_id)) { ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [af_instance_id]"); goto end; } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "referenceId"); + reference_id = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "referenceId"); if (!reference_id) { ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [reference_id]"); goto end; } - if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [reference_id]"); goto end; } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_maximum_response_timeJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_pp_maximum_response_time_parseFromJSON() failed [mtc_provider_information]"); goto end; } @@ -139,8 +155,8 @@ OpenAPI_pp_maximum_response_time_t *OpenAPI_pp_maximum_response_time_parseFromJS ogs_strdup(af_instance_id->valuestring), reference_id->valuedouble, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return pp_maximum_response_time_local_var; diff --git a/lib/sbi/openapi/model/pp_profile_data.c b/lib/sbi/openapi/model/pp_profile_data.c index a415d0939..db5a36e25 100644 --- a/lib/sbi/openapi/model/pp_profile_data.c +++ b/lib/sbi/openapi/model/pp_profile_data.c @@ -20,24 +20,32 @@ OpenAPI_pp_profile_data_t *OpenAPI_pp_profile_data_create( void OpenAPI_pp_profile_data_free(OpenAPI_pp_profile_data_t *pp_profile_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pp_profile_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(pp_profile_data->allowed_mtc_providers, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (pp_profile_data->allowed_mtc_providers) { + OpenAPI_list_for_each(pp_profile_data->allowed_mtc_providers, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pp_profile_data->allowed_mtc_providers); + pp_profile_data->allowed_mtc_providers = NULL; + } + if (pp_profile_data->supported_features) { + ogs_free(pp_profile_data->supported_features); + pp_profile_data->supported_features = NULL; } - OpenAPI_list_free(pp_profile_data->allowed_mtc_providers); - ogs_free(pp_profile_data->supported_features); ogs_free(pp_profile_data); } cJSON *OpenAPI_pp_profile_data_convertToJSON(OpenAPI_pp_profile_data_t *pp_profile_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pp_profile_data == NULL) { ogs_error("OpenAPI_pp_profile_data_convertToJSON() failed [PpProfileData]"); @@ -52,21 +60,20 @@ cJSON *OpenAPI_pp_profile_data_convertToJSON(OpenAPI_pp_profile_data_t *pp_profi goto end; } cJSON *localMapObject = allowed_mtc_providers; - OpenAPI_lnode_t *allowed_mtc_providers_node; if (pp_profile_data->allowed_mtc_providers) { - OpenAPI_list_for_each(pp_profile_data->allowed_mtc_providers, allowed_mtc_providers_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)allowed_mtc_providers_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_allowed_mtc_provider_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pp_profile_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(pp_profile_data->allowed_mtc_providers, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_allowed_mtc_provider_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pp_profile_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (pp_profile_data->supported_features) { if (cJSON_AddStringToObject(item, "supportedFeatures", pp_profile_data->supported_features) == NULL) { @@ -82,36 +89,41 @@ end: OpenAPI_pp_profile_data_t *OpenAPI_pp_profile_data_parseFromJSON(cJSON *pp_profile_dataJSON) { OpenAPI_pp_profile_data_t *pp_profile_data_local_var = NULL; - cJSON *allowed_mtc_providers = cJSON_GetObjectItemCaseSensitive(pp_profile_dataJSON, "allowedMtcProviders"); - - OpenAPI_list_t *allowed_mtc_providersList; + OpenAPI_lnode_t *node = NULL; + cJSON *allowed_mtc_providers = NULL; + OpenAPI_list_t *allowed_mtc_providersList = NULL; + cJSON *supported_features = NULL; + allowed_mtc_providers = cJSON_GetObjectItemCaseSensitive(pp_profile_dataJSON, "allowedMtcProviders"); if (allowed_mtc_providers) { - cJSON *allowed_mtc_providers_local_map; - if (!cJSON_IsObject(allowed_mtc_providers)) { - ogs_error("OpenAPI_pp_profile_data_parseFromJSON() failed [allowed_mtc_providers]"); - goto end; - } - allowed_mtc_providersList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(allowed_mtc_providers_local_map, allowed_mtc_providers) { - cJSON *localMapObject = allowed_mtc_providers_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_allowed_mtc_provider_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_pp_profile_data_parseFromJSON() failed [inner]"); + cJSON *allowed_mtc_providers_local_map = NULL; + if (!cJSON_IsObject(allowed_mtc_providers) && !cJSON_IsNull(allowed_mtc_providers)) { + ogs_error("OpenAPI_pp_profile_data_parseFromJSON() failed [allowed_mtc_providers]"); goto end; } - OpenAPI_list_add(allowed_mtc_providersList, localMapKeyPair); - } + if (cJSON_IsObject(allowed_mtc_providers)) { + allowed_mtc_providersList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(allowed_mtc_providers_local_map, allowed_mtc_providers) { + cJSON *localMapObject = allowed_mtc_providers_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_allowed_mtc_provider_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_pp_profile_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(allowed_mtc_providersList, localMapKeyPair); + } + } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(pp_profile_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(pp_profile_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_pp_profile_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -119,11 +131,21 @@ OpenAPI_pp_profile_data_t *OpenAPI_pp_profile_data_parseFromJSON(cJSON *pp_profi pp_profile_data_local_var = OpenAPI_pp_profile_data_create ( allowed_mtc_providers ? allowed_mtc_providersList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return pp_profile_data_local_var; end: + if (allowed_mtc_providersList) { + OpenAPI_list_for_each(allowed_mtc_providersList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(allowed_mtc_providersList); + allowed_mtc_providersList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pp_subs_reg_timer.c b/lib/sbi/openapi/model/pp_subs_reg_timer.c index b83b3832a..e03d48201 100644 --- a/lib/sbi/openapi/model/pp_subs_reg_timer.c +++ b/lib/sbi/openapi/model/pp_subs_reg_timer.c @@ -26,19 +26,30 @@ OpenAPI_pp_subs_reg_timer_t *OpenAPI_pp_subs_reg_timer_create( void OpenAPI_pp_subs_reg_timer_free(OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pp_subs_reg_timer) { return; } - OpenAPI_lnode_t *node; - ogs_free(pp_subs_reg_timer->af_instance_id); - ogs_free(pp_subs_reg_timer->validity_time); - ogs_free(pp_subs_reg_timer->mtc_provider_information); + if (pp_subs_reg_timer->af_instance_id) { + ogs_free(pp_subs_reg_timer->af_instance_id); + pp_subs_reg_timer->af_instance_id = NULL; + } + if (pp_subs_reg_timer->validity_time) { + ogs_free(pp_subs_reg_timer->validity_time); + pp_subs_reg_timer->validity_time = NULL; + } + if (pp_subs_reg_timer->mtc_provider_information) { + ogs_free(pp_subs_reg_timer->mtc_provider_information); + pp_subs_reg_timer->mtc_provider_information = NULL; + } ogs_free(pp_subs_reg_timer); } cJSON *OpenAPI_pp_subs_reg_timer_convertToJSON(OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pp_subs_reg_timer == NULL) { ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [PpSubsRegTimer]"); @@ -51,6 +62,10 @@ cJSON *OpenAPI_pp_subs_reg_timer_convertToJSON(OpenAPI_pp_subs_reg_timer_t *pp_s goto end; } + if (!pp_subs_reg_timer->af_instance_id) { + ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [af_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "afInstanceId", pp_subs_reg_timer->af_instance_id) == NULL) { ogs_error("OpenAPI_pp_subs_reg_timer_convertToJSON() failed [af_instance_id]"); goto end; @@ -82,52 +97,53 @@ end: OpenAPI_pp_subs_reg_timer_t *OpenAPI_pp_subs_reg_timer_parseFromJSON(cJSON *pp_subs_reg_timerJSON) { OpenAPI_pp_subs_reg_timer_t *pp_subs_reg_timer_local_var = NULL; - cJSON *subs_reg_timer = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "subsRegTimer"); + OpenAPI_lnode_t *node = NULL; + cJSON *subs_reg_timer = NULL; + cJSON *af_instance_id = NULL; + cJSON *reference_id = NULL; + cJSON *validity_time = NULL; + cJSON *mtc_provider_information = NULL; + subs_reg_timer = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "subsRegTimer"); if (!subs_reg_timer) { ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [subs_reg_timer]"); goto end; } - if (!cJSON_IsNumber(subs_reg_timer)) { ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [subs_reg_timer]"); goto end; } - cJSON *af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "afInstanceId"); + af_instance_id = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "afInstanceId"); if (!af_instance_id) { ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [af_instance_id]"); goto end; } - if (!cJSON_IsString(af_instance_id)) { ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [af_instance_id]"); goto end; } - cJSON *reference_id = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "referenceId"); + reference_id = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "referenceId"); if (!reference_id) { ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [reference_id]"); goto end; } - if (!cJSON_IsNumber(reference_id)) { ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [reference_id]"); goto end; } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "mtcProviderInformation"); - + mtc_provider_information = cJSON_GetObjectItemCaseSensitive(pp_subs_reg_timerJSON, "mtcProviderInformation"); if (mtc_provider_information) { - if (!cJSON_IsString(mtc_provider_information)) { + if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) { ogs_error("OpenAPI_pp_subs_reg_timer_parseFromJSON() failed [mtc_provider_information]"); goto end; } @@ -139,8 +155,8 @@ OpenAPI_pp_subs_reg_timer_t *OpenAPI_pp_subs_reg_timer_parseFromJSON(cJSON *pp_s ogs_strdup(af_instance_id->valuestring), reference_id->valuedouble, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, - mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, + mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL ); return pp_subs_reg_timer_local_var; diff --git a/lib/sbi/openapi/model/preemption_capability_rm.c b/lib/sbi/openapi/model/preemption_capability_rm.c index da11bcb67..8ec12d943 100644 --- a/lib/sbi/openapi/model/preemption_capability_rm.c +++ b/lib/sbi/openapi/model/preemption_capability_rm.c @@ -16,16 +16,18 @@ OpenAPI_preemption_capability_rm_t *OpenAPI_preemption_capability_rm_create( void OpenAPI_preemption_capability_rm_free(OpenAPI_preemption_capability_rm_t *preemption_capability_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == preemption_capability_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(preemption_capability_rm); } cJSON *OpenAPI_preemption_capability_rm_convertToJSON(OpenAPI_preemption_capability_rm_t *preemption_capability_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (preemption_capability_rm == NULL) { ogs_error("OpenAPI_preemption_capability_rm_convertToJSON() failed [PreemptionCapabilityRm]"); @@ -40,6 +42,7 @@ end: OpenAPI_preemption_capability_rm_t *OpenAPI_preemption_capability_rm_parseFromJSON(cJSON *preemption_capability_rmJSON) { OpenAPI_preemption_capability_rm_t *preemption_capability_rm_local_var = NULL; + OpenAPI_lnode_t *node = NULL; preemption_capability_rm_local_var = OpenAPI_preemption_capability_rm_create ( ); diff --git a/lib/sbi/openapi/model/preemption_control_information_rm.c b/lib/sbi/openapi/model/preemption_control_information_rm.c index b5b6cea97..edf7ee25a 100644 --- a/lib/sbi/openapi/model/preemption_control_information_rm.c +++ b/lib/sbi/openapi/model/preemption_control_information_rm.c @@ -16,16 +16,18 @@ OpenAPI_preemption_control_information_rm_t *OpenAPI_preemption_control_informat void OpenAPI_preemption_control_information_rm_free(OpenAPI_preemption_control_information_rm_t *preemption_control_information_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == preemption_control_information_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(preemption_control_information_rm); } cJSON *OpenAPI_preemption_control_information_rm_convertToJSON(OpenAPI_preemption_control_information_rm_t *preemption_control_information_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (preemption_control_information_rm == NULL) { ogs_error("OpenAPI_preemption_control_information_rm_convertToJSON() failed [PreemptionControlInformationRm]"); @@ -40,6 +42,7 @@ end: OpenAPI_preemption_control_information_rm_t *OpenAPI_preemption_control_information_rm_parseFromJSON(cJSON *preemption_control_information_rmJSON) { OpenAPI_preemption_control_information_rm_t *preemption_control_information_rm_local_var = NULL; + OpenAPI_lnode_t *node = NULL; preemption_control_information_rm_local_var = OpenAPI_preemption_control_information_rm_create ( ); diff --git a/lib/sbi/openapi/model/preemption_vulnerability_rm.c b/lib/sbi/openapi/model/preemption_vulnerability_rm.c index 4b84b1bde..689e7fa6d 100644 --- a/lib/sbi/openapi/model/preemption_vulnerability_rm.c +++ b/lib/sbi/openapi/model/preemption_vulnerability_rm.c @@ -16,16 +16,18 @@ OpenAPI_preemption_vulnerability_rm_t *OpenAPI_preemption_vulnerability_rm_creat void OpenAPI_preemption_vulnerability_rm_free(OpenAPI_preemption_vulnerability_rm_t *preemption_vulnerability_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == preemption_vulnerability_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(preemption_vulnerability_rm); } cJSON *OpenAPI_preemption_vulnerability_rm_convertToJSON(OpenAPI_preemption_vulnerability_rm_t *preemption_vulnerability_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (preemption_vulnerability_rm == NULL) { ogs_error("OpenAPI_preemption_vulnerability_rm_convertToJSON() failed [PreemptionVulnerabilityRm]"); @@ -40,6 +42,7 @@ end: OpenAPI_preemption_vulnerability_rm_t *OpenAPI_preemption_vulnerability_rm_parseFromJSON(cJSON *preemption_vulnerability_rmJSON) { OpenAPI_preemption_vulnerability_rm_t *preemption_vulnerability_rm_local_var = NULL; + OpenAPI_lnode_t *node = NULL; preemption_vulnerability_rm_local_var = OpenAPI_preemption_vulnerability_rm_create ( ); diff --git a/lib/sbi/openapi/model/preferred_search.c b/lib/sbi/openapi/model/preferred_search.c index 7c4e32bd6..485e2c742 100644 --- a/lib/sbi/openapi/model/preferred_search.c +++ b/lib/sbi/openapi/model/preferred_search.c @@ -40,16 +40,18 @@ OpenAPI_preferred_search_t *OpenAPI_preferred_search_create( void OpenAPI_preferred_search_free(OpenAPI_preferred_search_t *preferred_search) { + OpenAPI_lnode_t *node = NULL; + if (NULL == preferred_search) { return; } - OpenAPI_lnode_t *node; ogs_free(preferred_search); } cJSON *OpenAPI_preferred_search_convertToJSON(OpenAPI_preferred_search_t *preferred_search) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (preferred_search == NULL) { ogs_error("OpenAPI_preferred_search_convertToJSON() failed [PreferredSearch]"); @@ -106,8 +108,14 @@ end: OpenAPI_preferred_search_t *OpenAPI_preferred_search_parseFromJSON(cJSON *preferred_searchJSON) { OpenAPI_preferred_search_t *preferred_search_local_var = NULL; - cJSON *preferred_tai_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredTaiMatchInd"); - + OpenAPI_lnode_t *node = NULL; + cJSON *preferred_tai_match_ind = NULL; + cJSON *preferred_full_plmn_match_ind = NULL; + cJSON *preferred_api_versions_match_ind = NULL; + cJSON *other_api_versions_ind = NULL; + cJSON *preferred_locality_match_ind = NULL; + cJSON *other_locality_ind = NULL; + preferred_tai_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredTaiMatchInd"); if (preferred_tai_match_ind) { if (!cJSON_IsBool(preferred_tai_match_ind)) { ogs_error("OpenAPI_preferred_search_parseFromJSON() failed [preferred_tai_match_ind]"); @@ -115,8 +123,7 @@ OpenAPI_preferred_search_t *OpenAPI_preferred_search_parseFromJSON(cJSON *prefer } } - cJSON *preferred_full_plmn_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredFullPlmnMatchInd"); - + preferred_full_plmn_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredFullPlmnMatchInd"); if (preferred_full_plmn_match_ind) { if (!cJSON_IsBool(preferred_full_plmn_match_ind)) { ogs_error("OpenAPI_preferred_search_parseFromJSON() failed [preferred_full_plmn_match_ind]"); @@ -124,8 +131,7 @@ OpenAPI_preferred_search_t *OpenAPI_preferred_search_parseFromJSON(cJSON *prefer } } - cJSON *preferred_api_versions_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredApiVersionsMatchInd"); - + preferred_api_versions_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredApiVersionsMatchInd"); if (preferred_api_versions_match_ind) { if (!cJSON_IsBool(preferred_api_versions_match_ind)) { ogs_error("OpenAPI_preferred_search_parseFromJSON() failed [preferred_api_versions_match_ind]"); @@ -133,8 +139,7 @@ OpenAPI_preferred_search_t *OpenAPI_preferred_search_parseFromJSON(cJSON *prefer } } - cJSON *other_api_versions_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "otherApiVersionsInd"); - + other_api_versions_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "otherApiVersionsInd"); if (other_api_versions_ind) { if (!cJSON_IsBool(other_api_versions_ind)) { ogs_error("OpenAPI_preferred_search_parseFromJSON() failed [other_api_versions_ind]"); @@ -142,8 +147,7 @@ OpenAPI_preferred_search_t *OpenAPI_preferred_search_parseFromJSON(cJSON *prefer } } - cJSON *preferred_locality_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredLocalityMatchInd"); - + preferred_locality_match_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "preferredLocalityMatchInd"); if (preferred_locality_match_ind) { if (!cJSON_IsBool(preferred_locality_match_ind)) { ogs_error("OpenAPI_preferred_search_parseFromJSON() failed [preferred_locality_match_ind]"); @@ -151,8 +155,7 @@ OpenAPI_preferred_search_t *OpenAPI_preferred_search_parseFromJSON(cJSON *prefer } } - cJSON *other_locality_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "otherLocalityInd"); - + other_locality_ind = cJSON_GetObjectItemCaseSensitive(preferred_searchJSON, "otherLocalityInd"); if (other_locality_ind) { if (!cJSON_IsBool(other_locality_ind)) { ogs_error("OpenAPI_preferred_search_parseFromJSON() failed [other_locality_ind]"); diff --git a/lib/sbi/openapi/model/presence_info.c b/lib/sbi/openapi/model/presence_info.c index 58d1545e4..e018d210a 100644 --- a/lib/sbi/openapi/model/presence_info.c +++ b/lib/sbi/openapi/model/presence_info.c @@ -32,38 +32,61 @@ OpenAPI_presence_info_t *OpenAPI_presence_info_create( void OpenAPI_presence_info_free(OpenAPI_presence_info_t *presence_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == presence_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(presence_info->pra_id); - ogs_free(presence_info->additional_pra_id); - OpenAPI_list_for_each(presence_info->tracking_area_list, node) { - OpenAPI_tai_free(node->data); + if (presence_info->pra_id) { + ogs_free(presence_info->pra_id); + presence_info->pra_id = NULL; } - OpenAPI_list_free(presence_info->tracking_area_list); - OpenAPI_list_for_each(presence_info->ecgi_list, node) { - OpenAPI_ecgi_free(node->data); + if (presence_info->additional_pra_id) { + ogs_free(presence_info->additional_pra_id); + presence_info->additional_pra_id = NULL; } - OpenAPI_list_free(presence_info->ecgi_list); - OpenAPI_list_for_each(presence_info->ncgi_list, node) { - OpenAPI_ncgi_free(node->data); + if (presence_info->tracking_area_list) { + OpenAPI_list_for_each(presence_info->tracking_area_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(presence_info->tracking_area_list); + presence_info->tracking_area_list = NULL; } - OpenAPI_list_free(presence_info->ncgi_list); - OpenAPI_list_for_each(presence_info->global_ran_node_id_list, node) { - OpenAPI_global_ran_node_id_free(node->data); + if (presence_info->ecgi_list) { + OpenAPI_list_for_each(presence_info->ecgi_list, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(presence_info->ecgi_list); + presence_info->ecgi_list = NULL; } - OpenAPI_list_free(presence_info->global_ran_node_id_list); - OpenAPI_list_for_each(presence_info->globale_nb_id_list, node) { - OpenAPI_global_ran_node_id_free(node->data); + if (presence_info->ncgi_list) { + OpenAPI_list_for_each(presence_info->ncgi_list, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(presence_info->ncgi_list); + presence_info->ncgi_list = NULL; + } + if (presence_info->global_ran_node_id_list) { + OpenAPI_list_for_each(presence_info->global_ran_node_id_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(presence_info->global_ran_node_id_list); + presence_info->global_ran_node_id_list = NULL; + } + if (presence_info->globale_nb_id_list) { + OpenAPI_list_for_each(presence_info->globale_nb_id_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(presence_info->globale_nb_id_list); + presence_info->globale_nb_id_list = NULL; } - OpenAPI_list_free(presence_info->globale_nb_id_list); ogs_free(presence_info); } cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (presence_info == NULL) { ogs_error("OpenAPI_presence_info_convertToJSON() failed [PresenceInfo]"); @@ -85,7 +108,7 @@ cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_inf } } - if (presence_info->presence_state) { + if (presence_info->presence_state != OpenAPI_presence_state_NULL) { if (cJSON_AddStringToObject(item, "presenceState", OpenAPI_presence_state_ToString(presence_info->presence_state)) == NULL) { ogs_error("OpenAPI_presence_info_convertToJSON() failed [presence_state]"); goto end; @@ -98,17 +121,13 @@ cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_inf ogs_error("OpenAPI_presence_info_convertToJSON() failed [tracking_area_list]"); goto end; } - - OpenAPI_lnode_t *tracking_area_list_node; - if (presence_info->tracking_area_list) { - OpenAPI_list_for_each(presence_info->tracking_area_list, tracking_area_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tracking_area_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_convertToJSON() failed [tracking_area_list]"); - goto end; - } - cJSON_AddItemToArray(tracking_area_listList, itemLocal); + OpenAPI_list_for_each(presence_info->tracking_area_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [tracking_area_list]"); + goto end; } + cJSON_AddItemToArray(tracking_area_listList, itemLocal); } } @@ -118,17 +137,13 @@ cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_inf ogs_error("OpenAPI_presence_info_convertToJSON() failed [ecgi_list]"); goto end; } - - OpenAPI_lnode_t *ecgi_list_node; - if (presence_info->ecgi_list) { - OpenAPI_list_for_each(presence_info->ecgi_list, ecgi_list_node) { - cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(ecgi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_convertToJSON() failed [ecgi_list]"); - goto end; - } - cJSON_AddItemToArray(ecgi_listList, itemLocal); + OpenAPI_list_for_each(presence_info->ecgi_list, node) { + cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [ecgi_list]"); + goto end; } + cJSON_AddItemToArray(ecgi_listList, itemLocal); } } @@ -138,17 +153,13 @@ cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_inf ogs_error("OpenAPI_presence_info_convertToJSON() failed [ncgi_list]"); goto end; } - - OpenAPI_lnode_t *ncgi_list_node; - if (presence_info->ncgi_list) { - OpenAPI_list_for_each(presence_info->ncgi_list, ncgi_list_node) { - cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(ncgi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_convertToJSON() failed [ncgi_list]"); - goto end; - } - cJSON_AddItemToArray(ncgi_listList, itemLocal); + OpenAPI_list_for_each(presence_info->ncgi_list, node) { + cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [ncgi_list]"); + goto end; } + cJSON_AddItemToArray(ncgi_listList, itemLocal); } } @@ -158,17 +169,13 @@ cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_inf ogs_error("OpenAPI_presence_info_convertToJSON() failed [global_ran_node_id_list]"); goto end; } - - OpenAPI_lnode_t *global_ran_node_id_list_node; - if (presence_info->global_ran_node_id_list) { - OpenAPI_list_for_each(presence_info->global_ran_node_id_list, global_ran_node_id_list_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(global_ran_node_id_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_convertToJSON() failed [global_ran_node_id_list]"); - goto end; - } - cJSON_AddItemToArray(global_ran_node_id_listList, itemLocal); + OpenAPI_list_for_each(presence_info->global_ran_node_id_list, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [global_ran_node_id_list]"); + goto end; } + cJSON_AddItemToArray(global_ran_node_id_listList, itemLocal); } } @@ -178,17 +185,13 @@ cJSON *OpenAPI_presence_info_convertToJSON(OpenAPI_presence_info_t *presence_inf ogs_error("OpenAPI_presence_info_convertToJSON() failed [globale_nb_id_list]"); goto end; } - - OpenAPI_lnode_t *globale_nb_id_list_node; - if (presence_info->globale_nb_id_list) { - OpenAPI_list_for_each(presence_info->globale_nb_id_list, globale_nb_id_list_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(globale_nb_id_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_convertToJSON() failed [globale_nb_id_list]"); - goto end; - } - cJSON_AddItemToArray(globale_nb_id_listList, itemLocal); + OpenAPI_list_for_each(presence_info->globale_nb_id_list, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_convertToJSON() failed [globale_nb_id_list]"); + goto end; } + cJSON_AddItemToArray(globale_nb_id_listList, itemLocal); } } @@ -199,27 +202,38 @@ end: OpenAPI_presence_info_t *OpenAPI_presence_info_parseFromJSON(cJSON *presence_infoJSON) { OpenAPI_presence_info_t *presence_info_local_var = NULL; - cJSON *pra_id = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "praId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pra_id = NULL; + cJSON *additional_pra_id = NULL; + cJSON *presence_state = NULL; + OpenAPI_presence_state_e presence_stateVariable = 0; + cJSON *tracking_area_list = NULL; + OpenAPI_list_t *tracking_area_listList = NULL; + cJSON *ecgi_list = NULL; + OpenAPI_list_t *ecgi_listList = NULL; + cJSON *ncgi_list = NULL; + OpenAPI_list_t *ncgi_listList = NULL; + cJSON *global_ran_node_id_list = NULL; + OpenAPI_list_t *global_ran_node_id_listList = NULL; + cJSON *globale_nb_id_list = NULL; + OpenAPI_list_t *globale_nb_id_listList = NULL; + pra_id = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "praId"); if (pra_id) { - if (!cJSON_IsString(pra_id)) { + if (!cJSON_IsString(pra_id) && !cJSON_IsNull(pra_id)) { ogs_error("OpenAPI_presence_info_parseFromJSON() failed [pra_id]"); goto end; } } - cJSON *additional_pra_id = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "additionalPraId"); - + additional_pra_id = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "additionalPraId"); if (additional_pra_id) { - if (!cJSON_IsString(additional_pra_id)) { + if (!cJSON_IsString(additional_pra_id) && !cJSON_IsNull(additional_pra_id)) { ogs_error("OpenAPI_presence_info_parseFromJSON() failed [additional_pra_id]"); goto end; } } - cJSON *presence_state = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "presenceState"); - - OpenAPI_presence_state_e presence_stateVariable; + presence_state = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "presenceState"); if (presence_state) { if (!cJSON_IsString(presence_state)) { ogs_error("OpenAPI_presence_info_parseFromJSON() failed [presence_state]"); @@ -228,154 +242,134 @@ OpenAPI_presence_info_t *OpenAPI_presence_info_parseFromJSON(cJSON *presence_inf presence_stateVariable = OpenAPI_presence_state_FromString(presence_state->valuestring); } - cJSON *tracking_area_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "trackingAreaList"); - - OpenAPI_list_t *tracking_area_listList; + tracking_area_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "trackingAreaList"); if (tracking_area_list) { - cJSON *tracking_area_list_local_nonprimitive; - if (!cJSON_IsArray(tracking_area_list)){ - ogs_error("OpenAPI_presence_info_parseFromJSON() failed [tracking_area_list]"); - goto end; - } - - tracking_area_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tracking_area_list_local_nonprimitive, tracking_area_list ) { - if (!cJSON_IsObject(tracking_area_list_local_nonprimitive)) { + cJSON *tracking_area_list_local = NULL; + if (!cJSON_IsArray(tracking_area_list)) { ogs_error("OpenAPI_presence_info_parseFromJSON() failed [tracking_area_list]"); goto end; } - OpenAPI_tai_t *tracking_area_listItem = OpenAPI_tai_parseFromJSON(tracking_area_list_local_nonprimitive); - if (!tracking_area_listItem) { - ogs_error("No tracking_area_listItem"); - OpenAPI_list_free(tracking_area_listList); - goto end; + tracking_area_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tracking_area_list_local, tracking_area_list) { + if (!cJSON_IsObject(tracking_area_list_local)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [tracking_area_list]"); + goto end; + } + OpenAPI_tai_t *tracking_area_listItem = OpenAPI_tai_parseFromJSON(tracking_area_list_local); + if (!tracking_area_listItem) { + ogs_error("No tracking_area_listItem"); + OpenAPI_list_free(tracking_area_listList); + goto end; + } + OpenAPI_list_add(tracking_area_listList, tracking_area_listItem); } - - OpenAPI_list_add(tracking_area_listList, tracking_area_listItem); - } } - cJSON *ecgi_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "ecgiList"); - - OpenAPI_list_t *ecgi_listList; + ecgi_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "ecgiList"); if (ecgi_list) { - cJSON *ecgi_list_local_nonprimitive; - if (!cJSON_IsArray(ecgi_list)){ - ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ecgi_list]"); - goto end; - } - - ecgi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ecgi_list_local_nonprimitive, ecgi_list ) { - if (!cJSON_IsObject(ecgi_list_local_nonprimitive)) { + cJSON *ecgi_list_local = NULL; + if (!cJSON_IsArray(ecgi_list)) { ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ecgi_list]"); goto end; } - OpenAPI_ecgi_t *ecgi_listItem = OpenAPI_ecgi_parseFromJSON(ecgi_list_local_nonprimitive); - if (!ecgi_listItem) { - ogs_error("No ecgi_listItem"); - OpenAPI_list_free(ecgi_listList); - goto end; + ecgi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ecgi_list_local, ecgi_list) { + if (!cJSON_IsObject(ecgi_list_local)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ecgi_list]"); + goto end; + } + OpenAPI_ecgi_t *ecgi_listItem = OpenAPI_ecgi_parseFromJSON(ecgi_list_local); + if (!ecgi_listItem) { + ogs_error("No ecgi_listItem"); + OpenAPI_list_free(ecgi_listList); + goto end; + } + OpenAPI_list_add(ecgi_listList, ecgi_listItem); } - - OpenAPI_list_add(ecgi_listList, ecgi_listItem); - } } - cJSON *ncgi_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "ncgiList"); - - OpenAPI_list_t *ncgi_listList; + ncgi_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "ncgiList"); if (ncgi_list) { - cJSON *ncgi_list_local_nonprimitive; - if (!cJSON_IsArray(ncgi_list)){ - ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ncgi_list]"); - goto end; - } - - ncgi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ncgi_list_local_nonprimitive, ncgi_list ) { - if (!cJSON_IsObject(ncgi_list_local_nonprimitive)) { + cJSON *ncgi_list_local = NULL; + if (!cJSON_IsArray(ncgi_list)) { ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ncgi_list]"); goto end; } - OpenAPI_ncgi_t *ncgi_listItem = OpenAPI_ncgi_parseFromJSON(ncgi_list_local_nonprimitive); - if (!ncgi_listItem) { - ogs_error("No ncgi_listItem"); - OpenAPI_list_free(ncgi_listList); - goto end; + ncgi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ncgi_list_local, ncgi_list) { + if (!cJSON_IsObject(ncgi_list_local)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [ncgi_list]"); + goto end; + } + OpenAPI_ncgi_t *ncgi_listItem = OpenAPI_ncgi_parseFromJSON(ncgi_list_local); + if (!ncgi_listItem) { + ogs_error("No ncgi_listItem"); + OpenAPI_list_free(ncgi_listList); + goto end; + } + OpenAPI_list_add(ncgi_listList, ncgi_listItem); } - - OpenAPI_list_add(ncgi_listList, ncgi_listItem); - } } - cJSON *global_ran_node_id_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "globalRanNodeIdList"); - - OpenAPI_list_t *global_ran_node_id_listList; + global_ran_node_id_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "globalRanNodeIdList"); if (global_ran_node_id_list) { - cJSON *global_ran_node_id_list_local_nonprimitive; - if (!cJSON_IsArray(global_ran_node_id_list)){ - ogs_error("OpenAPI_presence_info_parseFromJSON() failed [global_ran_node_id_list]"); - goto end; - } - - global_ran_node_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(global_ran_node_id_list_local_nonprimitive, global_ran_node_id_list ) { - if (!cJSON_IsObject(global_ran_node_id_list_local_nonprimitive)) { + cJSON *global_ran_node_id_list_local = NULL; + if (!cJSON_IsArray(global_ran_node_id_list)) { ogs_error("OpenAPI_presence_info_parseFromJSON() failed [global_ran_node_id_list]"); goto end; } - OpenAPI_global_ran_node_id_t *global_ran_node_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_id_list_local_nonprimitive); - if (!global_ran_node_id_listItem) { - ogs_error("No global_ran_node_id_listItem"); - OpenAPI_list_free(global_ran_node_id_listList); - goto end; + global_ran_node_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(global_ran_node_id_list_local, global_ran_node_id_list) { + if (!cJSON_IsObject(global_ran_node_id_list_local)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [global_ran_node_id_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *global_ran_node_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_id_list_local); + if (!global_ran_node_id_listItem) { + ogs_error("No global_ran_node_id_listItem"); + OpenAPI_list_free(global_ran_node_id_listList); + goto end; + } + OpenAPI_list_add(global_ran_node_id_listList, global_ran_node_id_listItem); } - - OpenAPI_list_add(global_ran_node_id_listList, global_ran_node_id_listItem); - } } - cJSON *globale_nb_id_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "globaleNbIdList"); - - OpenAPI_list_t *globale_nb_id_listList; + globale_nb_id_list = cJSON_GetObjectItemCaseSensitive(presence_infoJSON, "globaleNbIdList"); if (globale_nb_id_list) { - cJSON *globale_nb_id_list_local_nonprimitive; - if (!cJSON_IsArray(globale_nb_id_list)){ - ogs_error("OpenAPI_presence_info_parseFromJSON() failed [globale_nb_id_list]"); - goto end; - } - - globale_nb_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(globale_nb_id_list_local_nonprimitive, globale_nb_id_list ) { - if (!cJSON_IsObject(globale_nb_id_list_local_nonprimitive)) { + cJSON *globale_nb_id_list_local = NULL; + if (!cJSON_IsArray(globale_nb_id_list)) { ogs_error("OpenAPI_presence_info_parseFromJSON() failed [globale_nb_id_list]"); goto end; } - OpenAPI_global_ran_node_id_t *globale_nb_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(globale_nb_id_list_local_nonprimitive); - if (!globale_nb_id_listItem) { - ogs_error("No globale_nb_id_listItem"); - OpenAPI_list_free(globale_nb_id_listList); - goto end; + globale_nb_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(globale_nb_id_list_local, globale_nb_id_list) { + if (!cJSON_IsObject(globale_nb_id_list_local)) { + ogs_error("OpenAPI_presence_info_parseFromJSON() failed [globale_nb_id_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *globale_nb_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(globale_nb_id_list_local); + if (!globale_nb_id_listItem) { + ogs_error("No globale_nb_id_listItem"); + OpenAPI_list_free(globale_nb_id_listList); + goto end; + } + OpenAPI_list_add(globale_nb_id_listList, globale_nb_id_listItem); } - - OpenAPI_list_add(globale_nb_id_listList, globale_nb_id_listItem); - } } presence_info_local_var = OpenAPI_presence_info_create ( - pra_id ? ogs_strdup(pra_id->valuestring) : NULL, - additional_pra_id ? ogs_strdup(additional_pra_id->valuestring) : NULL, + pra_id && !cJSON_IsNull(pra_id) ? ogs_strdup(pra_id->valuestring) : NULL, + additional_pra_id && !cJSON_IsNull(additional_pra_id) ? ogs_strdup(additional_pra_id->valuestring) : NULL, presence_state ? presence_stateVariable : 0, tracking_area_list ? tracking_area_listList : NULL, ecgi_list ? ecgi_listList : NULL, @@ -386,6 +380,41 @@ OpenAPI_presence_info_t *OpenAPI_presence_info_parseFromJSON(cJSON *presence_inf return presence_info_local_var; end: + if (tracking_area_listList) { + OpenAPI_list_for_each(tracking_area_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tracking_area_listList); + tracking_area_listList = NULL; + } + if (ecgi_listList) { + OpenAPI_list_for_each(ecgi_listList, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(ecgi_listList); + ecgi_listList = NULL; + } + if (ncgi_listList) { + OpenAPI_list_for_each(ncgi_listList, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(ncgi_listList); + ncgi_listList = NULL; + } + if (global_ran_node_id_listList) { + OpenAPI_list_for_each(global_ran_node_id_listList, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(global_ran_node_id_listList); + global_ran_node_id_listList = NULL; + } + if (globale_nb_id_listList) { + OpenAPI_list_for_each(globale_nb_id_listList, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(globale_nb_id_listList); + globale_nb_id_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/presence_info_rm.c b/lib/sbi/openapi/model/presence_info_rm.c index bd295f311..5889cc65c 100644 --- a/lib/sbi/openapi/model/presence_info_rm.c +++ b/lib/sbi/openapi/model/presence_info_rm.c @@ -32,38 +32,61 @@ OpenAPI_presence_info_rm_t *OpenAPI_presence_info_rm_create( void OpenAPI_presence_info_rm_free(OpenAPI_presence_info_rm_t *presence_info_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == presence_info_rm) { return; } - OpenAPI_lnode_t *node; - ogs_free(presence_info_rm->pra_id); - ogs_free(presence_info_rm->additional_pra_id); - OpenAPI_list_for_each(presence_info_rm->tracking_area_list, node) { - OpenAPI_tai_free(node->data); + if (presence_info_rm->pra_id) { + ogs_free(presence_info_rm->pra_id); + presence_info_rm->pra_id = NULL; } - OpenAPI_list_free(presence_info_rm->tracking_area_list); - OpenAPI_list_for_each(presence_info_rm->ecgi_list, node) { - OpenAPI_ecgi_free(node->data); + if (presence_info_rm->additional_pra_id) { + ogs_free(presence_info_rm->additional_pra_id); + presence_info_rm->additional_pra_id = NULL; } - OpenAPI_list_free(presence_info_rm->ecgi_list); - OpenAPI_list_for_each(presence_info_rm->ncgi_list, node) { - OpenAPI_ncgi_free(node->data); + if (presence_info_rm->tracking_area_list) { + OpenAPI_list_for_each(presence_info_rm->tracking_area_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(presence_info_rm->tracking_area_list); + presence_info_rm->tracking_area_list = NULL; } - OpenAPI_list_free(presence_info_rm->ncgi_list); - OpenAPI_list_for_each(presence_info_rm->global_ran_node_id_list, node) { - OpenAPI_global_ran_node_id_free(node->data); + if (presence_info_rm->ecgi_list) { + OpenAPI_list_for_each(presence_info_rm->ecgi_list, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(presence_info_rm->ecgi_list); + presence_info_rm->ecgi_list = NULL; } - OpenAPI_list_free(presence_info_rm->global_ran_node_id_list); - OpenAPI_list_for_each(presence_info_rm->globale_nb_id_list, node) { - OpenAPI_global_ran_node_id_free(node->data); + if (presence_info_rm->ncgi_list) { + OpenAPI_list_for_each(presence_info_rm->ncgi_list, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(presence_info_rm->ncgi_list); + presence_info_rm->ncgi_list = NULL; + } + if (presence_info_rm->global_ran_node_id_list) { + OpenAPI_list_for_each(presence_info_rm->global_ran_node_id_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(presence_info_rm->global_ran_node_id_list); + presence_info_rm->global_ran_node_id_list = NULL; + } + if (presence_info_rm->globale_nb_id_list) { + OpenAPI_list_for_each(presence_info_rm->globale_nb_id_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(presence_info_rm->globale_nb_id_list); + presence_info_rm->globale_nb_id_list = NULL; } - OpenAPI_list_free(presence_info_rm->globale_nb_id_list); ogs_free(presence_info_rm); } cJSON *OpenAPI_presence_info_rm_convertToJSON(OpenAPI_presence_info_rm_t *presence_info_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (presence_info_rm == NULL) { ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [PresenceInfoRm]"); @@ -85,7 +108,7 @@ cJSON *OpenAPI_presence_info_rm_convertToJSON(OpenAPI_presence_info_rm_t *presen } } - if (presence_info_rm->presence_state) { + if (presence_info_rm->presence_state != OpenAPI_presence_state_NULL) { if (cJSON_AddStringToObject(item, "presenceState", OpenAPI_presence_state_ToString(presence_info_rm->presence_state)) == NULL) { ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [presence_state]"); goto end; @@ -98,17 +121,13 @@ cJSON *OpenAPI_presence_info_rm_convertToJSON(OpenAPI_presence_info_rm_t *presen ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [tracking_area_list]"); goto end; } - - OpenAPI_lnode_t *tracking_area_list_node; - if (presence_info_rm->tracking_area_list) { - OpenAPI_list_for_each(presence_info_rm->tracking_area_list, tracking_area_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tracking_area_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [tracking_area_list]"); - goto end; - } - cJSON_AddItemToArray(tracking_area_listList, itemLocal); + OpenAPI_list_for_each(presence_info_rm->tracking_area_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [tracking_area_list]"); + goto end; } + cJSON_AddItemToArray(tracking_area_listList, itemLocal); } } @@ -118,17 +137,13 @@ cJSON *OpenAPI_presence_info_rm_convertToJSON(OpenAPI_presence_info_rm_t *presen ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [ecgi_list]"); goto end; } - - OpenAPI_lnode_t *ecgi_list_node; - if (presence_info_rm->ecgi_list) { - OpenAPI_list_for_each(presence_info_rm->ecgi_list, ecgi_list_node) { - cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(ecgi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [ecgi_list]"); - goto end; - } - cJSON_AddItemToArray(ecgi_listList, itemLocal); + OpenAPI_list_for_each(presence_info_rm->ecgi_list, node) { + cJSON *itemLocal = OpenAPI_ecgi_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [ecgi_list]"); + goto end; } + cJSON_AddItemToArray(ecgi_listList, itemLocal); } } @@ -138,17 +153,13 @@ cJSON *OpenAPI_presence_info_rm_convertToJSON(OpenAPI_presence_info_rm_t *presen ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [ncgi_list]"); goto end; } - - OpenAPI_lnode_t *ncgi_list_node; - if (presence_info_rm->ncgi_list) { - OpenAPI_list_for_each(presence_info_rm->ncgi_list, ncgi_list_node) { - cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(ncgi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [ncgi_list]"); - goto end; - } - cJSON_AddItemToArray(ncgi_listList, itemLocal); + OpenAPI_list_for_each(presence_info_rm->ncgi_list, node) { + cJSON *itemLocal = OpenAPI_ncgi_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [ncgi_list]"); + goto end; } + cJSON_AddItemToArray(ncgi_listList, itemLocal); } } @@ -158,17 +169,13 @@ cJSON *OpenAPI_presence_info_rm_convertToJSON(OpenAPI_presence_info_rm_t *presen ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [global_ran_node_id_list]"); goto end; } - - OpenAPI_lnode_t *global_ran_node_id_list_node; - if (presence_info_rm->global_ran_node_id_list) { - OpenAPI_list_for_each(presence_info_rm->global_ran_node_id_list, global_ran_node_id_list_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(global_ran_node_id_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [global_ran_node_id_list]"); - goto end; - } - cJSON_AddItemToArray(global_ran_node_id_listList, itemLocal); + OpenAPI_list_for_each(presence_info_rm->global_ran_node_id_list, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [global_ran_node_id_list]"); + goto end; } + cJSON_AddItemToArray(global_ran_node_id_listList, itemLocal); } } @@ -178,17 +185,13 @@ cJSON *OpenAPI_presence_info_rm_convertToJSON(OpenAPI_presence_info_rm_t *presen ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [globale_nb_id_list]"); goto end; } - - OpenAPI_lnode_t *globale_nb_id_list_node; - if (presence_info_rm->globale_nb_id_list) { - OpenAPI_list_for_each(presence_info_rm->globale_nb_id_list, globale_nb_id_list_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(globale_nb_id_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [globale_nb_id_list]"); - goto end; - } - cJSON_AddItemToArray(globale_nb_id_listList, itemLocal); + OpenAPI_list_for_each(presence_info_rm->globale_nb_id_list, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_presence_info_rm_convertToJSON() failed [globale_nb_id_list]"); + goto end; } + cJSON_AddItemToArray(globale_nb_id_listList, itemLocal); } } @@ -199,27 +202,38 @@ end: OpenAPI_presence_info_rm_t *OpenAPI_presence_info_rm_parseFromJSON(cJSON *presence_info_rmJSON) { OpenAPI_presence_info_rm_t *presence_info_rm_local_var = NULL; - cJSON *pra_id = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "praId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pra_id = NULL; + cJSON *additional_pra_id = NULL; + cJSON *presence_state = NULL; + OpenAPI_presence_state_e presence_stateVariable = 0; + cJSON *tracking_area_list = NULL; + OpenAPI_list_t *tracking_area_listList = NULL; + cJSON *ecgi_list = NULL; + OpenAPI_list_t *ecgi_listList = NULL; + cJSON *ncgi_list = NULL; + OpenAPI_list_t *ncgi_listList = NULL; + cJSON *global_ran_node_id_list = NULL; + OpenAPI_list_t *global_ran_node_id_listList = NULL; + cJSON *globale_nb_id_list = NULL; + OpenAPI_list_t *globale_nb_id_listList = NULL; + pra_id = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "praId"); if (pra_id) { - if (!cJSON_IsString(pra_id)) { + if (!cJSON_IsString(pra_id) && !cJSON_IsNull(pra_id)) { ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [pra_id]"); goto end; } } - cJSON *additional_pra_id = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "additionalPraId"); - + additional_pra_id = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "additionalPraId"); if (additional_pra_id) { - if (!cJSON_IsString(additional_pra_id)) { + if (!cJSON_IsString(additional_pra_id) && !cJSON_IsNull(additional_pra_id)) { ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [additional_pra_id]"); goto end; } } - cJSON *presence_state = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "presenceState"); - - OpenAPI_presence_state_e presence_stateVariable; + presence_state = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "presenceState"); if (presence_state) { if (!cJSON_IsString(presence_state)) { ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [presence_state]"); @@ -228,154 +242,134 @@ OpenAPI_presence_info_rm_t *OpenAPI_presence_info_rm_parseFromJSON(cJSON *presen presence_stateVariable = OpenAPI_presence_state_FromString(presence_state->valuestring); } - cJSON *tracking_area_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "trackingAreaList"); - - OpenAPI_list_t *tracking_area_listList; + tracking_area_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "trackingAreaList"); if (tracking_area_list) { - cJSON *tracking_area_list_local_nonprimitive; - if (!cJSON_IsArray(tracking_area_list)){ - ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [tracking_area_list]"); - goto end; - } - - tracking_area_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tracking_area_list_local_nonprimitive, tracking_area_list ) { - if (!cJSON_IsObject(tracking_area_list_local_nonprimitive)) { + cJSON *tracking_area_list_local = NULL; + if (!cJSON_IsArray(tracking_area_list)) { ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [tracking_area_list]"); goto end; } - OpenAPI_tai_t *tracking_area_listItem = OpenAPI_tai_parseFromJSON(tracking_area_list_local_nonprimitive); - if (!tracking_area_listItem) { - ogs_error("No tracking_area_listItem"); - OpenAPI_list_free(tracking_area_listList); - goto end; + tracking_area_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tracking_area_list_local, tracking_area_list) { + if (!cJSON_IsObject(tracking_area_list_local)) { + ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [tracking_area_list]"); + goto end; + } + OpenAPI_tai_t *tracking_area_listItem = OpenAPI_tai_parseFromJSON(tracking_area_list_local); + if (!tracking_area_listItem) { + ogs_error("No tracking_area_listItem"); + OpenAPI_list_free(tracking_area_listList); + goto end; + } + OpenAPI_list_add(tracking_area_listList, tracking_area_listItem); } - - OpenAPI_list_add(tracking_area_listList, tracking_area_listItem); - } } - cJSON *ecgi_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "ecgiList"); - - OpenAPI_list_t *ecgi_listList; + ecgi_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "ecgiList"); if (ecgi_list) { - cJSON *ecgi_list_local_nonprimitive; - if (!cJSON_IsArray(ecgi_list)){ - ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [ecgi_list]"); - goto end; - } - - ecgi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ecgi_list_local_nonprimitive, ecgi_list ) { - if (!cJSON_IsObject(ecgi_list_local_nonprimitive)) { + cJSON *ecgi_list_local = NULL; + if (!cJSON_IsArray(ecgi_list)) { ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [ecgi_list]"); goto end; } - OpenAPI_ecgi_t *ecgi_listItem = OpenAPI_ecgi_parseFromJSON(ecgi_list_local_nonprimitive); - if (!ecgi_listItem) { - ogs_error("No ecgi_listItem"); - OpenAPI_list_free(ecgi_listList); - goto end; + ecgi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ecgi_list_local, ecgi_list) { + if (!cJSON_IsObject(ecgi_list_local)) { + ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [ecgi_list]"); + goto end; + } + OpenAPI_ecgi_t *ecgi_listItem = OpenAPI_ecgi_parseFromJSON(ecgi_list_local); + if (!ecgi_listItem) { + ogs_error("No ecgi_listItem"); + OpenAPI_list_free(ecgi_listList); + goto end; + } + OpenAPI_list_add(ecgi_listList, ecgi_listItem); } - - OpenAPI_list_add(ecgi_listList, ecgi_listItem); - } } - cJSON *ncgi_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "ncgiList"); - - OpenAPI_list_t *ncgi_listList; + ncgi_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "ncgiList"); if (ncgi_list) { - cJSON *ncgi_list_local_nonprimitive; - if (!cJSON_IsArray(ncgi_list)){ - ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [ncgi_list]"); - goto end; - } - - ncgi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ncgi_list_local_nonprimitive, ncgi_list ) { - if (!cJSON_IsObject(ncgi_list_local_nonprimitive)) { + cJSON *ncgi_list_local = NULL; + if (!cJSON_IsArray(ncgi_list)) { ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [ncgi_list]"); goto end; } - OpenAPI_ncgi_t *ncgi_listItem = OpenAPI_ncgi_parseFromJSON(ncgi_list_local_nonprimitive); - if (!ncgi_listItem) { - ogs_error("No ncgi_listItem"); - OpenAPI_list_free(ncgi_listList); - goto end; + ncgi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ncgi_list_local, ncgi_list) { + if (!cJSON_IsObject(ncgi_list_local)) { + ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [ncgi_list]"); + goto end; + } + OpenAPI_ncgi_t *ncgi_listItem = OpenAPI_ncgi_parseFromJSON(ncgi_list_local); + if (!ncgi_listItem) { + ogs_error("No ncgi_listItem"); + OpenAPI_list_free(ncgi_listList); + goto end; + } + OpenAPI_list_add(ncgi_listList, ncgi_listItem); } - - OpenAPI_list_add(ncgi_listList, ncgi_listItem); - } } - cJSON *global_ran_node_id_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "globalRanNodeIdList"); - - OpenAPI_list_t *global_ran_node_id_listList; + global_ran_node_id_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "globalRanNodeIdList"); if (global_ran_node_id_list) { - cJSON *global_ran_node_id_list_local_nonprimitive; - if (!cJSON_IsArray(global_ran_node_id_list)){ - ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [global_ran_node_id_list]"); - goto end; - } - - global_ran_node_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(global_ran_node_id_list_local_nonprimitive, global_ran_node_id_list ) { - if (!cJSON_IsObject(global_ran_node_id_list_local_nonprimitive)) { + cJSON *global_ran_node_id_list_local = NULL; + if (!cJSON_IsArray(global_ran_node_id_list)) { ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [global_ran_node_id_list]"); goto end; } - OpenAPI_global_ran_node_id_t *global_ran_node_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_id_list_local_nonprimitive); - if (!global_ran_node_id_listItem) { - ogs_error("No global_ran_node_id_listItem"); - OpenAPI_list_free(global_ran_node_id_listList); - goto end; + global_ran_node_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(global_ran_node_id_list_local, global_ran_node_id_list) { + if (!cJSON_IsObject(global_ran_node_id_list_local)) { + ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [global_ran_node_id_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *global_ran_node_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(global_ran_node_id_list_local); + if (!global_ran_node_id_listItem) { + ogs_error("No global_ran_node_id_listItem"); + OpenAPI_list_free(global_ran_node_id_listList); + goto end; + } + OpenAPI_list_add(global_ran_node_id_listList, global_ran_node_id_listItem); } - - OpenAPI_list_add(global_ran_node_id_listList, global_ran_node_id_listItem); - } } - cJSON *globale_nb_id_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "globaleNbIdList"); - - OpenAPI_list_t *globale_nb_id_listList; + globale_nb_id_list = cJSON_GetObjectItemCaseSensitive(presence_info_rmJSON, "globaleNbIdList"); if (globale_nb_id_list) { - cJSON *globale_nb_id_list_local_nonprimitive; - if (!cJSON_IsArray(globale_nb_id_list)){ - ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [globale_nb_id_list]"); - goto end; - } - - globale_nb_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(globale_nb_id_list_local_nonprimitive, globale_nb_id_list ) { - if (!cJSON_IsObject(globale_nb_id_list_local_nonprimitive)) { + cJSON *globale_nb_id_list_local = NULL; + if (!cJSON_IsArray(globale_nb_id_list)) { ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [globale_nb_id_list]"); goto end; } - OpenAPI_global_ran_node_id_t *globale_nb_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(globale_nb_id_list_local_nonprimitive); - if (!globale_nb_id_listItem) { - ogs_error("No globale_nb_id_listItem"); - OpenAPI_list_free(globale_nb_id_listList); - goto end; + globale_nb_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(globale_nb_id_list_local, globale_nb_id_list) { + if (!cJSON_IsObject(globale_nb_id_list_local)) { + ogs_error("OpenAPI_presence_info_rm_parseFromJSON() failed [globale_nb_id_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *globale_nb_id_listItem = OpenAPI_global_ran_node_id_parseFromJSON(globale_nb_id_list_local); + if (!globale_nb_id_listItem) { + ogs_error("No globale_nb_id_listItem"); + OpenAPI_list_free(globale_nb_id_listList); + goto end; + } + OpenAPI_list_add(globale_nb_id_listList, globale_nb_id_listItem); } - - OpenAPI_list_add(globale_nb_id_listList, globale_nb_id_listItem); - } } presence_info_rm_local_var = OpenAPI_presence_info_rm_create ( - pra_id ? ogs_strdup(pra_id->valuestring) : NULL, - additional_pra_id ? ogs_strdup(additional_pra_id->valuestring) : NULL, + pra_id && !cJSON_IsNull(pra_id) ? ogs_strdup(pra_id->valuestring) : NULL, + additional_pra_id && !cJSON_IsNull(additional_pra_id) ? ogs_strdup(additional_pra_id->valuestring) : NULL, presence_state ? presence_stateVariable : 0, tracking_area_list ? tracking_area_listList : NULL, ecgi_list ? ecgi_listList : NULL, @@ -386,6 +380,41 @@ OpenAPI_presence_info_rm_t *OpenAPI_presence_info_rm_parseFromJSON(cJSON *presen return presence_info_rm_local_var; end: + if (tracking_area_listList) { + OpenAPI_list_for_each(tracking_area_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tracking_area_listList); + tracking_area_listList = NULL; + } + if (ecgi_listList) { + OpenAPI_list_for_each(ecgi_listList, node) { + OpenAPI_ecgi_free(node->data); + } + OpenAPI_list_free(ecgi_listList); + ecgi_listList = NULL; + } + if (ncgi_listList) { + OpenAPI_list_for_each(ncgi_listList, node) { + OpenAPI_ncgi_free(node->data); + } + OpenAPI_list_free(ncgi_listList); + ncgi_listList = NULL; + } + if (global_ran_node_id_listList) { + OpenAPI_list_for_each(global_ran_node_id_listList, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(global_ran_node_id_listList); + global_ran_node_id_listList = NULL; + } + if (globale_nb_id_listList) { + OpenAPI_list_for_each(globale_nb_id_listList, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(globale_nb_id_listList); + globale_nb_id_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/problem_details.c b/lib/sbi/openapi/model/problem_details.c index c9f034ef2..40feeee5e 100644 --- a/lib/sbi/openapi/model/problem_details.c +++ b/lib/sbi/openapi/model/problem_details.c @@ -40,29 +40,61 @@ OpenAPI_problem_details_t *OpenAPI_problem_details_create( void OpenAPI_problem_details_free(OpenAPI_problem_details_t *problem_details) { + OpenAPI_lnode_t *node = NULL; + if (NULL == problem_details) { return; } - OpenAPI_lnode_t *node; - ogs_free(problem_details->type); - ogs_free(problem_details->title); - ogs_free(problem_details->detail); - ogs_free(problem_details->instance); - ogs_free(problem_details->cause); - OpenAPI_list_for_each(problem_details->invalid_params, node) { - OpenAPI_invalid_param_free(node->data); + if (problem_details->type) { + ogs_free(problem_details->type); + problem_details->type = NULL; + } + if (problem_details->title) { + ogs_free(problem_details->title); + problem_details->title = NULL; + } + if (problem_details->detail) { + ogs_free(problem_details->detail); + problem_details->detail = NULL; + } + if (problem_details->instance) { + ogs_free(problem_details->instance); + problem_details->instance = NULL; + } + if (problem_details->cause) { + ogs_free(problem_details->cause); + problem_details->cause = NULL; + } + if (problem_details->invalid_params) { + OpenAPI_list_for_each(problem_details->invalid_params, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(problem_details->invalid_params); + problem_details->invalid_params = NULL; + } + if (problem_details->supported_features) { + ogs_free(problem_details->supported_features); + problem_details->supported_features = NULL; + } + if (problem_details->access_token_error) { + OpenAPI_access_token_err_free(problem_details->access_token_error); + problem_details->access_token_error = NULL; + } + if (problem_details->access_token_request) { + OpenAPI_access_token_req_free(problem_details->access_token_request); + problem_details->access_token_request = NULL; + } + if (problem_details->nrf_id) { + ogs_free(problem_details->nrf_id); + problem_details->nrf_id = NULL; } - OpenAPI_list_free(problem_details->invalid_params); - ogs_free(problem_details->supported_features); - OpenAPI_access_token_err_free(problem_details->access_token_error); - OpenAPI_access_token_req_free(problem_details->access_token_request); - ogs_free(problem_details->nrf_id); ogs_free(problem_details); } cJSON *OpenAPI_problem_details_convertToJSON(OpenAPI_problem_details_t *problem_details) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (problem_details == NULL) { ogs_error("OpenAPI_problem_details_convertToJSON() failed [ProblemDetails]"); @@ -118,17 +150,13 @@ cJSON *OpenAPI_problem_details_convertToJSON(OpenAPI_problem_details_t *problem_ ogs_error("OpenAPI_problem_details_convertToJSON() failed [invalid_params]"); goto end; } - - OpenAPI_lnode_t *invalid_params_node; - if (problem_details->invalid_params) { - OpenAPI_list_for_each(problem_details->invalid_params, invalid_params_node) { - cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(invalid_params_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_problem_details_convertToJSON() failed [invalid_params]"); - goto end; - } - cJSON_AddItemToArray(invalid_paramsList, itemLocal); + OpenAPI_list_for_each(problem_details->invalid_params, node) { + cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_problem_details_convertToJSON() failed [invalid_params]"); + goto end; } + cJSON_AddItemToArray(invalid_paramsList, itemLocal); } } @@ -179,26 +207,38 @@ end: OpenAPI_problem_details_t *OpenAPI_problem_details_parseFromJSON(cJSON *problem_detailsJSON) { OpenAPI_problem_details_t *problem_details_local_var = NULL; - cJSON *type = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "type"); - + OpenAPI_lnode_t *node = NULL; + cJSON *type = NULL; + cJSON *title = NULL; + cJSON *status = NULL; + cJSON *detail = NULL; + cJSON *instance = NULL; + cJSON *cause = NULL; + cJSON *invalid_params = NULL; + OpenAPI_list_t *invalid_paramsList = NULL; + cJSON *supported_features = NULL; + cJSON *access_token_error = NULL; + OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + cJSON *access_token_request = NULL; + OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + cJSON *nrf_id = NULL; + type = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "type"); if (type) { - if (!cJSON_IsString(type)) { + if (!cJSON_IsString(type) && !cJSON_IsNull(type)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [type]"); goto end; } } - cJSON *title = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "title"); - + title = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "title"); if (title) { - if (!cJSON_IsString(title)) { + if (!cJSON_IsString(title) && !cJSON_IsNull(title)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [title]"); goto end; } } - cJSON *status = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "status"); - + status = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "status"); if (status) { if (!cJSON_IsNumber(status)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [status]"); @@ -206,111 +246,113 @@ OpenAPI_problem_details_t *OpenAPI_problem_details_parseFromJSON(cJSON *problem_ } } - cJSON *detail = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "detail"); - + detail = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "detail"); if (detail) { - if (!cJSON_IsString(detail)) { + if (!cJSON_IsString(detail) && !cJSON_IsNull(detail)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [detail]"); goto end; } } - cJSON *instance = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "instance"); - + instance = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "instance"); if (instance) { - if (!cJSON_IsString(instance)) { + if (!cJSON_IsString(instance) && !cJSON_IsNull(instance)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [instance]"); goto end; } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "cause"); - + cause = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "cause"); if (cause) { - if (!cJSON_IsString(cause)) { + if (!cJSON_IsString(cause) && !cJSON_IsNull(cause)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [cause]"); goto end; } } - cJSON *invalid_params = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "invalidParams"); - - OpenAPI_list_t *invalid_paramsList; + invalid_params = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "invalidParams"); if (invalid_params) { - cJSON *invalid_params_local_nonprimitive; - if (!cJSON_IsArray(invalid_params)){ - ogs_error("OpenAPI_problem_details_parseFromJSON() failed [invalid_params]"); - goto end; - } - - invalid_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(invalid_params_local_nonprimitive, invalid_params ) { - if (!cJSON_IsObject(invalid_params_local_nonprimitive)) { + cJSON *invalid_params_local = NULL; + if (!cJSON_IsArray(invalid_params)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [invalid_params]"); goto end; } - OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local_nonprimitive); - if (!invalid_paramsItem) { - ogs_error("No invalid_paramsItem"); - OpenAPI_list_free(invalid_paramsList); - goto end; + invalid_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(invalid_params_local, invalid_params) { + if (!cJSON_IsObject(invalid_params_local)) { + ogs_error("OpenAPI_problem_details_parseFromJSON() failed [invalid_params]"); + goto end; + } + OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local); + if (!invalid_paramsItem) { + ogs_error("No invalid_paramsItem"); + OpenAPI_list_free(invalid_paramsList); + goto end; + } + OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); } - - OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); - } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *access_token_error = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "accessTokenError"); - - OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + access_token_error = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "accessTokenError"); if (access_token_error) { access_token_error_local_nonprim = OpenAPI_access_token_err_parseFromJSON(access_token_error); } - cJSON *access_token_request = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "accessTokenRequest"); - - OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + access_token_request = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "accessTokenRequest"); if (access_token_request) { access_token_request_local_nonprim = OpenAPI_access_token_req_parseFromJSON(access_token_request); } - cJSON *nrf_id = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "nrfId"); - + nrf_id = cJSON_GetObjectItemCaseSensitive(problem_detailsJSON, "nrfId"); if (nrf_id) { - if (!cJSON_IsString(nrf_id)) { + if (!cJSON_IsString(nrf_id) && !cJSON_IsNull(nrf_id)) { ogs_error("OpenAPI_problem_details_parseFromJSON() failed [nrf_id]"); goto end; } } problem_details_local_var = OpenAPI_problem_details_create ( - type ? ogs_strdup(type->valuestring) : NULL, - title ? ogs_strdup(title->valuestring) : NULL, + type && !cJSON_IsNull(type) ? ogs_strdup(type->valuestring) : NULL, + title && !cJSON_IsNull(title) ? ogs_strdup(title->valuestring) : NULL, status ? true : false, status ? status->valuedouble : 0, - detail ? ogs_strdup(detail->valuestring) : NULL, - instance ? ogs_strdup(instance->valuestring) : NULL, - cause ? ogs_strdup(cause->valuestring) : NULL, + detail && !cJSON_IsNull(detail) ? ogs_strdup(detail->valuestring) : NULL, + instance && !cJSON_IsNull(instance) ? ogs_strdup(instance->valuestring) : NULL, + cause && !cJSON_IsNull(cause) ? ogs_strdup(cause->valuestring) : NULL, invalid_params ? invalid_paramsList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, access_token_error ? access_token_error_local_nonprim : NULL, access_token_request ? access_token_request_local_nonprim : NULL, - nrf_id ? ogs_strdup(nrf_id->valuestring) : NULL + nrf_id && !cJSON_IsNull(nrf_id) ? ogs_strdup(nrf_id->valuestring) : NULL ); return problem_details_local_var; end: + if (invalid_paramsList) { + OpenAPI_list_for_each(invalid_paramsList, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(invalid_paramsList); + invalid_paramsList = NULL; + } + if (access_token_error_local_nonprim) { + OpenAPI_access_token_err_free(access_token_error_local_nonprim); + access_token_error_local_nonprim = NULL; + } + if (access_token_request_local_nonprim) { + OpenAPI_access_token_req_free(access_token_request_local_nonprim); + access_token_request_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/problem_details_1.c b/lib/sbi/openapi/model/problem_details_1.c index 7f2787572..2f9f91afa 100644 --- a/lib/sbi/openapi/model/problem_details_1.c +++ b/lib/sbi/openapi/model/problem_details_1.c @@ -12,7 +12,11 @@ OpenAPI_problem_details_1_t *OpenAPI_problem_details_1_create( char *detail, char *instance, char *cause, - OpenAPI_list_t *invalid_params + OpenAPI_list_t *invalid_params, + char *supported_features, + OpenAPI_access_token_err_t *access_token_error, + OpenAPI_access_token_req_t *access_token_request, + char *nrf_id ) { OpenAPI_problem_details_1_t *problem_details_1_local_var = ogs_malloc(sizeof(OpenAPI_problem_details_1_t)); @@ -26,31 +30,71 @@ OpenAPI_problem_details_1_t *OpenAPI_problem_details_1_create( problem_details_1_local_var->instance = instance; problem_details_1_local_var->cause = cause; problem_details_1_local_var->invalid_params = invalid_params; + problem_details_1_local_var->supported_features = supported_features; + problem_details_1_local_var->access_token_error = access_token_error; + problem_details_1_local_var->access_token_request = access_token_request; + problem_details_1_local_var->nrf_id = nrf_id; return problem_details_1_local_var; } void OpenAPI_problem_details_1_free(OpenAPI_problem_details_1_t *problem_details_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == problem_details_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(problem_details_1->type); - ogs_free(problem_details_1->title); - ogs_free(problem_details_1->detail); - ogs_free(problem_details_1->instance); - ogs_free(problem_details_1->cause); - OpenAPI_list_for_each(problem_details_1->invalid_params, node) { - OpenAPI_invalid_param_1_free(node->data); + if (problem_details_1->type) { + ogs_free(problem_details_1->type); + problem_details_1->type = NULL; + } + if (problem_details_1->title) { + ogs_free(problem_details_1->title); + problem_details_1->title = NULL; + } + if (problem_details_1->detail) { + ogs_free(problem_details_1->detail); + problem_details_1->detail = NULL; + } + if (problem_details_1->instance) { + ogs_free(problem_details_1->instance); + problem_details_1->instance = NULL; + } + if (problem_details_1->cause) { + ogs_free(problem_details_1->cause); + problem_details_1->cause = NULL; + } + if (problem_details_1->invalid_params) { + OpenAPI_list_for_each(problem_details_1->invalid_params, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(problem_details_1->invalid_params); + problem_details_1->invalid_params = NULL; + } + if (problem_details_1->supported_features) { + ogs_free(problem_details_1->supported_features); + problem_details_1->supported_features = NULL; + } + if (problem_details_1->access_token_error) { + OpenAPI_access_token_err_free(problem_details_1->access_token_error); + problem_details_1->access_token_error = NULL; + } + if (problem_details_1->access_token_request) { + OpenAPI_access_token_req_free(problem_details_1->access_token_request); + problem_details_1->access_token_request = NULL; + } + if (problem_details_1->nrf_id) { + ogs_free(problem_details_1->nrf_id); + problem_details_1->nrf_id = NULL; } - OpenAPI_list_free(problem_details_1->invalid_params); ogs_free(problem_details_1); } cJSON *OpenAPI_problem_details_1_convertToJSON(OpenAPI_problem_details_1_t *problem_details_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (problem_details_1 == NULL) { ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [ProblemDetails_1]"); @@ -106,17 +150,53 @@ cJSON *OpenAPI_problem_details_1_convertToJSON(OpenAPI_problem_details_1_t *prob ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [invalid_params]"); goto end; } - - OpenAPI_lnode_t *invalid_params_node; - if (problem_details_1->invalid_params) { - OpenAPI_list_for_each(problem_details_1->invalid_params, invalid_params_node) { - cJSON *itemLocal = OpenAPI_invalid_param_1_convertToJSON(invalid_params_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [invalid_params]"); - goto end; - } - cJSON_AddItemToArray(invalid_paramsList, itemLocal); + OpenAPI_list_for_each(problem_details_1->invalid_params, node) { + cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [invalid_params]"); + goto end; } + cJSON_AddItemToArray(invalid_paramsList, itemLocal); + } + } + + if (problem_details_1->supported_features) { + if (cJSON_AddStringToObject(item, "supportedFeatures", problem_details_1->supported_features) == NULL) { + ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [supported_features]"); + goto end; + } + } + + if (problem_details_1->access_token_error) { + cJSON *access_token_error_local_JSON = OpenAPI_access_token_err_convertToJSON(problem_details_1->access_token_error); + if (access_token_error_local_JSON == NULL) { + ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [access_token_error]"); + goto end; + } + cJSON_AddItemToObject(item, "accessTokenError", access_token_error_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [access_token_error]"); + goto end; + } + } + + if (problem_details_1->access_token_request) { + cJSON *access_token_request_local_JSON = OpenAPI_access_token_req_convertToJSON(problem_details_1->access_token_request); + if (access_token_request_local_JSON == NULL) { + ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [access_token_request]"); + goto end; + } + cJSON_AddItemToObject(item, "accessTokenRequest", access_token_request_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [access_token_request]"); + goto end; + } + } + + if (problem_details_1->nrf_id) { + if (cJSON_AddStringToObject(item, "nrfId", problem_details_1->nrf_id) == NULL) { + ogs_error("OpenAPI_problem_details_1_convertToJSON() failed [nrf_id]"); + goto end; } } @@ -127,26 +207,38 @@ end: OpenAPI_problem_details_1_t *OpenAPI_problem_details_1_parseFromJSON(cJSON *problem_details_1JSON) { OpenAPI_problem_details_1_t *problem_details_1_local_var = NULL; - cJSON *type = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "type"); - + OpenAPI_lnode_t *node = NULL; + cJSON *type = NULL; + cJSON *title = NULL; + cJSON *status = NULL; + cJSON *detail = NULL; + cJSON *instance = NULL; + cJSON *cause = NULL; + cJSON *invalid_params = NULL; + OpenAPI_list_t *invalid_paramsList = NULL; + cJSON *supported_features = NULL; + cJSON *access_token_error = NULL; + OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + cJSON *access_token_request = NULL; + OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + cJSON *nrf_id = NULL; + type = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "type"); if (type) { - if (!cJSON_IsString(type)) { + if (!cJSON_IsString(type) && !cJSON_IsNull(type)) { ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [type]"); goto end; } } - cJSON *title = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "title"); - + title = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "title"); if (title) { - if (!cJSON_IsString(title)) { + if (!cJSON_IsString(title) && !cJSON_IsNull(title)) { ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [title]"); goto end; } } - cJSON *status = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "status"); - + status = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "status"); if (status) { if (!cJSON_IsNumber(status)) { ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [status]"); @@ -154,75 +246,113 @@ OpenAPI_problem_details_1_t *OpenAPI_problem_details_1_parseFromJSON(cJSON *prob } } - cJSON *detail = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "detail"); - + detail = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "detail"); if (detail) { - if (!cJSON_IsString(detail)) { + if (!cJSON_IsString(detail) && !cJSON_IsNull(detail)) { ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [detail]"); goto end; } } - cJSON *instance = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "instance"); - + instance = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "instance"); if (instance) { - if (!cJSON_IsString(instance)) { + if (!cJSON_IsString(instance) && !cJSON_IsNull(instance)) { ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [instance]"); goto end; } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "cause"); - + cause = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "cause"); if (cause) { - if (!cJSON_IsString(cause)) { + if (!cJSON_IsString(cause) && !cJSON_IsNull(cause)) { ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [cause]"); goto end; } } - cJSON *invalid_params = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "invalidParams"); - - OpenAPI_list_t *invalid_paramsList; + invalid_params = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "invalidParams"); if (invalid_params) { - cJSON *invalid_params_local_nonprimitive; - if (!cJSON_IsArray(invalid_params)){ - ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [invalid_params]"); - goto end; - } - - invalid_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(invalid_params_local_nonprimitive, invalid_params ) { - if (!cJSON_IsObject(invalid_params_local_nonprimitive)) { + cJSON *invalid_params_local = NULL; + if (!cJSON_IsArray(invalid_params)) { ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [invalid_params]"); goto end; } - OpenAPI_invalid_param_1_t *invalid_paramsItem = OpenAPI_invalid_param_1_parseFromJSON(invalid_params_local_nonprimitive); - if (!invalid_paramsItem) { - ogs_error("No invalid_paramsItem"); - OpenAPI_list_free(invalid_paramsList); - goto end; + invalid_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(invalid_params_local, invalid_params) { + if (!cJSON_IsObject(invalid_params_local)) { + ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [invalid_params]"); + goto end; + } + OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local); + if (!invalid_paramsItem) { + ogs_error("No invalid_paramsItem"); + OpenAPI_list_free(invalid_paramsList); + goto end; + } + OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); } + } - OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); + supported_features = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "supportedFeatures"); + if (supported_features) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { + ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [supported_features]"); + goto end; + } + } + + access_token_error = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "accessTokenError"); + if (access_token_error) { + access_token_error_local_nonprim = OpenAPI_access_token_err_parseFromJSON(access_token_error); + } + + access_token_request = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "accessTokenRequest"); + if (access_token_request) { + access_token_request_local_nonprim = OpenAPI_access_token_req_parseFromJSON(access_token_request); + } + + nrf_id = cJSON_GetObjectItemCaseSensitive(problem_details_1JSON, "nrfId"); + if (nrf_id) { + if (!cJSON_IsString(nrf_id) && !cJSON_IsNull(nrf_id)) { + ogs_error("OpenAPI_problem_details_1_parseFromJSON() failed [nrf_id]"); + goto end; } } problem_details_1_local_var = OpenAPI_problem_details_1_create ( - type ? ogs_strdup(type->valuestring) : NULL, - title ? ogs_strdup(title->valuestring) : NULL, + type && !cJSON_IsNull(type) ? ogs_strdup(type->valuestring) : NULL, + title && !cJSON_IsNull(title) ? ogs_strdup(title->valuestring) : NULL, status ? true : false, status ? status->valuedouble : 0, - detail ? ogs_strdup(detail->valuestring) : NULL, - instance ? ogs_strdup(instance->valuestring) : NULL, - cause ? ogs_strdup(cause->valuestring) : NULL, - invalid_params ? invalid_paramsList : NULL + detail && !cJSON_IsNull(detail) ? ogs_strdup(detail->valuestring) : NULL, + instance && !cJSON_IsNull(instance) ? ogs_strdup(instance->valuestring) : NULL, + cause && !cJSON_IsNull(cause) ? ogs_strdup(cause->valuestring) : NULL, + invalid_params ? invalid_paramsList : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, + access_token_error ? access_token_error_local_nonprim : NULL, + access_token_request ? access_token_request_local_nonprim : NULL, + nrf_id && !cJSON_IsNull(nrf_id) ? ogs_strdup(nrf_id->valuestring) : NULL ); return problem_details_1_local_var; end: + if (invalid_paramsList) { + OpenAPI_list_for_each(invalid_paramsList, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(invalid_paramsList); + invalid_paramsList = NULL; + } + if (access_token_error_local_nonprim) { + OpenAPI_access_token_err_free(access_token_error_local_nonprim); + access_token_error_local_nonprim = NULL; + } + if (access_token_request_local_nonprim) { + OpenAPI_access_token_req_free(access_token_request_local_nonprim); + access_token_request_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/problem_details_1.h b/lib/sbi/openapi/model/problem_details_1.h index d54ffbb68..3fc1f5ad8 100644 --- a/lib/sbi/openapi/model/problem_details_1.h +++ b/lib/sbi/openapi/model/problem_details_1.h @@ -12,7 +12,9 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "invalid_param_1.h" +#include "access_token_err.h" +#include "access_token_req.h" +#include "invalid_param.h" #ifdef __cplusplus extern "C" { @@ -28,6 +30,10 @@ typedef struct OpenAPI_problem_details_1_s { char *instance; char *cause; OpenAPI_list_t *invalid_params; + char *supported_features; + struct OpenAPI_access_token_err_s *access_token_error; + struct OpenAPI_access_token_req_s *access_token_request; + char *nrf_id; } OpenAPI_problem_details_1_t; OpenAPI_problem_details_1_t *OpenAPI_problem_details_1_create( @@ -38,7 +44,11 @@ OpenAPI_problem_details_1_t *OpenAPI_problem_details_1_create( char *detail, char *instance, char *cause, - OpenAPI_list_t *invalid_params + OpenAPI_list_t *invalid_params, + char *supported_features, + OpenAPI_access_token_err_t *access_token_error, + OpenAPI_access_token_req_t *access_token_request, + char *nrf_id ); void OpenAPI_problem_details_1_free(OpenAPI_problem_details_1_t *problem_details_1); OpenAPI_problem_details_1_t *OpenAPI_problem_details_1_parseFromJSON(cJSON *problem_details_1JSON); diff --git a/lib/sbi/openapi/model/problem_details_2.c b/lib/sbi/openapi/model/problem_details_2.c index 3f11d2d21..985513e7a 100644 --- a/lib/sbi/openapi/model/problem_details_2.c +++ b/lib/sbi/openapi/model/problem_details_2.c @@ -32,10 +32,11 @@ OpenAPI_problem_details_2_t *OpenAPI_problem_details_2_create( void OpenAPI_problem_details_2_free(OpenAPI_problem_details_2_t *problem_details_2) { + OpenAPI_lnode_t *node = NULL; + if (NULL == problem_details_2) { return; } - OpenAPI_lnode_t *node; if (problem_details_2->type) { ogs_free(problem_details_2->type); problem_details_2->type = NULL; @@ -69,6 +70,7 @@ void OpenAPI_problem_details_2_free(OpenAPI_problem_details_2_t *problem_details cJSON *OpenAPI_problem_details_2_convertToJSON(OpenAPI_problem_details_2_t *problem_details_2) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (problem_details_2 == NULL) { ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [ProblemDetails_2]"); @@ -124,17 +126,13 @@ cJSON *OpenAPI_problem_details_2_convertToJSON(OpenAPI_problem_details_2_t *prob ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [invalid_params]"); goto end; } - - OpenAPI_lnode_t *invalid_params_node; - if (problem_details_2->invalid_params) { - OpenAPI_list_for_each(problem_details_2->invalid_params, invalid_params_node) { - cJSON *itemLocal = OpenAPI_invalid_param_1_convertToJSON(invalid_params_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [invalid_params]"); - goto end; - } - cJSON_AddItemToArray(invalid_paramsList, itemLocal); + OpenAPI_list_for_each(problem_details_2->invalid_params, node) { + cJSON *itemLocal = OpenAPI_invalid_param_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_problem_details_2_convertToJSON() failed [invalid_params]"); + goto end; } + cJSON_AddItemToArray(invalid_paramsList, itemLocal); } } @@ -204,27 +202,25 @@ OpenAPI_problem_details_2_t *OpenAPI_problem_details_2_parseFromJSON(cJSON *prob invalid_params = cJSON_GetObjectItemCaseSensitive(problem_details_2JSON, "invalidParams"); if (invalid_params) { - cJSON *invalid_params_local_nonprimitive; - if (!cJSON_IsArray(invalid_params)){ + cJSON *invalid_params_local = NULL; + if (!cJSON_IsArray(invalid_params)) { ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [invalid_params]"); goto end; } invalid_paramsList = OpenAPI_list_create(); - cJSON_ArrayForEach(invalid_params_local_nonprimitive, invalid_params ) { - if (!cJSON_IsObject(invalid_params_local_nonprimitive)) { + cJSON_ArrayForEach(invalid_params_local, invalid_params) { + if (!cJSON_IsObject(invalid_params_local)) { ogs_error("OpenAPI_problem_details_2_parseFromJSON() failed [invalid_params]"); goto end; } - OpenAPI_invalid_param_1_t *invalid_paramsItem = OpenAPI_invalid_param_1_parseFromJSON(invalid_params_local_nonprimitive); - + OpenAPI_invalid_param_1_t *invalid_paramsItem = OpenAPI_invalid_param_1_parseFromJSON(invalid_params_local); if (!invalid_paramsItem) { ogs_error("No invalid_paramsItem"); OpenAPI_list_free(invalid_paramsList); goto end; } - OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); } } diff --git a/lib/sbi/openapi/model/problem_details_add_info.c b/lib/sbi/openapi/model/problem_details_add_info.c index a309835c6..fce0430b2 100644 --- a/lib/sbi/openapi/model/problem_details_add_info.c +++ b/lib/sbi/openapi/model/problem_details_add_info.c @@ -20,16 +20,18 @@ OpenAPI_problem_details_add_info_t *OpenAPI_problem_details_add_info_create( void OpenAPI_problem_details_add_info_free(OpenAPI_problem_details_add_info_t *problem_details_add_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == problem_details_add_info) { return; } - OpenAPI_lnode_t *node; ogs_free(problem_details_add_info); } cJSON *OpenAPI_problem_details_add_info_convertToJSON(OpenAPI_problem_details_add_info_t *problem_details_add_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (problem_details_add_info == NULL) { ogs_error("OpenAPI_problem_details_add_info_convertToJSON() failed [ProblemDetailsAddInfo]"); @@ -51,8 +53,9 @@ end: OpenAPI_problem_details_add_info_t *OpenAPI_problem_details_add_info_parseFromJSON(cJSON *problem_details_add_infoJSON) { OpenAPI_problem_details_add_info_t *problem_details_add_info_local_var = NULL; - cJSON *remote_error = cJSON_GetObjectItemCaseSensitive(problem_details_add_infoJSON, "remoteError"); - + OpenAPI_lnode_t *node = NULL; + cJSON *remote_error = NULL; + remote_error = cJSON_GetObjectItemCaseSensitive(problem_details_add_infoJSON, "remoteError"); if (remote_error) { if (!cJSON_IsBool(remote_error)) { ogs_error("OpenAPI_problem_details_add_info_parseFromJSON() failed [remote_error]"); diff --git a/lib/sbi/openapi/model/provisioned_data_sets.c b/lib/sbi/openapi/model/provisioned_data_sets.c index 3bb11acce..f89f7b406 100644 --- a/lib/sbi/openapi/model/provisioned_data_sets.c +++ b/lib/sbi/openapi/model/provisioned_data_sets.c @@ -36,29 +36,61 @@ OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_create( void OpenAPI_provisioned_data_sets_free(OpenAPI_provisioned_data_sets_t *provisioned_data_sets) { + OpenAPI_lnode_t *node = NULL; + if (NULL == provisioned_data_sets) { return; } - OpenAPI_lnode_t *node; - OpenAPI_access_and_mobility_subscription_data_free(provisioned_data_sets->am_data); - OpenAPI_smf_selection_subscription_data_free(provisioned_data_sets->smf_sel_data); - OpenAPI_sms_subscription_data_free(provisioned_data_sets->sms_subs_data); - OpenAPI_list_for_each(provisioned_data_sets->sm_data, node) { - OpenAPI_session_management_subscription_data_free(node->data); + if (provisioned_data_sets->am_data) { + OpenAPI_access_and_mobility_subscription_data_free(provisioned_data_sets->am_data); + provisioned_data_sets->am_data = NULL; + } + if (provisioned_data_sets->smf_sel_data) { + OpenAPI_smf_selection_subscription_data_free(provisioned_data_sets->smf_sel_data); + provisioned_data_sets->smf_sel_data = NULL; + } + if (provisioned_data_sets->sms_subs_data) { + OpenAPI_sms_subscription_data_free(provisioned_data_sets->sms_subs_data); + provisioned_data_sets->sms_subs_data = NULL; + } + if (provisioned_data_sets->sm_data) { + OpenAPI_list_for_each(provisioned_data_sets->sm_data, node) { + OpenAPI_session_management_subscription_data_free(node->data); + } + OpenAPI_list_free(provisioned_data_sets->sm_data); + provisioned_data_sets->sm_data = NULL; + } + if (provisioned_data_sets->trace_data) { + OpenAPI_trace_data_free(provisioned_data_sets->trace_data); + provisioned_data_sets->trace_data = NULL; + } + if (provisioned_data_sets->sms_mng_data) { + OpenAPI_sms_management_subscription_data_free(provisioned_data_sets->sms_mng_data); + provisioned_data_sets->sms_mng_data = NULL; + } + if (provisioned_data_sets->lcs_privacy_data) { + OpenAPI_lcs_privacy_data_free(provisioned_data_sets->lcs_privacy_data); + provisioned_data_sets->lcs_privacy_data = NULL; + } + if (provisioned_data_sets->lcs_mo_data) { + OpenAPI_lcs_mo_data_free(provisioned_data_sets->lcs_mo_data); + provisioned_data_sets->lcs_mo_data = NULL; + } + if (provisioned_data_sets->lcs_bca_data) { + OpenAPI_lcs_broadcast_assistance_types_data_free(provisioned_data_sets->lcs_bca_data); + provisioned_data_sets->lcs_bca_data = NULL; + } + if (provisioned_data_sets->v2x_data) { + OpenAPI_v2x_subscription_data_free(provisioned_data_sets->v2x_data); + provisioned_data_sets->v2x_data = NULL; } - OpenAPI_list_free(provisioned_data_sets->sm_data); - OpenAPI_trace_data_free(provisioned_data_sets->trace_data); - OpenAPI_sms_management_subscription_data_free(provisioned_data_sets->sms_mng_data); - OpenAPI_lcs_privacy_data_free(provisioned_data_sets->lcs_privacy_data); - OpenAPI_lcs_mo_data_free(provisioned_data_sets->lcs_mo_data); - OpenAPI_lcs_broadcast_assistance_types_data_free(provisioned_data_sets->lcs_bca_data); - OpenAPI_v2x_subscription_data_free(provisioned_data_sets->v2x_data); ogs_free(provisioned_data_sets); } cJSON *OpenAPI_provisioned_data_sets_convertToJSON(OpenAPI_provisioned_data_sets_t *provisioned_data_sets) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (provisioned_data_sets == NULL) { ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [ProvisionedDataSets]"); @@ -111,17 +143,13 @@ cJSON *OpenAPI_provisioned_data_sets_convertToJSON(OpenAPI_provisioned_data_sets ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sm_data]"); goto end; } - - OpenAPI_lnode_t *sm_data_node; - if (provisioned_data_sets->sm_data) { - OpenAPI_list_for_each(provisioned_data_sets->sm_data, sm_data_node) { - cJSON *itemLocal = OpenAPI_session_management_subscription_data_convertToJSON(sm_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sm_data]"); - goto end; - } - cJSON_AddItemToArray(sm_dataList, itemLocal); + OpenAPI_list_for_each(provisioned_data_sets->sm_data, node) { + cJSON *itemLocal = OpenAPI_session_management_subscription_data_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_provisioned_data_sets_convertToJSON() failed [sm_data]"); + goto end; } + cJSON_AddItemToArray(sm_dataList, itemLocal); } } @@ -210,94 +238,93 @@ end: OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_parseFromJSON(cJSON *provisioned_data_setsJSON) { OpenAPI_provisioned_data_sets_t *provisioned_data_sets_local_var = NULL; - cJSON *am_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "amData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *am_data = NULL; OpenAPI_access_and_mobility_subscription_data_t *am_data_local_nonprim = NULL; + cJSON *smf_sel_data = NULL; + OpenAPI_smf_selection_subscription_data_t *smf_sel_data_local_nonprim = NULL; + cJSON *sms_subs_data = NULL; + OpenAPI_sms_subscription_data_t *sms_subs_data_local_nonprim = NULL; + cJSON *sm_data = NULL; + OpenAPI_list_t *sm_dataList = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *sms_mng_data = NULL; + OpenAPI_sms_management_subscription_data_t *sms_mng_data_local_nonprim = NULL; + cJSON *lcs_privacy_data = NULL; + OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_nonprim = NULL; + cJSON *lcs_mo_data = NULL; + OpenAPI_lcs_mo_data_t *lcs_mo_data_local_nonprim = NULL; + cJSON *lcs_bca_data = NULL; + OpenAPI_lcs_broadcast_assistance_types_data_t *lcs_bca_data_local_nonprim = NULL; + cJSON *v2x_data = NULL; + OpenAPI_v2x_subscription_data_t *v2x_data_local_nonprim = NULL; + am_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "amData"); if (am_data) { am_data_local_nonprim = OpenAPI_access_and_mobility_subscription_data_parseFromJSON(am_data); } - cJSON *smf_sel_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smfSelData"); - - OpenAPI_smf_selection_subscription_data_t *smf_sel_data_local_nonprim = NULL; + smf_sel_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smfSelData"); if (smf_sel_data) { smf_sel_data_local_nonprim = OpenAPI_smf_selection_subscription_data_parseFromJSON(smf_sel_data); } - cJSON *sms_subs_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smsSubsData"); - - OpenAPI_sms_subscription_data_t *sms_subs_data_local_nonprim = NULL; + sms_subs_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smsSubsData"); if (sms_subs_data) { sms_subs_data_local_nonprim = OpenAPI_sms_subscription_data_parseFromJSON(sms_subs_data); } - cJSON *sm_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smData"); - - OpenAPI_list_t *sm_dataList; + sm_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smData"); if (sm_data) { - cJSON *sm_data_local_nonprimitive; - if (!cJSON_IsArray(sm_data)){ - ogs_error("OpenAPI_provisioned_data_sets_parseFromJSON() failed [sm_data]"); - goto end; - } - - sm_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sm_data_local_nonprimitive, sm_data ) { - if (!cJSON_IsObject(sm_data_local_nonprimitive)) { + cJSON *sm_data_local = NULL; + if (!cJSON_IsArray(sm_data)) { ogs_error("OpenAPI_provisioned_data_sets_parseFromJSON() failed [sm_data]"); goto end; } - OpenAPI_session_management_subscription_data_t *sm_dataItem = OpenAPI_session_management_subscription_data_parseFromJSON(sm_data_local_nonprimitive); - if (!sm_dataItem) { - ogs_error("No sm_dataItem"); - OpenAPI_list_free(sm_dataList); - goto end; + sm_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sm_data_local, sm_data) { + if (!cJSON_IsObject(sm_data_local)) { + ogs_error("OpenAPI_provisioned_data_sets_parseFromJSON() failed [sm_data]"); + goto end; + } + OpenAPI_session_management_subscription_data_t *sm_dataItem = OpenAPI_session_management_subscription_data_parseFromJSON(sm_data_local); + if (!sm_dataItem) { + ogs_error("No sm_dataItem"); + OpenAPI_list_free(sm_dataList); + goto end; + } + OpenAPI_list_add(sm_dataList, sm_dataItem); } - - OpenAPI_list_add(sm_dataList, sm_dataItem); - } } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *sms_mng_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smsMngData"); - - OpenAPI_sms_management_subscription_data_t *sms_mng_data_local_nonprim = NULL; + sms_mng_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "smsMngData"); if (sms_mng_data) { sms_mng_data_local_nonprim = OpenAPI_sms_management_subscription_data_parseFromJSON(sms_mng_data); } - cJSON *lcs_privacy_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "lcsPrivacyData"); - - OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_nonprim = NULL; + lcs_privacy_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "lcsPrivacyData"); if (lcs_privacy_data) { lcs_privacy_data_local_nonprim = OpenAPI_lcs_privacy_data_parseFromJSON(lcs_privacy_data); } - cJSON *lcs_mo_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "lcsMoData"); - - OpenAPI_lcs_mo_data_t *lcs_mo_data_local_nonprim = NULL; + lcs_mo_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "lcsMoData"); if (lcs_mo_data) { lcs_mo_data_local_nonprim = OpenAPI_lcs_mo_data_parseFromJSON(lcs_mo_data); } - cJSON *lcs_bca_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "lcsBcaData"); - - OpenAPI_lcs_broadcast_assistance_types_data_t *lcs_bca_data_local_nonprim = NULL; + lcs_bca_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "lcsBcaData"); if (lcs_bca_data) { lcs_bca_data_local_nonprim = OpenAPI_lcs_broadcast_assistance_types_data_parseFromJSON(lcs_bca_data); } - cJSON *v2x_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "v2xData"); - - OpenAPI_v2x_subscription_data_t *v2x_data_local_nonprim = NULL; + v2x_data = cJSON_GetObjectItemCaseSensitive(provisioned_data_setsJSON, "v2xData"); if (v2x_data) { v2x_data_local_nonprim = OpenAPI_v2x_subscription_data_parseFromJSON(v2x_data); } @@ -317,6 +344,49 @@ OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_parseFromJSON(cJS return provisioned_data_sets_local_var; end: + if (am_data_local_nonprim) { + OpenAPI_access_and_mobility_subscription_data_free(am_data_local_nonprim); + am_data_local_nonprim = NULL; + } + if (smf_sel_data_local_nonprim) { + OpenAPI_smf_selection_subscription_data_free(smf_sel_data_local_nonprim); + smf_sel_data_local_nonprim = NULL; + } + if (sms_subs_data_local_nonprim) { + OpenAPI_sms_subscription_data_free(sms_subs_data_local_nonprim); + sms_subs_data_local_nonprim = NULL; + } + if (sm_dataList) { + OpenAPI_list_for_each(sm_dataList, node) { + OpenAPI_session_management_subscription_data_free(node->data); + } + OpenAPI_list_free(sm_dataList); + sm_dataList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (sms_mng_data_local_nonprim) { + OpenAPI_sms_management_subscription_data_free(sms_mng_data_local_nonprim); + sms_mng_data_local_nonprim = NULL; + } + if (lcs_privacy_data_local_nonprim) { + OpenAPI_lcs_privacy_data_free(lcs_privacy_data_local_nonprim); + lcs_privacy_data_local_nonprim = NULL; + } + if (lcs_mo_data_local_nonprim) { + OpenAPI_lcs_mo_data_free(lcs_mo_data_local_nonprim); + lcs_mo_data_local_nonprim = NULL; + } + if (lcs_bca_data_local_nonprim) { + OpenAPI_lcs_broadcast_assistance_types_data_free(lcs_bca_data_local_nonprim); + lcs_bca_data_local_nonprim = NULL; + } + if (v2x_data_local_nonprim) { + OpenAPI_v2x_subscription_data_free(v2x_data_local_nonprim); + v2x_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/psa_information.c b/lib/sbi/openapi/model/psa_information.c index d36a8b7f6..874936ae4 100644 --- a/lib/sbi/openapi/model/psa_information.c +++ b/lib/sbi/openapi/model/psa_information.c @@ -24,22 +24,33 @@ OpenAPI_psa_information_t *OpenAPI_psa_information_create( void OpenAPI_psa_information_free(OpenAPI_psa_information_t *psa_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == psa_information) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(psa_information->dnai_list, node) { - ogs_free(node->data); + if (psa_information->dnai_list) { + OpenAPI_list_for_each(psa_information->dnai_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(psa_information->dnai_list); + psa_information->dnai_list = NULL; + } + if (psa_information->ue_ipv6_prefix) { + ogs_free(psa_information->ue_ipv6_prefix); + psa_information->ue_ipv6_prefix = NULL; + } + if (psa_information->psa_upf_id) { + ogs_free(psa_information->psa_upf_id); + psa_information->psa_upf_id = NULL; } - OpenAPI_list_free(psa_information->dnai_list); - ogs_free(psa_information->ue_ipv6_prefix); - ogs_free(psa_information->psa_upf_id); ogs_free(psa_information); } cJSON *OpenAPI_psa_information_convertToJSON(OpenAPI_psa_information_t *psa_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (psa_information == NULL) { ogs_error("OpenAPI_psa_information_convertToJSON() failed [PsaInformation]"); @@ -47,7 +58,7 @@ cJSON *OpenAPI_psa_information_convertToJSON(OpenAPI_psa_information_t *psa_info } item = cJSON_CreateObject(); - if (psa_information->psa_ind) { + if (psa_information->psa_ind != OpenAPI_psa_indication_NULL) { if (cJSON_AddStringToObject(item, "psaInd", OpenAPI_psa_indication_ToString(psa_information->psa_ind)) == NULL) { ogs_error("OpenAPI_psa_information_convertToJSON() failed [psa_ind]"); goto end; @@ -55,19 +66,17 @@ cJSON *OpenAPI_psa_information_convertToJSON(OpenAPI_psa_information_t *psa_info } if (psa_information->dnai_list) { - cJSON *dnai_list = cJSON_AddArrayToObject(item, "dnaiList"); - if (dnai_list == NULL) { + cJSON *dnai_listList = cJSON_AddArrayToObject(item, "dnaiList"); + if (dnai_listList == NULL) { ogs_error("OpenAPI_psa_information_convertToJSON() failed [dnai_list]"); goto end; } - - OpenAPI_lnode_t *dnai_list_node; - OpenAPI_list_for_each(psa_information->dnai_list, dnai_list_node) { - if (cJSON_AddStringToObject(dnai_list, "", (char*)dnai_list_node->data) == NULL) { - ogs_error("OpenAPI_psa_information_convertToJSON() failed [dnai_list]"); - goto end; + OpenAPI_list_for_each(psa_information->dnai_list, node) { + if (cJSON_AddStringToObject(dnai_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_psa_information_convertToJSON() failed [dnai_list]"); + goto end; + } } - } } if (psa_information->ue_ipv6_prefix) { @@ -91,9 +100,14 @@ end: OpenAPI_psa_information_t *OpenAPI_psa_information_parseFromJSON(cJSON *psa_informationJSON) { OpenAPI_psa_information_t *psa_information_local_var = NULL; - cJSON *psa_ind = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "psaInd"); - - OpenAPI_psa_indication_e psa_indVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *psa_ind = NULL; + OpenAPI_psa_indication_e psa_indVariable = 0; + cJSON *dnai_list = NULL; + OpenAPI_list_t *dnai_listList = NULL; + cJSON *ue_ipv6_prefix = NULL; + cJSON *psa_upf_id = NULL; + psa_ind = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "psaInd"); if (psa_ind) { if (!cJSON_IsString(psa_ind)) { ogs_error("OpenAPI_psa_information_parseFromJSON() failed [psa_ind]"); @@ -102,39 +116,38 @@ OpenAPI_psa_information_t *OpenAPI_psa_information_parseFromJSON(cJSON *psa_info psa_indVariable = OpenAPI_psa_indication_FromString(psa_ind->valuestring); } - cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "dnaiList"); - - OpenAPI_list_t *dnai_listList; + dnai_list = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "dnaiList"); if (dnai_list) { - cJSON *dnai_list_local; - if (!cJSON_IsArray(dnai_list)) { - ogs_error("OpenAPI_psa_information_parseFromJSON() failed [dnai_list]"); - goto end; - } - dnai_listList = OpenAPI_list_create(); + cJSON *dnai_list_local = NULL; + if (!cJSON_IsArray(dnai_list)) { + ogs_error("OpenAPI_psa_information_parseFromJSON() failed [dnai_list]"); + goto end; + } - cJSON_ArrayForEach(dnai_list_local, dnai_list) { - if (!cJSON_IsString(dnai_list_local)) { - ogs_error("OpenAPI_psa_information_parseFromJSON() failed [dnai_list]"); - goto end; - } - OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); - } + dnai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnai_list_local, dnai_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnai_list_local)) { + ogs_error("OpenAPI_psa_information_parseFromJSON() failed [dnai_list]"); + goto end; + } + OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); + } } - cJSON *ue_ipv6_prefix = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "ueIpv6Prefix"); - + ue_ipv6_prefix = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "ueIpv6Prefix"); if (ue_ipv6_prefix) { - if (!cJSON_IsString(ue_ipv6_prefix)) { + if (!cJSON_IsString(ue_ipv6_prefix) && !cJSON_IsNull(ue_ipv6_prefix)) { ogs_error("OpenAPI_psa_information_parseFromJSON() failed [ue_ipv6_prefix]"); goto end; } } - cJSON *psa_upf_id = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "psaUpfId"); - + psa_upf_id = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "psaUpfId"); if (psa_upf_id) { - if (!cJSON_IsString(psa_upf_id)) { + if (!cJSON_IsString(psa_upf_id) && !cJSON_IsNull(psa_upf_id)) { ogs_error("OpenAPI_psa_information_parseFromJSON() failed [psa_upf_id]"); goto end; } @@ -143,12 +156,19 @@ OpenAPI_psa_information_t *OpenAPI_psa_information_parseFromJSON(cJSON *psa_info psa_information_local_var = OpenAPI_psa_information_create ( psa_ind ? psa_indVariable : 0, dnai_list ? dnai_listList : NULL, - ue_ipv6_prefix ? ogs_strdup(ue_ipv6_prefix->valuestring) : NULL, - psa_upf_id ? ogs_strdup(psa_upf_id->valuestring) : NULL + ue_ipv6_prefix && !cJSON_IsNull(ue_ipv6_prefix) ? ogs_strdup(ue_ipv6_prefix->valuestring) : NULL, + psa_upf_id && !cJSON_IsNull(psa_upf_id) ? ogs_strdup(psa_upf_id->valuestring) : NULL ); return psa_information_local_var; end: + if (dnai_listList) { + OpenAPI_list_for_each(dnai_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnai_listList); + dnai_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ptw_parameters.c b/lib/sbi/openapi/model/ptw_parameters.c index 833bf283b..6b8bb19bc 100644 --- a/lib/sbi/openapi/model/ptw_parameters.c +++ b/lib/sbi/openapi/model/ptw_parameters.c @@ -20,17 +20,22 @@ OpenAPI_ptw_parameters_t *OpenAPI_ptw_parameters_create( void OpenAPI_ptw_parameters_free(OpenAPI_ptw_parameters_t *ptw_parameters) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ptw_parameters) { return; } - OpenAPI_lnode_t *node; - ogs_free(ptw_parameters->ptw_value); + if (ptw_parameters->ptw_value) { + ogs_free(ptw_parameters->ptw_value); + ptw_parameters->ptw_value = NULL; + } ogs_free(ptw_parameters); } cJSON *OpenAPI_ptw_parameters_convertToJSON(OpenAPI_ptw_parameters_t *ptw_parameters) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ptw_parameters == NULL) { ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [PtwParameters]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_ptw_parameters_convertToJSON(OpenAPI_ptw_parameters_t *ptw_parame } item = cJSON_CreateObject(); + if (ptw_parameters->operation_mode == OpenAPI_operation_mode_NULL) { + ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [operation_mode]"); + return NULL; + } if (cJSON_AddStringToObject(item, "operationMode", OpenAPI_operation_mode_ToString(ptw_parameters->operation_mode)) == NULL) { ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [operation_mode]"); goto end; } + if (!ptw_parameters->ptw_value) { + ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [ptw_value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ptwValue", ptw_parameters->ptw_value) == NULL) { ogs_error("OpenAPI_ptw_parameters_convertToJSON() failed [ptw_value]"); goto end; @@ -55,25 +68,26 @@ end: OpenAPI_ptw_parameters_t *OpenAPI_ptw_parameters_parseFromJSON(cJSON *ptw_parametersJSON) { OpenAPI_ptw_parameters_t *ptw_parameters_local_var = NULL; - cJSON *operation_mode = cJSON_GetObjectItemCaseSensitive(ptw_parametersJSON, "operationMode"); + OpenAPI_lnode_t *node = NULL; + cJSON *operation_mode = NULL; + OpenAPI_operation_mode_e operation_modeVariable = 0; + cJSON *ptw_value = NULL; + operation_mode = cJSON_GetObjectItemCaseSensitive(ptw_parametersJSON, "operationMode"); if (!operation_mode) { ogs_error("OpenAPI_ptw_parameters_parseFromJSON() failed [operation_mode]"); goto end; } - - OpenAPI_operation_mode_e operation_modeVariable; if (!cJSON_IsString(operation_mode)) { ogs_error("OpenAPI_ptw_parameters_parseFromJSON() failed [operation_mode]"); goto end; } operation_modeVariable = OpenAPI_operation_mode_FromString(operation_mode->valuestring); - cJSON *ptw_value = cJSON_GetObjectItemCaseSensitive(ptw_parametersJSON, "ptwValue"); + ptw_value = cJSON_GetObjectItemCaseSensitive(ptw_parametersJSON, "ptwValue"); if (!ptw_value) { ogs_error("OpenAPI_ptw_parameters_parseFromJSON() failed [ptw_value]"); goto end; } - if (!cJSON_IsString(ptw_value)) { ogs_error("OpenAPI_ptw_parameters_parseFromJSON() failed [ptw_value]"); goto end; diff --git a/lib/sbi/openapi/model/ptw_parameters_1.c b/lib/sbi/openapi/model/ptw_parameters_1.c index 6310a64f7..075a4cd16 100644 --- a/lib/sbi/openapi/model/ptw_parameters_1.c +++ b/lib/sbi/openapi/model/ptw_parameters_1.c @@ -20,17 +20,22 @@ OpenAPI_ptw_parameters_1_t *OpenAPI_ptw_parameters_1_create( void OpenAPI_ptw_parameters_1_free(OpenAPI_ptw_parameters_1_t *ptw_parameters_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ptw_parameters_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(ptw_parameters_1->ptw_value); + if (ptw_parameters_1->ptw_value) { + ogs_free(ptw_parameters_1->ptw_value); + ptw_parameters_1->ptw_value = NULL; + } ogs_free(ptw_parameters_1); } cJSON *OpenAPI_ptw_parameters_1_convertToJSON(OpenAPI_ptw_parameters_1_t *ptw_parameters_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ptw_parameters_1 == NULL) { ogs_error("OpenAPI_ptw_parameters_1_convertToJSON() failed [PtwParameters_1]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_ptw_parameters_1_convertToJSON(OpenAPI_ptw_parameters_1_t *ptw_pa } item = cJSON_CreateObject(); + if (ptw_parameters_1->operation_mode == OpenAPI_operation_mode_NULL) { + ogs_error("OpenAPI_ptw_parameters_1_convertToJSON() failed [operation_mode]"); + return NULL; + } if (cJSON_AddStringToObject(item, "operationMode", OpenAPI_operation_mode_ToString(ptw_parameters_1->operation_mode)) == NULL) { ogs_error("OpenAPI_ptw_parameters_1_convertToJSON() failed [operation_mode]"); goto end; } + if (!ptw_parameters_1->ptw_value) { + ogs_error("OpenAPI_ptw_parameters_1_convertToJSON() failed [ptw_value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ptwValue", ptw_parameters_1->ptw_value) == NULL) { ogs_error("OpenAPI_ptw_parameters_1_convertToJSON() failed [ptw_value]"); goto end; @@ -55,25 +68,26 @@ end: OpenAPI_ptw_parameters_1_t *OpenAPI_ptw_parameters_1_parseFromJSON(cJSON *ptw_parameters_1JSON) { OpenAPI_ptw_parameters_1_t *ptw_parameters_1_local_var = NULL; - cJSON *operation_mode = cJSON_GetObjectItemCaseSensitive(ptw_parameters_1JSON, "operationMode"); + OpenAPI_lnode_t *node = NULL; + cJSON *operation_mode = NULL; + OpenAPI_operation_mode_e operation_modeVariable = 0; + cJSON *ptw_value = NULL; + operation_mode = cJSON_GetObjectItemCaseSensitive(ptw_parameters_1JSON, "operationMode"); if (!operation_mode) { ogs_error("OpenAPI_ptw_parameters_1_parseFromJSON() failed [operation_mode]"); goto end; } - - OpenAPI_operation_mode_e operation_modeVariable; if (!cJSON_IsString(operation_mode)) { ogs_error("OpenAPI_ptw_parameters_1_parseFromJSON() failed [operation_mode]"); goto end; } operation_modeVariable = OpenAPI_operation_mode_FromString(operation_mode->valuestring); - cJSON *ptw_value = cJSON_GetObjectItemCaseSensitive(ptw_parameters_1JSON, "ptwValue"); + ptw_value = cJSON_GetObjectItemCaseSensitive(ptw_parameters_1JSON, "ptwValue"); if (!ptw_value) { ogs_error("OpenAPI_ptw_parameters_1_parseFromJSON() failed [ptw_value]"); goto end; } - if (!cJSON_IsString(ptw_value)) { ogs_error("OpenAPI_ptw_parameters_1_parseFromJSON() failed [ptw_value]"); goto end; diff --git a/lib/sbi/openapi/model/pws_error_data.c b/lib/sbi/openapi/model/pws_error_data.c index 0cd49a3c7..470b3ae0a 100644 --- a/lib/sbi/openapi/model/pws_error_data.c +++ b/lib/sbi/openapi/model/pws_error_data.c @@ -18,16 +18,18 @@ OpenAPI_pws_error_data_t *OpenAPI_pws_error_data_create( void OpenAPI_pws_error_data_free(OpenAPI_pws_error_data_t *pws_error_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pws_error_data) { return; } - OpenAPI_lnode_t *node; ogs_free(pws_error_data); } cJSON *OpenAPI_pws_error_data_convertToJSON(OpenAPI_pws_error_data_t *pws_error_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pws_error_data == NULL) { ogs_error("OpenAPI_pws_error_data_convertToJSON() failed [PWSErrorData]"); @@ -47,12 +49,13 @@ end: OpenAPI_pws_error_data_t *OpenAPI_pws_error_data_parseFromJSON(cJSON *pws_error_dataJSON) { OpenAPI_pws_error_data_t *pws_error_data_local_var = NULL; - cJSON *namf_cause = cJSON_GetObjectItemCaseSensitive(pws_error_dataJSON, "namfCause"); + OpenAPI_lnode_t *node = NULL; + cJSON *namf_cause = NULL; + namf_cause = cJSON_GetObjectItemCaseSensitive(pws_error_dataJSON, "namfCause"); if (!namf_cause) { ogs_error("OpenAPI_pws_error_data_parseFromJSON() failed [namf_cause]"); goto end; } - if (!cJSON_IsNumber(namf_cause)) { ogs_error("OpenAPI_pws_error_data_parseFromJSON() failed [namf_cause]"); goto end; diff --git a/lib/sbi/openapi/model/pws_information.c b/lib/sbi/openapi/model/pws_information.c index 35161d720..9f438af81 100644 --- a/lib/sbi/openapi/model/pws_information.c +++ b/lib/sbi/openapi/model/pws_information.c @@ -30,22 +30,33 @@ OpenAPI_pws_information_t *OpenAPI_pws_information_create( void OpenAPI_pws_information_free(OpenAPI_pws_information_t *pws_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pws_information) { return; } - OpenAPI_lnode_t *node; - OpenAPI_n2_info_content_free(pws_information->pws_container); - OpenAPI_list_for_each(pws_information->bc_empty_area_list, node) { - OpenAPI_global_ran_node_id_free(node->data); + if (pws_information->pws_container) { + OpenAPI_n2_info_content_free(pws_information->pws_container); + pws_information->pws_container = NULL; + } + if (pws_information->bc_empty_area_list) { + OpenAPI_list_for_each(pws_information->bc_empty_area_list, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(pws_information->bc_empty_area_list); + pws_information->bc_empty_area_list = NULL; + } + if (pws_information->omc_id) { + ogs_free(pws_information->omc_id); + pws_information->omc_id = NULL; } - OpenAPI_list_free(pws_information->bc_empty_area_list); - ogs_free(pws_information->omc_id); ogs_free(pws_information); } cJSON *OpenAPI_pws_information_convertToJSON(OpenAPI_pws_information_t *pws_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pws_information == NULL) { ogs_error("OpenAPI_pws_information_convertToJSON() failed [PwsInformation]"); @@ -63,6 +74,10 @@ cJSON *OpenAPI_pws_information_convertToJSON(OpenAPI_pws_information_t *pws_info goto end; } + if (!pws_information->pws_container) { + ogs_error("OpenAPI_pws_information_convertToJSON() failed [pws_container]"); + return NULL; + } cJSON *pws_container_local_JSON = OpenAPI_n2_info_content_convertToJSON(pws_information->pws_container); if (pws_container_local_JSON == NULL) { ogs_error("OpenAPI_pws_information_convertToJSON() failed [pws_container]"); @@ -80,17 +95,13 @@ cJSON *OpenAPI_pws_information_convertToJSON(OpenAPI_pws_information_t *pws_info ogs_error("OpenAPI_pws_information_convertToJSON() failed [bc_empty_area_list]"); goto end; } - - OpenAPI_lnode_t *bc_empty_area_list_node; - if (pws_information->bc_empty_area_list) { - OpenAPI_list_for_each(pws_information->bc_empty_area_list, bc_empty_area_list_node) { - cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(bc_empty_area_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pws_information_convertToJSON() failed [bc_empty_area_list]"); - goto end; - } - cJSON_AddItemToArray(bc_empty_area_listList, itemLocal); + OpenAPI_list_for_each(pws_information->bc_empty_area_list, node) { + cJSON *itemLocal = OpenAPI_global_ran_node_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pws_information_convertToJSON() failed [bc_empty_area_list]"); + goto end; } + cJSON_AddItemToArray(bc_empty_area_listList, itemLocal); } } @@ -115,68 +126,68 @@ end: OpenAPI_pws_information_t *OpenAPI_pws_information_parseFromJSON(cJSON *pws_informationJSON) { OpenAPI_pws_information_t *pws_information_local_var = NULL; - cJSON *message_identifier = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "messageIdentifier"); + OpenAPI_lnode_t *node = NULL; + cJSON *message_identifier = NULL; + cJSON *serial_number = NULL; + cJSON *pws_container = NULL; + OpenAPI_n2_info_content_t *pws_container_local_nonprim = NULL; + cJSON *bc_empty_area_list = NULL; + OpenAPI_list_t *bc_empty_area_listList = NULL; + cJSON *send_ran_response = NULL; + cJSON *omc_id = NULL; + message_identifier = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "messageIdentifier"); if (!message_identifier) { ogs_error("OpenAPI_pws_information_parseFromJSON() failed [message_identifier]"); goto end; } - if (!cJSON_IsNumber(message_identifier)) { ogs_error("OpenAPI_pws_information_parseFromJSON() failed [message_identifier]"); goto end; } - cJSON *serial_number = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "serialNumber"); + serial_number = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "serialNumber"); if (!serial_number) { ogs_error("OpenAPI_pws_information_parseFromJSON() failed [serial_number]"); goto end; } - if (!cJSON_IsNumber(serial_number)) { ogs_error("OpenAPI_pws_information_parseFromJSON() failed [serial_number]"); goto end; } - cJSON *pws_container = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "pwsContainer"); + pws_container = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "pwsContainer"); if (!pws_container) { ogs_error("OpenAPI_pws_information_parseFromJSON() failed [pws_container]"); goto end; } - - OpenAPI_n2_info_content_t *pws_container_local_nonprim = NULL; pws_container_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(pws_container); - cJSON *bc_empty_area_list = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "bcEmptyAreaList"); - - OpenAPI_list_t *bc_empty_area_listList; + bc_empty_area_list = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "bcEmptyAreaList"); if (bc_empty_area_list) { - cJSON *bc_empty_area_list_local_nonprimitive; - if (!cJSON_IsArray(bc_empty_area_list)){ - ogs_error("OpenAPI_pws_information_parseFromJSON() failed [bc_empty_area_list]"); - goto end; - } - - bc_empty_area_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(bc_empty_area_list_local_nonprimitive, bc_empty_area_list ) { - if (!cJSON_IsObject(bc_empty_area_list_local_nonprimitive)) { + cJSON *bc_empty_area_list_local = NULL; + if (!cJSON_IsArray(bc_empty_area_list)) { ogs_error("OpenAPI_pws_information_parseFromJSON() failed [bc_empty_area_list]"); goto end; } - OpenAPI_global_ran_node_id_t *bc_empty_area_listItem = OpenAPI_global_ran_node_id_parseFromJSON(bc_empty_area_list_local_nonprimitive); - if (!bc_empty_area_listItem) { - ogs_error("No bc_empty_area_listItem"); - OpenAPI_list_free(bc_empty_area_listList); - goto end; + bc_empty_area_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(bc_empty_area_list_local, bc_empty_area_list) { + if (!cJSON_IsObject(bc_empty_area_list_local)) { + ogs_error("OpenAPI_pws_information_parseFromJSON() failed [bc_empty_area_list]"); + goto end; + } + OpenAPI_global_ran_node_id_t *bc_empty_area_listItem = OpenAPI_global_ran_node_id_parseFromJSON(bc_empty_area_list_local); + if (!bc_empty_area_listItem) { + ogs_error("No bc_empty_area_listItem"); + OpenAPI_list_free(bc_empty_area_listList); + goto end; + } + OpenAPI_list_add(bc_empty_area_listList, bc_empty_area_listItem); } - - OpenAPI_list_add(bc_empty_area_listList, bc_empty_area_listItem); - } } - cJSON *send_ran_response = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "sendRanResponse"); - + send_ran_response = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "sendRanResponse"); if (send_ran_response) { if (!cJSON_IsBool(send_ran_response)) { ogs_error("OpenAPI_pws_information_parseFromJSON() failed [send_ran_response]"); @@ -184,10 +195,9 @@ OpenAPI_pws_information_t *OpenAPI_pws_information_parseFromJSON(cJSON *pws_info } } - cJSON *omc_id = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "omcId"); - + omc_id = cJSON_GetObjectItemCaseSensitive(pws_informationJSON, "omcId"); if (omc_id) { - if (!cJSON_IsString(omc_id)) { + if (!cJSON_IsString(omc_id) && !cJSON_IsNull(omc_id)) { ogs_error("OpenAPI_pws_information_parseFromJSON() failed [omc_id]"); goto end; } @@ -202,11 +212,22 @@ OpenAPI_pws_information_t *OpenAPI_pws_information_parseFromJSON(cJSON *pws_info bc_empty_area_list ? bc_empty_area_listList : NULL, send_ran_response ? true : false, send_ran_response ? send_ran_response->valueint : 0, - omc_id ? ogs_strdup(omc_id->valuestring) : NULL + omc_id && !cJSON_IsNull(omc_id) ? ogs_strdup(omc_id->valuestring) : NULL ); return pws_information_local_var; end: + if (pws_container_local_nonprim) { + OpenAPI_n2_info_content_free(pws_container_local_nonprim); + pws_container_local_nonprim = NULL; + } + if (bc_empty_area_listList) { + OpenAPI_list_for_each(bc_empty_area_listList, node) { + OpenAPI_global_ran_node_id_free(node->data); + } + OpenAPI_list_free(bc_empty_area_listList); + bc_empty_area_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/pws_response_data.c b/lib/sbi/openapi/model/pws_response_data.c index e0cc73c9f..101017fe0 100644 --- a/lib/sbi/openapi/model/pws_response_data.c +++ b/lib/sbi/openapi/model/pws_response_data.c @@ -24,20 +24,25 @@ OpenAPI_pws_response_data_t *OpenAPI_pws_response_data_create( void OpenAPI_pws_response_data_free(OpenAPI_pws_response_data_t *pws_response_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == pws_response_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(pws_response_data->unknown_tai_list, node) { - OpenAPI_tai_free(node->data); + if (pws_response_data->unknown_tai_list) { + OpenAPI_list_for_each(pws_response_data->unknown_tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(pws_response_data->unknown_tai_list); + pws_response_data->unknown_tai_list = NULL; } - OpenAPI_list_free(pws_response_data->unknown_tai_list); ogs_free(pws_response_data); } cJSON *OpenAPI_pws_response_data_convertToJSON(OpenAPI_pws_response_data_t *pws_response_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (pws_response_data == NULL) { ogs_error("OpenAPI_pws_response_data_convertToJSON() failed [PWSResponseData]"); @@ -66,17 +71,13 @@ cJSON *OpenAPI_pws_response_data_convertToJSON(OpenAPI_pws_response_data_t *pws_ ogs_error("OpenAPI_pws_response_data_convertToJSON() failed [unknown_tai_list]"); goto end; } - - OpenAPI_lnode_t *unknown_tai_list_node; - if (pws_response_data->unknown_tai_list) { - OpenAPI_list_for_each(pws_response_data->unknown_tai_list, unknown_tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(unknown_tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_pws_response_data_convertToJSON() failed [unknown_tai_list]"); - goto end; - } - cJSON_AddItemToArray(unknown_tai_listList, itemLocal); + OpenAPI_list_for_each(pws_response_data->unknown_tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_pws_response_data_convertToJSON() failed [unknown_tai_list]"); + goto end; } + cJSON_AddItemToArray(unknown_tai_listList, itemLocal); } } @@ -87,66 +88,65 @@ end: OpenAPI_pws_response_data_t *OpenAPI_pws_response_data_parseFromJSON(cJSON *pws_response_dataJSON) { OpenAPI_pws_response_data_t *pws_response_data_local_var = NULL; - cJSON *ngap_message_type = cJSON_GetObjectItemCaseSensitive(pws_response_dataJSON, "ngapMessageType"); + OpenAPI_lnode_t *node = NULL; + cJSON *ngap_message_type = NULL; + cJSON *serial_number = NULL; + cJSON *message_identifier = NULL; + cJSON *unknown_tai_list = NULL; + OpenAPI_list_t *unknown_tai_listList = NULL; + ngap_message_type = cJSON_GetObjectItemCaseSensitive(pws_response_dataJSON, "ngapMessageType"); if (!ngap_message_type) { ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [ngap_message_type]"); goto end; } - if (!cJSON_IsNumber(ngap_message_type)) { ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [ngap_message_type]"); goto end; } - cJSON *serial_number = cJSON_GetObjectItemCaseSensitive(pws_response_dataJSON, "serialNumber"); + serial_number = cJSON_GetObjectItemCaseSensitive(pws_response_dataJSON, "serialNumber"); if (!serial_number) { ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [serial_number]"); goto end; } - if (!cJSON_IsNumber(serial_number)) { ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [serial_number]"); goto end; } - cJSON *message_identifier = cJSON_GetObjectItemCaseSensitive(pws_response_dataJSON, "messageIdentifier"); + message_identifier = cJSON_GetObjectItemCaseSensitive(pws_response_dataJSON, "messageIdentifier"); if (!message_identifier) { ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [message_identifier]"); goto end; } - if (!cJSON_IsNumber(message_identifier)) { ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [message_identifier]"); goto end; } - cJSON *unknown_tai_list = cJSON_GetObjectItemCaseSensitive(pws_response_dataJSON, "unknownTaiList"); - - OpenAPI_list_t *unknown_tai_listList; + unknown_tai_list = cJSON_GetObjectItemCaseSensitive(pws_response_dataJSON, "unknownTaiList"); if (unknown_tai_list) { - cJSON *unknown_tai_list_local_nonprimitive; - if (!cJSON_IsArray(unknown_tai_list)){ - ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [unknown_tai_list]"); - goto end; - } - - unknown_tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(unknown_tai_list_local_nonprimitive, unknown_tai_list ) { - if (!cJSON_IsObject(unknown_tai_list_local_nonprimitive)) { + cJSON *unknown_tai_list_local = NULL; + if (!cJSON_IsArray(unknown_tai_list)) { ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [unknown_tai_list]"); goto end; } - OpenAPI_tai_t *unknown_tai_listItem = OpenAPI_tai_parseFromJSON(unknown_tai_list_local_nonprimitive); - if (!unknown_tai_listItem) { - ogs_error("No unknown_tai_listItem"); - OpenAPI_list_free(unknown_tai_listList); - goto end; + unknown_tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(unknown_tai_list_local, unknown_tai_list) { + if (!cJSON_IsObject(unknown_tai_list_local)) { + ogs_error("OpenAPI_pws_response_data_parseFromJSON() failed [unknown_tai_list]"); + goto end; + } + OpenAPI_tai_t *unknown_tai_listItem = OpenAPI_tai_parseFromJSON(unknown_tai_list_local); + if (!unknown_tai_listItem) { + ogs_error("No unknown_tai_listItem"); + OpenAPI_list_free(unknown_tai_listList); + goto end; + } + OpenAPI_list_add(unknown_tai_listList, unknown_tai_listItem); } - - OpenAPI_list_add(unknown_tai_listList, unknown_tai_listItem); - } } pws_response_data_local_var = OpenAPI_pws_response_data_create ( @@ -161,6 +161,13 @@ OpenAPI_pws_response_data_t *OpenAPI_pws_response_data_parseFromJSON(cJSON *pws_ return pws_response_data_local_var; end: + if (unknown_tai_listList) { + OpenAPI_list_for_each(unknown_tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(unknown_tai_listList); + unknown_tai_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/qos_characteristics.c b/lib/sbi/openapi/model/qos_characteristics.c index 348431ff3..47e6b23c2 100644 --- a/lib/sbi/openapi/model/qos_characteristics.c +++ b/lib/sbi/openapi/model/qos_characteristics.c @@ -38,17 +38,22 @@ OpenAPI_qos_characteristics_t *OpenAPI_qos_characteristics_create( void OpenAPI_qos_characteristics_free(OpenAPI_qos_characteristics_t *qos_characteristics) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_characteristics) { return; } - OpenAPI_lnode_t *node; - ogs_free(qos_characteristics->packet_error_rate); + if (qos_characteristics->packet_error_rate) { + ogs_free(qos_characteristics->packet_error_rate); + qos_characteristics->packet_error_rate = NULL; + } ogs_free(qos_characteristics); } cJSON *OpenAPI_qos_characteristics_convertToJSON(OpenAPI_qos_characteristics_t *qos_characteristics) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_characteristics == NULL) { ogs_error("OpenAPI_qos_characteristics_convertToJSON() failed [QosCharacteristics]"); @@ -61,6 +66,10 @@ cJSON *OpenAPI_qos_characteristics_convertToJSON(OpenAPI_qos_characteristics_t * goto end; } + if (qos_characteristics->resource_type == OpenAPI_qos_resource_type_NULL) { + ogs_error("OpenAPI_qos_characteristics_convertToJSON() failed [resource_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resourceType", OpenAPI_qos_resource_type_ToString(qos_characteristics->resource_type)) == NULL) { ogs_error("OpenAPI_qos_characteristics_convertToJSON() failed [resource_type]"); goto end; @@ -76,6 +85,10 @@ cJSON *OpenAPI_qos_characteristics_convertToJSON(OpenAPI_qos_characteristics_t * goto end; } + if (!qos_characteristics->packet_error_rate) { + ogs_error("OpenAPI_qos_characteristics_convertToJSON() failed [packet_error_rate]"); + return NULL; + } if (cJSON_AddStringToObject(item, "packetErrorRate", qos_characteristics->packet_error_rate) == NULL) { ogs_error("OpenAPI_qos_characteristics_convertToJSON() failed [packet_error_rate]"); goto end; @@ -109,65 +122,68 @@ end: OpenAPI_qos_characteristics_t *OpenAPI_qos_characteristics_parseFromJSON(cJSON *qos_characteristicsJSON) { OpenAPI_qos_characteristics_t *qos_characteristics_local_var = NULL; - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "5qi"); + OpenAPI_lnode_t *node = NULL; + cJSON *_5qi = NULL; + cJSON *resource_type = NULL; + OpenAPI_qos_resource_type_e resource_typeVariable = 0; + cJSON *priority_level = NULL; + cJSON *packet_delay_budget = NULL; + cJSON *packet_error_rate = NULL; + cJSON *averaging_window = NULL; + cJSON *max_data_burst_vol = NULL; + cJSON *ext_max_data_burst_vol = NULL; + _5qi = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "5qi"); if (!_5qi) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [_5qi]"); goto end; } - if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [_5qi]"); goto end; } - cJSON *resource_type = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "resourceType"); + resource_type = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "resourceType"); if (!resource_type) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [resource_type]"); goto end; } - - OpenAPI_qos_resource_type_e resource_typeVariable; if (!cJSON_IsString(resource_type)) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [resource_type]"); goto end; } resource_typeVariable = OpenAPI_qos_resource_type_FromString(resource_type->valuestring); - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "priorityLevel"); + priority_level = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "priorityLevel"); if (!priority_level) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [priority_level]"); goto end; } - if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [priority_level]"); goto end; } - cJSON *packet_delay_budget = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "packetDelayBudget"); + packet_delay_budget = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "packetDelayBudget"); if (!packet_delay_budget) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [packet_delay_budget]"); goto end; } - if (!cJSON_IsNumber(packet_delay_budget)) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [packet_delay_budget]"); goto end; } - cJSON *packet_error_rate = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "packetErrorRate"); + packet_error_rate = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "packetErrorRate"); if (!packet_error_rate) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [packet_error_rate]"); goto end; } - if (!cJSON_IsString(packet_error_rate)) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [packet_error_rate]"); goto end; } - cJSON *averaging_window = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "averagingWindow"); - + averaging_window = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "averagingWindow"); if (averaging_window) { if (!cJSON_IsNumber(averaging_window)) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [averaging_window]"); @@ -175,8 +191,7 @@ OpenAPI_qos_characteristics_t *OpenAPI_qos_characteristics_parseFromJSON(cJSON * } } - cJSON *max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "maxDataBurstVol"); - + max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "maxDataBurstVol"); if (max_data_burst_vol) { if (!cJSON_IsNumber(max_data_burst_vol)) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [max_data_burst_vol]"); @@ -184,8 +199,7 @@ OpenAPI_qos_characteristics_t *OpenAPI_qos_characteristics_parseFromJSON(cJSON * } } - cJSON *ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "extMaxDataBurstVol"); - + ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(qos_characteristicsJSON, "extMaxDataBurstVol"); if (ext_max_data_burst_vol) { if (!cJSON_IsNumber(ext_max_data_burst_vol)) { ogs_error("OpenAPI_qos_characteristics_parseFromJSON() failed [ext_max_data_burst_vol]"); diff --git a/lib/sbi/openapi/model/qos_data.c b/lib/sbi/openapi/model/qos_data.c index 9d2c12384..c5a5c505b 100644 --- a/lib/sbi/openapi/model/qos_data.c +++ b/lib/sbi/openapi/model/qos_data.c @@ -78,25 +78,54 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_create( void OpenAPI_qos_data_free(OpenAPI_qos_data_t *qos_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(qos_data->qos_id); - ogs_free(qos_data->maxbr_ul); - ogs_free(qos_data->maxbr_dl); - ogs_free(qos_data->gbr_ul); - ogs_free(qos_data->gbr_dl); - OpenAPI_arp_free(qos_data->arp); - ogs_free(qos_data->sharing_key_dl); - ogs_free(qos_data->sharing_key_ul); - ogs_free(qos_data->packet_error_rate); + if (qos_data->qos_id) { + ogs_free(qos_data->qos_id); + qos_data->qos_id = NULL; + } + if (qos_data->maxbr_ul) { + ogs_free(qos_data->maxbr_ul); + qos_data->maxbr_ul = NULL; + } + if (qos_data->maxbr_dl) { + ogs_free(qos_data->maxbr_dl); + qos_data->maxbr_dl = NULL; + } + if (qos_data->gbr_ul) { + ogs_free(qos_data->gbr_ul); + qos_data->gbr_ul = NULL; + } + if (qos_data->gbr_dl) { + ogs_free(qos_data->gbr_dl); + qos_data->gbr_dl = NULL; + } + if (qos_data->arp) { + OpenAPI_arp_free(qos_data->arp); + qos_data->arp = NULL; + } + if (qos_data->sharing_key_dl) { + ogs_free(qos_data->sharing_key_dl); + qos_data->sharing_key_dl = NULL; + } + if (qos_data->sharing_key_ul) { + ogs_free(qos_data->sharing_key_ul); + qos_data->sharing_key_ul = NULL; + } + if (qos_data->packet_error_rate) { + ogs_free(qos_data->packet_error_rate); + qos_data->packet_error_rate = NULL; + } ogs_free(qos_data); } cJSON *OpenAPI_qos_data_convertToJSON(OpenAPI_qos_data_t *qos_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_data == NULL) { ogs_error("OpenAPI_qos_data_convertToJSON() failed [QosData]"); @@ -104,6 +133,10 @@ cJSON *OpenAPI_qos_data_convertToJSON(OpenAPI_qos_data_t *qos_data) } item = cJSON_CreateObject(); + if (!qos_data->qos_id) { + ogs_error("OpenAPI_qos_data_convertToJSON() failed [qos_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "qosId", qos_data->qos_id) == NULL) { ogs_error("OpenAPI_qos_data_convertToJSON() failed [qos_id]"); goto end; @@ -255,19 +288,39 @@ end: OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) { OpenAPI_qos_data_t *qos_data_local_var = NULL; - cJSON *qos_id = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "qosId"); + OpenAPI_lnode_t *node = NULL; + cJSON *qos_id = NULL; + cJSON *_5qi = NULL; + cJSON *maxbr_ul = NULL; + cJSON *maxbr_dl = NULL; + cJSON *gbr_ul = NULL; + cJSON *gbr_dl = NULL; + cJSON *arp = NULL; + OpenAPI_arp_t *arp_local_nonprim = NULL; + cJSON *qnc = NULL; + cJSON *priority_level = NULL; + cJSON *aver_window = NULL; + cJSON *max_data_burst_vol = NULL; + cJSON *reflective_qos = NULL; + cJSON *sharing_key_dl = NULL; + cJSON *sharing_key_ul = NULL; + cJSON *max_packet_loss_rate_dl = NULL; + cJSON *max_packet_loss_rate_ul = NULL; + cJSON *def_qos_flow_indication = NULL; + cJSON *ext_max_data_burst_vol = NULL; + cJSON *packet_delay_budget = NULL; + cJSON *packet_error_rate = NULL; + qos_id = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "qosId"); if (!qos_id) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [qos_id]"); goto end; } - if (!cJSON_IsString(qos_id)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [qos_id]"); goto end; } - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "5qi"); - + _5qi = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "5qi"); if (_5qi) { if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [_5qi]"); @@ -275,51 +328,44 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *maxbr_ul = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxbrUl"); - + maxbr_ul = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxbrUl"); if (maxbr_ul) { - if (!cJSON_IsString(maxbr_ul)) { + if (!cJSON_IsString(maxbr_ul) && !cJSON_IsNull(maxbr_ul)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [maxbr_ul]"); goto end; } } - cJSON *maxbr_dl = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxbrDl"); - + maxbr_dl = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxbrDl"); if (maxbr_dl) { - if (!cJSON_IsString(maxbr_dl)) { + if (!cJSON_IsString(maxbr_dl) && !cJSON_IsNull(maxbr_dl)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [maxbr_dl]"); goto end; } } - cJSON *gbr_ul = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "gbrUl"); - + gbr_ul = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "gbrUl"); if (gbr_ul) { - if (!cJSON_IsString(gbr_ul)) { + if (!cJSON_IsString(gbr_ul) && !cJSON_IsNull(gbr_ul)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [gbr_ul]"); goto end; } } - cJSON *gbr_dl = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "gbrDl"); - + gbr_dl = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "gbrDl"); if (gbr_dl) { - if (!cJSON_IsString(gbr_dl)) { + if (!cJSON_IsString(gbr_dl) && !cJSON_IsNull(gbr_dl)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [gbr_dl]"); goto end; } } - cJSON *arp = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "arp"); - - OpenAPI_arp_t *arp_local_nonprim = NULL; + arp = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "arp"); if (arp) { arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp); } - cJSON *qnc = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "qnc"); - + qnc = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "qnc"); if (qnc) { if (!cJSON_IsBool(qnc)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [qnc]"); @@ -327,8 +373,7 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "priorityLevel"); - + priority_level = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "priorityLevel"); if (priority_level) { if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [priority_level]"); @@ -336,8 +381,7 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *aver_window = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "averWindow"); - + aver_window = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "averWindow"); if (aver_window) { if (!cJSON_IsNumber(aver_window)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [aver_window]"); @@ -345,8 +389,7 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxDataBurstVol"); - + max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxDataBurstVol"); if (max_data_burst_vol) { if (!cJSON_IsNumber(max_data_burst_vol)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [max_data_burst_vol]"); @@ -354,8 +397,7 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *reflective_qos = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "reflectiveQos"); - + reflective_qos = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "reflectiveQos"); if (reflective_qos) { if (!cJSON_IsBool(reflective_qos)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [reflective_qos]"); @@ -363,26 +405,23 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *sharing_key_dl = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "sharingKeyDl"); - + sharing_key_dl = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "sharingKeyDl"); if (sharing_key_dl) { - if (!cJSON_IsString(sharing_key_dl)) { + if (!cJSON_IsString(sharing_key_dl) && !cJSON_IsNull(sharing_key_dl)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [sharing_key_dl]"); goto end; } } - cJSON *sharing_key_ul = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "sharingKeyUl"); - + sharing_key_ul = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "sharingKeyUl"); if (sharing_key_ul) { - if (!cJSON_IsString(sharing_key_ul)) { + if (!cJSON_IsString(sharing_key_ul) && !cJSON_IsNull(sharing_key_ul)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [sharing_key_ul]"); goto end; } } - cJSON *max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxPacketLossRateDl"); - + max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxPacketLossRateDl"); if (max_packet_loss_rate_dl) { if (!cJSON_IsNumber(max_packet_loss_rate_dl)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [max_packet_loss_rate_dl]"); @@ -390,8 +429,7 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *max_packet_loss_rate_ul = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxPacketLossRateUl"); - + max_packet_loss_rate_ul = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "maxPacketLossRateUl"); if (max_packet_loss_rate_ul) { if (!cJSON_IsNumber(max_packet_loss_rate_ul)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [max_packet_loss_rate_ul]"); @@ -399,8 +437,7 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *def_qos_flow_indication = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "defQosFlowIndication"); - + def_qos_flow_indication = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "defQosFlowIndication"); if (def_qos_flow_indication) { if (!cJSON_IsBool(def_qos_flow_indication)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [def_qos_flow_indication]"); @@ -408,8 +445,7 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "extMaxDataBurstVol"); - + ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "extMaxDataBurstVol"); if (ext_max_data_burst_vol) { if (!cJSON_IsNumber(ext_max_data_burst_vol)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [ext_max_data_burst_vol]"); @@ -417,8 +453,7 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *packet_delay_budget = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "packetDelayBudget"); - + packet_delay_budget = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "packetDelayBudget"); if (packet_delay_budget) { if (!cJSON_IsNumber(packet_delay_budget)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [packet_delay_budget]"); @@ -426,10 +461,9 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) } } - cJSON *packet_error_rate = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "packetErrorRate"); - + packet_error_rate = cJSON_GetObjectItemCaseSensitive(qos_dataJSON, "packetErrorRate"); if (packet_error_rate) { - if (!cJSON_IsString(packet_error_rate)) { + if (!cJSON_IsString(packet_error_rate) && !cJSON_IsNull(packet_error_rate)) { ogs_error("OpenAPI_qos_data_parseFromJSON() failed [packet_error_rate]"); goto end; } @@ -439,10 +473,10 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) ogs_strdup(qos_id->valuestring), _5qi ? true : false, _5qi ? _5qi->valuedouble : 0, - maxbr_ul ? ogs_strdup(maxbr_ul->valuestring) : NULL, - maxbr_dl ? ogs_strdup(maxbr_dl->valuestring) : NULL, - gbr_ul ? ogs_strdup(gbr_ul->valuestring) : NULL, - gbr_dl ? ogs_strdup(gbr_dl->valuestring) : NULL, + maxbr_ul && !cJSON_IsNull(maxbr_ul) ? ogs_strdup(maxbr_ul->valuestring) : NULL, + maxbr_dl && !cJSON_IsNull(maxbr_dl) ? ogs_strdup(maxbr_dl->valuestring) : NULL, + gbr_ul && !cJSON_IsNull(gbr_ul) ? ogs_strdup(gbr_ul->valuestring) : NULL, + gbr_dl && !cJSON_IsNull(gbr_dl) ? ogs_strdup(gbr_dl->valuestring) : NULL, arp ? arp_local_nonprim : NULL, qnc ? true : false, qnc ? qnc->valueint : 0, @@ -454,8 +488,8 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) max_data_burst_vol ? max_data_burst_vol->valuedouble : 0, reflective_qos ? true : false, reflective_qos ? reflective_qos->valueint : 0, - sharing_key_dl ? ogs_strdup(sharing_key_dl->valuestring) : NULL, - sharing_key_ul ? ogs_strdup(sharing_key_ul->valuestring) : NULL, + sharing_key_dl && !cJSON_IsNull(sharing_key_dl) ? ogs_strdup(sharing_key_dl->valuestring) : NULL, + sharing_key_ul && !cJSON_IsNull(sharing_key_ul) ? ogs_strdup(sharing_key_ul->valuestring) : NULL, max_packet_loss_rate_dl ? true : false, max_packet_loss_rate_dl ? max_packet_loss_rate_dl->valuedouble : 0, max_packet_loss_rate_ul ? true : false, @@ -466,11 +500,15 @@ OpenAPI_qos_data_t *OpenAPI_qos_data_parseFromJSON(cJSON *qos_dataJSON) ext_max_data_burst_vol ? ext_max_data_burst_vol->valuedouble : 0, packet_delay_budget ? true : false, packet_delay_budget ? packet_delay_budget->valuedouble : 0, - packet_error_rate ? ogs_strdup(packet_error_rate->valuestring) : NULL + packet_error_rate && !cJSON_IsNull(packet_error_rate) ? ogs_strdup(packet_error_rate->valuestring) : NULL ); return qos_data_local_var; end: + if (arp_local_nonprim) { + OpenAPI_arp_free(arp_local_nonprim); + arp_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/qos_flow_access_type.c b/lib/sbi/openapi/model/qos_flow_access_type.c index 6de2b754c..169fd3bf0 100644 --- a/lib/sbi/openapi/model/qos_flow_access_type.c +++ b/lib/sbi/openapi/model/qos_flow_access_type.c @@ -6,7 +6,7 @@ char* OpenAPI_qos_flow_access_type_ToString(OpenAPI_qos_flow_access_type_e qos_flow_access_type) { - const char *qos_flow_access_typeArray[] = { "NULL", "_3GPP", "NON_3GPP", "_3GPP_AND_NON_3GPP" }; + const char *qos_flow_access_typeArray[] = { "NULL", "3GPP", "NON_3GPP", "3GPP_AND_NON_3GPP" }; size_t sizeofArray = sizeof(qos_flow_access_typeArray) / sizeof(qos_flow_access_typeArray[0]); if (qos_flow_access_type < sizeofArray) return (char *)qos_flow_access_typeArray[qos_flow_access_type]; @@ -17,7 +17,7 @@ char* OpenAPI_qos_flow_access_type_ToString(OpenAPI_qos_flow_access_type_e qos_f OpenAPI_qos_flow_access_type_e OpenAPI_qos_flow_access_type_FromString(char* qos_flow_access_type) { int stringToReturn = 0; - const char *qos_flow_access_typeArray[] = { "NULL", "_3GPP", "NON_3GPP", "_3GPP_AND_NON_3GPP" }; + const char *qos_flow_access_typeArray[] = { "NULL", "3GPP", "NON_3GPP", "3GPP_AND_NON_3GPP" }; size_t sizeofArray = sizeof(qos_flow_access_typeArray) / sizeof(qos_flow_access_typeArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(qos_flow_access_type, qos_flow_access_typeArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/qos_flow_add_modify_request_item.c b/lib/sbi/openapi/model/qos_flow_add_modify_request_item.c index 4b1f3ecf7..19dbd0fe0 100644 --- a/lib/sbi/openapi/model/qos_flow_add_modify_request_item.c +++ b/lib/sbi/openapi/model/qos_flow_add_modify_request_item.c @@ -8,8 +8,8 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_ int qfi, bool is_ebi, int ebi, - char qos_rules, - char qos_flow_description, + char *qos_rules, + char *qos_flow_description, OpenAPI_qos_flow_profile_t *qos_flow_profile, OpenAPI_qos_flow_access_type_e associated_an_type ) @@ -30,17 +30,30 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_ void OpenAPI_qos_flow_add_modify_request_item_free(OpenAPI_qos_flow_add_modify_request_item_t *qos_flow_add_modify_request_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_flow_add_modify_request_item) { return; } - OpenAPI_lnode_t *node; - OpenAPI_qos_flow_profile_free(qos_flow_add_modify_request_item->qos_flow_profile); + if (qos_flow_add_modify_request_item->qos_rules) { + ogs_free(qos_flow_add_modify_request_item->qos_rules); + qos_flow_add_modify_request_item->qos_rules = NULL; + } + if (qos_flow_add_modify_request_item->qos_flow_description) { + ogs_free(qos_flow_add_modify_request_item->qos_flow_description); + qos_flow_add_modify_request_item->qos_flow_description = NULL; + } + if (qos_flow_add_modify_request_item->qos_flow_profile) { + OpenAPI_qos_flow_profile_free(qos_flow_add_modify_request_item->qos_flow_profile); + qos_flow_add_modify_request_item->qos_flow_profile = NULL; + } ogs_free(qos_flow_add_modify_request_item); } cJSON *OpenAPI_qos_flow_add_modify_request_item_convertToJSON(OpenAPI_qos_flow_add_modify_request_item_t *qos_flow_add_modify_request_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_flow_add_modify_request_item == NULL) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_convertToJSON() failed [QosFlowAddModifyRequestItem]"); @@ -61,14 +74,14 @@ cJSON *OpenAPI_qos_flow_add_modify_request_item_convertToJSON(OpenAPI_qos_flow_a } if (qos_flow_add_modify_request_item->qos_rules) { - if (cJSON_AddNumberToObject(item, "qosRules", qos_flow_add_modify_request_item->qos_rules) == NULL) { + if (cJSON_AddStringToObject(item, "qosRules", qos_flow_add_modify_request_item->qos_rules) == NULL) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_convertToJSON() failed [qos_rules]"); goto end; } } if (qos_flow_add_modify_request_item->qos_flow_description) { - if (cJSON_AddNumberToObject(item, "qosFlowDescription", qos_flow_add_modify_request_item->qos_flow_description) == NULL) { + if (cJSON_AddStringToObject(item, "qosFlowDescription", qos_flow_add_modify_request_item->qos_flow_description) == NULL) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_convertToJSON() failed [qos_flow_description]"); goto end; } @@ -87,7 +100,7 @@ cJSON *OpenAPI_qos_flow_add_modify_request_item_convertToJSON(OpenAPI_qos_flow_a } } - if (qos_flow_add_modify_request_item->associated_an_type) { + if (qos_flow_add_modify_request_item->associated_an_type != OpenAPI_qos_flow_access_type_NULL) { if (cJSON_AddStringToObject(item, "associatedAnType", OpenAPI_qos_flow_access_type_ToString(qos_flow_add_modify_request_item->associated_an_type)) == NULL) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_convertToJSON() failed [associated_an_type]"); goto end; @@ -101,19 +114,26 @@ end: OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_item_parseFromJSON(cJSON *qos_flow_add_modify_request_itemJSON) { OpenAPI_qos_flow_add_modify_request_item_t *qos_flow_add_modify_request_item_local_var = NULL; - cJSON *qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "qfi"); + OpenAPI_lnode_t *node = NULL; + cJSON *qfi = NULL; + cJSON *ebi = NULL; + cJSON *qos_rules = NULL; + cJSON *qos_flow_description = NULL; + cJSON *qos_flow_profile = NULL; + OpenAPI_qos_flow_profile_t *qos_flow_profile_local_nonprim = NULL; + cJSON *associated_an_type = NULL; + OpenAPI_qos_flow_access_type_e associated_an_typeVariable = 0; + qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "qfi"); if (!qfi) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_parseFromJSON() failed [qfi]"); goto end; } - if (!cJSON_IsNumber(qfi)) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_parseFromJSON() failed [qfi]"); goto end; } - cJSON *ebi = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "ebi"); - + ebi = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "ebi"); if (ebi) { if (!cJSON_IsNumber(ebi)) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_parseFromJSON() failed [ebi]"); @@ -121,34 +141,28 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_ } } - cJSON *qos_rules = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "qosRules"); - + qos_rules = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "qosRules"); if (qos_rules) { - if (!cJSON_IsNumber(qos_rules)) { + if (!cJSON_IsString(qos_rules) && !cJSON_IsNull(qos_rules)) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_parseFromJSON() failed [qos_rules]"); goto end; } } - cJSON *qos_flow_description = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "qosFlowDescription"); - + qos_flow_description = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "qosFlowDescription"); if (qos_flow_description) { - if (!cJSON_IsNumber(qos_flow_description)) { + if (!cJSON_IsString(qos_flow_description) && !cJSON_IsNull(qos_flow_description)) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_parseFromJSON() failed [qos_flow_description]"); goto end; } } - cJSON *qos_flow_profile = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "qosFlowProfile"); - - OpenAPI_qos_flow_profile_t *qos_flow_profile_local_nonprim = NULL; + qos_flow_profile = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "qosFlowProfile"); if (qos_flow_profile) { qos_flow_profile_local_nonprim = OpenAPI_qos_flow_profile_parseFromJSON(qos_flow_profile); } - cJSON *associated_an_type = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "associatedAnType"); - - OpenAPI_qos_flow_access_type_e associated_an_typeVariable; + associated_an_type = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "associatedAnType"); if (associated_an_type) { if (!cJSON_IsString(associated_an_type)) { ogs_error("OpenAPI_qos_flow_add_modify_request_item_parseFromJSON() failed [associated_an_type]"); @@ -162,14 +176,18 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_ qfi->valuedouble, ebi ? true : false, ebi ? ebi->valuedouble : 0, - qos_rules ? qos_rules->valueint : 0, - qos_flow_description ? qos_flow_description->valueint : 0, + qos_rules && !cJSON_IsNull(qos_rules) ? ogs_strdup(qos_rules->valuestring) : NULL, + qos_flow_description && !cJSON_IsNull(qos_flow_description) ? ogs_strdup(qos_flow_description->valuestring) : NULL, qos_flow_profile ? qos_flow_profile_local_nonprim : NULL, associated_an_type ? associated_an_typeVariable : 0 ); return qos_flow_add_modify_request_item_local_var; end: + if (qos_flow_profile_local_nonprim) { + OpenAPI_qos_flow_profile_free(qos_flow_profile_local_nonprim); + qos_flow_profile_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/qos_flow_add_modify_request_item.h b/lib/sbi/openapi/model/qos_flow_add_modify_request_item.h index 9a092f565..88ee6b642 100644 --- a/lib/sbi/openapi/model/qos_flow_add_modify_request_item.h +++ b/lib/sbi/openapi/model/qos_flow_add_modify_request_item.h @@ -24,8 +24,8 @@ typedef struct OpenAPI_qos_flow_add_modify_request_item_s { int qfi; bool is_ebi; int ebi; - char qos_rules; - char qos_flow_description; + char *qos_rules; + char *qos_flow_description; struct OpenAPI_qos_flow_profile_s *qos_flow_profile; OpenAPI_qos_flow_access_type_e associated_an_type; } OpenAPI_qos_flow_add_modify_request_item_t; @@ -34,8 +34,8 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_ int qfi, bool is_ebi, int ebi, - char qos_rules, - char qos_flow_description, + char *qos_rules, + char *qos_flow_description, OpenAPI_qos_flow_profile_t *qos_flow_profile, OpenAPI_qos_flow_access_type_e associated_an_type ); diff --git a/lib/sbi/openapi/model/qos_flow_item.c b/lib/sbi/openapi/model/qos_flow_item.c index 8ad3c0efe..3fd3de4b9 100644 --- a/lib/sbi/openapi/model/qos_flow_item.c +++ b/lib/sbi/openapi/model/qos_flow_item.c @@ -28,16 +28,18 @@ OpenAPI_qos_flow_item_t *OpenAPI_qos_flow_item_create( void OpenAPI_qos_flow_item_free(OpenAPI_qos_flow_item_t *qos_flow_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_flow_item) { return; } - OpenAPI_lnode_t *node; ogs_free(qos_flow_item); } cJSON *OpenAPI_qos_flow_item_convertToJSON(OpenAPI_qos_flow_item_t *qos_flow_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_flow_item == NULL) { ogs_error("OpenAPI_qos_flow_item_convertToJSON() failed [QosFlowItem]"); @@ -50,7 +52,7 @@ cJSON *OpenAPI_qos_flow_item_convertToJSON(OpenAPI_qos_flow_item_t *qos_flow_ite goto end; } - if (qos_flow_item->cause) { + if (qos_flow_item->cause != OpenAPI_cause_NULL) { if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(qos_flow_item->cause)) == NULL) { ogs_error("OpenAPI_qos_flow_item_convertToJSON() failed [cause]"); goto end; @@ -78,20 +80,23 @@ end: OpenAPI_qos_flow_item_t *OpenAPI_qos_flow_item_parseFromJSON(cJSON *qos_flow_itemJSON) { OpenAPI_qos_flow_item_t *qos_flow_item_local_var = NULL; - cJSON *qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "qfi"); + OpenAPI_lnode_t *node = NULL; + cJSON *qfi = NULL; + cJSON *cause = NULL; + OpenAPI_cause_e causeVariable = 0; + cJSON *current_qos_profile_index = NULL; + cJSON *null_qo_s_profile_index = NULL; + qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "qfi"); if (!qfi) { ogs_error("OpenAPI_qos_flow_item_parseFromJSON() failed [qfi]"); goto end; } - if (!cJSON_IsNumber(qfi)) { ogs_error("OpenAPI_qos_flow_item_parseFromJSON() failed [qfi]"); goto end; } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "cause"); - - OpenAPI_cause_e causeVariable; + cause = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "cause"); if (cause) { if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_qos_flow_item_parseFromJSON() failed [cause]"); @@ -100,8 +105,7 @@ OpenAPI_qos_flow_item_t *OpenAPI_qos_flow_item_parseFromJSON(cJSON *qos_flow_ite causeVariable = OpenAPI_cause_FromString(cause->valuestring); } - cJSON *current_qos_profile_index = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "currentQosProfileIndex"); - + current_qos_profile_index = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "currentQosProfileIndex"); if (current_qos_profile_index) { if (!cJSON_IsNumber(current_qos_profile_index)) { ogs_error("OpenAPI_qos_flow_item_parseFromJSON() failed [current_qos_profile_index]"); @@ -109,8 +113,7 @@ OpenAPI_qos_flow_item_t *OpenAPI_qos_flow_item_parseFromJSON(cJSON *qos_flow_ite } } - cJSON *null_qo_s_profile_index = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "nullQoSProfileIndex"); - + null_qo_s_profile_index = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "nullQoSProfileIndex"); if (null_qo_s_profile_index) { if (!cJSON_IsBool(null_qo_s_profile_index)) { ogs_error("OpenAPI_qos_flow_item_parseFromJSON() failed [null_qo_s_profile_index]"); diff --git a/lib/sbi/openapi/model/qos_flow_notify_item.c b/lib/sbi/openapi/model/qos_flow_notify_item.c index add3ce3ba..c92072552 100644 --- a/lib/sbi/openapi/model/qos_flow_notify_item.c +++ b/lib/sbi/openapi/model/qos_flow_notify_item.c @@ -28,16 +28,18 @@ OpenAPI_qos_flow_notify_item_t *OpenAPI_qos_flow_notify_item_create( void OpenAPI_qos_flow_notify_item_free(OpenAPI_qos_flow_notify_item_t *qos_flow_notify_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_flow_notify_item) { return; } - OpenAPI_lnode_t *node; ogs_free(qos_flow_notify_item); } cJSON *OpenAPI_qos_flow_notify_item_convertToJSON(OpenAPI_qos_flow_notify_item_t *qos_flow_notify_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_flow_notify_item == NULL) { ogs_error("OpenAPI_qos_flow_notify_item_convertToJSON() failed [QosFlowNotifyItem]"); @@ -50,6 +52,10 @@ cJSON *OpenAPI_qos_flow_notify_item_convertToJSON(OpenAPI_qos_flow_notify_item_t goto end; } + if (qos_flow_notify_item->notification_cause == OpenAPI_notification_cause_NULL) { + ogs_error("OpenAPI_qos_flow_notify_item_convertToJSON() failed [notification_cause]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationCause", OpenAPI_notification_cause_ToString(qos_flow_notify_item->notification_cause)) == NULL) { ogs_error("OpenAPI_qos_flow_notify_item_convertToJSON() failed [notification_cause]"); goto end; @@ -76,32 +82,34 @@ end: OpenAPI_qos_flow_notify_item_t *OpenAPI_qos_flow_notify_item_parseFromJSON(cJSON *qos_flow_notify_itemJSON) { OpenAPI_qos_flow_notify_item_t *qos_flow_notify_item_local_var = NULL; - cJSON *qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_notify_itemJSON, "qfi"); + OpenAPI_lnode_t *node = NULL; + cJSON *qfi = NULL; + cJSON *notification_cause = NULL; + OpenAPI_notification_cause_e notification_causeVariable = 0; + cJSON *current_qos_profile_index = NULL; + cJSON *null_qo_s_profile_index = NULL; + qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_notify_itemJSON, "qfi"); if (!qfi) { ogs_error("OpenAPI_qos_flow_notify_item_parseFromJSON() failed [qfi]"); goto end; } - if (!cJSON_IsNumber(qfi)) { ogs_error("OpenAPI_qos_flow_notify_item_parseFromJSON() failed [qfi]"); goto end; } - cJSON *notification_cause = cJSON_GetObjectItemCaseSensitive(qos_flow_notify_itemJSON, "notificationCause"); + notification_cause = cJSON_GetObjectItemCaseSensitive(qos_flow_notify_itemJSON, "notificationCause"); if (!notification_cause) { ogs_error("OpenAPI_qos_flow_notify_item_parseFromJSON() failed [notification_cause]"); goto end; } - - OpenAPI_notification_cause_e notification_causeVariable; if (!cJSON_IsString(notification_cause)) { ogs_error("OpenAPI_qos_flow_notify_item_parseFromJSON() failed [notification_cause]"); goto end; } notification_causeVariable = OpenAPI_notification_cause_FromString(notification_cause->valuestring); - cJSON *current_qos_profile_index = cJSON_GetObjectItemCaseSensitive(qos_flow_notify_itemJSON, "currentQosProfileIndex"); - + current_qos_profile_index = cJSON_GetObjectItemCaseSensitive(qos_flow_notify_itemJSON, "currentQosProfileIndex"); if (current_qos_profile_index) { if (!cJSON_IsNumber(current_qos_profile_index)) { ogs_error("OpenAPI_qos_flow_notify_item_parseFromJSON() failed [current_qos_profile_index]"); @@ -109,8 +117,7 @@ OpenAPI_qos_flow_notify_item_t *OpenAPI_qos_flow_notify_item_parseFromJSON(cJSON } } - cJSON *null_qo_s_profile_index = cJSON_GetObjectItemCaseSensitive(qos_flow_notify_itemJSON, "nullQoSProfileIndex"); - + null_qo_s_profile_index = cJSON_GetObjectItemCaseSensitive(qos_flow_notify_itemJSON, "nullQoSProfileIndex"); if (null_qo_s_profile_index) { if (!cJSON_IsBool(null_qo_s_profile_index)) { ogs_error("OpenAPI_qos_flow_notify_item_parseFromJSON() failed [null_qo_s_profile_index]"); diff --git a/lib/sbi/openapi/model/qos_flow_profile.c b/lib/sbi/openapi/model/qos_flow_profile.c index 0de401c61..ffbb7794f 100644 --- a/lib/sbi/openapi/model/qos_flow_profile.c +++ b/lib/sbi/openapi/model/qos_flow_profile.c @@ -36,20 +36,34 @@ OpenAPI_qos_flow_profile_t *OpenAPI_qos_flow_profile_create( void OpenAPI_qos_flow_profile_free(OpenAPI_qos_flow_profile_t *qos_flow_profile) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_flow_profile) { return; } - OpenAPI_lnode_t *node; - OpenAPI_non_dynamic5_qi_free(qos_flow_profile->non_dynamic5_qi); - OpenAPI_dynamic5_qi_free(qos_flow_profile->dynamic5_qi); - OpenAPI_arp_free(qos_flow_profile->arp); - OpenAPI_gbr_qos_flow_information_free(qos_flow_profile->gbr_qos_flow_info); + if (qos_flow_profile->non_dynamic5_qi) { + OpenAPI_non_dynamic5_qi_free(qos_flow_profile->non_dynamic5_qi); + qos_flow_profile->non_dynamic5_qi = NULL; + } + if (qos_flow_profile->dynamic5_qi) { + OpenAPI_dynamic5_qi_free(qos_flow_profile->dynamic5_qi); + qos_flow_profile->dynamic5_qi = NULL; + } + if (qos_flow_profile->arp) { + OpenAPI_arp_free(qos_flow_profile->arp); + qos_flow_profile->arp = NULL; + } + if (qos_flow_profile->gbr_qos_flow_info) { + OpenAPI_gbr_qos_flow_information_free(qos_flow_profile->gbr_qos_flow_info); + qos_flow_profile->gbr_qos_flow_info = NULL; + } ogs_free(qos_flow_profile); } cJSON *OpenAPI_qos_flow_profile_convertToJSON(OpenAPI_qos_flow_profile_t *qos_flow_profile) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_flow_profile == NULL) { ogs_error("OpenAPI_qos_flow_profile_convertToJSON() failed [QosFlowProfile]"); @@ -114,21 +128,21 @@ cJSON *OpenAPI_qos_flow_profile_convertToJSON(OpenAPI_qos_flow_profile_t *qos_fl } } - if (qos_flow_profile->rqa) { + if (qos_flow_profile->rqa != OpenAPI_reflective_qo_s_attribute_NULL) { if (cJSON_AddStringToObject(item, "rqa", OpenAPI_reflective_qo_s_attribute_ToString(qos_flow_profile->rqa)) == NULL) { ogs_error("OpenAPI_qos_flow_profile_convertToJSON() failed [rqa]"); goto end; } } - if (qos_flow_profile->additional_qos_flow_info) { + if (qos_flow_profile->additional_qos_flow_info != OpenAPI_additional_qos_flow_info_NULL) { if (cJSON_AddStringToObject(item, "additionalQosFlowInfo", OpenAPI_additional_qos_flow_info_ToString(qos_flow_profile->additional_qos_flow_info)) == NULL) { ogs_error("OpenAPI_qos_flow_profile_convertToJSON() failed [additional_qos_flow_info]"); goto end; } } - if (qos_flow_profile->qos_monitoring_req) { + if (qos_flow_profile->qos_monitoring_req != OpenAPI_qos_monitoring_req_NULL) { if (cJSON_AddStringToObject(item, "qosMonitoringReq", OpenAPI_qos_monitoring_req_ToString(qos_flow_profile->qos_monitoring_req)) == NULL) { ogs_error("OpenAPI_qos_flow_profile_convertToJSON() failed [qos_monitoring_req]"); goto end; @@ -149,48 +163,54 @@ end: OpenAPI_qos_flow_profile_t *OpenAPI_qos_flow_profile_parseFromJSON(cJSON *qos_flow_profileJSON) { OpenAPI_qos_flow_profile_t *qos_flow_profile_local_var = NULL; - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "5qi"); + OpenAPI_lnode_t *node = NULL; + cJSON *_5qi = NULL; + cJSON *non_dynamic5_qi = NULL; + OpenAPI_non_dynamic5_qi_t *non_dynamic5_qi_local_nonprim = NULL; + cJSON *dynamic5_qi = NULL; + OpenAPI_dynamic5_qi_t *dynamic5_qi_local_nonprim = NULL; + cJSON *arp = NULL; + OpenAPI_arp_t *arp_local_nonprim = NULL; + cJSON *gbr_qos_flow_info = NULL; + OpenAPI_gbr_qos_flow_information_t *gbr_qos_flow_info_local_nonprim = NULL; + cJSON *rqa = NULL; + OpenAPI_reflective_qo_s_attribute_e rqaVariable = 0; + cJSON *additional_qos_flow_info = NULL; + OpenAPI_additional_qos_flow_info_e additional_qos_flow_infoVariable = 0; + cJSON *qos_monitoring_req = NULL; + OpenAPI_qos_monitoring_req_e qos_monitoring_reqVariable = 0; + cJSON *qos_rep_period = NULL; + _5qi = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "5qi"); if (!_5qi) { ogs_error("OpenAPI_qos_flow_profile_parseFromJSON() failed [_5qi]"); goto end; } - if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_qos_flow_profile_parseFromJSON() failed [_5qi]"); goto end; } - cJSON *non_dynamic5_qi = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "nonDynamic5Qi"); - - OpenAPI_non_dynamic5_qi_t *non_dynamic5_qi_local_nonprim = NULL; + non_dynamic5_qi = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "nonDynamic5Qi"); if (non_dynamic5_qi) { non_dynamic5_qi_local_nonprim = OpenAPI_non_dynamic5_qi_parseFromJSON(non_dynamic5_qi); } - cJSON *dynamic5_qi = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "dynamic5Qi"); - - OpenAPI_dynamic5_qi_t *dynamic5_qi_local_nonprim = NULL; + dynamic5_qi = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "dynamic5Qi"); if (dynamic5_qi) { dynamic5_qi_local_nonprim = OpenAPI_dynamic5_qi_parseFromJSON(dynamic5_qi); } - cJSON *arp = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "arp"); - - OpenAPI_arp_t *arp_local_nonprim = NULL; + arp = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "arp"); if (arp) { arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp); } - cJSON *gbr_qos_flow_info = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "gbrQosFlowInfo"); - - OpenAPI_gbr_qos_flow_information_t *gbr_qos_flow_info_local_nonprim = NULL; + gbr_qos_flow_info = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "gbrQosFlowInfo"); if (gbr_qos_flow_info) { gbr_qos_flow_info_local_nonprim = OpenAPI_gbr_qos_flow_information_parseFromJSON(gbr_qos_flow_info); } - cJSON *rqa = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "rqa"); - - OpenAPI_reflective_qo_s_attribute_e rqaVariable; + rqa = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "rqa"); if (rqa) { if (!cJSON_IsString(rqa)) { ogs_error("OpenAPI_qos_flow_profile_parseFromJSON() failed [rqa]"); @@ -199,9 +219,7 @@ OpenAPI_qos_flow_profile_t *OpenAPI_qos_flow_profile_parseFromJSON(cJSON *qos_fl rqaVariable = OpenAPI_reflective_qo_s_attribute_FromString(rqa->valuestring); } - cJSON *additional_qos_flow_info = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "additionalQosFlowInfo"); - - OpenAPI_additional_qos_flow_info_e additional_qos_flow_infoVariable; + additional_qos_flow_info = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "additionalQosFlowInfo"); if (additional_qos_flow_info) { if (!cJSON_IsString(additional_qos_flow_info)) { ogs_error("OpenAPI_qos_flow_profile_parseFromJSON() failed [additional_qos_flow_info]"); @@ -210,9 +228,7 @@ OpenAPI_qos_flow_profile_t *OpenAPI_qos_flow_profile_parseFromJSON(cJSON *qos_fl additional_qos_flow_infoVariable = OpenAPI_additional_qos_flow_info_FromString(additional_qos_flow_info->valuestring); } - cJSON *qos_monitoring_req = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "qosMonitoringReq"); - - OpenAPI_qos_monitoring_req_e qos_monitoring_reqVariable; + qos_monitoring_req = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "qosMonitoringReq"); if (qos_monitoring_req) { if (!cJSON_IsString(qos_monitoring_req)) { ogs_error("OpenAPI_qos_flow_profile_parseFromJSON() failed [qos_monitoring_req]"); @@ -221,8 +237,7 @@ OpenAPI_qos_flow_profile_t *OpenAPI_qos_flow_profile_parseFromJSON(cJSON *qos_fl qos_monitoring_reqVariable = OpenAPI_qos_monitoring_req_FromString(qos_monitoring_req->valuestring); } - cJSON *qos_rep_period = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "qosRepPeriod"); - + qos_rep_period = cJSON_GetObjectItemCaseSensitive(qos_flow_profileJSON, "qosRepPeriod"); if (qos_rep_period) { if (!cJSON_IsNumber(qos_rep_period)) { ogs_error("OpenAPI_qos_flow_profile_parseFromJSON() failed [qos_rep_period]"); @@ -246,6 +261,22 @@ OpenAPI_qos_flow_profile_t *OpenAPI_qos_flow_profile_parseFromJSON(cJSON *qos_fl return qos_flow_profile_local_var; end: + if (non_dynamic5_qi_local_nonprim) { + OpenAPI_non_dynamic5_qi_free(non_dynamic5_qi_local_nonprim); + non_dynamic5_qi_local_nonprim = NULL; + } + if (dynamic5_qi_local_nonprim) { + OpenAPI_dynamic5_qi_free(dynamic5_qi_local_nonprim); + dynamic5_qi_local_nonprim = NULL; + } + if (arp_local_nonprim) { + OpenAPI_arp_free(arp_local_nonprim); + arp_local_nonprim = NULL; + } + if (gbr_qos_flow_info_local_nonprim) { + OpenAPI_gbr_qos_flow_information_free(gbr_qos_flow_info_local_nonprim); + gbr_qos_flow_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/qos_flow_release_request_item.c b/lib/sbi/openapi/model/qos_flow_release_request_item.c index 6d297a98a..f0671f747 100644 --- a/lib/sbi/openapi/model/qos_flow_release_request_item.c +++ b/lib/sbi/openapi/model/qos_flow_release_request_item.c @@ -6,8 +6,8 @@ OpenAPI_qos_flow_release_request_item_t *OpenAPI_qos_flow_release_request_item_create( int qfi, - char qos_rules, - char qos_flow_description + char *qos_rules, + char *qos_flow_description ) { OpenAPI_qos_flow_release_request_item_t *qos_flow_release_request_item_local_var = ogs_malloc(sizeof(OpenAPI_qos_flow_release_request_item_t)); @@ -22,16 +22,26 @@ OpenAPI_qos_flow_release_request_item_t *OpenAPI_qos_flow_release_request_item_c void OpenAPI_qos_flow_release_request_item_free(OpenAPI_qos_flow_release_request_item_t *qos_flow_release_request_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_flow_release_request_item) { return; } - OpenAPI_lnode_t *node; + if (qos_flow_release_request_item->qos_rules) { + ogs_free(qos_flow_release_request_item->qos_rules); + qos_flow_release_request_item->qos_rules = NULL; + } + if (qos_flow_release_request_item->qos_flow_description) { + ogs_free(qos_flow_release_request_item->qos_flow_description); + qos_flow_release_request_item->qos_flow_description = NULL; + } ogs_free(qos_flow_release_request_item); } cJSON *OpenAPI_qos_flow_release_request_item_convertToJSON(OpenAPI_qos_flow_release_request_item_t *qos_flow_release_request_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_flow_release_request_item == NULL) { ogs_error("OpenAPI_qos_flow_release_request_item_convertToJSON() failed [QosFlowReleaseRequestItem]"); @@ -45,14 +55,14 @@ cJSON *OpenAPI_qos_flow_release_request_item_convertToJSON(OpenAPI_qos_flow_rele } if (qos_flow_release_request_item->qos_rules) { - if (cJSON_AddNumberToObject(item, "qosRules", qos_flow_release_request_item->qos_rules) == NULL) { + if (cJSON_AddStringToObject(item, "qosRules", qos_flow_release_request_item->qos_rules) == NULL) { ogs_error("OpenAPI_qos_flow_release_request_item_convertToJSON() failed [qos_rules]"); goto end; } } if (qos_flow_release_request_item->qos_flow_description) { - if (cJSON_AddNumberToObject(item, "qosFlowDescription", qos_flow_release_request_item->qos_flow_description) == NULL) { + if (cJSON_AddStringToObject(item, "qosFlowDescription", qos_flow_release_request_item->qos_flow_description) == NULL) { ogs_error("OpenAPI_qos_flow_release_request_item_convertToJSON() failed [qos_flow_description]"); goto end; } @@ -65,30 +75,31 @@ end: OpenAPI_qos_flow_release_request_item_t *OpenAPI_qos_flow_release_request_item_parseFromJSON(cJSON *qos_flow_release_request_itemJSON) { OpenAPI_qos_flow_release_request_item_t *qos_flow_release_request_item_local_var = NULL; - cJSON *qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_release_request_itemJSON, "qfi"); + OpenAPI_lnode_t *node = NULL; + cJSON *qfi = NULL; + cJSON *qos_rules = NULL; + cJSON *qos_flow_description = NULL; + qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_release_request_itemJSON, "qfi"); if (!qfi) { ogs_error("OpenAPI_qos_flow_release_request_item_parseFromJSON() failed [qfi]"); goto end; } - if (!cJSON_IsNumber(qfi)) { ogs_error("OpenAPI_qos_flow_release_request_item_parseFromJSON() failed [qfi]"); goto end; } - cJSON *qos_rules = cJSON_GetObjectItemCaseSensitive(qos_flow_release_request_itemJSON, "qosRules"); - + qos_rules = cJSON_GetObjectItemCaseSensitive(qos_flow_release_request_itemJSON, "qosRules"); if (qos_rules) { - if (!cJSON_IsNumber(qos_rules)) { + if (!cJSON_IsString(qos_rules) && !cJSON_IsNull(qos_rules)) { ogs_error("OpenAPI_qos_flow_release_request_item_parseFromJSON() failed [qos_rules]"); goto end; } } - cJSON *qos_flow_description = cJSON_GetObjectItemCaseSensitive(qos_flow_release_request_itemJSON, "qosFlowDescription"); - + qos_flow_description = cJSON_GetObjectItemCaseSensitive(qos_flow_release_request_itemJSON, "qosFlowDescription"); if (qos_flow_description) { - if (!cJSON_IsNumber(qos_flow_description)) { + if (!cJSON_IsString(qos_flow_description) && !cJSON_IsNull(qos_flow_description)) { ogs_error("OpenAPI_qos_flow_release_request_item_parseFromJSON() failed [qos_flow_description]"); goto end; } @@ -97,8 +108,8 @@ OpenAPI_qos_flow_release_request_item_t *OpenAPI_qos_flow_release_request_item_p qos_flow_release_request_item_local_var = OpenAPI_qos_flow_release_request_item_create ( qfi->valuedouble, - qos_rules ? qos_rules->valueint : 0, - qos_flow_description ? qos_flow_description->valueint : 0 + qos_rules && !cJSON_IsNull(qos_rules) ? ogs_strdup(qos_rules->valuestring) : NULL, + qos_flow_description && !cJSON_IsNull(qos_flow_description) ? ogs_strdup(qos_flow_description->valuestring) : NULL ); return qos_flow_release_request_item_local_var; diff --git a/lib/sbi/openapi/model/qos_flow_release_request_item.h b/lib/sbi/openapi/model/qos_flow_release_request_item.h index 981d86b00..fb523f37c 100644 --- a/lib/sbi/openapi/model/qos_flow_release_request_item.h +++ b/lib/sbi/openapi/model/qos_flow_release_request_item.h @@ -20,14 +20,14 @@ extern "C" { typedef struct OpenAPI_qos_flow_release_request_item_s OpenAPI_qos_flow_release_request_item_t; typedef struct OpenAPI_qos_flow_release_request_item_s { int qfi; - char qos_rules; - char qos_flow_description; + char *qos_rules; + char *qos_flow_description; } OpenAPI_qos_flow_release_request_item_t; OpenAPI_qos_flow_release_request_item_t *OpenAPI_qos_flow_release_request_item_create( int qfi, - char qos_rules, - char qos_flow_description + char *qos_rules, + char *qos_flow_description ); void OpenAPI_qos_flow_release_request_item_free(OpenAPI_qos_flow_release_request_item_t *qos_flow_release_request_item); OpenAPI_qos_flow_release_request_item_t *OpenAPI_qos_flow_release_request_item_parseFromJSON(cJSON *qos_flow_release_request_itemJSON); diff --git a/lib/sbi/openapi/model/qos_flow_setup_item.c b/lib/sbi/openapi/model/qos_flow_setup_item.c index f5e49d73a..0d5cc253e 100644 --- a/lib/sbi/openapi/model/qos_flow_setup_item.c +++ b/lib/sbi/openapi/model/qos_flow_setup_item.c @@ -6,10 +6,10 @@ OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_create( int qfi, - char qos_rules, + char *qos_rules, bool is_ebi, int ebi, - char qos_flow_description, + char *qos_flow_description, OpenAPI_qos_flow_profile_t *qos_flow_profile, OpenAPI_qos_flow_access_type_e associated_an_type ) @@ -30,17 +30,30 @@ OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_create( void OpenAPI_qos_flow_setup_item_free(OpenAPI_qos_flow_setup_item_t *qos_flow_setup_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_flow_setup_item) { return; } - OpenAPI_lnode_t *node; - OpenAPI_qos_flow_profile_free(qos_flow_setup_item->qos_flow_profile); + if (qos_flow_setup_item->qos_rules) { + ogs_free(qos_flow_setup_item->qos_rules); + qos_flow_setup_item->qos_rules = NULL; + } + if (qos_flow_setup_item->qos_flow_description) { + ogs_free(qos_flow_setup_item->qos_flow_description); + qos_flow_setup_item->qos_flow_description = NULL; + } + if (qos_flow_setup_item->qos_flow_profile) { + OpenAPI_qos_flow_profile_free(qos_flow_setup_item->qos_flow_profile); + qos_flow_setup_item->qos_flow_profile = NULL; + } ogs_free(qos_flow_setup_item); } cJSON *OpenAPI_qos_flow_setup_item_convertToJSON(OpenAPI_qos_flow_setup_item_t *qos_flow_setup_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_flow_setup_item == NULL) { ogs_error("OpenAPI_qos_flow_setup_item_convertToJSON() failed [QosFlowSetupItem]"); @@ -53,7 +66,11 @@ cJSON *OpenAPI_qos_flow_setup_item_convertToJSON(OpenAPI_qos_flow_setup_item_t * goto end; } - if (cJSON_AddNumberToObject(item, "qosRules", qos_flow_setup_item->qos_rules) == NULL) { + if (!qos_flow_setup_item->qos_rules) { + ogs_error("OpenAPI_qos_flow_setup_item_convertToJSON() failed [qos_rules]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "qosRules", qos_flow_setup_item->qos_rules) == NULL) { ogs_error("OpenAPI_qos_flow_setup_item_convertToJSON() failed [qos_rules]"); goto end; } @@ -66,7 +83,7 @@ cJSON *OpenAPI_qos_flow_setup_item_convertToJSON(OpenAPI_qos_flow_setup_item_t * } if (qos_flow_setup_item->qos_flow_description) { - if (cJSON_AddNumberToObject(item, "qosFlowDescription", qos_flow_setup_item->qos_flow_description) == NULL) { + if (cJSON_AddStringToObject(item, "qosFlowDescription", qos_flow_setup_item->qos_flow_description) == NULL) { ogs_error("OpenAPI_qos_flow_setup_item_convertToJSON() failed [qos_flow_description]"); goto end; } @@ -85,7 +102,7 @@ cJSON *OpenAPI_qos_flow_setup_item_convertToJSON(OpenAPI_qos_flow_setup_item_t * } } - if (qos_flow_setup_item->associated_an_type) { + if (qos_flow_setup_item->associated_an_type != OpenAPI_qos_flow_access_type_NULL) { if (cJSON_AddStringToObject(item, "associatedAnType", OpenAPI_qos_flow_access_type_ToString(qos_flow_setup_item->associated_an_type)) == NULL) { ogs_error("OpenAPI_qos_flow_setup_item_convertToJSON() failed [associated_an_type]"); goto end; @@ -99,30 +116,36 @@ end: OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_parseFromJSON(cJSON *qos_flow_setup_itemJSON) { OpenAPI_qos_flow_setup_item_t *qos_flow_setup_item_local_var = NULL; - cJSON *qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "qfi"); + OpenAPI_lnode_t *node = NULL; + cJSON *qfi = NULL; + cJSON *qos_rules = NULL; + cJSON *ebi = NULL; + cJSON *qos_flow_description = NULL; + cJSON *qos_flow_profile = NULL; + OpenAPI_qos_flow_profile_t *qos_flow_profile_local_nonprim = NULL; + cJSON *associated_an_type = NULL; + OpenAPI_qos_flow_access_type_e associated_an_typeVariable = 0; + qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "qfi"); if (!qfi) { ogs_error("OpenAPI_qos_flow_setup_item_parseFromJSON() failed [qfi]"); goto end; } - if (!cJSON_IsNumber(qfi)) { ogs_error("OpenAPI_qos_flow_setup_item_parseFromJSON() failed [qfi]"); goto end; } - cJSON *qos_rules = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "qosRules"); + qos_rules = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "qosRules"); if (!qos_rules) { ogs_error("OpenAPI_qos_flow_setup_item_parseFromJSON() failed [qos_rules]"); goto end; } - - if (!cJSON_IsNumber(qos_rules)) { + if (!cJSON_IsString(qos_rules)) { ogs_error("OpenAPI_qos_flow_setup_item_parseFromJSON() failed [qos_rules]"); goto end; } - cJSON *ebi = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "ebi"); - + ebi = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "ebi"); if (ebi) { if (!cJSON_IsNumber(ebi)) { ogs_error("OpenAPI_qos_flow_setup_item_parseFromJSON() failed [ebi]"); @@ -130,25 +153,20 @@ OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_parseFromJSON(cJSON * } } - cJSON *qos_flow_description = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "qosFlowDescription"); - + qos_flow_description = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "qosFlowDescription"); if (qos_flow_description) { - if (!cJSON_IsNumber(qos_flow_description)) { + if (!cJSON_IsString(qos_flow_description) && !cJSON_IsNull(qos_flow_description)) { ogs_error("OpenAPI_qos_flow_setup_item_parseFromJSON() failed [qos_flow_description]"); goto end; } } - cJSON *qos_flow_profile = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "qosFlowProfile"); - - OpenAPI_qos_flow_profile_t *qos_flow_profile_local_nonprim = NULL; + qos_flow_profile = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "qosFlowProfile"); if (qos_flow_profile) { qos_flow_profile_local_nonprim = OpenAPI_qos_flow_profile_parseFromJSON(qos_flow_profile); } - cJSON *associated_an_type = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "associatedAnType"); - - OpenAPI_qos_flow_access_type_e associated_an_typeVariable; + associated_an_type = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "associatedAnType"); if (associated_an_type) { if (!cJSON_IsString(associated_an_type)) { ogs_error("OpenAPI_qos_flow_setup_item_parseFromJSON() failed [associated_an_type]"); @@ -160,16 +178,20 @@ OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_parseFromJSON(cJSON * qos_flow_setup_item_local_var = OpenAPI_qos_flow_setup_item_create ( qfi->valuedouble, - qos_rules->valueint, + ogs_strdup(qos_rules->valuestring), ebi ? true : false, ebi ? ebi->valuedouble : 0, - qos_flow_description ? qos_flow_description->valueint : 0, + qos_flow_description && !cJSON_IsNull(qos_flow_description) ? ogs_strdup(qos_flow_description->valuestring) : NULL, qos_flow_profile ? qos_flow_profile_local_nonprim : NULL, associated_an_type ? associated_an_typeVariable : 0 ); return qos_flow_setup_item_local_var; end: + if (qos_flow_profile_local_nonprim) { + OpenAPI_qos_flow_profile_free(qos_flow_profile_local_nonprim); + qos_flow_profile_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/qos_flow_setup_item.h b/lib/sbi/openapi/model/qos_flow_setup_item.h index 38a3ec961..18f4fd4ed 100644 --- a/lib/sbi/openapi/model/qos_flow_setup_item.h +++ b/lib/sbi/openapi/model/qos_flow_setup_item.h @@ -22,20 +22,20 @@ extern "C" { typedef struct OpenAPI_qos_flow_setup_item_s OpenAPI_qos_flow_setup_item_t; typedef struct OpenAPI_qos_flow_setup_item_s { int qfi; - char qos_rules; + char *qos_rules; bool is_ebi; int ebi; - char qos_flow_description; + char *qos_flow_description; struct OpenAPI_qos_flow_profile_s *qos_flow_profile; OpenAPI_qos_flow_access_type_e associated_an_type; } OpenAPI_qos_flow_setup_item_t; OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_create( int qfi, - char qos_rules, + char *qos_rules, bool is_ebi, int ebi, - char qos_flow_description, + char *qos_flow_description, OpenAPI_qos_flow_profile_t *qos_flow_profile, OpenAPI_qos_flow_access_type_e associated_an_type ); diff --git a/lib/sbi/openapi/model/qos_flow_tunnel.c b/lib/sbi/openapi/model/qos_flow_tunnel.c index 333699ebe..524c41502 100644 --- a/lib/sbi/openapi/model/qos_flow_tunnel.c +++ b/lib/sbi/openapi/model/qos_flow_tunnel.c @@ -20,21 +20,29 @@ OpenAPI_qos_flow_tunnel_t *OpenAPI_qos_flow_tunnel_create( void OpenAPI_qos_flow_tunnel_free(OpenAPI_qos_flow_tunnel_t *qos_flow_tunnel) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_flow_tunnel) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(qos_flow_tunnel->qfi_list, node) { - ogs_free(node->data); + if (qos_flow_tunnel->qfi_list) { + OpenAPI_list_for_each(qos_flow_tunnel->qfi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(qos_flow_tunnel->qfi_list); + qos_flow_tunnel->qfi_list = NULL; + } + if (qos_flow_tunnel->tunnel_info) { + OpenAPI_tunnel_info_free(qos_flow_tunnel->tunnel_info); + qos_flow_tunnel->tunnel_info = NULL; } - OpenAPI_list_free(qos_flow_tunnel->qfi_list); - OpenAPI_tunnel_info_free(qos_flow_tunnel->tunnel_info); ogs_free(qos_flow_tunnel); } cJSON *OpenAPI_qos_flow_tunnel_convertToJSON(OpenAPI_qos_flow_tunnel_t *qos_flow_tunnel) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_flow_tunnel == NULL) { ogs_error("OpenAPI_qos_flow_tunnel_convertToJSON() failed [QosFlowTunnel]"); @@ -42,20 +50,26 @@ cJSON *OpenAPI_qos_flow_tunnel_convertToJSON(OpenAPI_qos_flow_tunnel_t *qos_flow } item = cJSON_CreateObject(); - cJSON *qfi_list = cJSON_AddArrayToObject(item, "qfiList"); - if (qfi_list == NULL) { + if (!qos_flow_tunnel->qfi_list) { + ogs_error("OpenAPI_qos_flow_tunnel_convertToJSON() failed [qfi_list]"); + return NULL; + } + cJSON *qfi_listList = cJSON_AddArrayToObject(item, "qfiList"); + if (qfi_listList == NULL) { ogs_error("OpenAPI_qos_flow_tunnel_convertToJSON() failed [qfi_list]"); goto end; } - - OpenAPI_lnode_t *qfi_list_node; - OpenAPI_list_for_each(qos_flow_tunnel->qfi_list, qfi_list_node) { - if (cJSON_AddNumberToObject(qfi_list, "", *(double *)qfi_list_node->data) == NULL) { - ogs_error("OpenAPI_qos_flow_tunnel_convertToJSON() failed [qfi_list]"); - goto end; + OpenAPI_list_for_each(qos_flow_tunnel->qfi_list, node) { + if (cJSON_AddNumberToObject(qfi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_qos_flow_tunnel_convertToJSON() failed [qfi_list]"); + goto end; + } } - } + if (!qos_flow_tunnel->tunnel_info) { + ogs_error("OpenAPI_qos_flow_tunnel_convertToJSON() failed [tunnel_info]"); + return NULL; + } cJSON *tunnel_info_local_JSON = OpenAPI_tunnel_info_convertToJSON(qos_flow_tunnel->tunnel_info); if (tunnel_info_local_JSON == NULL) { ogs_error("OpenAPI_qos_flow_tunnel_convertToJSON() failed [tunnel_info]"); @@ -74,35 +88,45 @@ end: OpenAPI_qos_flow_tunnel_t *OpenAPI_qos_flow_tunnel_parseFromJSON(cJSON *qos_flow_tunnelJSON) { OpenAPI_qos_flow_tunnel_t *qos_flow_tunnel_local_var = NULL; - cJSON *qfi_list = cJSON_GetObjectItemCaseSensitive(qos_flow_tunnelJSON, "qfiList"); + OpenAPI_lnode_t *node = NULL; + cJSON *qfi_list = NULL; + OpenAPI_list_t *qfi_listList = NULL; + cJSON *tunnel_info = NULL; + OpenAPI_tunnel_info_t *tunnel_info_local_nonprim = NULL; + qfi_list = cJSON_GetObjectItemCaseSensitive(qos_flow_tunnelJSON, "qfiList"); if (!qfi_list) { ogs_error("OpenAPI_qos_flow_tunnel_parseFromJSON() failed [qfi_list]"); goto end; } + cJSON *qfi_list_local = NULL; + if (!cJSON_IsArray(qfi_list)) { + ogs_error("OpenAPI_qos_flow_tunnel_parseFromJSON() failed [qfi_list]"); + goto end; + } - OpenAPI_list_t *qfi_listList; - cJSON *qfi_list_local; - if (!cJSON_IsArray(qfi_list)) { - ogs_error("OpenAPI_qos_flow_tunnel_parseFromJSON() failed [qfi_list]"); - goto end; - } - qfi_listList = OpenAPI_list_create(); + qfi_listList = OpenAPI_list_create(); - cJSON_ArrayForEach(qfi_list_local, qfi_list) { - if (!cJSON_IsNumber(qfi_list_local)) { - ogs_error("OpenAPI_qos_flow_tunnel_parseFromJSON() failed [qfi_list]"); - goto end; - } - OpenAPI_list_add(qfi_listList, &qfi_list_local->valuedouble); - } + cJSON_ArrayForEach(qfi_list_local, qfi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(qfi_list_local)) { + ogs_error("OpenAPI_qos_flow_tunnel_parseFromJSON() failed [qfi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_qos_flow_tunnel_parseFromJSON() failed [qfi_list]"); + goto end; + } + *localDouble = qfi_list_local->valuedouble; + OpenAPI_list_add(qfi_listList, localDouble); + } - cJSON *tunnel_info = cJSON_GetObjectItemCaseSensitive(qos_flow_tunnelJSON, "tunnelInfo"); + tunnel_info = cJSON_GetObjectItemCaseSensitive(qos_flow_tunnelJSON, "tunnelInfo"); if (!tunnel_info) { ogs_error("OpenAPI_qos_flow_tunnel_parseFromJSON() failed [tunnel_info]"); goto end; } - - OpenAPI_tunnel_info_t *tunnel_info_local_nonprim = NULL; tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(tunnel_info); qos_flow_tunnel_local_var = OpenAPI_qos_flow_tunnel_create ( @@ -112,6 +136,17 @@ OpenAPI_qos_flow_tunnel_t *OpenAPI_qos_flow_tunnel_parseFromJSON(cJSON *qos_flow return qos_flow_tunnel_local_var; end: + if (qfi_listList) { + OpenAPI_list_for_each(qfi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(qfi_listList); + qfi_listList = NULL; + } + if (tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(tunnel_info_local_nonprim); + tunnel_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/qos_flow_usage_report.c b/lib/sbi/openapi/model/qos_flow_usage_report.c index 02d678d2f..5898b3887 100644 --- a/lib/sbi/openapi/model/qos_flow_usage_report.c +++ b/lib/sbi/openapi/model/qos_flow_usage_report.c @@ -26,18 +26,26 @@ OpenAPI_qos_flow_usage_report_t *OpenAPI_qos_flow_usage_report_create( void OpenAPI_qos_flow_usage_report_free(OpenAPI_qos_flow_usage_report_t *qos_flow_usage_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_flow_usage_report) { return; } - OpenAPI_lnode_t *node; - ogs_free(qos_flow_usage_report->start_time_stamp); - ogs_free(qos_flow_usage_report->end_time_stamp); + if (qos_flow_usage_report->start_time_stamp) { + ogs_free(qos_flow_usage_report->start_time_stamp); + qos_flow_usage_report->start_time_stamp = NULL; + } + if (qos_flow_usage_report->end_time_stamp) { + ogs_free(qos_flow_usage_report->end_time_stamp); + qos_flow_usage_report->end_time_stamp = NULL; + } ogs_free(qos_flow_usage_report); } cJSON *OpenAPI_qos_flow_usage_report_convertToJSON(OpenAPI_qos_flow_usage_report_t *qos_flow_usage_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_flow_usage_report == NULL) { ogs_error("OpenAPI_qos_flow_usage_report_convertToJSON() failed [QosFlowUsageReport]"); @@ -50,11 +58,19 @@ cJSON *OpenAPI_qos_flow_usage_report_convertToJSON(OpenAPI_qos_flow_usage_report goto end; } + if (!qos_flow_usage_report->start_time_stamp) { + ogs_error("OpenAPI_qos_flow_usage_report_convertToJSON() failed [start_time_stamp]"); + return NULL; + } if (cJSON_AddStringToObject(item, "startTimeStamp", qos_flow_usage_report->start_time_stamp) == NULL) { ogs_error("OpenAPI_qos_flow_usage_report_convertToJSON() failed [start_time_stamp]"); goto end; } + if (!qos_flow_usage_report->end_time_stamp) { + ogs_error("OpenAPI_qos_flow_usage_report_convertToJSON() failed [end_time_stamp]"); + return NULL; + } if (cJSON_AddStringToObject(item, "endTimeStamp", qos_flow_usage_report->end_time_stamp) == NULL) { ogs_error("OpenAPI_qos_flow_usage_report_convertToJSON() failed [end_time_stamp]"); goto end; @@ -77,56 +93,57 @@ end: OpenAPI_qos_flow_usage_report_t *OpenAPI_qos_flow_usage_report_parseFromJSON(cJSON *qos_flow_usage_reportJSON) { OpenAPI_qos_flow_usage_report_t *qos_flow_usage_report_local_var = NULL; - cJSON *qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "qfi"); + OpenAPI_lnode_t *node = NULL; + cJSON *qfi = NULL; + cJSON *start_time_stamp = NULL; + cJSON *end_time_stamp = NULL; + cJSON *downlink_volume = NULL; + cJSON *uplink_volume = NULL; + qfi = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "qfi"); if (!qfi) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [qfi]"); goto end; } - if (!cJSON_IsNumber(qfi)) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [qfi]"); goto end; } - cJSON *start_time_stamp = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "startTimeStamp"); + start_time_stamp = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "startTimeStamp"); if (!start_time_stamp) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [start_time_stamp]"); goto end; } - - if (!cJSON_IsString(start_time_stamp)) { + if (!cJSON_IsString(start_time_stamp) && !cJSON_IsNull(start_time_stamp)) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [start_time_stamp]"); goto end; } - cJSON *end_time_stamp = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "endTimeStamp"); + end_time_stamp = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "endTimeStamp"); if (!end_time_stamp) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [end_time_stamp]"); goto end; } - - if (!cJSON_IsString(end_time_stamp)) { + if (!cJSON_IsString(end_time_stamp) && !cJSON_IsNull(end_time_stamp)) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [end_time_stamp]"); goto end; } - cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "downlinkVolume"); + downlink_volume = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "downlinkVolume"); if (!downlink_volume) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [downlink_volume]"); goto end; } - if (!cJSON_IsNumber(downlink_volume)) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [downlink_volume]"); goto end; } - cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "uplinkVolume"); + uplink_volume = cJSON_GetObjectItemCaseSensitive(qos_flow_usage_reportJSON, "uplinkVolume"); if (!uplink_volume) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [uplink_volume]"); goto end; } - if (!cJSON_IsNumber(uplink_volume)) { ogs_error("OpenAPI_qos_flow_usage_report_parseFromJSON() failed [uplink_volume]"); goto end; diff --git a/lib/sbi/openapi/model/qos_monitoring_data.c b/lib/sbi/openapi/model/qos_monitoring_data.c index e3eb7103c..481d62e5e 100644 --- a/lib/sbi/openapi/model/qos_monitoring_data.c +++ b/lib/sbi/openapi/model/qos_monitoring_data.c @@ -46,21 +46,38 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_create( void OpenAPI_qos_monitoring_data_free(OpenAPI_qos_monitoring_data_t *qos_monitoring_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_monitoring_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(qos_monitoring_data->qm_id); - OpenAPI_list_free(qos_monitoring_data->req_qos_mon_params); - OpenAPI_list_free(qos_monitoring_data->rep_freqs); - ogs_free(qos_monitoring_data->notify_uri); - ogs_free(qos_monitoring_data->notify_corre_id); + if (qos_monitoring_data->qm_id) { + ogs_free(qos_monitoring_data->qm_id); + qos_monitoring_data->qm_id = NULL; + } + if (qos_monitoring_data->req_qos_mon_params) { + OpenAPI_list_free(qos_monitoring_data->req_qos_mon_params); + qos_monitoring_data->req_qos_mon_params = NULL; + } + if (qos_monitoring_data->rep_freqs) { + OpenAPI_list_free(qos_monitoring_data->rep_freqs); + qos_monitoring_data->rep_freqs = NULL; + } + if (qos_monitoring_data->notify_uri) { + ogs_free(qos_monitoring_data->notify_uri); + qos_monitoring_data->notify_uri = NULL; + } + if (qos_monitoring_data->notify_corre_id) { + ogs_free(qos_monitoring_data->notify_corre_id); + qos_monitoring_data->notify_corre_id = NULL; + } ogs_free(qos_monitoring_data); } cJSON *OpenAPI_qos_monitoring_data_convertToJSON(OpenAPI_qos_monitoring_data_t *qos_monitoring_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_monitoring_data == NULL) { ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [QosMonitoringData]"); @@ -68,32 +85,42 @@ cJSON *OpenAPI_qos_monitoring_data_convertToJSON(OpenAPI_qos_monitoring_data_t * } item = cJSON_CreateObject(); + if (!qos_monitoring_data->qm_id) { + ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [qm_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "qmId", qos_monitoring_data->qm_id) == NULL) { ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [qm_id]"); goto end; } - cJSON *req_qos_mon_params = cJSON_AddArrayToObject(item, "reqQosMonParams"); - if (req_qos_mon_params == NULL) { + if (qos_monitoring_data->req_qos_mon_params == OpenAPI_requested_qos_monitoring_parameter_NULL) { + ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [req_qos_mon_params]"); + return NULL; + } + cJSON *req_qos_mon_paramsList = cJSON_AddArrayToObject(item, "reqQosMonParams"); + if (req_qos_mon_paramsList == NULL) { ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [req_qos_mon_params]"); goto end; } - OpenAPI_lnode_t *req_qos_mon_params_node; - OpenAPI_list_for_each(qos_monitoring_data->req_qos_mon_params, req_qos_mon_params_node) { - if (cJSON_AddStringToObject(req_qos_mon_params, "", OpenAPI_requested_qos_monitoring_parameter_ToString((intptr_t)req_qos_mon_params_node->data)) == NULL) { + OpenAPI_list_for_each(qos_monitoring_data->req_qos_mon_params, node) { + if (cJSON_AddStringToObject(req_qos_mon_paramsList, "", OpenAPI_requested_qos_monitoring_parameter_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [req_qos_mon_params]"); goto end; } } - cJSON *rep_freqs = cJSON_AddArrayToObject(item, "repFreqs"); - if (rep_freqs == NULL) { + if (qos_monitoring_data->rep_freqs == OpenAPI_reporting_frequency_NULL) { + ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [rep_freqs]"); + return NULL; + } + cJSON *rep_freqsList = cJSON_AddArrayToObject(item, "repFreqs"); + if (rep_freqsList == NULL) { ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [rep_freqs]"); goto end; } - OpenAPI_lnode_t *rep_freqs_node; - OpenAPI_list_for_each(qos_monitoring_data->rep_freqs, rep_freqs_node) { - if (cJSON_AddStringToObject(rep_freqs, "", OpenAPI_reporting_frequency_ToString((intptr_t)rep_freqs_node->data)) == NULL) { + OpenAPI_list_for_each(qos_monitoring_data->rep_freqs, node) { + if (cJSON_AddStringToObject(rep_freqsList, "", OpenAPI_reporting_frequency_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [rep_freqs]"); goto end; } @@ -155,67 +182,72 @@ end: OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON *qos_monitoring_dataJSON) { OpenAPI_qos_monitoring_data_t *qos_monitoring_data_local_var = NULL; - cJSON *qm_id = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "qmId"); + OpenAPI_lnode_t *node = NULL; + cJSON *qm_id = NULL; + cJSON *req_qos_mon_params = NULL; + OpenAPI_list_t *req_qos_mon_paramsList = NULL; + cJSON *rep_freqs = NULL; + OpenAPI_list_t *rep_freqsList = NULL; + cJSON *rep_thresh_dl = NULL; + cJSON *rep_thresh_ul = NULL; + cJSON *rep_thresh_rp = NULL; + cJSON *wait_time = NULL; + cJSON *rep_period = NULL; + cJSON *notify_uri = NULL; + cJSON *notify_corre_id = NULL; + qm_id = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "qmId"); if (!qm_id) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [qm_id]"); goto end; } - if (!cJSON_IsString(qm_id)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [qm_id]"); goto end; } - cJSON *req_qos_mon_params = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "reqQosMonParams"); + req_qos_mon_params = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "reqQosMonParams"); if (!req_qos_mon_params) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [req_qos_mon_params]"); goto end; } - - OpenAPI_list_t *req_qos_mon_paramsList; - cJSON *req_qos_mon_params_local_nonprimitive; - if (!cJSON_IsArray(req_qos_mon_params)) { - ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [req_qos_mon_params]"); - goto end; - } - - req_qos_mon_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_qos_mon_params_local_nonprimitive, req_qos_mon_params ) { - if (!cJSON_IsString(req_qos_mon_params_local_nonprimitive)){ + cJSON *req_qos_mon_params_local = NULL; + if (!cJSON_IsArray(req_qos_mon_params)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [req_qos_mon_params]"); goto end; } - OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local_nonprimitive->valuestring)); - } + req_qos_mon_paramsList = OpenAPI_list_create(); - cJSON *rep_freqs = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repFreqs"); + cJSON_ArrayForEach(req_qos_mon_params_local, req_qos_mon_params) { + if (!cJSON_IsString(req_qos_mon_params_local)) { + ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [req_qos_mon_params]"); + goto end; + } + OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local->valuestring)); + } + + rep_freqs = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repFreqs"); if (!rep_freqs) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_freqs]"); goto end; } - - OpenAPI_list_t *rep_freqsList; - cJSON *rep_freqs_local_nonprimitive; - if (!cJSON_IsArray(rep_freqs)) { - ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_freqs]"); - goto end; - } - - rep_freqsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rep_freqs_local_nonprimitive, rep_freqs ) { - if (!cJSON_IsString(rep_freqs_local_nonprimitive)){ + cJSON *rep_freqs_local = NULL; + if (!cJSON_IsArray(rep_freqs)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_freqs]"); goto end; } - OpenAPI_list_add(rep_freqsList, (void *)OpenAPI_reporting_frequency_FromString(rep_freqs_local_nonprimitive->valuestring)); - } + rep_freqsList = OpenAPI_list_create(); - cJSON *rep_thresh_dl = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repThreshDl"); + cJSON_ArrayForEach(rep_freqs_local, rep_freqs) { + if (!cJSON_IsString(rep_freqs_local)) { + ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_freqs]"); + goto end; + } + OpenAPI_list_add(rep_freqsList, (void *)OpenAPI_reporting_frequency_FromString(rep_freqs_local->valuestring)); + } + rep_thresh_dl = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repThreshDl"); if (rep_thresh_dl) { if (!cJSON_IsNumber(rep_thresh_dl)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_thresh_dl]"); @@ -223,8 +255,7 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON * } } - cJSON *rep_thresh_ul = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repThreshUl"); - + rep_thresh_ul = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repThreshUl"); if (rep_thresh_ul) { if (!cJSON_IsNumber(rep_thresh_ul)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_thresh_ul]"); @@ -232,8 +263,7 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON * } } - cJSON *rep_thresh_rp = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repThreshRp"); - + rep_thresh_rp = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repThreshRp"); if (rep_thresh_rp) { if (!cJSON_IsNumber(rep_thresh_rp)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_thresh_rp]"); @@ -241,8 +271,7 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON * } } - cJSON *wait_time = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "waitTime"); - + wait_time = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "waitTime"); if (wait_time) { if (!cJSON_IsNumber(wait_time)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [wait_time]"); @@ -250,8 +279,7 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON * } } - cJSON *rep_period = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repPeriod"); - + rep_period = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "repPeriod"); if (rep_period) { if (!cJSON_IsNumber(rep_period)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_period]"); @@ -259,19 +287,17 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON * } } - cJSON *notify_uri = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "notifyUri"); - + notify_uri = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "notifyUri"); if (notify_uri) { - if (!cJSON_IsString(notify_uri)) { + if (!cJSON_IsString(notify_uri) && !cJSON_IsNull(notify_uri)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [notify_uri]"); goto end; } } - cJSON *notify_corre_id = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "notifyCorreId"); - + notify_corre_id = cJSON_GetObjectItemCaseSensitive(qos_monitoring_dataJSON, "notifyCorreId"); if (notify_corre_id) { - if (!cJSON_IsString(notify_corre_id)) { + if (!cJSON_IsString(notify_corre_id) && !cJSON_IsNull(notify_corre_id)) { ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [notify_corre_id]"); goto end; } @@ -291,12 +317,20 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON * wait_time ? wait_time->valuedouble : 0, rep_period ? true : false, rep_period ? rep_period->valuedouble : 0, - notify_uri ? ogs_strdup(notify_uri->valuestring) : NULL, - notify_corre_id ? ogs_strdup(notify_corre_id->valuestring) : NULL + notify_uri && !cJSON_IsNull(notify_uri) ? ogs_strdup(notify_uri->valuestring) : NULL, + notify_corre_id && !cJSON_IsNull(notify_corre_id) ? ogs_strdup(notify_corre_id->valuestring) : NULL ); return qos_monitoring_data_local_var; end: + if (req_qos_mon_paramsList) { + OpenAPI_list_free(req_qos_mon_paramsList); + req_qos_mon_paramsList = NULL; + } + if (rep_freqsList) { + OpenAPI_list_free(rep_freqsList); + rep_freqsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/qos_monitoring_info.c b/lib/sbi/openapi/model/qos_monitoring_info.c index 595df211d..ca8883e33 100644 --- a/lib/sbi/openapi/model/qos_monitoring_info.c +++ b/lib/sbi/openapi/model/qos_monitoring_info.c @@ -20,16 +20,18 @@ OpenAPI_qos_monitoring_info_t *OpenAPI_qos_monitoring_info_create( void OpenAPI_qos_monitoring_info_free(OpenAPI_qos_monitoring_info_t *qos_monitoring_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_monitoring_info) { return; } - OpenAPI_lnode_t *node; ogs_free(qos_monitoring_info); } cJSON *OpenAPI_qos_monitoring_info_convertToJSON(OpenAPI_qos_monitoring_info_t *qos_monitoring_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_monitoring_info == NULL) { ogs_error("OpenAPI_qos_monitoring_info_convertToJSON() failed [QosMonitoringInfo]"); @@ -51,8 +53,9 @@ end: OpenAPI_qos_monitoring_info_t *OpenAPI_qos_monitoring_info_parseFromJSON(cJSON *qos_monitoring_infoJSON) { OpenAPI_qos_monitoring_info_t *qos_monitoring_info_local_var = NULL; - cJSON *qos_monitoring_ind = cJSON_GetObjectItemCaseSensitive(qos_monitoring_infoJSON, "qosMonitoringInd"); - + OpenAPI_lnode_t *node = NULL; + cJSON *qos_monitoring_ind = NULL; + qos_monitoring_ind = cJSON_GetObjectItemCaseSensitive(qos_monitoring_infoJSON, "qosMonitoringInd"); if (qos_monitoring_ind) { if (!cJSON_IsBool(qos_monitoring_ind)) { ogs_error("OpenAPI_qos_monitoring_info_parseFromJSON() failed [qos_monitoring_ind]"); diff --git a/lib/sbi/openapi/model/qos_monitoring_information.c b/lib/sbi/openapi/model/qos_monitoring_information.c index 378ceabb9..2a5cd7593 100644 --- a/lib/sbi/openapi/model/qos_monitoring_information.c +++ b/lib/sbi/openapi/model/qos_monitoring_information.c @@ -28,16 +28,18 @@ OpenAPI_qos_monitoring_information_t *OpenAPI_qos_monitoring_information_create( void OpenAPI_qos_monitoring_information_free(OpenAPI_qos_monitoring_information_t *qos_monitoring_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_monitoring_information) { return; } - OpenAPI_lnode_t *node; ogs_free(qos_monitoring_information); } cJSON *OpenAPI_qos_monitoring_information_convertToJSON(OpenAPI_qos_monitoring_information_t *qos_monitoring_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_monitoring_information == NULL) { ogs_error("OpenAPI_qos_monitoring_information_convertToJSON() failed [QosMonitoringInformation]"); @@ -73,8 +75,11 @@ end: OpenAPI_qos_monitoring_information_t *OpenAPI_qos_monitoring_information_parseFromJSON(cJSON *qos_monitoring_informationJSON) { OpenAPI_qos_monitoring_information_t *qos_monitoring_information_local_var = NULL; - cJSON *rep_thresh_dl = cJSON_GetObjectItemCaseSensitive(qos_monitoring_informationJSON, "repThreshDl"); - + OpenAPI_lnode_t *node = NULL; + cJSON *rep_thresh_dl = NULL; + cJSON *rep_thresh_ul = NULL; + cJSON *rep_thresh_rp = NULL; + rep_thresh_dl = cJSON_GetObjectItemCaseSensitive(qos_monitoring_informationJSON, "repThreshDl"); if (rep_thresh_dl) { if (!cJSON_IsNumber(rep_thresh_dl)) { ogs_error("OpenAPI_qos_monitoring_information_parseFromJSON() failed [rep_thresh_dl]"); @@ -82,8 +87,7 @@ OpenAPI_qos_monitoring_information_t *OpenAPI_qos_monitoring_information_parseFr } } - cJSON *rep_thresh_ul = cJSON_GetObjectItemCaseSensitive(qos_monitoring_informationJSON, "repThreshUl"); - + rep_thresh_ul = cJSON_GetObjectItemCaseSensitive(qos_monitoring_informationJSON, "repThreshUl"); if (rep_thresh_ul) { if (!cJSON_IsNumber(rep_thresh_ul)) { ogs_error("OpenAPI_qos_monitoring_information_parseFromJSON() failed [rep_thresh_ul]"); @@ -91,8 +95,7 @@ OpenAPI_qos_monitoring_information_t *OpenAPI_qos_monitoring_information_parseFr } } - cJSON *rep_thresh_rp = cJSON_GetObjectItemCaseSensitive(qos_monitoring_informationJSON, "repThreshRp"); - + rep_thresh_rp = cJSON_GetObjectItemCaseSensitive(qos_monitoring_informationJSON, "repThreshRp"); if (rep_thresh_rp) { if (!cJSON_IsNumber(rep_thresh_rp)) { ogs_error("OpenAPI_qos_monitoring_information_parseFromJSON() failed [rep_thresh_rp]"); diff --git a/lib/sbi/openapi/model/qos_monitoring_information_rm.c b/lib/sbi/openapi/model/qos_monitoring_information_rm.c index 5879766cf..8fa1f0aa2 100644 --- a/lib/sbi/openapi/model/qos_monitoring_information_rm.c +++ b/lib/sbi/openapi/model/qos_monitoring_information_rm.c @@ -28,16 +28,18 @@ OpenAPI_qos_monitoring_information_rm_t *OpenAPI_qos_monitoring_information_rm_c void OpenAPI_qos_monitoring_information_rm_free(OpenAPI_qos_monitoring_information_rm_t *qos_monitoring_information_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_monitoring_information_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(qos_monitoring_information_rm); } cJSON *OpenAPI_qos_monitoring_information_rm_convertToJSON(OpenAPI_qos_monitoring_information_rm_t *qos_monitoring_information_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_monitoring_information_rm == NULL) { ogs_error("OpenAPI_qos_monitoring_information_rm_convertToJSON() failed [QosMonitoringInformationRm]"); @@ -73,8 +75,11 @@ end: OpenAPI_qos_monitoring_information_rm_t *OpenAPI_qos_monitoring_information_rm_parseFromJSON(cJSON *qos_monitoring_information_rmJSON) { OpenAPI_qos_monitoring_information_rm_t *qos_monitoring_information_rm_local_var = NULL; - cJSON *rep_thresh_dl = cJSON_GetObjectItemCaseSensitive(qos_monitoring_information_rmJSON, "repThreshDl"); - + OpenAPI_lnode_t *node = NULL; + cJSON *rep_thresh_dl = NULL; + cJSON *rep_thresh_ul = NULL; + cJSON *rep_thresh_rp = NULL; + rep_thresh_dl = cJSON_GetObjectItemCaseSensitive(qos_monitoring_information_rmJSON, "repThreshDl"); if (rep_thresh_dl) { if (!cJSON_IsNumber(rep_thresh_dl)) { ogs_error("OpenAPI_qos_monitoring_information_rm_parseFromJSON() failed [rep_thresh_dl]"); @@ -82,8 +87,7 @@ OpenAPI_qos_monitoring_information_rm_t *OpenAPI_qos_monitoring_information_rm_p } } - cJSON *rep_thresh_ul = cJSON_GetObjectItemCaseSensitive(qos_monitoring_information_rmJSON, "repThreshUl"); - + rep_thresh_ul = cJSON_GetObjectItemCaseSensitive(qos_monitoring_information_rmJSON, "repThreshUl"); if (rep_thresh_ul) { if (!cJSON_IsNumber(rep_thresh_ul)) { ogs_error("OpenAPI_qos_monitoring_information_rm_parseFromJSON() failed [rep_thresh_ul]"); @@ -91,8 +95,7 @@ OpenAPI_qos_monitoring_information_rm_t *OpenAPI_qos_monitoring_information_rm_p } } - cJSON *rep_thresh_rp = cJSON_GetObjectItemCaseSensitive(qos_monitoring_information_rmJSON, "repThreshRp"); - + rep_thresh_rp = cJSON_GetObjectItemCaseSensitive(qos_monitoring_information_rmJSON, "repThreshRp"); if (rep_thresh_rp) { if (!cJSON_IsNumber(rep_thresh_rp)) { ogs_error("OpenAPI_qos_monitoring_information_rm_parseFromJSON() failed [rep_thresh_rp]"); diff --git a/lib/sbi/openapi/model/qos_monitoring_report.c b/lib/sbi/openapi/model/qos_monitoring_report.c index 186e4f4c3..d08fd5c79 100644 --- a/lib/sbi/openapi/model/qos_monitoring_report.c +++ b/lib/sbi/openapi/model/qos_monitoring_report.c @@ -24,32 +24,46 @@ OpenAPI_qos_monitoring_report_t *OpenAPI_qos_monitoring_report_create( void OpenAPI_qos_monitoring_report_free(OpenAPI_qos_monitoring_report_t *qos_monitoring_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_monitoring_report) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(qos_monitoring_report->flows, node) { - OpenAPI_flows_free(node->data); + if (qos_monitoring_report->flows) { + OpenAPI_list_for_each(qos_monitoring_report->flows, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(qos_monitoring_report->flows); + qos_monitoring_report->flows = NULL; } - OpenAPI_list_free(qos_monitoring_report->flows); - OpenAPI_list_for_each(qos_monitoring_report->ul_delays, node) { - ogs_free(node->data); + if (qos_monitoring_report->ul_delays) { + OpenAPI_list_for_each(qos_monitoring_report->ul_delays, node) { + ogs_free(node->data); + } + OpenAPI_list_free(qos_monitoring_report->ul_delays); + qos_monitoring_report->ul_delays = NULL; } - OpenAPI_list_free(qos_monitoring_report->ul_delays); - OpenAPI_list_for_each(qos_monitoring_report->dl_delays, node) { - ogs_free(node->data); + if (qos_monitoring_report->dl_delays) { + OpenAPI_list_for_each(qos_monitoring_report->dl_delays, node) { + ogs_free(node->data); + } + OpenAPI_list_free(qos_monitoring_report->dl_delays); + qos_monitoring_report->dl_delays = NULL; } - OpenAPI_list_free(qos_monitoring_report->dl_delays); - OpenAPI_list_for_each(qos_monitoring_report->rt_delays, node) { - ogs_free(node->data); + if (qos_monitoring_report->rt_delays) { + OpenAPI_list_for_each(qos_monitoring_report->rt_delays, node) { + ogs_free(node->data); + } + OpenAPI_list_free(qos_monitoring_report->rt_delays); + qos_monitoring_report->rt_delays = NULL; } - OpenAPI_list_free(qos_monitoring_report->rt_delays); ogs_free(qos_monitoring_report); } cJSON *OpenAPI_qos_monitoring_report_convertToJSON(OpenAPI_qos_monitoring_report_t *qos_monitoring_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_monitoring_report == NULL) { ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [QosMonitoringReport]"); @@ -63,66 +77,56 @@ cJSON *OpenAPI_qos_monitoring_report_convertToJSON(OpenAPI_qos_monitoring_report ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [flows]"); goto end; } - - OpenAPI_lnode_t *flows_node; - if (qos_monitoring_report->flows) { - OpenAPI_list_for_each(qos_monitoring_report->flows, flows_node) { - cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [flows]"); - goto end; - } - cJSON_AddItemToArray(flowsList, itemLocal); + OpenAPI_list_for_each(qos_monitoring_report->flows, node) { + cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [flows]"); + goto end; } + cJSON_AddItemToArray(flowsList, itemLocal); } } if (qos_monitoring_report->ul_delays) { - cJSON *ul_delays = cJSON_AddArrayToObject(item, "ulDelays"); - if (ul_delays == NULL) { + cJSON *ul_delaysList = cJSON_AddArrayToObject(item, "ulDelays"); + if (ul_delaysList == NULL) { ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [ul_delays]"); goto end; } - - OpenAPI_lnode_t *ul_delays_node; - OpenAPI_list_for_each(qos_monitoring_report->ul_delays, ul_delays_node) { - if (cJSON_AddNumberToObject(ul_delays, "", *(double *)ul_delays_node->data) == NULL) { - ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [ul_delays]"); - goto end; + OpenAPI_list_for_each(qos_monitoring_report->ul_delays, node) { + if (cJSON_AddNumberToObject(ul_delaysList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [ul_delays]"); + goto end; + } } - } } if (qos_monitoring_report->dl_delays) { - cJSON *dl_delays = cJSON_AddArrayToObject(item, "dlDelays"); - if (dl_delays == NULL) { + cJSON *dl_delaysList = cJSON_AddArrayToObject(item, "dlDelays"); + if (dl_delaysList == NULL) { ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [dl_delays]"); goto end; } - - OpenAPI_lnode_t *dl_delays_node; - OpenAPI_list_for_each(qos_monitoring_report->dl_delays, dl_delays_node) { - if (cJSON_AddNumberToObject(dl_delays, "", *(double *)dl_delays_node->data) == NULL) { - ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [dl_delays]"); - goto end; + OpenAPI_list_for_each(qos_monitoring_report->dl_delays, node) { + if (cJSON_AddNumberToObject(dl_delaysList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [dl_delays]"); + goto end; + } } - } } if (qos_monitoring_report->rt_delays) { - cJSON *rt_delays = cJSON_AddArrayToObject(item, "rtDelays"); - if (rt_delays == NULL) { + cJSON *rt_delaysList = cJSON_AddArrayToObject(item, "rtDelays"); + if (rt_delaysList == NULL) { ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [rt_delays]"); goto end; } - - OpenAPI_lnode_t *rt_delays_node; - OpenAPI_list_for_each(qos_monitoring_report->rt_delays, rt_delays_node) { - if (cJSON_AddNumberToObject(rt_delays, "", *(double *)rt_delays_node->data) == NULL) { - ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [rt_delays]"); - goto end; + OpenAPI_list_for_each(qos_monitoring_report->rt_delays, node) { + if (cJSON_AddNumberToObject(rt_delaysList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [rt_delays]"); + goto end; + } } - } } end: @@ -132,93 +136,119 @@ end: OpenAPI_qos_monitoring_report_t *OpenAPI_qos_monitoring_report_parseFromJSON(cJSON *qos_monitoring_reportJSON) { OpenAPI_qos_monitoring_report_t *qos_monitoring_report_local_var = NULL; - cJSON *flows = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "flows"); - - OpenAPI_list_t *flowsList; + OpenAPI_lnode_t *node = NULL; + cJSON *flows = NULL; + OpenAPI_list_t *flowsList = NULL; + cJSON *ul_delays = NULL; + OpenAPI_list_t *ul_delaysList = NULL; + cJSON *dl_delays = NULL; + OpenAPI_list_t *dl_delaysList = NULL; + cJSON *rt_delays = NULL; + OpenAPI_list_t *rt_delaysList = NULL; + flows = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "flows"); if (flows) { - cJSON *flows_local_nonprimitive; - if (!cJSON_IsArray(flows)){ - ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [flows]"); - goto end; - } - - flowsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(flows_local_nonprimitive, flows ) { - if (!cJSON_IsObject(flows_local_nonprimitive)) { + cJSON *flows_local = NULL; + if (!cJSON_IsArray(flows)) { ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [flows]"); goto end; } - OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive); - if (!flowsItem) { - ogs_error("No flowsItem"); - OpenAPI_list_free(flowsList); + flowsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flows_local, flows) { + if (!cJSON_IsObject(flows_local)) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [flows]"); + goto end; + } + OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local); + if (!flowsItem) { + ogs_error("No flowsItem"); + OpenAPI_list_free(flowsList); + goto end; + } + OpenAPI_list_add(flowsList, flowsItem); + } + } + + ul_delays = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "ulDelays"); + if (ul_delays) { + cJSON *ul_delays_local = NULL; + if (!cJSON_IsArray(ul_delays)) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [ul_delays]"); goto end; } - OpenAPI_list_add(flowsList, flowsItem); - } + ul_delaysList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ul_delays_local, ul_delays) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(ul_delays_local)) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [ul_delays]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [ul_delays]"); + goto end; + } + *localDouble = ul_delays_local->valuedouble; + OpenAPI_list_add(ul_delaysList, localDouble); + } } - cJSON *ul_delays = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "ulDelays"); - - OpenAPI_list_t *ul_delaysList; - if (ul_delays) { - cJSON *ul_delays_local; - if (!cJSON_IsArray(ul_delays)) { - ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [ul_delays]"); - goto end; - } - ul_delaysList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ul_delays_local, ul_delays) { - if (!cJSON_IsNumber(ul_delays_local)) { - ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [ul_delays]"); - goto end; - } - OpenAPI_list_add(ul_delaysList, &ul_delays_local->valuedouble); - } - } - - cJSON *dl_delays = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "dlDelays"); - - OpenAPI_list_t *dl_delaysList; + dl_delays = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "dlDelays"); if (dl_delays) { - cJSON *dl_delays_local; - if (!cJSON_IsArray(dl_delays)) { - ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [dl_delays]"); - goto end; - } - dl_delaysList = OpenAPI_list_create(); + cJSON *dl_delays_local = NULL; + if (!cJSON_IsArray(dl_delays)) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [dl_delays]"); + goto end; + } - cJSON_ArrayForEach(dl_delays_local, dl_delays) { - if (!cJSON_IsNumber(dl_delays_local)) { - ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [dl_delays]"); - goto end; - } - OpenAPI_list_add(dl_delaysList, &dl_delays_local->valuedouble); - } + dl_delaysList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dl_delays_local, dl_delays) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(dl_delays_local)) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [dl_delays]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [dl_delays]"); + goto end; + } + *localDouble = dl_delays_local->valuedouble; + OpenAPI_list_add(dl_delaysList, localDouble); + } } - cJSON *rt_delays = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "rtDelays"); - - OpenAPI_list_t *rt_delaysList; + rt_delays = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "rtDelays"); if (rt_delays) { - cJSON *rt_delays_local; - if (!cJSON_IsArray(rt_delays)) { - ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [rt_delays]"); - goto end; - } - rt_delaysList = OpenAPI_list_create(); + cJSON *rt_delays_local = NULL; + if (!cJSON_IsArray(rt_delays)) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [rt_delays]"); + goto end; + } - cJSON_ArrayForEach(rt_delays_local, rt_delays) { - if (!cJSON_IsNumber(rt_delays_local)) { - ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [rt_delays]"); - goto end; - } - OpenAPI_list_add(rt_delaysList, &rt_delays_local->valuedouble); - } + rt_delaysList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rt_delays_local, rt_delays) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(rt_delays_local)) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [rt_delays]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [rt_delays]"); + goto end; + } + *localDouble = rt_delays_local->valuedouble; + OpenAPI_list_add(rt_delaysList, localDouble); + } } qos_monitoring_report_local_var = OpenAPI_qos_monitoring_report_create ( @@ -230,6 +260,34 @@ OpenAPI_qos_monitoring_report_t *OpenAPI_qos_monitoring_report_parseFromJSON(cJS return qos_monitoring_report_local_var; end: + if (flowsList) { + OpenAPI_list_for_each(flowsList, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(flowsList); + flowsList = NULL; + } + if (ul_delaysList) { + OpenAPI_list_for_each(ul_delaysList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ul_delaysList); + ul_delaysList = NULL; + } + if (dl_delaysList) { + OpenAPI_list_for_each(dl_delaysList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dl_delaysList); + dl_delaysList = NULL; + } + if (rt_delaysList) { + OpenAPI_list_for_each(rt_delaysList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(rt_delaysList); + rt_delaysList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/qos_notification_control_info.c b/lib/sbi/openapi/model/qos_notification_control_info.c index 44fc55f02..635baf43f 100644 --- a/lib/sbi/openapi/model/qos_notification_control_info.c +++ b/lib/sbi/openapi/model/qos_notification_control_info.c @@ -22,21 +22,29 @@ OpenAPI_qos_notification_control_info_t *OpenAPI_qos_notification_control_info_c void OpenAPI_qos_notification_control_info_free(OpenAPI_qos_notification_control_info_t *qos_notification_control_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == qos_notification_control_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(qos_notification_control_info->flows, node) { - OpenAPI_flows_free(node->data); + if (qos_notification_control_info->flows) { + OpenAPI_list_for_each(qos_notification_control_info->flows, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(qos_notification_control_info->flows); + qos_notification_control_info->flows = NULL; + } + if (qos_notification_control_info->alt_ser_req) { + ogs_free(qos_notification_control_info->alt_ser_req); + qos_notification_control_info->alt_ser_req = NULL; } - OpenAPI_list_free(qos_notification_control_info->flows); - ogs_free(qos_notification_control_info->alt_ser_req); ogs_free(qos_notification_control_info); } cJSON *OpenAPI_qos_notification_control_info_convertToJSON(OpenAPI_qos_notification_control_info_t *qos_notification_control_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (qos_notification_control_info == NULL) { ogs_error("OpenAPI_qos_notification_control_info_convertToJSON() failed [QosNotificationControlInfo]"); @@ -44,6 +52,10 @@ cJSON *OpenAPI_qos_notification_control_info_convertToJSON(OpenAPI_qos_notificat } item = cJSON_CreateObject(); + if (qos_notification_control_info->notif_type == OpenAPI_qos_notif_type_NULL) { + ogs_error("OpenAPI_qos_notification_control_info_convertToJSON() failed [notif_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notifType", OpenAPI_qos_notif_type_ToString(qos_notification_control_info->notif_type)) == NULL) { ogs_error("OpenAPI_qos_notification_control_info_convertToJSON() failed [notif_type]"); goto end; @@ -55,17 +67,13 @@ cJSON *OpenAPI_qos_notification_control_info_convertToJSON(OpenAPI_qos_notificat ogs_error("OpenAPI_qos_notification_control_info_convertToJSON() failed [flows]"); goto end; } - - OpenAPI_lnode_t *flows_node; - if (qos_notification_control_info->flows) { - OpenAPI_list_for_each(qos_notification_control_info->flows, flows_node) { - cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_qos_notification_control_info_convertToJSON() failed [flows]"); - goto end; - } - cJSON_AddItemToArray(flowsList, itemLocal); + OpenAPI_list_for_each(qos_notification_control_info->flows, node) { + cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_qos_notification_control_info_convertToJSON() failed [flows]"); + goto end; } + cJSON_AddItemToArray(flowsList, itemLocal); } } @@ -83,52 +91,51 @@ end: OpenAPI_qos_notification_control_info_t *OpenAPI_qos_notification_control_info_parseFromJSON(cJSON *qos_notification_control_infoJSON) { OpenAPI_qos_notification_control_info_t *qos_notification_control_info_local_var = NULL; - cJSON *notif_type = cJSON_GetObjectItemCaseSensitive(qos_notification_control_infoJSON, "notifType"); + OpenAPI_lnode_t *node = NULL; + cJSON *notif_type = NULL; + OpenAPI_qos_notif_type_e notif_typeVariable = 0; + cJSON *flows = NULL; + OpenAPI_list_t *flowsList = NULL; + cJSON *alt_ser_req = NULL; + notif_type = cJSON_GetObjectItemCaseSensitive(qos_notification_control_infoJSON, "notifType"); if (!notif_type) { ogs_error("OpenAPI_qos_notification_control_info_parseFromJSON() failed [notif_type]"); goto end; } - - OpenAPI_qos_notif_type_e notif_typeVariable; if (!cJSON_IsString(notif_type)) { ogs_error("OpenAPI_qos_notification_control_info_parseFromJSON() failed [notif_type]"); goto end; } notif_typeVariable = OpenAPI_qos_notif_type_FromString(notif_type->valuestring); - cJSON *flows = cJSON_GetObjectItemCaseSensitive(qos_notification_control_infoJSON, "flows"); - - OpenAPI_list_t *flowsList; + flows = cJSON_GetObjectItemCaseSensitive(qos_notification_control_infoJSON, "flows"); if (flows) { - cJSON *flows_local_nonprimitive; - if (!cJSON_IsArray(flows)){ - ogs_error("OpenAPI_qos_notification_control_info_parseFromJSON() failed [flows]"); - goto end; - } - - flowsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(flows_local_nonprimitive, flows ) { - if (!cJSON_IsObject(flows_local_nonprimitive)) { + cJSON *flows_local = NULL; + if (!cJSON_IsArray(flows)) { ogs_error("OpenAPI_qos_notification_control_info_parseFromJSON() failed [flows]"); goto end; } - OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive); - if (!flowsItem) { - ogs_error("No flowsItem"); - OpenAPI_list_free(flowsList); - goto end; + flowsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flows_local, flows) { + if (!cJSON_IsObject(flows_local)) { + ogs_error("OpenAPI_qos_notification_control_info_parseFromJSON() failed [flows]"); + goto end; + } + OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local); + if (!flowsItem) { + ogs_error("No flowsItem"); + OpenAPI_list_free(flowsList); + goto end; + } + OpenAPI_list_add(flowsList, flowsItem); } - - OpenAPI_list_add(flowsList, flowsItem); - } } - cJSON *alt_ser_req = cJSON_GetObjectItemCaseSensitive(qos_notification_control_infoJSON, "altSerReq"); - + alt_ser_req = cJSON_GetObjectItemCaseSensitive(qos_notification_control_infoJSON, "altSerReq"); if (alt_ser_req) { - if (!cJSON_IsString(alt_ser_req)) { + if (!cJSON_IsString(alt_ser_req) && !cJSON_IsNull(alt_ser_req)) { ogs_error("OpenAPI_qos_notification_control_info_parseFromJSON() failed [alt_ser_req]"); goto end; } @@ -137,11 +144,18 @@ OpenAPI_qos_notification_control_info_t *OpenAPI_qos_notification_control_info_p qos_notification_control_info_local_var = OpenAPI_qos_notification_control_info_create ( notif_typeVariable, flows ? flowsList : NULL, - alt_ser_req ? ogs_strdup(alt_ser_req->valuestring) : NULL + alt_ser_req && !cJSON_IsNull(alt_ser_req) ? ogs_strdup(alt_ser_req->valuestring) : NULL ); return qos_notification_control_info_local_var; end: + if (flowsList) { + OpenAPI_list_for_each(flowsList, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(flowsList); + flowsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ran_nas_rel_cause.c b/lib/sbi/openapi/model/ran_nas_rel_cause.c index d380a65b5..b9b041b8b 100644 --- a/lib/sbi/openapi/model/ran_nas_rel_cause.c +++ b/lib/sbi/openapi/model/ran_nas_rel_cause.c @@ -28,18 +28,26 @@ OpenAPI_ran_nas_rel_cause_t *OpenAPI_ran_nas_rel_cause_create( void OpenAPI_ran_nas_rel_cause_free(OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_cause) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ran_nas_rel_cause) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ng_ap_cause_free(ran_nas_rel_cause->ng_ap_cause); - ogs_free(ran_nas_rel_cause->eps_cause); + if (ran_nas_rel_cause->ng_ap_cause) { + OpenAPI_ng_ap_cause_free(ran_nas_rel_cause->ng_ap_cause); + ran_nas_rel_cause->ng_ap_cause = NULL; + } + if (ran_nas_rel_cause->eps_cause) { + ogs_free(ran_nas_rel_cause->eps_cause); + ran_nas_rel_cause->eps_cause = NULL; + } ogs_free(ran_nas_rel_cause); } cJSON *OpenAPI_ran_nas_rel_cause_convertToJSON(OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_cause) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ran_nas_rel_cause == NULL) { ogs_error("OpenAPI_ran_nas_rel_cause_convertToJSON() failed [RanNasRelCause]"); @@ -88,15 +96,18 @@ end: OpenAPI_ran_nas_rel_cause_t *OpenAPI_ran_nas_rel_cause_parseFromJSON(cJSON *ran_nas_rel_causeJSON) { OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_cause_local_var = NULL; - cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(ran_nas_rel_causeJSON, "ngApCause"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ng_ap_cause = NULL; OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + cJSON *_5g_mm_cause = NULL; + cJSON *_5g_sm_cause = NULL; + cJSON *eps_cause = NULL; + ng_ap_cause = cJSON_GetObjectItemCaseSensitive(ran_nas_rel_causeJSON, "ngApCause"); if (ng_ap_cause) { ng_ap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ng_ap_cause); } - cJSON *_5g_mm_cause = cJSON_GetObjectItemCaseSensitive(ran_nas_rel_causeJSON, "5gMmCause"); - + _5g_mm_cause = cJSON_GetObjectItemCaseSensitive(ran_nas_rel_causeJSON, "5gMmCause"); if (_5g_mm_cause) { if (!cJSON_IsNumber(_5g_mm_cause)) { ogs_error("OpenAPI_ran_nas_rel_cause_parseFromJSON() failed [_5g_mm_cause]"); @@ -104,8 +115,7 @@ OpenAPI_ran_nas_rel_cause_t *OpenAPI_ran_nas_rel_cause_parseFromJSON(cJSON *ran_ } } - cJSON *_5g_sm_cause = cJSON_GetObjectItemCaseSensitive(ran_nas_rel_causeJSON, "5gSmCause"); - + _5g_sm_cause = cJSON_GetObjectItemCaseSensitive(ran_nas_rel_causeJSON, "5gSmCause"); if (_5g_sm_cause) { if (!cJSON_IsNumber(_5g_sm_cause)) { ogs_error("OpenAPI_ran_nas_rel_cause_parseFromJSON() failed [_5g_sm_cause]"); @@ -113,10 +123,9 @@ OpenAPI_ran_nas_rel_cause_t *OpenAPI_ran_nas_rel_cause_parseFromJSON(cJSON *ran_ } } - cJSON *eps_cause = cJSON_GetObjectItemCaseSensitive(ran_nas_rel_causeJSON, "epsCause"); - + eps_cause = cJSON_GetObjectItemCaseSensitive(ran_nas_rel_causeJSON, "epsCause"); if (eps_cause) { - if (!cJSON_IsString(eps_cause)) { + if (!cJSON_IsString(eps_cause) && !cJSON_IsNull(eps_cause)) { ogs_error("OpenAPI_ran_nas_rel_cause_parseFromJSON() failed [eps_cause]"); goto end; } @@ -128,11 +137,15 @@ OpenAPI_ran_nas_rel_cause_t *OpenAPI_ran_nas_rel_cause_parseFromJSON(cJSON *ran_ _5g_mm_cause ? _5g_mm_cause->valuedouble : 0, _5g_sm_cause ? true : false, _5g_sm_cause ? _5g_sm_cause->valuedouble : 0, - eps_cause ? ogs_strdup(eps_cause->valuestring) : NULL + eps_cause && !cJSON_IsNull(eps_cause) ? ogs_strdup(eps_cause->valuestring) : NULL ); return ran_nas_rel_cause_local_var; end: + if (ng_ap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ng_ap_cause_local_nonprim); + ng_ap_cause_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/rat_selector.c b/lib/sbi/openapi/model/rat_selector.c index 12254bd98..68622f69a 100644 --- a/lib/sbi/openapi/model/rat_selector.c +++ b/lib/sbi/openapi/model/rat_selector.c @@ -6,7 +6,7 @@ char* OpenAPI_rat_selector_ToString(OpenAPI_rat_selector_e rat_selector) { - const char *rat_selectorArray[] = { "NULL", "E_UTRA", "NR" }; + const char *rat_selectorArray[] = { "NULL", "E-UTRA", "NR" }; size_t sizeofArray = sizeof(rat_selectorArray) / sizeof(rat_selectorArray[0]); if (rat_selector < sizeofArray) return (char *)rat_selectorArray[rat_selector]; @@ -17,7 +17,7 @@ char* OpenAPI_rat_selector_ToString(OpenAPI_rat_selector_e rat_selector) OpenAPI_rat_selector_e OpenAPI_rat_selector_FromString(char* rat_selector) { int stringToReturn = 0; - const char *rat_selectorArray[] = { "NULL", "E_UTRA", "NR" }; + const char *rat_selectorArray[] = { "NULL", "E-UTRA", "NR" }; size_t sizeofArray = sizeof(rat_selectorArray) / sizeof(rat_selectorArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(rat_selector, rat_selectorArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/rat_type.c b/lib/sbi/openapi/model/rat_type.c index 016439cb0..d31d7ccd7 100644 --- a/lib/sbi/openapi/model/rat_type.c +++ b/lib/sbi/openapi/model/rat_type.c @@ -6,7 +6,7 @@ char* OpenAPI_rat_type_ToString(OpenAPI_rat_type_e rat_type) { - const char *rat_typeArray[] = { "NULL", "NR", "EUTRA", "WLAN", "_VIRTUAL", "NBIOT", "WIRELINE", "WIRELINE_CABLE", "WIRELINE_BBF", "LTE_M", "NR_U", "EUTRA_U", "TRUSTED_N3GA", "TRUSTED_WLAN", "UTRA", "GERA" }; + const char *rat_typeArray[] = { "NULL", "NR", "EUTRA", "WLAN", "VIRTUAL", "NBIOT", "WIRELINE", "WIRELINE_CABLE", "WIRELINE_BBF", "LTE-M", "NR_U", "EUTRA_U", "TRUSTED_N3GA", "TRUSTED_WLAN", "UTRA", "GERA" }; size_t sizeofArray = sizeof(rat_typeArray) / sizeof(rat_typeArray[0]); if (rat_type < sizeofArray) return (char *)rat_typeArray[rat_type]; @@ -17,7 +17,7 @@ char* OpenAPI_rat_type_ToString(OpenAPI_rat_type_e rat_type) OpenAPI_rat_type_e OpenAPI_rat_type_FromString(char* rat_type) { int stringToReturn = 0; - const char *rat_typeArray[] = { "NULL", "NR", "EUTRA", "WLAN", "_VIRTUAL", "NBIOT", "WIRELINE", "WIRELINE_CABLE", "WIRELINE_BBF", "LTE_M", "NR_U", "EUTRA_U", "TRUSTED_N3GA", "TRUSTED_WLAN", "UTRA", "GERA" }; + const char *rat_typeArray[] = { "NULL", "NR", "EUTRA", "WLAN", "VIRTUAL", "NBIOT", "WIRELINE", "WIRELINE_CABLE", "WIRELINE_BBF", "LTE-M", "NR_U", "EUTRA_U", "TRUSTED_N3GA", "TRUSTED_WLAN", "UTRA", "GERA" }; size_t sizeofArray = sizeof(rat_typeArray) / sizeof(rat_typeArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(rat_type, rat_typeArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/reachability_filter.c b/lib/sbi/openapi/model/reachability_filter.c index 2cc2b935e..1dcd8aac2 100644 --- a/lib/sbi/openapi/model/reachability_filter.c +++ b/lib/sbi/openapi/model/reachability_filter.c @@ -16,16 +16,18 @@ OpenAPI_reachability_filter_t *OpenAPI_reachability_filter_create( void OpenAPI_reachability_filter_free(OpenAPI_reachability_filter_t *reachability_filter) { + OpenAPI_lnode_t *node = NULL; + if (NULL == reachability_filter) { return; } - OpenAPI_lnode_t *node; ogs_free(reachability_filter); } cJSON *OpenAPI_reachability_filter_convertToJSON(OpenAPI_reachability_filter_t *reachability_filter) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (reachability_filter == NULL) { ogs_error("OpenAPI_reachability_filter_convertToJSON() failed [ReachabilityFilter]"); @@ -40,6 +42,7 @@ end: OpenAPI_reachability_filter_t *OpenAPI_reachability_filter_parseFromJSON(cJSON *reachability_filterJSON) { OpenAPI_reachability_filter_t *reachability_filter_local_var = NULL; + OpenAPI_lnode_t *node = NULL; reachability_filter_local_var = OpenAPI_reachability_filter_create ( ); diff --git a/lib/sbi/openapi/model/reachability_for_sms_configuration.c b/lib/sbi/openapi/model/reachability_for_sms_configuration.c index cc0d8c635..2628970e9 100644 --- a/lib/sbi/openapi/model/reachability_for_sms_configuration.c +++ b/lib/sbi/openapi/model/reachability_for_sms_configuration.c @@ -16,16 +16,18 @@ OpenAPI_reachability_for_sms_configuration_t *OpenAPI_reachability_for_sms_confi void OpenAPI_reachability_for_sms_configuration_free(OpenAPI_reachability_for_sms_configuration_t *reachability_for_sms_configuration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == reachability_for_sms_configuration) { return; } - OpenAPI_lnode_t *node; ogs_free(reachability_for_sms_configuration); } cJSON *OpenAPI_reachability_for_sms_configuration_convertToJSON(OpenAPI_reachability_for_sms_configuration_t *reachability_for_sms_configuration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (reachability_for_sms_configuration == NULL) { ogs_error("OpenAPI_reachability_for_sms_configuration_convertToJSON() failed [ReachabilityForSmsConfiguration]"); @@ -40,6 +42,7 @@ end: OpenAPI_reachability_for_sms_configuration_t *OpenAPI_reachability_for_sms_configuration_parseFromJSON(cJSON *reachability_for_sms_configurationJSON) { OpenAPI_reachability_for_sms_configuration_t *reachability_for_sms_configuration_local_var = NULL; + OpenAPI_lnode_t *node = NULL; reachability_for_sms_configuration_local_var = OpenAPI_reachability_for_sms_configuration_create ( ); diff --git a/lib/sbi/openapi/model/redirect_information.c b/lib/sbi/openapi/model/redirect_information.c index a80e5e0fe..aa43bd74b 100644 --- a/lib/sbi/openapi/model/redirect_information.c +++ b/lib/sbi/openapi/model/redirect_information.c @@ -24,17 +24,22 @@ OpenAPI_redirect_information_t *OpenAPI_redirect_information_create( void OpenAPI_redirect_information_free(OpenAPI_redirect_information_t *redirect_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == redirect_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(redirect_information->redirect_server_address); + if (redirect_information->redirect_server_address) { + ogs_free(redirect_information->redirect_server_address); + redirect_information->redirect_server_address = NULL; + } ogs_free(redirect_information); } cJSON *OpenAPI_redirect_information_convertToJSON(OpenAPI_redirect_information_t *redirect_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (redirect_information == NULL) { ogs_error("OpenAPI_redirect_information_convertToJSON() failed [RedirectInformation]"); @@ -49,7 +54,7 @@ cJSON *OpenAPI_redirect_information_convertToJSON(OpenAPI_redirect_information_t } } - if (redirect_information->redirect_address_type) { + if (redirect_information->redirect_address_type != OpenAPI_redirect_address_type_NULL) { if (cJSON_AddStringToObject(item, "redirectAddressType", OpenAPI_redirect_address_type_ToString(redirect_information->redirect_address_type)) == NULL) { ogs_error("OpenAPI_redirect_information_convertToJSON() failed [redirect_address_type]"); goto end; @@ -70,8 +75,12 @@ end: OpenAPI_redirect_information_t *OpenAPI_redirect_information_parseFromJSON(cJSON *redirect_informationJSON) { OpenAPI_redirect_information_t *redirect_information_local_var = NULL; - cJSON *redirect_enabled = cJSON_GetObjectItemCaseSensitive(redirect_informationJSON, "redirectEnabled"); - + OpenAPI_lnode_t *node = NULL; + cJSON *redirect_enabled = NULL; + cJSON *redirect_address_type = NULL; + OpenAPI_redirect_address_type_e redirect_address_typeVariable = 0; + cJSON *redirect_server_address = NULL; + redirect_enabled = cJSON_GetObjectItemCaseSensitive(redirect_informationJSON, "redirectEnabled"); if (redirect_enabled) { if (!cJSON_IsBool(redirect_enabled)) { ogs_error("OpenAPI_redirect_information_parseFromJSON() failed [redirect_enabled]"); @@ -79,9 +88,7 @@ OpenAPI_redirect_information_t *OpenAPI_redirect_information_parseFromJSON(cJSON } } - cJSON *redirect_address_type = cJSON_GetObjectItemCaseSensitive(redirect_informationJSON, "redirectAddressType"); - - OpenAPI_redirect_address_type_e redirect_address_typeVariable; + redirect_address_type = cJSON_GetObjectItemCaseSensitive(redirect_informationJSON, "redirectAddressType"); if (redirect_address_type) { if (!cJSON_IsString(redirect_address_type)) { ogs_error("OpenAPI_redirect_information_parseFromJSON() failed [redirect_address_type]"); @@ -90,10 +97,9 @@ OpenAPI_redirect_information_t *OpenAPI_redirect_information_parseFromJSON(cJSON redirect_address_typeVariable = OpenAPI_redirect_address_type_FromString(redirect_address_type->valuestring); } - cJSON *redirect_server_address = cJSON_GetObjectItemCaseSensitive(redirect_informationJSON, "redirectServerAddress"); - + redirect_server_address = cJSON_GetObjectItemCaseSensitive(redirect_informationJSON, "redirectServerAddress"); if (redirect_server_address) { - if (!cJSON_IsString(redirect_server_address)) { + if (!cJSON_IsString(redirect_server_address) && !cJSON_IsNull(redirect_server_address)) { ogs_error("OpenAPI_redirect_information_parseFromJSON() failed [redirect_server_address]"); goto end; } @@ -103,7 +109,7 @@ OpenAPI_redirect_information_t *OpenAPI_redirect_information_parseFromJSON(cJSON redirect_enabled ? true : false, redirect_enabled ? redirect_enabled->valueint : 0, redirect_address_type ? redirect_address_typeVariable : 0, - redirect_server_address ? ogs_strdup(redirect_server_address->valuestring) : NULL + redirect_server_address && !cJSON_IsNull(redirect_server_address) ? ogs_strdup(redirect_server_address->valuestring) : NULL ); return redirect_information_local_var; diff --git a/lib/sbi/openapi/model/redirect_response.c b/lib/sbi/openapi/model/redirect_response.c index 41a8ab89a..f5610aec2 100644 --- a/lib/sbi/openapi/model/redirect_response.c +++ b/lib/sbi/openapi/model/redirect_response.c @@ -20,18 +20,26 @@ OpenAPI_redirect_response_t *OpenAPI_redirect_response_create( void OpenAPI_redirect_response_free(OpenAPI_redirect_response_t *redirect_response) { + OpenAPI_lnode_t *node = NULL; + if (NULL == redirect_response) { return; } - OpenAPI_lnode_t *node; - ogs_free(redirect_response->cause); - ogs_free(redirect_response->target_scp); + if (redirect_response->cause) { + ogs_free(redirect_response->cause); + redirect_response->cause = NULL; + } + if (redirect_response->target_scp) { + ogs_free(redirect_response->target_scp); + redirect_response->target_scp = NULL; + } ogs_free(redirect_response); } cJSON *OpenAPI_redirect_response_convertToJSON(OpenAPI_redirect_response_t *redirect_response) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (redirect_response == NULL) { ogs_error("OpenAPI_redirect_response_convertToJSON() failed [RedirectResponse]"); @@ -60,27 +68,28 @@ end: OpenAPI_redirect_response_t *OpenAPI_redirect_response_parseFromJSON(cJSON *redirect_responseJSON) { OpenAPI_redirect_response_t *redirect_response_local_var = NULL; - cJSON *cause = cJSON_GetObjectItemCaseSensitive(redirect_responseJSON, "cause"); - + OpenAPI_lnode_t *node = NULL; + cJSON *cause = NULL; + cJSON *target_scp = NULL; + cause = cJSON_GetObjectItemCaseSensitive(redirect_responseJSON, "cause"); if (cause) { - if (!cJSON_IsString(cause)) { + if (!cJSON_IsString(cause) && !cJSON_IsNull(cause)) { ogs_error("OpenAPI_redirect_response_parseFromJSON() failed [cause]"); goto end; } } - cJSON *target_scp = cJSON_GetObjectItemCaseSensitive(redirect_responseJSON, "targetScp"); - + target_scp = cJSON_GetObjectItemCaseSensitive(redirect_responseJSON, "targetScp"); if (target_scp) { - if (!cJSON_IsString(target_scp)) { + if (!cJSON_IsString(target_scp) && !cJSON_IsNull(target_scp)) { ogs_error("OpenAPI_redirect_response_parseFromJSON() failed [target_scp]"); goto end; } } redirect_response_local_var = OpenAPI_redirect_response_create ( - cause ? ogs_strdup(cause->valuestring) : NULL, - target_scp ? ogs_strdup(target_scp->valuestring) : NULL + cause && !cJSON_IsNull(cause) ? ogs_strdup(cause->valuestring) : NULL, + target_scp && !cJSON_IsNull(target_scp) ? ogs_strdup(target_scp->valuestring) : NULL ); return redirect_response_local_var; diff --git a/lib/sbi/openapi/model/redundant_pdu_session_information.c b/lib/sbi/openapi/model/redundant_pdu_session_information.c index d6d5d5735..dd028da38 100644 --- a/lib/sbi/openapi/model/redundant_pdu_session_information.c +++ b/lib/sbi/openapi/model/redundant_pdu_session_information.c @@ -18,16 +18,18 @@ OpenAPI_redundant_pdu_session_information_t *OpenAPI_redundant_pdu_session_infor void OpenAPI_redundant_pdu_session_information_free(OpenAPI_redundant_pdu_session_information_t *redundant_pdu_session_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == redundant_pdu_session_information) { return; } - OpenAPI_lnode_t *node; ogs_free(redundant_pdu_session_information); } cJSON *OpenAPI_redundant_pdu_session_information_convertToJSON(OpenAPI_redundant_pdu_session_information_t *redundant_pdu_session_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (redundant_pdu_session_information == NULL) { ogs_error("OpenAPI_redundant_pdu_session_information_convertToJSON() failed [RedundantPduSessionInformation]"); @@ -35,6 +37,10 @@ cJSON *OpenAPI_redundant_pdu_session_information_convertToJSON(OpenAPI_redundant } item = cJSON_CreateObject(); + if (redundant_pdu_session_information->rsn == OpenAPI_rsn_NULL) { + ogs_error("OpenAPI_redundant_pdu_session_information_convertToJSON() failed [rsn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "rsn", OpenAPI_rsn_ToString(redundant_pdu_session_information->rsn)) == NULL) { ogs_error("OpenAPI_redundant_pdu_session_information_convertToJSON() failed [rsn]"); goto end; @@ -47,13 +53,14 @@ end: OpenAPI_redundant_pdu_session_information_t *OpenAPI_redundant_pdu_session_information_parseFromJSON(cJSON *redundant_pdu_session_informationJSON) { OpenAPI_redundant_pdu_session_information_t *redundant_pdu_session_information_local_var = NULL; - cJSON *rsn = cJSON_GetObjectItemCaseSensitive(redundant_pdu_session_informationJSON, "rsn"); + OpenAPI_lnode_t *node = NULL; + cJSON *rsn = NULL; + OpenAPI_rsn_e rsnVariable = 0; + rsn = cJSON_GetObjectItemCaseSensitive(redundant_pdu_session_informationJSON, "rsn"); if (!rsn) { ogs_error("OpenAPI_redundant_pdu_session_information_parseFromJSON() failed [rsn]"); goto end; } - - OpenAPI_rsn_e rsnVariable; if (!cJSON_IsString(rsn)) { ogs_error("OpenAPI_redundant_pdu_session_information_parseFromJSON() failed [rsn]"); goto end; diff --git a/lib/sbi/openapi/model/ref_to_binary_data.c b/lib/sbi/openapi/model/ref_to_binary_data.c index bde491fe6..9c7a44d3c 100644 --- a/lib/sbi/openapi/model/ref_to_binary_data.c +++ b/lib/sbi/openapi/model/ref_to_binary_data.c @@ -18,17 +18,22 @@ OpenAPI_ref_to_binary_data_t *OpenAPI_ref_to_binary_data_create( void OpenAPI_ref_to_binary_data_free(OpenAPI_ref_to_binary_data_t *ref_to_binary_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ref_to_binary_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(ref_to_binary_data->content_id); + if (ref_to_binary_data->content_id) { + ogs_free(ref_to_binary_data->content_id); + ref_to_binary_data->content_id = NULL; + } ogs_free(ref_to_binary_data); } cJSON *OpenAPI_ref_to_binary_data_convertToJSON(OpenAPI_ref_to_binary_data_t *ref_to_binary_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ref_to_binary_data == NULL) { ogs_error("OpenAPI_ref_to_binary_data_convertToJSON() failed [RefToBinaryData]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_ref_to_binary_data_convertToJSON(OpenAPI_ref_to_binary_data_t *re } item = cJSON_CreateObject(); + if (!ref_to_binary_data->content_id) { + ogs_error("OpenAPI_ref_to_binary_data_convertToJSON() failed [content_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "contentId", ref_to_binary_data->content_id) == NULL) { ogs_error("OpenAPI_ref_to_binary_data_convertToJSON() failed [content_id]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_ref_to_binary_data_t *OpenAPI_ref_to_binary_data_parseFromJSON(cJSON *ref_to_binary_dataJSON) { OpenAPI_ref_to_binary_data_t *ref_to_binary_data_local_var = NULL; - cJSON *content_id = cJSON_GetObjectItemCaseSensitive(ref_to_binary_dataJSON, "contentId"); + OpenAPI_lnode_t *node = NULL; + cJSON *content_id = NULL; + content_id = cJSON_GetObjectItemCaseSensitive(ref_to_binary_dataJSON, "contentId"); if (!content_id) { ogs_error("OpenAPI_ref_to_binary_data_parseFromJSON() failed [content_id]"); goto end; } - if (!cJSON_IsString(content_id)) { ogs_error("OpenAPI_ref_to_binary_data_parseFromJSON() failed [content_id]"); goto end; diff --git a/lib/sbi/openapi/model/registration_context_container.c b/lib/sbi/openapi/model/registration_context_container.c index f0d073b7e..ee5d36a98 100644 --- a/lib/sbi/openapi/model/registration_context_container.c +++ b/lib/sbi/openapi/model/registration_context_container.c @@ -68,41 +68,91 @@ OpenAPI_registration_context_container_t *OpenAPI_registration_context_container void OpenAPI_registration_context_container_free(OpenAPI_registration_context_container_t *registration_context_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == registration_context_container) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_free(registration_context_container->ue_context); - ogs_free(registration_context_container->local_time_zone); - OpenAPI_global_ran_node_id_free(registration_context_container->ran_node_id); - ogs_free(registration_context_container->initial_amf_name); - OpenAPI_user_location_free(registration_context_container->user_location); - ogs_free(registration_context_container->rrc_est_cause); - ogs_free(registration_context_container->an_n2_ipv4_addr); - ogs_free(registration_context_container->an_n2_ipv6_addr); - OpenAPI_allowed_nssai_free(registration_context_container->allowed_nssai); - OpenAPI_list_for_each(registration_context_container->configured_nssai, node) { - OpenAPI_configured_snssai_free(node->data); + if (registration_context_container->ue_context) { + OpenAPI_ue_context_free(registration_context_container->ue_context); + registration_context_container->ue_context = NULL; } - OpenAPI_list_free(registration_context_container->configured_nssai); - OpenAPI_list_for_each(registration_context_container->rejected_nssai_in_plmn, node) { - OpenAPI_snssai_free(node->data); + if (registration_context_container->local_time_zone) { + ogs_free(registration_context_container->local_time_zone); + registration_context_container->local_time_zone = NULL; } - OpenAPI_list_free(registration_context_container->rejected_nssai_in_plmn); - OpenAPI_list_for_each(registration_context_container->rejected_nssai_in_ta, node) { - OpenAPI_snssai_free(node->data); + if (registration_context_container->ran_node_id) { + OpenAPI_global_ran_node_id_free(registration_context_container->ran_node_id); + registration_context_container->ran_node_id = NULL; + } + if (registration_context_container->initial_amf_name) { + ogs_free(registration_context_container->initial_amf_name); + registration_context_container->initial_amf_name = NULL; + } + if (registration_context_container->user_location) { + OpenAPI_user_location_free(registration_context_container->user_location); + registration_context_container->user_location = NULL; + } + if (registration_context_container->rrc_est_cause) { + ogs_free(registration_context_container->rrc_est_cause); + registration_context_container->rrc_est_cause = NULL; + } + if (registration_context_container->an_n2_ipv4_addr) { + ogs_free(registration_context_container->an_n2_ipv4_addr); + registration_context_container->an_n2_ipv4_addr = NULL; + } + if (registration_context_container->an_n2_ipv6_addr) { + ogs_free(registration_context_container->an_n2_ipv6_addr); + registration_context_container->an_n2_ipv6_addr = NULL; + } + if (registration_context_container->allowed_nssai) { + OpenAPI_allowed_nssai_free(registration_context_container->allowed_nssai); + registration_context_container->allowed_nssai = NULL; + } + if (registration_context_container->configured_nssai) { + OpenAPI_list_for_each(registration_context_container->configured_nssai, node) { + OpenAPI_configured_snssai_free(node->data); + } + OpenAPI_list_free(registration_context_container->configured_nssai); + registration_context_container->configured_nssai = NULL; + } + if (registration_context_container->rejected_nssai_in_plmn) { + OpenAPI_list_for_each(registration_context_container->rejected_nssai_in_plmn, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(registration_context_container->rejected_nssai_in_plmn); + registration_context_container->rejected_nssai_in_plmn = NULL; + } + if (registration_context_container->rejected_nssai_in_ta) { + OpenAPI_list_for_each(registration_context_container->rejected_nssai_in_ta, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(registration_context_container->rejected_nssai_in_ta); + registration_context_container->rejected_nssai_in_ta = NULL; + } + if (registration_context_container->selected_plmn_id) { + OpenAPI_plmn_id_free(registration_context_container->selected_plmn_id); + registration_context_container->selected_plmn_id = NULL; + } + if (registration_context_container->ce_mode_b_ind) { + OpenAPI_ce_mode_b_ind_free(registration_context_container->ce_mode_b_ind); + registration_context_container->ce_mode_b_ind = NULL; + } + if (registration_context_container->lte_m_ind) { + OpenAPI_lte_m_ind_free(registration_context_container->lte_m_ind); + registration_context_container->lte_m_ind = NULL; + } + if (registration_context_container->npn_access_info) { + OpenAPI_npn_access_info_free(registration_context_container->npn_access_info); + registration_context_container->npn_access_info = NULL; } - OpenAPI_list_free(registration_context_container->rejected_nssai_in_ta); - OpenAPI_plmn_id_free(registration_context_container->selected_plmn_id); - OpenAPI_ce_mode_b_ind_free(registration_context_container->ce_mode_b_ind); - OpenAPI_lte_m_ind_free(registration_context_container->lte_m_ind); - OpenAPI_npn_access_info_free(registration_context_container->npn_access_info); ogs_free(registration_context_container); } cJSON *OpenAPI_registration_context_container_convertToJSON(OpenAPI_registration_context_container_t *registration_context_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (registration_context_container == NULL) { ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [RegistrationContextContainer]"); @@ -110,6 +160,10 @@ cJSON *OpenAPI_registration_context_container_convertToJSON(OpenAPI_registration } item = cJSON_CreateObject(); + if (!registration_context_container->ue_context) { + ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [ue_context]"); + return NULL; + } cJSON *ue_context_local_JSON = OpenAPI_ue_context_convertToJSON(registration_context_container->ue_context); if (ue_context_local_JSON == NULL) { ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [ue_context]"); @@ -128,6 +182,10 @@ cJSON *OpenAPI_registration_context_container_convertToJSON(OpenAPI_registration } } + if (registration_context_container->an_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [an_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "anType", OpenAPI_access_type_ToString(registration_context_container->an_type)) == NULL) { ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [an_type]"); goto end; @@ -138,6 +196,10 @@ cJSON *OpenAPI_registration_context_container_convertToJSON(OpenAPI_registration goto end; } + if (!registration_context_container->ran_node_id) { + ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [ran_node_id]"); + return NULL; + } cJSON *ran_node_id_local_JSON = OpenAPI_global_ran_node_id_convertToJSON(registration_context_container->ran_node_id); if (ran_node_id_local_JSON == NULL) { ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [ran_node_id]"); @@ -149,11 +211,19 @@ cJSON *OpenAPI_registration_context_container_convertToJSON(OpenAPI_registration goto end; } + if (!registration_context_container->initial_amf_name) { + ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [initial_amf_name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "initialAmfName", registration_context_container->initial_amf_name) == NULL) { ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [initial_amf_name]"); goto end; } + if (!registration_context_container->user_location) { + ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [user_location]"); + return NULL; + } cJSON *user_location_local_JSON = OpenAPI_user_location_convertToJSON(registration_context_container->user_location); if (user_location_local_JSON == NULL) { ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [user_location]"); @@ -219,17 +289,13 @@ cJSON *OpenAPI_registration_context_container_convertToJSON(OpenAPI_registration ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [configured_nssai]"); goto end; } - - OpenAPI_lnode_t *configured_nssai_node; - if (registration_context_container->configured_nssai) { - OpenAPI_list_for_each(registration_context_container->configured_nssai, configured_nssai_node) { - cJSON *itemLocal = OpenAPI_configured_snssai_convertToJSON(configured_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [configured_nssai]"); - goto end; - } - cJSON_AddItemToArray(configured_nssaiList, itemLocal); + OpenAPI_list_for_each(registration_context_container->configured_nssai, node) { + cJSON *itemLocal = OpenAPI_configured_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [configured_nssai]"); + goto end; } + cJSON_AddItemToArray(configured_nssaiList, itemLocal); } } @@ -239,17 +305,13 @@ cJSON *OpenAPI_registration_context_container_convertToJSON(OpenAPI_registration ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [rejected_nssai_in_plmn]"); goto end; } - - OpenAPI_lnode_t *rejected_nssai_in_plmn_node; - if (registration_context_container->rejected_nssai_in_plmn) { - OpenAPI_list_for_each(registration_context_container->rejected_nssai_in_plmn, rejected_nssai_in_plmn_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(rejected_nssai_in_plmn_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [rejected_nssai_in_plmn]"); - goto end; - } - cJSON_AddItemToArray(rejected_nssai_in_plmnList, itemLocal); + OpenAPI_list_for_each(registration_context_container->rejected_nssai_in_plmn, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [rejected_nssai_in_plmn]"); + goto end; } + cJSON_AddItemToArray(rejected_nssai_in_plmnList, itemLocal); } } @@ -259,17 +321,13 @@ cJSON *OpenAPI_registration_context_container_convertToJSON(OpenAPI_registration ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [rejected_nssai_in_ta]"); goto end; } - - OpenAPI_lnode_t *rejected_nssai_in_ta_node; - if (registration_context_container->rejected_nssai_in_ta) { - OpenAPI_list_for_each(registration_context_container->rejected_nssai_in_ta, rejected_nssai_in_ta_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(rejected_nssai_in_ta_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [rejected_nssai_in_ta]"); - goto end; - } - cJSON_AddItemToArray(rejected_nssai_in_taList, itemLocal); + OpenAPI_list_for_each(registration_context_container->rejected_nssai_in_ta, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_registration_context_container_convertToJSON() failed [rejected_nssai_in_ta]"); + goto end; } + cJSON_AddItemToArray(rejected_nssai_in_taList, itemLocal); } } @@ -346,88 +404,110 @@ end: OpenAPI_registration_context_container_t *OpenAPI_registration_context_container_parseFromJSON(cJSON *registration_context_containerJSON) { OpenAPI_registration_context_container_t *registration_context_container_local_var = NULL; - cJSON *ue_context = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "ueContext"); + OpenAPI_lnode_t *node = NULL; + cJSON *ue_context = NULL; + OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; + cJSON *local_time_zone = NULL; + cJSON *an_type = NULL; + OpenAPI_access_type_e an_typeVariable = 0; + cJSON *an_n2_ap_id = NULL; + cJSON *ran_node_id = NULL; + OpenAPI_global_ran_node_id_t *ran_node_id_local_nonprim = NULL; + cJSON *initial_amf_name = NULL; + cJSON *user_location = NULL; + OpenAPI_user_location_t *user_location_local_nonprim = NULL; + cJSON *rrc_est_cause = NULL; + cJSON *ue_context_request = NULL; + cJSON *initial_amf_n2_ap_id = NULL; + cJSON *an_n2_ipv4_addr = NULL; + cJSON *an_n2_ipv6_addr = NULL; + cJSON *allowed_nssai = NULL; + OpenAPI_allowed_nssai_t *allowed_nssai_local_nonprim = NULL; + cJSON *configured_nssai = NULL; + OpenAPI_list_t *configured_nssaiList = NULL; + cJSON *rejected_nssai_in_plmn = NULL; + OpenAPI_list_t *rejected_nssai_in_plmnList = NULL; + cJSON *rejected_nssai_in_ta = NULL; + OpenAPI_list_t *rejected_nssai_in_taList = NULL; + cJSON *selected_plmn_id = NULL; + OpenAPI_plmn_id_t *selected_plmn_id_local_nonprim = NULL; + cJSON *iab_node_ind = NULL; + cJSON *ce_mode_b_ind = NULL; + OpenAPI_ce_mode_b_ind_t *ce_mode_b_ind_local_nonprim = NULL; + cJSON *lte_m_ind = NULL; + OpenAPI_lte_m_ind_t *lte_m_ind_local_nonprim = NULL; + cJSON *authenticated_ind = NULL; + cJSON *npn_access_info = NULL; + OpenAPI_npn_access_info_t *npn_access_info_local_nonprim = NULL; + ue_context = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "ueContext"); if (!ue_context) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [ue_context]"); goto end; } - - OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; ue_context_local_nonprim = OpenAPI_ue_context_parseFromJSON(ue_context); - cJSON *local_time_zone = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "localTimeZone"); - + local_time_zone = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "localTimeZone"); if (local_time_zone) { - if (!cJSON_IsString(local_time_zone)) { + if (!cJSON_IsString(local_time_zone) && !cJSON_IsNull(local_time_zone)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [local_time_zone]"); goto end; } } - cJSON *an_type = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "anType"); + an_type = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "anType"); if (!an_type) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [an_type]"); goto end; } - - OpenAPI_access_type_e an_typeVariable; if (!cJSON_IsString(an_type)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [an_type]"); goto end; } an_typeVariable = OpenAPI_access_type_FromString(an_type->valuestring); - cJSON *an_n2_ap_id = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "anN2ApId"); + an_n2_ap_id = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "anN2ApId"); if (!an_n2_ap_id) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [an_n2_ap_id]"); goto end; } - if (!cJSON_IsNumber(an_n2_ap_id)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [an_n2_ap_id]"); goto end; } - cJSON *ran_node_id = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "ranNodeId"); + ran_node_id = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "ranNodeId"); if (!ran_node_id) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [ran_node_id]"); goto end; } - - OpenAPI_global_ran_node_id_t *ran_node_id_local_nonprim = NULL; ran_node_id_local_nonprim = OpenAPI_global_ran_node_id_parseFromJSON(ran_node_id); - cJSON *initial_amf_name = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "initialAmfName"); + initial_amf_name = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "initialAmfName"); if (!initial_amf_name) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [initial_amf_name]"); goto end; } - if (!cJSON_IsString(initial_amf_name)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [initial_amf_name]"); goto end; } - cJSON *user_location = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "userLocation"); + user_location = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "userLocation"); if (!user_location) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [user_location]"); goto end; } - - OpenAPI_user_location_t *user_location_local_nonprim = NULL; user_location_local_nonprim = OpenAPI_user_location_parseFromJSON(user_location); - cJSON *rrc_est_cause = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "rrcEstCause"); - + rrc_est_cause = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "rrcEstCause"); if (rrc_est_cause) { - if (!cJSON_IsString(rrc_est_cause)) { + if (!cJSON_IsString(rrc_est_cause) && !cJSON_IsNull(rrc_est_cause)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [rrc_est_cause]"); goto end; } } - cJSON *ue_context_request = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "ueContextRequest"); - + ue_context_request = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "ueContextRequest"); if (ue_context_request) { if (!cJSON_IsBool(ue_context_request)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [ue_context_request]"); @@ -435,8 +515,7 @@ OpenAPI_registration_context_container_t *OpenAPI_registration_context_container } } - cJSON *initial_amf_n2_ap_id = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "initialAmfN2ApId"); - + initial_amf_n2_ap_id = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "initialAmfN2ApId"); if (initial_amf_n2_ap_id) { if (!cJSON_IsNumber(initial_amf_n2_ap_id)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [initial_amf_n2_ap_id]"); @@ -444,127 +523,108 @@ OpenAPI_registration_context_container_t *OpenAPI_registration_context_container } } - cJSON *an_n2_ipv4_addr = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "anN2IPv4Addr"); - + an_n2_ipv4_addr = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "anN2IPv4Addr"); if (an_n2_ipv4_addr) { - if (!cJSON_IsString(an_n2_ipv4_addr)) { + if (!cJSON_IsString(an_n2_ipv4_addr) && !cJSON_IsNull(an_n2_ipv4_addr)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [an_n2_ipv4_addr]"); goto end; } } - cJSON *an_n2_ipv6_addr = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "anN2IPv6Addr"); - + an_n2_ipv6_addr = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "anN2IPv6Addr"); if (an_n2_ipv6_addr) { - if (!cJSON_IsString(an_n2_ipv6_addr)) { + if (!cJSON_IsString(an_n2_ipv6_addr) && !cJSON_IsNull(an_n2_ipv6_addr)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [an_n2_ipv6_addr]"); goto end; } } - cJSON *allowed_nssai = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "allowedNssai"); - - OpenAPI_allowed_nssai_t *allowed_nssai_local_nonprim = NULL; + allowed_nssai = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "allowedNssai"); if (allowed_nssai) { allowed_nssai_local_nonprim = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai); } - cJSON *configured_nssai = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "configuredNssai"); - - OpenAPI_list_t *configured_nssaiList; + configured_nssai = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "configuredNssai"); if (configured_nssai) { - cJSON *configured_nssai_local_nonprimitive; - if (!cJSON_IsArray(configured_nssai)){ - ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [configured_nssai]"); - goto end; - } - - configured_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(configured_nssai_local_nonprimitive, configured_nssai ) { - if (!cJSON_IsObject(configured_nssai_local_nonprimitive)) { + cJSON *configured_nssai_local = NULL; + if (!cJSON_IsArray(configured_nssai)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [configured_nssai]"); goto end; } - OpenAPI_configured_snssai_t *configured_nssaiItem = OpenAPI_configured_snssai_parseFromJSON(configured_nssai_local_nonprimitive); - if (!configured_nssaiItem) { - ogs_error("No configured_nssaiItem"); - OpenAPI_list_free(configured_nssaiList); - goto end; + configured_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(configured_nssai_local, configured_nssai) { + if (!cJSON_IsObject(configured_nssai_local)) { + ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [configured_nssai]"); + goto end; + } + OpenAPI_configured_snssai_t *configured_nssaiItem = OpenAPI_configured_snssai_parseFromJSON(configured_nssai_local); + if (!configured_nssaiItem) { + ogs_error("No configured_nssaiItem"); + OpenAPI_list_free(configured_nssaiList); + goto end; + } + OpenAPI_list_add(configured_nssaiList, configured_nssaiItem); } - - OpenAPI_list_add(configured_nssaiList, configured_nssaiItem); - } } - cJSON *rejected_nssai_in_plmn = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "rejectedNssaiInPlmn"); - - OpenAPI_list_t *rejected_nssai_in_plmnList; + rejected_nssai_in_plmn = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "rejectedNssaiInPlmn"); if (rejected_nssai_in_plmn) { - cJSON *rejected_nssai_in_plmn_local_nonprimitive; - if (!cJSON_IsArray(rejected_nssai_in_plmn)){ - ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [rejected_nssai_in_plmn]"); - goto end; - } - - rejected_nssai_in_plmnList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rejected_nssai_in_plmn_local_nonprimitive, rejected_nssai_in_plmn ) { - if (!cJSON_IsObject(rejected_nssai_in_plmn_local_nonprimitive)) { + cJSON *rejected_nssai_in_plmn_local = NULL; + if (!cJSON_IsArray(rejected_nssai_in_plmn)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [rejected_nssai_in_plmn]"); goto end; } - OpenAPI_snssai_t *rejected_nssai_in_plmnItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_plmn_local_nonprimitive); - if (!rejected_nssai_in_plmnItem) { - ogs_error("No rejected_nssai_in_plmnItem"); - OpenAPI_list_free(rejected_nssai_in_plmnList); - goto end; + rejected_nssai_in_plmnList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rejected_nssai_in_plmn_local, rejected_nssai_in_plmn) { + if (!cJSON_IsObject(rejected_nssai_in_plmn_local)) { + ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [rejected_nssai_in_plmn]"); + goto end; + } + OpenAPI_snssai_t *rejected_nssai_in_plmnItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_plmn_local); + if (!rejected_nssai_in_plmnItem) { + ogs_error("No rejected_nssai_in_plmnItem"); + OpenAPI_list_free(rejected_nssai_in_plmnList); + goto end; + } + OpenAPI_list_add(rejected_nssai_in_plmnList, rejected_nssai_in_plmnItem); } - - OpenAPI_list_add(rejected_nssai_in_plmnList, rejected_nssai_in_plmnItem); - } } - cJSON *rejected_nssai_in_ta = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "rejectedNssaiInTa"); - - OpenAPI_list_t *rejected_nssai_in_taList; + rejected_nssai_in_ta = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "rejectedNssaiInTa"); if (rejected_nssai_in_ta) { - cJSON *rejected_nssai_in_ta_local_nonprimitive; - if (!cJSON_IsArray(rejected_nssai_in_ta)){ - ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [rejected_nssai_in_ta]"); - goto end; - } - - rejected_nssai_in_taList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rejected_nssai_in_ta_local_nonprimitive, rejected_nssai_in_ta ) { - if (!cJSON_IsObject(rejected_nssai_in_ta_local_nonprimitive)) { + cJSON *rejected_nssai_in_ta_local = NULL; + if (!cJSON_IsArray(rejected_nssai_in_ta)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [rejected_nssai_in_ta]"); goto end; } - OpenAPI_snssai_t *rejected_nssai_in_taItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_ta_local_nonprimitive); - if (!rejected_nssai_in_taItem) { - ogs_error("No rejected_nssai_in_taItem"); - OpenAPI_list_free(rejected_nssai_in_taList); - goto end; + rejected_nssai_in_taList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rejected_nssai_in_ta_local, rejected_nssai_in_ta) { + if (!cJSON_IsObject(rejected_nssai_in_ta_local)) { + ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [rejected_nssai_in_ta]"); + goto end; + } + OpenAPI_snssai_t *rejected_nssai_in_taItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_ta_local); + if (!rejected_nssai_in_taItem) { + ogs_error("No rejected_nssai_in_taItem"); + OpenAPI_list_free(rejected_nssai_in_taList); + goto end; + } + OpenAPI_list_add(rejected_nssai_in_taList, rejected_nssai_in_taItem); } - - OpenAPI_list_add(rejected_nssai_in_taList, rejected_nssai_in_taItem); - } } - cJSON *selected_plmn_id = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "selectedPlmnId"); - - OpenAPI_plmn_id_t *selected_plmn_id_local_nonprim = NULL; + selected_plmn_id = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "selectedPlmnId"); if (selected_plmn_id) { selected_plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(selected_plmn_id); } - cJSON *iab_node_ind = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "iabNodeInd"); - + iab_node_ind = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "iabNodeInd"); if (iab_node_ind) { if (!cJSON_IsBool(iab_node_ind)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [iab_node_ind]"); @@ -572,22 +632,17 @@ OpenAPI_registration_context_container_t *OpenAPI_registration_context_container } } - cJSON *ce_mode_b_ind = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "ceModeBInd"); - - OpenAPI_ce_mode_b_ind_t *ce_mode_b_ind_local_nonprim = NULL; + ce_mode_b_ind = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "ceModeBInd"); if (ce_mode_b_ind) { ce_mode_b_ind_local_nonprim = OpenAPI_ce_mode_b_ind_parseFromJSON(ce_mode_b_ind); } - cJSON *lte_m_ind = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "lteMInd"); - - OpenAPI_lte_m_ind_t *lte_m_ind_local_nonprim = NULL; + lte_m_ind = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "lteMInd"); if (lte_m_ind) { lte_m_ind_local_nonprim = OpenAPI_lte_m_ind_parseFromJSON(lte_m_ind); } - cJSON *authenticated_ind = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "authenticatedInd"); - + authenticated_ind = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "authenticatedInd"); if (authenticated_ind) { if (!cJSON_IsBool(authenticated_ind)) { ogs_error("OpenAPI_registration_context_container_parseFromJSON() failed [authenticated_ind]"); @@ -595,29 +650,27 @@ OpenAPI_registration_context_container_t *OpenAPI_registration_context_container } } - cJSON *npn_access_info = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "npnAccessInfo"); - - OpenAPI_npn_access_info_t *npn_access_info_local_nonprim = NULL; + npn_access_info = cJSON_GetObjectItemCaseSensitive(registration_context_containerJSON, "npnAccessInfo"); if (npn_access_info) { npn_access_info_local_nonprim = OpenAPI_npn_access_info_parseFromJSON(npn_access_info); } registration_context_container_local_var = OpenAPI_registration_context_container_create ( ue_context_local_nonprim, - local_time_zone ? ogs_strdup(local_time_zone->valuestring) : NULL, + local_time_zone && !cJSON_IsNull(local_time_zone) ? ogs_strdup(local_time_zone->valuestring) : NULL, an_typeVariable, an_n2_ap_id->valuedouble, ran_node_id_local_nonprim, ogs_strdup(initial_amf_name->valuestring), user_location_local_nonprim, - rrc_est_cause ? ogs_strdup(rrc_est_cause->valuestring) : NULL, + rrc_est_cause && !cJSON_IsNull(rrc_est_cause) ? ogs_strdup(rrc_est_cause->valuestring) : NULL, ue_context_request ? true : false, ue_context_request ? ue_context_request->valueint : 0, initial_amf_n2_ap_id ? true : false, initial_amf_n2_ap_id ? initial_amf_n2_ap_id->valuedouble : 0, - an_n2_ipv4_addr ? ogs_strdup(an_n2_ipv4_addr->valuestring) : NULL, - an_n2_ipv6_addr ? ogs_strdup(an_n2_ipv6_addr->valuestring) : NULL, + an_n2_ipv4_addr && !cJSON_IsNull(an_n2_ipv4_addr) ? ogs_strdup(an_n2_ipv4_addr->valuestring) : NULL, + an_n2_ipv6_addr && !cJSON_IsNull(an_n2_ipv6_addr) ? ogs_strdup(an_n2_ipv6_addr->valuestring) : NULL, allowed_nssai ? allowed_nssai_local_nonprim : NULL, configured_nssai ? configured_nssaiList : NULL, rejected_nssai_in_plmn ? rejected_nssai_in_plmnList : NULL, @@ -634,6 +687,59 @@ OpenAPI_registration_context_container_t *OpenAPI_registration_context_container return registration_context_container_local_var; end: + if (ue_context_local_nonprim) { + OpenAPI_ue_context_free(ue_context_local_nonprim); + ue_context_local_nonprim = NULL; + } + if (ran_node_id_local_nonprim) { + OpenAPI_global_ran_node_id_free(ran_node_id_local_nonprim); + ran_node_id_local_nonprim = NULL; + } + if (user_location_local_nonprim) { + OpenAPI_user_location_free(user_location_local_nonprim); + user_location_local_nonprim = NULL; + } + if (allowed_nssai_local_nonprim) { + OpenAPI_allowed_nssai_free(allowed_nssai_local_nonprim); + allowed_nssai_local_nonprim = NULL; + } + if (configured_nssaiList) { + OpenAPI_list_for_each(configured_nssaiList, node) { + OpenAPI_configured_snssai_free(node->data); + } + OpenAPI_list_free(configured_nssaiList); + configured_nssaiList = NULL; + } + if (rejected_nssai_in_plmnList) { + OpenAPI_list_for_each(rejected_nssai_in_plmnList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(rejected_nssai_in_plmnList); + rejected_nssai_in_plmnList = NULL; + } + if (rejected_nssai_in_taList) { + OpenAPI_list_for_each(rejected_nssai_in_taList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(rejected_nssai_in_taList); + rejected_nssai_in_taList = NULL; + } + if (selected_plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(selected_plmn_id_local_nonprim); + selected_plmn_id_local_nonprim = NULL; + } + if (ce_mode_b_ind_local_nonprim) { + OpenAPI_ce_mode_b_ind_free(ce_mode_b_ind_local_nonprim); + ce_mode_b_ind_local_nonprim = NULL; + } + if (lte_m_ind_local_nonprim) { + OpenAPI_lte_m_ind_free(lte_m_ind_local_nonprim); + lte_m_ind_local_nonprim = NULL; + } + if (npn_access_info_local_nonprim) { + OpenAPI_npn_access_info_free(npn_access_info_local_nonprim); + npn_access_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/registration_data_sets.c b/lib/sbi/openapi/model/registration_data_sets.c index a1bffec3a..de79886d5 100644 --- a/lib/sbi/openapi/model/registration_data_sets.c +++ b/lib/sbi/openapi/model/registration_data_sets.c @@ -26,21 +26,38 @@ OpenAPI_registration_data_sets_t *OpenAPI_registration_data_sets_create( void OpenAPI_registration_data_sets_free(OpenAPI_registration_data_sets_t *registration_data_sets) { + OpenAPI_lnode_t *node = NULL; + if (NULL == registration_data_sets) { return; } - OpenAPI_lnode_t *node; - OpenAPI_amf3_gpp_access_registration_free(registration_data_sets->amf3_gpp); - OpenAPI_amf_non3_gpp_access_registration_free(registration_data_sets->amf_non3_gpp); - OpenAPI_smf_registration_info_free(registration_data_sets->smf_registration); - OpenAPI_smsf_registration_free(registration_data_sets->smsf3_gpp); - OpenAPI_smsf_registration_free(registration_data_sets->smsf_non3_gpp); + if (registration_data_sets->amf3_gpp) { + OpenAPI_amf3_gpp_access_registration_free(registration_data_sets->amf3_gpp); + registration_data_sets->amf3_gpp = NULL; + } + if (registration_data_sets->amf_non3_gpp) { + OpenAPI_amf_non3_gpp_access_registration_free(registration_data_sets->amf_non3_gpp); + registration_data_sets->amf_non3_gpp = NULL; + } + if (registration_data_sets->smf_registration) { + OpenAPI_smf_registration_info_free(registration_data_sets->smf_registration); + registration_data_sets->smf_registration = NULL; + } + if (registration_data_sets->smsf3_gpp) { + OpenAPI_smsf_registration_free(registration_data_sets->smsf3_gpp); + registration_data_sets->smsf3_gpp = NULL; + } + if (registration_data_sets->smsf_non3_gpp) { + OpenAPI_smsf_registration_free(registration_data_sets->smsf_non3_gpp); + registration_data_sets->smsf_non3_gpp = NULL; + } ogs_free(registration_data_sets); } cJSON *OpenAPI_registration_data_sets_convertToJSON(OpenAPI_registration_data_sets_t *registration_data_sets) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (registration_data_sets == NULL) { ogs_error("OpenAPI_registration_data_sets_convertToJSON() failed [RegistrationDataSets]"); @@ -120,37 +137,38 @@ end: OpenAPI_registration_data_sets_t *OpenAPI_registration_data_sets_parseFromJSON(cJSON *registration_data_setsJSON) { OpenAPI_registration_data_sets_t *registration_data_sets_local_var = NULL; - cJSON *amf3_gpp = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "amf3Gpp"); - + OpenAPI_lnode_t *node = NULL; + cJSON *amf3_gpp = NULL; OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_local_nonprim = NULL; + cJSON *amf_non3_gpp = NULL; + OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_local_nonprim = NULL; + cJSON *smf_registration = NULL; + OpenAPI_smf_registration_info_t *smf_registration_local_nonprim = NULL; + cJSON *smsf3_gpp = NULL; + OpenAPI_smsf_registration_t *smsf3_gpp_local_nonprim = NULL; + cJSON *smsf_non3_gpp = NULL; + OpenAPI_smsf_registration_t *smsf_non3_gpp_local_nonprim = NULL; + amf3_gpp = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "amf3Gpp"); if (amf3_gpp) { amf3_gpp_local_nonprim = OpenAPI_amf3_gpp_access_registration_parseFromJSON(amf3_gpp); } - cJSON *amf_non3_gpp = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "amfNon3Gpp"); - - OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_local_nonprim = NULL; + amf_non3_gpp = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "amfNon3Gpp"); if (amf_non3_gpp) { amf_non3_gpp_local_nonprim = OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(amf_non3_gpp); } - cJSON *smf_registration = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "smfRegistration"); - - OpenAPI_smf_registration_info_t *smf_registration_local_nonprim = NULL; + smf_registration = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "smfRegistration"); if (smf_registration) { smf_registration_local_nonprim = OpenAPI_smf_registration_info_parseFromJSON(smf_registration); } - cJSON *smsf3_gpp = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "smsf3Gpp"); - - OpenAPI_smsf_registration_t *smsf3_gpp_local_nonprim = NULL; + smsf3_gpp = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "smsf3Gpp"); if (smsf3_gpp) { smsf3_gpp_local_nonprim = OpenAPI_smsf_registration_parseFromJSON(smsf3_gpp); } - cJSON *smsf_non3_gpp = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "smsfNon3Gpp"); - - OpenAPI_smsf_registration_t *smsf_non3_gpp_local_nonprim = NULL; + smsf_non3_gpp = cJSON_GetObjectItemCaseSensitive(registration_data_setsJSON, "smsfNon3Gpp"); if (smsf_non3_gpp) { smsf_non3_gpp_local_nonprim = OpenAPI_smsf_registration_parseFromJSON(smsf_non3_gpp); } @@ -165,6 +183,26 @@ OpenAPI_registration_data_sets_t *OpenAPI_registration_data_sets_parseFromJSON(c return registration_data_sets_local_var; end: + if (amf3_gpp_local_nonprim) { + OpenAPI_amf3_gpp_access_registration_free(amf3_gpp_local_nonprim); + amf3_gpp_local_nonprim = NULL; + } + if (amf_non3_gpp_local_nonprim) { + OpenAPI_amf_non3_gpp_access_registration_free(amf_non3_gpp_local_nonprim); + amf_non3_gpp_local_nonprim = NULL; + } + if (smf_registration_local_nonprim) { + OpenAPI_smf_registration_info_free(smf_registration_local_nonprim); + smf_registration_local_nonprim = NULL; + } + if (smsf3_gpp_local_nonprim) { + OpenAPI_smsf_registration_free(smsf3_gpp_local_nonprim); + smsf3_gpp_local_nonprim = NULL; + } + if (smsf_non3_gpp_local_nonprim) { + OpenAPI_smsf_registration_free(smsf_non3_gpp_local_nonprim); + smsf_non3_gpp_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/registration_location_info.c b/lib/sbi/openapi/model/registration_location_info.c index 1e3e2103d..53cb9b00d 100644 --- a/lib/sbi/openapi/model/registration_location_info.c +++ b/lib/sbi/openapi/model/registration_location_info.c @@ -24,20 +24,34 @@ OpenAPI_registration_location_info_t *OpenAPI_registration_location_info_create( void OpenAPI_registration_location_info_free(OpenAPI_registration_location_info_t *registration_location_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == registration_location_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(registration_location_info->amf_instance_id); - OpenAPI_plmn_id_free(registration_location_info->plmn_id); - OpenAPI_vgmlc_address_free(registration_location_info->vgmlc_address); - OpenAPI_list_free(registration_location_info->access_type_list); + if (registration_location_info->amf_instance_id) { + ogs_free(registration_location_info->amf_instance_id); + registration_location_info->amf_instance_id = NULL; + } + if (registration_location_info->plmn_id) { + OpenAPI_plmn_id_free(registration_location_info->plmn_id); + registration_location_info->plmn_id = NULL; + } + if (registration_location_info->vgmlc_address) { + OpenAPI_vgmlc_address_free(registration_location_info->vgmlc_address); + registration_location_info->vgmlc_address = NULL; + } + if (registration_location_info->access_type_list) { + OpenAPI_list_free(registration_location_info->access_type_list); + registration_location_info->access_type_list = NULL; + } ogs_free(registration_location_info); } cJSON *OpenAPI_registration_location_info_convertToJSON(OpenAPI_registration_location_info_t *registration_location_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (registration_location_info == NULL) { ogs_error("OpenAPI_registration_location_info_convertToJSON() failed [RegistrationLocationInfo]"); @@ -45,6 +59,10 @@ cJSON *OpenAPI_registration_location_info_convertToJSON(OpenAPI_registration_loc } item = cJSON_CreateObject(); + if (!registration_location_info->amf_instance_id) { + ogs_error("OpenAPI_registration_location_info_convertToJSON() failed [amf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "amfInstanceId", registration_location_info->amf_instance_id) == NULL) { ogs_error("OpenAPI_registration_location_info_convertToJSON() failed [amf_instance_id]"); goto end; @@ -76,14 +94,17 @@ cJSON *OpenAPI_registration_location_info_convertToJSON(OpenAPI_registration_loc } } - cJSON *access_type_list = cJSON_AddArrayToObject(item, "accessTypeList"); - if (access_type_list == NULL) { + if (registration_location_info->access_type_list == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_registration_location_info_convertToJSON() failed [access_type_list]"); + return NULL; + } + cJSON *access_type_listList = cJSON_AddArrayToObject(item, "accessTypeList"); + if (access_type_listList == NULL) { ogs_error("OpenAPI_registration_location_info_convertToJSON() failed [access_type_list]"); goto end; } - OpenAPI_lnode_t *access_type_list_node; - OpenAPI_list_for_each(registration_location_info->access_type_list, access_type_list_node) { - if (cJSON_AddStringToObject(access_type_list, "", OpenAPI_access_type_ToString((intptr_t)access_type_list_node->data)) == NULL) { + OpenAPI_list_for_each(registration_location_info->access_type_list, node) { + if (cJSON_AddStringToObject(access_type_listList, "", OpenAPI_access_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_registration_location_info_convertToJSON() failed [access_type_list]"); goto end; } @@ -96,54 +117,54 @@ end: OpenAPI_registration_location_info_t *OpenAPI_registration_location_info_parseFromJSON(cJSON *registration_location_infoJSON) { OpenAPI_registration_location_info_t *registration_location_info_local_var = NULL; - cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(registration_location_infoJSON, "amfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *amf_instance_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *vgmlc_address = NULL; + OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL; + cJSON *access_type_list = NULL; + OpenAPI_list_t *access_type_listList = NULL; + amf_instance_id = cJSON_GetObjectItemCaseSensitive(registration_location_infoJSON, "amfInstanceId"); if (!amf_instance_id) { ogs_error("OpenAPI_registration_location_info_parseFromJSON() failed [amf_instance_id]"); goto end; } - if (!cJSON_IsString(amf_instance_id)) { ogs_error("OpenAPI_registration_location_info_parseFromJSON() failed [amf_instance_id]"); goto end; } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(registration_location_infoJSON, "plmnId"); - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(registration_location_infoJSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); } - cJSON *vgmlc_address = cJSON_GetObjectItemCaseSensitive(registration_location_infoJSON, "vgmlcAddress"); - - OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL; + vgmlc_address = cJSON_GetObjectItemCaseSensitive(registration_location_infoJSON, "vgmlcAddress"); if (vgmlc_address) { vgmlc_address_local_nonprim = OpenAPI_vgmlc_address_parseFromJSON(vgmlc_address); } - cJSON *access_type_list = cJSON_GetObjectItemCaseSensitive(registration_location_infoJSON, "accessTypeList"); + access_type_list = cJSON_GetObjectItemCaseSensitive(registration_location_infoJSON, "accessTypeList"); if (!access_type_list) { ogs_error("OpenAPI_registration_location_info_parseFromJSON() failed [access_type_list]"); goto end; } - - OpenAPI_list_t *access_type_listList; - cJSON *access_type_list_local_nonprimitive; - if (!cJSON_IsArray(access_type_list)) { - ogs_error("OpenAPI_registration_location_info_parseFromJSON() failed [access_type_list]"); - goto end; - } - - access_type_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(access_type_list_local_nonprimitive, access_type_list ) { - if (!cJSON_IsString(access_type_list_local_nonprimitive)){ + cJSON *access_type_list_local = NULL; + if (!cJSON_IsArray(access_type_list)) { ogs_error("OpenAPI_registration_location_info_parseFromJSON() failed [access_type_list]"); goto end; } - OpenAPI_list_add(access_type_listList, (void *)OpenAPI_access_type_FromString(access_type_list_local_nonprimitive->valuestring)); - } + access_type_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(access_type_list_local, access_type_list) { + if (!cJSON_IsString(access_type_list_local)) { + ogs_error("OpenAPI_registration_location_info_parseFromJSON() failed [access_type_list]"); + goto end; + } + OpenAPI_list_add(access_type_listList, (void *)OpenAPI_access_type_FromString(access_type_list_local->valuestring)); + } registration_location_info_local_var = OpenAPI_registration_location_info_create ( ogs_strdup(amf_instance_id->valuestring), @@ -154,6 +175,18 @@ OpenAPI_registration_location_info_t *OpenAPI_registration_location_info_parseFr return registration_location_info_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (vgmlc_address_local_nonprim) { + OpenAPI_vgmlc_address_free(vgmlc_address_local_nonprim); + vgmlc_address_local_nonprim = NULL; + } + if (access_type_listList) { + OpenAPI_list_free(access_type_listList); + access_type_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/release_data.c b/lib/sbi/openapi/model/release_data.c index bbe4162c8..8eaaa6358 100644 --- a/lib/sbi/openapi/model/release_data.c +++ b/lib/sbi/openapi/model/release_data.c @@ -40,31 +40,60 @@ OpenAPI_release_data_t *OpenAPI_release_data_create( void OpenAPI_release_data_free(OpenAPI_release_data_t *release_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == release_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ng_ap_cause_free(release_data->ng_ap_cause); - OpenAPI_user_location_free(release_data->ue_location); - ogs_free(release_data->ue_time_zone); - OpenAPI_user_location_free(release_data->add_ue_location); - OpenAPI_list_for_each(release_data->secondary_rat_usage_report, node) { - OpenAPI_secondary_rat_usage_report_free(node->data); + if (release_data->ng_ap_cause) { + OpenAPI_ng_ap_cause_free(release_data->ng_ap_cause); + release_data->ng_ap_cause = NULL; } - OpenAPI_list_free(release_data->secondary_rat_usage_report); - OpenAPI_list_for_each(release_data->secondary_rat_usage_info, node) { - OpenAPI_secondary_rat_usage_info_free(node->data); + if (release_data->ue_location) { + OpenAPI_user_location_free(release_data->ue_location); + release_data->ue_location = NULL; + } + if (release_data->ue_time_zone) { + ogs_free(release_data->ue_time_zone); + release_data->ue_time_zone = NULL; + } + if (release_data->add_ue_location) { + OpenAPI_user_location_free(release_data->add_ue_location); + release_data->add_ue_location = NULL; + } + if (release_data->secondary_rat_usage_report) { + OpenAPI_list_for_each(release_data->secondary_rat_usage_report, node) { + OpenAPI_secondary_rat_usage_report_free(node->data); + } + OpenAPI_list_free(release_data->secondary_rat_usage_report); + release_data->secondary_rat_usage_report = NULL; + } + if (release_data->secondary_rat_usage_info) { + OpenAPI_list_for_each(release_data->secondary_rat_usage_info, node) { + OpenAPI_secondary_rat_usage_info_free(node->data); + } + OpenAPI_list_free(release_data->secondary_rat_usage_info); + release_data->secondary_rat_usage_info = NULL; + } + if (release_data->n4_info) { + OpenAPI_n4_information_free(release_data->n4_info); + release_data->n4_info = NULL; + } + if (release_data->n4_info_ext1) { + OpenAPI_n4_information_free(release_data->n4_info_ext1); + release_data->n4_info_ext1 = NULL; + } + if (release_data->n4_info_ext2) { + OpenAPI_n4_information_free(release_data->n4_info_ext2); + release_data->n4_info_ext2 = NULL; } - OpenAPI_list_free(release_data->secondary_rat_usage_info); - OpenAPI_n4_information_free(release_data->n4_info); - OpenAPI_n4_information_free(release_data->n4_info_ext1); - OpenAPI_n4_information_free(release_data->n4_info_ext2); ogs_free(release_data); } cJSON *OpenAPI_release_data_convertToJSON(OpenAPI_release_data_t *release_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (release_data == NULL) { ogs_error("OpenAPI_release_data_convertToJSON() failed [ReleaseData]"); @@ -72,7 +101,7 @@ cJSON *OpenAPI_release_data_convertToJSON(OpenAPI_release_data_t *release_data) } item = cJSON_CreateObject(); - if (release_data->cause) { + if (release_data->cause != OpenAPI_cause_NULL) { if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(release_data->cause)) == NULL) { ogs_error("OpenAPI_release_data_convertToJSON() failed [cause]"); goto end; @@ -138,17 +167,13 @@ cJSON *OpenAPI_release_data_convertToJSON(OpenAPI_release_data_t *release_data) ogs_error("OpenAPI_release_data_convertToJSON() failed [secondary_rat_usage_report]"); goto end; } - - OpenAPI_lnode_t *secondary_rat_usage_report_node; - if (release_data->secondary_rat_usage_report) { - OpenAPI_list_for_each(release_data->secondary_rat_usage_report, secondary_rat_usage_report_node) { - cJSON *itemLocal = OpenAPI_secondary_rat_usage_report_convertToJSON(secondary_rat_usage_report_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_release_data_convertToJSON() failed [secondary_rat_usage_report]"); - goto end; - } - cJSON_AddItemToArray(secondary_rat_usage_reportList, itemLocal); + OpenAPI_list_for_each(release_data->secondary_rat_usage_report, node) { + cJSON *itemLocal = OpenAPI_secondary_rat_usage_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_release_data_convertToJSON() failed [secondary_rat_usage_report]"); + goto end; } + cJSON_AddItemToArray(secondary_rat_usage_reportList, itemLocal); } } @@ -158,17 +183,13 @@ cJSON *OpenAPI_release_data_convertToJSON(OpenAPI_release_data_t *release_data) ogs_error("OpenAPI_release_data_convertToJSON() failed [secondary_rat_usage_info]"); goto end; } - - OpenAPI_lnode_t *secondary_rat_usage_info_node; - if (release_data->secondary_rat_usage_info) { - OpenAPI_list_for_each(release_data->secondary_rat_usage_info, secondary_rat_usage_info_node) { - cJSON *itemLocal = OpenAPI_secondary_rat_usage_info_convertToJSON(secondary_rat_usage_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_release_data_convertToJSON() failed [secondary_rat_usage_info]"); - goto end; - } - cJSON_AddItemToArray(secondary_rat_usage_infoList, itemLocal); + OpenAPI_list_for_each(release_data->secondary_rat_usage_info, node) { + cJSON *itemLocal = OpenAPI_secondary_rat_usage_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_release_data_convertToJSON() failed [secondary_rat_usage_info]"); + goto end; } + cJSON_AddItemToArray(secondary_rat_usage_infoList, itemLocal); } } @@ -218,9 +239,28 @@ end: OpenAPI_release_data_t *OpenAPI_release_data_parseFromJSON(cJSON *release_dataJSON) { OpenAPI_release_data_t *release_data_local_var = NULL; - cJSON *cause = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "cause"); - - OpenAPI_cause_e causeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *cause = NULL; + OpenAPI_cause_e causeVariable = 0; + cJSON *ng_ap_cause = NULL; + OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + cJSON *_5g_mm_cause_value = NULL; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *add_ue_location = NULL; + OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + cJSON *secondary_rat_usage_report = NULL; + OpenAPI_list_t *secondary_rat_usage_reportList = NULL; + cJSON *secondary_rat_usage_info = NULL; + OpenAPI_list_t *secondary_rat_usage_infoList = NULL; + cJSON *n4_info = NULL; + OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + cJSON *n4_info_ext1 = NULL; + OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + cJSON *n4_info_ext2 = NULL; + OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + cause = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "cause"); if (cause) { if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_release_data_parseFromJSON() failed [cause]"); @@ -229,15 +269,12 @@ OpenAPI_release_data_t *OpenAPI_release_data_parseFromJSON(cJSON *release_dataJS causeVariable = OpenAPI_cause_FromString(cause->valuestring); } - cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "ngApCause"); - - OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + ng_ap_cause = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "ngApCause"); if (ng_ap_cause) { ng_ap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ng_ap_cause); } - cJSON *_5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "5gMmCauseValue"); - + _5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "5gMmCauseValue"); if (_5g_mm_cause_value) { if (!cJSON_IsNumber(_5g_mm_cause_value)) { ogs_error("OpenAPI_release_data_parseFromJSON() failed [_5g_mm_cause_value]"); @@ -245,104 +282,85 @@ OpenAPI_release_data_t *OpenAPI_release_data_parseFromJSON(cJSON *release_dataJS } } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_release_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *add_ue_location = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "addUeLocation"); - - OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + add_ue_location = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "addUeLocation"); if (add_ue_location) { add_ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(add_ue_location); } - cJSON *secondary_rat_usage_report = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "secondaryRatUsageReport"); - - OpenAPI_list_t *secondary_rat_usage_reportList; + secondary_rat_usage_report = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "secondaryRatUsageReport"); if (secondary_rat_usage_report) { - cJSON *secondary_rat_usage_report_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_usage_report)){ - ogs_error("OpenAPI_release_data_parseFromJSON() failed [secondary_rat_usage_report]"); - goto end; - } - - secondary_rat_usage_reportList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_usage_report_local_nonprimitive, secondary_rat_usage_report ) { - if (!cJSON_IsObject(secondary_rat_usage_report_local_nonprimitive)) { + cJSON *secondary_rat_usage_report_local = NULL; + if (!cJSON_IsArray(secondary_rat_usage_report)) { ogs_error("OpenAPI_release_data_parseFromJSON() failed [secondary_rat_usage_report]"); goto end; } - OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_reportItem = OpenAPI_secondary_rat_usage_report_parseFromJSON(secondary_rat_usage_report_local_nonprimitive); - if (!secondary_rat_usage_reportItem) { - ogs_error("No secondary_rat_usage_reportItem"); - OpenAPI_list_free(secondary_rat_usage_reportList); - goto end; + secondary_rat_usage_reportList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_usage_report_local, secondary_rat_usage_report) { + if (!cJSON_IsObject(secondary_rat_usage_report_local)) { + ogs_error("OpenAPI_release_data_parseFromJSON() failed [secondary_rat_usage_report]"); + goto end; + } + OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_reportItem = OpenAPI_secondary_rat_usage_report_parseFromJSON(secondary_rat_usage_report_local); + if (!secondary_rat_usage_reportItem) { + ogs_error("No secondary_rat_usage_reportItem"); + OpenAPI_list_free(secondary_rat_usage_reportList); + goto end; + } + OpenAPI_list_add(secondary_rat_usage_reportList, secondary_rat_usage_reportItem); } - - OpenAPI_list_add(secondary_rat_usage_reportList, secondary_rat_usage_reportItem); - } } - cJSON *secondary_rat_usage_info = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "secondaryRatUsageInfo"); - - OpenAPI_list_t *secondary_rat_usage_infoList; + secondary_rat_usage_info = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "secondaryRatUsageInfo"); if (secondary_rat_usage_info) { - cJSON *secondary_rat_usage_info_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_usage_info)){ - ogs_error("OpenAPI_release_data_parseFromJSON() failed [secondary_rat_usage_info]"); - goto end; - } - - secondary_rat_usage_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_usage_info_local_nonprimitive, secondary_rat_usage_info ) { - if (!cJSON_IsObject(secondary_rat_usage_info_local_nonprimitive)) { + cJSON *secondary_rat_usage_info_local = NULL; + if (!cJSON_IsArray(secondary_rat_usage_info)) { ogs_error("OpenAPI_release_data_parseFromJSON() failed [secondary_rat_usage_info]"); goto end; } - OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_infoItem = OpenAPI_secondary_rat_usage_info_parseFromJSON(secondary_rat_usage_info_local_nonprimitive); - if (!secondary_rat_usage_infoItem) { - ogs_error("No secondary_rat_usage_infoItem"); - OpenAPI_list_free(secondary_rat_usage_infoList); - goto end; + secondary_rat_usage_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_usage_info_local, secondary_rat_usage_info) { + if (!cJSON_IsObject(secondary_rat_usage_info_local)) { + ogs_error("OpenAPI_release_data_parseFromJSON() failed [secondary_rat_usage_info]"); + goto end; + } + OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_infoItem = OpenAPI_secondary_rat_usage_info_parseFromJSON(secondary_rat_usage_info_local); + if (!secondary_rat_usage_infoItem) { + ogs_error("No secondary_rat_usage_infoItem"); + OpenAPI_list_free(secondary_rat_usage_infoList); + goto end; + } + OpenAPI_list_add(secondary_rat_usage_infoList, secondary_rat_usage_infoItem); } - - OpenAPI_list_add(secondary_rat_usage_infoList, secondary_rat_usage_infoItem); - } } - cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "n4Info"); - - OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + n4_info = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "n4Info"); if (n4_info) { n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info); } - cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "n4InfoExt1"); - - OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "n4InfoExt1"); if (n4_info_ext1) { n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1); } - cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "n4InfoExt2"); - - OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "n4InfoExt2"); if (n4_info_ext2) { n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2); } @@ -353,7 +371,7 @@ OpenAPI_release_data_t *OpenAPI_release_data_parseFromJSON(cJSON *release_dataJS _5g_mm_cause_value ? true : false, _5g_mm_cause_value ? _5g_mm_cause_value->valuedouble : 0, ue_location ? ue_location_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, add_ue_location ? add_ue_location_local_nonprim : NULL, secondary_rat_usage_report ? secondary_rat_usage_reportList : NULL, secondary_rat_usage_info ? secondary_rat_usage_infoList : NULL, @@ -364,6 +382,44 @@ OpenAPI_release_data_t *OpenAPI_release_data_parseFromJSON(cJSON *release_dataJS return release_data_local_var; end: + if (ng_ap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ng_ap_cause_local_nonprim); + ng_ap_cause_local_nonprim = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } + if (add_ue_location_local_nonprim) { + OpenAPI_user_location_free(add_ue_location_local_nonprim); + add_ue_location_local_nonprim = NULL; + } + if (secondary_rat_usage_reportList) { + OpenAPI_list_for_each(secondary_rat_usage_reportList, node) { + OpenAPI_secondary_rat_usage_report_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_reportList); + secondary_rat_usage_reportList = NULL; + } + if (secondary_rat_usage_infoList) { + OpenAPI_list_for_each(secondary_rat_usage_infoList, node) { + OpenAPI_secondary_rat_usage_info_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_infoList); + secondary_rat_usage_infoList = NULL; + } + if (n4_info_local_nonprim) { + OpenAPI_n4_information_free(n4_info_local_nonprim); + n4_info_local_nonprim = NULL; + } + if (n4_info_ext1_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext1_local_nonprim); + n4_info_ext1_local_nonprim = NULL; + } + if (n4_info_ext2_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext2_local_nonprim); + n4_info_ext2_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/release_pdu_session_200_response.c b/lib/sbi/openapi/model/release_pdu_session_200_response.c new file mode 100644 index 000000000..898b74db2 --- /dev/null +++ b/lib/sbi/openapi/model/release_pdu_session_200_response.c @@ -0,0 +1,217 @@ + +#include +#include +#include +#include "release_pdu_session_200_response.h" + +OpenAPI_release_pdu_session_200_response_t *OpenAPI_release_pdu_session_200_response_create( + OpenAPI_released_data_t *json_data, + OpenAPI_binary_t* binary_data_n4_information, + OpenAPI_binary_t* binary_data_n4_information_ext1, + OpenAPI_binary_t* binary_data_n4_information_ext2 +) +{ + OpenAPI_release_pdu_session_200_response_t *release_pdu_session_200_response_local_var = ogs_malloc(sizeof(OpenAPI_release_pdu_session_200_response_t)); + ogs_assert(release_pdu_session_200_response_local_var); + + release_pdu_session_200_response_local_var->json_data = json_data; + release_pdu_session_200_response_local_var->binary_data_n4_information = binary_data_n4_information; + release_pdu_session_200_response_local_var->binary_data_n4_information_ext1 = binary_data_n4_information_ext1; + release_pdu_session_200_response_local_var->binary_data_n4_information_ext2 = binary_data_n4_information_ext2; + + return release_pdu_session_200_response_local_var; +} + +void OpenAPI_release_pdu_session_200_response_free(OpenAPI_release_pdu_session_200_response_t *release_pdu_session_200_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == release_pdu_session_200_response) { + return; + } + if (release_pdu_session_200_response->json_data) { + OpenAPI_released_data_free(release_pdu_session_200_response->json_data); + release_pdu_session_200_response->json_data = NULL; + } + if (release_pdu_session_200_response->binary_data_n4_information) { + ogs_free(release_pdu_session_200_response->binary_data_n4_information->data); + release_pdu_session_200_response->binary_data_n4_information = NULL; + } + if (release_pdu_session_200_response->binary_data_n4_information_ext1) { + ogs_free(release_pdu_session_200_response->binary_data_n4_information_ext1->data); + release_pdu_session_200_response->binary_data_n4_information_ext1 = NULL; + } + if (release_pdu_session_200_response->binary_data_n4_information_ext2) { + ogs_free(release_pdu_session_200_response->binary_data_n4_information_ext2->data); + release_pdu_session_200_response->binary_data_n4_information_ext2 = NULL; + } + ogs_free(release_pdu_session_200_response); +} + +cJSON *OpenAPI_release_pdu_session_200_response_convertToJSON(OpenAPI_release_pdu_session_200_response_t *release_pdu_session_200_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (release_pdu_session_200_response == NULL) { + ogs_error("OpenAPI_release_pdu_session_200_response_convertToJSON() failed [ReleasePduSession_200_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (release_pdu_session_200_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_released_data_convertToJSON(release_pdu_session_200_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_release_pdu_session_200_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_release_pdu_session_200_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (release_pdu_session_200_response->binary_data_n4_information) { + char* encoded_str_binary_data_n4_information = OpenAPI_base64encode(release_pdu_session_200_response->binary_data_n4_information->data,release_pdu_session_200_response->binary_data_n4_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN4Information", encoded_str_binary_data_n4_information) == NULL) { + ogs_error("OpenAPI_release_pdu_session_200_response_convertToJSON() failed [binary_data_n4_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information); + } + + if (release_pdu_session_200_response->binary_data_n4_information_ext1) { + char* encoded_str_binary_data_n4_information_ext1 = OpenAPI_base64encode(release_pdu_session_200_response->binary_data_n4_information_ext1->data,release_pdu_session_200_response->binary_data_n4_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN4InformationExt1", encoded_str_binary_data_n4_information_ext1) == NULL) { + ogs_error("OpenAPI_release_pdu_session_200_response_convertToJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information_ext1); + } + + if (release_pdu_session_200_response->binary_data_n4_information_ext2) { + char* encoded_str_binary_data_n4_information_ext2 = OpenAPI_base64encode(release_pdu_session_200_response->binary_data_n4_information_ext2->data,release_pdu_session_200_response->binary_data_n4_information_ext2->len); + if (cJSON_AddStringToObject(item, "binaryDataN4InformationExt2", encoded_str_binary_data_n4_information_ext2) == NULL) { + ogs_error("OpenAPI_release_pdu_session_200_response_convertToJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information_ext2); + } + +end: + return item; +} + +OpenAPI_release_pdu_session_200_response_t *OpenAPI_release_pdu_session_200_response_parseFromJSON(cJSON *release_pdu_session_200_responseJSON) +{ + OpenAPI_release_pdu_session_200_response_t *release_pdu_session_200_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_released_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n4_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information = NULL; + cJSON *binary_data_n4_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information_ext1 = NULL; + cJSON *binary_data_n4_information_ext2 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information_ext2 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(release_pdu_session_200_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_released_data_parseFromJSON(json_data); + } + + binary_data_n4_information = cJSON_GetObjectItemCaseSensitive(release_pdu_session_200_responseJSON, "binaryDataN4Information"); + if (binary_data_n4_information) { + decoded_str_binary_data_n4_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information); + if (!cJSON_IsString(binary_data_n4_information)) { + ogs_error("OpenAPI_release_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information]"); + goto end; + } + decoded_str_binary_data_n4_information->data = OpenAPI_base64decode(binary_data_n4_information->valuestring, strlen(binary_data_n4_information->valuestring), &decoded_str_binary_data_n4_information->len); + if (!decoded_str_binary_data_n4_information->data) { + ogs_error("OpenAPI_release_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information]"); + goto end; + } + } + + binary_data_n4_information_ext1 = cJSON_GetObjectItemCaseSensitive(release_pdu_session_200_responseJSON, "binaryDataN4InformationExt1"); + if (binary_data_n4_information_ext1) { + decoded_str_binary_data_n4_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information_ext1); + if (!cJSON_IsString(binary_data_n4_information_ext1)) { + ogs_error("OpenAPI_release_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + decoded_str_binary_data_n4_information_ext1->data = OpenAPI_base64decode(binary_data_n4_information_ext1->valuestring, strlen(binary_data_n4_information_ext1->valuestring), &decoded_str_binary_data_n4_information_ext1->len); + if (!decoded_str_binary_data_n4_information_ext1->data) { + ogs_error("OpenAPI_release_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + } + + binary_data_n4_information_ext2 = cJSON_GetObjectItemCaseSensitive(release_pdu_session_200_responseJSON, "binaryDataN4InformationExt2"); + if (binary_data_n4_information_ext2) { + decoded_str_binary_data_n4_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information_ext2); + if (!cJSON_IsString(binary_data_n4_information_ext2)) { + ogs_error("OpenAPI_release_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + decoded_str_binary_data_n4_information_ext2->data = OpenAPI_base64decode(binary_data_n4_information_ext2->valuestring, strlen(binary_data_n4_information_ext2->valuestring), &decoded_str_binary_data_n4_information_ext2->len); + if (!decoded_str_binary_data_n4_information_ext2->data) { + ogs_error("OpenAPI_release_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + } + + release_pdu_session_200_response_local_var = OpenAPI_release_pdu_session_200_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n4_information ? decoded_str_binary_data_n4_information : NULL, + binary_data_n4_information_ext1 ? decoded_str_binary_data_n4_information_ext1 : NULL, + binary_data_n4_information_ext2 ? decoded_str_binary_data_n4_information_ext2 : NULL + ); + + return release_pdu_session_200_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_released_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_release_pdu_session_200_response_t *OpenAPI_release_pdu_session_200_response_copy(OpenAPI_release_pdu_session_200_response_t *dst, OpenAPI_release_pdu_session_200_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_release_pdu_session_200_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_release_pdu_session_200_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_release_pdu_session_200_response_free(dst); + dst = OpenAPI_release_pdu_session_200_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/release_pdu_session_200_response.h b/lib/sbi/openapi/model/release_pdu_session_200_response.h new file mode 100644 index 000000000..12a68b1a9 --- /dev/null +++ b/lib/sbi/openapi/model/release_pdu_session_200_response.h @@ -0,0 +1,45 @@ +/* + * release_pdu_session_200_response.h + * + * + */ + +#ifndef _OpenAPI_release_pdu_session_200_response_H_ +#define _OpenAPI_release_pdu_session_200_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "released_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_release_pdu_session_200_response_s OpenAPI_release_pdu_session_200_response_t; +typedef struct OpenAPI_release_pdu_session_200_response_s { + struct OpenAPI_released_data_s *json_data; + OpenAPI_binary_t* binary_data_n4_information; + OpenAPI_binary_t* binary_data_n4_information_ext1; + OpenAPI_binary_t* binary_data_n4_information_ext2; +} OpenAPI_release_pdu_session_200_response_t; + +OpenAPI_release_pdu_session_200_response_t *OpenAPI_release_pdu_session_200_response_create( + OpenAPI_released_data_t *json_data, + OpenAPI_binary_t* binary_data_n4_information, + OpenAPI_binary_t* binary_data_n4_information_ext1, + OpenAPI_binary_t* binary_data_n4_information_ext2 +); +void OpenAPI_release_pdu_session_200_response_free(OpenAPI_release_pdu_session_200_response_t *release_pdu_session_200_response); +OpenAPI_release_pdu_session_200_response_t *OpenAPI_release_pdu_session_200_response_parseFromJSON(cJSON *release_pdu_session_200_responseJSON); +cJSON *OpenAPI_release_pdu_session_200_response_convertToJSON(OpenAPI_release_pdu_session_200_response_t *release_pdu_session_200_response); +OpenAPI_release_pdu_session_200_response_t *OpenAPI_release_pdu_session_200_response_copy(OpenAPI_release_pdu_session_200_response_t *dst, OpenAPI_release_pdu_session_200_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_release_pdu_session_200_response_H_ */ + diff --git a/lib/sbi/openapi/model/release_pdu_session_request.c b/lib/sbi/openapi/model/release_pdu_session_request.c new file mode 100644 index 000000000..2d0e0e3ce --- /dev/null +++ b/lib/sbi/openapi/model/release_pdu_session_request.c @@ -0,0 +1,217 @@ + +#include +#include +#include +#include "release_pdu_session_request.h" + +OpenAPI_release_pdu_session_request_t *OpenAPI_release_pdu_session_request_create( + OpenAPI_release_data_t *json_data, + OpenAPI_binary_t* binary_data_n4_information, + OpenAPI_binary_t* binary_data_n4_information_ext1, + OpenAPI_binary_t* binary_data_n4_information_ext2 +) +{ + OpenAPI_release_pdu_session_request_t *release_pdu_session_request_local_var = ogs_malloc(sizeof(OpenAPI_release_pdu_session_request_t)); + ogs_assert(release_pdu_session_request_local_var); + + release_pdu_session_request_local_var->json_data = json_data; + release_pdu_session_request_local_var->binary_data_n4_information = binary_data_n4_information; + release_pdu_session_request_local_var->binary_data_n4_information_ext1 = binary_data_n4_information_ext1; + release_pdu_session_request_local_var->binary_data_n4_information_ext2 = binary_data_n4_information_ext2; + + return release_pdu_session_request_local_var; +} + +void OpenAPI_release_pdu_session_request_free(OpenAPI_release_pdu_session_request_t *release_pdu_session_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == release_pdu_session_request) { + return; + } + if (release_pdu_session_request->json_data) { + OpenAPI_release_data_free(release_pdu_session_request->json_data); + release_pdu_session_request->json_data = NULL; + } + if (release_pdu_session_request->binary_data_n4_information) { + ogs_free(release_pdu_session_request->binary_data_n4_information->data); + release_pdu_session_request->binary_data_n4_information = NULL; + } + if (release_pdu_session_request->binary_data_n4_information_ext1) { + ogs_free(release_pdu_session_request->binary_data_n4_information_ext1->data); + release_pdu_session_request->binary_data_n4_information_ext1 = NULL; + } + if (release_pdu_session_request->binary_data_n4_information_ext2) { + ogs_free(release_pdu_session_request->binary_data_n4_information_ext2->data); + release_pdu_session_request->binary_data_n4_information_ext2 = NULL; + } + ogs_free(release_pdu_session_request); +} + +cJSON *OpenAPI_release_pdu_session_request_convertToJSON(OpenAPI_release_pdu_session_request_t *release_pdu_session_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (release_pdu_session_request == NULL) { + ogs_error("OpenAPI_release_pdu_session_request_convertToJSON() failed [ReleasePduSession_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (release_pdu_session_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_release_data_convertToJSON(release_pdu_session_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_release_pdu_session_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_release_pdu_session_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (release_pdu_session_request->binary_data_n4_information) { + char* encoded_str_binary_data_n4_information = OpenAPI_base64encode(release_pdu_session_request->binary_data_n4_information->data,release_pdu_session_request->binary_data_n4_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN4Information", encoded_str_binary_data_n4_information) == NULL) { + ogs_error("OpenAPI_release_pdu_session_request_convertToJSON() failed [binary_data_n4_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information); + } + + if (release_pdu_session_request->binary_data_n4_information_ext1) { + char* encoded_str_binary_data_n4_information_ext1 = OpenAPI_base64encode(release_pdu_session_request->binary_data_n4_information_ext1->data,release_pdu_session_request->binary_data_n4_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN4InformationExt1", encoded_str_binary_data_n4_information_ext1) == NULL) { + ogs_error("OpenAPI_release_pdu_session_request_convertToJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information_ext1); + } + + if (release_pdu_session_request->binary_data_n4_information_ext2) { + char* encoded_str_binary_data_n4_information_ext2 = OpenAPI_base64encode(release_pdu_session_request->binary_data_n4_information_ext2->data,release_pdu_session_request->binary_data_n4_information_ext2->len); + if (cJSON_AddStringToObject(item, "binaryDataN4InformationExt2", encoded_str_binary_data_n4_information_ext2) == NULL) { + ogs_error("OpenAPI_release_pdu_session_request_convertToJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information_ext2); + } + +end: + return item; +} + +OpenAPI_release_pdu_session_request_t *OpenAPI_release_pdu_session_request_parseFromJSON(cJSON *release_pdu_session_requestJSON) +{ + OpenAPI_release_pdu_session_request_t *release_pdu_session_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_release_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n4_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information = NULL; + cJSON *binary_data_n4_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information_ext1 = NULL; + cJSON *binary_data_n4_information_ext2 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information_ext2 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(release_pdu_session_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_release_data_parseFromJSON(json_data); + } + + binary_data_n4_information = cJSON_GetObjectItemCaseSensitive(release_pdu_session_requestJSON, "binaryDataN4Information"); + if (binary_data_n4_information) { + decoded_str_binary_data_n4_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information); + if (!cJSON_IsString(binary_data_n4_information)) { + ogs_error("OpenAPI_release_pdu_session_request_parseFromJSON() failed [binary_data_n4_information]"); + goto end; + } + decoded_str_binary_data_n4_information->data = OpenAPI_base64decode(binary_data_n4_information->valuestring, strlen(binary_data_n4_information->valuestring), &decoded_str_binary_data_n4_information->len); + if (!decoded_str_binary_data_n4_information->data) { + ogs_error("OpenAPI_release_pdu_session_request_parseFromJSON() failed [binary_data_n4_information]"); + goto end; + } + } + + binary_data_n4_information_ext1 = cJSON_GetObjectItemCaseSensitive(release_pdu_session_requestJSON, "binaryDataN4InformationExt1"); + if (binary_data_n4_information_ext1) { + decoded_str_binary_data_n4_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information_ext1); + if (!cJSON_IsString(binary_data_n4_information_ext1)) { + ogs_error("OpenAPI_release_pdu_session_request_parseFromJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + decoded_str_binary_data_n4_information_ext1->data = OpenAPI_base64decode(binary_data_n4_information_ext1->valuestring, strlen(binary_data_n4_information_ext1->valuestring), &decoded_str_binary_data_n4_information_ext1->len); + if (!decoded_str_binary_data_n4_information_ext1->data) { + ogs_error("OpenAPI_release_pdu_session_request_parseFromJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + } + + binary_data_n4_information_ext2 = cJSON_GetObjectItemCaseSensitive(release_pdu_session_requestJSON, "binaryDataN4InformationExt2"); + if (binary_data_n4_information_ext2) { + decoded_str_binary_data_n4_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information_ext2); + if (!cJSON_IsString(binary_data_n4_information_ext2)) { + ogs_error("OpenAPI_release_pdu_session_request_parseFromJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + decoded_str_binary_data_n4_information_ext2->data = OpenAPI_base64decode(binary_data_n4_information_ext2->valuestring, strlen(binary_data_n4_information_ext2->valuestring), &decoded_str_binary_data_n4_information_ext2->len); + if (!decoded_str_binary_data_n4_information_ext2->data) { + ogs_error("OpenAPI_release_pdu_session_request_parseFromJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + } + + release_pdu_session_request_local_var = OpenAPI_release_pdu_session_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n4_information ? decoded_str_binary_data_n4_information : NULL, + binary_data_n4_information_ext1 ? decoded_str_binary_data_n4_information_ext1 : NULL, + binary_data_n4_information_ext2 ? decoded_str_binary_data_n4_information_ext2 : NULL + ); + + return release_pdu_session_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_release_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_release_pdu_session_request_t *OpenAPI_release_pdu_session_request_copy(OpenAPI_release_pdu_session_request_t *dst, OpenAPI_release_pdu_session_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_release_pdu_session_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_release_pdu_session_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_release_pdu_session_request_free(dst); + dst = OpenAPI_release_pdu_session_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/release_pdu_session_request.h b/lib/sbi/openapi/model/release_pdu_session_request.h new file mode 100644 index 000000000..9227d4233 --- /dev/null +++ b/lib/sbi/openapi/model/release_pdu_session_request.h @@ -0,0 +1,45 @@ +/* + * release_pdu_session_request.h + * + * + */ + +#ifndef _OpenAPI_release_pdu_session_request_H_ +#define _OpenAPI_release_pdu_session_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "release_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_release_pdu_session_request_s OpenAPI_release_pdu_session_request_t; +typedef struct OpenAPI_release_pdu_session_request_s { + struct OpenAPI_release_data_s *json_data; + OpenAPI_binary_t* binary_data_n4_information; + OpenAPI_binary_t* binary_data_n4_information_ext1; + OpenAPI_binary_t* binary_data_n4_information_ext2; +} OpenAPI_release_pdu_session_request_t; + +OpenAPI_release_pdu_session_request_t *OpenAPI_release_pdu_session_request_create( + OpenAPI_release_data_t *json_data, + OpenAPI_binary_t* binary_data_n4_information, + OpenAPI_binary_t* binary_data_n4_information_ext1, + OpenAPI_binary_t* binary_data_n4_information_ext2 +); +void OpenAPI_release_pdu_session_request_free(OpenAPI_release_pdu_session_request_t *release_pdu_session_request); +OpenAPI_release_pdu_session_request_t *OpenAPI_release_pdu_session_request_parseFromJSON(cJSON *release_pdu_session_requestJSON); +cJSON *OpenAPI_release_pdu_session_request_convertToJSON(OpenAPI_release_pdu_session_request_t *release_pdu_session_request); +OpenAPI_release_pdu_session_request_t *OpenAPI_release_pdu_session_request_copy(OpenAPI_release_pdu_session_request_t *dst, OpenAPI_release_pdu_session_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_release_pdu_session_request_H_ */ + diff --git a/lib/sbi/openapi/model/release_sm_context_request.c b/lib/sbi/openapi/model/release_sm_context_request.c new file mode 100644 index 000000000..bbb3d8bf8 --- /dev/null +++ b/lib/sbi/openapi/model/release_sm_context_request.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "release_sm_context_request.h" + +OpenAPI_release_sm_context_request_t *OpenAPI_release_sm_context_request_create( + OpenAPI_sm_context_release_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_sm_information +) +{ + OpenAPI_release_sm_context_request_t *release_sm_context_request_local_var = ogs_malloc(sizeof(OpenAPI_release_sm_context_request_t)); + ogs_assert(release_sm_context_request_local_var); + + release_sm_context_request_local_var->json_data = json_data; + release_sm_context_request_local_var->binary_data_n2_sm_information = binary_data_n2_sm_information; + + return release_sm_context_request_local_var; +} + +void OpenAPI_release_sm_context_request_free(OpenAPI_release_sm_context_request_t *release_sm_context_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == release_sm_context_request) { + return; + } + if (release_sm_context_request->json_data) { + OpenAPI_sm_context_release_data_free(release_sm_context_request->json_data); + release_sm_context_request->json_data = NULL; + } + if (release_sm_context_request->binary_data_n2_sm_information) { + ogs_free(release_sm_context_request->binary_data_n2_sm_information->data); + release_sm_context_request->binary_data_n2_sm_information = NULL; + } + ogs_free(release_sm_context_request); +} + +cJSON *OpenAPI_release_sm_context_request_convertToJSON(OpenAPI_release_sm_context_request_t *release_sm_context_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (release_sm_context_request == NULL) { + ogs_error("OpenAPI_release_sm_context_request_convertToJSON() failed [ReleaseSmContext_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (release_sm_context_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_sm_context_release_data_convertToJSON(release_sm_context_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_release_sm_context_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_release_sm_context_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (release_sm_context_request->binary_data_n2_sm_information) { + char* encoded_str_binary_data_n2_sm_information = OpenAPI_base64encode(release_sm_context_request->binary_data_n2_sm_information->data,release_sm_context_request->binary_data_n2_sm_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2SmInformation", encoded_str_binary_data_n2_sm_information) == NULL) { + ogs_error("OpenAPI_release_sm_context_request_convertToJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_sm_information); + } + +end: + return item; +} + +OpenAPI_release_sm_context_request_t *OpenAPI_release_sm_context_request_parseFromJSON(cJSON *release_sm_context_requestJSON) +{ + OpenAPI_release_sm_context_request_t *release_sm_context_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_sm_context_release_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n2_sm_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_sm_information = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(release_sm_context_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_sm_context_release_data_parseFromJSON(json_data); + } + + binary_data_n2_sm_information = cJSON_GetObjectItemCaseSensitive(release_sm_context_requestJSON, "binaryDataN2SmInformation"); + if (binary_data_n2_sm_information) { + decoded_str_binary_data_n2_sm_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_sm_information); + if (!cJSON_IsString(binary_data_n2_sm_information)) { + ogs_error("OpenAPI_release_sm_context_request_parseFromJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + decoded_str_binary_data_n2_sm_information->data = OpenAPI_base64decode(binary_data_n2_sm_information->valuestring, strlen(binary_data_n2_sm_information->valuestring), &decoded_str_binary_data_n2_sm_information->len); + if (!decoded_str_binary_data_n2_sm_information->data) { + ogs_error("OpenAPI_release_sm_context_request_parseFromJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + } + + release_sm_context_request_local_var = OpenAPI_release_sm_context_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n2_sm_information ? decoded_str_binary_data_n2_sm_information : NULL + ); + + return release_sm_context_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_sm_context_release_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_release_sm_context_request_t *OpenAPI_release_sm_context_request_copy(OpenAPI_release_sm_context_request_t *dst, OpenAPI_release_sm_context_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_release_sm_context_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_release_sm_context_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_release_sm_context_request_free(dst); + dst = OpenAPI_release_sm_context_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/release_sm_context_request.h b/lib/sbi/openapi/model/release_sm_context_request.h new file mode 100644 index 000000000..1084427ae --- /dev/null +++ b/lib/sbi/openapi/model/release_sm_context_request.h @@ -0,0 +1,41 @@ +/* + * release_sm_context_request.h + * + * + */ + +#ifndef _OpenAPI_release_sm_context_request_H_ +#define _OpenAPI_release_sm_context_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sm_context_release_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_release_sm_context_request_s OpenAPI_release_sm_context_request_t; +typedef struct OpenAPI_release_sm_context_request_s { + struct OpenAPI_sm_context_release_data_s *json_data; + OpenAPI_binary_t* binary_data_n2_sm_information; +} OpenAPI_release_sm_context_request_t; + +OpenAPI_release_sm_context_request_t *OpenAPI_release_sm_context_request_create( + OpenAPI_sm_context_release_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_sm_information +); +void OpenAPI_release_sm_context_request_free(OpenAPI_release_sm_context_request_t *release_sm_context_request); +OpenAPI_release_sm_context_request_t *OpenAPI_release_sm_context_request_parseFromJSON(cJSON *release_sm_context_requestJSON); +cJSON *OpenAPI_release_sm_context_request_convertToJSON(OpenAPI_release_sm_context_request_t *release_sm_context_request); +OpenAPI_release_sm_context_request_t *OpenAPI_release_sm_context_request_copy(OpenAPI_release_sm_context_request_t *dst, OpenAPI_release_sm_context_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_release_sm_context_request_H_ */ + diff --git a/lib/sbi/openapi/model/released_data.c b/lib/sbi/openapi/model/released_data.c index b0c65568c..b2fbb4df7 100644 --- a/lib/sbi/openapi/model/released_data.c +++ b/lib/sbi/openapi/model/released_data.c @@ -26,21 +26,38 @@ OpenAPI_released_data_t *OpenAPI_released_data_create( void OpenAPI_released_data_free(OpenAPI_released_data_t *released_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == released_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_small_data_rate_status_free(released_data->small_data_rate_status); - OpenAPI_apn_rate_status_free(released_data->apn_rate_status); - OpenAPI_n4_information_free(released_data->n4_info); - OpenAPI_n4_information_free(released_data->n4_info_ext1); - OpenAPI_n4_information_free(released_data->n4_info_ext2); + if (released_data->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(released_data->small_data_rate_status); + released_data->small_data_rate_status = NULL; + } + if (released_data->apn_rate_status) { + OpenAPI_apn_rate_status_free(released_data->apn_rate_status); + released_data->apn_rate_status = NULL; + } + if (released_data->n4_info) { + OpenAPI_n4_information_free(released_data->n4_info); + released_data->n4_info = NULL; + } + if (released_data->n4_info_ext1) { + OpenAPI_n4_information_free(released_data->n4_info_ext1); + released_data->n4_info_ext1 = NULL; + } + if (released_data->n4_info_ext2) { + OpenAPI_n4_information_free(released_data->n4_info_ext2); + released_data->n4_info_ext2 = NULL; + } ogs_free(released_data); } cJSON *OpenAPI_released_data_convertToJSON(OpenAPI_released_data_t *released_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (released_data == NULL) { ogs_error("OpenAPI_released_data_convertToJSON() failed [ReleasedData]"); @@ -120,37 +137,38 @@ end: OpenAPI_released_data_t *OpenAPI_released_data_parseFromJSON(cJSON *released_dataJSON) { OpenAPI_released_data_t *released_data_local_var = NULL; - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "smallDataRateStatus"); - + OpenAPI_lnode_t *node = NULL; + cJSON *small_data_rate_status = NULL; OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + cJSON *apn_rate_status = NULL; + OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + cJSON *n4_info = NULL; + OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + cJSON *n4_info_ext1 = NULL; + OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + cJSON *n4_info_ext2 = NULL; + OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "smallDataRateStatus"); if (small_data_rate_status) { small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); } - cJSON *apn_rate_status = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "apnRateStatus"); - - OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + apn_rate_status = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "apnRateStatus"); if (apn_rate_status) { apn_rate_status_local_nonprim = OpenAPI_apn_rate_status_parseFromJSON(apn_rate_status); } - cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4Info"); - - OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + n4_info = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4Info"); if (n4_info) { n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info); } - cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4InfoExt1"); - - OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4InfoExt1"); if (n4_info_ext1) { n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1); } - cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4InfoExt2"); - - OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4InfoExt2"); if (n4_info_ext2) { n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2); } @@ -165,6 +183,26 @@ OpenAPI_released_data_t *OpenAPI_released_data_parseFromJSON(cJSON *released_dat return released_data_local_var; end: + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } + if (apn_rate_status_local_nonprim) { + OpenAPI_apn_rate_status_free(apn_rate_status_local_nonprim); + apn_rate_status_local_nonprim = NULL; + } + if (n4_info_local_nonprim) { + OpenAPI_n4_information_free(n4_info_local_nonprim); + n4_info_local_nonprim = NULL; + } + if (n4_info_ext1_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext1_local_nonprim); + n4_info_ext1_local_nonprim = NULL; + } + if (n4_info_ext2_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext2_local_nonprim); + n4_info_ext2_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/relocate_ue_context_request.c b/lib/sbi/openapi/model/relocate_ue_context_request.c new file mode 100644 index 000000000..a71e23211 --- /dev/null +++ b/lib/sbi/openapi/model/relocate_ue_context_request.c @@ -0,0 +1,712 @@ + +#include +#include +#include +#include "relocate_ue_context_request.h" + +OpenAPI_relocate_ue_context_request_t *OpenAPI_relocate_ue_context_request_create( + OpenAPI_ue_context_relocate_data_t *json_data, + OpenAPI_binary_t* binary_data_gtpc_message, + OpenAPI_binary_t* binary_data_n2_information, + OpenAPI_binary_t* binary_data_n2_information_ext1, + OpenAPI_binary_t* binary_data_n2_information_ext2, + OpenAPI_binary_t* binary_data_n2_information_ext3, + OpenAPI_binary_t* binary_data_n2_information_ext4, + OpenAPI_binary_t* binary_data_n2_information_ext5, + OpenAPI_binary_t* binary_data_n2_information_ext6, + OpenAPI_binary_t* binary_data_n2_information_ext7, + OpenAPI_binary_t* binary_data_n2_information_ext8, + OpenAPI_binary_t* binary_data_n2_information_ext9, + OpenAPI_binary_t* binary_data_n2_information_ext10, + OpenAPI_binary_t* binary_data_n2_information_ext11, + OpenAPI_binary_t* binary_data_n2_information_ext12, + OpenAPI_binary_t* binary_data_n2_information_ext13, + OpenAPI_binary_t* binary_data_n2_information_ext14, + OpenAPI_binary_t* binary_data_n2_information_ext15, + OpenAPI_binary_t* binary_data_n2_information_ext16 +) +{ + OpenAPI_relocate_ue_context_request_t *relocate_ue_context_request_local_var = ogs_malloc(sizeof(OpenAPI_relocate_ue_context_request_t)); + ogs_assert(relocate_ue_context_request_local_var); + + relocate_ue_context_request_local_var->json_data = json_data; + relocate_ue_context_request_local_var->binary_data_gtpc_message = binary_data_gtpc_message; + relocate_ue_context_request_local_var->binary_data_n2_information = binary_data_n2_information; + relocate_ue_context_request_local_var->binary_data_n2_information_ext1 = binary_data_n2_information_ext1; + relocate_ue_context_request_local_var->binary_data_n2_information_ext2 = binary_data_n2_information_ext2; + relocate_ue_context_request_local_var->binary_data_n2_information_ext3 = binary_data_n2_information_ext3; + relocate_ue_context_request_local_var->binary_data_n2_information_ext4 = binary_data_n2_information_ext4; + relocate_ue_context_request_local_var->binary_data_n2_information_ext5 = binary_data_n2_information_ext5; + relocate_ue_context_request_local_var->binary_data_n2_information_ext6 = binary_data_n2_information_ext6; + relocate_ue_context_request_local_var->binary_data_n2_information_ext7 = binary_data_n2_information_ext7; + relocate_ue_context_request_local_var->binary_data_n2_information_ext8 = binary_data_n2_information_ext8; + relocate_ue_context_request_local_var->binary_data_n2_information_ext9 = binary_data_n2_information_ext9; + relocate_ue_context_request_local_var->binary_data_n2_information_ext10 = binary_data_n2_information_ext10; + relocate_ue_context_request_local_var->binary_data_n2_information_ext11 = binary_data_n2_information_ext11; + relocate_ue_context_request_local_var->binary_data_n2_information_ext12 = binary_data_n2_information_ext12; + relocate_ue_context_request_local_var->binary_data_n2_information_ext13 = binary_data_n2_information_ext13; + relocate_ue_context_request_local_var->binary_data_n2_information_ext14 = binary_data_n2_information_ext14; + relocate_ue_context_request_local_var->binary_data_n2_information_ext15 = binary_data_n2_information_ext15; + relocate_ue_context_request_local_var->binary_data_n2_information_ext16 = binary_data_n2_information_ext16; + + return relocate_ue_context_request_local_var; +} + +void OpenAPI_relocate_ue_context_request_free(OpenAPI_relocate_ue_context_request_t *relocate_ue_context_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == relocate_ue_context_request) { + return; + } + if (relocate_ue_context_request->json_data) { + OpenAPI_ue_context_relocate_data_free(relocate_ue_context_request->json_data); + relocate_ue_context_request->json_data = NULL; + } + if (relocate_ue_context_request->binary_data_gtpc_message) { + ogs_free(relocate_ue_context_request->binary_data_gtpc_message->data); + relocate_ue_context_request->binary_data_gtpc_message = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information) { + ogs_free(relocate_ue_context_request->binary_data_n2_information->data); + relocate_ue_context_request->binary_data_n2_information = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext1) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext1->data); + relocate_ue_context_request->binary_data_n2_information_ext1 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext2) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext2->data); + relocate_ue_context_request->binary_data_n2_information_ext2 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext3) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext3->data); + relocate_ue_context_request->binary_data_n2_information_ext3 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext4) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext4->data); + relocate_ue_context_request->binary_data_n2_information_ext4 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext5) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext5->data); + relocate_ue_context_request->binary_data_n2_information_ext5 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext6) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext6->data); + relocate_ue_context_request->binary_data_n2_information_ext6 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext7) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext7->data); + relocate_ue_context_request->binary_data_n2_information_ext7 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext8) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext8->data); + relocate_ue_context_request->binary_data_n2_information_ext8 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext9) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext9->data); + relocate_ue_context_request->binary_data_n2_information_ext9 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext10) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext10->data); + relocate_ue_context_request->binary_data_n2_information_ext10 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext11) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext11->data); + relocate_ue_context_request->binary_data_n2_information_ext11 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext12) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext12->data); + relocate_ue_context_request->binary_data_n2_information_ext12 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext13) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext13->data); + relocate_ue_context_request->binary_data_n2_information_ext13 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext14) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext14->data); + relocate_ue_context_request->binary_data_n2_information_ext14 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext15) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext15->data); + relocate_ue_context_request->binary_data_n2_information_ext15 = NULL; + } + if (relocate_ue_context_request->binary_data_n2_information_ext16) { + ogs_free(relocate_ue_context_request->binary_data_n2_information_ext16->data); + relocate_ue_context_request->binary_data_n2_information_ext16 = NULL; + } + ogs_free(relocate_ue_context_request); +} + +cJSON *OpenAPI_relocate_ue_context_request_convertToJSON(OpenAPI_relocate_ue_context_request_t *relocate_ue_context_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (relocate_ue_context_request == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [RelocateUEContext_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (relocate_ue_context_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_ue_context_relocate_data_convertToJSON(relocate_ue_context_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (relocate_ue_context_request->binary_data_gtpc_message) { + char* encoded_str_binary_data_gtpc_message = OpenAPI_base64encode(relocate_ue_context_request->binary_data_gtpc_message->data,relocate_ue_context_request->binary_data_gtpc_message->len); + if (cJSON_AddStringToObject(item, "binaryDataGtpcMessage", encoded_str_binary_data_gtpc_message) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_gtpc_message]"); + goto end; + } + ogs_free(encoded_str_binary_data_gtpc_message); + } + + if (relocate_ue_context_request->binary_data_n2_information) { + char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information->data,relocate_ue_context_request->binary_data_n2_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext1) { + char* encoded_str_binary_data_n2_information_ext1 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext1->data,relocate_ue_context_request->binary_data_n2_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt1", encoded_str_binary_data_n2_information_ext1) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext1); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext2) { + char* encoded_str_binary_data_n2_information_ext2 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext2->data,relocate_ue_context_request->binary_data_n2_information_ext2->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt2", encoded_str_binary_data_n2_information_ext2) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext2); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext3) { + char* encoded_str_binary_data_n2_information_ext3 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext3->data,relocate_ue_context_request->binary_data_n2_information_ext3->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt3", encoded_str_binary_data_n2_information_ext3) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext3); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext4) { + char* encoded_str_binary_data_n2_information_ext4 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext4->data,relocate_ue_context_request->binary_data_n2_information_ext4->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt4", encoded_str_binary_data_n2_information_ext4) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext4); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext5) { + char* encoded_str_binary_data_n2_information_ext5 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext5->data,relocate_ue_context_request->binary_data_n2_information_ext5->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt5", encoded_str_binary_data_n2_information_ext5) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext5); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext6) { + char* encoded_str_binary_data_n2_information_ext6 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext6->data,relocate_ue_context_request->binary_data_n2_information_ext6->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt6", encoded_str_binary_data_n2_information_ext6) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext6); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext7) { + char* encoded_str_binary_data_n2_information_ext7 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext7->data,relocate_ue_context_request->binary_data_n2_information_ext7->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt7", encoded_str_binary_data_n2_information_ext7) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext7); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext8) { + char* encoded_str_binary_data_n2_information_ext8 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext8->data,relocate_ue_context_request->binary_data_n2_information_ext8->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt8", encoded_str_binary_data_n2_information_ext8) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext8); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext9) { + char* encoded_str_binary_data_n2_information_ext9 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext9->data,relocate_ue_context_request->binary_data_n2_information_ext9->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt9", encoded_str_binary_data_n2_information_ext9) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext9); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext10) { + char* encoded_str_binary_data_n2_information_ext10 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext10->data,relocate_ue_context_request->binary_data_n2_information_ext10->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt10", encoded_str_binary_data_n2_information_ext10) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext10); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext11) { + char* encoded_str_binary_data_n2_information_ext11 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext11->data,relocate_ue_context_request->binary_data_n2_information_ext11->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt11", encoded_str_binary_data_n2_information_ext11) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext11); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext12) { + char* encoded_str_binary_data_n2_information_ext12 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext12->data,relocate_ue_context_request->binary_data_n2_information_ext12->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt12", encoded_str_binary_data_n2_information_ext12) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext12); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext13) { + char* encoded_str_binary_data_n2_information_ext13 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext13->data,relocate_ue_context_request->binary_data_n2_information_ext13->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt13", encoded_str_binary_data_n2_information_ext13) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext13); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext14) { + char* encoded_str_binary_data_n2_information_ext14 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext14->data,relocate_ue_context_request->binary_data_n2_information_ext14->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt14", encoded_str_binary_data_n2_information_ext14) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext14); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext15) { + char* encoded_str_binary_data_n2_information_ext15 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext15->data,relocate_ue_context_request->binary_data_n2_information_ext15->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt15", encoded_str_binary_data_n2_information_ext15) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext15); + } + + if (relocate_ue_context_request->binary_data_n2_information_ext16) { + char* encoded_str_binary_data_n2_information_ext16 = OpenAPI_base64encode(relocate_ue_context_request->binary_data_n2_information_ext16->data,relocate_ue_context_request->binary_data_n2_information_ext16->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt16", encoded_str_binary_data_n2_information_ext16) == NULL) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed [binary_data_n2_information_ext16]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext16); + } + +end: + return item; +} + +OpenAPI_relocate_ue_context_request_t *OpenAPI_relocate_ue_context_request_parseFromJSON(cJSON *relocate_ue_context_requestJSON) +{ + OpenAPI_relocate_ue_context_request_t *relocate_ue_context_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_ue_context_relocate_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_gtpc_message = NULL; + OpenAPI_binary_t *decoded_str_binary_data_gtpc_message = NULL; + cJSON *binary_data_n2_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information = NULL; + cJSON *binary_data_n2_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext1 = NULL; + cJSON *binary_data_n2_information_ext2 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext2 = NULL; + cJSON *binary_data_n2_information_ext3 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext3 = NULL; + cJSON *binary_data_n2_information_ext4 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext4 = NULL; + cJSON *binary_data_n2_information_ext5 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext5 = NULL; + cJSON *binary_data_n2_information_ext6 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext6 = NULL; + cJSON *binary_data_n2_information_ext7 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext7 = NULL; + cJSON *binary_data_n2_information_ext8 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext8 = NULL; + cJSON *binary_data_n2_information_ext9 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext9 = NULL; + cJSON *binary_data_n2_information_ext10 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext10 = NULL; + cJSON *binary_data_n2_information_ext11 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext11 = NULL; + cJSON *binary_data_n2_information_ext12 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext12 = NULL; + cJSON *binary_data_n2_information_ext13 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext13 = NULL; + cJSON *binary_data_n2_information_ext14 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext14 = NULL; + cJSON *binary_data_n2_information_ext15 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext15 = NULL; + cJSON *binary_data_n2_information_ext16 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext16 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_ue_context_relocate_data_parseFromJSON(json_data); + } + + binary_data_gtpc_message = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataGtpcMessage"); + if (binary_data_gtpc_message) { + decoded_str_binary_data_gtpc_message = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_gtpc_message); + if (!cJSON_IsString(binary_data_gtpc_message)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_gtpc_message]"); + goto end; + } + decoded_str_binary_data_gtpc_message->data = OpenAPI_base64decode(binary_data_gtpc_message->valuestring, strlen(binary_data_gtpc_message->valuestring), &decoded_str_binary_data_gtpc_message->len); + if (!decoded_str_binary_data_gtpc_message->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_gtpc_message]"); + goto end; + } + } + + binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2Information"); + if (binary_data_n2_information) { + decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information); + if (!cJSON_IsString(binary_data_n2_information)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); + if (!decoded_str_binary_data_n2_information->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + } + + binary_data_n2_information_ext1 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt1"); + if (binary_data_n2_information_ext1) { + decoded_str_binary_data_n2_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext1); + if (!cJSON_IsString(binary_data_n2_information_ext1)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + decoded_str_binary_data_n2_information_ext1->data = OpenAPI_base64decode(binary_data_n2_information_ext1->valuestring, strlen(binary_data_n2_information_ext1->valuestring), &decoded_str_binary_data_n2_information_ext1->len); + if (!decoded_str_binary_data_n2_information_ext1->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + } + + binary_data_n2_information_ext2 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt2"); + if (binary_data_n2_information_ext2) { + decoded_str_binary_data_n2_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext2); + if (!cJSON_IsString(binary_data_n2_information_ext2)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + decoded_str_binary_data_n2_information_ext2->data = OpenAPI_base64decode(binary_data_n2_information_ext2->valuestring, strlen(binary_data_n2_information_ext2->valuestring), &decoded_str_binary_data_n2_information_ext2->len); + if (!decoded_str_binary_data_n2_information_ext2->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext2]"); + goto end; + } + } + + binary_data_n2_information_ext3 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt3"); + if (binary_data_n2_information_ext3) { + decoded_str_binary_data_n2_information_ext3 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext3); + if (!cJSON_IsString(binary_data_n2_information_ext3)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + decoded_str_binary_data_n2_information_ext3->data = OpenAPI_base64decode(binary_data_n2_information_ext3->valuestring, strlen(binary_data_n2_information_ext3->valuestring), &decoded_str_binary_data_n2_information_ext3->len); + if (!decoded_str_binary_data_n2_information_ext3->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext3]"); + goto end; + } + } + + binary_data_n2_information_ext4 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt4"); + if (binary_data_n2_information_ext4) { + decoded_str_binary_data_n2_information_ext4 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext4); + if (!cJSON_IsString(binary_data_n2_information_ext4)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + decoded_str_binary_data_n2_information_ext4->data = OpenAPI_base64decode(binary_data_n2_information_ext4->valuestring, strlen(binary_data_n2_information_ext4->valuestring), &decoded_str_binary_data_n2_information_ext4->len); + if (!decoded_str_binary_data_n2_information_ext4->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext4]"); + goto end; + } + } + + binary_data_n2_information_ext5 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt5"); + if (binary_data_n2_information_ext5) { + decoded_str_binary_data_n2_information_ext5 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext5); + if (!cJSON_IsString(binary_data_n2_information_ext5)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + decoded_str_binary_data_n2_information_ext5->data = OpenAPI_base64decode(binary_data_n2_information_ext5->valuestring, strlen(binary_data_n2_information_ext5->valuestring), &decoded_str_binary_data_n2_information_ext5->len); + if (!decoded_str_binary_data_n2_information_ext5->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext5]"); + goto end; + } + } + + binary_data_n2_information_ext6 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt6"); + if (binary_data_n2_information_ext6) { + decoded_str_binary_data_n2_information_ext6 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext6); + if (!cJSON_IsString(binary_data_n2_information_ext6)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + decoded_str_binary_data_n2_information_ext6->data = OpenAPI_base64decode(binary_data_n2_information_ext6->valuestring, strlen(binary_data_n2_information_ext6->valuestring), &decoded_str_binary_data_n2_information_ext6->len); + if (!decoded_str_binary_data_n2_information_ext6->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext6]"); + goto end; + } + } + + binary_data_n2_information_ext7 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt7"); + if (binary_data_n2_information_ext7) { + decoded_str_binary_data_n2_information_ext7 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext7); + if (!cJSON_IsString(binary_data_n2_information_ext7)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + decoded_str_binary_data_n2_information_ext7->data = OpenAPI_base64decode(binary_data_n2_information_ext7->valuestring, strlen(binary_data_n2_information_ext7->valuestring), &decoded_str_binary_data_n2_information_ext7->len); + if (!decoded_str_binary_data_n2_information_ext7->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext7]"); + goto end; + } + } + + binary_data_n2_information_ext8 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt8"); + if (binary_data_n2_information_ext8) { + decoded_str_binary_data_n2_information_ext8 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext8); + if (!cJSON_IsString(binary_data_n2_information_ext8)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + decoded_str_binary_data_n2_information_ext8->data = OpenAPI_base64decode(binary_data_n2_information_ext8->valuestring, strlen(binary_data_n2_information_ext8->valuestring), &decoded_str_binary_data_n2_information_ext8->len); + if (!decoded_str_binary_data_n2_information_ext8->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext8]"); + goto end; + } + } + + binary_data_n2_information_ext9 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt9"); + if (binary_data_n2_information_ext9) { + decoded_str_binary_data_n2_information_ext9 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext9); + if (!cJSON_IsString(binary_data_n2_information_ext9)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + decoded_str_binary_data_n2_information_ext9->data = OpenAPI_base64decode(binary_data_n2_information_ext9->valuestring, strlen(binary_data_n2_information_ext9->valuestring), &decoded_str_binary_data_n2_information_ext9->len); + if (!decoded_str_binary_data_n2_information_ext9->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext9]"); + goto end; + } + } + + binary_data_n2_information_ext10 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt10"); + if (binary_data_n2_information_ext10) { + decoded_str_binary_data_n2_information_ext10 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext10); + if (!cJSON_IsString(binary_data_n2_information_ext10)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + decoded_str_binary_data_n2_information_ext10->data = OpenAPI_base64decode(binary_data_n2_information_ext10->valuestring, strlen(binary_data_n2_information_ext10->valuestring), &decoded_str_binary_data_n2_information_ext10->len); + if (!decoded_str_binary_data_n2_information_ext10->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext10]"); + goto end; + } + } + + binary_data_n2_information_ext11 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt11"); + if (binary_data_n2_information_ext11) { + decoded_str_binary_data_n2_information_ext11 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext11); + if (!cJSON_IsString(binary_data_n2_information_ext11)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + decoded_str_binary_data_n2_information_ext11->data = OpenAPI_base64decode(binary_data_n2_information_ext11->valuestring, strlen(binary_data_n2_information_ext11->valuestring), &decoded_str_binary_data_n2_information_ext11->len); + if (!decoded_str_binary_data_n2_information_ext11->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext11]"); + goto end; + } + } + + binary_data_n2_information_ext12 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt12"); + if (binary_data_n2_information_ext12) { + decoded_str_binary_data_n2_information_ext12 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext12); + if (!cJSON_IsString(binary_data_n2_information_ext12)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + decoded_str_binary_data_n2_information_ext12->data = OpenAPI_base64decode(binary_data_n2_information_ext12->valuestring, strlen(binary_data_n2_information_ext12->valuestring), &decoded_str_binary_data_n2_information_ext12->len); + if (!decoded_str_binary_data_n2_information_ext12->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext12]"); + goto end; + } + } + + binary_data_n2_information_ext13 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt13"); + if (binary_data_n2_information_ext13) { + decoded_str_binary_data_n2_information_ext13 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext13); + if (!cJSON_IsString(binary_data_n2_information_ext13)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + decoded_str_binary_data_n2_information_ext13->data = OpenAPI_base64decode(binary_data_n2_information_ext13->valuestring, strlen(binary_data_n2_information_ext13->valuestring), &decoded_str_binary_data_n2_information_ext13->len); + if (!decoded_str_binary_data_n2_information_ext13->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext13]"); + goto end; + } + } + + binary_data_n2_information_ext14 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt14"); + if (binary_data_n2_information_ext14) { + decoded_str_binary_data_n2_information_ext14 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext14); + if (!cJSON_IsString(binary_data_n2_information_ext14)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + decoded_str_binary_data_n2_information_ext14->data = OpenAPI_base64decode(binary_data_n2_information_ext14->valuestring, strlen(binary_data_n2_information_ext14->valuestring), &decoded_str_binary_data_n2_information_ext14->len); + if (!decoded_str_binary_data_n2_information_ext14->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext14]"); + goto end; + } + } + + binary_data_n2_information_ext15 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt15"); + if (binary_data_n2_information_ext15) { + decoded_str_binary_data_n2_information_ext15 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext15); + if (!cJSON_IsString(binary_data_n2_information_ext15)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + decoded_str_binary_data_n2_information_ext15->data = OpenAPI_base64decode(binary_data_n2_information_ext15->valuestring, strlen(binary_data_n2_information_ext15->valuestring), &decoded_str_binary_data_n2_information_ext15->len); + if (!decoded_str_binary_data_n2_information_ext15->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext15]"); + goto end; + } + } + + binary_data_n2_information_ext16 = cJSON_GetObjectItemCaseSensitive(relocate_ue_context_requestJSON, "binaryDataN2InformationExt16"); + if (binary_data_n2_information_ext16) { + decoded_str_binary_data_n2_information_ext16 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext16); + if (!cJSON_IsString(binary_data_n2_information_ext16)) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext16]"); + goto end; + } + decoded_str_binary_data_n2_information_ext16->data = OpenAPI_base64decode(binary_data_n2_information_ext16->valuestring, strlen(binary_data_n2_information_ext16->valuestring), &decoded_str_binary_data_n2_information_ext16->len); + if (!decoded_str_binary_data_n2_information_ext16->data) { + ogs_error("OpenAPI_relocate_ue_context_request_parseFromJSON() failed [binary_data_n2_information_ext16]"); + goto end; + } + } + + relocate_ue_context_request_local_var = OpenAPI_relocate_ue_context_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_gtpc_message ? decoded_str_binary_data_gtpc_message : NULL, + binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL, + binary_data_n2_information_ext1 ? decoded_str_binary_data_n2_information_ext1 : NULL, + binary_data_n2_information_ext2 ? decoded_str_binary_data_n2_information_ext2 : NULL, + binary_data_n2_information_ext3 ? decoded_str_binary_data_n2_information_ext3 : NULL, + binary_data_n2_information_ext4 ? decoded_str_binary_data_n2_information_ext4 : NULL, + binary_data_n2_information_ext5 ? decoded_str_binary_data_n2_information_ext5 : NULL, + binary_data_n2_information_ext6 ? decoded_str_binary_data_n2_information_ext6 : NULL, + binary_data_n2_information_ext7 ? decoded_str_binary_data_n2_information_ext7 : NULL, + binary_data_n2_information_ext8 ? decoded_str_binary_data_n2_information_ext8 : NULL, + binary_data_n2_information_ext9 ? decoded_str_binary_data_n2_information_ext9 : NULL, + binary_data_n2_information_ext10 ? decoded_str_binary_data_n2_information_ext10 : NULL, + binary_data_n2_information_ext11 ? decoded_str_binary_data_n2_information_ext11 : NULL, + binary_data_n2_information_ext12 ? decoded_str_binary_data_n2_information_ext12 : NULL, + binary_data_n2_information_ext13 ? decoded_str_binary_data_n2_information_ext13 : NULL, + binary_data_n2_information_ext14 ? decoded_str_binary_data_n2_information_ext14 : NULL, + binary_data_n2_information_ext15 ? decoded_str_binary_data_n2_information_ext15 : NULL, + binary_data_n2_information_ext16 ? decoded_str_binary_data_n2_information_ext16 : NULL + ); + + return relocate_ue_context_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_ue_context_relocate_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_relocate_ue_context_request_t *OpenAPI_relocate_ue_context_request_copy(OpenAPI_relocate_ue_context_request_t *dst, OpenAPI_relocate_ue_context_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_relocate_ue_context_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_relocate_ue_context_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_relocate_ue_context_request_free(dst); + dst = OpenAPI_relocate_ue_context_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/inline_object_1.h b/lib/sbi/openapi/model/relocate_ue_context_request.h similarity index 70% rename from lib/sbi/openapi/model/inline_object_1.h rename to lib/sbi/openapi/model/relocate_ue_context_request.h index 148f4efbe..d5f5b30fc 100644 --- a/lib/sbi/openapi/model/inline_object_1.h +++ b/lib/sbi/openapi/model/relocate_ue_context_request.h @@ -1,11 +1,11 @@ /* - * inline_object_1.h + * relocate_ue_context_request.h * * */ -#ifndef _OpenAPI_inline_object_1_H_ -#define _OpenAPI_inline_object_1_H_ +#ifndef _OpenAPI_relocate_ue_context_request_H_ +#define _OpenAPI_relocate_ue_context_request_H_ #include #include "../external/cJSON.h" @@ -18,8 +18,8 @@ extern "C" { #endif -typedef struct OpenAPI_inline_object_1_s OpenAPI_inline_object_1_t; -typedef struct OpenAPI_inline_object_1_s { +typedef struct OpenAPI_relocate_ue_context_request_s OpenAPI_relocate_ue_context_request_t; +typedef struct OpenAPI_relocate_ue_context_request_s { struct OpenAPI_ue_context_relocate_data_s *json_data; OpenAPI_binary_t* binary_data_gtpc_message; OpenAPI_binary_t* binary_data_n2_information; @@ -39,9 +39,9 @@ typedef struct OpenAPI_inline_object_1_s { OpenAPI_binary_t* binary_data_n2_information_ext14; OpenAPI_binary_t* binary_data_n2_information_ext15; OpenAPI_binary_t* binary_data_n2_information_ext16; -} OpenAPI_inline_object_1_t; +} OpenAPI_relocate_ue_context_request_t; -OpenAPI_inline_object_1_t *OpenAPI_inline_object_1_create( +OpenAPI_relocate_ue_context_request_t *OpenAPI_relocate_ue_context_request_create( OpenAPI_ue_context_relocate_data_t *json_data, OpenAPI_binary_t* binary_data_gtpc_message, OpenAPI_binary_t* binary_data_n2_information, @@ -62,14 +62,14 @@ OpenAPI_inline_object_1_t *OpenAPI_inline_object_1_create( OpenAPI_binary_t* binary_data_n2_information_ext15, OpenAPI_binary_t* binary_data_n2_information_ext16 ); -void OpenAPI_inline_object_1_free(OpenAPI_inline_object_1_t *inline_object_1); -OpenAPI_inline_object_1_t *OpenAPI_inline_object_1_parseFromJSON(cJSON *inline_object_1JSON); -cJSON *OpenAPI_inline_object_1_convertToJSON(OpenAPI_inline_object_1_t *inline_object_1); -OpenAPI_inline_object_1_t *OpenAPI_inline_object_1_copy(OpenAPI_inline_object_1_t *dst, OpenAPI_inline_object_1_t *src); +void OpenAPI_relocate_ue_context_request_free(OpenAPI_relocate_ue_context_request_t *relocate_ue_context_request); +OpenAPI_relocate_ue_context_request_t *OpenAPI_relocate_ue_context_request_parseFromJSON(cJSON *relocate_ue_context_requestJSON); +cJSON *OpenAPI_relocate_ue_context_request_convertToJSON(OpenAPI_relocate_ue_context_request_t *relocate_ue_context_request); +OpenAPI_relocate_ue_context_request_t *OpenAPI_relocate_ue_context_request_copy(OpenAPI_relocate_ue_context_request_t *dst, OpenAPI_relocate_ue_context_request_t *src); #ifdef __cplusplus } #endif -#endif /* _OpenAPI_inline_object_1_H_ */ +#endif /* _OpenAPI_relocate_ue_context_request_H_ */ diff --git a/lib/sbi/openapi/model/report_amount_mdt.c b/lib/sbi/openapi/model/report_amount_mdt.c index 6335c104b..c3d618cf5 100644 --- a/lib/sbi/openapi/model/report_amount_mdt.c +++ b/lib/sbi/openapi/model/report_amount_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_report_amount_mdt_ToString(OpenAPI_report_amount_mdt_e report_amount_mdt) { - const char *report_amount_mdtArray[] = { "NULL", "_1", "_2", "_4", "_8", "_16", "_32", "_64", "infinity" }; + const char *report_amount_mdtArray[] = { "NULL", "1", "2", "4", "8", "16", "32", "64", "infinity" }; size_t sizeofArray = sizeof(report_amount_mdtArray) / sizeof(report_amount_mdtArray[0]); if (report_amount_mdt < sizeofArray) return (char *)report_amount_mdtArray[report_amount_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_report_amount_mdt_ToString(OpenAPI_report_amount_mdt_e report_amou OpenAPI_report_amount_mdt_e OpenAPI_report_amount_mdt_FromString(char* report_amount_mdt) { int stringToReturn = 0; - const char *report_amount_mdtArray[] = { "NULL", "_1", "_2", "_4", "_8", "_16", "_32", "_64", "infinity" }; + const char *report_amount_mdtArray[] = { "NULL", "1", "2", "4", "8", "16", "32", "64", "infinity" }; size_t sizeofArray = sizeof(report_amount_mdtArray) / sizeof(report_amount_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(report_amount_mdt, report_amount_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/report_interval_mdt.c b/lib/sbi/openapi/model/report_interval_mdt.c index f82e99156..81046ca82 100644 --- a/lib/sbi/openapi/model/report_interval_mdt.c +++ b/lib/sbi/openapi/model/report_interval_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_report_interval_mdt_ToString(OpenAPI_report_interval_mdt_e report_interval_mdt) { - const char *report_interval_mdtArray[] = { "NULL", "_120", "_240", "_480", "_640", "_1024", "_2048", "_5120", "_10240", "_60000", "_360000", "_720000", "_1800000", "_3600000" }; + const char *report_interval_mdtArray[] = { "NULL", "120", "240", "480", "640", "1024", "2048", "5120", "10240", "60000", "360000", "720000", "1800000", "3600000" }; size_t sizeofArray = sizeof(report_interval_mdtArray) / sizeof(report_interval_mdtArray[0]); if (report_interval_mdt < sizeofArray) return (char *)report_interval_mdtArray[report_interval_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_report_interval_mdt_ToString(OpenAPI_report_interval_mdt_e report_ OpenAPI_report_interval_mdt_e OpenAPI_report_interval_mdt_FromString(char* report_interval_mdt) { int stringToReturn = 0; - const char *report_interval_mdtArray[] = { "NULL", "_120", "_240", "_480", "_640", "_1024", "_2048", "_5120", "_10240", "_60000", "_360000", "_720000", "_1800000", "_3600000" }; + const char *report_interval_mdtArray[] = { "NULL", "120", "240", "480", "640", "1024", "2048", "5120", "10240", "60000", "360000", "720000", "1800000", "3600000" }; size_t sizeofArray = sizeof(report_interval_mdtArray) / sizeof(report_interval_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(report_interval_mdt, report_interval_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/report_interval_nr_mdt.c b/lib/sbi/openapi/model/report_interval_nr_mdt.c index ad37b6632..5c707bc6d 100644 --- a/lib/sbi/openapi/model/report_interval_nr_mdt.c +++ b/lib/sbi/openapi/model/report_interval_nr_mdt.c @@ -6,7 +6,7 @@ char* OpenAPI_report_interval_nr_mdt_ToString(OpenAPI_report_interval_nr_mdt_e report_interval_nr_mdt) { - const char *report_interval_nr_mdtArray[] = { "NULL", "_120", "_240", "_480", "_640", "_1024", "_2048", "_5120", "_10240", "_20480", "_40960", "_60000", "_360000", "_720000", "_1800000", "_3600000" }; + const char *report_interval_nr_mdtArray[] = { "NULL", "120", "240", "480", "640", "1024", "2048", "5120", "10240", "20480", "40960", "60000", "360000", "720000", "1800000", "3600000" }; size_t sizeofArray = sizeof(report_interval_nr_mdtArray) / sizeof(report_interval_nr_mdtArray[0]); if (report_interval_nr_mdt < sizeofArray) return (char *)report_interval_nr_mdtArray[report_interval_nr_mdt]; @@ -17,7 +17,7 @@ char* OpenAPI_report_interval_nr_mdt_ToString(OpenAPI_report_interval_nr_mdt_e r OpenAPI_report_interval_nr_mdt_e OpenAPI_report_interval_nr_mdt_FromString(char* report_interval_nr_mdt) { int stringToReturn = 0; - const char *report_interval_nr_mdtArray[] = { "NULL", "_120", "_240", "_480", "_640", "_1024", "_2048", "_5120", "_10240", "_20480", "_40960", "_60000", "_360000", "_720000", "_1800000", "_3600000" }; + const char *report_interval_nr_mdtArray[] = { "NULL", "120", "240", "480", "640", "1024", "2048", "5120", "10240", "20480", "40960", "60000", "360000", "720000", "1800000", "3600000" }; size_t sizeofArray = sizeof(report_interval_nr_mdtArray) / sizeof(report_interval_nr_mdtArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(report_interval_nr_mdt, report_interval_nr_mdtArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/report_item.c b/lib/sbi/openapi/model/report_item.c index af3b95974..e8b6cb402 100644 --- a/lib/sbi/openapi/model/report_item.c +++ b/lib/sbi/openapi/model/report_item.c @@ -18,17 +18,22 @@ OpenAPI_report_item_t *OpenAPI_report_item_create( void OpenAPI_report_item_free(OpenAPI_report_item_t *report_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == report_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(report_item->path); + if (report_item->path) { + ogs_free(report_item->path); + report_item->path = NULL; + } ogs_free(report_item); } cJSON *OpenAPI_report_item_convertToJSON(OpenAPI_report_item_t *report_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (report_item == NULL) { ogs_error("OpenAPI_report_item_convertToJSON() failed [ReportItem]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_report_item_convertToJSON(OpenAPI_report_item_t *report_item) } item = cJSON_CreateObject(); + if (!report_item->path) { + ogs_error("OpenAPI_report_item_convertToJSON() failed [path]"); + return NULL; + } if (cJSON_AddStringToObject(item, "path", report_item->path) == NULL) { ogs_error("OpenAPI_report_item_convertToJSON() failed [path]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_report_item_t *OpenAPI_report_item_parseFromJSON(cJSON *report_itemJSON) { OpenAPI_report_item_t *report_item_local_var = NULL; - cJSON *path = cJSON_GetObjectItemCaseSensitive(report_itemJSON, "path"); + OpenAPI_lnode_t *node = NULL; + cJSON *path = NULL; + path = cJSON_GetObjectItemCaseSensitive(report_itemJSON, "path"); if (!path) { ogs_error("OpenAPI_report_item_parseFromJSON() failed [path]"); goto end; } - if (!cJSON_IsString(path)) { ogs_error("OpenAPI_report_item_parseFromJSON() failed [path]"); goto end; diff --git a/lib/sbi/openapi/model/reporting_options.c b/lib/sbi/openapi/model/reporting_options.c index b16ae2a64..f995e37b9 100644 --- a/lib/sbi/openapi/model/reporting_options.c +++ b/lib/sbi/openapi/model/reporting_options.c @@ -36,18 +36,26 @@ OpenAPI_reporting_options_t *OpenAPI_reporting_options_create( void OpenAPI_reporting_options_free(OpenAPI_reporting_options_t *reporting_options) { + OpenAPI_lnode_t *node = NULL; + if (NULL == reporting_options) { return; } - OpenAPI_lnode_t *node; - OpenAPI_event_report_mode_free(reporting_options->report_mode); - ogs_free(reporting_options->expiry); + if (reporting_options->report_mode) { + OpenAPI_event_report_mode_free(reporting_options->report_mode); + reporting_options->report_mode = NULL; + } + if (reporting_options->expiry) { + ogs_free(reporting_options->expiry); + reporting_options->expiry = NULL; + } ogs_free(reporting_options); } cJSON *OpenAPI_reporting_options_convertToJSON(OpenAPI_reporting_options_t *reporting_options) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (reporting_options == NULL) { ogs_error("OpenAPI_reporting_options_convertToJSON() failed [ReportingOptions]"); @@ -110,15 +118,20 @@ end: OpenAPI_reporting_options_t *OpenAPI_reporting_options_parseFromJSON(cJSON *reporting_optionsJSON) { OpenAPI_reporting_options_t *reporting_options_local_var = NULL; - cJSON *report_mode = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "reportMode"); - + OpenAPI_lnode_t *node = NULL; + cJSON *report_mode = NULL; OpenAPI_event_report_mode_t *report_mode_local_nonprim = NULL; + cJSON *max_num_of_reports = NULL; + cJSON *expiry = NULL; + cJSON *sampling_ratio = NULL; + cJSON *guard_time = NULL; + cJSON *report_period = NULL; + report_mode = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "reportMode"); if (report_mode) { report_mode_local_nonprim = OpenAPI_event_report_mode_parseFromJSON(report_mode); } - cJSON *max_num_of_reports = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "maxNumOfReports"); - + max_num_of_reports = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "maxNumOfReports"); if (max_num_of_reports) { if (!cJSON_IsNumber(max_num_of_reports)) { ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [max_num_of_reports]"); @@ -126,17 +139,15 @@ OpenAPI_reporting_options_t *OpenAPI_reporting_options_parseFromJSON(cJSON *repo } } - cJSON *expiry = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "expiry"); - + expiry = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "expiry"); if (expiry) { - if (!cJSON_IsString(expiry)) { + if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) { ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [expiry]"); goto end; } } - cJSON *sampling_ratio = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "samplingRatio"); - + sampling_ratio = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "samplingRatio"); if (sampling_ratio) { if (!cJSON_IsNumber(sampling_ratio)) { ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [sampling_ratio]"); @@ -144,8 +155,7 @@ OpenAPI_reporting_options_t *OpenAPI_reporting_options_parseFromJSON(cJSON *repo } } - cJSON *guard_time = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "guardTime"); - + guard_time = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "guardTime"); if (guard_time) { if (!cJSON_IsNumber(guard_time)) { ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [guard_time]"); @@ -153,8 +163,7 @@ OpenAPI_reporting_options_t *OpenAPI_reporting_options_parseFromJSON(cJSON *repo } } - cJSON *report_period = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "reportPeriod"); - + report_period = cJSON_GetObjectItemCaseSensitive(reporting_optionsJSON, "reportPeriod"); if (report_period) { if (!cJSON_IsNumber(report_period)) { ogs_error("OpenAPI_reporting_options_parseFromJSON() failed [report_period]"); @@ -166,7 +175,7 @@ OpenAPI_reporting_options_t *OpenAPI_reporting_options_parseFromJSON(cJSON *repo report_mode ? report_mode_local_nonprim : NULL, max_num_of_reports ? true : false, max_num_of_reports ? max_num_of_reports->valuedouble : 0, - expiry ? ogs_strdup(expiry->valuestring) : NULL, + expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL, sampling_ratio ? true : false, sampling_ratio ? sampling_ratio->valuedouble : 0, guard_time ? true : false, @@ -177,6 +186,10 @@ OpenAPI_reporting_options_t *OpenAPI_reporting_options_parseFromJSON(cJSON *repo return reporting_options_local_var; end: + if (report_mode_local_nonprim) { + OpenAPI_event_report_mode_free(report_mode_local_nonprim); + report_mode_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/requested_qos.c b/lib/sbi/openapi/model/requested_qos.c index 3046e40dd..53736369c 100644 --- a/lib/sbi/openapi/model/requested_qos.c +++ b/lib/sbi/openapi/model/requested_qos.c @@ -22,18 +22,26 @@ OpenAPI_requested_qos_t *OpenAPI_requested_qos_create( void OpenAPI_requested_qos_free(OpenAPI_requested_qos_t *requested_qos) { + OpenAPI_lnode_t *node = NULL; + if (NULL == requested_qos) { return; } - OpenAPI_lnode_t *node; - ogs_free(requested_qos->gbr_ul); - ogs_free(requested_qos->gbr_dl); + if (requested_qos->gbr_ul) { + ogs_free(requested_qos->gbr_ul); + requested_qos->gbr_ul = NULL; + } + if (requested_qos->gbr_dl) { + ogs_free(requested_qos->gbr_dl); + requested_qos->gbr_dl = NULL; + } ogs_free(requested_qos); } cJSON *OpenAPI_requested_qos_convertToJSON(OpenAPI_requested_qos_t *requested_qos) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (requested_qos == NULL) { ogs_error("OpenAPI_requested_qos_convertToJSON() failed [RequestedQos]"); @@ -67,30 +75,31 @@ end: OpenAPI_requested_qos_t *OpenAPI_requested_qos_parseFromJSON(cJSON *requested_qosJSON) { OpenAPI_requested_qos_t *requested_qos_local_var = NULL; - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(requested_qosJSON, "5qi"); + OpenAPI_lnode_t *node = NULL; + cJSON *_5qi = NULL; + cJSON *gbr_ul = NULL; + cJSON *gbr_dl = NULL; + _5qi = cJSON_GetObjectItemCaseSensitive(requested_qosJSON, "5qi"); if (!_5qi) { ogs_error("OpenAPI_requested_qos_parseFromJSON() failed [_5qi]"); goto end; } - if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_requested_qos_parseFromJSON() failed [_5qi]"); goto end; } - cJSON *gbr_ul = cJSON_GetObjectItemCaseSensitive(requested_qosJSON, "gbrUl"); - + gbr_ul = cJSON_GetObjectItemCaseSensitive(requested_qosJSON, "gbrUl"); if (gbr_ul) { - if (!cJSON_IsString(gbr_ul)) { + if (!cJSON_IsString(gbr_ul) && !cJSON_IsNull(gbr_ul)) { ogs_error("OpenAPI_requested_qos_parseFromJSON() failed [gbr_ul]"); goto end; } } - cJSON *gbr_dl = cJSON_GetObjectItemCaseSensitive(requested_qosJSON, "gbrDl"); - + gbr_dl = cJSON_GetObjectItemCaseSensitive(requested_qosJSON, "gbrDl"); if (gbr_dl) { - if (!cJSON_IsString(gbr_dl)) { + if (!cJSON_IsString(gbr_dl) && !cJSON_IsNull(gbr_dl)) { ogs_error("OpenAPI_requested_qos_parseFromJSON() failed [gbr_dl]"); goto end; } @@ -99,8 +108,8 @@ OpenAPI_requested_qos_t *OpenAPI_requested_qos_parseFromJSON(cJSON *requested_qo requested_qos_local_var = OpenAPI_requested_qos_create ( _5qi->valuedouble, - gbr_ul ? ogs_strdup(gbr_ul->valuestring) : NULL, - gbr_dl ? ogs_strdup(gbr_dl->valuestring) : NULL + gbr_ul && !cJSON_IsNull(gbr_ul) ? ogs_strdup(gbr_ul->valuestring) : NULL, + gbr_dl && !cJSON_IsNull(gbr_dl) ? ogs_strdup(gbr_dl->valuestring) : NULL ); return requested_qos_local_var; diff --git a/lib/sbi/openapi/model/requested_rule_data.c b/lib/sbi/openapi/model/requested_rule_data.c index fa066746c..645d6c2ba 100644 --- a/lib/sbi/openapi/model/requested_rule_data.c +++ b/lib/sbi/openapi/model/requested_rule_data.c @@ -20,21 +20,29 @@ OpenAPI_requested_rule_data_t *OpenAPI_requested_rule_data_create( void OpenAPI_requested_rule_data_free(OpenAPI_requested_rule_data_t *requested_rule_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == requested_rule_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(requested_rule_data->ref_pcc_rule_ids, node) { - ogs_free(node->data); + if (requested_rule_data->ref_pcc_rule_ids) { + OpenAPI_list_for_each(requested_rule_data->ref_pcc_rule_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(requested_rule_data->ref_pcc_rule_ids); + requested_rule_data->ref_pcc_rule_ids = NULL; + } + if (requested_rule_data->req_data) { + OpenAPI_list_free(requested_rule_data->req_data); + requested_rule_data->req_data = NULL; } - OpenAPI_list_free(requested_rule_data->ref_pcc_rule_ids); - OpenAPI_list_free(requested_rule_data->req_data); ogs_free(requested_rule_data); } cJSON *OpenAPI_requested_rule_data_convertToJSON(OpenAPI_requested_rule_data_t *requested_rule_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (requested_rule_data == NULL) { ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [RequestedRuleData]"); @@ -42,28 +50,33 @@ cJSON *OpenAPI_requested_rule_data_convertToJSON(OpenAPI_requested_rule_data_t * } item = cJSON_CreateObject(); - cJSON *ref_pcc_rule_ids = cJSON_AddArrayToObject(item, "refPccRuleIds"); - if (ref_pcc_rule_ids == NULL) { + if (!requested_rule_data->ref_pcc_rule_ids) { + ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [ref_pcc_rule_ids]"); + return NULL; + } + cJSON *ref_pcc_rule_idsList = cJSON_AddArrayToObject(item, "refPccRuleIds"); + if (ref_pcc_rule_idsList == NULL) { ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [ref_pcc_rule_ids]"); goto end; } - - OpenAPI_lnode_t *ref_pcc_rule_ids_node; - OpenAPI_list_for_each(requested_rule_data->ref_pcc_rule_ids, ref_pcc_rule_ids_node) { - if (cJSON_AddStringToObject(ref_pcc_rule_ids, "", (char*)ref_pcc_rule_ids_node->data) == NULL) { - ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [ref_pcc_rule_ids]"); - goto end; + OpenAPI_list_for_each(requested_rule_data->ref_pcc_rule_ids, node) { + if (cJSON_AddStringToObject(ref_pcc_rule_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [ref_pcc_rule_ids]"); + goto end; + } } - } - cJSON *req_data = cJSON_AddArrayToObject(item, "reqData"); - if (req_data == NULL) { + if (requested_rule_data->req_data == OpenAPI_requested_rule_data_type_NULL) { + ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [req_data]"); + return NULL; + } + cJSON *req_dataList = cJSON_AddArrayToObject(item, "reqData"); + if (req_dataList == NULL) { ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [req_data]"); goto end; } - OpenAPI_lnode_t *req_data_node; - OpenAPI_list_for_each(requested_rule_data->req_data, req_data_node) { - if (cJSON_AddStringToObject(req_data, "", OpenAPI_requested_rule_data_type_ToString((intptr_t)req_data_node->data)) == NULL) { + OpenAPI_list_for_each(requested_rule_data->req_data, node) { + if (cJSON_AddStringToObject(req_dataList, "", OpenAPI_requested_rule_data_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [req_data]"); goto end; } @@ -76,51 +89,54 @@ end: OpenAPI_requested_rule_data_t *OpenAPI_requested_rule_data_parseFromJSON(cJSON *requested_rule_dataJSON) { OpenAPI_requested_rule_data_t *requested_rule_data_local_var = NULL; - cJSON *ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(requested_rule_dataJSON, "refPccRuleIds"); + OpenAPI_lnode_t *node = NULL; + cJSON *ref_pcc_rule_ids = NULL; + OpenAPI_list_t *ref_pcc_rule_idsList = NULL; + cJSON *req_data = NULL; + OpenAPI_list_t *req_dataList = NULL; + ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(requested_rule_dataJSON, "refPccRuleIds"); if (!ref_pcc_rule_ids) { ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [ref_pcc_rule_ids]"); goto end; } + cJSON *ref_pcc_rule_ids_local = NULL; + if (!cJSON_IsArray(ref_pcc_rule_ids)) { + ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [ref_pcc_rule_ids]"); + goto end; + } - OpenAPI_list_t *ref_pcc_rule_idsList; - cJSON *ref_pcc_rule_ids_local; - if (!cJSON_IsArray(ref_pcc_rule_ids)) { - ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [ref_pcc_rule_ids]"); - goto end; - } - ref_pcc_rule_idsList = OpenAPI_list_create(); + ref_pcc_rule_idsList = OpenAPI_list_create(); - cJSON_ArrayForEach(ref_pcc_rule_ids_local, ref_pcc_rule_ids) { - if (!cJSON_IsString(ref_pcc_rule_ids_local)) { - ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [ref_pcc_rule_ids]"); - goto end; - } - OpenAPI_list_add(ref_pcc_rule_idsList, ogs_strdup(ref_pcc_rule_ids_local->valuestring)); - } + cJSON_ArrayForEach(ref_pcc_rule_ids_local, ref_pcc_rule_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_pcc_rule_ids_local)) { + ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [ref_pcc_rule_ids]"); + goto end; + } + OpenAPI_list_add(ref_pcc_rule_idsList, ogs_strdup(ref_pcc_rule_ids_local->valuestring)); + } - cJSON *req_data = cJSON_GetObjectItemCaseSensitive(requested_rule_dataJSON, "reqData"); + req_data = cJSON_GetObjectItemCaseSensitive(requested_rule_dataJSON, "reqData"); if (!req_data) { ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [req_data]"); goto end; } - - OpenAPI_list_t *req_dataList; - cJSON *req_data_local_nonprimitive; - if (!cJSON_IsArray(req_data)) { - ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [req_data]"); - goto end; - } - - req_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_data_local_nonprimitive, req_data ) { - if (!cJSON_IsString(req_data_local_nonprimitive)){ + cJSON *req_data_local = NULL; + if (!cJSON_IsArray(req_data)) { ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [req_data]"); goto end; } - OpenAPI_list_add(req_dataList, (void *)OpenAPI_requested_rule_data_type_FromString(req_data_local_nonprimitive->valuestring)); - } + req_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_data_local, req_data) { + if (!cJSON_IsString(req_data_local)) { + ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [req_data]"); + goto end; + } + OpenAPI_list_add(req_dataList, (void *)OpenAPI_requested_rule_data_type_FromString(req_data_local->valuestring)); + } requested_rule_data_local_var = OpenAPI_requested_rule_data_create ( ref_pcc_rule_idsList, @@ -129,6 +145,17 @@ OpenAPI_requested_rule_data_t *OpenAPI_requested_rule_data_parseFromJSON(cJSON * return requested_rule_data_local_var; end: + if (ref_pcc_rule_idsList) { + OpenAPI_list_for_each(ref_pcc_rule_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_pcc_rule_idsList); + ref_pcc_rule_idsList = NULL; + } + if (req_dataList) { + OpenAPI_list_free(req_dataList); + req_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/requested_usage_data.c b/lib/sbi/openapi/model/requested_usage_data.c index 73e833dc7..e3b9bafc4 100644 --- a/lib/sbi/openapi/model/requested_usage_data.c +++ b/lib/sbi/openapi/model/requested_usage_data.c @@ -22,20 +22,25 @@ OpenAPI_requested_usage_data_t *OpenAPI_requested_usage_data_create( void OpenAPI_requested_usage_data_free(OpenAPI_requested_usage_data_t *requested_usage_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == requested_usage_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(requested_usage_data->ref_um_ids, node) { - ogs_free(node->data); + if (requested_usage_data->ref_um_ids) { + OpenAPI_list_for_each(requested_usage_data->ref_um_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(requested_usage_data->ref_um_ids); + requested_usage_data->ref_um_ids = NULL; } - OpenAPI_list_free(requested_usage_data->ref_um_ids); ogs_free(requested_usage_data); } cJSON *OpenAPI_requested_usage_data_convertToJSON(OpenAPI_requested_usage_data_t *requested_usage_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (requested_usage_data == NULL) { ogs_error("OpenAPI_requested_usage_data_convertToJSON() failed [RequestedUsageData]"); @@ -44,19 +49,17 @@ cJSON *OpenAPI_requested_usage_data_convertToJSON(OpenAPI_requested_usage_data_t item = cJSON_CreateObject(); if (requested_usage_data->ref_um_ids) { - cJSON *ref_um_ids = cJSON_AddArrayToObject(item, "refUmIds"); - if (ref_um_ids == NULL) { + cJSON *ref_um_idsList = cJSON_AddArrayToObject(item, "refUmIds"); + if (ref_um_idsList == NULL) { ogs_error("OpenAPI_requested_usage_data_convertToJSON() failed [ref_um_ids]"); goto end; } - - OpenAPI_lnode_t *ref_um_ids_node; - OpenAPI_list_for_each(requested_usage_data->ref_um_ids, ref_um_ids_node) { - if (cJSON_AddStringToObject(ref_um_ids, "", (char*)ref_um_ids_node->data) == NULL) { - ogs_error("OpenAPI_requested_usage_data_convertToJSON() failed [ref_um_ids]"); - goto end; + OpenAPI_list_for_each(requested_usage_data->ref_um_ids, node) { + if (cJSON_AddStringToObject(ref_um_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_requested_usage_data_convertToJSON() failed [ref_um_ids]"); + goto end; + } } - } } if (requested_usage_data->is_all_um_ids) { @@ -73,28 +76,32 @@ end: OpenAPI_requested_usage_data_t *OpenAPI_requested_usage_data_parseFromJSON(cJSON *requested_usage_dataJSON) { OpenAPI_requested_usage_data_t *requested_usage_data_local_var = NULL; - cJSON *ref_um_ids = cJSON_GetObjectItemCaseSensitive(requested_usage_dataJSON, "refUmIds"); - - OpenAPI_list_t *ref_um_idsList; + OpenAPI_lnode_t *node = NULL; + cJSON *ref_um_ids = NULL; + OpenAPI_list_t *ref_um_idsList = NULL; + cJSON *all_um_ids = NULL; + ref_um_ids = cJSON_GetObjectItemCaseSensitive(requested_usage_dataJSON, "refUmIds"); if (ref_um_ids) { - cJSON *ref_um_ids_local; - if (!cJSON_IsArray(ref_um_ids)) { - ogs_error("OpenAPI_requested_usage_data_parseFromJSON() failed [ref_um_ids]"); - goto end; - } - ref_um_idsList = OpenAPI_list_create(); + cJSON *ref_um_ids_local = NULL; + if (!cJSON_IsArray(ref_um_ids)) { + ogs_error("OpenAPI_requested_usage_data_parseFromJSON() failed [ref_um_ids]"); + goto end; + } - cJSON_ArrayForEach(ref_um_ids_local, ref_um_ids) { - if (!cJSON_IsString(ref_um_ids_local)) { - ogs_error("OpenAPI_requested_usage_data_parseFromJSON() failed [ref_um_ids]"); - goto end; - } - OpenAPI_list_add(ref_um_idsList, ogs_strdup(ref_um_ids_local->valuestring)); - } + ref_um_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ref_um_ids_local, ref_um_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ref_um_ids_local)) { + ogs_error("OpenAPI_requested_usage_data_parseFromJSON() failed [ref_um_ids]"); + goto end; + } + OpenAPI_list_add(ref_um_idsList, ogs_strdup(ref_um_ids_local->valuestring)); + } } - cJSON *all_um_ids = cJSON_GetObjectItemCaseSensitive(requested_usage_dataJSON, "allUmIds"); - + all_um_ids = cJSON_GetObjectItemCaseSensitive(requested_usage_dataJSON, "allUmIds"); if (all_um_ids) { if (!cJSON_IsBool(all_um_ids)) { ogs_error("OpenAPI_requested_usage_data_parseFromJSON() failed [all_um_ids]"); @@ -110,6 +117,13 @@ OpenAPI_requested_usage_data_t *OpenAPI_requested_usage_data_parseFromJSON(cJSON return requested_usage_data_local_var; end: + if (ref_um_idsList) { + OpenAPI_list_for_each(ref_um_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ref_um_idsList); + ref_um_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/resource_item.c b/lib/sbi/openapi/model/resource_item.c index ebcc76e28..facdf9ad0 100644 --- a/lib/sbi/openapi/model/resource_item.c +++ b/lib/sbi/openapi/model/resource_item.c @@ -20,21 +20,29 @@ OpenAPI_resource_item_t *OpenAPI_resource_item_create( void OpenAPI_resource_item_free(OpenAPI_resource_item_t *resource_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == resource_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(resource_item->mon_resource_uri); - OpenAPI_list_for_each(resource_item->items, node) { - ogs_free(node->data); + if (resource_item->mon_resource_uri) { + ogs_free(resource_item->mon_resource_uri); + resource_item->mon_resource_uri = NULL; + } + if (resource_item->items) { + OpenAPI_list_for_each(resource_item->items, node) { + ogs_free(node->data); + } + OpenAPI_list_free(resource_item->items); + resource_item->items = NULL; } - OpenAPI_list_free(resource_item->items); ogs_free(resource_item); } cJSON *OpenAPI_resource_item_convertToJSON(OpenAPI_resource_item_t *resource_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (resource_item == NULL) { ogs_error("OpenAPI_resource_item_convertToJSON() failed [ResourceItem]"); @@ -42,24 +50,30 @@ cJSON *OpenAPI_resource_item_convertToJSON(OpenAPI_resource_item_t *resource_ite } item = cJSON_CreateObject(); + if (!resource_item->mon_resource_uri) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [mon_resource_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "monResourceUri", resource_item->mon_resource_uri) == NULL) { ogs_error("OpenAPI_resource_item_convertToJSON() failed [mon_resource_uri]"); goto end; } - cJSON *items = cJSON_AddArrayToObject(item, "items"); - if (items == NULL) { + if (!resource_item->items) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [items]"); + return NULL; + } + cJSON *itemsList = cJSON_AddArrayToObject(item, "items"); + if (itemsList == NULL) { ogs_error("OpenAPI_resource_item_convertToJSON() failed [items]"); goto end; } - - OpenAPI_lnode_t *items_node; - OpenAPI_list_for_each(resource_item->items, items_node) { - if (cJSON_AddStringToObject(items, "", (char*)items_node->data) == NULL) { - ogs_error("OpenAPI_resource_item_convertToJSON() failed [items]"); - goto end; + OpenAPI_list_for_each(resource_item->items, node) { + if (cJSON_AddStringToObject(itemsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_resource_item_convertToJSON() failed [items]"); + goto end; + } } - } end: return item; @@ -68,38 +82,42 @@ end: OpenAPI_resource_item_t *OpenAPI_resource_item_parseFromJSON(cJSON *resource_itemJSON) { OpenAPI_resource_item_t *resource_item_local_var = NULL; - cJSON *mon_resource_uri = cJSON_GetObjectItemCaseSensitive(resource_itemJSON, "monResourceUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *mon_resource_uri = NULL; + cJSON *items = NULL; + OpenAPI_list_t *itemsList = NULL; + mon_resource_uri = cJSON_GetObjectItemCaseSensitive(resource_itemJSON, "monResourceUri"); if (!mon_resource_uri) { ogs_error("OpenAPI_resource_item_parseFromJSON() failed [mon_resource_uri]"); goto end; } - if (!cJSON_IsString(mon_resource_uri)) { ogs_error("OpenAPI_resource_item_parseFromJSON() failed [mon_resource_uri]"); goto end; } - cJSON *items = cJSON_GetObjectItemCaseSensitive(resource_itemJSON, "items"); + items = cJSON_GetObjectItemCaseSensitive(resource_itemJSON, "items"); if (!items) { ogs_error("OpenAPI_resource_item_parseFromJSON() failed [items]"); goto end; } + cJSON *items_local = NULL; + if (!cJSON_IsArray(items)) { + ogs_error("OpenAPI_resource_item_parseFromJSON() failed [items]"); + goto end; + } - OpenAPI_list_t *itemsList; - cJSON *items_local; - if (!cJSON_IsArray(items)) { - ogs_error("OpenAPI_resource_item_parseFromJSON() failed [items]"); - goto end; - } - itemsList = OpenAPI_list_create(); + itemsList = OpenAPI_list_create(); - cJSON_ArrayForEach(items_local, items) { - if (!cJSON_IsString(items_local)) { - ogs_error("OpenAPI_resource_item_parseFromJSON() failed [items]"); - goto end; - } - OpenAPI_list_add(itemsList, ogs_strdup(items_local->valuestring)); - } + cJSON_ArrayForEach(items_local, items) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(items_local)) { + ogs_error("OpenAPI_resource_item_parseFromJSON() failed [items]"); + goto end; + } + OpenAPI_list_add(itemsList, ogs_strdup(items_local->valuestring)); + } resource_item_local_var = OpenAPI_resource_item_create ( ogs_strdup(mon_resource_uri->valuestring), @@ -108,6 +126,13 @@ OpenAPI_resource_item_t *OpenAPI_resource_item_parseFromJSON(cJSON *resource_ite return resource_item_local_var; end: + if (itemsList) { + OpenAPI_list_for_each(itemsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(itemsList); + itemsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/resources_allocation_info.c b/lib/sbi/openapi/model/resources_allocation_info.c index a5894b1ea..e1422cdee 100644 --- a/lib/sbi/openapi/model/resources_allocation_info.c +++ b/lib/sbi/openapi/model/resources_allocation_info.c @@ -22,21 +22,29 @@ OpenAPI_resources_allocation_info_t *OpenAPI_resources_allocation_info_create( void OpenAPI_resources_allocation_info_free(OpenAPI_resources_allocation_info_t *resources_allocation_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == resources_allocation_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(resources_allocation_info->flows, node) { - OpenAPI_flows_free(node->data); + if (resources_allocation_info->flows) { + OpenAPI_list_for_each(resources_allocation_info->flows, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(resources_allocation_info->flows); + resources_allocation_info->flows = NULL; + } + if (resources_allocation_info->alt_ser_req) { + ogs_free(resources_allocation_info->alt_ser_req); + resources_allocation_info->alt_ser_req = NULL; } - OpenAPI_list_free(resources_allocation_info->flows); - ogs_free(resources_allocation_info->alt_ser_req); ogs_free(resources_allocation_info); } cJSON *OpenAPI_resources_allocation_info_convertToJSON(OpenAPI_resources_allocation_info_t *resources_allocation_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (resources_allocation_info == NULL) { ogs_error("OpenAPI_resources_allocation_info_convertToJSON() failed [ResourcesAllocationInfo]"); @@ -44,7 +52,7 @@ cJSON *OpenAPI_resources_allocation_info_convertToJSON(OpenAPI_resources_allocat } item = cJSON_CreateObject(); - if (resources_allocation_info->mc_resourc_status) { + if (resources_allocation_info->mc_resourc_status != OpenAPI_media_component_resources_status_NULL) { if (cJSON_AddStringToObject(item, "mcResourcStatus", OpenAPI_media_component_resources_status_ToString(resources_allocation_info->mc_resourc_status)) == NULL) { ogs_error("OpenAPI_resources_allocation_info_convertToJSON() failed [mc_resourc_status]"); goto end; @@ -57,17 +65,13 @@ cJSON *OpenAPI_resources_allocation_info_convertToJSON(OpenAPI_resources_allocat ogs_error("OpenAPI_resources_allocation_info_convertToJSON() failed [flows]"); goto end; } - - OpenAPI_lnode_t *flows_node; - if (resources_allocation_info->flows) { - OpenAPI_list_for_each(resources_allocation_info->flows, flows_node) { - cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_resources_allocation_info_convertToJSON() failed [flows]"); - goto end; - } - cJSON_AddItemToArray(flowsList, itemLocal); + OpenAPI_list_for_each(resources_allocation_info->flows, node) { + cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_resources_allocation_info_convertToJSON() failed [flows]"); + goto end; } + cJSON_AddItemToArray(flowsList, itemLocal); } } @@ -85,9 +89,13 @@ end: OpenAPI_resources_allocation_info_t *OpenAPI_resources_allocation_info_parseFromJSON(cJSON *resources_allocation_infoJSON) { OpenAPI_resources_allocation_info_t *resources_allocation_info_local_var = NULL; - cJSON *mc_resourc_status = cJSON_GetObjectItemCaseSensitive(resources_allocation_infoJSON, "mcResourcStatus"); - - OpenAPI_media_component_resources_status_e mc_resourc_statusVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *mc_resourc_status = NULL; + OpenAPI_media_component_resources_status_e mc_resourc_statusVariable = 0; + cJSON *flows = NULL; + OpenAPI_list_t *flowsList = NULL; + cJSON *alt_ser_req = NULL; + mc_resourc_status = cJSON_GetObjectItemCaseSensitive(resources_allocation_infoJSON, "mcResourcStatus"); if (mc_resourc_status) { if (!cJSON_IsString(mc_resourc_status)) { ogs_error("OpenAPI_resources_allocation_info_parseFromJSON() failed [mc_resourc_status]"); @@ -96,39 +104,34 @@ OpenAPI_resources_allocation_info_t *OpenAPI_resources_allocation_info_parseFrom mc_resourc_statusVariable = OpenAPI_media_component_resources_status_FromString(mc_resourc_status->valuestring); } - cJSON *flows = cJSON_GetObjectItemCaseSensitive(resources_allocation_infoJSON, "flows"); - - OpenAPI_list_t *flowsList; + flows = cJSON_GetObjectItemCaseSensitive(resources_allocation_infoJSON, "flows"); if (flows) { - cJSON *flows_local_nonprimitive; - if (!cJSON_IsArray(flows)){ - ogs_error("OpenAPI_resources_allocation_info_parseFromJSON() failed [flows]"); - goto end; - } - - flowsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(flows_local_nonprimitive, flows ) { - if (!cJSON_IsObject(flows_local_nonprimitive)) { + cJSON *flows_local = NULL; + if (!cJSON_IsArray(flows)) { ogs_error("OpenAPI_resources_allocation_info_parseFromJSON() failed [flows]"); goto end; } - OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive); - if (!flowsItem) { - ogs_error("No flowsItem"); - OpenAPI_list_free(flowsList); - goto end; + flowsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(flows_local, flows) { + if (!cJSON_IsObject(flows_local)) { + ogs_error("OpenAPI_resources_allocation_info_parseFromJSON() failed [flows]"); + goto end; + } + OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local); + if (!flowsItem) { + ogs_error("No flowsItem"); + OpenAPI_list_free(flowsList); + goto end; + } + OpenAPI_list_add(flowsList, flowsItem); } - - OpenAPI_list_add(flowsList, flowsItem); - } } - cJSON *alt_ser_req = cJSON_GetObjectItemCaseSensitive(resources_allocation_infoJSON, "altSerReq"); - + alt_ser_req = cJSON_GetObjectItemCaseSensitive(resources_allocation_infoJSON, "altSerReq"); if (alt_ser_req) { - if (!cJSON_IsString(alt_ser_req)) { + if (!cJSON_IsString(alt_ser_req) && !cJSON_IsNull(alt_ser_req)) { ogs_error("OpenAPI_resources_allocation_info_parseFromJSON() failed [alt_ser_req]"); goto end; } @@ -137,11 +140,18 @@ OpenAPI_resources_allocation_info_t *OpenAPI_resources_allocation_info_parseFrom resources_allocation_info_local_var = OpenAPI_resources_allocation_info_create ( mc_resourc_status ? mc_resourc_statusVariable : 0, flows ? flowsList : NULL, - alt_ser_req ? ogs_strdup(alt_ser_req->valuestring) : NULL + alt_ser_req && !cJSON_IsNull(alt_ser_req) ? ogs_strdup(alt_ser_req->valuestring) : NULL ); return resources_allocation_info_local_var; end: + if (flowsList) { + OpenAPI_list_for_each(flowsList, node) { + OpenAPI_flows_free(node->data); + } + OpenAPI_list_free(flowsList); + flowsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/resynchronization_info.c b/lib/sbi/openapi/model/resynchronization_info.c index 1a970f2fd..1655b4353 100644 --- a/lib/sbi/openapi/model/resynchronization_info.c +++ b/lib/sbi/openapi/model/resynchronization_info.c @@ -20,18 +20,26 @@ OpenAPI_resynchronization_info_t *OpenAPI_resynchronization_info_create( void OpenAPI_resynchronization_info_free(OpenAPI_resynchronization_info_t *resynchronization_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == resynchronization_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(resynchronization_info->rand); - ogs_free(resynchronization_info->auts); + if (resynchronization_info->rand) { + ogs_free(resynchronization_info->rand); + resynchronization_info->rand = NULL; + } + if (resynchronization_info->auts) { + ogs_free(resynchronization_info->auts); + resynchronization_info->auts = NULL; + } ogs_free(resynchronization_info); } cJSON *OpenAPI_resynchronization_info_convertToJSON(OpenAPI_resynchronization_info_t *resynchronization_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (resynchronization_info == NULL) { ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [ResynchronizationInfo]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_resynchronization_info_convertToJSON(OpenAPI_resynchronization_in } item = cJSON_CreateObject(); + if (!resynchronization_info->rand) { + ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [rand]"); + return NULL; + } if (cJSON_AddStringToObject(item, "rand", resynchronization_info->rand) == NULL) { ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [rand]"); goto end; } + if (!resynchronization_info->auts) { + ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [auts]"); + return NULL; + } if (cJSON_AddStringToObject(item, "auts", resynchronization_info->auts) == NULL) { ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [auts]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_resynchronization_info_t *OpenAPI_resynchronization_info_parseFromJSON(cJSON *resynchronization_infoJSON) { OpenAPI_resynchronization_info_t *resynchronization_info_local_var = NULL; - cJSON *rand = cJSON_GetObjectItemCaseSensitive(resynchronization_infoJSON, "rand"); + OpenAPI_lnode_t *node = NULL; + cJSON *rand = NULL; + cJSON *auts = NULL; + rand = cJSON_GetObjectItemCaseSensitive(resynchronization_infoJSON, "rand"); if (!rand) { ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [rand]"); goto end; } - if (!cJSON_IsString(rand)) { ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [rand]"); goto end; } - cJSON *auts = cJSON_GetObjectItemCaseSensitive(resynchronization_infoJSON, "auts"); + auts = cJSON_GetObjectItemCaseSensitive(resynchronization_infoJSON, "auts"); if (!auts) { ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [auts]"); goto end; } - if (!cJSON_IsString(auts)) { ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [auts]"); goto end; diff --git a/lib/sbi/openapi/model/retrieve_data.c b/lib/sbi/openapi/model/retrieve_data.c index 83faf4662..9223eefaf 100644 --- a/lib/sbi/openapi/model/retrieve_data.c +++ b/lib/sbi/openapi/model/retrieve_data.c @@ -20,16 +20,18 @@ OpenAPI_retrieve_data_t *OpenAPI_retrieve_data_create( void OpenAPI_retrieve_data_free(OpenAPI_retrieve_data_t *retrieve_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == retrieve_data) { return; } - OpenAPI_lnode_t *node; ogs_free(retrieve_data); } cJSON *OpenAPI_retrieve_data_convertToJSON(OpenAPI_retrieve_data_t *retrieve_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (retrieve_data == NULL) { ogs_error("OpenAPI_retrieve_data_convertToJSON() failed [RetrieveData]"); @@ -51,8 +53,9 @@ end: OpenAPI_retrieve_data_t *OpenAPI_retrieve_data_parseFromJSON(cJSON *retrieve_dataJSON) { OpenAPI_retrieve_data_t *retrieve_data_local_var = NULL; - cJSON *small_data_rate_status_req = cJSON_GetObjectItemCaseSensitive(retrieve_dataJSON, "smallDataRateStatusReq"); - + OpenAPI_lnode_t *node = NULL; + cJSON *small_data_rate_status_req = NULL; + small_data_rate_status_req = cJSON_GetObjectItemCaseSensitive(retrieve_dataJSON, "smallDataRateStatusReq"); if (small_data_rate_status_req) { if (!cJSON_IsBool(small_data_rate_status_req)) { ogs_error("OpenAPI_retrieve_data_parseFromJSON() failed [small_data_rate_status_req]"); diff --git a/lib/sbi/openapi/model/retrieved_data.c b/lib/sbi/openapi/model/retrieved_data.c index 23ea6cba9..a5c5d934a 100644 --- a/lib/sbi/openapi/model/retrieved_data.c +++ b/lib/sbi/openapi/model/retrieved_data.c @@ -18,17 +18,22 @@ OpenAPI_retrieved_data_t *OpenAPI_retrieved_data_create( void OpenAPI_retrieved_data_free(OpenAPI_retrieved_data_t *retrieved_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == retrieved_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_small_data_rate_status_free(retrieved_data->small_data_rate_status); + if (retrieved_data->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(retrieved_data->small_data_rate_status); + retrieved_data->small_data_rate_status = NULL; + } ogs_free(retrieved_data); } cJSON *OpenAPI_retrieved_data_convertToJSON(OpenAPI_retrieved_data_t *retrieved_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (retrieved_data == NULL) { ogs_error("OpenAPI_retrieved_data_convertToJSON() failed [RetrievedData]"); @@ -56,9 +61,10 @@ end: OpenAPI_retrieved_data_t *OpenAPI_retrieved_data_parseFromJSON(cJSON *retrieved_dataJSON) { OpenAPI_retrieved_data_t *retrieved_data_local_var = NULL; - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(retrieved_dataJSON, "smallDataRateStatus"); - + OpenAPI_lnode_t *node = NULL; + cJSON *small_data_rate_status = NULL; OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(retrieved_dataJSON, "smallDataRateStatus"); if (small_data_rate_status) { small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); } @@ -69,6 +75,10 @@ OpenAPI_retrieved_data_t *OpenAPI_retrieved_data_parseFromJSON(cJSON *retrieved_ return retrieved_data_local_var; end: + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/rg_auth_ctx.c b/lib/sbi/openapi/model/rg_auth_ctx.c index 7eae434e6..9f2788350 100644 --- a/lib/sbi/openapi/model/rg_auth_ctx.c +++ b/lib/sbi/openapi/model/rg_auth_ctx.c @@ -24,17 +24,22 @@ OpenAPI_rg_auth_ctx_t *OpenAPI_rg_auth_ctx_create( void OpenAPI_rg_auth_ctx_free(OpenAPI_rg_auth_ctx_t *rg_auth_ctx) { + OpenAPI_lnode_t *node = NULL; + if (NULL == rg_auth_ctx) { return; } - OpenAPI_lnode_t *node; - ogs_free(rg_auth_ctx->supi); + if (rg_auth_ctx->supi) { + ogs_free(rg_auth_ctx->supi); + rg_auth_ctx->supi = NULL; + } ogs_free(rg_auth_ctx); } cJSON *OpenAPI_rg_auth_ctx_convertToJSON(OpenAPI_rg_auth_ctx_t *rg_auth_ctx) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (rg_auth_ctx == NULL) { ogs_error("OpenAPI_rg_auth_ctx_convertToJSON() failed [RgAuthCtx]"); @@ -42,6 +47,10 @@ cJSON *OpenAPI_rg_auth_ctx_convertToJSON(OpenAPI_rg_auth_ctx_t *rg_auth_ctx) } item = cJSON_CreateObject(); + if (rg_auth_ctx->auth_result == OpenAPI_auth_result_NULL) { + ogs_error("OpenAPI_rg_auth_ctx_convertToJSON() failed [auth_result]"); + return NULL; + } if (cJSON_AddStringToObject(item, "authResult", OpenAPI_auth_result_ToString(rg_auth_ctx->auth_result)) == NULL) { ogs_error("OpenAPI_rg_auth_ctx_convertToJSON() failed [auth_result]"); goto end; @@ -68,30 +77,31 @@ end: OpenAPI_rg_auth_ctx_t *OpenAPI_rg_auth_ctx_parseFromJSON(cJSON *rg_auth_ctxJSON) { OpenAPI_rg_auth_ctx_t *rg_auth_ctx_local_var = NULL; - cJSON *auth_result = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "authResult"); + OpenAPI_lnode_t *node = NULL; + cJSON *auth_result = NULL; + OpenAPI_auth_result_e auth_resultVariable = 0; + cJSON *supi = NULL; + cJSON *auth_ind = NULL; + auth_result = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "authResult"); if (!auth_result) { ogs_error("OpenAPI_rg_auth_ctx_parseFromJSON() failed [auth_result]"); goto end; } - - OpenAPI_auth_result_e auth_resultVariable; if (!cJSON_IsString(auth_result)) { ogs_error("OpenAPI_rg_auth_ctx_parseFromJSON() failed [auth_result]"); goto end; } auth_resultVariable = OpenAPI_auth_result_FromString(auth_result->valuestring); - cJSON *supi = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_rg_auth_ctx_parseFromJSON() failed [supi]"); goto end; } } - cJSON *auth_ind = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "authInd"); - + auth_ind = cJSON_GetObjectItemCaseSensitive(rg_auth_ctxJSON, "authInd"); if (auth_ind) { if (!cJSON_IsBool(auth_ind)) { ogs_error("OpenAPI_rg_auth_ctx_parseFromJSON() failed [auth_ind]"); @@ -101,7 +111,7 @@ OpenAPI_rg_auth_ctx_t *OpenAPI_rg_auth_ctx_parseFromJSON(cJSON *rg_auth_ctxJSON) rg_auth_ctx_local_var = OpenAPI_rg_auth_ctx_create ( auth_resultVariable, - supi ? ogs_strdup(supi->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, auth_ind ? true : false, auth_ind ? auth_ind->valueint : 0 ); diff --git a/lib/sbi/openapi/model/rg_authentication_info.c b/lib/sbi/openapi/model/rg_authentication_info.c index 224de033a..3e240a583 100644 --- a/lib/sbi/openapi/model/rg_authentication_info.c +++ b/lib/sbi/openapi/model/rg_authentication_info.c @@ -22,18 +22,26 @@ OpenAPI_rg_authentication_info_t *OpenAPI_rg_authentication_info_create( void OpenAPI_rg_authentication_info_free(OpenAPI_rg_authentication_info_t *rg_authentication_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == rg_authentication_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(rg_authentication_info->suci); - ogs_free(rg_authentication_info->supported_features); + if (rg_authentication_info->suci) { + ogs_free(rg_authentication_info->suci); + rg_authentication_info->suci = NULL; + } + if (rg_authentication_info->supported_features) { + ogs_free(rg_authentication_info->supported_features); + rg_authentication_info->supported_features = NULL; + } ogs_free(rg_authentication_info); } cJSON *OpenAPI_rg_authentication_info_convertToJSON(OpenAPI_rg_authentication_info_t *rg_authentication_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (rg_authentication_info == NULL) { ogs_error("OpenAPI_rg_authentication_info_convertToJSON() failed [RgAuthenticationInfo]"); @@ -41,6 +49,10 @@ cJSON *OpenAPI_rg_authentication_info_convertToJSON(OpenAPI_rg_authentication_in } item = cJSON_CreateObject(); + if (!rg_authentication_info->suci) { + ogs_error("OpenAPI_rg_authentication_info_convertToJSON() failed [suci]"); + return NULL; + } if (cJSON_AddStringToObject(item, "suci", rg_authentication_info->suci) == NULL) { ogs_error("OpenAPI_rg_authentication_info_convertToJSON() failed [suci]"); goto end; @@ -65,32 +77,33 @@ end: OpenAPI_rg_authentication_info_t *OpenAPI_rg_authentication_info_parseFromJSON(cJSON *rg_authentication_infoJSON) { OpenAPI_rg_authentication_info_t *rg_authentication_info_local_var = NULL; - cJSON *suci = cJSON_GetObjectItemCaseSensitive(rg_authentication_infoJSON, "suci"); + OpenAPI_lnode_t *node = NULL; + cJSON *suci = NULL; + cJSON *authenticated_ind = NULL; + cJSON *supported_features = NULL; + suci = cJSON_GetObjectItemCaseSensitive(rg_authentication_infoJSON, "suci"); if (!suci) { ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [suci]"); goto end; } - if (!cJSON_IsString(suci)) { ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [suci]"); goto end; } - cJSON *authenticated_ind = cJSON_GetObjectItemCaseSensitive(rg_authentication_infoJSON, "authenticatedInd"); + authenticated_ind = cJSON_GetObjectItemCaseSensitive(rg_authentication_infoJSON, "authenticatedInd"); if (!authenticated_ind) { ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [authenticated_ind]"); goto end; } - if (!cJSON_IsBool(authenticated_ind)) { ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [authenticated_ind]"); goto end; } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(rg_authentication_infoJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(rg_authentication_infoJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_rg_authentication_info_parseFromJSON() failed [supported_features]"); goto end; } @@ -100,7 +113,7 @@ OpenAPI_rg_authentication_info_t *OpenAPI_rg_authentication_info_parseFromJSON(c ogs_strdup(suci->valuestring), authenticated_ind->valueint, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return rg_authentication_info_local_var; diff --git a/lib/sbi/openapi/model/rm_info.c b/lib/sbi/openapi/model/rm_info.c index a55dadec0..18bdf577c 100644 --- a/lib/sbi/openapi/model/rm_info.c +++ b/lib/sbi/openapi/model/rm_info.c @@ -20,17 +20,22 @@ OpenAPI_rm_info_t *OpenAPI_rm_info_create( void OpenAPI_rm_info_free(OpenAPI_rm_info_t *rm_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == rm_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_rm_state_free(rm_info->rm_state); + if (rm_info->rm_state) { + OpenAPI_rm_state_free(rm_info->rm_state); + rm_info->rm_state = NULL; + } ogs_free(rm_info); } cJSON *OpenAPI_rm_info_convertToJSON(OpenAPI_rm_info_t *rm_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (rm_info == NULL) { ogs_error("OpenAPI_rm_info_convertToJSON() failed [RmInfo]"); @@ -38,6 +43,10 @@ cJSON *OpenAPI_rm_info_convertToJSON(OpenAPI_rm_info_t *rm_info) } item = cJSON_CreateObject(); + if (!rm_info->rm_state) { + ogs_error("OpenAPI_rm_info_convertToJSON() failed [rm_state]"); + return NULL; + } cJSON *rm_state_local_JSON = OpenAPI_rm_state_convertToJSON(rm_info->rm_state); if (rm_state_local_JSON == NULL) { ogs_error("OpenAPI_rm_info_convertToJSON() failed [rm_state]"); @@ -49,6 +58,10 @@ cJSON *OpenAPI_rm_info_convertToJSON(OpenAPI_rm_info_t *rm_info) goto end; } + if (rm_info->access_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_rm_info_convertToJSON() failed [access_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(rm_info->access_type)) == NULL) { ogs_error("OpenAPI_rm_info_convertToJSON() failed [access_type]"); goto end; @@ -61,22 +74,23 @@ end: OpenAPI_rm_info_t *OpenAPI_rm_info_parseFromJSON(cJSON *rm_infoJSON) { OpenAPI_rm_info_t *rm_info_local_var = NULL; - cJSON *rm_state = cJSON_GetObjectItemCaseSensitive(rm_infoJSON, "rmState"); + OpenAPI_lnode_t *node = NULL; + cJSON *rm_state = NULL; + OpenAPI_rm_state_t *rm_state_local_nonprim = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + rm_state = cJSON_GetObjectItemCaseSensitive(rm_infoJSON, "rmState"); if (!rm_state) { ogs_error("OpenAPI_rm_info_parseFromJSON() failed [rm_state]"); goto end; } - - OpenAPI_rm_state_t *rm_state_local_nonprim = NULL; rm_state_local_nonprim = OpenAPI_rm_state_parseFromJSON(rm_state); - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(rm_infoJSON, "accessType"); + access_type = cJSON_GetObjectItemCaseSensitive(rm_infoJSON, "accessType"); if (!access_type) { ogs_error("OpenAPI_rm_info_parseFromJSON() failed [access_type]"); goto end; } - - OpenAPI_access_type_e access_typeVariable; if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_rm_info_parseFromJSON() failed [access_type]"); goto end; @@ -90,6 +104,10 @@ OpenAPI_rm_info_t *OpenAPI_rm_info_parseFromJSON(cJSON *rm_infoJSON) return rm_info_local_var; end: + if (rm_state_local_nonprim) { + OpenAPI_rm_state_free(rm_state_local_nonprim); + rm_state_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/rm_state.c b/lib/sbi/openapi/model/rm_state.c index 065608cb7..e9f8f87b4 100644 --- a/lib/sbi/openapi/model/rm_state.c +++ b/lib/sbi/openapi/model/rm_state.c @@ -16,16 +16,18 @@ OpenAPI_rm_state_t *OpenAPI_rm_state_create( void OpenAPI_rm_state_free(OpenAPI_rm_state_t *rm_state) { + OpenAPI_lnode_t *node = NULL; + if (NULL == rm_state) { return; } - OpenAPI_lnode_t *node; ogs_free(rm_state); } cJSON *OpenAPI_rm_state_convertToJSON(OpenAPI_rm_state_t *rm_state) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (rm_state == NULL) { ogs_error("OpenAPI_rm_state_convertToJSON() failed [RmState]"); @@ -40,6 +42,7 @@ end: OpenAPI_rm_state_t *OpenAPI_rm_state_parseFromJSON(cJSON *rm_stateJSON) { OpenAPI_rm_state_t *rm_state_local_var = NULL; + OpenAPI_lnode_t *node = NULL; rm_state_local_var = OpenAPI_rm_state_create ( ); diff --git a/lib/sbi/openapi/model/roaming_charging_profile.c b/lib/sbi/openapi/model/roaming_charging_profile.c index 47c087615..065200ea1 100644 --- a/lib/sbi/openapi/model/roaming_charging_profile.c +++ b/lib/sbi/openapi/model/roaming_charging_profile.c @@ -20,21 +20,29 @@ OpenAPI_roaming_charging_profile_t *OpenAPI_roaming_charging_profile_create( void OpenAPI_roaming_charging_profile_free(OpenAPI_roaming_charging_profile_t *roaming_charging_profile) { + OpenAPI_lnode_t *node = NULL; + if (NULL == roaming_charging_profile) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(roaming_charging_profile->triggers, node) { - OpenAPI_trigger_free(node->data); + if (roaming_charging_profile->triggers) { + OpenAPI_list_for_each(roaming_charging_profile->triggers, node) { + OpenAPI_trigger_free(node->data); + } + OpenAPI_list_free(roaming_charging_profile->triggers); + roaming_charging_profile->triggers = NULL; + } + if (roaming_charging_profile->partial_record_method) { + OpenAPI_partial_record_method_free(roaming_charging_profile->partial_record_method); + roaming_charging_profile->partial_record_method = NULL; } - OpenAPI_list_free(roaming_charging_profile->triggers); - OpenAPI_partial_record_method_free(roaming_charging_profile->partial_record_method); ogs_free(roaming_charging_profile); } cJSON *OpenAPI_roaming_charging_profile_convertToJSON(OpenAPI_roaming_charging_profile_t *roaming_charging_profile) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (roaming_charging_profile == NULL) { ogs_error("OpenAPI_roaming_charging_profile_convertToJSON() failed [RoamingChargingProfile]"); @@ -48,17 +56,13 @@ cJSON *OpenAPI_roaming_charging_profile_convertToJSON(OpenAPI_roaming_charging_p ogs_error("OpenAPI_roaming_charging_profile_convertToJSON() failed [triggers]"); goto end; } - - OpenAPI_lnode_t *triggers_node; - if (roaming_charging_profile->triggers) { - OpenAPI_list_for_each(roaming_charging_profile->triggers, triggers_node) { - cJSON *itemLocal = OpenAPI_trigger_convertToJSON(triggers_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_roaming_charging_profile_convertToJSON() failed [triggers]"); - goto end; - } - cJSON_AddItemToArray(triggersList, itemLocal); + OpenAPI_list_for_each(roaming_charging_profile->triggers, node) { + cJSON *itemLocal = OpenAPI_trigger_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_roaming_charging_profile_convertToJSON() failed [triggers]"); + goto end; } + cJSON_AddItemToArray(triggersList, itemLocal); } } @@ -82,38 +86,37 @@ end: OpenAPI_roaming_charging_profile_t *OpenAPI_roaming_charging_profile_parseFromJSON(cJSON *roaming_charging_profileJSON) { OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_var = NULL; - cJSON *triggers = cJSON_GetObjectItemCaseSensitive(roaming_charging_profileJSON, "triggers"); - - OpenAPI_list_t *triggersList; + OpenAPI_lnode_t *node = NULL; + cJSON *triggers = NULL; + OpenAPI_list_t *triggersList = NULL; + cJSON *partial_record_method = NULL; + OpenAPI_partial_record_method_t *partial_record_method_local_nonprim = NULL; + triggers = cJSON_GetObjectItemCaseSensitive(roaming_charging_profileJSON, "triggers"); if (triggers) { - cJSON *triggers_local_nonprimitive; - if (!cJSON_IsArray(triggers)){ - ogs_error("OpenAPI_roaming_charging_profile_parseFromJSON() failed [triggers]"); - goto end; - } - - triggersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(triggers_local_nonprimitive, triggers ) { - if (!cJSON_IsObject(triggers_local_nonprimitive)) { + cJSON *triggers_local = NULL; + if (!cJSON_IsArray(triggers)) { ogs_error("OpenAPI_roaming_charging_profile_parseFromJSON() failed [triggers]"); goto end; } - OpenAPI_trigger_t *triggersItem = OpenAPI_trigger_parseFromJSON(triggers_local_nonprimitive); - if (!triggersItem) { - ogs_error("No triggersItem"); - OpenAPI_list_free(triggersList); - goto end; + triggersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(triggers_local, triggers) { + if (!cJSON_IsObject(triggers_local)) { + ogs_error("OpenAPI_roaming_charging_profile_parseFromJSON() failed [triggers]"); + goto end; + } + OpenAPI_trigger_t *triggersItem = OpenAPI_trigger_parseFromJSON(triggers_local); + if (!triggersItem) { + ogs_error("No triggersItem"); + OpenAPI_list_free(triggersList); + goto end; + } + OpenAPI_list_add(triggersList, triggersItem); } - - OpenAPI_list_add(triggersList, triggersItem); - } } - cJSON *partial_record_method = cJSON_GetObjectItemCaseSensitive(roaming_charging_profileJSON, "partialRecordMethod"); - - OpenAPI_partial_record_method_t *partial_record_method_local_nonprim = NULL; + partial_record_method = cJSON_GetObjectItemCaseSensitive(roaming_charging_profileJSON, "partialRecordMethod"); if (partial_record_method) { partial_record_method_local_nonprim = OpenAPI_partial_record_method_parseFromJSON(partial_record_method); } @@ -125,6 +128,17 @@ OpenAPI_roaming_charging_profile_t *OpenAPI_roaming_charging_profile_parseFromJS return roaming_charging_profile_local_var; end: + if (triggersList) { + OpenAPI_list_for_each(triggersList, node) { + OpenAPI_trigger_free(node->data); + } + OpenAPI_list_free(triggersList); + triggersList = NULL; + } + if (partial_record_method_local_nonprim) { + OpenAPI_partial_record_method_free(partial_record_method_local_nonprim); + partial_record_method_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/route_information.c b/lib/sbi/openapi/model/route_information.c index cc1f7b026..95387a4fd 100644 --- a/lib/sbi/openapi/model/route_information.c +++ b/lib/sbi/openapi/model/route_information.c @@ -22,18 +22,26 @@ OpenAPI_route_information_t *OpenAPI_route_information_create( void OpenAPI_route_information_free(OpenAPI_route_information_t *route_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == route_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(route_information->ipv4_addr); - ogs_free(route_information->ipv6_addr); + if (route_information->ipv4_addr) { + ogs_free(route_information->ipv4_addr); + route_information->ipv4_addr = NULL; + } + if (route_information->ipv6_addr) { + ogs_free(route_information->ipv6_addr); + route_information->ipv6_addr = NULL; + } ogs_free(route_information); } cJSON *OpenAPI_route_information_convertToJSON(OpenAPI_route_information_t *route_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (route_information == NULL) { ogs_error("OpenAPI_route_information_convertToJSON() failed [RouteInformation]"); @@ -67,38 +75,39 @@ end: OpenAPI_route_information_t *OpenAPI_route_information_parseFromJSON(cJSON *route_informationJSON) { OpenAPI_route_information_t *route_information_local_var = NULL; - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "ipv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ipv6_addr = NULL; + cJSON *port_number = NULL; + ipv4_addr = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_route_information_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "ipv6Addr"); - + ipv6_addr = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "ipv6Addr"); if (ipv6_addr) { - if (!cJSON_IsString(ipv6_addr)) { + if (!cJSON_IsString(ipv6_addr) && !cJSON_IsNull(ipv6_addr)) { ogs_error("OpenAPI_route_information_parseFromJSON() failed [ipv6_addr]"); goto end; } } - cJSON *port_number = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "portNumber"); + port_number = cJSON_GetObjectItemCaseSensitive(route_informationJSON, "portNumber"); if (!port_number) { ogs_error("OpenAPI_route_information_parseFromJSON() failed [port_number]"); goto end; } - if (!cJSON_IsNumber(port_number)) { ogs_error("OpenAPI_route_information_parseFromJSON() failed [port_number]"); goto end; } route_information_local_var = OpenAPI_route_information_create ( - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, - ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr && !cJSON_IsNull(ipv6_addr) ? ogs_strdup(ipv6_addr->valuestring) : NULL, port_number->valuedouble ); diff --git a/lib/sbi/openapi/model/route_to_location.c b/lib/sbi/openapi/model/route_to_location.c index d495b370a..94eede3d4 100644 --- a/lib/sbi/openapi/model/route_to_location.c +++ b/lib/sbi/openapi/model/route_to_location.c @@ -22,19 +22,30 @@ OpenAPI_route_to_location_t *OpenAPI_route_to_location_create( void OpenAPI_route_to_location_free(OpenAPI_route_to_location_t *route_to_location) { + OpenAPI_lnode_t *node = NULL; + if (NULL == route_to_location) { return; } - OpenAPI_lnode_t *node; - ogs_free(route_to_location->dnai); - OpenAPI_route_information_free(route_to_location->route_info); - ogs_free(route_to_location->route_prof_id); + if (route_to_location->dnai) { + ogs_free(route_to_location->dnai); + route_to_location->dnai = NULL; + } + if (route_to_location->route_info) { + OpenAPI_route_information_free(route_to_location->route_info); + route_to_location->route_info = NULL; + } + if (route_to_location->route_prof_id) { + ogs_free(route_to_location->route_prof_id); + route_to_location->route_prof_id = NULL; + } ogs_free(route_to_location); } cJSON *OpenAPI_route_to_location_convertToJSON(OpenAPI_route_to_location_t *route_to_location) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (route_to_location == NULL) { ogs_error("OpenAPI_route_to_location_convertToJSON() failed [RouteToLocation]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_route_to_location_convertToJSON(OpenAPI_route_to_location_t *rout } item = cJSON_CreateObject(); + if (!route_to_location->dnai) { + ogs_error("OpenAPI_route_to_location_convertToJSON() failed [dnai]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnai", route_to_location->dnai) == NULL) { ogs_error("OpenAPI_route_to_location_convertToJSON() failed [dnai]"); goto end; @@ -74,28 +89,29 @@ end: OpenAPI_route_to_location_t *OpenAPI_route_to_location_parseFromJSON(cJSON *route_to_locationJSON) { OpenAPI_route_to_location_t *route_to_location_local_var = NULL; - cJSON *dnai = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "dnai"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnai = NULL; + cJSON *route_info = NULL; + OpenAPI_route_information_t *route_info_local_nonprim = NULL; + cJSON *route_prof_id = NULL; + dnai = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "dnai"); if (!dnai) { ogs_error("OpenAPI_route_to_location_parseFromJSON() failed [dnai]"); goto end; } - if (!cJSON_IsString(dnai)) { ogs_error("OpenAPI_route_to_location_parseFromJSON() failed [dnai]"); goto end; } - cJSON *route_info = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "routeInfo"); - - OpenAPI_route_information_t *route_info_local_nonprim = NULL; + route_info = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "routeInfo"); if (route_info) { route_info_local_nonprim = OpenAPI_route_information_parseFromJSON(route_info); } - cJSON *route_prof_id = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "routeProfId"); - + route_prof_id = cJSON_GetObjectItemCaseSensitive(route_to_locationJSON, "routeProfId"); if (route_prof_id) { - if (!cJSON_IsString(route_prof_id)) { + if (!cJSON_IsString(route_prof_id) && !cJSON_IsNull(route_prof_id)) { ogs_error("OpenAPI_route_to_location_parseFromJSON() failed [route_prof_id]"); goto end; } @@ -104,11 +120,15 @@ OpenAPI_route_to_location_t *OpenAPI_route_to_location_parseFromJSON(cJSON *rout route_to_location_local_var = OpenAPI_route_to_location_create ( ogs_strdup(dnai->valuestring), route_info ? route_info_local_nonprim : NULL, - route_prof_id ? ogs_strdup(route_prof_id->valuestring) : NULL + route_prof_id && !cJSON_IsNull(route_prof_id) ? ogs_strdup(route_prof_id->valuestring) : NULL ); return route_to_location_local_var; end: + if (route_info_local_nonprim) { + OpenAPI_route_information_free(route_info_local_nonprim); + route_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/rule_report.c b/lib/sbi/openapi/model/rule_report.c index 33720ed3e..818ba5639 100644 --- a/lib/sbi/openapi/model/rule_report.c +++ b/lib/sbi/openapi/model/rule_report.c @@ -28,29 +28,43 @@ OpenAPI_rule_report_t *OpenAPI_rule_report_create( void OpenAPI_rule_report_free(OpenAPI_rule_report_t *rule_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == rule_report) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(rule_report->pcc_rule_ids, node) { - ogs_free(node->data); + if (rule_report->pcc_rule_ids) { + OpenAPI_list_for_each(rule_report->pcc_rule_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(rule_report->pcc_rule_ids); + rule_report->pcc_rule_ids = NULL; } - OpenAPI_list_free(rule_report->pcc_rule_ids); - OpenAPI_list_for_each(rule_report->cont_vers, node) { - ogs_free(node->data); + if (rule_report->cont_vers) { + OpenAPI_list_for_each(rule_report->cont_vers, node) { + ogs_free(node->data); + } + OpenAPI_list_free(rule_report->cont_vers); + rule_report->cont_vers = NULL; } - OpenAPI_list_free(rule_report->cont_vers); - OpenAPI_final_unit_action_free(rule_report->fin_unit_act); - OpenAPI_list_for_each(rule_report->ran_nas_rel_causes, node) { - OpenAPI_ran_nas_rel_cause_free(node->data); + if (rule_report->fin_unit_act) { + OpenAPI_final_unit_action_free(rule_report->fin_unit_act); + rule_report->fin_unit_act = NULL; + } + if (rule_report->ran_nas_rel_causes) { + OpenAPI_list_for_each(rule_report->ran_nas_rel_causes, node) { + OpenAPI_ran_nas_rel_cause_free(node->data); + } + OpenAPI_list_free(rule_report->ran_nas_rel_causes); + rule_report->ran_nas_rel_causes = NULL; } - OpenAPI_list_free(rule_report->ran_nas_rel_causes); ogs_free(rule_report); } cJSON *OpenAPI_rule_report_convertToJSON(OpenAPI_rule_report_t *rule_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (rule_report == NULL) { ogs_error("OpenAPI_rule_report_convertToJSON() failed [RuleReport]"); @@ -58,42 +72,46 @@ cJSON *OpenAPI_rule_report_convertToJSON(OpenAPI_rule_report_t *rule_report) } item = cJSON_CreateObject(); - cJSON *pcc_rule_ids = cJSON_AddArrayToObject(item, "pccRuleIds"); - if (pcc_rule_ids == NULL) { + if (!rule_report->pcc_rule_ids) { + ogs_error("OpenAPI_rule_report_convertToJSON() failed [pcc_rule_ids]"); + return NULL; + } + cJSON *pcc_rule_idsList = cJSON_AddArrayToObject(item, "pccRuleIds"); + if (pcc_rule_idsList == NULL) { ogs_error("OpenAPI_rule_report_convertToJSON() failed [pcc_rule_ids]"); goto end; } - - OpenAPI_lnode_t *pcc_rule_ids_node; - OpenAPI_list_for_each(rule_report->pcc_rule_ids, pcc_rule_ids_node) { - if (cJSON_AddStringToObject(pcc_rule_ids, "", (char*)pcc_rule_ids_node->data) == NULL) { - ogs_error("OpenAPI_rule_report_convertToJSON() failed [pcc_rule_ids]"); - goto end; + OpenAPI_list_for_each(rule_report->pcc_rule_ids, node) { + if (cJSON_AddStringToObject(pcc_rule_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_rule_report_convertToJSON() failed [pcc_rule_ids]"); + goto end; + } } - } + if (rule_report->rule_status == OpenAPI_rule_status_NULL) { + ogs_error("OpenAPI_rule_report_convertToJSON() failed [rule_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ruleStatus", OpenAPI_rule_status_ToString(rule_report->rule_status)) == NULL) { ogs_error("OpenAPI_rule_report_convertToJSON() failed [rule_status]"); goto end; } if (rule_report->cont_vers) { - cJSON *cont_vers = cJSON_AddArrayToObject(item, "contVers"); - if (cont_vers == NULL) { + cJSON *cont_versList = cJSON_AddArrayToObject(item, "contVers"); + if (cont_versList == NULL) { ogs_error("OpenAPI_rule_report_convertToJSON() failed [cont_vers]"); goto end; } - - OpenAPI_lnode_t *cont_vers_node; - OpenAPI_list_for_each(rule_report->cont_vers, cont_vers_node) { - if (cJSON_AddNumberToObject(cont_vers, "", *(double *)cont_vers_node->data) == NULL) { - ogs_error("OpenAPI_rule_report_convertToJSON() failed [cont_vers]"); - goto end; + OpenAPI_list_for_each(rule_report->cont_vers, node) { + if (cJSON_AddNumberToObject(cont_versList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_rule_report_convertToJSON() failed [cont_vers]"); + goto end; + } } - } } - if (rule_report->failure_code) { + if (rule_report->failure_code != OpenAPI_failure_code_NULL) { if (cJSON_AddStringToObject(item, "failureCode", OpenAPI_failure_code_ToString(rule_report->failure_code)) == NULL) { ogs_error("OpenAPI_rule_report_convertToJSON() failed [failure_code]"); goto end; @@ -119,17 +137,13 @@ cJSON *OpenAPI_rule_report_convertToJSON(OpenAPI_rule_report_t *rule_report) ogs_error("OpenAPI_rule_report_convertToJSON() failed [ran_nas_rel_causes]"); goto end; } - - OpenAPI_lnode_t *ran_nas_rel_causes_node; - if (rule_report->ran_nas_rel_causes) { - OpenAPI_list_for_each(rule_report->ran_nas_rel_causes, ran_nas_rel_causes_node) { - cJSON *itemLocal = OpenAPI_ran_nas_rel_cause_convertToJSON(ran_nas_rel_causes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_rule_report_convertToJSON() failed [ran_nas_rel_causes]"); - goto end; - } - cJSON_AddItemToArray(ran_nas_rel_causesList, itemLocal); + OpenAPI_list_for_each(rule_report->ran_nas_rel_causes, node) { + cJSON *itemLocal = OpenAPI_ran_nas_rel_cause_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_rule_report_convertToJSON() failed [ran_nas_rel_causes]"); + goto end; } + cJSON_AddItemToArray(ran_nas_rel_causesList, itemLocal); } } @@ -140,64 +154,81 @@ end: OpenAPI_rule_report_t *OpenAPI_rule_report_parseFromJSON(cJSON *rule_reportJSON) { OpenAPI_rule_report_t *rule_report_local_var = NULL; - cJSON *pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "pccRuleIds"); + OpenAPI_lnode_t *node = NULL; + cJSON *pcc_rule_ids = NULL; + OpenAPI_list_t *pcc_rule_idsList = NULL; + cJSON *rule_status = NULL; + OpenAPI_rule_status_e rule_statusVariable = 0; + cJSON *cont_vers = NULL; + OpenAPI_list_t *cont_versList = NULL; + cJSON *failure_code = NULL; + OpenAPI_failure_code_e failure_codeVariable = 0; + cJSON *fin_unit_act = NULL; + OpenAPI_final_unit_action_t *fin_unit_act_local_nonprim = NULL; + cJSON *ran_nas_rel_causes = NULL; + OpenAPI_list_t *ran_nas_rel_causesList = NULL; + pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "pccRuleIds"); if (!pcc_rule_ids) { ogs_error("OpenAPI_rule_report_parseFromJSON() failed [pcc_rule_ids]"); goto end; } + cJSON *pcc_rule_ids_local = NULL; + if (!cJSON_IsArray(pcc_rule_ids)) { + ogs_error("OpenAPI_rule_report_parseFromJSON() failed [pcc_rule_ids]"); + goto end; + } - OpenAPI_list_t *pcc_rule_idsList; - cJSON *pcc_rule_ids_local; - if (!cJSON_IsArray(pcc_rule_ids)) { - ogs_error("OpenAPI_rule_report_parseFromJSON() failed [pcc_rule_ids]"); - goto end; - } - pcc_rule_idsList = OpenAPI_list_create(); + pcc_rule_idsList = OpenAPI_list_create(); - cJSON_ArrayForEach(pcc_rule_ids_local, pcc_rule_ids) { - if (!cJSON_IsString(pcc_rule_ids_local)) { - ogs_error("OpenAPI_rule_report_parseFromJSON() failed [pcc_rule_ids]"); - goto end; - } - OpenAPI_list_add(pcc_rule_idsList, ogs_strdup(pcc_rule_ids_local->valuestring)); - } + cJSON_ArrayForEach(pcc_rule_ids_local, pcc_rule_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(pcc_rule_ids_local)) { + ogs_error("OpenAPI_rule_report_parseFromJSON() failed [pcc_rule_ids]"); + goto end; + } + OpenAPI_list_add(pcc_rule_idsList, ogs_strdup(pcc_rule_ids_local->valuestring)); + } - cJSON *rule_status = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "ruleStatus"); + rule_status = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "ruleStatus"); if (!rule_status) { ogs_error("OpenAPI_rule_report_parseFromJSON() failed [rule_status]"); goto end; } - - OpenAPI_rule_status_e rule_statusVariable; if (!cJSON_IsString(rule_status)) { ogs_error("OpenAPI_rule_report_parseFromJSON() failed [rule_status]"); goto end; } rule_statusVariable = OpenAPI_rule_status_FromString(rule_status->valuestring); - cJSON *cont_vers = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "contVers"); - - OpenAPI_list_t *cont_versList; + cont_vers = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "contVers"); if (cont_vers) { - cJSON *cont_vers_local; - if (!cJSON_IsArray(cont_vers)) { - ogs_error("OpenAPI_rule_report_parseFromJSON() failed [cont_vers]"); - goto end; - } - cont_versList = OpenAPI_list_create(); + cJSON *cont_vers_local = NULL; + if (!cJSON_IsArray(cont_vers)) { + ogs_error("OpenAPI_rule_report_parseFromJSON() failed [cont_vers]"); + goto end; + } - cJSON_ArrayForEach(cont_vers_local, cont_vers) { - if (!cJSON_IsNumber(cont_vers_local)) { - ogs_error("OpenAPI_rule_report_parseFromJSON() failed [cont_vers]"); - goto end; - } - OpenAPI_list_add(cont_versList, &cont_vers_local->valuedouble); - } + cont_versList = OpenAPI_list_create(); + + cJSON_ArrayForEach(cont_vers_local, cont_vers) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(cont_vers_local)) { + ogs_error("OpenAPI_rule_report_parseFromJSON() failed [cont_vers]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_rule_report_parseFromJSON() failed [cont_vers]"); + goto end; + } + *localDouble = cont_vers_local->valuedouble; + OpenAPI_list_add(cont_versList, localDouble); + } } - cJSON *failure_code = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "failureCode"); - - OpenAPI_failure_code_e failure_codeVariable; + failure_code = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "failureCode"); if (failure_code) { if (!cJSON_IsString(failure_code)) { ogs_error("OpenAPI_rule_report_parseFromJSON() failed [failure_code]"); @@ -206,40 +237,34 @@ OpenAPI_rule_report_t *OpenAPI_rule_report_parseFromJSON(cJSON *rule_reportJSON) failure_codeVariable = OpenAPI_failure_code_FromString(failure_code->valuestring); } - cJSON *fin_unit_act = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "finUnitAct"); - - OpenAPI_final_unit_action_t *fin_unit_act_local_nonprim = NULL; + fin_unit_act = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "finUnitAct"); if (fin_unit_act) { fin_unit_act_local_nonprim = OpenAPI_final_unit_action_parseFromJSON(fin_unit_act); } - cJSON *ran_nas_rel_causes = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "ranNasRelCauses"); - - OpenAPI_list_t *ran_nas_rel_causesList; + ran_nas_rel_causes = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "ranNasRelCauses"); if (ran_nas_rel_causes) { - cJSON *ran_nas_rel_causes_local_nonprimitive; - if (!cJSON_IsArray(ran_nas_rel_causes)){ - ogs_error("OpenAPI_rule_report_parseFromJSON() failed [ran_nas_rel_causes]"); - goto end; - } - - ran_nas_rel_causesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ran_nas_rel_causes_local_nonprimitive, ran_nas_rel_causes ) { - if (!cJSON_IsObject(ran_nas_rel_causes_local_nonprimitive)) { + cJSON *ran_nas_rel_causes_local = NULL; + if (!cJSON_IsArray(ran_nas_rel_causes)) { ogs_error("OpenAPI_rule_report_parseFromJSON() failed [ran_nas_rel_causes]"); goto end; } - OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_causesItem = OpenAPI_ran_nas_rel_cause_parseFromJSON(ran_nas_rel_causes_local_nonprimitive); - if (!ran_nas_rel_causesItem) { - ogs_error("No ran_nas_rel_causesItem"); - OpenAPI_list_free(ran_nas_rel_causesList); - goto end; + ran_nas_rel_causesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ran_nas_rel_causes_local, ran_nas_rel_causes) { + if (!cJSON_IsObject(ran_nas_rel_causes_local)) { + ogs_error("OpenAPI_rule_report_parseFromJSON() failed [ran_nas_rel_causes]"); + goto end; + } + OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_causesItem = OpenAPI_ran_nas_rel_cause_parseFromJSON(ran_nas_rel_causes_local); + if (!ran_nas_rel_causesItem) { + ogs_error("No ran_nas_rel_causesItem"); + OpenAPI_list_free(ran_nas_rel_causesList); + goto end; + } + OpenAPI_list_add(ran_nas_rel_causesList, ran_nas_rel_causesItem); } - - OpenAPI_list_add(ran_nas_rel_causesList, ran_nas_rel_causesItem); - } } rule_report_local_var = OpenAPI_rule_report_create ( @@ -253,6 +278,31 @@ OpenAPI_rule_report_t *OpenAPI_rule_report_parseFromJSON(cJSON *rule_reportJSON) return rule_report_local_var; end: + if (pcc_rule_idsList) { + OpenAPI_list_for_each(pcc_rule_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pcc_rule_idsList); + pcc_rule_idsList = NULL; + } + if (cont_versList) { + OpenAPI_list_for_each(cont_versList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(cont_versList); + cont_versList = NULL; + } + if (fin_unit_act_local_nonprim) { + OpenAPI_final_unit_action_free(fin_unit_act_local_nonprim); + fin_unit_act_local_nonprim = NULL; + } + if (ran_nas_rel_causesList) { + OpenAPI_list_for_each(ran_nas_rel_causesList, node) { + OpenAPI_ran_nas_rel_cause_free(node->data); + } + OpenAPI_list_free(ran_nas_rel_causesList); + ran_nas_rel_causesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/scheduled_communication_time.c b/lib/sbi/openapi/model/scheduled_communication_time.c index df4f1d070..3a03412f2 100644 --- a/lib/sbi/openapi/model/scheduled_communication_time.c +++ b/lib/sbi/openapi/model/scheduled_communication_time.c @@ -22,22 +22,33 @@ OpenAPI_scheduled_communication_time_t *OpenAPI_scheduled_communication_time_cre void OpenAPI_scheduled_communication_time_free(OpenAPI_scheduled_communication_time_t *scheduled_communication_time) { + OpenAPI_lnode_t *node = NULL; + if (NULL == scheduled_communication_time) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(scheduled_communication_time->days_of_week, node) { - ogs_free(node->data); + if (scheduled_communication_time->days_of_week) { + OpenAPI_list_for_each(scheduled_communication_time->days_of_week, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scheduled_communication_time->days_of_week); + scheduled_communication_time->days_of_week = NULL; + } + if (scheduled_communication_time->time_of_day_start) { + ogs_free(scheduled_communication_time->time_of_day_start); + scheduled_communication_time->time_of_day_start = NULL; + } + if (scheduled_communication_time->time_of_day_end) { + ogs_free(scheduled_communication_time->time_of_day_end); + scheduled_communication_time->time_of_day_end = NULL; } - OpenAPI_list_free(scheduled_communication_time->days_of_week); - ogs_free(scheduled_communication_time->time_of_day_start); - ogs_free(scheduled_communication_time->time_of_day_end); ogs_free(scheduled_communication_time); } cJSON *OpenAPI_scheduled_communication_time_convertToJSON(OpenAPI_scheduled_communication_time_t *scheduled_communication_time) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (scheduled_communication_time == NULL) { ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [ScheduledCommunicationTime]"); @@ -46,19 +57,17 @@ cJSON *OpenAPI_scheduled_communication_time_convertToJSON(OpenAPI_scheduled_comm item = cJSON_CreateObject(); if (scheduled_communication_time->days_of_week) { - cJSON *days_of_week = cJSON_AddArrayToObject(item, "daysOfWeek"); - if (days_of_week == NULL) { + cJSON *days_of_weekList = cJSON_AddArrayToObject(item, "daysOfWeek"); + if (days_of_weekList == NULL) { ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [days_of_week]"); goto end; } - - OpenAPI_lnode_t *days_of_week_node; - OpenAPI_list_for_each(scheduled_communication_time->days_of_week, days_of_week_node) { - if (cJSON_AddNumberToObject(days_of_week, "", *(double *)days_of_week_node->data) == NULL) { - ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [days_of_week]"); - goto end; + OpenAPI_list_for_each(scheduled_communication_time->days_of_week, node) { + if (cJSON_AddNumberToObject(days_of_weekList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_convertToJSON() failed [days_of_week]"); + goto end; + } } - } } if (scheduled_communication_time->time_of_day_start) { @@ -82,39 +91,49 @@ end: OpenAPI_scheduled_communication_time_t *OpenAPI_scheduled_communication_time_parseFromJSON(cJSON *scheduled_communication_timeJSON) { OpenAPI_scheduled_communication_time_t *scheduled_communication_time_local_var = NULL; - cJSON *days_of_week = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "daysOfWeek"); - - OpenAPI_list_t *days_of_weekList; + OpenAPI_lnode_t *node = NULL; + cJSON *days_of_week = NULL; + OpenAPI_list_t *days_of_weekList = NULL; + cJSON *time_of_day_start = NULL; + cJSON *time_of_day_end = NULL; + days_of_week = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "daysOfWeek"); if (days_of_week) { - cJSON *days_of_week_local; - if (!cJSON_IsArray(days_of_week)) { - ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [days_of_week]"); - goto end; - } - days_of_weekList = OpenAPI_list_create(); + cJSON *days_of_week_local = NULL; + if (!cJSON_IsArray(days_of_week)) { + ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [days_of_week]"); + goto end; + } - cJSON_ArrayForEach(days_of_week_local, days_of_week) { - if (!cJSON_IsNumber(days_of_week_local)) { - ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [days_of_week]"); - goto end; - } - OpenAPI_list_add(days_of_weekList, &days_of_week_local->valuedouble); - } + days_of_weekList = OpenAPI_list_create(); + + cJSON_ArrayForEach(days_of_week_local, days_of_week) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(days_of_week_local)) { + ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [days_of_week]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [days_of_week]"); + goto end; + } + *localDouble = days_of_week_local->valuedouble; + OpenAPI_list_add(days_of_weekList, localDouble); + } } - cJSON *time_of_day_start = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "timeOfDayStart"); - + time_of_day_start = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "timeOfDayStart"); if (time_of_day_start) { - if (!cJSON_IsString(time_of_day_start)) { + if (!cJSON_IsString(time_of_day_start) && !cJSON_IsNull(time_of_day_start)) { ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [time_of_day_start]"); goto end; } } - cJSON *time_of_day_end = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "timeOfDayEnd"); - + time_of_day_end = cJSON_GetObjectItemCaseSensitive(scheduled_communication_timeJSON, "timeOfDayEnd"); if (time_of_day_end) { - if (!cJSON_IsString(time_of_day_end)) { + if (!cJSON_IsString(time_of_day_end) && !cJSON_IsNull(time_of_day_end)) { ogs_error("OpenAPI_scheduled_communication_time_parseFromJSON() failed [time_of_day_end]"); goto end; } @@ -122,12 +141,19 @@ OpenAPI_scheduled_communication_time_t *OpenAPI_scheduled_communication_time_par scheduled_communication_time_local_var = OpenAPI_scheduled_communication_time_create ( days_of_week ? days_of_weekList : NULL, - time_of_day_start ? ogs_strdup(time_of_day_start->valuestring) : NULL, - time_of_day_end ? ogs_strdup(time_of_day_end->valuestring) : NULL + time_of_day_start && !cJSON_IsNull(time_of_day_start) ? ogs_strdup(time_of_day_start->valuestring) : NULL, + time_of_day_end && !cJSON_IsNull(time_of_day_end) ? ogs_strdup(time_of_day_end->valuestring) : NULL ); return scheduled_communication_time_local_var; end: + if (days_of_weekList) { + OpenAPI_list_for_each(days_of_weekList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(days_of_weekList); + days_of_weekList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/scheduled_communication_time_1.c b/lib/sbi/openapi/model/scheduled_communication_time_1.c index 0acea4078..f1937ad16 100644 --- a/lib/sbi/openapi/model/scheduled_communication_time_1.c +++ b/lib/sbi/openapi/model/scheduled_communication_time_1.c @@ -22,22 +22,33 @@ OpenAPI_scheduled_communication_time_1_t *OpenAPI_scheduled_communication_time_1 void OpenAPI_scheduled_communication_time_1_free(OpenAPI_scheduled_communication_time_1_t *scheduled_communication_time_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == scheduled_communication_time_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(scheduled_communication_time_1->days_of_week, node) { - ogs_free(node->data); + if (scheduled_communication_time_1->days_of_week) { + OpenAPI_list_for_each(scheduled_communication_time_1->days_of_week, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scheduled_communication_time_1->days_of_week); + scheduled_communication_time_1->days_of_week = NULL; + } + if (scheduled_communication_time_1->time_of_day_start) { + ogs_free(scheduled_communication_time_1->time_of_day_start); + scheduled_communication_time_1->time_of_day_start = NULL; + } + if (scheduled_communication_time_1->time_of_day_end) { + ogs_free(scheduled_communication_time_1->time_of_day_end); + scheduled_communication_time_1->time_of_day_end = NULL; } - OpenAPI_list_free(scheduled_communication_time_1->days_of_week); - ogs_free(scheduled_communication_time_1->time_of_day_start); - ogs_free(scheduled_communication_time_1->time_of_day_end); ogs_free(scheduled_communication_time_1); } cJSON *OpenAPI_scheduled_communication_time_1_convertToJSON(OpenAPI_scheduled_communication_time_1_t *scheduled_communication_time_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (scheduled_communication_time_1 == NULL) { ogs_error("OpenAPI_scheduled_communication_time_1_convertToJSON() failed [ScheduledCommunicationTime_1]"); @@ -46,19 +57,17 @@ cJSON *OpenAPI_scheduled_communication_time_1_convertToJSON(OpenAPI_scheduled_co item = cJSON_CreateObject(); if (scheduled_communication_time_1->days_of_week) { - cJSON *days_of_week = cJSON_AddArrayToObject(item, "daysOfWeek"); - if (days_of_week == NULL) { + cJSON *days_of_weekList = cJSON_AddArrayToObject(item, "daysOfWeek"); + if (days_of_weekList == NULL) { ogs_error("OpenAPI_scheduled_communication_time_1_convertToJSON() failed [days_of_week]"); goto end; } - - OpenAPI_lnode_t *days_of_week_node; - OpenAPI_list_for_each(scheduled_communication_time_1->days_of_week, days_of_week_node) { - if (cJSON_AddNumberToObject(days_of_week, "", *(double *)days_of_week_node->data) == NULL) { - ogs_error("OpenAPI_scheduled_communication_time_1_convertToJSON() failed [days_of_week]"); - goto end; + OpenAPI_list_for_each(scheduled_communication_time_1->days_of_week, node) { + if (cJSON_AddNumberToObject(days_of_weekList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_1_convertToJSON() failed [days_of_week]"); + goto end; + } } - } } if (scheduled_communication_time_1->time_of_day_start) { @@ -82,39 +91,49 @@ end: OpenAPI_scheduled_communication_time_1_t *OpenAPI_scheduled_communication_time_1_parseFromJSON(cJSON *scheduled_communication_time_1JSON) { OpenAPI_scheduled_communication_time_1_t *scheduled_communication_time_1_local_var = NULL; - cJSON *days_of_week = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_1JSON, "daysOfWeek"); - - OpenAPI_list_t *days_of_weekList; + OpenAPI_lnode_t *node = NULL; + cJSON *days_of_week = NULL; + OpenAPI_list_t *days_of_weekList = NULL; + cJSON *time_of_day_start = NULL; + cJSON *time_of_day_end = NULL; + days_of_week = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_1JSON, "daysOfWeek"); if (days_of_week) { - cJSON *days_of_week_local; - if (!cJSON_IsArray(days_of_week)) { - ogs_error("OpenAPI_scheduled_communication_time_1_parseFromJSON() failed [days_of_week]"); - goto end; - } - days_of_weekList = OpenAPI_list_create(); + cJSON *days_of_week_local = NULL; + if (!cJSON_IsArray(days_of_week)) { + ogs_error("OpenAPI_scheduled_communication_time_1_parseFromJSON() failed [days_of_week]"); + goto end; + } - cJSON_ArrayForEach(days_of_week_local, days_of_week) { - if (!cJSON_IsNumber(days_of_week_local)) { - ogs_error("OpenAPI_scheduled_communication_time_1_parseFromJSON() failed [days_of_week]"); - goto end; - } - OpenAPI_list_add(days_of_weekList, &days_of_week_local->valuedouble); - } + days_of_weekList = OpenAPI_list_create(); + + cJSON_ArrayForEach(days_of_week_local, days_of_week) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(days_of_week_local)) { + ogs_error("OpenAPI_scheduled_communication_time_1_parseFromJSON() failed [days_of_week]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_scheduled_communication_time_1_parseFromJSON() failed [days_of_week]"); + goto end; + } + *localDouble = days_of_week_local->valuedouble; + OpenAPI_list_add(days_of_weekList, localDouble); + } } - cJSON *time_of_day_start = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_1JSON, "timeOfDayStart"); - + time_of_day_start = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_1JSON, "timeOfDayStart"); if (time_of_day_start) { - if (!cJSON_IsString(time_of_day_start)) { + if (!cJSON_IsString(time_of_day_start) && !cJSON_IsNull(time_of_day_start)) { ogs_error("OpenAPI_scheduled_communication_time_1_parseFromJSON() failed [time_of_day_start]"); goto end; } } - cJSON *time_of_day_end = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_1JSON, "timeOfDayEnd"); - + time_of_day_end = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_1JSON, "timeOfDayEnd"); if (time_of_day_end) { - if (!cJSON_IsString(time_of_day_end)) { + if (!cJSON_IsString(time_of_day_end) && !cJSON_IsNull(time_of_day_end)) { ogs_error("OpenAPI_scheduled_communication_time_1_parseFromJSON() failed [time_of_day_end]"); goto end; } @@ -122,12 +141,19 @@ OpenAPI_scheduled_communication_time_1_t *OpenAPI_scheduled_communication_time_1 scheduled_communication_time_1_local_var = OpenAPI_scheduled_communication_time_1_create ( days_of_week ? days_of_weekList : NULL, - time_of_day_start ? ogs_strdup(time_of_day_start->valuestring) : NULL, - time_of_day_end ? ogs_strdup(time_of_day_end->valuestring) : NULL + time_of_day_start && !cJSON_IsNull(time_of_day_start) ? ogs_strdup(time_of_day_start->valuestring) : NULL, + time_of_day_end && !cJSON_IsNull(time_of_day_end) ? ogs_strdup(time_of_day_end->valuestring) : NULL ); return scheduled_communication_time_1_local_var; end: + if (days_of_weekList) { + OpenAPI_list_for_each(days_of_weekList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(days_of_weekList); + days_of_weekList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/scheduled_communication_time_rm.c b/lib/sbi/openapi/model/scheduled_communication_time_rm.c index 6060ab3be..4791eff1a 100644 --- a/lib/sbi/openapi/model/scheduled_communication_time_rm.c +++ b/lib/sbi/openapi/model/scheduled_communication_time_rm.c @@ -22,22 +22,33 @@ OpenAPI_scheduled_communication_time_rm_t *OpenAPI_scheduled_communication_time_ void OpenAPI_scheduled_communication_time_rm_free(OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == scheduled_communication_time_rm) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(scheduled_communication_time_rm->days_of_week, node) { - ogs_free(node->data); + if (scheduled_communication_time_rm->days_of_week) { + OpenAPI_list_for_each(scheduled_communication_time_rm->days_of_week, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scheduled_communication_time_rm->days_of_week); + scheduled_communication_time_rm->days_of_week = NULL; + } + if (scheduled_communication_time_rm->time_of_day_start) { + ogs_free(scheduled_communication_time_rm->time_of_day_start); + scheduled_communication_time_rm->time_of_day_start = NULL; + } + if (scheduled_communication_time_rm->time_of_day_end) { + ogs_free(scheduled_communication_time_rm->time_of_day_end); + scheduled_communication_time_rm->time_of_day_end = NULL; } - OpenAPI_list_free(scheduled_communication_time_rm->days_of_week); - ogs_free(scheduled_communication_time_rm->time_of_day_start); - ogs_free(scheduled_communication_time_rm->time_of_day_end); ogs_free(scheduled_communication_time_rm); } cJSON *OpenAPI_scheduled_communication_time_rm_convertToJSON(OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (scheduled_communication_time_rm == NULL) { ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [ScheduledCommunicationTimeRm]"); @@ -46,19 +57,17 @@ cJSON *OpenAPI_scheduled_communication_time_rm_convertToJSON(OpenAPI_scheduled_c item = cJSON_CreateObject(); if (scheduled_communication_time_rm->days_of_week) { - cJSON *days_of_week = cJSON_AddArrayToObject(item, "daysOfWeek"); - if (days_of_week == NULL) { + cJSON *days_of_weekList = cJSON_AddArrayToObject(item, "daysOfWeek"); + if (days_of_weekList == NULL) { ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [days_of_week]"); goto end; } - - OpenAPI_lnode_t *days_of_week_node; - OpenAPI_list_for_each(scheduled_communication_time_rm->days_of_week, days_of_week_node) { - if (cJSON_AddNumberToObject(days_of_week, "", *(double *)days_of_week_node->data) == NULL) { - ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [days_of_week]"); - goto end; + OpenAPI_list_for_each(scheduled_communication_time_rm->days_of_week, node) { + if (cJSON_AddNumberToObject(days_of_weekList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_scheduled_communication_time_rm_convertToJSON() failed [days_of_week]"); + goto end; + } } - } } if (scheduled_communication_time_rm->time_of_day_start) { @@ -82,39 +91,49 @@ end: OpenAPI_scheduled_communication_time_rm_t *OpenAPI_scheduled_communication_time_rm_parseFromJSON(cJSON *scheduled_communication_time_rmJSON) { OpenAPI_scheduled_communication_time_rm_t *scheduled_communication_time_rm_local_var = NULL; - cJSON *days_of_week = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "daysOfWeek"); - - OpenAPI_list_t *days_of_weekList; + OpenAPI_lnode_t *node = NULL; + cJSON *days_of_week = NULL; + OpenAPI_list_t *days_of_weekList = NULL; + cJSON *time_of_day_start = NULL; + cJSON *time_of_day_end = NULL; + days_of_week = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "daysOfWeek"); if (days_of_week) { - cJSON *days_of_week_local; - if (!cJSON_IsArray(days_of_week)) { - ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [days_of_week]"); - goto end; - } - days_of_weekList = OpenAPI_list_create(); + cJSON *days_of_week_local = NULL; + if (!cJSON_IsArray(days_of_week)) { + ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [days_of_week]"); + goto end; + } - cJSON_ArrayForEach(days_of_week_local, days_of_week) { - if (!cJSON_IsNumber(days_of_week_local)) { - ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [days_of_week]"); - goto end; - } - OpenAPI_list_add(days_of_weekList, &days_of_week_local->valuedouble); - } + days_of_weekList = OpenAPI_list_create(); + + cJSON_ArrayForEach(days_of_week_local, days_of_week) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(days_of_week_local)) { + ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [days_of_week]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [days_of_week]"); + goto end; + } + *localDouble = days_of_week_local->valuedouble; + OpenAPI_list_add(days_of_weekList, localDouble); + } } - cJSON *time_of_day_start = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "timeOfDayStart"); - + time_of_day_start = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "timeOfDayStart"); if (time_of_day_start) { - if (!cJSON_IsString(time_of_day_start)) { + if (!cJSON_IsString(time_of_day_start) && !cJSON_IsNull(time_of_day_start)) { ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [time_of_day_start]"); goto end; } } - cJSON *time_of_day_end = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "timeOfDayEnd"); - + time_of_day_end = cJSON_GetObjectItemCaseSensitive(scheduled_communication_time_rmJSON, "timeOfDayEnd"); if (time_of_day_end) { - if (!cJSON_IsString(time_of_day_end)) { + if (!cJSON_IsString(time_of_day_end) && !cJSON_IsNull(time_of_day_end)) { ogs_error("OpenAPI_scheduled_communication_time_rm_parseFromJSON() failed [time_of_day_end]"); goto end; } @@ -122,12 +141,19 @@ OpenAPI_scheduled_communication_time_rm_t *OpenAPI_scheduled_communication_time_ scheduled_communication_time_rm_local_var = OpenAPI_scheduled_communication_time_rm_create ( days_of_week ? days_of_weekList : NULL, - time_of_day_start ? ogs_strdup(time_of_day_start->valuestring) : NULL, - time_of_day_end ? ogs_strdup(time_of_day_end->valuestring) : NULL + time_of_day_start && !cJSON_IsNull(time_of_day_start) ? ogs_strdup(time_of_day_start->valuestring) : NULL, + time_of_day_end && !cJSON_IsNull(time_of_day_end) ? ogs_strdup(time_of_day_end->valuestring) : NULL ); return scheduled_communication_time_rm_local_var; end: + if (days_of_weekList) { + OpenAPI_list_for_each(days_of_weekList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(days_of_weekList); + days_of_weekList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/scheduled_communication_type_rm.c b/lib/sbi/openapi/model/scheduled_communication_type_rm.c index 0ad9fe639..44a4792f7 100644 --- a/lib/sbi/openapi/model/scheduled_communication_type_rm.c +++ b/lib/sbi/openapi/model/scheduled_communication_type_rm.c @@ -16,16 +16,18 @@ OpenAPI_scheduled_communication_type_rm_t *OpenAPI_scheduled_communication_type_ void OpenAPI_scheduled_communication_type_rm_free(OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == scheduled_communication_type_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(scheduled_communication_type_rm); } cJSON *OpenAPI_scheduled_communication_type_rm_convertToJSON(OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (scheduled_communication_type_rm == NULL) { ogs_error("OpenAPI_scheduled_communication_type_rm_convertToJSON() failed [ScheduledCommunicationTypeRm]"); @@ -40,6 +42,7 @@ end: OpenAPI_scheduled_communication_type_rm_t *OpenAPI_scheduled_communication_type_rm_parseFromJSON(cJSON *scheduled_communication_type_rmJSON) { OpenAPI_scheduled_communication_type_rm_t *scheduled_communication_type_rm_local_var = NULL; + OpenAPI_lnode_t *node = NULL; scheduled_communication_type_rm_local_var = OpenAPI_scheduled_communication_type_rm_create ( ); diff --git a/lib/sbi/openapi/model/scp_domain_cond.c b/lib/sbi/openapi/model/scp_domain_cond.c index 78e0ba11e..72342269a 100644 --- a/lib/sbi/openapi/model/scp_domain_cond.c +++ b/lib/sbi/openapi/model/scp_domain_cond.c @@ -18,20 +18,25 @@ OpenAPI_scp_domain_cond_t *OpenAPI_scp_domain_cond_create( void OpenAPI_scp_domain_cond_free(OpenAPI_scp_domain_cond_t *scp_domain_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == scp_domain_cond) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(scp_domain_cond->scp_domains, node) { - ogs_free(node->data); + if (scp_domain_cond->scp_domains) { + OpenAPI_list_for_each(scp_domain_cond->scp_domains, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scp_domain_cond->scp_domains); + scp_domain_cond->scp_domains = NULL; } - OpenAPI_list_free(scp_domain_cond->scp_domains); ogs_free(scp_domain_cond); } cJSON *OpenAPI_scp_domain_cond_convertToJSON(OpenAPI_scp_domain_cond_t *scp_domain_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (scp_domain_cond == NULL) { ogs_error("OpenAPI_scp_domain_cond_convertToJSON() failed [ScpDomainCond]"); @@ -40,19 +45,17 @@ cJSON *OpenAPI_scp_domain_cond_convertToJSON(OpenAPI_scp_domain_cond_t *scp_doma item = cJSON_CreateObject(); if (scp_domain_cond->scp_domains) { - cJSON *scp_domains = cJSON_AddArrayToObject(item, "scpDomains"); - if (scp_domains == NULL) { + cJSON *scp_domainsList = cJSON_AddArrayToObject(item, "scpDomains"); + if (scp_domainsList == NULL) { ogs_error("OpenAPI_scp_domain_cond_convertToJSON() failed [scp_domains]"); goto end; } - - OpenAPI_lnode_t *scp_domains_node; - OpenAPI_list_for_each(scp_domain_cond->scp_domains, scp_domains_node) { - if (cJSON_AddStringToObject(scp_domains, "", (char*)scp_domains_node->data) == NULL) { - ogs_error("OpenAPI_scp_domain_cond_convertToJSON() failed [scp_domains]"); - goto end; + OpenAPI_list_for_each(scp_domain_cond->scp_domains, node) { + if (cJSON_AddStringToObject(scp_domainsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_scp_domain_cond_convertToJSON() failed [scp_domains]"); + goto end; + } } - } } end: @@ -62,24 +65,28 @@ end: OpenAPI_scp_domain_cond_t *OpenAPI_scp_domain_cond_parseFromJSON(cJSON *scp_domain_condJSON) { OpenAPI_scp_domain_cond_t *scp_domain_cond_local_var = NULL; - cJSON *scp_domains = cJSON_GetObjectItemCaseSensitive(scp_domain_condJSON, "scpDomains"); - - OpenAPI_list_t *scp_domainsList; + OpenAPI_lnode_t *node = NULL; + cJSON *scp_domains = NULL; + OpenAPI_list_t *scp_domainsList = NULL; + scp_domains = cJSON_GetObjectItemCaseSensitive(scp_domain_condJSON, "scpDomains"); if (scp_domains) { - cJSON *scp_domains_local; - if (!cJSON_IsArray(scp_domains)) { - ogs_error("OpenAPI_scp_domain_cond_parseFromJSON() failed [scp_domains]"); - goto end; - } - scp_domainsList = OpenAPI_list_create(); + cJSON *scp_domains_local = NULL; + if (!cJSON_IsArray(scp_domains)) { + ogs_error("OpenAPI_scp_domain_cond_parseFromJSON() failed [scp_domains]"); + goto end; + } - cJSON_ArrayForEach(scp_domains_local, scp_domains) { - if (!cJSON_IsString(scp_domains_local)) { - ogs_error("OpenAPI_scp_domain_cond_parseFromJSON() failed [scp_domains]"); - goto end; - } - OpenAPI_list_add(scp_domainsList, ogs_strdup(scp_domains_local->valuestring)); - } + scp_domainsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(scp_domains_local, scp_domains) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(scp_domains_local)) { + ogs_error("OpenAPI_scp_domain_cond_parseFromJSON() failed [scp_domains]"); + goto end; + } + OpenAPI_list_add(scp_domainsList, ogs_strdup(scp_domains_local->valuestring)); + } } scp_domain_cond_local_var = OpenAPI_scp_domain_cond_create ( @@ -88,6 +95,13 @@ OpenAPI_scp_domain_cond_t *OpenAPI_scp_domain_cond_parseFromJSON(cJSON *scp_doma return scp_domain_cond_local_var; end: + if (scp_domainsList) { + OpenAPI_list_for_each(scp_domainsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scp_domainsList); + scp_domainsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/scp_domain_info.c b/lib/sbi/openapi/model/scp_domain_info.c index a90adbd63..02929ff73 100644 --- a/lib/sbi/openapi/model/scp_domain_info.c +++ b/lib/sbi/openapi/model/scp_domain_info.c @@ -24,29 +24,43 @@ OpenAPI_scp_domain_info_t *OpenAPI_scp_domain_info_create( void OpenAPI_scp_domain_info_free(OpenAPI_scp_domain_info_t *scp_domain_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == scp_domain_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(scp_domain_info->scp_fqdn); - OpenAPI_list_for_each(scp_domain_info->scp_ip_end_points, node) { - OpenAPI_ip_end_point_free(node->data); + if (scp_domain_info->scp_fqdn) { + ogs_free(scp_domain_info->scp_fqdn); + scp_domain_info->scp_fqdn = NULL; } - OpenAPI_list_free(scp_domain_info->scp_ip_end_points); - ogs_free(scp_domain_info->scp_prefix); - OpenAPI_list_for_each(scp_domain_info->scp_ports, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (scp_domain_info->scp_ip_end_points) { + OpenAPI_list_for_each(scp_domain_info->scp_ip_end_points, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(scp_domain_info->scp_ip_end_points); + scp_domain_info->scp_ip_end_points = NULL; + } + if (scp_domain_info->scp_prefix) { + ogs_free(scp_domain_info->scp_prefix); + scp_domain_info->scp_prefix = NULL; + } + if (scp_domain_info->scp_ports) { + OpenAPI_list_for_each(scp_domain_info->scp_ports, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(scp_domain_info->scp_ports); + scp_domain_info->scp_ports = NULL; } - OpenAPI_list_free(scp_domain_info->scp_ports); ogs_free(scp_domain_info); } cJSON *OpenAPI_scp_domain_info_convertToJSON(OpenAPI_scp_domain_info_t *scp_domain_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (scp_domain_info == NULL) { ogs_error("OpenAPI_scp_domain_info_convertToJSON() failed [ScpDomainInfo]"); @@ -67,17 +81,13 @@ cJSON *OpenAPI_scp_domain_info_convertToJSON(OpenAPI_scp_domain_info_t *scp_doma ogs_error("OpenAPI_scp_domain_info_convertToJSON() failed [scp_ip_end_points]"); goto end; } - - OpenAPI_lnode_t *scp_ip_end_points_node; - if (scp_domain_info->scp_ip_end_points) { - OpenAPI_list_for_each(scp_domain_info->scp_ip_end_points, scp_ip_end_points_node) { - cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(scp_ip_end_points_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_scp_domain_info_convertToJSON() failed [scp_ip_end_points]"); - goto end; - } - cJSON_AddItemToArray(scp_ip_end_pointsList, itemLocal); + OpenAPI_list_for_each(scp_domain_info->scp_ip_end_points, node) { + cJSON *itemLocal = OpenAPI_ip_end_point_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_scp_domain_info_convertToJSON() failed [scp_ip_end_points]"); + goto end; } + cJSON_AddItemToArray(scp_ip_end_pointsList, itemLocal); } } @@ -95,17 +105,16 @@ cJSON *OpenAPI_scp_domain_info_convertToJSON(OpenAPI_scp_domain_info_t *scp_doma goto end; } cJSON *localMapObject = scp_ports; - OpenAPI_lnode_t *scp_ports_node; if (scp_domain_info->scp_ports) { - OpenAPI_list_for_each(scp_domain_info->scp_ports, scp_ports_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)scp_ports_node->data; - if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, *(double *)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_scp_domain_info_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(scp_domain_info->scp_ports, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, (uintptr_t)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_scp_domain_info_convertToJSON() failed [inner]"); + goto end; } } } + } end: return item; @@ -114,84 +123,110 @@ end: OpenAPI_scp_domain_info_t *OpenAPI_scp_domain_info_parseFromJSON(cJSON *scp_domain_infoJSON) { OpenAPI_scp_domain_info_t *scp_domain_info_local_var = NULL; - cJSON *scp_fqdn = cJSON_GetObjectItemCaseSensitive(scp_domain_infoJSON, "scpFqdn"); - + OpenAPI_lnode_t *node = NULL; + cJSON *scp_fqdn = NULL; + cJSON *scp_ip_end_points = NULL; + OpenAPI_list_t *scp_ip_end_pointsList = NULL; + cJSON *scp_prefix = NULL; + cJSON *scp_ports = NULL; + OpenAPI_list_t *scp_portsList = NULL; + scp_fqdn = cJSON_GetObjectItemCaseSensitive(scp_domain_infoJSON, "scpFqdn"); if (scp_fqdn) { - if (!cJSON_IsString(scp_fqdn)) { + if (!cJSON_IsString(scp_fqdn) && !cJSON_IsNull(scp_fqdn)) { ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [scp_fqdn]"); goto end; } } - cJSON *scp_ip_end_points = cJSON_GetObjectItemCaseSensitive(scp_domain_infoJSON, "scpIpEndPoints"); - - OpenAPI_list_t *scp_ip_end_pointsList; + scp_ip_end_points = cJSON_GetObjectItemCaseSensitive(scp_domain_infoJSON, "scpIpEndPoints"); if (scp_ip_end_points) { - cJSON *scp_ip_end_points_local_nonprimitive; - if (!cJSON_IsArray(scp_ip_end_points)){ - ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [scp_ip_end_points]"); - goto end; - } - - scp_ip_end_pointsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(scp_ip_end_points_local_nonprimitive, scp_ip_end_points ) { - if (!cJSON_IsObject(scp_ip_end_points_local_nonprimitive)) { + cJSON *scp_ip_end_points_local = NULL; + if (!cJSON_IsArray(scp_ip_end_points)) { ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [scp_ip_end_points]"); goto end; } - OpenAPI_ip_end_point_t *scp_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(scp_ip_end_points_local_nonprimitive); - if (!scp_ip_end_pointsItem) { - ogs_error("No scp_ip_end_pointsItem"); - OpenAPI_list_free(scp_ip_end_pointsList); - goto end; + scp_ip_end_pointsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(scp_ip_end_points_local, scp_ip_end_points) { + if (!cJSON_IsObject(scp_ip_end_points_local)) { + ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [scp_ip_end_points]"); + goto end; + } + OpenAPI_ip_end_point_t *scp_ip_end_pointsItem = OpenAPI_ip_end_point_parseFromJSON(scp_ip_end_points_local); + if (!scp_ip_end_pointsItem) { + ogs_error("No scp_ip_end_pointsItem"); + OpenAPI_list_free(scp_ip_end_pointsList); + goto end; + } + OpenAPI_list_add(scp_ip_end_pointsList, scp_ip_end_pointsItem); } - - OpenAPI_list_add(scp_ip_end_pointsList, scp_ip_end_pointsItem); - } } - cJSON *scp_prefix = cJSON_GetObjectItemCaseSensitive(scp_domain_infoJSON, "scpPrefix"); - + scp_prefix = cJSON_GetObjectItemCaseSensitive(scp_domain_infoJSON, "scpPrefix"); if (scp_prefix) { - if (!cJSON_IsString(scp_prefix)) { + if (!cJSON_IsString(scp_prefix) && !cJSON_IsNull(scp_prefix)) { ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [scp_prefix]"); goto end; } } - cJSON *scp_ports = cJSON_GetObjectItemCaseSensitive(scp_domain_infoJSON, "scpPorts"); - - OpenAPI_list_t *scp_portsList; + scp_ports = cJSON_GetObjectItemCaseSensitive(scp_domain_infoJSON, "scpPorts"); if (scp_ports) { - cJSON *scp_ports_local_map; - if (!cJSON_IsObject(scp_ports)) { - ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [scp_ports]"); - goto end; - } - scp_portsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(scp_ports_local_map, scp_ports) { - cJSON *localMapObject = scp_ports_local_map; - if (!cJSON_IsNumber(localMapObject)) { - ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [inner]"); + cJSON *scp_ports_local_map = NULL; + if (!cJSON_IsObject(scp_ports) && !cJSON_IsNull(scp_ports)) { + ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [scp_ports]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),&localMapObject->valuedouble ); - OpenAPI_list_add(scp_portsList, localMapKeyPair); - } + if (cJSON_IsObject(scp_ports)) { + scp_portsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(scp_ports_local_map, scp_ports) { + cJSON *localMapObject = scp_ports_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(localMapObject)) { + ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [inner]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_scp_domain_info_parseFromJSON() failed [inner]"); + goto end; + } + *localDouble = localMapObject->valuedouble; + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), localDouble); + OpenAPI_list_add(scp_portsList, localMapKeyPair); + } + } } scp_domain_info_local_var = OpenAPI_scp_domain_info_create ( - scp_fqdn ? ogs_strdup(scp_fqdn->valuestring) : NULL, + scp_fqdn && !cJSON_IsNull(scp_fqdn) ? ogs_strdup(scp_fqdn->valuestring) : NULL, scp_ip_end_points ? scp_ip_end_pointsList : NULL, - scp_prefix ? ogs_strdup(scp_prefix->valuestring) : NULL, + scp_prefix && !cJSON_IsNull(scp_prefix) ? ogs_strdup(scp_prefix->valuestring) : NULL, scp_ports ? scp_portsList : NULL ); return scp_domain_info_local_var; end: + if (scp_ip_end_pointsList) { + OpenAPI_list_for_each(scp_ip_end_pointsList, node) { + OpenAPI_ip_end_point_free(node->data); + } + OpenAPI_list_free(scp_ip_end_pointsList); + scp_ip_end_pointsList = NULL; + } + if (scp_portsList) { + OpenAPI_list_for_each(scp_portsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(scp_portsList); + scp_portsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/scp_info.c b/lib/sbi/openapi/model/scp_info.c index 4787c5d7f..536ebbcd8 100644 --- a/lib/sbi/openapi/model/scp_info.c +++ b/lib/sbi/openapi/model/scp_info.c @@ -38,59 +38,91 @@ OpenAPI_scp_info_t *OpenAPI_scp_info_create( void OpenAPI_scp_info_free(OpenAPI_scp_info_t *scp_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == scp_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(scp_info->scp_domain_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (scp_info->scp_domain_info_list) { + OpenAPI_list_for_each(scp_info->scp_domain_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(scp_info->scp_domain_info_list); + scp_info->scp_domain_info_list = NULL; } - OpenAPI_list_free(scp_info->scp_domain_info_list); - ogs_free(scp_info->scp_prefix); - OpenAPI_list_for_each(scp_info->scp_ports, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (scp_info->scp_prefix) { + ogs_free(scp_info->scp_prefix); + scp_info->scp_prefix = NULL; } - OpenAPI_list_free(scp_info->scp_ports); - OpenAPI_list_for_each(scp_info->address_domains, node) { - ogs_free(node->data); + if (scp_info->scp_ports) { + OpenAPI_list_for_each(scp_info->scp_ports, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(scp_info->scp_ports); + scp_info->scp_ports = NULL; } - OpenAPI_list_free(scp_info->address_domains); - OpenAPI_list_for_each(scp_info->ipv4_addresses, node) { - ogs_free(node->data); + if (scp_info->address_domains) { + OpenAPI_list_for_each(scp_info->address_domains, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scp_info->address_domains); + scp_info->address_domains = NULL; } - OpenAPI_list_free(scp_info->ipv4_addresses); - OpenAPI_list_for_each(scp_info->ipv6_prefixes, node) { - ogs_free(node->data); + if (scp_info->ipv4_addresses) { + OpenAPI_list_for_each(scp_info->ipv4_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scp_info->ipv4_addresses); + scp_info->ipv4_addresses = NULL; } - OpenAPI_list_free(scp_info->ipv6_prefixes); - OpenAPI_list_for_each(scp_info->ipv4_addr_ranges, node) { - OpenAPI_ipv4_address_range_free(node->data); + if (scp_info->ipv6_prefixes) { + OpenAPI_list_for_each(scp_info->ipv6_prefixes, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scp_info->ipv6_prefixes); + scp_info->ipv6_prefixes = NULL; } - OpenAPI_list_free(scp_info->ipv4_addr_ranges); - OpenAPI_list_for_each(scp_info->ipv6_prefix_ranges, node) { - OpenAPI_ipv6_prefix_range_free(node->data); + if (scp_info->ipv4_addr_ranges) { + OpenAPI_list_for_each(scp_info->ipv4_addr_ranges, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(scp_info->ipv4_addr_ranges); + scp_info->ipv4_addr_ranges = NULL; } - OpenAPI_list_free(scp_info->ipv6_prefix_ranges); - OpenAPI_list_for_each(scp_info->served_nf_set_id_list, node) { - ogs_free(node->data); + if (scp_info->ipv6_prefix_ranges) { + OpenAPI_list_for_each(scp_info->ipv6_prefix_ranges, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(scp_info->ipv6_prefix_ranges); + scp_info->ipv6_prefix_ranges = NULL; } - OpenAPI_list_free(scp_info->served_nf_set_id_list); - OpenAPI_list_for_each(scp_info->remote_plmn_list, node) { - OpenAPI_plmn_id_free(node->data); + if (scp_info->served_nf_set_id_list) { + OpenAPI_list_for_each(scp_info->served_nf_set_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(scp_info->served_nf_set_id_list); + scp_info->served_nf_set_id_list = NULL; + } + if (scp_info->remote_plmn_list) { + OpenAPI_list_for_each(scp_info->remote_plmn_list, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(scp_info->remote_plmn_list); + scp_info->remote_plmn_list = NULL; } - OpenAPI_list_free(scp_info->remote_plmn_list); ogs_free(scp_info); } cJSON *OpenAPI_scp_info_convertToJSON(OpenAPI_scp_info_t *scp_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (scp_info == NULL) { ogs_error("OpenAPI_scp_info_convertToJSON() failed [ScpInfo]"); @@ -105,21 +137,20 @@ cJSON *OpenAPI_scp_info_convertToJSON(OpenAPI_scp_info_t *scp_info) goto end; } cJSON *localMapObject = scp_domain_info_list; - OpenAPI_lnode_t *scp_domain_info_list_node; if (scp_info->scp_domain_info_list) { - OpenAPI_list_for_each(scp_info->scp_domain_info_list, scp_domain_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)scp_domain_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_scp_domain_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(scp_info->scp_domain_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_scp_domain_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (scp_info->scp_prefix) { if (cJSON_AddStringToObject(item, "scpPrefix", scp_info->scp_prefix) == NULL) { @@ -135,64 +166,57 @@ cJSON *OpenAPI_scp_info_convertToJSON(OpenAPI_scp_info_t *scp_info) goto end; } cJSON *localMapObject = scp_ports; - OpenAPI_lnode_t *scp_ports_node; if (scp_info->scp_ports) { - OpenAPI_list_for_each(scp_info->scp_ports, scp_ports_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)scp_ports_node->data; - if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, *(double *)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(scp_info->scp_ports, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, (uintptr_t)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [inner]"); + goto end; } } } + } if (scp_info->address_domains) { - cJSON *address_domains = cJSON_AddArrayToObject(item, "addressDomains"); - if (address_domains == NULL) { + cJSON *address_domainsList = cJSON_AddArrayToObject(item, "addressDomains"); + if (address_domainsList == NULL) { ogs_error("OpenAPI_scp_info_convertToJSON() failed [address_domains]"); goto end; } - - OpenAPI_lnode_t *address_domains_node; - OpenAPI_list_for_each(scp_info->address_domains, address_domains_node) { - if (cJSON_AddStringToObject(address_domains, "", (char*)address_domains_node->data) == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [address_domains]"); - goto end; + OpenAPI_list_for_each(scp_info->address_domains, node) { + if (cJSON_AddStringToObject(address_domainsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [address_domains]"); + goto end; + } } - } } if (scp_info->ipv4_addresses) { - cJSON *ipv4_addresses = cJSON_AddArrayToObject(item, "ipv4Addresses"); - if (ipv4_addresses == NULL) { + cJSON *ipv4_addressesList = cJSON_AddArrayToObject(item, "ipv4Addresses"); + if (ipv4_addressesList == NULL) { ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv4_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv4_addresses_node; - OpenAPI_list_for_each(scp_info->ipv4_addresses, ipv4_addresses_node) { - if (cJSON_AddStringToObject(ipv4_addresses, "", (char*)ipv4_addresses_node->data) == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv4_addresses]"); - goto end; + OpenAPI_list_for_each(scp_info->ipv4_addresses, node) { + if (cJSON_AddStringToObject(ipv4_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv4_addresses]"); + goto end; + } } - } } if (scp_info->ipv6_prefixes) { - cJSON *ipv6_prefixes = cJSON_AddArrayToObject(item, "ipv6Prefixes"); - if (ipv6_prefixes == NULL) { + cJSON *ipv6_prefixesList = cJSON_AddArrayToObject(item, "ipv6Prefixes"); + if (ipv6_prefixesList == NULL) { ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv6_prefixes]"); goto end; } - - OpenAPI_lnode_t *ipv6_prefixes_node; - OpenAPI_list_for_each(scp_info->ipv6_prefixes, ipv6_prefixes_node) { - if (cJSON_AddStringToObject(ipv6_prefixes, "", (char*)ipv6_prefixes_node->data) == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv6_prefixes]"); - goto end; + OpenAPI_list_for_each(scp_info->ipv6_prefixes, node) { + if (cJSON_AddStringToObject(ipv6_prefixesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv6_prefixes]"); + goto end; + } } - } } if (scp_info->ipv4_addr_ranges) { @@ -201,17 +225,13 @@ cJSON *OpenAPI_scp_info_convertToJSON(OpenAPI_scp_info_t *scp_info) ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv4_addr_ranges]"); goto end; } - - OpenAPI_lnode_t *ipv4_addr_ranges_node; - if (scp_info->ipv4_addr_ranges) { - OpenAPI_list_for_each(scp_info->ipv4_addr_ranges, ipv4_addr_ranges_node) { - cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(ipv4_addr_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv4_addr_ranges]"); - goto end; - } - cJSON_AddItemToArray(ipv4_addr_rangesList, itemLocal); + OpenAPI_list_for_each(scp_info->ipv4_addr_ranges, node) { + cJSON *itemLocal = OpenAPI_ipv4_address_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv4_addr_ranges]"); + goto end; } + cJSON_AddItemToArray(ipv4_addr_rangesList, itemLocal); } } @@ -221,34 +241,28 @@ cJSON *OpenAPI_scp_info_convertToJSON(OpenAPI_scp_info_t *scp_info) ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv6_prefix_ranges]"); goto end; } - - OpenAPI_lnode_t *ipv6_prefix_ranges_node; - if (scp_info->ipv6_prefix_ranges) { - OpenAPI_list_for_each(scp_info->ipv6_prefix_ranges, ipv6_prefix_ranges_node) { - cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(ipv6_prefix_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv6_prefix_ranges]"); - goto end; - } - cJSON_AddItemToArray(ipv6_prefix_rangesList, itemLocal); + OpenAPI_list_for_each(scp_info->ipv6_prefix_ranges, node) { + cJSON *itemLocal = OpenAPI_ipv6_prefix_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [ipv6_prefix_ranges]"); + goto end; } + cJSON_AddItemToArray(ipv6_prefix_rangesList, itemLocal); } } if (scp_info->served_nf_set_id_list) { - cJSON *served_nf_set_id_list = cJSON_AddArrayToObject(item, "servedNfSetIdList"); - if (served_nf_set_id_list == NULL) { + cJSON *served_nf_set_id_listList = cJSON_AddArrayToObject(item, "servedNfSetIdList"); + if (served_nf_set_id_listList == NULL) { ogs_error("OpenAPI_scp_info_convertToJSON() failed [served_nf_set_id_list]"); goto end; } - - OpenAPI_lnode_t *served_nf_set_id_list_node; - OpenAPI_list_for_each(scp_info->served_nf_set_id_list, served_nf_set_id_list_node) { - if (cJSON_AddStringToObject(served_nf_set_id_list, "", (char*)served_nf_set_id_list_node->data) == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [served_nf_set_id_list]"); - goto end; + OpenAPI_list_for_each(scp_info->served_nf_set_id_list, node) { + if (cJSON_AddStringToObject(served_nf_set_id_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [served_nf_set_id_list]"); + goto end; + } } - } } if (scp_info->remote_plmn_list) { @@ -257,21 +271,17 @@ cJSON *OpenAPI_scp_info_convertToJSON(OpenAPI_scp_info_t *scp_info) ogs_error("OpenAPI_scp_info_convertToJSON() failed [remote_plmn_list]"); goto end; } - - OpenAPI_lnode_t *remote_plmn_list_node; - if (scp_info->remote_plmn_list) { - OpenAPI_list_for_each(scp_info->remote_plmn_list, remote_plmn_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(remote_plmn_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_scp_info_convertToJSON() failed [remote_plmn_list]"); - goto end; - } - cJSON_AddItemToArray(remote_plmn_listList, itemLocal); + OpenAPI_list_for_each(scp_info->remote_plmn_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_scp_info_convertToJSON() failed [remote_plmn_list]"); + goto end; } + cJSON_AddItemToArray(remote_plmn_listList, itemLocal); } } - if (scp_info->ip_reachability) { + if (scp_info->ip_reachability != OpenAPI_ip_reachability_NULL) { if (cJSON_AddStringToObject(item, "ipReachability", OpenAPI_ip_reachability_ToString(scp_info->ip_reachability)) == NULL) { ogs_error("OpenAPI_scp_info_convertToJSON() failed [ip_reachability]"); goto end; @@ -285,233 +295,254 @@ end: OpenAPI_scp_info_t *OpenAPI_scp_info_parseFromJSON(cJSON *scp_infoJSON) { OpenAPI_scp_info_t *scp_info_local_var = NULL; - cJSON *scp_domain_info_list = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "scpDomainInfoList"); - - OpenAPI_list_t *scp_domain_info_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *scp_domain_info_list = NULL; + OpenAPI_list_t *scp_domain_info_listList = NULL; + cJSON *scp_prefix = NULL; + cJSON *scp_ports = NULL; + OpenAPI_list_t *scp_portsList = NULL; + cJSON *address_domains = NULL; + OpenAPI_list_t *address_domainsList = NULL; + cJSON *ipv4_addresses = NULL; + OpenAPI_list_t *ipv4_addressesList = NULL; + cJSON *ipv6_prefixes = NULL; + OpenAPI_list_t *ipv6_prefixesList = NULL; + cJSON *ipv4_addr_ranges = NULL; + OpenAPI_list_t *ipv4_addr_rangesList = NULL; + cJSON *ipv6_prefix_ranges = NULL; + OpenAPI_list_t *ipv6_prefix_rangesList = NULL; + cJSON *served_nf_set_id_list = NULL; + OpenAPI_list_t *served_nf_set_id_listList = NULL; + cJSON *remote_plmn_list = NULL; + OpenAPI_list_t *remote_plmn_listList = NULL; + cJSON *ip_reachability = NULL; + OpenAPI_ip_reachability_e ip_reachabilityVariable = 0; + scp_domain_info_list = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "scpDomainInfoList"); if (scp_domain_info_list) { - cJSON *scp_domain_info_list_local_map; - if (!cJSON_IsObject(scp_domain_info_list)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [scp_domain_info_list]"); - goto end; - } - scp_domain_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(scp_domain_info_list_local_map, scp_domain_info_list) { - cJSON *localMapObject = scp_domain_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_scp_domain_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [inner]"); + cJSON *scp_domain_info_list_local_map = NULL; + if (!cJSON_IsObject(scp_domain_info_list) && !cJSON_IsNull(scp_domain_info_list)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [scp_domain_info_list]"); goto end; } - OpenAPI_list_add(scp_domain_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(scp_domain_info_list)) { + scp_domain_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(scp_domain_info_list_local_map, scp_domain_info_list) { + cJSON *localMapObject = scp_domain_info_list_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_scp_domain_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(scp_domain_info_listList, localMapKeyPair); + } + } } - cJSON *scp_prefix = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "scpPrefix"); - + scp_prefix = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "scpPrefix"); if (scp_prefix) { - if (!cJSON_IsString(scp_prefix)) { + if (!cJSON_IsString(scp_prefix) && !cJSON_IsNull(scp_prefix)) { ogs_error("OpenAPI_scp_info_parseFromJSON() failed [scp_prefix]"); goto end; } } - cJSON *scp_ports = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "scpPorts"); - - OpenAPI_list_t *scp_portsList; + scp_ports = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "scpPorts"); if (scp_ports) { - cJSON *scp_ports_local_map; - if (!cJSON_IsObject(scp_ports)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [scp_ports]"); - goto end; - } - scp_portsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(scp_ports_local_map, scp_ports) { - cJSON *localMapObject = scp_ports_local_map; - if (!cJSON_IsNumber(localMapObject)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [inner]"); + cJSON *scp_ports_local_map = NULL; + if (!cJSON_IsObject(scp_ports) && !cJSON_IsNull(scp_ports)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [scp_ports]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),&localMapObject->valuedouble ); - OpenAPI_list_add(scp_portsList, localMapKeyPair); - } + if (cJSON_IsObject(scp_ports)) { + scp_portsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(scp_ports_local_map, scp_ports) { + cJSON *localMapObject = scp_ports_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(localMapObject)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [inner]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [inner]"); + goto end; + } + *localDouble = localMapObject->valuedouble; + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), localDouble); + OpenAPI_list_add(scp_portsList, localMapKeyPair); + } + } } - cJSON *address_domains = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "addressDomains"); - - OpenAPI_list_t *address_domainsList; + address_domains = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "addressDomains"); if (address_domains) { - cJSON *address_domains_local; - if (!cJSON_IsArray(address_domains)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [address_domains]"); - goto end; - } - address_domainsList = OpenAPI_list_create(); + cJSON *address_domains_local = NULL; + if (!cJSON_IsArray(address_domains)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [address_domains]"); + goto end; + } - cJSON_ArrayForEach(address_domains_local, address_domains) { - if (!cJSON_IsString(address_domains_local)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [address_domains]"); - goto end; - } - OpenAPI_list_add(address_domainsList, ogs_strdup(address_domains_local->valuestring)); - } + address_domainsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(address_domains_local, address_domains) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(address_domains_local)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [address_domains]"); + goto end; + } + OpenAPI_list_add(address_domainsList, ogs_strdup(address_domains_local->valuestring)); + } } - cJSON *ipv4_addresses = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipv4Addresses"); - - OpenAPI_list_t *ipv4_addressesList; + ipv4_addresses = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipv4Addresses"); if (ipv4_addresses) { - cJSON *ipv4_addresses_local; - if (!cJSON_IsArray(ipv4_addresses)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv4_addresses]"); - goto end; - } - ipv4_addressesList = OpenAPI_list_create(); + cJSON *ipv4_addresses_local = NULL; + if (!cJSON_IsArray(ipv4_addresses)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv4_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv4_addresses_local, ipv4_addresses) { - if (!cJSON_IsString(ipv4_addresses_local)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv4_addresses]"); - goto end; - } - OpenAPI_list_add(ipv4_addressesList, ogs_strdup(ipv4_addresses_local->valuestring)); - } + ipv4_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_addresses_local, ipv4_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_addresses_local)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv4_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_addressesList, ogs_strdup(ipv4_addresses_local->valuestring)); + } } - cJSON *ipv6_prefixes = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipv6Prefixes"); - - OpenAPI_list_t *ipv6_prefixesList; + ipv6_prefixes = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipv6Prefixes"); if (ipv6_prefixes) { - cJSON *ipv6_prefixes_local; - if (!cJSON_IsArray(ipv6_prefixes)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv6_prefixes]"); - goto end; - } - ipv6_prefixesList = OpenAPI_list_create(); + cJSON *ipv6_prefixes_local = NULL; + if (!cJSON_IsArray(ipv6_prefixes)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv6_prefixes]"); + goto end; + } - cJSON_ArrayForEach(ipv6_prefixes_local, ipv6_prefixes) { - if (!cJSON_IsString(ipv6_prefixes_local)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv6_prefixes]"); - goto end; - } - OpenAPI_list_add(ipv6_prefixesList, ogs_strdup(ipv6_prefixes_local->valuestring)); - } + ipv6_prefixesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_prefixes_local, ipv6_prefixes) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_prefixes_local)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv6_prefixes]"); + goto end; + } + OpenAPI_list_add(ipv6_prefixesList, ogs_strdup(ipv6_prefixes_local->valuestring)); + } } - cJSON *ipv4_addr_ranges = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipv4AddrRanges"); - - OpenAPI_list_t *ipv4_addr_rangesList; + ipv4_addr_ranges = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipv4AddrRanges"); if (ipv4_addr_ranges) { - cJSON *ipv4_addr_ranges_local_nonprimitive; - if (!cJSON_IsArray(ipv4_addr_ranges)){ - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv4_addr_ranges]"); - goto end; - } - - ipv4_addr_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv4_addr_ranges_local_nonprimitive, ipv4_addr_ranges ) { - if (!cJSON_IsObject(ipv4_addr_ranges_local_nonprimitive)) { + cJSON *ipv4_addr_ranges_local = NULL; + if (!cJSON_IsArray(ipv4_addr_ranges)) { ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv4_addr_ranges]"); goto end; } - OpenAPI_ipv4_address_range_t *ipv4_addr_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(ipv4_addr_ranges_local_nonprimitive); - if (!ipv4_addr_rangesItem) { - ogs_error("No ipv4_addr_rangesItem"); - OpenAPI_list_free(ipv4_addr_rangesList); - goto end; + ipv4_addr_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_addr_ranges_local, ipv4_addr_ranges) { + if (!cJSON_IsObject(ipv4_addr_ranges_local)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv4_addr_ranges]"); + goto end; + } + OpenAPI_ipv4_address_range_t *ipv4_addr_rangesItem = OpenAPI_ipv4_address_range_parseFromJSON(ipv4_addr_ranges_local); + if (!ipv4_addr_rangesItem) { + ogs_error("No ipv4_addr_rangesItem"); + OpenAPI_list_free(ipv4_addr_rangesList); + goto end; + } + OpenAPI_list_add(ipv4_addr_rangesList, ipv4_addr_rangesItem); } - - OpenAPI_list_add(ipv4_addr_rangesList, ipv4_addr_rangesItem); - } } - cJSON *ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipv6PrefixRanges"); - - OpenAPI_list_t *ipv6_prefix_rangesList; + ipv6_prefix_ranges = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipv6PrefixRanges"); if (ipv6_prefix_ranges) { - cJSON *ipv6_prefix_ranges_local_nonprimitive; - if (!cJSON_IsArray(ipv6_prefix_ranges)){ - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv6_prefix_ranges]"); - goto end; - } - - ipv6_prefix_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ipv6_prefix_ranges_local_nonprimitive, ipv6_prefix_ranges ) { - if (!cJSON_IsObject(ipv6_prefix_ranges_local_nonprimitive)) { + cJSON *ipv6_prefix_ranges_local = NULL; + if (!cJSON_IsArray(ipv6_prefix_ranges)) { ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv6_prefix_ranges]"); goto end; } - OpenAPI_ipv6_prefix_range_t *ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(ipv6_prefix_ranges_local_nonprimitive); - if (!ipv6_prefix_rangesItem) { - ogs_error("No ipv6_prefix_rangesItem"); - OpenAPI_list_free(ipv6_prefix_rangesList); + ipv6_prefix_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_prefix_ranges_local, ipv6_prefix_ranges) { + if (!cJSON_IsObject(ipv6_prefix_ranges_local)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ipv6_prefix_ranges]"); + goto end; + } + OpenAPI_ipv6_prefix_range_t *ipv6_prefix_rangesItem = OpenAPI_ipv6_prefix_range_parseFromJSON(ipv6_prefix_ranges_local); + if (!ipv6_prefix_rangesItem) { + ogs_error("No ipv6_prefix_rangesItem"); + OpenAPI_list_free(ipv6_prefix_rangesList); + goto end; + } + OpenAPI_list_add(ipv6_prefix_rangesList, ipv6_prefix_rangesItem); + } + } + + served_nf_set_id_list = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "servedNfSetIdList"); + if (served_nf_set_id_list) { + cJSON *served_nf_set_id_list_local = NULL; + if (!cJSON_IsArray(served_nf_set_id_list)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [served_nf_set_id_list]"); goto end; } - OpenAPI_list_add(ipv6_prefix_rangesList, ipv6_prefix_rangesItem); - } + served_nf_set_id_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(served_nf_set_id_list_local, served_nf_set_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(served_nf_set_id_list_local)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [served_nf_set_id_list]"); + goto end; + } + OpenAPI_list_add(served_nf_set_id_listList, ogs_strdup(served_nf_set_id_list_local->valuestring)); + } } - cJSON *served_nf_set_id_list = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "servedNfSetIdList"); - - OpenAPI_list_t *served_nf_set_id_listList; - if (served_nf_set_id_list) { - cJSON *served_nf_set_id_list_local; - if (!cJSON_IsArray(served_nf_set_id_list)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [served_nf_set_id_list]"); - goto end; - } - served_nf_set_id_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(served_nf_set_id_list_local, served_nf_set_id_list) { - if (!cJSON_IsString(served_nf_set_id_list_local)) { - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [served_nf_set_id_list]"); - goto end; - } - OpenAPI_list_add(served_nf_set_id_listList, ogs_strdup(served_nf_set_id_list_local->valuestring)); - } - } - - cJSON *remote_plmn_list = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "remotePlmnList"); - - OpenAPI_list_t *remote_plmn_listList; + remote_plmn_list = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "remotePlmnList"); if (remote_plmn_list) { - cJSON *remote_plmn_list_local_nonprimitive; - if (!cJSON_IsArray(remote_plmn_list)){ - ogs_error("OpenAPI_scp_info_parseFromJSON() failed [remote_plmn_list]"); - goto end; - } - - remote_plmn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(remote_plmn_list_local_nonprimitive, remote_plmn_list ) { - if (!cJSON_IsObject(remote_plmn_list_local_nonprimitive)) { + cJSON *remote_plmn_list_local = NULL; + if (!cJSON_IsArray(remote_plmn_list)) { ogs_error("OpenAPI_scp_info_parseFromJSON() failed [remote_plmn_list]"); goto end; } - OpenAPI_plmn_id_t *remote_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(remote_plmn_list_local_nonprimitive); - if (!remote_plmn_listItem) { - ogs_error("No remote_plmn_listItem"); - OpenAPI_list_free(remote_plmn_listList); - goto end; + remote_plmn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(remote_plmn_list_local, remote_plmn_list) { + if (!cJSON_IsObject(remote_plmn_list_local)) { + ogs_error("OpenAPI_scp_info_parseFromJSON() failed [remote_plmn_list]"); + goto end; + } + OpenAPI_plmn_id_t *remote_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(remote_plmn_list_local); + if (!remote_plmn_listItem) { + ogs_error("No remote_plmn_listItem"); + OpenAPI_list_free(remote_plmn_listList); + goto end; + } + OpenAPI_list_add(remote_plmn_listList, remote_plmn_listItem); } - - OpenAPI_list_add(remote_plmn_listList, remote_plmn_listItem); - } } - cJSON *ip_reachability = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipReachability"); - - OpenAPI_ip_reachability_e ip_reachabilityVariable; + ip_reachability = cJSON_GetObjectItemCaseSensitive(scp_infoJSON, "ipReachability"); if (ip_reachability) { if (!cJSON_IsString(ip_reachability)) { ogs_error("OpenAPI_scp_info_parseFromJSON() failed [ip_reachability]"); @@ -522,7 +553,7 @@ OpenAPI_scp_info_t *OpenAPI_scp_info_parseFromJSON(cJSON *scp_infoJSON) scp_info_local_var = OpenAPI_scp_info_create ( scp_domain_info_list ? scp_domain_info_listList : NULL, - scp_prefix ? ogs_strdup(scp_prefix->valuestring) : NULL, + scp_prefix && !cJSON_IsNull(scp_prefix) ? ogs_strdup(scp_prefix->valuestring) : NULL, scp_ports ? scp_portsList : NULL, address_domains ? address_domainsList : NULL, ipv4_addresses ? ipv4_addressesList : NULL, @@ -536,6 +567,75 @@ OpenAPI_scp_info_t *OpenAPI_scp_info_parseFromJSON(cJSON *scp_infoJSON) return scp_info_local_var; end: + if (scp_domain_info_listList) { + OpenAPI_list_for_each(scp_domain_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(scp_domain_info_listList); + scp_domain_info_listList = NULL; + } + if (scp_portsList) { + OpenAPI_list_for_each(scp_portsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(scp_portsList); + scp_portsList = NULL; + } + if (address_domainsList) { + OpenAPI_list_for_each(address_domainsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(address_domainsList); + address_domainsList = NULL; + } + if (ipv4_addressesList) { + OpenAPI_list_for_each(ipv4_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_addressesList); + ipv4_addressesList = NULL; + } + if (ipv6_prefixesList) { + OpenAPI_list_for_each(ipv6_prefixesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_prefixesList); + ipv6_prefixesList = NULL; + } + if (ipv4_addr_rangesList) { + OpenAPI_list_for_each(ipv4_addr_rangesList, node) { + OpenAPI_ipv4_address_range_free(node->data); + } + OpenAPI_list_free(ipv4_addr_rangesList); + ipv4_addr_rangesList = NULL; + } + if (ipv6_prefix_rangesList) { + OpenAPI_list_for_each(ipv6_prefix_rangesList, node) { + OpenAPI_ipv6_prefix_range_free(node->data); + } + OpenAPI_list_free(ipv6_prefix_rangesList); + ipv6_prefix_rangesList = NULL; + } + if (served_nf_set_id_listList) { + OpenAPI_list_for_each(served_nf_set_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(served_nf_set_id_listList); + served_nf_set_id_listList = NULL; + } + if (remote_plmn_listList) { + OpenAPI_list_for_each(remote_plmn_listList, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(remote_plmn_listList); + remote_plmn_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sd_range.c b/lib/sbi/openapi/model/sd_range.c index 5f93bfca3..370c4184a 100644 --- a/lib/sbi/openapi/model/sd_range.c +++ b/lib/sbi/openapi/model/sd_range.c @@ -20,18 +20,26 @@ OpenAPI_sd_range_t *OpenAPI_sd_range_create( void OpenAPI_sd_range_free(OpenAPI_sd_range_t *sd_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sd_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(sd_range->start); - ogs_free(sd_range->end); + if (sd_range->start) { + ogs_free(sd_range->start); + sd_range->start = NULL; + } + if (sd_range->end) { + ogs_free(sd_range->end); + sd_range->end = NULL; + } ogs_free(sd_range); } cJSON *OpenAPI_sd_range_convertToJSON(OpenAPI_sd_range_t *sd_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sd_range == NULL) { ogs_error("OpenAPI_sd_range_convertToJSON() failed [SdRange]"); @@ -60,27 +68,28 @@ end: OpenAPI_sd_range_t *OpenAPI_sd_range_parseFromJSON(cJSON *sd_rangeJSON) { OpenAPI_sd_range_t *sd_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(sd_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + start = cJSON_GetObjectItemCaseSensitive(sd_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_sd_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(sd_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(sd_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_sd_range_parseFromJSON() failed [end]"); goto end; } } sd_range_local_var = OpenAPI_sd_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL ); return sd_range_local_var; diff --git a/lib/sbi/openapi/model/sdm_subs_modification.c b/lib/sbi/openapi/model/sdm_subs_modification.c index 4b259500d..3855d77ac 100644 --- a/lib/sbi/openapi/model/sdm_subs_modification.c +++ b/lib/sbi/openapi/model/sdm_subs_modification.c @@ -20,21 +20,29 @@ OpenAPI_sdm_subs_modification_t *OpenAPI_sdm_subs_modification_create( void OpenAPI_sdm_subs_modification_free(OpenAPI_sdm_subs_modification_t *sdm_subs_modification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sdm_subs_modification) { return; } - OpenAPI_lnode_t *node; - ogs_free(sdm_subs_modification->expires); - OpenAPI_list_for_each(sdm_subs_modification->monitored_resource_uris, node) { - ogs_free(node->data); + if (sdm_subs_modification->expires) { + ogs_free(sdm_subs_modification->expires); + sdm_subs_modification->expires = NULL; + } + if (sdm_subs_modification->monitored_resource_uris) { + OpenAPI_list_for_each(sdm_subs_modification->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sdm_subs_modification->monitored_resource_uris); + sdm_subs_modification->monitored_resource_uris = NULL; } - OpenAPI_list_free(sdm_subs_modification->monitored_resource_uris); ogs_free(sdm_subs_modification); } cJSON *OpenAPI_sdm_subs_modification_convertToJSON(OpenAPI_sdm_subs_modification_t *sdm_subs_modification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sdm_subs_modification == NULL) { ogs_error("OpenAPI_sdm_subs_modification_convertToJSON() failed [SdmSubsModification]"); @@ -50,19 +58,17 @@ cJSON *OpenAPI_sdm_subs_modification_convertToJSON(OpenAPI_sdm_subs_modification } if (sdm_subs_modification->monitored_resource_uris) { - cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); - if (monitored_resource_uris == NULL) { + cJSON *monitored_resource_urisList = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_urisList == NULL) { ogs_error("OpenAPI_sdm_subs_modification_convertToJSON() failed [monitored_resource_uris]"); goto end; } - - OpenAPI_lnode_t *monitored_resource_uris_node; - OpenAPI_list_for_each(sdm_subs_modification->monitored_resource_uris, monitored_resource_uris_node) { - if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { - ogs_error("OpenAPI_sdm_subs_modification_convertToJSON() failed [monitored_resource_uris]"); - goto end; + OpenAPI_list_for_each(sdm_subs_modification->monitored_resource_uris, node) { + if (cJSON_AddStringToObject(monitored_resource_urisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sdm_subs_modification_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } } - } } end: @@ -72,42 +78,53 @@ end: OpenAPI_sdm_subs_modification_t *OpenAPI_sdm_subs_modification_parseFromJSON(cJSON *sdm_subs_modificationJSON) { OpenAPI_sdm_subs_modification_t *sdm_subs_modification_local_var = NULL; - cJSON *expires = cJSON_GetObjectItemCaseSensitive(sdm_subs_modificationJSON, "expires"); - + OpenAPI_lnode_t *node = NULL; + cJSON *expires = NULL; + cJSON *monitored_resource_uris = NULL; + OpenAPI_list_t *monitored_resource_urisList = NULL; + expires = cJSON_GetObjectItemCaseSensitive(sdm_subs_modificationJSON, "expires"); if (expires) { - if (!cJSON_IsString(expires)) { + if (!cJSON_IsString(expires) && !cJSON_IsNull(expires)) { ogs_error("OpenAPI_sdm_subs_modification_parseFromJSON() failed [expires]"); goto end; } } - cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(sdm_subs_modificationJSON, "monitoredResourceUris"); - - OpenAPI_list_t *monitored_resource_urisList; + monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(sdm_subs_modificationJSON, "monitoredResourceUris"); if (monitored_resource_uris) { - cJSON *monitored_resource_uris_local; - if (!cJSON_IsArray(monitored_resource_uris)) { - ogs_error("OpenAPI_sdm_subs_modification_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - monitored_resource_urisList = OpenAPI_list_create(); + cJSON *monitored_resource_uris_local = NULL; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_sdm_subs_modification_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } - cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { - if (!cJSON_IsString(monitored_resource_uris_local)) { - ogs_error("OpenAPI_sdm_subs_modification_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); - } + monitored_resource_urisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_sdm_subs_modification_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } } sdm_subs_modification_local_var = OpenAPI_sdm_subs_modification_create ( - expires ? ogs_strdup(expires->valuestring) : NULL, + expires && !cJSON_IsNull(expires) ? ogs_strdup(expires->valuestring) : NULL, monitored_resource_uris ? monitored_resource_urisList : NULL ); return sdm_subs_modification_local_var; end: + if (monitored_resource_urisList) { + OpenAPI_list_for_each(monitored_resource_urisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monitored_resource_urisList); + monitored_resource_urisList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sdm_subscription.c b/lib/sbi/openapi/model/sdm_subscription.c index bc795f9b6..2e26c9fff 100644 --- a/lib/sbi/openapi/model/sdm_subscription.c +++ b/lib/sbi/openapi/model/sdm_subscription.c @@ -48,31 +48,69 @@ OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_create( void OpenAPI_sdm_subscription_free(OpenAPI_sdm_subscription_t *sdm_subscription) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sdm_subscription) { return; } - OpenAPI_lnode_t *node; - ogs_free(sdm_subscription->nf_instance_id); - ogs_free(sdm_subscription->expires); - ogs_free(sdm_subscription->callback_reference); - ogs_free(sdm_subscription->amf_service_name); - OpenAPI_list_for_each(sdm_subscription->monitored_resource_uris, node) { - ogs_free(node->data); + if (sdm_subscription->nf_instance_id) { + ogs_free(sdm_subscription->nf_instance_id); + sdm_subscription->nf_instance_id = NULL; + } + if (sdm_subscription->expires) { + ogs_free(sdm_subscription->expires); + sdm_subscription->expires = NULL; + } + if (sdm_subscription->callback_reference) { + ogs_free(sdm_subscription->callback_reference); + sdm_subscription->callback_reference = NULL; + } + if (sdm_subscription->amf_service_name) { + ogs_free(sdm_subscription->amf_service_name); + sdm_subscription->amf_service_name = NULL; + } + if (sdm_subscription->monitored_resource_uris) { + OpenAPI_list_for_each(sdm_subscription->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sdm_subscription->monitored_resource_uris); + sdm_subscription->monitored_resource_uris = NULL; + } + if (sdm_subscription->single_nssai) { + OpenAPI_snssai_free(sdm_subscription->single_nssai); + sdm_subscription->single_nssai = NULL; + } + if (sdm_subscription->dnn) { + ogs_free(sdm_subscription->dnn); + sdm_subscription->dnn = NULL; + } + if (sdm_subscription->subscription_id) { + ogs_free(sdm_subscription->subscription_id); + sdm_subscription->subscription_id = NULL; + } + if (sdm_subscription->plmn_id) { + OpenAPI_plmn_id_free(sdm_subscription->plmn_id); + sdm_subscription->plmn_id = NULL; + } + if (sdm_subscription->report) { + OpenAPI_subscription_data_sets_free(sdm_subscription->report); + sdm_subscription->report = NULL; + } + if (sdm_subscription->supported_features) { + ogs_free(sdm_subscription->supported_features); + sdm_subscription->supported_features = NULL; + } + if (sdm_subscription->context_info) { + OpenAPI_context_info_free(sdm_subscription->context_info); + sdm_subscription->context_info = NULL; } - OpenAPI_list_free(sdm_subscription->monitored_resource_uris); - OpenAPI_snssai_free(sdm_subscription->single_nssai); - ogs_free(sdm_subscription->dnn); - ogs_free(sdm_subscription->subscription_id); - OpenAPI_plmn_id_free(sdm_subscription->plmn_id); - OpenAPI_subscription_data_sets_free(sdm_subscription->report); - ogs_free(sdm_subscription->supported_features); - OpenAPI_context_info_free(sdm_subscription->context_info); ogs_free(sdm_subscription); } cJSON *OpenAPI_sdm_subscription_convertToJSON(OpenAPI_sdm_subscription_t *sdm_subscription) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sdm_subscription == NULL) { ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [SdmSubscription]"); @@ -80,6 +118,10 @@ cJSON *OpenAPI_sdm_subscription_convertToJSON(OpenAPI_sdm_subscription_t *sdm_su } item = cJSON_CreateObject(); + if (!sdm_subscription->nf_instance_id) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [nf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfInstanceId", sdm_subscription->nf_instance_id) == NULL) { ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [nf_instance_id]"); goto end; @@ -99,6 +141,10 @@ cJSON *OpenAPI_sdm_subscription_convertToJSON(OpenAPI_sdm_subscription_t *sdm_su } } + if (!sdm_subscription->callback_reference) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [callback_reference]"); + return NULL; + } if (cJSON_AddStringToObject(item, "callbackReference", sdm_subscription->callback_reference) == NULL) { ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [callback_reference]"); goto end; @@ -111,19 +157,21 @@ cJSON *OpenAPI_sdm_subscription_convertToJSON(OpenAPI_sdm_subscription_t *sdm_su } } - cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); - if (monitored_resource_uris == NULL) { + if (!sdm_subscription->monitored_resource_uris) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [monitored_resource_uris]"); + return NULL; + } + cJSON *monitored_resource_urisList = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_urisList == NULL) { ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [monitored_resource_uris]"); goto end; } - - OpenAPI_lnode_t *monitored_resource_uris_node; - OpenAPI_list_for_each(sdm_subscription->monitored_resource_uris, monitored_resource_uris_node) { - if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { - ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [monitored_resource_uris]"); - goto end; + OpenAPI_list_for_each(sdm_subscription->monitored_resource_uris, node) { + if (cJSON_AddStringToObject(monitored_resource_urisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sdm_subscription_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } } - } if (sdm_subscription->single_nssai) { cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(sdm_subscription->single_nssai); @@ -212,19 +260,37 @@ end: OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_parseFromJSON(cJSON *sdm_subscriptionJSON) { OpenAPI_sdm_subscription_t *sdm_subscription_local_var = NULL; - cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "nfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instance_id = NULL; + cJSON *implicit_unsubscribe = NULL; + cJSON *expires = NULL; + cJSON *callback_reference = NULL; + cJSON *amf_service_name = NULL; + cJSON *monitored_resource_uris = NULL; + OpenAPI_list_t *monitored_resource_urisList = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + cJSON *dnn = NULL; + cJSON *subscription_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *immediate_report = NULL; + cJSON *report = NULL; + OpenAPI_subscription_data_sets_t *report_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *context_info = NULL; + OpenAPI_context_info_t *context_info_local_nonprim = NULL; + nf_instance_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "nfInstanceId"); if (!nf_instance_id) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [nf_instance_id]"); goto end; } - if (!cJSON_IsString(nf_instance_id)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [nf_instance_id]"); goto end; } - cJSON *implicit_unsubscribe = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "implicitUnsubscribe"); - + implicit_unsubscribe = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "implicitUnsubscribe"); if (implicit_unsubscribe) { if (!cJSON_IsBool(implicit_unsubscribe)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [implicit_unsubscribe]"); @@ -232,91 +298,82 @@ OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_parseFromJSON(cJSON *sdm_su } } - cJSON *expires = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "expires"); - + expires = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "expires"); if (expires) { - if (!cJSON_IsString(expires)) { + if (!cJSON_IsString(expires) && !cJSON_IsNull(expires)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [expires]"); goto end; } } - cJSON *callback_reference = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "callbackReference"); + callback_reference = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "callbackReference"); if (!callback_reference) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [callback_reference]"); goto end; } - if (!cJSON_IsString(callback_reference)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [callback_reference]"); goto end; } - cJSON *amf_service_name = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "amfServiceName"); - + amf_service_name = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "amfServiceName"); if (amf_service_name) { - if (!cJSON_IsString(amf_service_name)) { + if (!cJSON_IsString(amf_service_name) && !cJSON_IsNull(amf_service_name)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [amf_service_name]"); goto end; } } - cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "monitoredResourceUris"); + monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "monitoredResourceUris"); if (!monitored_resource_uris) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [monitored_resource_uris]"); goto end; } + cJSON *monitored_resource_uris_local = NULL; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } - OpenAPI_list_t *monitored_resource_urisList; - cJSON *monitored_resource_uris_local; - if (!cJSON_IsArray(monitored_resource_uris)) { - ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - monitored_resource_urisList = OpenAPI_list_create(); + monitored_resource_urisList = OpenAPI_list_create(); - cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { - if (!cJSON_IsString(monitored_resource_uris_local)) { - ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); - } + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } - cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "singleNssai"); - - OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + single_nssai = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "singleNssai"); if (single_nssai) { single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "subscriptionId"); - + subscription_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "subscriptionId"); if (subscription_id) { - if (!cJSON_IsString(subscription_id)) { + if (!cJSON_IsString(subscription_id) && !cJSON_IsNull(subscription_id)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [subscription_id]"); goto end; } } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "plmnId"); - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); } - cJSON *immediate_report = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "immediateReport"); - + immediate_report = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "immediateReport"); if (immediate_report) { if (!cJSON_IsBool(immediate_report)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [immediate_report]"); @@ -324,25 +381,20 @@ OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_parseFromJSON(cJSON *sdm_su } } - cJSON *report = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "report"); - - OpenAPI_subscription_data_sets_t *report_local_nonprim = NULL; + report = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "report"); if (report) { report_local_nonprim = OpenAPI_subscription_data_sets_parseFromJSON(report); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_sdm_subscription_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *context_info = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "contextInfo"); - - OpenAPI_context_info_t *context_info_local_nonprim = NULL; + context_info = cJSON_GetObjectItemCaseSensitive(sdm_subscriptionJSON, "contextInfo"); if (context_info) { context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info); } @@ -351,23 +403,46 @@ OpenAPI_sdm_subscription_t *OpenAPI_sdm_subscription_parseFromJSON(cJSON *sdm_su ogs_strdup(nf_instance_id->valuestring), implicit_unsubscribe ? true : false, implicit_unsubscribe ? implicit_unsubscribe->valueint : 0, - expires ? ogs_strdup(expires->valuestring) : NULL, + expires && !cJSON_IsNull(expires) ? ogs_strdup(expires->valuestring) : NULL, ogs_strdup(callback_reference->valuestring), - amf_service_name ? ogs_strdup(amf_service_name->valuestring) : NULL, + amf_service_name && !cJSON_IsNull(amf_service_name) ? ogs_strdup(amf_service_name->valuestring) : NULL, monitored_resource_urisList, single_nssai ? single_nssai_local_nonprim : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, - subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, + subscription_id && !cJSON_IsNull(subscription_id) ? ogs_strdup(subscription_id->valuestring) : NULL, plmn_id ? plmn_id_local_nonprim : NULL, immediate_report ? true : false, immediate_report ? immediate_report->valueint : 0, report ? report_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, context_info ? context_info_local_nonprim : NULL ); return sdm_subscription_local_var; end: + if (monitored_resource_urisList) { + OpenAPI_list_for_each(monitored_resource_urisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monitored_resource_urisList); + monitored_resource_urisList = NULL; + } + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (report_local_nonprim) { + OpenAPI_subscription_data_sets_free(report_local_nonprim); + report_local_nonprim = NULL; + } + if (context_info_local_nonprim) { + OpenAPI_context_info_free(context_info_local_nonprim); + context_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sdm_subscription_1.c b/lib/sbi/openapi/model/sdm_subscription_1.c index 65248568b..cc938a80c 100644 --- a/lib/sbi/openapi/model/sdm_subscription_1.c +++ b/lib/sbi/openapi/model/sdm_subscription_1.c @@ -48,31 +48,69 @@ OpenAPI_sdm_subscription_1_t *OpenAPI_sdm_subscription_1_create( void OpenAPI_sdm_subscription_1_free(OpenAPI_sdm_subscription_1_t *sdm_subscription_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sdm_subscription_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(sdm_subscription_1->nf_instance_id); - ogs_free(sdm_subscription_1->expires); - ogs_free(sdm_subscription_1->callback_reference); - ogs_free(sdm_subscription_1->amf_service_name); - OpenAPI_list_for_each(sdm_subscription_1->monitored_resource_uris, node) { - ogs_free(node->data); + if (sdm_subscription_1->nf_instance_id) { + ogs_free(sdm_subscription_1->nf_instance_id); + sdm_subscription_1->nf_instance_id = NULL; + } + if (sdm_subscription_1->expires) { + ogs_free(sdm_subscription_1->expires); + sdm_subscription_1->expires = NULL; + } + if (sdm_subscription_1->callback_reference) { + ogs_free(sdm_subscription_1->callback_reference); + sdm_subscription_1->callback_reference = NULL; + } + if (sdm_subscription_1->amf_service_name) { + ogs_free(sdm_subscription_1->amf_service_name); + sdm_subscription_1->amf_service_name = NULL; + } + if (sdm_subscription_1->monitored_resource_uris) { + OpenAPI_list_for_each(sdm_subscription_1->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sdm_subscription_1->monitored_resource_uris); + sdm_subscription_1->monitored_resource_uris = NULL; + } + if (sdm_subscription_1->single_nssai) { + OpenAPI_snssai_free(sdm_subscription_1->single_nssai); + sdm_subscription_1->single_nssai = NULL; + } + if (sdm_subscription_1->dnn) { + ogs_free(sdm_subscription_1->dnn); + sdm_subscription_1->dnn = NULL; + } + if (sdm_subscription_1->subscription_id) { + ogs_free(sdm_subscription_1->subscription_id); + sdm_subscription_1->subscription_id = NULL; + } + if (sdm_subscription_1->plmn_id) { + OpenAPI_plmn_id_1_free(sdm_subscription_1->plmn_id); + sdm_subscription_1->plmn_id = NULL; + } + if (sdm_subscription_1->report) { + OpenAPI_subscription_data_sets_1_free(sdm_subscription_1->report); + sdm_subscription_1->report = NULL; + } + if (sdm_subscription_1->supported_features) { + ogs_free(sdm_subscription_1->supported_features); + sdm_subscription_1->supported_features = NULL; + } + if (sdm_subscription_1->context_info) { + OpenAPI_context_info_free(sdm_subscription_1->context_info); + sdm_subscription_1->context_info = NULL; } - OpenAPI_list_free(sdm_subscription_1->monitored_resource_uris); - OpenAPI_snssai_free(sdm_subscription_1->single_nssai); - ogs_free(sdm_subscription_1->dnn); - ogs_free(sdm_subscription_1->subscription_id); - OpenAPI_plmn_id_1_free(sdm_subscription_1->plmn_id); - OpenAPI_subscription_data_sets_1_free(sdm_subscription_1->report); - ogs_free(sdm_subscription_1->supported_features); - OpenAPI_context_info_free(sdm_subscription_1->context_info); ogs_free(sdm_subscription_1); } cJSON *OpenAPI_sdm_subscription_1_convertToJSON(OpenAPI_sdm_subscription_1_t *sdm_subscription_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sdm_subscription_1 == NULL) { ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [SdmSubscription_1]"); @@ -80,6 +118,10 @@ cJSON *OpenAPI_sdm_subscription_1_convertToJSON(OpenAPI_sdm_subscription_1_t *sd } item = cJSON_CreateObject(); + if (!sdm_subscription_1->nf_instance_id) { + ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [nf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfInstanceId", sdm_subscription_1->nf_instance_id) == NULL) { ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [nf_instance_id]"); goto end; @@ -99,6 +141,10 @@ cJSON *OpenAPI_sdm_subscription_1_convertToJSON(OpenAPI_sdm_subscription_1_t *sd } } + if (!sdm_subscription_1->callback_reference) { + ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [callback_reference]"); + return NULL; + } if (cJSON_AddStringToObject(item, "callbackReference", sdm_subscription_1->callback_reference) == NULL) { ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [callback_reference]"); goto end; @@ -111,19 +157,21 @@ cJSON *OpenAPI_sdm_subscription_1_convertToJSON(OpenAPI_sdm_subscription_1_t *sd } } - cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); - if (monitored_resource_uris == NULL) { + if (!sdm_subscription_1->monitored_resource_uris) { + ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [monitored_resource_uris]"); + return NULL; + } + cJSON *monitored_resource_urisList = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_urisList == NULL) { ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [monitored_resource_uris]"); goto end; } - - OpenAPI_lnode_t *monitored_resource_uris_node; - OpenAPI_list_for_each(sdm_subscription_1->monitored_resource_uris, monitored_resource_uris_node) { - if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { - ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [monitored_resource_uris]"); - goto end; + OpenAPI_list_for_each(sdm_subscription_1->monitored_resource_uris, node) { + if (cJSON_AddStringToObject(monitored_resource_urisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sdm_subscription_1_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } } - } if (sdm_subscription_1->single_nssai) { cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(sdm_subscription_1->single_nssai); @@ -212,19 +260,37 @@ end: OpenAPI_sdm_subscription_1_t *OpenAPI_sdm_subscription_1_parseFromJSON(cJSON *sdm_subscription_1JSON) { OpenAPI_sdm_subscription_1_t *sdm_subscription_1_local_var = NULL; - cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "nfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instance_id = NULL; + cJSON *implicit_unsubscribe = NULL; + cJSON *expires = NULL; + cJSON *callback_reference = NULL; + cJSON *amf_service_name = NULL; + cJSON *monitored_resource_uris = NULL; + OpenAPI_list_t *monitored_resource_urisList = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + cJSON *dnn = NULL; + cJSON *subscription_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + cJSON *immediate_report = NULL; + cJSON *report = NULL; + OpenAPI_subscription_data_sets_1_t *report_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *context_info = NULL; + OpenAPI_context_info_t *context_info_local_nonprim = NULL; + nf_instance_id = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "nfInstanceId"); if (!nf_instance_id) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [nf_instance_id]"); goto end; } - if (!cJSON_IsString(nf_instance_id)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [nf_instance_id]"); goto end; } - cJSON *implicit_unsubscribe = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "implicitUnsubscribe"); - + implicit_unsubscribe = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "implicitUnsubscribe"); if (implicit_unsubscribe) { if (!cJSON_IsBool(implicit_unsubscribe)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [implicit_unsubscribe]"); @@ -232,91 +298,82 @@ OpenAPI_sdm_subscription_1_t *OpenAPI_sdm_subscription_1_parseFromJSON(cJSON *sd } } - cJSON *expires = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "expires"); - + expires = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "expires"); if (expires) { - if (!cJSON_IsString(expires)) { + if (!cJSON_IsString(expires) && !cJSON_IsNull(expires)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [expires]"); goto end; } } - cJSON *callback_reference = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "callbackReference"); + callback_reference = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "callbackReference"); if (!callback_reference) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [callback_reference]"); goto end; } - if (!cJSON_IsString(callback_reference)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [callback_reference]"); goto end; } - cJSON *amf_service_name = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "amfServiceName"); - + amf_service_name = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "amfServiceName"); if (amf_service_name) { - if (!cJSON_IsString(amf_service_name)) { + if (!cJSON_IsString(amf_service_name) && !cJSON_IsNull(amf_service_name)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [amf_service_name]"); goto end; } } - cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "monitoredResourceUris"); + monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "monitoredResourceUris"); if (!monitored_resource_uris) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [monitored_resource_uris]"); goto end; } + cJSON *monitored_resource_uris_local = NULL; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } - OpenAPI_list_t *monitored_resource_urisList; - cJSON *monitored_resource_uris_local; - if (!cJSON_IsArray(monitored_resource_uris)) { - ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - monitored_resource_urisList = OpenAPI_list_create(); + monitored_resource_urisList = OpenAPI_list_create(); - cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { - if (!cJSON_IsString(monitored_resource_uris_local)) { - ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); - } + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } - cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "singleNssai"); - - OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + single_nssai = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "singleNssai"); if (single_nssai) { single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "subscriptionId"); - + subscription_id = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "subscriptionId"); if (subscription_id) { - if (!cJSON_IsString(subscription_id)) { + if (!cJSON_IsString(subscription_id) && !cJSON_IsNull(subscription_id)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [subscription_id]"); goto end; } } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "plmnId"); - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); } - cJSON *immediate_report = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "immediateReport"); - + immediate_report = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "immediateReport"); if (immediate_report) { if (!cJSON_IsBool(immediate_report)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [immediate_report]"); @@ -324,25 +381,20 @@ OpenAPI_sdm_subscription_1_t *OpenAPI_sdm_subscription_1_parseFromJSON(cJSON *sd } } - cJSON *report = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "report"); - - OpenAPI_subscription_data_sets_1_t *report_local_nonprim = NULL; + report = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "report"); if (report) { report_local_nonprim = OpenAPI_subscription_data_sets_1_parseFromJSON(report); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_sdm_subscription_1_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *context_info = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "contextInfo"); - - OpenAPI_context_info_t *context_info_local_nonprim = NULL; + context_info = cJSON_GetObjectItemCaseSensitive(sdm_subscription_1JSON, "contextInfo"); if (context_info) { context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info); } @@ -351,23 +403,46 @@ OpenAPI_sdm_subscription_1_t *OpenAPI_sdm_subscription_1_parseFromJSON(cJSON *sd ogs_strdup(nf_instance_id->valuestring), implicit_unsubscribe ? true : false, implicit_unsubscribe ? implicit_unsubscribe->valueint : 0, - expires ? ogs_strdup(expires->valuestring) : NULL, + expires && !cJSON_IsNull(expires) ? ogs_strdup(expires->valuestring) : NULL, ogs_strdup(callback_reference->valuestring), - amf_service_name ? ogs_strdup(amf_service_name->valuestring) : NULL, + amf_service_name && !cJSON_IsNull(amf_service_name) ? ogs_strdup(amf_service_name->valuestring) : NULL, monitored_resource_urisList, single_nssai ? single_nssai_local_nonprim : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, - subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, + subscription_id && !cJSON_IsNull(subscription_id) ? ogs_strdup(subscription_id->valuestring) : NULL, plmn_id ? plmn_id_local_nonprim : NULL, immediate_report ? true : false, immediate_report ? immediate_report->valueint : 0, report ? report_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, context_info ? context_info_local_nonprim : NULL ); return sdm_subscription_1_local_var; end: + if (monitored_resource_urisList) { + OpenAPI_list_for_each(monitored_resource_urisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monitored_resource_urisList); + monitored_resource_urisList = NULL; + } + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (report_local_nonprim) { + OpenAPI_subscription_data_sets_1_free(report_local_nonprim); + report_local_nonprim = NULL; + } + if (context_info_local_nonprim) { + OpenAPI_context_info_free(context_info_local_nonprim); + context_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/seaf_data.c b/lib/sbi/openapi/model/seaf_data.c index 05a2b2d03..f77700d31 100644 --- a/lib/sbi/openapi/model/seaf_data.c +++ b/lib/sbi/openapi/model/seaf_data.c @@ -34,19 +34,30 @@ OpenAPI_seaf_data_t *OpenAPI_seaf_data_create( void OpenAPI_seaf_data_free(OpenAPI_seaf_data_t *seaf_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == seaf_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ng_ksi_free(seaf_data->ng_ksi); - OpenAPI_key_amf_free(seaf_data->key_amf); - ogs_free(seaf_data->nh); + if (seaf_data->ng_ksi) { + OpenAPI_ng_ksi_free(seaf_data->ng_ksi); + seaf_data->ng_ksi = NULL; + } + if (seaf_data->key_amf) { + OpenAPI_key_amf_free(seaf_data->key_amf); + seaf_data->key_amf = NULL; + } + if (seaf_data->nh) { + ogs_free(seaf_data->nh); + seaf_data->nh = NULL; + } ogs_free(seaf_data); } cJSON *OpenAPI_seaf_data_convertToJSON(OpenAPI_seaf_data_t *seaf_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (seaf_data == NULL) { ogs_error("OpenAPI_seaf_data_convertToJSON() failed [SeafData]"); @@ -54,6 +65,10 @@ cJSON *OpenAPI_seaf_data_convertToJSON(OpenAPI_seaf_data_t *seaf_data) } item = cJSON_CreateObject(); + if (!seaf_data->ng_ksi) { + ogs_error("OpenAPI_seaf_data_convertToJSON() failed [ng_ksi]"); + return NULL; + } cJSON *ng_ksi_local_JSON = OpenAPI_ng_ksi_convertToJSON(seaf_data->ng_ksi); if (ng_ksi_local_JSON == NULL) { ogs_error("OpenAPI_seaf_data_convertToJSON() failed [ng_ksi]"); @@ -65,6 +80,10 @@ cJSON *OpenAPI_seaf_data_convertToJSON(OpenAPI_seaf_data_t *seaf_data) goto end; } + if (!seaf_data->key_amf) { + ogs_error("OpenAPI_seaf_data_convertToJSON() failed [key_amf]"); + return NULL; + } cJSON *key_amf_local_JSON = OpenAPI_key_amf_convertToJSON(seaf_data->key_amf); if (key_amf_local_JSON == NULL) { ogs_error("OpenAPI_seaf_data_convertToJSON() failed [key_amf]"); @@ -111,35 +130,38 @@ end: OpenAPI_seaf_data_t *OpenAPI_seaf_data_parseFromJSON(cJSON *seaf_dataJSON) { OpenAPI_seaf_data_t *seaf_data_local_var = NULL; - cJSON *ng_ksi = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "ngKsi"); + OpenAPI_lnode_t *node = NULL; + cJSON *ng_ksi = NULL; + OpenAPI_ng_ksi_t *ng_ksi_local_nonprim = NULL; + cJSON *key_amf = NULL; + OpenAPI_key_amf_t *key_amf_local_nonprim = NULL; + cJSON *nh = NULL; + cJSON *ncc = NULL; + cJSON *key_amf_change_ind = NULL; + cJSON *key_amf_h_derivation_ind = NULL; + ng_ksi = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "ngKsi"); if (!ng_ksi) { ogs_error("OpenAPI_seaf_data_parseFromJSON() failed [ng_ksi]"); goto end; } - - OpenAPI_ng_ksi_t *ng_ksi_local_nonprim = NULL; ng_ksi_local_nonprim = OpenAPI_ng_ksi_parseFromJSON(ng_ksi); - cJSON *key_amf = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "keyAmf"); + key_amf = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "keyAmf"); if (!key_amf) { ogs_error("OpenAPI_seaf_data_parseFromJSON() failed [key_amf]"); goto end; } - - OpenAPI_key_amf_t *key_amf_local_nonprim = NULL; key_amf_local_nonprim = OpenAPI_key_amf_parseFromJSON(key_amf); - cJSON *nh = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "nh"); - + nh = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "nh"); if (nh) { - if (!cJSON_IsString(nh)) { + if (!cJSON_IsString(nh) && !cJSON_IsNull(nh)) { ogs_error("OpenAPI_seaf_data_parseFromJSON() failed [nh]"); goto end; } } - cJSON *ncc = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "ncc"); - + ncc = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "ncc"); if (ncc) { if (!cJSON_IsNumber(ncc)) { ogs_error("OpenAPI_seaf_data_parseFromJSON() failed [ncc]"); @@ -147,8 +169,7 @@ OpenAPI_seaf_data_t *OpenAPI_seaf_data_parseFromJSON(cJSON *seaf_dataJSON) } } - cJSON *key_amf_change_ind = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "keyAmfChangeInd"); - + key_amf_change_ind = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "keyAmfChangeInd"); if (key_amf_change_ind) { if (!cJSON_IsBool(key_amf_change_ind)) { ogs_error("OpenAPI_seaf_data_parseFromJSON() failed [key_amf_change_ind]"); @@ -156,8 +177,7 @@ OpenAPI_seaf_data_t *OpenAPI_seaf_data_parseFromJSON(cJSON *seaf_dataJSON) } } - cJSON *key_amf_h_derivation_ind = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "keyAmfHDerivationInd"); - + key_amf_h_derivation_ind = cJSON_GetObjectItemCaseSensitive(seaf_dataJSON, "keyAmfHDerivationInd"); if (key_amf_h_derivation_ind) { if (!cJSON_IsBool(key_amf_h_derivation_ind)) { ogs_error("OpenAPI_seaf_data_parseFromJSON() failed [key_amf_h_derivation_ind]"); @@ -168,7 +188,7 @@ OpenAPI_seaf_data_t *OpenAPI_seaf_data_parseFromJSON(cJSON *seaf_dataJSON) seaf_data_local_var = OpenAPI_seaf_data_create ( ng_ksi_local_nonprim, key_amf_local_nonprim, - nh ? ogs_strdup(nh->valuestring) : NULL, + nh && !cJSON_IsNull(nh) ? ogs_strdup(nh->valuestring) : NULL, ncc ? true : false, ncc ? ncc->valuedouble : 0, key_amf_change_ind ? true : false, @@ -179,6 +199,14 @@ OpenAPI_seaf_data_t *OpenAPI_seaf_data_parseFromJSON(cJSON *seaf_dataJSON) return seaf_data_local_var; end: + if (ng_ksi_local_nonprim) { + OpenAPI_ng_ksi_free(ng_ksi_local_nonprim); + ng_ksi_local_nonprim = NULL; + } + if (key_amf_local_nonprim) { + OpenAPI_key_amf_free(key_amf_local_nonprim); + key_amf_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/search_result.c b/lib/sbi/openapi/model/search_result.c index f9bb42e7e..dc1fdc9ec 100644 --- a/lib/sbi/openapi/model/search_result.c +++ b/lib/sbi/openapi/model/search_result.c @@ -32,23 +32,37 @@ OpenAPI_search_result_t *OpenAPI_search_result_create( void OpenAPI_search_result_free(OpenAPI_search_result_t *search_result) { + OpenAPI_lnode_t *node = NULL; + if (NULL == search_result) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(search_result->nf_instances, node) { - OpenAPI_nf_profile_free(node->data); + if (search_result->nf_instances) { + OpenAPI_list_for_each(search_result->nf_instances, node) { + OpenAPI_nf_profile_free(node->data); + } + OpenAPI_list_free(search_result->nf_instances); + search_result->nf_instances = NULL; + } + if (search_result->search_id) { + ogs_free(search_result->search_id); + search_result->search_id = NULL; + } + if (search_result->preferred_search) { + OpenAPI_preferred_search_free(search_result->preferred_search); + search_result->preferred_search = NULL; + } + if (search_result->nrf_supported_features) { + ogs_free(search_result->nrf_supported_features); + search_result->nrf_supported_features = NULL; } - OpenAPI_list_free(search_result->nf_instances); - ogs_free(search_result->search_id); - OpenAPI_preferred_search_free(search_result->preferred_search); - ogs_free(search_result->nrf_supported_features); ogs_free(search_result); } cJSON *OpenAPI_search_result_convertToJSON(OpenAPI_search_result_t *search_result) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (search_result == NULL) { ogs_error("OpenAPI_search_result_convertToJSON() failed [SearchResult]"); @@ -63,22 +77,22 @@ cJSON *OpenAPI_search_result_convertToJSON(OpenAPI_search_result_t *search_resul } } + if (!search_result->nf_instances) { + ogs_error("OpenAPI_search_result_convertToJSON() failed [nf_instances]"); + return NULL; + } cJSON *nf_instancesList = cJSON_AddArrayToObject(item, "nfInstances"); if (nf_instancesList == NULL) { ogs_error("OpenAPI_search_result_convertToJSON() failed [nf_instances]"); goto end; } - - OpenAPI_lnode_t *nf_instances_node; - if (search_result->nf_instances) { - OpenAPI_list_for_each(search_result->nf_instances, nf_instances_node) { - cJSON *itemLocal = OpenAPI_nf_profile_convertToJSON(nf_instances_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_search_result_convertToJSON() failed [nf_instances]"); - goto end; - } - cJSON_AddItemToArray(nf_instancesList, itemLocal); + OpenAPI_list_for_each(search_result->nf_instances, node) { + cJSON *itemLocal = OpenAPI_nf_profile_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_search_result_convertToJSON() failed [nf_instances]"); + goto end; } + cJSON_AddItemToArray(nf_instancesList, itemLocal); } if (search_result->search_id) { @@ -122,8 +136,16 @@ end: OpenAPI_search_result_t *OpenAPI_search_result_parseFromJSON(cJSON *search_resultJSON) { OpenAPI_search_result_t *search_result_local_var = NULL; - cJSON *validity_period = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "validityPeriod"); - + OpenAPI_lnode_t *node = NULL; + cJSON *validity_period = NULL; + cJSON *nf_instances = NULL; + OpenAPI_list_t *nf_instancesList = NULL; + cJSON *search_id = NULL; + cJSON *num_nf_inst_complete = NULL; + cJSON *preferred_search = NULL; + OpenAPI_preferred_search_t *preferred_search_local_nonprim = NULL; + cJSON *nrf_supported_features = NULL; + validity_period = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "validityPeriod"); if (validity_period) { if (!cJSON_IsNumber(validity_period)) { ogs_error("OpenAPI_search_result_parseFromJSON() failed [validity_period]"); @@ -131,48 +153,42 @@ OpenAPI_search_result_t *OpenAPI_search_result_parseFromJSON(cJSON *search_resul } } - cJSON *nf_instances = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "nfInstances"); + nf_instances = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "nfInstances"); if (!nf_instances) { ogs_error("OpenAPI_search_result_parseFromJSON() failed [nf_instances]"); goto end; } - - OpenAPI_list_t *nf_instancesList; - cJSON *nf_instances_local_nonprimitive; - if (!cJSON_IsArray(nf_instances)){ - ogs_error("OpenAPI_search_result_parseFromJSON() failed [nf_instances]"); - goto end; - } - - nf_instancesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nf_instances_local_nonprimitive, nf_instances ) { - if (!cJSON_IsObject(nf_instances_local_nonprimitive)) { + cJSON *nf_instances_local = NULL; + if (!cJSON_IsArray(nf_instances)) { ogs_error("OpenAPI_search_result_parseFromJSON() failed [nf_instances]"); goto end; } - OpenAPI_nf_profile_t *nf_instancesItem = OpenAPI_nf_profile_parseFromJSON(nf_instances_local_nonprimitive); - if (!nf_instancesItem) { - ogs_error("No nf_instancesItem"); - OpenAPI_list_free(nf_instancesList); - goto end; + nf_instancesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nf_instances_local, nf_instances) { + if (!cJSON_IsObject(nf_instances_local)) { + ogs_error("OpenAPI_search_result_parseFromJSON() failed [nf_instances]"); + goto end; + } + OpenAPI_nf_profile_t *nf_instancesItem = OpenAPI_nf_profile_parseFromJSON(nf_instances_local); + if (!nf_instancesItem) { + ogs_error("No nf_instancesItem"); + OpenAPI_list_free(nf_instancesList); + goto end; + } + OpenAPI_list_add(nf_instancesList, nf_instancesItem); } - OpenAPI_list_add(nf_instancesList, nf_instancesItem); - } - - cJSON *search_id = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "searchId"); - + search_id = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "searchId"); if (search_id) { - if (!cJSON_IsString(search_id)) { + if (!cJSON_IsString(search_id) && !cJSON_IsNull(search_id)) { ogs_error("OpenAPI_search_result_parseFromJSON() failed [search_id]"); goto end; } } - cJSON *num_nf_inst_complete = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "numNfInstComplete"); - + num_nf_inst_complete = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "numNfInstComplete"); if (num_nf_inst_complete) { if (!cJSON_IsNumber(num_nf_inst_complete)) { ogs_error("OpenAPI_search_result_parseFromJSON() failed [num_nf_inst_complete]"); @@ -180,17 +196,14 @@ OpenAPI_search_result_t *OpenAPI_search_result_parseFromJSON(cJSON *search_resul } } - cJSON *preferred_search = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "preferredSearch"); - - OpenAPI_preferred_search_t *preferred_search_local_nonprim = NULL; + preferred_search = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "preferredSearch"); if (preferred_search) { preferred_search_local_nonprim = OpenAPI_preferred_search_parseFromJSON(preferred_search); } - cJSON *nrf_supported_features = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "nrfSupportedFeatures"); - + nrf_supported_features = cJSON_GetObjectItemCaseSensitive(search_resultJSON, "nrfSupportedFeatures"); if (nrf_supported_features) { - if (!cJSON_IsString(nrf_supported_features)) { + if (!cJSON_IsString(nrf_supported_features) && !cJSON_IsNull(nrf_supported_features)) { ogs_error("OpenAPI_search_result_parseFromJSON() failed [nrf_supported_features]"); goto end; } @@ -200,15 +213,26 @@ OpenAPI_search_result_t *OpenAPI_search_result_parseFromJSON(cJSON *search_resul validity_period ? true : false, validity_period ? validity_period->valuedouble : 0, nf_instancesList, - search_id ? ogs_strdup(search_id->valuestring) : NULL, + search_id && !cJSON_IsNull(search_id) ? ogs_strdup(search_id->valuestring) : NULL, num_nf_inst_complete ? true : false, num_nf_inst_complete ? num_nf_inst_complete->valuedouble : 0, preferred_search ? preferred_search_local_nonprim : NULL, - nrf_supported_features ? ogs_strdup(nrf_supported_features->valuestring) : NULL + nrf_supported_features && !cJSON_IsNull(nrf_supported_features) ? ogs_strdup(nrf_supported_features->valuestring) : NULL ); return search_result_local_var; end: + if (nf_instancesList) { + OpenAPI_list_for_each(nf_instancesList, node) { + OpenAPI_nf_profile_free(node->data); + } + OpenAPI_list_free(nf_instancesList); + nf_instancesList = NULL; + } + if (preferred_search_local_nonprim) { + OpenAPI_preferred_search_free(preferred_search_local_nonprim); + preferred_search_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/secondary_rat_usage_info.c b/lib/sbi/openapi/model/secondary_rat_usage_info.c index bebe328cf..d6937f067 100644 --- a/lib/sbi/openapi/model/secondary_rat_usage_info.c +++ b/lib/sbi/openapi/model/secondary_rat_usage_info.c @@ -22,24 +22,32 @@ OpenAPI_secondary_rat_usage_info_t *OpenAPI_secondary_rat_usage_info_create( void OpenAPI_secondary_rat_usage_info_free(OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == secondary_rat_usage_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(secondary_rat_usage_info->qos_flows_usage_data, node) { - OpenAPI_qos_flow_usage_report_free(node->data); + if (secondary_rat_usage_info->qos_flows_usage_data) { + OpenAPI_list_for_each(secondary_rat_usage_info->qos_flows_usage_data, node) { + OpenAPI_qos_flow_usage_report_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_info->qos_flows_usage_data); + secondary_rat_usage_info->qos_flows_usage_data = NULL; } - OpenAPI_list_free(secondary_rat_usage_info->qos_flows_usage_data); - OpenAPI_list_for_each(secondary_rat_usage_info->pdu_session_usage_data, node) { - OpenAPI_volume_timed_report_free(node->data); + if (secondary_rat_usage_info->pdu_session_usage_data) { + OpenAPI_list_for_each(secondary_rat_usage_info->pdu_session_usage_data, node) { + OpenAPI_volume_timed_report_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_info->pdu_session_usage_data); + secondary_rat_usage_info->pdu_session_usage_data = NULL; } - OpenAPI_list_free(secondary_rat_usage_info->pdu_session_usage_data); ogs_free(secondary_rat_usage_info); } cJSON *OpenAPI_secondary_rat_usage_info_convertToJSON(OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (secondary_rat_usage_info == NULL) { ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [SecondaryRatUsageInfo]"); @@ -47,6 +55,10 @@ cJSON *OpenAPI_secondary_rat_usage_info_convertToJSON(OpenAPI_secondary_rat_usag } item = cJSON_CreateObject(); + if (secondary_rat_usage_info->secondary_rat_type == OpenAPI_rat_type_NULL) { + ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [secondary_rat_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "secondaryRatType", OpenAPI_rat_type_ToString(secondary_rat_usage_info->secondary_rat_type)) == NULL) { ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [secondary_rat_type]"); goto end; @@ -58,17 +70,13 @@ cJSON *OpenAPI_secondary_rat_usage_info_convertToJSON(OpenAPI_secondary_rat_usag ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [qos_flows_usage_data]"); goto end; } - - OpenAPI_lnode_t *qos_flows_usage_data_node; - if (secondary_rat_usage_info->qos_flows_usage_data) { - OpenAPI_list_for_each(secondary_rat_usage_info->qos_flows_usage_data, qos_flows_usage_data_node) { - cJSON *itemLocal = OpenAPI_qos_flow_usage_report_convertToJSON(qos_flows_usage_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [qos_flows_usage_data]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_usage_dataList, itemLocal); + OpenAPI_list_for_each(secondary_rat_usage_info->qos_flows_usage_data, node) { + cJSON *itemLocal = OpenAPI_qos_flow_usage_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [qos_flows_usage_data]"); + goto end; } + cJSON_AddItemToArray(qos_flows_usage_dataList, itemLocal); } } @@ -78,17 +86,13 @@ cJSON *OpenAPI_secondary_rat_usage_info_convertToJSON(OpenAPI_secondary_rat_usag ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [pdu_session_usage_data]"); goto end; } - - OpenAPI_lnode_t *pdu_session_usage_data_node; - if (secondary_rat_usage_info->pdu_session_usage_data) { - OpenAPI_list_for_each(secondary_rat_usage_info->pdu_session_usage_data, pdu_session_usage_data_node) { - cJSON *itemLocal = OpenAPI_volume_timed_report_convertToJSON(pdu_session_usage_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [pdu_session_usage_data]"); - goto end; - } - cJSON_AddItemToArray(pdu_session_usage_dataList, itemLocal); + OpenAPI_list_for_each(secondary_rat_usage_info->pdu_session_usage_data, node) { + cJSON *itemLocal = OpenAPI_volume_timed_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_secondary_rat_usage_info_convertToJSON() failed [pdu_session_usage_data]"); + goto end; } + cJSON_AddItemToArray(pdu_session_usage_dataList, itemLocal); } } @@ -99,75 +103,72 @@ end: OpenAPI_secondary_rat_usage_info_t *OpenAPI_secondary_rat_usage_info_parseFromJSON(cJSON *secondary_rat_usage_infoJSON) { OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_info_local_var = NULL; - cJSON *secondary_rat_type = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_infoJSON, "secondaryRatType"); + OpenAPI_lnode_t *node = NULL; + cJSON *secondary_rat_type = NULL; + OpenAPI_rat_type_e secondary_rat_typeVariable = 0; + cJSON *qos_flows_usage_data = NULL; + OpenAPI_list_t *qos_flows_usage_dataList = NULL; + cJSON *pdu_session_usage_data = NULL; + OpenAPI_list_t *pdu_session_usage_dataList = NULL; + secondary_rat_type = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_infoJSON, "secondaryRatType"); if (!secondary_rat_type) { ogs_error("OpenAPI_secondary_rat_usage_info_parseFromJSON() failed [secondary_rat_type]"); goto end; } - - OpenAPI_rat_type_e secondary_rat_typeVariable; if (!cJSON_IsString(secondary_rat_type)) { ogs_error("OpenAPI_secondary_rat_usage_info_parseFromJSON() failed [secondary_rat_type]"); goto end; } secondary_rat_typeVariable = OpenAPI_rat_type_FromString(secondary_rat_type->valuestring); - cJSON *qos_flows_usage_data = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_infoJSON, "qosFlowsUsageData"); - - OpenAPI_list_t *qos_flows_usage_dataList; + qos_flows_usage_data = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_infoJSON, "qosFlowsUsageData"); if (qos_flows_usage_data) { - cJSON *qos_flows_usage_data_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_usage_data)){ - ogs_error("OpenAPI_secondary_rat_usage_info_parseFromJSON() failed [qos_flows_usage_data]"); - goto end; - } - - qos_flows_usage_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_usage_data_local_nonprimitive, qos_flows_usage_data ) { - if (!cJSON_IsObject(qos_flows_usage_data_local_nonprimitive)) { + cJSON *qos_flows_usage_data_local = NULL; + if (!cJSON_IsArray(qos_flows_usage_data)) { ogs_error("OpenAPI_secondary_rat_usage_info_parseFromJSON() failed [qos_flows_usage_data]"); goto end; } - OpenAPI_qos_flow_usage_report_t *qos_flows_usage_dataItem = OpenAPI_qos_flow_usage_report_parseFromJSON(qos_flows_usage_data_local_nonprimitive); - if (!qos_flows_usage_dataItem) { - ogs_error("No qos_flows_usage_dataItem"); - OpenAPI_list_free(qos_flows_usage_dataList); - goto end; + qos_flows_usage_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_usage_data_local, qos_flows_usage_data) { + if (!cJSON_IsObject(qos_flows_usage_data_local)) { + ogs_error("OpenAPI_secondary_rat_usage_info_parseFromJSON() failed [qos_flows_usage_data]"); + goto end; + } + OpenAPI_qos_flow_usage_report_t *qos_flows_usage_dataItem = OpenAPI_qos_flow_usage_report_parseFromJSON(qos_flows_usage_data_local); + if (!qos_flows_usage_dataItem) { + ogs_error("No qos_flows_usage_dataItem"); + OpenAPI_list_free(qos_flows_usage_dataList); + goto end; + } + OpenAPI_list_add(qos_flows_usage_dataList, qos_flows_usage_dataItem); } - - OpenAPI_list_add(qos_flows_usage_dataList, qos_flows_usage_dataItem); - } } - cJSON *pdu_session_usage_data = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_infoJSON, "pduSessionUsageData"); - - OpenAPI_list_t *pdu_session_usage_dataList; + pdu_session_usage_data = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_infoJSON, "pduSessionUsageData"); if (pdu_session_usage_data) { - cJSON *pdu_session_usage_data_local_nonprimitive; - if (!cJSON_IsArray(pdu_session_usage_data)){ - ogs_error("OpenAPI_secondary_rat_usage_info_parseFromJSON() failed [pdu_session_usage_data]"); - goto end; - } - - pdu_session_usage_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_session_usage_data_local_nonprimitive, pdu_session_usage_data ) { - if (!cJSON_IsObject(pdu_session_usage_data_local_nonprimitive)) { + cJSON *pdu_session_usage_data_local = NULL; + if (!cJSON_IsArray(pdu_session_usage_data)) { ogs_error("OpenAPI_secondary_rat_usage_info_parseFromJSON() failed [pdu_session_usage_data]"); goto end; } - OpenAPI_volume_timed_report_t *pdu_session_usage_dataItem = OpenAPI_volume_timed_report_parseFromJSON(pdu_session_usage_data_local_nonprimitive); - if (!pdu_session_usage_dataItem) { - ogs_error("No pdu_session_usage_dataItem"); - OpenAPI_list_free(pdu_session_usage_dataList); - goto end; + pdu_session_usage_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_usage_data_local, pdu_session_usage_data) { + if (!cJSON_IsObject(pdu_session_usage_data_local)) { + ogs_error("OpenAPI_secondary_rat_usage_info_parseFromJSON() failed [pdu_session_usage_data]"); + goto end; + } + OpenAPI_volume_timed_report_t *pdu_session_usage_dataItem = OpenAPI_volume_timed_report_parseFromJSON(pdu_session_usage_data_local); + if (!pdu_session_usage_dataItem) { + ogs_error("No pdu_session_usage_dataItem"); + OpenAPI_list_free(pdu_session_usage_dataList); + goto end; + } + OpenAPI_list_add(pdu_session_usage_dataList, pdu_session_usage_dataItem); } - - OpenAPI_list_add(pdu_session_usage_dataList, pdu_session_usage_dataItem); - } } secondary_rat_usage_info_local_var = OpenAPI_secondary_rat_usage_info_create ( @@ -178,6 +179,20 @@ OpenAPI_secondary_rat_usage_info_t *OpenAPI_secondary_rat_usage_info_parseFromJS return secondary_rat_usage_info_local_var; end: + if (qos_flows_usage_dataList) { + OpenAPI_list_for_each(qos_flows_usage_dataList, node) { + OpenAPI_qos_flow_usage_report_free(node->data); + } + OpenAPI_list_free(qos_flows_usage_dataList); + qos_flows_usage_dataList = NULL; + } + if (pdu_session_usage_dataList) { + OpenAPI_list_for_each(pdu_session_usage_dataList, node) { + OpenAPI_volume_timed_report_free(node->data); + } + OpenAPI_list_free(pdu_session_usage_dataList); + pdu_session_usage_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/secondary_rat_usage_report.c b/lib/sbi/openapi/model/secondary_rat_usage_report.c index 80eedbf70..70b0fefa7 100644 --- a/lib/sbi/openapi/model/secondary_rat_usage_report.c +++ b/lib/sbi/openapi/model/secondary_rat_usage_report.c @@ -20,20 +20,25 @@ OpenAPI_secondary_rat_usage_report_t *OpenAPI_secondary_rat_usage_report_create( void OpenAPI_secondary_rat_usage_report_free(OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == secondary_rat_usage_report) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(secondary_rat_usage_report->qos_flows_usage_data, node) { - OpenAPI_qos_flow_usage_report_free(node->data); + if (secondary_rat_usage_report->qos_flows_usage_data) { + OpenAPI_list_for_each(secondary_rat_usage_report->qos_flows_usage_data, node) { + OpenAPI_qos_flow_usage_report_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_report->qos_flows_usage_data); + secondary_rat_usage_report->qos_flows_usage_data = NULL; } - OpenAPI_list_free(secondary_rat_usage_report->qos_flows_usage_data); ogs_free(secondary_rat_usage_report); } cJSON *OpenAPI_secondary_rat_usage_report_convertToJSON(OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (secondary_rat_usage_report == NULL) { ogs_error("OpenAPI_secondary_rat_usage_report_convertToJSON() failed [SecondaryRatUsageReport]"); @@ -41,27 +46,31 @@ cJSON *OpenAPI_secondary_rat_usage_report_convertToJSON(OpenAPI_secondary_rat_us } item = cJSON_CreateObject(); + if (secondary_rat_usage_report->secondary_rat_type == OpenAPI_rat_type_NULL) { + ogs_error("OpenAPI_secondary_rat_usage_report_convertToJSON() failed [secondary_rat_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "secondaryRatType", OpenAPI_rat_type_ToString(secondary_rat_usage_report->secondary_rat_type)) == NULL) { ogs_error("OpenAPI_secondary_rat_usage_report_convertToJSON() failed [secondary_rat_type]"); goto end; } + if (!secondary_rat_usage_report->qos_flows_usage_data) { + ogs_error("OpenAPI_secondary_rat_usage_report_convertToJSON() failed [qos_flows_usage_data]"); + return NULL; + } cJSON *qos_flows_usage_dataList = cJSON_AddArrayToObject(item, "qosFlowsUsageData"); if (qos_flows_usage_dataList == NULL) { ogs_error("OpenAPI_secondary_rat_usage_report_convertToJSON() failed [qos_flows_usage_data]"); goto end; } - - OpenAPI_lnode_t *qos_flows_usage_data_node; - if (secondary_rat_usage_report->qos_flows_usage_data) { - OpenAPI_list_for_each(secondary_rat_usage_report->qos_flows_usage_data, qos_flows_usage_data_node) { - cJSON *itemLocal = OpenAPI_qos_flow_usage_report_convertToJSON(qos_flows_usage_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_secondary_rat_usage_report_convertToJSON() failed [qos_flows_usage_data]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_usage_dataList, itemLocal); + OpenAPI_list_for_each(secondary_rat_usage_report->qos_flows_usage_data, node) { + cJSON *itemLocal = OpenAPI_qos_flow_usage_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_secondary_rat_usage_report_convertToJSON() failed [qos_flows_usage_data]"); + goto end; } + cJSON_AddItemToArray(qos_flows_usage_dataList, itemLocal); } end: @@ -71,50 +80,49 @@ end: OpenAPI_secondary_rat_usage_report_t *OpenAPI_secondary_rat_usage_report_parseFromJSON(cJSON *secondary_rat_usage_reportJSON) { OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_report_local_var = NULL; - cJSON *secondary_rat_type = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_reportJSON, "secondaryRatType"); + OpenAPI_lnode_t *node = NULL; + cJSON *secondary_rat_type = NULL; + OpenAPI_rat_type_e secondary_rat_typeVariable = 0; + cJSON *qos_flows_usage_data = NULL; + OpenAPI_list_t *qos_flows_usage_dataList = NULL; + secondary_rat_type = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_reportJSON, "secondaryRatType"); if (!secondary_rat_type) { ogs_error("OpenAPI_secondary_rat_usage_report_parseFromJSON() failed [secondary_rat_type]"); goto end; } - - OpenAPI_rat_type_e secondary_rat_typeVariable; if (!cJSON_IsString(secondary_rat_type)) { ogs_error("OpenAPI_secondary_rat_usage_report_parseFromJSON() failed [secondary_rat_type]"); goto end; } secondary_rat_typeVariable = OpenAPI_rat_type_FromString(secondary_rat_type->valuestring); - cJSON *qos_flows_usage_data = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_reportJSON, "qosFlowsUsageData"); + qos_flows_usage_data = cJSON_GetObjectItemCaseSensitive(secondary_rat_usage_reportJSON, "qosFlowsUsageData"); if (!qos_flows_usage_data) { ogs_error("OpenAPI_secondary_rat_usage_report_parseFromJSON() failed [qos_flows_usage_data]"); goto end; } - - OpenAPI_list_t *qos_flows_usage_dataList; - cJSON *qos_flows_usage_data_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_usage_data)){ - ogs_error("OpenAPI_secondary_rat_usage_report_parseFromJSON() failed [qos_flows_usage_data]"); - goto end; - } - - qos_flows_usage_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_usage_data_local_nonprimitive, qos_flows_usage_data ) { - if (!cJSON_IsObject(qos_flows_usage_data_local_nonprimitive)) { + cJSON *qos_flows_usage_data_local = NULL; + if (!cJSON_IsArray(qos_flows_usage_data)) { ogs_error("OpenAPI_secondary_rat_usage_report_parseFromJSON() failed [qos_flows_usage_data]"); goto end; } - OpenAPI_qos_flow_usage_report_t *qos_flows_usage_dataItem = OpenAPI_qos_flow_usage_report_parseFromJSON(qos_flows_usage_data_local_nonprimitive); - if (!qos_flows_usage_dataItem) { - ogs_error("No qos_flows_usage_dataItem"); - OpenAPI_list_free(qos_flows_usage_dataList); - goto end; + qos_flows_usage_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_usage_data_local, qos_flows_usage_data) { + if (!cJSON_IsObject(qos_flows_usage_data_local)) { + ogs_error("OpenAPI_secondary_rat_usage_report_parseFromJSON() failed [qos_flows_usage_data]"); + goto end; + } + OpenAPI_qos_flow_usage_report_t *qos_flows_usage_dataItem = OpenAPI_qos_flow_usage_report_parseFromJSON(qos_flows_usage_data_local); + if (!qos_flows_usage_dataItem) { + ogs_error("No qos_flows_usage_dataItem"); + OpenAPI_list_free(qos_flows_usage_dataList); + goto end; + } + OpenAPI_list_add(qos_flows_usage_dataList, qos_flows_usage_dataItem); } - OpenAPI_list_add(qos_flows_usage_dataList, qos_flows_usage_dataItem); - } - secondary_rat_usage_report_local_var = OpenAPI_secondary_rat_usage_report_create ( secondary_rat_typeVariable, qos_flows_usage_dataList @@ -122,6 +130,13 @@ OpenAPI_secondary_rat_usage_report_t *OpenAPI_secondary_rat_usage_report_parseFr return secondary_rat_usage_report_local_var; end: + if (qos_flows_usage_dataList) { + OpenAPI_list_for_each(qos_flows_usage_dataList, node) { + OpenAPI_qos_flow_usage_report_free(node->data); + } + OpenAPI_list_free(qos_flows_usage_dataList); + qos_flows_usage_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/security_result.c b/lib/sbi/openapi/model/security_result.c index c9684c015..e114af3a8 100644 --- a/lib/sbi/openapi/model/security_result.c +++ b/lib/sbi/openapi/model/security_result.c @@ -20,16 +20,18 @@ OpenAPI_security_result_t *OpenAPI_security_result_create( void OpenAPI_security_result_free(OpenAPI_security_result_t *security_result) { + OpenAPI_lnode_t *node = NULL; + if (NULL == security_result) { return; } - OpenAPI_lnode_t *node; ogs_free(security_result); } cJSON *OpenAPI_security_result_convertToJSON(OpenAPI_security_result_t *security_result) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (security_result == NULL) { ogs_error("OpenAPI_security_result_convertToJSON() failed [SecurityResult]"); @@ -37,14 +39,14 @@ cJSON *OpenAPI_security_result_convertToJSON(OpenAPI_security_result_t *security } item = cJSON_CreateObject(); - if (security_result->integrity_protection_result) { + if (security_result->integrity_protection_result != OpenAPI_protection_result_NULL) { if (cJSON_AddStringToObject(item, "integrityProtectionResult", OpenAPI_protection_result_ToString(security_result->integrity_protection_result)) == NULL) { ogs_error("OpenAPI_security_result_convertToJSON() failed [integrity_protection_result]"); goto end; } } - if (security_result->confidentiality_protection_result) { + if (security_result->confidentiality_protection_result != OpenAPI_protection_result_NULL) { if (cJSON_AddStringToObject(item, "confidentialityProtectionResult", OpenAPI_protection_result_ToString(security_result->confidentiality_protection_result)) == NULL) { ogs_error("OpenAPI_security_result_convertToJSON() failed [confidentiality_protection_result]"); goto end; @@ -58,9 +60,12 @@ end: OpenAPI_security_result_t *OpenAPI_security_result_parseFromJSON(cJSON *security_resultJSON) { OpenAPI_security_result_t *security_result_local_var = NULL; - cJSON *integrity_protection_result = cJSON_GetObjectItemCaseSensitive(security_resultJSON, "integrityProtectionResult"); - - OpenAPI_protection_result_e integrity_protection_resultVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *integrity_protection_result = NULL; + OpenAPI_protection_result_e integrity_protection_resultVariable = 0; + cJSON *confidentiality_protection_result = NULL; + OpenAPI_protection_result_e confidentiality_protection_resultVariable = 0; + integrity_protection_result = cJSON_GetObjectItemCaseSensitive(security_resultJSON, "integrityProtectionResult"); if (integrity_protection_result) { if (!cJSON_IsString(integrity_protection_result)) { ogs_error("OpenAPI_security_result_parseFromJSON() failed [integrity_protection_result]"); @@ -69,9 +74,7 @@ OpenAPI_security_result_t *OpenAPI_security_result_parseFromJSON(cJSON *security integrity_protection_resultVariable = OpenAPI_protection_result_FromString(integrity_protection_result->valuestring); } - cJSON *confidentiality_protection_result = cJSON_GetObjectItemCaseSensitive(security_resultJSON, "confidentialityProtectionResult"); - - OpenAPI_protection_result_e confidentiality_protection_resultVariable; + confidentiality_protection_result = cJSON_GetObjectItemCaseSensitive(security_resultJSON, "confidentialityProtectionResult"); if (confidentiality_protection_result) { if (!cJSON_IsString(confidentiality_protection_result)) { ogs_error("OpenAPI_security_result_parseFromJSON() failed [confidentiality_protection_result]"); diff --git a/lib/sbi/openapi/model/send_mo_data_req_data.c b/lib/sbi/openapi/model/send_mo_data_req_data.c index 9c9a39864..8fe315bac 100644 --- a/lib/sbi/openapi/model/send_mo_data_req_data.c +++ b/lib/sbi/openapi/model/send_mo_data_req_data.c @@ -22,19 +22,30 @@ OpenAPI_send_mo_data_req_data_t *OpenAPI_send_mo_data_req_data_create( void OpenAPI_send_mo_data_req_data_free(OpenAPI_send_mo_data_req_data_t *send_mo_data_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == send_mo_data_req_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ref_to_binary_data_free(send_mo_data_req_data->mo_data); - OpenAPI_mo_exp_data_counter_free(send_mo_data_req_data->mo_exp_data_counter); - OpenAPI_user_location_free(send_mo_data_req_data->ue_location); + if (send_mo_data_req_data->mo_data) { + OpenAPI_ref_to_binary_data_free(send_mo_data_req_data->mo_data); + send_mo_data_req_data->mo_data = NULL; + } + if (send_mo_data_req_data->mo_exp_data_counter) { + OpenAPI_mo_exp_data_counter_free(send_mo_data_req_data->mo_exp_data_counter); + send_mo_data_req_data->mo_exp_data_counter = NULL; + } + if (send_mo_data_req_data->ue_location) { + OpenAPI_user_location_free(send_mo_data_req_data->ue_location); + send_mo_data_req_data->ue_location = NULL; + } ogs_free(send_mo_data_req_data); } cJSON *OpenAPI_send_mo_data_req_data_convertToJSON(OpenAPI_send_mo_data_req_data_t *send_mo_data_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (send_mo_data_req_data == NULL) { ogs_error("OpenAPI_send_mo_data_req_data_convertToJSON() failed [SendMoDataReqData]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_send_mo_data_req_data_convertToJSON(OpenAPI_send_mo_data_req_data } item = cJSON_CreateObject(); + if (!send_mo_data_req_data->mo_data) { + ogs_error("OpenAPI_send_mo_data_req_data_convertToJSON() failed [mo_data]"); + return NULL; + } cJSON *mo_data_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(send_mo_data_req_data->mo_data); if (mo_data_local_JSON == NULL) { ogs_error("OpenAPI_send_mo_data_req_data_convertToJSON() failed [mo_data]"); @@ -86,25 +101,26 @@ end: OpenAPI_send_mo_data_req_data_t *OpenAPI_send_mo_data_req_data_parseFromJSON(cJSON *send_mo_data_req_dataJSON) { OpenAPI_send_mo_data_req_data_t *send_mo_data_req_data_local_var = NULL; - cJSON *mo_data = cJSON_GetObjectItemCaseSensitive(send_mo_data_req_dataJSON, "moData"); + OpenAPI_lnode_t *node = NULL; + cJSON *mo_data = NULL; + OpenAPI_ref_to_binary_data_t *mo_data_local_nonprim = NULL; + cJSON *mo_exp_data_counter = NULL; + OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + mo_data = cJSON_GetObjectItemCaseSensitive(send_mo_data_req_dataJSON, "moData"); if (!mo_data) { ogs_error("OpenAPI_send_mo_data_req_data_parseFromJSON() failed [mo_data]"); goto end; } - - OpenAPI_ref_to_binary_data_t *mo_data_local_nonprim = NULL; mo_data_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(mo_data); - cJSON *mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(send_mo_data_req_dataJSON, "moExpDataCounter"); - - OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(send_mo_data_req_dataJSON, "moExpDataCounter"); if (mo_exp_data_counter) { mo_exp_data_counter_local_nonprim = OpenAPI_mo_exp_data_counter_parseFromJSON(mo_exp_data_counter); } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(send_mo_data_req_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(send_mo_data_req_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } @@ -117,6 +133,18 @@ OpenAPI_send_mo_data_req_data_t *OpenAPI_send_mo_data_req_data_parseFromJSON(cJS return send_mo_data_req_data_local_var; end: + if (mo_data_local_nonprim) { + OpenAPI_ref_to_binary_data_free(mo_data_local_nonprim); + mo_data_local_nonprim = NULL; + } + if (mo_exp_data_counter_local_nonprim) { + OpenAPI_mo_exp_data_counter_free(mo_exp_data_counter_local_nonprim); + mo_exp_data_counter_local_nonprim = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/send_mo_data_request.c b/lib/sbi/openapi/model/send_mo_data_request.c new file mode 100644 index 000000000..6b63e589a --- /dev/null +++ b/lib/sbi/openapi/model/send_mo_data_request.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "send_mo_data_request.h" + +OpenAPI_send_mo_data_request_t *OpenAPI_send_mo_data_request_create( + OpenAPI_send_mo_data_req_data_t *json_data, + OpenAPI_binary_t* binary_mo_data +) +{ + OpenAPI_send_mo_data_request_t *send_mo_data_request_local_var = ogs_malloc(sizeof(OpenAPI_send_mo_data_request_t)); + ogs_assert(send_mo_data_request_local_var); + + send_mo_data_request_local_var->json_data = json_data; + send_mo_data_request_local_var->binary_mo_data = binary_mo_data; + + return send_mo_data_request_local_var; +} + +void OpenAPI_send_mo_data_request_free(OpenAPI_send_mo_data_request_t *send_mo_data_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == send_mo_data_request) { + return; + } + if (send_mo_data_request->json_data) { + OpenAPI_send_mo_data_req_data_free(send_mo_data_request->json_data); + send_mo_data_request->json_data = NULL; + } + if (send_mo_data_request->binary_mo_data) { + ogs_free(send_mo_data_request->binary_mo_data->data); + send_mo_data_request->binary_mo_data = NULL; + } + ogs_free(send_mo_data_request); +} + +cJSON *OpenAPI_send_mo_data_request_convertToJSON(OpenAPI_send_mo_data_request_t *send_mo_data_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (send_mo_data_request == NULL) { + ogs_error("OpenAPI_send_mo_data_request_convertToJSON() failed [SendMoData_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (send_mo_data_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_send_mo_data_req_data_convertToJSON(send_mo_data_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_send_mo_data_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_send_mo_data_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (send_mo_data_request->binary_mo_data) { + char* encoded_str_binary_mo_data = OpenAPI_base64encode(send_mo_data_request->binary_mo_data->data,send_mo_data_request->binary_mo_data->len); + if (cJSON_AddStringToObject(item, "binaryMoData", encoded_str_binary_mo_data) == NULL) { + ogs_error("OpenAPI_send_mo_data_request_convertToJSON() failed [binary_mo_data]"); + goto end; + } + ogs_free(encoded_str_binary_mo_data); + } + +end: + return item; +} + +OpenAPI_send_mo_data_request_t *OpenAPI_send_mo_data_request_parseFromJSON(cJSON *send_mo_data_requestJSON) +{ + OpenAPI_send_mo_data_request_t *send_mo_data_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_send_mo_data_req_data_t *json_data_local_nonprim = NULL; + cJSON *binary_mo_data = NULL; + OpenAPI_binary_t *decoded_str_binary_mo_data = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(send_mo_data_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_send_mo_data_req_data_parseFromJSON(json_data); + } + + binary_mo_data = cJSON_GetObjectItemCaseSensitive(send_mo_data_requestJSON, "binaryMoData"); + if (binary_mo_data) { + decoded_str_binary_mo_data = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_mo_data); + if (!cJSON_IsString(binary_mo_data)) { + ogs_error("OpenAPI_send_mo_data_request_parseFromJSON() failed [binary_mo_data]"); + goto end; + } + decoded_str_binary_mo_data->data = OpenAPI_base64decode(binary_mo_data->valuestring, strlen(binary_mo_data->valuestring), &decoded_str_binary_mo_data->len); + if (!decoded_str_binary_mo_data->data) { + ogs_error("OpenAPI_send_mo_data_request_parseFromJSON() failed [binary_mo_data]"); + goto end; + } + } + + send_mo_data_request_local_var = OpenAPI_send_mo_data_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_mo_data ? decoded_str_binary_mo_data : NULL + ); + + return send_mo_data_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_send_mo_data_req_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_send_mo_data_request_t *OpenAPI_send_mo_data_request_copy(OpenAPI_send_mo_data_request_t *dst, OpenAPI_send_mo_data_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_send_mo_data_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_send_mo_data_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_send_mo_data_request_free(dst); + dst = OpenAPI_send_mo_data_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/send_mo_data_request.h b/lib/sbi/openapi/model/send_mo_data_request.h new file mode 100644 index 000000000..ce9809591 --- /dev/null +++ b/lib/sbi/openapi/model/send_mo_data_request.h @@ -0,0 +1,41 @@ +/* + * send_mo_data_request.h + * + * + */ + +#ifndef _OpenAPI_send_mo_data_request_H_ +#define _OpenAPI_send_mo_data_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "send_mo_data_req_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_send_mo_data_request_s OpenAPI_send_mo_data_request_t; +typedef struct OpenAPI_send_mo_data_request_s { + struct OpenAPI_send_mo_data_req_data_s *json_data; + OpenAPI_binary_t* binary_mo_data; +} OpenAPI_send_mo_data_request_t; + +OpenAPI_send_mo_data_request_t *OpenAPI_send_mo_data_request_create( + OpenAPI_send_mo_data_req_data_t *json_data, + OpenAPI_binary_t* binary_mo_data +); +void OpenAPI_send_mo_data_request_free(OpenAPI_send_mo_data_request_t *send_mo_data_request); +OpenAPI_send_mo_data_request_t *OpenAPI_send_mo_data_request_parseFromJSON(cJSON *send_mo_data_requestJSON); +cJSON *OpenAPI_send_mo_data_request_convertToJSON(OpenAPI_send_mo_data_request_t *send_mo_data_request); +OpenAPI_send_mo_data_request_t *OpenAPI_send_mo_data_request_copy(OpenAPI_send_mo_data_request_t *dst, OpenAPI_send_mo_data_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_send_mo_data_request_H_ */ + diff --git a/lib/sbi/openapi/model/sequence_number.c b/lib/sbi/openapi/model/sequence_number.c index 1c3c98451..684bac80d 100644 --- a/lib/sbi/openapi/model/sequence_number.c +++ b/lib/sbi/openapi/model/sequence_number.c @@ -28,24 +28,32 @@ OpenAPI_sequence_number_t *OpenAPI_sequence_number_create( void OpenAPI_sequence_number_free(OpenAPI_sequence_number_t *sequence_number) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sequence_number) { return; } - OpenAPI_lnode_t *node; - ogs_free(sequence_number->sqn); - OpenAPI_list_for_each(sequence_number->last_indexes, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sequence_number->sqn) { + ogs_free(sequence_number->sqn); + sequence_number->sqn = NULL; + } + if (sequence_number->last_indexes) { + OpenAPI_list_for_each(sequence_number->last_indexes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sequence_number->last_indexes); + sequence_number->last_indexes = NULL; } - OpenAPI_list_free(sequence_number->last_indexes); ogs_free(sequence_number); } cJSON *OpenAPI_sequence_number_convertToJSON(OpenAPI_sequence_number_t *sequence_number) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sequence_number == NULL) { ogs_error("OpenAPI_sequence_number_convertToJSON() failed [SequenceNumber]"); @@ -53,7 +61,7 @@ cJSON *OpenAPI_sequence_number_convertToJSON(OpenAPI_sequence_number_t *sequence } item = cJSON_CreateObject(); - if (sequence_number->sqn_scheme) { + if (sequence_number->sqn_scheme != OpenAPI_sqn_scheme_NULL) { if (cJSON_AddStringToObject(item, "sqnScheme", OpenAPI_sqn_scheme_ToString(sequence_number->sqn_scheme)) == NULL) { ogs_error("OpenAPI_sequence_number_convertToJSON() failed [sqn_scheme]"); goto end; @@ -74,17 +82,16 @@ cJSON *OpenAPI_sequence_number_convertToJSON(OpenAPI_sequence_number_t *sequence goto end; } cJSON *localMapObject = last_indexes; - OpenAPI_lnode_t *last_indexes_node; if (sequence_number->last_indexes) { - OpenAPI_list_for_each(sequence_number->last_indexes, last_indexes_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)last_indexes_node->data; - if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, *(double *)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_sequence_number_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(sequence_number->last_indexes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, (uintptr_t)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_sequence_number_convertToJSON() failed [inner]"); + goto end; } } } + } if (sequence_number->is_ind_length) { if (cJSON_AddNumberToObject(item, "indLength", sequence_number->ind_length) == NULL) { @@ -93,7 +100,7 @@ cJSON *OpenAPI_sequence_number_convertToJSON(OpenAPI_sequence_number_t *sequence } } - if (sequence_number->dif_sign) { + if (sequence_number->dif_sign != OpenAPI_sign_NULL) { if (cJSON_AddStringToObject(item, "difSign", OpenAPI_sign_ToString(sequence_number->dif_sign)) == NULL) { ogs_error("OpenAPI_sequence_number_convertToJSON() failed [dif_sign]"); goto end; @@ -107,9 +114,16 @@ end: OpenAPI_sequence_number_t *OpenAPI_sequence_number_parseFromJSON(cJSON *sequence_numberJSON) { OpenAPI_sequence_number_t *sequence_number_local_var = NULL; - cJSON *sqn_scheme = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "sqnScheme"); - - OpenAPI_sqn_scheme_e sqn_schemeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *sqn_scheme = NULL; + OpenAPI_sqn_scheme_e sqn_schemeVariable = 0; + cJSON *sqn = NULL; + cJSON *last_indexes = NULL; + OpenAPI_list_t *last_indexesList = NULL; + cJSON *ind_length = NULL; + cJSON *dif_sign = NULL; + OpenAPI_sign_e dif_signVariable = 0; + sqn_scheme = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "sqnScheme"); if (sqn_scheme) { if (!cJSON_IsString(sqn_scheme)) { ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [sqn_scheme]"); @@ -118,39 +132,45 @@ OpenAPI_sequence_number_t *OpenAPI_sequence_number_parseFromJSON(cJSON *sequence sqn_schemeVariable = OpenAPI_sqn_scheme_FromString(sqn_scheme->valuestring); } - cJSON *sqn = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "sqn"); - + sqn = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "sqn"); if (sqn) { - if (!cJSON_IsString(sqn)) { + if (!cJSON_IsString(sqn) && !cJSON_IsNull(sqn)) { ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [sqn]"); goto end; } } - cJSON *last_indexes = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "lastIndexes"); - - OpenAPI_list_t *last_indexesList; + last_indexes = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "lastIndexes"); if (last_indexes) { - cJSON *last_indexes_local_map; - if (!cJSON_IsObject(last_indexes)) { - ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [last_indexes]"); - goto end; - } - last_indexesList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(last_indexes_local_map, last_indexes) { - cJSON *localMapObject = last_indexes_local_map; - if (!cJSON_IsNumber(localMapObject)) { - ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [inner]"); + cJSON *last_indexes_local_map = NULL; + if (!cJSON_IsObject(last_indexes) && !cJSON_IsNull(last_indexes)) { + ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [last_indexes]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),&localMapObject->valuedouble ); - OpenAPI_list_add(last_indexesList, localMapKeyPair); - } + if (cJSON_IsObject(last_indexes)) { + last_indexesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(last_indexes_local_map, last_indexes) { + cJSON *localMapObject = last_indexes_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(localMapObject)) { + ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [inner]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [inner]"); + goto end; + } + *localDouble = localMapObject->valuedouble; + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), localDouble); + OpenAPI_list_add(last_indexesList, localMapKeyPair); + } + } } - cJSON *ind_length = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "indLength"); - + ind_length = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "indLength"); if (ind_length) { if (!cJSON_IsNumber(ind_length)) { ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [ind_length]"); @@ -158,9 +178,7 @@ OpenAPI_sequence_number_t *OpenAPI_sequence_number_parseFromJSON(cJSON *sequence } } - cJSON *dif_sign = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "difSign"); - - OpenAPI_sign_e dif_signVariable; + dif_sign = cJSON_GetObjectItemCaseSensitive(sequence_numberJSON, "difSign"); if (dif_sign) { if (!cJSON_IsString(dif_sign)) { ogs_error("OpenAPI_sequence_number_parseFromJSON() failed [dif_sign]"); @@ -171,7 +189,7 @@ OpenAPI_sequence_number_t *OpenAPI_sequence_number_parseFromJSON(cJSON *sequence sequence_number_local_var = OpenAPI_sequence_number_create ( sqn_scheme ? sqn_schemeVariable : 0, - sqn ? ogs_strdup(sqn->valuestring) : NULL, + sqn && !cJSON_IsNull(sqn) ? ogs_strdup(sqn->valuestring) : NULL, last_indexes ? last_indexesList : NULL, ind_length ? true : false, ind_length ? ind_length->valuedouble : 0, @@ -180,6 +198,16 @@ OpenAPI_sequence_number_t *OpenAPI_sequence_number_parseFromJSON(cJSON *sequence return sequence_number_local_var; end: + if (last_indexesList) { + OpenAPI_list_for_each(last_indexesList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(last_indexesList); + last_indexesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/service_area_restriction.c b/lib/sbi/openapi/model/service_area_restriction.c index fe3462b37..785949c00 100644 --- a/lib/sbi/openapi/model/service_area_restriction.c +++ b/lib/sbi/openapi/model/service_area_restriction.c @@ -28,20 +28,25 @@ OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_create( void OpenAPI_service_area_restriction_free(OpenAPI_service_area_restriction_t *service_area_restriction) { + OpenAPI_lnode_t *node = NULL; + if (NULL == service_area_restriction) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(service_area_restriction->areas, node) { - OpenAPI_area_free(node->data); + if (service_area_restriction->areas) { + OpenAPI_list_for_each(service_area_restriction->areas, node) { + OpenAPI_area_free(node->data); + } + OpenAPI_list_free(service_area_restriction->areas); + service_area_restriction->areas = NULL; } - OpenAPI_list_free(service_area_restriction->areas); ogs_free(service_area_restriction); } cJSON *OpenAPI_service_area_restriction_convertToJSON(OpenAPI_service_area_restriction_t *service_area_restriction) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (service_area_restriction == NULL) { ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [ServiceAreaRestriction]"); @@ -49,7 +54,7 @@ cJSON *OpenAPI_service_area_restriction_convertToJSON(OpenAPI_service_area_restr } item = cJSON_CreateObject(); - if (service_area_restriction->restriction_type) { + if (service_area_restriction->restriction_type != OpenAPI_restriction_type_NULL) { if (cJSON_AddStringToObject(item, "restrictionType", OpenAPI_restriction_type_ToString(service_area_restriction->restriction_type)) == NULL) { ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [restriction_type]"); goto end; @@ -62,17 +67,13 @@ cJSON *OpenAPI_service_area_restriction_convertToJSON(OpenAPI_service_area_restr ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [areas]"); goto end; } - - OpenAPI_lnode_t *areas_node; - if (service_area_restriction->areas) { - OpenAPI_list_for_each(service_area_restriction->areas, areas_node) { - cJSON *itemLocal = OpenAPI_area_convertToJSON(areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [areas]"); - goto end; - } - cJSON_AddItemToArray(areasList, itemLocal); + OpenAPI_list_for_each(service_area_restriction->areas, node) { + cJSON *itemLocal = OpenAPI_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_service_area_restriction_convertToJSON() failed [areas]"); + goto end; } + cJSON_AddItemToArray(areasList, itemLocal); } } @@ -97,9 +98,14 @@ end: OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_parseFromJSON(cJSON *service_area_restrictionJSON) { OpenAPI_service_area_restriction_t *service_area_restriction_local_var = NULL; - cJSON *restriction_type = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "restrictionType"); - - OpenAPI_restriction_type_e restriction_typeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *restriction_type = NULL; + OpenAPI_restriction_type_e restriction_typeVariable = 0; + cJSON *areas = NULL; + OpenAPI_list_t *areasList = NULL; + cJSON *max_num_of_tas = NULL; + cJSON *max_num_of_tas_for_not_allowed_areas = NULL; + restriction_type = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "restrictionType"); if (restriction_type) { if (!cJSON_IsString(restriction_type)) { ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [restriction_type]"); @@ -108,37 +114,32 @@ OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_parseFromJS restriction_typeVariable = OpenAPI_restriction_type_FromString(restriction_type->valuestring); } - cJSON *areas = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "areas"); - - OpenAPI_list_t *areasList; + areas = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "areas"); if (areas) { - cJSON *areas_local_nonprimitive; - if (!cJSON_IsArray(areas)){ - ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [areas]"); - goto end; - } - - areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(areas_local_nonprimitive, areas ) { - if (!cJSON_IsObject(areas_local_nonprimitive)) { + cJSON *areas_local = NULL; + if (!cJSON_IsArray(areas)) { ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [areas]"); goto end; } - OpenAPI_area_t *areasItem = OpenAPI_area_parseFromJSON(areas_local_nonprimitive); - if (!areasItem) { - ogs_error("No areasItem"); - OpenAPI_list_free(areasList); - goto end; + areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(areas_local, areas) { + if (!cJSON_IsObject(areas_local)) { + ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [areas]"); + goto end; + } + OpenAPI_area_t *areasItem = OpenAPI_area_parseFromJSON(areas_local); + if (!areasItem) { + ogs_error("No areasItem"); + OpenAPI_list_free(areasList); + goto end; + } + OpenAPI_list_add(areasList, areasItem); } - - OpenAPI_list_add(areasList, areasItem); - } } - cJSON *max_num_of_tas = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "maxNumOfTAs"); - + max_num_of_tas = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "maxNumOfTAs"); if (max_num_of_tas) { if (!cJSON_IsNumber(max_num_of_tas)) { ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [max_num_of_tas]"); @@ -146,8 +147,7 @@ OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_parseFromJS } } - cJSON *max_num_of_tas_for_not_allowed_areas = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "maxNumOfTAsForNotAllowedAreas"); - + max_num_of_tas_for_not_allowed_areas = cJSON_GetObjectItemCaseSensitive(service_area_restrictionJSON, "maxNumOfTAsForNotAllowedAreas"); if (max_num_of_tas_for_not_allowed_areas) { if (!cJSON_IsNumber(max_num_of_tas_for_not_allowed_areas)) { ogs_error("OpenAPI_service_area_restriction_parseFromJSON() failed [max_num_of_tas_for_not_allowed_areas]"); @@ -166,6 +166,13 @@ OpenAPI_service_area_restriction_t *OpenAPI_service_area_restriction_parseFromJS return service_area_restriction_local_var; end: + if (areasList) { + OpenAPI_list_for_each(areasList, node) { + OpenAPI_area_free(node->data); + } + OpenAPI_list_free(areasList); + areasList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/service_area_restriction_1.c b/lib/sbi/openapi/model/service_area_restriction_1.c index 21403977c..4e86a9a02 100644 --- a/lib/sbi/openapi/model/service_area_restriction_1.c +++ b/lib/sbi/openapi/model/service_area_restriction_1.c @@ -28,20 +28,25 @@ OpenAPI_service_area_restriction_1_t *OpenAPI_service_area_restriction_1_create( void OpenAPI_service_area_restriction_1_free(OpenAPI_service_area_restriction_1_t *service_area_restriction_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == service_area_restriction_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(service_area_restriction_1->areas, node) { - OpenAPI_area_1_free(node->data); + if (service_area_restriction_1->areas) { + OpenAPI_list_for_each(service_area_restriction_1->areas, node) { + OpenAPI_area_1_free(node->data); + } + OpenAPI_list_free(service_area_restriction_1->areas); + service_area_restriction_1->areas = NULL; } - OpenAPI_list_free(service_area_restriction_1->areas); ogs_free(service_area_restriction_1); } cJSON *OpenAPI_service_area_restriction_1_convertToJSON(OpenAPI_service_area_restriction_1_t *service_area_restriction_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (service_area_restriction_1 == NULL) { ogs_error("OpenAPI_service_area_restriction_1_convertToJSON() failed [ServiceAreaRestriction_1]"); @@ -49,7 +54,7 @@ cJSON *OpenAPI_service_area_restriction_1_convertToJSON(OpenAPI_service_area_res } item = cJSON_CreateObject(); - if (service_area_restriction_1->restriction_type) { + if (service_area_restriction_1->restriction_type != OpenAPI_restriction_type_NULL) { if (cJSON_AddStringToObject(item, "restrictionType", OpenAPI_restriction_type_ToString(service_area_restriction_1->restriction_type)) == NULL) { ogs_error("OpenAPI_service_area_restriction_1_convertToJSON() failed [restriction_type]"); goto end; @@ -62,17 +67,13 @@ cJSON *OpenAPI_service_area_restriction_1_convertToJSON(OpenAPI_service_area_res ogs_error("OpenAPI_service_area_restriction_1_convertToJSON() failed [areas]"); goto end; } - - OpenAPI_lnode_t *areas_node; - if (service_area_restriction_1->areas) { - OpenAPI_list_for_each(service_area_restriction_1->areas, areas_node) { - cJSON *itemLocal = OpenAPI_area_1_convertToJSON(areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_service_area_restriction_1_convertToJSON() failed [areas]"); - goto end; - } - cJSON_AddItemToArray(areasList, itemLocal); + OpenAPI_list_for_each(service_area_restriction_1->areas, node) { + cJSON *itemLocal = OpenAPI_area_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_service_area_restriction_1_convertToJSON() failed [areas]"); + goto end; } + cJSON_AddItemToArray(areasList, itemLocal); } } @@ -97,9 +98,14 @@ end: OpenAPI_service_area_restriction_1_t *OpenAPI_service_area_restriction_1_parseFromJSON(cJSON *service_area_restriction_1JSON) { OpenAPI_service_area_restriction_1_t *service_area_restriction_1_local_var = NULL; - cJSON *restriction_type = cJSON_GetObjectItemCaseSensitive(service_area_restriction_1JSON, "restrictionType"); - - OpenAPI_restriction_type_e restriction_typeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *restriction_type = NULL; + OpenAPI_restriction_type_e restriction_typeVariable = 0; + cJSON *areas = NULL; + OpenAPI_list_t *areasList = NULL; + cJSON *max_num_of_tas = NULL; + cJSON *max_num_of_tas_for_not_allowed_areas = NULL; + restriction_type = cJSON_GetObjectItemCaseSensitive(service_area_restriction_1JSON, "restrictionType"); if (restriction_type) { if (!cJSON_IsString(restriction_type)) { ogs_error("OpenAPI_service_area_restriction_1_parseFromJSON() failed [restriction_type]"); @@ -108,37 +114,32 @@ OpenAPI_service_area_restriction_1_t *OpenAPI_service_area_restriction_1_parseFr restriction_typeVariable = OpenAPI_restriction_type_FromString(restriction_type->valuestring); } - cJSON *areas = cJSON_GetObjectItemCaseSensitive(service_area_restriction_1JSON, "areas"); - - OpenAPI_list_t *areasList; + areas = cJSON_GetObjectItemCaseSensitive(service_area_restriction_1JSON, "areas"); if (areas) { - cJSON *areas_local_nonprimitive; - if (!cJSON_IsArray(areas)){ - ogs_error("OpenAPI_service_area_restriction_1_parseFromJSON() failed [areas]"); - goto end; - } - - areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(areas_local_nonprimitive, areas ) { - if (!cJSON_IsObject(areas_local_nonprimitive)) { + cJSON *areas_local = NULL; + if (!cJSON_IsArray(areas)) { ogs_error("OpenAPI_service_area_restriction_1_parseFromJSON() failed [areas]"); goto end; } - OpenAPI_area_1_t *areasItem = OpenAPI_area_1_parseFromJSON(areas_local_nonprimitive); - if (!areasItem) { - ogs_error("No areasItem"); - OpenAPI_list_free(areasList); - goto end; + areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(areas_local, areas) { + if (!cJSON_IsObject(areas_local)) { + ogs_error("OpenAPI_service_area_restriction_1_parseFromJSON() failed [areas]"); + goto end; + } + OpenAPI_area_1_t *areasItem = OpenAPI_area_1_parseFromJSON(areas_local); + if (!areasItem) { + ogs_error("No areasItem"); + OpenAPI_list_free(areasList); + goto end; + } + OpenAPI_list_add(areasList, areasItem); } - - OpenAPI_list_add(areasList, areasItem); - } } - cJSON *max_num_of_tas = cJSON_GetObjectItemCaseSensitive(service_area_restriction_1JSON, "maxNumOfTAs"); - + max_num_of_tas = cJSON_GetObjectItemCaseSensitive(service_area_restriction_1JSON, "maxNumOfTAs"); if (max_num_of_tas) { if (!cJSON_IsNumber(max_num_of_tas)) { ogs_error("OpenAPI_service_area_restriction_1_parseFromJSON() failed [max_num_of_tas]"); @@ -146,8 +147,7 @@ OpenAPI_service_area_restriction_1_t *OpenAPI_service_area_restriction_1_parseFr } } - cJSON *max_num_of_tas_for_not_allowed_areas = cJSON_GetObjectItemCaseSensitive(service_area_restriction_1JSON, "maxNumOfTAsForNotAllowedAreas"); - + max_num_of_tas_for_not_allowed_areas = cJSON_GetObjectItemCaseSensitive(service_area_restriction_1JSON, "maxNumOfTAsForNotAllowedAreas"); if (max_num_of_tas_for_not_allowed_areas) { if (!cJSON_IsNumber(max_num_of_tas_for_not_allowed_areas)) { ogs_error("OpenAPI_service_area_restriction_1_parseFromJSON() failed [max_num_of_tas_for_not_allowed_areas]"); @@ -166,6 +166,13 @@ OpenAPI_service_area_restriction_1_t *OpenAPI_service_area_restriction_1_parseFr return service_area_restriction_1_local_var; end: + if (areasList) { + OpenAPI_list_for_each(areasList, node) { + OpenAPI_area_1_free(node->data); + } + OpenAPI_list_free(areasList); + areasList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/service_info_status.c b/lib/sbi/openapi/model/service_info_status.c index beaf28394..5b38698e2 100644 --- a/lib/sbi/openapi/model/service_info_status.c +++ b/lib/sbi/openapi/model/service_info_status.c @@ -6,7 +6,7 @@ char* OpenAPI_service_info_status_ToString(OpenAPI_service_info_status_e service_info_status) { - const char *service_info_statusArray[] = { "NULL", "_FINAL", "PRELIMINARY" }; + const char *service_info_statusArray[] = { "NULL", "FINAL", "PRELIMINARY" }; size_t sizeofArray = sizeof(service_info_statusArray) / sizeof(service_info_statusArray[0]); if (service_info_status < sizeofArray) return (char *)service_info_statusArray[service_info_status]; @@ -17,7 +17,7 @@ char* OpenAPI_service_info_status_ToString(OpenAPI_service_info_status_e service OpenAPI_service_info_status_e OpenAPI_service_info_status_FromString(char* service_info_status) { int stringToReturn = 0; - const char *service_info_statusArray[] = { "NULL", "_FINAL", "PRELIMINARY" }; + const char *service_info_statusArray[] = { "NULL", "FINAL", "PRELIMINARY" }; size_t sizeofArray = sizeof(service_info_statusArray) / sizeof(service_info_statusArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(service_info_status, service_info_statusArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/service_name_cond.c b/lib/sbi/openapi/model/service_name_cond.c index 5d7b4a657..ca3849280 100644 --- a/lib/sbi/openapi/model/service_name_cond.c +++ b/lib/sbi/openapi/model/service_name_cond.c @@ -18,17 +18,22 @@ OpenAPI_service_name_cond_t *OpenAPI_service_name_cond_create( void OpenAPI_service_name_cond_free(OpenAPI_service_name_cond_t *service_name_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == service_name_cond) { return; } - OpenAPI_lnode_t *node; - ogs_free(service_name_cond->service_name); + if (service_name_cond->service_name) { + ogs_free(service_name_cond->service_name); + service_name_cond->service_name = NULL; + } ogs_free(service_name_cond); } cJSON *OpenAPI_service_name_cond_convertToJSON(OpenAPI_service_name_cond_t *service_name_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (service_name_cond == NULL) { ogs_error("OpenAPI_service_name_cond_convertToJSON() failed [ServiceNameCond]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_service_name_cond_convertToJSON(OpenAPI_service_name_cond_t *serv } item = cJSON_CreateObject(); + if (!service_name_cond->service_name) { + ogs_error("OpenAPI_service_name_cond_convertToJSON() failed [service_name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "serviceName", service_name_cond->service_name) == NULL) { ogs_error("OpenAPI_service_name_cond_convertToJSON() failed [service_name]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_service_name_cond_t *OpenAPI_service_name_cond_parseFromJSON(cJSON *service_name_condJSON) { OpenAPI_service_name_cond_t *service_name_cond_local_var = NULL; - cJSON *service_name = cJSON_GetObjectItemCaseSensitive(service_name_condJSON, "serviceName"); + OpenAPI_lnode_t *node = NULL; + cJSON *service_name = NULL; + service_name = cJSON_GetObjectItemCaseSensitive(service_name_condJSON, "serviceName"); if (!service_name) { ogs_error("OpenAPI_service_name_cond_parseFromJSON() failed [service_name]"); goto end; } - if (!cJSON_IsString(service_name)) { ogs_error("OpenAPI_service_name_cond_parseFromJSON() failed [service_name]"); goto end; diff --git a/lib/sbi/openapi/model/service_parameter_data.c b/lib/sbi/openapi/model/service_parameter_data.c index 7adc30686..9590b562b 100644 --- a/lib/sbi/openapi/model/service_parameter_data.c +++ b/lib/sbi/openapi/model/service_parameter_data.c @@ -44,28 +44,66 @@ OpenAPI_service_parameter_data_t *OpenAPI_service_parameter_data_create( void OpenAPI_service_parameter_data_free(OpenAPI_service_parameter_data_t *service_parameter_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == service_parameter_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(service_parameter_data->app_id); - ogs_free(service_parameter_data->dnn); - OpenAPI_snssai_free(service_parameter_data->snssai); - ogs_free(service_parameter_data->inter_group_id); - ogs_free(service_parameter_data->supi); - ogs_free(service_parameter_data->ue_ipv4); - ogs_free(service_parameter_data->ue_ipv6); - ogs_free(service_parameter_data->ue_mac); - ogs_free(service_parameter_data->param_over_pc5); - ogs_free(service_parameter_data->param_over_uu); - ogs_free(service_parameter_data->supp_feat); - ogs_free(service_parameter_data->res_uri); + if (service_parameter_data->app_id) { + ogs_free(service_parameter_data->app_id); + service_parameter_data->app_id = NULL; + } + if (service_parameter_data->dnn) { + ogs_free(service_parameter_data->dnn); + service_parameter_data->dnn = NULL; + } + if (service_parameter_data->snssai) { + OpenAPI_snssai_free(service_parameter_data->snssai); + service_parameter_data->snssai = NULL; + } + if (service_parameter_data->inter_group_id) { + ogs_free(service_parameter_data->inter_group_id); + service_parameter_data->inter_group_id = NULL; + } + if (service_parameter_data->supi) { + ogs_free(service_parameter_data->supi); + service_parameter_data->supi = NULL; + } + if (service_parameter_data->ue_ipv4) { + ogs_free(service_parameter_data->ue_ipv4); + service_parameter_data->ue_ipv4 = NULL; + } + if (service_parameter_data->ue_ipv6) { + ogs_free(service_parameter_data->ue_ipv6); + service_parameter_data->ue_ipv6 = NULL; + } + if (service_parameter_data->ue_mac) { + ogs_free(service_parameter_data->ue_mac); + service_parameter_data->ue_mac = NULL; + } + if (service_parameter_data->param_over_pc5) { + ogs_free(service_parameter_data->param_over_pc5); + service_parameter_data->param_over_pc5 = NULL; + } + if (service_parameter_data->param_over_uu) { + ogs_free(service_parameter_data->param_over_uu); + service_parameter_data->param_over_uu = NULL; + } + if (service_parameter_data->supp_feat) { + ogs_free(service_parameter_data->supp_feat); + service_parameter_data->supp_feat = NULL; + } + if (service_parameter_data->res_uri) { + ogs_free(service_parameter_data->res_uri); + service_parameter_data->res_uri = NULL; + } ogs_free(service_parameter_data); } cJSON *OpenAPI_service_parameter_data_convertToJSON(OpenAPI_service_parameter_data_t *service_parameter_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (service_parameter_data == NULL) { ogs_error("OpenAPI_service_parameter_data_convertToJSON() failed [ServiceParameterData]"); @@ -177,78 +215,83 @@ end: OpenAPI_service_parameter_data_t *OpenAPI_service_parameter_data_parseFromJSON(cJSON *service_parameter_dataJSON) { OpenAPI_service_parameter_data_t *service_parameter_data_local_var = NULL; - cJSON *app_id = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "appId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *app_id = NULL; + cJSON *dnn = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *inter_group_id = NULL; + cJSON *supi = NULL; + cJSON *ue_ipv4 = NULL; + cJSON *ue_ipv6 = NULL; + cJSON *ue_mac = NULL; + cJSON *any_ue_ind = NULL; + cJSON *param_over_pc5 = NULL; + cJSON *param_over_uu = NULL; + cJSON *supp_feat = NULL; + cJSON *res_uri = NULL; + app_id = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "appId"); if (app_id) { - if (!cJSON_IsString(app_id)) { + if (!cJSON_IsString(app_id) && !cJSON_IsNull(app_id)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [app_id]"); goto end; } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "snssai"); - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "snssai"); if (snssai) { snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); } - cJSON *inter_group_id = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "interGroupId"); - + inter_group_id = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "interGroupId"); if (inter_group_id) { - if (!cJSON_IsString(inter_group_id)) { + if (!cJSON_IsString(inter_group_id) && !cJSON_IsNull(inter_group_id)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [inter_group_id]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *ue_ipv4 = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "ueIpv4"); - + ue_ipv4 = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "ueIpv4"); if (ue_ipv4) { - if (!cJSON_IsString(ue_ipv4)) { + if (!cJSON_IsString(ue_ipv4) && !cJSON_IsNull(ue_ipv4)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [ue_ipv4]"); goto end; } } - cJSON *ue_ipv6 = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "ueIpv6"); - + ue_ipv6 = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "ueIpv6"); if (ue_ipv6) { - if (!cJSON_IsString(ue_ipv6)) { + if (!cJSON_IsString(ue_ipv6) && !cJSON_IsNull(ue_ipv6)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [ue_ipv6]"); goto end; } } - cJSON *ue_mac = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "ueMac"); - + ue_mac = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "ueMac"); if (ue_mac) { - if (!cJSON_IsString(ue_mac)) { + if (!cJSON_IsString(ue_mac) && !cJSON_IsNull(ue_mac)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [ue_mac]"); goto end; } } - cJSON *any_ue_ind = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "anyUeInd"); - + any_ue_ind = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "anyUeInd"); if (any_ue_ind) { if (!cJSON_IsBool(any_ue_ind)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [any_ue_ind]"); @@ -256,61 +299,61 @@ OpenAPI_service_parameter_data_t *OpenAPI_service_parameter_data_parseFromJSON(c } } - cJSON *param_over_pc5 = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "paramOverPc5"); - + param_over_pc5 = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "paramOverPc5"); if (param_over_pc5) { - if (!cJSON_IsString(param_over_pc5)) { + if (!cJSON_IsString(param_over_pc5) && !cJSON_IsNull(param_over_pc5)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [param_over_pc5]"); goto end; } } - cJSON *param_over_uu = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "paramOverUu"); - + param_over_uu = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "paramOverUu"); if (param_over_uu) { - if (!cJSON_IsString(param_over_uu)) { + if (!cJSON_IsString(param_over_uu) && !cJSON_IsNull(param_over_uu)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [param_over_uu]"); goto end; } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [supp_feat]"); goto end; } } - cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "resUri"); - + res_uri = cJSON_GetObjectItemCaseSensitive(service_parameter_dataJSON, "resUri"); if (res_uri) { - if (!cJSON_IsString(res_uri)) { + if (!cJSON_IsString(res_uri) && !cJSON_IsNull(res_uri)) { ogs_error("OpenAPI_service_parameter_data_parseFromJSON() failed [res_uri]"); goto end; } } service_parameter_data_local_var = OpenAPI_service_parameter_data_create ( - app_id ? ogs_strdup(app_id->valuestring) : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + app_id && !cJSON_IsNull(app_id) ? ogs_strdup(app_id->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, snssai ? snssai_local_nonprim : NULL, - inter_group_id ? ogs_strdup(inter_group_id->valuestring) : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL, - ue_ipv4 ? ogs_strdup(ue_ipv4->valuestring) : NULL, - ue_ipv6 ? ogs_strdup(ue_ipv6->valuestring) : NULL, - ue_mac ? ogs_strdup(ue_mac->valuestring) : NULL, + inter_group_id && !cJSON_IsNull(inter_group_id) ? ogs_strdup(inter_group_id->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, + ue_ipv4 && !cJSON_IsNull(ue_ipv4) ? ogs_strdup(ue_ipv4->valuestring) : NULL, + ue_ipv6 && !cJSON_IsNull(ue_ipv6) ? ogs_strdup(ue_ipv6->valuestring) : NULL, + ue_mac && !cJSON_IsNull(ue_mac) ? ogs_strdup(ue_mac->valuestring) : NULL, any_ue_ind ? true : false, any_ue_ind ? any_ue_ind->valueint : 0, - param_over_pc5 ? ogs_strdup(param_over_pc5->valuestring) : NULL, - param_over_uu ? ogs_strdup(param_over_uu->valuestring) : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL, - res_uri ? ogs_strdup(res_uri->valuestring) : NULL + param_over_pc5 && !cJSON_IsNull(param_over_pc5) ? ogs_strdup(param_over_pc5->valuestring) : NULL, + param_over_uu && !cJSON_IsNull(param_over_uu) ? ogs_strdup(param_over_uu->valuestring) : NULL, + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL, + res_uri && !cJSON_IsNull(res_uri) ? ogs_strdup(res_uri->valuestring) : NULL ); return service_parameter_data_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/service_parameter_data_patch.c b/lib/sbi/openapi/model/service_parameter_data_patch.c index 59f80c02d..ba0ac3ad8 100644 --- a/lib/sbi/openapi/model/service_parameter_data_patch.c +++ b/lib/sbi/openapi/model/service_parameter_data_patch.c @@ -20,18 +20,26 @@ OpenAPI_service_parameter_data_patch_t *OpenAPI_service_parameter_data_patch_cre void OpenAPI_service_parameter_data_patch_free(OpenAPI_service_parameter_data_patch_t *service_parameter_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == service_parameter_data_patch) { return; } - OpenAPI_lnode_t *node; - ogs_free(service_parameter_data_patch->param_over_pc5); - ogs_free(service_parameter_data_patch->param_over_uu); + if (service_parameter_data_patch->param_over_pc5) { + ogs_free(service_parameter_data_patch->param_over_pc5); + service_parameter_data_patch->param_over_pc5 = NULL; + } + if (service_parameter_data_patch->param_over_uu) { + ogs_free(service_parameter_data_patch->param_over_uu); + service_parameter_data_patch->param_over_uu = NULL; + } ogs_free(service_parameter_data_patch); } cJSON *OpenAPI_service_parameter_data_patch_convertToJSON(OpenAPI_service_parameter_data_patch_t *service_parameter_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (service_parameter_data_patch == NULL) { ogs_error("OpenAPI_service_parameter_data_patch_convertToJSON() failed [ServiceParameterDataPatch]"); @@ -60,27 +68,28 @@ end: OpenAPI_service_parameter_data_patch_t *OpenAPI_service_parameter_data_patch_parseFromJSON(cJSON *service_parameter_data_patchJSON) { OpenAPI_service_parameter_data_patch_t *service_parameter_data_patch_local_var = NULL; - cJSON *param_over_pc5 = cJSON_GetObjectItemCaseSensitive(service_parameter_data_patchJSON, "paramOverPc5"); - + OpenAPI_lnode_t *node = NULL; + cJSON *param_over_pc5 = NULL; + cJSON *param_over_uu = NULL; + param_over_pc5 = cJSON_GetObjectItemCaseSensitive(service_parameter_data_patchJSON, "paramOverPc5"); if (param_over_pc5) { - if (!cJSON_IsString(param_over_pc5)) { + if (!cJSON_IsString(param_over_pc5) && !cJSON_IsNull(param_over_pc5)) { ogs_error("OpenAPI_service_parameter_data_patch_parseFromJSON() failed [param_over_pc5]"); goto end; } } - cJSON *param_over_uu = cJSON_GetObjectItemCaseSensitive(service_parameter_data_patchJSON, "paramOverUu"); - + param_over_uu = cJSON_GetObjectItemCaseSensitive(service_parameter_data_patchJSON, "paramOverUu"); if (param_over_uu) { - if (!cJSON_IsString(param_over_uu)) { + if (!cJSON_IsString(param_over_uu) && !cJSON_IsNull(param_over_uu)) { ogs_error("OpenAPI_service_parameter_data_patch_parseFromJSON() failed [param_over_uu]"); goto end; } } service_parameter_data_patch_local_var = OpenAPI_service_parameter_data_patch_create ( - param_over_pc5 ? ogs_strdup(param_over_pc5->valuestring) : NULL, - param_over_uu ? ogs_strdup(param_over_uu->valuestring) : NULL + param_over_pc5 && !cJSON_IsNull(param_over_pc5) ? ogs_strdup(param_over_pc5->valuestring) : NULL, + param_over_uu && !cJSON_IsNull(param_over_uu) ? ogs_strdup(param_over_uu->valuestring) : NULL ); return service_parameter_data_patch_local_var; diff --git a/lib/sbi/openapi/model/service_type_unrelated_class.c b/lib/sbi/openapi/model/service_type_unrelated_class.c index 59fd4c909..ae946aa09 100644 --- a/lib/sbi/openapi/model/service_type_unrelated_class.c +++ b/lib/sbi/openapi/model/service_type_unrelated_class.c @@ -28,25 +28,36 @@ OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_cre void OpenAPI_service_type_unrelated_class_free(OpenAPI_service_type_unrelated_class_t *service_type_unrelated_class) { + OpenAPI_lnode_t *node = NULL; + if (NULL == service_type_unrelated_class) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(service_type_unrelated_class->allowed_geographic_area, node) { - OpenAPI_geographic_area_free(node->data); + if (service_type_unrelated_class->allowed_geographic_area) { + OpenAPI_list_for_each(service_type_unrelated_class->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(service_type_unrelated_class->allowed_geographic_area); + service_type_unrelated_class->allowed_geographic_area = NULL; } - OpenAPI_list_free(service_type_unrelated_class->allowed_geographic_area); - OpenAPI_valid_time_period_free(service_type_unrelated_class->valid_time_period); - OpenAPI_list_for_each(service_type_unrelated_class->code_word_list, node) { - ogs_free(node->data); + if (service_type_unrelated_class->valid_time_period) { + OpenAPI_valid_time_period_free(service_type_unrelated_class->valid_time_period); + service_type_unrelated_class->valid_time_period = NULL; + } + if (service_type_unrelated_class->code_word_list) { + OpenAPI_list_for_each(service_type_unrelated_class->code_word_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_type_unrelated_class->code_word_list); + service_type_unrelated_class->code_word_list = NULL; } - OpenAPI_list_free(service_type_unrelated_class->code_word_list); ogs_free(service_type_unrelated_class); } cJSON *OpenAPI_service_type_unrelated_class_convertToJSON(OpenAPI_service_type_unrelated_class_t *service_type_unrelated_class) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (service_type_unrelated_class == NULL) { ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [ServiceTypeUnrelatedClass]"); @@ -65,28 +76,24 @@ cJSON *OpenAPI_service_type_unrelated_class_convertToJSON(OpenAPI_service_type_u ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [allowed_geographic_area]"); goto end; } - - OpenAPI_lnode_t *allowed_geographic_area_node; - if (service_type_unrelated_class->allowed_geographic_area) { - OpenAPI_list_for_each(service_type_unrelated_class->allowed_geographic_area, allowed_geographic_area_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [allowed_geographic_area]"); - goto end; - } - cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + OpenAPI_list_for_each(service_type_unrelated_class->allowed_geographic_area, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [allowed_geographic_area]"); + goto end; } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); } } - if (service_type_unrelated_class->privacy_check_related_action) { + if (service_type_unrelated_class->privacy_check_related_action != OpenAPI_privacy_check_related_action_NULL) { if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(service_type_unrelated_class->privacy_check_related_action)) == NULL) { ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [privacy_check_related_action]"); goto end; } } - if (service_type_unrelated_class->code_word_ind) { + if (service_type_unrelated_class->code_word_ind != OpenAPI_code_word_ind_NULL) { if (cJSON_AddStringToObject(item, "codeWordInd", OpenAPI_code_word_ind_ToString(service_type_unrelated_class->code_word_ind)) == NULL) { ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [code_word_ind]"); goto end; @@ -107,19 +114,17 @@ cJSON *OpenAPI_service_type_unrelated_class_convertToJSON(OpenAPI_service_type_u } if (service_type_unrelated_class->code_word_list) { - cJSON *code_word_list = cJSON_AddArrayToObject(item, "codeWordList"); - if (code_word_list == NULL) { + cJSON *code_word_listList = cJSON_AddArrayToObject(item, "codeWordList"); + if (code_word_listList == NULL) { ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [code_word_list]"); goto end; } - - OpenAPI_lnode_t *code_word_list_node; - OpenAPI_list_for_each(service_type_unrelated_class->code_word_list, code_word_list_node) { - if (cJSON_AddStringToObject(code_word_list, "", (char*)code_word_list_node->data) == NULL) { - ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [code_word_list]"); - goto end; + OpenAPI_list_for_each(service_type_unrelated_class->code_word_list, node) { + if (cJSON_AddStringToObject(code_word_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_convertToJSON() failed [code_word_list]"); + goto end; + } } - } } end: @@ -129,49 +134,54 @@ end: OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_parseFromJSON(cJSON *service_type_unrelated_classJSON) { OpenAPI_service_type_unrelated_class_t *service_type_unrelated_class_local_var = NULL; - cJSON *service_type = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "serviceType"); + OpenAPI_lnode_t *node = NULL; + cJSON *service_type = NULL; + cJSON *allowed_geographic_area = NULL; + OpenAPI_list_t *allowed_geographic_areaList = NULL; + cJSON *privacy_check_related_action = NULL; + OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable = 0; + cJSON *code_word_ind = NULL; + OpenAPI_code_word_ind_e code_word_indVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + cJSON *code_word_list = NULL; + OpenAPI_list_t *code_word_listList = NULL; + service_type = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "serviceType"); if (!service_type) { ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [service_type]"); goto end; } - if (!cJSON_IsNumber(service_type)) { ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [service_type]"); goto end; } - cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "allowedGeographicArea"); - - OpenAPI_list_t *allowed_geographic_areaList; + allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "allowedGeographicArea"); if (allowed_geographic_area) { - cJSON *allowed_geographic_area_local_nonprimitive; - if (!cJSON_IsArray(allowed_geographic_area)){ - ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [allowed_geographic_area]"); - goto end; - } - - allowed_geographic_areaList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) { - if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) { + cJSON *allowed_geographic_area_local = NULL; + if (!cJSON_IsArray(allowed_geographic_area)) { ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [allowed_geographic_area]"); goto end; } - OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive); - if (!allowed_geographic_areaItem) { - ogs_error("No allowed_geographic_areaItem"); - OpenAPI_list_free(allowed_geographic_areaList); - goto end; + allowed_geographic_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_geographic_area_local, allowed_geographic_area) { + if (!cJSON_IsObject(allowed_geographic_area_local)) { + ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local); + if (!allowed_geographic_areaItem) { + ogs_error("No allowed_geographic_areaItem"); + OpenAPI_list_free(allowed_geographic_areaList); + goto end; + } + OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); } - - OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); - } } - cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "privacyCheckRelatedAction"); - - OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable; + privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "privacyCheckRelatedAction"); if (privacy_check_related_action) { if (!cJSON_IsString(privacy_check_related_action)) { ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [privacy_check_related_action]"); @@ -180,9 +190,7 @@ OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_par privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); } - cJSON *code_word_ind = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "codeWordInd"); - - OpenAPI_code_word_ind_e code_word_indVariable; + code_word_ind = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "codeWordInd"); if (code_word_ind) { if (!cJSON_IsString(code_word_ind)) { ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [code_word_ind]"); @@ -191,31 +199,30 @@ OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_par code_word_indVariable = OpenAPI_code_word_ind_FromString(code_word_ind->valuestring); } - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "validTimePeriod"); - - OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period); } - cJSON *code_word_list = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "codeWordList"); - - OpenAPI_list_t *code_word_listList; + code_word_list = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_classJSON, "codeWordList"); if (code_word_list) { - cJSON *code_word_list_local; - if (!cJSON_IsArray(code_word_list)) { - ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [code_word_list]"); - goto end; - } - code_word_listList = OpenAPI_list_create(); + cJSON *code_word_list_local = NULL; + if (!cJSON_IsArray(code_word_list)) { + ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [code_word_list]"); + goto end; + } - cJSON_ArrayForEach(code_word_list_local, code_word_list) { - if (!cJSON_IsString(code_word_list_local)) { - ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [code_word_list]"); - goto end; - } - OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring)); - } + code_word_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(code_word_list_local, code_word_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(code_word_list_local)) { + ogs_error("OpenAPI_service_type_unrelated_class_parseFromJSON() failed [code_word_list]"); + goto end; + } + OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring)); + } } service_type_unrelated_class_local_var = OpenAPI_service_type_unrelated_class_create ( @@ -230,6 +237,24 @@ OpenAPI_service_type_unrelated_class_t *OpenAPI_service_type_unrelated_class_par return service_type_unrelated_class_local_var; end: + if (allowed_geographic_areaList) { + OpenAPI_list_for_each(allowed_geographic_areaList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(allowed_geographic_areaList); + allowed_geographic_areaList = NULL; + } + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } + if (code_word_listList) { + OpenAPI_list_for_each(code_word_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(code_word_listList); + code_word_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/service_type_unrelated_class_1.c b/lib/sbi/openapi/model/service_type_unrelated_class_1.c index a08c2b344..586d8b60f 100644 --- a/lib/sbi/openapi/model/service_type_unrelated_class_1.c +++ b/lib/sbi/openapi/model/service_type_unrelated_class_1.c @@ -28,25 +28,36 @@ OpenAPI_service_type_unrelated_class_1_t *OpenAPI_service_type_unrelated_class_1 void OpenAPI_service_type_unrelated_class_1_free(OpenAPI_service_type_unrelated_class_1_t *service_type_unrelated_class_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == service_type_unrelated_class_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(service_type_unrelated_class_1->allowed_geographic_area, node) { - OpenAPI_geographic_area_free(node->data); + if (service_type_unrelated_class_1->allowed_geographic_area) { + OpenAPI_list_for_each(service_type_unrelated_class_1->allowed_geographic_area, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(service_type_unrelated_class_1->allowed_geographic_area); + service_type_unrelated_class_1->allowed_geographic_area = NULL; } - OpenAPI_list_free(service_type_unrelated_class_1->allowed_geographic_area); - OpenAPI_valid_time_period_1_free(service_type_unrelated_class_1->valid_time_period); - OpenAPI_list_for_each(service_type_unrelated_class_1->code_word_list, node) { - ogs_free(node->data); + if (service_type_unrelated_class_1->valid_time_period) { + OpenAPI_valid_time_period_1_free(service_type_unrelated_class_1->valid_time_period); + service_type_unrelated_class_1->valid_time_period = NULL; + } + if (service_type_unrelated_class_1->code_word_list) { + OpenAPI_list_for_each(service_type_unrelated_class_1->code_word_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(service_type_unrelated_class_1->code_word_list); + service_type_unrelated_class_1->code_word_list = NULL; } - OpenAPI_list_free(service_type_unrelated_class_1->code_word_list); ogs_free(service_type_unrelated_class_1); } cJSON *OpenAPI_service_type_unrelated_class_1_convertToJSON(OpenAPI_service_type_unrelated_class_1_t *service_type_unrelated_class_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (service_type_unrelated_class_1 == NULL) { ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [ServiceTypeUnrelatedClass_1]"); @@ -65,28 +76,24 @@ cJSON *OpenAPI_service_type_unrelated_class_1_convertToJSON(OpenAPI_service_type ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [allowed_geographic_area]"); goto end; } - - OpenAPI_lnode_t *allowed_geographic_area_node; - if (service_type_unrelated_class_1->allowed_geographic_area) { - OpenAPI_list_for_each(service_type_unrelated_class_1->allowed_geographic_area, allowed_geographic_area_node) { - cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [allowed_geographic_area]"); - goto end; - } - cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); + OpenAPI_list_for_each(service_type_unrelated_class_1->allowed_geographic_area, node) { + cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [allowed_geographic_area]"); + goto end; } + cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal); } } - if (service_type_unrelated_class_1->privacy_check_related_action) { + if (service_type_unrelated_class_1->privacy_check_related_action != OpenAPI_privacy_check_related_action_NULL) { if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(service_type_unrelated_class_1->privacy_check_related_action)) == NULL) { ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [privacy_check_related_action]"); goto end; } } - if (service_type_unrelated_class_1->code_word_ind) { + if (service_type_unrelated_class_1->code_word_ind != OpenAPI_code_word_ind_NULL) { if (cJSON_AddStringToObject(item, "codeWordInd", OpenAPI_code_word_ind_ToString(service_type_unrelated_class_1->code_word_ind)) == NULL) { ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [code_word_ind]"); goto end; @@ -107,19 +114,17 @@ cJSON *OpenAPI_service_type_unrelated_class_1_convertToJSON(OpenAPI_service_type } if (service_type_unrelated_class_1->code_word_list) { - cJSON *code_word_list = cJSON_AddArrayToObject(item, "codeWordList"); - if (code_word_list == NULL) { + cJSON *code_word_listList = cJSON_AddArrayToObject(item, "codeWordList"); + if (code_word_listList == NULL) { ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [code_word_list]"); goto end; } - - OpenAPI_lnode_t *code_word_list_node; - OpenAPI_list_for_each(service_type_unrelated_class_1->code_word_list, code_word_list_node) { - if (cJSON_AddStringToObject(code_word_list, "", (char*)code_word_list_node->data) == NULL) { - ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [code_word_list]"); - goto end; + OpenAPI_list_for_each(service_type_unrelated_class_1->code_word_list, node) { + if (cJSON_AddStringToObject(code_word_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_service_type_unrelated_class_1_convertToJSON() failed [code_word_list]"); + goto end; + } } - } } end: @@ -129,49 +134,54 @@ end: OpenAPI_service_type_unrelated_class_1_t *OpenAPI_service_type_unrelated_class_1_parseFromJSON(cJSON *service_type_unrelated_class_1JSON) { OpenAPI_service_type_unrelated_class_1_t *service_type_unrelated_class_1_local_var = NULL; - cJSON *service_type = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "serviceType"); + OpenAPI_lnode_t *node = NULL; + cJSON *service_type = NULL; + cJSON *allowed_geographic_area = NULL; + OpenAPI_list_t *allowed_geographic_areaList = NULL; + cJSON *privacy_check_related_action = NULL; + OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable = 0; + cJSON *code_word_ind = NULL; + OpenAPI_code_word_ind_e code_word_indVariable = 0; + cJSON *valid_time_period = NULL; + OpenAPI_valid_time_period_1_t *valid_time_period_local_nonprim = NULL; + cJSON *code_word_list = NULL; + OpenAPI_list_t *code_word_listList = NULL; + service_type = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "serviceType"); if (!service_type) { ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [service_type]"); goto end; } - if (!cJSON_IsNumber(service_type)) { ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [service_type]"); goto end; } - cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "allowedGeographicArea"); - - OpenAPI_list_t *allowed_geographic_areaList; + allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "allowedGeographicArea"); if (allowed_geographic_area) { - cJSON *allowed_geographic_area_local_nonprimitive; - if (!cJSON_IsArray(allowed_geographic_area)){ - ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [allowed_geographic_area]"); - goto end; - } - - allowed_geographic_areaList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) { - if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) { + cJSON *allowed_geographic_area_local = NULL; + if (!cJSON_IsArray(allowed_geographic_area)) { ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [allowed_geographic_area]"); goto end; } - OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive); - if (!allowed_geographic_areaItem) { - ogs_error("No allowed_geographic_areaItem"); - OpenAPI_list_free(allowed_geographic_areaList); - goto end; + allowed_geographic_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_geographic_area_local, allowed_geographic_area) { + if (!cJSON_IsObject(allowed_geographic_area_local)) { + ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [allowed_geographic_area]"); + goto end; + } + OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local); + if (!allowed_geographic_areaItem) { + ogs_error("No allowed_geographic_areaItem"); + OpenAPI_list_free(allowed_geographic_areaList); + goto end; + } + OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); } - - OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem); - } } - cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "privacyCheckRelatedAction"); - - OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable; + privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "privacyCheckRelatedAction"); if (privacy_check_related_action) { if (!cJSON_IsString(privacy_check_related_action)) { ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [privacy_check_related_action]"); @@ -180,9 +190,7 @@ OpenAPI_service_type_unrelated_class_1_t *OpenAPI_service_type_unrelated_class_1 privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring); } - cJSON *code_word_ind = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "codeWordInd"); - - OpenAPI_code_word_ind_e code_word_indVariable; + code_word_ind = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "codeWordInd"); if (code_word_ind) { if (!cJSON_IsString(code_word_ind)) { ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [code_word_ind]"); @@ -191,31 +199,30 @@ OpenAPI_service_type_unrelated_class_1_t *OpenAPI_service_type_unrelated_class_1 code_word_indVariable = OpenAPI_code_word_ind_FromString(code_word_ind->valuestring); } - cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "validTimePeriod"); - - OpenAPI_valid_time_period_1_t *valid_time_period_local_nonprim = NULL; + valid_time_period = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "validTimePeriod"); if (valid_time_period) { valid_time_period_local_nonprim = OpenAPI_valid_time_period_1_parseFromJSON(valid_time_period); } - cJSON *code_word_list = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "codeWordList"); - - OpenAPI_list_t *code_word_listList; + code_word_list = cJSON_GetObjectItemCaseSensitive(service_type_unrelated_class_1JSON, "codeWordList"); if (code_word_list) { - cJSON *code_word_list_local; - if (!cJSON_IsArray(code_word_list)) { - ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [code_word_list]"); - goto end; - } - code_word_listList = OpenAPI_list_create(); + cJSON *code_word_list_local = NULL; + if (!cJSON_IsArray(code_word_list)) { + ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [code_word_list]"); + goto end; + } - cJSON_ArrayForEach(code_word_list_local, code_word_list) { - if (!cJSON_IsString(code_word_list_local)) { - ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [code_word_list]"); - goto end; - } - OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring)); - } + code_word_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(code_word_list_local, code_word_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(code_word_list_local)) { + ogs_error("OpenAPI_service_type_unrelated_class_1_parseFromJSON() failed [code_word_list]"); + goto end; + } + OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring)); + } } service_type_unrelated_class_1_local_var = OpenAPI_service_type_unrelated_class_1_create ( @@ -230,6 +237,24 @@ OpenAPI_service_type_unrelated_class_1_t *OpenAPI_service_type_unrelated_class_1 return service_type_unrelated_class_1_local_var; end: + if (allowed_geographic_areaList) { + OpenAPI_list_for_each(allowed_geographic_areaList, node) { + OpenAPI_geographic_area_free(node->data); + } + OpenAPI_list_free(allowed_geographic_areaList); + allowed_geographic_areaList = NULL; + } + if (valid_time_period_local_nonprim) { + OpenAPI_valid_time_period_1_free(valid_time_period_local_nonprim); + valid_time_period_local_nonprim = NULL; + } + if (code_word_listList) { + OpenAPI_list_for_each(code_word_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(code_word_listList); + code_word_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/serving_nf_identity.c b/lib/sbi/openapi/model/serving_nf_identity.c index acb291b15..0996be885 100644 --- a/lib/sbi/openapi/model/serving_nf_identity.c +++ b/lib/sbi/openapi/model/serving_nf_identity.c @@ -22,19 +22,30 @@ OpenAPI_serving_nf_identity_t *OpenAPI_serving_nf_identity_create( void OpenAPI_serving_nf_identity_free(OpenAPI_serving_nf_identity_t *serving_nf_identity) { + OpenAPI_lnode_t *node = NULL; + if (NULL == serving_nf_identity) { return; } - OpenAPI_lnode_t *node; - ogs_free(serving_nf_identity->serv_nf_inst_id); - OpenAPI_guami_free(serving_nf_identity->guami); - OpenAPI_an_gw_address_free(serving_nf_identity->an_gw_addr); + if (serving_nf_identity->serv_nf_inst_id) { + ogs_free(serving_nf_identity->serv_nf_inst_id); + serving_nf_identity->serv_nf_inst_id = NULL; + } + if (serving_nf_identity->guami) { + OpenAPI_guami_free(serving_nf_identity->guami); + serving_nf_identity->guami = NULL; + } + if (serving_nf_identity->an_gw_addr) { + OpenAPI_an_gw_address_free(serving_nf_identity->an_gw_addr); + serving_nf_identity->an_gw_addr = NULL; + } ogs_free(serving_nf_identity); } cJSON *OpenAPI_serving_nf_identity_convertToJSON(OpenAPI_serving_nf_identity_t *serving_nf_identity) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (serving_nf_identity == NULL) { ogs_error("OpenAPI_serving_nf_identity_convertToJSON() failed [ServingNfIdentity]"); @@ -82,37 +93,46 @@ end: OpenAPI_serving_nf_identity_t *OpenAPI_serving_nf_identity_parseFromJSON(cJSON *serving_nf_identityJSON) { OpenAPI_serving_nf_identity_t *serving_nf_identity_local_var = NULL; - cJSON *serv_nf_inst_id = cJSON_GetObjectItemCaseSensitive(serving_nf_identityJSON, "servNfInstId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *serv_nf_inst_id = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *an_gw_addr = NULL; + OpenAPI_an_gw_address_t *an_gw_addr_local_nonprim = NULL; + serv_nf_inst_id = cJSON_GetObjectItemCaseSensitive(serving_nf_identityJSON, "servNfInstId"); if (serv_nf_inst_id) { - if (!cJSON_IsString(serv_nf_inst_id)) { + if (!cJSON_IsString(serv_nf_inst_id) && !cJSON_IsNull(serv_nf_inst_id)) { ogs_error("OpenAPI_serving_nf_identity_parseFromJSON() failed [serv_nf_inst_id]"); goto end; } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(serving_nf_identityJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(serving_nf_identityJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } - cJSON *an_gw_addr = cJSON_GetObjectItemCaseSensitive(serving_nf_identityJSON, "anGwAddr"); - - OpenAPI_an_gw_address_t *an_gw_addr_local_nonprim = NULL; + an_gw_addr = cJSON_GetObjectItemCaseSensitive(serving_nf_identityJSON, "anGwAddr"); if (an_gw_addr) { an_gw_addr_local_nonprim = OpenAPI_an_gw_address_parseFromJSON(an_gw_addr); } serving_nf_identity_local_var = OpenAPI_serving_nf_identity_create ( - serv_nf_inst_id ? ogs_strdup(serv_nf_inst_id->valuestring) : NULL, + serv_nf_inst_id && !cJSON_IsNull(serv_nf_inst_id) ? ogs_strdup(serv_nf_inst_id->valuestring) : NULL, guami ? guami_local_nonprim : NULL, an_gw_addr ? an_gw_addr_local_nonprim : NULL ); return serving_nf_identity_local_var; end: + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (an_gw_addr_local_nonprim) { + OpenAPI_an_gw_address_free(an_gw_addr_local_nonprim); + an_gw_addr_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/session_management_subscription_data.c b/lib/sbi/openapi/model/session_management_subscription_data.c index d76aca2a8..364b9576f 100644 --- a/lib/sbi/openapi/model/session_management_subscription_data.c +++ b/lib/sbi/openapi/model/session_management_subscription_data.c @@ -11,7 +11,7 @@ OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subsc OpenAPI_list_t* shared_vn_group_data_ids, char *shared_dnn_configurations_id, OpenAPI_odb_packet_services_e odb_packet_services, - OpenAPI_trace_data_1_t *trace_data, + OpenAPI_trace_data_t *trace_data, char *shared_trace_data_id, OpenAPI_list_t* expected_ue_behaviours_list, OpenAPI_list_t* suggested_packet_num_dl_list, @@ -38,53 +38,85 @@ OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subsc void OpenAPI_session_management_subscription_data_free(OpenAPI_session_management_subscription_data_t *session_management_subscription_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == session_management_subscription_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(session_management_subscription_data->single_nssai); - OpenAPI_list_for_each(session_management_subscription_data->dnn_configurations, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_dnn_configuration_free(localKeyValue->value); - ogs_free(localKeyValue); + if (session_management_subscription_data->single_nssai) { + OpenAPI_snssai_free(session_management_subscription_data->single_nssai); + session_management_subscription_data->single_nssai = NULL; } - OpenAPI_list_free(session_management_subscription_data->dnn_configurations); - OpenAPI_list_for_each(session_management_subscription_data->internal_group_ids, node) { - ogs_free(node->data); + if (session_management_subscription_data->dnn_configurations) { + OpenAPI_list_for_each(session_management_subscription_data->dnn_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_dnn_configuration_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data->dnn_configurations); + session_management_subscription_data->dnn_configurations = NULL; } - OpenAPI_list_free(session_management_subscription_data->internal_group_ids); - OpenAPI_list_for_each(session_management_subscription_data->shared_vn_group_data_ids, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (session_management_subscription_data->internal_group_ids) { + OpenAPI_list_for_each(session_management_subscription_data->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(session_management_subscription_data->internal_group_ids); + session_management_subscription_data->internal_group_ids = NULL; } - OpenAPI_list_free(session_management_subscription_data->shared_vn_group_data_ids); - ogs_free(session_management_subscription_data->shared_dnn_configurations_id); - OpenAPI_trace_data_1_free(session_management_subscription_data->trace_data); - ogs_free(session_management_subscription_data->shared_trace_data_id); - OpenAPI_list_for_each(session_management_subscription_data->expected_ue_behaviours_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_expected_ue_behaviour_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (session_management_subscription_data->shared_vn_group_data_ids) { + OpenAPI_list_for_each(session_management_subscription_data->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data->shared_vn_group_data_ids); + session_management_subscription_data->shared_vn_group_data_ids = NULL; } - OpenAPI_list_free(session_management_subscription_data->expected_ue_behaviours_list); - OpenAPI_list_for_each(session_management_subscription_data->suggested_packet_num_dl_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_suggested_packet_num_dl_free(localKeyValue->value); - ogs_free(localKeyValue); + if (session_management_subscription_data->shared_dnn_configurations_id) { + ogs_free(session_management_subscription_data->shared_dnn_configurations_id); + session_management_subscription_data->shared_dnn_configurations_id = NULL; + } + if (session_management_subscription_data->trace_data) { + OpenAPI_trace_data_free(session_management_subscription_data->trace_data); + session_management_subscription_data->trace_data = NULL; + } + if (session_management_subscription_data->shared_trace_data_id) { + ogs_free(session_management_subscription_data->shared_trace_data_id); + session_management_subscription_data->shared_trace_data_id = NULL; + } + if (session_management_subscription_data->expected_ue_behaviours_list) { + OpenAPI_list_for_each(session_management_subscription_data->expected_ue_behaviours_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_expected_ue_behaviour_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data->expected_ue_behaviours_list); + session_management_subscription_data->expected_ue_behaviours_list = NULL; + } + if (session_management_subscription_data->suggested_packet_num_dl_list) { + OpenAPI_list_for_each(session_management_subscription_data->suggested_packet_num_dl_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_suggested_packet_num_dl_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data->suggested_packet_num_dl_list); + session_management_subscription_data->suggested_packet_num_dl_list = NULL; + } + if (session_management_subscription_data->_3gpp_charging_characteristics) { + ogs_free(session_management_subscription_data->_3gpp_charging_characteristics); + session_management_subscription_data->_3gpp_charging_characteristics = NULL; } - OpenAPI_list_free(session_management_subscription_data->suggested_packet_num_dl_list); - ogs_free(session_management_subscription_data->_3gpp_charging_characteristics); ogs_free(session_management_subscription_data); } cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_session_management_subscription_data_t *session_management_subscription_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (session_management_subscription_data == NULL) { ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [SessionManagementSubscriptionData]"); @@ -92,6 +124,10 @@ cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_sessio } item = cJSON_CreateObject(); + if (!session_management_subscription_data->single_nssai) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [single_nssai]"); + return NULL; + } cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(session_management_subscription_data->single_nssai); if (single_nssai_local_JSON == NULL) { ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [single_nssai]"); @@ -110,36 +146,33 @@ cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_sessio goto end; } cJSON *localMapObject = dnn_configurations; - OpenAPI_lnode_t *dnn_configurations_node; if (session_management_subscription_data->dnn_configurations) { - OpenAPI_list_for_each(session_management_subscription_data->dnn_configurations, dnn_configurations_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)dnn_configurations_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_dnn_configuration_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(session_management_subscription_data->dnn_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_dnn_configuration_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (session_management_subscription_data->internal_group_ids) { - cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); - if (internal_group_ids == NULL) { + cJSON *internal_group_idsList = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_idsList == NULL) { ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [internal_group_ids]"); goto end; } - - OpenAPI_lnode_t *internal_group_ids_node; - OpenAPI_list_for_each(session_management_subscription_data->internal_group_ids, internal_group_ids_node) { - if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [internal_group_ids]"); - goto end; + OpenAPI_list_for_each(session_management_subscription_data->internal_group_ids, node) { + if (cJSON_AddStringToObject(internal_group_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [internal_group_ids]"); + goto end; + } } - } } if (session_management_subscription_data->shared_vn_group_data_ids) { @@ -149,17 +182,16 @@ cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_sessio goto end; } cJSON *localMapObject = shared_vn_group_data_ids; - OpenAPI_lnode_t *shared_vn_group_data_ids_node; if (session_management_subscription_data->shared_vn_group_data_ids) { - OpenAPI_list_for_each(session_management_subscription_data->shared_vn_group_data_ids, shared_vn_group_data_ids_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_vn_group_data_ids_node->data; - if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(session_management_subscription_data->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [inner]"); + goto end; } } } + } if (session_management_subscription_data->shared_dnn_configurations_id) { if (cJSON_AddStringToObject(item, "sharedDnnConfigurationsId", session_management_subscription_data->shared_dnn_configurations_id) == NULL) { @@ -168,7 +200,7 @@ cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_sessio } } - if (session_management_subscription_data->odb_packet_services) { + if (session_management_subscription_data->odb_packet_services != OpenAPI_odb_packet_services_NULL) { if (cJSON_AddStringToObject(item, "odbPacketServices", OpenAPI_odb_packet_services_ToString(session_management_subscription_data->odb_packet_services)) == NULL) { ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [odb_packet_services]"); goto end; @@ -176,7 +208,7 @@ cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_sessio } if (session_management_subscription_data->trace_data) { - cJSON *trace_data_local_JSON = OpenAPI_trace_data_1_convertToJSON(session_management_subscription_data->trace_data); + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(session_management_subscription_data->trace_data); if (trace_data_local_JSON == NULL) { ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [trace_data]"); goto end; @@ -202,21 +234,20 @@ cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_sessio goto end; } cJSON *localMapObject = expected_ue_behaviours_list; - OpenAPI_lnode_t *expected_ue_behaviours_list_node; if (session_management_subscription_data->expected_ue_behaviours_list) { - OpenAPI_list_for_each(session_management_subscription_data->expected_ue_behaviours_list, expected_ue_behaviours_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)expected_ue_behaviours_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_expected_ue_behaviour_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(session_management_subscription_data->expected_ue_behaviours_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_expected_ue_behaviour_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (session_management_subscription_data->suggested_packet_num_dl_list) { cJSON *suggested_packet_num_dl_list = cJSON_AddObjectToObject(item, "suggestedPacketNumDlList"); @@ -225,21 +256,20 @@ cJSON *OpenAPI_session_management_subscription_data_convertToJSON(OpenAPI_sessio goto end; } cJSON *localMapObject = suggested_packet_num_dl_list; - OpenAPI_lnode_t *suggested_packet_num_dl_list_node; if (session_management_subscription_data->suggested_packet_num_dl_list) { - OpenAPI_list_for_each(session_management_subscription_data->suggested_packet_num_dl_list, suggested_packet_num_dl_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)suggested_packet_num_dl_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_suggested_packet_num_dl_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(session_management_subscription_data->suggested_packet_num_dl_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_suggested_packet_num_dl_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (session_management_subscription_data->_3gpp_charging_characteristics) { if (cJSON_AddStringToObject(item, "3gppChargingCharacteristics", session_management_subscription_data->_3gpp_charging_characteristics) == NULL) { @@ -255,95 +285,113 @@ end: OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subscription_data_parseFromJSON(cJSON *session_management_subscription_dataJSON) { OpenAPI_session_management_subscription_data_t *session_management_subscription_data_local_var = NULL; - cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "singleNssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + cJSON *dnn_configurations = NULL; + OpenAPI_list_t *dnn_configurationsList = NULL; + cJSON *internal_group_ids = NULL; + OpenAPI_list_t *internal_group_idsList = NULL; + cJSON *shared_vn_group_data_ids = NULL; + OpenAPI_list_t *shared_vn_group_data_idsList = NULL; + cJSON *shared_dnn_configurations_id = NULL; + cJSON *odb_packet_services = NULL; + OpenAPI_odb_packet_services_e odb_packet_servicesVariable = 0; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *shared_trace_data_id = NULL; + cJSON *expected_ue_behaviours_list = NULL; + OpenAPI_list_t *expected_ue_behaviours_listList = NULL; + cJSON *suggested_packet_num_dl_list = NULL; + OpenAPI_list_t *suggested_packet_num_dl_listList = NULL; + cJSON *_3gpp_charging_characteristics = NULL; + single_nssai = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "singleNssai"); if (!single_nssai) { ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [single_nssai]"); goto end; } - - OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); - cJSON *dnn_configurations = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "dnnConfigurations"); - - OpenAPI_list_t *dnn_configurationsList; + dnn_configurations = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "dnnConfigurations"); if (dnn_configurations) { - cJSON *dnn_configurations_local_map; - if (!cJSON_IsObject(dnn_configurations)) { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [dnn_configurations]"); - goto end; - } - dnn_configurationsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(dnn_configurations_local_map, dnn_configurations) { - cJSON *localMapObject = dnn_configurations_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_dnn_configuration_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [inner]"); + cJSON *dnn_configurations_local_map = NULL; + if (!cJSON_IsObject(dnn_configurations) && !cJSON_IsNull(dnn_configurations)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [dnn_configurations]"); goto end; } - OpenAPI_list_add(dnn_configurationsList, localMapKeyPair); - } + if (cJSON_IsObject(dnn_configurations)) { + dnn_configurationsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(dnn_configurations_local_map, dnn_configurations) { + cJSON *localMapObject = dnn_configurations_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_dnn_configuration_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(dnn_configurationsList, localMapKeyPair); + } + } } - cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "internalGroupIds"); - - OpenAPI_list_t *internal_group_idsList; + internal_group_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "internalGroupIds"); if (internal_group_ids) { - cJSON *internal_group_ids_local; - if (!cJSON_IsArray(internal_group_ids)) { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - internal_group_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { - if (!cJSON_IsString(internal_group_ids_local)) { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); - } - } - - cJSON *shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "sharedVnGroupDataIds"); - - OpenAPI_list_t *shared_vn_group_data_idsList; - if (shared_vn_group_data_ids) { - cJSON *shared_vn_group_data_ids_local_map; - if (!cJSON_IsObject(shared_vn_group_data_ids)) { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [shared_vn_group_data_ids]"); - goto end; - } - shared_vn_group_data_idsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { - cJSON *localMapObject = shared_vn_group_data_ids_local_map; - if (!cJSON_IsString(localMapObject)) { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [inner]"); + cJSON *internal_group_ids_local = NULL; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [internal_group_ids]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); - } + + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } } - cJSON *shared_dnn_configurations_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "sharedDnnConfigurationsId"); + shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "sharedVnGroupDataIds"); + if (shared_vn_group_data_ids) { + cJSON *shared_vn_group_data_ids_local_map = NULL; + if (!cJSON_IsObject(shared_vn_group_data_ids) && !cJSON_IsNull(shared_vn_group_data_ids)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [shared_vn_group_data_ids]"); + goto end; + } + if (cJSON_IsObject(shared_vn_group_data_ids)) { + shared_vn_group_data_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { + cJSON *localMapObject = shared_vn_group_data_ids_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [inner]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); + } + } + } + shared_dnn_configurations_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "sharedDnnConfigurationsId"); if (shared_dnn_configurations_id) { - if (!cJSON_IsString(shared_dnn_configurations_id)) { + if (!cJSON_IsString(shared_dnn_configurations_id) && !cJSON_IsNull(shared_dnn_configurations_id)) { ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [shared_dnn_configurations_id]"); goto end; } } - cJSON *odb_packet_services = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "odbPacketServices"); - - OpenAPI_odb_packet_services_e odb_packet_servicesVariable; + odb_packet_services = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "odbPacketServices"); if (odb_packet_services) { if (!cJSON_IsString(odb_packet_services)) { ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [odb_packet_services]"); @@ -352,78 +400,74 @@ OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subsc odb_packet_servicesVariable = OpenAPI_odb_packet_services_FromString(odb_packet_services->valuestring); } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "traceData"); - - OpenAPI_trace_data_1_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "traceData"); if (trace_data) { - trace_data_local_nonprim = OpenAPI_trace_data_1_parseFromJSON(trace_data); + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *shared_trace_data_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "sharedTraceDataId"); - + shared_trace_data_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "sharedTraceDataId"); if (shared_trace_data_id) { - if (!cJSON_IsString(shared_trace_data_id)) { + if (!cJSON_IsString(shared_trace_data_id) && !cJSON_IsNull(shared_trace_data_id)) { ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [shared_trace_data_id]"); goto end; } } - cJSON *expected_ue_behaviours_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "expectedUeBehavioursList"); - - OpenAPI_list_t *expected_ue_behaviours_listList; + expected_ue_behaviours_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "expectedUeBehavioursList"); if (expected_ue_behaviours_list) { - cJSON *expected_ue_behaviours_list_local_map; - if (!cJSON_IsObject(expected_ue_behaviours_list)) { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [expected_ue_behaviours_list]"); - goto end; - } - expected_ue_behaviours_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(expected_ue_behaviours_list_local_map, expected_ue_behaviours_list) { - cJSON *localMapObject = expected_ue_behaviours_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_expected_ue_behaviour_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [inner]"); + cJSON *expected_ue_behaviours_list_local_map = NULL; + if (!cJSON_IsObject(expected_ue_behaviours_list) && !cJSON_IsNull(expected_ue_behaviours_list)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [expected_ue_behaviours_list]"); goto end; } - OpenAPI_list_add(expected_ue_behaviours_listList, localMapKeyPair); - } + if (cJSON_IsObject(expected_ue_behaviours_list)) { + expected_ue_behaviours_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(expected_ue_behaviours_list_local_map, expected_ue_behaviours_list) { + cJSON *localMapObject = expected_ue_behaviours_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_expected_ue_behaviour_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(expected_ue_behaviours_listList, localMapKeyPair); + } + } } - cJSON *suggested_packet_num_dl_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "suggestedPacketNumDlList"); - - OpenAPI_list_t *suggested_packet_num_dl_listList; + suggested_packet_num_dl_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "suggestedPacketNumDlList"); if (suggested_packet_num_dl_list) { - cJSON *suggested_packet_num_dl_list_local_map; - if (!cJSON_IsObject(suggested_packet_num_dl_list)) { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [suggested_packet_num_dl_list]"); - goto end; - } - suggested_packet_num_dl_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(suggested_packet_num_dl_list_local_map, suggested_packet_num_dl_list) { - cJSON *localMapObject = suggested_packet_num_dl_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_suggested_packet_num_dl_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [inner]"); + cJSON *suggested_packet_num_dl_list_local_map = NULL; + if (!cJSON_IsObject(suggested_packet_num_dl_list) && !cJSON_IsNull(suggested_packet_num_dl_list)) { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [suggested_packet_num_dl_list]"); goto end; } - OpenAPI_list_add(suggested_packet_num_dl_listList, localMapKeyPair); - } + if (cJSON_IsObject(suggested_packet_num_dl_list)) { + suggested_packet_num_dl_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(suggested_packet_num_dl_list_local_map, suggested_packet_num_dl_list) { + cJSON *localMapObject = suggested_packet_num_dl_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_suggested_packet_num_dl_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(suggested_packet_num_dl_listList, localMapKeyPair); + } + } } - cJSON *_3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "3gppChargingCharacteristics"); - + _3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(session_management_subscription_dataJSON, "3gppChargingCharacteristics"); if (_3gpp_charging_characteristics) { - if (!cJSON_IsString(_3gpp_charging_characteristics)) { + if (!cJSON_IsString(_3gpp_charging_characteristics) && !cJSON_IsNull(_3gpp_charging_characteristics)) { ogs_error("OpenAPI_session_management_subscription_data_parseFromJSON() failed [_3gpp_charging_characteristics]"); goto end; } @@ -434,17 +478,72 @@ OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subsc dnn_configurations ? dnn_configurationsList : NULL, internal_group_ids ? internal_group_idsList : NULL, shared_vn_group_data_ids ? shared_vn_group_data_idsList : NULL, - shared_dnn_configurations_id ? ogs_strdup(shared_dnn_configurations_id->valuestring) : NULL, + shared_dnn_configurations_id && !cJSON_IsNull(shared_dnn_configurations_id) ? ogs_strdup(shared_dnn_configurations_id->valuestring) : NULL, odb_packet_services ? odb_packet_servicesVariable : 0, trace_data ? trace_data_local_nonprim : NULL, - shared_trace_data_id ? ogs_strdup(shared_trace_data_id->valuestring) : NULL, + shared_trace_data_id && !cJSON_IsNull(shared_trace_data_id) ? ogs_strdup(shared_trace_data_id->valuestring) : NULL, expected_ue_behaviours_list ? expected_ue_behaviours_listList : NULL, suggested_packet_num_dl_list ? suggested_packet_num_dl_listList : NULL, - _3gpp_charging_characteristics ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL + _3gpp_charging_characteristics && !cJSON_IsNull(_3gpp_charging_characteristics) ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL ); return session_management_subscription_data_local_var; end: + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } + if (dnn_configurationsList) { + OpenAPI_list_for_each(dnn_configurationsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_dnn_configuration_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(dnn_configurationsList); + dnn_configurationsList = NULL; + } + if (internal_group_idsList) { + OpenAPI_list_for_each(internal_group_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(internal_group_idsList); + internal_group_idsList = NULL; + } + if (shared_vn_group_data_idsList) { + OpenAPI_list_for_each(shared_vn_group_data_idsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_vn_group_data_idsList); + shared_vn_group_data_idsList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (expected_ue_behaviours_listList) { + OpenAPI_list_for_each(expected_ue_behaviours_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_expected_ue_behaviour_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(expected_ue_behaviours_listList); + expected_ue_behaviours_listList = NULL; + } + if (suggested_packet_num_dl_listList) { + OpenAPI_list_for_each(suggested_packet_num_dl_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_suggested_packet_num_dl_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(suggested_packet_num_dl_listList); + suggested_packet_num_dl_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/session_management_subscription_data.h b/lib/sbi/openapi/model/session_management_subscription_data.h index d04b8b561..06d7ddf8e 100644 --- a/lib/sbi/openapi/model/session_management_subscription_data.h +++ b/lib/sbi/openapi/model/session_management_subscription_data.h @@ -17,7 +17,7 @@ #include "odb_packet_services.h" #include "snssai.h" #include "suggested_packet_num_dl.h" -#include "trace_data_1.h" +#include "trace_data.h" #ifdef __cplusplus extern "C" { @@ -31,7 +31,7 @@ typedef struct OpenAPI_session_management_subscription_data_s { OpenAPI_list_t* shared_vn_group_data_ids; char *shared_dnn_configurations_id; OpenAPI_odb_packet_services_e odb_packet_services; - struct OpenAPI_trace_data_1_s *trace_data; + struct OpenAPI_trace_data_s *trace_data; char *shared_trace_data_id; OpenAPI_list_t* expected_ue_behaviours_list; OpenAPI_list_t* suggested_packet_num_dl_list; @@ -45,7 +45,7 @@ OpenAPI_session_management_subscription_data_t *OpenAPI_session_management_subsc OpenAPI_list_t* shared_vn_group_data_ids, char *shared_dnn_configurations_id, OpenAPI_odb_packet_services_e odb_packet_services, - OpenAPI_trace_data_1_t *trace_data, + OpenAPI_trace_data_t *trace_data, char *shared_trace_data_id, OpenAPI_list_t* expected_ue_behaviours_list, OpenAPI_list_t* suggested_packet_num_dl_list, diff --git a/lib/sbi/openapi/model/session_management_subscription_data_1.c b/lib/sbi/openapi/model/session_management_subscription_data_1.c index 55af579e5..c898ef98b 100644 --- a/lib/sbi/openapi/model/session_management_subscription_data_1.c +++ b/lib/sbi/openapi/model/session_management_subscription_data_1.c @@ -38,53 +38,85 @@ OpenAPI_session_management_subscription_data_1_t *OpenAPI_session_management_sub void OpenAPI_session_management_subscription_data_1_free(OpenAPI_session_management_subscription_data_1_t *session_management_subscription_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == session_management_subscription_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(session_management_subscription_data_1->single_nssai); - OpenAPI_list_for_each(session_management_subscription_data_1->dnn_configurations, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_dnn_configuration_1_free(localKeyValue->value); - ogs_free(localKeyValue); + if (session_management_subscription_data_1->single_nssai) { + OpenAPI_snssai_free(session_management_subscription_data_1->single_nssai); + session_management_subscription_data_1->single_nssai = NULL; } - OpenAPI_list_free(session_management_subscription_data_1->dnn_configurations); - OpenAPI_list_for_each(session_management_subscription_data_1->internal_group_ids, node) { - ogs_free(node->data); + if (session_management_subscription_data_1->dnn_configurations) { + OpenAPI_list_for_each(session_management_subscription_data_1->dnn_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_dnn_configuration_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data_1->dnn_configurations); + session_management_subscription_data_1->dnn_configurations = NULL; } - OpenAPI_list_free(session_management_subscription_data_1->internal_group_ids); - OpenAPI_list_for_each(session_management_subscription_data_1->shared_vn_group_data_ids, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (session_management_subscription_data_1->internal_group_ids) { + OpenAPI_list_for_each(session_management_subscription_data_1->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(session_management_subscription_data_1->internal_group_ids); + session_management_subscription_data_1->internal_group_ids = NULL; } - OpenAPI_list_free(session_management_subscription_data_1->shared_vn_group_data_ids); - ogs_free(session_management_subscription_data_1->shared_dnn_configurations_id); - OpenAPI_trace_data_free(session_management_subscription_data_1->trace_data); - ogs_free(session_management_subscription_data_1->shared_trace_data_id); - OpenAPI_list_for_each(session_management_subscription_data_1->expected_ue_behaviours_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_expected_ue_behaviour_data_1_free(localKeyValue->value); - ogs_free(localKeyValue); + if (session_management_subscription_data_1->shared_vn_group_data_ids) { + OpenAPI_list_for_each(session_management_subscription_data_1->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data_1->shared_vn_group_data_ids); + session_management_subscription_data_1->shared_vn_group_data_ids = NULL; } - OpenAPI_list_free(session_management_subscription_data_1->expected_ue_behaviours_list); - OpenAPI_list_for_each(session_management_subscription_data_1->suggested_packet_num_dl_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_suggested_packet_num_dl_1_free(localKeyValue->value); - ogs_free(localKeyValue); + if (session_management_subscription_data_1->shared_dnn_configurations_id) { + ogs_free(session_management_subscription_data_1->shared_dnn_configurations_id); + session_management_subscription_data_1->shared_dnn_configurations_id = NULL; + } + if (session_management_subscription_data_1->trace_data) { + OpenAPI_trace_data_free(session_management_subscription_data_1->trace_data); + session_management_subscription_data_1->trace_data = NULL; + } + if (session_management_subscription_data_1->shared_trace_data_id) { + ogs_free(session_management_subscription_data_1->shared_trace_data_id); + session_management_subscription_data_1->shared_trace_data_id = NULL; + } + if (session_management_subscription_data_1->expected_ue_behaviours_list) { + OpenAPI_list_for_each(session_management_subscription_data_1->expected_ue_behaviours_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_expected_ue_behaviour_data_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data_1->expected_ue_behaviours_list); + session_management_subscription_data_1->expected_ue_behaviours_list = NULL; + } + if (session_management_subscription_data_1->suggested_packet_num_dl_list) { + OpenAPI_list_for_each(session_management_subscription_data_1->suggested_packet_num_dl_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_suggested_packet_num_dl_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(session_management_subscription_data_1->suggested_packet_num_dl_list); + session_management_subscription_data_1->suggested_packet_num_dl_list = NULL; + } + if (session_management_subscription_data_1->_3gpp_charging_characteristics) { + ogs_free(session_management_subscription_data_1->_3gpp_charging_characteristics); + session_management_subscription_data_1->_3gpp_charging_characteristics = NULL; } - OpenAPI_list_free(session_management_subscription_data_1->suggested_packet_num_dl_list); - ogs_free(session_management_subscription_data_1->_3gpp_charging_characteristics); ogs_free(session_management_subscription_data_1); } cJSON *OpenAPI_session_management_subscription_data_1_convertToJSON(OpenAPI_session_management_subscription_data_1_t *session_management_subscription_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (session_management_subscription_data_1 == NULL) { ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [SessionManagementSubscriptionData_1]"); @@ -92,6 +124,10 @@ cJSON *OpenAPI_session_management_subscription_data_1_convertToJSON(OpenAPI_sess } item = cJSON_CreateObject(); + if (!session_management_subscription_data_1->single_nssai) { + ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [single_nssai]"); + return NULL; + } cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(session_management_subscription_data_1->single_nssai); if (single_nssai_local_JSON == NULL) { ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [single_nssai]"); @@ -110,36 +146,33 @@ cJSON *OpenAPI_session_management_subscription_data_1_convertToJSON(OpenAPI_sess goto end; } cJSON *localMapObject = dnn_configurations; - OpenAPI_lnode_t *dnn_configurations_node; if (session_management_subscription_data_1->dnn_configurations) { - OpenAPI_list_for_each(session_management_subscription_data_1->dnn_configurations, dnn_configurations_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)dnn_configurations_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_dnn_configuration_1_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(session_management_subscription_data_1->dnn_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_dnn_configuration_1_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (session_management_subscription_data_1->internal_group_ids) { - cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); - if (internal_group_ids == NULL) { + cJSON *internal_group_idsList = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_idsList == NULL) { ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [internal_group_ids]"); goto end; } - - OpenAPI_lnode_t *internal_group_ids_node; - OpenAPI_list_for_each(session_management_subscription_data_1->internal_group_ids, internal_group_ids_node) { - if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [internal_group_ids]"); - goto end; + OpenAPI_list_for_each(session_management_subscription_data_1->internal_group_ids, node) { + if (cJSON_AddStringToObject(internal_group_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [internal_group_ids]"); + goto end; + } } - } } if (session_management_subscription_data_1->shared_vn_group_data_ids) { @@ -149,17 +182,16 @@ cJSON *OpenAPI_session_management_subscription_data_1_convertToJSON(OpenAPI_sess goto end; } cJSON *localMapObject = shared_vn_group_data_ids; - OpenAPI_lnode_t *shared_vn_group_data_ids_node; if (session_management_subscription_data_1->shared_vn_group_data_ids) { - OpenAPI_list_for_each(session_management_subscription_data_1->shared_vn_group_data_ids, shared_vn_group_data_ids_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_vn_group_data_ids_node->data; - if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(session_management_subscription_data_1->shared_vn_group_data_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [inner]"); + goto end; } } } + } if (session_management_subscription_data_1->shared_dnn_configurations_id) { if (cJSON_AddStringToObject(item, "sharedDnnConfigurationsId", session_management_subscription_data_1->shared_dnn_configurations_id) == NULL) { @@ -168,7 +200,7 @@ cJSON *OpenAPI_session_management_subscription_data_1_convertToJSON(OpenAPI_sess } } - if (session_management_subscription_data_1->odb_packet_services) { + if (session_management_subscription_data_1->odb_packet_services != OpenAPI_odb_packet_services_NULL) { if (cJSON_AddStringToObject(item, "odbPacketServices", OpenAPI_odb_packet_services_ToString(session_management_subscription_data_1->odb_packet_services)) == NULL) { ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [odb_packet_services]"); goto end; @@ -202,21 +234,20 @@ cJSON *OpenAPI_session_management_subscription_data_1_convertToJSON(OpenAPI_sess goto end; } cJSON *localMapObject = expected_ue_behaviours_list; - OpenAPI_lnode_t *expected_ue_behaviours_list_node; if (session_management_subscription_data_1->expected_ue_behaviours_list) { - OpenAPI_list_for_each(session_management_subscription_data_1->expected_ue_behaviours_list, expected_ue_behaviours_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)expected_ue_behaviours_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_expected_ue_behaviour_data_1_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(session_management_subscription_data_1->expected_ue_behaviours_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_expected_ue_behaviour_data_1_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (session_management_subscription_data_1->suggested_packet_num_dl_list) { cJSON *suggested_packet_num_dl_list = cJSON_AddObjectToObject(item, "suggestedPacketNumDlList"); @@ -225,21 +256,20 @@ cJSON *OpenAPI_session_management_subscription_data_1_convertToJSON(OpenAPI_sess goto end; } cJSON *localMapObject = suggested_packet_num_dl_list; - OpenAPI_lnode_t *suggested_packet_num_dl_list_node; if (session_management_subscription_data_1->suggested_packet_num_dl_list) { - OpenAPI_list_for_each(session_management_subscription_data_1->suggested_packet_num_dl_list, suggested_packet_num_dl_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)suggested_packet_num_dl_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_suggested_packet_num_dl_1_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(session_management_subscription_data_1->suggested_packet_num_dl_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_suggested_packet_num_dl_1_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_session_management_subscription_data_1_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (session_management_subscription_data_1->_3gpp_charging_characteristics) { if (cJSON_AddStringToObject(item, "3gppChargingCharacteristics", session_management_subscription_data_1->_3gpp_charging_characteristics) == NULL) { @@ -255,95 +285,113 @@ end: OpenAPI_session_management_subscription_data_1_t *OpenAPI_session_management_subscription_data_1_parseFromJSON(cJSON *session_management_subscription_data_1JSON) { OpenAPI_session_management_subscription_data_1_t *session_management_subscription_data_1_local_var = NULL; - cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "singleNssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + cJSON *dnn_configurations = NULL; + OpenAPI_list_t *dnn_configurationsList = NULL; + cJSON *internal_group_ids = NULL; + OpenAPI_list_t *internal_group_idsList = NULL; + cJSON *shared_vn_group_data_ids = NULL; + OpenAPI_list_t *shared_vn_group_data_idsList = NULL; + cJSON *shared_dnn_configurations_id = NULL; + cJSON *odb_packet_services = NULL; + OpenAPI_odb_packet_services_e odb_packet_servicesVariable = 0; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *shared_trace_data_id = NULL; + cJSON *expected_ue_behaviours_list = NULL; + OpenAPI_list_t *expected_ue_behaviours_listList = NULL; + cJSON *suggested_packet_num_dl_list = NULL; + OpenAPI_list_t *suggested_packet_num_dl_listList = NULL; + cJSON *_3gpp_charging_characteristics = NULL; + single_nssai = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "singleNssai"); if (!single_nssai) { ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [single_nssai]"); goto end; } - - OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); - cJSON *dnn_configurations = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "dnnConfigurations"); - - OpenAPI_list_t *dnn_configurationsList; + dnn_configurations = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "dnnConfigurations"); if (dnn_configurations) { - cJSON *dnn_configurations_local_map; - if (!cJSON_IsObject(dnn_configurations)) { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [dnn_configurations]"); - goto end; - } - dnn_configurationsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(dnn_configurations_local_map, dnn_configurations) { - cJSON *localMapObject = dnn_configurations_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_dnn_configuration_1_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [inner]"); + cJSON *dnn_configurations_local_map = NULL; + if (!cJSON_IsObject(dnn_configurations) && !cJSON_IsNull(dnn_configurations)) { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [dnn_configurations]"); goto end; } - OpenAPI_list_add(dnn_configurationsList, localMapKeyPair); - } + if (cJSON_IsObject(dnn_configurations)) { + dnn_configurationsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(dnn_configurations_local_map, dnn_configurations) { + cJSON *localMapObject = dnn_configurations_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_dnn_configuration_1_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(dnn_configurationsList, localMapKeyPair); + } + } } - cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "internalGroupIds"); - - OpenAPI_list_t *internal_group_idsList; + internal_group_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "internalGroupIds"); if (internal_group_ids) { - cJSON *internal_group_ids_local; - if (!cJSON_IsArray(internal_group_ids)) { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - internal_group_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { - if (!cJSON_IsString(internal_group_ids_local)) { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); - } - } - - cJSON *shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "sharedVnGroupDataIds"); - - OpenAPI_list_t *shared_vn_group_data_idsList; - if (shared_vn_group_data_ids) { - cJSON *shared_vn_group_data_ids_local_map; - if (!cJSON_IsObject(shared_vn_group_data_ids)) { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [shared_vn_group_data_ids]"); - goto end; - } - shared_vn_group_data_idsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { - cJSON *localMapObject = shared_vn_group_data_ids_local_map; - if (!cJSON_IsString(localMapObject)) { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [inner]"); + cJSON *internal_group_ids_local = NULL; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [internal_group_ids]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); - } + + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } } - cJSON *shared_dnn_configurations_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "sharedDnnConfigurationsId"); + shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "sharedVnGroupDataIds"); + if (shared_vn_group_data_ids) { + cJSON *shared_vn_group_data_ids_local_map = NULL; + if (!cJSON_IsObject(shared_vn_group_data_ids) && !cJSON_IsNull(shared_vn_group_data_ids)) { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [shared_vn_group_data_ids]"); + goto end; + } + if (cJSON_IsObject(shared_vn_group_data_ids)) { + shared_vn_group_data_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_vn_group_data_ids_local_map, shared_vn_group_data_ids) { + cJSON *localMapObject = shared_vn_group_data_ids_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [inner]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + OpenAPI_list_add(shared_vn_group_data_idsList, localMapKeyPair); + } + } + } + shared_dnn_configurations_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "sharedDnnConfigurationsId"); if (shared_dnn_configurations_id) { - if (!cJSON_IsString(shared_dnn_configurations_id)) { + if (!cJSON_IsString(shared_dnn_configurations_id) && !cJSON_IsNull(shared_dnn_configurations_id)) { ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [shared_dnn_configurations_id]"); goto end; } } - cJSON *odb_packet_services = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "odbPacketServices"); - - OpenAPI_odb_packet_services_e odb_packet_servicesVariable; + odb_packet_services = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "odbPacketServices"); if (odb_packet_services) { if (!cJSON_IsString(odb_packet_services)) { ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [odb_packet_services]"); @@ -352,78 +400,74 @@ OpenAPI_session_management_subscription_data_1_t *OpenAPI_session_management_sub odb_packet_servicesVariable = OpenAPI_odb_packet_services_FromString(odb_packet_services->valuestring); } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *shared_trace_data_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "sharedTraceDataId"); - + shared_trace_data_id = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "sharedTraceDataId"); if (shared_trace_data_id) { - if (!cJSON_IsString(shared_trace_data_id)) { + if (!cJSON_IsString(shared_trace_data_id) && !cJSON_IsNull(shared_trace_data_id)) { ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [shared_trace_data_id]"); goto end; } } - cJSON *expected_ue_behaviours_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "expectedUeBehavioursList"); - - OpenAPI_list_t *expected_ue_behaviours_listList; + expected_ue_behaviours_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "expectedUeBehavioursList"); if (expected_ue_behaviours_list) { - cJSON *expected_ue_behaviours_list_local_map; - if (!cJSON_IsObject(expected_ue_behaviours_list)) { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [expected_ue_behaviours_list]"); - goto end; - } - expected_ue_behaviours_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(expected_ue_behaviours_list_local_map, expected_ue_behaviours_list) { - cJSON *localMapObject = expected_ue_behaviours_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_expected_ue_behaviour_data_1_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [inner]"); + cJSON *expected_ue_behaviours_list_local_map = NULL; + if (!cJSON_IsObject(expected_ue_behaviours_list) && !cJSON_IsNull(expected_ue_behaviours_list)) { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [expected_ue_behaviours_list]"); goto end; } - OpenAPI_list_add(expected_ue_behaviours_listList, localMapKeyPair); - } + if (cJSON_IsObject(expected_ue_behaviours_list)) { + expected_ue_behaviours_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(expected_ue_behaviours_list_local_map, expected_ue_behaviours_list) { + cJSON *localMapObject = expected_ue_behaviours_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_expected_ue_behaviour_data_1_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(expected_ue_behaviours_listList, localMapKeyPair); + } + } } - cJSON *suggested_packet_num_dl_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "suggestedPacketNumDlList"); - - OpenAPI_list_t *suggested_packet_num_dl_listList; + suggested_packet_num_dl_list = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "suggestedPacketNumDlList"); if (suggested_packet_num_dl_list) { - cJSON *suggested_packet_num_dl_list_local_map; - if (!cJSON_IsObject(suggested_packet_num_dl_list)) { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [suggested_packet_num_dl_list]"); - goto end; - } - suggested_packet_num_dl_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(suggested_packet_num_dl_list_local_map, suggested_packet_num_dl_list) { - cJSON *localMapObject = suggested_packet_num_dl_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_suggested_packet_num_dl_1_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [inner]"); + cJSON *suggested_packet_num_dl_list_local_map = NULL; + if (!cJSON_IsObject(suggested_packet_num_dl_list) && !cJSON_IsNull(suggested_packet_num_dl_list)) { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [suggested_packet_num_dl_list]"); goto end; } - OpenAPI_list_add(suggested_packet_num_dl_listList, localMapKeyPair); - } + if (cJSON_IsObject(suggested_packet_num_dl_list)) { + suggested_packet_num_dl_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(suggested_packet_num_dl_list_local_map, suggested_packet_num_dl_list) { + cJSON *localMapObject = suggested_packet_num_dl_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_suggested_packet_num_dl_1_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(suggested_packet_num_dl_listList, localMapKeyPair); + } + } } - cJSON *_3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "3gppChargingCharacteristics"); - + _3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(session_management_subscription_data_1JSON, "3gppChargingCharacteristics"); if (_3gpp_charging_characteristics) { - if (!cJSON_IsString(_3gpp_charging_characteristics)) { + if (!cJSON_IsString(_3gpp_charging_characteristics) && !cJSON_IsNull(_3gpp_charging_characteristics)) { ogs_error("OpenAPI_session_management_subscription_data_1_parseFromJSON() failed [_3gpp_charging_characteristics]"); goto end; } @@ -434,17 +478,72 @@ OpenAPI_session_management_subscription_data_1_t *OpenAPI_session_management_sub dnn_configurations ? dnn_configurationsList : NULL, internal_group_ids ? internal_group_idsList : NULL, shared_vn_group_data_ids ? shared_vn_group_data_idsList : NULL, - shared_dnn_configurations_id ? ogs_strdup(shared_dnn_configurations_id->valuestring) : NULL, + shared_dnn_configurations_id && !cJSON_IsNull(shared_dnn_configurations_id) ? ogs_strdup(shared_dnn_configurations_id->valuestring) : NULL, odb_packet_services ? odb_packet_servicesVariable : 0, trace_data ? trace_data_local_nonprim : NULL, - shared_trace_data_id ? ogs_strdup(shared_trace_data_id->valuestring) : NULL, + shared_trace_data_id && !cJSON_IsNull(shared_trace_data_id) ? ogs_strdup(shared_trace_data_id->valuestring) : NULL, expected_ue_behaviours_list ? expected_ue_behaviours_listList : NULL, suggested_packet_num_dl_list ? suggested_packet_num_dl_listList : NULL, - _3gpp_charging_characteristics ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL + _3gpp_charging_characteristics && !cJSON_IsNull(_3gpp_charging_characteristics) ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL ); return session_management_subscription_data_1_local_var; end: + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } + if (dnn_configurationsList) { + OpenAPI_list_for_each(dnn_configurationsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_dnn_configuration_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(dnn_configurationsList); + dnn_configurationsList = NULL; + } + if (internal_group_idsList) { + OpenAPI_list_for_each(internal_group_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(internal_group_idsList); + internal_group_idsList = NULL; + } + if (shared_vn_group_data_idsList) { + OpenAPI_list_for_each(shared_vn_group_data_idsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_vn_group_data_idsList); + shared_vn_group_data_idsList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (expected_ue_behaviours_listList) { + OpenAPI_list_for_each(expected_ue_behaviours_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_expected_ue_behaviour_data_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(expected_ue_behaviours_listList); + expected_ue_behaviours_listList = NULL; + } + if (suggested_packet_num_dl_listList) { + OpenAPI_list_for_each(suggested_packet_num_dl_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_suggested_packet_num_dl_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(suggested_packet_num_dl_listList); + suggested_packet_num_dl_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/session_rule.c b/lib/sbi/openapi/model/session_rule.c index c47959398..60eb658b9 100644 --- a/lib/sbi/openapi/model/session_rule.c +++ b/lib/sbi/openapi/model/session_rule.c @@ -28,22 +28,42 @@ OpenAPI_session_rule_t *OpenAPI_session_rule_create( void OpenAPI_session_rule_free(OpenAPI_session_rule_t *session_rule) { + OpenAPI_lnode_t *node = NULL; + if (NULL == session_rule) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ambr_free(session_rule->auth_sess_ambr); - OpenAPI_authorized_default_qos_free(session_rule->auth_def_qos); - ogs_free(session_rule->sess_rule_id); - ogs_free(session_rule->ref_um_data); - ogs_free(session_rule->ref_um_n3g_data); - ogs_free(session_rule->ref_cond_data); + if (session_rule->auth_sess_ambr) { + OpenAPI_ambr_free(session_rule->auth_sess_ambr); + session_rule->auth_sess_ambr = NULL; + } + if (session_rule->auth_def_qos) { + OpenAPI_authorized_default_qos_free(session_rule->auth_def_qos); + session_rule->auth_def_qos = NULL; + } + if (session_rule->sess_rule_id) { + ogs_free(session_rule->sess_rule_id); + session_rule->sess_rule_id = NULL; + } + if (session_rule->ref_um_data) { + ogs_free(session_rule->ref_um_data); + session_rule->ref_um_data = NULL; + } + if (session_rule->ref_um_n3g_data) { + ogs_free(session_rule->ref_um_n3g_data); + session_rule->ref_um_n3g_data = NULL; + } + if (session_rule->ref_cond_data) { + ogs_free(session_rule->ref_cond_data); + session_rule->ref_cond_data = NULL; + } ogs_free(session_rule); } cJSON *OpenAPI_session_rule_convertToJSON(OpenAPI_session_rule_t *session_rule) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (session_rule == NULL) { ogs_error("OpenAPI_session_rule_convertToJSON() failed [SessionRule]"); @@ -77,6 +97,10 @@ cJSON *OpenAPI_session_rule_convertToJSON(OpenAPI_session_rule_t *session_rule) } } + if (!session_rule->sess_rule_id) { + ogs_error("OpenAPI_session_rule_convertToJSON() failed [sess_rule_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "sessRuleId", session_rule->sess_rule_id) == NULL) { ogs_error("OpenAPI_session_rule_convertToJSON() failed [sess_rule_id]"); goto end; @@ -110,53 +134,54 @@ end: OpenAPI_session_rule_t *OpenAPI_session_rule_parseFromJSON(cJSON *session_ruleJSON) { OpenAPI_session_rule_t *session_rule_local_var = NULL; - cJSON *auth_sess_ambr = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "authSessAmbr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *auth_sess_ambr = NULL; OpenAPI_ambr_t *auth_sess_ambr_local_nonprim = NULL; + cJSON *auth_def_qos = NULL; + OpenAPI_authorized_default_qos_t *auth_def_qos_local_nonprim = NULL; + cJSON *sess_rule_id = NULL; + cJSON *ref_um_data = NULL; + cJSON *ref_um_n3g_data = NULL; + cJSON *ref_cond_data = NULL; + auth_sess_ambr = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "authSessAmbr"); if (auth_sess_ambr) { auth_sess_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(auth_sess_ambr); } - cJSON *auth_def_qos = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "authDefQos"); - - OpenAPI_authorized_default_qos_t *auth_def_qos_local_nonprim = NULL; + auth_def_qos = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "authDefQos"); if (auth_def_qos) { auth_def_qos_local_nonprim = OpenAPI_authorized_default_qos_parseFromJSON(auth_def_qos); } - cJSON *sess_rule_id = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "sessRuleId"); + sess_rule_id = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "sessRuleId"); if (!sess_rule_id) { ogs_error("OpenAPI_session_rule_parseFromJSON() failed [sess_rule_id]"); goto end; } - if (!cJSON_IsString(sess_rule_id)) { ogs_error("OpenAPI_session_rule_parseFromJSON() failed [sess_rule_id]"); goto end; } - cJSON *ref_um_data = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "refUmData"); - + ref_um_data = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "refUmData"); if (ref_um_data) { - if (!cJSON_IsString(ref_um_data)) { + if (!cJSON_IsString(ref_um_data) && !cJSON_IsNull(ref_um_data)) { ogs_error("OpenAPI_session_rule_parseFromJSON() failed [ref_um_data]"); goto end; } } - cJSON *ref_um_n3g_data = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "refUmN3gData"); - + ref_um_n3g_data = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "refUmN3gData"); if (ref_um_n3g_data) { - if (!cJSON_IsString(ref_um_n3g_data)) { + if (!cJSON_IsString(ref_um_n3g_data) && !cJSON_IsNull(ref_um_n3g_data)) { ogs_error("OpenAPI_session_rule_parseFromJSON() failed [ref_um_n3g_data]"); goto end; } } - cJSON *ref_cond_data = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "refCondData"); - + ref_cond_data = cJSON_GetObjectItemCaseSensitive(session_ruleJSON, "refCondData"); if (ref_cond_data) { - if (!cJSON_IsString(ref_cond_data)) { + if (!cJSON_IsString(ref_cond_data) && !cJSON_IsNull(ref_cond_data)) { ogs_error("OpenAPI_session_rule_parseFromJSON() failed [ref_cond_data]"); goto end; } @@ -166,13 +191,21 @@ OpenAPI_session_rule_t *OpenAPI_session_rule_parseFromJSON(cJSON *session_ruleJS auth_sess_ambr ? auth_sess_ambr_local_nonprim : NULL, auth_def_qos ? auth_def_qos_local_nonprim : NULL, ogs_strdup(sess_rule_id->valuestring), - ref_um_data ? ogs_strdup(ref_um_data->valuestring) : NULL, - ref_um_n3g_data ? ogs_strdup(ref_um_n3g_data->valuestring) : NULL, - ref_cond_data ? ogs_strdup(ref_cond_data->valuestring) : NULL + ref_um_data && !cJSON_IsNull(ref_um_data) ? ogs_strdup(ref_um_data->valuestring) : NULL, + ref_um_n3g_data && !cJSON_IsNull(ref_um_n3g_data) ? ogs_strdup(ref_um_n3g_data->valuestring) : NULL, + ref_cond_data && !cJSON_IsNull(ref_cond_data) ? ogs_strdup(ref_cond_data->valuestring) : NULL ); return session_rule_local_var; end: + if (auth_sess_ambr_local_nonprim) { + OpenAPI_ambr_free(auth_sess_ambr_local_nonprim); + auth_sess_ambr_local_nonprim = NULL; + } + if (auth_def_qos_local_nonprim) { + OpenAPI_authorized_default_qos_free(auth_def_qos_local_nonprim); + auth_def_qos_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/session_rule_report.c b/lib/sbi/openapi/model/session_rule_report.c index 4ca95ea10..8f1d62326 100644 --- a/lib/sbi/openapi/model/session_rule_report.c +++ b/lib/sbi/openapi/model/session_rule_report.c @@ -24,21 +24,29 @@ OpenAPI_session_rule_report_t *OpenAPI_session_rule_report_create( void OpenAPI_session_rule_report_free(OpenAPI_session_rule_report_t *session_rule_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == session_rule_report) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(session_rule_report->rule_ids, node) { - ogs_free(node->data); + if (session_rule_report->rule_ids) { + OpenAPI_list_for_each(session_rule_report->rule_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(session_rule_report->rule_ids); + session_rule_report->rule_ids = NULL; + } + if (session_rule_report->policy_dec_failure_reports) { + OpenAPI_list_free(session_rule_report->policy_dec_failure_reports); + session_rule_report->policy_dec_failure_reports = NULL; } - OpenAPI_list_free(session_rule_report->rule_ids); - OpenAPI_list_free(session_rule_report->policy_dec_failure_reports); ogs_free(session_rule_report); } cJSON *OpenAPI_session_rule_report_convertToJSON(OpenAPI_session_rule_report_t *session_rule_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (session_rule_report == NULL) { ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [SessionRuleReport]"); @@ -46,41 +54,46 @@ cJSON *OpenAPI_session_rule_report_convertToJSON(OpenAPI_session_rule_report_t * } item = cJSON_CreateObject(); - cJSON *rule_ids = cJSON_AddArrayToObject(item, "ruleIds"); - if (rule_ids == NULL) { + if (!session_rule_report->rule_ids) { + ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_ids]"); + return NULL; + } + cJSON *rule_idsList = cJSON_AddArrayToObject(item, "ruleIds"); + if (rule_idsList == NULL) { ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_ids]"); goto end; } - - OpenAPI_lnode_t *rule_ids_node; - OpenAPI_list_for_each(session_rule_report->rule_ids, rule_ids_node) { - if (cJSON_AddStringToObject(rule_ids, "", (char*)rule_ids_node->data) == NULL) { - ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_ids]"); - goto end; + OpenAPI_list_for_each(session_rule_report->rule_ids, node) { + if (cJSON_AddStringToObject(rule_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_ids]"); + goto end; + } } - } + if (session_rule_report->rule_status == OpenAPI_rule_status_NULL) { + ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ruleStatus", OpenAPI_rule_status_ToString(session_rule_report->rule_status)) == NULL) { ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_status]"); goto end; } - if (session_rule_report->sess_rule_failure_code) { + if (session_rule_report->sess_rule_failure_code != OpenAPI_session_rule_failure_code_NULL) { if (cJSON_AddStringToObject(item, "sessRuleFailureCode", OpenAPI_session_rule_failure_code_ToString(session_rule_report->sess_rule_failure_code)) == NULL) { ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [sess_rule_failure_code]"); goto end; } } - if (session_rule_report->policy_dec_failure_reports) { - cJSON *policy_dec_failure_reports = cJSON_AddArrayToObject(item, "policyDecFailureReports"); - if (policy_dec_failure_reports == NULL) { + if (session_rule_report->policy_dec_failure_reports != OpenAPI_policy_decision_failure_code_NULL) { + cJSON *policy_dec_failure_reportsList = cJSON_AddArrayToObject(item, "policyDecFailureReports"); + if (policy_dec_failure_reportsList == NULL) { ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [policy_dec_failure_reports]"); goto end; } - OpenAPI_lnode_t *policy_dec_failure_reports_node; - OpenAPI_list_for_each(session_rule_report->policy_dec_failure_reports, policy_dec_failure_reports_node) { - if (cJSON_AddStringToObject(policy_dec_failure_reports, "", OpenAPI_policy_decision_failure_code_ToString((intptr_t)policy_dec_failure_reports_node->data)) == NULL) { + OpenAPI_list_for_each(session_rule_report->policy_dec_failure_reports, node) { + if (cJSON_AddStringToObject(policy_dec_failure_reportsList, "", OpenAPI_policy_decision_failure_code_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [policy_dec_failure_reports]"); goto end; } @@ -94,44 +107,50 @@ end: OpenAPI_session_rule_report_t *OpenAPI_session_rule_report_parseFromJSON(cJSON *session_rule_reportJSON) { OpenAPI_session_rule_report_t *session_rule_report_local_var = NULL; - cJSON *rule_ids = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "ruleIds"); + OpenAPI_lnode_t *node = NULL; + cJSON *rule_ids = NULL; + OpenAPI_list_t *rule_idsList = NULL; + cJSON *rule_status = NULL; + OpenAPI_rule_status_e rule_statusVariable = 0; + cJSON *sess_rule_failure_code = NULL; + OpenAPI_session_rule_failure_code_e sess_rule_failure_codeVariable = 0; + cJSON *policy_dec_failure_reports = NULL; + OpenAPI_list_t *policy_dec_failure_reportsList = NULL; + rule_ids = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "ruleIds"); if (!rule_ids) { ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [rule_ids]"); goto end; } + cJSON *rule_ids_local = NULL; + if (!cJSON_IsArray(rule_ids)) { + ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [rule_ids]"); + goto end; + } - OpenAPI_list_t *rule_idsList; - cJSON *rule_ids_local; - if (!cJSON_IsArray(rule_ids)) { - ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [rule_ids]"); - goto end; - } - rule_idsList = OpenAPI_list_create(); + rule_idsList = OpenAPI_list_create(); - cJSON_ArrayForEach(rule_ids_local, rule_ids) { - if (!cJSON_IsString(rule_ids_local)) { - ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [rule_ids]"); - goto end; - } - OpenAPI_list_add(rule_idsList, ogs_strdup(rule_ids_local->valuestring)); - } + cJSON_ArrayForEach(rule_ids_local, rule_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(rule_ids_local)) { + ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [rule_ids]"); + goto end; + } + OpenAPI_list_add(rule_idsList, ogs_strdup(rule_ids_local->valuestring)); + } - cJSON *rule_status = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "ruleStatus"); + rule_status = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "ruleStatus"); if (!rule_status) { ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [rule_status]"); goto end; } - - OpenAPI_rule_status_e rule_statusVariable; if (!cJSON_IsString(rule_status)) { ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [rule_status]"); goto end; } rule_statusVariable = OpenAPI_rule_status_FromString(rule_status->valuestring); - cJSON *sess_rule_failure_code = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "sessRuleFailureCode"); - - OpenAPI_session_rule_failure_code_e sess_rule_failure_codeVariable; + sess_rule_failure_code = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "sessRuleFailureCode"); if (sess_rule_failure_code) { if (!cJSON_IsString(sess_rule_failure_code)) { ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [sess_rule_failure_code]"); @@ -140,26 +159,23 @@ OpenAPI_session_rule_report_t *OpenAPI_session_rule_report_parseFromJSON(cJSON * sess_rule_failure_codeVariable = OpenAPI_session_rule_failure_code_FromString(sess_rule_failure_code->valuestring); } - cJSON *policy_dec_failure_reports = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "policyDecFailureReports"); - - OpenAPI_list_t *policy_dec_failure_reportsList; + policy_dec_failure_reports = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "policyDecFailureReports"); if (policy_dec_failure_reports) { - cJSON *policy_dec_failure_reports_local_nonprimitive; - if (!cJSON_IsArray(policy_dec_failure_reports)) { - ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [policy_dec_failure_reports]"); - goto end; - } - - policy_dec_failure_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(policy_dec_failure_reports_local_nonprimitive, policy_dec_failure_reports ) { - if (!cJSON_IsString(policy_dec_failure_reports_local_nonprimitive)){ + cJSON *policy_dec_failure_reports_local = NULL; + if (!cJSON_IsArray(policy_dec_failure_reports)) { ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [policy_dec_failure_reports]"); goto end; } - OpenAPI_list_add(policy_dec_failure_reportsList, (void *)OpenAPI_policy_decision_failure_code_FromString(policy_dec_failure_reports_local_nonprimitive->valuestring)); - } + policy_dec_failure_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(policy_dec_failure_reports_local, policy_dec_failure_reports) { + if (!cJSON_IsString(policy_dec_failure_reports_local)) { + ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [policy_dec_failure_reports]"); + goto end; + } + OpenAPI_list_add(policy_dec_failure_reportsList, (void *)OpenAPI_policy_decision_failure_code_FromString(policy_dec_failure_reports_local->valuestring)); + } } session_rule_report_local_var = OpenAPI_session_rule_report_create ( @@ -171,6 +187,17 @@ OpenAPI_session_rule_report_t *OpenAPI_session_rule_report_parseFromJSON(cJSON * return session_rule_report_local_var; end: + if (rule_idsList) { + OpenAPI_list_for_each(rule_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(rule_idsList); + rule_idsList = NULL; + } + if (policy_dec_failure_reportsList) { + OpenAPI_list_free(policy_dec_failure_reportsList); + policy_dec_failure_reportsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/shared_data.c b/lib/sbi/openapi/model/shared_data.c index 6c2151674..847974122 100644 --- a/lib/sbi/openapi/model/shared_data.c +++ b/lib/sbi/openapi/model/shared_data.c @@ -6,9 +6,9 @@ OpenAPI_shared_data_t *OpenAPI_shared_data_create( char *shared_data_id, - OpenAPI_access_and_mobility_subscription_data_1_t *shared_am_data, - OpenAPI_sms_subscription_data_1_t *shared_sms_subs_data, - OpenAPI_sms_management_subscription_data_1_t *shared_sms_mng_subs_data, + OpenAPI_access_and_mobility_subscription_data_t *shared_am_data, + OpenAPI_sms_subscription_data_t *shared_sms_subs_data, + OpenAPI_sms_management_subscription_data_t *shared_sms_mng_subs_data, OpenAPI_list_t* shared_dnn_configurations, OpenAPI_trace_data_t *shared_trace_data, OpenAPI_list_t* shared_snssai_infos, @@ -32,42 +32,68 @@ OpenAPI_shared_data_t *OpenAPI_shared_data_create( void OpenAPI_shared_data_free(OpenAPI_shared_data_t *shared_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == shared_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(shared_data->shared_data_id); - OpenAPI_access_and_mobility_subscription_data_1_free(shared_data->shared_am_data); - OpenAPI_sms_subscription_data_1_free(shared_data->shared_sms_subs_data); - OpenAPI_sms_management_subscription_data_1_free(shared_data->shared_sms_mng_subs_data); - OpenAPI_list_for_each(shared_data->shared_dnn_configurations, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_dnn_configuration_1_free(localKeyValue->value); - ogs_free(localKeyValue); + if (shared_data->shared_data_id) { + ogs_free(shared_data->shared_data_id); + shared_data->shared_data_id = NULL; } - OpenAPI_list_free(shared_data->shared_dnn_configurations); - OpenAPI_trace_data_free(shared_data->shared_trace_data); - OpenAPI_list_for_each(shared_data->shared_snssai_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_snssai_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (shared_data->shared_am_data) { + OpenAPI_access_and_mobility_subscription_data_free(shared_data->shared_am_data); + shared_data->shared_am_data = NULL; } - OpenAPI_list_free(shared_data->shared_snssai_infos); - OpenAPI_list_for_each(shared_data->shared_vn_group_datas, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_vn_group_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (shared_data->shared_sms_subs_data) { + OpenAPI_sms_subscription_data_free(shared_data->shared_sms_subs_data); + shared_data->shared_sms_subs_data = NULL; + } + if (shared_data->shared_sms_mng_subs_data) { + OpenAPI_sms_management_subscription_data_free(shared_data->shared_sms_mng_subs_data); + shared_data->shared_sms_mng_subs_data = NULL; + } + if (shared_data->shared_dnn_configurations) { + OpenAPI_list_for_each(shared_data->shared_dnn_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_dnn_configuration_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_data->shared_dnn_configurations); + shared_data->shared_dnn_configurations = NULL; + } + if (shared_data->shared_trace_data) { + OpenAPI_trace_data_free(shared_data->shared_trace_data); + shared_data->shared_trace_data = NULL; + } + if (shared_data->shared_snssai_infos) { + OpenAPI_list_for_each(shared_data->shared_snssai_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_snssai_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_data->shared_snssai_infos); + shared_data->shared_snssai_infos = NULL; + } + if (shared_data->shared_vn_group_datas) { + OpenAPI_list_for_each(shared_data->shared_vn_group_datas, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_vn_group_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_data->shared_vn_group_datas); + shared_data->shared_vn_group_datas = NULL; } - OpenAPI_list_free(shared_data->shared_vn_group_datas); ogs_free(shared_data); } cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (shared_data == NULL) { ogs_error("OpenAPI_shared_data_convertToJSON() failed [SharedData]"); @@ -75,13 +101,17 @@ cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data) } item = cJSON_CreateObject(); + if (!shared_data->shared_data_id) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_data_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "sharedDataId", shared_data->shared_data_id) == NULL) { ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_data_id]"); goto end; } if (shared_data->shared_am_data) { - cJSON *shared_am_data_local_JSON = OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(shared_data->shared_am_data); + cJSON *shared_am_data_local_JSON = OpenAPI_access_and_mobility_subscription_data_convertToJSON(shared_data->shared_am_data); if (shared_am_data_local_JSON == NULL) { ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_am_data]"); goto end; @@ -94,7 +124,7 @@ cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data) } if (shared_data->shared_sms_subs_data) { - cJSON *shared_sms_subs_data_local_JSON = OpenAPI_sms_subscription_data_1_convertToJSON(shared_data->shared_sms_subs_data); + cJSON *shared_sms_subs_data_local_JSON = OpenAPI_sms_subscription_data_convertToJSON(shared_data->shared_sms_subs_data); if (shared_sms_subs_data_local_JSON == NULL) { ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_sms_subs_data]"); goto end; @@ -107,7 +137,7 @@ cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data) } if (shared_data->shared_sms_mng_subs_data) { - cJSON *shared_sms_mng_subs_data_local_JSON = OpenAPI_sms_management_subscription_data_1_convertToJSON(shared_data->shared_sms_mng_subs_data); + cJSON *shared_sms_mng_subs_data_local_JSON = OpenAPI_sms_management_subscription_data_convertToJSON(shared_data->shared_sms_mng_subs_data); if (shared_sms_mng_subs_data_local_JSON == NULL) { ogs_error("OpenAPI_shared_data_convertToJSON() failed [shared_sms_mng_subs_data]"); goto end; @@ -126,21 +156,20 @@ cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data) goto end; } cJSON *localMapObject = shared_dnn_configurations; - OpenAPI_lnode_t *shared_dnn_configurations_node; if (shared_data->shared_dnn_configurations) { - OpenAPI_list_for_each(shared_data->shared_dnn_configurations, shared_dnn_configurations_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_dnn_configurations_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_dnn_configuration_1_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_shared_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(shared_data->shared_dnn_configurations, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_dnn_configuration_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (shared_data->shared_trace_data) { cJSON *shared_trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(shared_data->shared_trace_data); @@ -162,21 +191,20 @@ cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data) goto end; } cJSON *localMapObject = shared_snssai_infos; - OpenAPI_lnode_t *shared_snssai_infos_node; if (shared_data->shared_snssai_infos) { - OpenAPI_list_for_each(shared_data->shared_snssai_infos, shared_snssai_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_snssai_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_snssai_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_shared_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(shared_data->shared_snssai_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_snssai_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (shared_data->shared_vn_group_datas) { cJSON *shared_vn_group_datas = cJSON_AddObjectToObject(item, "sharedVnGroupDatas"); @@ -185,21 +213,20 @@ cJSON *OpenAPI_shared_data_convertToJSON(OpenAPI_shared_data_t *shared_data) goto end; } cJSON *localMapObject = shared_vn_group_datas; - OpenAPI_lnode_t *shared_vn_group_datas_node; if (shared_data->shared_vn_group_datas) { - OpenAPI_list_for_each(shared_data->shared_vn_group_datas, shared_vn_group_datas_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)shared_vn_group_datas_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_vn_group_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_shared_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(shared_data->shared_vn_group_datas, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_vn_group_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_shared_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -208,121 +235,128 @@ end: OpenAPI_shared_data_t *OpenAPI_shared_data_parseFromJSON(cJSON *shared_dataJSON) { OpenAPI_shared_data_t *shared_data_local_var = NULL; - cJSON *shared_data_id = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedDataId"); + OpenAPI_lnode_t *node = NULL; + cJSON *shared_data_id = NULL; + cJSON *shared_am_data = NULL; + OpenAPI_access_and_mobility_subscription_data_t *shared_am_data_local_nonprim = NULL; + cJSON *shared_sms_subs_data = NULL; + OpenAPI_sms_subscription_data_t *shared_sms_subs_data_local_nonprim = NULL; + cJSON *shared_sms_mng_subs_data = NULL; + OpenAPI_sms_management_subscription_data_t *shared_sms_mng_subs_data_local_nonprim = NULL; + cJSON *shared_dnn_configurations = NULL; + OpenAPI_list_t *shared_dnn_configurationsList = NULL; + cJSON *shared_trace_data = NULL; + OpenAPI_trace_data_t *shared_trace_data_local_nonprim = NULL; + cJSON *shared_snssai_infos = NULL; + OpenAPI_list_t *shared_snssai_infosList = NULL; + cJSON *shared_vn_group_datas = NULL; + OpenAPI_list_t *shared_vn_group_datasList = NULL; + shared_data_id = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedDataId"); if (!shared_data_id) { ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_data_id]"); goto end; } - if (!cJSON_IsString(shared_data_id)) { ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_data_id]"); goto end; } - cJSON *shared_am_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedAmData"); - - OpenAPI_access_and_mobility_subscription_data_1_t *shared_am_data_local_nonprim = NULL; + shared_am_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedAmData"); if (shared_am_data) { - shared_am_data_local_nonprim = OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON(shared_am_data); + shared_am_data_local_nonprim = OpenAPI_access_and_mobility_subscription_data_parseFromJSON(shared_am_data); } - cJSON *shared_sms_subs_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSmsSubsData"); - - OpenAPI_sms_subscription_data_1_t *shared_sms_subs_data_local_nonprim = NULL; + shared_sms_subs_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSmsSubsData"); if (shared_sms_subs_data) { - shared_sms_subs_data_local_nonprim = OpenAPI_sms_subscription_data_1_parseFromJSON(shared_sms_subs_data); + shared_sms_subs_data_local_nonprim = OpenAPI_sms_subscription_data_parseFromJSON(shared_sms_subs_data); } - cJSON *shared_sms_mng_subs_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSmsMngSubsData"); - - OpenAPI_sms_management_subscription_data_1_t *shared_sms_mng_subs_data_local_nonprim = NULL; + shared_sms_mng_subs_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSmsMngSubsData"); if (shared_sms_mng_subs_data) { - shared_sms_mng_subs_data_local_nonprim = OpenAPI_sms_management_subscription_data_1_parseFromJSON(shared_sms_mng_subs_data); + shared_sms_mng_subs_data_local_nonprim = OpenAPI_sms_management_subscription_data_parseFromJSON(shared_sms_mng_subs_data); } - cJSON *shared_dnn_configurations = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedDnnConfigurations"); - - OpenAPI_list_t *shared_dnn_configurationsList; + shared_dnn_configurations = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedDnnConfigurations"); if (shared_dnn_configurations) { - cJSON *shared_dnn_configurations_local_map; - if (!cJSON_IsObject(shared_dnn_configurations)) { - ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_dnn_configurations]"); - goto end; - } - shared_dnn_configurationsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(shared_dnn_configurations_local_map, shared_dnn_configurations) { - cJSON *localMapObject = shared_dnn_configurations_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_dnn_configuration_1_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_shared_data_parseFromJSON() failed [inner]"); + cJSON *shared_dnn_configurations_local_map = NULL; + if (!cJSON_IsObject(shared_dnn_configurations) && !cJSON_IsNull(shared_dnn_configurations)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_dnn_configurations]"); goto end; } - OpenAPI_list_add(shared_dnn_configurationsList, localMapKeyPair); - } + if (cJSON_IsObject(shared_dnn_configurations)) { + shared_dnn_configurationsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_dnn_configurations_local_map, shared_dnn_configurations) { + cJSON *localMapObject = shared_dnn_configurations_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_dnn_configuration_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(shared_dnn_configurationsList, localMapKeyPair); + } + } } - cJSON *shared_trace_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedTraceData"); - - OpenAPI_trace_data_t *shared_trace_data_local_nonprim = NULL; + shared_trace_data = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedTraceData"); if (shared_trace_data) { shared_trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(shared_trace_data); } - cJSON *shared_snssai_infos = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSnssaiInfos"); - - OpenAPI_list_t *shared_snssai_infosList; + shared_snssai_infos = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedSnssaiInfos"); if (shared_snssai_infos) { - cJSON *shared_snssai_infos_local_map; - if (!cJSON_IsObject(shared_snssai_infos)) { - ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_snssai_infos]"); - goto end; - } - shared_snssai_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(shared_snssai_infos_local_map, shared_snssai_infos) { - cJSON *localMapObject = shared_snssai_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_snssai_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_shared_data_parseFromJSON() failed [inner]"); + cJSON *shared_snssai_infos_local_map = NULL; + if (!cJSON_IsObject(shared_snssai_infos) && !cJSON_IsNull(shared_snssai_infos)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_snssai_infos]"); goto end; } - OpenAPI_list_add(shared_snssai_infosList, localMapKeyPair); - } + if (cJSON_IsObject(shared_snssai_infos)) { + shared_snssai_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_snssai_infos_local_map, shared_snssai_infos) { + cJSON *localMapObject = shared_snssai_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_snssai_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(shared_snssai_infosList, localMapKeyPair); + } + } } - cJSON *shared_vn_group_datas = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedVnGroupDatas"); - - OpenAPI_list_t *shared_vn_group_datasList; + shared_vn_group_datas = cJSON_GetObjectItemCaseSensitive(shared_dataJSON, "sharedVnGroupDatas"); if (shared_vn_group_datas) { - cJSON *shared_vn_group_datas_local_map; - if (!cJSON_IsObject(shared_vn_group_datas)) { - ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_vn_group_datas]"); - goto end; - } - shared_vn_group_datasList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(shared_vn_group_datas_local_map, shared_vn_group_datas) { - cJSON *localMapObject = shared_vn_group_datas_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_vn_group_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_shared_data_parseFromJSON() failed [inner]"); + cJSON *shared_vn_group_datas_local_map = NULL; + if (!cJSON_IsObject(shared_vn_group_datas) && !cJSON_IsNull(shared_vn_group_datas)) { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [shared_vn_group_datas]"); goto end; } - OpenAPI_list_add(shared_vn_group_datasList, localMapKeyPair); - } + if (cJSON_IsObject(shared_vn_group_datas)) { + shared_vn_group_datasList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(shared_vn_group_datas_local_map, shared_vn_group_datas) { + cJSON *localMapObject = shared_vn_group_datas_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_vn_group_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_shared_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(shared_vn_group_datasList, localMapKeyPair); + } + } } shared_data_local_var = OpenAPI_shared_data_create ( @@ -338,6 +372,52 @@ OpenAPI_shared_data_t *OpenAPI_shared_data_parseFromJSON(cJSON *shared_dataJSON) return shared_data_local_var; end: + if (shared_am_data_local_nonprim) { + OpenAPI_access_and_mobility_subscription_data_free(shared_am_data_local_nonprim); + shared_am_data_local_nonprim = NULL; + } + if (shared_sms_subs_data_local_nonprim) { + OpenAPI_sms_subscription_data_free(shared_sms_subs_data_local_nonprim); + shared_sms_subs_data_local_nonprim = NULL; + } + if (shared_sms_mng_subs_data_local_nonprim) { + OpenAPI_sms_management_subscription_data_free(shared_sms_mng_subs_data_local_nonprim); + shared_sms_mng_subs_data_local_nonprim = NULL; + } + if (shared_dnn_configurationsList) { + OpenAPI_list_for_each(shared_dnn_configurationsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_dnn_configuration_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_dnn_configurationsList); + shared_dnn_configurationsList = NULL; + } + if (shared_trace_data_local_nonprim) { + OpenAPI_trace_data_free(shared_trace_data_local_nonprim); + shared_trace_data_local_nonprim = NULL; + } + if (shared_snssai_infosList) { + OpenAPI_list_for_each(shared_snssai_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_snssai_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_snssai_infosList); + shared_snssai_infosList = NULL; + } + if (shared_vn_group_datasList) { + OpenAPI_list_for_each(shared_vn_group_datasList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_vn_group_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(shared_vn_group_datasList); + shared_vn_group_datasList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/shared_data.h b/lib/sbi/openapi/model/shared_data.h index 005c0e3cb..cdad9751f 100644 --- a/lib/sbi/openapi/model/shared_data.h +++ b/lib/sbi/openapi/model/shared_data.h @@ -12,10 +12,10 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "access_and_mobility_subscription_data_1.h" -#include "dnn_configuration_1.h" -#include "sms_management_subscription_data_1.h" -#include "sms_subscription_data_1.h" +#include "access_and_mobility_subscription_data.h" +#include "dnn_configuration.h" +#include "sms_management_subscription_data.h" +#include "sms_subscription_data.h" #include "snssai_info.h" #include "trace_data.h" #include "vn_group_data.h" @@ -27,9 +27,9 @@ extern "C" { typedef struct OpenAPI_shared_data_s OpenAPI_shared_data_t; typedef struct OpenAPI_shared_data_s { char *shared_data_id; - struct OpenAPI_access_and_mobility_subscription_data_1_s *shared_am_data; - struct OpenAPI_sms_subscription_data_1_s *shared_sms_subs_data; - struct OpenAPI_sms_management_subscription_data_1_s *shared_sms_mng_subs_data; + struct OpenAPI_access_and_mobility_subscription_data_s *shared_am_data; + struct OpenAPI_sms_subscription_data_s *shared_sms_subs_data; + struct OpenAPI_sms_management_subscription_data_s *shared_sms_mng_subs_data; OpenAPI_list_t* shared_dnn_configurations; struct OpenAPI_trace_data_s *shared_trace_data; OpenAPI_list_t* shared_snssai_infos; @@ -38,9 +38,9 @@ typedef struct OpenAPI_shared_data_s { OpenAPI_shared_data_t *OpenAPI_shared_data_create( char *shared_data_id, - OpenAPI_access_and_mobility_subscription_data_1_t *shared_am_data, - OpenAPI_sms_subscription_data_1_t *shared_sms_subs_data, - OpenAPI_sms_management_subscription_data_1_t *shared_sms_mng_subs_data, + OpenAPI_access_and_mobility_subscription_data_t *shared_am_data, + OpenAPI_sms_subscription_data_t *shared_sms_subs_data, + OpenAPI_sms_management_subscription_data_t *shared_sms_mng_subs_data, OpenAPI_list_t* shared_dnn_configurations, OpenAPI_trace_data_t *shared_trace_data, OpenAPI_list_t* shared_snssai_infos, diff --git a/lib/sbi/openapi/model/slice_info_for_pdu_session.c b/lib/sbi/openapi/model/slice_info_for_pdu_session.c index 7612ed3e6..267ced171 100644 --- a/lib/sbi/openapi/model/slice_info_for_pdu_session.c +++ b/lib/sbi/openapi/model/slice_info_for_pdu_session.c @@ -22,18 +22,26 @@ OpenAPI_slice_info_for_pdu_session_t *OpenAPI_slice_info_for_pdu_session_create( void OpenAPI_slice_info_for_pdu_session_free(OpenAPI_slice_info_for_pdu_session_t *slice_info_for_pdu_session) { + OpenAPI_lnode_t *node = NULL; + if (NULL == slice_info_for_pdu_session) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(slice_info_for_pdu_session->s_nssai); - OpenAPI_snssai_free(slice_info_for_pdu_session->home_snssai); + if (slice_info_for_pdu_session->s_nssai) { + OpenAPI_snssai_free(slice_info_for_pdu_session->s_nssai); + slice_info_for_pdu_session->s_nssai = NULL; + } + if (slice_info_for_pdu_session->home_snssai) { + OpenAPI_snssai_free(slice_info_for_pdu_session->home_snssai); + slice_info_for_pdu_session->home_snssai = NULL; + } ogs_free(slice_info_for_pdu_session); } cJSON *OpenAPI_slice_info_for_pdu_session_convertToJSON(OpenAPI_slice_info_for_pdu_session_t *slice_info_for_pdu_session) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (slice_info_for_pdu_session == NULL) { ogs_error("OpenAPI_slice_info_for_pdu_session_convertToJSON() failed [SliceInfoForPDUSession]"); @@ -41,6 +49,10 @@ cJSON *OpenAPI_slice_info_for_pdu_session_convertToJSON(OpenAPI_slice_info_for_p } item = cJSON_CreateObject(); + if (!slice_info_for_pdu_session->s_nssai) { + ogs_error("OpenAPI_slice_info_for_pdu_session_convertToJSON() failed [s_nssai]"); + return NULL; + } cJSON *s_nssai_local_JSON = OpenAPI_snssai_convertToJSON(slice_info_for_pdu_session->s_nssai); if (s_nssai_local_JSON == NULL) { ogs_error("OpenAPI_slice_info_for_pdu_session_convertToJSON() failed [s_nssai]"); @@ -52,6 +64,10 @@ cJSON *OpenAPI_slice_info_for_pdu_session_convertToJSON(OpenAPI_slice_info_for_p goto end; } + if (slice_info_for_pdu_session->roaming_indication == OpenAPI_roaming_indication_NULL) { + ogs_error("OpenAPI_slice_info_for_pdu_session_convertToJSON() failed [roaming_indication]"); + return NULL; + } if (cJSON_AddStringToObject(item, "roamingIndication", OpenAPI_roaming_indication_ToString(slice_info_for_pdu_session->roaming_indication)) == NULL) { ogs_error("OpenAPI_slice_info_for_pdu_session_convertToJSON() failed [roaming_indication]"); goto end; @@ -77,31 +93,32 @@ end: OpenAPI_slice_info_for_pdu_session_t *OpenAPI_slice_info_for_pdu_session_parseFromJSON(cJSON *slice_info_for_pdu_sessionJSON) { OpenAPI_slice_info_for_pdu_session_t *slice_info_for_pdu_session_local_var = NULL; - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_pdu_sessionJSON, "sNssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *roaming_indication = NULL; + OpenAPI_roaming_indication_e roaming_indicationVariable = 0; + cJSON *home_snssai = NULL; + OpenAPI_snssai_t *home_snssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_pdu_sessionJSON, "sNssai"); if (!s_nssai) { ogs_error("OpenAPI_slice_info_for_pdu_session_parseFromJSON() failed [s_nssai]"); goto end; } - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); - cJSON *roaming_indication = cJSON_GetObjectItemCaseSensitive(slice_info_for_pdu_sessionJSON, "roamingIndication"); + roaming_indication = cJSON_GetObjectItemCaseSensitive(slice_info_for_pdu_sessionJSON, "roamingIndication"); if (!roaming_indication) { ogs_error("OpenAPI_slice_info_for_pdu_session_parseFromJSON() failed [roaming_indication]"); goto end; } - - OpenAPI_roaming_indication_e roaming_indicationVariable; if (!cJSON_IsString(roaming_indication)) { ogs_error("OpenAPI_slice_info_for_pdu_session_parseFromJSON() failed [roaming_indication]"); goto end; } roaming_indicationVariable = OpenAPI_roaming_indication_FromString(roaming_indication->valuestring); - cJSON *home_snssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_pdu_sessionJSON, "homeSnssai"); - - OpenAPI_snssai_t *home_snssai_local_nonprim = NULL; + home_snssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_pdu_sessionJSON, "homeSnssai"); if (home_snssai) { home_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(home_snssai); } @@ -114,6 +131,14 @@ OpenAPI_slice_info_for_pdu_session_t *OpenAPI_slice_info_for_pdu_session_parseFr return slice_info_for_pdu_session_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (home_snssai_local_nonprim) { + OpenAPI_snssai_free(home_snssai_local_nonprim); + home_snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/slice_info_for_registration.c b/lib/sbi/openapi/model/slice_info_for_registration.c index a12b58d5b..0df1971ac 100644 --- a/lib/sbi/openapi/model/slice_info_for_registration.c +++ b/lib/sbi/openapi/model/slice_info_for_registration.c @@ -36,34 +36,54 @@ OpenAPI_slice_info_for_registration_t *OpenAPI_slice_info_for_registration_creat void OpenAPI_slice_info_for_registration_free(OpenAPI_slice_info_for_registration_t *slice_info_for_registration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == slice_info_for_registration) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(slice_info_for_registration->subscribed_nssai, node) { - OpenAPI_subscribed_snssai_free(node->data); + if (slice_info_for_registration->subscribed_nssai) { + OpenAPI_list_for_each(slice_info_for_registration->subscribed_nssai, node) { + OpenAPI_subscribed_snssai_free(node->data); + } + OpenAPI_list_free(slice_info_for_registration->subscribed_nssai); + slice_info_for_registration->subscribed_nssai = NULL; } - OpenAPI_list_free(slice_info_for_registration->subscribed_nssai); - OpenAPI_allowed_nssai_free(slice_info_for_registration->allowed_nssai_current_access); - OpenAPI_allowed_nssai_free(slice_info_for_registration->allowed_nssai_other_access); - OpenAPI_list_for_each(slice_info_for_registration->s_nssai_for_mapping, node) { - OpenAPI_snssai_free(node->data); + if (slice_info_for_registration->allowed_nssai_current_access) { + OpenAPI_allowed_nssai_free(slice_info_for_registration->allowed_nssai_current_access); + slice_info_for_registration->allowed_nssai_current_access = NULL; } - OpenAPI_list_free(slice_info_for_registration->s_nssai_for_mapping); - OpenAPI_list_for_each(slice_info_for_registration->requested_nssai, node) { - OpenAPI_snssai_free(node->data); + if (slice_info_for_registration->allowed_nssai_other_access) { + OpenAPI_allowed_nssai_free(slice_info_for_registration->allowed_nssai_other_access); + slice_info_for_registration->allowed_nssai_other_access = NULL; } - OpenAPI_list_free(slice_info_for_registration->requested_nssai); - OpenAPI_list_for_each(slice_info_for_registration->mapping_of_nssai, node) { - OpenAPI_mapping_of_snssai_free(node->data); + if (slice_info_for_registration->s_nssai_for_mapping) { + OpenAPI_list_for_each(slice_info_for_registration->s_nssai_for_mapping, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(slice_info_for_registration->s_nssai_for_mapping); + slice_info_for_registration->s_nssai_for_mapping = NULL; + } + if (slice_info_for_registration->requested_nssai) { + OpenAPI_list_for_each(slice_info_for_registration->requested_nssai, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(slice_info_for_registration->requested_nssai); + slice_info_for_registration->requested_nssai = NULL; + } + if (slice_info_for_registration->mapping_of_nssai) { + OpenAPI_list_for_each(slice_info_for_registration->mapping_of_nssai, node) { + OpenAPI_mapping_of_snssai_free(node->data); + } + OpenAPI_list_free(slice_info_for_registration->mapping_of_nssai); + slice_info_for_registration->mapping_of_nssai = NULL; } - OpenAPI_list_free(slice_info_for_registration->mapping_of_nssai); ogs_free(slice_info_for_registration); } cJSON *OpenAPI_slice_info_for_registration_convertToJSON(OpenAPI_slice_info_for_registration_t *slice_info_for_registration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (slice_info_for_registration == NULL) { ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [SliceInfoForRegistration]"); @@ -77,17 +97,13 @@ cJSON *OpenAPI_slice_info_for_registration_convertToJSON(OpenAPI_slice_info_for_ ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [subscribed_nssai]"); goto end; } - - OpenAPI_lnode_t *subscribed_nssai_node; - if (slice_info_for_registration->subscribed_nssai) { - OpenAPI_list_for_each(slice_info_for_registration->subscribed_nssai, subscribed_nssai_node) { - cJSON *itemLocal = OpenAPI_subscribed_snssai_convertToJSON(subscribed_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [subscribed_nssai]"); - goto end; - } - cJSON_AddItemToArray(subscribed_nssaiList, itemLocal); + OpenAPI_list_for_each(slice_info_for_registration->subscribed_nssai, node) { + cJSON *itemLocal = OpenAPI_subscribed_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [subscribed_nssai]"); + goto end; } + cJSON_AddItemToArray(subscribed_nssaiList, itemLocal); } } @@ -123,17 +139,13 @@ cJSON *OpenAPI_slice_info_for_registration_convertToJSON(OpenAPI_slice_info_for_ ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [s_nssai_for_mapping]"); goto end; } - - OpenAPI_lnode_t *s_nssai_for_mapping_node; - if (slice_info_for_registration->s_nssai_for_mapping) { - OpenAPI_list_for_each(slice_info_for_registration->s_nssai_for_mapping, s_nssai_for_mapping_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(s_nssai_for_mapping_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [s_nssai_for_mapping]"); - goto end; - } - cJSON_AddItemToArray(s_nssai_for_mappingList, itemLocal); + OpenAPI_list_for_each(slice_info_for_registration->s_nssai_for_mapping, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [s_nssai_for_mapping]"); + goto end; } + cJSON_AddItemToArray(s_nssai_for_mappingList, itemLocal); } } @@ -143,17 +155,13 @@ cJSON *OpenAPI_slice_info_for_registration_convertToJSON(OpenAPI_slice_info_for_ ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [requested_nssai]"); goto end; } - - OpenAPI_lnode_t *requested_nssai_node; - if (slice_info_for_registration->requested_nssai) { - OpenAPI_list_for_each(slice_info_for_registration->requested_nssai, requested_nssai_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(requested_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [requested_nssai]"); - goto end; - } - cJSON_AddItemToArray(requested_nssaiList, itemLocal); + OpenAPI_list_for_each(slice_info_for_registration->requested_nssai, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [requested_nssai]"); + goto end; } + cJSON_AddItemToArray(requested_nssaiList, itemLocal); } } @@ -170,17 +178,13 @@ cJSON *OpenAPI_slice_info_for_registration_convertToJSON(OpenAPI_slice_info_for_ ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [mapping_of_nssai]"); goto end; } - - OpenAPI_lnode_t *mapping_of_nssai_node; - if (slice_info_for_registration->mapping_of_nssai) { - OpenAPI_list_for_each(slice_info_for_registration->mapping_of_nssai, mapping_of_nssai_node) { - cJSON *itemLocal = OpenAPI_mapping_of_snssai_convertToJSON(mapping_of_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [mapping_of_nssai]"); - goto end; - } - cJSON_AddItemToArray(mapping_of_nssaiList, itemLocal); + OpenAPI_list_for_each(slice_info_for_registration->mapping_of_nssai, node) { + cJSON *itemLocal = OpenAPI_mapping_of_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_slice_info_for_registration_convertToJSON() failed [mapping_of_nssai]"); + goto end; } + cJSON_AddItemToArray(mapping_of_nssaiList, itemLocal); } } @@ -198,109 +202,107 @@ end: OpenAPI_slice_info_for_registration_t *OpenAPI_slice_info_for_registration_parseFromJSON(cJSON *slice_info_for_registrationJSON) { OpenAPI_slice_info_for_registration_t *slice_info_for_registration_local_var = NULL; - cJSON *subscribed_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "subscribedNssai"); - - OpenAPI_list_t *subscribed_nssaiList; + OpenAPI_lnode_t *node = NULL; + cJSON *subscribed_nssai = NULL; + OpenAPI_list_t *subscribed_nssaiList = NULL; + cJSON *allowed_nssai_current_access = NULL; + OpenAPI_allowed_nssai_t *allowed_nssai_current_access_local_nonprim = NULL; + cJSON *allowed_nssai_other_access = NULL; + OpenAPI_allowed_nssai_t *allowed_nssai_other_access_local_nonprim = NULL; + cJSON *s_nssai_for_mapping = NULL; + OpenAPI_list_t *s_nssai_for_mappingList = NULL; + cJSON *requested_nssai = NULL; + OpenAPI_list_t *requested_nssaiList = NULL; + cJSON *default_configured_snssai_ind = NULL; + cJSON *mapping_of_nssai = NULL; + OpenAPI_list_t *mapping_of_nssaiList = NULL; + cJSON *request_mapping = NULL; + subscribed_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "subscribedNssai"); if (subscribed_nssai) { - cJSON *subscribed_nssai_local_nonprimitive; - if (!cJSON_IsArray(subscribed_nssai)){ - ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [subscribed_nssai]"); - goto end; - } - - subscribed_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(subscribed_nssai_local_nonprimitive, subscribed_nssai ) { - if (!cJSON_IsObject(subscribed_nssai_local_nonprimitive)) { + cJSON *subscribed_nssai_local = NULL; + if (!cJSON_IsArray(subscribed_nssai)) { ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [subscribed_nssai]"); goto end; } - OpenAPI_subscribed_snssai_t *subscribed_nssaiItem = OpenAPI_subscribed_snssai_parseFromJSON(subscribed_nssai_local_nonprimitive); - if (!subscribed_nssaiItem) { - ogs_error("No subscribed_nssaiItem"); - OpenAPI_list_free(subscribed_nssaiList); - goto end; + subscribed_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscribed_nssai_local, subscribed_nssai) { + if (!cJSON_IsObject(subscribed_nssai_local)) { + ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [subscribed_nssai]"); + goto end; + } + OpenAPI_subscribed_snssai_t *subscribed_nssaiItem = OpenAPI_subscribed_snssai_parseFromJSON(subscribed_nssai_local); + if (!subscribed_nssaiItem) { + ogs_error("No subscribed_nssaiItem"); + OpenAPI_list_free(subscribed_nssaiList); + goto end; + } + OpenAPI_list_add(subscribed_nssaiList, subscribed_nssaiItem); } - - OpenAPI_list_add(subscribed_nssaiList, subscribed_nssaiItem); - } } - cJSON *allowed_nssai_current_access = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "allowedNssaiCurrentAccess"); - - OpenAPI_allowed_nssai_t *allowed_nssai_current_access_local_nonprim = NULL; + allowed_nssai_current_access = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "allowedNssaiCurrentAccess"); if (allowed_nssai_current_access) { allowed_nssai_current_access_local_nonprim = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_current_access); } - cJSON *allowed_nssai_other_access = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "allowedNssaiOtherAccess"); - - OpenAPI_allowed_nssai_t *allowed_nssai_other_access_local_nonprim = NULL; + allowed_nssai_other_access = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "allowedNssaiOtherAccess"); if (allowed_nssai_other_access) { allowed_nssai_other_access_local_nonprim = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_other_access); } - cJSON *s_nssai_for_mapping = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "sNssaiForMapping"); - - OpenAPI_list_t *s_nssai_for_mappingList; + s_nssai_for_mapping = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "sNssaiForMapping"); if (s_nssai_for_mapping) { - cJSON *s_nssai_for_mapping_local_nonprimitive; - if (!cJSON_IsArray(s_nssai_for_mapping)){ - ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [s_nssai_for_mapping]"); - goto end; - } - - s_nssai_for_mappingList = OpenAPI_list_create(); - - cJSON_ArrayForEach(s_nssai_for_mapping_local_nonprimitive, s_nssai_for_mapping ) { - if (!cJSON_IsObject(s_nssai_for_mapping_local_nonprimitive)) { + cJSON *s_nssai_for_mapping_local = NULL; + if (!cJSON_IsArray(s_nssai_for_mapping)) { ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [s_nssai_for_mapping]"); goto end; } - OpenAPI_snssai_t *s_nssai_for_mappingItem = OpenAPI_snssai_parseFromJSON(s_nssai_for_mapping_local_nonprimitive); - if (!s_nssai_for_mappingItem) { - ogs_error("No s_nssai_for_mappingItem"); - OpenAPI_list_free(s_nssai_for_mappingList); - goto end; + s_nssai_for_mappingList = OpenAPI_list_create(); + + cJSON_ArrayForEach(s_nssai_for_mapping_local, s_nssai_for_mapping) { + if (!cJSON_IsObject(s_nssai_for_mapping_local)) { + ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [s_nssai_for_mapping]"); + goto end; + } + OpenAPI_snssai_t *s_nssai_for_mappingItem = OpenAPI_snssai_parseFromJSON(s_nssai_for_mapping_local); + if (!s_nssai_for_mappingItem) { + ogs_error("No s_nssai_for_mappingItem"); + OpenAPI_list_free(s_nssai_for_mappingList); + goto end; + } + OpenAPI_list_add(s_nssai_for_mappingList, s_nssai_for_mappingItem); } - - OpenAPI_list_add(s_nssai_for_mappingList, s_nssai_for_mappingItem); - } } - cJSON *requested_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "requestedNssai"); - - OpenAPI_list_t *requested_nssaiList; + requested_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "requestedNssai"); if (requested_nssai) { - cJSON *requested_nssai_local_nonprimitive; - if (!cJSON_IsArray(requested_nssai)){ - ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [requested_nssai]"); - goto end; - } - - requested_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(requested_nssai_local_nonprimitive, requested_nssai ) { - if (!cJSON_IsObject(requested_nssai_local_nonprimitive)) { + cJSON *requested_nssai_local = NULL; + if (!cJSON_IsArray(requested_nssai)) { ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [requested_nssai]"); goto end; } - OpenAPI_snssai_t *requested_nssaiItem = OpenAPI_snssai_parseFromJSON(requested_nssai_local_nonprimitive); - if (!requested_nssaiItem) { - ogs_error("No requested_nssaiItem"); - OpenAPI_list_free(requested_nssaiList); - goto end; + requested_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(requested_nssai_local, requested_nssai) { + if (!cJSON_IsObject(requested_nssai_local)) { + ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [requested_nssai]"); + goto end; + } + OpenAPI_snssai_t *requested_nssaiItem = OpenAPI_snssai_parseFromJSON(requested_nssai_local); + if (!requested_nssaiItem) { + ogs_error("No requested_nssaiItem"); + OpenAPI_list_free(requested_nssaiList); + goto end; + } + OpenAPI_list_add(requested_nssaiList, requested_nssaiItem); } - - OpenAPI_list_add(requested_nssaiList, requested_nssaiItem); - } } - cJSON *default_configured_snssai_ind = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "defaultConfiguredSnssaiInd"); - + default_configured_snssai_ind = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "defaultConfiguredSnssaiInd"); if (default_configured_snssai_ind) { if (!cJSON_IsBool(default_configured_snssai_ind)) { ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [default_configured_snssai_ind]"); @@ -308,37 +310,32 @@ OpenAPI_slice_info_for_registration_t *OpenAPI_slice_info_for_registration_parse } } - cJSON *mapping_of_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "mappingOfNssai"); - - OpenAPI_list_t *mapping_of_nssaiList; + mapping_of_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "mappingOfNssai"); if (mapping_of_nssai) { - cJSON *mapping_of_nssai_local_nonprimitive; - if (!cJSON_IsArray(mapping_of_nssai)){ - ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [mapping_of_nssai]"); - goto end; - } - - mapping_of_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mapping_of_nssai_local_nonprimitive, mapping_of_nssai ) { - if (!cJSON_IsObject(mapping_of_nssai_local_nonprimitive)) { + cJSON *mapping_of_nssai_local = NULL; + if (!cJSON_IsArray(mapping_of_nssai)) { ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [mapping_of_nssai]"); goto end; } - OpenAPI_mapping_of_snssai_t *mapping_of_nssaiItem = OpenAPI_mapping_of_snssai_parseFromJSON(mapping_of_nssai_local_nonprimitive); - if (!mapping_of_nssaiItem) { - ogs_error("No mapping_of_nssaiItem"); - OpenAPI_list_free(mapping_of_nssaiList); - goto end; + mapping_of_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mapping_of_nssai_local, mapping_of_nssai) { + if (!cJSON_IsObject(mapping_of_nssai_local)) { + ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [mapping_of_nssai]"); + goto end; + } + OpenAPI_mapping_of_snssai_t *mapping_of_nssaiItem = OpenAPI_mapping_of_snssai_parseFromJSON(mapping_of_nssai_local); + if (!mapping_of_nssaiItem) { + ogs_error("No mapping_of_nssaiItem"); + OpenAPI_list_free(mapping_of_nssaiList); + goto end; + } + OpenAPI_list_add(mapping_of_nssaiList, mapping_of_nssaiItem); } - - OpenAPI_list_add(mapping_of_nssaiList, mapping_of_nssaiItem); - } } - cJSON *request_mapping = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "requestMapping"); - + request_mapping = cJSON_GetObjectItemCaseSensitive(slice_info_for_registrationJSON, "requestMapping"); if (request_mapping) { if (!cJSON_IsBool(request_mapping)) { ogs_error("OpenAPI_slice_info_for_registration_parseFromJSON() failed [request_mapping]"); @@ -361,6 +358,42 @@ OpenAPI_slice_info_for_registration_t *OpenAPI_slice_info_for_registration_parse return slice_info_for_registration_local_var; end: + if (subscribed_nssaiList) { + OpenAPI_list_for_each(subscribed_nssaiList, node) { + OpenAPI_subscribed_snssai_free(node->data); + } + OpenAPI_list_free(subscribed_nssaiList); + subscribed_nssaiList = NULL; + } + if (allowed_nssai_current_access_local_nonprim) { + OpenAPI_allowed_nssai_free(allowed_nssai_current_access_local_nonprim); + allowed_nssai_current_access_local_nonprim = NULL; + } + if (allowed_nssai_other_access_local_nonprim) { + OpenAPI_allowed_nssai_free(allowed_nssai_other_access_local_nonprim); + allowed_nssai_other_access_local_nonprim = NULL; + } + if (s_nssai_for_mappingList) { + OpenAPI_list_for_each(s_nssai_for_mappingList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(s_nssai_for_mappingList); + s_nssai_for_mappingList = NULL; + } + if (requested_nssaiList) { + OpenAPI_list_for_each(requested_nssaiList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(requested_nssaiList); + requested_nssaiList = NULL; + } + if (mapping_of_nssaiList) { + OpenAPI_list_for_each(mapping_of_nssaiList, node) { + OpenAPI_mapping_of_snssai_free(node->data); + } + OpenAPI_list_free(mapping_of_nssaiList); + mapping_of_nssaiList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/slice_info_for_ue_configuration_update.c b/lib/sbi/openapi/model/slice_info_for_ue_configuration_update.c index c3c46f3f3..98a29b6d5 100644 --- a/lib/sbi/openapi/model/slice_info_for_ue_configuration_update.c +++ b/lib/sbi/openapi/model/slice_info_for_ue_configuration_update.c @@ -30,30 +30,47 @@ OpenAPI_slice_info_for_ue_configuration_update_t *OpenAPI_slice_info_for_ue_conf void OpenAPI_slice_info_for_ue_configuration_update_free(OpenAPI_slice_info_for_ue_configuration_update_t *slice_info_for_ue_configuration_update) { + OpenAPI_lnode_t *node = NULL; + if (NULL == slice_info_for_ue_configuration_update) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(slice_info_for_ue_configuration_update->subscribed_nssai, node) { - OpenAPI_subscribed_snssai_free(node->data); + if (slice_info_for_ue_configuration_update->subscribed_nssai) { + OpenAPI_list_for_each(slice_info_for_ue_configuration_update->subscribed_nssai, node) { + OpenAPI_subscribed_snssai_free(node->data); + } + OpenAPI_list_free(slice_info_for_ue_configuration_update->subscribed_nssai); + slice_info_for_ue_configuration_update->subscribed_nssai = NULL; } - OpenAPI_list_free(slice_info_for_ue_configuration_update->subscribed_nssai); - OpenAPI_allowed_nssai_free(slice_info_for_ue_configuration_update->allowed_nssai_current_access); - OpenAPI_allowed_nssai_free(slice_info_for_ue_configuration_update->allowed_nssai_other_access); - OpenAPI_list_for_each(slice_info_for_ue_configuration_update->requested_nssai, node) { - OpenAPI_snssai_free(node->data); + if (slice_info_for_ue_configuration_update->allowed_nssai_current_access) { + OpenAPI_allowed_nssai_free(slice_info_for_ue_configuration_update->allowed_nssai_current_access); + slice_info_for_ue_configuration_update->allowed_nssai_current_access = NULL; } - OpenAPI_list_free(slice_info_for_ue_configuration_update->requested_nssai); - OpenAPI_list_for_each(slice_info_for_ue_configuration_update->mapping_of_nssai, node) { - OpenAPI_mapping_of_snssai_free(node->data); + if (slice_info_for_ue_configuration_update->allowed_nssai_other_access) { + OpenAPI_allowed_nssai_free(slice_info_for_ue_configuration_update->allowed_nssai_other_access); + slice_info_for_ue_configuration_update->allowed_nssai_other_access = NULL; + } + if (slice_info_for_ue_configuration_update->requested_nssai) { + OpenAPI_list_for_each(slice_info_for_ue_configuration_update->requested_nssai, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(slice_info_for_ue_configuration_update->requested_nssai); + slice_info_for_ue_configuration_update->requested_nssai = NULL; + } + if (slice_info_for_ue_configuration_update->mapping_of_nssai) { + OpenAPI_list_for_each(slice_info_for_ue_configuration_update->mapping_of_nssai, node) { + OpenAPI_mapping_of_snssai_free(node->data); + } + OpenAPI_list_free(slice_info_for_ue_configuration_update->mapping_of_nssai); + slice_info_for_ue_configuration_update->mapping_of_nssai = NULL; } - OpenAPI_list_free(slice_info_for_ue_configuration_update->mapping_of_nssai); ogs_free(slice_info_for_ue_configuration_update); } cJSON *OpenAPI_slice_info_for_ue_configuration_update_convertToJSON(OpenAPI_slice_info_for_ue_configuration_update_t *slice_info_for_ue_configuration_update) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (slice_info_for_ue_configuration_update == NULL) { ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [SliceInfoForUEConfigurationUpdate]"); @@ -67,17 +84,13 @@ cJSON *OpenAPI_slice_info_for_ue_configuration_update_convertToJSON(OpenAPI_slic ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [subscribed_nssai]"); goto end; } - - OpenAPI_lnode_t *subscribed_nssai_node; - if (slice_info_for_ue_configuration_update->subscribed_nssai) { - OpenAPI_list_for_each(slice_info_for_ue_configuration_update->subscribed_nssai, subscribed_nssai_node) { - cJSON *itemLocal = OpenAPI_subscribed_snssai_convertToJSON(subscribed_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [subscribed_nssai]"); - goto end; - } - cJSON_AddItemToArray(subscribed_nssaiList, itemLocal); + OpenAPI_list_for_each(slice_info_for_ue_configuration_update->subscribed_nssai, node) { + cJSON *itemLocal = OpenAPI_subscribed_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [subscribed_nssai]"); + goto end; } + cJSON_AddItemToArray(subscribed_nssaiList, itemLocal); } } @@ -120,17 +133,13 @@ cJSON *OpenAPI_slice_info_for_ue_configuration_update_convertToJSON(OpenAPI_slic ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [requested_nssai]"); goto end; } - - OpenAPI_lnode_t *requested_nssai_node; - if (slice_info_for_ue_configuration_update->requested_nssai) { - OpenAPI_list_for_each(slice_info_for_ue_configuration_update->requested_nssai, requested_nssai_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(requested_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [requested_nssai]"); - goto end; - } - cJSON_AddItemToArray(requested_nssaiList, itemLocal); + OpenAPI_list_for_each(slice_info_for_ue_configuration_update->requested_nssai, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [requested_nssai]"); + goto end; } + cJSON_AddItemToArray(requested_nssaiList, itemLocal); } } @@ -140,17 +149,13 @@ cJSON *OpenAPI_slice_info_for_ue_configuration_update_convertToJSON(OpenAPI_slic ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [mapping_of_nssai]"); goto end; } - - OpenAPI_lnode_t *mapping_of_nssai_node; - if (slice_info_for_ue_configuration_update->mapping_of_nssai) { - OpenAPI_list_for_each(slice_info_for_ue_configuration_update->mapping_of_nssai, mapping_of_nssai_node) { - cJSON *itemLocal = OpenAPI_mapping_of_snssai_convertToJSON(mapping_of_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [mapping_of_nssai]"); - goto end; - } - cJSON_AddItemToArray(mapping_of_nssaiList, itemLocal); + OpenAPI_list_for_each(slice_info_for_ue_configuration_update->mapping_of_nssai, node) { + cJSON *itemLocal = OpenAPI_mapping_of_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_slice_info_for_ue_configuration_update_convertToJSON() failed [mapping_of_nssai]"); + goto end; } + cJSON_AddItemToArray(mapping_of_nssaiList, itemLocal); } } @@ -161,51 +166,54 @@ end: OpenAPI_slice_info_for_ue_configuration_update_t *OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON(cJSON *slice_info_for_ue_configuration_updateJSON) { OpenAPI_slice_info_for_ue_configuration_update_t *slice_info_for_ue_configuration_update_local_var = NULL; - cJSON *subscribed_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "subscribedNssai"); - - OpenAPI_list_t *subscribed_nssaiList; + OpenAPI_lnode_t *node = NULL; + cJSON *subscribed_nssai = NULL; + OpenAPI_list_t *subscribed_nssaiList = NULL; + cJSON *allowed_nssai_current_access = NULL; + OpenAPI_allowed_nssai_t *allowed_nssai_current_access_local_nonprim = NULL; + cJSON *allowed_nssai_other_access = NULL; + OpenAPI_allowed_nssai_t *allowed_nssai_other_access_local_nonprim = NULL; + cJSON *default_configured_snssai_ind = NULL; + cJSON *requested_nssai = NULL; + OpenAPI_list_t *requested_nssaiList = NULL; + cJSON *mapping_of_nssai = NULL; + OpenAPI_list_t *mapping_of_nssaiList = NULL; + subscribed_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "subscribedNssai"); if (subscribed_nssai) { - cJSON *subscribed_nssai_local_nonprimitive; - if (!cJSON_IsArray(subscribed_nssai)){ - ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [subscribed_nssai]"); - goto end; - } - - subscribed_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(subscribed_nssai_local_nonprimitive, subscribed_nssai ) { - if (!cJSON_IsObject(subscribed_nssai_local_nonprimitive)) { + cJSON *subscribed_nssai_local = NULL; + if (!cJSON_IsArray(subscribed_nssai)) { ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [subscribed_nssai]"); goto end; } - OpenAPI_subscribed_snssai_t *subscribed_nssaiItem = OpenAPI_subscribed_snssai_parseFromJSON(subscribed_nssai_local_nonprimitive); - if (!subscribed_nssaiItem) { - ogs_error("No subscribed_nssaiItem"); - OpenAPI_list_free(subscribed_nssaiList); - goto end; + subscribed_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscribed_nssai_local, subscribed_nssai) { + if (!cJSON_IsObject(subscribed_nssai_local)) { + ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [subscribed_nssai]"); + goto end; + } + OpenAPI_subscribed_snssai_t *subscribed_nssaiItem = OpenAPI_subscribed_snssai_parseFromJSON(subscribed_nssai_local); + if (!subscribed_nssaiItem) { + ogs_error("No subscribed_nssaiItem"); + OpenAPI_list_free(subscribed_nssaiList); + goto end; + } + OpenAPI_list_add(subscribed_nssaiList, subscribed_nssaiItem); } - - OpenAPI_list_add(subscribed_nssaiList, subscribed_nssaiItem); - } } - cJSON *allowed_nssai_current_access = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "allowedNssaiCurrentAccess"); - - OpenAPI_allowed_nssai_t *allowed_nssai_current_access_local_nonprim = NULL; + allowed_nssai_current_access = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "allowedNssaiCurrentAccess"); if (allowed_nssai_current_access) { allowed_nssai_current_access_local_nonprim = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_current_access); } - cJSON *allowed_nssai_other_access = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "allowedNssaiOtherAccess"); - - OpenAPI_allowed_nssai_t *allowed_nssai_other_access_local_nonprim = NULL; + allowed_nssai_other_access = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "allowedNssaiOtherAccess"); if (allowed_nssai_other_access) { allowed_nssai_other_access_local_nonprim = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_other_access); } - cJSON *default_configured_snssai_ind = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "defaultConfiguredSnssaiInd"); - + default_configured_snssai_ind = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "defaultConfiguredSnssaiInd"); if (default_configured_snssai_ind) { if (!cJSON_IsBool(default_configured_snssai_ind)) { ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [default_configured_snssai_ind]"); @@ -213,62 +221,54 @@ OpenAPI_slice_info_for_ue_configuration_update_t *OpenAPI_slice_info_for_ue_conf } } - cJSON *requested_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "requestedNssai"); - - OpenAPI_list_t *requested_nssaiList; + requested_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "requestedNssai"); if (requested_nssai) { - cJSON *requested_nssai_local_nonprimitive; - if (!cJSON_IsArray(requested_nssai)){ - ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [requested_nssai]"); - goto end; - } - - requested_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(requested_nssai_local_nonprimitive, requested_nssai ) { - if (!cJSON_IsObject(requested_nssai_local_nonprimitive)) { + cJSON *requested_nssai_local = NULL; + if (!cJSON_IsArray(requested_nssai)) { ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [requested_nssai]"); goto end; } - OpenAPI_snssai_t *requested_nssaiItem = OpenAPI_snssai_parseFromJSON(requested_nssai_local_nonprimitive); - if (!requested_nssaiItem) { - ogs_error("No requested_nssaiItem"); - OpenAPI_list_free(requested_nssaiList); - goto end; + requested_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(requested_nssai_local, requested_nssai) { + if (!cJSON_IsObject(requested_nssai_local)) { + ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [requested_nssai]"); + goto end; + } + OpenAPI_snssai_t *requested_nssaiItem = OpenAPI_snssai_parseFromJSON(requested_nssai_local); + if (!requested_nssaiItem) { + ogs_error("No requested_nssaiItem"); + OpenAPI_list_free(requested_nssaiList); + goto end; + } + OpenAPI_list_add(requested_nssaiList, requested_nssaiItem); } - - OpenAPI_list_add(requested_nssaiList, requested_nssaiItem); - } } - cJSON *mapping_of_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "mappingOfNssai"); - - OpenAPI_list_t *mapping_of_nssaiList; + mapping_of_nssai = cJSON_GetObjectItemCaseSensitive(slice_info_for_ue_configuration_updateJSON, "mappingOfNssai"); if (mapping_of_nssai) { - cJSON *mapping_of_nssai_local_nonprimitive; - if (!cJSON_IsArray(mapping_of_nssai)){ - ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [mapping_of_nssai]"); - goto end; - } - - mapping_of_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mapping_of_nssai_local_nonprimitive, mapping_of_nssai ) { - if (!cJSON_IsObject(mapping_of_nssai_local_nonprimitive)) { + cJSON *mapping_of_nssai_local = NULL; + if (!cJSON_IsArray(mapping_of_nssai)) { ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [mapping_of_nssai]"); goto end; } - OpenAPI_mapping_of_snssai_t *mapping_of_nssaiItem = OpenAPI_mapping_of_snssai_parseFromJSON(mapping_of_nssai_local_nonprimitive); - if (!mapping_of_nssaiItem) { - ogs_error("No mapping_of_nssaiItem"); - OpenAPI_list_free(mapping_of_nssaiList); - goto end; + mapping_of_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mapping_of_nssai_local, mapping_of_nssai) { + if (!cJSON_IsObject(mapping_of_nssai_local)) { + ogs_error("OpenAPI_slice_info_for_ue_configuration_update_parseFromJSON() failed [mapping_of_nssai]"); + goto end; + } + OpenAPI_mapping_of_snssai_t *mapping_of_nssaiItem = OpenAPI_mapping_of_snssai_parseFromJSON(mapping_of_nssai_local); + if (!mapping_of_nssaiItem) { + ogs_error("No mapping_of_nssaiItem"); + OpenAPI_list_free(mapping_of_nssaiList); + goto end; + } + OpenAPI_list_add(mapping_of_nssaiList, mapping_of_nssaiItem); } - - OpenAPI_list_add(mapping_of_nssaiList, mapping_of_nssaiItem); - } } slice_info_for_ue_configuration_update_local_var = OpenAPI_slice_info_for_ue_configuration_update_create ( @@ -283,6 +283,35 @@ OpenAPI_slice_info_for_ue_configuration_update_t *OpenAPI_slice_info_for_ue_conf return slice_info_for_ue_configuration_update_local_var; end: + if (subscribed_nssaiList) { + OpenAPI_list_for_each(subscribed_nssaiList, node) { + OpenAPI_subscribed_snssai_free(node->data); + } + OpenAPI_list_free(subscribed_nssaiList); + subscribed_nssaiList = NULL; + } + if (allowed_nssai_current_access_local_nonprim) { + OpenAPI_allowed_nssai_free(allowed_nssai_current_access_local_nonprim); + allowed_nssai_current_access_local_nonprim = NULL; + } + if (allowed_nssai_other_access_local_nonprim) { + OpenAPI_allowed_nssai_free(allowed_nssai_other_access_local_nonprim); + allowed_nssai_other_access_local_nonprim = NULL; + } + if (requested_nssaiList) { + OpenAPI_list_for_each(requested_nssaiList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(requested_nssaiList); + requested_nssaiList = NULL; + } + if (mapping_of_nssaiList) { + OpenAPI_list_for_each(mapping_of_nssaiList, node) { + OpenAPI_mapping_of_snssai_free(node->data); + } + OpenAPI_list_free(mapping_of_nssaiList); + mapping_of_nssaiList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context.c b/lib/sbi/openapi/model/sm_context.c index 39f8cb035..5444b601b 100644 --- a/lib/sbi/openapi/model/sm_context.c +++ b/lib/sbi/openapi/model/sm_context.c @@ -120,65 +120,178 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_create( void OpenAPI_sm_context_free(OpenAPI_sm_context_t *sm_context) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context) { return; } - OpenAPI_lnode_t *node; - ogs_free(sm_context->dnn); - ogs_free(sm_context->selected_dnn); - OpenAPI_snssai_free(sm_context->s_nssai); - OpenAPI_snssai_free(sm_context->hplmn_snssai); - ogs_free(sm_context->gpsi); - ogs_free(sm_context->h_smf_uri); - ogs_free(sm_context->smf_uri); - ogs_free(sm_context->pdu_session_ref); - ogs_free(sm_context->pcf_id); - ogs_free(sm_context->pcf_group_id); - ogs_free(sm_context->pcf_set_id); - ogs_free(sm_context->udm_group_id); - ogs_free(sm_context->routing_indicator); - OpenAPI_ambr_free(sm_context->session_ambr); - OpenAPI_list_for_each(sm_context->qos_flows_list, node) { - OpenAPI_qos_flow_setup_item_free(node->data); + if (sm_context->dnn) { + ogs_free(sm_context->dnn); + sm_context->dnn = NULL; } - OpenAPI_list_free(sm_context->qos_flows_list); - ogs_free(sm_context->h_smf_instance_id); - ogs_free(sm_context->smf_instance_id); - ogs_free(sm_context->pdu_session_smf_set_id); - ogs_free(sm_context->pdu_session_smf_service_set_id); - ogs_free(sm_context->ue_ipv4_address); - ogs_free(sm_context->ue_ipv6_prefix); - OpenAPI_eps_pdn_cnx_info_free(sm_context->eps_pdn_cnx_info); - OpenAPI_list_for_each(sm_context->eps_bearer_info, node) { - OpenAPI_eps_bearer_info_free(node->data); + if (sm_context->selected_dnn) { + ogs_free(sm_context->selected_dnn); + sm_context->selected_dnn = NULL; } - OpenAPI_list_free(sm_context->eps_bearer_info); - OpenAPI_up_security_free(sm_context->up_security); - ogs_free(sm_context->h_smf_service_instance_id); - ogs_free(sm_context->smf_service_instance_id); - ogs_free(sm_context->recovery_time); - OpenAPI_tunnel_info_free(sm_context->psa_tunnel_info); - ogs_free(sm_context->charging_id); - OpenAPI_charging_information_free(sm_context->charging_info); - OpenAPI_roaming_charging_profile_free(sm_context->roaming_charging_profile); - OpenAPI_ip_address_free(sm_context->dn_aaa_address); - OpenAPI_redundant_pdu_session_information_free(sm_context->redundant_pdu_session_info); - OpenAPI_qos_flow_tunnel_free(sm_context->ran_tunnel_info); - OpenAPI_list_for_each(sm_context->add_ran_tunnel_info, node) { - OpenAPI_qos_flow_tunnel_free(node->data); + if (sm_context->s_nssai) { + OpenAPI_snssai_free(sm_context->s_nssai); + sm_context->s_nssai = NULL; } - OpenAPI_list_free(sm_context->add_ran_tunnel_info); - OpenAPI_qos_flow_tunnel_free(sm_context->red_ran_tunnel_info); - OpenAPI_list_for_each(sm_context->add_red_ran_tunnel_info, node) { - OpenAPI_qos_flow_tunnel_free(node->data); + if (sm_context->hplmn_snssai) { + OpenAPI_snssai_free(sm_context->hplmn_snssai); + sm_context->hplmn_snssai = NULL; + } + if (sm_context->gpsi) { + ogs_free(sm_context->gpsi); + sm_context->gpsi = NULL; + } + if (sm_context->h_smf_uri) { + ogs_free(sm_context->h_smf_uri); + sm_context->h_smf_uri = NULL; + } + if (sm_context->smf_uri) { + ogs_free(sm_context->smf_uri); + sm_context->smf_uri = NULL; + } + if (sm_context->pdu_session_ref) { + ogs_free(sm_context->pdu_session_ref); + sm_context->pdu_session_ref = NULL; + } + if (sm_context->pcf_id) { + ogs_free(sm_context->pcf_id); + sm_context->pcf_id = NULL; + } + if (sm_context->pcf_group_id) { + ogs_free(sm_context->pcf_group_id); + sm_context->pcf_group_id = NULL; + } + if (sm_context->pcf_set_id) { + ogs_free(sm_context->pcf_set_id); + sm_context->pcf_set_id = NULL; + } + if (sm_context->udm_group_id) { + ogs_free(sm_context->udm_group_id); + sm_context->udm_group_id = NULL; + } + if (sm_context->routing_indicator) { + ogs_free(sm_context->routing_indicator); + sm_context->routing_indicator = NULL; + } + if (sm_context->session_ambr) { + OpenAPI_ambr_free(sm_context->session_ambr); + sm_context->session_ambr = NULL; + } + if (sm_context->qos_flows_list) { + OpenAPI_list_for_each(sm_context->qos_flows_list, node) { + OpenAPI_qos_flow_setup_item_free(node->data); + } + OpenAPI_list_free(sm_context->qos_flows_list); + sm_context->qos_flows_list = NULL; + } + if (sm_context->h_smf_instance_id) { + ogs_free(sm_context->h_smf_instance_id); + sm_context->h_smf_instance_id = NULL; + } + if (sm_context->smf_instance_id) { + ogs_free(sm_context->smf_instance_id); + sm_context->smf_instance_id = NULL; + } + if (sm_context->pdu_session_smf_set_id) { + ogs_free(sm_context->pdu_session_smf_set_id); + sm_context->pdu_session_smf_set_id = NULL; + } + if (sm_context->pdu_session_smf_service_set_id) { + ogs_free(sm_context->pdu_session_smf_service_set_id); + sm_context->pdu_session_smf_service_set_id = NULL; + } + if (sm_context->ue_ipv4_address) { + ogs_free(sm_context->ue_ipv4_address); + sm_context->ue_ipv4_address = NULL; + } + if (sm_context->ue_ipv6_prefix) { + ogs_free(sm_context->ue_ipv6_prefix); + sm_context->ue_ipv6_prefix = NULL; + } + if (sm_context->eps_pdn_cnx_info) { + OpenAPI_eps_pdn_cnx_info_free(sm_context->eps_pdn_cnx_info); + sm_context->eps_pdn_cnx_info = NULL; + } + if (sm_context->eps_bearer_info) { + OpenAPI_list_for_each(sm_context->eps_bearer_info, node) { + OpenAPI_eps_bearer_info_free(node->data); + } + OpenAPI_list_free(sm_context->eps_bearer_info); + sm_context->eps_bearer_info = NULL; + } + if (sm_context->up_security) { + OpenAPI_up_security_free(sm_context->up_security); + sm_context->up_security = NULL; + } + if (sm_context->h_smf_service_instance_id) { + ogs_free(sm_context->h_smf_service_instance_id); + sm_context->h_smf_service_instance_id = NULL; + } + if (sm_context->smf_service_instance_id) { + ogs_free(sm_context->smf_service_instance_id); + sm_context->smf_service_instance_id = NULL; + } + if (sm_context->recovery_time) { + ogs_free(sm_context->recovery_time); + sm_context->recovery_time = NULL; + } + if (sm_context->psa_tunnel_info) { + OpenAPI_tunnel_info_free(sm_context->psa_tunnel_info); + sm_context->psa_tunnel_info = NULL; + } + if (sm_context->charging_id) { + ogs_free(sm_context->charging_id); + sm_context->charging_id = NULL; + } + if (sm_context->charging_info) { + OpenAPI_charging_information_free(sm_context->charging_info); + sm_context->charging_info = NULL; + } + if (sm_context->roaming_charging_profile) { + OpenAPI_roaming_charging_profile_free(sm_context->roaming_charging_profile); + sm_context->roaming_charging_profile = NULL; + } + if (sm_context->dn_aaa_address) { + OpenAPI_ip_address_free(sm_context->dn_aaa_address); + sm_context->dn_aaa_address = NULL; + } + if (sm_context->redundant_pdu_session_info) { + OpenAPI_redundant_pdu_session_information_free(sm_context->redundant_pdu_session_info); + sm_context->redundant_pdu_session_info = NULL; + } + if (sm_context->ran_tunnel_info) { + OpenAPI_qos_flow_tunnel_free(sm_context->ran_tunnel_info); + sm_context->ran_tunnel_info = NULL; + } + if (sm_context->add_ran_tunnel_info) { + OpenAPI_list_for_each(sm_context->add_ran_tunnel_info, node) { + OpenAPI_qos_flow_tunnel_free(node->data); + } + OpenAPI_list_free(sm_context->add_ran_tunnel_info); + sm_context->add_ran_tunnel_info = NULL; + } + if (sm_context->red_ran_tunnel_info) { + OpenAPI_qos_flow_tunnel_free(sm_context->red_ran_tunnel_info); + sm_context->red_ran_tunnel_info = NULL; + } + if (sm_context->add_red_ran_tunnel_info) { + OpenAPI_list_for_each(sm_context->add_red_ran_tunnel_info, node) { + OpenAPI_qos_flow_tunnel_free(node->data); + } + OpenAPI_list_free(sm_context->add_red_ran_tunnel_info); + sm_context->add_red_ran_tunnel_info = NULL; } - OpenAPI_list_free(sm_context->add_red_ran_tunnel_info); ogs_free(sm_context); } cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [SmContext]"); @@ -191,6 +304,10 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) goto end; } + if (!sm_context->dnn) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", sm_context->dnn) == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [dnn]"); goto end; @@ -203,6 +320,10 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) } } + if (!sm_context->s_nssai) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [s_nssai]"); + return NULL; + } cJSON *s_nssai_local_JSON = OpenAPI_snssai_convertToJSON(sm_context->s_nssai); if (s_nssai_local_JSON == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [s_nssai]"); @@ -227,6 +348,10 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) } } + if (sm_context->pdu_session_type == OpenAPI_pdu_session_type_NULL) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [pdu_session_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "pduSessionType", OpenAPI_pdu_session_type_ToString(sm_context->pdu_session_type)) == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [pdu_session_type]"); goto end; @@ -281,7 +406,7 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) } } - if (sm_context->sel_mode) { + if (sm_context->sel_mode != OpenAPI_dnn_selection_mode_NULL) { if (cJSON_AddStringToObject(item, "selMode", OpenAPI_dnn_selection_mode_ToString(sm_context->sel_mode)) == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [sel_mode]"); goto end; @@ -302,6 +427,10 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) } } + if (!sm_context->session_ambr) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [session_ambr]"); + return NULL; + } cJSON *session_ambr_local_JSON = OpenAPI_ambr_convertToJSON(sm_context->session_ambr); if (session_ambr_local_JSON == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [session_ambr]"); @@ -313,22 +442,22 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) goto end; } + if (!sm_context->qos_flows_list) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [qos_flows_list]"); + return NULL; + } cJSON *qos_flows_listList = cJSON_AddArrayToObject(item, "qosFlowsList"); if (qos_flows_listList == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [qos_flows_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_list_node; - if (sm_context->qos_flows_list) { - OpenAPI_list_for_each(sm_context->qos_flows_list, qos_flows_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_setup_item_convertToJSON(qos_flows_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_convertToJSON() failed [qos_flows_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_listList, itemLocal); + OpenAPI_list_for_each(sm_context->qos_flows_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_setup_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [qos_flows_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_listList, itemLocal); } if (sm_context->h_smf_instance_id) { @@ -359,7 +488,7 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) } } - if (sm_context->pdu_session_smf_binding) { + if (sm_context->pdu_session_smf_binding != OpenAPI_sbi_binding_level_NULL) { if (cJSON_AddStringToObject(item, "pduSessionSmfBinding", OpenAPI_sbi_binding_level_ToString(sm_context->pdu_session_smf_binding)) == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [pdu_session_smf_binding]"); goto end; @@ -406,21 +535,17 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) ogs_error("OpenAPI_sm_context_convertToJSON() failed [eps_bearer_info]"); goto end; } - - OpenAPI_lnode_t *eps_bearer_info_node; - if (sm_context->eps_bearer_info) { - OpenAPI_list_for_each(sm_context->eps_bearer_info, eps_bearer_info_node) { - cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(eps_bearer_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_convertToJSON() failed [eps_bearer_info]"); - goto end; - } - cJSON_AddItemToArray(eps_bearer_infoList, itemLocal); + OpenAPI_list_for_each(sm_context->eps_bearer_info, node) { + cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [eps_bearer_info]"); + goto end; } + cJSON_AddItemToArray(eps_bearer_infoList, itemLocal); } } - if (sm_context->max_integrity_protected_data_rate) { + if (sm_context->max_integrity_protected_data_rate != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRate", OpenAPI_max_integrity_protected_data_rate_ToString(sm_context->max_integrity_protected_data_rate)) == NULL) { ogs_error("OpenAPI_sm_context_convertToJSON() failed [max_integrity_protected_data_rate]"); goto end; @@ -580,17 +705,13 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) ogs_error("OpenAPI_sm_context_convertToJSON() failed [add_ran_tunnel_info]"); goto end; } - - OpenAPI_lnode_t *add_ran_tunnel_info_node; - if (sm_context->add_ran_tunnel_info) { - OpenAPI_list_for_each(sm_context->add_ran_tunnel_info, add_ran_tunnel_info_node) { - cJSON *itemLocal = OpenAPI_qos_flow_tunnel_convertToJSON(add_ran_tunnel_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_convertToJSON() failed [add_ran_tunnel_info]"); - goto end; - } - cJSON_AddItemToArray(add_ran_tunnel_infoList, itemLocal); + OpenAPI_list_for_each(sm_context->add_ran_tunnel_info, node) { + cJSON *itemLocal = OpenAPI_qos_flow_tunnel_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [add_ran_tunnel_info]"); + goto end; } + cJSON_AddItemToArray(add_ran_tunnel_infoList, itemLocal); } } @@ -613,17 +734,13 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context) ogs_error("OpenAPI_sm_context_convertToJSON() failed [add_red_ran_tunnel_info]"); goto end; } - - OpenAPI_lnode_t *add_red_ran_tunnel_info_node; - if (sm_context->add_red_ran_tunnel_info) { - OpenAPI_list_for_each(sm_context->add_red_ran_tunnel_info, add_red_ran_tunnel_info_node) { - cJSON *itemLocal = OpenAPI_qos_flow_tunnel_convertToJSON(add_red_ran_tunnel_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_convertToJSON() failed [add_red_ran_tunnel_info]"); - goto end; - } - cJSON_AddItemToArray(add_red_ran_tunnel_infoList, itemLocal); + OpenAPI_list_for_each(sm_context->add_red_ran_tunnel_info, node) { + cJSON *itemLocal = OpenAPI_qos_flow_tunnel_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_convertToJSON() failed [add_red_ran_tunnel_info]"); + goto end; } + cJSON_AddItemToArray(add_red_ran_tunnel_infoList, itemLocal); } } @@ -634,132 +751,182 @@ end: OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) { OpenAPI_sm_context_t *sm_context_local_var = NULL; - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_id = NULL; + cJSON *dnn = NULL; + cJSON *selected_dnn = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *hplmn_snssai = NULL; + OpenAPI_snssai_t *hplmn_snssai_local_nonprim = NULL; + cJSON *pdu_session_type = NULL; + OpenAPI_pdu_session_type_e pdu_session_typeVariable = 0; + cJSON *gpsi = NULL; + cJSON *h_smf_uri = NULL; + cJSON *smf_uri = NULL; + cJSON *pdu_session_ref = NULL; + cJSON *pcf_id = NULL; + cJSON *pcf_group_id = NULL; + cJSON *pcf_set_id = NULL; + cJSON *sel_mode = NULL; + OpenAPI_dnn_selection_mode_e sel_modeVariable = 0; + cJSON *udm_group_id = NULL; + cJSON *routing_indicator = NULL; + cJSON *session_ambr = NULL; + OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + cJSON *qos_flows_list = NULL; + OpenAPI_list_t *qos_flows_listList = NULL; + cJSON *h_smf_instance_id = NULL; + cJSON *smf_instance_id = NULL; + cJSON *pdu_session_smf_set_id = NULL; + cJSON *pdu_session_smf_service_set_id = NULL; + cJSON *pdu_session_smf_binding = NULL; + OpenAPI_sbi_binding_level_e pdu_session_smf_bindingVariable = 0; + cJSON *enable_pause_charging = NULL; + cJSON *ue_ipv4_address = NULL; + cJSON *ue_ipv6_prefix = NULL; + cJSON *eps_pdn_cnx_info = NULL; + OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_nonprim = NULL; + cJSON *eps_bearer_info = NULL; + OpenAPI_list_t *eps_bearer_infoList = NULL; + cJSON *max_integrity_protected_data_rate = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rateVariable = 0; + cJSON *always_on_granted = NULL; + cJSON *up_security = NULL; + OpenAPI_up_security_t *up_security_local_nonprim = NULL; + cJSON *h_smf_service_instance_id = NULL; + cJSON *smf_service_instance_id = NULL; + cJSON *recovery_time = NULL; + cJSON *forwarding_ind = NULL; + cJSON *psa_tunnel_info = NULL; + OpenAPI_tunnel_info_t *psa_tunnel_info_local_nonprim = NULL; + cJSON *charging_id = NULL; + cJSON *charging_info = NULL; + OpenAPI_charging_information_t *charging_info_local_nonprim = NULL; + cJSON *roaming_charging_profile = NULL; + OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + cJSON *nef_ext_buf_support_ind = NULL; + cJSON *ipv6_index = NULL; + cJSON *dn_aaa_address = NULL; + OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL; + cJSON *redundant_pdu_session_info = NULL; + OpenAPI_redundant_pdu_session_information_t *redundant_pdu_session_info_local_nonprim = NULL; + cJSON *ran_tunnel_info = NULL; + OpenAPI_qos_flow_tunnel_t *ran_tunnel_info_local_nonprim = NULL; + cJSON *add_ran_tunnel_info = NULL; + OpenAPI_list_t *add_ran_tunnel_infoList = NULL; + cJSON *red_ran_tunnel_info = NULL; + OpenAPI_qos_flow_tunnel_t *red_ran_tunnel_info_local_nonprim = NULL; + cJSON *add_red_ran_tunnel_info = NULL; + OpenAPI_list_t *add_red_ran_tunnel_infoList = NULL; + pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionId"); if (!pdu_session_id) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pdu_session_id]"); goto end; } - if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pdu_session_id]"); goto end; } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "dnn"); + dnn = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [dnn]"); goto end; } - cJSON *selected_dnn = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "selectedDnn"); - + selected_dnn = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "selectedDnn"); if (selected_dnn) { - if (!cJSON_IsString(selected_dnn)) { + if (!cJSON_IsString(selected_dnn) && !cJSON_IsNull(selected_dnn)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [selected_dnn]"); goto end; } } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "sNssai"); + s_nssai = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "sNssai"); if (!s_nssai) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [s_nssai]"); goto end; } - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); - cJSON *hplmn_snssai = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "hplmnSnssai"); - - OpenAPI_snssai_t *hplmn_snssai_local_nonprim = NULL; + hplmn_snssai = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "hplmnSnssai"); if (hplmn_snssai) { hplmn_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(hplmn_snssai); } - cJSON *pdu_session_type = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionType"); + pdu_session_type = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionType"); if (!pdu_session_type) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pdu_session_type]"); goto end; } - - OpenAPI_pdu_session_type_e pdu_session_typeVariable; if (!cJSON_IsString(pdu_session_type)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pdu_session_type]"); goto end; } pdu_session_typeVariable = OpenAPI_pdu_session_type_FromString(pdu_session_type->valuestring); - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *h_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "hSmfUri"); - + h_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "hSmfUri"); if (h_smf_uri) { - if (!cJSON_IsString(h_smf_uri)) { + if (!cJSON_IsString(h_smf_uri) && !cJSON_IsNull(h_smf_uri)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [h_smf_uri]"); goto end; } } - cJSON *smf_uri = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "smfUri"); - + smf_uri = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "smfUri"); if (smf_uri) { - if (!cJSON_IsString(smf_uri)) { + if (!cJSON_IsString(smf_uri) && !cJSON_IsNull(smf_uri)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [smf_uri]"); goto end; } } - cJSON *pdu_session_ref = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionRef"); - + pdu_session_ref = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionRef"); if (pdu_session_ref) { - if (!cJSON_IsString(pdu_session_ref)) { + if (!cJSON_IsString(pdu_session_ref) && !cJSON_IsNull(pdu_session_ref)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pdu_session_ref]"); goto end; } } - cJSON *pcf_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pcfId"); - + pcf_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pcfId"); if (pcf_id) { - if (!cJSON_IsString(pcf_id)) { + if (!cJSON_IsString(pcf_id) && !cJSON_IsNull(pcf_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pcf_id]"); goto end; } } - cJSON *pcf_group_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pcfGroupId"); - + pcf_group_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pcfGroupId"); if (pcf_group_id) { - if (!cJSON_IsString(pcf_group_id)) { + if (!cJSON_IsString(pcf_group_id) && !cJSON_IsNull(pcf_group_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pcf_group_id]"); goto end; } } - cJSON *pcf_set_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pcfSetId"); - + pcf_set_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pcfSetId"); if (pcf_set_id) { - if (!cJSON_IsString(pcf_set_id)) { + if (!cJSON_IsString(pcf_set_id) && !cJSON_IsNull(pcf_set_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pcf_set_id]"); goto end; } } - cJSON *sel_mode = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "selMode"); - - OpenAPI_dnn_selection_mode_e sel_modeVariable; + sel_mode = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "selMode"); if (sel_mode) { if (!cJSON_IsString(sel_mode)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [sel_mode]"); @@ -768,103 +935,89 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) sel_modeVariable = OpenAPI_dnn_selection_mode_FromString(sel_mode->valuestring); } - cJSON *udm_group_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "udmGroupId"); - + udm_group_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "udmGroupId"); if (udm_group_id) { - if (!cJSON_IsString(udm_group_id)) { + if (!cJSON_IsString(udm_group_id) && !cJSON_IsNull(udm_group_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [udm_group_id]"); goto end; } } - cJSON *routing_indicator = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "routingIndicator"); - + routing_indicator = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "routingIndicator"); if (routing_indicator) { - if (!cJSON_IsString(routing_indicator)) { + if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [routing_indicator]"); goto end; } } - cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "sessionAmbr"); + session_ambr = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "sessionAmbr"); if (!session_ambr) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [session_ambr]"); goto end; } - - OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr); - cJSON *qos_flows_list = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "qosFlowsList"); + qos_flows_list = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "qosFlowsList"); if (!qos_flows_list) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [qos_flows_list]"); goto end; } - - OpenAPI_list_t *qos_flows_listList; - cJSON *qos_flows_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_list)){ - ogs_error("OpenAPI_sm_context_parseFromJSON() failed [qos_flows_list]"); - goto end; - } - - qos_flows_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_list_local_nonprimitive, qos_flows_list ) { - if (!cJSON_IsObject(qos_flows_list_local_nonprimitive)) { + cJSON *qos_flows_list_local = NULL; + if (!cJSON_IsArray(qos_flows_list)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [qos_flows_list]"); goto end; } - OpenAPI_qos_flow_setup_item_t *qos_flows_listItem = OpenAPI_qos_flow_setup_item_parseFromJSON(qos_flows_list_local_nonprimitive); - if (!qos_flows_listItem) { - ogs_error("No qos_flows_listItem"); - OpenAPI_list_free(qos_flows_listList); - goto end; + qos_flows_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_list_local, qos_flows_list) { + if (!cJSON_IsObject(qos_flows_list_local)) { + ogs_error("OpenAPI_sm_context_parseFromJSON() failed [qos_flows_list]"); + goto end; + } + OpenAPI_qos_flow_setup_item_t *qos_flows_listItem = OpenAPI_qos_flow_setup_item_parseFromJSON(qos_flows_list_local); + if (!qos_flows_listItem) { + ogs_error("No qos_flows_listItem"); + OpenAPI_list_free(qos_flows_listList); + goto end; + } + OpenAPI_list_add(qos_flows_listList, qos_flows_listItem); } - OpenAPI_list_add(qos_flows_listList, qos_flows_listItem); - } - - cJSON *h_smf_instance_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "hSmfInstanceId"); - + h_smf_instance_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "hSmfInstanceId"); if (h_smf_instance_id) { - if (!cJSON_IsString(h_smf_instance_id)) { + if (!cJSON_IsString(h_smf_instance_id) && !cJSON_IsNull(h_smf_instance_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [h_smf_instance_id]"); goto end; } } - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "smfInstanceId"); - + smf_instance_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "smfInstanceId"); if (smf_instance_id) { - if (!cJSON_IsString(smf_instance_id)) { + if (!cJSON_IsString(smf_instance_id) && !cJSON_IsNull(smf_instance_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [smf_instance_id]"); goto end; } } - cJSON *pdu_session_smf_set_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionSmfSetId"); - + pdu_session_smf_set_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionSmfSetId"); if (pdu_session_smf_set_id) { - if (!cJSON_IsString(pdu_session_smf_set_id)) { + if (!cJSON_IsString(pdu_session_smf_set_id) && !cJSON_IsNull(pdu_session_smf_set_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pdu_session_smf_set_id]"); goto end; } } - cJSON *pdu_session_smf_service_set_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionSmfServiceSetId"); - + pdu_session_smf_service_set_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionSmfServiceSetId"); if (pdu_session_smf_service_set_id) { - if (!cJSON_IsString(pdu_session_smf_service_set_id)) { + if (!cJSON_IsString(pdu_session_smf_service_set_id) && !cJSON_IsNull(pdu_session_smf_service_set_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pdu_session_smf_service_set_id]"); goto end; } } - cJSON *pdu_session_smf_binding = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionSmfBinding"); - - OpenAPI_sbi_binding_level_e pdu_session_smf_bindingVariable; + pdu_session_smf_binding = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "pduSessionSmfBinding"); if (pdu_session_smf_binding) { if (!cJSON_IsString(pdu_session_smf_binding)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [pdu_session_smf_binding]"); @@ -873,8 +1026,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) pdu_session_smf_bindingVariable = OpenAPI_sbi_binding_level_FromString(pdu_session_smf_binding->valuestring); } - cJSON *enable_pause_charging = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "enablePauseCharging"); - + enable_pause_charging = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "enablePauseCharging"); if (enable_pause_charging) { if (!cJSON_IsBool(enable_pause_charging)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [enable_pause_charging]"); @@ -882,63 +1034,53 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) } } - cJSON *ue_ipv4_address = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "ueIpv4Address"); - + ue_ipv4_address = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "ueIpv4Address"); if (ue_ipv4_address) { - if (!cJSON_IsString(ue_ipv4_address)) { + if (!cJSON_IsString(ue_ipv4_address) && !cJSON_IsNull(ue_ipv4_address)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [ue_ipv4_address]"); goto end; } } - cJSON *ue_ipv6_prefix = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "ueIpv6Prefix"); - + ue_ipv6_prefix = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "ueIpv6Prefix"); if (ue_ipv6_prefix) { - if (!cJSON_IsString(ue_ipv6_prefix)) { + if (!cJSON_IsString(ue_ipv6_prefix) && !cJSON_IsNull(ue_ipv6_prefix)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [ue_ipv6_prefix]"); goto end; } } - cJSON *eps_pdn_cnx_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "epsPdnCnxInfo"); - - OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_nonprim = NULL; + eps_pdn_cnx_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "epsPdnCnxInfo"); if (eps_pdn_cnx_info) { eps_pdn_cnx_info_local_nonprim = OpenAPI_eps_pdn_cnx_info_parseFromJSON(eps_pdn_cnx_info); } - cJSON *eps_bearer_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "epsBearerInfo"); - - OpenAPI_list_t *eps_bearer_infoList; + eps_bearer_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "epsBearerInfo"); if (eps_bearer_info) { - cJSON *eps_bearer_info_local_nonprimitive; - if (!cJSON_IsArray(eps_bearer_info)){ - ogs_error("OpenAPI_sm_context_parseFromJSON() failed [eps_bearer_info]"); - goto end; - } - - eps_bearer_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eps_bearer_info_local_nonprimitive, eps_bearer_info ) { - if (!cJSON_IsObject(eps_bearer_info_local_nonprimitive)) { + cJSON *eps_bearer_info_local = NULL; + if (!cJSON_IsArray(eps_bearer_info)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [eps_bearer_info]"); goto end; } - OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local_nonprimitive); - if (!eps_bearer_infoItem) { - ogs_error("No eps_bearer_infoItem"); - OpenAPI_list_free(eps_bearer_infoList); - goto end; + eps_bearer_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eps_bearer_info_local, eps_bearer_info) { + if (!cJSON_IsObject(eps_bearer_info_local)) { + ogs_error("OpenAPI_sm_context_parseFromJSON() failed [eps_bearer_info]"); + goto end; + } + OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local); + if (!eps_bearer_infoItem) { + ogs_error("No eps_bearer_infoItem"); + OpenAPI_list_free(eps_bearer_infoList); + goto end; + } + OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem); } - - OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem); - } } - cJSON *max_integrity_protected_data_rate = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "maxIntegrityProtectedDataRate"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rateVariable; + max_integrity_protected_data_rate = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "maxIntegrityProtectedDataRate"); if (max_integrity_protected_data_rate) { if (!cJSON_IsString(max_integrity_protected_data_rate)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [max_integrity_protected_data_rate]"); @@ -947,8 +1089,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) max_integrity_protected_data_rateVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate->valuestring); } - cJSON *always_on_granted = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "alwaysOnGranted"); - + always_on_granted = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "alwaysOnGranted"); if (always_on_granted) { if (!cJSON_IsBool(always_on_granted)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [always_on_granted]"); @@ -956,42 +1097,36 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) } } - cJSON *up_security = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "upSecurity"); - - OpenAPI_up_security_t *up_security_local_nonprim = NULL; + up_security = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "upSecurity"); if (up_security) { up_security_local_nonprim = OpenAPI_up_security_parseFromJSON(up_security); } - cJSON *h_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "hSmfServiceInstanceId"); - + h_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "hSmfServiceInstanceId"); if (h_smf_service_instance_id) { - if (!cJSON_IsString(h_smf_service_instance_id)) { + if (!cJSON_IsString(h_smf_service_instance_id) && !cJSON_IsNull(h_smf_service_instance_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [h_smf_service_instance_id]"); goto end; } } - cJSON *smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "smfServiceInstanceId"); - + smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "smfServiceInstanceId"); if (smf_service_instance_id) { - if (!cJSON_IsString(smf_service_instance_id)) { + if (!cJSON_IsString(smf_service_instance_id) && !cJSON_IsNull(smf_service_instance_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [smf_service_instance_id]"); goto end; } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *forwarding_ind = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "forwardingInd"); - + forwarding_ind = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "forwardingInd"); if (forwarding_ind) { if (!cJSON_IsBool(forwarding_ind)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [forwarding_ind]"); @@ -999,38 +1134,30 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) } } - cJSON *psa_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "psaTunnelInfo"); - - OpenAPI_tunnel_info_t *psa_tunnel_info_local_nonprim = NULL; + psa_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "psaTunnelInfo"); if (psa_tunnel_info) { psa_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(psa_tunnel_info); } - cJSON *charging_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "chargingId"); - + charging_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "chargingId"); if (charging_id) { - if (!cJSON_IsString(charging_id)) { + if (!cJSON_IsString(charging_id) && !cJSON_IsNull(charging_id)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [charging_id]"); goto end; } } - cJSON *charging_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "chargingInfo"); - - OpenAPI_charging_information_t *charging_info_local_nonprim = NULL; + charging_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "chargingInfo"); if (charging_info) { charging_info_local_nonprim = OpenAPI_charging_information_parseFromJSON(charging_info); } - cJSON *roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "roamingChargingProfile"); - - OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL; + roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "roamingChargingProfile"); if (roaming_charging_profile) { roaming_charging_profile_local_nonprim = OpenAPI_roaming_charging_profile_parseFromJSON(roaming_charging_profile); } - cJSON *nef_ext_buf_support_ind = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "nefExtBufSupportInd"); - + nef_ext_buf_support_ind = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "nefExtBufSupportInd"); if (nef_ext_buf_support_ind) { if (!cJSON_IsBool(nef_ext_buf_support_ind)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [nef_ext_buf_support_ind]"); @@ -1038,8 +1165,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) } } - cJSON *ipv6_index = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "ipv6Index"); - + ipv6_index = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "ipv6Index"); if (ipv6_index) { if (!cJSON_IsNumber(ipv6_index)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [ipv6_index]"); @@ -1047,134 +1173,118 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) } } - cJSON *dn_aaa_address = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "dnAaaAddress"); - - OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL; + dn_aaa_address = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "dnAaaAddress"); if (dn_aaa_address) { dn_aaa_address_local_nonprim = OpenAPI_ip_address_parseFromJSON(dn_aaa_address); } - cJSON *redundant_pdu_session_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "redundantPduSessionInfo"); - - OpenAPI_redundant_pdu_session_information_t *redundant_pdu_session_info_local_nonprim = NULL; + redundant_pdu_session_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "redundantPduSessionInfo"); if (redundant_pdu_session_info) { redundant_pdu_session_info_local_nonprim = OpenAPI_redundant_pdu_session_information_parseFromJSON(redundant_pdu_session_info); } - cJSON *ran_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "ranTunnelInfo"); - - OpenAPI_qos_flow_tunnel_t *ran_tunnel_info_local_nonprim = NULL; + ran_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "ranTunnelInfo"); if (ran_tunnel_info) { ran_tunnel_info_local_nonprim = OpenAPI_qos_flow_tunnel_parseFromJSON(ran_tunnel_info); } - cJSON *add_ran_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "addRanTunnelInfo"); - - OpenAPI_list_t *add_ran_tunnel_infoList; + add_ran_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "addRanTunnelInfo"); if (add_ran_tunnel_info) { - cJSON *add_ran_tunnel_info_local_nonprimitive; - if (!cJSON_IsArray(add_ran_tunnel_info)){ - ogs_error("OpenAPI_sm_context_parseFromJSON() failed [add_ran_tunnel_info]"); - goto end; - } - - add_ran_tunnel_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(add_ran_tunnel_info_local_nonprimitive, add_ran_tunnel_info ) { - if (!cJSON_IsObject(add_ran_tunnel_info_local_nonprimitive)) { + cJSON *add_ran_tunnel_info_local = NULL; + if (!cJSON_IsArray(add_ran_tunnel_info)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [add_ran_tunnel_info]"); goto end; } - OpenAPI_qos_flow_tunnel_t *add_ran_tunnel_infoItem = OpenAPI_qos_flow_tunnel_parseFromJSON(add_ran_tunnel_info_local_nonprimitive); - if (!add_ran_tunnel_infoItem) { - ogs_error("No add_ran_tunnel_infoItem"); - OpenAPI_list_free(add_ran_tunnel_infoList); - goto end; + add_ran_tunnel_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_ran_tunnel_info_local, add_ran_tunnel_info) { + if (!cJSON_IsObject(add_ran_tunnel_info_local)) { + ogs_error("OpenAPI_sm_context_parseFromJSON() failed [add_ran_tunnel_info]"); + goto end; + } + OpenAPI_qos_flow_tunnel_t *add_ran_tunnel_infoItem = OpenAPI_qos_flow_tunnel_parseFromJSON(add_ran_tunnel_info_local); + if (!add_ran_tunnel_infoItem) { + ogs_error("No add_ran_tunnel_infoItem"); + OpenAPI_list_free(add_ran_tunnel_infoList); + goto end; + } + OpenAPI_list_add(add_ran_tunnel_infoList, add_ran_tunnel_infoItem); } - - OpenAPI_list_add(add_ran_tunnel_infoList, add_ran_tunnel_infoItem); - } } - cJSON *red_ran_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "redRanTunnelInfo"); - - OpenAPI_qos_flow_tunnel_t *red_ran_tunnel_info_local_nonprim = NULL; + red_ran_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "redRanTunnelInfo"); if (red_ran_tunnel_info) { red_ran_tunnel_info_local_nonprim = OpenAPI_qos_flow_tunnel_parseFromJSON(red_ran_tunnel_info); } - cJSON *add_red_ran_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "addRedRanTunnelInfo"); - - OpenAPI_list_t *add_red_ran_tunnel_infoList; + add_red_ran_tunnel_info = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "addRedRanTunnelInfo"); if (add_red_ran_tunnel_info) { - cJSON *add_red_ran_tunnel_info_local_nonprimitive; - if (!cJSON_IsArray(add_red_ran_tunnel_info)){ - ogs_error("OpenAPI_sm_context_parseFromJSON() failed [add_red_ran_tunnel_info]"); - goto end; - } - - add_red_ran_tunnel_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(add_red_ran_tunnel_info_local_nonprimitive, add_red_ran_tunnel_info ) { - if (!cJSON_IsObject(add_red_ran_tunnel_info_local_nonprimitive)) { + cJSON *add_red_ran_tunnel_info_local = NULL; + if (!cJSON_IsArray(add_red_ran_tunnel_info)) { ogs_error("OpenAPI_sm_context_parseFromJSON() failed [add_red_ran_tunnel_info]"); goto end; } - OpenAPI_qos_flow_tunnel_t *add_red_ran_tunnel_infoItem = OpenAPI_qos_flow_tunnel_parseFromJSON(add_red_ran_tunnel_info_local_nonprimitive); - if (!add_red_ran_tunnel_infoItem) { - ogs_error("No add_red_ran_tunnel_infoItem"); - OpenAPI_list_free(add_red_ran_tunnel_infoList); - goto end; + add_red_ran_tunnel_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_red_ran_tunnel_info_local, add_red_ran_tunnel_info) { + if (!cJSON_IsObject(add_red_ran_tunnel_info_local)) { + ogs_error("OpenAPI_sm_context_parseFromJSON() failed [add_red_ran_tunnel_info]"); + goto end; + } + OpenAPI_qos_flow_tunnel_t *add_red_ran_tunnel_infoItem = OpenAPI_qos_flow_tunnel_parseFromJSON(add_red_ran_tunnel_info_local); + if (!add_red_ran_tunnel_infoItem) { + ogs_error("No add_red_ran_tunnel_infoItem"); + OpenAPI_list_free(add_red_ran_tunnel_infoList); + goto end; + } + OpenAPI_list_add(add_red_ran_tunnel_infoList, add_red_ran_tunnel_infoItem); } - - OpenAPI_list_add(add_red_ran_tunnel_infoList, add_red_ran_tunnel_infoItem); - } } sm_context_local_var = OpenAPI_sm_context_create ( pdu_session_id->valuedouble, ogs_strdup(dnn->valuestring), - selected_dnn ? ogs_strdup(selected_dnn->valuestring) : NULL, + selected_dnn && !cJSON_IsNull(selected_dnn) ? ogs_strdup(selected_dnn->valuestring) : NULL, s_nssai_local_nonprim, hplmn_snssai ? hplmn_snssai_local_nonprim : NULL, pdu_session_typeVariable, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - h_smf_uri ? ogs_strdup(h_smf_uri->valuestring) : NULL, - smf_uri ? ogs_strdup(smf_uri->valuestring) : NULL, - pdu_session_ref ? ogs_strdup(pdu_session_ref->valuestring) : NULL, - pcf_id ? ogs_strdup(pcf_id->valuestring) : NULL, - pcf_group_id ? ogs_strdup(pcf_group_id->valuestring) : NULL, - pcf_set_id ? ogs_strdup(pcf_set_id->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + h_smf_uri && !cJSON_IsNull(h_smf_uri) ? ogs_strdup(h_smf_uri->valuestring) : NULL, + smf_uri && !cJSON_IsNull(smf_uri) ? ogs_strdup(smf_uri->valuestring) : NULL, + pdu_session_ref && !cJSON_IsNull(pdu_session_ref) ? ogs_strdup(pdu_session_ref->valuestring) : NULL, + pcf_id && !cJSON_IsNull(pcf_id) ? ogs_strdup(pcf_id->valuestring) : NULL, + pcf_group_id && !cJSON_IsNull(pcf_group_id) ? ogs_strdup(pcf_group_id->valuestring) : NULL, + pcf_set_id && !cJSON_IsNull(pcf_set_id) ? ogs_strdup(pcf_set_id->valuestring) : NULL, sel_mode ? sel_modeVariable : 0, - udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL, - routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL, + udm_group_id && !cJSON_IsNull(udm_group_id) ? ogs_strdup(udm_group_id->valuestring) : NULL, + routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL, session_ambr_local_nonprim, qos_flows_listList, - h_smf_instance_id ? ogs_strdup(h_smf_instance_id->valuestring) : NULL, - smf_instance_id ? ogs_strdup(smf_instance_id->valuestring) : NULL, - pdu_session_smf_set_id ? ogs_strdup(pdu_session_smf_set_id->valuestring) : NULL, - pdu_session_smf_service_set_id ? ogs_strdup(pdu_session_smf_service_set_id->valuestring) : NULL, + h_smf_instance_id && !cJSON_IsNull(h_smf_instance_id) ? ogs_strdup(h_smf_instance_id->valuestring) : NULL, + smf_instance_id && !cJSON_IsNull(smf_instance_id) ? ogs_strdup(smf_instance_id->valuestring) : NULL, + pdu_session_smf_set_id && !cJSON_IsNull(pdu_session_smf_set_id) ? ogs_strdup(pdu_session_smf_set_id->valuestring) : NULL, + pdu_session_smf_service_set_id && !cJSON_IsNull(pdu_session_smf_service_set_id) ? ogs_strdup(pdu_session_smf_service_set_id->valuestring) : NULL, pdu_session_smf_binding ? pdu_session_smf_bindingVariable : 0, enable_pause_charging ? true : false, enable_pause_charging ? enable_pause_charging->valueint : 0, - ue_ipv4_address ? ogs_strdup(ue_ipv4_address->valuestring) : NULL, - ue_ipv6_prefix ? ogs_strdup(ue_ipv6_prefix->valuestring) : NULL, + ue_ipv4_address && !cJSON_IsNull(ue_ipv4_address) ? ogs_strdup(ue_ipv4_address->valuestring) : NULL, + ue_ipv6_prefix && !cJSON_IsNull(ue_ipv6_prefix) ? ogs_strdup(ue_ipv6_prefix->valuestring) : NULL, eps_pdn_cnx_info ? eps_pdn_cnx_info_local_nonprim : NULL, eps_bearer_info ? eps_bearer_infoList : NULL, max_integrity_protected_data_rate ? max_integrity_protected_data_rateVariable : 0, always_on_granted ? true : false, always_on_granted ? always_on_granted->valueint : 0, up_security ? up_security_local_nonprim : NULL, - h_smf_service_instance_id ? ogs_strdup(h_smf_service_instance_id->valuestring) : NULL, - smf_service_instance_id ? ogs_strdup(smf_service_instance_id->valuestring) : NULL, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, + h_smf_service_instance_id && !cJSON_IsNull(h_smf_service_instance_id) ? ogs_strdup(h_smf_service_instance_id->valuestring) : NULL, + smf_service_instance_id && !cJSON_IsNull(smf_service_instance_id) ? ogs_strdup(smf_service_instance_id->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, forwarding_ind ? true : false, forwarding_ind ? forwarding_ind->valueint : 0, psa_tunnel_info ? psa_tunnel_info_local_nonprim : NULL, - charging_id ? ogs_strdup(charging_id->valuestring) : NULL, + charging_id && !cJSON_IsNull(charging_id) ? ogs_strdup(charging_id->valuestring) : NULL, charging_info ? charging_info_local_nonprim : NULL, roaming_charging_profile ? roaming_charging_profile_local_nonprim : NULL, nef_ext_buf_support_ind ? true : false, @@ -1191,6 +1301,82 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON) return sm_context_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (hplmn_snssai_local_nonprim) { + OpenAPI_snssai_free(hplmn_snssai_local_nonprim); + hplmn_snssai_local_nonprim = NULL; + } + if (session_ambr_local_nonprim) { + OpenAPI_ambr_free(session_ambr_local_nonprim); + session_ambr_local_nonprim = NULL; + } + if (qos_flows_listList) { + OpenAPI_list_for_each(qos_flows_listList, node) { + OpenAPI_qos_flow_setup_item_free(node->data); + } + OpenAPI_list_free(qos_flows_listList); + qos_flows_listList = NULL; + } + if (eps_pdn_cnx_info_local_nonprim) { + OpenAPI_eps_pdn_cnx_info_free(eps_pdn_cnx_info_local_nonprim); + eps_pdn_cnx_info_local_nonprim = NULL; + } + if (eps_bearer_infoList) { + OpenAPI_list_for_each(eps_bearer_infoList, node) { + OpenAPI_eps_bearer_info_free(node->data); + } + OpenAPI_list_free(eps_bearer_infoList); + eps_bearer_infoList = NULL; + } + if (up_security_local_nonprim) { + OpenAPI_up_security_free(up_security_local_nonprim); + up_security_local_nonprim = NULL; + } + if (psa_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(psa_tunnel_info_local_nonprim); + psa_tunnel_info_local_nonprim = NULL; + } + if (charging_info_local_nonprim) { + OpenAPI_charging_information_free(charging_info_local_nonprim); + charging_info_local_nonprim = NULL; + } + if (roaming_charging_profile_local_nonprim) { + OpenAPI_roaming_charging_profile_free(roaming_charging_profile_local_nonprim); + roaming_charging_profile_local_nonprim = NULL; + } + if (dn_aaa_address_local_nonprim) { + OpenAPI_ip_address_free(dn_aaa_address_local_nonprim); + dn_aaa_address_local_nonprim = NULL; + } + if (redundant_pdu_session_info_local_nonprim) { + OpenAPI_redundant_pdu_session_information_free(redundant_pdu_session_info_local_nonprim); + redundant_pdu_session_info_local_nonprim = NULL; + } + if (ran_tunnel_info_local_nonprim) { + OpenAPI_qos_flow_tunnel_free(ran_tunnel_info_local_nonprim); + ran_tunnel_info_local_nonprim = NULL; + } + if (add_ran_tunnel_infoList) { + OpenAPI_list_for_each(add_ran_tunnel_infoList, node) { + OpenAPI_qos_flow_tunnel_free(node->data); + } + OpenAPI_list_free(add_ran_tunnel_infoList); + add_ran_tunnel_infoList = NULL; + } + if (red_ran_tunnel_info_local_nonprim) { + OpenAPI_qos_flow_tunnel_free(red_ran_tunnel_info_local_nonprim); + red_ran_tunnel_info_local_nonprim = NULL; + } + if (add_red_ran_tunnel_infoList) { + OpenAPI_list_for_each(add_red_ran_tunnel_infoList, node) { + OpenAPI_qos_flow_tunnel_free(node->data); + } + OpenAPI_list_free(add_red_ran_tunnel_infoList); + add_red_ran_tunnel_infoList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_create_data.c b/lib/sbi/openapi/model/sm_context_create_data.c index f8fcd8a8f..c5cc503e7 100644 --- a/lib/sbi/openapi/model/sm_context_create_data.c +++ b/lib/sbi/openapi/model/sm_context_create_data.c @@ -198,85 +198,240 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_create( void OpenAPI_sm_context_create_data_free(OpenAPI_sm_context_create_data_t *sm_context_create_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_create_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(sm_context_create_data->supi); - ogs_free(sm_context_create_data->pei); - ogs_free(sm_context_create_data->gpsi); - ogs_free(sm_context_create_data->dnn); - ogs_free(sm_context_create_data->selected_dnn); - OpenAPI_snssai_free(sm_context_create_data->s_nssai); - OpenAPI_snssai_free(sm_context_create_data->hplmn_snssai); - ogs_free(sm_context_create_data->serving_nf_id); - OpenAPI_guami_free(sm_context_create_data->guami); - ogs_free(sm_context_create_data->service_name); - OpenAPI_plmn_id_nid_free(sm_context_create_data->serving_network); - OpenAPI_ref_to_binary_data_free(sm_context_create_data->n1_sm_msg); - OpenAPI_user_location_free(sm_context_create_data->ue_location); - ogs_free(sm_context_create_data->ue_time_zone); - OpenAPI_user_location_free(sm_context_create_data->add_ue_location); - ogs_free(sm_context_create_data->sm_context_status_uri); - ogs_free(sm_context_create_data->h_smf_uri); - ogs_free(sm_context_create_data->h_smf_id); - ogs_free(sm_context_create_data->smf_uri); - ogs_free(sm_context_create_data->smf_id); - OpenAPI_list_for_each(sm_context_create_data->additional_hsmf_uri, node) { - ogs_free(node->data); + if (sm_context_create_data->supi) { + ogs_free(sm_context_create_data->supi); + sm_context_create_data->supi = NULL; } - OpenAPI_list_free(sm_context_create_data->additional_hsmf_uri); - OpenAPI_list_for_each(sm_context_create_data->additional_hsmf_id, node) { - ogs_free(node->data); + if (sm_context_create_data->pei) { + ogs_free(sm_context_create_data->pei); + sm_context_create_data->pei = NULL; } - OpenAPI_list_free(sm_context_create_data->additional_hsmf_id); - OpenAPI_list_for_each(sm_context_create_data->additional_smf_uri, node) { - ogs_free(node->data); + if (sm_context_create_data->gpsi) { + ogs_free(sm_context_create_data->gpsi); + sm_context_create_data->gpsi = NULL; } - OpenAPI_list_free(sm_context_create_data->additional_smf_uri); - OpenAPI_list_for_each(sm_context_create_data->additional_smf_id, node) { - ogs_free(node->data); + if (sm_context_create_data->dnn) { + ogs_free(sm_context_create_data->dnn); + sm_context_create_data->dnn = NULL; } - OpenAPI_list_free(sm_context_create_data->additional_smf_id); - OpenAPI_list_for_each(sm_context_create_data->pdu_sessions_activate_list, node) { - ogs_free(node->data); + if (sm_context_create_data->selected_dnn) { + ogs_free(sm_context_create_data->selected_dnn); + sm_context_create_data->selected_dnn = NULL; } - OpenAPI_list_free(sm_context_create_data->pdu_sessions_activate_list); - ogs_free(sm_context_create_data->ue_eps_pdn_connection); - ogs_free(sm_context_create_data->pcf_id); - ogs_free(sm_context_create_data->pcf_group_id); - ogs_free(sm_context_create_data->pcf_set_id); - ogs_free(sm_context_create_data->nrf_uri); - ogs_free(sm_context_create_data->supported_features); - OpenAPI_list_for_each(sm_context_create_data->backup_amf_info, node) { - OpenAPI_backup_amf_info_free(node->data); + if (sm_context_create_data->s_nssai) { + OpenAPI_snssai_free(sm_context_create_data->s_nssai); + sm_context_create_data->s_nssai = NULL; + } + if (sm_context_create_data->hplmn_snssai) { + OpenAPI_snssai_free(sm_context_create_data->hplmn_snssai); + sm_context_create_data->hplmn_snssai = NULL; + } + if (sm_context_create_data->serving_nf_id) { + ogs_free(sm_context_create_data->serving_nf_id); + sm_context_create_data->serving_nf_id = NULL; + } + if (sm_context_create_data->guami) { + OpenAPI_guami_free(sm_context_create_data->guami); + sm_context_create_data->guami = NULL; + } + if (sm_context_create_data->service_name) { + ogs_free(sm_context_create_data->service_name); + sm_context_create_data->service_name = NULL; + } + if (sm_context_create_data->serving_network) { + OpenAPI_plmn_id_nid_free(sm_context_create_data->serving_network); + sm_context_create_data->serving_network = NULL; + } + if (sm_context_create_data->n1_sm_msg) { + OpenAPI_ref_to_binary_data_free(sm_context_create_data->n1_sm_msg); + sm_context_create_data->n1_sm_msg = NULL; + } + if (sm_context_create_data->ue_location) { + OpenAPI_user_location_free(sm_context_create_data->ue_location); + sm_context_create_data->ue_location = NULL; + } + if (sm_context_create_data->ue_time_zone) { + ogs_free(sm_context_create_data->ue_time_zone); + sm_context_create_data->ue_time_zone = NULL; + } + if (sm_context_create_data->add_ue_location) { + OpenAPI_user_location_free(sm_context_create_data->add_ue_location); + sm_context_create_data->add_ue_location = NULL; + } + if (sm_context_create_data->sm_context_status_uri) { + ogs_free(sm_context_create_data->sm_context_status_uri); + sm_context_create_data->sm_context_status_uri = NULL; + } + if (sm_context_create_data->h_smf_uri) { + ogs_free(sm_context_create_data->h_smf_uri); + sm_context_create_data->h_smf_uri = NULL; + } + if (sm_context_create_data->h_smf_id) { + ogs_free(sm_context_create_data->h_smf_id); + sm_context_create_data->h_smf_id = NULL; + } + if (sm_context_create_data->smf_uri) { + ogs_free(sm_context_create_data->smf_uri); + sm_context_create_data->smf_uri = NULL; + } + if (sm_context_create_data->smf_id) { + ogs_free(sm_context_create_data->smf_id); + sm_context_create_data->smf_id = NULL; + } + if (sm_context_create_data->additional_hsmf_uri) { + OpenAPI_list_for_each(sm_context_create_data->additional_hsmf_uri, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_create_data->additional_hsmf_uri); + sm_context_create_data->additional_hsmf_uri = NULL; + } + if (sm_context_create_data->additional_hsmf_id) { + OpenAPI_list_for_each(sm_context_create_data->additional_hsmf_id, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_create_data->additional_hsmf_id); + sm_context_create_data->additional_hsmf_id = NULL; + } + if (sm_context_create_data->additional_smf_uri) { + OpenAPI_list_for_each(sm_context_create_data->additional_smf_uri, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_create_data->additional_smf_uri); + sm_context_create_data->additional_smf_uri = NULL; + } + if (sm_context_create_data->additional_smf_id) { + OpenAPI_list_for_each(sm_context_create_data->additional_smf_id, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_create_data->additional_smf_id); + sm_context_create_data->additional_smf_id = NULL; + } + if (sm_context_create_data->pdu_sessions_activate_list) { + OpenAPI_list_for_each(sm_context_create_data->pdu_sessions_activate_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_create_data->pdu_sessions_activate_list); + sm_context_create_data->pdu_sessions_activate_list = NULL; + } + if (sm_context_create_data->ue_eps_pdn_connection) { + ogs_free(sm_context_create_data->ue_eps_pdn_connection); + sm_context_create_data->ue_eps_pdn_connection = NULL; + } + if (sm_context_create_data->pcf_id) { + ogs_free(sm_context_create_data->pcf_id); + sm_context_create_data->pcf_id = NULL; + } + if (sm_context_create_data->pcf_group_id) { + ogs_free(sm_context_create_data->pcf_group_id); + sm_context_create_data->pcf_group_id = NULL; + } + if (sm_context_create_data->pcf_set_id) { + ogs_free(sm_context_create_data->pcf_set_id); + sm_context_create_data->pcf_set_id = NULL; + } + if (sm_context_create_data->nrf_uri) { + ogs_free(sm_context_create_data->nrf_uri); + sm_context_create_data->nrf_uri = NULL; + } + if (sm_context_create_data->supported_features) { + ogs_free(sm_context_create_data->supported_features); + sm_context_create_data->supported_features = NULL; + } + if (sm_context_create_data->backup_amf_info) { + OpenAPI_list_for_each(sm_context_create_data->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(sm_context_create_data->backup_amf_info); + sm_context_create_data->backup_amf_info = NULL; + } + if (sm_context_create_data->trace_data) { + OpenAPI_trace_data_free(sm_context_create_data->trace_data); + sm_context_create_data->trace_data = NULL; + } + if (sm_context_create_data->udm_group_id) { + ogs_free(sm_context_create_data->udm_group_id); + sm_context_create_data->udm_group_id = NULL; + } + if (sm_context_create_data->routing_indicator) { + ogs_free(sm_context_create_data->routing_indicator); + sm_context_create_data->routing_indicator = NULL; + } + if (sm_context_create_data->target_id) { + OpenAPI_ng_ran_target_id_free(sm_context_create_data->target_id); + sm_context_create_data->target_id = NULL; + } + if (sm_context_create_data->eps_bearer_ctx_status) { + ogs_free(sm_context_create_data->eps_bearer_ctx_status); + sm_context_create_data->eps_bearer_ctx_status = NULL; + } + if (sm_context_create_data->n2_sm_info) { + OpenAPI_ref_to_binary_data_free(sm_context_create_data->n2_sm_info); + sm_context_create_data->n2_sm_info = NULL; + } + if (sm_context_create_data->n2_sm_info_ext1) { + OpenAPI_ref_to_binary_data_free(sm_context_create_data->n2_sm_info_ext1); + sm_context_create_data->n2_sm_info_ext1 = NULL; + } + if (sm_context_create_data->sm_context_ref) { + ogs_free(sm_context_create_data->sm_context_ref); + sm_context_create_data->sm_context_ref = NULL; + } + if (sm_context_create_data->sm_context_smf_id) { + ogs_free(sm_context_create_data->sm_context_smf_id); + sm_context_create_data->sm_context_smf_id = NULL; + } + if (sm_context_create_data->sm_context_smf_set_id) { + ogs_free(sm_context_create_data->sm_context_smf_set_id); + sm_context_create_data->sm_context_smf_set_id = NULL; + } + if (sm_context_create_data->sm_context_smf_service_set_id) { + ogs_free(sm_context_create_data->sm_context_smf_service_set_id); + sm_context_create_data->sm_context_smf_service_set_id = NULL; + } + if (sm_context_create_data->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(sm_context_create_data->small_data_rate_status); + sm_context_create_data->small_data_rate_status = NULL; + } + if (sm_context_create_data->apn_rate_status) { + OpenAPI_apn_rate_status_free(sm_context_create_data->apn_rate_status); + sm_context_create_data->apn_rate_status = NULL; + } + if (sm_context_create_data->ddn_failure_subs) { + OpenAPI_ddn_failure_subs_free(sm_context_create_data->ddn_failure_subs); + sm_context_create_data->ddn_failure_subs = NULL; + } + if (sm_context_create_data->old_smf_id) { + ogs_free(sm_context_create_data->old_smf_id); + sm_context_create_data->old_smf_id = NULL; + } + if (sm_context_create_data->old_sm_context_ref) { + ogs_free(sm_context_create_data->old_sm_context_ref); + sm_context_create_data->old_sm_context_ref = NULL; + } + if (sm_context_create_data->w_agf_info) { + OpenAPI_w_agf_info_free(sm_context_create_data->w_agf_info); + sm_context_create_data->w_agf_info = NULL; + } + if (sm_context_create_data->tngf_info) { + OpenAPI_tngf_info_free(sm_context_create_data->tngf_info); + sm_context_create_data->tngf_info = NULL; + } + if (sm_context_create_data->twif_info) { + OpenAPI_twif_info_free(sm_context_create_data->twif_info); + sm_context_create_data->twif_info = NULL; } - OpenAPI_list_free(sm_context_create_data->backup_amf_info); - OpenAPI_trace_data_free(sm_context_create_data->trace_data); - ogs_free(sm_context_create_data->udm_group_id); - ogs_free(sm_context_create_data->routing_indicator); - OpenAPI_ng_ran_target_id_free(sm_context_create_data->target_id); - ogs_free(sm_context_create_data->eps_bearer_ctx_status); - OpenAPI_ref_to_binary_data_free(sm_context_create_data->n2_sm_info); - OpenAPI_ref_to_binary_data_free(sm_context_create_data->n2_sm_info_ext1); - ogs_free(sm_context_create_data->sm_context_ref); - ogs_free(sm_context_create_data->sm_context_smf_id); - ogs_free(sm_context_create_data->sm_context_smf_set_id); - ogs_free(sm_context_create_data->sm_context_smf_service_set_id); - OpenAPI_small_data_rate_status_free(sm_context_create_data->small_data_rate_status); - OpenAPI_apn_rate_status_free(sm_context_create_data->apn_rate_status); - OpenAPI_ddn_failure_subs_free(sm_context_create_data->ddn_failure_subs); - ogs_free(sm_context_create_data->old_smf_id); - ogs_free(sm_context_create_data->old_sm_context_ref); - OpenAPI_w_agf_info_free(sm_context_create_data->w_agf_info); - OpenAPI_tngf_info_free(sm_context_create_data->tngf_info); - OpenAPI_twif_info_free(sm_context_create_data->twif_info); ogs_free(sm_context_create_data); } cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_data_t *sm_context_create_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_create_data == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [SmContextCreateData]"); @@ -359,6 +514,10 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } + if (!sm_context_create_data->serving_nf_id) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [serving_nf_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "servingNfId", sm_context_create_data->serving_nf_id) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [serving_nf_id]"); goto end; @@ -384,6 +543,10 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } + if (!sm_context_create_data->serving_network) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [serving_network]"); + return NULL; + } cJSON *serving_network_local_JSON = OpenAPI_plmn_id_nid_convertToJSON(sm_context_create_data->serving_network); if (serving_network_local_JSON == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [serving_network]"); @@ -395,7 +558,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da goto end; } - if (sm_context_create_data->request_type) { + if (sm_context_create_data->request_type != OpenAPI_request_type_NULL) { if (cJSON_AddStringToObject(item, "requestType", OpenAPI_request_type_ToString(sm_context_create_data->request_type)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [request_type]"); goto end; @@ -415,26 +578,30 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } + if (sm_context_create_data->an_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [an_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "anType", OpenAPI_access_type_ToString(sm_context_create_data->an_type)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [an_type]"); goto end; } - if (sm_context_create_data->additional_an_type) { + if (sm_context_create_data->additional_an_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "additionalAnType", OpenAPI_access_type_ToString(sm_context_create_data->additional_an_type)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_an_type]"); goto end; } } - if (sm_context_create_data->rat_type) { + if (sm_context_create_data->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(sm_context_create_data->rat_type)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [rat_type]"); goto end; } } - if (sm_context_create_data->presence_in_ladn) { + if (sm_context_create_data->presence_in_ladn != OpenAPI_presence_state_NULL) { if (cJSON_AddStringToObject(item, "presenceInLadn", OpenAPI_presence_state_ToString(sm_context_create_data->presence_in_ladn)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [presence_in_ladn]"); goto end; @@ -474,6 +641,10 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } + if (!sm_context_create_data->sm_context_status_uri) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [sm_context_status_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smContextStatusUri", sm_context_create_data->sm_context_status_uri) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [sm_context_status_uri]"); goto end; @@ -508,67 +679,59 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } if (sm_context_create_data->additional_hsmf_uri) { - cJSON *additional_hsmf_uri = cJSON_AddArrayToObject(item, "additionalHsmfUri"); - if (additional_hsmf_uri == NULL) { + cJSON *additional_hsmf_uriList = cJSON_AddArrayToObject(item, "additionalHsmfUri"); + if (additional_hsmf_uriList == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_hsmf_uri]"); goto end; } - - OpenAPI_lnode_t *additional_hsmf_uri_node; - OpenAPI_list_for_each(sm_context_create_data->additional_hsmf_uri, additional_hsmf_uri_node) { - if (cJSON_AddStringToObject(additional_hsmf_uri, "", (char*)additional_hsmf_uri_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_hsmf_uri]"); - goto end; + OpenAPI_list_for_each(sm_context_create_data->additional_hsmf_uri, node) { + if (cJSON_AddStringToObject(additional_hsmf_uriList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_hsmf_uri]"); + goto end; + } } - } } if (sm_context_create_data->additional_hsmf_id) { - cJSON *additional_hsmf_id = cJSON_AddArrayToObject(item, "additionalHsmfId"); - if (additional_hsmf_id == NULL) { + cJSON *additional_hsmf_idList = cJSON_AddArrayToObject(item, "additionalHsmfId"); + if (additional_hsmf_idList == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_hsmf_id]"); goto end; } - - OpenAPI_lnode_t *additional_hsmf_id_node; - OpenAPI_list_for_each(sm_context_create_data->additional_hsmf_id, additional_hsmf_id_node) { - if (cJSON_AddStringToObject(additional_hsmf_id, "", (char*)additional_hsmf_id_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_hsmf_id]"); - goto end; + OpenAPI_list_for_each(sm_context_create_data->additional_hsmf_id, node) { + if (cJSON_AddStringToObject(additional_hsmf_idList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_hsmf_id]"); + goto end; + } } - } } if (sm_context_create_data->additional_smf_uri) { - cJSON *additional_smf_uri = cJSON_AddArrayToObject(item, "additionalSmfUri"); - if (additional_smf_uri == NULL) { + cJSON *additional_smf_uriList = cJSON_AddArrayToObject(item, "additionalSmfUri"); + if (additional_smf_uriList == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_smf_uri]"); goto end; } - - OpenAPI_lnode_t *additional_smf_uri_node; - OpenAPI_list_for_each(sm_context_create_data->additional_smf_uri, additional_smf_uri_node) { - if (cJSON_AddStringToObject(additional_smf_uri, "", (char*)additional_smf_uri_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_smf_uri]"); - goto end; + OpenAPI_list_for_each(sm_context_create_data->additional_smf_uri, node) { + if (cJSON_AddStringToObject(additional_smf_uriList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_smf_uri]"); + goto end; + } } - } } if (sm_context_create_data->additional_smf_id) { - cJSON *additional_smf_id = cJSON_AddArrayToObject(item, "additionalSmfId"); - if (additional_smf_id == NULL) { + cJSON *additional_smf_idList = cJSON_AddArrayToObject(item, "additionalSmfId"); + if (additional_smf_idList == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_smf_id]"); goto end; } - - OpenAPI_lnode_t *additional_smf_id_node; - OpenAPI_list_for_each(sm_context_create_data->additional_smf_id, additional_smf_id_node) { - if (cJSON_AddStringToObject(additional_smf_id, "", (char*)additional_smf_id_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_smf_id]"); - goto end; + OpenAPI_list_for_each(sm_context_create_data->additional_smf_id, node) { + if (cJSON_AddStringToObject(additional_smf_idList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [additional_smf_id]"); + goto end; + } } - } } if (sm_context_create_data->is_old_pdu_session_id) { @@ -579,19 +742,17 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } if (sm_context_create_data->pdu_sessions_activate_list) { - cJSON *pdu_sessions_activate_list = cJSON_AddArrayToObject(item, "pduSessionsActivateList"); - if (pdu_sessions_activate_list == NULL) { + cJSON *pdu_sessions_activate_listList = cJSON_AddArrayToObject(item, "pduSessionsActivateList"); + if (pdu_sessions_activate_listList == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [pdu_sessions_activate_list]"); goto end; } - - OpenAPI_lnode_t *pdu_sessions_activate_list_node; - OpenAPI_list_for_each(sm_context_create_data->pdu_sessions_activate_list, pdu_sessions_activate_list_node) { - if (cJSON_AddNumberToObject(pdu_sessions_activate_list, "", *(double *)pdu_sessions_activate_list_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [pdu_sessions_activate_list]"); - goto end; + OpenAPI_list_for_each(sm_context_create_data->pdu_sessions_activate_list, node) { + if (cJSON_AddNumberToObject(pdu_sessions_activate_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [pdu_sessions_activate_list]"); + goto end; + } } - } } if (sm_context_create_data->ue_eps_pdn_connection) { @@ -601,7 +762,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } - if (sm_context_create_data->ho_state) { + if (sm_context_create_data->ho_state != OpenAPI_ho_state_NULL) { if (cJSON_AddStringToObject(item, "hoState", OpenAPI_ho_state_ToString(sm_context_create_data->ho_state)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [ho_state]"); goto end; @@ -643,7 +804,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } - if (sm_context_create_data->sel_mode) { + if (sm_context_create_data->sel_mode != OpenAPI_dnn_selection_mode_NULL) { if (cJSON_AddStringToObject(item, "selMode", OpenAPI_dnn_selection_mode_ToString(sm_context_create_data->sel_mode)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [sel_mode]"); goto end; @@ -656,17 +817,13 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [backup_amf_info]"); goto end; } - - OpenAPI_lnode_t *backup_amf_info_node; - if (sm_context_create_data->backup_amf_info) { - OpenAPI_list_for_each(sm_context_create_data->backup_amf_info, backup_amf_info_node) { - cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [backup_amf_info]"); - goto end; - } - cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + OpenAPI_list_for_each(sm_context_create_data->backup_amf_info, node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [backup_amf_info]"); + goto end; } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); } } @@ -697,7 +854,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } - if (sm_context_create_data->eps_interworking_ind) { + if (sm_context_create_data->eps_interworking_ind != OpenAPI_eps_interworking_indication_NULL) { if (cJSON_AddStringToObject(item, "epsInterworkingInd", OpenAPI_eps_interworking_indication_ToString(sm_context_create_data->eps_interworking_ind)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [eps_interworking_ind]"); goto end; @@ -786,7 +943,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } - if (sm_context_create_data->n2_sm_info_type) { + if (sm_context_create_data->n2_sm_info_type != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoType", OpenAPI_n2_sm_info_type_ToString(sm_context_create_data->n2_sm_info_type)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [n2_sm_info_type]"); goto end; @@ -806,7 +963,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } - if (sm_context_create_data->n2_sm_info_type_ext1) { + if (sm_context_create_data->n2_sm_info_type_ext1 != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoTypeExt1", OpenAPI_n2_sm_info_type_ToString(sm_context_create_data->n2_sm_info_type_ext1)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [n2_sm_info_type_ext1]"); goto end; @@ -841,14 +998,14 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da } } - if (sm_context_create_data->sm_context_smf_binding) { + if (sm_context_create_data->sm_context_smf_binding != OpenAPI_sbi_binding_level_NULL) { if (cJSON_AddStringToObject(item, "smContextSmfBinding", OpenAPI_sbi_binding_level_ToString(sm_context_create_data->sm_context_smf_binding)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [sm_context_smf_binding]"); goto end; } } - if (sm_context_create_data->up_cnx_state) { + if (sm_context_create_data->up_cnx_state != OpenAPI_up_cnx_state_NULL) { if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_create_data->up_cnx_state)) == NULL) { ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [up_cnx_state]"); goto end; @@ -982,17 +1139,128 @@ end: OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(cJSON *sm_context_create_dataJSON) { OpenAPI_sm_context_create_data_t *sm_context_create_data_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *unauthenticated_supi = NULL; + cJSON *pei = NULL; + cJSON *gpsi = NULL; + cJSON *pdu_session_id = NULL; + cJSON *dnn = NULL; + cJSON *selected_dnn = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *hplmn_snssai = NULL; + OpenAPI_snssai_t *hplmn_snssai_local_nonprim = NULL; + cJSON *serving_nf_id = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *service_name = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + cJSON *request_type = NULL; + OpenAPI_request_type_e request_typeVariable = 0; + cJSON *n1_sm_msg = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + cJSON *an_type = NULL; + OpenAPI_access_type_e an_typeVariable = 0; + cJSON *additional_an_type = NULL; + OpenAPI_access_type_e additional_an_typeVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *presence_in_ladn = NULL; + OpenAPI_presence_state_e presence_in_ladnVariable = 0; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *add_ue_location = NULL; + OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + cJSON *sm_context_status_uri = NULL; + cJSON *h_smf_uri = NULL; + cJSON *h_smf_id = NULL; + cJSON *smf_uri = NULL; + cJSON *smf_id = NULL; + cJSON *additional_hsmf_uri = NULL; + OpenAPI_list_t *additional_hsmf_uriList = NULL; + cJSON *additional_hsmf_id = NULL; + OpenAPI_list_t *additional_hsmf_idList = NULL; + cJSON *additional_smf_uri = NULL; + OpenAPI_list_t *additional_smf_uriList = NULL; + cJSON *additional_smf_id = NULL; + OpenAPI_list_t *additional_smf_idList = NULL; + cJSON *old_pdu_session_id = NULL; + cJSON *pdu_sessions_activate_list = NULL; + OpenAPI_list_t *pdu_sessions_activate_listList = NULL; + cJSON *ue_eps_pdn_connection = NULL; + cJSON *ho_state = NULL; + OpenAPI_ho_state_e ho_stateVariable = 0; + cJSON *pcf_id = NULL; + cJSON *pcf_group_id = NULL; + cJSON *pcf_set_id = NULL; + cJSON *nrf_uri = NULL; + cJSON *supported_features = NULL; + cJSON *sel_mode = NULL; + OpenAPI_dnn_selection_mode_e sel_modeVariable = 0; + cJSON *backup_amf_info = NULL; + OpenAPI_list_t *backup_amf_infoList = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *udm_group_id = NULL; + cJSON *routing_indicator = NULL; + cJSON *eps_interworking_ind = NULL; + OpenAPI_eps_interworking_indication_e eps_interworking_indVariable = 0; + cJSON *indirect_forwarding_flag = NULL; + cJSON *direct_forwarding_flag = NULL; + cJSON *target_id = NULL; + OpenAPI_ng_ran_target_id_t *target_id_local_nonprim = NULL; + cJSON *eps_bearer_ctx_status = NULL; + cJSON *cp_ciot_enabled = NULL; + cJSON *cp_only_ind = NULL; + cJSON *invoke_nef = NULL; + cJSON *ma_request_ind = NULL; + cJSON *ma_nw_upgrade_ind = NULL; + cJSON *n2_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + cJSON *n2_sm_info_type = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable = 0; + cJSON *n2_sm_info_ext1 = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_ext1_local_nonprim = NULL; + cJSON *n2_sm_info_type_ext1 = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1Variable = 0; + cJSON *sm_context_ref = NULL; + cJSON *sm_context_smf_id = NULL; + cJSON *sm_context_smf_set_id = NULL; + cJSON *sm_context_smf_service_set_id = NULL; + cJSON *sm_context_smf_binding = NULL; + OpenAPI_sbi_binding_level_e sm_context_smf_bindingVariable = 0; + cJSON *up_cnx_state = NULL; + OpenAPI_up_cnx_state_e up_cnx_stateVariable = 0; + cJSON *small_data_rate_status = NULL; + OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + cJSON *apn_rate_status = NULL; + OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + cJSON *extended_nas_sm_timer_ind = NULL; + cJSON *dl_data_waiting_ind = NULL; + cJSON *ddn_failure_subs = NULL; + OpenAPI_ddn_failure_subs_t *ddn_failure_subs_local_nonprim = NULL; + cJSON *smf_transfer_ind = NULL; + cJSON *old_smf_id = NULL; + cJSON *old_sm_context_ref = NULL; + cJSON *w_agf_info = NULL; + OpenAPI_w_agf_info_t *w_agf_info_local_nonprim = NULL; + cJSON *tngf_info = NULL; + OpenAPI_tngf_info_t *tngf_info_local_nonprim = NULL; + cJSON *twif_info = NULL; + OpenAPI_twif_info_t *twif_info_local_nonprim = NULL; + cJSON *ran_unchanged_ind = NULL; + supi = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *unauthenticated_supi = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "unauthenticatedSupi"); - + unauthenticated_supi = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "unauthenticatedSupi"); if (unauthenticated_supi) { if (!cJSON_IsBool(unauthenticated_supi)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [unauthenticated_supi]"); @@ -1000,26 +1268,23 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pei]"); goto end; } } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pduSessionId"); - + pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pduSessionId"); if (pdu_session_id) { if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pdu_session_id]"); @@ -1027,77 +1292,63 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *selected_dnn = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "selectedDnn"); - + selected_dnn = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "selectedDnn"); if (selected_dnn) { - if (!cJSON_IsString(selected_dnn)) { + if (!cJSON_IsString(selected_dnn) && !cJSON_IsNull(selected_dnn)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [selected_dnn]"); goto end; } } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "sNssai"); - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "sNssai"); if (s_nssai) { s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); } - cJSON *hplmn_snssai = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hplmnSnssai"); - - OpenAPI_snssai_t *hplmn_snssai_local_nonprim = NULL; + hplmn_snssai = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hplmnSnssai"); if (hplmn_snssai) { hplmn_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(hplmn_snssai); } - cJSON *serving_nf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "servingNfId"); + serving_nf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "servingNfId"); if (!serving_nf_id) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [serving_nf_id]"); goto end; } - if (!cJSON_IsString(serving_nf_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [serving_nf_id]"); goto end; } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } - cJSON *service_name = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "serviceName"); - + service_name = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "serviceName"); if (service_name) { - if (!cJSON_IsString(service_name)) { + if (!cJSON_IsString(service_name) && !cJSON_IsNull(service_name)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [service_name]"); goto end; } } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "servingNetwork"); + serving_network = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "servingNetwork"); if (!serving_network) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [serving_network]"); goto end; } - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); - cJSON *request_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "requestType"); - - OpenAPI_request_type_e request_typeVariable; + request_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "requestType"); if (request_type) { if (!cJSON_IsString(request_type)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [request_type]"); @@ -1106,29 +1357,23 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c request_typeVariable = OpenAPI_request_type_FromString(request_type->valuestring); } - cJSON *n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n1SmMsg"); - - OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n1SmMsg"); if (n1_sm_msg) { n1_sm_msg_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_msg); } - cJSON *an_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "anType"); + an_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "anType"); if (!an_type) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [an_type]"); goto end; } - - OpenAPI_access_type_e an_typeVariable; if (!cJSON_IsString(an_type)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [an_type]"); goto end; } an_typeVariable = OpenAPI_access_type_FromString(an_type->valuestring); - cJSON *additional_an_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalAnType"); - - OpenAPI_access_type_e additional_an_typeVariable; + additional_an_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalAnType"); if (additional_an_type) { if (!cJSON_IsString(additional_an_type)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_an_type]"); @@ -1137,9 +1382,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c additional_an_typeVariable = OpenAPI_access_type_FromString(additional_an_type->valuestring); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [rat_type]"); @@ -1148,9 +1391,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *presence_in_ladn = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "presenceInLadn"); - - OpenAPI_presence_state_e presence_in_ladnVariable; + presence_in_ladn = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "presenceInLadn"); if (presence_in_ladn) { if (!cJSON_IsString(presence_in_ladn)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [presence_in_ladn]"); @@ -1159,158 +1400,151 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c presence_in_ladnVariable = OpenAPI_presence_state_FromString(presence_in_ladn->valuestring); } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *add_ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "addUeLocation"); - - OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + add_ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "addUeLocation"); if (add_ue_location) { add_ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(add_ue_location); } - cJSON *sm_context_status_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextStatusUri"); + sm_context_status_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextStatusUri"); if (!sm_context_status_uri) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sm_context_status_uri]"); goto end; } - if (!cJSON_IsString(sm_context_status_uri)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sm_context_status_uri]"); goto end; } - cJSON *h_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hSmfUri"); - + h_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hSmfUri"); if (h_smf_uri) { - if (!cJSON_IsString(h_smf_uri)) { + if (!cJSON_IsString(h_smf_uri) && !cJSON_IsNull(h_smf_uri)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [h_smf_uri]"); goto end; } } - cJSON *h_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hSmfId"); - + h_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hSmfId"); if (h_smf_id) { - if (!cJSON_IsString(h_smf_id)) { + if (!cJSON_IsString(h_smf_id) && !cJSON_IsNull(h_smf_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [h_smf_id]"); goto end; } } - cJSON *smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smfUri"); - + smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smfUri"); if (smf_uri) { - if (!cJSON_IsString(smf_uri)) { + if (!cJSON_IsString(smf_uri) && !cJSON_IsNull(smf_uri)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [smf_uri]"); goto end; } } - cJSON *smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smfId"); - + smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smfId"); if (smf_id) { - if (!cJSON_IsString(smf_id)) { + if (!cJSON_IsString(smf_id) && !cJSON_IsNull(smf_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [smf_id]"); goto end; } } - cJSON *additional_hsmf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalHsmfUri"); - - OpenAPI_list_t *additional_hsmf_uriList; + additional_hsmf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalHsmfUri"); if (additional_hsmf_uri) { - cJSON *additional_hsmf_uri_local; - if (!cJSON_IsArray(additional_hsmf_uri)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_hsmf_uri]"); - goto end; - } - additional_hsmf_uriList = OpenAPI_list_create(); + cJSON *additional_hsmf_uri_local = NULL; + if (!cJSON_IsArray(additional_hsmf_uri)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_hsmf_uri]"); + goto end; + } - cJSON_ArrayForEach(additional_hsmf_uri_local, additional_hsmf_uri) { - if (!cJSON_IsString(additional_hsmf_uri_local)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_hsmf_uri]"); - goto end; - } - OpenAPI_list_add(additional_hsmf_uriList, ogs_strdup(additional_hsmf_uri_local->valuestring)); - } + additional_hsmf_uriList = OpenAPI_list_create(); + + cJSON_ArrayForEach(additional_hsmf_uri_local, additional_hsmf_uri) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(additional_hsmf_uri_local)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_hsmf_uri]"); + goto end; + } + OpenAPI_list_add(additional_hsmf_uriList, ogs_strdup(additional_hsmf_uri_local->valuestring)); + } } - cJSON *additional_hsmf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalHsmfId"); - - OpenAPI_list_t *additional_hsmf_idList; + additional_hsmf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalHsmfId"); if (additional_hsmf_id) { - cJSON *additional_hsmf_id_local; - if (!cJSON_IsArray(additional_hsmf_id)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_hsmf_id]"); - goto end; - } - additional_hsmf_idList = OpenAPI_list_create(); + cJSON *additional_hsmf_id_local = NULL; + if (!cJSON_IsArray(additional_hsmf_id)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_hsmf_id]"); + goto end; + } - cJSON_ArrayForEach(additional_hsmf_id_local, additional_hsmf_id) { - if (!cJSON_IsString(additional_hsmf_id_local)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_hsmf_id]"); - goto end; - } - OpenAPI_list_add(additional_hsmf_idList, ogs_strdup(additional_hsmf_id_local->valuestring)); - } + additional_hsmf_idList = OpenAPI_list_create(); + + cJSON_ArrayForEach(additional_hsmf_id_local, additional_hsmf_id) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(additional_hsmf_id_local)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_hsmf_id]"); + goto end; + } + OpenAPI_list_add(additional_hsmf_idList, ogs_strdup(additional_hsmf_id_local->valuestring)); + } } - cJSON *additional_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalSmfUri"); - - OpenAPI_list_t *additional_smf_uriList; + additional_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalSmfUri"); if (additional_smf_uri) { - cJSON *additional_smf_uri_local; - if (!cJSON_IsArray(additional_smf_uri)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_smf_uri]"); - goto end; - } - additional_smf_uriList = OpenAPI_list_create(); + cJSON *additional_smf_uri_local = NULL; + if (!cJSON_IsArray(additional_smf_uri)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_smf_uri]"); + goto end; + } - cJSON_ArrayForEach(additional_smf_uri_local, additional_smf_uri) { - if (!cJSON_IsString(additional_smf_uri_local)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_smf_uri]"); - goto end; - } - OpenAPI_list_add(additional_smf_uriList, ogs_strdup(additional_smf_uri_local->valuestring)); - } + additional_smf_uriList = OpenAPI_list_create(); + + cJSON_ArrayForEach(additional_smf_uri_local, additional_smf_uri) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(additional_smf_uri_local)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_smf_uri]"); + goto end; + } + OpenAPI_list_add(additional_smf_uriList, ogs_strdup(additional_smf_uri_local->valuestring)); + } } - cJSON *additional_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalSmfId"); - - OpenAPI_list_t *additional_smf_idList; + additional_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "additionalSmfId"); if (additional_smf_id) { - cJSON *additional_smf_id_local; - if (!cJSON_IsArray(additional_smf_id)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_smf_id]"); - goto end; - } - additional_smf_idList = OpenAPI_list_create(); + cJSON *additional_smf_id_local = NULL; + if (!cJSON_IsArray(additional_smf_id)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_smf_id]"); + goto end; + } - cJSON_ArrayForEach(additional_smf_id_local, additional_smf_id) { - if (!cJSON_IsString(additional_smf_id_local)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_smf_id]"); - goto end; - } - OpenAPI_list_add(additional_smf_idList, ogs_strdup(additional_smf_id_local->valuestring)); - } + additional_smf_idList = OpenAPI_list_create(); + + cJSON_ArrayForEach(additional_smf_id_local, additional_smf_id) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(additional_smf_id_local)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [additional_smf_id]"); + goto end; + } + OpenAPI_list_add(additional_smf_idList, ogs_strdup(additional_smf_id_local->valuestring)); + } } - cJSON *old_pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "oldPduSessionId"); - + old_pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "oldPduSessionId"); if (old_pdu_session_id) { if (!cJSON_IsNumber(old_pdu_session_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [old_pdu_session_id]"); @@ -1318,38 +1552,42 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *pdu_sessions_activate_list = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pduSessionsActivateList"); - - OpenAPI_list_t *pdu_sessions_activate_listList; + pdu_sessions_activate_list = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pduSessionsActivateList"); if (pdu_sessions_activate_list) { - cJSON *pdu_sessions_activate_list_local; - if (!cJSON_IsArray(pdu_sessions_activate_list)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pdu_sessions_activate_list]"); - goto end; - } - pdu_sessions_activate_listList = OpenAPI_list_create(); + cJSON *pdu_sessions_activate_list_local = NULL; + if (!cJSON_IsArray(pdu_sessions_activate_list)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pdu_sessions_activate_list]"); + goto end; + } - cJSON_ArrayForEach(pdu_sessions_activate_list_local, pdu_sessions_activate_list) { - if (!cJSON_IsNumber(pdu_sessions_activate_list_local)) { - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pdu_sessions_activate_list]"); - goto end; - } - OpenAPI_list_add(pdu_sessions_activate_listList, &pdu_sessions_activate_list_local->valuedouble); - } + pdu_sessions_activate_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_sessions_activate_list_local, pdu_sessions_activate_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(pdu_sessions_activate_list_local)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pdu_sessions_activate_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pdu_sessions_activate_list]"); + goto end; + } + *localDouble = pdu_sessions_activate_list_local->valuedouble; + OpenAPI_list_add(pdu_sessions_activate_listList, localDouble); + } } - cJSON *ue_eps_pdn_connection = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ueEpsPdnConnection"); - + ue_eps_pdn_connection = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ueEpsPdnConnection"); if (ue_eps_pdn_connection) { - if (!cJSON_IsString(ue_eps_pdn_connection)) { + if (!cJSON_IsString(ue_eps_pdn_connection) && !cJSON_IsNull(ue_eps_pdn_connection)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [ue_eps_pdn_connection]"); goto end; } } - cJSON *ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hoState"); - - OpenAPI_ho_state_e ho_stateVariable; + ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hoState"); if (ho_state) { if (!cJSON_IsString(ho_state)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [ho_state]"); @@ -1358,54 +1596,47 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c ho_stateVariable = OpenAPI_ho_state_FromString(ho_state->valuestring); } - cJSON *pcf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pcfId"); - + pcf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pcfId"); if (pcf_id) { - if (!cJSON_IsString(pcf_id)) { + if (!cJSON_IsString(pcf_id) && !cJSON_IsNull(pcf_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pcf_id]"); goto end; } } - cJSON *pcf_group_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pcfGroupId"); - + pcf_group_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pcfGroupId"); if (pcf_group_id) { - if (!cJSON_IsString(pcf_group_id)) { + if (!cJSON_IsString(pcf_group_id) && !cJSON_IsNull(pcf_group_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pcf_group_id]"); goto end; } } - cJSON *pcf_set_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pcfSetId"); - + pcf_set_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pcfSetId"); if (pcf_set_id) { - if (!cJSON_IsString(pcf_set_id)) { + if (!cJSON_IsString(pcf_set_id) && !cJSON_IsNull(pcf_set_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [pcf_set_id]"); goto end; } } - cJSON *nrf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "nrfUri"); - + nrf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "nrfUri"); if (nrf_uri) { - if (!cJSON_IsString(nrf_uri)) { + if (!cJSON_IsString(nrf_uri) && !cJSON_IsNull(nrf_uri)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [nrf_uri]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *sel_mode = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "selMode"); - - OpenAPI_dnn_selection_mode_e sel_modeVariable; + sel_mode = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "selMode"); if (sel_mode) { if (!cJSON_IsString(sel_mode)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sel_mode]"); @@ -1414,63 +1645,53 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c sel_modeVariable = OpenAPI_dnn_selection_mode_FromString(sel_mode->valuestring); } - cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "backupAmfInfo"); - - OpenAPI_list_t *backup_amf_infoList; + backup_amf_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "backupAmfInfo"); if (backup_amf_info) { - cJSON *backup_amf_info_local_nonprimitive; - if (!cJSON_IsArray(backup_amf_info)){ - ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [backup_amf_info]"); - goto end; - } - - backup_amf_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { - if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + cJSON *backup_amf_info_local = NULL; + if (!cJSON_IsArray(backup_amf_info)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [backup_amf_info]"); goto end; } - OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); - if (!backup_amf_infoItem) { - ogs_error("No backup_amf_infoItem"); - OpenAPI_list_free(backup_amf_infoList); - goto end; + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) { + if (!cJSON_IsObject(backup_amf_info_local)) { + ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local); + if (!backup_amf_infoItem) { + ogs_error("No backup_amf_infoItem"); + OpenAPI_list_free(backup_amf_infoList); + goto end; + } + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); } - - OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); - } } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *udm_group_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "udmGroupId"); - + udm_group_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "udmGroupId"); if (udm_group_id) { - if (!cJSON_IsString(udm_group_id)) { + if (!cJSON_IsString(udm_group_id) && !cJSON_IsNull(udm_group_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [udm_group_id]"); goto end; } } - cJSON *routing_indicator = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "routingIndicator"); - + routing_indicator = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "routingIndicator"); if (routing_indicator) { - if (!cJSON_IsString(routing_indicator)) { + if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [routing_indicator]"); goto end; } } - cJSON *eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "epsInterworkingInd"); - - OpenAPI_eps_interworking_indication_e eps_interworking_indVariable; + eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "epsInterworkingInd"); if (eps_interworking_ind) { if (!cJSON_IsString(eps_interworking_ind)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [eps_interworking_ind]"); @@ -1479,8 +1700,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c eps_interworking_indVariable = OpenAPI_eps_interworking_indication_FromString(eps_interworking_ind->valuestring); } - cJSON *indirect_forwarding_flag = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "indirectForwardingFlag"); - + indirect_forwarding_flag = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "indirectForwardingFlag"); if (indirect_forwarding_flag) { if (!cJSON_IsBool(indirect_forwarding_flag)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [indirect_forwarding_flag]"); @@ -1488,8 +1708,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *direct_forwarding_flag = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "directForwardingFlag"); - + direct_forwarding_flag = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "directForwardingFlag"); if (direct_forwarding_flag) { if (!cJSON_IsBool(direct_forwarding_flag)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [direct_forwarding_flag]"); @@ -1497,24 +1716,20 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *target_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "targetId"); - - OpenAPI_ng_ran_target_id_t *target_id_local_nonprim = NULL; + target_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "targetId"); if (target_id) { target_id_local_nonprim = OpenAPI_ng_ran_target_id_parseFromJSON(target_id); } - cJSON *eps_bearer_ctx_status = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "epsBearerCtxStatus"); - + eps_bearer_ctx_status = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "epsBearerCtxStatus"); if (eps_bearer_ctx_status) { - if (!cJSON_IsString(eps_bearer_ctx_status)) { + if (!cJSON_IsString(eps_bearer_ctx_status) && !cJSON_IsNull(eps_bearer_ctx_status)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [eps_bearer_ctx_status]"); goto end; } } - cJSON *cp_ciot_enabled = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "cpCiotEnabled"); - + cp_ciot_enabled = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "cpCiotEnabled"); if (cp_ciot_enabled) { if (!cJSON_IsBool(cp_ciot_enabled)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [cp_ciot_enabled]"); @@ -1522,8 +1737,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *cp_only_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "cpOnlyInd"); - + cp_only_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "cpOnlyInd"); if (cp_only_ind) { if (!cJSON_IsBool(cp_only_ind)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [cp_only_ind]"); @@ -1531,8 +1745,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *invoke_nef = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "invokeNef"); - + invoke_nef = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "invokeNef"); if (invoke_nef) { if (!cJSON_IsBool(invoke_nef)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [invoke_nef]"); @@ -1540,8 +1753,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *ma_request_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "maRequestInd"); - + ma_request_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "maRequestInd"); if (ma_request_ind) { if (!cJSON_IsBool(ma_request_ind)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [ma_request_ind]"); @@ -1549,8 +1761,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "maNwUpgradeInd"); - + ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "maNwUpgradeInd"); if (ma_nw_upgrade_ind) { if (!cJSON_IsBool(ma_nw_upgrade_ind)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [ma_nw_upgrade_ind]"); @@ -1558,16 +1769,12 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n2SmInfo"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n2SmInfo"); if (n2_sm_info) { n2_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info); } - cJSON *n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n2SmInfoType"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable; + n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n2SmInfoType"); if (n2_sm_info_type) { if (!cJSON_IsString(n2_sm_info_type)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [n2_sm_info_type]"); @@ -1576,16 +1783,12 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c n2_sm_info_typeVariable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type->valuestring); } - cJSON *n2_sm_info_ext1 = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n2SmInfoExt1"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_ext1_local_nonprim = NULL; + n2_sm_info_ext1 = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n2SmInfoExt1"); if (n2_sm_info_ext1) { n2_sm_info_ext1_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info_ext1); } - cJSON *n2_sm_info_type_ext1 = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n2SmInfoTypeExt1"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1Variable; + n2_sm_info_type_ext1 = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n2SmInfoTypeExt1"); if (n2_sm_info_type_ext1) { if (!cJSON_IsString(n2_sm_info_type_ext1)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [n2_sm_info_type_ext1]"); @@ -1594,45 +1797,39 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c n2_sm_info_type_ext1Variable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type_ext1->valuestring); } - cJSON *sm_context_ref = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextRef"); - + sm_context_ref = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextRef"); if (sm_context_ref) { - if (!cJSON_IsString(sm_context_ref)) { + if (!cJSON_IsString(sm_context_ref) && !cJSON_IsNull(sm_context_ref)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sm_context_ref]"); goto end; } } - cJSON *sm_context_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextSmfId"); - + sm_context_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextSmfId"); if (sm_context_smf_id) { - if (!cJSON_IsString(sm_context_smf_id)) { + if (!cJSON_IsString(sm_context_smf_id) && !cJSON_IsNull(sm_context_smf_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sm_context_smf_id]"); goto end; } } - cJSON *sm_context_smf_set_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextSmfSetId"); - + sm_context_smf_set_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextSmfSetId"); if (sm_context_smf_set_id) { - if (!cJSON_IsString(sm_context_smf_set_id)) { + if (!cJSON_IsString(sm_context_smf_set_id) && !cJSON_IsNull(sm_context_smf_set_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sm_context_smf_set_id]"); goto end; } } - cJSON *sm_context_smf_service_set_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextSmfServiceSetId"); - + sm_context_smf_service_set_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextSmfServiceSetId"); if (sm_context_smf_service_set_id) { - if (!cJSON_IsString(sm_context_smf_service_set_id)) { + if (!cJSON_IsString(sm_context_smf_service_set_id) && !cJSON_IsNull(sm_context_smf_service_set_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sm_context_smf_service_set_id]"); goto end; } } - cJSON *sm_context_smf_binding = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextSmfBinding"); - - OpenAPI_sbi_binding_level_e sm_context_smf_bindingVariable; + sm_context_smf_binding = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smContextSmfBinding"); if (sm_context_smf_binding) { if (!cJSON_IsString(sm_context_smf_binding)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sm_context_smf_binding]"); @@ -1641,9 +1838,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c sm_context_smf_bindingVariable = OpenAPI_sbi_binding_level_FromString(sm_context_smf_binding->valuestring); } - cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "upCnxState"); - - OpenAPI_up_cnx_state_e up_cnx_stateVariable; + up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "upCnxState"); if (up_cnx_state) { if (!cJSON_IsString(up_cnx_state)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [up_cnx_state]"); @@ -1652,22 +1847,17 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring); } - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smallDataRateStatus"); - - OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smallDataRateStatus"); if (small_data_rate_status) { small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); } - cJSON *apn_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "apnRateStatus"); - - OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + apn_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "apnRateStatus"); if (apn_rate_status) { apn_rate_status_local_nonprim = OpenAPI_apn_rate_status_parseFromJSON(apn_rate_status); } - cJSON *extended_nas_sm_timer_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "extendedNasSmTimerInd"); - + extended_nas_sm_timer_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "extendedNasSmTimerInd"); if (extended_nas_sm_timer_ind) { if (!cJSON_IsBool(extended_nas_sm_timer_ind)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [extended_nas_sm_timer_ind]"); @@ -1675,8 +1865,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *dl_data_waiting_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "dlDataWaitingInd"); - + dl_data_waiting_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "dlDataWaitingInd"); if (dl_data_waiting_ind) { if (!cJSON_IsBool(dl_data_waiting_ind)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [dl_data_waiting_ind]"); @@ -1684,15 +1873,12 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *ddn_failure_subs = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ddnFailureSubs"); - - OpenAPI_ddn_failure_subs_t *ddn_failure_subs_local_nonprim = NULL; + ddn_failure_subs = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ddnFailureSubs"); if (ddn_failure_subs) { ddn_failure_subs_local_nonprim = OpenAPI_ddn_failure_subs_parseFromJSON(ddn_failure_subs); } - cJSON *smf_transfer_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smfTransferInd"); - + smf_transfer_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smfTransferInd"); if (smf_transfer_ind) { if (!cJSON_IsBool(smf_transfer_ind)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [smf_transfer_ind]"); @@ -1700,47 +1886,38 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } } - cJSON *old_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "oldSmfId"); - + old_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "oldSmfId"); if (old_smf_id) { - if (!cJSON_IsString(old_smf_id)) { + if (!cJSON_IsString(old_smf_id) && !cJSON_IsNull(old_smf_id)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [old_smf_id]"); goto end; } } - cJSON *old_sm_context_ref = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "oldSmContextRef"); - + old_sm_context_ref = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "oldSmContextRef"); if (old_sm_context_ref) { - if (!cJSON_IsString(old_sm_context_ref)) { + if (!cJSON_IsString(old_sm_context_ref) && !cJSON_IsNull(old_sm_context_ref)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [old_sm_context_ref]"); goto end; } } - cJSON *w_agf_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "wAgfInfo"); - - OpenAPI_w_agf_info_t *w_agf_info_local_nonprim = NULL; + w_agf_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "wAgfInfo"); if (w_agf_info) { w_agf_info_local_nonprim = OpenAPI_w_agf_info_parseFromJSON(w_agf_info); } - cJSON *tngf_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "tngfInfo"); - - OpenAPI_tngf_info_t *tngf_info_local_nonprim = NULL; + tngf_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "tngfInfo"); if (tngf_info) { tngf_info_local_nonprim = OpenAPI_tngf_info_parseFromJSON(tngf_info); } - cJSON *twif_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "twifInfo"); - - OpenAPI_twif_info_t *twif_info_local_nonprim = NULL; + twif_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "twifInfo"); if (twif_info) { twif_info_local_nonprim = OpenAPI_twif_info_parseFromJSON(twif_info); } - cJSON *ran_unchanged_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ranUnchangedInd"); - + ran_unchanged_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "ranUnchangedInd"); if (ran_unchanged_ind) { if (!cJSON_IsBool(ran_unchanged_ind)) { ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [ran_unchanged_ind]"); @@ -1749,20 +1926,20 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c } sm_context_create_data_local_var = OpenAPI_sm_context_create_data_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, unauthenticated_supi ? true : false, unauthenticated_supi ? unauthenticated_supi->valueint : 0, - pei ? ogs_strdup(pei->valuestring) : NULL, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, pdu_session_id ? true : false, pdu_session_id ? pdu_session_id->valuedouble : 0, - dnn ? ogs_strdup(dnn->valuestring) : NULL, - selected_dnn ? ogs_strdup(selected_dnn->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, + selected_dnn && !cJSON_IsNull(selected_dnn) ? ogs_strdup(selected_dnn->valuestring) : NULL, s_nssai ? s_nssai_local_nonprim : NULL, hplmn_snssai ? hplmn_snssai_local_nonprim : NULL, ogs_strdup(serving_nf_id->valuestring), guami ? guami_local_nonprim : NULL, - service_name ? ogs_strdup(service_name->valuestring) : NULL, + service_name && !cJSON_IsNull(service_name) ? ogs_strdup(service_name->valuestring) : NULL, serving_network_local_nonprim, request_type ? request_typeVariable : 0, n1_sm_msg ? n1_sm_msg_local_nonprim : NULL, @@ -1771,13 +1948,13 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c rat_type ? rat_typeVariable : 0, presence_in_ladn ? presence_in_ladnVariable : 0, ue_location ? ue_location_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, add_ue_location ? add_ue_location_local_nonprim : NULL, ogs_strdup(sm_context_status_uri->valuestring), - h_smf_uri ? ogs_strdup(h_smf_uri->valuestring) : NULL, - h_smf_id ? ogs_strdup(h_smf_id->valuestring) : NULL, - smf_uri ? ogs_strdup(smf_uri->valuestring) : NULL, - smf_id ? ogs_strdup(smf_id->valuestring) : NULL, + h_smf_uri && !cJSON_IsNull(h_smf_uri) ? ogs_strdup(h_smf_uri->valuestring) : NULL, + h_smf_id && !cJSON_IsNull(h_smf_id) ? ogs_strdup(h_smf_id->valuestring) : NULL, + smf_uri && !cJSON_IsNull(smf_uri) ? ogs_strdup(smf_uri->valuestring) : NULL, + smf_id && !cJSON_IsNull(smf_id) ? ogs_strdup(smf_id->valuestring) : NULL, additional_hsmf_uri ? additional_hsmf_uriList : NULL, additional_hsmf_id ? additional_hsmf_idList : NULL, additional_smf_uri ? additional_smf_uriList : NULL, @@ -1785,25 +1962,25 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c old_pdu_session_id ? true : false, old_pdu_session_id ? old_pdu_session_id->valuedouble : 0, pdu_sessions_activate_list ? pdu_sessions_activate_listList : NULL, - ue_eps_pdn_connection ? ogs_strdup(ue_eps_pdn_connection->valuestring) : NULL, + ue_eps_pdn_connection && !cJSON_IsNull(ue_eps_pdn_connection) ? ogs_strdup(ue_eps_pdn_connection->valuestring) : NULL, ho_state ? ho_stateVariable : 0, - pcf_id ? ogs_strdup(pcf_id->valuestring) : NULL, - pcf_group_id ? ogs_strdup(pcf_group_id->valuestring) : NULL, - pcf_set_id ? ogs_strdup(pcf_set_id->valuestring) : NULL, - nrf_uri ? ogs_strdup(nrf_uri->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + pcf_id && !cJSON_IsNull(pcf_id) ? ogs_strdup(pcf_id->valuestring) : NULL, + pcf_group_id && !cJSON_IsNull(pcf_group_id) ? ogs_strdup(pcf_group_id->valuestring) : NULL, + pcf_set_id && !cJSON_IsNull(pcf_set_id) ? ogs_strdup(pcf_set_id->valuestring) : NULL, + nrf_uri && !cJSON_IsNull(nrf_uri) ? ogs_strdup(nrf_uri->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, sel_mode ? sel_modeVariable : 0, backup_amf_info ? backup_amf_infoList : NULL, trace_data ? trace_data_local_nonprim : NULL, - udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL, - routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL, + udm_group_id && !cJSON_IsNull(udm_group_id) ? ogs_strdup(udm_group_id->valuestring) : NULL, + routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL, eps_interworking_ind ? eps_interworking_indVariable : 0, indirect_forwarding_flag ? true : false, indirect_forwarding_flag ? indirect_forwarding_flag->valueint : 0, direct_forwarding_flag ? true : false, direct_forwarding_flag ? direct_forwarding_flag->valueint : 0, target_id ? target_id_local_nonprim : NULL, - eps_bearer_ctx_status ? ogs_strdup(eps_bearer_ctx_status->valuestring) : NULL, + eps_bearer_ctx_status && !cJSON_IsNull(eps_bearer_ctx_status) ? ogs_strdup(eps_bearer_ctx_status->valuestring) : NULL, cp_ciot_enabled ? true : false, cp_ciot_enabled ? cp_ciot_enabled->valueint : 0, cp_only_ind ? true : false, @@ -1818,10 +1995,10 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c n2_sm_info_type ? n2_sm_info_typeVariable : 0, n2_sm_info_ext1 ? n2_sm_info_ext1_local_nonprim : NULL, n2_sm_info_type_ext1 ? n2_sm_info_type_ext1Variable : 0, - sm_context_ref ? ogs_strdup(sm_context_ref->valuestring) : NULL, - sm_context_smf_id ? ogs_strdup(sm_context_smf_id->valuestring) : NULL, - sm_context_smf_set_id ? ogs_strdup(sm_context_smf_set_id->valuestring) : NULL, - sm_context_smf_service_set_id ? ogs_strdup(sm_context_smf_service_set_id->valuestring) : NULL, + sm_context_ref && !cJSON_IsNull(sm_context_ref) ? ogs_strdup(sm_context_ref->valuestring) : NULL, + sm_context_smf_id && !cJSON_IsNull(sm_context_smf_id) ? ogs_strdup(sm_context_smf_id->valuestring) : NULL, + sm_context_smf_set_id && !cJSON_IsNull(sm_context_smf_set_id) ? ogs_strdup(sm_context_smf_set_id->valuestring) : NULL, + sm_context_smf_service_set_id && !cJSON_IsNull(sm_context_smf_service_set_id) ? ogs_strdup(sm_context_smf_service_set_id->valuestring) : NULL, sm_context_smf_binding ? sm_context_smf_bindingVariable : 0, up_cnx_state ? up_cnx_stateVariable : 0, small_data_rate_status ? small_data_rate_status_local_nonprim : NULL, @@ -1833,8 +2010,8 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c ddn_failure_subs ? ddn_failure_subs_local_nonprim : NULL, smf_transfer_ind ? true : false, smf_transfer_ind ? smf_transfer_ind->valueint : 0, - old_smf_id ? ogs_strdup(old_smf_id->valuestring) : NULL, - old_sm_context_ref ? ogs_strdup(old_sm_context_ref->valuestring) : NULL, + old_smf_id && !cJSON_IsNull(old_smf_id) ? ogs_strdup(old_smf_id->valuestring) : NULL, + old_sm_context_ref && !cJSON_IsNull(old_sm_context_ref) ? ogs_strdup(old_sm_context_ref->valuestring) : NULL, w_agf_info ? w_agf_info_local_nonprim : NULL, tngf_info ? tngf_info_local_nonprim : NULL, twif_info ? twif_info_local_nonprim : NULL, @@ -1844,6 +2021,116 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c return sm_context_create_data_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (hplmn_snssai_local_nonprim) { + OpenAPI_snssai_free(hplmn_snssai_local_nonprim); + hplmn_snssai_local_nonprim = NULL; + } + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (n1_sm_msg_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_msg_local_nonprim); + n1_sm_msg_local_nonprim = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } + if (add_ue_location_local_nonprim) { + OpenAPI_user_location_free(add_ue_location_local_nonprim); + add_ue_location_local_nonprim = NULL; + } + if (additional_hsmf_uriList) { + OpenAPI_list_for_each(additional_hsmf_uriList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(additional_hsmf_uriList); + additional_hsmf_uriList = NULL; + } + if (additional_hsmf_idList) { + OpenAPI_list_for_each(additional_hsmf_idList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(additional_hsmf_idList); + additional_hsmf_idList = NULL; + } + if (additional_smf_uriList) { + OpenAPI_list_for_each(additional_smf_uriList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(additional_smf_uriList); + additional_smf_uriList = NULL; + } + if (additional_smf_idList) { + OpenAPI_list_for_each(additional_smf_idList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(additional_smf_idList); + additional_smf_idList = NULL; + } + if (pdu_sessions_activate_listList) { + OpenAPI_list_for_each(pdu_sessions_activate_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_sessions_activate_listList); + pdu_sessions_activate_listList = NULL; + } + if (backup_amf_infoList) { + OpenAPI_list_for_each(backup_amf_infoList, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(backup_amf_infoList); + backup_amf_infoList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (target_id_local_nonprim) { + OpenAPI_ng_ran_target_id_free(target_id_local_nonprim); + target_id_local_nonprim = NULL; + } + if (n2_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_local_nonprim); + n2_sm_info_local_nonprim = NULL; + } + if (n2_sm_info_ext1_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_ext1_local_nonprim); + n2_sm_info_ext1_local_nonprim = NULL; + } + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } + if (apn_rate_status_local_nonprim) { + OpenAPI_apn_rate_status_free(apn_rate_status_local_nonprim); + apn_rate_status_local_nonprim = NULL; + } + if (ddn_failure_subs_local_nonprim) { + OpenAPI_ddn_failure_subs_free(ddn_failure_subs_local_nonprim); + ddn_failure_subs_local_nonprim = NULL; + } + if (w_agf_info_local_nonprim) { + OpenAPI_w_agf_info_free(w_agf_info_local_nonprim); + w_agf_info_local_nonprim = NULL; + } + if (tngf_info_local_nonprim) { + OpenAPI_tngf_info_free(tngf_info_local_nonprim); + tngf_info_local_nonprim = NULL; + } + if (twif_info_local_nonprim) { + OpenAPI_twif_info_free(twif_info_local_nonprim); + twif_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_create_error.c b/lib/sbi/openapi/model/sm_context_create_error.c index a12335c2f..ceeaaa359 100644 --- a/lib/sbi/openapi/model/sm_context_create_error.c +++ b/lib/sbi/openapi/model/sm_context_create_error.c @@ -26,20 +26,34 @@ OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_create( void OpenAPI_sm_context_create_error_free(OpenAPI_sm_context_create_error_t *sm_context_create_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_create_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ext_problem_details_free(sm_context_create_error->error); - OpenAPI_ref_to_binary_data_free(sm_context_create_error->n1_sm_msg); - OpenAPI_ref_to_binary_data_free(sm_context_create_error->n2_sm_info); - ogs_free(sm_context_create_error->recovery_time); + if (sm_context_create_error->error) { + OpenAPI_ext_problem_details_free(sm_context_create_error->error); + sm_context_create_error->error = NULL; + } + if (sm_context_create_error->n1_sm_msg) { + OpenAPI_ref_to_binary_data_free(sm_context_create_error->n1_sm_msg); + sm_context_create_error->n1_sm_msg = NULL; + } + if (sm_context_create_error->n2_sm_info) { + OpenAPI_ref_to_binary_data_free(sm_context_create_error->n2_sm_info); + sm_context_create_error->n2_sm_info = NULL; + } + if (sm_context_create_error->recovery_time) { + ogs_free(sm_context_create_error->recovery_time); + sm_context_create_error->recovery_time = NULL; + } ogs_free(sm_context_create_error); } cJSON *OpenAPI_sm_context_create_error_convertToJSON(OpenAPI_sm_context_create_error_t *sm_context_create_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_create_error == NULL) { ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [SmContextCreateError]"); @@ -47,6 +61,10 @@ cJSON *OpenAPI_sm_context_create_error_convertToJSON(OpenAPI_sm_context_create_e } item = cJSON_CreateObject(); + if (!sm_context_create_error->error) { + ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_ext_problem_details_convertToJSON(sm_context_create_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [error]"); @@ -84,7 +102,7 @@ cJSON *OpenAPI_sm_context_create_error_convertToJSON(OpenAPI_sm_context_create_e } } - if (sm_context_create_error->n2_sm_info_type) { + if (sm_context_create_error->n2_sm_info_type != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoType", OpenAPI_n2_sm_info_type_ToString(sm_context_create_error->n2_sm_info_type)) == NULL) { ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [n2_sm_info_type]"); goto end; @@ -105,32 +123,34 @@ end: OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_parseFromJSON(cJSON *sm_context_create_errorJSON) { OpenAPI_sm_context_create_error_t *sm_context_create_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_ext_problem_details_t *error_local_nonprim = NULL; + cJSON *n1_sm_msg = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + cJSON *n2_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + cJSON *n2_sm_info_type = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable = 0; + cJSON *recovery_time = NULL; + error = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_sm_context_create_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_ext_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_ext_problem_details_parseFromJSON(error); - cJSON *n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n1SmMsg"); - - OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n1SmMsg"); if (n1_sm_msg) { n1_sm_msg_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_msg); } - cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n2SmInfo"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n2SmInfo"); if (n2_sm_info) { n2_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info); } - cJSON *n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n2SmInfoType"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable; + n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n2SmInfoType"); if (n2_sm_info_type) { if (!cJSON_IsString(n2_sm_info_type)) { ogs_error("OpenAPI_sm_context_create_error_parseFromJSON() failed [n2_sm_info_type]"); @@ -139,10 +159,9 @@ OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_parseFromJSON n2_sm_info_typeVariable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type->valuestring); } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_sm_context_create_error_parseFromJSON() failed [recovery_time]"); goto end; } @@ -153,11 +172,23 @@ OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_parseFromJSON n1_sm_msg ? n1_sm_msg_local_nonprim : NULL, n2_sm_info ? n2_sm_info_local_nonprim : NULL, n2_sm_info_type ? n2_sm_info_typeVariable : 0, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL ); return sm_context_create_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_ext_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (n1_sm_msg_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_msg_local_nonprim); + n1_sm_msg_local_nonprim = NULL; + } + if (n2_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_local_nonprim); + n2_sm_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_created_data.c b/lib/sbi/openapi/model/sm_context_created_data.c index f1873cfe6..f3f6bfc2f 100644 --- a/lib/sbi/openapi/model/sm_context_created_data.c +++ b/lib/sbi/openapi/model/sm_context_created_data.c @@ -48,30 +48,65 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_create( void OpenAPI_sm_context_created_data_free(OpenAPI_sm_context_created_data_t *sm_context_created_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_created_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(sm_context_created_data->h_smf_uri); - ogs_free(sm_context_created_data->smf_uri); - OpenAPI_snssai_free(sm_context_created_data->s_nssai); - OpenAPI_ref_to_binary_data_free(sm_context_created_data->n2_sm_info); - OpenAPI_list_for_each(sm_context_created_data->allocated_ebi_list, node) { - OpenAPI_ebi_arp_mapping_free(node->data); + if (sm_context_created_data->h_smf_uri) { + ogs_free(sm_context_created_data->h_smf_uri); + sm_context_created_data->h_smf_uri = NULL; + } + if (sm_context_created_data->smf_uri) { + ogs_free(sm_context_created_data->smf_uri); + sm_context_created_data->smf_uri = NULL; + } + if (sm_context_created_data->s_nssai) { + OpenAPI_snssai_free(sm_context_created_data->s_nssai); + sm_context_created_data->s_nssai = NULL; + } + if (sm_context_created_data->n2_sm_info) { + OpenAPI_ref_to_binary_data_free(sm_context_created_data->n2_sm_info); + sm_context_created_data->n2_sm_info = NULL; + } + if (sm_context_created_data->allocated_ebi_list) { + OpenAPI_list_for_each(sm_context_created_data->allocated_ebi_list, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(sm_context_created_data->allocated_ebi_list); + sm_context_created_data->allocated_ebi_list = NULL; + } + if (sm_context_created_data->gpsi) { + ogs_free(sm_context_created_data->gpsi); + sm_context_created_data->gpsi = NULL; + } + if (sm_context_created_data->smf_service_instance_id) { + ogs_free(sm_context_created_data->smf_service_instance_id); + sm_context_created_data->smf_service_instance_id = NULL; + } + if (sm_context_created_data->recovery_time) { + ogs_free(sm_context_created_data->recovery_time); + sm_context_created_data->recovery_time = NULL; + } + if (sm_context_created_data->supported_features) { + ogs_free(sm_context_created_data->supported_features); + sm_context_created_data->supported_features = NULL; + } + if (sm_context_created_data->selected_smf_id) { + ogs_free(sm_context_created_data->selected_smf_id); + sm_context_created_data->selected_smf_id = NULL; + } + if (sm_context_created_data->selected_old_smf_id) { + ogs_free(sm_context_created_data->selected_old_smf_id); + sm_context_created_data->selected_old_smf_id = NULL; } - OpenAPI_list_free(sm_context_created_data->allocated_ebi_list); - ogs_free(sm_context_created_data->gpsi); - ogs_free(sm_context_created_data->smf_service_instance_id); - ogs_free(sm_context_created_data->recovery_time); - ogs_free(sm_context_created_data->supported_features); - ogs_free(sm_context_created_data->selected_smf_id); - ogs_free(sm_context_created_data->selected_old_smf_id); ogs_free(sm_context_created_data); } cJSON *OpenAPI_sm_context_created_data_convertToJSON(OpenAPI_sm_context_created_data_t *sm_context_created_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_created_data == NULL) { ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [SmContextCreatedData]"); @@ -113,7 +148,7 @@ cJSON *OpenAPI_sm_context_created_data_convertToJSON(OpenAPI_sm_context_created_ } } - if (sm_context_created_data->up_cnx_state) { + if (sm_context_created_data->up_cnx_state != OpenAPI_up_cnx_state_NULL) { if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_created_data->up_cnx_state)) == NULL) { ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [up_cnx_state]"); goto end; @@ -133,7 +168,7 @@ cJSON *OpenAPI_sm_context_created_data_convertToJSON(OpenAPI_sm_context_created_ } } - if (sm_context_created_data->n2_sm_info_type) { + if (sm_context_created_data->n2_sm_info_type != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoType", OpenAPI_n2_sm_info_type_ToString(sm_context_created_data->n2_sm_info_type)) == NULL) { ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [n2_sm_info_type]"); goto end; @@ -146,21 +181,17 @@ cJSON *OpenAPI_sm_context_created_data_convertToJSON(OpenAPI_sm_context_created_ ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [allocated_ebi_list]"); goto end; } - - OpenAPI_lnode_t *allocated_ebi_list_node; - if (sm_context_created_data->allocated_ebi_list) { - OpenAPI_list_for_each(sm_context_created_data->allocated_ebi_list, allocated_ebi_list_node) { - cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(allocated_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [allocated_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(allocated_ebi_listList, itemLocal); + OpenAPI_list_for_each(sm_context_created_data->allocated_ebi_list, node) { + cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [allocated_ebi_list]"); + goto end; } + cJSON_AddItemToArray(allocated_ebi_listList, itemLocal); } } - if (sm_context_created_data->ho_state) { + if (sm_context_created_data->ho_state != OpenAPI_ho_state_NULL) { if (cJSON_AddStringToObject(item, "hoState", OpenAPI_ho_state_ToString(sm_context_created_data->ho_state)) == NULL) { ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [ho_state]"); goto end; @@ -216,26 +247,45 @@ end: OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON(cJSON *sm_context_created_dataJSON) { OpenAPI_sm_context_created_data_t *sm_context_created_data_local_var = NULL; - cJSON *h_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "hSmfUri"); - + OpenAPI_lnode_t *node = NULL; + cJSON *h_smf_uri = NULL; + cJSON *smf_uri = NULL; + cJSON *pdu_session_id = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *up_cnx_state = NULL; + OpenAPI_up_cnx_state_e up_cnx_stateVariable = 0; + cJSON *n2_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + cJSON *n2_sm_info_type = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable = 0; + cJSON *allocated_ebi_list = NULL; + OpenAPI_list_t *allocated_ebi_listList = NULL; + cJSON *ho_state = NULL; + OpenAPI_ho_state_e ho_stateVariable = 0; + cJSON *gpsi = NULL; + cJSON *smf_service_instance_id = NULL; + cJSON *recovery_time = NULL; + cJSON *supported_features = NULL; + cJSON *selected_smf_id = NULL; + cJSON *selected_old_smf_id = NULL; + h_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "hSmfUri"); if (h_smf_uri) { - if (!cJSON_IsString(h_smf_uri)) { + if (!cJSON_IsString(h_smf_uri) && !cJSON_IsNull(h_smf_uri)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [h_smf_uri]"); goto end; } } - cJSON *smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "smfUri"); - + smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "smfUri"); if (smf_uri) { - if (!cJSON_IsString(smf_uri)) { + if (!cJSON_IsString(smf_uri) && !cJSON_IsNull(smf_uri)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [smf_uri]"); goto end; } } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "pduSessionId"); - + pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "pduSessionId"); if (pdu_session_id) { if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [pdu_session_id]"); @@ -243,16 +293,12 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON } } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "sNssai"); - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "sNssai"); if (s_nssai) { s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); } - cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "upCnxState"); - - OpenAPI_up_cnx_state_e up_cnx_stateVariable; + up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "upCnxState"); if (up_cnx_state) { if (!cJSON_IsString(up_cnx_state)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [up_cnx_state]"); @@ -261,16 +307,12 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring); } - cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "n2SmInfo"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "n2SmInfo"); if (n2_sm_info) { n2_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info); } - cJSON *n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "n2SmInfoType"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable; + n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "n2SmInfoType"); if (n2_sm_info_type) { if (!cJSON_IsString(n2_sm_info_type)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [n2_sm_info_type]"); @@ -279,38 +321,32 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON n2_sm_info_typeVariable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type->valuestring); } - cJSON *allocated_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "allocatedEbiList"); - - OpenAPI_list_t *allocated_ebi_listList; + allocated_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "allocatedEbiList"); if (allocated_ebi_list) { - cJSON *allocated_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(allocated_ebi_list)){ - ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [allocated_ebi_list]"); - goto end; - } - - allocated_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allocated_ebi_list_local_nonprimitive, allocated_ebi_list ) { - if (!cJSON_IsObject(allocated_ebi_list_local_nonprimitive)) { + cJSON *allocated_ebi_list_local = NULL; + if (!cJSON_IsArray(allocated_ebi_list)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [allocated_ebi_list]"); goto end; } - OpenAPI_ebi_arp_mapping_t *allocated_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(allocated_ebi_list_local_nonprimitive); - if (!allocated_ebi_listItem) { - ogs_error("No allocated_ebi_listItem"); - OpenAPI_list_free(allocated_ebi_listList); - goto end; + allocated_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allocated_ebi_list_local, allocated_ebi_list) { + if (!cJSON_IsObject(allocated_ebi_list_local)) { + ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [allocated_ebi_list]"); + goto end; + } + OpenAPI_ebi_arp_mapping_t *allocated_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(allocated_ebi_list_local); + if (!allocated_ebi_listItem) { + ogs_error("No allocated_ebi_listItem"); + OpenAPI_list_free(allocated_ebi_listList); + goto end; + } + OpenAPI_list_add(allocated_ebi_listList, allocated_ebi_listItem); } - - OpenAPI_list_add(allocated_ebi_listList, allocated_ebi_listItem); - } } - cJSON *ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "hoState"); - - OpenAPI_ho_state_e ho_stateVariable; + ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "hoState"); if (ho_state) { if (!cJSON_IsString(ho_state)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [ho_state]"); @@ -319,63 +355,57 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON ho_stateVariable = OpenAPI_ho_state_FromString(ho_state->valuestring); } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "smfServiceInstanceId"); - + smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "smfServiceInstanceId"); if (smf_service_instance_id) { - if (!cJSON_IsString(smf_service_instance_id)) { + if (!cJSON_IsString(smf_service_instance_id) && !cJSON_IsNull(smf_service_instance_id)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [smf_service_instance_id]"); goto end; } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *selected_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "selectedSmfId"); - + selected_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "selectedSmfId"); if (selected_smf_id) { - if (!cJSON_IsString(selected_smf_id)) { + if (!cJSON_IsString(selected_smf_id) && !cJSON_IsNull(selected_smf_id)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [selected_smf_id]"); goto end; } } - cJSON *selected_old_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "selectedOldSmfId"); - + selected_old_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "selectedOldSmfId"); if (selected_old_smf_id) { - if (!cJSON_IsString(selected_old_smf_id)) { + if (!cJSON_IsString(selected_old_smf_id) && !cJSON_IsNull(selected_old_smf_id)) { ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [selected_old_smf_id]"); goto end; } } sm_context_created_data_local_var = OpenAPI_sm_context_created_data_create ( - h_smf_uri ? ogs_strdup(h_smf_uri->valuestring) : NULL, - smf_uri ? ogs_strdup(smf_uri->valuestring) : NULL, + h_smf_uri && !cJSON_IsNull(h_smf_uri) ? ogs_strdup(h_smf_uri->valuestring) : NULL, + smf_uri && !cJSON_IsNull(smf_uri) ? ogs_strdup(smf_uri->valuestring) : NULL, pdu_session_id ? true : false, pdu_session_id ? pdu_session_id->valuedouble : 0, s_nssai ? s_nssai_local_nonprim : NULL, @@ -384,16 +414,31 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON n2_sm_info_type ? n2_sm_info_typeVariable : 0, allocated_ebi_list ? allocated_ebi_listList : NULL, ho_state ? ho_stateVariable : 0, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - smf_service_instance_id ? ogs_strdup(smf_service_instance_id->valuestring) : NULL, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, - selected_smf_id ? ogs_strdup(selected_smf_id->valuestring) : NULL, - selected_old_smf_id ? ogs_strdup(selected_old_smf_id->valuestring) : NULL + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + smf_service_instance_id && !cJSON_IsNull(smf_service_instance_id) ? ogs_strdup(smf_service_instance_id->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, + selected_smf_id && !cJSON_IsNull(selected_smf_id) ? ogs_strdup(selected_smf_id->valuestring) : NULL, + selected_old_smf_id && !cJSON_IsNull(selected_old_smf_id) ? ogs_strdup(selected_old_smf_id->valuestring) : NULL ); return sm_context_created_data_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (n2_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_local_nonprim); + n2_sm_info_local_nonprim = NULL; + } + if (allocated_ebi_listList) { + OpenAPI_list_for_each(allocated_ebi_listList, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(allocated_ebi_listList); + allocated_ebi_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_release_data.c b/lib/sbi/openapi/model/sm_context_release_data.c index f23ea5e69..5e7cead54 100644 --- a/lib/sbi/openapi/model/sm_context_release_data.c +++ b/lib/sbi/openapi/model/sm_context_release_data.c @@ -42,21 +42,38 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_create( void OpenAPI_sm_context_release_data_free(OpenAPI_sm_context_release_data_t *sm_context_release_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_release_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ng_ap_cause_free(sm_context_release_data->ng_ap_cause); - OpenAPI_user_location_free(sm_context_release_data->ue_location); - ogs_free(sm_context_release_data->ue_time_zone); - OpenAPI_user_location_free(sm_context_release_data->add_ue_location); - OpenAPI_ref_to_binary_data_free(sm_context_release_data->n2_sm_info); + if (sm_context_release_data->ng_ap_cause) { + OpenAPI_ng_ap_cause_free(sm_context_release_data->ng_ap_cause); + sm_context_release_data->ng_ap_cause = NULL; + } + if (sm_context_release_data->ue_location) { + OpenAPI_user_location_free(sm_context_release_data->ue_location); + sm_context_release_data->ue_location = NULL; + } + if (sm_context_release_data->ue_time_zone) { + ogs_free(sm_context_release_data->ue_time_zone); + sm_context_release_data->ue_time_zone = NULL; + } + if (sm_context_release_data->add_ue_location) { + OpenAPI_user_location_free(sm_context_release_data->add_ue_location); + sm_context_release_data->add_ue_location = NULL; + } + if (sm_context_release_data->n2_sm_info) { + OpenAPI_ref_to_binary_data_free(sm_context_release_data->n2_sm_info); + sm_context_release_data->n2_sm_info = NULL; + } ogs_free(sm_context_release_data); } cJSON *OpenAPI_sm_context_release_data_convertToJSON(OpenAPI_sm_context_release_data_t *sm_context_release_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_release_data == NULL) { ogs_error("OpenAPI_sm_context_release_data_convertToJSON() failed [SmContextReleaseData]"); @@ -64,7 +81,7 @@ cJSON *OpenAPI_sm_context_release_data_convertToJSON(OpenAPI_sm_context_release_ } item = cJSON_CreateObject(); - if (sm_context_release_data->cause) { + if (sm_context_release_data->cause != OpenAPI_cause_NULL) { if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(sm_context_release_data->cause)) == NULL) { ogs_error("OpenAPI_sm_context_release_data_convertToJSON() failed [cause]"); goto end; @@ -144,7 +161,7 @@ cJSON *OpenAPI_sm_context_release_data_convertToJSON(OpenAPI_sm_context_release_ } } - if (sm_context_release_data->n2_sm_info_type) { + if (sm_context_release_data->n2_sm_info_type != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoType", OpenAPI_n2_sm_info_type_ToString(sm_context_release_data->n2_sm_info_type)) == NULL) { ogs_error("OpenAPI_sm_context_release_data_convertToJSON() failed [n2_sm_info_type]"); goto end; @@ -165,9 +182,24 @@ end: OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON(cJSON *sm_context_release_dataJSON) { OpenAPI_sm_context_release_data_t *sm_context_release_data_local_var = NULL; - cJSON *cause = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "cause"); - - OpenAPI_cause_e causeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *cause = NULL; + OpenAPI_cause_e causeVariable = 0; + cJSON *ng_ap_cause = NULL; + OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + cJSON *_5g_mm_cause_value = NULL; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *add_ue_location = NULL; + OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + cJSON *vsmf_release_only = NULL; + cJSON *n2_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + cJSON *n2_sm_info_type = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable = 0; + cJSON *ismf_release_only = NULL; + cause = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "cause"); if (cause) { if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_sm_context_release_data_parseFromJSON() failed [cause]"); @@ -176,15 +208,12 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON causeVariable = OpenAPI_cause_FromString(cause->valuestring); } - cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ngApCause"); - - OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + ng_ap_cause = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ngApCause"); if (ng_ap_cause) { ng_ap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ng_ap_cause); } - cJSON *_5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "5gMmCauseValue"); - + _5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "5gMmCauseValue"); if (_5g_mm_cause_value) { if (!cJSON_IsNumber(_5g_mm_cause_value)) { ogs_error("OpenAPI_sm_context_release_data_parseFromJSON() failed [_5g_mm_cause_value]"); @@ -192,31 +221,25 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON } } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_sm_context_release_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *add_ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "addUeLocation"); - - OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + add_ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "addUeLocation"); if (add_ue_location) { add_ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(add_ue_location); } - cJSON *vsmf_release_only = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "vsmfReleaseOnly"); - + vsmf_release_only = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "vsmfReleaseOnly"); if (vsmf_release_only) { if (!cJSON_IsBool(vsmf_release_only)) { ogs_error("OpenAPI_sm_context_release_data_parseFromJSON() failed [vsmf_release_only]"); @@ -224,16 +247,12 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON } } - cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "n2SmInfo"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "n2SmInfo"); if (n2_sm_info) { n2_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info); } - cJSON *n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "n2SmInfoType"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable; + n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "n2SmInfoType"); if (n2_sm_info_type) { if (!cJSON_IsString(n2_sm_info_type)) { ogs_error("OpenAPI_sm_context_release_data_parseFromJSON() failed [n2_sm_info_type]"); @@ -242,8 +261,7 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON n2_sm_info_typeVariable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type->valuestring); } - cJSON *ismf_release_only = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ismfReleaseOnly"); - + ismf_release_only = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ismfReleaseOnly"); if (ismf_release_only) { if (!cJSON_IsBool(ismf_release_only)) { ogs_error("OpenAPI_sm_context_release_data_parseFromJSON() failed [ismf_release_only]"); @@ -257,7 +275,7 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON _5g_mm_cause_value ? true : false, _5g_mm_cause_value ? _5g_mm_cause_value->valuedouble : 0, ue_location ? ue_location_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, add_ue_location ? add_ue_location_local_nonprim : NULL, vsmf_release_only ? true : false, vsmf_release_only ? vsmf_release_only->valueint : 0, @@ -269,6 +287,22 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON return sm_context_release_data_local_var; end: + if (ng_ap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ng_ap_cause_local_nonprim); + ng_ap_cause_local_nonprim = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } + if (add_ue_location_local_nonprim) { + OpenAPI_user_location_free(add_ue_location_local_nonprim); + add_ue_location_local_nonprim = NULL; + } + if (n2_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_local_nonprim); + n2_sm_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_released_data.c b/lib/sbi/openapi/model/sm_context_released_data.c index 366b30c02..3afdc8afb 100644 --- a/lib/sbi/openapi/model/sm_context_released_data.c +++ b/lib/sbi/openapi/model/sm_context_released_data.c @@ -20,18 +20,26 @@ OpenAPI_sm_context_released_data_t *OpenAPI_sm_context_released_data_create( void OpenAPI_sm_context_released_data_free(OpenAPI_sm_context_released_data_t *sm_context_released_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_released_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_small_data_rate_status_free(sm_context_released_data->small_data_rate_status); - OpenAPI_apn_rate_status_free(sm_context_released_data->apn_rate_status); + if (sm_context_released_data->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(sm_context_released_data->small_data_rate_status); + sm_context_released_data->small_data_rate_status = NULL; + } + if (sm_context_released_data->apn_rate_status) { + OpenAPI_apn_rate_status_free(sm_context_released_data->apn_rate_status); + sm_context_released_data->apn_rate_status = NULL; + } ogs_free(sm_context_released_data); } cJSON *OpenAPI_sm_context_released_data_convertToJSON(OpenAPI_sm_context_released_data_t *sm_context_released_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_released_data == NULL) { ogs_error("OpenAPI_sm_context_released_data_convertToJSON() failed [SmContextReleasedData]"); @@ -72,16 +80,17 @@ end: OpenAPI_sm_context_released_data_t *OpenAPI_sm_context_released_data_parseFromJSON(cJSON *sm_context_released_dataJSON) { OpenAPI_sm_context_released_data_t *sm_context_released_data_local_var = NULL; - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_released_dataJSON, "smallDataRateStatus"); - + OpenAPI_lnode_t *node = NULL; + cJSON *small_data_rate_status = NULL; OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + cJSON *apn_rate_status = NULL; + OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_released_dataJSON, "smallDataRateStatus"); if (small_data_rate_status) { small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); } - cJSON *apn_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_released_dataJSON, "apnRateStatus"); - - OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + apn_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_released_dataJSON, "apnRateStatus"); if (apn_rate_status) { apn_rate_status_local_nonprim = OpenAPI_apn_rate_status_parseFromJSON(apn_rate_status); } @@ -93,6 +102,14 @@ OpenAPI_sm_context_released_data_t *OpenAPI_sm_context_released_data_parseFromJS return sm_context_released_data_local_var; end: + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } + if (apn_rate_status_local_nonprim) { + OpenAPI_apn_rate_status_free(apn_rate_status_local_nonprim); + apn_rate_status_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_retrieve_data.c b/lib/sbi/openapi/model/sm_context_retrieve_data.c index a19852212..24e384735 100644 --- a/lib/sbi/openapi/model/sm_context_retrieve_data.c +++ b/lib/sbi/openapi/model/sm_context_retrieve_data.c @@ -28,22 +28,33 @@ OpenAPI_sm_context_retrieve_data_t *OpenAPI_sm_context_retrieve_data_create( void OpenAPI_sm_context_retrieve_data_free(OpenAPI_sm_context_retrieve_data_t *sm_context_retrieve_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_retrieve_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_mme_capabilities_free(sm_context_retrieve_data->target_mme_cap); - OpenAPI_plmn_id_free(sm_context_retrieve_data->serving_network); - OpenAPI_list_for_each(sm_context_retrieve_data->not_to_transfer_ebi_list, node) { - ogs_free(node->data); + if (sm_context_retrieve_data->target_mme_cap) { + OpenAPI_mme_capabilities_free(sm_context_retrieve_data->target_mme_cap); + sm_context_retrieve_data->target_mme_cap = NULL; + } + if (sm_context_retrieve_data->serving_network) { + OpenAPI_plmn_id_free(sm_context_retrieve_data->serving_network); + sm_context_retrieve_data->serving_network = NULL; + } + if (sm_context_retrieve_data->not_to_transfer_ebi_list) { + OpenAPI_list_for_each(sm_context_retrieve_data->not_to_transfer_ebi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_retrieve_data->not_to_transfer_ebi_list); + sm_context_retrieve_data->not_to_transfer_ebi_list = NULL; } - OpenAPI_list_free(sm_context_retrieve_data->not_to_transfer_ebi_list); ogs_free(sm_context_retrieve_data); } cJSON *OpenAPI_sm_context_retrieve_data_convertToJSON(OpenAPI_sm_context_retrieve_data_t *sm_context_retrieve_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_retrieve_data == NULL) { ogs_error("OpenAPI_sm_context_retrieve_data_convertToJSON() failed [SmContextRetrieveData]"); @@ -64,7 +75,7 @@ cJSON *OpenAPI_sm_context_retrieve_data_convertToJSON(OpenAPI_sm_context_retriev } } - if (sm_context_retrieve_data->sm_context_type) { + if (sm_context_retrieve_data->sm_context_type != OpenAPI_sm_context_type_NULL) { if (cJSON_AddStringToObject(item, "smContextType", OpenAPI_sm_context_type_ToString(sm_context_retrieve_data->sm_context_type)) == NULL) { ogs_error("OpenAPI_sm_context_retrieve_data_convertToJSON() failed [sm_context_type]"); goto end; @@ -85,19 +96,17 @@ cJSON *OpenAPI_sm_context_retrieve_data_convertToJSON(OpenAPI_sm_context_retriev } if (sm_context_retrieve_data->not_to_transfer_ebi_list) { - cJSON *not_to_transfer_ebi_list = cJSON_AddArrayToObject(item, "notToTransferEbiList"); - if (not_to_transfer_ebi_list == NULL) { + cJSON *not_to_transfer_ebi_listList = cJSON_AddArrayToObject(item, "notToTransferEbiList"); + if (not_to_transfer_ebi_listList == NULL) { ogs_error("OpenAPI_sm_context_retrieve_data_convertToJSON() failed [not_to_transfer_ebi_list]"); goto end; } - - OpenAPI_lnode_t *not_to_transfer_ebi_list_node; - OpenAPI_list_for_each(sm_context_retrieve_data->not_to_transfer_ebi_list, not_to_transfer_ebi_list_node) { - if (cJSON_AddNumberToObject(not_to_transfer_ebi_list, "", *(double *)not_to_transfer_ebi_list_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_retrieve_data_convertToJSON() failed [not_to_transfer_ebi_list]"); - goto end; + OpenAPI_list_for_each(sm_context_retrieve_data->not_to_transfer_ebi_list, node) { + if (cJSON_AddNumberToObject(not_to_transfer_ebi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_retrieve_data_convertToJSON() failed [not_to_transfer_ebi_list]"); + goto end; + } } - } } if (sm_context_retrieve_data->is_ran_unchanged_ind) { @@ -114,16 +123,22 @@ end: OpenAPI_sm_context_retrieve_data_t *OpenAPI_sm_context_retrieve_data_parseFromJSON(cJSON *sm_context_retrieve_dataJSON) { OpenAPI_sm_context_retrieve_data_t *sm_context_retrieve_data_local_var = NULL; - cJSON *target_mme_cap = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "targetMmeCap"); - + OpenAPI_lnode_t *node = NULL; + cJSON *target_mme_cap = NULL; OpenAPI_mme_capabilities_t *target_mme_cap_local_nonprim = NULL; + cJSON *sm_context_type = NULL; + OpenAPI_sm_context_type_e sm_context_typeVariable = 0; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_t *serving_network_local_nonprim = NULL; + cJSON *not_to_transfer_ebi_list = NULL; + OpenAPI_list_t *not_to_transfer_ebi_listList = NULL; + cJSON *ran_unchanged_ind = NULL; + target_mme_cap = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "targetMmeCap"); if (target_mme_cap) { target_mme_cap_local_nonprim = OpenAPI_mme_capabilities_parseFromJSON(target_mme_cap); } - cJSON *sm_context_type = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "smContextType"); - - OpenAPI_sm_context_type_e sm_context_typeVariable; + sm_context_type = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "smContextType"); if (sm_context_type) { if (!cJSON_IsString(sm_context_type)) { ogs_error("OpenAPI_sm_context_retrieve_data_parseFromJSON() failed [sm_context_type]"); @@ -132,35 +147,39 @@ OpenAPI_sm_context_retrieve_data_t *OpenAPI_sm_context_retrieve_data_parseFromJS sm_context_typeVariable = OpenAPI_sm_context_type_FromString(sm_context_type->valuestring); } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "servingNetwork"); - - OpenAPI_plmn_id_t *serving_network_local_nonprim = NULL; + serving_network = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "servingNetwork"); if (serving_network) { serving_network_local_nonprim = OpenAPI_plmn_id_parseFromJSON(serving_network); } - cJSON *not_to_transfer_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "notToTransferEbiList"); - - OpenAPI_list_t *not_to_transfer_ebi_listList; + not_to_transfer_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "notToTransferEbiList"); if (not_to_transfer_ebi_list) { - cJSON *not_to_transfer_ebi_list_local; - if (!cJSON_IsArray(not_to_transfer_ebi_list)) { - ogs_error("OpenAPI_sm_context_retrieve_data_parseFromJSON() failed [not_to_transfer_ebi_list]"); - goto end; - } - not_to_transfer_ebi_listList = OpenAPI_list_create(); + cJSON *not_to_transfer_ebi_list_local = NULL; + if (!cJSON_IsArray(not_to_transfer_ebi_list)) { + ogs_error("OpenAPI_sm_context_retrieve_data_parseFromJSON() failed [not_to_transfer_ebi_list]"); + goto end; + } - cJSON_ArrayForEach(not_to_transfer_ebi_list_local, not_to_transfer_ebi_list) { - if (!cJSON_IsNumber(not_to_transfer_ebi_list_local)) { - ogs_error("OpenAPI_sm_context_retrieve_data_parseFromJSON() failed [not_to_transfer_ebi_list]"); - goto end; - } - OpenAPI_list_add(not_to_transfer_ebi_listList, ¬_to_transfer_ebi_list_local->valuedouble); - } + not_to_transfer_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(not_to_transfer_ebi_list_local, not_to_transfer_ebi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(not_to_transfer_ebi_list_local)) { + ogs_error("OpenAPI_sm_context_retrieve_data_parseFromJSON() failed [not_to_transfer_ebi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_sm_context_retrieve_data_parseFromJSON() failed [not_to_transfer_ebi_list]"); + goto end; + } + *localDouble = not_to_transfer_ebi_list_local->valuedouble; + OpenAPI_list_add(not_to_transfer_ebi_listList, localDouble); + } } - cJSON *ran_unchanged_ind = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "ranUnchangedInd"); - + ran_unchanged_ind = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "ranUnchangedInd"); if (ran_unchanged_ind) { if (!cJSON_IsBool(ran_unchanged_ind)) { ogs_error("OpenAPI_sm_context_retrieve_data_parseFromJSON() failed [ran_unchanged_ind]"); @@ -179,6 +198,21 @@ OpenAPI_sm_context_retrieve_data_t *OpenAPI_sm_context_retrieve_data_parseFromJS return sm_context_retrieve_data_local_var; end: + if (target_mme_cap_local_nonprim) { + OpenAPI_mme_capabilities_free(target_mme_cap_local_nonprim); + target_mme_cap_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (not_to_transfer_ebi_listList) { + OpenAPI_list_for_each(not_to_transfer_ebi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(not_to_transfer_ebi_listList); + not_to_transfer_ebi_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_retrieved_data.c b/lib/sbi/openapi/model/sm_context_retrieved_data.c index 0d6946a37..fe151fc05 100644 --- a/lib/sbi/openapi/model/sm_context_retrieved_data.c +++ b/lib/sbi/openapi/model/sm_context_retrieved_data.c @@ -28,20 +28,34 @@ OpenAPI_sm_context_retrieved_data_t *OpenAPI_sm_context_retrieved_data_create( void OpenAPI_sm_context_retrieved_data_free(OpenAPI_sm_context_retrieved_data_t *sm_context_retrieved_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_retrieved_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(sm_context_retrieved_data->ue_eps_pdn_connection); - OpenAPI_sm_context_free(sm_context_retrieved_data->sm_context); - OpenAPI_small_data_rate_status_free(sm_context_retrieved_data->small_data_rate_status); - OpenAPI_apn_rate_status_free(sm_context_retrieved_data->apn_rate_status); + if (sm_context_retrieved_data->ue_eps_pdn_connection) { + ogs_free(sm_context_retrieved_data->ue_eps_pdn_connection); + sm_context_retrieved_data->ue_eps_pdn_connection = NULL; + } + if (sm_context_retrieved_data->sm_context) { + OpenAPI_sm_context_free(sm_context_retrieved_data->sm_context); + sm_context_retrieved_data->sm_context = NULL; + } + if (sm_context_retrieved_data->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(sm_context_retrieved_data->small_data_rate_status); + sm_context_retrieved_data->small_data_rate_status = NULL; + } + if (sm_context_retrieved_data->apn_rate_status) { + OpenAPI_apn_rate_status_free(sm_context_retrieved_data->apn_rate_status); + sm_context_retrieved_data->apn_rate_status = NULL; + } ogs_free(sm_context_retrieved_data); } cJSON *OpenAPI_sm_context_retrieved_data_convertToJSON(OpenAPI_sm_context_retrieved_data_t *sm_context_retrieved_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_retrieved_data == NULL) { ogs_error("OpenAPI_sm_context_retrieved_data_convertToJSON() failed [SmContextRetrievedData]"); @@ -49,6 +63,10 @@ cJSON *OpenAPI_sm_context_retrieved_data_convertToJSON(OpenAPI_sm_context_retrie } item = cJSON_CreateObject(); + if (!sm_context_retrieved_data->ue_eps_pdn_connection) { + ogs_error("OpenAPI_sm_context_retrieved_data_convertToJSON() failed [ue_eps_pdn_connection]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ueEpsPdnConnection", sm_context_retrieved_data->ue_eps_pdn_connection) == NULL) { ogs_error("OpenAPI_sm_context_retrieved_data_convertToJSON() failed [ue_eps_pdn_connection]"); goto end; @@ -107,40 +125,41 @@ end: OpenAPI_sm_context_retrieved_data_t *OpenAPI_sm_context_retrieved_data_parseFromJSON(cJSON *sm_context_retrieved_dataJSON) { OpenAPI_sm_context_retrieved_data_t *sm_context_retrieved_data_local_var = NULL; - cJSON *ue_eps_pdn_connection = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "ueEpsPdnConnection"); + OpenAPI_lnode_t *node = NULL; + cJSON *ue_eps_pdn_connection = NULL; + cJSON *sm_context = NULL; + OpenAPI_sm_context_t *sm_context_local_nonprim = NULL; + cJSON *small_data_rate_status = NULL; + OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + cJSON *apn_rate_status = NULL; + OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + cJSON *dl_data_waiting_ind = NULL; + ue_eps_pdn_connection = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "ueEpsPdnConnection"); if (!ue_eps_pdn_connection) { ogs_error("OpenAPI_sm_context_retrieved_data_parseFromJSON() failed [ue_eps_pdn_connection]"); goto end; } - if (!cJSON_IsString(ue_eps_pdn_connection)) { ogs_error("OpenAPI_sm_context_retrieved_data_parseFromJSON() failed [ue_eps_pdn_connection]"); goto end; } - cJSON *sm_context = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "smContext"); - - OpenAPI_sm_context_t *sm_context_local_nonprim = NULL; + sm_context = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "smContext"); if (sm_context) { sm_context_local_nonprim = OpenAPI_sm_context_parseFromJSON(sm_context); } - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "smallDataRateStatus"); - - OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "smallDataRateStatus"); if (small_data_rate_status) { small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); } - cJSON *apn_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "apnRateStatus"); - - OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + apn_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "apnRateStatus"); if (apn_rate_status) { apn_rate_status_local_nonprim = OpenAPI_apn_rate_status_parseFromJSON(apn_rate_status); } - cJSON *dl_data_waiting_ind = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "dlDataWaitingInd"); - + dl_data_waiting_ind = cJSON_GetObjectItemCaseSensitive(sm_context_retrieved_dataJSON, "dlDataWaitingInd"); if (dl_data_waiting_ind) { if (!cJSON_IsBool(dl_data_waiting_ind)) { ogs_error("OpenAPI_sm_context_retrieved_data_parseFromJSON() failed [dl_data_waiting_ind]"); @@ -159,6 +178,18 @@ OpenAPI_sm_context_retrieved_data_t *OpenAPI_sm_context_retrieved_data_parseFrom return sm_context_retrieved_data_local_var; end: + if (sm_context_local_nonprim) { + OpenAPI_sm_context_free(sm_context_local_nonprim); + sm_context_local_nonprim = NULL; + } + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } + if (apn_rate_status_local_nonprim) { + OpenAPI_apn_rate_status_free(apn_rate_status_local_nonprim); + apn_rate_status_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_status_notification.c b/lib/sbi/openapi/model/sm_context_status_notification.c index d0a15c26b..4ff50bb05 100644 --- a/lib/sbi/openapi/model/sm_context_status_notification.c +++ b/lib/sbi/openapi/model/sm_context_status_notification.c @@ -40,29 +40,61 @@ OpenAPI_sm_context_status_notification_t *OpenAPI_sm_context_status_notification void OpenAPI_sm_context_status_notification_free(OpenAPI_sm_context_status_notification_t *sm_context_status_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_status_notification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_status_info_free(sm_context_status_notification->status_info); - OpenAPI_small_data_rate_status_free(sm_context_status_notification->small_data_rate_status); - OpenAPI_apn_rate_status_free(sm_context_status_notification->apn_rate_status); - OpenAPI_list_for_each(sm_context_status_notification->notify_correlation_ids_forddn_failure, node) { - ogs_free(node->data); + if (sm_context_status_notification->status_info) { + OpenAPI_status_info_free(sm_context_status_notification->status_info); + sm_context_status_notification->status_info = NULL; + } + if (sm_context_status_notification->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(sm_context_status_notification->small_data_rate_status); + sm_context_status_notification->small_data_rate_status = NULL; + } + if (sm_context_status_notification->apn_rate_status) { + OpenAPI_apn_rate_status_free(sm_context_status_notification->apn_rate_status); + sm_context_status_notification->apn_rate_status = NULL; + } + if (sm_context_status_notification->notify_correlation_ids_forddn_failure) { + OpenAPI_list_for_each(sm_context_status_notification->notify_correlation_ids_forddn_failure, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_status_notification->notify_correlation_ids_forddn_failure); + sm_context_status_notification->notify_correlation_ids_forddn_failure = NULL; + } + if (sm_context_status_notification->new_smf_id) { + ogs_free(sm_context_status_notification->new_smf_id); + sm_context_status_notification->new_smf_id = NULL; + } + if (sm_context_status_notification->new_smf_set_id) { + ogs_free(sm_context_status_notification->new_smf_set_id); + sm_context_status_notification->new_smf_set_id = NULL; + } + if (sm_context_status_notification->old_smf_id) { + ogs_free(sm_context_status_notification->old_smf_id); + sm_context_status_notification->old_smf_id = NULL; + } + if (sm_context_status_notification->old_sm_context_ref) { + ogs_free(sm_context_status_notification->old_sm_context_ref); + sm_context_status_notification->old_sm_context_ref = NULL; + } + if (sm_context_status_notification->alt_anchor_smf_uri) { + ogs_free(sm_context_status_notification->alt_anchor_smf_uri); + sm_context_status_notification->alt_anchor_smf_uri = NULL; + } + if (sm_context_status_notification->alt_anchor_smf_id) { + ogs_free(sm_context_status_notification->alt_anchor_smf_id); + sm_context_status_notification->alt_anchor_smf_id = NULL; } - OpenAPI_list_free(sm_context_status_notification->notify_correlation_ids_forddn_failure); - ogs_free(sm_context_status_notification->new_smf_id); - ogs_free(sm_context_status_notification->new_smf_set_id); - ogs_free(sm_context_status_notification->old_smf_id); - ogs_free(sm_context_status_notification->old_sm_context_ref); - ogs_free(sm_context_status_notification->alt_anchor_smf_uri); - ogs_free(sm_context_status_notification->alt_anchor_smf_id); ogs_free(sm_context_status_notification); } cJSON *OpenAPI_sm_context_status_notification_convertToJSON(OpenAPI_sm_context_status_notification_t *sm_context_status_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_status_notification == NULL) { ogs_error("OpenAPI_sm_context_status_notification_convertToJSON() failed [SmContextStatusNotification]"); @@ -70,6 +102,10 @@ cJSON *OpenAPI_sm_context_status_notification_convertToJSON(OpenAPI_sm_context_s } item = cJSON_CreateObject(); + if (!sm_context_status_notification->status_info) { + ogs_error("OpenAPI_sm_context_status_notification_convertToJSON() failed [status_info]"); + return NULL; + } cJSON *status_info_local_JSON = OpenAPI_status_info_convertToJSON(sm_context_status_notification->status_info); if (status_info_local_JSON == NULL) { ogs_error("OpenAPI_sm_context_status_notification_convertToJSON() failed [status_info]"); @@ -115,19 +151,17 @@ cJSON *OpenAPI_sm_context_status_notification_convertToJSON(OpenAPI_sm_context_s } if (sm_context_status_notification->notify_correlation_ids_forddn_failure) { - cJSON *notify_correlation_ids_forddn_failure = cJSON_AddArrayToObject(item, "notifyCorrelationIdsForddnFailure"); - if (notify_correlation_ids_forddn_failure == NULL) { + cJSON *notify_correlation_ids_forddn_failureList = cJSON_AddArrayToObject(item, "notifyCorrelationIdsForddnFailure"); + if (notify_correlation_ids_forddn_failureList == NULL) { ogs_error("OpenAPI_sm_context_status_notification_convertToJSON() failed [notify_correlation_ids_forddn_failure]"); goto end; } - - OpenAPI_lnode_t *notify_correlation_ids_forddn_failure_node; - OpenAPI_list_for_each(sm_context_status_notification->notify_correlation_ids_forddn_failure, notify_correlation_ids_forddn_failure_node) { - if (cJSON_AddStringToObject(notify_correlation_ids_forddn_failure, "", (char*)notify_correlation_ids_forddn_failure_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_status_notification_convertToJSON() failed [notify_correlation_ids_forddn_failure]"); - goto end; + OpenAPI_list_for_each(sm_context_status_notification->notify_correlation_ids_forddn_failure, node) { + if (cJSON_AddStringToObject(notify_correlation_ids_forddn_failureList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_status_notification_convertToJSON() failed [notify_correlation_ids_forddn_failure]"); + goto end; + } } - } } if (sm_context_status_notification->new_smf_id) { @@ -179,31 +213,40 @@ end: OpenAPI_sm_context_status_notification_t *OpenAPI_sm_context_status_notification_parseFromJSON(cJSON *sm_context_status_notificationJSON) { OpenAPI_sm_context_status_notification_t *sm_context_status_notification_local_var = NULL; - cJSON *status_info = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "statusInfo"); + OpenAPI_lnode_t *node = NULL; + cJSON *status_info = NULL; + OpenAPI_status_info_t *status_info_local_nonprim = NULL; + cJSON *small_data_rate_status = NULL; + OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + cJSON *apn_rate_status = NULL; + OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + cJSON *ddn_failure_status = NULL; + cJSON *notify_correlation_ids_forddn_failure = NULL; + OpenAPI_list_t *notify_correlation_ids_forddn_failureList = NULL; + cJSON *new_smf_id = NULL; + cJSON *new_smf_set_id = NULL; + cJSON *old_smf_id = NULL; + cJSON *old_sm_context_ref = NULL; + cJSON *alt_anchor_smf_uri = NULL; + cJSON *alt_anchor_smf_id = NULL; + status_info = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "statusInfo"); if (!status_info) { ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [status_info]"); goto end; } - - OpenAPI_status_info_t *status_info_local_nonprim = NULL; status_info_local_nonprim = OpenAPI_status_info_parseFromJSON(status_info); - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "smallDataRateStatus"); - - OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "smallDataRateStatus"); if (small_data_rate_status) { small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); } - cJSON *apn_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "apnRateStatus"); - - OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + apn_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "apnRateStatus"); if (apn_rate_status) { apn_rate_status_local_nonprim = OpenAPI_apn_rate_status_parseFromJSON(apn_rate_status); } - cJSON *ddn_failure_status = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "ddnFailureStatus"); - + ddn_failure_status = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "ddnFailureStatus"); if (ddn_failure_status) { if (!cJSON_IsBool(ddn_failure_status)) { ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [ddn_failure_status]"); @@ -211,75 +254,70 @@ OpenAPI_sm_context_status_notification_t *OpenAPI_sm_context_status_notification } } - cJSON *notify_correlation_ids_forddn_failure = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "notifyCorrelationIdsForddnFailure"); - - OpenAPI_list_t *notify_correlation_ids_forddn_failureList; + notify_correlation_ids_forddn_failure = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "notifyCorrelationIdsForddnFailure"); if (notify_correlation_ids_forddn_failure) { - cJSON *notify_correlation_ids_forddn_failure_local; - if (!cJSON_IsArray(notify_correlation_ids_forddn_failure)) { - ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [notify_correlation_ids_forddn_failure]"); - goto end; - } - notify_correlation_ids_forddn_failureList = OpenAPI_list_create(); + cJSON *notify_correlation_ids_forddn_failure_local = NULL; + if (!cJSON_IsArray(notify_correlation_ids_forddn_failure)) { + ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [notify_correlation_ids_forddn_failure]"); + goto end; + } - cJSON_ArrayForEach(notify_correlation_ids_forddn_failure_local, notify_correlation_ids_forddn_failure) { - if (!cJSON_IsString(notify_correlation_ids_forddn_failure_local)) { - ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [notify_correlation_ids_forddn_failure]"); - goto end; - } - OpenAPI_list_add(notify_correlation_ids_forddn_failureList, ogs_strdup(notify_correlation_ids_forddn_failure_local->valuestring)); - } + notify_correlation_ids_forddn_failureList = OpenAPI_list_create(); + + cJSON_ArrayForEach(notify_correlation_ids_forddn_failure_local, notify_correlation_ids_forddn_failure) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(notify_correlation_ids_forddn_failure_local)) { + ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [notify_correlation_ids_forddn_failure]"); + goto end; + } + OpenAPI_list_add(notify_correlation_ids_forddn_failureList, ogs_strdup(notify_correlation_ids_forddn_failure_local->valuestring)); + } } - cJSON *new_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "newSmfId"); - + new_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "newSmfId"); if (new_smf_id) { - if (!cJSON_IsString(new_smf_id)) { + if (!cJSON_IsString(new_smf_id) && !cJSON_IsNull(new_smf_id)) { ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [new_smf_id]"); goto end; } } - cJSON *new_smf_set_id = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "newSmfSetId"); - + new_smf_set_id = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "newSmfSetId"); if (new_smf_set_id) { - if (!cJSON_IsString(new_smf_set_id)) { + if (!cJSON_IsString(new_smf_set_id) && !cJSON_IsNull(new_smf_set_id)) { ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [new_smf_set_id]"); goto end; } } - cJSON *old_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "oldSmfId"); - + old_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "oldSmfId"); if (old_smf_id) { - if (!cJSON_IsString(old_smf_id)) { + if (!cJSON_IsString(old_smf_id) && !cJSON_IsNull(old_smf_id)) { ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [old_smf_id]"); goto end; } } - cJSON *old_sm_context_ref = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "oldSmContextRef"); - + old_sm_context_ref = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "oldSmContextRef"); if (old_sm_context_ref) { - if (!cJSON_IsString(old_sm_context_ref)) { + if (!cJSON_IsString(old_sm_context_ref) && !cJSON_IsNull(old_sm_context_ref)) { ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [old_sm_context_ref]"); goto end; } } - cJSON *alt_anchor_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "altAnchorSmfUri"); - + alt_anchor_smf_uri = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "altAnchorSmfUri"); if (alt_anchor_smf_uri) { - if (!cJSON_IsString(alt_anchor_smf_uri)) { + if (!cJSON_IsString(alt_anchor_smf_uri) && !cJSON_IsNull(alt_anchor_smf_uri)) { ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [alt_anchor_smf_uri]"); goto end; } } - cJSON *alt_anchor_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "altAnchorSmfId"); - + alt_anchor_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_status_notificationJSON, "altAnchorSmfId"); if (alt_anchor_smf_id) { - if (!cJSON_IsString(alt_anchor_smf_id)) { + if (!cJSON_IsString(alt_anchor_smf_id) && !cJSON_IsNull(alt_anchor_smf_id)) { ogs_error("OpenAPI_sm_context_status_notification_parseFromJSON() failed [alt_anchor_smf_id]"); goto end; } @@ -292,16 +330,35 @@ OpenAPI_sm_context_status_notification_t *OpenAPI_sm_context_status_notification ddn_failure_status ? true : false, ddn_failure_status ? ddn_failure_status->valueint : 0, notify_correlation_ids_forddn_failure ? notify_correlation_ids_forddn_failureList : NULL, - new_smf_id ? ogs_strdup(new_smf_id->valuestring) : NULL, - new_smf_set_id ? ogs_strdup(new_smf_set_id->valuestring) : NULL, - old_smf_id ? ogs_strdup(old_smf_id->valuestring) : NULL, - old_sm_context_ref ? ogs_strdup(old_sm_context_ref->valuestring) : NULL, - alt_anchor_smf_uri ? ogs_strdup(alt_anchor_smf_uri->valuestring) : NULL, - alt_anchor_smf_id ? ogs_strdup(alt_anchor_smf_id->valuestring) : NULL + new_smf_id && !cJSON_IsNull(new_smf_id) ? ogs_strdup(new_smf_id->valuestring) : NULL, + new_smf_set_id && !cJSON_IsNull(new_smf_set_id) ? ogs_strdup(new_smf_set_id->valuestring) : NULL, + old_smf_id && !cJSON_IsNull(old_smf_id) ? ogs_strdup(old_smf_id->valuestring) : NULL, + old_sm_context_ref && !cJSON_IsNull(old_sm_context_ref) ? ogs_strdup(old_sm_context_ref->valuestring) : NULL, + alt_anchor_smf_uri && !cJSON_IsNull(alt_anchor_smf_uri) ? ogs_strdup(alt_anchor_smf_uri->valuestring) : NULL, + alt_anchor_smf_id && !cJSON_IsNull(alt_anchor_smf_id) ? ogs_strdup(alt_anchor_smf_id->valuestring) : NULL ); return sm_context_status_notification_local_var; end: + if (status_info_local_nonprim) { + OpenAPI_status_info_free(status_info_local_nonprim); + status_info_local_nonprim = NULL; + } + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } + if (apn_rate_status_local_nonprim) { + OpenAPI_apn_rate_status_free(apn_rate_status_local_nonprim); + apn_rate_status_local_nonprim = NULL; + } + if (notify_correlation_ids_forddn_failureList) { + OpenAPI_list_for_each(notify_correlation_ids_forddn_failureList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(notify_correlation_ids_forddn_failureList); + notify_correlation_ids_forddn_failureList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_update_data.c b/lib/sbi/openapi/model/sm_context_update_data.c index dd71c06b4..7a4ff5e07 100644 --- a/lib/sbi/openapi/model/sm_context_update_data.c +++ b/lib/sbi/openapi/model/sm_context_update_data.c @@ -60,7 +60,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_create( OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter, bool is_extended_nas_sm_timer_ind, int extended_nas_sm_timer_ind, - char forwarding_f_teid, + char *forwarding_f_teid, OpenAPI_list_t *forwarding_bearer_contexts, OpenAPI_ddn_failure_subs_t *ddn_failure_subs ) @@ -132,61 +132,148 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_create( void OpenAPI_sm_context_update_data_free(OpenAPI_sm_context_update_data_t *sm_context_update_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_update_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(sm_context_update_data->pei); - ogs_free(sm_context_update_data->serving_nf_id); - OpenAPI_guami_free(sm_context_update_data->guami); - OpenAPI_plmn_id_nid_free(sm_context_update_data->serving_network); - OpenAPI_list_for_each(sm_context_update_data->backup_amf_info, node) { - OpenAPI_backup_amf_info_free(node->data); + if (sm_context_update_data->pei) { + ogs_free(sm_context_update_data->pei); + sm_context_update_data->pei = NULL; } - OpenAPI_list_free(sm_context_update_data->backup_amf_info); - OpenAPI_user_location_free(sm_context_update_data->ue_location); - ogs_free(sm_context_update_data->ue_time_zone); - OpenAPI_user_location_free(sm_context_update_data->add_ue_location); - OpenAPI_ref_to_binary_data_free(sm_context_update_data->n1_sm_msg); - OpenAPI_ref_to_binary_data_free(sm_context_update_data->n2_sm_info); - OpenAPI_ng_ran_target_id_free(sm_context_update_data->target_id); - ogs_free(sm_context_update_data->target_serving_nf_id); - ogs_free(sm_context_update_data->sm_context_status_uri); - OpenAPI_tunnel_info_free(sm_context_update_data->n9_forwarding_tunnel); - OpenAPI_list_for_each(sm_context_update_data->n9_dl_forwarding_tnl_list, node) { - OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + if (sm_context_update_data->serving_nf_id) { + ogs_free(sm_context_update_data->serving_nf_id); + sm_context_update_data->serving_nf_id = NULL; } - OpenAPI_list_free(sm_context_update_data->n9_dl_forwarding_tnl_list); - OpenAPI_list_for_each(sm_context_update_data->n9_ul_forwarding_tnl_list, node) { - OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + if (sm_context_update_data->guami) { + OpenAPI_guami_free(sm_context_update_data->guami); + sm_context_update_data->guami = NULL; } - OpenAPI_list_free(sm_context_update_data->n9_ul_forwarding_tnl_list); - OpenAPI_list_for_each(sm_context_update_data->eps_bearer_setup, node) { - ogs_free(node->data); + if (sm_context_update_data->serving_network) { + OpenAPI_plmn_id_nid_free(sm_context_update_data->serving_network); + sm_context_update_data->serving_network = NULL; } - OpenAPI_list_free(sm_context_update_data->eps_bearer_setup); - OpenAPI_list_for_each(sm_context_update_data->revoke_ebi_list, node) { - ogs_free(node->data); + if (sm_context_update_data->backup_amf_info) { + OpenAPI_list_for_each(sm_context_update_data->backup_amf_info, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(sm_context_update_data->backup_amf_info); + sm_context_update_data->backup_amf_info = NULL; } - OpenAPI_list_free(sm_context_update_data->revoke_ebi_list); - OpenAPI_ng_ap_cause_free(sm_context_update_data->ng_ap_cause); - OpenAPI_snssai_free(sm_context_update_data->s_nssai); - OpenAPI_trace_data_free(sm_context_update_data->trace_data); - OpenAPI_ref_to_binary_data_free(sm_context_update_data->n2_sm_info_ext1); - OpenAPI_exemption_ind_free(sm_context_update_data->exemption_ind); - ogs_free(sm_context_update_data->supported_features); - OpenAPI_mo_exp_data_counter_free(sm_context_update_data->mo_exp_data_counter); - OpenAPI_list_for_each(sm_context_update_data->forwarding_bearer_contexts, node) { - ogs_free(node->data); + if (sm_context_update_data->ue_location) { + OpenAPI_user_location_free(sm_context_update_data->ue_location); + sm_context_update_data->ue_location = NULL; + } + if (sm_context_update_data->ue_time_zone) { + ogs_free(sm_context_update_data->ue_time_zone); + sm_context_update_data->ue_time_zone = NULL; + } + if (sm_context_update_data->add_ue_location) { + OpenAPI_user_location_free(sm_context_update_data->add_ue_location); + sm_context_update_data->add_ue_location = NULL; + } + if (sm_context_update_data->n1_sm_msg) { + OpenAPI_ref_to_binary_data_free(sm_context_update_data->n1_sm_msg); + sm_context_update_data->n1_sm_msg = NULL; + } + if (sm_context_update_data->n2_sm_info) { + OpenAPI_ref_to_binary_data_free(sm_context_update_data->n2_sm_info); + sm_context_update_data->n2_sm_info = NULL; + } + if (sm_context_update_data->target_id) { + OpenAPI_ng_ran_target_id_free(sm_context_update_data->target_id); + sm_context_update_data->target_id = NULL; + } + if (sm_context_update_data->target_serving_nf_id) { + ogs_free(sm_context_update_data->target_serving_nf_id); + sm_context_update_data->target_serving_nf_id = NULL; + } + if (sm_context_update_data->sm_context_status_uri) { + ogs_free(sm_context_update_data->sm_context_status_uri); + sm_context_update_data->sm_context_status_uri = NULL; + } + if (sm_context_update_data->n9_forwarding_tunnel) { + OpenAPI_tunnel_info_free(sm_context_update_data->n9_forwarding_tunnel); + sm_context_update_data->n9_forwarding_tunnel = NULL; + } + if (sm_context_update_data->n9_dl_forwarding_tnl_list) { + OpenAPI_list_for_each(sm_context_update_data->n9_dl_forwarding_tnl_list, node) { + OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + } + OpenAPI_list_free(sm_context_update_data->n9_dl_forwarding_tnl_list); + sm_context_update_data->n9_dl_forwarding_tnl_list = NULL; + } + if (sm_context_update_data->n9_ul_forwarding_tnl_list) { + OpenAPI_list_for_each(sm_context_update_data->n9_ul_forwarding_tnl_list, node) { + OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + } + OpenAPI_list_free(sm_context_update_data->n9_ul_forwarding_tnl_list); + sm_context_update_data->n9_ul_forwarding_tnl_list = NULL; + } + if (sm_context_update_data->eps_bearer_setup) { + OpenAPI_list_for_each(sm_context_update_data->eps_bearer_setup, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_update_data->eps_bearer_setup); + sm_context_update_data->eps_bearer_setup = NULL; + } + if (sm_context_update_data->revoke_ebi_list) { + OpenAPI_list_for_each(sm_context_update_data->revoke_ebi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_update_data->revoke_ebi_list); + sm_context_update_data->revoke_ebi_list = NULL; + } + if (sm_context_update_data->ng_ap_cause) { + OpenAPI_ng_ap_cause_free(sm_context_update_data->ng_ap_cause); + sm_context_update_data->ng_ap_cause = NULL; + } + if (sm_context_update_data->s_nssai) { + OpenAPI_snssai_free(sm_context_update_data->s_nssai); + sm_context_update_data->s_nssai = NULL; + } + if (sm_context_update_data->trace_data) { + OpenAPI_trace_data_free(sm_context_update_data->trace_data); + sm_context_update_data->trace_data = NULL; + } + if (sm_context_update_data->n2_sm_info_ext1) { + OpenAPI_ref_to_binary_data_free(sm_context_update_data->n2_sm_info_ext1); + sm_context_update_data->n2_sm_info_ext1 = NULL; + } + if (sm_context_update_data->exemption_ind) { + OpenAPI_exemption_ind_free(sm_context_update_data->exemption_ind); + sm_context_update_data->exemption_ind = NULL; + } + if (sm_context_update_data->supported_features) { + ogs_free(sm_context_update_data->supported_features); + sm_context_update_data->supported_features = NULL; + } + if (sm_context_update_data->mo_exp_data_counter) { + OpenAPI_mo_exp_data_counter_free(sm_context_update_data->mo_exp_data_counter); + sm_context_update_data->mo_exp_data_counter = NULL; + } + if (sm_context_update_data->forwarding_f_teid) { + ogs_free(sm_context_update_data->forwarding_f_teid); + sm_context_update_data->forwarding_f_teid = NULL; + } + if (sm_context_update_data->forwarding_bearer_contexts) { + OpenAPI_list_for_each(sm_context_update_data->forwarding_bearer_contexts, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_update_data->forwarding_bearer_contexts); + sm_context_update_data->forwarding_bearer_contexts = NULL; + } + if (sm_context_update_data->ddn_failure_subs) { + OpenAPI_ddn_failure_subs_free(sm_context_update_data->ddn_failure_subs); + sm_context_update_data->ddn_failure_subs = NULL; } - OpenAPI_list_free(sm_context_update_data->forwarding_bearer_contexts); - OpenAPI_ddn_failure_subs_free(sm_context_update_data->ddn_failure_subs); ogs_free(sm_context_update_data); } cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_data_t *sm_context_update_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_update_data == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [SmContextUpdateData]"); @@ -240,49 +327,45 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [backup_amf_info]"); goto end; } - - OpenAPI_lnode_t *backup_amf_info_node; - if (sm_context_update_data->backup_amf_info) { - OpenAPI_list_for_each(sm_context_update_data->backup_amf_info, backup_amf_info_node) { - cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [backup_amf_info]"); - goto end; - } - cJSON_AddItemToArray(backup_amf_infoList, itemLocal); + OpenAPI_list_for_each(sm_context_update_data->backup_amf_info, node) { + cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [backup_amf_info]"); + goto end; } + cJSON_AddItemToArray(backup_amf_infoList, itemLocal); } } - if (sm_context_update_data->an_type) { + if (sm_context_update_data->an_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "anType", OpenAPI_access_type_ToString(sm_context_update_data->an_type)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [an_type]"); goto end; } } - if (sm_context_update_data->additional_an_type) { + if (sm_context_update_data->additional_an_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "additionalAnType", OpenAPI_access_type_ToString(sm_context_update_data->additional_an_type)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [additional_an_type]"); goto end; } } - if (sm_context_update_data->an_type_to_reactivate) { + if (sm_context_update_data->an_type_to_reactivate != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "anTypeToReactivate", OpenAPI_access_type_ToString(sm_context_update_data->an_type_to_reactivate)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [an_type_to_reactivate]"); goto end; } } - if (sm_context_update_data->rat_type) { + if (sm_context_update_data->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(sm_context_update_data->rat_type)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [rat_type]"); goto end; } } - if (sm_context_update_data->presence_in_ladn) { + if (sm_context_update_data->presence_in_ladn != OpenAPI_presence_state_NULL) { if (cJSON_AddStringToObject(item, "presenceInLadn", OpenAPI_presence_state_ToString(sm_context_update_data->presence_in_ladn)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [presence_in_ladn]"); goto end; @@ -322,14 +405,14 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da } } - if (sm_context_update_data->up_cnx_state) { + if (sm_context_update_data->up_cnx_state != OpenAPI_up_cnx_state_NULL) { if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_update_data->up_cnx_state)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [up_cnx_state]"); goto end; } } - if (sm_context_update_data->ho_state) { + if (sm_context_update_data->ho_state != OpenAPI_ho_state_NULL) { if (cJSON_AddStringToObject(item, "hoState", OpenAPI_ho_state_ToString(sm_context_update_data->ho_state)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [ho_state]"); goto end; @@ -376,7 +459,7 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da } } - if (sm_context_update_data->n2_sm_info_type) { + if (sm_context_update_data->n2_sm_info_type != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoType", OpenAPI_n2_sm_info_type_ToString(sm_context_update_data->n2_sm_info_type)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [n2_sm_info_type]"); goto end; @@ -436,17 +519,13 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [n9_dl_forwarding_tnl_list]"); goto end; } - - OpenAPI_lnode_t *n9_dl_forwarding_tnl_list_node; - if (sm_context_update_data->n9_dl_forwarding_tnl_list) { - OpenAPI_list_for_each(sm_context_update_data->n9_dl_forwarding_tnl_list, n9_dl_forwarding_tnl_list_node) { - cJSON *itemLocal = OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(n9_dl_forwarding_tnl_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [n9_dl_forwarding_tnl_list]"); - goto end; - } - cJSON_AddItemToArray(n9_dl_forwarding_tnl_listList, itemLocal); + OpenAPI_list_for_each(sm_context_update_data->n9_dl_forwarding_tnl_list, node) { + cJSON *itemLocal = OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [n9_dl_forwarding_tnl_list]"); + goto end; } + cJSON_AddItemToArray(n9_dl_forwarding_tnl_listList, itemLocal); } } @@ -456,50 +535,42 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [n9_ul_forwarding_tnl_list]"); goto end; } - - OpenAPI_lnode_t *n9_ul_forwarding_tnl_list_node; - if (sm_context_update_data->n9_ul_forwarding_tnl_list) { - OpenAPI_list_for_each(sm_context_update_data->n9_ul_forwarding_tnl_list, n9_ul_forwarding_tnl_list_node) { - cJSON *itemLocal = OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(n9_ul_forwarding_tnl_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [n9_ul_forwarding_tnl_list]"); - goto end; - } - cJSON_AddItemToArray(n9_ul_forwarding_tnl_listList, itemLocal); + OpenAPI_list_for_each(sm_context_update_data->n9_ul_forwarding_tnl_list, node) { + cJSON *itemLocal = OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [n9_ul_forwarding_tnl_list]"); + goto end; } + cJSON_AddItemToArray(n9_ul_forwarding_tnl_listList, itemLocal); } } if (sm_context_update_data->eps_bearer_setup) { - cJSON *eps_bearer_setup = cJSON_AddArrayToObject(item, "epsBearerSetup"); - if (eps_bearer_setup == NULL) { + cJSON *eps_bearer_setupList = cJSON_AddArrayToObject(item, "epsBearerSetup"); + if (eps_bearer_setupList == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [eps_bearer_setup]"); goto end; } - - OpenAPI_lnode_t *eps_bearer_setup_node; - OpenAPI_list_for_each(sm_context_update_data->eps_bearer_setup, eps_bearer_setup_node) { - if (cJSON_AddStringToObject(eps_bearer_setup, "", (char*)eps_bearer_setup_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [eps_bearer_setup]"); - goto end; + OpenAPI_list_for_each(sm_context_update_data->eps_bearer_setup, node) { + if (cJSON_AddStringToObject(eps_bearer_setupList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [eps_bearer_setup]"); + goto end; + } } - } } if (sm_context_update_data->revoke_ebi_list) { - cJSON *revoke_ebi_list = cJSON_AddArrayToObject(item, "revokeEbiList"); - if (revoke_ebi_list == NULL) { + cJSON *revoke_ebi_listList = cJSON_AddArrayToObject(item, "revokeEbiList"); + if (revoke_ebi_listList == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [revoke_ebi_list]"); goto end; } - - OpenAPI_lnode_t *revoke_ebi_list_node; - OpenAPI_list_for_each(sm_context_update_data->revoke_ebi_list, revoke_ebi_list_node) { - if (cJSON_AddNumberToObject(revoke_ebi_list, "", *(double *)revoke_ebi_list_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [revoke_ebi_list]"); - goto end; + OpenAPI_list_for_each(sm_context_update_data->revoke_ebi_list, node) { + if (cJSON_AddNumberToObject(revoke_ebi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [revoke_ebi_list]"); + goto end; + } } - } } if (sm_context_update_data->is_release) { @@ -509,7 +580,7 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da } } - if (sm_context_update_data->cause) { + if (sm_context_update_data->cause != OpenAPI_cause_NULL) { if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(sm_context_update_data->cause)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [cause]"); goto end; @@ -562,7 +633,7 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da } } - if (sm_context_update_data->eps_interworking_ind) { + if (sm_context_update_data->eps_interworking_ind != OpenAPI_eps_interworking_indication_NULL) { if (cJSON_AddStringToObject(item, "epsInterworkingInd", OpenAPI_eps_interworking_indication_ToString(sm_context_update_data->eps_interworking_ind)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [eps_interworking_ind]"); goto end; @@ -589,14 +660,14 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da } } - if (sm_context_update_data->n2_sm_info_type_ext1) { + if (sm_context_update_data->n2_sm_info_type_ext1 != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoTypeExt1", OpenAPI_n2_sm_info_type_ToString(sm_context_update_data->n2_sm_info_type_ext1)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [n2_sm_info_type_ext1]"); goto end; } } - if (sm_context_update_data->ma_release_ind) { + if (sm_context_update_data->ma_release_ind != OpenAPI_ma_release_indication_NULL) { if (cJSON_AddStringToObject(item, "maReleaseInd", OpenAPI_ma_release_indication_ToString(sm_context_update_data->ma_release_ind)) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [ma_release_ind]"); goto end; @@ -658,26 +729,24 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da } if (sm_context_update_data->forwarding_f_teid) { - if (cJSON_AddNumberToObject(item, "forwardingFTeid", sm_context_update_data->forwarding_f_teid) == NULL) { + if (cJSON_AddStringToObject(item, "forwardingFTeid", sm_context_update_data->forwarding_f_teid) == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [forwarding_f_teid]"); goto end; } } if (sm_context_update_data->forwarding_bearer_contexts) { - cJSON *forwarding_bearer_contexts = cJSON_AddArrayToObject(item, "forwardingBearerContexts"); - if (forwarding_bearer_contexts == NULL) { + cJSON *forwarding_bearer_contextsList = cJSON_AddArrayToObject(item, "forwardingBearerContexts"); + if (forwarding_bearer_contextsList == NULL) { ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [forwarding_bearer_contexts]"); goto end; } - - OpenAPI_lnode_t *forwarding_bearer_contexts_node; - OpenAPI_list_for_each(sm_context_update_data->forwarding_bearer_contexts, forwarding_bearer_contexts_node) { - if (cJSON_AddStringToObject(forwarding_bearer_contexts, "", (char*)forwarding_bearer_contexts_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [forwarding_bearer_contexts]"); - goto end; + OpenAPI_list_for_each(sm_context_update_data->forwarding_bearer_contexts, node) { + if (cJSON_AddStringToObject(forwarding_bearer_contextsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [forwarding_bearer_contexts]"); + goto end; + } } - } } if (sm_context_update_data->ddn_failure_subs) { @@ -700,70 +769,141 @@ end: OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(cJSON *sm_context_update_dataJSON) { OpenAPI_sm_context_update_data_t *sm_context_update_data_local_var = NULL; - cJSON *pei = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "pei"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pei = NULL; + cJSON *serving_nf_id = NULL; + cJSON *guami = NULL; + OpenAPI_guami_t *guami_local_nonprim = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + cJSON *backup_amf_info = NULL; + OpenAPI_list_t *backup_amf_infoList = NULL; + cJSON *an_type = NULL; + OpenAPI_access_type_e an_typeVariable = 0; + cJSON *additional_an_type = NULL; + OpenAPI_access_type_e additional_an_typeVariable = 0; + cJSON *an_type_to_reactivate = NULL; + OpenAPI_access_type_e an_type_to_reactivateVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *presence_in_ladn = NULL; + OpenAPI_presence_state_e presence_in_ladnVariable = 0; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *add_ue_location = NULL; + OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + cJSON *up_cnx_state = NULL; + OpenAPI_up_cnx_state_e up_cnx_stateVariable = 0; + cJSON *ho_state = NULL; + OpenAPI_ho_state_e ho_stateVariable = 0; + cJSON *to_be_switched = NULL; + cJSON *failed_to_be_switched = NULL; + cJSON *n1_sm_msg = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + cJSON *n2_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + cJSON *n2_sm_info_type = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable = 0; + cJSON *target_id = NULL; + OpenAPI_ng_ran_target_id_t *target_id_local_nonprim = NULL; + cJSON *target_serving_nf_id = NULL; + cJSON *sm_context_status_uri = NULL; + cJSON *data_forwarding = NULL; + cJSON *n9_forwarding_tunnel = NULL; + OpenAPI_tunnel_info_t *n9_forwarding_tunnel_local_nonprim = NULL; + cJSON *n9_dl_forwarding_tnl_list = NULL; + OpenAPI_list_t *n9_dl_forwarding_tnl_listList = NULL; + cJSON *n9_ul_forwarding_tnl_list = NULL; + OpenAPI_list_t *n9_ul_forwarding_tnl_listList = NULL; + cJSON *eps_bearer_setup = NULL; + OpenAPI_list_t *eps_bearer_setupList = NULL; + cJSON *revoke_ebi_list = NULL; + OpenAPI_list_t *revoke_ebi_listList = NULL; + cJSON *release = NULL; + cJSON *cause = NULL; + OpenAPI_cause_e causeVariable = 0; + cJSON *ng_ap_cause = NULL; + OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + cJSON *_5g_mm_cause_value = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *eps_interworking_ind = NULL; + OpenAPI_eps_interworking_indication_e eps_interworking_indVariable = 0; + cJSON *an_type_can_be_changed = NULL; + cJSON *n2_sm_info_ext1 = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_ext1_local_nonprim = NULL; + cJSON *n2_sm_info_type_ext1 = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1Variable = 0; + cJSON *ma_release_ind = NULL; + OpenAPI_ma_release_indication_e ma_release_indVariable = 0; + cJSON *ma_nw_upgrade_ind = NULL; + cJSON *ma_request_ind = NULL; + cJSON *exemption_ind = NULL; + OpenAPI_exemption_ind_t *exemption_ind_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *mo_exp_data_counter = NULL; + OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + cJSON *extended_nas_sm_timer_ind = NULL; + cJSON *forwarding_f_teid = NULL; + cJSON *forwarding_bearer_contexts = NULL; + OpenAPI_list_t *forwarding_bearer_contextsList = NULL; + cJSON *ddn_failure_subs = NULL; + OpenAPI_ddn_failure_subs_t *ddn_failure_subs_local_nonprim = NULL; + pei = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [pei]"); goto end; } } - cJSON *serving_nf_id = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "servingNfId"); - + serving_nf_id = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "servingNfId"); if (serving_nf_id) { - if (!cJSON_IsString(serving_nf_id)) { + if (!cJSON_IsString(serving_nf_id) && !cJSON_IsNull(serving_nf_id)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [serving_nf_id]"); goto end; } } - cJSON *guami = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "guami"); - - OpenAPI_guami_t *guami_local_nonprim = NULL; + guami = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "guami"); if (guami) { guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami); } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "servingNetwork"); - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + serving_network = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "servingNetwork"); if (serving_network) { serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); } - cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "backupAmfInfo"); - - OpenAPI_list_t *backup_amf_infoList; + backup_amf_info = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "backupAmfInfo"); if (backup_amf_info) { - cJSON *backup_amf_info_local_nonprimitive; - if (!cJSON_IsArray(backup_amf_info)){ - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [backup_amf_info]"); - goto end; - } - - backup_amf_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) { - if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) { + cJSON *backup_amf_info_local = NULL; + if (!cJSON_IsArray(backup_amf_info)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [backup_amf_info]"); goto end; } - OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive); - if (!backup_amf_infoItem) { - ogs_error("No backup_amf_infoItem"); - OpenAPI_list_free(backup_amf_infoList); - goto end; + backup_amf_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) { + if (!cJSON_IsObject(backup_amf_info_local)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [backup_amf_info]"); + goto end; + } + OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local); + if (!backup_amf_infoItem) { + ogs_error("No backup_amf_infoItem"); + OpenAPI_list_free(backup_amf_infoList); + goto end; + } + OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); } - - OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem); - } } - cJSON *an_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "anType"); - - OpenAPI_access_type_e an_typeVariable; + an_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "anType"); if (an_type) { if (!cJSON_IsString(an_type)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [an_type]"); @@ -772,9 +912,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c an_typeVariable = OpenAPI_access_type_FromString(an_type->valuestring); } - cJSON *additional_an_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "additionalAnType"); - - OpenAPI_access_type_e additional_an_typeVariable; + additional_an_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "additionalAnType"); if (additional_an_type) { if (!cJSON_IsString(additional_an_type)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [additional_an_type]"); @@ -783,9 +921,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c additional_an_typeVariable = OpenAPI_access_type_FromString(additional_an_type->valuestring); } - cJSON *an_type_to_reactivate = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "anTypeToReactivate"); - - OpenAPI_access_type_e an_type_to_reactivateVariable; + an_type_to_reactivate = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "anTypeToReactivate"); if (an_type_to_reactivate) { if (!cJSON_IsString(an_type_to_reactivate)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [an_type_to_reactivate]"); @@ -794,9 +930,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c an_type_to_reactivateVariable = OpenAPI_access_type_FromString(an_type_to_reactivate->valuestring); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [rat_type]"); @@ -805,9 +939,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *presence_in_ladn = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "presenceInLadn"); - - OpenAPI_presence_state_e presence_in_ladnVariable; + presence_in_ladn = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "presenceInLadn"); if (presence_in_ladn) { if (!cJSON_IsString(presence_in_ladn)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [presence_in_ladn]"); @@ -816,32 +948,25 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c presence_in_ladnVariable = OpenAPI_presence_state_FromString(presence_in_ladn->valuestring); } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *add_ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "addUeLocation"); - - OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + add_ue_location = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "addUeLocation"); if (add_ue_location) { add_ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(add_ue_location); } - cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "upCnxState"); - - OpenAPI_up_cnx_state_e up_cnx_stateVariable; + up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "upCnxState"); if (up_cnx_state) { if (!cJSON_IsString(up_cnx_state)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [up_cnx_state]"); @@ -850,9 +975,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring); } - cJSON *ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "hoState"); - - OpenAPI_ho_state_e ho_stateVariable; + ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "hoState"); if (ho_state) { if (!cJSON_IsString(ho_state)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [ho_state]"); @@ -861,8 +984,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c ho_stateVariable = OpenAPI_ho_state_FromString(ho_state->valuestring); } - cJSON *to_be_switched = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "toBeSwitched"); - + to_be_switched = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "toBeSwitched"); if (to_be_switched) { if (!cJSON_IsBool(to_be_switched)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [to_be_switched]"); @@ -870,8 +992,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *failed_to_be_switched = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "failedToBeSwitched"); - + failed_to_be_switched = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "failedToBeSwitched"); if (failed_to_be_switched) { if (!cJSON_IsBool(failed_to_be_switched)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [failed_to_be_switched]"); @@ -879,23 +1000,17 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n1SmMsg"); - - OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n1SmMsg"); if (n1_sm_msg) { n1_sm_msg_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_msg); } - cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n2SmInfo"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n2SmInfo"); if (n2_sm_info) { n2_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info); } - cJSON *n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n2SmInfoType"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable; + n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n2SmInfoType"); if (n2_sm_info_type) { if (!cJSON_IsString(n2_sm_info_type)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [n2_sm_info_type]"); @@ -904,33 +1019,28 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c n2_sm_info_typeVariable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type->valuestring); } - cJSON *target_id = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "targetId"); - - OpenAPI_ng_ran_target_id_t *target_id_local_nonprim = NULL; + target_id = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "targetId"); if (target_id) { target_id_local_nonprim = OpenAPI_ng_ran_target_id_parseFromJSON(target_id); } - cJSON *target_serving_nf_id = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "targetServingNfId"); - + target_serving_nf_id = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "targetServingNfId"); if (target_serving_nf_id) { - if (!cJSON_IsString(target_serving_nf_id)) { + if (!cJSON_IsString(target_serving_nf_id) && !cJSON_IsNull(target_serving_nf_id)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [target_serving_nf_id]"); goto end; } } - cJSON *sm_context_status_uri = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "smContextStatusUri"); - + sm_context_status_uri = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "smContextStatusUri"); if (sm_context_status_uri) { - if (!cJSON_IsString(sm_context_status_uri)) { + if (!cJSON_IsString(sm_context_status_uri) && !cJSON_IsNull(sm_context_status_uri)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [sm_context_status_uri]"); goto end; } } - cJSON *data_forwarding = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "dataForwarding"); - + data_forwarding = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "dataForwarding"); if (data_forwarding) { if (!cJSON_IsBool(data_forwarding)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [data_forwarding]"); @@ -938,113 +1048,110 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *n9_forwarding_tunnel = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n9ForwardingTunnel"); - - OpenAPI_tunnel_info_t *n9_forwarding_tunnel_local_nonprim = NULL; + n9_forwarding_tunnel = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n9ForwardingTunnel"); if (n9_forwarding_tunnel) { n9_forwarding_tunnel_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(n9_forwarding_tunnel); } - cJSON *n9_dl_forwarding_tnl_list = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n9DlForwardingTnlList"); - - OpenAPI_list_t *n9_dl_forwarding_tnl_listList; + n9_dl_forwarding_tnl_list = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n9DlForwardingTnlList"); if (n9_dl_forwarding_tnl_list) { - cJSON *n9_dl_forwarding_tnl_list_local_nonprimitive; - if (!cJSON_IsArray(n9_dl_forwarding_tnl_list)){ - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [n9_dl_forwarding_tnl_list]"); - goto end; - } - - n9_dl_forwarding_tnl_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(n9_dl_forwarding_tnl_list_local_nonprimitive, n9_dl_forwarding_tnl_list ) { - if (!cJSON_IsObject(n9_dl_forwarding_tnl_list_local_nonprimitive)) { + cJSON *n9_dl_forwarding_tnl_list_local = NULL; + if (!cJSON_IsArray(n9_dl_forwarding_tnl_list)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [n9_dl_forwarding_tnl_list]"); goto end; } - OpenAPI_indirect_data_forwarding_tunnel_info_t *n9_dl_forwarding_tnl_listItem = OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(n9_dl_forwarding_tnl_list_local_nonprimitive); - if (!n9_dl_forwarding_tnl_listItem) { - ogs_error("No n9_dl_forwarding_tnl_listItem"); - OpenAPI_list_free(n9_dl_forwarding_tnl_listList); - goto end; + n9_dl_forwarding_tnl_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(n9_dl_forwarding_tnl_list_local, n9_dl_forwarding_tnl_list) { + if (!cJSON_IsObject(n9_dl_forwarding_tnl_list_local)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [n9_dl_forwarding_tnl_list]"); + goto end; + } + OpenAPI_indirect_data_forwarding_tunnel_info_t *n9_dl_forwarding_tnl_listItem = OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(n9_dl_forwarding_tnl_list_local); + if (!n9_dl_forwarding_tnl_listItem) { + ogs_error("No n9_dl_forwarding_tnl_listItem"); + OpenAPI_list_free(n9_dl_forwarding_tnl_listList); + goto end; + } + OpenAPI_list_add(n9_dl_forwarding_tnl_listList, n9_dl_forwarding_tnl_listItem); } - - OpenAPI_list_add(n9_dl_forwarding_tnl_listList, n9_dl_forwarding_tnl_listItem); - } } - cJSON *n9_ul_forwarding_tnl_list = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n9UlForwardingTnlList"); - - OpenAPI_list_t *n9_ul_forwarding_tnl_listList; + n9_ul_forwarding_tnl_list = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n9UlForwardingTnlList"); if (n9_ul_forwarding_tnl_list) { - cJSON *n9_ul_forwarding_tnl_list_local_nonprimitive; - if (!cJSON_IsArray(n9_ul_forwarding_tnl_list)){ - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [n9_ul_forwarding_tnl_list]"); - goto end; - } - - n9_ul_forwarding_tnl_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(n9_ul_forwarding_tnl_list_local_nonprimitive, n9_ul_forwarding_tnl_list ) { - if (!cJSON_IsObject(n9_ul_forwarding_tnl_list_local_nonprimitive)) { + cJSON *n9_ul_forwarding_tnl_list_local = NULL; + if (!cJSON_IsArray(n9_ul_forwarding_tnl_list)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [n9_ul_forwarding_tnl_list]"); goto end; } - OpenAPI_indirect_data_forwarding_tunnel_info_t *n9_ul_forwarding_tnl_listItem = OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(n9_ul_forwarding_tnl_list_local_nonprimitive); - if (!n9_ul_forwarding_tnl_listItem) { - ogs_error("No n9_ul_forwarding_tnl_listItem"); - OpenAPI_list_free(n9_ul_forwarding_tnl_listList); + n9_ul_forwarding_tnl_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(n9_ul_forwarding_tnl_list_local, n9_ul_forwarding_tnl_list) { + if (!cJSON_IsObject(n9_ul_forwarding_tnl_list_local)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [n9_ul_forwarding_tnl_list]"); + goto end; + } + OpenAPI_indirect_data_forwarding_tunnel_info_t *n9_ul_forwarding_tnl_listItem = OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(n9_ul_forwarding_tnl_list_local); + if (!n9_ul_forwarding_tnl_listItem) { + ogs_error("No n9_ul_forwarding_tnl_listItem"); + OpenAPI_list_free(n9_ul_forwarding_tnl_listList); + goto end; + } + OpenAPI_list_add(n9_ul_forwarding_tnl_listList, n9_ul_forwarding_tnl_listItem); + } + } + + eps_bearer_setup = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "epsBearerSetup"); + if (eps_bearer_setup) { + cJSON *eps_bearer_setup_local = NULL; + if (!cJSON_IsArray(eps_bearer_setup)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [eps_bearer_setup]"); goto end; } - OpenAPI_list_add(n9_ul_forwarding_tnl_listList, n9_ul_forwarding_tnl_listItem); - } + eps_bearer_setupList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eps_bearer_setup_local, eps_bearer_setup) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(eps_bearer_setup_local)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [eps_bearer_setup]"); + goto end; + } + OpenAPI_list_add(eps_bearer_setupList, ogs_strdup(eps_bearer_setup_local->valuestring)); + } } - cJSON *eps_bearer_setup = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "epsBearerSetup"); - - OpenAPI_list_t *eps_bearer_setupList; - if (eps_bearer_setup) { - cJSON *eps_bearer_setup_local; - if (!cJSON_IsArray(eps_bearer_setup)) { - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [eps_bearer_setup]"); - goto end; - } - eps_bearer_setupList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eps_bearer_setup_local, eps_bearer_setup) { - if (!cJSON_IsString(eps_bearer_setup_local)) { - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [eps_bearer_setup]"); - goto end; - } - OpenAPI_list_add(eps_bearer_setupList, ogs_strdup(eps_bearer_setup_local->valuestring)); - } - } - - cJSON *revoke_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "revokeEbiList"); - - OpenAPI_list_t *revoke_ebi_listList; + revoke_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "revokeEbiList"); if (revoke_ebi_list) { - cJSON *revoke_ebi_list_local; - if (!cJSON_IsArray(revoke_ebi_list)) { - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [revoke_ebi_list]"); - goto end; - } - revoke_ebi_listList = OpenAPI_list_create(); + cJSON *revoke_ebi_list_local = NULL; + if (!cJSON_IsArray(revoke_ebi_list)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [revoke_ebi_list]"); + goto end; + } - cJSON_ArrayForEach(revoke_ebi_list_local, revoke_ebi_list) { - if (!cJSON_IsNumber(revoke_ebi_list_local)) { - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [revoke_ebi_list]"); - goto end; - } - OpenAPI_list_add(revoke_ebi_listList, &revoke_ebi_list_local->valuedouble); - } + revoke_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(revoke_ebi_list_local, revoke_ebi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(revoke_ebi_list_local)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [revoke_ebi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [revoke_ebi_list]"); + goto end; + } + *localDouble = revoke_ebi_list_local->valuedouble; + OpenAPI_list_add(revoke_ebi_listList, localDouble); + } } - cJSON *release = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "release"); - + release = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "release"); if (release) { if (!cJSON_IsBool(release)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [release]"); @@ -1052,9 +1159,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "cause"); - - OpenAPI_cause_e causeVariable; + cause = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "cause"); if (cause) { if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [cause]"); @@ -1063,15 +1168,12 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c causeVariable = OpenAPI_cause_FromString(cause->valuestring); } - cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ngApCause"); - - OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + ng_ap_cause = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ngApCause"); if (ng_ap_cause) { ng_ap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ng_ap_cause); } - cJSON *_5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "5gMmCauseValue"); - + _5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "5gMmCauseValue"); if (_5g_mm_cause_value) { if (!cJSON_IsNumber(_5g_mm_cause_value)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [_5g_mm_cause_value]"); @@ -1079,23 +1181,17 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "sNssai"); - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "sNssai"); if (s_nssai) { s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "epsInterworkingInd"); - - OpenAPI_eps_interworking_indication_e eps_interworking_indVariable; + eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "epsInterworkingInd"); if (eps_interworking_ind) { if (!cJSON_IsString(eps_interworking_ind)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [eps_interworking_ind]"); @@ -1104,8 +1200,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c eps_interworking_indVariable = OpenAPI_eps_interworking_indication_FromString(eps_interworking_ind->valuestring); } - cJSON *an_type_can_be_changed = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "anTypeCanBeChanged"); - + an_type_can_be_changed = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "anTypeCanBeChanged"); if (an_type_can_be_changed) { if (!cJSON_IsBool(an_type_can_be_changed)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [an_type_can_be_changed]"); @@ -1113,16 +1208,12 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *n2_sm_info_ext1 = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n2SmInfoExt1"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_ext1_local_nonprim = NULL; + n2_sm_info_ext1 = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n2SmInfoExt1"); if (n2_sm_info_ext1) { n2_sm_info_ext1_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info_ext1); } - cJSON *n2_sm_info_type_ext1 = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n2SmInfoTypeExt1"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1Variable; + n2_sm_info_type_ext1 = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "n2SmInfoTypeExt1"); if (n2_sm_info_type_ext1) { if (!cJSON_IsString(n2_sm_info_type_ext1)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [n2_sm_info_type_ext1]"); @@ -1131,9 +1222,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c n2_sm_info_type_ext1Variable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type_ext1->valuestring); } - cJSON *ma_release_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "maReleaseInd"); - - OpenAPI_ma_release_indication_e ma_release_indVariable; + ma_release_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "maReleaseInd"); if (ma_release_ind) { if (!cJSON_IsString(ma_release_ind)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [ma_release_ind]"); @@ -1142,8 +1231,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c ma_release_indVariable = OpenAPI_ma_release_indication_FromString(ma_release_ind->valuestring); } - cJSON *ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "maNwUpgradeInd"); - + ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "maNwUpgradeInd"); if (ma_nw_upgrade_ind) { if (!cJSON_IsBool(ma_nw_upgrade_ind)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [ma_nw_upgrade_ind]"); @@ -1151,8 +1239,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *ma_request_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "maRequestInd"); - + ma_request_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "maRequestInd"); if (ma_request_ind) { if (!cJSON_IsBool(ma_request_ind)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [ma_request_ind]"); @@ -1160,31 +1247,25 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *exemption_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "exemptionInd"); - - OpenAPI_exemption_ind_t *exemption_ind_local_nonprim = NULL; + exemption_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "exemptionInd"); if (exemption_ind) { exemption_ind_local_nonprim = OpenAPI_exemption_ind_parseFromJSON(exemption_ind); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "moExpDataCounter"); - - OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "moExpDataCounter"); if (mo_exp_data_counter) { mo_exp_data_counter_local_nonprim = OpenAPI_mo_exp_data_counter_parseFromJSON(mo_exp_data_counter); } - cJSON *extended_nas_sm_timer_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "extendedNasSmTimerInd"); - + extended_nas_sm_timer_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "extendedNasSmTimerInd"); if (extended_nas_sm_timer_ind) { if (!cJSON_IsBool(extended_nas_sm_timer_ind)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [extended_nas_sm_timer_ind]"); @@ -1192,45 +1273,43 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c } } - cJSON *forwarding_f_teid = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "forwardingFTeid"); - + forwarding_f_teid = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "forwardingFTeid"); if (forwarding_f_teid) { - if (!cJSON_IsNumber(forwarding_f_teid)) { + if (!cJSON_IsString(forwarding_f_teid) && !cJSON_IsNull(forwarding_f_teid)) { ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [forwarding_f_teid]"); goto end; } } - cJSON *forwarding_bearer_contexts = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "forwardingBearerContexts"); - - OpenAPI_list_t *forwarding_bearer_contextsList; + forwarding_bearer_contexts = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "forwardingBearerContexts"); if (forwarding_bearer_contexts) { - cJSON *forwarding_bearer_contexts_local; - if (!cJSON_IsArray(forwarding_bearer_contexts)) { - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [forwarding_bearer_contexts]"); - goto end; - } - forwarding_bearer_contextsList = OpenAPI_list_create(); + cJSON *forwarding_bearer_contexts_local = NULL; + if (!cJSON_IsArray(forwarding_bearer_contexts)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [forwarding_bearer_contexts]"); + goto end; + } - cJSON_ArrayForEach(forwarding_bearer_contexts_local, forwarding_bearer_contexts) { - if (!cJSON_IsString(forwarding_bearer_contexts_local)) { - ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [forwarding_bearer_contexts]"); - goto end; - } - OpenAPI_list_add(forwarding_bearer_contextsList, ogs_strdup(forwarding_bearer_contexts_local->valuestring)); - } + forwarding_bearer_contextsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(forwarding_bearer_contexts_local, forwarding_bearer_contexts) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(forwarding_bearer_contexts_local)) { + ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [forwarding_bearer_contexts]"); + goto end; + } + OpenAPI_list_add(forwarding_bearer_contextsList, ogs_strdup(forwarding_bearer_contexts_local->valuestring)); + } } - cJSON *ddn_failure_subs = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ddnFailureSubs"); - - OpenAPI_ddn_failure_subs_t *ddn_failure_subs_local_nonprim = NULL; + ddn_failure_subs = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ddnFailureSubs"); if (ddn_failure_subs) { ddn_failure_subs_local_nonprim = OpenAPI_ddn_failure_subs_parseFromJSON(ddn_failure_subs); } sm_context_update_data_local_var = OpenAPI_sm_context_update_data_create ( - pei ? ogs_strdup(pei->valuestring) : NULL, - serving_nf_id ? ogs_strdup(serving_nf_id->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, + serving_nf_id && !cJSON_IsNull(serving_nf_id) ? ogs_strdup(serving_nf_id->valuestring) : NULL, guami ? guami_local_nonprim : NULL, serving_network ? serving_network_local_nonprim : NULL, backup_amf_info ? backup_amf_infoList : NULL, @@ -1240,7 +1319,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c rat_type ? rat_typeVariable : 0, presence_in_ladn ? presence_in_ladnVariable : 0, ue_location ? ue_location_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, add_ue_location ? add_ue_location_local_nonprim : NULL, up_cnx_state ? up_cnx_stateVariable : 0, ho_state ? ho_stateVariable : 0, @@ -1252,8 +1331,8 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c n2_sm_info ? n2_sm_info_local_nonprim : NULL, n2_sm_info_type ? n2_sm_info_typeVariable : 0, target_id ? target_id_local_nonprim : NULL, - target_serving_nf_id ? ogs_strdup(target_serving_nf_id->valuestring) : NULL, - sm_context_status_uri ? ogs_strdup(sm_context_status_uri->valuestring) : NULL, + target_serving_nf_id && !cJSON_IsNull(target_serving_nf_id) ? ogs_strdup(target_serving_nf_id->valuestring) : NULL, + sm_context_status_uri && !cJSON_IsNull(sm_context_status_uri) ? ogs_strdup(sm_context_status_uri->valuestring) : NULL, data_forwarding ? true : false, data_forwarding ? data_forwarding->valueint : 0, n9_forwarding_tunnel ? n9_forwarding_tunnel_local_nonprim : NULL, @@ -1280,17 +1359,119 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c ma_request_ind ? true : false, ma_request_ind ? ma_request_ind->valueint : 0, exemption_ind ? exemption_ind_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, mo_exp_data_counter ? mo_exp_data_counter_local_nonprim : NULL, extended_nas_sm_timer_ind ? true : false, extended_nas_sm_timer_ind ? extended_nas_sm_timer_ind->valueint : 0, - forwarding_f_teid ? forwarding_f_teid->valueint : 0, + forwarding_f_teid && !cJSON_IsNull(forwarding_f_teid) ? ogs_strdup(forwarding_f_teid->valuestring) : NULL, forwarding_bearer_contexts ? forwarding_bearer_contextsList : NULL, ddn_failure_subs ? ddn_failure_subs_local_nonprim : NULL ); return sm_context_update_data_local_var; end: + if (guami_local_nonprim) { + OpenAPI_guami_free(guami_local_nonprim); + guami_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (backup_amf_infoList) { + OpenAPI_list_for_each(backup_amf_infoList, node) { + OpenAPI_backup_amf_info_free(node->data); + } + OpenAPI_list_free(backup_amf_infoList); + backup_amf_infoList = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } + if (add_ue_location_local_nonprim) { + OpenAPI_user_location_free(add_ue_location_local_nonprim); + add_ue_location_local_nonprim = NULL; + } + if (n1_sm_msg_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_msg_local_nonprim); + n1_sm_msg_local_nonprim = NULL; + } + if (n2_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_local_nonprim); + n2_sm_info_local_nonprim = NULL; + } + if (target_id_local_nonprim) { + OpenAPI_ng_ran_target_id_free(target_id_local_nonprim); + target_id_local_nonprim = NULL; + } + if (n9_forwarding_tunnel_local_nonprim) { + OpenAPI_tunnel_info_free(n9_forwarding_tunnel_local_nonprim); + n9_forwarding_tunnel_local_nonprim = NULL; + } + if (n9_dl_forwarding_tnl_listList) { + OpenAPI_list_for_each(n9_dl_forwarding_tnl_listList, node) { + OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + } + OpenAPI_list_free(n9_dl_forwarding_tnl_listList); + n9_dl_forwarding_tnl_listList = NULL; + } + if (n9_ul_forwarding_tnl_listList) { + OpenAPI_list_for_each(n9_ul_forwarding_tnl_listList, node) { + OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + } + OpenAPI_list_free(n9_ul_forwarding_tnl_listList); + n9_ul_forwarding_tnl_listList = NULL; + } + if (eps_bearer_setupList) { + OpenAPI_list_for_each(eps_bearer_setupList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(eps_bearer_setupList); + eps_bearer_setupList = NULL; + } + if (revoke_ebi_listList) { + OpenAPI_list_for_each(revoke_ebi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(revoke_ebi_listList); + revoke_ebi_listList = NULL; + } + if (ng_ap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ng_ap_cause_local_nonprim); + ng_ap_cause_local_nonprim = NULL; + } + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (n2_sm_info_ext1_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_ext1_local_nonprim); + n2_sm_info_ext1_local_nonprim = NULL; + } + if (exemption_ind_local_nonprim) { + OpenAPI_exemption_ind_free(exemption_ind_local_nonprim); + exemption_ind_local_nonprim = NULL; + } + if (mo_exp_data_counter_local_nonprim) { + OpenAPI_mo_exp_data_counter_free(mo_exp_data_counter_local_nonprim); + mo_exp_data_counter_local_nonprim = NULL; + } + if (forwarding_bearer_contextsList) { + OpenAPI_list_for_each(forwarding_bearer_contextsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(forwarding_bearer_contextsList); + forwarding_bearer_contextsList = NULL; + } + if (ddn_failure_subs_local_nonprim) { + OpenAPI_ddn_failure_subs_free(ddn_failure_subs_local_nonprim); + ddn_failure_subs_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_update_data.h b/lib/sbi/openapi/model/sm_context_update_data.h index acd6ac249..68ae98f03 100644 --- a/lib/sbi/openapi/model/sm_context_update_data.h +++ b/lib/sbi/openapi/model/sm_context_update_data.h @@ -97,7 +97,7 @@ typedef struct OpenAPI_sm_context_update_data_s { struct OpenAPI_mo_exp_data_counter_s *mo_exp_data_counter; bool is_extended_nas_sm_timer_ind; int extended_nas_sm_timer_ind; - char forwarding_f_teid; + char *forwarding_f_teid; OpenAPI_list_t *forwarding_bearer_contexts; struct OpenAPI_ddn_failure_subs_s *ddn_failure_subs; } OpenAPI_sm_context_update_data_t; @@ -158,7 +158,7 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_create( OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter, bool is_extended_nas_sm_timer_ind, int extended_nas_sm_timer_ind, - char forwarding_f_teid, + char *forwarding_f_teid, OpenAPI_list_t *forwarding_bearer_contexts, OpenAPI_ddn_failure_subs_t *ddn_failure_subs ); diff --git a/lib/sbi/openapi/model/sm_context_update_error.c b/lib/sbi/openapi/model/sm_context_update_error.c index b7a86937f..8c3d06532 100644 --- a/lib/sbi/openapi/model/sm_context_update_error.c +++ b/lib/sbi/openapi/model/sm_context_update_error.c @@ -28,20 +28,34 @@ OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_create( void OpenAPI_sm_context_update_error_free(OpenAPI_sm_context_update_error_t *sm_context_update_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_update_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ext_problem_details_free(sm_context_update_error->error); - OpenAPI_ref_to_binary_data_free(sm_context_update_error->n1_sm_msg); - OpenAPI_ref_to_binary_data_free(sm_context_update_error->n2_sm_info); - ogs_free(sm_context_update_error->recovery_time); + if (sm_context_update_error->error) { + OpenAPI_ext_problem_details_free(sm_context_update_error->error); + sm_context_update_error->error = NULL; + } + if (sm_context_update_error->n1_sm_msg) { + OpenAPI_ref_to_binary_data_free(sm_context_update_error->n1_sm_msg); + sm_context_update_error->n1_sm_msg = NULL; + } + if (sm_context_update_error->n2_sm_info) { + OpenAPI_ref_to_binary_data_free(sm_context_update_error->n2_sm_info); + sm_context_update_error->n2_sm_info = NULL; + } + if (sm_context_update_error->recovery_time) { + ogs_free(sm_context_update_error->recovery_time); + sm_context_update_error->recovery_time = NULL; + } ogs_free(sm_context_update_error); } cJSON *OpenAPI_sm_context_update_error_convertToJSON(OpenAPI_sm_context_update_error_t *sm_context_update_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_update_error == NULL) { ogs_error("OpenAPI_sm_context_update_error_convertToJSON() failed [SmContextUpdateError]"); @@ -49,6 +63,10 @@ cJSON *OpenAPI_sm_context_update_error_convertToJSON(OpenAPI_sm_context_update_e } item = cJSON_CreateObject(); + if (!sm_context_update_error->error) { + ogs_error("OpenAPI_sm_context_update_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_ext_problem_details_convertToJSON(sm_context_update_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_sm_context_update_error_convertToJSON() failed [error]"); @@ -86,14 +104,14 @@ cJSON *OpenAPI_sm_context_update_error_convertToJSON(OpenAPI_sm_context_update_e } } - if (sm_context_update_error->n2_sm_info_type) { + if (sm_context_update_error->n2_sm_info_type != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoType", OpenAPI_n2_sm_info_type_ToString(sm_context_update_error->n2_sm_info_type)) == NULL) { ogs_error("OpenAPI_sm_context_update_error_convertToJSON() failed [n2_sm_info_type]"); goto end; } } - if (sm_context_update_error->up_cnx_state) { + if (sm_context_update_error->up_cnx_state != OpenAPI_up_cnx_state_NULL) { if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_update_error->up_cnx_state)) == NULL) { ogs_error("OpenAPI_sm_context_update_error_convertToJSON() failed [up_cnx_state]"); goto end; @@ -114,32 +132,36 @@ end: OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_parseFromJSON(cJSON *sm_context_update_errorJSON) { OpenAPI_sm_context_update_error_t *sm_context_update_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_ext_problem_details_t *error_local_nonprim = NULL; + cJSON *n1_sm_msg = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + cJSON *n2_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + cJSON *n2_sm_info_type = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable = 0; + cJSON *up_cnx_state = NULL; + OpenAPI_up_cnx_state_e up_cnx_stateVariable = 0; + cJSON *recovery_time = NULL; + error = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_sm_context_update_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_ext_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_ext_problem_details_parseFromJSON(error); - cJSON *n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "n1SmMsg"); - - OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "n1SmMsg"); if (n1_sm_msg) { n1_sm_msg_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_msg); } - cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "n2SmInfo"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "n2SmInfo"); if (n2_sm_info) { n2_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info); } - cJSON *n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "n2SmInfoType"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable; + n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "n2SmInfoType"); if (n2_sm_info_type) { if (!cJSON_IsString(n2_sm_info_type)) { ogs_error("OpenAPI_sm_context_update_error_parseFromJSON() failed [n2_sm_info_type]"); @@ -148,9 +170,7 @@ OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_parseFromJSON n2_sm_info_typeVariable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type->valuestring); } - cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "upCnxState"); - - OpenAPI_up_cnx_state_e up_cnx_stateVariable; + up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "upCnxState"); if (up_cnx_state) { if (!cJSON_IsString(up_cnx_state)) { ogs_error("OpenAPI_sm_context_update_error_parseFromJSON() failed [up_cnx_state]"); @@ -159,10 +179,9 @@ OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_parseFromJSON up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring); } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_sm_context_update_error_parseFromJSON() failed [recovery_time]"); goto end; } @@ -174,11 +193,23 @@ OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_parseFromJSON n2_sm_info ? n2_sm_info_local_nonprim : NULL, n2_sm_info_type ? n2_sm_info_typeVariable : 0, up_cnx_state ? up_cnx_stateVariable : 0, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL ); return sm_context_update_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_ext_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (n1_sm_msg_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_msg_local_nonprim); + n1_sm_msg_local_nonprim = NULL; + } + if (n2_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_local_nonprim); + n2_sm_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_updated_data.c b/lib/sbi/openapi/model/sm_context_updated_data.c index 822476b10..9c3067ef0 100644 --- a/lib/sbi/openapi/model/sm_context_updated_data.c +++ b/lib/sbi/openapi/model/sm_context_updated_data.c @@ -22,7 +22,7 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_create( bool is_ma_accepted_ind, int ma_accepted_ind, char *supported_features, - char forwarding_f_teid, + char *forwarding_f_teid, OpenAPI_list_t *forwarding_bearer_contexts, char *selected_smf_id, char *selected_old_smf_id @@ -58,49 +58,91 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_create( void OpenAPI_sm_context_updated_data_free(OpenAPI_sm_context_updated_data_t *sm_context_updated_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_context_updated_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(sm_context_updated_data->release_ebi_list, node) { - ogs_free(node->data); + if (sm_context_updated_data->release_ebi_list) { + OpenAPI_list_for_each(sm_context_updated_data->release_ebi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_updated_data->release_ebi_list); + sm_context_updated_data->release_ebi_list = NULL; } - OpenAPI_list_free(sm_context_updated_data->release_ebi_list); - OpenAPI_list_for_each(sm_context_updated_data->allocated_ebi_list, node) { - OpenAPI_ebi_arp_mapping_free(node->data); + if (sm_context_updated_data->allocated_ebi_list) { + OpenAPI_list_for_each(sm_context_updated_data->allocated_ebi_list, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(sm_context_updated_data->allocated_ebi_list); + sm_context_updated_data->allocated_ebi_list = NULL; } - OpenAPI_list_free(sm_context_updated_data->allocated_ebi_list); - OpenAPI_list_for_each(sm_context_updated_data->modified_ebi_list, node) { - OpenAPI_ebi_arp_mapping_free(node->data); + if (sm_context_updated_data->modified_ebi_list) { + OpenAPI_list_for_each(sm_context_updated_data->modified_ebi_list, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(sm_context_updated_data->modified_ebi_list); + sm_context_updated_data->modified_ebi_list = NULL; } - OpenAPI_list_free(sm_context_updated_data->modified_ebi_list); - OpenAPI_ref_to_binary_data_free(sm_context_updated_data->n1_sm_msg); - OpenAPI_ref_to_binary_data_free(sm_context_updated_data->n2_sm_info); - OpenAPI_list_for_each(sm_context_updated_data->eps_bearer_setup, node) { - ogs_free(node->data); + if (sm_context_updated_data->n1_sm_msg) { + OpenAPI_ref_to_binary_data_free(sm_context_updated_data->n1_sm_msg); + sm_context_updated_data->n1_sm_msg = NULL; } - OpenAPI_list_free(sm_context_updated_data->eps_bearer_setup); - OpenAPI_list_for_each(sm_context_updated_data->n3_dl_forwarding_tnl_list, node) { - OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + if (sm_context_updated_data->n2_sm_info) { + OpenAPI_ref_to_binary_data_free(sm_context_updated_data->n2_sm_info); + sm_context_updated_data->n2_sm_info = NULL; } - OpenAPI_list_free(sm_context_updated_data->n3_dl_forwarding_tnl_list); - OpenAPI_list_for_each(sm_context_updated_data->n3_ul_forwarding_tnl_list, node) { - OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + if (sm_context_updated_data->eps_bearer_setup) { + OpenAPI_list_for_each(sm_context_updated_data->eps_bearer_setup, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_updated_data->eps_bearer_setup); + sm_context_updated_data->eps_bearer_setup = NULL; } - OpenAPI_list_free(sm_context_updated_data->n3_ul_forwarding_tnl_list); - ogs_free(sm_context_updated_data->supported_features); - OpenAPI_list_for_each(sm_context_updated_data->forwarding_bearer_contexts, node) { - ogs_free(node->data); + if (sm_context_updated_data->n3_dl_forwarding_tnl_list) { + OpenAPI_list_for_each(sm_context_updated_data->n3_dl_forwarding_tnl_list, node) { + OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + } + OpenAPI_list_free(sm_context_updated_data->n3_dl_forwarding_tnl_list); + sm_context_updated_data->n3_dl_forwarding_tnl_list = NULL; + } + if (sm_context_updated_data->n3_ul_forwarding_tnl_list) { + OpenAPI_list_for_each(sm_context_updated_data->n3_ul_forwarding_tnl_list, node) { + OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + } + OpenAPI_list_free(sm_context_updated_data->n3_ul_forwarding_tnl_list); + sm_context_updated_data->n3_ul_forwarding_tnl_list = NULL; + } + if (sm_context_updated_data->supported_features) { + ogs_free(sm_context_updated_data->supported_features); + sm_context_updated_data->supported_features = NULL; + } + if (sm_context_updated_data->forwarding_f_teid) { + ogs_free(sm_context_updated_data->forwarding_f_teid); + sm_context_updated_data->forwarding_f_teid = NULL; + } + if (sm_context_updated_data->forwarding_bearer_contexts) { + OpenAPI_list_for_each(sm_context_updated_data->forwarding_bearer_contexts, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_context_updated_data->forwarding_bearer_contexts); + sm_context_updated_data->forwarding_bearer_contexts = NULL; + } + if (sm_context_updated_data->selected_smf_id) { + ogs_free(sm_context_updated_data->selected_smf_id); + sm_context_updated_data->selected_smf_id = NULL; + } + if (sm_context_updated_data->selected_old_smf_id) { + ogs_free(sm_context_updated_data->selected_old_smf_id); + sm_context_updated_data->selected_old_smf_id = NULL; } - OpenAPI_list_free(sm_context_updated_data->forwarding_bearer_contexts); - ogs_free(sm_context_updated_data->selected_smf_id); - ogs_free(sm_context_updated_data->selected_old_smf_id); ogs_free(sm_context_updated_data); } cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_data_t *sm_context_updated_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_context_updated_data == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [SmContextUpdatedData]"); @@ -108,14 +150,14 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ } item = cJSON_CreateObject(); - if (sm_context_updated_data->up_cnx_state) { + if (sm_context_updated_data->up_cnx_state != OpenAPI_up_cnx_state_NULL) { if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_updated_data->up_cnx_state)) == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [up_cnx_state]"); goto end; } } - if (sm_context_updated_data->ho_state) { + if (sm_context_updated_data->ho_state != OpenAPI_ho_state_NULL) { if (cJSON_AddStringToObject(item, "hoState", OpenAPI_ho_state_ToString(sm_context_updated_data->ho_state)) == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [ho_state]"); goto end; @@ -123,19 +165,17 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ } if (sm_context_updated_data->release_ebi_list) { - cJSON *release_ebi_list = cJSON_AddArrayToObject(item, "releaseEbiList"); - if (release_ebi_list == NULL) { + cJSON *release_ebi_listList = cJSON_AddArrayToObject(item, "releaseEbiList"); + if (release_ebi_listList == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [release_ebi_list]"); goto end; } - - OpenAPI_lnode_t *release_ebi_list_node; - OpenAPI_list_for_each(sm_context_updated_data->release_ebi_list, release_ebi_list_node) { - if (cJSON_AddNumberToObject(release_ebi_list, "", *(double *)release_ebi_list_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [release_ebi_list]"); - goto end; + OpenAPI_list_for_each(sm_context_updated_data->release_ebi_list, node) { + if (cJSON_AddNumberToObject(release_ebi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [release_ebi_list]"); + goto end; + } } - } } if (sm_context_updated_data->allocated_ebi_list) { @@ -144,17 +184,13 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [allocated_ebi_list]"); goto end; } - - OpenAPI_lnode_t *allocated_ebi_list_node; - if (sm_context_updated_data->allocated_ebi_list) { - OpenAPI_list_for_each(sm_context_updated_data->allocated_ebi_list, allocated_ebi_list_node) { - cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(allocated_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [allocated_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(allocated_ebi_listList, itemLocal); + OpenAPI_list_for_each(sm_context_updated_data->allocated_ebi_list, node) { + cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [allocated_ebi_list]"); + goto end; } + cJSON_AddItemToArray(allocated_ebi_listList, itemLocal); } } @@ -164,17 +200,13 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [modified_ebi_list]"); goto end; } - - OpenAPI_lnode_t *modified_ebi_list_node; - if (sm_context_updated_data->modified_ebi_list) { - OpenAPI_list_for_each(sm_context_updated_data->modified_ebi_list, modified_ebi_list_node) { - cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(modified_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [modified_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(modified_ebi_listList, itemLocal); + OpenAPI_list_for_each(sm_context_updated_data->modified_ebi_list, node) { + cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [modified_ebi_list]"); + goto end; } + cJSON_AddItemToArray(modified_ebi_listList, itemLocal); } } @@ -204,7 +236,7 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ } } - if (sm_context_updated_data->n2_sm_info_type) { + if (sm_context_updated_data->n2_sm_info_type != OpenAPI_n2_sm_info_type_NULL) { if (cJSON_AddStringToObject(item, "n2SmInfoType", OpenAPI_n2_sm_info_type_ToString(sm_context_updated_data->n2_sm_info_type)) == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [n2_sm_info_type]"); goto end; @@ -212,19 +244,17 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ } if (sm_context_updated_data->eps_bearer_setup) { - cJSON *eps_bearer_setup = cJSON_AddArrayToObject(item, "epsBearerSetup"); - if (eps_bearer_setup == NULL) { + cJSON *eps_bearer_setupList = cJSON_AddArrayToObject(item, "epsBearerSetup"); + if (eps_bearer_setupList == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [eps_bearer_setup]"); goto end; } - - OpenAPI_lnode_t *eps_bearer_setup_node; - OpenAPI_list_for_each(sm_context_updated_data->eps_bearer_setup, eps_bearer_setup_node) { - if (cJSON_AddStringToObject(eps_bearer_setup, "", (char*)eps_bearer_setup_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [eps_bearer_setup]"); - goto end; + OpenAPI_list_for_each(sm_context_updated_data->eps_bearer_setup, node) { + if (cJSON_AddStringToObject(eps_bearer_setupList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [eps_bearer_setup]"); + goto end; + } } - } } if (sm_context_updated_data->is_data_forwarding) { @@ -240,17 +270,13 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [n3_dl_forwarding_tnl_list]"); goto end; } - - OpenAPI_lnode_t *n3_dl_forwarding_tnl_list_node; - if (sm_context_updated_data->n3_dl_forwarding_tnl_list) { - OpenAPI_list_for_each(sm_context_updated_data->n3_dl_forwarding_tnl_list, n3_dl_forwarding_tnl_list_node) { - cJSON *itemLocal = OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(n3_dl_forwarding_tnl_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [n3_dl_forwarding_tnl_list]"); - goto end; - } - cJSON_AddItemToArray(n3_dl_forwarding_tnl_listList, itemLocal); + OpenAPI_list_for_each(sm_context_updated_data->n3_dl_forwarding_tnl_list, node) { + cJSON *itemLocal = OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [n3_dl_forwarding_tnl_list]"); + goto end; } + cJSON_AddItemToArray(n3_dl_forwarding_tnl_listList, itemLocal); } } @@ -260,21 +286,17 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [n3_ul_forwarding_tnl_list]"); goto end; } - - OpenAPI_lnode_t *n3_ul_forwarding_tnl_list_node; - if (sm_context_updated_data->n3_ul_forwarding_tnl_list) { - OpenAPI_list_for_each(sm_context_updated_data->n3_ul_forwarding_tnl_list, n3_ul_forwarding_tnl_list_node) { - cJSON *itemLocal = OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(n3_ul_forwarding_tnl_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [n3_ul_forwarding_tnl_list]"); - goto end; - } - cJSON_AddItemToArray(n3_ul_forwarding_tnl_listList, itemLocal); + OpenAPI_list_for_each(sm_context_updated_data->n3_ul_forwarding_tnl_list, node) { + cJSON *itemLocal = OpenAPI_indirect_data_forwarding_tunnel_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [n3_ul_forwarding_tnl_list]"); + goto end; } + cJSON_AddItemToArray(n3_ul_forwarding_tnl_listList, itemLocal); } } - if (sm_context_updated_data->cause) { + if (sm_context_updated_data->cause != OpenAPI_cause_NULL) { if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(sm_context_updated_data->cause)) == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [cause]"); goto end; @@ -296,26 +318,24 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_ } if (sm_context_updated_data->forwarding_f_teid) { - if (cJSON_AddNumberToObject(item, "forwardingFTeid", sm_context_updated_data->forwarding_f_teid) == NULL) { + if (cJSON_AddStringToObject(item, "forwardingFTeid", sm_context_updated_data->forwarding_f_teid) == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [forwarding_f_teid]"); goto end; } } if (sm_context_updated_data->forwarding_bearer_contexts) { - cJSON *forwarding_bearer_contexts = cJSON_AddArrayToObject(item, "forwardingBearerContexts"); - if (forwarding_bearer_contexts == NULL) { + cJSON *forwarding_bearer_contextsList = cJSON_AddArrayToObject(item, "forwardingBearerContexts"); + if (forwarding_bearer_contextsList == NULL) { ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [forwarding_bearer_contexts]"); goto end; } - - OpenAPI_lnode_t *forwarding_bearer_contexts_node; - OpenAPI_list_for_each(sm_context_updated_data->forwarding_bearer_contexts, forwarding_bearer_contexts_node) { - if (cJSON_AddStringToObject(forwarding_bearer_contexts, "", (char*)forwarding_bearer_contexts_node->data) == NULL) { - ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [forwarding_bearer_contexts]"); - goto end; + OpenAPI_list_for_each(sm_context_updated_data->forwarding_bearer_contexts, node) { + if (cJSON_AddStringToObject(forwarding_bearer_contextsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [forwarding_bearer_contexts]"); + goto end; + } } - } } if (sm_context_updated_data->selected_smf_id) { @@ -339,9 +359,40 @@ end: OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON(cJSON *sm_context_updated_dataJSON) { OpenAPI_sm_context_updated_data_t *sm_context_updated_data_local_var = NULL; - cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "upCnxState"); - - OpenAPI_up_cnx_state_e up_cnx_stateVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *up_cnx_state = NULL; + OpenAPI_up_cnx_state_e up_cnx_stateVariable = 0; + cJSON *ho_state = NULL; + OpenAPI_ho_state_e ho_stateVariable = 0; + cJSON *release_ebi_list = NULL; + OpenAPI_list_t *release_ebi_listList = NULL; + cJSON *allocated_ebi_list = NULL; + OpenAPI_list_t *allocated_ebi_listList = NULL; + cJSON *modified_ebi_list = NULL; + OpenAPI_list_t *modified_ebi_listList = NULL; + cJSON *n1_sm_msg = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + cJSON *n2_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + cJSON *n2_sm_info_type = NULL; + OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable = 0; + cJSON *eps_bearer_setup = NULL; + OpenAPI_list_t *eps_bearer_setupList = NULL; + cJSON *data_forwarding = NULL; + cJSON *n3_dl_forwarding_tnl_list = NULL; + OpenAPI_list_t *n3_dl_forwarding_tnl_listList = NULL; + cJSON *n3_ul_forwarding_tnl_list = NULL; + OpenAPI_list_t *n3_ul_forwarding_tnl_listList = NULL; + cJSON *cause = NULL; + OpenAPI_cause_e causeVariable = 0; + cJSON *ma_accepted_ind = NULL; + cJSON *supported_features = NULL; + cJSON *forwarding_f_teid = NULL; + cJSON *forwarding_bearer_contexts = NULL; + OpenAPI_list_t *forwarding_bearer_contextsList = NULL; + cJSON *selected_smf_id = NULL; + cJSON *selected_old_smf_id = NULL; + up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "upCnxState"); if (up_cnx_state) { if (!cJSON_IsString(up_cnx_state)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [up_cnx_state]"); @@ -350,9 +401,7 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring); } - cJSON *ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "hoState"); - - OpenAPI_ho_state_e ho_stateVariable; + ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "hoState"); if (ho_state) { if (!cJSON_IsString(ho_state)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [ho_state]"); @@ -361,101 +410,94 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON ho_stateVariable = OpenAPI_ho_state_FromString(ho_state->valuestring); } - cJSON *release_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "releaseEbiList"); - - OpenAPI_list_t *release_ebi_listList; + release_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "releaseEbiList"); if (release_ebi_list) { - cJSON *release_ebi_list_local; - if (!cJSON_IsArray(release_ebi_list)) { - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [release_ebi_list]"); - goto end; - } - release_ebi_listList = OpenAPI_list_create(); + cJSON *release_ebi_list_local = NULL; + if (!cJSON_IsArray(release_ebi_list)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [release_ebi_list]"); + goto end; + } - cJSON_ArrayForEach(release_ebi_list_local, release_ebi_list) { - if (!cJSON_IsNumber(release_ebi_list_local)) { - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [release_ebi_list]"); - goto end; - } - OpenAPI_list_add(release_ebi_listList, &release_ebi_list_local->valuedouble); - } + release_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(release_ebi_list_local, release_ebi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(release_ebi_list_local)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [release_ebi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [release_ebi_list]"); + goto end; + } + *localDouble = release_ebi_list_local->valuedouble; + OpenAPI_list_add(release_ebi_listList, localDouble); + } } - cJSON *allocated_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "allocatedEbiList"); - - OpenAPI_list_t *allocated_ebi_listList; + allocated_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "allocatedEbiList"); if (allocated_ebi_list) { - cJSON *allocated_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(allocated_ebi_list)){ - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [allocated_ebi_list]"); - goto end; - } - - allocated_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allocated_ebi_list_local_nonprimitive, allocated_ebi_list ) { - if (!cJSON_IsObject(allocated_ebi_list_local_nonprimitive)) { + cJSON *allocated_ebi_list_local = NULL; + if (!cJSON_IsArray(allocated_ebi_list)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [allocated_ebi_list]"); goto end; } - OpenAPI_ebi_arp_mapping_t *allocated_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(allocated_ebi_list_local_nonprimitive); - if (!allocated_ebi_listItem) { - ogs_error("No allocated_ebi_listItem"); - OpenAPI_list_free(allocated_ebi_listList); - goto end; + allocated_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allocated_ebi_list_local, allocated_ebi_list) { + if (!cJSON_IsObject(allocated_ebi_list_local)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [allocated_ebi_list]"); + goto end; + } + OpenAPI_ebi_arp_mapping_t *allocated_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(allocated_ebi_list_local); + if (!allocated_ebi_listItem) { + ogs_error("No allocated_ebi_listItem"); + OpenAPI_list_free(allocated_ebi_listList); + goto end; + } + OpenAPI_list_add(allocated_ebi_listList, allocated_ebi_listItem); } - - OpenAPI_list_add(allocated_ebi_listList, allocated_ebi_listItem); - } } - cJSON *modified_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "modifiedEbiList"); - - OpenAPI_list_t *modified_ebi_listList; + modified_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "modifiedEbiList"); if (modified_ebi_list) { - cJSON *modified_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(modified_ebi_list)){ - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [modified_ebi_list]"); - goto end; - } - - modified_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(modified_ebi_list_local_nonprimitive, modified_ebi_list ) { - if (!cJSON_IsObject(modified_ebi_list_local_nonprimitive)) { + cJSON *modified_ebi_list_local = NULL; + if (!cJSON_IsArray(modified_ebi_list)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [modified_ebi_list]"); goto end; } - OpenAPI_ebi_arp_mapping_t *modified_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(modified_ebi_list_local_nonprimitive); - if (!modified_ebi_listItem) { - ogs_error("No modified_ebi_listItem"); - OpenAPI_list_free(modified_ebi_listList); - goto end; + modified_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(modified_ebi_list_local, modified_ebi_list) { + if (!cJSON_IsObject(modified_ebi_list_local)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [modified_ebi_list]"); + goto end; + } + OpenAPI_ebi_arp_mapping_t *modified_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(modified_ebi_list_local); + if (!modified_ebi_listItem) { + ogs_error("No modified_ebi_listItem"); + OpenAPI_list_free(modified_ebi_listList); + goto end; + } + OpenAPI_list_add(modified_ebi_listList, modified_ebi_listItem); } - - OpenAPI_list_add(modified_ebi_listList, modified_ebi_listItem); - } } - cJSON *n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n1SmMsg"); - - OpenAPI_ref_to_binary_data_t *n1_sm_msg_local_nonprim = NULL; + n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n1SmMsg"); if (n1_sm_msg) { n1_sm_msg_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_msg); } - cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n2SmInfo"); - - OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL; + n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n2SmInfo"); if (n2_sm_info) { n2_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info); } - cJSON *n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n2SmInfoType"); - - OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable; + n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n2SmInfoType"); if (n2_sm_info_type) { if (!cJSON_IsString(n2_sm_info_type)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [n2_sm_info_type]"); @@ -464,28 +506,28 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON n2_sm_info_typeVariable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type->valuestring); } - cJSON *eps_bearer_setup = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "epsBearerSetup"); - - OpenAPI_list_t *eps_bearer_setupList; + eps_bearer_setup = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "epsBearerSetup"); if (eps_bearer_setup) { - cJSON *eps_bearer_setup_local; - if (!cJSON_IsArray(eps_bearer_setup)) { - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [eps_bearer_setup]"); - goto end; - } - eps_bearer_setupList = OpenAPI_list_create(); + cJSON *eps_bearer_setup_local = NULL; + if (!cJSON_IsArray(eps_bearer_setup)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [eps_bearer_setup]"); + goto end; + } - cJSON_ArrayForEach(eps_bearer_setup_local, eps_bearer_setup) { - if (!cJSON_IsString(eps_bearer_setup_local)) { - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [eps_bearer_setup]"); - goto end; - } - OpenAPI_list_add(eps_bearer_setupList, ogs_strdup(eps_bearer_setup_local->valuestring)); - } + eps_bearer_setupList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eps_bearer_setup_local, eps_bearer_setup) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(eps_bearer_setup_local)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [eps_bearer_setup]"); + goto end; + } + OpenAPI_list_add(eps_bearer_setupList, ogs_strdup(eps_bearer_setup_local->valuestring)); + } } - cJSON *data_forwarding = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "dataForwarding"); - + data_forwarding = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "dataForwarding"); if (data_forwarding) { if (!cJSON_IsBool(data_forwarding)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [data_forwarding]"); @@ -493,67 +535,57 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON } } - cJSON *n3_dl_forwarding_tnl_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n3DlForwardingTnlList"); - - OpenAPI_list_t *n3_dl_forwarding_tnl_listList; + n3_dl_forwarding_tnl_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n3DlForwardingTnlList"); if (n3_dl_forwarding_tnl_list) { - cJSON *n3_dl_forwarding_tnl_list_local_nonprimitive; - if (!cJSON_IsArray(n3_dl_forwarding_tnl_list)){ - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [n3_dl_forwarding_tnl_list]"); - goto end; - } - - n3_dl_forwarding_tnl_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(n3_dl_forwarding_tnl_list_local_nonprimitive, n3_dl_forwarding_tnl_list ) { - if (!cJSON_IsObject(n3_dl_forwarding_tnl_list_local_nonprimitive)) { + cJSON *n3_dl_forwarding_tnl_list_local = NULL; + if (!cJSON_IsArray(n3_dl_forwarding_tnl_list)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [n3_dl_forwarding_tnl_list]"); goto end; } - OpenAPI_indirect_data_forwarding_tunnel_info_t *n3_dl_forwarding_tnl_listItem = OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(n3_dl_forwarding_tnl_list_local_nonprimitive); - if (!n3_dl_forwarding_tnl_listItem) { - ogs_error("No n3_dl_forwarding_tnl_listItem"); - OpenAPI_list_free(n3_dl_forwarding_tnl_listList); - goto end; + n3_dl_forwarding_tnl_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(n3_dl_forwarding_tnl_list_local, n3_dl_forwarding_tnl_list) { + if (!cJSON_IsObject(n3_dl_forwarding_tnl_list_local)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [n3_dl_forwarding_tnl_list]"); + goto end; + } + OpenAPI_indirect_data_forwarding_tunnel_info_t *n3_dl_forwarding_tnl_listItem = OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(n3_dl_forwarding_tnl_list_local); + if (!n3_dl_forwarding_tnl_listItem) { + ogs_error("No n3_dl_forwarding_tnl_listItem"); + OpenAPI_list_free(n3_dl_forwarding_tnl_listList); + goto end; + } + OpenAPI_list_add(n3_dl_forwarding_tnl_listList, n3_dl_forwarding_tnl_listItem); } - - OpenAPI_list_add(n3_dl_forwarding_tnl_listList, n3_dl_forwarding_tnl_listItem); - } } - cJSON *n3_ul_forwarding_tnl_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n3UlForwardingTnlList"); - - OpenAPI_list_t *n3_ul_forwarding_tnl_listList; + n3_ul_forwarding_tnl_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "n3UlForwardingTnlList"); if (n3_ul_forwarding_tnl_list) { - cJSON *n3_ul_forwarding_tnl_list_local_nonprimitive; - if (!cJSON_IsArray(n3_ul_forwarding_tnl_list)){ - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [n3_ul_forwarding_tnl_list]"); - goto end; - } - - n3_ul_forwarding_tnl_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(n3_ul_forwarding_tnl_list_local_nonprimitive, n3_ul_forwarding_tnl_list ) { - if (!cJSON_IsObject(n3_ul_forwarding_tnl_list_local_nonprimitive)) { + cJSON *n3_ul_forwarding_tnl_list_local = NULL; + if (!cJSON_IsArray(n3_ul_forwarding_tnl_list)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [n3_ul_forwarding_tnl_list]"); goto end; } - OpenAPI_indirect_data_forwarding_tunnel_info_t *n3_ul_forwarding_tnl_listItem = OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(n3_ul_forwarding_tnl_list_local_nonprimitive); - if (!n3_ul_forwarding_tnl_listItem) { - ogs_error("No n3_ul_forwarding_tnl_listItem"); - OpenAPI_list_free(n3_ul_forwarding_tnl_listList); - goto end; + n3_ul_forwarding_tnl_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(n3_ul_forwarding_tnl_list_local, n3_ul_forwarding_tnl_list) { + if (!cJSON_IsObject(n3_ul_forwarding_tnl_list_local)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [n3_ul_forwarding_tnl_list]"); + goto end; + } + OpenAPI_indirect_data_forwarding_tunnel_info_t *n3_ul_forwarding_tnl_listItem = OpenAPI_indirect_data_forwarding_tunnel_info_parseFromJSON(n3_ul_forwarding_tnl_list_local); + if (!n3_ul_forwarding_tnl_listItem) { + ogs_error("No n3_ul_forwarding_tnl_listItem"); + OpenAPI_list_free(n3_ul_forwarding_tnl_listList); + goto end; + } + OpenAPI_list_add(n3_ul_forwarding_tnl_listList, n3_ul_forwarding_tnl_listItem); } - - OpenAPI_list_add(n3_ul_forwarding_tnl_listList, n3_ul_forwarding_tnl_listItem); - } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "cause"); - - OpenAPI_cause_e causeVariable; + cause = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "cause"); if (cause) { if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [cause]"); @@ -562,8 +594,7 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON causeVariable = OpenAPI_cause_FromString(cause->valuestring); } - cJSON *ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "maAcceptedInd"); - + ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "maAcceptedInd"); if (ma_accepted_ind) { if (!cJSON_IsBool(ma_accepted_ind)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [ma_accepted_ind]"); @@ -571,57 +602,54 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *forwarding_f_teid = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "forwardingFTeid"); - + forwarding_f_teid = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "forwardingFTeid"); if (forwarding_f_teid) { - if (!cJSON_IsNumber(forwarding_f_teid)) { + if (!cJSON_IsString(forwarding_f_teid) && !cJSON_IsNull(forwarding_f_teid)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [forwarding_f_teid]"); goto end; } } - cJSON *forwarding_bearer_contexts = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "forwardingBearerContexts"); - - OpenAPI_list_t *forwarding_bearer_contextsList; + forwarding_bearer_contexts = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "forwardingBearerContexts"); if (forwarding_bearer_contexts) { - cJSON *forwarding_bearer_contexts_local; - if (!cJSON_IsArray(forwarding_bearer_contexts)) { - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [forwarding_bearer_contexts]"); - goto end; - } - forwarding_bearer_contextsList = OpenAPI_list_create(); + cJSON *forwarding_bearer_contexts_local = NULL; + if (!cJSON_IsArray(forwarding_bearer_contexts)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [forwarding_bearer_contexts]"); + goto end; + } - cJSON_ArrayForEach(forwarding_bearer_contexts_local, forwarding_bearer_contexts) { - if (!cJSON_IsString(forwarding_bearer_contexts_local)) { - ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [forwarding_bearer_contexts]"); - goto end; - } - OpenAPI_list_add(forwarding_bearer_contextsList, ogs_strdup(forwarding_bearer_contexts_local->valuestring)); - } + forwarding_bearer_contextsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(forwarding_bearer_contexts_local, forwarding_bearer_contexts) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(forwarding_bearer_contexts_local)) { + ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [forwarding_bearer_contexts]"); + goto end; + } + OpenAPI_list_add(forwarding_bearer_contextsList, ogs_strdup(forwarding_bearer_contexts_local->valuestring)); + } } - cJSON *selected_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "selectedSmfId"); - + selected_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "selectedSmfId"); if (selected_smf_id) { - if (!cJSON_IsString(selected_smf_id)) { + if (!cJSON_IsString(selected_smf_id) && !cJSON_IsNull(selected_smf_id)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [selected_smf_id]"); goto end; } } - cJSON *selected_old_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "selectedOldSmfId"); - + selected_old_smf_id = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "selectedOldSmfId"); if (selected_old_smf_id) { - if (!cJSON_IsString(selected_old_smf_id)) { + if (!cJSON_IsString(selected_old_smf_id) && !cJSON_IsNull(selected_old_smf_id)) { ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [selected_old_smf_id]"); goto end; } @@ -644,15 +672,72 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON cause ? causeVariable : 0, ma_accepted_ind ? true : false, ma_accepted_ind ? ma_accepted_ind->valueint : 0, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, - forwarding_f_teid ? forwarding_f_teid->valueint : 0, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, + forwarding_f_teid && !cJSON_IsNull(forwarding_f_teid) ? ogs_strdup(forwarding_f_teid->valuestring) : NULL, forwarding_bearer_contexts ? forwarding_bearer_contextsList : NULL, - selected_smf_id ? ogs_strdup(selected_smf_id->valuestring) : NULL, - selected_old_smf_id ? ogs_strdup(selected_old_smf_id->valuestring) : NULL + selected_smf_id && !cJSON_IsNull(selected_smf_id) ? ogs_strdup(selected_smf_id->valuestring) : NULL, + selected_old_smf_id && !cJSON_IsNull(selected_old_smf_id) ? ogs_strdup(selected_old_smf_id->valuestring) : NULL ); return sm_context_updated_data_local_var; end: + if (release_ebi_listList) { + OpenAPI_list_for_each(release_ebi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(release_ebi_listList); + release_ebi_listList = NULL; + } + if (allocated_ebi_listList) { + OpenAPI_list_for_each(allocated_ebi_listList, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(allocated_ebi_listList); + allocated_ebi_listList = NULL; + } + if (modified_ebi_listList) { + OpenAPI_list_for_each(modified_ebi_listList, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(modified_ebi_listList); + modified_ebi_listList = NULL; + } + if (n1_sm_msg_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_msg_local_nonprim); + n1_sm_msg_local_nonprim = NULL; + } + if (n2_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n2_sm_info_local_nonprim); + n2_sm_info_local_nonprim = NULL; + } + if (eps_bearer_setupList) { + OpenAPI_list_for_each(eps_bearer_setupList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(eps_bearer_setupList); + eps_bearer_setupList = NULL; + } + if (n3_dl_forwarding_tnl_listList) { + OpenAPI_list_for_each(n3_dl_forwarding_tnl_listList, node) { + OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + } + OpenAPI_list_free(n3_dl_forwarding_tnl_listList); + n3_dl_forwarding_tnl_listList = NULL; + } + if (n3_ul_forwarding_tnl_listList) { + OpenAPI_list_for_each(n3_ul_forwarding_tnl_listList, node) { + OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data); + } + OpenAPI_list_free(n3_ul_forwarding_tnl_listList); + n3_ul_forwarding_tnl_listList = NULL; + } + if (forwarding_bearer_contextsList) { + OpenAPI_list_for_each(forwarding_bearer_contextsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(forwarding_bearer_contextsList); + forwarding_bearer_contextsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_context_updated_data.h b/lib/sbi/openapi/model/sm_context_updated_data.h index da3289cc1..63d44f8e2 100644 --- a/lib/sbi/openapi/model/sm_context_updated_data.h +++ b/lib/sbi/openapi/model/sm_context_updated_data.h @@ -43,7 +43,7 @@ typedef struct OpenAPI_sm_context_updated_data_s { bool is_ma_accepted_ind; int ma_accepted_ind; char *supported_features; - char forwarding_f_teid; + char *forwarding_f_teid; OpenAPI_list_t *forwarding_bearer_contexts; char *selected_smf_id; char *selected_old_smf_id; @@ -67,7 +67,7 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_create( bool is_ma_accepted_ind, int ma_accepted_ind, char *supported_features, - char forwarding_f_teid, + char *forwarding_f_teid, OpenAPI_list_t *forwarding_bearer_contexts, char *selected_smf_id, char *selected_old_smf_id diff --git a/lib/sbi/openapi/model/sm_policy_context_data.c b/lib/sbi/openapi/model/sm_policy_context_data.c index 48cacf598..d9705c274 100644 --- a/lib/sbi/openapi/model/sm_policy_context_data.c +++ b/lib/sbi/openapi/model/sm_policy_context_data.c @@ -112,54 +112,143 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_create( void OpenAPI_sm_policy_context_data_free(OpenAPI_sm_policy_context_data_t *sm_policy_context_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_context_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_acc_net_ch_id_free(sm_policy_context_data->acc_net_ch_id); - OpenAPI_acc_net_charging_address_free(sm_policy_context_data->charg_entity_addr); - ogs_free(sm_policy_context_data->gpsi); - ogs_free(sm_policy_context_data->supi); - OpenAPI_list_for_each(sm_policy_context_data->inter_grp_ids, node) { - ogs_free(node->data); + if (sm_policy_context_data->acc_net_ch_id) { + OpenAPI_acc_net_ch_id_free(sm_policy_context_data->acc_net_ch_id); + sm_policy_context_data->acc_net_ch_id = NULL; } - OpenAPI_list_free(sm_policy_context_data->inter_grp_ids); - ogs_free(sm_policy_context_data->chargingcharacteristics); - ogs_free(sm_policy_context_data->dnn); - ogs_free(sm_policy_context_data->notification_uri); - OpenAPI_additional_access_info_free(sm_policy_context_data->add_access_info); - OpenAPI_plmn_id_nid_free(sm_policy_context_data->serving_network); - OpenAPI_user_location_free(sm_policy_context_data->user_location_info); - ogs_free(sm_policy_context_data->ue_time_zone); - ogs_free(sm_policy_context_data->pei); - ogs_free(sm_policy_context_data->ipv4_address); - ogs_free(sm_policy_context_data->ipv6_address_prefix); - ogs_free(sm_policy_context_data->ip_domain); - OpenAPI_ambr_free(sm_policy_context_data->subs_sess_ambr); - ogs_free(sm_policy_context_data->auth_prof_index); - OpenAPI_subscribed_default_qos_free(sm_policy_context_data->subs_def_qos); - OpenAPI_vplmn_qos_free(sm_policy_context_data->vplmn_qos); - OpenAPI_trace_data_free(sm_policy_context_data->trace_req); - OpenAPI_snssai_free(sm_policy_context_data->slice_info); - OpenAPI_serving_nf_identity_free(sm_policy_context_data->serv_nf_id); - ogs_free(sm_policy_context_data->supp_feat); - ogs_free(sm_policy_context_data->smf_id); - ogs_free(sm_policy_context_data->recovery_time); - OpenAPI_atsss_capability_free(sm_policy_context_data->atsss_capab); - OpenAPI_list_for_each(sm_policy_context_data->ipv4_frame_route_list, node) { - ogs_free(node->data); + if (sm_policy_context_data->charg_entity_addr) { + OpenAPI_acc_net_charging_address_free(sm_policy_context_data->charg_entity_addr); + sm_policy_context_data->charg_entity_addr = NULL; } - OpenAPI_list_free(sm_policy_context_data->ipv4_frame_route_list); - OpenAPI_list_for_each(sm_policy_context_data->ipv6_frame_route_list, node) { - ogs_free(node->data); + if (sm_policy_context_data->gpsi) { + ogs_free(sm_policy_context_data->gpsi); + sm_policy_context_data->gpsi = NULL; + } + if (sm_policy_context_data->supi) { + ogs_free(sm_policy_context_data->supi); + sm_policy_context_data->supi = NULL; + } + if (sm_policy_context_data->inter_grp_ids) { + OpenAPI_list_for_each(sm_policy_context_data->inter_grp_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_policy_context_data->inter_grp_ids); + sm_policy_context_data->inter_grp_ids = NULL; + } + if (sm_policy_context_data->chargingcharacteristics) { + ogs_free(sm_policy_context_data->chargingcharacteristics); + sm_policy_context_data->chargingcharacteristics = NULL; + } + if (sm_policy_context_data->dnn) { + ogs_free(sm_policy_context_data->dnn); + sm_policy_context_data->dnn = NULL; + } + if (sm_policy_context_data->notification_uri) { + ogs_free(sm_policy_context_data->notification_uri); + sm_policy_context_data->notification_uri = NULL; + } + if (sm_policy_context_data->add_access_info) { + OpenAPI_additional_access_info_free(sm_policy_context_data->add_access_info); + sm_policy_context_data->add_access_info = NULL; + } + if (sm_policy_context_data->serving_network) { + OpenAPI_plmn_id_nid_free(sm_policy_context_data->serving_network); + sm_policy_context_data->serving_network = NULL; + } + if (sm_policy_context_data->user_location_info) { + OpenAPI_user_location_free(sm_policy_context_data->user_location_info); + sm_policy_context_data->user_location_info = NULL; + } + if (sm_policy_context_data->ue_time_zone) { + ogs_free(sm_policy_context_data->ue_time_zone); + sm_policy_context_data->ue_time_zone = NULL; + } + if (sm_policy_context_data->pei) { + ogs_free(sm_policy_context_data->pei); + sm_policy_context_data->pei = NULL; + } + if (sm_policy_context_data->ipv4_address) { + ogs_free(sm_policy_context_data->ipv4_address); + sm_policy_context_data->ipv4_address = NULL; + } + if (sm_policy_context_data->ipv6_address_prefix) { + ogs_free(sm_policy_context_data->ipv6_address_prefix); + sm_policy_context_data->ipv6_address_prefix = NULL; + } + if (sm_policy_context_data->ip_domain) { + ogs_free(sm_policy_context_data->ip_domain); + sm_policy_context_data->ip_domain = NULL; + } + if (sm_policy_context_data->subs_sess_ambr) { + OpenAPI_ambr_free(sm_policy_context_data->subs_sess_ambr); + sm_policy_context_data->subs_sess_ambr = NULL; + } + if (sm_policy_context_data->auth_prof_index) { + ogs_free(sm_policy_context_data->auth_prof_index); + sm_policy_context_data->auth_prof_index = NULL; + } + if (sm_policy_context_data->subs_def_qos) { + OpenAPI_subscribed_default_qos_free(sm_policy_context_data->subs_def_qos); + sm_policy_context_data->subs_def_qos = NULL; + } + if (sm_policy_context_data->vplmn_qos) { + OpenAPI_vplmn_qos_free(sm_policy_context_data->vplmn_qos); + sm_policy_context_data->vplmn_qos = NULL; + } + if (sm_policy_context_data->trace_req) { + OpenAPI_trace_data_free(sm_policy_context_data->trace_req); + sm_policy_context_data->trace_req = NULL; + } + if (sm_policy_context_data->slice_info) { + OpenAPI_snssai_free(sm_policy_context_data->slice_info); + sm_policy_context_data->slice_info = NULL; + } + if (sm_policy_context_data->serv_nf_id) { + OpenAPI_serving_nf_identity_free(sm_policy_context_data->serv_nf_id); + sm_policy_context_data->serv_nf_id = NULL; + } + if (sm_policy_context_data->supp_feat) { + ogs_free(sm_policy_context_data->supp_feat); + sm_policy_context_data->supp_feat = NULL; + } + if (sm_policy_context_data->smf_id) { + ogs_free(sm_policy_context_data->smf_id); + sm_policy_context_data->smf_id = NULL; + } + if (sm_policy_context_data->recovery_time) { + ogs_free(sm_policy_context_data->recovery_time); + sm_policy_context_data->recovery_time = NULL; + } + if (sm_policy_context_data->atsss_capab) { + OpenAPI_atsss_capability_free(sm_policy_context_data->atsss_capab); + sm_policy_context_data->atsss_capab = NULL; + } + if (sm_policy_context_data->ipv4_frame_route_list) { + OpenAPI_list_for_each(sm_policy_context_data->ipv4_frame_route_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_policy_context_data->ipv4_frame_route_list); + sm_policy_context_data->ipv4_frame_route_list = NULL; + } + if (sm_policy_context_data->ipv6_frame_route_list) { + OpenAPI_list_for_each(sm_policy_context_data->ipv6_frame_route_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_policy_context_data->ipv6_frame_route_list); + sm_policy_context_data->ipv6_frame_route_list = NULL; } - OpenAPI_list_free(sm_policy_context_data->ipv6_frame_route_list); ogs_free(sm_policy_context_data); } cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_data_t *sm_policy_context_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_context_data == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [SmPolicyContextData]"); @@ -200,6 +289,10 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da } } + if (!sm_policy_context_data->supi) { + ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [supi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supi", sm_policy_context_data->supi) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [supi]"); goto end; @@ -213,19 +306,17 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da } if (sm_policy_context_data->inter_grp_ids) { - cJSON *inter_grp_ids = cJSON_AddArrayToObject(item, "interGrpIds"); - if (inter_grp_ids == NULL) { + cJSON *inter_grp_idsList = cJSON_AddArrayToObject(item, "interGrpIds"); + if (inter_grp_idsList == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [inter_grp_ids]"); goto end; } - - OpenAPI_lnode_t *inter_grp_ids_node; - OpenAPI_list_for_each(sm_policy_context_data->inter_grp_ids, inter_grp_ids_node) { - if (cJSON_AddStringToObject(inter_grp_ids, "", (char*)inter_grp_ids_node->data) == NULL) { - ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [inter_grp_ids]"); - goto end; + OpenAPI_list_for_each(sm_policy_context_data->inter_grp_ids, node) { + if (cJSON_AddStringToObject(inter_grp_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [inter_grp_ids]"); + goto end; + } } - } } if (cJSON_AddNumberToObject(item, "pduSessionId", sm_policy_context_data->pdu_session_id) == NULL) { @@ -233,6 +324,10 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da goto end; } + if (sm_policy_context_data->pdu_session_type == OpenAPI_pdu_session_type_NULL) { + ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [pdu_session_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "pduSessionType", OpenAPI_pdu_session_type_ToString(sm_policy_context_data->pdu_session_type)) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [pdu_session_type]"); goto end; @@ -245,31 +340,39 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da } } + if (!sm_policy_context_data->dnn) { + ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", sm_policy_context_data->dnn) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [dnn]"); goto end; } - if (sm_policy_context_data->dnn_sel_mode) { + if (sm_policy_context_data->dnn_sel_mode != OpenAPI_dnn_selection_mode_NULL) { if (cJSON_AddStringToObject(item, "dnnSelMode", OpenAPI_dnn_selection_mode_ToString(sm_policy_context_data->dnn_sel_mode)) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [dnn_sel_mode]"); goto end; } } + if (!sm_policy_context_data->notification_uri) { + ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [notification_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationUri", sm_policy_context_data->notification_uri) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [notification_uri]"); goto end; } - if (sm_policy_context_data->access_type) { + if (sm_policy_context_data->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(sm_policy_context_data->access_type)) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [access_type]"); goto end; } } - if (sm_policy_context_data->rat_type) { + if (sm_policy_context_data->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(sm_policy_context_data->rat_type)) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [rat_type]"); goto end; @@ -444,6 +547,10 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da } } + if (!sm_policy_context_data->slice_info) { + ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [slice_info]"); + return NULL; + } cJSON *slice_info_local_JSON = OpenAPI_snssai_convertToJSON(sm_policy_context_data->slice_info); if (slice_info_local_JSON == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [slice_info]"); @@ -455,7 +562,7 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da goto end; } - if (sm_policy_context_data->qos_flow_usage) { + if (sm_policy_context_data->qos_flow_usage != OpenAPI_qos_flow_usage_NULL) { if (cJSON_AddStringToObject(item, "qosFlowUsage", OpenAPI_qos_flow_usage_ToString(sm_policy_context_data->qos_flow_usage)) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [qos_flow_usage]"); goto end; @@ -496,7 +603,7 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da } } - if (sm_policy_context_data->ma_pdu_ind) { + if (sm_policy_context_data->ma_pdu_ind != OpenAPI_ma_pdu_indication_NULL) { if (cJSON_AddStringToObject(item, "maPduInd", OpenAPI_ma_pdu_indication_ToString(sm_policy_context_data->ma_pdu_ind)) == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ma_pdu_ind]"); goto end; @@ -517,35 +624,31 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da } if (sm_policy_context_data->ipv4_frame_route_list) { - cJSON *ipv4_frame_route_list = cJSON_AddArrayToObject(item, "ipv4FrameRouteList"); - if (ipv4_frame_route_list == NULL) { + cJSON *ipv4_frame_route_listList = cJSON_AddArrayToObject(item, "ipv4FrameRouteList"); + if (ipv4_frame_route_listList == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ipv4_frame_route_list]"); goto end; } - - OpenAPI_lnode_t *ipv4_frame_route_list_node; - OpenAPI_list_for_each(sm_policy_context_data->ipv4_frame_route_list, ipv4_frame_route_list_node) { - if (cJSON_AddStringToObject(ipv4_frame_route_list, "", (char*)ipv4_frame_route_list_node->data) == NULL) { - ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ipv4_frame_route_list]"); - goto end; + OpenAPI_list_for_each(sm_policy_context_data->ipv4_frame_route_list, node) { + if (cJSON_AddStringToObject(ipv4_frame_route_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ipv4_frame_route_list]"); + goto end; + } } - } } if (sm_policy_context_data->ipv6_frame_route_list) { - cJSON *ipv6_frame_route_list = cJSON_AddArrayToObject(item, "ipv6FrameRouteList"); - if (ipv6_frame_route_list == NULL) { + cJSON *ipv6_frame_route_listList = cJSON_AddArrayToObject(item, "ipv6FrameRouteList"); + if (ipv6_frame_route_listList == NULL) { ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ipv6_frame_route_list]"); goto end; } - - OpenAPI_lnode_t *ipv6_frame_route_list_node; - OpenAPI_list_for_each(sm_policy_context_data->ipv6_frame_route_list, ipv6_frame_route_list_node) { - if (cJSON_AddStringToObject(ipv6_frame_route_list, "", (char*)ipv6_frame_route_list_node->data) == NULL) { - ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ipv6_frame_route_list]"); - goto end; + OpenAPI_list_for_each(sm_policy_context_data->ipv6_frame_route_list, node) { + if (cJSON_AddStringToObject(ipv6_frame_route_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ipv6_frame_route_list]"); + goto end; + } } - } } end: @@ -555,42 +658,99 @@ end: OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(cJSON *sm_policy_context_dataJSON) { OpenAPI_sm_policy_context_data_t *sm_policy_context_data_local_var = NULL; - cJSON *acc_net_ch_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "accNetChId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *acc_net_ch_id = NULL; OpenAPI_acc_net_ch_id_t *acc_net_ch_id_local_nonprim = NULL; + cJSON *charg_entity_addr = NULL; + OpenAPI_acc_net_charging_address_t *charg_entity_addr_local_nonprim = NULL; + cJSON *gpsi = NULL; + cJSON *supi = NULL; + cJSON *invalid_supi = NULL; + cJSON *inter_grp_ids = NULL; + OpenAPI_list_t *inter_grp_idsList = NULL; + cJSON *pdu_session_id = NULL; + cJSON *pdu_session_type = NULL; + OpenAPI_pdu_session_type_e pdu_session_typeVariable = 0; + cJSON *chargingcharacteristics = NULL; + cJSON *dnn = NULL; + cJSON *dnn_sel_mode = NULL; + OpenAPI_dnn_selection_mode_e dnn_sel_modeVariable = 0; + cJSON *notification_uri = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *add_access_info = NULL; + OpenAPI_additional_access_info_t *add_access_info_local_nonprim = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + cJSON *user_location_info = NULL; + OpenAPI_user_location_t *user_location_info_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *pei = NULL; + cJSON *ipv4_address = NULL; + cJSON *ipv6_address_prefix = NULL; + cJSON *ip_domain = NULL; + cJSON *subs_sess_ambr = NULL; + OpenAPI_ambr_t *subs_sess_ambr_local_nonprim = NULL; + cJSON *auth_prof_index = NULL; + cJSON *subs_def_qos = NULL; + OpenAPI_subscribed_default_qos_t *subs_def_qos_local_nonprim = NULL; + cJSON *vplmn_qos = NULL; + OpenAPI_vplmn_qos_t *vplmn_qos_local_nonprim = NULL; + cJSON *num_of_pack_filter = NULL; + cJSON *online = NULL; + cJSON *offline = NULL; + cJSON *_3gpp_ps_data_off_status = NULL; + cJSON *ref_qos_indication = NULL; + cJSON *trace_req = NULL; + OpenAPI_trace_data_t *trace_req_local_nonprim = NULL; + cJSON *slice_info = NULL; + OpenAPI_snssai_t *slice_info_local_nonprim = NULL; + cJSON *qos_flow_usage = NULL; + OpenAPI_qos_flow_usage_e qos_flow_usageVariable = 0; + cJSON *serv_nf_id = NULL; + OpenAPI_serving_nf_identity_t *serv_nf_id_local_nonprim = NULL; + cJSON *supp_feat = NULL; + cJSON *smf_id = NULL; + cJSON *recovery_time = NULL; + cJSON *ma_pdu_ind = NULL; + OpenAPI_ma_pdu_indication_e ma_pdu_indVariable = 0; + cJSON *atsss_capab = NULL; + OpenAPI_atsss_capability_t *atsss_capab_local_nonprim = NULL; + cJSON *ipv4_frame_route_list = NULL; + OpenAPI_list_t *ipv4_frame_route_listList = NULL; + cJSON *ipv6_frame_route_list = NULL; + OpenAPI_list_t *ipv6_frame_route_listList = NULL; + acc_net_ch_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "accNetChId"); if (acc_net_ch_id) { acc_net_ch_id_local_nonprim = OpenAPI_acc_net_ch_id_parseFromJSON(acc_net_ch_id); } - cJSON *charg_entity_addr = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "chargEntityAddr"); - - OpenAPI_acc_net_charging_address_t *charg_entity_addr_local_nonprim = NULL; + charg_entity_addr = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "chargEntityAddr"); if (charg_entity_addr) { charg_entity_addr_local_nonprim = OpenAPI_acc_net_charging_address_parseFromJSON(charg_entity_addr); } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "supi"); + supi = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "supi"); if (!supi) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [supi]"); goto end; } - if (!cJSON_IsString(supi)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [supi]"); goto end; } - cJSON *invalid_supi = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "invalidSupi"); - + invalid_supi = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "invalidSupi"); if (invalid_supi) { if (!cJSON_IsBool(invalid_supi)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [invalid_supi]"); @@ -598,73 +758,67 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c } } - cJSON *inter_grp_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "interGrpIds"); - - OpenAPI_list_t *inter_grp_idsList; + inter_grp_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "interGrpIds"); if (inter_grp_ids) { - cJSON *inter_grp_ids_local; - if (!cJSON_IsArray(inter_grp_ids)) { - ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [inter_grp_ids]"); - goto end; - } - inter_grp_idsList = OpenAPI_list_create(); + cJSON *inter_grp_ids_local = NULL; + if (!cJSON_IsArray(inter_grp_ids)) { + ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [inter_grp_ids]"); + goto end; + } - cJSON_ArrayForEach(inter_grp_ids_local, inter_grp_ids) { - if (!cJSON_IsString(inter_grp_ids_local)) { - ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [inter_grp_ids]"); - goto end; - } - OpenAPI_list_add(inter_grp_idsList, ogs_strdup(inter_grp_ids_local->valuestring)); - } + inter_grp_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(inter_grp_ids_local, inter_grp_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(inter_grp_ids_local)) { + ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [inter_grp_ids]"); + goto end; + } + OpenAPI_list_add(inter_grp_idsList, ogs_strdup(inter_grp_ids_local->valuestring)); + } } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "pduSessionId"); + pdu_session_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "pduSessionId"); if (!pdu_session_id) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [pdu_session_id]"); goto end; } - if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [pdu_session_id]"); goto end; } - cJSON *pdu_session_type = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "pduSessionType"); + pdu_session_type = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "pduSessionType"); if (!pdu_session_type) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [pdu_session_type]"); goto end; } - - OpenAPI_pdu_session_type_e pdu_session_typeVariable; if (!cJSON_IsString(pdu_session_type)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [pdu_session_type]"); goto end; } pdu_session_typeVariable = OpenAPI_pdu_session_type_FromString(pdu_session_type->valuestring); - cJSON *chargingcharacteristics = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "chargingcharacteristics"); - + chargingcharacteristics = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "chargingcharacteristics"); if (chargingcharacteristics) { - if (!cJSON_IsString(chargingcharacteristics)) { + if (!cJSON_IsString(chargingcharacteristics) && !cJSON_IsNull(chargingcharacteristics)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [chargingcharacteristics]"); goto end; } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "dnn"); + dnn = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [dnn]"); goto end; } - cJSON *dnn_sel_mode = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "dnnSelMode"); - - OpenAPI_dnn_selection_mode_e dnn_sel_modeVariable; + dnn_sel_mode = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "dnnSelMode"); if (dnn_sel_mode) { if (!cJSON_IsString(dnn_sel_mode)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [dnn_sel_mode]"); @@ -673,20 +827,17 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c dnn_sel_modeVariable = OpenAPI_dnn_selection_mode_FromString(dnn_sel_mode->valuestring); } - cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "notificationUri"); + notification_uri = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "notificationUri"); if (!notification_uri) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [notification_uri]"); goto end; } - if (!cJSON_IsString(notification_uri)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [notification_uri]"); goto end; } - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + access_type = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [access_type]"); @@ -695,9 +846,7 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [rat_type]"); @@ -706,104 +855,85 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *add_access_info = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "addAccessInfo"); - - OpenAPI_additional_access_info_t *add_access_info_local_nonprim = NULL; + add_access_info = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "addAccessInfo"); if (add_access_info) { add_access_info_local_nonprim = OpenAPI_additional_access_info_parseFromJSON(add_access_info); } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "servingNetwork"); - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + serving_network = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "servingNetwork"); if (serving_network) { serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); } - cJSON *user_location_info = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "userLocationInfo"); - - OpenAPI_user_location_t *user_location_info_local_nonprim = NULL; + user_location_info = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "userLocationInfo"); if (user_location_info) { user_location_info_local_nonprim = OpenAPI_user_location_parseFromJSON(user_location_info); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [pei]"); goto end; } } - cJSON *ipv4_address = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipv4Address"); - + ipv4_address = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipv4Address"); if (ipv4_address) { - if (!cJSON_IsString(ipv4_address)) { + if (!cJSON_IsString(ipv4_address) && !cJSON_IsNull(ipv4_address)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv4_address]"); goto end; } } - cJSON *ipv6_address_prefix = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipv6AddressPrefix"); - + ipv6_address_prefix = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipv6AddressPrefix"); if (ipv6_address_prefix) { - if (!cJSON_IsString(ipv6_address_prefix)) { + if (!cJSON_IsString(ipv6_address_prefix) && !cJSON_IsNull(ipv6_address_prefix)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv6_address_prefix]"); goto end; } } - cJSON *ip_domain = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipDomain"); - + ip_domain = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipDomain"); if (ip_domain) { - if (!cJSON_IsString(ip_domain)) { + if (!cJSON_IsString(ip_domain) && !cJSON_IsNull(ip_domain)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ip_domain]"); goto end; } } - cJSON *subs_sess_ambr = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "subsSessAmbr"); - - OpenAPI_ambr_t *subs_sess_ambr_local_nonprim = NULL; + subs_sess_ambr = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "subsSessAmbr"); if (subs_sess_ambr) { subs_sess_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(subs_sess_ambr); } - cJSON *auth_prof_index = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "authProfIndex"); - + auth_prof_index = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "authProfIndex"); if (auth_prof_index) { - if (!cJSON_IsString(auth_prof_index)) { + if (!cJSON_IsString(auth_prof_index) && !cJSON_IsNull(auth_prof_index)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [auth_prof_index]"); goto end; } } - cJSON *subs_def_qos = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "subsDefQos"); - - OpenAPI_subscribed_default_qos_t *subs_def_qos_local_nonprim = NULL; + subs_def_qos = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "subsDefQos"); if (subs_def_qos) { subs_def_qos_local_nonprim = OpenAPI_subscribed_default_qos_parseFromJSON(subs_def_qos); } - cJSON *vplmn_qos = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "vplmnQos"); - - OpenAPI_vplmn_qos_t *vplmn_qos_local_nonprim = NULL; + vplmn_qos = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "vplmnQos"); if (vplmn_qos) { vplmn_qos_local_nonprim = OpenAPI_vplmn_qos_parseFromJSON(vplmn_qos); } - cJSON *num_of_pack_filter = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "numOfPackFilter"); - + num_of_pack_filter = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "numOfPackFilter"); if (num_of_pack_filter) { if (!cJSON_IsNumber(num_of_pack_filter)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [num_of_pack_filter]"); @@ -811,8 +941,7 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c } } - cJSON *online = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "online"); - + online = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "online"); if (online) { if (!cJSON_IsBool(online)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [online]"); @@ -820,8 +949,7 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c } } - cJSON *offline = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "offline"); - + offline = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "offline"); if (offline) { if (!cJSON_IsBool(offline)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [offline]"); @@ -829,8 +957,7 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c } } - cJSON *_3gpp_ps_data_off_status = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "3gppPsDataOffStatus"); - + _3gpp_ps_data_off_status = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "3gppPsDataOffStatus"); if (_3gpp_ps_data_off_status) { if (!cJSON_IsBool(_3gpp_ps_data_off_status)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [_3gpp_ps_data_off_status]"); @@ -838,8 +965,7 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c } } - cJSON *ref_qos_indication = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "refQosIndication"); - + ref_qos_indication = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "refQosIndication"); if (ref_qos_indication) { if (!cJSON_IsBool(ref_qos_indication)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ref_qos_indication]"); @@ -847,25 +973,19 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c } } - cJSON *trace_req = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "traceReq"); - - OpenAPI_trace_data_t *trace_req_local_nonprim = NULL; + trace_req = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "traceReq"); if (trace_req) { trace_req_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_req); } - cJSON *slice_info = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "sliceInfo"); + slice_info = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "sliceInfo"); if (!slice_info) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [slice_info]"); goto end; } - - OpenAPI_snssai_t *slice_info_local_nonprim = NULL; slice_info_local_nonprim = OpenAPI_snssai_parseFromJSON(slice_info); - cJSON *qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "qosFlowUsage"); - - OpenAPI_qos_flow_usage_e qos_flow_usageVariable; + qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "qosFlowUsage"); if (qos_flow_usage) { if (!cJSON_IsString(qos_flow_usage)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [qos_flow_usage]"); @@ -874,43 +994,36 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c qos_flow_usageVariable = OpenAPI_qos_flow_usage_FromString(qos_flow_usage->valuestring); } - cJSON *serv_nf_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "servNfId"); - - OpenAPI_serving_nf_identity_t *serv_nf_id_local_nonprim = NULL; + serv_nf_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "servNfId"); if (serv_nf_id) { serv_nf_id_local_nonprim = OpenAPI_serving_nf_identity_parseFromJSON(serv_nf_id); } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [supp_feat]"); goto end; } } - cJSON *smf_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "smfId"); - + smf_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "smfId"); if (smf_id) { - if (!cJSON_IsString(smf_id)) { + if (!cJSON_IsString(smf_id) && !cJSON_IsNull(smf_id)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [smf_id]"); goto end; } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *ma_pdu_ind = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "maPduInd"); - - OpenAPI_ma_pdu_indication_e ma_pdu_indVariable; + ma_pdu_ind = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "maPduInd"); if (ma_pdu_ind) { if (!cJSON_IsString(ma_pdu_ind)) { ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ma_pdu_ind]"); @@ -919,57 +1032,57 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c ma_pdu_indVariable = OpenAPI_ma_pdu_indication_FromString(ma_pdu_ind->valuestring); } - cJSON *atsss_capab = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "atsssCapab"); - - OpenAPI_atsss_capability_t *atsss_capab_local_nonprim = NULL; + atsss_capab = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "atsssCapab"); if (atsss_capab) { atsss_capab_local_nonprim = OpenAPI_atsss_capability_parseFromJSON(atsss_capab); } - cJSON *ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipv4FrameRouteList"); - - OpenAPI_list_t *ipv4_frame_route_listList; + ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipv4FrameRouteList"); if (ipv4_frame_route_list) { - cJSON *ipv4_frame_route_list_local; - if (!cJSON_IsArray(ipv4_frame_route_list)) { - ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv4_frame_route_list]"); - goto end; - } - ipv4_frame_route_listList = OpenAPI_list_create(); + cJSON *ipv4_frame_route_list_local = NULL; + if (!cJSON_IsArray(ipv4_frame_route_list)) { + ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv4_frame_route_list]"); + goto end; + } - cJSON_ArrayForEach(ipv4_frame_route_list_local, ipv4_frame_route_list) { - if (!cJSON_IsString(ipv4_frame_route_list_local)) { - ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv4_frame_route_list]"); - goto end; - } - OpenAPI_list_add(ipv4_frame_route_listList, ogs_strdup(ipv4_frame_route_list_local->valuestring)); - } + ipv4_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_frame_route_list_local, ipv4_frame_route_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_frame_route_list_local)) { + ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv4_frame_route_list]"); + goto end; + } + OpenAPI_list_add(ipv4_frame_route_listList, ogs_strdup(ipv4_frame_route_list_local->valuestring)); + } } - cJSON *ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipv6FrameRouteList"); - - OpenAPI_list_t *ipv6_frame_route_listList; + ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "ipv6FrameRouteList"); if (ipv6_frame_route_list) { - cJSON *ipv6_frame_route_list_local; - if (!cJSON_IsArray(ipv6_frame_route_list)) { - ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv6_frame_route_list]"); - goto end; - } - ipv6_frame_route_listList = OpenAPI_list_create(); + cJSON *ipv6_frame_route_list_local = NULL; + if (!cJSON_IsArray(ipv6_frame_route_list)) { + ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv6_frame_route_list]"); + goto end; + } - cJSON_ArrayForEach(ipv6_frame_route_list_local, ipv6_frame_route_list) { - if (!cJSON_IsString(ipv6_frame_route_list_local)) { - ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv6_frame_route_list]"); - goto end; - } - OpenAPI_list_add(ipv6_frame_route_listList, ogs_strdup(ipv6_frame_route_list_local->valuestring)); - } + ipv6_frame_route_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_frame_route_list_local, ipv6_frame_route_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_frame_route_list_local)) { + ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ipv6_frame_route_list]"); + goto end; + } + OpenAPI_list_add(ipv6_frame_route_listList, ogs_strdup(ipv6_frame_route_list_local->valuestring)); + } } sm_policy_context_data_local_var = OpenAPI_sm_policy_context_data_create ( acc_net_ch_id ? acc_net_ch_id_local_nonprim : NULL, charg_entity_addr ? charg_entity_addr_local_nonprim : NULL, - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, ogs_strdup(supi->valuestring), invalid_supi ? true : false, invalid_supi ? invalid_supi->valueint : 0, @@ -977,7 +1090,7 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c pdu_session_id->valuedouble, pdu_session_typeVariable, - chargingcharacteristics ? ogs_strdup(chargingcharacteristics->valuestring) : NULL, + chargingcharacteristics && !cJSON_IsNull(chargingcharacteristics) ? ogs_strdup(chargingcharacteristics->valuestring) : NULL, ogs_strdup(dnn->valuestring), dnn_sel_mode ? dnn_sel_modeVariable : 0, ogs_strdup(notification_uri->valuestring), @@ -986,13 +1099,13 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c add_access_info ? add_access_info_local_nonprim : NULL, serving_network ? serving_network_local_nonprim : NULL, user_location_info ? user_location_info_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, - pei ? ogs_strdup(pei->valuestring) : NULL, - ipv4_address ? ogs_strdup(ipv4_address->valuestring) : NULL, - ipv6_address_prefix ? ogs_strdup(ipv6_address_prefix->valuestring) : NULL, - ip_domain ? ogs_strdup(ip_domain->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, + ipv4_address && !cJSON_IsNull(ipv4_address) ? ogs_strdup(ipv4_address->valuestring) : NULL, + ipv6_address_prefix && !cJSON_IsNull(ipv6_address_prefix) ? ogs_strdup(ipv6_address_prefix->valuestring) : NULL, + ip_domain && !cJSON_IsNull(ip_domain) ? ogs_strdup(ip_domain->valuestring) : NULL, subs_sess_ambr ? subs_sess_ambr_local_nonprim : NULL, - auth_prof_index ? ogs_strdup(auth_prof_index->valuestring) : NULL, + auth_prof_index && !cJSON_IsNull(auth_prof_index) ? ogs_strdup(auth_prof_index->valuestring) : NULL, subs_def_qos ? subs_def_qos_local_nonprim : NULL, vplmn_qos ? vplmn_qos_local_nonprim : NULL, num_of_pack_filter ? true : false, @@ -1009,9 +1122,9 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c slice_info_local_nonprim, qos_flow_usage ? qos_flow_usageVariable : 0, serv_nf_id ? serv_nf_id_local_nonprim : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL, - smf_id ? ogs_strdup(smf_id->valuestring) : NULL, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL, + smf_id && !cJSON_IsNull(smf_id) ? ogs_strdup(smf_id->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, ma_pdu_ind ? ma_pdu_indVariable : 0, atsss_capab ? atsss_capab_local_nonprim : NULL, ipv4_frame_route_list ? ipv4_frame_route_listList : NULL, @@ -1020,6 +1133,75 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c return sm_policy_context_data_local_var; end: + if (acc_net_ch_id_local_nonprim) { + OpenAPI_acc_net_ch_id_free(acc_net_ch_id_local_nonprim); + acc_net_ch_id_local_nonprim = NULL; + } + if (charg_entity_addr_local_nonprim) { + OpenAPI_acc_net_charging_address_free(charg_entity_addr_local_nonprim); + charg_entity_addr_local_nonprim = NULL; + } + if (inter_grp_idsList) { + OpenAPI_list_for_each(inter_grp_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(inter_grp_idsList); + inter_grp_idsList = NULL; + } + if (add_access_info_local_nonprim) { + OpenAPI_additional_access_info_free(add_access_info_local_nonprim); + add_access_info_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (user_location_info_local_nonprim) { + OpenAPI_user_location_free(user_location_info_local_nonprim); + user_location_info_local_nonprim = NULL; + } + if (subs_sess_ambr_local_nonprim) { + OpenAPI_ambr_free(subs_sess_ambr_local_nonprim); + subs_sess_ambr_local_nonprim = NULL; + } + if (subs_def_qos_local_nonprim) { + OpenAPI_subscribed_default_qos_free(subs_def_qos_local_nonprim); + subs_def_qos_local_nonprim = NULL; + } + if (vplmn_qos_local_nonprim) { + OpenAPI_vplmn_qos_free(vplmn_qos_local_nonprim); + vplmn_qos_local_nonprim = NULL; + } + if (trace_req_local_nonprim) { + OpenAPI_trace_data_free(trace_req_local_nonprim); + trace_req_local_nonprim = NULL; + } + if (slice_info_local_nonprim) { + OpenAPI_snssai_free(slice_info_local_nonprim); + slice_info_local_nonprim = NULL; + } + if (serv_nf_id_local_nonprim) { + OpenAPI_serving_nf_identity_free(serv_nf_id_local_nonprim); + serv_nf_id_local_nonprim = NULL; + } + if (atsss_capab_local_nonprim) { + OpenAPI_atsss_capability_free(atsss_capab_local_nonprim); + atsss_capab_local_nonprim = NULL; + } + if (ipv4_frame_route_listList) { + OpenAPI_list_for_each(ipv4_frame_route_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_frame_route_listList); + ipv4_frame_route_listList = NULL; + } + if (ipv6_frame_route_listList) { + OpenAPI_list_for_each(ipv6_frame_route_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_frame_route_listList); + ipv6_frame_route_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_control.c b/lib/sbi/openapi/model/sm_policy_control.c index 8c7a3fc21..61af77adf 100644 --- a/lib/sbi/openapi/model/sm_policy_control.c +++ b/lib/sbi/openapi/model/sm_policy_control.c @@ -20,18 +20,26 @@ OpenAPI_sm_policy_control_t *OpenAPI_sm_policy_control_create( void OpenAPI_sm_policy_control_free(OpenAPI_sm_policy_control_t *sm_policy_control) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_control) { return; } - OpenAPI_lnode_t *node; - OpenAPI_sm_policy_context_data_free(sm_policy_control->context); - OpenAPI_sm_policy_decision_free(sm_policy_control->policy); + if (sm_policy_control->context) { + OpenAPI_sm_policy_context_data_free(sm_policy_control->context); + sm_policy_control->context = NULL; + } + if (sm_policy_control->policy) { + OpenAPI_sm_policy_decision_free(sm_policy_control->policy); + sm_policy_control->policy = NULL; + } ogs_free(sm_policy_control); } cJSON *OpenAPI_sm_policy_control_convertToJSON(OpenAPI_sm_policy_control_t *sm_policy_control) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_control == NULL) { ogs_error("OpenAPI_sm_policy_control_convertToJSON() failed [SmPolicyControl]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_sm_policy_control_convertToJSON(OpenAPI_sm_policy_control_t *sm_p } item = cJSON_CreateObject(); + if (!sm_policy_control->context) { + ogs_error("OpenAPI_sm_policy_control_convertToJSON() failed [context]"); + return NULL; + } cJSON *context_local_JSON = OpenAPI_sm_policy_context_data_convertToJSON(sm_policy_control->context); if (context_local_JSON == NULL) { ogs_error("OpenAPI_sm_policy_control_convertToJSON() failed [context]"); @@ -50,6 +62,10 @@ cJSON *OpenAPI_sm_policy_control_convertToJSON(OpenAPI_sm_policy_control_t *sm_p goto end; } + if (!sm_policy_control->policy) { + ogs_error("OpenAPI_sm_policy_control_convertToJSON() failed [policy]"); + return NULL; + } cJSON *policy_local_JSON = OpenAPI_sm_policy_decision_convertToJSON(sm_policy_control->policy); if (policy_local_JSON == NULL) { ogs_error("OpenAPI_sm_policy_control_convertToJSON() failed [policy]"); @@ -68,22 +84,23 @@ end: OpenAPI_sm_policy_control_t *OpenAPI_sm_policy_control_parseFromJSON(cJSON *sm_policy_controlJSON) { OpenAPI_sm_policy_control_t *sm_policy_control_local_var = NULL; - cJSON *context = cJSON_GetObjectItemCaseSensitive(sm_policy_controlJSON, "context"); + OpenAPI_lnode_t *node = NULL; + cJSON *context = NULL; + OpenAPI_sm_policy_context_data_t *context_local_nonprim = NULL; + cJSON *policy = NULL; + OpenAPI_sm_policy_decision_t *policy_local_nonprim = NULL; + context = cJSON_GetObjectItemCaseSensitive(sm_policy_controlJSON, "context"); if (!context) { ogs_error("OpenAPI_sm_policy_control_parseFromJSON() failed [context]"); goto end; } - - OpenAPI_sm_policy_context_data_t *context_local_nonprim = NULL; context_local_nonprim = OpenAPI_sm_policy_context_data_parseFromJSON(context); - cJSON *policy = cJSON_GetObjectItemCaseSensitive(sm_policy_controlJSON, "policy"); + policy = cJSON_GetObjectItemCaseSensitive(sm_policy_controlJSON, "policy"); if (!policy) { ogs_error("OpenAPI_sm_policy_control_parseFromJSON() failed [policy]"); goto end; } - - OpenAPI_sm_policy_decision_t *policy_local_nonprim = NULL; policy_local_nonprim = OpenAPI_sm_policy_decision_parseFromJSON(policy); sm_policy_control_local_var = OpenAPI_sm_policy_control_create ( @@ -93,6 +110,14 @@ OpenAPI_sm_policy_control_t *OpenAPI_sm_policy_control_parseFromJSON(cJSON *sm_p return sm_policy_control_local_var; end: + if (context_local_nonprim) { + OpenAPI_sm_policy_context_data_free(context_local_nonprim); + context_local_nonprim = NULL; + } + if (policy_local_nonprim) { + OpenAPI_sm_policy_decision_free(policy_local_nonprim); + policy_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_data.c b/lib/sbi/openapi/model/sm_policy_data.c index d14dfc25d..3eee8ed51 100644 --- a/lib/sbi/openapi/model/sm_policy_data.c +++ b/lib/sbi/openapi/model/sm_policy_data.c @@ -24,38 +24,52 @@ OpenAPI_sm_policy_data_t *OpenAPI_sm_policy_data_create( void OpenAPI_sm_policy_data_free(OpenAPI_sm_policy_data_t *sm_policy_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(sm_policy_data->sm_policy_snssai_data, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_sm_policy_snssai_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_data->sm_policy_snssai_data) { + OpenAPI_list_for_each(sm_policy_data->sm_policy_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_sm_policy_snssai_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data->sm_policy_snssai_data); + sm_policy_data->sm_policy_snssai_data = NULL; } - OpenAPI_list_free(sm_policy_data->sm_policy_snssai_data); - OpenAPI_list_for_each(sm_policy_data->um_data_limits, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_usage_mon_data_limit_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_data->um_data_limits) { + OpenAPI_list_for_each(sm_policy_data->um_data_limits, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_limit_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data->um_data_limits); + sm_policy_data->um_data_limits = NULL; } - OpenAPI_list_free(sm_policy_data->um_data_limits); - OpenAPI_list_for_each(sm_policy_data->um_data, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_usage_mon_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_data->um_data) { + OpenAPI_list_for_each(sm_policy_data->um_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data->um_data); + sm_policy_data->um_data = NULL; + } + if (sm_policy_data->supp_feat) { + ogs_free(sm_policy_data->supp_feat); + sm_policy_data->supp_feat = NULL; } - OpenAPI_list_free(sm_policy_data->um_data); - ogs_free(sm_policy_data->supp_feat); ogs_free(sm_policy_data); } cJSON *OpenAPI_sm_policy_data_convertToJSON(OpenAPI_sm_policy_data_t *sm_policy_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_data == NULL) { ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [SmPolicyData]"); @@ -63,26 +77,29 @@ cJSON *OpenAPI_sm_policy_data_convertToJSON(OpenAPI_sm_policy_data_t *sm_policy_ } item = cJSON_CreateObject(); + if (!sm_policy_data->sm_policy_snssai_data) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [sm_policy_snssai_data]"); + return NULL; + } cJSON *sm_policy_snssai_data = cJSON_AddObjectToObject(item, "smPolicySnssaiData"); if (sm_policy_snssai_data == NULL) { ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [sm_policy_snssai_data]"); goto end; } cJSON *localMapObject = sm_policy_snssai_data; - OpenAPI_lnode_t *sm_policy_snssai_data_node; if (sm_policy_data->sm_policy_snssai_data) { - OpenAPI_list_for_each(sm_policy_data->sm_policy_snssai_data, sm_policy_snssai_data_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sm_policy_snssai_data_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_sm_policy_snssai_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_data->sm_policy_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_sm_policy_snssai_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } + } if (sm_policy_data->um_data_limits) { cJSON *um_data_limits = cJSON_AddObjectToObject(item, "umDataLimits"); @@ -91,21 +108,20 @@ cJSON *OpenAPI_sm_policy_data_convertToJSON(OpenAPI_sm_policy_data_t *sm_policy_ goto end; } cJSON *localMapObject = um_data_limits; - OpenAPI_lnode_t *um_data_limits_node; if (sm_policy_data->um_data_limits) { - OpenAPI_list_for_each(sm_policy_data->um_data_limits, um_data_limits_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)um_data_limits_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_usage_mon_data_limit_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_data->um_data_limits, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_usage_mon_data_limit_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_data->um_data) { cJSON *um_data = cJSON_AddObjectToObject(item, "umData"); @@ -114,21 +130,20 @@ cJSON *OpenAPI_sm_policy_data_convertToJSON(OpenAPI_sm_policy_data_t *sm_policy_ goto end; } cJSON *localMapObject = um_data; - OpenAPI_lnode_t *um_data_node; if (sm_policy_data->um_data) { - OpenAPI_list_for_each(sm_policy_data->um_data, um_data_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)um_data_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_usage_mon_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_data->um_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_usage_mon_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_data->supp_feat) { if (cJSON_AddStringToObject(item, "suppFeat", sm_policy_data->supp_feat) == NULL) { @@ -144,90 +159,97 @@ end: OpenAPI_sm_policy_data_t *OpenAPI_sm_policy_data_parseFromJSON(cJSON *sm_policy_dataJSON) { OpenAPI_sm_policy_data_t *sm_policy_data_local_var = NULL; - cJSON *sm_policy_snssai_data = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "smPolicySnssaiData"); + OpenAPI_lnode_t *node = NULL; + cJSON *sm_policy_snssai_data = NULL; + OpenAPI_list_t *sm_policy_snssai_dataList = NULL; + cJSON *um_data_limits = NULL; + OpenAPI_list_t *um_data_limitsList = NULL; + cJSON *um_data = NULL; + OpenAPI_list_t *um_dataList = NULL; + cJSON *supp_feat = NULL; + sm_policy_snssai_data = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "smPolicySnssaiData"); if (!sm_policy_snssai_data) { ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [sm_policy_snssai_data]"); goto end; } - - OpenAPI_list_t *sm_policy_snssai_dataList; - cJSON *sm_policy_snssai_data_local_map; - if (!cJSON_IsObject(sm_policy_snssai_data)) { - ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [sm_policy_snssai_data]"); - goto end; - } - sm_policy_snssai_dataList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(sm_policy_snssai_data_local_map, sm_policy_snssai_data) { - cJSON *localMapObject = sm_policy_snssai_data_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_sm_policy_snssai_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [inner]"); + cJSON *sm_policy_snssai_data_local_map = NULL; + if (!cJSON_IsObject(sm_policy_snssai_data) && !cJSON_IsNull(sm_policy_snssai_data)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [sm_policy_snssai_data]"); goto end; } - OpenAPI_list_add(sm_policy_snssai_dataList, localMapKeyPair); - } + if (cJSON_IsObject(sm_policy_snssai_data)) { + sm_policy_snssai_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sm_policy_snssai_data_local_map, sm_policy_snssai_data) { + cJSON *localMapObject = sm_policy_snssai_data_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_sm_policy_snssai_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(sm_policy_snssai_dataList, localMapKeyPair); + } + } - cJSON *um_data_limits = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "umDataLimits"); - - OpenAPI_list_t *um_data_limitsList; + um_data_limits = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "umDataLimits"); if (um_data_limits) { - cJSON *um_data_limits_local_map; - if (!cJSON_IsObject(um_data_limits)) { - ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [um_data_limits]"); - goto end; - } - um_data_limitsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(um_data_limits_local_map, um_data_limits) { - cJSON *localMapObject = um_data_limits_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_limit_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [inner]"); + cJSON *um_data_limits_local_map = NULL; + if (!cJSON_IsObject(um_data_limits) && !cJSON_IsNull(um_data_limits)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [um_data_limits]"); goto end; } - OpenAPI_list_add(um_data_limitsList, localMapKeyPair); - } + if (cJSON_IsObject(um_data_limits)) { + um_data_limitsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(um_data_limits_local_map, um_data_limits) { + cJSON *localMapObject = um_data_limits_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_limit_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(um_data_limitsList, localMapKeyPair); + } + } } - cJSON *um_data = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "umData"); - - OpenAPI_list_t *um_dataList; + um_data = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "umData"); if (um_data) { - cJSON *um_data_local_map; - if (!cJSON_IsObject(um_data)) { - ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [um_data]"); - goto end; - } - um_dataList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(um_data_local_map, um_data) { - cJSON *localMapObject = um_data_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [inner]"); + cJSON *um_data_local_map = NULL; + if (!cJSON_IsObject(um_data) && !cJSON_IsNull(um_data)) { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [um_data]"); goto end; } - OpenAPI_list_add(um_dataList, localMapKeyPair); - } + if (cJSON_IsObject(um_data)) { + um_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(um_data_local_map, um_data) { + cJSON *localMapObject = um_data_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(um_dataList, localMapKeyPair); + } + } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(sm_policy_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_sm_policy_data_parseFromJSON() failed [supp_feat]"); goto end; } @@ -237,11 +259,41 @@ OpenAPI_sm_policy_data_t *OpenAPI_sm_policy_data_parseFromJSON(cJSON *sm_policy_ sm_policy_snssai_dataList, um_data_limits ? um_data_limitsList : NULL, um_data ? um_dataList : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return sm_policy_data_local_var; end: + if (sm_policy_snssai_dataList) { + OpenAPI_list_for_each(sm_policy_snssai_dataList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_sm_policy_snssai_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_snssai_dataList); + sm_policy_snssai_dataList = NULL; + } + if (um_data_limitsList) { + OpenAPI_list_for_each(um_data_limitsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_limit_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(um_data_limitsList); + um_data_limitsList = NULL; + } + if (um_dataList) { + OpenAPI_list_for_each(um_dataList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(um_dataList); + um_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_data_patch.c b/lib/sbi/openapi/model/sm_policy_data_patch.c index d853cde54..0639ec83a 100644 --- a/lib/sbi/openapi/model/sm_policy_data_patch.c +++ b/lib/sbi/openapi/model/sm_policy_data_patch.c @@ -20,30 +20,38 @@ OpenAPI_sm_policy_data_patch_t *OpenAPI_sm_policy_data_patch_create( void OpenAPI_sm_policy_data_patch_free(OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_data_patch) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(sm_policy_data_patch->um_data, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_usage_mon_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_data_patch->um_data) { + OpenAPI_list_for_each(sm_policy_data_patch->um_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data_patch->um_data); + sm_policy_data_patch->um_data = NULL; } - OpenAPI_list_free(sm_policy_data_patch->um_data); - OpenAPI_list_for_each(sm_policy_data_patch->sm_policy_snssai_data, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_sm_policy_snssai_data_patch_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_data_patch->sm_policy_snssai_data) { + OpenAPI_list_for_each(sm_policy_data_patch->sm_policy_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_sm_policy_snssai_data_patch_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_data_patch->sm_policy_snssai_data); + sm_policy_data_patch->sm_policy_snssai_data = NULL; } - OpenAPI_list_free(sm_policy_data_patch->sm_policy_snssai_data); ogs_free(sm_policy_data_patch); } cJSON *OpenAPI_sm_policy_data_patch_convertToJSON(OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_data_patch == NULL) { ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [SmPolicyDataPatch]"); @@ -58,21 +66,20 @@ cJSON *OpenAPI_sm_policy_data_patch_convertToJSON(OpenAPI_sm_policy_data_patch_t goto end; } cJSON *localMapObject = um_data; - OpenAPI_lnode_t *um_data_node; if (sm_policy_data_patch->um_data) { - OpenAPI_list_for_each(sm_policy_data_patch->um_data, um_data_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)um_data_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_usage_mon_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_data_patch->um_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_usage_mon_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_data_patch->sm_policy_snssai_data) { cJSON *sm_policy_snssai_data = cJSON_AddObjectToObject(item, "smPolicySnssaiData"); @@ -81,21 +88,20 @@ cJSON *OpenAPI_sm_policy_data_patch_convertToJSON(OpenAPI_sm_policy_data_patch_t goto end; } cJSON *localMapObject = sm_policy_snssai_data; - OpenAPI_lnode_t *sm_policy_snssai_data_node; if (sm_policy_data_patch->sm_policy_snssai_data) { - OpenAPI_list_for_each(sm_policy_data_patch->sm_policy_snssai_data, sm_policy_snssai_data_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sm_policy_snssai_data_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_sm_policy_snssai_data_patch_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_data_patch->sm_policy_snssai_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_sm_policy_snssai_data_patch_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_data_patch_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -104,56 +110,61 @@ end: OpenAPI_sm_policy_data_patch_t *OpenAPI_sm_policy_data_patch_parseFromJSON(cJSON *sm_policy_data_patchJSON) { OpenAPI_sm_policy_data_patch_t *sm_policy_data_patch_local_var = NULL; - cJSON *um_data = cJSON_GetObjectItemCaseSensitive(sm_policy_data_patchJSON, "umData"); - - OpenAPI_list_t *um_dataList; + OpenAPI_lnode_t *node = NULL; + cJSON *um_data = NULL; + OpenAPI_list_t *um_dataList = NULL; + cJSON *sm_policy_snssai_data = NULL; + OpenAPI_list_t *sm_policy_snssai_dataList = NULL; + um_data = cJSON_GetObjectItemCaseSensitive(sm_policy_data_patchJSON, "umData"); if (um_data) { - cJSON *um_data_local_map; - if (!cJSON_IsObject(um_data)) { - ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [um_data]"); - goto end; - } - um_dataList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(um_data_local_map, um_data) { - cJSON *localMapObject = um_data_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [inner]"); + cJSON *um_data_local_map = NULL; + if (!cJSON_IsObject(um_data) && !cJSON_IsNull(um_data)) { + ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [um_data]"); goto end; } - OpenAPI_list_add(um_dataList, localMapKeyPair); - } + if (cJSON_IsObject(um_data)) { + um_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(um_data_local_map, um_data) { + cJSON *localMapObject = um_data_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(um_dataList, localMapKeyPair); + } + } } - cJSON *sm_policy_snssai_data = cJSON_GetObjectItemCaseSensitive(sm_policy_data_patchJSON, "smPolicySnssaiData"); - - OpenAPI_list_t *sm_policy_snssai_dataList; + sm_policy_snssai_data = cJSON_GetObjectItemCaseSensitive(sm_policy_data_patchJSON, "smPolicySnssaiData"); if (sm_policy_snssai_data) { - cJSON *sm_policy_snssai_data_local_map; - if (!cJSON_IsObject(sm_policy_snssai_data)) { - ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [sm_policy_snssai_data]"); - goto end; - } - sm_policy_snssai_dataList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(sm_policy_snssai_data_local_map, sm_policy_snssai_data) { - cJSON *localMapObject = sm_policy_snssai_data_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_sm_policy_snssai_data_patch_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [inner]"); + cJSON *sm_policy_snssai_data_local_map = NULL; + if (!cJSON_IsObject(sm_policy_snssai_data) && !cJSON_IsNull(sm_policy_snssai_data)) { + ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [sm_policy_snssai_data]"); goto end; } - OpenAPI_list_add(sm_policy_snssai_dataList, localMapKeyPair); - } + if (cJSON_IsObject(sm_policy_snssai_data)) { + sm_policy_snssai_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sm_policy_snssai_data_local_map, sm_policy_snssai_data) { + cJSON *localMapObject = sm_policy_snssai_data_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_sm_policy_snssai_data_patch_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_data_patch_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(sm_policy_snssai_dataList, localMapKeyPair); + } + } } sm_policy_data_patch_local_var = OpenAPI_sm_policy_data_patch_create ( @@ -163,6 +174,26 @@ OpenAPI_sm_policy_data_patch_t *OpenAPI_sm_policy_data_patch_parseFromJSON(cJSON return sm_policy_data_patch_local_var; end: + if (um_dataList) { + OpenAPI_list_for_each(um_dataList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(um_dataList); + um_dataList = NULL; + } + if (sm_policy_snssai_dataList) { + OpenAPI_list_for_each(sm_policy_snssai_dataList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_sm_policy_snssai_data_patch_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_snssai_dataList); + sm_policy_snssai_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_decision.c b/lib/sbi/openapi/model/sm_policy_decision.c index 23af6fc55..9a96c6670 100644 --- a/lib/sbi/openapi/model/sm_policy_decision.c +++ b/lib/sbi/openapi/model/sm_policy_decision.c @@ -86,101 +86,160 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_create( void OpenAPI_sm_policy_decision_free(OpenAPI_sm_policy_decision_t *sm_policy_decision) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_decision) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(sm_policy_decision->sess_rules, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_session_rule_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->sess_rules) { + OpenAPI_list_for_each(sm_policy_decision->sess_rules, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_session_rule_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->sess_rules); + sm_policy_decision->sess_rules = NULL; } - OpenAPI_list_free(sm_policy_decision->sess_rules); - OpenAPI_list_for_each(sm_policy_decision->pcc_rules, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_pcc_rule_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->pcc_rules) { + OpenAPI_list_for_each(sm_policy_decision->pcc_rules, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_pcc_rule_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->pcc_rules); + sm_policy_decision->pcc_rules = NULL; } - OpenAPI_list_free(sm_policy_decision->pcc_rules); - OpenAPI_list_for_each(sm_policy_decision->qos_decs, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_qos_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->qos_decs) { + OpenAPI_list_for_each(sm_policy_decision->qos_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_qos_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->qos_decs); + sm_policy_decision->qos_decs = NULL; } - OpenAPI_list_free(sm_policy_decision->qos_decs); - OpenAPI_list_for_each(sm_policy_decision->chg_decs, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_charging_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->chg_decs) { + OpenAPI_list_for_each(sm_policy_decision->chg_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_charging_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->chg_decs); + sm_policy_decision->chg_decs = NULL; } - OpenAPI_list_free(sm_policy_decision->chg_decs); - OpenAPI_charging_information_free(sm_policy_decision->charging_info); - OpenAPI_list_for_each(sm_policy_decision->traff_cont_decs, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_traffic_control_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->charging_info) { + OpenAPI_charging_information_free(sm_policy_decision->charging_info); + sm_policy_decision->charging_info = NULL; } - OpenAPI_list_free(sm_policy_decision->traff_cont_decs); - OpenAPI_list_for_each(sm_policy_decision->um_decs, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_usage_monitoring_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->traff_cont_decs) { + OpenAPI_list_for_each(sm_policy_decision->traff_cont_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_traffic_control_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->traff_cont_decs); + sm_policy_decision->traff_cont_decs = NULL; } - OpenAPI_list_free(sm_policy_decision->um_decs); - OpenAPI_list_for_each(sm_policy_decision->qos_chars, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_qos_characteristics_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->um_decs) { + OpenAPI_list_for_each(sm_policy_decision->um_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_monitoring_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->um_decs); + sm_policy_decision->um_decs = NULL; } - OpenAPI_list_free(sm_policy_decision->qos_chars); - OpenAPI_list_for_each(sm_policy_decision->qos_mon_decs, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_qos_monitoring_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->qos_chars) { + OpenAPI_list_for_each(sm_policy_decision->qos_chars, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_qos_characteristics_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->qos_chars); + sm_policy_decision->qos_chars = NULL; } - OpenAPI_list_free(sm_policy_decision->qos_mon_decs); - OpenAPI_list_for_each(sm_policy_decision->conds, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_condition_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->qos_mon_decs) { + OpenAPI_list_for_each(sm_policy_decision->qos_mon_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_qos_monitoring_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->qos_mon_decs); + sm_policy_decision->qos_mon_decs = NULL; } - OpenAPI_list_free(sm_policy_decision->conds); - ogs_free(sm_policy_decision->revalidation_time); - OpenAPI_list_free(sm_policy_decision->policy_ctrl_req_triggers); - OpenAPI_list_for_each(sm_policy_decision->last_req_rule_data, node) { - OpenAPI_requested_rule_data_free(node->data); + if (sm_policy_decision->conds) { + OpenAPI_list_for_each(sm_policy_decision->conds, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_condition_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->conds); + sm_policy_decision->conds = NULL; } - OpenAPI_list_free(sm_policy_decision->last_req_rule_data); - OpenAPI_requested_usage_data_free(sm_policy_decision->last_req_usage_data); - OpenAPI_list_for_each(sm_policy_decision->pra_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_rm_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_decision->revalidation_time) { + ogs_free(sm_policy_decision->revalidation_time); + sm_policy_decision->revalidation_time = NULL; } - OpenAPI_list_free(sm_policy_decision->pra_infos); - ogs_free(sm_policy_decision->supp_feat); - OpenAPI_bridge_management_container_free(sm_policy_decision->tsn_bridge_man_cont); - OpenAPI_port_management_container_free(sm_policy_decision->tsn_port_man_cont_dstt); - OpenAPI_list_for_each(sm_policy_decision->tsn_port_man_cont_nwtts, node) { - OpenAPI_port_management_container_free(node->data); + if (sm_policy_decision->policy_ctrl_req_triggers) { + OpenAPI_list_free(sm_policy_decision->policy_ctrl_req_triggers); + sm_policy_decision->policy_ctrl_req_triggers = NULL; + } + if (sm_policy_decision->last_req_rule_data) { + OpenAPI_list_for_each(sm_policy_decision->last_req_rule_data, node) { + OpenAPI_requested_rule_data_free(node->data); + } + OpenAPI_list_free(sm_policy_decision->last_req_rule_data); + sm_policy_decision->last_req_rule_data = NULL; + } + if (sm_policy_decision->last_req_usage_data) { + OpenAPI_requested_usage_data_free(sm_policy_decision->last_req_usage_data); + sm_policy_decision->last_req_usage_data = NULL; + } + if (sm_policy_decision->pra_infos) { + OpenAPI_list_for_each(sm_policy_decision->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_rm_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_decision->pra_infos); + sm_policy_decision->pra_infos = NULL; + } + if (sm_policy_decision->supp_feat) { + ogs_free(sm_policy_decision->supp_feat); + sm_policy_decision->supp_feat = NULL; + } + if (sm_policy_decision->tsn_bridge_man_cont) { + OpenAPI_bridge_management_container_free(sm_policy_decision->tsn_bridge_man_cont); + sm_policy_decision->tsn_bridge_man_cont = NULL; + } + if (sm_policy_decision->tsn_port_man_cont_dstt) { + OpenAPI_port_management_container_free(sm_policy_decision->tsn_port_man_cont_dstt); + sm_policy_decision->tsn_port_man_cont_dstt = NULL; + } + if (sm_policy_decision->tsn_port_man_cont_nwtts) { + OpenAPI_list_for_each(sm_policy_decision->tsn_port_man_cont_nwtts, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(sm_policy_decision->tsn_port_man_cont_nwtts); + sm_policy_decision->tsn_port_man_cont_nwtts = NULL; } - OpenAPI_list_free(sm_policy_decision->tsn_port_man_cont_nwtts); ogs_free(sm_policy_decision); } cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm_policy_decision) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_decision == NULL) { ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [SmPolicyDecision]"); @@ -195,21 +254,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = sess_rules; - OpenAPI_lnode_t *sess_rules_node; if (sm_policy_decision->sess_rules) { - OpenAPI_list_for_each(sm_policy_decision->sess_rules, sess_rules_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sess_rules_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_session_rule_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->sess_rules, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_session_rule_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->pcc_rules) { cJSON *pcc_rules = cJSON_AddObjectToObject(item, "pccRules"); @@ -218,21 +276,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = pcc_rules; - OpenAPI_lnode_t *pcc_rules_node; if (sm_policy_decision->pcc_rules) { - OpenAPI_list_for_each(sm_policy_decision->pcc_rules, pcc_rules_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pcc_rules_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_pcc_rule_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->pcc_rules, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_pcc_rule_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->is_pcscf_rest_indication) { if (cJSON_AddBoolToObject(item, "pcscfRestIndication", sm_policy_decision->pcscf_rest_indication) == NULL) { @@ -248,21 +305,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = qos_decs; - OpenAPI_lnode_t *qos_decs_node; if (sm_policy_decision->qos_decs) { - OpenAPI_list_for_each(sm_policy_decision->qos_decs, qos_decs_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)qos_decs_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_qos_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->qos_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_qos_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->chg_decs) { cJSON *chg_decs = cJSON_AddObjectToObject(item, "chgDecs"); @@ -271,21 +327,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = chg_decs; - OpenAPI_lnode_t *chg_decs_node; if (sm_policy_decision->chg_decs) { - OpenAPI_list_for_each(sm_policy_decision->chg_decs, chg_decs_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)chg_decs_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_charging_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->chg_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_charging_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->charging_info) { cJSON *charging_info_local_JSON = OpenAPI_charging_information_convertToJSON(sm_policy_decision->charging_info); @@ -307,21 +362,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = traff_cont_decs; - OpenAPI_lnode_t *traff_cont_decs_node; if (sm_policy_decision->traff_cont_decs) { - OpenAPI_list_for_each(sm_policy_decision->traff_cont_decs, traff_cont_decs_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)traff_cont_decs_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_traffic_control_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->traff_cont_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_traffic_control_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->um_decs) { cJSON *um_decs = cJSON_AddObjectToObject(item, "umDecs"); @@ -330,21 +384,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = um_decs; - OpenAPI_lnode_t *um_decs_node; if (sm_policy_decision->um_decs) { - OpenAPI_list_for_each(sm_policy_decision->um_decs, um_decs_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)um_decs_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_usage_monitoring_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->um_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_usage_monitoring_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->qos_chars) { cJSON *qos_chars = cJSON_AddObjectToObject(item, "qosChars"); @@ -353,21 +406,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = qos_chars; - OpenAPI_lnode_t *qos_chars_node; if (sm_policy_decision->qos_chars) { - OpenAPI_list_for_each(sm_policy_decision->qos_chars, qos_chars_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)qos_chars_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_qos_characteristics_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->qos_chars, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_qos_characteristics_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->qos_mon_decs) { cJSON *qos_mon_decs = cJSON_AddObjectToObject(item, "qosMonDecs"); @@ -376,21 +428,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = qos_mon_decs; - OpenAPI_lnode_t *qos_mon_decs_node; if (sm_policy_decision->qos_mon_decs) { - OpenAPI_list_for_each(sm_policy_decision->qos_mon_decs, qos_mon_decs_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)qos_mon_decs_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_qos_monitoring_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->qos_mon_decs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_qos_monitoring_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->is_reflective_qo_s_timer) { if (cJSON_AddNumberToObject(item, "reflectiveQoSTimer", sm_policy_decision->reflective_qo_s_timer) == NULL) { @@ -406,21 +457,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = conds; - OpenAPI_lnode_t *conds_node; if (sm_policy_decision->conds) { - OpenAPI_list_for_each(sm_policy_decision->conds, conds_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)conds_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_condition_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->conds, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_condition_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->revalidation_time) { if (cJSON_AddStringToObject(item, "revalidationTime", sm_policy_decision->revalidation_time) == NULL) { @@ -443,15 +493,14 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm } } - if (sm_policy_decision->policy_ctrl_req_triggers) { - cJSON *policy_ctrl_req_triggers = cJSON_AddArrayToObject(item, "policyCtrlReqTriggers"); - if (policy_ctrl_req_triggers == NULL) { + if (sm_policy_decision->policy_ctrl_req_triggers != OpenAPI_policy_control_request_trigger_NULL) { + cJSON *policy_ctrl_req_triggersList = cJSON_AddArrayToObject(item, "policyCtrlReqTriggers"); + if (policy_ctrl_req_triggersList == NULL) { ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [policy_ctrl_req_triggers]"); goto end; } - OpenAPI_lnode_t *policy_ctrl_req_triggers_node; - OpenAPI_list_for_each(sm_policy_decision->policy_ctrl_req_triggers, policy_ctrl_req_triggers_node) { - if (cJSON_AddStringToObject(policy_ctrl_req_triggers, "", OpenAPI_policy_control_request_trigger_ToString((intptr_t)policy_ctrl_req_triggers_node->data)) == NULL) { + OpenAPI_list_for_each(sm_policy_decision->policy_ctrl_req_triggers, node) { + if (cJSON_AddStringToObject(policy_ctrl_req_triggersList, "", OpenAPI_policy_control_request_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [policy_ctrl_req_triggers]"); goto end; } @@ -464,17 +513,13 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [last_req_rule_data]"); goto end; } - - OpenAPI_lnode_t *last_req_rule_data_node; - if (sm_policy_decision->last_req_rule_data) { - OpenAPI_list_for_each(sm_policy_decision->last_req_rule_data, last_req_rule_data_node) { - cJSON *itemLocal = OpenAPI_requested_rule_data_convertToJSON(last_req_rule_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [last_req_rule_data]"); - goto end; - } - cJSON_AddItemToArray(last_req_rule_dataList, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->last_req_rule_data, node) { + cJSON *itemLocal = OpenAPI_requested_rule_data_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [last_req_rule_data]"); + goto end; } + cJSON_AddItemToArray(last_req_rule_dataList, itemLocal); } } @@ -498,21 +543,20 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm goto end; } cJSON *localMapObject = pra_infos; - OpenAPI_lnode_t *pra_infos_node; if (sm_policy_decision->pra_infos) { - OpenAPI_list_for_each(sm_policy_decision->pra_infos, pra_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_rm_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_rm_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_decision->is_ipv4_index) { if (cJSON_AddNumberToObject(item, "ipv4Index", sm_policy_decision->ipv4_index) == NULL) { @@ -528,14 +572,14 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm } } - if (sm_policy_decision->qos_flow_usage) { + if (sm_policy_decision->qos_flow_usage != OpenAPI_qos_flow_usage_NULL) { if (cJSON_AddStringToObject(item, "qosFlowUsage", OpenAPI_qos_flow_usage_ToString(sm_policy_decision->qos_flow_usage)) == NULL) { ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [qos_flow_usage]"); goto end; } } - if (sm_policy_decision->rel_cause) { + if (sm_policy_decision->rel_cause != OpenAPI_sm_policy_association_release_cause_NULL) { if (cJSON_AddStringToObject(item, "relCause", OpenAPI_sm_policy_association_release_cause_ToString(sm_policy_decision->rel_cause)) == NULL) { ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [rel_cause]"); goto end; @@ -581,17 +625,13 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - - OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node; - if (sm_policy_decision->tsn_port_man_cont_nwtts) { - OpenAPI_list_for_each(sm_policy_decision->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) { - cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); + OpenAPI_list_for_each(sm_policy_decision->tsn_port_man_cont_nwtts, node) { + cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; } + cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); } } @@ -609,60 +649,107 @@ end: OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm_policy_decisionJSON) { OpenAPI_sm_policy_decision_t *sm_policy_decision_local_var = NULL; - cJSON *sess_rules = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "sessRules"); - - OpenAPI_list_t *sess_rulesList; + OpenAPI_lnode_t *node = NULL; + cJSON *sess_rules = NULL; + OpenAPI_list_t *sess_rulesList = NULL; + cJSON *pcc_rules = NULL; + OpenAPI_list_t *pcc_rulesList = NULL; + cJSON *pcscf_rest_indication = NULL; + cJSON *qos_decs = NULL; + OpenAPI_list_t *qos_decsList = NULL; + cJSON *chg_decs = NULL; + OpenAPI_list_t *chg_decsList = NULL; + cJSON *charging_info = NULL; + OpenAPI_charging_information_t *charging_info_local_nonprim = NULL; + cJSON *traff_cont_decs = NULL; + OpenAPI_list_t *traff_cont_decsList = NULL; + cJSON *um_decs = NULL; + OpenAPI_list_t *um_decsList = NULL; + cJSON *qos_chars = NULL; + OpenAPI_list_t *qos_charsList = NULL; + cJSON *qos_mon_decs = NULL; + OpenAPI_list_t *qos_mon_decsList = NULL; + cJSON *reflective_qo_s_timer = NULL; + cJSON *conds = NULL; + OpenAPI_list_t *condsList = NULL; + cJSON *revalidation_time = NULL; + cJSON *offline = NULL; + cJSON *online = NULL; + cJSON *policy_ctrl_req_triggers = NULL; + OpenAPI_list_t *policy_ctrl_req_triggersList = NULL; + cJSON *last_req_rule_data = NULL; + OpenAPI_list_t *last_req_rule_dataList = NULL; + cJSON *last_req_usage_data = NULL; + OpenAPI_requested_usage_data_t *last_req_usage_data_local_nonprim = NULL; + cJSON *pra_infos = NULL; + OpenAPI_list_t *pra_infosList = NULL; + cJSON *ipv4_index = NULL; + cJSON *ipv6_index = NULL; + cJSON *qos_flow_usage = NULL; + OpenAPI_qos_flow_usage_e qos_flow_usageVariable = 0; + cJSON *rel_cause = NULL; + OpenAPI_sm_policy_association_release_cause_e rel_causeVariable = 0; + cJSON *supp_feat = NULL; + cJSON *tsn_bridge_man_cont = NULL; + OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + cJSON *tsn_port_man_cont_dstt = NULL; + OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + cJSON *tsn_port_man_cont_nwtts = NULL; + OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL; + cJSON *red_sess_indication = NULL; + sess_rules = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "sessRules"); if (sess_rules) { - cJSON *sess_rules_local_map; - if (!cJSON_IsObject(sess_rules)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [sess_rules]"); - goto end; - } - sess_rulesList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(sess_rules_local_map, sess_rules) { - cJSON *localMapObject = sess_rules_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_session_rule_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *sess_rules_local_map = NULL; + if (!cJSON_IsObject(sess_rules) && !cJSON_IsNull(sess_rules)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [sess_rules]"); goto end; } - OpenAPI_list_add(sess_rulesList, localMapKeyPair); - } + if (cJSON_IsObject(sess_rules)) { + sess_rulesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sess_rules_local_map, sess_rules) { + cJSON *localMapObject = sess_rules_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_session_rule_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(sess_rulesList, localMapKeyPair); + } + } } - cJSON *pcc_rules = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "pccRules"); - - OpenAPI_list_t *pcc_rulesList; + pcc_rules = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "pccRules"); if (pcc_rules) { - cJSON *pcc_rules_local_map; - if (!cJSON_IsObject(pcc_rules)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [pcc_rules]"); - goto end; - } - pcc_rulesList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pcc_rules_local_map, pcc_rules) { - cJSON *localMapObject = pcc_rules_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_pcc_rule_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *pcc_rules_local_map = NULL; + if (!cJSON_IsObject(pcc_rules) && !cJSON_IsNull(pcc_rules)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [pcc_rules]"); goto end; } - OpenAPI_list_add(pcc_rulesList, localMapKeyPair); - } + if (cJSON_IsObject(pcc_rules)) { + pcc_rulesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pcc_rules_local_map, pcc_rules) { + cJSON *localMapObject = pcc_rules_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_pcc_rule_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pcc_rulesList, localMapKeyPair); + } + } } - cJSON *pcscf_rest_indication = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "pcscfRestIndication"); - + pcscf_rest_indication = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "pcscfRestIndication"); if (pcscf_rest_indication) { if (!cJSON_IsBool(pcscf_rest_indication)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [pcscf_rest_indication]"); @@ -670,171 +757,168 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm } } - cJSON *qos_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosDecs"); - - OpenAPI_list_t *qos_decsList; + qos_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosDecs"); if (qos_decs) { - cJSON *qos_decs_local_map; - if (!cJSON_IsObject(qos_decs)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [qos_decs]"); - goto end; - } - qos_decsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(qos_decs_local_map, qos_decs) { - cJSON *localMapObject = qos_decs_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_qos_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *qos_decs_local_map = NULL; + if (!cJSON_IsObject(qos_decs) && !cJSON_IsNull(qos_decs)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [qos_decs]"); goto end; } - OpenAPI_list_add(qos_decsList, localMapKeyPair); - } + if (cJSON_IsObject(qos_decs)) { + qos_decsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(qos_decs_local_map, qos_decs) { + cJSON *localMapObject = qos_decs_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_qos_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(qos_decsList, localMapKeyPair); + } + } } - cJSON *chg_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "chgDecs"); - - OpenAPI_list_t *chg_decsList; + chg_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "chgDecs"); if (chg_decs) { - cJSON *chg_decs_local_map; - if (!cJSON_IsObject(chg_decs)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [chg_decs]"); - goto end; - } - chg_decsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(chg_decs_local_map, chg_decs) { - cJSON *localMapObject = chg_decs_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_charging_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *chg_decs_local_map = NULL; + if (!cJSON_IsObject(chg_decs) && !cJSON_IsNull(chg_decs)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [chg_decs]"); goto end; } - OpenAPI_list_add(chg_decsList, localMapKeyPair); - } + if (cJSON_IsObject(chg_decs)) { + chg_decsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(chg_decs_local_map, chg_decs) { + cJSON *localMapObject = chg_decs_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_charging_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(chg_decsList, localMapKeyPair); + } + } } - cJSON *charging_info = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "chargingInfo"); - - OpenAPI_charging_information_t *charging_info_local_nonprim = NULL; + charging_info = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "chargingInfo"); if (charging_info) { charging_info_local_nonprim = OpenAPI_charging_information_parseFromJSON(charging_info); } - cJSON *traff_cont_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "traffContDecs"); - - OpenAPI_list_t *traff_cont_decsList; + traff_cont_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "traffContDecs"); if (traff_cont_decs) { - cJSON *traff_cont_decs_local_map; - if (!cJSON_IsObject(traff_cont_decs)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [traff_cont_decs]"); - goto end; - } - traff_cont_decsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(traff_cont_decs_local_map, traff_cont_decs) { - cJSON *localMapObject = traff_cont_decs_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_traffic_control_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *traff_cont_decs_local_map = NULL; + if (!cJSON_IsObject(traff_cont_decs) && !cJSON_IsNull(traff_cont_decs)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [traff_cont_decs]"); goto end; } - OpenAPI_list_add(traff_cont_decsList, localMapKeyPair); - } + if (cJSON_IsObject(traff_cont_decs)) { + traff_cont_decsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(traff_cont_decs_local_map, traff_cont_decs) { + cJSON *localMapObject = traff_cont_decs_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_traffic_control_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(traff_cont_decsList, localMapKeyPair); + } + } } - cJSON *um_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "umDecs"); - - OpenAPI_list_t *um_decsList; + um_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "umDecs"); if (um_decs) { - cJSON *um_decs_local_map; - if (!cJSON_IsObject(um_decs)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [um_decs]"); - goto end; - } - um_decsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(um_decs_local_map, um_decs) { - cJSON *localMapObject = um_decs_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_usage_monitoring_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *um_decs_local_map = NULL; + if (!cJSON_IsObject(um_decs) && !cJSON_IsNull(um_decs)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [um_decs]"); goto end; } - OpenAPI_list_add(um_decsList, localMapKeyPair); - } + if (cJSON_IsObject(um_decs)) { + um_decsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(um_decs_local_map, um_decs) { + cJSON *localMapObject = um_decs_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_usage_monitoring_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(um_decsList, localMapKeyPair); + } + } } - cJSON *qos_chars = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosChars"); - - OpenAPI_list_t *qos_charsList; + qos_chars = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosChars"); if (qos_chars) { - cJSON *qos_chars_local_map; - if (!cJSON_IsObject(qos_chars)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [qos_chars]"); - goto end; - } - qos_charsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(qos_chars_local_map, qos_chars) { - cJSON *localMapObject = qos_chars_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_qos_characteristics_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *qos_chars_local_map = NULL; + if (!cJSON_IsObject(qos_chars) && !cJSON_IsNull(qos_chars)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [qos_chars]"); goto end; } - OpenAPI_list_add(qos_charsList, localMapKeyPair); - } + if (cJSON_IsObject(qos_chars)) { + qos_charsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(qos_chars_local_map, qos_chars) { + cJSON *localMapObject = qos_chars_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_qos_characteristics_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(qos_charsList, localMapKeyPair); + } + } } - cJSON *qos_mon_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosMonDecs"); - - OpenAPI_list_t *qos_mon_decsList; + qos_mon_decs = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosMonDecs"); if (qos_mon_decs) { - cJSON *qos_mon_decs_local_map; - if (!cJSON_IsObject(qos_mon_decs)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [qos_mon_decs]"); - goto end; - } - qos_mon_decsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(qos_mon_decs_local_map, qos_mon_decs) { - cJSON *localMapObject = qos_mon_decs_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_qos_monitoring_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *qos_mon_decs_local_map = NULL; + if (!cJSON_IsObject(qos_mon_decs) && !cJSON_IsNull(qos_mon_decs)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [qos_mon_decs]"); goto end; } - OpenAPI_list_add(qos_mon_decsList, localMapKeyPair); - } + if (cJSON_IsObject(qos_mon_decs)) { + qos_mon_decsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(qos_mon_decs_local_map, qos_mon_decs) { + cJSON *localMapObject = qos_mon_decs_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_qos_monitoring_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(qos_mon_decsList, localMapKeyPair); + } + } } - cJSON *reflective_qo_s_timer = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "reflectiveQoSTimer"); - + reflective_qo_s_timer = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "reflectiveQoSTimer"); if (reflective_qo_s_timer) { if (!cJSON_IsNumber(reflective_qo_s_timer)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [reflective_qo_s_timer]"); @@ -842,43 +926,41 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm } } - cJSON *conds = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "conds"); - - OpenAPI_list_t *condsList; + conds = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "conds"); if (conds) { - cJSON *conds_local_map; - if (!cJSON_IsObject(conds)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [conds]"); - goto end; - } - condsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(conds_local_map, conds) { - cJSON *localMapObject = conds_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_condition_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *conds_local_map = NULL; + if (!cJSON_IsObject(conds) && !cJSON_IsNull(conds)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [conds]"); goto end; } - OpenAPI_list_add(condsList, localMapKeyPair); - } + if (cJSON_IsObject(conds)) { + condsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(conds_local_map, conds) { + cJSON *localMapObject = conds_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_condition_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(condsList, localMapKeyPair); + } + } } - cJSON *revalidation_time = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "revalidationTime"); - + revalidation_time = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "revalidationTime"); if (revalidation_time) { - if (!cJSON_IsString(revalidation_time)) { + if (!cJSON_IsString(revalidation_time) && !cJSON_IsNull(revalidation_time)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [revalidation_time]"); goto end; } } - cJSON *offline = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "offline"); - + offline = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "offline"); if (offline) { if (!cJSON_IsBool(offline)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [offline]"); @@ -886,8 +968,7 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm } } - cJSON *online = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "online"); - + online = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "online"); if (online) { if (!cJSON_IsBool(online)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [online]"); @@ -895,92 +976,82 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm } } - cJSON *policy_ctrl_req_triggers = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "policyCtrlReqTriggers"); - - OpenAPI_list_t *policy_ctrl_req_triggersList; + policy_ctrl_req_triggers = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "policyCtrlReqTriggers"); if (policy_ctrl_req_triggers) { - cJSON *policy_ctrl_req_triggers_local_nonprimitive; - if (!cJSON_IsArray(policy_ctrl_req_triggers)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [policy_ctrl_req_triggers]"); - goto end; - } - - policy_ctrl_req_triggersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(policy_ctrl_req_triggers_local_nonprimitive, policy_ctrl_req_triggers ) { - if (!cJSON_IsString(policy_ctrl_req_triggers_local_nonprimitive)){ + cJSON *policy_ctrl_req_triggers_local = NULL; + if (!cJSON_IsArray(policy_ctrl_req_triggers)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [policy_ctrl_req_triggers]"); goto end; } - OpenAPI_list_add(policy_ctrl_req_triggersList, (void *)OpenAPI_policy_control_request_trigger_FromString(policy_ctrl_req_triggers_local_nonprimitive->valuestring)); - } + policy_ctrl_req_triggersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(policy_ctrl_req_triggers_local, policy_ctrl_req_triggers) { + if (!cJSON_IsString(policy_ctrl_req_triggers_local)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [policy_ctrl_req_triggers]"); + goto end; + } + OpenAPI_list_add(policy_ctrl_req_triggersList, (void *)OpenAPI_policy_control_request_trigger_FromString(policy_ctrl_req_triggers_local->valuestring)); + } } - cJSON *last_req_rule_data = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "lastReqRuleData"); - - OpenAPI_list_t *last_req_rule_dataList; + last_req_rule_data = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "lastReqRuleData"); if (last_req_rule_data) { - cJSON *last_req_rule_data_local_nonprimitive; - if (!cJSON_IsArray(last_req_rule_data)){ - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [last_req_rule_data]"); - goto end; - } - - last_req_rule_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(last_req_rule_data_local_nonprimitive, last_req_rule_data ) { - if (!cJSON_IsObject(last_req_rule_data_local_nonprimitive)) { + cJSON *last_req_rule_data_local = NULL; + if (!cJSON_IsArray(last_req_rule_data)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [last_req_rule_data]"); goto end; } - OpenAPI_requested_rule_data_t *last_req_rule_dataItem = OpenAPI_requested_rule_data_parseFromJSON(last_req_rule_data_local_nonprimitive); - if (!last_req_rule_dataItem) { - ogs_error("No last_req_rule_dataItem"); - OpenAPI_list_free(last_req_rule_dataList); - goto end; + last_req_rule_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(last_req_rule_data_local, last_req_rule_data) { + if (!cJSON_IsObject(last_req_rule_data_local)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [last_req_rule_data]"); + goto end; + } + OpenAPI_requested_rule_data_t *last_req_rule_dataItem = OpenAPI_requested_rule_data_parseFromJSON(last_req_rule_data_local); + if (!last_req_rule_dataItem) { + ogs_error("No last_req_rule_dataItem"); + OpenAPI_list_free(last_req_rule_dataList); + goto end; + } + OpenAPI_list_add(last_req_rule_dataList, last_req_rule_dataItem); } - - OpenAPI_list_add(last_req_rule_dataList, last_req_rule_dataItem); - } } - cJSON *last_req_usage_data = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "lastReqUsageData"); - - OpenAPI_requested_usage_data_t *last_req_usage_data_local_nonprim = NULL; + last_req_usage_data = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "lastReqUsageData"); if (last_req_usage_data) { last_req_usage_data_local_nonprim = OpenAPI_requested_usage_data_parseFromJSON(last_req_usage_data); } - cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "praInfos"); - - OpenAPI_list_t *pra_infosList; + pra_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "praInfos"); if (pra_infos) { - cJSON *pra_infos_local_map; - if (!cJSON_IsObject(pra_infos)) { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [pra_infos]"); - goto end; - } - pra_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { - cJSON *localMapObject = pra_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_rm_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + cJSON *pra_infos_local_map = NULL; + if (!cJSON_IsObject(pra_infos) && !cJSON_IsNull(pra_infos)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [pra_infos]"); goto end; } - OpenAPI_list_add(pra_infosList, localMapKeyPair); - } + if (cJSON_IsObject(pra_infos)) { + pra_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { + cJSON *localMapObject = pra_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_rm_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pra_infosList, localMapKeyPair); + } + } } - cJSON *ipv4_index = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "ipv4Index"); - + ipv4_index = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "ipv4Index"); if (ipv4_index) { if (!cJSON_IsNumber(ipv4_index)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [ipv4_index]"); @@ -988,8 +1059,7 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm } } - cJSON *ipv6_index = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "ipv6Index"); - + ipv6_index = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "ipv6Index"); if (ipv6_index) { if (!cJSON_IsNumber(ipv6_index)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [ipv6_index]"); @@ -997,9 +1067,7 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm } } - cJSON *qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosFlowUsage"); - - OpenAPI_qos_flow_usage_e qos_flow_usageVariable; + qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosFlowUsage"); if (qos_flow_usage) { if (!cJSON_IsString(qos_flow_usage)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [qos_flow_usage]"); @@ -1008,9 +1076,7 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm qos_flow_usageVariable = OpenAPI_qos_flow_usage_FromString(qos_flow_usage->valuestring); } - cJSON *rel_cause = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "relCause"); - - OpenAPI_sm_policy_association_release_cause_e rel_causeVariable; + rel_cause = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "relCause"); if (rel_cause) { if (!cJSON_IsString(rel_cause)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [rel_cause]"); @@ -1019,60 +1085,50 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm rel_causeVariable = OpenAPI_sm_policy_association_release_cause_FromString(rel_cause->valuestring); } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [supp_feat]"); goto end; } } - cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "tsnBridgeManCont"); - - OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "tsnBridgeManCont"); if (tsn_bridge_man_cont) { tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont); } - cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "tsnPortManContDstt"); - - OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "tsnPortManContDstt"); if (tsn_port_man_cont_dstt) { tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt); } - cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "tsnPortManContNwtts"); - - OpenAPI_list_t *tsn_port_man_cont_nwttsList; + tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "tsnPortManContNwtts"); if (tsn_port_man_cont_nwtts) { - cJSON *tsn_port_man_cont_nwtts_local_nonprimitive; - if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){ - ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - - tsn_port_man_cont_nwttsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) { - if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) { + cJSON *tsn_port_man_cont_nwtts_local = NULL; + if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive); - if (!tsn_port_man_cont_nwttsItem) { - ogs_error("No tsn_port_man_cont_nwttsItem"); - OpenAPI_list_free(tsn_port_man_cont_nwttsList); - goto end; + tsn_port_man_cont_nwttsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) { + if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) { + ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; + } + OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local); + if (!tsn_port_man_cont_nwttsItem) { + ogs_error("No tsn_port_man_cont_nwttsItem"); + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + goto end; + } + OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); } - - OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); - } } - cJSON *red_sess_indication = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "redSessIndication"); - + red_sess_indication = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "redSessIndication"); if (red_sess_indication) { if (!cJSON_IsBool(red_sess_indication)) { ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [red_sess_indication]"); @@ -1095,7 +1151,7 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm reflective_qo_s_timer ? true : false, reflective_qo_s_timer ? reflective_qo_s_timer->valuedouble : 0, conds ? condsList : NULL, - revalidation_time ? ogs_strdup(revalidation_time->valuestring) : NULL, + revalidation_time && !cJSON_IsNull(revalidation_time) ? ogs_strdup(revalidation_time->valuestring) : NULL, offline ? true : false, offline ? offline->valueint : 0, online ? true : false, @@ -1110,7 +1166,7 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm ipv6_index ? ipv6_index->valuedouble : 0, qos_flow_usage ? qos_flow_usageVariable : 0, rel_cause ? rel_causeVariable : 0, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL, + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL, tsn_bridge_man_cont ? tsn_bridge_man_cont_local_nonprim : NULL, tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL, tsn_port_man_cont_nwtts ? tsn_port_man_cont_nwttsList : NULL, @@ -1120,6 +1176,140 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm return sm_policy_decision_local_var; end: + if (sess_rulesList) { + OpenAPI_list_for_each(sess_rulesList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_session_rule_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sess_rulesList); + sess_rulesList = NULL; + } + if (pcc_rulesList) { + OpenAPI_list_for_each(pcc_rulesList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_pcc_rule_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pcc_rulesList); + pcc_rulesList = NULL; + } + if (qos_decsList) { + OpenAPI_list_for_each(qos_decsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_qos_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(qos_decsList); + qos_decsList = NULL; + } + if (chg_decsList) { + OpenAPI_list_for_each(chg_decsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_charging_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(chg_decsList); + chg_decsList = NULL; + } + if (charging_info_local_nonprim) { + OpenAPI_charging_information_free(charging_info_local_nonprim); + charging_info_local_nonprim = NULL; + } + if (traff_cont_decsList) { + OpenAPI_list_for_each(traff_cont_decsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_traffic_control_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(traff_cont_decsList); + traff_cont_decsList = NULL; + } + if (um_decsList) { + OpenAPI_list_for_each(um_decsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_monitoring_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(um_decsList); + um_decsList = NULL; + } + if (qos_charsList) { + OpenAPI_list_for_each(qos_charsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_qos_characteristics_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(qos_charsList); + qos_charsList = NULL; + } + if (qos_mon_decsList) { + OpenAPI_list_for_each(qos_mon_decsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_qos_monitoring_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(qos_mon_decsList); + qos_mon_decsList = NULL; + } + if (condsList) { + OpenAPI_list_for_each(condsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_condition_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(condsList); + condsList = NULL; + } + if (policy_ctrl_req_triggersList) { + OpenAPI_list_free(policy_ctrl_req_triggersList); + policy_ctrl_req_triggersList = NULL; + } + if (last_req_rule_dataList) { + OpenAPI_list_for_each(last_req_rule_dataList, node) { + OpenAPI_requested_rule_data_free(node->data); + } + OpenAPI_list_free(last_req_rule_dataList); + last_req_rule_dataList = NULL; + } + if (last_req_usage_data_local_nonprim) { + OpenAPI_requested_usage_data_free(last_req_usage_data_local_nonprim); + last_req_usage_data_local_nonprim = NULL; + } + if (pra_infosList) { + OpenAPI_list_for_each(pra_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_rm_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pra_infosList); + pra_infosList = NULL; + } + if (tsn_bridge_man_cont_local_nonprim) { + OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim); + tsn_bridge_man_cont_local_nonprim = NULL; + } + if (tsn_port_man_cont_dstt_local_nonprim) { + OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim); + tsn_port_man_cont_dstt_local_nonprim = NULL; + } + if (tsn_port_man_cont_nwttsList) { + OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + tsn_port_man_cont_nwttsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_delete_data.c b/lib/sbi/openapi/model/sm_policy_delete_data.c index d9758de86..c863160bf 100644 --- a/lib/sbi/openapi/model/sm_policy_delete_data.c +++ b/lib/sbi/openapi/model/sm_policy_delete_data.c @@ -32,32 +32,55 @@ OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_create( void OpenAPI_sm_policy_delete_data_free(OpenAPI_sm_policy_delete_data_t *sm_policy_delete_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_delete_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_user_location_free(sm_policy_delete_data->user_location_info); - ogs_free(sm_policy_delete_data->ue_time_zone); - OpenAPI_plmn_id_nid_free(sm_policy_delete_data->serving_network); - ogs_free(sm_policy_delete_data->user_location_info_time); - OpenAPI_list_for_each(sm_policy_delete_data->ran_nas_rel_causes, node) { - OpenAPI_ran_nas_rel_cause_free(node->data); + if (sm_policy_delete_data->user_location_info) { + OpenAPI_user_location_free(sm_policy_delete_data->user_location_info); + sm_policy_delete_data->user_location_info = NULL; } - OpenAPI_list_free(sm_policy_delete_data->ran_nas_rel_causes); - OpenAPI_list_for_each(sm_policy_delete_data->accu_usage_reports, node) { - OpenAPI_accu_usage_report_free(node->data); + if (sm_policy_delete_data->ue_time_zone) { + ogs_free(sm_policy_delete_data->ue_time_zone); + sm_policy_delete_data->ue_time_zone = NULL; } - OpenAPI_list_free(sm_policy_delete_data->accu_usage_reports); - OpenAPI_list_for_each(sm_policy_delete_data->qos_mon_reports, node) { - OpenAPI_qos_monitoring_report_free(node->data); + if (sm_policy_delete_data->serving_network) { + OpenAPI_plmn_id_nid_free(sm_policy_delete_data->serving_network); + sm_policy_delete_data->serving_network = NULL; + } + if (sm_policy_delete_data->user_location_info_time) { + ogs_free(sm_policy_delete_data->user_location_info_time); + sm_policy_delete_data->user_location_info_time = NULL; + } + if (sm_policy_delete_data->ran_nas_rel_causes) { + OpenAPI_list_for_each(sm_policy_delete_data->ran_nas_rel_causes, node) { + OpenAPI_ran_nas_rel_cause_free(node->data); + } + OpenAPI_list_free(sm_policy_delete_data->ran_nas_rel_causes); + sm_policy_delete_data->ran_nas_rel_causes = NULL; + } + if (sm_policy_delete_data->accu_usage_reports) { + OpenAPI_list_for_each(sm_policy_delete_data->accu_usage_reports, node) { + OpenAPI_accu_usage_report_free(node->data); + } + OpenAPI_list_free(sm_policy_delete_data->accu_usage_reports); + sm_policy_delete_data->accu_usage_reports = NULL; + } + if (sm_policy_delete_data->qos_mon_reports) { + OpenAPI_list_for_each(sm_policy_delete_data->qos_mon_reports, node) { + OpenAPI_qos_monitoring_report_free(node->data); + } + OpenAPI_list_free(sm_policy_delete_data->qos_mon_reports); + sm_policy_delete_data->qos_mon_reports = NULL; } - OpenAPI_list_free(sm_policy_delete_data->qos_mon_reports); ogs_free(sm_policy_delete_data); } cJSON *OpenAPI_sm_policy_delete_data_convertToJSON(OpenAPI_sm_policy_delete_data_t *sm_policy_delete_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_delete_data == NULL) { ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [SmPolicyDeleteData]"); @@ -111,17 +134,13 @@ cJSON *OpenAPI_sm_policy_delete_data_convertToJSON(OpenAPI_sm_policy_delete_data ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [ran_nas_rel_causes]"); goto end; } - - OpenAPI_lnode_t *ran_nas_rel_causes_node; - if (sm_policy_delete_data->ran_nas_rel_causes) { - OpenAPI_list_for_each(sm_policy_delete_data->ran_nas_rel_causes, ran_nas_rel_causes_node) { - cJSON *itemLocal = OpenAPI_ran_nas_rel_cause_convertToJSON(ran_nas_rel_causes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [ran_nas_rel_causes]"); - goto end; - } - cJSON_AddItemToArray(ran_nas_rel_causesList, itemLocal); + OpenAPI_list_for_each(sm_policy_delete_data->ran_nas_rel_causes, node) { + cJSON *itemLocal = OpenAPI_ran_nas_rel_cause_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [ran_nas_rel_causes]"); + goto end; } + cJSON_AddItemToArray(ran_nas_rel_causesList, itemLocal); } } @@ -131,21 +150,17 @@ cJSON *OpenAPI_sm_policy_delete_data_convertToJSON(OpenAPI_sm_policy_delete_data ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [accu_usage_reports]"); goto end; } - - OpenAPI_lnode_t *accu_usage_reports_node; - if (sm_policy_delete_data->accu_usage_reports) { - OpenAPI_list_for_each(sm_policy_delete_data->accu_usage_reports, accu_usage_reports_node) { - cJSON *itemLocal = OpenAPI_accu_usage_report_convertToJSON(accu_usage_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [accu_usage_reports]"); - goto end; - } - cJSON_AddItemToArray(accu_usage_reportsList, itemLocal); + OpenAPI_list_for_each(sm_policy_delete_data->accu_usage_reports, node) { + cJSON *itemLocal = OpenAPI_accu_usage_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [accu_usage_reports]"); + goto end; } + cJSON_AddItemToArray(accu_usage_reportsList, itemLocal); } } - if (sm_policy_delete_data->pdu_sess_rel_cause) { + if (sm_policy_delete_data->pdu_sess_rel_cause != OpenAPI_pdu_session_rel_cause_NULL) { if (cJSON_AddStringToObject(item, "pduSessRelCause", OpenAPI_pdu_session_rel_cause_ToString(sm_policy_delete_data->pdu_sess_rel_cause)) == NULL) { ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [pdu_sess_rel_cause]"); goto end; @@ -158,17 +173,13 @@ cJSON *OpenAPI_sm_policy_delete_data_convertToJSON(OpenAPI_sm_policy_delete_data ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [qos_mon_reports]"); goto end; } - - OpenAPI_lnode_t *qos_mon_reports_node; - if (sm_policy_delete_data->qos_mon_reports) { - OpenAPI_list_for_each(sm_policy_delete_data->qos_mon_reports, qos_mon_reports_node) { - cJSON *itemLocal = OpenAPI_qos_monitoring_report_convertToJSON(qos_mon_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [qos_mon_reports]"); - goto end; - } - cJSON_AddItemToArray(qos_mon_reportsList, itemLocal); + OpenAPI_list_for_each(sm_policy_delete_data->qos_mon_reports, node) { + cJSON *itemLocal = OpenAPI_qos_monitoring_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [qos_mon_reports]"); + goto end; } + cJSON_AddItemToArray(qos_mon_reportsList, itemLocal); } } @@ -179,99 +190,98 @@ end: OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_parseFromJSON(cJSON *sm_policy_delete_dataJSON) { OpenAPI_sm_policy_delete_data_t *sm_policy_delete_data_local_var = NULL; - cJSON *user_location_info = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "userLocationInfo"); - + OpenAPI_lnode_t *node = NULL; + cJSON *user_location_info = NULL; OpenAPI_user_location_t *user_location_info_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + cJSON *user_location_info_time = NULL; + cJSON *ran_nas_rel_causes = NULL; + OpenAPI_list_t *ran_nas_rel_causesList = NULL; + cJSON *accu_usage_reports = NULL; + OpenAPI_list_t *accu_usage_reportsList = NULL; + cJSON *pdu_sess_rel_cause = NULL; + OpenAPI_pdu_session_rel_cause_e pdu_sess_rel_causeVariable = 0; + cJSON *qos_mon_reports = NULL; + OpenAPI_list_t *qos_mon_reportsList = NULL; + user_location_info = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "userLocationInfo"); if (user_location_info) { user_location_info_local_nonprim = OpenAPI_user_location_parseFromJSON(user_location_info); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "servingNetwork"); - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + serving_network = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "servingNetwork"); if (serving_network) { serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); } - cJSON *user_location_info_time = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "userLocationInfoTime"); - + user_location_info_time = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "userLocationInfoTime"); if (user_location_info_time) { - if (!cJSON_IsString(user_location_info_time)) { + if (!cJSON_IsString(user_location_info_time) && !cJSON_IsNull(user_location_info_time)) { ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [user_location_info_time]"); goto end; } } - cJSON *ran_nas_rel_causes = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "ranNasRelCauses"); - - OpenAPI_list_t *ran_nas_rel_causesList; + ran_nas_rel_causes = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "ranNasRelCauses"); if (ran_nas_rel_causes) { - cJSON *ran_nas_rel_causes_local_nonprimitive; - if (!cJSON_IsArray(ran_nas_rel_causes)){ - ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [ran_nas_rel_causes]"); - goto end; - } - - ran_nas_rel_causesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ran_nas_rel_causes_local_nonprimitive, ran_nas_rel_causes ) { - if (!cJSON_IsObject(ran_nas_rel_causes_local_nonprimitive)) { + cJSON *ran_nas_rel_causes_local = NULL; + if (!cJSON_IsArray(ran_nas_rel_causes)) { ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [ran_nas_rel_causes]"); goto end; } - OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_causesItem = OpenAPI_ran_nas_rel_cause_parseFromJSON(ran_nas_rel_causes_local_nonprimitive); - if (!ran_nas_rel_causesItem) { - ogs_error("No ran_nas_rel_causesItem"); - OpenAPI_list_free(ran_nas_rel_causesList); - goto end; + ran_nas_rel_causesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ran_nas_rel_causes_local, ran_nas_rel_causes) { + if (!cJSON_IsObject(ran_nas_rel_causes_local)) { + ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [ran_nas_rel_causes]"); + goto end; + } + OpenAPI_ran_nas_rel_cause_t *ran_nas_rel_causesItem = OpenAPI_ran_nas_rel_cause_parseFromJSON(ran_nas_rel_causes_local); + if (!ran_nas_rel_causesItem) { + ogs_error("No ran_nas_rel_causesItem"); + OpenAPI_list_free(ran_nas_rel_causesList); + goto end; + } + OpenAPI_list_add(ran_nas_rel_causesList, ran_nas_rel_causesItem); } - - OpenAPI_list_add(ran_nas_rel_causesList, ran_nas_rel_causesItem); - } } - cJSON *accu_usage_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "accuUsageReports"); - - OpenAPI_list_t *accu_usage_reportsList; + accu_usage_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "accuUsageReports"); if (accu_usage_reports) { - cJSON *accu_usage_reports_local_nonprimitive; - if (!cJSON_IsArray(accu_usage_reports)){ - ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [accu_usage_reports]"); - goto end; - } - - accu_usage_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(accu_usage_reports_local_nonprimitive, accu_usage_reports ) { - if (!cJSON_IsObject(accu_usage_reports_local_nonprimitive)) { + cJSON *accu_usage_reports_local = NULL; + if (!cJSON_IsArray(accu_usage_reports)) { ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [accu_usage_reports]"); goto end; } - OpenAPI_accu_usage_report_t *accu_usage_reportsItem = OpenAPI_accu_usage_report_parseFromJSON(accu_usage_reports_local_nonprimitive); - if (!accu_usage_reportsItem) { - ogs_error("No accu_usage_reportsItem"); - OpenAPI_list_free(accu_usage_reportsList); - goto end; + accu_usage_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(accu_usage_reports_local, accu_usage_reports) { + if (!cJSON_IsObject(accu_usage_reports_local)) { + ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [accu_usage_reports]"); + goto end; + } + OpenAPI_accu_usage_report_t *accu_usage_reportsItem = OpenAPI_accu_usage_report_parseFromJSON(accu_usage_reports_local); + if (!accu_usage_reportsItem) { + ogs_error("No accu_usage_reportsItem"); + OpenAPI_list_free(accu_usage_reportsList); + goto end; + } + OpenAPI_list_add(accu_usage_reportsList, accu_usage_reportsItem); } - - OpenAPI_list_add(accu_usage_reportsList, accu_usage_reportsItem); - } } - cJSON *pdu_sess_rel_cause = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "pduSessRelCause"); - - OpenAPI_pdu_session_rel_cause_e pdu_sess_rel_causeVariable; + pdu_sess_rel_cause = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "pduSessRelCause"); if (pdu_sess_rel_cause) { if (!cJSON_IsString(pdu_sess_rel_cause)) { ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [pdu_sess_rel_cause]"); @@ -280,40 +290,36 @@ OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_parseFromJSON(cJS pdu_sess_rel_causeVariable = OpenAPI_pdu_session_rel_cause_FromString(pdu_sess_rel_cause->valuestring); } - cJSON *qos_mon_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "qosMonReports"); - - OpenAPI_list_t *qos_mon_reportsList; + qos_mon_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "qosMonReports"); if (qos_mon_reports) { - cJSON *qos_mon_reports_local_nonprimitive; - if (!cJSON_IsArray(qos_mon_reports)){ - ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [qos_mon_reports]"); - goto end; - } - - qos_mon_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_mon_reports_local_nonprimitive, qos_mon_reports ) { - if (!cJSON_IsObject(qos_mon_reports_local_nonprimitive)) { + cJSON *qos_mon_reports_local = NULL; + if (!cJSON_IsArray(qos_mon_reports)) { ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [qos_mon_reports]"); goto end; } - OpenAPI_qos_monitoring_report_t *qos_mon_reportsItem = OpenAPI_qos_monitoring_report_parseFromJSON(qos_mon_reports_local_nonprimitive); - if (!qos_mon_reportsItem) { - ogs_error("No qos_mon_reportsItem"); - OpenAPI_list_free(qos_mon_reportsList); - goto end; + qos_mon_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_mon_reports_local, qos_mon_reports) { + if (!cJSON_IsObject(qos_mon_reports_local)) { + ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [qos_mon_reports]"); + goto end; + } + OpenAPI_qos_monitoring_report_t *qos_mon_reportsItem = OpenAPI_qos_monitoring_report_parseFromJSON(qos_mon_reports_local); + if (!qos_mon_reportsItem) { + ogs_error("No qos_mon_reportsItem"); + OpenAPI_list_free(qos_mon_reportsList); + goto end; + } + OpenAPI_list_add(qos_mon_reportsList, qos_mon_reportsItem); } - - OpenAPI_list_add(qos_mon_reportsList, qos_mon_reportsItem); - } } sm_policy_delete_data_local_var = OpenAPI_sm_policy_delete_data_create ( user_location_info ? user_location_info_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, serving_network ? serving_network_local_nonprim : NULL, - user_location_info_time ? ogs_strdup(user_location_info_time->valuestring) : NULL, + user_location_info_time && !cJSON_IsNull(user_location_info_time) ? ogs_strdup(user_location_info_time->valuestring) : NULL, ran_nas_rel_causes ? ran_nas_rel_causesList : NULL, accu_usage_reports ? accu_usage_reportsList : NULL, pdu_sess_rel_cause ? pdu_sess_rel_causeVariable : 0, @@ -322,6 +328,35 @@ OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_parseFromJSON(cJS return sm_policy_delete_data_local_var; end: + if (user_location_info_local_nonprim) { + OpenAPI_user_location_free(user_location_info_local_nonprim); + user_location_info_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (ran_nas_rel_causesList) { + OpenAPI_list_for_each(ran_nas_rel_causesList, node) { + OpenAPI_ran_nas_rel_cause_free(node->data); + } + OpenAPI_list_free(ran_nas_rel_causesList); + ran_nas_rel_causesList = NULL; + } + if (accu_usage_reportsList) { + OpenAPI_list_for_each(accu_usage_reportsList, node) { + OpenAPI_accu_usage_report_free(node->data); + } + OpenAPI_list_free(accu_usage_reportsList); + accu_usage_reportsList = NULL; + } + if (qos_mon_reportsList) { + OpenAPI_list_for_each(qos_mon_reportsList, node) { + OpenAPI_qos_monitoring_report_free(node->data); + } + OpenAPI_list_free(qos_mon_reportsList); + qos_mon_reportsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_dnn_data.c b/lib/sbi/openapi/model/sm_policy_dnn_data.c index 8ae8fe09c..5ef69597f 100644 --- a/lib/sbi/openapi/model/sm_policy_dnn_data.c +++ b/lib/sbi/openapi/model/sm_policy_dnn_data.c @@ -82,49 +82,78 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_create( void OpenAPI_sm_policy_dnn_data_free(OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_dnn_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(sm_policy_dnn_data->dnn); - OpenAPI_list_for_each(sm_policy_dnn_data->allowed_services, node) { - ogs_free(node->data); + if (sm_policy_dnn_data->dnn) { + ogs_free(sm_policy_dnn_data->dnn); + sm_policy_dnn_data->dnn = NULL; } - OpenAPI_list_free(sm_policy_dnn_data->allowed_services); - OpenAPI_list_for_each(sm_policy_dnn_data->subsc_cats, node) { - ogs_free(node->data); + if (sm_policy_dnn_data->allowed_services) { + OpenAPI_list_for_each(sm_policy_dnn_data->allowed_services, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_policy_dnn_data->allowed_services); + sm_policy_dnn_data->allowed_services = NULL; } - OpenAPI_list_free(sm_policy_dnn_data->subsc_cats); - ogs_free(sm_policy_dnn_data->gbr_ul); - ogs_free(sm_policy_dnn_data->gbr_dl); - OpenAPI_charging_information_free(sm_policy_dnn_data->chf_info); - OpenAPI_list_for_each(sm_policy_dnn_data->ref_um_data_limit_ids, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_limit_id_to_monitoring_key_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_dnn_data->subsc_cats) { + OpenAPI_list_for_each(sm_policy_dnn_data->subsc_cats, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_policy_dnn_data->subsc_cats); + sm_policy_dnn_data->subsc_cats = NULL; } - OpenAPI_list_free(sm_policy_dnn_data->ref_um_data_limit_ids); - OpenAPI_list_for_each(sm_policy_dnn_data->pra_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_dnn_data->gbr_ul) { + ogs_free(sm_policy_dnn_data->gbr_ul); + sm_policy_dnn_data->gbr_ul = NULL; } - OpenAPI_list_free(sm_policy_dnn_data->pra_infos); - OpenAPI_list_for_each(sm_policy_dnn_data->bdt_ref_ids, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_dnn_data->gbr_dl) { + ogs_free(sm_policy_dnn_data->gbr_dl); + sm_policy_dnn_data->gbr_dl = NULL; + } + if (sm_policy_dnn_data->chf_info) { + OpenAPI_charging_information_free(sm_policy_dnn_data->chf_info); + sm_policy_dnn_data->chf_info = NULL; + } + if (sm_policy_dnn_data->ref_um_data_limit_ids) { + OpenAPI_list_for_each(sm_policy_dnn_data->ref_um_data_limit_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_limit_id_to_monitoring_key_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_data->ref_um_data_limit_ids); + sm_policy_dnn_data->ref_um_data_limit_ids = NULL; + } + if (sm_policy_dnn_data->pra_infos) { + OpenAPI_list_for_each(sm_policy_dnn_data->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_data->pra_infos); + sm_policy_dnn_data->pra_infos = NULL; + } + if (sm_policy_dnn_data->bdt_ref_ids) { + OpenAPI_list_for_each(sm_policy_dnn_data->bdt_ref_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_data->bdt_ref_ids); + sm_policy_dnn_data->bdt_ref_ids = NULL; } - OpenAPI_list_free(sm_policy_dnn_data->bdt_ref_ids); ogs_free(sm_policy_dnn_data); } cJSON *OpenAPI_sm_policy_dnn_data_convertToJSON(OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_dnn_data == NULL) { ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [SmPolicyDnnData]"); @@ -132,41 +161,41 @@ cJSON *OpenAPI_sm_policy_dnn_data_convertToJSON(OpenAPI_sm_policy_dnn_data_t *sm } item = cJSON_CreateObject(); + if (!sm_policy_dnn_data->dnn) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", sm_policy_dnn_data->dnn) == NULL) { ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [dnn]"); goto end; } if (sm_policy_dnn_data->allowed_services) { - cJSON *allowed_services = cJSON_AddArrayToObject(item, "allowedServices"); - if (allowed_services == NULL) { + cJSON *allowed_servicesList = cJSON_AddArrayToObject(item, "allowedServices"); + if (allowed_servicesList == NULL) { ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [allowed_services]"); goto end; } - - OpenAPI_lnode_t *allowed_services_node; - OpenAPI_list_for_each(sm_policy_dnn_data->allowed_services, allowed_services_node) { - if (cJSON_AddStringToObject(allowed_services, "", (char*)allowed_services_node->data) == NULL) { - ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [allowed_services]"); - goto end; + OpenAPI_list_for_each(sm_policy_dnn_data->allowed_services, node) { + if (cJSON_AddStringToObject(allowed_servicesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [allowed_services]"); + goto end; + } } - } } if (sm_policy_dnn_data->subsc_cats) { - cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats"); - if (subsc_cats == NULL) { + cJSON *subsc_catsList = cJSON_AddArrayToObject(item, "subscCats"); + if (subsc_catsList == NULL) { ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [subsc_cats]"); goto end; } - - OpenAPI_lnode_t *subsc_cats_node; - OpenAPI_list_for_each(sm_policy_dnn_data->subsc_cats, subsc_cats_node) { - if (cJSON_AddStringToObject(subsc_cats, "", (char*)subsc_cats_node->data) == NULL) { - ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [subsc_cats]"); - goto end; + OpenAPI_list_for_each(sm_policy_dnn_data->subsc_cats, node) { + if (cJSON_AddStringToObject(subsc_catsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [subsc_cats]"); + goto end; + } } - } } if (sm_policy_dnn_data->gbr_ul) { @@ -245,21 +274,20 @@ cJSON *OpenAPI_sm_policy_dnn_data_convertToJSON(OpenAPI_sm_policy_dnn_data_t *sm goto end; } cJSON *localMapObject = ref_um_data_limit_ids; - OpenAPI_lnode_t *ref_um_data_limit_ids_node; if (sm_policy_dnn_data->ref_um_data_limit_ids) { - OpenAPI_list_for_each(sm_policy_dnn_data->ref_um_data_limit_ids, ref_um_data_limit_ids_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)ref_um_data_limit_ids_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_limit_id_to_monitoring_key_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_dnn_data->ref_um_data_limit_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_limit_id_to_monitoring_key_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_dnn_data->is_mps_priority) { if (cJSON_AddBoolToObject(item, "mpsPriority", sm_policy_dnn_data->mps_priority) == NULL) { @@ -303,21 +331,20 @@ cJSON *OpenAPI_sm_policy_dnn_data_convertToJSON(OpenAPI_sm_policy_dnn_data_t *sm goto end; } cJSON *localMapObject = pra_infos; - OpenAPI_lnode_t *pra_infos_node; if (sm_policy_dnn_data->pra_infos) { - OpenAPI_list_for_each(sm_policy_dnn_data->pra_infos, pra_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_dnn_data->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_dnn_data->bdt_ref_ids) { cJSON *bdt_ref_ids = cJSON_AddObjectToObject(item, "bdtRefIds"); @@ -326,17 +353,16 @@ cJSON *OpenAPI_sm_policy_dnn_data_convertToJSON(OpenAPI_sm_policy_dnn_data_t *sm goto end; } cJSON *localMapObject = bdt_ref_ids; - OpenAPI_lnode_t *bdt_ref_ids_node; if (sm_policy_dnn_data->bdt_ref_ids) { - OpenAPI_list_for_each(sm_policy_dnn_data->bdt_ref_ids, bdt_ref_ids_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)bdt_ref_ids_node->data; - if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(sm_policy_dnn_data->bdt_ref_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_convertToJSON() failed [inner]"); + goto end; } } } + } if (sm_policy_dnn_data->is_loc_rout_not_allowed) { if (cJSON_AddBoolToObject(item, "locRoutNotAllowed", sm_policy_dnn_data->loc_rout_not_allowed) == NULL) { @@ -352,77 +378,103 @@ end: OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm_policy_dnn_dataJSON) { OpenAPI_sm_policy_dnn_data_t *sm_policy_dnn_data_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *allowed_services = NULL; + OpenAPI_list_t *allowed_servicesList = NULL; + cJSON *subsc_cats = NULL; + OpenAPI_list_t *subsc_catsList = NULL; + cJSON *gbr_ul = NULL; + cJSON *gbr_dl = NULL; + cJSON *adc_support = NULL; + cJSON *subsc_spending_limits = NULL; + cJSON *ipv4_index = NULL; + cJSON *ipv6_index = NULL; + cJSON *offline = NULL; + cJSON *online = NULL; + cJSON *chf_info = NULL; + OpenAPI_charging_information_t *chf_info_local_nonprim = NULL; + cJSON *ref_um_data_limit_ids = NULL; + OpenAPI_list_t *ref_um_data_limit_idsList = NULL; + cJSON *mps_priority = NULL; + cJSON *mcs_priority = NULL; + cJSON *ims_signalling_prio = NULL; + cJSON *mps_priority_level = NULL; + cJSON *mcs_priority_level = NULL; + cJSON *pra_infos = NULL; + OpenAPI_list_t *pra_infosList = NULL; + cJSON *bdt_ref_ids = NULL; + OpenAPI_list_t *bdt_ref_idsList = NULL; + cJSON *loc_rout_not_allowed = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [dnn]"); goto end; } - cJSON *allowed_services = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "allowedServices"); - - OpenAPI_list_t *allowed_servicesList; + allowed_services = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "allowedServices"); if (allowed_services) { - cJSON *allowed_services_local; - if (!cJSON_IsArray(allowed_services)) { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [allowed_services]"); - goto end; - } - allowed_servicesList = OpenAPI_list_create(); + cJSON *allowed_services_local = NULL; + if (!cJSON_IsArray(allowed_services)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [allowed_services]"); + goto end; + } - cJSON_ArrayForEach(allowed_services_local, allowed_services) { - if (!cJSON_IsString(allowed_services_local)) { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [allowed_services]"); - goto end; - } - OpenAPI_list_add(allowed_servicesList, ogs_strdup(allowed_services_local->valuestring)); - } + allowed_servicesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_services_local, allowed_services) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(allowed_services_local)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [allowed_services]"); + goto end; + } + OpenAPI_list_add(allowed_servicesList, ogs_strdup(allowed_services_local->valuestring)); + } } - cJSON *subsc_cats = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "subscCats"); - - OpenAPI_list_t *subsc_catsList; + subsc_cats = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "subscCats"); if (subsc_cats) { - cJSON *subsc_cats_local; - if (!cJSON_IsArray(subsc_cats)) { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [subsc_cats]"); - goto end; - } - subsc_catsList = OpenAPI_list_create(); + cJSON *subsc_cats_local = NULL; + if (!cJSON_IsArray(subsc_cats)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [subsc_cats]"); + goto end; + } - cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { - if (!cJSON_IsString(subsc_cats_local)) { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [subsc_cats]"); - goto end; - } - OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); - } + subsc_catsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(subsc_cats_local)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [subsc_cats]"); + goto end; + } + OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); + } } - cJSON *gbr_ul = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "gbrUl"); - + gbr_ul = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "gbrUl"); if (gbr_ul) { - if (!cJSON_IsString(gbr_ul)) { + if (!cJSON_IsString(gbr_ul) && !cJSON_IsNull(gbr_ul)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [gbr_ul]"); goto end; } } - cJSON *gbr_dl = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "gbrDl"); - + gbr_dl = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "gbrDl"); if (gbr_dl) { - if (!cJSON_IsString(gbr_dl)) { + if (!cJSON_IsString(gbr_dl) && !cJSON_IsNull(gbr_dl)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [gbr_dl]"); goto end; } } - cJSON *adc_support = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "adcSupport"); - + adc_support = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "adcSupport"); if (adc_support) { if (!cJSON_IsBool(adc_support)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [adc_support]"); @@ -430,8 +482,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *subsc_spending_limits = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "subscSpendingLimits"); - + subsc_spending_limits = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "subscSpendingLimits"); if (subsc_spending_limits) { if (!cJSON_IsBool(subsc_spending_limits)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [subsc_spending_limits]"); @@ -439,8 +490,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *ipv4_index = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "ipv4Index"); - + ipv4_index = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "ipv4Index"); if (ipv4_index) { if (!cJSON_IsNumber(ipv4_index)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ipv4_index]"); @@ -448,8 +498,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *ipv6_index = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "ipv6Index"); - + ipv6_index = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "ipv6Index"); if (ipv6_index) { if (!cJSON_IsNumber(ipv6_index)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ipv6_index]"); @@ -457,8 +506,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *offline = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "offline"); - + offline = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "offline"); if (offline) { if (!cJSON_IsBool(offline)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [offline]"); @@ -466,8 +514,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *online = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "online"); - + online = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "online"); if (online) { if (!cJSON_IsBool(online)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [online]"); @@ -475,41 +522,38 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *chf_info = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "chfInfo"); - - OpenAPI_charging_information_t *chf_info_local_nonprim = NULL; + chf_info = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "chfInfo"); if (chf_info) { chf_info_local_nonprim = OpenAPI_charging_information_parseFromJSON(chf_info); } - cJSON *ref_um_data_limit_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "refUmDataLimitIds"); - - OpenAPI_list_t *ref_um_data_limit_idsList; + ref_um_data_limit_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "refUmDataLimitIds"); if (ref_um_data_limit_ids) { - cJSON *ref_um_data_limit_ids_local_map; - if (!cJSON_IsObject(ref_um_data_limit_ids)) { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ref_um_data_limit_ids]"); - goto end; - } - ref_um_data_limit_idsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(ref_um_data_limit_ids_local_map, ref_um_data_limit_ids) { - cJSON *localMapObject = ref_um_data_limit_ids_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_limit_id_to_monitoring_key_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [inner]"); + cJSON *ref_um_data_limit_ids_local_map = NULL; + if (!cJSON_IsObject(ref_um_data_limit_ids) && !cJSON_IsNull(ref_um_data_limit_ids)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ref_um_data_limit_ids]"); goto end; } - OpenAPI_list_add(ref_um_data_limit_idsList, localMapKeyPair); - } + if (cJSON_IsObject(ref_um_data_limit_ids)) { + ref_um_data_limit_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(ref_um_data_limit_ids_local_map, ref_um_data_limit_ids) { + cJSON *localMapObject = ref_um_data_limit_ids_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_limit_id_to_monitoring_key_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(ref_um_data_limit_idsList, localMapKeyPair); + } + } } - cJSON *mps_priority = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mpsPriority"); - + mps_priority = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mpsPriority"); if (mps_priority) { if (!cJSON_IsBool(mps_priority)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [mps_priority]"); @@ -517,8 +561,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *mcs_priority = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mcsPriority"); - + mcs_priority = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mcsPriority"); if (mcs_priority) { if (!cJSON_IsBool(mcs_priority)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [mcs_priority]"); @@ -526,8 +569,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *ims_signalling_prio = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "imsSignallingPrio"); - + ims_signalling_prio = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "imsSignallingPrio"); if (ims_signalling_prio) { if (!cJSON_IsBool(ims_signalling_prio)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [ims_signalling_prio]"); @@ -535,8 +577,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *mps_priority_level = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mpsPriorityLevel"); - + mps_priority_level = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mpsPriorityLevel"); if (mps_priority_level) { if (!cJSON_IsNumber(mps_priority_level)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [mps_priority_level]"); @@ -544,8 +585,7 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *mcs_priority_level = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mcsPriorityLevel"); - + mcs_priority_level = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "mcsPriorityLevel"); if (mcs_priority_level) { if (!cJSON_IsNumber(mcs_priority_level)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [mcs_priority_level]"); @@ -553,56 +593,57 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm } } - cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "praInfos"); - - OpenAPI_list_t *pra_infosList; + pra_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "praInfos"); if (pra_infos) { - cJSON *pra_infos_local_map; - if (!cJSON_IsObject(pra_infos)) { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [pra_infos]"); - goto end; - } - pra_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { - cJSON *localMapObject = pra_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [inner]"); + cJSON *pra_infos_local_map = NULL; + if (!cJSON_IsObject(pra_infos) && !cJSON_IsNull(pra_infos)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [pra_infos]"); goto end; } - OpenAPI_list_add(pra_infosList, localMapKeyPair); - } + if (cJSON_IsObject(pra_infos)) { + pra_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { + cJSON *localMapObject = pra_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pra_infosList, localMapKeyPair); + } + } } - cJSON *bdt_ref_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "bdtRefIds"); - - OpenAPI_list_t *bdt_ref_idsList; + bdt_ref_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "bdtRefIds"); if (bdt_ref_ids) { - cJSON *bdt_ref_ids_local_map; - if (!cJSON_IsObject(bdt_ref_ids)) { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [bdt_ref_ids]"); - goto end; - } - bdt_ref_idsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(bdt_ref_ids_local_map, bdt_ref_ids) { - cJSON *localMapObject = bdt_ref_ids_local_map; - if (!cJSON_IsString(localMapObject)) { - ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [inner]"); + cJSON *bdt_ref_ids_local_map = NULL; + if (!cJSON_IsObject(bdt_ref_ids) && !cJSON_IsNull(bdt_ref_ids)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [bdt_ref_ids]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - OpenAPI_list_add(bdt_ref_idsList, localMapKeyPair); - } + if (cJSON_IsObject(bdt_ref_ids)) { + bdt_ref_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(bdt_ref_ids_local_map, bdt_ref_ids) { + cJSON *localMapObject = bdt_ref_ids_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [inner]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + OpenAPI_list_add(bdt_ref_idsList, localMapKeyPair); + } + } } - cJSON *loc_rout_not_allowed = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "locRoutNotAllowed"); - + loc_rout_not_allowed = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_dataJSON, "locRoutNotAllowed"); if (loc_rout_not_allowed) { if (!cJSON_IsBool(loc_rout_not_allowed)) { ogs_error("OpenAPI_sm_policy_dnn_data_parseFromJSON() failed [loc_rout_not_allowed]"); @@ -614,8 +655,8 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm ogs_strdup(dnn->valuestring), allowed_services ? allowed_servicesList : NULL, subsc_cats ? subsc_catsList : NULL, - gbr_ul ? ogs_strdup(gbr_ul->valuestring) : NULL, - gbr_dl ? ogs_strdup(gbr_dl->valuestring) : NULL, + gbr_ul && !cJSON_IsNull(gbr_ul) ? ogs_strdup(gbr_ul->valuestring) : NULL, + gbr_dl && !cJSON_IsNull(gbr_dl) ? ogs_strdup(gbr_dl->valuestring) : NULL, adc_support ? true : false, adc_support ? adc_support->valueint : 0, subsc_spending_limits ? true : false, @@ -648,6 +689,54 @@ OpenAPI_sm_policy_dnn_data_t *OpenAPI_sm_policy_dnn_data_parseFromJSON(cJSON *sm return sm_policy_dnn_data_local_var; end: + if (allowed_servicesList) { + OpenAPI_list_for_each(allowed_servicesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(allowed_servicesList); + allowed_servicesList = NULL; + } + if (subsc_catsList) { + OpenAPI_list_for_each(subsc_catsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subsc_catsList); + subsc_catsList = NULL; + } + if (chf_info_local_nonprim) { + OpenAPI_charging_information_free(chf_info_local_nonprim); + chf_info_local_nonprim = NULL; + } + if (ref_um_data_limit_idsList) { + OpenAPI_list_for_each(ref_um_data_limit_idsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_limit_id_to_monitoring_key_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ref_um_data_limit_idsList); + ref_um_data_limit_idsList = NULL; + } + if (pra_infosList) { + OpenAPI_list_for_each(pra_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pra_infosList); + pra_infosList = NULL; + } + if (bdt_ref_idsList) { + OpenAPI_list_for_each(bdt_ref_idsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(bdt_ref_idsList); + bdt_ref_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_dnn_data_patch.c b/lib/sbi/openapi/model/sm_policy_dnn_data_patch.c index f80065a42..1efb947af 100644 --- a/lib/sbi/openapi/model/sm_policy_dnn_data_patch.c +++ b/lib/sbi/openapi/model/sm_policy_dnn_data_patch.c @@ -20,24 +20,32 @@ OpenAPI_sm_policy_dnn_data_patch_t *OpenAPI_sm_policy_dnn_data_patch_create( void OpenAPI_sm_policy_dnn_data_patch_free(OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_dnn_data_patch) { return; } - OpenAPI_lnode_t *node; - ogs_free(sm_policy_dnn_data_patch->dnn); - OpenAPI_list_for_each(sm_policy_dnn_data_patch->bdt_ref_ids, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_dnn_data_patch->dnn) { + ogs_free(sm_policy_dnn_data_patch->dnn); + sm_policy_dnn_data_patch->dnn = NULL; + } + if (sm_policy_dnn_data_patch->bdt_ref_ids) { + OpenAPI_list_for_each(sm_policy_dnn_data_patch->bdt_ref_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_data_patch->bdt_ref_ids); + sm_policy_dnn_data_patch->bdt_ref_ids = NULL; } - OpenAPI_list_free(sm_policy_dnn_data_patch->bdt_ref_ids); ogs_free(sm_policy_dnn_data_patch); } cJSON *OpenAPI_sm_policy_dnn_data_patch_convertToJSON(OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_dnn_data_patch == NULL) { ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [SmPolicyDnnDataPatch]"); @@ -45,6 +53,10 @@ cJSON *OpenAPI_sm_policy_dnn_data_patch_convertToJSON(OpenAPI_sm_policy_dnn_data } item = cJSON_CreateObject(); + if (!sm_policy_dnn_data_patch->dnn) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnn", sm_policy_dnn_data_patch->dnn) == NULL) { ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [dnn]"); goto end; @@ -57,17 +69,16 @@ cJSON *OpenAPI_sm_policy_dnn_data_patch_convertToJSON(OpenAPI_sm_policy_dnn_data goto end; } cJSON *localMapObject = bdt_ref_ids; - OpenAPI_lnode_t *bdt_ref_ids_node; if (sm_policy_dnn_data_patch->bdt_ref_ids) { - OpenAPI_list_for_each(sm_policy_dnn_data_patch->bdt_ref_ids, bdt_ref_ids_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)bdt_ref_ids_node->data; - if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [inner]"); - goto end; - } + OpenAPI_list_for_each(sm_policy_dnn_data_patch->bdt_ref_ids, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_convertToJSON() failed [inner]"); + goto end; } } } + } end: return item; @@ -76,37 +87,42 @@ end: OpenAPI_sm_policy_dnn_data_patch_t *OpenAPI_sm_policy_dnn_data_patch_parseFromJSON(cJSON *sm_policy_dnn_data_patchJSON) { OpenAPI_sm_policy_dnn_data_patch_t *sm_policy_dnn_data_patch_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_data_patchJSON, "dnn"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *bdt_ref_ids = NULL; + OpenAPI_list_t *bdt_ref_idsList = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_data_patchJSON, "dnn"); if (!dnn) { ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [dnn]"); goto end; } - cJSON *bdt_ref_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_data_patchJSON, "bdtRefIds"); - - OpenAPI_list_t *bdt_ref_idsList; + bdt_ref_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_dnn_data_patchJSON, "bdtRefIds"); if (bdt_ref_ids) { - cJSON *bdt_ref_ids_local_map; - if (!cJSON_IsObject(bdt_ref_ids)) { - ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [bdt_ref_ids]"); - goto end; - } - bdt_ref_idsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(bdt_ref_ids_local_map, bdt_ref_ids) { - cJSON *localMapObject = bdt_ref_ids_local_map; - if (!cJSON_IsString(localMapObject)) { - ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [inner]"); + cJSON *bdt_ref_ids_local_map = NULL; + if (!cJSON_IsObject(bdt_ref_ids) && !cJSON_IsNull(bdt_ref_ids)) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [bdt_ref_ids]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - OpenAPI_list_add(bdt_ref_idsList, localMapKeyPair); - } + if (cJSON_IsObject(bdt_ref_ids)) { + bdt_ref_idsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(bdt_ref_ids_local_map, bdt_ref_ids) { + cJSON *localMapObject = bdt_ref_ids_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_sm_policy_dnn_data_patch_parseFromJSON() failed [inner]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + OpenAPI_list_add(bdt_ref_idsList, localMapKeyPair); + } + } } sm_policy_dnn_data_patch_local_var = OpenAPI_sm_policy_dnn_data_patch_create ( @@ -116,6 +132,16 @@ OpenAPI_sm_policy_dnn_data_patch_t *OpenAPI_sm_policy_dnn_data_patch_parseFromJS return sm_policy_dnn_data_patch_local_var; end: + if (bdt_ref_idsList) { + OpenAPI_list_for_each(bdt_ref_idsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(bdt_ref_idsList); + bdt_ref_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_notification.c b/lib/sbi/openapi/model/sm_policy_notification.c index 514517ab3..233b46198 100644 --- a/lib/sbi/openapi/model/sm_policy_notification.c +++ b/lib/sbi/openapi/model/sm_policy_notification.c @@ -20,18 +20,26 @@ OpenAPI_sm_policy_notification_t *OpenAPI_sm_policy_notification_create( void OpenAPI_sm_policy_notification_free(OpenAPI_sm_policy_notification_t *sm_policy_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_notification) { return; } - OpenAPI_lnode_t *node; - ogs_free(sm_policy_notification->resource_uri); - OpenAPI_sm_policy_decision_free(sm_policy_notification->sm_policy_decision); + if (sm_policy_notification->resource_uri) { + ogs_free(sm_policy_notification->resource_uri); + sm_policy_notification->resource_uri = NULL; + } + if (sm_policy_notification->sm_policy_decision) { + OpenAPI_sm_policy_decision_free(sm_policy_notification->sm_policy_decision); + sm_policy_notification->sm_policy_decision = NULL; + } ogs_free(sm_policy_notification); } cJSON *OpenAPI_sm_policy_notification_convertToJSON(OpenAPI_sm_policy_notification_t *sm_policy_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_notification == NULL) { ogs_error("OpenAPI_sm_policy_notification_convertToJSON() failed [SmPolicyNotification]"); @@ -66,29 +74,34 @@ end: OpenAPI_sm_policy_notification_t *OpenAPI_sm_policy_notification_parseFromJSON(cJSON *sm_policy_notificationJSON) { OpenAPI_sm_policy_notification_t *sm_policy_notification_local_var = NULL; - cJSON *resource_uri = cJSON_GetObjectItemCaseSensitive(sm_policy_notificationJSON, "resourceUri"); - + OpenAPI_lnode_t *node = NULL; + cJSON *resource_uri = NULL; + cJSON *sm_policy_decision = NULL; + OpenAPI_sm_policy_decision_t *sm_policy_decision_local_nonprim = NULL; + resource_uri = cJSON_GetObjectItemCaseSensitive(sm_policy_notificationJSON, "resourceUri"); if (resource_uri) { - if (!cJSON_IsString(resource_uri)) { + if (!cJSON_IsString(resource_uri) && !cJSON_IsNull(resource_uri)) { ogs_error("OpenAPI_sm_policy_notification_parseFromJSON() failed [resource_uri]"); goto end; } } - cJSON *sm_policy_decision = cJSON_GetObjectItemCaseSensitive(sm_policy_notificationJSON, "smPolicyDecision"); - - OpenAPI_sm_policy_decision_t *sm_policy_decision_local_nonprim = NULL; + sm_policy_decision = cJSON_GetObjectItemCaseSensitive(sm_policy_notificationJSON, "smPolicyDecision"); if (sm_policy_decision) { sm_policy_decision_local_nonprim = OpenAPI_sm_policy_decision_parseFromJSON(sm_policy_decision); } sm_policy_notification_local_var = OpenAPI_sm_policy_notification_create ( - resource_uri ? ogs_strdup(resource_uri->valuestring) : NULL, + resource_uri && !cJSON_IsNull(resource_uri) ? ogs_strdup(resource_uri->valuestring) : NULL, sm_policy_decision ? sm_policy_decision_local_nonprim : NULL ); return sm_policy_notification_local_var; end: + if (sm_policy_decision_local_nonprim) { + OpenAPI_sm_policy_decision_free(sm_policy_decision_local_nonprim); + sm_policy_decision_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_snssai_data.c b/lib/sbi/openapi/model/sm_policy_snssai_data.c index 5e48d2e37..765792a35 100644 --- a/lib/sbi/openapi/model/sm_policy_snssai_data.c +++ b/lib/sbi/openapi/model/sm_policy_snssai_data.c @@ -20,24 +20,32 @@ OpenAPI_sm_policy_snssai_data_t *OpenAPI_sm_policy_snssai_data_create( void OpenAPI_sm_policy_snssai_data_free(OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_snssai_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(sm_policy_snssai_data->snssai); - OpenAPI_list_for_each(sm_policy_snssai_data->sm_policy_dnn_data, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_sm_policy_dnn_data_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_snssai_data->snssai) { + OpenAPI_snssai_free(sm_policy_snssai_data->snssai); + sm_policy_snssai_data->snssai = NULL; + } + if (sm_policy_snssai_data->sm_policy_dnn_data) { + OpenAPI_list_for_each(sm_policy_snssai_data->sm_policy_dnn_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_sm_policy_dnn_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_snssai_data->sm_policy_dnn_data); + sm_policy_snssai_data->sm_policy_dnn_data = NULL; } - OpenAPI_list_free(sm_policy_snssai_data->sm_policy_dnn_data); ogs_free(sm_policy_snssai_data); } cJSON *OpenAPI_sm_policy_snssai_data_convertToJSON(OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_snssai_data == NULL) { ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [SmPolicySnssaiData]"); @@ -45,6 +53,10 @@ cJSON *OpenAPI_sm_policy_snssai_data_convertToJSON(OpenAPI_sm_policy_snssai_data } item = cJSON_CreateObject(); + if (!sm_policy_snssai_data->snssai) { + ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [snssai]"); + return NULL; + } cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(sm_policy_snssai_data->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [snssai]"); @@ -63,21 +75,20 @@ cJSON *OpenAPI_sm_policy_snssai_data_convertToJSON(OpenAPI_sm_policy_snssai_data goto end; } cJSON *localMapObject = sm_policy_dnn_data; - OpenAPI_lnode_t *sm_policy_dnn_data_node; if (sm_policy_snssai_data->sm_policy_dnn_data) { - OpenAPI_list_for_each(sm_policy_snssai_data->sm_policy_dnn_data, sm_policy_dnn_data_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sm_policy_dnn_data_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_sm_policy_dnn_data_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_snssai_data->sm_policy_dnn_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_sm_policy_dnn_data_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -86,39 +97,42 @@ end: OpenAPI_sm_policy_snssai_data_t *OpenAPI_sm_policy_snssai_data_parseFromJSON(cJSON *sm_policy_snssai_dataJSON) { OpenAPI_sm_policy_snssai_data_t *sm_policy_snssai_data_local_var = NULL; - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_dataJSON, "snssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *sm_policy_dnn_data = NULL; + OpenAPI_list_t *sm_policy_dnn_dataList = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_dataJSON, "snssai"); if (!snssai) { ogs_error("OpenAPI_sm_policy_snssai_data_parseFromJSON() failed [snssai]"); goto end; } - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); - cJSON *sm_policy_dnn_data = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_dataJSON, "smPolicyDnnData"); - - OpenAPI_list_t *sm_policy_dnn_dataList; + sm_policy_dnn_data = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_dataJSON, "smPolicyDnnData"); if (sm_policy_dnn_data) { - cJSON *sm_policy_dnn_data_local_map; - if (!cJSON_IsObject(sm_policy_dnn_data)) { - ogs_error("OpenAPI_sm_policy_snssai_data_parseFromJSON() failed [sm_policy_dnn_data]"); - goto end; - } - sm_policy_dnn_dataList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(sm_policy_dnn_data_local_map, sm_policy_dnn_data) { - cJSON *localMapObject = sm_policy_dnn_data_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_sm_policy_dnn_data_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_snssai_data_parseFromJSON() failed [inner]"); + cJSON *sm_policy_dnn_data_local_map = NULL; + if (!cJSON_IsObject(sm_policy_dnn_data) && !cJSON_IsNull(sm_policy_dnn_data)) { + ogs_error("OpenAPI_sm_policy_snssai_data_parseFromJSON() failed [sm_policy_dnn_data]"); goto end; } - OpenAPI_list_add(sm_policy_dnn_dataList, localMapKeyPair); - } + if (cJSON_IsObject(sm_policy_dnn_data)) { + sm_policy_dnn_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sm_policy_dnn_data_local_map, sm_policy_dnn_data) { + cJSON *localMapObject = sm_policy_dnn_data_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_sm_policy_dnn_data_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_snssai_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(sm_policy_dnn_dataList, localMapKeyPair); + } + } } sm_policy_snssai_data_local_var = OpenAPI_sm_policy_snssai_data_create ( @@ -128,6 +142,20 @@ OpenAPI_sm_policy_snssai_data_t *OpenAPI_sm_policy_snssai_data_parseFromJSON(cJS return sm_policy_snssai_data_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (sm_policy_dnn_dataList) { + OpenAPI_list_for_each(sm_policy_dnn_dataList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_sm_policy_dnn_data_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_dataList); + sm_policy_dnn_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_snssai_data_patch.c b/lib/sbi/openapi/model/sm_policy_snssai_data_patch.c index 38dbf566e..76029784f 100644 --- a/lib/sbi/openapi/model/sm_policy_snssai_data_patch.c +++ b/lib/sbi/openapi/model/sm_policy_snssai_data_patch.c @@ -20,24 +20,32 @@ OpenAPI_sm_policy_snssai_data_patch_t *OpenAPI_sm_policy_snssai_data_patch_creat void OpenAPI_sm_policy_snssai_data_patch_free(OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_snssai_data_patch) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(sm_policy_snssai_data_patch->snssai); - OpenAPI_list_for_each(sm_policy_snssai_data_patch->sm_policy_dnn_data, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_sm_policy_dnn_data_patch_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_snssai_data_patch->snssai) { + OpenAPI_snssai_free(sm_policy_snssai_data_patch->snssai); + sm_policy_snssai_data_patch->snssai = NULL; + } + if (sm_policy_snssai_data_patch->sm_policy_dnn_data) { + OpenAPI_list_for_each(sm_policy_snssai_data_patch->sm_policy_dnn_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_sm_policy_dnn_data_patch_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_snssai_data_patch->sm_policy_dnn_data); + sm_policy_snssai_data_patch->sm_policy_dnn_data = NULL; } - OpenAPI_list_free(sm_policy_snssai_data_patch->sm_policy_dnn_data); ogs_free(sm_policy_snssai_data_patch); } cJSON *OpenAPI_sm_policy_snssai_data_patch_convertToJSON(OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_snssai_data_patch == NULL) { ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [SmPolicySnssaiDataPatch]"); @@ -45,6 +53,10 @@ cJSON *OpenAPI_sm_policy_snssai_data_patch_convertToJSON(OpenAPI_sm_policy_snssa } item = cJSON_CreateObject(); + if (!sm_policy_snssai_data_patch->snssai) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [snssai]"); + return NULL; + } cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(sm_policy_snssai_data_patch->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [snssai]"); @@ -63,21 +75,20 @@ cJSON *OpenAPI_sm_policy_snssai_data_patch_convertToJSON(OpenAPI_sm_policy_snssa goto end; } cJSON *localMapObject = sm_policy_dnn_data; - OpenAPI_lnode_t *sm_policy_dnn_data_node; if (sm_policy_snssai_data_patch->sm_policy_dnn_data) { - OpenAPI_list_for_each(sm_policy_snssai_data_patch->sm_policy_dnn_data, sm_policy_dnn_data_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)sm_policy_dnn_data_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_sm_policy_dnn_data_patch_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_snssai_data_patch->sm_policy_dnn_data, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_sm_policy_dnn_data_patch_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -86,39 +97,42 @@ end: OpenAPI_sm_policy_snssai_data_patch_t *OpenAPI_sm_policy_snssai_data_patch_parseFromJSON(cJSON *sm_policy_snssai_data_patchJSON) { OpenAPI_sm_policy_snssai_data_patch_t *sm_policy_snssai_data_patch_local_var = NULL; - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_data_patchJSON, "snssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *sm_policy_dnn_data = NULL; + OpenAPI_list_t *sm_policy_dnn_dataList = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_data_patchJSON, "snssai"); if (!snssai) { ogs_error("OpenAPI_sm_policy_snssai_data_patch_parseFromJSON() failed [snssai]"); goto end; } - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); - cJSON *sm_policy_dnn_data = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_data_patchJSON, "smPolicyDnnData"); - - OpenAPI_list_t *sm_policy_dnn_dataList; + sm_policy_dnn_data = cJSON_GetObjectItemCaseSensitive(sm_policy_snssai_data_patchJSON, "smPolicyDnnData"); if (sm_policy_dnn_data) { - cJSON *sm_policy_dnn_data_local_map; - if (!cJSON_IsObject(sm_policy_dnn_data)) { - ogs_error("OpenAPI_sm_policy_snssai_data_patch_parseFromJSON() failed [sm_policy_dnn_data]"); - goto end; - } - sm_policy_dnn_dataList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(sm_policy_dnn_data_local_map, sm_policy_dnn_data) { - cJSON *localMapObject = sm_policy_dnn_data_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_sm_policy_dnn_data_patch_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_snssai_data_patch_parseFromJSON() failed [inner]"); + cJSON *sm_policy_dnn_data_local_map = NULL; + if (!cJSON_IsObject(sm_policy_dnn_data) && !cJSON_IsNull(sm_policy_dnn_data)) { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_parseFromJSON() failed [sm_policy_dnn_data]"); goto end; } - OpenAPI_list_add(sm_policy_dnn_dataList, localMapKeyPair); - } + if (cJSON_IsObject(sm_policy_dnn_data)) { + sm_policy_dnn_dataList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(sm_policy_dnn_data_local_map, sm_policy_dnn_data) { + cJSON *localMapObject = sm_policy_dnn_data_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_sm_policy_dnn_data_patch_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_snssai_data_patch_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(sm_policy_dnn_dataList, localMapKeyPair); + } + } } sm_policy_snssai_data_patch_local_var = OpenAPI_sm_policy_snssai_data_patch_create ( @@ -128,6 +142,20 @@ OpenAPI_sm_policy_snssai_data_patch_t *OpenAPI_sm_policy_snssai_data_patch_parse return sm_policy_snssai_data_patch_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (sm_policy_dnn_dataList) { + OpenAPI_list_for_each(sm_policy_dnn_dataList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_sm_policy_dnn_data_patch_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_dnn_dataList); + sm_policy_dnn_dataList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sm_policy_update_context_data.c b/lib/sbi/openapi/model/sm_policy_update_context_data.c index 104ee6b65..4e6f6b6e7 100644 --- a/lib/sbi/openapi/model/sm_policy_update_context_data.c +++ b/lib/sbi/openapi/model/sm_policy_update_context_data.c @@ -122,97 +122,225 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_c void OpenAPI_sm_policy_update_context_data_free(OpenAPI_sm_policy_update_context_data_t *sm_policy_update_context_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sm_policy_update_context_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(sm_policy_update_context_data->rep_policy_ctrl_req_triggers); - OpenAPI_list_for_each(sm_policy_update_context_data->acc_net_ch_ids, node) { - OpenAPI_acc_net_ch_id_free(node->data); + if (sm_policy_update_context_data->rep_policy_ctrl_req_triggers) { + OpenAPI_list_free(sm_policy_update_context_data->rep_policy_ctrl_req_triggers); + sm_policy_update_context_data->rep_policy_ctrl_req_triggers = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->acc_net_ch_ids); - OpenAPI_additional_access_info_free(sm_policy_update_context_data->add_access_info); - OpenAPI_additional_access_info_free(sm_policy_update_context_data->rel_access_info); - OpenAPI_plmn_id_nid_free(sm_policy_update_context_data->serving_network); - OpenAPI_user_location_free(sm_policy_update_context_data->user_location_info); - ogs_free(sm_policy_update_context_data->ue_time_zone); - ogs_free(sm_policy_update_context_data->rel_ipv4_address); - ogs_free(sm_policy_update_context_data->ipv4_address); - ogs_free(sm_policy_update_context_data->ip_domain); - ogs_free(sm_policy_update_context_data->ipv6_address_prefix); - ogs_free(sm_policy_update_context_data->rel_ipv6_address_prefix); - ogs_free(sm_policy_update_context_data->add_ipv6_addr_prefixes); - ogs_free(sm_policy_update_context_data->add_rel_ipv6_addr_prefixes); - ogs_free(sm_policy_update_context_data->rel_ue_mac); - ogs_free(sm_policy_update_context_data->ue_mac); - OpenAPI_ambr_free(sm_policy_update_context_data->subs_sess_ambr); - ogs_free(sm_policy_update_context_data->auth_prof_index); - OpenAPI_subscribed_default_qos_free(sm_policy_update_context_data->subs_def_qos); - OpenAPI_vplmn_qos_free(sm_policy_update_context_data->vplmn_qos); - OpenAPI_list_for_each(sm_policy_update_context_data->accu_usage_reports, node) { - OpenAPI_accu_usage_report_free(node->data); + if (sm_policy_update_context_data->acc_net_ch_ids) { + OpenAPI_list_for_each(sm_policy_update_context_data->acc_net_ch_ids, node) { + OpenAPI_acc_net_ch_id_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->acc_net_ch_ids); + sm_policy_update_context_data->acc_net_ch_ids = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->accu_usage_reports); - OpenAPI_list_for_each(sm_policy_update_context_data->app_detection_infos, node) { - OpenAPI_app_detection_info_free(node->data); + if (sm_policy_update_context_data->add_access_info) { + OpenAPI_additional_access_info_free(sm_policy_update_context_data->add_access_info); + sm_policy_update_context_data->add_access_info = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->app_detection_infos); - OpenAPI_list_for_each(sm_policy_update_context_data->rule_reports, node) { - OpenAPI_rule_report_free(node->data); + if (sm_policy_update_context_data->rel_access_info) { + OpenAPI_additional_access_info_free(sm_policy_update_context_data->rel_access_info); + sm_policy_update_context_data->rel_access_info = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->rule_reports); - OpenAPI_list_for_each(sm_policy_update_context_data->sess_rule_reports, node) { - OpenAPI_session_rule_report_free(node->data); + if (sm_policy_update_context_data->serving_network) { + OpenAPI_plmn_id_nid_free(sm_policy_update_context_data->serving_network); + sm_policy_update_context_data->serving_network = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->sess_rule_reports); - OpenAPI_list_for_each(sm_policy_update_context_data->qnc_reports, node) { - OpenAPI_qos_notification_control_info_free(node->data); + if (sm_policy_update_context_data->user_location_info) { + OpenAPI_user_location_free(sm_policy_update_context_data->user_location_info); + sm_policy_update_context_data->user_location_info = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->qnc_reports); - OpenAPI_list_for_each(sm_policy_update_context_data->qos_mon_reports, node) { - OpenAPI_qos_monitoring_report_free(node->data); + if (sm_policy_update_context_data->ue_time_zone) { + ogs_free(sm_policy_update_context_data->ue_time_zone); + sm_policy_update_context_data->ue_time_zone = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->qos_mon_reports); - ogs_free(sm_policy_update_context_data->user_location_info_time); - OpenAPI_list_for_each(sm_policy_update_context_data->rep_pra_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (sm_policy_update_context_data->rel_ipv4_address) { + ogs_free(sm_policy_update_context_data->rel_ipv4_address); + sm_policy_update_context_data->rel_ipv4_address = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->rep_pra_infos); - OpenAPI_ue_initiated_resource_request_free(sm_policy_update_context_data->ue_init_res_req); - OpenAPI_serving_nf_identity_free(sm_policy_update_context_data->serv_nf_id); - OpenAPI_trace_data_free(sm_policy_update_context_data->trace_req); - OpenAPI_atsss_capability_free(sm_policy_update_context_data->atsss_capab); - OpenAPI_tsn_bridge_info_free(sm_policy_update_context_data->tsn_bridge_info); - OpenAPI_bridge_management_container_free(sm_policy_update_context_data->tsn_bridge_man_cont); - OpenAPI_port_management_container_free(sm_policy_update_context_data->tsn_port_man_cont_dstt); - OpenAPI_list_for_each(sm_policy_update_context_data->tsn_port_man_cont_nwtts, node) { - OpenAPI_port_management_container_free(node->data); + if (sm_policy_update_context_data->ipv4_address) { + ogs_free(sm_policy_update_context_data->ipv4_address); + sm_policy_update_context_data->ipv4_address = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->tsn_port_man_cont_nwtts); - OpenAPI_list_for_each(sm_policy_update_context_data->mul_addr_infos, node) { - OpenAPI_ip_multicast_address_info_free(node->data); + if (sm_policy_update_context_data->ip_domain) { + ogs_free(sm_policy_update_context_data->ip_domain); + sm_policy_update_context_data->ip_domain = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->mul_addr_infos); - OpenAPI_list_free(sm_policy_update_context_data->policy_dec_failure_reports); - OpenAPI_list_for_each(sm_policy_update_context_data->traffic_descriptors, node) { - OpenAPI_ddd_traffic_descriptor_free(node->data); + if (sm_policy_update_context_data->ipv6_address_prefix) { + ogs_free(sm_policy_update_context_data->ipv6_address_prefix); + sm_policy_update_context_data->ipv6_address_prefix = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->traffic_descriptors); - ogs_free(sm_policy_update_context_data->pcc_rule_id); - OpenAPI_list_for_each(sm_policy_update_context_data->inter_grp_ids, node) { - ogs_free(node->data); + if (sm_policy_update_context_data->rel_ipv6_address_prefix) { + ogs_free(sm_policy_update_context_data->rel_ipv6_address_prefix); + sm_policy_update_context_data->rel_ipv6_address_prefix = NULL; + } + if (sm_policy_update_context_data->add_ipv6_addr_prefixes) { + ogs_free(sm_policy_update_context_data->add_ipv6_addr_prefixes); + sm_policy_update_context_data->add_ipv6_addr_prefixes = NULL; + } + if (sm_policy_update_context_data->add_rel_ipv6_addr_prefixes) { + ogs_free(sm_policy_update_context_data->add_rel_ipv6_addr_prefixes); + sm_policy_update_context_data->add_rel_ipv6_addr_prefixes = NULL; + } + if (sm_policy_update_context_data->rel_ue_mac) { + ogs_free(sm_policy_update_context_data->rel_ue_mac); + sm_policy_update_context_data->rel_ue_mac = NULL; + } + if (sm_policy_update_context_data->ue_mac) { + ogs_free(sm_policy_update_context_data->ue_mac); + sm_policy_update_context_data->ue_mac = NULL; + } + if (sm_policy_update_context_data->subs_sess_ambr) { + OpenAPI_ambr_free(sm_policy_update_context_data->subs_sess_ambr); + sm_policy_update_context_data->subs_sess_ambr = NULL; + } + if (sm_policy_update_context_data->auth_prof_index) { + ogs_free(sm_policy_update_context_data->auth_prof_index); + sm_policy_update_context_data->auth_prof_index = NULL; + } + if (sm_policy_update_context_data->subs_def_qos) { + OpenAPI_subscribed_default_qos_free(sm_policy_update_context_data->subs_def_qos); + sm_policy_update_context_data->subs_def_qos = NULL; + } + if (sm_policy_update_context_data->vplmn_qos) { + OpenAPI_vplmn_qos_free(sm_policy_update_context_data->vplmn_qos); + sm_policy_update_context_data->vplmn_qos = NULL; + } + if (sm_policy_update_context_data->accu_usage_reports) { + OpenAPI_list_for_each(sm_policy_update_context_data->accu_usage_reports, node) { + OpenAPI_accu_usage_report_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->accu_usage_reports); + sm_policy_update_context_data->accu_usage_reports = NULL; + } + if (sm_policy_update_context_data->app_detection_infos) { + OpenAPI_list_for_each(sm_policy_update_context_data->app_detection_infos, node) { + OpenAPI_app_detection_info_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->app_detection_infos); + sm_policy_update_context_data->app_detection_infos = NULL; + } + if (sm_policy_update_context_data->rule_reports) { + OpenAPI_list_for_each(sm_policy_update_context_data->rule_reports, node) { + OpenAPI_rule_report_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->rule_reports); + sm_policy_update_context_data->rule_reports = NULL; + } + if (sm_policy_update_context_data->sess_rule_reports) { + OpenAPI_list_for_each(sm_policy_update_context_data->sess_rule_reports, node) { + OpenAPI_session_rule_report_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->sess_rule_reports); + sm_policy_update_context_data->sess_rule_reports = NULL; + } + if (sm_policy_update_context_data->qnc_reports) { + OpenAPI_list_for_each(sm_policy_update_context_data->qnc_reports, node) { + OpenAPI_qos_notification_control_info_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->qnc_reports); + sm_policy_update_context_data->qnc_reports = NULL; + } + if (sm_policy_update_context_data->qos_mon_reports) { + OpenAPI_list_for_each(sm_policy_update_context_data->qos_mon_reports, node) { + OpenAPI_qos_monitoring_report_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->qos_mon_reports); + sm_policy_update_context_data->qos_mon_reports = NULL; + } + if (sm_policy_update_context_data->user_location_info_time) { + ogs_free(sm_policy_update_context_data->user_location_info_time); + sm_policy_update_context_data->user_location_info_time = NULL; + } + if (sm_policy_update_context_data->rep_pra_infos) { + OpenAPI_list_for_each(sm_policy_update_context_data->rep_pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(sm_policy_update_context_data->rep_pra_infos); + sm_policy_update_context_data->rep_pra_infos = NULL; + } + if (sm_policy_update_context_data->ue_init_res_req) { + OpenAPI_ue_initiated_resource_request_free(sm_policy_update_context_data->ue_init_res_req); + sm_policy_update_context_data->ue_init_res_req = NULL; + } + if (sm_policy_update_context_data->serv_nf_id) { + OpenAPI_serving_nf_identity_free(sm_policy_update_context_data->serv_nf_id); + sm_policy_update_context_data->serv_nf_id = NULL; + } + if (sm_policy_update_context_data->trace_req) { + OpenAPI_trace_data_free(sm_policy_update_context_data->trace_req); + sm_policy_update_context_data->trace_req = NULL; + } + if (sm_policy_update_context_data->atsss_capab) { + OpenAPI_atsss_capability_free(sm_policy_update_context_data->atsss_capab); + sm_policy_update_context_data->atsss_capab = NULL; + } + if (sm_policy_update_context_data->tsn_bridge_info) { + OpenAPI_tsn_bridge_info_free(sm_policy_update_context_data->tsn_bridge_info); + sm_policy_update_context_data->tsn_bridge_info = NULL; + } + if (sm_policy_update_context_data->tsn_bridge_man_cont) { + OpenAPI_bridge_management_container_free(sm_policy_update_context_data->tsn_bridge_man_cont); + sm_policy_update_context_data->tsn_bridge_man_cont = NULL; + } + if (sm_policy_update_context_data->tsn_port_man_cont_dstt) { + OpenAPI_port_management_container_free(sm_policy_update_context_data->tsn_port_man_cont_dstt); + sm_policy_update_context_data->tsn_port_man_cont_dstt = NULL; + } + if (sm_policy_update_context_data->tsn_port_man_cont_nwtts) { + OpenAPI_list_for_each(sm_policy_update_context_data->tsn_port_man_cont_nwtts, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->tsn_port_man_cont_nwtts); + sm_policy_update_context_data->tsn_port_man_cont_nwtts = NULL; + } + if (sm_policy_update_context_data->mul_addr_infos) { + OpenAPI_list_for_each(sm_policy_update_context_data->mul_addr_infos, node) { + OpenAPI_ip_multicast_address_info_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->mul_addr_infos); + sm_policy_update_context_data->mul_addr_infos = NULL; + } + if (sm_policy_update_context_data->policy_dec_failure_reports) { + OpenAPI_list_free(sm_policy_update_context_data->policy_dec_failure_reports); + sm_policy_update_context_data->policy_dec_failure_reports = NULL; + } + if (sm_policy_update_context_data->traffic_descriptors) { + OpenAPI_list_for_each(sm_policy_update_context_data->traffic_descriptors, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->traffic_descriptors); + sm_policy_update_context_data->traffic_descriptors = NULL; + } + if (sm_policy_update_context_data->pcc_rule_id) { + ogs_free(sm_policy_update_context_data->pcc_rule_id); + sm_policy_update_context_data->pcc_rule_id = NULL; + } + if (sm_policy_update_context_data->inter_grp_ids) { + OpenAPI_list_for_each(sm_policy_update_context_data->inter_grp_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sm_policy_update_context_data->inter_grp_ids); + sm_policy_update_context_data->inter_grp_ids = NULL; + } + if (sm_policy_update_context_data->types_of_notif) { + OpenAPI_list_free(sm_policy_update_context_data->types_of_notif); + sm_policy_update_context_data->types_of_notif = NULL; } - OpenAPI_list_free(sm_policy_update_context_data->inter_grp_ids); - OpenAPI_list_free(sm_policy_update_context_data->types_of_notif); ogs_free(sm_policy_update_context_data); } cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_update_context_data_t *sm_policy_update_context_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sm_policy_update_context_data == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [SmPolicyUpdateContextData]"); @@ -220,15 +348,14 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd } item = cJSON_CreateObject(); - if (sm_policy_update_context_data->rep_policy_ctrl_req_triggers) { - cJSON *rep_policy_ctrl_req_triggers = cJSON_AddArrayToObject(item, "repPolicyCtrlReqTriggers"); - if (rep_policy_ctrl_req_triggers == NULL) { + if (sm_policy_update_context_data->rep_policy_ctrl_req_triggers != OpenAPI_policy_control_request_trigger_NULL) { + cJSON *rep_policy_ctrl_req_triggersList = cJSON_AddArrayToObject(item, "repPolicyCtrlReqTriggers"); + if (rep_policy_ctrl_req_triggersList == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rep_policy_ctrl_req_triggers]"); goto end; } - OpenAPI_lnode_t *rep_policy_ctrl_req_triggers_node; - OpenAPI_list_for_each(sm_policy_update_context_data->rep_policy_ctrl_req_triggers, rep_policy_ctrl_req_triggers_node) { - if (cJSON_AddStringToObject(rep_policy_ctrl_req_triggers, "", OpenAPI_policy_control_request_trigger_ToString((intptr_t)rep_policy_ctrl_req_triggers_node->data)) == NULL) { + OpenAPI_list_for_each(sm_policy_update_context_data->rep_policy_ctrl_req_triggers, node) { + if (cJSON_AddStringToObject(rep_policy_ctrl_req_triggersList, "", OpenAPI_policy_control_request_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rep_policy_ctrl_req_triggers]"); goto end; } @@ -241,28 +368,24 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [acc_net_ch_ids]"); goto end; } - - OpenAPI_lnode_t *acc_net_ch_ids_node; - if (sm_policy_update_context_data->acc_net_ch_ids) { - OpenAPI_list_for_each(sm_policy_update_context_data->acc_net_ch_ids, acc_net_ch_ids_node) { - cJSON *itemLocal = OpenAPI_acc_net_ch_id_convertToJSON(acc_net_ch_ids_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [acc_net_ch_ids]"); - goto end; - } - cJSON_AddItemToArray(acc_net_ch_idsList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->acc_net_ch_ids, node) { + cJSON *itemLocal = OpenAPI_acc_net_ch_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [acc_net_ch_ids]"); + goto end; } + cJSON_AddItemToArray(acc_net_ch_idsList, itemLocal); } } - if (sm_policy_update_context_data->access_type) { + if (sm_policy_update_context_data->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(sm_policy_update_context_data->access_type)) == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [access_type]"); goto end; } } - if (sm_policy_update_context_data->rat_type) { + if (sm_policy_update_context_data->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(sm_policy_update_context_data->rat_type)) == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rat_type]"); goto end; @@ -450,17 +573,13 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [accu_usage_reports]"); goto end; } - - OpenAPI_lnode_t *accu_usage_reports_node; - if (sm_policy_update_context_data->accu_usage_reports) { - OpenAPI_list_for_each(sm_policy_update_context_data->accu_usage_reports, accu_usage_reports_node) { - cJSON *itemLocal = OpenAPI_accu_usage_report_convertToJSON(accu_usage_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [accu_usage_reports]"); - goto end; - } - cJSON_AddItemToArray(accu_usage_reportsList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->accu_usage_reports, node) { + cJSON *itemLocal = OpenAPI_accu_usage_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [accu_usage_reports]"); + goto end; } + cJSON_AddItemToArray(accu_usage_reportsList, itemLocal); } } @@ -477,17 +596,13 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [app_detection_infos]"); goto end; } - - OpenAPI_lnode_t *app_detection_infos_node; - if (sm_policy_update_context_data->app_detection_infos) { - OpenAPI_list_for_each(sm_policy_update_context_data->app_detection_infos, app_detection_infos_node) { - cJSON *itemLocal = OpenAPI_app_detection_info_convertToJSON(app_detection_infos_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [app_detection_infos]"); - goto end; - } - cJSON_AddItemToArray(app_detection_infosList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->app_detection_infos, node) { + cJSON *itemLocal = OpenAPI_app_detection_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [app_detection_infos]"); + goto end; } + cJSON_AddItemToArray(app_detection_infosList, itemLocal); } } @@ -497,17 +612,13 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rule_reports]"); goto end; } - - OpenAPI_lnode_t *rule_reports_node; - if (sm_policy_update_context_data->rule_reports) { - OpenAPI_list_for_each(sm_policy_update_context_data->rule_reports, rule_reports_node) { - cJSON *itemLocal = OpenAPI_rule_report_convertToJSON(rule_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rule_reports]"); - goto end; - } - cJSON_AddItemToArray(rule_reportsList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->rule_reports, node) { + cJSON *itemLocal = OpenAPI_rule_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rule_reports]"); + goto end; } + cJSON_AddItemToArray(rule_reportsList, itemLocal); } } @@ -517,17 +628,13 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [sess_rule_reports]"); goto end; } - - OpenAPI_lnode_t *sess_rule_reports_node; - if (sm_policy_update_context_data->sess_rule_reports) { - OpenAPI_list_for_each(sm_policy_update_context_data->sess_rule_reports, sess_rule_reports_node) { - cJSON *itemLocal = OpenAPI_session_rule_report_convertToJSON(sess_rule_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [sess_rule_reports]"); - goto end; - } - cJSON_AddItemToArray(sess_rule_reportsList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->sess_rule_reports, node) { + cJSON *itemLocal = OpenAPI_session_rule_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [sess_rule_reports]"); + goto end; } + cJSON_AddItemToArray(sess_rule_reportsList, itemLocal); } } @@ -537,17 +644,13 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qnc_reports]"); goto end; } - - OpenAPI_lnode_t *qnc_reports_node; - if (sm_policy_update_context_data->qnc_reports) { - OpenAPI_list_for_each(sm_policy_update_context_data->qnc_reports, qnc_reports_node) { - cJSON *itemLocal = OpenAPI_qos_notification_control_info_convertToJSON(qnc_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qnc_reports]"); - goto end; - } - cJSON_AddItemToArray(qnc_reportsList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->qnc_reports, node) { + cJSON *itemLocal = OpenAPI_qos_notification_control_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qnc_reports]"); + goto end; } + cJSON_AddItemToArray(qnc_reportsList, itemLocal); } } @@ -557,17 +660,13 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qos_mon_reports]"); goto end; } - - OpenAPI_lnode_t *qos_mon_reports_node; - if (sm_policy_update_context_data->qos_mon_reports) { - OpenAPI_list_for_each(sm_policy_update_context_data->qos_mon_reports, qos_mon_reports_node) { - cJSON *itemLocal = OpenAPI_qos_monitoring_report_convertToJSON(qos_mon_reports_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qos_mon_reports]"); - goto end; - } - cJSON_AddItemToArray(qos_mon_reportsList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->qos_mon_reports, node) { + cJSON *itemLocal = OpenAPI_qos_monitoring_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qos_mon_reports]"); + goto end; } + cJSON_AddItemToArray(qos_mon_reportsList, itemLocal); } } @@ -585,21 +684,20 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd goto end; } cJSON *localMapObject = rep_pra_infos; - OpenAPI_lnode_t *rep_pra_infos_node; if (sm_policy_update_context_data->rep_pra_infos) { - OpenAPI_list_for_each(sm_policy_update_context_data->rep_pra_infos, rep_pra_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)rep_pra_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->rep_pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (sm_policy_update_context_data->ue_init_res_req) { cJSON *ue_init_res_req_local_JSON = OpenAPI_ue_initiated_resource_request_convertToJSON(sm_policy_update_context_data->ue_init_res_req); @@ -621,14 +719,14 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd } } - if (sm_policy_update_context_data->qos_flow_usage) { + if (sm_policy_update_context_data->qos_flow_usage != OpenAPI_qos_flow_usage_NULL) { if (cJSON_AddStringToObject(item, "qosFlowUsage", OpenAPI_qos_flow_usage_ToString(sm_policy_update_context_data->qos_flow_usage)) == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qos_flow_usage]"); goto end; } } - if (sm_policy_update_context_data->credit_manage_status) { + if (sm_policy_update_context_data->credit_manage_status != OpenAPI_credit_management_status_NULL) { if (cJSON_AddStringToObject(item, "creditManageStatus", OpenAPI_credit_management_status_ToString(sm_policy_update_context_data->credit_manage_status)) == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [credit_manage_status]"); goto end; @@ -661,7 +759,7 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd } } - if (sm_policy_update_context_data->ma_pdu_ind) { + if (sm_policy_update_context_data->ma_pdu_ind != OpenAPI_ma_pdu_indication_NULL) { if (cJSON_AddStringToObject(item, "maPduInd", OpenAPI_ma_pdu_indication_ToString(sm_policy_update_context_data->ma_pdu_ind)) == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [ma_pdu_ind]"); goto end; @@ -726,17 +824,13 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - - OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node; - if (sm_policy_update_context_data->tsn_port_man_cont_nwtts) { - OpenAPI_list_for_each(sm_policy_update_context_data->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) { - cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->tsn_port_man_cont_nwtts, node) { + cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; } + cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal); } } @@ -746,29 +840,24 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [mul_addr_infos]"); goto end; } - - OpenAPI_lnode_t *mul_addr_infos_node; - if (sm_policy_update_context_data->mul_addr_infos) { - OpenAPI_list_for_each(sm_policy_update_context_data->mul_addr_infos, mul_addr_infos_node) { - cJSON *itemLocal = OpenAPI_ip_multicast_address_info_convertToJSON(mul_addr_infos_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [mul_addr_infos]"); - goto end; - } - cJSON_AddItemToArray(mul_addr_infosList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->mul_addr_infos, node) { + cJSON *itemLocal = OpenAPI_ip_multicast_address_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [mul_addr_infos]"); + goto end; } + cJSON_AddItemToArray(mul_addr_infosList, itemLocal); } } - if (sm_policy_update_context_data->policy_dec_failure_reports) { - cJSON *policy_dec_failure_reports = cJSON_AddArrayToObject(item, "policyDecFailureReports"); - if (policy_dec_failure_reports == NULL) { + if (sm_policy_update_context_data->policy_dec_failure_reports != OpenAPI_policy_decision_failure_code_NULL) { + cJSON *policy_dec_failure_reportsList = cJSON_AddArrayToObject(item, "policyDecFailureReports"); + if (policy_dec_failure_reportsList == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [policy_dec_failure_reports]"); goto end; } - OpenAPI_lnode_t *policy_dec_failure_reports_node; - OpenAPI_list_for_each(sm_policy_update_context_data->policy_dec_failure_reports, policy_dec_failure_reports_node) { - if (cJSON_AddStringToObject(policy_dec_failure_reports, "", OpenAPI_policy_decision_failure_code_ToString((intptr_t)policy_dec_failure_reports_node->data)) == NULL) { + OpenAPI_list_for_each(sm_policy_update_context_data->policy_dec_failure_reports, node) { + if (cJSON_AddStringToObject(policy_dec_failure_reportsList, "", OpenAPI_policy_decision_failure_code_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [policy_dec_failure_reports]"); goto end; } @@ -781,17 +870,13 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [traffic_descriptors]"); goto end; } - - OpenAPI_lnode_t *traffic_descriptors_node; - if (sm_policy_update_context_data->traffic_descriptors) { - OpenAPI_list_for_each(sm_policy_update_context_data->traffic_descriptors, traffic_descriptors_node) { - cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(traffic_descriptors_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [traffic_descriptors]"); - goto end; - } - cJSON_AddItemToArray(traffic_descriptorsList, itemLocal); + OpenAPI_list_for_each(sm_policy_update_context_data->traffic_descriptors, node) { + cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [traffic_descriptors]"); + goto end; } + cJSON_AddItemToArray(traffic_descriptorsList, itemLocal); } } @@ -803,30 +888,27 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd } if (sm_policy_update_context_data->inter_grp_ids) { - cJSON *inter_grp_ids = cJSON_AddArrayToObject(item, "interGrpIds"); - if (inter_grp_ids == NULL) { + cJSON *inter_grp_idsList = cJSON_AddArrayToObject(item, "interGrpIds"); + if (inter_grp_idsList == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [inter_grp_ids]"); goto end; } - - OpenAPI_lnode_t *inter_grp_ids_node; - OpenAPI_list_for_each(sm_policy_update_context_data->inter_grp_ids, inter_grp_ids_node) { - if (cJSON_AddStringToObject(inter_grp_ids, "", (char*)inter_grp_ids_node->data) == NULL) { - ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [inter_grp_ids]"); - goto end; + OpenAPI_list_for_each(sm_policy_update_context_data->inter_grp_ids, node) { + if (cJSON_AddStringToObject(inter_grp_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [inter_grp_ids]"); + goto end; + } } - } } - if (sm_policy_update_context_data->types_of_notif) { - cJSON *types_of_notif = cJSON_AddArrayToObject(item, "typesOfNotif"); - if (types_of_notif == NULL) { + if (sm_policy_update_context_data->types_of_notif != OpenAPI_dl_data_delivery_status_NULL) { + cJSON *types_of_notifList = cJSON_AddArrayToObject(item, "typesOfNotif"); + if (types_of_notifList == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [types_of_notif]"); goto end; } - OpenAPI_lnode_t *types_of_notif_node; - OpenAPI_list_for_each(sm_policy_update_context_data->types_of_notif, types_of_notif_node) { - if (cJSON_AddStringToObject(types_of_notif, "", OpenAPI_dl_data_delivery_status_ToString((intptr_t)types_of_notif_node->data)) == NULL) { + OpenAPI_list_for_each(sm_policy_update_context_data->types_of_notif, node) { + if (cJSON_AddStringToObject(types_of_notifList, "", OpenAPI_dl_data_delivery_status_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [types_of_notif]"); goto end; } @@ -840,60 +922,136 @@ end: OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_parseFromJSON(cJSON *sm_policy_update_context_dataJSON) { OpenAPI_sm_policy_update_context_data_t *sm_policy_update_context_data_local_var = NULL; - cJSON *rep_policy_ctrl_req_triggers = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "repPolicyCtrlReqTriggers"); - - OpenAPI_list_t *rep_policy_ctrl_req_triggersList; + OpenAPI_lnode_t *node = NULL; + cJSON *rep_policy_ctrl_req_triggers = NULL; + OpenAPI_list_t *rep_policy_ctrl_req_triggersList = NULL; + cJSON *acc_net_ch_ids = NULL; + OpenAPI_list_t *acc_net_ch_idsList = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *add_access_info = NULL; + OpenAPI_additional_access_info_t *add_access_info_local_nonprim = NULL; + cJSON *rel_access_info = NULL; + OpenAPI_additional_access_info_t *rel_access_info_local_nonprim = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + cJSON *user_location_info = NULL; + OpenAPI_user_location_t *user_location_info_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *rel_ipv4_address = NULL; + cJSON *ipv4_address = NULL; + cJSON *ip_domain = NULL; + cJSON *ipv6_address_prefix = NULL; + cJSON *rel_ipv6_address_prefix = NULL; + cJSON *add_ipv6_addr_prefixes = NULL; + cJSON *add_rel_ipv6_addr_prefixes = NULL; + cJSON *rel_ue_mac = NULL; + cJSON *ue_mac = NULL; + cJSON *subs_sess_ambr = NULL; + OpenAPI_ambr_t *subs_sess_ambr_local_nonprim = NULL; + cJSON *auth_prof_index = NULL; + cJSON *subs_def_qos = NULL; + OpenAPI_subscribed_default_qos_t *subs_def_qos_local_nonprim = NULL; + cJSON *vplmn_qos = NULL; + OpenAPI_vplmn_qos_t *vplmn_qos_local_nonprim = NULL; + cJSON *num_of_pack_filter = NULL; + cJSON *accu_usage_reports = NULL; + OpenAPI_list_t *accu_usage_reportsList = NULL; + cJSON *_3gpp_ps_data_off_status = NULL; + cJSON *app_detection_infos = NULL; + OpenAPI_list_t *app_detection_infosList = NULL; + cJSON *rule_reports = NULL; + OpenAPI_list_t *rule_reportsList = NULL; + cJSON *sess_rule_reports = NULL; + OpenAPI_list_t *sess_rule_reportsList = NULL; + cJSON *qnc_reports = NULL; + OpenAPI_list_t *qnc_reportsList = NULL; + cJSON *qos_mon_reports = NULL; + OpenAPI_list_t *qos_mon_reportsList = NULL; + cJSON *user_location_info_time = NULL; + cJSON *rep_pra_infos = NULL; + OpenAPI_list_t *rep_pra_infosList = NULL; + cJSON *ue_init_res_req = NULL; + OpenAPI_ue_initiated_resource_request_t *ue_init_res_req_local_nonprim = NULL; + cJSON *ref_qos_indication = NULL; + cJSON *qos_flow_usage = NULL; + OpenAPI_qos_flow_usage_e qos_flow_usageVariable = 0; + cJSON *credit_manage_status = NULL; + OpenAPI_credit_management_status_e credit_manage_statusVariable = 0; + cJSON *serv_nf_id = NULL; + OpenAPI_serving_nf_identity_t *serv_nf_id_local_nonprim = NULL; + cJSON *trace_req = NULL; + OpenAPI_trace_data_t *trace_req_local_nonprim = NULL; + cJSON *ma_pdu_ind = NULL; + OpenAPI_ma_pdu_indication_e ma_pdu_indVariable = 0; + cJSON *atsss_capab = NULL; + OpenAPI_atsss_capability_t *atsss_capab_local_nonprim = NULL; + cJSON *tsn_bridge_info = NULL; + OpenAPI_tsn_bridge_info_t *tsn_bridge_info_local_nonprim = NULL; + cJSON *tsn_bridge_man_cont = NULL; + OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + cJSON *tsn_port_man_cont_dstt = NULL; + OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + cJSON *tsn_port_man_cont_nwtts = NULL; + OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL; + cJSON *mul_addr_infos = NULL; + OpenAPI_list_t *mul_addr_infosList = NULL; + cJSON *policy_dec_failure_reports = NULL; + OpenAPI_list_t *policy_dec_failure_reportsList = NULL; + cJSON *traffic_descriptors = NULL; + OpenAPI_list_t *traffic_descriptorsList = NULL; + cJSON *pcc_rule_id = NULL; + cJSON *inter_grp_ids = NULL; + OpenAPI_list_t *inter_grp_idsList = NULL; + cJSON *types_of_notif = NULL; + OpenAPI_list_t *types_of_notifList = NULL; + rep_policy_ctrl_req_triggers = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "repPolicyCtrlReqTriggers"); if (rep_policy_ctrl_req_triggers) { - cJSON *rep_policy_ctrl_req_triggers_local_nonprimitive; - if (!cJSON_IsArray(rep_policy_ctrl_req_triggers)) { - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rep_policy_ctrl_req_triggers]"); - goto end; - } - - rep_policy_ctrl_req_triggersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rep_policy_ctrl_req_triggers_local_nonprimitive, rep_policy_ctrl_req_triggers ) { - if (!cJSON_IsString(rep_policy_ctrl_req_triggers_local_nonprimitive)){ + cJSON *rep_policy_ctrl_req_triggers_local = NULL; + if (!cJSON_IsArray(rep_policy_ctrl_req_triggers)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rep_policy_ctrl_req_triggers]"); goto end; } - OpenAPI_list_add(rep_policy_ctrl_req_triggersList, (void *)OpenAPI_policy_control_request_trigger_FromString(rep_policy_ctrl_req_triggers_local_nonprimitive->valuestring)); - } + rep_policy_ctrl_req_triggersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rep_policy_ctrl_req_triggers_local, rep_policy_ctrl_req_triggers) { + if (!cJSON_IsString(rep_policy_ctrl_req_triggers_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rep_policy_ctrl_req_triggers]"); + goto end; + } + OpenAPI_list_add(rep_policy_ctrl_req_triggersList, (void *)OpenAPI_policy_control_request_trigger_FromString(rep_policy_ctrl_req_triggers_local->valuestring)); + } } - cJSON *acc_net_ch_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "accNetChIds"); - - OpenAPI_list_t *acc_net_ch_idsList; + acc_net_ch_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "accNetChIds"); if (acc_net_ch_ids) { - cJSON *acc_net_ch_ids_local_nonprimitive; - if (!cJSON_IsArray(acc_net_ch_ids)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [acc_net_ch_ids]"); - goto end; - } - - acc_net_ch_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(acc_net_ch_ids_local_nonprimitive, acc_net_ch_ids ) { - if (!cJSON_IsObject(acc_net_ch_ids_local_nonprimitive)) { + cJSON *acc_net_ch_ids_local = NULL; + if (!cJSON_IsArray(acc_net_ch_ids)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [acc_net_ch_ids]"); goto end; } - OpenAPI_acc_net_ch_id_t *acc_net_ch_idsItem = OpenAPI_acc_net_ch_id_parseFromJSON(acc_net_ch_ids_local_nonprimitive); - if (!acc_net_ch_idsItem) { - ogs_error("No acc_net_ch_idsItem"); - OpenAPI_list_free(acc_net_ch_idsList); - goto end; + acc_net_ch_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(acc_net_ch_ids_local, acc_net_ch_ids) { + if (!cJSON_IsObject(acc_net_ch_ids_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [acc_net_ch_ids]"); + goto end; + } + OpenAPI_acc_net_ch_id_t *acc_net_ch_idsItem = OpenAPI_acc_net_ch_id_parseFromJSON(acc_net_ch_ids_local); + if (!acc_net_ch_idsItem) { + ogs_error("No acc_net_ch_idsItem"); + OpenAPI_list_free(acc_net_ch_idsList); + goto end; + } + OpenAPI_list_add(acc_net_ch_idsList, acc_net_ch_idsItem); } - - OpenAPI_list_add(acc_net_ch_idsList, acc_net_ch_idsItem); - } } - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + access_type = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [access_type]"); @@ -902,9 +1060,7 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rat_type]"); @@ -913,156 +1069,130 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *add_access_info = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "addAccessInfo"); - - OpenAPI_additional_access_info_t *add_access_info_local_nonprim = NULL; + add_access_info = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "addAccessInfo"); if (add_access_info) { add_access_info_local_nonprim = OpenAPI_additional_access_info_parseFromJSON(add_access_info); } - cJSON *rel_access_info = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "relAccessInfo"); - - OpenAPI_additional_access_info_t *rel_access_info_local_nonprim = NULL; + rel_access_info = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "relAccessInfo"); if (rel_access_info) { rel_access_info_local_nonprim = OpenAPI_additional_access_info_parseFromJSON(rel_access_info); } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "servingNetwork"); - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + serving_network = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "servingNetwork"); if (serving_network) { serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); } - cJSON *user_location_info = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "userLocationInfo"); - - OpenAPI_user_location_t *user_location_info_local_nonprim = NULL; + user_location_info = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "userLocationInfo"); if (user_location_info) { user_location_info_local_nonprim = OpenAPI_user_location_parseFromJSON(user_location_info); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *rel_ipv4_address = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "relIpv4Address"); - + rel_ipv4_address = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "relIpv4Address"); if (rel_ipv4_address) { - if (!cJSON_IsString(rel_ipv4_address)) { + if (!cJSON_IsString(rel_ipv4_address) && !cJSON_IsNull(rel_ipv4_address)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rel_ipv4_address]"); goto end; } } - cJSON *ipv4_address = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ipv4Address"); - + ipv4_address = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ipv4Address"); if (ipv4_address) { - if (!cJSON_IsString(ipv4_address)) { + if (!cJSON_IsString(ipv4_address) && !cJSON_IsNull(ipv4_address)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [ipv4_address]"); goto end; } } - cJSON *ip_domain = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ipDomain"); - + ip_domain = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ipDomain"); if (ip_domain) { - if (!cJSON_IsString(ip_domain)) { + if (!cJSON_IsString(ip_domain) && !cJSON_IsNull(ip_domain)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [ip_domain]"); goto end; } } - cJSON *ipv6_address_prefix = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ipv6AddressPrefix"); - + ipv6_address_prefix = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ipv6AddressPrefix"); if (ipv6_address_prefix) { - if (!cJSON_IsString(ipv6_address_prefix)) { + if (!cJSON_IsString(ipv6_address_prefix) && !cJSON_IsNull(ipv6_address_prefix)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [ipv6_address_prefix]"); goto end; } } - cJSON *rel_ipv6_address_prefix = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "relIpv6AddressPrefix"); - + rel_ipv6_address_prefix = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "relIpv6AddressPrefix"); if (rel_ipv6_address_prefix) { - if (!cJSON_IsString(rel_ipv6_address_prefix)) { + if (!cJSON_IsString(rel_ipv6_address_prefix) && !cJSON_IsNull(rel_ipv6_address_prefix)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rel_ipv6_address_prefix]"); goto end; } } - cJSON *add_ipv6_addr_prefixes = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "addIpv6AddrPrefixes"); - + add_ipv6_addr_prefixes = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "addIpv6AddrPrefixes"); if (add_ipv6_addr_prefixes) { - if (!cJSON_IsString(add_ipv6_addr_prefixes)) { + if (!cJSON_IsString(add_ipv6_addr_prefixes) && !cJSON_IsNull(add_ipv6_addr_prefixes)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [add_ipv6_addr_prefixes]"); goto end; } } - cJSON *add_rel_ipv6_addr_prefixes = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "addRelIpv6AddrPrefixes"); - + add_rel_ipv6_addr_prefixes = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "addRelIpv6AddrPrefixes"); if (add_rel_ipv6_addr_prefixes) { - if (!cJSON_IsString(add_rel_ipv6_addr_prefixes)) { + if (!cJSON_IsString(add_rel_ipv6_addr_prefixes) && !cJSON_IsNull(add_rel_ipv6_addr_prefixes)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [add_rel_ipv6_addr_prefixes]"); goto end; } } - cJSON *rel_ue_mac = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "relUeMac"); - + rel_ue_mac = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "relUeMac"); if (rel_ue_mac) { - if (!cJSON_IsString(rel_ue_mac)) { + if (!cJSON_IsString(rel_ue_mac) && !cJSON_IsNull(rel_ue_mac)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rel_ue_mac]"); goto end; } } - cJSON *ue_mac = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ueMac"); - + ue_mac = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ueMac"); if (ue_mac) { - if (!cJSON_IsString(ue_mac)) { + if (!cJSON_IsString(ue_mac) && !cJSON_IsNull(ue_mac)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [ue_mac]"); goto end; } } - cJSON *subs_sess_ambr = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "subsSessAmbr"); - - OpenAPI_ambr_t *subs_sess_ambr_local_nonprim = NULL; + subs_sess_ambr = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "subsSessAmbr"); if (subs_sess_ambr) { subs_sess_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(subs_sess_ambr); } - cJSON *auth_prof_index = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "authProfIndex"); - + auth_prof_index = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "authProfIndex"); if (auth_prof_index) { - if (!cJSON_IsString(auth_prof_index)) { + if (!cJSON_IsString(auth_prof_index) && !cJSON_IsNull(auth_prof_index)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [auth_prof_index]"); goto end; } } - cJSON *subs_def_qos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "subsDefQos"); - - OpenAPI_subscribed_default_qos_t *subs_def_qos_local_nonprim = NULL; + subs_def_qos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "subsDefQos"); if (subs_def_qos) { subs_def_qos_local_nonprim = OpenAPI_subscribed_default_qos_parseFromJSON(subs_def_qos); } - cJSON *vplmn_qos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "vplmnQos"); - - OpenAPI_vplmn_qos_t *vplmn_qos_local_nonprim = NULL; + vplmn_qos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "vplmnQos"); if (vplmn_qos) { vplmn_qos_local_nonprim = OpenAPI_vplmn_qos_parseFromJSON(vplmn_qos); } - cJSON *num_of_pack_filter = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "numOfPackFilter"); - + num_of_pack_filter = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "numOfPackFilter"); if (num_of_pack_filter) { if (!cJSON_IsNumber(num_of_pack_filter)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [num_of_pack_filter]"); @@ -1070,37 +1200,32 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p } } - cJSON *accu_usage_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "accuUsageReports"); - - OpenAPI_list_t *accu_usage_reportsList; + accu_usage_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "accuUsageReports"); if (accu_usage_reports) { - cJSON *accu_usage_reports_local_nonprimitive; - if (!cJSON_IsArray(accu_usage_reports)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [accu_usage_reports]"); - goto end; - } - - accu_usage_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(accu_usage_reports_local_nonprimitive, accu_usage_reports ) { - if (!cJSON_IsObject(accu_usage_reports_local_nonprimitive)) { + cJSON *accu_usage_reports_local = NULL; + if (!cJSON_IsArray(accu_usage_reports)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [accu_usage_reports]"); goto end; } - OpenAPI_accu_usage_report_t *accu_usage_reportsItem = OpenAPI_accu_usage_report_parseFromJSON(accu_usage_reports_local_nonprimitive); - if (!accu_usage_reportsItem) { - ogs_error("No accu_usage_reportsItem"); - OpenAPI_list_free(accu_usage_reportsList); - goto end; + accu_usage_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(accu_usage_reports_local, accu_usage_reports) { + if (!cJSON_IsObject(accu_usage_reports_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [accu_usage_reports]"); + goto end; + } + OpenAPI_accu_usage_report_t *accu_usage_reportsItem = OpenAPI_accu_usage_report_parseFromJSON(accu_usage_reports_local); + if (!accu_usage_reportsItem) { + ogs_error("No accu_usage_reportsItem"); + OpenAPI_list_free(accu_usage_reportsList); + goto end; + } + OpenAPI_list_add(accu_usage_reportsList, accu_usage_reportsItem); } - - OpenAPI_list_add(accu_usage_reportsList, accu_usage_reportsItem); - } } - cJSON *_3gpp_ps_data_off_status = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "3gppPsDataOffStatus"); - + _3gpp_ps_data_off_status = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "3gppPsDataOffStatus"); if (_3gpp_ps_data_off_status) { if (!cJSON_IsBool(_3gpp_ps_data_off_status)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [_3gpp_ps_data_off_status]"); @@ -1108,195 +1233,171 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p } } - cJSON *app_detection_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "appDetectionInfos"); - - OpenAPI_list_t *app_detection_infosList; + app_detection_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "appDetectionInfos"); if (app_detection_infos) { - cJSON *app_detection_infos_local_nonprimitive; - if (!cJSON_IsArray(app_detection_infos)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [app_detection_infos]"); - goto end; - } - - app_detection_infosList = OpenAPI_list_create(); - - cJSON_ArrayForEach(app_detection_infos_local_nonprimitive, app_detection_infos ) { - if (!cJSON_IsObject(app_detection_infos_local_nonprimitive)) { + cJSON *app_detection_infos_local = NULL; + if (!cJSON_IsArray(app_detection_infos)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [app_detection_infos]"); goto end; } - OpenAPI_app_detection_info_t *app_detection_infosItem = OpenAPI_app_detection_info_parseFromJSON(app_detection_infos_local_nonprimitive); - if (!app_detection_infosItem) { - ogs_error("No app_detection_infosItem"); - OpenAPI_list_free(app_detection_infosList); - goto end; + app_detection_infosList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_detection_infos_local, app_detection_infos) { + if (!cJSON_IsObject(app_detection_infos_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [app_detection_infos]"); + goto end; + } + OpenAPI_app_detection_info_t *app_detection_infosItem = OpenAPI_app_detection_info_parseFromJSON(app_detection_infos_local); + if (!app_detection_infosItem) { + ogs_error("No app_detection_infosItem"); + OpenAPI_list_free(app_detection_infosList); + goto end; + } + OpenAPI_list_add(app_detection_infosList, app_detection_infosItem); } - - OpenAPI_list_add(app_detection_infosList, app_detection_infosItem); - } } - cJSON *rule_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ruleReports"); - - OpenAPI_list_t *rule_reportsList; + rule_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ruleReports"); if (rule_reports) { - cJSON *rule_reports_local_nonprimitive; - if (!cJSON_IsArray(rule_reports)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rule_reports]"); - goto end; - } - - rule_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(rule_reports_local_nonprimitive, rule_reports ) { - if (!cJSON_IsObject(rule_reports_local_nonprimitive)) { + cJSON *rule_reports_local = NULL; + if (!cJSON_IsArray(rule_reports)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rule_reports]"); goto end; } - OpenAPI_rule_report_t *rule_reportsItem = OpenAPI_rule_report_parseFromJSON(rule_reports_local_nonprimitive); - if (!rule_reportsItem) { - ogs_error("No rule_reportsItem"); - OpenAPI_list_free(rule_reportsList); - goto end; + rule_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(rule_reports_local, rule_reports) { + if (!cJSON_IsObject(rule_reports_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rule_reports]"); + goto end; + } + OpenAPI_rule_report_t *rule_reportsItem = OpenAPI_rule_report_parseFromJSON(rule_reports_local); + if (!rule_reportsItem) { + ogs_error("No rule_reportsItem"); + OpenAPI_list_free(rule_reportsList); + goto end; + } + OpenAPI_list_add(rule_reportsList, rule_reportsItem); } - - OpenAPI_list_add(rule_reportsList, rule_reportsItem); - } } - cJSON *sess_rule_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "sessRuleReports"); - - OpenAPI_list_t *sess_rule_reportsList; + sess_rule_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "sessRuleReports"); if (sess_rule_reports) { - cJSON *sess_rule_reports_local_nonprimitive; - if (!cJSON_IsArray(sess_rule_reports)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [sess_rule_reports]"); - goto end; - } - - sess_rule_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sess_rule_reports_local_nonprimitive, sess_rule_reports ) { - if (!cJSON_IsObject(sess_rule_reports_local_nonprimitive)) { + cJSON *sess_rule_reports_local = NULL; + if (!cJSON_IsArray(sess_rule_reports)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [sess_rule_reports]"); goto end; } - OpenAPI_session_rule_report_t *sess_rule_reportsItem = OpenAPI_session_rule_report_parseFromJSON(sess_rule_reports_local_nonprimitive); - if (!sess_rule_reportsItem) { - ogs_error("No sess_rule_reportsItem"); - OpenAPI_list_free(sess_rule_reportsList); - goto end; + sess_rule_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sess_rule_reports_local, sess_rule_reports) { + if (!cJSON_IsObject(sess_rule_reports_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [sess_rule_reports]"); + goto end; + } + OpenAPI_session_rule_report_t *sess_rule_reportsItem = OpenAPI_session_rule_report_parseFromJSON(sess_rule_reports_local); + if (!sess_rule_reportsItem) { + ogs_error("No sess_rule_reportsItem"); + OpenAPI_list_free(sess_rule_reportsList); + goto end; + } + OpenAPI_list_add(sess_rule_reportsList, sess_rule_reportsItem); } - - OpenAPI_list_add(sess_rule_reportsList, sess_rule_reportsItem); - } } - cJSON *qnc_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "qncReports"); - - OpenAPI_list_t *qnc_reportsList; + qnc_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "qncReports"); if (qnc_reports) { - cJSON *qnc_reports_local_nonprimitive; - if (!cJSON_IsArray(qnc_reports)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [qnc_reports]"); - goto end; - } - - qnc_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qnc_reports_local_nonprimitive, qnc_reports ) { - if (!cJSON_IsObject(qnc_reports_local_nonprimitive)) { + cJSON *qnc_reports_local = NULL; + if (!cJSON_IsArray(qnc_reports)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [qnc_reports]"); goto end; } - OpenAPI_qos_notification_control_info_t *qnc_reportsItem = OpenAPI_qos_notification_control_info_parseFromJSON(qnc_reports_local_nonprimitive); - if (!qnc_reportsItem) { - ogs_error("No qnc_reportsItem"); - OpenAPI_list_free(qnc_reportsList); - goto end; + qnc_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qnc_reports_local, qnc_reports) { + if (!cJSON_IsObject(qnc_reports_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [qnc_reports]"); + goto end; + } + OpenAPI_qos_notification_control_info_t *qnc_reportsItem = OpenAPI_qos_notification_control_info_parseFromJSON(qnc_reports_local); + if (!qnc_reportsItem) { + ogs_error("No qnc_reportsItem"); + OpenAPI_list_free(qnc_reportsList); + goto end; + } + OpenAPI_list_add(qnc_reportsList, qnc_reportsItem); } - - OpenAPI_list_add(qnc_reportsList, qnc_reportsItem); - } } - cJSON *qos_mon_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "qosMonReports"); - - OpenAPI_list_t *qos_mon_reportsList; + qos_mon_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "qosMonReports"); if (qos_mon_reports) { - cJSON *qos_mon_reports_local_nonprimitive; - if (!cJSON_IsArray(qos_mon_reports)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [qos_mon_reports]"); - goto end; - } - - qos_mon_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_mon_reports_local_nonprimitive, qos_mon_reports ) { - if (!cJSON_IsObject(qos_mon_reports_local_nonprimitive)) { + cJSON *qos_mon_reports_local = NULL; + if (!cJSON_IsArray(qos_mon_reports)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [qos_mon_reports]"); goto end; } - OpenAPI_qos_monitoring_report_t *qos_mon_reportsItem = OpenAPI_qos_monitoring_report_parseFromJSON(qos_mon_reports_local_nonprimitive); - if (!qos_mon_reportsItem) { - ogs_error("No qos_mon_reportsItem"); - OpenAPI_list_free(qos_mon_reportsList); - goto end; + qos_mon_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_mon_reports_local, qos_mon_reports) { + if (!cJSON_IsObject(qos_mon_reports_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [qos_mon_reports]"); + goto end; + } + OpenAPI_qos_monitoring_report_t *qos_mon_reportsItem = OpenAPI_qos_monitoring_report_parseFromJSON(qos_mon_reports_local); + if (!qos_mon_reportsItem) { + ogs_error("No qos_mon_reportsItem"); + OpenAPI_list_free(qos_mon_reportsList); + goto end; + } + OpenAPI_list_add(qos_mon_reportsList, qos_mon_reportsItem); } - - OpenAPI_list_add(qos_mon_reportsList, qos_mon_reportsItem); - } } - cJSON *user_location_info_time = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "userLocationInfoTime"); - + user_location_info_time = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "userLocationInfoTime"); if (user_location_info_time) { - if (!cJSON_IsString(user_location_info_time)) { + if (!cJSON_IsString(user_location_info_time) && !cJSON_IsNull(user_location_info_time)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [user_location_info_time]"); goto end; } } - cJSON *rep_pra_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "repPraInfos"); - - OpenAPI_list_t *rep_pra_infosList; + rep_pra_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "repPraInfos"); if (rep_pra_infos) { - cJSON *rep_pra_infos_local_map; - if (!cJSON_IsObject(rep_pra_infos)) { - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rep_pra_infos]"); - goto end; - } - rep_pra_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(rep_pra_infos_local_map, rep_pra_infos) { - cJSON *localMapObject = rep_pra_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [inner]"); + cJSON *rep_pra_infos_local_map = NULL; + if (!cJSON_IsObject(rep_pra_infos) && !cJSON_IsNull(rep_pra_infos)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rep_pra_infos]"); goto end; } - OpenAPI_list_add(rep_pra_infosList, localMapKeyPair); - } + if (cJSON_IsObject(rep_pra_infos)) { + rep_pra_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(rep_pra_infos_local_map, rep_pra_infos) { + cJSON *localMapObject = rep_pra_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(rep_pra_infosList, localMapKeyPair); + } + } } - cJSON *ue_init_res_req = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ueInitResReq"); - - OpenAPI_ue_initiated_resource_request_t *ue_init_res_req_local_nonprim = NULL; + ue_init_res_req = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "ueInitResReq"); if (ue_init_res_req) { ue_init_res_req_local_nonprim = OpenAPI_ue_initiated_resource_request_parseFromJSON(ue_init_res_req); } - cJSON *ref_qos_indication = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "refQosIndication"); - + ref_qos_indication = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "refQosIndication"); if (ref_qos_indication) { if (!cJSON_IsBool(ref_qos_indication)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [ref_qos_indication]"); @@ -1304,9 +1405,7 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p } } - cJSON *qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "qosFlowUsage"); - - OpenAPI_qos_flow_usage_e qos_flow_usageVariable; + qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "qosFlowUsage"); if (qos_flow_usage) { if (!cJSON_IsString(qos_flow_usage)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [qos_flow_usage]"); @@ -1315,9 +1414,7 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p qos_flow_usageVariable = OpenAPI_qos_flow_usage_FromString(qos_flow_usage->valuestring); } - cJSON *credit_manage_status = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "creditManageStatus"); - - OpenAPI_credit_management_status_e credit_manage_statusVariable; + credit_manage_status = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "creditManageStatus"); if (credit_manage_status) { if (!cJSON_IsString(credit_manage_status)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [credit_manage_status]"); @@ -1326,23 +1423,17 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p credit_manage_statusVariable = OpenAPI_credit_management_status_FromString(credit_manage_status->valuestring); } - cJSON *serv_nf_id = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "servNfId"); - - OpenAPI_serving_nf_identity_t *serv_nf_id_local_nonprim = NULL; + serv_nf_id = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "servNfId"); if (serv_nf_id) { serv_nf_id_local_nonprim = OpenAPI_serving_nf_identity_parseFromJSON(serv_nf_id); } - cJSON *trace_req = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "traceReq"); - - OpenAPI_trace_data_t *trace_req_local_nonprim = NULL; + trace_req = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "traceReq"); if (trace_req) { trace_req_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_req); } - cJSON *ma_pdu_ind = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "maPduInd"); - - OpenAPI_ma_pdu_indication_e ma_pdu_indVariable; + ma_pdu_ind = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "maPduInd"); if (ma_pdu_ind) { if (!cJSON_IsString(ma_pdu_ind)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [ma_pdu_ind]"); @@ -1351,192 +1442,166 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p ma_pdu_indVariable = OpenAPI_ma_pdu_indication_FromString(ma_pdu_ind->valuestring); } - cJSON *atsss_capab = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "atsssCapab"); - - OpenAPI_atsss_capability_t *atsss_capab_local_nonprim = NULL; + atsss_capab = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "atsssCapab"); if (atsss_capab) { atsss_capab_local_nonprim = OpenAPI_atsss_capability_parseFromJSON(atsss_capab); } - cJSON *tsn_bridge_info = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "tsnBridgeInfo"); - - OpenAPI_tsn_bridge_info_t *tsn_bridge_info_local_nonprim = NULL; + tsn_bridge_info = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "tsnBridgeInfo"); if (tsn_bridge_info) { tsn_bridge_info_local_nonprim = OpenAPI_tsn_bridge_info_parseFromJSON(tsn_bridge_info); } - cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "tsnBridgeManCont"); - - OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL; + tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "tsnBridgeManCont"); if (tsn_bridge_man_cont) { tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont); } - cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "tsnPortManContDstt"); - - OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL; + tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "tsnPortManContDstt"); if (tsn_port_man_cont_dstt) { tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt); } - cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "tsnPortManContNwtts"); - - OpenAPI_list_t *tsn_port_man_cont_nwttsList; + tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "tsnPortManContNwtts"); if (tsn_port_man_cont_nwtts) { - cJSON *tsn_port_man_cont_nwtts_local_nonprimitive; - if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); - goto end; - } - - tsn_port_man_cont_nwttsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) { - if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) { + cJSON *tsn_port_man_cont_nwtts_local = NULL; + if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); goto end; } - OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive); - if (!tsn_port_man_cont_nwttsItem) { - ogs_error("No tsn_port_man_cont_nwttsItem"); - OpenAPI_list_free(tsn_port_man_cont_nwttsList); - goto end; + tsn_port_man_cont_nwttsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) { + if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]"); + goto end; + } + OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local); + if (!tsn_port_man_cont_nwttsItem) { + ogs_error("No tsn_port_man_cont_nwttsItem"); + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + goto end; + } + OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); } - - OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem); - } } - cJSON *mul_addr_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "mulAddrInfos"); - - OpenAPI_list_t *mul_addr_infosList; + mul_addr_infos = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "mulAddrInfos"); if (mul_addr_infos) { - cJSON *mul_addr_infos_local_nonprimitive; - if (!cJSON_IsArray(mul_addr_infos)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [mul_addr_infos]"); - goto end; - } - - mul_addr_infosList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mul_addr_infos_local_nonprimitive, mul_addr_infos ) { - if (!cJSON_IsObject(mul_addr_infos_local_nonprimitive)) { + cJSON *mul_addr_infos_local = NULL; + if (!cJSON_IsArray(mul_addr_infos)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [mul_addr_infos]"); goto end; } - OpenAPI_ip_multicast_address_info_t *mul_addr_infosItem = OpenAPI_ip_multicast_address_info_parseFromJSON(mul_addr_infos_local_nonprimitive); - if (!mul_addr_infosItem) { - ogs_error("No mul_addr_infosItem"); - OpenAPI_list_free(mul_addr_infosList); - goto end; + mul_addr_infosList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mul_addr_infos_local, mul_addr_infos) { + if (!cJSON_IsObject(mul_addr_infos_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [mul_addr_infos]"); + goto end; + } + OpenAPI_ip_multicast_address_info_t *mul_addr_infosItem = OpenAPI_ip_multicast_address_info_parseFromJSON(mul_addr_infos_local); + if (!mul_addr_infosItem) { + ogs_error("No mul_addr_infosItem"); + OpenAPI_list_free(mul_addr_infosList); + goto end; + } + OpenAPI_list_add(mul_addr_infosList, mul_addr_infosItem); } - - OpenAPI_list_add(mul_addr_infosList, mul_addr_infosItem); - } } - cJSON *policy_dec_failure_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "policyDecFailureReports"); - - OpenAPI_list_t *policy_dec_failure_reportsList; + policy_dec_failure_reports = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "policyDecFailureReports"); if (policy_dec_failure_reports) { - cJSON *policy_dec_failure_reports_local_nonprimitive; - if (!cJSON_IsArray(policy_dec_failure_reports)) { - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [policy_dec_failure_reports]"); - goto end; - } - - policy_dec_failure_reportsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(policy_dec_failure_reports_local_nonprimitive, policy_dec_failure_reports ) { - if (!cJSON_IsString(policy_dec_failure_reports_local_nonprimitive)){ + cJSON *policy_dec_failure_reports_local = NULL; + if (!cJSON_IsArray(policy_dec_failure_reports)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [policy_dec_failure_reports]"); goto end; } - OpenAPI_list_add(policy_dec_failure_reportsList, (void *)OpenAPI_policy_decision_failure_code_FromString(policy_dec_failure_reports_local_nonprimitive->valuestring)); - } + policy_dec_failure_reportsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(policy_dec_failure_reports_local, policy_dec_failure_reports) { + if (!cJSON_IsString(policy_dec_failure_reports_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [policy_dec_failure_reports]"); + goto end; + } + OpenAPI_list_add(policy_dec_failure_reportsList, (void *)OpenAPI_policy_decision_failure_code_FromString(policy_dec_failure_reports_local->valuestring)); + } } - cJSON *traffic_descriptors = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "trafficDescriptors"); - - OpenAPI_list_t *traffic_descriptorsList; + traffic_descriptors = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "trafficDescriptors"); if (traffic_descriptors) { - cJSON *traffic_descriptors_local_nonprimitive; - if (!cJSON_IsArray(traffic_descriptors)){ - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [traffic_descriptors]"); - goto end; - } - - traffic_descriptorsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(traffic_descriptors_local_nonprimitive, traffic_descriptors ) { - if (!cJSON_IsObject(traffic_descriptors_local_nonprimitive)) { + cJSON *traffic_descriptors_local = NULL; + if (!cJSON_IsArray(traffic_descriptors)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [traffic_descriptors]"); goto end; } - OpenAPI_ddd_traffic_descriptor_t *traffic_descriptorsItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(traffic_descriptors_local_nonprimitive); - if (!traffic_descriptorsItem) { - ogs_error("No traffic_descriptorsItem"); - OpenAPI_list_free(traffic_descriptorsList); - goto end; + traffic_descriptorsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_descriptors_local, traffic_descriptors) { + if (!cJSON_IsObject(traffic_descriptors_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [traffic_descriptors]"); + goto end; + } + OpenAPI_ddd_traffic_descriptor_t *traffic_descriptorsItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(traffic_descriptors_local); + if (!traffic_descriptorsItem) { + ogs_error("No traffic_descriptorsItem"); + OpenAPI_list_free(traffic_descriptorsList); + goto end; + } + OpenAPI_list_add(traffic_descriptorsList, traffic_descriptorsItem); } - - OpenAPI_list_add(traffic_descriptorsList, traffic_descriptorsItem); - } } - cJSON *pcc_rule_id = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "pccRuleId"); - + pcc_rule_id = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "pccRuleId"); if (pcc_rule_id) { - if (!cJSON_IsString(pcc_rule_id)) { + if (!cJSON_IsString(pcc_rule_id) && !cJSON_IsNull(pcc_rule_id)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [pcc_rule_id]"); goto end; } } - cJSON *inter_grp_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "interGrpIds"); - - OpenAPI_list_t *inter_grp_idsList; + inter_grp_ids = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "interGrpIds"); if (inter_grp_ids) { - cJSON *inter_grp_ids_local; - if (!cJSON_IsArray(inter_grp_ids)) { - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [inter_grp_ids]"); - goto end; - } - inter_grp_idsList = OpenAPI_list_create(); + cJSON *inter_grp_ids_local = NULL; + if (!cJSON_IsArray(inter_grp_ids)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [inter_grp_ids]"); + goto end; + } - cJSON_ArrayForEach(inter_grp_ids_local, inter_grp_ids) { - if (!cJSON_IsString(inter_grp_ids_local)) { - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [inter_grp_ids]"); - goto end; - } - OpenAPI_list_add(inter_grp_idsList, ogs_strdup(inter_grp_ids_local->valuestring)); - } + inter_grp_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(inter_grp_ids_local, inter_grp_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(inter_grp_ids_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [inter_grp_ids]"); + goto end; + } + OpenAPI_list_add(inter_grp_idsList, ogs_strdup(inter_grp_ids_local->valuestring)); + } } - cJSON *types_of_notif = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "typesOfNotif"); - - OpenAPI_list_t *types_of_notifList; + types_of_notif = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "typesOfNotif"); if (types_of_notif) { - cJSON *types_of_notif_local_nonprimitive; - if (!cJSON_IsArray(types_of_notif)) { - ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [types_of_notif]"); - goto end; - } - - types_of_notifList = OpenAPI_list_create(); - - cJSON_ArrayForEach(types_of_notif_local_nonprimitive, types_of_notif ) { - if (!cJSON_IsString(types_of_notif_local_nonprimitive)){ + cJSON *types_of_notif_local = NULL; + if (!cJSON_IsArray(types_of_notif)) { ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [types_of_notif]"); goto end; } - OpenAPI_list_add(types_of_notifList, (void *)OpenAPI_dl_data_delivery_status_FromString(types_of_notif_local_nonprimitive->valuestring)); - } + types_of_notifList = OpenAPI_list_create(); + + cJSON_ArrayForEach(types_of_notif_local, types_of_notif) { + if (!cJSON_IsString(types_of_notif_local)) { + ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [types_of_notif]"); + goto end; + } + OpenAPI_list_add(types_of_notifList, (void *)OpenAPI_dl_data_delivery_status_FromString(types_of_notif_local->valuestring)); + } } sm_policy_update_context_data_local_var = OpenAPI_sm_policy_update_context_data_create ( @@ -1548,18 +1613,18 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p rel_access_info ? rel_access_info_local_nonprim : NULL, serving_network ? serving_network_local_nonprim : NULL, user_location_info ? user_location_info_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, - rel_ipv4_address ? ogs_strdup(rel_ipv4_address->valuestring) : NULL, - ipv4_address ? ogs_strdup(ipv4_address->valuestring) : NULL, - ip_domain ? ogs_strdup(ip_domain->valuestring) : NULL, - ipv6_address_prefix ? ogs_strdup(ipv6_address_prefix->valuestring) : NULL, - rel_ipv6_address_prefix ? ogs_strdup(rel_ipv6_address_prefix->valuestring) : NULL, - add_ipv6_addr_prefixes ? ogs_strdup(add_ipv6_addr_prefixes->valuestring) : NULL, - add_rel_ipv6_addr_prefixes ? ogs_strdup(add_rel_ipv6_addr_prefixes->valuestring) : NULL, - rel_ue_mac ? ogs_strdup(rel_ue_mac->valuestring) : NULL, - ue_mac ? ogs_strdup(ue_mac->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, + rel_ipv4_address && !cJSON_IsNull(rel_ipv4_address) ? ogs_strdup(rel_ipv4_address->valuestring) : NULL, + ipv4_address && !cJSON_IsNull(ipv4_address) ? ogs_strdup(ipv4_address->valuestring) : NULL, + ip_domain && !cJSON_IsNull(ip_domain) ? ogs_strdup(ip_domain->valuestring) : NULL, + ipv6_address_prefix && !cJSON_IsNull(ipv6_address_prefix) ? ogs_strdup(ipv6_address_prefix->valuestring) : NULL, + rel_ipv6_address_prefix && !cJSON_IsNull(rel_ipv6_address_prefix) ? ogs_strdup(rel_ipv6_address_prefix->valuestring) : NULL, + add_ipv6_addr_prefixes && !cJSON_IsNull(add_ipv6_addr_prefixes) ? ogs_strdup(add_ipv6_addr_prefixes->valuestring) : NULL, + add_rel_ipv6_addr_prefixes && !cJSON_IsNull(add_rel_ipv6_addr_prefixes) ? ogs_strdup(add_rel_ipv6_addr_prefixes->valuestring) : NULL, + rel_ue_mac && !cJSON_IsNull(rel_ue_mac) ? ogs_strdup(rel_ue_mac->valuestring) : NULL, + ue_mac && !cJSON_IsNull(ue_mac) ? ogs_strdup(ue_mac->valuestring) : NULL, subs_sess_ambr ? subs_sess_ambr_local_nonprim : NULL, - auth_prof_index ? ogs_strdup(auth_prof_index->valuestring) : NULL, + auth_prof_index && !cJSON_IsNull(auth_prof_index) ? ogs_strdup(auth_prof_index->valuestring) : NULL, subs_def_qos ? subs_def_qos_local_nonprim : NULL, vplmn_qos ? vplmn_qos_local_nonprim : NULL, num_of_pack_filter ? true : false, @@ -1572,7 +1637,7 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p sess_rule_reports ? sess_rule_reportsList : NULL, qnc_reports ? qnc_reportsList : NULL, qos_mon_reports ? qos_mon_reportsList : NULL, - user_location_info_time ? ogs_strdup(user_location_info_time->valuestring) : NULL, + user_location_info_time && !cJSON_IsNull(user_location_info_time) ? ogs_strdup(user_location_info_time->valuestring) : NULL, rep_pra_infos ? rep_pra_infosList : NULL, ue_init_res_req ? ue_init_res_req_local_nonprim : NULL, ref_qos_indication ? true : false, @@ -1590,13 +1655,168 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p mul_addr_infos ? mul_addr_infosList : NULL, policy_dec_failure_reports ? policy_dec_failure_reportsList : NULL, traffic_descriptors ? traffic_descriptorsList : NULL, - pcc_rule_id ? ogs_strdup(pcc_rule_id->valuestring) : NULL, + pcc_rule_id && !cJSON_IsNull(pcc_rule_id) ? ogs_strdup(pcc_rule_id->valuestring) : NULL, inter_grp_ids ? inter_grp_idsList : NULL, types_of_notif ? types_of_notifList : NULL ); return sm_policy_update_context_data_local_var; end: + if (rep_policy_ctrl_req_triggersList) { + OpenAPI_list_free(rep_policy_ctrl_req_triggersList); + rep_policy_ctrl_req_triggersList = NULL; + } + if (acc_net_ch_idsList) { + OpenAPI_list_for_each(acc_net_ch_idsList, node) { + OpenAPI_acc_net_ch_id_free(node->data); + } + OpenAPI_list_free(acc_net_ch_idsList); + acc_net_ch_idsList = NULL; + } + if (add_access_info_local_nonprim) { + OpenAPI_additional_access_info_free(add_access_info_local_nonprim); + add_access_info_local_nonprim = NULL; + } + if (rel_access_info_local_nonprim) { + OpenAPI_additional_access_info_free(rel_access_info_local_nonprim); + rel_access_info_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (user_location_info_local_nonprim) { + OpenAPI_user_location_free(user_location_info_local_nonprim); + user_location_info_local_nonprim = NULL; + } + if (subs_sess_ambr_local_nonprim) { + OpenAPI_ambr_free(subs_sess_ambr_local_nonprim); + subs_sess_ambr_local_nonprim = NULL; + } + if (subs_def_qos_local_nonprim) { + OpenAPI_subscribed_default_qos_free(subs_def_qos_local_nonprim); + subs_def_qos_local_nonprim = NULL; + } + if (vplmn_qos_local_nonprim) { + OpenAPI_vplmn_qos_free(vplmn_qos_local_nonprim); + vplmn_qos_local_nonprim = NULL; + } + if (accu_usage_reportsList) { + OpenAPI_list_for_each(accu_usage_reportsList, node) { + OpenAPI_accu_usage_report_free(node->data); + } + OpenAPI_list_free(accu_usage_reportsList); + accu_usage_reportsList = NULL; + } + if (app_detection_infosList) { + OpenAPI_list_for_each(app_detection_infosList, node) { + OpenAPI_app_detection_info_free(node->data); + } + OpenAPI_list_free(app_detection_infosList); + app_detection_infosList = NULL; + } + if (rule_reportsList) { + OpenAPI_list_for_each(rule_reportsList, node) { + OpenAPI_rule_report_free(node->data); + } + OpenAPI_list_free(rule_reportsList); + rule_reportsList = NULL; + } + if (sess_rule_reportsList) { + OpenAPI_list_for_each(sess_rule_reportsList, node) { + OpenAPI_session_rule_report_free(node->data); + } + OpenAPI_list_free(sess_rule_reportsList); + sess_rule_reportsList = NULL; + } + if (qnc_reportsList) { + OpenAPI_list_for_each(qnc_reportsList, node) { + OpenAPI_qos_notification_control_info_free(node->data); + } + OpenAPI_list_free(qnc_reportsList); + qnc_reportsList = NULL; + } + if (qos_mon_reportsList) { + OpenAPI_list_for_each(qos_mon_reportsList, node) { + OpenAPI_qos_monitoring_report_free(node->data); + } + OpenAPI_list_free(qos_mon_reportsList); + qos_mon_reportsList = NULL; + } + if (rep_pra_infosList) { + OpenAPI_list_for_each(rep_pra_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(rep_pra_infosList); + rep_pra_infosList = NULL; + } + if (ue_init_res_req_local_nonprim) { + OpenAPI_ue_initiated_resource_request_free(ue_init_res_req_local_nonprim); + ue_init_res_req_local_nonprim = NULL; + } + if (serv_nf_id_local_nonprim) { + OpenAPI_serving_nf_identity_free(serv_nf_id_local_nonprim); + serv_nf_id_local_nonprim = NULL; + } + if (trace_req_local_nonprim) { + OpenAPI_trace_data_free(trace_req_local_nonprim); + trace_req_local_nonprim = NULL; + } + if (atsss_capab_local_nonprim) { + OpenAPI_atsss_capability_free(atsss_capab_local_nonprim); + atsss_capab_local_nonprim = NULL; + } + if (tsn_bridge_info_local_nonprim) { + OpenAPI_tsn_bridge_info_free(tsn_bridge_info_local_nonprim); + tsn_bridge_info_local_nonprim = NULL; + } + if (tsn_bridge_man_cont_local_nonprim) { + OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim); + tsn_bridge_man_cont_local_nonprim = NULL; + } + if (tsn_port_man_cont_dstt_local_nonprim) { + OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim); + tsn_port_man_cont_dstt_local_nonprim = NULL; + } + if (tsn_port_man_cont_nwttsList) { + OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) { + OpenAPI_port_management_container_free(node->data); + } + OpenAPI_list_free(tsn_port_man_cont_nwttsList); + tsn_port_man_cont_nwttsList = NULL; + } + if (mul_addr_infosList) { + OpenAPI_list_for_each(mul_addr_infosList, node) { + OpenAPI_ip_multicast_address_info_free(node->data); + } + OpenAPI_list_free(mul_addr_infosList); + mul_addr_infosList = NULL; + } + if (policy_dec_failure_reportsList) { + OpenAPI_list_free(policy_dec_failure_reportsList); + policy_dec_failure_reportsList = NULL; + } + if (traffic_descriptorsList) { + OpenAPI_list_for_each(traffic_descriptorsList, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(traffic_descriptorsList); + traffic_descriptorsList = NULL; + } + if (inter_grp_idsList) { + OpenAPI_list_for_each(inter_grp_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(inter_grp_idsList); + inter_grp_idsList = NULL; + } + if (types_of_notifList) { + OpenAPI_list_free(types_of_notifList); + types_of_notifList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/small_data_rate_status.c b/lib/sbi/openapi/model/small_data_rate_status.c index 8479b4934..338383521 100644 --- a/lib/sbi/openapi/model/small_data_rate_status.c +++ b/lib/sbi/openapi/model/small_data_rate_status.c @@ -34,17 +34,22 @@ OpenAPI_small_data_rate_status_t *OpenAPI_small_data_rate_status_create( void OpenAPI_small_data_rate_status_free(OpenAPI_small_data_rate_status_t *small_data_rate_status) { + OpenAPI_lnode_t *node = NULL; + if (NULL == small_data_rate_status) { return; } - OpenAPI_lnode_t *node; - ogs_free(small_data_rate_status->validity_time); + if (small_data_rate_status->validity_time) { + ogs_free(small_data_rate_status->validity_time); + small_data_rate_status->validity_time = NULL; + } ogs_free(small_data_rate_status); } cJSON *OpenAPI_small_data_rate_status_convertToJSON(OpenAPI_small_data_rate_status_t *small_data_rate_status) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (small_data_rate_status == NULL) { ogs_error("OpenAPI_small_data_rate_status_convertToJSON() failed [SmallDataRateStatus]"); @@ -94,8 +99,13 @@ end: OpenAPI_small_data_rate_status_t *OpenAPI_small_data_rate_status_parseFromJSON(cJSON *small_data_rate_statusJSON) { OpenAPI_small_data_rate_status_t *small_data_rate_status_local_var = NULL; - cJSON *remain_packets_ul = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "remainPacketsUl"); - + OpenAPI_lnode_t *node = NULL; + cJSON *remain_packets_ul = NULL; + cJSON *remain_packets_dl = NULL; + cJSON *validity_time = NULL; + cJSON *remain_ex_reports_ul = NULL; + cJSON *remain_ex_reports_dl = NULL; + remain_packets_ul = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "remainPacketsUl"); if (remain_packets_ul) { if (!cJSON_IsNumber(remain_packets_ul)) { ogs_error("OpenAPI_small_data_rate_status_parseFromJSON() failed [remain_packets_ul]"); @@ -103,8 +113,7 @@ OpenAPI_small_data_rate_status_t *OpenAPI_small_data_rate_status_parseFromJSON(c } } - cJSON *remain_packets_dl = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "remainPacketsDl"); - + remain_packets_dl = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "remainPacketsDl"); if (remain_packets_dl) { if (!cJSON_IsNumber(remain_packets_dl)) { ogs_error("OpenAPI_small_data_rate_status_parseFromJSON() failed [remain_packets_dl]"); @@ -112,17 +121,15 @@ OpenAPI_small_data_rate_status_t *OpenAPI_small_data_rate_status_parseFromJSON(c } } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_small_data_rate_status_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *remain_ex_reports_ul = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "remainExReportsUl"); - + remain_ex_reports_ul = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "remainExReportsUl"); if (remain_ex_reports_ul) { if (!cJSON_IsNumber(remain_ex_reports_ul)) { ogs_error("OpenAPI_small_data_rate_status_parseFromJSON() failed [remain_ex_reports_ul]"); @@ -130,8 +137,7 @@ OpenAPI_small_data_rate_status_t *OpenAPI_small_data_rate_status_parseFromJSON(c } } - cJSON *remain_ex_reports_dl = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "remainExReportsDl"); - + remain_ex_reports_dl = cJSON_GetObjectItemCaseSensitive(small_data_rate_statusJSON, "remainExReportsDl"); if (remain_ex_reports_dl) { if (!cJSON_IsNumber(remain_ex_reports_dl)) { ogs_error("OpenAPI_small_data_rate_status_parseFromJSON() failed [remain_ex_reports_dl]"); @@ -144,7 +150,7 @@ OpenAPI_small_data_rate_status_t *OpenAPI_small_data_rate_status_parseFromJSON(c remain_packets_ul ? remain_packets_ul->valuedouble : 0, remain_packets_dl ? true : false, remain_packets_dl ? remain_packets_dl->valuedouble : 0, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, remain_ex_reports_ul ? true : false, remain_ex_reports_ul ? remain_ex_reports_ul->valuedouble : 0, remain_ex_reports_dl ? true : false, diff --git a/lib/sbi/openapi/model/small_data_rate_status_info.c b/lib/sbi/openapi/model/small_data_rate_status_info.c index 0b70f5e24..3fa2213d7 100644 --- a/lib/sbi/openapi/model/small_data_rate_status_info.c +++ b/lib/sbi/openapi/model/small_data_rate_status_info.c @@ -22,19 +22,30 @@ OpenAPI_small_data_rate_status_info_t *OpenAPI_small_data_rate_status_info_creat void OpenAPI_small_data_rate_status_info_free(OpenAPI_small_data_rate_status_info_t *small_data_rate_status_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == small_data_rate_status_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(small_data_rate_status_info->snssai); - ogs_free(small_data_rate_status_info->dnn); - OpenAPI_small_data_rate_status_free(small_data_rate_status_info->small_data_rate_status); + if (small_data_rate_status_info->snssai) { + OpenAPI_snssai_free(small_data_rate_status_info->snssai); + small_data_rate_status_info->snssai = NULL; + } + if (small_data_rate_status_info->dnn) { + ogs_free(small_data_rate_status_info->dnn); + small_data_rate_status_info->dnn = NULL; + } + if (small_data_rate_status_info->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_info->small_data_rate_status); + small_data_rate_status_info->small_data_rate_status = NULL; + } ogs_free(small_data_rate_status_info); } cJSON *OpenAPI_small_data_rate_status_info_convertToJSON(OpenAPI_small_data_rate_status_info_t *small_data_rate_status_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (small_data_rate_status_info == NULL) { ogs_error("OpenAPI_small_data_rate_status_info_convertToJSON() failed [SmallDataRateStatusInfo]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_small_data_rate_status_info_convertToJSON(OpenAPI_small_data_rate } item = cJSON_CreateObject(); + if (!small_data_rate_status_info->snssai) { + ogs_error("OpenAPI_small_data_rate_status_info_convertToJSON() failed [snssai]"); + return NULL; + } cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(small_data_rate_status_info->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_small_data_rate_status_info_convertToJSON() failed [snssai]"); @@ -53,11 +68,19 @@ cJSON *OpenAPI_small_data_rate_status_info_convertToJSON(OpenAPI_small_data_rate goto end; } + if (!small_data_rate_status_info->dnn) { + ogs_error("OpenAPI_small_data_rate_status_info_convertToJSON() failed [dnn]"); + return NULL; + } if (cJSON_AddStringToObject(item, "Dnn", small_data_rate_status_info->dnn) == NULL) { ogs_error("OpenAPI_small_data_rate_status_info_convertToJSON() failed [dnn]"); goto end; } + if (!small_data_rate_status_info->small_data_rate_status) { + ogs_error("OpenAPI_small_data_rate_status_info_convertToJSON() failed [small_data_rate_status]"); + return NULL; + } cJSON *small_data_rate_status_local_JSON = OpenAPI_small_data_rate_status_convertToJSON(small_data_rate_status_info->small_data_rate_status); if (small_data_rate_status_local_JSON == NULL) { ogs_error("OpenAPI_small_data_rate_status_info_convertToJSON() failed [small_data_rate_status]"); @@ -76,33 +99,34 @@ end: OpenAPI_small_data_rate_status_info_t *OpenAPI_small_data_rate_status_info_parseFromJSON(cJSON *small_data_rate_status_infoJSON) { OpenAPI_small_data_rate_status_info_t *small_data_rate_status_info_local_var = NULL; - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(small_data_rate_status_infoJSON, "Snssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *dnn = NULL; + cJSON *small_data_rate_status = NULL; + OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(small_data_rate_status_infoJSON, "Snssai"); if (!snssai) { ogs_error("OpenAPI_small_data_rate_status_info_parseFromJSON() failed [snssai]"); goto end; } - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(small_data_rate_status_infoJSON, "Dnn"); + dnn = cJSON_GetObjectItemCaseSensitive(small_data_rate_status_infoJSON, "Dnn"); if (!dnn) { ogs_error("OpenAPI_small_data_rate_status_info_parseFromJSON() failed [dnn]"); goto end; } - if (!cJSON_IsString(dnn)) { ogs_error("OpenAPI_small_data_rate_status_info_parseFromJSON() failed [dnn]"); goto end; } - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(small_data_rate_status_infoJSON, "SmallDataRateStatus"); + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(small_data_rate_status_infoJSON, "SmallDataRateStatus"); if (!small_data_rate_status) { ogs_error("OpenAPI_small_data_rate_status_info_parseFromJSON() failed [small_data_rate_status]"); goto end; } - - OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); small_data_rate_status_info_local_var = OpenAPI_small_data_rate_status_info_create ( @@ -113,6 +137,14 @@ OpenAPI_small_data_rate_status_info_t *OpenAPI_small_data_rate_status_info_parse return small_data_rate_status_info_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_change_info.c b/lib/sbi/openapi/model/smf_change_info.c index 9846d32b2..ee7a501ea 100644 --- a/lib/sbi/openapi/model/smf_change_info.c +++ b/lib/sbi/openapi/model/smf_change_info.c @@ -20,20 +20,25 @@ OpenAPI_smf_change_info_t *OpenAPI_smf_change_info_create( void OpenAPI_smf_change_info_free(OpenAPI_smf_change_info_t *smf_change_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_change_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(smf_change_info->pdu_session_id_list, node) { - ogs_free(node->data); + if (smf_change_info->pdu_session_id_list) { + OpenAPI_list_for_each(smf_change_info->pdu_session_id_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(smf_change_info->pdu_session_id_list); + smf_change_info->pdu_session_id_list = NULL; } - OpenAPI_list_free(smf_change_info->pdu_session_id_list); ogs_free(smf_change_info); } cJSON *OpenAPI_smf_change_info_convertToJSON(OpenAPI_smf_change_info_t *smf_change_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_change_info == NULL) { ogs_error("OpenAPI_smf_change_info_convertToJSON() failed [SmfChangeInfo]"); @@ -41,20 +46,26 @@ cJSON *OpenAPI_smf_change_info_convertToJSON(OpenAPI_smf_change_info_t *smf_chan } item = cJSON_CreateObject(); - cJSON *pdu_session_id_list = cJSON_AddArrayToObject(item, "pduSessionIdList"); - if (pdu_session_id_list == NULL) { + if (!smf_change_info->pdu_session_id_list) { + ogs_error("OpenAPI_smf_change_info_convertToJSON() failed [pdu_session_id_list]"); + return NULL; + } + cJSON *pdu_session_id_listList = cJSON_AddArrayToObject(item, "pduSessionIdList"); + if (pdu_session_id_listList == NULL) { ogs_error("OpenAPI_smf_change_info_convertToJSON() failed [pdu_session_id_list]"); goto end; } - - OpenAPI_lnode_t *pdu_session_id_list_node; - OpenAPI_list_for_each(smf_change_info->pdu_session_id_list, pdu_session_id_list_node) { - if (cJSON_AddNumberToObject(pdu_session_id_list, "", *(double *)pdu_session_id_list_node->data) == NULL) { - ogs_error("OpenAPI_smf_change_info_convertToJSON() failed [pdu_session_id_list]"); - goto end; + OpenAPI_list_for_each(smf_change_info->pdu_session_id_list, node) { + if (cJSON_AddNumberToObject(pdu_session_id_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_smf_change_info_convertToJSON() failed [pdu_session_id_list]"); + goto end; + } } - } + if (smf_change_info->smf_change_ind == OpenAPI_smf_change_indication_NULL) { + ogs_error("OpenAPI_smf_change_info_convertToJSON() failed [smf_change_ind]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smfChangeInd", OpenAPI_smf_change_indication_ToString(smf_change_info->smf_change_ind)) == NULL) { ogs_error("OpenAPI_smf_change_info_convertToJSON() failed [smf_change_ind]"); goto end; @@ -67,35 +78,45 @@ end: OpenAPI_smf_change_info_t *OpenAPI_smf_change_info_parseFromJSON(cJSON *smf_change_infoJSON) { OpenAPI_smf_change_info_t *smf_change_info_local_var = NULL; - cJSON *pdu_session_id_list = cJSON_GetObjectItemCaseSensitive(smf_change_infoJSON, "pduSessionIdList"); + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_id_list = NULL; + OpenAPI_list_t *pdu_session_id_listList = NULL; + cJSON *smf_change_ind = NULL; + OpenAPI_smf_change_indication_e smf_change_indVariable = 0; + pdu_session_id_list = cJSON_GetObjectItemCaseSensitive(smf_change_infoJSON, "pduSessionIdList"); if (!pdu_session_id_list) { ogs_error("OpenAPI_smf_change_info_parseFromJSON() failed [pdu_session_id_list]"); goto end; } + cJSON *pdu_session_id_list_local = NULL; + if (!cJSON_IsArray(pdu_session_id_list)) { + ogs_error("OpenAPI_smf_change_info_parseFromJSON() failed [pdu_session_id_list]"); + goto end; + } - OpenAPI_list_t *pdu_session_id_listList; - cJSON *pdu_session_id_list_local; - if (!cJSON_IsArray(pdu_session_id_list)) { - ogs_error("OpenAPI_smf_change_info_parseFromJSON() failed [pdu_session_id_list]"); - goto end; - } - pdu_session_id_listList = OpenAPI_list_create(); + pdu_session_id_listList = OpenAPI_list_create(); - cJSON_ArrayForEach(pdu_session_id_list_local, pdu_session_id_list) { - if (!cJSON_IsNumber(pdu_session_id_list_local)) { - ogs_error("OpenAPI_smf_change_info_parseFromJSON() failed [pdu_session_id_list]"); - goto end; - } - OpenAPI_list_add(pdu_session_id_listList, &pdu_session_id_list_local->valuedouble); - } + cJSON_ArrayForEach(pdu_session_id_list_local, pdu_session_id_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(pdu_session_id_list_local)) { + ogs_error("OpenAPI_smf_change_info_parseFromJSON() failed [pdu_session_id_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_smf_change_info_parseFromJSON() failed [pdu_session_id_list]"); + goto end; + } + *localDouble = pdu_session_id_list_local->valuedouble; + OpenAPI_list_add(pdu_session_id_listList, localDouble); + } - cJSON *smf_change_ind = cJSON_GetObjectItemCaseSensitive(smf_change_infoJSON, "smfChangeInd"); + smf_change_ind = cJSON_GetObjectItemCaseSensitive(smf_change_infoJSON, "smfChangeInd"); if (!smf_change_ind) { ogs_error("OpenAPI_smf_change_info_parseFromJSON() failed [smf_change_ind]"); goto end; } - - OpenAPI_smf_change_indication_e smf_change_indVariable; if (!cJSON_IsString(smf_change_ind)) { ogs_error("OpenAPI_smf_change_info_parseFromJSON() failed [smf_change_ind]"); goto end; @@ -109,6 +130,13 @@ OpenAPI_smf_change_info_t *OpenAPI_smf_change_info_parseFromJSON(cJSON *smf_chan return smf_change_info_local_var; end: + if (pdu_session_id_listList) { + OpenAPI_list_for_each(pdu_session_id_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(pdu_session_id_listList); + pdu_session_id_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_info.c b/lib/sbi/openapi/model/smf_info.c index 1c5d8f62b..1dc8fafd1 100644 --- a/lib/sbi/openapi/model/smf_info.c +++ b/lib/sbi/openapi/model/smf_info.c @@ -34,30 +34,47 @@ OpenAPI_smf_info_t *OpenAPI_smf_info_create( void OpenAPI_smf_info_free(OpenAPI_smf_info_t *smf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(smf_info->s_nssai_smf_info_list, node) { - OpenAPI_snssai_smf_info_item_free(node->data); + if (smf_info->s_nssai_smf_info_list) { + OpenAPI_list_for_each(smf_info->s_nssai_smf_info_list, node) { + OpenAPI_snssai_smf_info_item_free(node->data); + } + OpenAPI_list_free(smf_info->s_nssai_smf_info_list); + smf_info->s_nssai_smf_info_list = NULL; } - OpenAPI_list_free(smf_info->s_nssai_smf_info_list); - OpenAPI_list_for_each(smf_info->tai_list, node) { - OpenAPI_tai_free(node->data); + if (smf_info->tai_list) { + OpenAPI_list_for_each(smf_info->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(smf_info->tai_list); + smf_info->tai_list = NULL; } - OpenAPI_list_free(smf_info->tai_list); - OpenAPI_list_for_each(smf_info->tai_range_list, node) { - OpenAPI_tai_range_free(node->data); + if (smf_info->tai_range_list) { + OpenAPI_list_for_each(smf_info->tai_range_list, node) { + OpenAPI_tai_range_free(node->data); + } + OpenAPI_list_free(smf_info->tai_range_list); + smf_info->tai_range_list = NULL; + } + if (smf_info->pgw_fqdn) { + ogs_free(smf_info->pgw_fqdn); + smf_info->pgw_fqdn = NULL; + } + if (smf_info->access_type) { + OpenAPI_list_free(smf_info->access_type); + smf_info->access_type = NULL; } - OpenAPI_list_free(smf_info->tai_range_list); - ogs_free(smf_info->pgw_fqdn); - OpenAPI_list_free(smf_info->access_type); ogs_free(smf_info); } cJSON *OpenAPI_smf_info_convertToJSON(OpenAPI_smf_info_t *smf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_info == NULL) { ogs_error("OpenAPI_smf_info_convertToJSON() failed [SmfInfo]"); @@ -65,22 +82,22 @@ cJSON *OpenAPI_smf_info_convertToJSON(OpenAPI_smf_info_t *smf_info) } item = cJSON_CreateObject(); + if (!smf_info->s_nssai_smf_info_list) { + ogs_error("OpenAPI_smf_info_convertToJSON() failed [s_nssai_smf_info_list]"); + return NULL; + } cJSON *s_nssai_smf_info_listList = cJSON_AddArrayToObject(item, "sNssaiSmfInfoList"); if (s_nssai_smf_info_listList == NULL) { ogs_error("OpenAPI_smf_info_convertToJSON() failed [s_nssai_smf_info_list]"); goto end; } - - OpenAPI_lnode_t *s_nssai_smf_info_list_node; - if (smf_info->s_nssai_smf_info_list) { - OpenAPI_list_for_each(smf_info->s_nssai_smf_info_list, s_nssai_smf_info_list_node) { - cJSON *itemLocal = OpenAPI_snssai_smf_info_item_convertToJSON(s_nssai_smf_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_smf_info_convertToJSON() failed [s_nssai_smf_info_list]"); - goto end; - } - cJSON_AddItemToArray(s_nssai_smf_info_listList, itemLocal); + OpenAPI_list_for_each(smf_info->s_nssai_smf_info_list, node) { + cJSON *itemLocal = OpenAPI_snssai_smf_info_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_info_convertToJSON() failed [s_nssai_smf_info_list]"); + goto end; } + cJSON_AddItemToArray(s_nssai_smf_info_listList, itemLocal); } if (smf_info->tai_list) { @@ -89,17 +106,13 @@ cJSON *OpenAPI_smf_info_convertToJSON(OpenAPI_smf_info_t *smf_info) ogs_error("OpenAPI_smf_info_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (smf_info->tai_list) { - OpenAPI_list_for_each(smf_info->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_smf_info_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(smf_info->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_info_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } } @@ -109,17 +122,13 @@ cJSON *OpenAPI_smf_info_convertToJSON(OpenAPI_smf_info_t *smf_info) ogs_error("OpenAPI_smf_info_convertToJSON() failed [tai_range_list]"); goto end; } - - OpenAPI_lnode_t *tai_range_list_node; - if (smf_info->tai_range_list) { - OpenAPI_list_for_each(smf_info->tai_range_list, tai_range_list_node) { - cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(tai_range_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_smf_info_convertToJSON() failed [tai_range_list]"); - goto end; - } - cJSON_AddItemToArray(tai_range_listList, itemLocal); + OpenAPI_list_for_each(smf_info->tai_range_list, node) { + cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_info_convertToJSON() failed [tai_range_list]"); + goto end; } + cJSON_AddItemToArray(tai_range_listList, itemLocal); } } @@ -130,15 +139,14 @@ cJSON *OpenAPI_smf_info_convertToJSON(OpenAPI_smf_info_t *smf_info) } } - if (smf_info->access_type) { - cJSON *access_type = cJSON_AddArrayToObject(item, "accessType"); - if (access_type == NULL) { + if (smf_info->access_type != OpenAPI_access_type_NULL) { + cJSON *access_typeList = cJSON_AddArrayToObject(item, "accessType"); + if (access_typeList == NULL) { ogs_error("OpenAPI_smf_info_convertToJSON() failed [access_type]"); goto end; } - OpenAPI_lnode_t *access_type_node; - OpenAPI_list_for_each(smf_info->access_type, access_type_node) { - if (cJSON_AddStringToObject(access_type, "", OpenAPI_access_type_ToString((intptr_t)access_type_node->data)) == NULL) { + OpenAPI_list_for_each(smf_info->access_type, node) { + if (cJSON_AddStringToObject(access_typeList, "", OpenAPI_access_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_smf_info_convertToJSON() failed [access_type]"); goto end; } @@ -166,128 +174,123 @@ end: OpenAPI_smf_info_t *OpenAPI_smf_info_parseFromJSON(cJSON *smf_infoJSON) { OpenAPI_smf_info_t *smf_info_local_var = NULL; - cJSON *s_nssai_smf_info_list = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "sNssaiSmfInfoList"); + OpenAPI_lnode_t *node = NULL; + cJSON *s_nssai_smf_info_list = NULL; + OpenAPI_list_t *s_nssai_smf_info_listList = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + cJSON *tai_range_list = NULL; + OpenAPI_list_t *tai_range_listList = NULL; + cJSON *pgw_fqdn = NULL; + cJSON *access_type = NULL; + OpenAPI_list_t *access_typeList = NULL; + cJSON *priority = NULL; + cJSON *vsmf_support_ind = NULL; + s_nssai_smf_info_list = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "sNssaiSmfInfoList"); if (!s_nssai_smf_info_list) { ogs_error("OpenAPI_smf_info_parseFromJSON() failed [s_nssai_smf_info_list]"); goto end; } - - OpenAPI_list_t *s_nssai_smf_info_listList; - cJSON *s_nssai_smf_info_list_local_nonprimitive; - if (!cJSON_IsArray(s_nssai_smf_info_list)){ - ogs_error("OpenAPI_smf_info_parseFromJSON() failed [s_nssai_smf_info_list]"); - goto end; - } - - s_nssai_smf_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(s_nssai_smf_info_list_local_nonprimitive, s_nssai_smf_info_list ) { - if (!cJSON_IsObject(s_nssai_smf_info_list_local_nonprimitive)) { + cJSON *s_nssai_smf_info_list_local = NULL; + if (!cJSON_IsArray(s_nssai_smf_info_list)) { ogs_error("OpenAPI_smf_info_parseFromJSON() failed [s_nssai_smf_info_list]"); goto end; } - OpenAPI_snssai_smf_info_item_t *s_nssai_smf_info_listItem = OpenAPI_snssai_smf_info_item_parseFromJSON(s_nssai_smf_info_list_local_nonprimitive); - if (!s_nssai_smf_info_listItem) { - ogs_error("No s_nssai_smf_info_listItem"); - OpenAPI_list_free(s_nssai_smf_info_listList); - goto end; + s_nssai_smf_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(s_nssai_smf_info_list_local, s_nssai_smf_info_list) { + if (!cJSON_IsObject(s_nssai_smf_info_list_local)) { + ogs_error("OpenAPI_smf_info_parseFromJSON() failed [s_nssai_smf_info_list]"); + goto end; + } + OpenAPI_snssai_smf_info_item_t *s_nssai_smf_info_listItem = OpenAPI_snssai_smf_info_item_parseFromJSON(s_nssai_smf_info_list_local); + if (!s_nssai_smf_info_listItem) { + ogs_error("No s_nssai_smf_info_listItem"); + OpenAPI_list_free(s_nssai_smf_info_listList); + goto end; + } + OpenAPI_list_add(s_nssai_smf_info_listList, s_nssai_smf_info_listItem); } - OpenAPI_list_add(s_nssai_smf_info_listList, s_nssai_smf_info_listItem); - } - - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "taiList"); - - OpenAPI_list_t *tai_listList; + tai_list = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "taiList"); if (tai_list) { - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_smf_info_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_smf_info_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_smf_info_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - - OpenAPI_list_add(tai_listList, tai_listItem); - } } - cJSON *tai_range_list = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "taiRangeList"); - - OpenAPI_list_t *tai_range_listList; + tai_range_list = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "taiRangeList"); if (tai_range_list) { - cJSON *tai_range_list_local_nonprimitive; - if (!cJSON_IsArray(tai_range_list)){ - ogs_error("OpenAPI_smf_info_parseFromJSON() failed [tai_range_list]"); - goto end; - } - - tai_range_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_range_list_local_nonprimitive, tai_range_list ) { - if (!cJSON_IsObject(tai_range_list_local_nonprimitive)) { + cJSON *tai_range_list_local = NULL; + if (!cJSON_IsArray(tai_range_list)) { ogs_error("OpenAPI_smf_info_parseFromJSON() failed [tai_range_list]"); goto end; } - OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local_nonprimitive); - if (!tai_range_listItem) { - ogs_error("No tai_range_listItem"); - OpenAPI_list_free(tai_range_listList); - goto end; + tai_range_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_range_list_local, tai_range_list) { + if (!cJSON_IsObject(tai_range_list_local)) { + ogs_error("OpenAPI_smf_info_parseFromJSON() failed [tai_range_list]"); + goto end; + } + OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local); + if (!tai_range_listItem) { + ogs_error("No tai_range_listItem"); + OpenAPI_list_free(tai_range_listList); + goto end; + } + OpenAPI_list_add(tai_range_listList, tai_range_listItem); } - - OpenAPI_list_add(tai_range_listList, tai_range_listItem); - } } - cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "pgwFqdn"); - + pgw_fqdn = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "pgwFqdn"); if (pgw_fqdn) { - if (!cJSON_IsString(pgw_fqdn)) { + if (!cJSON_IsString(pgw_fqdn) && !cJSON_IsNull(pgw_fqdn)) { ogs_error("OpenAPI_smf_info_parseFromJSON() failed [pgw_fqdn]"); goto end; } } - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "accessType"); - - OpenAPI_list_t *access_typeList; + access_type = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "accessType"); if (access_type) { - cJSON *access_type_local_nonprimitive; - if (!cJSON_IsArray(access_type)) { - ogs_error("OpenAPI_smf_info_parseFromJSON() failed [access_type]"); - goto end; - } - - access_typeList = OpenAPI_list_create(); - - cJSON_ArrayForEach(access_type_local_nonprimitive, access_type ) { - if (!cJSON_IsString(access_type_local_nonprimitive)){ + cJSON *access_type_local = NULL; + if (!cJSON_IsArray(access_type)) { ogs_error("OpenAPI_smf_info_parseFromJSON() failed [access_type]"); goto end; } - OpenAPI_list_add(access_typeList, (void *)OpenAPI_access_type_FromString(access_type_local_nonprimitive->valuestring)); - } + access_typeList = OpenAPI_list_create(); + + cJSON_ArrayForEach(access_type_local, access_type) { + if (!cJSON_IsString(access_type_local)) { + ogs_error("OpenAPI_smf_info_parseFromJSON() failed [access_type]"); + goto end; + } + OpenAPI_list_add(access_typeList, (void *)OpenAPI_access_type_FromString(access_type_local->valuestring)); + } } - cJSON *priority = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "priority"); - + priority = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "priority"); if (priority) { if (!cJSON_IsNumber(priority)) { ogs_error("OpenAPI_smf_info_parseFromJSON() failed [priority]"); @@ -295,8 +298,7 @@ OpenAPI_smf_info_t *OpenAPI_smf_info_parseFromJSON(cJSON *smf_infoJSON) } } - cJSON *vsmf_support_ind = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "vsmfSupportInd"); - + vsmf_support_ind = cJSON_GetObjectItemCaseSensitive(smf_infoJSON, "vsmfSupportInd"); if (vsmf_support_ind) { if (!cJSON_IsBool(vsmf_support_ind)) { ogs_error("OpenAPI_smf_info_parseFromJSON() failed [vsmf_support_ind]"); @@ -308,7 +310,7 @@ OpenAPI_smf_info_t *OpenAPI_smf_info_parseFromJSON(cJSON *smf_infoJSON) s_nssai_smf_info_listList, tai_list ? tai_listList : NULL, tai_range_list ? tai_range_listList : NULL, - pgw_fqdn ? ogs_strdup(pgw_fqdn->valuestring) : NULL, + pgw_fqdn && !cJSON_IsNull(pgw_fqdn) ? ogs_strdup(pgw_fqdn->valuestring) : NULL, access_type ? access_typeList : NULL, priority ? true : false, priority ? priority->valuedouble : 0, @@ -318,6 +320,31 @@ OpenAPI_smf_info_t *OpenAPI_smf_info_parseFromJSON(cJSON *smf_infoJSON) return smf_info_local_var; end: + if (s_nssai_smf_info_listList) { + OpenAPI_list_for_each(s_nssai_smf_info_listList, node) { + OpenAPI_snssai_smf_info_item_free(node->data); + } + OpenAPI_list_free(s_nssai_smf_info_listList); + s_nssai_smf_info_listList = NULL; + } + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } + if (tai_range_listList) { + OpenAPI_list_for_each(tai_range_listList, node) { + OpenAPI_tai_range_free(node->data); + } + OpenAPI_list_free(tai_range_listList); + tai_range_listList = NULL; + } + if (access_typeList) { + OpenAPI_list_free(access_typeList); + access_typeList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_registration.c b/lib/sbi/openapi/model/smf_registration.c index 1b7eee39e..8820652dd 100644 --- a/lib/sbi/openapi/model/smf_registration.c +++ b/lib/sbi/openapi/model/smf_registration.c @@ -50,27 +50,62 @@ OpenAPI_smf_registration_t *OpenAPI_smf_registration_create( void OpenAPI_smf_registration_free(OpenAPI_smf_registration_t *smf_registration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_registration) { return; } - OpenAPI_lnode_t *node; - ogs_free(smf_registration->smf_instance_id); - ogs_free(smf_registration->smf_set_id); - ogs_free(smf_registration->supported_features); - OpenAPI_snssai_free(smf_registration->single_nssai); - ogs_free(smf_registration->dnn); - ogs_free(smf_registration->pcscf_restoration_callback_uri); - OpenAPI_plmn_id_free(smf_registration->plmn_id); - ogs_free(smf_registration->pgw_fqdn); - ogs_free(smf_registration->dereg_callback_uri); - ogs_free(smf_registration->registration_time); - OpenAPI_context_info_free(smf_registration->context_info); + if (smf_registration->smf_instance_id) { + ogs_free(smf_registration->smf_instance_id); + smf_registration->smf_instance_id = NULL; + } + if (smf_registration->smf_set_id) { + ogs_free(smf_registration->smf_set_id); + smf_registration->smf_set_id = NULL; + } + if (smf_registration->supported_features) { + ogs_free(smf_registration->supported_features); + smf_registration->supported_features = NULL; + } + if (smf_registration->single_nssai) { + OpenAPI_snssai_free(smf_registration->single_nssai); + smf_registration->single_nssai = NULL; + } + if (smf_registration->dnn) { + ogs_free(smf_registration->dnn); + smf_registration->dnn = NULL; + } + if (smf_registration->pcscf_restoration_callback_uri) { + ogs_free(smf_registration->pcscf_restoration_callback_uri); + smf_registration->pcscf_restoration_callback_uri = NULL; + } + if (smf_registration->plmn_id) { + OpenAPI_plmn_id_free(smf_registration->plmn_id); + smf_registration->plmn_id = NULL; + } + if (smf_registration->pgw_fqdn) { + ogs_free(smf_registration->pgw_fqdn); + smf_registration->pgw_fqdn = NULL; + } + if (smf_registration->dereg_callback_uri) { + ogs_free(smf_registration->dereg_callback_uri); + smf_registration->dereg_callback_uri = NULL; + } + if (smf_registration->registration_time) { + ogs_free(smf_registration->registration_time); + smf_registration->registration_time = NULL; + } + if (smf_registration->context_info) { + OpenAPI_context_info_free(smf_registration->context_info); + smf_registration->context_info = NULL; + } ogs_free(smf_registration); } cJSON *OpenAPI_smf_registration_convertToJSON(OpenAPI_smf_registration_t *smf_registration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_registration == NULL) { ogs_error("OpenAPI_smf_registration_convertToJSON() failed [SmfRegistration]"); @@ -78,6 +113,10 @@ cJSON *OpenAPI_smf_registration_convertToJSON(OpenAPI_smf_registration_t *smf_re } item = cJSON_CreateObject(); + if (!smf_registration->smf_instance_id) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [smf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smfInstanceId", smf_registration->smf_instance_id) == NULL) { ogs_error("OpenAPI_smf_registration_convertToJSON() failed [smf_instance_id]"); goto end; @@ -102,6 +141,10 @@ cJSON *OpenAPI_smf_registration_convertToJSON(OpenAPI_smf_registration_t *smf_re goto end; } + if (!smf_registration->single_nssai) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [single_nssai]"); + return NULL; + } cJSON *single_nssai_local_JSON = OpenAPI_snssai_convertToJSON(smf_registration->single_nssai); if (single_nssai_local_JSON == NULL) { ogs_error("OpenAPI_smf_registration_convertToJSON() failed [single_nssai]"); @@ -134,6 +177,10 @@ cJSON *OpenAPI_smf_registration_convertToJSON(OpenAPI_smf_registration_t *smf_re } } + if (!smf_registration->plmn_id) { + ogs_error("OpenAPI_smf_registration_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(smf_registration->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_smf_registration_convertToJSON() failed [plmn_id]"); @@ -166,7 +213,7 @@ cJSON *OpenAPI_smf_registration_convertToJSON(OpenAPI_smf_registration_t *smf_re } } - if (smf_registration->registration_reason) { + if (smf_registration->registration_reason != OpenAPI_registration_reason_NULL) { if (cJSON_AddStringToObject(item, "registrationReason", OpenAPI_registration_reason_ToString(smf_registration->registration_reason)) == NULL) { ogs_error("OpenAPI_smf_registration_convertToJSON() failed [registration_reason]"); goto end; @@ -200,66 +247,78 @@ end: OpenAPI_smf_registration_t *OpenAPI_smf_registration_parseFromJSON(cJSON *smf_registrationJSON) { OpenAPI_smf_registration_t *smf_registration_local_var = NULL; - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "smfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *smf_instance_id = NULL; + cJSON *smf_set_id = NULL; + cJSON *supported_features = NULL; + cJSON *pdu_session_id = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + cJSON *dnn = NULL; + cJSON *emergency_services = NULL; + cJSON *pcscf_restoration_callback_uri = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *pgw_fqdn = NULL; + cJSON *epdg_ind = NULL; + cJSON *dereg_callback_uri = NULL; + cJSON *registration_reason = NULL; + OpenAPI_registration_reason_e registration_reasonVariable = 0; + cJSON *registration_time = NULL; + cJSON *context_info = NULL; + OpenAPI_context_info_t *context_info_local_nonprim = NULL; + smf_instance_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "smfInstanceId"); if (!smf_instance_id) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [smf_instance_id]"); goto end; } - if (!cJSON_IsString(smf_instance_id)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [smf_instance_id]"); goto end; } - cJSON *smf_set_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "smfSetId"); - + smf_set_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "smfSetId"); if (smf_set_id) { - if (!cJSON_IsString(smf_set_id)) { + if (!cJSON_IsString(smf_set_id) && !cJSON_IsNull(smf_set_id)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [smf_set_id]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pduSessionId"); + pdu_session_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pduSessionId"); if (!pdu_session_id) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [pdu_session_id]"); goto end; } - if (!cJSON_IsNumber(pdu_session_id)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [pdu_session_id]"); goto end; } - cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "singleNssai"); + single_nssai = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "singleNssai"); if (!single_nssai) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [single_nssai]"); goto end; } - - OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *emergency_services = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "emergencyServices"); - + emergency_services = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "emergencyServices"); if (emergency_services) { if (!cJSON_IsBool(emergency_services)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [emergency_services]"); @@ -267,35 +326,30 @@ OpenAPI_smf_registration_t *OpenAPI_smf_registration_parseFromJSON(cJSON *smf_re } } - cJSON *pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pcscfRestorationCallbackUri"); - + pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pcscfRestorationCallbackUri"); if (pcscf_restoration_callback_uri) { - if (!cJSON_IsString(pcscf_restoration_callback_uri)) { + if (!cJSON_IsString(pcscf_restoration_callback_uri) && !cJSON_IsNull(pcscf_restoration_callback_uri)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]"); goto end; } } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "plmnId"); + plmn_id = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *pgw_fqdn = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pgwFqdn"); - + pgw_fqdn = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "pgwFqdn"); if (pgw_fqdn) { - if (!cJSON_IsString(pgw_fqdn)) { + if (!cJSON_IsString(pgw_fqdn) && !cJSON_IsNull(pgw_fqdn)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [pgw_fqdn]"); goto end; } } - cJSON *epdg_ind = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "epdgInd"); - + epdg_ind = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "epdgInd"); if (epdg_ind) { if (!cJSON_IsBool(epdg_ind)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [epdg_ind]"); @@ -303,18 +357,15 @@ OpenAPI_smf_registration_t *OpenAPI_smf_registration_parseFromJSON(cJSON *smf_re } } - cJSON *dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "deregCallbackUri"); - + dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "deregCallbackUri"); if (dereg_callback_uri) { - if (!cJSON_IsString(dereg_callback_uri)) { + if (!cJSON_IsString(dereg_callback_uri) && !cJSON_IsNull(dereg_callback_uri)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [dereg_callback_uri]"); goto end; } } - cJSON *registration_reason = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "registrationReason"); - - OpenAPI_registration_reason_e registration_reasonVariable; + registration_reason = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "registrationReason"); if (registration_reason) { if (!cJSON_IsString(registration_reason)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [registration_reason]"); @@ -323,45 +374,54 @@ OpenAPI_smf_registration_t *OpenAPI_smf_registration_parseFromJSON(cJSON *smf_re registration_reasonVariable = OpenAPI_registration_reason_FromString(registration_reason->valuestring); } - cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "registrationTime"); - + registration_time = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "registrationTime"); if (registration_time) { - if (!cJSON_IsString(registration_time)) { + if (!cJSON_IsString(registration_time) && !cJSON_IsNull(registration_time)) { ogs_error("OpenAPI_smf_registration_parseFromJSON() failed [registration_time]"); goto end; } } - cJSON *context_info = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "contextInfo"); - - OpenAPI_context_info_t *context_info_local_nonprim = NULL; + context_info = cJSON_GetObjectItemCaseSensitive(smf_registrationJSON, "contextInfo"); if (context_info) { context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info); } smf_registration_local_var = OpenAPI_smf_registration_create ( ogs_strdup(smf_instance_id->valuestring), - smf_set_id ? ogs_strdup(smf_set_id->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + smf_set_id && !cJSON_IsNull(smf_set_id) ? ogs_strdup(smf_set_id->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, pdu_session_id->valuedouble, single_nssai_local_nonprim, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, emergency_services ? true : false, emergency_services ? emergency_services->valueint : 0, - pcscf_restoration_callback_uri ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, + pcscf_restoration_callback_uri && !cJSON_IsNull(pcscf_restoration_callback_uri) ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL, plmn_id_local_nonprim, - pgw_fqdn ? ogs_strdup(pgw_fqdn->valuestring) : NULL, + pgw_fqdn && !cJSON_IsNull(pgw_fqdn) ? ogs_strdup(pgw_fqdn->valuestring) : NULL, epdg_ind ? true : false, epdg_ind ? epdg_ind->valueint : 0, - dereg_callback_uri ? ogs_strdup(dereg_callback_uri->valuestring) : NULL, + dereg_callback_uri && !cJSON_IsNull(dereg_callback_uri) ? ogs_strdup(dereg_callback_uri->valuestring) : NULL, registration_reason ? registration_reasonVariable : 0, - registration_time ? ogs_strdup(registration_time->valuestring) : NULL, + registration_time && !cJSON_IsNull(registration_time) ? ogs_strdup(registration_time->valuestring) : NULL, context_info ? context_info_local_nonprim : NULL ); return smf_registration_local_var; end: + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (context_info_local_nonprim) { + OpenAPI_context_info_free(context_info_local_nonprim); + context_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_registration_info.c b/lib/sbi/openapi/model/smf_registration_info.c index 4e54dce8c..dfd8c2046 100644 --- a/lib/sbi/openapi/model/smf_registration_info.c +++ b/lib/sbi/openapi/model/smf_registration_info.c @@ -18,20 +18,25 @@ OpenAPI_smf_registration_info_t *OpenAPI_smf_registration_info_create( void OpenAPI_smf_registration_info_free(OpenAPI_smf_registration_info_t *smf_registration_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_registration_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(smf_registration_info->smf_registration_list, node) { - OpenAPI_smf_registration_free(node->data); + if (smf_registration_info->smf_registration_list) { + OpenAPI_list_for_each(smf_registration_info->smf_registration_list, node) { + OpenAPI_smf_registration_free(node->data); + } + OpenAPI_list_free(smf_registration_info->smf_registration_list); + smf_registration_info->smf_registration_list = NULL; } - OpenAPI_list_free(smf_registration_info->smf_registration_list); ogs_free(smf_registration_info); } cJSON *OpenAPI_smf_registration_info_convertToJSON(OpenAPI_smf_registration_info_t *smf_registration_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_registration_info == NULL) { ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [SmfRegistrationInfo]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_smf_registration_info_convertToJSON(OpenAPI_smf_registration_info } item = cJSON_CreateObject(); + if (!smf_registration_info->smf_registration_list) { + ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [smf_registration_list]"); + return NULL; + } cJSON *smf_registration_listList = cJSON_AddArrayToObject(item, "smfRegistrationList"); if (smf_registration_listList == NULL) { ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [smf_registration_list]"); goto end; } - - OpenAPI_lnode_t *smf_registration_list_node; - if (smf_registration_info->smf_registration_list) { - OpenAPI_list_for_each(smf_registration_info->smf_registration_list, smf_registration_list_node) { - cJSON *itemLocal = OpenAPI_smf_registration_convertToJSON(smf_registration_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [smf_registration_list]"); - goto end; - } - cJSON_AddItemToArray(smf_registration_listList, itemLocal); + OpenAPI_list_for_each(smf_registration_info->smf_registration_list, node) { + cJSON *itemLocal = OpenAPI_smf_registration_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_registration_info_convertToJSON() failed [smf_registration_list]"); + goto end; } + cJSON_AddItemToArray(smf_registration_listList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_smf_registration_info_t *OpenAPI_smf_registration_info_parseFromJSON(cJSON *smf_registration_infoJSON) { OpenAPI_smf_registration_info_t *smf_registration_info_local_var = NULL; - cJSON *smf_registration_list = cJSON_GetObjectItemCaseSensitive(smf_registration_infoJSON, "smfRegistrationList"); + OpenAPI_lnode_t *node = NULL; + cJSON *smf_registration_list = NULL; + OpenAPI_list_t *smf_registration_listList = NULL; + smf_registration_list = cJSON_GetObjectItemCaseSensitive(smf_registration_infoJSON, "smfRegistrationList"); if (!smf_registration_list) { ogs_error("OpenAPI_smf_registration_info_parseFromJSON() failed [smf_registration_list]"); goto end; } - - OpenAPI_list_t *smf_registration_listList; - cJSON *smf_registration_list_local_nonprimitive; - if (!cJSON_IsArray(smf_registration_list)){ - ogs_error("OpenAPI_smf_registration_info_parseFromJSON() failed [smf_registration_list]"); - goto end; - } - - smf_registration_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(smf_registration_list_local_nonprimitive, smf_registration_list ) { - if (!cJSON_IsObject(smf_registration_list_local_nonprimitive)) { + cJSON *smf_registration_list_local = NULL; + if (!cJSON_IsArray(smf_registration_list)) { ogs_error("OpenAPI_smf_registration_info_parseFromJSON() failed [smf_registration_list]"); goto end; } - OpenAPI_smf_registration_t *smf_registration_listItem = OpenAPI_smf_registration_parseFromJSON(smf_registration_list_local_nonprimitive); - if (!smf_registration_listItem) { - ogs_error("No smf_registration_listItem"); - OpenAPI_list_free(smf_registration_listList); - goto end; + smf_registration_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_registration_list_local, smf_registration_list) { + if (!cJSON_IsObject(smf_registration_list_local)) { + ogs_error("OpenAPI_smf_registration_info_parseFromJSON() failed [smf_registration_list]"); + goto end; + } + OpenAPI_smf_registration_t *smf_registration_listItem = OpenAPI_smf_registration_parseFromJSON(smf_registration_list_local); + if (!smf_registration_listItem) { + ogs_error("No smf_registration_listItem"); + OpenAPI_list_free(smf_registration_listList); + goto end; + } + OpenAPI_list_add(smf_registration_listList, smf_registration_listItem); } - OpenAPI_list_add(smf_registration_listList, smf_registration_listItem); - } - smf_registration_info_local_var = OpenAPI_smf_registration_info_create ( smf_registration_listList ); return smf_registration_info_local_var; end: + if (smf_registration_listList) { + OpenAPI_list_for_each(smf_registration_listList, node) { + OpenAPI_smf_registration_free(node->data); + } + OpenAPI_list_free(smf_registration_listList); + smf_registration_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_selection_data.c b/lib/sbi/openapi/model/smf_selection_data.c index f3ccc7220..e87c3cb93 100644 --- a/lib/sbi/openapi/model/smf_selection_data.c +++ b/lib/sbi/openapi/model/smf_selection_data.c @@ -28,26 +28,40 @@ OpenAPI_smf_selection_data_t *OpenAPI_smf_selection_data_create( void OpenAPI_smf_selection_data_free(OpenAPI_smf_selection_data_t *smf_selection_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_selection_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(smf_selection_data->candidates, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_candidate_for_replacement_free(localKeyValue->value); - ogs_free(localKeyValue); + if (smf_selection_data->candidates) { + OpenAPI_list_for_each(smf_selection_data->candidates, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_candidate_for_replacement_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(smf_selection_data->candidates); + smf_selection_data->candidates = NULL; + } + if (smf_selection_data->snssai) { + OpenAPI_snssai_free(smf_selection_data->snssai); + smf_selection_data->snssai = NULL; + } + if (smf_selection_data->mapping_snssai) { + OpenAPI_snssai_free(smf_selection_data->mapping_snssai); + smf_selection_data->mapping_snssai = NULL; + } + if (smf_selection_data->dnn) { + ogs_free(smf_selection_data->dnn); + smf_selection_data->dnn = NULL; } - OpenAPI_list_free(smf_selection_data->candidates); - OpenAPI_snssai_free(smf_selection_data->snssai); - OpenAPI_snssai_free(smf_selection_data->mapping_snssai); - ogs_free(smf_selection_data->dnn); ogs_free(smf_selection_data); } cJSON *OpenAPI_smf_selection_data_convertToJSON(OpenAPI_smf_selection_data_t *smf_selection_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_selection_data == NULL) { ogs_error("OpenAPI_smf_selection_data_convertToJSON() failed [SmfSelectionData]"); @@ -69,21 +83,20 @@ cJSON *OpenAPI_smf_selection_data_convertToJSON(OpenAPI_smf_selection_data_t *sm goto end; } cJSON *localMapObject = candidates; - OpenAPI_lnode_t *candidates_node; if (smf_selection_data->candidates) { - OpenAPI_list_for_each(smf_selection_data->candidates, candidates_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)candidates_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_candidate_for_replacement_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_smf_selection_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(smf_selection_data->candidates, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_candidate_for_replacement_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_selection_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (smf_selection_data->snssai) { cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(smf_selection_data->snssai); @@ -125,8 +138,16 @@ end: OpenAPI_smf_selection_data_t *OpenAPI_smf_selection_data_parseFromJSON(cJSON *smf_selection_dataJSON) { OpenAPI_smf_selection_data_t *smf_selection_data_local_var = NULL; - cJSON *unsupp_dnn = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "unsuppDnn"); - + OpenAPI_lnode_t *node = NULL; + cJSON *unsupp_dnn = NULL; + cJSON *candidates = NULL; + OpenAPI_list_t *candidatesList = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *mapping_snssai = NULL; + OpenAPI_snssai_t *mapping_snssai_local_nonprim = NULL; + cJSON *dnn = NULL; + unsupp_dnn = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "unsuppDnn"); if (unsupp_dnn) { if (!cJSON_IsBool(unsupp_dnn)) { ogs_error("OpenAPI_smf_selection_data_parseFromJSON() failed [unsupp_dnn]"); @@ -134,50 +155,45 @@ OpenAPI_smf_selection_data_t *OpenAPI_smf_selection_data_parseFromJSON(cJSON *sm } } - cJSON *candidates = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "candidates"); - - OpenAPI_list_t *candidatesList; + candidates = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "candidates"); if (candidates) { - cJSON *candidates_local_map; - if (!cJSON_IsObject(candidates)) { - ogs_error("OpenAPI_smf_selection_data_parseFromJSON() failed [candidates]"); - goto end; - } - candidatesList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(candidates_local_map, candidates) { - cJSON *localMapObject = candidates_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_candidate_for_replacement_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_smf_selection_data_parseFromJSON() failed [inner]"); + cJSON *candidates_local_map = NULL; + if (!cJSON_IsObject(candidates) && !cJSON_IsNull(candidates)) { + ogs_error("OpenAPI_smf_selection_data_parseFromJSON() failed [candidates]"); goto end; } - OpenAPI_list_add(candidatesList, localMapKeyPair); - } + if (cJSON_IsObject(candidates)) { + candidatesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(candidates_local_map, candidates) { + cJSON *localMapObject = candidates_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_candidate_for_replacement_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_smf_selection_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(candidatesList, localMapKeyPair); + } + } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "snssai"); - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "snssai"); if (snssai) { snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); } - cJSON *mapping_snssai = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "mappingSnssai"); - - OpenAPI_snssai_t *mapping_snssai_local_nonprim = NULL; + mapping_snssai = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "mappingSnssai"); if (mapping_snssai) { mapping_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(mapping_snssai); } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(smf_selection_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_smf_selection_data_parseFromJSON() failed [dnn]"); goto end; } @@ -189,11 +205,29 @@ OpenAPI_smf_selection_data_t *OpenAPI_smf_selection_data_parseFromJSON(cJSON *sm candidates ? candidatesList : NULL, snssai ? snssai_local_nonprim : NULL, mapping_snssai ? mapping_snssai_local_nonprim : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL ); return smf_selection_data_local_var; end: + if (candidatesList) { + OpenAPI_list_for_each(candidatesList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_candidate_for_replacement_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(candidatesList); + candidatesList = NULL; + } + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (mapping_snssai_local_nonprim) { + OpenAPI_snssai_free(mapping_snssai_local_nonprim); + mapping_snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_selection_subscription_data.c b/lib/sbi/openapi/model/smf_selection_subscription_data.c index f6a02da7c..5c16e76f9 100644 --- a/lib/sbi/openapi/model/smf_selection_subscription_data.c +++ b/lib/sbi/openapi/model/smf_selection_subscription_data.c @@ -22,25 +22,36 @@ OpenAPI_smf_selection_subscription_data_t *OpenAPI_smf_selection_subscription_da void OpenAPI_smf_selection_subscription_data_free(OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_selection_subscription_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(smf_selection_subscription_data->supported_features); - OpenAPI_list_for_each(smf_selection_subscription_data->subscribed_snssai_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_snssai_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (smf_selection_subscription_data->supported_features) { + ogs_free(smf_selection_subscription_data->supported_features); + smf_selection_subscription_data->supported_features = NULL; + } + if (smf_selection_subscription_data->subscribed_snssai_infos) { + OpenAPI_list_for_each(smf_selection_subscription_data->subscribed_snssai_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_snssai_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(smf_selection_subscription_data->subscribed_snssai_infos); + smf_selection_subscription_data->subscribed_snssai_infos = NULL; + } + if (smf_selection_subscription_data->shared_snssai_infos_id) { + ogs_free(smf_selection_subscription_data->shared_snssai_infos_id); + smf_selection_subscription_data->shared_snssai_infos_id = NULL; } - OpenAPI_list_free(smf_selection_subscription_data->subscribed_snssai_infos); - ogs_free(smf_selection_subscription_data->shared_snssai_infos_id); ogs_free(smf_selection_subscription_data); } cJSON *OpenAPI_smf_selection_subscription_data_convertToJSON(OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_selection_subscription_data == NULL) { ogs_error("OpenAPI_smf_selection_subscription_data_convertToJSON() failed [SmfSelectionSubscriptionData]"); @@ -62,21 +73,20 @@ cJSON *OpenAPI_smf_selection_subscription_data_convertToJSON(OpenAPI_smf_selecti goto end; } cJSON *localMapObject = subscribed_snssai_infos; - OpenAPI_lnode_t *subscribed_snssai_infos_node; if (smf_selection_subscription_data->subscribed_snssai_infos) { - OpenAPI_list_for_each(smf_selection_subscription_data->subscribed_snssai_infos, subscribed_snssai_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)subscribed_snssai_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_snssai_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_smf_selection_subscription_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(smf_selection_subscription_data->subscribed_snssai_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_snssai_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_selection_subscription_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (smf_selection_subscription_data->shared_snssai_infos_id) { if (cJSON_AddStringToObject(item, "sharedSnssaiInfosId", smf_selection_subscription_data->shared_snssai_infos_id) == NULL) { @@ -92,58 +102,71 @@ end: OpenAPI_smf_selection_subscription_data_t *OpenAPI_smf_selection_subscription_data_parseFromJSON(cJSON *smf_selection_subscription_dataJSON) { OpenAPI_smf_selection_subscription_data_t *smf_selection_subscription_data_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *subscribed_snssai_infos = NULL; + OpenAPI_list_t *subscribed_snssai_infosList = NULL; + cJSON *shared_snssai_infos_id = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *subscribed_snssai_infos = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "subscribedSnssaiInfos"); - - OpenAPI_list_t *subscribed_snssai_infosList; + subscribed_snssai_infos = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "subscribedSnssaiInfos"); if (subscribed_snssai_infos) { - cJSON *subscribed_snssai_infos_local_map; - if (!cJSON_IsObject(subscribed_snssai_infos)) { - ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [subscribed_snssai_infos]"); - goto end; - } - subscribed_snssai_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(subscribed_snssai_infos_local_map, subscribed_snssai_infos) { - cJSON *localMapObject = subscribed_snssai_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_snssai_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [inner]"); + cJSON *subscribed_snssai_infos_local_map = NULL; + if (!cJSON_IsObject(subscribed_snssai_infos) && !cJSON_IsNull(subscribed_snssai_infos)) { + ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [subscribed_snssai_infos]"); goto end; } - OpenAPI_list_add(subscribed_snssai_infosList, localMapKeyPair); - } + if (cJSON_IsObject(subscribed_snssai_infos)) { + subscribed_snssai_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(subscribed_snssai_infos_local_map, subscribed_snssai_infos) { + cJSON *localMapObject = subscribed_snssai_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_snssai_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(subscribed_snssai_infosList, localMapKeyPair); + } + } } - cJSON *shared_snssai_infos_id = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "sharedSnssaiInfosId"); - + shared_snssai_infos_id = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_dataJSON, "sharedSnssaiInfosId"); if (shared_snssai_infos_id) { - if (!cJSON_IsString(shared_snssai_infos_id)) { + if (!cJSON_IsString(shared_snssai_infos_id) && !cJSON_IsNull(shared_snssai_infos_id)) { ogs_error("OpenAPI_smf_selection_subscription_data_parseFromJSON() failed [shared_snssai_infos_id]"); goto end; } } smf_selection_subscription_data_local_var = OpenAPI_smf_selection_subscription_data_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, subscribed_snssai_infos ? subscribed_snssai_infosList : NULL, - shared_snssai_infos_id ? ogs_strdup(shared_snssai_infos_id->valuestring) : NULL + shared_snssai_infos_id && !cJSON_IsNull(shared_snssai_infos_id) ? ogs_strdup(shared_snssai_infos_id->valuestring) : NULL ); return smf_selection_subscription_data_local_var; end: + if (subscribed_snssai_infosList) { + OpenAPI_list_for_each(subscribed_snssai_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_snssai_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(subscribed_snssai_infosList); + subscribed_snssai_infosList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_selection_subscription_data_1.c b/lib/sbi/openapi/model/smf_selection_subscription_data_1.c index eddaa1c7a..c8db849fd 100644 --- a/lib/sbi/openapi/model/smf_selection_subscription_data_1.c +++ b/lib/sbi/openapi/model/smf_selection_subscription_data_1.c @@ -22,25 +22,36 @@ OpenAPI_smf_selection_subscription_data_1_t *OpenAPI_smf_selection_subscription_ void OpenAPI_smf_selection_subscription_data_1_free(OpenAPI_smf_selection_subscription_data_1_t *smf_selection_subscription_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_selection_subscription_data_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(smf_selection_subscription_data_1->supported_features); - OpenAPI_list_for_each(smf_selection_subscription_data_1->subscribed_snssai_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_snssai_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (smf_selection_subscription_data_1->supported_features) { + ogs_free(smf_selection_subscription_data_1->supported_features); + smf_selection_subscription_data_1->supported_features = NULL; + } + if (smf_selection_subscription_data_1->subscribed_snssai_infos) { + OpenAPI_list_for_each(smf_selection_subscription_data_1->subscribed_snssai_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_snssai_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(smf_selection_subscription_data_1->subscribed_snssai_infos); + smf_selection_subscription_data_1->subscribed_snssai_infos = NULL; + } + if (smf_selection_subscription_data_1->shared_snssai_infos_id) { + ogs_free(smf_selection_subscription_data_1->shared_snssai_infos_id); + smf_selection_subscription_data_1->shared_snssai_infos_id = NULL; } - OpenAPI_list_free(smf_selection_subscription_data_1->subscribed_snssai_infos); - ogs_free(smf_selection_subscription_data_1->shared_snssai_infos_id); ogs_free(smf_selection_subscription_data_1); } cJSON *OpenAPI_smf_selection_subscription_data_1_convertToJSON(OpenAPI_smf_selection_subscription_data_1_t *smf_selection_subscription_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_selection_subscription_data_1 == NULL) { ogs_error("OpenAPI_smf_selection_subscription_data_1_convertToJSON() failed [SmfSelectionSubscriptionData_1]"); @@ -62,21 +73,20 @@ cJSON *OpenAPI_smf_selection_subscription_data_1_convertToJSON(OpenAPI_smf_selec goto end; } cJSON *localMapObject = subscribed_snssai_infos; - OpenAPI_lnode_t *subscribed_snssai_infos_node; if (smf_selection_subscription_data_1->subscribed_snssai_infos) { - OpenAPI_list_for_each(smf_selection_subscription_data_1->subscribed_snssai_infos, subscribed_snssai_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)subscribed_snssai_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_snssai_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_smf_selection_subscription_data_1_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(smf_selection_subscription_data_1->subscribed_snssai_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_snssai_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_selection_subscription_data_1_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (smf_selection_subscription_data_1->shared_snssai_infos_id) { if (cJSON_AddStringToObject(item, "sharedSnssaiInfosId", smf_selection_subscription_data_1->shared_snssai_infos_id) == NULL) { @@ -92,58 +102,71 @@ end: OpenAPI_smf_selection_subscription_data_1_t *OpenAPI_smf_selection_subscription_data_1_parseFromJSON(cJSON *smf_selection_subscription_data_1JSON) { OpenAPI_smf_selection_subscription_data_1_t *smf_selection_subscription_data_1_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_data_1JSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *subscribed_snssai_infos = NULL; + OpenAPI_list_t *subscribed_snssai_infosList = NULL; + cJSON *shared_snssai_infos_id = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_data_1JSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_smf_selection_subscription_data_1_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *subscribed_snssai_infos = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_data_1JSON, "subscribedSnssaiInfos"); - - OpenAPI_list_t *subscribed_snssai_infosList; + subscribed_snssai_infos = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_data_1JSON, "subscribedSnssaiInfos"); if (subscribed_snssai_infos) { - cJSON *subscribed_snssai_infos_local_map; - if (!cJSON_IsObject(subscribed_snssai_infos)) { - ogs_error("OpenAPI_smf_selection_subscription_data_1_parseFromJSON() failed [subscribed_snssai_infos]"); - goto end; - } - subscribed_snssai_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(subscribed_snssai_infos_local_map, subscribed_snssai_infos) { - cJSON *localMapObject = subscribed_snssai_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_snssai_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_smf_selection_subscription_data_1_parseFromJSON() failed [inner]"); + cJSON *subscribed_snssai_infos_local_map = NULL; + if (!cJSON_IsObject(subscribed_snssai_infos) && !cJSON_IsNull(subscribed_snssai_infos)) { + ogs_error("OpenAPI_smf_selection_subscription_data_1_parseFromJSON() failed [subscribed_snssai_infos]"); goto end; } - OpenAPI_list_add(subscribed_snssai_infosList, localMapKeyPair); - } + if (cJSON_IsObject(subscribed_snssai_infos)) { + subscribed_snssai_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(subscribed_snssai_infos_local_map, subscribed_snssai_infos) { + cJSON *localMapObject = subscribed_snssai_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_snssai_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_smf_selection_subscription_data_1_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(subscribed_snssai_infosList, localMapKeyPair); + } + } } - cJSON *shared_snssai_infos_id = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_data_1JSON, "sharedSnssaiInfosId"); - + shared_snssai_infos_id = cJSON_GetObjectItemCaseSensitive(smf_selection_subscription_data_1JSON, "sharedSnssaiInfosId"); if (shared_snssai_infos_id) { - if (!cJSON_IsString(shared_snssai_infos_id)) { + if (!cJSON_IsString(shared_snssai_infos_id) && !cJSON_IsNull(shared_snssai_infos_id)) { ogs_error("OpenAPI_smf_selection_subscription_data_1_parseFromJSON() failed [shared_snssai_infos_id]"); goto end; } } smf_selection_subscription_data_1_local_var = OpenAPI_smf_selection_subscription_data_1_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, subscribed_snssai_infos ? subscribed_snssai_infosList : NULL, - shared_snssai_infos_id ? ogs_strdup(shared_snssai_infos_id->valuestring) : NULL + shared_snssai_infos_id && !cJSON_IsNull(shared_snssai_infos_id) ? ogs_strdup(shared_snssai_infos_id->valuestring) : NULL ); return smf_selection_subscription_data_1_local_var; end: + if (subscribed_snssai_infosList) { + OpenAPI_list_for_each(subscribed_snssai_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_snssai_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(subscribed_snssai_infosList); + subscribed_snssai_infosList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_subscription_info.c b/lib/sbi/openapi/model/smf_subscription_info.c index 961529839..1d25a51e3 100644 --- a/lib/sbi/openapi/model/smf_subscription_info.c +++ b/lib/sbi/openapi/model/smf_subscription_info.c @@ -18,20 +18,25 @@ OpenAPI_smf_subscription_info_t *OpenAPI_smf_subscription_info_create( void OpenAPI_smf_subscription_info_free(OpenAPI_smf_subscription_info_t *smf_subscription_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_subscription_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(smf_subscription_info->smf_subscription_list, node) { - OpenAPI_smf_subscription_item_free(node->data); + if (smf_subscription_info->smf_subscription_list) { + OpenAPI_list_for_each(smf_subscription_info->smf_subscription_list, node) { + OpenAPI_smf_subscription_item_free(node->data); + } + OpenAPI_list_free(smf_subscription_info->smf_subscription_list); + smf_subscription_info->smf_subscription_list = NULL; } - OpenAPI_list_free(smf_subscription_info->smf_subscription_list); ogs_free(smf_subscription_info); } cJSON *OpenAPI_smf_subscription_info_convertToJSON(OpenAPI_smf_subscription_info_t *smf_subscription_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_subscription_info == NULL) { ogs_error("OpenAPI_smf_subscription_info_convertToJSON() failed [SmfSubscriptionInfo]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_smf_subscription_info_convertToJSON(OpenAPI_smf_subscription_info } item = cJSON_CreateObject(); + if (!smf_subscription_info->smf_subscription_list) { + ogs_error("OpenAPI_smf_subscription_info_convertToJSON() failed [smf_subscription_list]"); + return NULL; + } cJSON *smf_subscription_listList = cJSON_AddArrayToObject(item, "smfSubscriptionList"); if (smf_subscription_listList == NULL) { ogs_error("OpenAPI_smf_subscription_info_convertToJSON() failed [smf_subscription_list]"); goto end; } - - OpenAPI_lnode_t *smf_subscription_list_node; - if (smf_subscription_info->smf_subscription_list) { - OpenAPI_list_for_each(smf_subscription_info->smf_subscription_list, smf_subscription_list_node) { - cJSON *itemLocal = OpenAPI_smf_subscription_item_convertToJSON(smf_subscription_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_smf_subscription_info_convertToJSON() failed [smf_subscription_list]"); - goto end; - } - cJSON_AddItemToArray(smf_subscription_listList, itemLocal); + OpenAPI_list_for_each(smf_subscription_info->smf_subscription_list, node) { + cJSON *itemLocal = OpenAPI_smf_subscription_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_smf_subscription_info_convertToJSON() failed [smf_subscription_list]"); + goto end; } + cJSON_AddItemToArray(smf_subscription_listList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_smf_subscription_info_t *OpenAPI_smf_subscription_info_parseFromJSON(cJSON *smf_subscription_infoJSON) { OpenAPI_smf_subscription_info_t *smf_subscription_info_local_var = NULL; - cJSON *smf_subscription_list = cJSON_GetObjectItemCaseSensitive(smf_subscription_infoJSON, "smfSubscriptionList"); + OpenAPI_lnode_t *node = NULL; + cJSON *smf_subscription_list = NULL; + OpenAPI_list_t *smf_subscription_listList = NULL; + smf_subscription_list = cJSON_GetObjectItemCaseSensitive(smf_subscription_infoJSON, "smfSubscriptionList"); if (!smf_subscription_list) { ogs_error("OpenAPI_smf_subscription_info_parseFromJSON() failed [smf_subscription_list]"); goto end; } - - OpenAPI_list_t *smf_subscription_listList; - cJSON *smf_subscription_list_local_nonprimitive; - if (!cJSON_IsArray(smf_subscription_list)){ - ogs_error("OpenAPI_smf_subscription_info_parseFromJSON() failed [smf_subscription_list]"); - goto end; - } - - smf_subscription_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(smf_subscription_list_local_nonprimitive, smf_subscription_list ) { - if (!cJSON_IsObject(smf_subscription_list_local_nonprimitive)) { + cJSON *smf_subscription_list_local = NULL; + if (!cJSON_IsArray(smf_subscription_list)) { ogs_error("OpenAPI_smf_subscription_info_parseFromJSON() failed [smf_subscription_list]"); goto end; } - OpenAPI_smf_subscription_item_t *smf_subscription_listItem = OpenAPI_smf_subscription_item_parseFromJSON(smf_subscription_list_local_nonprimitive); - if (!smf_subscription_listItem) { - ogs_error("No smf_subscription_listItem"); - OpenAPI_list_free(smf_subscription_listList); - goto end; + smf_subscription_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_subscription_list_local, smf_subscription_list) { + if (!cJSON_IsObject(smf_subscription_list_local)) { + ogs_error("OpenAPI_smf_subscription_info_parseFromJSON() failed [smf_subscription_list]"); + goto end; + } + OpenAPI_smf_subscription_item_t *smf_subscription_listItem = OpenAPI_smf_subscription_item_parseFromJSON(smf_subscription_list_local); + if (!smf_subscription_listItem) { + ogs_error("No smf_subscription_listItem"); + OpenAPI_list_free(smf_subscription_listList); + goto end; + } + OpenAPI_list_add(smf_subscription_listList, smf_subscription_listItem); } - OpenAPI_list_add(smf_subscription_listList, smf_subscription_listItem); - } - smf_subscription_info_local_var = OpenAPI_smf_subscription_info_create ( smf_subscription_listList ); return smf_subscription_info_local_var; end: + if (smf_subscription_listList) { + OpenAPI_list_for_each(smf_subscription_listList, node) { + OpenAPI_smf_subscription_item_free(node->data); + } + OpenAPI_list_free(smf_subscription_listList); + smf_subscription_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smf_subscription_item.c b/lib/sbi/openapi/model/smf_subscription_item.c index 3d5d9af2e..c36aaa915 100644 --- a/lib/sbi/openapi/model/smf_subscription_item.c +++ b/lib/sbi/openapi/model/smf_subscription_item.c @@ -20,18 +20,26 @@ OpenAPI_smf_subscription_item_t *OpenAPI_smf_subscription_item_create( void OpenAPI_smf_subscription_item_free(OpenAPI_smf_subscription_item_t *smf_subscription_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smf_subscription_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(smf_subscription_item->smf_instance_id); - ogs_free(smf_subscription_item->subscription_id); + if (smf_subscription_item->smf_instance_id) { + ogs_free(smf_subscription_item->smf_instance_id); + smf_subscription_item->smf_instance_id = NULL; + } + if (smf_subscription_item->subscription_id) { + ogs_free(smf_subscription_item->subscription_id); + smf_subscription_item->subscription_id = NULL; + } ogs_free(smf_subscription_item); } cJSON *OpenAPI_smf_subscription_item_convertToJSON(OpenAPI_smf_subscription_item_t *smf_subscription_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smf_subscription_item == NULL) { ogs_error("OpenAPI_smf_subscription_item_convertToJSON() failed [SmfSubscriptionItem]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_smf_subscription_item_convertToJSON(OpenAPI_smf_subscription_item } item = cJSON_CreateObject(); + if (!smf_subscription_item->smf_instance_id) { + ogs_error("OpenAPI_smf_subscription_item_convertToJSON() failed [smf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smfInstanceId", smf_subscription_item->smf_instance_id) == NULL) { ogs_error("OpenAPI_smf_subscription_item_convertToJSON() failed [smf_instance_id]"); goto end; } + if (!smf_subscription_item->subscription_id) { + ogs_error("OpenAPI_smf_subscription_item_convertToJSON() failed [subscription_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "subscriptionId", smf_subscription_item->subscription_id) == NULL) { ogs_error("OpenAPI_smf_subscription_item_convertToJSON() failed [subscription_id]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_smf_subscription_item_t *OpenAPI_smf_subscription_item_parseFromJSON(cJSON *smf_subscription_itemJSON) { OpenAPI_smf_subscription_item_t *smf_subscription_item_local_var = NULL; - cJSON *smf_instance_id = cJSON_GetObjectItemCaseSensitive(smf_subscription_itemJSON, "smfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *smf_instance_id = NULL; + cJSON *subscription_id = NULL; + smf_instance_id = cJSON_GetObjectItemCaseSensitive(smf_subscription_itemJSON, "smfInstanceId"); if (!smf_instance_id) { ogs_error("OpenAPI_smf_subscription_item_parseFromJSON() failed [smf_instance_id]"); goto end; } - if (!cJSON_IsString(smf_instance_id)) { ogs_error("OpenAPI_smf_subscription_item_parseFromJSON() failed [smf_instance_id]"); goto end; } - cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(smf_subscription_itemJSON, "subscriptionId"); + subscription_id = cJSON_GetObjectItemCaseSensitive(smf_subscription_itemJSON, "subscriptionId"); if (!subscription_id) { ogs_error("OpenAPI_smf_subscription_item_parseFromJSON() failed [subscription_id]"); goto end; } - if (!cJSON_IsString(subscription_id)) { ogs_error("OpenAPI_smf_subscription_item_parseFromJSON() failed [subscription_id]"); goto end; diff --git a/lib/sbi/openapi/model/sms_management_subscription_data.c b/lib/sbi/openapi/model/sms_management_subscription_data.c index 03f3bfab2..7fb4e7bd4 100644 --- a/lib/sbi/openapi/model/sms_management_subscription_data.c +++ b/lib/sbi/openapi/model/sms_management_subscription_data.c @@ -19,7 +19,7 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ bool is_mo_sms_barring_roaming, int mo_sms_barring_roaming, OpenAPI_list_t *shared_sms_mng_data_ids, - OpenAPI_trace_data_1_t *trace_data + OpenAPI_trace_data_t *trace_data ) { OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data_local_var = ogs_malloc(sizeof(OpenAPI_sms_management_subscription_data_t)); @@ -46,22 +46,33 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ void OpenAPI_sms_management_subscription_data_free(OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sms_management_subscription_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(sms_management_subscription_data->supported_features); - OpenAPI_list_for_each(sms_management_subscription_data->shared_sms_mng_data_ids, node) { - ogs_free(node->data); + if (sms_management_subscription_data->supported_features) { + ogs_free(sms_management_subscription_data->supported_features); + sms_management_subscription_data->supported_features = NULL; + } + if (sms_management_subscription_data->shared_sms_mng_data_ids) { + OpenAPI_list_for_each(sms_management_subscription_data->shared_sms_mng_data_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sms_management_subscription_data->shared_sms_mng_data_ids); + sms_management_subscription_data->shared_sms_mng_data_ids = NULL; + } + if (sms_management_subscription_data->trace_data) { + OpenAPI_trace_data_free(sms_management_subscription_data->trace_data); + sms_management_subscription_data->trace_data = NULL; } - OpenAPI_list_free(sms_management_subscription_data->shared_sms_mng_data_ids); - OpenAPI_trace_data_1_free(sms_management_subscription_data->trace_data); ogs_free(sms_management_subscription_data); } cJSON *OpenAPI_sms_management_subscription_data_convertToJSON(OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sms_management_subscription_data == NULL) { ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [SmsManagementSubscriptionData]"); @@ -119,23 +130,21 @@ cJSON *OpenAPI_sms_management_subscription_data_convertToJSON(OpenAPI_sms_manage } if (sms_management_subscription_data->shared_sms_mng_data_ids) { - cJSON *shared_sms_mng_data_ids = cJSON_AddArrayToObject(item, "sharedSmsMngDataIds"); - if (shared_sms_mng_data_ids == NULL) { + cJSON *shared_sms_mng_data_idsList = cJSON_AddArrayToObject(item, "sharedSmsMngDataIds"); + if (shared_sms_mng_data_idsList == NULL) { ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [shared_sms_mng_data_ids]"); goto end; } - - OpenAPI_lnode_t *shared_sms_mng_data_ids_node; - OpenAPI_list_for_each(sms_management_subscription_data->shared_sms_mng_data_ids, shared_sms_mng_data_ids_node) { - if (cJSON_AddStringToObject(shared_sms_mng_data_ids, "", (char*)shared_sms_mng_data_ids_node->data) == NULL) { - ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [shared_sms_mng_data_ids]"); - goto end; + OpenAPI_list_for_each(sms_management_subscription_data->shared_sms_mng_data_ids, node) { + if (cJSON_AddStringToObject(shared_sms_mng_data_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } } - } } if (sms_management_subscription_data->trace_data) { - cJSON *trace_data_local_JSON = OpenAPI_trace_data_1_convertToJSON(sms_management_subscription_data->trace_data); + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(sms_management_subscription_data->trace_data); if (trace_data_local_JSON == NULL) { ogs_error("OpenAPI_sms_management_subscription_data_convertToJSON() failed [trace_data]"); goto end; @@ -154,17 +163,27 @@ end: OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_data_parseFromJSON(cJSON *sms_management_subscription_dataJSON) { OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *mt_sms_subscribed = NULL; + cJSON *mt_sms_barring_all = NULL; + cJSON *mt_sms_barring_roaming = NULL; + cJSON *mo_sms_subscribed = NULL; + cJSON *mo_sms_barring_all = NULL; + cJSON *mo_sms_barring_roaming = NULL; + cJSON *shared_sms_mng_data_ids = NULL; + OpenAPI_list_t *shared_sms_mng_data_idsList = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *mt_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsSubscribed"); - + mt_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsSubscribed"); if (mt_sms_subscribed) { if (!cJSON_IsBool(mt_sms_subscribed)) { ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mt_sms_subscribed]"); @@ -172,8 +191,7 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ } } - cJSON *mt_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsBarringAll"); - + mt_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsBarringAll"); if (mt_sms_barring_all) { if (!cJSON_IsBool(mt_sms_barring_all)) { ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mt_sms_barring_all]"); @@ -181,8 +199,7 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ } } - cJSON *mt_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsBarringRoaming"); - + mt_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "mtSmsBarringRoaming"); if (mt_sms_barring_roaming) { if (!cJSON_IsBool(mt_sms_barring_roaming)) { ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mt_sms_barring_roaming]"); @@ -190,8 +207,7 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ } } - cJSON *mo_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsSubscribed"); - + mo_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsSubscribed"); if (mo_sms_subscribed) { if (!cJSON_IsBool(mo_sms_subscribed)) { ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mo_sms_subscribed]"); @@ -199,8 +215,7 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ } } - cJSON *mo_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsBarringAll"); - + mo_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsBarringAll"); if (mo_sms_barring_all) { if (!cJSON_IsBool(mo_sms_barring_all)) { ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mo_sms_barring_all]"); @@ -208,8 +223,7 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ } } - cJSON *mo_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsBarringRoaming"); - + mo_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "moSmsBarringRoaming"); if (mo_sms_barring_roaming) { if (!cJSON_IsBool(mo_sms_barring_roaming)) { ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [mo_sms_barring_roaming]"); @@ -217,35 +231,34 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ } } - cJSON *shared_sms_mng_data_ids = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "sharedSmsMngDataIds"); - - OpenAPI_list_t *shared_sms_mng_data_idsList; + shared_sms_mng_data_ids = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "sharedSmsMngDataIds"); if (shared_sms_mng_data_ids) { - cJSON *shared_sms_mng_data_ids_local; - if (!cJSON_IsArray(shared_sms_mng_data_ids)) { - ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [shared_sms_mng_data_ids]"); - goto end; - } - shared_sms_mng_data_idsList = OpenAPI_list_create(); + cJSON *shared_sms_mng_data_ids_local = NULL; + if (!cJSON_IsArray(shared_sms_mng_data_ids)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } - cJSON_ArrayForEach(shared_sms_mng_data_ids_local, shared_sms_mng_data_ids) { - if (!cJSON_IsString(shared_sms_mng_data_ids_local)) { - ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [shared_sms_mng_data_ids]"); - goto end; - } - OpenAPI_list_add(shared_sms_mng_data_idsList, ogs_strdup(shared_sms_mng_data_ids_local->valuestring)); - } + shared_sms_mng_data_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(shared_sms_mng_data_ids_local, shared_sms_mng_data_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(shared_sms_mng_data_ids_local)) { + ogs_error("OpenAPI_sms_management_subscription_data_parseFromJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } + OpenAPI_list_add(shared_sms_mng_data_idsList, ogs_strdup(shared_sms_mng_data_ids_local->valuestring)); + } } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "traceData"); - - OpenAPI_trace_data_1_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_dataJSON, "traceData"); if (trace_data) { - trace_data_local_nonprim = OpenAPI_trace_data_1_parseFromJSON(trace_data); + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } sms_management_subscription_data_local_var = OpenAPI_sms_management_subscription_data_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, mt_sms_subscribed ? true : false, mt_sms_subscribed ? mt_sms_subscribed->valueint : 0, mt_sms_barring_all ? true : false, @@ -264,6 +277,17 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ return sms_management_subscription_data_local_var; end: + if (shared_sms_mng_data_idsList) { + OpenAPI_list_for_each(shared_sms_mng_data_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(shared_sms_mng_data_idsList); + shared_sms_mng_data_idsList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sms_management_subscription_data.h b/lib/sbi/openapi/model/sms_management_subscription_data.h index 0ffa5966d..d4a0175c0 100644 --- a/lib/sbi/openapi/model/sms_management_subscription_data.h +++ b/lib/sbi/openapi/model/sms_management_subscription_data.h @@ -12,7 +12,7 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "trace_data_1.h" +#include "trace_data.h" #ifdef __cplusplus extern "C" { @@ -34,7 +34,7 @@ typedef struct OpenAPI_sms_management_subscription_data_s { bool is_mo_sms_barring_roaming; int mo_sms_barring_roaming; OpenAPI_list_t *shared_sms_mng_data_ids; - struct OpenAPI_trace_data_1_s *trace_data; + struct OpenAPI_trace_data_s *trace_data; } OpenAPI_sms_management_subscription_data_t; OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_data_create( @@ -52,7 +52,7 @@ OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_ bool is_mo_sms_barring_roaming, int mo_sms_barring_roaming, OpenAPI_list_t *shared_sms_mng_data_ids, - OpenAPI_trace_data_1_t *trace_data + OpenAPI_trace_data_t *trace_data ); void OpenAPI_sms_management_subscription_data_free(OpenAPI_sms_management_subscription_data_t *sms_management_subscription_data); OpenAPI_sms_management_subscription_data_t *OpenAPI_sms_management_subscription_data_parseFromJSON(cJSON *sms_management_subscription_dataJSON); diff --git a/lib/sbi/openapi/model/sms_management_subscription_data_1.c b/lib/sbi/openapi/model/sms_management_subscription_data_1.c index 5e17b4638..073bd4352 100644 --- a/lib/sbi/openapi/model/sms_management_subscription_data_1.c +++ b/lib/sbi/openapi/model/sms_management_subscription_data_1.c @@ -46,22 +46,33 @@ OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscriptio void OpenAPI_sms_management_subscription_data_1_free(OpenAPI_sms_management_subscription_data_1_t *sms_management_subscription_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sms_management_subscription_data_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(sms_management_subscription_data_1->supported_features); - OpenAPI_list_for_each(sms_management_subscription_data_1->shared_sms_mng_data_ids, node) { - ogs_free(node->data); + if (sms_management_subscription_data_1->supported_features) { + ogs_free(sms_management_subscription_data_1->supported_features); + sms_management_subscription_data_1->supported_features = NULL; + } + if (sms_management_subscription_data_1->shared_sms_mng_data_ids) { + OpenAPI_list_for_each(sms_management_subscription_data_1->shared_sms_mng_data_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sms_management_subscription_data_1->shared_sms_mng_data_ids); + sms_management_subscription_data_1->shared_sms_mng_data_ids = NULL; + } + if (sms_management_subscription_data_1->trace_data) { + OpenAPI_trace_data_free(sms_management_subscription_data_1->trace_data); + sms_management_subscription_data_1->trace_data = NULL; } - OpenAPI_list_free(sms_management_subscription_data_1->shared_sms_mng_data_ids); - OpenAPI_trace_data_free(sms_management_subscription_data_1->trace_data); ogs_free(sms_management_subscription_data_1); } cJSON *OpenAPI_sms_management_subscription_data_1_convertToJSON(OpenAPI_sms_management_subscription_data_1_t *sms_management_subscription_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sms_management_subscription_data_1 == NULL) { ogs_error("OpenAPI_sms_management_subscription_data_1_convertToJSON() failed [SmsManagementSubscriptionData_1]"); @@ -119,19 +130,17 @@ cJSON *OpenAPI_sms_management_subscription_data_1_convertToJSON(OpenAPI_sms_mana } if (sms_management_subscription_data_1->shared_sms_mng_data_ids) { - cJSON *shared_sms_mng_data_ids = cJSON_AddArrayToObject(item, "sharedSmsMngDataIds"); - if (shared_sms_mng_data_ids == NULL) { + cJSON *shared_sms_mng_data_idsList = cJSON_AddArrayToObject(item, "sharedSmsMngDataIds"); + if (shared_sms_mng_data_idsList == NULL) { ogs_error("OpenAPI_sms_management_subscription_data_1_convertToJSON() failed [shared_sms_mng_data_ids]"); goto end; } - - OpenAPI_lnode_t *shared_sms_mng_data_ids_node; - OpenAPI_list_for_each(sms_management_subscription_data_1->shared_sms_mng_data_ids, shared_sms_mng_data_ids_node) { - if (cJSON_AddStringToObject(shared_sms_mng_data_ids, "", (char*)shared_sms_mng_data_ids_node->data) == NULL) { - ogs_error("OpenAPI_sms_management_subscription_data_1_convertToJSON() failed [shared_sms_mng_data_ids]"); - goto end; + OpenAPI_list_for_each(sms_management_subscription_data_1->shared_sms_mng_data_ids, node) { + if (cJSON_AddStringToObject(shared_sms_mng_data_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sms_management_subscription_data_1_convertToJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } } - } } if (sms_management_subscription_data_1->trace_data) { @@ -154,17 +163,27 @@ end: OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscription_data_1_parseFromJSON(cJSON *sms_management_subscription_data_1JSON) { OpenAPI_sms_management_subscription_data_1_t *sms_management_subscription_data_1_local_var = NULL; - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "supportedFeatures"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supported_features = NULL; + cJSON *mt_sms_subscribed = NULL; + cJSON *mt_sms_barring_all = NULL; + cJSON *mt_sms_barring_roaming = NULL; + cJSON *mo_sms_subscribed = NULL; + cJSON *mo_sms_barring_all = NULL; + cJSON *mo_sms_barring_roaming = NULL; + cJSON *shared_sms_mng_data_ids = NULL; + OpenAPI_list_t *shared_sms_mng_data_idsList = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + supported_features = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *mt_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "mtSmsSubscribed"); - + mt_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "mtSmsSubscribed"); if (mt_sms_subscribed) { if (!cJSON_IsBool(mt_sms_subscribed)) { ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [mt_sms_subscribed]"); @@ -172,8 +191,7 @@ OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscriptio } } - cJSON *mt_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "mtSmsBarringAll"); - + mt_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "mtSmsBarringAll"); if (mt_sms_barring_all) { if (!cJSON_IsBool(mt_sms_barring_all)) { ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [mt_sms_barring_all]"); @@ -181,8 +199,7 @@ OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscriptio } } - cJSON *mt_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "mtSmsBarringRoaming"); - + mt_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "mtSmsBarringRoaming"); if (mt_sms_barring_roaming) { if (!cJSON_IsBool(mt_sms_barring_roaming)) { ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [mt_sms_barring_roaming]"); @@ -190,8 +207,7 @@ OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscriptio } } - cJSON *mo_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "moSmsSubscribed"); - + mo_sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "moSmsSubscribed"); if (mo_sms_subscribed) { if (!cJSON_IsBool(mo_sms_subscribed)) { ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [mo_sms_subscribed]"); @@ -199,8 +215,7 @@ OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscriptio } } - cJSON *mo_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "moSmsBarringAll"); - + mo_sms_barring_all = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "moSmsBarringAll"); if (mo_sms_barring_all) { if (!cJSON_IsBool(mo_sms_barring_all)) { ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [mo_sms_barring_all]"); @@ -208,8 +223,7 @@ OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscriptio } } - cJSON *mo_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "moSmsBarringRoaming"); - + mo_sms_barring_roaming = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "moSmsBarringRoaming"); if (mo_sms_barring_roaming) { if (!cJSON_IsBool(mo_sms_barring_roaming)) { ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [mo_sms_barring_roaming]"); @@ -217,35 +231,34 @@ OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscriptio } } - cJSON *shared_sms_mng_data_ids = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "sharedSmsMngDataIds"); - - OpenAPI_list_t *shared_sms_mng_data_idsList; + shared_sms_mng_data_ids = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "sharedSmsMngDataIds"); if (shared_sms_mng_data_ids) { - cJSON *shared_sms_mng_data_ids_local; - if (!cJSON_IsArray(shared_sms_mng_data_ids)) { - ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [shared_sms_mng_data_ids]"); - goto end; - } - shared_sms_mng_data_idsList = OpenAPI_list_create(); + cJSON *shared_sms_mng_data_ids_local = NULL; + if (!cJSON_IsArray(shared_sms_mng_data_ids)) { + ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } - cJSON_ArrayForEach(shared_sms_mng_data_ids_local, shared_sms_mng_data_ids) { - if (!cJSON_IsString(shared_sms_mng_data_ids_local)) { - ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [shared_sms_mng_data_ids]"); - goto end; - } - OpenAPI_list_add(shared_sms_mng_data_idsList, ogs_strdup(shared_sms_mng_data_ids_local->valuestring)); - } + shared_sms_mng_data_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(shared_sms_mng_data_ids_local, shared_sms_mng_data_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(shared_sms_mng_data_ids_local)) { + ogs_error("OpenAPI_sms_management_subscription_data_1_parseFromJSON() failed [shared_sms_mng_data_ids]"); + goto end; + } + OpenAPI_list_add(shared_sms_mng_data_idsList, ogs_strdup(shared_sms_mng_data_ids_local->valuestring)); + } } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(sms_management_subscription_data_1JSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } sms_management_subscription_data_1_local_var = OpenAPI_sms_management_subscription_data_1_create ( - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, mt_sms_subscribed ? true : false, mt_sms_subscribed ? mt_sms_subscribed->valueint : 0, mt_sms_barring_all ? true : false, @@ -264,6 +277,17 @@ OpenAPI_sms_management_subscription_data_1_t *OpenAPI_sms_management_subscriptio return sms_management_subscription_data_1_local_var; end: + if (shared_sms_mng_data_idsList) { + OpenAPI_list_for_each(shared_sms_mng_data_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(shared_sms_mng_data_idsList); + shared_sms_mng_data_idsList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sms_subscription_data.c b/lib/sbi/openapi/model/sms_subscription_data.c index bf0c66ac9..0506d78b0 100644 --- a/lib/sbi/openapi/model/sms_subscription_data.c +++ b/lib/sbi/openapi/model/sms_subscription_data.c @@ -22,17 +22,22 @@ OpenAPI_sms_subscription_data_t *OpenAPI_sms_subscription_data_create( void OpenAPI_sms_subscription_data_free(OpenAPI_sms_subscription_data_t *sms_subscription_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sms_subscription_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(sms_subscription_data->shared_sms_subs_data_id); + if (sms_subscription_data->shared_sms_subs_data_id) { + ogs_free(sms_subscription_data->shared_sms_subs_data_id); + sms_subscription_data->shared_sms_subs_data_id = NULL; + } ogs_free(sms_subscription_data); } cJSON *OpenAPI_sms_subscription_data_convertToJSON(OpenAPI_sms_subscription_data_t *sms_subscription_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sms_subscription_data == NULL) { ogs_error("OpenAPI_sms_subscription_data_convertToJSON() failed [SmsSubscriptionData]"); @@ -61,8 +66,10 @@ end: OpenAPI_sms_subscription_data_t *OpenAPI_sms_subscription_data_parseFromJSON(cJSON *sms_subscription_dataJSON) { OpenAPI_sms_subscription_data_t *sms_subscription_data_local_var = NULL; - cJSON *sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_subscription_dataJSON, "smsSubscribed"); - + OpenAPI_lnode_t *node = NULL; + cJSON *sms_subscribed = NULL; + cJSON *shared_sms_subs_data_id = NULL; + sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_subscription_dataJSON, "smsSubscribed"); if (sms_subscribed) { if (!cJSON_IsBool(sms_subscribed)) { ogs_error("OpenAPI_sms_subscription_data_parseFromJSON() failed [sms_subscribed]"); @@ -70,10 +77,9 @@ OpenAPI_sms_subscription_data_t *OpenAPI_sms_subscription_data_parseFromJSON(cJS } } - cJSON *shared_sms_subs_data_id = cJSON_GetObjectItemCaseSensitive(sms_subscription_dataJSON, "sharedSmsSubsDataId"); - + shared_sms_subs_data_id = cJSON_GetObjectItemCaseSensitive(sms_subscription_dataJSON, "sharedSmsSubsDataId"); if (shared_sms_subs_data_id) { - if (!cJSON_IsString(shared_sms_subs_data_id)) { + if (!cJSON_IsString(shared_sms_subs_data_id) && !cJSON_IsNull(shared_sms_subs_data_id)) { ogs_error("OpenAPI_sms_subscription_data_parseFromJSON() failed [shared_sms_subs_data_id]"); goto end; } @@ -82,7 +88,7 @@ OpenAPI_sms_subscription_data_t *OpenAPI_sms_subscription_data_parseFromJSON(cJS sms_subscription_data_local_var = OpenAPI_sms_subscription_data_create ( sms_subscribed ? true : false, sms_subscribed ? sms_subscribed->valueint : 0, - shared_sms_subs_data_id ? ogs_strdup(shared_sms_subs_data_id->valuestring) : NULL + shared_sms_subs_data_id && !cJSON_IsNull(shared_sms_subs_data_id) ? ogs_strdup(shared_sms_subs_data_id->valuestring) : NULL ); return sms_subscription_data_local_var; diff --git a/lib/sbi/openapi/model/sms_subscription_data_1.c b/lib/sbi/openapi/model/sms_subscription_data_1.c index b3bac3768..edfced2ed 100644 --- a/lib/sbi/openapi/model/sms_subscription_data_1.c +++ b/lib/sbi/openapi/model/sms_subscription_data_1.c @@ -22,17 +22,22 @@ OpenAPI_sms_subscription_data_1_t *OpenAPI_sms_subscription_data_1_create( void OpenAPI_sms_subscription_data_1_free(OpenAPI_sms_subscription_data_1_t *sms_subscription_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sms_subscription_data_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(sms_subscription_data_1->shared_sms_subs_data_id); + if (sms_subscription_data_1->shared_sms_subs_data_id) { + ogs_free(sms_subscription_data_1->shared_sms_subs_data_id); + sms_subscription_data_1->shared_sms_subs_data_id = NULL; + } ogs_free(sms_subscription_data_1); } cJSON *OpenAPI_sms_subscription_data_1_convertToJSON(OpenAPI_sms_subscription_data_1_t *sms_subscription_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sms_subscription_data_1 == NULL) { ogs_error("OpenAPI_sms_subscription_data_1_convertToJSON() failed [SmsSubscriptionData_1]"); @@ -61,8 +66,10 @@ end: OpenAPI_sms_subscription_data_1_t *OpenAPI_sms_subscription_data_1_parseFromJSON(cJSON *sms_subscription_data_1JSON) { OpenAPI_sms_subscription_data_1_t *sms_subscription_data_1_local_var = NULL; - cJSON *sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_subscription_data_1JSON, "smsSubscribed"); - + OpenAPI_lnode_t *node = NULL; + cJSON *sms_subscribed = NULL; + cJSON *shared_sms_subs_data_id = NULL; + sms_subscribed = cJSON_GetObjectItemCaseSensitive(sms_subscription_data_1JSON, "smsSubscribed"); if (sms_subscribed) { if (!cJSON_IsBool(sms_subscribed)) { ogs_error("OpenAPI_sms_subscription_data_1_parseFromJSON() failed [sms_subscribed]"); @@ -70,10 +77,9 @@ OpenAPI_sms_subscription_data_1_t *OpenAPI_sms_subscription_data_1_parseFromJSON } } - cJSON *shared_sms_subs_data_id = cJSON_GetObjectItemCaseSensitive(sms_subscription_data_1JSON, "sharedSmsSubsDataId"); - + shared_sms_subs_data_id = cJSON_GetObjectItemCaseSensitive(sms_subscription_data_1JSON, "sharedSmsSubsDataId"); if (shared_sms_subs_data_id) { - if (!cJSON_IsString(shared_sms_subs_data_id)) { + if (!cJSON_IsString(shared_sms_subs_data_id) && !cJSON_IsNull(shared_sms_subs_data_id)) { ogs_error("OpenAPI_sms_subscription_data_1_parseFromJSON() failed [shared_sms_subs_data_id]"); goto end; } @@ -82,7 +88,7 @@ OpenAPI_sms_subscription_data_1_t *OpenAPI_sms_subscription_data_1_parseFromJSON sms_subscription_data_1_local_var = OpenAPI_sms_subscription_data_1_create ( sms_subscribed ? true : false, sms_subscribed ? sms_subscribed->valueint : 0, - shared_sms_subs_data_id ? ogs_strdup(shared_sms_subs_data_id->valuestring) : NULL + shared_sms_subs_data_id && !cJSON_IsNull(shared_sms_subs_data_id) ? ogs_strdup(shared_sms_subs_data_id->valuestring) : NULL ); return sms_subscription_data_1_local_var; diff --git a/lib/sbi/openapi/model/sms_support.c b/lib/sbi/openapi/model/sms_support.c index a4c63aa5d..3616347b0 100644 --- a/lib/sbi/openapi/model/sms_support.c +++ b/lib/sbi/openapi/model/sms_support.c @@ -6,7 +6,7 @@ char* OpenAPI_sms_support_ToString(OpenAPI_sms_support_e sms_support) { - const char *sms_supportArray[] = { "NULL", "_3GPP", "NON_3GPP", "BOTH", "NONE" }; + const char *sms_supportArray[] = { "NULL", "3GPP", "NON_3GPP", "BOTH", "NONE" }; size_t sizeofArray = sizeof(sms_supportArray) / sizeof(sms_supportArray[0]); if (sms_support < sizeofArray) return (char *)sms_supportArray[sms_support]; @@ -17,7 +17,7 @@ char* OpenAPI_sms_support_ToString(OpenAPI_sms_support_e sms_support) OpenAPI_sms_support_e OpenAPI_sms_support_FromString(char* sms_support) { int stringToReturn = 0; - const char *sms_supportArray[] = { "NULL", "_3GPP", "NON_3GPP", "BOTH", "NONE" }; + const char *sms_supportArray[] = { "NULL", "3GPP", "NON_3GPP", "BOTH", "NONE" }; size_t sizeofArray = sizeof(sms_supportArray) / sizeof(sms_supportArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(sms_support, sms_supportArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/smsc_data.c b/lib/sbi/openapi/model/smsc_data.c index 39e704ee2..af764a297 100644 --- a/lib/sbi/openapi/model/smsc_data.c +++ b/lib/sbi/openapi/model/smsc_data.c @@ -20,18 +20,26 @@ OpenAPI_smsc_data_t *OpenAPI_smsc_data_create( void OpenAPI_smsc_data_free(OpenAPI_smsc_data_t *smsc_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smsc_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(smsc_data->smsc_map_address); - OpenAPI_network_node_diameter_address_1_free(smsc_data->smsc_diameter_address); + if (smsc_data->smsc_map_address) { + ogs_free(smsc_data->smsc_map_address); + smsc_data->smsc_map_address = NULL; + } + if (smsc_data->smsc_diameter_address) { + OpenAPI_network_node_diameter_address_1_free(smsc_data->smsc_diameter_address); + smsc_data->smsc_diameter_address = NULL; + } ogs_free(smsc_data); } cJSON *OpenAPI_smsc_data_convertToJSON(OpenAPI_smsc_data_t *smsc_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smsc_data == NULL) { ogs_error("OpenAPI_smsc_data_convertToJSON() failed [SmscData]"); @@ -66,29 +74,34 @@ end: OpenAPI_smsc_data_t *OpenAPI_smsc_data_parseFromJSON(cJSON *smsc_dataJSON) { OpenAPI_smsc_data_t *smsc_data_local_var = NULL; - cJSON *smsc_map_address = cJSON_GetObjectItemCaseSensitive(smsc_dataJSON, "smscMapAddress"); - + OpenAPI_lnode_t *node = NULL; + cJSON *smsc_map_address = NULL; + cJSON *smsc_diameter_address = NULL; + OpenAPI_network_node_diameter_address_1_t *smsc_diameter_address_local_nonprim = NULL; + smsc_map_address = cJSON_GetObjectItemCaseSensitive(smsc_dataJSON, "smscMapAddress"); if (smsc_map_address) { - if (!cJSON_IsString(smsc_map_address)) { + if (!cJSON_IsString(smsc_map_address) && !cJSON_IsNull(smsc_map_address)) { ogs_error("OpenAPI_smsc_data_parseFromJSON() failed [smsc_map_address]"); goto end; } } - cJSON *smsc_diameter_address = cJSON_GetObjectItemCaseSensitive(smsc_dataJSON, "smscDiameterAddress"); - - OpenAPI_network_node_diameter_address_1_t *smsc_diameter_address_local_nonprim = NULL; + smsc_diameter_address = cJSON_GetObjectItemCaseSensitive(smsc_dataJSON, "smscDiameterAddress"); if (smsc_diameter_address) { smsc_diameter_address_local_nonprim = OpenAPI_network_node_diameter_address_1_parseFromJSON(smsc_diameter_address); } smsc_data_local_var = OpenAPI_smsc_data_create ( - smsc_map_address ? ogs_strdup(smsc_map_address->valuestring) : NULL, + smsc_map_address && !cJSON_IsNull(smsc_map_address) ? ogs_strdup(smsc_map_address->valuestring) : NULL, smsc_diameter_address ? smsc_diameter_address_local_nonprim : NULL ); return smsc_data_local_var; end: + if (smsc_diameter_address_local_nonprim) { + OpenAPI_network_node_diameter_address_1_free(smsc_diameter_address_local_nonprim); + smsc_diameter_address_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smsf_info.c b/lib/sbi/openapi/model/smsf_info.c index e947f5e09..b08ec99bb 100644 --- a/lib/sbi/openapi/model/smsf_info.c +++ b/lib/sbi/openapi/model/smsf_info.c @@ -20,18 +20,26 @@ OpenAPI_smsf_info_t *OpenAPI_smsf_info_create( void OpenAPI_smsf_info_free(OpenAPI_smsf_info_t *smsf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smsf_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(smsf_info->smsf_instance_id); - OpenAPI_plmn_id_free(smsf_info->plmn_id); + if (smsf_info->smsf_instance_id) { + ogs_free(smsf_info->smsf_instance_id); + smsf_info->smsf_instance_id = NULL; + } + if (smsf_info->plmn_id) { + OpenAPI_plmn_id_free(smsf_info->plmn_id); + smsf_info->plmn_id = NULL; + } ogs_free(smsf_info); } cJSON *OpenAPI_smsf_info_convertToJSON(OpenAPI_smsf_info_t *smsf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smsf_info == NULL) { ogs_error("OpenAPI_smsf_info_convertToJSON() failed [SmsfInfo]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_smsf_info_convertToJSON(OpenAPI_smsf_info_t *smsf_info) } item = cJSON_CreateObject(); + if (!smsf_info->smsf_instance_id) { + ogs_error("OpenAPI_smsf_info_convertToJSON() failed [smsf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smsfInstanceId", smsf_info->smsf_instance_id) == NULL) { ogs_error("OpenAPI_smsf_info_convertToJSON() failed [smsf_instance_id]"); goto end; } + if (!smsf_info->plmn_id) { + ogs_error("OpenAPI_smsf_info_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(smsf_info->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_smsf_info_convertToJSON() failed [plmn_id]"); @@ -62,24 +78,25 @@ end: OpenAPI_smsf_info_t *OpenAPI_smsf_info_parseFromJSON(cJSON *smsf_infoJSON) { OpenAPI_smsf_info_t *smsf_info_local_var = NULL; - cJSON *smsf_instance_id = cJSON_GetObjectItemCaseSensitive(smsf_infoJSON, "smsfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *smsf_instance_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + smsf_instance_id = cJSON_GetObjectItemCaseSensitive(smsf_infoJSON, "smsfInstanceId"); if (!smsf_instance_id) { ogs_error("OpenAPI_smsf_info_parseFromJSON() failed [smsf_instance_id]"); goto end; } - if (!cJSON_IsString(smsf_instance_id)) { ogs_error("OpenAPI_smsf_info_parseFromJSON() failed [smsf_instance_id]"); goto end; } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(smsf_infoJSON, "plmnId"); + plmn_id = cJSON_GetObjectItemCaseSensitive(smsf_infoJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_smsf_info_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); smsf_info_local_var = OpenAPI_smsf_info_create ( @@ -89,6 +106,10 @@ OpenAPI_smsf_info_t *OpenAPI_smsf_info_parseFromJSON(cJSON *smsf_infoJSON) return smsf_info_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smsf_info_1.c b/lib/sbi/openapi/model/smsf_info_1.c index c8b174757..3d9cf01a8 100644 --- a/lib/sbi/openapi/model/smsf_info_1.c +++ b/lib/sbi/openapi/model/smsf_info_1.c @@ -20,18 +20,26 @@ OpenAPI_smsf_info_1_t *OpenAPI_smsf_info_1_create( void OpenAPI_smsf_info_1_free(OpenAPI_smsf_info_1_t *smsf_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smsf_info_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(smsf_info_1->smsf_instance_id); - OpenAPI_plmn_id_1_free(smsf_info_1->plmn_id); + if (smsf_info_1->smsf_instance_id) { + ogs_free(smsf_info_1->smsf_instance_id); + smsf_info_1->smsf_instance_id = NULL; + } + if (smsf_info_1->plmn_id) { + OpenAPI_plmn_id_1_free(smsf_info_1->plmn_id); + smsf_info_1->plmn_id = NULL; + } ogs_free(smsf_info_1); } cJSON *OpenAPI_smsf_info_1_convertToJSON(OpenAPI_smsf_info_1_t *smsf_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smsf_info_1 == NULL) { ogs_error("OpenAPI_smsf_info_1_convertToJSON() failed [SmsfInfo_1]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_smsf_info_1_convertToJSON(OpenAPI_smsf_info_1_t *smsf_info_1) } item = cJSON_CreateObject(); + if (!smsf_info_1->smsf_instance_id) { + ogs_error("OpenAPI_smsf_info_1_convertToJSON() failed [smsf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smsfInstanceId", smsf_info_1->smsf_instance_id) == NULL) { ogs_error("OpenAPI_smsf_info_1_convertToJSON() failed [smsf_instance_id]"); goto end; } + if (!smsf_info_1->plmn_id) { + ogs_error("OpenAPI_smsf_info_1_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_1_convertToJSON(smsf_info_1->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_smsf_info_1_convertToJSON() failed [plmn_id]"); @@ -62,24 +78,25 @@ end: OpenAPI_smsf_info_1_t *OpenAPI_smsf_info_1_parseFromJSON(cJSON *smsf_info_1JSON) { OpenAPI_smsf_info_1_t *smsf_info_1_local_var = NULL; - cJSON *smsf_instance_id = cJSON_GetObjectItemCaseSensitive(smsf_info_1JSON, "smsfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *smsf_instance_id = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + smsf_instance_id = cJSON_GetObjectItemCaseSensitive(smsf_info_1JSON, "smsfInstanceId"); if (!smsf_instance_id) { ogs_error("OpenAPI_smsf_info_1_parseFromJSON() failed [smsf_instance_id]"); goto end; } - if (!cJSON_IsString(smsf_instance_id)) { ogs_error("OpenAPI_smsf_info_1_parseFromJSON() failed [smsf_instance_id]"); goto end; } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(smsf_info_1JSON, "plmnId"); + plmn_id = cJSON_GetObjectItemCaseSensitive(smsf_info_1JSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_smsf_info_1_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); smsf_info_1_local_var = OpenAPI_smsf_info_1_create ( @@ -89,6 +106,10 @@ OpenAPI_smsf_info_1_t *OpenAPI_smsf_info_1_parseFromJSON(cJSON *smsf_info_1JSON) return smsf_info_1_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/smsf_registration.c b/lib/sbi/openapi/model/smsf_registration.c index 0f7bb59c0..2660ab077 100644 --- a/lib/sbi/openapi/model/smsf_registration.c +++ b/lib/sbi/openapi/model/smsf_registration.c @@ -32,24 +32,50 @@ OpenAPI_smsf_registration_t *OpenAPI_smsf_registration_create( void OpenAPI_smsf_registration_free(OpenAPI_smsf_registration_t *smsf_registration) { + OpenAPI_lnode_t *node = NULL; + if (NULL == smsf_registration) { return; } - OpenAPI_lnode_t *node; - ogs_free(smsf_registration->smsf_instance_id); - ogs_free(smsf_registration->smsf_set_id); - ogs_free(smsf_registration->supported_features); - OpenAPI_plmn_id_free(smsf_registration->plmn_id); - ogs_free(smsf_registration->smsf_map_address); - OpenAPI_network_node_diameter_address_free(smsf_registration->smsf_diameter_address); - ogs_free(smsf_registration->registration_time); - OpenAPI_context_info_free(smsf_registration->context_info); + if (smsf_registration->smsf_instance_id) { + ogs_free(smsf_registration->smsf_instance_id); + smsf_registration->smsf_instance_id = NULL; + } + if (smsf_registration->smsf_set_id) { + ogs_free(smsf_registration->smsf_set_id); + smsf_registration->smsf_set_id = NULL; + } + if (smsf_registration->supported_features) { + ogs_free(smsf_registration->supported_features); + smsf_registration->supported_features = NULL; + } + if (smsf_registration->plmn_id) { + OpenAPI_plmn_id_free(smsf_registration->plmn_id); + smsf_registration->plmn_id = NULL; + } + if (smsf_registration->smsf_map_address) { + ogs_free(smsf_registration->smsf_map_address); + smsf_registration->smsf_map_address = NULL; + } + if (smsf_registration->smsf_diameter_address) { + OpenAPI_network_node_diameter_address_free(smsf_registration->smsf_diameter_address); + smsf_registration->smsf_diameter_address = NULL; + } + if (smsf_registration->registration_time) { + ogs_free(smsf_registration->registration_time); + smsf_registration->registration_time = NULL; + } + if (smsf_registration->context_info) { + OpenAPI_context_info_free(smsf_registration->context_info); + smsf_registration->context_info = NULL; + } ogs_free(smsf_registration); } cJSON *OpenAPI_smsf_registration_convertToJSON(OpenAPI_smsf_registration_t *smsf_registration) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (smsf_registration == NULL) { ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [SmsfRegistration]"); @@ -57,6 +83,10 @@ cJSON *OpenAPI_smsf_registration_convertToJSON(OpenAPI_smsf_registration_t *smsf } item = cJSON_CreateObject(); + if (!smsf_registration->smsf_instance_id) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [smsf_instance_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "smsfInstanceId", smsf_registration->smsf_instance_id) == NULL) { ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [smsf_instance_id]"); goto end; @@ -76,6 +106,10 @@ cJSON *OpenAPI_smsf_registration_convertToJSON(OpenAPI_smsf_registration_t *smsf } } + if (!smsf_registration->plmn_id) { + ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(smsf_registration->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_smsf_registration_convertToJSON() failed [plmn_id]"); @@ -134,89 +168,102 @@ end: OpenAPI_smsf_registration_t *OpenAPI_smsf_registration_parseFromJSON(cJSON *smsf_registrationJSON) { OpenAPI_smsf_registration_t *smsf_registration_local_var = NULL; - cJSON *smsf_instance_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfInstanceId"); + OpenAPI_lnode_t *node = NULL; + cJSON *smsf_instance_id = NULL; + cJSON *smsf_set_id = NULL; + cJSON *supported_features = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *smsf_map_address = NULL; + cJSON *smsf_diameter_address = NULL; + OpenAPI_network_node_diameter_address_t *smsf_diameter_address_local_nonprim = NULL; + cJSON *registration_time = NULL; + cJSON *context_info = NULL; + OpenAPI_context_info_t *context_info_local_nonprim = NULL; + smsf_instance_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfInstanceId"); if (!smsf_instance_id) { ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [smsf_instance_id]"); goto end; } - if (!cJSON_IsString(smsf_instance_id)) { ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [smsf_instance_id]"); goto end; } - cJSON *smsf_set_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfSetId"); - + smsf_set_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfSetId"); if (smsf_set_id) { - if (!cJSON_IsString(smsf_set_id)) { + if (!cJSON_IsString(smsf_set_id) && !cJSON_IsNull(smsf_set_id)) { ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [smsf_set_id]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "plmnId"); + plmn_id = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *smsf_map_address = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfMAPAddress"); - + smsf_map_address = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfMAPAddress"); if (smsf_map_address) { - if (!cJSON_IsString(smsf_map_address)) { + if (!cJSON_IsString(smsf_map_address) && !cJSON_IsNull(smsf_map_address)) { ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [smsf_map_address]"); goto end; } } - cJSON *smsf_diameter_address = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfDiameterAddress"); - - OpenAPI_network_node_diameter_address_t *smsf_diameter_address_local_nonprim = NULL; + smsf_diameter_address = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "smsfDiameterAddress"); if (smsf_diameter_address) { smsf_diameter_address_local_nonprim = OpenAPI_network_node_diameter_address_parseFromJSON(smsf_diameter_address); } - cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "registrationTime"); - + registration_time = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "registrationTime"); if (registration_time) { - if (!cJSON_IsString(registration_time)) { + if (!cJSON_IsString(registration_time) && !cJSON_IsNull(registration_time)) { ogs_error("OpenAPI_smsf_registration_parseFromJSON() failed [registration_time]"); goto end; } } - cJSON *context_info = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "contextInfo"); - - OpenAPI_context_info_t *context_info_local_nonprim = NULL; + context_info = cJSON_GetObjectItemCaseSensitive(smsf_registrationJSON, "contextInfo"); if (context_info) { context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info); } smsf_registration_local_var = OpenAPI_smsf_registration_create ( ogs_strdup(smsf_instance_id->valuestring), - smsf_set_id ? ogs_strdup(smsf_set_id->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + smsf_set_id && !cJSON_IsNull(smsf_set_id) ? ogs_strdup(smsf_set_id->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, plmn_id_local_nonprim, - smsf_map_address ? ogs_strdup(smsf_map_address->valuestring) : NULL, + smsf_map_address && !cJSON_IsNull(smsf_map_address) ? ogs_strdup(smsf_map_address->valuestring) : NULL, smsf_diameter_address ? smsf_diameter_address_local_nonprim : NULL, - registration_time ? ogs_strdup(registration_time->valuestring) : NULL, + registration_time && !cJSON_IsNull(registration_time) ? ogs_strdup(registration_time->valuestring) : NULL, context_info ? context_info_local_nonprim : NULL ); return smsf_registration_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (smsf_diameter_address_local_nonprim) { + OpenAPI_network_node_diameter_address_free(smsf_diameter_address_local_nonprim); + smsf_diameter_address_local_nonprim = NULL; + } + if (context_info_local_nonprim) { + OpenAPI_context_info_free(context_info_local_nonprim); + context_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/snssai.c b/lib/sbi/openapi/model/snssai.c index 5c80c6541..0375e89e7 100644 --- a/lib/sbi/openapi/model/snssai.c +++ b/lib/sbi/openapi/model/snssai.c @@ -20,17 +20,22 @@ OpenAPI_snssai_t *OpenAPI_snssai_create( void OpenAPI_snssai_free(OpenAPI_snssai_t *snssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == snssai) { return; } - OpenAPI_lnode_t *node; - ogs_free(snssai->sd); + if (snssai->sd) { + ogs_free(snssai->sd); + snssai->sd = NULL; + } ogs_free(snssai); } cJSON *OpenAPI_snssai_convertToJSON(OpenAPI_snssai_t *snssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (snssai == NULL) { ogs_error("OpenAPI_snssai_convertToJSON() failed [Snssai]"); @@ -57,21 +62,22 @@ end: OpenAPI_snssai_t *OpenAPI_snssai_parseFromJSON(cJSON *snssaiJSON) { OpenAPI_snssai_t *snssai_local_var = NULL; - cJSON *sst = cJSON_GetObjectItemCaseSensitive(snssaiJSON, "sst"); + OpenAPI_lnode_t *node = NULL; + cJSON *sst = NULL; + cJSON *sd = NULL; + sst = cJSON_GetObjectItemCaseSensitive(snssaiJSON, "sst"); if (!sst) { ogs_error("OpenAPI_snssai_parseFromJSON() failed [sst]"); goto end; } - if (!cJSON_IsNumber(sst)) { ogs_error("OpenAPI_snssai_parseFromJSON() failed [sst]"); goto end; } - cJSON *sd = cJSON_GetObjectItemCaseSensitive(snssaiJSON, "sd"); - + sd = cJSON_GetObjectItemCaseSensitive(snssaiJSON, "sd"); if (sd) { - if (!cJSON_IsString(sd)) { + if (!cJSON_IsString(sd) && !cJSON_IsNull(sd)) { ogs_error("OpenAPI_snssai_parseFromJSON() failed [sd]"); goto end; } @@ -80,7 +86,7 @@ OpenAPI_snssai_t *OpenAPI_snssai_parseFromJSON(cJSON *snssaiJSON) snssai_local_var = OpenAPI_snssai_create ( sst->valuedouble, - sd ? ogs_strdup(sd->valuestring) : NULL + sd && !cJSON_IsNull(sd) ? ogs_strdup(sd->valuestring) : NULL ); return snssai_local_var; diff --git a/lib/sbi/openapi/model/snssai_extension.c b/lib/sbi/openapi/model/snssai_extension.c index 7d66fd9c4..134c6c4c1 100644 --- a/lib/sbi/openapi/model/snssai_extension.c +++ b/lib/sbi/openapi/model/snssai_extension.c @@ -22,20 +22,25 @@ OpenAPI_snssai_extension_t *OpenAPI_snssai_extension_create( void OpenAPI_snssai_extension_free(OpenAPI_snssai_extension_t *snssai_extension) { + OpenAPI_lnode_t *node = NULL; + if (NULL == snssai_extension) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(snssai_extension->sd_ranges, node) { - OpenAPI_sd_range_free(node->data); + if (snssai_extension->sd_ranges) { + OpenAPI_list_for_each(snssai_extension->sd_ranges, node) { + OpenAPI_sd_range_free(node->data); + } + OpenAPI_list_free(snssai_extension->sd_ranges); + snssai_extension->sd_ranges = NULL; } - OpenAPI_list_free(snssai_extension->sd_ranges); ogs_free(snssai_extension); } cJSON *OpenAPI_snssai_extension_convertToJSON(OpenAPI_snssai_extension_t *snssai_extension) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (snssai_extension == NULL) { ogs_error("OpenAPI_snssai_extension_convertToJSON() failed [SnssaiExtension]"); @@ -49,17 +54,13 @@ cJSON *OpenAPI_snssai_extension_convertToJSON(OpenAPI_snssai_extension_t *snssai ogs_error("OpenAPI_snssai_extension_convertToJSON() failed [sd_ranges]"); goto end; } - - OpenAPI_lnode_t *sd_ranges_node; - if (snssai_extension->sd_ranges) { - OpenAPI_list_for_each(snssai_extension->sd_ranges, sd_ranges_node) { - cJSON *itemLocal = OpenAPI_sd_range_convertToJSON(sd_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_snssai_extension_convertToJSON() failed [sd_ranges]"); - goto end; - } - cJSON_AddItemToArray(sd_rangesList, itemLocal); + OpenAPI_list_for_each(snssai_extension->sd_ranges, node) { + cJSON *itemLocal = OpenAPI_sd_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_snssai_extension_convertToJSON() failed [sd_ranges]"); + goto end; } + cJSON_AddItemToArray(sd_rangesList, itemLocal); } } @@ -77,37 +78,36 @@ end: OpenAPI_snssai_extension_t *OpenAPI_snssai_extension_parseFromJSON(cJSON *snssai_extensionJSON) { OpenAPI_snssai_extension_t *snssai_extension_local_var = NULL; - cJSON *sd_ranges = cJSON_GetObjectItemCaseSensitive(snssai_extensionJSON, "sdRanges"); - - OpenAPI_list_t *sd_rangesList; + OpenAPI_lnode_t *node = NULL; + cJSON *sd_ranges = NULL; + OpenAPI_list_t *sd_rangesList = NULL; + cJSON *wildcard_sd = NULL; + sd_ranges = cJSON_GetObjectItemCaseSensitive(snssai_extensionJSON, "sdRanges"); if (sd_ranges) { - cJSON *sd_ranges_local_nonprimitive; - if (!cJSON_IsArray(sd_ranges)){ - ogs_error("OpenAPI_snssai_extension_parseFromJSON() failed [sd_ranges]"); - goto end; - } - - sd_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sd_ranges_local_nonprimitive, sd_ranges ) { - if (!cJSON_IsObject(sd_ranges_local_nonprimitive)) { + cJSON *sd_ranges_local = NULL; + if (!cJSON_IsArray(sd_ranges)) { ogs_error("OpenAPI_snssai_extension_parseFromJSON() failed [sd_ranges]"); goto end; } - OpenAPI_sd_range_t *sd_rangesItem = OpenAPI_sd_range_parseFromJSON(sd_ranges_local_nonprimitive); - if (!sd_rangesItem) { - ogs_error("No sd_rangesItem"); - OpenAPI_list_free(sd_rangesList); - goto end; + sd_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sd_ranges_local, sd_ranges) { + if (!cJSON_IsObject(sd_ranges_local)) { + ogs_error("OpenAPI_snssai_extension_parseFromJSON() failed [sd_ranges]"); + goto end; + } + OpenAPI_sd_range_t *sd_rangesItem = OpenAPI_sd_range_parseFromJSON(sd_ranges_local); + if (!sd_rangesItem) { + ogs_error("No sd_rangesItem"); + OpenAPI_list_free(sd_rangesList); + goto end; + } + OpenAPI_list_add(sd_rangesList, sd_rangesItem); } - - OpenAPI_list_add(sd_rangesList, sd_rangesItem); - } } - cJSON *wildcard_sd = cJSON_GetObjectItemCaseSensitive(snssai_extensionJSON, "wildcardSd"); - + wildcard_sd = cJSON_GetObjectItemCaseSensitive(snssai_extensionJSON, "wildcardSd"); if (wildcard_sd) { if (!cJSON_IsBool(wildcard_sd)) { ogs_error("OpenAPI_snssai_extension_parseFromJSON() failed [wildcard_sd]"); @@ -123,6 +123,13 @@ OpenAPI_snssai_extension_t *OpenAPI_snssai_extension_parseFromJSON(cJSON *snssai return snssai_extension_local_var; end: + if (sd_rangesList) { + OpenAPI_list_for_each(sd_rangesList, node) { + OpenAPI_sd_range_free(node->data); + } + OpenAPI_list_free(sd_rangesList); + sd_rangesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/snssai_info.c b/lib/sbi/openapi/model/snssai_info.c index 3e73269f6..615d89a5b 100644 --- a/lib/sbi/openapi/model/snssai_info.c +++ b/lib/sbi/openapi/model/snssai_info.c @@ -18,20 +18,25 @@ OpenAPI_snssai_info_t *OpenAPI_snssai_info_create( void OpenAPI_snssai_info_free(OpenAPI_snssai_info_t *snssai_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == snssai_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(snssai_info->dnn_infos, node) { - OpenAPI_dnn_info_free(node->data); + if (snssai_info->dnn_infos) { + OpenAPI_list_for_each(snssai_info->dnn_infos, node) { + OpenAPI_dnn_info_free(node->data); + } + OpenAPI_list_free(snssai_info->dnn_infos); + snssai_info->dnn_infos = NULL; } - OpenAPI_list_free(snssai_info->dnn_infos); ogs_free(snssai_info); } cJSON *OpenAPI_snssai_info_convertToJSON(OpenAPI_snssai_info_t *snssai_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (snssai_info == NULL) { ogs_error("OpenAPI_snssai_info_convertToJSON() failed [SnssaiInfo]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_snssai_info_convertToJSON(OpenAPI_snssai_info_t *snssai_info) } item = cJSON_CreateObject(); + if (!snssai_info->dnn_infos) { + ogs_error("OpenAPI_snssai_info_convertToJSON() failed [dnn_infos]"); + return NULL; + } cJSON *dnn_infosList = cJSON_AddArrayToObject(item, "dnnInfos"); if (dnn_infosList == NULL) { ogs_error("OpenAPI_snssai_info_convertToJSON() failed [dnn_infos]"); goto end; } - - OpenAPI_lnode_t *dnn_infos_node; - if (snssai_info->dnn_infos) { - OpenAPI_list_for_each(snssai_info->dnn_infos, dnn_infos_node) { - cJSON *itemLocal = OpenAPI_dnn_info_convertToJSON(dnn_infos_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_snssai_info_convertToJSON() failed [dnn_infos]"); - goto end; - } - cJSON_AddItemToArray(dnn_infosList, itemLocal); + OpenAPI_list_for_each(snssai_info->dnn_infos, node) { + cJSON *itemLocal = OpenAPI_dnn_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_snssai_info_convertToJSON() failed [dnn_infos]"); + goto end; } + cJSON_AddItemToArray(dnn_infosList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_snssai_info_t *OpenAPI_snssai_info_parseFromJSON(cJSON *snssai_infoJSON) { OpenAPI_snssai_info_t *snssai_info_local_var = NULL; - cJSON *dnn_infos = cJSON_GetObjectItemCaseSensitive(snssai_infoJSON, "dnnInfos"); + OpenAPI_lnode_t *node = NULL; + cJSON *dnn_infos = NULL; + OpenAPI_list_t *dnn_infosList = NULL; + dnn_infos = cJSON_GetObjectItemCaseSensitive(snssai_infoJSON, "dnnInfos"); if (!dnn_infos) { ogs_error("OpenAPI_snssai_info_parseFromJSON() failed [dnn_infos]"); goto end; } - - OpenAPI_list_t *dnn_infosList; - cJSON *dnn_infos_local_nonprimitive; - if (!cJSON_IsArray(dnn_infos)){ - ogs_error("OpenAPI_snssai_info_parseFromJSON() failed [dnn_infos]"); - goto end; - } - - dnn_infosList = OpenAPI_list_create(); - - cJSON_ArrayForEach(dnn_infos_local_nonprimitive, dnn_infos ) { - if (!cJSON_IsObject(dnn_infos_local_nonprimitive)) { + cJSON *dnn_infos_local = NULL; + if (!cJSON_IsArray(dnn_infos)) { ogs_error("OpenAPI_snssai_info_parseFromJSON() failed [dnn_infos]"); goto end; } - OpenAPI_dnn_info_t *dnn_infosItem = OpenAPI_dnn_info_parseFromJSON(dnn_infos_local_nonprimitive); - if (!dnn_infosItem) { - ogs_error("No dnn_infosItem"); - OpenAPI_list_free(dnn_infosList); - goto end; + dnn_infosList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_infos_local, dnn_infos) { + if (!cJSON_IsObject(dnn_infos_local)) { + ogs_error("OpenAPI_snssai_info_parseFromJSON() failed [dnn_infos]"); + goto end; + } + OpenAPI_dnn_info_t *dnn_infosItem = OpenAPI_dnn_info_parseFromJSON(dnn_infos_local); + if (!dnn_infosItem) { + ogs_error("No dnn_infosItem"); + OpenAPI_list_free(dnn_infosList); + goto end; + } + OpenAPI_list_add(dnn_infosList, dnn_infosItem); } - OpenAPI_list_add(dnn_infosList, dnn_infosItem); - } - snssai_info_local_var = OpenAPI_snssai_info_create ( dnn_infosList ); return snssai_info_local_var; end: + if (dnn_infosList) { + OpenAPI_list_for_each(dnn_infosList, node) { + OpenAPI_dnn_info_free(node->data); + } + OpenAPI_list_free(dnn_infosList); + dnn_infosList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/snssai_route_selection_descriptor.c b/lib/sbi/openapi/model/snssai_route_selection_descriptor.c index cbcd84b39..e911dce61 100644 --- a/lib/sbi/openapi/model/snssai_route_selection_descriptor.c +++ b/lib/sbi/openapi/model/snssai_route_selection_descriptor.c @@ -20,21 +20,29 @@ OpenAPI_snssai_route_selection_descriptor_t *OpenAPI_snssai_route_selection_desc void OpenAPI_snssai_route_selection_descriptor_free(OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor) { + OpenAPI_lnode_t *node = NULL; + if (NULL == snssai_route_selection_descriptor) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(snssai_route_selection_descriptor->snssai); - OpenAPI_list_for_each(snssai_route_selection_descriptor->dnn_route_sel_descs, node) { - OpenAPI_dnn_route_selection_descriptor_free(node->data); + if (snssai_route_selection_descriptor->snssai) { + OpenAPI_snssai_free(snssai_route_selection_descriptor->snssai); + snssai_route_selection_descriptor->snssai = NULL; + } + if (snssai_route_selection_descriptor->dnn_route_sel_descs) { + OpenAPI_list_for_each(snssai_route_selection_descriptor->dnn_route_sel_descs, node) { + OpenAPI_dnn_route_selection_descriptor_free(node->data); + } + OpenAPI_list_free(snssai_route_selection_descriptor->dnn_route_sel_descs); + snssai_route_selection_descriptor->dnn_route_sel_descs = NULL; } - OpenAPI_list_free(snssai_route_selection_descriptor->dnn_route_sel_descs); ogs_free(snssai_route_selection_descriptor); } cJSON *OpenAPI_snssai_route_selection_descriptor_convertToJSON(OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (snssai_route_selection_descriptor == NULL) { ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [SnssaiRouteSelectionDescriptor]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_snssai_route_selection_descriptor_convertToJSON(OpenAPI_snssai_ro } item = cJSON_CreateObject(); + if (!snssai_route_selection_descriptor->snssai) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [snssai]"); + return NULL; + } cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(snssai_route_selection_descriptor->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [snssai]"); @@ -59,17 +71,13 @@ cJSON *OpenAPI_snssai_route_selection_descriptor_convertToJSON(OpenAPI_snssai_ro ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [dnn_route_sel_descs]"); goto end; } - - OpenAPI_lnode_t *dnn_route_sel_descs_node; - if (snssai_route_selection_descriptor->dnn_route_sel_descs) { - OpenAPI_list_for_each(snssai_route_selection_descriptor->dnn_route_sel_descs, dnn_route_sel_descs_node) { - cJSON *itemLocal = OpenAPI_dnn_route_selection_descriptor_convertToJSON(dnn_route_sel_descs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [dnn_route_sel_descs]"); - goto end; - } - cJSON_AddItemToArray(dnn_route_sel_descsList, itemLocal); + OpenAPI_list_for_each(snssai_route_selection_descriptor->dnn_route_sel_descs, node) { + cJSON *itemLocal = OpenAPI_dnn_route_selection_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_convertToJSON() failed [dnn_route_sel_descs]"); + goto end; } + cJSON_AddItemToArray(dnn_route_sel_descsList, itemLocal); } } @@ -80,42 +88,41 @@ end: OpenAPI_snssai_route_selection_descriptor_t *OpenAPI_snssai_route_selection_descriptor_parseFromJSON(cJSON *snssai_route_selection_descriptorJSON) { OpenAPI_snssai_route_selection_descriptor_t *snssai_route_selection_descriptor_local_var = NULL; - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(snssai_route_selection_descriptorJSON, "snssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *dnn_route_sel_descs = NULL; + OpenAPI_list_t *dnn_route_sel_descsList = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(snssai_route_selection_descriptorJSON, "snssai"); if (!snssai) { ogs_error("OpenAPI_snssai_route_selection_descriptor_parseFromJSON() failed [snssai]"); goto end; } - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); - cJSON *dnn_route_sel_descs = cJSON_GetObjectItemCaseSensitive(snssai_route_selection_descriptorJSON, "dnnRouteSelDescs"); - - OpenAPI_list_t *dnn_route_sel_descsList; + dnn_route_sel_descs = cJSON_GetObjectItemCaseSensitive(snssai_route_selection_descriptorJSON, "dnnRouteSelDescs"); if (dnn_route_sel_descs) { - cJSON *dnn_route_sel_descs_local_nonprimitive; - if (!cJSON_IsArray(dnn_route_sel_descs)){ - ogs_error("OpenAPI_snssai_route_selection_descriptor_parseFromJSON() failed [dnn_route_sel_descs]"); - goto end; - } - - dnn_route_sel_descsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(dnn_route_sel_descs_local_nonprimitive, dnn_route_sel_descs ) { - if (!cJSON_IsObject(dnn_route_sel_descs_local_nonprimitive)) { + cJSON *dnn_route_sel_descs_local = NULL; + if (!cJSON_IsArray(dnn_route_sel_descs)) { ogs_error("OpenAPI_snssai_route_selection_descriptor_parseFromJSON() failed [dnn_route_sel_descs]"); goto end; } - OpenAPI_dnn_route_selection_descriptor_t *dnn_route_sel_descsItem = OpenAPI_dnn_route_selection_descriptor_parseFromJSON(dnn_route_sel_descs_local_nonprimitive); - if (!dnn_route_sel_descsItem) { - ogs_error("No dnn_route_sel_descsItem"); - OpenAPI_list_free(dnn_route_sel_descsList); - goto end; + dnn_route_sel_descsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_route_sel_descs_local, dnn_route_sel_descs) { + if (!cJSON_IsObject(dnn_route_sel_descs_local)) { + ogs_error("OpenAPI_snssai_route_selection_descriptor_parseFromJSON() failed [dnn_route_sel_descs]"); + goto end; + } + OpenAPI_dnn_route_selection_descriptor_t *dnn_route_sel_descsItem = OpenAPI_dnn_route_selection_descriptor_parseFromJSON(dnn_route_sel_descs_local); + if (!dnn_route_sel_descsItem) { + ogs_error("No dnn_route_sel_descsItem"); + OpenAPI_list_free(dnn_route_sel_descsList); + goto end; + } + OpenAPI_list_add(dnn_route_sel_descsList, dnn_route_sel_descsItem); } - - OpenAPI_list_add(dnn_route_sel_descsList, dnn_route_sel_descsItem); - } } snssai_route_selection_descriptor_local_var = OpenAPI_snssai_route_selection_descriptor_create ( @@ -125,6 +132,17 @@ OpenAPI_snssai_route_selection_descriptor_t *OpenAPI_snssai_route_selection_desc return snssai_route_selection_descriptor_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (dnn_route_sel_descsList) { + OpenAPI_list_for_each(dnn_route_sel_descsList, node) { + OpenAPI_dnn_route_selection_descriptor_free(node->data); + } + OpenAPI_list_free(dnn_route_sel_descsList); + dnn_route_sel_descsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/snssai_smf_info_item.c b/lib/sbi/openapi/model/snssai_smf_info_item.c index c91bef42d..82ee02e85 100644 --- a/lib/sbi/openapi/model/snssai_smf_info_item.c +++ b/lib/sbi/openapi/model/snssai_smf_info_item.c @@ -20,21 +20,29 @@ OpenAPI_snssai_smf_info_item_t *OpenAPI_snssai_smf_info_item_create( void OpenAPI_snssai_smf_info_item_free(OpenAPI_snssai_smf_info_item_t *snssai_smf_info_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == snssai_smf_info_item) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(snssai_smf_info_item->s_nssai); - OpenAPI_list_for_each(snssai_smf_info_item->dnn_smf_info_list, node) { - OpenAPI_dnn_smf_info_item_free(node->data); + if (snssai_smf_info_item->s_nssai) { + OpenAPI_snssai_free(snssai_smf_info_item->s_nssai); + snssai_smf_info_item->s_nssai = NULL; + } + if (snssai_smf_info_item->dnn_smf_info_list) { + OpenAPI_list_for_each(snssai_smf_info_item->dnn_smf_info_list, node) { + OpenAPI_dnn_smf_info_item_free(node->data); + } + OpenAPI_list_free(snssai_smf_info_item->dnn_smf_info_list); + snssai_smf_info_item->dnn_smf_info_list = NULL; } - OpenAPI_list_free(snssai_smf_info_item->dnn_smf_info_list); ogs_free(snssai_smf_info_item); } cJSON *OpenAPI_snssai_smf_info_item_convertToJSON(OpenAPI_snssai_smf_info_item_t *snssai_smf_info_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (snssai_smf_info_item == NULL) { ogs_error("OpenAPI_snssai_smf_info_item_convertToJSON() failed [SnssaiSmfInfoItem]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_snssai_smf_info_item_convertToJSON(OpenAPI_snssai_smf_info_item_t } item = cJSON_CreateObject(); + if (!snssai_smf_info_item->s_nssai) { + ogs_error("OpenAPI_snssai_smf_info_item_convertToJSON() failed [s_nssai]"); + return NULL; + } cJSON *s_nssai_local_JSON = OpenAPI_snssai_convertToJSON(snssai_smf_info_item->s_nssai); if (s_nssai_local_JSON == NULL) { ogs_error("OpenAPI_snssai_smf_info_item_convertToJSON() failed [s_nssai]"); @@ -53,22 +65,22 @@ cJSON *OpenAPI_snssai_smf_info_item_convertToJSON(OpenAPI_snssai_smf_info_item_t goto end; } + if (!snssai_smf_info_item->dnn_smf_info_list) { + ogs_error("OpenAPI_snssai_smf_info_item_convertToJSON() failed [dnn_smf_info_list]"); + return NULL; + } cJSON *dnn_smf_info_listList = cJSON_AddArrayToObject(item, "dnnSmfInfoList"); if (dnn_smf_info_listList == NULL) { ogs_error("OpenAPI_snssai_smf_info_item_convertToJSON() failed [dnn_smf_info_list]"); goto end; } - - OpenAPI_lnode_t *dnn_smf_info_list_node; - if (snssai_smf_info_item->dnn_smf_info_list) { - OpenAPI_list_for_each(snssai_smf_info_item->dnn_smf_info_list, dnn_smf_info_list_node) { - cJSON *itemLocal = OpenAPI_dnn_smf_info_item_convertToJSON(dnn_smf_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_snssai_smf_info_item_convertToJSON() failed [dnn_smf_info_list]"); - goto end; - } - cJSON_AddItemToArray(dnn_smf_info_listList, itemLocal); + OpenAPI_list_for_each(snssai_smf_info_item->dnn_smf_info_list, node) { + cJSON *itemLocal = OpenAPI_dnn_smf_info_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_snssai_smf_info_item_convertToJSON() failed [dnn_smf_info_list]"); + goto end; } + cJSON_AddItemToArray(dnn_smf_info_listList, itemLocal); } end: @@ -78,46 +90,45 @@ end: OpenAPI_snssai_smf_info_item_t *OpenAPI_snssai_smf_info_item_parseFromJSON(cJSON *snssai_smf_info_itemJSON) { OpenAPI_snssai_smf_info_item_t *snssai_smf_info_item_local_var = NULL; - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(snssai_smf_info_itemJSON, "sNssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *dnn_smf_info_list = NULL; + OpenAPI_list_t *dnn_smf_info_listList = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(snssai_smf_info_itemJSON, "sNssai"); if (!s_nssai) { ogs_error("OpenAPI_snssai_smf_info_item_parseFromJSON() failed [s_nssai]"); goto end; } - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); - cJSON *dnn_smf_info_list = cJSON_GetObjectItemCaseSensitive(snssai_smf_info_itemJSON, "dnnSmfInfoList"); + dnn_smf_info_list = cJSON_GetObjectItemCaseSensitive(snssai_smf_info_itemJSON, "dnnSmfInfoList"); if (!dnn_smf_info_list) { ogs_error("OpenAPI_snssai_smf_info_item_parseFromJSON() failed [dnn_smf_info_list]"); goto end; } - - OpenAPI_list_t *dnn_smf_info_listList; - cJSON *dnn_smf_info_list_local_nonprimitive; - if (!cJSON_IsArray(dnn_smf_info_list)){ - ogs_error("OpenAPI_snssai_smf_info_item_parseFromJSON() failed [dnn_smf_info_list]"); - goto end; - } - - dnn_smf_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(dnn_smf_info_list_local_nonprimitive, dnn_smf_info_list ) { - if (!cJSON_IsObject(dnn_smf_info_list_local_nonprimitive)) { + cJSON *dnn_smf_info_list_local = NULL; + if (!cJSON_IsArray(dnn_smf_info_list)) { ogs_error("OpenAPI_snssai_smf_info_item_parseFromJSON() failed [dnn_smf_info_list]"); goto end; } - OpenAPI_dnn_smf_info_item_t *dnn_smf_info_listItem = OpenAPI_dnn_smf_info_item_parseFromJSON(dnn_smf_info_list_local_nonprimitive); - if (!dnn_smf_info_listItem) { - ogs_error("No dnn_smf_info_listItem"); - OpenAPI_list_free(dnn_smf_info_listList); - goto end; + dnn_smf_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_smf_info_list_local, dnn_smf_info_list) { + if (!cJSON_IsObject(dnn_smf_info_list_local)) { + ogs_error("OpenAPI_snssai_smf_info_item_parseFromJSON() failed [dnn_smf_info_list]"); + goto end; + } + OpenAPI_dnn_smf_info_item_t *dnn_smf_info_listItem = OpenAPI_dnn_smf_info_item_parseFromJSON(dnn_smf_info_list_local); + if (!dnn_smf_info_listItem) { + ogs_error("No dnn_smf_info_listItem"); + OpenAPI_list_free(dnn_smf_info_listList); + goto end; + } + OpenAPI_list_add(dnn_smf_info_listList, dnn_smf_info_listItem); } - OpenAPI_list_add(dnn_smf_info_listList, dnn_smf_info_listItem); - } - snssai_smf_info_item_local_var = OpenAPI_snssai_smf_info_item_create ( s_nssai_local_nonprim, dnn_smf_info_listList @@ -125,6 +136,17 @@ OpenAPI_snssai_smf_info_item_t *OpenAPI_snssai_smf_info_item_parseFromJSON(cJSON return snssai_smf_info_item_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (dnn_smf_info_listList) { + OpenAPI_list_for_each(dnn_smf_info_listList, node) { + OpenAPI_dnn_smf_info_item_free(node->data); + } + OpenAPI_list_free(dnn_smf_info_listList); + dnn_smf_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/snssai_upf_info_item.c b/lib/sbi/openapi/model/snssai_upf_info_item.c index 216e8be32..fda0234c5 100644 --- a/lib/sbi/openapi/model/snssai_upf_info_item.c +++ b/lib/sbi/openapi/model/snssai_upf_info_item.c @@ -24,21 +24,29 @@ OpenAPI_snssai_upf_info_item_t *OpenAPI_snssai_upf_info_item_create( void OpenAPI_snssai_upf_info_item_free(OpenAPI_snssai_upf_info_item_t *snssai_upf_info_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == snssai_upf_info_item) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(snssai_upf_info_item->s_nssai); - OpenAPI_list_for_each(snssai_upf_info_item->dnn_upf_info_list, node) { - OpenAPI_dnn_upf_info_item_free(node->data); + if (snssai_upf_info_item->s_nssai) { + OpenAPI_snssai_free(snssai_upf_info_item->s_nssai); + snssai_upf_info_item->s_nssai = NULL; + } + if (snssai_upf_info_item->dnn_upf_info_list) { + OpenAPI_list_for_each(snssai_upf_info_item->dnn_upf_info_list, node) { + OpenAPI_dnn_upf_info_item_free(node->data); + } + OpenAPI_list_free(snssai_upf_info_item->dnn_upf_info_list); + snssai_upf_info_item->dnn_upf_info_list = NULL; } - OpenAPI_list_free(snssai_upf_info_item->dnn_upf_info_list); ogs_free(snssai_upf_info_item); } cJSON *OpenAPI_snssai_upf_info_item_convertToJSON(OpenAPI_snssai_upf_info_item_t *snssai_upf_info_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (snssai_upf_info_item == NULL) { ogs_error("OpenAPI_snssai_upf_info_item_convertToJSON() failed [SnssaiUpfInfoItem]"); @@ -46,6 +54,10 @@ cJSON *OpenAPI_snssai_upf_info_item_convertToJSON(OpenAPI_snssai_upf_info_item_t } item = cJSON_CreateObject(); + if (!snssai_upf_info_item->s_nssai) { + ogs_error("OpenAPI_snssai_upf_info_item_convertToJSON() failed [s_nssai]"); + return NULL; + } cJSON *s_nssai_local_JSON = OpenAPI_snssai_convertToJSON(snssai_upf_info_item->s_nssai); if (s_nssai_local_JSON == NULL) { ogs_error("OpenAPI_snssai_upf_info_item_convertToJSON() failed [s_nssai]"); @@ -57,22 +69,22 @@ cJSON *OpenAPI_snssai_upf_info_item_convertToJSON(OpenAPI_snssai_upf_info_item_t goto end; } + if (!snssai_upf_info_item->dnn_upf_info_list) { + ogs_error("OpenAPI_snssai_upf_info_item_convertToJSON() failed [dnn_upf_info_list]"); + return NULL; + } cJSON *dnn_upf_info_listList = cJSON_AddArrayToObject(item, "dnnUpfInfoList"); if (dnn_upf_info_listList == NULL) { ogs_error("OpenAPI_snssai_upf_info_item_convertToJSON() failed [dnn_upf_info_list]"); goto end; } - - OpenAPI_lnode_t *dnn_upf_info_list_node; - if (snssai_upf_info_item->dnn_upf_info_list) { - OpenAPI_list_for_each(snssai_upf_info_item->dnn_upf_info_list, dnn_upf_info_list_node) { - cJSON *itemLocal = OpenAPI_dnn_upf_info_item_convertToJSON(dnn_upf_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_snssai_upf_info_item_convertToJSON() failed [dnn_upf_info_list]"); - goto end; - } - cJSON_AddItemToArray(dnn_upf_info_listList, itemLocal); + OpenAPI_list_for_each(snssai_upf_info_item->dnn_upf_info_list, node) { + cJSON *itemLocal = OpenAPI_dnn_upf_info_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_snssai_upf_info_item_convertToJSON() failed [dnn_upf_info_list]"); + goto end; } + cJSON_AddItemToArray(dnn_upf_info_listList, itemLocal); } if (snssai_upf_info_item->is_redundant_transport) { @@ -89,48 +101,47 @@ end: OpenAPI_snssai_upf_info_item_t *OpenAPI_snssai_upf_info_item_parseFromJSON(cJSON *snssai_upf_info_itemJSON) { OpenAPI_snssai_upf_info_item_t *snssai_upf_info_item_local_var = NULL; - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(snssai_upf_info_itemJSON, "sNssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *dnn_upf_info_list = NULL; + OpenAPI_list_t *dnn_upf_info_listList = NULL; + cJSON *redundant_transport = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(snssai_upf_info_itemJSON, "sNssai"); if (!s_nssai) { ogs_error("OpenAPI_snssai_upf_info_item_parseFromJSON() failed [s_nssai]"); goto end; } - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); - cJSON *dnn_upf_info_list = cJSON_GetObjectItemCaseSensitive(snssai_upf_info_itemJSON, "dnnUpfInfoList"); + dnn_upf_info_list = cJSON_GetObjectItemCaseSensitive(snssai_upf_info_itemJSON, "dnnUpfInfoList"); if (!dnn_upf_info_list) { ogs_error("OpenAPI_snssai_upf_info_item_parseFromJSON() failed [dnn_upf_info_list]"); goto end; } - - OpenAPI_list_t *dnn_upf_info_listList; - cJSON *dnn_upf_info_list_local_nonprimitive; - if (!cJSON_IsArray(dnn_upf_info_list)){ - ogs_error("OpenAPI_snssai_upf_info_item_parseFromJSON() failed [dnn_upf_info_list]"); - goto end; - } - - dnn_upf_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(dnn_upf_info_list_local_nonprimitive, dnn_upf_info_list ) { - if (!cJSON_IsObject(dnn_upf_info_list_local_nonprimitive)) { + cJSON *dnn_upf_info_list_local = NULL; + if (!cJSON_IsArray(dnn_upf_info_list)) { ogs_error("OpenAPI_snssai_upf_info_item_parseFromJSON() failed [dnn_upf_info_list]"); goto end; } - OpenAPI_dnn_upf_info_item_t *dnn_upf_info_listItem = OpenAPI_dnn_upf_info_item_parseFromJSON(dnn_upf_info_list_local_nonprimitive); - if (!dnn_upf_info_listItem) { - ogs_error("No dnn_upf_info_listItem"); - OpenAPI_list_free(dnn_upf_info_listList); - goto end; + dnn_upf_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_upf_info_list_local, dnn_upf_info_list) { + if (!cJSON_IsObject(dnn_upf_info_list_local)) { + ogs_error("OpenAPI_snssai_upf_info_item_parseFromJSON() failed [dnn_upf_info_list]"); + goto end; + } + OpenAPI_dnn_upf_info_item_t *dnn_upf_info_listItem = OpenAPI_dnn_upf_info_item_parseFromJSON(dnn_upf_info_list_local); + if (!dnn_upf_info_listItem) { + ogs_error("No dnn_upf_info_listItem"); + OpenAPI_list_free(dnn_upf_info_listList); + goto end; + } + OpenAPI_list_add(dnn_upf_info_listList, dnn_upf_info_listItem); } - OpenAPI_list_add(dnn_upf_info_listList, dnn_upf_info_listItem); - } - - cJSON *redundant_transport = cJSON_GetObjectItemCaseSensitive(snssai_upf_info_itemJSON, "redundantTransport"); - + redundant_transport = cJSON_GetObjectItemCaseSensitive(snssai_upf_info_itemJSON, "redundantTransport"); if (redundant_transport) { if (!cJSON_IsBool(redundant_transport)) { ogs_error("OpenAPI_snssai_upf_info_item_parseFromJSON() failed [redundant_transport]"); @@ -147,6 +158,17 @@ OpenAPI_snssai_upf_info_item_t *OpenAPI_snssai_upf_info_item_parseFromJSON(cJSON return snssai_upf_info_item_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (dnn_upf_info_listList) { + OpenAPI_list_for_each(dnn_upf_info_listList, node) { + OpenAPI_dnn_upf_info_item_free(node->data); + } + OpenAPI_list_free(dnn_upf_info_listList); + dnn_upf_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sor_data.c b/lib/sbi/openapi/model/sor_data.c index c74911b9e..2f4cc5bbd 100644 --- a/lib/sbi/openapi/model/sor_data.c +++ b/lib/sbi/openapi/model/sor_data.c @@ -24,19 +24,30 @@ OpenAPI_sor_data_t *OpenAPI_sor_data_create( void OpenAPI_sor_data_free(OpenAPI_sor_data_t *sor_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sor_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(sor_data->provisioning_time); - ogs_free(sor_data->sor_xmac_iue); - ogs_free(sor_data->sor_mac_iue); + if (sor_data->provisioning_time) { + ogs_free(sor_data->provisioning_time); + sor_data->provisioning_time = NULL; + } + if (sor_data->sor_xmac_iue) { + ogs_free(sor_data->sor_xmac_iue); + sor_data->sor_xmac_iue = NULL; + } + if (sor_data->sor_mac_iue) { + ogs_free(sor_data->sor_mac_iue); + sor_data->sor_mac_iue = NULL; + } ogs_free(sor_data); } cJSON *OpenAPI_sor_data_convertToJSON(OpenAPI_sor_data_t *sor_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sor_data == NULL) { ogs_error("OpenAPI_sor_data_convertToJSON() failed [SorData]"); @@ -44,11 +55,19 @@ cJSON *OpenAPI_sor_data_convertToJSON(OpenAPI_sor_data_t *sor_data) } item = cJSON_CreateObject(); + if (!sor_data->provisioning_time) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [provisioning_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "provisioningTime", sor_data->provisioning_time) == NULL) { ogs_error("OpenAPI_sor_data_convertToJSON() failed [provisioning_time]"); goto end; } + if (sor_data->ue_update_status == OpenAPI_ue_update_status_NULL) { + ogs_error("OpenAPI_sor_data_convertToJSON() failed [ue_update_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ueUpdateStatus", OpenAPI_ue_update_status_ToString(sor_data->ue_update_status)) == NULL) { ogs_error("OpenAPI_sor_data_convertToJSON() failed [ue_update_status]"); goto end; @@ -75,43 +94,44 @@ end: OpenAPI_sor_data_t *OpenAPI_sor_data_parseFromJSON(cJSON *sor_dataJSON) { OpenAPI_sor_data_t *sor_data_local_var = NULL; - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "provisioningTime"); + OpenAPI_lnode_t *node = NULL; + cJSON *provisioning_time = NULL; + cJSON *ue_update_status = NULL; + OpenAPI_ue_update_status_e ue_update_statusVariable = 0; + cJSON *sor_xmac_iue = NULL; + cJSON *sor_mac_iue = NULL; + provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "provisioningTime"); if (!provisioning_time) { ogs_error("OpenAPI_sor_data_parseFromJSON() failed [provisioning_time]"); goto end; } - - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_sor_data_parseFromJSON() failed [provisioning_time]"); goto end; } - cJSON *ue_update_status = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "ueUpdateStatus"); + ue_update_status = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "ueUpdateStatus"); if (!ue_update_status) { ogs_error("OpenAPI_sor_data_parseFromJSON() failed [ue_update_status]"); goto end; } - - OpenAPI_ue_update_status_e ue_update_statusVariable; if (!cJSON_IsString(ue_update_status)) { ogs_error("OpenAPI_sor_data_parseFromJSON() failed [ue_update_status]"); goto end; } ue_update_statusVariable = OpenAPI_ue_update_status_FromString(ue_update_status->valuestring); - cJSON *sor_xmac_iue = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "sorXmacIue"); - + sor_xmac_iue = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "sorXmacIue"); if (sor_xmac_iue) { - if (!cJSON_IsString(sor_xmac_iue)) { + if (!cJSON_IsString(sor_xmac_iue) && !cJSON_IsNull(sor_xmac_iue)) { ogs_error("OpenAPI_sor_data_parseFromJSON() failed [sor_xmac_iue]"); goto end; } } - cJSON *sor_mac_iue = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "sorMacIue"); - + sor_mac_iue = cJSON_GetObjectItemCaseSensitive(sor_dataJSON, "sorMacIue"); if (sor_mac_iue) { - if (!cJSON_IsString(sor_mac_iue)) { + if (!cJSON_IsString(sor_mac_iue) && !cJSON_IsNull(sor_mac_iue)) { ogs_error("OpenAPI_sor_data_parseFromJSON() failed [sor_mac_iue]"); goto end; } @@ -120,8 +140,8 @@ OpenAPI_sor_data_t *OpenAPI_sor_data_parseFromJSON(cJSON *sor_dataJSON) sor_data_local_var = OpenAPI_sor_data_create ( ogs_strdup(provisioning_time->valuestring), ue_update_statusVariable, - sor_xmac_iue ? ogs_strdup(sor_xmac_iue->valuestring) : NULL, - sor_mac_iue ? ogs_strdup(sor_mac_iue->valuestring) : NULL + sor_xmac_iue && !cJSON_IsNull(sor_xmac_iue) ? ogs_strdup(sor_xmac_iue->valuestring) : NULL, + sor_mac_iue && !cJSON_IsNull(sor_mac_iue) ? ogs_strdup(sor_mac_iue->valuestring) : NULL ); return sor_data_local_var; diff --git a/lib/sbi/openapi/model/sor_info.c b/lib/sbi/openapi/model/sor_info.c index 3ca14fac0..37e4ca3f8 100644 --- a/lib/sbi/openapi/model/sor_info.c +++ b/lib/sbi/openapi/model/sor_info.c @@ -26,20 +26,34 @@ OpenAPI_sor_info_t *OpenAPI_sor_info_create( void OpenAPI_sor_info_free(OpenAPI_sor_info_t *sor_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sor_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_steering_container_free(sor_info->steering_container); - ogs_free(sor_info->sor_mac_iausf); - ogs_free(sor_info->countersor); - ogs_free(sor_info->provisioning_time); + if (sor_info->steering_container) { + OpenAPI_steering_container_free(sor_info->steering_container); + sor_info->steering_container = NULL; + } + if (sor_info->sor_mac_iausf) { + ogs_free(sor_info->sor_mac_iausf); + sor_info->sor_mac_iausf = NULL; + } + if (sor_info->countersor) { + ogs_free(sor_info->countersor); + sor_info->countersor = NULL; + } + if (sor_info->provisioning_time) { + ogs_free(sor_info->provisioning_time); + sor_info->provisioning_time = NULL; + } ogs_free(sor_info); } cJSON *OpenAPI_sor_info_convertToJSON(OpenAPI_sor_info_t *sor_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sor_info == NULL) { ogs_error("OpenAPI_sor_info_convertToJSON() failed [SorInfo]"); @@ -79,6 +93,10 @@ cJSON *OpenAPI_sor_info_convertToJSON(OpenAPI_sor_info_t *sor_info) } } + if (!sor_info->provisioning_time) { + ogs_error("OpenAPI_sor_info_convertToJSON() failed [provisioning_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "provisioningTime", sor_info->provisioning_time) == NULL) { ogs_error("OpenAPI_sor_info_convertToJSON() failed [provisioning_time]"); goto end; @@ -91,49 +109,50 @@ end: OpenAPI_sor_info_t *OpenAPI_sor_info_parseFromJSON(cJSON *sor_infoJSON) { OpenAPI_sor_info_t *sor_info_local_var = NULL; - cJSON *steering_container = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "steeringContainer"); - + OpenAPI_lnode_t *node = NULL; + cJSON *steering_container = NULL; OpenAPI_steering_container_t *steering_container_local_nonprim = NULL; + cJSON *ack_ind = NULL; + cJSON *sor_mac_iausf = NULL; + cJSON *countersor = NULL; + cJSON *provisioning_time = NULL; + steering_container = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "steeringContainer"); if (steering_container) { steering_container_local_nonprim = OpenAPI_steering_container_parseFromJSON(steering_container); } - cJSON *ack_ind = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "ackInd"); + ack_ind = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "ackInd"); if (!ack_ind) { ogs_error("OpenAPI_sor_info_parseFromJSON() failed [ack_ind]"); goto end; } - if (!cJSON_IsBool(ack_ind)) { ogs_error("OpenAPI_sor_info_parseFromJSON() failed [ack_ind]"); goto end; } - cJSON *sor_mac_iausf = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "sorMacIausf"); - + sor_mac_iausf = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "sorMacIausf"); if (sor_mac_iausf) { - if (!cJSON_IsString(sor_mac_iausf)) { + if (!cJSON_IsString(sor_mac_iausf) && !cJSON_IsNull(sor_mac_iausf)) { ogs_error("OpenAPI_sor_info_parseFromJSON() failed [sor_mac_iausf]"); goto end; } } - cJSON *countersor = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "countersor"); - + countersor = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "countersor"); if (countersor) { - if (!cJSON_IsString(countersor)) { + if (!cJSON_IsString(countersor) && !cJSON_IsNull(countersor)) { ogs_error("OpenAPI_sor_info_parseFromJSON() failed [countersor]"); goto end; } } - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "provisioningTime"); + provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_infoJSON, "provisioningTime"); if (!provisioning_time) { ogs_error("OpenAPI_sor_info_parseFromJSON() failed [provisioning_time]"); goto end; } - - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_sor_info_parseFromJSON() failed [provisioning_time]"); goto end; } @@ -142,13 +161,17 @@ OpenAPI_sor_info_t *OpenAPI_sor_info_parseFromJSON(cJSON *sor_infoJSON) steering_container ? steering_container_local_nonprim : NULL, ack_ind->valueint, - sor_mac_iausf ? ogs_strdup(sor_mac_iausf->valuestring) : NULL, - countersor ? ogs_strdup(countersor->valuestring) : NULL, + sor_mac_iausf && !cJSON_IsNull(sor_mac_iausf) ? ogs_strdup(sor_mac_iausf->valuestring) : NULL, + countersor && !cJSON_IsNull(countersor) ? ogs_strdup(countersor->valuestring) : NULL, ogs_strdup(provisioning_time->valuestring) ); return sor_info_local_var; end: + if (steering_container_local_nonprim) { + OpenAPI_steering_container_free(steering_container_local_nonprim); + steering_container_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sor_info_1.c b/lib/sbi/openapi/model/sor_info_1.c index 2ee2ad841..a8041df07 100644 --- a/lib/sbi/openapi/model/sor_info_1.c +++ b/lib/sbi/openapi/model/sor_info_1.c @@ -26,20 +26,34 @@ OpenAPI_sor_info_1_t *OpenAPI_sor_info_1_create( void OpenAPI_sor_info_1_free(OpenAPI_sor_info_1_t *sor_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sor_info_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_steering_container_free(sor_info_1->steering_container); - ogs_free(sor_info_1->sor_mac_iausf); - ogs_free(sor_info_1->countersor); - ogs_free(sor_info_1->provisioning_time); + if (sor_info_1->steering_container) { + OpenAPI_steering_container_free(sor_info_1->steering_container); + sor_info_1->steering_container = NULL; + } + if (sor_info_1->sor_mac_iausf) { + ogs_free(sor_info_1->sor_mac_iausf); + sor_info_1->sor_mac_iausf = NULL; + } + if (sor_info_1->countersor) { + ogs_free(sor_info_1->countersor); + sor_info_1->countersor = NULL; + } + if (sor_info_1->provisioning_time) { + ogs_free(sor_info_1->provisioning_time); + sor_info_1->provisioning_time = NULL; + } ogs_free(sor_info_1); } cJSON *OpenAPI_sor_info_1_convertToJSON(OpenAPI_sor_info_1_t *sor_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sor_info_1 == NULL) { ogs_error("OpenAPI_sor_info_1_convertToJSON() failed [SorInfo_1]"); @@ -79,6 +93,10 @@ cJSON *OpenAPI_sor_info_1_convertToJSON(OpenAPI_sor_info_1_t *sor_info_1) } } + if (!sor_info_1->provisioning_time) { + ogs_error("OpenAPI_sor_info_1_convertToJSON() failed [provisioning_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "provisioningTime", sor_info_1->provisioning_time) == NULL) { ogs_error("OpenAPI_sor_info_1_convertToJSON() failed [provisioning_time]"); goto end; @@ -91,49 +109,50 @@ end: OpenAPI_sor_info_1_t *OpenAPI_sor_info_1_parseFromJSON(cJSON *sor_info_1JSON) { OpenAPI_sor_info_1_t *sor_info_1_local_var = NULL; - cJSON *steering_container = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "steeringContainer"); - + OpenAPI_lnode_t *node = NULL; + cJSON *steering_container = NULL; OpenAPI_steering_container_t *steering_container_local_nonprim = NULL; + cJSON *ack_ind = NULL; + cJSON *sor_mac_iausf = NULL; + cJSON *countersor = NULL; + cJSON *provisioning_time = NULL; + steering_container = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "steeringContainer"); if (steering_container) { steering_container_local_nonprim = OpenAPI_steering_container_parseFromJSON(steering_container); } - cJSON *ack_ind = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "ackInd"); + ack_ind = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "ackInd"); if (!ack_ind) { ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [ack_ind]"); goto end; } - if (!cJSON_IsBool(ack_ind)) { ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [ack_ind]"); goto end; } - cJSON *sor_mac_iausf = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "sorMacIausf"); - + sor_mac_iausf = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "sorMacIausf"); if (sor_mac_iausf) { - if (!cJSON_IsString(sor_mac_iausf)) { + if (!cJSON_IsString(sor_mac_iausf) && !cJSON_IsNull(sor_mac_iausf)) { ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [sor_mac_iausf]"); goto end; } } - cJSON *countersor = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "countersor"); - + countersor = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "countersor"); if (countersor) { - if (!cJSON_IsString(countersor)) { + if (!cJSON_IsString(countersor) && !cJSON_IsNull(countersor)) { ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [countersor]"); goto end; } } - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "provisioningTime"); + provisioning_time = cJSON_GetObjectItemCaseSensitive(sor_info_1JSON, "provisioningTime"); if (!provisioning_time) { ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [provisioning_time]"); goto end; } - - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_sor_info_1_parseFromJSON() failed [provisioning_time]"); goto end; } @@ -142,13 +161,17 @@ OpenAPI_sor_info_1_t *OpenAPI_sor_info_1_parseFromJSON(cJSON *sor_info_1JSON) steering_container ? steering_container_local_nonprim : NULL, ack_ind->valueint, - sor_mac_iausf ? ogs_strdup(sor_mac_iausf->valuestring) : NULL, - countersor ? ogs_strdup(countersor->valuestring) : NULL, + sor_mac_iausf && !cJSON_IsNull(sor_mac_iausf) ? ogs_strdup(sor_mac_iausf->valuestring) : NULL, + countersor && !cJSON_IsNull(countersor) ? ogs_strdup(countersor->valuestring) : NULL, ogs_strdup(provisioning_time->valuestring) ); return sor_info_1_local_var; end: + if (steering_container_local_nonprim) { + OpenAPI_steering_container_free(steering_container_local_nonprim); + steering_container_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sor_update_info.c b/lib/sbi/openapi/model/sor_update_info.c index ce53b3168..a1decdcd3 100644 --- a/lib/sbi/openapi/model/sor_update_info.c +++ b/lib/sbi/openapi/model/sor_update_info.c @@ -18,17 +18,22 @@ OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_create( void OpenAPI_sor_update_info_free(OpenAPI_sor_update_info_t *sor_update_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sor_update_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(sor_update_info->vplmn_id); + if (sor_update_info->vplmn_id) { + OpenAPI_plmn_id_free(sor_update_info->vplmn_id); + sor_update_info->vplmn_id = NULL; + } ogs_free(sor_update_info); } cJSON *OpenAPI_sor_update_info_convertToJSON(OpenAPI_sor_update_info_t *sor_update_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sor_update_info == NULL) { ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [SorUpdateInfo]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_sor_update_info_convertToJSON(OpenAPI_sor_update_info_t *sor_upda } item = cJSON_CreateObject(); + if (!sor_update_info->vplmn_id) { + ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]"); + return NULL; + } cJSON *vplmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(sor_update_info->vplmn_id); if (vplmn_id_local_JSON == NULL) { ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]"); @@ -54,13 +63,14 @@ end: OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_parseFromJSON(cJSON *sor_update_infoJSON) { OpenAPI_sor_update_info_t *sor_update_info_local_var = NULL; - cJSON *vplmn_id = cJSON_GetObjectItemCaseSensitive(sor_update_infoJSON, "vplmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *vplmn_id = NULL; + OpenAPI_plmn_id_t *vplmn_id_local_nonprim = NULL; + vplmn_id = cJSON_GetObjectItemCaseSensitive(sor_update_infoJSON, "vplmnId"); if (!vplmn_id) { ogs_error("OpenAPI_sor_update_info_parseFromJSON() failed [vplmn_id]"); goto end; } - - OpenAPI_plmn_id_t *vplmn_id_local_nonprim = NULL; vplmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(vplmn_id); sor_update_info_local_var = OpenAPI_sor_update_info_create ( @@ -69,6 +79,10 @@ OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_parseFromJSON(cJSON *sor_upda return sor_update_info_local_var; end: + if (vplmn_id_local_nonprim) { + OpenAPI_plmn_id_free(vplmn_id_local_nonprim); + vplmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/spatial_validity.c b/lib/sbi/openapi/model/spatial_validity.c index 14e5c6f10..b17c143b2 100644 --- a/lib/sbi/openapi/model/spatial_validity.c +++ b/lib/sbi/openapi/model/spatial_validity.c @@ -18,23 +18,28 @@ OpenAPI_spatial_validity_t *OpenAPI_spatial_validity_create( void OpenAPI_spatial_validity_free(OpenAPI_spatial_validity_t *spatial_validity) { + OpenAPI_lnode_t *node = NULL; + if (NULL == spatial_validity) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(spatial_validity->presence_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (spatial_validity->presence_info_list) { + OpenAPI_list_for_each(spatial_validity->presence_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(spatial_validity->presence_info_list); + spatial_validity->presence_info_list = NULL; } - OpenAPI_list_free(spatial_validity->presence_info_list); ogs_free(spatial_validity); } cJSON *OpenAPI_spatial_validity_convertToJSON(OpenAPI_spatial_validity_t *spatial_validity) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (spatial_validity == NULL) { ogs_error("OpenAPI_spatial_validity_convertToJSON() failed [SpatialValidity]"); @@ -42,26 +47,29 @@ cJSON *OpenAPI_spatial_validity_convertToJSON(OpenAPI_spatial_validity_t *spatia } item = cJSON_CreateObject(); + if (!spatial_validity->presence_info_list) { + ogs_error("OpenAPI_spatial_validity_convertToJSON() failed [presence_info_list]"); + return NULL; + } cJSON *presence_info_list = cJSON_AddObjectToObject(item, "presenceInfoList"); if (presence_info_list == NULL) { ogs_error("OpenAPI_spatial_validity_convertToJSON() failed [presence_info_list]"); goto end; } cJSON *localMapObject = presence_info_list; - OpenAPI_lnode_t *presence_info_list_node; if (spatial_validity->presence_info_list) { - OpenAPI_list_for_each(spatial_validity->presence_info_list, presence_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)presence_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_spatial_validity_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(spatial_validity->presence_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_spatial_validity_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } + } end: return item; @@ -70,33 +78,36 @@ end: OpenAPI_spatial_validity_t *OpenAPI_spatial_validity_parseFromJSON(cJSON *spatial_validityJSON) { OpenAPI_spatial_validity_t *spatial_validity_local_var = NULL; - cJSON *presence_info_list = cJSON_GetObjectItemCaseSensitive(spatial_validityJSON, "presenceInfoList"); + OpenAPI_lnode_t *node = NULL; + cJSON *presence_info_list = NULL; + OpenAPI_list_t *presence_info_listList = NULL; + presence_info_list = cJSON_GetObjectItemCaseSensitive(spatial_validityJSON, "presenceInfoList"); if (!presence_info_list) { ogs_error("OpenAPI_spatial_validity_parseFromJSON() failed [presence_info_list]"); goto end; } - - OpenAPI_list_t *presence_info_listList; - cJSON *presence_info_list_local_map; - if (!cJSON_IsObject(presence_info_list)) { - ogs_error("OpenAPI_spatial_validity_parseFromJSON() failed [presence_info_list]"); - goto end; - } - presence_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(presence_info_list_local_map, presence_info_list) { - cJSON *localMapObject = presence_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_spatial_validity_parseFromJSON() failed [inner]"); + cJSON *presence_info_list_local_map = NULL; + if (!cJSON_IsObject(presence_info_list) && !cJSON_IsNull(presence_info_list)) { + ogs_error("OpenAPI_spatial_validity_parseFromJSON() failed [presence_info_list]"); goto end; } - OpenAPI_list_add(presence_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(presence_info_list)) { + presence_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(presence_info_list_local_map, presence_info_list) { + cJSON *localMapObject = presence_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_spatial_validity_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(presence_info_listList, localMapKeyPair); + } + } spatial_validity_local_var = OpenAPI_spatial_validity_create ( presence_info_listList @@ -104,6 +115,16 @@ OpenAPI_spatial_validity_t *OpenAPI_spatial_validity_parseFromJSON(cJSON *spatia return spatial_validity_local_var; end: + if (presence_info_listList) { + OpenAPI_list_for_each(presence_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(presence_info_listList); + presence_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/spatial_validity_rm.c b/lib/sbi/openapi/model/spatial_validity_rm.c index a1ca52e10..f1a2b7795 100644 --- a/lib/sbi/openapi/model/spatial_validity_rm.c +++ b/lib/sbi/openapi/model/spatial_validity_rm.c @@ -18,23 +18,28 @@ OpenAPI_spatial_validity_rm_t *OpenAPI_spatial_validity_rm_create( void OpenAPI_spatial_validity_rm_free(OpenAPI_spatial_validity_rm_t *spatial_validity_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == spatial_validity_rm) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(spatial_validity_rm->presence_info_list, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (spatial_validity_rm->presence_info_list) { + OpenAPI_list_for_each(spatial_validity_rm->presence_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(spatial_validity_rm->presence_info_list); + spatial_validity_rm->presence_info_list = NULL; } - OpenAPI_list_free(spatial_validity_rm->presence_info_list); ogs_free(spatial_validity_rm); } cJSON *OpenAPI_spatial_validity_rm_convertToJSON(OpenAPI_spatial_validity_rm_t *spatial_validity_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (spatial_validity_rm == NULL) { ogs_error("OpenAPI_spatial_validity_rm_convertToJSON() failed [SpatialValidityRm]"); @@ -42,26 +47,29 @@ cJSON *OpenAPI_spatial_validity_rm_convertToJSON(OpenAPI_spatial_validity_rm_t * } item = cJSON_CreateObject(); + if (!spatial_validity_rm->presence_info_list) { + ogs_error("OpenAPI_spatial_validity_rm_convertToJSON() failed [presence_info_list]"); + return NULL; + } cJSON *presence_info_list = cJSON_AddObjectToObject(item, "presenceInfoList"); if (presence_info_list == NULL) { ogs_error("OpenAPI_spatial_validity_rm_convertToJSON() failed [presence_info_list]"); goto end; } cJSON *localMapObject = presence_info_list; - OpenAPI_lnode_t *presence_info_list_node; if (spatial_validity_rm->presence_info_list) { - OpenAPI_list_for_each(spatial_validity_rm->presence_info_list, presence_info_list_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)presence_info_list_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_spatial_validity_rm_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(spatial_validity_rm->presence_info_list, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_spatial_validity_rm_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } + } end: return item; @@ -70,33 +78,36 @@ end: OpenAPI_spatial_validity_rm_t *OpenAPI_spatial_validity_rm_parseFromJSON(cJSON *spatial_validity_rmJSON) { OpenAPI_spatial_validity_rm_t *spatial_validity_rm_local_var = NULL; - cJSON *presence_info_list = cJSON_GetObjectItemCaseSensitive(spatial_validity_rmJSON, "presenceInfoList"); + OpenAPI_lnode_t *node = NULL; + cJSON *presence_info_list = NULL; + OpenAPI_list_t *presence_info_listList = NULL; + presence_info_list = cJSON_GetObjectItemCaseSensitive(spatial_validity_rmJSON, "presenceInfoList"); if (!presence_info_list) { ogs_error("OpenAPI_spatial_validity_rm_parseFromJSON() failed [presence_info_list]"); goto end; } - - OpenAPI_list_t *presence_info_listList; - cJSON *presence_info_list_local_map; - if (!cJSON_IsObject(presence_info_list)) { - ogs_error("OpenAPI_spatial_validity_rm_parseFromJSON() failed [presence_info_list]"); - goto end; - } - presence_info_listList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(presence_info_list_local_map, presence_info_list) { - cJSON *localMapObject = presence_info_list_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_spatial_validity_rm_parseFromJSON() failed [inner]"); + cJSON *presence_info_list_local_map = NULL; + if (!cJSON_IsObject(presence_info_list) && !cJSON_IsNull(presence_info_list)) { + ogs_error("OpenAPI_spatial_validity_rm_parseFromJSON() failed [presence_info_list]"); goto end; } - OpenAPI_list_add(presence_info_listList, localMapKeyPair); - } + if (cJSON_IsObject(presence_info_list)) { + presence_info_listList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(presence_info_list_local_map, presence_info_list) { + cJSON *localMapObject = presence_info_list_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_spatial_validity_rm_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(presence_info_listList, localMapKeyPair); + } + } spatial_validity_rm_local_var = OpenAPI_spatial_validity_rm_create ( presence_info_listList @@ -104,6 +115,16 @@ OpenAPI_spatial_validity_rm_t *OpenAPI_spatial_validity_rm_parseFromJSON(cJSON * return spatial_validity_rm_local_var; end: + if (presence_info_listList) { + OpenAPI_list_for_each(presence_info_listList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(presence_info_listList); + presence_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/sponsor_connectivity_data.c b/lib/sbi/openapi/model/sponsor_connectivity_data.c index d134fd8db..2ae97b2a6 100644 --- a/lib/sbi/openapi/model/sponsor_connectivity_data.c +++ b/lib/sbi/openapi/model/sponsor_connectivity_data.c @@ -18,20 +18,25 @@ OpenAPI_sponsor_connectivity_data_t *OpenAPI_sponsor_connectivity_data_create( void OpenAPI_sponsor_connectivity_data_free(OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == sponsor_connectivity_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(sponsor_connectivity_data->asp_ids, node) { - ogs_free(node->data); + if (sponsor_connectivity_data->asp_ids) { + OpenAPI_list_for_each(sponsor_connectivity_data->asp_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(sponsor_connectivity_data->asp_ids); + sponsor_connectivity_data->asp_ids = NULL; } - OpenAPI_list_free(sponsor_connectivity_data->asp_ids); ogs_free(sponsor_connectivity_data); } cJSON *OpenAPI_sponsor_connectivity_data_convertToJSON(OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (sponsor_connectivity_data == NULL) { ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [SponsorConnectivityData]"); @@ -39,19 +44,21 @@ cJSON *OpenAPI_sponsor_connectivity_data_convertToJSON(OpenAPI_sponsor_connectiv } item = cJSON_CreateObject(); - cJSON *asp_ids = cJSON_AddArrayToObject(item, "aspIds"); - if (asp_ids == NULL) { + if (!sponsor_connectivity_data->asp_ids) { + ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [asp_ids]"); + return NULL; + } + cJSON *asp_idsList = cJSON_AddArrayToObject(item, "aspIds"); + if (asp_idsList == NULL) { ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [asp_ids]"); goto end; } - - OpenAPI_lnode_t *asp_ids_node; - OpenAPI_list_for_each(sponsor_connectivity_data->asp_ids, asp_ids_node) { - if (cJSON_AddStringToObject(asp_ids, "", (char*)asp_ids_node->data) == NULL) { - ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [asp_ids]"); - goto end; + OpenAPI_list_for_each(sponsor_connectivity_data->asp_ids, node) { + if (cJSON_AddStringToObject(asp_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_sponsor_connectivity_data_convertToJSON() failed [asp_ids]"); + goto end; + } } - } end: return item; @@ -60,27 +67,31 @@ end: OpenAPI_sponsor_connectivity_data_t *OpenAPI_sponsor_connectivity_data_parseFromJSON(cJSON *sponsor_connectivity_dataJSON) { OpenAPI_sponsor_connectivity_data_t *sponsor_connectivity_data_local_var = NULL; - cJSON *asp_ids = cJSON_GetObjectItemCaseSensitive(sponsor_connectivity_dataJSON, "aspIds"); + OpenAPI_lnode_t *node = NULL; + cJSON *asp_ids = NULL; + OpenAPI_list_t *asp_idsList = NULL; + asp_ids = cJSON_GetObjectItemCaseSensitive(sponsor_connectivity_dataJSON, "aspIds"); if (!asp_ids) { ogs_error("OpenAPI_sponsor_connectivity_data_parseFromJSON() failed [asp_ids]"); goto end; } + cJSON *asp_ids_local = NULL; + if (!cJSON_IsArray(asp_ids)) { + ogs_error("OpenAPI_sponsor_connectivity_data_parseFromJSON() failed [asp_ids]"); + goto end; + } - OpenAPI_list_t *asp_idsList; - cJSON *asp_ids_local; - if (!cJSON_IsArray(asp_ids)) { - ogs_error("OpenAPI_sponsor_connectivity_data_parseFromJSON() failed [asp_ids]"); - goto end; - } - asp_idsList = OpenAPI_list_create(); + asp_idsList = OpenAPI_list_create(); - cJSON_ArrayForEach(asp_ids_local, asp_ids) { - if (!cJSON_IsString(asp_ids_local)) { - ogs_error("OpenAPI_sponsor_connectivity_data_parseFromJSON() failed [asp_ids]"); - goto end; - } - OpenAPI_list_add(asp_idsList, ogs_strdup(asp_ids_local->valuestring)); - } + cJSON_ArrayForEach(asp_ids_local, asp_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(asp_ids_local)) { + ogs_error("OpenAPI_sponsor_connectivity_data_parseFromJSON() failed [asp_ids]"); + goto end; + } + OpenAPI_list_add(asp_idsList, ogs_strdup(asp_ids_local->valuestring)); + } sponsor_connectivity_data_local_var = OpenAPI_sponsor_connectivity_data_create ( asp_idsList @@ -88,6 +99,13 @@ OpenAPI_sponsor_connectivity_data_t *OpenAPI_sponsor_connectivity_data_parseFrom return sponsor_connectivity_data_local_var; end: + if (asp_idsList) { + OpenAPI_list_for_each(asp_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(asp_idsList); + asp_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ssc_modes.c b/lib/sbi/openapi/model/ssc_modes.c index 956fd9306..7f8e53f53 100644 --- a/lib/sbi/openapi/model/ssc_modes.c +++ b/lib/sbi/openapi/model/ssc_modes.c @@ -20,17 +20,22 @@ OpenAPI_ssc_modes_t *OpenAPI_ssc_modes_create( void OpenAPI_ssc_modes_free(OpenAPI_ssc_modes_t *ssc_modes) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ssc_modes) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(ssc_modes->allowed_ssc_modes); + if (ssc_modes->allowed_ssc_modes) { + OpenAPI_list_free(ssc_modes->allowed_ssc_modes); + ssc_modes->allowed_ssc_modes = NULL; + } ogs_free(ssc_modes); } cJSON *OpenAPI_ssc_modes_convertToJSON(OpenAPI_ssc_modes_t *ssc_modes) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ssc_modes == NULL) { ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [SscModes]"); @@ -38,20 +43,23 @@ cJSON *OpenAPI_ssc_modes_convertToJSON(OpenAPI_ssc_modes_t *ssc_modes) } item = cJSON_CreateObject(); + if (ssc_modes->default_ssc_mode == OpenAPI_ssc_mode_NULL) { + ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [default_ssc_mode]"); + return NULL; + } if (cJSON_AddStringToObject(item, "defaultSscMode", OpenAPI_ssc_mode_ToString(ssc_modes->default_ssc_mode)) == NULL) { ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [default_ssc_mode]"); goto end; } - if (ssc_modes->allowed_ssc_modes) { - cJSON *allowed_ssc_modes = cJSON_AddArrayToObject(item, "allowedSscModes"); - if (allowed_ssc_modes == NULL) { + if (ssc_modes->allowed_ssc_modes != OpenAPI_ssc_mode_NULL) { + cJSON *allowed_ssc_modesList = cJSON_AddArrayToObject(item, "allowedSscModes"); + if (allowed_ssc_modesList == NULL) { ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [allowed_ssc_modes]"); goto end; } - OpenAPI_lnode_t *allowed_ssc_modes_node; - OpenAPI_list_for_each(ssc_modes->allowed_ssc_modes, allowed_ssc_modes_node) { - if (cJSON_AddStringToObject(allowed_ssc_modes, "", OpenAPI_ssc_mode_ToString((intptr_t)allowed_ssc_modes_node->data)) == NULL) { + OpenAPI_list_for_each(ssc_modes->allowed_ssc_modes, node) { + if (cJSON_AddStringToObject(allowed_ssc_modesList, "", OpenAPI_ssc_mode_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_ssc_modes_convertToJSON() failed [allowed_ssc_modes]"); goto end; } @@ -65,39 +73,39 @@ end: OpenAPI_ssc_modes_t *OpenAPI_ssc_modes_parseFromJSON(cJSON *ssc_modesJSON) { OpenAPI_ssc_modes_t *ssc_modes_local_var = NULL; - cJSON *default_ssc_mode = cJSON_GetObjectItemCaseSensitive(ssc_modesJSON, "defaultSscMode"); + OpenAPI_lnode_t *node = NULL; + cJSON *default_ssc_mode = NULL; + OpenAPI_ssc_mode_e default_ssc_modeVariable = 0; + cJSON *allowed_ssc_modes = NULL; + OpenAPI_list_t *allowed_ssc_modesList = NULL; + default_ssc_mode = cJSON_GetObjectItemCaseSensitive(ssc_modesJSON, "defaultSscMode"); if (!default_ssc_mode) { ogs_error("OpenAPI_ssc_modes_parseFromJSON() failed [default_ssc_mode]"); goto end; } - - OpenAPI_ssc_mode_e default_ssc_modeVariable; if (!cJSON_IsString(default_ssc_mode)) { ogs_error("OpenAPI_ssc_modes_parseFromJSON() failed [default_ssc_mode]"); goto end; } default_ssc_modeVariable = OpenAPI_ssc_mode_FromString(default_ssc_mode->valuestring); - cJSON *allowed_ssc_modes = cJSON_GetObjectItemCaseSensitive(ssc_modesJSON, "allowedSscModes"); - - OpenAPI_list_t *allowed_ssc_modesList; + allowed_ssc_modes = cJSON_GetObjectItemCaseSensitive(ssc_modesJSON, "allowedSscModes"); if (allowed_ssc_modes) { - cJSON *allowed_ssc_modes_local_nonprimitive; - if (!cJSON_IsArray(allowed_ssc_modes)) { - ogs_error("OpenAPI_ssc_modes_parseFromJSON() failed [allowed_ssc_modes]"); - goto end; - } - - allowed_ssc_modesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_ssc_modes_local_nonprimitive, allowed_ssc_modes ) { - if (!cJSON_IsString(allowed_ssc_modes_local_nonprimitive)){ + cJSON *allowed_ssc_modes_local = NULL; + if (!cJSON_IsArray(allowed_ssc_modes)) { ogs_error("OpenAPI_ssc_modes_parseFromJSON() failed [allowed_ssc_modes]"); goto end; } - OpenAPI_list_add(allowed_ssc_modesList, (void *)OpenAPI_ssc_mode_FromString(allowed_ssc_modes_local_nonprimitive->valuestring)); - } + allowed_ssc_modesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_ssc_modes_local, allowed_ssc_modes) { + if (!cJSON_IsString(allowed_ssc_modes_local)) { + ogs_error("OpenAPI_ssc_modes_parseFromJSON() failed [allowed_ssc_modes]"); + goto end; + } + OpenAPI_list_add(allowed_ssc_modesList, (void *)OpenAPI_ssc_mode_FromString(allowed_ssc_modes_local->valuestring)); + } } ssc_modes_local_var = OpenAPI_ssc_modes_create ( @@ -107,6 +115,10 @@ OpenAPI_ssc_modes_t *OpenAPI_ssc_modes_parseFromJSON(cJSON *ssc_modesJSON) return ssc_modes_local_var; end: + if (allowed_ssc_modesList) { + OpenAPI_list_free(allowed_ssc_modesList); + allowed_ssc_modesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ssc_modes_1.c b/lib/sbi/openapi/model/ssc_modes_1.c index bf81a2964..ac56a08ff 100644 --- a/lib/sbi/openapi/model/ssc_modes_1.c +++ b/lib/sbi/openapi/model/ssc_modes_1.c @@ -20,17 +20,22 @@ OpenAPI_ssc_modes_1_t *OpenAPI_ssc_modes_1_create( void OpenAPI_ssc_modes_1_free(OpenAPI_ssc_modes_1_t *ssc_modes_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ssc_modes_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_free(ssc_modes_1->allowed_ssc_modes); + if (ssc_modes_1->allowed_ssc_modes) { + OpenAPI_list_free(ssc_modes_1->allowed_ssc_modes); + ssc_modes_1->allowed_ssc_modes = NULL; + } ogs_free(ssc_modes_1); } cJSON *OpenAPI_ssc_modes_1_convertToJSON(OpenAPI_ssc_modes_1_t *ssc_modes_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ssc_modes_1 == NULL) { ogs_error("OpenAPI_ssc_modes_1_convertToJSON() failed [SscModes_1]"); @@ -38,20 +43,23 @@ cJSON *OpenAPI_ssc_modes_1_convertToJSON(OpenAPI_ssc_modes_1_t *ssc_modes_1) } item = cJSON_CreateObject(); + if (ssc_modes_1->default_ssc_mode == OpenAPI_ssc_mode_NULL) { + ogs_error("OpenAPI_ssc_modes_1_convertToJSON() failed [default_ssc_mode]"); + return NULL; + } if (cJSON_AddStringToObject(item, "defaultSscMode", OpenAPI_ssc_mode_ToString(ssc_modes_1->default_ssc_mode)) == NULL) { ogs_error("OpenAPI_ssc_modes_1_convertToJSON() failed [default_ssc_mode]"); goto end; } - if (ssc_modes_1->allowed_ssc_modes) { - cJSON *allowed_ssc_modes = cJSON_AddArrayToObject(item, "allowedSscModes"); - if (allowed_ssc_modes == NULL) { + if (ssc_modes_1->allowed_ssc_modes != OpenAPI_ssc_mode_NULL) { + cJSON *allowed_ssc_modesList = cJSON_AddArrayToObject(item, "allowedSscModes"); + if (allowed_ssc_modesList == NULL) { ogs_error("OpenAPI_ssc_modes_1_convertToJSON() failed [allowed_ssc_modes]"); goto end; } - OpenAPI_lnode_t *allowed_ssc_modes_node; - OpenAPI_list_for_each(ssc_modes_1->allowed_ssc_modes, allowed_ssc_modes_node) { - if (cJSON_AddStringToObject(allowed_ssc_modes, "", OpenAPI_ssc_mode_ToString((intptr_t)allowed_ssc_modes_node->data)) == NULL) { + OpenAPI_list_for_each(ssc_modes_1->allowed_ssc_modes, node) { + if (cJSON_AddStringToObject(allowed_ssc_modesList, "", OpenAPI_ssc_mode_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_ssc_modes_1_convertToJSON() failed [allowed_ssc_modes]"); goto end; } @@ -65,39 +73,39 @@ end: OpenAPI_ssc_modes_1_t *OpenAPI_ssc_modes_1_parseFromJSON(cJSON *ssc_modes_1JSON) { OpenAPI_ssc_modes_1_t *ssc_modes_1_local_var = NULL; - cJSON *default_ssc_mode = cJSON_GetObjectItemCaseSensitive(ssc_modes_1JSON, "defaultSscMode"); + OpenAPI_lnode_t *node = NULL; + cJSON *default_ssc_mode = NULL; + OpenAPI_ssc_mode_e default_ssc_modeVariable = 0; + cJSON *allowed_ssc_modes = NULL; + OpenAPI_list_t *allowed_ssc_modesList = NULL; + default_ssc_mode = cJSON_GetObjectItemCaseSensitive(ssc_modes_1JSON, "defaultSscMode"); if (!default_ssc_mode) { ogs_error("OpenAPI_ssc_modes_1_parseFromJSON() failed [default_ssc_mode]"); goto end; } - - OpenAPI_ssc_mode_e default_ssc_modeVariable; if (!cJSON_IsString(default_ssc_mode)) { ogs_error("OpenAPI_ssc_modes_1_parseFromJSON() failed [default_ssc_mode]"); goto end; } default_ssc_modeVariable = OpenAPI_ssc_mode_FromString(default_ssc_mode->valuestring); - cJSON *allowed_ssc_modes = cJSON_GetObjectItemCaseSensitive(ssc_modes_1JSON, "allowedSscModes"); - - OpenAPI_list_t *allowed_ssc_modesList; + allowed_ssc_modes = cJSON_GetObjectItemCaseSensitive(ssc_modes_1JSON, "allowedSscModes"); if (allowed_ssc_modes) { - cJSON *allowed_ssc_modes_local_nonprimitive; - if (!cJSON_IsArray(allowed_ssc_modes)) { - ogs_error("OpenAPI_ssc_modes_1_parseFromJSON() failed [allowed_ssc_modes]"); - goto end; - } - - allowed_ssc_modesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(allowed_ssc_modes_local_nonprimitive, allowed_ssc_modes ) { - if (!cJSON_IsString(allowed_ssc_modes_local_nonprimitive)){ + cJSON *allowed_ssc_modes_local = NULL; + if (!cJSON_IsArray(allowed_ssc_modes)) { ogs_error("OpenAPI_ssc_modes_1_parseFromJSON() failed [allowed_ssc_modes]"); goto end; } - OpenAPI_list_add(allowed_ssc_modesList, (void *)OpenAPI_ssc_mode_FromString(allowed_ssc_modes_local_nonprimitive->valuestring)); - } + allowed_ssc_modesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(allowed_ssc_modes_local, allowed_ssc_modes) { + if (!cJSON_IsString(allowed_ssc_modes_local)) { + ogs_error("OpenAPI_ssc_modes_1_parseFromJSON() failed [allowed_ssc_modes]"); + goto end; + } + OpenAPI_list_add(allowed_ssc_modesList, (void *)OpenAPI_ssc_mode_FromString(allowed_ssc_modes_local->valuestring)); + } } ssc_modes_1_local_var = OpenAPI_ssc_modes_1_create ( @@ -107,6 +115,10 @@ OpenAPI_ssc_modes_1_t *OpenAPI_ssc_modes_1_parseFromJSON(cJSON *ssc_modes_1JSON) return ssc_modes_1_local_var; end: + if (allowed_ssc_modesList) { + OpenAPI_list_free(allowed_ssc_modesList); + allowed_ssc_modesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/stationary_indication_rm.c b/lib/sbi/openapi/model/stationary_indication_rm.c index 88b851329..4f148a1fa 100644 --- a/lib/sbi/openapi/model/stationary_indication_rm.c +++ b/lib/sbi/openapi/model/stationary_indication_rm.c @@ -16,16 +16,18 @@ OpenAPI_stationary_indication_rm_t *OpenAPI_stationary_indication_rm_create( void OpenAPI_stationary_indication_rm_free(OpenAPI_stationary_indication_rm_t *stationary_indication_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == stationary_indication_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(stationary_indication_rm); } cJSON *OpenAPI_stationary_indication_rm_convertToJSON(OpenAPI_stationary_indication_rm_t *stationary_indication_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (stationary_indication_rm == NULL) { ogs_error("OpenAPI_stationary_indication_rm_convertToJSON() failed [StationaryIndicationRm]"); @@ -40,6 +42,7 @@ end: OpenAPI_stationary_indication_rm_t *OpenAPI_stationary_indication_rm_parseFromJSON(cJSON *stationary_indication_rmJSON) { OpenAPI_stationary_indication_rm_t *stationary_indication_rm_local_var = NULL; + OpenAPI_lnode_t *node = NULL; stationary_indication_rm_local_var = OpenAPI_stationary_indication_rm_create ( ); diff --git a/lib/sbi/openapi/model/status_info.c b/lib/sbi/openapi/model/status_info.c index c654b07d6..ef60920c0 100644 --- a/lib/sbi/openapi/model/status_info.c +++ b/lib/sbi/openapi/model/status_info.c @@ -24,17 +24,22 @@ OpenAPI_status_info_t *OpenAPI_status_info_create( void OpenAPI_status_info_free(OpenAPI_status_info_t *status_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == status_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_cn_assisted_ran_para_free(status_info->cn_assisted_ran_para); + if (status_info->cn_assisted_ran_para) { + OpenAPI_cn_assisted_ran_para_free(status_info->cn_assisted_ran_para); + status_info->cn_assisted_ran_para = NULL; + } ogs_free(status_info); } cJSON *OpenAPI_status_info_convertToJSON(OpenAPI_status_info_t *status_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (status_info == NULL) { ogs_error("OpenAPI_status_info_convertToJSON() failed [StatusInfo]"); @@ -42,12 +47,16 @@ cJSON *OpenAPI_status_info_convertToJSON(OpenAPI_status_info_t *status_info) } item = cJSON_CreateObject(); + if (status_info->resource_status == OpenAPI_resource_status_NULL) { + ogs_error("OpenAPI_status_info_convertToJSON() failed [resource_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resourceStatus", OpenAPI_resource_status_ToString(status_info->resource_status)) == NULL) { ogs_error("OpenAPI_status_info_convertToJSON() failed [resource_status]"); goto end; } - if (status_info->cause) { + if (status_info->cause != OpenAPI_cause_NULL) { if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(status_info->cause)) == NULL) { ogs_error("OpenAPI_status_info_convertToJSON() failed [cause]"); goto end; @@ -67,7 +76,7 @@ cJSON *OpenAPI_status_info_convertToJSON(OpenAPI_status_info_t *status_info) } } - if (status_info->an_type) { + if (status_info->an_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "anType", OpenAPI_access_type_ToString(status_info->an_type)) == NULL) { ogs_error("OpenAPI_status_info_convertToJSON() failed [an_type]"); goto end; @@ -81,22 +90,27 @@ end: OpenAPI_status_info_t *OpenAPI_status_info_parseFromJSON(cJSON *status_infoJSON) { OpenAPI_status_info_t *status_info_local_var = NULL; - cJSON *resource_status = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "resourceStatus"); + OpenAPI_lnode_t *node = NULL; + cJSON *resource_status = NULL; + OpenAPI_resource_status_e resource_statusVariable = 0; + cJSON *cause = NULL; + OpenAPI_cause_e causeVariable = 0; + cJSON *cn_assisted_ran_para = NULL; + OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para_local_nonprim = NULL; + cJSON *an_type = NULL; + OpenAPI_access_type_e an_typeVariable = 0; + resource_status = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "resourceStatus"); if (!resource_status) { ogs_error("OpenAPI_status_info_parseFromJSON() failed [resource_status]"); goto end; } - - OpenAPI_resource_status_e resource_statusVariable; if (!cJSON_IsString(resource_status)) { ogs_error("OpenAPI_status_info_parseFromJSON() failed [resource_status]"); goto end; } resource_statusVariable = OpenAPI_resource_status_FromString(resource_status->valuestring); - cJSON *cause = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "cause"); - - OpenAPI_cause_e causeVariable; + cause = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "cause"); if (cause) { if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_status_info_parseFromJSON() failed [cause]"); @@ -105,16 +119,12 @@ OpenAPI_status_info_t *OpenAPI_status_info_parseFromJSON(cJSON *status_infoJSON) causeVariable = OpenAPI_cause_FromString(cause->valuestring); } - cJSON *cn_assisted_ran_para = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "cnAssistedRanPara"); - - OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para_local_nonprim = NULL; + cn_assisted_ran_para = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "cnAssistedRanPara"); if (cn_assisted_ran_para) { cn_assisted_ran_para_local_nonprim = OpenAPI_cn_assisted_ran_para_parseFromJSON(cn_assisted_ran_para); } - cJSON *an_type = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "anType"); - - OpenAPI_access_type_e an_typeVariable; + an_type = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "anType"); if (an_type) { if (!cJSON_IsString(an_type)) { ogs_error("OpenAPI_status_info_parseFromJSON() failed [an_type]"); @@ -132,6 +142,10 @@ OpenAPI_status_info_t *OpenAPI_status_info_parseFromJSON(cJSON *status_infoJSON) return status_info_local_var; end: + if (cn_assisted_ran_para_local_nonprim) { + OpenAPI_cn_assisted_ran_para_free(cn_assisted_ran_para_local_nonprim); + cn_assisted_ran_para_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/status_notification.c b/lib/sbi/openapi/model/status_notification.c index b2405b06e..2e3ffe90b 100644 --- a/lib/sbi/openapi/model/status_notification.c +++ b/lib/sbi/openapi/model/status_notification.c @@ -22,19 +22,30 @@ OpenAPI_status_notification_t *OpenAPI_status_notification_create( void OpenAPI_status_notification_free(OpenAPI_status_notification_t *status_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == status_notification) { return; } - OpenAPI_lnode_t *node; - OpenAPI_status_info_free(status_notification->status_info); - OpenAPI_small_data_rate_status_free(status_notification->small_data_rate_status); - OpenAPI_apn_rate_status_free(status_notification->apn_rate_status); + if (status_notification->status_info) { + OpenAPI_status_info_free(status_notification->status_info); + status_notification->status_info = NULL; + } + if (status_notification->small_data_rate_status) { + OpenAPI_small_data_rate_status_free(status_notification->small_data_rate_status); + status_notification->small_data_rate_status = NULL; + } + if (status_notification->apn_rate_status) { + OpenAPI_apn_rate_status_free(status_notification->apn_rate_status); + status_notification->apn_rate_status = NULL; + } ogs_free(status_notification); } cJSON *OpenAPI_status_notification_convertToJSON(OpenAPI_status_notification_t *status_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (status_notification == NULL) { ogs_error("OpenAPI_status_notification_convertToJSON() failed [StatusNotification]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_status_notification_convertToJSON(OpenAPI_status_notification_t * } item = cJSON_CreateObject(); + if (!status_notification->status_info) { + ogs_error("OpenAPI_status_notification_convertToJSON() failed [status_info]"); + return NULL; + } cJSON *status_info_local_JSON = OpenAPI_status_info_convertToJSON(status_notification->status_info); if (status_info_local_JSON == NULL) { ogs_error("OpenAPI_status_notification_convertToJSON() failed [status_info]"); @@ -86,25 +101,26 @@ end: OpenAPI_status_notification_t *OpenAPI_status_notification_parseFromJSON(cJSON *status_notificationJSON) { OpenAPI_status_notification_t *status_notification_local_var = NULL; - cJSON *status_info = cJSON_GetObjectItemCaseSensitive(status_notificationJSON, "statusInfo"); + OpenAPI_lnode_t *node = NULL; + cJSON *status_info = NULL; + OpenAPI_status_info_t *status_info_local_nonprim = NULL; + cJSON *small_data_rate_status = NULL; + OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + cJSON *apn_rate_status = NULL; + OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + status_info = cJSON_GetObjectItemCaseSensitive(status_notificationJSON, "statusInfo"); if (!status_info) { ogs_error("OpenAPI_status_notification_parseFromJSON() failed [status_info]"); goto end; } - - OpenAPI_status_info_t *status_info_local_nonprim = NULL; status_info_local_nonprim = OpenAPI_status_info_parseFromJSON(status_info); - cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(status_notificationJSON, "smallDataRateStatus"); - - OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL; + small_data_rate_status = cJSON_GetObjectItemCaseSensitive(status_notificationJSON, "smallDataRateStatus"); if (small_data_rate_status) { small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status); } - cJSON *apn_rate_status = cJSON_GetObjectItemCaseSensitive(status_notificationJSON, "apnRateStatus"); - - OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL; + apn_rate_status = cJSON_GetObjectItemCaseSensitive(status_notificationJSON, "apnRateStatus"); if (apn_rate_status) { apn_rate_status_local_nonprim = OpenAPI_apn_rate_status_parseFromJSON(apn_rate_status); } @@ -117,6 +133,18 @@ OpenAPI_status_notification_t *OpenAPI_status_notification_parseFromJSON(cJSON * return status_notification_local_var; end: + if (status_info_local_nonprim) { + OpenAPI_status_info_free(status_info_local_nonprim); + status_info_local_nonprim = NULL; + } + if (small_data_rate_status_local_nonprim) { + OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim); + small_data_rate_status_local_nonprim = NULL; + } + if (apn_rate_status_local_nonprim) { + OpenAPI_apn_rate_status_free(apn_rate_status_local_nonprim); + apn_rate_status_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/steering_container.c b/lib/sbi/openapi/model/steering_container.c index a9526cba8..8a5de0269 100644 --- a/lib/sbi/openapi/model/steering_container.c +++ b/lib/sbi/openapi/model/steering_container.c @@ -16,16 +16,18 @@ OpenAPI_steering_container_t *OpenAPI_steering_container_create( void OpenAPI_steering_container_free(OpenAPI_steering_container_t *steering_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == steering_container) { return; } - OpenAPI_lnode_t *node; ogs_free(steering_container); } cJSON *OpenAPI_steering_container_convertToJSON(OpenAPI_steering_container_t *steering_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (steering_container == NULL) { ogs_error("OpenAPI_steering_container_convertToJSON() failed [SteeringContainer]"); @@ -40,6 +42,7 @@ end: OpenAPI_steering_container_t *OpenAPI_steering_container_parseFromJSON(cJSON *steering_containerJSON) { OpenAPI_steering_container_t *steering_container_local_var = NULL; + OpenAPI_lnode_t *node = NULL; steering_container_local_var = OpenAPI_steering_container_create ( ); diff --git a/lib/sbi/openapi/model/steering_info.c b/lib/sbi/openapi/model/steering_info.c index 921e2bd78..2b88268b0 100644 --- a/lib/sbi/openapi/model/steering_info.c +++ b/lib/sbi/openapi/model/steering_info.c @@ -5,7 +5,7 @@ #include "steering_info.h" OpenAPI_steering_info_t *OpenAPI_steering_info_create( - OpenAPI_plmn_id_1_t *plmn_id, + OpenAPI_plmn_id_t *plmn_id, OpenAPI_list_t *access_tech_list ) { @@ -20,21 +20,29 @@ OpenAPI_steering_info_t *OpenAPI_steering_info_create( void OpenAPI_steering_info_free(OpenAPI_steering_info_t *steering_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == steering_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_1_free(steering_info->plmn_id); - OpenAPI_list_for_each(steering_info->access_tech_list, node) { - OpenAPI_access_tech_free(node->data); + if (steering_info->plmn_id) { + OpenAPI_plmn_id_free(steering_info->plmn_id); + steering_info->plmn_id = NULL; + } + if (steering_info->access_tech_list) { + OpenAPI_list_for_each(steering_info->access_tech_list, node) { + OpenAPI_access_tech_free(node->data); + } + OpenAPI_list_free(steering_info->access_tech_list); + steering_info->access_tech_list = NULL; } - OpenAPI_list_free(steering_info->access_tech_list); ogs_free(steering_info); } cJSON *OpenAPI_steering_info_convertToJSON(OpenAPI_steering_info_t *steering_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (steering_info == NULL) { ogs_error("OpenAPI_steering_info_convertToJSON() failed [SteeringInfo]"); @@ -42,7 +50,11 @@ cJSON *OpenAPI_steering_info_convertToJSON(OpenAPI_steering_info_t *steering_inf } item = cJSON_CreateObject(); - cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_1_convertToJSON(steering_info->plmn_id); + if (!steering_info->plmn_id) { + ogs_error("OpenAPI_steering_info_convertToJSON() failed [plmn_id]"); + return NULL; + } + cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(steering_info->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_steering_info_convertToJSON() failed [plmn_id]"); goto end; @@ -59,17 +71,13 @@ cJSON *OpenAPI_steering_info_convertToJSON(OpenAPI_steering_info_t *steering_inf ogs_error("OpenAPI_steering_info_convertToJSON() failed [access_tech_list]"); goto end; } - - OpenAPI_lnode_t *access_tech_list_node; - if (steering_info->access_tech_list) { - OpenAPI_list_for_each(steering_info->access_tech_list, access_tech_list_node) { - cJSON *itemLocal = OpenAPI_access_tech_convertToJSON(access_tech_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_steering_info_convertToJSON() failed [access_tech_list]"); - goto end; - } - cJSON_AddItemToArray(access_tech_listList, itemLocal); + OpenAPI_list_for_each(steering_info->access_tech_list, node) { + cJSON *itemLocal = OpenAPI_access_tech_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_steering_info_convertToJSON() failed [access_tech_list]"); + goto end; } + cJSON_AddItemToArray(access_tech_listList, itemLocal); } } @@ -80,42 +88,41 @@ end: OpenAPI_steering_info_t *OpenAPI_steering_info_parseFromJSON(cJSON *steering_infoJSON) { OpenAPI_steering_info_t *steering_info_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(steering_infoJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *access_tech_list = NULL; + OpenAPI_list_t *access_tech_listList = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(steering_infoJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_steering_info_parseFromJSON() failed [plmn_id]"); goto end; } + plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; - plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); - - cJSON *access_tech_list = cJSON_GetObjectItemCaseSensitive(steering_infoJSON, "accessTechList"); - - OpenAPI_list_t *access_tech_listList; + access_tech_list = cJSON_GetObjectItemCaseSensitive(steering_infoJSON, "accessTechList"); if (access_tech_list) { - cJSON *access_tech_list_local_nonprimitive; - if (!cJSON_IsArray(access_tech_list)){ - ogs_error("OpenAPI_steering_info_parseFromJSON() failed [access_tech_list]"); - goto end; - } - - access_tech_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(access_tech_list_local_nonprimitive, access_tech_list ) { - if (!cJSON_IsObject(access_tech_list_local_nonprimitive)) { + cJSON *access_tech_list_local = NULL; + if (!cJSON_IsArray(access_tech_list)) { ogs_error("OpenAPI_steering_info_parseFromJSON() failed [access_tech_list]"); goto end; } - OpenAPI_access_tech_t *access_tech_listItem = OpenAPI_access_tech_parseFromJSON(access_tech_list_local_nonprimitive); - if (!access_tech_listItem) { - ogs_error("No access_tech_listItem"); - OpenAPI_list_free(access_tech_listList); - goto end; + access_tech_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(access_tech_list_local, access_tech_list) { + if (!cJSON_IsObject(access_tech_list_local)) { + ogs_error("OpenAPI_steering_info_parseFromJSON() failed [access_tech_list]"); + goto end; + } + OpenAPI_access_tech_t *access_tech_listItem = OpenAPI_access_tech_parseFromJSON(access_tech_list_local); + if (!access_tech_listItem) { + ogs_error("No access_tech_listItem"); + OpenAPI_list_free(access_tech_listList); + goto end; + } + OpenAPI_list_add(access_tech_listList, access_tech_listItem); } - - OpenAPI_list_add(access_tech_listList, access_tech_listItem); - } } steering_info_local_var = OpenAPI_steering_info_create ( @@ -125,6 +132,17 @@ OpenAPI_steering_info_t *OpenAPI_steering_info_parseFromJSON(cJSON *steering_inf return steering_info_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (access_tech_listList) { + OpenAPI_list_for_each(access_tech_listList, node) { + OpenAPI_access_tech_free(node->data); + } + OpenAPI_list_free(access_tech_listList); + access_tech_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/steering_info.h b/lib/sbi/openapi/model/steering_info.h index 6734510f1..befd2e228 100644 --- a/lib/sbi/openapi/model/steering_info.h +++ b/lib/sbi/openapi/model/steering_info.h @@ -13,7 +13,7 @@ #include "../include/keyValuePair.h" #include "../include/binary.h" #include "access_tech.h" -#include "plmn_id_1.h" +#include "plmn_id.h" #ifdef __cplusplus extern "C" { @@ -21,12 +21,12 @@ extern "C" { typedef struct OpenAPI_steering_info_s OpenAPI_steering_info_t; typedef struct OpenAPI_steering_info_s { - struct OpenAPI_plmn_id_1_s *plmn_id; + struct OpenAPI_plmn_id_s *plmn_id; OpenAPI_list_t *access_tech_list; } OpenAPI_steering_info_t; OpenAPI_steering_info_t *OpenAPI_steering_info_create( - OpenAPI_plmn_id_1_t *plmn_id, + OpenAPI_plmn_id_t *plmn_id, OpenAPI_list_t *access_tech_list ); void OpenAPI_steering_info_free(OpenAPI_steering_info_t *steering_info); diff --git a/lib/sbi/openapi/model/steering_mode.c b/lib/sbi/openapi/model/steering_mode.c index 2049345e1..bb94d85f2 100644 --- a/lib/sbi/openapi/model/steering_mode.c +++ b/lib/sbi/openapi/model/steering_mode.c @@ -28,17 +28,22 @@ OpenAPI_steering_mode_t *OpenAPI_steering_mode_create( void OpenAPI_steering_mode_free(OpenAPI_steering_mode_t *steering_mode) { + OpenAPI_lnode_t *node = NULL; + if (NULL == steering_mode) { return; } - OpenAPI_lnode_t *node; - OpenAPI_access_type_rm_free(steering_mode->standby); + if (steering_mode->standby) { + OpenAPI_access_type_rm_free(steering_mode->standby); + steering_mode->standby = NULL; + } ogs_free(steering_mode); } cJSON *OpenAPI_steering_mode_convertToJSON(OpenAPI_steering_mode_t *steering_mode) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (steering_mode == NULL) { ogs_error("OpenAPI_steering_mode_convertToJSON() failed [SteeringMode]"); @@ -46,12 +51,16 @@ cJSON *OpenAPI_steering_mode_convertToJSON(OpenAPI_steering_mode_t *steering_mod } item = cJSON_CreateObject(); + if (steering_mode->steer_mode_value == OpenAPI_steer_mode_value_NULL) { + ogs_error("OpenAPI_steering_mode_convertToJSON() failed [steer_mode_value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "steerModeValue", OpenAPI_steer_mode_value_ToString(steering_mode->steer_mode_value)) == NULL) { ogs_error("OpenAPI_steering_mode_convertToJSON() failed [steer_mode_value]"); goto end; } - if (steering_mode->active) { + if (steering_mode->active != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "active", OpenAPI_access_type_ToString(steering_mode->active)) == NULL) { ogs_error("OpenAPI_steering_mode_convertToJSON() failed [active]"); goto end; @@ -78,7 +87,7 @@ cJSON *OpenAPI_steering_mode_convertToJSON(OpenAPI_steering_mode_t *steering_mod } } - if (steering_mode->prio_acc) { + if (steering_mode->prio_acc != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "prioAcc", OpenAPI_access_type_ToString(steering_mode->prio_acc)) == NULL) { ogs_error("OpenAPI_steering_mode_convertToJSON() failed [prio_acc]"); goto end; @@ -92,22 +101,28 @@ end: OpenAPI_steering_mode_t *OpenAPI_steering_mode_parseFromJSON(cJSON *steering_modeJSON) { OpenAPI_steering_mode_t *steering_mode_local_var = NULL; - cJSON *steer_mode_value = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "steerModeValue"); + OpenAPI_lnode_t *node = NULL; + cJSON *steer_mode_value = NULL; + OpenAPI_steer_mode_value_e steer_mode_valueVariable = 0; + cJSON *active = NULL; + OpenAPI_access_type_e activeVariable = 0; + cJSON *standby = NULL; + OpenAPI_access_type_rm_t *standby_local_nonprim = NULL; + cJSON *_3g_load = NULL; + cJSON *prio_acc = NULL; + OpenAPI_access_type_e prio_accVariable = 0; + steer_mode_value = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "steerModeValue"); if (!steer_mode_value) { ogs_error("OpenAPI_steering_mode_parseFromJSON() failed [steer_mode_value]"); goto end; } - - OpenAPI_steer_mode_value_e steer_mode_valueVariable; if (!cJSON_IsString(steer_mode_value)) { ogs_error("OpenAPI_steering_mode_parseFromJSON() failed [steer_mode_value]"); goto end; } steer_mode_valueVariable = OpenAPI_steer_mode_value_FromString(steer_mode_value->valuestring); - cJSON *active = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "active"); - - OpenAPI_access_type_e activeVariable; + active = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "active"); if (active) { if (!cJSON_IsString(active)) { ogs_error("OpenAPI_steering_mode_parseFromJSON() failed [active]"); @@ -116,15 +131,12 @@ OpenAPI_steering_mode_t *OpenAPI_steering_mode_parseFromJSON(cJSON *steering_mod activeVariable = OpenAPI_access_type_FromString(active->valuestring); } - cJSON *standby = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "standby"); - - OpenAPI_access_type_rm_t *standby_local_nonprim = NULL; + standby = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "standby"); if (standby) { standby_local_nonprim = OpenAPI_access_type_rm_parseFromJSON(standby); } - cJSON *_3g_load = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "3gLoad"); - + _3g_load = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "3gLoad"); if (_3g_load) { if (!cJSON_IsNumber(_3g_load)) { ogs_error("OpenAPI_steering_mode_parseFromJSON() failed [_3g_load]"); @@ -132,9 +144,7 @@ OpenAPI_steering_mode_t *OpenAPI_steering_mode_parseFromJSON(cJSON *steering_mod } } - cJSON *prio_acc = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "prioAcc"); - - OpenAPI_access_type_e prio_accVariable; + prio_acc = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "prioAcc"); if (prio_acc) { if (!cJSON_IsString(prio_acc)) { ogs_error("OpenAPI_steering_mode_parseFromJSON() failed [prio_acc]"); @@ -154,6 +164,10 @@ OpenAPI_steering_mode_t *OpenAPI_steering_mode_parseFromJSON(cJSON *steering_mod return steering_mode_local_var; end: + if (standby_local_nonprim) { + OpenAPI_access_type_rm_free(standby_local_nonprim); + standby_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/stored_search_result.c b/lib/sbi/openapi/model/stored_search_result.c index 4d1f678a5..4aba0d4b6 100644 --- a/lib/sbi/openapi/model/stored_search_result.c +++ b/lib/sbi/openapi/model/stored_search_result.c @@ -18,20 +18,25 @@ OpenAPI_stored_search_result_t *OpenAPI_stored_search_result_create( void OpenAPI_stored_search_result_free(OpenAPI_stored_search_result_t *stored_search_result) { + OpenAPI_lnode_t *node = NULL; + if (NULL == stored_search_result) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(stored_search_result->nf_instances, node) { - OpenAPI_nf_profile_free(node->data); + if (stored_search_result->nf_instances) { + OpenAPI_list_for_each(stored_search_result->nf_instances, node) { + OpenAPI_nf_profile_free(node->data); + } + OpenAPI_list_free(stored_search_result->nf_instances); + stored_search_result->nf_instances = NULL; } - OpenAPI_list_free(stored_search_result->nf_instances); ogs_free(stored_search_result); } cJSON *OpenAPI_stored_search_result_convertToJSON(OpenAPI_stored_search_result_t *stored_search_result) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (stored_search_result == NULL) { ogs_error("OpenAPI_stored_search_result_convertToJSON() failed [StoredSearchResult]"); @@ -39,22 +44,22 @@ cJSON *OpenAPI_stored_search_result_convertToJSON(OpenAPI_stored_search_result_t } item = cJSON_CreateObject(); + if (!stored_search_result->nf_instances) { + ogs_error("OpenAPI_stored_search_result_convertToJSON() failed [nf_instances]"); + return NULL; + } cJSON *nf_instancesList = cJSON_AddArrayToObject(item, "nfInstances"); if (nf_instancesList == NULL) { ogs_error("OpenAPI_stored_search_result_convertToJSON() failed [nf_instances]"); goto end; } - - OpenAPI_lnode_t *nf_instances_node; - if (stored_search_result->nf_instances) { - OpenAPI_list_for_each(stored_search_result->nf_instances, nf_instances_node) { - cJSON *itemLocal = OpenAPI_nf_profile_convertToJSON(nf_instances_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_stored_search_result_convertToJSON() failed [nf_instances]"); - goto end; - } - cJSON_AddItemToArray(nf_instancesList, itemLocal); + OpenAPI_list_for_each(stored_search_result->nf_instances, node) { + cJSON *itemLocal = OpenAPI_nf_profile_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_stored_search_result_convertToJSON() failed [nf_instances]"); + goto end; } + cJSON_AddItemToArray(nf_instancesList, itemLocal); } end: @@ -64,43 +69,49 @@ end: OpenAPI_stored_search_result_t *OpenAPI_stored_search_result_parseFromJSON(cJSON *stored_search_resultJSON) { OpenAPI_stored_search_result_t *stored_search_result_local_var = NULL; - cJSON *nf_instances = cJSON_GetObjectItemCaseSensitive(stored_search_resultJSON, "nfInstances"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instances = NULL; + OpenAPI_list_t *nf_instancesList = NULL; + nf_instances = cJSON_GetObjectItemCaseSensitive(stored_search_resultJSON, "nfInstances"); if (!nf_instances) { ogs_error("OpenAPI_stored_search_result_parseFromJSON() failed [nf_instances]"); goto end; } - - OpenAPI_list_t *nf_instancesList; - cJSON *nf_instances_local_nonprimitive; - if (!cJSON_IsArray(nf_instances)){ - ogs_error("OpenAPI_stored_search_result_parseFromJSON() failed [nf_instances]"); - goto end; - } - - nf_instancesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nf_instances_local_nonprimitive, nf_instances ) { - if (!cJSON_IsObject(nf_instances_local_nonprimitive)) { + cJSON *nf_instances_local = NULL; + if (!cJSON_IsArray(nf_instances)) { ogs_error("OpenAPI_stored_search_result_parseFromJSON() failed [nf_instances]"); goto end; } - OpenAPI_nf_profile_t *nf_instancesItem = OpenAPI_nf_profile_parseFromJSON(nf_instances_local_nonprimitive); - if (!nf_instancesItem) { - ogs_error("No nf_instancesItem"); - OpenAPI_list_free(nf_instancesList); - goto end; + nf_instancesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nf_instances_local, nf_instances) { + if (!cJSON_IsObject(nf_instances_local)) { + ogs_error("OpenAPI_stored_search_result_parseFromJSON() failed [nf_instances]"); + goto end; + } + OpenAPI_nf_profile_t *nf_instancesItem = OpenAPI_nf_profile_parseFromJSON(nf_instances_local); + if (!nf_instancesItem) { + ogs_error("No nf_instancesItem"); + OpenAPI_list_free(nf_instancesList); + goto end; + } + OpenAPI_list_add(nf_instancesList, nf_instancesItem); } - OpenAPI_list_add(nf_instancesList, nf_instancesItem); - } - stored_search_result_local_var = OpenAPI_stored_search_result_create ( nf_instancesList ); return stored_search_result_local_var; end: + if (nf_instancesList) { + OpenAPI_list_for_each(nf_instancesList, node) { + OpenAPI_nf_profile_free(node->data); + } + OpenAPI_list_free(nf_instancesList); + nf_instancesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/subscribed_default_qos.c b/lib/sbi/openapi/model/subscribed_default_qos.c index 93220272f..55d69da3e 100644 --- a/lib/sbi/openapi/model/subscribed_default_qos.c +++ b/lib/sbi/openapi/model/subscribed_default_qos.c @@ -24,17 +24,22 @@ OpenAPI_subscribed_default_qos_t *OpenAPI_subscribed_default_qos_create( void OpenAPI_subscribed_default_qos_free(OpenAPI_subscribed_default_qos_t *subscribed_default_qos) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscribed_default_qos) { return; } - OpenAPI_lnode_t *node; - OpenAPI_arp_free(subscribed_default_qos->arp); + if (subscribed_default_qos->arp) { + OpenAPI_arp_free(subscribed_default_qos->arp); + subscribed_default_qos->arp = NULL; + } ogs_free(subscribed_default_qos); } cJSON *OpenAPI_subscribed_default_qos_convertToJSON(OpenAPI_subscribed_default_qos_t *subscribed_default_qos) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscribed_default_qos == NULL) { ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [SubscribedDefaultQos]"); @@ -47,6 +52,10 @@ cJSON *OpenAPI_subscribed_default_qos_convertToJSON(OpenAPI_subscribed_default_q goto end; } + if (!subscribed_default_qos->arp) { + ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [arp]"); + return NULL; + } cJSON *arp_local_JSON = OpenAPI_arp_convertToJSON(subscribed_default_qos->arp); if (arp_local_JSON == NULL) { ogs_error("OpenAPI_subscribed_default_qos_convertToJSON() failed [arp]"); @@ -72,28 +81,29 @@ end: OpenAPI_subscribed_default_qos_t *OpenAPI_subscribed_default_qos_parseFromJSON(cJSON *subscribed_default_qosJSON) { OpenAPI_subscribed_default_qos_t *subscribed_default_qos_local_var = NULL; - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "5qi"); + OpenAPI_lnode_t *node = NULL; + cJSON *_5qi = NULL; + cJSON *arp = NULL; + OpenAPI_arp_t *arp_local_nonprim = NULL; + cJSON *priority_level = NULL; + _5qi = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "5qi"); if (!_5qi) { ogs_error("OpenAPI_subscribed_default_qos_parseFromJSON() failed [_5qi]"); goto end; } - if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_subscribed_default_qos_parseFromJSON() failed [_5qi]"); goto end; } - cJSON *arp = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "arp"); + arp = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "arp"); if (!arp) { ogs_error("OpenAPI_subscribed_default_qos_parseFromJSON() failed [arp]"); goto end; } - - OpenAPI_arp_t *arp_local_nonprim = NULL; arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp); - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "priorityLevel"); - + priority_level = cJSON_GetObjectItemCaseSensitive(subscribed_default_qosJSON, "priorityLevel"); if (priority_level) { if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_subscribed_default_qos_parseFromJSON() failed [priority_level]"); @@ -111,6 +121,10 @@ OpenAPI_subscribed_default_qos_t *OpenAPI_subscribed_default_qos_parseFromJSON(c return subscribed_default_qos_local_var; end: + if (arp_local_nonprim) { + OpenAPI_arp_free(arp_local_nonprim); + arp_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/subscribed_default_qos_1.c b/lib/sbi/openapi/model/subscribed_default_qos_1.c index 0e1de884d..9402ab8b8 100644 --- a/lib/sbi/openapi/model/subscribed_default_qos_1.c +++ b/lib/sbi/openapi/model/subscribed_default_qos_1.c @@ -24,17 +24,22 @@ OpenAPI_subscribed_default_qos_1_t *OpenAPI_subscribed_default_qos_1_create( void OpenAPI_subscribed_default_qos_1_free(OpenAPI_subscribed_default_qos_1_t *subscribed_default_qos_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscribed_default_qos_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_arp_1_free(subscribed_default_qos_1->arp); + if (subscribed_default_qos_1->arp) { + OpenAPI_arp_1_free(subscribed_default_qos_1->arp); + subscribed_default_qos_1->arp = NULL; + } ogs_free(subscribed_default_qos_1); } cJSON *OpenAPI_subscribed_default_qos_1_convertToJSON(OpenAPI_subscribed_default_qos_1_t *subscribed_default_qos_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscribed_default_qos_1 == NULL) { ogs_error("OpenAPI_subscribed_default_qos_1_convertToJSON() failed [SubscribedDefaultQos_1]"); @@ -47,6 +52,10 @@ cJSON *OpenAPI_subscribed_default_qos_1_convertToJSON(OpenAPI_subscribed_default goto end; } + if (!subscribed_default_qos_1->arp) { + ogs_error("OpenAPI_subscribed_default_qos_1_convertToJSON() failed [arp]"); + return NULL; + } cJSON *arp_local_JSON = OpenAPI_arp_1_convertToJSON(subscribed_default_qos_1->arp); if (arp_local_JSON == NULL) { ogs_error("OpenAPI_subscribed_default_qos_1_convertToJSON() failed [arp]"); @@ -72,28 +81,29 @@ end: OpenAPI_subscribed_default_qos_1_t *OpenAPI_subscribed_default_qos_1_parseFromJSON(cJSON *subscribed_default_qos_1JSON) { OpenAPI_subscribed_default_qos_1_t *subscribed_default_qos_1_local_var = NULL; - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(subscribed_default_qos_1JSON, "5qi"); + OpenAPI_lnode_t *node = NULL; + cJSON *_5qi = NULL; + cJSON *arp = NULL; + OpenAPI_arp_1_t *arp_local_nonprim = NULL; + cJSON *priority_level = NULL; + _5qi = cJSON_GetObjectItemCaseSensitive(subscribed_default_qos_1JSON, "5qi"); if (!_5qi) { ogs_error("OpenAPI_subscribed_default_qos_1_parseFromJSON() failed [_5qi]"); goto end; } - if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_subscribed_default_qos_1_parseFromJSON() failed [_5qi]"); goto end; } - cJSON *arp = cJSON_GetObjectItemCaseSensitive(subscribed_default_qos_1JSON, "arp"); + arp = cJSON_GetObjectItemCaseSensitive(subscribed_default_qos_1JSON, "arp"); if (!arp) { ogs_error("OpenAPI_subscribed_default_qos_1_parseFromJSON() failed [arp]"); goto end; } - - OpenAPI_arp_1_t *arp_local_nonprim = NULL; arp_local_nonprim = OpenAPI_arp_1_parseFromJSON(arp); - cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(subscribed_default_qos_1JSON, "priorityLevel"); - + priority_level = cJSON_GetObjectItemCaseSensitive(subscribed_default_qos_1JSON, "priorityLevel"); if (priority_level) { if (!cJSON_IsNumber(priority_level)) { ogs_error("OpenAPI_subscribed_default_qos_1_parseFromJSON() failed [priority_level]"); @@ -111,6 +121,10 @@ OpenAPI_subscribed_default_qos_1_t *OpenAPI_subscribed_default_qos_1_parseFromJS return subscribed_default_qos_1_local_var; end: + if (arp_local_nonprim) { + OpenAPI_arp_1_free(arp_local_nonprim); + arp_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/subscribed_event.c b/lib/sbi/openapi/model/subscribed_event.c index a139abe6c..77cbc8339 100644 --- a/lib/sbi/openapi/model/subscribed_event.c +++ b/lib/sbi/openapi/model/subscribed_event.c @@ -16,16 +16,18 @@ OpenAPI_subscribed_event_t *OpenAPI_subscribed_event_create( void OpenAPI_subscribed_event_free(OpenAPI_subscribed_event_t *subscribed_event) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscribed_event) { return; } - OpenAPI_lnode_t *node; ogs_free(subscribed_event); } cJSON *OpenAPI_subscribed_event_convertToJSON(OpenAPI_subscribed_event_t *subscribed_event) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscribed_event == NULL) { ogs_error("OpenAPI_subscribed_event_convertToJSON() failed [SubscribedEvent]"); @@ -40,6 +42,7 @@ end: OpenAPI_subscribed_event_t *OpenAPI_subscribed_event_parseFromJSON(cJSON *subscribed_eventJSON) { OpenAPI_subscribed_event_t *subscribed_event_local_var = NULL; + OpenAPI_lnode_t *node = NULL; subscribed_event_local_var = OpenAPI_subscribed_event_create ( ); diff --git a/lib/sbi/openapi/model/subscribed_snssai.c b/lib/sbi/openapi/model/subscribed_snssai.c index 8317b5b04..af4a338ed 100644 --- a/lib/sbi/openapi/model/subscribed_snssai.c +++ b/lib/sbi/openapi/model/subscribed_snssai.c @@ -22,17 +22,22 @@ OpenAPI_subscribed_snssai_t *OpenAPI_subscribed_snssai_create( void OpenAPI_subscribed_snssai_free(OpenAPI_subscribed_snssai_t *subscribed_snssai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscribed_snssai) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(subscribed_snssai->subscribed_snssai); + if (subscribed_snssai->subscribed_snssai) { + OpenAPI_snssai_free(subscribed_snssai->subscribed_snssai); + subscribed_snssai->subscribed_snssai = NULL; + } ogs_free(subscribed_snssai); } cJSON *OpenAPI_subscribed_snssai_convertToJSON(OpenAPI_subscribed_snssai_t *subscribed_snssai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscribed_snssai == NULL) { ogs_error("OpenAPI_subscribed_snssai_convertToJSON() failed [SubscribedSnssai]"); @@ -40,6 +45,10 @@ cJSON *OpenAPI_subscribed_snssai_convertToJSON(OpenAPI_subscribed_snssai_t *subs } item = cJSON_CreateObject(); + if (!subscribed_snssai->subscribed_snssai) { + ogs_error("OpenAPI_subscribed_snssai_convertToJSON() failed [subscribed_snssai]"); + return NULL; + } cJSON *subscribed_snssai_local_JSON = OpenAPI_snssai_convertToJSON(subscribed_snssai->subscribed_snssai); if (subscribed_snssai_local_JSON == NULL) { ogs_error("OpenAPI_subscribed_snssai_convertToJSON() failed [subscribed_snssai]"); @@ -65,17 +74,18 @@ end: OpenAPI_subscribed_snssai_t *OpenAPI_subscribed_snssai_parseFromJSON(cJSON *subscribed_snssaiJSON) { OpenAPI_subscribed_snssai_t *subscribed_snssai_local_var = NULL; - cJSON *subscribed_snssai = cJSON_GetObjectItemCaseSensitive(subscribed_snssaiJSON, "subscribedSnssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *subscribed_snssai = NULL; + OpenAPI_snssai_t *subscribed_snssai_local_nonprim = NULL; + cJSON *default_indication = NULL; + subscribed_snssai = cJSON_GetObjectItemCaseSensitive(subscribed_snssaiJSON, "subscribedSnssai"); if (!subscribed_snssai) { ogs_error("OpenAPI_subscribed_snssai_parseFromJSON() failed [subscribed_snssai]"); goto end; } - - OpenAPI_snssai_t *subscribed_snssai_local_nonprim = NULL; subscribed_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(subscribed_snssai); - cJSON *default_indication = cJSON_GetObjectItemCaseSensitive(subscribed_snssaiJSON, "defaultIndication"); - + default_indication = cJSON_GetObjectItemCaseSensitive(subscribed_snssaiJSON, "defaultIndication"); if (default_indication) { if (!cJSON_IsBool(default_indication)) { ogs_error("OpenAPI_subscribed_snssai_parseFromJSON() failed [default_indication]"); @@ -91,6 +101,10 @@ OpenAPI_subscribed_snssai_t *OpenAPI_subscribed_snssai_parseFromJSON(cJSON *subs return subscribed_snssai_local_var; end: + if (subscribed_snssai_local_nonprim) { + OpenAPI_snssai_free(subscribed_snssai_local_nonprim); + subscribed_snssai_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/subscription_data.c b/lib/sbi/openapi/model/subscription_data.c index e8517513a..afeb0c8d5 100644 --- a/lib/sbi/openapi/model/subscription_data.c +++ b/lib/sbi/openapi/model/subscription_data.c @@ -52,48 +52,101 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_create( void OpenAPI_subscription_data_free(OpenAPI_subscription_data_t *subscription_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscription_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(subscription_data->nf_status_notification_uri); - ogs_free(subscription_data->req_nf_instance_id); - OpenAPI_subscription_data_subscr_cond_free(subscription_data->subscr_cond); - ogs_free(subscription_data->subscription_id); - ogs_free(subscription_data->validity_time); - OpenAPI_list_free(subscription_data->req_notif_events); - OpenAPI_plmn_id_free(subscription_data->plmn_id); - ogs_free(subscription_data->nid); - OpenAPI_notif_condition_free(subscription_data->notif_condition); - ogs_free(subscription_data->req_nf_fqdn); - OpenAPI_list_for_each(subscription_data->req_snssais, node) { - OpenAPI_snssai_free(node->data); + if (subscription_data->nf_status_notification_uri) { + ogs_free(subscription_data->nf_status_notification_uri); + subscription_data->nf_status_notification_uri = NULL; } - OpenAPI_list_free(subscription_data->req_snssais); - OpenAPI_list_for_each(subscription_data->req_per_plmn_snssais, node) { - OpenAPI_plmn_snssai_free(node->data); + if (subscription_data->req_nf_instance_id) { + ogs_free(subscription_data->req_nf_instance_id); + subscription_data->req_nf_instance_id = NULL; } - OpenAPI_list_free(subscription_data->req_per_plmn_snssais); - OpenAPI_list_for_each(subscription_data->req_plmn_list, node) { - OpenAPI_plmn_id_free(node->data); + if (subscription_data->subscr_cond) { + OpenAPI_subscription_data_subscr_cond_free(subscription_data->subscr_cond); + subscription_data->subscr_cond = NULL; } - OpenAPI_list_free(subscription_data->req_plmn_list); - OpenAPI_list_for_each(subscription_data->req_snpn_list, node) { - OpenAPI_plmn_id_nid_free(node->data); + if (subscription_data->subscription_id) { + ogs_free(subscription_data->subscription_id); + subscription_data->subscription_id = NULL; } - OpenAPI_list_free(subscription_data->req_snpn_list); - OpenAPI_list_for_each(subscription_data->serving_scope, node) { - ogs_free(node->data); + if (subscription_data->validity_time) { + ogs_free(subscription_data->validity_time); + subscription_data->validity_time = NULL; + } + if (subscription_data->req_notif_events) { + OpenAPI_list_free(subscription_data->req_notif_events); + subscription_data->req_notif_events = NULL; + } + if (subscription_data->plmn_id) { + OpenAPI_plmn_id_free(subscription_data->plmn_id); + subscription_data->plmn_id = NULL; + } + if (subscription_data->nid) { + ogs_free(subscription_data->nid); + subscription_data->nid = NULL; + } + if (subscription_data->notif_condition) { + OpenAPI_notif_condition_free(subscription_data->notif_condition); + subscription_data->notif_condition = NULL; + } + if (subscription_data->req_nf_fqdn) { + ogs_free(subscription_data->req_nf_fqdn); + subscription_data->req_nf_fqdn = NULL; + } + if (subscription_data->req_snssais) { + OpenAPI_list_for_each(subscription_data->req_snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(subscription_data->req_snssais); + subscription_data->req_snssais = NULL; + } + if (subscription_data->req_per_plmn_snssais) { + OpenAPI_list_for_each(subscription_data->req_per_plmn_snssais, node) { + OpenAPI_plmn_snssai_free(node->data); + } + OpenAPI_list_free(subscription_data->req_per_plmn_snssais); + subscription_data->req_per_plmn_snssais = NULL; + } + if (subscription_data->req_plmn_list) { + OpenAPI_list_for_each(subscription_data->req_plmn_list, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(subscription_data->req_plmn_list); + subscription_data->req_plmn_list = NULL; + } + if (subscription_data->req_snpn_list) { + OpenAPI_list_for_each(subscription_data->req_snpn_list, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(subscription_data->req_snpn_list); + subscription_data->req_snpn_list = NULL; + } + if (subscription_data->serving_scope) { + OpenAPI_list_for_each(subscription_data->serving_scope, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subscription_data->serving_scope); + subscription_data->serving_scope = NULL; + } + if (subscription_data->requester_features) { + ogs_free(subscription_data->requester_features); + subscription_data->requester_features = NULL; + } + if (subscription_data->nrf_supported_features) { + ogs_free(subscription_data->nrf_supported_features); + subscription_data->nrf_supported_features = NULL; } - OpenAPI_list_free(subscription_data->serving_scope); - ogs_free(subscription_data->requester_features); - ogs_free(subscription_data->nrf_supported_features); ogs_free(subscription_data); } cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subscription_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscription_data == NULL) { ogs_error("OpenAPI_subscription_data_convertToJSON() failed [SubscriptionData]"); @@ -101,6 +154,10 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs } item = cJSON_CreateObject(); + if (!subscription_data->nf_status_notification_uri) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [nf_status_notification_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "nfStatusNotificationUri", subscription_data->nf_status_notification_uri) == NULL) { ogs_error("OpenAPI_subscription_data_convertToJSON() failed [nf_status_notification_uri]"); goto end; @@ -140,15 +197,14 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs } } - if (subscription_data->req_notif_events) { - cJSON *req_notif_events = cJSON_AddArrayToObject(item, "reqNotifEvents"); - if (req_notif_events == NULL) { + if (subscription_data->req_notif_events != OpenAPI_notification_event_type_NULL) { + cJSON *req_notif_eventsList = cJSON_AddArrayToObject(item, "reqNotifEvents"); + if (req_notif_eventsList == NULL) { ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_notif_events]"); goto end; } - OpenAPI_lnode_t *req_notif_events_node; - OpenAPI_list_for_each(subscription_data->req_notif_events, req_notif_events_node) { - if (cJSON_AddStringToObject(req_notif_events, "", OpenAPI_notification_event_type_ToString((intptr_t)req_notif_events_node->data)) == NULL) { + OpenAPI_list_for_each(subscription_data->req_notif_events, node) { + if (cJSON_AddStringToObject(req_notif_eventsList, "", OpenAPI_notification_event_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_notif_events]"); goto end; } @@ -188,7 +244,7 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs } } - if (subscription_data->req_nf_type) { + if (subscription_data->req_nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "reqNfType", OpenAPI_nf_type_ToString(subscription_data->req_nf_type)) == NULL) { ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_nf_type]"); goto end; @@ -208,17 +264,13 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_snssais]"); goto end; } - - OpenAPI_lnode_t *req_snssais_node; - if (subscription_data->req_snssais) { - OpenAPI_list_for_each(subscription_data->req_snssais, req_snssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(req_snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_snssais]"); - goto end; - } - cJSON_AddItemToArray(req_snssaisList, itemLocal); + OpenAPI_list_for_each(subscription_data->req_snssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_snssais]"); + goto end; } + cJSON_AddItemToArray(req_snssaisList, itemLocal); } } @@ -228,17 +280,13 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_per_plmn_snssais]"); goto end; } - - OpenAPI_lnode_t *req_per_plmn_snssais_node; - if (subscription_data->req_per_plmn_snssais) { - OpenAPI_list_for_each(subscription_data->req_per_plmn_snssais, req_per_plmn_snssais_node) { - cJSON *itemLocal = OpenAPI_plmn_snssai_convertToJSON(req_per_plmn_snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_per_plmn_snssais]"); - goto end; - } - cJSON_AddItemToArray(req_per_plmn_snssaisList, itemLocal); + OpenAPI_list_for_each(subscription_data->req_per_plmn_snssais, node) { + cJSON *itemLocal = OpenAPI_plmn_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_per_plmn_snssais]"); + goto end; } + cJSON_AddItemToArray(req_per_plmn_snssaisList, itemLocal); } } @@ -248,17 +296,13 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_plmn_list]"); goto end; } - - OpenAPI_lnode_t *req_plmn_list_node; - if (subscription_data->req_plmn_list) { - OpenAPI_list_for_each(subscription_data->req_plmn_list, req_plmn_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(req_plmn_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_plmn_list]"); - goto end; - } - cJSON_AddItemToArray(req_plmn_listList, itemLocal); + OpenAPI_list_for_each(subscription_data->req_plmn_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_plmn_list]"); + goto end; } + cJSON_AddItemToArray(req_plmn_listList, itemLocal); } } @@ -268,34 +312,28 @@ cJSON *OpenAPI_subscription_data_convertToJSON(OpenAPI_subscription_data_t *subs ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_snpn_list]"); goto end; } - - OpenAPI_lnode_t *req_snpn_list_node; - if (subscription_data->req_snpn_list) { - OpenAPI_list_for_each(subscription_data->req_snpn_list, req_snpn_list_node) { - cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(req_snpn_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_snpn_list]"); - goto end; - } - cJSON_AddItemToArray(req_snpn_listList, itemLocal); + OpenAPI_list_for_each(subscription_data->req_snpn_list, node) { + cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [req_snpn_list]"); + goto end; } + cJSON_AddItemToArray(req_snpn_listList, itemLocal); } } if (subscription_data->serving_scope) { - cJSON *serving_scope = cJSON_AddArrayToObject(item, "servingScope"); - if (serving_scope == NULL) { + cJSON *serving_scopeList = cJSON_AddArrayToObject(item, "servingScope"); + if (serving_scopeList == NULL) { ogs_error("OpenAPI_subscription_data_convertToJSON() failed [serving_scope]"); goto end; } - - OpenAPI_lnode_t *serving_scope_node; - OpenAPI_list_for_each(subscription_data->serving_scope, serving_scope_node) { - if (cJSON_AddStringToObject(serving_scope, "", (char*)serving_scope_node->data) == NULL) { - ogs_error("OpenAPI_subscription_data_convertToJSON() failed [serving_scope]"); - goto end; + OpenAPI_list_for_each(subscription_data->serving_scope, node) { + if (cJSON_AddStringToObject(serving_scopeList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_subscription_data_convertToJSON() failed [serving_scope]"); + goto end; + } } - } } if (subscription_data->requester_features) { @@ -319,99 +357,112 @@ end: OpenAPI_subscription_data_t *OpenAPI_subscription_data_parseFromJSON(cJSON *subscription_dataJSON) { OpenAPI_subscription_data_t *subscription_data_local_var = NULL; - cJSON *nf_status_notification_uri = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "nfStatusNotificationUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *nf_status_notification_uri = NULL; + cJSON *req_nf_instance_id = NULL; + cJSON *subscr_cond = NULL; + OpenAPI_subscription_data_subscr_cond_t *subscr_cond_local_nonprim = NULL; + cJSON *subscription_id = NULL; + cJSON *validity_time = NULL; + cJSON *req_notif_events = NULL; + OpenAPI_list_t *req_notif_eventsList = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *nid = NULL; + cJSON *notif_condition = NULL; + OpenAPI_notif_condition_t *notif_condition_local_nonprim = NULL; + cJSON *req_nf_type = NULL; + OpenAPI_nf_type_e req_nf_typeVariable = 0; + cJSON *req_nf_fqdn = NULL; + cJSON *req_snssais = NULL; + OpenAPI_list_t *req_snssaisList = NULL; + cJSON *req_per_plmn_snssais = NULL; + OpenAPI_list_t *req_per_plmn_snssaisList = NULL; + cJSON *req_plmn_list = NULL; + OpenAPI_list_t *req_plmn_listList = NULL; + cJSON *req_snpn_list = NULL; + OpenAPI_list_t *req_snpn_listList = NULL; + cJSON *serving_scope = NULL; + OpenAPI_list_t *serving_scopeList = NULL; + cJSON *requester_features = NULL; + cJSON *nrf_supported_features = NULL; + nf_status_notification_uri = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "nfStatusNotificationUri"); if (!nf_status_notification_uri) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [nf_status_notification_uri]"); goto end; } - if (!cJSON_IsString(nf_status_notification_uri)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [nf_status_notification_uri]"); goto end; } - cJSON *req_nf_instance_id = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqNfInstanceId"); - + req_nf_instance_id = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqNfInstanceId"); if (req_nf_instance_id) { - if (!cJSON_IsString(req_nf_instance_id)) { + if (!cJSON_IsString(req_nf_instance_id) && !cJSON_IsNull(req_nf_instance_id)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_nf_instance_id]"); goto end; } } - cJSON *subscr_cond = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "subscrCond"); - - OpenAPI_subscription_data_subscr_cond_t *subscr_cond_local_nonprim = NULL; + subscr_cond = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "subscrCond"); if (subscr_cond) { subscr_cond_local_nonprim = OpenAPI_subscription_data_subscr_cond_parseFromJSON(subscr_cond); } - cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "subscriptionId"); - + subscription_id = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "subscriptionId"); if (subscription_id) { - if (!cJSON_IsString(subscription_id)) { + if (!cJSON_IsString(subscription_id) && !cJSON_IsNull(subscription_id)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [subscription_id]"); goto end; } } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [validity_time]"); goto end; } } - cJSON *req_notif_events = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqNotifEvents"); - - OpenAPI_list_t *req_notif_eventsList; + req_notif_events = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqNotifEvents"); if (req_notif_events) { - cJSON *req_notif_events_local_nonprimitive; - if (!cJSON_IsArray(req_notif_events)) { - ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_notif_events]"); - goto end; - } - - req_notif_eventsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_notif_events_local_nonprimitive, req_notif_events ) { - if (!cJSON_IsString(req_notif_events_local_nonprimitive)){ + cJSON *req_notif_events_local = NULL; + if (!cJSON_IsArray(req_notif_events)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_notif_events]"); goto end; } - OpenAPI_list_add(req_notif_eventsList, (void *)OpenAPI_notification_event_type_FromString(req_notif_events_local_nonprimitive->valuestring)); - } + req_notif_eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_notif_events_local, req_notif_events) { + if (!cJSON_IsString(req_notif_events_local)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_notif_events]"); + goto end; + } + OpenAPI_list_add(req_notif_eventsList, (void *)OpenAPI_notification_event_type_FromString(req_notif_events_local->valuestring)); + } } - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "plmnId"); - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [nid]"); goto end; } } - cJSON *notif_condition = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "notifCondition"); - - OpenAPI_notif_condition_t *notif_condition_local_nonprim = NULL; + notif_condition = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "notifCondition"); if (notif_condition) { notif_condition_local_nonprim = OpenAPI_notif_condition_parseFromJSON(notif_condition); } - cJSON *req_nf_type = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqNfType"); - - OpenAPI_nf_type_e req_nf_typeVariable; + req_nf_type = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqNfType"); if (req_nf_type) { if (!cJSON_IsString(req_nf_type)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_nf_type]"); @@ -420,164 +471,146 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_parseFromJSON(cJSON *subs req_nf_typeVariable = OpenAPI_nf_type_FromString(req_nf_type->valuestring); } - cJSON *req_nf_fqdn = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqNfFqdn"); - + req_nf_fqdn = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqNfFqdn"); if (req_nf_fqdn) { - if (!cJSON_IsString(req_nf_fqdn)) { + if (!cJSON_IsString(req_nf_fqdn) && !cJSON_IsNull(req_nf_fqdn)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_nf_fqdn]"); goto end; } } - cJSON *req_snssais = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqSnssais"); - - OpenAPI_list_t *req_snssaisList; + req_snssais = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqSnssais"); if (req_snssais) { - cJSON *req_snssais_local_nonprimitive; - if (!cJSON_IsArray(req_snssais)){ - ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_snssais]"); - goto end; - } - - req_snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_snssais_local_nonprimitive, req_snssais ) { - if (!cJSON_IsObject(req_snssais_local_nonprimitive)) { + cJSON *req_snssais_local = NULL; + if (!cJSON_IsArray(req_snssais)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_snssais]"); goto end; } - OpenAPI_snssai_t *req_snssaisItem = OpenAPI_snssai_parseFromJSON(req_snssais_local_nonprimitive); - if (!req_snssaisItem) { - ogs_error("No req_snssaisItem"); - OpenAPI_list_free(req_snssaisList); - goto end; + req_snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_snssais_local, req_snssais) { + if (!cJSON_IsObject(req_snssais_local)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_snssais]"); + goto end; + } + OpenAPI_snssai_t *req_snssaisItem = OpenAPI_snssai_parseFromJSON(req_snssais_local); + if (!req_snssaisItem) { + ogs_error("No req_snssaisItem"); + OpenAPI_list_free(req_snssaisList); + goto end; + } + OpenAPI_list_add(req_snssaisList, req_snssaisItem); } - - OpenAPI_list_add(req_snssaisList, req_snssaisItem); - } } - cJSON *req_per_plmn_snssais = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqPerPlmnSnssais"); - - OpenAPI_list_t *req_per_plmn_snssaisList; + req_per_plmn_snssais = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqPerPlmnSnssais"); if (req_per_plmn_snssais) { - cJSON *req_per_plmn_snssais_local_nonprimitive; - if (!cJSON_IsArray(req_per_plmn_snssais)){ - ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_per_plmn_snssais]"); - goto end; - } - - req_per_plmn_snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_per_plmn_snssais_local_nonprimitive, req_per_plmn_snssais ) { - if (!cJSON_IsObject(req_per_plmn_snssais_local_nonprimitive)) { + cJSON *req_per_plmn_snssais_local = NULL; + if (!cJSON_IsArray(req_per_plmn_snssais)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_per_plmn_snssais]"); goto end; } - OpenAPI_plmn_snssai_t *req_per_plmn_snssaisItem = OpenAPI_plmn_snssai_parseFromJSON(req_per_plmn_snssais_local_nonprimitive); - if (!req_per_plmn_snssaisItem) { - ogs_error("No req_per_plmn_snssaisItem"); - OpenAPI_list_free(req_per_plmn_snssaisList); - goto end; + req_per_plmn_snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_per_plmn_snssais_local, req_per_plmn_snssais) { + if (!cJSON_IsObject(req_per_plmn_snssais_local)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_per_plmn_snssais]"); + goto end; + } + OpenAPI_plmn_snssai_t *req_per_plmn_snssaisItem = OpenAPI_plmn_snssai_parseFromJSON(req_per_plmn_snssais_local); + if (!req_per_plmn_snssaisItem) { + ogs_error("No req_per_plmn_snssaisItem"); + OpenAPI_list_free(req_per_plmn_snssaisList); + goto end; + } + OpenAPI_list_add(req_per_plmn_snssaisList, req_per_plmn_snssaisItem); } - - OpenAPI_list_add(req_per_plmn_snssaisList, req_per_plmn_snssaisItem); - } } - cJSON *req_plmn_list = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqPlmnList"); - - OpenAPI_list_t *req_plmn_listList; + req_plmn_list = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqPlmnList"); if (req_plmn_list) { - cJSON *req_plmn_list_local_nonprimitive; - if (!cJSON_IsArray(req_plmn_list)){ - ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_plmn_list]"); - goto end; - } - - req_plmn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_plmn_list_local_nonprimitive, req_plmn_list ) { - if (!cJSON_IsObject(req_plmn_list_local_nonprimitive)) { + cJSON *req_plmn_list_local = NULL; + if (!cJSON_IsArray(req_plmn_list)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_plmn_list]"); goto end; } - OpenAPI_plmn_id_t *req_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(req_plmn_list_local_nonprimitive); - if (!req_plmn_listItem) { - ogs_error("No req_plmn_listItem"); - OpenAPI_list_free(req_plmn_listList); - goto end; + req_plmn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_plmn_list_local, req_plmn_list) { + if (!cJSON_IsObject(req_plmn_list_local)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_plmn_list]"); + goto end; + } + OpenAPI_plmn_id_t *req_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(req_plmn_list_local); + if (!req_plmn_listItem) { + ogs_error("No req_plmn_listItem"); + OpenAPI_list_free(req_plmn_listList); + goto end; + } + OpenAPI_list_add(req_plmn_listList, req_plmn_listItem); } - - OpenAPI_list_add(req_plmn_listList, req_plmn_listItem); - } } - cJSON *req_snpn_list = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqSnpnList"); - - OpenAPI_list_t *req_snpn_listList; + req_snpn_list = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "reqSnpnList"); if (req_snpn_list) { - cJSON *req_snpn_list_local_nonprimitive; - if (!cJSON_IsArray(req_snpn_list)){ - ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_snpn_list]"); - goto end; - } - - req_snpn_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(req_snpn_list_local_nonprimitive, req_snpn_list ) { - if (!cJSON_IsObject(req_snpn_list_local_nonprimitive)) { + cJSON *req_snpn_list_local = NULL; + if (!cJSON_IsArray(req_snpn_list)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_snpn_list]"); goto end; } - OpenAPI_plmn_id_nid_t *req_snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(req_snpn_list_local_nonprimitive); - if (!req_snpn_listItem) { - ogs_error("No req_snpn_listItem"); - OpenAPI_list_free(req_snpn_listList); + req_snpn_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(req_snpn_list_local, req_snpn_list) { + if (!cJSON_IsObject(req_snpn_list_local)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [req_snpn_list]"); + goto end; + } + OpenAPI_plmn_id_nid_t *req_snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(req_snpn_list_local); + if (!req_snpn_listItem) { + ogs_error("No req_snpn_listItem"); + OpenAPI_list_free(req_snpn_listList); + goto end; + } + OpenAPI_list_add(req_snpn_listList, req_snpn_listItem); + } + } + + serving_scope = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "servingScope"); + if (serving_scope) { + cJSON *serving_scope_local = NULL; + if (!cJSON_IsArray(serving_scope)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [serving_scope]"); goto end; } - OpenAPI_list_add(req_snpn_listList, req_snpn_listItem); - } + serving_scopeList = OpenAPI_list_create(); + + cJSON_ArrayForEach(serving_scope_local, serving_scope) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(serving_scope_local)) { + ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [serving_scope]"); + goto end; + } + OpenAPI_list_add(serving_scopeList, ogs_strdup(serving_scope_local->valuestring)); + } } - cJSON *serving_scope = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "servingScope"); - - OpenAPI_list_t *serving_scopeList; - if (serving_scope) { - cJSON *serving_scope_local; - if (!cJSON_IsArray(serving_scope)) { - ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [serving_scope]"); - goto end; - } - serving_scopeList = OpenAPI_list_create(); - - cJSON_ArrayForEach(serving_scope_local, serving_scope) { - if (!cJSON_IsString(serving_scope_local)) { - ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [serving_scope]"); - goto end; - } - OpenAPI_list_add(serving_scopeList, ogs_strdup(serving_scope_local->valuestring)); - } - } - - cJSON *requester_features = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "requesterFeatures"); - + requester_features = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "requesterFeatures"); if (requester_features) { - if (!cJSON_IsString(requester_features)) { + if (!cJSON_IsString(requester_features) && !cJSON_IsNull(requester_features)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [requester_features]"); goto end; } } - cJSON *nrf_supported_features = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "nrfSupportedFeatures"); - + nrf_supported_features = cJSON_GetObjectItemCaseSensitive(subscription_dataJSON, "nrfSupportedFeatures"); if (nrf_supported_features) { - if (!cJSON_IsString(nrf_supported_features)) { + if (!cJSON_IsString(nrf_supported_features) && !cJSON_IsNull(nrf_supported_features)) { ogs_error("OpenAPI_subscription_data_parseFromJSON() failed [nrf_supported_features]"); goto end; } @@ -585,27 +618,78 @@ OpenAPI_subscription_data_t *OpenAPI_subscription_data_parseFromJSON(cJSON *subs subscription_data_local_var = OpenAPI_subscription_data_create ( ogs_strdup(nf_status_notification_uri->valuestring), - req_nf_instance_id ? ogs_strdup(req_nf_instance_id->valuestring) : NULL, + req_nf_instance_id && !cJSON_IsNull(req_nf_instance_id) ? ogs_strdup(req_nf_instance_id->valuestring) : NULL, subscr_cond ? subscr_cond_local_nonprim : NULL, - subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL, + subscription_id && !cJSON_IsNull(subscription_id) ? ogs_strdup(subscription_id->valuestring) : NULL, + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL, req_notif_events ? req_notif_eventsList : NULL, plmn_id ? plmn_id_local_nonprim : NULL, - nid ? ogs_strdup(nid->valuestring) : NULL, + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL, notif_condition ? notif_condition_local_nonprim : NULL, req_nf_type ? req_nf_typeVariable : 0, - req_nf_fqdn ? ogs_strdup(req_nf_fqdn->valuestring) : NULL, + req_nf_fqdn && !cJSON_IsNull(req_nf_fqdn) ? ogs_strdup(req_nf_fqdn->valuestring) : NULL, req_snssais ? req_snssaisList : NULL, req_per_plmn_snssais ? req_per_plmn_snssaisList : NULL, req_plmn_list ? req_plmn_listList : NULL, req_snpn_list ? req_snpn_listList : NULL, serving_scope ? serving_scopeList : NULL, - requester_features ? ogs_strdup(requester_features->valuestring) : NULL, - nrf_supported_features ? ogs_strdup(nrf_supported_features->valuestring) : NULL + requester_features && !cJSON_IsNull(requester_features) ? ogs_strdup(requester_features->valuestring) : NULL, + nrf_supported_features && !cJSON_IsNull(nrf_supported_features) ? ogs_strdup(nrf_supported_features->valuestring) : NULL ); return subscription_data_local_var; end: + if (subscr_cond_local_nonprim) { + OpenAPI_subscription_data_subscr_cond_free(subscr_cond_local_nonprim); + subscr_cond_local_nonprim = NULL; + } + if (req_notif_eventsList) { + OpenAPI_list_free(req_notif_eventsList); + req_notif_eventsList = NULL; + } + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (notif_condition_local_nonprim) { + OpenAPI_notif_condition_free(notif_condition_local_nonprim); + notif_condition_local_nonprim = NULL; + } + if (req_snssaisList) { + OpenAPI_list_for_each(req_snssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(req_snssaisList); + req_snssaisList = NULL; + } + if (req_per_plmn_snssaisList) { + OpenAPI_list_for_each(req_per_plmn_snssaisList, node) { + OpenAPI_plmn_snssai_free(node->data); + } + OpenAPI_list_free(req_per_plmn_snssaisList); + req_per_plmn_snssaisList = NULL; + } + if (req_plmn_listList) { + OpenAPI_list_for_each(req_plmn_listList, node) { + OpenAPI_plmn_id_free(node->data); + } + OpenAPI_list_free(req_plmn_listList); + req_plmn_listList = NULL; + } + if (req_snpn_listList) { + OpenAPI_list_for_each(req_snpn_listList, node) { + OpenAPI_plmn_id_nid_free(node->data); + } + OpenAPI_list_free(req_snpn_listList); + req_snpn_listList = NULL; + } + if (serving_scopeList) { + OpenAPI_list_for_each(serving_scopeList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(serving_scopeList); + serving_scopeList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/subscription_data_sets.c b/lib/sbi/openapi/model/subscription_data_sets.c index 6e16b4a55..d959954d4 100644 --- a/lib/sbi/openapi/model/subscription_data_sets.c +++ b/lib/sbi/openapi/model/subscription_data_sets.c @@ -12,7 +12,7 @@ OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_create( OpenAPI_ue_context_in_smsf_data_t *uec_smsf_data, OpenAPI_sms_subscription_data_t *sms_subs_data, OpenAPI_list_t *sm_data, - OpenAPI_trace_data_1_t *trace_data, + OpenAPI_trace_data_t *trace_data, OpenAPI_sms_management_subscription_data_t *sms_mng_data, OpenAPI_lcs_privacy_data_t *lcs_privacy_data, OpenAPI_lcs_mo_data_t *lcs_mo_data, @@ -42,32 +42,73 @@ OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_create( void OpenAPI_subscription_data_sets_free(OpenAPI_subscription_data_sets_t *subscription_data_sets) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscription_data_sets) { return; } - OpenAPI_lnode_t *node; - OpenAPI_access_and_mobility_subscription_data_free(subscription_data_sets->am_data); - OpenAPI_smf_selection_subscription_data_free(subscription_data_sets->smf_sel_data); - OpenAPI_ue_context_in_amf_data_free(subscription_data_sets->uec_amf_data); - OpenAPI_ue_context_in_smf_data_free(subscription_data_sets->uec_smf_data); - OpenAPI_ue_context_in_smsf_data_free(subscription_data_sets->uec_smsf_data); - OpenAPI_sms_subscription_data_free(subscription_data_sets->sms_subs_data); - OpenAPI_list_for_each(subscription_data_sets->sm_data, node) { - OpenAPI_session_management_subscription_data_free(node->data); + if (subscription_data_sets->am_data) { + OpenAPI_access_and_mobility_subscription_data_free(subscription_data_sets->am_data); + subscription_data_sets->am_data = NULL; + } + if (subscription_data_sets->smf_sel_data) { + OpenAPI_smf_selection_subscription_data_free(subscription_data_sets->smf_sel_data); + subscription_data_sets->smf_sel_data = NULL; + } + if (subscription_data_sets->uec_amf_data) { + OpenAPI_ue_context_in_amf_data_free(subscription_data_sets->uec_amf_data); + subscription_data_sets->uec_amf_data = NULL; + } + if (subscription_data_sets->uec_smf_data) { + OpenAPI_ue_context_in_smf_data_free(subscription_data_sets->uec_smf_data); + subscription_data_sets->uec_smf_data = NULL; + } + if (subscription_data_sets->uec_smsf_data) { + OpenAPI_ue_context_in_smsf_data_free(subscription_data_sets->uec_smsf_data); + subscription_data_sets->uec_smsf_data = NULL; + } + if (subscription_data_sets->sms_subs_data) { + OpenAPI_sms_subscription_data_free(subscription_data_sets->sms_subs_data); + subscription_data_sets->sms_subs_data = NULL; + } + if (subscription_data_sets->sm_data) { + OpenAPI_list_for_each(subscription_data_sets->sm_data, node) { + OpenAPI_session_management_subscription_data_free(node->data); + } + OpenAPI_list_free(subscription_data_sets->sm_data); + subscription_data_sets->sm_data = NULL; + } + if (subscription_data_sets->trace_data) { + OpenAPI_trace_data_free(subscription_data_sets->trace_data); + subscription_data_sets->trace_data = NULL; + } + if (subscription_data_sets->sms_mng_data) { + OpenAPI_sms_management_subscription_data_free(subscription_data_sets->sms_mng_data); + subscription_data_sets->sms_mng_data = NULL; + } + if (subscription_data_sets->lcs_privacy_data) { + OpenAPI_lcs_privacy_data_free(subscription_data_sets->lcs_privacy_data); + subscription_data_sets->lcs_privacy_data = NULL; + } + if (subscription_data_sets->lcs_mo_data) { + OpenAPI_lcs_mo_data_free(subscription_data_sets->lcs_mo_data); + subscription_data_sets->lcs_mo_data = NULL; + } + if (subscription_data_sets->v2x_data) { + OpenAPI_v2x_subscription_data_free(subscription_data_sets->v2x_data); + subscription_data_sets->v2x_data = NULL; + } + if (subscription_data_sets->lcs_broadcast_assistance_types_data) { + OpenAPI_lcs_broadcast_assistance_types_data_free(subscription_data_sets->lcs_broadcast_assistance_types_data); + subscription_data_sets->lcs_broadcast_assistance_types_data = NULL; } - OpenAPI_list_free(subscription_data_sets->sm_data); - OpenAPI_trace_data_1_free(subscription_data_sets->trace_data); - OpenAPI_sms_management_subscription_data_free(subscription_data_sets->sms_mng_data); - OpenAPI_lcs_privacy_data_free(subscription_data_sets->lcs_privacy_data); - OpenAPI_lcs_mo_data_free(subscription_data_sets->lcs_mo_data); - OpenAPI_v2x_subscription_data_free(subscription_data_sets->v2x_data); - OpenAPI_lcs_broadcast_assistance_types_data_free(subscription_data_sets->lcs_broadcast_assistance_types_data); ogs_free(subscription_data_sets); } cJSON *OpenAPI_subscription_data_sets_convertToJSON(OpenAPI_subscription_data_sets_t *subscription_data_sets) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscription_data_sets == NULL) { ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [SubscriptionDataSets]"); @@ -159,22 +200,18 @@ cJSON *OpenAPI_subscription_data_sets_convertToJSON(OpenAPI_subscription_data_se ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sm_data]"); goto end; } - - OpenAPI_lnode_t *sm_data_node; - if (subscription_data_sets->sm_data) { - OpenAPI_list_for_each(subscription_data_sets->sm_data, sm_data_node) { - cJSON *itemLocal = OpenAPI_session_management_subscription_data_convertToJSON(sm_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sm_data]"); - goto end; - } - cJSON_AddItemToArray(sm_dataList, itemLocal); + OpenAPI_list_for_each(subscription_data_sets->sm_data, node) { + cJSON *itemLocal = OpenAPI_session_management_subscription_data_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [sm_data]"); + goto end; } + cJSON_AddItemToArray(sm_dataList, itemLocal); } } if (subscription_data_sets->trace_data) { - cJSON *trace_data_local_JSON = OpenAPI_trace_data_1_convertToJSON(subscription_data_sets->trace_data); + cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(subscription_data_sets->trace_data); if (trace_data_local_JSON == NULL) { ogs_error("OpenAPI_subscription_data_sets_convertToJSON() failed [trace_data]"); goto end; @@ -258,115 +295,114 @@ end: OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_parseFromJSON(cJSON *subscription_data_setsJSON) { OpenAPI_subscription_data_sets_t *subscription_data_sets_local_var = NULL; - cJSON *am_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "amData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *am_data = NULL; OpenAPI_access_and_mobility_subscription_data_t *am_data_local_nonprim = NULL; + cJSON *smf_sel_data = NULL; + OpenAPI_smf_selection_subscription_data_t *smf_sel_data_local_nonprim = NULL; + cJSON *uec_amf_data = NULL; + OpenAPI_ue_context_in_amf_data_t *uec_amf_data_local_nonprim = NULL; + cJSON *uec_smf_data = NULL; + OpenAPI_ue_context_in_smf_data_t *uec_smf_data_local_nonprim = NULL; + cJSON *uec_smsf_data = NULL; + OpenAPI_ue_context_in_smsf_data_t *uec_smsf_data_local_nonprim = NULL; + cJSON *sms_subs_data = NULL; + OpenAPI_sms_subscription_data_t *sms_subs_data_local_nonprim = NULL; + cJSON *sm_data = NULL; + OpenAPI_list_t *sm_dataList = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *sms_mng_data = NULL; + OpenAPI_sms_management_subscription_data_t *sms_mng_data_local_nonprim = NULL; + cJSON *lcs_privacy_data = NULL; + OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_nonprim = NULL; + cJSON *lcs_mo_data = NULL; + OpenAPI_lcs_mo_data_t *lcs_mo_data_local_nonprim = NULL; + cJSON *v2x_data = NULL; + OpenAPI_v2x_subscription_data_t *v2x_data_local_nonprim = NULL; + cJSON *lcs_broadcast_assistance_types_data = NULL; + OpenAPI_lcs_broadcast_assistance_types_data_t *lcs_broadcast_assistance_types_data_local_nonprim = NULL; + am_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "amData"); if (am_data) { am_data_local_nonprim = OpenAPI_access_and_mobility_subscription_data_parseFromJSON(am_data); } - cJSON *smf_sel_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smfSelData"); - - OpenAPI_smf_selection_subscription_data_t *smf_sel_data_local_nonprim = NULL; + smf_sel_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smfSelData"); if (smf_sel_data) { smf_sel_data_local_nonprim = OpenAPI_smf_selection_subscription_data_parseFromJSON(smf_sel_data); } - cJSON *uec_amf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "uecAmfData"); - - OpenAPI_ue_context_in_amf_data_t *uec_amf_data_local_nonprim = NULL; + uec_amf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "uecAmfData"); if (uec_amf_data) { uec_amf_data_local_nonprim = OpenAPI_ue_context_in_amf_data_parseFromJSON(uec_amf_data); } - cJSON *uec_smf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "uecSmfData"); - - OpenAPI_ue_context_in_smf_data_t *uec_smf_data_local_nonprim = NULL; + uec_smf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "uecSmfData"); if (uec_smf_data) { uec_smf_data_local_nonprim = OpenAPI_ue_context_in_smf_data_parseFromJSON(uec_smf_data); } - cJSON *uec_smsf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "uecSmsfData"); - - OpenAPI_ue_context_in_smsf_data_t *uec_smsf_data_local_nonprim = NULL; + uec_smsf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "uecSmsfData"); if (uec_smsf_data) { uec_smsf_data_local_nonprim = OpenAPI_ue_context_in_smsf_data_parseFromJSON(uec_smsf_data); } - cJSON *sms_subs_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smsSubsData"); - - OpenAPI_sms_subscription_data_t *sms_subs_data_local_nonprim = NULL; + sms_subs_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smsSubsData"); if (sms_subs_data) { sms_subs_data_local_nonprim = OpenAPI_sms_subscription_data_parseFromJSON(sms_subs_data); } - cJSON *sm_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smData"); - - OpenAPI_list_t *sm_dataList; + sm_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smData"); if (sm_data) { - cJSON *sm_data_local_nonprimitive; - if (!cJSON_IsArray(sm_data)){ - ogs_error("OpenAPI_subscription_data_sets_parseFromJSON() failed [sm_data]"); - goto end; - } - - sm_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sm_data_local_nonprimitive, sm_data ) { - if (!cJSON_IsObject(sm_data_local_nonprimitive)) { + cJSON *sm_data_local = NULL; + if (!cJSON_IsArray(sm_data)) { ogs_error("OpenAPI_subscription_data_sets_parseFromJSON() failed [sm_data]"); goto end; } - OpenAPI_session_management_subscription_data_t *sm_dataItem = OpenAPI_session_management_subscription_data_parseFromJSON(sm_data_local_nonprimitive); - if (!sm_dataItem) { - ogs_error("No sm_dataItem"); - OpenAPI_list_free(sm_dataList); - goto end; + sm_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sm_data_local, sm_data) { + if (!cJSON_IsObject(sm_data_local)) { + ogs_error("OpenAPI_subscription_data_sets_parseFromJSON() failed [sm_data]"); + goto end; + } + OpenAPI_session_management_subscription_data_t *sm_dataItem = OpenAPI_session_management_subscription_data_parseFromJSON(sm_data_local); + if (!sm_dataItem) { + ogs_error("No sm_dataItem"); + OpenAPI_list_free(sm_dataList); + goto end; + } + OpenAPI_list_add(sm_dataList, sm_dataItem); } - - OpenAPI_list_add(sm_dataList, sm_dataItem); - } } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "traceData"); - - OpenAPI_trace_data_1_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "traceData"); if (trace_data) { - trace_data_local_nonprim = OpenAPI_trace_data_1_parseFromJSON(trace_data); + trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *sms_mng_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smsMngData"); - - OpenAPI_sms_management_subscription_data_t *sms_mng_data_local_nonprim = NULL; + sms_mng_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "smsMngData"); if (sms_mng_data) { sms_mng_data_local_nonprim = OpenAPI_sms_management_subscription_data_parseFromJSON(sms_mng_data); } - cJSON *lcs_privacy_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "lcsPrivacyData"); - - OpenAPI_lcs_privacy_data_t *lcs_privacy_data_local_nonprim = NULL; + lcs_privacy_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "lcsPrivacyData"); if (lcs_privacy_data) { lcs_privacy_data_local_nonprim = OpenAPI_lcs_privacy_data_parseFromJSON(lcs_privacy_data); } - cJSON *lcs_mo_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "lcsMoData"); - - OpenAPI_lcs_mo_data_t *lcs_mo_data_local_nonprim = NULL; + lcs_mo_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "lcsMoData"); if (lcs_mo_data) { lcs_mo_data_local_nonprim = OpenAPI_lcs_mo_data_parseFromJSON(lcs_mo_data); } - cJSON *v2x_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "v2xData"); - - OpenAPI_v2x_subscription_data_t *v2x_data_local_nonprim = NULL; + v2x_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "v2xData"); if (v2x_data) { v2x_data_local_nonprim = OpenAPI_v2x_subscription_data_parseFromJSON(v2x_data); } - cJSON *lcs_broadcast_assistance_types_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "lcsBroadcastAssistanceTypesData"); - - OpenAPI_lcs_broadcast_assistance_types_data_t *lcs_broadcast_assistance_types_data_local_nonprim = NULL; + lcs_broadcast_assistance_types_data = cJSON_GetObjectItemCaseSensitive(subscription_data_setsJSON, "lcsBroadcastAssistanceTypesData"); if (lcs_broadcast_assistance_types_data) { lcs_broadcast_assistance_types_data_local_nonprim = OpenAPI_lcs_broadcast_assistance_types_data_parseFromJSON(lcs_broadcast_assistance_types_data); } @@ -389,6 +425,61 @@ OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_parseFromJSON(c return subscription_data_sets_local_var; end: + if (am_data_local_nonprim) { + OpenAPI_access_and_mobility_subscription_data_free(am_data_local_nonprim); + am_data_local_nonprim = NULL; + } + if (smf_sel_data_local_nonprim) { + OpenAPI_smf_selection_subscription_data_free(smf_sel_data_local_nonprim); + smf_sel_data_local_nonprim = NULL; + } + if (uec_amf_data_local_nonprim) { + OpenAPI_ue_context_in_amf_data_free(uec_amf_data_local_nonprim); + uec_amf_data_local_nonprim = NULL; + } + if (uec_smf_data_local_nonprim) { + OpenAPI_ue_context_in_smf_data_free(uec_smf_data_local_nonprim); + uec_smf_data_local_nonprim = NULL; + } + if (uec_smsf_data_local_nonprim) { + OpenAPI_ue_context_in_smsf_data_free(uec_smsf_data_local_nonprim); + uec_smsf_data_local_nonprim = NULL; + } + if (sms_subs_data_local_nonprim) { + OpenAPI_sms_subscription_data_free(sms_subs_data_local_nonprim); + sms_subs_data_local_nonprim = NULL; + } + if (sm_dataList) { + OpenAPI_list_for_each(sm_dataList, node) { + OpenAPI_session_management_subscription_data_free(node->data); + } + OpenAPI_list_free(sm_dataList); + sm_dataList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (sms_mng_data_local_nonprim) { + OpenAPI_sms_management_subscription_data_free(sms_mng_data_local_nonprim); + sms_mng_data_local_nonprim = NULL; + } + if (lcs_privacy_data_local_nonprim) { + OpenAPI_lcs_privacy_data_free(lcs_privacy_data_local_nonprim); + lcs_privacy_data_local_nonprim = NULL; + } + if (lcs_mo_data_local_nonprim) { + OpenAPI_lcs_mo_data_free(lcs_mo_data_local_nonprim); + lcs_mo_data_local_nonprim = NULL; + } + if (v2x_data_local_nonprim) { + OpenAPI_v2x_subscription_data_free(v2x_data_local_nonprim); + v2x_data_local_nonprim = NULL; + } + if (lcs_broadcast_assistance_types_data_local_nonprim) { + OpenAPI_lcs_broadcast_assistance_types_data_free(lcs_broadcast_assistance_types_data_local_nonprim); + lcs_broadcast_assistance_types_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/subscription_data_sets.h b/lib/sbi/openapi/model/subscription_data_sets.h index 83a8189f2..fe563ec25 100644 --- a/lib/sbi/openapi/model/subscription_data_sets.h +++ b/lib/sbi/openapi/model/subscription_data_sets.h @@ -20,7 +20,7 @@ #include "smf_selection_subscription_data.h" #include "sms_management_subscription_data.h" #include "sms_subscription_data.h" -#include "trace_data_1.h" +#include "trace_data.h" #include "ue_context_in_amf_data.h" #include "ue_context_in_smf_data.h" #include "ue_context_in_smsf_data.h" @@ -39,7 +39,7 @@ typedef struct OpenAPI_subscription_data_sets_s { struct OpenAPI_ue_context_in_smsf_data_s *uec_smsf_data; struct OpenAPI_sms_subscription_data_s *sms_subs_data; OpenAPI_list_t *sm_data; - struct OpenAPI_trace_data_1_s *trace_data; + struct OpenAPI_trace_data_s *trace_data; struct OpenAPI_sms_management_subscription_data_s *sms_mng_data; struct OpenAPI_lcs_privacy_data_s *lcs_privacy_data; struct OpenAPI_lcs_mo_data_s *lcs_mo_data; @@ -55,7 +55,7 @@ OpenAPI_subscription_data_sets_t *OpenAPI_subscription_data_sets_create( OpenAPI_ue_context_in_smsf_data_t *uec_smsf_data, OpenAPI_sms_subscription_data_t *sms_subs_data, OpenAPI_list_t *sm_data, - OpenAPI_trace_data_1_t *trace_data, + OpenAPI_trace_data_t *trace_data, OpenAPI_sms_management_subscription_data_t *sms_mng_data, OpenAPI_lcs_privacy_data_t *lcs_privacy_data, OpenAPI_lcs_mo_data_t *lcs_mo_data, diff --git a/lib/sbi/openapi/model/subscription_data_sets_1.c b/lib/sbi/openapi/model/subscription_data_sets_1.c index 9e2cb1302..47752c58f 100644 --- a/lib/sbi/openapi/model/subscription_data_sets_1.c +++ b/lib/sbi/openapi/model/subscription_data_sets_1.c @@ -42,32 +42,73 @@ OpenAPI_subscription_data_sets_1_t *OpenAPI_subscription_data_sets_1_create( void OpenAPI_subscription_data_sets_1_free(OpenAPI_subscription_data_sets_1_t *subscription_data_sets_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscription_data_sets_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_access_and_mobility_subscription_data_1_free(subscription_data_sets_1->am_data); - OpenAPI_smf_selection_subscription_data_1_free(subscription_data_sets_1->smf_sel_data); - OpenAPI_ue_context_in_amf_data_1_free(subscription_data_sets_1->uec_amf_data); - OpenAPI_ue_context_in_smf_data_1_free(subscription_data_sets_1->uec_smf_data); - OpenAPI_ue_context_in_smsf_data_1_free(subscription_data_sets_1->uec_smsf_data); - OpenAPI_sms_subscription_data_1_free(subscription_data_sets_1->sms_subs_data); - OpenAPI_list_for_each(subscription_data_sets_1->sm_data, node) { - OpenAPI_session_management_subscription_data_1_free(node->data); + if (subscription_data_sets_1->am_data) { + OpenAPI_access_and_mobility_subscription_data_1_free(subscription_data_sets_1->am_data); + subscription_data_sets_1->am_data = NULL; + } + if (subscription_data_sets_1->smf_sel_data) { + OpenAPI_smf_selection_subscription_data_1_free(subscription_data_sets_1->smf_sel_data); + subscription_data_sets_1->smf_sel_data = NULL; + } + if (subscription_data_sets_1->uec_amf_data) { + OpenAPI_ue_context_in_amf_data_1_free(subscription_data_sets_1->uec_amf_data); + subscription_data_sets_1->uec_amf_data = NULL; + } + if (subscription_data_sets_1->uec_smf_data) { + OpenAPI_ue_context_in_smf_data_1_free(subscription_data_sets_1->uec_smf_data); + subscription_data_sets_1->uec_smf_data = NULL; + } + if (subscription_data_sets_1->uec_smsf_data) { + OpenAPI_ue_context_in_smsf_data_1_free(subscription_data_sets_1->uec_smsf_data); + subscription_data_sets_1->uec_smsf_data = NULL; + } + if (subscription_data_sets_1->sms_subs_data) { + OpenAPI_sms_subscription_data_1_free(subscription_data_sets_1->sms_subs_data); + subscription_data_sets_1->sms_subs_data = NULL; + } + if (subscription_data_sets_1->sm_data) { + OpenAPI_list_for_each(subscription_data_sets_1->sm_data, node) { + OpenAPI_session_management_subscription_data_1_free(node->data); + } + OpenAPI_list_free(subscription_data_sets_1->sm_data); + subscription_data_sets_1->sm_data = NULL; + } + if (subscription_data_sets_1->trace_data) { + OpenAPI_trace_data_free(subscription_data_sets_1->trace_data); + subscription_data_sets_1->trace_data = NULL; + } + if (subscription_data_sets_1->sms_mng_data) { + OpenAPI_sms_management_subscription_data_1_free(subscription_data_sets_1->sms_mng_data); + subscription_data_sets_1->sms_mng_data = NULL; + } + if (subscription_data_sets_1->lcs_privacy_data) { + OpenAPI_lcs_privacy_data_1_free(subscription_data_sets_1->lcs_privacy_data); + subscription_data_sets_1->lcs_privacy_data = NULL; + } + if (subscription_data_sets_1->lcs_mo_data) { + OpenAPI_lcs_mo_data_free(subscription_data_sets_1->lcs_mo_data); + subscription_data_sets_1->lcs_mo_data = NULL; + } + if (subscription_data_sets_1->v2x_data) { + OpenAPI_v2x_subscription_data_1_free(subscription_data_sets_1->v2x_data); + subscription_data_sets_1->v2x_data = NULL; + } + if (subscription_data_sets_1->lcs_broadcast_assistance_types_data) { + OpenAPI_lcs_broadcast_assistance_types_data_1_free(subscription_data_sets_1->lcs_broadcast_assistance_types_data); + subscription_data_sets_1->lcs_broadcast_assistance_types_data = NULL; } - OpenAPI_list_free(subscription_data_sets_1->sm_data); - OpenAPI_trace_data_free(subscription_data_sets_1->trace_data); - OpenAPI_sms_management_subscription_data_1_free(subscription_data_sets_1->sms_mng_data); - OpenAPI_lcs_privacy_data_1_free(subscription_data_sets_1->lcs_privacy_data); - OpenAPI_lcs_mo_data_free(subscription_data_sets_1->lcs_mo_data); - OpenAPI_v2x_subscription_data_1_free(subscription_data_sets_1->v2x_data); - OpenAPI_lcs_broadcast_assistance_types_data_1_free(subscription_data_sets_1->lcs_broadcast_assistance_types_data); ogs_free(subscription_data_sets_1); } cJSON *OpenAPI_subscription_data_sets_1_convertToJSON(OpenAPI_subscription_data_sets_1_t *subscription_data_sets_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscription_data_sets_1 == NULL) { ogs_error("OpenAPI_subscription_data_sets_1_convertToJSON() failed [SubscriptionDataSets_1]"); @@ -159,17 +200,13 @@ cJSON *OpenAPI_subscription_data_sets_1_convertToJSON(OpenAPI_subscription_data_ ogs_error("OpenAPI_subscription_data_sets_1_convertToJSON() failed [sm_data]"); goto end; } - - OpenAPI_lnode_t *sm_data_node; - if (subscription_data_sets_1->sm_data) { - OpenAPI_list_for_each(subscription_data_sets_1->sm_data, sm_data_node) { - cJSON *itemLocal = OpenAPI_session_management_subscription_data_1_convertToJSON(sm_data_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_sets_1_convertToJSON() failed [sm_data]"); - goto end; - } - cJSON_AddItemToArray(sm_dataList, itemLocal); + OpenAPI_list_for_each(subscription_data_sets_1->sm_data, node) { + cJSON *itemLocal = OpenAPI_session_management_subscription_data_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_sets_1_convertToJSON() failed [sm_data]"); + goto end; } + cJSON_AddItemToArray(sm_dataList, itemLocal); } } @@ -258,115 +295,114 @@ end: OpenAPI_subscription_data_sets_1_t *OpenAPI_subscription_data_sets_1_parseFromJSON(cJSON *subscription_data_sets_1JSON) { OpenAPI_subscription_data_sets_1_t *subscription_data_sets_1_local_var = NULL; - cJSON *am_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "amData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *am_data = NULL; OpenAPI_access_and_mobility_subscription_data_1_t *am_data_local_nonprim = NULL; + cJSON *smf_sel_data = NULL; + OpenAPI_smf_selection_subscription_data_1_t *smf_sel_data_local_nonprim = NULL; + cJSON *uec_amf_data = NULL; + OpenAPI_ue_context_in_amf_data_1_t *uec_amf_data_local_nonprim = NULL; + cJSON *uec_smf_data = NULL; + OpenAPI_ue_context_in_smf_data_1_t *uec_smf_data_local_nonprim = NULL; + cJSON *uec_smsf_data = NULL; + OpenAPI_ue_context_in_smsf_data_1_t *uec_smsf_data_local_nonprim = NULL; + cJSON *sms_subs_data = NULL; + OpenAPI_sms_subscription_data_1_t *sms_subs_data_local_nonprim = NULL; + cJSON *sm_data = NULL; + OpenAPI_list_t *sm_dataList = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *sms_mng_data = NULL; + OpenAPI_sms_management_subscription_data_1_t *sms_mng_data_local_nonprim = NULL; + cJSON *lcs_privacy_data = NULL; + OpenAPI_lcs_privacy_data_1_t *lcs_privacy_data_local_nonprim = NULL; + cJSON *lcs_mo_data = NULL; + OpenAPI_lcs_mo_data_t *lcs_mo_data_local_nonprim = NULL; + cJSON *v2x_data = NULL; + OpenAPI_v2x_subscription_data_1_t *v2x_data_local_nonprim = NULL; + cJSON *lcs_broadcast_assistance_types_data = NULL; + OpenAPI_lcs_broadcast_assistance_types_data_1_t *lcs_broadcast_assistance_types_data_local_nonprim = NULL; + am_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "amData"); if (am_data) { am_data_local_nonprim = OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON(am_data); } - cJSON *smf_sel_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "smfSelData"); - - OpenAPI_smf_selection_subscription_data_1_t *smf_sel_data_local_nonprim = NULL; + smf_sel_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "smfSelData"); if (smf_sel_data) { smf_sel_data_local_nonprim = OpenAPI_smf_selection_subscription_data_1_parseFromJSON(smf_sel_data); } - cJSON *uec_amf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "uecAmfData"); - - OpenAPI_ue_context_in_amf_data_1_t *uec_amf_data_local_nonprim = NULL; + uec_amf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "uecAmfData"); if (uec_amf_data) { uec_amf_data_local_nonprim = OpenAPI_ue_context_in_amf_data_1_parseFromJSON(uec_amf_data); } - cJSON *uec_smf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "uecSmfData"); - - OpenAPI_ue_context_in_smf_data_1_t *uec_smf_data_local_nonprim = NULL; + uec_smf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "uecSmfData"); if (uec_smf_data) { uec_smf_data_local_nonprim = OpenAPI_ue_context_in_smf_data_1_parseFromJSON(uec_smf_data); } - cJSON *uec_smsf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "uecSmsfData"); - - OpenAPI_ue_context_in_smsf_data_1_t *uec_smsf_data_local_nonprim = NULL; + uec_smsf_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "uecSmsfData"); if (uec_smsf_data) { uec_smsf_data_local_nonprim = OpenAPI_ue_context_in_smsf_data_1_parseFromJSON(uec_smsf_data); } - cJSON *sms_subs_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "smsSubsData"); - - OpenAPI_sms_subscription_data_1_t *sms_subs_data_local_nonprim = NULL; + sms_subs_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "smsSubsData"); if (sms_subs_data) { sms_subs_data_local_nonprim = OpenAPI_sms_subscription_data_1_parseFromJSON(sms_subs_data); } - cJSON *sm_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "smData"); - - OpenAPI_list_t *sm_dataList; + sm_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "smData"); if (sm_data) { - cJSON *sm_data_local_nonprimitive; - if (!cJSON_IsArray(sm_data)){ - ogs_error("OpenAPI_subscription_data_sets_1_parseFromJSON() failed [sm_data]"); - goto end; - } - - sm_dataList = OpenAPI_list_create(); - - cJSON_ArrayForEach(sm_data_local_nonprimitive, sm_data ) { - if (!cJSON_IsObject(sm_data_local_nonprimitive)) { + cJSON *sm_data_local = NULL; + if (!cJSON_IsArray(sm_data)) { ogs_error("OpenAPI_subscription_data_sets_1_parseFromJSON() failed [sm_data]"); goto end; } - OpenAPI_session_management_subscription_data_1_t *sm_dataItem = OpenAPI_session_management_subscription_data_1_parseFromJSON(sm_data_local_nonprimitive); - if (!sm_dataItem) { - ogs_error("No sm_dataItem"); - OpenAPI_list_free(sm_dataList); - goto end; + sm_dataList = OpenAPI_list_create(); + + cJSON_ArrayForEach(sm_data_local, sm_data) { + if (!cJSON_IsObject(sm_data_local)) { + ogs_error("OpenAPI_subscription_data_sets_1_parseFromJSON() failed [sm_data]"); + goto end; + } + OpenAPI_session_management_subscription_data_1_t *sm_dataItem = OpenAPI_session_management_subscription_data_1_parseFromJSON(sm_data_local); + if (!sm_dataItem) { + ogs_error("No sm_dataItem"); + OpenAPI_list_free(sm_dataList); + goto end; + } + OpenAPI_list_add(sm_dataList, sm_dataItem); } - - OpenAPI_list_add(sm_dataList, sm_dataItem); - } } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *sms_mng_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "smsMngData"); - - OpenAPI_sms_management_subscription_data_1_t *sms_mng_data_local_nonprim = NULL; + sms_mng_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "smsMngData"); if (sms_mng_data) { sms_mng_data_local_nonprim = OpenAPI_sms_management_subscription_data_1_parseFromJSON(sms_mng_data); } - cJSON *lcs_privacy_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "lcsPrivacyData"); - - OpenAPI_lcs_privacy_data_1_t *lcs_privacy_data_local_nonprim = NULL; + lcs_privacy_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "lcsPrivacyData"); if (lcs_privacy_data) { lcs_privacy_data_local_nonprim = OpenAPI_lcs_privacy_data_1_parseFromJSON(lcs_privacy_data); } - cJSON *lcs_mo_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "lcsMoData"); - - OpenAPI_lcs_mo_data_t *lcs_mo_data_local_nonprim = NULL; + lcs_mo_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "lcsMoData"); if (lcs_mo_data) { lcs_mo_data_local_nonprim = OpenAPI_lcs_mo_data_parseFromJSON(lcs_mo_data); } - cJSON *v2x_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "v2xData"); - - OpenAPI_v2x_subscription_data_1_t *v2x_data_local_nonprim = NULL; + v2x_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "v2xData"); if (v2x_data) { v2x_data_local_nonprim = OpenAPI_v2x_subscription_data_1_parseFromJSON(v2x_data); } - cJSON *lcs_broadcast_assistance_types_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "lcsBroadcastAssistanceTypesData"); - - OpenAPI_lcs_broadcast_assistance_types_data_1_t *lcs_broadcast_assistance_types_data_local_nonprim = NULL; + lcs_broadcast_assistance_types_data = cJSON_GetObjectItemCaseSensitive(subscription_data_sets_1JSON, "lcsBroadcastAssistanceTypesData"); if (lcs_broadcast_assistance_types_data) { lcs_broadcast_assistance_types_data_local_nonprim = OpenAPI_lcs_broadcast_assistance_types_data_1_parseFromJSON(lcs_broadcast_assistance_types_data); } @@ -389,6 +425,61 @@ OpenAPI_subscription_data_sets_1_t *OpenAPI_subscription_data_sets_1_parseFromJS return subscription_data_sets_1_local_var; end: + if (am_data_local_nonprim) { + OpenAPI_access_and_mobility_subscription_data_1_free(am_data_local_nonprim); + am_data_local_nonprim = NULL; + } + if (smf_sel_data_local_nonprim) { + OpenAPI_smf_selection_subscription_data_1_free(smf_sel_data_local_nonprim); + smf_sel_data_local_nonprim = NULL; + } + if (uec_amf_data_local_nonprim) { + OpenAPI_ue_context_in_amf_data_1_free(uec_amf_data_local_nonprim); + uec_amf_data_local_nonprim = NULL; + } + if (uec_smf_data_local_nonprim) { + OpenAPI_ue_context_in_smf_data_1_free(uec_smf_data_local_nonprim); + uec_smf_data_local_nonprim = NULL; + } + if (uec_smsf_data_local_nonprim) { + OpenAPI_ue_context_in_smsf_data_1_free(uec_smsf_data_local_nonprim); + uec_smsf_data_local_nonprim = NULL; + } + if (sms_subs_data_local_nonprim) { + OpenAPI_sms_subscription_data_1_free(sms_subs_data_local_nonprim); + sms_subs_data_local_nonprim = NULL; + } + if (sm_dataList) { + OpenAPI_list_for_each(sm_dataList, node) { + OpenAPI_session_management_subscription_data_1_free(node->data); + } + OpenAPI_list_free(sm_dataList); + sm_dataList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (sms_mng_data_local_nonprim) { + OpenAPI_sms_management_subscription_data_1_free(sms_mng_data_local_nonprim); + sms_mng_data_local_nonprim = NULL; + } + if (lcs_privacy_data_local_nonprim) { + OpenAPI_lcs_privacy_data_1_free(lcs_privacy_data_local_nonprim); + lcs_privacy_data_local_nonprim = NULL; + } + if (lcs_mo_data_local_nonprim) { + OpenAPI_lcs_mo_data_free(lcs_mo_data_local_nonprim); + lcs_mo_data_local_nonprim = NULL; + } + if (v2x_data_local_nonprim) { + OpenAPI_v2x_subscription_data_1_free(v2x_data_local_nonprim); + v2x_data_local_nonprim = NULL; + } + if (lcs_broadcast_assistance_types_data_local_nonprim) { + OpenAPI_lcs_broadcast_assistance_types_data_1_free(lcs_broadcast_assistance_types_data_local_nonprim); + lcs_broadcast_assistance_types_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/subscription_data_subscr_cond.c b/lib/sbi/openapi/model/subscription_data_subscr_cond.c index c2fe5b84e..c7f774db4 100644 --- a/lib/sbi/openapi/model/subscription_data_subscr_cond.c +++ b/lib/sbi/openapi/model/subscription_data_subscr_cond.c @@ -42,43 +42,81 @@ OpenAPI_subscription_data_subscr_cond_t *OpenAPI_subscription_data_subscr_cond_c void OpenAPI_subscription_data_subscr_cond_free(OpenAPI_subscription_data_subscr_cond_t *subscription_data_subscr_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscription_data_subscr_cond) { return; } - OpenAPI_lnode_t *node; - ogs_free(subscription_data_subscr_cond->nf_instance_id); - ogs_free(subscription_data_subscr_cond->service_name); - ogs_free(subscription_data_subscr_cond->amf_set_id); - ogs_free(subscription_data_subscr_cond->amf_region_id); - OpenAPI_list_for_each(subscription_data_subscr_cond->guami_list, node) { - OpenAPI_guami_free(node->data); + if (subscription_data_subscr_cond->nf_instance_id) { + ogs_free(subscription_data_subscr_cond->nf_instance_id); + subscription_data_subscr_cond->nf_instance_id = NULL; } - OpenAPI_list_free(subscription_data_subscr_cond->guami_list); - OpenAPI_list_for_each(subscription_data_subscr_cond->snssai_list, node) { - OpenAPI_snssai_free(node->data); + if (subscription_data_subscr_cond->service_name) { + ogs_free(subscription_data_subscr_cond->service_name); + subscription_data_subscr_cond->service_name = NULL; } - OpenAPI_list_free(subscription_data_subscr_cond->snssai_list); - OpenAPI_list_for_each(subscription_data_subscr_cond->nsi_list, node) { - ogs_free(node->data); + if (subscription_data_subscr_cond->amf_set_id) { + ogs_free(subscription_data_subscr_cond->amf_set_id); + subscription_data_subscr_cond->amf_set_id = NULL; } - OpenAPI_list_free(subscription_data_subscr_cond->nsi_list); - ogs_free(subscription_data_subscr_cond->nf_group_id); - ogs_free(subscription_data_subscr_cond->nf_set_id); - ogs_free(subscription_data_subscr_cond->nf_service_set_id); - OpenAPI_list_for_each(subscription_data_subscr_cond->smf_serving_area, node) { - ogs_free(node->data); + if (subscription_data_subscr_cond->amf_region_id) { + ogs_free(subscription_data_subscr_cond->amf_region_id); + subscription_data_subscr_cond->amf_region_id = NULL; } - OpenAPI_list_free(subscription_data_subscr_cond->smf_serving_area); - OpenAPI_list_for_each(subscription_data_subscr_cond->tai_list, node) { - OpenAPI_tai_free(node->data); + if (subscription_data_subscr_cond->guami_list) { + OpenAPI_list_for_each(subscription_data_subscr_cond->guami_list, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(subscription_data_subscr_cond->guami_list); + subscription_data_subscr_cond->guami_list = NULL; + } + if (subscription_data_subscr_cond->snssai_list) { + OpenAPI_list_for_each(subscription_data_subscr_cond->snssai_list, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(subscription_data_subscr_cond->snssai_list); + subscription_data_subscr_cond->snssai_list = NULL; + } + if (subscription_data_subscr_cond->nsi_list) { + OpenAPI_list_for_each(subscription_data_subscr_cond->nsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subscription_data_subscr_cond->nsi_list); + subscription_data_subscr_cond->nsi_list = NULL; + } + if (subscription_data_subscr_cond->nf_group_id) { + ogs_free(subscription_data_subscr_cond->nf_group_id); + subscription_data_subscr_cond->nf_group_id = NULL; + } + if (subscription_data_subscr_cond->nf_set_id) { + ogs_free(subscription_data_subscr_cond->nf_set_id); + subscription_data_subscr_cond->nf_set_id = NULL; + } + if (subscription_data_subscr_cond->nf_service_set_id) { + ogs_free(subscription_data_subscr_cond->nf_service_set_id); + subscription_data_subscr_cond->nf_service_set_id = NULL; + } + if (subscription_data_subscr_cond->smf_serving_area) { + OpenAPI_list_for_each(subscription_data_subscr_cond->smf_serving_area, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subscription_data_subscr_cond->smf_serving_area); + subscription_data_subscr_cond->smf_serving_area = NULL; + } + if (subscription_data_subscr_cond->tai_list) { + OpenAPI_list_for_each(subscription_data_subscr_cond->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(subscription_data_subscr_cond->tai_list); + subscription_data_subscr_cond->tai_list = NULL; } - OpenAPI_list_free(subscription_data_subscr_cond->tai_list); ogs_free(subscription_data_subscr_cond); } cJSON *OpenAPI_subscription_data_subscr_cond_convertToJSON(OpenAPI_subscription_data_subscr_cond_t *subscription_data_subscr_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscription_data_subscr_cond == NULL) { ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [SubscriptionData_subscrCond]"); @@ -93,7 +131,7 @@ cJSON *OpenAPI_subscription_data_subscr_cond_convertToJSON(OpenAPI_subscription_ } } - if (subscription_data_subscr_cond->nf_type) { + if (subscription_data_subscr_cond->nf_type != OpenAPI_nf_type_NULL) { if (cJSON_AddStringToObject(item, "nfType", OpenAPI_nf_type_ToString(subscription_data_subscr_cond->nf_type)) == NULL) { ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [nf_type]"); goto end; @@ -127,17 +165,13 @@ cJSON *OpenAPI_subscription_data_subscr_cond_convertToJSON(OpenAPI_subscription_ ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [guami_list]"); goto end; } - - OpenAPI_lnode_t *guami_list_node; - if (subscription_data_subscr_cond->guami_list) { - OpenAPI_list_for_each(subscription_data_subscr_cond->guami_list, guami_list_node) { - cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [guami_list]"); - goto end; - } - cJSON_AddItemToArray(guami_listList, itemLocal); + OpenAPI_list_for_each(subscription_data_subscr_cond->guami_list, node) { + cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [guami_list]"); + goto end; } + cJSON_AddItemToArray(guami_listList, itemLocal); } } @@ -147,34 +181,28 @@ cJSON *OpenAPI_subscription_data_subscr_cond_convertToJSON(OpenAPI_subscription_ ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [snssai_list]"); goto end; } - - OpenAPI_lnode_t *snssai_list_node; - if (subscription_data_subscr_cond->snssai_list) { - OpenAPI_list_for_each(subscription_data_subscr_cond->snssai_list, snssai_list_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(snssai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [snssai_list]"); - goto end; - } - cJSON_AddItemToArray(snssai_listList, itemLocal); + OpenAPI_list_for_each(subscription_data_subscr_cond->snssai_list, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [snssai_list]"); + goto end; } + cJSON_AddItemToArray(snssai_listList, itemLocal); } } if (subscription_data_subscr_cond->nsi_list) { - cJSON *nsi_list = cJSON_AddArrayToObject(item, "nsiList"); - if (nsi_list == NULL) { + cJSON *nsi_listList = cJSON_AddArrayToObject(item, "nsiList"); + if (nsi_listList == NULL) { ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [nsi_list]"); goto end; } - - OpenAPI_lnode_t *nsi_list_node; - OpenAPI_list_for_each(subscription_data_subscr_cond->nsi_list, nsi_list_node) { - if (cJSON_AddStringToObject(nsi_list, "", (char*)nsi_list_node->data) == NULL) { - ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [nsi_list]"); - goto end; + OpenAPI_list_for_each(subscription_data_subscr_cond->nsi_list, node) { + if (cJSON_AddStringToObject(nsi_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [nsi_list]"); + goto end; + } } - } } if (subscription_data_subscr_cond->nf_group_id) { @@ -199,19 +227,17 @@ cJSON *OpenAPI_subscription_data_subscr_cond_convertToJSON(OpenAPI_subscription_ } if (subscription_data_subscr_cond->smf_serving_area) { - cJSON *smf_serving_area = cJSON_AddArrayToObject(item, "smfServingArea"); - if (smf_serving_area == NULL) { + cJSON *smf_serving_areaList = cJSON_AddArrayToObject(item, "smfServingArea"); + if (smf_serving_areaList == NULL) { ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [smf_serving_area]"); goto end; } - - OpenAPI_lnode_t *smf_serving_area_node; - OpenAPI_list_for_each(subscription_data_subscr_cond->smf_serving_area, smf_serving_area_node) { - if (cJSON_AddStringToObject(smf_serving_area, "", (char*)smf_serving_area_node->data) == NULL) { - ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [smf_serving_area]"); - goto end; + OpenAPI_list_for_each(subscription_data_subscr_cond->smf_serving_area, node) { + if (cJSON_AddStringToObject(smf_serving_areaList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [smf_serving_area]"); + goto end; + } } - } } if (subscription_data_subscr_cond->tai_list) { @@ -220,17 +246,13 @@ cJSON *OpenAPI_subscription_data_subscr_cond_convertToJSON(OpenAPI_subscription_ ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (subscription_data_subscr_cond->tai_list) { - OpenAPI_list_for_each(subscription_data_subscr_cond->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(subscription_data_subscr_cond->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_subscription_data_subscr_cond_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } } @@ -241,18 +263,35 @@ end: OpenAPI_subscription_data_subscr_cond_t *OpenAPI_subscription_data_subscr_cond_parseFromJSON(cJSON *subscription_data_subscr_condJSON) { OpenAPI_subscription_data_subscr_cond_t *subscription_data_subscr_cond_local_var = NULL; - cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfInstanceId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *nf_instance_id = NULL; + cJSON *nf_type = NULL; + OpenAPI_nf_type_e nf_typeVariable = 0; + cJSON *service_name = NULL; + cJSON *amf_set_id = NULL; + cJSON *amf_region_id = NULL; + cJSON *guami_list = NULL; + OpenAPI_list_t *guami_listList = NULL; + cJSON *snssai_list = NULL; + OpenAPI_list_t *snssai_listList = NULL; + cJSON *nsi_list = NULL; + OpenAPI_list_t *nsi_listList = NULL; + cJSON *nf_group_id = NULL; + cJSON *nf_set_id = NULL; + cJSON *nf_service_set_id = NULL; + cJSON *smf_serving_area = NULL; + OpenAPI_list_t *smf_serving_areaList = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + nf_instance_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfInstanceId"); if (nf_instance_id) { - if (!cJSON_IsString(nf_instance_id)) { + if (!cJSON_IsString(nf_instance_id) && !cJSON_IsNull(nf_instance_id)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nf_instance_id]"); goto end; } } - cJSON *nf_type = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfType"); - - OpenAPI_nf_type_e nf_typeVariable; + nf_type = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfType"); if (nf_type) { if (!cJSON_IsString(nf_type)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nf_type]"); @@ -261,205 +300,224 @@ OpenAPI_subscription_data_subscr_cond_t *OpenAPI_subscription_data_subscr_cond_p nf_typeVariable = OpenAPI_nf_type_FromString(nf_type->valuestring); } - cJSON *service_name = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "serviceName"); - + service_name = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "serviceName"); if (service_name) { - if (!cJSON_IsString(service_name)) { + if (!cJSON_IsString(service_name) && !cJSON_IsNull(service_name)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [service_name]"); goto end; } } - cJSON *amf_set_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "amfSetId"); - + amf_set_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "amfSetId"); if (amf_set_id) { - if (!cJSON_IsString(amf_set_id)) { + if (!cJSON_IsString(amf_set_id) && !cJSON_IsNull(amf_set_id)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [amf_set_id]"); goto end; } } - cJSON *amf_region_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "amfRegionId"); - + amf_region_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "amfRegionId"); if (amf_region_id) { - if (!cJSON_IsString(amf_region_id)) { + if (!cJSON_IsString(amf_region_id) && !cJSON_IsNull(amf_region_id)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [amf_region_id]"); goto end; } } - cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "guamiList"); - - OpenAPI_list_t *guami_listList; + guami_list = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "guamiList"); if (guami_list) { - cJSON *guami_list_local_nonprimitive; - if (!cJSON_IsArray(guami_list)){ - ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [guami_list]"); - goto end; - } - - guami_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) { - if (!cJSON_IsObject(guami_list_local_nonprimitive)) { + cJSON *guami_list_local = NULL; + if (!cJSON_IsArray(guami_list)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [guami_list]"); goto end; } - OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive); - if (!guami_listItem) { - ogs_error("No guami_listItem"); - OpenAPI_list_free(guami_listList); - goto end; + guami_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(guami_list_local, guami_list) { + if (!cJSON_IsObject(guami_list_local)) { + ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [guami_list]"); + goto end; + } + OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local); + if (!guami_listItem) { + ogs_error("No guami_listItem"); + OpenAPI_list_free(guami_listList); + goto end; + } + OpenAPI_list_add(guami_listList, guami_listItem); } - - OpenAPI_list_add(guami_listList, guami_listItem); - } } - cJSON *snssai_list = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "snssaiList"); - - OpenAPI_list_t *snssai_listList; + snssai_list = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "snssaiList"); if (snssai_list) { - cJSON *snssai_list_local_nonprimitive; - if (!cJSON_IsArray(snssai_list)){ - ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [snssai_list]"); - goto end; - } - - snssai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(snssai_list_local_nonprimitive, snssai_list ) { - if (!cJSON_IsObject(snssai_list_local_nonprimitive)) { + cJSON *snssai_list_local = NULL; + if (!cJSON_IsArray(snssai_list)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [snssai_list]"); goto end; } - OpenAPI_snssai_t *snssai_listItem = OpenAPI_snssai_parseFromJSON(snssai_list_local_nonprimitive); - if (!snssai_listItem) { - ogs_error("No snssai_listItem"); - OpenAPI_list_free(snssai_listList); + snssai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssai_list_local, snssai_list) { + if (!cJSON_IsObject(snssai_list_local)) { + ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [snssai_list]"); + goto end; + } + OpenAPI_snssai_t *snssai_listItem = OpenAPI_snssai_parseFromJSON(snssai_list_local); + if (!snssai_listItem) { + ogs_error("No snssai_listItem"); + OpenAPI_list_free(snssai_listList); + goto end; + } + OpenAPI_list_add(snssai_listList, snssai_listItem); + } + } + + nsi_list = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nsiList"); + if (nsi_list) { + cJSON *nsi_list_local = NULL; + if (!cJSON_IsArray(nsi_list)) { + ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nsi_list]"); goto end; } - OpenAPI_list_add(snssai_listList, snssai_listItem); - } + nsi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(nsi_list_local, nsi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(nsi_list_local)) { + ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nsi_list]"); + goto end; + } + OpenAPI_list_add(nsi_listList, ogs_strdup(nsi_list_local->valuestring)); + } } - cJSON *nsi_list = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nsiList"); - - OpenAPI_list_t *nsi_listList; - if (nsi_list) { - cJSON *nsi_list_local; - if (!cJSON_IsArray(nsi_list)) { - ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nsi_list]"); - goto end; - } - nsi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(nsi_list_local, nsi_list) { - if (!cJSON_IsString(nsi_list_local)) { - ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nsi_list]"); - goto end; - } - OpenAPI_list_add(nsi_listList, ogs_strdup(nsi_list_local->valuestring)); - } - } - - cJSON *nf_group_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfGroupId"); - + nf_group_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfGroupId"); if (nf_group_id) { - if (!cJSON_IsString(nf_group_id)) { + if (!cJSON_IsString(nf_group_id) && !cJSON_IsNull(nf_group_id)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nf_group_id]"); goto end; } } - cJSON *nf_set_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfSetId"); - + nf_set_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfSetId"); if (nf_set_id) { - if (!cJSON_IsString(nf_set_id)) { + if (!cJSON_IsString(nf_set_id) && !cJSON_IsNull(nf_set_id)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nf_set_id]"); goto end; } } - cJSON *nf_service_set_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfServiceSetId"); - + nf_service_set_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "nfServiceSetId"); if (nf_service_set_id) { - if (!cJSON_IsString(nf_service_set_id)) { + if (!cJSON_IsString(nf_service_set_id) && !cJSON_IsNull(nf_service_set_id)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [nf_service_set_id]"); goto end; } } - cJSON *smf_serving_area = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "smfServingArea"); - - OpenAPI_list_t *smf_serving_areaList; + smf_serving_area = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "smfServingArea"); if (smf_serving_area) { - cJSON *smf_serving_area_local; - if (!cJSON_IsArray(smf_serving_area)) { - ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [smf_serving_area]"); - goto end; - } - smf_serving_areaList = OpenAPI_list_create(); + cJSON *smf_serving_area_local = NULL; + if (!cJSON_IsArray(smf_serving_area)) { + ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [smf_serving_area]"); + goto end; + } - cJSON_ArrayForEach(smf_serving_area_local, smf_serving_area) { - if (!cJSON_IsString(smf_serving_area_local)) { - ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [smf_serving_area]"); - goto end; - } - OpenAPI_list_add(smf_serving_areaList, ogs_strdup(smf_serving_area_local->valuestring)); - } + smf_serving_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_serving_area_local, smf_serving_area) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(smf_serving_area_local)) { + ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [smf_serving_area]"); + goto end; + } + OpenAPI_list_add(smf_serving_areaList, ogs_strdup(smf_serving_area_local->valuestring)); + } } - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "taiList"); - - OpenAPI_list_t *tai_listList; + tai_list = cJSON_GetObjectItemCaseSensitive(subscription_data_subscr_condJSON, "taiList"); if (tai_list) { - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_subscription_data_subscr_cond_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - - OpenAPI_list_add(tai_listList, tai_listItem); - } } subscription_data_subscr_cond_local_var = OpenAPI_subscription_data_subscr_cond_create ( - nf_instance_id ? ogs_strdup(nf_instance_id->valuestring) : NULL, + nf_instance_id && !cJSON_IsNull(nf_instance_id) ? ogs_strdup(nf_instance_id->valuestring) : NULL, nf_type ? nf_typeVariable : 0, - service_name ? ogs_strdup(service_name->valuestring) : NULL, - amf_set_id ? ogs_strdup(amf_set_id->valuestring) : NULL, - amf_region_id ? ogs_strdup(amf_region_id->valuestring) : NULL, + service_name && !cJSON_IsNull(service_name) ? ogs_strdup(service_name->valuestring) : NULL, + amf_set_id && !cJSON_IsNull(amf_set_id) ? ogs_strdup(amf_set_id->valuestring) : NULL, + amf_region_id && !cJSON_IsNull(amf_region_id) ? ogs_strdup(amf_region_id->valuestring) : NULL, guami_list ? guami_listList : NULL, snssai_list ? snssai_listList : NULL, nsi_list ? nsi_listList : NULL, - nf_group_id ? ogs_strdup(nf_group_id->valuestring) : NULL, - nf_set_id ? ogs_strdup(nf_set_id->valuestring) : NULL, - nf_service_set_id ? ogs_strdup(nf_service_set_id->valuestring) : NULL, + nf_group_id && !cJSON_IsNull(nf_group_id) ? ogs_strdup(nf_group_id->valuestring) : NULL, + nf_set_id && !cJSON_IsNull(nf_set_id) ? ogs_strdup(nf_set_id->valuestring) : NULL, + nf_service_set_id && !cJSON_IsNull(nf_service_set_id) ? ogs_strdup(nf_service_set_id->valuestring) : NULL, smf_serving_area ? smf_serving_areaList : NULL, tai_list ? tai_listList : NULL ); return subscription_data_subscr_cond_local_var; end: + if (guami_listList) { + OpenAPI_list_for_each(guami_listList, node) { + OpenAPI_guami_free(node->data); + } + OpenAPI_list_free(guami_listList); + guami_listList = NULL; + } + if (snssai_listList) { + OpenAPI_list_for_each(snssai_listList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(snssai_listList); + snssai_listList = NULL; + } + if (nsi_listList) { + OpenAPI_list_for_each(nsi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(nsi_listList); + nsi_listList = NULL; + } + if (smf_serving_areaList) { + OpenAPI_list_for_each(smf_serving_areaList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(smf_serving_areaList); + smf_serving_areaList = NULL; + } + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/subscription_data_subscriptions.c b/lib/sbi/openapi/model/subscription_data_subscriptions.c index 3235e3a69..bd863217d 100644 --- a/lib/sbi/openapi/model/subscription_data_subscriptions.c +++ b/lib/sbi/openapi/model/subscription_data_subscriptions.c @@ -32,27 +32,53 @@ OpenAPI_subscription_data_subscriptions_t *OpenAPI_subscription_data_subscriptio void OpenAPI_subscription_data_subscriptions_free(OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions) { + OpenAPI_lnode_t *node = NULL; + if (NULL == subscription_data_subscriptions) { return; } - OpenAPI_lnode_t *node; - ogs_free(subscription_data_subscriptions->ue_id); - ogs_free(subscription_data_subscriptions->callback_reference); - ogs_free(subscription_data_subscriptions->original_callback_reference); - OpenAPI_list_for_each(subscription_data_subscriptions->monitored_resource_uris, node) { - ogs_free(node->data); + if (subscription_data_subscriptions->ue_id) { + ogs_free(subscription_data_subscriptions->ue_id); + subscription_data_subscriptions->ue_id = NULL; + } + if (subscription_data_subscriptions->callback_reference) { + ogs_free(subscription_data_subscriptions->callback_reference); + subscription_data_subscriptions->callback_reference = NULL; + } + if (subscription_data_subscriptions->original_callback_reference) { + ogs_free(subscription_data_subscriptions->original_callback_reference); + subscription_data_subscriptions->original_callback_reference = NULL; + } + if (subscription_data_subscriptions->monitored_resource_uris) { + OpenAPI_list_for_each(subscription_data_subscriptions->monitored_resource_uris, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subscription_data_subscriptions->monitored_resource_uris); + subscription_data_subscriptions->monitored_resource_uris = NULL; + } + if (subscription_data_subscriptions->expiry) { + ogs_free(subscription_data_subscriptions->expiry); + subscription_data_subscriptions->expiry = NULL; + } + if (subscription_data_subscriptions->sdm_subscription) { + OpenAPI_sdm_subscription_1_free(subscription_data_subscriptions->sdm_subscription); + subscription_data_subscriptions->sdm_subscription = NULL; + } + if (subscription_data_subscriptions->subscription_id) { + ogs_free(subscription_data_subscriptions->subscription_id); + subscription_data_subscriptions->subscription_id = NULL; + } + if (subscription_data_subscriptions->supported_features) { + ogs_free(subscription_data_subscriptions->supported_features); + subscription_data_subscriptions->supported_features = NULL; } - OpenAPI_list_free(subscription_data_subscriptions->monitored_resource_uris); - ogs_free(subscription_data_subscriptions->expiry); - OpenAPI_sdm_subscription_1_free(subscription_data_subscriptions->sdm_subscription); - ogs_free(subscription_data_subscriptions->subscription_id); - ogs_free(subscription_data_subscriptions->supported_features); ogs_free(subscription_data_subscriptions); } cJSON *OpenAPI_subscription_data_subscriptions_convertToJSON(OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (subscription_data_subscriptions == NULL) { ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [SubscriptionDataSubscriptions]"); @@ -67,6 +93,10 @@ cJSON *OpenAPI_subscription_data_subscriptions_convertToJSON(OpenAPI_subscriptio } } + if (!subscription_data_subscriptions->callback_reference) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [callback_reference]"); + return NULL; + } if (cJSON_AddStringToObject(item, "callbackReference", subscription_data_subscriptions->callback_reference) == NULL) { ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [callback_reference]"); goto end; @@ -79,19 +109,21 @@ cJSON *OpenAPI_subscription_data_subscriptions_convertToJSON(OpenAPI_subscriptio } } - cJSON *monitored_resource_uris = cJSON_AddArrayToObject(item, "monitoredResourceUris"); - if (monitored_resource_uris == NULL) { + if (!subscription_data_subscriptions->monitored_resource_uris) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [monitored_resource_uris]"); + return NULL; + } + cJSON *monitored_resource_urisList = cJSON_AddArrayToObject(item, "monitoredResourceUris"); + if (monitored_resource_urisList == NULL) { ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [monitored_resource_uris]"); goto end; } - - OpenAPI_lnode_t *monitored_resource_uris_node; - OpenAPI_list_for_each(subscription_data_subscriptions->monitored_resource_uris, monitored_resource_uris_node) { - if (cJSON_AddStringToObject(monitored_resource_uris, "", (char*)monitored_resource_uris_node->data) == NULL) { - ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [monitored_resource_uris]"); - goto end; + OpenAPI_list_for_each(subscription_data_subscriptions->monitored_resource_uris, node) { + if (cJSON_AddStringToObject(monitored_resource_urisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_subscription_data_subscriptions_convertToJSON() failed [monitored_resource_uris]"); + goto end; + } } - } if (subscription_data_subscriptions->expiry) { if (cJSON_AddStringToObject(item, "expiry", subscription_data_subscriptions->expiry) == NULL) { @@ -134,104 +166,119 @@ end: OpenAPI_subscription_data_subscriptions_t *OpenAPI_subscription_data_subscriptions_parseFromJSON(cJSON *subscription_data_subscriptionsJSON) { OpenAPI_subscription_data_subscriptions_t *subscription_data_subscriptions_local_var = NULL; - cJSON *ue_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "ueId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ue_id = NULL; + cJSON *callback_reference = NULL; + cJSON *original_callback_reference = NULL; + cJSON *monitored_resource_uris = NULL; + OpenAPI_list_t *monitored_resource_urisList = NULL; + cJSON *expiry = NULL; + cJSON *sdm_subscription = NULL; + OpenAPI_sdm_subscription_1_t *sdm_subscription_local_nonprim = NULL; + cJSON *subscription_id = NULL; + cJSON *supported_features = NULL; + ue_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "ueId"); if (ue_id) { - if (!cJSON_IsString(ue_id)) { + if (!cJSON_IsString(ue_id) && !cJSON_IsNull(ue_id)) { ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [ue_id]"); goto end; } } - cJSON *callback_reference = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "callbackReference"); + callback_reference = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "callbackReference"); if (!callback_reference) { ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [callback_reference]"); goto end; } - if (!cJSON_IsString(callback_reference)) { ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [callback_reference]"); goto end; } - cJSON *original_callback_reference = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "originalCallbackReference"); - + original_callback_reference = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "originalCallbackReference"); if (original_callback_reference) { - if (!cJSON_IsString(original_callback_reference)) { + if (!cJSON_IsString(original_callback_reference) && !cJSON_IsNull(original_callback_reference)) { ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [original_callback_reference]"); goto end; } } - cJSON *monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "monitoredResourceUris"); + monitored_resource_uris = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "monitoredResourceUris"); if (!monitored_resource_uris) { ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [monitored_resource_uris]"); goto end; } + cJSON *monitored_resource_uris_local = NULL; + if (!cJSON_IsArray(monitored_resource_uris)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } - OpenAPI_list_t *monitored_resource_urisList; - cJSON *monitored_resource_uris_local; - if (!cJSON_IsArray(monitored_resource_uris)) { - ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - monitored_resource_urisList = OpenAPI_list_create(); + monitored_resource_urisList = OpenAPI_list_create(); - cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { - if (!cJSON_IsString(monitored_resource_uris_local)) { - ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [monitored_resource_uris]"); - goto end; - } - OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); - } - - cJSON *expiry = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "expiry"); + cJSON_ArrayForEach(monitored_resource_uris_local, monitored_resource_uris) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(monitored_resource_uris_local)) { + ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [monitored_resource_uris]"); + goto end; + } + OpenAPI_list_add(monitored_resource_urisList, ogs_strdup(monitored_resource_uris_local->valuestring)); + } + expiry = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "expiry"); if (expiry) { - if (!cJSON_IsString(expiry)) { + if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) { ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [expiry]"); goto end; } } - cJSON *sdm_subscription = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "sdmSubscription"); - - OpenAPI_sdm_subscription_1_t *sdm_subscription_local_nonprim = NULL; + sdm_subscription = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "sdmSubscription"); if (sdm_subscription) { sdm_subscription_local_nonprim = OpenAPI_sdm_subscription_1_parseFromJSON(sdm_subscription); } - cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "subscriptionId"); - + subscription_id = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "subscriptionId"); if (subscription_id) { - if (!cJSON_IsString(subscription_id)) { + if (!cJSON_IsString(subscription_id) && !cJSON_IsNull(subscription_id)) { ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [subscription_id]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "supported-features"); - + supported_features = cJSON_GetObjectItemCaseSensitive(subscription_data_subscriptionsJSON, "supported-features"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_subscription_data_subscriptions_parseFromJSON() failed [supported_features]"); goto end; } } subscription_data_subscriptions_local_var = OpenAPI_subscription_data_subscriptions_create ( - ue_id ? ogs_strdup(ue_id->valuestring) : NULL, + ue_id && !cJSON_IsNull(ue_id) ? ogs_strdup(ue_id->valuestring) : NULL, ogs_strdup(callback_reference->valuestring), - original_callback_reference ? ogs_strdup(original_callback_reference->valuestring) : NULL, + original_callback_reference && !cJSON_IsNull(original_callback_reference) ? ogs_strdup(original_callback_reference->valuestring) : NULL, monitored_resource_urisList, - expiry ? ogs_strdup(expiry->valuestring) : NULL, + expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL, sdm_subscription ? sdm_subscription_local_nonprim : NULL, - subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + subscription_id && !cJSON_IsNull(subscription_id) ? ogs_strdup(subscription_id->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return subscription_data_subscriptions_local_var; end: + if (monitored_resource_urisList) { + OpenAPI_list_for_each(monitored_resource_urisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(monitored_resource_urisList); + monitored_resource_urisList = NULL; + } + if (sdm_subscription_local_nonprim) { + OpenAPI_sdm_subscription_1_free(sdm_subscription_local_nonprim); + sdm_subscription_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/suggested_packet_num_dl.c b/lib/sbi/openapi/model/suggested_packet_num_dl.c index 7dfe46c53..62ad98fcd 100644 --- a/lib/sbi/openapi/model/suggested_packet_num_dl.c +++ b/lib/sbi/openapi/model/suggested_packet_num_dl.c @@ -20,17 +20,22 @@ OpenAPI_suggested_packet_num_dl_t *OpenAPI_suggested_packet_num_dl_create( void OpenAPI_suggested_packet_num_dl_free(OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl) { + OpenAPI_lnode_t *node = NULL; + if (NULL == suggested_packet_num_dl) { return; } - OpenAPI_lnode_t *node; - ogs_free(suggested_packet_num_dl->validity_time); + if (suggested_packet_num_dl->validity_time) { + ogs_free(suggested_packet_num_dl->validity_time); + suggested_packet_num_dl->validity_time = NULL; + } ogs_free(suggested_packet_num_dl); } cJSON *OpenAPI_suggested_packet_num_dl_convertToJSON(OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (suggested_packet_num_dl == NULL) { ogs_error("OpenAPI_suggested_packet_num_dl_convertToJSON() failed [SuggestedPacketNumDl]"); @@ -57,21 +62,22 @@ end: OpenAPI_suggested_packet_num_dl_t *OpenAPI_suggested_packet_num_dl_parseFromJSON(cJSON *suggested_packet_num_dlJSON) { OpenAPI_suggested_packet_num_dl_t *suggested_packet_num_dl_local_var = NULL; - cJSON *suggested_packet_num_dl = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dlJSON, "suggestedPacketNumDl"); + OpenAPI_lnode_t *node = NULL; + cJSON *suggested_packet_num_dl = NULL; + cJSON *validity_time = NULL; + suggested_packet_num_dl = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dlJSON, "suggestedPacketNumDl"); if (!suggested_packet_num_dl) { ogs_error("OpenAPI_suggested_packet_num_dl_parseFromJSON() failed [suggested_packet_num_dl]"); goto end; } - if (!cJSON_IsNumber(suggested_packet_num_dl)) { ogs_error("OpenAPI_suggested_packet_num_dl_parseFromJSON() failed [suggested_packet_num_dl]"); goto end; } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dlJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dlJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_suggested_packet_num_dl_parseFromJSON() failed [validity_time]"); goto end; } @@ -80,7 +86,7 @@ OpenAPI_suggested_packet_num_dl_t *OpenAPI_suggested_packet_num_dl_parseFromJSON suggested_packet_num_dl_local_var = OpenAPI_suggested_packet_num_dl_create ( suggested_packet_num_dl->valuedouble, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL ); return suggested_packet_num_dl_local_var; diff --git a/lib/sbi/openapi/model/suggested_packet_num_dl_1.c b/lib/sbi/openapi/model/suggested_packet_num_dl_1.c index 617d46422..53acdf2ba 100644 --- a/lib/sbi/openapi/model/suggested_packet_num_dl_1.c +++ b/lib/sbi/openapi/model/suggested_packet_num_dl_1.c @@ -20,17 +20,22 @@ OpenAPI_suggested_packet_num_dl_1_t *OpenAPI_suggested_packet_num_dl_1_create( void OpenAPI_suggested_packet_num_dl_1_free(OpenAPI_suggested_packet_num_dl_1_t *suggested_packet_num_dl_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == suggested_packet_num_dl_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(suggested_packet_num_dl_1->validity_time); + if (suggested_packet_num_dl_1->validity_time) { + ogs_free(suggested_packet_num_dl_1->validity_time); + suggested_packet_num_dl_1->validity_time = NULL; + } ogs_free(suggested_packet_num_dl_1); } cJSON *OpenAPI_suggested_packet_num_dl_1_convertToJSON(OpenAPI_suggested_packet_num_dl_1_t *suggested_packet_num_dl_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (suggested_packet_num_dl_1 == NULL) { ogs_error("OpenAPI_suggested_packet_num_dl_1_convertToJSON() failed [SuggestedPacketNumDl_1]"); @@ -57,21 +62,22 @@ end: OpenAPI_suggested_packet_num_dl_1_t *OpenAPI_suggested_packet_num_dl_1_parseFromJSON(cJSON *suggested_packet_num_dl_1JSON) { OpenAPI_suggested_packet_num_dl_1_t *suggested_packet_num_dl_1_local_var = NULL; - cJSON *suggested_packet_num_dl = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dl_1JSON, "suggestedPacketNumDl"); + OpenAPI_lnode_t *node = NULL; + cJSON *suggested_packet_num_dl = NULL; + cJSON *validity_time = NULL; + suggested_packet_num_dl = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dl_1JSON, "suggestedPacketNumDl"); if (!suggested_packet_num_dl) { ogs_error("OpenAPI_suggested_packet_num_dl_1_parseFromJSON() failed [suggested_packet_num_dl]"); goto end; } - if (!cJSON_IsNumber(suggested_packet_num_dl)) { ogs_error("OpenAPI_suggested_packet_num_dl_1_parseFromJSON() failed [suggested_packet_num_dl]"); goto end; } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dl_1JSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(suggested_packet_num_dl_1JSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_suggested_packet_num_dl_1_parseFromJSON() failed [validity_time]"); goto end; } @@ -80,7 +86,7 @@ OpenAPI_suggested_packet_num_dl_1_t *OpenAPI_suggested_packet_num_dl_1_parseFrom suggested_packet_num_dl_1_local_var = OpenAPI_suggested_packet_num_dl_1_create ( suggested_packet_num_dl->valuedouble, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL ); return suggested_packet_num_dl_1_local_var; diff --git a/lib/sbi/openapi/model/supi_range.c b/lib/sbi/openapi/model/supi_range.c index 3ba1100f2..884a15e8a 100644 --- a/lib/sbi/openapi/model/supi_range.c +++ b/lib/sbi/openapi/model/supi_range.c @@ -22,19 +22,30 @@ OpenAPI_supi_range_t *OpenAPI_supi_range_create( void OpenAPI_supi_range_free(OpenAPI_supi_range_t *supi_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == supi_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(supi_range->start); - ogs_free(supi_range->end); - ogs_free(supi_range->pattern); + if (supi_range->start) { + ogs_free(supi_range->start); + supi_range->start = NULL; + } + if (supi_range->end) { + ogs_free(supi_range->end); + supi_range->end = NULL; + } + if (supi_range->pattern) { + ogs_free(supi_range->pattern); + supi_range->pattern = NULL; + } ogs_free(supi_range); } cJSON *OpenAPI_supi_range_convertToJSON(OpenAPI_supi_range_t *supi_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (supi_range == NULL) { ogs_error("OpenAPI_supi_range_convertToJSON() failed [SupiRange]"); @@ -70,37 +81,38 @@ end: OpenAPI_supi_range_t *OpenAPI_supi_range_parseFromJSON(cJSON *supi_rangeJSON) { OpenAPI_supi_range_t *supi_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(supi_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + cJSON *pattern = NULL; + start = cJSON_GetObjectItemCaseSensitive(supi_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_supi_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(supi_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(supi_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_supi_range_parseFromJSON() failed [end]"); goto end; } } - cJSON *pattern = cJSON_GetObjectItemCaseSensitive(supi_rangeJSON, "pattern"); - + pattern = cJSON_GetObjectItemCaseSensitive(supi_rangeJSON, "pattern"); if (pattern) { - if (!cJSON_IsString(pattern)) { + if (!cJSON_IsString(pattern) && !cJSON_IsNull(pattern)) { ogs_error("OpenAPI_supi_range_parseFromJSON() failed [pattern]"); goto end; } } supi_range_local_var = OpenAPI_supi_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL, - pattern ? ogs_strdup(pattern->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL, + pattern && !cJSON_IsNull(pattern) ? ogs_strdup(pattern->valuestring) : NULL ); return supi_range_local_var; diff --git a/lib/sbi/openapi/model/supported_gad_shapes.c b/lib/sbi/openapi/model/supported_gad_shapes.c index 02c705f6b..d741fc227 100644 --- a/lib/sbi/openapi/model/supported_gad_shapes.c +++ b/lib/sbi/openapi/model/supported_gad_shapes.c @@ -16,16 +16,18 @@ OpenAPI_supported_gad_shapes_t *OpenAPI_supported_gad_shapes_create( void OpenAPI_supported_gad_shapes_free(OpenAPI_supported_gad_shapes_t *supported_gad_shapes) { + OpenAPI_lnode_t *node = NULL; + if (NULL == supported_gad_shapes) { return; } - OpenAPI_lnode_t *node; ogs_free(supported_gad_shapes); } cJSON *OpenAPI_supported_gad_shapes_convertToJSON(OpenAPI_supported_gad_shapes_t *supported_gad_shapes) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (supported_gad_shapes == NULL) { ogs_error("OpenAPI_supported_gad_shapes_convertToJSON() failed [SupportedGADShapes]"); @@ -40,6 +42,7 @@ end: OpenAPI_supported_gad_shapes_t *OpenAPI_supported_gad_shapes_parseFromJSON(cJSON *supported_gad_shapesJSON) { OpenAPI_supported_gad_shapes_t *supported_gad_shapes_local_var = NULL; + OpenAPI_lnode_t *node = NULL; supported_gad_shapes_local_var = OpenAPI_supported_gad_shapes_create ( ); diff --git a/lib/sbi/openapi/model/tac_info.c b/lib/sbi/openapi/model/tac_info.c index e243e5779..d447d3232 100644 --- a/lib/sbi/openapi/model/tac_info.c +++ b/lib/sbi/openapi/model/tac_info.c @@ -18,20 +18,25 @@ OpenAPI_tac_info_t *OpenAPI_tac_info_create( void OpenAPI_tac_info_free(OpenAPI_tac_info_t *tac_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tac_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(tac_info->tac_list, node) { - ogs_free(node->data); + if (tac_info->tac_list) { + OpenAPI_list_for_each(tac_info->tac_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tac_info->tac_list); + tac_info->tac_list = NULL; } - OpenAPI_list_free(tac_info->tac_list); ogs_free(tac_info); } cJSON *OpenAPI_tac_info_convertToJSON(OpenAPI_tac_info_t *tac_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tac_info == NULL) { ogs_error("OpenAPI_tac_info_convertToJSON() failed [TacInfo]"); @@ -39,19 +44,21 @@ cJSON *OpenAPI_tac_info_convertToJSON(OpenAPI_tac_info_t *tac_info) } item = cJSON_CreateObject(); - cJSON *tac_list = cJSON_AddArrayToObject(item, "tacList"); - if (tac_list == NULL) { + if (!tac_info->tac_list) { + ogs_error("OpenAPI_tac_info_convertToJSON() failed [tac_list]"); + return NULL; + } + cJSON *tac_listList = cJSON_AddArrayToObject(item, "tacList"); + if (tac_listList == NULL) { ogs_error("OpenAPI_tac_info_convertToJSON() failed [tac_list]"); goto end; } - - OpenAPI_lnode_t *tac_list_node; - OpenAPI_list_for_each(tac_info->tac_list, tac_list_node) { - if (cJSON_AddStringToObject(tac_list, "", (char*)tac_list_node->data) == NULL) { - ogs_error("OpenAPI_tac_info_convertToJSON() failed [tac_list]"); - goto end; + OpenAPI_list_for_each(tac_info->tac_list, node) { + if (cJSON_AddStringToObject(tac_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_tac_info_convertToJSON() failed [tac_list]"); + goto end; + } } - } end: return item; @@ -60,27 +67,31 @@ end: OpenAPI_tac_info_t *OpenAPI_tac_info_parseFromJSON(cJSON *tac_infoJSON) { OpenAPI_tac_info_t *tac_info_local_var = NULL; - cJSON *tac_list = cJSON_GetObjectItemCaseSensitive(tac_infoJSON, "tacList"); + OpenAPI_lnode_t *node = NULL; + cJSON *tac_list = NULL; + OpenAPI_list_t *tac_listList = NULL; + tac_list = cJSON_GetObjectItemCaseSensitive(tac_infoJSON, "tacList"); if (!tac_list) { ogs_error("OpenAPI_tac_info_parseFromJSON() failed [tac_list]"); goto end; } + cJSON *tac_list_local = NULL; + if (!cJSON_IsArray(tac_list)) { + ogs_error("OpenAPI_tac_info_parseFromJSON() failed [tac_list]"); + goto end; + } - OpenAPI_list_t *tac_listList; - cJSON *tac_list_local; - if (!cJSON_IsArray(tac_list)) { - ogs_error("OpenAPI_tac_info_parseFromJSON() failed [tac_list]"); - goto end; - } - tac_listList = OpenAPI_list_create(); + tac_listList = OpenAPI_list_create(); - cJSON_ArrayForEach(tac_list_local, tac_list) { - if (!cJSON_IsString(tac_list_local)) { - ogs_error("OpenAPI_tac_info_parseFromJSON() failed [tac_list]"); - goto end; - } - OpenAPI_list_add(tac_listList, ogs_strdup(tac_list_local->valuestring)); - } + cJSON_ArrayForEach(tac_list_local, tac_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(tac_list_local)) { + ogs_error("OpenAPI_tac_info_parseFromJSON() failed [tac_list]"); + goto end; + } + OpenAPI_list_add(tac_listList, ogs_strdup(tac_list_local->valuestring)); + } tac_info_local_var = OpenAPI_tac_info_create ( tac_listList @@ -88,6 +99,13 @@ OpenAPI_tac_info_t *OpenAPI_tac_info_parseFromJSON(cJSON *tac_infoJSON) return tac_info_local_var; end: + if (tac_listList) { + OpenAPI_list_for_each(tac_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tac_listList); + tac_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/tac_range.c b/lib/sbi/openapi/model/tac_range.c index 9a65d3940..404489483 100644 --- a/lib/sbi/openapi/model/tac_range.c +++ b/lib/sbi/openapi/model/tac_range.c @@ -22,19 +22,30 @@ OpenAPI_tac_range_t *OpenAPI_tac_range_create( void OpenAPI_tac_range_free(OpenAPI_tac_range_t *tac_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tac_range) { return; } - OpenAPI_lnode_t *node; - ogs_free(tac_range->start); - ogs_free(tac_range->end); - ogs_free(tac_range->pattern); + if (tac_range->start) { + ogs_free(tac_range->start); + tac_range->start = NULL; + } + if (tac_range->end) { + ogs_free(tac_range->end); + tac_range->end = NULL; + } + if (tac_range->pattern) { + ogs_free(tac_range->pattern); + tac_range->pattern = NULL; + } ogs_free(tac_range); } cJSON *OpenAPI_tac_range_convertToJSON(OpenAPI_tac_range_t *tac_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tac_range == NULL) { ogs_error("OpenAPI_tac_range_convertToJSON() failed [TacRange]"); @@ -70,37 +81,38 @@ end: OpenAPI_tac_range_t *OpenAPI_tac_range_parseFromJSON(cJSON *tac_rangeJSON) { OpenAPI_tac_range_t *tac_range_local_var = NULL; - cJSON *start = cJSON_GetObjectItemCaseSensitive(tac_rangeJSON, "start"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start = NULL; + cJSON *end = NULL; + cJSON *pattern = NULL; + start = cJSON_GetObjectItemCaseSensitive(tac_rangeJSON, "start"); if (start) { - if (!cJSON_IsString(start)) { + if (!cJSON_IsString(start) && !cJSON_IsNull(start)) { ogs_error("OpenAPI_tac_range_parseFromJSON() failed [start]"); goto end; } } - cJSON *end = cJSON_GetObjectItemCaseSensitive(tac_rangeJSON, "end"); - + end = cJSON_GetObjectItemCaseSensitive(tac_rangeJSON, "end"); if (end) { - if (!cJSON_IsString(end)) { + if (!cJSON_IsString(end) && !cJSON_IsNull(end)) { ogs_error("OpenAPI_tac_range_parseFromJSON() failed [end]"); goto end; } } - cJSON *pattern = cJSON_GetObjectItemCaseSensitive(tac_rangeJSON, "pattern"); - + pattern = cJSON_GetObjectItemCaseSensitive(tac_rangeJSON, "pattern"); if (pattern) { - if (!cJSON_IsString(pattern)) { + if (!cJSON_IsString(pattern) && !cJSON_IsNull(pattern)) { ogs_error("OpenAPI_tac_range_parseFromJSON() failed [pattern]"); goto end; } } tac_range_local_var = OpenAPI_tac_range_create ( - start ? ogs_strdup(start->valuestring) : NULL, - end ? ogs_strdup(end->valuestring) : NULL, - pattern ? ogs_strdup(pattern->valuestring) : NULL + start && !cJSON_IsNull(start) ? ogs_strdup(start->valuestring) : NULL, + end && !cJSON_IsNull(end) ? ogs_strdup(end->valuestring) : NULL, + pattern && !cJSON_IsNull(pattern) ? ogs_strdup(pattern->valuestring) : NULL ); return tac_range_local_var; diff --git a/lib/sbi/openapi/model/tai.c b/lib/sbi/openapi/model/tai.c index 38fb01cdd..008347af7 100644 --- a/lib/sbi/openapi/model/tai.c +++ b/lib/sbi/openapi/model/tai.c @@ -22,19 +22,30 @@ OpenAPI_tai_t *OpenAPI_tai_create( void OpenAPI_tai_free(OpenAPI_tai_t *tai) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tai) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(tai->plmn_id); - ogs_free(tai->tac); - ogs_free(tai->nid); + if (tai->plmn_id) { + OpenAPI_plmn_id_free(tai->plmn_id); + tai->plmn_id = NULL; + } + if (tai->tac) { + ogs_free(tai->tac); + tai->tac = NULL; + } + if (tai->nid) { + ogs_free(tai->nid); + tai->nid = NULL; + } ogs_free(tai); } cJSON *OpenAPI_tai_convertToJSON(OpenAPI_tai_t *tai) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tai == NULL) { ogs_error("OpenAPI_tai_convertToJSON() failed [Tai]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_tai_convertToJSON(OpenAPI_tai_t *tai) } item = cJSON_CreateObject(); + if (!tai->plmn_id) { + ogs_error("OpenAPI_tai_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(tai->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_tai_convertToJSON() failed [plmn_id]"); @@ -53,6 +68,10 @@ cJSON *OpenAPI_tai_convertToJSON(OpenAPI_tai_t *tai) goto end; } + if (!tai->tac) { + ogs_error("OpenAPI_tai_convertToJSON() failed [tac]"); + return NULL; + } if (cJSON_AddStringToObject(item, "tac", tai->tac) == NULL) { ogs_error("OpenAPI_tai_convertToJSON() failed [tac]"); goto end; @@ -72,30 +91,31 @@ end: OpenAPI_tai_t *OpenAPI_tai_parseFromJSON(cJSON *taiJSON) { OpenAPI_tai_t *tai_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(taiJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *tac = NULL; + cJSON *nid = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(taiJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_tai_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *tac = cJSON_GetObjectItemCaseSensitive(taiJSON, "tac"); + tac = cJSON_GetObjectItemCaseSensitive(taiJSON, "tac"); if (!tac) { ogs_error("OpenAPI_tai_parseFromJSON() failed [tac]"); goto end; } - if (!cJSON_IsString(tac)) { ogs_error("OpenAPI_tai_parseFromJSON() failed [tac]"); goto end; } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(taiJSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(taiJSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_tai_parseFromJSON() failed [nid]"); goto end; } @@ -104,11 +124,15 @@ OpenAPI_tai_t *OpenAPI_tai_parseFromJSON(cJSON *taiJSON) tai_local_var = OpenAPI_tai_create ( plmn_id_local_nonprim, ogs_strdup(tac->valuestring), - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return tai_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/tai_1.c b/lib/sbi/openapi/model/tai_1.c index fc2ee44da..b1d403bb8 100644 --- a/lib/sbi/openapi/model/tai_1.c +++ b/lib/sbi/openapi/model/tai_1.c @@ -22,19 +22,30 @@ OpenAPI_tai_1_t *OpenAPI_tai_1_create( void OpenAPI_tai_1_free(OpenAPI_tai_1_t *tai_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tai_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_1_free(tai_1->plmn_id); - ogs_free(tai_1->tac); - ogs_free(tai_1->nid); + if (tai_1->plmn_id) { + OpenAPI_plmn_id_1_free(tai_1->plmn_id); + tai_1->plmn_id = NULL; + } + if (tai_1->tac) { + ogs_free(tai_1->tac); + tai_1->tac = NULL; + } + if (tai_1->nid) { + ogs_free(tai_1->nid); + tai_1->nid = NULL; + } ogs_free(tai_1); } cJSON *OpenAPI_tai_1_convertToJSON(OpenAPI_tai_1_t *tai_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tai_1 == NULL) { ogs_error("OpenAPI_tai_1_convertToJSON() failed [Tai_1]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_tai_1_convertToJSON(OpenAPI_tai_1_t *tai_1) } item = cJSON_CreateObject(); + if (!tai_1->plmn_id) { + ogs_error("OpenAPI_tai_1_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_1_convertToJSON(tai_1->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_tai_1_convertToJSON() failed [plmn_id]"); @@ -53,6 +68,10 @@ cJSON *OpenAPI_tai_1_convertToJSON(OpenAPI_tai_1_t *tai_1) goto end; } + if (!tai_1->tac) { + ogs_error("OpenAPI_tai_1_convertToJSON() failed [tac]"); + return NULL; + } if (cJSON_AddStringToObject(item, "tac", tai_1->tac) == NULL) { ogs_error("OpenAPI_tai_1_convertToJSON() failed [tac]"); goto end; @@ -72,30 +91,31 @@ end: OpenAPI_tai_1_t *OpenAPI_tai_1_parseFromJSON(cJSON *tai_1JSON) { OpenAPI_tai_1_t *tai_1_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(tai_1JSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; + cJSON *tac = NULL; + cJSON *nid = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(tai_1JSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_tai_1_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_1_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(plmn_id); - cJSON *tac = cJSON_GetObjectItemCaseSensitive(tai_1JSON, "tac"); + tac = cJSON_GetObjectItemCaseSensitive(tai_1JSON, "tac"); if (!tac) { ogs_error("OpenAPI_tai_1_parseFromJSON() failed [tac]"); goto end; } - if (!cJSON_IsString(tac)) { ogs_error("OpenAPI_tai_1_parseFromJSON() failed [tac]"); goto end; } - cJSON *nid = cJSON_GetObjectItemCaseSensitive(tai_1JSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(tai_1JSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_tai_1_parseFromJSON() failed [nid]"); goto end; } @@ -104,11 +124,15 @@ OpenAPI_tai_1_t *OpenAPI_tai_1_parseFromJSON(cJSON *tai_1JSON) tai_1_local_var = OpenAPI_tai_1_create ( plmn_id_local_nonprim, ogs_strdup(tac->valuestring), - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return tai_1_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_1_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/tai_range.c b/lib/sbi/openapi/model/tai_range.c index 4482380c7..7a465d47a 100644 --- a/lib/sbi/openapi/model/tai_range.c +++ b/lib/sbi/openapi/model/tai_range.c @@ -22,22 +22,33 @@ OpenAPI_tai_range_t *OpenAPI_tai_range_create( void OpenAPI_tai_range_free(OpenAPI_tai_range_t *tai_range) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tai_range) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(tai_range->plmn_id); - OpenAPI_list_for_each(tai_range->tac_range_list, node) { - OpenAPI_tac_range_free(node->data); + if (tai_range->plmn_id) { + OpenAPI_plmn_id_free(tai_range->plmn_id); + tai_range->plmn_id = NULL; + } + if (tai_range->tac_range_list) { + OpenAPI_list_for_each(tai_range->tac_range_list, node) { + OpenAPI_tac_range_free(node->data); + } + OpenAPI_list_free(tai_range->tac_range_list); + tai_range->tac_range_list = NULL; + } + if (tai_range->nid) { + ogs_free(tai_range->nid); + tai_range->nid = NULL; } - OpenAPI_list_free(tai_range->tac_range_list); - ogs_free(tai_range->nid); ogs_free(tai_range); } cJSON *OpenAPI_tai_range_convertToJSON(OpenAPI_tai_range_t *tai_range) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tai_range == NULL) { ogs_error("OpenAPI_tai_range_convertToJSON() failed [TaiRange]"); @@ -45,6 +56,10 @@ cJSON *OpenAPI_tai_range_convertToJSON(OpenAPI_tai_range_t *tai_range) } item = cJSON_CreateObject(); + if (!tai_range->plmn_id) { + ogs_error("OpenAPI_tai_range_convertToJSON() failed [plmn_id]"); + return NULL; + } cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(tai_range->plmn_id); if (plmn_id_local_JSON == NULL) { ogs_error("OpenAPI_tai_range_convertToJSON() failed [plmn_id]"); @@ -56,22 +71,22 @@ cJSON *OpenAPI_tai_range_convertToJSON(OpenAPI_tai_range_t *tai_range) goto end; } + if (!tai_range->tac_range_list) { + ogs_error("OpenAPI_tai_range_convertToJSON() failed [tac_range_list]"); + return NULL; + } cJSON *tac_range_listList = cJSON_AddArrayToObject(item, "tacRangeList"); if (tac_range_listList == NULL) { ogs_error("OpenAPI_tai_range_convertToJSON() failed [tac_range_list]"); goto end; } - - OpenAPI_lnode_t *tac_range_list_node; - if (tai_range->tac_range_list) { - OpenAPI_list_for_each(tai_range->tac_range_list, tac_range_list_node) { - cJSON *itemLocal = OpenAPI_tac_range_convertToJSON(tac_range_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_tai_range_convertToJSON() failed [tac_range_list]"); - goto end; - } - cJSON_AddItemToArray(tac_range_listList, itemLocal); + OpenAPI_list_for_each(tai_range->tac_range_list, node) { + cJSON *itemLocal = OpenAPI_tac_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_tai_range_convertToJSON() failed [tac_range_list]"); + goto end; } + cJSON_AddItemToArray(tac_range_listList, itemLocal); } if (tai_range->nid) { @@ -88,50 +103,49 @@ end: OpenAPI_tai_range_t *OpenAPI_tai_range_parseFromJSON(cJSON *tai_rangeJSON) { OpenAPI_tai_range_t *tai_range_local_var = NULL; - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(tai_rangeJSON, "plmnId"); + OpenAPI_lnode_t *node = NULL; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *tac_range_list = NULL; + OpenAPI_list_t *tac_range_listList = NULL; + cJSON *nid = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(tai_rangeJSON, "plmnId"); if (!plmn_id) { ogs_error("OpenAPI_tai_range_parseFromJSON() failed [plmn_id]"); goto end; } - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); - cJSON *tac_range_list = cJSON_GetObjectItemCaseSensitive(tai_rangeJSON, "tacRangeList"); + tac_range_list = cJSON_GetObjectItemCaseSensitive(tai_rangeJSON, "tacRangeList"); if (!tac_range_list) { ogs_error("OpenAPI_tai_range_parseFromJSON() failed [tac_range_list]"); goto end; } - - OpenAPI_list_t *tac_range_listList; - cJSON *tac_range_list_local_nonprimitive; - if (!cJSON_IsArray(tac_range_list)){ - ogs_error("OpenAPI_tai_range_parseFromJSON() failed [tac_range_list]"); - goto end; - } - - tac_range_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tac_range_list_local_nonprimitive, tac_range_list ) { - if (!cJSON_IsObject(tac_range_list_local_nonprimitive)) { + cJSON *tac_range_list_local = NULL; + if (!cJSON_IsArray(tac_range_list)) { ogs_error("OpenAPI_tai_range_parseFromJSON() failed [tac_range_list]"); goto end; } - OpenAPI_tac_range_t *tac_range_listItem = OpenAPI_tac_range_parseFromJSON(tac_range_list_local_nonprimitive); - if (!tac_range_listItem) { - ogs_error("No tac_range_listItem"); - OpenAPI_list_free(tac_range_listList); - goto end; + tac_range_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tac_range_list_local, tac_range_list) { + if (!cJSON_IsObject(tac_range_list_local)) { + ogs_error("OpenAPI_tai_range_parseFromJSON() failed [tac_range_list]"); + goto end; + } + OpenAPI_tac_range_t *tac_range_listItem = OpenAPI_tac_range_parseFromJSON(tac_range_list_local); + if (!tac_range_listItem) { + ogs_error("No tac_range_listItem"); + OpenAPI_list_free(tac_range_listList); + goto end; + } + OpenAPI_list_add(tac_range_listList, tac_range_listItem); } - OpenAPI_list_add(tac_range_listList, tac_range_listItem); - } - - cJSON *nid = cJSON_GetObjectItemCaseSensitive(tai_rangeJSON, "nid"); - + nid = cJSON_GetObjectItemCaseSensitive(tai_rangeJSON, "nid"); if (nid) { - if (!cJSON_IsString(nid)) { + if (!cJSON_IsString(nid) && !cJSON_IsNull(nid)) { ogs_error("OpenAPI_tai_range_parseFromJSON() failed [nid]"); goto end; } @@ -140,11 +154,22 @@ OpenAPI_tai_range_t *OpenAPI_tai_range_parseFromJSON(cJSON *tai_rangeJSON) tai_range_local_var = OpenAPI_tai_range_create ( plmn_id_local_nonprim, tac_range_listList, - nid ? ogs_strdup(nid->valuestring) : NULL + nid && !cJSON_IsNull(nid) ? ogs_strdup(nid->valuestring) : NULL ); return tai_range_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (tac_range_listList) { + OpenAPI_list_for_each(tac_range_listList, node) { + OpenAPI_tac_range_free(node->data); + } + OpenAPI_list_free(tac_range_listList); + tac_range_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/temporal_validity.c b/lib/sbi/openapi/model/temporal_validity.c index fc5ad230a..7d13b99f8 100644 --- a/lib/sbi/openapi/model/temporal_validity.c +++ b/lib/sbi/openapi/model/temporal_validity.c @@ -20,18 +20,26 @@ OpenAPI_temporal_validity_t *OpenAPI_temporal_validity_create( void OpenAPI_temporal_validity_free(OpenAPI_temporal_validity_t *temporal_validity) { + OpenAPI_lnode_t *node = NULL; + if (NULL == temporal_validity) { return; } - OpenAPI_lnode_t *node; - ogs_free(temporal_validity->start_time); - ogs_free(temporal_validity->stop_time); + if (temporal_validity->start_time) { + ogs_free(temporal_validity->start_time); + temporal_validity->start_time = NULL; + } + if (temporal_validity->stop_time) { + ogs_free(temporal_validity->stop_time); + temporal_validity->stop_time = NULL; + } ogs_free(temporal_validity); } cJSON *OpenAPI_temporal_validity_convertToJSON(OpenAPI_temporal_validity_t *temporal_validity) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (temporal_validity == NULL) { ogs_error("OpenAPI_temporal_validity_convertToJSON() failed [TemporalValidity]"); @@ -60,27 +68,28 @@ end: OpenAPI_temporal_validity_t *OpenAPI_temporal_validity_parseFromJSON(cJSON *temporal_validityJSON) { OpenAPI_temporal_validity_t *temporal_validity_local_var = NULL; - cJSON *start_time = cJSON_GetObjectItemCaseSensitive(temporal_validityJSON, "startTime"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start_time = NULL; + cJSON *stop_time = NULL; + start_time = cJSON_GetObjectItemCaseSensitive(temporal_validityJSON, "startTime"); if (start_time) { - if (!cJSON_IsString(start_time)) { + if (!cJSON_IsString(start_time) && !cJSON_IsNull(start_time)) { ogs_error("OpenAPI_temporal_validity_parseFromJSON() failed [start_time]"); goto end; } } - cJSON *stop_time = cJSON_GetObjectItemCaseSensitive(temporal_validityJSON, "stopTime"); - + stop_time = cJSON_GetObjectItemCaseSensitive(temporal_validityJSON, "stopTime"); if (stop_time) { - if (!cJSON_IsString(stop_time)) { + if (!cJSON_IsString(stop_time) && !cJSON_IsNull(stop_time)) { ogs_error("OpenAPI_temporal_validity_parseFromJSON() failed [stop_time]"); goto end; } } temporal_validity_local_var = OpenAPI_temporal_validity_create ( - start_time ? ogs_strdup(start_time->valuestring) : NULL, - stop_time ? ogs_strdup(stop_time->valuestring) : NULL + start_time && !cJSON_IsNull(start_time) ? ogs_strdup(start_time->valuestring) : NULL, + stop_time && !cJSON_IsNull(stop_time) ? ogs_strdup(stop_time->valuestring) : NULL ); return temporal_validity_local_var; diff --git a/lib/sbi/openapi/model/termination_info.c b/lib/sbi/openapi/model/termination_info.c index beeb19b95..2e535e57d 100644 --- a/lib/sbi/openapi/model/termination_info.c +++ b/lib/sbi/openapi/model/termination_info.c @@ -20,17 +20,22 @@ OpenAPI_termination_info_t *OpenAPI_termination_info_create( void OpenAPI_termination_info_free(OpenAPI_termination_info_t *termination_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == termination_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(termination_info->res_uri); + if (termination_info->res_uri) { + ogs_free(termination_info->res_uri); + termination_info->res_uri = NULL; + } ogs_free(termination_info); } cJSON *OpenAPI_termination_info_convertToJSON(OpenAPI_termination_info_t *termination_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (termination_info == NULL) { ogs_error("OpenAPI_termination_info_convertToJSON() failed [TerminationInfo]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_termination_info_convertToJSON(OpenAPI_termination_info_t *termin } item = cJSON_CreateObject(); + if (termination_info->term_cause == OpenAPI_termination_cause_NULL) { + ogs_error("OpenAPI_termination_info_convertToJSON() failed [term_cause]"); + return NULL; + } if (cJSON_AddStringToObject(item, "termCause", OpenAPI_termination_cause_ToString(termination_info->term_cause)) == NULL) { ogs_error("OpenAPI_termination_info_convertToJSON() failed [term_cause]"); goto end; } + if (!termination_info->res_uri) { + ogs_error("OpenAPI_termination_info_convertToJSON() failed [res_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resUri", termination_info->res_uri) == NULL) { ogs_error("OpenAPI_termination_info_convertToJSON() failed [res_uri]"); goto end; @@ -55,25 +68,26 @@ end: OpenAPI_termination_info_t *OpenAPI_termination_info_parseFromJSON(cJSON *termination_infoJSON) { OpenAPI_termination_info_t *termination_info_local_var = NULL; - cJSON *term_cause = cJSON_GetObjectItemCaseSensitive(termination_infoJSON, "termCause"); + OpenAPI_lnode_t *node = NULL; + cJSON *term_cause = NULL; + OpenAPI_termination_cause_e term_causeVariable = 0; + cJSON *res_uri = NULL; + term_cause = cJSON_GetObjectItemCaseSensitive(termination_infoJSON, "termCause"); if (!term_cause) { ogs_error("OpenAPI_termination_info_parseFromJSON() failed [term_cause]"); goto end; } - - OpenAPI_termination_cause_e term_causeVariable; if (!cJSON_IsString(term_cause)) { ogs_error("OpenAPI_termination_info_parseFromJSON() failed [term_cause]"); goto end; } term_causeVariable = OpenAPI_termination_cause_FromString(term_cause->valuestring); - cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(termination_infoJSON, "resUri"); + res_uri = cJSON_GetObjectItemCaseSensitive(termination_infoJSON, "resUri"); if (!res_uri) { ogs_error("OpenAPI_termination_info_parseFromJSON() failed [res_uri]"); goto end; } - if (!cJSON_IsString(res_uri)) { ogs_error("OpenAPI_termination_info_parseFromJSON() failed [res_uri]"); goto end; diff --git a/lib/sbi/openapi/model/termination_notification.c b/lib/sbi/openapi/model/termination_notification.c index 54bbd02dd..037aaad7c 100644 --- a/lib/sbi/openapi/model/termination_notification.c +++ b/lib/sbi/openapi/model/termination_notification.c @@ -20,17 +20,22 @@ OpenAPI_termination_notification_t *OpenAPI_termination_notification_create( void OpenAPI_termination_notification_free(OpenAPI_termination_notification_t *termination_notification) { + OpenAPI_lnode_t *node = NULL; + if (NULL == termination_notification) { return; } - OpenAPI_lnode_t *node; - ogs_free(termination_notification->resource_uri); + if (termination_notification->resource_uri) { + ogs_free(termination_notification->resource_uri); + termination_notification->resource_uri = NULL; + } ogs_free(termination_notification); } cJSON *OpenAPI_termination_notification_convertToJSON(OpenAPI_termination_notification_t *termination_notification) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (termination_notification == NULL) { ogs_error("OpenAPI_termination_notification_convertToJSON() failed [TerminationNotification]"); @@ -38,11 +43,19 @@ cJSON *OpenAPI_termination_notification_convertToJSON(OpenAPI_termination_notifi } item = cJSON_CreateObject(); + if (!termination_notification->resource_uri) { + ogs_error("OpenAPI_termination_notification_convertToJSON() failed [resource_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resourceUri", termination_notification->resource_uri) == NULL) { ogs_error("OpenAPI_termination_notification_convertToJSON() failed [resource_uri]"); goto end; } + if (termination_notification->cause == OpenAPI_sm_policy_association_release_cause_NULL) { + ogs_error("OpenAPI_termination_notification_convertToJSON() failed [cause]"); + return NULL; + } if (cJSON_AddStringToObject(item, "cause", OpenAPI_sm_policy_association_release_cause_ToString(termination_notification->cause)) == NULL) { ogs_error("OpenAPI_termination_notification_convertToJSON() failed [cause]"); goto end; @@ -55,24 +68,25 @@ end: OpenAPI_termination_notification_t *OpenAPI_termination_notification_parseFromJSON(cJSON *termination_notificationJSON) { OpenAPI_termination_notification_t *termination_notification_local_var = NULL; - cJSON *resource_uri = cJSON_GetObjectItemCaseSensitive(termination_notificationJSON, "resourceUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *resource_uri = NULL; + cJSON *cause = NULL; + OpenAPI_sm_policy_association_release_cause_e causeVariable = 0; + resource_uri = cJSON_GetObjectItemCaseSensitive(termination_notificationJSON, "resourceUri"); if (!resource_uri) { ogs_error("OpenAPI_termination_notification_parseFromJSON() failed [resource_uri]"); goto end; } - if (!cJSON_IsString(resource_uri)) { ogs_error("OpenAPI_termination_notification_parseFromJSON() failed [resource_uri]"); goto end; } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(termination_notificationJSON, "cause"); + cause = cJSON_GetObjectItemCaseSensitive(termination_notificationJSON, "cause"); if (!cause) { ogs_error("OpenAPI_termination_notification_parseFromJSON() failed [cause]"); goto end; } - - OpenAPI_sm_policy_association_release_cause_e causeVariable; if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_termination_notification_parseFromJSON() failed [cause]"); goto end; diff --git a/lib/sbi/openapi/model/time_period.c b/lib/sbi/openapi/model/time_period.c index 0afc9a76f..8a39e60ae 100644 --- a/lib/sbi/openapi/model/time_period.c +++ b/lib/sbi/openapi/model/time_period.c @@ -22,17 +22,22 @@ OpenAPI_time_period_t *OpenAPI_time_period_create( void OpenAPI_time_period_free(OpenAPI_time_period_t *time_period) { + OpenAPI_lnode_t *node = NULL; + if (NULL == time_period) { return; } - OpenAPI_lnode_t *node; - OpenAPI_periodicity_free(time_period->period); + if (time_period->period) { + OpenAPI_periodicity_free(time_period->period); + time_period->period = NULL; + } ogs_free(time_period); } cJSON *OpenAPI_time_period_convertToJSON(OpenAPI_time_period_t *time_period) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (time_period == NULL) { ogs_error("OpenAPI_time_period_convertToJSON() failed [TimePeriod]"); @@ -40,6 +45,10 @@ cJSON *OpenAPI_time_period_convertToJSON(OpenAPI_time_period_t *time_period) } item = cJSON_CreateObject(); + if (!time_period->period) { + ogs_error("OpenAPI_time_period_convertToJSON() failed [period]"); + return NULL; + } cJSON *period_local_JSON = OpenAPI_periodicity_convertToJSON(time_period->period); if (period_local_JSON == NULL) { ogs_error("OpenAPI_time_period_convertToJSON() failed [period]"); @@ -65,17 +74,18 @@ end: OpenAPI_time_period_t *OpenAPI_time_period_parseFromJSON(cJSON *time_periodJSON) { OpenAPI_time_period_t *time_period_local_var = NULL; - cJSON *period = cJSON_GetObjectItemCaseSensitive(time_periodJSON, "period"); + OpenAPI_lnode_t *node = NULL; + cJSON *period = NULL; + OpenAPI_periodicity_t *period_local_nonprim = NULL; + cJSON *max_num_period = NULL; + period = cJSON_GetObjectItemCaseSensitive(time_periodJSON, "period"); if (!period) { ogs_error("OpenAPI_time_period_parseFromJSON() failed [period]"); goto end; } - - OpenAPI_periodicity_t *period_local_nonprim = NULL; period_local_nonprim = OpenAPI_periodicity_parseFromJSON(period); - cJSON *max_num_period = cJSON_GetObjectItemCaseSensitive(time_periodJSON, "maxNumPeriod"); - + max_num_period = cJSON_GetObjectItemCaseSensitive(time_periodJSON, "maxNumPeriod"); if (max_num_period) { if (!cJSON_IsNumber(max_num_period)) { ogs_error("OpenAPI_time_period_parseFromJSON() failed [max_num_period]"); @@ -91,6 +101,10 @@ OpenAPI_time_period_t *OpenAPI_time_period_parseFromJSON(cJSON *time_periodJSON) return time_period_local_var; end: + if (period_local_nonprim) { + OpenAPI_periodicity_free(period_local_nonprim); + period_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/time_window.c b/lib/sbi/openapi/model/time_window.c index b7bdb4066..d86a479a2 100644 --- a/lib/sbi/openapi/model/time_window.c +++ b/lib/sbi/openapi/model/time_window.c @@ -20,18 +20,26 @@ OpenAPI_time_window_t *OpenAPI_time_window_create( void OpenAPI_time_window_free(OpenAPI_time_window_t *time_window) { + OpenAPI_lnode_t *node = NULL; + if (NULL == time_window) { return; } - OpenAPI_lnode_t *node; - ogs_free(time_window->start_time); - ogs_free(time_window->stop_time); + if (time_window->start_time) { + ogs_free(time_window->start_time); + time_window->start_time = NULL; + } + if (time_window->stop_time) { + ogs_free(time_window->stop_time); + time_window->stop_time = NULL; + } ogs_free(time_window); } cJSON *OpenAPI_time_window_convertToJSON(OpenAPI_time_window_t *time_window) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (time_window == NULL) { ogs_error("OpenAPI_time_window_convertToJSON() failed [TimeWindow]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_time_window_convertToJSON(OpenAPI_time_window_t *time_window) } item = cJSON_CreateObject(); + if (!time_window->start_time) { + ogs_error("OpenAPI_time_window_convertToJSON() failed [start_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "startTime", time_window->start_time) == NULL) { ogs_error("OpenAPI_time_window_convertToJSON() failed [start_time]"); goto end; } + if (!time_window->stop_time) { + ogs_error("OpenAPI_time_window_convertToJSON() failed [stop_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "stopTime", time_window->stop_time) == NULL) { ogs_error("OpenAPI_time_window_convertToJSON() failed [stop_time]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_time_window_t *OpenAPI_time_window_parseFromJSON(cJSON *time_windowJSON) { OpenAPI_time_window_t *time_window_local_var = NULL; - cJSON *start_time = cJSON_GetObjectItemCaseSensitive(time_windowJSON, "startTime"); + OpenAPI_lnode_t *node = NULL; + cJSON *start_time = NULL; + cJSON *stop_time = NULL; + start_time = cJSON_GetObjectItemCaseSensitive(time_windowJSON, "startTime"); if (!start_time) { ogs_error("OpenAPI_time_window_parseFromJSON() failed [start_time]"); goto end; } - if (!cJSON_IsString(start_time)) { ogs_error("OpenAPI_time_window_parseFromJSON() failed [start_time]"); goto end; } - cJSON *stop_time = cJSON_GetObjectItemCaseSensitive(time_windowJSON, "stopTime"); + stop_time = cJSON_GetObjectItemCaseSensitive(time_windowJSON, "stopTime"); if (!stop_time) { ogs_error("OpenAPI_time_window_parseFromJSON() failed [stop_time]"); goto end; } - if (!cJSON_IsString(stop_time)) { ogs_error("OpenAPI_time_window_parseFromJSON() failed [stop_time]"); goto end; diff --git a/lib/sbi/openapi/model/tnap_id.c b/lib/sbi/openapi/model/tnap_id.c index 3b17074b7..3c43bddb1 100644 --- a/lib/sbi/openapi/model/tnap_id.c +++ b/lib/sbi/openapi/model/tnap_id.c @@ -7,7 +7,7 @@ OpenAPI_tnap_id_t *OpenAPI_tnap_id_create( char *ss_id, char *bss_id, - char civic_address + char *civic_address ) { OpenAPI_tnap_id_t *tnap_id_local_var = ogs_malloc(sizeof(OpenAPI_tnap_id_t)); @@ -22,18 +22,30 @@ OpenAPI_tnap_id_t *OpenAPI_tnap_id_create( void OpenAPI_tnap_id_free(OpenAPI_tnap_id_t *tnap_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tnap_id) { return; } - OpenAPI_lnode_t *node; - ogs_free(tnap_id->ss_id); - ogs_free(tnap_id->bss_id); + if (tnap_id->ss_id) { + ogs_free(tnap_id->ss_id); + tnap_id->ss_id = NULL; + } + if (tnap_id->bss_id) { + ogs_free(tnap_id->bss_id); + tnap_id->bss_id = NULL; + } + if (tnap_id->civic_address) { + ogs_free(tnap_id->civic_address); + tnap_id->civic_address = NULL; + } ogs_free(tnap_id); } cJSON *OpenAPI_tnap_id_convertToJSON(OpenAPI_tnap_id_t *tnap_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tnap_id == NULL) { ogs_error("OpenAPI_tnap_id_convertToJSON() failed [TnapId]"); @@ -56,7 +68,7 @@ cJSON *OpenAPI_tnap_id_convertToJSON(OpenAPI_tnap_id_t *tnap_id) } if (tnap_id->civic_address) { - if (cJSON_AddNumberToObject(item, "civicAddress", tnap_id->civic_address) == NULL) { + if (cJSON_AddStringToObject(item, "civicAddress", tnap_id->civic_address) == NULL) { ogs_error("OpenAPI_tnap_id_convertToJSON() failed [civic_address]"); goto end; } @@ -69,37 +81,38 @@ end: OpenAPI_tnap_id_t *OpenAPI_tnap_id_parseFromJSON(cJSON *tnap_idJSON) { OpenAPI_tnap_id_t *tnap_id_local_var = NULL; - cJSON *ss_id = cJSON_GetObjectItemCaseSensitive(tnap_idJSON, "ssId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ss_id = NULL; + cJSON *bss_id = NULL; + cJSON *civic_address = NULL; + ss_id = cJSON_GetObjectItemCaseSensitive(tnap_idJSON, "ssId"); if (ss_id) { - if (!cJSON_IsString(ss_id)) { + if (!cJSON_IsString(ss_id) && !cJSON_IsNull(ss_id)) { ogs_error("OpenAPI_tnap_id_parseFromJSON() failed [ss_id]"); goto end; } } - cJSON *bss_id = cJSON_GetObjectItemCaseSensitive(tnap_idJSON, "bssId"); - + bss_id = cJSON_GetObjectItemCaseSensitive(tnap_idJSON, "bssId"); if (bss_id) { - if (!cJSON_IsString(bss_id)) { + if (!cJSON_IsString(bss_id) && !cJSON_IsNull(bss_id)) { ogs_error("OpenAPI_tnap_id_parseFromJSON() failed [bss_id]"); goto end; } } - cJSON *civic_address = cJSON_GetObjectItemCaseSensitive(tnap_idJSON, "civicAddress"); - + civic_address = cJSON_GetObjectItemCaseSensitive(tnap_idJSON, "civicAddress"); if (civic_address) { - if (!cJSON_IsNumber(civic_address)) { + if (!cJSON_IsString(civic_address) && !cJSON_IsNull(civic_address)) { ogs_error("OpenAPI_tnap_id_parseFromJSON() failed [civic_address]"); goto end; } } tnap_id_local_var = OpenAPI_tnap_id_create ( - ss_id ? ogs_strdup(ss_id->valuestring) : NULL, - bss_id ? ogs_strdup(bss_id->valuestring) : NULL, - civic_address ? civic_address->valueint : 0 + ss_id && !cJSON_IsNull(ss_id) ? ogs_strdup(ss_id->valuestring) : NULL, + bss_id && !cJSON_IsNull(bss_id) ? ogs_strdup(bss_id->valuestring) : NULL, + civic_address && !cJSON_IsNull(civic_address) ? ogs_strdup(civic_address->valuestring) : NULL ); return tnap_id_local_var; diff --git a/lib/sbi/openapi/model/tnap_id.h b/lib/sbi/openapi/model/tnap_id.h index 753bc8b57..55e773da5 100644 --- a/lib/sbi/openapi/model/tnap_id.h +++ b/lib/sbi/openapi/model/tnap_id.h @@ -21,13 +21,13 @@ typedef struct OpenAPI_tnap_id_s OpenAPI_tnap_id_t; typedef struct OpenAPI_tnap_id_s { char *ss_id; char *bss_id; - char civic_address; + char *civic_address; } OpenAPI_tnap_id_t; OpenAPI_tnap_id_t *OpenAPI_tnap_id_create( char *ss_id, char *bss_id, - char civic_address + char *civic_address ); void OpenAPI_tnap_id_free(OpenAPI_tnap_id_t *tnap_id); OpenAPI_tnap_id_t *OpenAPI_tnap_id_parseFromJSON(cJSON *tnap_idJSON); diff --git a/lib/sbi/openapi/model/tngf_info.c b/lib/sbi/openapi/model/tngf_info.c index 9b54bb091..81c8b3f12 100644 --- a/lib/sbi/openapi/model/tngf_info.c +++ b/lib/sbi/openapi/model/tngf_info.c @@ -22,25 +22,36 @@ OpenAPI_tngf_info_t *OpenAPI_tngf_info_create( void OpenAPI_tngf_info_free(OpenAPI_tngf_info_t *tngf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tngf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(tngf_info->ipv4_endpoint_addresses, node) { - ogs_free(node->data); + if (tngf_info->ipv4_endpoint_addresses) { + OpenAPI_list_for_each(tngf_info->ipv4_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tngf_info->ipv4_endpoint_addresses); + tngf_info->ipv4_endpoint_addresses = NULL; } - OpenAPI_list_free(tngf_info->ipv4_endpoint_addresses); - OpenAPI_list_for_each(tngf_info->ipv6_endpoint_addresses, node) { - ogs_free(node->data); + if (tngf_info->ipv6_endpoint_addresses) { + OpenAPI_list_for_each(tngf_info->ipv6_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(tngf_info->ipv6_endpoint_addresses); + tngf_info->ipv6_endpoint_addresses = NULL; + } + if (tngf_info->endpoint_fqdn) { + ogs_free(tngf_info->endpoint_fqdn); + tngf_info->endpoint_fqdn = NULL; } - OpenAPI_list_free(tngf_info->ipv6_endpoint_addresses); - ogs_free(tngf_info->endpoint_fqdn); ogs_free(tngf_info); } cJSON *OpenAPI_tngf_info_convertToJSON(OpenAPI_tngf_info_t *tngf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tngf_info == NULL) { ogs_error("OpenAPI_tngf_info_convertToJSON() failed [TngfInfo]"); @@ -49,35 +60,31 @@ cJSON *OpenAPI_tngf_info_convertToJSON(OpenAPI_tngf_info_t *tngf_info) item = cJSON_CreateObject(); if (tngf_info->ipv4_endpoint_addresses) { - cJSON *ipv4_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); - if (ipv4_endpoint_addresses == NULL) { + cJSON *ipv4_endpoint_addressesList = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); + if (ipv4_endpoint_addressesList == NULL) { ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv4_endpoint_addresses_node; - OpenAPI_list_for_each(tngf_info->ipv4_endpoint_addresses, ipv4_endpoint_addresses_node) { - if (cJSON_AddStringToObject(ipv4_endpoint_addresses, "", (char*)ipv4_endpoint_addresses_node->data) == NULL) { - ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); - goto end; + OpenAPI_list_for_each(tngf_info->ipv4_endpoint_addresses, node) { + if (cJSON_AddStringToObject(ipv4_endpoint_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } } - } } if (tngf_info->ipv6_endpoint_addresses) { - cJSON *ipv6_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); - if (ipv6_endpoint_addresses == NULL) { + cJSON *ipv6_endpoint_addressesList = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); + if (ipv6_endpoint_addressesList == NULL) { ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv6_endpoint_addresses_node; - OpenAPI_list_for_each(tngf_info->ipv6_endpoint_addresses, ipv6_endpoint_addresses_node) { - if (cJSON_AddStringToObject(ipv6_endpoint_addresses, "", (char*)ipv6_endpoint_addresses_node->data) == NULL) { - ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); - goto end; + OpenAPI_list_for_each(tngf_info->ipv6_endpoint_addresses, node) { + if (cJSON_AddStringToObject(ipv6_endpoint_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_tngf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } } - } } if (tngf_info->endpoint_fqdn) { @@ -94,50 +101,57 @@ end: OpenAPI_tngf_info_t *OpenAPI_tngf_info_parseFromJSON(cJSON *tngf_infoJSON) { OpenAPI_tngf_info_t *tngf_info_local_var = NULL; - cJSON *ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "ipv4EndpointAddresses"); - - OpenAPI_list_t *ipv4_endpoint_addressesList; + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_endpoint_addresses = NULL; + OpenAPI_list_t *ipv4_endpoint_addressesList = NULL; + cJSON *ipv6_endpoint_addresses = NULL; + OpenAPI_list_t *ipv6_endpoint_addressesList = NULL; + cJSON *endpoint_fqdn = NULL; + ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "ipv4EndpointAddresses"); if (ipv4_endpoint_addresses) { - cJSON *ipv4_endpoint_addresses_local; - if (!cJSON_IsArray(ipv4_endpoint_addresses)) { - ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); - goto end; - } - ipv4_endpoint_addressesList = OpenAPI_list_create(); + cJSON *ipv4_endpoint_addresses_local = NULL; + if (!cJSON_IsArray(ipv4_endpoint_addresses)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { - if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { - ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); - goto end; - } - OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); - } + ipv4_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); + } } - cJSON *ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "ipv6EndpointAddresses"); - - OpenAPI_list_t *ipv6_endpoint_addressesList; + ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "ipv6EndpointAddresses"); if (ipv6_endpoint_addresses) { - cJSON *ipv6_endpoint_addresses_local; - if (!cJSON_IsArray(ipv6_endpoint_addresses)) { - ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); - goto end; - } - ipv6_endpoint_addressesList = OpenAPI_list_create(); + cJSON *ipv6_endpoint_addresses_local = NULL; + if (!cJSON_IsArray(ipv6_endpoint_addresses)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { - if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { - ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); - goto end; - } - OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); - } + ipv6_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { + ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); + } } - cJSON *endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "endpointFqdn"); - + endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(tngf_infoJSON, "endpointFqdn"); if (endpoint_fqdn) { - if (!cJSON_IsString(endpoint_fqdn)) { + if (!cJSON_IsString(endpoint_fqdn) && !cJSON_IsNull(endpoint_fqdn)) { ogs_error("OpenAPI_tngf_info_parseFromJSON() failed [endpoint_fqdn]"); goto end; } @@ -146,11 +160,25 @@ OpenAPI_tngf_info_t *OpenAPI_tngf_info_parseFromJSON(cJSON *tngf_infoJSON) tngf_info_local_var = OpenAPI_tngf_info_create ( ipv4_endpoint_addresses ? ipv4_endpoint_addressesList : NULL, ipv6_endpoint_addresses ? ipv6_endpoint_addressesList : NULL, - endpoint_fqdn ? ogs_strdup(endpoint_fqdn->valuestring) : NULL + endpoint_fqdn && !cJSON_IsNull(endpoint_fqdn) ? ogs_strdup(endpoint_fqdn->valuestring) : NULL ); return tngf_info_local_var; end: + if (ipv4_endpoint_addressesList) { + OpenAPI_list_for_each(ipv4_endpoint_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_endpoint_addressesList); + ipv4_endpoint_addressesList = NULL; + } + if (ipv6_endpoint_addressesList) { + OpenAPI_list_for_each(ipv6_endpoint_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_endpoint_addressesList); + ipv6_endpoint_addressesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/trace_data.c b/lib/sbi/openapi/model/trace_data.c index 453a405fb..e43062683 100644 --- a/lib/sbi/openapi/model/trace_data.c +++ b/lib/sbi/openapi/model/trace_data.c @@ -30,22 +30,42 @@ OpenAPI_trace_data_t *OpenAPI_trace_data_create( void OpenAPI_trace_data_free(OpenAPI_trace_data_t *trace_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == trace_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(trace_data->trace_ref); - ogs_free(trace_data->ne_type_list); - ogs_free(trace_data->event_list); - ogs_free(trace_data->collection_entity_ipv4_addr); - ogs_free(trace_data->collection_entity_ipv6_addr); - ogs_free(trace_data->interface_list); + if (trace_data->trace_ref) { + ogs_free(trace_data->trace_ref); + trace_data->trace_ref = NULL; + } + if (trace_data->ne_type_list) { + ogs_free(trace_data->ne_type_list); + trace_data->ne_type_list = NULL; + } + if (trace_data->event_list) { + ogs_free(trace_data->event_list); + trace_data->event_list = NULL; + } + if (trace_data->collection_entity_ipv4_addr) { + ogs_free(trace_data->collection_entity_ipv4_addr); + trace_data->collection_entity_ipv4_addr = NULL; + } + if (trace_data->collection_entity_ipv6_addr) { + ogs_free(trace_data->collection_entity_ipv6_addr); + trace_data->collection_entity_ipv6_addr = NULL; + } + if (trace_data->interface_list) { + ogs_free(trace_data->interface_list); + trace_data->interface_list = NULL; + } ogs_free(trace_data); } cJSON *OpenAPI_trace_data_convertToJSON(OpenAPI_trace_data_t *trace_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (trace_data == NULL) { ogs_error("OpenAPI_trace_data_convertToJSON() failed [TraceData]"); @@ -53,21 +73,37 @@ cJSON *OpenAPI_trace_data_convertToJSON(OpenAPI_trace_data_t *trace_data) } item = cJSON_CreateObject(); + if (!trace_data->trace_ref) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_ref]"); + return NULL; + } if (cJSON_AddStringToObject(item, "traceRef", trace_data->trace_ref) == NULL) { ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_ref]"); goto end; } + if (trace_data->trace_depth == OpenAPI_trace_depth_NULL) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_depth]"); + return NULL; + } if (cJSON_AddStringToObject(item, "traceDepth", OpenAPI_trace_depth_ToString(trace_data->trace_depth)) == NULL) { ogs_error("OpenAPI_trace_data_convertToJSON() failed [trace_depth]"); goto end; } + if (!trace_data->ne_type_list) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [ne_type_list]"); + return NULL; + } if (cJSON_AddStringToObject(item, "neTypeList", trace_data->ne_type_list) == NULL) { ogs_error("OpenAPI_trace_data_convertToJSON() failed [ne_type_list]"); goto end; } + if (!trace_data->event_list) { + ogs_error("OpenAPI_trace_data_convertToJSON() failed [event_list]"); + return NULL; + } if (cJSON_AddStringToObject(item, "eventList", trace_data->event_list) == NULL) { ogs_error("OpenAPI_trace_data_convertToJSON() failed [event_list]"); goto end; @@ -101,74 +137,75 @@ end: OpenAPI_trace_data_t *OpenAPI_trace_data_parseFromJSON(cJSON *trace_dataJSON) { OpenAPI_trace_data_t *trace_data_local_var = NULL; - cJSON *trace_ref = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "traceRef"); + OpenAPI_lnode_t *node = NULL; + cJSON *trace_ref = NULL; + cJSON *trace_depth = NULL; + OpenAPI_trace_depth_e trace_depthVariable = 0; + cJSON *ne_type_list = NULL; + cJSON *event_list = NULL; + cJSON *collection_entity_ipv4_addr = NULL; + cJSON *collection_entity_ipv6_addr = NULL; + cJSON *interface_list = NULL; + trace_ref = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "traceRef"); if (!trace_ref) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [trace_ref]"); goto end; } - if (!cJSON_IsString(trace_ref)) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [trace_ref]"); goto end; } - cJSON *trace_depth = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "traceDepth"); + trace_depth = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "traceDepth"); if (!trace_depth) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [trace_depth]"); goto end; } - - OpenAPI_trace_depth_e trace_depthVariable; if (!cJSON_IsString(trace_depth)) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [trace_depth]"); goto end; } trace_depthVariable = OpenAPI_trace_depth_FromString(trace_depth->valuestring); - cJSON *ne_type_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "neTypeList"); + ne_type_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "neTypeList"); if (!ne_type_list) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [ne_type_list]"); goto end; } - if (!cJSON_IsString(ne_type_list)) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [ne_type_list]"); goto end; } - cJSON *event_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "eventList"); + event_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "eventList"); if (!event_list) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [event_list]"); goto end; } - if (!cJSON_IsString(event_list)) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [event_list]"); goto end; } - cJSON *collection_entity_ipv4_addr = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "collectionEntityIpv4Addr"); - + collection_entity_ipv4_addr = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "collectionEntityIpv4Addr"); if (collection_entity_ipv4_addr) { - if (!cJSON_IsString(collection_entity_ipv4_addr)) { + if (!cJSON_IsString(collection_entity_ipv4_addr) && !cJSON_IsNull(collection_entity_ipv4_addr)) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [collection_entity_ipv4_addr]"); goto end; } } - cJSON *collection_entity_ipv6_addr = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "collectionEntityIpv6Addr"); - + collection_entity_ipv6_addr = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "collectionEntityIpv6Addr"); if (collection_entity_ipv6_addr) { - if (!cJSON_IsString(collection_entity_ipv6_addr)) { + if (!cJSON_IsString(collection_entity_ipv6_addr) && !cJSON_IsNull(collection_entity_ipv6_addr)) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [collection_entity_ipv6_addr]"); goto end; } } - cJSON *interface_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "interfaceList"); - + interface_list = cJSON_GetObjectItemCaseSensitive(trace_dataJSON, "interfaceList"); if (interface_list) { - if (!cJSON_IsString(interface_list)) { + if (!cJSON_IsString(interface_list) && !cJSON_IsNull(interface_list)) { ogs_error("OpenAPI_trace_data_parseFromJSON() failed [interface_list]"); goto end; } @@ -179,9 +216,9 @@ OpenAPI_trace_data_t *OpenAPI_trace_data_parseFromJSON(cJSON *trace_dataJSON) trace_depthVariable, ogs_strdup(ne_type_list->valuestring), ogs_strdup(event_list->valuestring), - collection_entity_ipv4_addr ? ogs_strdup(collection_entity_ipv4_addr->valuestring) : NULL, - collection_entity_ipv6_addr ? ogs_strdup(collection_entity_ipv6_addr->valuestring) : NULL, - interface_list ? ogs_strdup(interface_list->valuestring) : NULL + collection_entity_ipv4_addr && !cJSON_IsNull(collection_entity_ipv4_addr) ? ogs_strdup(collection_entity_ipv4_addr->valuestring) : NULL, + collection_entity_ipv6_addr && !cJSON_IsNull(collection_entity_ipv6_addr) ? ogs_strdup(collection_entity_ipv6_addr->valuestring) : NULL, + interface_list && !cJSON_IsNull(interface_list) ? ogs_strdup(interface_list->valuestring) : NULL ); return trace_data_local_var; diff --git a/lib/sbi/openapi/model/trace_data_1.c b/lib/sbi/openapi/model/trace_data_1.c index 842ec5f20..537fec21f 100644 --- a/lib/sbi/openapi/model/trace_data_1.c +++ b/lib/sbi/openapi/model/trace_data_1.c @@ -30,22 +30,42 @@ OpenAPI_trace_data_1_t *OpenAPI_trace_data_1_create( void OpenAPI_trace_data_1_free(OpenAPI_trace_data_1_t *trace_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == trace_data_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(trace_data_1->trace_ref); - ogs_free(trace_data_1->ne_type_list); - ogs_free(trace_data_1->event_list); - ogs_free(trace_data_1->collection_entity_ipv4_addr); - ogs_free(trace_data_1->collection_entity_ipv6_addr); - ogs_free(trace_data_1->interface_list); + if (trace_data_1->trace_ref) { + ogs_free(trace_data_1->trace_ref); + trace_data_1->trace_ref = NULL; + } + if (trace_data_1->ne_type_list) { + ogs_free(trace_data_1->ne_type_list); + trace_data_1->ne_type_list = NULL; + } + if (trace_data_1->event_list) { + ogs_free(trace_data_1->event_list); + trace_data_1->event_list = NULL; + } + if (trace_data_1->collection_entity_ipv4_addr) { + ogs_free(trace_data_1->collection_entity_ipv4_addr); + trace_data_1->collection_entity_ipv4_addr = NULL; + } + if (trace_data_1->collection_entity_ipv6_addr) { + ogs_free(trace_data_1->collection_entity_ipv6_addr); + trace_data_1->collection_entity_ipv6_addr = NULL; + } + if (trace_data_1->interface_list) { + ogs_free(trace_data_1->interface_list); + trace_data_1->interface_list = NULL; + } ogs_free(trace_data_1); } cJSON *OpenAPI_trace_data_1_convertToJSON(OpenAPI_trace_data_1_t *trace_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (trace_data_1 == NULL) { ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [TraceData_1]"); @@ -53,21 +73,37 @@ cJSON *OpenAPI_trace_data_1_convertToJSON(OpenAPI_trace_data_1_t *trace_data_1) } item = cJSON_CreateObject(); + if (!trace_data_1->trace_ref) { + ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [trace_ref]"); + return NULL; + } if (cJSON_AddStringToObject(item, "traceRef", trace_data_1->trace_ref) == NULL) { ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [trace_ref]"); goto end; } + if (trace_data_1->trace_depth == OpenAPI_trace_depth_NULL) { + ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [trace_depth]"); + return NULL; + } if (cJSON_AddStringToObject(item, "traceDepth", OpenAPI_trace_depth_ToString(trace_data_1->trace_depth)) == NULL) { ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [trace_depth]"); goto end; } + if (!trace_data_1->ne_type_list) { + ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [ne_type_list]"); + return NULL; + } if (cJSON_AddStringToObject(item, "neTypeList", trace_data_1->ne_type_list) == NULL) { ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [ne_type_list]"); goto end; } + if (!trace_data_1->event_list) { + ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [event_list]"); + return NULL; + } if (cJSON_AddStringToObject(item, "eventList", trace_data_1->event_list) == NULL) { ogs_error("OpenAPI_trace_data_1_convertToJSON() failed [event_list]"); goto end; @@ -101,74 +137,75 @@ end: OpenAPI_trace_data_1_t *OpenAPI_trace_data_1_parseFromJSON(cJSON *trace_data_1JSON) { OpenAPI_trace_data_1_t *trace_data_1_local_var = NULL; - cJSON *trace_ref = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "traceRef"); + OpenAPI_lnode_t *node = NULL; + cJSON *trace_ref = NULL; + cJSON *trace_depth = NULL; + OpenAPI_trace_depth_e trace_depthVariable = 0; + cJSON *ne_type_list = NULL; + cJSON *event_list = NULL; + cJSON *collection_entity_ipv4_addr = NULL; + cJSON *collection_entity_ipv6_addr = NULL; + cJSON *interface_list = NULL; + trace_ref = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "traceRef"); if (!trace_ref) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [trace_ref]"); goto end; } - if (!cJSON_IsString(trace_ref)) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [trace_ref]"); goto end; } - cJSON *trace_depth = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "traceDepth"); + trace_depth = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "traceDepth"); if (!trace_depth) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [trace_depth]"); goto end; } - - OpenAPI_trace_depth_e trace_depthVariable; if (!cJSON_IsString(trace_depth)) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [trace_depth]"); goto end; } trace_depthVariable = OpenAPI_trace_depth_FromString(trace_depth->valuestring); - cJSON *ne_type_list = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "neTypeList"); + ne_type_list = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "neTypeList"); if (!ne_type_list) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [ne_type_list]"); goto end; } - if (!cJSON_IsString(ne_type_list)) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [ne_type_list]"); goto end; } - cJSON *event_list = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "eventList"); + event_list = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "eventList"); if (!event_list) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [event_list]"); goto end; } - if (!cJSON_IsString(event_list)) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [event_list]"); goto end; } - cJSON *collection_entity_ipv4_addr = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "collectionEntityIpv4Addr"); - + collection_entity_ipv4_addr = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "collectionEntityIpv4Addr"); if (collection_entity_ipv4_addr) { - if (!cJSON_IsString(collection_entity_ipv4_addr)) { + if (!cJSON_IsString(collection_entity_ipv4_addr) && !cJSON_IsNull(collection_entity_ipv4_addr)) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [collection_entity_ipv4_addr]"); goto end; } } - cJSON *collection_entity_ipv6_addr = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "collectionEntityIpv6Addr"); - + collection_entity_ipv6_addr = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "collectionEntityIpv6Addr"); if (collection_entity_ipv6_addr) { - if (!cJSON_IsString(collection_entity_ipv6_addr)) { + if (!cJSON_IsString(collection_entity_ipv6_addr) && !cJSON_IsNull(collection_entity_ipv6_addr)) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [collection_entity_ipv6_addr]"); goto end; } } - cJSON *interface_list = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "interfaceList"); - + interface_list = cJSON_GetObjectItemCaseSensitive(trace_data_1JSON, "interfaceList"); if (interface_list) { - if (!cJSON_IsString(interface_list)) { + if (!cJSON_IsString(interface_list) && !cJSON_IsNull(interface_list)) { ogs_error("OpenAPI_trace_data_1_parseFromJSON() failed [interface_list]"); goto end; } @@ -179,9 +216,9 @@ OpenAPI_trace_data_1_t *OpenAPI_trace_data_1_parseFromJSON(cJSON *trace_data_1JS trace_depthVariable, ogs_strdup(ne_type_list->valuestring), ogs_strdup(event_list->valuestring), - collection_entity_ipv4_addr ? ogs_strdup(collection_entity_ipv4_addr->valuestring) : NULL, - collection_entity_ipv6_addr ? ogs_strdup(collection_entity_ipv6_addr->valuestring) : NULL, - interface_list ? ogs_strdup(interface_list->valuestring) : NULL + collection_entity_ipv4_addr && !cJSON_IsNull(collection_entity_ipv4_addr) ? ogs_strdup(collection_entity_ipv4_addr->valuestring) : NULL, + collection_entity_ipv6_addr && !cJSON_IsNull(collection_entity_ipv6_addr) ? ogs_strdup(collection_entity_ipv6_addr->valuestring) : NULL, + interface_list && !cJSON_IsNull(interface_list) ? ogs_strdup(interface_list->valuestring) : NULL ); return trace_data_1_local_var; diff --git a/lib/sbi/openapi/model/trace_data_response.c b/lib/sbi/openapi/model/trace_data_response.c index f66ef3ee4..afdc6b5ed 100644 --- a/lib/sbi/openapi/model/trace_data_response.c +++ b/lib/sbi/openapi/model/trace_data_response.c @@ -20,18 +20,26 @@ OpenAPI_trace_data_response_t *OpenAPI_trace_data_response_create( void OpenAPI_trace_data_response_free(OpenAPI_trace_data_response_t *trace_data_response) { + OpenAPI_lnode_t *node = NULL; + if (NULL == trace_data_response) { return; } - OpenAPI_lnode_t *node; - OpenAPI_trace_data_free(trace_data_response->trace_data); - ogs_free(trace_data_response->shared_trace_data_id); + if (trace_data_response->trace_data) { + OpenAPI_trace_data_free(trace_data_response->trace_data); + trace_data_response->trace_data = NULL; + } + if (trace_data_response->shared_trace_data_id) { + ogs_free(trace_data_response->shared_trace_data_id); + trace_data_response->shared_trace_data_id = NULL; + } ogs_free(trace_data_response); } cJSON *OpenAPI_trace_data_response_convertToJSON(OpenAPI_trace_data_response_t *trace_data_response) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (trace_data_response == NULL) { ogs_error("OpenAPI_trace_data_response_convertToJSON() failed [TraceDataResponse]"); @@ -66,17 +74,18 @@ end: OpenAPI_trace_data_response_t *OpenAPI_trace_data_response_parseFromJSON(cJSON *trace_data_responseJSON) { OpenAPI_trace_data_response_t *trace_data_response_local_var = NULL; - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(trace_data_responseJSON, "traceData"); - + OpenAPI_lnode_t *node = NULL; + cJSON *trace_data = NULL; OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *shared_trace_data_id = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(trace_data_responseJSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *shared_trace_data_id = cJSON_GetObjectItemCaseSensitive(trace_data_responseJSON, "sharedTraceDataId"); - + shared_trace_data_id = cJSON_GetObjectItemCaseSensitive(trace_data_responseJSON, "sharedTraceDataId"); if (shared_trace_data_id) { - if (!cJSON_IsString(shared_trace_data_id)) { + if (!cJSON_IsString(shared_trace_data_id) && !cJSON_IsNull(shared_trace_data_id)) { ogs_error("OpenAPI_trace_data_response_parseFromJSON() failed [shared_trace_data_id]"); goto end; } @@ -84,11 +93,15 @@ OpenAPI_trace_data_response_t *OpenAPI_trace_data_response_parseFromJSON(cJSON * trace_data_response_local_var = OpenAPI_trace_data_response_create ( trace_data ? trace_data_local_nonprim : NULL, - shared_trace_data_id ? ogs_strdup(shared_trace_data_id->valuestring) : NULL + shared_trace_data_id && !cJSON_IsNull(shared_trace_data_id) ? ogs_strdup(shared_trace_data_id->valuestring) : NULL ); return trace_data_response_local_var; end: + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/traffic_control_data.c b/lib/sbi/openapi/model/traffic_control_data.c index 2b915d01e..b2cfa9f96 100644 --- a/lib/sbi/openapi/model/traffic_control_data.c +++ b/lib/sbi/openapi/model/traffic_control_data.c @@ -48,32 +48,64 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_create( void OpenAPI_traffic_control_data_free(OpenAPI_traffic_control_data_t *traffic_control_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == traffic_control_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(traffic_control_data->tc_id); - OpenAPI_redirect_information_free(traffic_control_data->redirect_info); - OpenAPI_list_for_each(traffic_control_data->add_redirect_info, node) { - OpenAPI_redirect_information_free(node->data); + if (traffic_control_data->tc_id) { + ogs_free(traffic_control_data->tc_id); + traffic_control_data->tc_id = NULL; } - OpenAPI_list_free(traffic_control_data->add_redirect_info); - ogs_free(traffic_control_data->traffic_steering_pol_id_dl); - ogs_free(traffic_control_data->traffic_steering_pol_id_ul); - OpenAPI_list_for_each(traffic_control_data->route_to_locs, node) { - OpenAPI_route_to_location_free(node->data); + if (traffic_control_data->redirect_info) { + OpenAPI_redirect_information_free(traffic_control_data->redirect_info); + traffic_control_data->redirect_info = NULL; + } + if (traffic_control_data->add_redirect_info) { + OpenAPI_list_for_each(traffic_control_data->add_redirect_info, node) { + OpenAPI_redirect_information_free(node->data); + } + OpenAPI_list_free(traffic_control_data->add_redirect_info); + traffic_control_data->add_redirect_info = NULL; + } + if (traffic_control_data->traffic_steering_pol_id_dl) { + ogs_free(traffic_control_data->traffic_steering_pol_id_dl); + traffic_control_data->traffic_steering_pol_id_dl = NULL; + } + if (traffic_control_data->traffic_steering_pol_id_ul) { + ogs_free(traffic_control_data->traffic_steering_pol_id_ul); + traffic_control_data->traffic_steering_pol_id_ul = NULL; + } + if (traffic_control_data->route_to_locs) { + OpenAPI_list_for_each(traffic_control_data->route_to_locs, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(traffic_control_data->route_to_locs); + traffic_control_data->route_to_locs = NULL; + } + if (traffic_control_data->up_path_chg_event) { + OpenAPI_up_path_chg_event_free(traffic_control_data->up_path_chg_event); + traffic_control_data->up_path_chg_event = NULL; + } + if (traffic_control_data->steer_mode_dl) { + OpenAPI_steering_mode_free(traffic_control_data->steer_mode_dl); + traffic_control_data->steer_mode_dl = NULL; + } + if (traffic_control_data->steer_mode_ul) { + OpenAPI_steering_mode_free(traffic_control_data->steer_mode_ul); + traffic_control_data->steer_mode_ul = NULL; + } + if (traffic_control_data->mul_acc_ctrl) { + OpenAPI_multicast_access_control_free(traffic_control_data->mul_acc_ctrl); + traffic_control_data->mul_acc_ctrl = NULL; } - OpenAPI_list_free(traffic_control_data->route_to_locs); - OpenAPI_up_path_chg_event_free(traffic_control_data->up_path_chg_event); - OpenAPI_steering_mode_free(traffic_control_data->steer_mode_dl); - OpenAPI_steering_mode_free(traffic_control_data->steer_mode_ul); - OpenAPI_multicast_access_control_free(traffic_control_data->mul_acc_ctrl); ogs_free(traffic_control_data); } cJSON *OpenAPI_traffic_control_data_convertToJSON(OpenAPI_traffic_control_data_t *traffic_control_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (traffic_control_data == NULL) { ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [TrafficControlData]"); @@ -81,12 +113,16 @@ cJSON *OpenAPI_traffic_control_data_convertToJSON(OpenAPI_traffic_control_data_t } item = cJSON_CreateObject(); + if (!traffic_control_data->tc_id) { + ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [tc_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "tcId", traffic_control_data->tc_id) == NULL) { ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [tc_id]"); goto end; } - if (traffic_control_data->flow_status) { + if (traffic_control_data->flow_status != OpenAPI_flow_status_NULL) { if (cJSON_AddStringToObject(item, "flowStatus", OpenAPI_flow_status_ToString(traffic_control_data->flow_status)) == NULL) { ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [flow_status]"); goto end; @@ -112,17 +148,13 @@ cJSON *OpenAPI_traffic_control_data_convertToJSON(OpenAPI_traffic_control_data_t ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [add_redirect_info]"); goto end; } - - OpenAPI_lnode_t *add_redirect_info_node; - if (traffic_control_data->add_redirect_info) { - OpenAPI_list_for_each(traffic_control_data->add_redirect_info, add_redirect_info_node) { - cJSON *itemLocal = OpenAPI_redirect_information_convertToJSON(add_redirect_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [add_redirect_info]"); - goto end; - } - cJSON_AddItemToArray(add_redirect_infoList, itemLocal); + OpenAPI_list_for_each(traffic_control_data->add_redirect_info, node) { + cJSON *itemLocal = OpenAPI_redirect_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [add_redirect_info]"); + goto end; } + cJSON_AddItemToArray(add_redirect_infoList, itemLocal); } } @@ -153,17 +185,13 @@ cJSON *OpenAPI_traffic_control_data_convertToJSON(OpenAPI_traffic_control_data_t ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [route_to_locs]"); goto end; } - - OpenAPI_lnode_t *route_to_locs_node; - if (traffic_control_data->route_to_locs) { - OpenAPI_list_for_each(traffic_control_data->route_to_locs, route_to_locs_node) { - cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(route_to_locs_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [route_to_locs]"); - goto end; - } - cJSON_AddItemToArray(route_to_locsList, itemLocal); + OpenAPI_list_for_each(traffic_control_data->route_to_locs, node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [route_to_locs]"); + goto end; } + cJSON_AddItemToArray(route_to_locsList, itemLocal); } } @@ -187,7 +215,7 @@ cJSON *OpenAPI_traffic_control_data_convertToJSON(OpenAPI_traffic_control_data_t } } - if (traffic_control_data->steer_fun) { + if (traffic_control_data->steer_fun != OpenAPI_steering_functionality_NULL) { if (cJSON_AddStringToObject(item, "steerFun", OpenAPI_steering_functionality_ToString(traffic_control_data->steer_fun)) == NULL) { ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [steer_fun]"); goto end; @@ -240,20 +268,41 @@ end: OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON *traffic_control_dataJSON) { OpenAPI_traffic_control_data_t *traffic_control_data_local_var = NULL; - cJSON *tc_id = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "tcId"); + OpenAPI_lnode_t *node = NULL; + cJSON *tc_id = NULL; + cJSON *flow_status = NULL; + OpenAPI_flow_status_e flow_statusVariable = 0; + cJSON *redirect_info = NULL; + OpenAPI_redirect_information_t *redirect_info_local_nonprim = NULL; + cJSON *add_redirect_info = NULL; + OpenAPI_list_t *add_redirect_infoList = NULL; + cJSON *mute_notif = NULL; + cJSON *traffic_steering_pol_id_dl = NULL; + cJSON *traffic_steering_pol_id_ul = NULL; + cJSON *route_to_locs = NULL; + OpenAPI_list_t *route_to_locsList = NULL; + cJSON *traff_corre_ind = NULL; + cJSON *up_path_chg_event = NULL; + OpenAPI_up_path_chg_event_t *up_path_chg_event_local_nonprim = NULL; + cJSON *steer_fun = NULL; + OpenAPI_steering_functionality_e steer_funVariable = 0; + cJSON *steer_mode_dl = NULL; + OpenAPI_steering_mode_t *steer_mode_dl_local_nonprim = NULL; + cJSON *steer_mode_ul = NULL; + OpenAPI_steering_mode_t *steer_mode_ul_local_nonprim = NULL; + cJSON *mul_acc_ctrl = NULL; + OpenAPI_multicast_access_control_t *mul_acc_ctrl_local_nonprim = NULL; + tc_id = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "tcId"); if (!tc_id) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [tc_id]"); goto end; } - if (!cJSON_IsString(tc_id)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [tc_id]"); goto end; } - cJSON *flow_status = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "flowStatus"); - - OpenAPI_flow_status_e flow_statusVariable; + flow_status = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "flowStatus"); if (flow_status) { if (!cJSON_IsString(flow_status)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [flow_status]"); @@ -262,44 +311,37 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON flow_statusVariable = OpenAPI_flow_status_FromString(flow_status->valuestring); } - cJSON *redirect_info = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "redirectInfo"); - - OpenAPI_redirect_information_t *redirect_info_local_nonprim = NULL; + redirect_info = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "redirectInfo"); if (redirect_info) { redirect_info_local_nonprim = OpenAPI_redirect_information_parseFromJSON(redirect_info); } - cJSON *add_redirect_info = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "addRedirectInfo"); - - OpenAPI_list_t *add_redirect_infoList; + add_redirect_info = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "addRedirectInfo"); if (add_redirect_info) { - cJSON *add_redirect_info_local_nonprimitive; - if (!cJSON_IsArray(add_redirect_info)){ - ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [add_redirect_info]"); - goto end; - } - - add_redirect_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(add_redirect_info_local_nonprimitive, add_redirect_info ) { - if (!cJSON_IsObject(add_redirect_info_local_nonprimitive)) { + cJSON *add_redirect_info_local = NULL; + if (!cJSON_IsArray(add_redirect_info)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [add_redirect_info]"); goto end; } - OpenAPI_redirect_information_t *add_redirect_infoItem = OpenAPI_redirect_information_parseFromJSON(add_redirect_info_local_nonprimitive); - if (!add_redirect_infoItem) { - ogs_error("No add_redirect_infoItem"); - OpenAPI_list_free(add_redirect_infoList); - goto end; + add_redirect_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(add_redirect_info_local, add_redirect_info) { + if (!cJSON_IsObject(add_redirect_info_local)) { + ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [add_redirect_info]"); + goto end; + } + OpenAPI_redirect_information_t *add_redirect_infoItem = OpenAPI_redirect_information_parseFromJSON(add_redirect_info_local); + if (!add_redirect_infoItem) { + ogs_error("No add_redirect_infoItem"); + OpenAPI_list_free(add_redirect_infoList); + goto end; + } + OpenAPI_list_add(add_redirect_infoList, add_redirect_infoItem); } - - OpenAPI_list_add(add_redirect_infoList, add_redirect_infoItem); - } } - cJSON *mute_notif = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "muteNotif"); - + mute_notif = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "muteNotif"); if (mute_notif) { if (!cJSON_IsBool(mute_notif)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [mute_notif]"); @@ -307,55 +349,48 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON } } - cJSON *traffic_steering_pol_id_dl = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "trafficSteeringPolIdDl"); - + traffic_steering_pol_id_dl = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "trafficSteeringPolIdDl"); if (traffic_steering_pol_id_dl) { - if (!cJSON_IsString(traffic_steering_pol_id_dl)) { + if (!cJSON_IsString(traffic_steering_pol_id_dl) && !cJSON_IsNull(traffic_steering_pol_id_dl)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [traffic_steering_pol_id_dl]"); goto end; } } - cJSON *traffic_steering_pol_id_ul = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "trafficSteeringPolIdUl"); - + traffic_steering_pol_id_ul = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "trafficSteeringPolIdUl"); if (traffic_steering_pol_id_ul) { - if (!cJSON_IsString(traffic_steering_pol_id_ul)) { + if (!cJSON_IsString(traffic_steering_pol_id_ul) && !cJSON_IsNull(traffic_steering_pol_id_ul)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [traffic_steering_pol_id_ul]"); goto end; } } - cJSON *route_to_locs = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "routeToLocs"); - - OpenAPI_list_t *route_to_locsList; + route_to_locs = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "routeToLocs"); if (route_to_locs) { - cJSON *route_to_locs_local_nonprimitive; - if (!cJSON_IsArray(route_to_locs)){ - ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [route_to_locs]"); - goto end; - } - - route_to_locsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(route_to_locs_local_nonprimitive, route_to_locs ) { - if (!cJSON_IsObject(route_to_locs_local_nonprimitive)) { + cJSON *route_to_locs_local = NULL; + if (!cJSON_IsArray(route_to_locs)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [route_to_locs]"); goto end; } - OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local_nonprimitive); - if (!route_to_locsItem) { - ogs_error("No route_to_locsItem"); - OpenAPI_list_free(route_to_locsList); - goto end; + route_to_locsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(route_to_locs_local, route_to_locs) { + if (!cJSON_IsObject(route_to_locs_local)) { + ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [route_to_locs]"); + goto end; + } + OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local); + if (!route_to_locsItem) { + ogs_error("No route_to_locsItem"); + OpenAPI_list_free(route_to_locsList); + goto end; + } + OpenAPI_list_add(route_to_locsList, route_to_locsItem); } - - OpenAPI_list_add(route_to_locsList, route_to_locsItem); - } } - cJSON *traff_corre_ind = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "traffCorreInd"); - + traff_corre_ind = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "traffCorreInd"); if (traff_corre_ind) { if (!cJSON_IsBool(traff_corre_ind)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [traff_corre_ind]"); @@ -363,16 +398,12 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON } } - cJSON *up_path_chg_event = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "upPathChgEvent"); - - OpenAPI_up_path_chg_event_t *up_path_chg_event_local_nonprim = NULL; + up_path_chg_event = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "upPathChgEvent"); if (up_path_chg_event) { up_path_chg_event_local_nonprim = OpenAPI_up_path_chg_event_parseFromJSON(up_path_chg_event); } - cJSON *steer_fun = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "steerFun"); - - OpenAPI_steering_functionality_e steer_funVariable; + steer_fun = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "steerFun"); if (steer_fun) { if (!cJSON_IsString(steer_fun)) { ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [steer_fun]"); @@ -381,23 +412,17 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON steer_funVariable = OpenAPI_steering_functionality_FromString(steer_fun->valuestring); } - cJSON *steer_mode_dl = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "steerModeDl"); - - OpenAPI_steering_mode_t *steer_mode_dl_local_nonprim = NULL; + steer_mode_dl = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "steerModeDl"); if (steer_mode_dl) { steer_mode_dl_local_nonprim = OpenAPI_steering_mode_parseFromJSON(steer_mode_dl); } - cJSON *steer_mode_ul = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "steerModeUl"); - - OpenAPI_steering_mode_t *steer_mode_ul_local_nonprim = NULL; + steer_mode_ul = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "steerModeUl"); if (steer_mode_ul) { steer_mode_ul_local_nonprim = OpenAPI_steering_mode_parseFromJSON(steer_mode_ul); } - cJSON *mul_acc_ctrl = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "mulAccCtrl"); - - OpenAPI_multicast_access_control_t *mul_acc_ctrl_local_nonprim = NULL; + mul_acc_ctrl = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "mulAccCtrl"); if (mul_acc_ctrl) { mul_acc_ctrl_local_nonprim = OpenAPI_multicast_access_control_parseFromJSON(mul_acc_ctrl); } @@ -409,8 +434,8 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON add_redirect_info ? add_redirect_infoList : NULL, mute_notif ? true : false, mute_notif ? mute_notif->valueint : 0, - traffic_steering_pol_id_dl ? ogs_strdup(traffic_steering_pol_id_dl->valuestring) : NULL, - traffic_steering_pol_id_ul ? ogs_strdup(traffic_steering_pol_id_ul->valuestring) : NULL, + traffic_steering_pol_id_dl && !cJSON_IsNull(traffic_steering_pol_id_dl) ? ogs_strdup(traffic_steering_pol_id_dl->valuestring) : NULL, + traffic_steering_pol_id_ul && !cJSON_IsNull(traffic_steering_pol_id_ul) ? ogs_strdup(traffic_steering_pol_id_ul->valuestring) : NULL, route_to_locs ? route_to_locsList : NULL, traff_corre_ind ? true : false, traff_corre_ind ? traff_corre_ind->valueint : 0, @@ -423,6 +448,40 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON return traffic_control_data_local_var; end: + if (redirect_info_local_nonprim) { + OpenAPI_redirect_information_free(redirect_info_local_nonprim); + redirect_info_local_nonprim = NULL; + } + if (add_redirect_infoList) { + OpenAPI_list_for_each(add_redirect_infoList, node) { + OpenAPI_redirect_information_free(node->data); + } + OpenAPI_list_free(add_redirect_infoList); + add_redirect_infoList = NULL; + } + if (route_to_locsList) { + OpenAPI_list_for_each(route_to_locsList, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(route_to_locsList); + route_to_locsList = NULL; + } + if (up_path_chg_event_local_nonprim) { + OpenAPI_up_path_chg_event_free(up_path_chg_event_local_nonprim); + up_path_chg_event_local_nonprim = NULL; + } + if (steer_mode_dl_local_nonprim) { + OpenAPI_steering_mode_free(steer_mode_dl_local_nonprim); + steer_mode_dl_local_nonprim = NULL; + } + if (steer_mode_ul_local_nonprim) { + OpenAPI_steering_mode_free(steer_mode_ul_local_nonprim); + steer_mode_ul_local_nonprim = NULL; + } + if (mul_acc_ctrl_local_nonprim) { + OpenAPI_multicast_access_control_free(mul_acc_ctrl_local_nonprim); + mul_acc_ctrl_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/traffic_descriptor.c b/lib/sbi/openapi/model/traffic_descriptor.c index a85d175e5..9047b89ca 100644 --- a/lib/sbi/openapi/model/traffic_descriptor.c +++ b/lib/sbi/openapi/model/traffic_descriptor.c @@ -22,22 +22,33 @@ OpenAPI_traffic_descriptor_t *OpenAPI_traffic_descriptor_create( void OpenAPI_traffic_descriptor_free(OpenAPI_traffic_descriptor_t *traffic_descriptor) { + OpenAPI_lnode_t *node = NULL; + if (NULL == traffic_descriptor) { return; } - OpenAPI_lnode_t *node; - ogs_free(traffic_descriptor->dnn); - OpenAPI_snssai_free(traffic_descriptor->s_nssai); - OpenAPI_list_for_each(traffic_descriptor->ddd_traffic_descriptor_list, node) { - OpenAPI_ddd_traffic_descriptor_free(node->data); + if (traffic_descriptor->dnn) { + ogs_free(traffic_descriptor->dnn); + traffic_descriptor->dnn = NULL; + } + if (traffic_descriptor->s_nssai) { + OpenAPI_snssai_free(traffic_descriptor->s_nssai); + traffic_descriptor->s_nssai = NULL; + } + if (traffic_descriptor->ddd_traffic_descriptor_list) { + OpenAPI_list_for_each(traffic_descriptor->ddd_traffic_descriptor_list, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(traffic_descriptor->ddd_traffic_descriptor_list); + traffic_descriptor->ddd_traffic_descriptor_list = NULL; } - OpenAPI_list_free(traffic_descriptor->ddd_traffic_descriptor_list); ogs_free(traffic_descriptor); } cJSON *OpenAPI_traffic_descriptor_convertToJSON(OpenAPI_traffic_descriptor_t *traffic_descriptor) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (traffic_descriptor == NULL) { ogs_error("OpenAPI_traffic_descriptor_convertToJSON() failed [TrafficDescriptor]"); @@ -71,17 +82,13 @@ cJSON *OpenAPI_traffic_descriptor_convertToJSON(OpenAPI_traffic_descriptor_t *tr ogs_error("OpenAPI_traffic_descriptor_convertToJSON() failed [ddd_traffic_descriptor_list]"); goto end; } - - OpenAPI_lnode_t *ddd_traffic_descriptor_list_node; - if (traffic_descriptor->ddd_traffic_descriptor_list) { - OpenAPI_list_for_each(traffic_descriptor->ddd_traffic_descriptor_list, ddd_traffic_descriptor_list_node) { - cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(ddd_traffic_descriptor_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_descriptor_convertToJSON() failed [ddd_traffic_descriptor_list]"); - goto end; - } - cJSON_AddItemToArray(ddd_traffic_descriptor_listList, itemLocal); + OpenAPI_list_for_each(traffic_descriptor->ddd_traffic_descriptor_list, node) { + cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_descriptor_convertToJSON() failed [ddd_traffic_descriptor_list]"); + goto end; } + cJSON_AddItemToArray(ddd_traffic_descriptor_listList, itemLocal); } } @@ -92,59 +99,69 @@ end: OpenAPI_traffic_descriptor_t *OpenAPI_traffic_descriptor_parseFromJSON(cJSON *traffic_descriptorJSON) { OpenAPI_traffic_descriptor_t *traffic_descriptor_local_var = NULL; - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(traffic_descriptorJSON, "dnn"); - + OpenAPI_lnode_t *node = NULL; + cJSON *dnn = NULL; + cJSON *s_nssai = NULL; + OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + cJSON *ddd_traffic_descriptor_list = NULL; + OpenAPI_list_t *ddd_traffic_descriptor_listList = NULL; + dnn = cJSON_GetObjectItemCaseSensitive(traffic_descriptorJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_traffic_descriptor_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(traffic_descriptorJSON, "sNssai"); - - OpenAPI_snssai_t *s_nssai_local_nonprim = NULL; + s_nssai = cJSON_GetObjectItemCaseSensitive(traffic_descriptorJSON, "sNssai"); if (s_nssai) { s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai); } - cJSON *ddd_traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(traffic_descriptorJSON, "dddTrafficDescriptorList"); - - OpenAPI_list_t *ddd_traffic_descriptor_listList; + ddd_traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(traffic_descriptorJSON, "dddTrafficDescriptorList"); if (ddd_traffic_descriptor_list) { - cJSON *ddd_traffic_descriptor_list_local_nonprimitive; - if (!cJSON_IsArray(ddd_traffic_descriptor_list)){ - ogs_error("OpenAPI_traffic_descriptor_parseFromJSON() failed [ddd_traffic_descriptor_list]"); - goto end; - } - - ddd_traffic_descriptor_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ddd_traffic_descriptor_list_local_nonprimitive, ddd_traffic_descriptor_list ) { - if (!cJSON_IsObject(ddd_traffic_descriptor_list_local_nonprimitive)) { + cJSON *ddd_traffic_descriptor_list_local = NULL; + if (!cJSON_IsArray(ddd_traffic_descriptor_list)) { ogs_error("OpenAPI_traffic_descriptor_parseFromJSON() failed [ddd_traffic_descriptor_list]"); goto end; } - OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_listItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_descriptor_list_local_nonprimitive); - if (!ddd_traffic_descriptor_listItem) { - ogs_error("No ddd_traffic_descriptor_listItem"); - OpenAPI_list_free(ddd_traffic_descriptor_listList); - goto end; + ddd_traffic_descriptor_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ddd_traffic_descriptor_list_local, ddd_traffic_descriptor_list) { + if (!cJSON_IsObject(ddd_traffic_descriptor_list_local)) { + ogs_error("OpenAPI_traffic_descriptor_parseFromJSON() failed [ddd_traffic_descriptor_list]"); + goto end; + } + OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_listItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_descriptor_list_local); + if (!ddd_traffic_descriptor_listItem) { + ogs_error("No ddd_traffic_descriptor_listItem"); + OpenAPI_list_free(ddd_traffic_descriptor_listList); + goto end; + } + OpenAPI_list_add(ddd_traffic_descriptor_listList, ddd_traffic_descriptor_listItem); } - - OpenAPI_list_add(ddd_traffic_descriptor_listList, ddd_traffic_descriptor_listItem); - } } traffic_descriptor_local_var = OpenAPI_traffic_descriptor_create ( - dnn ? ogs_strdup(dnn->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, s_nssai ? s_nssai_local_nonprim : NULL, ddd_traffic_descriptor_list ? ddd_traffic_descriptor_listList : NULL ); return traffic_descriptor_local_var; end: + if (s_nssai_local_nonprim) { + OpenAPI_snssai_free(s_nssai_local_nonprim); + s_nssai_local_nonprim = NULL; + } + if (ddd_traffic_descriptor_listList) { + OpenAPI_list_for_each(ddd_traffic_descriptor_listList, node) { + OpenAPI_ddd_traffic_descriptor_free(node->data); + } + OpenAPI_list_free(ddd_traffic_descriptor_listList); + ddd_traffic_descriptor_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/traffic_influ_data.c b/lib/sbi/openapi/model/traffic_influ_data.c index cf0fd159e..0ccef378b 100644 --- a/lib/sbi/openapi/model/traffic_influ_data.c +++ b/lib/sbi/openapi/model/traffic_influ_data.c @@ -70,52 +70,108 @@ OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_create( void OpenAPI_traffic_influ_data_free(OpenAPI_traffic_influ_data_t *traffic_influ_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == traffic_influ_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(traffic_influ_data->up_path_chg_notif_corre_id); - ogs_free(traffic_influ_data->af_app_id); - ogs_free(traffic_influ_data->dnn); - OpenAPI_list_for_each(traffic_influ_data->eth_traffic_filters, node) { - OpenAPI_eth_flow_description_free(node->data); + if (traffic_influ_data->up_path_chg_notif_corre_id) { + ogs_free(traffic_influ_data->up_path_chg_notif_corre_id); + traffic_influ_data->up_path_chg_notif_corre_id = NULL; } - OpenAPI_list_free(traffic_influ_data->eth_traffic_filters); - OpenAPI_snssai_free(traffic_influ_data->snssai); - ogs_free(traffic_influ_data->inter_group_id); - ogs_free(traffic_influ_data->supi); - OpenAPI_list_for_each(traffic_influ_data->traffic_filters, node) { - OpenAPI_flow_info_free(node->data); + if (traffic_influ_data->af_app_id) { + ogs_free(traffic_influ_data->af_app_id); + traffic_influ_data->af_app_id = NULL; } - OpenAPI_list_free(traffic_influ_data->traffic_filters); - OpenAPI_list_for_each(traffic_influ_data->traffic_routes, node) { - OpenAPI_route_to_location_free(node->data); + if (traffic_influ_data->dnn) { + ogs_free(traffic_influ_data->dnn); + traffic_influ_data->dnn = NULL; } - OpenAPI_list_free(traffic_influ_data->traffic_routes); - ogs_free(traffic_influ_data->valid_start_time); - ogs_free(traffic_influ_data->valid_end_time); - OpenAPI_list_for_each(traffic_influ_data->temp_validities, node) { - OpenAPI_temporal_validity_free(node->data); + if (traffic_influ_data->eth_traffic_filters) { + OpenAPI_list_for_each(traffic_influ_data->eth_traffic_filters, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->eth_traffic_filters); + traffic_influ_data->eth_traffic_filters = NULL; } - OpenAPI_list_free(traffic_influ_data->temp_validities); - OpenAPI_network_area_info_1_free(traffic_influ_data->nw_area_info); - ogs_free(traffic_influ_data->up_path_chg_notif_uri); - OpenAPI_list_for_each(traffic_influ_data->headers, node) { - ogs_free(node->data); + if (traffic_influ_data->snssai) { + OpenAPI_snssai_free(traffic_influ_data->snssai); + traffic_influ_data->snssai = NULL; } - OpenAPI_list_free(traffic_influ_data->headers); - OpenAPI_list_for_each(traffic_influ_data->subscribed_events, node) { - OpenAPI_subscribed_event_free(node->data); + if (traffic_influ_data->inter_group_id) { + ogs_free(traffic_influ_data->inter_group_id); + traffic_influ_data->inter_group_id = NULL; + } + if (traffic_influ_data->supi) { + ogs_free(traffic_influ_data->supi); + traffic_influ_data->supi = NULL; + } + if (traffic_influ_data->traffic_filters) { + OpenAPI_list_for_each(traffic_influ_data->traffic_filters, node) { + OpenAPI_flow_info_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->traffic_filters); + traffic_influ_data->traffic_filters = NULL; + } + if (traffic_influ_data->traffic_routes) { + OpenAPI_list_for_each(traffic_influ_data->traffic_routes, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->traffic_routes); + traffic_influ_data->traffic_routes = NULL; + } + if (traffic_influ_data->valid_start_time) { + ogs_free(traffic_influ_data->valid_start_time); + traffic_influ_data->valid_start_time = NULL; + } + if (traffic_influ_data->valid_end_time) { + ogs_free(traffic_influ_data->valid_end_time); + traffic_influ_data->valid_end_time = NULL; + } + if (traffic_influ_data->temp_validities) { + OpenAPI_list_for_each(traffic_influ_data->temp_validities, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->temp_validities); + traffic_influ_data->temp_validities = NULL; + } + if (traffic_influ_data->nw_area_info) { + OpenAPI_network_area_info_1_free(traffic_influ_data->nw_area_info); + traffic_influ_data->nw_area_info = NULL; + } + if (traffic_influ_data->up_path_chg_notif_uri) { + ogs_free(traffic_influ_data->up_path_chg_notif_uri); + traffic_influ_data->up_path_chg_notif_uri = NULL; + } + if (traffic_influ_data->headers) { + OpenAPI_list_for_each(traffic_influ_data->headers, node) { + ogs_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->headers); + traffic_influ_data->headers = NULL; + } + if (traffic_influ_data->subscribed_events) { + OpenAPI_list_for_each(traffic_influ_data->subscribed_events, node) { + OpenAPI_subscribed_event_free(node->data); + } + OpenAPI_list_free(traffic_influ_data->subscribed_events); + traffic_influ_data->subscribed_events = NULL; + } + if (traffic_influ_data->supported_features) { + ogs_free(traffic_influ_data->supported_features); + traffic_influ_data->supported_features = NULL; + } + if (traffic_influ_data->res_uri) { + ogs_free(traffic_influ_data->res_uri); + traffic_influ_data->res_uri = NULL; } - OpenAPI_list_free(traffic_influ_data->subscribed_events); - ogs_free(traffic_influ_data->supported_features); - ogs_free(traffic_influ_data->res_uri); ogs_free(traffic_influ_data); } cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *traffic_influ_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (traffic_influ_data == NULL) { ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [TrafficInfluData]"); @@ -157,17 +213,13 @@ cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *tr ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [eth_traffic_filters]"); goto end; } - - OpenAPI_lnode_t *eth_traffic_filters_node; - if (traffic_influ_data->eth_traffic_filters) { - OpenAPI_list_for_each(traffic_influ_data->eth_traffic_filters, eth_traffic_filters_node) { - cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(eth_traffic_filters_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [eth_traffic_filters]"); - goto end; - } - cJSON_AddItemToArray(eth_traffic_filtersList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data->eth_traffic_filters, node) { + cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [eth_traffic_filters]"); + goto end; } + cJSON_AddItemToArray(eth_traffic_filtersList, itemLocal); } } @@ -204,17 +256,13 @@ cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *tr ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_filters]"); goto end; } - - OpenAPI_lnode_t *traffic_filters_node; - if (traffic_influ_data->traffic_filters) { - OpenAPI_list_for_each(traffic_influ_data->traffic_filters, traffic_filters_node) { - cJSON *itemLocal = OpenAPI_flow_info_convertToJSON(traffic_filters_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_filters]"); - goto end; - } - cJSON_AddItemToArray(traffic_filtersList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data->traffic_filters, node) { + cJSON *itemLocal = OpenAPI_flow_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_filters]"); + goto end; } + cJSON_AddItemToArray(traffic_filtersList, itemLocal); } } @@ -224,17 +272,13 @@ cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *tr ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_routes]"); goto end; } - - OpenAPI_lnode_t *traffic_routes_node; - if (traffic_influ_data->traffic_routes) { - OpenAPI_list_for_each(traffic_influ_data->traffic_routes, traffic_routes_node) { - cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(traffic_routes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_routes]"); - goto end; - } - cJSON_AddItemToArray(traffic_routesList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data->traffic_routes, node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [traffic_routes]"); + goto end; } + cJSON_AddItemToArray(traffic_routesList, itemLocal); } } @@ -265,17 +309,13 @@ cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *tr ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [temp_validities]"); goto end; } - - OpenAPI_lnode_t *temp_validities_node; - if (traffic_influ_data->temp_validities) { - OpenAPI_list_for_each(traffic_influ_data->temp_validities, temp_validities_node) { - cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(temp_validities_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [temp_validities]"); - goto end; - } - cJSON_AddItemToArray(temp_validitiesList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data->temp_validities, node) { + cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [temp_validities]"); + goto end; } + cJSON_AddItemToArray(temp_validitiesList, itemLocal); } } @@ -300,19 +340,17 @@ cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *tr } if (traffic_influ_data->headers) { - cJSON *headers = cJSON_AddArrayToObject(item, "headers"); - if (headers == NULL) { + cJSON *headersList = cJSON_AddArrayToObject(item, "headers"); + if (headersList == NULL) { ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [headers]"); goto end; } - - OpenAPI_lnode_t *headers_node; - OpenAPI_list_for_each(traffic_influ_data->headers, headers_node) { - if (cJSON_AddStringToObject(headers, "", (char*)headers_node->data) == NULL) { - ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [headers]"); - goto end; + OpenAPI_list_for_each(traffic_influ_data->headers, node) { + if (cJSON_AddStringToObject(headersList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [headers]"); + goto end; + } } - } } if (traffic_influ_data->subscribed_events) { @@ -321,21 +359,17 @@ cJSON *OpenAPI_traffic_influ_data_convertToJSON(OpenAPI_traffic_influ_data_t *tr ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [subscribed_events]"); goto end; } - - OpenAPI_lnode_t *subscribed_events_node; - if (traffic_influ_data->subscribed_events) { - OpenAPI_list_for_each(traffic_influ_data->subscribed_events, subscribed_events_node) { - cJSON *itemLocal = OpenAPI_subscribed_event_convertToJSON(subscribed_events_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [subscribed_events]"); - goto end; - } - cJSON_AddItemToArray(subscribed_eventsList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data->subscribed_events, node) { + cJSON *itemLocal = OpenAPI_subscribed_event_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [subscribed_events]"); + goto end; } + cJSON_AddItemToArray(subscribed_eventsList, itemLocal); } } - if (traffic_influ_data->dnai_chg_type) { + if (traffic_influ_data->dnai_chg_type != OpenAPI_dnai_change_type_NULL) { if (cJSON_AddStringToObject(item, "dnaiChgType", OpenAPI_dnai_change_type_ToString(traffic_influ_data->dnai_chg_type)) == NULL) { ogs_error("OpenAPI_traffic_influ_data_convertToJSON() failed [dnai_chg_type]"); goto end; @@ -377,17 +411,48 @@ end: OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *traffic_influ_dataJSON) { OpenAPI_traffic_influ_data_t *traffic_influ_data_local_var = NULL; - cJSON *up_path_chg_notif_corre_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "upPathChgNotifCorreId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *up_path_chg_notif_corre_id = NULL; + cJSON *app_relo_ind = NULL; + cJSON *af_app_id = NULL; + cJSON *dnn = NULL; + cJSON *eth_traffic_filters = NULL; + OpenAPI_list_t *eth_traffic_filtersList = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *inter_group_id = NULL; + cJSON *supi = NULL; + cJSON *traffic_filters = NULL; + OpenAPI_list_t *traffic_filtersList = NULL; + cJSON *traffic_routes = NULL; + OpenAPI_list_t *traffic_routesList = NULL; + cJSON *traff_corre_ind = NULL; + cJSON *valid_start_time = NULL; + cJSON *valid_end_time = NULL; + cJSON *temp_validities = NULL; + OpenAPI_list_t *temp_validitiesList = NULL; + cJSON *nw_area_info = NULL; + OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL; + cJSON *up_path_chg_notif_uri = NULL; + cJSON *headers = NULL; + OpenAPI_list_t *headersList = NULL; + cJSON *subscribed_events = NULL; + OpenAPI_list_t *subscribed_eventsList = NULL; + cJSON *dnai_chg_type = NULL; + OpenAPI_dnai_change_type_e dnai_chg_typeVariable = 0; + cJSON *af_ack_ind = NULL; + cJSON *addr_preser_ind = NULL; + cJSON *supported_features = NULL; + cJSON *res_uri = NULL; + up_path_chg_notif_corre_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "upPathChgNotifCorreId"); if (up_path_chg_notif_corre_id) { - if (!cJSON_IsString(up_path_chg_notif_corre_id)) { + if (!cJSON_IsString(up_path_chg_notif_corre_id) && !cJSON_IsNull(up_path_chg_notif_corre_id)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [up_path_chg_notif_corre_id]"); goto end; } } - cJSON *app_relo_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "appReloInd"); - + app_relo_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "appReloInd"); if (app_relo_ind) { if (!cJSON_IsBool(app_relo_ind)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [app_relo_ind]"); @@ -395,138 +460,119 @@ OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *tr } } - cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "afAppId"); - + af_app_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "afAppId"); if (af_app_id) { - if (!cJSON_IsString(af_app_id)) { + if (!cJSON_IsString(af_app_id) && !cJSON_IsNull(af_app_id)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [af_app_id]"); goto end; } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *eth_traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "ethTrafficFilters"); - - OpenAPI_list_t *eth_traffic_filtersList; + eth_traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "ethTrafficFilters"); if (eth_traffic_filters) { - cJSON *eth_traffic_filters_local_nonprimitive; - if (!cJSON_IsArray(eth_traffic_filters)){ - ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [eth_traffic_filters]"); - goto end; - } - - eth_traffic_filtersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eth_traffic_filters_local_nonprimitive, eth_traffic_filters ) { - if (!cJSON_IsObject(eth_traffic_filters_local_nonprimitive)) { + cJSON *eth_traffic_filters_local = NULL; + if (!cJSON_IsArray(eth_traffic_filters)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [eth_traffic_filters]"); goto end; } - OpenAPI_eth_flow_description_t *eth_traffic_filtersItem = OpenAPI_eth_flow_description_parseFromJSON(eth_traffic_filters_local_nonprimitive); - if (!eth_traffic_filtersItem) { - ogs_error("No eth_traffic_filtersItem"); - OpenAPI_list_free(eth_traffic_filtersList); - goto end; + eth_traffic_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eth_traffic_filters_local, eth_traffic_filters) { + if (!cJSON_IsObject(eth_traffic_filters_local)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [eth_traffic_filters]"); + goto end; + } + OpenAPI_eth_flow_description_t *eth_traffic_filtersItem = OpenAPI_eth_flow_description_parseFromJSON(eth_traffic_filters_local); + if (!eth_traffic_filtersItem) { + ogs_error("No eth_traffic_filtersItem"); + OpenAPI_list_free(eth_traffic_filtersList); + goto end; + } + OpenAPI_list_add(eth_traffic_filtersList, eth_traffic_filtersItem); } - - OpenAPI_list_add(eth_traffic_filtersList, eth_traffic_filtersItem); - } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "snssai"); - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "snssai"); if (snssai) { snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); } - cJSON *inter_group_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "interGroupId"); - + inter_group_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "interGroupId"); if (inter_group_id) { - if (!cJSON_IsString(inter_group_id)) { + if (!cJSON_IsString(inter_group_id) && !cJSON_IsNull(inter_group_id)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [inter_group_id]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "trafficFilters"); - - OpenAPI_list_t *traffic_filtersList; + traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "trafficFilters"); if (traffic_filters) { - cJSON *traffic_filters_local_nonprimitive; - if (!cJSON_IsArray(traffic_filters)){ - ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_filters]"); - goto end; - } - - traffic_filtersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(traffic_filters_local_nonprimitive, traffic_filters ) { - if (!cJSON_IsObject(traffic_filters_local_nonprimitive)) { + cJSON *traffic_filters_local = NULL; + if (!cJSON_IsArray(traffic_filters)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_filters]"); goto end; } - OpenAPI_flow_info_t *traffic_filtersItem = OpenAPI_flow_info_parseFromJSON(traffic_filters_local_nonprimitive); - if (!traffic_filtersItem) { - ogs_error("No traffic_filtersItem"); - OpenAPI_list_free(traffic_filtersList); - goto end; + traffic_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_filters_local, traffic_filters) { + if (!cJSON_IsObject(traffic_filters_local)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_filters]"); + goto end; + } + OpenAPI_flow_info_t *traffic_filtersItem = OpenAPI_flow_info_parseFromJSON(traffic_filters_local); + if (!traffic_filtersItem) { + ogs_error("No traffic_filtersItem"); + OpenAPI_list_free(traffic_filtersList); + goto end; + } + OpenAPI_list_add(traffic_filtersList, traffic_filtersItem); } - - OpenAPI_list_add(traffic_filtersList, traffic_filtersItem); - } } - cJSON *traffic_routes = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "trafficRoutes"); - - OpenAPI_list_t *traffic_routesList; + traffic_routes = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "trafficRoutes"); if (traffic_routes) { - cJSON *traffic_routes_local_nonprimitive; - if (!cJSON_IsArray(traffic_routes)){ - ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_routes]"); - goto end; - } - - traffic_routesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(traffic_routes_local_nonprimitive, traffic_routes ) { - if (!cJSON_IsObject(traffic_routes_local_nonprimitive)) { + cJSON *traffic_routes_local = NULL; + if (!cJSON_IsArray(traffic_routes)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_routes]"); goto end; } - OpenAPI_route_to_location_t *traffic_routesItem = OpenAPI_route_to_location_parseFromJSON(traffic_routes_local_nonprimitive); - if (!traffic_routesItem) { - ogs_error("No traffic_routesItem"); - OpenAPI_list_free(traffic_routesList); - goto end; + traffic_routesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_routes_local, traffic_routes) { + if (!cJSON_IsObject(traffic_routes_local)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traffic_routes]"); + goto end; + } + OpenAPI_route_to_location_t *traffic_routesItem = OpenAPI_route_to_location_parseFromJSON(traffic_routes_local); + if (!traffic_routesItem) { + ogs_error("No traffic_routesItem"); + OpenAPI_list_free(traffic_routesList); + goto end; + } + OpenAPI_list_add(traffic_routesList, traffic_routesItem); } - - OpenAPI_list_add(traffic_routesList, traffic_routesItem); - } } - cJSON *traff_corre_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "traffCorreInd"); - + traff_corre_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "traffCorreInd"); if (traff_corre_ind) { if (!cJSON_IsBool(traff_corre_ind)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [traff_corre_ind]"); @@ -534,121 +580,107 @@ OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *tr } } - cJSON *valid_start_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "validStartTime"); - + valid_start_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "validStartTime"); if (valid_start_time) { - if (!cJSON_IsString(valid_start_time)) { + if (!cJSON_IsString(valid_start_time) && !cJSON_IsNull(valid_start_time)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [valid_start_time]"); goto end; } } - cJSON *valid_end_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "validEndTime"); - + valid_end_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "validEndTime"); if (valid_end_time) { - if (!cJSON_IsString(valid_end_time)) { + if (!cJSON_IsString(valid_end_time) && !cJSON_IsNull(valid_end_time)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [valid_end_time]"); goto end; } } - cJSON *temp_validities = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "tempValidities"); - - OpenAPI_list_t *temp_validitiesList; + temp_validities = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "tempValidities"); if (temp_validities) { - cJSON *temp_validities_local_nonprimitive; - if (!cJSON_IsArray(temp_validities)){ - ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [temp_validities]"); - goto end; - } - - temp_validitiesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(temp_validities_local_nonprimitive, temp_validities ) { - if (!cJSON_IsObject(temp_validities_local_nonprimitive)) { + cJSON *temp_validities_local = NULL; + if (!cJSON_IsArray(temp_validities)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [temp_validities]"); goto end; } - OpenAPI_temporal_validity_t *temp_validitiesItem = OpenAPI_temporal_validity_parseFromJSON(temp_validities_local_nonprimitive); - if (!temp_validitiesItem) { - ogs_error("No temp_validitiesItem"); - OpenAPI_list_free(temp_validitiesList); - goto end; + temp_validitiesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(temp_validities_local, temp_validities) { + if (!cJSON_IsObject(temp_validities_local)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [temp_validities]"); + goto end; + } + OpenAPI_temporal_validity_t *temp_validitiesItem = OpenAPI_temporal_validity_parseFromJSON(temp_validities_local); + if (!temp_validitiesItem) { + ogs_error("No temp_validitiesItem"); + OpenAPI_list_free(temp_validitiesList); + goto end; + } + OpenAPI_list_add(temp_validitiesList, temp_validitiesItem); } - - OpenAPI_list_add(temp_validitiesList, temp_validitiesItem); - } } - cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "nwAreaInfo"); - - OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL; + nw_area_info = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "nwAreaInfo"); if (nw_area_info) { nw_area_info_local_nonprim = OpenAPI_network_area_info_1_parseFromJSON(nw_area_info); } - cJSON *up_path_chg_notif_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "upPathChgNotifUri"); - + up_path_chg_notif_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "upPathChgNotifUri"); if (up_path_chg_notif_uri) { - if (!cJSON_IsString(up_path_chg_notif_uri)) { + if (!cJSON_IsString(up_path_chg_notif_uri) && !cJSON_IsNull(up_path_chg_notif_uri)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [up_path_chg_notif_uri]"); goto end; } } - cJSON *headers = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "headers"); - - OpenAPI_list_t *headersList; + headers = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "headers"); if (headers) { - cJSON *headers_local; - if (!cJSON_IsArray(headers)) { - ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [headers]"); - goto end; - } - headersList = OpenAPI_list_create(); + cJSON *headers_local = NULL; + if (!cJSON_IsArray(headers)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [headers]"); + goto end; + } - cJSON_ArrayForEach(headers_local, headers) { - if (!cJSON_IsString(headers_local)) { - ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [headers]"); - goto end; - } - OpenAPI_list_add(headersList, ogs_strdup(headers_local->valuestring)); - } + headersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(headers_local, headers) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(headers_local)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [headers]"); + goto end; + } + OpenAPI_list_add(headersList, ogs_strdup(headers_local->valuestring)); + } } - cJSON *subscribed_events = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "subscribedEvents"); - - OpenAPI_list_t *subscribed_eventsList; + subscribed_events = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "subscribedEvents"); if (subscribed_events) { - cJSON *subscribed_events_local_nonprimitive; - if (!cJSON_IsArray(subscribed_events)){ - ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [subscribed_events]"); - goto end; - } - - subscribed_eventsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(subscribed_events_local_nonprimitive, subscribed_events ) { - if (!cJSON_IsObject(subscribed_events_local_nonprimitive)) { + cJSON *subscribed_events_local = NULL; + if (!cJSON_IsArray(subscribed_events)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [subscribed_events]"); goto end; } - OpenAPI_subscribed_event_t *subscribed_eventsItem = OpenAPI_subscribed_event_parseFromJSON(subscribed_events_local_nonprimitive); - if (!subscribed_eventsItem) { - ogs_error("No subscribed_eventsItem"); - OpenAPI_list_free(subscribed_eventsList); - goto end; + subscribed_eventsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subscribed_events_local, subscribed_events) { + if (!cJSON_IsObject(subscribed_events_local)) { + ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [subscribed_events]"); + goto end; + } + OpenAPI_subscribed_event_t *subscribed_eventsItem = OpenAPI_subscribed_event_parseFromJSON(subscribed_events_local); + if (!subscribed_eventsItem) { + ogs_error("No subscribed_eventsItem"); + OpenAPI_list_free(subscribed_eventsList); + goto end; + } + OpenAPI_list_add(subscribed_eventsList, subscribed_eventsItem); } - - OpenAPI_list_add(subscribed_eventsList, subscribed_eventsItem); - } } - cJSON *dnai_chg_type = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "dnaiChgType"); - - OpenAPI_dnai_change_type_e dnai_chg_typeVariable; + dnai_chg_type = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "dnaiChgType"); if (dnai_chg_type) { if (!cJSON_IsString(dnai_chg_type)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [dnai_chg_type]"); @@ -657,8 +689,7 @@ OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *tr dnai_chg_typeVariable = OpenAPI_dnai_change_type_FromString(dnai_chg_type->valuestring); } - cJSON *af_ack_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "afAckInd"); - + af_ack_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "afAckInd"); if (af_ack_ind) { if (!cJSON_IsBool(af_ack_ind)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [af_ack_ind]"); @@ -666,8 +697,7 @@ OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *tr } } - cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "addrPreserInd"); - + addr_preser_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "addrPreserInd"); if (addr_preser_ind) { if (!cJSON_IsBool(addr_preser_ind)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [addr_preser_ind]"); @@ -675,43 +705,41 @@ OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *tr } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "resUri"); - + res_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_dataJSON, "resUri"); if (res_uri) { - if (!cJSON_IsString(res_uri)) { + if (!cJSON_IsString(res_uri) && !cJSON_IsNull(res_uri)) { ogs_error("OpenAPI_traffic_influ_data_parseFromJSON() failed [res_uri]"); goto end; } } traffic_influ_data_local_var = OpenAPI_traffic_influ_data_create ( - up_path_chg_notif_corre_id ? ogs_strdup(up_path_chg_notif_corre_id->valuestring) : NULL, + up_path_chg_notif_corre_id && !cJSON_IsNull(up_path_chg_notif_corre_id) ? ogs_strdup(up_path_chg_notif_corre_id->valuestring) : NULL, app_relo_ind ? true : false, app_relo_ind ? app_relo_ind->valueint : 0, - af_app_id ? ogs_strdup(af_app_id->valuestring) : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + af_app_id && !cJSON_IsNull(af_app_id) ? ogs_strdup(af_app_id->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, eth_traffic_filters ? eth_traffic_filtersList : NULL, snssai ? snssai_local_nonprim : NULL, - inter_group_id ? ogs_strdup(inter_group_id->valuestring) : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL, + inter_group_id && !cJSON_IsNull(inter_group_id) ? ogs_strdup(inter_group_id->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, traffic_filters ? traffic_filtersList : NULL, traffic_routes ? traffic_routesList : NULL, traff_corre_ind ? true : false, traff_corre_ind ? traff_corre_ind->valueint : 0, - valid_start_time ? ogs_strdup(valid_start_time->valuestring) : NULL, - valid_end_time ? ogs_strdup(valid_end_time->valuestring) : NULL, + valid_start_time && !cJSON_IsNull(valid_start_time) ? ogs_strdup(valid_start_time->valuestring) : NULL, + valid_end_time && !cJSON_IsNull(valid_end_time) ? ogs_strdup(valid_end_time->valuestring) : NULL, temp_validities ? temp_validitiesList : NULL, nw_area_info ? nw_area_info_local_nonprim : NULL, - up_path_chg_notif_uri ? ogs_strdup(up_path_chg_notif_uri->valuestring) : NULL, + up_path_chg_notif_uri && !cJSON_IsNull(up_path_chg_notif_uri) ? ogs_strdup(up_path_chg_notif_uri->valuestring) : NULL, headers ? headersList : NULL, subscribed_events ? subscribed_eventsList : NULL, dnai_chg_type ? dnai_chg_typeVariable : 0, @@ -719,12 +747,62 @@ OpenAPI_traffic_influ_data_t *OpenAPI_traffic_influ_data_parseFromJSON(cJSON *tr af_ack_ind ? af_ack_ind->valueint : 0, addr_preser_ind ? true : false, addr_preser_ind ? addr_preser_ind->valueint : 0, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, - res_uri ? ogs_strdup(res_uri->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, + res_uri && !cJSON_IsNull(res_uri) ? ogs_strdup(res_uri->valuestring) : NULL ); return traffic_influ_data_local_var; end: + if (eth_traffic_filtersList) { + OpenAPI_list_for_each(eth_traffic_filtersList, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(eth_traffic_filtersList); + eth_traffic_filtersList = NULL; + } + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (traffic_filtersList) { + OpenAPI_list_for_each(traffic_filtersList, node) { + OpenAPI_flow_info_free(node->data); + } + OpenAPI_list_free(traffic_filtersList); + traffic_filtersList = NULL; + } + if (traffic_routesList) { + OpenAPI_list_for_each(traffic_routesList, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(traffic_routesList); + traffic_routesList = NULL; + } + if (temp_validitiesList) { + OpenAPI_list_for_each(temp_validitiesList, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(temp_validitiesList); + temp_validitiesList = NULL; + } + if (nw_area_info_local_nonprim) { + OpenAPI_network_area_info_1_free(nw_area_info_local_nonprim); + nw_area_info_local_nonprim = NULL; + } + if (headersList) { + OpenAPI_list_for_each(headersList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(headersList); + headersList = NULL; + } + if (subscribed_eventsList) { + OpenAPI_list_for_each(subscribed_eventsList, node) { + OpenAPI_subscribed_event_free(node->data); + } + OpenAPI_list_free(subscribed_eventsList); + subscribed_eventsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/traffic_influ_data_notif.c b/lib/sbi/openapi/model/traffic_influ_data_notif.c index f92376f64..748c9e36f 100644 --- a/lib/sbi/openapi/model/traffic_influ_data_notif.c +++ b/lib/sbi/openapi/model/traffic_influ_data_notif.c @@ -20,18 +20,26 @@ OpenAPI_traffic_influ_data_notif_t *OpenAPI_traffic_influ_data_notif_create( void OpenAPI_traffic_influ_data_notif_free(OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif) { + OpenAPI_lnode_t *node = NULL; + if (NULL == traffic_influ_data_notif) { return; } - OpenAPI_lnode_t *node; - ogs_free(traffic_influ_data_notif->res_uri); - OpenAPI_traffic_influ_data_free(traffic_influ_data_notif->traffic_influ_data); + if (traffic_influ_data_notif->res_uri) { + ogs_free(traffic_influ_data_notif->res_uri); + traffic_influ_data_notif->res_uri = NULL; + } + if (traffic_influ_data_notif->traffic_influ_data) { + OpenAPI_traffic_influ_data_free(traffic_influ_data_notif->traffic_influ_data); + traffic_influ_data_notif->traffic_influ_data = NULL; + } ogs_free(traffic_influ_data_notif); } cJSON *OpenAPI_traffic_influ_data_notif_convertToJSON(OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (traffic_influ_data_notif == NULL) { ogs_error("OpenAPI_traffic_influ_data_notif_convertToJSON() failed [TrafficInfluDataNotif]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_traffic_influ_data_notif_convertToJSON(OpenAPI_traffic_influ_data } item = cJSON_CreateObject(); + if (!traffic_influ_data_notif->res_uri) { + ogs_error("OpenAPI_traffic_influ_data_notif_convertToJSON() failed [res_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "resUri", traffic_influ_data_notif->res_uri) == NULL) { ogs_error("OpenAPI_traffic_influ_data_notif_convertToJSON() failed [res_uri]"); goto end; @@ -64,20 +76,21 @@ end: OpenAPI_traffic_influ_data_notif_t *OpenAPI_traffic_influ_data_notif_parseFromJSON(cJSON *traffic_influ_data_notifJSON) { OpenAPI_traffic_influ_data_notif_t *traffic_influ_data_notif_local_var = NULL; - cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_notifJSON, "resUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *res_uri = NULL; + cJSON *traffic_influ_data = NULL; + OpenAPI_traffic_influ_data_t *traffic_influ_data_local_nonprim = NULL; + res_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_notifJSON, "resUri"); if (!res_uri) { ogs_error("OpenAPI_traffic_influ_data_notif_parseFromJSON() failed [res_uri]"); goto end; } - if (!cJSON_IsString(res_uri)) { ogs_error("OpenAPI_traffic_influ_data_notif_parseFromJSON() failed [res_uri]"); goto end; } - cJSON *traffic_influ_data = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_notifJSON, "trafficInfluData"); - - OpenAPI_traffic_influ_data_t *traffic_influ_data_local_nonprim = NULL; + traffic_influ_data = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_notifJSON, "trafficInfluData"); if (traffic_influ_data) { traffic_influ_data_local_nonprim = OpenAPI_traffic_influ_data_parseFromJSON(traffic_influ_data); } @@ -89,6 +102,10 @@ OpenAPI_traffic_influ_data_notif_t *OpenAPI_traffic_influ_data_notif_parseFromJS return traffic_influ_data_notif_local_var; end: + if (traffic_influ_data_local_nonprim) { + OpenAPI_traffic_influ_data_free(traffic_influ_data_local_nonprim); + traffic_influ_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/traffic_influ_data_patch.c b/lib/sbi/openapi/model/traffic_influ_data_patch.c index d61bde192..8b67f573a 100644 --- a/lib/sbi/openapi/model/traffic_influ_data_patch.c +++ b/lib/sbi/openapi/model/traffic_influ_data_patch.c @@ -60,45 +60,89 @@ OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_create( void OpenAPI_traffic_influ_data_patch_free(OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == traffic_influ_data_patch) { return; } - OpenAPI_lnode_t *node; - ogs_free(traffic_influ_data_patch->up_path_chg_notif_corre_id); - ogs_free(traffic_influ_data_patch->dnn); - OpenAPI_list_for_each(traffic_influ_data_patch->eth_traffic_filters, node) { - OpenAPI_eth_flow_description_free(node->data); + if (traffic_influ_data_patch->up_path_chg_notif_corre_id) { + ogs_free(traffic_influ_data_patch->up_path_chg_notif_corre_id); + traffic_influ_data_patch->up_path_chg_notif_corre_id = NULL; } - OpenAPI_list_free(traffic_influ_data_patch->eth_traffic_filters); - OpenAPI_snssai_free(traffic_influ_data_patch->snssai); - ogs_free(traffic_influ_data_patch->internal_group_id); - ogs_free(traffic_influ_data_patch->supi); - OpenAPI_list_for_each(traffic_influ_data_patch->traffic_filters, node) { - OpenAPI_flow_info_free(node->data); + if (traffic_influ_data_patch->dnn) { + ogs_free(traffic_influ_data_patch->dnn); + traffic_influ_data_patch->dnn = NULL; } - OpenAPI_list_free(traffic_influ_data_patch->traffic_filters); - OpenAPI_list_for_each(traffic_influ_data_patch->traffic_routes, node) { - OpenAPI_route_to_location_free(node->data); + if (traffic_influ_data_patch->eth_traffic_filters) { + OpenAPI_list_for_each(traffic_influ_data_patch->eth_traffic_filters, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->eth_traffic_filters); + traffic_influ_data_patch->eth_traffic_filters = NULL; } - OpenAPI_list_free(traffic_influ_data_patch->traffic_routes); - ogs_free(traffic_influ_data_patch->valid_start_time); - ogs_free(traffic_influ_data_patch->valid_end_time); - OpenAPI_list_for_each(traffic_influ_data_patch->temp_validities, node) { - OpenAPI_temporal_validity_free(node->data); + if (traffic_influ_data_patch->snssai) { + OpenAPI_snssai_free(traffic_influ_data_patch->snssai); + traffic_influ_data_patch->snssai = NULL; } - OpenAPI_list_free(traffic_influ_data_patch->temp_validities); - OpenAPI_network_area_info_1_free(traffic_influ_data_patch->nw_area_info); - ogs_free(traffic_influ_data_patch->up_path_chg_notif_uri); - OpenAPI_list_for_each(traffic_influ_data_patch->headers, node) { - ogs_free(node->data); + if (traffic_influ_data_patch->internal_group_id) { + ogs_free(traffic_influ_data_patch->internal_group_id); + traffic_influ_data_patch->internal_group_id = NULL; + } + if (traffic_influ_data_patch->supi) { + ogs_free(traffic_influ_data_patch->supi); + traffic_influ_data_patch->supi = NULL; + } + if (traffic_influ_data_patch->traffic_filters) { + OpenAPI_list_for_each(traffic_influ_data_patch->traffic_filters, node) { + OpenAPI_flow_info_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->traffic_filters); + traffic_influ_data_patch->traffic_filters = NULL; + } + if (traffic_influ_data_patch->traffic_routes) { + OpenAPI_list_for_each(traffic_influ_data_patch->traffic_routes, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->traffic_routes); + traffic_influ_data_patch->traffic_routes = NULL; + } + if (traffic_influ_data_patch->valid_start_time) { + ogs_free(traffic_influ_data_patch->valid_start_time); + traffic_influ_data_patch->valid_start_time = NULL; + } + if (traffic_influ_data_patch->valid_end_time) { + ogs_free(traffic_influ_data_patch->valid_end_time); + traffic_influ_data_patch->valid_end_time = NULL; + } + if (traffic_influ_data_patch->temp_validities) { + OpenAPI_list_for_each(traffic_influ_data_patch->temp_validities, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->temp_validities); + traffic_influ_data_patch->temp_validities = NULL; + } + if (traffic_influ_data_patch->nw_area_info) { + OpenAPI_network_area_info_1_free(traffic_influ_data_patch->nw_area_info); + traffic_influ_data_patch->nw_area_info = NULL; + } + if (traffic_influ_data_patch->up_path_chg_notif_uri) { + ogs_free(traffic_influ_data_patch->up_path_chg_notif_uri); + traffic_influ_data_patch->up_path_chg_notif_uri = NULL; + } + if (traffic_influ_data_patch->headers) { + OpenAPI_list_for_each(traffic_influ_data_patch->headers, node) { + ogs_free(node->data); + } + OpenAPI_list_free(traffic_influ_data_patch->headers); + traffic_influ_data_patch->headers = NULL; } - OpenAPI_list_free(traffic_influ_data_patch->headers); ogs_free(traffic_influ_data_patch); } cJSON *OpenAPI_traffic_influ_data_patch_convertToJSON(OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (traffic_influ_data_patch == NULL) { ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [TrafficInfluDataPatch]"); @@ -133,17 +177,13 @@ cJSON *OpenAPI_traffic_influ_data_patch_convertToJSON(OpenAPI_traffic_influ_data ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [eth_traffic_filters]"); goto end; } - - OpenAPI_lnode_t *eth_traffic_filters_node; - if (traffic_influ_data_patch->eth_traffic_filters) { - OpenAPI_list_for_each(traffic_influ_data_patch->eth_traffic_filters, eth_traffic_filters_node) { - cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(eth_traffic_filters_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [eth_traffic_filters]"); - goto end; - } - cJSON_AddItemToArray(eth_traffic_filtersList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data_patch->eth_traffic_filters, node) { + cJSON *itemLocal = OpenAPI_eth_flow_description_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [eth_traffic_filters]"); + goto end; } + cJSON_AddItemToArray(eth_traffic_filtersList, itemLocal); } } @@ -180,17 +220,13 @@ cJSON *OpenAPI_traffic_influ_data_patch_convertToJSON(OpenAPI_traffic_influ_data ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_filters]"); goto end; } - - OpenAPI_lnode_t *traffic_filters_node; - if (traffic_influ_data_patch->traffic_filters) { - OpenAPI_list_for_each(traffic_influ_data_patch->traffic_filters, traffic_filters_node) { - cJSON *itemLocal = OpenAPI_flow_info_convertToJSON(traffic_filters_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_filters]"); - goto end; - } - cJSON_AddItemToArray(traffic_filtersList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data_patch->traffic_filters, node) { + cJSON *itemLocal = OpenAPI_flow_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_filters]"); + goto end; } + cJSON_AddItemToArray(traffic_filtersList, itemLocal); } } @@ -200,17 +236,13 @@ cJSON *OpenAPI_traffic_influ_data_patch_convertToJSON(OpenAPI_traffic_influ_data ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_routes]"); goto end; } - - OpenAPI_lnode_t *traffic_routes_node; - if (traffic_influ_data_patch->traffic_routes) { - OpenAPI_list_for_each(traffic_influ_data_patch->traffic_routes, traffic_routes_node) { - cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(traffic_routes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_routes]"); - goto end; - } - cJSON_AddItemToArray(traffic_routesList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data_patch->traffic_routes, node) { + cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [traffic_routes]"); + goto end; } + cJSON_AddItemToArray(traffic_routesList, itemLocal); } } @@ -241,17 +273,13 @@ cJSON *OpenAPI_traffic_influ_data_patch_convertToJSON(OpenAPI_traffic_influ_data ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [temp_validities]"); goto end; } - - OpenAPI_lnode_t *temp_validities_node; - if (traffic_influ_data_patch->temp_validities) { - OpenAPI_list_for_each(traffic_influ_data_patch->temp_validities, temp_validities_node) { - cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(temp_validities_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [temp_validities]"); - goto end; - } - cJSON_AddItemToArray(temp_validitiesList, itemLocal); + OpenAPI_list_for_each(traffic_influ_data_patch->temp_validities, node) { + cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [temp_validities]"); + goto end; } + cJSON_AddItemToArray(temp_validitiesList, itemLocal); } } @@ -276,19 +304,17 @@ cJSON *OpenAPI_traffic_influ_data_patch_convertToJSON(OpenAPI_traffic_influ_data } if (traffic_influ_data_patch->headers) { - cJSON *headers = cJSON_AddArrayToObject(item, "headers"); - if (headers == NULL) { + cJSON *headersList = cJSON_AddArrayToObject(item, "headers"); + if (headersList == NULL) { ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [headers]"); goto end; } - - OpenAPI_lnode_t *headers_node; - OpenAPI_list_for_each(traffic_influ_data_patch->headers, headers_node) { - if (cJSON_AddStringToObject(headers, "", (char*)headers_node->data) == NULL) { - ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [headers]"); - goto end; + OpenAPI_list_for_each(traffic_influ_data_patch->headers, node) { + if (cJSON_AddStringToObject(headersList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_traffic_influ_data_patch_convertToJSON() failed [headers]"); + goto end; + } } - } } if (traffic_influ_data_patch->is_af_ack_ind) { @@ -312,17 +338,41 @@ end: OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_parseFromJSON(cJSON *traffic_influ_data_patchJSON) { OpenAPI_traffic_influ_data_patch_t *traffic_influ_data_patch_local_var = NULL; - cJSON *up_path_chg_notif_corre_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "upPathChgNotifCorreId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *up_path_chg_notif_corre_id = NULL; + cJSON *app_relo_ind = NULL; + cJSON *dnn = NULL; + cJSON *eth_traffic_filters = NULL; + OpenAPI_list_t *eth_traffic_filtersList = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *internal_group_id = NULL; + cJSON *supi = NULL; + cJSON *traffic_filters = NULL; + OpenAPI_list_t *traffic_filtersList = NULL; + cJSON *traffic_routes = NULL; + OpenAPI_list_t *traffic_routesList = NULL; + cJSON *traff_corre_ind = NULL; + cJSON *valid_start_time = NULL; + cJSON *valid_end_time = NULL; + cJSON *temp_validities = NULL; + OpenAPI_list_t *temp_validitiesList = NULL; + cJSON *nw_area_info = NULL; + OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL; + cJSON *up_path_chg_notif_uri = NULL; + cJSON *headers = NULL; + OpenAPI_list_t *headersList = NULL; + cJSON *af_ack_ind = NULL; + cJSON *addr_preser_ind = NULL; + up_path_chg_notif_corre_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "upPathChgNotifCorreId"); if (up_path_chg_notif_corre_id) { - if (!cJSON_IsString(up_path_chg_notif_corre_id)) { + if (!cJSON_IsString(up_path_chg_notif_corre_id) && !cJSON_IsNull(up_path_chg_notif_corre_id)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [up_path_chg_notif_corre_id]"); goto end; } } - cJSON *app_relo_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "appReloInd"); - + app_relo_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "appReloInd"); if (app_relo_ind) { if (!cJSON_IsBool(app_relo_ind)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [app_relo_ind]"); @@ -330,129 +380,111 @@ OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_parseFromJS } } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *eth_traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "ethTrafficFilters"); - - OpenAPI_list_t *eth_traffic_filtersList; + eth_traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "ethTrafficFilters"); if (eth_traffic_filters) { - cJSON *eth_traffic_filters_local_nonprimitive; - if (!cJSON_IsArray(eth_traffic_filters)){ - ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [eth_traffic_filters]"); - goto end; - } - - eth_traffic_filtersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eth_traffic_filters_local_nonprimitive, eth_traffic_filters ) { - if (!cJSON_IsObject(eth_traffic_filters_local_nonprimitive)) { + cJSON *eth_traffic_filters_local = NULL; + if (!cJSON_IsArray(eth_traffic_filters)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [eth_traffic_filters]"); goto end; } - OpenAPI_eth_flow_description_t *eth_traffic_filtersItem = OpenAPI_eth_flow_description_parseFromJSON(eth_traffic_filters_local_nonprimitive); - if (!eth_traffic_filtersItem) { - ogs_error("No eth_traffic_filtersItem"); - OpenAPI_list_free(eth_traffic_filtersList); - goto end; + eth_traffic_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eth_traffic_filters_local, eth_traffic_filters) { + if (!cJSON_IsObject(eth_traffic_filters_local)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [eth_traffic_filters]"); + goto end; + } + OpenAPI_eth_flow_description_t *eth_traffic_filtersItem = OpenAPI_eth_flow_description_parseFromJSON(eth_traffic_filters_local); + if (!eth_traffic_filtersItem) { + ogs_error("No eth_traffic_filtersItem"); + OpenAPI_list_free(eth_traffic_filtersList); + goto end; + } + OpenAPI_list_add(eth_traffic_filtersList, eth_traffic_filtersItem); } - - OpenAPI_list_add(eth_traffic_filtersList, eth_traffic_filtersItem); - } } - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "snssai"); - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "snssai"); if (snssai) { snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); } - cJSON *internal_group_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "internalGroupId"); - + internal_group_id = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "internalGroupId"); if (internal_group_id) { - if (!cJSON_IsString(internal_group_id)) { + if (!cJSON_IsString(internal_group_id) && !cJSON_IsNull(internal_group_id)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [internal_group_id]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [supi]"); goto end; } } - cJSON *traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "trafficFilters"); - - OpenAPI_list_t *traffic_filtersList; + traffic_filters = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "trafficFilters"); if (traffic_filters) { - cJSON *traffic_filters_local_nonprimitive; - if (!cJSON_IsArray(traffic_filters)){ - ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_filters]"); - goto end; - } - - traffic_filtersList = OpenAPI_list_create(); - - cJSON_ArrayForEach(traffic_filters_local_nonprimitive, traffic_filters ) { - if (!cJSON_IsObject(traffic_filters_local_nonprimitive)) { + cJSON *traffic_filters_local = NULL; + if (!cJSON_IsArray(traffic_filters)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_filters]"); goto end; } - OpenAPI_flow_info_t *traffic_filtersItem = OpenAPI_flow_info_parseFromJSON(traffic_filters_local_nonprimitive); - if (!traffic_filtersItem) { - ogs_error("No traffic_filtersItem"); - OpenAPI_list_free(traffic_filtersList); - goto end; + traffic_filtersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_filters_local, traffic_filters) { + if (!cJSON_IsObject(traffic_filters_local)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_filters]"); + goto end; + } + OpenAPI_flow_info_t *traffic_filtersItem = OpenAPI_flow_info_parseFromJSON(traffic_filters_local); + if (!traffic_filtersItem) { + ogs_error("No traffic_filtersItem"); + OpenAPI_list_free(traffic_filtersList); + goto end; + } + OpenAPI_list_add(traffic_filtersList, traffic_filtersItem); } - - OpenAPI_list_add(traffic_filtersList, traffic_filtersItem); - } } - cJSON *traffic_routes = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "trafficRoutes"); - - OpenAPI_list_t *traffic_routesList; + traffic_routes = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "trafficRoutes"); if (traffic_routes) { - cJSON *traffic_routes_local_nonprimitive; - if (!cJSON_IsArray(traffic_routes)){ - ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_routes]"); - goto end; - } - - traffic_routesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(traffic_routes_local_nonprimitive, traffic_routes ) { - if (!cJSON_IsObject(traffic_routes_local_nonprimitive)) { + cJSON *traffic_routes_local = NULL; + if (!cJSON_IsArray(traffic_routes)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_routes]"); goto end; } - OpenAPI_route_to_location_t *traffic_routesItem = OpenAPI_route_to_location_parseFromJSON(traffic_routes_local_nonprimitive); - if (!traffic_routesItem) { - ogs_error("No traffic_routesItem"); - OpenAPI_list_free(traffic_routesList); - goto end; + traffic_routesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(traffic_routes_local, traffic_routes) { + if (!cJSON_IsObject(traffic_routes_local)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traffic_routes]"); + goto end; + } + OpenAPI_route_to_location_t *traffic_routesItem = OpenAPI_route_to_location_parseFromJSON(traffic_routes_local); + if (!traffic_routesItem) { + ogs_error("No traffic_routesItem"); + OpenAPI_list_free(traffic_routesList); + goto end; + } + OpenAPI_list_add(traffic_routesList, traffic_routesItem); } - - OpenAPI_list_add(traffic_routesList, traffic_routesItem); - } } - cJSON *traff_corre_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "traffCorreInd"); - + traff_corre_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "traffCorreInd"); if (traff_corre_ind) { if (!cJSON_IsBool(traff_corre_ind)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [traff_corre_ind]"); @@ -460,91 +492,82 @@ OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_parseFromJS } } - cJSON *valid_start_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "validStartTime"); - + valid_start_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "validStartTime"); if (valid_start_time) { - if (!cJSON_IsString(valid_start_time)) { + if (!cJSON_IsString(valid_start_time) && !cJSON_IsNull(valid_start_time)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [valid_start_time]"); goto end; } } - cJSON *valid_end_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "validEndTime"); - + valid_end_time = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "validEndTime"); if (valid_end_time) { - if (!cJSON_IsString(valid_end_time)) { + if (!cJSON_IsString(valid_end_time) && !cJSON_IsNull(valid_end_time)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [valid_end_time]"); goto end; } } - cJSON *temp_validities = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "tempValidities"); - - OpenAPI_list_t *temp_validitiesList; + temp_validities = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "tempValidities"); if (temp_validities) { - cJSON *temp_validities_local_nonprimitive; - if (!cJSON_IsArray(temp_validities)){ - ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [temp_validities]"); - goto end; - } - - temp_validitiesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(temp_validities_local_nonprimitive, temp_validities ) { - if (!cJSON_IsObject(temp_validities_local_nonprimitive)) { + cJSON *temp_validities_local = NULL; + if (!cJSON_IsArray(temp_validities)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [temp_validities]"); goto end; } - OpenAPI_temporal_validity_t *temp_validitiesItem = OpenAPI_temporal_validity_parseFromJSON(temp_validities_local_nonprimitive); - if (!temp_validitiesItem) { - ogs_error("No temp_validitiesItem"); - OpenAPI_list_free(temp_validitiesList); - goto end; + temp_validitiesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(temp_validities_local, temp_validities) { + if (!cJSON_IsObject(temp_validities_local)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [temp_validities]"); + goto end; + } + OpenAPI_temporal_validity_t *temp_validitiesItem = OpenAPI_temporal_validity_parseFromJSON(temp_validities_local); + if (!temp_validitiesItem) { + ogs_error("No temp_validitiesItem"); + OpenAPI_list_free(temp_validitiesList); + goto end; + } + OpenAPI_list_add(temp_validitiesList, temp_validitiesItem); } - - OpenAPI_list_add(temp_validitiesList, temp_validitiesItem); - } } - cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "nwAreaInfo"); - - OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL; + nw_area_info = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "nwAreaInfo"); if (nw_area_info) { nw_area_info_local_nonprim = OpenAPI_network_area_info_1_parseFromJSON(nw_area_info); } - cJSON *up_path_chg_notif_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "upPathChgNotifUri"); - + up_path_chg_notif_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "upPathChgNotifUri"); if (up_path_chg_notif_uri) { - if (!cJSON_IsString(up_path_chg_notif_uri)) { + if (!cJSON_IsString(up_path_chg_notif_uri) && !cJSON_IsNull(up_path_chg_notif_uri)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [up_path_chg_notif_uri]"); goto end; } } - cJSON *headers = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "headers"); - - OpenAPI_list_t *headersList; + headers = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "headers"); if (headers) { - cJSON *headers_local; - if (!cJSON_IsArray(headers)) { - ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [headers]"); - goto end; - } - headersList = OpenAPI_list_create(); + cJSON *headers_local = NULL; + if (!cJSON_IsArray(headers)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [headers]"); + goto end; + } - cJSON_ArrayForEach(headers_local, headers) { - if (!cJSON_IsString(headers_local)) { - ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [headers]"); - goto end; - } - OpenAPI_list_add(headersList, ogs_strdup(headers_local->valuestring)); - } + headersList = OpenAPI_list_create(); + + cJSON_ArrayForEach(headers_local, headers) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(headers_local)) { + ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [headers]"); + goto end; + } + OpenAPI_list_add(headersList, ogs_strdup(headers_local->valuestring)); + } } - cJSON *af_ack_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "afAckInd"); - + af_ack_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "afAckInd"); if (af_ack_ind) { if (!cJSON_IsBool(af_ack_ind)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [af_ack_ind]"); @@ -552,8 +575,7 @@ OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_parseFromJS } } - cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "addrPreserInd"); - + addr_preser_ind = cJSON_GetObjectItemCaseSensitive(traffic_influ_data_patchJSON, "addrPreserInd"); if (addr_preser_ind) { if (!cJSON_IsBool(addr_preser_ind)) { ogs_error("OpenAPI_traffic_influ_data_patch_parseFromJSON() failed [addr_preser_ind]"); @@ -562,23 +584,23 @@ OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_parseFromJS } traffic_influ_data_patch_local_var = OpenAPI_traffic_influ_data_patch_create ( - up_path_chg_notif_corre_id ? ogs_strdup(up_path_chg_notif_corre_id->valuestring) : NULL, + up_path_chg_notif_corre_id && !cJSON_IsNull(up_path_chg_notif_corre_id) ? ogs_strdup(up_path_chg_notif_corre_id->valuestring) : NULL, app_relo_ind ? true : false, app_relo_ind ? app_relo_ind->valueint : 0, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, eth_traffic_filters ? eth_traffic_filtersList : NULL, snssai ? snssai_local_nonprim : NULL, - internal_group_id ? ogs_strdup(internal_group_id->valuestring) : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL, + internal_group_id && !cJSON_IsNull(internal_group_id) ? ogs_strdup(internal_group_id->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, traffic_filters ? traffic_filtersList : NULL, traffic_routes ? traffic_routesList : NULL, traff_corre_ind ? true : false, traff_corre_ind ? traff_corre_ind->valueint : 0, - valid_start_time ? ogs_strdup(valid_start_time->valuestring) : NULL, - valid_end_time ? ogs_strdup(valid_end_time->valuestring) : NULL, + valid_start_time && !cJSON_IsNull(valid_start_time) ? ogs_strdup(valid_start_time->valuestring) : NULL, + valid_end_time && !cJSON_IsNull(valid_end_time) ? ogs_strdup(valid_end_time->valuestring) : NULL, temp_validities ? temp_validitiesList : NULL, nw_area_info ? nw_area_info_local_nonprim : NULL, - up_path_chg_notif_uri ? ogs_strdup(up_path_chg_notif_uri->valuestring) : NULL, + up_path_chg_notif_uri && !cJSON_IsNull(up_path_chg_notif_uri) ? ogs_strdup(up_path_chg_notif_uri->valuestring) : NULL, headers ? headersList : NULL, af_ack_ind ? true : false, af_ack_ind ? af_ack_ind->valueint : 0, @@ -588,6 +610,49 @@ OpenAPI_traffic_influ_data_patch_t *OpenAPI_traffic_influ_data_patch_parseFromJS return traffic_influ_data_patch_local_var; end: + if (eth_traffic_filtersList) { + OpenAPI_list_for_each(eth_traffic_filtersList, node) { + OpenAPI_eth_flow_description_free(node->data); + } + OpenAPI_list_free(eth_traffic_filtersList); + eth_traffic_filtersList = NULL; + } + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (traffic_filtersList) { + OpenAPI_list_for_each(traffic_filtersList, node) { + OpenAPI_flow_info_free(node->data); + } + OpenAPI_list_free(traffic_filtersList); + traffic_filtersList = NULL; + } + if (traffic_routesList) { + OpenAPI_list_for_each(traffic_routesList, node) { + OpenAPI_route_to_location_free(node->data); + } + OpenAPI_list_free(traffic_routesList); + traffic_routesList = NULL; + } + if (temp_validitiesList) { + OpenAPI_list_for_each(temp_validitiesList, node) { + OpenAPI_temporal_validity_free(node->data); + } + OpenAPI_list_free(temp_validitiesList); + temp_validitiesList = NULL; + } + if (nw_area_info_local_nonprim) { + OpenAPI_network_area_info_1_free(nw_area_info_local_nonprim); + nw_area_info_local_nonprim = NULL; + } + if (headersList) { + OpenAPI_list_for_each(headersList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(headersList); + headersList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/traffic_influ_sub.c b/lib/sbi/openapi/model/traffic_influ_sub.c index c9644cb2e..b442ac0b5 100644 --- a/lib/sbi/openapi/model/traffic_influ_sub.c +++ b/lib/sbi/openapi/model/traffic_influ_sub.c @@ -30,35 +30,58 @@ OpenAPI_traffic_influ_sub_t *OpenAPI_traffic_influ_sub_create( void OpenAPI_traffic_influ_sub_free(OpenAPI_traffic_influ_sub_t *traffic_influ_sub) { + OpenAPI_lnode_t *node = NULL; + if (NULL == traffic_influ_sub) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(traffic_influ_sub->dnns, node) { - ogs_free(node->data); + if (traffic_influ_sub->dnns) { + OpenAPI_list_for_each(traffic_influ_sub->dnns, node) { + ogs_free(node->data); + } + OpenAPI_list_free(traffic_influ_sub->dnns); + traffic_influ_sub->dnns = NULL; } - OpenAPI_list_free(traffic_influ_sub->dnns); - OpenAPI_list_for_each(traffic_influ_sub->snssais, node) { - OpenAPI_snssai_free(node->data); + if (traffic_influ_sub->snssais) { + OpenAPI_list_for_each(traffic_influ_sub->snssais, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(traffic_influ_sub->snssais); + traffic_influ_sub->snssais = NULL; } - OpenAPI_list_free(traffic_influ_sub->snssais); - OpenAPI_list_for_each(traffic_influ_sub->internal_group_ids, node) { - ogs_free(node->data); + if (traffic_influ_sub->internal_group_ids) { + OpenAPI_list_for_each(traffic_influ_sub->internal_group_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(traffic_influ_sub->internal_group_ids); + traffic_influ_sub->internal_group_ids = NULL; } - OpenAPI_list_free(traffic_influ_sub->internal_group_ids); - OpenAPI_list_for_each(traffic_influ_sub->supis, node) { - ogs_free(node->data); + if (traffic_influ_sub->supis) { + OpenAPI_list_for_each(traffic_influ_sub->supis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(traffic_influ_sub->supis); + traffic_influ_sub->supis = NULL; + } + if (traffic_influ_sub->notification_uri) { + ogs_free(traffic_influ_sub->notification_uri); + traffic_influ_sub->notification_uri = NULL; + } + if (traffic_influ_sub->expiry) { + ogs_free(traffic_influ_sub->expiry); + traffic_influ_sub->expiry = NULL; + } + if (traffic_influ_sub->supported_features) { + ogs_free(traffic_influ_sub->supported_features); + traffic_influ_sub->supported_features = NULL; } - OpenAPI_list_free(traffic_influ_sub->supis); - ogs_free(traffic_influ_sub->notification_uri); - ogs_free(traffic_influ_sub->expiry); - ogs_free(traffic_influ_sub->supported_features); ogs_free(traffic_influ_sub); } cJSON *OpenAPI_traffic_influ_sub_convertToJSON(OpenAPI_traffic_influ_sub_t *traffic_influ_sub) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (traffic_influ_sub == NULL) { ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [TrafficInfluSub]"); @@ -67,19 +90,17 @@ cJSON *OpenAPI_traffic_influ_sub_convertToJSON(OpenAPI_traffic_influ_sub_t *traf item = cJSON_CreateObject(); if (traffic_influ_sub->dnns) { - cJSON *dnns = cJSON_AddArrayToObject(item, "dnns"); - if (dnns == NULL) { + cJSON *dnnsList = cJSON_AddArrayToObject(item, "dnns"); + if (dnnsList == NULL) { ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [dnns]"); goto end; } - - OpenAPI_lnode_t *dnns_node; - OpenAPI_list_for_each(traffic_influ_sub->dnns, dnns_node) { - if (cJSON_AddStringToObject(dnns, "", (char*)dnns_node->data) == NULL) { - ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [dnns]"); - goto end; + OpenAPI_list_for_each(traffic_influ_sub->dnns, node) { + if (cJSON_AddStringToObject(dnnsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [dnns]"); + goto end; + } } - } } if (traffic_influ_sub->snssais) { @@ -88,52 +109,48 @@ cJSON *OpenAPI_traffic_influ_sub_convertToJSON(OpenAPI_traffic_influ_sub_t *traf ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [snssais]"); goto end; } - - OpenAPI_lnode_t *snssais_node; - if (traffic_influ_sub->snssais) { - OpenAPI_list_for_each(traffic_influ_sub->snssais, snssais_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(snssais_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [snssais]"); - goto end; - } - cJSON_AddItemToArray(snssaisList, itemLocal); + OpenAPI_list_for_each(traffic_influ_sub->snssais, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [snssais]"); + goto end; } + cJSON_AddItemToArray(snssaisList, itemLocal); } } if (traffic_influ_sub->internal_group_ids) { - cJSON *internal_group_ids = cJSON_AddArrayToObject(item, "internalGroupIds"); - if (internal_group_ids == NULL) { + cJSON *internal_group_idsList = cJSON_AddArrayToObject(item, "internalGroupIds"); + if (internal_group_idsList == NULL) { ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [internal_group_ids]"); goto end; } - - OpenAPI_lnode_t *internal_group_ids_node; - OpenAPI_list_for_each(traffic_influ_sub->internal_group_ids, internal_group_ids_node) { - if (cJSON_AddStringToObject(internal_group_ids, "", (char*)internal_group_ids_node->data) == NULL) { - ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [internal_group_ids]"); - goto end; + OpenAPI_list_for_each(traffic_influ_sub->internal_group_ids, node) { + if (cJSON_AddStringToObject(internal_group_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [internal_group_ids]"); + goto end; + } } - } } if (traffic_influ_sub->supis) { - cJSON *supis = cJSON_AddArrayToObject(item, "supis"); - if (supis == NULL) { + cJSON *supisList = cJSON_AddArrayToObject(item, "supis"); + if (supisList == NULL) { ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [supis]"); goto end; } - - OpenAPI_lnode_t *supis_node; - OpenAPI_list_for_each(traffic_influ_sub->supis, supis_node) { - if (cJSON_AddStringToObject(supis, "", (char*)supis_node->data) == NULL) { - ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [supis]"); - goto end; + OpenAPI_list_for_each(traffic_influ_sub->supis, node) { + if (cJSON_AddStringToObject(supisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [supis]"); + goto end; + } } - } } + if (!traffic_influ_sub->notification_uri) { + ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [notification_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationUri", traffic_influ_sub->notification_uri) == NULL) { ogs_error("OpenAPI_traffic_influ_sub_convertToJSON() failed [notification_uri]"); goto end; @@ -160,119 +177,127 @@ end: OpenAPI_traffic_influ_sub_t *OpenAPI_traffic_influ_sub_parseFromJSON(cJSON *traffic_influ_subJSON) { OpenAPI_traffic_influ_sub_t *traffic_influ_sub_local_var = NULL; - cJSON *dnns = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "dnns"); - - OpenAPI_list_t *dnnsList; + OpenAPI_lnode_t *node = NULL; + cJSON *dnns = NULL; + OpenAPI_list_t *dnnsList = NULL; + cJSON *snssais = NULL; + OpenAPI_list_t *snssaisList = NULL; + cJSON *internal_group_ids = NULL; + OpenAPI_list_t *internal_group_idsList = NULL; + cJSON *supis = NULL; + OpenAPI_list_t *supisList = NULL; + cJSON *notification_uri = NULL; + cJSON *expiry = NULL; + cJSON *supported_features = NULL; + dnns = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "dnns"); if (dnns) { - cJSON *dnns_local; - if (!cJSON_IsArray(dnns)) { - ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [dnns]"); - goto end; - } - dnnsList = OpenAPI_list_create(); + cJSON *dnns_local = NULL; + if (!cJSON_IsArray(dnns)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [dnns]"); + goto end; + } - cJSON_ArrayForEach(dnns_local, dnns) { - if (!cJSON_IsString(dnns_local)) { - ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [dnns]"); - goto end; - } - OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); - } + dnnsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnns_local, dnns) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnns_local)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [dnns]"); + goto end; + } + OpenAPI_list_add(dnnsList, ogs_strdup(dnns_local->valuestring)); + } } - cJSON *snssais = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "snssais"); - - OpenAPI_list_t *snssaisList; + snssais = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "snssais"); if (snssais) { - cJSON *snssais_local_nonprimitive; - if (!cJSON_IsArray(snssais)){ - ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [snssais]"); - goto end; - } - - snssaisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(snssais_local_nonprimitive, snssais ) { - if (!cJSON_IsObject(snssais_local_nonprimitive)) { + cJSON *snssais_local = NULL; + if (!cJSON_IsArray(snssais)) { ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [snssais]"); goto end; } - OpenAPI_snssai_t *snssaisItem = OpenAPI_snssai_parseFromJSON(snssais_local_nonprimitive); - if (!snssaisItem) { - ogs_error("No snssaisItem"); - OpenAPI_list_free(snssaisList); + snssaisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(snssais_local, snssais) { + if (!cJSON_IsObject(snssais_local)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [snssais]"); + goto end; + } + OpenAPI_snssai_t *snssaisItem = OpenAPI_snssai_parseFromJSON(snssais_local); + if (!snssaisItem) { + ogs_error("No snssaisItem"); + OpenAPI_list_free(snssaisList); + goto end; + } + OpenAPI_list_add(snssaisList, snssaisItem); + } + } + + internal_group_ids = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "internalGroupIds"); + if (internal_group_ids) { + cJSON *internal_group_ids_local = NULL; + if (!cJSON_IsArray(internal_group_ids)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [internal_group_ids]"); goto end; } - OpenAPI_list_add(snssaisList, snssaisItem); - } + internal_group_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(internal_group_ids_local)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [internal_group_ids]"); + goto end; + } + OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); + } } - cJSON *internal_group_ids = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "internalGroupIds"); - - OpenAPI_list_t *internal_group_idsList; - if (internal_group_ids) { - cJSON *internal_group_ids_local; - if (!cJSON_IsArray(internal_group_ids)) { - ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - internal_group_idsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(internal_group_ids_local, internal_group_ids) { - if (!cJSON_IsString(internal_group_ids_local)) { - ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [internal_group_ids]"); - goto end; - } - OpenAPI_list_add(internal_group_idsList, ogs_strdup(internal_group_ids_local->valuestring)); - } - } - - cJSON *supis = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "supis"); - - OpenAPI_list_t *supisList; + supis = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "supis"); if (supis) { - cJSON *supis_local; - if (!cJSON_IsArray(supis)) { - ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [supis]"); - goto end; - } - supisList = OpenAPI_list_create(); + cJSON *supis_local = NULL; + if (!cJSON_IsArray(supis)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [supis]"); + goto end; + } - cJSON_ArrayForEach(supis_local, supis) { - if (!cJSON_IsString(supis_local)) { - ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [supis]"); - goto end; - } - OpenAPI_list_add(supisList, ogs_strdup(supis_local->valuestring)); - } + supisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supis_local, supis) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(supis_local)) { + ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [supis]"); + goto end; + } + OpenAPI_list_add(supisList, ogs_strdup(supis_local->valuestring)); + } } - cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "notificationUri"); + notification_uri = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "notificationUri"); if (!notification_uri) { ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [notification_uri]"); goto end; } - if (!cJSON_IsString(notification_uri)) { ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [notification_uri]"); goto end; } - cJSON *expiry = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "expiry"); - + expiry = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "expiry"); if (expiry) { - if (!cJSON_IsString(expiry)) { + if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) { ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [expiry]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(traffic_influ_subJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_traffic_influ_sub_parseFromJSON() failed [supported_features]"); goto end; } @@ -284,12 +309,40 @@ OpenAPI_traffic_influ_sub_t *OpenAPI_traffic_influ_sub_parseFromJSON(cJSON *traf internal_group_ids ? internal_group_idsList : NULL, supis ? supisList : NULL, ogs_strdup(notification_uri->valuestring), - expiry ? ogs_strdup(expiry->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return traffic_influ_sub_local_var; end: + if (dnnsList) { + OpenAPI_list_for_each(dnnsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnnsList); + dnnsList = NULL; + } + if (snssaisList) { + OpenAPI_list_for_each(snssaisList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(snssaisList); + snssaisList = NULL; + } + if (internal_group_idsList) { + OpenAPI_list_for_each(internal_group_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(internal_group_idsList); + internal_group_idsList = NULL; + } + if (supisList) { + OpenAPI_list_for_each(supisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(supisList); + supisList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/traffic_profile_rm.c b/lib/sbi/openapi/model/traffic_profile_rm.c index a8ee35c1b..4445410fe 100644 --- a/lib/sbi/openapi/model/traffic_profile_rm.c +++ b/lib/sbi/openapi/model/traffic_profile_rm.c @@ -16,16 +16,18 @@ OpenAPI_traffic_profile_rm_t *OpenAPI_traffic_profile_rm_create( void OpenAPI_traffic_profile_rm_free(OpenAPI_traffic_profile_rm_t *traffic_profile_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == traffic_profile_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(traffic_profile_rm); } cJSON *OpenAPI_traffic_profile_rm_convertToJSON(OpenAPI_traffic_profile_rm_t *traffic_profile_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (traffic_profile_rm == NULL) { ogs_error("OpenAPI_traffic_profile_rm_convertToJSON() failed [TrafficProfileRm]"); @@ -40,6 +42,7 @@ end: OpenAPI_traffic_profile_rm_t *OpenAPI_traffic_profile_rm_parseFromJSON(cJSON *traffic_profile_rmJSON) { OpenAPI_traffic_profile_rm_t *traffic_profile_rm_local_var = NULL; + OpenAPI_lnode_t *node = NULL; traffic_profile_rm_local_var = OpenAPI_traffic_profile_rm_create ( ); diff --git a/lib/sbi/openapi/model/transfer_mo_data_req_data.c b/lib/sbi/openapi/model/transfer_mo_data_req_data.c index 940c3da6e..e6e117154 100644 --- a/lib/sbi/openapi/model/transfer_mo_data_req_data.c +++ b/lib/sbi/openapi/model/transfer_mo_data_req_data.c @@ -22,19 +22,30 @@ OpenAPI_transfer_mo_data_req_data_t *OpenAPI_transfer_mo_data_req_data_create( void OpenAPI_transfer_mo_data_req_data_free(OpenAPI_transfer_mo_data_req_data_t *transfer_mo_data_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == transfer_mo_data_req_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ref_to_binary_data_free(transfer_mo_data_req_data->mo_data); - OpenAPI_mo_exp_data_counter_free(transfer_mo_data_req_data->mo_exp_data_counter); - OpenAPI_user_location_free(transfer_mo_data_req_data->ue_location); + if (transfer_mo_data_req_data->mo_data) { + OpenAPI_ref_to_binary_data_free(transfer_mo_data_req_data->mo_data); + transfer_mo_data_req_data->mo_data = NULL; + } + if (transfer_mo_data_req_data->mo_exp_data_counter) { + OpenAPI_mo_exp_data_counter_free(transfer_mo_data_req_data->mo_exp_data_counter); + transfer_mo_data_req_data->mo_exp_data_counter = NULL; + } + if (transfer_mo_data_req_data->ue_location) { + OpenAPI_user_location_free(transfer_mo_data_req_data->ue_location); + transfer_mo_data_req_data->ue_location = NULL; + } ogs_free(transfer_mo_data_req_data); } cJSON *OpenAPI_transfer_mo_data_req_data_convertToJSON(OpenAPI_transfer_mo_data_req_data_t *transfer_mo_data_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (transfer_mo_data_req_data == NULL) { ogs_error("OpenAPI_transfer_mo_data_req_data_convertToJSON() failed [TransferMoDataReqData]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_transfer_mo_data_req_data_convertToJSON(OpenAPI_transfer_mo_data_ } item = cJSON_CreateObject(); + if (!transfer_mo_data_req_data->mo_data) { + ogs_error("OpenAPI_transfer_mo_data_req_data_convertToJSON() failed [mo_data]"); + return NULL; + } cJSON *mo_data_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(transfer_mo_data_req_data->mo_data); if (mo_data_local_JSON == NULL) { ogs_error("OpenAPI_transfer_mo_data_req_data_convertToJSON() failed [mo_data]"); @@ -86,25 +101,26 @@ end: OpenAPI_transfer_mo_data_req_data_t *OpenAPI_transfer_mo_data_req_data_parseFromJSON(cJSON *transfer_mo_data_req_dataJSON) { OpenAPI_transfer_mo_data_req_data_t *transfer_mo_data_req_data_local_var = NULL; - cJSON *mo_data = cJSON_GetObjectItemCaseSensitive(transfer_mo_data_req_dataJSON, "moData"); + OpenAPI_lnode_t *node = NULL; + cJSON *mo_data = NULL; + OpenAPI_ref_to_binary_data_t *mo_data_local_nonprim = NULL; + cJSON *mo_exp_data_counter = NULL; + OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + mo_data = cJSON_GetObjectItemCaseSensitive(transfer_mo_data_req_dataJSON, "moData"); if (!mo_data) { ogs_error("OpenAPI_transfer_mo_data_req_data_parseFromJSON() failed [mo_data]"); goto end; } - - OpenAPI_ref_to_binary_data_t *mo_data_local_nonprim = NULL; mo_data_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(mo_data); - cJSON *mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(transfer_mo_data_req_dataJSON, "moExpDataCounter"); - - OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(transfer_mo_data_req_dataJSON, "moExpDataCounter"); if (mo_exp_data_counter) { mo_exp_data_counter_local_nonprim = OpenAPI_mo_exp_data_counter_parseFromJSON(mo_exp_data_counter); } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(transfer_mo_data_req_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(transfer_mo_data_req_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } @@ -117,6 +133,18 @@ OpenAPI_transfer_mo_data_req_data_t *OpenAPI_transfer_mo_data_req_data_parseFrom return transfer_mo_data_req_data_local_var; end: + if (mo_data_local_nonprim) { + OpenAPI_ref_to_binary_data_free(mo_data_local_nonprim); + mo_data_local_nonprim = NULL; + } + if (mo_exp_data_counter_local_nonprim) { + OpenAPI_mo_exp_data_counter_free(mo_exp_data_counter_local_nonprim); + mo_exp_data_counter_local_nonprim = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/transfer_mo_data_request.c b/lib/sbi/openapi/model/transfer_mo_data_request.c new file mode 100644 index 000000000..cb1dd4f01 --- /dev/null +++ b/lib/sbi/openapi/model/transfer_mo_data_request.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "transfer_mo_data_request.h" + +OpenAPI_transfer_mo_data_request_t *OpenAPI_transfer_mo_data_request_create( + OpenAPI_transfer_mo_data_req_data_t *json_data, + OpenAPI_binary_t* binary_mo_data +) +{ + OpenAPI_transfer_mo_data_request_t *transfer_mo_data_request_local_var = ogs_malloc(sizeof(OpenAPI_transfer_mo_data_request_t)); + ogs_assert(transfer_mo_data_request_local_var); + + transfer_mo_data_request_local_var->json_data = json_data; + transfer_mo_data_request_local_var->binary_mo_data = binary_mo_data; + + return transfer_mo_data_request_local_var; +} + +void OpenAPI_transfer_mo_data_request_free(OpenAPI_transfer_mo_data_request_t *transfer_mo_data_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == transfer_mo_data_request) { + return; + } + if (transfer_mo_data_request->json_data) { + OpenAPI_transfer_mo_data_req_data_free(transfer_mo_data_request->json_data); + transfer_mo_data_request->json_data = NULL; + } + if (transfer_mo_data_request->binary_mo_data) { + ogs_free(transfer_mo_data_request->binary_mo_data->data); + transfer_mo_data_request->binary_mo_data = NULL; + } + ogs_free(transfer_mo_data_request); +} + +cJSON *OpenAPI_transfer_mo_data_request_convertToJSON(OpenAPI_transfer_mo_data_request_t *transfer_mo_data_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (transfer_mo_data_request == NULL) { + ogs_error("OpenAPI_transfer_mo_data_request_convertToJSON() failed [TransferMoData_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (transfer_mo_data_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_transfer_mo_data_req_data_convertToJSON(transfer_mo_data_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_transfer_mo_data_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_transfer_mo_data_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (transfer_mo_data_request->binary_mo_data) { + char* encoded_str_binary_mo_data = OpenAPI_base64encode(transfer_mo_data_request->binary_mo_data->data,transfer_mo_data_request->binary_mo_data->len); + if (cJSON_AddStringToObject(item, "binaryMoData", encoded_str_binary_mo_data) == NULL) { + ogs_error("OpenAPI_transfer_mo_data_request_convertToJSON() failed [binary_mo_data]"); + goto end; + } + ogs_free(encoded_str_binary_mo_data); + } + +end: + return item; +} + +OpenAPI_transfer_mo_data_request_t *OpenAPI_transfer_mo_data_request_parseFromJSON(cJSON *transfer_mo_data_requestJSON) +{ + OpenAPI_transfer_mo_data_request_t *transfer_mo_data_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_transfer_mo_data_req_data_t *json_data_local_nonprim = NULL; + cJSON *binary_mo_data = NULL; + OpenAPI_binary_t *decoded_str_binary_mo_data = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(transfer_mo_data_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_transfer_mo_data_req_data_parseFromJSON(json_data); + } + + binary_mo_data = cJSON_GetObjectItemCaseSensitive(transfer_mo_data_requestJSON, "binaryMoData"); + if (binary_mo_data) { + decoded_str_binary_mo_data = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_mo_data); + if (!cJSON_IsString(binary_mo_data)) { + ogs_error("OpenAPI_transfer_mo_data_request_parseFromJSON() failed [binary_mo_data]"); + goto end; + } + decoded_str_binary_mo_data->data = OpenAPI_base64decode(binary_mo_data->valuestring, strlen(binary_mo_data->valuestring), &decoded_str_binary_mo_data->len); + if (!decoded_str_binary_mo_data->data) { + ogs_error("OpenAPI_transfer_mo_data_request_parseFromJSON() failed [binary_mo_data]"); + goto end; + } + } + + transfer_mo_data_request_local_var = OpenAPI_transfer_mo_data_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_mo_data ? decoded_str_binary_mo_data : NULL + ); + + return transfer_mo_data_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_transfer_mo_data_req_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_transfer_mo_data_request_t *OpenAPI_transfer_mo_data_request_copy(OpenAPI_transfer_mo_data_request_t *dst, OpenAPI_transfer_mo_data_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_transfer_mo_data_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_transfer_mo_data_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_transfer_mo_data_request_free(dst); + dst = OpenAPI_transfer_mo_data_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/transfer_mo_data_request.h b/lib/sbi/openapi/model/transfer_mo_data_request.h new file mode 100644 index 000000000..292a87187 --- /dev/null +++ b/lib/sbi/openapi/model/transfer_mo_data_request.h @@ -0,0 +1,41 @@ +/* + * transfer_mo_data_request.h + * + * + */ + +#ifndef _OpenAPI_transfer_mo_data_request_H_ +#define _OpenAPI_transfer_mo_data_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "transfer_mo_data_req_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_transfer_mo_data_request_s OpenAPI_transfer_mo_data_request_t; +typedef struct OpenAPI_transfer_mo_data_request_s { + struct OpenAPI_transfer_mo_data_req_data_s *json_data; + OpenAPI_binary_t* binary_mo_data; +} OpenAPI_transfer_mo_data_request_t; + +OpenAPI_transfer_mo_data_request_t *OpenAPI_transfer_mo_data_request_create( + OpenAPI_transfer_mo_data_req_data_t *json_data, + OpenAPI_binary_t* binary_mo_data +); +void OpenAPI_transfer_mo_data_request_free(OpenAPI_transfer_mo_data_request_t *transfer_mo_data_request); +OpenAPI_transfer_mo_data_request_t *OpenAPI_transfer_mo_data_request_parseFromJSON(cJSON *transfer_mo_data_requestJSON); +cJSON *OpenAPI_transfer_mo_data_request_convertToJSON(OpenAPI_transfer_mo_data_request_t *transfer_mo_data_request); +OpenAPI_transfer_mo_data_request_t *OpenAPI_transfer_mo_data_request_copy(OpenAPI_transfer_mo_data_request_t *dst, OpenAPI_transfer_mo_data_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_transfer_mo_data_request_H_ */ + diff --git a/lib/sbi/openapi/model/transfer_mt_data_add_info.c b/lib/sbi/openapi/model/transfer_mt_data_add_info.c index 3d4bfb54d..01c8ea22b 100644 --- a/lib/sbi/openapi/model/transfer_mt_data_add_info.c +++ b/lib/sbi/openapi/model/transfer_mt_data_add_info.c @@ -20,16 +20,18 @@ OpenAPI_transfer_mt_data_add_info_t *OpenAPI_transfer_mt_data_add_info_create( void OpenAPI_transfer_mt_data_add_info_free(OpenAPI_transfer_mt_data_add_info_t *transfer_mt_data_add_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == transfer_mt_data_add_info) { return; } - OpenAPI_lnode_t *node; ogs_free(transfer_mt_data_add_info); } cJSON *OpenAPI_transfer_mt_data_add_info_convertToJSON(OpenAPI_transfer_mt_data_add_info_t *transfer_mt_data_add_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (transfer_mt_data_add_info == NULL) { ogs_error("OpenAPI_transfer_mt_data_add_info_convertToJSON() failed [TransferMtDataAddInfo]"); @@ -51,8 +53,9 @@ end: OpenAPI_transfer_mt_data_add_info_t *OpenAPI_transfer_mt_data_add_info_parseFromJSON(cJSON *transfer_mt_data_add_infoJSON) { OpenAPI_transfer_mt_data_add_info_t *transfer_mt_data_add_info_local_var = NULL; - cJSON *max_waiting_time = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_add_infoJSON, "maxWaitingTime"); - + OpenAPI_lnode_t *node = NULL; + cJSON *max_waiting_time = NULL; + max_waiting_time = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_add_infoJSON, "maxWaitingTime"); if (max_waiting_time) { if (!cJSON_IsNumber(max_waiting_time)) { ogs_error("OpenAPI_transfer_mt_data_add_info_parseFromJSON() failed [max_waiting_time]"); diff --git a/lib/sbi/openapi/model/transfer_mt_data_error.c b/lib/sbi/openapi/model/transfer_mt_data_error.c index 54b8c7bf6..3d2307246 100644 --- a/lib/sbi/openapi/model/transfer_mt_data_error.c +++ b/lib/sbi/openapi/model/transfer_mt_data_error.c @@ -44,29 +44,61 @@ OpenAPI_transfer_mt_data_error_t *OpenAPI_transfer_mt_data_error_create( void OpenAPI_transfer_mt_data_error_free(OpenAPI_transfer_mt_data_error_t *transfer_mt_data_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == transfer_mt_data_error) { return; } - OpenAPI_lnode_t *node; - ogs_free(transfer_mt_data_error->type); - ogs_free(transfer_mt_data_error->title); - ogs_free(transfer_mt_data_error->detail); - ogs_free(transfer_mt_data_error->instance); - ogs_free(transfer_mt_data_error->cause); - OpenAPI_list_for_each(transfer_mt_data_error->invalid_params, node) { - OpenAPI_invalid_param_free(node->data); + if (transfer_mt_data_error->type) { + ogs_free(transfer_mt_data_error->type); + transfer_mt_data_error->type = NULL; + } + if (transfer_mt_data_error->title) { + ogs_free(transfer_mt_data_error->title); + transfer_mt_data_error->title = NULL; + } + if (transfer_mt_data_error->detail) { + ogs_free(transfer_mt_data_error->detail); + transfer_mt_data_error->detail = NULL; + } + if (transfer_mt_data_error->instance) { + ogs_free(transfer_mt_data_error->instance); + transfer_mt_data_error->instance = NULL; + } + if (transfer_mt_data_error->cause) { + ogs_free(transfer_mt_data_error->cause); + transfer_mt_data_error->cause = NULL; + } + if (transfer_mt_data_error->invalid_params) { + OpenAPI_list_for_each(transfer_mt_data_error->invalid_params, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(transfer_mt_data_error->invalid_params); + transfer_mt_data_error->invalid_params = NULL; + } + if (transfer_mt_data_error->supported_features) { + ogs_free(transfer_mt_data_error->supported_features); + transfer_mt_data_error->supported_features = NULL; + } + if (transfer_mt_data_error->access_token_error) { + OpenAPI_access_token_err_free(transfer_mt_data_error->access_token_error); + transfer_mt_data_error->access_token_error = NULL; + } + if (transfer_mt_data_error->access_token_request) { + OpenAPI_access_token_req_free(transfer_mt_data_error->access_token_request); + transfer_mt_data_error->access_token_request = NULL; + } + if (transfer_mt_data_error->nrf_id) { + ogs_free(transfer_mt_data_error->nrf_id); + transfer_mt_data_error->nrf_id = NULL; } - OpenAPI_list_free(transfer_mt_data_error->invalid_params); - ogs_free(transfer_mt_data_error->supported_features); - OpenAPI_access_token_err_free(transfer_mt_data_error->access_token_error); - OpenAPI_access_token_req_free(transfer_mt_data_error->access_token_request); - ogs_free(transfer_mt_data_error->nrf_id); ogs_free(transfer_mt_data_error); } cJSON *OpenAPI_transfer_mt_data_error_convertToJSON(OpenAPI_transfer_mt_data_error_t *transfer_mt_data_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (transfer_mt_data_error == NULL) { ogs_error("OpenAPI_transfer_mt_data_error_convertToJSON() failed [TransferMtDataError]"); @@ -122,17 +154,13 @@ cJSON *OpenAPI_transfer_mt_data_error_convertToJSON(OpenAPI_transfer_mt_data_err ogs_error("OpenAPI_transfer_mt_data_error_convertToJSON() failed [invalid_params]"); goto end; } - - OpenAPI_lnode_t *invalid_params_node; - if (transfer_mt_data_error->invalid_params) { - OpenAPI_list_for_each(transfer_mt_data_error->invalid_params, invalid_params_node) { - cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(invalid_params_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_transfer_mt_data_error_convertToJSON() failed [invalid_params]"); - goto end; - } - cJSON_AddItemToArray(invalid_paramsList, itemLocal); + OpenAPI_list_for_each(transfer_mt_data_error->invalid_params, node) { + cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_transfer_mt_data_error_convertToJSON() failed [invalid_params]"); + goto end; } + cJSON_AddItemToArray(invalid_paramsList, itemLocal); } } @@ -190,26 +218,39 @@ end: OpenAPI_transfer_mt_data_error_t *OpenAPI_transfer_mt_data_error_parseFromJSON(cJSON *transfer_mt_data_errorJSON) { OpenAPI_transfer_mt_data_error_t *transfer_mt_data_error_local_var = NULL; - cJSON *type = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "type"); - + OpenAPI_lnode_t *node = NULL; + cJSON *type = NULL; + cJSON *title = NULL; + cJSON *status = NULL; + cJSON *detail = NULL; + cJSON *instance = NULL; + cJSON *cause = NULL; + cJSON *invalid_params = NULL; + OpenAPI_list_t *invalid_paramsList = NULL; + cJSON *supported_features = NULL; + cJSON *access_token_error = NULL; + OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + cJSON *access_token_request = NULL; + OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + cJSON *nrf_id = NULL; + cJSON *max_waiting_time = NULL; + type = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "type"); if (type) { - if (!cJSON_IsString(type)) { + if (!cJSON_IsString(type) && !cJSON_IsNull(type)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [type]"); goto end; } } - cJSON *title = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "title"); - + title = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "title"); if (title) { - if (!cJSON_IsString(title)) { + if (!cJSON_IsString(title) && !cJSON_IsNull(title)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [title]"); goto end; } } - cJSON *status = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "status"); - + status = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "status"); if (status) { if (!cJSON_IsNumber(status)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [status]"); @@ -217,96 +258,82 @@ OpenAPI_transfer_mt_data_error_t *OpenAPI_transfer_mt_data_error_parseFromJSON(c } } - cJSON *detail = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "detail"); - + detail = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "detail"); if (detail) { - if (!cJSON_IsString(detail)) { + if (!cJSON_IsString(detail) && !cJSON_IsNull(detail)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [detail]"); goto end; } } - cJSON *instance = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "instance"); - + instance = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "instance"); if (instance) { - if (!cJSON_IsString(instance)) { + if (!cJSON_IsString(instance) && !cJSON_IsNull(instance)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [instance]"); goto end; } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "cause"); - + cause = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "cause"); if (cause) { - if (!cJSON_IsString(cause)) { + if (!cJSON_IsString(cause) && !cJSON_IsNull(cause)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [cause]"); goto end; } } - cJSON *invalid_params = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "invalidParams"); - - OpenAPI_list_t *invalid_paramsList; + invalid_params = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "invalidParams"); if (invalid_params) { - cJSON *invalid_params_local_nonprimitive; - if (!cJSON_IsArray(invalid_params)){ - ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [invalid_params]"); - goto end; - } - - invalid_paramsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(invalid_params_local_nonprimitive, invalid_params ) { - if (!cJSON_IsObject(invalid_params_local_nonprimitive)) { + cJSON *invalid_params_local = NULL; + if (!cJSON_IsArray(invalid_params)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [invalid_params]"); goto end; } - OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local_nonprimitive); - if (!invalid_paramsItem) { - ogs_error("No invalid_paramsItem"); - OpenAPI_list_free(invalid_paramsList); - goto end; + invalid_paramsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(invalid_params_local, invalid_params) { + if (!cJSON_IsObject(invalid_params_local)) { + ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [invalid_params]"); + goto end; + } + OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local); + if (!invalid_paramsItem) { + ogs_error("No invalid_paramsItem"); + OpenAPI_list_free(invalid_paramsList); + goto end; + } + OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); } - - OpenAPI_list_add(invalid_paramsList, invalid_paramsItem); - } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *access_token_error = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "accessTokenError"); - - OpenAPI_access_token_err_t *access_token_error_local_nonprim = NULL; + access_token_error = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "accessTokenError"); if (access_token_error) { access_token_error_local_nonprim = OpenAPI_access_token_err_parseFromJSON(access_token_error); } - cJSON *access_token_request = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "accessTokenRequest"); - - OpenAPI_access_token_req_t *access_token_request_local_nonprim = NULL; + access_token_request = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "accessTokenRequest"); if (access_token_request) { access_token_request_local_nonprim = OpenAPI_access_token_req_parseFromJSON(access_token_request); } - cJSON *nrf_id = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "nrfId"); - + nrf_id = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "nrfId"); if (nrf_id) { - if (!cJSON_IsString(nrf_id)) { + if (!cJSON_IsString(nrf_id) && !cJSON_IsNull(nrf_id)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [nrf_id]"); goto end; } } - cJSON *max_waiting_time = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "maxWaitingTime"); - + max_waiting_time = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_errorJSON, "maxWaitingTime"); if (max_waiting_time) { if (!cJSON_IsNumber(max_waiting_time)) { ogs_error("OpenAPI_transfer_mt_data_error_parseFromJSON() failed [max_waiting_time]"); @@ -315,24 +342,39 @@ OpenAPI_transfer_mt_data_error_t *OpenAPI_transfer_mt_data_error_parseFromJSON(c } transfer_mt_data_error_local_var = OpenAPI_transfer_mt_data_error_create ( - type ? ogs_strdup(type->valuestring) : NULL, - title ? ogs_strdup(title->valuestring) : NULL, + type && !cJSON_IsNull(type) ? ogs_strdup(type->valuestring) : NULL, + title && !cJSON_IsNull(title) ? ogs_strdup(title->valuestring) : NULL, status ? true : false, status ? status->valuedouble : 0, - detail ? ogs_strdup(detail->valuestring) : NULL, - instance ? ogs_strdup(instance->valuestring) : NULL, - cause ? ogs_strdup(cause->valuestring) : NULL, + detail && !cJSON_IsNull(detail) ? ogs_strdup(detail->valuestring) : NULL, + instance && !cJSON_IsNull(instance) ? ogs_strdup(instance->valuestring) : NULL, + cause && !cJSON_IsNull(cause) ? ogs_strdup(cause->valuestring) : NULL, invalid_params ? invalid_paramsList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, access_token_error ? access_token_error_local_nonprim : NULL, access_token_request ? access_token_request_local_nonprim : NULL, - nrf_id ? ogs_strdup(nrf_id->valuestring) : NULL, + nrf_id && !cJSON_IsNull(nrf_id) ? ogs_strdup(nrf_id->valuestring) : NULL, max_waiting_time ? true : false, max_waiting_time ? max_waiting_time->valuedouble : 0 ); return transfer_mt_data_error_local_var; end: + if (invalid_paramsList) { + OpenAPI_list_for_each(invalid_paramsList, node) { + OpenAPI_invalid_param_free(node->data); + } + OpenAPI_list_free(invalid_paramsList); + invalid_paramsList = NULL; + } + if (access_token_error_local_nonprim) { + OpenAPI_access_token_err_free(access_token_error_local_nonprim); + access_token_error_local_nonprim = NULL; + } + if (access_token_request_local_nonprim) { + OpenAPI_access_token_req_free(access_token_request_local_nonprim); + access_token_request_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/transfer_mt_data_error.h b/lib/sbi/openapi/model/transfer_mt_data_error.h index ba6f52630..c8440e5a3 100644 --- a/lib/sbi/openapi/model/transfer_mt_data_error.h +++ b/lib/sbi/openapi/model/transfer_mt_data_error.h @@ -15,8 +15,6 @@ #include "access_token_err.h" #include "access_token_req.h" #include "invalid_param.h" -#include "problem_details.h" -#include "transfer_mt_data_add_info.h" #ifdef __cplusplus extern "C" { diff --git a/lib/sbi/openapi/model/transfer_mt_data_ismf_request.c b/lib/sbi/openapi/model/transfer_mt_data_ismf_request.c new file mode 100644 index 000000000..e00072fba --- /dev/null +++ b/lib/sbi/openapi/model/transfer_mt_data_ismf_request.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "transfer_mt_data_ismf_request.h" + +OpenAPI_transfer_mt_data_ismf_request_t *OpenAPI_transfer_mt_data_ismf_request_create( + OpenAPI_transfer_mt_data_req_data_t *json_data, + OpenAPI_binary_t* binary_mt_data +) +{ + OpenAPI_transfer_mt_data_ismf_request_t *transfer_mt_data_ismf_request_local_var = ogs_malloc(sizeof(OpenAPI_transfer_mt_data_ismf_request_t)); + ogs_assert(transfer_mt_data_ismf_request_local_var); + + transfer_mt_data_ismf_request_local_var->json_data = json_data; + transfer_mt_data_ismf_request_local_var->binary_mt_data = binary_mt_data; + + return transfer_mt_data_ismf_request_local_var; +} + +void OpenAPI_transfer_mt_data_ismf_request_free(OpenAPI_transfer_mt_data_ismf_request_t *transfer_mt_data_ismf_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == transfer_mt_data_ismf_request) { + return; + } + if (transfer_mt_data_ismf_request->json_data) { + OpenAPI_transfer_mt_data_req_data_free(transfer_mt_data_ismf_request->json_data); + transfer_mt_data_ismf_request->json_data = NULL; + } + if (transfer_mt_data_ismf_request->binary_mt_data) { + ogs_free(transfer_mt_data_ismf_request->binary_mt_data->data); + transfer_mt_data_ismf_request->binary_mt_data = NULL; + } + ogs_free(transfer_mt_data_ismf_request); +} + +cJSON *OpenAPI_transfer_mt_data_ismf_request_convertToJSON(OpenAPI_transfer_mt_data_ismf_request_t *transfer_mt_data_ismf_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (transfer_mt_data_ismf_request == NULL) { + ogs_error("OpenAPI_transfer_mt_data_ismf_request_convertToJSON() failed [TransferMtData_ismf_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (transfer_mt_data_ismf_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_transfer_mt_data_req_data_convertToJSON(transfer_mt_data_ismf_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_transfer_mt_data_ismf_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_transfer_mt_data_ismf_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (transfer_mt_data_ismf_request->binary_mt_data) { + char* encoded_str_binary_mt_data = OpenAPI_base64encode(transfer_mt_data_ismf_request->binary_mt_data->data,transfer_mt_data_ismf_request->binary_mt_data->len); + if (cJSON_AddStringToObject(item, "binaryMtData", encoded_str_binary_mt_data) == NULL) { + ogs_error("OpenAPI_transfer_mt_data_ismf_request_convertToJSON() failed [binary_mt_data]"); + goto end; + } + ogs_free(encoded_str_binary_mt_data); + } + +end: + return item; +} + +OpenAPI_transfer_mt_data_ismf_request_t *OpenAPI_transfer_mt_data_ismf_request_parseFromJSON(cJSON *transfer_mt_data_ismf_requestJSON) +{ + OpenAPI_transfer_mt_data_ismf_request_t *transfer_mt_data_ismf_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_transfer_mt_data_req_data_t *json_data_local_nonprim = NULL; + cJSON *binary_mt_data = NULL; + OpenAPI_binary_t *decoded_str_binary_mt_data = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_ismf_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_transfer_mt_data_req_data_parseFromJSON(json_data); + } + + binary_mt_data = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_ismf_requestJSON, "binaryMtData"); + if (binary_mt_data) { + decoded_str_binary_mt_data = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_mt_data); + if (!cJSON_IsString(binary_mt_data)) { + ogs_error("OpenAPI_transfer_mt_data_ismf_request_parseFromJSON() failed [binary_mt_data]"); + goto end; + } + decoded_str_binary_mt_data->data = OpenAPI_base64decode(binary_mt_data->valuestring, strlen(binary_mt_data->valuestring), &decoded_str_binary_mt_data->len); + if (!decoded_str_binary_mt_data->data) { + ogs_error("OpenAPI_transfer_mt_data_ismf_request_parseFromJSON() failed [binary_mt_data]"); + goto end; + } + } + + transfer_mt_data_ismf_request_local_var = OpenAPI_transfer_mt_data_ismf_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_mt_data ? decoded_str_binary_mt_data : NULL + ); + + return transfer_mt_data_ismf_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_transfer_mt_data_req_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_transfer_mt_data_ismf_request_t *OpenAPI_transfer_mt_data_ismf_request_copy(OpenAPI_transfer_mt_data_ismf_request_t *dst, OpenAPI_transfer_mt_data_ismf_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_transfer_mt_data_ismf_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_transfer_mt_data_ismf_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_transfer_mt_data_ismf_request_free(dst); + dst = OpenAPI_transfer_mt_data_ismf_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/transfer_mt_data_ismf_request.h b/lib/sbi/openapi/model/transfer_mt_data_ismf_request.h new file mode 100644 index 000000000..a735bd285 --- /dev/null +++ b/lib/sbi/openapi/model/transfer_mt_data_ismf_request.h @@ -0,0 +1,41 @@ +/* + * transfer_mt_data_ismf_request.h + * + * + */ + +#ifndef _OpenAPI_transfer_mt_data_ismf_request_H_ +#define _OpenAPI_transfer_mt_data_ismf_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "transfer_mt_data_req_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_transfer_mt_data_ismf_request_s OpenAPI_transfer_mt_data_ismf_request_t; +typedef struct OpenAPI_transfer_mt_data_ismf_request_s { + struct OpenAPI_transfer_mt_data_req_data_s *json_data; + OpenAPI_binary_t* binary_mt_data; +} OpenAPI_transfer_mt_data_ismf_request_t; + +OpenAPI_transfer_mt_data_ismf_request_t *OpenAPI_transfer_mt_data_ismf_request_create( + OpenAPI_transfer_mt_data_req_data_t *json_data, + OpenAPI_binary_t* binary_mt_data +); +void OpenAPI_transfer_mt_data_ismf_request_free(OpenAPI_transfer_mt_data_ismf_request_t *transfer_mt_data_ismf_request); +OpenAPI_transfer_mt_data_ismf_request_t *OpenAPI_transfer_mt_data_ismf_request_parseFromJSON(cJSON *transfer_mt_data_ismf_requestJSON); +cJSON *OpenAPI_transfer_mt_data_ismf_request_convertToJSON(OpenAPI_transfer_mt_data_ismf_request_t *transfer_mt_data_ismf_request); +OpenAPI_transfer_mt_data_ismf_request_t *OpenAPI_transfer_mt_data_ismf_request_copy(OpenAPI_transfer_mt_data_ismf_request_t *dst, OpenAPI_transfer_mt_data_ismf_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_transfer_mt_data_ismf_request_H_ */ + diff --git a/lib/sbi/openapi/model/transfer_mt_data_req_data.c b/lib/sbi/openapi/model/transfer_mt_data_req_data.c index 201914efb..9a45c97c8 100644 --- a/lib/sbi/openapi/model/transfer_mt_data_req_data.c +++ b/lib/sbi/openapi/model/transfer_mt_data_req_data.c @@ -18,17 +18,22 @@ OpenAPI_transfer_mt_data_req_data_t *OpenAPI_transfer_mt_data_req_data_create( void OpenAPI_transfer_mt_data_req_data_free(OpenAPI_transfer_mt_data_req_data_t *transfer_mt_data_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == transfer_mt_data_req_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ref_to_binary_data_free(transfer_mt_data_req_data->mt_data); + if (transfer_mt_data_req_data->mt_data) { + OpenAPI_ref_to_binary_data_free(transfer_mt_data_req_data->mt_data); + transfer_mt_data_req_data->mt_data = NULL; + } ogs_free(transfer_mt_data_req_data); } cJSON *OpenAPI_transfer_mt_data_req_data_convertToJSON(OpenAPI_transfer_mt_data_req_data_t *transfer_mt_data_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (transfer_mt_data_req_data == NULL) { ogs_error("OpenAPI_transfer_mt_data_req_data_convertToJSON() failed [TransferMtDataReqData]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_transfer_mt_data_req_data_convertToJSON(OpenAPI_transfer_mt_data_ } item = cJSON_CreateObject(); + if (!transfer_mt_data_req_data->mt_data) { + ogs_error("OpenAPI_transfer_mt_data_req_data_convertToJSON() failed [mt_data]"); + return NULL; + } cJSON *mt_data_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(transfer_mt_data_req_data->mt_data); if (mt_data_local_JSON == NULL) { ogs_error("OpenAPI_transfer_mt_data_req_data_convertToJSON() failed [mt_data]"); @@ -54,13 +63,14 @@ end: OpenAPI_transfer_mt_data_req_data_t *OpenAPI_transfer_mt_data_req_data_parseFromJSON(cJSON *transfer_mt_data_req_dataJSON) { OpenAPI_transfer_mt_data_req_data_t *transfer_mt_data_req_data_local_var = NULL; - cJSON *mt_data = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_req_dataJSON, "mtData"); + OpenAPI_lnode_t *node = NULL; + cJSON *mt_data = NULL; + OpenAPI_ref_to_binary_data_t *mt_data_local_nonprim = NULL; + mt_data = cJSON_GetObjectItemCaseSensitive(transfer_mt_data_req_dataJSON, "mtData"); if (!mt_data) { ogs_error("OpenAPI_transfer_mt_data_req_data_parseFromJSON() failed [mt_data]"); goto end; } - - OpenAPI_ref_to_binary_data_t *mt_data_local_nonprim = NULL; mt_data_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(mt_data); transfer_mt_data_req_data_local_var = OpenAPI_transfer_mt_data_req_data_create ( @@ -69,6 +79,10 @@ OpenAPI_transfer_mt_data_req_data_t *OpenAPI_transfer_mt_data_req_data_parseFrom return transfer_mt_data_req_data_local_var; end: + if (mt_data_local_nonprim) { + OpenAPI_ref_to_binary_data_free(mt_data_local_nonprim); + mt_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/transfer_policy.c b/lib/sbi/openapi/model/transfer_policy.c index 18e3d1a8d..6654d8979 100644 --- a/lib/sbi/openapi/model/transfer_policy.c +++ b/lib/sbi/openapi/model/transfer_policy.c @@ -26,19 +26,30 @@ OpenAPI_transfer_policy_t *OpenAPI_transfer_policy_create( void OpenAPI_transfer_policy_free(OpenAPI_transfer_policy_t *transfer_policy) { + OpenAPI_lnode_t *node = NULL; + if (NULL == transfer_policy) { return; } - OpenAPI_lnode_t *node; - ogs_free(transfer_policy->max_bit_rate_dl); - ogs_free(transfer_policy->max_bit_rate_ul); - OpenAPI_time_window_free(transfer_policy->rec_time_int); + if (transfer_policy->max_bit_rate_dl) { + ogs_free(transfer_policy->max_bit_rate_dl); + transfer_policy->max_bit_rate_dl = NULL; + } + if (transfer_policy->max_bit_rate_ul) { + ogs_free(transfer_policy->max_bit_rate_ul); + transfer_policy->max_bit_rate_ul = NULL; + } + if (transfer_policy->rec_time_int) { + OpenAPI_time_window_free(transfer_policy->rec_time_int); + transfer_policy->rec_time_int = NULL; + } ogs_free(transfer_policy); } cJSON *OpenAPI_transfer_policy_convertToJSON(OpenAPI_transfer_policy_t *transfer_policy) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (transfer_policy == NULL) { ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [TransferPolicy]"); @@ -65,6 +76,10 @@ cJSON *OpenAPI_transfer_policy_convertToJSON(OpenAPI_transfer_policy_t *transfer goto end; } + if (!transfer_policy->rec_time_int) { + ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [rec_time_int]"); + return NULL; + } cJSON *rec_time_int_local_JSON = OpenAPI_time_window_convertToJSON(transfer_policy->rec_time_int); if (rec_time_int_local_JSON == NULL) { ogs_error("OpenAPI_transfer_policy_convertToJSON() failed [rec_time_int]"); @@ -88,58 +103,59 @@ end: OpenAPI_transfer_policy_t *OpenAPI_transfer_policy_parseFromJSON(cJSON *transfer_policyJSON) { OpenAPI_transfer_policy_t *transfer_policy_local_var = NULL; - cJSON *max_bit_rate_dl = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "maxBitRateDl"); - + OpenAPI_lnode_t *node = NULL; + cJSON *max_bit_rate_dl = NULL; + cJSON *max_bit_rate_ul = NULL; + cJSON *rating_group = NULL; + cJSON *rec_time_int = NULL; + OpenAPI_time_window_t *rec_time_int_local_nonprim = NULL; + cJSON *trans_policy_id = NULL; + max_bit_rate_dl = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "maxBitRateDl"); if (max_bit_rate_dl) { - if (!cJSON_IsString(max_bit_rate_dl)) { + if (!cJSON_IsString(max_bit_rate_dl) && !cJSON_IsNull(max_bit_rate_dl)) { ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [max_bit_rate_dl]"); goto end; } } - cJSON *max_bit_rate_ul = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "maxBitRateUl"); - + max_bit_rate_ul = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "maxBitRateUl"); if (max_bit_rate_ul) { - if (!cJSON_IsString(max_bit_rate_ul)) { + if (!cJSON_IsString(max_bit_rate_ul) && !cJSON_IsNull(max_bit_rate_ul)) { ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [max_bit_rate_ul]"); goto end; } } - cJSON *rating_group = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "ratingGroup"); + rating_group = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "ratingGroup"); if (!rating_group) { ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [rating_group]"); goto end; } - if (!cJSON_IsNumber(rating_group)) { ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [rating_group]"); goto end; } - cJSON *rec_time_int = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "recTimeInt"); + rec_time_int = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "recTimeInt"); if (!rec_time_int) { ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [rec_time_int]"); goto end; } - - OpenAPI_time_window_t *rec_time_int_local_nonprim = NULL; rec_time_int_local_nonprim = OpenAPI_time_window_parseFromJSON(rec_time_int); - cJSON *trans_policy_id = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "transPolicyId"); + trans_policy_id = cJSON_GetObjectItemCaseSensitive(transfer_policyJSON, "transPolicyId"); if (!trans_policy_id) { ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [trans_policy_id]"); goto end; } - if (!cJSON_IsNumber(trans_policy_id)) { ogs_error("OpenAPI_transfer_policy_parseFromJSON() failed [trans_policy_id]"); goto end; } transfer_policy_local_var = OpenAPI_transfer_policy_create ( - max_bit_rate_dl ? ogs_strdup(max_bit_rate_dl->valuestring) : NULL, - max_bit_rate_ul ? ogs_strdup(max_bit_rate_ul->valuestring) : NULL, + max_bit_rate_dl && !cJSON_IsNull(max_bit_rate_dl) ? ogs_strdup(max_bit_rate_dl->valuestring) : NULL, + max_bit_rate_ul && !cJSON_IsNull(max_bit_rate_ul) ? ogs_strdup(max_bit_rate_ul->valuestring) : NULL, rating_group->valuedouble, rec_time_int_local_nonprim, @@ -149,6 +165,10 @@ OpenAPI_transfer_policy_t *OpenAPI_transfer_policy_parseFromJSON(cJSON *transfer return transfer_policy_local_var; end: + if (rec_time_int_local_nonprim) { + OpenAPI_time_window_free(rec_time_int_local_nonprim); + rec_time_int_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/trigger.c b/lib/sbi/openapi/model/trigger.c index b4a599077..10785be81 100644 --- a/lib/sbi/openapi/model/trigger.c +++ b/lib/sbi/openapi/model/trigger.c @@ -42,19 +42,30 @@ OpenAPI_trigger_t *OpenAPI_trigger_create( void OpenAPI_trigger_free(OpenAPI_trigger_t *trigger) { + OpenAPI_lnode_t *node = NULL; + if (NULL == trigger) { return; } - OpenAPI_lnode_t *node; - OpenAPI_trigger_type_free(trigger->trigger_type); - OpenAPI_trigger_category_free(trigger->trigger_category); - ogs_free(trigger->tariff_time_change); + if (trigger->trigger_type) { + OpenAPI_trigger_type_free(trigger->trigger_type); + trigger->trigger_type = NULL; + } + if (trigger->trigger_category) { + OpenAPI_trigger_category_free(trigger->trigger_category); + trigger->trigger_category = NULL; + } + if (trigger->tariff_time_change) { + ogs_free(trigger->tariff_time_change); + trigger->tariff_time_change = NULL; + } ogs_free(trigger); } cJSON *OpenAPI_trigger_convertToJSON(OpenAPI_trigger_t *trigger) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (trigger == NULL) { ogs_error("OpenAPI_trigger_convertToJSON() failed [Trigger]"); @@ -62,6 +73,10 @@ cJSON *OpenAPI_trigger_convertToJSON(OpenAPI_trigger_t *trigger) } item = cJSON_CreateObject(); + if (!trigger->trigger_type) { + ogs_error("OpenAPI_trigger_convertToJSON() failed [trigger_type]"); + return NULL; + } cJSON *trigger_type_local_JSON = OpenAPI_trigger_type_convertToJSON(trigger->trigger_type); if (trigger_type_local_JSON == NULL) { ogs_error("OpenAPI_trigger_convertToJSON() failed [trigger_type]"); @@ -73,6 +88,10 @@ cJSON *OpenAPI_trigger_convertToJSON(OpenAPI_trigger_t *trigger) goto end; } + if (!trigger->trigger_category) { + ogs_error("OpenAPI_trigger_convertToJSON() failed [trigger_category]"); + return NULL; + } cJSON *trigger_category_local_JSON = OpenAPI_trigger_category_convertToJSON(trigger->trigger_category); if (trigger_category_local_JSON == NULL) { ogs_error("OpenAPI_trigger_convertToJSON() failed [trigger_category]"); @@ -133,26 +152,32 @@ end: OpenAPI_trigger_t *OpenAPI_trigger_parseFromJSON(cJSON *triggerJSON) { OpenAPI_trigger_t *trigger_local_var = NULL; - cJSON *trigger_type = cJSON_GetObjectItemCaseSensitive(triggerJSON, "triggerType"); + OpenAPI_lnode_t *node = NULL; + cJSON *trigger_type = NULL; + OpenAPI_trigger_type_t *trigger_type_local_nonprim = NULL; + cJSON *trigger_category = NULL; + OpenAPI_trigger_category_t *trigger_category_local_nonprim = NULL; + cJSON *time_limit = NULL; + cJSON *volume_limit = NULL; + cJSON *volume_limit64 = NULL; + cJSON *event_limit = NULL; + cJSON *max_number_ofccc = NULL; + cJSON *tariff_time_change = NULL; + trigger_type = cJSON_GetObjectItemCaseSensitive(triggerJSON, "triggerType"); if (!trigger_type) { ogs_error("OpenAPI_trigger_parseFromJSON() failed [trigger_type]"); goto end; } - - OpenAPI_trigger_type_t *trigger_type_local_nonprim = NULL; trigger_type_local_nonprim = OpenAPI_trigger_type_parseFromJSON(trigger_type); - cJSON *trigger_category = cJSON_GetObjectItemCaseSensitive(triggerJSON, "triggerCategory"); + trigger_category = cJSON_GetObjectItemCaseSensitive(triggerJSON, "triggerCategory"); if (!trigger_category) { ogs_error("OpenAPI_trigger_parseFromJSON() failed [trigger_category]"); goto end; } - - OpenAPI_trigger_category_t *trigger_category_local_nonprim = NULL; trigger_category_local_nonprim = OpenAPI_trigger_category_parseFromJSON(trigger_category); - cJSON *time_limit = cJSON_GetObjectItemCaseSensitive(triggerJSON, "timeLimit"); - + time_limit = cJSON_GetObjectItemCaseSensitive(triggerJSON, "timeLimit"); if (time_limit) { if (!cJSON_IsNumber(time_limit)) { ogs_error("OpenAPI_trigger_parseFromJSON() failed [time_limit]"); @@ -160,8 +185,7 @@ OpenAPI_trigger_t *OpenAPI_trigger_parseFromJSON(cJSON *triggerJSON) } } - cJSON *volume_limit = cJSON_GetObjectItemCaseSensitive(triggerJSON, "volumeLimit"); - + volume_limit = cJSON_GetObjectItemCaseSensitive(triggerJSON, "volumeLimit"); if (volume_limit) { if (!cJSON_IsNumber(volume_limit)) { ogs_error("OpenAPI_trigger_parseFromJSON() failed [volume_limit]"); @@ -169,8 +193,7 @@ OpenAPI_trigger_t *OpenAPI_trigger_parseFromJSON(cJSON *triggerJSON) } } - cJSON *volume_limit64 = cJSON_GetObjectItemCaseSensitive(triggerJSON, "volumeLimit64"); - + volume_limit64 = cJSON_GetObjectItemCaseSensitive(triggerJSON, "volumeLimit64"); if (volume_limit64) { if (!cJSON_IsNumber(volume_limit64)) { ogs_error("OpenAPI_trigger_parseFromJSON() failed [volume_limit64]"); @@ -178,8 +201,7 @@ OpenAPI_trigger_t *OpenAPI_trigger_parseFromJSON(cJSON *triggerJSON) } } - cJSON *event_limit = cJSON_GetObjectItemCaseSensitive(triggerJSON, "eventLimit"); - + event_limit = cJSON_GetObjectItemCaseSensitive(triggerJSON, "eventLimit"); if (event_limit) { if (!cJSON_IsNumber(event_limit)) { ogs_error("OpenAPI_trigger_parseFromJSON() failed [event_limit]"); @@ -187,8 +209,7 @@ OpenAPI_trigger_t *OpenAPI_trigger_parseFromJSON(cJSON *triggerJSON) } } - cJSON *max_number_ofccc = cJSON_GetObjectItemCaseSensitive(triggerJSON, "maxNumberOfccc"); - + max_number_ofccc = cJSON_GetObjectItemCaseSensitive(triggerJSON, "maxNumberOfccc"); if (max_number_ofccc) { if (!cJSON_IsNumber(max_number_ofccc)) { ogs_error("OpenAPI_trigger_parseFromJSON() failed [max_number_ofccc]"); @@ -196,10 +217,9 @@ OpenAPI_trigger_t *OpenAPI_trigger_parseFromJSON(cJSON *triggerJSON) } } - cJSON *tariff_time_change = cJSON_GetObjectItemCaseSensitive(triggerJSON, "tariffTimeChange"); - + tariff_time_change = cJSON_GetObjectItemCaseSensitive(triggerJSON, "tariffTimeChange"); if (tariff_time_change) { - if (!cJSON_IsString(tariff_time_change)) { + if (!cJSON_IsString(tariff_time_change) && !cJSON_IsNull(tariff_time_change)) { ogs_error("OpenAPI_trigger_parseFromJSON() failed [tariff_time_change]"); goto end; } @@ -218,11 +238,19 @@ OpenAPI_trigger_t *OpenAPI_trigger_parseFromJSON(cJSON *triggerJSON) event_limit ? event_limit->valuedouble : 0, max_number_ofccc ? true : false, max_number_ofccc ? max_number_ofccc->valuedouble : 0, - tariff_time_change ? ogs_strdup(tariff_time_change->valuestring) : NULL + tariff_time_change && !cJSON_IsNull(tariff_time_change) ? ogs_strdup(tariff_time_change->valuestring) : NULL ); return trigger_local_var; end: + if (trigger_type_local_nonprim) { + OpenAPI_trigger_type_free(trigger_type_local_nonprim); + trigger_type_local_nonprim = NULL; + } + if (trigger_category_local_nonprim) { + OpenAPI_trigger_category_free(trigger_category_local_nonprim); + trigger_category_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/trigger_category.c b/lib/sbi/openapi/model/trigger_category.c index ee9f24a85..76f50ccb4 100644 --- a/lib/sbi/openapi/model/trigger_category.c +++ b/lib/sbi/openapi/model/trigger_category.c @@ -16,16 +16,18 @@ OpenAPI_trigger_category_t *OpenAPI_trigger_category_create( void OpenAPI_trigger_category_free(OpenAPI_trigger_category_t *trigger_category) { + OpenAPI_lnode_t *node = NULL; + if (NULL == trigger_category) { return; } - OpenAPI_lnode_t *node; ogs_free(trigger_category); } cJSON *OpenAPI_trigger_category_convertToJSON(OpenAPI_trigger_category_t *trigger_category) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (trigger_category == NULL) { ogs_error("OpenAPI_trigger_category_convertToJSON() failed [TriggerCategory]"); @@ -40,6 +42,7 @@ end: OpenAPI_trigger_category_t *OpenAPI_trigger_category_parseFromJSON(cJSON *trigger_categoryJSON) { OpenAPI_trigger_category_t *trigger_category_local_var = NULL; + OpenAPI_lnode_t *node = NULL; trigger_category_local_var = OpenAPI_trigger_category_create ( ); diff --git a/lib/sbi/openapi/model/trigger_request.c b/lib/sbi/openapi/model/trigger_request.c index dc9c39226..96c610333 100644 --- a/lib/sbi/openapi/model/trigger_request.c +++ b/lib/sbi/openapi/model/trigger_request.c @@ -18,17 +18,22 @@ OpenAPI_trigger_request_t *OpenAPI_trigger_request_create( void OpenAPI_trigger_request_free(OpenAPI_trigger_request_t *trigger_request) { + OpenAPI_lnode_t *node = NULL; + if (NULL == trigger_request) { return; } - OpenAPI_lnode_t *node; - ogs_free(trigger_request->supi); + if (trigger_request->supi) { + ogs_free(trigger_request->supi); + trigger_request->supi = NULL; + } ogs_free(trigger_request); } cJSON *OpenAPI_trigger_request_convertToJSON(OpenAPI_trigger_request_t *trigger_request) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (trigger_request == NULL) { ogs_error("OpenAPI_trigger_request_convertToJSON() failed [TriggerRequest]"); @@ -36,6 +41,10 @@ cJSON *OpenAPI_trigger_request_convertToJSON(OpenAPI_trigger_request_t *trigger_ } item = cJSON_CreateObject(); + if (!trigger_request->supi) { + ogs_error("OpenAPI_trigger_request_convertToJSON() failed [supi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supi", trigger_request->supi) == NULL) { ogs_error("OpenAPI_trigger_request_convertToJSON() failed [supi]"); goto end; @@ -48,12 +57,13 @@ end: OpenAPI_trigger_request_t *OpenAPI_trigger_request_parseFromJSON(cJSON *trigger_requestJSON) { OpenAPI_trigger_request_t *trigger_request_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(trigger_requestJSON, "supi"); + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + supi = cJSON_GetObjectItemCaseSensitive(trigger_requestJSON, "supi"); if (!supi) { ogs_error("OpenAPI_trigger_request_parseFromJSON() failed [supi]"); goto end; } - if (!cJSON_IsString(supi)) { ogs_error("OpenAPI_trigger_request_parseFromJSON() failed [supi]"); goto end; diff --git a/lib/sbi/openapi/model/trigger_type.c b/lib/sbi/openapi/model/trigger_type.c index 434c9992f..e8ffad1f0 100644 --- a/lib/sbi/openapi/model/trigger_type.c +++ b/lib/sbi/openapi/model/trigger_type.c @@ -16,16 +16,18 @@ OpenAPI_trigger_type_t *OpenAPI_trigger_type_create( void OpenAPI_trigger_type_free(OpenAPI_trigger_type_t *trigger_type) { + OpenAPI_lnode_t *node = NULL; + if (NULL == trigger_type) { return; } - OpenAPI_lnode_t *node; ogs_free(trigger_type); } cJSON *OpenAPI_trigger_type_convertToJSON(OpenAPI_trigger_type_t *trigger_type) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (trigger_type == NULL) { ogs_error("OpenAPI_trigger_type_convertToJSON() failed [TriggerType]"); @@ -40,6 +42,7 @@ end: OpenAPI_trigger_type_t *OpenAPI_trigger_type_parseFromJSON(cJSON *trigger_typeJSON) { OpenAPI_trigger_type_t *trigger_type_local_var = NULL; + OpenAPI_lnode_t *node = NULL; trigger_type_local_var = OpenAPI_trigger_type_create ( ); diff --git a/lib/sbi/openapi/model/trigger_type_any_of.c b/lib/sbi/openapi/model/trigger_type_any_of.c index 34ac4e70f..80bba8872 100644 --- a/lib/sbi/openapi/model/trigger_type_any_of.c +++ b/lib/sbi/openapi/model/trigger_type_any_of.c @@ -6,7 +6,7 @@ char* OpenAPI_trigger_type_any_of_ToString(OpenAPI_trigger_type_any_of_e trigger_type_any_of) { - const char *trigger_type_any_ofArray[] = { "NULL", "QUOTA_THRESHOLD", "QHT", "_FINAL", "QUOTA_EXHAUSTED", "VALIDITY_TIME", "OTHER_QUOTA_TYPE", "FORCED_REAUTHORISATION", "UNUSED_QUOTA_TIMER", "UNIT_COUNT_INACTIVITY_TIMER", "ABNORMAL_RELEASE", "QOS_CHANGE", "VOLUME_LIMIT", "TIME_LIMIT", "EVENT_LIMIT", "PLMN_CHANGE", "USER_LOCATION_CHANGE", "RAT_CHANGE", "SESSION_AMBR_CHANGE", "UE_TIMEZONE_CHANGE", "TARIFF_TIME_CHANGE", "MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS", "MANAGEMENT_INTERVENTION", "CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA", "CHANGE_OF_3GPP_PS_DATA_OFF_STATUS", "SERVING_NODE_CHANGE", "REMOVAL_OF_UPF", "ADDITION_OF_UPF", "INSERTION_OF_ISMF", "REMOVAL_OF_ISMF", "CHANGE_OF_ISMF", "START_OF_SERVICE_DATA_FLOW", "ECGI_CHANGE", "TAI_CHANGE", "HANDOVER_CANCEL", "HANDOVER_START", "HANDOVER_COMPLETE", "GFBR_GUARANTEED_STATUS_CHANGE", "ADDITION_OF_ACCESS", "REMOVAL_OF_ACCESS", "START_OF_SDF_ADDITIONAL_ACCESS" }; + const char *trigger_type_any_ofArray[] = { "NULL", "QUOTA_THRESHOLD", "QHT", "FINAL", "QUOTA_EXHAUSTED", "VALIDITY_TIME", "OTHER_QUOTA_TYPE", "FORCED_REAUTHORISATION", "UNUSED_QUOTA_TIMER", "UNIT_COUNT_INACTIVITY_TIMER", "ABNORMAL_RELEASE", "QOS_CHANGE", "VOLUME_LIMIT", "TIME_LIMIT", "EVENT_LIMIT", "PLMN_CHANGE", "USER_LOCATION_CHANGE", "RAT_CHANGE", "SESSION_AMBR_CHANGE", "UE_TIMEZONE_CHANGE", "TARIFF_TIME_CHANGE", "MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS", "MANAGEMENT_INTERVENTION", "CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA", "CHANGE_OF_3GPP_PS_DATA_OFF_STATUS", "SERVING_NODE_CHANGE", "REMOVAL_OF_UPF", "ADDITION_OF_UPF", "INSERTION_OF_ISMF", "REMOVAL_OF_ISMF", "CHANGE_OF_ISMF", "START_OF_SERVICE_DATA_FLOW", "ECGI_CHANGE", "TAI_CHANGE", "HANDOVER_CANCEL", "HANDOVER_START", "HANDOVER_COMPLETE", "GFBR_GUARANTEED_STATUS_CHANGE", "ADDITION_OF_ACCESS", "REMOVAL_OF_ACCESS", "START_OF_SDF_ADDITIONAL_ACCESS" }; size_t sizeofArray = sizeof(trigger_type_any_ofArray) / sizeof(trigger_type_any_ofArray[0]); if (trigger_type_any_of < sizeofArray) return (char *)trigger_type_any_ofArray[trigger_type_any_of]; @@ -17,7 +17,7 @@ char* OpenAPI_trigger_type_any_of_ToString(OpenAPI_trigger_type_any_of_e trigger OpenAPI_trigger_type_any_of_e OpenAPI_trigger_type_any_of_FromString(char* trigger_type_any_of) { int stringToReturn = 0; - const char *trigger_type_any_ofArray[] = { "NULL", "QUOTA_THRESHOLD", "QHT", "_FINAL", "QUOTA_EXHAUSTED", "VALIDITY_TIME", "OTHER_QUOTA_TYPE", "FORCED_REAUTHORISATION", "UNUSED_QUOTA_TIMER", "UNIT_COUNT_INACTIVITY_TIMER", "ABNORMAL_RELEASE", "QOS_CHANGE", "VOLUME_LIMIT", "TIME_LIMIT", "EVENT_LIMIT", "PLMN_CHANGE", "USER_LOCATION_CHANGE", "RAT_CHANGE", "SESSION_AMBR_CHANGE", "UE_TIMEZONE_CHANGE", "TARIFF_TIME_CHANGE", "MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS", "MANAGEMENT_INTERVENTION", "CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA", "CHANGE_OF_3GPP_PS_DATA_OFF_STATUS", "SERVING_NODE_CHANGE", "REMOVAL_OF_UPF", "ADDITION_OF_UPF", "INSERTION_OF_ISMF", "REMOVAL_OF_ISMF", "CHANGE_OF_ISMF", "START_OF_SERVICE_DATA_FLOW", "ECGI_CHANGE", "TAI_CHANGE", "HANDOVER_CANCEL", "HANDOVER_START", "HANDOVER_COMPLETE", "GFBR_GUARANTEED_STATUS_CHANGE", "ADDITION_OF_ACCESS", "REMOVAL_OF_ACCESS", "START_OF_SDF_ADDITIONAL_ACCESS" }; + const char *trigger_type_any_ofArray[] = { "NULL", "QUOTA_THRESHOLD", "QHT", "FINAL", "QUOTA_EXHAUSTED", "VALIDITY_TIME", "OTHER_QUOTA_TYPE", "FORCED_REAUTHORISATION", "UNUSED_QUOTA_TIMER", "UNIT_COUNT_INACTIVITY_TIMER", "ABNORMAL_RELEASE", "QOS_CHANGE", "VOLUME_LIMIT", "TIME_LIMIT", "EVENT_LIMIT", "PLMN_CHANGE", "USER_LOCATION_CHANGE", "RAT_CHANGE", "SESSION_AMBR_CHANGE", "UE_TIMEZONE_CHANGE", "TARIFF_TIME_CHANGE", "MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS", "MANAGEMENT_INTERVENTION", "CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA", "CHANGE_OF_3GPP_PS_DATA_OFF_STATUS", "SERVING_NODE_CHANGE", "REMOVAL_OF_UPF", "ADDITION_OF_UPF", "INSERTION_OF_ISMF", "REMOVAL_OF_ISMF", "CHANGE_OF_ISMF", "START_OF_SERVICE_DATA_FLOW", "ECGI_CHANGE", "TAI_CHANGE", "HANDOVER_CANCEL", "HANDOVER_START", "HANDOVER_COMPLETE", "GFBR_GUARANTEED_STATUS_CHANGE", "ADDITION_OF_ACCESS", "REMOVAL_OF_ACCESS", "START_OF_SDF_ADDITIONAL_ACCESS" }; size_t sizeofArray = sizeof(trigger_type_any_ofArray) / sizeof(trigger_type_any_ofArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(trigger_type_any_of, trigger_type_any_ofArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/tscai_input_container.c b/lib/sbi/openapi/model/tscai_input_container.c index ef6c4d371..d969e5611 100644 --- a/lib/sbi/openapi/model/tscai_input_container.c +++ b/lib/sbi/openapi/model/tscai_input_container.c @@ -22,17 +22,22 @@ OpenAPI_tscai_input_container_t *OpenAPI_tscai_input_container_create( void OpenAPI_tscai_input_container_free(OpenAPI_tscai_input_container_t *tscai_input_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tscai_input_container) { return; } - OpenAPI_lnode_t *node; - ogs_free(tscai_input_container->burst_arrival_time); + if (tscai_input_container->burst_arrival_time) { + ogs_free(tscai_input_container->burst_arrival_time); + tscai_input_container->burst_arrival_time = NULL; + } ogs_free(tscai_input_container); } cJSON *OpenAPI_tscai_input_container_convertToJSON(OpenAPI_tscai_input_container_t *tscai_input_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tscai_input_container == NULL) { ogs_error("OpenAPI_tscai_input_container_convertToJSON() failed [TscaiInputContainer]"); @@ -61,8 +66,10 @@ end: OpenAPI_tscai_input_container_t *OpenAPI_tscai_input_container_parseFromJSON(cJSON *tscai_input_containerJSON) { OpenAPI_tscai_input_container_t *tscai_input_container_local_var = NULL; - cJSON *periodicity = cJSON_GetObjectItemCaseSensitive(tscai_input_containerJSON, "periodicity"); - + OpenAPI_lnode_t *node = NULL; + cJSON *periodicity = NULL; + cJSON *burst_arrival_time = NULL; + periodicity = cJSON_GetObjectItemCaseSensitive(tscai_input_containerJSON, "periodicity"); if (periodicity) { if (!cJSON_IsNumber(periodicity)) { ogs_error("OpenAPI_tscai_input_container_parseFromJSON() failed [periodicity]"); @@ -70,10 +77,9 @@ OpenAPI_tscai_input_container_t *OpenAPI_tscai_input_container_parseFromJSON(cJS } } - cJSON *burst_arrival_time = cJSON_GetObjectItemCaseSensitive(tscai_input_containerJSON, "burstArrivalTime"); - + burst_arrival_time = cJSON_GetObjectItemCaseSensitive(tscai_input_containerJSON, "burstArrivalTime"); if (burst_arrival_time) { - if (!cJSON_IsString(burst_arrival_time)) { + if (!cJSON_IsString(burst_arrival_time) && !cJSON_IsNull(burst_arrival_time)) { ogs_error("OpenAPI_tscai_input_container_parseFromJSON() failed [burst_arrival_time]"); goto end; } @@ -82,7 +88,7 @@ OpenAPI_tscai_input_container_t *OpenAPI_tscai_input_container_parseFromJSON(cJS tscai_input_container_local_var = OpenAPI_tscai_input_container_create ( periodicity ? true : false, periodicity ? periodicity->valuedouble : 0, - burst_arrival_time ? ogs_strdup(burst_arrival_time->valuestring) : NULL + burst_arrival_time && !cJSON_IsNull(burst_arrival_time) ? ogs_strdup(burst_arrival_time->valuestring) : NULL ); return tscai_input_container_local_var; diff --git a/lib/sbi/openapi/model/tsn_bridge_info.c b/lib/sbi/openapi/model/tsn_bridge_info.c index 0d20b67f6..3dbdfa4a8 100644 --- a/lib/sbi/openapi/model/tsn_bridge_info.c +++ b/lib/sbi/openapi/model/tsn_bridge_info.c @@ -30,17 +30,22 @@ OpenAPI_tsn_bridge_info_t *OpenAPI_tsn_bridge_info_create( void OpenAPI_tsn_bridge_info_free(OpenAPI_tsn_bridge_info_t *tsn_bridge_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tsn_bridge_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(tsn_bridge_info->dstt_addr); + if (tsn_bridge_info->dstt_addr) { + ogs_free(tsn_bridge_info->dstt_addr); + tsn_bridge_info->dstt_addr = NULL; + } ogs_free(tsn_bridge_info); } cJSON *OpenAPI_tsn_bridge_info_convertToJSON(OpenAPI_tsn_bridge_info_t *tsn_bridge_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tsn_bridge_info == NULL) { ogs_error("OpenAPI_tsn_bridge_info_convertToJSON() failed [TsnBridgeInfo]"); @@ -83,8 +88,12 @@ end: OpenAPI_tsn_bridge_info_t *OpenAPI_tsn_bridge_info_parseFromJSON(cJSON *tsn_bridge_infoJSON) { OpenAPI_tsn_bridge_info_t *tsn_bridge_info_local_var = NULL; - cJSON *bridge_id = cJSON_GetObjectItemCaseSensitive(tsn_bridge_infoJSON, "bridgeId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *bridge_id = NULL; + cJSON *dstt_addr = NULL; + cJSON *dstt_port_num = NULL; + cJSON *dstt_resid_time = NULL; + bridge_id = cJSON_GetObjectItemCaseSensitive(tsn_bridge_infoJSON, "bridgeId"); if (bridge_id) { if (!cJSON_IsNumber(bridge_id)) { ogs_error("OpenAPI_tsn_bridge_info_parseFromJSON() failed [bridge_id]"); @@ -92,17 +101,15 @@ OpenAPI_tsn_bridge_info_t *OpenAPI_tsn_bridge_info_parseFromJSON(cJSON *tsn_brid } } - cJSON *dstt_addr = cJSON_GetObjectItemCaseSensitive(tsn_bridge_infoJSON, "dsttAddr"); - + dstt_addr = cJSON_GetObjectItemCaseSensitive(tsn_bridge_infoJSON, "dsttAddr"); if (dstt_addr) { - if (!cJSON_IsString(dstt_addr)) { + if (!cJSON_IsString(dstt_addr) && !cJSON_IsNull(dstt_addr)) { ogs_error("OpenAPI_tsn_bridge_info_parseFromJSON() failed [dstt_addr]"); goto end; } } - cJSON *dstt_port_num = cJSON_GetObjectItemCaseSensitive(tsn_bridge_infoJSON, "dsttPortNum"); - + dstt_port_num = cJSON_GetObjectItemCaseSensitive(tsn_bridge_infoJSON, "dsttPortNum"); if (dstt_port_num) { if (!cJSON_IsNumber(dstt_port_num)) { ogs_error("OpenAPI_tsn_bridge_info_parseFromJSON() failed [dstt_port_num]"); @@ -110,8 +117,7 @@ OpenAPI_tsn_bridge_info_t *OpenAPI_tsn_bridge_info_parseFromJSON(cJSON *tsn_brid } } - cJSON *dstt_resid_time = cJSON_GetObjectItemCaseSensitive(tsn_bridge_infoJSON, "dsttResidTime"); - + dstt_resid_time = cJSON_GetObjectItemCaseSensitive(tsn_bridge_infoJSON, "dsttResidTime"); if (dstt_resid_time) { if (!cJSON_IsNumber(dstt_resid_time)) { ogs_error("OpenAPI_tsn_bridge_info_parseFromJSON() failed [dstt_resid_time]"); @@ -122,7 +128,7 @@ OpenAPI_tsn_bridge_info_t *OpenAPI_tsn_bridge_info_parseFromJSON(cJSON *tsn_brid tsn_bridge_info_local_var = OpenAPI_tsn_bridge_info_create ( bridge_id ? true : false, bridge_id ? bridge_id->valuedouble : 0, - dstt_addr ? ogs_strdup(dstt_addr->valuestring) : NULL, + dstt_addr && !cJSON_IsNull(dstt_addr) ? ogs_strdup(dstt_addr->valuestring) : NULL, dstt_port_num ? true : false, dstt_port_num ? dstt_port_num->valuedouble : 0, dstt_resid_time ? true : false, diff --git a/lib/sbi/openapi/model/tsn_qos_container.c b/lib/sbi/openapi/model/tsn_qos_container.c index 1d1faba56..ba5d207a7 100644 --- a/lib/sbi/openapi/model/tsn_qos_container.c +++ b/lib/sbi/openapi/model/tsn_qos_container.c @@ -28,16 +28,18 @@ OpenAPI_tsn_qos_container_t *OpenAPI_tsn_qos_container_create( void OpenAPI_tsn_qos_container_free(OpenAPI_tsn_qos_container_t *tsn_qos_container) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tsn_qos_container) { return; } - OpenAPI_lnode_t *node; ogs_free(tsn_qos_container); } cJSON *OpenAPI_tsn_qos_container_convertToJSON(OpenAPI_tsn_qos_container_t *tsn_qos_container) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tsn_qos_container == NULL) { ogs_error("OpenAPI_tsn_qos_container_convertToJSON() failed [TsnQosContainer]"); @@ -73,8 +75,11 @@ end: OpenAPI_tsn_qos_container_t *OpenAPI_tsn_qos_container_parseFromJSON(cJSON *tsn_qos_containerJSON) { OpenAPI_tsn_qos_container_t *tsn_qos_container_local_var = NULL; - cJSON *max_tsc_burst_size = cJSON_GetObjectItemCaseSensitive(tsn_qos_containerJSON, "maxTscBurstSize"); - + OpenAPI_lnode_t *node = NULL; + cJSON *max_tsc_burst_size = NULL; + cJSON *tsc_pack_delay = NULL; + cJSON *tsc_prio_level = NULL; + max_tsc_burst_size = cJSON_GetObjectItemCaseSensitive(tsn_qos_containerJSON, "maxTscBurstSize"); if (max_tsc_burst_size) { if (!cJSON_IsNumber(max_tsc_burst_size)) { ogs_error("OpenAPI_tsn_qos_container_parseFromJSON() failed [max_tsc_burst_size]"); @@ -82,8 +87,7 @@ OpenAPI_tsn_qos_container_t *OpenAPI_tsn_qos_container_parseFromJSON(cJSON *tsn_ } } - cJSON *tsc_pack_delay = cJSON_GetObjectItemCaseSensitive(tsn_qos_containerJSON, "tscPackDelay"); - + tsc_pack_delay = cJSON_GetObjectItemCaseSensitive(tsn_qos_containerJSON, "tscPackDelay"); if (tsc_pack_delay) { if (!cJSON_IsNumber(tsc_pack_delay)) { ogs_error("OpenAPI_tsn_qos_container_parseFromJSON() failed [tsc_pack_delay]"); @@ -91,8 +95,7 @@ OpenAPI_tsn_qos_container_t *OpenAPI_tsn_qos_container_parseFromJSON(cJSON *tsn_ } } - cJSON *tsc_prio_level = cJSON_GetObjectItemCaseSensitive(tsn_qos_containerJSON, "tscPrioLevel"); - + tsc_prio_level = cJSON_GetObjectItemCaseSensitive(tsn_qos_containerJSON, "tscPrioLevel"); if (tsc_prio_level) { if (!cJSON_IsNumber(tsc_prio_level)) { ogs_error("OpenAPI_tsn_qos_container_parseFromJSON() failed [tsc_prio_level]"); diff --git a/lib/sbi/openapi/model/tsn_qos_container_rm.c b/lib/sbi/openapi/model/tsn_qos_container_rm.c index 976064da6..c7df775c1 100644 --- a/lib/sbi/openapi/model/tsn_qos_container_rm.c +++ b/lib/sbi/openapi/model/tsn_qos_container_rm.c @@ -28,16 +28,18 @@ OpenAPI_tsn_qos_container_rm_t *OpenAPI_tsn_qos_container_rm_create( void OpenAPI_tsn_qos_container_rm_free(OpenAPI_tsn_qos_container_rm_t *tsn_qos_container_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tsn_qos_container_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(tsn_qos_container_rm); } cJSON *OpenAPI_tsn_qos_container_rm_convertToJSON(OpenAPI_tsn_qos_container_rm_t *tsn_qos_container_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tsn_qos_container_rm == NULL) { ogs_error("OpenAPI_tsn_qos_container_rm_convertToJSON() failed [TsnQosContainerRm]"); @@ -73,8 +75,11 @@ end: OpenAPI_tsn_qos_container_rm_t *OpenAPI_tsn_qos_container_rm_parseFromJSON(cJSON *tsn_qos_container_rmJSON) { OpenAPI_tsn_qos_container_rm_t *tsn_qos_container_rm_local_var = NULL; - cJSON *max_tsc_burst_size = cJSON_GetObjectItemCaseSensitive(tsn_qos_container_rmJSON, "maxTscBurstSize"); - + OpenAPI_lnode_t *node = NULL; + cJSON *max_tsc_burst_size = NULL; + cJSON *tsc_pack_delay = NULL; + cJSON *tsc_prio_level = NULL; + max_tsc_burst_size = cJSON_GetObjectItemCaseSensitive(tsn_qos_container_rmJSON, "maxTscBurstSize"); if (max_tsc_burst_size) { if (!cJSON_IsNumber(max_tsc_burst_size)) { ogs_error("OpenAPI_tsn_qos_container_rm_parseFromJSON() failed [max_tsc_burst_size]"); @@ -82,8 +87,7 @@ OpenAPI_tsn_qos_container_rm_t *OpenAPI_tsn_qos_container_rm_parseFromJSON(cJSON } } - cJSON *tsc_pack_delay = cJSON_GetObjectItemCaseSensitive(tsn_qos_container_rmJSON, "tscPackDelay"); - + tsc_pack_delay = cJSON_GetObjectItemCaseSensitive(tsn_qos_container_rmJSON, "tscPackDelay"); if (tsc_pack_delay) { if (!cJSON_IsNumber(tsc_pack_delay)) { ogs_error("OpenAPI_tsn_qos_container_rm_parseFromJSON() failed [tsc_pack_delay]"); @@ -91,8 +95,7 @@ OpenAPI_tsn_qos_container_rm_t *OpenAPI_tsn_qos_container_rm_parseFromJSON(cJSON } } - cJSON *tsc_prio_level = cJSON_GetObjectItemCaseSensitive(tsn_qos_container_rmJSON, "tscPrioLevel"); - + tsc_prio_level = cJSON_GetObjectItemCaseSensitive(tsn_qos_container_rmJSON, "tscPrioLevel"); if (tsc_prio_level) { if (!cJSON_IsNumber(tsc_prio_level)) { ogs_error("OpenAPI_tsn_qos_container_rm_parseFromJSON() failed [tsc_prio_level]"); diff --git a/lib/sbi/openapi/model/tunnel_info.c b/lib/sbi/openapi/model/tunnel_info.c index f99e97e3e..5f251fa80 100644 --- a/lib/sbi/openapi/model/tunnel_info.c +++ b/lib/sbi/openapi/model/tunnel_info.c @@ -24,19 +24,30 @@ OpenAPI_tunnel_info_t *OpenAPI_tunnel_info_create( void OpenAPI_tunnel_info_free(OpenAPI_tunnel_info_t *tunnel_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == tunnel_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(tunnel_info->ipv4_addr); - ogs_free(tunnel_info->ipv6_addr); - ogs_free(tunnel_info->gtp_teid); + if (tunnel_info->ipv4_addr) { + ogs_free(tunnel_info->ipv4_addr); + tunnel_info->ipv4_addr = NULL; + } + if (tunnel_info->ipv6_addr) { + ogs_free(tunnel_info->ipv6_addr); + tunnel_info->ipv6_addr = NULL; + } + if (tunnel_info->gtp_teid) { + ogs_free(tunnel_info->gtp_teid); + tunnel_info->gtp_teid = NULL; + } ogs_free(tunnel_info); } cJSON *OpenAPI_tunnel_info_convertToJSON(OpenAPI_tunnel_info_t *tunnel_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (tunnel_info == NULL) { ogs_error("OpenAPI_tunnel_info_convertToJSON() failed [TunnelInfo]"); @@ -58,12 +69,16 @@ cJSON *OpenAPI_tunnel_info_convertToJSON(OpenAPI_tunnel_info_t *tunnel_info) } } + if (!tunnel_info->gtp_teid) { + ogs_error("OpenAPI_tunnel_info_convertToJSON() failed [gtp_teid]"); + return NULL; + } if (cJSON_AddStringToObject(item, "gtpTeid", tunnel_info->gtp_teid) == NULL) { ogs_error("OpenAPI_tunnel_info_convertToJSON() failed [gtp_teid]"); goto end; } - if (tunnel_info->an_type) { + if (tunnel_info->an_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "anType", OpenAPI_access_type_ToString(tunnel_info->an_type)) == NULL) { ogs_error("OpenAPI_tunnel_info_convertToJSON() failed [an_type]"); goto end; @@ -77,38 +92,39 @@ end: OpenAPI_tunnel_info_t *OpenAPI_tunnel_info_parseFromJSON(cJSON *tunnel_infoJSON) { OpenAPI_tunnel_info_t *tunnel_info_local_var = NULL; - cJSON *ipv4_addr = cJSON_GetObjectItemCaseSensitive(tunnel_infoJSON, "ipv4Addr"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_addr = NULL; + cJSON *ipv6_addr = NULL; + cJSON *gtp_teid = NULL; + cJSON *an_type = NULL; + OpenAPI_access_type_e an_typeVariable = 0; + ipv4_addr = cJSON_GetObjectItemCaseSensitive(tunnel_infoJSON, "ipv4Addr"); if (ipv4_addr) { - if (!cJSON_IsString(ipv4_addr)) { + if (!cJSON_IsString(ipv4_addr) && !cJSON_IsNull(ipv4_addr)) { ogs_error("OpenAPI_tunnel_info_parseFromJSON() failed [ipv4_addr]"); goto end; } } - cJSON *ipv6_addr = cJSON_GetObjectItemCaseSensitive(tunnel_infoJSON, "ipv6Addr"); - + ipv6_addr = cJSON_GetObjectItemCaseSensitive(tunnel_infoJSON, "ipv6Addr"); if (ipv6_addr) { - if (!cJSON_IsString(ipv6_addr)) { + if (!cJSON_IsString(ipv6_addr) && !cJSON_IsNull(ipv6_addr)) { ogs_error("OpenAPI_tunnel_info_parseFromJSON() failed [ipv6_addr]"); goto end; } } - cJSON *gtp_teid = cJSON_GetObjectItemCaseSensitive(tunnel_infoJSON, "gtpTeid"); + gtp_teid = cJSON_GetObjectItemCaseSensitive(tunnel_infoJSON, "gtpTeid"); if (!gtp_teid) { ogs_error("OpenAPI_tunnel_info_parseFromJSON() failed [gtp_teid]"); goto end; } - if (!cJSON_IsString(gtp_teid)) { ogs_error("OpenAPI_tunnel_info_parseFromJSON() failed [gtp_teid]"); goto end; } - cJSON *an_type = cJSON_GetObjectItemCaseSensitive(tunnel_infoJSON, "anType"); - - OpenAPI_access_type_e an_typeVariable; + an_type = cJSON_GetObjectItemCaseSensitive(tunnel_infoJSON, "anType"); if (an_type) { if (!cJSON_IsString(an_type)) { ogs_error("OpenAPI_tunnel_info_parseFromJSON() failed [an_type]"); @@ -118,8 +134,8 @@ OpenAPI_tunnel_info_t *OpenAPI_tunnel_info_parseFromJSON(cJSON *tunnel_infoJSON) } tunnel_info_local_var = OpenAPI_tunnel_info_create ( - ipv4_addr ? ogs_strdup(ipv4_addr->valuestring) : NULL, - ipv6_addr ? ogs_strdup(ipv6_addr->valuestring) : NULL, + ipv4_addr && !cJSON_IsNull(ipv4_addr) ? ogs_strdup(ipv4_addr->valuestring) : NULL, + ipv6_addr && !cJSON_IsNull(ipv6_addr) ? ogs_strdup(ipv6_addr->valuestring) : NULL, ogs_strdup(gtp_teid->valuestring), an_type ? an_typeVariable : 0 ); diff --git a/lib/sbi/openapi/model/twap_id.c b/lib/sbi/openapi/model/twap_id.c index 455b0295a..0c14bcb85 100644 --- a/lib/sbi/openapi/model/twap_id.c +++ b/lib/sbi/openapi/model/twap_id.c @@ -7,7 +7,7 @@ OpenAPI_twap_id_t *OpenAPI_twap_id_create( char *ss_id, char *bss_id, - char civic_address + char *civic_address ) { OpenAPI_twap_id_t *twap_id_local_var = ogs_malloc(sizeof(OpenAPI_twap_id_t)); @@ -22,18 +22,30 @@ OpenAPI_twap_id_t *OpenAPI_twap_id_create( void OpenAPI_twap_id_free(OpenAPI_twap_id_t *twap_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == twap_id) { return; } - OpenAPI_lnode_t *node; - ogs_free(twap_id->ss_id); - ogs_free(twap_id->bss_id); + if (twap_id->ss_id) { + ogs_free(twap_id->ss_id); + twap_id->ss_id = NULL; + } + if (twap_id->bss_id) { + ogs_free(twap_id->bss_id); + twap_id->bss_id = NULL; + } + if (twap_id->civic_address) { + ogs_free(twap_id->civic_address); + twap_id->civic_address = NULL; + } ogs_free(twap_id); } cJSON *OpenAPI_twap_id_convertToJSON(OpenAPI_twap_id_t *twap_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (twap_id == NULL) { ogs_error("OpenAPI_twap_id_convertToJSON() failed [TwapId]"); @@ -41,6 +53,10 @@ cJSON *OpenAPI_twap_id_convertToJSON(OpenAPI_twap_id_t *twap_id) } item = cJSON_CreateObject(); + if (!twap_id->ss_id) { + ogs_error("OpenAPI_twap_id_convertToJSON() failed [ss_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ssId", twap_id->ss_id) == NULL) { ogs_error("OpenAPI_twap_id_convertToJSON() failed [ss_id]"); goto end; @@ -54,7 +70,7 @@ cJSON *OpenAPI_twap_id_convertToJSON(OpenAPI_twap_id_t *twap_id) } if (twap_id->civic_address) { - if (cJSON_AddNumberToObject(item, "civicAddress", twap_id->civic_address) == NULL) { + if (cJSON_AddStringToObject(item, "civicAddress", twap_id->civic_address) == NULL) { ogs_error("OpenAPI_twap_id_convertToJSON() failed [civic_address]"); goto end; } @@ -67,30 +83,31 @@ end: OpenAPI_twap_id_t *OpenAPI_twap_id_parseFromJSON(cJSON *twap_idJSON) { OpenAPI_twap_id_t *twap_id_local_var = NULL; - cJSON *ss_id = cJSON_GetObjectItemCaseSensitive(twap_idJSON, "ssId"); + OpenAPI_lnode_t *node = NULL; + cJSON *ss_id = NULL; + cJSON *bss_id = NULL; + cJSON *civic_address = NULL; + ss_id = cJSON_GetObjectItemCaseSensitive(twap_idJSON, "ssId"); if (!ss_id) { ogs_error("OpenAPI_twap_id_parseFromJSON() failed [ss_id]"); goto end; } - if (!cJSON_IsString(ss_id)) { ogs_error("OpenAPI_twap_id_parseFromJSON() failed [ss_id]"); goto end; } - cJSON *bss_id = cJSON_GetObjectItemCaseSensitive(twap_idJSON, "bssId"); - + bss_id = cJSON_GetObjectItemCaseSensitive(twap_idJSON, "bssId"); if (bss_id) { - if (!cJSON_IsString(bss_id)) { + if (!cJSON_IsString(bss_id) && !cJSON_IsNull(bss_id)) { ogs_error("OpenAPI_twap_id_parseFromJSON() failed [bss_id]"); goto end; } } - cJSON *civic_address = cJSON_GetObjectItemCaseSensitive(twap_idJSON, "civicAddress"); - + civic_address = cJSON_GetObjectItemCaseSensitive(twap_idJSON, "civicAddress"); if (civic_address) { - if (!cJSON_IsNumber(civic_address)) { + if (!cJSON_IsString(civic_address) && !cJSON_IsNull(civic_address)) { ogs_error("OpenAPI_twap_id_parseFromJSON() failed [civic_address]"); goto end; } @@ -98,8 +115,8 @@ OpenAPI_twap_id_t *OpenAPI_twap_id_parseFromJSON(cJSON *twap_idJSON) twap_id_local_var = OpenAPI_twap_id_create ( ogs_strdup(ss_id->valuestring), - bss_id ? ogs_strdup(bss_id->valuestring) : NULL, - civic_address ? civic_address->valueint : 0 + bss_id && !cJSON_IsNull(bss_id) ? ogs_strdup(bss_id->valuestring) : NULL, + civic_address && !cJSON_IsNull(civic_address) ? ogs_strdup(civic_address->valuestring) : NULL ); return twap_id_local_var; diff --git a/lib/sbi/openapi/model/twap_id.h b/lib/sbi/openapi/model/twap_id.h index 9d8c0f989..ea91a4572 100644 --- a/lib/sbi/openapi/model/twap_id.h +++ b/lib/sbi/openapi/model/twap_id.h @@ -21,13 +21,13 @@ typedef struct OpenAPI_twap_id_s OpenAPI_twap_id_t; typedef struct OpenAPI_twap_id_s { char *ss_id; char *bss_id; - char civic_address; + char *civic_address; } OpenAPI_twap_id_t; OpenAPI_twap_id_t *OpenAPI_twap_id_create( char *ss_id, char *bss_id, - char civic_address + char *civic_address ); void OpenAPI_twap_id_free(OpenAPI_twap_id_t *twap_id); OpenAPI_twap_id_t *OpenAPI_twap_id_parseFromJSON(cJSON *twap_idJSON); diff --git a/lib/sbi/openapi/model/twif_info.c b/lib/sbi/openapi/model/twif_info.c index ccf74a1f6..9a7f86f30 100644 --- a/lib/sbi/openapi/model/twif_info.c +++ b/lib/sbi/openapi/model/twif_info.c @@ -22,25 +22,36 @@ OpenAPI_twif_info_t *OpenAPI_twif_info_create( void OpenAPI_twif_info_free(OpenAPI_twif_info_t *twif_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == twif_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(twif_info->ipv4_endpoint_addresses, node) { - ogs_free(node->data); + if (twif_info->ipv4_endpoint_addresses) { + OpenAPI_list_for_each(twif_info->ipv4_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(twif_info->ipv4_endpoint_addresses); + twif_info->ipv4_endpoint_addresses = NULL; } - OpenAPI_list_free(twif_info->ipv4_endpoint_addresses); - OpenAPI_list_for_each(twif_info->ipv6_endpoint_addresses, node) { - ogs_free(node->data); + if (twif_info->ipv6_endpoint_addresses) { + OpenAPI_list_for_each(twif_info->ipv6_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(twif_info->ipv6_endpoint_addresses); + twif_info->ipv6_endpoint_addresses = NULL; + } + if (twif_info->endpoint_fqdn) { + ogs_free(twif_info->endpoint_fqdn); + twif_info->endpoint_fqdn = NULL; } - OpenAPI_list_free(twif_info->ipv6_endpoint_addresses); - ogs_free(twif_info->endpoint_fqdn); ogs_free(twif_info); } cJSON *OpenAPI_twif_info_convertToJSON(OpenAPI_twif_info_t *twif_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (twif_info == NULL) { ogs_error("OpenAPI_twif_info_convertToJSON() failed [TwifInfo]"); @@ -49,35 +60,31 @@ cJSON *OpenAPI_twif_info_convertToJSON(OpenAPI_twif_info_t *twif_info) item = cJSON_CreateObject(); if (twif_info->ipv4_endpoint_addresses) { - cJSON *ipv4_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); - if (ipv4_endpoint_addresses == NULL) { + cJSON *ipv4_endpoint_addressesList = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); + if (ipv4_endpoint_addressesList == NULL) { ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv4_endpoint_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv4_endpoint_addresses_node; - OpenAPI_list_for_each(twif_info->ipv4_endpoint_addresses, ipv4_endpoint_addresses_node) { - if (cJSON_AddStringToObject(ipv4_endpoint_addresses, "", (char*)ipv4_endpoint_addresses_node->data) == NULL) { - ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv4_endpoint_addresses]"); - goto end; + OpenAPI_list_for_each(twif_info->ipv4_endpoint_addresses, node) { + if (cJSON_AddStringToObject(ipv4_endpoint_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } } - } } if (twif_info->ipv6_endpoint_addresses) { - cJSON *ipv6_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); - if (ipv6_endpoint_addresses == NULL) { + cJSON *ipv6_endpoint_addressesList = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); + if (ipv6_endpoint_addressesList == NULL) { ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv6_endpoint_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv6_endpoint_addresses_node; - OpenAPI_list_for_each(twif_info->ipv6_endpoint_addresses, ipv6_endpoint_addresses_node) { - if (cJSON_AddStringToObject(ipv6_endpoint_addresses, "", (char*)ipv6_endpoint_addresses_node->data) == NULL) { - ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv6_endpoint_addresses]"); - goto end; + OpenAPI_list_for_each(twif_info->ipv6_endpoint_addresses, node) { + if (cJSON_AddStringToObject(ipv6_endpoint_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_twif_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } } - } } if (twif_info->endpoint_fqdn) { @@ -94,50 +101,57 @@ end: OpenAPI_twif_info_t *OpenAPI_twif_info_parseFromJSON(cJSON *twif_infoJSON) { OpenAPI_twif_info_t *twif_info_local_var = NULL; - cJSON *ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "ipv4EndpointAddresses"); - - OpenAPI_list_t *ipv4_endpoint_addressesList; + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_endpoint_addresses = NULL; + OpenAPI_list_t *ipv4_endpoint_addressesList = NULL; + cJSON *ipv6_endpoint_addresses = NULL; + OpenAPI_list_t *ipv6_endpoint_addressesList = NULL; + cJSON *endpoint_fqdn = NULL; + ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "ipv4EndpointAddresses"); if (ipv4_endpoint_addresses) { - cJSON *ipv4_endpoint_addresses_local; - if (!cJSON_IsArray(ipv4_endpoint_addresses)) { - ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); - goto end; - } - ipv4_endpoint_addressesList = OpenAPI_list_create(); + cJSON *ipv4_endpoint_addresses_local = NULL; + if (!cJSON_IsArray(ipv4_endpoint_addresses)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { - if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { - ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); - goto end; - } - OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); - } + ipv4_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); + } } - cJSON *ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "ipv6EndpointAddresses"); - - OpenAPI_list_t *ipv6_endpoint_addressesList; + ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "ipv6EndpointAddresses"); if (ipv6_endpoint_addresses) { - cJSON *ipv6_endpoint_addresses_local; - if (!cJSON_IsArray(ipv6_endpoint_addresses)) { - ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); - goto end; - } - ipv6_endpoint_addressesList = OpenAPI_list_create(); + cJSON *ipv6_endpoint_addresses_local = NULL; + if (!cJSON_IsArray(ipv6_endpoint_addresses)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { - if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { - ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); - goto end; - } - OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); - } + ipv6_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { + ogs_error("OpenAPI_twif_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); + } } - cJSON *endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "endpointFqdn"); - + endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(twif_infoJSON, "endpointFqdn"); if (endpoint_fqdn) { - if (!cJSON_IsString(endpoint_fqdn)) { + if (!cJSON_IsString(endpoint_fqdn) && !cJSON_IsNull(endpoint_fqdn)) { ogs_error("OpenAPI_twif_info_parseFromJSON() failed [endpoint_fqdn]"); goto end; } @@ -146,11 +160,25 @@ OpenAPI_twif_info_t *OpenAPI_twif_info_parseFromJSON(cJSON *twif_infoJSON) twif_info_local_var = OpenAPI_twif_info_create ( ipv4_endpoint_addresses ? ipv4_endpoint_addressesList : NULL, ipv6_endpoint_addresses ? ipv6_endpoint_addressesList : NULL, - endpoint_fqdn ? ogs_strdup(endpoint_fqdn->valuestring) : NULL + endpoint_fqdn && !cJSON_IsNull(endpoint_fqdn) ? ogs_strdup(endpoint_fqdn->valuestring) : NULL ); return twif_info_local_var; end: + if (ipv4_endpoint_addressesList) { + OpenAPI_list_for_each(ipv4_endpoint_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_endpoint_addressesList); + ipv4_endpoint_addressesList = NULL; + } + if (ipv6_endpoint_addressesList) { + OpenAPI_list_for_each(ipv6_endpoint_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_endpoint_addressesList); + ipv6_endpoint_addressesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/udm_info.c b/lib/sbi/openapi/model/udm_info.c index 8479aa607..df702257b 100644 --- a/lib/sbi/openapi/model/udm_info.c +++ b/lib/sbi/openapi/model/udm_info.c @@ -28,37 +28,57 @@ OpenAPI_udm_info_t *OpenAPI_udm_info_create( void OpenAPI_udm_info_free(OpenAPI_udm_info_t *udm_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == udm_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(udm_info->group_id); - OpenAPI_list_for_each(udm_info->supi_ranges, node) { - OpenAPI_supi_range_free(node->data); + if (udm_info->group_id) { + ogs_free(udm_info->group_id); + udm_info->group_id = NULL; } - OpenAPI_list_free(udm_info->supi_ranges); - OpenAPI_list_for_each(udm_info->gpsi_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (udm_info->supi_ranges) { + OpenAPI_list_for_each(udm_info->supi_ranges, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(udm_info->supi_ranges); + udm_info->supi_ranges = NULL; } - OpenAPI_list_free(udm_info->gpsi_ranges); - OpenAPI_list_for_each(udm_info->external_group_identifiers_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (udm_info->gpsi_ranges) { + OpenAPI_list_for_each(udm_info->gpsi_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(udm_info->gpsi_ranges); + udm_info->gpsi_ranges = NULL; } - OpenAPI_list_free(udm_info->external_group_identifiers_ranges); - OpenAPI_list_for_each(udm_info->routing_indicators, node) { - ogs_free(node->data); + if (udm_info->external_group_identifiers_ranges) { + OpenAPI_list_for_each(udm_info->external_group_identifiers_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(udm_info->external_group_identifiers_ranges); + udm_info->external_group_identifiers_ranges = NULL; } - OpenAPI_list_free(udm_info->routing_indicators); - OpenAPI_list_for_each(udm_info->internal_group_identifiers_ranges, node) { - OpenAPI_internal_group_id_range_free(node->data); + if (udm_info->routing_indicators) { + OpenAPI_list_for_each(udm_info->routing_indicators, node) { + ogs_free(node->data); + } + OpenAPI_list_free(udm_info->routing_indicators); + udm_info->routing_indicators = NULL; + } + if (udm_info->internal_group_identifiers_ranges) { + OpenAPI_list_for_each(udm_info->internal_group_identifiers_ranges, node) { + OpenAPI_internal_group_id_range_free(node->data); + } + OpenAPI_list_free(udm_info->internal_group_identifiers_ranges); + udm_info->internal_group_identifiers_ranges = NULL; } - OpenAPI_list_free(udm_info->internal_group_identifiers_ranges); ogs_free(udm_info); } cJSON *OpenAPI_udm_info_convertToJSON(OpenAPI_udm_info_t *udm_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (udm_info == NULL) { ogs_error("OpenAPI_udm_info_convertToJSON() failed [UdmInfo]"); @@ -79,17 +99,13 @@ cJSON *OpenAPI_udm_info_convertToJSON(OpenAPI_udm_info_t *udm_info) ogs_error("OpenAPI_udm_info_convertToJSON() failed [supi_ranges]"); goto end; } - - OpenAPI_lnode_t *supi_ranges_node; - if (udm_info->supi_ranges) { - OpenAPI_list_for_each(udm_info->supi_ranges, supi_ranges_node) { - cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(supi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udm_info_convertToJSON() failed [supi_ranges]"); - goto end; - } - cJSON_AddItemToArray(supi_rangesList, itemLocal); + OpenAPI_list_for_each(udm_info->supi_ranges, node) { + cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udm_info_convertToJSON() failed [supi_ranges]"); + goto end; } + cJSON_AddItemToArray(supi_rangesList, itemLocal); } } @@ -99,17 +115,13 @@ cJSON *OpenAPI_udm_info_convertToJSON(OpenAPI_udm_info_t *udm_info) ogs_error("OpenAPI_udm_info_convertToJSON() failed [gpsi_ranges]"); goto end; } - - OpenAPI_lnode_t *gpsi_ranges_node; - if (udm_info->gpsi_ranges) { - OpenAPI_list_for_each(udm_info->gpsi_ranges, gpsi_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(gpsi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udm_info_convertToJSON() failed [gpsi_ranges]"); - goto end; - } - cJSON_AddItemToArray(gpsi_rangesList, itemLocal); + OpenAPI_list_for_each(udm_info->gpsi_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udm_info_convertToJSON() failed [gpsi_ranges]"); + goto end; } + cJSON_AddItemToArray(gpsi_rangesList, itemLocal); } } @@ -119,34 +131,28 @@ cJSON *OpenAPI_udm_info_convertToJSON(OpenAPI_udm_info_t *udm_info) ogs_error("OpenAPI_udm_info_convertToJSON() failed [external_group_identifiers_ranges]"); goto end; } - - OpenAPI_lnode_t *external_group_identifiers_ranges_node; - if (udm_info->external_group_identifiers_ranges) { - OpenAPI_list_for_each(udm_info->external_group_identifiers_ranges, external_group_identifiers_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(external_group_identifiers_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udm_info_convertToJSON() failed [external_group_identifiers_ranges]"); - goto end; - } - cJSON_AddItemToArray(external_group_identifiers_rangesList, itemLocal); + OpenAPI_list_for_each(udm_info->external_group_identifiers_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udm_info_convertToJSON() failed [external_group_identifiers_ranges]"); + goto end; } + cJSON_AddItemToArray(external_group_identifiers_rangesList, itemLocal); } } if (udm_info->routing_indicators) { - cJSON *routing_indicators = cJSON_AddArrayToObject(item, "routingIndicators"); - if (routing_indicators == NULL) { + cJSON *routing_indicatorsList = cJSON_AddArrayToObject(item, "routingIndicators"); + if (routing_indicatorsList == NULL) { ogs_error("OpenAPI_udm_info_convertToJSON() failed [routing_indicators]"); goto end; } - - OpenAPI_lnode_t *routing_indicators_node; - OpenAPI_list_for_each(udm_info->routing_indicators, routing_indicators_node) { - if (cJSON_AddStringToObject(routing_indicators, "", (char*)routing_indicators_node->data) == NULL) { - ogs_error("OpenAPI_udm_info_convertToJSON() failed [routing_indicators]"); - goto end; + OpenAPI_list_for_each(udm_info->routing_indicators, node) { + if (cJSON_AddStringToObject(routing_indicatorsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_udm_info_convertToJSON() failed [routing_indicators]"); + goto end; + } } - } } if (udm_info->internal_group_identifiers_ranges) { @@ -155,17 +161,13 @@ cJSON *OpenAPI_udm_info_convertToJSON(OpenAPI_udm_info_t *udm_info) ogs_error("OpenAPI_udm_info_convertToJSON() failed [internal_group_identifiers_ranges]"); goto end; } - - OpenAPI_lnode_t *internal_group_identifiers_ranges_node; - if (udm_info->internal_group_identifiers_ranges) { - OpenAPI_list_for_each(udm_info->internal_group_identifiers_ranges, internal_group_identifiers_ranges_node) { - cJSON *itemLocal = OpenAPI_internal_group_id_range_convertToJSON(internal_group_identifiers_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udm_info_convertToJSON() failed [internal_group_identifiers_ranges]"); - goto end; - } - cJSON_AddItemToArray(internal_group_identifiers_rangesList, itemLocal); + OpenAPI_list_for_each(udm_info->internal_group_identifiers_ranges, node) { + cJSON *itemLocal = OpenAPI_internal_group_id_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udm_info_convertToJSON() failed [internal_group_identifiers_ranges]"); + goto end; } + cJSON_AddItemToArray(internal_group_identifiers_rangesList, itemLocal); } } @@ -176,153 +178,149 @@ end: OpenAPI_udm_info_t *OpenAPI_udm_info_parseFromJSON(cJSON *udm_infoJSON) { OpenAPI_udm_info_t *udm_info_local_var = NULL; - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "groupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *group_id = NULL; + cJSON *supi_ranges = NULL; + OpenAPI_list_t *supi_rangesList = NULL; + cJSON *gpsi_ranges = NULL; + OpenAPI_list_t *gpsi_rangesList = NULL; + cJSON *external_group_identifiers_ranges = NULL; + OpenAPI_list_t *external_group_identifiers_rangesList = NULL; + cJSON *routing_indicators = NULL; + OpenAPI_list_t *routing_indicatorsList = NULL; + cJSON *internal_group_identifiers_ranges = NULL; + OpenAPI_list_t *internal_group_identifiers_rangesList = NULL; + group_id = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_udm_info_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *supi_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "supiRanges"); - - OpenAPI_list_t *supi_rangesList; + supi_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "supiRanges"); if (supi_ranges) { - cJSON *supi_ranges_local_nonprimitive; - if (!cJSON_IsArray(supi_ranges)){ - ogs_error("OpenAPI_udm_info_parseFromJSON() failed [supi_ranges]"); - goto end; - } - - supi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(supi_ranges_local_nonprimitive, supi_ranges ) { - if (!cJSON_IsObject(supi_ranges_local_nonprimitive)) { + cJSON *supi_ranges_local = NULL; + if (!cJSON_IsArray(supi_ranges)) { ogs_error("OpenAPI_udm_info_parseFromJSON() failed [supi_ranges]"); goto end; } - OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local_nonprimitive); - if (!supi_rangesItem) { - ogs_error("No supi_rangesItem"); - OpenAPI_list_free(supi_rangesList); - goto end; + supi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_ranges_local, supi_ranges) { + if (!cJSON_IsObject(supi_ranges_local)) { + ogs_error("OpenAPI_udm_info_parseFromJSON() failed [supi_ranges]"); + goto end; + } + OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local); + if (!supi_rangesItem) { + ogs_error("No supi_rangesItem"); + OpenAPI_list_free(supi_rangesList); + goto end; + } + OpenAPI_list_add(supi_rangesList, supi_rangesItem); } - - OpenAPI_list_add(supi_rangesList, supi_rangesItem); - } } - cJSON *gpsi_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "gpsiRanges"); - - OpenAPI_list_t *gpsi_rangesList; + gpsi_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "gpsiRanges"); if (gpsi_ranges) { - cJSON *gpsi_ranges_local_nonprimitive; - if (!cJSON_IsArray(gpsi_ranges)){ - ogs_error("OpenAPI_udm_info_parseFromJSON() failed [gpsi_ranges]"); - goto end; - } - - gpsi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(gpsi_ranges_local_nonprimitive, gpsi_ranges ) { - if (!cJSON_IsObject(gpsi_ranges_local_nonprimitive)) { + cJSON *gpsi_ranges_local = NULL; + if (!cJSON_IsArray(gpsi_ranges)) { ogs_error("OpenAPI_udm_info_parseFromJSON() failed [gpsi_ranges]"); goto end; } - OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local_nonprimitive); - if (!gpsi_rangesItem) { - ogs_error("No gpsi_rangesItem"); - OpenAPI_list_free(gpsi_rangesList); - goto end; + gpsi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_ranges_local, gpsi_ranges) { + if (!cJSON_IsObject(gpsi_ranges_local)) { + ogs_error("OpenAPI_udm_info_parseFromJSON() failed [gpsi_ranges]"); + goto end; + } + OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local); + if (!gpsi_rangesItem) { + ogs_error("No gpsi_rangesItem"); + OpenAPI_list_free(gpsi_rangesList); + goto end; + } + OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); } - - OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); - } } - cJSON *external_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "externalGroupIdentifiersRanges"); - - OpenAPI_list_t *external_group_identifiers_rangesList; + external_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "externalGroupIdentifiersRanges"); if (external_group_identifiers_ranges) { - cJSON *external_group_identifiers_ranges_local_nonprimitive; - if (!cJSON_IsArray(external_group_identifiers_ranges)){ - ogs_error("OpenAPI_udm_info_parseFromJSON() failed [external_group_identifiers_ranges]"); - goto end; - } - - external_group_identifiers_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(external_group_identifiers_ranges_local_nonprimitive, external_group_identifiers_ranges ) { - if (!cJSON_IsObject(external_group_identifiers_ranges_local_nonprimitive)) { + cJSON *external_group_identifiers_ranges_local = NULL; + if (!cJSON_IsArray(external_group_identifiers_ranges)) { ogs_error("OpenAPI_udm_info_parseFromJSON() failed [external_group_identifiers_ranges]"); goto end; } - OpenAPI_identity_range_t *external_group_identifiers_rangesItem = OpenAPI_identity_range_parseFromJSON(external_group_identifiers_ranges_local_nonprimitive); - if (!external_group_identifiers_rangesItem) { - ogs_error("No external_group_identifiers_rangesItem"); - OpenAPI_list_free(external_group_identifiers_rangesList); + external_group_identifiers_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(external_group_identifiers_ranges_local, external_group_identifiers_ranges) { + if (!cJSON_IsObject(external_group_identifiers_ranges_local)) { + ogs_error("OpenAPI_udm_info_parseFromJSON() failed [external_group_identifiers_ranges]"); + goto end; + } + OpenAPI_identity_range_t *external_group_identifiers_rangesItem = OpenAPI_identity_range_parseFromJSON(external_group_identifiers_ranges_local); + if (!external_group_identifiers_rangesItem) { + ogs_error("No external_group_identifiers_rangesItem"); + OpenAPI_list_free(external_group_identifiers_rangesList); + goto end; + } + OpenAPI_list_add(external_group_identifiers_rangesList, external_group_identifiers_rangesItem); + } + } + + routing_indicators = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "routingIndicators"); + if (routing_indicators) { + cJSON *routing_indicators_local = NULL; + if (!cJSON_IsArray(routing_indicators)) { + ogs_error("OpenAPI_udm_info_parseFromJSON() failed [routing_indicators]"); goto end; } - OpenAPI_list_add(external_group_identifiers_rangesList, external_group_identifiers_rangesItem); - } + routing_indicatorsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(routing_indicators_local, routing_indicators) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(routing_indicators_local)) { + ogs_error("OpenAPI_udm_info_parseFromJSON() failed [routing_indicators]"); + goto end; + } + OpenAPI_list_add(routing_indicatorsList, ogs_strdup(routing_indicators_local->valuestring)); + } } - cJSON *routing_indicators = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "routingIndicators"); - - OpenAPI_list_t *routing_indicatorsList; - if (routing_indicators) { - cJSON *routing_indicators_local; - if (!cJSON_IsArray(routing_indicators)) { - ogs_error("OpenAPI_udm_info_parseFromJSON() failed [routing_indicators]"); - goto end; - } - routing_indicatorsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(routing_indicators_local, routing_indicators) { - if (!cJSON_IsString(routing_indicators_local)) { - ogs_error("OpenAPI_udm_info_parseFromJSON() failed [routing_indicators]"); - goto end; - } - OpenAPI_list_add(routing_indicatorsList, ogs_strdup(routing_indicators_local->valuestring)); - } - } - - cJSON *internal_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "internalGroupIdentifiersRanges"); - - OpenAPI_list_t *internal_group_identifiers_rangesList; + internal_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(udm_infoJSON, "internalGroupIdentifiersRanges"); if (internal_group_identifiers_ranges) { - cJSON *internal_group_identifiers_ranges_local_nonprimitive; - if (!cJSON_IsArray(internal_group_identifiers_ranges)){ - ogs_error("OpenAPI_udm_info_parseFromJSON() failed [internal_group_identifiers_ranges]"); - goto end; - } - - internal_group_identifiers_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(internal_group_identifiers_ranges_local_nonprimitive, internal_group_identifiers_ranges ) { - if (!cJSON_IsObject(internal_group_identifiers_ranges_local_nonprimitive)) { + cJSON *internal_group_identifiers_ranges_local = NULL; + if (!cJSON_IsArray(internal_group_identifiers_ranges)) { ogs_error("OpenAPI_udm_info_parseFromJSON() failed [internal_group_identifiers_ranges]"); goto end; } - OpenAPI_internal_group_id_range_t *internal_group_identifiers_rangesItem = OpenAPI_internal_group_id_range_parseFromJSON(internal_group_identifiers_ranges_local_nonprimitive); - if (!internal_group_identifiers_rangesItem) { - ogs_error("No internal_group_identifiers_rangesItem"); - OpenAPI_list_free(internal_group_identifiers_rangesList); - goto end; + internal_group_identifiers_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(internal_group_identifiers_ranges_local, internal_group_identifiers_ranges) { + if (!cJSON_IsObject(internal_group_identifiers_ranges_local)) { + ogs_error("OpenAPI_udm_info_parseFromJSON() failed [internal_group_identifiers_ranges]"); + goto end; + } + OpenAPI_internal_group_id_range_t *internal_group_identifiers_rangesItem = OpenAPI_internal_group_id_range_parseFromJSON(internal_group_identifiers_ranges_local); + if (!internal_group_identifiers_rangesItem) { + ogs_error("No internal_group_identifiers_rangesItem"); + OpenAPI_list_free(internal_group_identifiers_rangesList); + goto end; + } + OpenAPI_list_add(internal_group_identifiers_rangesList, internal_group_identifiers_rangesItem); } - - OpenAPI_list_add(internal_group_identifiers_rangesList, internal_group_identifiers_rangesItem); - } } udm_info_local_var = OpenAPI_udm_info_create ( - group_id ? ogs_strdup(group_id->valuestring) : NULL, + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, supi_ranges ? supi_rangesList : NULL, gpsi_ranges ? gpsi_rangesList : NULL, external_group_identifiers_ranges ? external_group_identifiers_rangesList : NULL, @@ -332,6 +330,41 @@ OpenAPI_udm_info_t *OpenAPI_udm_info_parseFromJSON(cJSON *udm_infoJSON) return udm_info_local_var; end: + if (supi_rangesList) { + OpenAPI_list_for_each(supi_rangesList, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(supi_rangesList); + supi_rangesList = NULL; + } + if (gpsi_rangesList) { + OpenAPI_list_for_each(gpsi_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(gpsi_rangesList); + gpsi_rangesList = NULL; + } + if (external_group_identifiers_rangesList) { + OpenAPI_list_for_each(external_group_identifiers_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(external_group_identifiers_rangesList); + external_group_identifiers_rangesList = NULL; + } + if (routing_indicatorsList) { + OpenAPI_list_for_each(routing_indicatorsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(routing_indicatorsList); + routing_indicatorsList = NULL; + } + if (internal_group_identifiers_rangesList) { + OpenAPI_list_for_each(internal_group_identifiers_rangesList, node) { + OpenAPI_internal_group_id_range_free(node->data); + } + OpenAPI_list_free(internal_group_identifiers_rangesList); + internal_group_identifiers_rangesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/udr_info.c b/lib/sbi/openapi/model/udr_info.c index 5983c367b..a21303da2 100644 --- a/lib/sbi/openapi/model/udr_info.c +++ b/lib/sbi/openapi/model/udr_info.c @@ -26,30 +26,47 @@ OpenAPI_udr_info_t *OpenAPI_udr_info_create( void OpenAPI_udr_info_free(OpenAPI_udr_info_t *udr_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == udr_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(udr_info->group_id); - OpenAPI_list_for_each(udr_info->supi_ranges, node) { - OpenAPI_supi_range_free(node->data); + if (udr_info->group_id) { + ogs_free(udr_info->group_id); + udr_info->group_id = NULL; } - OpenAPI_list_free(udr_info->supi_ranges); - OpenAPI_list_for_each(udr_info->gpsi_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (udr_info->supi_ranges) { + OpenAPI_list_for_each(udr_info->supi_ranges, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(udr_info->supi_ranges); + udr_info->supi_ranges = NULL; } - OpenAPI_list_free(udr_info->gpsi_ranges); - OpenAPI_list_for_each(udr_info->external_group_identifiers_ranges, node) { - OpenAPI_identity_range_free(node->data); + if (udr_info->gpsi_ranges) { + OpenAPI_list_for_each(udr_info->gpsi_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(udr_info->gpsi_ranges); + udr_info->gpsi_ranges = NULL; + } + if (udr_info->external_group_identifiers_ranges) { + OpenAPI_list_for_each(udr_info->external_group_identifiers_ranges, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(udr_info->external_group_identifiers_ranges); + udr_info->external_group_identifiers_ranges = NULL; + } + if (udr_info->supported_data_sets) { + OpenAPI_list_free(udr_info->supported_data_sets); + udr_info->supported_data_sets = NULL; } - OpenAPI_list_free(udr_info->external_group_identifiers_ranges); - OpenAPI_list_free(udr_info->supported_data_sets); ogs_free(udr_info); } cJSON *OpenAPI_udr_info_convertToJSON(OpenAPI_udr_info_t *udr_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (udr_info == NULL) { ogs_error("OpenAPI_udr_info_convertToJSON() failed [UdrInfo]"); @@ -70,17 +87,13 @@ cJSON *OpenAPI_udr_info_convertToJSON(OpenAPI_udr_info_t *udr_info) ogs_error("OpenAPI_udr_info_convertToJSON() failed [supi_ranges]"); goto end; } - - OpenAPI_lnode_t *supi_ranges_node; - if (udr_info->supi_ranges) { - OpenAPI_list_for_each(udr_info->supi_ranges, supi_ranges_node) { - cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(supi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udr_info_convertToJSON() failed [supi_ranges]"); - goto end; - } - cJSON_AddItemToArray(supi_rangesList, itemLocal); + OpenAPI_list_for_each(udr_info->supi_ranges, node) { + cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udr_info_convertToJSON() failed [supi_ranges]"); + goto end; } + cJSON_AddItemToArray(supi_rangesList, itemLocal); } } @@ -90,17 +103,13 @@ cJSON *OpenAPI_udr_info_convertToJSON(OpenAPI_udr_info_t *udr_info) ogs_error("OpenAPI_udr_info_convertToJSON() failed [gpsi_ranges]"); goto end; } - - OpenAPI_lnode_t *gpsi_ranges_node; - if (udr_info->gpsi_ranges) { - OpenAPI_list_for_each(udr_info->gpsi_ranges, gpsi_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(gpsi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udr_info_convertToJSON() failed [gpsi_ranges]"); - goto end; - } - cJSON_AddItemToArray(gpsi_rangesList, itemLocal); + OpenAPI_list_for_each(udr_info->gpsi_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udr_info_convertToJSON() failed [gpsi_ranges]"); + goto end; } + cJSON_AddItemToArray(gpsi_rangesList, itemLocal); } } @@ -110,29 +119,24 @@ cJSON *OpenAPI_udr_info_convertToJSON(OpenAPI_udr_info_t *udr_info) ogs_error("OpenAPI_udr_info_convertToJSON() failed [external_group_identifiers_ranges]"); goto end; } - - OpenAPI_lnode_t *external_group_identifiers_ranges_node; - if (udr_info->external_group_identifiers_ranges) { - OpenAPI_list_for_each(udr_info->external_group_identifiers_ranges, external_group_identifiers_ranges_node) { - cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(external_group_identifiers_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udr_info_convertToJSON() failed [external_group_identifiers_ranges]"); - goto end; - } - cJSON_AddItemToArray(external_group_identifiers_rangesList, itemLocal); + OpenAPI_list_for_each(udr_info->external_group_identifiers_ranges, node) { + cJSON *itemLocal = OpenAPI_identity_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udr_info_convertToJSON() failed [external_group_identifiers_ranges]"); + goto end; } + cJSON_AddItemToArray(external_group_identifiers_rangesList, itemLocal); } } - if (udr_info->supported_data_sets) { - cJSON *supported_data_sets = cJSON_AddArrayToObject(item, "supportedDataSets"); - if (supported_data_sets == NULL) { + if (udr_info->supported_data_sets != OpenAPI_data_set_id_NULL) { + cJSON *supported_data_setsList = cJSON_AddArrayToObject(item, "supportedDataSets"); + if (supported_data_setsList == NULL) { ogs_error("OpenAPI_udr_info_convertToJSON() failed [supported_data_sets]"); goto end; } - OpenAPI_lnode_t *supported_data_sets_node; - OpenAPI_list_for_each(udr_info->supported_data_sets, supported_data_sets_node) { - if (cJSON_AddStringToObject(supported_data_sets, "", OpenAPI_data_set_id_ToString((intptr_t)supported_data_sets_node->data)) == NULL) { + OpenAPI_list_for_each(udr_info->supported_data_sets, node) { + if (cJSON_AddStringToObject(supported_data_setsList, "", OpenAPI_data_set_id_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_udr_info_convertToJSON() failed [supported_data_sets]"); goto end; } @@ -146,126 +150,120 @@ end: OpenAPI_udr_info_t *OpenAPI_udr_info_parseFromJSON(cJSON *udr_infoJSON) { OpenAPI_udr_info_t *udr_info_local_var = NULL; - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "groupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *group_id = NULL; + cJSON *supi_ranges = NULL; + OpenAPI_list_t *supi_rangesList = NULL; + cJSON *gpsi_ranges = NULL; + OpenAPI_list_t *gpsi_rangesList = NULL; + cJSON *external_group_identifiers_ranges = NULL; + OpenAPI_list_t *external_group_identifiers_rangesList = NULL; + cJSON *supported_data_sets = NULL; + OpenAPI_list_t *supported_data_setsList = NULL; + group_id = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_udr_info_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *supi_ranges = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "supiRanges"); - - OpenAPI_list_t *supi_rangesList; + supi_ranges = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "supiRanges"); if (supi_ranges) { - cJSON *supi_ranges_local_nonprimitive; - if (!cJSON_IsArray(supi_ranges)){ - ogs_error("OpenAPI_udr_info_parseFromJSON() failed [supi_ranges]"); - goto end; - } - - supi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(supi_ranges_local_nonprimitive, supi_ranges ) { - if (!cJSON_IsObject(supi_ranges_local_nonprimitive)) { + cJSON *supi_ranges_local = NULL; + if (!cJSON_IsArray(supi_ranges)) { ogs_error("OpenAPI_udr_info_parseFromJSON() failed [supi_ranges]"); goto end; } - OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local_nonprimitive); - if (!supi_rangesItem) { - ogs_error("No supi_rangesItem"); - OpenAPI_list_free(supi_rangesList); - goto end; + supi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_ranges_local, supi_ranges) { + if (!cJSON_IsObject(supi_ranges_local)) { + ogs_error("OpenAPI_udr_info_parseFromJSON() failed [supi_ranges]"); + goto end; + } + OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local); + if (!supi_rangesItem) { + ogs_error("No supi_rangesItem"); + OpenAPI_list_free(supi_rangesList); + goto end; + } + OpenAPI_list_add(supi_rangesList, supi_rangesItem); } - - OpenAPI_list_add(supi_rangesList, supi_rangesItem); - } } - cJSON *gpsi_ranges = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "gpsiRanges"); - - OpenAPI_list_t *gpsi_rangesList; + gpsi_ranges = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "gpsiRanges"); if (gpsi_ranges) { - cJSON *gpsi_ranges_local_nonprimitive; - if (!cJSON_IsArray(gpsi_ranges)){ - ogs_error("OpenAPI_udr_info_parseFromJSON() failed [gpsi_ranges]"); - goto end; - } - - gpsi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(gpsi_ranges_local_nonprimitive, gpsi_ranges ) { - if (!cJSON_IsObject(gpsi_ranges_local_nonprimitive)) { + cJSON *gpsi_ranges_local = NULL; + if (!cJSON_IsArray(gpsi_ranges)) { ogs_error("OpenAPI_udr_info_parseFromJSON() failed [gpsi_ranges]"); goto end; } - OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local_nonprimitive); - if (!gpsi_rangesItem) { - ogs_error("No gpsi_rangesItem"); - OpenAPI_list_free(gpsi_rangesList); - goto end; + gpsi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_ranges_local, gpsi_ranges) { + if (!cJSON_IsObject(gpsi_ranges_local)) { + ogs_error("OpenAPI_udr_info_parseFromJSON() failed [gpsi_ranges]"); + goto end; + } + OpenAPI_identity_range_t *gpsi_rangesItem = OpenAPI_identity_range_parseFromJSON(gpsi_ranges_local); + if (!gpsi_rangesItem) { + ogs_error("No gpsi_rangesItem"); + OpenAPI_list_free(gpsi_rangesList); + goto end; + } + OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); } - - OpenAPI_list_add(gpsi_rangesList, gpsi_rangesItem); - } } - cJSON *external_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "externalGroupIdentifiersRanges"); - - OpenAPI_list_t *external_group_identifiers_rangesList; + external_group_identifiers_ranges = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "externalGroupIdentifiersRanges"); if (external_group_identifiers_ranges) { - cJSON *external_group_identifiers_ranges_local_nonprimitive; - if (!cJSON_IsArray(external_group_identifiers_ranges)){ - ogs_error("OpenAPI_udr_info_parseFromJSON() failed [external_group_identifiers_ranges]"); - goto end; - } - - external_group_identifiers_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(external_group_identifiers_ranges_local_nonprimitive, external_group_identifiers_ranges ) { - if (!cJSON_IsObject(external_group_identifiers_ranges_local_nonprimitive)) { + cJSON *external_group_identifiers_ranges_local = NULL; + if (!cJSON_IsArray(external_group_identifiers_ranges)) { ogs_error("OpenAPI_udr_info_parseFromJSON() failed [external_group_identifiers_ranges]"); goto end; } - OpenAPI_identity_range_t *external_group_identifiers_rangesItem = OpenAPI_identity_range_parseFromJSON(external_group_identifiers_ranges_local_nonprimitive); - if (!external_group_identifiers_rangesItem) { - ogs_error("No external_group_identifiers_rangesItem"); - OpenAPI_list_free(external_group_identifiers_rangesList); - goto end; + external_group_identifiers_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(external_group_identifiers_ranges_local, external_group_identifiers_ranges) { + if (!cJSON_IsObject(external_group_identifiers_ranges_local)) { + ogs_error("OpenAPI_udr_info_parseFromJSON() failed [external_group_identifiers_ranges]"); + goto end; + } + OpenAPI_identity_range_t *external_group_identifiers_rangesItem = OpenAPI_identity_range_parseFromJSON(external_group_identifiers_ranges_local); + if (!external_group_identifiers_rangesItem) { + ogs_error("No external_group_identifiers_rangesItem"); + OpenAPI_list_free(external_group_identifiers_rangesList); + goto end; + } + OpenAPI_list_add(external_group_identifiers_rangesList, external_group_identifiers_rangesItem); } - - OpenAPI_list_add(external_group_identifiers_rangesList, external_group_identifiers_rangesItem); - } } - cJSON *supported_data_sets = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "supportedDataSets"); - - OpenAPI_list_t *supported_data_setsList; + supported_data_sets = cJSON_GetObjectItemCaseSensitive(udr_infoJSON, "supportedDataSets"); if (supported_data_sets) { - cJSON *supported_data_sets_local_nonprimitive; - if (!cJSON_IsArray(supported_data_sets)) { - ogs_error("OpenAPI_udr_info_parseFromJSON() failed [supported_data_sets]"); - goto end; - } - - supported_data_setsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(supported_data_sets_local_nonprimitive, supported_data_sets ) { - if (!cJSON_IsString(supported_data_sets_local_nonprimitive)){ + cJSON *supported_data_sets_local = NULL; + if (!cJSON_IsArray(supported_data_sets)) { ogs_error("OpenAPI_udr_info_parseFromJSON() failed [supported_data_sets]"); goto end; } - OpenAPI_list_add(supported_data_setsList, (void *)OpenAPI_data_set_id_FromString(supported_data_sets_local_nonprimitive->valuestring)); - } + supported_data_setsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supported_data_sets_local, supported_data_sets) { + if (!cJSON_IsString(supported_data_sets_local)) { + ogs_error("OpenAPI_udr_info_parseFromJSON() failed [supported_data_sets]"); + goto end; + } + OpenAPI_list_add(supported_data_setsList, (void *)OpenAPI_data_set_id_FromString(supported_data_sets_local->valuestring)); + } } udr_info_local_var = OpenAPI_udr_info_create ( - group_id ? ogs_strdup(group_id->valuestring) : NULL, + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, supi_ranges ? supi_rangesList : NULL, gpsi_ranges ? gpsi_rangesList : NULL, external_group_identifiers_ranges ? external_group_identifiers_rangesList : NULL, @@ -274,6 +272,31 @@ OpenAPI_udr_info_t *OpenAPI_udr_info_parseFromJSON(cJSON *udr_infoJSON) return udr_info_local_var; end: + if (supi_rangesList) { + OpenAPI_list_for_each(supi_rangesList, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(supi_rangesList); + supi_rangesList = NULL; + } + if (gpsi_rangesList) { + OpenAPI_list_for_each(gpsi_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(gpsi_rangesList); + gpsi_rangesList = NULL; + } + if (external_group_identifiers_rangesList) { + OpenAPI_list_for_each(external_group_identifiers_rangesList, node) { + OpenAPI_identity_range_free(node->data); + } + OpenAPI_list_free(external_group_identifiers_rangesList); + external_group_identifiers_rangesList = NULL; + } + if (supported_data_setsList) { + OpenAPI_list_free(supported_data_setsList); + supported_data_setsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/udsf_info.c b/lib/sbi/openapi/model/udsf_info.c index 62b0fa219..33b8a870d 100644 --- a/lib/sbi/openapi/model/udsf_info.c +++ b/lib/sbi/openapi/model/udsf_info.c @@ -22,28 +22,39 @@ OpenAPI_udsf_info_t *OpenAPI_udsf_info_create( void OpenAPI_udsf_info_free(OpenAPI_udsf_info_t *udsf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == udsf_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(udsf_info->group_id); - OpenAPI_list_for_each(udsf_info->supi_ranges, node) { - OpenAPI_supi_range_free(node->data); + if (udsf_info->group_id) { + ogs_free(udsf_info->group_id); + udsf_info->group_id = NULL; } - OpenAPI_list_free(udsf_info->supi_ranges); - OpenAPI_list_for_each(udsf_info->storage_id_ranges, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - ogs_free(localKeyValue->value); - ogs_free(localKeyValue); + if (udsf_info->supi_ranges) { + OpenAPI_list_for_each(udsf_info->supi_ranges, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(udsf_info->supi_ranges); + udsf_info->supi_ranges = NULL; + } + if (udsf_info->storage_id_ranges) { + OpenAPI_list_for_each(udsf_info->storage_id_ranges, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(udsf_info->storage_id_ranges); + udsf_info->storage_id_ranges = NULL; } - OpenAPI_list_free(udsf_info->storage_id_ranges); ogs_free(udsf_info); } cJSON *OpenAPI_udsf_info_convertToJSON(OpenAPI_udsf_info_t *udsf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (udsf_info == NULL) { ogs_error("OpenAPI_udsf_info_convertToJSON() failed [UdsfInfo]"); @@ -64,17 +75,13 @@ cJSON *OpenAPI_udsf_info_convertToJSON(OpenAPI_udsf_info_t *udsf_info) ogs_error("OpenAPI_udsf_info_convertToJSON() failed [supi_ranges]"); goto end; } - - OpenAPI_lnode_t *supi_ranges_node; - if (udsf_info->supi_ranges) { - OpenAPI_list_for_each(udsf_info->supi_ranges, supi_ranges_node) { - cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(supi_ranges_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udsf_info_convertToJSON() failed [supi_ranges]"); - goto end; - } - cJSON_AddItemToArray(supi_rangesList, itemLocal); + OpenAPI_list_for_each(udsf_info->supi_ranges, node) { + cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udsf_info_convertToJSON() failed [supi_ranges]"); + goto end; } + cJSON_AddItemToArray(supi_rangesList, itemLocal); } } @@ -85,21 +92,20 @@ cJSON *OpenAPI_udsf_info_convertToJSON(OpenAPI_udsf_info_t *udsf_info) goto end; } cJSON *localMapObject = storage_id_ranges; - OpenAPI_lnode_t *storage_id_ranges_node; if (udsf_info->storage_id_ranges) { - OpenAPI_list_for_each(udsf_info->storage_id_ranges, storage_id_ranges_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)storage_id_ranges_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_identity_range_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_udsf_info_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(udsf_info->storage_id_ranges, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_identity_range_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_udsf_info_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } end: return item; @@ -108,78 +114,98 @@ end: OpenAPI_udsf_info_t *OpenAPI_udsf_info_parseFromJSON(cJSON *udsf_infoJSON) { OpenAPI_udsf_info_t *udsf_info_local_var = NULL; - cJSON *group_id = cJSON_GetObjectItemCaseSensitive(udsf_infoJSON, "groupId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *group_id = NULL; + cJSON *supi_ranges = NULL; + OpenAPI_list_t *supi_rangesList = NULL; + cJSON *storage_id_ranges = NULL; + OpenAPI_list_t *storage_id_rangesList = NULL; + group_id = cJSON_GetObjectItemCaseSensitive(udsf_infoJSON, "groupId"); if (group_id) { - if (!cJSON_IsString(group_id)) { + if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) { ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [group_id]"); goto end; } } - cJSON *supi_ranges = cJSON_GetObjectItemCaseSensitive(udsf_infoJSON, "supiRanges"); - - OpenAPI_list_t *supi_rangesList; + supi_ranges = cJSON_GetObjectItemCaseSensitive(udsf_infoJSON, "supiRanges"); if (supi_ranges) { - cJSON *supi_ranges_local_nonprimitive; - if (!cJSON_IsArray(supi_ranges)){ - ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [supi_ranges]"); - goto end; - } - - supi_rangesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(supi_ranges_local_nonprimitive, supi_ranges ) { - if (!cJSON_IsObject(supi_ranges_local_nonprimitive)) { + cJSON *supi_ranges_local = NULL; + if (!cJSON_IsArray(supi_ranges)) { ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [supi_ranges]"); goto end; } - OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local_nonprimitive); - if (!supi_rangesItem) { - ogs_error("No supi_rangesItem"); - OpenAPI_list_free(supi_rangesList); - goto end; + supi_rangesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supi_ranges_local, supi_ranges) { + if (!cJSON_IsObject(supi_ranges_local)) { + ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [supi_ranges]"); + goto end; + } + OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local); + if (!supi_rangesItem) { + ogs_error("No supi_rangesItem"); + OpenAPI_list_free(supi_rangesList); + goto end; + } + OpenAPI_list_add(supi_rangesList, supi_rangesItem); } - - OpenAPI_list_add(supi_rangesList, supi_rangesItem); - } } - cJSON *storage_id_ranges = cJSON_GetObjectItemCaseSensitive(udsf_infoJSON, "storageIdRanges"); - - OpenAPI_list_t *storage_id_rangesList; + storage_id_ranges = cJSON_GetObjectItemCaseSensitive(udsf_infoJSON, "storageIdRanges"); if (storage_id_ranges) { - cJSON *storage_id_ranges_local_map; - if (!cJSON_IsObject(storage_id_ranges)) { - ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [storage_id_ranges]"); - goto end; - } - storage_id_rangesList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(storage_id_ranges_local_map, storage_id_ranges) { - cJSON *localMapObject = storage_id_ranges_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_identity_range_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [inner]"); + cJSON *storage_id_ranges_local_map = NULL; + if (!cJSON_IsObject(storage_id_ranges) && !cJSON_IsNull(storage_id_ranges)) { + ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [storage_id_ranges]"); goto end; } - OpenAPI_list_add(storage_id_rangesList, localMapKeyPair); - } + if (cJSON_IsObject(storage_id_ranges)) { + storage_id_rangesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(storage_id_ranges_local_map, storage_id_ranges) { + cJSON *localMapObject = storage_id_ranges_local_map; + double *localDouble = NULL; + int *localInt = NULL; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_identity_range_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_udsf_info_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(storage_id_rangesList, localMapKeyPair); + } + } } udsf_info_local_var = OpenAPI_udsf_info_create ( - group_id ? ogs_strdup(group_id->valuestring) : NULL, + group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL, supi_ranges ? supi_rangesList : NULL, storage_id_ranges ? storage_id_rangesList : NULL ); return udsf_info_local_var; end: + if (supi_rangesList) { + OpenAPI_list_for_each(supi_rangesList, node) { + OpenAPI_supi_range_free(node->data); + } + OpenAPI_list_free(supi_rangesList); + supi_rangesList = NULL; + } + if (storage_id_rangesList) { + OpenAPI_list_for_each(storage_id_rangesList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + ogs_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(storage_id_rangesList); + storage_id_rangesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_authentication_ctx.c b/lib/sbi/openapi/model/ue_authentication_ctx.c index 3d0e12ec4..14189ba9d 100644 --- a/lib/sbi/openapi/model/ue_authentication_ctx.c +++ b/lib/sbi/openapi/model/ue_authentication_ctx.c @@ -24,10 +24,11 @@ OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_create( void OpenAPI_ue_authentication_ctx_free(OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_authentication_ctx) { return; } - OpenAPI_lnode_t *node; if (ue_authentication_ctx->_5g_auth_data) { OpenAPI_ue_authentication_ctx_5g_auth_data_free(ue_authentication_ctx->_5g_auth_data); ue_authentication_ctx->_5g_auth_data = NULL; @@ -52,6 +53,7 @@ void OpenAPI_ue_authentication_ctx_free(OpenAPI_ue_authentication_ctx_t *ue_auth cJSON *OpenAPI_ue_authentication_ctx_convertToJSON(OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_authentication_ctx == NULL) { ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [UEAuthenticationCtx]"); @@ -93,20 +95,19 @@ cJSON *OpenAPI_ue_authentication_ctx_convertToJSON(OpenAPI_ue_authentication_ctx goto end; } cJSON *localMapObject = _links; - OpenAPI_lnode_t *_links_node; if (ue_authentication_ctx->_links) { - OpenAPI_list_for_each(ue_authentication_ctx->_links, _links_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)_links_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_links_value_schema_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ue_authentication_ctx->_links, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_links_value_schema_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } + } if (ue_authentication_ctx->serving_network_name) { if (cJSON_AddStringToObject(item, "servingNetworkName", ue_authentication_ctx->serving_network_name) == NULL) { diff --git a/lib/sbi/openapi/model/ue_authentication_ctx_5g_auth_data.c b/lib/sbi/openapi/model/ue_authentication_ctx_5g_auth_data.c index e6e83fdc8..3121f621d 100644 --- a/lib/sbi/openapi/model/ue_authentication_ctx_5g_auth_data.c +++ b/lib/sbi/openapi/model/ue_authentication_ctx_5g_auth_data.c @@ -22,10 +22,11 @@ OpenAPI_ue_authentication_ctx_5g_auth_data_t *OpenAPI_ue_authentication_ctx_5g_a void OpenAPI_ue_authentication_ctx_5g_auth_data_free(OpenAPI_ue_authentication_ctx_5g_auth_data_t *ue_authentication_ctx_5g_auth_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_authentication_ctx_5g_auth_data) { return; } - OpenAPI_lnode_t *node; if (ue_authentication_ctx_5g_auth_data->rand) { ogs_free(ue_authentication_ctx_5g_auth_data->rand); ue_authentication_ctx_5g_auth_data->rand = NULL; @@ -44,6 +45,7 @@ void OpenAPI_ue_authentication_ctx_5g_auth_data_free(OpenAPI_ue_authentication_c cJSON *OpenAPI_ue_authentication_ctx_5g_auth_data_convertToJSON(OpenAPI_ue_authentication_ctx_5g_auth_data_t *ue_authentication_ctx_5g_auth_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_authentication_ctx_5g_auth_data == NULL) { ogs_error("OpenAPI_ue_authentication_ctx_5g_auth_data_convertToJSON() failed [UEAuthenticationCtx_5gAuthData]"); diff --git a/lib/sbi/openapi/model/ue_camping_rep.c b/lib/sbi/openapi/model/ue_camping_rep.c index ca331f5d3..3fb67e324 100644 --- a/lib/sbi/openapi/model/ue_camping_rep.c +++ b/lib/sbi/openapi/model/ue_camping_rep.c @@ -30,20 +30,34 @@ OpenAPI_ue_camping_rep_t *OpenAPI_ue_camping_rep_create( void OpenAPI_ue_camping_rep_free(OpenAPI_ue_camping_rep_t *ue_camping_rep) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_camping_rep) { return; } - OpenAPI_lnode_t *node; - OpenAPI_serving_nf_identity_free(ue_camping_rep->serv_nf_id); - OpenAPI_plmn_id_nid_free(ue_camping_rep->serving_network); - OpenAPI_user_location_free(ue_camping_rep->user_location_info); - ogs_free(ue_camping_rep->ue_time_zone); + if (ue_camping_rep->serv_nf_id) { + OpenAPI_serving_nf_identity_free(ue_camping_rep->serv_nf_id); + ue_camping_rep->serv_nf_id = NULL; + } + if (ue_camping_rep->serving_network) { + OpenAPI_plmn_id_nid_free(ue_camping_rep->serving_network); + ue_camping_rep->serving_network = NULL; + } + if (ue_camping_rep->user_location_info) { + OpenAPI_user_location_free(ue_camping_rep->user_location_info); + ue_camping_rep->user_location_info = NULL; + } + if (ue_camping_rep->ue_time_zone) { + ogs_free(ue_camping_rep->ue_time_zone); + ue_camping_rep->ue_time_zone = NULL; + } ogs_free(ue_camping_rep); } cJSON *OpenAPI_ue_camping_rep_convertToJSON(OpenAPI_ue_camping_rep_t *ue_camping_rep) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_camping_rep == NULL) { ogs_error("OpenAPI_ue_camping_rep_convertToJSON() failed [UeCampingRep]"); @@ -51,14 +65,14 @@ cJSON *OpenAPI_ue_camping_rep_convertToJSON(OpenAPI_ue_camping_rep_t *ue_camping } item = cJSON_CreateObject(); - if (ue_camping_rep->access_type) { + if (ue_camping_rep->access_type != OpenAPI_access_type_NULL) { if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(ue_camping_rep->access_type)) == NULL) { ogs_error("OpenAPI_ue_camping_rep_convertToJSON() failed [access_type]"); goto end; } } - if (ue_camping_rep->rat_type) { + if (ue_camping_rep->rat_type != OpenAPI_rat_type_NULL) { if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(ue_camping_rep->rat_type)) == NULL) { ogs_error("OpenAPI_ue_camping_rep_convertToJSON() failed [rat_type]"); goto end; @@ -111,7 +125,7 @@ cJSON *OpenAPI_ue_camping_rep_convertToJSON(OpenAPI_ue_camping_rep_t *ue_camping } } - if (ue_camping_rep->net_loc_acc_supp) { + if (ue_camping_rep->net_loc_acc_supp != OpenAPI_net_loc_access_support_NULL) { if (cJSON_AddStringToObject(item, "netLocAccSupp", OpenAPI_net_loc_access_support_ToString(ue_camping_rep->net_loc_acc_supp)) == NULL) { ogs_error("OpenAPI_ue_camping_rep_convertToJSON() failed [net_loc_acc_supp]"); goto end; @@ -125,9 +139,21 @@ end: OpenAPI_ue_camping_rep_t *OpenAPI_ue_camping_rep_parseFromJSON(cJSON *ue_camping_repJSON) { OpenAPI_ue_camping_rep_t *ue_camping_rep_local_var = NULL; - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "accessType"); - - OpenAPI_access_type_e access_typeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *rat_type = NULL; + OpenAPI_rat_type_e rat_typeVariable = 0; + cJSON *serv_nf_id = NULL; + OpenAPI_serving_nf_identity_t *serv_nf_id_local_nonprim = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + cJSON *user_location_info = NULL; + OpenAPI_user_location_t *user_location_info_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *net_loc_acc_supp = NULL; + OpenAPI_net_loc_access_support_e net_loc_acc_suppVariable = 0; + access_type = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "accessType"); if (access_type) { if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_ue_camping_rep_parseFromJSON() failed [access_type]"); @@ -136,9 +162,7 @@ OpenAPI_ue_camping_rep_t *OpenAPI_ue_camping_rep_parseFromJSON(cJSON *ue_camping access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); } - cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "ratType"); - - OpenAPI_rat_type_e rat_typeVariable; + rat_type = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "ratType"); if (rat_type) { if (!cJSON_IsString(rat_type)) { ogs_error("OpenAPI_ue_camping_rep_parseFromJSON() failed [rat_type]"); @@ -147,39 +171,30 @@ OpenAPI_ue_camping_rep_t *OpenAPI_ue_camping_rep_parseFromJSON(cJSON *ue_camping rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring); } - cJSON *serv_nf_id = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "servNfId"); - - OpenAPI_serving_nf_identity_t *serv_nf_id_local_nonprim = NULL; + serv_nf_id = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "servNfId"); if (serv_nf_id) { serv_nf_id_local_nonprim = OpenAPI_serving_nf_identity_parseFromJSON(serv_nf_id); } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "servingNetwork"); - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + serving_network = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "servingNetwork"); if (serving_network) { serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); } - cJSON *user_location_info = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "userLocationInfo"); - - OpenAPI_user_location_t *user_location_info_local_nonprim = NULL; + user_location_info = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "userLocationInfo"); if (user_location_info) { user_location_info_local_nonprim = OpenAPI_user_location_parseFromJSON(user_location_info); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_ue_camping_rep_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *net_loc_acc_supp = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "netLocAccSupp"); - - OpenAPI_net_loc_access_support_e net_loc_acc_suppVariable; + net_loc_acc_supp = cJSON_GetObjectItemCaseSensitive(ue_camping_repJSON, "netLocAccSupp"); if (net_loc_acc_supp) { if (!cJSON_IsString(net_loc_acc_supp)) { ogs_error("OpenAPI_ue_camping_rep_parseFromJSON() failed [net_loc_acc_supp]"); @@ -194,12 +209,24 @@ OpenAPI_ue_camping_rep_t *OpenAPI_ue_camping_rep_parseFromJSON(cJSON *ue_camping serv_nf_id ? serv_nf_id_local_nonprim : NULL, serving_network ? serving_network_local_nonprim : NULL, user_location_info ? user_location_info_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, net_loc_acc_supp ? net_loc_acc_suppVariable : 0 ); return ue_camping_rep_local_var; end: + if (serv_nf_id_local_nonprim) { + OpenAPI_serving_nf_identity_free(serv_nf_id_local_nonprim); + serv_nf_id_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } + if (user_location_info_local_nonprim) { + OpenAPI_user_location_free(user_location_info_local_nonprim); + user_location_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context.c b/lib/sbi/openapi/model/ue_context.c index ccea61042..a502269dd 100644 --- a/lib/sbi/openapi/model/ue_context.c +++ b/lib/sbi/openapi/model/ue_context.c @@ -15,7 +15,7 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_create( char *pcf_group_id, char *routing_indicator, OpenAPI_list_t *group_list, - char drx_parameter, + char *drx_parameter, bool is_sub_rfsp, int sub_rfsp, bool is_used_rfsp, @@ -23,7 +23,7 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_create( OpenAPI_ambr_t *sub_ue_ambr, char *smsf_id, OpenAPI_seaf_data_t *seaf_data, - char _5g_mm_capability, + char *_5g_mm_capability, char *pcf_id, char *pcf_set_id, char *pcf_amp_service_set_id, @@ -46,7 +46,7 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_create( char *service_gap_expiry_time, char *stn_sr, char *c_msisdn, - char ms_classmark2, + char *ms_classmark2, OpenAPI_list_t *supported_codec_list, OpenAPI_list_t *small_data_rate_status_infos, OpenAPI_list_t *restricted_primary_rat_list, @@ -134,81 +134,218 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_create( void OpenAPI_ue_context_free(OpenAPI_ue_context_t *ue_context) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_context->supi); - OpenAPI_list_for_each(ue_context->gpsi_list, node) { - ogs_free(node->data); + if (ue_context->supi) { + ogs_free(ue_context->supi); + ue_context->supi = NULL; } - OpenAPI_list_free(ue_context->gpsi_list); - ogs_free(ue_context->pei); - ogs_free(ue_context->udm_group_id); - ogs_free(ue_context->ausf_group_id); - ogs_free(ue_context->pcf_group_id); - ogs_free(ue_context->routing_indicator); - OpenAPI_list_for_each(ue_context->group_list, node) { - ogs_free(node->data); + if (ue_context->gpsi_list) { + OpenAPI_list_for_each(ue_context->gpsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_context->gpsi_list); + ue_context->gpsi_list = NULL; } - OpenAPI_list_free(ue_context->group_list); - OpenAPI_ambr_free(ue_context->sub_ue_ambr); - ogs_free(ue_context->smsf_id); - OpenAPI_seaf_data_free(ue_context->seaf_data); - ogs_free(ue_context->pcf_id); - ogs_free(ue_context->pcf_set_id); - ogs_free(ue_context->pcf_amp_service_set_id); - ogs_free(ue_context->pcf_uep_service_set_id); - ogs_free(ue_context->pcf_am_policy_uri); - OpenAPI_list_free(ue_context->am_policy_req_trigger_list); - ogs_free(ue_context->pcf_ue_policy_uri); - OpenAPI_list_free(ue_context->ue_policy_req_trigger_list); - ogs_free(ue_context->hpcf_id); - ogs_free(ue_context->hpcf_set_id); - OpenAPI_list_free(ue_context->restricted_rat_list); - OpenAPI_list_for_each(ue_context->forbidden_area_list, node) { - OpenAPI_area_free(node->data); + if (ue_context->pei) { + ogs_free(ue_context->pei); + ue_context->pei = NULL; } - OpenAPI_list_free(ue_context->forbidden_area_list); - OpenAPI_service_area_restriction_free(ue_context->service_area_restriction); - OpenAPI_list_free(ue_context->restricted_core_nw_type_list); - OpenAPI_list_for_each(ue_context->event_subscription_list, node) { - OpenAPI_ext_amf_event_subscription_free(node->data); + if (ue_context->udm_group_id) { + ogs_free(ue_context->udm_group_id); + ue_context->udm_group_id = NULL; } - OpenAPI_list_free(ue_context->event_subscription_list); - OpenAPI_list_for_each(ue_context->mm_context_list, node) { - OpenAPI_mm_context_free(node->data); + if (ue_context->ausf_group_id) { + ogs_free(ue_context->ausf_group_id); + ue_context->ausf_group_id = NULL; } - OpenAPI_list_free(ue_context->mm_context_list); - OpenAPI_list_for_each(ue_context->session_context_list, node) { - OpenAPI_pdu_session_context_free(node->data); + if (ue_context->pcf_group_id) { + ogs_free(ue_context->pcf_group_id); + ue_context->pcf_group_id = NULL; } - OpenAPI_list_free(ue_context->session_context_list); - OpenAPI_trace_data_free(ue_context->trace_data); - ogs_free(ue_context->service_gap_expiry_time); - ogs_free(ue_context->stn_sr); - ogs_free(ue_context->c_msisdn); - OpenAPI_list_for_each(ue_context->supported_codec_list, node) { - ogs_free(node->data); + if (ue_context->routing_indicator) { + ogs_free(ue_context->routing_indicator); + ue_context->routing_indicator = NULL; } - OpenAPI_list_free(ue_context->supported_codec_list); - OpenAPI_list_for_each(ue_context->small_data_rate_status_infos, node) { - OpenAPI_small_data_rate_status_info_free(node->data); + if (ue_context->group_list) { + OpenAPI_list_for_each(ue_context->group_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_context->group_list); + ue_context->group_list = NULL; + } + if (ue_context->drx_parameter) { + ogs_free(ue_context->drx_parameter); + ue_context->drx_parameter = NULL; + } + if (ue_context->sub_ue_ambr) { + OpenAPI_ambr_free(ue_context->sub_ue_ambr); + ue_context->sub_ue_ambr = NULL; + } + if (ue_context->smsf_id) { + ogs_free(ue_context->smsf_id); + ue_context->smsf_id = NULL; + } + if (ue_context->seaf_data) { + OpenAPI_seaf_data_free(ue_context->seaf_data); + ue_context->seaf_data = NULL; + } + if (ue_context->_5g_mm_capability) { + ogs_free(ue_context->_5g_mm_capability); + ue_context->_5g_mm_capability = NULL; + } + if (ue_context->pcf_id) { + ogs_free(ue_context->pcf_id); + ue_context->pcf_id = NULL; + } + if (ue_context->pcf_set_id) { + ogs_free(ue_context->pcf_set_id); + ue_context->pcf_set_id = NULL; + } + if (ue_context->pcf_amp_service_set_id) { + ogs_free(ue_context->pcf_amp_service_set_id); + ue_context->pcf_amp_service_set_id = NULL; + } + if (ue_context->pcf_uep_service_set_id) { + ogs_free(ue_context->pcf_uep_service_set_id); + ue_context->pcf_uep_service_set_id = NULL; + } + if (ue_context->pcf_am_policy_uri) { + ogs_free(ue_context->pcf_am_policy_uri); + ue_context->pcf_am_policy_uri = NULL; + } + if (ue_context->am_policy_req_trigger_list) { + OpenAPI_list_free(ue_context->am_policy_req_trigger_list); + ue_context->am_policy_req_trigger_list = NULL; + } + if (ue_context->pcf_ue_policy_uri) { + ogs_free(ue_context->pcf_ue_policy_uri); + ue_context->pcf_ue_policy_uri = NULL; + } + if (ue_context->ue_policy_req_trigger_list) { + OpenAPI_list_free(ue_context->ue_policy_req_trigger_list); + ue_context->ue_policy_req_trigger_list = NULL; + } + if (ue_context->hpcf_id) { + ogs_free(ue_context->hpcf_id); + ue_context->hpcf_id = NULL; + } + if (ue_context->hpcf_set_id) { + ogs_free(ue_context->hpcf_set_id); + ue_context->hpcf_set_id = NULL; + } + if (ue_context->restricted_rat_list) { + OpenAPI_list_free(ue_context->restricted_rat_list); + ue_context->restricted_rat_list = NULL; + } + if (ue_context->forbidden_area_list) { + OpenAPI_list_for_each(ue_context->forbidden_area_list, node) { + OpenAPI_area_free(node->data); + } + OpenAPI_list_free(ue_context->forbidden_area_list); + ue_context->forbidden_area_list = NULL; + } + if (ue_context->service_area_restriction) { + OpenAPI_service_area_restriction_free(ue_context->service_area_restriction); + ue_context->service_area_restriction = NULL; + } + if (ue_context->restricted_core_nw_type_list) { + OpenAPI_list_free(ue_context->restricted_core_nw_type_list); + ue_context->restricted_core_nw_type_list = NULL; + } + if (ue_context->event_subscription_list) { + OpenAPI_list_for_each(ue_context->event_subscription_list, node) { + OpenAPI_ext_amf_event_subscription_free(node->data); + } + OpenAPI_list_free(ue_context->event_subscription_list); + ue_context->event_subscription_list = NULL; + } + if (ue_context->mm_context_list) { + OpenAPI_list_for_each(ue_context->mm_context_list, node) { + OpenAPI_mm_context_free(node->data); + } + OpenAPI_list_free(ue_context->mm_context_list); + ue_context->mm_context_list = NULL; + } + if (ue_context->session_context_list) { + OpenAPI_list_for_each(ue_context->session_context_list, node) { + OpenAPI_pdu_session_context_free(node->data); + } + OpenAPI_list_free(ue_context->session_context_list); + ue_context->session_context_list = NULL; + } + if (ue_context->trace_data) { + OpenAPI_trace_data_free(ue_context->trace_data); + ue_context->trace_data = NULL; + } + if (ue_context->service_gap_expiry_time) { + ogs_free(ue_context->service_gap_expiry_time); + ue_context->service_gap_expiry_time = NULL; + } + if (ue_context->stn_sr) { + ogs_free(ue_context->stn_sr); + ue_context->stn_sr = NULL; + } + if (ue_context->c_msisdn) { + ogs_free(ue_context->c_msisdn); + ue_context->c_msisdn = NULL; + } + if (ue_context->ms_classmark2) { + ogs_free(ue_context->ms_classmark2); + ue_context->ms_classmark2 = NULL; + } + if (ue_context->supported_codec_list) { + OpenAPI_list_for_each(ue_context->supported_codec_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_context->supported_codec_list); + ue_context->supported_codec_list = NULL; + } + if (ue_context->small_data_rate_status_infos) { + OpenAPI_list_for_each(ue_context->small_data_rate_status_infos, node) { + OpenAPI_small_data_rate_status_info_free(node->data); + } + OpenAPI_list_free(ue_context->small_data_rate_status_infos); + ue_context->small_data_rate_status_infos = NULL; + } + if (ue_context->restricted_primary_rat_list) { + OpenAPI_list_free(ue_context->restricted_primary_rat_list); + ue_context->restricted_primary_rat_list = NULL; + } + if (ue_context->restricted_secondary_rat_list) { + OpenAPI_list_free(ue_context->restricted_secondary_rat_list); + ue_context->restricted_secondary_rat_list = NULL; + } + if (ue_context->v2x_context) { + OpenAPI_v2x_context_free(ue_context->v2x_context); + ue_context->v2x_context = NULL; + } + if (ue_context->mo_exp_data_counter) { + OpenAPI_mo_exp_data_counter_free(ue_context->mo_exp_data_counter); + ue_context->mo_exp_data_counter = NULL; + } + if (ue_context->cag_data) { + OpenAPI_cag_data_free(ue_context->cag_data); + ue_context->cag_data = NULL; + } + if (ue_context->immediate_mdt_conf) { + OpenAPI_immediate_mdt_conf_free(ue_context->immediate_mdt_conf); + ue_context->immediate_mdt_conf = NULL; + } + if (ue_context->ec_restriction_data_wb) { + OpenAPI_ec_restriction_data_wb_free(ue_context->ec_restriction_data_wb); + ue_context->ec_restriction_data_wb = NULL; } - OpenAPI_list_free(ue_context->small_data_rate_status_infos); - OpenAPI_list_free(ue_context->restricted_primary_rat_list); - OpenAPI_list_free(ue_context->restricted_secondary_rat_list); - OpenAPI_v2x_context_free(ue_context->v2x_context); - OpenAPI_mo_exp_data_counter_free(ue_context->mo_exp_data_counter); - OpenAPI_cag_data_free(ue_context->cag_data); - OpenAPI_immediate_mdt_conf_free(ue_context->immediate_mdt_conf); - OpenAPI_ec_restriction_data_wb_free(ue_context->ec_restriction_data_wb); ogs_free(ue_context); } cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [UeContext]"); @@ -231,19 +368,17 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } if (ue_context->gpsi_list) { - cJSON *gpsi_list = cJSON_AddArrayToObject(item, "gpsiList"); - if (gpsi_list == NULL) { + cJSON *gpsi_listList = cJSON_AddArrayToObject(item, "gpsiList"); + if (gpsi_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [gpsi_list]"); goto end; } - - OpenAPI_lnode_t *gpsi_list_node; - OpenAPI_list_for_each(ue_context->gpsi_list, gpsi_list_node) { - if (cJSON_AddStringToObject(gpsi_list, "", (char*)gpsi_list_node->data) == NULL) { - ogs_error("OpenAPI_ue_context_convertToJSON() failed [gpsi_list]"); - goto end; + OpenAPI_list_for_each(ue_context->gpsi_list, node) { + if (cJSON_AddStringToObject(gpsi_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_context_convertToJSON() failed [gpsi_list]"); + goto end; + } } - } } if (ue_context->pei) { @@ -282,23 +417,21 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } if (ue_context->group_list) { - cJSON *group_list = cJSON_AddArrayToObject(item, "groupList"); - if (group_list == NULL) { + cJSON *group_listList = cJSON_AddArrayToObject(item, "groupList"); + if (group_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [group_list]"); goto end; } - - OpenAPI_lnode_t *group_list_node; - OpenAPI_list_for_each(ue_context->group_list, group_list_node) { - if (cJSON_AddStringToObject(group_list, "", (char*)group_list_node->data) == NULL) { - ogs_error("OpenAPI_ue_context_convertToJSON() failed [group_list]"); - goto end; + OpenAPI_list_for_each(ue_context->group_list, node) { + if (cJSON_AddStringToObject(group_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_context_convertToJSON() failed [group_list]"); + goto end; + } } - } } if (ue_context->drx_parameter) { - if (cJSON_AddNumberToObject(item, "drxParameter", ue_context->drx_parameter) == NULL) { + if (cJSON_AddStringToObject(item, "drxParameter", ue_context->drx_parameter) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [drx_parameter]"); goto end; } @@ -352,7 +485,7 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } if (ue_context->_5g_mm_capability) { - if (cJSON_AddNumberToObject(item, "5gMmCapability", ue_context->_5g_mm_capability) == NULL) { + if (cJSON_AddStringToObject(item, "5gMmCapability", ue_context->_5g_mm_capability) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [_5g_mm_capability]"); goto end; } @@ -386,7 +519,7 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } } - if (ue_context->pcf_binding) { + if (ue_context->pcf_binding != OpenAPI_sbi_binding_level_NULL) { if (cJSON_AddStringToObject(item, "pcfBinding", OpenAPI_sbi_binding_level_ToString(ue_context->pcf_binding)) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_binding]"); goto end; @@ -400,15 +533,14 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } } - if (ue_context->am_policy_req_trigger_list) { - cJSON *am_policy_req_trigger_list = cJSON_AddArrayToObject(item, "amPolicyReqTriggerList"); - if (am_policy_req_trigger_list == NULL) { + if (ue_context->am_policy_req_trigger_list != OpenAPI_policy_req_trigger_NULL) { + cJSON *am_policy_req_trigger_listList = cJSON_AddArrayToObject(item, "amPolicyReqTriggerList"); + if (am_policy_req_trigger_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [am_policy_req_trigger_list]"); goto end; } - OpenAPI_lnode_t *am_policy_req_trigger_list_node; - OpenAPI_list_for_each(ue_context->am_policy_req_trigger_list, am_policy_req_trigger_list_node) { - if (cJSON_AddStringToObject(am_policy_req_trigger_list, "", OpenAPI_policy_req_trigger_ToString((intptr_t)am_policy_req_trigger_list_node->data)) == NULL) { + OpenAPI_list_for_each(ue_context->am_policy_req_trigger_list, node) { + if (cJSON_AddStringToObject(am_policy_req_trigger_listList, "", OpenAPI_policy_req_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [am_policy_req_trigger_list]"); goto end; } @@ -422,15 +554,14 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } } - if (ue_context->ue_policy_req_trigger_list) { - cJSON *ue_policy_req_trigger_list = cJSON_AddArrayToObject(item, "uePolicyReqTriggerList"); - if (ue_policy_req_trigger_list == NULL) { + if (ue_context->ue_policy_req_trigger_list != OpenAPI_policy_req_trigger_NULL) { + cJSON *ue_policy_req_trigger_listList = cJSON_AddArrayToObject(item, "uePolicyReqTriggerList"); + if (ue_policy_req_trigger_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [ue_policy_req_trigger_list]"); goto end; } - OpenAPI_lnode_t *ue_policy_req_trigger_list_node; - OpenAPI_list_for_each(ue_context->ue_policy_req_trigger_list, ue_policy_req_trigger_list_node) { - if (cJSON_AddStringToObject(ue_policy_req_trigger_list, "", OpenAPI_policy_req_trigger_ToString((intptr_t)ue_policy_req_trigger_list_node->data)) == NULL) { + OpenAPI_list_for_each(ue_context->ue_policy_req_trigger_list, node) { + if (cJSON_AddStringToObject(ue_policy_req_trigger_listList, "", OpenAPI_policy_req_trigger_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [ue_policy_req_trigger_list]"); goto end; } @@ -451,15 +582,14 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } } - if (ue_context->restricted_rat_list) { - cJSON *restricted_rat_list = cJSON_AddArrayToObject(item, "restrictedRatList"); - if (restricted_rat_list == NULL) { + if (ue_context->restricted_rat_list != OpenAPI_rat_type_NULL) { + cJSON *restricted_rat_listList = cJSON_AddArrayToObject(item, "restrictedRatList"); + if (restricted_rat_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_rat_list]"); goto end; } - OpenAPI_lnode_t *restricted_rat_list_node; - OpenAPI_list_for_each(ue_context->restricted_rat_list, restricted_rat_list_node) { - if (cJSON_AddStringToObject(restricted_rat_list, "", OpenAPI_rat_type_ToString((intptr_t)restricted_rat_list_node->data)) == NULL) { + OpenAPI_list_for_each(ue_context->restricted_rat_list, node) { + if (cJSON_AddStringToObject(restricted_rat_listList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_rat_list]"); goto end; } @@ -472,17 +602,13 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) ogs_error("OpenAPI_ue_context_convertToJSON() failed [forbidden_area_list]"); goto end; } - - OpenAPI_lnode_t *forbidden_area_list_node; - if (ue_context->forbidden_area_list) { - OpenAPI_list_for_each(ue_context->forbidden_area_list, forbidden_area_list_node) { - cJSON *itemLocal = OpenAPI_area_convertToJSON(forbidden_area_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_convertToJSON() failed [forbidden_area_list]"); - goto end; - } - cJSON_AddItemToArray(forbidden_area_listList, itemLocal); + OpenAPI_list_for_each(ue_context->forbidden_area_list, node) { + cJSON *itemLocal = OpenAPI_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_convertToJSON() failed [forbidden_area_list]"); + goto end; } + cJSON_AddItemToArray(forbidden_area_listList, itemLocal); } } @@ -499,15 +625,14 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } } - if (ue_context->restricted_core_nw_type_list) { - cJSON *restricted_core_nw_type_list = cJSON_AddArrayToObject(item, "restrictedCoreNwTypeList"); - if (restricted_core_nw_type_list == NULL) { + if (ue_context->restricted_core_nw_type_list != OpenAPI_core_network_type_NULL) { + cJSON *restricted_core_nw_type_listList = cJSON_AddArrayToObject(item, "restrictedCoreNwTypeList"); + if (restricted_core_nw_type_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_core_nw_type_list]"); goto end; } - OpenAPI_lnode_t *restricted_core_nw_type_list_node; - OpenAPI_list_for_each(ue_context->restricted_core_nw_type_list, restricted_core_nw_type_list_node) { - if (cJSON_AddStringToObject(restricted_core_nw_type_list, "", OpenAPI_core_network_type_ToString((intptr_t)restricted_core_nw_type_list_node->data)) == NULL) { + OpenAPI_list_for_each(ue_context->restricted_core_nw_type_list, node) { + if (cJSON_AddStringToObject(restricted_core_nw_type_listList, "", OpenAPI_core_network_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_core_nw_type_list]"); goto end; } @@ -520,17 +645,13 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) ogs_error("OpenAPI_ue_context_convertToJSON() failed [event_subscription_list]"); goto end; } - - OpenAPI_lnode_t *event_subscription_list_node; - if (ue_context->event_subscription_list) { - OpenAPI_list_for_each(ue_context->event_subscription_list, event_subscription_list_node) { - cJSON *itemLocal = OpenAPI_ext_amf_event_subscription_convertToJSON(event_subscription_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_convertToJSON() failed [event_subscription_list]"); - goto end; - } - cJSON_AddItemToArray(event_subscription_listList, itemLocal); + OpenAPI_list_for_each(ue_context->event_subscription_list, node) { + cJSON *itemLocal = OpenAPI_ext_amf_event_subscription_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_convertToJSON() failed [event_subscription_list]"); + goto end; } + cJSON_AddItemToArray(event_subscription_listList, itemLocal); } } @@ -540,17 +661,13 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) ogs_error("OpenAPI_ue_context_convertToJSON() failed [mm_context_list]"); goto end; } - - OpenAPI_lnode_t *mm_context_list_node; - if (ue_context->mm_context_list) { - OpenAPI_list_for_each(ue_context->mm_context_list, mm_context_list_node) { - cJSON *itemLocal = OpenAPI_mm_context_convertToJSON(mm_context_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_convertToJSON() failed [mm_context_list]"); - goto end; - } - cJSON_AddItemToArray(mm_context_listList, itemLocal); + OpenAPI_list_for_each(ue_context->mm_context_list, node) { + cJSON *itemLocal = OpenAPI_mm_context_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_convertToJSON() failed [mm_context_list]"); + goto end; } + cJSON_AddItemToArray(mm_context_listList, itemLocal); } } @@ -560,17 +677,13 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) ogs_error("OpenAPI_ue_context_convertToJSON() failed [session_context_list]"); goto end; } - - OpenAPI_lnode_t *session_context_list_node; - if (ue_context->session_context_list) { - OpenAPI_list_for_each(ue_context->session_context_list, session_context_list_node) { - cJSON *itemLocal = OpenAPI_pdu_session_context_convertToJSON(session_context_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_convertToJSON() failed [session_context_list]"); - goto end; - } - cJSON_AddItemToArray(session_context_listList, itemLocal); + OpenAPI_list_for_each(ue_context->session_context_list, node) { + cJSON *itemLocal = OpenAPI_pdu_session_context_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_convertToJSON() failed [session_context_list]"); + goto end; } + cJSON_AddItemToArray(session_context_listList, itemLocal); } } @@ -609,22 +722,24 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) } if (ue_context->ms_classmark2) { - if (cJSON_AddNumberToObject(item, "msClassmark2", ue_context->ms_classmark2) == NULL) { + if (cJSON_AddStringToObject(item, "msClassmark2", ue_context->ms_classmark2) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [ms_classmark2]"); goto end; } } if (ue_context->supported_codec_list) { - cJSON *supported_codec_list = cJSON_AddArrayToObject(item, "supportedCodecList"); - if (supported_codec_list == NULL) { + cJSON *supported_codec_listList = cJSON_AddArrayToObject(item, "supportedCodecList"); + if (supported_codec_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [supported_codec_list]"); goto end; } - - OpenAPI_lnode_t *supported_codec_list_node; - OpenAPI_list_for_each(ue_context->supported_codec_list, supported_codec_list_node) { - } + OpenAPI_list_for_each(ue_context->supported_codec_list, node) { + if (cJSON_AddStringToObject(supported_codec_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_context_convertToJSON() failed [supported_codec_list]"); + goto end; + } + } } if (ue_context->small_data_rate_status_infos) { @@ -633,44 +748,38 @@ cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context) ogs_error("OpenAPI_ue_context_convertToJSON() failed [small_data_rate_status_infos]"); goto end; } - - OpenAPI_lnode_t *small_data_rate_status_infos_node; - if (ue_context->small_data_rate_status_infos) { - OpenAPI_list_for_each(ue_context->small_data_rate_status_infos, small_data_rate_status_infos_node) { - cJSON *itemLocal = OpenAPI_small_data_rate_status_info_convertToJSON(small_data_rate_status_infos_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_convertToJSON() failed [small_data_rate_status_infos]"); - goto end; - } - cJSON_AddItemToArray(small_data_rate_status_infosList, itemLocal); + OpenAPI_list_for_each(ue_context->small_data_rate_status_infos, node) { + cJSON *itemLocal = OpenAPI_small_data_rate_status_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_convertToJSON() failed [small_data_rate_status_infos]"); + goto end; } + cJSON_AddItemToArray(small_data_rate_status_infosList, itemLocal); } } - if (ue_context->restricted_primary_rat_list) { - cJSON *restricted_primary_rat_list = cJSON_AddArrayToObject(item, "restrictedPrimaryRatList"); - if (restricted_primary_rat_list == NULL) { + if (ue_context->restricted_primary_rat_list != OpenAPI_rat_type_NULL) { + cJSON *restricted_primary_rat_listList = cJSON_AddArrayToObject(item, "restrictedPrimaryRatList"); + if (restricted_primary_rat_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_primary_rat_list]"); goto end; } - OpenAPI_lnode_t *restricted_primary_rat_list_node; - OpenAPI_list_for_each(ue_context->restricted_primary_rat_list, restricted_primary_rat_list_node) { - if (cJSON_AddStringToObject(restricted_primary_rat_list, "", OpenAPI_rat_type_ToString((intptr_t)restricted_primary_rat_list_node->data)) == NULL) { + OpenAPI_list_for_each(ue_context->restricted_primary_rat_list, node) { + if (cJSON_AddStringToObject(restricted_primary_rat_listList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_primary_rat_list]"); goto end; } } } - if (ue_context->restricted_secondary_rat_list) { - cJSON *restricted_secondary_rat_list = cJSON_AddArrayToObject(item, "restrictedSecondaryRatList"); - if (restricted_secondary_rat_list == NULL) { + if (ue_context->restricted_secondary_rat_list != OpenAPI_rat_type_NULL) { + cJSON *restricted_secondary_rat_listList = cJSON_AddArrayToObject(item, "restrictedSecondaryRatList"); + if (restricted_secondary_rat_listList == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_secondary_rat_list]"); goto end; } - OpenAPI_lnode_t *restricted_secondary_rat_list_node; - OpenAPI_list_for_each(ue_context->restricted_secondary_rat_list, restricted_secondary_rat_list_node) { - if (cJSON_AddStringToObject(restricted_secondary_rat_list, "", OpenAPI_rat_type_ToString((intptr_t)restricted_secondary_rat_list_node->data)) == NULL) { + OpenAPI_list_for_each(ue_context->restricted_secondary_rat_list, node) { + if (cJSON_AddStringToObject(restricted_secondary_rat_listList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_secondary_rat_list]"); goto end; } @@ -777,17 +886,92 @@ end: OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) { OpenAPI_ue_context_t *ue_context_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *supi_unauth_ind = NULL; + cJSON *gpsi_list = NULL; + OpenAPI_list_t *gpsi_listList = NULL; + cJSON *pei = NULL; + cJSON *udm_group_id = NULL; + cJSON *ausf_group_id = NULL; + cJSON *pcf_group_id = NULL; + cJSON *routing_indicator = NULL; + cJSON *group_list = NULL; + OpenAPI_list_t *group_listList = NULL; + cJSON *drx_parameter = NULL; + cJSON *sub_rfsp = NULL; + cJSON *used_rfsp = NULL; + cJSON *sub_ue_ambr = NULL; + OpenAPI_ambr_t *sub_ue_ambr_local_nonprim = NULL; + cJSON *smsf_id = NULL; + cJSON *seaf_data = NULL; + OpenAPI_seaf_data_t *seaf_data_local_nonprim = NULL; + cJSON *_5g_mm_capability = NULL; + cJSON *pcf_id = NULL; + cJSON *pcf_set_id = NULL; + cJSON *pcf_amp_service_set_id = NULL; + cJSON *pcf_uep_service_set_id = NULL; + cJSON *pcf_binding = NULL; + OpenAPI_sbi_binding_level_e pcf_bindingVariable = 0; + cJSON *pcf_am_policy_uri = NULL; + cJSON *am_policy_req_trigger_list = NULL; + OpenAPI_list_t *am_policy_req_trigger_listList = NULL; + cJSON *pcf_ue_policy_uri = NULL; + cJSON *ue_policy_req_trigger_list = NULL; + OpenAPI_list_t *ue_policy_req_trigger_listList = NULL; + cJSON *hpcf_id = NULL; + cJSON *hpcf_set_id = NULL; + cJSON *restricted_rat_list = NULL; + OpenAPI_list_t *restricted_rat_listList = NULL; + cJSON *forbidden_area_list = NULL; + OpenAPI_list_t *forbidden_area_listList = NULL; + cJSON *service_area_restriction = NULL; + OpenAPI_service_area_restriction_t *service_area_restriction_local_nonprim = NULL; + cJSON *restricted_core_nw_type_list = NULL; + OpenAPI_list_t *restricted_core_nw_type_listList = NULL; + cJSON *event_subscription_list = NULL; + OpenAPI_list_t *event_subscription_listList = NULL; + cJSON *mm_context_list = NULL; + OpenAPI_list_t *mm_context_listList = NULL; + cJSON *session_context_list = NULL; + OpenAPI_list_t *session_context_listList = NULL; + cJSON *trace_data = NULL; + OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + cJSON *service_gap_expiry_time = NULL; + cJSON *stn_sr = NULL; + cJSON *c_msisdn = NULL; + cJSON *ms_classmark2 = NULL; + cJSON *supported_codec_list = NULL; + OpenAPI_list_t *supported_codec_listList = NULL; + cJSON *small_data_rate_status_infos = NULL; + OpenAPI_list_t *small_data_rate_status_infosList = NULL; + cJSON *restricted_primary_rat_list = NULL; + OpenAPI_list_t *restricted_primary_rat_listList = NULL; + cJSON *restricted_secondary_rat_list = NULL; + OpenAPI_list_t *restricted_secondary_rat_listList = NULL; + cJSON *v2x_context = NULL; + OpenAPI_v2x_context_t *v2x_context_local_nonprim = NULL; + cJSON *lte_cat_m_ind = NULL; + cJSON *mo_exp_data_counter = NULL; + OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + cJSON *cag_data = NULL; + OpenAPI_cag_data_t *cag_data_local_nonprim = NULL; + cJSON *management_mdt_ind = NULL; + cJSON *immediate_mdt_conf = NULL; + OpenAPI_immediate_mdt_conf_t *immediate_mdt_conf_local_nonprim = NULL; + cJSON *ec_restriction_data_wb = NULL; + OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL; + cJSON *ec_restriction_data_nb = NULL; + cJSON *iab_operation_allowed = NULL; + supi = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supi]"); goto end; } } - cJSON *supi_unauth_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supiUnauthInd"); - + supi_unauth_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supiUnauthInd"); if (supi_unauth_ind) { if (!cJSON_IsBool(supi_unauth_ind)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supi_unauth_ind]"); @@ -795,102 +979,97 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) } } - cJSON *gpsi_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "gpsiList"); - - OpenAPI_list_t *gpsi_listList; + gpsi_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "gpsiList"); if (gpsi_list) { - cJSON *gpsi_list_local; - if (!cJSON_IsArray(gpsi_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [gpsi_list]"); - goto end; - } - gpsi_listList = OpenAPI_list_create(); + cJSON *gpsi_list_local = NULL; + if (!cJSON_IsArray(gpsi_list)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [gpsi_list]"); + goto end; + } - cJSON_ArrayForEach(gpsi_list_local, gpsi_list) { - if (!cJSON_IsString(gpsi_list_local)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [gpsi_list]"); - goto end; - } - OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring)); - } + gpsi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_list_local, gpsi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(gpsi_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [gpsi_list]"); + goto end; + } + OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring)); + } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pei]"); goto end; } } - cJSON *udm_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "udmGroupId"); - + udm_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "udmGroupId"); if (udm_group_id) { - if (!cJSON_IsString(udm_group_id)) { + if (!cJSON_IsString(udm_group_id) && !cJSON_IsNull(udm_group_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [udm_group_id]"); goto end; } } - cJSON *ausf_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ausfGroupId"); - + ausf_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ausfGroupId"); if (ausf_group_id) { - if (!cJSON_IsString(ausf_group_id)) { + if (!cJSON_IsString(ausf_group_id) && !cJSON_IsNull(ausf_group_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ausf_group_id]"); goto end; } } - cJSON *pcf_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfGroupId"); - + pcf_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfGroupId"); if (pcf_group_id) { - if (!cJSON_IsString(pcf_group_id)) { + if (!cJSON_IsString(pcf_group_id) && !cJSON_IsNull(pcf_group_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_group_id]"); goto end; } } - cJSON *routing_indicator = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "routingIndicator"); - + routing_indicator = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "routingIndicator"); if (routing_indicator) { - if (!cJSON_IsString(routing_indicator)) { + if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [routing_indicator]"); goto end; } } - cJSON *group_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "groupList"); - - OpenAPI_list_t *group_listList; + group_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "groupList"); if (group_list) { - cJSON *group_list_local; - if (!cJSON_IsArray(group_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [group_list]"); - goto end; - } - group_listList = OpenAPI_list_create(); + cJSON *group_list_local = NULL; + if (!cJSON_IsArray(group_list)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [group_list]"); + goto end; + } - cJSON_ArrayForEach(group_list_local, group_list) { - if (!cJSON_IsString(group_list_local)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [group_list]"); - goto end; - } - OpenAPI_list_add(group_listList, ogs_strdup(group_list_local->valuestring)); - } + group_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(group_list_local, group_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(group_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [group_list]"); + goto end; + } + OpenAPI_list_add(group_listList, ogs_strdup(group_list_local->valuestring)); + } } - cJSON *drx_parameter = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "drxParameter"); - + drx_parameter = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "drxParameter"); if (drx_parameter) { - if (!cJSON_IsNumber(drx_parameter)) { + if (!cJSON_IsString(drx_parameter) && !cJSON_IsNull(drx_parameter)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [drx_parameter]"); goto end; } } - cJSON *sub_rfsp = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "subRfsp"); - + sub_rfsp = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "subRfsp"); if (sub_rfsp) { if (!cJSON_IsNumber(sub_rfsp)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [sub_rfsp]"); @@ -898,8 +1077,7 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) } } - cJSON *used_rfsp = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "usedRfsp"); - + used_rfsp = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "usedRfsp"); if (used_rfsp) { if (!cJSON_IsNumber(used_rfsp)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [used_rfsp]"); @@ -907,77 +1085,65 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) } } - cJSON *sub_ue_ambr = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "subUeAmbr"); - - OpenAPI_ambr_t *sub_ue_ambr_local_nonprim = NULL; + sub_ue_ambr = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "subUeAmbr"); if (sub_ue_ambr) { sub_ue_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(sub_ue_ambr); } - cJSON *smsf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smsfId"); - + smsf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smsfId"); if (smsf_id) { - if (!cJSON_IsString(smsf_id)) { + if (!cJSON_IsString(smsf_id) && !cJSON_IsNull(smsf_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [smsf_id]"); goto end; } } - cJSON *seaf_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "seafData"); - - OpenAPI_seaf_data_t *seaf_data_local_nonprim = NULL; + seaf_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "seafData"); if (seaf_data) { seaf_data_local_nonprim = OpenAPI_seaf_data_parseFromJSON(seaf_data); } - cJSON *_5g_mm_capability = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "5gMmCapability"); - + _5g_mm_capability = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "5gMmCapability"); if (_5g_mm_capability) { - if (!cJSON_IsNumber(_5g_mm_capability)) { + if (!cJSON_IsString(_5g_mm_capability) && !cJSON_IsNull(_5g_mm_capability)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [_5g_mm_capability]"); goto end; } } - cJSON *pcf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfId"); - + pcf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfId"); if (pcf_id) { - if (!cJSON_IsString(pcf_id)) { + if (!cJSON_IsString(pcf_id) && !cJSON_IsNull(pcf_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_id]"); goto end; } } - cJSON *pcf_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfSetId"); - + pcf_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfSetId"); if (pcf_set_id) { - if (!cJSON_IsString(pcf_set_id)) { + if (!cJSON_IsString(pcf_set_id) && !cJSON_IsNull(pcf_set_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_set_id]"); goto end; } } - cJSON *pcf_amp_service_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfAmpServiceSetId"); - + pcf_amp_service_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfAmpServiceSetId"); if (pcf_amp_service_set_id) { - if (!cJSON_IsString(pcf_amp_service_set_id)) { + if (!cJSON_IsString(pcf_amp_service_set_id) && !cJSON_IsNull(pcf_amp_service_set_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_amp_service_set_id]"); goto end; } } - cJSON *pcf_uep_service_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUepServiceSetId"); - + pcf_uep_service_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUepServiceSetId"); if (pcf_uep_service_set_id) { - if (!cJSON_IsString(pcf_uep_service_set_id)) { + if (!cJSON_IsString(pcf_uep_service_set_id) && !cJSON_IsNull(pcf_uep_service_set_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_uep_service_set_id]"); goto end; } } - cJSON *pcf_binding = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfBinding"); - - OpenAPI_sbi_binding_level_e pcf_bindingVariable; + pcf_binding = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfBinding"); if (pcf_binding) { if (!cJSON_IsString(pcf_binding)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_binding]"); @@ -986,393 +1152,346 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) pcf_bindingVariable = OpenAPI_sbi_binding_level_FromString(pcf_binding->valuestring); } - cJSON *pcf_am_policy_uri = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfAmPolicyUri"); - + pcf_am_policy_uri = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfAmPolicyUri"); if (pcf_am_policy_uri) { - if (!cJSON_IsString(pcf_am_policy_uri)) { + if (!cJSON_IsString(pcf_am_policy_uri) && !cJSON_IsNull(pcf_am_policy_uri)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_am_policy_uri]"); goto end; } } - cJSON *am_policy_req_trigger_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "amPolicyReqTriggerList"); - - OpenAPI_list_t *am_policy_req_trigger_listList; + am_policy_req_trigger_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "amPolicyReqTriggerList"); if (am_policy_req_trigger_list) { - cJSON *am_policy_req_trigger_list_local_nonprimitive; - if (!cJSON_IsArray(am_policy_req_trigger_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [am_policy_req_trigger_list]"); - goto end; - } - - am_policy_req_trigger_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(am_policy_req_trigger_list_local_nonprimitive, am_policy_req_trigger_list ) { - if (!cJSON_IsString(am_policy_req_trigger_list_local_nonprimitive)){ + cJSON *am_policy_req_trigger_list_local = NULL; + if (!cJSON_IsArray(am_policy_req_trigger_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [am_policy_req_trigger_list]"); goto end; } - OpenAPI_list_add(am_policy_req_trigger_listList, (void *)OpenAPI_policy_req_trigger_FromString(am_policy_req_trigger_list_local_nonprimitive->valuestring)); - } + am_policy_req_trigger_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(am_policy_req_trigger_list_local, am_policy_req_trigger_list) { + if (!cJSON_IsString(am_policy_req_trigger_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [am_policy_req_trigger_list]"); + goto end; + } + OpenAPI_list_add(am_policy_req_trigger_listList, (void *)OpenAPI_policy_req_trigger_FromString(am_policy_req_trigger_list_local->valuestring)); + } } - cJSON *pcf_ue_policy_uri = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUePolicyUri"); - + pcf_ue_policy_uri = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUePolicyUri"); if (pcf_ue_policy_uri) { - if (!cJSON_IsString(pcf_ue_policy_uri)) { + if (!cJSON_IsString(pcf_ue_policy_uri) && !cJSON_IsNull(pcf_ue_policy_uri)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_ue_policy_uri]"); goto end; } } - cJSON *ue_policy_req_trigger_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "uePolicyReqTriggerList"); - - OpenAPI_list_t *ue_policy_req_trigger_listList; + ue_policy_req_trigger_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "uePolicyReqTriggerList"); if (ue_policy_req_trigger_list) { - cJSON *ue_policy_req_trigger_list_local_nonprimitive; - if (!cJSON_IsArray(ue_policy_req_trigger_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ue_policy_req_trigger_list]"); - goto end; - } - - ue_policy_req_trigger_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(ue_policy_req_trigger_list_local_nonprimitive, ue_policy_req_trigger_list ) { - if (!cJSON_IsString(ue_policy_req_trigger_list_local_nonprimitive)){ + cJSON *ue_policy_req_trigger_list_local = NULL; + if (!cJSON_IsArray(ue_policy_req_trigger_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ue_policy_req_trigger_list]"); goto end; } - OpenAPI_list_add(ue_policy_req_trigger_listList, (void *)OpenAPI_policy_req_trigger_FromString(ue_policy_req_trigger_list_local_nonprimitive->valuestring)); - } + ue_policy_req_trigger_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ue_policy_req_trigger_list_local, ue_policy_req_trigger_list) { + if (!cJSON_IsString(ue_policy_req_trigger_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ue_policy_req_trigger_list]"); + goto end; + } + OpenAPI_list_add(ue_policy_req_trigger_listList, (void *)OpenAPI_policy_req_trigger_FromString(ue_policy_req_trigger_list_local->valuestring)); + } } - cJSON *hpcf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "hpcfId"); - + hpcf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "hpcfId"); if (hpcf_id) { - if (!cJSON_IsString(hpcf_id)) { + if (!cJSON_IsString(hpcf_id) && !cJSON_IsNull(hpcf_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [hpcf_id]"); goto end; } } - cJSON *hpcf_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "hpcfSetId"); - + hpcf_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "hpcfSetId"); if (hpcf_set_id) { - if (!cJSON_IsString(hpcf_set_id)) { + if (!cJSON_IsString(hpcf_set_id) && !cJSON_IsNull(hpcf_set_id)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [hpcf_set_id]"); goto end; } } - cJSON *restricted_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedRatList"); - - OpenAPI_list_t *restricted_rat_listList; + restricted_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedRatList"); if (restricted_rat_list) { - cJSON *restricted_rat_list_local_nonprimitive; - if (!cJSON_IsArray(restricted_rat_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_rat_list]"); - goto end; - } - - restricted_rat_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(restricted_rat_list_local_nonprimitive, restricted_rat_list ) { - if (!cJSON_IsString(restricted_rat_list_local_nonprimitive)){ + cJSON *restricted_rat_list_local = NULL; + if (!cJSON_IsArray(restricted_rat_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_rat_list]"); goto end; } - OpenAPI_list_add(restricted_rat_listList, (void *)OpenAPI_rat_type_FromString(restricted_rat_list_local_nonprimitive->valuestring)); - } + restricted_rat_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(restricted_rat_list_local, restricted_rat_list) { + if (!cJSON_IsString(restricted_rat_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_rat_list]"); + goto end; + } + OpenAPI_list_add(restricted_rat_listList, (void *)OpenAPI_rat_type_FromString(restricted_rat_list_local->valuestring)); + } } - cJSON *forbidden_area_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "forbiddenAreaList"); - - OpenAPI_list_t *forbidden_area_listList; + forbidden_area_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "forbiddenAreaList"); if (forbidden_area_list) { - cJSON *forbidden_area_list_local_nonprimitive; - if (!cJSON_IsArray(forbidden_area_list)){ - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [forbidden_area_list]"); - goto end; - } - - forbidden_area_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(forbidden_area_list_local_nonprimitive, forbidden_area_list ) { - if (!cJSON_IsObject(forbidden_area_list_local_nonprimitive)) { + cJSON *forbidden_area_list_local = NULL; + if (!cJSON_IsArray(forbidden_area_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [forbidden_area_list]"); goto end; } - OpenAPI_area_t *forbidden_area_listItem = OpenAPI_area_parseFromJSON(forbidden_area_list_local_nonprimitive); - if (!forbidden_area_listItem) { - ogs_error("No forbidden_area_listItem"); - OpenAPI_list_free(forbidden_area_listList); - goto end; + forbidden_area_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(forbidden_area_list_local, forbidden_area_list) { + if (!cJSON_IsObject(forbidden_area_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [forbidden_area_list]"); + goto end; + } + OpenAPI_area_t *forbidden_area_listItem = OpenAPI_area_parseFromJSON(forbidden_area_list_local); + if (!forbidden_area_listItem) { + ogs_error("No forbidden_area_listItem"); + OpenAPI_list_free(forbidden_area_listList); + goto end; + } + OpenAPI_list_add(forbidden_area_listList, forbidden_area_listItem); } - - OpenAPI_list_add(forbidden_area_listList, forbidden_area_listItem); - } } - cJSON *service_area_restriction = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "serviceAreaRestriction"); - - OpenAPI_service_area_restriction_t *service_area_restriction_local_nonprim = NULL; + service_area_restriction = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "serviceAreaRestriction"); if (service_area_restriction) { service_area_restriction_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(service_area_restriction); } - cJSON *restricted_core_nw_type_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedCoreNwTypeList"); - - OpenAPI_list_t *restricted_core_nw_type_listList; + restricted_core_nw_type_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedCoreNwTypeList"); if (restricted_core_nw_type_list) { - cJSON *restricted_core_nw_type_list_local_nonprimitive; - if (!cJSON_IsArray(restricted_core_nw_type_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_core_nw_type_list]"); - goto end; - } - - restricted_core_nw_type_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(restricted_core_nw_type_list_local_nonprimitive, restricted_core_nw_type_list ) { - if (!cJSON_IsString(restricted_core_nw_type_list_local_nonprimitive)){ + cJSON *restricted_core_nw_type_list_local = NULL; + if (!cJSON_IsArray(restricted_core_nw_type_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_core_nw_type_list]"); goto end; } - OpenAPI_list_add(restricted_core_nw_type_listList, (void *)OpenAPI_core_network_type_FromString(restricted_core_nw_type_list_local_nonprimitive->valuestring)); - } + restricted_core_nw_type_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(restricted_core_nw_type_list_local, restricted_core_nw_type_list) { + if (!cJSON_IsString(restricted_core_nw_type_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_core_nw_type_list]"); + goto end; + } + OpenAPI_list_add(restricted_core_nw_type_listList, (void *)OpenAPI_core_network_type_FromString(restricted_core_nw_type_list_local->valuestring)); + } } - cJSON *event_subscription_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "eventSubscriptionList"); - - OpenAPI_list_t *event_subscription_listList; + event_subscription_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "eventSubscriptionList"); if (event_subscription_list) { - cJSON *event_subscription_list_local_nonprimitive; - if (!cJSON_IsArray(event_subscription_list)){ - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [event_subscription_list]"); - goto end; - } - - event_subscription_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(event_subscription_list_local_nonprimitive, event_subscription_list ) { - if (!cJSON_IsObject(event_subscription_list_local_nonprimitive)) { + cJSON *event_subscription_list_local = NULL; + if (!cJSON_IsArray(event_subscription_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [event_subscription_list]"); goto end; } - OpenAPI_ext_amf_event_subscription_t *event_subscription_listItem = OpenAPI_ext_amf_event_subscription_parseFromJSON(event_subscription_list_local_nonprimitive); - if (!event_subscription_listItem) { - ogs_error("No event_subscription_listItem"); - OpenAPI_list_free(event_subscription_listList); - goto end; + event_subscription_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(event_subscription_list_local, event_subscription_list) { + if (!cJSON_IsObject(event_subscription_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [event_subscription_list]"); + goto end; + } + OpenAPI_ext_amf_event_subscription_t *event_subscription_listItem = OpenAPI_ext_amf_event_subscription_parseFromJSON(event_subscription_list_local); + if (!event_subscription_listItem) { + ogs_error("No event_subscription_listItem"); + OpenAPI_list_free(event_subscription_listList); + goto end; + } + OpenAPI_list_add(event_subscription_listList, event_subscription_listItem); } - - OpenAPI_list_add(event_subscription_listList, event_subscription_listItem); - } } - cJSON *mm_context_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "mmContextList"); - - OpenAPI_list_t *mm_context_listList; + mm_context_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "mmContextList"); if (mm_context_list) { - cJSON *mm_context_list_local_nonprimitive; - if (!cJSON_IsArray(mm_context_list)){ - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [mm_context_list]"); - goto end; - } - - mm_context_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(mm_context_list_local_nonprimitive, mm_context_list ) { - if (!cJSON_IsObject(mm_context_list_local_nonprimitive)) { + cJSON *mm_context_list_local = NULL; + if (!cJSON_IsArray(mm_context_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [mm_context_list]"); goto end; } - OpenAPI_mm_context_t *mm_context_listItem = OpenAPI_mm_context_parseFromJSON(mm_context_list_local_nonprimitive); - if (!mm_context_listItem) { - ogs_error("No mm_context_listItem"); - OpenAPI_list_free(mm_context_listList); - goto end; + mm_context_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(mm_context_list_local, mm_context_list) { + if (!cJSON_IsObject(mm_context_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [mm_context_list]"); + goto end; + } + OpenAPI_mm_context_t *mm_context_listItem = OpenAPI_mm_context_parseFromJSON(mm_context_list_local); + if (!mm_context_listItem) { + ogs_error("No mm_context_listItem"); + OpenAPI_list_free(mm_context_listList); + goto end; + } + OpenAPI_list_add(mm_context_listList, mm_context_listItem); } - - OpenAPI_list_add(mm_context_listList, mm_context_listItem); - } } - cJSON *session_context_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "sessionContextList"); - - OpenAPI_list_t *session_context_listList; + session_context_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "sessionContextList"); if (session_context_list) { - cJSON *session_context_list_local_nonprimitive; - if (!cJSON_IsArray(session_context_list)){ - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [session_context_list]"); - goto end; - } - - session_context_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(session_context_list_local_nonprimitive, session_context_list ) { - if (!cJSON_IsObject(session_context_list_local_nonprimitive)) { + cJSON *session_context_list_local = NULL; + if (!cJSON_IsArray(session_context_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [session_context_list]"); goto end; } - OpenAPI_pdu_session_context_t *session_context_listItem = OpenAPI_pdu_session_context_parseFromJSON(session_context_list_local_nonprimitive); - if (!session_context_listItem) { - ogs_error("No session_context_listItem"); - OpenAPI_list_free(session_context_listList); - goto end; + session_context_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(session_context_list_local, session_context_list) { + if (!cJSON_IsObject(session_context_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [session_context_list]"); + goto end; + } + OpenAPI_pdu_session_context_t *session_context_listItem = OpenAPI_pdu_session_context_parseFromJSON(session_context_list_local); + if (!session_context_listItem) { + ogs_error("No session_context_listItem"); + OpenAPI_list_free(session_context_listList); + goto end; + } + OpenAPI_list_add(session_context_listList, session_context_listItem); } - - OpenAPI_list_add(session_context_listList, session_context_listItem); - } } - cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "traceData"); - - OpenAPI_trace_data_t *trace_data_local_nonprim = NULL; + trace_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "traceData"); if (trace_data) { trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data); } - cJSON *service_gap_expiry_time = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "serviceGapExpiryTime"); - + service_gap_expiry_time = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "serviceGapExpiryTime"); if (service_gap_expiry_time) { - if (!cJSON_IsString(service_gap_expiry_time)) { + if (!cJSON_IsString(service_gap_expiry_time) && !cJSON_IsNull(service_gap_expiry_time)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [service_gap_expiry_time]"); goto end; } } - cJSON *stn_sr = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "stnSr"); - + stn_sr = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "stnSr"); if (stn_sr) { - if (!cJSON_IsString(stn_sr)) { + if (!cJSON_IsString(stn_sr) && !cJSON_IsNull(stn_sr)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [stn_sr]"); goto end; } } - cJSON *c_msisdn = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "cMsisdn"); - + c_msisdn = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "cMsisdn"); if (c_msisdn) { - if (!cJSON_IsString(c_msisdn)) { + if (!cJSON_IsString(c_msisdn) && !cJSON_IsNull(c_msisdn)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [c_msisdn]"); goto end; } } - cJSON *ms_classmark2 = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "msClassmark2"); - + ms_classmark2 = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "msClassmark2"); if (ms_classmark2) { - if (!cJSON_IsNumber(ms_classmark2)) { + if (!cJSON_IsString(ms_classmark2) && !cJSON_IsNull(ms_classmark2)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ms_classmark2]"); goto end; } } - cJSON *supported_codec_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supportedCodecList"); - - OpenAPI_list_t *supported_codec_listList; + supported_codec_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supportedCodecList"); if (supported_codec_list) { - cJSON *supported_codec_list_local; - if (!cJSON_IsArray(supported_codec_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supported_codec_list]"); - goto end; - } - supported_codec_listList = OpenAPI_list_create(); + cJSON *supported_codec_list_local = NULL; + if (!cJSON_IsArray(supported_codec_list)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supported_codec_list]"); + goto end; + } - cJSON_ArrayForEach(supported_codec_list_local, supported_codec_list) { - } + supported_codec_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(supported_codec_list_local, supported_codec_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(supported_codec_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supported_codec_list]"); + goto end; + } + OpenAPI_list_add(supported_codec_listList, ogs_strdup(supported_codec_list_local->valuestring)); + } } - cJSON *small_data_rate_status_infos = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smallDataRateStatusInfos"); - - OpenAPI_list_t *small_data_rate_status_infosList; + small_data_rate_status_infos = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smallDataRateStatusInfos"); if (small_data_rate_status_infos) { - cJSON *small_data_rate_status_infos_local_nonprimitive; - if (!cJSON_IsArray(small_data_rate_status_infos)){ - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [small_data_rate_status_infos]"); - goto end; - } - - small_data_rate_status_infosList = OpenAPI_list_create(); - - cJSON_ArrayForEach(small_data_rate_status_infos_local_nonprimitive, small_data_rate_status_infos ) { - if (!cJSON_IsObject(small_data_rate_status_infos_local_nonprimitive)) { + cJSON *small_data_rate_status_infos_local = NULL; + if (!cJSON_IsArray(small_data_rate_status_infos)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [small_data_rate_status_infos]"); goto end; } - OpenAPI_small_data_rate_status_info_t *small_data_rate_status_infosItem = OpenAPI_small_data_rate_status_info_parseFromJSON(small_data_rate_status_infos_local_nonprimitive); - if (!small_data_rate_status_infosItem) { - ogs_error("No small_data_rate_status_infosItem"); - OpenAPI_list_free(small_data_rate_status_infosList); - goto end; + small_data_rate_status_infosList = OpenAPI_list_create(); + + cJSON_ArrayForEach(small_data_rate_status_infos_local, small_data_rate_status_infos) { + if (!cJSON_IsObject(small_data_rate_status_infos_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [small_data_rate_status_infos]"); + goto end; + } + OpenAPI_small_data_rate_status_info_t *small_data_rate_status_infosItem = OpenAPI_small_data_rate_status_info_parseFromJSON(small_data_rate_status_infos_local); + if (!small_data_rate_status_infosItem) { + ogs_error("No small_data_rate_status_infosItem"); + OpenAPI_list_free(small_data_rate_status_infosList); + goto end; + } + OpenAPI_list_add(small_data_rate_status_infosList, small_data_rate_status_infosItem); } - - OpenAPI_list_add(small_data_rate_status_infosList, small_data_rate_status_infosItem); - } } - cJSON *restricted_primary_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedPrimaryRatList"); - - OpenAPI_list_t *restricted_primary_rat_listList; + restricted_primary_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedPrimaryRatList"); if (restricted_primary_rat_list) { - cJSON *restricted_primary_rat_list_local_nonprimitive; - if (!cJSON_IsArray(restricted_primary_rat_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_primary_rat_list]"); - goto end; - } - - restricted_primary_rat_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(restricted_primary_rat_list_local_nonprimitive, restricted_primary_rat_list ) { - if (!cJSON_IsString(restricted_primary_rat_list_local_nonprimitive)){ + cJSON *restricted_primary_rat_list_local = NULL; + if (!cJSON_IsArray(restricted_primary_rat_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_primary_rat_list]"); goto end; } - OpenAPI_list_add(restricted_primary_rat_listList, (void *)OpenAPI_rat_type_FromString(restricted_primary_rat_list_local_nonprimitive->valuestring)); - } + restricted_primary_rat_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(restricted_primary_rat_list_local, restricted_primary_rat_list) { + if (!cJSON_IsString(restricted_primary_rat_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_primary_rat_list]"); + goto end; + } + OpenAPI_list_add(restricted_primary_rat_listList, (void *)OpenAPI_rat_type_FromString(restricted_primary_rat_list_local->valuestring)); + } } - cJSON *restricted_secondary_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedSecondaryRatList"); - - OpenAPI_list_t *restricted_secondary_rat_listList; + restricted_secondary_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedSecondaryRatList"); if (restricted_secondary_rat_list) { - cJSON *restricted_secondary_rat_list_local_nonprimitive; - if (!cJSON_IsArray(restricted_secondary_rat_list)) { - ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_secondary_rat_list]"); - goto end; - } - - restricted_secondary_rat_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(restricted_secondary_rat_list_local_nonprimitive, restricted_secondary_rat_list ) { - if (!cJSON_IsString(restricted_secondary_rat_list_local_nonprimitive)){ + cJSON *restricted_secondary_rat_list_local = NULL; + if (!cJSON_IsArray(restricted_secondary_rat_list)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_secondary_rat_list]"); goto end; } - OpenAPI_list_add(restricted_secondary_rat_listList, (void *)OpenAPI_rat_type_FromString(restricted_secondary_rat_list_local_nonprimitive->valuestring)); - } + restricted_secondary_rat_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(restricted_secondary_rat_list_local, restricted_secondary_rat_list) { + if (!cJSON_IsString(restricted_secondary_rat_list_local)) { + ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_secondary_rat_list]"); + goto end; + } + OpenAPI_list_add(restricted_secondary_rat_listList, (void *)OpenAPI_rat_type_FromString(restricted_secondary_rat_list_local->valuestring)); + } } - cJSON *v2x_context = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "v2xContext"); - - OpenAPI_v2x_context_t *v2x_context_local_nonprim = NULL; + v2x_context = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "v2xContext"); if (v2x_context) { v2x_context_local_nonprim = OpenAPI_v2x_context_parseFromJSON(v2x_context); } - cJSON *lte_cat_m_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "lteCatMInd"); - + lte_cat_m_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "lteCatMInd"); if (lte_cat_m_ind) { if (!cJSON_IsBool(lte_cat_m_ind)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [lte_cat_m_ind]"); @@ -1380,22 +1499,17 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) } } - cJSON *mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "moExpDataCounter"); - - OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL; + mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "moExpDataCounter"); if (mo_exp_data_counter) { mo_exp_data_counter_local_nonprim = OpenAPI_mo_exp_data_counter_parseFromJSON(mo_exp_data_counter); } - cJSON *cag_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "cagData"); - - OpenAPI_cag_data_t *cag_data_local_nonprim = NULL; + cag_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "cagData"); if (cag_data) { cag_data_local_nonprim = OpenAPI_cag_data_parseFromJSON(cag_data); } - cJSON *management_mdt_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "managementMdtInd"); - + management_mdt_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "managementMdtInd"); if (management_mdt_ind) { if (!cJSON_IsBool(management_mdt_ind)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [management_mdt_ind]"); @@ -1403,22 +1517,17 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) } } - cJSON *immediate_mdt_conf = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "immediateMdtConf"); - - OpenAPI_immediate_mdt_conf_t *immediate_mdt_conf_local_nonprim = NULL; + immediate_mdt_conf = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "immediateMdtConf"); if (immediate_mdt_conf) { immediate_mdt_conf_local_nonprim = OpenAPI_immediate_mdt_conf_parseFromJSON(immediate_mdt_conf); } - cJSON *ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ecRestrictionDataWb"); - - OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL; + ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ecRestrictionDataWb"); if (ec_restriction_data_wb) { ec_restriction_data_wb_local_nonprim = OpenAPI_ec_restriction_data_wb_parseFromJSON(ec_restriction_data_wb); } - cJSON *ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ecRestrictionDataNb"); - + ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ecRestrictionDataNb"); if (ec_restriction_data_nb) { if (!cJSON_IsBool(ec_restriction_data_nb)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ec_restriction_data_nb]"); @@ -1426,8 +1535,7 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) } } - cJSON *iab_operation_allowed = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "iabOperationAllowed"); - + iab_operation_allowed = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "iabOperationAllowed"); if (iab_operation_allowed) { if (!cJSON_IsBool(iab_operation_allowed)) { ogs_error("OpenAPI_ue_context_parseFromJSON() failed [iab_operation_allowed]"); @@ -1436,36 +1544,36 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) } ue_context_local_var = OpenAPI_ue_context_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, supi_unauth_ind ? true : false, supi_unauth_ind ? supi_unauth_ind->valueint : 0, gpsi_list ? gpsi_listList : NULL, - pei ? ogs_strdup(pei->valuestring) : NULL, - udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL, - ausf_group_id ? ogs_strdup(ausf_group_id->valuestring) : NULL, - pcf_group_id ? ogs_strdup(pcf_group_id->valuestring) : NULL, - routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, + udm_group_id && !cJSON_IsNull(udm_group_id) ? ogs_strdup(udm_group_id->valuestring) : NULL, + ausf_group_id && !cJSON_IsNull(ausf_group_id) ? ogs_strdup(ausf_group_id->valuestring) : NULL, + pcf_group_id && !cJSON_IsNull(pcf_group_id) ? ogs_strdup(pcf_group_id->valuestring) : NULL, + routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL, group_list ? group_listList : NULL, - drx_parameter ? drx_parameter->valueint : 0, + drx_parameter && !cJSON_IsNull(drx_parameter) ? ogs_strdup(drx_parameter->valuestring) : NULL, sub_rfsp ? true : false, sub_rfsp ? sub_rfsp->valuedouble : 0, used_rfsp ? true : false, used_rfsp ? used_rfsp->valuedouble : 0, sub_ue_ambr ? sub_ue_ambr_local_nonprim : NULL, - smsf_id ? ogs_strdup(smsf_id->valuestring) : NULL, + smsf_id && !cJSON_IsNull(smsf_id) ? ogs_strdup(smsf_id->valuestring) : NULL, seaf_data ? seaf_data_local_nonprim : NULL, - _5g_mm_capability ? _5g_mm_capability->valueint : 0, - pcf_id ? ogs_strdup(pcf_id->valuestring) : NULL, - pcf_set_id ? ogs_strdup(pcf_set_id->valuestring) : NULL, - pcf_amp_service_set_id ? ogs_strdup(pcf_amp_service_set_id->valuestring) : NULL, - pcf_uep_service_set_id ? ogs_strdup(pcf_uep_service_set_id->valuestring) : NULL, + _5g_mm_capability && !cJSON_IsNull(_5g_mm_capability) ? ogs_strdup(_5g_mm_capability->valuestring) : NULL, + pcf_id && !cJSON_IsNull(pcf_id) ? ogs_strdup(pcf_id->valuestring) : NULL, + pcf_set_id && !cJSON_IsNull(pcf_set_id) ? ogs_strdup(pcf_set_id->valuestring) : NULL, + pcf_amp_service_set_id && !cJSON_IsNull(pcf_amp_service_set_id) ? ogs_strdup(pcf_amp_service_set_id->valuestring) : NULL, + pcf_uep_service_set_id && !cJSON_IsNull(pcf_uep_service_set_id) ? ogs_strdup(pcf_uep_service_set_id->valuestring) : NULL, pcf_binding ? pcf_bindingVariable : 0, - pcf_am_policy_uri ? ogs_strdup(pcf_am_policy_uri->valuestring) : NULL, + pcf_am_policy_uri && !cJSON_IsNull(pcf_am_policy_uri) ? ogs_strdup(pcf_am_policy_uri->valuestring) : NULL, am_policy_req_trigger_list ? am_policy_req_trigger_listList : NULL, - pcf_ue_policy_uri ? ogs_strdup(pcf_ue_policy_uri->valuestring) : NULL, + pcf_ue_policy_uri && !cJSON_IsNull(pcf_ue_policy_uri) ? ogs_strdup(pcf_ue_policy_uri->valuestring) : NULL, ue_policy_req_trigger_list ? ue_policy_req_trigger_listList : NULL, - hpcf_id ? ogs_strdup(hpcf_id->valuestring) : NULL, - hpcf_set_id ? ogs_strdup(hpcf_set_id->valuestring) : NULL, + hpcf_id && !cJSON_IsNull(hpcf_id) ? ogs_strdup(hpcf_id->valuestring) : NULL, + hpcf_set_id && !cJSON_IsNull(hpcf_set_id) ? ogs_strdup(hpcf_set_id->valuestring) : NULL, restricted_rat_list ? restricted_rat_listList : NULL, forbidden_area_list ? forbidden_area_listList : NULL, service_area_restriction ? service_area_restriction_local_nonprim : NULL, @@ -1474,10 +1582,10 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) mm_context_list ? mm_context_listList : NULL, session_context_list ? session_context_listList : NULL, trace_data ? trace_data_local_nonprim : NULL, - service_gap_expiry_time ? ogs_strdup(service_gap_expiry_time->valuestring) : NULL, - stn_sr ? ogs_strdup(stn_sr->valuestring) : NULL, - c_msisdn ? ogs_strdup(c_msisdn->valuestring) : NULL, - ms_classmark2 ? ms_classmark2->valueint : 0, + service_gap_expiry_time && !cJSON_IsNull(service_gap_expiry_time) ? ogs_strdup(service_gap_expiry_time->valuestring) : NULL, + stn_sr && !cJSON_IsNull(stn_sr) ? ogs_strdup(stn_sr->valuestring) : NULL, + c_msisdn && !cJSON_IsNull(c_msisdn) ? ogs_strdup(c_msisdn->valuestring) : NULL, + ms_classmark2 && !cJSON_IsNull(ms_classmark2) ? ogs_strdup(ms_classmark2->valuestring) : NULL, supported_codec_list ? supported_codec_listList : NULL, small_data_rate_status_infos ? small_data_rate_status_infosList : NULL, restricted_primary_rat_list ? restricted_primary_rat_listList : NULL, @@ -1499,6 +1607,122 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON) return ue_context_local_var; end: + if (gpsi_listList) { + OpenAPI_list_for_each(gpsi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(gpsi_listList); + gpsi_listList = NULL; + } + if (group_listList) { + OpenAPI_list_for_each(group_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(group_listList); + group_listList = NULL; + } + if (sub_ue_ambr_local_nonprim) { + OpenAPI_ambr_free(sub_ue_ambr_local_nonprim); + sub_ue_ambr_local_nonprim = NULL; + } + if (seaf_data_local_nonprim) { + OpenAPI_seaf_data_free(seaf_data_local_nonprim); + seaf_data_local_nonprim = NULL; + } + if (am_policy_req_trigger_listList) { + OpenAPI_list_free(am_policy_req_trigger_listList); + am_policy_req_trigger_listList = NULL; + } + if (ue_policy_req_trigger_listList) { + OpenAPI_list_free(ue_policy_req_trigger_listList); + ue_policy_req_trigger_listList = NULL; + } + if (restricted_rat_listList) { + OpenAPI_list_free(restricted_rat_listList); + restricted_rat_listList = NULL; + } + if (forbidden_area_listList) { + OpenAPI_list_for_each(forbidden_area_listList, node) { + OpenAPI_area_free(node->data); + } + OpenAPI_list_free(forbidden_area_listList); + forbidden_area_listList = NULL; + } + if (service_area_restriction_local_nonprim) { + OpenAPI_service_area_restriction_free(service_area_restriction_local_nonprim); + service_area_restriction_local_nonprim = NULL; + } + if (restricted_core_nw_type_listList) { + OpenAPI_list_free(restricted_core_nw_type_listList); + restricted_core_nw_type_listList = NULL; + } + if (event_subscription_listList) { + OpenAPI_list_for_each(event_subscription_listList, node) { + OpenAPI_ext_amf_event_subscription_free(node->data); + } + OpenAPI_list_free(event_subscription_listList); + event_subscription_listList = NULL; + } + if (mm_context_listList) { + OpenAPI_list_for_each(mm_context_listList, node) { + OpenAPI_mm_context_free(node->data); + } + OpenAPI_list_free(mm_context_listList); + mm_context_listList = NULL; + } + if (session_context_listList) { + OpenAPI_list_for_each(session_context_listList, node) { + OpenAPI_pdu_session_context_free(node->data); + } + OpenAPI_list_free(session_context_listList); + session_context_listList = NULL; + } + if (trace_data_local_nonprim) { + OpenAPI_trace_data_free(trace_data_local_nonprim); + trace_data_local_nonprim = NULL; + } + if (supported_codec_listList) { + OpenAPI_list_for_each(supported_codec_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(supported_codec_listList); + supported_codec_listList = NULL; + } + if (small_data_rate_status_infosList) { + OpenAPI_list_for_each(small_data_rate_status_infosList, node) { + OpenAPI_small_data_rate_status_info_free(node->data); + } + OpenAPI_list_free(small_data_rate_status_infosList); + small_data_rate_status_infosList = NULL; + } + if (restricted_primary_rat_listList) { + OpenAPI_list_free(restricted_primary_rat_listList); + restricted_primary_rat_listList = NULL; + } + if (restricted_secondary_rat_listList) { + OpenAPI_list_free(restricted_secondary_rat_listList); + restricted_secondary_rat_listList = NULL; + } + if (v2x_context_local_nonprim) { + OpenAPI_v2x_context_free(v2x_context_local_nonprim); + v2x_context_local_nonprim = NULL; + } + if (mo_exp_data_counter_local_nonprim) { + OpenAPI_mo_exp_data_counter_free(mo_exp_data_counter_local_nonprim); + mo_exp_data_counter_local_nonprim = NULL; + } + if (cag_data_local_nonprim) { + OpenAPI_cag_data_free(cag_data_local_nonprim); + cag_data_local_nonprim = NULL; + } + if (immediate_mdt_conf_local_nonprim) { + OpenAPI_immediate_mdt_conf_free(immediate_mdt_conf_local_nonprim); + immediate_mdt_conf_local_nonprim = NULL; + } + if (ec_restriction_data_wb_local_nonprim) { + OpenAPI_ec_restriction_data_wb_free(ec_restriction_data_wb_local_nonprim); + ec_restriction_data_wb_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context.h b/lib/sbi/openapi/model/ue_context.h index 1b47ab4cb..53429ab27 100644 --- a/lib/sbi/openapi/model/ue_context.h +++ b/lib/sbi/openapi/model/ue_context.h @@ -47,7 +47,7 @@ typedef struct OpenAPI_ue_context_s { char *pcf_group_id; char *routing_indicator; OpenAPI_list_t *group_list; - char drx_parameter; + char *drx_parameter; bool is_sub_rfsp; int sub_rfsp; bool is_used_rfsp; @@ -55,7 +55,7 @@ typedef struct OpenAPI_ue_context_s { struct OpenAPI_ambr_s *sub_ue_ambr; char *smsf_id; struct OpenAPI_seaf_data_s *seaf_data; - char _5g_mm_capability; + char *_5g_mm_capability; char *pcf_id; char *pcf_set_id; char *pcf_amp_service_set_id; @@ -78,7 +78,7 @@ typedef struct OpenAPI_ue_context_s { char *service_gap_expiry_time; char *stn_sr; char *c_msisdn; - char ms_classmark2; + char *ms_classmark2; OpenAPI_list_t *supported_codec_list; OpenAPI_list_t *small_data_rate_status_infos; OpenAPI_list_t *restricted_primary_rat_list; @@ -109,7 +109,7 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_create( char *pcf_group_id, char *routing_indicator, OpenAPI_list_t *group_list, - char drx_parameter, + char *drx_parameter, bool is_sub_rfsp, int sub_rfsp, bool is_used_rfsp, @@ -117,7 +117,7 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_create( OpenAPI_ambr_t *sub_ue_ambr, char *smsf_id, OpenAPI_seaf_data_t *seaf_data, - char _5g_mm_capability, + char *_5g_mm_capability, char *pcf_id, char *pcf_set_id, char *pcf_amp_service_set_id, @@ -140,7 +140,7 @@ OpenAPI_ue_context_t *OpenAPI_ue_context_create( char *service_gap_expiry_time, char *stn_sr, char *c_msisdn, - char ms_classmark2, + char *ms_classmark2, OpenAPI_list_t *supported_codec_list, OpenAPI_list_t *small_data_rate_status_infos, OpenAPI_list_t *restricted_primary_rat_list, diff --git a/lib/sbi/openapi/model/ue_context_cancel_relocate_data.c b/lib/sbi/openapi/model/ue_context_cancel_relocate_data.c index e1f560bd5..6016e28b5 100644 --- a/lib/sbi/openapi/model/ue_context_cancel_relocate_data.c +++ b/lib/sbi/openapi/model/ue_context_cancel_relocate_data.c @@ -20,18 +20,26 @@ OpenAPI_ue_context_cancel_relocate_data_t *OpenAPI_ue_context_cancel_relocate_da void OpenAPI_ue_context_cancel_relocate_data_free(OpenAPI_ue_context_cancel_relocate_data_t *ue_context_cancel_relocate_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_cancel_relocate_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_context_cancel_relocate_data->supi); - OpenAPI_ref_to_binary_data_free(ue_context_cancel_relocate_data->relocation_cancel_request); + if (ue_context_cancel_relocate_data->supi) { + ogs_free(ue_context_cancel_relocate_data->supi); + ue_context_cancel_relocate_data->supi = NULL; + } + if (ue_context_cancel_relocate_data->relocation_cancel_request) { + OpenAPI_ref_to_binary_data_free(ue_context_cancel_relocate_data->relocation_cancel_request); + ue_context_cancel_relocate_data->relocation_cancel_request = NULL; + } ogs_free(ue_context_cancel_relocate_data); } cJSON *OpenAPI_ue_context_cancel_relocate_data_convertToJSON(OpenAPI_ue_context_cancel_relocate_data_t *ue_context_cancel_relocate_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_cancel_relocate_data == NULL) { ogs_error("OpenAPI_ue_context_cancel_relocate_data_convertToJSON() failed [UeContextCancelRelocateData]"); @@ -46,6 +54,10 @@ cJSON *OpenAPI_ue_context_cancel_relocate_data_convertToJSON(OpenAPI_ue_context_ } } + if (!ue_context_cancel_relocate_data->relocation_cancel_request) { + ogs_error("OpenAPI_ue_context_cancel_relocate_data_convertToJSON() failed [relocation_cancel_request]"); + return NULL; + } cJSON *relocation_cancel_request_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(ue_context_cancel_relocate_data->relocation_cancel_request); if (relocation_cancel_request_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_cancel_relocate_data_convertToJSON() failed [relocation_cancel_request]"); @@ -64,31 +76,36 @@ end: OpenAPI_ue_context_cancel_relocate_data_t *OpenAPI_ue_context_cancel_relocate_data_parseFromJSON(cJSON *ue_context_cancel_relocate_dataJSON) { OpenAPI_ue_context_cancel_relocate_data_t *ue_context_cancel_relocate_data_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(ue_context_cancel_relocate_dataJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *relocation_cancel_request = NULL; + OpenAPI_ref_to_binary_data_t *relocation_cancel_request_local_nonprim = NULL; + supi = cJSON_GetObjectItemCaseSensitive(ue_context_cancel_relocate_dataJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_ue_context_cancel_relocate_data_parseFromJSON() failed [supi]"); goto end; } } - cJSON *relocation_cancel_request = cJSON_GetObjectItemCaseSensitive(ue_context_cancel_relocate_dataJSON, "relocationCancelRequest"); + relocation_cancel_request = cJSON_GetObjectItemCaseSensitive(ue_context_cancel_relocate_dataJSON, "relocationCancelRequest"); if (!relocation_cancel_request) { ogs_error("OpenAPI_ue_context_cancel_relocate_data_parseFromJSON() failed [relocation_cancel_request]"); goto end; } - - OpenAPI_ref_to_binary_data_t *relocation_cancel_request_local_nonprim = NULL; relocation_cancel_request_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(relocation_cancel_request); ue_context_cancel_relocate_data_local_var = OpenAPI_ue_context_cancel_relocate_data_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, relocation_cancel_request_local_nonprim ); return ue_context_cancel_relocate_data_local_var; end: + if (relocation_cancel_request_local_nonprim) { + OpenAPI_ref_to_binary_data_free(relocation_cancel_request_local_nonprim); + relocation_cancel_request_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_create_data.c b/lib/sbi/openapi/model/ue_context_create_data.c index aa43f7fcf..a4593171c 100644 --- a/lib/sbi/openapi/model/ue_context_create_data.c +++ b/lib/sbi/openapi/model/ue_context_create_data.c @@ -34,28 +34,57 @@ OpenAPI_ue_context_create_data_t *OpenAPI_ue_context_create_data_create( void OpenAPI_ue_context_create_data_free(OpenAPI_ue_context_create_data_t *ue_context_create_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_create_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_free(ue_context_create_data->ue_context); - OpenAPI_ng_ran_target_id_free(ue_context_create_data->target_id); - OpenAPI_n2_info_content_free(ue_context_create_data->source_to_target_data); - OpenAPI_list_for_each(ue_context_create_data->pdu_session_list, node) { - OpenAPI_n2_sm_information_free(node->data); + if (ue_context_create_data->ue_context) { + OpenAPI_ue_context_free(ue_context_create_data->ue_context); + ue_context_create_data->ue_context = NULL; + } + if (ue_context_create_data->target_id) { + OpenAPI_ng_ran_target_id_free(ue_context_create_data->target_id); + ue_context_create_data->target_id = NULL; + } + if (ue_context_create_data->source_to_target_data) { + OpenAPI_n2_info_content_free(ue_context_create_data->source_to_target_data); + ue_context_create_data->source_to_target_data = NULL; + } + if (ue_context_create_data->pdu_session_list) { + OpenAPI_list_for_each(ue_context_create_data->pdu_session_list, node) { + OpenAPI_n2_sm_information_free(node->data); + } + OpenAPI_list_free(ue_context_create_data->pdu_session_list); + ue_context_create_data->pdu_session_list = NULL; + } + if (ue_context_create_data->n2_notify_uri) { + ogs_free(ue_context_create_data->n2_notify_uri); + ue_context_create_data->n2_notify_uri = NULL; + } + if (ue_context_create_data->ue_radio_capability) { + OpenAPI_n2_info_content_free(ue_context_create_data->ue_radio_capability); + ue_context_create_data->ue_radio_capability = NULL; + } + if (ue_context_create_data->ngap_cause) { + OpenAPI_ng_ap_cause_free(ue_context_create_data->ngap_cause); + ue_context_create_data->ngap_cause = NULL; + } + if (ue_context_create_data->supported_features) { + ogs_free(ue_context_create_data->supported_features); + ue_context_create_data->supported_features = NULL; + } + if (ue_context_create_data->serving_network) { + OpenAPI_plmn_id_nid_free(ue_context_create_data->serving_network); + ue_context_create_data->serving_network = NULL; } - OpenAPI_list_free(ue_context_create_data->pdu_session_list); - ogs_free(ue_context_create_data->n2_notify_uri); - OpenAPI_n2_info_content_free(ue_context_create_data->ue_radio_capability); - OpenAPI_ng_ap_cause_free(ue_context_create_data->ngap_cause); - ogs_free(ue_context_create_data->supported_features); - OpenAPI_plmn_id_nid_free(ue_context_create_data->serving_network); ogs_free(ue_context_create_data); } cJSON *OpenAPI_ue_context_create_data_convertToJSON(OpenAPI_ue_context_create_data_t *ue_context_create_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_create_data == NULL) { ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [UeContextCreateData]"); @@ -63,6 +92,10 @@ cJSON *OpenAPI_ue_context_create_data_convertToJSON(OpenAPI_ue_context_create_da } item = cJSON_CreateObject(); + if (!ue_context_create_data->ue_context) { + ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [ue_context]"); + return NULL; + } cJSON *ue_context_local_JSON = OpenAPI_ue_context_convertToJSON(ue_context_create_data->ue_context); if (ue_context_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [ue_context]"); @@ -74,6 +107,10 @@ cJSON *OpenAPI_ue_context_create_data_convertToJSON(OpenAPI_ue_context_create_da goto end; } + if (!ue_context_create_data->target_id) { + ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [target_id]"); + return NULL; + } cJSON *target_id_local_JSON = OpenAPI_ng_ran_target_id_convertToJSON(ue_context_create_data->target_id); if (target_id_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [target_id]"); @@ -85,6 +122,10 @@ cJSON *OpenAPI_ue_context_create_data_convertToJSON(OpenAPI_ue_context_create_da goto end; } + if (!ue_context_create_data->source_to_target_data) { + ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [source_to_target_data]"); + return NULL; + } cJSON *source_to_target_data_local_JSON = OpenAPI_n2_info_content_convertToJSON(ue_context_create_data->source_to_target_data); if (source_to_target_data_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [source_to_target_data]"); @@ -96,22 +137,22 @@ cJSON *OpenAPI_ue_context_create_data_convertToJSON(OpenAPI_ue_context_create_da goto end; } + if (!ue_context_create_data->pdu_session_list) { + ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [pdu_session_list]"); + return NULL; + } cJSON *pdu_session_listList = cJSON_AddArrayToObject(item, "pduSessionList"); if (pdu_session_listList == NULL) { ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [pdu_session_list]"); goto end; } - - OpenAPI_lnode_t *pdu_session_list_node; - if (ue_context_create_data->pdu_session_list) { - OpenAPI_list_for_each(ue_context_create_data->pdu_session_list, pdu_session_list_node) { - cJSON *itemLocal = OpenAPI_n2_sm_information_convertToJSON(pdu_session_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [pdu_session_list]"); - goto end; - } - cJSON_AddItemToArray(pdu_session_listList, itemLocal); + OpenAPI_list_for_each(ue_context_create_data->pdu_session_list, node) { + cJSON *itemLocal = OpenAPI_n2_sm_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_create_data_convertToJSON() failed [pdu_session_list]"); + goto end; } + cJSON_AddItemToArray(pdu_session_listList, itemLocal); } if (ue_context_create_data->n2_notify_uri) { @@ -174,99 +215,98 @@ end: OpenAPI_ue_context_create_data_t *OpenAPI_ue_context_create_data_parseFromJSON(cJSON *ue_context_create_dataJSON) { OpenAPI_ue_context_create_data_t *ue_context_create_data_local_var = NULL; - cJSON *ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "ueContext"); + OpenAPI_lnode_t *node = NULL; + cJSON *ue_context = NULL; + OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; + cJSON *target_id = NULL; + OpenAPI_ng_ran_target_id_t *target_id_local_nonprim = NULL; + cJSON *source_to_target_data = NULL; + OpenAPI_n2_info_content_t *source_to_target_data_local_nonprim = NULL; + cJSON *pdu_session_list = NULL; + OpenAPI_list_t *pdu_session_listList = NULL; + cJSON *n2_notify_uri = NULL; + cJSON *ue_radio_capability = NULL; + OpenAPI_n2_info_content_t *ue_radio_capability_local_nonprim = NULL; + cJSON *ngap_cause = NULL; + OpenAPI_ng_ap_cause_t *ngap_cause_local_nonprim = NULL; + cJSON *supported_features = NULL; + cJSON *serving_network = NULL; + OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "ueContext"); if (!ue_context) { ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [ue_context]"); goto end; } - - OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; ue_context_local_nonprim = OpenAPI_ue_context_parseFromJSON(ue_context); - cJSON *target_id = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "targetId"); + target_id = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "targetId"); if (!target_id) { ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [target_id]"); goto end; } - - OpenAPI_ng_ran_target_id_t *target_id_local_nonprim = NULL; target_id_local_nonprim = OpenAPI_ng_ran_target_id_parseFromJSON(target_id); - cJSON *source_to_target_data = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "sourceToTargetData"); + source_to_target_data = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "sourceToTargetData"); if (!source_to_target_data) { ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [source_to_target_data]"); goto end; } - - OpenAPI_n2_info_content_t *source_to_target_data_local_nonprim = NULL; source_to_target_data_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(source_to_target_data); - cJSON *pdu_session_list = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "pduSessionList"); + pdu_session_list = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "pduSessionList"); if (!pdu_session_list) { ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [pdu_session_list]"); goto end; } - - OpenAPI_list_t *pdu_session_listList; - cJSON *pdu_session_list_local_nonprimitive; - if (!cJSON_IsArray(pdu_session_list)){ - ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [pdu_session_list]"); - goto end; - } - - pdu_session_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_session_list_local_nonprimitive, pdu_session_list ) { - if (!cJSON_IsObject(pdu_session_list_local_nonprimitive)) { + cJSON *pdu_session_list_local = NULL; + if (!cJSON_IsArray(pdu_session_list)) { ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [pdu_session_list]"); goto end; } - OpenAPI_n2_sm_information_t *pdu_session_listItem = OpenAPI_n2_sm_information_parseFromJSON(pdu_session_list_local_nonprimitive); - if (!pdu_session_listItem) { - ogs_error("No pdu_session_listItem"); - OpenAPI_list_free(pdu_session_listList); - goto end; + pdu_session_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_list_local, pdu_session_list) { + if (!cJSON_IsObject(pdu_session_list_local)) { + ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [pdu_session_list]"); + goto end; + } + OpenAPI_n2_sm_information_t *pdu_session_listItem = OpenAPI_n2_sm_information_parseFromJSON(pdu_session_list_local); + if (!pdu_session_listItem) { + ogs_error("No pdu_session_listItem"); + OpenAPI_list_free(pdu_session_listList); + goto end; + } + OpenAPI_list_add(pdu_session_listList, pdu_session_listItem); } - OpenAPI_list_add(pdu_session_listList, pdu_session_listItem); - } - - cJSON *n2_notify_uri = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "n2NotifyUri"); - + n2_notify_uri = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "n2NotifyUri"); if (n2_notify_uri) { - if (!cJSON_IsString(n2_notify_uri)) { + if (!cJSON_IsString(n2_notify_uri) && !cJSON_IsNull(n2_notify_uri)) { ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [n2_notify_uri]"); goto end; } } - cJSON *ue_radio_capability = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "ueRadioCapability"); - - OpenAPI_n2_info_content_t *ue_radio_capability_local_nonprim = NULL; + ue_radio_capability = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "ueRadioCapability"); if (ue_radio_capability) { ue_radio_capability_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(ue_radio_capability); } - cJSON *ngap_cause = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "ngapCause"); - - OpenAPI_ng_ap_cause_t *ngap_cause_local_nonprim = NULL; + ngap_cause = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "ngapCause"); if (ngap_cause) { ngap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ngap_cause); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ue_context_create_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "servingNetwork"); - - OpenAPI_plmn_id_nid_t *serving_network_local_nonprim = NULL; + serving_network = cJSON_GetObjectItemCaseSensitive(ue_context_create_dataJSON, "servingNetwork"); if (serving_network) { serving_network_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(serving_network); } @@ -276,15 +316,46 @@ OpenAPI_ue_context_create_data_t *OpenAPI_ue_context_create_data_parseFromJSON(c target_id_local_nonprim, source_to_target_data_local_nonprim, pdu_session_listList, - n2_notify_uri ? ogs_strdup(n2_notify_uri->valuestring) : NULL, + n2_notify_uri && !cJSON_IsNull(n2_notify_uri) ? ogs_strdup(n2_notify_uri->valuestring) : NULL, ue_radio_capability ? ue_radio_capability_local_nonprim : NULL, ngap_cause ? ngap_cause_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, serving_network ? serving_network_local_nonprim : NULL ); return ue_context_create_data_local_var; end: + if (ue_context_local_nonprim) { + OpenAPI_ue_context_free(ue_context_local_nonprim); + ue_context_local_nonprim = NULL; + } + if (target_id_local_nonprim) { + OpenAPI_ng_ran_target_id_free(target_id_local_nonprim); + target_id_local_nonprim = NULL; + } + if (source_to_target_data_local_nonprim) { + OpenAPI_n2_info_content_free(source_to_target_data_local_nonprim); + source_to_target_data_local_nonprim = NULL; + } + if (pdu_session_listList) { + OpenAPI_list_for_each(pdu_session_listList, node) { + OpenAPI_n2_sm_information_free(node->data); + } + OpenAPI_list_free(pdu_session_listList); + pdu_session_listList = NULL; + } + if (ue_radio_capability_local_nonprim) { + OpenAPI_n2_info_content_free(ue_radio_capability_local_nonprim); + ue_radio_capability_local_nonprim = NULL; + } + if (ngap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ngap_cause_local_nonprim); + ngap_cause_local_nonprim = NULL; + } + if (serving_network_local_nonprim) { + OpenAPI_plmn_id_nid_free(serving_network_local_nonprim); + serving_network_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_create_error.c b/lib/sbi/openapi/model/ue_context_create_error.c index 7ba9a0113..dd877f870 100644 --- a/lib/sbi/openapi/model/ue_context_create_error.c +++ b/lib/sbi/openapi/model/ue_context_create_error.c @@ -22,19 +22,30 @@ OpenAPI_ue_context_create_error_t *OpenAPI_ue_context_create_error_create( void OpenAPI_ue_context_create_error_free(OpenAPI_ue_context_create_error_t *ue_context_create_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_create_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_problem_details_free(ue_context_create_error->error); - OpenAPI_ng_ap_cause_free(ue_context_create_error->ngap_cause); - OpenAPI_n2_info_content_free(ue_context_create_error->target_to_source_failure_data); + if (ue_context_create_error->error) { + OpenAPI_problem_details_free(ue_context_create_error->error); + ue_context_create_error->error = NULL; + } + if (ue_context_create_error->ngap_cause) { + OpenAPI_ng_ap_cause_free(ue_context_create_error->ngap_cause); + ue_context_create_error->ngap_cause = NULL; + } + if (ue_context_create_error->target_to_source_failure_data) { + OpenAPI_n2_info_content_free(ue_context_create_error->target_to_source_failure_data); + ue_context_create_error->target_to_source_failure_data = NULL; + } ogs_free(ue_context_create_error); } cJSON *OpenAPI_ue_context_create_error_convertToJSON(OpenAPI_ue_context_create_error_t *ue_context_create_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_create_error == NULL) { ogs_error("OpenAPI_ue_context_create_error_convertToJSON() failed [UeContextCreateError]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_ue_context_create_error_convertToJSON(OpenAPI_ue_context_create_e } item = cJSON_CreateObject(); + if (!ue_context_create_error->error) { + ogs_error("OpenAPI_ue_context_create_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(ue_context_create_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_create_error_convertToJSON() failed [error]"); @@ -86,25 +101,26 @@ end: OpenAPI_ue_context_create_error_t *OpenAPI_ue_context_create_error_parseFromJSON(cJSON *ue_context_create_errorJSON) { OpenAPI_ue_context_create_error_t *ue_context_create_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(ue_context_create_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_problem_details_t *error_local_nonprim = NULL; + cJSON *ngap_cause = NULL; + OpenAPI_ng_ap_cause_t *ngap_cause_local_nonprim = NULL; + cJSON *target_to_source_failure_data = NULL; + OpenAPI_n2_info_content_t *target_to_source_failure_data_local_nonprim = NULL; + error = cJSON_GetObjectItemCaseSensitive(ue_context_create_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_ue_context_create_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error); - cJSON *ngap_cause = cJSON_GetObjectItemCaseSensitive(ue_context_create_errorJSON, "ngapCause"); - - OpenAPI_ng_ap_cause_t *ngap_cause_local_nonprim = NULL; + ngap_cause = cJSON_GetObjectItemCaseSensitive(ue_context_create_errorJSON, "ngapCause"); if (ngap_cause) { ngap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ngap_cause); } - cJSON *target_to_source_failure_data = cJSON_GetObjectItemCaseSensitive(ue_context_create_errorJSON, "targetToSourceFailureData"); - - OpenAPI_n2_info_content_t *target_to_source_failure_data_local_nonprim = NULL; + target_to_source_failure_data = cJSON_GetObjectItemCaseSensitive(ue_context_create_errorJSON, "targetToSourceFailureData"); if (target_to_source_failure_data) { target_to_source_failure_data_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(target_to_source_failure_data); } @@ -117,6 +133,18 @@ OpenAPI_ue_context_create_error_t *OpenAPI_ue_context_create_error_parseFromJSON return ue_context_create_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (ngap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ngap_cause_local_nonprim); + ngap_cause_local_nonprim = NULL; + } + if (target_to_source_failure_data_local_nonprim) { + OpenAPI_n2_info_content_free(target_to_source_failure_data_local_nonprim); + target_to_source_failure_data_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_created_data.c b/lib/sbi/openapi/model/ue_context_created_data.c index f98f12c02..97ba37a58 100644 --- a/lib/sbi/openapi/model/ue_context_created_data.c +++ b/lib/sbi/openapi/model/ue_context_created_data.c @@ -30,27 +30,44 @@ OpenAPI_ue_context_created_data_t *OpenAPI_ue_context_created_data_create( void OpenAPI_ue_context_created_data_free(OpenAPI_ue_context_created_data_t *ue_context_created_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_created_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_free(ue_context_created_data->ue_context); - OpenAPI_n2_info_content_free(ue_context_created_data->target_to_source_data); - OpenAPI_list_for_each(ue_context_created_data->pdu_session_list, node) { - OpenAPI_n2_sm_information_free(node->data); + if (ue_context_created_data->ue_context) { + OpenAPI_ue_context_free(ue_context_created_data->ue_context); + ue_context_created_data->ue_context = NULL; } - OpenAPI_list_free(ue_context_created_data->pdu_session_list); - OpenAPI_list_for_each(ue_context_created_data->failed_session_list, node) { - OpenAPI_n2_sm_information_free(node->data); + if (ue_context_created_data->target_to_source_data) { + OpenAPI_n2_info_content_free(ue_context_created_data->target_to_source_data); + ue_context_created_data->target_to_source_data = NULL; + } + if (ue_context_created_data->pdu_session_list) { + OpenAPI_list_for_each(ue_context_created_data->pdu_session_list, node) { + OpenAPI_n2_sm_information_free(node->data); + } + OpenAPI_list_free(ue_context_created_data->pdu_session_list); + ue_context_created_data->pdu_session_list = NULL; + } + if (ue_context_created_data->failed_session_list) { + OpenAPI_list_for_each(ue_context_created_data->failed_session_list, node) { + OpenAPI_n2_sm_information_free(node->data); + } + OpenAPI_list_free(ue_context_created_data->failed_session_list); + ue_context_created_data->failed_session_list = NULL; + } + if (ue_context_created_data->supported_features) { + ogs_free(ue_context_created_data->supported_features); + ue_context_created_data->supported_features = NULL; } - OpenAPI_list_free(ue_context_created_data->failed_session_list); - ogs_free(ue_context_created_data->supported_features); ogs_free(ue_context_created_data); } cJSON *OpenAPI_ue_context_created_data_convertToJSON(OpenAPI_ue_context_created_data_t *ue_context_created_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_created_data == NULL) { ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [UeContextCreatedData]"); @@ -58,6 +75,10 @@ cJSON *OpenAPI_ue_context_created_data_convertToJSON(OpenAPI_ue_context_created_ } item = cJSON_CreateObject(); + if (!ue_context_created_data->ue_context) { + ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [ue_context]"); + return NULL; + } cJSON *ue_context_local_JSON = OpenAPI_ue_context_convertToJSON(ue_context_created_data->ue_context); if (ue_context_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [ue_context]"); @@ -69,6 +90,10 @@ cJSON *OpenAPI_ue_context_created_data_convertToJSON(OpenAPI_ue_context_created_ goto end; } + if (!ue_context_created_data->target_to_source_data) { + ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [target_to_source_data]"); + return NULL; + } cJSON *target_to_source_data_local_JSON = OpenAPI_n2_info_content_convertToJSON(ue_context_created_data->target_to_source_data); if (target_to_source_data_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [target_to_source_data]"); @@ -80,22 +105,22 @@ cJSON *OpenAPI_ue_context_created_data_convertToJSON(OpenAPI_ue_context_created_ goto end; } + if (!ue_context_created_data->pdu_session_list) { + ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [pdu_session_list]"); + return NULL; + } cJSON *pdu_session_listList = cJSON_AddArrayToObject(item, "pduSessionList"); if (pdu_session_listList == NULL) { ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [pdu_session_list]"); goto end; } - - OpenAPI_lnode_t *pdu_session_list_node; - if (ue_context_created_data->pdu_session_list) { - OpenAPI_list_for_each(ue_context_created_data->pdu_session_list, pdu_session_list_node) { - cJSON *itemLocal = OpenAPI_n2_sm_information_convertToJSON(pdu_session_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [pdu_session_list]"); - goto end; - } - cJSON_AddItemToArray(pdu_session_listList, itemLocal); + OpenAPI_list_for_each(ue_context_created_data->pdu_session_list, node) { + cJSON *itemLocal = OpenAPI_n2_sm_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [pdu_session_list]"); + goto end; } + cJSON_AddItemToArray(pdu_session_listList, itemLocal); } if (ue_context_created_data->failed_session_list) { @@ -104,17 +129,13 @@ cJSON *OpenAPI_ue_context_created_data_convertToJSON(OpenAPI_ue_context_created_ ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [failed_session_list]"); goto end; } - - OpenAPI_lnode_t *failed_session_list_node; - if (ue_context_created_data->failed_session_list) { - OpenAPI_list_for_each(ue_context_created_data->failed_session_list, failed_session_list_node) { - cJSON *itemLocal = OpenAPI_n2_sm_information_convertToJSON(failed_session_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [failed_session_list]"); - goto end; - } - cJSON_AddItemToArray(failed_session_listList, itemLocal); + OpenAPI_list_for_each(ue_context_created_data->failed_session_list, node) { + cJSON *itemLocal = OpenAPI_n2_sm_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_created_data_convertToJSON() failed [failed_session_list]"); + goto end; } + cJSON_AddItemToArray(failed_session_listList, itemLocal); } } @@ -139,95 +160,92 @@ end: OpenAPI_ue_context_created_data_t *OpenAPI_ue_context_created_data_parseFromJSON(cJSON *ue_context_created_dataJSON) { OpenAPI_ue_context_created_data_t *ue_context_created_data_local_var = NULL; - cJSON *ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "ueContext"); + OpenAPI_lnode_t *node = NULL; + cJSON *ue_context = NULL; + OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; + cJSON *target_to_source_data = NULL; + OpenAPI_n2_info_content_t *target_to_source_data_local_nonprim = NULL; + cJSON *pdu_session_list = NULL; + OpenAPI_list_t *pdu_session_listList = NULL; + cJSON *failed_session_list = NULL; + OpenAPI_list_t *failed_session_listList = NULL; + cJSON *supported_features = NULL; + cJSON *pcf_reselected_ind = NULL; + ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "ueContext"); if (!ue_context) { ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [ue_context]"); goto end; } - - OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; ue_context_local_nonprim = OpenAPI_ue_context_parseFromJSON(ue_context); - cJSON *target_to_source_data = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "targetToSourceData"); + target_to_source_data = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "targetToSourceData"); if (!target_to_source_data) { ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [target_to_source_data]"); goto end; } - - OpenAPI_n2_info_content_t *target_to_source_data_local_nonprim = NULL; target_to_source_data_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(target_to_source_data); - cJSON *pdu_session_list = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "pduSessionList"); + pdu_session_list = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "pduSessionList"); if (!pdu_session_list) { ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [pdu_session_list]"); goto end; } - - OpenAPI_list_t *pdu_session_listList; - cJSON *pdu_session_list_local_nonprimitive; - if (!cJSON_IsArray(pdu_session_list)){ - ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [pdu_session_list]"); - goto end; - } - - pdu_session_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_session_list_local_nonprimitive, pdu_session_list ) { - if (!cJSON_IsObject(pdu_session_list_local_nonprimitive)) { + cJSON *pdu_session_list_local = NULL; + if (!cJSON_IsArray(pdu_session_list)) { ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [pdu_session_list]"); goto end; } - OpenAPI_n2_sm_information_t *pdu_session_listItem = OpenAPI_n2_sm_information_parseFromJSON(pdu_session_list_local_nonprimitive); - if (!pdu_session_listItem) { - ogs_error("No pdu_session_listItem"); - OpenAPI_list_free(pdu_session_listList); - goto end; + pdu_session_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_list_local, pdu_session_list) { + if (!cJSON_IsObject(pdu_session_list_local)) { + ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [pdu_session_list]"); + goto end; + } + OpenAPI_n2_sm_information_t *pdu_session_listItem = OpenAPI_n2_sm_information_parseFromJSON(pdu_session_list_local); + if (!pdu_session_listItem) { + ogs_error("No pdu_session_listItem"); + OpenAPI_list_free(pdu_session_listList); + goto end; + } + OpenAPI_list_add(pdu_session_listList, pdu_session_listItem); } - OpenAPI_list_add(pdu_session_listList, pdu_session_listItem); - } - - cJSON *failed_session_list = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "failedSessionList"); - - OpenAPI_list_t *failed_session_listList; + failed_session_list = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "failedSessionList"); if (failed_session_list) { - cJSON *failed_session_list_local_nonprimitive; - if (!cJSON_IsArray(failed_session_list)){ - ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [failed_session_list]"); - goto end; - } - - failed_session_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(failed_session_list_local_nonprimitive, failed_session_list ) { - if (!cJSON_IsObject(failed_session_list_local_nonprimitive)) { + cJSON *failed_session_list_local = NULL; + if (!cJSON_IsArray(failed_session_list)) { ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [failed_session_list]"); goto end; } - OpenAPI_n2_sm_information_t *failed_session_listItem = OpenAPI_n2_sm_information_parseFromJSON(failed_session_list_local_nonprimitive); - if (!failed_session_listItem) { - ogs_error("No failed_session_listItem"); - OpenAPI_list_free(failed_session_listList); - goto end; + failed_session_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(failed_session_list_local, failed_session_list) { + if (!cJSON_IsObject(failed_session_list_local)) { + ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [failed_session_list]"); + goto end; + } + OpenAPI_n2_sm_information_t *failed_session_listItem = OpenAPI_n2_sm_information_parseFromJSON(failed_session_list_local); + if (!failed_session_listItem) { + ogs_error("No failed_session_listItem"); + OpenAPI_list_free(failed_session_listList); + goto end; + } + OpenAPI_list_add(failed_session_listList, failed_session_listItem); } - - OpenAPI_list_add(failed_session_listList, failed_session_listItem); - } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *pcf_reselected_ind = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "pcfReselectedInd"); - + pcf_reselected_ind = cJSON_GetObjectItemCaseSensitive(ue_context_created_dataJSON, "pcfReselectedInd"); if (pcf_reselected_ind) { if (!cJSON_IsBool(pcf_reselected_ind)) { ogs_error("OpenAPI_ue_context_created_data_parseFromJSON() failed [pcf_reselected_ind]"); @@ -240,13 +258,35 @@ OpenAPI_ue_context_created_data_t *OpenAPI_ue_context_created_data_parseFromJSON target_to_source_data_local_nonprim, pdu_session_listList, failed_session_list ? failed_session_listList : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, pcf_reselected_ind ? true : false, pcf_reselected_ind ? pcf_reselected_ind->valueint : 0 ); return ue_context_created_data_local_var; end: + if (ue_context_local_nonprim) { + OpenAPI_ue_context_free(ue_context_local_nonprim); + ue_context_local_nonprim = NULL; + } + if (target_to_source_data_local_nonprim) { + OpenAPI_n2_info_content_free(target_to_source_data_local_nonprim); + target_to_source_data_local_nonprim = NULL; + } + if (pdu_session_listList) { + OpenAPI_list_for_each(pdu_session_listList, node) { + OpenAPI_n2_sm_information_free(node->data); + } + OpenAPI_list_free(pdu_session_listList); + pdu_session_listList = NULL; + } + if (failed_session_listList) { + OpenAPI_list_for_each(failed_session_listList, node) { + OpenAPI_n2_sm_information_free(node->data); + } + OpenAPI_list_free(failed_session_listList); + failed_session_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_in_amf_data.c b/lib/sbi/openapi/model/ue_context_in_amf_data.c index caf434aba..2ba91dc42 100644 --- a/lib/sbi/openapi/model/ue_context_in_amf_data.c +++ b/lib/sbi/openapi/model/ue_context_in_amf_data.c @@ -18,17 +18,22 @@ OpenAPI_ue_context_in_amf_data_t *OpenAPI_ue_context_in_amf_data_create( void OpenAPI_ue_context_in_amf_data_free(OpenAPI_ue_context_in_amf_data_t *ue_context_in_amf_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_in_amf_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_eps_interworking_info_free(ue_context_in_amf_data->eps_interworking_info); + if (ue_context_in_amf_data->eps_interworking_info) { + OpenAPI_eps_interworking_info_free(ue_context_in_amf_data->eps_interworking_info); + ue_context_in_amf_data->eps_interworking_info = NULL; + } ogs_free(ue_context_in_amf_data); } cJSON *OpenAPI_ue_context_in_amf_data_convertToJSON(OpenAPI_ue_context_in_amf_data_t *ue_context_in_amf_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_in_amf_data == NULL) { ogs_error("OpenAPI_ue_context_in_amf_data_convertToJSON() failed [UeContextInAmfData]"); @@ -56,9 +61,10 @@ end: OpenAPI_ue_context_in_amf_data_t *OpenAPI_ue_context_in_amf_data_parseFromJSON(cJSON *ue_context_in_amf_dataJSON) { OpenAPI_ue_context_in_amf_data_t *ue_context_in_amf_data_local_var = NULL; - cJSON *eps_interworking_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_amf_dataJSON, "epsInterworkingInfo"); - + OpenAPI_lnode_t *node = NULL; + cJSON *eps_interworking_info = NULL; OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL; + eps_interworking_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_amf_dataJSON, "epsInterworkingInfo"); if (eps_interworking_info) { eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info); } @@ -69,6 +75,10 @@ OpenAPI_ue_context_in_amf_data_t *OpenAPI_ue_context_in_amf_data_parseFromJSON(c return ue_context_in_amf_data_local_var; end: + if (eps_interworking_info_local_nonprim) { + OpenAPI_eps_interworking_info_free(eps_interworking_info_local_nonprim); + eps_interworking_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_in_amf_data_1.c b/lib/sbi/openapi/model/ue_context_in_amf_data_1.c index c5cb4f0d1..7813dbe47 100644 --- a/lib/sbi/openapi/model/ue_context_in_amf_data_1.c +++ b/lib/sbi/openapi/model/ue_context_in_amf_data_1.c @@ -18,17 +18,22 @@ OpenAPI_ue_context_in_amf_data_1_t *OpenAPI_ue_context_in_amf_data_1_create( void OpenAPI_ue_context_in_amf_data_1_free(OpenAPI_ue_context_in_amf_data_1_t *ue_context_in_amf_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_in_amf_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_eps_interworking_info_free(ue_context_in_amf_data_1->eps_interworking_info); + if (ue_context_in_amf_data_1->eps_interworking_info) { + OpenAPI_eps_interworking_info_free(ue_context_in_amf_data_1->eps_interworking_info); + ue_context_in_amf_data_1->eps_interworking_info = NULL; + } ogs_free(ue_context_in_amf_data_1); } cJSON *OpenAPI_ue_context_in_amf_data_1_convertToJSON(OpenAPI_ue_context_in_amf_data_1_t *ue_context_in_amf_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_in_amf_data_1 == NULL) { ogs_error("OpenAPI_ue_context_in_amf_data_1_convertToJSON() failed [UeContextInAmfData_1]"); @@ -56,9 +61,10 @@ end: OpenAPI_ue_context_in_amf_data_1_t *OpenAPI_ue_context_in_amf_data_1_parseFromJSON(cJSON *ue_context_in_amf_data_1JSON) { OpenAPI_ue_context_in_amf_data_1_t *ue_context_in_amf_data_1_local_var = NULL; - cJSON *eps_interworking_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_amf_data_1JSON, "epsInterworkingInfo"); - + OpenAPI_lnode_t *node = NULL; + cJSON *eps_interworking_info = NULL; OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL; + eps_interworking_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_amf_data_1JSON, "epsInterworkingInfo"); if (eps_interworking_info) { eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info); } @@ -69,6 +75,10 @@ OpenAPI_ue_context_in_amf_data_1_t *OpenAPI_ue_context_in_amf_data_1_parseFromJS return ue_context_in_amf_data_1_local_var; end: + if (eps_interworking_info_local_nonprim) { + OpenAPI_eps_interworking_info_free(eps_interworking_info_local_nonprim); + eps_interworking_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_in_smf_data.c b/lib/sbi/openapi/model/ue_context_in_smf_data.c index 03495f231..dc7bb6c4d 100644 --- a/lib/sbi/openapi/model/ue_context_in_smf_data.c +++ b/lib/sbi/openapi/model/ue_context_in_smf_data.c @@ -22,28 +22,39 @@ OpenAPI_ue_context_in_smf_data_t *OpenAPI_ue_context_in_smf_data_create( void OpenAPI_ue_context_in_smf_data_free(OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_in_smf_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ue_context_in_smf_data->pdu_sessions, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_pdu_session_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ue_context_in_smf_data->pdu_sessions) { + OpenAPI_list_for_each(ue_context_in_smf_data->pdu_sessions, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_pdu_session_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ue_context_in_smf_data->pdu_sessions); + ue_context_in_smf_data->pdu_sessions = NULL; } - OpenAPI_list_free(ue_context_in_smf_data->pdu_sessions); - OpenAPI_list_for_each(ue_context_in_smf_data->pgw_info, node) { - OpenAPI_pgw_info_free(node->data); + if (ue_context_in_smf_data->pgw_info) { + OpenAPI_list_for_each(ue_context_in_smf_data->pgw_info, node) { + OpenAPI_pgw_info_free(node->data); + } + OpenAPI_list_free(ue_context_in_smf_data->pgw_info); + ue_context_in_smf_data->pgw_info = NULL; + } + if (ue_context_in_smf_data->emergency_info) { + OpenAPI_emergency_info_free(ue_context_in_smf_data->emergency_info); + ue_context_in_smf_data->emergency_info = NULL; } - OpenAPI_list_free(ue_context_in_smf_data->pgw_info); - OpenAPI_emergency_info_free(ue_context_in_smf_data->emergency_info); ogs_free(ue_context_in_smf_data); } cJSON *OpenAPI_ue_context_in_smf_data_convertToJSON(OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_in_smf_data == NULL) { ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [UeContextInSmfData]"); @@ -58,21 +69,20 @@ cJSON *OpenAPI_ue_context_in_smf_data_convertToJSON(OpenAPI_ue_context_in_smf_da goto end; } cJSON *localMapObject = pdu_sessions; - OpenAPI_lnode_t *pdu_sessions_node; if (ue_context_in_smf_data->pdu_sessions) { - OpenAPI_list_for_each(ue_context_in_smf_data->pdu_sessions, pdu_sessions_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pdu_sessions_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_pdu_session_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ue_context_in_smf_data->pdu_sessions, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_pdu_session_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (ue_context_in_smf_data->pgw_info) { cJSON *pgw_infoList = cJSON_AddArrayToObject(item, "pgwInfo"); @@ -80,17 +90,13 @@ cJSON *OpenAPI_ue_context_in_smf_data_convertToJSON(OpenAPI_ue_context_in_smf_da ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [pgw_info]"); goto end; } - - OpenAPI_lnode_t *pgw_info_node; - if (ue_context_in_smf_data->pgw_info) { - OpenAPI_list_for_each(ue_context_in_smf_data->pgw_info, pgw_info_node) { - cJSON *itemLocal = OpenAPI_pgw_info_convertToJSON(pgw_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [pgw_info]"); - goto end; - } - cJSON_AddItemToArray(pgw_infoList, itemLocal); + OpenAPI_list_for_each(ue_context_in_smf_data->pgw_info, node) { + cJSON *itemLocal = OpenAPI_pgw_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_convertToJSON() failed [pgw_info]"); + goto end; } + cJSON_AddItemToArray(pgw_infoList, itemLocal); } } @@ -114,64 +120,65 @@ end: OpenAPI_ue_context_in_smf_data_t *OpenAPI_ue_context_in_smf_data_parseFromJSON(cJSON *ue_context_in_smf_dataJSON) { OpenAPI_ue_context_in_smf_data_t *ue_context_in_smf_data_local_var = NULL; - cJSON *pdu_sessions = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "pduSessions"); - - OpenAPI_list_t *pdu_sessionsList; + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_sessions = NULL; + OpenAPI_list_t *pdu_sessionsList = NULL; + cJSON *pgw_info = NULL; + OpenAPI_list_t *pgw_infoList = NULL; + cJSON *emergency_info = NULL; + OpenAPI_emergency_info_t *emergency_info_local_nonprim = NULL; + pdu_sessions = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "pduSessions"); if (pdu_sessions) { - cJSON *pdu_sessions_local_map; - if (!cJSON_IsObject(pdu_sessions)) { - ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pdu_sessions]"); - goto end; - } - pdu_sessionsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pdu_sessions_local_map, pdu_sessions) { - cJSON *localMapObject = pdu_sessions_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_pdu_session_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [inner]"); + cJSON *pdu_sessions_local_map = NULL; + if (!cJSON_IsObject(pdu_sessions) && !cJSON_IsNull(pdu_sessions)) { + ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pdu_sessions]"); goto end; } - OpenAPI_list_add(pdu_sessionsList, localMapKeyPair); - } + if (cJSON_IsObject(pdu_sessions)) { + pdu_sessionsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pdu_sessions_local_map, pdu_sessions) { + cJSON *localMapObject = pdu_sessions_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_pdu_session_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pdu_sessionsList, localMapKeyPair); + } + } } - cJSON *pgw_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "pgwInfo"); - - OpenAPI_list_t *pgw_infoList; + pgw_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "pgwInfo"); if (pgw_info) { - cJSON *pgw_info_local_nonprimitive; - if (!cJSON_IsArray(pgw_info)){ - ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pgw_info]"); - goto end; - } - - pgw_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pgw_info_local_nonprimitive, pgw_info ) { - if (!cJSON_IsObject(pgw_info_local_nonprimitive)) { + cJSON *pgw_info_local = NULL; + if (!cJSON_IsArray(pgw_info)) { ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pgw_info]"); goto end; } - OpenAPI_pgw_info_t *pgw_infoItem = OpenAPI_pgw_info_parseFromJSON(pgw_info_local_nonprimitive); - if (!pgw_infoItem) { - ogs_error("No pgw_infoItem"); - OpenAPI_list_free(pgw_infoList); - goto end; + pgw_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pgw_info_local, pgw_info) { + if (!cJSON_IsObject(pgw_info_local)) { + ogs_error("OpenAPI_ue_context_in_smf_data_parseFromJSON() failed [pgw_info]"); + goto end; + } + OpenAPI_pgw_info_t *pgw_infoItem = OpenAPI_pgw_info_parseFromJSON(pgw_info_local); + if (!pgw_infoItem) { + ogs_error("No pgw_infoItem"); + OpenAPI_list_free(pgw_infoList); + goto end; + } + OpenAPI_list_add(pgw_infoList, pgw_infoItem); } - - OpenAPI_list_add(pgw_infoList, pgw_infoItem); - } } - cJSON *emergency_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "emergencyInfo"); - - OpenAPI_emergency_info_t *emergency_info_local_nonprim = NULL; + emergency_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_dataJSON, "emergencyInfo"); if (emergency_info) { emergency_info_local_nonprim = OpenAPI_emergency_info_parseFromJSON(emergency_info); } @@ -184,6 +191,27 @@ OpenAPI_ue_context_in_smf_data_t *OpenAPI_ue_context_in_smf_data_parseFromJSON(c return ue_context_in_smf_data_local_var; end: + if (pdu_sessionsList) { + OpenAPI_list_for_each(pdu_sessionsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_pdu_session_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pdu_sessionsList); + pdu_sessionsList = NULL; + } + if (pgw_infoList) { + OpenAPI_list_for_each(pgw_infoList, node) { + OpenAPI_pgw_info_free(node->data); + } + OpenAPI_list_free(pgw_infoList); + pgw_infoList = NULL; + } + if (emergency_info_local_nonprim) { + OpenAPI_emergency_info_free(emergency_info_local_nonprim); + emergency_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_in_smf_data_1.c b/lib/sbi/openapi/model/ue_context_in_smf_data_1.c index 0b317405b..c7c77a2ff 100644 --- a/lib/sbi/openapi/model/ue_context_in_smf_data_1.c +++ b/lib/sbi/openapi/model/ue_context_in_smf_data_1.c @@ -22,28 +22,39 @@ OpenAPI_ue_context_in_smf_data_1_t *OpenAPI_ue_context_in_smf_data_1_create( void OpenAPI_ue_context_in_smf_data_1_free(OpenAPI_ue_context_in_smf_data_1_t *ue_context_in_smf_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_in_smf_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ue_context_in_smf_data_1->pdu_sessions, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_pdu_session_1_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ue_context_in_smf_data_1->pdu_sessions) { + OpenAPI_list_for_each(ue_context_in_smf_data_1->pdu_sessions, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_pdu_session_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ue_context_in_smf_data_1->pdu_sessions); + ue_context_in_smf_data_1->pdu_sessions = NULL; } - OpenAPI_list_free(ue_context_in_smf_data_1->pdu_sessions); - OpenAPI_list_for_each(ue_context_in_smf_data_1->pgw_info, node) { - OpenAPI_pgw_info_1_free(node->data); + if (ue_context_in_smf_data_1->pgw_info) { + OpenAPI_list_for_each(ue_context_in_smf_data_1->pgw_info, node) { + OpenAPI_pgw_info_1_free(node->data); + } + OpenAPI_list_free(ue_context_in_smf_data_1->pgw_info); + ue_context_in_smf_data_1->pgw_info = NULL; + } + if (ue_context_in_smf_data_1->emergency_info) { + OpenAPI_emergency_info_1_free(ue_context_in_smf_data_1->emergency_info); + ue_context_in_smf_data_1->emergency_info = NULL; } - OpenAPI_list_free(ue_context_in_smf_data_1->pgw_info); - OpenAPI_emergency_info_1_free(ue_context_in_smf_data_1->emergency_info); ogs_free(ue_context_in_smf_data_1); } cJSON *OpenAPI_ue_context_in_smf_data_1_convertToJSON(OpenAPI_ue_context_in_smf_data_1_t *ue_context_in_smf_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_in_smf_data_1 == NULL) { ogs_error("OpenAPI_ue_context_in_smf_data_1_convertToJSON() failed [UeContextInSmfData_1]"); @@ -58,21 +69,20 @@ cJSON *OpenAPI_ue_context_in_smf_data_1_convertToJSON(OpenAPI_ue_context_in_smf_ goto end; } cJSON *localMapObject = pdu_sessions; - OpenAPI_lnode_t *pdu_sessions_node; if (ue_context_in_smf_data_1->pdu_sessions) { - OpenAPI_list_for_each(ue_context_in_smf_data_1->pdu_sessions, pdu_sessions_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pdu_sessions_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_pdu_session_1_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_in_smf_data_1_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ue_context_in_smf_data_1->pdu_sessions, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_pdu_session_1_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_1_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (ue_context_in_smf_data_1->pgw_info) { cJSON *pgw_infoList = cJSON_AddArrayToObject(item, "pgwInfo"); @@ -80,17 +90,13 @@ cJSON *OpenAPI_ue_context_in_smf_data_1_convertToJSON(OpenAPI_ue_context_in_smf_ ogs_error("OpenAPI_ue_context_in_smf_data_1_convertToJSON() failed [pgw_info]"); goto end; } - - OpenAPI_lnode_t *pgw_info_node; - if (ue_context_in_smf_data_1->pgw_info) { - OpenAPI_list_for_each(ue_context_in_smf_data_1->pgw_info, pgw_info_node) { - cJSON *itemLocal = OpenAPI_pgw_info_1_convertToJSON(pgw_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_in_smf_data_1_convertToJSON() failed [pgw_info]"); - goto end; - } - cJSON_AddItemToArray(pgw_infoList, itemLocal); + OpenAPI_list_for_each(ue_context_in_smf_data_1->pgw_info, node) { + cJSON *itemLocal = OpenAPI_pgw_info_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_in_smf_data_1_convertToJSON() failed [pgw_info]"); + goto end; } + cJSON_AddItemToArray(pgw_infoList, itemLocal); } } @@ -114,64 +120,65 @@ end: OpenAPI_ue_context_in_smf_data_1_t *OpenAPI_ue_context_in_smf_data_1_parseFromJSON(cJSON *ue_context_in_smf_data_1JSON) { OpenAPI_ue_context_in_smf_data_1_t *ue_context_in_smf_data_1_local_var = NULL; - cJSON *pdu_sessions = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_data_1JSON, "pduSessions"); - - OpenAPI_list_t *pdu_sessionsList; + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_sessions = NULL; + OpenAPI_list_t *pdu_sessionsList = NULL; + cJSON *pgw_info = NULL; + OpenAPI_list_t *pgw_infoList = NULL; + cJSON *emergency_info = NULL; + OpenAPI_emergency_info_1_t *emergency_info_local_nonprim = NULL; + pdu_sessions = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_data_1JSON, "pduSessions"); if (pdu_sessions) { - cJSON *pdu_sessions_local_map; - if (!cJSON_IsObject(pdu_sessions)) { - ogs_error("OpenAPI_ue_context_in_smf_data_1_parseFromJSON() failed [pdu_sessions]"); - goto end; - } - pdu_sessionsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pdu_sessions_local_map, pdu_sessions) { - cJSON *localMapObject = pdu_sessions_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_pdu_session_1_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ue_context_in_smf_data_1_parseFromJSON() failed [inner]"); + cJSON *pdu_sessions_local_map = NULL; + if (!cJSON_IsObject(pdu_sessions) && !cJSON_IsNull(pdu_sessions)) { + ogs_error("OpenAPI_ue_context_in_smf_data_1_parseFromJSON() failed [pdu_sessions]"); goto end; } - OpenAPI_list_add(pdu_sessionsList, localMapKeyPair); - } + if (cJSON_IsObject(pdu_sessions)) { + pdu_sessionsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pdu_sessions_local_map, pdu_sessions) { + cJSON *localMapObject = pdu_sessions_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_pdu_session_1_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ue_context_in_smf_data_1_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pdu_sessionsList, localMapKeyPair); + } + } } - cJSON *pgw_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_data_1JSON, "pgwInfo"); - - OpenAPI_list_t *pgw_infoList; + pgw_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_data_1JSON, "pgwInfo"); if (pgw_info) { - cJSON *pgw_info_local_nonprimitive; - if (!cJSON_IsArray(pgw_info)){ - ogs_error("OpenAPI_ue_context_in_smf_data_1_parseFromJSON() failed [pgw_info]"); - goto end; - } - - pgw_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pgw_info_local_nonprimitive, pgw_info ) { - if (!cJSON_IsObject(pgw_info_local_nonprimitive)) { + cJSON *pgw_info_local = NULL; + if (!cJSON_IsArray(pgw_info)) { ogs_error("OpenAPI_ue_context_in_smf_data_1_parseFromJSON() failed [pgw_info]"); goto end; } - OpenAPI_pgw_info_1_t *pgw_infoItem = OpenAPI_pgw_info_1_parseFromJSON(pgw_info_local_nonprimitive); - if (!pgw_infoItem) { - ogs_error("No pgw_infoItem"); - OpenAPI_list_free(pgw_infoList); - goto end; + pgw_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pgw_info_local, pgw_info) { + if (!cJSON_IsObject(pgw_info_local)) { + ogs_error("OpenAPI_ue_context_in_smf_data_1_parseFromJSON() failed [pgw_info]"); + goto end; + } + OpenAPI_pgw_info_1_t *pgw_infoItem = OpenAPI_pgw_info_1_parseFromJSON(pgw_info_local); + if (!pgw_infoItem) { + ogs_error("No pgw_infoItem"); + OpenAPI_list_free(pgw_infoList); + goto end; + } + OpenAPI_list_add(pgw_infoList, pgw_infoItem); } - - OpenAPI_list_add(pgw_infoList, pgw_infoItem); - } } - cJSON *emergency_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_data_1JSON, "emergencyInfo"); - - OpenAPI_emergency_info_1_t *emergency_info_local_nonprim = NULL; + emergency_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_smf_data_1JSON, "emergencyInfo"); if (emergency_info) { emergency_info_local_nonprim = OpenAPI_emergency_info_1_parseFromJSON(emergency_info); } @@ -184,6 +191,27 @@ OpenAPI_ue_context_in_smf_data_1_t *OpenAPI_ue_context_in_smf_data_1_parseFromJS return ue_context_in_smf_data_1_local_var; end: + if (pdu_sessionsList) { + OpenAPI_list_for_each(pdu_sessionsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_pdu_session_1_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pdu_sessionsList); + pdu_sessionsList = NULL; + } + if (pgw_infoList) { + OpenAPI_list_for_each(pgw_infoList, node) { + OpenAPI_pgw_info_1_free(node->data); + } + OpenAPI_list_free(pgw_infoList); + pgw_infoList = NULL; + } + if (emergency_info_local_nonprim) { + OpenAPI_emergency_info_1_free(emergency_info_local_nonprim); + emergency_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_in_smsf_data.c b/lib/sbi/openapi/model/ue_context_in_smsf_data.c index 2224575ac..a39c44563 100644 --- a/lib/sbi/openapi/model/ue_context_in_smsf_data.c +++ b/lib/sbi/openapi/model/ue_context_in_smsf_data.c @@ -20,18 +20,26 @@ OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_create( void OpenAPI_ue_context_in_smsf_data_free(OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_in_smsf_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_smsf_info_free(ue_context_in_smsf_data->smsf_info3_gpp_access); - OpenAPI_smsf_info_free(ue_context_in_smsf_data->smsf_info_non3_gpp_access); + if (ue_context_in_smsf_data->smsf_info3_gpp_access) { + OpenAPI_smsf_info_free(ue_context_in_smsf_data->smsf_info3_gpp_access); + ue_context_in_smsf_data->smsf_info3_gpp_access = NULL; + } + if (ue_context_in_smsf_data->smsf_info_non3_gpp_access) { + OpenAPI_smsf_info_free(ue_context_in_smsf_data->smsf_info_non3_gpp_access); + ue_context_in_smsf_data->smsf_info_non3_gpp_access = NULL; + } ogs_free(ue_context_in_smsf_data); } cJSON *OpenAPI_ue_context_in_smsf_data_convertToJSON(OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_in_smsf_data == NULL) { ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [UeContextInSmsfData]"); @@ -72,16 +80,17 @@ end: OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_parseFromJSON(cJSON *ue_context_in_smsf_dataJSON) { OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data_local_var = NULL; - cJSON *smsf_info3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_dataJSON, "smsfInfo3GppAccess"); - + OpenAPI_lnode_t *node = NULL; + cJSON *smsf_info3_gpp_access = NULL; OpenAPI_smsf_info_t *smsf_info3_gpp_access_local_nonprim = NULL; + cJSON *smsf_info_non3_gpp_access = NULL; + OpenAPI_smsf_info_t *smsf_info_non3_gpp_access_local_nonprim = NULL; + smsf_info3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_dataJSON, "smsfInfo3GppAccess"); if (smsf_info3_gpp_access) { smsf_info3_gpp_access_local_nonprim = OpenAPI_smsf_info_parseFromJSON(smsf_info3_gpp_access); } - cJSON *smsf_info_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_dataJSON, "smsfInfoNon3GppAccess"); - - OpenAPI_smsf_info_t *smsf_info_non3_gpp_access_local_nonprim = NULL; + smsf_info_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_dataJSON, "smsfInfoNon3GppAccess"); if (smsf_info_non3_gpp_access) { smsf_info_non3_gpp_access_local_nonprim = OpenAPI_smsf_info_parseFromJSON(smsf_info_non3_gpp_access); } @@ -93,6 +102,14 @@ OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_parseFromJSON return ue_context_in_smsf_data_local_var; end: + if (smsf_info3_gpp_access_local_nonprim) { + OpenAPI_smsf_info_free(smsf_info3_gpp_access_local_nonprim); + smsf_info3_gpp_access_local_nonprim = NULL; + } + if (smsf_info_non3_gpp_access_local_nonprim) { + OpenAPI_smsf_info_free(smsf_info_non3_gpp_access_local_nonprim); + smsf_info_non3_gpp_access_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_in_smsf_data_1.c b/lib/sbi/openapi/model/ue_context_in_smsf_data_1.c index f89389147..08b18cfbd 100644 --- a/lib/sbi/openapi/model/ue_context_in_smsf_data_1.c +++ b/lib/sbi/openapi/model/ue_context_in_smsf_data_1.c @@ -20,18 +20,26 @@ OpenAPI_ue_context_in_smsf_data_1_t *OpenAPI_ue_context_in_smsf_data_1_create( void OpenAPI_ue_context_in_smsf_data_1_free(OpenAPI_ue_context_in_smsf_data_1_t *ue_context_in_smsf_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_in_smsf_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_smsf_info_1_free(ue_context_in_smsf_data_1->smsf_info3_gpp_access); - OpenAPI_smsf_info_1_free(ue_context_in_smsf_data_1->smsf_info_non3_gpp_access); + if (ue_context_in_smsf_data_1->smsf_info3_gpp_access) { + OpenAPI_smsf_info_1_free(ue_context_in_smsf_data_1->smsf_info3_gpp_access); + ue_context_in_smsf_data_1->smsf_info3_gpp_access = NULL; + } + if (ue_context_in_smsf_data_1->smsf_info_non3_gpp_access) { + OpenAPI_smsf_info_1_free(ue_context_in_smsf_data_1->smsf_info_non3_gpp_access); + ue_context_in_smsf_data_1->smsf_info_non3_gpp_access = NULL; + } ogs_free(ue_context_in_smsf_data_1); } cJSON *OpenAPI_ue_context_in_smsf_data_1_convertToJSON(OpenAPI_ue_context_in_smsf_data_1_t *ue_context_in_smsf_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_in_smsf_data_1 == NULL) { ogs_error("OpenAPI_ue_context_in_smsf_data_1_convertToJSON() failed [UeContextInSmsfData_1]"); @@ -72,16 +80,17 @@ end: OpenAPI_ue_context_in_smsf_data_1_t *OpenAPI_ue_context_in_smsf_data_1_parseFromJSON(cJSON *ue_context_in_smsf_data_1JSON) { OpenAPI_ue_context_in_smsf_data_1_t *ue_context_in_smsf_data_1_local_var = NULL; - cJSON *smsf_info3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_data_1JSON, "smsfInfo3GppAccess"); - + OpenAPI_lnode_t *node = NULL; + cJSON *smsf_info3_gpp_access = NULL; OpenAPI_smsf_info_1_t *smsf_info3_gpp_access_local_nonprim = NULL; + cJSON *smsf_info_non3_gpp_access = NULL; + OpenAPI_smsf_info_1_t *smsf_info_non3_gpp_access_local_nonprim = NULL; + smsf_info3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_data_1JSON, "smsfInfo3GppAccess"); if (smsf_info3_gpp_access) { smsf_info3_gpp_access_local_nonprim = OpenAPI_smsf_info_1_parseFromJSON(smsf_info3_gpp_access); } - cJSON *smsf_info_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_data_1JSON, "smsfInfoNon3GppAccess"); - - OpenAPI_smsf_info_1_t *smsf_info_non3_gpp_access_local_nonprim = NULL; + smsf_info_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_data_1JSON, "smsfInfoNon3GppAccess"); if (smsf_info_non3_gpp_access) { smsf_info_non3_gpp_access_local_nonprim = OpenAPI_smsf_info_1_parseFromJSON(smsf_info_non3_gpp_access); } @@ -93,6 +102,14 @@ OpenAPI_ue_context_in_smsf_data_1_t *OpenAPI_ue_context_in_smsf_data_1_parseFrom return ue_context_in_smsf_data_1_local_var; end: + if (smsf_info3_gpp_access_local_nonprim) { + OpenAPI_smsf_info_1_free(smsf_info3_gpp_access_local_nonprim); + smsf_info3_gpp_access_local_nonprim = NULL; + } + if (smsf_info_non3_gpp_access_local_nonprim) { + OpenAPI_smsf_info_1_free(smsf_info_non3_gpp_access_local_nonprim); + smsf_info_non3_gpp_access_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_release.c b/lib/sbi/openapi/model/ue_context_release.c index fdfb679f2..04a181dc1 100644 --- a/lib/sbi/openapi/model/ue_context_release.c +++ b/lib/sbi/openapi/model/ue_context_release.c @@ -24,18 +24,26 @@ OpenAPI_ue_context_release_t *OpenAPI_ue_context_release_create( void OpenAPI_ue_context_release_free(OpenAPI_ue_context_release_t *ue_context_release) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_release) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_context_release->supi); - OpenAPI_ng_ap_cause_free(ue_context_release->ngap_cause); + if (ue_context_release->supi) { + ogs_free(ue_context_release->supi); + ue_context_release->supi = NULL; + } + if (ue_context_release->ngap_cause) { + OpenAPI_ng_ap_cause_free(ue_context_release->ngap_cause); + ue_context_release->ngap_cause = NULL; + } ogs_free(ue_context_release); } cJSON *OpenAPI_ue_context_release_convertToJSON(OpenAPI_ue_context_release_t *ue_context_release) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_release == NULL) { ogs_error("OpenAPI_ue_context_release_convertToJSON() failed [UEContextRelease]"); @@ -57,6 +65,10 @@ cJSON *OpenAPI_ue_context_release_convertToJSON(OpenAPI_ue_context_release_t *ue } } + if (!ue_context_release->ngap_cause) { + ogs_error("OpenAPI_ue_context_release_convertToJSON() failed [ngap_cause]"); + return NULL; + } cJSON *ngap_cause_local_JSON = OpenAPI_ng_ap_cause_convertToJSON(ue_context_release->ngap_cause); if (ngap_cause_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_release_convertToJSON() failed [ngap_cause]"); @@ -75,17 +87,20 @@ end: OpenAPI_ue_context_release_t *OpenAPI_ue_context_release_parseFromJSON(cJSON *ue_context_releaseJSON) { OpenAPI_ue_context_release_t *ue_context_release_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(ue_context_releaseJSON, "supi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *unauthenticated_supi = NULL; + cJSON *ngap_cause = NULL; + OpenAPI_ng_ap_cause_t *ngap_cause_local_nonprim = NULL; + supi = cJSON_GetObjectItemCaseSensitive(ue_context_releaseJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_ue_context_release_parseFromJSON() failed [supi]"); goto end; } } - cJSON *unauthenticated_supi = cJSON_GetObjectItemCaseSensitive(ue_context_releaseJSON, "unauthenticatedSupi"); - + unauthenticated_supi = cJSON_GetObjectItemCaseSensitive(ue_context_releaseJSON, "unauthenticatedSupi"); if (unauthenticated_supi) { if (!cJSON_IsBool(unauthenticated_supi)) { ogs_error("OpenAPI_ue_context_release_parseFromJSON() failed [unauthenticated_supi]"); @@ -93,17 +108,15 @@ OpenAPI_ue_context_release_t *OpenAPI_ue_context_release_parseFromJSON(cJSON *ue } } - cJSON *ngap_cause = cJSON_GetObjectItemCaseSensitive(ue_context_releaseJSON, "ngapCause"); + ngap_cause = cJSON_GetObjectItemCaseSensitive(ue_context_releaseJSON, "ngapCause"); if (!ngap_cause) { ogs_error("OpenAPI_ue_context_release_parseFromJSON() failed [ngap_cause]"); goto end; } - - OpenAPI_ng_ap_cause_t *ngap_cause_local_nonprim = NULL; ngap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ngap_cause); ue_context_release_local_var = OpenAPI_ue_context_release_create ( - supi ? ogs_strdup(supi->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL, unauthenticated_supi ? true : false, unauthenticated_supi ? unauthenticated_supi->valueint : 0, ngap_cause_local_nonprim @@ -111,6 +124,10 @@ OpenAPI_ue_context_release_t *OpenAPI_ue_context_release_parseFromJSON(cJSON *ue return ue_context_release_local_var; end: + if (ngap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ngap_cause_local_nonprim); + ngap_cause_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_relocate_data.c b/lib/sbi/openapi/model/ue_context_relocate_data.c index d8777cda5..db689af08 100644 --- a/lib/sbi/openapi/model/ue_context_relocate_data.c +++ b/lib/sbi/openapi/model/ue_context_relocate_data.c @@ -32,27 +32,53 @@ OpenAPI_ue_context_relocate_data_t *OpenAPI_ue_context_relocate_data_create( void OpenAPI_ue_context_relocate_data_free(OpenAPI_ue_context_relocate_data_t *ue_context_relocate_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_relocate_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_free(ue_context_relocate_data->ue_context); - OpenAPI_ng_ran_target_id_free(ue_context_relocate_data->target_id); - OpenAPI_n2_info_content_free(ue_context_relocate_data->source_to_target_data); - OpenAPI_ref_to_binary_data_free(ue_context_relocate_data->forward_relocation_request); - OpenAPI_list_for_each(ue_context_relocate_data->pdu_session_list, node) { - OpenAPI_n2_sm_information_free(node->data); + if (ue_context_relocate_data->ue_context) { + OpenAPI_ue_context_free(ue_context_relocate_data->ue_context); + ue_context_relocate_data->ue_context = NULL; + } + if (ue_context_relocate_data->target_id) { + OpenAPI_ng_ran_target_id_free(ue_context_relocate_data->target_id); + ue_context_relocate_data->target_id = NULL; + } + if (ue_context_relocate_data->source_to_target_data) { + OpenAPI_n2_info_content_free(ue_context_relocate_data->source_to_target_data); + ue_context_relocate_data->source_to_target_data = NULL; + } + if (ue_context_relocate_data->forward_relocation_request) { + OpenAPI_ref_to_binary_data_free(ue_context_relocate_data->forward_relocation_request); + ue_context_relocate_data->forward_relocation_request = NULL; + } + if (ue_context_relocate_data->pdu_session_list) { + OpenAPI_list_for_each(ue_context_relocate_data->pdu_session_list, node) { + OpenAPI_n2_sm_information_free(node->data); + } + OpenAPI_list_free(ue_context_relocate_data->pdu_session_list); + ue_context_relocate_data->pdu_session_list = NULL; + } + if (ue_context_relocate_data->ue_radio_capability) { + OpenAPI_n2_info_content_free(ue_context_relocate_data->ue_radio_capability); + ue_context_relocate_data->ue_radio_capability = NULL; + } + if (ue_context_relocate_data->ngap_cause) { + OpenAPI_ng_ap_cause_free(ue_context_relocate_data->ngap_cause); + ue_context_relocate_data->ngap_cause = NULL; + } + if (ue_context_relocate_data->supported_features) { + ogs_free(ue_context_relocate_data->supported_features); + ue_context_relocate_data->supported_features = NULL; } - OpenAPI_list_free(ue_context_relocate_data->pdu_session_list); - OpenAPI_n2_info_content_free(ue_context_relocate_data->ue_radio_capability); - OpenAPI_ng_ap_cause_free(ue_context_relocate_data->ngap_cause); - ogs_free(ue_context_relocate_data->supported_features); ogs_free(ue_context_relocate_data); } cJSON *OpenAPI_ue_context_relocate_data_convertToJSON(OpenAPI_ue_context_relocate_data_t *ue_context_relocate_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_relocate_data == NULL) { ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [UeContextRelocateData]"); @@ -60,6 +86,10 @@ cJSON *OpenAPI_ue_context_relocate_data_convertToJSON(OpenAPI_ue_context_relocat } item = cJSON_CreateObject(); + if (!ue_context_relocate_data->ue_context) { + ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [ue_context]"); + return NULL; + } cJSON *ue_context_local_JSON = OpenAPI_ue_context_convertToJSON(ue_context_relocate_data->ue_context); if (ue_context_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [ue_context]"); @@ -71,6 +101,10 @@ cJSON *OpenAPI_ue_context_relocate_data_convertToJSON(OpenAPI_ue_context_relocat goto end; } + if (!ue_context_relocate_data->target_id) { + ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [target_id]"); + return NULL; + } cJSON *target_id_local_JSON = OpenAPI_ng_ran_target_id_convertToJSON(ue_context_relocate_data->target_id); if (target_id_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [target_id]"); @@ -82,6 +116,10 @@ cJSON *OpenAPI_ue_context_relocate_data_convertToJSON(OpenAPI_ue_context_relocat goto end; } + if (!ue_context_relocate_data->source_to_target_data) { + ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [source_to_target_data]"); + return NULL; + } cJSON *source_to_target_data_local_JSON = OpenAPI_n2_info_content_convertToJSON(ue_context_relocate_data->source_to_target_data); if (source_to_target_data_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [source_to_target_data]"); @@ -93,6 +131,10 @@ cJSON *OpenAPI_ue_context_relocate_data_convertToJSON(OpenAPI_ue_context_relocat goto end; } + if (!ue_context_relocate_data->forward_relocation_request) { + ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [forward_relocation_request]"); + return NULL; + } cJSON *forward_relocation_request_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(ue_context_relocate_data->forward_relocation_request); if (forward_relocation_request_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [forward_relocation_request]"); @@ -110,17 +152,13 @@ cJSON *OpenAPI_ue_context_relocate_data_convertToJSON(OpenAPI_ue_context_relocat ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [pdu_session_list]"); goto end; } - - OpenAPI_lnode_t *pdu_session_list_node; - if (ue_context_relocate_data->pdu_session_list) { - OpenAPI_list_for_each(ue_context_relocate_data->pdu_session_list, pdu_session_list_node) { - cJSON *itemLocal = OpenAPI_n2_sm_information_convertToJSON(pdu_session_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [pdu_session_list]"); - goto end; - } - cJSON_AddItemToArray(pdu_session_listList, itemLocal); + OpenAPI_list_for_each(ue_context_relocate_data->pdu_session_list, node) { + cJSON *itemLocal = OpenAPI_n2_sm_information_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_context_relocate_data_convertToJSON() failed [pdu_session_list]"); + goto end; } + cJSON_AddItemToArray(pdu_session_listList, itemLocal); } } @@ -164,89 +202,88 @@ end: OpenAPI_ue_context_relocate_data_t *OpenAPI_ue_context_relocate_data_parseFromJSON(cJSON *ue_context_relocate_dataJSON) { OpenAPI_ue_context_relocate_data_t *ue_context_relocate_data_local_var = NULL; - cJSON *ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "ueContext"); + OpenAPI_lnode_t *node = NULL; + cJSON *ue_context = NULL; + OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; + cJSON *target_id = NULL; + OpenAPI_ng_ran_target_id_t *target_id_local_nonprim = NULL; + cJSON *source_to_target_data = NULL; + OpenAPI_n2_info_content_t *source_to_target_data_local_nonprim = NULL; + cJSON *forward_relocation_request = NULL; + OpenAPI_ref_to_binary_data_t *forward_relocation_request_local_nonprim = NULL; + cJSON *pdu_session_list = NULL; + OpenAPI_list_t *pdu_session_listList = NULL; + cJSON *ue_radio_capability = NULL; + OpenAPI_n2_info_content_t *ue_radio_capability_local_nonprim = NULL; + cJSON *ngap_cause = NULL; + OpenAPI_ng_ap_cause_t *ngap_cause_local_nonprim = NULL; + cJSON *supported_features = NULL; + ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "ueContext"); if (!ue_context) { ogs_error("OpenAPI_ue_context_relocate_data_parseFromJSON() failed [ue_context]"); goto end; } - - OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; ue_context_local_nonprim = OpenAPI_ue_context_parseFromJSON(ue_context); - cJSON *target_id = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "targetId"); + target_id = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "targetId"); if (!target_id) { ogs_error("OpenAPI_ue_context_relocate_data_parseFromJSON() failed [target_id]"); goto end; } - - OpenAPI_ng_ran_target_id_t *target_id_local_nonprim = NULL; target_id_local_nonprim = OpenAPI_ng_ran_target_id_parseFromJSON(target_id); - cJSON *source_to_target_data = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "sourceToTargetData"); + source_to_target_data = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "sourceToTargetData"); if (!source_to_target_data) { ogs_error("OpenAPI_ue_context_relocate_data_parseFromJSON() failed [source_to_target_data]"); goto end; } - - OpenAPI_n2_info_content_t *source_to_target_data_local_nonprim = NULL; source_to_target_data_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(source_to_target_data); - cJSON *forward_relocation_request = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "forwardRelocationRequest"); + forward_relocation_request = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "forwardRelocationRequest"); if (!forward_relocation_request) { ogs_error("OpenAPI_ue_context_relocate_data_parseFromJSON() failed [forward_relocation_request]"); goto end; } - - OpenAPI_ref_to_binary_data_t *forward_relocation_request_local_nonprim = NULL; forward_relocation_request_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(forward_relocation_request); - cJSON *pdu_session_list = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "pduSessionList"); - - OpenAPI_list_t *pdu_session_listList; + pdu_session_list = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "pduSessionList"); if (pdu_session_list) { - cJSON *pdu_session_list_local_nonprimitive; - if (!cJSON_IsArray(pdu_session_list)){ - ogs_error("OpenAPI_ue_context_relocate_data_parseFromJSON() failed [pdu_session_list]"); - goto end; - } - - pdu_session_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_session_list_local_nonprimitive, pdu_session_list ) { - if (!cJSON_IsObject(pdu_session_list_local_nonprimitive)) { + cJSON *pdu_session_list_local = NULL; + if (!cJSON_IsArray(pdu_session_list)) { ogs_error("OpenAPI_ue_context_relocate_data_parseFromJSON() failed [pdu_session_list]"); goto end; } - OpenAPI_n2_sm_information_t *pdu_session_listItem = OpenAPI_n2_sm_information_parseFromJSON(pdu_session_list_local_nonprimitive); - if (!pdu_session_listItem) { - ogs_error("No pdu_session_listItem"); - OpenAPI_list_free(pdu_session_listList); - goto end; + pdu_session_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_list_local, pdu_session_list) { + if (!cJSON_IsObject(pdu_session_list_local)) { + ogs_error("OpenAPI_ue_context_relocate_data_parseFromJSON() failed [pdu_session_list]"); + goto end; + } + OpenAPI_n2_sm_information_t *pdu_session_listItem = OpenAPI_n2_sm_information_parseFromJSON(pdu_session_list_local); + if (!pdu_session_listItem) { + ogs_error("No pdu_session_listItem"); + OpenAPI_list_free(pdu_session_listList); + goto end; + } + OpenAPI_list_add(pdu_session_listList, pdu_session_listItem); } - - OpenAPI_list_add(pdu_session_listList, pdu_session_listItem); - } } - cJSON *ue_radio_capability = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "ueRadioCapability"); - - OpenAPI_n2_info_content_t *ue_radio_capability_local_nonprim = NULL; + ue_radio_capability = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "ueRadioCapability"); if (ue_radio_capability) { ue_radio_capability_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(ue_radio_capability); } - cJSON *ngap_cause = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "ngapCause"); - - OpenAPI_ng_ap_cause_t *ngap_cause_local_nonprim = NULL; + ngap_cause = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "ngapCause"); if (ngap_cause) { ngap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ngap_cause); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_relocate_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ue_context_relocate_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -260,11 +297,42 @@ OpenAPI_ue_context_relocate_data_t *OpenAPI_ue_context_relocate_data_parseFromJS pdu_session_list ? pdu_session_listList : NULL, ue_radio_capability ? ue_radio_capability_local_nonprim : NULL, ngap_cause ? ngap_cause_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return ue_context_relocate_data_local_var; end: + if (ue_context_local_nonprim) { + OpenAPI_ue_context_free(ue_context_local_nonprim); + ue_context_local_nonprim = NULL; + } + if (target_id_local_nonprim) { + OpenAPI_ng_ran_target_id_free(target_id_local_nonprim); + target_id_local_nonprim = NULL; + } + if (source_to_target_data_local_nonprim) { + OpenAPI_n2_info_content_free(source_to_target_data_local_nonprim); + source_to_target_data_local_nonprim = NULL; + } + if (forward_relocation_request_local_nonprim) { + OpenAPI_ref_to_binary_data_free(forward_relocation_request_local_nonprim); + forward_relocation_request_local_nonprim = NULL; + } + if (pdu_session_listList) { + OpenAPI_list_for_each(pdu_session_listList, node) { + OpenAPI_n2_sm_information_free(node->data); + } + OpenAPI_list_free(pdu_session_listList); + pdu_session_listList = NULL; + } + if (ue_radio_capability_local_nonprim) { + OpenAPI_n2_info_content_free(ue_radio_capability_local_nonprim); + ue_radio_capability_local_nonprim = NULL; + } + if (ngap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ngap_cause_local_nonprim); + ngap_cause_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_relocated_data.c b/lib/sbi/openapi/model/ue_context_relocated_data.c index efe3a25b4..0483a19de 100644 --- a/lib/sbi/openapi/model/ue_context_relocated_data.c +++ b/lib/sbi/openapi/model/ue_context_relocated_data.c @@ -18,17 +18,22 @@ OpenAPI_ue_context_relocated_data_t *OpenAPI_ue_context_relocated_data_create( void OpenAPI_ue_context_relocated_data_free(OpenAPI_ue_context_relocated_data_t *ue_context_relocated_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_relocated_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_free(ue_context_relocated_data->ue_context); + if (ue_context_relocated_data->ue_context) { + OpenAPI_ue_context_free(ue_context_relocated_data->ue_context); + ue_context_relocated_data->ue_context = NULL; + } ogs_free(ue_context_relocated_data); } cJSON *OpenAPI_ue_context_relocated_data_convertToJSON(OpenAPI_ue_context_relocated_data_t *ue_context_relocated_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_relocated_data == NULL) { ogs_error("OpenAPI_ue_context_relocated_data_convertToJSON() failed [UeContextRelocatedData]"); @@ -56,9 +61,10 @@ end: OpenAPI_ue_context_relocated_data_t *OpenAPI_ue_context_relocated_data_parseFromJSON(cJSON *ue_context_relocated_dataJSON) { OpenAPI_ue_context_relocated_data_t *ue_context_relocated_data_local_var = NULL; - cJSON *ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_relocated_dataJSON, "ueContext"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ue_context = NULL; OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; + ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_relocated_dataJSON, "ueContext"); if (ue_context) { ue_context_local_nonprim = OpenAPI_ue_context_parseFromJSON(ue_context); } @@ -69,6 +75,10 @@ OpenAPI_ue_context_relocated_data_t *OpenAPI_ue_context_relocated_data_parseFrom return ue_context_relocated_data_local_var; end: + if (ue_context_local_nonprim) { + OpenAPI_ue_context_free(ue_context_local_nonprim); + ue_context_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_transfer_200_response.c b/lib/sbi/openapi/model/ue_context_transfer_200_response.c new file mode 100644 index 000000000..e62c2e9e9 --- /dev/null +++ b/lib/sbi/openapi/model/ue_context_transfer_200_response.c @@ -0,0 +1,184 @@ + +#include +#include +#include +#include "ue_context_transfer_200_response.h" + +OpenAPI_ue_context_transfer_200_response_t *OpenAPI_ue_context_transfer_200_response_create( + OpenAPI_ue_context_transfer_rsp_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information, + OpenAPI_binary_t* binary_data_n2_information_ext1 +) +{ + OpenAPI_ue_context_transfer_200_response_t *ue_context_transfer_200_response_local_var = ogs_malloc(sizeof(OpenAPI_ue_context_transfer_200_response_t)); + ogs_assert(ue_context_transfer_200_response_local_var); + + ue_context_transfer_200_response_local_var->json_data = json_data; + ue_context_transfer_200_response_local_var->binary_data_n2_information = binary_data_n2_information; + ue_context_transfer_200_response_local_var->binary_data_n2_information_ext1 = binary_data_n2_information_ext1; + + return ue_context_transfer_200_response_local_var; +} + +void OpenAPI_ue_context_transfer_200_response_free(OpenAPI_ue_context_transfer_200_response_t *ue_context_transfer_200_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == ue_context_transfer_200_response) { + return; + } + if (ue_context_transfer_200_response->json_data) { + OpenAPI_ue_context_transfer_rsp_data_free(ue_context_transfer_200_response->json_data); + ue_context_transfer_200_response->json_data = NULL; + } + if (ue_context_transfer_200_response->binary_data_n2_information) { + ogs_free(ue_context_transfer_200_response->binary_data_n2_information->data); + ue_context_transfer_200_response->binary_data_n2_information = NULL; + } + if (ue_context_transfer_200_response->binary_data_n2_information_ext1) { + ogs_free(ue_context_transfer_200_response->binary_data_n2_information_ext1->data); + ue_context_transfer_200_response->binary_data_n2_information_ext1 = NULL; + } + ogs_free(ue_context_transfer_200_response); +} + +cJSON *OpenAPI_ue_context_transfer_200_response_convertToJSON(OpenAPI_ue_context_transfer_200_response_t *ue_context_transfer_200_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (ue_context_transfer_200_response == NULL) { + ogs_error("OpenAPI_ue_context_transfer_200_response_convertToJSON() failed [UEContextTransfer_200_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ue_context_transfer_200_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_ue_context_transfer_rsp_data_convertToJSON(ue_context_transfer_200_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_ue_context_transfer_200_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ue_context_transfer_200_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (ue_context_transfer_200_response->binary_data_n2_information) { + char* encoded_str_binary_data_n2_information = OpenAPI_base64encode(ue_context_transfer_200_response->binary_data_n2_information->data,ue_context_transfer_200_response->binary_data_n2_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2Information", encoded_str_binary_data_n2_information) == NULL) { + ogs_error("OpenAPI_ue_context_transfer_200_response_convertToJSON() failed [binary_data_n2_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information); + } + + if (ue_context_transfer_200_response->binary_data_n2_information_ext1) { + char* encoded_str_binary_data_n2_information_ext1 = OpenAPI_base64encode(ue_context_transfer_200_response->binary_data_n2_information_ext1->data,ue_context_transfer_200_response->binary_data_n2_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN2InformationExt1", encoded_str_binary_data_n2_information_ext1) == NULL) { + ogs_error("OpenAPI_ue_context_transfer_200_response_convertToJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_information_ext1); + } + +end: + return item; +} + +OpenAPI_ue_context_transfer_200_response_t *OpenAPI_ue_context_transfer_200_response_parseFromJSON(cJSON *ue_context_transfer_200_responseJSON) +{ + OpenAPI_ue_context_transfer_200_response_t *ue_context_transfer_200_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_ue_context_transfer_rsp_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n2_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information = NULL; + cJSON *binary_data_n2_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_information_ext1 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_200_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_ue_context_transfer_rsp_data_parseFromJSON(json_data); + } + + binary_data_n2_information = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_200_responseJSON, "binaryDataN2Information"); + if (binary_data_n2_information) { + decoded_str_binary_data_n2_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information); + if (!cJSON_IsString(binary_data_n2_information)) { + ogs_error("OpenAPI_ue_context_transfer_200_response_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + decoded_str_binary_data_n2_information->data = OpenAPI_base64decode(binary_data_n2_information->valuestring, strlen(binary_data_n2_information->valuestring), &decoded_str_binary_data_n2_information->len); + if (!decoded_str_binary_data_n2_information->data) { + ogs_error("OpenAPI_ue_context_transfer_200_response_parseFromJSON() failed [binary_data_n2_information]"); + goto end; + } + } + + binary_data_n2_information_ext1 = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_200_responseJSON, "binaryDataN2InformationExt1"); + if (binary_data_n2_information_ext1) { + decoded_str_binary_data_n2_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_information_ext1); + if (!cJSON_IsString(binary_data_n2_information_ext1)) { + ogs_error("OpenAPI_ue_context_transfer_200_response_parseFromJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + decoded_str_binary_data_n2_information_ext1->data = OpenAPI_base64decode(binary_data_n2_information_ext1->valuestring, strlen(binary_data_n2_information_ext1->valuestring), &decoded_str_binary_data_n2_information_ext1->len); + if (!decoded_str_binary_data_n2_information_ext1->data) { + ogs_error("OpenAPI_ue_context_transfer_200_response_parseFromJSON() failed [binary_data_n2_information_ext1]"); + goto end; + } + } + + ue_context_transfer_200_response_local_var = OpenAPI_ue_context_transfer_200_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n2_information ? decoded_str_binary_data_n2_information : NULL, + binary_data_n2_information_ext1 ? decoded_str_binary_data_n2_information_ext1 : NULL + ); + + return ue_context_transfer_200_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_ue_context_transfer_rsp_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_ue_context_transfer_200_response_t *OpenAPI_ue_context_transfer_200_response_copy(OpenAPI_ue_context_transfer_200_response_t *dst, OpenAPI_ue_context_transfer_200_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_ue_context_transfer_200_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_ue_context_transfer_200_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_ue_context_transfer_200_response_free(dst); + dst = OpenAPI_ue_context_transfer_200_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/ue_context_transfer_200_response.h b/lib/sbi/openapi/model/ue_context_transfer_200_response.h new file mode 100644 index 000000000..a20ad9ba3 --- /dev/null +++ b/lib/sbi/openapi/model/ue_context_transfer_200_response.h @@ -0,0 +1,43 @@ +/* + * ue_context_transfer_200_response.h + * + * + */ + +#ifndef _OpenAPI_ue_context_transfer_200_response_H_ +#define _OpenAPI_ue_context_transfer_200_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_context_transfer_rsp_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_context_transfer_200_response_s OpenAPI_ue_context_transfer_200_response_t; +typedef struct OpenAPI_ue_context_transfer_200_response_s { + struct OpenAPI_ue_context_transfer_rsp_data_s *json_data; + OpenAPI_binary_t* binary_data_n2_information; + OpenAPI_binary_t* binary_data_n2_information_ext1; +} OpenAPI_ue_context_transfer_200_response_t; + +OpenAPI_ue_context_transfer_200_response_t *OpenAPI_ue_context_transfer_200_response_create( + OpenAPI_ue_context_transfer_rsp_data_t *json_data, + OpenAPI_binary_t* binary_data_n2_information, + OpenAPI_binary_t* binary_data_n2_information_ext1 +); +void OpenAPI_ue_context_transfer_200_response_free(OpenAPI_ue_context_transfer_200_response_t *ue_context_transfer_200_response); +OpenAPI_ue_context_transfer_200_response_t *OpenAPI_ue_context_transfer_200_response_parseFromJSON(cJSON *ue_context_transfer_200_responseJSON); +cJSON *OpenAPI_ue_context_transfer_200_response_convertToJSON(OpenAPI_ue_context_transfer_200_response_t *ue_context_transfer_200_response); +OpenAPI_ue_context_transfer_200_response_t *OpenAPI_ue_context_transfer_200_response_copy(OpenAPI_ue_context_transfer_200_response_t *dst, OpenAPI_ue_context_transfer_200_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_context_transfer_200_response_H_ */ + diff --git a/lib/sbi/openapi/model/ue_context_transfer_req_data.c b/lib/sbi/openapi/model/ue_context_transfer_req_data.c index 6a91ee691..cc3134bb6 100644 --- a/lib/sbi/openapi/model/ue_context_transfer_req_data.c +++ b/lib/sbi/openapi/model/ue_context_transfer_req_data.c @@ -26,19 +26,30 @@ OpenAPI_ue_context_transfer_req_data_t *OpenAPI_ue_context_transfer_req_data_cre void OpenAPI_ue_context_transfer_req_data_free(OpenAPI_ue_context_transfer_req_data_t *ue_context_transfer_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_transfer_req_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_plmn_id_free(ue_context_transfer_req_data->plmn_id); - OpenAPI_n1_message_container_free(ue_context_transfer_req_data->reg_request); - ogs_free(ue_context_transfer_req_data->supported_features); + if (ue_context_transfer_req_data->plmn_id) { + OpenAPI_plmn_id_free(ue_context_transfer_req_data->plmn_id); + ue_context_transfer_req_data->plmn_id = NULL; + } + if (ue_context_transfer_req_data->reg_request) { + OpenAPI_n1_message_container_free(ue_context_transfer_req_data->reg_request); + ue_context_transfer_req_data->reg_request = NULL; + } + if (ue_context_transfer_req_data->supported_features) { + ogs_free(ue_context_transfer_req_data->supported_features); + ue_context_transfer_req_data->supported_features = NULL; + } ogs_free(ue_context_transfer_req_data); } cJSON *OpenAPI_ue_context_transfer_req_data_convertToJSON(OpenAPI_ue_context_transfer_req_data_t *ue_context_transfer_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_transfer_req_data == NULL) { ogs_error("OpenAPI_ue_context_transfer_req_data_convertToJSON() failed [UeContextTransferReqData]"); @@ -46,11 +57,19 @@ cJSON *OpenAPI_ue_context_transfer_req_data_convertToJSON(OpenAPI_ue_context_tra } item = cJSON_CreateObject(); + if (ue_context_transfer_req_data->reason == OpenAPI_transfer_reason_NULL) { + ogs_error("OpenAPI_ue_context_transfer_req_data_convertToJSON() failed [reason]"); + return NULL; + } if (cJSON_AddStringToObject(item, "reason", OpenAPI_transfer_reason_ToString(ue_context_transfer_req_data->reason)) == NULL) { ogs_error("OpenAPI_ue_context_transfer_req_data_convertToJSON() failed [reason]"); goto end; } + if (ue_context_transfer_req_data->access_type == OpenAPI_access_type_NULL) { + ogs_error("OpenAPI_ue_context_transfer_req_data_convertToJSON() failed [access_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(ue_context_transfer_req_data->access_type)) == NULL) { ogs_error("OpenAPI_ue_context_transfer_req_data_convertToJSON() failed [access_type]"); goto end; @@ -96,50 +115,51 @@ end: OpenAPI_ue_context_transfer_req_data_t *OpenAPI_ue_context_transfer_req_data_parseFromJSON(cJSON *ue_context_transfer_req_dataJSON) { OpenAPI_ue_context_transfer_req_data_t *ue_context_transfer_req_data_local_var = NULL; - cJSON *reason = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "reason"); + OpenAPI_lnode_t *node = NULL; + cJSON *reason = NULL; + OpenAPI_transfer_reason_e reasonVariable = 0; + cJSON *access_type = NULL; + OpenAPI_access_type_e access_typeVariable = 0; + cJSON *plmn_id = NULL; + OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + cJSON *reg_request = NULL; + OpenAPI_n1_message_container_t *reg_request_local_nonprim = NULL; + cJSON *supported_features = NULL; + reason = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "reason"); if (!reason) { ogs_error("OpenAPI_ue_context_transfer_req_data_parseFromJSON() failed [reason]"); goto end; } - - OpenAPI_transfer_reason_e reasonVariable; if (!cJSON_IsString(reason)) { ogs_error("OpenAPI_ue_context_transfer_req_data_parseFromJSON() failed [reason]"); goto end; } reasonVariable = OpenAPI_transfer_reason_FromString(reason->valuestring); - cJSON *access_type = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "accessType"); + access_type = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "accessType"); if (!access_type) { ogs_error("OpenAPI_ue_context_transfer_req_data_parseFromJSON() failed [access_type]"); goto end; } - - OpenAPI_access_type_e access_typeVariable; if (!cJSON_IsString(access_type)) { ogs_error("OpenAPI_ue_context_transfer_req_data_parseFromJSON() failed [access_type]"); goto end; } access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring); - cJSON *plmn_id = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "plmnId"); - - OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL; + plmn_id = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "plmnId"); if (plmn_id) { plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id); } - cJSON *reg_request = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "regRequest"); - - OpenAPI_n1_message_container_t *reg_request_local_nonprim = NULL; + reg_request = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "regRequest"); if (reg_request) { reg_request_local_nonprim = OpenAPI_n1_message_container_parseFromJSON(reg_request); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_req_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ue_context_transfer_req_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -150,11 +170,19 @@ OpenAPI_ue_context_transfer_req_data_t *OpenAPI_ue_context_transfer_req_data_par access_typeVariable, plmn_id ? plmn_id_local_nonprim : NULL, reg_request ? reg_request_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return ue_context_transfer_req_data_local_var; end: + if (plmn_id_local_nonprim) { + OpenAPI_plmn_id_free(plmn_id_local_nonprim); + plmn_id_local_nonprim = NULL; + } + if (reg_request_local_nonprim) { + OpenAPI_n1_message_container_free(reg_request_local_nonprim); + reg_request_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_context_transfer_request.c b/lib/sbi/openapi/model/ue_context_transfer_request.c new file mode 100644 index 000000000..bc0dc2ce6 --- /dev/null +++ b/lib/sbi/openapi/model/ue_context_transfer_request.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "ue_context_transfer_request.h" + +OpenAPI_ue_context_transfer_request_t *OpenAPI_ue_context_transfer_request_create( + OpenAPI_ue_context_transfer_req_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_message +) +{ + OpenAPI_ue_context_transfer_request_t *ue_context_transfer_request_local_var = ogs_malloc(sizeof(OpenAPI_ue_context_transfer_request_t)); + ogs_assert(ue_context_transfer_request_local_var); + + ue_context_transfer_request_local_var->json_data = json_data; + ue_context_transfer_request_local_var->binary_data_n1_message = binary_data_n1_message; + + return ue_context_transfer_request_local_var; +} + +void OpenAPI_ue_context_transfer_request_free(OpenAPI_ue_context_transfer_request_t *ue_context_transfer_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == ue_context_transfer_request) { + return; + } + if (ue_context_transfer_request->json_data) { + OpenAPI_ue_context_transfer_req_data_free(ue_context_transfer_request->json_data); + ue_context_transfer_request->json_data = NULL; + } + if (ue_context_transfer_request->binary_data_n1_message) { + ogs_free(ue_context_transfer_request->binary_data_n1_message->data); + ue_context_transfer_request->binary_data_n1_message = NULL; + } + ogs_free(ue_context_transfer_request); +} + +cJSON *OpenAPI_ue_context_transfer_request_convertToJSON(OpenAPI_ue_context_transfer_request_t *ue_context_transfer_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (ue_context_transfer_request == NULL) { + ogs_error("OpenAPI_ue_context_transfer_request_convertToJSON() failed [UEContextTransfer_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (ue_context_transfer_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_ue_context_transfer_req_data_convertToJSON(ue_context_transfer_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_ue_context_transfer_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_ue_context_transfer_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (ue_context_transfer_request->binary_data_n1_message) { + char* encoded_str_binary_data_n1_message = OpenAPI_base64encode(ue_context_transfer_request->binary_data_n1_message->data,ue_context_transfer_request->binary_data_n1_message->len); + if (cJSON_AddStringToObject(item, "binaryDataN1Message", encoded_str_binary_data_n1_message) == NULL) { + ogs_error("OpenAPI_ue_context_transfer_request_convertToJSON() failed [binary_data_n1_message]"); + goto end; + } + ogs_free(encoded_str_binary_data_n1_message); + } + +end: + return item; +} + +OpenAPI_ue_context_transfer_request_t *OpenAPI_ue_context_transfer_request_parseFromJSON(cJSON *ue_context_transfer_requestJSON) +{ + OpenAPI_ue_context_transfer_request_t *ue_context_transfer_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_ue_context_transfer_req_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n1_message = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n1_message = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_ue_context_transfer_req_data_parseFromJSON(json_data); + } + + binary_data_n1_message = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_requestJSON, "binaryDataN1Message"); + if (binary_data_n1_message) { + decoded_str_binary_data_n1_message = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n1_message); + if (!cJSON_IsString(binary_data_n1_message)) { + ogs_error("OpenAPI_ue_context_transfer_request_parseFromJSON() failed [binary_data_n1_message]"); + goto end; + } + decoded_str_binary_data_n1_message->data = OpenAPI_base64decode(binary_data_n1_message->valuestring, strlen(binary_data_n1_message->valuestring), &decoded_str_binary_data_n1_message->len); + if (!decoded_str_binary_data_n1_message->data) { + ogs_error("OpenAPI_ue_context_transfer_request_parseFromJSON() failed [binary_data_n1_message]"); + goto end; + } + } + + ue_context_transfer_request_local_var = OpenAPI_ue_context_transfer_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n1_message ? decoded_str_binary_data_n1_message : NULL + ); + + return ue_context_transfer_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_ue_context_transfer_req_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_ue_context_transfer_request_t *OpenAPI_ue_context_transfer_request_copy(OpenAPI_ue_context_transfer_request_t *dst, OpenAPI_ue_context_transfer_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_ue_context_transfer_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_ue_context_transfer_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_ue_context_transfer_request_free(dst); + dst = OpenAPI_ue_context_transfer_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/ue_context_transfer_request.h b/lib/sbi/openapi/model/ue_context_transfer_request.h new file mode 100644 index 000000000..6818ddae2 --- /dev/null +++ b/lib/sbi/openapi/model/ue_context_transfer_request.h @@ -0,0 +1,41 @@ +/* + * ue_context_transfer_request.h + * + * + */ + +#ifndef _OpenAPI_ue_context_transfer_request_H_ +#define _OpenAPI_ue_context_transfer_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "ue_context_transfer_req_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_ue_context_transfer_request_s OpenAPI_ue_context_transfer_request_t; +typedef struct OpenAPI_ue_context_transfer_request_s { + struct OpenAPI_ue_context_transfer_req_data_s *json_data; + OpenAPI_binary_t* binary_data_n1_message; +} OpenAPI_ue_context_transfer_request_t; + +OpenAPI_ue_context_transfer_request_t *OpenAPI_ue_context_transfer_request_create( + OpenAPI_ue_context_transfer_req_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_message +); +void OpenAPI_ue_context_transfer_request_free(OpenAPI_ue_context_transfer_request_t *ue_context_transfer_request); +OpenAPI_ue_context_transfer_request_t *OpenAPI_ue_context_transfer_request_parseFromJSON(cJSON *ue_context_transfer_requestJSON); +cJSON *OpenAPI_ue_context_transfer_request_convertToJSON(OpenAPI_ue_context_transfer_request_t *ue_context_transfer_request); +OpenAPI_ue_context_transfer_request_t *OpenAPI_ue_context_transfer_request_copy(OpenAPI_ue_context_transfer_request_t *dst, OpenAPI_ue_context_transfer_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_ue_context_transfer_request_H_ */ + diff --git a/lib/sbi/openapi/model/ue_context_transfer_rsp_data.c b/lib/sbi/openapi/model/ue_context_transfer_rsp_data.c index f8d500aaf..3cdafacef 100644 --- a/lib/sbi/openapi/model/ue_context_transfer_rsp_data.c +++ b/lib/sbi/openapi/model/ue_context_transfer_rsp_data.c @@ -24,20 +24,34 @@ OpenAPI_ue_context_transfer_rsp_data_t *OpenAPI_ue_context_transfer_rsp_data_cre void OpenAPI_ue_context_transfer_rsp_data_free(OpenAPI_ue_context_transfer_rsp_data_t *ue_context_transfer_rsp_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_context_transfer_rsp_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ue_context_free(ue_context_transfer_rsp_data->ue_context); - OpenAPI_n2_info_content_free(ue_context_transfer_rsp_data->ue_radio_capability); - OpenAPI_n2_info_content_free(ue_context_transfer_rsp_data->ue_nbiot_radio_capability); - ogs_free(ue_context_transfer_rsp_data->supported_features); + if (ue_context_transfer_rsp_data->ue_context) { + OpenAPI_ue_context_free(ue_context_transfer_rsp_data->ue_context); + ue_context_transfer_rsp_data->ue_context = NULL; + } + if (ue_context_transfer_rsp_data->ue_radio_capability) { + OpenAPI_n2_info_content_free(ue_context_transfer_rsp_data->ue_radio_capability); + ue_context_transfer_rsp_data->ue_radio_capability = NULL; + } + if (ue_context_transfer_rsp_data->ue_nbiot_radio_capability) { + OpenAPI_n2_info_content_free(ue_context_transfer_rsp_data->ue_nbiot_radio_capability); + ue_context_transfer_rsp_data->ue_nbiot_radio_capability = NULL; + } + if (ue_context_transfer_rsp_data->supported_features) { + ogs_free(ue_context_transfer_rsp_data->supported_features); + ue_context_transfer_rsp_data->supported_features = NULL; + } ogs_free(ue_context_transfer_rsp_data); } cJSON *OpenAPI_ue_context_transfer_rsp_data_convertToJSON(OpenAPI_ue_context_transfer_rsp_data_t *ue_context_transfer_rsp_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_context_transfer_rsp_data == NULL) { ogs_error("OpenAPI_ue_context_transfer_rsp_data_convertToJSON() failed [UeContextTransferRspData]"); @@ -45,6 +59,10 @@ cJSON *OpenAPI_ue_context_transfer_rsp_data_convertToJSON(OpenAPI_ue_context_tra } item = cJSON_CreateObject(); + if (!ue_context_transfer_rsp_data->ue_context) { + ogs_error("OpenAPI_ue_context_transfer_rsp_data_convertToJSON() failed [ue_context]"); + return NULL; + } cJSON *ue_context_local_JSON = OpenAPI_ue_context_convertToJSON(ue_context_transfer_rsp_data->ue_context); if (ue_context_local_JSON == NULL) { ogs_error("OpenAPI_ue_context_transfer_rsp_data_convertToJSON() failed [ue_context]"); @@ -96,33 +114,34 @@ end: OpenAPI_ue_context_transfer_rsp_data_t *OpenAPI_ue_context_transfer_rsp_data_parseFromJSON(cJSON *ue_context_transfer_rsp_dataJSON) { OpenAPI_ue_context_transfer_rsp_data_t *ue_context_transfer_rsp_data_local_var = NULL; - cJSON *ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_rsp_dataJSON, "ueContext"); + OpenAPI_lnode_t *node = NULL; + cJSON *ue_context = NULL; + OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; + cJSON *ue_radio_capability = NULL; + OpenAPI_n2_info_content_t *ue_radio_capability_local_nonprim = NULL; + cJSON *ue_nbiot_radio_capability = NULL; + OpenAPI_n2_info_content_t *ue_nbiot_radio_capability_local_nonprim = NULL; + cJSON *supported_features = NULL; + ue_context = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_rsp_dataJSON, "ueContext"); if (!ue_context) { ogs_error("OpenAPI_ue_context_transfer_rsp_data_parseFromJSON() failed [ue_context]"); goto end; } - - OpenAPI_ue_context_t *ue_context_local_nonprim = NULL; ue_context_local_nonprim = OpenAPI_ue_context_parseFromJSON(ue_context); - cJSON *ue_radio_capability = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_rsp_dataJSON, "ueRadioCapability"); - - OpenAPI_n2_info_content_t *ue_radio_capability_local_nonprim = NULL; + ue_radio_capability = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_rsp_dataJSON, "ueRadioCapability"); if (ue_radio_capability) { ue_radio_capability_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(ue_radio_capability); } - cJSON *ue_nbiot_radio_capability = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_rsp_dataJSON, "ueNbiotRadioCapability"); - - OpenAPI_n2_info_content_t *ue_nbiot_radio_capability_local_nonprim = NULL; + ue_nbiot_radio_capability = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_rsp_dataJSON, "ueNbiotRadioCapability"); if (ue_nbiot_radio_capability) { ue_nbiot_radio_capability_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(ue_nbiot_radio_capability); } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_rsp_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ue_context_transfer_rsp_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ue_context_transfer_rsp_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -132,11 +151,23 @@ OpenAPI_ue_context_transfer_rsp_data_t *OpenAPI_ue_context_transfer_rsp_data_par ue_context_local_nonprim, ue_radio_capability ? ue_radio_capability_local_nonprim : NULL, ue_nbiot_radio_capability ? ue_nbiot_radio_capability_local_nonprim : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return ue_context_transfer_rsp_data_local_var; end: + if (ue_context_local_nonprim) { + OpenAPI_ue_context_free(ue_context_local_nonprim); + ue_context_local_nonprim = NULL; + } + if (ue_radio_capability_local_nonprim) { + OpenAPI_n2_info_content_free(ue_radio_capability_local_nonprim); + ue_radio_capability_local_nonprim = NULL; + } + if (ue_nbiot_radio_capability_local_nonprim) { + OpenAPI_n2_info_content_free(ue_nbiot_radio_capability_local_nonprim); + ue_nbiot_radio_capability_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_differentiation_info.c b/lib/sbi/openapi/model/ue_differentiation_info.c index 8b784204e..26f945b76 100644 --- a/lib/sbi/openapi/model/ue_differentiation_info.c +++ b/lib/sbi/openapi/model/ue_differentiation_info.c @@ -32,19 +32,30 @@ OpenAPI_ue_differentiation_info_t *OpenAPI_ue_differentiation_info_create( void OpenAPI_ue_differentiation_info_free(OpenAPI_ue_differentiation_info_t *ue_differentiation_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_differentiation_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_scheduled_communication_time_free(ue_differentiation_info->scheduled_com_time); - OpenAPI_battery_indication_free(ue_differentiation_info->battery_ind); - ogs_free(ue_differentiation_info->validity_time); + if (ue_differentiation_info->scheduled_com_time) { + OpenAPI_scheduled_communication_time_free(ue_differentiation_info->scheduled_com_time); + ue_differentiation_info->scheduled_com_time = NULL; + } + if (ue_differentiation_info->battery_ind) { + OpenAPI_battery_indication_free(ue_differentiation_info->battery_ind); + ue_differentiation_info->battery_ind = NULL; + } + if (ue_differentiation_info->validity_time) { + ogs_free(ue_differentiation_info->validity_time); + ue_differentiation_info->validity_time = NULL; + } ogs_free(ue_differentiation_info); } cJSON *OpenAPI_ue_differentiation_info_convertToJSON(OpenAPI_ue_differentiation_info_t *ue_differentiation_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_differentiation_info == NULL) { ogs_error("OpenAPI_ue_differentiation_info_convertToJSON() failed [UeDifferentiationInfo]"); @@ -52,7 +63,7 @@ cJSON *OpenAPI_ue_differentiation_info_convertToJSON(OpenAPI_ue_differentiation_ } item = cJSON_CreateObject(); - if (ue_differentiation_info->periodic_com_ind) { + if (ue_differentiation_info->periodic_com_ind != OpenAPI_periodic_communication_indicator_NULL) { if (cJSON_AddStringToObject(item, "periodicComInd", OpenAPI_periodic_communication_indicator_ToString(ue_differentiation_info->periodic_com_ind)) == NULL) { ogs_error("OpenAPI_ue_differentiation_info_convertToJSON() failed [periodic_com_ind]"); goto end; @@ -79,14 +90,14 @@ cJSON *OpenAPI_ue_differentiation_info_convertToJSON(OpenAPI_ue_differentiation_ } } - if (ue_differentiation_info->stationary_ind) { + if (ue_differentiation_info->stationary_ind != OpenAPI_stationary_indication_NULL) { if (cJSON_AddStringToObject(item, "stationaryInd", OpenAPI_stationary_indication_ToString(ue_differentiation_info->stationary_ind)) == NULL) { ogs_error("OpenAPI_ue_differentiation_info_convertToJSON() failed [stationary_ind]"); goto end; } } - if (ue_differentiation_info->traffic_profile) { + if (ue_differentiation_info->traffic_profile != OpenAPI_traffic_profile_NULL) { if (cJSON_AddStringToObject(item, "trafficProfile", OpenAPI_traffic_profile_ToString(ue_differentiation_info->traffic_profile)) == NULL) { ogs_error("OpenAPI_ue_differentiation_info_convertToJSON() failed [traffic_profile]"); goto end; @@ -120,9 +131,20 @@ end: OpenAPI_ue_differentiation_info_t *OpenAPI_ue_differentiation_info_parseFromJSON(cJSON *ue_differentiation_infoJSON) { OpenAPI_ue_differentiation_info_t *ue_differentiation_info_local_var = NULL; - cJSON *periodic_com_ind = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "periodicComInd"); - - OpenAPI_periodic_communication_indicator_e periodic_com_indVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *periodic_com_ind = NULL; + OpenAPI_periodic_communication_indicator_e periodic_com_indVariable = 0; + cJSON *periodic_time = NULL; + cJSON *scheduled_com_time = NULL; + OpenAPI_scheduled_communication_time_t *scheduled_com_time_local_nonprim = NULL; + cJSON *stationary_ind = NULL; + OpenAPI_stationary_indication_e stationary_indVariable = 0; + cJSON *traffic_profile = NULL; + OpenAPI_traffic_profile_e traffic_profileVariable = 0; + cJSON *battery_ind = NULL; + OpenAPI_battery_indication_t *battery_ind_local_nonprim = NULL; + cJSON *validity_time = NULL; + periodic_com_ind = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "periodicComInd"); if (periodic_com_ind) { if (!cJSON_IsString(periodic_com_ind)) { ogs_error("OpenAPI_ue_differentiation_info_parseFromJSON() failed [periodic_com_ind]"); @@ -131,8 +153,7 @@ OpenAPI_ue_differentiation_info_t *OpenAPI_ue_differentiation_info_parseFromJSON periodic_com_indVariable = OpenAPI_periodic_communication_indicator_FromString(periodic_com_ind->valuestring); } - cJSON *periodic_time = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "periodicTime"); - + periodic_time = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "periodicTime"); if (periodic_time) { if (!cJSON_IsNumber(periodic_time)) { ogs_error("OpenAPI_ue_differentiation_info_parseFromJSON() failed [periodic_time]"); @@ -140,16 +161,12 @@ OpenAPI_ue_differentiation_info_t *OpenAPI_ue_differentiation_info_parseFromJSON } } - cJSON *scheduled_com_time = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "scheduledComTime"); - - OpenAPI_scheduled_communication_time_t *scheduled_com_time_local_nonprim = NULL; + scheduled_com_time = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "scheduledComTime"); if (scheduled_com_time) { scheduled_com_time_local_nonprim = OpenAPI_scheduled_communication_time_parseFromJSON(scheduled_com_time); } - cJSON *stationary_ind = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "stationaryInd"); - - OpenAPI_stationary_indication_e stationary_indVariable; + stationary_ind = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "stationaryInd"); if (stationary_ind) { if (!cJSON_IsString(stationary_ind)) { ogs_error("OpenAPI_ue_differentiation_info_parseFromJSON() failed [stationary_ind]"); @@ -158,9 +175,7 @@ OpenAPI_ue_differentiation_info_t *OpenAPI_ue_differentiation_info_parseFromJSON stationary_indVariable = OpenAPI_stationary_indication_FromString(stationary_ind->valuestring); } - cJSON *traffic_profile = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "trafficProfile"); - - OpenAPI_traffic_profile_e traffic_profileVariable; + traffic_profile = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "trafficProfile"); if (traffic_profile) { if (!cJSON_IsString(traffic_profile)) { ogs_error("OpenAPI_ue_differentiation_info_parseFromJSON() failed [traffic_profile]"); @@ -169,17 +184,14 @@ OpenAPI_ue_differentiation_info_t *OpenAPI_ue_differentiation_info_parseFromJSON traffic_profileVariable = OpenAPI_traffic_profile_FromString(traffic_profile->valuestring); } - cJSON *battery_ind = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "batteryInd"); - - OpenAPI_battery_indication_t *battery_ind_local_nonprim = NULL; + battery_ind = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "batteryInd"); if (battery_ind) { battery_ind_local_nonprim = OpenAPI_battery_indication_parseFromJSON(battery_ind); } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(ue_differentiation_infoJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_ue_differentiation_info_parseFromJSON() failed [validity_time]"); goto end; } @@ -193,11 +205,19 @@ OpenAPI_ue_differentiation_info_t *OpenAPI_ue_differentiation_info_parseFromJSON stationary_ind ? stationary_indVariable : 0, traffic_profile ? traffic_profileVariable : 0, battery_ind ? battery_ind_local_nonprim : NULL, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL ); return ue_differentiation_info_local_var; end: + if (scheduled_com_time_local_nonprim) { + OpenAPI_scheduled_communication_time_free(scheduled_com_time_local_nonprim); + scheduled_com_time_local_nonprim = NULL; + } + if (battery_ind_local_nonprim) { + OpenAPI_battery_indication_free(battery_ind_local_nonprim); + battery_ind_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_id.c b/lib/sbi/openapi/model/ue_id.c index 6e813fcfd..7c3a40ed0 100644 --- a/lib/sbi/openapi/model/ue_id.c +++ b/lib/sbi/openapi/model/ue_id.c @@ -20,21 +20,29 @@ OpenAPI_ue_id_t *OpenAPI_ue_id_create( void OpenAPI_ue_id_free(OpenAPI_ue_id_t *ue_id) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_id) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_id->supi); - OpenAPI_list_for_each(ue_id->gpsi_list, node) { - ogs_free(node->data); + if (ue_id->supi) { + ogs_free(ue_id->supi); + ue_id->supi = NULL; + } + if (ue_id->gpsi_list) { + OpenAPI_list_for_each(ue_id->gpsi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_id->gpsi_list); + ue_id->gpsi_list = NULL; } - OpenAPI_list_free(ue_id->gpsi_list); ogs_free(ue_id); } cJSON *OpenAPI_ue_id_convertToJSON(OpenAPI_ue_id_t *ue_id) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_id == NULL) { ogs_error("OpenAPI_ue_id_convertToJSON() failed [UeId]"); @@ -42,25 +50,27 @@ cJSON *OpenAPI_ue_id_convertToJSON(OpenAPI_ue_id_t *ue_id) } item = cJSON_CreateObject(); + if (!ue_id->supi) { + ogs_error("OpenAPI_ue_id_convertToJSON() failed [supi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supi", ue_id->supi) == NULL) { ogs_error("OpenAPI_ue_id_convertToJSON() failed [supi]"); goto end; } if (ue_id->gpsi_list) { - cJSON *gpsi_list = cJSON_AddArrayToObject(item, "gpsiList"); - if (gpsi_list == NULL) { + cJSON *gpsi_listList = cJSON_AddArrayToObject(item, "gpsiList"); + if (gpsi_listList == NULL) { ogs_error("OpenAPI_ue_id_convertToJSON() failed [gpsi_list]"); goto end; } - - OpenAPI_lnode_t *gpsi_list_node; - OpenAPI_list_for_each(ue_id->gpsi_list, gpsi_list_node) { - if (cJSON_AddStringToObject(gpsi_list, "", (char*)gpsi_list_node->data) == NULL) { - ogs_error("OpenAPI_ue_id_convertToJSON() failed [gpsi_list]"); - goto end; + OpenAPI_list_for_each(ue_id->gpsi_list, node) { + if (cJSON_AddStringToObject(gpsi_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_id_convertToJSON() failed [gpsi_list]"); + goto end; + } } - } } end: @@ -70,35 +80,39 @@ end: OpenAPI_ue_id_t *OpenAPI_ue_id_parseFromJSON(cJSON *ue_idJSON) { OpenAPI_ue_id_t *ue_id_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(ue_idJSON, "supi"); + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *gpsi_list = NULL; + OpenAPI_list_t *gpsi_listList = NULL; + supi = cJSON_GetObjectItemCaseSensitive(ue_idJSON, "supi"); if (!supi) { ogs_error("OpenAPI_ue_id_parseFromJSON() failed [supi]"); goto end; } - if (!cJSON_IsString(supi)) { ogs_error("OpenAPI_ue_id_parseFromJSON() failed [supi]"); goto end; } - cJSON *gpsi_list = cJSON_GetObjectItemCaseSensitive(ue_idJSON, "gpsiList"); - - OpenAPI_list_t *gpsi_listList; + gpsi_list = cJSON_GetObjectItemCaseSensitive(ue_idJSON, "gpsiList"); if (gpsi_list) { - cJSON *gpsi_list_local; - if (!cJSON_IsArray(gpsi_list)) { - ogs_error("OpenAPI_ue_id_parseFromJSON() failed [gpsi_list]"); - goto end; - } - gpsi_listList = OpenAPI_list_create(); + cJSON *gpsi_list_local = NULL; + if (!cJSON_IsArray(gpsi_list)) { + ogs_error("OpenAPI_ue_id_parseFromJSON() failed [gpsi_list]"); + goto end; + } - cJSON_ArrayForEach(gpsi_list_local, gpsi_list) { - if (!cJSON_IsString(gpsi_list_local)) { - ogs_error("OpenAPI_ue_id_parseFromJSON() failed [gpsi_list]"); - goto end; - } - OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring)); - } + gpsi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(gpsi_list_local, gpsi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(gpsi_list_local)) { + ogs_error("OpenAPI_ue_id_parseFromJSON() failed [gpsi_list]"); + goto end; + } + OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring)); + } } ue_id_local_var = OpenAPI_ue_id_create ( @@ -108,6 +122,13 @@ OpenAPI_ue_id_t *OpenAPI_ue_id_parseFromJSON(cJSON *ue_idJSON) return ue_id_local_var; end: + if (gpsi_listList) { + OpenAPI_list_for_each(gpsi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(gpsi_listList); + gpsi_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_identity_info.c b/lib/sbi/openapi/model/ue_identity_info.c index 1eea1909d..991afc1e7 100644 --- a/lib/sbi/openapi/model/ue_identity_info.c +++ b/lib/sbi/openapi/model/ue_identity_info.c @@ -22,19 +22,30 @@ OpenAPI_ue_identity_info_t *OpenAPI_ue_identity_info_create( void OpenAPI_ue_identity_info_free(OpenAPI_ue_identity_info_t *ue_identity_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_identity_info) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_identity_info->gpsi); - ogs_free(ue_identity_info->pei); - ogs_free(ue_identity_info->supi); + if (ue_identity_info->gpsi) { + ogs_free(ue_identity_info->gpsi); + ue_identity_info->gpsi = NULL; + } + if (ue_identity_info->pei) { + ogs_free(ue_identity_info->pei); + ue_identity_info->pei = NULL; + } + if (ue_identity_info->supi) { + ogs_free(ue_identity_info->supi); + ue_identity_info->supi = NULL; + } ogs_free(ue_identity_info); } cJSON *OpenAPI_ue_identity_info_convertToJSON(OpenAPI_ue_identity_info_t *ue_identity_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_identity_info == NULL) { ogs_error("OpenAPI_ue_identity_info_convertToJSON() failed [UeIdentityInfo]"); @@ -70,37 +81,38 @@ end: OpenAPI_ue_identity_info_t *OpenAPI_ue_identity_info_parseFromJSON(cJSON *ue_identity_infoJSON) { OpenAPI_ue_identity_info_t *ue_identity_info_local_var = NULL; - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(ue_identity_infoJSON, "gpsi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *gpsi = NULL; + cJSON *pei = NULL; + cJSON *supi = NULL; + gpsi = cJSON_GetObjectItemCaseSensitive(ue_identity_infoJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_ue_identity_info_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(ue_identity_infoJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(ue_identity_infoJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_ue_identity_info_parseFromJSON() failed [pei]"); goto end; } } - cJSON *supi = cJSON_GetObjectItemCaseSensitive(ue_identity_infoJSON, "supi"); - + supi = cJSON_GetObjectItemCaseSensitive(ue_identity_infoJSON, "supi"); if (supi) { - if (!cJSON_IsString(supi)) { + if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) { ogs_error("OpenAPI_ue_identity_info_parseFromJSON() failed [supi]"); goto end; } } ue_identity_info_local_var = OpenAPI_ue_identity_info_create ( - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - pei ? ogs_strdup(pei->valuestring) : NULL, - supi ? ogs_strdup(supi->valuestring) : NULL + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, + supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL ); return ue_identity_info_local_var; diff --git a/lib/sbi/openapi/model/ue_initiated_resource_request.c b/lib/sbi/openapi/model/ue_initiated_resource_request.c index 774a219f4..683cdab97 100644 --- a/lib/sbi/openapi/model/ue_initiated_resource_request.c +++ b/lib/sbi/openapi/model/ue_initiated_resource_request.c @@ -28,22 +28,33 @@ OpenAPI_ue_initiated_resource_request_t *OpenAPI_ue_initiated_resource_request_c void OpenAPI_ue_initiated_resource_request_free(OpenAPI_ue_initiated_resource_request_t *ue_initiated_resource_request) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_initiated_resource_request) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_initiated_resource_request->pcc_rule_id); - OpenAPI_list_for_each(ue_initiated_resource_request->pack_filt_info, node) { - OpenAPI_packet_filter_info_free(node->data); + if (ue_initiated_resource_request->pcc_rule_id) { + ogs_free(ue_initiated_resource_request->pcc_rule_id); + ue_initiated_resource_request->pcc_rule_id = NULL; + } + if (ue_initiated_resource_request->pack_filt_info) { + OpenAPI_list_for_each(ue_initiated_resource_request->pack_filt_info, node) { + OpenAPI_packet_filter_info_free(node->data); + } + OpenAPI_list_free(ue_initiated_resource_request->pack_filt_info); + ue_initiated_resource_request->pack_filt_info = NULL; + } + if (ue_initiated_resource_request->req_qos) { + OpenAPI_requested_qos_free(ue_initiated_resource_request->req_qos); + ue_initiated_resource_request->req_qos = NULL; } - OpenAPI_list_free(ue_initiated_resource_request->pack_filt_info); - OpenAPI_requested_qos_free(ue_initiated_resource_request->req_qos); ogs_free(ue_initiated_resource_request); } cJSON *OpenAPI_ue_initiated_resource_request_convertToJSON(OpenAPI_ue_initiated_resource_request_t *ue_initiated_resource_request) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_initiated_resource_request == NULL) { ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [UeInitiatedResourceRequest]"); @@ -58,6 +69,10 @@ cJSON *OpenAPI_ue_initiated_resource_request_convertToJSON(OpenAPI_ue_initiated_ } } + if (ue_initiated_resource_request->rule_op == OpenAPI_rule_operation_NULL) { + ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [rule_op]"); + return NULL; + } if (cJSON_AddStringToObject(item, "ruleOp", OpenAPI_rule_operation_ToString(ue_initiated_resource_request->rule_op)) == NULL) { ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [rule_op]"); goto end; @@ -70,22 +85,22 @@ cJSON *OpenAPI_ue_initiated_resource_request_convertToJSON(OpenAPI_ue_initiated_ } } + if (!ue_initiated_resource_request->pack_filt_info) { + ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [pack_filt_info]"); + return NULL; + } cJSON *pack_filt_infoList = cJSON_AddArrayToObject(item, "packFiltInfo"); if (pack_filt_infoList == NULL) { ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [pack_filt_info]"); goto end; } - - OpenAPI_lnode_t *pack_filt_info_node; - if (ue_initiated_resource_request->pack_filt_info) { - OpenAPI_list_for_each(ue_initiated_resource_request->pack_filt_info, pack_filt_info_node) { - cJSON *itemLocal = OpenAPI_packet_filter_info_convertToJSON(pack_filt_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [pack_filt_info]"); - goto end; - } - cJSON_AddItemToArray(pack_filt_infoList, itemLocal); + OpenAPI_list_for_each(ue_initiated_resource_request->pack_filt_info, node) { + cJSON *itemLocal = OpenAPI_packet_filter_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [pack_filt_info]"); + goto end; } + cJSON_AddItemToArray(pack_filt_infoList, itemLocal); } if (ue_initiated_resource_request->req_qos) { @@ -108,30 +123,35 @@ end: OpenAPI_ue_initiated_resource_request_t *OpenAPI_ue_initiated_resource_request_parseFromJSON(cJSON *ue_initiated_resource_requestJSON) { OpenAPI_ue_initiated_resource_request_t *ue_initiated_resource_request_local_var = NULL; - cJSON *pcc_rule_id = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "pccRuleId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *pcc_rule_id = NULL; + cJSON *rule_op = NULL; + OpenAPI_rule_operation_e rule_opVariable = 0; + cJSON *precedence = NULL; + cJSON *pack_filt_info = NULL; + OpenAPI_list_t *pack_filt_infoList = NULL; + cJSON *req_qos = NULL; + OpenAPI_requested_qos_t *req_qos_local_nonprim = NULL; + pcc_rule_id = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "pccRuleId"); if (pcc_rule_id) { - if (!cJSON_IsString(pcc_rule_id)) { + if (!cJSON_IsString(pcc_rule_id) && !cJSON_IsNull(pcc_rule_id)) { ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [pcc_rule_id]"); goto end; } } - cJSON *rule_op = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "ruleOp"); + rule_op = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "ruleOp"); if (!rule_op) { ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [rule_op]"); goto end; } - - OpenAPI_rule_operation_e rule_opVariable; if (!cJSON_IsString(rule_op)) { ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [rule_op]"); goto end; } rule_opVariable = OpenAPI_rule_operation_FromString(rule_op->valuestring); - cJSON *precedence = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "precedence"); - + precedence = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "precedence"); if (precedence) { if (!cJSON_IsNumber(precedence)) { ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [precedence]"); @@ -139,46 +159,40 @@ OpenAPI_ue_initiated_resource_request_t *OpenAPI_ue_initiated_resource_request_p } } - cJSON *pack_filt_info = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "packFiltInfo"); + pack_filt_info = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "packFiltInfo"); if (!pack_filt_info) { ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [pack_filt_info]"); goto end; } - - OpenAPI_list_t *pack_filt_infoList; - cJSON *pack_filt_info_local_nonprimitive; - if (!cJSON_IsArray(pack_filt_info)){ - ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [pack_filt_info]"); - goto end; - } - - pack_filt_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pack_filt_info_local_nonprimitive, pack_filt_info ) { - if (!cJSON_IsObject(pack_filt_info_local_nonprimitive)) { + cJSON *pack_filt_info_local = NULL; + if (!cJSON_IsArray(pack_filt_info)) { ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [pack_filt_info]"); goto end; } - OpenAPI_packet_filter_info_t *pack_filt_infoItem = OpenAPI_packet_filter_info_parseFromJSON(pack_filt_info_local_nonprimitive); - if (!pack_filt_infoItem) { - ogs_error("No pack_filt_infoItem"); - OpenAPI_list_free(pack_filt_infoList); - goto end; + pack_filt_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pack_filt_info_local, pack_filt_info) { + if (!cJSON_IsObject(pack_filt_info_local)) { + ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [pack_filt_info]"); + goto end; + } + OpenAPI_packet_filter_info_t *pack_filt_infoItem = OpenAPI_packet_filter_info_parseFromJSON(pack_filt_info_local); + if (!pack_filt_infoItem) { + ogs_error("No pack_filt_infoItem"); + OpenAPI_list_free(pack_filt_infoList); + goto end; + } + OpenAPI_list_add(pack_filt_infoList, pack_filt_infoItem); } - OpenAPI_list_add(pack_filt_infoList, pack_filt_infoItem); - } - - cJSON *req_qos = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "reqQos"); - - OpenAPI_requested_qos_t *req_qos_local_nonprim = NULL; + req_qos = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "reqQos"); if (req_qos) { req_qos_local_nonprim = OpenAPI_requested_qos_parseFromJSON(req_qos); } ue_initiated_resource_request_local_var = OpenAPI_ue_initiated_resource_request_create ( - pcc_rule_id ? ogs_strdup(pcc_rule_id->valuestring) : NULL, + pcc_rule_id && !cJSON_IsNull(pcc_rule_id) ? ogs_strdup(pcc_rule_id->valuestring) : NULL, rule_opVariable, precedence ? true : false, precedence ? precedence->valuedouble : 0, @@ -188,6 +202,17 @@ OpenAPI_ue_initiated_resource_request_t *OpenAPI_ue_initiated_resource_request_p return ue_initiated_resource_request_local_var; end: + if (pack_filt_infoList) { + OpenAPI_list_for_each(pack_filt_infoList, node) { + OpenAPI_packet_filter_info_free(node->data); + } + OpenAPI_list_free(pack_filt_infoList); + pack_filt_infoList = NULL; + } + if (req_qos_local_nonprim) { + OpenAPI_requested_qos_free(req_qos_local_nonprim); + req_qos_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_n1_n2_info_subscription_create_data.c b/lib/sbi/openapi/model/ue_n1_n2_info_subscription_create_data.c index cfcbed940..3f2555a27 100644 --- a/lib/sbi/openapi/model/ue_n1_n2_info_subscription_create_data.c +++ b/lib/sbi/openapi/model/ue_n1_n2_info_subscription_create_data.c @@ -30,21 +30,38 @@ OpenAPI_ue_n1_n2_info_subscription_create_data_t *OpenAPI_ue_n1_n2_info_subscrip void OpenAPI_ue_n1_n2_info_subscription_create_data_free(OpenAPI_ue_n1_n2_info_subscription_create_data_t *ue_n1_n2_info_subscription_create_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_n1_n2_info_subscription_create_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_n1_n2_info_subscription_create_data->n2_notify_callback_uri); - ogs_free(ue_n1_n2_info_subscription_create_data->n1_notify_callback_uri); - ogs_free(ue_n1_n2_info_subscription_create_data->nf_id); - ogs_free(ue_n1_n2_info_subscription_create_data->supported_features); - OpenAPI_guami_free(ue_n1_n2_info_subscription_create_data->old_guami); + if (ue_n1_n2_info_subscription_create_data->n2_notify_callback_uri) { + ogs_free(ue_n1_n2_info_subscription_create_data->n2_notify_callback_uri); + ue_n1_n2_info_subscription_create_data->n2_notify_callback_uri = NULL; + } + if (ue_n1_n2_info_subscription_create_data->n1_notify_callback_uri) { + ogs_free(ue_n1_n2_info_subscription_create_data->n1_notify_callback_uri); + ue_n1_n2_info_subscription_create_data->n1_notify_callback_uri = NULL; + } + if (ue_n1_n2_info_subscription_create_data->nf_id) { + ogs_free(ue_n1_n2_info_subscription_create_data->nf_id); + ue_n1_n2_info_subscription_create_data->nf_id = NULL; + } + if (ue_n1_n2_info_subscription_create_data->supported_features) { + ogs_free(ue_n1_n2_info_subscription_create_data->supported_features); + ue_n1_n2_info_subscription_create_data->supported_features = NULL; + } + if (ue_n1_n2_info_subscription_create_data->old_guami) { + OpenAPI_guami_free(ue_n1_n2_info_subscription_create_data->old_guami); + ue_n1_n2_info_subscription_create_data->old_guami = NULL; + } ogs_free(ue_n1_n2_info_subscription_create_data); } cJSON *OpenAPI_ue_n1_n2_info_subscription_create_data_convertToJSON(OpenAPI_ue_n1_n2_info_subscription_create_data_t *ue_n1_n2_info_subscription_create_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_n1_n2_info_subscription_create_data == NULL) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_convertToJSON() failed [UeN1N2InfoSubscriptionCreateData]"); @@ -52,7 +69,7 @@ cJSON *OpenAPI_ue_n1_n2_info_subscription_create_data_convertToJSON(OpenAPI_ue_n } item = cJSON_CreateObject(); - if (ue_n1_n2_info_subscription_create_data->n2_information_class) { + if (ue_n1_n2_info_subscription_create_data->n2_information_class != OpenAPI_n2_information_class_NULL) { if (cJSON_AddStringToObject(item, "n2InformationClass", OpenAPI_n2_information_class_ToString(ue_n1_n2_info_subscription_create_data->n2_information_class)) == NULL) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_convertToJSON() failed [n2_information_class]"); goto end; @@ -66,7 +83,7 @@ cJSON *OpenAPI_ue_n1_n2_info_subscription_create_data_convertToJSON(OpenAPI_ue_n } } - if (ue_n1_n2_info_subscription_create_data->n1_message_class) { + if (ue_n1_n2_info_subscription_create_data->n1_message_class != OpenAPI_n1_message_class_NULL) { if (cJSON_AddStringToObject(item, "n1MessageClass", OpenAPI_n1_message_class_ToString(ue_n1_n2_info_subscription_create_data->n1_message_class)) == NULL) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_convertToJSON() failed [n1_message_class]"); goto end; @@ -114,9 +131,18 @@ end: OpenAPI_ue_n1_n2_info_subscription_create_data_t *OpenAPI_ue_n1_n2_info_subscription_create_data_parseFromJSON(cJSON *ue_n1_n2_info_subscription_create_dataJSON) { OpenAPI_ue_n1_n2_info_subscription_create_data_t *ue_n1_n2_info_subscription_create_data_local_var = NULL; - cJSON *n2_information_class = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "n2InformationClass"); - - OpenAPI_n2_information_class_e n2_information_classVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *n2_information_class = NULL; + OpenAPI_n2_information_class_e n2_information_classVariable = 0; + cJSON *n2_notify_callback_uri = NULL; + cJSON *n1_message_class = NULL; + OpenAPI_n1_message_class_e n1_message_classVariable = 0; + cJSON *n1_notify_callback_uri = NULL; + cJSON *nf_id = NULL; + cJSON *supported_features = NULL; + cJSON *old_guami = NULL; + OpenAPI_guami_t *old_guami_local_nonprim = NULL; + n2_information_class = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "n2InformationClass"); if (n2_information_class) { if (!cJSON_IsString(n2_information_class)) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_parseFromJSON() failed [n2_information_class]"); @@ -125,18 +151,15 @@ OpenAPI_ue_n1_n2_info_subscription_create_data_t *OpenAPI_ue_n1_n2_info_subscrip n2_information_classVariable = OpenAPI_n2_information_class_FromString(n2_information_class->valuestring); } - cJSON *n2_notify_callback_uri = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "n2NotifyCallbackUri"); - + n2_notify_callback_uri = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "n2NotifyCallbackUri"); if (n2_notify_callback_uri) { - if (!cJSON_IsString(n2_notify_callback_uri)) { + if (!cJSON_IsString(n2_notify_callback_uri) && !cJSON_IsNull(n2_notify_callback_uri)) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_parseFromJSON() failed [n2_notify_callback_uri]"); goto end; } } - cJSON *n1_message_class = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "n1MessageClass"); - - OpenAPI_n1_message_class_e n1_message_classVariable; + n1_message_class = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "n1MessageClass"); if (n1_message_class) { if (!cJSON_IsString(n1_message_class)) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_parseFromJSON() failed [n1_message_class]"); @@ -145,52 +168,51 @@ OpenAPI_ue_n1_n2_info_subscription_create_data_t *OpenAPI_ue_n1_n2_info_subscrip n1_message_classVariable = OpenAPI_n1_message_class_FromString(n1_message_class->valuestring); } - cJSON *n1_notify_callback_uri = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "n1NotifyCallbackUri"); - + n1_notify_callback_uri = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "n1NotifyCallbackUri"); if (n1_notify_callback_uri) { - if (!cJSON_IsString(n1_notify_callback_uri)) { + if (!cJSON_IsString(n1_notify_callback_uri) && !cJSON_IsNull(n1_notify_callback_uri)) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_parseFromJSON() failed [n1_notify_callback_uri]"); goto end; } } - cJSON *nf_id = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "nfId"); - + nf_id = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "nfId"); if (nf_id) { - if (!cJSON_IsString(nf_id)) { + if (!cJSON_IsString(nf_id) && !cJSON_IsNull(nf_id)) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_parseFromJSON() failed [nf_id]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_create_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *old_guami = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "oldGuami"); - - OpenAPI_guami_t *old_guami_local_nonprim = NULL; + old_guami = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_create_dataJSON, "oldGuami"); if (old_guami) { old_guami_local_nonprim = OpenAPI_guami_parseFromJSON(old_guami); } ue_n1_n2_info_subscription_create_data_local_var = OpenAPI_ue_n1_n2_info_subscription_create_data_create ( n2_information_class ? n2_information_classVariable : 0, - n2_notify_callback_uri ? ogs_strdup(n2_notify_callback_uri->valuestring) : NULL, + n2_notify_callback_uri && !cJSON_IsNull(n2_notify_callback_uri) ? ogs_strdup(n2_notify_callback_uri->valuestring) : NULL, n1_message_class ? n1_message_classVariable : 0, - n1_notify_callback_uri ? ogs_strdup(n1_notify_callback_uri->valuestring) : NULL, - nf_id ? ogs_strdup(nf_id->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + n1_notify_callback_uri && !cJSON_IsNull(n1_notify_callback_uri) ? ogs_strdup(n1_notify_callback_uri->valuestring) : NULL, + nf_id && !cJSON_IsNull(nf_id) ? ogs_strdup(nf_id->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, old_guami ? old_guami_local_nonprim : NULL ); return ue_n1_n2_info_subscription_create_data_local_var; end: + if (old_guami_local_nonprim) { + OpenAPI_guami_free(old_guami_local_nonprim); + old_guami_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_n1_n2_info_subscription_created_data.c b/lib/sbi/openapi/model/ue_n1_n2_info_subscription_created_data.c index c54be2c9f..ea1bc1537 100644 --- a/lib/sbi/openapi/model/ue_n1_n2_info_subscription_created_data.c +++ b/lib/sbi/openapi/model/ue_n1_n2_info_subscription_created_data.c @@ -20,18 +20,26 @@ OpenAPI_ue_n1_n2_info_subscription_created_data_t *OpenAPI_ue_n1_n2_info_subscri void OpenAPI_ue_n1_n2_info_subscription_created_data_free(OpenAPI_ue_n1_n2_info_subscription_created_data_t *ue_n1_n2_info_subscription_created_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_n1_n2_info_subscription_created_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_n1_n2_info_subscription_created_data->n1n2_notify_subscription_id); - ogs_free(ue_n1_n2_info_subscription_created_data->supported_features); + if (ue_n1_n2_info_subscription_created_data->n1n2_notify_subscription_id) { + ogs_free(ue_n1_n2_info_subscription_created_data->n1n2_notify_subscription_id); + ue_n1_n2_info_subscription_created_data->n1n2_notify_subscription_id = NULL; + } + if (ue_n1_n2_info_subscription_created_data->supported_features) { + ogs_free(ue_n1_n2_info_subscription_created_data->supported_features); + ue_n1_n2_info_subscription_created_data->supported_features = NULL; + } ogs_free(ue_n1_n2_info_subscription_created_data); } cJSON *OpenAPI_ue_n1_n2_info_subscription_created_data_convertToJSON(OpenAPI_ue_n1_n2_info_subscription_created_data_t *ue_n1_n2_info_subscription_created_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_n1_n2_info_subscription_created_data == NULL) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_created_data_convertToJSON() failed [UeN1N2InfoSubscriptionCreatedData]"); @@ -39,6 +47,10 @@ cJSON *OpenAPI_ue_n1_n2_info_subscription_created_data_convertToJSON(OpenAPI_ue_ } item = cJSON_CreateObject(); + if (!ue_n1_n2_info_subscription_created_data->n1n2_notify_subscription_id) { + ogs_error("OpenAPI_ue_n1_n2_info_subscription_created_data_convertToJSON() failed [n1n2_notify_subscription_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "n1n2NotifySubscriptionId", ue_n1_n2_info_subscription_created_data->n1n2_notify_subscription_id) == NULL) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_created_data_convertToJSON() failed [n1n2_notify_subscription_id]"); goto end; @@ -58,21 +70,22 @@ end: OpenAPI_ue_n1_n2_info_subscription_created_data_t *OpenAPI_ue_n1_n2_info_subscription_created_data_parseFromJSON(cJSON *ue_n1_n2_info_subscription_created_dataJSON) { OpenAPI_ue_n1_n2_info_subscription_created_data_t *ue_n1_n2_info_subscription_created_data_local_var = NULL; - cJSON *n1n2_notify_subscription_id = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_created_dataJSON, "n1n2NotifySubscriptionId"); + OpenAPI_lnode_t *node = NULL; + cJSON *n1n2_notify_subscription_id = NULL; + cJSON *supported_features = NULL; + n1n2_notify_subscription_id = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_created_dataJSON, "n1n2NotifySubscriptionId"); if (!n1n2_notify_subscription_id) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_created_data_parseFromJSON() failed [n1n2_notify_subscription_id]"); goto end; } - if (!cJSON_IsString(n1n2_notify_subscription_id)) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_created_data_parseFromJSON() failed [n1n2_notify_subscription_id]"); goto end; } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_created_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(ue_n1_n2_info_subscription_created_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_ue_n1_n2_info_subscription_created_data_parseFromJSON() failed [supported_features]"); goto end; } @@ -80,7 +93,7 @@ OpenAPI_ue_n1_n2_info_subscription_created_data_t *OpenAPI_ue_n1_n2_info_subscri ue_n1_n2_info_subscription_created_data_local_var = OpenAPI_ue_n1_n2_info_subscription_created_data_create ( ogs_strdup(n1n2_notify_subscription_id->valuestring), - supported_features ? ogs_strdup(supported_features->valuestring) : NULL + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL ); return ue_n1_n2_info_subscription_created_data_local_var; diff --git a/lib/sbi/openapi/model/ue_policy_section.c b/lib/sbi/openapi/model/ue_policy_section.c index 888422cdb..a44c42315 100644 --- a/lib/sbi/openapi/model/ue_policy_section.c +++ b/lib/sbi/openapi/model/ue_policy_section.c @@ -5,7 +5,7 @@ #include "ue_policy_section.h" OpenAPI_ue_policy_section_t *OpenAPI_ue_policy_section_create( - char ue_policy_section_info, + char *ue_policy_section_info, char *upsi ) { @@ -20,17 +20,26 @@ OpenAPI_ue_policy_section_t *OpenAPI_ue_policy_section_create( void OpenAPI_ue_policy_section_free(OpenAPI_ue_policy_section_t *ue_policy_section) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_policy_section) { return; } - OpenAPI_lnode_t *node; - ogs_free(ue_policy_section->upsi); + if (ue_policy_section->ue_policy_section_info) { + ogs_free(ue_policy_section->ue_policy_section_info); + ue_policy_section->ue_policy_section_info = NULL; + } + if (ue_policy_section->upsi) { + ogs_free(ue_policy_section->upsi); + ue_policy_section->upsi = NULL; + } ogs_free(ue_policy_section); } cJSON *OpenAPI_ue_policy_section_convertToJSON(OpenAPI_ue_policy_section_t *ue_policy_section) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_policy_section == NULL) { ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [UePolicySection]"); @@ -38,11 +47,19 @@ cJSON *OpenAPI_ue_policy_section_convertToJSON(OpenAPI_ue_policy_section_t *ue_p } item = cJSON_CreateObject(); - if (cJSON_AddNumberToObject(item, "uePolicySectionInfo", ue_policy_section->ue_policy_section_info) == NULL) { + if (!ue_policy_section->ue_policy_section_info) { + ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [ue_policy_section_info]"); + return NULL; + } + if (cJSON_AddStringToObject(item, "uePolicySectionInfo", ue_policy_section->ue_policy_section_info) == NULL) { ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [ue_policy_section_info]"); goto end; } + if (!ue_policy_section->upsi) { + ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [upsi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "upsi", ue_policy_section->upsi) == NULL) { ogs_error("OpenAPI_ue_policy_section_convertToJSON() failed [upsi]"); goto end; @@ -55,30 +72,31 @@ end: OpenAPI_ue_policy_section_t *OpenAPI_ue_policy_section_parseFromJSON(cJSON *ue_policy_sectionJSON) { OpenAPI_ue_policy_section_t *ue_policy_section_local_var = NULL; - cJSON *ue_policy_section_info = cJSON_GetObjectItemCaseSensitive(ue_policy_sectionJSON, "uePolicySectionInfo"); + OpenAPI_lnode_t *node = NULL; + cJSON *ue_policy_section_info = NULL; + cJSON *upsi = NULL; + ue_policy_section_info = cJSON_GetObjectItemCaseSensitive(ue_policy_sectionJSON, "uePolicySectionInfo"); if (!ue_policy_section_info) { ogs_error("OpenAPI_ue_policy_section_parseFromJSON() failed [ue_policy_section_info]"); goto end; } - - if (!cJSON_IsNumber(ue_policy_section_info)) { + if (!cJSON_IsString(ue_policy_section_info)) { ogs_error("OpenAPI_ue_policy_section_parseFromJSON() failed [ue_policy_section_info]"); goto end; } - cJSON *upsi = cJSON_GetObjectItemCaseSensitive(ue_policy_sectionJSON, "upsi"); + upsi = cJSON_GetObjectItemCaseSensitive(ue_policy_sectionJSON, "upsi"); if (!upsi) { ogs_error("OpenAPI_ue_policy_section_parseFromJSON() failed [upsi]"); goto end; } - if (!cJSON_IsString(upsi)) { ogs_error("OpenAPI_ue_policy_section_parseFromJSON() failed [upsi]"); goto end; } ue_policy_section_local_var = OpenAPI_ue_policy_section_create ( - ue_policy_section_info->valueint, + ogs_strdup(ue_policy_section_info->valuestring), ogs_strdup(upsi->valuestring) ); diff --git a/lib/sbi/openapi/model/ue_policy_section.h b/lib/sbi/openapi/model/ue_policy_section.h index f756f2e9c..8f97c849a 100644 --- a/lib/sbi/openapi/model/ue_policy_section.h +++ b/lib/sbi/openapi/model/ue_policy_section.h @@ -19,12 +19,12 @@ extern "C" { typedef struct OpenAPI_ue_policy_section_s OpenAPI_ue_policy_section_t; typedef struct OpenAPI_ue_policy_section_s { - char ue_policy_section_info; + char *ue_policy_section_info; char *upsi; } OpenAPI_ue_policy_section_t; OpenAPI_ue_policy_section_t *OpenAPI_ue_policy_section_create( - char ue_policy_section_info, + char *ue_policy_section_info, char *upsi ); void OpenAPI_ue_policy_section_free(OpenAPI_ue_policy_section_t *ue_policy_section); diff --git a/lib/sbi/openapi/model/ue_policy_set.c b/lib/sbi/openapi/model/ue_policy_set.c index fef44f23e..de05cf2a6 100644 --- a/lib/sbi/openapi/model/ue_policy_set.c +++ b/lib/sbi/openapi/model/ue_policy_set.c @@ -36,51 +36,77 @@ OpenAPI_ue_policy_set_t *OpenAPI_ue_policy_set_create( void OpenAPI_ue_policy_set_free(OpenAPI_ue_policy_set_t *ue_policy_set) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_policy_set) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ue_policy_set->pra_infos, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_presence_info_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ue_policy_set->pra_infos) { + OpenAPI_list_for_each(ue_policy_set->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_set->pra_infos); + ue_policy_set->pra_infos = NULL; } - OpenAPI_list_free(ue_policy_set->pra_infos); - OpenAPI_list_for_each(ue_policy_set->subsc_cats, node) { - ogs_free(node->data); + if (ue_policy_set->subsc_cats) { + OpenAPI_list_for_each(ue_policy_set->subsc_cats, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set->subsc_cats); + ue_policy_set->subsc_cats = NULL; } - OpenAPI_list_free(ue_policy_set->subsc_cats); - OpenAPI_list_for_each(ue_policy_set->ue_policy_sections, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_ue_policy_section_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ue_policy_set->ue_policy_sections) { + OpenAPI_list_for_each(ue_policy_set->ue_policy_sections, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_ue_policy_section_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_set->ue_policy_sections); + ue_policy_set->ue_policy_sections = NULL; } - OpenAPI_list_free(ue_policy_set->ue_policy_sections); - OpenAPI_list_for_each(ue_policy_set->upsis, node) { - ogs_free(node->data); + if (ue_policy_set->upsis) { + OpenAPI_list_for_each(ue_policy_set->upsis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set->upsis); + ue_policy_set->upsis = NULL; } - OpenAPI_list_free(ue_policy_set->upsis); - OpenAPI_list_for_each(ue_policy_set->allowed_route_sel_descs, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_plmn_route_selection_descriptor_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ue_policy_set->allowed_route_sel_descs) { + OpenAPI_list_for_each(ue_policy_set->allowed_route_sel_descs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_plmn_route_selection_descriptor_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_set->allowed_route_sel_descs); + ue_policy_set->allowed_route_sel_descs = NULL; } - OpenAPI_list_free(ue_policy_set->allowed_route_sel_descs); - ogs_free(ue_policy_set->pei); - OpenAPI_list_for_each(ue_policy_set->os_ids, node) { - ogs_free(node->data); + if (ue_policy_set->pei) { + ogs_free(ue_policy_set->pei); + ue_policy_set->pei = NULL; + } + if (ue_policy_set->os_ids) { + OpenAPI_list_for_each(ue_policy_set->os_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set->os_ids); + ue_policy_set->os_ids = NULL; + } + if (ue_policy_set->supp_feat) { + ogs_free(ue_policy_set->supp_feat); + ue_policy_set->supp_feat = NULL; } - OpenAPI_list_free(ue_policy_set->os_ids); - ogs_free(ue_policy_set->supp_feat); ogs_free(ue_policy_set); } cJSON *OpenAPI_ue_policy_set_convertToJSON(OpenAPI_ue_policy_set_t *ue_policy_set) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_policy_set == NULL) { ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [UePolicySet]"); @@ -95,36 +121,33 @@ cJSON *OpenAPI_ue_policy_set_convertToJSON(OpenAPI_ue_policy_set_t *ue_policy_se goto end; } cJSON *localMapObject = pra_infos; - OpenAPI_lnode_t *pra_infos_node; if (ue_policy_set->pra_infos) { - OpenAPI_list_for_each(ue_policy_set->pra_infos, pra_infos_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_infos_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_presence_info_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ue_policy_set->pra_infos, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_presence_info_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (ue_policy_set->subsc_cats) { - cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats"); - if (subsc_cats == NULL) { + cJSON *subsc_catsList = cJSON_AddArrayToObject(item, "subscCats"); + if (subsc_catsList == NULL) { ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [subsc_cats]"); goto end; } - - OpenAPI_lnode_t *subsc_cats_node; - OpenAPI_list_for_each(ue_policy_set->subsc_cats, subsc_cats_node) { - if (cJSON_AddStringToObject(subsc_cats, "", (char*)subsc_cats_node->data) == NULL) { - ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [subsc_cats]"); - goto end; + OpenAPI_list_for_each(ue_policy_set->subsc_cats, node) { + if (cJSON_AddStringToObject(subsc_catsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [subsc_cats]"); + goto end; + } } - } } if (ue_policy_set->ue_policy_sections) { @@ -134,36 +157,33 @@ cJSON *OpenAPI_ue_policy_set_convertToJSON(OpenAPI_ue_policy_set_t *ue_policy_se goto end; } cJSON *localMapObject = ue_policy_sections; - OpenAPI_lnode_t *ue_policy_sections_node; if (ue_policy_set->ue_policy_sections) { - OpenAPI_list_for_each(ue_policy_set->ue_policy_sections, ue_policy_sections_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)ue_policy_sections_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_ue_policy_section_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ue_policy_set->ue_policy_sections, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_ue_policy_section_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (ue_policy_set->upsis) { - cJSON *upsis = cJSON_AddArrayToObject(item, "upsis"); - if (upsis == NULL) { + cJSON *upsisList = cJSON_AddArrayToObject(item, "upsis"); + if (upsisList == NULL) { ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [upsis]"); goto end; } - - OpenAPI_lnode_t *upsis_node; - OpenAPI_list_for_each(ue_policy_set->upsis, upsis_node) { - if (cJSON_AddStringToObject(upsis, "", (char*)upsis_node->data) == NULL) { - ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [upsis]"); - goto end; + OpenAPI_list_for_each(ue_policy_set->upsis, node) { + if (cJSON_AddStringToObject(upsisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [upsis]"); + goto end; + } } - } } if (ue_policy_set->allowed_route_sel_descs) { @@ -173,21 +193,20 @@ cJSON *OpenAPI_ue_policy_set_convertToJSON(OpenAPI_ue_policy_set_t *ue_policy_se goto end; } cJSON *localMapObject = allowed_route_sel_descs; - OpenAPI_lnode_t *allowed_route_sel_descs_node; if (ue_policy_set->allowed_route_sel_descs) { - OpenAPI_list_for_each(ue_policy_set->allowed_route_sel_descs, allowed_route_sel_descs_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)allowed_route_sel_descs_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_plmn_route_selection_descriptor_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ue_policy_set->allowed_route_sel_descs, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_plmn_route_selection_descriptor_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (ue_policy_set->is_andsp_ind) { if (cJSON_AddBoolToObject(item, "andspInd", ue_policy_set->andsp_ind) == NULL) { @@ -204,19 +223,17 @@ cJSON *OpenAPI_ue_policy_set_convertToJSON(OpenAPI_ue_policy_set_t *ue_policy_se } if (ue_policy_set->os_ids) { - cJSON *os_ids = cJSON_AddArrayToObject(item, "osIds"); - if (os_ids == NULL) { + cJSON *os_idsList = cJSON_AddArrayToObject(item, "osIds"); + if (os_idsList == NULL) { ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [os_ids]"); goto end; } - - OpenAPI_lnode_t *os_ids_node; - OpenAPI_list_for_each(ue_policy_set->os_ids, os_ids_node) { - if (cJSON_AddStringToObject(os_ids, "", (char*)os_ids_node->data) == NULL) { - ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [os_ids]"); - goto end; + OpenAPI_list_for_each(ue_policy_set->os_ids, node) { + if (cJSON_AddStringToObject(os_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_convertToJSON() failed [os_ids]"); + goto end; + } } - } } if (ue_policy_set->supp_feat) { @@ -233,126 +250,143 @@ end: OpenAPI_ue_policy_set_t *OpenAPI_ue_policy_set_parseFromJSON(cJSON *ue_policy_setJSON) { OpenAPI_ue_policy_set_t *ue_policy_set_local_var = NULL; - cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "praInfos"); - - OpenAPI_list_t *pra_infosList; + OpenAPI_lnode_t *node = NULL; + cJSON *pra_infos = NULL; + OpenAPI_list_t *pra_infosList = NULL; + cJSON *subsc_cats = NULL; + OpenAPI_list_t *subsc_catsList = NULL; + cJSON *ue_policy_sections = NULL; + OpenAPI_list_t *ue_policy_sectionsList = NULL; + cJSON *upsis = NULL; + OpenAPI_list_t *upsisList = NULL; + cJSON *allowed_route_sel_descs = NULL; + OpenAPI_list_t *allowed_route_sel_descsList = NULL; + cJSON *andsp_ind = NULL; + cJSON *pei = NULL; + cJSON *os_ids = NULL; + OpenAPI_list_t *os_idsList = NULL; + cJSON *supp_feat = NULL; + pra_infos = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "praInfos"); if (pra_infos) { - cJSON *pra_infos_local_map; - if (!cJSON_IsObject(pra_infos)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [pra_infos]"); - goto end; - } - pra_infosList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { - cJSON *localMapObject = pra_infos_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [inner]"); + cJSON *pra_infos_local_map = NULL; + if (!cJSON_IsObject(pra_infos) && !cJSON_IsNull(pra_infos)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [pra_infos]"); goto end; } - OpenAPI_list_add(pra_infosList, localMapKeyPair); - } + if (cJSON_IsObject(pra_infos)) { + pra_infosList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(pra_infos_local_map, pra_infos) { + cJSON *localMapObject = pra_infos_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(pra_infosList, localMapKeyPair); + } + } } - cJSON *subsc_cats = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "subscCats"); - - OpenAPI_list_t *subsc_catsList; + subsc_cats = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "subscCats"); if (subsc_cats) { - cJSON *subsc_cats_local; - if (!cJSON_IsArray(subsc_cats)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [subsc_cats]"); - goto end; - } - subsc_catsList = OpenAPI_list_create(); + cJSON *subsc_cats_local = NULL; + if (!cJSON_IsArray(subsc_cats)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [subsc_cats]"); + goto end; + } - cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { - if (!cJSON_IsString(subsc_cats_local)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [subsc_cats]"); - goto end; - } - OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); - } + subsc_catsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(subsc_cats_local, subsc_cats) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(subsc_cats_local)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [subsc_cats]"); + goto end; + } + OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring)); + } } - cJSON *ue_policy_sections = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "uePolicySections"); - - OpenAPI_list_t *ue_policy_sectionsList; + ue_policy_sections = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "uePolicySections"); if (ue_policy_sections) { - cJSON *ue_policy_sections_local_map; - if (!cJSON_IsObject(ue_policy_sections)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [ue_policy_sections]"); - goto end; - } - ue_policy_sectionsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(ue_policy_sections_local_map, ue_policy_sections) { - cJSON *localMapObject = ue_policy_sections_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_ue_policy_section_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [inner]"); + cJSON *ue_policy_sections_local_map = NULL; + if (!cJSON_IsObject(ue_policy_sections) && !cJSON_IsNull(ue_policy_sections)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [ue_policy_sections]"); goto end; } - OpenAPI_list_add(ue_policy_sectionsList, localMapKeyPair); - } + if (cJSON_IsObject(ue_policy_sections)) { + ue_policy_sectionsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(ue_policy_sections_local_map, ue_policy_sections) { + cJSON *localMapObject = ue_policy_sections_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_ue_policy_section_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(ue_policy_sectionsList, localMapKeyPair); + } + } } - cJSON *upsis = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "upsis"); - - OpenAPI_list_t *upsisList; + upsis = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "upsis"); if (upsis) { - cJSON *upsis_local; - if (!cJSON_IsArray(upsis)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [upsis]"); - goto end; - } - upsisList = OpenAPI_list_create(); - - cJSON_ArrayForEach(upsis_local, upsis) { - if (!cJSON_IsString(upsis_local)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [upsis]"); - goto end; - } - OpenAPI_list_add(upsisList, ogs_strdup(upsis_local->valuestring)); - } - } - - cJSON *allowed_route_sel_descs = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "allowedRouteSelDescs"); - - OpenAPI_list_t *allowed_route_sel_descsList; - if (allowed_route_sel_descs) { - cJSON *allowed_route_sel_descs_local_map; - if (!cJSON_IsObject(allowed_route_sel_descs)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [allowed_route_sel_descs]"); - goto end; - } - allowed_route_sel_descsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(allowed_route_sel_descs_local_map, allowed_route_sel_descs) { - cJSON *localMapObject = allowed_route_sel_descs_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_plmn_route_selection_descriptor_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [inner]"); + cJSON *upsis_local = NULL; + if (!cJSON_IsArray(upsis)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [upsis]"); goto end; } - OpenAPI_list_add(allowed_route_sel_descsList, localMapKeyPair); - } + + upsisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(upsis_local, upsis) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(upsis_local)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [upsis]"); + goto end; + } + OpenAPI_list_add(upsisList, ogs_strdup(upsis_local->valuestring)); + } } - cJSON *andsp_ind = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "andspInd"); + allowed_route_sel_descs = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "allowedRouteSelDescs"); + if (allowed_route_sel_descs) { + cJSON *allowed_route_sel_descs_local_map = NULL; + if (!cJSON_IsObject(allowed_route_sel_descs) && !cJSON_IsNull(allowed_route_sel_descs)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [allowed_route_sel_descs]"); + goto end; + } + if (cJSON_IsObject(allowed_route_sel_descs)) { + allowed_route_sel_descsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(allowed_route_sel_descs_local_map, allowed_route_sel_descs) { + cJSON *localMapObject = allowed_route_sel_descs_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_plmn_route_selection_descriptor_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(allowed_route_sel_descsList, localMapKeyPair); + } + } + } + andsp_ind = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "andspInd"); if (andsp_ind) { if (!cJSON_IsBool(andsp_ind)) { ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [andsp_ind]"); @@ -360,39 +394,38 @@ OpenAPI_ue_policy_set_t *OpenAPI_ue_policy_set_parseFromJSON(cJSON *ue_policy_se } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [pei]"); goto end; } } - cJSON *os_ids = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "osIds"); - - OpenAPI_list_t *os_idsList; + os_ids = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "osIds"); if (os_ids) { - cJSON *os_ids_local; - if (!cJSON_IsArray(os_ids)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [os_ids]"); - goto end; - } - os_idsList = OpenAPI_list_create(); + cJSON *os_ids_local = NULL; + if (!cJSON_IsArray(os_ids)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [os_ids]"); + goto end; + } - cJSON_ArrayForEach(os_ids_local, os_ids) { - if (!cJSON_IsString(os_ids_local)) { - ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [os_ids]"); - goto end; - } - OpenAPI_list_add(os_idsList, ogs_strdup(os_ids_local->valuestring)); - } + os_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(os_ids_local, os_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(os_ids_local)) { + ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [os_ids]"); + goto end; + } + OpenAPI_list_add(os_idsList, ogs_strdup(os_ids_local->valuestring)); + } } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(ue_policy_setJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_ue_policy_set_parseFromJSON() failed [supp_feat]"); goto end; } @@ -406,13 +439,64 @@ OpenAPI_ue_policy_set_t *OpenAPI_ue_policy_set_parseFromJSON(cJSON *ue_policy_se allowed_route_sel_descs ? allowed_route_sel_descsList : NULL, andsp_ind ? true : false, andsp_ind ? andsp_ind->valueint : 0, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, os_ids ? os_idsList : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return ue_policy_set_local_var; end: + if (pra_infosList) { + OpenAPI_list_for_each(pra_infosList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_presence_info_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(pra_infosList); + pra_infosList = NULL; + } + if (subsc_catsList) { + OpenAPI_list_for_each(subsc_catsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(subsc_catsList); + subsc_catsList = NULL; + } + if (ue_policy_sectionsList) { + OpenAPI_list_for_each(ue_policy_sectionsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_ue_policy_section_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_sectionsList); + ue_policy_sectionsList = NULL; + } + if (upsisList) { + OpenAPI_list_for_each(upsisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(upsisList); + upsisList = NULL; + } + if (allowed_route_sel_descsList) { + OpenAPI_list_for_each(allowed_route_sel_descsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_plmn_route_selection_descriptor_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(allowed_route_sel_descsList); + allowed_route_sel_descsList = NULL; + } + if (os_idsList) { + OpenAPI_list_for_each(os_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(os_idsList); + os_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_policy_set_patch.c b/lib/sbi/openapi/model/ue_policy_set_patch.c index 290dde049..2357ffceb 100644 --- a/lib/sbi/openapi/model/ue_policy_set_patch.c +++ b/lib/sbi/openapi/model/ue_policy_set_patch.c @@ -28,32 +28,46 @@ OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_create( void OpenAPI_ue_policy_set_patch_free(OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_policy_set_patch) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ue_policy_set_patch->ue_policy_sections, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_ue_policy_section_free(localKeyValue->value); - ogs_free(localKeyValue); + if (ue_policy_set_patch->ue_policy_sections) { + OpenAPI_list_for_each(ue_policy_set_patch->ue_policy_sections, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_ue_policy_section_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_set_patch->ue_policy_sections); + ue_policy_set_patch->ue_policy_sections = NULL; } - OpenAPI_list_free(ue_policy_set_patch->ue_policy_sections); - OpenAPI_list_for_each(ue_policy_set_patch->upsis, node) { - ogs_free(node->data); + if (ue_policy_set_patch->upsis) { + OpenAPI_list_for_each(ue_policy_set_patch->upsis, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set_patch->upsis); + ue_policy_set_patch->upsis = NULL; } - OpenAPI_list_free(ue_policy_set_patch->upsis); - ogs_free(ue_policy_set_patch->pei); - OpenAPI_list_for_each(ue_policy_set_patch->os_ids, node) { - ogs_free(node->data); + if (ue_policy_set_patch->pei) { + ogs_free(ue_policy_set_patch->pei); + ue_policy_set_patch->pei = NULL; + } + if (ue_policy_set_patch->os_ids) { + OpenAPI_list_for_each(ue_policy_set_patch->os_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_policy_set_patch->os_ids); + ue_policy_set_patch->os_ids = NULL; } - OpenAPI_list_free(ue_policy_set_patch->os_ids); ogs_free(ue_policy_set_patch); } cJSON *OpenAPI_ue_policy_set_patch_convertToJSON(OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_policy_set_patch == NULL) { ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [UePolicySetPatch]"); @@ -68,36 +82,33 @@ cJSON *OpenAPI_ue_policy_set_patch_convertToJSON(OpenAPI_ue_policy_set_patch_t * goto end; } cJSON *localMapObject = ue_policy_sections; - OpenAPI_lnode_t *ue_policy_sections_node; if (ue_policy_set_patch->ue_policy_sections) { - OpenAPI_list_for_each(ue_policy_set_patch->ue_policy_sections, ue_policy_sections_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)ue_policy_sections_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_ue_policy_section_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(ue_policy_set_patch->ue_policy_sections, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_ue_policy_section_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (ue_policy_set_patch->upsis) { - cJSON *upsis = cJSON_AddArrayToObject(item, "upsis"); - if (upsis == NULL) { + cJSON *upsisList = cJSON_AddArrayToObject(item, "upsis"); + if (upsisList == NULL) { ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [upsis]"); goto end; } - - OpenAPI_lnode_t *upsis_node; - OpenAPI_list_for_each(ue_policy_set_patch->upsis, upsis_node) { - if (cJSON_AddStringToObject(upsis, "", (char*)upsis_node->data) == NULL) { - ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [upsis]"); - goto end; + OpenAPI_list_for_each(ue_policy_set_patch->upsis, node) { + if (cJSON_AddStringToObject(upsisList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [upsis]"); + goto end; + } } - } } if (ue_policy_set_patch->is_andsp_ind) { @@ -115,19 +126,17 @@ cJSON *OpenAPI_ue_policy_set_patch_convertToJSON(OpenAPI_ue_policy_set_patch_t * } if (ue_policy_set_patch->os_ids) { - cJSON *os_ids = cJSON_AddArrayToObject(item, "osIds"); - if (os_ids == NULL) { + cJSON *os_idsList = cJSON_AddArrayToObject(item, "osIds"); + if (os_idsList == NULL) { ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [os_ids]"); goto end; } - - OpenAPI_lnode_t *os_ids_node; - OpenAPI_list_for_each(ue_policy_set_patch->os_ids, os_ids_node) { - if (cJSON_AddStringToObject(os_ids, "", (char*)os_ids_node->data) == NULL) { - ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [os_ids]"); - goto end; + OpenAPI_list_for_each(ue_policy_set_patch->os_ids, node) { + if (cJSON_AddStringToObject(os_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_ue_policy_set_patch_convertToJSON() failed [os_ids]"); + goto end; + } } - } } end: @@ -137,54 +146,63 @@ end: OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON *ue_policy_set_patchJSON) { OpenAPI_ue_policy_set_patch_t *ue_policy_set_patch_local_var = NULL; - cJSON *ue_policy_sections = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "uePolicySections"); - - OpenAPI_list_t *ue_policy_sectionsList; + OpenAPI_lnode_t *node = NULL; + cJSON *ue_policy_sections = NULL; + OpenAPI_list_t *ue_policy_sectionsList = NULL; + cJSON *upsis = NULL; + OpenAPI_list_t *upsisList = NULL; + cJSON *andsp_ind = NULL; + cJSON *pei = NULL; + cJSON *os_ids = NULL; + OpenAPI_list_t *os_idsList = NULL; + ue_policy_sections = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "uePolicySections"); if (ue_policy_sections) { - cJSON *ue_policy_sections_local_map; - if (!cJSON_IsObject(ue_policy_sections)) { - ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [ue_policy_sections]"); - goto end; - } - ue_policy_sectionsList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(ue_policy_sections_local_map, ue_policy_sections) { - cJSON *localMapObject = ue_policy_sections_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_ue_policy_section_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [inner]"); + cJSON *ue_policy_sections_local_map = NULL; + if (!cJSON_IsObject(ue_policy_sections) && !cJSON_IsNull(ue_policy_sections)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [ue_policy_sections]"); goto end; } - OpenAPI_list_add(ue_policy_sectionsList, localMapKeyPair); - } + if (cJSON_IsObject(ue_policy_sections)) { + ue_policy_sectionsList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(ue_policy_sections_local_map, ue_policy_sections) { + cJSON *localMapObject = ue_policy_sections_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_ue_policy_section_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(ue_policy_sectionsList, localMapKeyPair); + } + } } - cJSON *upsis = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "upsis"); - - OpenAPI_list_t *upsisList; + upsis = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "upsis"); if (upsis) { - cJSON *upsis_local; - if (!cJSON_IsArray(upsis)) { - ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [upsis]"); - goto end; - } - upsisList = OpenAPI_list_create(); + cJSON *upsis_local = NULL; + if (!cJSON_IsArray(upsis)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [upsis]"); + goto end; + } - cJSON_ArrayForEach(upsis_local, upsis) { - if (!cJSON_IsString(upsis_local)) { - ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [upsis]"); - goto end; - } - OpenAPI_list_add(upsisList, ogs_strdup(upsis_local->valuestring)); - } + upsisList = OpenAPI_list_create(); + + cJSON_ArrayForEach(upsis_local, upsis) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(upsis_local)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [upsis]"); + goto end; + } + OpenAPI_list_add(upsisList, ogs_strdup(upsis_local->valuestring)); + } } - cJSON *andsp_ind = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "andspInd"); - + andsp_ind = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "andspInd"); if (andsp_ind) { if (!cJSON_IsBool(andsp_ind)) { ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [andsp_ind]"); @@ -192,33 +210,33 @@ OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON * } } - cJSON *pei = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "pei"); - + pei = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "pei"); if (pei) { - if (!cJSON_IsString(pei)) { + if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) { ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [pei]"); goto end; } } - cJSON *os_ids = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "osIds"); - - OpenAPI_list_t *os_idsList; + os_ids = cJSON_GetObjectItemCaseSensitive(ue_policy_set_patchJSON, "osIds"); if (os_ids) { - cJSON *os_ids_local; - if (!cJSON_IsArray(os_ids)) { - ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [os_ids]"); - goto end; - } - os_idsList = OpenAPI_list_create(); + cJSON *os_ids_local = NULL; + if (!cJSON_IsArray(os_ids)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [os_ids]"); + goto end; + } - cJSON_ArrayForEach(os_ids_local, os_ids) { - if (!cJSON_IsString(os_ids_local)) { - ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [os_ids]"); - goto end; - } - OpenAPI_list_add(os_idsList, ogs_strdup(os_ids_local->valuestring)); - } + os_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(os_ids_local, os_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(os_ids_local)) { + ogs_error("OpenAPI_ue_policy_set_patch_parseFromJSON() failed [os_ids]"); + goto end; + } + OpenAPI_list_add(os_idsList, ogs_strdup(os_ids_local->valuestring)); + } } ue_policy_set_patch_local_var = OpenAPI_ue_policy_set_patch_create ( @@ -226,12 +244,36 @@ OpenAPI_ue_policy_set_patch_t *OpenAPI_ue_policy_set_patch_parseFromJSON(cJSON * upsis ? upsisList : NULL, andsp_ind ? true : false, andsp_ind ? andsp_ind->valueint : 0, - pei ? ogs_strdup(pei->valuestring) : NULL, + pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL, os_ids ? os_idsList : NULL ); return ue_policy_set_patch_local_var; end: + if (ue_policy_sectionsList) { + OpenAPI_list_for_each(ue_policy_sectionsList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_ue_policy_section_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(ue_policy_sectionsList); + ue_policy_sectionsList = NULL; + } + if (upsisList) { + OpenAPI_list_for_each(upsisList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(upsisList); + upsisList = NULL; + } + if (os_idsList) { + OpenAPI_list_for_each(os_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(os_idsList); + os_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_reachability.c b/lib/sbi/openapi/model/ue_reachability.c index ab3860160..08828e6ea 100644 --- a/lib/sbi/openapi/model/ue_reachability.c +++ b/lib/sbi/openapi/model/ue_reachability.c @@ -16,16 +16,18 @@ OpenAPI_ue_reachability_t *OpenAPI_ue_reachability_create( void OpenAPI_ue_reachability_free(OpenAPI_ue_reachability_t *ue_reachability) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_reachability) { return; } - OpenAPI_lnode_t *node; ogs_free(ue_reachability); } cJSON *OpenAPI_ue_reachability_convertToJSON(OpenAPI_ue_reachability_t *ue_reachability) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_reachability == NULL) { ogs_error("OpenAPI_ue_reachability_convertToJSON() failed [UeReachability]"); @@ -40,6 +42,7 @@ end: OpenAPI_ue_reachability_t *OpenAPI_ue_reachability_parseFromJSON(cJSON *ue_reachabilityJSON) { OpenAPI_ue_reachability_t *ue_reachability_local_var = NULL; + OpenAPI_lnode_t *node = NULL; ue_reachability_local_var = OpenAPI_ue_reachability_create ( ); diff --git a/lib/sbi/openapi/model/ue_reg_status_update_req_data.c b/lib/sbi/openapi/model/ue_reg_status_update_req_data.c index 23c57d3f9..f8b568678 100644 --- a/lib/sbi/openapi/model/ue_reg_status_update_req_data.c +++ b/lib/sbi/openapi/model/ue_reg_status_update_req_data.c @@ -26,24 +26,32 @@ OpenAPI_ue_reg_status_update_req_data_t *OpenAPI_ue_reg_status_update_req_data_c void OpenAPI_ue_reg_status_update_req_data_free(OpenAPI_ue_reg_status_update_req_data_t *ue_reg_status_update_req_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_reg_status_update_req_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(ue_reg_status_update_req_data->to_release_session_list, node) { - ogs_free(node->data); + if (ue_reg_status_update_req_data->to_release_session_list) { + OpenAPI_list_for_each(ue_reg_status_update_req_data->to_release_session_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ue_reg_status_update_req_data->to_release_session_list); + ue_reg_status_update_req_data->to_release_session_list = NULL; } - OpenAPI_list_free(ue_reg_status_update_req_data->to_release_session_list); - OpenAPI_list_for_each(ue_reg_status_update_req_data->smf_change_info_list, node) { - OpenAPI_smf_change_info_free(node->data); + if (ue_reg_status_update_req_data->smf_change_info_list) { + OpenAPI_list_for_each(ue_reg_status_update_req_data->smf_change_info_list, node) { + OpenAPI_smf_change_info_free(node->data); + } + OpenAPI_list_free(ue_reg_status_update_req_data->smf_change_info_list); + ue_reg_status_update_req_data->smf_change_info_list = NULL; } - OpenAPI_list_free(ue_reg_status_update_req_data->smf_change_info_list); ogs_free(ue_reg_status_update_req_data); } cJSON *OpenAPI_ue_reg_status_update_req_data_convertToJSON(OpenAPI_ue_reg_status_update_req_data_t *ue_reg_status_update_req_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_reg_status_update_req_data == NULL) { ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [UeRegStatusUpdateReqData]"); @@ -51,25 +59,27 @@ cJSON *OpenAPI_ue_reg_status_update_req_data_convertToJSON(OpenAPI_ue_reg_status } item = cJSON_CreateObject(); + if (ue_reg_status_update_req_data->transfer_status == OpenAPI_ue_context_transfer_status_NULL) { + ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [transfer_status]"); + return NULL; + } if (cJSON_AddStringToObject(item, "transferStatus", OpenAPI_ue_context_transfer_status_ToString(ue_reg_status_update_req_data->transfer_status)) == NULL) { ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [transfer_status]"); goto end; } if (ue_reg_status_update_req_data->to_release_session_list) { - cJSON *to_release_session_list = cJSON_AddArrayToObject(item, "toReleaseSessionList"); - if (to_release_session_list == NULL) { + cJSON *to_release_session_listList = cJSON_AddArrayToObject(item, "toReleaseSessionList"); + if (to_release_session_listList == NULL) { ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [to_release_session_list]"); goto end; } - - OpenAPI_lnode_t *to_release_session_list_node; - OpenAPI_list_for_each(ue_reg_status_update_req_data->to_release_session_list, to_release_session_list_node) { - if (cJSON_AddNumberToObject(to_release_session_list, "", *(double *)to_release_session_list_node->data) == NULL) { - ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [to_release_session_list]"); - goto end; + OpenAPI_list_for_each(ue_reg_status_update_req_data->to_release_session_list, node) { + if (cJSON_AddNumberToObject(to_release_session_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [to_release_session_list]"); + goto end; + } } - } } if (ue_reg_status_update_req_data->is_pcf_reselected_ind) { @@ -85,17 +95,13 @@ cJSON *OpenAPI_ue_reg_status_update_req_data_convertToJSON(OpenAPI_ue_reg_status ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [smf_change_info_list]"); goto end; } - - OpenAPI_lnode_t *smf_change_info_list_node; - if (ue_reg_status_update_req_data->smf_change_info_list) { - OpenAPI_list_for_each(ue_reg_status_update_req_data->smf_change_info_list, smf_change_info_list_node) { - cJSON *itemLocal = OpenAPI_smf_change_info_convertToJSON(smf_change_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [smf_change_info_list]"); - goto end; - } - cJSON_AddItemToArray(smf_change_info_listList, itemLocal); + OpenAPI_list_for_each(ue_reg_status_update_req_data->smf_change_info_list, node) { + cJSON *itemLocal = OpenAPI_smf_change_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_ue_reg_status_update_req_data_convertToJSON() failed [smf_change_info_list]"); + goto end; } + cJSON_AddItemToArray(smf_change_info_listList, itemLocal); } } @@ -106,41 +112,53 @@ end: OpenAPI_ue_reg_status_update_req_data_t *OpenAPI_ue_reg_status_update_req_data_parseFromJSON(cJSON *ue_reg_status_update_req_dataJSON) { OpenAPI_ue_reg_status_update_req_data_t *ue_reg_status_update_req_data_local_var = NULL; - cJSON *transfer_status = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_req_dataJSON, "transferStatus"); + OpenAPI_lnode_t *node = NULL; + cJSON *transfer_status = NULL; + OpenAPI_ue_context_transfer_status_e transfer_statusVariable = 0; + cJSON *to_release_session_list = NULL; + OpenAPI_list_t *to_release_session_listList = NULL; + cJSON *pcf_reselected_ind = NULL; + cJSON *smf_change_info_list = NULL; + OpenAPI_list_t *smf_change_info_listList = NULL; + transfer_status = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_req_dataJSON, "transferStatus"); if (!transfer_status) { ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [transfer_status]"); goto end; } - - OpenAPI_ue_context_transfer_status_e transfer_statusVariable; if (!cJSON_IsString(transfer_status)) { ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [transfer_status]"); goto end; } transfer_statusVariable = OpenAPI_ue_context_transfer_status_FromString(transfer_status->valuestring); - cJSON *to_release_session_list = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_req_dataJSON, "toReleaseSessionList"); - - OpenAPI_list_t *to_release_session_listList; + to_release_session_list = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_req_dataJSON, "toReleaseSessionList"); if (to_release_session_list) { - cJSON *to_release_session_list_local; - if (!cJSON_IsArray(to_release_session_list)) { - ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [to_release_session_list]"); - goto end; - } - to_release_session_listList = OpenAPI_list_create(); + cJSON *to_release_session_list_local = NULL; + if (!cJSON_IsArray(to_release_session_list)) { + ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [to_release_session_list]"); + goto end; + } - cJSON_ArrayForEach(to_release_session_list_local, to_release_session_list) { - if (!cJSON_IsNumber(to_release_session_list_local)) { - ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [to_release_session_list]"); - goto end; - } - OpenAPI_list_add(to_release_session_listList, &to_release_session_list_local->valuedouble); - } + to_release_session_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(to_release_session_list_local, to_release_session_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(to_release_session_list_local)) { + ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [to_release_session_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [to_release_session_list]"); + goto end; + } + *localDouble = to_release_session_list_local->valuedouble; + OpenAPI_list_add(to_release_session_listList, localDouble); + } } - cJSON *pcf_reselected_ind = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_req_dataJSON, "pcfReselectedInd"); - + pcf_reselected_ind = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_req_dataJSON, "pcfReselectedInd"); if (pcf_reselected_ind) { if (!cJSON_IsBool(pcf_reselected_ind)) { ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [pcf_reselected_ind]"); @@ -148,33 +166,29 @@ OpenAPI_ue_reg_status_update_req_data_t *OpenAPI_ue_reg_status_update_req_data_p } } - cJSON *smf_change_info_list = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_req_dataJSON, "smfChangeInfoList"); - - OpenAPI_list_t *smf_change_info_listList; + smf_change_info_list = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_req_dataJSON, "smfChangeInfoList"); if (smf_change_info_list) { - cJSON *smf_change_info_list_local_nonprimitive; - if (!cJSON_IsArray(smf_change_info_list)){ - ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [smf_change_info_list]"); - goto end; - } - - smf_change_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(smf_change_info_list_local_nonprimitive, smf_change_info_list ) { - if (!cJSON_IsObject(smf_change_info_list_local_nonprimitive)) { + cJSON *smf_change_info_list_local = NULL; + if (!cJSON_IsArray(smf_change_info_list)) { ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [smf_change_info_list]"); goto end; } - OpenAPI_smf_change_info_t *smf_change_info_listItem = OpenAPI_smf_change_info_parseFromJSON(smf_change_info_list_local_nonprimitive); - if (!smf_change_info_listItem) { - ogs_error("No smf_change_info_listItem"); - OpenAPI_list_free(smf_change_info_listList); - goto end; + smf_change_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_change_info_list_local, smf_change_info_list) { + if (!cJSON_IsObject(smf_change_info_list_local)) { + ogs_error("OpenAPI_ue_reg_status_update_req_data_parseFromJSON() failed [smf_change_info_list]"); + goto end; + } + OpenAPI_smf_change_info_t *smf_change_info_listItem = OpenAPI_smf_change_info_parseFromJSON(smf_change_info_list_local); + if (!smf_change_info_listItem) { + ogs_error("No smf_change_info_listItem"); + OpenAPI_list_free(smf_change_info_listList); + goto end; + } + OpenAPI_list_add(smf_change_info_listList, smf_change_info_listItem); } - - OpenAPI_list_add(smf_change_info_listList, smf_change_info_listItem); - } } ue_reg_status_update_req_data_local_var = OpenAPI_ue_reg_status_update_req_data_create ( @@ -187,6 +201,20 @@ OpenAPI_ue_reg_status_update_req_data_t *OpenAPI_ue_reg_status_update_req_data_p return ue_reg_status_update_req_data_local_var; end: + if (to_release_session_listList) { + OpenAPI_list_for_each(to_release_session_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(to_release_session_listList); + to_release_session_listList = NULL; + } + if (smf_change_info_listList) { + OpenAPI_list_for_each(smf_change_info_listList, node) { + OpenAPI_smf_change_info_free(node->data); + } + OpenAPI_list_free(smf_change_info_listList); + smf_change_info_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/ue_reg_status_update_rsp_data.c b/lib/sbi/openapi/model/ue_reg_status_update_rsp_data.c index 764e55f45..f7cf92458 100644 --- a/lib/sbi/openapi/model/ue_reg_status_update_rsp_data.c +++ b/lib/sbi/openapi/model/ue_reg_status_update_rsp_data.c @@ -18,16 +18,18 @@ OpenAPI_ue_reg_status_update_rsp_data_t *OpenAPI_ue_reg_status_update_rsp_data_c void OpenAPI_ue_reg_status_update_rsp_data_free(OpenAPI_ue_reg_status_update_rsp_data_t *ue_reg_status_update_rsp_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ue_reg_status_update_rsp_data) { return; } - OpenAPI_lnode_t *node; ogs_free(ue_reg_status_update_rsp_data); } cJSON *OpenAPI_ue_reg_status_update_rsp_data_convertToJSON(OpenAPI_ue_reg_status_update_rsp_data_t *ue_reg_status_update_rsp_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ue_reg_status_update_rsp_data == NULL) { ogs_error("OpenAPI_ue_reg_status_update_rsp_data_convertToJSON() failed [UeRegStatusUpdateRspData]"); @@ -47,12 +49,13 @@ end: OpenAPI_ue_reg_status_update_rsp_data_t *OpenAPI_ue_reg_status_update_rsp_data_parseFromJSON(cJSON *ue_reg_status_update_rsp_dataJSON) { OpenAPI_ue_reg_status_update_rsp_data_t *ue_reg_status_update_rsp_data_local_var = NULL; - cJSON *reg_status_transfer_complete = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_rsp_dataJSON, "regStatusTransferComplete"); + OpenAPI_lnode_t *node = NULL; + cJSON *reg_status_transfer_complete = NULL; + reg_status_transfer_complete = cJSON_GetObjectItemCaseSensitive(ue_reg_status_update_rsp_dataJSON, "regStatusTransferComplete"); if (!reg_status_transfer_complete) { ogs_error("OpenAPI_ue_reg_status_update_rsp_data_parseFromJSON() failed [reg_status_transfer_complete]"); goto end; } - if (!cJSON_IsBool(reg_status_transfer_complete)) { ogs_error("OpenAPI_ue_reg_status_update_rsp_data_parseFromJSON() failed [reg_status_transfer_complete]"); goto end; diff --git a/lib/sbi/openapi/model/ulcl_bp_information.c b/lib/sbi/openapi/model/ulcl_bp_information.c index feeb69011..0a5f8fd7f 100644 --- a/lib/sbi/openapi/model/ulcl_bp_information.c +++ b/lib/sbi/openapi/model/ulcl_bp_information.c @@ -18,17 +18,22 @@ OpenAPI_ulcl_bp_information_t *OpenAPI_ulcl_bp_information_create( void OpenAPI_ulcl_bp_information_free(OpenAPI_ulcl_bp_information_t *ulcl_bp_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == ulcl_bp_information) { return; } - OpenAPI_lnode_t *node; - ogs_free(ulcl_bp_information->ulcl_bp_upf_id); + if (ulcl_bp_information->ulcl_bp_upf_id) { + ogs_free(ulcl_bp_information->ulcl_bp_upf_id); + ulcl_bp_information->ulcl_bp_upf_id = NULL; + } ogs_free(ulcl_bp_information); } cJSON *OpenAPI_ulcl_bp_information_convertToJSON(OpenAPI_ulcl_bp_information_t *ulcl_bp_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (ulcl_bp_information == NULL) { ogs_error("OpenAPI_ulcl_bp_information_convertToJSON() failed [UlclBpInformation]"); @@ -50,17 +55,18 @@ end: OpenAPI_ulcl_bp_information_t *OpenAPI_ulcl_bp_information_parseFromJSON(cJSON *ulcl_bp_informationJSON) { OpenAPI_ulcl_bp_information_t *ulcl_bp_information_local_var = NULL; - cJSON *ulcl_bp_upf_id = cJSON_GetObjectItemCaseSensitive(ulcl_bp_informationJSON, "ulclBpUpfId"); - + OpenAPI_lnode_t *node = NULL; + cJSON *ulcl_bp_upf_id = NULL; + ulcl_bp_upf_id = cJSON_GetObjectItemCaseSensitive(ulcl_bp_informationJSON, "ulclBpUpfId"); if (ulcl_bp_upf_id) { - if (!cJSON_IsString(ulcl_bp_upf_id)) { + if (!cJSON_IsString(ulcl_bp_upf_id) && !cJSON_IsNull(ulcl_bp_upf_id)) { ogs_error("OpenAPI_ulcl_bp_information_parseFromJSON() failed [ulcl_bp_upf_id]"); goto end; } } ulcl_bp_information_local_var = OpenAPI_ulcl_bp_information_create ( - ulcl_bp_upf_id ? ogs_strdup(ulcl_bp_upf_id->valuestring) : NULL + ulcl_bp_upf_id && !cJSON_IsNull(ulcl_bp_upf_id) ? ogs_strdup(ulcl_bp_upf_id->valuestring) : NULL ); return ulcl_bp_information_local_var; diff --git a/lib/sbi/openapi/model/unavailable_access_indication.c b/lib/sbi/openapi/model/unavailable_access_indication.c index 3957c0a46..2b7d0539c 100644 --- a/lib/sbi/openapi/model/unavailable_access_indication.c +++ b/lib/sbi/openapi/model/unavailable_access_indication.c @@ -6,7 +6,7 @@ char* OpenAPI_unavailable_access_indication_ToString(OpenAPI_unavailable_access_indication_e unavailable_access_indication) { - const char *unavailable_access_indicationArray[] = { "NULL", "_3GA_UNAVAILABLE", "N3GA_UNAVAILABLE" }; + const char *unavailable_access_indicationArray[] = { "NULL", "3GA_UNAVAILABLE", "N3GA_UNAVAILABLE" }; size_t sizeofArray = sizeof(unavailable_access_indicationArray) / sizeof(unavailable_access_indicationArray[0]); if (unavailable_access_indication < sizeofArray) return (char *)unavailable_access_indicationArray[unavailable_access_indication]; @@ -17,7 +17,7 @@ char* OpenAPI_unavailable_access_indication_ToString(OpenAPI_unavailable_access_ OpenAPI_unavailable_access_indication_e OpenAPI_unavailable_access_indication_FromString(char* unavailable_access_indication) { int stringToReturn = 0; - const char *unavailable_access_indicationArray[] = { "NULL", "_3GA_UNAVAILABLE", "N3GA_UNAVAILABLE" }; + const char *unavailable_access_indicationArray[] = { "NULL", "3GA_UNAVAILABLE", "N3GA_UNAVAILABLE" }; size_t sizeofArray = sizeof(unavailable_access_indicationArray) / sizeof(unavailable_access_indicationArray[0]); while (stringToReturn < sizeofArray) { if (strcmp(unavailable_access_indication, unavailable_access_indicationArray[stringToReturn]) == 0) { diff --git a/lib/sbi/openapi/model/uncertainty_ellipse.c b/lib/sbi/openapi/model/uncertainty_ellipse.c index 3962bb6bd..2db3d58bf 100644 --- a/lib/sbi/openapi/model/uncertainty_ellipse.c +++ b/lib/sbi/openapi/model/uncertainty_ellipse.c @@ -22,16 +22,18 @@ OpenAPI_uncertainty_ellipse_t *OpenAPI_uncertainty_ellipse_create( void OpenAPI_uncertainty_ellipse_free(OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse) { + OpenAPI_lnode_t *node = NULL; + if (NULL == uncertainty_ellipse) { return; } - OpenAPI_lnode_t *node; ogs_free(uncertainty_ellipse); } cJSON *OpenAPI_uncertainty_ellipse_convertToJSON(OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (uncertainty_ellipse == NULL) { ogs_error("OpenAPI_uncertainty_ellipse_convertToJSON() failed [UncertaintyEllipse]"); @@ -61,34 +63,35 @@ end: OpenAPI_uncertainty_ellipse_t *OpenAPI_uncertainty_ellipse_parseFromJSON(cJSON *uncertainty_ellipseJSON) { OpenAPI_uncertainty_ellipse_t *uncertainty_ellipse_local_var = NULL; - cJSON *semi_major = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "semiMajor"); + OpenAPI_lnode_t *node = NULL; + cJSON *semi_major = NULL; + cJSON *semi_minor = NULL; + cJSON *orientation_major = NULL; + semi_major = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "semiMajor"); if (!semi_major) { ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [semi_major]"); goto end; } - if (!cJSON_IsNumber(semi_major)) { ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [semi_major]"); goto end; } - cJSON *semi_minor = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "semiMinor"); + semi_minor = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "semiMinor"); if (!semi_minor) { ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [semi_minor]"); goto end; } - if (!cJSON_IsNumber(semi_minor)) { ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [semi_minor]"); goto end; } - cJSON *orientation_major = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "orientationMajor"); + orientation_major = cJSON_GetObjectItemCaseSensitive(uncertainty_ellipseJSON, "orientationMajor"); if (!orientation_major) { ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [orientation_major]"); goto end; } - if (!cJSON_IsNumber(orientation_major)) { ogs_error("OpenAPI_uncertainty_ellipse_parseFromJSON() failed [orientation_major]"); goto end; diff --git a/lib/sbi/openapi/model/unrelated_class.c b/lib/sbi/openapi/model/unrelated_class.c index e6ec87c5f..d403a8513 100644 --- a/lib/sbi/openapi/model/unrelated_class.c +++ b/lib/sbi/openapi/model/unrelated_class.c @@ -22,22 +22,33 @@ OpenAPI_unrelated_class_t *OpenAPI_unrelated_class_create( void OpenAPI_unrelated_class_free(OpenAPI_unrelated_class_t *unrelated_class) { + OpenAPI_lnode_t *node = NULL; + if (NULL == unrelated_class) { return; } - OpenAPI_lnode_t *node; - OpenAPI_default_unrelated_class_free(unrelated_class->default_unrelated_class); - OpenAPI_external_unrelated_class_free(unrelated_class->external_unrelated_class); - OpenAPI_list_for_each(unrelated_class->service_type_unrelated_classes, node) { - OpenAPI_service_type_unrelated_class_free(node->data); + if (unrelated_class->default_unrelated_class) { + OpenAPI_default_unrelated_class_free(unrelated_class->default_unrelated_class); + unrelated_class->default_unrelated_class = NULL; + } + if (unrelated_class->external_unrelated_class) { + OpenAPI_external_unrelated_class_free(unrelated_class->external_unrelated_class); + unrelated_class->external_unrelated_class = NULL; + } + if (unrelated_class->service_type_unrelated_classes) { + OpenAPI_list_for_each(unrelated_class->service_type_unrelated_classes, node) { + OpenAPI_service_type_unrelated_class_free(node->data); + } + OpenAPI_list_free(unrelated_class->service_type_unrelated_classes); + unrelated_class->service_type_unrelated_classes = NULL; } - OpenAPI_list_free(unrelated_class->service_type_unrelated_classes); ogs_free(unrelated_class); } cJSON *OpenAPI_unrelated_class_convertToJSON(OpenAPI_unrelated_class_t *unrelated_class) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (unrelated_class == NULL) { ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [UnrelatedClass]"); @@ -45,6 +56,10 @@ cJSON *OpenAPI_unrelated_class_convertToJSON(OpenAPI_unrelated_class_t *unrelate } item = cJSON_CreateObject(); + if (!unrelated_class->default_unrelated_class) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [default_unrelated_class]"); + return NULL; + } cJSON *default_unrelated_class_local_JSON = OpenAPI_default_unrelated_class_convertToJSON(unrelated_class->default_unrelated_class); if (default_unrelated_class_local_JSON == NULL) { ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [default_unrelated_class]"); @@ -75,17 +90,13 @@ cJSON *OpenAPI_unrelated_class_convertToJSON(OpenAPI_unrelated_class_t *unrelate ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [service_type_unrelated_classes]"); goto end; } - - OpenAPI_lnode_t *service_type_unrelated_classes_node; - if (unrelated_class->service_type_unrelated_classes) { - OpenAPI_list_for_each(unrelated_class->service_type_unrelated_classes, service_type_unrelated_classes_node) { - cJSON *itemLocal = OpenAPI_service_type_unrelated_class_convertToJSON(service_type_unrelated_classes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [service_type_unrelated_classes]"); - goto end; - } - cJSON_AddItemToArray(service_type_unrelated_classesList, itemLocal); + OpenAPI_list_for_each(unrelated_class->service_type_unrelated_classes, node) { + cJSON *itemLocal = OpenAPI_service_type_unrelated_class_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_unrelated_class_convertToJSON() failed [service_type_unrelated_classes]"); + goto end; } + cJSON_AddItemToArray(service_type_unrelated_classesList, itemLocal); } } @@ -96,49 +107,48 @@ end: OpenAPI_unrelated_class_t *OpenAPI_unrelated_class_parseFromJSON(cJSON *unrelated_classJSON) { OpenAPI_unrelated_class_t *unrelated_class_local_var = NULL; - cJSON *default_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "defaultUnrelatedClass"); + OpenAPI_lnode_t *node = NULL; + cJSON *default_unrelated_class = NULL; + OpenAPI_default_unrelated_class_t *default_unrelated_class_local_nonprim = NULL; + cJSON *external_unrelated_class = NULL; + OpenAPI_external_unrelated_class_t *external_unrelated_class_local_nonprim = NULL; + cJSON *service_type_unrelated_classes = NULL; + OpenAPI_list_t *service_type_unrelated_classesList = NULL; + default_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "defaultUnrelatedClass"); if (!default_unrelated_class) { ogs_error("OpenAPI_unrelated_class_parseFromJSON() failed [default_unrelated_class]"); goto end; } - - OpenAPI_default_unrelated_class_t *default_unrelated_class_local_nonprim = NULL; default_unrelated_class_local_nonprim = OpenAPI_default_unrelated_class_parseFromJSON(default_unrelated_class); - cJSON *external_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "externalUnrelatedClass"); - - OpenAPI_external_unrelated_class_t *external_unrelated_class_local_nonprim = NULL; + external_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "externalUnrelatedClass"); if (external_unrelated_class) { external_unrelated_class_local_nonprim = OpenAPI_external_unrelated_class_parseFromJSON(external_unrelated_class); } - cJSON *service_type_unrelated_classes = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "serviceTypeUnrelatedClasses"); - - OpenAPI_list_t *service_type_unrelated_classesList; + service_type_unrelated_classes = cJSON_GetObjectItemCaseSensitive(unrelated_classJSON, "serviceTypeUnrelatedClasses"); if (service_type_unrelated_classes) { - cJSON *service_type_unrelated_classes_local_nonprimitive; - if (!cJSON_IsArray(service_type_unrelated_classes)){ - ogs_error("OpenAPI_unrelated_class_parseFromJSON() failed [service_type_unrelated_classes]"); - goto end; - } - - service_type_unrelated_classesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(service_type_unrelated_classes_local_nonprimitive, service_type_unrelated_classes ) { - if (!cJSON_IsObject(service_type_unrelated_classes_local_nonprimitive)) { + cJSON *service_type_unrelated_classes_local = NULL; + if (!cJSON_IsArray(service_type_unrelated_classes)) { ogs_error("OpenAPI_unrelated_class_parseFromJSON() failed [service_type_unrelated_classes]"); goto end; } - OpenAPI_service_type_unrelated_class_t *service_type_unrelated_classesItem = OpenAPI_service_type_unrelated_class_parseFromJSON(service_type_unrelated_classes_local_nonprimitive); - if (!service_type_unrelated_classesItem) { - ogs_error("No service_type_unrelated_classesItem"); - OpenAPI_list_free(service_type_unrelated_classesList); - goto end; + service_type_unrelated_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(service_type_unrelated_classes_local, service_type_unrelated_classes) { + if (!cJSON_IsObject(service_type_unrelated_classes_local)) { + ogs_error("OpenAPI_unrelated_class_parseFromJSON() failed [service_type_unrelated_classes]"); + goto end; + } + OpenAPI_service_type_unrelated_class_t *service_type_unrelated_classesItem = OpenAPI_service_type_unrelated_class_parseFromJSON(service_type_unrelated_classes_local); + if (!service_type_unrelated_classesItem) { + ogs_error("No service_type_unrelated_classesItem"); + OpenAPI_list_free(service_type_unrelated_classesList); + goto end; + } + OpenAPI_list_add(service_type_unrelated_classesList, service_type_unrelated_classesItem); } - - OpenAPI_list_add(service_type_unrelated_classesList, service_type_unrelated_classesItem); - } } unrelated_class_local_var = OpenAPI_unrelated_class_create ( @@ -149,6 +159,21 @@ OpenAPI_unrelated_class_t *OpenAPI_unrelated_class_parseFromJSON(cJSON *unrelate return unrelated_class_local_var; end: + if (default_unrelated_class_local_nonprim) { + OpenAPI_default_unrelated_class_free(default_unrelated_class_local_nonprim); + default_unrelated_class_local_nonprim = NULL; + } + if (external_unrelated_class_local_nonprim) { + OpenAPI_external_unrelated_class_free(external_unrelated_class_local_nonprim); + external_unrelated_class_local_nonprim = NULL; + } + if (service_type_unrelated_classesList) { + OpenAPI_list_for_each(service_type_unrelated_classesList, node) { + OpenAPI_service_type_unrelated_class_free(node->data); + } + OpenAPI_list_free(service_type_unrelated_classesList); + service_type_unrelated_classesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/unrelated_class_1.c b/lib/sbi/openapi/model/unrelated_class_1.c index 10bfd2114..44548128d 100644 --- a/lib/sbi/openapi/model/unrelated_class_1.c +++ b/lib/sbi/openapi/model/unrelated_class_1.c @@ -22,22 +22,33 @@ OpenAPI_unrelated_class_1_t *OpenAPI_unrelated_class_1_create( void OpenAPI_unrelated_class_1_free(OpenAPI_unrelated_class_1_t *unrelated_class_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == unrelated_class_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_default_unrelated_class_1_free(unrelated_class_1->default_unrelated_class); - OpenAPI_external_unrelated_class_free(unrelated_class_1->external_unrelated_class); - OpenAPI_list_for_each(unrelated_class_1->service_type_unrelated_classes, node) { - OpenAPI_service_type_unrelated_class_1_free(node->data); + if (unrelated_class_1->default_unrelated_class) { + OpenAPI_default_unrelated_class_1_free(unrelated_class_1->default_unrelated_class); + unrelated_class_1->default_unrelated_class = NULL; + } + if (unrelated_class_1->external_unrelated_class) { + OpenAPI_external_unrelated_class_free(unrelated_class_1->external_unrelated_class); + unrelated_class_1->external_unrelated_class = NULL; + } + if (unrelated_class_1->service_type_unrelated_classes) { + OpenAPI_list_for_each(unrelated_class_1->service_type_unrelated_classes, node) { + OpenAPI_service_type_unrelated_class_1_free(node->data); + } + OpenAPI_list_free(unrelated_class_1->service_type_unrelated_classes); + unrelated_class_1->service_type_unrelated_classes = NULL; } - OpenAPI_list_free(unrelated_class_1->service_type_unrelated_classes); ogs_free(unrelated_class_1); } cJSON *OpenAPI_unrelated_class_1_convertToJSON(OpenAPI_unrelated_class_1_t *unrelated_class_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (unrelated_class_1 == NULL) { ogs_error("OpenAPI_unrelated_class_1_convertToJSON() failed [UnrelatedClass_1]"); @@ -45,6 +56,10 @@ cJSON *OpenAPI_unrelated_class_1_convertToJSON(OpenAPI_unrelated_class_1_t *unre } item = cJSON_CreateObject(); + if (!unrelated_class_1->default_unrelated_class) { + ogs_error("OpenAPI_unrelated_class_1_convertToJSON() failed [default_unrelated_class]"); + return NULL; + } cJSON *default_unrelated_class_local_JSON = OpenAPI_default_unrelated_class_1_convertToJSON(unrelated_class_1->default_unrelated_class); if (default_unrelated_class_local_JSON == NULL) { ogs_error("OpenAPI_unrelated_class_1_convertToJSON() failed [default_unrelated_class]"); @@ -75,17 +90,13 @@ cJSON *OpenAPI_unrelated_class_1_convertToJSON(OpenAPI_unrelated_class_1_t *unre ogs_error("OpenAPI_unrelated_class_1_convertToJSON() failed [service_type_unrelated_classes]"); goto end; } - - OpenAPI_lnode_t *service_type_unrelated_classes_node; - if (unrelated_class_1->service_type_unrelated_classes) { - OpenAPI_list_for_each(unrelated_class_1->service_type_unrelated_classes, service_type_unrelated_classes_node) { - cJSON *itemLocal = OpenAPI_service_type_unrelated_class_1_convertToJSON(service_type_unrelated_classes_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_unrelated_class_1_convertToJSON() failed [service_type_unrelated_classes]"); - goto end; - } - cJSON_AddItemToArray(service_type_unrelated_classesList, itemLocal); + OpenAPI_list_for_each(unrelated_class_1->service_type_unrelated_classes, node) { + cJSON *itemLocal = OpenAPI_service_type_unrelated_class_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_unrelated_class_1_convertToJSON() failed [service_type_unrelated_classes]"); + goto end; } + cJSON_AddItemToArray(service_type_unrelated_classesList, itemLocal); } } @@ -96,49 +107,48 @@ end: OpenAPI_unrelated_class_1_t *OpenAPI_unrelated_class_1_parseFromJSON(cJSON *unrelated_class_1JSON) { OpenAPI_unrelated_class_1_t *unrelated_class_1_local_var = NULL; - cJSON *default_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_class_1JSON, "defaultUnrelatedClass"); + OpenAPI_lnode_t *node = NULL; + cJSON *default_unrelated_class = NULL; + OpenAPI_default_unrelated_class_1_t *default_unrelated_class_local_nonprim = NULL; + cJSON *external_unrelated_class = NULL; + OpenAPI_external_unrelated_class_t *external_unrelated_class_local_nonprim = NULL; + cJSON *service_type_unrelated_classes = NULL; + OpenAPI_list_t *service_type_unrelated_classesList = NULL; + default_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_class_1JSON, "defaultUnrelatedClass"); if (!default_unrelated_class) { ogs_error("OpenAPI_unrelated_class_1_parseFromJSON() failed [default_unrelated_class]"); goto end; } - - OpenAPI_default_unrelated_class_1_t *default_unrelated_class_local_nonprim = NULL; default_unrelated_class_local_nonprim = OpenAPI_default_unrelated_class_1_parseFromJSON(default_unrelated_class); - cJSON *external_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_class_1JSON, "externalUnrelatedClass"); - - OpenAPI_external_unrelated_class_t *external_unrelated_class_local_nonprim = NULL; + external_unrelated_class = cJSON_GetObjectItemCaseSensitive(unrelated_class_1JSON, "externalUnrelatedClass"); if (external_unrelated_class) { external_unrelated_class_local_nonprim = OpenAPI_external_unrelated_class_parseFromJSON(external_unrelated_class); } - cJSON *service_type_unrelated_classes = cJSON_GetObjectItemCaseSensitive(unrelated_class_1JSON, "serviceTypeUnrelatedClasses"); - - OpenAPI_list_t *service_type_unrelated_classesList; + service_type_unrelated_classes = cJSON_GetObjectItemCaseSensitive(unrelated_class_1JSON, "serviceTypeUnrelatedClasses"); if (service_type_unrelated_classes) { - cJSON *service_type_unrelated_classes_local_nonprimitive; - if (!cJSON_IsArray(service_type_unrelated_classes)){ - ogs_error("OpenAPI_unrelated_class_1_parseFromJSON() failed [service_type_unrelated_classes]"); - goto end; - } - - service_type_unrelated_classesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(service_type_unrelated_classes_local_nonprimitive, service_type_unrelated_classes ) { - if (!cJSON_IsObject(service_type_unrelated_classes_local_nonprimitive)) { + cJSON *service_type_unrelated_classes_local = NULL; + if (!cJSON_IsArray(service_type_unrelated_classes)) { ogs_error("OpenAPI_unrelated_class_1_parseFromJSON() failed [service_type_unrelated_classes]"); goto end; } - OpenAPI_service_type_unrelated_class_1_t *service_type_unrelated_classesItem = OpenAPI_service_type_unrelated_class_1_parseFromJSON(service_type_unrelated_classes_local_nonprimitive); - if (!service_type_unrelated_classesItem) { - ogs_error("No service_type_unrelated_classesItem"); - OpenAPI_list_free(service_type_unrelated_classesList); - goto end; + service_type_unrelated_classesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(service_type_unrelated_classes_local, service_type_unrelated_classes) { + if (!cJSON_IsObject(service_type_unrelated_classes_local)) { + ogs_error("OpenAPI_unrelated_class_1_parseFromJSON() failed [service_type_unrelated_classes]"); + goto end; + } + OpenAPI_service_type_unrelated_class_1_t *service_type_unrelated_classesItem = OpenAPI_service_type_unrelated_class_1_parseFromJSON(service_type_unrelated_classes_local); + if (!service_type_unrelated_classesItem) { + ogs_error("No service_type_unrelated_classesItem"); + OpenAPI_list_free(service_type_unrelated_classesList); + goto end; + } + OpenAPI_list_add(service_type_unrelated_classesList, service_type_unrelated_classesItem); } - - OpenAPI_list_add(service_type_unrelated_classesList, service_type_unrelated_classesItem); - } } unrelated_class_1_local_var = OpenAPI_unrelated_class_1_create ( @@ -149,6 +159,21 @@ OpenAPI_unrelated_class_1_t *OpenAPI_unrelated_class_1_parseFromJSON(cJSON *unre return unrelated_class_1_local_var; end: + if (default_unrelated_class_local_nonprim) { + OpenAPI_default_unrelated_class_1_free(default_unrelated_class_local_nonprim); + default_unrelated_class_local_nonprim = NULL; + } + if (external_unrelated_class_local_nonprim) { + OpenAPI_external_unrelated_class_free(external_unrelated_class_local_nonprim); + external_unrelated_class_local_nonprim = NULL; + } + if (service_type_unrelated_classesList) { + OpenAPI_list_for_each(service_type_unrelated_classesList, node) { + OpenAPI_service_type_unrelated_class_1_free(node->data); + } + OpenAPI_list_free(service_type_unrelated_classesList); + service_type_unrelated_classesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/up_path_chg_event.c b/lib/sbi/openapi/model/up_path_chg_event.c index 01a02cc49..d47214e24 100644 --- a/lib/sbi/openapi/model/up_path_chg_event.c +++ b/lib/sbi/openapi/model/up_path_chg_event.c @@ -26,18 +26,26 @@ OpenAPI_up_path_chg_event_t *OpenAPI_up_path_chg_event_create( void OpenAPI_up_path_chg_event_free(OpenAPI_up_path_chg_event_t *up_path_chg_event) { + OpenAPI_lnode_t *node = NULL; + if (NULL == up_path_chg_event) { return; } - OpenAPI_lnode_t *node; - ogs_free(up_path_chg_event->notification_uri); - ogs_free(up_path_chg_event->notif_corre_id); + if (up_path_chg_event->notification_uri) { + ogs_free(up_path_chg_event->notification_uri); + up_path_chg_event->notification_uri = NULL; + } + if (up_path_chg_event->notif_corre_id) { + ogs_free(up_path_chg_event->notif_corre_id); + up_path_chg_event->notif_corre_id = NULL; + } ogs_free(up_path_chg_event); } cJSON *OpenAPI_up_path_chg_event_convertToJSON(OpenAPI_up_path_chg_event_t *up_path_chg_event) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (up_path_chg_event == NULL) { ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [UpPathChgEvent]"); @@ -45,16 +53,28 @@ cJSON *OpenAPI_up_path_chg_event_convertToJSON(OpenAPI_up_path_chg_event_t *up_p } item = cJSON_CreateObject(); + if (!up_path_chg_event->notification_uri) { + ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [notification_uri]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notificationUri", up_path_chg_event->notification_uri) == NULL) { ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [notification_uri]"); goto end; } + if (!up_path_chg_event->notif_corre_id) { + ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [notif_corre_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "notifCorreId", up_path_chg_event->notif_corre_id) == NULL) { ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [notif_corre_id]"); goto end; } + if (up_path_chg_event->dnai_chg_type == OpenAPI_dnai_change_type_NULL) { + ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [dnai_chg_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "dnaiChgType", OpenAPI_dnai_change_type_ToString(up_path_chg_event->dnai_chg_type)) == NULL) { ogs_error("OpenAPI_up_path_chg_event_convertToJSON() failed [dnai_chg_type]"); goto end; @@ -74,43 +94,44 @@ end: OpenAPI_up_path_chg_event_t *OpenAPI_up_path_chg_event_parseFromJSON(cJSON *up_path_chg_eventJSON) { OpenAPI_up_path_chg_event_t *up_path_chg_event_local_var = NULL; - cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "notificationUri"); + OpenAPI_lnode_t *node = NULL; + cJSON *notification_uri = NULL; + cJSON *notif_corre_id = NULL; + cJSON *dnai_chg_type = NULL; + OpenAPI_dnai_change_type_e dnai_chg_typeVariable = 0; + cJSON *af_ack_ind = NULL; + notification_uri = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "notificationUri"); if (!notification_uri) { ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [notification_uri]"); goto end; } - if (!cJSON_IsString(notification_uri)) { ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [notification_uri]"); goto end; } - cJSON *notif_corre_id = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "notifCorreId"); + notif_corre_id = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "notifCorreId"); if (!notif_corre_id) { ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [notif_corre_id]"); goto end; } - if (!cJSON_IsString(notif_corre_id)) { ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [notif_corre_id]"); goto end; } - cJSON *dnai_chg_type = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "dnaiChgType"); + dnai_chg_type = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "dnaiChgType"); if (!dnai_chg_type) { ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [dnai_chg_type]"); goto end; } - - OpenAPI_dnai_change_type_e dnai_chg_typeVariable; if (!cJSON_IsString(dnai_chg_type)) { ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [dnai_chg_type]"); goto end; } dnai_chg_typeVariable = OpenAPI_dnai_change_type_FromString(dnai_chg_type->valuestring); - cJSON *af_ack_ind = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "afAckInd"); - + af_ack_ind = cJSON_GetObjectItemCaseSensitive(up_path_chg_eventJSON, "afAckInd"); if (af_ack_ind) { if (!cJSON_IsBool(af_ack_ind)) { ogs_error("OpenAPI_up_path_chg_event_parseFromJSON() failed [af_ack_ind]"); diff --git a/lib/sbi/openapi/model/up_security.c b/lib/sbi/openapi/model/up_security.c index eeea60904..6ebae3c9a 100644 --- a/lib/sbi/openapi/model/up_security.c +++ b/lib/sbi/openapi/model/up_security.c @@ -20,16 +20,18 @@ OpenAPI_up_security_t *OpenAPI_up_security_create( void OpenAPI_up_security_free(OpenAPI_up_security_t *up_security) { + OpenAPI_lnode_t *node = NULL; + if (NULL == up_security) { return; } - OpenAPI_lnode_t *node; ogs_free(up_security); } cJSON *OpenAPI_up_security_convertToJSON(OpenAPI_up_security_t *up_security) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (up_security == NULL) { ogs_error("OpenAPI_up_security_convertToJSON() failed [UpSecurity]"); @@ -37,11 +39,19 @@ cJSON *OpenAPI_up_security_convertToJSON(OpenAPI_up_security_t *up_security) } item = cJSON_CreateObject(); + if (up_security->up_integr == OpenAPI_up_integrity_NULL) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [up_integr]"); + return NULL; + } if (cJSON_AddStringToObject(item, "upIntegr", OpenAPI_up_integrity_ToString(up_security->up_integr)) == NULL) { ogs_error("OpenAPI_up_security_convertToJSON() failed [up_integr]"); goto end; } + if (up_security->up_confid == OpenAPI_up_confidentiality_NULL) { + ogs_error("OpenAPI_up_security_convertToJSON() failed [up_confid]"); + return NULL; + } if (cJSON_AddStringToObject(item, "upConfid", OpenAPI_up_confidentiality_ToString(up_security->up_confid)) == NULL) { ogs_error("OpenAPI_up_security_convertToJSON() failed [up_confid]"); goto end; @@ -54,26 +64,27 @@ end: OpenAPI_up_security_t *OpenAPI_up_security_parseFromJSON(cJSON *up_securityJSON) { OpenAPI_up_security_t *up_security_local_var = NULL; - cJSON *up_integr = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upIntegr"); + OpenAPI_lnode_t *node = NULL; + cJSON *up_integr = NULL; + OpenAPI_up_integrity_e up_integrVariable = 0; + cJSON *up_confid = NULL; + OpenAPI_up_confidentiality_e up_confidVariable = 0; + up_integr = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upIntegr"); if (!up_integr) { ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_integr]"); goto end; } - - OpenAPI_up_integrity_e up_integrVariable; if (!cJSON_IsString(up_integr)) { ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_integr]"); goto end; } up_integrVariable = OpenAPI_up_integrity_FromString(up_integr->valuestring); - cJSON *up_confid = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upConfid"); + up_confid = cJSON_GetObjectItemCaseSensitive(up_securityJSON, "upConfid"); if (!up_confid) { ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_confid]"); goto end; } - - OpenAPI_up_confidentiality_e up_confidVariable; if (!cJSON_IsString(up_confid)) { ogs_error("OpenAPI_up_security_parseFromJSON() failed [up_confid]"); goto end; diff --git a/lib/sbi/openapi/model/up_security_1.c b/lib/sbi/openapi/model/up_security_1.c index a8c548ed8..8c052631c 100644 --- a/lib/sbi/openapi/model/up_security_1.c +++ b/lib/sbi/openapi/model/up_security_1.c @@ -20,16 +20,18 @@ OpenAPI_up_security_1_t *OpenAPI_up_security_1_create( void OpenAPI_up_security_1_free(OpenAPI_up_security_1_t *up_security_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == up_security_1) { return; } - OpenAPI_lnode_t *node; ogs_free(up_security_1); } cJSON *OpenAPI_up_security_1_convertToJSON(OpenAPI_up_security_1_t *up_security_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (up_security_1 == NULL) { ogs_error("OpenAPI_up_security_1_convertToJSON() failed [UpSecurity_1]"); @@ -37,11 +39,19 @@ cJSON *OpenAPI_up_security_1_convertToJSON(OpenAPI_up_security_1_t *up_security_ } item = cJSON_CreateObject(); + if (up_security_1->up_integr == OpenAPI_up_integrity_NULL) { + ogs_error("OpenAPI_up_security_1_convertToJSON() failed [up_integr]"); + return NULL; + } if (cJSON_AddStringToObject(item, "upIntegr", OpenAPI_up_integrity_ToString(up_security_1->up_integr)) == NULL) { ogs_error("OpenAPI_up_security_1_convertToJSON() failed [up_integr]"); goto end; } + if (up_security_1->up_confid == OpenAPI_up_confidentiality_NULL) { + ogs_error("OpenAPI_up_security_1_convertToJSON() failed [up_confid]"); + return NULL; + } if (cJSON_AddStringToObject(item, "upConfid", OpenAPI_up_confidentiality_ToString(up_security_1->up_confid)) == NULL) { ogs_error("OpenAPI_up_security_1_convertToJSON() failed [up_confid]"); goto end; @@ -54,26 +64,27 @@ end: OpenAPI_up_security_1_t *OpenAPI_up_security_1_parseFromJSON(cJSON *up_security_1JSON) { OpenAPI_up_security_1_t *up_security_1_local_var = NULL; - cJSON *up_integr = cJSON_GetObjectItemCaseSensitive(up_security_1JSON, "upIntegr"); + OpenAPI_lnode_t *node = NULL; + cJSON *up_integr = NULL; + OpenAPI_up_integrity_e up_integrVariable = 0; + cJSON *up_confid = NULL; + OpenAPI_up_confidentiality_e up_confidVariable = 0; + up_integr = cJSON_GetObjectItemCaseSensitive(up_security_1JSON, "upIntegr"); if (!up_integr) { ogs_error("OpenAPI_up_security_1_parseFromJSON() failed [up_integr]"); goto end; } - - OpenAPI_up_integrity_e up_integrVariable; if (!cJSON_IsString(up_integr)) { ogs_error("OpenAPI_up_security_1_parseFromJSON() failed [up_integr]"); goto end; } up_integrVariable = OpenAPI_up_integrity_FromString(up_integr->valuestring); - cJSON *up_confid = cJSON_GetObjectItemCaseSensitive(up_security_1JSON, "upConfid"); + up_confid = cJSON_GetObjectItemCaseSensitive(up_security_1JSON, "upConfid"); if (!up_confid) { ogs_error("OpenAPI_up_security_1_parseFromJSON() failed [up_confid]"); goto end; } - - OpenAPI_up_confidentiality_e up_confidVariable; if (!cJSON_IsString(up_confid)) { ogs_error("OpenAPI_up_security_1_parseFromJSON() failed [up_confid]"); goto end; diff --git a/lib/sbi/openapi/model/up_security_info.c b/lib/sbi/openapi/model/up_security_info.c index 49c7ea6eb..a0c802c40 100644 --- a/lib/sbi/openapi/model/up_security_info.c +++ b/lib/sbi/openapi/model/up_security_info.c @@ -24,18 +24,26 @@ OpenAPI_up_security_info_t *OpenAPI_up_security_info_create( void OpenAPI_up_security_info_free(OpenAPI_up_security_info_t *up_security_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == up_security_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_up_security_free(up_security_info->up_security); - OpenAPI_security_result_free(up_security_info->security_result); + if (up_security_info->up_security) { + OpenAPI_up_security_free(up_security_info->up_security); + up_security_info->up_security = NULL; + } + if (up_security_info->security_result) { + OpenAPI_security_result_free(up_security_info->security_result); + up_security_info->security_result = NULL; + } ogs_free(up_security_info); } cJSON *OpenAPI_up_security_info_convertToJSON(OpenAPI_up_security_info_t *up_security_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (up_security_info == NULL) { ogs_error("OpenAPI_up_security_info_convertToJSON() failed [UpSecurityInfo]"); @@ -43,6 +51,10 @@ cJSON *OpenAPI_up_security_info_convertToJSON(OpenAPI_up_security_info_t *up_sec } item = cJSON_CreateObject(); + if (!up_security_info->up_security) { + ogs_error("OpenAPI_up_security_info_convertToJSON() failed [up_security]"); + return NULL; + } cJSON *up_security_local_JSON = OpenAPI_up_security_convertToJSON(up_security_info->up_security); if (up_security_local_JSON == NULL) { ogs_error("OpenAPI_up_security_info_convertToJSON() failed [up_security]"); @@ -54,14 +66,14 @@ cJSON *OpenAPI_up_security_info_convertToJSON(OpenAPI_up_security_info_t *up_sec goto end; } - if (up_security_info->max_integrity_protected_data_rate_ul) { + if (up_security_info->max_integrity_protected_data_rate_ul != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateUl", OpenAPI_max_integrity_protected_data_rate_ToString(up_security_info->max_integrity_protected_data_rate_ul)) == NULL) { ogs_error("OpenAPI_up_security_info_convertToJSON() failed [max_integrity_protected_data_rate_ul]"); goto end; } } - if (up_security_info->max_integrity_protected_data_rate_dl) { + if (up_security_info->max_integrity_protected_data_rate_dl != OpenAPI_max_integrity_protected_data_rate_NULL) { if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateDl", OpenAPI_max_integrity_protected_data_rate_ToString(up_security_info->max_integrity_protected_data_rate_dl)) == NULL) { ogs_error("OpenAPI_up_security_info_convertToJSON() failed [max_integrity_protected_data_rate_dl]"); goto end; @@ -88,18 +100,23 @@ end: OpenAPI_up_security_info_t *OpenAPI_up_security_info_parseFromJSON(cJSON *up_security_infoJSON) { OpenAPI_up_security_info_t *up_security_info_local_var = NULL; - cJSON *up_security = cJSON_GetObjectItemCaseSensitive(up_security_infoJSON, "upSecurity"); + OpenAPI_lnode_t *node = NULL; + cJSON *up_security = NULL; + OpenAPI_up_security_t *up_security_local_nonprim = NULL; + cJSON *max_integrity_protected_data_rate_ul = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_ulVariable = 0; + cJSON *max_integrity_protected_data_rate_dl = NULL; + OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable = 0; + cJSON *security_result = NULL; + OpenAPI_security_result_t *security_result_local_nonprim = NULL; + up_security = cJSON_GetObjectItemCaseSensitive(up_security_infoJSON, "upSecurity"); if (!up_security) { ogs_error("OpenAPI_up_security_info_parseFromJSON() failed [up_security]"); goto end; } - - OpenAPI_up_security_t *up_security_local_nonprim = NULL; up_security_local_nonprim = OpenAPI_up_security_parseFromJSON(up_security); - cJSON *max_integrity_protected_data_rate_ul = cJSON_GetObjectItemCaseSensitive(up_security_infoJSON, "maxIntegrityProtectedDataRateUl"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_ulVariable; + max_integrity_protected_data_rate_ul = cJSON_GetObjectItemCaseSensitive(up_security_infoJSON, "maxIntegrityProtectedDataRateUl"); if (max_integrity_protected_data_rate_ul) { if (!cJSON_IsString(max_integrity_protected_data_rate_ul)) { ogs_error("OpenAPI_up_security_info_parseFromJSON() failed [max_integrity_protected_data_rate_ul]"); @@ -108,9 +125,7 @@ OpenAPI_up_security_info_t *OpenAPI_up_security_info_parseFromJSON(cJSON *up_sec max_integrity_protected_data_rate_ulVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_ul->valuestring); } - cJSON *max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(up_security_infoJSON, "maxIntegrityProtectedDataRateDl"); - - OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable; + max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(up_security_infoJSON, "maxIntegrityProtectedDataRateDl"); if (max_integrity_protected_data_rate_dl) { if (!cJSON_IsString(max_integrity_protected_data_rate_dl)) { ogs_error("OpenAPI_up_security_info_parseFromJSON() failed [max_integrity_protected_data_rate_dl]"); @@ -119,9 +134,7 @@ OpenAPI_up_security_info_t *OpenAPI_up_security_info_parseFromJSON(cJSON *up_sec max_integrity_protected_data_rate_dlVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_dl->valuestring); } - cJSON *security_result = cJSON_GetObjectItemCaseSensitive(up_security_infoJSON, "securityResult"); - - OpenAPI_security_result_t *security_result_local_nonprim = NULL; + security_result = cJSON_GetObjectItemCaseSensitive(up_security_infoJSON, "securityResult"); if (security_result) { security_result_local_nonprim = OpenAPI_security_result_parseFromJSON(security_result); } @@ -135,6 +148,14 @@ OpenAPI_up_security_info_t *OpenAPI_up_security_info_parseFromJSON(cJSON *up_sec return up_security_info_local_var; end: + if (up_security_local_nonprim) { + OpenAPI_up_security_free(up_security_local_nonprim); + up_security_local_nonprim = NULL; + } + if (security_result_local_nonprim) { + OpenAPI_security_result_free(security_result_local_nonprim); + security_result_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/update_pdu_session_200_response.c b/lib/sbi/openapi/model/update_pdu_session_200_response.c new file mode 100644 index 000000000..1bdbeb22c --- /dev/null +++ b/lib/sbi/openapi/model/update_pdu_session_200_response.c @@ -0,0 +1,250 @@ + +#include +#include +#include +#include "update_pdu_session_200_response.h" + +OpenAPI_update_pdu_session_200_response_t *OpenAPI_update_pdu_session_200_response_create( + OpenAPI_hsmf_updated_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_info_to_ue, + OpenAPI_binary_t* binary_data_n4_information, + OpenAPI_binary_t* binary_data_n4_information_ext1, + OpenAPI_binary_t* binary_data_n4_information_ext2 +) +{ + OpenAPI_update_pdu_session_200_response_t *update_pdu_session_200_response_local_var = ogs_malloc(sizeof(OpenAPI_update_pdu_session_200_response_t)); + ogs_assert(update_pdu_session_200_response_local_var); + + update_pdu_session_200_response_local_var->json_data = json_data; + update_pdu_session_200_response_local_var->binary_data_n1_sm_info_to_ue = binary_data_n1_sm_info_to_ue; + update_pdu_session_200_response_local_var->binary_data_n4_information = binary_data_n4_information; + update_pdu_session_200_response_local_var->binary_data_n4_information_ext1 = binary_data_n4_information_ext1; + update_pdu_session_200_response_local_var->binary_data_n4_information_ext2 = binary_data_n4_information_ext2; + + return update_pdu_session_200_response_local_var; +} + +void OpenAPI_update_pdu_session_200_response_free(OpenAPI_update_pdu_session_200_response_t *update_pdu_session_200_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == update_pdu_session_200_response) { + return; + } + if (update_pdu_session_200_response->json_data) { + OpenAPI_hsmf_updated_data_free(update_pdu_session_200_response->json_data); + update_pdu_session_200_response->json_data = NULL; + } + if (update_pdu_session_200_response->binary_data_n1_sm_info_to_ue) { + ogs_free(update_pdu_session_200_response->binary_data_n1_sm_info_to_ue->data); + update_pdu_session_200_response->binary_data_n1_sm_info_to_ue = NULL; + } + if (update_pdu_session_200_response->binary_data_n4_information) { + ogs_free(update_pdu_session_200_response->binary_data_n4_information->data); + update_pdu_session_200_response->binary_data_n4_information = NULL; + } + if (update_pdu_session_200_response->binary_data_n4_information_ext1) { + ogs_free(update_pdu_session_200_response->binary_data_n4_information_ext1->data); + update_pdu_session_200_response->binary_data_n4_information_ext1 = NULL; + } + if (update_pdu_session_200_response->binary_data_n4_information_ext2) { + ogs_free(update_pdu_session_200_response->binary_data_n4_information_ext2->data); + update_pdu_session_200_response->binary_data_n4_information_ext2 = NULL; + } + ogs_free(update_pdu_session_200_response); +} + +cJSON *OpenAPI_update_pdu_session_200_response_convertToJSON(OpenAPI_update_pdu_session_200_response_t *update_pdu_session_200_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (update_pdu_session_200_response == NULL) { + ogs_error("OpenAPI_update_pdu_session_200_response_convertToJSON() failed [UpdatePduSession_200_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (update_pdu_session_200_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_hsmf_updated_data_convertToJSON(update_pdu_session_200_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_update_pdu_session_200_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_update_pdu_session_200_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (update_pdu_session_200_response->binary_data_n1_sm_info_to_ue) { + char* encoded_str_binary_data_n1_sm_info_to_ue = OpenAPI_base64encode(update_pdu_session_200_response->binary_data_n1_sm_info_to_ue->data,update_pdu_session_200_response->binary_data_n1_sm_info_to_ue->len); + if (cJSON_AddStringToObject(item, "binaryDataN1SmInfoToUe", encoded_str_binary_data_n1_sm_info_to_ue) == NULL) { + ogs_error("OpenAPI_update_pdu_session_200_response_convertToJSON() failed [binary_data_n1_sm_info_to_ue]"); + goto end; + } + ogs_free(encoded_str_binary_data_n1_sm_info_to_ue); + } + + if (update_pdu_session_200_response->binary_data_n4_information) { + char* encoded_str_binary_data_n4_information = OpenAPI_base64encode(update_pdu_session_200_response->binary_data_n4_information->data,update_pdu_session_200_response->binary_data_n4_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN4Information", encoded_str_binary_data_n4_information) == NULL) { + ogs_error("OpenAPI_update_pdu_session_200_response_convertToJSON() failed [binary_data_n4_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information); + } + + if (update_pdu_session_200_response->binary_data_n4_information_ext1) { + char* encoded_str_binary_data_n4_information_ext1 = OpenAPI_base64encode(update_pdu_session_200_response->binary_data_n4_information_ext1->data,update_pdu_session_200_response->binary_data_n4_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN4InformationExt1", encoded_str_binary_data_n4_information_ext1) == NULL) { + ogs_error("OpenAPI_update_pdu_session_200_response_convertToJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information_ext1); + } + + if (update_pdu_session_200_response->binary_data_n4_information_ext2) { + char* encoded_str_binary_data_n4_information_ext2 = OpenAPI_base64encode(update_pdu_session_200_response->binary_data_n4_information_ext2->data,update_pdu_session_200_response->binary_data_n4_information_ext2->len); + if (cJSON_AddStringToObject(item, "binaryDataN4InformationExt2", encoded_str_binary_data_n4_information_ext2) == NULL) { + ogs_error("OpenAPI_update_pdu_session_200_response_convertToJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information_ext2); + } + +end: + return item; +} + +OpenAPI_update_pdu_session_200_response_t *OpenAPI_update_pdu_session_200_response_parseFromJSON(cJSON *update_pdu_session_200_responseJSON) +{ + OpenAPI_update_pdu_session_200_response_t *update_pdu_session_200_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_hsmf_updated_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n1_sm_info_to_ue = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n1_sm_info_to_ue = NULL; + cJSON *binary_data_n4_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information = NULL; + cJSON *binary_data_n4_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information_ext1 = NULL; + cJSON *binary_data_n4_information_ext2 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information_ext2 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(update_pdu_session_200_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_hsmf_updated_data_parseFromJSON(json_data); + } + + binary_data_n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(update_pdu_session_200_responseJSON, "binaryDataN1SmInfoToUe"); + if (binary_data_n1_sm_info_to_ue) { + decoded_str_binary_data_n1_sm_info_to_ue = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n1_sm_info_to_ue); + if (!cJSON_IsString(binary_data_n1_sm_info_to_ue)) { + ogs_error("OpenAPI_update_pdu_session_200_response_parseFromJSON() failed [binary_data_n1_sm_info_to_ue]"); + goto end; + } + decoded_str_binary_data_n1_sm_info_to_ue->data = OpenAPI_base64decode(binary_data_n1_sm_info_to_ue->valuestring, strlen(binary_data_n1_sm_info_to_ue->valuestring), &decoded_str_binary_data_n1_sm_info_to_ue->len); + if (!decoded_str_binary_data_n1_sm_info_to_ue->data) { + ogs_error("OpenAPI_update_pdu_session_200_response_parseFromJSON() failed [binary_data_n1_sm_info_to_ue]"); + goto end; + } + } + + binary_data_n4_information = cJSON_GetObjectItemCaseSensitive(update_pdu_session_200_responseJSON, "binaryDataN4Information"); + if (binary_data_n4_information) { + decoded_str_binary_data_n4_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information); + if (!cJSON_IsString(binary_data_n4_information)) { + ogs_error("OpenAPI_update_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information]"); + goto end; + } + decoded_str_binary_data_n4_information->data = OpenAPI_base64decode(binary_data_n4_information->valuestring, strlen(binary_data_n4_information->valuestring), &decoded_str_binary_data_n4_information->len); + if (!decoded_str_binary_data_n4_information->data) { + ogs_error("OpenAPI_update_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information]"); + goto end; + } + } + + binary_data_n4_information_ext1 = cJSON_GetObjectItemCaseSensitive(update_pdu_session_200_responseJSON, "binaryDataN4InformationExt1"); + if (binary_data_n4_information_ext1) { + decoded_str_binary_data_n4_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information_ext1); + if (!cJSON_IsString(binary_data_n4_information_ext1)) { + ogs_error("OpenAPI_update_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + decoded_str_binary_data_n4_information_ext1->data = OpenAPI_base64decode(binary_data_n4_information_ext1->valuestring, strlen(binary_data_n4_information_ext1->valuestring), &decoded_str_binary_data_n4_information_ext1->len); + if (!decoded_str_binary_data_n4_information_ext1->data) { + ogs_error("OpenAPI_update_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + } + + binary_data_n4_information_ext2 = cJSON_GetObjectItemCaseSensitive(update_pdu_session_200_responseJSON, "binaryDataN4InformationExt2"); + if (binary_data_n4_information_ext2) { + decoded_str_binary_data_n4_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information_ext2); + if (!cJSON_IsString(binary_data_n4_information_ext2)) { + ogs_error("OpenAPI_update_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + decoded_str_binary_data_n4_information_ext2->data = OpenAPI_base64decode(binary_data_n4_information_ext2->valuestring, strlen(binary_data_n4_information_ext2->valuestring), &decoded_str_binary_data_n4_information_ext2->len); + if (!decoded_str_binary_data_n4_information_ext2->data) { + ogs_error("OpenAPI_update_pdu_session_200_response_parseFromJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + } + + update_pdu_session_200_response_local_var = OpenAPI_update_pdu_session_200_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n1_sm_info_to_ue ? decoded_str_binary_data_n1_sm_info_to_ue : NULL, + binary_data_n4_information ? decoded_str_binary_data_n4_information : NULL, + binary_data_n4_information_ext1 ? decoded_str_binary_data_n4_information_ext1 : NULL, + binary_data_n4_information_ext2 ? decoded_str_binary_data_n4_information_ext2 : NULL + ); + + return update_pdu_session_200_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_hsmf_updated_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_update_pdu_session_200_response_t *OpenAPI_update_pdu_session_200_response_copy(OpenAPI_update_pdu_session_200_response_t *dst, OpenAPI_update_pdu_session_200_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_update_pdu_session_200_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_update_pdu_session_200_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_update_pdu_session_200_response_free(dst); + dst = OpenAPI_update_pdu_session_200_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/update_pdu_session_200_response.h b/lib/sbi/openapi/model/update_pdu_session_200_response.h new file mode 100644 index 000000000..cc0f75a69 --- /dev/null +++ b/lib/sbi/openapi/model/update_pdu_session_200_response.h @@ -0,0 +1,47 @@ +/* + * update_pdu_session_200_response.h + * + * + */ + +#ifndef _OpenAPI_update_pdu_session_200_response_H_ +#define _OpenAPI_update_pdu_session_200_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "hsmf_updated_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_update_pdu_session_200_response_s OpenAPI_update_pdu_session_200_response_t; +typedef struct OpenAPI_update_pdu_session_200_response_s { + struct OpenAPI_hsmf_updated_data_s *json_data; + OpenAPI_binary_t* binary_data_n1_sm_info_to_ue; + OpenAPI_binary_t* binary_data_n4_information; + OpenAPI_binary_t* binary_data_n4_information_ext1; + OpenAPI_binary_t* binary_data_n4_information_ext2; +} OpenAPI_update_pdu_session_200_response_t; + +OpenAPI_update_pdu_session_200_response_t *OpenAPI_update_pdu_session_200_response_create( + OpenAPI_hsmf_updated_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_info_to_ue, + OpenAPI_binary_t* binary_data_n4_information, + OpenAPI_binary_t* binary_data_n4_information_ext1, + OpenAPI_binary_t* binary_data_n4_information_ext2 +); +void OpenAPI_update_pdu_session_200_response_free(OpenAPI_update_pdu_session_200_response_t *update_pdu_session_200_response); +OpenAPI_update_pdu_session_200_response_t *OpenAPI_update_pdu_session_200_response_parseFromJSON(cJSON *update_pdu_session_200_responseJSON); +cJSON *OpenAPI_update_pdu_session_200_response_convertToJSON(OpenAPI_update_pdu_session_200_response_t *update_pdu_session_200_response); +OpenAPI_update_pdu_session_200_response_t *OpenAPI_update_pdu_session_200_response_copy(OpenAPI_update_pdu_session_200_response_t *dst, OpenAPI_update_pdu_session_200_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_update_pdu_session_200_response_H_ */ + diff --git a/lib/sbi/openapi/model/update_pdu_session_400_response.c b/lib/sbi/openapi/model/update_pdu_session_400_response.c new file mode 100644 index 000000000..91700b1bd --- /dev/null +++ b/lib/sbi/openapi/model/update_pdu_session_400_response.c @@ -0,0 +1,151 @@ + +#include +#include +#include +#include "update_pdu_session_400_response.h" + +OpenAPI_update_pdu_session_400_response_t *OpenAPI_update_pdu_session_400_response_create( + OpenAPI_hsmf_update_error_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_info_to_ue +) +{ + OpenAPI_update_pdu_session_400_response_t *update_pdu_session_400_response_local_var = ogs_malloc(sizeof(OpenAPI_update_pdu_session_400_response_t)); + ogs_assert(update_pdu_session_400_response_local_var); + + update_pdu_session_400_response_local_var->json_data = json_data; + update_pdu_session_400_response_local_var->binary_data_n1_sm_info_to_ue = binary_data_n1_sm_info_to_ue; + + return update_pdu_session_400_response_local_var; +} + +void OpenAPI_update_pdu_session_400_response_free(OpenAPI_update_pdu_session_400_response_t *update_pdu_session_400_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == update_pdu_session_400_response) { + return; + } + if (update_pdu_session_400_response->json_data) { + OpenAPI_hsmf_update_error_free(update_pdu_session_400_response->json_data); + update_pdu_session_400_response->json_data = NULL; + } + if (update_pdu_session_400_response->binary_data_n1_sm_info_to_ue) { + ogs_free(update_pdu_session_400_response->binary_data_n1_sm_info_to_ue->data); + update_pdu_session_400_response->binary_data_n1_sm_info_to_ue = NULL; + } + ogs_free(update_pdu_session_400_response); +} + +cJSON *OpenAPI_update_pdu_session_400_response_convertToJSON(OpenAPI_update_pdu_session_400_response_t *update_pdu_session_400_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (update_pdu_session_400_response == NULL) { + ogs_error("OpenAPI_update_pdu_session_400_response_convertToJSON() failed [UpdatePduSession_400_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (update_pdu_session_400_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_hsmf_update_error_convertToJSON(update_pdu_session_400_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_update_pdu_session_400_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_update_pdu_session_400_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (update_pdu_session_400_response->binary_data_n1_sm_info_to_ue) { + char* encoded_str_binary_data_n1_sm_info_to_ue = OpenAPI_base64encode(update_pdu_session_400_response->binary_data_n1_sm_info_to_ue->data,update_pdu_session_400_response->binary_data_n1_sm_info_to_ue->len); + if (cJSON_AddStringToObject(item, "binaryDataN1SmInfoToUe", encoded_str_binary_data_n1_sm_info_to_ue) == NULL) { + ogs_error("OpenAPI_update_pdu_session_400_response_convertToJSON() failed [binary_data_n1_sm_info_to_ue]"); + goto end; + } + ogs_free(encoded_str_binary_data_n1_sm_info_to_ue); + } + +end: + return item; +} + +OpenAPI_update_pdu_session_400_response_t *OpenAPI_update_pdu_session_400_response_parseFromJSON(cJSON *update_pdu_session_400_responseJSON) +{ + OpenAPI_update_pdu_session_400_response_t *update_pdu_session_400_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_hsmf_update_error_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n1_sm_info_to_ue = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n1_sm_info_to_ue = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(update_pdu_session_400_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_hsmf_update_error_parseFromJSON(json_data); + } + + binary_data_n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(update_pdu_session_400_responseJSON, "binaryDataN1SmInfoToUe"); + if (binary_data_n1_sm_info_to_ue) { + decoded_str_binary_data_n1_sm_info_to_ue = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n1_sm_info_to_ue); + if (!cJSON_IsString(binary_data_n1_sm_info_to_ue)) { + ogs_error("OpenAPI_update_pdu_session_400_response_parseFromJSON() failed [binary_data_n1_sm_info_to_ue]"); + goto end; + } + decoded_str_binary_data_n1_sm_info_to_ue->data = OpenAPI_base64decode(binary_data_n1_sm_info_to_ue->valuestring, strlen(binary_data_n1_sm_info_to_ue->valuestring), &decoded_str_binary_data_n1_sm_info_to_ue->len); + if (!decoded_str_binary_data_n1_sm_info_to_ue->data) { + ogs_error("OpenAPI_update_pdu_session_400_response_parseFromJSON() failed [binary_data_n1_sm_info_to_ue]"); + goto end; + } + } + + update_pdu_session_400_response_local_var = OpenAPI_update_pdu_session_400_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n1_sm_info_to_ue ? decoded_str_binary_data_n1_sm_info_to_ue : NULL + ); + + return update_pdu_session_400_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_hsmf_update_error_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_update_pdu_session_400_response_t *OpenAPI_update_pdu_session_400_response_copy(OpenAPI_update_pdu_session_400_response_t *dst, OpenAPI_update_pdu_session_400_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_update_pdu_session_400_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_update_pdu_session_400_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_update_pdu_session_400_response_free(dst); + dst = OpenAPI_update_pdu_session_400_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/update_pdu_session_400_response.h b/lib/sbi/openapi/model/update_pdu_session_400_response.h new file mode 100644 index 000000000..dd12a83a3 --- /dev/null +++ b/lib/sbi/openapi/model/update_pdu_session_400_response.h @@ -0,0 +1,41 @@ +/* + * update_pdu_session_400_response.h + * + * + */ + +#ifndef _OpenAPI_update_pdu_session_400_response_H_ +#define _OpenAPI_update_pdu_session_400_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "hsmf_update_error.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_update_pdu_session_400_response_s OpenAPI_update_pdu_session_400_response_t; +typedef struct OpenAPI_update_pdu_session_400_response_s { + struct OpenAPI_hsmf_update_error_s *json_data; + OpenAPI_binary_t* binary_data_n1_sm_info_to_ue; +} OpenAPI_update_pdu_session_400_response_t; + +OpenAPI_update_pdu_session_400_response_t *OpenAPI_update_pdu_session_400_response_create( + OpenAPI_hsmf_update_error_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_info_to_ue +); +void OpenAPI_update_pdu_session_400_response_free(OpenAPI_update_pdu_session_400_response_t *update_pdu_session_400_response); +OpenAPI_update_pdu_session_400_response_t *OpenAPI_update_pdu_session_400_response_parseFromJSON(cJSON *update_pdu_session_400_responseJSON); +cJSON *OpenAPI_update_pdu_session_400_response_convertToJSON(OpenAPI_update_pdu_session_400_response_t *update_pdu_session_400_response); +OpenAPI_update_pdu_session_400_response_t *OpenAPI_update_pdu_session_400_response_copy(OpenAPI_update_pdu_session_400_response_t *dst, OpenAPI_update_pdu_session_400_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_update_pdu_session_400_response_H_ */ + diff --git a/lib/sbi/openapi/model/update_pdu_session_request.c b/lib/sbi/openapi/model/update_pdu_session_request.c new file mode 100644 index 000000000..484ffbf03 --- /dev/null +++ b/lib/sbi/openapi/model/update_pdu_session_request.c @@ -0,0 +1,283 @@ + +#include +#include +#include +#include "update_pdu_session_request.h" + +OpenAPI_update_pdu_session_request_t *OpenAPI_update_pdu_session_request_create( + OpenAPI_hsmf_update_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_info_from_ue, + OpenAPI_binary_t* binary_data_unknown_n1_sm_info, + OpenAPI_binary_t* binary_data_n4_information, + OpenAPI_binary_t* binary_data_n4_information_ext1, + OpenAPI_binary_t* binary_data_n4_information_ext2 +) +{ + OpenAPI_update_pdu_session_request_t *update_pdu_session_request_local_var = ogs_malloc(sizeof(OpenAPI_update_pdu_session_request_t)); + ogs_assert(update_pdu_session_request_local_var); + + update_pdu_session_request_local_var->json_data = json_data; + update_pdu_session_request_local_var->binary_data_n1_sm_info_from_ue = binary_data_n1_sm_info_from_ue; + update_pdu_session_request_local_var->binary_data_unknown_n1_sm_info = binary_data_unknown_n1_sm_info; + update_pdu_session_request_local_var->binary_data_n4_information = binary_data_n4_information; + update_pdu_session_request_local_var->binary_data_n4_information_ext1 = binary_data_n4_information_ext1; + update_pdu_session_request_local_var->binary_data_n4_information_ext2 = binary_data_n4_information_ext2; + + return update_pdu_session_request_local_var; +} + +void OpenAPI_update_pdu_session_request_free(OpenAPI_update_pdu_session_request_t *update_pdu_session_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == update_pdu_session_request) { + return; + } + if (update_pdu_session_request->json_data) { + OpenAPI_hsmf_update_data_free(update_pdu_session_request->json_data); + update_pdu_session_request->json_data = NULL; + } + if (update_pdu_session_request->binary_data_n1_sm_info_from_ue) { + ogs_free(update_pdu_session_request->binary_data_n1_sm_info_from_ue->data); + update_pdu_session_request->binary_data_n1_sm_info_from_ue = NULL; + } + if (update_pdu_session_request->binary_data_unknown_n1_sm_info) { + ogs_free(update_pdu_session_request->binary_data_unknown_n1_sm_info->data); + update_pdu_session_request->binary_data_unknown_n1_sm_info = NULL; + } + if (update_pdu_session_request->binary_data_n4_information) { + ogs_free(update_pdu_session_request->binary_data_n4_information->data); + update_pdu_session_request->binary_data_n4_information = NULL; + } + if (update_pdu_session_request->binary_data_n4_information_ext1) { + ogs_free(update_pdu_session_request->binary_data_n4_information_ext1->data); + update_pdu_session_request->binary_data_n4_information_ext1 = NULL; + } + if (update_pdu_session_request->binary_data_n4_information_ext2) { + ogs_free(update_pdu_session_request->binary_data_n4_information_ext2->data); + update_pdu_session_request->binary_data_n4_information_ext2 = NULL; + } + ogs_free(update_pdu_session_request); +} + +cJSON *OpenAPI_update_pdu_session_request_convertToJSON(OpenAPI_update_pdu_session_request_t *update_pdu_session_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (update_pdu_session_request == NULL) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed [UpdatePduSession_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (update_pdu_session_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_hsmf_update_data_convertToJSON(update_pdu_session_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (update_pdu_session_request->binary_data_n1_sm_info_from_ue) { + char* encoded_str_binary_data_n1_sm_info_from_ue = OpenAPI_base64encode(update_pdu_session_request->binary_data_n1_sm_info_from_ue->data,update_pdu_session_request->binary_data_n1_sm_info_from_ue->len); + if (cJSON_AddStringToObject(item, "binaryDataN1SmInfoFromUe", encoded_str_binary_data_n1_sm_info_from_ue) == NULL) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed [binary_data_n1_sm_info_from_ue]"); + goto end; + } + ogs_free(encoded_str_binary_data_n1_sm_info_from_ue); + } + + if (update_pdu_session_request->binary_data_unknown_n1_sm_info) { + char* encoded_str_binary_data_unknown_n1_sm_info = OpenAPI_base64encode(update_pdu_session_request->binary_data_unknown_n1_sm_info->data,update_pdu_session_request->binary_data_unknown_n1_sm_info->len); + if (cJSON_AddStringToObject(item, "binaryDataUnknownN1SmInfo", encoded_str_binary_data_unknown_n1_sm_info) == NULL) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed [binary_data_unknown_n1_sm_info]"); + goto end; + } + ogs_free(encoded_str_binary_data_unknown_n1_sm_info); + } + + if (update_pdu_session_request->binary_data_n4_information) { + char* encoded_str_binary_data_n4_information = OpenAPI_base64encode(update_pdu_session_request->binary_data_n4_information->data,update_pdu_session_request->binary_data_n4_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN4Information", encoded_str_binary_data_n4_information) == NULL) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed [binary_data_n4_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information); + } + + if (update_pdu_session_request->binary_data_n4_information_ext1) { + char* encoded_str_binary_data_n4_information_ext1 = OpenAPI_base64encode(update_pdu_session_request->binary_data_n4_information_ext1->data,update_pdu_session_request->binary_data_n4_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN4InformationExt1", encoded_str_binary_data_n4_information_ext1) == NULL) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information_ext1); + } + + if (update_pdu_session_request->binary_data_n4_information_ext2) { + char* encoded_str_binary_data_n4_information_ext2 = OpenAPI_base64encode(update_pdu_session_request->binary_data_n4_information_ext2->data,update_pdu_session_request->binary_data_n4_information_ext2->len); + if (cJSON_AddStringToObject(item, "binaryDataN4InformationExt2", encoded_str_binary_data_n4_information_ext2) == NULL) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + ogs_free(encoded_str_binary_data_n4_information_ext2); + } + +end: + return item; +} + +OpenAPI_update_pdu_session_request_t *OpenAPI_update_pdu_session_request_parseFromJSON(cJSON *update_pdu_session_requestJSON) +{ + OpenAPI_update_pdu_session_request_t *update_pdu_session_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_hsmf_update_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n1_sm_info_from_ue = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n1_sm_info_from_ue = NULL; + cJSON *binary_data_unknown_n1_sm_info = NULL; + OpenAPI_binary_t *decoded_str_binary_data_unknown_n1_sm_info = NULL; + cJSON *binary_data_n4_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information = NULL; + cJSON *binary_data_n4_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information_ext1 = NULL; + cJSON *binary_data_n4_information_ext2 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n4_information_ext2 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(update_pdu_session_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_hsmf_update_data_parseFromJSON(json_data); + } + + binary_data_n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(update_pdu_session_requestJSON, "binaryDataN1SmInfoFromUe"); + if (binary_data_n1_sm_info_from_ue) { + decoded_str_binary_data_n1_sm_info_from_ue = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n1_sm_info_from_ue); + if (!cJSON_IsString(binary_data_n1_sm_info_from_ue)) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_n1_sm_info_from_ue]"); + goto end; + } + decoded_str_binary_data_n1_sm_info_from_ue->data = OpenAPI_base64decode(binary_data_n1_sm_info_from_ue->valuestring, strlen(binary_data_n1_sm_info_from_ue->valuestring), &decoded_str_binary_data_n1_sm_info_from_ue->len); + if (!decoded_str_binary_data_n1_sm_info_from_ue->data) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_n1_sm_info_from_ue]"); + goto end; + } + } + + binary_data_unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(update_pdu_session_requestJSON, "binaryDataUnknownN1SmInfo"); + if (binary_data_unknown_n1_sm_info) { + decoded_str_binary_data_unknown_n1_sm_info = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_unknown_n1_sm_info); + if (!cJSON_IsString(binary_data_unknown_n1_sm_info)) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_unknown_n1_sm_info]"); + goto end; + } + decoded_str_binary_data_unknown_n1_sm_info->data = OpenAPI_base64decode(binary_data_unknown_n1_sm_info->valuestring, strlen(binary_data_unknown_n1_sm_info->valuestring), &decoded_str_binary_data_unknown_n1_sm_info->len); + if (!decoded_str_binary_data_unknown_n1_sm_info->data) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_unknown_n1_sm_info]"); + goto end; + } + } + + binary_data_n4_information = cJSON_GetObjectItemCaseSensitive(update_pdu_session_requestJSON, "binaryDataN4Information"); + if (binary_data_n4_information) { + decoded_str_binary_data_n4_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information); + if (!cJSON_IsString(binary_data_n4_information)) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_n4_information]"); + goto end; + } + decoded_str_binary_data_n4_information->data = OpenAPI_base64decode(binary_data_n4_information->valuestring, strlen(binary_data_n4_information->valuestring), &decoded_str_binary_data_n4_information->len); + if (!decoded_str_binary_data_n4_information->data) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_n4_information]"); + goto end; + } + } + + binary_data_n4_information_ext1 = cJSON_GetObjectItemCaseSensitive(update_pdu_session_requestJSON, "binaryDataN4InformationExt1"); + if (binary_data_n4_information_ext1) { + decoded_str_binary_data_n4_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information_ext1); + if (!cJSON_IsString(binary_data_n4_information_ext1)) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + decoded_str_binary_data_n4_information_ext1->data = OpenAPI_base64decode(binary_data_n4_information_ext1->valuestring, strlen(binary_data_n4_information_ext1->valuestring), &decoded_str_binary_data_n4_information_ext1->len); + if (!decoded_str_binary_data_n4_information_ext1->data) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_n4_information_ext1]"); + goto end; + } + } + + binary_data_n4_information_ext2 = cJSON_GetObjectItemCaseSensitive(update_pdu_session_requestJSON, "binaryDataN4InformationExt2"); + if (binary_data_n4_information_ext2) { + decoded_str_binary_data_n4_information_ext2 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n4_information_ext2); + if (!cJSON_IsString(binary_data_n4_information_ext2)) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + decoded_str_binary_data_n4_information_ext2->data = OpenAPI_base64decode(binary_data_n4_information_ext2->valuestring, strlen(binary_data_n4_information_ext2->valuestring), &decoded_str_binary_data_n4_information_ext2->len); + if (!decoded_str_binary_data_n4_information_ext2->data) { + ogs_error("OpenAPI_update_pdu_session_request_parseFromJSON() failed [binary_data_n4_information_ext2]"); + goto end; + } + } + + update_pdu_session_request_local_var = OpenAPI_update_pdu_session_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n1_sm_info_from_ue ? decoded_str_binary_data_n1_sm_info_from_ue : NULL, + binary_data_unknown_n1_sm_info ? decoded_str_binary_data_unknown_n1_sm_info : NULL, + binary_data_n4_information ? decoded_str_binary_data_n4_information : NULL, + binary_data_n4_information_ext1 ? decoded_str_binary_data_n4_information_ext1 : NULL, + binary_data_n4_information_ext2 ? decoded_str_binary_data_n4_information_ext2 : NULL + ); + + return update_pdu_session_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_hsmf_update_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_update_pdu_session_request_t *OpenAPI_update_pdu_session_request_copy(OpenAPI_update_pdu_session_request_t *dst, OpenAPI_update_pdu_session_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_update_pdu_session_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_update_pdu_session_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_update_pdu_session_request_free(dst); + dst = OpenAPI_update_pdu_session_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/update_pdu_session_request.h b/lib/sbi/openapi/model/update_pdu_session_request.h new file mode 100644 index 000000000..e5b92f597 --- /dev/null +++ b/lib/sbi/openapi/model/update_pdu_session_request.h @@ -0,0 +1,49 @@ +/* + * update_pdu_session_request.h + * + * + */ + +#ifndef _OpenAPI_update_pdu_session_request_H_ +#define _OpenAPI_update_pdu_session_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "hsmf_update_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_update_pdu_session_request_s OpenAPI_update_pdu_session_request_t; +typedef struct OpenAPI_update_pdu_session_request_s { + struct OpenAPI_hsmf_update_data_s *json_data; + OpenAPI_binary_t* binary_data_n1_sm_info_from_ue; + OpenAPI_binary_t* binary_data_unknown_n1_sm_info; + OpenAPI_binary_t* binary_data_n4_information; + OpenAPI_binary_t* binary_data_n4_information_ext1; + OpenAPI_binary_t* binary_data_n4_information_ext2; +} OpenAPI_update_pdu_session_request_t; + +OpenAPI_update_pdu_session_request_t *OpenAPI_update_pdu_session_request_create( + OpenAPI_hsmf_update_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_info_from_ue, + OpenAPI_binary_t* binary_data_unknown_n1_sm_info, + OpenAPI_binary_t* binary_data_n4_information, + OpenAPI_binary_t* binary_data_n4_information_ext1, + OpenAPI_binary_t* binary_data_n4_information_ext2 +); +void OpenAPI_update_pdu_session_request_free(OpenAPI_update_pdu_session_request_t *update_pdu_session_request); +OpenAPI_update_pdu_session_request_t *OpenAPI_update_pdu_session_request_parseFromJSON(cJSON *update_pdu_session_requestJSON); +cJSON *OpenAPI_update_pdu_session_request_convertToJSON(OpenAPI_update_pdu_session_request_t *update_pdu_session_request); +OpenAPI_update_pdu_session_request_t *OpenAPI_update_pdu_session_request_copy(OpenAPI_update_pdu_session_request_t *dst, OpenAPI_update_pdu_session_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_update_pdu_session_request_H_ */ + diff --git a/lib/sbi/openapi/model/update_sm_context_200_response.c b/lib/sbi/openapi/model/update_sm_context_200_response.c new file mode 100644 index 000000000..460ed539a --- /dev/null +++ b/lib/sbi/openapi/model/update_sm_context_200_response.c @@ -0,0 +1,184 @@ + +#include +#include +#include +#include "update_sm_context_200_response.h" + +OpenAPI_update_sm_context_200_response_t *OpenAPI_update_sm_context_200_response_create( + OpenAPI_sm_context_updated_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_message, + OpenAPI_binary_t* binary_data_n2_sm_information +) +{ + OpenAPI_update_sm_context_200_response_t *update_sm_context_200_response_local_var = ogs_malloc(sizeof(OpenAPI_update_sm_context_200_response_t)); + ogs_assert(update_sm_context_200_response_local_var); + + update_sm_context_200_response_local_var->json_data = json_data; + update_sm_context_200_response_local_var->binary_data_n1_sm_message = binary_data_n1_sm_message; + update_sm_context_200_response_local_var->binary_data_n2_sm_information = binary_data_n2_sm_information; + + return update_sm_context_200_response_local_var; +} + +void OpenAPI_update_sm_context_200_response_free(OpenAPI_update_sm_context_200_response_t *update_sm_context_200_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == update_sm_context_200_response) { + return; + } + if (update_sm_context_200_response->json_data) { + OpenAPI_sm_context_updated_data_free(update_sm_context_200_response->json_data); + update_sm_context_200_response->json_data = NULL; + } + if (update_sm_context_200_response->binary_data_n1_sm_message) { + ogs_free(update_sm_context_200_response->binary_data_n1_sm_message->data); + update_sm_context_200_response->binary_data_n1_sm_message = NULL; + } + if (update_sm_context_200_response->binary_data_n2_sm_information) { + ogs_free(update_sm_context_200_response->binary_data_n2_sm_information->data); + update_sm_context_200_response->binary_data_n2_sm_information = NULL; + } + ogs_free(update_sm_context_200_response); +} + +cJSON *OpenAPI_update_sm_context_200_response_convertToJSON(OpenAPI_update_sm_context_200_response_t *update_sm_context_200_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (update_sm_context_200_response == NULL) { + ogs_error("OpenAPI_update_sm_context_200_response_convertToJSON() failed [UpdateSmContext_200_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (update_sm_context_200_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_sm_context_updated_data_convertToJSON(update_sm_context_200_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_update_sm_context_200_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_update_sm_context_200_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (update_sm_context_200_response->binary_data_n1_sm_message) { + char* encoded_str_binary_data_n1_sm_message = OpenAPI_base64encode(update_sm_context_200_response->binary_data_n1_sm_message->data,update_sm_context_200_response->binary_data_n1_sm_message->len); + if (cJSON_AddStringToObject(item, "binaryDataN1SmMessage", encoded_str_binary_data_n1_sm_message) == NULL) { + ogs_error("OpenAPI_update_sm_context_200_response_convertToJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + ogs_free(encoded_str_binary_data_n1_sm_message); + } + + if (update_sm_context_200_response->binary_data_n2_sm_information) { + char* encoded_str_binary_data_n2_sm_information = OpenAPI_base64encode(update_sm_context_200_response->binary_data_n2_sm_information->data,update_sm_context_200_response->binary_data_n2_sm_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2SmInformation", encoded_str_binary_data_n2_sm_information) == NULL) { + ogs_error("OpenAPI_update_sm_context_200_response_convertToJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_sm_information); + } + +end: + return item; +} + +OpenAPI_update_sm_context_200_response_t *OpenAPI_update_sm_context_200_response_parseFromJSON(cJSON *update_sm_context_200_responseJSON) +{ + OpenAPI_update_sm_context_200_response_t *update_sm_context_200_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_sm_context_updated_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n1_sm_message = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n1_sm_message = NULL; + cJSON *binary_data_n2_sm_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_sm_information = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(update_sm_context_200_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_sm_context_updated_data_parseFromJSON(json_data); + } + + binary_data_n1_sm_message = cJSON_GetObjectItemCaseSensitive(update_sm_context_200_responseJSON, "binaryDataN1SmMessage"); + if (binary_data_n1_sm_message) { + decoded_str_binary_data_n1_sm_message = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n1_sm_message); + if (!cJSON_IsString(binary_data_n1_sm_message)) { + ogs_error("OpenAPI_update_sm_context_200_response_parseFromJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + decoded_str_binary_data_n1_sm_message->data = OpenAPI_base64decode(binary_data_n1_sm_message->valuestring, strlen(binary_data_n1_sm_message->valuestring), &decoded_str_binary_data_n1_sm_message->len); + if (!decoded_str_binary_data_n1_sm_message->data) { + ogs_error("OpenAPI_update_sm_context_200_response_parseFromJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + } + + binary_data_n2_sm_information = cJSON_GetObjectItemCaseSensitive(update_sm_context_200_responseJSON, "binaryDataN2SmInformation"); + if (binary_data_n2_sm_information) { + decoded_str_binary_data_n2_sm_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_sm_information); + if (!cJSON_IsString(binary_data_n2_sm_information)) { + ogs_error("OpenAPI_update_sm_context_200_response_parseFromJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + decoded_str_binary_data_n2_sm_information->data = OpenAPI_base64decode(binary_data_n2_sm_information->valuestring, strlen(binary_data_n2_sm_information->valuestring), &decoded_str_binary_data_n2_sm_information->len); + if (!decoded_str_binary_data_n2_sm_information->data) { + ogs_error("OpenAPI_update_sm_context_200_response_parseFromJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + } + + update_sm_context_200_response_local_var = OpenAPI_update_sm_context_200_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n1_sm_message ? decoded_str_binary_data_n1_sm_message : NULL, + binary_data_n2_sm_information ? decoded_str_binary_data_n2_sm_information : NULL + ); + + return update_sm_context_200_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_sm_context_updated_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_update_sm_context_200_response_t *OpenAPI_update_sm_context_200_response_copy(OpenAPI_update_sm_context_200_response_t *dst, OpenAPI_update_sm_context_200_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_update_sm_context_200_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_update_sm_context_200_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_update_sm_context_200_response_free(dst); + dst = OpenAPI_update_sm_context_200_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/update_sm_context_200_response.h b/lib/sbi/openapi/model/update_sm_context_200_response.h new file mode 100644 index 000000000..b50a9028e --- /dev/null +++ b/lib/sbi/openapi/model/update_sm_context_200_response.h @@ -0,0 +1,43 @@ +/* + * update_sm_context_200_response.h + * + * + */ + +#ifndef _OpenAPI_update_sm_context_200_response_H_ +#define _OpenAPI_update_sm_context_200_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sm_context_updated_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_update_sm_context_200_response_s OpenAPI_update_sm_context_200_response_t; +typedef struct OpenAPI_update_sm_context_200_response_s { + struct OpenAPI_sm_context_updated_data_s *json_data; + OpenAPI_binary_t* binary_data_n1_sm_message; + OpenAPI_binary_t* binary_data_n2_sm_information; +} OpenAPI_update_sm_context_200_response_t; + +OpenAPI_update_sm_context_200_response_t *OpenAPI_update_sm_context_200_response_create( + OpenAPI_sm_context_updated_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_message, + OpenAPI_binary_t* binary_data_n2_sm_information +); +void OpenAPI_update_sm_context_200_response_free(OpenAPI_update_sm_context_200_response_t *update_sm_context_200_response); +OpenAPI_update_sm_context_200_response_t *OpenAPI_update_sm_context_200_response_parseFromJSON(cJSON *update_sm_context_200_responseJSON); +cJSON *OpenAPI_update_sm_context_200_response_convertToJSON(OpenAPI_update_sm_context_200_response_t *update_sm_context_200_response); +OpenAPI_update_sm_context_200_response_t *OpenAPI_update_sm_context_200_response_copy(OpenAPI_update_sm_context_200_response_t *dst, OpenAPI_update_sm_context_200_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_update_sm_context_200_response_H_ */ + diff --git a/lib/sbi/openapi/model/update_sm_context_400_response.c b/lib/sbi/openapi/model/update_sm_context_400_response.c new file mode 100644 index 000000000..24af9e77a --- /dev/null +++ b/lib/sbi/openapi/model/update_sm_context_400_response.c @@ -0,0 +1,184 @@ + +#include +#include +#include +#include "update_sm_context_400_response.h" + +OpenAPI_update_sm_context_400_response_t *OpenAPI_update_sm_context_400_response_create( + OpenAPI_sm_context_update_error_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_message, + OpenAPI_binary_t* binary_data_n2_sm_information +) +{ + OpenAPI_update_sm_context_400_response_t *update_sm_context_400_response_local_var = ogs_malloc(sizeof(OpenAPI_update_sm_context_400_response_t)); + ogs_assert(update_sm_context_400_response_local_var); + + update_sm_context_400_response_local_var->json_data = json_data; + update_sm_context_400_response_local_var->binary_data_n1_sm_message = binary_data_n1_sm_message; + update_sm_context_400_response_local_var->binary_data_n2_sm_information = binary_data_n2_sm_information; + + return update_sm_context_400_response_local_var; +} + +void OpenAPI_update_sm_context_400_response_free(OpenAPI_update_sm_context_400_response_t *update_sm_context_400_response) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == update_sm_context_400_response) { + return; + } + if (update_sm_context_400_response->json_data) { + OpenAPI_sm_context_update_error_free(update_sm_context_400_response->json_data); + update_sm_context_400_response->json_data = NULL; + } + if (update_sm_context_400_response->binary_data_n1_sm_message) { + ogs_free(update_sm_context_400_response->binary_data_n1_sm_message->data); + update_sm_context_400_response->binary_data_n1_sm_message = NULL; + } + if (update_sm_context_400_response->binary_data_n2_sm_information) { + ogs_free(update_sm_context_400_response->binary_data_n2_sm_information->data); + update_sm_context_400_response->binary_data_n2_sm_information = NULL; + } + ogs_free(update_sm_context_400_response); +} + +cJSON *OpenAPI_update_sm_context_400_response_convertToJSON(OpenAPI_update_sm_context_400_response_t *update_sm_context_400_response) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (update_sm_context_400_response == NULL) { + ogs_error("OpenAPI_update_sm_context_400_response_convertToJSON() failed [UpdateSmContext_400_response]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (update_sm_context_400_response->json_data) { + cJSON *json_data_local_JSON = OpenAPI_sm_context_update_error_convertToJSON(update_sm_context_400_response->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_update_sm_context_400_response_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_update_sm_context_400_response_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (update_sm_context_400_response->binary_data_n1_sm_message) { + char* encoded_str_binary_data_n1_sm_message = OpenAPI_base64encode(update_sm_context_400_response->binary_data_n1_sm_message->data,update_sm_context_400_response->binary_data_n1_sm_message->len); + if (cJSON_AddStringToObject(item, "binaryDataN1SmMessage", encoded_str_binary_data_n1_sm_message) == NULL) { + ogs_error("OpenAPI_update_sm_context_400_response_convertToJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + ogs_free(encoded_str_binary_data_n1_sm_message); + } + + if (update_sm_context_400_response->binary_data_n2_sm_information) { + char* encoded_str_binary_data_n2_sm_information = OpenAPI_base64encode(update_sm_context_400_response->binary_data_n2_sm_information->data,update_sm_context_400_response->binary_data_n2_sm_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2SmInformation", encoded_str_binary_data_n2_sm_information) == NULL) { + ogs_error("OpenAPI_update_sm_context_400_response_convertToJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_sm_information); + } + +end: + return item; +} + +OpenAPI_update_sm_context_400_response_t *OpenAPI_update_sm_context_400_response_parseFromJSON(cJSON *update_sm_context_400_responseJSON) +{ + OpenAPI_update_sm_context_400_response_t *update_sm_context_400_response_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_sm_context_update_error_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n1_sm_message = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n1_sm_message = NULL; + cJSON *binary_data_n2_sm_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_sm_information = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(update_sm_context_400_responseJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_sm_context_update_error_parseFromJSON(json_data); + } + + binary_data_n1_sm_message = cJSON_GetObjectItemCaseSensitive(update_sm_context_400_responseJSON, "binaryDataN1SmMessage"); + if (binary_data_n1_sm_message) { + decoded_str_binary_data_n1_sm_message = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n1_sm_message); + if (!cJSON_IsString(binary_data_n1_sm_message)) { + ogs_error("OpenAPI_update_sm_context_400_response_parseFromJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + decoded_str_binary_data_n1_sm_message->data = OpenAPI_base64decode(binary_data_n1_sm_message->valuestring, strlen(binary_data_n1_sm_message->valuestring), &decoded_str_binary_data_n1_sm_message->len); + if (!decoded_str_binary_data_n1_sm_message->data) { + ogs_error("OpenAPI_update_sm_context_400_response_parseFromJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + } + + binary_data_n2_sm_information = cJSON_GetObjectItemCaseSensitive(update_sm_context_400_responseJSON, "binaryDataN2SmInformation"); + if (binary_data_n2_sm_information) { + decoded_str_binary_data_n2_sm_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_sm_information); + if (!cJSON_IsString(binary_data_n2_sm_information)) { + ogs_error("OpenAPI_update_sm_context_400_response_parseFromJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + decoded_str_binary_data_n2_sm_information->data = OpenAPI_base64decode(binary_data_n2_sm_information->valuestring, strlen(binary_data_n2_sm_information->valuestring), &decoded_str_binary_data_n2_sm_information->len); + if (!decoded_str_binary_data_n2_sm_information->data) { + ogs_error("OpenAPI_update_sm_context_400_response_parseFromJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + } + + update_sm_context_400_response_local_var = OpenAPI_update_sm_context_400_response_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n1_sm_message ? decoded_str_binary_data_n1_sm_message : NULL, + binary_data_n2_sm_information ? decoded_str_binary_data_n2_sm_information : NULL + ); + + return update_sm_context_400_response_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_sm_context_update_error_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_update_sm_context_400_response_t *OpenAPI_update_sm_context_400_response_copy(OpenAPI_update_sm_context_400_response_t *dst, OpenAPI_update_sm_context_400_response_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_update_sm_context_400_response_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_update_sm_context_400_response_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_update_sm_context_400_response_free(dst); + dst = OpenAPI_update_sm_context_400_response_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/update_sm_context_400_response.h b/lib/sbi/openapi/model/update_sm_context_400_response.h new file mode 100644 index 000000000..d668f7e9c --- /dev/null +++ b/lib/sbi/openapi/model/update_sm_context_400_response.h @@ -0,0 +1,43 @@ +/* + * update_sm_context_400_response.h + * + * + */ + +#ifndef _OpenAPI_update_sm_context_400_response_H_ +#define _OpenAPI_update_sm_context_400_response_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sm_context_update_error.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_update_sm_context_400_response_s OpenAPI_update_sm_context_400_response_t; +typedef struct OpenAPI_update_sm_context_400_response_s { + struct OpenAPI_sm_context_update_error_s *json_data; + OpenAPI_binary_t* binary_data_n1_sm_message; + OpenAPI_binary_t* binary_data_n2_sm_information; +} OpenAPI_update_sm_context_400_response_t; + +OpenAPI_update_sm_context_400_response_t *OpenAPI_update_sm_context_400_response_create( + OpenAPI_sm_context_update_error_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_message, + OpenAPI_binary_t* binary_data_n2_sm_information +); +void OpenAPI_update_sm_context_400_response_free(OpenAPI_update_sm_context_400_response_t *update_sm_context_400_response); +OpenAPI_update_sm_context_400_response_t *OpenAPI_update_sm_context_400_response_parseFromJSON(cJSON *update_sm_context_400_responseJSON); +cJSON *OpenAPI_update_sm_context_400_response_convertToJSON(OpenAPI_update_sm_context_400_response_t *update_sm_context_400_response); +OpenAPI_update_sm_context_400_response_t *OpenAPI_update_sm_context_400_response_copy(OpenAPI_update_sm_context_400_response_t *dst, OpenAPI_update_sm_context_400_response_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_update_sm_context_400_response_H_ */ + diff --git a/lib/sbi/openapi/model/update_sm_context_request.c b/lib/sbi/openapi/model/update_sm_context_request.c new file mode 100644 index 000000000..000ee3579 --- /dev/null +++ b/lib/sbi/openapi/model/update_sm_context_request.c @@ -0,0 +1,217 @@ + +#include +#include +#include +#include "update_sm_context_request.h" + +OpenAPI_update_sm_context_request_t *OpenAPI_update_sm_context_request_create( + OpenAPI_sm_context_update_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_message, + OpenAPI_binary_t* binary_data_n2_sm_information, + OpenAPI_binary_t* binary_data_n2_sm_information_ext1 +) +{ + OpenAPI_update_sm_context_request_t *update_sm_context_request_local_var = ogs_malloc(sizeof(OpenAPI_update_sm_context_request_t)); + ogs_assert(update_sm_context_request_local_var); + + update_sm_context_request_local_var->json_data = json_data; + update_sm_context_request_local_var->binary_data_n1_sm_message = binary_data_n1_sm_message; + update_sm_context_request_local_var->binary_data_n2_sm_information = binary_data_n2_sm_information; + update_sm_context_request_local_var->binary_data_n2_sm_information_ext1 = binary_data_n2_sm_information_ext1; + + return update_sm_context_request_local_var; +} + +void OpenAPI_update_sm_context_request_free(OpenAPI_update_sm_context_request_t *update_sm_context_request) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == update_sm_context_request) { + return; + } + if (update_sm_context_request->json_data) { + OpenAPI_sm_context_update_data_free(update_sm_context_request->json_data); + update_sm_context_request->json_data = NULL; + } + if (update_sm_context_request->binary_data_n1_sm_message) { + ogs_free(update_sm_context_request->binary_data_n1_sm_message->data); + update_sm_context_request->binary_data_n1_sm_message = NULL; + } + if (update_sm_context_request->binary_data_n2_sm_information) { + ogs_free(update_sm_context_request->binary_data_n2_sm_information->data); + update_sm_context_request->binary_data_n2_sm_information = NULL; + } + if (update_sm_context_request->binary_data_n2_sm_information_ext1) { + ogs_free(update_sm_context_request->binary_data_n2_sm_information_ext1->data); + update_sm_context_request->binary_data_n2_sm_information_ext1 = NULL; + } + ogs_free(update_sm_context_request); +} + +cJSON *OpenAPI_update_sm_context_request_convertToJSON(OpenAPI_update_sm_context_request_t *update_sm_context_request) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if (update_sm_context_request == NULL) { + ogs_error("OpenAPI_update_sm_context_request_convertToJSON() failed [UpdateSmContext_request]"); + return NULL; + } + + item = cJSON_CreateObject(); + if (update_sm_context_request->json_data) { + cJSON *json_data_local_JSON = OpenAPI_sm_context_update_data_convertToJSON(update_sm_context_request->json_data); + if (json_data_local_JSON == NULL) { + ogs_error("OpenAPI_update_sm_context_request_convertToJSON() failed [json_data]"); + goto end; + } + cJSON_AddItemToObject(item, "jsonData", json_data_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_update_sm_context_request_convertToJSON() failed [json_data]"); + goto end; + } + } + + if (update_sm_context_request->binary_data_n1_sm_message) { + char* encoded_str_binary_data_n1_sm_message = OpenAPI_base64encode(update_sm_context_request->binary_data_n1_sm_message->data,update_sm_context_request->binary_data_n1_sm_message->len); + if (cJSON_AddStringToObject(item, "binaryDataN1SmMessage", encoded_str_binary_data_n1_sm_message) == NULL) { + ogs_error("OpenAPI_update_sm_context_request_convertToJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + ogs_free(encoded_str_binary_data_n1_sm_message); + } + + if (update_sm_context_request->binary_data_n2_sm_information) { + char* encoded_str_binary_data_n2_sm_information = OpenAPI_base64encode(update_sm_context_request->binary_data_n2_sm_information->data,update_sm_context_request->binary_data_n2_sm_information->len); + if (cJSON_AddStringToObject(item, "binaryDataN2SmInformation", encoded_str_binary_data_n2_sm_information) == NULL) { + ogs_error("OpenAPI_update_sm_context_request_convertToJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_sm_information); + } + + if (update_sm_context_request->binary_data_n2_sm_information_ext1) { + char* encoded_str_binary_data_n2_sm_information_ext1 = OpenAPI_base64encode(update_sm_context_request->binary_data_n2_sm_information_ext1->data,update_sm_context_request->binary_data_n2_sm_information_ext1->len); + if (cJSON_AddStringToObject(item, "binaryDataN2SmInformationExt1", encoded_str_binary_data_n2_sm_information_ext1) == NULL) { + ogs_error("OpenAPI_update_sm_context_request_convertToJSON() failed [binary_data_n2_sm_information_ext1]"); + goto end; + } + ogs_free(encoded_str_binary_data_n2_sm_information_ext1); + } + +end: + return item; +} + +OpenAPI_update_sm_context_request_t *OpenAPI_update_sm_context_request_parseFromJSON(cJSON *update_sm_context_requestJSON) +{ + OpenAPI_update_sm_context_request_t *update_sm_context_request_local_var = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *json_data = NULL; + OpenAPI_sm_context_update_data_t *json_data_local_nonprim = NULL; + cJSON *binary_data_n1_sm_message = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n1_sm_message = NULL; + cJSON *binary_data_n2_sm_information = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_sm_information = NULL; + cJSON *binary_data_n2_sm_information_ext1 = NULL; + OpenAPI_binary_t *decoded_str_binary_data_n2_sm_information_ext1 = NULL; + json_data = cJSON_GetObjectItemCaseSensitive(update_sm_context_requestJSON, "jsonData"); + if (json_data) { + json_data_local_nonprim = OpenAPI_sm_context_update_data_parseFromJSON(json_data); + } + + binary_data_n1_sm_message = cJSON_GetObjectItemCaseSensitive(update_sm_context_requestJSON, "binaryDataN1SmMessage"); + if (binary_data_n1_sm_message) { + decoded_str_binary_data_n1_sm_message = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n1_sm_message); + if (!cJSON_IsString(binary_data_n1_sm_message)) { + ogs_error("OpenAPI_update_sm_context_request_parseFromJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + decoded_str_binary_data_n1_sm_message->data = OpenAPI_base64decode(binary_data_n1_sm_message->valuestring, strlen(binary_data_n1_sm_message->valuestring), &decoded_str_binary_data_n1_sm_message->len); + if (!decoded_str_binary_data_n1_sm_message->data) { + ogs_error("OpenAPI_update_sm_context_request_parseFromJSON() failed [binary_data_n1_sm_message]"); + goto end; + } + } + + binary_data_n2_sm_information = cJSON_GetObjectItemCaseSensitive(update_sm_context_requestJSON, "binaryDataN2SmInformation"); + if (binary_data_n2_sm_information) { + decoded_str_binary_data_n2_sm_information = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_sm_information); + if (!cJSON_IsString(binary_data_n2_sm_information)) { + ogs_error("OpenAPI_update_sm_context_request_parseFromJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + decoded_str_binary_data_n2_sm_information->data = OpenAPI_base64decode(binary_data_n2_sm_information->valuestring, strlen(binary_data_n2_sm_information->valuestring), &decoded_str_binary_data_n2_sm_information->len); + if (!decoded_str_binary_data_n2_sm_information->data) { + ogs_error("OpenAPI_update_sm_context_request_parseFromJSON() failed [binary_data_n2_sm_information]"); + goto end; + } + } + + binary_data_n2_sm_information_ext1 = cJSON_GetObjectItemCaseSensitive(update_sm_context_requestJSON, "binaryDataN2SmInformationExt1"); + if (binary_data_n2_sm_information_ext1) { + decoded_str_binary_data_n2_sm_information_ext1 = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_binary_data_n2_sm_information_ext1); + if (!cJSON_IsString(binary_data_n2_sm_information_ext1)) { + ogs_error("OpenAPI_update_sm_context_request_parseFromJSON() failed [binary_data_n2_sm_information_ext1]"); + goto end; + } + decoded_str_binary_data_n2_sm_information_ext1->data = OpenAPI_base64decode(binary_data_n2_sm_information_ext1->valuestring, strlen(binary_data_n2_sm_information_ext1->valuestring), &decoded_str_binary_data_n2_sm_information_ext1->len); + if (!decoded_str_binary_data_n2_sm_information_ext1->data) { + ogs_error("OpenAPI_update_sm_context_request_parseFromJSON() failed [binary_data_n2_sm_information_ext1]"); + goto end; + } + } + + update_sm_context_request_local_var = OpenAPI_update_sm_context_request_create ( + json_data ? json_data_local_nonprim : NULL, + binary_data_n1_sm_message ? decoded_str_binary_data_n1_sm_message : NULL, + binary_data_n2_sm_information ? decoded_str_binary_data_n2_sm_information : NULL, + binary_data_n2_sm_information_ext1 ? decoded_str_binary_data_n2_sm_information_ext1 : NULL + ); + + return update_sm_context_request_local_var; +end: + if (json_data_local_nonprim) { + OpenAPI_sm_context_update_data_free(json_data_local_nonprim); + json_data_local_nonprim = NULL; + } + return NULL; +} + +OpenAPI_update_sm_context_request_t *OpenAPI_update_sm_context_request_copy(OpenAPI_update_sm_context_request_t *dst, OpenAPI_update_sm_context_request_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_update_sm_context_request_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_update_sm_context_request_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_update_sm_context_request_free(dst); + dst = OpenAPI_update_sm_context_request_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} + diff --git a/lib/sbi/openapi/model/update_sm_context_request.h b/lib/sbi/openapi/model/update_sm_context_request.h new file mode 100644 index 000000000..a028137d4 --- /dev/null +++ b/lib/sbi/openapi/model/update_sm_context_request.h @@ -0,0 +1,45 @@ +/* + * update_sm_context_request.h + * + * + */ + +#ifndef _OpenAPI_update_sm_context_request_H_ +#define _OpenAPI_update_sm_context_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +#include "sm_context_update_data.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_update_sm_context_request_s OpenAPI_update_sm_context_request_t; +typedef struct OpenAPI_update_sm_context_request_s { + struct OpenAPI_sm_context_update_data_s *json_data; + OpenAPI_binary_t* binary_data_n1_sm_message; + OpenAPI_binary_t* binary_data_n2_sm_information; + OpenAPI_binary_t* binary_data_n2_sm_information_ext1; +} OpenAPI_update_sm_context_request_t; + +OpenAPI_update_sm_context_request_t *OpenAPI_update_sm_context_request_create( + OpenAPI_sm_context_update_data_t *json_data, + OpenAPI_binary_t* binary_data_n1_sm_message, + OpenAPI_binary_t* binary_data_n2_sm_information, + OpenAPI_binary_t* binary_data_n2_sm_information_ext1 +); +void OpenAPI_update_sm_context_request_free(OpenAPI_update_sm_context_request_t *update_sm_context_request); +OpenAPI_update_sm_context_request_t *OpenAPI_update_sm_context_request_parseFromJSON(cJSON *update_sm_context_requestJSON); +cJSON *OpenAPI_update_sm_context_request_convertToJSON(OpenAPI_update_sm_context_request_t *update_sm_context_request); +OpenAPI_update_sm_context_request_t *OpenAPI_update_sm_context_request_copy(OpenAPI_update_sm_context_request_t *dst, OpenAPI_update_sm_context_request_t *src); + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_update_sm_context_request_H_ */ + diff --git a/lib/sbi/openapi/model/updated_item.c b/lib/sbi/openapi/model/updated_item.c index caf9bb3ff..734d98966 100644 --- a/lib/sbi/openapi/model/updated_item.c +++ b/lib/sbi/openapi/model/updated_item.c @@ -20,18 +20,26 @@ OpenAPI_updated_item_t *OpenAPI_updated_item_create( void OpenAPI_updated_item_free(OpenAPI_updated_item_t *updated_item) { + OpenAPI_lnode_t *node = NULL; + if (NULL == updated_item) { return; } - OpenAPI_lnode_t *node; - ogs_free(updated_item->item); - ogs_free(updated_item->value); + if (updated_item->item) { + ogs_free(updated_item->item); + updated_item->item = NULL; + } + if (updated_item->value) { + ogs_free(updated_item->value); + updated_item->value = NULL; + } ogs_free(updated_item); } cJSON *OpenAPI_updated_item_convertToJSON(OpenAPI_updated_item_t *updated_item) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (updated_item == NULL) { ogs_error("OpenAPI_updated_item_convertToJSON() failed [UpdatedItem]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_updated_item_convertToJSON(OpenAPI_updated_item_t *updated_item) } item = cJSON_CreateObject(); + if (!updated_item->item) { + ogs_error("OpenAPI_updated_item_convertToJSON() failed [item]"); + return NULL; + } if (cJSON_AddStringToObject(item, "item", updated_item->item) == NULL) { ogs_error("OpenAPI_updated_item_convertToJSON() failed [item]"); goto end; } + if (!updated_item->value) { + ogs_error("OpenAPI_updated_item_convertToJSON() failed [value]"); + return NULL; + } if (cJSON_AddStringToObject(item, "value", updated_item->value) == NULL) { ogs_error("OpenAPI_updated_item_convertToJSON() failed [value]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_updated_item_t *OpenAPI_updated_item_parseFromJSON(cJSON *updated_itemJSON) { OpenAPI_updated_item_t *updated_item_local_var = NULL; - cJSON *item = cJSON_GetObjectItemCaseSensitive(updated_itemJSON, "item"); + OpenAPI_lnode_t *node = NULL; + cJSON *item = NULL; + cJSON *value = NULL; + item = cJSON_GetObjectItemCaseSensitive(updated_itemJSON, "item"); if (!item) { ogs_error("OpenAPI_updated_item_parseFromJSON() failed [item]"); goto end; } - if (!cJSON_IsString(item)) { ogs_error("OpenAPI_updated_item_parseFromJSON() failed [item]"); goto end; } - cJSON *value = cJSON_GetObjectItemCaseSensitive(updated_itemJSON, "value"); + value = cJSON_GetObjectItemCaseSensitive(updated_itemJSON, "value"); if (!value) { ogs_error("OpenAPI_updated_item_parseFromJSON() failed [value]"); goto end; } - if (!cJSON_IsString(value)) { ogs_error("OpenAPI_updated_item_parseFromJSON() failed [value]"); goto end; diff --git a/lib/sbi/openapi/model/upf_cond.c b/lib/sbi/openapi/model/upf_cond.c index 38733c4d2..a41077255 100644 --- a/lib/sbi/openapi/model/upf_cond.c +++ b/lib/sbi/openapi/model/upf_cond.c @@ -45,24 +45,32 @@ OpenAPI_upf_cond_t *OpenAPI_upf_cond_create( void OpenAPI_upf_cond_free(OpenAPI_upf_cond_t *upf_cond) { + OpenAPI_lnode_t *node = NULL; + if (NULL == upf_cond) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(upf_cond->smf_serving_area, node) { - ogs_free(node->data); + if (upf_cond->smf_serving_area) { + OpenAPI_list_for_each(upf_cond->smf_serving_area, node) { + ogs_free(node->data); + } + OpenAPI_list_free(upf_cond->smf_serving_area); + upf_cond->smf_serving_area = NULL; } - OpenAPI_list_free(upf_cond->smf_serving_area); - OpenAPI_list_for_each(upf_cond->tai_list, node) { - OpenAPI_tai_free(node->data); + if (upf_cond->tai_list) { + OpenAPI_list_for_each(upf_cond->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(upf_cond->tai_list); + upf_cond->tai_list = NULL; } - OpenAPI_list_free(upf_cond->tai_list); ogs_free(upf_cond); } cJSON *OpenAPI_upf_cond_convertToJSON(OpenAPI_upf_cond_t *upf_cond) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (upf_cond == NULL) { ogs_error("OpenAPI_upf_cond_convertToJSON() failed [UpfCond]"); @@ -70,25 +78,27 @@ cJSON *OpenAPI_upf_cond_convertToJSON(OpenAPI_upf_cond_t *upf_cond) } item = cJSON_CreateObject(); + if (upf_cond->condition_type == OpenAPI_upf_cond_CONDITIONTYPE_NULL) { + ogs_error("OpenAPI_upf_cond_convertToJSON() failed [condition_type]"); + return NULL; + } if (cJSON_AddStringToObject(item, "conditionType", OpenAPI_condition_typeupf_cond_ToString(upf_cond->condition_type)) == NULL) { ogs_error("OpenAPI_upf_cond_convertToJSON() failed [condition_type]"); goto end; } if (upf_cond->smf_serving_area) { - cJSON *smf_serving_area = cJSON_AddArrayToObject(item, "smfServingArea"); - if (smf_serving_area == NULL) { + cJSON *smf_serving_areaList = cJSON_AddArrayToObject(item, "smfServingArea"); + if (smf_serving_areaList == NULL) { ogs_error("OpenAPI_upf_cond_convertToJSON() failed [smf_serving_area]"); goto end; } - - OpenAPI_lnode_t *smf_serving_area_node; - OpenAPI_list_for_each(upf_cond->smf_serving_area, smf_serving_area_node) { - if (cJSON_AddStringToObject(smf_serving_area, "", (char*)smf_serving_area_node->data) == NULL) { - ogs_error("OpenAPI_upf_cond_convertToJSON() failed [smf_serving_area]"); - goto end; + OpenAPI_list_for_each(upf_cond->smf_serving_area, node) { + if (cJSON_AddStringToObject(smf_serving_areaList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_upf_cond_convertToJSON() failed [smf_serving_area]"); + goto end; + } } - } } if (upf_cond->tai_list) { @@ -97,17 +107,13 @@ cJSON *OpenAPI_upf_cond_convertToJSON(OpenAPI_upf_cond_t *upf_cond) ogs_error("OpenAPI_upf_cond_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (upf_cond->tai_list) { - OpenAPI_list_for_each(upf_cond->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_upf_cond_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(upf_cond->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upf_cond_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } } @@ -118,66 +124,68 @@ end: OpenAPI_upf_cond_t *OpenAPI_upf_cond_parseFromJSON(cJSON *upf_condJSON) { OpenAPI_upf_cond_t *upf_cond_local_var = NULL; - cJSON *condition_type = cJSON_GetObjectItemCaseSensitive(upf_condJSON, "conditionType"); + OpenAPI_lnode_t *node = NULL; + cJSON *condition_type = NULL; + OpenAPI_upf_cond_condition_type_e condition_typeVariable = 0; + cJSON *smf_serving_area = NULL; + OpenAPI_list_t *smf_serving_areaList = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + condition_type = cJSON_GetObjectItemCaseSensitive(upf_condJSON, "conditionType"); if (!condition_type) { ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [condition_type]"); goto end; } - - OpenAPI_upf_cond_condition_type_e condition_typeVariable; if (!cJSON_IsString(condition_type)) { ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [condition_type]"); goto end; } condition_typeVariable = OpenAPI_condition_typeupf_cond_FromString(condition_type->valuestring); - cJSON *smf_serving_area = cJSON_GetObjectItemCaseSensitive(upf_condJSON, "smfServingArea"); - - OpenAPI_list_t *smf_serving_areaList; + smf_serving_area = cJSON_GetObjectItemCaseSensitive(upf_condJSON, "smfServingArea"); if (smf_serving_area) { - cJSON *smf_serving_area_local; - if (!cJSON_IsArray(smf_serving_area)) { - ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [smf_serving_area]"); - goto end; - } - smf_serving_areaList = OpenAPI_list_create(); + cJSON *smf_serving_area_local = NULL; + if (!cJSON_IsArray(smf_serving_area)) { + ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [smf_serving_area]"); + goto end; + } - cJSON_ArrayForEach(smf_serving_area_local, smf_serving_area) { - if (!cJSON_IsString(smf_serving_area_local)) { - ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [smf_serving_area]"); - goto end; - } - OpenAPI_list_add(smf_serving_areaList, ogs_strdup(smf_serving_area_local->valuestring)); - } + smf_serving_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_serving_area_local, smf_serving_area) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(smf_serving_area_local)) { + ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [smf_serving_area]"); + goto end; + } + OpenAPI_list_add(smf_serving_areaList, ogs_strdup(smf_serving_area_local->valuestring)); + } } - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(upf_condJSON, "taiList"); - - OpenAPI_list_t *tai_listList; + tai_list = cJSON_GetObjectItemCaseSensitive(upf_condJSON, "taiList"); if (tai_list) { - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_upf_cond_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - - OpenAPI_list_add(tai_listList, tai_listItem); - } } upf_cond_local_var = OpenAPI_upf_cond_create ( @@ -188,6 +196,20 @@ OpenAPI_upf_cond_t *OpenAPI_upf_cond_parseFromJSON(cJSON *upf_condJSON) return upf_cond_local_var; end: + if (smf_serving_areaList) { + OpenAPI_list_for_each(smf_serving_areaList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(smf_serving_areaList); + smf_serving_areaList = NULL; + } + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/upf_info.c b/lib/sbi/openapi/model/upf_info.c index 385590aaf..170c0583b 100644 --- a/lib/sbi/openapi/model/upf_info.c +++ b/lib/sbi/openapi/model/upf_info.c @@ -58,37 +58,66 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_create( void OpenAPI_upf_info_free(OpenAPI_upf_info_t *upf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == upf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(upf_info->s_nssai_upf_info_list, node) { - OpenAPI_snssai_upf_info_item_free(node->data); + if (upf_info->s_nssai_upf_info_list) { + OpenAPI_list_for_each(upf_info->s_nssai_upf_info_list, node) { + OpenAPI_snssai_upf_info_item_free(node->data); + } + OpenAPI_list_free(upf_info->s_nssai_upf_info_list); + upf_info->s_nssai_upf_info_list = NULL; } - OpenAPI_list_free(upf_info->s_nssai_upf_info_list); - OpenAPI_list_for_each(upf_info->smf_serving_area, node) { - ogs_free(node->data); + if (upf_info->smf_serving_area) { + OpenAPI_list_for_each(upf_info->smf_serving_area, node) { + ogs_free(node->data); + } + OpenAPI_list_free(upf_info->smf_serving_area); + upf_info->smf_serving_area = NULL; } - OpenAPI_list_free(upf_info->smf_serving_area); - OpenAPI_list_for_each(upf_info->interface_upf_info_list, node) { - OpenAPI_interface_upf_info_item_free(node->data); + if (upf_info->interface_upf_info_list) { + OpenAPI_list_for_each(upf_info->interface_upf_info_list, node) { + OpenAPI_interface_upf_info_item_free(node->data); + } + OpenAPI_list_free(upf_info->interface_upf_info_list); + upf_info->interface_upf_info_list = NULL; } - OpenAPI_list_free(upf_info->interface_upf_info_list); - OpenAPI_list_free(upf_info->pdu_session_types); - OpenAPI_atsss_capability_free(upf_info->atsss_capability); - OpenAPI_list_for_each(upf_info->tai_list, node) { - OpenAPI_tai_free(node->data); + if (upf_info->pdu_session_types) { + OpenAPI_list_free(upf_info->pdu_session_types); + upf_info->pdu_session_types = NULL; + } + if (upf_info->atsss_capability) { + OpenAPI_atsss_capability_free(upf_info->atsss_capability); + upf_info->atsss_capability = NULL; + } + if (upf_info->tai_list) { + OpenAPI_list_for_each(upf_info->tai_list, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(upf_info->tai_list); + upf_info->tai_list = NULL; + } + if (upf_info->w_agf_info) { + OpenAPI_w_agf_info_free(upf_info->w_agf_info); + upf_info->w_agf_info = NULL; + } + if (upf_info->tngf_info) { + OpenAPI_tngf_info_free(upf_info->tngf_info); + upf_info->tngf_info = NULL; + } + if (upf_info->twif_info) { + OpenAPI_twif_info_free(upf_info->twif_info); + upf_info->twif_info = NULL; } - OpenAPI_list_free(upf_info->tai_list); - OpenAPI_w_agf_info_free(upf_info->w_agf_info); - OpenAPI_tngf_info_free(upf_info->tngf_info); - OpenAPI_twif_info_free(upf_info->twif_info); ogs_free(upf_info); } cJSON *OpenAPI_upf_info_convertToJSON(OpenAPI_upf_info_t *upf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (upf_info == NULL) { ogs_error("OpenAPI_upf_info_convertToJSON() failed [UpfInfo]"); @@ -96,38 +125,36 @@ cJSON *OpenAPI_upf_info_convertToJSON(OpenAPI_upf_info_t *upf_info) } item = cJSON_CreateObject(); + if (!upf_info->s_nssai_upf_info_list) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [s_nssai_upf_info_list]"); + return NULL; + } cJSON *s_nssai_upf_info_listList = cJSON_AddArrayToObject(item, "sNssaiUpfInfoList"); if (s_nssai_upf_info_listList == NULL) { ogs_error("OpenAPI_upf_info_convertToJSON() failed [s_nssai_upf_info_list]"); goto end; } - - OpenAPI_lnode_t *s_nssai_upf_info_list_node; - if (upf_info->s_nssai_upf_info_list) { - OpenAPI_list_for_each(upf_info->s_nssai_upf_info_list, s_nssai_upf_info_list_node) { - cJSON *itemLocal = OpenAPI_snssai_upf_info_item_convertToJSON(s_nssai_upf_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_upf_info_convertToJSON() failed [s_nssai_upf_info_list]"); - goto end; - } - cJSON_AddItemToArray(s_nssai_upf_info_listList, itemLocal); + OpenAPI_list_for_each(upf_info->s_nssai_upf_info_list, node) { + cJSON *itemLocal = OpenAPI_snssai_upf_info_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [s_nssai_upf_info_list]"); + goto end; } + cJSON_AddItemToArray(s_nssai_upf_info_listList, itemLocal); } if (upf_info->smf_serving_area) { - cJSON *smf_serving_area = cJSON_AddArrayToObject(item, "smfServingArea"); - if (smf_serving_area == NULL) { + cJSON *smf_serving_areaList = cJSON_AddArrayToObject(item, "smfServingArea"); + if (smf_serving_areaList == NULL) { ogs_error("OpenAPI_upf_info_convertToJSON() failed [smf_serving_area]"); goto end; } - - OpenAPI_lnode_t *smf_serving_area_node; - OpenAPI_list_for_each(upf_info->smf_serving_area, smf_serving_area_node) { - if (cJSON_AddStringToObject(smf_serving_area, "", (char*)smf_serving_area_node->data) == NULL) { - ogs_error("OpenAPI_upf_info_convertToJSON() failed [smf_serving_area]"); - goto end; + OpenAPI_list_for_each(upf_info->smf_serving_area, node) { + if (cJSON_AddStringToObject(smf_serving_areaList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [smf_serving_area]"); + goto end; + } } - } } if (upf_info->interface_upf_info_list) { @@ -136,17 +163,13 @@ cJSON *OpenAPI_upf_info_convertToJSON(OpenAPI_upf_info_t *upf_info) ogs_error("OpenAPI_upf_info_convertToJSON() failed [interface_upf_info_list]"); goto end; } - - OpenAPI_lnode_t *interface_upf_info_list_node; - if (upf_info->interface_upf_info_list) { - OpenAPI_list_for_each(upf_info->interface_upf_info_list, interface_upf_info_list_node) { - cJSON *itemLocal = OpenAPI_interface_upf_info_item_convertToJSON(interface_upf_info_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_upf_info_convertToJSON() failed [interface_upf_info_list]"); - goto end; - } - cJSON_AddItemToArray(interface_upf_info_listList, itemLocal); + OpenAPI_list_for_each(upf_info->interface_upf_info_list, node) { + cJSON *itemLocal = OpenAPI_interface_upf_info_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [interface_upf_info_list]"); + goto end; } + cJSON_AddItemToArray(interface_upf_info_listList, itemLocal); } } @@ -157,15 +180,14 @@ cJSON *OpenAPI_upf_info_convertToJSON(OpenAPI_upf_info_t *upf_info) } } - if (upf_info->pdu_session_types) { - cJSON *pdu_session_types = cJSON_AddArrayToObject(item, "pduSessionTypes"); - if (pdu_session_types == NULL) { + if (upf_info->pdu_session_types != OpenAPI_pdu_session_type_NULL) { + cJSON *pdu_session_typesList = cJSON_AddArrayToObject(item, "pduSessionTypes"); + if (pdu_session_typesList == NULL) { ogs_error("OpenAPI_upf_info_convertToJSON() failed [pdu_session_types]"); goto end; } - OpenAPI_lnode_t *pdu_session_types_node; - OpenAPI_list_for_each(upf_info->pdu_session_types, pdu_session_types_node) { - if (cJSON_AddStringToObject(pdu_session_types, "", OpenAPI_pdu_session_type_ToString((intptr_t)pdu_session_types_node->data)) == NULL) { + OpenAPI_list_for_each(upf_info->pdu_session_types, node) { + if (cJSON_AddStringToObject(pdu_session_typesList, "", OpenAPI_pdu_session_type_ToString((intptr_t)node->data)) == NULL) { ogs_error("OpenAPI_upf_info_convertToJSON() failed [pdu_session_types]"); goto end; } @@ -198,17 +220,13 @@ cJSON *OpenAPI_upf_info_convertToJSON(OpenAPI_upf_info_t *upf_info) ogs_error("OpenAPI_upf_info_convertToJSON() failed [tai_list]"); goto end; } - - OpenAPI_lnode_t *tai_list_node; - if (upf_info->tai_list) { - OpenAPI_list_for_each(upf_info->tai_list, tai_list_node) { - cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_upf_info_convertToJSON() failed [tai_list]"); - goto end; - } - cJSON_AddItemToArray(tai_listList, itemLocal); + OpenAPI_list_for_each(upf_info->tai_list, node) { + cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upf_info_convertToJSON() failed [tai_list]"); + goto end; } + cJSON_AddItemToArray(tai_listList, itemLocal); } } @@ -286,88 +304,105 @@ end: OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) { OpenAPI_upf_info_t *upf_info_local_var = NULL; - cJSON *s_nssai_upf_info_list = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "sNssaiUpfInfoList"); + OpenAPI_lnode_t *node = NULL; + cJSON *s_nssai_upf_info_list = NULL; + OpenAPI_list_t *s_nssai_upf_info_listList = NULL; + cJSON *smf_serving_area = NULL; + OpenAPI_list_t *smf_serving_areaList = NULL; + cJSON *interface_upf_info_list = NULL; + OpenAPI_list_t *interface_upf_info_listList = NULL; + cJSON *iwk_eps_ind = NULL; + cJSON *pdu_session_types = NULL; + OpenAPI_list_t *pdu_session_typesList = NULL; + cJSON *atsss_capability = NULL; + OpenAPI_atsss_capability_t *atsss_capability_local_nonprim = NULL; + cJSON *ue_ip_addr_ind = NULL; + cJSON *tai_list = NULL; + OpenAPI_list_t *tai_listList = NULL; + cJSON *w_agf_info = NULL; + OpenAPI_w_agf_info_t *w_agf_info_local_nonprim = NULL; + cJSON *tngf_info = NULL; + OpenAPI_tngf_info_t *tngf_info_local_nonprim = NULL; + cJSON *twif_info = NULL; + OpenAPI_twif_info_t *twif_info_local_nonprim = NULL; + cJSON *priority = NULL; + cJSON *redundant_gtpu = NULL; + cJSON *ipups = NULL; + cJSON *data_forwarding = NULL; + s_nssai_upf_info_list = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "sNssaiUpfInfoList"); if (!s_nssai_upf_info_list) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [s_nssai_upf_info_list]"); goto end; } - - OpenAPI_list_t *s_nssai_upf_info_listList; - cJSON *s_nssai_upf_info_list_local_nonprimitive; - if (!cJSON_IsArray(s_nssai_upf_info_list)){ - ogs_error("OpenAPI_upf_info_parseFromJSON() failed [s_nssai_upf_info_list]"); - goto end; - } - - s_nssai_upf_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(s_nssai_upf_info_list_local_nonprimitive, s_nssai_upf_info_list ) { - if (!cJSON_IsObject(s_nssai_upf_info_list_local_nonprimitive)) { + cJSON *s_nssai_upf_info_list_local = NULL; + if (!cJSON_IsArray(s_nssai_upf_info_list)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [s_nssai_upf_info_list]"); goto end; } - OpenAPI_snssai_upf_info_item_t *s_nssai_upf_info_listItem = OpenAPI_snssai_upf_info_item_parseFromJSON(s_nssai_upf_info_list_local_nonprimitive); - if (!s_nssai_upf_info_listItem) { - ogs_error("No s_nssai_upf_info_listItem"); - OpenAPI_list_free(s_nssai_upf_info_listList); + s_nssai_upf_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(s_nssai_upf_info_list_local, s_nssai_upf_info_list) { + if (!cJSON_IsObject(s_nssai_upf_info_list_local)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [s_nssai_upf_info_list]"); + goto end; + } + OpenAPI_snssai_upf_info_item_t *s_nssai_upf_info_listItem = OpenAPI_snssai_upf_info_item_parseFromJSON(s_nssai_upf_info_list_local); + if (!s_nssai_upf_info_listItem) { + ogs_error("No s_nssai_upf_info_listItem"); + OpenAPI_list_free(s_nssai_upf_info_listList); + goto end; + } + OpenAPI_list_add(s_nssai_upf_info_listList, s_nssai_upf_info_listItem); + } + + smf_serving_area = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "smfServingArea"); + if (smf_serving_area) { + cJSON *smf_serving_area_local = NULL; + if (!cJSON_IsArray(smf_serving_area)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [smf_serving_area]"); goto end; } - OpenAPI_list_add(s_nssai_upf_info_listList, s_nssai_upf_info_listItem); + smf_serving_areaList = OpenAPI_list_create(); + + cJSON_ArrayForEach(smf_serving_area_local, smf_serving_area) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(smf_serving_area_local)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [smf_serving_area]"); + goto end; + } + OpenAPI_list_add(smf_serving_areaList, ogs_strdup(smf_serving_area_local->valuestring)); + } } - cJSON *smf_serving_area = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "smfServingArea"); - - OpenAPI_list_t *smf_serving_areaList; - if (smf_serving_area) { - cJSON *smf_serving_area_local; - if (!cJSON_IsArray(smf_serving_area)) { - ogs_error("OpenAPI_upf_info_parseFromJSON() failed [smf_serving_area]"); - goto end; - } - smf_serving_areaList = OpenAPI_list_create(); - - cJSON_ArrayForEach(smf_serving_area_local, smf_serving_area) { - if (!cJSON_IsString(smf_serving_area_local)) { - ogs_error("OpenAPI_upf_info_parseFromJSON() failed [smf_serving_area]"); - goto end; - } - OpenAPI_list_add(smf_serving_areaList, ogs_strdup(smf_serving_area_local->valuestring)); - } - } - - cJSON *interface_upf_info_list = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "interfaceUpfInfoList"); - - OpenAPI_list_t *interface_upf_info_listList; + interface_upf_info_list = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "interfaceUpfInfoList"); if (interface_upf_info_list) { - cJSON *interface_upf_info_list_local_nonprimitive; - if (!cJSON_IsArray(interface_upf_info_list)){ - ogs_error("OpenAPI_upf_info_parseFromJSON() failed [interface_upf_info_list]"); - goto end; - } - - interface_upf_info_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(interface_upf_info_list_local_nonprimitive, interface_upf_info_list ) { - if (!cJSON_IsObject(interface_upf_info_list_local_nonprimitive)) { + cJSON *interface_upf_info_list_local = NULL; + if (!cJSON_IsArray(interface_upf_info_list)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [interface_upf_info_list]"); goto end; } - OpenAPI_interface_upf_info_item_t *interface_upf_info_listItem = OpenAPI_interface_upf_info_item_parseFromJSON(interface_upf_info_list_local_nonprimitive); - if (!interface_upf_info_listItem) { - ogs_error("No interface_upf_info_listItem"); - OpenAPI_list_free(interface_upf_info_listList); - goto end; + interface_upf_info_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(interface_upf_info_list_local, interface_upf_info_list) { + if (!cJSON_IsObject(interface_upf_info_list_local)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [interface_upf_info_list]"); + goto end; + } + OpenAPI_interface_upf_info_item_t *interface_upf_info_listItem = OpenAPI_interface_upf_info_item_parseFromJSON(interface_upf_info_list_local); + if (!interface_upf_info_listItem) { + ogs_error("No interface_upf_info_listItem"); + OpenAPI_list_free(interface_upf_info_listList); + goto end; + } + OpenAPI_list_add(interface_upf_info_listList, interface_upf_info_listItem); } - - OpenAPI_list_add(interface_upf_info_listList, interface_upf_info_listItem); - } } - cJSON *iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "iwkEpsInd"); - + iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "iwkEpsInd"); if (iwk_eps_ind) { if (!cJSON_IsBool(iwk_eps_ind)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [iwk_eps_ind]"); @@ -375,37 +410,31 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) } } - cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "pduSessionTypes"); - - OpenAPI_list_t *pdu_session_typesList; + pdu_session_types = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "pduSessionTypes"); if (pdu_session_types) { - cJSON *pdu_session_types_local_nonprimitive; - if (!cJSON_IsArray(pdu_session_types)) { - ogs_error("OpenAPI_upf_info_parseFromJSON() failed [pdu_session_types]"); - goto end; - } - - pdu_session_typesList = OpenAPI_list_create(); - - cJSON_ArrayForEach(pdu_session_types_local_nonprimitive, pdu_session_types ) { - if (!cJSON_IsString(pdu_session_types_local_nonprimitive)){ + cJSON *pdu_session_types_local = NULL; + if (!cJSON_IsArray(pdu_session_types)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [pdu_session_types]"); goto end; } - OpenAPI_list_add(pdu_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(pdu_session_types_local_nonprimitive->valuestring)); - } + pdu_session_typesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(pdu_session_types_local, pdu_session_types) { + if (!cJSON_IsString(pdu_session_types_local)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [pdu_session_types]"); + goto end; + } + OpenAPI_list_add(pdu_session_typesList, (void *)OpenAPI_pdu_session_type_FromString(pdu_session_types_local->valuestring)); + } } - cJSON *atsss_capability = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "atsssCapability"); - - OpenAPI_atsss_capability_t *atsss_capability_local_nonprim = NULL; + atsss_capability = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "atsssCapability"); if (atsss_capability) { atsss_capability_local_nonprim = OpenAPI_atsss_capability_parseFromJSON(atsss_capability); } - cJSON *ue_ip_addr_ind = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "ueIpAddrInd"); - + ue_ip_addr_ind = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "ueIpAddrInd"); if (ue_ip_addr_ind) { if (!cJSON_IsBool(ue_ip_addr_ind)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [ue_ip_addr_ind]"); @@ -413,58 +442,47 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) } } - cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "taiList"); - - OpenAPI_list_t *tai_listList; + tai_list = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "taiList"); if (tai_list) { - cJSON *tai_list_local_nonprimitive; - if (!cJSON_IsArray(tai_list)){ - ogs_error("OpenAPI_upf_info_parseFromJSON() failed [tai_list]"); - goto end; - } - - tai_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) { - if (!cJSON_IsObject(tai_list_local_nonprimitive)) { + cJSON *tai_list_local = NULL; + if (!cJSON_IsArray(tai_list)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [tai_list]"); goto end; } - OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive); - if (!tai_listItem) { - ogs_error("No tai_listItem"); - OpenAPI_list_free(tai_listList); - goto end; + tai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(tai_list_local, tai_list) { + if (!cJSON_IsObject(tai_list_local)) { + ogs_error("OpenAPI_upf_info_parseFromJSON() failed [tai_list]"); + goto end; + } + OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local); + if (!tai_listItem) { + ogs_error("No tai_listItem"); + OpenAPI_list_free(tai_listList); + goto end; + } + OpenAPI_list_add(tai_listList, tai_listItem); } - - OpenAPI_list_add(tai_listList, tai_listItem); - } } - cJSON *w_agf_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "wAgfInfo"); - - OpenAPI_w_agf_info_t *w_agf_info_local_nonprim = NULL; + w_agf_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "wAgfInfo"); if (w_agf_info) { w_agf_info_local_nonprim = OpenAPI_w_agf_info_parseFromJSON(w_agf_info); } - cJSON *tngf_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "tngfInfo"); - - OpenAPI_tngf_info_t *tngf_info_local_nonprim = NULL; + tngf_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "tngfInfo"); if (tngf_info) { tngf_info_local_nonprim = OpenAPI_tngf_info_parseFromJSON(tngf_info); } - cJSON *twif_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "twifInfo"); - - OpenAPI_twif_info_t *twif_info_local_nonprim = NULL; + twif_info = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "twifInfo"); if (twif_info) { twif_info_local_nonprim = OpenAPI_twif_info_parseFromJSON(twif_info); } - cJSON *priority = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "priority"); - + priority = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "priority"); if (priority) { if (!cJSON_IsNumber(priority)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [priority]"); @@ -472,8 +490,7 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) } } - cJSON *redundant_gtpu = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "redundantGtpu"); - + redundant_gtpu = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "redundantGtpu"); if (redundant_gtpu) { if (!cJSON_IsBool(redundant_gtpu)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [redundant_gtpu]"); @@ -481,8 +498,7 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) } } - cJSON *ipups = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "ipups"); - + ipups = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "ipups"); if (ipups) { if (!cJSON_IsBool(ipups)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [ipups]"); @@ -490,8 +506,7 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) } } - cJSON *data_forwarding = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "dataForwarding"); - + data_forwarding = cJSON_GetObjectItemCaseSensitive(upf_infoJSON, "dataForwarding"); if (data_forwarding) { if (!cJSON_IsBool(data_forwarding)) { ogs_error("OpenAPI_upf_info_parseFromJSON() failed [data_forwarding]"); @@ -525,6 +540,54 @@ OpenAPI_upf_info_t *OpenAPI_upf_info_parseFromJSON(cJSON *upf_infoJSON) return upf_info_local_var; end: + if (s_nssai_upf_info_listList) { + OpenAPI_list_for_each(s_nssai_upf_info_listList, node) { + OpenAPI_snssai_upf_info_item_free(node->data); + } + OpenAPI_list_free(s_nssai_upf_info_listList); + s_nssai_upf_info_listList = NULL; + } + if (smf_serving_areaList) { + OpenAPI_list_for_each(smf_serving_areaList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(smf_serving_areaList); + smf_serving_areaList = NULL; + } + if (interface_upf_info_listList) { + OpenAPI_list_for_each(interface_upf_info_listList, node) { + OpenAPI_interface_upf_info_item_free(node->data); + } + OpenAPI_list_free(interface_upf_info_listList); + interface_upf_info_listList = NULL; + } + if (pdu_session_typesList) { + OpenAPI_list_free(pdu_session_typesList); + pdu_session_typesList = NULL; + } + if (atsss_capability_local_nonprim) { + OpenAPI_atsss_capability_free(atsss_capability_local_nonprim); + atsss_capability_local_nonprim = NULL; + } + if (tai_listList) { + OpenAPI_list_for_each(tai_listList, node) { + OpenAPI_tai_free(node->data); + } + OpenAPI_list_free(tai_listList); + tai_listList = NULL; + } + if (w_agf_info_local_nonprim) { + OpenAPI_w_agf_info_free(w_agf_info_local_nonprim); + w_agf_info_local_nonprim = NULL; + } + if (tngf_info_local_nonprim) { + OpenAPI_tngf_info_free(tngf_info_local_nonprim); + tngf_info_local_nonprim = NULL; + } + if (twif_info_local_nonprim) { + OpenAPI_twif_info_free(twif_info_local_nonprim); + twif_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/upu_data.c b/lib/sbi/openapi/model/upu_data.c index ec47b3cb2..ad65e9b8d 100644 --- a/lib/sbi/openapi/model/upu_data.c +++ b/lib/sbi/openapi/model/upu_data.c @@ -5,38 +5,50 @@ #include "upu_data.h" OpenAPI_upu_data_t *OpenAPI_upu_data_create( - char *provisioning_time, - OpenAPI_ue_update_status_e ue_update_status, - char *upu_xmac_iue, - char *upu_mac_iue + char *sec_packet, + OpenAPI_list_t *default_conf_nssai, + char *routing_id ) { OpenAPI_upu_data_t *upu_data_local_var = ogs_malloc(sizeof(OpenAPI_upu_data_t)); ogs_assert(upu_data_local_var); - upu_data_local_var->provisioning_time = provisioning_time; - upu_data_local_var->ue_update_status = ue_update_status; - upu_data_local_var->upu_xmac_iue = upu_xmac_iue; - upu_data_local_var->upu_mac_iue = upu_mac_iue; + upu_data_local_var->sec_packet = sec_packet; + upu_data_local_var->default_conf_nssai = default_conf_nssai; + upu_data_local_var->routing_id = routing_id; return upu_data_local_var; } void OpenAPI_upu_data_free(OpenAPI_upu_data_t *upu_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == upu_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(upu_data->provisioning_time); - ogs_free(upu_data->upu_xmac_iue); - ogs_free(upu_data->upu_mac_iue); + if (upu_data->sec_packet) { + ogs_free(upu_data->sec_packet); + upu_data->sec_packet = NULL; + } + if (upu_data->default_conf_nssai) { + OpenAPI_list_for_each(upu_data->default_conf_nssai, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(upu_data->default_conf_nssai); + upu_data->default_conf_nssai = NULL; + } + if (upu_data->routing_id) { + ogs_free(upu_data->routing_id); + upu_data->routing_id = NULL; + } ogs_free(upu_data); } cJSON *OpenAPI_upu_data_convertToJSON(OpenAPI_upu_data_t *upu_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (upu_data == NULL) { ogs_error("OpenAPI_upu_data_convertToJSON() failed [UpuData]"); @@ -44,26 +56,32 @@ cJSON *OpenAPI_upu_data_convertToJSON(OpenAPI_upu_data_t *upu_data) } item = cJSON_CreateObject(); - if (cJSON_AddStringToObject(item, "provisioningTime", upu_data->provisioning_time) == NULL) { - ogs_error("OpenAPI_upu_data_convertToJSON() failed [provisioning_time]"); - goto end; - } - - if (cJSON_AddStringToObject(item, "ueUpdateStatus", OpenAPI_ue_update_status_ToString(upu_data->ue_update_status)) == NULL) { - ogs_error("OpenAPI_upu_data_convertToJSON() failed [ue_update_status]"); - goto end; - } - - if (upu_data->upu_xmac_iue) { - if (cJSON_AddStringToObject(item, "upuXmacIue", upu_data->upu_xmac_iue) == NULL) { - ogs_error("OpenAPI_upu_data_convertToJSON() failed [upu_xmac_iue]"); + if (upu_data->sec_packet) { + if (cJSON_AddStringToObject(item, "secPacket", upu_data->sec_packet) == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [sec_packet]"); goto end; } } - if (upu_data->upu_mac_iue) { - if (cJSON_AddStringToObject(item, "upuMacIue", upu_data->upu_mac_iue) == NULL) { - ogs_error("OpenAPI_upu_data_convertToJSON() failed [upu_mac_iue]"); + if (upu_data->default_conf_nssai) { + cJSON *default_conf_nssaiList = cJSON_AddArrayToObject(item, "defaultConfNssai"); + if (default_conf_nssaiList == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [default_conf_nssai]"); + goto end; + } + OpenAPI_list_for_each(upu_data->default_conf_nssai, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [default_conf_nssai]"); + goto end; + } + cJSON_AddItemToArray(default_conf_nssaiList, itemLocal); + } + } + + if (upu_data->routing_id) { + if (cJSON_AddStringToObject(item, "routingId", upu_data->routing_id) == NULL) { + ogs_error("OpenAPI_upu_data_convertToJSON() failed [routing_id]"); goto end; } } @@ -75,57 +93,67 @@ end: OpenAPI_upu_data_t *OpenAPI_upu_data_parseFromJSON(cJSON *upu_dataJSON) { OpenAPI_upu_data_t *upu_data_local_var = NULL; - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "provisioningTime"); - if (!provisioning_time) { - ogs_error("OpenAPI_upu_data_parseFromJSON() failed [provisioning_time]"); - goto end; - } - - if (!cJSON_IsString(provisioning_time)) { - ogs_error("OpenAPI_upu_data_parseFromJSON() failed [provisioning_time]"); - goto end; - } - - cJSON *ue_update_status = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "ueUpdateStatus"); - if (!ue_update_status) { - ogs_error("OpenAPI_upu_data_parseFromJSON() failed [ue_update_status]"); - goto end; - } - - OpenAPI_ue_update_status_e ue_update_statusVariable; - if (!cJSON_IsString(ue_update_status)) { - ogs_error("OpenAPI_upu_data_parseFromJSON() failed [ue_update_status]"); - goto end; - } - ue_update_statusVariable = OpenAPI_ue_update_status_FromString(ue_update_status->valuestring); - - cJSON *upu_xmac_iue = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "upuXmacIue"); - - if (upu_xmac_iue) { - if (!cJSON_IsString(upu_xmac_iue)) { - ogs_error("OpenAPI_upu_data_parseFromJSON() failed [upu_xmac_iue]"); + OpenAPI_lnode_t *node = NULL; + cJSON *sec_packet = NULL; + cJSON *default_conf_nssai = NULL; + OpenAPI_list_t *default_conf_nssaiList = NULL; + cJSON *routing_id = NULL; + sec_packet = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "secPacket"); + if (sec_packet) { + if (!cJSON_IsString(sec_packet) && !cJSON_IsNull(sec_packet)) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [sec_packet]"); goto end; } } - cJSON *upu_mac_iue = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "upuMacIue"); + default_conf_nssai = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "defaultConfNssai"); + if (default_conf_nssai) { + cJSON *default_conf_nssai_local = NULL; + if (!cJSON_IsArray(default_conf_nssai)) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [default_conf_nssai]"); + goto end; + } - if (upu_mac_iue) { - if (!cJSON_IsString(upu_mac_iue)) { - ogs_error("OpenAPI_upu_data_parseFromJSON() failed [upu_mac_iue]"); + default_conf_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_conf_nssai_local, default_conf_nssai) { + if (!cJSON_IsObject(default_conf_nssai_local)) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [default_conf_nssai]"); + goto end; + } + OpenAPI_snssai_t *default_conf_nssaiItem = OpenAPI_snssai_parseFromJSON(default_conf_nssai_local); + if (!default_conf_nssaiItem) { + ogs_error("No default_conf_nssaiItem"); + OpenAPI_list_free(default_conf_nssaiList); + goto end; + } + OpenAPI_list_add(default_conf_nssaiList, default_conf_nssaiItem); + } + } + + routing_id = cJSON_GetObjectItemCaseSensitive(upu_dataJSON, "routingId"); + if (routing_id) { + if (!cJSON_IsString(routing_id) && !cJSON_IsNull(routing_id)) { + ogs_error("OpenAPI_upu_data_parseFromJSON() failed [routing_id]"); goto end; } } upu_data_local_var = OpenAPI_upu_data_create ( - ogs_strdup(provisioning_time->valuestring), - ue_update_statusVariable, - upu_xmac_iue ? ogs_strdup(upu_xmac_iue->valuestring) : NULL, - upu_mac_iue ? ogs_strdup(upu_mac_iue->valuestring) : NULL + sec_packet && !cJSON_IsNull(sec_packet) ? ogs_strdup(sec_packet->valuestring) : NULL, + default_conf_nssai ? default_conf_nssaiList : NULL, + routing_id && !cJSON_IsNull(routing_id) ? ogs_strdup(routing_id->valuestring) : NULL ); return upu_data_local_var; end: + if (default_conf_nssaiList) { + OpenAPI_list_for_each(default_conf_nssaiList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(default_conf_nssaiList); + default_conf_nssaiList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/upu_data.h b/lib/sbi/openapi/model/upu_data.h index 786b5fc88..8be344765 100644 --- a/lib/sbi/openapi/model/upu_data.h +++ b/lib/sbi/openapi/model/upu_data.h @@ -12,7 +12,7 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "ue_update_status.h" +#include "snssai.h" #ifdef __cplusplus extern "C" { @@ -20,17 +20,15 @@ extern "C" { typedef struct OpenAPI_upu_data_s OpenAPI_upu_data_t; typedef struct OpenAPI_upu_data_s { - char *provisioning_time; - OpenAPI_ue_update_status_e ue_update_status; - char *upu_xmac_iue; - char *upu_mac_iue; + char *sec_packet; + OpenAPI_list_t *default_conf_nssai; + char *routing_id; } OpenAPI_upu_data_t; OpenAPI_upu_data_t *OpenAPI_upu_data_create( - char *provisioning_time, - OpenAPI_ue_update_status_e ue_update_status, - char *upu_xmac_iue, - char *upu_mac_iue + char *sec_packet, + OpenAPI_list_t *default_conf_nssai, + char *routing_id ); void OpenAPI_upu_data_free(OpenAPI_upu_data_t *upu_data); OpenAPI_upu_data_t *OpenAPI_upu_data_parseFromJSON(cJSON *upu_dataJSON); diff --git a/lib/sbi/openapi/model/upu_data_1.c b/lib/sbi/openapi/model/upu_data_1.c index a81248fba..0ac188302 100644 --- a/lib/sbi/openapi/model/upu_data_1.c +++ b/lib/sbi/openapi/model/upu_data_1.c @@ -22,22 +22,33 @@ OpenAPI_upu_data_1_t *OpenAPI_upu_data_1_create( void OpenAPI_upu_data_1_free(OpenAPI_upu_data_1_t *upu_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == upu_data_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(upu_data_1->sec_packet); - OpenAPI_list_for_each(upu_data_1->default_conf_nssai, node) { - OpenAPI_snssai_free(node->data); + if (upu_data_1->sec_packet) { + ogs_free(upu_data_1->sec_packet); + upu_data_1->sec_packet = NULL; + } + if (upu_data_1->default_conf_nssai) { + OpenAPI_list_for_each(upu_data_1->default_conf_nssai, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(upu_data_1->default_conf_nssai); + upu_data_1->default_conf_nssai = NULL; + } + if (upu_data_1->routing_id) { + ogs_free(upu_data_1->routing_id); + upu_data_1->routing_id = NULL; } - OpenAPI_list_free(upu_data_1->default_conf_nssai); - ogs_free(upu_data_1->routing_id); ogs_free(upu_data_1); } cJSON *OpenAPI_upu_data_1_convertToJSON(OpenAPI_upu_data_1_t *upu_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (upu_data_1 == NULL) { ogs_error("OpenAPI_upu_data_1_convertToJSON() failed [UpuData_1]"); @@ -58,17 +69,13 @@ cJSON *OpenAPI_upu_data_1_convertToJSON(OpenAPI_upu_data_1_t *upu_data_1) ogs_error("OpenAPI_upu_data_1_convertToJSON() failed [default_conf_nssai]"); goto end; } - - OpenAPI_lnode_t *default_conf_nssai_node; - if (upu_data_1->default_conf_nssai) { - OpenAPI_list_for_each(upu_data_1->default_conf_nssai, default_conf_nssai_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(default_conf_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_upu_data_1_convertToJSON() failed [default_conf_nssai]"); - goto end; - } - cJSON_AddItemToArray(default_conf_nssaiList, itemLocal); + OpenAPI_list_for_each(upu_data_1->default_conf_nssai, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upu_data_1_convertToJSON() failed [default_conf_nssai]"); + goto end; } + cJSON_AddItemToArray(default_conf_nssaiList, itemLocal); } } @@ -86,61 +93,67 @@ end: OpenAPI_upu_data_1_t *OpenAPI_upu_data_1_parseFromJSON(cJSON *upu_data_1JSON) { OpenAPI_upu_data_1_t *upu_data_1_local_var = NULL; - cJSON *sec_packet = cJSON_GetObjectItemCaseSensitive(upu_data_1JSON, "secPacket"); - + OpenAPI_lnode_t *node = NULL; + cJSON *sec_packet = NULL; + cJSON *default_conf_nssai = NULL; + OpenAPI_list_t *default_conf_nssaiList = NULL; + cJSON *routing_id = NULL; + sec_packet = cJSON_GetObjectItemCaseSensitive(upu_data_1JSON, "secPacket"); if (sec_packet) { - if (!cJSON_IsString(sec_packet)) { + if (!cJSON_IsString(sec_packet) && !cJSON_IsNull(sec_packet)) { ogs_error("OpenAPI_upu_data_1_parseFromJSON() failed [sec_packet]"); goto end; } } - cJSON *default_conf_nssai = cJSON_GetObjectItemCaseSensitive(upu_data_1JSON, "defaultConfNssai"); - - OpenAPI_list_t *default_conf_nssaiList; + default_conf_nssai = cJSON_GetObjectItemCaseSensitive(upu_data_1JSON, "defaultConfNssai"); if (default_conf_nssai) { - cJSON *default_conf_nssai_local_nonprimitive; - if (!cJSON_IsArray(default_conf_nssai)){ - ogs_error("OpenAPI_upu_data_1_parseFromJSON() failed [default_conf_nssai]"); - goto end; - } - - default_conf_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(default_conf_nssai_local_nonprimitive, default_conf_nssai ) { - if (!cJSON_IsObject(default_conf_nssai_local_nonprimitive)) { + cJSON *default_conf_nssai_local = NULL; + if (!cJSON_IsArray(default_conf_nssai)) { ogs_error("OpenAPI_upu_data_1_parseFromJSON() failed [default_conf_nssai]"); goto end; } - OpenAPI_snssai_t *default_conf_nssaiItem = OpenAPI_snssai_parseFromJSON(default_conf_nssai_local_nonprimitive); - if (!default_conf_nssaiItem) { - ogs_error("No default_conf_nssaiItem"); - OpenAPI_list_free(default_conf_nssaiList); - goto end; + default_conf_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_conf_nssai_local, default_conf_nssai) { + if (!cJSON_IsObject(default_conf_nssai_local)) { + ogs_error("OpenAPI_upu_data_1_parseFromJSON() failed [default_conf_nssai]"); + goto end; + } + OpenAPI_snssai_t *default_conf_nssaiItem = OpenAPI_snssai_parseFromJSON(default_conf_nssai_local); + if (!default_conf_nssaiItem) { + ogs_error("No default_conf_nssaiItem"); + OpenAPI_list_free(default_conf_nssaiList); + goto end; + } + OpenAPI_list_add(default_conf_nssaiList, default_conf_nssaiItem); } - - OpenAPI_list_add(default_conf_nssaiList, default_conf_nssaiItem); - } } - cJSON *routing_id = cJSON_GetObjectItemCaseSensitive(upu_data_1JSON, "routingId"); - + routing_id = cJSON_GetObjectItemCaseSensitive(upu_data_1JSON, "routingId"); if (routing_id) { - if (!cJSON_IsString(routing_id)) { + if (!cJSON_IsString(routing_id) && !cJSON_IsNull(routing_id)) { ogs_error("OpenAPI_upu_data_1_parseFromJSON() failed [routing_id]"); goto end; } } upu_data_1_local_var = OpenAPI_upu_data_1_create ( - sec_packet ? ogs_strdup(sec_packet->valuestring) : NULL, + sec_packet && !cJSON_IsNull(sec_packet) ? ogs_strdup(sec_packet->valuestring) : NULL, default_conf_nssai ? default_conf_nssaiList : NULL, - routing_id ? ogs_strdup(routing_id->valuestring) : NULL + routing_id && !cJSON_IsNull(routing_id) ? ogs_strdup(routing_id->valuestring) : NULL ); return upu_data_1_local_var; end: + if (default_conf_nssaiList) { + OpenAPI_list_for_each(default_conf_nssaiList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(default_conf_nssaiList); + default_conf_nssaiList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/upu_data_2.c b/lib/sbi/openapi/model/upu_data_2.c index ec0803bef..0fa07efff 100644 --- a/lib/sbi/openapi/model/upu_data_2.c +++ b/lib/sbi/openapi/model/upu_data_2.c @@ -22,22 +22,33 @@ OpenAPI_upu_data_2_t *OpenAPI_upu_data_2_create( void OpenAPI_upu_data_2_free(OpenAPI_upu_data_2_t *upu_data_2) { + OpenAPI_lnode_t *node = NULL; + if (NULL == upu_data_2) { return; } - OpenAPI_lnode_t *node; - ogs_free(upu_data_2->sec_packet); - OpenAPI_list_for_each(upu_data_2->default_conf_nssai, node) { - OpenAPI_snssai_free(node->data); + if (upu_data_2->sec_packet) { + ogs_free(upu_data_2->sec_packet); + upu_data_2->sec_packet = NULL; + } + if (upu_data_2->default_conf_nssai) { + OpenAPI_list_for_each(upu_data_2->default_conf_nssai, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(upu_data_2->default_conf_nssai); + upu_data_2->default_conf_nssai = NULL; + } + if (upu_data_2->routing_id) { + ogs_free(upu_data_2->routing_id); + upu_data_2->routing_id = NULL; } - OpenAPI_list_free(upu_data_2->default_conf_nssai); - ogs_free(upu_data_2->routing_id); ogs_free(upu_data_2); } cJSON *OpenAPI_upu_data_2_convertToJSON(OpenAPI_upu_data_2_t *upu_data_2) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (upu_data_2 == NULL) { ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [UpuData_2]"); @@ -58,17 +69,13 @@ cJSON *OpenAPI_upu_data_2_convertToJSON(OpenAPI_upu_data_2_t *upu_data_2) ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [default_conf_nssai]"); goto end; } - - OpenAPI_lnode_t *default_conf_nssai_node; - if (upu_data_2->default_conf_nssai) { - OpenAPI_list_for_each(upu_data_2->default_conf_nssai, default_conf_nssai_node) { - cJSON *itemLocal = OpenAPI_snssai_convertToJSON(default_conf_nssai_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [default_conf_nssai]"); - goto end; - } - cJSON_AddItemToArray(default_conf_nssaiList, itemLocal); + OpenAPI_list_for_each(upu_data_2->default_conf_nssai, node) { + cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upu_data_2_convertToJSON() failed [default_conf_nssai]"); + goto end; } + cJSON_AddItemToArray(default_conf_nssaiList, itemLocal); } } @@ -86,61 +93,67 @@ end: OpenAPI_upu_data_2_t *OpenAPI_upu_data_2_parseFromJSON(cJSON *upu_data_2JSON) { OpenAPI_upu_data_2_t *upu_data_2_local_var = NULL; - cJSON *sec_packet = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "secPacket"); - + OpenAPI_lnode_t *node = NULL; + cJSON *sec_packet = NULL; + cJSON *default_conf_nssai = NULL; + OpenAPI_list_t *default_conf_nssaiList = NULL; + cJSON *routing_id = NULL; + sec_packet = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "secPacket"); if (sec_packet) { - if (!cJSON_IsString(sec_packet)) { + if (!cJSON_IsString(sec_packet) && !cJSON_IsNull(sec_packet)) { ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [sec_packet]"); goto end; } } - cJSON *default_conf_nssai = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "defaultConfNssai"); - - OpenAPI_list_t *default_conf_nssaiList; + default_conf_nssai = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "defaultConfNssai"); if (default_conf_nssai) { - cJSON *default_conf_nssai_local_nonprimitive; - if (!cJSON_IsArray(default_conf_nssai)){ - ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [default_conf_nssai]"); - goto end; - } - - default_conf_nssaiList = OpenAPI_list_create(); - - cJSON_ArrayForEach(default_conf_nssai_local_nonprimitive, default_conf_nssai ) { - if (!cJSON_IsObject(default_conf_nssai_local_nonprimitive)) { + cJSON *default_conf_nssai_local = NULL; + if (!cJSON_IsArray(default_conf_nssai)) { ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [default_conf_nssai]"); goto end; } - OpenAPI_snssai_t *default_conf_nssaiItem = OpenAPI_snssai_parseFromJSON(default_conf_nssai_local_nonprimitive); - if (!default_conf_nssaiItem) { - ogs_error("No default_conf_nssaiItem"); - OpenAPI_list_free(default_conf_nssaiList); - goto end; + default_conf_nssaiList = OpenAPI_list_create(); + + cJSON_ArrayForEach(default_conf_nssai_local, default_conf_nssai) { + if (!cJSON_IsObject(default_conf_nssai_local)) { + ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [default_conf_nssai]"); + goto end; + } + OpenAPI_snssai_t *default_conf_nssaiItem = OpenAPI_snssai_parseFromJSON(default_conf_nssai_local); + if (!default_conf_nssaiItem) { + ogs_error("No default_conf_nssaiItem"); + OpenAPI_list_free(default_conf_nssaiList); + goto end; + } + OpenAPI_list_add(default_conf_nssaiList, default_conf_nssaiItem); } - - OpenAPI_list_add(default_conf_nssaiList, default_conf_nssaiItem); - } } - cJSON *routing_id = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "routingId"); - + routing_id = cJSON_GetObjectItemCaseSensitive(upu_data_2JSON, "routingId"); if (routing_id) { - if (!cJSON_IsString(routing_id)) { + if (!cJSON_IsString(routing_id) && !cJSON_IsNull(routing_id)) { ogs_error("OpenAPI_upu_data_2_parseFromJSON() failed [routing_id]"); goto end; } } upu_data_2_local_var = OpenAPI_upu_data_2_create ( - sec_packet ? ogs_strdup(sec_packet->valuestring) : NULL, + sec_packet && !cJSON_IsNull(sec_packet) ? ogs_strdup(sec_packet->valuestring) : NULL, default_conf_nssai ? default_conf_nssaiList : NULL, - routing_id ? ogs_strdup(routing_id->valuestring) : NULL + routing_id && !cJSON_IsNull(routing_id) ? ogs_strdup(routing_id->valuestring) : NULL ); return upu_data_2_local_var; end: + if (default_conf_nssaiList) { + OpenAPI_list_for_each(default_conf_nssaiList, node) { + OpenAPI_snssai_free(node->data); + } + OpenAPI_list_free(default_conf_nssaiList); + default_conf_nssaiList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/upu_info.c b/lib/sbi/openapi/model/upu_info.c index d00a9af91..61743ae72 100644 --- a/lib/sbi/openapi/model/upu_info.c +++ b/lib/sbi/openapi/model/upu_info.c @@ -28,23 +28,37 @@ OpenAPI_upu_info_t *OpenAPI_upu_info_create( void OpenAPI_upu_info_free(OpenAPI_upu_info_t *upu_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == upu_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(upu_info->upu_data_list, node) { - OpenAPI_upu_data_1_free(node->data); + if (upu_info->upu_data_list) { + OpenAPI_list_for_each(upu_info->upu_data_list, node) { + OpenAPI_upu_data_free(node->data); + } + OpenAPI_list_free(upu_info->upu_data_list); + upu_info->upu_data_list = NULL; + } + if (upu_info->upu_mac_iausf) { + ogs_free(upu_info->upu_mac_iausf); + upu_info->upu_mac_iausf = NULL; + } + if (upu_info->counter_upu) { + ogs_free(upu_info->counter_upu); + upu_info->counter_upu = NULL; + } + if (upu_info->provisioning_time) { + ogs_free(upu_info->provisioning_time); + upu_info->provisioning_time = NULL; } - OpenAPI_list_free(upu_info->upu_data_list); - ogs_free(upu_info->upu_mac_iausf); - ogs_free(upu_info->counter_upu); - ogs_free(upu_info->provisioning_time); ogs_free(upu_info); } cJSON *OpenAPI_upu_info_convertToJSON(OpenAPI_upu_info_t *upu_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (upu_info == NULL) { ogs_error("OpenAPI_upu_info_convertToJSON() failed [UpuInfo]"); @@ -52,22 +66,22 @@ cJSON *OpenAPI_upu_info_convertToJSON(OpenAPI_upu_info_t *upu_info) } item = cJSON_CreateObject(); + if (!upu_info->upu_data_list) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_data_list]"); + return NULL; + } cJSON *upu_data_listList = cJSON_AddArrayToObject(item, "upuDataList"); if (upu_data_listList == NULL) { ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_data_list]"); goto end; } - - OpenAPI_lnode_t *upu_data_list_node; - if (upu_info->upu_data_list) { - OpenAPI_list_for_each(upu_info->upu_data_list, upu_data_list_node) { - cJSON *itemLocal = OpenAPI_upu_data_1_convertToJSON(upu_data_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_data_list]"); - goto end; - } - cJSON_AddItemToArray(upu_data_listList, itemLocal); + OpenAPI_list_for_each(upu_info->upu_data_list, node) { + cJSON *itemLocal = OpenAPI_upu_data_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [upu_data_list]"); + goto end; } + cJSON_AddItemToArray(upu_data_listList, itemLocal); } if (cJSON_AddBoolToObject(item, "upuRegInd", upu_info->upu_reg_ind) == NULL) { @@ -94,6 +108,10 @@ cJSON *OpenAPI_upu_info_convertToJSON(OpenAPI_upu_info_t *upu_info) } } + if (!upu_info->provisioning_time) { + ogs_error("OpenAPI_upu_info_convertToJSON() failed [provisioning_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "provisioningTime", upu_info->provisioning_time) == NULL) { ogs_error("OpenAPI_upu_info_convertToJSON() failed [provisioning_time]"); goto end; @@ -106,84 +124,83 @@ end: OpenAPI_upu_info_t *OpenAPI_upu_info_parseFromJSON(cJSON *upu_infoJSON) { OpenAPI_upu_info_t *upu_info_local_var = NULL; - cJSON *upu_data_list = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuDataList"); + OpenAPI_lnode_t *node = NULL; + cJSON *upu_data_list = NULL; + OpenAPI_list_t *upu_data_listList = NULL; + cJSON *upu_reg_ind = NULL; + cJSON *upu_ack_ind = NULL; + cJSON *upu_mac_iausf = NULL; + cJSON *counter_upu = NULL; + cJSON *provisioning_time = NULL; + upu_data_list = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuDataList"); if (!upu_data_list) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_data_list]"); goto end; } - - OpenAPI_list_t *upu_data_listList; - cJSON *upu_data_list_local_nonprimitive; - if (!cJSON_IsArray(upu_data_list)){ - ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_data_list]"); - goto end; - } - - upu_data_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(upu_data_list_local_nonprimitive, upu_data_list ) { - if (!cJSON_IsObject(upu_data_list_local_nonprimitive)) { + cJSON *upu_data_list_local = NULL; + if (!cJSON_IsArray(upu_data_list)) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_data_list]"); goto end; } - OpenAPI_upu_data_1_t *upu_data_listItem = OpenAPI_upu_data_1_parseFromJSON(upu_data_list_local_nonprimitive); - if (!upu_data_listItem) { - ogs_error("No upu_data_listItem"); - OpenAPI_list_free(upu_data_listList); - goto end; + upu_data_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(upu_data_list_local, upu_data_list) { + if (!cJSON_IsObject(upu_data_list_local)) { + ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_data_list]"); + goto end; + } + OpenAPI_upu_data_t *upu_data_listItem = OpenAPI_upu_data_parseFromJSON(upu_data_list_local); + if (!upu_data_listItem) { + ogs_error("No upu_data_listItem"); + OpenAPI_list_free(upu_data_listList); + goto end; + } + OpenAPI_list_add(upu_data_listList, upu_data_listItem); } - OpenAPI_list_add(upu_data_listList, upu_data_listItem); - } - - cJSON *upu_reg_ind = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuRegInd"); + upu_reg_ind = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuRegInd"); if (!upu_reg_ind) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_reg_ind]"); goto end; } - if (!cJSON_IsBool(upu_reg_ind)) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_reg_ind]"); goto end; } - cJSON *upu_ack_ind = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuAckInd"); + upu_ack_ind = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuAckInd"); if (!upu_ack_ind) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_ack_ind]"); goto end; } - if (!cJSON_IsBool(upu_ack_ind)) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_ack_ind]"); goto end; } - cJSON *upu_mac_iausf = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuMacIausf"); - + upu_mac_iausf = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "upuMacIausf"); if (upu_mac_iausf) { - if (!cJSON_IsString(upu_mac_iausf)) { + if (!cJSON_IsString(upu_mac_iausf) && !cJSON_IsNull(upu_mac_iausf)) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [upu_mac_iausf]"); goto end; } } - cJSON *counter_upu = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "counterUpu"); - + counter_upu = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "counterUpu"); if (counter_upu) { - if (!cJSON_IsString(counter_upu)) { + if (!cJSON_IsString(counter_upu) && !cJSON_IsNull(counter_upu)) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [counter_upu]"); goto end; } } - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "provisioningTime"); + provisioning_time = cJSON_GetObjectItemCaseSensitive(upu_infoJSON, "provisioningTime"); if (!provisioning_time) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [provisioning_time]"); goto end; } - - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_upu_info_parseFromJSON() failed [provisioning_time]"); goto end; } @@ -194,13 +211,20 @@ OpenAPI_upu_info_t *OpenAPI_upu_info_parseFromJSON(cJSON *upu_infoJSON) upu_reg_ind->valueint, upu_ack_ind->valueint, - upu_mac_iausf ? ogs_strdup(upu_mac_iausf->valuestring) : NULL, - counter_upu ? ogs_strdup(counter_upu->valuestring) : NULL, + upu_mac_iausf && !cJSON_IsNull(upu_mac_iausf) ? ogs_strdup(upu_mac_iausf->valuestring) : NULL, + counter_upu && !cJSON_IsNull(counter_upu) ? ogs_strdup(counter_upu->valuestring) : NULL, ogs_strdup(provisioning_time->valuestring) ); return upu_info_local_var; end: + if (upu_data_listList) { + OpenAPI_list_for_each(upu_data_listList, node) { + OpenAPI_upu_data_free(node->data); + } + OpenAPI_list_free(upu_data_listList); + upu_data_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/upu_info.h b/lib/sbi/openapi/model/upu_info.h index 9fac49b1a..402c47ba5 100644 --- a/lib/sbi/openapi/model/upu_info.h +++ b/lib/sbi/openapi/model/upu_info.h @@ -12,7 +12,7 @@ #include "../include/list.h" #include "../include/keyValuePair.h" #include "../include/binary.h" -#include "upu_data_1.h" +#include "upu_data.h" #ifdef __cplusplus extern "C" { diff --git a/lib/sbi/openapi/model/upu_info_1.c b/lib/sbi/openapi/model/upu_info_1.c index 51c62a6c6..f5689fc21 100644 --- a/lib/sbi/openapi/model/upu_info_1.c +++ b/lib/sbi/openapi/model/upu_info_1.c @@ -28,23 +28,37 @@ OpenAPI_upu_info_1_t *OpenAPI_upu_info_1_create( void OpenAPI_upu_info_1_free(OpenAPI_upu_info_1_t *upu_info_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == upu_info_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(upu_info_1->upu_data_list, node) { - OpenAPI_upu_data_2_free(node->data); + if (upu_info_1->upu_data_list) { + OpenAPI_list_for_each(upu_info_1->upu_data_list, node) { + OpenAPI_upu_data_2_free(node->data); + } + OpenAPI_list_free(upu_info_1->upu_data_list); + upu_info_1->upu_data_list = NULL; + } + if (upu_info_1->upu_mac_iausf) { + ogs_free(upu_info_1->upu_mac_iausf); + upu_info_1->upu_mac_iausf = NULL; + } + if (upu_info_1->counter_upu) { + ogs_free(upu_info_1->counter_upu); + upu_info_1->counter_upu = NULL; + } + if (upu_info_1->provisioning_time) { + ogs_free(upu_info_1->provisioning_time); + upu_info_1->provisioning_time = NULL; } - OpenAPI_list_free(upu_info_1->upu_data_list); - ogs_free(upu_info_1->upu_mac_iausf); - ogs_free(upu_info_1->counter_upu); - ogs_free(upu_info_1->provisioning_time); ogs_free(upu_info_1); } cJSON *OpenAPI_upu_info_1_convertToJSON(OpenAPI_upu_info_1_t *upu_info_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (upu_info_1 == NULL) { ogs_error("OpenAPI_upu_info_1_convertToJSON() failed [UpuInfo_1]"); @@ -52,22 +66,22 @@ cJSON *OpenAPI_upu_info_1_convertToJSON(OpenAPI_upu_info_1_t *upu_info_1) } item = cJSON_CreateObject(); + if (!upu_info_1->upu_data_list) { + ogs_error("OpenAPI_upu_info_1_convertToJSON() failed [upu_data_list]"); + return NULL; + } cJSON *upu_data_listList = cJSON_AddArrayToObject(item, "upuDataList"); if (upu_data_listList == NULL) { ogs_error("OpenAPI_upu_info_1_convertToJSON() failed [upu_data_list]"); goto end; } - - OpenAPI_lnode_t *upu_data_list_node; - if (upu_info_1->upu_data_list) { - OpenAPI_list_for_each(upu_info_1->upu_data_list, upu_data_list_node) { - cJSON *itemLocal = OpenAPI_upu_data_2_convertToJSON(upu_data_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_upu_info_1_convertToJSON() failed [upu_data_list]"); - goto end; - } - cJSON_AddItemToArray(upu_data_listList, itemLocal); + OpenAPI_list_for_each(upu_info_1->upu_data_list, node) { + cJSON *itemLocal = OpenAPI_upu_data_2_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_upu_info_1_convertToJSON() failed [upu_data_list]"); + goto end; } + cJSON_AddItemToArray(upu_data_listList, itemLocal); } if (cJSON_AddBoolToObject(item, "upuRegInd", upu_info_1->upu_reg_ind) == NULL) { @@ -94,6 +108,10 @@ cJSON *OpenAPI_upu_info_1_convertToJSON(OpenAPI_upu_info_1_t *upu_info_1) } } + if (!upu_info_1->provisioning_time) { + ogs_error("OpenAPI_upu_info_1_convertToJSON() failed [provisioning_time]"); + return NULL; + } if (cJSON_AddStringToObject(item, "provisioningTime", upu_info_1->provisioning_time) == NULL) { ogs_error("OpenAPI_upu_info_1_convertToJSON() failed [provisioning_time]"); goto end; @@ -106,84 +124,83 @@ end: OpenAPI_upu_info_1_t *OpenAPI_upu_info_1_parseFromJSON(cJSON *upu_info_1JSON) { OpenAPI_upu_info_1_t *upu_info_1_local_var = NULL; - cJSON *upu_data_list = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "upuDataList"); + OpenAPI_lnode_t *node = NULL; + cJSON *upu_data_list = NULL; + OpenAPI_list_t *upu_data_listList = NULL; + cJSON *upu_reg_ind = NULL; + cJSON *upu_ack_ind = NULL; + cJSON *upu_mac_iausf = NULL; + cJSON *counter_upu = NULL; + cJSON *provisioning_time = NULL; + upu_data_list = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "upuDataList"); if (!upu_data_list) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_data_list]"); goto end; } - - OpenAPI_list_t *upu_data_listList; - cJSON *upu_data_list_local_nonprimitive; - if (!cJSON_IsArray(upu_data_list)){ - ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_data_list]"); - goto end; - } - - upu_data_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(upu_data_list_local_nonprimitive, upu_data_list ) { - if (!cJSON_IsObject(upu_data_list_local_nonprimitive)) { + cJSON *upu_data_list_local = NULL; + if (!cJSON_IsArray(upu_data_list)) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_data_list]"); goto end; } - OpenAPI_upu_data_2_t *upu_data_listItem = OpenAPI_upu_data_2_parseFromJSON(upu_data_list_local_nonprimitive); - if (!upu_data_listItem) { - ogs_error("No upu_data_listItem"); - OpenAPI_list_free(upu_data_listList); - goto end; + upu_data_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(upu_data_list_local, upu_data_list) { + if (!cJSON_IsObject(upu_data_list_local)) { + ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_data_list]"); + goto end; + } + OpenAPI_upu_data_2_t *upu_data_listItem = OpenAPI_upu_data_2_parseFromJSON(upu_data_list_local); + if (!upu_data_listItem) { + ogs_error("No upu_data_listItem"); + OpenAPI_list_free(upu_data_listList); + goto end; + } + OpenAPI_list_add(upu_data_listList, upu_data_listItem); } - OpenAPI_list_add(upu_data_listList, upu_data_listItem); - } - - cJSON *upu_reg_ind = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "upuRegInd"); + upu_reg_ind = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "upuRegInd"); if (!upu_reg_ind) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_reg_ind]"); goto end; } - if (!cJSON_IsBool(upu_reg_ind)) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_reg_ind]"); goto end; } - cJSON *upu_ack_ind = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "upuAckInd"); + upu_ack_ind = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "upuAckInd"); if (!upu_ack_ind) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_ack_ind]"); goto end; } - if (!cJSON_IsBool(upu_ack_ind)) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_ack_ind]"); goto end; } - cJSON *upu_mac_iausf = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "upuMacIausf"); - + upu_mac_iausf = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "upuMacIausf"); if (upu_mac_iausf) { - if (!cJSON_IsString(upu_mac_iausf)) { + if (!cJSON_IsString(upu_mac_iausf) && !cJSON_IsNull(upu_mac_iausf)) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [upu_mac_iausf]"); goto end; } } - cJSON *counter_upu = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "counterUpu"); - + counter_upu = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "counterUpu"); if (counter_upu) { - if (!cJSON_IsString(counter_upu)) { + if (!cJSON_IsString(counter_upu) && !cJSON_IsNull(counter_upu)) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [counter_upu]"); goto end; } } - cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "provisioningTime"); + provisioning_time = cJSON_GetObjectItemCaseSensitive(upu_info_1JSON, "provisioningTime"); if (!provisioning_time) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [provisioning_time]"); goto end; } - - if (!cJSON_IsString(provisioning_time)) { + if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) { ogs_error("OpenAPI_upu_info_1_parseFromJSON() failed [provisioning_time]"); goto end; } @@ -194,13 +211,20 @@ OpenAPI_upu_info_1_t *OpenAPI_upu_info_1_parseFromJSON(cJSON *upu_info_1JSON) upu_reg_ind->valueint, upu_ack_ind->valueint, - upu_mac_iausf ? ogs_strdup(upu_mac_iausf->valuestring) : NULL, - counter_upu ? ogs_strdup(counter_upu->valuestring) : NULL, + upu_mac_iausf && !cJSON_IsNull(upu_mac_iausf) ? ogs_strdup(upu_mac_iausf->valuestring) : NULL, + counter_upu && !cJSON_IsNull(counter_upu) ? ogs_strdup(counter_upu->valuestring) : NULL, ogs_strdup(provisioning_time->valuestring) ); return upu_info_1_local_var; end: + if (upu_data_listList) { + OpenAPI_list_for_each(upu_data_listList, node) { + OpenAPI_upu_data_2_free(node->data); + } + OpenAPI_list_free(upu_data_listList); + upu_data_listList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/usage_mon_data.c b/lib/sbi/openapi/model/usage_mon_data.c index 2d52c4738..fb0a7abf1 100644 --- a/lib/sbi/openapi/model/usage_mon_data.c +++ b/lib/sbi/openapi/model/usage_mon_data.c @@ -28,28 +28,48 @@ OpenAPI_usage_mon_data_t *OpenAPI_usage_mon_data_create( void OpenAPI_usage_mon_data_free(OpenAPI_usage_mon_data_t *usage_mon_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == usage_mon_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(usage_mon_data->limit_id); - OpenAPI_list_for_each(usage_mon_data->scopes, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_usage_mon_data_scope_free(localKeyValue->value); - ogs_free(localKeyValue); + if (usage_mon_data->limit_id) { + ogs_free(usage_mon_data->limit_id); + usage_mon_data->limit_id = NULL; + } + if (usage_mon_data->scopes) { + OpenAPI_list_for_each(usage_mon_data->scopes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_scope_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(usage_mon_data->scopes); + usage_mon_data->scopes = NULL; + } + if (usage_mon_data->um_level) { + OpenAPI_usage_mon_level_free(usage_mon_data->um_level); + usage_mon_data->um_level = NULL; + } + if (usage_mon_data->allowed_usage) { + OpenAPI_usage_threshold_free(usage_mon_data->allowed_usage); + usage_mon_data->allowed_usage = NULL; + } + if (usage_mon_data->reset_time) { + OpenAPI_time_period_free(usage_mon_data->reset_time); + usage_mon_data->reset_time = NULL; + } + if (usage_mon_data->supp_feat) { + ogs_free(usage_mon_data->supp_feat); + usage_mon_data->supp_feat = NULL; } - OpenAPI_list_free(usage_mon_data->scopes); - OpenAPI_usage_mon_level_free(usage_mon_data->um_level); - OpenAPI_usage_threshold_free(usage_mon_data->allowed_usage); - OpenAPI_time_period_free(usage_mon_data->reset_time); - ogs_free(usage_mon_data->supp_feat); ogs_free(usage_mon_data); } cJSON *OpenAPI_usage_mon_data_convertToJSON(OpenAPI_usage_mon_data_t *usage_mon_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (usage_mon_data == NULL) { ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [UsageMonData]"); @@ -57,6 +77,10 @@ cJSON *OpenAPI_usage_mon_data_convertToJSON(OpenAPI_usage_mon_data_t *usage_mon_ } item = cJSON_CreateObject(); + if (!usage_mon_data->limit_id) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [limit_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "limitId", usage_mon_data->limit_id) == NULL) { ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [limit_id]"); goto end; @@ -69,21 +93,20 @@ cJSON *OpenAPI_usage_mon_data_convertToJSON(OpenAPI_usage_mon_data_t *usage_mon_ goto end; } cJSON *localMapObject = scopes; - OpenAPI_lnode_t *scopes_node; if (usage_mon_data->scopes) { - OpenAPI_list_for_each(usage_mon_data->scopes, scopes_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)scopes_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_usage_mon_data_scope_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(usage_mon_data->scopes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_usage_mon_data_scope_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_usage_mon_data_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (usage_mon_data->um_level) { cJSON *um_level_local_JSON = OpenAPI_usage_mon_level_convertToJSON(usage_mon_data->um_level); @@ -138,68 +161,71 @@ end: OpenAPI_usage_mon_data_t *OpenAPI_usage_mon_data_parseFromJSON(cJSON *usage_mon_dataJSON) { OpenAPI_usage_mon_data_t *usage_mon_data_local_var = NULL; - cJSON *limit_id = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "limitId"); + OpenAPI_lnode_t *node = NULL; + cJSON *limit_id = NULL; + cJSON *scopes = NULL; + OpenAPI_list_t *scopesList = NULL; + cJSON *um_level = NULL; + OpenAPI_usage_mon_level_t *um_level_local_nonprim = NULL; + cJSON *allowed_usage = NULL; + OpenAPI_usage_threshold_t *allowed_usage_local_nonprim = NULL; + cJSON *reset_time = NULL; + OpenAPI_time_period_t *reset_time_local_nonprim = NULL; + cJSON *supp_feat = NULL; + limit_id = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "limitId"); if (!limit_id) { ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [limit_id]"); goto end; } - if (!cJSON_IsString(limit_id)) { ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [limit_id]"); goto end; } - cJSON *scopes = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "scopes"); - - OpenAPI_list_t *scopesList; + scopes = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "scopes"); if (scopes) { - cJSON *scopes_local_map; - if (!cJSON_IsObject(scopes)) { - ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [scopes]"); - goto end; - } - scopesList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(scopes_local_map, scopes) { - cJSON *localMapObject = scopes_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_scope_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [inner]"); + cJSON *scopes_local_map = NULL; + if (!cJSON_IsObject(scopes) && !cJSON_IsNull(scopes)) { + ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [scopes]"); goto end; } - OpenAPI_list_add(scopesList, localMapKeyPair); - } + if (cJSON_IsObject(scopes)) { + scopesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(scopes_local_map, scopes) { + cJSON *localMapObject = scopes_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_scope_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(scopesList, localMapKeyPair); + } + } } - cJSON *um_level = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "umLevel"); - - OpenAPI_usage_mon_level_t *um_level_local_nonprim = NULL; + um_level = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "umLevel"); if (um_level) { um_level_local_nonprim = OpenAPI_usage_mon_level_parseFromJSON(um_level); } - cJSON *allowed_usage = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "allowedUsage"); - - OpenAPI_usage_threshold_t *allowed_usage_local_nonprim = NULL; + allowed_usage = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "allowedUsage"); if (allowed_usage) { allowed_usage_local_nonprim = OpenAPI_usage_threshold_parseFromJSON(allowed_usage); } - cJSON *reset_time = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "resetTime"); - - OpenAPI_time_period_t *reset_time_local_nonprim = NULL; + reset_time = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "resetTime"); if (reset_time) { reset_time_local_nonprim = OpenAPI_time_period_parseFromJSON(reset_time); } - cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "suppFeat"); - + supp_feat = cJSON_GetObjectItemCaseSensitive(usage_mon_dataJSON, "suppFeat"); if (supp_feat) { - if (!cJSON_IsString(supp_feat)) { + if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) { ogs_error("OpenAPI_usage_mon_data_parseFromJSON() failed [supp_feat]"); goto end; } @@ -211,11 +237,33 @@ OpenAPI_usage_mon_data_t *OpenAPI_usage_mon_data_parseFromJSON(cJSON *usage_mon_ um_level ? um_level_local_nonprim : NULL, allowed_usage ? allowed_usage_local_nonprim : NULL, reset_time ? reset_time_local_nonprim : NULL, - supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL + supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL ); return usage_mon_data_local_var; end: + if (scopesList) { + OpenAPI_list_for_each(scopesList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_scope_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(scopesList); + scopesList = NULL; + } + if (um_level_local_nonprim) { + OpenAPI_usage_mon_level_free(um_level_local_nonprim); + um_level_local_nonprim = NULL; + } + if (allowed_usage_local_nonprim) { + OpenAPI_usage_threshold_free(allowed_usage_local_nonprim); + allowed_usage_local_nonprim = NULL; + } + if (reset_time_local_nonprim) { + OpenAPI_time_period_free(reset_time_local_nonprim); + reset_time_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/usage_mon_data_limit.c b/lib/sbi/openapi/model/usage_mon_data_limit.c index b99e4c9e0..c83a9a486 100644 --- a/lib/sbi/openapi/model/usage_mon_data_limit.c +++ b/lib/sbi/openapi/model/usage_mon_data_limit.c @@ -30,29 +30,52 @@ OpenAPI_usage_mon_data_limit_t *OpenAPI_usage_mon_data_limit_create( void OpenAPI_usage_mon_data_limit_free(OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit) { + OpenAPI_lnode_t *node = NULL; + if (NULL == usage_mon_data_limit) { return; } - OpenAPI_lnode_t *node; - ogs_free(usage_mon_data_limit->limit_id); - OpenAPI_list_for_each(usage_mon_data_limit->scopes, node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; - ogs_free(localKeyValue->key); - OpenAPI_usage_mon_data_scope_free(localKeyValue->value); - ogs_free(localKeyValue); + if (usage_mon_data_limit->limit_id) { + ogs_free(usage_mon_data_limit->limit_id); + usage_mon_data_limit->limit_id = NULL; + } + if (usage_mon_data_limit->scopes) { + OpenAPI_list_for_each(usage_mon_data_limit->scopes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_scope_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(usage_mon_data_limit->scopes); + usage_mon_data_limit->scopes = NULL; + } + if (usage_mon_data_limit->um_level) { + OpenAPI_usage_mon_level_free(usage_mon_data_limit->um_level); + usage_mon_data_limit->um_level = NULL; + } + if (usage_mon_data_limit->start_date) { + ogs_free(usage_mon_data_limit->start_date); + usage_mon_data_limit->start_date = NULL; + } + if (usage_mon_data_limit->end_date) { + ogs_free(usage_mon_data_limit->end_date); + usage_mon_data_limit->end_date = NULL; + } + if (usage_mon_data_limit->usage_limit) { + OpenAPI_usage_threshold_free(usage_mon_data_limit->usage_limit); + usage_mon_data_limit->usage_limit = NULL; + } + if (usage_mon_data_limit->reset_period) { + ogs_free(usage_mon_data_limit->reset_period); + usage_mon_data_limit->reset_period = NULL; } - OpenAPI_list_free(usage_mon_data_limit->scopes); - OpenAPI_usage_mon_level_free(usage_mon_data_limit->um_level); - ogs_free(usage_mon_data_limit->start_date); - ogs_free(usage_mon_data_limit->end_date); - OpenAPI_usage_threshold_free(usage_mon_data_limit->usage_limit); - ogs_free(usage_mon_data_limit->reset_period); ogs_free(usage_mon_data_limit); } cJSON *OpenAPI_usage_mon_data_limit_convertToJSON(OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (usage_mon_data_limit == NULL) { ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [UsageMonDataLimit]"); @@ -60,6 +83,10 @@ cJSON *OpenAPI_usage_mon_data_limit_convertToJSON(OpenAPI_usage_mon_data_limit_t } item = cJSON_CreateObject(); + if (!usage_mon_data_limit->limit_id) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [limit_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "limitId", usage_mon_data_limit->limit_id) == NULL) { ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [limit_id]"); goto end; @@ -72,21 +99,20 @@ cJSON *OpenAPI_usage_mon_data_limit_convertToJSON(OpenAPI_usage_mon_data_limit_t goto end; } cJSON *localMapObject = scopes; - OpenAPI_lnode_t *scopes_node; if (usage_mon_data_limit->scopes) { - OpenAPI_list_for_each(usage_mon_data_limit->scopes, scopes_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)scopes_node->data; - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_usage_mon_data_scope_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [inner]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + OpenAPI_list_for_each(usage_mon_data_limit->scopes, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_usage_mon_data_scope_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_usage_mon_data_limit_convertToJSON() failed [inner]"); + goto end; } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); } } + } if (usage_mon_data_limit->um_level) { cJSON *um_level_local_JSON = OpenAPI_usage_mon_level_convertToJSON(usage_mon_data_limit->um_level); @@ -142,79 +168,82 @@ end: OpenAPI_usage_mon_data_limit_t *OpenAPI_usage_mon_data_limit_parseFromJSON(cJSON *usage_mon_data_limitJSON) { OpenAPI_usage_mon_data_limit_t *usage_mon_data_limit_local_var = NULL; - cJSON *limit_id = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "limitId"); + OpenAPI_lnode_t *node = NULL; + cJSON *limit_id = NULL; + cJSON *scopes = NULL; + OpenAPI_list_t *scopesList = NULL; + cJSON *um_level = NULL; + OpenAPI_usage_mon_level_t *um_level_local_nonprim = NULL; + cJSON *start_date = NULL; + cJSON *end_date = NULL; + cJSON *usage_limit = NULL; + OpenAPI_usage_threshold_t *usage_limit_local_nonprim = NULL; + cJSON *reset_period = NULL; + limit_id = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "limitId"); if (!limit_id) { ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [limit_id]"); goto end; } - if (!cJSON_IsString(limit_id)) { ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [limit_id]"); goto end; } - cJSON *scopes = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "scopes"); - - OpenAPI_list_t *scopesList; + scopes = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "scopes"); if (scopes) { - cJSON *scopes_local_map; - if (!cJSON_IsObject(scopes)) { - ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [scopes]"); - goto end; - } - scopesList = OpenAPI_list_create(); - OpenAPI_map_t *localMapKeyPair = NULL; - cJSON_ArrayForEach(scopes_local_map, scopes) { - cJSON *localMapObject = scopes_local_map; - if (cJSON_IsObject(localMapObject)) { - localMapKeyPair = OpenAPI_map_create( - ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_scope_parseFromJSON(localMapObject)); - } else if (cJSON_IsNull(localMapObject)) { - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); - } else { - ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [inner]"); + cJSON *scopes_local_map = NULL; + if (!cJSON_IsObject(scopes) && !cJSON_IsNull(scopes)) { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [scopes]"); goto end; } - OpenAPI_list_add(scopesList, localMapKeyPair); - } + if (cJSON_IsObject(scopes)) { + scopesList = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach(scopes_local_map, scopes) { + cJSON *localMapObject = scopes_local_map; + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_usage_mon_data_scope_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [inner]"); + goto end; + } + OpenAPI_list_add(scopesList, localMapKeyPair); + } + } } - cJSON *um_level = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "umLevel"); - - OpenAPI_usage_mon_level_t *um_level_local_nonprim = NULL; + um_level = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "umLevel"); if (um_level) { um_level_local_nonprim = OpenAPI_usage_mon_level_parseFromJSON(um_level); } - cJSON *start_date = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "startDate"); - + start_date = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "startDate"); if (start_date) { - if (!cJSON_IsString(start_date)) { + if (!cJSON_IsString(start_date) && !cJSON_IsNull(start_date)) { ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [start_date]"); goto end; } } - cJSON *end_date = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "endDate"); - + end_date = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "endDate"); if (end_date) { - if (!cJSON_IsString(end_date)) { + if (!cJSON_IsString(end_date) && !cJSON_IsNull(end_date)) { ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [end_date]"); goto end; } } - cJSON *usage_limit = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "usageLimit"); - - OpenAPI_usage_threshold_t *usage_limit_local_nonprim = NULL; + usage_limit = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "usageLimit"); if (usage_limit) { usage_limit_local_nonprim = OpenAPI_usage_threshold_parseFromJSON(usage_limit); } - cJSON *reset_period = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "resetPeriod"); - + reset_period = cJSON_GetObjectItemCaseSensitive(usage_mon_data_limitJSON, "resetPeriod"); if (reset_period) { - if (!cJSON_IsString(reset_period)) { + if (!cJSON_IsString(reset_period) && !cJSON_IsNull(reset_period)) { ogs_error("OpenAPI_usage_mon_data_limit_parseFromJSON() failed [reset_period]"); goto end; } @@ -224,14 +253,32 @@ OpenAPI_usage_mon_data_limit_t *OpenAPI_usage_mon_data_limit_parseFromJSON(cJSON ogs_strdup(limit_id->valuestring), scopes ? scopesList : NULL, um_level ? um_level_local_nonprim : NULL, - start_date ? ogs_strdup(start_date->valuestring) : NULL, - end_date ? ogs_strdup(end_date->valuestring) : NULL, + start_date && !cJSON_IsNull(start_date) ? ogs_strdup(start_date->valuestring) : NULL, + end_date && !cJSON_IsNull(end_date) ? ogs_strdup(end_date->valuestring) : NULL, usage_limit ? usage_limit_local_nonprim : NULL, - reset_period ? ogs_strdup(reset_period->valuestring) : NULL + reset_period && !cJSON_IsNull(reset_period) ? ogs_strdup(reset_period->valuestring) : NULL ); return usage_mon_data_limit_local_var; end: + if (scopesList) { + OpenAPI_list_for_each(scopesList, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + OpenAPI_usage_mon_data_scope_free(localKeyValue->value); + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free(scopesList); + scopesList = NULL; + } + if (um_level_local_nonprim) { + OpenAPI_usage_mon_level_free(um_level_local_nonprim); + um_level_local_nonprim = NULL; + } + if (usage_limit_local_nonprim) { + OpenAPI_usage_threshold_free(usage_limit_local_nonprim); + usage_limit_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/usage_mon_data_scope.c b/lib/sbi/openapi/model/usage_mon_data_scope.c index d4e833042..d95238fa4 100644 --- a/lib/sbi/openapi/model/usage_mon_data_scope.c +++ b/lib/sbi/openapi/model/usage_mon_data_scope.c @@ -20,21 +20,29 @@ OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_create( void OpenAPI_usage_mon_data_scope_free(OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope) { + OpenAPI_lnode_t *node = NULL; + if (NULL == usage_mon_data_scope) { return; } - OpenAPI_lnode_t *node; - OpenAPI_snssai_free(usage_mon_data_scope->snssai); - OpenAPI_list_for_each(usage_mon_data_scope->dnn, node) { - ogs_free(node->data); + if (usage_mon_data_scope->snssai) { + OpenAPI_snssai_free(usage_mon_data_scope->snssai); + usage_mon_data_scope->snssai = NULL; + } + if (usage_mon_data_scope->dnn) { + OpenAPI_list_for_each(usage_mon_data_scope->dnn, node) { + ogs_free(node->data); + } + OpenAPI_list_free(usage_mon_data_scope->dnn); + usage_mon_data_scope->dnn = NULL; } - OpenAPI_list_free(usage_mon_data_scope->dnn); ogs_free(usage_mon_data_scope); } cJSON *OpenAPI_usage_mon_data_scope_convertToJSON(OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (usage_mon_data_scope == NULL) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [UsageMonDataScope]"); @@ -42,6 +50,10 @@ cJSON *OpenAPI_usage_mon_data_scope_convertToJSON(OpenAPI_usage_mon_data_scope_t } item = cJSON_CreateObject(); + if (!usage_mon_data_scope->snssai) { + ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [snssai]"); + return NULL; + } cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(usage_mon_data_scope->snssai); if (snssai_local_JSON == NULL) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [snssai]"); @@ -54,19 +66,17 @@ cJSON *OpenAPI_usage_mon_data_scope_convertToJSON(OpenAPI_usage_mon_data_scope_t } if (usage_mon_data_scope->dnn) { - cJSON *dnn = cJSON_AddArrayToObject(item, "dnn"); - if (dnn == NULL) { + cJSON *dnnList = cJSON_AddArrayToObject(item, "dnn"); + if (dnnList == NULL) { ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [dnn]"); goto end; } - - OpenAPI_lnode_t *dnn_node; - OpenAPI_list_for_each(usage_mon_data_scope->dnn, dnn_node) { - if (cJSON_AddStringToObject(dnn, "", (char*)dnn_node->data) == NULL) { - ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [dnn]"); - goto end; + OpenAPI_list_for_each(usage_mon_data_scope->dnn, node) { + if (cJSON_AddStringToObject(dnnList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_usage_mon_data_scope_convertToJSON() failed [dnn]"); + goto end; + } } - } } end: @@ -76,33 +86,37 @@ end: OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_parseFromJSON(cJSON *usage_mon_data_scopeJSON) { OpenAPI_usage_mon_data_scope_t *usage_mon_data_scope_local_var = NULL; - cJSON *snssai = cJSON_GetObjectItemCaseSensitive(usage_mon_data_scopeJSON, "snssai"); + OpenAPI_lnode_t *node = NULL; + cJSON *snssai = NULL; + OpenAPI_snssai_t *snssai_local_nonprim = NULL; + cJSON *dnn = NULL; + OpenAPI_list_t *dnnList = NULL; + snssai = cJSON_GetObjectItemCaseSensitive(usage_mon_data_scopeJSON, "snssai"); if (!snssai) { ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [snssai]"); goto end; } - - OpenAPI_snssai_t *snssai_local_nonprim = NULL; snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai); - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(usage_mon_data_scopeJSON, "dnn"); - - OpenAPI_list_t *dnnList; + dnn = cJSON_GetObjectItemCaseSensitive(usage_mon_data_scopeJSON, "dnn"); if (dnn) { - cJSON *dnn_local; - if (!cJSON_IsArray(dnn)) { - ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [dnn]"); - goto end; - } - dnnList = OpenAPI_list_create(); + cJSON *dnn_local = NULL; + if (!cJSON_IsArray(dnn)) { + ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [dnn]"); + goto end; + } - cJSON_ArrayForEach(dnn_local, dnn) { - if (!cJSON_IsString(dnn_local)) { - ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [dnn]"); - goto end; - } - OpenAPI_list_add(dnnList, ogs_strdup(dnn_local->valuestring)); - } + dnnList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnn_local, dnn) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnn_local)) { + ogs_error("OpenAPI_usage_mon_data_scope_parseFromJSON() failed [dnn]"); + goto end; + } + OpenAPI_list_add(dnnList, ogs_strdup(dnn_local->valuestring)); + } } usage_mon_data_scope_local_var = OpenAPI_usage_mon_data_scope_create ( @@ -112,6 +126,17 @@ OpenAPI_usage_mon_data_scope_t *OpenAPI_usage_mon_data_scope_parseFromJSON(cJSON return usage_mon_data_scope_local_var; end: + if (snssai_local_nonprim) { + OpenAPI_snssai_free(snssai_local_nonprim); + snssai_local_nonprim = NULL; + } + if (dnnList) { + OpenAPI_list_for_each(dnnList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnnList); + dnnList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/usage_mon_level.c b/lib/sbi/openapi/model/usage_mon_level.c index 4d793b44f..78847de6d 100644 --- a/lib/sbi/openapi/model/usage_mon_level.c +++ b/lib/sbi/openapi/model/usage_mon_level.c @@ -16,16 +16,18 @@ OpenAPI_usage_mon_level_t *OpenAPI_usage_mon_level_create( void OpenAPI_usage_mon_level_free(OpenAPI_usage_mon_level_t *usage_mon_level) { + OpenAPI_lnode_t *node = NULL; + if (NULL == usage_mon_level) { return; } - OpenAPI_lnode_t *node; ogs_free(usage_mon_level); } cJSON *OpenAPI_usage_mon_level_convertToJSON(OpenAPI_usage_mon_level_t *usage_mon_level) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (usage_mon_level == NULL) { ogs_error("OpenAPI_usage_mon_level_convertToJSON() failed [UsageMonLevel]"); @@ -40,6 +42,7 @@ end: OpenAPI_usage_mon_level_t *OpenAPI_usage_mon_level_parseFromJSON(cJSON *usage_mon_levelJSON) { OpenAPI_usage_mon_level_t *usage_mon_level_local_var = NULL; + OpenAPI_lnode_t *node = NULL; usage_mon_level_local_var = OpenAPI_usage_mon_level_create ( ); diff --git a/lib/sbi/openapi/model/usage_monitoring_data.c b/lib/sbi/openapi/model/usage_monitoring_data.c index 4c8e14378..bc4f4fe60 100644 --- a/lib/sbi/openapi/model/usage_monitoring_data.c +++ b/lib/sbi/openapi/model/usage_monitoring_data.c @@ -58,22 +58,33 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_create( void OpenAPI_usage_monitoring_data_free(OpenAPI_usage_monitoring_data_t *usage_monitoring_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == usage_monitoring_data) { return; } - OpenAPI_lnode_t *node; - ogs_free(usage_monitoring_data->um_id); - ogs_free(usage_monitoring_data->monitoring_time); - OpenAPI_list_for_each(usage_monitoring_data->ex_usage_pcc_rule_ids, node) { - ogs_free(node->data); + if (usage_monitoring_data->um_id) { + ogs_free(usage_monitoring_data->um_id); + usage_monitoring_data->um_id = NULL; + } + if (usage_monitoring_data->monitoring_time) { + ogs_free(usage_monitoring_data->monitoring_time); + usage_monitoring_data->monitoring_time = NULL; + } + if (usage_monitoring_data->ex_usage_pcc_rule_ids) { + OpenAPI_list_for_each(usage_monitoring_data->ex_usage_pcc_rule_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(usage_monitoring_data->ex_usage_pcc_rule_ids); + usage_monitoring_data->ex_usage_pcc_rule_ids = NULL; } - OpenAPI_list_free(usage_monitoring_data->ex_usage_pcc_rule_ids); ogs_free(usage_monitoring_data); } cJSON *OpenAPI_usage_monitoring_data_convertToJSON(OpenAPI_usage_monitoring_data_t *usage_monitoring_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (usage_monitoring_data == NULL) { ogs_error("OpenAPI_usage_monitoring_data_convertToJSON() failed [UsageMonitoringData]"); @@ -81,6 +92,10 @@ cJSON *OpenAPI_usage_monitoring_data_convertToJSON(OpenAPI_usage_monitoring_data } item = cJSON_CreateObject(); + if (!usage_monitoring_data->um_id) { + ogs_error("OpenAPI_usage_monitoring_data_convertToJSON() failed [um_id]"); + return NULL; + } if (cJSON_AddStringToObject(item, "umId", usage_monitoring_data->um_id) == NULL) { ogs_error("OpenAPI_usage_monitoring_data_convertToJSON() failed [um_id]"); goto end; @@ -157,19 +172,17 @@ cJSON *OpenAPI_usage_monitoring_data_convertToJSON(OpenAPI_usage_monitoring_data } if (usage_monitoring_data->ex_usage_pcc_rule_ids) { - cJSON *ex_usage_pcc_rule_ids = cJSON_AddArrayToObject(item, "exUsagePccRuleIds"); - if (ex_usage_pcc_rule_ids == NULL) { + cJSON *ex_usage_pcc_rule_idsList = cJSON_AddArrayToObject(item, "exUsagePccRuleIds"); + if (ex_usage_pcc_rule_idsList == NULL) { ogs_error("OpenAPI_usage_monitoring_data_convertToJSON() failed [ex_usage_pcc_rule_ids]"); goto end; } - - OpenAPI_lnode_t *ex_usage_pcc_rule_ids_node; - OpenAPI_list_for_each(usage_monitoring_data->ex_usage_pcc_rule_ids, ex_usage_pcc_rule_ids_node) { - if (cJSON_AddStringToObject(ex_usage_pcc_rule_ids, "", (char*)ex_usage_pcc_rule_ids_node->data) == NULL) { - ogs_error("OpenAPI_usage_monitoring_data_convertToJSON() failed [ex_usage_pcc_rule_ids]"); - goto end; + OpenAPI_list_for_each(usage_monitoring_data->ex_usage_pcc_rule_ids, node) { + if (cJSON_AddStringToObject(ex_usage_pcc_rule_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_usage_monitoring_data_convertToJSON() failed [ex_usage_pcc_rule_ids]"); + goto end; + } } - } } end: @@ -179,19 +192,31 @@ end: OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJSON *usage_monitoring_dataJSON) { OpenAPI_usage_monitoring_data_t *usage_monitoring_data_local_var = NULL; - cJSON *um_id = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "umId"); + OpenAPI_lnode_t *node = NULL; + cJSON *um_id = NULL; + cJSON *volume_threshold = NULL; + cJSON *volume_threshold_uplink = NULL; + cJSON *volume_threshold_downlink = NULL; + cJSON *time_threshold = NULL; + cJSON *monitoring_time = NULL; + cJSON *next_vol_threshold = NULL; + cJSON *next_vol_threshold_uplink = NULL; + cJSON *next_vol_threshold_downlink = NULL; + cJSON *next_time_threshold = NULL; + cJSON *inactivity_time = NULL; + cJSON *ex_usage_pcc_rule_ids = NULL; + OpenAPI_list_t *ex_usage_pcc_rule_idsList = NULL; + um_id = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "umId"); if (!um_id) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [um_id]"); goto end; } - if (!cJSON_IsString(um_id)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [um_id]"); goto end; } - cJSON *volume_threshold = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "volumeThreshold"); - + volume_threshold = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "volumeThreshold"); if (volume_threshold) { if (!cJSON_IsNumber(volume_threshold)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [volume_threshold]"); @@ -199,8 +224,7 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *volume_threshold_uplink = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "volumeThresholdUplink"); - + volume_threshold_uplink = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "volumeThresholdUplink"); if (volume_threshold_uplink) { if (!cJSON_IsNumber(volume_threshold_uplink)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [volume_threshold_uplink]"); @@ -208,8 +232,7 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *volume_threshold_downlink = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "volumeThresholdDownlink"); - + volume_threshold_downlink = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "volumeThresholdDownlink"); if (volume_threshold_downlink) { if (!cJSON_IsNumber(volume_threshold_downlink)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [volume_threshold_downlink]"); @@ -217,8 +240,7 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *time_threshold = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "timeThreshold"); - + time_threshold = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "timeThreshold"); if (time_threshold) { if (!cJSON_IsNumber(time_threshold)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [time_threshold]"); @@ -226,17 +248,15 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *monitoring_time = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "monitoringTime"); - + monitoring_time = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "monitoringTime"); if (monitoring_time) { - if (!cJSON_IsString(monitoring_time)) { + if (!cJSON_IsString(monitoring_time) && !cJSON_IsNull(monitoring_time)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [monitoring_time]"); goto end; } } - cJSON *next_vol_threshold = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "nextVolThreshold"); - + next_vol_threshold = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "nextVolThreshold"); if (next_vol_threshold) { if (!cJSON_IsNumber(next_vol_threshold)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [next_vol_threshold]"); @@ -244,8 +264,7 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *next_vol_threshold_uplink = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "nextVolThresholdUplink"); - + next_vol_threshold_uplink = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "nextVolThresholdUplink"); if (next_vol_threshold_uplink) { if (!cJSON_IsNumber(next_vol_threshold_uplink)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [next_vol_threshold_uplink]"); @@ -253,8 +272,7 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *next_vol_threshold_downlink = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "nextVolThresholdDownlink"); - + next_vol_threshold_downlink = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "nextVolThresholdDownlink"); if (next_vol_threshold_downlink) { if (!cJSON_IsNumber(next_vol_threshold_downlink)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [next_vol_threshold_downlink]"); @@ -262,8 +280,7 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *next_time_threshold = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "nextTimeThreshold"); - + next_time_threshold = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "nextTimeThreshold"); if (next_time_threshold) { if (!cJSON_IsNumber(next_time_threshold)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [next_time_threshold]"); @@ -271,8 +288,7 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *inactivity_time = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "inactivityTime"); - + inactivity_time = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "inactivityTime"); if (inactivity_time) { if (!cJSON_IsNumber(inactivity_time)) { ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [inactivity_time]"); @@ -280,24 +296,25 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS } } - cJSON *ex_usage_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "exUsagePccRuleIds"); - - OpenAPI_list_t *ex_usage_pcc_rule_idsList; + ex_usage_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(usage_monitoring_dataJSON, "exUsagePccRuleIds"); if (ex_usage_pcc_rule_ids) { - cJSON *ex_usage_pcc_rule_ids_local; - if (!cJSON_IsArray(ex_usage_pcc_rule_ids)) { - ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [ex_usage_pcc_rule_ids]"); - goto end; - } - ex_usage_pcc_rule_idsList = OpenAPI_list_create(); + cJSON *ex_usage_pcc_rule_ids_local = NULL; + if (!cJSON_IsArray(ex_usage_pcc_rule_ids)) { + ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [ex_usage_pcc_rule_ids]"); + goto end; + } - cJSON_ArrayForEach(ex_usage_pcc_rule_ids_local, ex_usage_pcc_rule_ids) { - if (!cJSON_IsString(ex_usage_pcc_rule_ids_local)) { - ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [ex_usage_pcc_rule_ids]"); - goto end; - } - OpenAPI_list_add(ex_usage_pcc_rule_idsList, ogs_strdup(ex_usage_pcc_rule_ids_local->valuestring)); - } + ex_usage_pcc_rule_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ex_usage_pcc_rule_ids_local, ex_usage_pcc_rule_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ex_usage_pcc_rule_ids_local)) { + ogs_error("OpenAPI_usage_monitoring_data_parseFromJSON() failed [ex_usage_pcc_rule_ids]"); + goto end; + } + OpenAPI_list_add(ex_usage_pcc_rule_idsList, ogs_strdup(ex_usage_pcc_rule_ids_local->valuestring)); + } } usage_monitoring_data_local_var = OpenAPI_usage_monitoring_data_create ( @@ -310,7 +327,7 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS volume_threshold_downlink ? volume_threshold_downlink->valuedouble : 0, time_threshold ? true : false, time_threshold ? time_threshold->valuedouble : 0, - monitoring_time ? ogs_strdup(monitoring_time->valuestring) : NULL, + monitoring_time && !cJSON_IsNull(monitoring_time) ? ogs_strdup(monitoring_time->valuestring) : NULL, next_vol_threshold ? true : false, next_vol_threshold ? next_vol_threshold->valuedouble : 0, next_vol_threshold_uplink ? true : false, @@ -326,6 +343,13 @@ OpenAPI_usage_monitoring_data_t *OpenAPI_usage_monitoring_data_parseFromJSON(cJS return usage_monitoring_data_local_var; end: + if (ex_usage_pcc_rule_idsList) { + OpenAPI_list_for_each(ex_usage_pcc_rule_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ex_usage_pcc_rule_idsList); + ex_usage_pcc_rule_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/usage_threshold.c b/lib/sbi/openapi/model/usage_threshold.c index 8b35b3663..a1e55df4a 100644 --- a/lib/sbi/openapi/model/usage_threshold.c +++ b/lib/sbi/openapi/model/usage_threshold.c @@ -32,16 +32,18 @@ OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_create( void OpenAPI_usage_threshold_free(OpenAPI_usage_threshold_t *usage_threshold) { + OpenAPI_lnode_t *node = NULL; + if (NULL == usage_threshold) { return; } - OpenAPI_lnode_t *node; ogs_free(usage_threshold); } cJSON *OpenAPI_usage_threshold_convertToJSON(OpenAPI_usage_threshold_t *usage_threshold) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (usage_threshold == NULL) { ogs_error("OpenAPI_usage_threshold_convertToJSON() failed [UsageThreshold]"); @@ -84,8 +86,12 @@ end: OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_thresholdJSON) { OpenAPI_usage_threshold_t *usage_threshold_local_var = NULL; - cJSON *duration = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "duration"); - + OpenAPI_lnode_t *node = NULL; + cJSON *duration = NULL; + cJSON *total_volume = NULL; + cJSON *downlink_volume = NULL; + cJSON *uplink_volume = NULL; + duration = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "duration"); if (duration) { if (!cJSON_IsNumber(duration)) { ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [duration]"); @@ -93,8 +99,7 @@ OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_th } } - cJSON *total_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "totalVolume"); - + total_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "totalVolume"); if (total_volume) { if (!cJSON_IsNumber(total_volume)) { ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [total_volume]"); @@ -102,8 +107,7 @@ OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_th } } - cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "downlinkVolume"); - + downlink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "downlinkVolume"); if (downlink_volume) { if (!cJSON_IsNumber(downlink_volume)) { ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [downlink_volume]"); @@ -111,8 +115,7 @@ OpenAPI_usage_threshold_t *OpenAPI_usage_threshold_parseFromJSON(cJSON *usage_th } } - cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "uplinkVolume"); - + uplink_volume = cJSON_GetObjectItemCaseSensitive(usage_thresholdJSON, "uplinkVolume"); if (uplink_volume) { if (!cJSON_IsNumber(uplink_volume)) { ogs_error("OpenAPI_usage_threshold_parseFromJSON() failed [uplink_volume]"); diff --git a/lib/sbi/openapi/model/usage_threshold_rm.c b/lib/sbi/openapi/model/usage_threshold_rm.c index 5abfc045e..ccfc088c4 100644 --- a/lib/sbi/openapi/model/usage_threshold_rm.c +++ b/lib/sbi/openapi/model/usage_threshold_rm.c @@ -32,16 +32,18 @@ OpenAPI_usage_threshold_rm_t *OpenAPI_usage_threshold_rm_create( void OpenAPI_usage_threshold_rm_free(OpenAPI_usage_threshold_rm_t *usage_threshold_rm) { + OpenAPI_lnode_t *node = NULL; + if (NULL == usage_threshold_rm) { return; } - OpenAPI_lnode_t *node; ogs_free(usage_threshold_rm); } cJSON *OpenAPI_usage_threshold_rm_convertToJSON(OpenAPI_usage_threshold_rm_t *usage_threshold_rm) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (usage_threshold_rm == NULL) { ogs_error("OpenAPI_usage_threshold_rm_convertToJSON() failed [UsageThresholdRm]"); @@ -84,8 +86,12 @@ end: OpenAPI_usage_threshold_rm_t *OpenAPI_usage_threshold_rm_parseFromJSON(cJSON *usage_threshold_rmJSON) { OpenAPI_usage_threshold_rm_t *usage_threshold_rm_local_var = NULL; - cJSON *duration = cJSON_GetObjectItemCaseSensitive(usage_threshold_rmJSON, "duration"); - + OpenAPI_lnode_t *node = NULL; + cJSON *duration = NULL; + cJSON *total_volume = NULL; + cJSON *downlink_volume = NULL; + cJSON *uplink_volume = NULL; + duration = cJSON_GetObjectItemCaseSensitive(usage_threshold_rmJSON, "duration"); if (duration) { if (!cJSON_IsNumber(duration)) { ogs_error("OpenAPI_usage_threshold_rm_parseFromJSON() failed [duration]"); @@ -93,8 +99,7 @@ OpenAPI_usage_threshold_rm_t *OpenAPI_usage_threshold_rm_parseFromJSON(cJSON *us } } - cJSON *total_volume = cJSON_GetObjectItemCaseSensitive(usage_threshold_rmJSON, "totalVolume"); - + total_volume = cJSON_GetObjectItemCaseSensitive(usage_threshold_rmJSON, "totalVolume"); if (total_volume) { if (!cJSON_IsNumber(total_volume)) { ogs_error("OpenAPI_usage_threshold_rm_parseFromJSON() failed [total_volume]"); @@ -102,8 +107,7 @@ OpenAPI_usage_threshold_rm_t *OpenAPI_usage_threshold_rm_parseFromJSON(cJSON *us } } - cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(usage_threshold_rmJSON, "downlinkVolume"); - + downlink_volume = cJSON_GetObjectItemCaseSensitive(usage_threshold_rmJSON, "downlinkVolume"); if (downlink_volume) { if (!cJSON_IsNumber(downlink_volume)) { ogs_error("OpenAPI_usage_threshold_rm_parseFromJSON() failed [downlink_volume]"); @@ -111,8 +115,7 @@ OpenAPI_usage_threshold_rm_t *OpenAPI_usage_threshold_rm_parseFromJSON(cJSON *us } } - cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(usage_threshold_rmJSON, "uplinkVolume"); - + uplink_volume = cJSON_GetObjectItemCaseSensitive(usage_threshold_rmJSON, "uplinkVolume"); if (uplink_volume) { if (!cJSON_IsNumber(uplink_volume)) { ogs_error("OpenAPI_usage_threshold_rm_parseFromJSON() failed [uplink_volume]"); diff --git a/lib/sbi/openapi/model/user_identifier.c b/lib/sbi/openapi/model/user_identifier.c index 3fad98283..801bbc818 100644 --- a/lib/sbi/openapi/model/user_identifier.c +++ b/lib/sbi/openapi/model/user_identifier.c @@ -22,19 +22,30 @@ OpenAPI_user_identifier_t *OpenAPI_user_identifier_create( void OpenAPI_user_identifier_free(OpenAPI_user_identifier_t *user_identifier) { + OpenAPI_lnode_t *node = NULL; + if (NULL == user_identifier) { return; } - OpenAPI_lnode_t *node; - ogs_free(user_identifier->supi); - ogs_free(user_identifier->gpsi); - ogs_free(user_identifier->validity_time); + if (user_identifier->supi) { + ogs_free(user_identifier->supi); + user_identifier->supi = NULL; + } + if (user_identifier->gpsi) { + ogs_free(user_identifier->gpsi); + user_identifier->gpsi = NULL; + } + if (user_identifier->validity_time) { + ogs_free(user_identifier->validity_time); + user_identifier->validity_time = NULL; + } ogs_free(user_identifier); } cJSON *OpenAPI_user_identifier_convertToJSON(OpenAPI_user_identifier_t *user_identifier) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (user_identifier == NULL) { ogs_error("OpenAPI_user_identifier_convertToJSON() failed [UserIdentifier]"); @@ -42,6 +53,10 @@ cJSON *OpenAPI_user_identifier_convertToJSON(OpenAPI_user_identifier_t *user_ide } item = cJSON_CreateObject(); + if (!user_identifier->supi) { + ogs_error("OpenAPI_user_identifier_convertToJSON() failed [supi]"); + return NULL; + } if (cJSON_AddStringToObject(item, "supi", user_identifier->supi) == NULL) { ogs_error("OpenAPI_user_identifier_convertToJSON() failed [supi]"); goto end; @@ -68,30 +83,31 @@ end: OpenAPI_user_identifier_t *OpenAPI_user_identifier_parseFromJSON(cJSON *user_identifierJSON) { OpenAPI_user_identifier_t *user_identifier_local_var = NULL; - cJSON *supi = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "supi"); + OpenAPI_lnode_t *node = NULL; + cJSON *supi = NULL; + cJSON *gpsi = NULL; + cJSON *validity_time = NULL; + supi = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "supi"); if (!supi) { ogs_error("OpenAPI_user_identifier_parseFromJSON() failed [supi]"); goto end; } - if (!cJSON_IsString(supi)) { ogs_error("OpenAPI_user_identifier_parseFromJSON() failed [supi]"); goto end; } - cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "gpsi"); - + gpsi = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "gpsi"); if (gpsi) { - if (!cJSON_IsString(gpsi)) { + if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) { ogs_error("OpenAPI_user_identifier_parseFromJSON() failed [gpsi]"); goto end; } } - cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "validityTime"); - + validity_time = cJSON_GetObjectItemCaseSensitive(user_identifierJSON, "validityTime"); if (validity_time) { - if (!cJSON_IsString(validity_time)) { + if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) { ogs_error("OpenAPI_user_identifier_parseFromJSON() failed [validity_time]"); goto end; } @@ -99,8 +115,8 @@ OpenAPI_user_identifier_t *OpenAPI_user_identifier_parseFromJSON(cJSON *user_ide user_identifier_local_var = OpenAPI_user_identifier_create ( ogs_strdup(supi->valuestring), - gpsi ? ogs_strdup(gpsi->valuestring) : NULL, - validity_time ? ogs_strdup(validity_time->valuestring) : NULL + gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL, + validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL ); return user_identifier_local_var; diff --git a/lib/sbi/openapi/model/user_location.c b/lib/sbi/openapi/model/user_location.c index d3d42ff7a..0ed3d8685 100644 --- a/lib/sbi/openapi/model/user_location.c +++ b/lib/sbi/openapi/model/user_location.c @@ -22,19 +22,30 @@ OpenAPI_user_location_t *OpenAPI_user_location_create( void OpenAPI_user_location_free(OpenAPI_user_location_t *user_location) { + OpenAPI_lnode_t *node = NULL; + if (NULL == user_location) { return; } - OpenAPI_lnode_t *node; - OpenAPI_eutra_location_free(user_location->eutra_location); - OpenAPI_nr_location_free(user_location->nr_location); - OpenAPI_n3ga_location_free(user_location->n3ga_location); + if (user_location->eutra_location) { + OpenAPI_eutra_location_free(user_location->eutra_location); + user_location->eutra_location = NULL; + } + if (user_location->nr_location) { + OpenAPI_nr_location_free(user_location->nr_location); + user_location->nr_location = NULL; + } + if (user_location->n3ga_location) { + OpenAPI_n3ga_location_free(user_location->n3ga_location); + user_location->n3ga_location = NULL; + } ogs_free(user_location); } cJSON *OpenAPI_user_location_convertToJSON(OpenAPI_user_location_t *user_location) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (user_location == NULL) { ogs_error("OpenAPI_user_location_convertToJSON() failed [UserLocation]"); @@ -88,23 +99,24 @@ end: OpenAPI_user_location_t *OpenAPI_user_location_parseFromJSON(cJSON *user_locationJSON) { OpenAPI_user_location_t *user_location_local_var = NULL; - cJSON *eutra_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "eutraLocation"); - + OpenAPI_lnode_t *node = NULL; + cJSON *eutra_location = NULL; OpenAPI_eutra_location_t *eutra_location_local_nonprim = NULL; + cJSON *nr_location = NULL; + OpenAPI_nr_location_t *nr_location_local_nonprim = NULL; + cJSON *n3ga_location = NULL; + OpenAPI_n3ga_location_t *n3ga_location_local_nonprim = NULL; + eutra_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "eutraLocation"); if (eutra_location) { eutra_location_local_nonprim = OpenAPI_eutra_location_parseFromJSON(eutra_location); } - cJSON *nr_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "nrLocation"); - - OpenAPI_nr_location_t *nr_location_local_nonprim = NULL; + nr_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "nrLocation"); if (nr_location) { nr_location_local_nonprim = OpenAPI_nr_location_parseFromJSON(nr_location); } - cJSON *n3ga_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "n3gaLocation"); - - OpenAPI_n3ga_location_t *n3ga_location_local_nonprim = NULL; + n3ga_location = cJSON_GetObjectItemCaseSensitive(user_locationJSON, "n3gaLocation"); if (n3ga_location) { n3ga_location_local_nonprim = OpenAPI_n3ga_location_parseFromJSON(n3ga_location); } @@ -117,6 +129,18 @@ OpenAPI_user_location_t *OpenAPI_user_location_parseFromJSON(cJSON *user_locatio return user_location_local_var; end: + if (eutra_location_local_nonprim) { + OpenAPI_eutra_location_free(eutra_location_local_nonprim); + eutra_location_local_nonprim = NULL; + } + if (nr_location_local_nonprim) { + OpenAPI_nr_location_free(nr_location_local_nonprim); + nr_location_local_nonprim = NULL; + } + if (n3ga_location_local_nonprim) { + OpenAPI_n3ga_location_free(n3ga_location_local_nonprim); + n3ga_location_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/v2x_context.c b/lib/sbi/openapi/model/v2x_context.c index 0bfd8d4b5..3b40ccf60 100644 --- a/lib/sbi/openapi/model/v2x_context.c +++ b/lib/sbi/openapi/model/v2x_context.c @@ -26,21 +26,38 @@ OpenAPI_v2x_context_t *OpenAPI_v2x_context_create( void OpenAPI_v2x_context_free(OpenAPI_v2x_context_t *v2x_context) { + OpenAPI_lnode_t *node = NULL; + if (NULL == v2x_context) { return; } - OpenAPI_lnode_t *node; - OpenAPI_nr_v2x_auth_free(v2x_context->nr_v2x_services_auth); - OpenAPI_lte_v2x_auth_free(v2x_context->lte_v2x_services_auth); - ogs_free(v2x_context->nr_ue_sidelink_ambr); - ogs_free(v2x_context->lte_ue_sidelink_ambr); - OpenAPI_pc5_qo_s_para_free(v2x_context->pc5_qo_s_para); + if (v2x_context->nr_v2x_services_auth) { + OpenAPI_nr_v2x_auth_free(v2x_context->nr_v2x_services_auth); + v2x_context->nr_v2x_services_auth = NULL; + } + if (v2x_context->lte_v2x_services_auth) { + OpenAPI_lte_v2x_auth_free(v2x_context->lte_v2x_services_auth); + v2x_context->lte_v2x_services_auth = NULL; + } + if (v2x_context->nr_ue_sidelink_ambr) { + ogs_free(v2x_context->nr_ue_sidelink_ambr); + v2x_context->nr_ue_sidelink_ambr = NULL; + } + if (v2x_context->lte_ue_sidelink_ambr) { + ogs_free(v2x_context->lte_ue_sidelink_ambr); + v2x_context->lte_ue_sidelink_ambr = NULL; + } + if (v2x_context->pc5_qo_s_para) { + OpenAPI_pc5_qo_s_para_free(v2x_context->pc5_qo_s_para); + v2x_context->pc5_qo_s_para = NULL; + } ogs_free(v2x_context); } cJSON *OpenAPI_v2x_context_convertToJSON(OpenAPI_v2x_context_t *v2x_context) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (v2x_context == NULL) { ogs_error("OpenAPI_v2x_context_convertToJSON() failed [V2xContext]"); @@ -108,41 +125,42 @@ end: OpenAPI_v2x_context_t *OpenAPI_v2x_context_parseFromJSON(cJSON *v2x_contextJSON) { OpenAPI_v2x_context_t *v2x_context_local_var = NULL; - cJSON *nr_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "nrV2xServicesAuth"); - + OpenAPI_lnode_t *node = NULL; + cJSON *nr_v2x_services_auth = NULL; OpenAPI_nr_v2x_auth_t *nr_v2x_services_auth_local_nonprim = NULL; + cJSON *lte_v2x_services_auth = NULL; + OpenAPI_lte_v2x_auth_t *lte_v2x_services_auth_local_nonprim = NULL; + cJSON *nr_ue_sidelink_ambr = NULL; + cJSON *lte_ue_sidelink_ambr = NULL; + cJSON *pc5_qo_s_para = NULL; + OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para_local_nonprim = NULL; + nr_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "nrV2xServicesAuth"); if (nr_v2x_services_auth) { nr_v2x_services_auth_local_nonprim = OpenAPI_nr_v2x_auth_parseFromJSON(nr_v2x_services_auth); } - cJSON *lte_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "lteV2xServicesAuth"); - - OpenAPI_lte_v2x_auth_t *lte_v2x_services_auth_local_nonprim = NULL; + lte_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "lteV2xServicesAuth"); if (lte_v2x_services_auth) { lte_v2x_services_auth_local_nonprim = OpenAPI_lte_v2x_auth_parseFromJSON(lte_v2x_services_auth); } - cJSON *nr_ue_sidelink_ambr = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "nrUeSidelinkAmbr"); - + nr_ue_sidelink_ambr = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "nrUeSidelinkAmbr"); if (nr_ue_sidelink_ambr) { - if (!cJSON_IsString(nr_ue_sidelink_ambr)) { + if (!cJSON_IsString(nr_ue_sidelink_ambr) && !cJSON_IsNull(nr_ue_sidelink_ambr)) { ogs_error("OpenAPI_v2x_context_parseFromJSON() failed [nr_ue_sidelink_ambr]"); goto end; } } - cJSON *lte_ue_sidelink_ambr = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "lteUeSidelinkAmbr"); - + lte_ue_sidelink_ambr = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "lteUeSidelinkAmbr"); if (lte_ue_sidelink_ambr) { - if (!cJSON_IsString(lte_ue_sidelink_ambr)) { + if (!cJSON_IsString(lte_ue_sidelink_ambr) && !cJSON_IsNull(lte_ue_sidelink_ambr)) { ogs_error("OpenAPI_v2x_context_parseFromJSON() failed [lte_ue_sidelink_ambr]"); goto end; } } - cJSON *pc5_qo_s_para = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "Pc5QoSPara"); - - OpenAPI_pc5_qo_s_para_t *pc5_qo_s_para_local_nonprim = NULL; + pc5_qo_s_para = cJSON_GetObjectItemCaseSensitive(v2x_contextJSON, "Pc5QoSPara"); if (pc5_qo_s_para) { pc5_qo_s_para_local_nonprim = OpenAPI_pc5_qo_s_para_parseFromJSON(pc5_qo_s_para); } @@ -150,13 +168,25 @@ OpenAPI_v2x_context_t *OpenAPI_v2x_context_parseFromJSON(cJSON *v2x_contextJSON) v2x_context_local_var = OpenAPI_v2x_context_create ( nr_v2x_services_auth ? nr_v2x_services_auth_local_nonprim : NULL, lte_v2x_services_auth ? lte_v2x_services_auth_local_nonprim : NULL, - nr_ue_sidelink_ambr ? ogs_strdup(nr_ue_sidelink_ambr->valuestring) : NULL, - lte_ue_sidelink_ambr ? ogs_strdup(lte_ue_sidelink_ambr->valuestring) : NULL, + nr_ue_sidelink_ambr && !cJSON_IsNull(nr_ue_sidelink_ambr) ? ogs_strdup(nr_ue_sidelink_ambr->valuestring) : NULL, + lte_ue_sidelink_ambr && !cJSON_IsNull(lte_ue_sidelink_ambr) ? ogs_strdup(lte_ue_sidelink_ambr->valuestring) : NULL, pc5_qo_s_para ? pc5_qo_s_para_local_nonprim : NULL ); return v2x_context_local_var; end: + if (nr_v2x_services_auth_local_nonprim) { + OpenAPI_nr_v2x_auth_free(nr_v2x_services_auth_local_nonprim); + nr_v2x_services_auth_local_nonprim = NULL; + } + if (lte_v2x_services_auth_local_nonprim) { + OpenAPI_lte_v2x_auth_free(lte_v2x_services_auth_local_nonprim); + lte_v2x_services_auth_local_nonprim = NULL; + } + if (pc5_qo_s_para_local_nonprim) { + OpenAPI_pc5_qo_s_para_free(pc5_qo_s_para_local_nonprim); + pc5_qo_s_para_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/v2x_information.c b/lib/sbi/openapi/model/v2x_information.c index 5a48ea43e..d6ad0aaf0 100644 --- a/lib/sbi/openapi/model/v2x_information.c +++ b/lib/sbi/openapi/model/v2x_information.c @@ -18,17 +18,22 @@ OpenAPI_v2x_information_t *OpenAPI_v2x_information_create( void OpenAPI_v2x_information_free(OpenAPI_v2x_information_t *v2x_information) { + OpenAPI_lnode_t *node = NULL; + if (NULL == v2x_information) { return; } - OpenAPI_lnode_t *node; - OpenAPI_n2_info_content_free(v2x_information->n2_pc5_pol); + if (v2x_information->n2_pc5_pol) { + OpenAPI_n2_info_content_free(v2x_information->n2_pc5_pol); + v2x_information->n2_pc5_pol = NULL; + } ogs_free(v2x_information); } cJSON *OpenAPI_v2x_information_convertToJSON(OpenAPI_v2x_information_t *v2x_information) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (v2x_information == NULL) { ogs_error("OpenAPI_v2x_information_convertToJSON() failed [V2xInformation]"); @@ -56,9 +61,10 @@ end: OpenAPI_v2x_information_t *OpenAPI_v2x_information_parseFromJSON(cJSON *v2x_informationJSON) { OpenAPI_v2x_information_t *v2x_information_local_var = NULL; - cJSON *n2_pc5_pol = cJSON_GetObjectItemCaseSensitive(v2x_informationJSON, "n2Pc5Pol"); - + OpenAPI_lnode_t *node = NULL; + cJSON *n2_pc5_pol = NULL; OpenAPI_n2_info_content_t *n2_pc5_pol_local_nonprim = NULL; + n2_pc5_pol = cJSON_GetObjectItemCaseSensitive(v2x_informationJSON, "n2Pc5Pol"); if (n2_pc5_pol) { n2_pc5_pol_local_nonprim = OpenAPI_n2_info_content_parseFromJSON(n2_pc5_pol); } @@ -69,6 +75,10 @@ OpenAPI_v2x_information_t *OpenAPI_v2x_information_parseFromJSON(cJSON *v2x_info return v2x_information_local_var; end: + if (n2_pc5_pol_local_nonprim) { + OpenAPI_n2_info_content_free(n2_pc5_pol_local_nonprim); + n2_pc5_pol_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/v2x_subscription_data.c b/lib/sbi/openapi/model/v2x_subscription_data.c index b67f1c2ea..6f5e96c79 100644 --- a/lib/sbi/openapi/model/v2x_subscription_data.c +++ b/lib/sbi/openapi/model/v2x_subscription_data.c @@ -24,20 +24,34 @@ OpenAPI_v2x_subscription_data_t *OpenAPI_v2x_subscription_data_create( void OpenAPI_v2x_subscription_data_free(OpenAPI_v2x_subscription_data_t *v2x_subscription_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == v2x_subscription_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_nr_v2x_auth_free(v2x_subscription_data->nr_v2x_services_auth); - OpenAPI_lte_v2x_auth_free(v2x_subscription_data->lte_v2x_services_auth); - ogs_free(v2x_subscription_data->nr_ue_pc5_ambr); - ogs_free(v2x_subscription_data->lte_pc5_ambr); + if (v2x_subscription_data->nr_v2x_services_auth) { + OpenAPI_nr_v2x_auth_free(v2x_subscription_data->nr_v2x_services_auth); + v2x_subscription_data->nr_v2x_services_auth = NULL; + } + if (v2x_subscription_data->lte_v2x_services_auth) { + OpenAPI_lte_v2x_auth_free(v2x_subscription_data->lte_v2x_services_auth); + v2x_subscription_data->lte_v2x_services_auth = NULL; + } + if (v2x_subscription_data->nr_ue_pc5_ambr) { + ogs_free(v2x_subscription_data->nr_ue_pc5_ambr); + v2x_subscription_data->nr_ue_pc5_ambr = NULL; + } + if (v2x_subscription_data->lte_pc5_ambr) { + ogs_free(v2x_subscription_data->lte_pc5_ambr); + v2x_subscription_data->lte_pc5_ambr = NULL; + } ogs_free(v2x_subscription_data); } cJSON *OpenAPI_v2x_subscription_data_convertToJSON(OpenAPI_v2x_subscription_data_t *v2x_subscription_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (v2x_subscription_data == NULL) { ogs_error("OpenAPI_v2x_subscription_data_convertToJSON() failed [V2xSubscriptionData]"); @@ -92,33 +106,34 @@ end: OpenAPI_v2x_subscription_data_t *OpenAPI_v2x_subscription_data_parseFromJSON(cJSON *v2x_subscription_dataJSON) { OpenAPI_v2x_subscription_data_t *v2x_subscription_data_local_var = NULL; - cJSON *nr_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_subscription_dataJSON, "nrV2xServicesAuth"); - + OpenAPI_lnode_t *node = NULL; + cJSON *nr_v2x_services_auth = NULL; OpenAPI_nr_v2x_auth_t *nr_v2x_services_auth_local_nonprim = NULL; + cJSON *lte_v2x_services_auth = NULL; + OpenAPI_lte_v2x_auth_t *lte_v2x_services_auth_local_nonprim = NULL; + cJSON *nr_ue_pc5_ambr = NULL; + cJSON *lte_pc5_ambr = NULL; + nr_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_subscription_dataJSON, "nrV2xServicesAuth"); if (nr_v2x_services_auth) { nr_v2x_services_auth_local_nonprim = OpenAPI_nr_v2x_auth_parseFromJSON(nr_v2x_services_auth); } - cJSON *lte_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_subscription_dataJSON, "lteV2xServicesAuth"); - - OpenAPI_lte_v2x_auth_t *lte_v2x_services_auth_local_nonprim = NULL; + lte_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_subscription_dataJSON, "lteV2xServicesAuth"); if (lte_v2x_services_auth) { lte_v2x_services_auth_local_nonprim = OpenAPI_lte_v2x_auth_parseFromJSON(lte_v2x_services_auth); } - cJSON *nr_ue_pc5_ambr = cJSON_GetObjectItemCaseSensitive(v2x_subscription_dataJSON, "nrUePc5Ambr"); - + nr_ue_pc5_ambr = cJSON_GetObjectItemCaseSensitive(v2x_subscription_dataJSON, "nrUePc5Ambr"); if (nr_ue_pc5_ambr) { - if (!cJSON_IsString(nr_ue_pc5_ambr)) { + if (!cJSON_IsString(nr_ue_pc5_ambr) && !cJSON_IsNull(nr_ue_pc5_ambr)) { ogs_error("OpenAPI_v2x_subscription_data_parseFromJSON() failed [nr_ue_pc5_ambr]"); goto end; } } - cJSON *lte_pc5_ambr = cJSON_GetObjectItemCaseSensitive(v2x_subscription_dataJSON, "ltePc5Ambr"); - + lte_pc5_ambr = cJSON_GetObjectItemCaseSensitive(v2x_subscription_dataJSON, "ltePc5Ambr"); if (lte_pc5_ambr) { - if (!cJSON_IsString(lte_pc5_ambr)) { + if (!cJSON_IsString(lte_pc5_ambr) && !cJSON_IsNull(lte_pc5_ambr)) { ogs_error("OpenAPI_v2x_subscription_data_parseFromJSON() failed [lte_pc5_ambr]"); goto end; } @@ -127,12 +142,20 @@ OpenAPI_v2x_subscription_data_t *OpenAPI_v2x_subscription_data_parseFromJSON(cJS v2x_subscription_data_local_var = OpenAPI_v2x_subscription_data_create ( nr_v2x_services_auth ? nr_v2x_services_auth_local_nonprim : NULL, lte_v2x_services_auth ? lte_v2x_services_auth_local_nonprim : NULL, - nr_ue_pc5_ambr ? ogs_strdup(nr_ue_pc5_ambr->valuestring) : NULL, - lte_pc5_ambr ? ogs_strdup(lte_pc5_ambr->valuestring) : NULL + nr_ue_pc5_ambr && !cJSON_IsNull(nr_ue_pc5_ambr) ? ogs_strdup(nr_ue_pc5_ambr->valuestring) : NULL, + lte_pc5_ambr && !cJSON_IsNull(lte_pc5_ambr) ? ogs_strdup(lte_pc5_ambr->valuestring) : NULL ); return v2x_subscription_data_local_var; end: + if (nr_v2x_services_auth_local_nonprim) { + OpenAPI_nr_v2x_auth_free(nr_v2x_services_auth_local_nonprim); + nr_v2x_services_auth_local_nonprim = NULL; + } + if (lte_v2x_services_auth_local_nonprim) { + OpenAPI_lte_v2x_auth_free(lte_v2x_services_auth_local_nonprim); + lte_v2x_services_auth_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/v2x_subscription_data_1.c b/lib/sbi/openapi/model/v2x_subscription_data_1.c index 445467392..fa85f1517 100644 --- a/lib/sbi/openapi/model/v2x_subscription_data_1.c +++ b/lib/sbi/openapi/model/v2x_subscription_data_1.c @@ -24,20 +24,34 @@ OpenAPI_v2x_subscription_data_1_t *OpenAPI_v2x_subscription_data_1_create( void OpenAPI_v2x_subscription_data_1_free(OpenAPI_v2x_subscription_data_1_t *v2x_subscription_data_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == v2x_subscription_data_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_nr_v2x_auth_1_free(v2x_subscription_data_1->nr_v2x_services_auth); - OpenAPI_lte_v2x_auth_1_free(v2x_subscription_data_1->lte_v2x_services_auth); - ogs_free(v2x_subscription_data_1->nr_ue_pc5_ambr); - ogs_free(v2x_subscription_data_1->lte_pc5_ambr); + if (v2x_subscription_data_1->nr_v2x_services_auth) { + OpenAPI_nr_v2x_auth_1_free(v2x_subscription_data_1->nr_v2x_services_auth); + v2x_subscription_data_1->nr_v2x_services_auth = NULL; + } + if (v2x_subscription_data_1->lte_v2x_services_auth) { + OpenAPI_lte_v2x_auth_1_free(v2x_subscription_data_1->lte_v2x_services_auth); + v2x_subscription_data_1->lte_v2x_services_auth = NULL; + } + if (v2x_subscription_data_1->nr_ue_pc5_ambr) { + ogs_free(v2x_subscription_data_1->nr_ue_pc5_ambr); + v2x_subscription_data_1->nr_ue_pc5_ambr = NULL; + } + if (v2x_subscription_data_1->lte_pc5_ambr) { + ogs_free(v2x_subscription_data_1->lte_pc5_ambr); + v2x_subscription_data_1->lte_pc5_ambr = NULL; + } ogs_free(v2x_subscription_data_1); } cJSON *OpenAPI_v2x_subscription_data_1_convertToJSON(OpenAPI_v2x_subscription_data_1_t *v2x_subscription_data_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (v2x_subscription_data_1 == NULL) { ogs_error("OpenAPI_v2x_subscription_data_1_convertToJSON() failed [V2xSubscriptionData_1]"); @@ -92,33 +106,34 @@ end: OpenAPI_v2x_subscription_data_1_t *OpenAPI_v2x_subscription_data_1_parseFromJSON(cJSON *v2x_subscription_data_1JSON) { OpenAPI_v2x_subscription_data_1_t *v2x_subscription_data_1_local_var = NULL; - cJSON *nr_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_subscription_data_1JSON, "nrV2xServicesAuth"); - + OpenAPI_lnode_t *node = NULL; + cJSON *nr_v2x_services_auth = NULL; OpenAPI_nr_v2x_auth_1_t *nr_v2x_services_auth_local_nonprim = NULL; + cJSON *lte_v2x_services_auth = NULL; + OpenAPI_lte_v2x_auth_1_t *lte_v2x_services_auth_local_nonprim = NULL; + cJSON *nr_ue_pc5_ambr = NULL; + cJSON *lte_pc5_ambr = NULL; + nr_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_subscription_data_1JSON, "nrV2xServicesAuth"); if (nr_v2x_services_auth) { nr_v2x_services_auth_local_nonprim = OpenAPI_nr_v2x_auth_1_parseFromJSON(nr_v2x_services_auth); } - cJSON *lte_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_subscription_data_1JSON, "lteV2xServicesAuth"); - - OpenAPI_lte_v2x_auth_1_t *lte_v2x_services_auth_local_nonprim = NULL; + lte_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(v2x_subscription_data_1JSON, "lteV2xServicesAuth"); if (lte_v2x_services_auth) { lte_v2x_services_auth_local_nonprim = OpenAPI_lte_v2x_auth_1_parseFromJSON(lte_v2x_services_auth); } - cJSON *nr_ue_pc5_ambr = cJSON_GetObjectItemCaseSensitive(v2x_subscription_data_1JSON, "nrUePc5Ambr"); - + nr_ue_pc5_ambr = cJSON_GetObjectItemCaseSensitive(v2x_subscription_data_1JSON, "nrUePc5Ambr"); if (nr_ue_pc5_ambr) { - if (!cJSON_IsString(nr_ue_pc5_ambr)) { + if (!cJSON_IsString(nr_ue_pc5_ambr) && !cJSON_IsNull(nr_ue_pc5_ambr)) { ogs_error("OpenAPI_v2x_subscription_data_1_parseFromJSON() failed [nr_ue_pc5_ambr]"); goto end; } } - cJSON *lte_pc5_ambr = cJSON_GetObjectItemCaseSensitive(v2x_subscription_data_1JSON, "ltePc5Ambr"); - + lte_pc5_ambr = cJSON_GetObjectItemCaseSensitive(v2x_subscription_data_1JSON, "ltePc5Ambr"); if (lte_pc5_ambr) { - if (!cJSON_IsString(lte_pc5_ambr)) { + if (!cJSON_IsString(lte_pc5_ambr) && !cJSON_IsNull(lte_pc5_ambr)) { ogs_error("OpenAPI_v2x_subscription_data_1_parseFromJSON() failed [lte_pc5_ambr]"); goto end; } @@ -127,12 +142,20 @@ OpenAPI_v2x_subscription_data_1_t *OpenAPI_v2x_subscription_data_1_parseFromJSON v2x_subscription_data_1_local_var = OpenAPI_v2x_subscription_data_1_create ( nr_v2x_services_auth ? nr_v2x_services_auth_local_nonprim : NULL, lte_v2x_services_auth ? lte_v2x_services_auth_local_nonprim : NULL, - nr_ue_pc5_ambr ? ogs_strdup(nr_ue_pc5_ambr->valuestring) : NULL, - lte_pc5_ambr ? ogs_strdup(lte_pc5_ambr->valuestring) : NULL + nr_ue_pc5_ambr && !cJSON_IsNull(nr_ue_pc5_ambr) ? ogs_strdup(nr_ue_pc5_ambr->valuestring) : NULL, + lte_pc5_ambr && !cJSON_IsNull(lte_pc5_ambr) ? ogs_strdup(lte_pc5_ambr->valuestring) : NULL ); return v2x_subscription_data_1_local_var; end: + if (nr_v2x_services_auth_local_nonprim) { + OpenAPI_nr_v2x_auth_1_free(nr_v2x_services_auth_local_nonprim); + nr_v2x_services_auth_local_nonprim = NULL; + } + if (lte_v2x_services_auth_local_nonprim) { + OpenAPI_lte_v2x_auth_1_free(lte_v2x_services_auth_local_nonprim); + lte_v2x_services_auth_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/valid_time_period.c b/lib/sbi/openapi/model/valid_time_period.c index 6c6ddb924..acb54d033 100644 --- a/lib/sbi/openapi/model/valid_time_period.c +++ b/lib/sbi/openapi/model/valid_time_period.c @@ -20,18 +20,26 @@ OpenAPI_valid_time_period_t *OpenAPI_valid_time_period_create( void OpenAPI_valid_time_period_free(OpenAPI_valid_time_period_t *valid_time_period) { + OpenAPI_lnode_t *node = NULL; + if (NULL == valid_time_period) { return; } - OpenAPI_lnode_t *node; - ogs_free(valid_time_period->start_time); - ogs_free(valid_time_period->end_time); + if (valid_time_period->start_time) { + ogs_free(valid_time_period->start_time); + valid_time_period->start_time = NULL; + } + if (valid_time_period->end_time) { + ogs_free(valid_time_period->end_time); + valid_time_period->end_time = NULL; + } ogs_free(valid_time_period); } cJSON *OpenAPI_valid_time_period_convertToJSON(OpenAPI_valid_time_period_t *valid_time_period) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (valid_time_period == NULL) { ogs_error("OpenAPI_valid_time_period_convertToJSON() failed [ValidTimePeriod]"); @@ -60,27 +68,28 @@ end: OpenAPI_valid_time_period_t *OpenAPI_valid_time_period_parseFromJSON(cJSON *valid_time_periodJSON) { OpenAPI_valid_time_period_t *valid_time_period_local_var = NULL; - cJSON *start_time = cJSON_GetObjectItemCaseSensitive(valid_time_periodJSON, "startTime"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start_time = NULL; + cJSON *end_time = NULL; + start_time = cJSON_GetObjectItemCaseSensitive(valid_time_periodJSON, "startTime"); if (start_time) { - if (!cJSON_IsString(start_time)) { + if (!cJSON_IsString(start_time) && !cJSON_IsNull(start_time)) { ogs_error("OpenAPI_valid_time_period_parseFromJSON() failed [start_time]"); goto end; } } - cJSON *end_time = cJSON_GetObjectItemCaseSensitive(valid_time_periodJSON, "endTime"); - + end_time = cJSON_GetObjectItemCaseSensitive(valid_time_periodJSON, "endTime"); if (end_time) { - if (!cJSON_IsString(end_time)) { + if (!cJSON_IsString(end_time) && !cJSON_IsNull(end_time)) { ogs_error("OpenAPI_valid_time_period_parseFromJSON() failed [end_time]"); goto end; } } valid_time_period_local_var = OpenAPI_valid_time_period_create ( - start_time ? ogs_strdup(start_time->valuestring) : NULL, - end_time ? ogs_strdup(end_time->valuestring) : NULL + start_time && !cJSON_IsNull(start_time) ? ogs_strdup(start_time->valuestring) : NULL, + end_time && !cJSON_IsNull(end_time) ? ogs_strdup(end_time->valuestring) : NULL ); return valid_time_period_local_var; diff --git a/lib/sbi/openapi/model/valid_time_period_1.c b/lib/sbi/openapi/model/valid_time_period_1.c index b5a34922f..61e77cde6 100644 --- a/lib/sbi/openapi/model/valid_time_period_1.c +++ b/lib/sbi/openapi/model/valid_time_period_1.c @@ -20,18 +20,26 @@ OpenAPI_valid_time_period_1_t *OpenAPI_valid_time_period_1_create( void OpenAPI_valid_time_period_1_free(OpenAPI_valid_time_period_1_t *valid_time_period_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == valid_time_period_1) { return; } - OpenAPI_lnode_t *node; - ogs_free(valid_time_period_1->start_time); - ogs_free(valid_time_period_1->end_time); + if (valid_time_period_1->start_time) { + ogs_free(valid_time_period_1->start_time); + valid_time_period_1->start_time = NULL; + } + if (valid_time_period_1->end_time) { + ogs_free(valid_time_period_1->end_time); + valid_time_period_1->end_time = NULL; + } ogs_free(valid_time_period_1); } cJSON *OpenAPI_valid_time_period_1_convertToJSON(OpenAPI_valid_time_period_1_t *valid_time_period_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (valid_time_period_1 == NULL) { ogs_error("OpenAPI_valid_time_period_1_convertToJSON() failed [ValidTimePeriod_1]"); @@ -60,27 +68,28 @@ end: OpenAPI_valid_time_period_1_t *OpenAPI_valid_time_period_1_parseFromJSON(cJSON *valid_time_period_1JSON) { OpenAPI_valid_time_period_1_t *valid_time_period_1_local_var = NULL; - cJSON *start_time = cJSON_GetObjectItemCaseSensitive(valid_time_period_1JSON, "startTime"); - + OpenAPI_lnode_t *node = NULL; + cJSON *start_time = NULL; + cJSON *end_time = NULL; + start_time = cJSON_GetObjectItemCaseSensitive(valid_time_period_1JSON, "startTime"); if (start_time) { - if (!cJSON_IsString(start_time)) { + if (!cJSON_IsString(start_time) && !cJSON_IsNull(start_time)) { ogs_error("OpenAPI_valid_time_period_1_parseFromJSON() failed [start_time]"); goto end; } } - cJSON *end_time = cJSON_GetObjectItemCaseSensitive(valid_time_period_1JSON, "endTime"); - + end_time = cJSON_GetObjectItemCaseSensitive(valid_time_period_1JSON, "endTime"); if (end_time) { - if (!cJSON_IsString(end_time)) { + if (!cJSON_IsString(end_time) && !cJSON_IsNull(end_time)) { ogs_error("OpenAPI_valid_time_period_1_parseFromJSON() failed [end_time]"); goto end; } } valid_time_period_1_local_var = OpenAPI_valid_time_period_1_create ( - start_time ? ogs_strdup(start_time->valuestring) : NULL, - end_time ? ogs_strdup(end_time->valuestring) : NULL + start_time && !cJSON_IsNull(start_time) ? ogs_strdup(start_time->valuestring) : NULL, + end_time && !cJSON_IsNull(end_time) ? ogs_strdup(end_time->valuestring) : NULL ); return valid_time_period_1_local_var; diff --git a/lib/sbi/openapi/model/vendor_specific_feature.c b/lib/sbi/openapi/model/vendor_specific_feature.c index dda424f23..e55b6a957 100644 --- a/lib/sbi/openapi/model/vendor_specific_feature.c +++ b/lib/sbi/openapi/model/vendor_specific_feature.c @@ -20,18 +20,26 @@ OpenAPI_vendor_specific_feature_t *OpenAPI_vendor_specific_feature_create( void OpenAPI_vendor_specific_feature_free(OpenAPI_vendor_specific_feature_t *vendor_specific_feature) { + OpenAPI_lnode_t *node = NULL; + if (NULL == vendor_specific_feature) { return; } - OpenAPI_lnode_t *node; - ogs_free(vendor_specific_feature->feature_name); - ogs_free(vendor_specific_feature->feature_version); + if (vendor_specific_feature->feature_name) { + ogs_free(vendor_specific_feature->feature_name); + vendor_specific_feature->feature_name = NULL; + } + if (vendor_specific_feature->feature_version) { + ogs_free(vendor_specific_feature->feature_version); + vendor_specific_feature->feature_version = NULL; + } ogs_free(vendor_specific_feature); } cJSON *OpenAPI_vendor_specific_feature_convertToJSON(OpenAPI_vendor_specific_feature_t *vendor_specific_feature) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (vendor_specific_feature == NULL) { ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [VendorSpecificFeature]"); @@ -39,11 +47,19 @@ cJSON *OpenAPI_vendor_specific_feature_convertToJSON(OpenAPI_vendor_specific_fea } item = cJSON_CreateObject(); + if (!vendor_specific_feature->feature_name) { + ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [feature_name]"); + return NULL; + } if (cJSON_AddStringToObject(item, "featureName", vendor_specific_feature->feature_name) == NULL) { ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [feature_name]"); goto end; } + if (!vendor_specific_feature->feature_version) { + ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [feature_version]"); + return NULL; + } if (cJSON_AddStringToObject(item, "featureVersion", vendor_specific_feature->feature_version) == NULL) { ogs_error("OpenAPI_vendor_specific_feature_convertToJSON() failed [feature_version]"); goto end; @@ -56,23 +72,24 @@ end: OpenAPI_vendor_specific_feature_t *OpenAPI_vendor_specific_feature_parseFromJSON(cJSON *vendor_specific_featureJSON) { OpenAPI_vendor_specific_feature_t *vendor_specific_feature_local_var = NULL; - cJSON *feature_name = cJSON_GetObjectItemCaseSensitive(vendor_specific_featureJSON, "featureName"); + OpenAPI_lnode_t *node = NULL; + cJSON *feature_name = NULL; + cJSON *feature_version = NULL; + feature_name = cJSON_GetObjectItemCaseSensitive(vendor_specific_featureJSON, "featureName"); if (!feature_name) { ogs_error("OpenAPI_vendor_specific_feature_parseFromJSON() failed [feature_name]"); goto end; } - if (!cJSON_IsString(feature_name)) { ogs_error("OpenAPI_vendor_specific_feature_parseFromJSON() failed [feature_name]"); goto end; } - cJSON *feature_version = cJSON_GetObjectItemCaseSensitive(vendor_specific_featureJSON, "featureVersion"); + feature_version = cJSON_GetObjectItemCaseSensitive(vendor_specific_featureJSON, "featureVersion"); if (!feature_version) { ogs_error("OpenAPI_vendor_specific_feature_parseFromJSON() failed [feature_version]"); goto end; } - if (!cJSON_IsString(feature_version)) { ogs_error("OpenAPI_vendor_specific_feature_parseFromJSON() failed [feature_version]"); goto end; diff --git a/lib/sbi/openapi/model/vgmlc_address.c b/lib/sbi/openapi/model/vgmlc_address.c index 10bae8f62..eb988db21 100644 --- a/lib/sbi/openapi/model/vgmlc_address.c +++ b/lib/sbi/openapi/model/vgmlc_address.c @@ -22,19 +22,30 @@ OpenAPI_vgmlc_address_t *OpenAPI_vgmlc_address_create( void OpenAPI_vgmlc_address_free(OpenAPI_vgmlc_address_t *vgmlc_address) { + OpenAPI_lnode_t *node = NULL; + if (NULL == vgmlc_address) { return; } - OpenAPI_lnode_t *node; - ogs_free(vgmlc_address->vgmlc_address_ipv4); - ogs_free(vgmlc_address->vgmlc_address_ipv6); - ogs_free(vgmlc_address->vgmlc_fqdn); + if (vgmlc_address->vgmlc_address_ipv4) { + ogs_free(vgmlc_address->vgmlc_address_ipv4); + vgmlc_address->vgmlc_address_ipv4 = NULL; + } + if (vgmlc_address->vgmlc_address_ipv6) { + ogs_free(vgmlc_address->vgmlc_address_ipv6); + vgmlc_address->vgmlc_address_ipv6 = NULL; + } + if (vgmlc_address->vgmlc_fqdn) { + ogs_free(vgmlc_address->vgmlc_fqdn); + vgmlc_address->vgmlc_fqdn = NULL; + } ogs_free(vgmlc_address); } cJSON *OpenAPI_vgmlc_address_convertToJSON(OpenAPI_vgmlc_address_t *vgmlc_address) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (vgmlc_address == NULL) { ogs_error("OpenAPI_vgmlc_address_convertToJSON() failed [VgmlcAddress]"); @@ -70,37 +81,38 @@ end: OpenAPI_vgmlc_address_t *OpenAPI_vgmlc_address_parseFromJSON(cJSON *vgmlc_addressJSON) { OpenAPI_vgmlc_address_t *vgmlc_address_local_var = NULL; - cJSON *vgmlc_address_ipv4 = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcAddressIpv4"); - + OpenAPI_lnode_t *node = NULL; + cJSON *vgmlc_address_ipv4 = NULL; + cJSON *vgmlc_address_ipv6 = NULL; + cJSON *vgmlc_fqdn = NULL; + vgmlc_address_ipv4 = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcAddressIpv4"); if (vgmlc_address_ipv4) { - if (!cJSON_IsString(vgmlc_address_ipv4)) { + if (!cJSON_IsString(vgmlc_address_ipv4) && !cJSON_IsNull(vgmlc_address_ipv4)) { ogs_error("OpenAPI_vgmlc_address_parseFromJSON() failed [vgmlc_address_ipv4]"); goto end; } } - cJSON *vgmlc_address_ipv6 = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcAddressIpv6"); - + vgmlc_address_ipv6 = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcAddressIpv6"); if (vgmlc_address_ipv6) { - if (!cJSON_IsString(vgmlc_address_ipv6)) { + if (!cJSON_IsString(vgmlc_address_ipv6) && !cJSON_IsNull(vgmlc_address_ipv6)) { ogs_error("OpenAPI_vgmlc_address_parseFromJSON() failed [vgmlc_address_ipv6]"); goto end; } } - cJSON *vgmlc_fqdn = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcFqdn"); - + vgmlc_fqdn = cJSON_GetObjectItemCaseSensitive(vgmlc_addressJSON, "vgmlcFqdn"); if (vgmlc_fqdn) { - if (!cJSON_IsString(vgmlc_fqdn)) { + if (!cJSON_IsString(vgmlc_fqdn) && !cJSON_IsNull(vgmlc_fqdn)) { ogs_error("OpenAPI_vgmlc_address_parseFromJSON() failed [vgmlc_fqdn]"); goto end; } } vgmlc_address_local_var = OpenAPI_vgmlc_address_create ( - vgmlc_address_ipv4 ? ogs_strdup(vgmlc_address_ipv4->valuestring) : NULL, - vgmlc_address_ipv6 ? ogs_strdup(vgmlc_address_ipv6->valuestring) : NULL, - vgmlc_fqdn ? ogs_strdup(vgmlc_fqdn->valuestring) : NULL + vgmlc_address_ipv4 && !cJSON_IsNull(vgmlc_address_ipv4) ? ogs_strdup(vgmlc_address_ipv4->valuestring) : NULL, + vgmlc_address_ipv6 && !cJSON_IsNull(vgmlc_address_ipv6) ? ogs_strdup(vgmlc_address_ipv6->valuestring) : NULL, + vgmlc_fqdn && !cJSON_IsNull(vgmlc_fqdn) ? ogs_strdup(vgmlc_fqdn->valuestring) : NULL ); return vgmlc_address_local_var; diff --git a/lib/sbi/openapi/model/vn_group_data.c b/lib/sbi/openapi/model/vn_group_data.c index 477ce6f00..cce2a9597 100644 --- a/lib/sbi/openapi/model/vn_group_data.c +++ b/lib/sbi/openapi/model/vn_group_data.c @@ -5,7 +5,7 @@ #include "vn_group_data.h" OpenAPI_vn_group_data_t *OpenAPI_vn_group_data_create( - OpenAPI_pdu_session_types_1_t *pdu_session_types, + OpenAPI_pdu_session_types_t *pdu_session_types, char *dnn, OpenAPI_snssai_t *single_nssai, OpenAPI_list_t *app_descriptors @@ -24,23 +24,37 @@ OpenAPI_vn_group_data_t *OpenAPI_vn_group_data_create( void OpenAPI_vn_group_data_free(OpenAPI_vn_group_data_t *vn_group_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == vn_group_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_pdu_session_types_1_free(vn_group_data->pdu_session_types); - ogs_free(vn_group_data->dnn); - OpenAPI_snssai_free(vn_group_data->single_nssai); - OpenAPI_list_for_each(vn_group_data->app_descriptors, node) { - OpenAPI_app_descriptor_free(node->data); + if (vn_group_data->pdu_session_types) { + OpenAPI_pdu_session_types_free(vn_group_data->pdu_session_types); + vn_group_data->pdu_session_types = NULL; + } + if (vn_group_data->dnn) { + ogs_free(vn_group_data->dnn); + vn_group_data->dnn = NULL; + } + if (vn_group_data->single_nssai) { + OpenAPI_snssai_free(vn_group_data->single_nssai); + vn_group_data->single_nssai = NULL; + } + if (vn_group_data->app_descriptors) { + OpenAPI_list_for_each(vn_group_data->app_descriptors, node) { + OpenAPI_app_descriptor_free(node->data); + } + OpenAPI_list_free(vn_group_data->app_descriptors); + vn_group_data->app_descriptors = NULL; } - OpenAPI_list_free(vn_group_data->app_descriptors); ogs_free(vn_group_data); } cJSON *OpenAPI_vn_group_data_convertToJSON(OpenAPI_vn_group_data_t *vn_group_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (vn_group_data == NULL) { ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [VnGroupData]"); @@ -49,7 +63,7 @@ cJSON *OpenAPI_vn_group_data_convertToJSON(OpenAPI_vn_group_data_t *vn_group_dat item = cJSON_CreateObject(); if (vn_group_data->pdu_session_types) { - cJSON *pdu_session_types_local_JSON = OpenAPI_pdu_session_types_1_convertToJSON(vn_group_data->pdu_session_types); + cJSON *pdu_session_types_local_JSON = OpenAPI_pdu_session_types_convertToJSON(vn_group_data->pdu_session_types); if (pdu_session_types_local_JSON == NULL) { ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [pdu_session_types]"); goto end; @@ -87,17 +101,13 @@ cJSON *OpenAPI_vn_group_data_convertToJSON(OpenAPI_vn_group_data_t *vn_group_dat ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [app_descriptors]"); goto end; } - - OpenAPI_lnode_t *app_descriptors_node; - if (vn_group_data->app_descriptors) { - OpenAPI_list_for_each(vn_group_data->app_descriptors, app_descriptors_node) { - cJSON *itemLocal = OpenAPI_app_descriptor_convertToJSON(app_descriptors_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [app_descriptors]"); - goto end; - } - cJSON_AddItemToArray(app_descriptorsList, itemLocal); + OpenAPI_list_for_each(vn_group_data->app_descriptors, node) { + cJSON *itemLocal = OpenAPI_app_descriptor_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vn_group_data_convertToJSON() failed [app_descriptors]"); + goto end; } + cJSON_AddItemToArray(app_descriptorsList, itemLocal); } } @@ -108,67 +118,81 @@ end: OpenAPI_vn_group_data_t *OpenAPI_vn_group_data_parseFromJSON(cJSON *vn_group_dataJSON) { OpenAPI_vn_group_data_t *vn_group_data_local_var = NULL; - cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "pduSessionTypes"); - - OpenAPI_pdu_session_types_1_t *pdu_session_types_local_nonprim = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *pdu_session_types = NULL; + OpenAPI_pdu_session_types_t *pdu_session_types_local_nonprim = NULL; + cJSON *dnn = NULL; + cJSON *single_nssai = NULL; + OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + cJSON *app_descriptors = NULL; + OpenAPI_list_t *app_descriptorsList = NULL; + pdu_session_types = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "pduSessionTypes"); if (pdu_session_types) { - pdu_session_types_local_nonprim = OpenAPI_pdu_session_types_1_parseFromJSON(pdu_session_types); + pdu_session_types_local_nonprim = OpenAPI_pdu_session_types_parseFromJSON(pdu_session_types); } - cJSON *dnn = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "dnn"); - + dnn = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "dnn"); if (dnn) { - if (!cJSON_IsString(dnn)) { + if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) { ogs_error("OpenAPI_vn_group_data_parseFromJSON() failed [dnn]"); goto end; } } - cJSON *single_nssai = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "singleNssai"); - - OpenAPI_snssai_t *single_nssai_local_nonprim = NULL; + single_nssai = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "singleNssai"); if (single_nssai) { single_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(single_nssai); } - cJSON *app_descriptors = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "appDescriptors"); - - OpenAPI_list_t *app_descriptorsList; + app_descriptors = cJSON_GetObjectItemCaseSensitive(vn_group_dataJSON, "appDescriptors"); if (app_descriptors) { - cJSON *app_descriptors_local_nonprimitive; - if (!cJSON_IsArray(app_descriptors)){ - ogs_error("OpenAPI_vn_group_data_parseFromJSON() failed [app_descriptors]"); - goto end; - } - - app_descriptorsList = OpenAPI_list_create(); - - cJSON_ArrayForEach(app_descriptors_local_nonprimitive, app_descriptors ) { - if (!cJSON_IsObject(app_descriptors_local_nonprimitive)) { + cJSON *app_descriptors_local = NULL; + if (!cJSON_IsArray(app_descriptors)) { ogs_error("OpenAPI_vn_group_data_parseFromJSON() failed [app_descriptors]"); goto end; } - OpenAPI_app_descriptor_t *app_descriptorsItem = OpenAPI_app_descriptor_parseFromJSON(app_descriptors_local_nonprimitive); - if (!app_descriptorsItem) { - ogs_error("No app_descriptorsItem"); - OpenAPI_list_free(app_descriptorsList); - goto end; + app_descriptorsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(app_descriptors_local, app_descriptors) { + if (!cJSON_IsObject(app_descriptors_local)) { + ogs_error("OpenAPI_vn_group_data_parseFromJSON() failed [app_descriptors]"); + goto end; + } + OpenAPI_app_descriptor_t *app_descriptorsItem = OpenAPI_app_descriptor_parseFromJSON(app_descriptors_local); + if (!app_descriptorsItem) { + ogs_error("No app_descriptorsItem"); + OpenAPI_list_free(app_descriptorsList); + goto end; + } + OpenAPI_list_add(app_descriptorsList, app_descriptorsItem); } - - OpenAPI_list_add(app_descriptorsList, app_descriptorsItem); - } } vn_group_data_local_var = OpenAPI_vn_group_data_create ( pdu_session_types ? pdu_session_types_local_nonprim : NULL, - dnn ? ogs_strdup(dnn->valuestring) : NULL, + dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL, single_nssai ? single_nssai_local_nonprim : NULL, app_descriptors ? app_descriptorsList : NULL ); return vn_group_data_local_var; end: + if (pdu_session_types_local_nonprim) { + OpenAPI_pdu_session_types_free(pdu_session_types_local_nonprim); + pdu_session_types_local_nonprim = NULL; + } + if (single_nssai_local_nonprim) { + OpenAPI_snssai_free(single_nssai_local_nonprim); + single_nssai_local_nonprim = NULL; + } + if (app_descriptorsList) { + OpenAPI_list_for_each(app_descriptorsList, node) { + OpenAPI_app_descriptor_free(node->data); + } + OpenAPI_list_free(app_descriptorsList); + app_descriptorsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/vn_group_data.h b/lib/sbi/openapi/model/vn_group_data.h index 3ce425716..9880d1e51 100644 --- a/lib/sbi/openapi/model/vn_group_data.h +++ b/lib/sbi/openapi/model/vn_group_data.h @@ -13,7 +13,7 @@ #include "../include/keyValuePair.h" #include "../include/binary.h" #include "app_descriptor.h" -#include "pdu_session_types_1.h" +#include "pdu_session_types.h" #include "snssai.h" #ifdef __cplusplus @@ -22,14 +22,14 @@ extern "C" { typedef struct OpenAPI_vn_group_data_s OpenAPI_vn_group_data_t; typedef struct OpenAPI_vn_group_data_s { - struct OpenAPI_pdu_session_types_1_s *pdu_session_types; + struct OpenAPI_pdu_session_types_s *pdu_session_types; char *dnn; struct OpenAPI_snssai_s *single_nssai; OpenAPI_list_t *app_descriptors; } OpenAPI_vn_group_data_t; OpenAPI_vn_group_data_t *OpenAPI_vn_group_data_create( - OpenAPI_pdu_session_types_1_t *pdu_session_types, + OpenAPI_pdu_session_types_t *pdu_session_types, char *dnn, OpenAPI_snssai_t *single_nssai, OpenAPI_list_t *app_descriptors diff --git a/lib/sbi/openapi/model/volume_timed_report.c b/lib/sbi/openapi/model/volume_timed_report.c index c48881e44..6a70f463b 100644 --- a/lib/sbi/openapi/model/volume_timed_report.c +++ b/lib/sbi/openapi/model/volume_timed_report.c @@ -24,18 +24,26 @@ OpenAPI_volume_timed_report_t *OpenAPI_volume_timed_report_create( void OpenAPI_volume_timed_report_free(OpenAPI_volume_timed_report_t *volume_timed_report) { + OpenAPI_lnode_t *node = NULL; + if (NULL == volume_timed_report) { return; } - OpenAPI_lnode_t *node; - ogs_free(volume_timed_report->start_time_stamp); - ogs_free(volume_timed_report->end_time_stamp); + if (volume_timed_report->start_time_stamp) { + ogs_free(volume_timed_report->start_time_stamp); + volume_timed_report->start_time_stamp = NULL; + } + if (volume_timed_report->end_time_stamp) { + ogs_free(volume_timed_report->end_time_stamp); + volume_timed_report->end_time_stamp = NULL; + } ogs_free(volume_timed_report); } cJSON *OpenAPI_volume_timed_report_convertToJSON(OpenAPI_volume_timed_report_t *volume_timed_report) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (volume_timed_report == NULL) { ogs_error("OpenAPI_volume_timed_report_convertToJSON() failed [VolumeTimedReport]"); @@ -43,11 +51,19 @@ cJSON *OpenAPI_volume_timed_report_convertToJSON(OpenAPI_volume_timed_report_t * } item = cJSON_CreateObject(); + if (!volume_timed_report->start_time_stamp) { + ogs_error("OpenAPI_volume_timed_report_convertToJSON() failed [start_time_stamp]"); + return NULL; + } if (cJSON_AddStringToObject(item, "startTimeStamp", volume_timed_report->start_time_stamp) == NULL) { ogs_error("OpenAPI_volume_timed_report_convertToJSON() failed [start_time_stamp]"); goto end; } + if (!volume_timed_report->end_time_stamp) { + ogs_error("OpenAPI_volume_timed_report_convertToJSON() failed [end_time_stamp]"); + return NULL; + } if (cJSON_AddStringToObject(item, "endTimeStamp", volume_timed_report->end_time_stamp) == NULL) { ogs_error("OpenAPI_volume_timed_report_convertToJSON() failed [end_time_stamp]"); goto end; @@ -70,45 +86,46 @@ end: OpenAPI_volume_timed_report_t *OpenAPI_volume_timed_report_parseFromJSON(cJSON *volume_timed_reportJSON) { OpenAPI_volume_timed_report_t *volume_timed_report_local_var = NULL; - cJSON *start_time_stamp = cJSON_GetObjectItemCaseSensitive(volume_timed_reportJSON, "startTimeStamp"); + OpenAPI_lnode_t *node = NULL; + cJSON *start_time_stamp = NULL; + cJSON *end_time_stamp = NULL; + cJSON *downlink_volume = NULL; + cJSON *uplink_volume = NULL; + start_time_stamp = cJSON_GetObjectItemCaseSensitive(volume_timed_reportJSON, "startTimeStamp"); if (!start_time_stamp) { ogs_error("OpenAPI_volume_timed_report_parseFromJSON() failed [start_time_stamp]"); goto end; } - - if (!cJSON_IsString(start_time_stamp)) { + if (!cJSON_IsString(start_time_stamp) && !cJSON_IsNull(start_time_stamp)) { ogs_error("OpenAPI_volume_timed_report_parseFromJSON() failed [start_time_stamp]"); goto end; } - cJSON *end_time_stamp = cJSON_GetObjectItemCaseSensitive(volume_timed_reportJSON, "endTimeStamp"); + end_time_stamp = cJSON_GetObjectItemCaseSensitive(volume_timed_reportJSON, "endTimeStamp"); if (!end_time_stamp) { ogs_error("OpenAPI_volume_timed_report_parseFromJSON() failed [end_time_stamp]"); goto end; } - - if (!cJSON_IsString(end_time_stamp)) { + if (!cJSON_IsString(end_time_stamp) && !cJSON_IsNull(end_time_stamp)) { ogs_error("OpenAPI_volume_timed_report_parseFromJSON() failed [end_time_stamp]"); goto end; } - cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(volume_timed_reportJSON, "downlinkVolume"); + downlink_volume = cJSON_GetObjectItemCaseSensitive(volume_timed_reportJSON, "downlinkVolume"); if (!downlink_volume) { ogs_error("OpenAPI_volume_timed_report_parseFromJSON() failed [downlink_volume]"); goto end; } - if (!cJSON_IsNumber(downlink_volume)) { ogs_error("OpenAPI_volume_timed_report_parseFromJSON() failed [downlink_volume]"); goto end; } - cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(volume_timed_reportJSON, "uplinkVolume"); + uplink_volume = cJSON_GetObjectItemCaseSensitive(volume_timed_reportJSON, "uplinkVolume"); if (!uplink_volume) { ogs_error("OpenAPI_volume_timed_report_parseFromJSON() failed [uplink_volume]"); goto end; } - if (!cJSON_IsNumber(uplink_volume)) { ogs_error("OpenAPI_volume_timed_report_parseFromJSON() failed [uplink_volume]"); goto end; diff --git a/lib/sbi/openapi/model/vplmn_qos.c b/lib/sbi/openapi/model/vplmn_qos.c index 8e66f7ea6..023c0d435 100644 --- a/lib/sbi/openapi/model/vplmn_qos.c +++ b/lib/sbi/openapi/model/vplmn_qos.c @@ -32,22 +32,42 @@ OpenAPI_vplmn_qos_t *OpenAPI_vplmn_qos_create( void OpenAPI_vplmn_qos_free(OpenAPI_vplmn_qos_t *vplmn_qos) { + OpenAPI_lnode_t *node = NULL; + if (NULL == vplmn_qos) { return; } - OpenAPI_lnode_t *node; - OpenAPI_arp_free(vplmn_qos->arp); - OpenAPI_ambr_free(vplmn_qos->session_ambr); - ogs_free(vplmn_qos->max_fbr_dl); - ogs_free(vplmn_qos->max_fbr_ul); - ogs_free(vplmn_qos->gua_fbr_dl); - ogs_free(vplmn_qos->gua_fbr_ul); + if (vplmn_qos->arp) { + OpenAPI_arp_free(vplmn_qos->arp); + vplmn_qos->arp = NULL; + } + if (vplmn_qos->session_ambr) { + OpenAPI_ambr_free(vplmn_qos->session_ambr); + vplmn_qos->session_ambr = NULL; + } + if (vplmn_qos->max_fbr_dl) { + ogs_free(vplmn_qos->max_fbr_dl); + vplmn_qos->max_fbr_dl = NULL; + } + if (vplmn_qos->max_fbr_ul) { + ogs_free(vplmn_qos->max_fbr_ul); + vplmn_qos->max_fbr_ul = NULL; + } + if (vplmn_qos->gua_fbr_dl) { + ogs_free(vplmn_qos->gua_fbr_dl); + vplmn_qos->gua_fbr_dl = NULL; + } + if (vplmn_qos->gua_fbr_ul) { + ogs_free(vplmn_qos->gua_fbr_ul); + vplmn_qos->gua_fbr_ul = NULL; + } ogs_free(vplmn_qos); } cJSON *OpenAPI_vplmn_qos_convertToJSON(OpenAPI_vplmn_qos_t *vplmn_qos) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (vplmn_qos == NULL) { ogs_error("OpenAPI_vplmn_qos_convertToJSON() failed [VplmnQos]"); @@ -123,8 +143,17 @@ end: OpenAPI_vplmn_qos_t *OpenAPI_vplmn_qos_parseFromJSON(cJSON *vplmn_qosJSON) { OpenAPI_vplmn_qos_t *vplmn_qos_local_var = NULL; - cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "5qi"); - + OpenAPI_lnode_t *node = NULL; + cJSON *_5qi = NULL; + cJSON *arp = NULL; + OpenAPI_arp_t *arp_local_nonprim = NULL; + cJSON *session_ambr = NULL; + OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + cJSON *max_fbr_dl = NULL; + cJSON *max_fbr_ul = NULL; + cJSON *gua_fbr_dl = NULL; + cJSON *gua_fbr_ul = NULL; + _5qi = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "5qi"); if (_5qi) { if (!cJSON_IsNumber(_5qi)) { ogs_error("OpenAPI_vplmn_qos_parseFromJSON() failed [_5qi]"); @@ -132,51 +161,43 @@ OpenAPI_vplmn_qos_t *OpenAPI_vplmn_qos_parseFromJSON(cJSON *vplmn_qosJSON) } } - cJSON *arp = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "arp"); - - OpenAPI_arp_t *arp_local_nonprim = NULL; + arp = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "arp"); if (arp) { arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp); } - cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "sessionAmbr"); - - OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + session_ambr = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "sessionAmbr"); if (session_ambr) { session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr); } - cJSON *max_fbr_dl = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "maxFbrDl"); - + max_fbr_dl = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "maxFbrDl"); if (max_fbr_dl) { - if (!cJSON_IsString(max_fbr_dl)) { + if (!cJSON_IsString(max_fbr_dl) && !cJSON_IsNull(max_fbr_dl)) { ogs_error("OpenAPI_vplmn_qos_parseFromJSON() failed [max_fbr_dl]"); goto end; } } - cJSON *max_fbr_ul = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "maxFbrUl"); - + max_fbr_ul = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "maxFbrUl"); if (max_fbr_ul) { - if (!cJSON_IsString(max_fbr_ul)) { + if (!cJSON_IsString(max_fbr_ul) && !cJSON_IsNull(max_fbr_ul)) { ogs_error("OpenAPI_vplmn_qos_parseFromJSON() failed [max_fbr_ul]"); goto end; } } - cJSON *gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "guaFbrDl"); - + gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "guaFbrDl"); if (gua_fbr_dl) { - if (!cJSON_IsString(gua_fbr_dl)) { + if (!cJSON_IsString(gua_fbr_dl) && !cJSON_IsNull(gua_fbr_dl)) { ogs_error("OpenAPI_vplmn_qos_parseFromJSON() failed [gua_fbr_dl]"); goto end; } } - cJSON *gua_fbr_ul = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "guaFbrUl"); - + gua_fbr_ul = cJSON_GetObjectItemCaseSensitive(vplmn_qosJSON, "guaFbrUl"); if (gua_fbr_ul) { - if (!cJSON_IsString(gua_fbr_ul)) { + if (!cJSON_IsString(gua_fbr_ul) && !cJSON_IsNull(gua_fbr_ul)) { ogs_error("OpenAPI_vplmn_qos_parseFromJSON() failed [gua_fbr_ul]"); goto end; } @@ -187,14 +208,22 @@ OpenAPI_vplmn_qos_t *OpenAPI_vplmn_qos_parseFromJSON(cJSON *vplmn_qosJSON) _5qi ? _5qi->valuedouble : 0, arp ? arp_local_nonprim : NULL, session_ambr ? session_ambr_local_nonprim : NULL, - max_fbr_dl ? ogs_strdup(max_fbr_dl->valuestring) : NULL, - max_fbr_ul ? ogs_strdup(max_fbr_ul->valuestring) : NULL, - gua_fbr_dl ? ogs_strdup(gua_fbr_dl->valuestring) : NULL, - gua_fbr_ul ? ogs_strdup(gua_fbr_ul->valuestring) : NULL + max_fbr_dl && !cJSON_IsNull(max_fbr_dl) ? ogs_strdup(max_fbr_dl->valuestring) : NULL, + max_fbr_ul && !cJSON_IsNull(max_fbr_ul) ? ogs_strdup(max_fbr_ul->valuestring) : NULL, + gua_fbr_dl && !cJSON_IsNull(gua_fbr_dl) ? ogs_strdup(gua_fbr_dl->valuestring) : NULL, + gua_fbr_ul && !cJSON_IsNull(gua_fbr_ul) ? ogs_strdup(gua_fbr_ul->valuestring) : NULL ); return vplmn_qos_local_var; end: + if (arp_local_nonprim) { + OpenAPI_arp_free(arp_local_nonprim); + arp_local_nonprim = NULL; + } + if (session_ambr_local_nonprim) { + OpenAPI_ambr_free(session_ambr_local_nonprim); + session_ambr_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/vsmf_update_data.c b/lib/sbi/openapi/model/vsmf_update_data.c index 32fa792dd..a9f7ac247 100644 --- a/lib/sbi/openapi/model/vsmf_update_data.c +++ b/lib/sbi/openapi/model/vsmf_update_data.c @@ -76,54 +76,107 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_create( void OpenAPI_vsmf_update_data_free(OpenAPI_vsmf_update_data_t *vsmf_update_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == vsmf_update_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_ambr_free(vsmf_update_data->session_ambr); - OpenAPI_list_for_each(vsmf_update_data->qos_flows_add_mod_request_list, node) { - OpenAPI_qos_flow_add_modify_request_item_free(node->data); + if (vsmf_update_data->session_ambr) { + OpenAPI_ambr_free(vsmf_update_data->session_ambr); + vsmf_update_data->session_ambr = NULL; } - OpenAPI_list_free(vsmf_update_data->qos_flows_add_mod_request_list); - OpenAPI_list_for_each(vsmf_update_data->qos_flows_rel_request_list, node) { - OpenAPI_qos_flow_release_request_item_free(node->data); + if (vsmf_update_data->qos_flows_add_mod_request_list) { + OpenAPI_list_for_each(vsmf_update_data->qos_flows_add_mod_request_list, node) { + OpenAPI_qos_flow_add_modify_request_item_free(node->data); + } + OpenAPI_list_free(vsmf_update_data->qos_flows_add_mod_request_list); + vsmf_update_data->qos_flows_add_mod_request_list = NULL; } - OpenAPI_list_free(vsmf_update_data->qos_flows_rel_request_list); - OpenAPI_list_for_each(vsmf_update_data->eps_bearer_info, node) { - OpenAPI_eps_bearer_info_free(node->data); + if (vsmf_update_data->qos_flows_rel_request_list) { + OpenAPI_list_for_each(vsmf_update_data->qos_flows_rel_request_list, node) { + OpenAPI_qos_flow_release_request_item_free(node->data); + } + OpenAPI_list_free(vsmf_update_data->qos_flows_rel_request_list); + vsmf_update_data->qos_flows_rel_request_list = NULL; } - OpenAPI_list_free(vsmf_update_data->eps_bearer_info); - OpenAPI_list_for_each(vsmf_update_data->assign_ebi_list, node) { - OpenAPI_arp_free(node->data); + if (vsmf_update_data->eps_bearer_info) { + OpenAPI_list_for_each(vsmf_update_data->eps_bearer_info, node) { + OpenAPI_eps_bearer_info_free(node->data); + } + OpenAPI_list_free(vsmf_update_data->eps_bearer_info); + vsmf_update_data->eps_bearer_info = NULL; } - OpenAPI_list_free(vsmf_update_data->assign_ebi_list); - OpenAPI_list_for_each(vsmf_update_data->revoke_ebi_list, node) { - ogs_free(node->data); + if (vsmf_update_data->assign_ebi_list) { + OpenAPI_list_for_each(vsmf_update_data->assign_ebi_list, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(vsmf_update_data->assign_ebi_list); + vsmf_update_data->assign_ebi_list = NULL; } - OpenAPI_list_free(vsmf_update_data->revoke_ebi_list); - OpenAPI_list_for_each(vsmf_update_data->modified_ebi_list, node) { - OpenAPI_ebi_arp_mapping_free(node->data); + if (vsmf_update_data->revoke_ebi_list) { + OpenAPI_list_for_each(vsmf_update_data->revoke_ebi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(vsmf_update_data->revoke_ebi_list); + vsmf_update_data->revoke_ebi_list = NULL; } - OpenAPI_list_free(vsmf_update_data->modified_ebi_list); - OpenAPI_ref_to_binary_data_free(vsmf_update_data->n1_sm_info_to_ue); - ogs_free(vsmf_update_data->hsmf_pdu_session_uri); - ogs_free(vsmf_update_data->supported_features); - ogs_free(vsmf_update_data->n1sm_cause); - OpenAPI_tunnel_info_free(vsmf_update_data->additional_cn_tunnel_info); - OpenAPI_list_for_each(vsmf_update_data->dnai_list, node) { - ogs_free(node->data); + if (vsmf_update_data->modified_ebi_list) { + OpenAPI_list_for_each(vsmf_update_data->modified_ebi_list, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(vsmf_update_data->modified_ebi_list); + vsmf_update_data->modified_ebi_list = NULL; + } + if (vsmf_update_data->n1_sm_info_to_ue) { + OpenAPI_ref_to_binary_data_free(vsmf_update_data->n1_sm_info_to_ue); + vsmf_update_data->n1_sm_info_to_ue = NULL; + } + if (vsmf_update_data->hsmf_pdu_session_uri) { + ogs_free(vsmf_update_data->hsmf_pdu_session_uri); + vsmf_update_data->hsmf_pdu_session_uri = NULL; + } + if (vsmf_update_data->supported_features) { + ogs_free(vsmf_update_data->supported_features); + vsmf_update_data->supported_features = NULL; + } + if (vsmf_update_data->n1sm_cause) { + ogs_free(vsmf_update_data->n1sm_cause); + vsmf_update_data->n1sm_cause = NULL; + } + if (vsmf_update_data->additional_cn_tunnel_info) { + OpenAPI_tunnel_info_free(vsmf_update_data->additional_cn_tunnel_info); + vsmf_update_data->additional_cn_tunnel_info = NULL; + } + if (vsmf_update_data->dnai_list) { + OpenAPI_list_for_each(vsmf_update_data->dnai_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(vsmf_update_data->dnai_list); + vsmf_update_data->dnai_list = NULL; + } + if (vsmf_update_data->n4_info) { + OpenAPI_n4_information_free(vsmf_update_data->n4_info); + vsmf_update_data->n4_info = NULL; + } + if (vsmf_update_data->n4_info_ext1) { + OpenAPI_n4_information_free(vsmf_update_data->n4_info_ext1); + vsmf_update_data->n4_info_ext1 = NULL; + } + if (vsmf_update_data->n4_info_ext2) { + OpenAPI_n4_information_free(vsmf_update_data->n4_info_ext2); + vsmf_update_data->n4_info_ext2 = NULL; + } + if (vsmf_update_data->qos_monitoring_info) { + OpenAPI_qos_monitoring_info_free(vsmf_update_data->qos_monitoring_info); + vsmf_update_data->qos_monitoring_info = NULL; } - OpenAPI_list_free(vsmf_update_data->dnai_list); - OpenAPI_n4_information_free(vsmf_update_data->n4_info); - OpenAPI_n4_information_free(vsmf_update_data->n4_info_ext1); - OpenAPI_n4_information_free(vsmf_update_data->n4_info_ext2); - OpenAPI_qos_monitoring_info_free(vsmf_update_data->qos_monitoring_info); ogs_free(vsmf_update_data); } cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_update_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (vsmf_update_data == NULL) { ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [VsmfUpdateData]"); @@ -131,6 +184,10 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u } item = cJSON_CreateObject(); + if (vsmf_update_data->request_indication == OpenAPI_request_indication_NULL) { + ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [request_indication]"); + return NULL; + } if (cJSON_AddStringToObject(item, "requestIndication", OpenAPI_request_indication_ToString(vsmf_update_data->request_indication)) == NULL) { ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [request_indication]"); goto end; @@ -155,17 +212,13 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [qos_flows_add_mod_request_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_add_mod_request_list_node; - if (vsmf_update_data->qos_flows_add_mod_request_list) { - OpenAPI_list_for_each(vsmf_update_data->qos_flows_add_mod_request_list, qos_flows_add_mod_request_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_add_modify_request_item_convertToJSON(qos_flows_add_mod_request_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [qos_flows_add_mod_request_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_add_mod_request_listList, itemLocal); + OpenAPI_list_for_each(vsmf_update_data->qos_flows_add_mod_request_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_add_modify_request_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [qos_flows_add_mod_request_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_add_mod_request_listList, itemLocal); } } @@ -175,17 +228,13 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [qos_flows_rel_request_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_rel_request_list_node; - if (vsmf_update_data->qos_flows_rel_request_list) { - OpenAPI_list_for_each(vsmf_update_data->qos_flows_rel_request_list, qos_flows_rel_request_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_release_request_item_convertToJSON(qos_flows_rel_request_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [qos_flows_rel_request_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_rel_request_listList, itemLocal); + OpenAPI_list_for_each(vsmf_update_data->qos_flows_rel_request_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_release_request_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [qos_flows_rel_request_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_rel_request_listList, itemLocal); } } @@ -195,17 +244,13 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [eps_bearer_info]"); goto end; } - - OpenAPI_lnode_t *eps_bearer_info_node; - if (vsmf_update_data->eps_bearer_info) { - OpenAPI_list_for_each(vsmf_update_data->eps_bearer_info, eps_bearer_info_node) { - cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(eps_bearer_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [eps_bearer_info]"); - goto end; - } - cJSON_AddItemToArray(eps_bearer_infoList, itemLocal); + OpenAPI_list_for_each(vsmf_update_data->eps_bearer_info, node) { + cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [eps_bearer_info]"); + goto end; } + cJSON_AddItemToArray(eps_bearer_infoList, itemLocal); } } @@ -215,34 +260,28 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [assign_ebi_list]"); goto end; } - - OpenAPI_lnode_t *assign_ebi_list_node; - if (vsmf_update_data->assign_ebi_list) { - OpenAPI_list_for_each(vsmf_update_data->assign_ebi_list, assign_ebi_list_node) { - cJSON *itemLocal = OpenAPI_arp_convertToJSON(assign_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [assign_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(assign_ebi_listList, itemLocal); + OpenAPI_list_for_each(vsmf_update_data->assign_ebi_list, node) { + cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [assign_ebi_list]"); + goto end; } + cJSON_AddItemToArray(assign_ebi_listList, itemLocal); } } if (vsmf_update_data->revoke_ebi_list) { - cJSON *revoke_ebi_list = cJSON_AddArrayToObject(item, "revokeEbiList"); - if (revoke_ebi_list == NULL) { + cJSON *revoke_ebi_listList = cJSON_AddArrayToObject(item, "revokeEbiList"); + if (revoke_ebi_listList == NULL) { ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [revoke_ebi_list]"); goto end; } - - OpenAPI_lnode_t *revoke_ebi_list_node; - OpenAPI_list_for_each(vsmf_update_data->revoke_ebi_list, revoke_ebi_list_node) { - if (cJSON_AddNumberToObject(revoke_ebi_list, "", *(double *)revoke_ebi_list_node->data) == NULL) { - ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [revoke_ebi_list]"); - goto end; + OpenAPI_list_for_each(vsmf_update_data->revoke_ebi_list, node) { + if (cJSON_AddNumberToObject(revoke_ebi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [revoke_ebi_list]"); + goto end; + } } - } } if (vsmf_update_data->modified_ebi_list) { @@ -251,17 +290,13 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [modified_ebi_list]"); goto end; } - - OpenAPI_lnode_t *modified_ebi_list_node; - if (vsmf_update_data->modified_ebi_list) { - OpenAPI_list_for_each(vsmf_update_data->modified_ebi_list, modified_ebi_list_node) { - cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(modified_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [modified_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(modified_ebi_listList, itemLocal); + OpenAPI_list_for_each(vsmf_update_data->modified_ebi_list, node) { + cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [modified_ebi_list]"); + goto end; } + cJSON_AddItemToArray(modified_ebi_listList, itemLocal); } } @@ -306,7 +341,7 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u } } - if (vsmf_update_data->cause) { + if (vsmf_update_data->cause != OpenAPI_cause_NULL) { if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(vsmf_update_data->cause)) == NULL) { ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [cause]"); goto end; @@ -327,7 +362,7 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u } } - if (vsmf_update_data->ma_release_ind) { + if (vsmf_update_data->ma_release_ind != OpenAPI_ma_release_indication_NULL) { if (cJSON_AddStringToObject(item, "maReleaseInd", OpenAPI_ma_release_indication_ToString(vsmf_update_data->ma_release_ind)) == NULL) { ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [ma_release_ind]"); goto end; @@ -355,19 +390,17 @@ cJSON *OpenAPI_vsmf_update_data_convertToJSON(OpenAPI_vsmf_update_data_t *vsmf_u } if (vsmf_update_data->dnai_list) { - cJSON *dnai_list = cJSON_AddArrayToObject(item, "dnaiList"); - if (dnai_list == NULL) { + cJSON *dnai_listList = cJSON_AddArrayToObject(item, "dnaiList"); + if (dnai_listList == NULL) { ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [dnai_list]"); goto end; } - - OpenAPI_lnode_t *dnai_list_node; - OpenAPI_list_for_each(vsmf_update_data->dnai_list, dnai_list_node) { - if (cJSON_AddStringToObject(dnai_list, "", (char*)dnai_list_node->data) == NULL) { - ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [dnai_list]"); - goto end; + OpenAPI_list_for_each(vsmf_update_data->dnai_list, node) { + if (cJSON_AddStringToObject(dnai_listList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_vsmf_update_data_convertToJSON() failed [dnai_list]"); + goto end; + } } - } } if (vsmf_update_data->n4_info) { @@ -436,193 +469,218 @@ end: OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_update_dataJSON) { OpenAPI_vsmf_update_data_t *vsmf_update_data_local_var = NULL; - cJSON *request_indication = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "requestIndication"); + OpenAPI_lnode_t *node = NULL; + cJSON *request_indication = NULL; + OpenAPI_request_indication_e request_indicationVariable = 0; + cJSON *session_ambr = NULL; + OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + cJSON *qos_flows_add_mod_request_list = NULL; + OpenAPI_list_t *qos_flows_add_mod_request_listList = NULL; + cJSON *qos_flows_rel_request_list = NULL; + OpenAPI_list_t *qos_flows_rel_request_listList = NULL; + cJSON *eps_bearer_info = NULL; + OpenAPI_list_t *eps_bearer_infoList = NULL; + cJSON *assign_ebi_list = NULL; + OpenAPI_list_t *assign_ebi_listList = NULL; + cJSON *revoke_ebi_list = NULL; + OpenAPI_list_t *revoke_ebi_listList = NULL; + cJSON *modified_ebi_list = NULL; + OpenAPI_list_t *modified_ebi_listList = NULL; + cJSON *pti = NULL; + cJSON *n1_sm_info_to_ue = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + cJSON *always_on_granted = NULL; + cJSON *hsmf_pdu_session_uri = NULL; + cJSON *supported_features = NULL; + cJSON *cause = NULL; + OpenAPI_cause_e causeVariable = 0; + cJSON *n1sm_cause = NULL; + cJSON *back_off_timer = NULL; + cJSON *ma_release_ind = NULL; + OpenAPI_ma_release_indication_e ma_release_indVariable = 0; + cJSON *ma_accepted_ind = NULL; + cJSON *additional_cn_tunnel_info = NULL; + OpenAPI_tunnel_info_t *additional_cn_tunnel_info_local_nonprim = NULL; + cJSON *dnai_list = NULL; + OpenAPI_list_t *dnai_listList = NULL; + cJSON *n4_info = NULL; + OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + cJSON *n4_info_ext1 = NULL; + OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + cJSON *n4_info_ext2 = NULL; + OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + cJSON *small_data_rate_control_enabled = NULL; + cJSON *qos_monitoring_info = NULL; + OpenAPI_qos_monitoring_info_t *qos_monitoring_info_local_nonprim = NULL; + request_indication = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "requestIndication"); if (!request_indication) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [request_indication]"); goto end; } - - OpenAPI_request_indication_e request_indicationVariable; if (!cJSON_IsString(request_indication)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [request_indication]"); goto end; } request_indicationVariable = OpenAPI_request_indication_FromString(request_indication->valuestring); - cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "sessionAmbr"); - - OpenAPI_ambr_t *session_ambr_local_nonprim = NULL; + session_ambr = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "sessionAmbr"); if (session_ambr) { session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr); } - cJSON *qos_flows_add_mod_request_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "qosFlowsAddModRequestList"); - - OpenAPI_list_t *qos_flows_add_mod_request_listList; + qos_flows_add_mod_request_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "qosFlowsAddModRequestList"); if (qos_flows_add_mod_request_list) { - cJSON *qos_flows_add_mod_request_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_add_mod_request_list)){ - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [qos_flows_add_mod_request_list]"); - goto end; - } - - qos_flows_add_mod_request_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_add_mod_request_list_local_nonprimitive, qos_flows_add_mod_request_list ) { - if (!cJSON_IsObject(qos_flows_add_mod_request_list_local_nonprimitive)) { + cJSON *qos_flows_add_mod_request_list_local = NULL; + if (!cJSON_IsArray(qos_flows_add_mod_request_list)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [qos_flows_add_mod_request_list]"); goto end; } - OpenAPI_qos_flow_add_modify_request_item_t *qos_flows_add_mod_request_listItem = OpenAPI_qos_flow_add_modify_request_item_parseFromJSON(qos_flows_add_mod_request_list_local_nonprimitive); - if (!qos_flows_add_mod_request_listItem) { - ogs_error("No qos_flows_add_mod_request_listItem"); - OpenAPI_list_free(qos_flows_add_mod_request_listList); - goto end; + qos_flows_add_mod_request_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_add_mod_request_list_local, qos_flows_add_mod_request_list) { + if (!cJSON_IsObject(qos_flows_add_mod_request_list_local)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [qos_flows_add_mod_request_list]"); + goto end; + } + OpenAPI_qos_flow_add_modify_request_item_t *qos_flows_add_mod_request_listItem = OpenAPI_qos_flow_add_modify_request_item_parseFromJSON(qos_flows_add_mod_request_list_local); + if (!qos_flows_add_mod_request_listItem) { + ogs_error("No qos_flows_add_mod_request_listItem"); + OpenAPI_list_free(qos_flows_add_mod_request_listList); + goto end; + } + OpenAPI_list_add(qos_flows_add_mod_request_listList, qos_flows_add_mod_request_listItem); } - - OpenAPI_list_add(qos_flows_add_mod_request_listList, qos_flows_add_mod_request_listItem); - } } - cJSON *qos_flows_rel_request_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "qosFlowsRelRequestList"); - - OpenAPI_list_t *qos_flows_rel_request_listList; + qos_flows_rel_request_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "qosFlowsRelRequestList"); if (qos_flows_rel_request_list) { - cJSON *qos_flows_rel_request_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_rel_request_list)){ - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [qos_flows_rel_request_list]"); - goto end; - } - - qos_flows_rel_request_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_rel_request_list_local_nonprimitive, qos_flows_rel_request_list ) { - if (!cJSON_IsObject(qos_flows_rel_request_list_local_nonprimitive)) { + cJSON *qos_flows_rel_request_list_local = NULL; + if (!cJSON_IsArray(qos_flows_rel_request_list)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [qos_flows_rel_request_list]"); goto end; } - OpenAPI_qos_flow_release_request_item_t *qos_flows_rel_request_listItem = OpenAPI_qos_flow_release_request_item_parseFromJSON(qos_flows_rel_request_list_local_nonprimitive); - if (!qos_flows_rel_request_listItem) { - ogs_error("No qos_flows_rel_request_listItem"); - OpenAPI_list_free(qos_flows_rel_request_listList); - goto end; + qos_flows_rel_request_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_rel_request_list_local, qos_flows_rel_request_list) { + if (!cJSON_IsObject(qos_flows_rel_request_list_local)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [qos_flows_rel_request_list]"); + goto end; + } + OpenAPI_qos_flow_release_request_item_t *qos_flows_rel_request_listItem = OpenAPI_qos_flow_release_request_item_parseFromJSON(qos_flows_rel_request_list_local); + if (!qos_flows_rel_request_listItem) { + ogs_error("No qos_flows_rel_request_listItem"); + OpenAPI_list_free(qos_flows_rel_request_listList); + goto end; + } + OpenAPI_list_add(qos_flows_rel_request_listList, qos_flows_rel_request_listItem); } - - OpenAPI_list_add(qos_flows_rel_request_listList, qos_flows_rel_request_listItem); - } } - cJSON *eps_bearer_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "epsBearerInfo"); - - OpenAPI_list_t *eps_bearer_infoList; + eps_bearer_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "epsBearerInfo"); if (eps_bearer_info) { - cJSON *eps_bearer_info_local_nonprimitive; - if (!cJSON_IsArray(eps_bearer_info)){ - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [eps_bearer_info]"); - goto end; - } - - eps_bearer_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(eps_bearer_info_local_nonprimitive, eps_bearer_info ) { - if (!cJSON_IsObject(eps_bearer_info_local_nonprimitive)) { + cJSON *eps_bearer_info_local = NULL; + if (!cJSON_IsArray(eps_bearer_info)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [eps_bearer_info]"); goto end; } - OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local_nonprimitive); - if (!eps_bearer_infoItem) { - ogs_error("No eps_bearer_infoItem"); - OpenAPI_list_free(eps_bearer_infoList); - goto end; + eps_bearer_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(eps_bearer_info_local, eps_bearer_info) { + if (!cJSON_IsObject(eps_bearer_info_local)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [eps_bearer_info]"); + goto end; + } + OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local); + if (!eps_bearer_infoItem) { + ogs_error("No eps_bearer_infoItem"); + OpenAPI_list_free(eps_bearer_infoList); + goto end; + } + OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem); } - - OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem); - } } - cJSON *assign_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "assignEbiList"); - - OpenAPI_list_t *assign_ebi_listList; + assign_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "assignEbiList"); if (assign_ebi_list) { - cJSON *assign_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(assign_ebi_list)){ - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [assign_ebi_list]"); - goto end; - } - - assign_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(assign_ebi_list_local_nonprimitive, assign_ebi_list ) { - if (!cJSON_IsObject(assign_ebi_list_local_nonprimitive)) { + cJSON *assign_ebi_list_local = NULL; + if (!cJSON_IsArray(assign_ebi_list)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [assign_ebi_list]"); goto end; } - OpenAPI_arp_t *assign_ebi_listItem = OpenAPI_arp_parseFromJSON(assign_ebi_list_local_nonprimitive); - if (!assign_ebi_listItem) { - ogs_error("No assign_ebi_listItem"); - OpenAPI_list_free(assign_ebi_listList); + assign_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(assign_ebi_list_local, assign_ebi_list) { + if (!cJSON_IsObject(assign_ebi_list_local)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [assign_ebi_list]"); + goto end; + } + OpenAPI_arp_t *assign_ebi_listItem = OpenAPI_arp_parseFromJSON(assign_ebi_list_local); + if (!assign_ebi_listItem) { + ogs_error("No assign_ebi_listItem"); + OpenAPI_list_free(assign_ebi_listList); + goto end; + } + OpenAPI_list_add(assign_ebi_listList, assign_ebi_listItem); + } + } + + revoke_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "revokeEbiList"); + if (revoke_ebi_list) { + cJSON *revoke_ebi_list_local = NULL; + if (!cJSON_IsArray(revoke_ebi_list)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); goto end; } - OpenAPI_list_add(assign_ebi_listList, assign_ebi_listItem); - } + revoke_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(revoke_ebi_list_local, revoke_ebi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(revoke_ebi_list_local)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); + goto end; + } + *localDouble = revoke_ebi_list_local->valuedouble; + OpenAPI_list_add(revoke_ebi_listList, localDouble); + } } - cJSON *revoke_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "revokeEbiList"); - - OpenAPI_list_t *revoke_ebi_listList; - if (revoke_ebi_list) { - cJSON *revoke_ebi_list_local; - if (!cJSON_IsArray(revoke_ebi_list)) { - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); - goto end; - } - revoke_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(revoke_ebi_list_local, revoke_ebi_list) { - if (!cJSON_IsNumber(revoke_ebi_list_local)) { - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [revoke_ebi_list]"); - goto end; - } - OpenAPI_list_add(revoke_ebi_listList, &revoke_ebi_list_local->valuedouble); - } - } - - cJSON *modified_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "modifiedEbiList"); - - OpenAPI_list_t *modified_ebi_listList; + modified_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "modifiedEbiList"); if (modified_ebi_list) { - cJSON *modified_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(modified_ebi_list)){ - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [modified_ebi_list]"); - goto end; - } - - modified_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(modified_ebi_list_local_nonprimitive, modified_ebi_list ) { - if (!cJSON_IsObject(modified_ebi_list_local_nonprimitive)) { + cJSON *modified_ebi_list_local = NULL; + if (!cJSON_IsArray(modified_ebi_list)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [modified_ebi_list]"); goto end; } - OpenAPI_ebi_arp_mapping_t *modified_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(modified_ebi_list_local_nonprimitive); - if (!modified_ebi_listItem) { - ogs_error("No modified_ebi_listItem"); - OpenAPI_list_free(modified_ebi_listList); - goto end; + modified_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(modified_ebi_list_local, modified_ebi_list) { + if (!cJSON_IsObject(modified_ebi_list_local)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [modified_ebi_list]"); + goto end; + } + OpenAPI_ebi_arp_mapping_t *modified_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(modified_ebi_list_local); + if (!modified_ebi_listItem) { + ogs_error("No modified_ebi_listItem"); + OpenAPI_list_free(modified_ebi_listList); + goto end; + } + OpenAPI_list_add(modified_ebi_listList, modified_ebi_listItem); } - - OpenAPI_list_add(modified_ebi_listList, modified_ebi_listItem); - } } - cJSON *pti = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "pti"); - + pti = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "pti"); if (pti) { if (!cJSON_IsNumber(pti)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [pti]"); @@ -630,15 +688,12 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u } } - cJSON *n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n1SmInfoToUe"); - - OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL; + n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n1SmInfoToUe"); if (n1_sm_info_to_ue) { n1_sm_info_to_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_to_ue); } - cJSON *always_on_granted = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "alwaysOnGranted"); - + always_on_granted = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "alwaysOnGranted"); if (always_on_granted) { if (!cJSON_IsBool(always_on_granted)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [always_on_granted]"); @@ -646,27 +701,23 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u } } - cJSON *hsmf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "hsmfPduSessionUri"); - + hsmf_pdu_session_uri = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "hsmfPduSessionUri"); if (hsmf_pdu_session_uri) { - if (!cJSON_IsString(hsmf_pdu_session_uri)) { + if (!cJSON_IsString(hsmf_pdu_session_uri) && !cJSON_IsNull(hsmf_pdu_session_uri)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [hsmf_pdu_session_uri]"); goto end; } } - cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "supportedFeatures"); - + supported_features = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "supportedFeatures"); if (supported_features) { - if (!cJSON_IsString(supported_features)) { + if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [supported_features]"); goto end; } } - cJSON *cause = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "cause"); - - OpenAPI_cause_e causeVariable; + cause = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "cause"); if (cause) { if (!cJSON_IsString(cause)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [cause]"); @@ -675,17 +726,15 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u causeVariable = OpenAPI_cause_FromString(cause->valuestring); } - cJSON *n1sm_cause = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n1smCause"); - + n1sm_cause = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n1smCause"); if (n1sm_cause) { - if (!cJSON_IsString(n1sm_cause)) { + if (!cJSON_IsString(n1sm_cause) && !cJSON_IsNull(n1sm_cause)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [n1sm_cause]"); goto end; } } - cJSON *back_off_timer = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "backOffTimer"); - + back_off_timer = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "backOffTimer"); if (back_off_timer) { if (!cJSON_IsNumber(back_off_timer)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [back_off_timer]"); @@ -693,9 +742,7 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u } } - cJSON *ma_release_ind = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "maReleaseInd"); - - OpenAPI_ma_release_indication_e ma_release_indVariable; + ma_release_ind = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "maReleaseInd"); if (ma_release_ind) { if (!cJSON_IsString(ma_release_ind)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [ma_release_ind]"); @@ -704,8 +751,7 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u ma_release_indVariable = OpenAPI_ma_release_indication_FromString(ma_release_ind->valuestring); } - cJSON *ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "maAcceptedInd"); - + ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "maAcceptedInd"); if (ma_accepted_ind) { if (!cJSON_IsBool(ma_accepted_ind)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [ma_accepted_ind]"); @@ -713,56 +759,48 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u } } - cJSON *additional_cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "additionalCnTunnelInfo"); - - OpenAPI_tunnel_info_t *additional_cn_tunnel_info_local_nonprim = NULL; + additional_cn_tunnel_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "additionalCnTunnelInfo"); if (additional_cn_tunnel_info) { additional_cn_tunnel_info_local_nonprim = OpenAPI_tunnel_info_parseFromJSON(additional_cn_tunnel_info); } - cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "dnaiList"); - - OpenAPI_list_t *dnai_listList; + dnai_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "dnaiList"); if (dnai_list) { - cJSON *dnai_list_local; - if (!cJSON_IsArray(dnai_list)) { - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - dnai_listList = OpenAPI_list_create(); + cJSON *dnai_list_local = NULL; + if (!cJSON_IsArray(dnai_list)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [dnai_list]"); + goto end; + } - cJSON_ArrayForEach(dnai_list_local, dnai_list) { - if (!cJSON_IsString(dnai_list_local)) { - ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [dnai_list]"); - goto end; - } - OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); - } + dnai_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(dnai_list_local, dnai_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(dnai_list_local)) { + ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [dnai_list]"); + goto end; + } + OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring)); + } } - cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n4Info"); - - OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + n4_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n4Info"); if (n4_info) { n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info); } - cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n4InfoExt1"); - - OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n4InfoExt1"); if (n4_info_ext1) { n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1); } - cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n4InfoExt2"); - - OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "n4InfoExt2"); if (n4_info_ext2) { n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2); } - cJSON *small_data_rate_control_enabled = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "smallDataRateControlEnabled"); - + small_data_rate_control_enabled = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "smallDataRateControlEnabled"); if (small_data_rate_control_enabled) { if (!cJSON_IsBool(small_data_rate_control_enabled)) { ogs_error("OpenAPI_vsmf_update_data_parseFromJSON() failed [small_data_rate_control_enabled]"); @@ -770,9 +808,7 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u } } - cJSON *qos_monitoring_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "qosMonitoringInfo"); - - OpenAPI_qos_monitoring_info_t *qos_monitoring_info_local_nonprim = NULL; + qos_monitoring_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_dataJSON, "qosMonitoringInfo"); if (qos_monitoring_info) { qos_monitoring_info_local_nonprim = OpenAPI_qos_monitoring_info_parseFromJSON(qos_monitoring_info); } @@ -791,10 +827,10 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u n1_sm_info_to_ue ? n1_sm_info_to_ue_local_nonprim : NULL, always_on_granted ? true : false, always_on_granted ? always_on_granted->valueint : 0, - hsmf_pdu_session_uri ? ogs_strdup(hsmf_pdu_session_uri->valuestring) : NULL, - supported_features ? ogs_strdup(supported_features->valuestring) : NULL, + hsmf_pdu_session_uri && !cJSON_IsNull(hsmf_pdu_session_uri) ? ogs_strdup(hsmf_pdu_session_uri->valuestring) : NULL, + supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL, cause ? causeVariable : 0, - n1sm_cause ? ogs_strdup(n1sm_cause->valuestring) : NULL, + n1sm_cause && !cJSON_IsNull(n1sm_cause) ? ogs_strdup(n1sm_cause->valuestring) : NULL, back_off_timer ? true : false, back_off_timer ? back_off_timer->valuedouble : 0, ma_release_ind ? ma_release_indVariable : 0, @@ -812,6 +848,83 @@ OpenAPI_vsmf_update_data_t *OpenAPI_vsmf_update_data_parseFromJSON(cJSON *vsmf_u return vsmf_update_data_local_var; end: + if (session_ambr_local_nonprim) { + OpenAPI_ambr_free(session_ambr_local_nonprim); + session_ambr_local_nonprim = NULL; + } + if (qos_flows_add_mod_request_listList) { + OpenAPI_list_for_each(qos_flows_add_mod_request_listList, node) { + OpenAPI_qos_flow_add_modify_request_item_free(node->data); + } + OpenAPI_list_free(qos_flows_add_mod_request_listList); + qos_flows_add_mod_request_listList = NULL; + } + if (qos_flows_rel_request_listList) { + OpenAPI_list_for_each(qos_flows_rel_request_listList, node) { + OpenAPI_qos_flow_release_request_item_free(node->data); + } + OpenAPI_list_free(qos_flows_rel_request_listList); + qos_flows_rel_request_listList = NULL; + } + if (eps_bearer_infoList) { + OpenAPI_list_for_each(eps_bearer_infoList, node) { + OpenAPI_eps_bearer_info_free(node->data); + } + OpenAPI_list_free(eps_bearer_infoList); + eps_bearer_infoList = NULL; + } + if (assign_ebi_listList) { + OpenAPI_list_for_each(assign_ebi_listList, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(assign_ebi_listList); + assign_ebi_listList = NULL; + } + if (revoke_ebi_listList) { + OpenAPI_list_for_each(revoke_ebi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(revoke_ebi_listList); + revoke_ebi_listList = NULL; + } + if (modified_ebi_listList) { + OpenAPI_list_for_each(modified_ebi_listList, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(modified_ebi_listList); + modified_ebi_listList = NULL; + } + if (n1_sm_info_to_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_to_ue_local_nonprim); + n1_sm_info_to_ue_local_nonprim = NULL; + } + if (additional_cn_tunnel_info_local_nonprim) { + OpenAPI_tunnel_info_free(additional_cn_tunnel_info_local_nonprim); + additional_cn_tunnel_info_local_nonprim = NULL; + } + if (dnai_listList) { + OpenAPI_list_for_each(dnai_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(dnai_listList); + dnai_listList = NULL; + } + if (n4_info_local_nonprim) { + OpenAPI_n4_information_free(n4_info_local_nonprim); + n4_info_local_nonprim = NULL; + } + if (n4_info_ext1_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext1_local_nonprim); + n4_info_ext1_local_nonprim = NULL; + } + if (n4_info_ext2_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext2_local_nonprim); + n4_info_ext2_local_nonprim = NULL; + } + if (qos_monitoring_info_local_nonprim) { + OpenAPI_qos_monitoring_info_free(qos_monitoring_info_local_nonprim); + qos_monitoring_info_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/vsmf_update_error.c b/lib/sbi/openapi/model/vsmf_update_error.c index f4a070425..5a4e22267 100644 --- a/lib/sbi/openapi/model/vsmf_update_error.c +++ b/lib/sbi/openapi/model/vsmf_update_error.c @@ -44,29 +44,61 @@ OpenAPI_vsmf_update_error_t *OpenAPI_vsmf_update_error_create( void OpenAPI_vsmf_update_error_free(OpenAPI_vsmf_update_error_t *vsmf_update_error) { + OpenAPI_lnode_t *node = NULL; + if (NULL == vsmf_update_error) { return; } - OpenAPI_lnode_t *node; - OpenAPI_problem_details_free(vsmf_update_error->error); - ogs_free(vsmf_update_error->n1sm_cause); - OpenAPI_ref_to_binary_data_free(vsmf_update_error->n1_sm_info_from_ue); - OpenAPI_ref_to_binary_data_free(vsmf_update_error->unknown_n1_sm_info); - OpenAPI_list_for_each(vsmf_update_error->failed_to_assign_ebi_list, node) { - OpenAPI_arp_free(node->data); + if (vsmf_update_error->error) { + OpenAPI_problem_details_free(vsmf_update_error->error); + vsmf_update_error->error = NULL; + } + if (vsmf_update_error->n1sm_cause) { + ogs_free(vsmf_update_error->n1sm_cause); + vsmf_update_error->n1sm_cause = NULL; + } + if (vsmf_update_error->n1_sm_info_from_ue) { + OpenAPI_ref_to_binary_data_free(vsmf_update_error->n1_sm_info_from_ue); + vsmf_update_error->n1_sm_info_from_ue = NULL; + } + if (vsmf_update_error->unknown_n1_sm_info) { + OpenAPI_ref_to_binary_data_free(vsmf_update_error->unknown_n1_sm_info); + vsmf_update_error->unknown_n1_sm_info = NULL; + } + if (vsmf_update_error->failed_to_assign_ebi_list) { + OpenAPI_list_for_each(vsmf_update_error->failed_to_assign_ebi_list, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(vsmf_update_error->failed_to_assign_ebi_list); + vsmf_update_error->failed_to_assign_ebi_list = NULL; + } + if (vsmf_update_error->ng_ap_cause) { + OpenAPI_ng_ap_cause_free(vsmf_update_error->ng_ap_cause); + vsmf_update_error->ng_ap_cause = NULL; + } + if (vsmf_update_error->recovery_time) { + ogs_free(vsmf_update_error->recovery_time); + vsmf_update_error->recovery_time = NULL; + } + if (vsmf_update_error->n4_info) { + OpenAPI_n4_information_free(vsmf_update_error->n4_info); + vsmf_update_error->n4_info = NULL; + } + if (vsmf_update_error->n4_info_ext1) { + OpenAPI_n4_information_free(vsmf_update_error->n4_info_ext1); + vsmf_update_error->n4_info_ext1 = NULL; + } + if (vsmf_update_error->n4_info_ext2) { + OpenAPI_n4_information_free(vsmf_update_error->n4_info_ext2); + vsmf_update_error->n4_info_ext2 = NULL; } - OpenAPI_list_free(vsmf_update_error->failed_to_assign_ebi_list); - OpenAPI_ng_ap_cause_free(vsmf_update_error->ng_ap_cause); - ogs_free(vsmf_update_error->recovery_time); - OpenAPI_n4_information_free(vsmf_update_error->n4_info); - OpenAPI_n4_information_free(vsmf_update_error->n4_info_ext1); - OpenAPI_n4_information_free(vsmf_update_error->n4_info_ext2); ogs_free(vsmf_update_error); } cJSON *OpenAPI_vsmf_update_error_convertToJSON(OpenAPI_vsmf_update_error_t *vsmf_update_error) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (vsmf_update_error == NULL) { ogs_error("OpenAPI_vsmf_update_error_convertToJSON() failed [VsmfUpdateError]"); @@ -74,6 +106,10 @@ cJSON *OpenAPI_vsmf_update_error_convertToJSON(OpenAPI_vsmf_update_error_t *vsmf } item = cJSON_CreateObject(); + if (!vsmf_update_error->error) { + ogs_error("OpenAPI_vsmf_update_error_convertToJSON() failed [error]"); + return NULL; + } cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(vsmf_update_error->error); if (error_local_JSON == NULL) { ogs_error("OpenAPI_vsmf_update_error_convertToJSON() failed [error]"); @@ -131,17 +167,13 @@ cJSON *OpenAPI_vsmf_update_error_convertToJSON(OpenAPI_vsmf_update_error_t *vsmf ogs_error("OpenAPI_vsmf_update_error_convertToJSON() failed [failed_to_assign_ebi_list]"); goto end; } - - OpenAPI_lnode_t *failed_to_assign_ebi_list_node; - if (vsmf_update_error->failed_to_assign_ebi_list) { - OpenAPI_list_for_each(vsmf_update_error->failed_to_assign_ebi_list, failed_to_assign_ebi_list_node) { - cJSON *itemLocal = OpenAPI_arp_convertToJSON(failed_to_assign_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_update_error_convertToJSON() failed [failed_to_assign_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(failed_to_assign_ebi_listList, itemLocal); + OpenAPI_list_for_each(vsmf_update_error->failed_to_assign_ebi_list, node) { + cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_update_error_convertToJSON() failed [failed_to_assign_ebi_list]"); + goto end; } + cJSON_AddItemToArray(failed_to_assign_ebi_listList, itemLocal); } } @@ -218,17 +250,35 @@ end: OpenAPI_vsmf_update_error_t *OpenAPI_vsmf_update_error_parseFromJSON(cJSON *vsmf_update_errorJSON) { OpenAPI_vsmf_update_error_t *vsmf_update_error_local_var = NULL; - cJSON *error = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "error"); + OpenAPI_lnode_t *node = NULL; + cJSON *error = NULL; + OpenAPI_problem_details_t *error_local_nonprim = NULL; + cJSON *pti = NULL; + cJSON *n1sm_cause = NULL; + cJSON *n1_sm_info_from_ue = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_info_from_ue_local_nonprim = NULL; + cJSON *unknown_n1_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *unknown_n1_sm_info_local_nonprim = NULL; + cJSON *failed_to_assign_ebi_list = NULL; + OpenAPI_list_t *failed_to_assign_ebi_listList = NULL; + cJSON *ng_ap_cause = NULL; + OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + cJSON *_5g_mm_cause_value = NULL; + cJSON *recovery_time = NULL; + cJSON *n4_info = NULL; + OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + cJSON *n4_info_ext1 = NULL; + OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + cJSON *n4_info_ext2 = NULL; + OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + error = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "error"); if (!error) { ogs_error("OpenAPI_vsmf_update_error_parseFromJSON() failed [error]"); goto end; } - - OpenAPI_problem_details_t *error_local_nonprim = NULL; error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error); - cJSON *pti = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "pti"); - + pti = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "pti"); if (pti) { if (!cJSON_IsNumber(pti)) { ogs_error("OpenAPI_vsmf_update_error_parseFromJSON() failed [pti]"); @@ -236,67 +286,55 @@ OpenAPI_vsmf_update_error_t *OpenAPI_vsmf_update_error_parseFromJSON(cJSON *vsmf } } - cJSON *n1sm_cause = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n1smCause"); - + n1sm_cause = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n1smCause"); if (n1sm_cause) { - if (!cJSON_IsString(n1sm_cause)) { + if (!cJSON_IsString(n1sm_cause) && !cJSON_IsNull(n1sm_cause)) { ogs_error("OpenAPI_vsmf_update_error_parseFromJSON() failed [n1sm_cause]"); goto end; } } - cJSON *n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n1SmInfoFromUe"); - - OpenAPI_ref_to_binary_data_t *n1_sm_info_from_ue_local_nonprim = NULL; + n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n1SmInfoFromUe"); if (n1_sm_info_from_ue) { n1_sm_info_from_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_from_ue); } - cJSON *unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "unknownN1SmInfo"); - - OpenAPI_ref_to_binary_data_t *unknown_n1_sm_info_local_nonprim = NULL; + unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "unknownN1SmInfo"); if (unknown_n1_sm_info) { unknown_n1_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(unknown_n1_sm_info); } - cJSON *failed_to_assign_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "failedToAssignEbiList"); - - OpenAPI_list_t *failed_to_assign_ebi_listList; + failed_to_assign_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "failedToAssignEbiList"); if (failed_to_assign_ebi_list) { - cJSON *failed_to_assign_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(failed_to_assign_ebi_list)){ - ogs_error("OpenAPI_vsmf_update_error_parseFromJSON() failed [failed_to_assign_ebi_list]"); - goto end; - } - - failed_to_assign_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(failed_to_assign_ebi_list_local_nonprimitive, failed_to_assign_ebi_list ) { - if (!cJSON_IsObject(failed_to_assign_ebi_list_local_nonprimitive)) { + cJSON *failed_to_assign_ebi_list_local = NULL; + if (!cJSON_IsArray(failed_to_assign_ebi_list)) { ogs_error("OpenAPI_vsmf_update_error_parseFromJSON() failed [failed_to_assign_ebi_list]"); goto end; } - OpenAPI_arp_t *failed_to_assign_ebi_listItem = OpenAPI_arp_parseFromJSON(failed_to_assign_ebi_list_local_nonprimitive); - if (!failed_to_assign_ebi_listItem) { - ogs_error("No failed_to_assign_ebi_listItem"); - OpenAPI_list_free(failed_to_assign_ebi_listList); - goto end; + failed_to_assign_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(failed_to_assign_ebi_list_local, failed_to_assign_ebi_list) { + if (!cJSON_IsObject(failed_to_assign_ebi_list_local)) { + ogs_error("OpenAPI_vsmf_update_error_parseFromJSON() failed [failed_to_assign_ebi_list]"); + goto end; + } + OpenAPI_arp_t *failed_to_assign_ebi_listItem = OpenAPI_arp_parseFromJSON(failed_to_assign_ebi_list_local); + if (!failed_to_assign_ebi_listItem) { + ogs_error("No failed_to_assign_ebi_listItem"); + OpenAPI_list_free(failed_to_assign_ebi_listList); + goto end; + } + OpenAPI_list_add(failed_to_assign_ebi_listList, failed_to_assign_ebi_listItem); } - - OpenAPI_list_add(failed_to_assign_ebi_listList, failed_to_assign_ebi_listItem); - } } - cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "ngApCause"); - - OpenAPI_ng_ap_cause_t *ng_ap_cause_local_nonprim = NULL; + ng_ap_cause = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "ngApCause"); if (ng_ap_cause) { ng_ap_cause_local_nonprim = OpenAPI_ng_ap_cause_parseFromJSON(ng_ap_cause); } - cJSON *_5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "5gMmCauseValue"); - + _5g_mm_cause_value = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "5gMmCauseValue"); if (_5g_mm_cause_value) { if (!cJSON_IsNumber(_5g_mm_cause_value)) { ogs_error("OpenAPI_vsmf_update_error_parseFromJSON() failed [_5g_mm_cause_value]"); @@ -304,32 +342,25 @@ OpenAPI_vsmf_update_error_t *OpenAPI_vsmf_update_error_parseFromJSON(cJSON *vsmf } } - cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "recoveryTime"); - + recovery_time = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "recoveryTime"); if (recovery_time) { - if (!cJSON_IsString(recovery_time)) { + if (!cJSON_IsString(recovery_time) && !cJSON_IsNull(recovery_time)) { ogs_error("OpenAPI_vsmf_update_error_parseFromJSON() failed [recovery_time]"); goto end; } } - cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n4Info"); - - OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + n4_info = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n4Info"); if (n4_info) { n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info); } - cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n4InfoExt1"); - - OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n4InfoExt1"); if (n4_info_ext1) { n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1); } - cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n4InfoExt2"); - - OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(vsmf_update_errorJSON, "n4InfoExt2"); if (n4_info_ext2) { n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2); } @@ -338,14 +369,14 @@ OpenAPI_vsmf_update_error_t *OpenAPI_vsmf_update_error_parseFromJSON(cJSON *vsmf error_local_nonprim, pti ? true : false, pti ? pti->valuedouble : 0, - n1sm_cause ? ogs_strdup(n1sm_cause->valuestring) : NULL, + n1sm_cause && !cJSON_IsNull(n1sm_cause) ? ogs_strdup(n1sm_cause->valuestring) : NULL, n1_sm_info_from_ue ? n1_sm_info_from_ue_local_nonprim : NULL, unknown_n1_sm_info ? unknown_n1_sm_info_local_nonprim : NULL, failed_to_assign_ebi_list ? failed_to_assign_ebi_listList : NULL, ng_ap_cause ? ng_ap_cause_local_nonprim : NULL, _5g_mm_cause_value ? true : false, _5g_mm_cause_value ? _5g_mm_cause_value->valuedouble : 0, - recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL, + recovery_time && !cJSON_IsNull(recovery_time) ? ogs_strdup(recovery_time->valuestring) : NULL, n4_info ? n4_info_local_nonprim : NULL, n4_info_ext1 ? n4_info_ext1_local_nonprim : NULL, n4_info_ext2 ? n4_info_ext2_local_nonprim : NULL @@ -353,6 +384,41 @@ OpenAPI_vsmf_update_error_t *OpenAPI_vsmf_update_error_parseFromJSON(cJSON *vsmf return vsmf_update_error_local_var; end: + if (error_local_nonprim) { + OpenAPI_problem_details_free(error_local_nonprim); + error_local_nonprim = NULL; + } + if (n1_sm_info_from_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_from_ue_local_nonprim); + n1_sm_info_from_ue_local_nonprim = NULL; + } + if (unknown_n1_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(unknown_n1_sm_info_local_nonprim); + unknown_n1_sm_info_local_nonprim = NULL; + } + if (failed_to_assign_ebi_listList) { + OpenAPI_list_for_each(failed_to_assign_ebi_listList, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(failed_to_assign_ebi_listList); + failed_to_assign_ebi_listList = NULL; + } + if (ng_ap_cause_local_nonprim) { + OpenAPI_ng_ap_cause_free(ng_ap_cause_local_nonprim); + ng_ap_cause_local_nonprim = NULL; + } + if (n4_info_local_nonprim) { + OpenAPI_n4_information_free(n4_info_local_nonprim); + n4_info_local_nonprim = NULL; + } + if (n4_info_ext1_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext1_local_nonprim); + n4_info_ext1_local_nonprim = NULL; + } + if (n4_info_ext2_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext2_local_nonprim); + n4_info_ext2_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/vsmf_updated_data.c b/lib/sbi/openapi/model/vsmf_updated_data.c index c17731906..386e5da87 100644 --- a/lib/sbi/openapi/model/vsmf_updated_data.c +++ b/lib/sbi/openapi/model/vsmf_updated_data.c @@ -50,60 +50,113 @@ OpenAPI_vsmf_updated_data_t *OpenAPI_vsmf_updated_data_create( void OpenAPI_vsmf_updated_data_free(OpenAPI_vsmf_updated_data_t *vsmf_updated_data) { + OpenAPI_lnode_t *node = NULL; + if (NULL == vsmf_updated_data) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(vsmf_updated_data->qos_flows_add_mod_list, node) { - OpenAPI_qos_flow_item_free(node->data); + if (vsmf_updated_data->qos_flows_add_mod_list) { + OpenAPI_list_for_each(vsmf_updated_data->qos_flows_add_mod_list, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->qos_flows_add_mod_list); + vsmf_updated_data->qos_flows_add_mod_list = NULL; } - OpenAPI_list_free(vsmf_updated_data->qos_flows_add_mod_list); - OpenAPI_list_for_each(vsmf_updated_data->qos_flows_rel_list, node) { - OpenAPI_qos_flow_item_free(node->data); + if (vsmf_updated_data->qos_flows_rel_list) { + OpenAPI_list_for_each(vsmf_updated_data->qos_flows_rel_list, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->qos_flows_rel_list); + vsmf_updated_data->qos_flows_rel_list = NULL; } - OpenAPI_list_free(vsmf_updated_data->qos_flows_rel_list); - OpenAPI_list_for_each(vsmf_updated_data->qos_flows_failedto_add_mod_list, node) { - OpenAPI_qos_flow_item_free(node->data); + if (vsmf_updated_data->qos_flows_failedto_add_mod_list) { + OpenAPI_list_for_each(vsmf_updated_data->qos_flows_failedto_add_mod_list, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->qos_flows_failedto_add_mod_list); + vsmf_updated_data->qos_flows_failedto_add_mod_list = NULL; } - OpenAPI_list_free(vsmf_updated_data->qos_flows_failedto_add_mod_list); - OpenAPI_list_for_each(vsmf_updated_data->qos_flows_failedto_rel_list, node) { - OpenAPI_qos_flow_item_free(node->data); + if (vsmf_updated_data->qos_flows_failedto_rel_list) { + OpenAPI_list_for_each(vsmf_updated_data->qos_flows_failedto_rel_list, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->qos_flows_failedto_rel_list); + vsmf_updated_data->qos_flows_failedto_rel_list = NULL; } - OpenAPI_list_free(vsmf_updated_data->qos_flows_failedto_rel_list); - OpenAPI_ref_to_binary_data_free(vsmf_updated_data->n1_sm_info_from_ue); - OpenAPI_ref_to_binary_data_free(vsmf_updated_data->unknown_n1_sm_info); - OpenAPI_user_location_free(vsmf_updated_data->ue_location); - ogs_free(vsmf_updated_data->ue_time_zone); - OpenAPI_user_location_free(vsmf_updated_data->add_ue_location); - OpenAPI_list_for_each(vsmf_updated_data->assigned_ebi_list, node) { - OpenAPI_ebi_arp_mapping_free(node->data); + if (vsmf_updated_data->n1_sm_info_from_ue) { + OpenAPI_ref_to_binary_data_free(vsmf_updated_data->n1_sm_info_from_ue); + vsmf_updated_data->n1_sm_info_from_ue = NULL; } - OpenAPI_list_free(vsmf_updated_data->assigned_ebi_list); - OpenAPI_list_for_each(vsmf_updated_data->failed_to_assign_ebi_list, node) { - OpenAPI_arp_free(node->data); + if (vsmf_updated_data->unknown_n1_sm_info) { + OpenAPI_ref_to_binary_data_free(vsmf_updated_data->unknown_n1_sm_info); + vsmf_updated_data->unknown_n1_sm_info = NULL; } - OpenAPI_list_free(vsmf_updated_data->failed_to_assign_ebi_list); - OpenAPI_list_for_each(vsmf_updated_data->released_ebi_list, node) { - ogs_free(node->data); + if (vsmf_updated_data->ue_location) { + OpenAPI_user_location_free(vsmf_updated_data->ue_location); + vsmf_updated_data->ue_location = NULL; } - OpenAPI_list_free(vsmf_updated_data->released_ebi_list); - OpenAPI_list_for_each(vsmf_updated_data->secondary_rat_usage_report, node) { - OpenAPI_secondary_rat_usage_report_free(node->data); + if (vsmf_updated_data->ue_time_zone) { + ogs_free(vsmf_updated_data->ue_time_zone); + vsmf_updated_data->ue_time_zone = NULL; } - OpenAPI_list_free(vsmf_updated_data->secondary_rat_usage_report); - OpenAPI_list_for_each(vsmf_updated_data->secondary_rat_usage_info, node) { - OpenAPI_secondary_rat_usage_info_free(node->data); + if (vsmf_updated_data->add_ue_location) { + OpenAPI_user_location_free(vsmf_updated_data->add_ue_location); + vsmf_updated_data->add_ue_location = NULL; + } + if (vsmf_updated_data->assigned_ebi_list) { + OpenAPI_list_for_each(vsmf_updated_data->assigned_ebi_list, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->assigned_ebi_list); + vsmf_updated_data->assigned_ebi_list = NULL; + } + if (vsmf_updated_data->failed_to_assign_ebi_list) { + OpenAPI_list_for_each(vsmf_updated_data->failed_to_assign_ebi_list, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->failed_to_assign_ebi_list); + vsmf_updated_data->failed_to_assign_ebi_list = NULL; + } + if (vsmf_updated_data->released_ebi_list) { + OpenAPI_list_for_each(vsmf_updated_data->released_ebi_list, node) { + ogs_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->released_ebi_list); + vsmf_updated_data->released_ebi_list = NULL; + } + if (vsmf_updated_data->secondary_rat_usage_report) { + OpenAPI_list_for_each(vsmf_updated_data->secondary_rat_usage_report, node) { + OpenAPI_secondary_rat_usage_report_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->secondary_rat_usage_report); + vsmf_updated_data->secondary_rat_usage_report = NULL; + } + if (vsmf_updated_data->secondary_rat_usage_info) { + OpenAPI_list_for_each(vsmf_updated_data->secondary_rat_usage_info, node) { + OpenAPI_secondary_rat_usage_info_free(node->data); + } + OpenAPI_list_free(vsmf_updated_data->secondary_rat_usage_info); + vsmf_updated_data->secondary_rat_usage_info = NULL; + } + if (vsmf_updated_data->n4_info) { + OpenAPI_n4_information_free(vsmf_updated_data->n4_info); + vsmf_updated_data->n4_info = NULL; + } + if (vsmf_updated_data->n4_info_ext1) { + OpenAPI_n4_information_free(vsmf_updated_data->n4_info_ext1); + vsmf_updated_data->n4_info_ext1 = NULL; + } + if (vsmf_updated_data->n4_info_ext2) { + OpenAPI_n4_information_free(vsmf_updated_data->n4_info_ext2); + vsmf_updated_data->n4_info_ext2 = NULL; } - OpenAPI_list_free(vsmf_updated_data->secondary_rat_usage_info); - OpenAPI_n4_information_free(vsmf_updated_data->n4_info); - OpenAPI_n4_information_free(vsmf_updated_data->n4_info_ext1); - OpenAPI_n4_information_free(vsmf_updated_data->n4_info_ext2); ogs_free(vsmf_updated_data); } cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf_updated_data) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (vsmf_updated_data == NULL) { ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [VsmfUpdatedData]"); @@ -117,17 +170,13 @@ cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_add_mod_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_add_mod_list_node; - if (vsmf_updated_data->qos_flows_add_mod_list) { - OpenAPI_list_for_each(vsmf_updated_data->qos_flows_add_mod_list, qos_flows_add_mod_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(qos_flows_add_mod_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_add_mod_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_add_mod_listList, itemLocal); + OpenAPI_list_for_each(vsmf_updated_data->qos_flows_add_mod_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_add_mod_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_add_mod_listList, itemLocal); } } @@ -137,17 +186,13 @@ cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_rel_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_rel_list_node; - if (vsmf_updated_data->qos_flows_rel_list) { - OpenAPI_list_for_each(vsmf_updated_data->qos_flows_rel_list, qos_flows_rel_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(qos_flows_rel_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_rel_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_rel_listList, itemLocal); + OpenAPI_list_for_each(vsmf_updated_data->qos_flows_rel_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_rel_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_rel_listList, itemLocal); } } @@ -157,17 +202,13 @@ cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_failedto_add_mod_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_failedto_add_mod_list_node; - if (vsmf_updated_data->qos_flows_failedto_add_mod_list) { - OpenAPI_list_for_each(vsmf_updated_data->qos_flows_failedto_add_mod_list, qos_flows_failedto_add_mod_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(qos_flows_failedto_add_mod_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_failedto_add_mod_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_failedto_add_mod_listList, itemLocal); + OpenAPI_list_for_each(vsmf_updated_data->qos_flows_failedto_add_mod_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_failedto_add_mod_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_failedto_add_mod_listList, itemLocal); } } @@ -177,17 +218,13 @@ cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_failedto_rel_list]"); goto end; } - - OpenAPI_lnode_t *qos_flows_failedto_rel_list_node; - if (vsmf_updated_data->qos_flows_failedto_rel_list) { - OpenAPI_list_for_each(vsmf_updated_data->qos_flows_failedto_rel_list, qos_flows_failedto_rel_list_node) { - cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(qos_flows_failedto_rel_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_failedto_rel_list]"); - goto end; - } - cJSON_AddItemToArray(qos_flows_failedto_rel_listList, itemLocal); + OpenAPI_list_for_each(vsmf_updated_data->qos_flows_failedto_rel_list, node) { + cJSON *itemLocal = OpenAPI_qos_flow_item_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [qos_flows_failedto_rel_list]"); + goto end; } + cJSON_AddItemToArray(qos_flows_failedto_rel_listList, itemLocal); } } @@ -256,17 +293,13 @@ cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [assigned_ebi_list]"); goto end; } - - OpenAPI_lnode_t *assigned_ebi_list_node; - if (vsmf_updated_data->assigned_ebi_list) { - OpenAPI_list_for_each(vsmf_updated_data->assigned_ebi_list, assigned_ebi_list_node) { - cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(assigned_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [assigned_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(assigned_ebi_listList, itemLocal); + OpenAPI_list_for_each(vsmf_updated_data->assigned_ebi_list, node) { + cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [assigned_ebi_list]"); + goto end; } + cJSON_AddItemToArray(assigned_ebi_listList, itemLocal); } } @@ -276,34 +309,28 @@ cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [failed_to_assign_ebi_list]"); goto end; } - - OpenAPI_lnode_t *failed_to_assign_ebi_list_node; - if (vsmf_updated_data->failed_to_assign_ebi_list) { - OpenAPI_list_for_each(vsmf_updated_data->failed_to_assign_ebi_list, failed_to_assign_ebi_list_node) { - cJSON *itemLocal = OpenAPI_arp_convertToJSON(failed_to_assign_ebi_list_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [failed_to_assign_ebi_list]"); - goto end; - } - cJSON_AddItemToArray(failed_to_assign_ebi_listList, itemLocal); + OpenAPI_list_for_each(vsmf_updated_data->failed_to_assign_ebi_list, node) { + cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [failed_to_assign_ebi_list]"); + goto end; } + cJSON_AddItemToArray(failed_to_assign_ebi_listList, itemLocal); } } if (vsmf_updated_data->released_ebi_list) { - cJSON *released_ebi_list = cJSON_AddArrayToObject(item, "releasedEbiList"); - if (released_ebi_list == NULL) { + cJSON *released_ebi_listList = cJSON_AddArrayToObject(item, "releasedEbiList"); + if (released_ebi_listList == NULL) { ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [released_ebi_list]"); goto end; } - - OpenAPI_lnode_t *released_ebi_list_node; - OpenAPI_list_for_each(vsmf_updated_data->released_ebi_list, released_ebi_list_node) { - if (cJSON_AddNumberToObject(released_ebi_list, "", *(double *)released_ebi_list_node->data) == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [released_ebi_list]"); - goto end; + OpenAPI_list_for_each(vsmf_updated_data->released_ebi_list, node) { + if (cJSON_AddNumberToObject(released_ebi_listList, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [released_ebi_list]"); + goto end; + } } - } } if (vsmf_updated_data->secondary_rat_usage_report) { @@ -312,17 +339,13 @@ cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [secondary_rat_usage_report]"); goto end; } - - OpenAPI_lnode_t *secondary_rat_usage_report_node; - if (vsmf_updated_data->secondary_rat_usage_report) { - OpenAPI_list_for_each(vsmf_updated_data->secondary_rat_usage_report, secondary_rat_usage_report_node) { - cJSON *itemLocal = OpenAPI_secondary_rat_usage_report_convertToJSON(secondary_rat_usage_report_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [secondary_rat_usage_report]"); - goto end; - } - cJSON_AddItemToArray(secondary_rat_usage_reportList, itemLocal); + OpenAPI_list_for_each(vsmf_updated_data->secondary_rat_usage_report, node) { + cJSON *itemLocal = OpenAPI_secondary_rat_usage_report_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [secondary_rat_usage_report]"); + goto end; } + cJSON_AddItemToArray(secondary_rat_usage_reportList, itemLocal); } } @@ -332,17 +355,13 @@ cJSON *OpenAPI_vsmf_updated_data_convertToJSON(OpenAPI_vsmf_updated_data_t *vsmf ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [secondary_rat_usage_info]"); goto end; } - - OpenAPI_lnode_t *secondary_rat_usage_info_node; - if (vsmf_updated_data->secondary_rat_usage_info) { - OpenAPI_list_for_each(vsmf_updated_data->secondary_rat_usage_info, secondary_rat_usage_info_node) { - cJSON *itemLocal = OpenAPI_secondary_rat_usage_info_convertToJSON(secondary_rat_usage_info_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [secondary_rat_usage_info]"); - goto end; - } - cJSON_AddItemToArray(secondary_rat_usage_infoList, itemLocal); + OpenAPI_list_for_each(vsmf_updated_data->secondary_rat_usage_info, node) { + cJSON *itemLocal = OpenAPI_secondary_rat_usage_info_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_vsmf_updated_data_convertToJSON() failed [secondary_rat_usage_info]"); + goto end; } + cJSON_AddItemToArray(secondary_rat_usage_infoList, itemLocal); } } @@ -392,312 +411,306 @@ end: OpenAPI_vsmf_updated_data_t *OpenAPI_vsmf_updated_data_parseFromJSON(cJSON *vsmf_updated_dataJSON) { OpenAPI_vsmf_updated_data_t *vsmf_updated_data_local_var = NULL; - cJSON *qos_flows_add_mod_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "qosFlowsAddModList"); - - OpenAPI_list_t *qos_flows_add_mod_listList; + OpenAPI_lnode_t *node = NULL; + cJSON *qos_flows_add_mod_list = NULL; + OpenAPI_list_t *qos_flows_add_mod_listList = NULL; + cJSON *qos_flows_rel_list = NULL; + OpenAPI_list_t *qos_flows_rel_listList = NULL; + cJSON *qos_flows_failedto_add_mod_list = NULL; + OpenAPI_list_t *qos_flows_failedto_add_mod_listList = NULL; + cJSON *qos_flows_failedto_rel_list = NULL; + OpenAPI_list_t *qos_flows_failedto_rel_listList = NULL; + cJSON *n1_sm_info_from_ue = NULL; + OpenAPI_ref_to_binary_data_t *n1_sm_info_from_ue_local_nonprim = NULL; + cJSON *unknown_n1_sm_info = NULL; + OpenAPI_ref_to_binary_data_t *unknown_n1_sm_info_local_nonprim = NULL; + cJSON *ue_location = NULL; + OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + cJSON *ue_time_zone = NULL; + cJSON *add_ue_location = NULL; + OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + cJSON *assigned_ebi_list = NULL; + OpenAPI_list_t *assigned_ebi_listList = NULL; + cJSON *failed_to_assign_ebi_list = NULL; + OpenAPI_list_t *failed_to_assign_ebi_listList = NULL; + cJSON *released_ebi_list = NULL; + OpenAPI_list_t *released_ebi_listList = NULL; + cJSON *secondary_rat_usage_report = NULL; + OpenAPI_list_t *secondary_rat_usage_reportList = NULL; + cJSON *secondary_rat_usage_info = NULL; + OpenAPI_list_t *secondary_rat_usage_infoList = NULL; + cJSON *n4_info = NULL; + OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + cJSON *n4_info_ext1 = NULL; + OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + cJSON *n4_info_ext2 = NULL; + OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + qos_flows_add_mod_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "qosFlowsAddModList"); if (qos_flows_add_mod_list) { - cJSON *qos_flows_add_mod_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_add_mod_list)){ - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_add_mod_list]"); - goto end; - } - - qos_flows_add_mod_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_add_mod_list_local_nonprimitive, qos_flows_add_mod_list ) { - if (!cJSON_IsObject(qos_flows_add_mod_list_local_nonprimitive)) { + cJSON *qos_flows_add_mod_list_local = NULL; + if (!cJSON_IsArray(qos_flows_add_mod_list)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_add_mod_list]"); goto end; } - OpenAPI_qos_flow_item_t *qos_flows_add_mod_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_add_mod_list_local_nonprimitive); - if (!qos_flows_add_mod_listItem) { - ogs_error("No qos_flows_add_mod_listItem"); - OpenAPI_list_free(qos_flows_add_mod_listList); - goto end; + qos_flows_add_mod_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_add_mod_list_local, qos_flows_add_mod_list) { + if (!cJSON_IsObject(qos_flows_add_mod_list_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_add_mod_list]"); + goto end; + } + OpenAPI_qos_flow_item_t *qos_flows_add_mod_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_add_mod_list_local); + if (!qos_flows_add_mod_listItem) { + ogs_error("No qos_flows_add_mod_listItem"); + OpenAPI_list_free(qos_flows_add_mod_listList); + goto end; + } + OpenAPI_list_add(qos_flows_add_mod_listList, qos_flows_add_mod_listItem); } - - OpenAPI_list_add(qos_flows_add_mod_listList, qos_flows_add_mod_listItem); - } } - cJSON *qos_flows_rel_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "qosFlowsRelList"); - - OpenAPI_list_t *qos_flows_rel_listList; + qos_flows_rel_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "qosFlowsRelList"); if (qos_flows_rel_list) { - cJSON *qos_flows_rel_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_rel_list)){ - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_rel_list]"); - goto end; - } - - qos_flows_rel_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_rel_list_local_nonprimitive, qos_flows_rel_list ) { - if (!cJSON_IsObject(qos_flows_rel_list_local_nonprimitive)) { + cJSON *qos_flows_rel_list_local = NULL; + if (!cJSON_IsArray(qos_flows_rel_list)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_rel_list]"); goto end; } - OpenAPI_qos_flow_item_t *qos_flows_rel_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_rel_list_local_nonprimitive); - if (!qos_flows_rel_listItem) { - ogs_error("No qos_flows_rel_listItem"); - OpenAPI_list_free(qos_flows_rel_listList); - goto end; + qos_flows_rel_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_rel_list_local, qos_flows_rel_list) { + if (!cJSON_IsObject(qos_flows_rel_list_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_rel_list]"); + goto end; + } + OpenAPI_qos_flow_item_t *qos_flows_rel_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_rel_list_local); + if (!qos_flows_rel_listItem) { + ogs_error("No qos_flows_rel_listItem"); + OpenAPI_list_free(qos_flows_rel_listList); + goto end; + } + OpenAPI_list_add(qos_flows_rel_listList, qos_flows_rel_listItem); } - - OpenAPI_list_add(qos_flows_rel_listList, qos_flows_rel_listItem); - } } - cJSON *qos_flows_failedto_add_mod_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "qosFlowsFailedtoAddModList"); - - OpenAPI_list_t *qos_flows_failedto_add_mod_listList; + qos_flows_failedto_add_mod_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "qosFlowsFailedtoAddModList"); if (qos_flows_failedto_add_mod_list) { - cJSON *qos_flows_failedto_add_mod_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_failedto_add_mod_list)){ - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_failedto_add_mod_list]"); - goto end; - } - - qos_flows_failedto_add_mod_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_failedto_add_mod_list_local_nonprimitive, qos_flows_failedto_add_mod_list ) { - if (!cJSON_IsObject(qos_flows_failedto_add_mod_list_local_nonprimitive)) { + cJSON *qos_flows_failedto_add_mod_list_local = NULL; + if (!cJSON_IsArray(qos_flows_failedto_add_mod_list)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_failedto_add_mod_list]"); goto end; } - OpenAPI_qos_flow_item_t *qos_flows_failedto_add_mod_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_failedto_add_mod_list_local_nonprimitive); - if (!qos_flows_failedto_add_mod_listItem) { - ogs_error("No qos_flows_failedto_add_mod_listItem"); - OpenAPI_list_free(qos_flows_failedto_add_mod_listList); - goto end; + qos_flows_failedto_add_mod_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_failedto_add_mod_list_local, qos_flows_failedto_add_mod_list) { + if (!cJSON_IsObject(qos_flows_failedto_add_mod_list_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_failedto_add_mod_list]"); + goto end; + } + OpenAPI_qos_flow_item_t *qos_flows_failedto_add_mod_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_failedto_add_mod_list_local); + if (!qos_flows_failedto_add_mod_listItem) { + ogs_error("No qos_flows_failedto_add_mod_listItem"); + OpenAPI_list_free(qos_flows_failedto_add_mod_listList); + goto end; + } + OpenAPI_list_add(qos_flows_failedto_add_mod_listList, qos_flows_failedto_add_mod_listItem); } - - OpenAPI_list_add(qos_flows_failedto_add_mod_listList, qos_flows_failedto_add_mod_listItem); - } } - cJSON *qos_flows_failedto_rel_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "qosFlowsFailedtoRelList"); - - OpenAPI_list_t *qos_flows_failedto_rel_listList; + qos_flows_failedto_rel_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "qosFlowsFailedtoRelList"); if (qos_flows_failedto_rel_list) { - cJSON *qos_flows_failedto_rel_list_local_nonprimitive; - if (!cJSON_IsArray(qos_flows_failedto_rel_list)){ - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_failedto_rel_list]"); - goto end; - } - - qos_flows_failedto_rel_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(qos_flows_failedto_rel_list_local_nonprimitive, qos_flows_failedto_rel_list ) { - if (!cJSON_IsObject(qos_flows_failedto_rel_list_local_nonprimitive)) { + cJSON *qos_flows_failedto_rel_list_local = NULL; + if (!cJSON_IsArray(qos_flows_failedto_rel_list)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_failedto_rel_list]"); goto end; } - OpenAPI_qos_flow_item_t *qos_flows_failedto_rel_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_failedto_rel_list_local_nonprimitive); - if (!qos_flows_failedto_rel_listItem) { - ogs_error("No qos_flows_failedto_rel_listItem"); - OpenAPI_list_free(qos_flows_failedto_rel_listList); - goto end; + qos_flows_failedto_rel_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(qos_flows_failedto_rel_list_local, qos_flows_failedto_rel_list) { + if (!cJSON_IsObject(qos_flows_failedto_rel_list_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [qos_flows_failedto_rel_list]"); + goto end; + } + OpenAPI_qos_flow_item_t *qos_flows_failedto_rel_listItem = OpenAPI_qos_flow_item_parseFromJSON(qos_flows_failedto_rel_list_local); + if (!qos_flows_failedto_rel_listItem) { + ogs_error("No qos_flows_failedto_rel_listItem"); + OpenAPI_list_free(qos_flows_failedto_rel_listList); + goto end; + } + OpenAPI_list_add(qos_flows_failedto_rel_listList, qos_flows_failedto_rel_listItem); } - - OpenAPI_list_add(qos_flows_failedto_rel_listList, qos_flows_failedto_rel_listItem); - } } - cJSON *n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "n1SmInfoFromUe"); - - OpenAPI_ref_to_binary_data_t *n1_sm_info_from_ue_local_nonprim = NULL; + n1_sm_info_from_ue = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "n1SmInfoFromUe"); if (n1_sm_info_from_ue) { n1_sm_info_from_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_from_ue); } - cJSON *unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "unknownN1SmInfo"); - - OpenAPI_ref_to_binary_data_t *unknown_n1_sm_info_local_nonprim = NULL; + unknown_n1_sm_info = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "unknownN1SmInfo"); if (unknown_n1_sm_info) { unknown_n1_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(unknown_n1_sm_info); } - cJSON *ue_location = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "ueLocation"); - - OpenAPI_user_location_t *ue_location_local_nonprim = NULL; + ue_location = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "ueLocation"); if (ue_location) { ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(ue_location); } - cJSON *ue_time_zone = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "ueTimeZone"); - + ue_time_zone = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "ueTimeZone"); if (ue_time_zone) { - if (!cJSON_IsString(ue_time_zone)) { + if (!cJSON_IsString(ue_time_zone) && !cJSON_IsNull(ue_time_zone)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [ue_time_zone]"); goto end; } } - cJSON *add_ue_location = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "addUeLocation"); - - OpenAPI_user_location_t *add_ue_location_local_nonprim = NULL; + add_ue_location = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "addUeLocation"); if (add_ue_location) { add_ue_location_local_nonprim = OpenAPI_user_location_parseFromJSON(add_ue_location); } - cJSON *assigned_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "assignedEbiList"); - - OpenAPI_list_t *assigned_ebi_listList; + assigned_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "assignedEbiList"); if (assigned_ebi_list) { - cJSON *assigned_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(assigned_ebi_list)){ - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [assigned_ebi_list]"); - goto end; - } - - assigned_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(assigned_ebi_list_local_nonprimitive, assigned_ebi_list ) { - if (!cJSON_IsObject(assigned_ebi_list_local_nonprimitive)) { + cJSON *assigned_ebi_list_local = NULL; + if (!cJSON_IsArray(assigned_ebi_list)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [assigned_ebi_list]"); goto end; } - OpenAPI_ebi_arp_mapping_t *assigned_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(assigned_ebi_list_local_nonprimitive); - if (!assigned_ebi_listItem) { - ogs_error("No assigned_ebi_listItem"); - OpenAPI_list_free(assigned_ebi_listList); - goto end; + assigned_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(assigned_ebi_list_local, assigned_ebi_list) { + if (!cJSON_IsObject(assigned_ebi_list_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [assigned_ebi_list]"); + goto end; + } + OpenAPI_ebi_arp_mapping_t *assigned_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(assigned_ebi_list_local); + if (!assigned_ebi_listItem) { + ogs_error("No assigned_ebi_listItem"); + OpenAPI_list_free(assigned_ebi_listList); + goto end; + } + OpenAPI_list_add(assigned_ebi_listList, assigned_ebi_listItem); } - - OpenAPI_list_add(assigned_ebi_listList, assigned_ebi_listItem); - } } - cJSON *failed_to_assign_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "failedToAssignEbiList"); - - OpenAPI_list_t *failed_to_assign_ebi_listList; + failed_to_assign_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "failedToAssignEbiList"); if (failed_to_assign_ebi_list) { - cJSON *failed_to_assign_ebi_list_local_nonprimitive; - if (!cJSON_IsArray(failed_to_assign_ebi_list)){ - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [failed_to_assign_ebi_list]"); - goto end; - } - - failed_to_assign_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(failed_to_assign_ebi_list_local_nonprimitive, failed_to_assign_ebi_list ) { - if (!cJSON_IsObject(failed_to_assign_ebi_list_local_nonprimitive)) { + cJSON *failed_to_assign_ebi_list_local = NULL; + if (!cJSON_IsArray(failed_to_assign_ebi_list)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [failed_to_assign_ebi_list]"); goto end; } - OpenAPI_arp_t *failed_to_assign_ebi_listItem = OpenAPI_arp_parseFromJSON(failed_to_assign_ebi_list_local_nonprimitive); - if (!failed_to_assign_ebi_listItem) { - ogs_error("No failed_to_assign_ebi_listItem"); - OpenAPI_list_free(failed_to_assign_ebi_listList); + failed_to_assign_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(failed_to_assign_ebi_list_local, failed_to_assign_ebi_list) { + if (!cJSON_IsObject(failed_to_assign_ebi_list_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [failed_to_assign_ebi_list]"); + goto end; + } + OpenAPI_arp_t *failed_to_assign_ebi_listItem = OpenAPI_arp_parseFromJSON(failed_to_assign_ebi_list_local); + if (!failed_to_assign_ebi_listItem) { + ogs_error("No failed_to_assign_ebi_listItem"); + OpenAPI_list_free(failed_to_assign_ebi_listList); + goto end; + } + OpenAPI_list_add(failed_to_assign_ebi_listList, failed_to_assign_ebi_listItem); + } + } + + released_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "releasedEbiList"); + if (released_ebi_list) { + cJSON *released_ebi_list_local = NULL; + if (!cJSON_IsArray(released_ebi_list)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [released_ebi_list]"); goto end; } - OpenAPI_list_add(failed_to_assign_ebi_listList, failed_to_assign_ebi_listItem); - } + released_ebi_listList = OpenAPI_list_create(); + + cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsNumber(released_ebi_list_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [released_ebi_list]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [released_ebi_list]"); + goto end; + } + *localDouble = released_ebi_list_local->valuedouble; + OpenAPI_list_add(released_ebi_listList, localDouble); + } } - cJSON *released_ebi_list = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "releasedEbiList"); - - OpenAPI_list_t *released_ebi_listList; - if (released_ebi_list) { - cJSON *released_ebi_list_local; - if (!cJSON_IsArray(released_ebi_list)) { - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [released_ebi_list]"); - goto end; - } - released_ebi_listList = OpenAPI_list_create(); - - cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) { - if (!cJSON_IsNumber(released_ebi_list_local)) { - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [released_ebi_list]"); - goto end; - } - OpenAPI_list_add(released_ebi_listList, &released_ebi_list_local->valuedouble); - } - } - - cJSON *secondary_rat_usage_report = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "secondaryRatUsageReport"); - - OpenAPI_list_t *secondary_rat_usage_reportList; + secondary_rat_usage_report = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "secondaryRatUsageReport"); if (secondary_rat_usage_report) { - cJSON *secondary_rat_usage_report_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_usage_report)){ - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [secondary_rat_usage_report]"); - goto end; - } - - secondary_rat_usage_reportList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_usage_report_local_nonprimitive, secondary_rat_usage_report ) { - if (!cJSON_IsObject(secondary_rat_usage_report_local_nonprimitive)) { + cJSON *secondary_rat_usage_report_local = NULL; + if (!cJSON_IsArray(secondary_rat_usage_report)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [secondary_rat_usage_report]"); goto end; } - OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_reportItem = OpenAPI_secondary_rat_usage_report_parseFromJSON(secondary_rat_usage_report_local_nonprimitive); - if (!secondary_rat_usage_reportItem) { - ogs_error("No secondary_rat_usage_reportItem"); - OpenAPI_list_free(secondary_rat_usage_reportList); - goto end; + secondary_rat_usage_reportList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_usage_report_local, secondary_rat_usage_report) { + if (!cJSON_IsObject(secondary_rat_usage_report_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [secondary_rat_usage_report]"); + goto end; + } + OpenAPI_secondary_rat_usage_report_t *secondary_rat_usage_reportItem = OpenAPI_secondary_rat_usage_report_parseFromJSON(secondary_rat_usage_report_local); + if (!secondary_rat_usage_reportItem) { + ogs_error("No secondary_rat_usage_reportItem"); + OpenAPI_list_free(secondary_rat_usage_reportList); + goto end; + } + OpenAPI_list_add(secondary_rat_usage_reportList, secondary_rat_usage_reportItem); } - - OpenAPI_list_add(secondary_rat_usage_reportList, secondary_rat_usage_reportItem); - } } - cJSON *secondary_rat_usage_info = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "secondaryRatUsageInfo"); - - OpenAPI_list_t *secondary_rat_usage_infoList; + secondary_rat_usage_info = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "secondaryRatUsageInfo"); if (secondary_rat_usage_info) { - cJSON *secondary_rat_usage_info_local_nonprimitive; - if (!cJSON_IsArray(secondary_rat_usage_info)){ - ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [secondary_rat_usage_info]"); - goto end; - } - - secondary_rat_usage_infoList = OpenAPI_list_create(); - - cJSON_ArrayForEach(secondary_rat_usage_info_local_nonprimitive, secondary_rat_usage_info ) { - if (!cJSON_IsObject(secondary_rat_usage_info_local_nonprimitive)) { + cJSON *secondary_rat_usage_info_local = NULL; + if (!cJSON_IsArray(secondary_rat_usage_info)) { ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [secondary_rat_usage_info]"); goto end; } - OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_infoItem = OpenAPI_secondary_rat_usage_info_parseFromJSON(secondary_rat_usage_info_local_nonprimitive); - if (!secondary_rat_usage_infoItem) { - ogs_error("No secondary_rat_usage_infoItem"); - OpenAPI_list_free(secondary_rat_usage_infoList); - goto end; + secondary_rat_usage_infoList = OpenAPI_list_create(); + + cJSON_ArrayForEach(secondary_rat_usage_info_local, secondary_rat_usage_info) { + if (!cJSON_IsObject(secondary_rat_usage_info_local)) { + ogs_error("OpenAPI_vsmf_updated_data_parseFromJSON() failed [secondary_rat_usage_info]"); + goto end; + } + OpenAPI_secondary_rat_usage_info_t *secondary_rat_usage_infoItem = OpenAPI_secondary_rat_usage_info_parseFromJSON(secondary_rat_usage_info_local); + if (!secondary_rat_usage_infoItem) { + ogs_error("No secondary_rat_usage_infoItem"); + OpenAPI_list_free(secondary_rat_usage_infoList); + goto end; + } + OpenAPI_list_add(secondary_rat_usage_infoList, secondary_rat_usage_infoItem); } - - OpenAPI_list_add(secondary_rat_usage_infoList, secondary_rat_usage_infoItem); - } } - cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "n4Info"); - - OpenAPI_n4_information_t *n4_info_local_nonprim = NULL; + n4_info = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "n4Info"); if (n4_info) { n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info); } - cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "n4InfoExt1"); - - OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL; + n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "n4InfoExt1"); if (n4_info_ext1) { n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1); } - cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "n4InfoExt2"); - - OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL; + n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(vsmf_updated_dataJSON, "n4InfoExt2"); if (n4_info_ext2) { n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2); } @@ -710,7 +723,7 @@ OpenAPI_vsmf_updated_data_t *OpenAPI_vsmf_updated_data_parseFromJSON(cJSON *vsmf n1_sm_info_from_ue ? n1_sm_info_from_ue_local_nonprim : NULL, unknown_n1_sm_info ? unknown_n1_sm_info_local_nonprim : NULL, ue_location ? ue_location_local_nonprim : NULL, - ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL, + ue_time_zone && !cJSON_IsNull(ue_time_zone) ? ogs_strdup(ue_time_zone->valuestring) : NULL, add_ue_location ? add_ue_location_local_nonprim : NULL, assigned_ebi_list ? assigned_ebi_listList : NULL, failed_to_assign_ebi_list ? failed_to_assign_ebi_listList : NULL, @@ -724,6 +737,97 @@ OpenAPI_vsmf_updated_data_t *OpenAPI_vsmf_updated_data_parseFromJSON(cJSON *vsmf return vsmf_updated_data_local_var; end: + if (qos_flows_add_mod_listList) { + OpenAPI_list_for_each(qos_flows_add_mod_listList, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(qos_flows_add_mod_listList); + qos_flows_add_mod_listList = NULL; + } + if (qos_flows_rel_listList) { + OpenAPI_list_for_each(qos_flows_rel_listList, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(qos_flows_rel_listList); + qos_flows_rel_listList = NULL; + } + if (qos_flows_failedto_add_mod_listList) { + OpenAPI_list_for_each(qos_flows_failedto_add_mod_listList, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(qos_flows_failedto_add_mod_listList); + qos_flows_failedto_add_mod_listList = NULL; + } + if (qos_flows_failedto_rel_listList) { + OpenAPI_list_for_each(qos_flows_failedto_rel_listList, node) { + OpenAPI_qos_flow_item_free(node->data); + } + OpenAPI_list_free(qos_flows_failedto_rel_listList); + qos_flows_failedto_rel_listList = NULL; + } + if (n1_sm_info_from_ue_local_nonprim) { + OpenAPI_ref_to_binary_data_free(n1_sm_info_from_ue_local_nonprim); + n1_sm_info_from_ue_local_nonprim = NULL; + } + if (unknown_n1_sm_info_local_nonprim) { + OpenAPI_ref_to_binary_data_free(unknown_n1_sm_info_local_nonprim); + unknown_n1_sm_info_local_nonprim = NULL; + } + if (ue_location_local_nonprim) { + OpenAPI_user_location_free(ue_location_local_nonprim); + ue_location_local_nonprim = NULL; + } + if (add_ue_location_local_nonprim) { + OpenAPI_user_location_free(add_ue_location_local_nonprim); + add_ue_location_local_nonprim = NULL; + } + if (assigned_ebi_listList) { + OpenAPI_list_for_each(assigned_ebi_listList, node) { + OpenAPI_ebi_arp_mapping_free(node->data); + } + OpenAPI_list_free(assigned_ebi_listList); + assigned_ebi_listList = NULL; + } + if (failed_to_assign_ebi_listList) { + OpenAPI_list_for_each(failed_to_assign_ebi_listList, node) { + OpenAPI_arp_free(node->data); + } + OpenAPI_list_free(failed_to_assign_ebi_listList); + failed_to_assign_ebi_listList = NULL; + } + if (released_ebi_listList) { + OpenAPI_list_for_each(released_ebi_listList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(released_ebi_listList); + released_ebi_listList = NULL; + } + if (secondary_rat_usage_reportList) { + OpenAPI_list_for_each(secondary_rat_usage_reportList, node) { + OpenAPI_secondary_rat_usage_report_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_reportList); + secondary_rat_usage_reportList = NULL; + } + if (secondary_rat_usage_infoList) { + OpenAPI_list_for_each(secondary_rat_usage_infoList, node) { + OpenAPI_secondary_rat_usage_info_free(node->data); + } + OpenAPI_list_free(secondary_rat_usage_infoList); + secondary_rat_usage_infoList = NULL; + } + if (n4_info_local_nonprim) { + OpenAPI_n4_information_free(n4_info_local_nonprim); + n4_info_local_nonprim = NULL; + } + if (n4_info_ext1_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext1_local_nonprim); + n4_info_ext1_local_nonprim = NULL; + } + if (n4_info_ext2_local_nonprim) { + OpenAPI_n4_information_free(n4_info_ext2_local_nonprim); + n4_info_ext2_local_nonprim = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/w_agf_info.c b/lib/sbi/openapi/model/w_agf_info.c index 86335c2ad..097c49b2f 100644 --- a/lib/sbi/openapi/model/w_agf_info.c +++ b/lib/sbi/openapi/model/w_agf_info.c @@ -22,25 +22,36 @@ OpenAPI_w_agf_info_t *OpenAPI_w_agf_info_create( void OpenAPI_w_agf_info_free(OpenAPI_w_agf_info_t *w_agf_info) { + OpenAPI_lnode_t *node = NULL; + if (NULL == w_agf_info) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(w_agf_info->ipv4_endpoint_addresses, node) { - ogs_free(node->data); + if (w_agf_info->ipv4_endpoint_addresses) { + OpenAPI_list_for_each(w_agf_info->ipv4_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(w_agf_info->ipv4_endpoint_addresses); + w_agf_info->ipv4_endpoint_addresses = NULL; } - OpenAPI_list_free(w_agf_info->ipv4_endpoint_addresses); - OpenAPI_list_for_each(w_agf_info->ipv6_endpoint_addresses, node) { - ogs_free(node->data); + if (w_agf_info->ipv6_endpoint_addresses) { + OpenAPI_list_for_each(w_agf_info->ipv6_endpoint_addresses, node) { + ogs_free(node->data); + } + OpenAPI_list_free(w_agf_info->ipv6_endpoint_addresses); + w_agf_info->ipv6_endpoint_addresses = NULL; + } + if (w_agf_info->endpoint_fqdn) { + ogs_free(w_agf_info->endpoint_fqdn); + w_agf_info->endpoint_fqdn = NULL; } - OpenAPI_list_free(w_agf_info->ipv6_endpoint_addresses); - ogs_free(w_agf_info->endpoint_fqdn); ogs_free(w_agf_info); } cJSON *OpenAPI_w_agf_info_convertToJSON(OpenAPI_w_agf_info_t *w_agf_info) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (w_agf_info == NULL) { ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [WAgfInfo]"); @@ -49,35 +60,31 @@ cJSON *OpenAPI_w_agf_info_convertToJSON(OpenAPI_w_agf_info_t *w_agf_info) item = cJSON_CreateObject(); if (w_agf_info->ipv4_endpoint_addresses) { - cJSON *ipv4_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); - if (ipv4_endpoint_addresses == NULL) { + cJSON *ipv4_endpoint_addressesList = cJSON_AddArrayToObject(item, "ipv4EndpointAddresses"); + if (ipv4_endpoint_addressesList == NULL) { ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv4_endpoint_addresses_node; - OpenAPI_list_for_each(w_agf_info->ipv4_endpoint_addresses, ipv4_endpoint_addresses_node) { - if (cJSON_AddStringToObject(ipv4_endpoint_addresses, "", (char*)ipv4_endpoint_addresses_node->data) == NULL) { - ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); - goto end; + OpenAPI_list_for_each(w_agf_info->ipv4_endpoint_addresses, node) { + if (cJSON_AddStringToObject(ipv4_endpoint_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } } - } } if (w_agf_info->ipv6_endpoint_addresses) { - cJSON *ipv6_endpoint_addresses = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); - if (ipv6_endpoint_addresses == NULL) { + cJSON *ipv6_endpoint_addressesList = cJSON_AddArrayToObject(item, "ipv6EndpointAddresses"); + if (ipv6_endpoint_addressesList == NULL) { ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); goto end; } - - OpenAPI_lnode_t *ipv6_endpoint_addresses_node; - OpenAPI_list_for_each(w_agf_info->ipv6_endpoint_addresses, ipv6_endpoint_addresses_node) { - if (cJSON_AddStringToObject(ipv6_endpoint_addresses, "", (char*)ipv6_endpoint_addresses_node->data) == NULL) { - ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); - goto end; + OpenAPI_list_for_each(w_agf_info->ipv6_endpoint_addresses, node) { + if (cJSON_AddStringToObject(ipv6_endpoint_addressesList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_w_agf_info_convertToJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } } - } } if (w_agf_info->endpoint_fqdn) { @@ -94,50 +101,57 @@ end: OpenAPI_w_agf_info_t *OpenAPI_w_agf_info_parseFromJSON(cJSON *w_agf_infoJSON) { OpenAPI_w_agf_info_t *w_agf_info_local_var = NULL; - cJSON *ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "ipv4EndpointAddresses"); - - OpenAPI_list_t *ipv4_endpoint_addressesList; + OpenAPI_lnode_t *node = NULL; + cJSON *ipv4_endpoint_addresses = NULL; + OpenAPI_list_t *ipv4_endpoint_addressesList = NULL; + cJSON *ipv6_endpoint_addresses = NULL; + OpenAPI_list_t *ipv6_endpoint_addressesList = NULL; + cJSON *endpoint_fqdn = NULL; + ipv4_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "ipv4EndpointAddresses"); if (ipv4_endpoint_addresses) { - cJSON *ipv4_endpoint_addresses_local; - if (!cJSON_IsArray(ipv4_endpoint_addresses)) { - ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); - goto end; - } - ipv4_endpoint_addressesList = OpenAPI_list_create(); + cJSON *ipv4_endpoint_addresses_local = NULL; + if (!cJSON_IsArray(ipv4_endpoint_addresses)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { - if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { - ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); - goto end; - } - OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); - } + ipv4_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv4_endpoint_addresses_local, ipv4_endpoint_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv4_endpoint_addresses_local)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv4_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv4_endpoint_addressesList, ogs_strdup(ipv4_endpoint_addresses_local->valuestring)); + } } - cJSON *ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "ipv6EndpointAddresses"); - - OpenAPI_list_t *ipv6_endpoint_addressesList; + ipv6_endpoint_addresses = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "ipv6EndpointAddresses"); if (ipv6_endpoint_addresses) { - cJSON *ipv6_endpoint_addresses_local; - if (!cJSON_IsArray(ipv6_endpoint_addresses)) { - ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); - goto end; - } - ipv6_endpoint_addressesList = OpenAPI_list_create(); + cJSON *ipv6_endpoint_addresses_local = NULL; + if (!cJSON_IsArray(ipv6_endpoint_addresses)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } - cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { - if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { - ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); - goto end; - } - OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); - } + ipv6_endpoint_addressesList = OpenAPI_list_create(); + + cJSON_ArrayForEach(ipv6_endpoint_addresses_local, ipv6_endpoint_addresses) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(ipv6_endpoint_addresses_local)) { + ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [ipv6_endpoint_addresses]"); + goto end; + } + OpenAPI_list_add(ipv6_endpoint_addressesList, ogs_strdup(ipv6_endpoint_addresses_local->valuestring)); + } } - cJSON *endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "endpointFqdn"); - + endpoint_fqdn = cJSON_GetObjectItemCaseSensitive(w_agf_infoJSON, "endpointFqdn"); if (endpoint_fqdn) { - if (!cJSON_IsString(endpoint_fqdn)) { + if (!cJSON_IsString(endpoint_fqdn) && !cJSON_IsNull(endpoint_fqdn)) { ogs_error("OpenAPI_w_agf_info_parseFromJSON() failed [endpoint_fqdn]"); goto end; } @@ -146,11 +160,25 @@ OpenAPI_w_agf_info_t *OpenAPI_w_agf_info_parseFromJSON(cJSON *w_agf_infoJSON) w_agf_info_local_var = OpenAPI_w_agf_info_create ( ipv4_endpoint_addresses ? ipv4_endpoint_addressesList : NULL, ipv6_endpoint_addresses ? ipv6_endpoint_addressesList : NULL, - endpoint_fqdn ? ogs_strdup(endpoint_fqdn->valuestring) : NULL + endpoint_fqdn && !cJSON_IsNull(endpoint_fqdn) ? ogs_strdup(endpoint_fqdn->valuestring) : NULL ); return w_agf_info_local_var; end: + if (ipv4_endpoint_addressesList) { + OpenAPI_list_for_each(ipv4_endpoint_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv4_endpoint_addressesList); + ipv4_endpoint_addressesList = NULL; + } + if (ipv6_endpoint_addressesList) { + OpenAPI_list_for_each(ipv6_endpoint_addressesList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(ipv6_endpoint_addressesList); + ipv6_endpoint_addressesList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/wireline_area.c b/lib/sbi/openapi/model/wireline_area.c index 16b47ddec..f931da5ef 100644 --- a/lib/sbi/openapi/model/wireline_area.c +++ b/lib/sbi/openapi/model/wireline_area.c @@ -24,26 +24,40 @@ OpenAPI_wireline_area_t *OpenAPI_wireline_area_create( void OpenAPI_wireline_area_free(OpenAPI_wireline_area_t *wireline_area) { + OpenAPI_lnode_t *node = NULL; + if (NULL == wireline_area) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(wireline_area->global_line_ids, node) { - ogs_free(node->data); + if (wireline_area->global_line_ids) { + OpenAPI_list_for_each(wireline_area->global_line_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(wireline_area->global_line_ids); + wireline_area->global_line_ids = NULL; } - OpenAPI_list_free(wireline_area->global_line_ids); - OpenAPI_list_for_each(wireline_area->hfc_n_ids, node) { - ogs_free(node->data); + if (wireline_area->hfc_n_ids) { + OpenAPI_list_for_each(wireline_area->hfc_n_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(wireline_area->hfc_n_ids); + wireline_area->hfc_n_ids = NULL; + } + if (wireline_area->area_code_b) { + ogs_free(wireline_area->area_code_b); + wireline_area->area_code_b = NULL; + } + if (wireline_area->area_code_c) { + ogs_free(wireline_area->area_code_c); + wireline_area->area_code_c = NULL; } - OpenAPI_list_free(wireline_area->hfc_n_ids); - ogs_free(wireline_area->area_code_b); - ogs_free(wireline_area->area_code_c); ogs_free(wireline_area); } cJSON *OpenAPI_wireline_area_convertToJSON(OpenAPI_wireline_area_t *wireline_area) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (wireline_area == NULL) { ogs_error("OpenAPI_wireline_area_convertToJSON() failed [WirelineArea]"); @@ -52,35 +66,31 @@ cJSON *OpenAPI_wireline_area_convertToJSON(OpenAPI_wireline_area_t *wireline_are item = cJSON_CreateObject(); if (wireline_area->global_line_ids) { - cJSON *global_line_ids = cJSON_AddArrayToObject(item, "globalLineIds"); - if (global_line_ids == NULL) { + cJSON *global_line_idsList = cJSON_AddArrayToObject(item, "globalLineIds"); + if (global_line_idsList == NULL) { ogs_error("OpenAPI_wireline_area_convertToJSON() failed [global_line_ids]"); goto end; } - - OpenAPI_lnode_t *global_line_ids_node; - OpenAPI_list_for_each(wireline_area->global_line_ids, global_line_ids_node) { - if (cJSON_AddStringToObject(global_line_ids, "", (char*)global_line_ids_node->data) == NULL) { - ogs_error("OpenAPI_wireline_area_convertToJSON() failed [global_line_ids]"); - goto end; + OpenAPI_list_for_each(wireline_area->global_line_ids, node) { + if (cJSON_AddStringToObject(global_line_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_wireline_area_convertToJSON() failed [global_line_ids]"); + goto end; + } } - } } if (wireline_area->hfc_n_ids) { - cJSON *hfc_n_ids = cJSON_AddArrayToObject(item, "hfcNIds"); - if (hfc_n_ids == NULL) { + cJSON *hfc_n_idsList = cJSON_AddArrayToObject(item, "hfcNIds"); + if (hfc_n_idsList == NULL) { ogs_error("OpenAPI_wireline_area_convertToJSON() failed [hfc_n_ids]"); goto end; } - - OpenAPI_lnode_t *hfc_n_ids_node; - OpenAPI_list_for_each(wireline_area->hfc_n_ids, hfc_n_ids_node) { - if (cJSON_AddStringToObject(hfc_n_ids, "", (char*)hfc_n_ids_node->data) == NULL) { - ogs_error("OpenAPI_wireline_area_convertToJSON() failed [hfc_n_ids]"); - goto end; + OpenAPI_list_for_each(wireline_area->hfc_n_ids, node) { + if (cJSON_AddStringToObject(hfc_n_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_wireline_area_convertToJSON() failed [hfc_n_ids]"); + goto end; + } } - } } if (wireline_area->area_code_b) { @@ -104,59 +114,66 @@ end: OpenAPI_wireline_area_t *OpenAPI_wireline_area_parseFromJSON(cJSON *wireline_areaJSON) { OpenAPI_wireline_area_t *wireline_area_local_var = NULL; - cJSON *global_line_ids = cJSON_GetObjectItemCaseSensitive(wireline_areaJSON, "globalLineIds"); - - OpenAPI_list_t *global_line_idsList; + OpenAPI_lnode_t *node = NULL; + cJSON *global_line_ids = NULL; + OpenAPI_list_t *global_line_idsList = NULL; + cJSON *hfc_n_ids = NULL; + OpenAPI_list_t *hfc_n_idsList = NULL; + cJSON *area_code_b = NULL; + cJSON *area_code_c = NULL; + global_line_ids = cJSON_GetObjectItemCaseSensitive(wireline_areaJSON, "globalLineIds"); if (global_line_ids) { - cJSON *global_line_ids_local; - if (!cJSON_IsArray(global_line_ids)) { - ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [global_line_ids]"); - goto end; - } - global_line_idsList = OpenAPI_list_create(); + cJSON *global_line_ids_local = NULL; + if (!cJSON_IsArray(global_line_ids)) { + ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [global_line_ids]"); + goto end; + } - cJSON_ArrayForEach(global_line_ids_local, global_line_ids) { - if (!cJSON_IsString(global_line_ids_local)) { - ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [global_line_ids]"); - goto end; - } - OpenAPI_list_add(global_line_idsList, ogs_strdup(global_line_ids_local->valuestring)); - } + global_line_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(global_line_ids_local, global_line_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(global_line_ids_local)) { + ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [global_line_ids]"); + goto end; + } + OpenAPI_list_add(global_line_idsList, ogs_strdup(global_line_ids_local->valuestring)); + } } - cJSON *hfc_n_ids = cJSON_GetObjectItemCaseSensitive(wireline_areaJSON, "hfcNIds"); - - OpenAPI_list_t *hfc_n_idsList; + hfc_n_ids = cJSON_GetObjectItemCaseSensitive(wireline_areaJSON, "hfcNIds"); if (hfc_n_ids) { - cJSON *hfc_n_ids_local; - if (!cJSON_IsArray(hfc_n_ids)) { - ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [hfc_n_ids]"); - goto end; - } - hfc_n_idsList = OpenAPI_list_create(); + cJSON *hfc_n_ids_local = NULL; + if (!cJSON_IsArray(hfc_n_ids)) { + ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [hfc_n_ids]"); + goto end; + } - cJSON_ArrayForEach(hfc_n_ids_local, hfc_n_ids) { - if (!cJSON_IsString(hfc_n_ids_local)) { - ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [hfc_n_ids]"); - goto end; - } - OpenAPI_list_add(hfc_n_idsList, ogs_strdup(hfc_n_ids_local->valuestring)); - } + hfc_n_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(hfc_n_ids_local, hfc_n_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(hfc_n_ids_local)) { + ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [hfc_n_ids]"); + goto end; + } + OpenAPI_list_add(hfc_n_idsList, ogs_strdup(hfc_n_ids_local->valuestring)); + } } - cJSON *area_code_b = cJSON_GetObjectItemCaseSensitive(wireline_areaJSON, "areaCodeB"); - + area_code_b = cJSON_GetObjectItemCaseSensitive(wireline_areaJSON, "areaCodeB"); if (area_code_b) { - if (!cJSON_IsString(area_code_b)) { + if (!cJSON_IsString(area_code_b) && !cJSON_IsNull(area_code_b)) { ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [area_code_b]"); goto end; } } - cJSON *area_code_c = cJSON_GetObjectItemCaseSensitive(wireline_areaJSON, "areaCodeC"); - + area_code_c = cJSON_GetObjectItemCaseSensitive(wireline_areaJSON, "areaCodeC"); if (area_code_c) { - if (!cJSON_IsString(area_code_c)) { + if (!cJSON_IsString(area_code_c) && !cJSON_IsNull(area_code_c)) { ogs_error("OpenAPI_wireline_area_parseFromJSON() failed [area_code_c]"); goto end; } @@ -165,12 +182,26 @@ OpenAPI_wireline_area_t *OpenAPI_wireline_area_parseFromJSON(cJSON *wireline_are wireline_area_local_var = OpenAPI_wireline_area_create ( global_line_ids ? global_line_idsList : NULL, hfc_n_ids ? hfc_n_idsList : NULL, - area_code_b ? ogs_strdup(area_code_b->valuestring) : NULL, - area_code_c ? ogs_strdup(area_code_c->valuestring) : NULL + area_code_b && !cJSON_IsNull(area_code_b) ? ogs_strdup(area_code_b->valuestring) : NULL, + area_code_c && !cJSON_IsNull(area_code_c) ? ogs_strdup(area_code_c->valuestring) : NULL ); return wireline_area_local_var; end: + if (global_line_idsList) { + OpenAPI_list_for_each(global_line_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(global_line_idsList); + global_line_idsList = NULL; + } + if (hfc_n_idsList) { + OpenAPI_list_for_each(hfc_n_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(hfc_n_idsList); + hfc_n_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/wireline_area_1.c b/lib/sbi/openapi/model/wireline_area_1.c index 23f0450c4..c000f5cef 100644 --- a/lib/sbi/openapi/model/wireline_area_1.c +++ b/lib/sbi/openapi/model/wireline_area_1.c @@ -24,26 +24,40 @@ OpenAPI_wireline_area_1_t *OpenAPI_wireline_area_1_create( void OpenAPI_wireline_area_1_free(OpenAPI_wireline_area_1_t *wireline_area_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == wireline_area_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(wireline_area_1->global_line_ids, node) { - ogs_free(node->data); + if (wireline_area_1->global_line_ids) { + OpenAPI_list_for_each(wireline_area_1->global_line_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(wireline_area_1->global_line_ids); + wireline_area_1->global_line_ids = NULL; } - OpenAPI_list_free(wireline_area_1->global_line_ids); - OpenAPI_list_for_each(wireline_area_1->hfc_n_ids, node) { - ogs_free(node->data); + if (wireline_area_1->hfc_n_ids) { + OpenAPI_list_for_each(wireline_area_1->hfc_n_ids, node) { + ogs_free(node->data); + } + OpenAPI_list_free(wireline_area_1->hfc_n_ids); + wireline_area_1->hfc_n_ids = NULL; + } + if (wireline_area_1->area_code_b) { + ogs_free(wireline_area_1->area_code_b); + wireline_area_1->area_code_b = NULL; + } + if (wireline_area_1->area_code_c) { + ogs_free(wireline_area_1->area_code_c); + wireline_area_1->area_code_c = NULL; } - OpenAPI_list_free(wireline_area_1->hfc_n_ids); - ogs_free(wireline_area_1->area_code_b); - ogs_free(wireline_area_1->area_code_c); ogs_free(wireline_area_1); } cJSON *OpenAPI_wireline_area_1_convertToJSON(OpenAPI_wireline_area_1_t *wireline_area_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (wireline_area_1 == NULL) { ogs_error("OpenAPI_wireline_area_1_convertToJSON() failed [WirelineArea_1]"); @@ -52,35 +66,31 @@ cJSON *OpenAPI_wireline_area_1_convertToJSON(OpenAPI_wireline_area_1_t *wireline item = cJSON_CreateObject(); if (wireline_area_1->global_line_ids) { - cJSON *global_line_ids = cJSON_AddArrayToObject(item, "globalLineIds"); - if (global_line_ids == NULL) { + cJSON *global_line_idsList = cJSON_AddArrayToObject(item, "globalLineIds"); + if (global_line_idsList == NULL) { ogs_error("OpenAPI_wireline_area_1_convertToJSON() failed [global_line_ids]"); goto end; } - - OpenAPI_lnode_t *global_line_ids_node; - OpenAPI_list_for_each(wireline_area_1->global_line_ids, global_line_ids_node) { - if (cJSON_AddStringToObject(global_line_ids, "", (char*)global_line_ids_node->data) == NULL) { - ogs_error("OpenAPI_wireline_area_1_convertToJSON() failed [global_line_ids]"); - goto end; + OpenAPI_list_for_each(wireline_area_1->global_line_ids, node) { + if (cJSON_AddStringToObject(global_line_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_wireline_area_1_convertToJSON() failed [global_line_ids]"); + goto end; + } } - } } if (wireline_area_1->hfc_n_ids) { - cJSON *hfc_n_ids = cJSON_AddArrayToObject(item, "hfcNIds"); - if (hfc_n_ids == NULL) { + cJSON *hfc_n_idsList = cJSON_AddArrayToObject(item, "hfcNIds"); + if (hfc_n_idsList == NULL) { ogs_error("OpenAPI_wireline_area_1_convertToJSON() failed [hfc_n_ids]"); goto end; } - - OpenAPI_lnode_t *hfc_n_ids_node; - OpenAPI_list_for_each(wireline_area_1->hfc_n_ids, hfc_n_ids_node) { - if (cJSON_AddStringToObject(hfc_n_ids, "", (char*)hfc_n_ids_node->data) == NULL) { - ogs_error("OpenAPI_wireline_area_1_convertToJSON() failed [hfc_n_ids]"); - goto end; + OpenAPI_list_for_each(wireline_area_1->hfc_n_ids, node) { + if (cJSON_AddStringToObject(hfc_n_idsList, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_wireline_area_1_convertToJSON() failed [hfc_n_ids]"); + goto end; + } } - } } if (wireline_area_1->area_code_b) { @@ -104,59 +114,66 @@ end: OpenAPI_wireline_area_1_t *OpenAPI_wireline_area_1_parseFromJSON(cJSON *wireline_area_1JSON) { OpenAPI_wireline_area_1_t *wireline_area_1_local_var = NULL; - cJSON *global_line_ids = cJSON_GetObjectItemCaseSensitive(wireline_area_1JSON, "globalLineIds"); - - OpenAPI_list_t *global_line_idsList; + OpenAPI_lnode_t *node = NULL; + cJSON *global_line_ids = NULL; + OpenAPI_list_t *global_line_idsList = NULL; + cJSON *hfc_n_ids = NULL; + OpenAPI_list_t *hfc_n_idsList = NULL; + cJSON *area_code_b = NULL; + cJSON *area_code_c = NULL; + global_line_ids = cJSON_GetObjectItemCaseSensitive(wireline_area_1JSON, "globalLineIds"); if (global_line_ids) { - cJSON *global_line_ids_local; - if (!cJSON_IsArray(global_line_ids)) { - ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [global_line_ids]"); - goto end; - } - global_line_idsList = OpenAPI_list_create(); + cJSON *global_line_ids_local = NULL; + if (!cJSON_IsArray(global_line_ids)) { + ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [global_line_ids]"); + goto end; + } - cJSON_ArrayForEach(global_line_ids_local, global_line_ids) { - if (!cJSON_IsString(global_line_ids_local)) { - ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [global_line_ids]"); - goto end; - } - OpenAPI_list_add(global_line_idsList, ogs_strdup(global_line_ids_local->valuestring)); - } + global_line_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(global_line_ids_local, global_line_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(global_line_ids_local)) { + ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [global_line_ids]"); + goto end; + } + OpenAPI_list_add(global_line_idsList, ogs_strdup(global_line_ids_local->valuestring)); + } } - cJSON *hfc_n_ids = cJSON_GetObjectItemCaseSensitive(wireline_area_1JSON, "hfcNIds"); - - OpenAPI_list_t *hfc_n_idsList; + hfc_n_ids = cJSON_GetObjectItemCaseSensitive(wireline_area_1JSON, "hfcNIds"); if (hfc_n_ids) { - cJSON *hfc_n_ids_local; - if (!cJSON_IsArray(hfc_n_ids)) { - ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [hfc_n_ids]"); - goto end; - } - hfc_n_idsList = OpenAPI_list_create(); + cJSON *hfc_n_ids_local = NULL; + if (!cJSON_IsArray(hfc_n_ids)) { + ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [hfc_n_ids]"); + goto end; + } - cJSON_ArrayForEach(hfc_n_ids_local, hfc_n_ids) { - if (!cJSON_IsString(hfc_n_ids_local)) { - ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [hfc_n_ids]"); - goto end; - } - OpenAPI_list_add(hfc_n_idsList, ogs_strdup(hfc_n_ids_local->valuestring)); - } + hfc_n_idsList = OpenAPI_list_create(); + + cJSON_ArrayForEach(hfc_n_ids_local, hfc_n_ids) { + double *localDouble = NULL; + int *localInt = NULL; + if (!cJSON_IsString(hfc_n_ids_local)) { + ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [hfc_n_ids]"); + goto end; + } + OpenAPI_list_add(hfc_n_idsList, ogs_strdup(hfc_n_ids_local->valuestring)); + } } - cJSON *area_code_b = cJSON_GetObjectItemCaseSensitive(wireline_area_1JSON, "areaCodeB"); - + area_code_b = cJSON_GetObjectItemCaseSensitive(wireline_area_1JSON, "areaCodeB"); if (area_code_b) { - if (!cJSON_IsString(area_code_b)) { + if (!cJSON_IsString(area_code_b) && !cJSON_IsNull(area_code_b)) { ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [area_code_b]"); goto end; } } - cJSON *area_code_c = cJSON_GetObjectItemCaseSensitive(wireline_area_1JSON, "areaCodeC"); - + area_code_c = cJSON_GetObjectItemCaseSensitive(wireline_area_1JSON, "areaCodeC"); if (area_code_c) { - if (!cJSON_IsString(area_code_c)) { + if (!cJSON_IsString(area_code_c) && !cJSON_IsNull(area_code_c)) { ogs_error("OpenAPI_wireline_area_1_parseFromJSON() failed [area_code_c]"); goto end; } @@ -165,12 +182,26 @@ OpenAPI_wireline_area_1_t *OpenAPI_wireline_area_1_parseFromJSON(cJSON *wireline wireline_area_1_local_var = OpenAPI_wireline_area_1_create ( global_line_ids ? global_line_idsList : NULL, hfc_n_ids ? hfc_n_idsList : NULL, - area_code_b ? ogs_strdup(area_code_b->valuestring) : NULL, - area_code_c ? ogs_strdup(area_code_c->valuestring) : NULL + area_code_b && !cJSON_IsNull(area_code_b) ? ogs_strdup(area_code_b->valuestring) : NULL, + area_code_c && !cJSON_IsNull(area_code_c) ? ogs_strdup(area_code_c->valuestring) : NULL ); return wireline_area_1_local_var; end: + if (global_line_idsList) { + OpenAPI_list_for_each(global_line_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(global_line_idsList); + global_line_idsList = NULL; + } + if (hfc_n_idsList) { + OpenAPI_list_for_each(hfc_n_idsList, node) { + ogs_free(node->data); + } + OpenAPI_list_free(hfc_n_idsList); + hfc_n_idsList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/wireline_service_area_restriction.c b/lib/sbi/openapi/model/wireline_service_area_restriction.c index 07e8f8960..6350617c1 100644 --- a/lib/sbi/openapi/model/wireline_service_area_restriction.c +++ b/lib/sbi/openapi/model/wireline_service_area_restriction.c @@ -20,20 +20,25 @@ OpenAPI_wireline_service_area_restriction_t *OpenAPI_wireline_service_area_restr void OpenAPI_wireline_service_area_restriction_free(OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction) { + OpenAPI_lnode_t *node = NULL; + if (NULL == wireline_service_area_restriction) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(wireline_service_area_restriction->areas, node) { - OpenAPI_wireline_area_free(node->data); + if (wireline_service_area_restriction->areas) { + OpenAPI_list_for_each(wireline_service_area_restriction->areas, node) { + OpenAPI_wireline_area_free(node->data); + } + OpenAPI_list_free(wireline_service_area_restriction->areas); + wireline_service_area_restriction->areas = NULL; } - OpenAPI_list_free(wireline_service_area_restriction->areas); ogs_free(wireline_service_area_restriction); } cJSON *OpenAPI_wireline_service_area_restriction_convertToJSON(OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (wireline_service_area_restriction == NULL) { ogs_error("OpenAPI_wireline_service_area_restriction_convertToJSON() failed [WirelineServiceAreaRestriction]"); @@ -41,7 +46,7 @@ cJSON *OpenAPI_wireline_service_area_restriction_convertToJSON(OpenAPI_wireline_ } item = cJSON_CreateObject(); - if (wireline_service_area_restriction->restriction_type) { + if (wireline_service_area_restriction->restriction_type != OpenAPI_restriction_type_NULL) { if (cJSON_AddStringToObject(item, "restrictionType", OpenAPI_restriction_type_ToString(wireline_service_area_restriction->restriction_type)) == NULL) { ogs_error("OpenAPI_wireline_service_area_restriction_convertToJSON() failed [restriction_type]"); goto end; @@ -54,17 +59,13 @@ cJSON *OpenAPI_wireline_service_area_restriction_convertToJSON(OpenAPI_wireline_ ogs_error("OpenAPI_wireline_service_area_restriction_convertToJSON() failed [areas]"); goto end; } - - OpenAPI_lnode_t *areas_node; - if (wireline_service_area_restriction->areas) { - OpenAPI_list_for_each(wireline_service_area_restriction->areas, areas_node) { - cJSON *itemLocal = OpenAPI_wireline_area_convertToJSON(areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_wireline_service_area_restriction_convertToJSON() failed [areas]"); - goto end; - } - cJSON_AddItemToArray(areasList, itemLocal); + OpenAPI_list_for_each(wireline_service_area_restriction->areas, node) { + cJSON *itemLocal = OpenAPI_wireline_area_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_wireline_service_area_restriction_convertToJSON() failed [areas]"); + goto end; } + cJSON_AddItemToArray(areasList, itemLocal); } } @@ -75,9 +76,12 @@ end: OpenAPI_wireline_service_area_restriction_t *OpenAPI_wireline_service_area_restriction_parseFromJSON(cJSON *wireline_service_area_restrictionJSON) { OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction_local_var = NULL; - cJSON *restriction_type = cJSON_GetObjectItemCaseSensitive(wireline_service_area_restrictionJSON, "restrictionType"); - - OpenAPI_restriction_type_e restriction_typeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *restriction_type = NULL; + OpenAPI_restriction_type_e restriction_typeVariable = 0; + cJSON *areas = NULL; + OpenAPI_list_t *areasList = NULL; + restriction_type = cJSON_GetObjectItemCaseSensitive(wireline_service_area_restrictionJSON, "restrictionType"); if (restriction_type) { if (!cJSON_IsString(restriction_type)) { ogs_error("OpenAPI_wireline_service_area_restriction_parseFromJSON() failed [restriction_type]"); @@ -86,33 +90,29 @@ OpenAPI_wireline_service_area_restriction_t *OpenAPI_wireline_service_area_restr restriction_typeVariable = OpenAPI_restriction_type_FromString(restriction_type->valuestring); } - cJSON *areas = cJSON_GetObjectItemCaseSensitive(wireline_service_area_restrictionJSON, "areas"); - - OpenAPI_list_t *areasList; + areas = cJSON_GetObjectItemCaseSensitive(wireline_service_area_restrictionJSON, "areas"); if (areas) { - cJSON *areas_local_nonprimitive; - if (!cJSON_IsArray(areas)){ - ogs_error("OpenAPI_wireline_service_area_restriction_parseFromJSON() failed [areas]"); - goto end; - } - - areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(areas_local_nonprimitive, areas ) { - if (!cJSON_IsObject(areas_local_nonprimitive)) { + cJSON *areas_local = NULL; + if (!cJSON_IsArray(areas)) { ogs_error("OpenAPI_wireline_service_area_restriction_parseFromJSON() failed [areas]"); goto end; } - OpenAPI_wireline_area_t *areasItem = OpenAPI_wireline_area_parseFromJSON(areas_local_nonprimitive); - if (!areasItem) { - ogs_error("No areasItem"); - OpenAPI_list_free(areasList); - goto end; + areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(areas_local, areas) { + if (!cJSON_IsObject(areas_local)) { + ogs_error("OpenAPI_wireline_service_area_restriction_parseFromJSON() failed [areas]"); + goto end; + } + OpenAPI_wireline_area_t *areasItem = OpenAPI_wireline_area_parseFromJSON(areas_local); + if (!areasItem) { + ogs_error("No areasItem"); + OpenAPI_list_free(areasList); + goto end; + } + OpenAPI_list_add(areasList, areasItem); } - - OpenAPI_list_add(areasList, areasItem); - } } wireline_service_area_restriction_local_var = OpenAPI_wireline_service_area_restriction_create ( @@ -122,6 +122,13 @@ OpenAPI_wireline_service_area_restriction_t *OpenAPI_wireline_service_area_restr return wireline_service_area_restriction_local_var; end: + if (areasList) { + OpenAPI_list_for_each(areasList, node) { + OpenAPI_wireline_area_free(node->data); + } + OpenAPI_list_free(areasList); + areasList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/model/wireline_service_area_restriction_1.c b/lib/sbi/openapi/model/wireline_service_area_restriction_1.c index cf68dc43f..2c608ae8d 100644 --- a/lib/sbi/openapi/model/wireline_service_area_restriction_1.c +++ b/lib/sbi/openapi/model/wireline_service_area_restriction_1.c @@ -20,20 +20,25 @@ OpenAPI_wireline_service_area_restriction_1_t *OpenAPI_wireline_service_area_res void OpenAPI_wireline_service_area_restriction_1_free(OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction_1) { + OpenAPI_lnode_t *node = NULL; + if (NULL == wireline_service_area_restriction_1) { return; } - OpenAPI_lnode_t *node; - OpenAPI_list_for_each(wireline_service_area_restriction_1->areas, node) { - OpenAPI_wireline_area_1_free(node->data); + if (wireline_service_area_restriction_1->areas) { + OpenAPI_list_for_each(wireline_service_area_restriction_1->areas, node) { + OpenAPI_wireline_area_1_free(node->data); + } + OpenAPI_list_free(wireline_service_area_restriction_1->areas); + wireline_service_area_restriction_1->areas = NULL; } - OpenAPI_list_free(wireline_service_area_restriction_1->areas); ogs_free(wireline_service_area_restriction_1); } cJSON *OpenAPI_wireline_service_area_restriction_1_convertToJSON(OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction_1) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if (wireline_service_area_restriction_1 == NULL) { ogs_error("OpenAPI_wireline_service_area_restriction_1_convertToJSON() failed [WirelineServiceAreaRestriction_1]"); @@ -41,7 +46,7 @@ cJSON *OpenAPI_wireline_service_area_restriction_1_convertToJSON(OpenAPI_wirelin } item = cJSON_CreateObject(); - if (wireline_service_area_restriction_1->restriction_type) { + if (wireline_service_area_restriction_1->restriction_type != OpenAPI_restriction_type_NULL) { if (cJSON_AddStringToObject(item, "restrictionType", OpenAPI_restriction_type_ToString(wireline_service_area_restriction_1->restriction_type)) == NULL) { ogs_error("OpenAPI_wireline_service_area_restriction_1_convertToJSON() failed [restriction_type]"); goto end; @@ -54,17 +59,13 @@ cJSON *OpenAPI_wireline_service_area_restriction_1_convertToJSON(OpenAPI_wirelin ogs_error("OpenAPI_wireline_service_area_restriction_1_convertToJSON() failed [areas]"); goto end; } - - OpenAPI_lnode_t *areas_node; - if (wireline_service_area_restriction_1->areas) { - OpenAPI_list_for_each(wireline_service_area_restriction_1->areas, areas_node) { - cJSON *itemLocal = OpenAPI_wireline_area_1_convertToJSON(areas_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_wireline_service_area_restriction_1_convertToJSON() failed [areas]"); - goto end; - } - cJSON_AddItemToArray(areasList, itemLocal); + OpenAPI_list_for_each(wireline_service_area_restriction_1->areas, node) { + cJSON *itemLocal = OpenAPI_wireline_area_1_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_wireline_service_area_restriction_1_convertToJSON() failed [areas]"); + goto end; } + cJSON_AddItemToArray(areasList, itemLocal); } } @@ -75,9 +76,12 @@ end: OpenAPI_wireline_service_area_restriction_1_t *OpenAPI_wireline_service_area_restriction_1_parseFromJSON(cJSON *wireline_service_area_restriction_1JSON) { OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction_1_local_var = NULL; - cJSON *restriction_type = cJSON_GetObjectItemCaseSensitive(wireline_service_area_restriction_1JSON, "restrictionType"); - - OpenAPI_restriction_type_e restriction_typeVariable; + OpenAPI_lnode_t *node = NULL; + cJSON *restriction_type = NULL; + OpenAPI_restriction_type_e restriction_typeVariable = 0; + cJSON *areas = NULL; + OpenAPI_list_t *areasList = NULL; + restriction_type = cJSON_GetObjectItemCaseSensitive(wireline_service_area_restriction_1JSON, "restrictionType"); if (restriction_type) { if (!cJSON_IsString(restriction_type)) { ogs_error("OpenAPI_wireline_service_area_restriction_1_parseFromJSON() failed [restriction_type]"); @@ -86,33 +90,29 @@ OpenAPI_wireline_service_area_restriction_1_t *OpenAPI_wireline_service_area_res restriction_typeVariable = OpenAPI_restriction_type_FromString(restriction_type->valuestring); } - cJSON *areas = cJSON_GetObjectItemCaseSensitive(wireline_service_area_restriction_1JSON, "areas"); - - OpenAPI_list_t *areasList; + areas = cJSON_GetObjectItemCaseSensitive(wireline_service_area_restriction_1JSON, "areas"); if (areas) { - cJSON *areas_local_nonprimitive; - if (!cJSON_IsArray(areas)){ - ogs_error("OpenAPI_wireline_service_area_restriction_1_parseFromJSON() failed [areas]"); - goto end; - } - - areasList = OpenAPI_list_create(); - - cJSON_ArrayForEach(areas_local_nonprimitive, areas ) { - if (!cJSON_IsObject(areas_local_nonprimitive)) { + cJSON *areas_local = NULL; + if (!cJSON_IsArray(areas)) { ogs_error("OpenAPI_wireline_service_area_restriction_1_parseFromJSON() failed [areas]"); goto end; } - OpenAPI_wireline_area_1_t *areasItem = OpenAPI_wireline_area_1_parseFromJSON(areas_local_nonprimitive); - if (!areasItem) { - ogs_error("No areasItem"); - OpenAPI_list_free(areasList); - goto end; + areasList = OpenAPI_list_create(); + + cJSON_ArrayForEach(areas_local, areas) { + if (!cJSON_IsObject(areas_local)) { + ogs_error("OpenAPI_wireline_service_area_restriction_1_parseFromJSON() failed [areas]"); + goto end; + } + OpenAPI_wireline_area_1_t *areasItem = OpenAPI_wireline_area_1_parseFromJSON(areas_local); + if (!areasItem) { + ogs_error("No areasItem"); + OpenAPI_list_free(areasList); + goto end; + } + OpenAPI_list_add(areasList, areasItem); } - - OpenAPI_list_add(areasList, areasItem); - } } wireline_service_area_restriction_1_local_var = OpenAPI_wireline_service_area_restriction_1_create ( @@ -122,6 +122,13 @@ OpenAPI_wireline_service_area_restriction_1_t *OpenAPI_wireline_service_area_res return wireline_service_area_restriction_1_local_var; end: + if (areasList) { + OpenAPI_list_for_each(areasList, node) { + OpenAPI_wireline_area_1_free(node->data); + } + OpenAPI_list_free(areasList); + areasList = NULL; + } return NULL; } diff --git a/lib/sbi/openapi/set.h b/lib/sbi/openapi/set.h new file mode 100644 index 000000000..1786a4f11 --- /dev/null +++ b/lib/sbi/openapi/set.h @@ -0,0 +1,14 @@ +#ifndef OGS_SBI_SET_H +#define OGS_SBI_SET_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_list_s OpenAPI_set_t; + +#ifdef __cplusplus +} +#endif + +#endif /* OGS_SBI_SET_H */ diff --git a/lib/sbi/support/r16-20210629-openapitools-5.2.0/README.md b/lib/sbi/support/r16-20210629-openapitools-5.2.0/README.md index b13e53550..3b6a33c9e 100644 --- a/lib/sbi/support/r16-20210629-openapitools-5.2.0/README.md +++ b/lib/sbi/support/r16-20210629-openapitools-5.2.0/README.md @@ -1,4 +1,6 @@ +### Ubuntu + * To install JDK(Java) $ sudo apt install default-jdk @@ -14,3 +16,19 @@ $ sudo npm install @openapitools/openapi-generator-cli -g $ Run generator $ openapi-generator-cli version-manager set 5.2.0 $ ./generator.sh + + +### MacOSX + +* To install JDK(Java) +$ brew install openjdk + +* To install Node.js +$ brew install node + +* To install OpenAPI Geneator +$ npm install @openapitools/openapi-generator-cli -g + +$ Run generator +$ openapi-generator-cli version-manager set 5.2.0 +$ ./generator.sh diff --git a/lib/sbi/support/r16-20230226-openapitools-6.4.0/README.md b/lib/sbi/support/r16-20230226-openapitools-6.4.0/README.md index ec0ccdc8d..aa994df70 100644 --- a/lib/sbi/support/r16-20230226-openapitools-6.4.0/README.md +++ b/lib/sbi/support/r16-20230226-openapitools-6.4.0/README.md @@ -1,4 +1,6 @@ +### Ubuntu + * To install JDK(Java) $ sudo apt install default-jdk @@ -14,3 +16,29 @@ $ sudo npm install @openapitools/openapi-generator-cli -g $ Run generator $ sudo openapi-generator-cli version-manager set 6.4.0 $ ./generator.sh + + +### MacOSX + +* To install JDK(Java) +$ brew install openjdk + +* To install Node.js +$ brew install node + +* To install OpenAPI Geneator +$ npm install @openapitools/openapi-generator-cli -g + +$ Run generator +$ openapi-generator-cli version-manager set 6.4.0 +$ ./generator.sh + + +### How to upgrade SBI + +1. Download the *.yaml from etsi.org +2. Copy *.yaml to standard/modified directory +3. Run ./generator.sh and check for openapi-generator-cli errors +4. If you copy the entire OLD version without ERROR to modified, + you can identify the problem. +5. Check the *.yaml below in the OLD version to apply the changes. diff --git a/lib/sbi/support/r16-20230226-openapitools-6.4.0/generator.sh b/lib/sbi/support/r16-20230226-openapitools-6.4.0/generator.sh index 41d84c470..d8ad9fa21 100755 --- a/lib/sbi/support/r16-20230226-openapitools-6.4.0/generator.sh +++ b/lib/sbi/support/r16-20230226-openapitools-6.4.0/generator.sh @@ -6,22 +6,17 @@ openapi_generator_cli="openapi-generator-cli" -$openapi_generator_cli generate -i ./modified/TS29521_Nbsf_Management.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29531_Nnssf_NSSelection.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29507_Npcf_AMPolicyControl.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29512_Npcf_SMPolicyControl.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29503_Nudm_SDM.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29503_Nudm_UECM.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29503_Nudm_UEAU.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29509_Nausf_UEAuthentication.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29510_Nnrf_NFDiscovery.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29510_Nnrf_NFManagement.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29504_Nudr_DR.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29502_Nsmf_PDUSession.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi -$openapi_generator_cli generate -i ./modified/TS29518_Namf_Communication.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi - -# 'AfEvent' Model was duplicated in TS29514_Npcf_PolicyAuthorization and -# TS29517_Naf_EventExposure.yaml. -# You should put TS29514_Npcf_PolicyAuthorization bottom to use 'AfEvent' -# in TS29514_Npcf_PolicyAuthorization, -$openapi_generator_cli generate -i ./modified/TS29514_Npcf_PolicyAuthorization.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi +$openapi_generator_cli generate -i ./modified/TS29504_Nudr_DR.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29521_Nbsf_Management.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29531_Nnssf_NSSelection.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29507_Npcf_AMPolicyControl.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29512_Npcf_SMPolicyControl.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29514_Npcf_PolicyAuthorization.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_SDM.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_UECM.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_UEAU.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29509_Nausf_UEAuthentication.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29502_Nsmf_PDUSession.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29518_Namf_Communication.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29510_Nnrf_NFDiscovery.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29510_Nnrf_NFManagement.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 diff --git a/lib/sbi/support/r16-20230226-openapitools-6.4.0/modified/TS29514_Npcf_PolicyAuthorization.yaml b/lib/sbi/support/r16-20230226-openapitools-6.4.0/modified/TS29514_Npcf_PolicyAuthorization.yaml index 80437101e..68dad224a 100644 --- a/lib/sbi/support/r16-20230226-openapitools-6.4.0/modified/TS29514_Npcf_PolicyAuthorization.yaml +++ b/lib/sbi/support/r16-20230226-openapitools-6.4.0/modified/TS29514_Npcf_PolicyAuthorization.yaml @@ -1161,7 +1161,8 @@ components: - event properties: event: - $ref: '#/components/schemas/AfEvent' +# $ref: '#/components/schemas/NpcfAfEvent' + $ref: '#/components/schemas/NpcfAfEvent' notifMethod: $ref: '#/components/schemas/AfNotifMethod' repPeriod: @@ -1175,7 +1176,8 @@ components: - event properties: event: - $ref: '#/components/schemas/AfEvent' +# $ref: '#/components/schemas/NpcfAfEvent' + $ref: '#/components/schemas/NpcfAfEvent' flows: type: array items: @@ -1657,7 +1659,8 @@ components: - SPONSOR_ENABLED # - type: string # - AfEvent: +# NpcfAfEvent: + NpcfAfEvent: # anyOf: # - type: string type: string diff --git a/lib/sbi/support/r16-20230226-openapitools-6.4.0/openapi-generator/templates/model-body.mustache b/lib/sbi/support/r16-20230226-openapitools-6.4.0/openapi-generator/templates/model-body.mustache index 016c38b4a..4621a94ec 100644 --- a/lib/sbi/support/r16-20230226-openapitools-6.4.0/openapi-generator/templates/model-body.mustache +++ b/lib/sbi/support/r16-20230226-openapitools-6.4.0/openapi-generator/templates/model-body.mustache @@ -93,6 +93,12 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create( OpenAPI_{{classVarName}}_{{name}}_e {{name}}{{^-last}},{{/-last}} {{/isEnum}} {{^isEnum}} + {{#isString}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isString}} + {{#isByteArray}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isByteArray}} {{#isNumeric}} {{^required}} bool is_{{name}}, @@ -105,13 +111,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create( {{/required}} {{datatype}} {{name}}{{^-last}},{{/-last}} {{/isBoolean}} - {{#isString}} - {{datatype}} *{{name}}{{^-last}},{{/-last}} - {{/isString}} {{/isEnum}} - {{#isByteArray}} - {{datatype}} *{{name}}{{^-last}},{{/-last}} - {{/isByteArray}} {{#isBinary}} OpenAPI_{{datatype}} {{name}}{{^-last}},{{/-last}} {{/isBinary}} @@ -161,10 +161,11 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create( void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}}) { + OpenAPI_lnode_t *node = NULL; + if (NULL == {{classname}}) { return; } - OpenAPI_lnode_t *node; {{#vars}} {{^isContainer}} {{^isPrimitiveType}} @@ -211,13 +212,13 @@ void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}}) {{classname}}->{{name}} = NULL; } {{/isString}} - {{/isEnum}} - {{#isByteArray}} + {{#isByteArray}} if ({{{classname}}}->{{{name}}}) { ogs_free({{{classname}}}->{{{name}}}); {{classname}}->{{name}} = NULL; } - {{/isByteArray}} + {{/isByteArray}} + {{/isEnum}} {{#isBinary}} if ({{{classname}}}->{{{name}}}) { ogs_free({{{classname}}}->{{{name}}}->data); @@ -260,12 +261,14 @@ void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}}) OpenAPI_list_for_each({{classname}}->{{name}}, node) { OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; ogs_free(localKeyValue->key); - {{#isPrimitiveType}} + {{^isEnum}} + {{#isPrimitiveType}} ogs_free(localKeyValue->value); - {{/isPrimitiveType}} - {{^isPrimitiveType}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} OpenAPI_{{complexType}}_free(localKeyValue->value); - {{/isPrimitiveType}} + {{/isPrimitiveType}} + {{/isEnum}} OpenAPI_map_free(localKeyValue); } OpenAPI_list_free({{classname}}->{{name}}); @@ -280,6 +283,7 @@ void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}}) cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}}) { cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; if ({{classname}} == NULL) { ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); @@ -346,6 +350,18 @@ cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname} } {{/isEnum}} {{^isEnum}} + {{#isString}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isString}} + {{#isByteArray}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isByteArray}} {{#isNumeric}} if (cJSON_AddNumberToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); @@ -358,19 +374,7 @@ cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname} goto end; } {{/isBoolean}} - {{#isString}} - if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isString}} {{/isEnum}} - {{#isByteArray}} - if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isByteArray}} {{#isBinary}} char* encoded_str_{{{name}}} = OpenAPI_base64encode({{{classname}}}->{{{name}}}->data,{{{classname}}}->{{{name}}}->len); if (cJSON_AddStringToObject(item, "{{{baseName}}}", encoded_str_{{{name}}}) == NULL) { @@ -455,72 +459,57 @@ cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname} {{/isContainer}} {{#isContainer}} {{#isArray}} - {{#isEnum}} - cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{baseName}}}"); - if ({{{name}}} == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - OpenAPI_lnode_t *{{{name}}}_node; - OpenAPI_list_for_each({{classname}}->{{{name}}}, {{{name}}}_node) { - if (cJSON_AddStringToObject({{{name}}}, "", OpenAPI_{{{complexType}}}_ToString((intptr_t){{{name}}}_node->data)) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - } - {{/isEnum}} - {{^isEnum}} - {{#isPrimitiveType}} - cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{baseName}}}"); - if ({{{name}}} == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - - OpenAPI_lnode_t *{{{name}}}_node; - OpenAPI_list_for_each({{{classname}}}->{{{name}}}, {{{name}}}_node) { - {{#items}} - {{#isString}} - if (cJSON_AddStringToObject({{{name}}}, "", (char*){{{name}}}_node->data) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isString}} - {{#isBoolean}} - if (cJSON_AddBoolToObject({{{name}}}, "", *(cJSON_bool *){{{name}}}_node->data) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isBoolean}} - {{#isNumeric}} - if (cJSON_AddNumberToObject({{{name}}}, "", *(double *){{{name}}}_node->data) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isNumeric}} - {{/items}} - } - {{/isPrimitiveType}} - {{^isPrimitiveType}} cJSON *{{{name}}}List = cJSON_AddArrayToObject(item, "{{{baseName}}}"); if ({{{name}}}List == NULL) { ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); goto end; } - - OpenAPI_lnode_t *{{{name}}}_node; - if ({{{classname}}}->{{{name}}}) { - OpenAPI_list_for_each({{classname}}->{{{name}}}, {{{name}}}_node) { - cJSON *itemLocal = OpenAPI_{{complexType}}_convertToJSON({{#isEnum}}{{#items}}(intptr_t){{/items}}{{/isEnum}}{{{name}}}_node->data); - if (itemLocal == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - cJSON_AddItemToArray({{{name}}}List, itemLocal); + OpenAPI_list_for_each({{classname}}->{{{name}}}, node) { + {{#isEnum}} + if (cJSON_AddStringToObject({{{name}}}List, "", OpenAPI_{{{complexType}}}_ToString((intptr_t)node->data)) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; } - } - {{/isPrimitiveType}} {{/isEnum}} + {{^isEnum}} + {{#items}} + {{#isPrimitiveType}} + {{#isString}} + if (cJSON_AddStringToObject({{{name}}}List, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isString}} + {{#isByteArray}} + if (cJSON_AddStringToObject({{{name}}}List, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isByteArray}} + {{#isNumeric}} + if (cJSON_AddNumberToObject({{{name}}}List, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isNumeric}} + {{#isBoolean}} + if (cJSON_AddBoolToObject({{{name}}}List, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isBoolean}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + cJSON *itemLocal = OpenAPI_{{complexType}}_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + cJSON_AddItemToArray({{{name}}}List, itemLocal); + {{/isPrimitiveType}} + {{/items}} + {{/isEnum}} + } {{/isArray}} {{#isMap}} cJSON *{{{name}}} = cJSON_AddObjectToObject(item, "{{{baseName}}}"); @@ -529,50 +518,57 @@ cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname} goto end; } cJSON *localMapObject = {{{name}}}; - OpenAPI_lnode_t *{{{name}}}_node; if ({{{classname}}}->{{{name}}}) { - OpenAPI_list_for_each({{{classname}}}->{{{name}}}, {{{name}}}_node) { - OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*){{{name}}}_node->data; - {{#items}} - {{#isPrimitiveType}} - {{#isString}} - if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isString}} - {{#isNumeric}} - if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, *(double *)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isNumeric}} - {{#isByteArray}} - if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isByteArray}} - {{#isBoolean}} - if (cJSON_AddBoolToObject(localMapObject, localKeyValue->key, *(cJSON_bool *)localKeyValue->value) == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - {{/isBoolean}} - {{/isPrimitiveType}} - {{^isPrimitiveType}} - cJSON *itemLocal = localKeyValue->value ? - OpenAPI_{{complexType}}_convertToJSON(localKeyValue->value) : - cJSON_CreateNull(); - if (itemLocal == NULL) { - ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); - goto end; - } - cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); - {{/isPrimitiveType}} - {{/items}} + OpenAPI_list_for_each({{{classname}}}->{{{name}}}, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + {{#isEnum}} + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, OpenAPI_{{{complexType}}}_ToString((intptr_t)localKeyValue->value)) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; } + {{/isEnum}} + {{^isEnum}} + {{#items}} + {{#isPrimitiveType}} + {{#isString}} + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isString}} + {{#isByteArray}} + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isByteArray}} + {{#isNumeric}} + if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, (uintptr_t)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isNumeric}} + {{#isBoolean}} + if (cJSON_AddBoolToObject(localMapObject, localKeyValue->key, (uintptr_t)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isBoolean}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_{{complexType}}_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + {{/isPrimitiveType}} + {{/items}} + {{/isEnum}} } + } {{/isMap}} {{/isContainer}} {{^required}} @@ -648,6 +644,18 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname} {{name}}Variable = OpenAPI_{{name}}{{classname}}_FromString({{{name}}}->valuestring); {{/isEnum}} {{^isEnum}} + {{#isString}} + if (!cJSON_IsString({{{name}}}){{^required}} && !cJSON_IsNull({{{name}}}){{/required}}) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isString}} + {{#isByteArray}} + if (!cJSON_IsString({{{name}}}){{^required}} && !cJSON_IsNull({{{name}}}){{/required}}) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isByteArray}} {{#isNumeric}} if (!cJSON_IsNumber({{{name}}})) { ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); @@ -660,19 +668,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname} goto end; } {{/isBoolean}} - {{#isString}} - if (!cJSON_IsString({{{name}}}){{^required}} && !cJSON_IsNull({{{name}}}){{/required}}) { - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - {{/isString}} {{/isEnum}} - {{#isByteArray}} - if (!cJSON_IsString({{{name}}})) { - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - {{/isByteArray}} {{#isBinary}} decoded_str_{{{name}}} = ogs_malloc(sizeof(OpenAPI_binary_t)); ogs_assert(decoded_str_{{{name}}}); @@ -740,8 +736,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname} {{/isContainer}} {{#isContainer}} {{#isArray}} - {{#isEnum}} - cJSON *{{{name}}}_local_nonprimitive = NULL; + cJSON *{{{name}}}_local = NULL; if (!cJSON_IsArray({{{name}}})) { ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); goto end; @@ -749,84 +744,78 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname} {{{name}}}List = OpenAPI_list_create(); - cJSON_ArrayForEach({{{name}}}_local_nonprimitive, {{{name}}} ) { - if (!cJSON_IsString({{{name}}}_local_nonprimitive)){ - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - - OpenAPI_list_add({{{name}}}List, (void *)OpenAPI_{{{complexType}}}_FromString({{{name}}}_local_nonprimitive->valuestring)); - } - {{/isEnum}} - {{^isEnum}} - {{#isPrimitiveType}} - cJSON *{{{name}}}_local; - if (!cJSON_IsArray({{{name}}})) { - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - {{{name}}}List = OpenAPI_list_create(); - cJSON_ArrayForEach({{{name}}}_local, {{{name}}}) { - {{#items}} - {{#isString}} - if (!cJSON_IsString({{{name}}}_local)) { - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - OpenAPI_list_add({{{name}}}List, ogs_strdup({{{name}}}_local->valuestring)); - {{/isString}} - {{#isNumeric}} - if (!cJSON_IsNumber({{{name}}}_local)) { - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - double *{{{name}}}_local_value = (double *)ogs_calloc(1, sizeof(double)); - if(!{{{name}}}_local_value) { - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - *{{{name}}}_local_value = {{{name}}}_local->valuedouble; - OpenAPI_list_add({{{name}}}List, {{{name}}}_local_value); - {{/isNumeric}} - {{#isBoolean}} - if (!cJSON_IsBool({{{name}}}_local)) { - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - OpenAPI_list_add({{{name}}}List, {{{name}}}_local->valueint); - {{/isBoolean}} - {{/items}} - } - {{/isPrimitiveType}} - {{^isPrimitiveType}} - cJSON *{{{name}}}_local_nonprimitive; - if (!cJSON_IsArray({{{name}}})){ - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - - {{{name}}}List = OpenAPI_list_create(); - - cJSON_ArrayForEach({{{name}}}_local_nonprimitive, {{{name}}} ) { - if (!cJSON_IsObject({{{name}}}_local_nonprimitive)) { + {{#isEnum}} + if (!cJSON_IsString({{{name}}}_local)) { ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); goto end; } - {{#isEnum}}{{#items}}{{datatypeWithEnum}}_e {{/items}}{{/isEnum}}{{^isEnum}}OpenAPI_{{complexType}}_t *{{/isEnum}}{{{name}}}Item = OpenAPI_{{complexType}}_parseFromJSON({{{name}}}_local_nonprimitive); - + OpenAPI_list_add({{{name}}}List, (void *)OpenAPI_{{{complexType}}}_FromString({{{name}}}_local->valuestring)); + {{/isEnum}} {{^isEnum}} + {{#isPrimitiveType}} + double *localDouble = NULL; + int *localInt = NULL; + {{/isPrimitiveType}} + {{#items}} + {{#isPrimitiveType}} + {{#isString}} + if (!cJSON_IsString({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + OpenAPI_list_add({{{name}}}List, ogs_strdup({{{name}}}_local->valuestring)); + {{/isString}} + {{#isByteArray}} + if (!cJSON_IsString({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + OpenAPI_list_add({{{name}}}List, ogs_strdup({{{name}}}_local->valuestring)); + {{/isByteArray}} + {{#isNumeric}} + if (!cJSON_IsNumber({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + *localDouble = {{{name}}}_local->valuedouble; + OpenAPI_list_add({{{name}}}List, localDouble); + {{/isNumeric}} + {{#isBoolean}} + if (!cJSON_IsBool({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localInt = (int *)ogs_calloc(1, sizeof(int)); + if (!localInt) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + *localInt = {{{name}}}_local->valueint; + OpenAPI_list_add({{{name}}}List, localInt); + {{/isBoolean}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if (!cJSON_IsObject({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + OpenAPI_{{complexType}}_t *{{{name}}}Item = OpenAPI_{{complexType}}_parseFromJSON({{{name}}}_local); if (!{{{name}}}Item) { ogs_error("No {{{name}}}Item"); OpenAPI_list_free({{{name}}}List); goto end; } + OpenAPI_list_add({{{name}}}List, {{{name}}}Item); + {{/isPrimitiveType}} + {{/items}} {{/isEnum}} - - OpenAPI_list_add({{{name}}}List, {{#isEnum}}{{#items}}(void *){{/items}}{{/isEnum}}{{{name}}}Item); } - {{/isPrimitiveType}} - {{/isEnum}} {{/isArray}} {{#isMap}} cJSON *{{{name}}}_local_map = NULL; @@ -839,38 +828,62 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname} OpenAPI_map_t *localMapKeyPair = NULL; cJSON_ArrayForEach({{{name}}}_local_map, {{{name}}}) { cJSON *localMapObject = {{{name}}}_local_map; - {{#items}} - {{#isPrimitiveType}} - {{#isString}} + {{#isEnum}} if (!cJSON_IsString(localMapObject)) { ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - {{/isString}} - {{#isByteArray}} - if (!cJSON_IsString(localMapObject)) { - ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); - goto end; - } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),ogs_strdup(localMapObject->valuestring)); - {{/isByteArray}} - {{#isBoolean}} - if (!cJSON_IsBool(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), (void *)OpenAPI_{{{complexType}}}_FromString(localMapObject->string)); + {{/isEnum}} + {{^isEnum}} + {{#isPrimitiveType}} + double *localDouble = NULL; + int *localInt = NULL; + {{/isPrimitiveType}} + {{#items}} + {{#isPrimitiveType}} + {{#isString}} + if (!cJSON_IsString(localMapObject)) { ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), &localMapObject->valueint); - {{/isBoolean}} - {{#isNumeric}} + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + {{/isString}} + {{#isByteArray}} + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + {{/isByteArray}} + {{#isNumeric}} if (!cJSON_IsNumber(localMapObject)) { ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); goto end; } - localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string),&localMapObject->valuedouble ); - {{/isNumeric}} - {{/isPrimitiveType}} - {{^isPrimitiveType}} + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + *localDouble = localMapObject->valuedouble; + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), localDouble); + {{/isNumeric}} + {{#isBoolean}} + if (!cJSON_IsBool(localMapObject)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localInt = (int *)ogs_calloc(1, sizeof(int)); + if (!localInt) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + *localInt = localMapObject->valueint; + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), localInt); + {{/isBoolean}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} if (cJSON_IsObject(localMapObject)) { localMapKeyPair = OpenAPI_map_create( ogs_strdup(localMapObject->string), OpenAPI_{{complexType}}_parseFromJSON(localMapObject)); @@ -880,8 +893,9 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname} ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); goto end; } - {{/isPrimitiveType}} - {{/items}} + {{/isPrimitiveType}} + {{/items}} + {{/isEnum}} OpenAPI_list_add({{{name}}}List, localMapKeyPair); } } @@ -935,10 +949,10 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname} {{#isString}} {{^required}}{{{name}}} && !cJSON_IsNull({{{name}}}) ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} {{/isString}} + {{#isByteArray}} + {{^required}}{{{name}}} && !cJSON_IsNull({{{name}}}) ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isByteArray}} {{/isEnum}} - {{#isByteArray}} - {{^required}}{{{name}}} ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} - {{/isByteArray}} {{#isBinary}} {{^required}}{{{name}}} ? {{/required}}decoded_str_{{{name}}}{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} {{/isBinary}} @@ -1012,12 +1026,14 @@ end: OpenAPI_list_for_each({{{name}}}List, node) { OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; ogs_free(localKeyValue->key); - {{#isPrimitiveType}} + {{^isEnum}} + {{#isPrimitiveType}} ogs_free(localKeyValue->value); - {{/isPrimitiveType}} - {{^isPrimitiveType}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} OpenAPI_{{complexType}}_free(localKeyValue->value); - {{/isPrimitiveType}} + {{/isPrimitiveType}} + {{/isEnum}} OpenAPI_map_free(localKeyValue); } OpenAPI_list_free({{{name}}}List); diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/README.md b/lib/sbi/support/r17-20230301-openapitools-6.4.0/README.md new file mode 100644 index 000000000..f979f9583 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/README.md @@ -0,0 +1,74 @@ + +### Ubuntu + +* To install JDK(Java) +$ sudo apt install default-jdk + +* To install Node.js +$ sudo apt update +$ sudo apt install curl +$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - +$ sudo apt install nodejs + +* To install OpenAPI Geneator +$ sudo npm install @openapitools/openapi-generator-cli -g + +$ Run generator +$ sudo openapi-generator-cli version-manager set 6.4.0 +$ ./generator.sh + + +### MacOSX + +* To install JDK(Java) +$ brew install openjdk + +* To install Node.js +$ brew install node + +* To install OpenAPI Geneator +$ npm install @openapitools/openapi-generator-cli -g + +$ Run generator +$ openapi-generator-cli version-manager set 6.4.0 +$ ./generator.sh + + +### How to upgrade SBI + +1. Download the *.yaml from etsi.org +2. Copy *.yaml to standard/modified directory +3. Run ./generator.sh and check for openapi-generator-cli errors +4. If you copy the entire OLD version without ERROR to modified, + you can identify the problem. +5. Check the *.yaml below in the OLD version to apply the changes. + +./modified/TS29508_Nsmf_EventExposure.yaml +./modified/TS32291_Nchf_ConvergedCharging.yaml +./modified/TS29519_Exposure_Data.yaml + +./modified/TS29517_Naf_EventExposure.yaml +./modified/TS29521_Nbsf_Management.yaml +./modified/TS29531_Nnssf_NSSelection.yaml +./modified/TS29507_Npcf_AMPolicyControl.yaml +./modified/TS29512_Npcf_SMPolicyControl.yaml +./modified/TS29514_Npcf_PolicyAuthorization.yaml +./modified/TS29503_Nudm_SDM.yaml +./modified/TS29503_Nudm_UEAU.yaml +./modified/TS29503_Nudm_UECM.yaml +./modified/TS29509_Nausf_UEAuthentication.yaml +./modified/TS29502_Nsmf_PDUSession.yaml +./modified/TS29518_Namf_Communication.yaml +./modified/TS29510_Nnrf_NFManagement.yaml +./modified/TS29505_Subscription_Data.yaml +./modified/TS29571_CommonData.yaml + +./modified/TS29520_Nnwdaf_EventsSubscription.yaml +./modified/TS29507_Npcf_AMPolicyControl.yaml +./modified/TS29512_Npcf_SMPolicyControl.yaml +./modified/TS29503_Nudm_SDM.yaml +./modified/TS29518_Namf_Communication.yaml +./modified/TS29510_Nnrf_NFManagement.yaml +./modified/TS29505_Subscription_Data.yaml +./modified/TS29571_CommonData.yaml + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/generator.sh b/lib/sbi/support/r17-20230301-openapitools-6.4.0/generator.sh new file mode 100755 index 000000000..d8ad9fa21 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/generator.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +### Ubuntu 20.04(focal) is not working +#export C_POST_PROCESS_FILE="/usr/bin/uncrustify --no-backup" +#export UNCRUSTIFY_CONFIG="./openapi-generator/uncrustify-rules.cfg" + +openapi_generator_cli="openapi-generator-cli" + +$openapi_generator_cli generate -i ./modified/TS29504_Nudr_DR.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29521_Nbsf_Management.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29531_Nnssf_NSSelection.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29507_Npcf_AMPolicyControl.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29512_Npcf_SMPolicyControl.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29514_Npcf_PolicyAuthorization.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_SDM.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_UECM.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29503_Nudm_UEAU.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29509_Nausf_UEAuthentication.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29502_Nsmf_PDUSession.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29518_Namf_Communication.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29510_Nnrf_NFDiscovery.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 +$openapi_generator_cli generate -i ./modified/TS29510_Nnrf_NFManagement.yaml -c ./openapi-generator/config.yaml -g c -o ../../openapi || exit 1 diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_AsSessionWithQoS.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_AsSessionWithQoS.yaml new file mode 100644 index 000000000..5c252d0c2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_AsSessionWithQoS.yaml @@ -0,0 +1,771 @@ +openapi: 3.0.0 +info: + title: 3gpp-as-session-with-qos + version: 1.2.2 + description: | + API for setting us an AS session with required QoS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.8.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-as-session-with-qos/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + get: + summary: Read all or queried active subscriptions for the SCS/AS. + operationId: FetchAllASSessionWithQoSSubscriptions + tags: + - AS Session with Required QoS Subscriptions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: ip-addrs + in: query + description: The IP address(es) of the requested UE(s). + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + - name: ip-domain + in: query + description: The IPv4 address domain identifier. The attribute may only be provided if IPv4 address is included in the ip-addrs query parameter. + required: false + schema: + type: string + - name: mac-addrs + in: query + description: The MAC address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource. + operationId: CreateASSessionWithQoSSubscription + tags: + - AS Session with Required QoS Subscriptions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserPlaneNotificationData' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/subscriptions/{subscriptionId}: + get: + summary: Read an active subscriptions for the SCS/AS and the subscription Id. + operationId: FetchIndASSessionWithQoSSubscription + tags: + - Individual AS Session with Required QoS Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing subscription resource. + operationId: UpdateIndASSessionWithQoSSubscription + tags: + - Individual AS Session with Required QoS Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + '204': + description: No Content (Successful update of the subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates/replaces an existing subscription resource. + operationId: ModifyIndASSessionWithQoSSubscription + tags: + - Individual AS Session with Required QoS Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscriptionPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + '204': + description: No Content. The subscription was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription. + operationId: DeleteIndASSessionWithQoSSubscription + tags: + - Individual AS Session with Required QoS Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/UserPlaneNotificationData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AsSessionWithQoSSubscription: + description: Represents an individual AS session with required QoS subscription resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + exterAppId: + type: string + description: Identifies the external Application Identifier. + flowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Describe the data flow which requires QoS. + ethFlowInfo: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet flows. + enEthFlowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/EthFlowInfo' + minItems: 1 + description: > + Identifies the Ethernet flows which require QoS. Each Ethernet flow consists of a flow + idenifer and the corresponding UL and/or DL flows. + qosReference: + type: string + description: Identifies a pre-defined QoS information + altQoSReferences: + type: array + items: + type: string + minItems: 1 + description: Identifies an ordered list of pre-defined QoS information. The lower the index of the array for a given entry, the higher the priority. + altQosReqs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AlternativeServiceRequirementsData' + minItems: 1 + description: Identifies an ordered list of alternative service requirements that include individual QoS parameter sets. The lower the index of the array for a given entry, the higher the priority. + disUeNotif: + description: > + Indicates whether the QoS flow parameters signalling to the UE when the SMF is notified + by the NG-RAN of changes in the fulfilled QoS situation is disabled (true) or + not (false). Default value is false. The fulfilled situation is either the QoS profile + or an Alternative QoS Profile. + type: boolean + ueIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + ueIpv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + usageThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + sponsorInfo: + $ref: 'TS29122_CommonData.yaml#/components/schemas/SponsorInformation' + qosMonInfo: + $ref: '#/components/schemas/QosMonitoringInformation' + directNotifInd: + type: boolean + description: > + Indicates whether the direct event notification is requested (true) or not (false). + Default value is false. + tscQosReq: + $ref: '#/components/schemas/TscQosRequirement' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + events: + description: Represents the list of user plane event(s) to which the SCS/AS requests to subscribe to. + type: array + items: + $ref: '#/components/schemas/UserPlaneEvent' + minItems: 1 + required: + - notificationDestination + AsSessionWithQoSSubscriptionPatch: + description: Represents parameters to modify an AS session with specific QoS subscription. + type: object + properties: + exterAppId: + type: string + description: Identifies the external Application Identifier. + flowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Describe the IP data flow which requires QoS. + ethFlowInfo: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet flows. + enEthFlowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/EthFlowInfo' + minItems: 1 + description: > + Identifies the Ethernet flows which require QoS. Each Ethernet flow consists of a flow + idenifer and the corresponding UL and/or DL flows. + qosReference: + type: string + description: Pre-defined QoS reference + altQoSReferences: + type: array + items: + type: string + minItems: 1 + description: Identifies an ordered list of pre-defined QoS information. The lower the index of the array for a given entry, the higher the priority. + altQosReqs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AlternativeServiceRequirementsData' + minItems: 1 + description: Identifies an ordered list of alternative service requirements that include individual QoS parameter sets. The lower the index of the array for a given entry, the higher the priority. + disUeNotif: + type: boolean + description: > + Indicates whether the QoS flow parameters signalling to the UE when the SMF is notified + by the NG-RAN of changes in the fulfilled QoS situation is disabled (true) or + not (false). The fulfilled situation is either the QoS profile or an Alternative QoS + Profile. + usageThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThresholdRm' + qosMonInfo: + $ref: '#/components/schemas/QosMonitoringInformationRm' + directNotifInd: + type: boolean + description: > + Indicates whether the direct event notification is requested (true) or not (false). + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + tscQosReq: + $ref: '#/components/schemas/TscQosRequirementRm' + events: + description: Represents the updated list of user plane event(s) to which the SCS/AS requests to subscribe to. + type: array + items: + $ref: '#/components/schemas/UserPlaneEvent' + minItems: 1 + QosMonitoringInformation: + description: Represents QoS monitoring information. + type: object + properties: + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + repFreqs: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ReportingFrequency' + minItems: 1 + repThreshDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + repThreshUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + repThreshRp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - reqQosMonParams + - repFreqs + QosMonitoringInformationRm: + description: Represents the same as the QosMonitoringInformation data type but with the nullable:true property. + type: object + properties: + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + repFreqs: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ReportingFrequency' + minItems: 1 + repThreshDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + repThreshUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + repThreshRp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + QosMonitoringReport: + description: Represents a QoS monitoring report. + type: object + properties: + ulDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + dlDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + rtDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + UserPlaneNotificationData: + description: Represents the parameters to be conveyed in a user plane event(s) notification. + type: object + properties: + transaction: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + eventReports: + type: array + items: + $ref: '#/components/schemas/UserPlaneEventReport' + minItems: 1 + description: Contains the reported event and applicable information + required: + - transaction + - eventReports + UserPlaneEventReport: + description: Represents an event report for user plane. + type: object + properties: + event: + $ref: '#/components/schemas/UserPlaneEvent' + accumulatedUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/AccumulatedUsage' + flowIds: + type: array + items: + type: integer + minItems: 1 + description: > + Identifies the affected flows that were sent during event subscription. It might be + omitted when the reported event applies to all the flows sent during the subscription. + appliedQosRef: + type: string + description: The currently applied QoS reference. Applicable for event QOS_NOT_GUARANTEED or SUCCESSFUL_RESOURCES_ALLOCATION. + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + description: Contains the QoS Monitoring Reporting information + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + required: + - event + TscQosRequirement: + description: Represents QoS requirements for time sensitive communication. + type: object + properties: + reqGbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + reqGbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + reqMbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + reqMbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVol' + req5Gsdelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + priority: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscPriorityLevel' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + tscaiInputDl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + TscQosRequirementRm: + description: Represents the same as the TscQosRequirement data type but with the nullable:true property. + type: object + properties: + reqGbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + reqGbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + reqMbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + reqMbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + req5Gsdelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudgetRm' + priority: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscPriorityLevelRm' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + tscaiInputDl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + UserPlaneEvent: + anyOf: + - type: string + enum: + - SESSION_TERMINATION + - LOSS_OF_BEARER + - RECOVERY_OF_BEARER + - RELEASE_OF_BEARER + - USAGE_REPORT + - FAILED_RESOURCES_ALLOCATION + - QOS_GUARANTEED + - QOS_NOT_GUARANTEED + - QOS_MONITORING + - SUCCESSFUL_RESOURCES_ALLOCATION + - ACCESS_TYPE_CHANGE + - PLMN_CHG + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SESSION_TERMINATION: Indicates that Rx session is terminated. + - LOSS_OF_BEARER : Indicates a loss of a bearer. + - RECOVERY_OF_BEARER: Indicates a recovery of a bearer. + - RELEASE_OF_BEARER: Indicates a release of a bearer. + - USAGE_REPORT: Indicates the usage report event. + - FAILED_RESOURCES_ALLOCATION: Indicates the resource allocation is failed. + - QOS_GUARANTEED: The QoS targets of one or more SDFs are guaranteed again. + - QOS_NOT_GUARANTEED: The QoS targets of one or more SDFs are not being guaranteed. + - QOS_MONITORING: Indicates a QoS monitoring event. + - SUCCESSFUL_RESOURCES_ALLOCATION: Indicates the resource allocation is successful. + - ACCESS_TYPE_CHANGE: Indicates an Access type change. + - PLMN_CHG: Indicates a PLMN change. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ChargeableParty.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ChargeableParty.yaml new file mode 100644 index 000000000..29ec612de --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ChargeableParty.yaml @@ -0,0 +1,454 @@ +openapi: 3.0.0 +info: + title: 3gpp-chargeable-party + version: 1.2.1 + description: | + API for Chargeable Party management. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-chargeable-party/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/transactions: + get: + summary: Read all or queried chargeable party transaction resources for a given SCS/AS. + operationId: FetchAllChargeablePartyTransactions + tags: + - Chargeable Party Transaction Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: ip-addrs + in: query + description: The IP address(es) of the requested UE(s). + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + - name: ip-domain + in: query + description: The IPv4 address domain identifier. The attribute may only be provided if IPv4 address is included in the ip-addrs query parameter. + required: false + schema: + type: string + - name: mac-addrs + in: query + description: The MAC address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + responses: + '200': + description: OK (successful query of Chargeable Party resource) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChargeableParty' + minItems: 0 + description: individual BDT policy subscription. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Create a new chargeable party transaction resource. + operationId: CreateChargeablePartyTransaction + tags: + - Chargeable Party Transaction Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + requestBody: + description: representation of the Chargeable Party resource to be Created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargeableParty' + callbacks: + eventNotification: + '{$request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/NotificationData' + responses: + '204': + description: No Content (The successful acknowledgement of the notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: successful creation of a chargeable party resource + content: + application/json: + schema: + $ref: '#/components/schemas/ChargeableParty' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/transactions/{transactionId}: + get: + summary: Read a chargeable party resource for a given SCS/AS and a transaction Id. + operationId: FetchIndChargeablePartyTransaction + tags: + - Individual chargeable party resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of a chargeable party resource) + content: + application/json: + schema: + $ref: '#/components/schemas/ChargeableParty' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates a existing chargeable party resource for a given SCS/AS and transaction Id. + operationId: UpdateChargeablePartyTransaction + tags: + - Individual chargeable party resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the chargeable party resource to be udpated in the SCEF + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/ChargeablePartyPatch' + responses: + '200': + description: successful update of a chargeable party resource + content: + application/json: + schema: + $ref: '#/components/schemas/ChargeableParty' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a chargeable party resource for a given SCS/AS and a transcation Id. + operationId: DeleteChargeablePartyTransaction + tags: + - Individual chargeable party resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '204': + description: successful deletion of an resouce of chargeable party + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/NotificationData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ChargeableParty: + description: Represents the configuration of a chargeable party. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + exterAppId: + type: string + description: Identifies the external Application Identifier. + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + ipv6Addr : + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + flowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Describes the application flows. + ethFlowInfo: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet flows. + sponsorInformation: + $ref: 'TS29122_CommonData.yaml#/components/schemas/SponsorInformation' + sponsoringEnabled: + type: boolean + description: > + Indicates whether the sponsoring data connectivity is enabled (true) or not (false). + referenceId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + servAuthInfo: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ServAuthInfo' + usageThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + events: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Event' + minItems: 1 + description: Represents the list of event(s) to which the SCS/AS requests to subscribe to. + required: + - notificationDestination + - sponsorInformation + - sponsoringEnabled + ChargeablePartyPatch: + description: Represents a modification request of a chargeable party resource. + type: object + properties: + flowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Describes the IP flows. + exterAppId: + type: string + description: Identifies the external Application Identifier. + ethFlowInfo: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet flows. + sponsoringEnabled: + type: boolean + description: > + Indicates whether the sponsoring data connectivity is enabled (true) or not (false). + referenceId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + usageThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThresholdRm' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + events: + description: Represents the list of event(s) to which the SCS/AS requests to subscribe to. + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Event' + minItems: 1 + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_CommonData.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_CommonData.yaml new file mode 100644 index 000000000..d5e172dc4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_CommonData.yaml @@ -0,0 +1,571 @@ +openapi: 3.0.0 +info: + title: TS 29.122 Common Data Types + version: 1.2.1 + description: | + Data types applicable to several APIs. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +paths: {} +components: + schemas: + SponsorInformation: + description: Represents a sponsor information. + type: object + properties: + sponsorId: + type: string + description: It indicates Sponsor ID. + aspId: + type: string + description: It indicates Application Service Provider ID. + required: + - sponsorId + - aspId + UsageThreshold: + description: Represents a usage threshold. + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSec' + totalVolume: + $ref: '#/components/schemas/Volume' + downlinkVolume: + $ref: '#/components/schemas/Volume' + uplinkVolume: + $ref: '#/components/schemas/Volume' + UsageThresholdRm: + description: Represents the same as the UsageThreshold data type but with the nullable:true property. + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSecRm' + totalVolume: + $ref: '#/components/schemas/VolumeRm' + downlinkVolume: + $ref: '#/components/schemas/VolumeRm' + uplinkVolume: + $ref: '#/components/schemas/VolumeRm' + nullable: true + TimeWindow: + description: Represents a time window identified by a start time and a stop time. + type: object + properties: + startTime: + $ref: '#/components/schemas/DateTime' + stopTime: + $ref: '#/components/schemas/DateTime' + required: + - startTime + - stopTime + Acknowledgement: + description: Represents a successful acknowledgement of a notification. + type: object + properties: + details: + type: string + description: A human-readable explanation specific to this successful acknowledgement + required: + - details + NotificationData: + description: Represents the information to be conveyed in a bearer level event(s) notification. + type: object + properties: + transaction: + $ref: '#/components/schemas/Link' + eventReports: + type: array + items: + $ref: '#/components/schemas/EventReport' + minItems: 1 + description: Contains the reported event and applicable information + required: + - transaction + - eventReports + EventReport: + description: Represents an event report. + type: object + properties: + event: + $ref: '#/components/schemas/Event' + accumulatedUsage: + $ref: '#/components/schemas/AccumulatedUsage' + flowIds: + type: array + items: + type: integer + minItems: 1 + description: Identifies the IP flows that were sent during event subscription + required: + - event + AccumulatedUsage: + description: Represents an accumulated usage. + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSec' + totalVolume: + $ref: '#/components/schemas/Volume' + downlinkVolume: + $ref: '#/components/schemas/Volume' + uplinkVolume: + $ref: '#/components/schemas/Volume' + FlowInfo: + description: Represents IP flow information. + type: object + properties: + flowId: + type: integer + description: Indicates the IP flow identifier. + flowDescriptions: + type: array + items: + type: string + description: > + Indicates the packet filters of the IP flow. Refer to clause 5.3.8 of 3GPP TS 29.214 for + encoding. It shall contain UL and/or DL IP flow description. + minItems: 1 + maxItems: 2 + required: + - flowId + TestNotification: + description: Represents a notification that can be sent to test whether a chosen notification mechanism works. + type: object + properties: + subscription: + $ref: '#/components/schemas/Link' + required: + - subscription + WebsockNotifConfig: + description: Represents the configuration information for the delivery of notifications over Websockets. + type: object + properties: + websocketUri: + $ref: '#/components/schemas/Link' + requestWebsocketUri: + type: boolean + description: Set by the SCS/AS to indicate that the Websocket delivery is requested. + LocationArea: + description: Represents a user location area. + type: object + properties: + cellIds: + type: array + items: + type: string + minItems: 1 + description: Indicates a list of Cell Global Identities of the user which identifies the cell the UE is registered. + enodeBIds: + type: array + items: + type: string + minItems: 1 + description: Indicates a list of eNodeB identities in which the UE is currently located. + routingAreaIds: + type: array + items: + type: string + minItems: 1 + description: Identifies a list of Routing Area Identities of the user where the UE is located. + trackingAreaIds: + type: array + items: + type: string + minItems: 1 + description: Identifies a list of Tracking Area Identities of the user where the UE is located. + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + description: Identifies a list of civic addresses of the user where the UE is located. + LocationArea5G: + description: Represents a user location area when the UE is attached to 5G. + type: object + properties: + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 0 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 0 + description: Identifies a list of civic addresses of the user where the UE is located. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + ProblemDetails: + description: Represents additional information and details on an error response. + type: object + properties: + type: + $ref: '#/components/schemas/Uri' + title: + type: string + description: A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. + status: + type: integer + description: The HTTP status code for this occurrence of the problem. + detail: + type: string + description: A human-readable explanation specific to this occurrence of the problem. + instance: + $ref: '#/components/schemas/Uri' + cause: + type: string + description: A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. + invalidParams: + type: array + items: + $ref: '#/components/schemas/InvalidParam' + minItems: 1 + description: Description of invalid parameters, for a request rejected due to invalid parameters. + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + InvalidParam: + description: Represents the description of invalid parameters, for a request rejected due to invalid parameters. + type: object + properties: + param: + type: string + description: Attribute's name encoded as a JSON Pointer, or header's name. + reason: + type: string + description: A human-readable reason, e.g. "must be a positive integer". + required: + - param + PlmnId: + description: Represents the identifier of a PLMN. + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + required: + - mcc + - mnc + ConfigResult: + description: Represents one configuration processing result for a group's members. + type: object + properties: + externalIds: + type: array + items: + $ref: '#/components/schemas/ExternalId' + minItems: 1 + description: Each element indicates an external identifier of the UE. + msisdns: + type: array + items: + $ref: '#/components/schemas/Msisdn' + minItems: 1 + description: Each element identifies the MS internal PSTN/ISDN number allocated for the UE. + resultReason: + $ref: '#/components/schemas/ResultReason' + required: + - resultReason + oneOf: + - required: [externalIds] + - required: [msisdns] + Bandwidth: + type: integer + minimum: 0 + description: integer indicating a bandwidth in bits per second. + BdtReferenceId: + type: string + description: string identifying a BDT Reference ID as defined in clause 5.3.3 of 3GPP TS 29.154. + BdtReferenceIdRm: + type: string + description: This data type is defined in the same way as the BdtReferenceId data type, but with the nullable property set to true. + nullable: true + Binary: + type: string + description: string with format "binary" as defined in OpenAPI Specification. + Bytes: + type: string + description: String with format "byte" as defined in OpenAPI Specification, i.e, base64-encoded characters. + DayOfWeek: + type: integer + minimum: 1 + maximum: 7 + description: integer between and including 1 and 7 denoting a weekday. 1 shall indicate Monday, and the subsequent weekdays shall be indicated with the next higher numbers. 7 shall indicate Sunday. + DateTime: + format: date-time + type: string + description: string with format "date-time" as defined in OpenAPI. + DateTimeRm: + format: date-time + type: string + description: string with format "date-time" as defined in OpenAPI with "nullable=true" property. + nullable: true + DateTimeRo: + format: date-time + type: string + description: string with format "date-time" as defined in OpenAPI with "readOnly=true" property. + readOnly: true + DurationSec: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds. + DurationSecRm: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds with "nullable=true" property. + nullable: true + DurationSecRo: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds with "readOnly=true" property. + readOnly: true + DurationMin: + type: integer + format: int32 + minimum: 0 + description: Unsigned integer identifying a period of time in units of minutes. + ExternalId: + type: string + description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clause 4.6.2 of 3GPP TS 23.682 for more information. + ExternalGroupId: + type: string + description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clauses 4.6.2 and 4.6.3 of 3GPP TS 23.682 for more information. + Ipv4Addr: + type: string + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. + Ipv6Addr: + type: string + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + Ipv4AddrRo: + type: string + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166, with "readOnly=true" property. + readOnly: true + Ipv6AddrRo: + type: string + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952, with "readOnly=true" property. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + readOnly: true + Link: + type: string + description: string formatted according to IETF RFC 3986 identifying a referenced resource. + LinkRm: + type: string + description: > + String formatted according to IETF RFC 3986 identifying a referenced resource, + but with the nullable property set to true. + nullable: true + Mcc: + type: string + description: String encoding a Mobile Country Code part of the PLMN, comprising 3 digits, as defined in 3GPP TS 38.413. + Mnc: + type: string + description: String encoding a Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in 3GPP TS 38.413. + Msisdn: + type: string + description: string formatted according to clause 3.3 of 3GPP TS 23.003 that describes an MSISDN. + Port: + type: integer + description: Unsigned integer with valid values between 0 and 65535. + minimum: 0 + maximum: 65535 + PortRo: + type: integer + description: Unsigned integer with valid values between 0 and 65535, with "readOnly=true" property. + minimum: 0 + maximum: 65535 + readOnly: true + ResourceId: + type: string + description: string chosen by the SCEF to serve as identifier in a resource URI. + ScsAsId: + type: string + description: string that identifies an SCS/AS. + TimeOfDay: + type: string + description: String with format partial-time or full-time as defined in clause 5.6 of IETF RFC 3339. Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). + Uri: + type: string + description: string providing an URI formatted according to IETF RFC 3986. + Volume: + type: integer + format: int64 + minimum: 0 + description: Unsigned integer identifying a volume in units of bytes. + VolumeRm: + type: integer + format: int64 + minimum: 0 + description: Unsigned integer identifying a volume in units of bytes with "nullable=true" property. + nullable: true + EthFlowInfo: + description: Represents Ethernet flow information. + type: object + properties: + flowId: + type: integer + description: Indicates the Ethernet flow identifier. + ethFlowDescriptions: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + description: > + Indicates the packet filters of the Ethernet flow. It shall contain UL and/or DL + Ethernet flow description. + minItems: 1 + maxItems: 2 + required: + - flowId + Event: + anyOf: + - type: string + enum: + - SESSION_TERMINATION + - LOSS_OF_BEARER + - RECOVERY_OF_BEARER + - RELEASE_OF_BEARER + - USAGE_REPORT + - FAILED_RESOURCES_ALLOCATION + - SUCCESSFUL_RESOURCES_ALLOCATION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SESSION_TERMINATION: Indicates that Rx session is terminated. + - LOSS_OF_BEARER : Indicates a loss of a bearer. + - RECOVERY_OF_BEARER: Indicates a recovery of a bearer. + - RELEASE_OF_BEARER: Indicates a release of a bearer. + - USAGE_REPORT: Indicates the usage report event. + - FAILED_RESOURCES_ALLOCATION: Indicates the resource allocation is failed. + - SUCCESSFUL_RESOURCES_ALLOCATION: Indicates the resource allocation is successful. + ResultReason: + anyOf: + - type: string + enum: + - ROAMING_NOT_ALLOWED + - OTHER_REASON + - type: string + description: > + This string provides a failure reason. + description: > + Possible values are + - ROAMING_NOT_ALLOWED: Identifies the configuration parameters are not allowed by roaming agreement. + - OTHER_REASON: Identifies the configuration parameters are not configured due to other reason. +# +# HTTP responses +# + responses: + '307': + description: Temporary Redirect + headers: + Location: + description: 'An alternative URI of the resource.' + required: true + schema: + type: string + '308': + description: Permanent Redirect + headers: + Location: + description: 'An alternative URI of the resource.' + required: true + schema: + type: string + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '406': + description: Not Acceptable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '409': + description: Conflict + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '411': + description: Length Required + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '412': + description: Precondition Failed + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '414': + description: URI Too Long + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + default: + description: Generic Error diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_CpProvisioning.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_CpProvisioning.yaml new file mode 100644 index 000000000..709059039 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_CpProvisioning.yaml @@ -0,0 +1,710 @@ +openapi: 3.0.0 +info: + title: 3gpp-cp-parameter-provisioning + version: 1.2.0 + description: | + API for provisioning communication pattern parameters. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-cp-parameter-provisioning/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + get: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + summary: Read all active CP parameter provisioning subscription resources for a given SCS/AS. + operationId: FetchAllCPProvisioningSubscriptions + tags: + - CP provisioning Subscriptions + responses: + '200': + description: OK. The subscription information related to the request URI is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CpInfo' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + summary: Create a new subscription resource of provisioning CP parameter set(s). + operationId: CreateCPProvisioningSubscription + tags: + - CP provisioning Subscriptions + requestBody: + description: create new subscriptions for a given SCS/AS and the provisioning CP parameter sets. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + responses: + '201': + description: Created. The subscription was created successfully. The SCEF shall return the created subscription in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The CP parameters for all sets were not created successfully. CpReport may be included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CpReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/subscriptions/{subscriptionId}: + get: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + summary: Read a CP parameter provisioning subscription resource. + operationId: FetchIndCPProvisioningSubscription + tags: + - Individual CP Provisioning Subscription + responses: + '200': + description: OK. The subscription information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Modify a CP parameter provisioning subscription resource. + operationId: UpdateIndCPProvisioningSubscription + tags: + - Individual CP Provisioning Subscription + requestBody: + description: Modify a CP parameter provisioning subscription resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. The subscription was modified successfully. The SCEF shall return an updated subscription in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + '204': + description: No Content. The subscription was modified successfully and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The CP parameters for all sets were not updated successfully. CpReport may be included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CpReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + summary: Delete a CP parameter provisioning subscription resource. + operationId: DeleteIndCPProvisioningSubscription + tags: + - Individual CP Provisioning Subscription + responses: + '204': + description: No Content. The subscription was deleted successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/subscriptions/{subscriptionId}/cpSets/{setId}: + get: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + - name: setId + in: path + description: Identifier of the CP parameter set + required: true + schema: + type: string + summary: Read CP at individual CP set(s) level associated with a CP parameter set Id. + operationId: FetchIndCPSetProvisioning + tags: + - Individual CP set Provisioning + responses: + '200': + description: OK. The subscription information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/CpParameterSet' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update CP at individual CP set(s) level associated with a CP parameter set Id. + operationId: UpdateIndCPSetProvisioning + tags: + - Individual CP set Provisioning + requestBody: + description: Change information for a CP parameter set. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CpParameterSet' + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + - name: setId + in: path + description: Identifier of the CP parameter set + required: true + schema: + type: string + responses: + '200': + description: OK. The CP parameter set resource was modified successfully. The SCEF shall return an updated CP parameter set resource in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/CpParameterSet' + '204': + description: No Content. The CP parameter set resource was modified successfully and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + description: The CP parameters for the CP set were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/CpReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The CP parameters for the CP set were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/CpReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + - name: setId + in: path + description: Identifier of the CP parameter set + required: true + schema: + type: string + summary: Delete CP at individual CP set(s) level associated with a CP parameter set Id. + operationId: DeleteIndCPSetProvisioning + tags: + - Individual CP set Provisioning + responses: + '204': + description: No Content. The subscription was deleted successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + CpInfo: + description: Represents the resources for communication pattern parameter provisioning. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + cpParameterSets: + type: object + additionalProperties: + $ref: '#/components/schemas/CpParameterSet' + minProperties: 1 + description: Identifies a set of CP parameter information that may be part of this CpInfo structure. Any string value can be used as a key of the map. + cpReports: + type: object + additionalProperties: + $ref: '#/components/schemas/CpReport' + minProperties: 1 + description: Supplied by the SCEF and contains the CP set identifiers for which CP parameter(s) are not added or modified successfully. The failure reason is also included. Each element provides the related information for one or more CP set identifier(s) and is identified in the map via the failure identifier as key. + readOnly: true + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ueMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + required: + - cpParameterSets + oneOf: + - required: [externalId] + - required: [msisdn] + - required: [externalGroupId] + CpParameterSet: + description: Represents an offered communication pattern parameter set. + type: object + properties: + setId: + type: string + description: SCS/AS-chosen correlator provided by the SCS/AS in the request to create a resource fo CP parameter set(s). + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + validityTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + periodicCommunicationIndicator: + $ref: '#/components/schemas/CommunicationIndicator' + communicationDurationTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + periodicTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + scheduledCommunicationTime: + $ref: '#/components/schemas/ScheduledCommunicationTime' + scheduledCommunicationType: + $ref: '#/components/schemas/ScheduledCommunicationType' + stationaryIndication: + $ref: '#/components/schemas/StationaryIndication' + batteryInds: + type: array + items: + $ref: '#/components/schemas/BatteryIndication' + minItems: 1 + trafficProfile: + $ref: '#/components/schemas/TrafficProfile' + expectedUmts: + type: array + items: + $ref: '#/components/schemas/UmtLocationArea5G' + minItems: 1 + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + expectedUmtDays: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DayOfWeek' + required: + - setId + ScheduledCommunicationTime: + description: Represents an offered scheduled communication time. + type: object + properties: + daysOfWeek: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DayOfWeek' + minItems: 1 + maxItems: 6 + description: Identifies the day(s) of the week. If absent, it indicates every day of the week. + timeOfDayStart: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeOfDay' + timeOfDayEnd: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeOfDay' + CpReport: + description: Represents a CP report indicating the CP set identifier(s) which CP parameter(s) are not added or modified successfully and the corresponding failure cause(s). + type: object + properties: + setIds: + type: array + items: + type: string + minItems: 1 + description: Identifies the CP set identifier(s) which CP parameter(s) are not added or modified successfully + failureCode: + $ref: '#/components/schemas/CpFailureCode' + required: + - failureCode + UmtLocationArea5G: + description: Represents the user location area describing the UE moving trajectory. + allOf: + - $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + - type: object + properties: + umtTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeOfDay' + umtDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + CommunicationIndicator: + anyOf: + - type: string + enum: + - PERIODICALLY + - ON_DEMAND + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - PERIODICALLY: Identifies the UE communicates periodically + - ON_DEMAND: Identifies the UE communicates on demand + StationaryIndication: + anyOf: + - type: string + enum: + - STATIONARY + - MOBILE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - STATIONARY: Identifies the UE is stationary + - MOBILE: Identifies the UE is mobile + CpFailureCode: + anyOf: + - type: string + enum: + - MALFUNCTION + - SET_ID_DUPLICATED + - OTHER_REASON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - MALFUNCTION: This value indicates that something functions wrongly in CP parameter provisioning or the CP parameter provisioning does not function at all. + - SET_ID_DUPLICATED: The received CP set identifier(s) are already provisioned. + - OTHER_REASON: Other reason unspecified. + BatteryIndication: + anyOf: + - type: string + enum: + - BATTERY_RECHARGE + - BATTERY_REPLACE + - BATTERY_NO_RECHARGE + - BATTERY_NO_REPLACE + - NO_BATTERY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - BATTERY_RECHARGE: UE powered with rechargeable battery. + - BATTERY_REPLACE: UE powered with replaceable battery. + - BATTERY_NO_RECHARGE: UE powered with no rechargeable battery. + - BATTERY_NO_REPLACE: UE powered with no replaceable battery. + - NO_BATTERY: UE not battery powered. + TrafficProfile: + anyOf: + - type: string + enum: + - SINGLE_TRANS_UL + - SINGLE_TRANS_DL + - DUAL_TRANS_UL_FIRST + - DUAL_TRANS_DL_FIRST + - MULTI_TRANS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SINGLE_TRANS_UL: Uplink single packet transmission. + - SINGLE_TRANS_DL: Downlink single packet transmission. + - DUAL_TRANS_UL_FIRST: Dual packet transmission, firstly uplink packet transmission with subsequent downlink packet transmission. + - DUAL_TRANS_DL_FIRST: Dual packet transmission, firstly downlink packet transmission with subsequent uplink packet transmission. + - MULTI_TRANS: Multiple packet transmission. + ScheduledCommunicationType: + anyOf: + - type: string + enum: + - DOWNLINK + - UPLINK + - BIDIRECTIONAL + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - DOWNLINK: Downlink only. + - UPLINK: Uplink only. + - BIDIRECTIONAL: Bi-directional. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_DeviceTriggering.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_DeviceTriggering.yaml new file mode 100644 index 000000000..f3c041e50 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_DeviceTriggering.yaml @@ -0,0 +1,503 @@ +openapi: 3.0.0 +info: + title: 3gpp-device-triggering + version: 1.2.0 + description: | + API for device trigger. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-device-triggering/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/transactions: + get: + summary: read all active device triggering transactions for a given SCS/AS. + operationId: FetchAllDeviceTriggeringTransactions + tags: + - Device Triggering Transactions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + responses: + '200': + description: OK (Successful get all of the active device triggering transactions for the SCS/AS) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceTriggering' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create a long-term transaction for a device triggering. + operationId: CreateDeviceTriggeringTransaction + tags: + - Device Triggering API Transactions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + requestBody: + description: Parameters to request a device triggering delivery. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggeringDeliveryReportNotification' + responses: + '200': + description: OK (successful notification) + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Acknowledgement' + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/transactions/{transactionId}: + get: + summary: Read a device triggering transaction resource. + operationId: FetchIndDeviceTriggeringTransaction + tags: + - Individual Device Triggering Transaction + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: transactionId + in: path + description: Identifier of the transaction resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Replace an existing device triggering transaction resource and the corresponding device trigger request. + operationId: UpdateIndDeviceTriggeringTransaction + tags: + - Individual Device Triggering Transaction + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: transactionId + in: path + description: Identifier of the transaction resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing device triggering + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + responses: + '200': + description: OK (Successful update of the device triggering) + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + '204': + description: No Content (Successful update of the device triggering) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing Individual Device Triggering Transaction resource and the corresponding device triggering request. + operationId: ModifyIndDeviceTriggeringTransaction + tags: + - Individual Device Triggering Transaction + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: transactionId + in: path + description: Identifier of the transaction resource + required: true + schema: + type: string + requestBody: + description: Parameters to request the modification of the existing Individual Device Triggering Transaction resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggeringPatch' + responses: + '200': + description: OK. The Individual Device Triggering Transaction resource was successfully modified and a representation of the modified Individual Device Triggering Transaction resource within the DeviceTriggering data structure including the "deliveryResult" attribute is returned by the SCEF. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + '204': + description: No Content. The Individual Device Triggering Transaction resource was successfully modified no content is returned in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes an already existing device triggering transaction. + operationId: DeleteIndDeviceTriggeringTransaction + tags: + - Individual Device Triggering Transaction + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: transactionId + in: path + description: Identifier of the transaction resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + DeviceTriggering: + description: Represents device triggering related information. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + validityPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + priority: + $ref: '#/components/schemas/Priority' + applicationPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + appSrcPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + triggerPayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + deliveryResult: + $ref: '#/components/schemas/DeliveryResult' + required: + - validityPeriod + - priority + - applicationPortId + - triggerPayload + - notificationDestination + oneOf: + - required: [externalId] + - required: [msisdn] + DeviceTriggeringDeliveryReportNotification: + description: Represents a device triggering delivery report notification. + type: object + properties: + transaction: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + result: + $ref: '#/components/schemas/DeliveryResult' + required: + - transaction + - result + DeviceTriggeringPatch: + description: Represents device triggering related information. + type: object + properties: + validityPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + priority: + $ref: '#/components/schemas/Priority' + applicationPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + appSrcPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + triggerPayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + DeliveryResult: + anyOf: + - type: string + enum: + - SUCCESS + - UNKNOWN + - FAILURE + - TRIGGERED + - EXPIRED + - UNCONFIRMED + - REPLACED + - TERMINATE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SUCCESS: This value indicates that the device action request was successfully completed. + - UNKNOWN: This value indicates any unspecified errors. + - FAILURE: This value indicates that this trigger encountered a delivery error and is deemed permanently undeliverable. + - TRIGGERED: This value indicates that device triggering request is accepted by the SCEF. + - EXPIRED: This value indicates that the validity period expired before the trigger could be delivered. + - UNCONFIRMED: This value indicates that the delivery of the device action request is not confirmed. + - REPLACED: This value indicates that the device triggering replacement request is accepted by the SCEF. + - TERMINATE: This value indicates that the delivery of the device action request is terminated by the SCS/AS. + readOnly: true + Priority: + anyOf: + - type: string + enum: + - NO_PRIORITY + - PRIORITY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - NO_PRIORITY: This value indicates that the device trigger has no priority. + - PRIORITY: This value indicates that the device trigger has priority. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ECRControl.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ECRControl.yaml new file mode 100644 index 000000000..8bb8645e7 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ECRControl.yaml @@ -0,0 +1,194 @@ +openapi: 3.0.0 +info: + title: 3gpp-ecr-control + version: 1.2.0 + description: | + API for enhanced converage restriction control. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-ecr-control/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /query: + post: + summary: Query the status of enhanced converage restriction for a UE. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ECRControl' + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ECRData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /configure: + post: + summary: Configure the enhanced converage restriction for a UE. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ECRControl' + responses: + '200': + description: The Enhanced Coverage Restriction setting was configured successfully.. + content: + application/json: + schema: + $ref: '#/components/schemas/ECRData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ECRControl: + description: Represents the parameters to request Enhanced Coverage Restriction control. + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + scsAsId: + type: string + description: Identifier of the SCS/AS. + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + ecrDataWbs: + type: array + items: + $ref: '#/components/schemas/PlmnEcRestrictionDataWb' + minItems: 0 + restrictedPlmnIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + minItems: 0 + description: Indicates a complete list (and possibly empty) of serving PLMNs where Enhanced Coverage shall be restricted. This attribute shall not be present for the query custom operation. + allowedPlmnIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + minItems: 0 + description: Indicates a complete list (and possibly empty) of serving PLMNs where Enhanced Coverage shall be allowed. This attribute shall not be present for the query custom operation. + required: + - supportedFeatures + oneOf: + - required: [externalId] + - required: [msisdn] + not: + required: [restrictedPlmnIds, allowedPlmnIds] + ECRData: + description: Represents the current visited PLMN (if any) and the current settings of enhanced coverage restriction. + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + visitedPlmnId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + ecrDataWbs: + type: array + items: + $ref: '#/components/schemas/PlmnEcRestrictionDataWb' + minItems: 0 + restrictedPlmnIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + minItems: 0 + description: Indicates a complete list (and possibly empty) of serving PLMNs where Enhanced Coverage shall be restricted. + allowedPlmnIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + minItems: 0 + description: Indicates a complete list (and possibly empty) of serving PLMNs where Enhanced Coverage shall be allowed. + required: + - supportedFeatures + not: + required: [restrictedPlmnIds, allowedPlmnIds] + PlmnEcRestrictionDataWb: + description: Indicates whether enhanced coverage mode is restricted or not for a PLMN ID. + type: object + properties: + plmnId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + plmnEcrDataWb: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/EcRestrictionDataWb' + required: + - plmnId diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_GMDviaMBMSbyMB2.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_GMDviaMBMSbyMB2.yaml new file mode 100644 index 000000000..0ee308534 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_GMDviaMBMSbyMB2.yaml @@ -0,0 +1,843 @@ +openapi: 3.0.0 +info: + title: GMDviaMBMSbyMB2 + description: | + API for Group Message Delivery via MBMS by MB2 + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + version: 1.2.0 +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-group-message-delivery-mb2/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/tmgi-allocation: + get: + summary: read all TMGI Allocation resource for a given SCS/AS + operationId: FetchAllTMGIAllocations + tags: + - TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of TMGI Allocation resource) + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new TMGI Allocation resource for a given SCS/AS. + operationId: CreateTMGIAllocation + tags: + - TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + requestBody: + description: representation of the TMGI Allocation to be created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + responses: + '201': + description: successful creation of an TMGI Allocation + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/tmgi-allocation/{tmgi}: + get: + summary: Read a TMGI Allocation resource for a given SCS/AS and a TMGI. + operationId: FetchIndTMGIAllocation + tags: + - Individual TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of TMGI Allocation resource) + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates an existing TMGI Allocation resource for a given SCS/AS and a TMGI. + operationId: UpdateIndTMGIAllocation + tags: + - Individual TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + requestBody: + description: representation of the TMGI Allocation to be updated in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + responses: + '200': + description: successful creation of an TMGI Allocation + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + '204': + description: The TMGI expiration time renewal is successful, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates an existing TMGI Allocation resource for a given SCS/AS and a TMGI. + operationId: ModifyIndTMGIAllocation + tags: + - Individual TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + requestBody: + description: representation of the TMGI Allocation to be updated in the SCEF + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/TMGIAllocationPatch' + responses: + '200': + description: successful creation of an TMGI Allocation + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + '204': + description: The TMGI expiration time renewal is successful, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing TMGI Allocation resource for a given SCS/AS and a TMGI. + operationId: DeleteTMGIAllocation + tags: + - Individual TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + responses: + '204': + description: No Content, successful deletion of an TMGI Allocation + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/tmgi-allocation/{tmgi}/delivery-via-mbms: + get: + summary: Read all group message delivery via MBMS resource for a given SCS/AS and a TMGI. + operationId: FecthAllGMDViaMBMSByMB2 + tags: + - Delivery via MBMS Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of Delivery via MBMS resource) + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new delivery via MBMS for a given SCS/AS and a TMGI. + operationId: CreateGMDViaMBMSByMB2 + tags: + - Delivery via MBMS Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by MB2 resource to be Created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + callbacks: + gMDByMb2Notification: + '{$request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDByMb2Notification' + responses: + '200': + description: OK (The successful acknowledgement of the notification with a body) + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Acknowledgement' + '204': + description: successful notification + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: successful creation of an GMD via MBMS by MB2 resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/tmgi-allocation/{tmgi}/delivery-via-mbms/{transactionId}: + get: + summary: Read all group message delivery via MBMS resource for a given SCS/AS and a TMGI. + operationId: FetchIndDeliveryViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of an Delivery via MBMS resource) + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates a existing delivery via MBMS for a given SCS/AS, a TMGI and transaction Id. + operationId: UpdateIndDeliveryViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by MB2 resource to be udpated in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + responses: + '200': + description: successful update of an individual GMD via MBMS by MB2 resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + '204': + description: The group message delivery is replaced successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates a existing delivery via MBMS for a given SCS/AS, a TMGI and transaction Id. + operationId: ModifyIndDeliveryViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by MB2 resource to be udpated in the SCEF + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2Patch' + responses: + '200': + description: successful update of an individual GMD via MBMS by MB2 resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + '204': + description: The group message delivery is modified successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a delivery via MBMS resource for a given SCS/AS, a TMGI and a transcation Id. + operationId: DeleteIndDeliveryViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '204': + description: No Content, successful deletion of an resouce of deliery via MBMS + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + TMGIAllocation: + description: Represents an individual TMGI Allocation resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + tmgiExpiration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRo' + GMDViaMBMSByMb2: + description: Represents a group message delivery via MBMS by MB2. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + messageDeliveryStartTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + groupMessagePayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + scefMessageDeliveryIPv4: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4AddrRo' + scefMessageDeliveryIPv6: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6AddrRo' + scefMessageDeliveryPort: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PortRo' + required: + - notificationDestination + GMDByMb2Notification: + description: Represents a group message delivery notification. + type: object + properties: + transaction: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + deliveryTriggerStatus: + type: boolean + description: Indicates whether delivery of group message payload corresponding to the TMGI was successful (TRUE) or not (FALSE) + required: + - transaction + - deliveryTriggerStatus + TMGIAllocationPatch: + description: Represents the parameters to request the modification of a TMGI Allocation resource. + type: object + properties: + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + GMDViaMBMSByMb2Patch: + description: Represents a modification request of a group message delivery via MBMS by MB2. + type: object + properties: + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + messageDeliveryStartTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + groupMessagePayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + MbmsLocArea: + description: Represents a user location area whithin which is sent a group message delivery via MBMS request. + type: object + properties: + cellId: + type: array + items: + type: string + minItems: 1 + description: Indicates a Cell Global Identification of the user which identifies the cell the UE is registered. + enodeBId: + type: array + items: + type: string + minItems: 1 + description: Indicates an eNodeB in which the UE is currently located. + geographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies a geographic area of the user where the UE is located. + mbmsServiceAreaId: + type: array + items: + type: string + minItems: 1 + description: Identifies an MBMS Service Area Identity of the user where the UE is located. + civicAddress: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + description: Identifies a civic address of the user where the UE is located. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_GMDviaMBMSbyxMB.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_GMDviaMBMSbyxMB.yaml new file mode 100644 index 000000000..619109e27 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_GMDviaMBMSbyxMB.yaml @@ -0,0 +1,761 @@ +openapi: 3.0.0 +info: + title: GMDviaMBMSbyxMB + description: | + API for Group Message Delivery via MBMS by xMB + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + version: 1.2.0 +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-group-message-delivery-xmb/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/services: + get: + summary: Read all service resources for a given SCS/AS. + operationId: FetchAllxMBServices + tags: + - Service Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of service creation resource) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceCreation' + minItems: 0 + description: The service resource for the SCS/AS in the request URI is returned. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new service creation resource for a given SCS/AS. + operationId: CreatexMBService + tags: + - Service Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + requestBody: + description: representation of the service to be created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceCreation' + responses: + '201': + description: successful creation of a service + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceCreation' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/services/{serviceId}: + get: + summary: Read a service resource for a given SCS/AS and a Service Id. + operationId: FetchIndxMBService + tags: + - Individual Service Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of service resource) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceCreation' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing service resource for a given SCS/AS and a service id. + operationId: DeletexMBService + tags: + - Individual Service Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + responses: + '204': + description: No Content, successful deletion of a service resource + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/services/{serviceId}/delivery-via-mbms: + get: + summary: Read all group message delivery via MBMS resource for a given SCS/AS and a service id. + operationId: FetchAllGMDViaMBMS + tags: + - Delivery via MBMS Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of Delivery via MBMS resource) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new delivery via MBMS for a given SCS/AS and a service Id. + operationId: CreateGMDViaMBMS + tags: + - Delivery via MBMS Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by xMB resource to be Created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + callbacks: + gMDByxMBNotification: + '{$request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDByxMBNotification' + responses: + '200': + description: OK (The successful acknowledgement of the notification with a body) + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Acknowledgement' + '204': + description: successful notification + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: successful creation of an GMD via MBMS by xMB resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/services/{serviceId}/delivery-via-mbms/{transactionId}: + get: + summary: Read all group message delivery via MBMS resource for a given SCS/AS and a service Id. + operationId: FetchIndGMDViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of an Delivery via MBMS resource) + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates an existing delivery via MBMS for a given SCS/AS, a service Id and transaction Id. + operationId: UpdateIndGMDViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by xMB resource to be udpated in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + responses: + '200': + description: successful update of an individual GMD via MBMS by xMB resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + '204': + description: The group message delivery was modified successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates an existing delivery via MBMS for a given SCS/AS, a service Id and transaction Id. + operationId: ModifyIndGMDViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by xMB resource to be udpated in the SCEF + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMBPatch' + responses: + '200': + description: successful update of an individual GMD via MBMS by xMB resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + '204': + description: The group message delivery was modified successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a delivery via MBMS resource for a given SCS/AS, a service Id and a transcation Id. + operationId: DeleteIndGMDViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '204': + description: No Content, successful deletion of an resouce of deliery via MBMS + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ServiceCreation: + description: Represents an individual xMB Service resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + userServiceId: + type: string + description: Identifies the MBMS User Service supplied by the SCEF. + readOnly: true + serviceClass: + type: string + description: The service class that service belongs to supplied by the SCEF. + readOnly: true + serviceLanguages: + type: array + items: + type: string + minItems: 1 + description: List of language of the service content supplied by the SCEF. + readOnly: true + serviceNames: + type: array + items: + type: string + minItems: 1 + description: List of Service Names supplied by the SCEF. + readOnly: true + receiveOnlyMode: + type: boolean + description: When set to 'true', the Content Provider indicates that the service is a Receive Only Mode service. This parameter is supplied by the SCEF. + readOnly: true + serviceAnnouncementMode: + $ref: '#/components/schemas/ServiceAnnouncementMode' + GMDViaMBMSByxMB: + description: Represents a group message delivery via MBMS by xMB. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + messageDeliveryStartTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + messageDeliveryStopTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + groupMessagePayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + scefMessageDeliveryIPv4: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4AddrRo' + scefMessageDeliveryIPv6: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6AddrRo' + scefMessageDeliveryPort: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PortRo' + required: + - notificationDestination + GMDByxMBNotification: + description: Represents a group message delivery notification. + type: object + properties: + transaction: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + deliveryTriggerStatus: + type: boolean + description: Indicates whether delivery of group message payload was successful(TRUE) or not (FALSE) + required: + - transaction + - deliveryTriggerStatus + GMDViaMBMSByxMBPatch: + description: Represents a modification request of a group message delivery via MBMS by xMB. + type: object + properties: + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + messageDeliveryStartTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + messageDeliveryStopTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + groupMessagePayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + MbmsLocArea: + description: Represents a user location area whithin which is sent a group message delivery via MBMS request. + type: object + properties: + cellId: + type: array + items: + type: string + minItems: 1 + description: Indicates a Cell Global Identification of the user which identifies the cell the UE is registered. + enodeBId: + type: array + items: + type: string + minItems: 1 + description: Indicates an eNodeB in which the UE is currently located. + geographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies a geographic area of the user where the UE is located. + mbmsServiceAreaId: + type: array + items: + type: string + minItems: 1 + description: Identifies an MBMS Service Area Identity of the user where the UE is located. + civicAddress: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + description: Identifies a civic address of the user where the UE is located. + ServiceAnnouncementMode: + anyOf: + - type: string + enum: + - SACH + - CONTENT_PROVIDER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SACH: BM-SC performs the service announcement for the current service using the SACH channel. + - CONTENT_PROVIDER: BM-SC provides the necessary service access information used by the Content Provider to create the service announcement information. + readOnly: true diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_MonitoringEvent.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_MonitoringEvent.yaml new file mode 100644 index 000000000..094fe0fee --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_MonitoringEvent.yaml @@ -0,0 +1,1196 @@ +openapi: 3.0.0 +info: + title: 3gpp-monitoring-event + version: 1.2.1 + description: | + API for Monitoring Event. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-monitoring-event/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + get: + summary: Read all or queried active subscriptions for the SCS/AS. + operationId: FetchAllMonitoringEventSubscriptions + tags: + - Monitoring Event Subscriptions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: ip-addrs + in: query + description: The IP address(es) of the requested UE(s). + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + - name: ip-domain + in: query + description: The IPv4 address domain identifier. The attribute may only be provided if IPv4 address is included in the ip-addrs query parameter. + required: false + schema: + type: string + - name: mac-addrs + in: query + description: The MAC address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + responses: + '200': + description: OK (Successful get all or queried active subscriptions for the SCS/AS) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MonitoringEventSubscription' + minItems: 0 + description: Monitoring event subscriptions + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource for monitoring event notification. + operationId: CreateMonitoringEventSubscription + tags: + - Monitoring Event Subscriptions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + requestBody: + description: Subscription for notification about monitoring event + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + UserConsentRevocationNotif: + '{request.body#/revocationNotifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentRevocNotif' + responses: + '204': + description: No Content (successful notification). + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: The operation is successful and immediate report is included. + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/MonitoringEventReport' + - $ref: '#/components/schemas/MonitoringEventReports' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/subscriptions/{subscriptionId}: + get: + summary: Read an active subscriptions for the SCS/AS and the subscription Id. + operationId: FetchIndMonitoringEventSubscription + tags: + - Individual Monitoring Event Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing subscription resource. + operationId: UpdateIndMonitoringEventSubscription + tags: + - Individual Monitoring Event Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + '204': + description: No Content (Successful update of the subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Modifies an existing subscription of monitoring event. + operationId: ModifyIndMonitoringEventSubscription + tags: + - Individual Monitoring Event Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource. + required: true + schema: + type: string + requestBody: + description: This is used for PATCH request for partial cancellation and/or partial addition of certain UE(s) within an active group. + required: true + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + responses: + '204': + description: The resource was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing monitoring event subscription. + operationId: DeleteIndMonitoringEventSubscription + tags: + - Individual Monitoring Event Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MonitoringEventReport' + minItems: 1 + description: The subscription was terminated successfully, the monitoring event report(s) shall be included if received. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + MonitoringEventSubscription: + description: Represents a subscription to event(s) monitoring. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + addedExternalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Indicates the added external Identifier(s) within the active group. + addedMsisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Indicates the added MSISDN(s) within the active group. + excludedExternalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Indicates cancellation of the external Identifier(s) within the active group. + excludedMsisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Indicates cancellation of the MSISDN(s) within the active group. + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + addExtGroupId: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + minItems: 2 + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + monitoringType: + $ref: '#/components/schemas/MonitoringType' + maximumNumberOfReports: + type: integer + minimum: 1 + description: Identifies the maximum number of event reports to be generated by the HSS, MME/SGSN as specified in clause 5.6.0 of 3GPP TS 23.682. + monitorExpireTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + groupReportGuardTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumDetectionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + reachabilityType: + $ref: '#/components/schemas/ReachabilityType' + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumResponseTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + suggestedNumberOfDlPackets: + type: integer + minimum: 0 + description: If "monitoringType" is "UE_REACHABILITY", this parameter may be included to identify the number of packets that the serving gateway shall buffer in case that the UE is not reachable. + idleStatusIndication: + type: boolean + description: If "monitoringType" is set to "UE_REACHABILITY" or "AVAILABILITY_AFTER_DDN_FAILURE", this parameter may be included to indicate the notification of when a UE, for which PSM is enabled, transitions into idle mode. "true" indicates enabling of notification; "false" indicate no need to notify. Default value is "false". + locationType: + $ref: '#/components/schemas/LocationType' + accuracy: + $ref: '#/components/schemas/Accuracy' + minimumReportInterval: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maxRptExpireIntvl: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + samplingInterval: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + reportingLocEstInd: + type: boolean + description: Indicates whether to request the location estimate for event reporting. + linearDistance: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LinearDistance' + locQoS: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocationQoS' + svcId: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/ServiceIdentity' + ldrType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrType' + velocityRequested: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityRequested' + maxAgeOfLocEst: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + locTimeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + supportedGADShapes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + codeWord: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/CodeWord' + associationType: + $ref: '#/components/schemas/AssociationType' + plmnIndication: + type: boolean + description: If "monitoringType" is "ROAMING_STATUS", this parameter may be included to indicate the notification of UE's Serving PLMN ID. Value "true" indicates enabling of notification; "false" indicates disabling of notification. Default value is "false". + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + dddTraDescriptors: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + dddStati: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + apiNames: + type: array + items: + type: string + minItems: 1 + monitoringEventReport: + $ref: '#/components/schemas/MonitoringEventReport' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + tgtNsThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SACInfo' + nsRepFormat: + $ref: '#/components/schemas/SACRepFormat' + afServiceId: + type: string + immediateRep: + type: boolean + uavPolicy: + $ref: '#/components/schemas/UavPolicy' + sesEstInd: + type: boolean + description: Set to true by the SCS/AS so that only UAV's with "PDU session established for DNN(s) subject to aerial service" are to be listed in the Event report. Set to false or omitted otherwise. + subType: + $ref: '#/components/schemas/SubType' + addnMonTypes: + type: array + items: + $ref: '#/components/schemas/MonitoringType' + addnMonEventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringEventReport' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ueMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + revocationNotifUri: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' + required: + - notificationDestination + - monitoringType + anyOf: + - required: [maximumNumberOfReports] + - required: [monitorExpireTime] + MonitoringNotification: + description: Represents an event monitoring notification. + type: object + properties: + subscription: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + configResults: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ConfigResult' + minItems: 1 + description: Each element identifies a notification of grouping configuration result. + monitoringEventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringEventReport' + minItems: 1 + description: Monitoring event reports. + addedExternalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Identifies the added external Identifier(s) within the active group via the "externalGroupId" attribute within the MonitoringEventSubscription data type. + addedMsisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Identifies the added MSISDN(s) within the active group via the "externalGroupId" attribute within the MonitoringEventSubscription data type. + cancelExternalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Identifies the cancelled external Identifier(s) within the active group via the "externalGroupId" attribute within the MonitoringEventSubscription data type. + cancelMsisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Identifies the cancelled MSISDN(s) within the active group via the "externalGroupId" attribute within the MonitoringEventSubscription data type. + cancelInd: + type: boolean + description: > + Indicates whether to request to cancel the corresponding monitoring subscription. + Set to false or omitted otherwise. + appliedParam: + $ref: '#/components/schemas/AppliedParameterConfiguration' + required: + - subscription + MonitoringEventReport: + description: Represents an event monitoring report. + type: object + properties: + imeiChange: + $ref: '#/components/schemas/AssociationType' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + idleStatusInfo: + $ref: '#/components/schemas/IdleStatusInfo' + locationInfo: + $ref: '#/components/schemas/LocationInfo' + locFailureCause: + $ref: '#/components/schemas/LocationFailureCause' + lossOfConnectReason: + type: integer + description: If "monitoringType" is "LOSS_OF_CONNECTIVITY", this parameter shall be included if available to identify the reason why loss of connectivity is reported. Refer to 3GPP TS 29.336 clause 8.4.58. + maxUEAvailabilityTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + monitoringType: + $ref: '#/components/schemas/MonitoringType' + uePerLocationReport: + $ref: '#/components/schemas/UePerLocationReport' + plmnId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + reachabilityType: + $ref: '#/components/schemas/ReachabilityType' + roamingStatus: + type: boolean + description: If "monitoringType" is "ROAMING_STATUS", this parameter shall be set to "true" if the UE is on roaming status. Set to false or omitted otherwise. + failureCause: + $ref: '#/components/schemas/FailureCause' + eventTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + pdnConnInfoList: + type: array + items: + $ref: '#/components/schemas/PdnConnectionInformation' + minItems: 1 + dddStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + dddTrafDescriptor: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + maxWaitTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + apiCaps: + type: array + items: + $ref: '#/components/schemas/ApiCapabilityInfo' + minItems: 0 + nSStatusInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SACEventStatus' + afServiceId: + type: string + servLevelDevId: + type: string + description: If "monitoringType" is "AREA_OF_INTEREST", this parameter may be included to identify the UAV. + uavPresInd: + type: boolean + description: If "monitoringType" is "AREA_OF_INTEREST", this parameter shall be set to true if the specified UAV is in the monitoring area. Set to false or omitted otherwise. + required: + - monitoringType + MonitoringEventReports: + description: Represents a set of event monitoring reports. + type: object + properties: + monitoringEventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringEventReport' + minItems: 1 + required: + - monitoringEventReports + IdleStatusInfo: + description: Represents the information relevant to when the UE transitions into idle mode. + type: object + properties: + activeTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + edrxCycleLength: + format: float + type: number + minimum: 0 + suggestedNumberOfDlPackets: + type: integer + minimum: 0 + description: Identifies the number of packets shall be buffered in the serving gateway. It shall be present if the idle status indication is requested by the SCS/AS with "idleStatusIndication" in the "monitoringEventSubscription" sets to "true". + idleStatusTimestamp: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + periodicAUTimer: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + UePerLocationReport: + description: Represents the number of UEs found at the indicated location. + type: object + properties: + ueCount: + type: integer + minimum: 0 + description: Identifies the number of UEs. + externalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Each element uniquely identifies a user. + msisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Each element identifies the MS internal PSTN/ISDN number allocated for a UE. + servLevelDevIds: + type: array + items: + type: string + minItems: 1 + description: Each element uniquely identifies a UAV. + required: + - ueCount + LocationInfo: + description: Represents the user location information. + type: object + properties: + ageOfLocationInfo: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationMin' + cellId: + type: string + description: Indicates the Cell Global Identification of the user which identifies the cell the UE is registered. + enodeBId: + type: string + description: Indicates the eNodeB in which the UE is currently located. + routingAreaId: + type: string + description: Identifies the Routing Area Identity of the user where the UE is located. + trackingAreaId: + type: string + description: Identifies the Tracking Area Identity of the user where the UE is located. + plmnId: + type: string + description: Identifies the PLMN Identity of the user where the UE is located. + twanId: + type: string + description: Identifies the TWAN Identity of the user where the UE is located. + geographicArea: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + positionMethod: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethod' + qosFulfilInd: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AccuracyFulfilmentIndicator' + ueVelocity: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' + ldrType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrType' + achievedQos: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MinorLocationQoS' + FailureCause: + description: Represents the reason of communication failure. + type: object + properties: + bssgpCause: + type: integer + description: Identifies a non-transparent copy of the BSSGP cause code. Refer to 3GPP TS 29.128. + causeType: + type: integer + description: Identify the type of the S1AP-Cause. Refer to 3GPP TS 29.128. + gmmCause: + type: integer + description: Identifies a non-transparent copy of the GMM cause code. Refer to 3GPP TS 29.128. + ranapCause: + type: integer + description: Identifies a non-transparent copy of the RANAP cause code. Refer to 3GPP TS 29.128. + ranNasCause: + type: string + description: Indicates RAN and/or NAS release cause code information, TWAN release cause code information or untrusted WLAN release cause code information. Refer to 3GPP TS 29.214. + s1ApCause: + type: integer + description: Identifies a non-transparent copy of the S1AP cause code. Refer to 3GPP TS 29.128. + smCause: + type: integer + description: Identifies a non-transparent copy of the SM cause code. Refer to 3GPP TS 29.128. + PdnConnectionInformation: + description: Represents the PDN connection information of the UE. + type: object + properties: + status: + $ref: '#/components/schemas/PdnConnectionStatus' + apn: + type: string + description: Identify the APN, it is depending on the SCEF local configuration whether or not this attribute is sent to the SCS/AS. + pdnType: + $ref: '#/components/schemas/PdnType' + interfaceInd: + $ref: '#/components/schemas/InterfaceIndication' + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addrs: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + macAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + required: + - status + - pdnType + AppliedParameterConfiguration: + description: Represents the parameter configuration applied in the network. + type: object + properties: + externalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Each element uniquely identifies a user. + msisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Each element identifies the MS internal PSTN/ISDN number allocated for a UE. + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumResponseTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumDetectionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + ApiCapabilityInfo: + description: Represents the availability information of supported API. + type: object + properties: + apiName: + type: string + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - apiName + - suppFeat + UavPolicy: + description: Represents the policy information included in the UAV presence monitoring request. + type: object + properties: + uavMoveInd: + type: boolean + revokeInd: + type: boolean + required: + - uavMoveInd + - revokeInd + + ConsentRevocNotif: + description: > + Represents the user consent revocation information conveyed in a user consent + revocation notification. + type: object + properties: + subscriptionId: + type: string + consentsRevoked: + type: array + items: + $ref: '#/components/schemas/ConsentRevoked' + minItems: 1 + required: + - subscriptionId + - consentsRevoked + + ConsentRevoked: + description: Represents the information related to a revoked user consent. + type: object + properties: + ucPurpose: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/UcPurpose' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + required: + - ucPurpose + oneOf: + - required: [externalId] + - required: [msisdn] + +# +# ENUMS +# + MonitoringType: + anyOf: + - type: string + enum: + - LOSS_OF_CONNECTIVITY + - UE_REACHABILITY + - LOCATION_REPORTING + - CHANGE_OF_IMSI_IMEI_ASSOCIATION + - ROAMING_STATUS + - COMMUNICATION_FAILURE + - AVAILABILITY_AFTER_DDN_FAILURE + - NUMBER_OF_UES_IN_AN_AREA + - PDN_CONNECTIVITY_STATUS + - DOWNLINK_DATA_DELIVERY_STATUS + - API_SUPPORT_CAPABILITY + - NUM_OF_REGD_UES + - NUM_OF_ESTD_PDU_SESSIONS + - AREA_OF_INTEREST + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - LOSS_OF_CONNECTIVITY: The SCS/AS requests to be notified when the 3GPP network detects that the UE is no longer reachable for signalling or user plane communication + - UE_REACHABILITY: The SCS/AS requests to be notified when the UE becomes reachable for sending either SMS or downlink data to the UE + - LOCATION_REPORTING: The SCS/AS requests to be notified of the current location or the last known location of the UE + - CHANGE_OF_IMSI_IMEI_ASSOCIATION: The SCS/AS requests to be notified when the association of an ME (IMEI(SV)) that uses a specific subscription (IMSI) is changed + - ROAMING_STATUS: The SCS/AS queries the UE's current roaming status and requests to get notified when the status changes + - COMMUNICATION_FAILURE: The SCS/AS requests to be notified of communication failure events + - AVAILABILITY_AFTER_DDN_FAILURE: The SCS/AS requests to be notified when the UE has become available after a DDN failure + - NUMBER_OF_UES_IN_AN_AREA: The SCS/AS requests to be notified the number of UEs in a given geographic area + - PDN_CONNECTIVITY_STATUS: The SCS/AS requests to be notified when the 3GPP network detects that the UE’s PDN connection is set up or torn down + - DOWNLINK_DATA_DELIVERY_STATUS: The AF requests to be notified when the 3GPP network detects that the downlink data delivery status is changed. + - API_SUPPORT_CAPABILITY: The SCS/AS requests to be notified of the availability of support of service APIs. + - NUM_OF_REGD_UES: The AF requests to be notified of the current number of registered UEs for a network slice. + - NUM_OF_ESTD_PDU_SESSIONS: The AF requests to be notified of the current number of established PDU Sessions for a network slice. + - AREA_OF_INTEREST: The SCS/AS requests to be notified when the UAV moves in or out of the geographic area. + ReachabilityType: + anyOf: + - type: string + enum: + - SMS + - DATA + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SMS : The SCS/AS requests to be notified when the UE becomes reachable for sending SMS to the UE + - DATA: The SCS/AS requests to be notified when the UE becomes reachable for sending downlink data to the UE + LocationType: + anyOf: + - type: string + enum: + - CURRENT_LOCATION + - LAST_KNOWN_LOCATION + - CURRENT_OR_LAST_KNOWN_LOCATION + - INITIAL_LOCATION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CURRENT_LOCATION: The SCS/AS requests to be notified for current location + - LAST_KNOWN_LOCATION: The SCS/AS requests to be notified for last known location + - CURRENT_OR_LAST_KNOWN_LOCATION: The AF requests the current or last known location + - INITIAL_LOCATION: The AF requests the initial location + AssociationType: + anyOf: + - type: string + enum: + - IMEI + - IMEISV + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - IMEI: The value shall be used when the change of IMSI-IMEI association shall be detected + - IMEISV: The value shall be used when the change of IMSI-IMEISV association shall be detected + Accuracy: + anyOf: + - type: string + enum: + - CGI_ECGI + - ENODEB + - TA_RA + - PLMN + - TWAN_ID + - GEO_AREA + - CIVIC_ADDR + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CGI_ECGI: The SCS/AS requests to be notified using cell level location accuracy. + - ENODEB: The SCS/AS requests to be notified using eNodeB level location accuracy. + - TA_RA: The SCS/AS requests to be notified using TA/RA level location accuracy. + - PLMN: The SCS/AS requests to be notified using PLMN level location accuracy. + - TWAN_ID: The SCS/AS requests to be notified using TWAN identifier level location accuracy. + - GEO_AREA: The SCS/AS requests to be notified using the geographical area accuracy. + - CIVIC_ADDR: The SCS/AS requests to be notified using the civic address accuracy. + PdnConnectionStatus: + anyOf: + - type: string + enum: + - CREATED + - RELEASED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CREATED: The PDN connection is created. + - RELEASED: The PDN connection is released. + PdnType: + anyOf: + - type: string + enum: + - IPV4 + - IPV6 + - IPV4V6 + - NON_IP + - ETHERNET + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - IPV4: PDN connection of IPv4 type. + - IPV6: PDN connection of IPv6 type. + - IPV4V6: PDN connection of IPv4v6 type. + - NON_IP: PDN connection of non-IP type. + - ETHERNET: PDN connection of Ethernet type. + InterfaceIndication: + anyOf: + - type: string + enum: + - EXPOSURE_FUNCTION + - PDN_GATEWAY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - EXPOSURE_FUNCTION: SCEF is used for the PDN connection towards the SCS/AS. + - PDN_GATEWAY: PDN gateway is used for the PDN connection towards the SCS/AS. + LocationFailureCause: + anyOf: + - type: string + enum: + - POSITIONING_DENIED + - UNSUPPORTED_BY_UE + - NOT_REGISTED_UE + - UNSPECIFIED + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: > + This string Indicates the location positioning failure cause. + Possible values are + - POSITIONING_DENIED: Positioning is denied. + - UNSUPPORTED_BY_UE: Positioning is not supported by UE. + - NOT_REGISTED_UE: UE is not registered. + - UNSPECIFIED: Unspecified. + SubType: + anyOf: + - type: string + enum: + - AERIAL_UE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - AERIAL_UE: The UE has Aerial subscription. + SACRepFormat: + anyOf: + - type: string + enum: + - NUMERICAL + - PERCENTAGE + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: Indicates the NSAC reporting format. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_MsisdnLessMoSms.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_MsisdnLessMoSms.yaml new file mode 100644 index 000000000..bc3d12c77 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_MsisdnLessMoSms.yaml @@ -0,0 +1,102 @@ +openapi: 3.0.0 +info: + title: 3gpp-msisdn-less-mo-sms + version: 1.2.0 + description: | + API for MSISDN-less Mobile Originated SMS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /: + post: + summary: Deliver a received MSIDN-less MO SMS from the SCEF to the SCS/AS. + operationId: DeliverMSISDNlessMOSMSNotification + tags: + - MSISDN-less MO SMS Notification + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MsisdnLessMoSmsNotification' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/MsisdnLessMoSmsNotificationReply' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + MsisdnLessMoSmsNotification: + description: Represents a MSISDN-less MO SMS notification. + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + sms: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + externalId: + type: string + description: External identifier has the form username@realm. + applicationPort: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + required: + - supportedFeatures + - sms + - externalId + - applicationPort + MsisdnLessMoSmsNotificationReply: + description: Represents a reply to a MSISDN-less MO SMS notification. + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supportedFeatures diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_NIDD.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_NIDD.yaml new file mode 100644 index 000000000..5caaa2252 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_NIDD.yaml @@ -0,0 +1,1233 @@ +openapi: 3.0.0 +info: + title: 3gpp-nidd + version: 1.2.1 + description: | + API for non IP data delivery. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-nidd/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/configurations: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + get: + summary: Read all NIDD configuration resources for a given SCS/AS. + operationId: FetchAllNIDDConfigurations + tags: + - NIDD configurations + responses: + '200': + description: all NIDD configurations. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NiddConfiguration' + minItems: 0 + description: individual NIDD configuration. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create a new NIDD configuration resource. + operationId: CreateNIDDConfiguration + tags: + - NIDD configurations + requestBody: + description: Contains the data to create a NIDD configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfiguration' + responses: + '201': + description: NIDD configuration is successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfiguration' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + niddNotifications: + '{$request.body#/notificationDestination}': + post: + requestBody: + description: Notification for NIDD configuration status, MO NIDD, MT NIDD delivery report. + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NiddConfigurationStatusNotification' + - $ref: '#/components/schemas/NiddUplinkDataNotification' + - $ref: '#/components/schemas/NiddDownlinkDataDeliveryStatusNotification' + - $ref: '#/components/schemas/GmdNiddDownlinkDataDeliveryNotification' + - $ref: '#/components/schemas/ManagePortNotification' + responses: + '204': + description: Expected response to a successful callback processing without a body + '200': + description: Expected response to a successful callback processing with a body + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Acknowledgement' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/configurations/{configurationId}: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read an NIDD configuration resource. + operationId: FetchIndNIDDConfiguration + tags: + - Individual NIDD configuration + responses: + '200': + description: The individual NIDD configuration is successfully retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfiguration' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing NIDD configuration resource. + operationId: ModifyNIDDConfiguration + tags: + - Individual NIDD configuration + requestBody: + description: Contains information to be applied to the individual NIDD configuration. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/NiddConfigurationPatch' + responses: + '200': + description: The Individual NIDD configuration is modified successfully and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfiguration' + '204': + description: The Individual NIDD configuration is modified successfully and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an existing NIDD configuration resource. + operationId: DeleteNIDDConfiguration + tags: + - Individual NIDD configuration + responses: + '204': + description: The Individual NIDD configuration is deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/configurations/{configurationId}/downlink-data-deliveries: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read all pending NIDD downlink data delivery resources related to a particular NIDD configuration resource. + operationId: FetchAllDownlinkDataDeliveries + tags: + - NIDD downlink data deliveries + responses: + '200': + description: all NIDD downlink data deliveries. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + minItems: 0 + description: individual NIDD downlink data delivery. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create an NIDD downlink data delivery resource related to a particular NIDD configuration resource. + operationId: CreateDownlinkDataDelivery + tags: + - NIDD downlink data deliveries + requestBody: + description: Contains the data to create a NIDD downlink data delivery. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + responses: + '200': + description: NIDD downlink data delivery is successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + '201': + description: NIDD downlink data delivery is pending. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The NIDD downlink data delivery request was not successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/configurations/{configurationId}/downlink-data-deliveries/{downlinkDataDeliveryId}: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + - name: downlinkDataDeliveryId + description: String identifying the individual NIDD downlink data delivery in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read pending NIDD downlink data delivery resource. + operationId: FetchIndDownlinkDataDelivery + tags: + - Individual NIDD downlink data delivery + responses: + '200': + description: The individual NIDD downlink data delivery is successfully retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Replace an NIDD downlink data delivery resource. + operationId: UpdateIndDownlinkDataDelivery + tags: + - Individual NIDD downlink data delivery + requestBody: + description: Contains information to be applied to the individual NIDD downlink data delivery. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + responses: + '200': + description: The pending NIDD downlink data is replaced sucessfully but delivery is pending. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + '204': + description: The NIDD downlink data delivery has been replaced successfully and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The NIDD downlink data replacement request was not successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing Individual NIDD downlink data delivery resource. + operationId: ModifyIndDownlinkDataDelivery + tags: + - Individual NIDD downlink data delivery + requestBody: + description: Contains the parameters to update an individual NIDD downlink data delivery resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransferPatch' + responses: + '200': + description: OK. The modification of the Individual NIDD downlink data delivery resource was successful and an updated representation of the resource within the NiddDownlinkDataTransfer data structure in the response message body is returned by the SCEF. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + '204': + description: No Content. The modification of the Individual NIDD downlink data delivery resource was successful and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error. The NIDD downlink data modification request was not successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an NIDD downlink data delivery resource. + operationId: DeleteIndDownlinkDataDelivery + tags: + - Individual NIDD downlink data delivery + responses: + '204': + description: The pending NIDD downlink data is deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The NIDD downlink data cancellation request was not successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/configurations/{configurationId}/rds-ports: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read all RDS ManagePort Configurations. + operationId: FetchAllManagePortConfigurations + tags: + - ManagePort Configurations + responses: + '200': + description: all ManagePort configurations. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ManagePort' + minItems: 0 + description: individual ManagePort configuration. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/configurations/{configurationId}/rds-ports/{portId}: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + - name: portId + description: The UE port number. + in: path + required: true + schema: + type: string + pattern: '^(ue([0-9]|(1[0-5]))-ef([0-9]|(1[0-5])))$' + get: + summary: Read an Individual ManagePort Configuration resource to query port numbers. + operationId: FetchIndManagePortConfiguration + tags: + - Individual ManagePort Configuration + responses: + '200': + description: The individual ManagePort configuration is successfully retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/ManagePort' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Create a new Individual ManagePort Configuration resource to reserve port numbers. + operationId: UpdateIndManagePortConfiguration + tags: + - Individual ManagePort Configuration + requestBody: + description: Contains information to be applied to the individual ManagePort configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ManagePort' + responses: + '201': + description: The individual ManagePort configuration is created. + content: + application/json: + schema: + $ref: '#/components/schemas/ManagePort' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '202': + description: The request is accepted and under processing. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The request was not successful. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RdsDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an Individual ManagePort Configuration resource to release port numbers. + operationId: DeleteIndManagePortConfiguration + tags: + - Individual ManagePort Configuration + responses: + '202': + description: The request is accepted and under processing. + '204': + description: The individual ManagePort configuration is deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The request was not successful. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RdsDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + NiddConfiguration: + description: Represents the configuration for NIDD. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + duration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service (as defined in clause 4.5.14.3 of 3GPP TS + 23.682) acknowledgement is requested (true) or not (false). Default value is false. + rdsPorts: + type: array + items: + $ref: '#/components/schemas/RdsPort' + minItems: 1 + description: Indicates the static port configuration that is used for reliable data transfer between specific applications using RDS (as defined in clause 5.2.4 and 5.2.5 of 3GPP TS 24.250). + pdnEstablishmentOption: + $ref: '#/components/schemas/PdnEstablishmentOptions' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + maximumPacketSize: + type: integer + minimum: 1 + description: The Maximum Packet Size is the maximum NIDD packet size that was transferred to the UE by the SCEF in the PCO, see clause 4.5.14.1 of 3GPP TS 23.682. If no maximum packet size was provided to the UE by the SCEF, the SCEF sends a default configured max packet size to SCS/AS. Unit bit. + readOnly: true + niddDownlinkDataTransfers: + type: array + items: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + minItems: 1 + description: The downlink data deliveries that needed to be executed by the SCEF. The cardinality of the property shall be 0..1 in the request and 0..N in the response (i.e. response may contain multiple buffered MT NIDD). + status: + $ref: '#/components/schemas/NiddStatus' + required: + - notificationDestination + oneOf: + - required: [externalId] + - required: [msisdn] + - required: [externalGroupId] + NiddDownlinkDataTransfer: + description: Represents the received NIDD downlink data from the SCS/AS. + type: object + properties: + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + data: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service (as defined in clause 4.5.14.3 of 3GPP TS + 23.682) acknowledgement is requested (true) or not (false). Default value is false. + rdsPort: + $ref: '#/components/schemas/RdsPort' + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + priority: + type: integer + description: It is used to indicate the priority of the non-IP data packet relative to other non-IP data packets. + pdnEstablishmentOption: + $ref: '#/components/schemas/PdnEstablishmentOptions' + deliveryStatus: + $ref: '#/components/schemas/DeliveryStatus' + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + required: + - data + oneOf: + - required: [externalId] + - required: [msisdn] + - required: [externalGroupId] + NiddUplinkDataNotification: + description: Represents NIDD uplink data to be notified to the SCS/AS. + type: object + properties: + niddConfiguration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + data: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service acknowledgement is requested (true) or + not (false). + rdsPort: + $ref: '#/components/schemas/RdsPort' + required: + - niddConfiguration + - data + oneOf: + - required: [externalId] + - required: [msisdn] + NiddDownlinkDataDeliveryStatusNotification: + description: Represents the delivery status of a specific NIDD downlink data delivery. + type: object + properties: + niddDownlinkDataTransfer: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + deliveryStatus: + $ref: '#/components/schemas/DeliveryStatus' + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + required: + - niddDownlinkDataTransfer + - deliveryStatus + NiddConfigurationStatusNotification: + description: Represents an NIDD configuration status notification. + type: object + properties: + niddConfiguration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + status: + $ref: '#/components/schemas/NiddStatus' + rdsCapIndication: + type: boolean + description: It indicates whether the network capability for the reliable data service is enabled or not. + rdsPort: + $ref: '#/components/schemas/RdsPort' + required: + - niddConfiguration + - status + oneOf: + - required: [externalId] + - required: [msisdn] + GmdNiddDownlinkDataDeliveryNotification: + description: Represents the delivery status of a specific group NIDD downlink data delivery. + type: object + properties: + niddDownlinkDataTransfer: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + gmdResults: + type: array + items: + $ref: '#/components/schemas/GmdResult' + minItems: 1 + description: Indicates the group message delivery result. + required: + - niddDownlinkDataTransfer + - gmdResults + RdsPort: + description: Represents the port configuration for Reliable Data Transfer. + type: object + properties: + portUE: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + portSCEF: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + required: + - portUE + - portSCEF + GmdResult: + description: Represents the group message delivery result. + type: object + properties: + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + deliveryStatus: + $ref: '#/components/schemas/DeliveryStatus' + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + required: + - deliveryStatus + oneOf: + - required: [externalId] + - required: [msisdn] + NiddDownlinkDataDeliveryFailure: + description: Represents information related to a failure delivery result. + type: object + properties: + problemDetail: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + required: + - problemDetail + ManagePort: + description: Represents the configuration of a RDS dynamic port management. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + appId: + type: string + description: Identifies the application. + manageEntity: + $ref: '#/components/schemas/ManageEntity' + skipUeInquiry: + type: boolean + description: Indicate whether to skip UE inquiry. + supportedFormats: + type: array + items: + $ref: '#/components/schemas/SerializationFormat' + minItems: 1 + description: Indicates the serialization format(s) that are supported by the SCS/AS on the associated RDS port. + configuredFormat: + $ref: '#/components/schemas/SerializationFormat' + required: + - appId + ManagePortNotification: + description: Represents a ManagePort notification of port numbers that are reserved. + type: object + properties: + niddConfiguration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + managedPorts: + type: array + items: + $ref: '#/components/schemas/ManagePort' + minItems: 1 + description: Indicates the reserved RDS port configuration information. + required: + - niddConfiguration + oneOf: + - required: [externalId] + - required: [msisdn] + RdsDownlinkDataDeliveryFailure: + description: Represents the failure delivery result for RDS. + allOf: + - $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + - type: object + properties: + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + supportedUeFormats: + type: array + items: + $ref: '#/components/schemas/SerializationFormat' + minItems: 1 + description: Indicates the serialization format(s) that are supported by the UE on the associated RDS port. + + NiddDownlinkDataTransferPatch: + description: Represents the parameters to request the modification of an Individual NIDD Downlink Data Delivery resource. + type: object + properties: + data: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service (as defined in clause 4.5.14.3 of 3GPP TS + 23.682) acknowledgement is requested (true) or not (false). + rdsPort: + $ref: '#/components/schemas/RdsPort' + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + priority: + type: integer + description: It is used to indicate the priority of the non-IP data packet relative to other non-IP data packets. + pdnEstablishmentOption: + $ref: '#/components/schemas/PdnEstablishmentOptions' + + PdnEstablishmentOptions: + anyOf: + - type: string + enum: + - WAIT_FOR_UE + - INDICATE_ERROR + - SEND_TRIGGER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - WAIT_FOR_UE: wait for the UE to establish the PDN connection + - INDICATE_ERROR: respond with an error cause + - SEND_TRIGGER: send a device trigger + PdnEstablishmentOptionsRm: + description: Represents the same information as the PdnEstablishmentOptions data type with the difference that it allows also the null value. + anyOf: + - $ref: '#/components/schemas/PdnEstablishmentOptions' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + DeliveryStatus: + anyOf: + - type: string + enum: + - SUCCESS + - SUCCESS_NEXT_HOP_ACKNOWLEDGED + - SUCCESS_NEXT_HOP_UNACKNOWLEDGED + - SUCCESS_ACKNOWLEDGED + - SUCCESS_UNACKNOWLEDGED + - TRIGGERED + - BUFFERING + - BUFFERING_TEMPORARILY_NOT_REACHABLE + - SENDING + - FAILURE + - FAILURE_RDS_DISABLED + - FAILURE_NEXT_HOP + - FAILURE_TIMEOUT + - FAILURE_TEMPORARILY_NOT_REACHABLE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SUCCESS: Success but details not provided + - SUCCESS_NEXT_HOP_ACKNOWLEDGED: Successful delivery to the next hop with acknowledgment. + - SUCCESS_NEXT_HOP_UNACKNOWLEDGED: Successful delivery to the next hop without acknowledgment + - SUCCESS_ACKNOWLEDGED: Reliable delivery was acknowledged by the UE + - SUCCESS_UNACKNOWLEDGED: Reliable delivery was not acknowledged by the UE + - TRIGGERED: The SCEF triggered the device and is buffering the data. + - BUFFERING: The SCEF is buffering the data due to no PDN connection established. + - BUFFERING_TEMPORARILY_NOT_REACHABLE: The SCEF has been informed that the UE is temporarily not reachable but is buffering the data + - SENDING: The SCEF has forwarded the data, but they may be stored elsewhere + - FAILURE: Delivery failure but details not provided + - FAILURE_RDS_DISABLED: RDS was disabled + - FAILURE_NEXT_HOP: Unsuccessful delivery to the next hop. + - FAILURE_TIMEOUT: Unsuccessful delivery due to timeout. + - FAILURE_TEMPORARILY_NOT_REACHABLE: The SCEF has been informed that the UE is temporarily not reachable without buffering the data. + readOnly: true + NiddStatus: + anyOf: + - type: string + enum: + - ACTIVE + - TERMINATED_UE_NOT_AUTHORIZED + - TERMINATED + - RDS_PORT_UNKNOWN + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - ACTIVE: The NIDD configuration is active. + - TERMINATED_UE_NOT_AUTHORIZED: The NIDD configuration was terminated because the UE´s authorisation was revoked. + - TERMINATED: The NIDD configuration was terminated. + - RDS_PORT_UNKNOWN: The RDS port is unknown. + readOnly: true + ManageEntity: + anyOf: + - type: string + enum: + - UE + - AS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - UE: Representing the UE. + - AS: Representing the Application Server. + readOnly: true + SerializationFormat: + anyOf: + - type: string + enum: + - CBOR + - JSON + - XML + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CBOR: The CBOR Serialzition format + - JSON: The JSON Serialzition format + - XML: The XML Serialzition format + NiddConfigurationPatch: + description: Represents the parameters to update a NIDD configuration. + type: object + properties: + duration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRm' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service (as defined in clause 4.5.14.3 of 3GPP TS + 23.682) acknowledgement is requested (true) or not (false). + nullable: true + rdsPorts: + type: array + items: + $ref: '#/components/schemas/RdsPort' + minItems: 1 + description: Indicates the static port configuration that is used for reliable data transfer between specific applications using RDS (as defined in clause 5.2.4 and 5.2.5 of 3GPP TS 24.250). + pdnEstablishmentOption: + $ref: '#/components/schemas/PdnEstablishmentOptionsRm' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_NpConfiguration.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_NpConfiguration.yaml new file mode 100644 index 000000000..30b30b6a7 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_NpConfiguration.yaml @@ -0,0 +1,475 @@ +openapi: 3.0.0 +info: + title: 3gpp-network-parameter-configuration + version: 1.2.0 + description: | + API for network parameter configuration. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-network-parameter-configuration/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause of 3GPP TS 29.122. +paths: + /{scsAsId}/configurations: + get: + summary: Read all of the active configurations for the SCS/AS. + operationId: FetchAllNPConfigurations + tags: + - Np Configurations + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active NpConfigurations for the SCS/AS) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NpConfiguration' + minItems: 0 + description: Network Parameter configurations + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource for network parameter configuration. + operationId: CreateNPConfiguration + tags: + - Np Configurations + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/configurations/{configurationId}: + get: + summary: Read an active configuration for the SCS/AS and the configuration Id. + operationId: FetchIndNPConfiguration + tags: + - Individual Np Configuration + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing configuration resource. + operationId: UpdateIndNPConfiguration + tags: + - Individual Np Configuration + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + responses: + '200': + description: OK (Successful update of the existing configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + '204': + description: No Content (Successful update of the configuration) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates/replaces an existing configuration resource. + operationId: ModifyIndNPConfiguration + tags: + - Individual Np Configuration + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/NpConfigurationPatch' + responses: + '200': + description: OK. The configuration was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + '204': + description: No Content. The configuration was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration. + operationId: DeleteIndNPConfiguration + tags: + - Individual Np Configuration + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '200': + description: OK. (Successful deletion of the existing configuration) + content: + application/json: + schema: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ConfigResult' + minItems: 1 + description: The configuration was terminated successfully, the configuration failure information for group members shall be included if received. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + NpConfiguration: + description: Represents a network parameters configuration. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumResponseTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + suggestedNumberOfDlPackets: + type: integer + minimum: 0 + description: This parameter may be included to identify the number of packets that the serving gateway shall buffer in case that the UE is not reachable. + groupReportingGuardTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + validityTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ueMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + oneOf: + - required: [externalId] + - required: [msisdn] + - required: [externalGroupId] + NpConfigurationPatch: + description: Represents parameters used to request the modification of a network parameters configuration resource. + type: object + properties: + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + maximumResponseTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + suggestedNumberOfDlPackets: + type: integer + minimum: 0 + description: This parameter may be included to identify the number of packets that the serving gateway shall buffer in case that the UE is not reachable. + nullable: true + groupReportGuardTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + validityTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRm' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + ConfigurationNotification: + description: Represents a configuration result notification. + type: object + properties: + configuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + configResults: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ConfigResult' + minItems: 1 + description: The grouping configuration result notification provided by the SCEF. + appliedParam: + $ref: 'TS29122_MonitoringEvent.yaml#/components/schemas/AppliedParameterConfiguration' + required: + - configuration diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_PfdManagement.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_PfdManagement.yaml new file mode 100644 index 000000000..8d4f60a58 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_PfdManagement.yaml @@ -0,0 +1,760 @@ +openapi: 3.0.0 +info: + title: 3gpp-pfd-management + version: 1.2.0 + description: | + API for PFD management. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-pfd-management/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/transactions: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + get: + summary: Read all or queried PFDs for a given SCS/AS. + operationId: FetchAllPFDManagementTransactions + tags: + - PFD Management Transactions + parameters: + - name: external-app-ids + in: query + description: The external application identifier(s) of the requested PFD data. + required: false + schema: + type: array + items: + type: string + minItems: 1 + responses: + '200': + description: OK. All or queried transactions related to the request URI are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdManagement' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create PFDs for a given SCS/AS and one or more external Application Identifier(s). + operationId: CreatePFDManagementTransaction + tags: + - PFD Management Transactions + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + description: Create a new transaction for PFD management. + responses: + '201': + description: Created. The transaction was created successfully. The SCEF shall return the created transaction in the response payload body. PfdReport may be included to provide detailed failure information for some applications. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for all applications were not created successfully. PfdReport is included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/transactions/{transactionId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: transactionId + in: path + description: Transaction ID + required: true + schema: + type: string + get: + summary: Read all PFDs for a given SCS/AS and a transaction for one or more external Application Identifier(s). + operationId: FetchIndPFDManagementTransaction + tags: + - Individual PFD Management Transaction + responses: + '200': + description: OK. The transaction information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update PFDs for a given SCS/AS and a transaction for one or more external Application Identifier(s). + operationId: UpdateIndPFDManagementTransaction + tags: + - Individual PFD Management Transaction + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + description: Change information in PFD management transaction. + responses: + '200': + description: OK. The transaction was modified successfully. The SCEF shall return an updated transaction in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + '204': + description: No Content. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for all applications were not updated successfully. PfdReport is included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing PFD Management Transaction resource. + operationId: ModifyIndPFDManagementTransaction + tags: + - Individual PFD Management Transaction + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PfdManagementPatch' + responses: + '200': + description: OK. The PFD Management Transaction was modified successfully. The SCEF shall return an updated representation of the resource in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + '204': + description: No Content. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for all applications were not modified successfully. A set of PFD Report(s) is included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete PFDs for a given SCS/AS and a transaction for one or more external Application Identifier(s). + operationId: DeleteIndPFDManagementTransaction + tags: + - Individual PFD Management Transaction + responses: + '204': + description: No Content. The transaction was deleted successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/transactions/{transactionId}/applications/{appId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: transactionId + in: path + description: Transaction ID + required: true + schema: + type: string + - name: appId + in: path + description: Identifier of the application + required: true + schema: + type: string + get: + summary: Read PFDs at individual application level. + operationId: FetchIndApplicationPFDManagement + tags: + - Individual Application PFD Management + responses: + '200': + description: OK. The application information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update PFDs at individual application level. + operationId: UpdateIndApplicationPFDManagement + tags: + - Individual Application PFD Management + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + description: Change information in application. + responses: + '200': + description: OK. The application resource was modified successfully. The SCEF shall return an updated application resource in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '204': + description: No Content. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Update PFDs at individual application level. + operationId: ModifyIndApplicationPFDManagement + tags: + - Individual Application PFD Management + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PfdData' + description: Change information in PFD management transaction. + responses: + '200': + description: OK. The transaction was modified successfully. The SCEF shall return an updated transaction in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete PFDs at individual application level. + operationId: DeleteIndApplicationPFDManagement + tags: + - Individual Application PFD Management + responses: + '204': + description: No Content. The application was deleted successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + PfdManagement: + description: Represents a PFD management resource for a PFD management request. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pfdDatas: + type: object + additionalProperties: + $ref: '#/components/schemas/PfdData' + minProperties: 1 + description: Each element uniquely identifies the PFDs for an external application identifier. Each element is identified in the map via an external application identifier as key. The response shall include successfully provisioned PFD data of application(s). + pfdReports: + type: object + additionalProperties: + $ref: '#/components/schemas/PfdReport' + minProperties: 1 + description: Supplied by the SCEF and contains the external application identifiers for which PFD(s) are not added or modified successfully. The failure reason is also included. Each element provides the related information for one or more external application identifier(s) and is identified in the map via the failure identifier as key. + readOnly: true + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + required: + - pfdDatas + PfdData: + description: Represents a PFD request to add, update or remove PFD(s) for one external application identifier. + type: object + properties: + externalAppId: + type: string + description: Each element uniquely external application identifier + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + pfds: + type: object + additionalProperties: + $ref: '#/components/schemas/Pfd' + description: Contains the PFDs of the external application identifier. Each PFD is identified in the map via a key containing the PFD identifier. + allowedDelay: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + cachingTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRo' + required: + - externalAppId + - pfds + Pfd: + description: Represents a PFD for an external Application Identifier. + type: object + properties: + pfdId: + type: string + description: Identifies a PDF of an application identifier. + flowDescriptions: + type: array + items: + type: string + minItems: 1 + description: Represents a 3-tuple with protocol, server ip and server port for UL/DL application traffic. The content of the string has the same encoding as the IPFilterRule AVP value as defined in IETF RFC 6733. + urls: + type: array + items: + type: string + minItems: 1 + description: Indicates a URL or a regular expression which is used to match the significant parts of the URL. + domainNames: + type: array + items: + type: string + minItems: 1 + description: Indicates an FQDN or a regular expression as a domain name matching criteria. + dnProtocol: + $ref: '#/components/schemas/DomainNameProtocol' + required: + - pfdId + PfdReport: + description: Represents a PFD report indicating the external application identifier(s) which PFD(s) are not added or modified successfully and the corresponding failure cause(s). + type: object + properties: + externalAppIds: + type: array + items: + type: string + minItems: 1 + description: Identifies the external application identifier(s) which PFD(s) are not added or modified successfully + failureCode: + $ref: '#/components/schemas/FailureCode' + cachingTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + locationArea: + $ref: '#/components/schemas/UserPlaneLocationArea' + required: + - externalAppIds + - failureCode + UserPlaneLocationArea: + description: Represents location area(s) of the user plane functions which are unable to enforce the provisioned PFD(s) successfully. + type: object + properties: + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 0 + description: Identifies a list of DNAI which the user plane functions support. + PfdManagementPatch: + description: Represents the parameters to request the modification of a PFD management transaction resource. + type: object + properties: + pfdDatas: + type: object + additionalProperties: + $ref: '#/components/schemas/PfdData' + minProperties: 1 + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + FailureCode: + anyOf: + - type: string + enum: + - MALFUNCTION + - RESOURCE_LIMITATION + - SHORT_DELAY + - APP_ID_DUPLICATED + - PARTIAL_FAILURE + - OTHER_REASON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - MALFUNCTION: This value indicates that something functions wrongly in PFD provisioning or the PFD provisioning does not function at all. + - RESOURCE_LIMITATION: This value indicates there is resource limitation for PFD storage. + - SHORT_DELAY: This value indicates that the allowed delay is too short and PFD(s) are not stored. + - APP_ID_DUPLICATED: The received external application identifier(s) are already provisioned. + - PARTIAL_FAILURE: The PFD(s) are not provisioned to all PCEFs/TDFs/SMFs. + - OTHER_REASON: Other reason unspecified. + DomainNameProtocol: + anyOf: + - type: string + enum: + - DNS_QNAME + - TLS_SNI + - TLS_SAN + - TSL_SCN + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - DNS_QNAME: Identifies the DNS protocol and the question name in DNS query. + - TLS_SNI: Identifies the Server Name Indication in TLS ClientHello message. + - TLS_SAN: Identifies the Subject Alternative Name in TLS ServerCertificate message. + - TLS_SCN: Identifies the Subject Common Name in TLS ServerCertificate message. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_RacsParameterProvisioning.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_RacsParameterProvisioning.yaml new file mode 100644 index 000000000..95de58d75 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_RacsParameterProvisioning.yaml @@ -0,0 +1,433 @@ +openapi: 3.0.0 +info: + title: 3gpp-racs-parameter-provisioning + version: 1.1.0 + description: | + API for provisioning UE radio capability parameters. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-racs-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/provisionings: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + get: + summary: Read all RACS parameter provisionings for a given AF. + operationId: FetchAllRACSParameterProvisionings + tags: + - RACS Parameter Provisionings + responses: + '200': + description: OK. The provisioning information related to the request URI is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RacsProvisioningData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create a new RACS parameter provisioning. + operationId: CreateRACSParameterProvisioning + tags: + - RACS Parameter Provisionings + requestBody: + description: create new provisionings for a given SCS/AS. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + responses: + '201': + description: Created. The provisioning was created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The RACS data for all RACS IDs were not provisioned successfully. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RacsFailureReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/provisionings/{provisioningId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: provisioningId + in: path + description: Provisioning ID + required: true + schema: + type: string + get: + summary: Read an existing RACS parameter provisioning. + operationId: FetchIndRACSParameterProvisioning + tags: + - Individual RACS Parameter Provisioning + responses: + '200': + description: OK. The provisioning information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify some properties in an existing RACS parameter provisioning. + operationId: ModifyIndRACSParameterProvisioning + tags: + - Individual RACS Parameter Provisioning + requestBody: + description: update an existing parameter provisioning. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/RacsProvisioningDataPatch' + responses: + '200': + description: OK. The provisioning data was updated successfully. The SCEF shall return an updated provisioning information in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + '204': + description: The provisioning data was updated successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The RACS data for all RACS IDs were not provisioned successfully. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RacsFailureReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Modify all properties in an existing RACS parameter provisioning. + operationId: UpdateIndRACSParameterProvisioning + tags: + - Individual RACS Parameter Provisioning + requestBody: + description: update an existing parameter provisioning. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + responses: + '200': + description: OK. The provisioning data was updated successfully. The SCEF shall return an updated provisioning information in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + '204': + description: The provisioning data was updated successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The RACS data for all RACS IDs were not provisioned successfully. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RacsFailureReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete a RACS parameter provisioning. + operationId: DeleteIndRACSParameterProvisioning + tags: + - Individual RACS Parameter Provisioning + responses: + '204': + description: No Content. The provisioning was terminated successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + RacsProvisioningData: + description: Represents a UE's radio capability data. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + racsConfigs: + type: object + additionalProperties: + $ref: '#/components/schemas/RacsConfiguration' + minProperties: 1 + description: Identifies the configuration related to manufacturer specific UE radio capability. Each element uniquely identifies an RACS configuration for an RACS ID and is identified in the map via the RACS ID as key. The response shall include successfully provisioned RACS data. + racsReports: + type: object + additionalProperties: + $ref: '#/components/schemas/RacsFailureReport' + minProperties: 1 + description: Supplied by the SCEF. Contains the RACS IDs for which the RACS data are not provisioned successfully. Any string value can be used as a key of the map. + readOnly: true + required: + - racsConfigs + RacsFailureReport: + description: Represents a radio capability data provisioning failure report. + type: object + properties: + racsIds: + type: array + items: + type: string + minItems: 1 + description: Identifies the RACS ID(s) for which the RACS data are not provisioned successfully. + failureCode: + $ref: '#/components/schemas/RacsFailureCode' + required: + - racsIds + - failureCode + RacsConfiguration: + description: Represents a single UE radio capability configuration data. + type: object + properties: + racsId: + type: string + description: The UE radio capability ID provided by the SCS/AS to identify the UE radio capability data. See 3GPP TS 23.003 for the encoding. + racsParamEps: + type: string + description: The UE radio capability data in EPS. + racsParam5Gs: + type: string + description: The UE radio capability data in 5GS. + imeiTacs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TypeAllocationCode' + minItems: 1 + description: Related UE model's IMEI-TAC values. + anyOf: + - required: [racsParamEps] + - required: [racsParam5Gs] + required: + - racsId + - imeiTacs + RacsProvisioningDataPatch: + description: Represents parameters to request the modification of a UE's radio capability data. + type: object + properties: + racsConfigs: + type: object + additionalProperties: + $ref: '#/components/schemas/RacsConfigurationRm' + minProperties: 1 + description: Identifies the configuration related to manufactuer specific UE radio capability. Each element uniquely identifies an RACS configuration for an RACS ID and is identified in the map via the RACS ID as key. + RacsConfigurationRm: + description: Represents the same as the RacsConfiguration data type but with the nullable:true property. + type: object + properties: + racsParamEps: + type: string + description: The UE radio capability data in EPS. + nullable: true + racsParam5Gs: + type: string + description: The UE radio capability data in 5GS. + nullable: true + imeiTacs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TypeAllocationCode' + minItems: 1 + description: Related UE model's IMEI-TAC values. + nullable: true + RacsFailureCode: + anyOf: + - type: string + enum: + - MALFUNCTION + - RESOURCE_LIMITATION + - RACS_ID_DUPLICATED + - OTHER_REASON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - MALFUNCTION: This value indicates that something functions wrongly in RACS provisioning or the RACS provisioning does not function at all. + - RESOURCE_LIMITATION: This value indicates there is resource limitation for RACS data storage. + - RACS_ID_DUPLICATED: The received RACS identifier(s) are already provisioned. + - OTHER_REASON: Other reason unspecified. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ReportingNetworkStatus.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ReportingNetworkStatus.yaml new file mode 100644 index 000000000..e78e121a6 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ReportingNetworkStatus.yaml @@ -0,0 +1,427 @@ +openapi: 3.0.0 +info: + title: 3gpp-network-status-reporting + version: 1.2.0 + description: | + API for reporting network status. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-net-stat-report/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + get: + summary: Read all network status reporting subscription resources for a given SCS/AS. + operationId: FetchAllNwStatusReportSubscriptions + tags: + - Network Status Reporting Subscriptions + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Create a new network status reporting subscription resource. + operationId: CreateNwStatusReportSubscription + tags: + - Network Status Reporting Subscriptions + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: The subscription was created successfully. The URI of the created resource shall be returned in the "Location" HTTP header. + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/subscriptions/{subscriptionId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: subscriptionId + in: path + description: Identifier of the subscription resource of type string + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ResourceId' + get: + summary: Read an active network status reporting subscription resource. + operationId: FetchIndNwStatusReportSubscription + tags: + - Individual Network Status Reporting subscription + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Modify an existing subscription resource to update a subscription. + operationId: UpdateIndNwStatusReportSubscription + tags: + - Individual Network Status Reporting subscription + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + responses: + '200': + description: The subscription was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + '204': + description: No Content. The subscription was updated successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing Individual Network Status Reporting Subscription resource. + operationId: ModifyIndNwStatusReportSubscription + tags: + - Individual Network Status Reporting Subscription + requestBody: + description: Contains the parameters to modify an existing Individual Network Status Reporting Subscription resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/NetStatusRepSubsPatch' + responses: + '200': + description: OK. The modification of the Individual Network Status Reporting Subscription resource was successfull. The SCEF shall return an updated representation of the resource within the NetworkStatusReportingSubscription data structure in the response message body. + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + '204': + description: No Content. The modification of the Individual Network Status Reporting Subscription resource was successfull and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an existing continuous network status reporting subscription resource. + operationId: DeleteIndNwStatusReportSubscription + tags: + - Individual Network Status Reporting subscription + responses: + '204': + description: The subscription was updated successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + NetworkStatusReportingSubscription: + description: Represents a subscription to network status information reporting. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + timeDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + thresholdValues: + type: array + items: + $ref: '#/components/schemas/CongestionValue' + minItems: 1 + description: Identifies a list of congestion level(s) with exact value that the SCS/AS requests to be informed of when reached. + thresholdTypes: + type: array + items: + $ref: '#/components/schemas/CongestionType' + minItems: 1 + description: Identifies a list of congestion level(s) with abstracted value that the SCS/AS requests to be informed of when reached. + required: + - notificationDestination + - locationArea + not: + required: [thresholdValues, thresholdTypes] + + NetStatusRepSubsPatch: + description: Represents the parameters to request the modification of network status reporting subscription. + type: object + properties: + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + timeDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRm' + thresholdValues: + type: array + items: + $ref: '#/components/schemas/CongestionValue' + minItems: 1 + thresholdTypes: + type: array + items: + $ref: '#/components/schemas/CongestionType' + minItems: 1 + not: + required: [thresholdValues, thresholdTypes] + + NetworkStatusReportingNotification: + description: Represents a network status reporting notification. + type: object + properties: + subscription: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + nsiValue: + $ref: '#/components/schemas/CongestionValue' + nsiType: + $ref: '#/components/schemas/CongestionType' + required: + - subscription + not: + required: [nsiValue, nsiType] + CongestionValue: + type: integer + minimum: 0 + maximum: 31 + description: Unsigned integer with valid values between 0 and 31. The value 0 indicates that there is no congestion. The value 1 is the lowest congestion level and value 31 is the highest congestion level. + CongestionType: + anyOf: + - type: string + enum: + - HIGH + - MEDIUM + - LOW + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - HIGH: The congestion status is high. + - MEDIUM: The congestion status is medium. + - LOW: The congestion status is low. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ResourceManagementOfBdt.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ResourceManagementOfBdt.yaml new file mode 100644 index 000000000..cd0eece9a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29122_ResourceManagementOfBdt.yaml @@ -0,0 +1,439 @@ +openapi: 3.0.0 +info: + title: 3gpp-bdt + version: 1.2.1 + description: | + API for BDT resouce management. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-bdt/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + get: + summary: Fetch all active background data transfer subscription resources for a given SCS/AS. + operationId: FetchAllActiveBDTSubscriptions + tags: + - BDT Subscription + responses: + '200': + description: all BDT policy subscriptions. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Bdt' + minItems: 0 + description: individual BDT policy subscription. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Creates a new background data transfer subscription resource. + operationId: CreateBDTSubscription + tags: + - BDT Subscription + requestBody: + description: Contains the data to create a BDT subscription. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + callbacks: + bDTWarningNotification: + '{$request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Background data transfer policies offered to the SCS/AS. + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/subscriptions/{subscriptionId}: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: subscriptionId + description: String identifying the individual BDT policy resource in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read a background data transfer subscription resource. + operationId: FetchIndBDTSubscription + tags: + - Individual BDT Subscription + responses: + '200': + description: Background data transfer policies offered to and selected by the SCEF. + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update a background data transfer subscription resource for negotiation of background data transfer policy. + operationId: UpdateBDTSubscription + tags: + - Individual BDT Subscription + requestBody: + description: Parameters to update/replace the existing BDT subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + responses: + '200': + description: OK (Successful update of the BDT subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + '204': + description: No Content. The Individual BDT Subscription resource was updated successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify a background data transfer subscription resource to select one of the transfer policies offered by the SCEF. + operationId: ModifyBDTSubscription + tags: + - Individual BDT Subscription + requestBody: + description: Contains information to be performed on the Bdt data structure to select a transfer policy. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/BdtPatch' + responses: + '200': + description: The Individual BDT Policy resource is modified with a selected policy and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + '204': + description: The Individual BDT Policy resource is modified with a selected policy. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete a background data transfer resource. + operationId: DeleteBDTSubscription + tags: + - Individual BDT Subscription + responses: + '204': + description: The Individual BDT Policy resource is deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + Bdt: + description: Represents a Background Data Transfer subscription. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + volumePerUE: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + numberOfUEs: + type: integer + minimum: 1 + description: Identifies the number of UEs. + desiredTimeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + referenceId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + transferPolicies: + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + description: Identifies an offered transfer policy. + readOnly: true + selectedPolicy: + type: integer + description: Identity of the selected background data transfer policy. Shall not be present in initial message exchange, can be provided by NF service consumer in a subsequent message exchange. + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + warnNotifEnabled: + type: boolean + description: > + Indicates whether the BDT warning notification is enabled (true) or not (false). Default + value is false. + trafficDes: + $ref: '#/components/schemas/TrafficDescriptor' + required: + - volumePerUE + - numberOfUEs + - desiredTimeWindow + BdtPatch: + description: Represents a Background Data Transfer subscription modification request. + type: object + properties: + selectedPolicy: + type: integer + description: Identity of the selected background data transfer policy. + warnNotifEnabled: + type: boolean + description: > + Indicates whether the BDT warning notification is enabled (true) or not (false). + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + required: + - selectedPolicy + TransferPolicy: + description: Represents an offered transfer policy sent from the SCEF to the SCS/AS, or a selected transfer policy sent from the SCS/AS to the SCEF. + type: object + properties: + bdtPolicyId: + type: integer + description: Identifier for the transfer policy + maxUplinkBandwidth: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bandwidth' + maxDownlinkBandwidth: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bandwidth' + ratingGroup: + type: integer + minimum: 0 + description: Indicates the rating group during the time window. + timeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + required: + - bdtPolicyId + - ratingGroup + - timeWindow + ExNotification: + description: Represents a Background Data Transfer notification. + type: object + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + timeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + candPolicies: + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + description: This IE indicates a list of the candidate transfer policies from which the AF may select a new transfer policy due to network performance degradation. + required: + - bdtRefId + TrafficDescriptor: + type: string + description: Identify a traffic descriptor as defined in Figure 5.2.2 of 3GPP TS 24.526, octets v+5 to w. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29502_Nsmf_PDUSession.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29502_Nsmf_PDUSession.yaml new file mode 100644 index 000000000..2e9e45550 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29502_Nsmf_PDUSession.yaml @@ -0,0 +1,4824 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'Nsmf_PDUSession' + description: | + SMF PDU Session Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.502 V17.7.0; 5G System; Session Management Services; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.502/ + +servers: + - url: '{apiRoot}/nsmf-pdusession/v1' + variables: + apiRoot: + default: https://example.com + description: > + apiRoot as defined in clause 4.4 of 3GPP TS 29.501. The sm-contexts and pdu-sessions + resources can be distributed on different processing instances or hosts. Thus the + authority and/or deployment-specific string of the apiRoot of the created individual + sm context and pdu-session resources' URIs may differ from the authority and/or + deployment-specific string of the apiRoot of the sm-contexts and pdu-sessions + collections' URIs. + +security: + - {} + - oAuth2ClientCredentials: + - nsmf-pdusession + +paths: + /sm-contexts: + post: + summary: Create SM Context + tags: + - SM contexts collection + operationId: PostSmContexts + requestBody: + description: representation of the SM context to be created in the SMF + required: true + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateData' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + binaryDataN2SmInformationExt1: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + callbacks: + smContextStatusNotification: + '{$request.body#/smContextStatusUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmContextStatusNotification' + responses: + '204': + description: successful notification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + + responses: + '201': + description: successful creation of an SM context + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreatedData' + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nsmf-pdusession//sm-contexts/{smContextRef} + required: true + schema: + type: string + + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: unsuccessful creation of an SM context - bad request + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '403': + description: unsuccessful creation of an SM context - forbidden + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '404': + description: unsuccessful creation of an SM context - not found + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: '#/components/responses/413' + '415': + $ref: '#/components/responses/415' + '429': + $ref: '#/components/responses/429' + + '500': + description: unsuccessful creation of an SM context - internal server error + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '503': + description: unsuccessful creation of an SM context - service unavailable + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + + '504': + description: unsuccessful creation of an SM context - gateway timeout + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + + /sm-contexts/{smContextRef}/retrieve: + post: + summary: Retrieve SM Context + tags: + - Individual SM context + operationId: RetrieveSmContext + parameters: + - name: smContextRef + in: path + description: SM context reference + required: true + schema: + type: string + requestBody: + description: parameters used to retrieve the SM context + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/SmContextRetrieveData' + responses: + '200': + description: successful retrieval of an SM context + content: + application/json: + schema: + $ref: '#/components/schemas/SmContextRetrievedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /sm-contexts/{smContextRef}/modify: + post: + summary: Update SM Context + tags: + - Individual SM context + operationId: UpdateSmContext + parameters: + - name: smContextRef + in: path + description: SM context reference + required: true + schema: + type: string + requestBody: + description: representation of the updates to apply to the SM context + required: true + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateData' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + binaryDataN2SmInformationExt1: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '200': + description: successful update of an SM context with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdatedData' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '204': + description: successful update of an SM context without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: unsuccessful update of an SM context - bad request + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '403': + description: unsuccessful update of an SM context - forbidden + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '404': + description: unsuccessful update of an SM context - not found + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: '#/components/responses/413' + '415': + $ref: '#/components/responses/415' + '429': + $ref: '#/components/responses/429' + '500': + description: unsuccessful update of an SM context - Internal server error + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '503': + description: unsuccessful update of an SM context - Service Unavailable + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /sm-contexts/{smContextRef}/release: + post: + summary: Release SM Context + tags: + - Individual SM context + operationId: ReleaseSmContext + parameters: + - name: smContextRef + in: path + description: SM context reference + required: true + schema: + type: string + requestBody: + description: representation of the data to be sent to the SMF when releasing the SM context + required: false + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextReleaseData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextReleaseData' + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + + responses: + '200': + description: successful release of a PDU session with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextReleasedData' + '204': + description: successful release of an SM context without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /sm-contexts/{smContextRef}/send-mo-data: + post: + summary: Send MO Data + tags: + - Individual SM context + operationId: SendMoData + parameters: + - name: smContextRef + in: path + description: SM context reference + required: true + schema: + type: string + requestBody: + description: representation of the payload of Send MO Data Request + required: true + content: + multipart/related: # message with a binary body part + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/SendMoDataReqData' + binaryMoData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryMoData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful sending of MO data + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '403': + $ref: '#/components/responses/403' + '404': + $ref: '#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: '#/components/responses/413' + '415': + $ref: '#/components/responses/415' + '429': + $ref: '#/components/responses/429' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions: + post: + summary: Create + tags: + - PDU sessions collection + operationId: PostPduSessions + requestBody: + description: representation of the PDU session to be created in the H-SMF or SMF + required: true + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/PduSessionCreateData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/PduSessionCreateData' + binaryDataN1SmInfoFromUe: + type: string + format: binary + binaryDataUnknownN1SmInfo: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoFromUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataUnknownN1SmInfo: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + callbacks: + statusNotification: + '{$request.body#/vsmfPduSessionUri}': + post: + summary: Notify Status + tags: + - Individual PDU session (V-SMF) + operationId: NotifyStatus + requestBody: + $ref: '#/components/requestBodies/NotifyStatusRequestBody' + responses: + '204': + description: successful notificationof the status change + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + statusNotification-ismf: + '{$request.body#/ismfPduSessionUri}': + post: + summary: Notify Status + tags: + - Individual PDU session (I-SMF) + operationId: NotifyStatus-isfm + requestBody: + $ref: '#/components/requestBodies/NotifyStatusRequestBody' + responses: + '204': + description: successful notificationof the status change + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + + update: + '{$request.body#/vsmfPduSessionUri}/modify': + post: + summary: Update (initiated by H-SMF) + tags: + - Individual PDU session (V-SMF) + operationId: ModifyPduSession + requestBody: + $ref: '#/components/requestBodies/VsmfUpdateRequestBody' + responses: + '200': + $ref: '#/components/responses/VsmfUpdateResponse200' + '204': + description: successful update of a PDU session without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/VsmfUpdateError' + '403': + $ref: '#/components/responses/VsmfUpdateError' + '404': + $ref: '#/components/responses/VsmfUpdateError' + '409': + $ref: '#/components/responses/VsmfUpdateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: '#/components/responses/VsmfUpdateError' + '503': + $ref: '#/components/responses/VsmfUpdateError' + '504': + $ref: '#/components/responses/VsmfUpdateError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + update-ismf: + '{$request.body#/ismfPduSessionUri}/modify': + post: + summary: Update (initiated by SMF) + tags: + - Individual PDU session (I-SMF) + operationId: ModifyPduSession-ismf + requestBody: + $ref: '#/components/requestBodies/VsmfUpdateRequestBody' + responses: + '200': + $ref: '#/components/responses/VsmfUpdateResponse200' + '204': + description: successful update of a PDU session without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/VsmfUpdateError' + '403': + $ref: '#/components/responses/VsmfUpdateError' + '404': + $ref: '#/components/responses/VsmfUpdateError' + '409': + $ref: '#/components/responses/VsmfUpdateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: '#/components/responses/VsmfUpdateError' + '503': + $ref: '#/components/responses/VsmfUpdateError' + '504': + $ref: '#/components/responses/VsmfUpdateError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + transferMtData: + '{$request.body#/vsmfPduSessionUri}/transfer-mt-data': + post: + summary: Transfer MT Data (by H-SMF) + tags: + - Individual PDU session (V-SMF) + operationId: TransferMtData + requestBody: + description: representation of the payload of Transfer MT Data Request + required: true + content: + multipart/related: # message with a binary body part + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/TransferMtDataReqData' + binaryMtData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryMtData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful transfering of MT data + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: unsuccessful delivery of mobile terminated data - gateway timeout + content: + application/json: + schema: + $ref: '#/components/schemas/TransferMtDataError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + transferMtData-ismf: + '{$request.body#/ismfPduSessionUri}/transfer-mt-data': + post: + summary: Transfer MT Data (by SMF) + tags: + - Individual PDU session (I-SMF) + operationId: TransferMtData-ismf + requestBody: + description: representation of the payload of Transfer MT Data Request + required: true + content: + multipart/related: # message with a binary body part + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/TransferMtDataReqData' + binaryMtData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryMtData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful transfering of MT data + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: unsuccessful delivery of mobile terminated data - gateway timeout + content: + application/json: + schema: + $ref: '#/components/schemas/TransferMtDataError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + responses: + '201': + description: successful creation of a PDU session + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/PduSessionCreatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/PduSessionCreatedData' + binaryDataN1SmInfoToUe: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nsmf-pdusession//pdu-sessions/{pduSessionRef} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/PduSessionCreateError' + '403': + $ref: '#/components/responses/PduSessionCreateError' + '404': + $ref: '#/components/responses/PduSessionCreateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: '#/components/responses/PduSessionCreateError' + '503': + $ref: '#/components/responses/PduSessionCreateError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions/{pduSessionRef}/modify: + post: + summary: Update (initiated by V-SMF or I-SMF) + tags: + - Individual PDU session (H-SMF or SMF) + operationId: UpdatePduSession + parameters: + - name: pduSessionRef + in: path + description: PDU session reference + required: true + schema: + type: string + requestBody: + description: representation of the updates to apply to the PDU session + required: true + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/HsmfUpdateData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/HsmfUpdateData' + binaryDataN1SmInfoFromUe: + type: string + format: binary + binaryDataUnknownN1SmInfo: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoFromUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataUnknownN1SmInfo: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + responses: + '200': + description: successful update of a PDU session with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/HsmfUpdatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/HsmfUpdatedData' + binaryDataN1SmInfoToUe: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + '204': + description: successful update of a PDU session without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/HsmfUpdateError' + '403': + $ref: '#/components/responses/HsmfUpdateError' + '404': + $ref: '#/components/responses/HsmfUpdateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: '#/components/responses/HsmfUpdateError' + '503': + $ref: '#/components/responses/HsmfUpdateError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions/{pduSessionRef}/release: + post: + summary: Release + tags: + - Individual PDU session (H-SMF or SMF) + operationId: ReleasePduSession + parameters: + - name: pduSessionRef + in: path + description: PDU session reference + required: true + schema: + type: string + requestBody: + description: data sent to H-SMF or SMF when releasing the PDU session + required: false + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/ReleaseData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/ReleaseData' + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + + responses: + '200': + description: successful release of a PDU session with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/ReleasedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/ReleasedData' + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + '204': + description: successful release of a PDU session + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions/{pduSessionRef}/retrieve: + post: + summary: Retrieve + tags: + - Individual PDU session (H-SMF or SMF) + operationId: RetrievePduSession + parameters: + - name: pduSessionRef + in: path + description: PDU session reference + required: true + schema: + type: string + requestBody: + description: representation of the payload of the Retrieve Request + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveData' + responses: + '200': + description: successful information retrieval + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/RetrievedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions/{pduSessionRef}/transfer-mo-data: + post: + summary: Transfer MO Data + tags: + - Individual PDU session (H-SMF or SMF) + operationId: TransferMoData + parameters: + - name: pduSessionRef + in: path + description: PDU session reference + required: true + schema: + type: string + requestBody: + description: representation of the payload of Transfer MO Data Request + required: true + content: + multipart/related: # message with a binary body part + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/TransferMoDataReqData' + binaryMoData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryMoData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful transfering of MO data + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nsmf-pdusession: Access to the nsmf-pdusession API + + schemas: +# +# STRUCTURED DATA TYPES +# + SmContextCreateData: + description: Data within Create SM Context Request + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + unauthenticatedSupi: + type: boolean + default: false + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + selectedDnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hplmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + servingNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + serviceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + requestType: + $ref: '#/components/schemas/RequestType' + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAnType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + presenceInLadn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + smContextStatusUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + hSmfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + hSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + additionalHsmfUri: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + additionalHsmfId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + additionalSmfUri: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + additionalSmfId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + oldPduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduSessionsActivateList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + ueEpsPdnConnection: + $ref: '#/components/schemas/EpsPdnCnxContainer' + hoState: + $ref: '#/components/schemas/HoState' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nrfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + selMode: + $ref: '#/components/schemas/DnnSelectionMode' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + hNwPubKeyId: + type: integer + epsInterworkingInd: + $ref: '#/components/schemas/EpsInterworkingIndication' + indirectForwardingFlag: + type: boolean + directForwardingFlag: + type: boolean + targetId: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/NgRanTargetId' + epsBearerCtxStatus: + $ref: '#/components/schemas/EpsBearerContextStatus' + cpCiotEnabled: + type: boolean + default: false + cpOnlyInd: + type: boolean + default: false + invokeNef: + type: boolean + default: false + maRequestInd: + type: boolean + default: false + maNwUpgradeInd: + type: boolean + default: false + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + n2SmInfoExt1: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoTypeExt1: + $ref: '#/components/schemas/N2SmInfoType' + smContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smContextSmfPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + smContextSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smContextSmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + smContextSmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smContextSmfBinding: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/SbiBindingLevel' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + extendedNasSmTimerInd: + type: boolean + default: false + dlDataWaitingInd: + type: boolean + default: false + ddnFailureSubs: + $ref: '#/components/schemas/DdnFailureSubs' + smfTransferInd: + type: boolean + default: false + oldSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + oldSmContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + wAgfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/WAgfInfo' + tngfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TngfInfo' + twifInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TwifInfo' + ranUnchangedInd: + type: boolean + samePcfSelectionInd: + type: boolean + default: false + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + nrfManagementUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfDiscoveryUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfOauth2Required: + type: object + description: 'Map indicating whether the NRF requires Oauth2-based authorization for accessing its services. The key of the map shall be the name of an NRF service, e.g. "nnrf-nfm" or "nnrf-disc"' + additionalProperties: + type: boolean + minProperties: 1 + smfBindingInfo: + type: string + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + onboardingInd: + type: boolean + default: false + oldPduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smPolicyNotifyInd: + type: boolean + default: false + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + upipSupported: + type: boolean + default: false + uavAuthenticated: + type: boolean + disasterRoamingInd: + type: boolean + default: false + anchorSmfOauth2Required: + type: boolean + smContextSmfOauth2Required: + type: boolean + required: + - servingNfId + - servingNetwork + - anType + - smContextStatusUri + + SmContextCreatedData: + description: Data within Create SM Context Response + type: object + properties: + hSmfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + allocatedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + hoState: + $ref: '#/components/schemas/HoState' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + smfServiceInstanceId: + type: string + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + selectedSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + selectedOldSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + SmContextUpdateData: + description: Data within Update SM Context Request + type: object + properties: + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + servingNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + nullable: true + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAnType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + anTypeToReactivate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + presenceInLadn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + hoState: + $ref: '#/components/schemas/HoState' + toBeSwitched: + type: boolean + default: false + failedToBeSwitched: + type: boolean + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + targetId: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/NgRanTargetId' + targetServingNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smContextStatusUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + dataForwarding: + type: boolean + default: false + n9ForwardingTunnel: + $ref: '#/components/schemas/TunnelInfo' + n9DlForwardingTnlList: + type: array + items: + $ref: '#/components/schemas/IndirectDataForwardingTunnelInfo' + minItems: 1 + n9UlForwardingTnlList: + type: array + items: + $ref: '#/components/schemas/IndirectDataForwardingTunnelInfo' + minItems: 1 + n9DlForwardingTunnel: + $ref: '#/components/schemas/TunnelInfo' + n9InactivityTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + epsBearerSetup: + type: array + items: + $ref: '#/components/schemas/EpsBearerContainer' + minItems: 0 + revokeEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + release: + type: boolean + default: false + cause: + $ref: '#/components/schemas/Cause' + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + epsInterworkingInd: + $ref: '#/components/schemas/EpsInterworkingIndication' + anTypeCanBeChanged: + type: boolean + default: false + n2SmInfoExt1: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoTypeExt1: + $ref: '#/components/schemas/N2SmInfoType' + maReleaseInd: + $ref: '#/components/schemas/MaReleaseIndication' + maNwUpgradeInd: + type: boolean + default: false + maRequestInd: + type: boolean + default: false + exemptionInd: + $ref: '#/components/schemas/ExemptionInd' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + extendedNasSmTimerInd: + type: boolean + forwardingFTeid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + forwardingBearerContexts: + type: array + items: + $ref: '#/components/schemas/ForwardingBearerContainer' + minItems: 1 + ddnFailureSubs: + $ref: '#/components/schemas/DdnFailureSubs' + skipN2PduSessionResRelInd: + type: boolean + default: false + secondaryRatUsageDataReportContainer: + type: array + items: + $ref: '#/components/schemas/SecondaryRatUsageDataReportContainer' + minItems: 1 + smPolicyNotifyInd: + type: boolean + enum: + - true + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + + SmContextUpdatedData: + description: Data within Update SM Context Response + type: object + properties: + upCnxState: + $ref: '#/components/schemas/UpCnxState' + hoState: + $ref: '#/components/schemas/HoState' + releaseEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + allocatedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + modifiedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + epsBearerSetup: + type: array + items: + $ref: '#/components/schemas/EpsBearerContainer' + minItems: 1 + dataForwarding: + type: boolean + n3DlForwardingTnlList: + type: array + items: + $ref: '#/components/schemas/IndirectDataForwardingTunnelInfo' + minItems: 1 + n3UlForwardingTnlList: + type: array + items: + $ref: '#/components/schemas/IndirectDataForwardingTunnelInfo' + minItems: 1 + n9UlForwardingTunnel: + $ref: '#/components/schemas/TunnelInfo' + cause: + $ref: '#/components/schemas/Cause' + maAcceptedInd: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + forwardingFTeid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + forwardingBearerContexts: + type: array + items: + $ref: '#/components/schemas/ForwardingBearerContainer' + minItems: 1 + selectedSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + selectedOldSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + anchorSmfFeatures: + $ref: '#/components/schemas/AnchorSmfFeatures' + + SmContextReleaseData: + description: Data within Release SM Context Request + type: object + properties: + cause: + $ref: '#/components/schemas/Cause' + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + vsmfReleaseOnly: + type: boolean + default: false + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + ismfReleaseOnly: + type: boolean + default: false + + SmContextReleasedData: + description: Data within Release SM Context Response + type: object + properties: + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + + SmContextStatusNotification: + description: Data within Notify SM Context Status Request + type: object + properties: + statusInfo : + $ref: '#/components/schemas/StatusInfo' + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + ddnFailureStatus: + type: boolean + default: false + notifyCorrelationIdsForddnFailure: + type: array + items: + type: string + minItems: 1 + newIntermediateSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + newSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + newSmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + oldSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + oldSmContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altAnchorSmfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altAnchorSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + targetDnaiInfo: + $ref: '#/components/schemas/TargetDnaiInfo' + oldPduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - statusInfo + + PduSessionCreateData: + description: Data within Create Request + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + unauthenticatedSupi: + type: boolean + default: false + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + selectedDnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hplmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + vsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ismfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + requestType: + $ref: '#/components/schemas/RequestType' + epsBearerId: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + pgwS8cFteid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + vsmfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ismfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + vcnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + icnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + n9ForwardingTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + additionalCnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAnType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + n1SmInfoFromUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + unknownN1SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hPcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + hoPreparationIndication: + type: boolean + selMode: + $ref: '#/components/schemas/DnnSelectionMode' + alwaysOnRequested: + type: boolean + default: false + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + hNwPubKeyId: + type: integer + epsInterworkingInd: + $ref: '#/components/schemas/EpsInterworkingIndication' + vSmfServiceInstanceId: + type: string + iSmfServiceInstanceId: + type: string + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + chargingId: + type: string + pattern: '^(0|([1-9]{1}[0-9]{0,9}))$' + oldPduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + epsBearerCtxStatus: + $ref: '#/components/schemas/EpsBearerContextStatus' + amfNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + maxIntegrityProtectedDataRateUl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + cpCiotEnabled: + type: boolean + default: false + cpOnlyInd: + type: boolean + default: false + invokeNef: + type: boolean + default: false + maRequestInd: + type: boolean + default: false + maNwUpgradeInd: + type: boolean + default: false + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + presenceInLadn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + secondaryRatUsageInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' + minItems: 1 + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + dlServingPlmnRateCtl: + type: integer + minimum: 10 + upSecurityInfo: + $ref: '#/components/schemas/UpSecurityInfo' + vplmnQos: + $ref: '#/components/schemas/VplmnQos' + oldSmContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + redundantPduSessionInfo: + $ref: '#/components/schemas/RedundantPduSessionInformation' + oldPduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smPolicyNotifyInd: + type: boolean + default: false + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + upipSupported: + type: boolean + default: false + upCnxState: + $ref: '#/components/schemas/UpCnxState' + disasterRoamingInd: + type: boolean + default: false + required: + - dnn + - servingNetwork + - anType + oneOf: + - required: [ vsmfId, vsmfPduSessionUri ] + - required: [ ismfId, ismfPduSessionUri ] + + PduSessionCreatedData: + description: Data within Create Response + type: object + properties: + pduSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sscMode: + type: string + pattern: '^[0-7]$' + hcnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + cnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + additionalCnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + qosFlowsSetupList: + type: array + items: + $ref: '#/components/schemas/QosFlowSetupItem' + minItems: 1 + hSmfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + enablePauseCharging: + type: boolean + default: false + ueIpv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + epsBearerInfo: + type: array + items: + $ref: '#/components/schemas/EpsBearerInfo' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + maxIntegrityProtectedDataRate: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + alwaysOnGranted: + type: boolean + default: false + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + hSmfServiceInstanceId: + type: string + smfServiceInstanceId: + type: string + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + ipv6MultiHomingInd: + type: boolean + default: false + maAcceptedInd: + type: boolean + default: false + homeProvidedChargingId: + type: string + pattern: '^(0|([1-9]{1}[0-9]{0,9}))$' + nefExtBufSupportInd: + type: boolean + default: false + smallDataRateControlEnabled: + type: boolean + default: false + ueIpv6InterfaceId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + ipv6Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + dnAaaAddress: + $ref: '#/components/schemas/IpAddress' + redundantPduSessionInfo: + $ref: '#/components/schemas/RedundantPduSessionInformation' + nspuSupportInd: + type: boolean + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + intraPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - pduSessionType + - sscMode + oneOf: + - required: [ hSmfInstanceId ] + - required: [ smfInstanceId ] + + HsmfUpdateData: + description: Data within Update Request towards H-SMF, or from I-SMF to SMF + type: object + properties: + requestIndication: + $ref: '#/components/schemas/RequestIndication' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + vcnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + icnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + additionalCnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAnType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + pauseCharging: + type: boolean + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + n1SmInfoFromUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + unknownN1SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + qosFlowsRelNotifyList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + qosFlowsNotifyList: + type: array + items: + $ref: '#/components/schemas/QosFlowNotifyItem' + minItems: 1 + NotifyList: + type: array + items: + $ref: '#/components/schemas/PduSessionNotifyItem' + minItems: 1 +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + epsBearerId: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 0 + hoPreparationIndication: + type: boolean + revokeEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + cause: + $ref: '#/components/schemas/Cause' + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + alwaysOnRequested: + type: boolean + default: false + epsInterworkingInd: + $ref: '#/components/schemas/EpsInterworkingIndication' + secondaryRatUsageReport: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' + minItems: 1 + secondaryRatUsageInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' + minItems: 1 + anTypeCanBeChanged: + type: boolean + default: false + maReleaseInd: + $ref: '#/components/schemas/MaReleaseIndication' + maNwUpgradeInd: + type: boolean + default: false + maRequestInd: + type: boolean + default: false + unavailableAccessInd: + $ref: '#/components/schemas/UnavailableAccessIndication' + psaInfo: + type: array + items: + $ref: '#/components/schemas/PsaInformation' + minItems: 1 + ulclBpInfo: + $ref: '#/components/schemas/UlclBpInformation' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + presenceInLadn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + vsmfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + vsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + vSmfServiceInstanceId: + type: string + ismfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ismfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + iSmfServiceInstanceId: + type: string + dlServingPlmnRateCtl: + type: integer + minimum: 10 + nullable: true + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + vplmnQos: + $ref: '#/components/schemas/VplmnQos' + securityResult: + $ref: '#/components/schemas/SecurityResult' + upSecurityInfo: + $ref: '#/components/schemas/UpSecurityInfo' + amfNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + secondaryRatUsageDataReportContainer: + type: array + items: + $ref: '#/components/schemas/SecondaryRatUsageDataReportContainer' + minItems: 1 + smPolicyNotifyInd: + type: boolean + enum: + - true + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + maxIntegrityProtectedDataRateUl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + required: + - requestIndication + + HsmfUpdatedData: + description: Data within Update Response from H-SMF, or from SMF to I-SMF + type: object + properties: + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + homeProvidedChargingId: + type: string + pattern: '^(0|([1-9]{1}[0-9]{0,9}))$' + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + maxIntegrityProtectedDataRateUl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + ipv6MultiHomingInd: + type: boolean + default: false + qosFlowsSetupList: + type: array + items: + $ref: '#/components/schemas/QosFlowSetupItem' + minItems: 1 + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + epsBearerInfo: + type: array + items: + $ref: '#/components/schemas/EpsBearerInfo' + minItems: 1 + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + intraPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + ReleaseData: + description: Data within Release Request + type: object + properties: + cause: + $ref: '#/components/schemas/Cause' + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + secondaryRatUsageReport: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' + minItems: 1 + secondaryRatUsageInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' + minItems: 1 + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + + ReleasedData: + description: Data within Release Response + type: object + properties: + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + + VsmfUpdateData: + description: Data within Update Request towards V-SMF, or from SMF to I-SMF + type: object + properties: + requestIndication: + $ref: '#/components/schemas/RequestIndication' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + qosFlowsAddModRequestList: + type: array + items: + $ref: '#/components/schemas/QosFlowAddModifyRequestItem' + minItems: 1 + qosFlowsRelRequestList: + type: array + items: + $ref: '#/components/schemas/QosFlowReleaseRequestItem' + minItems: 1 + epsBearerInfo: + type: array + items: + $ref: '#/components/schemas/EpsBearerInfo' + minItems: 1 + assignEbiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + revokeEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + modifiedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + alwaysOnGranted: + type: boolean + default: false + hsmfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + newSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + newSmfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + cause: + $ref: '#/components/schemas/Cause' + n1smCause: + type: string + backOffTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maReleaseInd: + $ref: '#/components/schemas/MaReleaseIndication' + maAcceptedInd: + type: boolean + default: false + additionalCnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + n4InfoExt3: + $ref: '#/components/schemas/N4Information' + smallDataRateControlEnabled: + type: boolean + qosMonitoringInfo: + $ref: '#/components/schemas/QosMonitoringInfo' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + n9DataForwardingInd: + type: boolean + default: false + n9InactivityTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - requestIndication + + VsmfUpdatedData: + description: Data within Update Response from V-SMF, or from I-SMF to SMF + type: object + properties: + qosFlowsAddModList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + qosFlowsRelList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + qosFlowsFailedtoAddModList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + qosFlowsFailedtoRelList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + n1SmInfoFromUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + unknownN1SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + assignedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + failedToAssignEbiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + secondaryRatUsageReport: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' + minItems: 1 + secondaryRatUsageInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' + minItems: 1 + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + n4InfoExt3: + $ref: '#/components/schemas/N4Information' + + StatusNotification: + description: Data within Notify Status Request + type: object + properties: + statusInfo : + $ref: '#/components/schemas/StatusInfo' + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + targetDnaiInfo: + $ref: '#/components/schemas/TargetDnaiInfo' + oldPduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + newSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + intraPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - statusInfo + + QosFlowItem: + description: Individual QoS flow + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + cause: + $ref: '#/components/schemas/Cause' + currentQosProfileIndex: + type: integer + minimum: 1 + maximum: 8 + nullQoSProfileIndex: + type: boolean + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + required: + - qfi + + QosFlowSetupItem: + description: Individual QoS flow to setup + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + qosRules: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + ebi: + $ref: '#/components/schemas/EpsBearerId' + qosFlowDescription: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + qosFlowProfile: + $ref: '#/components/schemas/QosFlowProfile' + associatedAnType: + $ref: '#/components/schemas/QosFlowAccessType' + defaultQosRuleInd: + type: boolean + required: + - qfi + - qosRules + + QosFlowAddModifyRequestItem: + description: Individual QoS flow requested to be created or modified + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + ebi: + $ref: '#/components/schemas/EpsBearerId' + qosRules: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + qosFlowDescription: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + qosFlowProfile: + $ref: '#/components/schemas/QosFlowProfile' + associatedAnType: + $ref: '#/components/schemas/QosFlowAccessType' + required: + - qfi + + QosFlowReleaseRequestItem: + description: Individual QoS flow requested to be released + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + qosRules: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + qosFlowDescription: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + required: + - qfi + + QosFlowProfile: + description: QoS flow profile + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + nonDynamic5Qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NonDynamic5Qi' + dynamic5Qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dynamic5Qi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + gbrQosFlowInfo: + $ref: '#/components/schemas/GbrQosFlowInformation' + rqa: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReflectiveQoSAttribute' + additionalQosFlowInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AdditionalQosFlowInfo' + qosMonitoringReq: + $ref: '#/components/schemas/QosMonitoringReq' + qosRepPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - 5qi + + GbrQosFlowInformation: + description: GBR QoS flow information + type: object + properties: + maxFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + notifControl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationControl' + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + alternativeQosProfileList: + type: array + items: + $ref: '#/components/schemas/AlternativeQosProfile' + required: + - maxFbrDl + - maxFbrUl + - guaFbrDl + - guaFbrUl + + QosFlowNotifyItem: + description: Notification related to a QoS flow + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + notificationCause: + $ref: '#/components/schemas/NotificationCause' + currentQosProfileIndex: + type: integer + minimum: 1 + maximum: 8 + nullQoSProfileIndex: + type: boolean + required: + - qfi + - notificationCause + + + SmContextRetrieveData: + description: Data within Retrieve SM Context Request + type: object + properties: + targetMmeCap: + $ref: '#/components/schemas/MmeCapabilities' + smContextType: + $ref: '#/components/schemas/SmContextType' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + notToTransferEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + ranUnchangedInd: + type: boolean + default: false + + SmContextRetrievedData: + description: Data within Retrieve SM Context Response + type: object + properties: + ueEpsPdnConnection: + $ref: '#/components/schemas/EpsPdnCnxContainer' + smContext: + $ref: '#/components/schemas/SmContext' + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + dlDataWaitingInd: + type: boolean + default: false + afCoordinationInfo: + $ref: '#/components/schemas/AfCoordinationInfo' + required: + - ueEpsPdnConnection + + MmeCapabilities: + description: MME capabilities + type: object + properties: + nonIpSupported: + type: boolean + default: false + ethernetSupported: + type: boolean + default: false + upipSupported: + type: boolean + default: false + + TunnelInfo: + description: Tunnel Information + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + gtpTeid: + $ref: '#/components/schemas/Teid' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - gtpTeid + + StatusInfo: + description: Status of SM context or of PDU session + type: object + properties: + resourceStatus: + $ref: '#/components/schemas/ResourceStatus' + cause: + $ref: '#/components/schemas/Cause' + cnAssistedRanPara: + $ref: '#/components/schemas/CnAssistedRanPara' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - resourceStatus + + + EpsPdnCnxInfo: + description: EPS PDN Connection Information from H-SMF to V-SMF, or from SMF to I-SMF + type: object + properties: + pgwS8cFteid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + pgwNodeName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + linkedBearerId: + $ref: '#/components/schemas/EpsBearerId' + required: + - pgwS8cFteid + + EpsBearerInfo: + description: EPS Bearer Information from H-SMF to V-SMF, or from SMF to I-SMF + type: object + properties: + ebi: + $ref: '#/components/schemas/EpsBearerId' + pgwS8uFteid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + bearerLevelQoS: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + required: + - ebi + - pgwS8uFteid + - bearerLevelQoS + + PduSessionNotifyItem: + description: Notification related to a PDU session + type: object + properties: + notificationCause: + $ref: '#/components/schemas/NotificationCause' + required: + - notificationCause + + EbiArpMapping: + description: EBI to ARP mapping + type: object + properties: + epsBearerId: + $ref: '#/components/schemas/EpsBearerId' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + required: + - epsBearerId + - arp + + SmContextCreateError: + description: Error within Create SM Context Response + type: object + properties: + error: + $ref: '#/components/schemas/ExtProblemDetails' + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - error + + SmContextUpdateError: + description: Error within Update SM Context Response + type: object + properties: + error: + $ref: '#/components/schemas/ExtProblemDetails' + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - error + + PduSessionCreateError: + description: Error within Create Response + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + n1smCause: + type: string + pattern: '^[A-F0-9]{2}$' + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + backOffTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - error + + HsmfUpdateError: + description: Error within Update Response from H-SMF, or from SMF to I-SMF + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + n1smCause: + type: string + pattern: '^[A-F0-9]{2}$' + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + backOffTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - error + + VsmfUpdateError: + description: Error within Update Response from V-SMF, or from I-SMF to SMF + type: object + properties: + error: + $ref: '#/components/schemas/ExtProblemDetails' + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + n1smCause: + type: string + pattern: '^[A-F0-9]{2}$' + n1SmInfoFromUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + unknownN1SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + failedToAssignEbiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + n4InfoExt3: + $ref: '#/components/schemas/N4Information' + required: + - error + + SmContext: + description: Complete SM Context + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + selectedDnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hplmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pduSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + hSmfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + pduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + intraPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + selMode: + $ref: '#/components/schemas/DnnSelectionMode' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + hNwPubKeyId: + type: integer + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + qosFlowsList: + type: array + items: + $ref: '#/components/schemas/QosFlowSetupItem' + minItems: 1 + hSmfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pduSessionSmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + pduSessionSmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pduSessionSmfBinding: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/SbiBindingLevel' + enablePauseCharging: + type: boolean + default: false + ueIpv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + epsBearerInfo: + type: array + items: + $ref: '#/components/schemas/EpsBearerInfo' + minItems: 1 + maxIntegrityProtectedDataRate: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + alwaysOnGranted: + type: boolean + default: false + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + hSmfServiceInstanceId: + type: string + smfServiceInstanceId: + type: string + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + forwardingInd: + type: boolean + default: false + psaTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + chargingId: + type: string + pattern: '^(0|([1-9]{1}[0-9]{0,9}))$' + chargingInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ChargingInformation' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + nefExtBufSupportInd: + type: boolean + default: false + ipv6Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + dnAaaAddress: + $ref: '#/components/schemas/IpAddress' + redundantPduSessionInfo: + $ref: '#/components/schemas/RedundantPduSessionInformation' + ranTunnelInfo: + $ref: '#/components/schemas/QosFlowTunnel' + addRanTunnelInfo: + type: array + items: + $ref: '#/components/schemas/QosFlowTunnel' + minItems: 1 + redRanTunnelInfo: + $ref: '#/components/schemas/QosFlowTunnel' + addRedRanTunnelInfo: + type: array + items: + $ref: '#/components/schemas/QosFlowTunnel' + minItems: 1 + nspuSupportInd: + type: boolean + smfBindingInfo: + type: string + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + sscMode: + type: string + pattern: '^[0-7]$' + dlsetSupportInd: + type: boolean + n9fscSupportInd: + type: boolean + disasterRoamingInd: + type: boolean + default: false + anchorSmfOauth2Required: + type: boolean + required: + - pduSessionId + - dnn + - sNssai + - pduSessionType + - sessionAmbr + - qosFlowsList + + ExemptionInd: + description: Exemption Indication + type: object + properties: + dnnCongestion: + type: boolean + default: false + snssaiOnlyCongestion: + type: boolean + default: false + snssaiDnnCongestion: + type: boolean + default: false + + PsaInformation: + description: PSA Information + type: object + properties: + psaInd: + $ref: '#/components/schemas/PsaIndication' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + ueIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + psaUpfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + DnaiInformation: + description: DNAI Information + type: object + properties: + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + noDnaiChangeInd: + type: boolean + noLocalPsaChangeInd: + type: boolean + required: + - dnai + + N4Information: + description: N4 Information + type: object + properties: + n4MessageType: + $ref: '#/components/schemas/N4MessageType' + n4MessagePayload: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n4DnaiInfo: + $ref: '#/components/schemas/DnaiInformation' + psaUpfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ulClBpId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + n9UlPdrIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + minItems: 1 + required: + - n4MessageType + - n4MessagePayload + + IndirectDataForwardingTunnelInfo: + description: Indirect Data Forwarding Tunnel Information + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + gtpTeid: + $ref: '#/components/schemas/Teid' + drbId: + $ref: '#/components/schemas/DrbId' + additionalTnlNb: + $ref: '#/components/schemas/AdditionalTnlNb' + required: + - gtpTeid + not: + required: [ drbId, additionalTnlNb ] + + SendMoDataReqData: + description: Data within Send MO Data Request + type: object + properties: + moData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + required: + - moData + + CnAssistedRanPara: + description: SMF derived CN assisted RAN parameters tuning + type: object + properties: + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndication' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTime' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationType' + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfile' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndication' + + UlclBpInformation: + description: UL CL or BP Information + type: object + properties: + ulclBpUpfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + TransferMoDataReqData: + description: Data within Transfer MO Data Request + type: object + properties: + moData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + required: + - moData + + TransferMtDataReqData: + description: Data within Transfer MT Data Request + type: object + properties: + mtData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - mtData + + TransferMtDataError: + description: Transfer MT Data Error Response + allOf: + - $ref: '#/components/schemas/ExtProblemDetails' + - $ref: '#/components/schemas/TransferMtDataAddInfo' + + TransferMtDataAddInfo: + description: Transfer MT Data Error Response Additional Information + type: object + properties: + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + VplmnQos: + description: VPLMN QoS + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + maxFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + DdnFailureSubs: + description: DDN Failure Subscription + type: object + properties: + ddnFailureSubsInd: + type: boolean + default: false + ddnFailureSubsInfoList: + type: array + items: + $ref: '#/components/schemas/DdnFailureSubInfo' + minItems: 1 + + DdnFailureSubInfo: + description: DDN Failure Subscription Information + type: object + required: + - notifyCorrelationId + properties: + notifyCorrelationId: + type: string + dddTrafficDescriptorList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + + RetrieveData: + description: Data within Retrieve Request + type: object + properties: + smallDataRateStatusReq: + type: boolean + default: false + pduSessionContextType: + $ref: '#/components/schemas/PduSessionContextType' + + RetrievedData: + description: Data within Retrieve Response + type: object + properties: + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + afCoordinationInfo: + $ref: '#/components/schemas/AfCoordinationInfo' + + SecurityResult: + description: Security Result + type: object + properties: + integrityProtectionResult: + $ref: '#/components/schemas/ProtectionResult' + confidentialityProtectionResult: + $ref: '#/components/schemas/ProtectionResult' + + UpSecurityInfo: + description: User Plane Security Information + type: object + properties: + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + maxIntegrityProtectedDataRateUl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + securityResult: + $ref: '#/components/schemas/SecurityResult' + required: + - upSecurity + + AlternativeQosProfile: + description: Alternative QoS Profile + type: object + properties: + index: + type: integer + minimum: 1 + maximum: 8 + guaFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + packetDelayBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + packetErrRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + required: + - index + + ExtProblemDetails: + description: Extended Problem Details + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ProblemDetailsAddInfo' + + ProblemDetailsAddInfo: + description: Problem Details Additional Information + type: object + properties: + remoteError: + type: boolean + + QosMonitoringInfo: + description: QoS Monitoring Information + type: object + properties: + qosMonitoringInd: + type: boolean + default: false + + IpAddress: + description: IP Address + type: object + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + - required: + - ipv6Prefix + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + RedundantPduSessionInformation: + description: Redundant PDU Session Information + type: object + properties: + rsn: + $ref: '#/components/schemas/Rsn' + pduSessionPairId: + type: integer + minimum: 0 + maximum: 255 + required: + - rsn + + QosFlowTunnel: + description: Tunnel Information per QoS Flow + type: object + properties: + qfiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + minItems: 1 + tunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + required: + - qfiList + - tunnelInfo + + TargetDnaiInfo: + description: Target DNAI Information + type: object + properties: + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + smfSelectionType: + $ref: '#/components/schemas/SmfSelectionType' + required: + - smfSelectionType + + AfCoordinationInfo: + description: AF Coordination Information + type: object + properties: + sourceDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + sourceUeIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + sourceUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + notificationInfoList: + type: array + items: + $ref: '#/components/schemas/NotificationInfo' + minItems: 1 + + NotificationInfo: + description: > + Notification Correlation ID and Notification URI provided by the NF service consumer + type: object + properties: + notifId: + type: string + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + upBufferInd: + type: boolean + default: false + required: + - notifId + - notifUri + + AnchorSmfFeatures: + description: Anchor SMF supported features + type: object + properties: + psetrSupportInd: + type: boolean + +# +# SIMPLE DATA TYPES +# + ProcedureTransactionId: + description: Procedure Transaction Identifier + type: integer + minimum: 0 + maximum: 255 + + EpsBearerId: + description: EPS Bearer Identifier + type: integer + minimum: 0 + maximum: 15 + + EpsPdnCnxContainer: + description: UE EPS PDN Connection container from SMF to AMF + type: string + + EpsBearerContainer: + description: EPS Bearer container from SMF to AMF + type: string + + Teid: + type: string + description: GTP Tunnel Endpoint Identifier + pattern: '^[A-Fa-f0-9]{8}$' + + EpsBearerContextStatus: + description: EPS bearer context status + type: string + pattern: '^[A-Fa-f0-9]{4}$' + + DrbId: + description: Data Radio Bearer Identity + type: integer + minimum: 1 + maximum: 32 + + AdditionalTnlNb: + description: indicates first, second or third additional indirect data forwarding tunnel + type: integer + minimum: 1 + maximum: 3 + + ForwardingBearerContainer: + description: Forwarding Bearer Container + type: string + + SecondaryRatUsageDataReportContainer: + description: Secondary Rat Usage Data Report Container + type: string + format: byte + +# +# ENUMERATIONS +# + UpCnxState: +# anyOf: +# - type: string + enum: + - ACTIVATED + - DEACTIVATED + - ACTIVATING + - SUSPENDED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# User Plane Connection State. Possible values are +# - ACTIVATED +# - DEACTIVATED +# - ACTIVATING +# - SUSPENDED + + HoState: +# anyOf: +# - type: string + enum: + - NONE + - PREPARING + - PREPARED + - COMPLETED + - CANCELLED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Handover state. Possible values are +# - NONE +# - PREPARING +# - PREPARED +# - COMPLETED +# - CANCELLED + + RequestType: +# anyOf: +# - type: string + enum: + - INITIAL_REQUEST + - EXISTING_PDU_SESSION + - INITIAL_EMERGENCY_REQUEST + - EXISTING_EMERGENCY_PDU_SESSION +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Request Type in Create (SM context) service operation. Possible values are +# - INITIAL_REQUEST +# - EXISTING_PDU_SESSION +# - INITIAL_EMERGENCY_REQUEST +# - EXISTING_EMERGENCY_PDU_SESSION + + RequestIndication: +# anyOf: +# - type: string + enum: + - UE_REQ_PDU_SES_MOD + - UE_REQ_PDU_SES_REL + - PDU_SES_MOB + - NW_REQ_PDU_SES_AUTH + - NW_REQ_PDU_SES_MOD + - NW_REQ_PDU_SES_REL + - EBI_ASSIGNMENT_REQ + - REL_DUE_TO_5G_AN_REQUEST +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Request Indication in Update (SM context) service operation. Possible values are +# - UE_REQ_PDU_SES_MOD +# - UE_REQ_PDU_SES_REL +# - PDU_SES_MOB +# - NW_REQ_PDU_SES_AUTH +# - NW_REQ_PDU_SES_MOD +# - NW_REQ_PDU_SES_REL +# - EBI_ASSIGNMENT_REQ +# - REL_DUE_TO_5G_AN_REQUEST + + NotificationCause: +# anyOf: +# - type: string + enum: + - QOS_FULFILLED + - QOS_NOT_FULFILLED + - UP_SEC_FULFILLED + - UP_SEC_NOT_FULFILLED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Cause for generating a notification. Possible values are +# - QOS_FULFILLED +# - QOS_NOT_FULFILLED +# - UP_SEC_FULFILLED +# - UP_SEC_NOT_FULFILLED + + Cause: +# anyOf: +# - type: string + enum: + - REL_DUE_TO_HO + - EPS_FALLBACK + - REL_DUE_TO_UP_SEC + - DNN_CONGESTION + - S_NSSAI_CONGESTION + - REL_DUE_TO_REACTIVATION + - 5G_AN_NOT_RESPONDING + - REL_DUE_TO_SLICE_NOT_AVAILABLE + - REL_DUE_TO_DUPLICATE_SESSION_ID + - PDU_SESSION_STATUS_MISMATCH + - HO_FAILURE + - INSUFFICIENT_UP_RESOURCES + - PDU_SESSION_HANDED_OVER + - PDU_SESSION_RESUMED + - CN_ASSISTED_RAN_PARAMETER_TUNING + - ISMF_CONTEXT_TRANSFER + - SMF_CONTEXT_TRANSFER + - REL_DUE_TO_PS_TO_CS_HO + - REL_DUE_TO_SUBSCRIPTION_CHANGE + - HO_CANCEL + - REL_DUE_TO_SLICE_NOT_AUTHORIZED + - PDU_SESSION_HAND_OVER_FAILURE + - DDN_FAILURE_STATUS + - REL_DUE_TO_CP_ONLY_NOT_APPLICABLE + - NOT_SUPPORTED_WITH_ISMF + - CHANGED_ANCHOR_SMF + - CHANGED_INTERMEDIATE_SMF + - TARGET_DNAI_NOTIFICATION + - REL_DUE_TO_VPLMN_QOS_FAILURE + - REL_DUE_TO_SMF_NOT_SUPPORT_PSETR + - REL_DUE_TO_SNPN_SNPN_MOBILITY + - REL_DUE_TO_NO_HR_AGREEMENT + - REL_DUE_TO_UNSPECIFIED_REASON +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Cause information. Possible values are +# - REL_DUE_TO_HO +# - EPS_FALLBACK +# - REL_DUE_TO_UP_SEC +# - DNN_CONGESTION +# - S_NSSAI_CONGESTION +# - REL_DUE_TO_REACTIVATION +# - 5G_AN_NOT_RESPONDING +# - REL_DUE_TO_SLICE_NOT_AVAILABLE +# - REL_DUE_TO_DUPLICATE_SESSION_ID +# - PDU_SESSION_STATUS_MISMATCH +# - HO_FAILURE +# - INSUFFICIENT_UP_RESOURCES +# - PDU_SESSION_HANDED_OVER +# - PDU_SESSION_RESUMED +# - CN_ASSISTED_RAN_PARAMETER_TUNING +# - ISMF_CONTEXT_TRANSFER +# - SMF_CONTEXT_TRANSFER +# - REL_DUE_TO_PS_TO_CS_HO +# - REL_DUE_TO_SUBSCRIPTION_CHANGE +# - HO_CANCEL +# - REL_DUE_TO_SLICE_NOT_AUTHORIZED +# - PDU_SESSION_HAND_OVER_FAILURE +# - DDN_FAILURE_STATUS +# - REL_DUE_TO_CP_ONLY_NOT_APPLICABLE +# - NOT_SUPPORTED_WITH_ISMF +# - CHANGED_ANCHOR_SMF +# - CHANGED_INTERMEDIATE_SMF +# - TARGET_DNAI_NOTIFICATION +# - REL_DUE_TO_VPLMN_QOS_FAILURE +# - REL_DUE_TO_SMF_NOT_SUPPORT_PSETR +# - REL_DUE_TO_SNPN_SNPN_MOBILITY +# - REL_DUE_TO_NO_HR_AGREEMENT +# - REL_DUE_TO_UNSPECIFIED_REASON + + ResourceStatus: +# anyOf: +# - type: string + enum: + - RELEASED + - UNCHANGED + - TRANSFERRED + - UPDATED + - ALT_ANCHOR_SMF +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Status of SM context or PDU session resource. Possible values are +# - RELEASED +# - UNCHANGED +# - TRANSFERRED +# - UPDATED +# - ALT_ANCHOR_SMF + + DnnSelectionMode: +# anyOf: +# - type: string + enum: + - VERIFIED + - UE_DNN_NOT_VERIFIED + - NW_DNN_NOT_VERIFIED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# DNN Selection Mode. Possible values are +# - VERIFIED +# - UE_DNN_NOT_VERIFIED +# - NW_DNN_NOT_VERIFIED + + EpsInterworkingIndication: +# anyOf: +# - type: string + enum: + - NONE + - WITH_N26 + - WITHOUT_N26 + - IWK_NON_3GPP +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# EPS Interworking Indication. Possible values are +# - NONE +# - WITH_N26 +# - WITHOUT_N26 +# - IWK_NON_3GPP + + N2SmInfoType: +# anyOf: +# - type: string + enum: + - PDU_RES_SETUP_REQ + - PDU_RES_SETUP_RSP + - PDU_RES_SETUP_FAIL + - PDU_RES_REL_CMD + - PDU_RES_REL_RSP + - PDU_RES_MOD_REQ + - PDU_RES_MOD_RSP + - PDU_RES_MOD_FAIL + - PDU_RES_NTY + - PDU_RES_NTY_REL + - PDU_RES_MOD_IND + - PDU_RES_MOD_CFM + - PATH_SWITCH_REQ + - PATH_SWITCH_SETUP_FAIL + - PATH_SWITCH_REQ_ACK + - PATH_SWITCH_REQ_FAIL + - HANDOVER_REQUIRED + - HANDOVER_CMD + - HANDOVER_PREP_FAIL + - HANDOVER_REQ_ACK + - HANDOVER_RES_ALLOC_FAIL + - SECONDARY_RAT_USAGE + - PDU_RES_MOD_IND_FAIL + - UE_CONTEXT_RESUME_REQ + - UE_CONTEXT_RESUME_RSP + - UE_CONTEXT_SUSPEND_REQ +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# N2 SM Information Type. Possible values are +# - PDU_RES_SETUP_REQ +# - PDU_RES_SETUP_RSP +# - PDU_RES_SETUP_FAIL +# - PDU_RES_REL_CMD +# - PDU_RES_REL_RSP +# - PDU_RES_MOD_REQ +# - PDU_RES_MOD_RSP +# - PDU_RES_MOD_FAIL +# - PDU_RES_NTY +# - PDU_RES_NTY_REL +# - PDU_RES_MOD_IND +# - PDU_RES_MOD_CFM +# - PATH_SWITCH_REQ +# - PATH_SWITCH_SETUP_FAIL +# - PATH_SWITCH_REQ_ACK +# - PATH_SWITCH_REQ_FAIL +# - HANDOVER_REQUIRED +# - HANDOVER_CMD +# - HANDOVER_PREP_FAIL +# - HANDOVER_REQ_ACK +# - HANDOVER_RES_ALLOC_FAIL +# - SECONDARY_RAT_USAGE +# - PDU_RES_MOD_IND_FAIL +# - UE_CONTEXT_RESUME_REQ +# - UE_CONTEXT_RESUME_RSP +# - UE_CONTEXT_SUSPEND_REQ + + MaxIntegrityProtectedDataRate: +# anyOf: +# - type: string + enum: + - 64_KBPS + - MAX_UE_RATE +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Maximum Integrity Protected Data Rate. Possible values are +# - 64_KBPS +# - MAX_UE_RATE + + MaReleaseIndication: +# anyOf: +# - type: string + enum: + - REL_MAPDU_OVER_3GPP + - REL_MAPDU_OVER_N3GPP +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Multi-Access PDU session release Indication. Possible values are +# - REL_MAPDU_OVER_3GPP +# - REL_MAPDU_OVER_N3GPP + + SmContextType: +# anyOf: +# - type: string + enum: + - EPS_PDN_CONNECTION + - SM_CONTEXT + - AF_COORDINATION_INFO +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Type of SM Context information. Possible values are +# - EPS_PDN_CONNECTION +# - SM_CONTEXT +# - AF_COORDINATION_INFO + + PsaIndication: +# anyOf: +# - type: string + enum: + - PSA_INSERTED + - PSA_REMOVED + - PSA_INSERTED_ONLY + - PSA_REMOVED_ONLY +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Indication of whether a PSA is inserted or removed. Possible values are +# - PSA_INSERTED +# - PSA_REMOVED +# - PSA_INSERTED_ONLY +# - PSA_REMOVED_ONLY + + N4MessageType: +# anyOf: +# - type: string + enum: + - PFCP_SES_EST_REQ + - PFCP_SES_EST_RSP + - PFCP_SES_MOD_REQ + - PFCP_SES_MOD_RSP + - PFCP_SES_DEL_REQ + - PFCP_SES_DEL_RSP + - PFCP_SES_REP_REQ + - PFCP_SES_REP_RSP +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# N4 Message Type. Possible values are +# - PFCP_SES_EST_REQ +# - PFCP_SES_EST_RSP +# - PFCP_SES_MOD_REQ +# - PFCP_SES_MOD_RSP +# - PFCP_SES_DEL_REQ +# - PFCP_SES_DEL_RSP +# - PFCP_SES_REP_REQ +# - PFCP_SES_REP_RSP + + QosFlowAccessType: +# anyOf: +# - type: string + enum: + - 3GPP + - NON_3GPP + - 3GPP_AND_NON_3GPP +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Access type associated with a QoS Flow. Possible values are +# - 3GPP +# - NON_3GPP +# - 3GPP_AND_NON_3GPP + + UnavailableAccessIndication: +# anyOf: +# - type: string + enum: + - 3GA_UNAVAILABLE + - N3GA_UNAVAILABLE +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Indicates the access type of a MA PDU session that is unavailable. Possible values are +# - 3GA_UNAVAILABLE +# - N3GA_UNAVAILABLE + + ProtectionResult: +# anyOf: +# - type: string + enum: + - PERFORMED + - NOT_PERFORMED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Protection Result of the security policy indicated as "preferred". Possible values are +# - PERFORMED +# - NOT_PERFORMED + + QosMonitoringReq: +# anyOf: +# - type: string + enum: + - UL + - DL + - BOTH + - NONE +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# QoS monitoring request. Possible values are +# - UL +# - DL +# - BOTH +# - NONE + + Rsn: +# anyOf: +# - type: string + enum: + - V1 + - V2 + - NONE +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Redundancy Sequence Number. Possible values are +# - V1 +# - V2 +# - NONE + + SmfSelectionType: +# anyOf: +# - type: string + enum: + - CURRENT_PDU_SESSION + - NEXT_PDU_SESSION +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Smf Selection Type. Possible values are +# - CURRENT_PDU_SESSION +# - NEXT_PDU_SESSION + + PduSessionContextType: +# anyOf: +# - type: string + enum: + - AF_COORDINATION_INFO +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Type of PDU Session information. Possible values are +# - AF_COORDINATION_INFO +# +# HTTP request bodies +# + requestBodies: + 'VsmfUpdateRequestBody': + description: representation of updates to apply to the PDU session + required: true + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/VsmfUpdateData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/VsmfUpdateData' + binaryDataN1SmInfoToUe: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + binaryDataN4InformationExt3: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt3: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + + 'NotifyStatusRequestBody': + description: representation of the status notification + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StatusNotification' + +# +# HTTP responses +# + responses: + 'VsmfUpdateResponse200': + description: successful update of a PDU session with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/VsmfUpdatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/VsmfUpdatedData' + binaryDataN1SmInfoFromUe: + type: string + format: binary + binaryDataUnknownN1SmInfo: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + binaryDataN4InformationExt3: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoFromUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataUnknownN1SmInfo: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt3: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + + 'PduSessionCreateError': + description: unsuccessful creation of a PDU session + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/PduSessionCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/PduSessionCreateError' + binaryDataN1SmInfoToUe: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + + 'HsmfUpdateError': + description: unsuccessful update of a PDU session + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/HsmfUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/HsmfUpdateError' + binaryDataN1SmInfoToUe: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + + 'VsmfUpdateError': + description: unsuccessful update of a PDU session + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/VsmfUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/VsmfUpdateError' + binaryDataN1SmInfoFromUe: + type: string + format: binary + binaryDataUnknownN1SmInfo: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + binaryDataN4InformationExt3: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoFromUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataUnknownN1SmInfo: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt3: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_EE.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_EE.yaml new file mode 100644 index 000000000..8f257c17e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_EE.yaml @@ -0,0 +1,775 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'Nudm_EE' + description: | + Nudm Event Exposure Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ee/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ee + - {} + +paths: + /{ueIdentity}/ee-subscriptions: + post: + summary: Subscribe + operationId: CreateEeSubscription + tags: + - Create EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CreatedEeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-ee/v1/{ueIdentity}/ee-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + eventOccurrenceNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MonitoringReport' + minItems: 1 + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + monitoringRevocationNotification: + '{request.body#/secondCallbackRef}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EeMonitoringRevoked' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + + + /{ueIdentity}/ee-subscriptions/{subscriptionId}: + delete: + summary: Unsubscribe + operationId: DeleteEeSubscription + tags: + - Delete EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + - name: subscriptionId + in: path + description: Id of the EE Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: Patch + operationId: UpdateEeSubscription + tags: + - Update EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + - name: subscriptionId + in: path + description: Id of the EE Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ee: Access to the nudm-ee API + + + schemas: + +# COMPLEX TYPES: + + CreatedEeSubscription: + type: object + required: + - eeSubscription + properties: + eeSubscription: + $ref: '#/components/schemas/EeSubscription' + numberOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + eventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringReport' + minItems: 1 + epcStatusInd: + type: boolean + failedMonitoringConfigs: + description: A map (list of key-value pairs where referenceId converted from integer to string serves as key; see clause 6.4.6.3.2) of FailedMonitoringConfiguration + type: object + additionalProperties: + $ref: '#/components/schemas/FailedMonitoringConfiguration' + minProperties: 1 + failedMoniConfigsEPC: + description: A map (list of key-value pairs where referenceId converted from integer to string serves as key; see clause 6.4.6.3.2) of FailedMonitoringConfiguration, the key value "ALL" may be used to identify a map entry which contains the failed cause of the EE subscription was not successful in EPC domain. + type: object + additionalProperties: + $ref: '#/components/schemas/FailedMonitoringConfiguration' + minProperties: 1 + resetIds: + type: array + items: + type: string + minItems: 1 + + + FailedMonitoringConfiguration: + description: Contains the event type and failed cause of the failed Monitoring Configuration in the EE subscription + type: object + required: + - eventType + - failedCause + properties: + eventType: + $ref: '#/components/schemas/EventType' + failedCause: + $ref: '#/components/schemas/FailedCause' + + + EeSubscription: + type: object + required: + - callbackReference + - monitoringConfigurations + properties: + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoringConfigurations: + description: A map (list of key-value pairs where ReferenceId serves as key) of MonitoringConfigurations + type: object + additionalProperties: + $ref: '#/components/schemas/MonitoringConfiguration' + minProperties: 1 + reportingOptions: + $ref: '#/components/schemas/ReportingOptions' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + subscriptionId: + type: string + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + epcAppliedInd: + type: boolean + default: false + scefDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + scefDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + notifyCorrelationId: + type: string + secondCallbackRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + excludeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + includeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + + MonitoringConfiguration: + type: object + required: + - eventType + properties: + eventType: + $ref: '#/components/schemas/EventType' + immediateFlag: + type: boolean + locationReportingConfiguration: + $ref: '#/components/schemas/LocationReportingConfiguration' + associationType: + $ref: '#/components/schemas/AssociationType' + datalinkReportCfg: + $ref: '#/components/schemas/DatalinkReportingConfiguration' + lossConnectivityCfg: + $ref: '#/components/schemas/LossConnectivityCfg' + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + suggestedPacketNumDl: + type: integer + minimum: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pduSessionStatusCfg: + $ref: '#/components/schemas/PduSessionStatusCfg' + reachabilityForSmsCfg: + $ref: '#/components/schemas/ReachabilityForSmsConfiguration' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + afId: + type: string + reachabilityForDataCfg: + $ref: '#/components/schemas/ReachabilityForDataConfiguration' + idleStatusInd: + type: boolean + default: false + + LossConnectivityCfg: + type: object + properties: + maxDetectionTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + LocationReportingConfiguration: + type: object + required: + - currentLocation + properties: + currentLocation: + type: boolean + oneTime: + type: boolean + accuracy: + $ref: '#/components/schemas/LocationAccuracy' + n3gppAccuracy: + $ref: '#/components/schemas/LocationAccuracy' + + ReportingOptions: + type: object + properties: + reportMode: + $ref: '#/components/schemas/EventReportMode' + maxNumOfReports: + $ref: '#/components/schemas/MaxNumOfReports' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + samplingRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + guardTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + reportPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + notifFlag: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationFlag' + + MonitoringReport: + type: object + required: + - referenceId + - eventType + - timeStamp + properties: + referenceId: + $ref: '#/components/schemas/ReferenceId' + eventType: + $ref: '#/components/schemas/EventType' + report: + $ref: '#/components/schemas/Report' + reachabilityForSmsReport: + $ref: '#/components/schemas/ReachabilityForSmsReport' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reachabilityReport: + $ref: '#/components/schemas/ReachabilityReport' + + Report: + oneOf: + - $ref: '#/components/schemas/ChangeOfSupiPeiAssociationReport' + - $ref: '#/components/schemas/RoamingStatusReport' + - $ref: '#/components/schemas/CnTypeChangeReport' + - $ref: '#/components/schemas/CmInfoReport' + - $ref: '#/components/schemas/LossConnectivityReport' + - $ref: '#/components/schemas/LocationReport' + - $ref: '#/components/schemas/PdnConnectivityStatReport' + + ReachabilityForSmsReport: + type: object + required: + - smsfAccessType + properties: + smsfAccessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + maxAvailabilityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ChangeOfSupiPeiAssociationReport: + type: object + required: + - newPei + properties: + newPei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + + RoamingStatusReport: + type: object + required: + - roaming + - newServingPlmn + properties: + roaming: + type: + boolean + newServingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + CnTypeChangeReport: + type: object + required: + - newCnType + properties: + newCnType: + $ref: '#/components/schemas/CnType' + oldCnType: + $ref: '#/components/schemas/CnType' + + DatalinkReportingConfiguration: + type: object + properties: + dddTrafficDes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + slice: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dddStatusList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + + CmInfoReport: + type: object + properties: + oldCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + newCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + required: + - newCmInfoList + + PduSessionStatusCfg: + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + + ReachabilityReport: + type: object + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + reachability: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + maxAvailabilityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + idleStatusIndication: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/IdleStatusIndication' + + ReachabilityForDataConfiguration: + type: object + required: + - reportCfg + properties: + reportCfg: + $ref: '#/components/schemas/ReachabilityForDataReportConfig' + minInterval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + EeMonitoringRevoked: + type: object + required: + - revokedMonitoringEventList + properties: + revokedMonitoringEventList: + description: A map (list of key-value pairs where ReferenceId serves as key) of MonitoringEvents + type: object + additionalProperties: + $ref: '#/components/schemas/MonitoringEvent' + minProperties: 1 + removedGpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + excludeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + + MonitoringEvent: + type: object + required: + - eventType + properties: + eventType: + $ref: '#/components/schemas/EventType' + revokedCause: + $ref: '#/components/schemas/RevokedCause' + + LossConnectivityReport: + type: object + required: + - lossOfConnectReason + properties: + lossOfConnectReason: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/LossOfConnectivityReason' + + LocationReport: + type: object + required: + - location + properties: + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + + PdnConnectivityStatReport: + type: object + required: + - pdnConnStat + properties: + pdnConnStat: + $ref: '#/components/schemas/PdnConnectivityStatus' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pduSeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + pduSessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + + +# SIMPLE TYPES: + + ReferenceId: + type: integer + + MaxNumOfReports: + type: integer + + +# ENUMS: + + ReachabilityForSmsConfiguration: + anyOf: + - type: string + enum: + - REACHABILITY_FOR_SMS_OVER_NAS + - REACHABILITY_FOR_SMS_OVER_IP + - type: string + + EventType: + anyOf: + - type: string + enum: + - LOSS_OF_CONNECTIVITY + - UE_REACHABILITY_FOR_DATA + - UE_REACHABILITY_FOR_SMS + - LOCATION_REPORTING + - CHANGE_OF_SUPI_PEI_ASSOCIATION + - ROAMING_STATUS + - COMMUNICATION_FAILURE + - AVAILABILITY_AFTER_DDN_FAILURE + - CN_TYPE_CHANGE + - DL_DATA_DELIVERY_STATUS + - PDN_CONNECTIVITY_STATUS + - UE_CONNECTION_MANAGEMENT_STATE + - ACCESS_TYPE_REPORT + - REGISTRATION_STATE_REPORT + - CONNECTIVITY_STATE_REPORT + - TYPE_ALLOCATION_CODE_REPORT + - FREQUENT_MOBILITY_REGISTRATION_REPORT + - PDU_SES_REL + - PDU_SES_EST + - UE_MEMORY_AVAILABLE_FOR_SMS + - type: string + + LocationAccuracy: + anyOf: + - type: string + enum: + - CELL_LEVEL + - RAN_NODE_LEVEL + - TA_LEVEL + - N3IWF_LEVEL + - UE_IP + - UE_PORT + - type: string + + CnType: + anyOf: + - type: string + enum: + - SINGLE_4G + - SINGLE_5G + - DUAL_4G5G + - type: string + + AssociationType: + anyOf: + - type: string + enum: + - IMEI_CHANGE + - IMEISV_CHANGE + - type: string + + EventReportMode: + anyOf: + - type: string + enum: + - PERIODIC + - ON_EVENT_DETECTION + - type: string + + ReachabilityForDataReportConfig: + anyOf: + - type: string + enum: + - DIRECT_REPORT + - INDIRECT_REPORT + - type: string + + RevokedCause: + anyOf: + - type: string + enum: + - NOT_ALLOWED + - EXCLUDED_FROM_GROUP + - GPSI_REMOVED + - type: string + + FailedCause: + anyOf: + - type: string + enum: + - AF_NOT_ALLOWED + - MTC_PROVIDER_NOT_ALLOWED + - MONITORING_NOT_ALLOWED + - UNSUPPORTED_MONITORING_EVENT_TYPE + - UNSUPPORTED_MONITORING_REPORT_OPTIONS + - UNSPECIFIED + - type: string + description: Indicates the Failed cause of the failed Monitoring Configuration in the EE subscription + + PdnConnectivityStatus: + anyOf: + - type: string + enum: + - ESTABLISHED + - RELEASED + - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_MT.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_MT.yaml new file mode 100644 index 000000000..69bf49368 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_MT.yaml @@ -0,0 +1,209 @@ +openapi: 3.0.0 +info: + version: '1.1.0' + title: 'Nudm_MT' + description: | + UDM MT Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.7.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-mt/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-mt + - {} + +paths: + /{supi}: + get: + summary: Query Information for the UE + operationId: QueryUeInfo + tags: + - Query UE Info + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: fields + in: query + description: attributes to be retrieved + required: true + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/loc-info/provide-loc-info: + post: + summary: Provides the UE's 5GS location information + operationId: ProvideLocationInfo + tags: + - Provide UE Location + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-mt: Access to the nudm-mt API + + + schemas: + +# COMPLEX TYPES: + + UeInfo: + description: Represents UE information. + type: object + properties: + tadsInfo: + $ref: 'TS29518_Namf_MT.yaml#/components/schemas/UeContextInfo' + userState: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/5GsUserState' + 5gSrvccInfo: + $ref: '#/components/schemas/5GSrvccInfo' + + 5GSrvccInfo: + description: Represents 5G SRVCC information for a UE. + type: object + required: + - ue5GSrvccCapability + properties: + ue5GSrvccCapability: + type: boolean + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + + LocationInfoRequest: + description: Represents information to be sent in a location information request. It contains the requested information, i.e. current location, local time zone, RAT type, or serving node identity only. + type: object + properties: + req5gsLoc: + type: boolean + default: false + reqCurrentLoc: + type: boolean + default: false + reqRatType: + type: boolean + default: false + reqTimeZone: + type: boolean + default: false + reqServingNode: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + LocationInfoResult: + description: Represents the requested location information. + type: object + properties: + vPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + currentLoc: + type: boolean + geoInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + locationAge: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + +# SIMPLE TYPES: + + +# ENUMS: + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_NIDDAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_NIDDAU.yaml new file mode 100644 index 000000000..2d1c2a1ff --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_NIDDAU.yaml @@ -0,0 +1,195 @@ +openapi: 3.0.0 + +info: + version: '1.1.1' + title: 'Nudm_NIDDAU' + description: | + Nudm NIDD Authorization Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.8.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-niddau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-niddau + - {} + +paths: + /{ueIdentity}/authorize: + post: + summary: Authorize the NIDD configuration request. + operationId: AuthorizeNiddData + tags: + - Authorize the NIDD configuration request + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the NIDD configuration are authorized. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + niddAuthUpdateNotification: + '{request.body#/authUpdateCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthUpdateNotification' + responses: + '204': + description: Expected response to a valid request + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-niddau: Access to the nudm-niddau API + + schemas: + +# COMPLEX TYPES: +# + AuthorizationData: + description: Represents NIDD authorization data. + type: object + required: + - authorizationData + properties: + authorizationData: + type: array + items: + $ref: '#/components/schemas/UserIdentifier' + minItems: 1 + uniqueItems: true + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + UserIdentifier: + description: Represents the user identifier. + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + NiddAuthUpdateInfo: + description: Represents NIDD authorization update information. + type: object + required: + - authorizationData + properties: + authorizationData: + $ref: '#/components/schemas/AuthorizationData' + invalidityInd: + type: boolean + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + niddCause: + $ref: '#/components/schemas/NiddCause' + + NiddAuthUpdateNotification: + description: Represents a NIDD authorization update notification. + type: object + required: + - niddAuthUpdateInfoList + properties: + niddAuthUpdateInfoList: + type: array + items: + $ref: '#/components/schemas/NiddAuthUpdateInfo' + minItems: 1 + + AuthorizationInfo: + description: Represents NIDD authorization information. + type: object + required: + - snssai + - dnn + - mtcProviderInformation + - authUpdateCallbackUri + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + authUpdateCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + afId: + type: string + nefId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + + +# SIMPLE TYPES: + + + +# ENUMS: + + NiddCause: + anyOf: + - type: string + enum: + - SUBSCRIPTION_WITHDRAWAL + - DNN_REMOVED + - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_PP.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_PP.yaml new file mode 100644 index 000000000..b62dc8059 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_PP.yaml @@ -0,0 +1,770 @@ +openapi: 3.0.0 + +info: + version: '1.2.1' + title: 'Nudm_PP' + description: | + Nudm Parameter Provision Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.8.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-pp + - {} + +paths: + /{ueId}/pp-data: + patch: + summary: provision parameters + operationId: Update + tags: + - Subscription Data Update + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PpData' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /5g-vn-groups/{extGroupId}: + put: + summary: create a 5G VN Group + operationId: Create 5G VN Group + tags: + - 5G VN Group Creation + parameters: + - name: extGroupId + in: path + description: External Identifier of the Group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '201': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete a 5G VN Group + operationId: Delete 5G VN Group + tags: + - 5G VN Group Deletion + parameters: + - name: extGroupId + in: path + description: External Identifier of the Group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: mtc-provider-info + in: query + description: MTC Provider Information that originated the service operation + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: af-id + in: query + description: AF ID that originated the service operation + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify a 5G VN Group + operationId: Modify 5G VN Group + tags: + - 5G VN Group Modification + parameters: + - name: extGroupId + in: path + description: External Identifier of the group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: get 5G VN Group + operationId: Get 5G VN Group + tags: + - 5G VN Group Modification + parameters: + - name: extGroupId + in: path + description: External Identifier of the group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/pp-data-store/{afInstanceId}: + put: + summary: Create a Provisioning Parameter Data Entry + operationId: Create PP Data Entry + tags: + - ParameterProvisioningDataEntry (Document) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PpDataEntry' + required: true + responses: + '201': + description: Indicating a successful creation of the resource + content: + application/json: + schema: + $ref: '#/components/schemas/PpDataEntry' + '204': + description: Indicating a successful update of the resource + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: Delete a Provisioning Parameter Data Entry + operationId: Delete PP Data Entry + tags: + - ParameterProvisioningDataEntry (Document) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: get Parameter Provisioning Data Entry + operationId: Get PP Data Entry + tags: + - ParameterProvisioningDataEntry (Document) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpDataEntry' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-pp: Access to the nudm-pp API + + + schemas: + +# COMPLEX TYPES: + + PpData: + type: object + properties: + communicationCharacteristics: + $ref: '#/components/schemas/CommunicationCharacteristics' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + expectedUeBehaviourParameters: + $ref: '#/components/schemas/ExpectedUeBehaviour' + ecRestriction: + $ref: '#/components/schemas/EcRestriction' + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfoRm' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSrRm' + lcsPrivacy: + $ref: '#/components/schemas/LcsPrivacy' + sorInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SorInfo' + 5mbsAuthorizationInfo: + $ref: '#/components/schemas/5MbsAuthorizationInfo' + nullable: true + + CommunicationCharacteristics: + type: object + properties: + ppSubsRegTimer: + $ref: '#/components/schemas/PpSubsRegTimer' + ppActiveTime: + $ref: '#/components/schemas/PpActiveTime' + ppDlPacketCount: + $ref: '#/components/schemas/PpDlPacketCount' + ppDlPacketCountExt: + $ref: '#/components/schemas/PpDlPacketCountExt' + ppMaximumResponseTime: + $ref: '#/components/schemas/PpMaximumResponseTime' + ppMaximumLatency: + $ref: '#/components/schemas/PpMaximumLatency' + nullable: true + + PpSubsRegTimer: + type: object + required: + - subsRegTimer + - afInstanceId + - referenceId + properties: + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PpActiveTime: + type: object + required: + - activeTime + - afInstanceId + - referenceId + properties: + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + 5GVnGroupConfiguration: + type: object + properties: + 5gVnGroupData: + $ref: '#/components/schemas/5GVnGroupData' + members: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + referenceId: + $ref: '#/components/schemas/ReferenceId' + afInstanceId: + type: string + internalGroupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + + 5GVnGroupData: + type: object + required: + - dnn + - sNssai + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pduSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + appDescriptors: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AppDescriptor' + minItems: 1 + secondaryAuth: + type: boolean + dnAaaIpAddressAllocation: + type: boolean + dnAaaAddress: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpAddress' + additionalDnAaaAddresses: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpAddress' + minItems: 1 + dnAaaFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + ExpectedUeBehaviour: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndicationRm' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTypeRm' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTimeRm' + expectedUmts: + type: array + items: + $ref: '#/components/schemas/LocationArea' + minItems: 1 + nullable: true + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfileRm' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndicationRm' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + LocationArea: + type: object + properties: + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 0 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 0 + description: Identifies a list of civic addresses of the user where the UE is located. + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + umtTime: + $ref: '#/components/schemas/UmtTime' + + UmtTime: + type: object + required: + - timeOfDay + - dayOfWeek + properties: + timeOfDay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeOfDay' + dayOfWeek: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DayOfWeek' + + NetworkAreaInfo: + description: Describes a network area information in which the NF service consumer requests the number of UEs. + type: object + properties: + ecgis: + description: Contains a list of E-UTRA cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + ncgis: + description: Contains a list of NR cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + gRanNodeIds: + description: Contains a list of NG RAN nodes. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + tais: + description: Contains a list of tracking area identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + EcRestriction: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + plmnEcInfos: + type: array + items: + $ref: '#/components/schemas/PlmnEcInfo' + minItems: 1 + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PlmnEcInfo: + type: object + required: + - plmnId + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + ecRestrictionDataWb: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/EcRestrictionDataWb' + ecRestrictionDataNb: + type: boolean + default: false + + + PpDlPacketCountExt: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PpMaximumResponseTime: + type: object + required: + - maximumResponseTime + - afInstanceId + - referenceId + properties: + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PpMaximumLatency: + type: object + required: + - maximumLatency + - afInstanceId + - referenceId + properties: + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + LcsPrivacy: + type: object + properties: + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + lpi: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PpDataEntry: + type: object + properties: + communicationCharacteristics: + $ref: '#/components/schemas/CommunicationCharacteristicsAF' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ecsAddrConfigInfo: + $ref: '#/components/schemas/EcsAddrConfigInfo' + additionalEcsAddrConfigInfos: + type: array + items: + $ref: '#/components/schemas/EcsAddrConfigInfo' + minItems: 1 + ecRestriction: + $ref: '#/components/schemas/EcRestriction' + nullable: true + + CommunicationCharacteristicsAF: + type: object + properties: + ppDlPacketCount: + $ref: '#/components/schemas/PpDlPacketCount' + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + nullable: true + + EcsAddrConfigInfo: + type: object + properties: + ecsServerAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EcsServerAddr' + spatialValidityCond: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SpatialValidityCond' + nullable: true + + 5MbsAuthorizationInfo: + type: object + properties: + 5mbsSessionIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + minItems: 1 + nullable: true + +# SIMPLE TYPES: + + ReferenceId: + type: integer + + PpDlPacketCount: + type: integer + nullable: true + + + +# ENUMS: + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_RSDS.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_RSDS.yaml new file mode 100644 index 000000000..75d6f1a04 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_RSDS.yaml @@ -0,0 +1,94 @@ +openapi: 3.0.0 +info: + version: '1.1.0' + title: 'Nudm_ReportSMDeliveryStatus' + description: | + UDM Report SM Delivery Status Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.8.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-rsds/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-rsds + - {} + +paths: + /{ueIdentity}/sm-delivery-status: + post: + summary: Report the SM Delivery Status + operationId: ReportSMDeliveryStatus + tags: + - Report SM Delivery Status + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the Service Specific Parameters are authorized. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmDeliveryStatus' + required: true + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-rsds: Access to the nudm-rsds API + + + schemas: + +# COMPLEX TYPES: + + SmDeliveryStatus: + description: Represents SM Delivery Status. + type: object + required: + - gpsi + - smStatusReport + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + smStatusReport: + type: string + + +# SIMPLE TYPES: + + +# ENUMS: + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_SDM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_SDM.yaml new file mode 100644 index 000000000..a6777f4ad --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_SDM.yaml @@ -0,0 +1,3695 @@ +openapi: 3.0.0 + +info: + version: '2.2.2' + title: 'Nudm_SDM' + description: | + Nudm Subscriber Data Management Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-sdm/v2' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-sdm + - {} + +paths: + /{supi}: + get: + summary: retrieve multiple data sets + operationId: GetDataSets + tags: + - Retrieval of multiple data sets + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: dataset-names + in: query + style: form + explode: false + description: List of dataset names + required: true + schema: + $ref: '#/components/schemas/DatasetNames' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: disaster-roaming-ind + in: query + description: Indication whether Disaster Roaming service is applied or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSets' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/nssai: + get: + summary: retrieve a UE's subscribed NSSAI + operationId: GetNSSAI + tags: + - Slice Selection Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: disaster-roaming-ind + in: query + description: Indication whether Disaster Roaming service is applied or not + required: false + schema: + type: boolean + default: false + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Nssai' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-amf-data: + get: + summary: retrieve a UE's UE Context In AMF Data + operationId: GetUeCtxInAmfData + tags: + - UE Context In AMF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInAmfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data: + get: + summary: retrieve a UE's Access and Mobility Subscription Data + operationId: GetAmData + tags: + - Access and Mobility Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: Serving PLMN ID or SNPN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: adjacent-plmns + in: query + description: List of PLMNs adjacent to the UE's serving PLMN + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + style: form + explode: false + - name: disaster-roaming-ind + in: query + description: Indication whether Disaster Roaming service is applied or not + required: false + schema: + type: boolean + default: false + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/ecr-data: + get: + summary: retrieve a UE's subscribed Enhanced Coverage Restriction Data + operationId: GetEcrData + tags: + - Enhanced Coverage Restriction Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EnhancedCoverageRestrictionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/smf-select-data: + get: + summary: retrieve a UE's SMF Selection Subscription Data + operationId: GetSmfSelData + tags: + - SMF Selection Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: disaster-roaming-ind + in: query + description: Indication whether Disaster Roaming service is applied or not + required: false + schema: + type: boolean + default: false + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-smf-data: + get: + summary: retrieve a UE's UE Context In SMF Data + operationId: GetUeCtxInSmfData + tags: + - UE Context In SMF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInSmfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-smsf-data: + get: + summary: retrieve a UE's UE Context In SMSF Data + operationId: GetUeCtxInSmsfData + tags: + - UE Context In SMSF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInSmsfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/trace-data: + get: + summary: retrieve a UE's Trace Configuration Data + operationId: GetTraceConfigData + tags: + - Trace Configuration Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/TraceDataResponse' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sm-data: + get: + summary: retrieve a UE's Session Management Subscription Data + operationId: GetSmData + tags: + - Session Management Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmSubsData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sms-data: + get: + summary: retrieve a UE's SMS Subscription Data + operationId: GetSmsData + tags: + - SMS Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sms-mng-data: + get: + summary: retrieve a UE's SMS Management Subscription Data + operationId: GetSmsMngtData + tags: + - SMS Management Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/lcs-privacy-data: + get: + summary: retrieve a UE's LCS Privacy Subscription Data + operationId: GetLcsPrivacyData + tags: + - LCS Privacy Data Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsPrivacyData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/lcs-mo-data: + get: + summary: retrieve a UE's LCS Mobile Originated Subscription Data + operationId: GetLcsMoData + tags: + - LCS Mobile Originated Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsMoData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/lcs-bca-data: + get: + summary: retrieve a UE's LCS Broadcast Assistance Data Types Subscription Data + operationId: GetLcsBcaData + tags: + - LCS Broadcast Assistance Data Types Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/v2x-data: + get: + summary: retrieve a UE's V2X Subscription Data + operationId: GetV2xData + tags: + - V2X Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/V2xSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/prose-data: + get: + summary: retrieve a UE's ProSe Subscription Data + operationId: GetProseData + tags: + - Prose Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProseSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/5mbs-data: + get: + summary: retrieve a UE's 5MBS Subscription Data + operationId: GetMbsData + tags: + - 5MBS Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/uc-data: + get: + summary: retrieve a UE's User Consent Subscription Data + operationId: GetUcData + tags: + - User Consent Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: uc-purpose + in: query + description: User consent purpose + schema: + $ref: '#/components/schemas/UcPurpose' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UcSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/sdm-subscriptions: + post: + summary: subscribe to notifications + operationId: Subscribe + tags: + - Subscription Creation + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-sdm//{ueId}/sdm-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/sdm-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications + operationId: Unsubscribe + tags: + - Subscription Deletion + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: Modify + tags: + - Subscription Modification + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SdmSubsModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SdmSubscription' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/id-translation-result: + get: + summary: retrieve a UE's SUPI or GPSI + operationId: GetSupiOrGpsi + tags: + - GPSI to SUPI Translation or SUPI to GPSI translation + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: af-id + in: query + description: AF identifier + schema: + type: string + - name: app-port-id + in: query + description: Application port identifier + content: + application/json: + schema: + $ref: '#/components/schemas/AppPortId' + - name: af-service-id + in: query + description: AF Service Identifier + schema: + type: string + - name: mtc-provider-info + in: query + description: MTC Provider Information + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: requested-gpsi-type + in: query + description: Requested GPSI Type + schema: + $ref: '#/components/schemas/GpsiType' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IdTranslationResult' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/sor-ack: + put: + summary: Nudm_Sdm Info service operation + operationId: SorAckInfo + tags: + - Providing acknowledgement of Steering of Roaming + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/upu-ack: + put: + summary: Nudm_Sdm Info for UPU service operation + operationId: UpuAck + tags: + - Providing acknowledgement of UE Parameters Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/subscribed-snssais-ack: + put: + summary: Nudm_Sdm Info operation for S-NSSAIs acknowledgement + operationId: S-NSSAIs Ack + tags: + - Providing acknowledgement of S-NSSAIs Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/cag-ack: + put: + summary: Nudm_Sdm Info operation for CAG acknowledgement + operationId: CAG Ack + tags: + - Providing acknowledgement of CAG Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/update-sor: + post: + summary: Nudm_Sdm custom operation to trigger SOR info update + operationId: Update SOR Info + tags: + - Trigger SOR info update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorUpdateInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SorInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + $ref: '#/components/schemas/SharedDataIds' + - name: supportedFeatures + in: query + deprecated: true + description: Supported Features; this query parameter should not be used + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SharedData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data-subscriptions: + post: + summary: subscribe to notifications for shared data + operationId: SubscribeToSharedData + tags: + - Subscription Creation for shared data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-sdm//shared-data-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications for shared data + operationId: UnsubscribeForSharedData + tags: + - Subscription Deletion for shared data + parameters: + - name: subscriptionId + in: path + description: Id of the Shared data Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: ModifySharedDataSubs + tags: + - Subscription Modification + parameters: + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SdmSubsModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SdmSubscription' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /group-data/group-identifiers: + get: + summary: Mapping of Group Identifiers + operationId: GetGroupIdentifiers + tags: + - Group Identifiers + parameters: + - name: ext-group-id + in: query + description: External Group Identifier + required: false + schema: + $ref: '#/components/schemas/ExtGroupId' + - name: int-group-id + in: query + description: Internal Group Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: ue-id-ind + in: query + description: Indication whether UE identifiers are required or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: af-id + in: query + description: AF identifier + schema: + type: string + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GroupIdentifiers' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /shared-data/{sharedDataId}: + get: + summary: retrieve the individual shared data + operationId: GetIndividualSharedData + tags: + - Retrieval of the individual shared data + parameters: + - name: sharedDataId + in: path + description: Id of the Shared data + required: true + schema: + $ref: '#/components/schemas/SharedDataIds' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SharedData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /multiple-identifiers: + get: + summary: Mapping of UE Identifiers + operationId: GetMultipleIdentifiers + tags: + - Multiple Identifiers + parameters: + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: gpsi-list + in: query + description: list of the GPSIs + required: true + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeIdentifiers' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-sdm: Access to the nudm-sdm API + + schemas: + +# COMPLEX TYPES: + + DatasetNames: + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 2 + uniqueItems: true + + SubscriptionDataSets: + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + uecAmfData: + $ref: '#/components/schemas/UeContextInAmfData' + uecSmfData: + $ref: '#/components/schemas/UeContextInSmfData' + uecSmsfData: + $ref: '#/components/schemas/UeContextInSmsfData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + $ref: '#/components/schemas/SmSubsData' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + v2xData: + $ref: '#/components/schemas/V2xSubscriptionData' + lcsBroadcastAssistanceTypesData: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + proseData: + $ref: '#/components/schemas/ProseSubscriptionData' + mbsData: + $ref: '#/components/schemas/MbsSubscriptionData' + ucData: + $ref: '#/components/schemas/UcSubscriptionData' + + UeContextInSmsfData: + type: object + properties: + smsfInfo3GppAccess: + $ref: '#/components/schemas/SmsfInfo' + smsfInfoNon3GppAccess: + $ref: '#/components/schemas/SmsfInfo' + + SmsfInfo: + type: object + required: + - smsfInstanceId + - plmnId + properties: + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + smsfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + + + AccessAndMobilitySubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + sharedVnGroupDataIds: + description: A map(list of key-value pairs) where GroupId serves as key of SharedDataId + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataId' + minProperties: 1 + subscribedUeAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmbrRm' + nssai: + $ref: '#/components/schemas/Nssai' + ratRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + forbiddenAreas: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + coreNetworkTypeRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + rfspIndex: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndexRm' + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + ueUsageType: + $ref: '#/components/schemas/UeUsageType' + mpsPriority: + $ref: '#/components/schemas/MpsPriorityIndicator' + mcsPriority: + $ref: '#/components/schemas/McsPriorityIndicator' + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + sorInfo: + $ref: '#/components/schemas/SorInfo' + sorInfoExpectInd: + type: boolean + sorafRetrieval: + type: boolean + default: false + sorUpdateIndicatorList: + type: array + items: + $ref: '#/components/schemas/SorUpdateIndicator' + minItems: 1 + upuInfo: + $ref: '#/components/schemas/UpuInfo' + routingIndicator: + type: string + pattern: '^[0-9]{1,4}$' + micoAllowed: + $ref: '#/components/schemas/MicoAllowed' + sharedAmDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + odbPacketServices: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbPacketServices' + subscribedDnnList: + type: array + items: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + serviceGapTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + mdtUserConsent: + $ref: '#/components/schemas/MdtUserConsent' + mdtConfiguration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MdtConfiguration' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + cagData: + $ref: '#/components/schemas/CagData' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + nbIoTUePriority: + $ref: '#/components/schemas/NbIoTUePriority' + nssaiInclusionAllowed: + type: boolean + default: false + rgWirelineCharacteristics: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RgWirelineCharacteristics' + ecRestrictionDataWb: + $ref: '#/components/schemas/EcRestrictionDataWb' + ecRestrictionDataNb: + type: boolean + default: false + expectedUeBehaviourList: + $ref: '#/components/schemas/ExpectedUeBehaviourData' + primaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + secondaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + edrxParametersList: + type: array + items: + $ref: '#/components/schemas/EdrxParameters' + minItems: 1 + ptwParametersList: + type: array + items: + $ref: '#/components/schemas/PtwParameters' + minItems: 1 + iabOperationAllowed: + type: boolean + default: false + adjacentPlmnRestrictions: + description: A map (list of key-value pairs where PlmnId serves as key) of PlmnRestriction + type: object + additionalProperties: + $ref: '#/components/schemas/PlmnRestriction' + minProperties: 1 + wirelineForbiddenAreas: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineArea' + wirelineServiceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + pcfSelectionAssistanceInfos: + type: array + items: + $ref: '#/components/schemas/PcfSelectionAssistanceInfo' + minItems: 1 + aerialUeSubInfo: + $ref: '#/components/schemas/AerialUeSubscriptionInfo' + roamingRestrictions: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RoamingRestrictions' + remoteProvInd: + type: boolean + default: false + + PcfSelectionAssistanceInfo: + type: object + required: + - dnn + - singleNssai + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + PlmnRestriction: + type: object + properties: + ratRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + forbiddenAreas: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + coreNetworkTypeRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + primaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + secondaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + + ProseSubscriptionData: + description: Contains the ProSe Subscription Data. + type: object + properties: + proseServiceAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProseServiceAuth' + nrUePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + proseAllowedPlmn: + type: array + items: + $ref: '#/components/schemas/ProSeAllowedPlmn' + minItems: 1 + + ProSeAllowedPlmn: + description: Contains the PLMN identities where the Prose services are authorised to use and the authorised Prose services on this given PLMNs. + type: object + required: + - visitedPlmn + properties: + visitedPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + proseDirectAllowed: + type: array + items: + $ref: '#/components/schemas/ProseDirectAllowed' + minItems: 1 + + CagData: + type: object + required: + - cagInfos + properties: + cagInfos: + description: A map (list of key-value pairs where PlmnId serves as key) of CagInfo + type: object + additionalProperties: + $ref: '#/components/schemas/CagInfo' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + CagInfo: + type: object + required: + - allowedCagList + properties: + allowedCagList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + cagOnlyIndicator: + type: boolean + + SmfSelectionSubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + subscribedSnssaiInfos: + description: A map(list of key-value pairs) where singleNssai serves as key of SnssaiInfo + type: object + additionalProperties: + $ref: '#/components/schemas/SnssaiInfo' + sharedSnssaiInfosId: + $ref: '#/components/schemas/SharedDataId' + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + SnssaiInfo: + type: object + required: + - dnnInfos + properties: + dnnInfos: + type: array + items: + $ref: '#/components/schemas/DnnInfo' + minItems: 1 + + DnnInfo: + type: object + required: + - dnn + properties: + dnn: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + defaultDnnIndicator: + $ref: '#/components/schemas/DnnIndicator' + lboRoamingAllowed: + $ref: '#/components/schemas/LboRoamingAllowed' + iwkEpsInd: + $ref: '#/components/schemas/IwkEpsInd' + dnnBarred: + type: boolean + invokeNefInd: + type: boolean + smfList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + sameSmfInd: + type: boolean + + Nssai: + type: object + required: + - defaultSingleNssais + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + defaultSingleNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + singleNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + additionalSnssaiData: + description: A map(list of key-value pairs) where singleNssai serves as key of AdditionalSnssaiData + type: object + additionalProperties: + $ref: '#/components/schemas/AdditionalSnssaiData' + minProperties: 1 + suppressNssrgInd: + type: boolean + nullable: true + + UeContextInAmfData: + type: object + properties: + epsInterworkingInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/EpsInterworkingInfo' + amfInfo: + description: AMF information + type: array + items: + $ref: '#/components/schemas/NudmAmfInfo' + minItems: 1 + maxItems: 2 + + UeContextInSmfData: + type: object + properties: + pduSessions: + description: A map (list of key-value pairs where PduSessionId serves as key) of PduSessions + type: object + additionalProperties: + $ref: '#/components/schemas/PduSession' + pgwInfo: + type: array + items: + $ref: '#/components/schemas/PgwInfo' + minItems: 1 + emergencyInfo: + $ref: '#/components/schemas/EmergencyInfo' + + EmergencyInfo: + type: object + oneOf: + - required: + - pgwFqdn + - required: + - pgwIpAddress + properties: + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddress: + $ref: '#/components/schemas/IpAddress' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + epdgInd: + type: boolean + default: false + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + + PduSession: + type: object + required: + - dnn + - smfInstanceId + - plmnId + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + NudmAmfInfo: + type: object + required: + - amfInstanceId + - guami + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + PgwInfo: + type: object + required: + - dnn + - pgwFqdn + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddr: + $ref: '#/components/schemas/IpAddress' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + epdgInd: + type: boolean + default: false + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SessionManagementSubscriptionData: + type: object + required: + - singleNssai + properties: + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnnConfigurations: + description: A map (list of key-value pairs where Dnn, or optionally the Wildcard DNN, serves as key) of DnnConfigurations + type: object + additionalProperties: + $ref: '#/components/schemas/DnnConfiguration' + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + sharedVnGroupDataIds: + description: A map(list of key-value pairs) where GroupId serves as key of SharedDataId + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataId' + minProperties: 1 + sharedDnnConfigurationsId: + $ref: '#/components/schemas/SharedDataId' + odbPacketServices: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbPacketServices' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedTraceDataId: + $ref: '#/components/schemas/SharedDataId' + expectedUeBehavioursList: + description: A map(list of key-value pairs) where Dnn serves as key of ExpectedUeBehaviourData + type: object + additionalProperties: + $ref: '#/components/schemas/ExpectedUeBehaviourData' + minProperties: 1 + suggestedPacketNumDlList: + description: A map(list of key-value pairs) where Dnn serves as key of SuggestedPacketNumDl + type: object + additionalProperties: + $ref: '#/components/schemas/SuggestedPacketNumDl' + minProperties: 1 + 3gppChargingCharacteristics: + $ref: '#/components/schemas/3GppChargingCharacteristics' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + DnnConfiguration: + type: object + required: + - pduSessionTypes + - sscModes + properties: + pduSessionTypes: + $ref: '#/components/schemas/PduSessionTypes' + sscModes: + $ref: '#/components/schemas/SscModes' + iwkEpsInd: + $ref: '#/components/schemas/IwkEpsInd' + 5gQosProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + 3gppChargingCharacteristics: + $ref: '#/components/schemas/3GppChargingCharacteristics' + staticIpAddress: + type: array + items: + $ref: '#/components/schemas/IpAddress' + minItems: 1 + maxItems: 2 + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + pduSessionContinuityInd: + $ref: '#/components/schemas/PduSessionContinuityInd' + niddNefId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + niddInfo: + $ref: '#/components/schemas/NiddInformation' + redundantSessionAllowed: + type: boolean + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfo' + ipv4FrameRouteList: + type: array + items: + $ref: '#/components/schemas/FrameRouteInfo' + minItems: 1 + ipv6FrameRouteList: + type: array + items: + $ref: '#/components/schemas/FrameRouteInfo' + minItems: 1 + atsssAllowed: + type: boolean + default: false + secondaryAuth: + type: boolean + uavSecondaryAuth: + type: boolean + default: false + dnAaaIpAddressAllocation: + type: boolean + dnAaaAddress: + $ref: '#/components/schemas/IpAddress' + additionalDnAaaAddresses: + type: array + items: + $ref: '#/components/schemas/IpAddress' + minItems: 1 + dnAaaFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + iptvAccCtrlInfo: + type: string + ipv4Index: + $ref: '#/components/schemas/IpIndex' + ipv6Index: + $ref: '#/components/schemas/IpIndex' + ecsAddrConfigInfo: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/EcsAddrConfigInfo' + additionalEcsAddrConfigInfos: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/EcsAddrConfigInfo' + minItems: 1 + sharedEcsAddrConfigInfo: + $ref: '#/components/schemas/SharedDataId' + additionalSharedEcsAddrConfigInfoIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + easDiscoveryAuthorized: + type: boolean + default: false + onboardingInd: + type: boolean + default: false + aerialUeInd: + $ref: '#/components/schemas/AerialUeIndication' + subscribedMaxIpv6PrefixSize: + type: integer + + NiddInformation: + type: object + required: + - afId + properties: + afId: + type: string + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + extGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExternalGroupId' + + IpAddress: + type: object + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + - required: + - ipv6Prefix + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + PduSessionTypes: + type: object + properties: + defaultSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + allowedSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + + SscModes: + type: object + required: + - defaultSscMode + properties: + defaultSscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + allowedSscModes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + minItems: 1 + maxItems: 2 + + SmsSubscriptionData: + type: object + properties: + smsSubscribed: + $ref: '#/components/schemas/SmsSubscribed' + sharedSmsSubsDataId: + $ref: '#/components/schemas/SharedDataId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + SmsManagementSubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtSmsSubscribed: + type: boolean + mtSmsBarringAll: + type: boolean + mtSmsBarringRoaming: + type: boolean + moSmsSubscribed: + type: boolean + moSmsBarringAll: + type: boolean + moSmsBarringRoaming: + type: boolean + sharedSmsMngDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + + SdmSubscription: + type: object + required: + - nfInstanceId + - callbackReference + - monitoredResourceUris + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + implicitUnsubscribe: + type: boolean + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + subscriptionId: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + immediateReport: + type: boolean + default: false + report: + $ref: '#/components/schemas/ImmediateReport' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + contextInfo: + $ref: '#/components/schemas/ContextInfo' + nfChangeFilter: + type: boolean + default: false + uniqueSubscription: + type: boolean + resetIds: + type: array + items: + type: string + minItems: 1 + ueConSmfDataSubFilter: + $ref: '#/components/schemas/UeContextInSmfDataSubFilter' + + SdmSubsModification: + type: object + properties: + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + + ModificationNotification: + type: object + required: + - notifyItems + properties: + notifyItems: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotifyItem' + minItems: 1 + + IdTranslationResult: + type: object + required: + - supi + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + additionalSupis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + additionalGpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + + AcknowledgeInfo: + type: object + required: + - provisioningTime + properties: + sorMacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + upuMacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sorTransparentContainer: + $ref: '#/components/schemas/SorTransparentContainer' + ueNotReachable: + type: boolean + default: false + upuTransparentContainer: + $ref: '#/components/schemas/UpuTransparentContainer' + + SorInfo: + type: object + properties: + steeringContainer: + $ref: '#/components/schemas/SteeringContainer' + ackInd: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/AckInd' + sorMacIausf: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + countersor: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/CounterSor' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sorTransparentContainer: + $ref: '#/components/schemas/SorTransparentContainer' + sorCmci: + $ref: '#/components/schemas/SorCmci' + storeSorCmciInMe: + type: boolean + usimSupportOfSorCmci: + type: boolean + required: + - ackInd + - provisioningTime + + SharedDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + uniqueItems: true + + UpuInfo: + type: object + properties: + upuDataList: + type: array + items: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuData' + minItems: 1 + upuRegInd: + $ref: '#/components/schemas/UpuRegInd' + upuAckInd: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuAckInd' + upuMacIausf: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + counterUpu: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/CounterUpu' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + upuTransparentContainer: + $ref: '#/components/schemas/UpuTransparentContainer' + required: + - provisioningTime + + + SharedData: + type: object + required: + - sharedDataId + properties: + sharedDataId: + $ref: '#/components/schemas/SharedDataId' + sharedAmData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + sharedSmsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + sharedSmsMngSubsData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + sharedDnnConfigurations: + description: A map(list of key-value pairs) where Dnn, or optionally the Wildcard DNN, serves as key of DnnConfiguration + type: object + additionalProperties: + $ref: '#/components/schemas/DnnConfiguration' + minProperties: 1 + sharedTraceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedSnssaiInfos: + description: A map(list of key-value pairs) where singleNssai serves as key of SnssaiInfo + type: object + additionalProperties: + $ref: '#/components/schemas/SnssaiInfo' + minProperties: 1 + sharedVnGroupDatas: + description: A map(list of key-value pairs) where GroupId serves as key of VnGroupData + type: object + additionalProperties: + $ref: '#/components/schemas/VnGroupData' + minProperties: 1 + treatmentInstructions: + description: A map(list of key-value pairs) where JSON pointer pointing to an attribute within the SharedData serves as key of SharedDataTreatmentInstruction + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataTreatmentInstruction' + minProperties: 1 + sharedSmSubsData: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + sharedEcsAddrConfigInfo: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/EcsAddrConfigInfo' + + TraceDataResponse: + type: object + properties: + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedTraceDataId: + $ref: '#/components/schemas/SharedDataId' + + SteeringContainer: + oneOf: + - type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + - $ref: '#/components/schemas/SecuredPacket' + + GroupIdentifiers: + type: object + properties: + extGroupId: + $ref: '#/components/schemas/ExtGroupId' + intGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + ueIdList: + type: array + items: + $ref: '#/components/schemas/UeId' + minItems: 1 + + VnGroupData: + type: object + properties: + pduSessionTypes: + $ref: '#/components/schemas/PduSessionTypes' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + appDescriptors: + type: array + items: + $ref: '#/components/schemas/AppDescriptor' + minItems: 1 + + AppDescriptor: + type: object + properties: + osId: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/OsId' + appId: + type: string + + AdditionalSnssaiData: + type: object + properties: + requiredAuthnAuthz: + type: boolean + subscribedUeSliceMbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbrRm' + subscribedNsSrgList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NsSrg' + minItems: 1 + + AppPortId: + type: object + properties: + destinationPort: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + originatorPort: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + + LcsPrivacyData: + type: object + properties: + lpi: + $ref: '#/components/schemas/Lpi' + unrelatedClass: + $ref: '#/components/schemas/UnrelatedClass' + plmnOperatorClasses: + type: array + items: + $ref: '#/components/schemas/PlmnOperatorClass' + minItems: 1 + + Lpi: + type: object + required: + - locationPrivacyInd + properties: + locationPrivacyInd: + $ref: '#/components/schemas/LocationPrivacyInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + UnrelatedClass: + type: object + required: + - defaultUnrelatedClass + properties: + defaultUnrelatedClass: + $ref: '#/components/schemas/DefaultUnrelatedClass' + externalUnrelatedClass: + $ref: '#/components/schemas/ExternalUnrelatedClass' + serviceTypeUnrelatedClasses: + type: array + items: + $ref: '#/components/schemas/ServiceTypeUnrelatedClass' + minItems: 1 + + PlmnOperatorClass: + type: object + required: + - lcsClientClass + - lcsClientIds + properties: + lcsClientClass: + $ref: '#/components/schemas/LcsClientClass' + lcsClientIds: + type: array + items: + $ref: '#/components/schemas/LcsClientId' + minItems: 1 + + ValidTimePeriod: + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + ExternalUnrelatedClass: + properties: + lcsClientExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientExternal' + minItems: 1 + afExternals: + type: array + items: + $ref: '#/components/schemas/AfExternal' + minItems: 1 + lcsClientGroupExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientGroupExternal' + minItems: 1 + + AfExternal: + type: object + properties: + afId: + $ref: '#/components/schemas/AfId' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsClientExternal: + type: object + properties: + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsClientGroupExternal: + type: object + properties: + lcsClientGroupId: + $ref: '#/components/schemas/ExtGroupId' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + ServiceTypeUnrelatedClass: + type: object + required: + - serviceType + properties: + serviceType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsServiceType' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + codeWordList: + type: array + items: + $ref: '#/components/schemas/CodeWord' + minItems: 1 + + LcsMoData: + type: object + required: + - allowedServiceClasses + properties: + allowedServiceClasses: + type: array + items: + $ref: '#/components/schemas/LcsMoServiceClass' + minItems: 1 + moAssistanceDataTypes: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + + + LcsBroadcastAssistanceTypesData: + type: object + required: + - locationAssistanceType + properties: + locationAssistanceType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Binary' + + EcRestrictionDataWb: + type: object + anyOf: + - required: [ ecModeARestricted ] + - required: [ ecModeBRestricted ] + properties: + ecModeARestricted: + type: boolean + ecModeBRestricted: + type: boolean + + ExpectedUeBehaviourData: + type: object + properties: + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndication' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTime' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationType' + expectedUmts: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/LocationArea' + minItems: 1 + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfile' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndication' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + + SuggestedPacketNumDl: + type: object + required: + - suggestedPacketNumDl + properties: + suggestedPacketNumDl: + type: integer + minimum: 1 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + FrameRouteInfo: + type: object + properties: + ipv4Mask: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrMask' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + SorUpdateInfo: + type: object + required: + - vplmnId + properties: + vplmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + EnhancedCoverageRestrictionData: + type: object + properties: + plmnEcInfoList: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PlmnEcInfo' + minItems: 1 + + EdrxParameters: + type: object + required: + - ratType + - edrxValue + properties: + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + edrxValue: + type: string + pattern: '^([0-1]{4})$' + + PtwParameters: + type: object + required: + - operationMode + - ptwValue + properties: + operationMode: + $ref: '#/components/schemas/OperationMode' + ptwValue: + type: string + pattern: '^([0-1]{4})$' + + UeId: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + + V2xSubscriptionData: + type: object + properties: + nrV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrV2xAuth' + lteV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LteV2xAuth' + nrUePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + ltePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + DefaultUnrelatedClass: + type: object + properties: + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + codeWordList: + type: array + items: + $ref: '#/components/schemas/CodeWord' + minItems: 1 + + ContextInfo: + type: object + properties: + origHeaders: + type: array + items: + type: string + minItems: 1 + requestHeaders: + type: array + items: + type: string + minItems: 1 + + AerialUeSubscriptionInfo: + description: Contains the Aerial UE Subscription Information, it at least contains the Aerial UE Indication. + type: object + required: + - aerialUeInd + properties: + aerialUeInd: + $ref: '#/components/schemas/AerialUeIndication' + 3gppUavId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + + SmSubsData: + oneOf: + - type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + minItems: 1 + - $ref: '#/components/schemas/ExtendedSmSubsData' + + ExtendedSmSubsData: + description: Contains identifiers of shared Session Management Subscription Data and optionally individual Session Management Subscription Data. + type: object + required: + - sharedSmSubsDataIds + properties: + sharedSmSubsDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + individualSmSubsData: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + + ImmediateReport: + oneOf: + - $ref: '#/components/schemas/SubscriptionDataSets' + - type: array + items: + $ref: '#/components/schemas/SharedData' + minItems: 0 + + MbsSubscriptionData: + description: Contains the 5MBS Subscription Data. + type: object + properties: + mbsAllowed: + type: boolean + default: false + mbsSessionIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + minItems: 1 + + UcSubscriptionData: + description: Contains the User Consent Subscription Data. + type: object + properties: + userConsentPerPurposeList: + description: A map(list of key-value pairs) where user consent purpose serves as key of user consent + type: object + additionalProperties: + $ref: '#/components/schemas/UserConsent' + minProperties: 1 + + UeContextInSmfDataSubFilter: + description: UE Context In Smf Data Subscription Filter. + type: object + properties: + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + emergencyInd: + type: boolean + default: false + + UeIdentifiers: + description: A map(list of key-value pairs) where Gpsi serves as key of arrays of Supi + type: object + additionalProperties: + $ref: '#/components/schemas/SupiInfo' + minProperties: 1 + + SupiInfo: + description: List of Supis. + type: object + required: + - supiList + properties: + supiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + + + +# SIMPLE TYPES: + + UeUsageType: + type: integer + + MpsPriorityIndicator: + type: boolean + + McsPriorityIndicator: + type: boolean + + DnnIndicator: + type: boolean + + LboRoamingAllowed: + type: boolean + + SmsSubscribed: + type: boolean + + 3GppChargingCharacteristics: + type: string + + MicoAllowed: + type: boolean + + SharedDataId: + type: string + pattern: '^[0-9]{5,6}-.+$' + + IwkEpsInd: + type: boolean + + SecuredPacket: + type: string + format: byte + + UpuRegInd: + type: boolean + + ExtGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + + NbIoTUePriority: + type: integer + minimum: 0 + maximum: 255 + + CodeWord: + type: string + + AfId: + type: string + + LcsClientId: + type: string + + SorTransparentContainer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + UpuTransparentContainer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + IpIndex: + description: Represents the IP Index to be sent from UDM to the SMF (its value can be either an integer or a string) + anyOf: + - type: integer + - type: string + + SorCmci: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + +# ENUMS: + + DataSetName: +# anyOf: +# - type: string + enum: + - AM + - SMF_SEL + - UEC_SMF + - UEC_SMSF + - SMS_SUB + - SM + - TRACE + - SMS_MNG + - LCS_PRIVACY + - LCS_MO + - UEC_AMF + - V2X + - LCS_BCA + - PROSE + - UC + - MBS +# - type: string + + UcPurpose: +# anyOf: +# - type: string + enum: + - ANALYTICS + - MODEL_TRAINING + - NW_CAP_EXPOSURE + - EDGEAPP_UE_LOCATION +# - type: string +# description: Indicates the purpose of the user consent. + + UserConsent: +# anyOf: +# - type: string + enum: + - CONSENT_NOT_GIVEN + - CONSENT_GIVEN +# - type: string + + PduSessionContinuityInd: +# anyOf: +# - type: string + enum: + - MAINTAIN_PDUSESSION + - RECONNECT_PDUSESSION + - RELEASE_PDUSESSION +# - type: string + + LocationPrivacyInd: +# anyOf: +# - type: string + enum: + - LOCATION_DISALLOWED + - LOCATION_ALLOWED +# - type: string + + PrivacyCheckRelatedAction: +# anyOf: +# - type: string + enum: + - LOCATION_NOT_ALLOWED + - LOCATION_ALLOWED_WITH_NOTIFICATION + - LOCATION_ALLOWED_WITHOUT_NOTIFICATION + - LOCATION_ALLOWED_WITHOUT_RESPONSE + - LOCATION_RESTRICTED_WITHOUT_RESPONSE +# - type: string + + LcsClientClass: +# anyOf: +# - type: string + enum: + - BROADCAST_SERVICE + - OM_IN_HPLMN + - OM_IN_VPLMN + - ANONYMOUS_LOCATION_SERVICE + - SPECIFIC_SERVICE +# - type: string + + LcsMoServiceClass: +# anyOf: +# - type: string + enum: + - BASIC_SELF_LOCATION + - AUTONOMOUS_SELF_LOCATION + - TRANSFER_TO_THIRD_PARTY +# - type: string + + OperationMode: +# anyOf: +# - type: string + enum: + - WB_S1 + - NB_S1 + - WB_N1 + - NB_N1 +# - type: string + + SorUpdateIndicator: +# anyOf: +# - type: string + enum: + - INITIAL_REGISTRATION + - EMERGENCY_REGISTRATION +# - type: string + + CodeWordInd: +# anyOf: +# - type: string + enum: + - CODEWORD_CHECK_IN_UE + - CODEWORD_CHECK_IN_GMLC +# - type: string + + MdtUserConsent: +# anyOf: +# - type: string + enum: + - CONSENT_NOT_GIVEN + - CONSENT_GIVEN +# - type: string + + SharedDataTreatmentInstruction: +# anyOf: +# - type: string + enum: + - USE_IF_NO_CLASH + - OVERWRITE + - MAX + - MIN +# - type: string + + GpsiType: +# description: Type of GPSI (MSISDN or External-ID) +# anyOf: +# - type: string + enum: + - MSISDN + - EXT_ID + - EXT_GROUP_ID +# - type: string + + AerialUeIndication: +# anyOf: +# - type: string + enum: + - AERIAL_UE_ALLOWED + - AERIAL_UE_NOT_ALLOWED +# - type: string +# description: > +# Indicates the Aerial service for the UE is allowed or not allowed, possible values are +# - AERIAL_UE_ALLOWED: Aerial service for the UE is allowed. +# - AERIAL_UE_NOT_ALLOWED: Aerial service for the UE is not allowed. + + ProseDirectAllowed: +# anyOf: +# - type: string + enum: + - ANNOUNCE + - MONITOR + - RESTRICTD_ANNOUNCE + - RESTRICTD_MONITOR + - DISCOVERER + - DISCOVEREE + - BROADCAST + - GROUPCAST + - UNICAST + - LAYER2_RELAY + - LAYER3_RELAY +# - type: string +# description: Indicates the 5G ProSe Direct services that can be authorised to use in the given PLMN for the UE. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_SSAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_SSAU.yaml new file mode 100644 index 000000000..9b7db0a38 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_SSAU.yaml @@ -0,0 +1,288 @@ +openapi: 3.0.0 + +info: + version: '1.0.2' + title: 'Nudm_SSAU' + description: | + Nudm Service Specific Authorization Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ssau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ssau + - {} + +paths: + /{ueIdentity}/{serviceType}/authorize: + post: + summary: Authorization for the Service specific parameters in the request. + operationId: ServiceSpecificAuthorization + tags: + - Service specific authorization request + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the Service Specific Parameters are authorized. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: serviceType + in: path + description: Represents the specific service for which the Service Specific Parameters are authorized. + required: true + schema: + $ref: '#/components/schemas/ServiceType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + authUpdateNotification: + '{request.body#/authUpdateCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AuthUpdateNotification' + responses: + '204': + description: Expected response to a valid request + + /{ueIdentity}/{serviceType}/remove: + post: + summary: Remove the authorization of specific service's configuration. + operationId: ServiceSpecificAuthorizationRemoval + tags: + - Service specific authorization remove + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the Service Specific configuration authorization to be removed. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: serviceType + in: path + description: Represents the specific service for which the Service Specific configuration authorization to be removed. + required: true + schema: + $ref: '#/components/schemas/ServiceType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationRemoveData' + required: true + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ssau: Access to the nudm-ssau API + + schemas: + +# COMPLEX TYPES: +# + AuthUpdateNotification: + description: Represents an authorization update notification. + type: object + required: + - serviceType + - authUpdateInfoList + properties: + serviceType: + $ref: '#/components/schemas/ServiceType' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + authUpdateInfoList: + type: array + items: + $ref: '#/components/schemas/AuthUpdateInfo' + minItems: 1 + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + afId: + type: string + + AuthUpdateInfo: + description: Represents authorization update information. + type: object + required: + - authorizationData + properties: + authorizationData: + $ref: '#/components/schemas/ServiceSpecificAuthorizationData' + invalidityInd: + type: boolean + invalidCause: + $ref: '#/components/schemas/InvalidCause' + + + ServiceSpecificAuthorizationInfo: + description: Authorization information for a specific service + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + authUpdateCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + afId: + type: string + nefId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + + ServiceSpecificAuthorizationData: + description: Authorization Response for a specific service. + type: object + properties: + authorizationUeId: + $ref: '#/components/schemas/AuthorizationUeId' + extGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExternalGroupId' + intGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + authId: + type: string + + AuthorizationUeId: + description: UE Id of the Authorization Data. + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + + ServiceSpecificAuthorizationRemoveData: + description: Information for Authorization removal of a specific service. + type: object + required: + - authId + properties: + authId: + type: string + + + +# SIMPLE TYPES: + + + +# ENUMS: + + ServiceType: + anyOf: + - type: string + enum: + - AF_GUIDANCE_FOR_URSP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - AF_GUIDANCE_FOR_URSP + + InvalidCause: + anyOf: + - type: string + enum: + - SUBSRIPTION_WITHDRAWAL + - DNN_REMOVED + - SLICE_REMOVED + - AUTHORIZATION_REVOKED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SUBSRIPTION_WITHDRAWAL + - DNN_REMOVED + - SLICE_REMOVED + - AUTHORIZATION_REVOKED + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_UEAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_UEAU.yaml new file mode 100644 index 000000000..03d334734 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_UEAU.yaml @@ -0,0 +1,866 @@ +openapi: 3.0.0 +info: + version: '1.2.1' + title: 'Nudm_UEAU' + description: | + UDM UE Authentication Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ueau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ueau + - {} + +paths: + /{supiOrSuci}/security-information/generate-auth-data: + post: + summary: Generate authentication data for the UE + operationId: GenerateAuthData + tags: + - Generate Auth Data + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:security-information:generate-auth-data:invoke + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supiOrSuci}/security-information-rg: + get: + summary: Get authentication data for the FN-RG + operationId: GetRgAuthData + tags: + - Get Auth Data for FN-RG + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:security-information-rg:read + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + - name: authenticated-ind + in: query + description: Authenticated indication + required: true + schema: + $ref: '#/components/schemas/AuthenticatedInd' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthCtx' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/auth-events: + post: + summary: Create a new confirmation event + operationId: ConfirmAuth + tags: + - Confirm Auth + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:auth-events:create + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-ueau/v1/{supi}/auth-events/{authEventId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/hss-security-information/{hssAuthType}/generate-av: + post: + summary: Generate authentication data for the UE in EPS or IMS domain + operationId: GenerateAv + tags: + - Generate HSS Authentication Vectors + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:hss-security-information:generate-av:invoke + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: hssAuthType + in: path + description: Type of AV requested by HSS + required: true + schema: + $ref: '#/components/schemas/HssAuthTypeInUri' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/HssAuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/auth-events/{authEventId}: + put: + summary: Deletes the authentication result in the UDM + operationId: DeleteAuth + tags: + - Delete Auth + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:auth-event-id:modify + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: authEventId + in: path + description: authEvent Id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + required: true + responses: + '204': + description: Expected response to a successful authentication result removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{supi}/gba-security-information/generate-av: + post: + summary: Generate authentication data for the UE in GBA domain + operationId: GenerateGbaAv + tags: + - Generate GBA Authentication Vectors + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:gba-security-information:generate-av:invoke + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GbaAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GbaAuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supiOrSuci}/prose-security-information/generate-av: + post: + summary: Generate authentication data for ProSe + operationId: GenerateProseAV + tags: + - Generate ProSe Authentication Vectors + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ueau: Access to the nudm-ueau API + nudm-ueau:security-information:generate-auth-data:invoke: Acess to invoke the "generate-auth-data" custom operation on the "security-information" resource + nudm-ueau:security-information-rg:read: Access to read the "security-information-rg" resource + nudm-ueau:auth-events:create: Access to create a new child resource on the "auth-events" collection resource + nudm-ueau:auth-event-id:modify: Access to modify (delete) an "auth-event-id" individual resource + nudm-ueau:hss-security-information:generate-av:invoke: Acess to invoke the "generate-av" custom operation on the "hss-security-information" resource + nudm-ueau:gba-security-information:generate-av:invoke: Acess to invoke the "generate-av" custom operation on the "gba-security-information" resource + + + schemas: + +# COMPLEX TYPES: + + AuthenticationInfoRequest: + type: object + required: + - servingNetworkName + - ausfInstanceId + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + ausfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + cellCagInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + minItems: 1 + n5gcInd: + type: boolean + default: false + nswoInd: + type: boolean + default: false + disasterRoamingInd: + type: boolean + default: false + + AuthenticationInfoResult: + type: object + required: + - authType + properties: + authType: + $ref: '#/components/schemas/AuthType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + authenticationVector: + $ref: '#/components/schemas/AuthenticationVector' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + akmaInd: + type: boolean + default: false + authAaa: + type: boolean + default: false + routingId: + type: string + pattern: '^[0-9]{1,4}$' + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + + AuthenticationVector: + oneOf: + - $ref: '#/components/schemas/AvEapAkaPrime' + - $ref: '#/components/schemas/Av5GHeAka' + discriminator: + propertyName: avType + mapping: + 5G_HE_AKA: '#/components/schemas/Av5GHeAka' + EAP_AKA_PRIME: '#/components/schemas/AvEapAkaPrime' + + AvEapAkaPrime: + type: object + required: + - avType + - rand +# - xres + - autn +# - ckPrime +# - ikPrime + properties: + avType: + $ref: '#/components/schemas/AvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + ckPrime: + $ref: '#/components/schemas/CkPrime' + ikPrime: + $ref: '#/components/schemas/IkPrime' + + Av5GHeAka: + type: object + required: + - avType + - rand +# - xresStar + - autn +# - kausf + properties: + avType: + $ref: '#/components/schemas/AvType' + rand: + $ref: '#/components/schemas/Rand' + xresStar: + $ref: '#/components/schemas/XresStar' + autn: + $ref: '#/components/schemas/Autn' + kausf: + $ref: '#/components/schemas/Kausf' + + ResynchronizationInfo: + type: object + required: + - rand + - auts + properties: + rand: + $ref: '#/components/schemas/Rand' + auts: + $ref: '#/components/schemas/Auts' + + AuthEvent: + type: object + required: + - nfInstanceId + - success + - timeStamp + - authType + - servingNetworkName + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + success: + $ref: '#/components/schemas/Success' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + authType: + $ref: '#/components/schemas/AuthType' + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + authRemovalInd: + type: boolean + default: false + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + resetIds: + type: array + items: + type: string + minItems: 1 + + + RgAuthCtx: + type: object + required: + - authInd + properties: + authInd: + type: boolean + default: false + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + HssAuthenticationInfoRequest: + type: object + required: + - hssAuthType + - numOfRequestedVectors + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hssAuthType: + $ref: '#/components/schemas/HssAuthType' + numOfRequestedVectors: + $ref: '#/components/schemas/NumOfRequestedVectors' + requestingNodeType: + $ref: '#/components/schemas/NodeType' + servingNetworkId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + anId: + $ref: '#/components/schemas/AccessNetworkId' + + HssAuthenticationInfoResult: + type: object + required: + - hssAuthenticationVectors + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hssAuthenticationVectors: + $ref: '#/components/schemas/HssAuthenticationVectors' + + HssAuthenticationVectors: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AvEpsAka' + minItems: 1 + maxItems: 5 + - type: array + items: + $ref: '#/components/schemas/AvImsGbaEapAka' + minItems: 1 + maxItems: 5 + - type: array + items: + $ref: '#/components/schemas/AvEapAkaPrime' + minItems: 1 + maxItems: 5 + + AvEpsAka: + type: object + required: + - avType + - rand + - xres + - autn + - kasme + properties: + avType: + $ref: '#/components/schemas/HssAvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + kasme: + $ref: '#/components/schemas/Kasme' + + AvImsGbaEapAka: + type: object + required: + - avType + - rand + - xres + - autn + - ck + - ik + properties: + avType: + $ref: '#/components/schemas/HssAvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + ck: + $ref: '#/components/schemas/ConfidentialityKey' + ik: + $ref: '#/components/schemas/IntegrityKey' + + GbaAuthenticationInfoRequest: + type: object + required: + - authType + properties: + authType: + $ref: '#/components/schemas/GbaAuthType' + resynchronizationInfo: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/ResynchronizationInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + GbaAuthenticationInfoResult: + type: object + properties: + 3gAkaAv: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/3GAkaAv' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ProSeAuthenticationInfoRequest: + type: object + required: + - servingNetworkName + - relayServiceCode + properties: + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + relayServiceCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RelayServiceCode' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ProSeAuthenticationInfoResult: + type: object + required: + - authType + properties: + authType: + $ref: '#/components/schemas/AuthType' + proseAuthenticationVectors: + $ref: '#/components/schemas/ProSeAuthenticationVectors' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ProSeAuthenticationVectors: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AvEapAkaPrime' + minItems: 1 + maxItems: 5 + + + +# SIMPLE TYPES: + + Autn: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Auts: + type: string + pattern: '^[A-Fa-f0-9]{28}$' + + CkPrime: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + IkPrime: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Kausf: + type: string + pattern: '^[A-Fa-f0-9]{64}$' + + Rand: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Xres: + type: string + pattern: '^[A-Fa-f0-9]{8,32}$' + + XresStar: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + ServingNetworkName: + type: string + pattern: '^(5G:mnc[0-9]{3}[.]mcc[0-9]{3}[.]3gppnetwork[.]org(:[A-F0-9]{11})?)|5G:NSWO$' + + Success: + type: boolean + + AuthenticatedInd: + type: boolean + + ConfidentialityKey: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + IntegrityKey: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Kasme: + type: string + pattern: '^[A-Fa-f0-9]{64}$' + + NumOfRequestedVectors: + type: integer + minimum: 1 + maximum: 5 + + +# ENUMS: + + AuthType: +# anyOf: +# - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - NONE + - EAP_TTLS +# - type: string + + AvType: +# anyOf: +# - type: string + enum: + - 5G_HE_AKA + - EAP_AKA_PRIME +# - type: string + + HssAuthType: +# anyOf: +# - type: string + enum: + - EPS_AKA + - EAP_AKA + - EAP_AKA_PRIME + - IMS_AKA + - GBA_AKA + - UMTS_AKA +# - type: string + + HssAvType: +# anyOf: +# - type: string + enum: + - EPS_AKA + - EAP_AKA + - IMS_AKA + - GBA_AKA + - UMTS_AKA +# - type: string + + HssAuthTypeInUri: +# anyOf: +# - type: string + enum: + - eps-aka + - eap-aka + - eap-aka-prime + - ims-aka + - gba-aka +# - type: string + + AccessNetworkId: +# anyOf: +# - type: string + enum: + - HRPD + - WIMAX + - WLAN + - ETHERNET +# - type: string + + NodeType: +# anyOf: +# - type: string + enum: + - AUSF + - VLR + - SGSN + - S_CSCF + - BSF + - GAN_AAA_SERVER + - WLAN_AAA_SERVER + - MME +# - type: string + + GbaAuthType: +# anyOf: +# - type: string + enum: + - DIGEST_AKAV1_MD5 +# - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_UECM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_UECM.yaml new file mode 100644 index 000000000..ad857c52e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29503_Nudm_UECM.yaml @@ -0,0 +1,2640 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'Nudm_UECM' + description: | + Nudm Context Management Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-uecm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-uecm + - {} + +paths: + /{ueId}/registrations: + get: + summary: retrieve UE registration data sets + operationId: GetRegistrations + tags: + - UECM Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: registration-dataset-names + in: query + style: form + explode: false + description: List of UECM registration dataset names + required: true + schema: + $ref: '#/components/schemas/RegistrationDatasetNames' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RegistrationDataSets' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/send-routing-info-sm: + post: + summary: Retreive addressing information for SMS delivery + operationId: SendRoutingInfoSm + tags: + - SendRoutingInfoSM (Custom Operation) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RoutingInfoSmRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RoutingInfoSmResponse' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access: + put: + summary: register as AMF for 3GPP access + operationId: 3GppRegistration + tags: + - AMF registration for 3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-3gpp-access' + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + patch: + summary: Update a parameter in the AMF registration for 3GPP access + operationId: Update3GppRegistration + tags: + - Parameter update in the AMF registration for 3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the AMF registration for 3GPP access information + operationId: Get3GppRegistration + tags: + - AMF 3Gpp-access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/dereg-amf: + post: + summary: trigger AMF for 3GPP access deregistration + operationId: deregAMF + tags: + - Trigger AMF for 3GPP access deregistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfDeregInfo' + required: true + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/pei-update: + post: + summary: Updates the PEI in the 3GPP access registration context + operationId: PeiUpdate + tags: + - PEI Update + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeiUpdateInfo' + required: true + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/roaming-info-update: + post: + summary: Update the Roaming Information + operationId: UpdateRoamingInformation + tags: + - Roaming Information Update + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:roaming-info-update:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RoamingInfoUpdate' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/RoamingInfoUpdate' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm//{ueId}/registrations/amf-3gpp-access/roaming-info-update' + required: true + schema: + type: string + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-non-3gpp-access: + put: + summary: register as AMF for non-3GPP access + operationId: Non3GppRegistration + tags: + - AMF registration for non-3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-non-3gpp-access' + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + '204': + description: No Content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: update a parameter in the AMF registration for non-3GPP access + operationId: UpdateNon3GppRegistration + tags: + - Parameter update in the AMF registration for non-3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the AMF registration for non-3GPP access information + operationId: GetNon3GppRegistration + tags: + - AMF non-3GPP-access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smf-registrations: + get: + summary: retrieve the SMF registration information + operationId: GetSmfRegistration + tags: + - SMF SmfRegistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistrationInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smf-registrations/{pduSessionId}: + put: + summary: register as SMF + operationId: Registration + tags: + - SMF SmfRegistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smf-registrations/{pduSessionId}' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete an SMF registration + operationId: SmfDeregistration + tags: + - SMF Deregistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: smf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: smf-instance-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: get an SMF registration + operationId: RetrieveSmfRegistration + tags: + - Retrieve SMF Registration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: update a parameter in the SMF registration + operationId: UpdateSmfRegistration + tags: + - Parameter update in the SMF registration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SmfRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smsf-3gpp-access: + put: + summary: register as SMSF for 3GPP access + operationId: 3GppSmsfRegistration + tags: + - SMSF registration for 3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smsf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smsf-3gpp-access' + required: true + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '204': + description: No content + headers: + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete the SMSF registration for 3GPP access + operationId: 3GppSmsfDeregistration + tags: + - SMSF Deregistration for 3GPP Access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smsf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: smsf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: If-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.1 + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the SMSF registration for 3GPP access information + operationId: Get3GppSmsfRegistration + tags: + - SMSF 3GPP access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smsf-non-3gpp-access: + put: + summary: register as SMSF for non-3GPP access + operationId: Non3GppSmsfRegistration + tags: + - SMSF registration for non-3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smsf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smsf-non-3gpp-access' + required: true + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '204': + description: No content + headers: + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete SMSF registration for non 3GPP access + operationId: Non3GppSmsfDeregistration + tags: + - SMSF Deregistration for non-3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smsf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: smsf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: If-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.1 + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the SMSF registration for non-3GPP access information + operationId: GetNon3GppSmsfRegistration + tags: + - SMSF non-3GPP access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/ip-sm-gw: + put: + summary: Register an IP-SM-GW + operationId: IpSmGwRegistration + tags: + - IP-SM-GW registration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:ip-sm-gw-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/ip-sm-gw' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: Delete the IP-SM-GW registration + operationId: IpSmGwDeregistration + tags: + - IP-SM-GW Deregistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:ip-sm-gw-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: Retrieve the IP-SM-GW registration information + operationId: GetIpSmGwRegistration + tags: + - IP-SM-GW Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /restore-pcscf: + post: + summary: Trigger the Restoration of the P-CSCF + operationId: Trigger P-CSCF Restoration + tags: + - Trigger P-CSCF Restoration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerRequest' + required: true + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/location: + get: + summary: retrieve the target UE's location information + operationId: GetLocationInfo + tags: + - UE Location Information retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/nwdaf-registrations: + get: + summary: retrieve the NWDAF registration + operationId: GetNwdafRegistration + tags: + - NWDAF Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: analytics-ids + in: query + description: List of analytics Id(s) provided by the consumers of NWDAF. + schema: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NwdafRegistration' + minItems: 1 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/nwdaf-registrations/{nwdafRegistrationId}: + put: + summary: register as NWDAF + operationId: NwdafRegistration + tags: + - NWDAF registration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:nwdaf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nwdafRegistrationId + in: path + description: NWDAF registration identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafRegistration' + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + delete: + summary: delete an NWDAF registration + operationId: NwdafDeregistration + tags: + - NWDAF Deregistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:nwdaf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nwdafRegistrationId + in: path + description: NWDAF registration identifier + required: true + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + patch: + summary: Update a parameter in the NWDAF registration + operationId: UpdateNwdafRegistration + tags: + - Parameter update in the NWDAF registration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:nwdaf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nwdafRegistrationId + in: path + description: NWDAF registration identifier + required: true + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/NwdafRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NwdafRegistration' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-uecm: Access to the nudm-uecm API + nudm_uecm:amf-registration:write: Write access (update/modify) to representations of the Amf3GppAccessRegistration and AmfNon3GppAccessRegistration resources + nudm_uecm:smf-registration:write: Write access (create/delete/modify) to the representations of individualSmfRegistration resources + nudm_uecm:smsf-registration:write: Write access (create/delete/modify) to representations of the Smsf3GppAccessRegistration and SmsfNon3GppAccessRegistration resources + nudm_uecm:ip-sm-gw-registration:write: Write access (create/delete/modify) to the representation of the IpSmGwRegistration resource + nudm_uecm:nwdaf-registration:write: Write access (create/delete/modify) to the representation of the NwdafRegistration resource + + + schemas: + +# COMPLEX TYPES: + + Amf3GppAccessRegistration: + type: object + required: + - amfInstanceId + - deregCallbackUri + - guami + - ratType + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNameDereg: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNamePcscfRest: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + initialRegistrationInd: + type: boolean + emergencyRegistrationInd: + type: boolean + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + drFlag: + $ref: '#/components/schemas/DualRegistrationFlag' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + urrpIndicator: + type: boolean + amfEeSubscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + epsInterworkingInfo: + $ref: '#/components/schemas/EpsInterworkingInfo' + ueSrvccCapability: + type: boolean + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + vgmlcAddress: + $ref: '#/components/schemas/VgmlcAddress' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + noEeSubscriptionInd: + type: boolean + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueReachableInd: + $ref: '#/components/schemas/UeReachableInd' + reRegistrationRequired: + type: boolean + adminDeregSubWithdrawn: + type: boolean + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + disasterRoamingInd: + type: boolean + default: false + ueMINTCapability: + type: boolean + sorSnpnSiSupported: + type: boolean + default: false + udrRestartInd: + type: boolean + default: false + lastSynchronizationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + + Amf3GppAccessRegistrationModification: + type: object + required: + - guami + properties: + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + epsInterworkingInfo: + $ref: '#/components/schemas/EpsInterworkingInfo' + ueSrvccCapability: + type: boolean + nullable: true + ueMINTCapability: + type: boolean + + EpsInterworkingInfo: + type: object + properties: + epsIwkPgws: + description: A map (list of key-value pairs where Dnn serves as key) of EpsIwkPgws + type: object + additionalProperties: + $ref: '#/components/schemas/EpsIwkPgw' + + EpsIwkPgw: + type: object + required: + - pgwFqdn + - smfInstanceId + properties: + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + AmfNon3GppAccessRegistration: + type: object + required: + - amfInstanceId + - imsVoPs + - deregCallbackUri + - guami + - ratType + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNameDereg: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNamePcscfRest: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + urrpIndicator: + type: boolean + amfEeSubscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + vgmlcAddress: + $ref: '#/components/schemas/VgmlcAddress' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + noEeSubscriptionInd: + type: boolean + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + reRegistrationRequired: + type: boolean + adminDeregSubWithdrawn: + type: boolean + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + disasterRoamingInd: + type: boolean + default: false + sorSnpnSiSupported: + type: boolean + default: false + udrRestartInd: + type: boolean + default: false + lastSynchronizationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + AmfNon3GppAccessRegistrationModification: + type: object + required: + - guami + properties: + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + + SmfRegistration: + type: object + required: + - smfInstanceId + - pduSessionId + - singleNssai + - plmnId + properties: + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + emergencyServices: + type: boolean + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddr: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpAddress' + epdgInd: + type: boolean + default: false + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + registrationReason: + $ref: '#/components/schemas/RegistrationReason' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + udrRestartInd: + type: boolean + default: false + lastSynchronizationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SmsfRegistration: + type: object + required: + - smsfInstanceId + - plmnId + properties: + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smsfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + smsfMAPAddress: + $ref: '#/components/schemas/E164Number' + smsfDiameterAddress: + $ref: '#/components/schemas/NetworkNodeDiameterAddress' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + smsfSbiSupInd: + type: boolean + default: false + udrRestartInd: + type: boolean + default: false + lastSynchronizationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + DeregistrationData: + type: object + required: + - deregReason + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + newSmfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + PcscfRestorationNotification: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + failedPcscf: + $ref: '#/components/schemas/PcscfAddress' + + NetworkNodeDiameterAddress: + type: object + required: + - name + - realm + properties: + name: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + realm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + + TriggerRequest: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + failedPcscf: + $ref: '#/components/schemas/PcscfAddress' + + SmfRegistrationInfo: + type: object + required: + - smfRegistrationList + properties: + smfRegistrationList: + type: array + items: + $ref: '#/components/schemas/SmfRegistration' + minItems: 1 + + IpSmGwRegistration: + type: object + anyOf: + - required: [ ipSmGwMapAddress ] + - required: [ ipSmGwDiameterAddress ] + - required: [ ipsmgwIpv4 ] + - required: [ ipsmgwIpv6 ] + - required: [ ipsmgwFqdn ] + properties: + ipSmGwMapAddress: + $ref: '#/components/schemas/E164Number' + ipSmGwDiameterAddress: + $ref: '#/components/schemas/NetworkNodeDiameterAddress' + ipsmgwIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipsmgwIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipsmgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + unriIndicator: + type: boolean + default: false + resetIds: + type: array + items: + type: string + minItems: 1 + ipSmGwSbiSupInd: + type: boolean + default: false + + + AmfDeregInfo: + type: object + required: + - deregReason + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + + LocationInfo: + type: object + required: + - registrationLocationInfoList + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + registrationLocationInfoList: + type: array + items: + $ref: '#/components/schemas/RegistrationLocationInfo' + minItems: 1 + maxItems: 2 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + RegistrationLocationInfo: + type: object + required: + - amfInstanceId + - accessTypeList + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + vgmlcAddress: + $ref: '#/components/schemas/VgmlcAddress' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + maxItems: 2 + + VgmlcAddress: + type: object + properties: + vgmlcAddressIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + vgmlcAddressIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + vgmlcFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + PeiUpdateInfo: + type: object + required: + - pei + properties: + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + + RegistrationDatasetNames: + type: array + items: + $ref: '#/components/schemas/RegistrationDataSetName' + minItems: 2 + uniqueItems: true + + RegistrationDataSets: + type: object + properties: + amf3Gpp: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + amfNon3Gpp: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + smfRegistration: + $ref: '#/components/schemas/SmfRegistrationInfo' + smsf3Gpp: + $ref: '#/components/schemas/SmsfRegistration' + smsfNon3Gpp: + $ref: '#/components/schemas/SmsfRegistration' + ipSmGw: + $ref: '#/components/schemas/IpSmGwRegistration' + nwdafRegistration: + $ref: '#/components/schemas/NwdafRegistrationInfo' + + NwdafRegistration: + description: The complete set of information relevant to an NWDAF serving the UE + type: object + required: + - nwdafInstanceId + - analyticsIds + properties: + nwdafInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + analyticsIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + minItems: 1 + nwdafSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + + NwdafRegistrationModification: + description: Contains attributes of NwdafRegistration that can be modified using PATCH + required: + - nwdafInstanceId + properties: + nwdafInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nwdafSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + analyticsIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + SmfRegistrationModification: + description: Contains attributes of SmfRegistration that can be modified using PATCH + type: object + required: + - smfInstanceId + properties: + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FqdnRm' + + DataRestorationNotification: + description: Contains identities representing those UEs potentially affected by a data-loss event at the UDR + type: object + properties: + lastReplicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + supiRanges: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IdentityRange' + minItems: 1 + resetIds: + type: array + items: + type: string + minItems: 1 + sNssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + RoamingInfoUpdate: + description: Contains the Roaming Information Update + type: object + required: + - servingPlmn + properties: + roaming: + type: + boolean + servingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + PcscfAddress: + description: Contains the addressing information (IP addresses and/or FQDN) of the P-CSCF + type: object + anyOf: + - required: [ipv4Addrs] + - required: [ipv6Addrs] + - required: [fqdn] + properties: + ipv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + NwdafRegistrationInfo: + description: List of NwdafRegistration + type: object + required: + - nwdafRegistrationList + properties: + nwdafRegistrationList: + type: array + items: + $ref: '#/components/schemas/NwdafRegistration' + minItems: 1 + + RoutingInfoSmRequest: + description: Request body of the send-routing-info-sm custom operation + type: object + properties: + ipSmGwInd: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + RoutingInfoSmResponse: + description: Addressing information of available nodes for SMS delivery + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + smsf3Gpp: + $ref: '#/components/schemas/SmsfRegistration' + smsfNon3Gpp: + $ref: '#/components/schemas/SmsfRegistration' + ipSmGw: + $ref: '#/components/schemas/IpSmGwInfo' + smsRouter: + $ref: '#/components/schemas/SmsRouterInfo' + + IpSmGwInfo: + description: Contains the IP-SM-GW Information + type: object + properties: + ipSmGwRegistration: + $ref: '#/components/schemas/IpSmGwRegistration' + ipSmGwGuidance: + $ref: '#/components/schemas/IpSmGwGuidance' + + IpSmGwGuidance: + description: > + Contains guidance information (e.g. minimum and recommended delivery times) of the IP-SM-GW + type: object + required: + - minDeliveryTime + - recommDeliveryTime + properties: + minDeliveryTime: + type: integer + minimum: 30 + maximum: 600 + recommDeliveryTime: + type: integer + minimum: 30 + maximum: 600 + + SmsRouterInfo: + description: Addressing information of the SMS Router configured at the UDM + type: object + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + diameterAddress: + $ref: '#/components/schemas/NetworkNodeDiameterAddress' + mapAddress: + $ref: '#/components/schemas/E164Number' + routerIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + routerIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + routerFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + +# SIMPLE TYPES: + + PurgeFlag: + type: boolean + + E164Number: + type: string + pattern: '^[0-9]{1,15}$' + + DualRegistrationFlag: + type: boolean + +# ENUMS: + + ImsVoPs: +# anyOf: +# - type: string + enum: + - HOMOGENEOUS_SUPPORT + - HOMOGENEOUS_NON_SUPPORT + - NON_HOMOGENEOUS_OR_UNKNOWN +# - type: string + + DeregistrationReason: +# anyOf: +# - type: string + enum: + - UE_INITIAL_REGISTRATION + - UE_REGISTRATION_AREA_CHANGE + - SUBSCRIPTION_WITHDRAWN + - 5GS_TO_EPS_MOBILITY + - 5GS_TO_EPS_MOBILITY_UE_INITIAL_REGISTRATION + - REREGISTRATION_REQUIRED + - SMF_CONTEXT_TRANSFERRED + - DUPLICATE_PDU_SESSION + - 5G_SRVCC_TO_UTRAN_MOBILITY +# - type: string + + RegistrationReason: +# anyOf: +# - type: string + enum: + - SMF_CONTEXT_TRANSFERRED +# - type: string + + RegistrationDataSetName: +# anyOf: +# - type: string + enum: + - AMF_3GPP + - AMF_NON_3GPP + - SMF_PDU_SESSIONS + - SMSF_3GPP + - SMSF_NON_3GPP + - IP_SM_GW + - NWDAF +# - type: string + + UeReachableInd: +# description: UE Reachable Indication +# anyOf: +# - type: string + enum: + - REACHABLE + - NOT_REACHABLE + - UNKNOWN +# - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29504_Nudr_DR.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29504_Nudr_DR.yaml new file mode 100644 index 000000000..cbf27caa1 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29504_Nudr_DR.yaml @@ -0,0 +1,394 @@ +openapi: 3.0.0 + +info: + version: 2.2.2 + title: 'Nudr_DataRepository API OpenAPI file' + description: | + Unified Data Repository Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.504 V17.9.0; 5G System; Unified Data Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.504/' + +servers: + - description: API root + url: '{apiRoot}/nudr-dr/v2' + variables: + apiRoot: + default: https://example.com + +security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + +paths: + /subscription-data/{ueId}/authentication-data/authentication-subscription: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-subscription' + /subscription-data/{ueId}/authentication-data/authentication-status: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-status' + /subscription-data/{ueId}/authentication-data/authentication-status/{servingNetworkName}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-status~1%7BservingNetworkName%7D' + /subscription-data/{ueId}/ue-update-confirmation-data/sor-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1sor-data' + /subscription-data/{ueId}/ue-update-confirmation-data/upu-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1upu-data' + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-cag: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1subscribed-cag' + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-snssais: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1subscribed-snssais' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/am-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1am-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/smf-selection-subscription-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1smf-selection-subscription-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sm-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sm-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-bca-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1lcs-bca-data' + /subscription-data/{ueId}/context-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data' + /subscription-data/{ueId}/context-data/amf-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1amf-3gpp-access' + /subscription-data/{ueId}/context-data/amf-non-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1amf-non-3gpp-access' + /subscription-data/{ueId}/context-data/smf-registrations: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smf-registrations' + /subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smf-registrations~1%7BpduSessionId%7D' + /subscription-data/{ueId}/operator-specific-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1operator-specific-data' + /subscription-data/{ueId}/context-data/smsf-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smsf-3gpp-access' + /subscription-data/{ueId}/context-data/smsf-non-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smsf-non-3gpp-access' + /subscription-data/{ueId}/context-data/location: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1location' + /subscription-data/{ueId}/context-data/ip-sm-gw: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ip-sm-gw' + /subscription-data/{ueId}/context-data/mwd: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1mwd' + /subscription-data/{ueId}/context-data/roaming-information: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1roaming-information' + /subscription-data/{ueId}/context-data/pei-info: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1pei-info' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-mng-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sms-mng-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sms-data' + /subscription-data/{ueId}/lcs-privacy-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1lcs-privacy-data' + /subscription-data/{ueId}/lcs-mo-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1lcs-mo-data' + /subscription-data/{ueId}/pp-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1pp-data' + /subscription-data/{ueId}/context-data/ee-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/amf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D~1amf-subscriptions' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/smf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D~1smf-subscriptions' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/hss-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D~1hss-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/amf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D~1amf-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/smf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D~1smf-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/hss-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D~1hss-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-profile-data' + /subscription-data/group-data/5g-vn-groups: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups' + /subscription-data/group-data/5g-vn-groups/{externalGroupId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups~1%7BexternalGroupId%7D' + /subscription-data/group-data/5g-vn-groups/internal: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups~1internal' + /subscription-data/group-data/5g-vn-groups/pp-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups~1pp-profile-data' + /subscription-data/{ueId}/ee-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ee-profile-data' + /subscription-data/{ueId}/context-data/sdm-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions' + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions~1%7BsubsId%7D' + /subscription-data/{ueId}/context-data/nidd-authorizations: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1nidd-authorizations' + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}/hss-sdm-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions~1%7BsubsId%7D~1hss-sdm-subscriptions' + /subscription-data/shared-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1shared-data' + /subscription-data/shared-data/{sharedDataId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1shared-data~1%7BsharedDataId%7D' + /subscription-data/subs-to-notify: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1subs-to-notify' + /subscription-data/subs-to-notify/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1subs-to-notify~1%7BsubsId%7D' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/trace-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1trace-data' + /subscription-data/{ueId}/identity-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1identity-data' + /subscription-data/{ueId}/operator-determined-barring-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1operator-determined-barring-data' + /subscription-data/{ueId}/nidd-authorization-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1nidd-authorization-data' + /subscription-data/{ueId}/service-specific-authorization-data/{serviceType}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1service-specific-authorization-data~1%7BserviceType%7D' + /subscription-data/{ueId}/v2x-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1v2x-data' + /subscription-data/{ueId}/pp-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1pp-profile-data' + /subscription-data/{ueId}/coverage-restriction-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1coverage-restriction-data' + /subscription-data/group-data/group-identifiers: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1group-identifiers' + /subscription-data/{ueId}/prose-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1prose-data' + /subscription-data/{ueId}/pp-data-store: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1pp-data-store' + /subscription-data/{ueId}/context-data/service-specific-authorizations/{serviceType}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1service-specific-authorizations~1%7BserviceType%7D' + /subscription-data/{ueId}/5mbs-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~15mbs-data' + /subscription-data/{ueId}/uc-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1uc-data' + /policy-data/ues/{ueId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D' + /policy-data/ues/{ueId}/am-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1am-data' + /policy-data/ues/{ueId}/ue-policy-set: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1ue-policy-set' + /policy-data/ues/{ueId}/sm-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1sm-data' + /policy-data/ues/{ueId}/sm-data/{usageMonId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1sm-data~1%7BusageMonId%7D' + /policy-data/sponsor-connectivity-data/{sponsorId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1sponsor-connectivity-data~1%7BsponsorId%7D' + /policy-data/bdt-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1bdt-data' + /policy-data/bdt-data/{bdtReferenceId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1bdt-data~1%7BbdtReferenceId%7D' + /policy-data/subs-to-notify: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1subs-to-notify' + /policy-data/subs-to-notify/{subsId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1subs-to-notify~1%7BsubsId%7D' + /policy-data/ues/{ueId}/operator-specific-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1operator-specific-data' + /application-data/pfds: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1pfds' + /application-data/pfds/{appId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1pfds~1%7BappId%7D' + /application-data/influenceData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/influenceData/{influenceId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1%7BinfluenceId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /policy-data/plmns/{plmnId}/ue-policy-set: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1plmns~1%7BplmnId%7D~1ue-policy-set' + /application-data/bdtPolicyData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1bdtPolicyData' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/bdtPolicyData/{bdtPolicyId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1bdtPolicyData~1%7BbdtPolicyId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/iptvConfigData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1iptvConfigData' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/iptvConfigData/{configurationId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1iptvConfigData~1%7BconfigurationId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/serviceParamData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1serviceParamData' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/serviceParamData/{serviceParamId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1serviceParamData~1%7BserviceParamId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/influenceData/subs-to-notify: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1subs-to-notify' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/influenceData/subs-to-notify/{subscriptionId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1subs-to-notify~1%7BsubscriptionId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/subs-to-notify: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1subs-to-notify' + /application-data/subs-to-notify/{subsId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1subs-to-notify~1%7BsubsId%7D' + /exposure-data/{ueId}/access-and-mobility-data: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1%7BueId%7D~1access-and-mobility-data' + /exposure-data/{ueId}/session-management-data/{pduSessionId}: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1%7BueId%7D~1session-management-data~1%7BpduSessionId%7D' + /exposure-data/subs-to-notify: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1subs-to-notify' + /exposure-data/subs-to-notify/{subId}: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1subs-to-notify~1%7BsubId%7D' + /data-restoration-events: + post: + # This is a pseudo operation, clients shall NOT invoke this method! + summary: subscribe to data restoration notifications + operationId: CreateIndividualSubcription + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: {} + responses: + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + restorationNotification: + '{dataRestorationCallbackUri}': + # The URI in {dataRestorationCallbackUri} is the default endpoint discovered from NRF. + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: No Content, Notification was succesfull + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: 'The URI pointing to the resource located on the redirect target NF service consumer' + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: 'The URI pointing to the resource located on the redirect target NF service consumer' + required: true + schema: + type: string + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudr-dr: Access to the Nudr_DataRepository API + nudr-dr:subscription-data: Access to the SubscriptionData data set + nudr-dr:subscription-data:authentication-subscription:read: Access to read the AuthenticationSubscription resource of the SubscriptionData data set + nudr-dr:subscription-data:authentication-subscription:modify: Access to update the AuthenticationSubscription resource of the SubscriptionData data set + nudr-dr:subscription-data:registrations:write: Write access to NF registration resources of the SubscriptionData data set + nudr-dr:policy-data: Access to the PolicyData data set + nudr-dr:policy-data:ues:read: Access to read the UEs resource + nudr-dr:policy-data:ues:am-data:read: Access to read the UEs Access and Mobility policy data + nudr-dr:policy-data:ues:ue-policy-set:read: Access to read the UEs Policy Set data + nudr-dr:policy-data:ues:ue-policy-set:create: Access to create the UEs Policy Set data + nudr-dr:policy-data:ues:ue-policy-set:modify: Access to update the UEs Policy Set data + nudr-dr:policy-data:ues:sm-data:read: Access to read the UEs Session Management Policy data + nudr-dr:policy-data:ues:sm-data:modify: Access to update the UEs Session Management Policy data + nudr-dr:policy-data:ues:sm-data:create: Access to create the UEs Session Management Policy data + nudr-dr:policy-data:sponsor-connectivity-data:read: Access to read the sponsored Connectivity Data + nudr-dr:policy-data:bdt-data:read: Access to read the BDT data resource + nudr-dr:policy-data:bdt-data:create: Access to create the BDT data resource + nudr-dr:policy-data:bdt-data:modify: Access to update the BDT data resource + nudr-dr:policy-data:subs-to-notify:create: Access to create Subscriptions resources + nudr-dr:policy-data:subs-to-notify:modify: Access to update Subscriptions resources + nudr-dr:policy-data:ues:operator-specific-data:read: Access to read the UEs operator specific policy data + nudr-dr:policy-data:ues:operator-specific-data:modify: Access to update the UEs operator specific policy data + nudr-dr:policy-data:ues:operator-specific-data:create: Access to create the UEs operator specific policy data + nudr-dr:policy-data:slice-control-data:read: Access to read Slice specific Policy Control Data + nudr-dr:policy-data:slice-control-data:modify: Access to update Slice specific Policy Control Data + nudr-dr:exposure-data: Access to the ExposureData data set + nudr-dr:exposure-data:access-and-mobility-data:create: Access to create ExposureData + nudr-dr:exposure-data:access-and-mobility-data:read: Access to read ExposureData + nudr-dr:exposure-data:access-and-mobility-data:modify: Access to update ExposureData + nudr-dr:exposure-data:session-management-data:create: Access to create ExposureData + nudr-dr:exposure-data:session-management-data:read: Access to read ExposureData + nudr-dr:exposure-data:session-management-data:modify: Access to update ExposureData + nudr-dr:exposure-data:subs-to-notify:create: Access to create Subscriptions resources + nudr-dr:exposure-data:subs-to-notify:modify: Access to update Subscriptions resources + nudr-dr:application-data: Access to the ApplicationData data set + nudr-dr:application-data:pfds:read: Access to read PFDData + nudr-dr:application-data:pfds:modify: Access to update PFDData + nudr-dr:application-data:pfds:create: Access to create PFDData + nudr-dr:application-data:influence-data:read: Access to read Traffic Influence Data + nudr-dr:application-data:influence-data:create: Access to create Traffic Influence Data. + nudr-dr:application-data:influence-data:modify: Access to update Traffic Influence Data + nudr-dr:application-data:influence-data:subscriptions:read: Access to read Traffic Influence Data Subscriptions + nudr-dr:application-data:influence-data:subscriptions:create: Access to create Traffic Influence Data Subscriptions + nudr-dr:application-data:influence-data:subscriptions:modify: Access to update Traffic Influence Data Subscriptions + nudr-dr:application-data:bdt-policy-data:read: Access to read BDT Policy Data + nudr-dr:application-data:bdt-policy-data:create: Access to create BDT Policy Data + nudr-dr:application-data:bdt-policy-data:modify: Access to update BDT Policy Data + nudr-dr:application-data:iptv-config-data:read: Access to read IPTV Configuration Data + nudr-dr:application-data:iptv-config-data:create: Access to create IPTV Configuration Data + nudr-dr:application-data:iptv-config-data:modify: Access to update IPTV Configuration Data + nudr-dr:application-data:service-param-data:read: Access to read Service Parameter Data + nudr-dr:application-data:service-param-data:create: Access to create Service Parameter Data + nudr-dr:application-data:service-param-data:modify: Access to update Service Parameter Data + nudr-dr:application-data:am-influence-data:read: Access to read AM Influence Data + nudr-dr:application-data:am-influence-data:create: Access to create AM Influence Data + nudr-dr:application-data:am-influence-data:modify: Access to update AM Influence Data + nudr-dr:application-data:subs-to-notify:create: Access to create Subscriptions resources + nudr-dr:application-data:subs-to-notify:read: Access to read Subscriptions resources + nudr-dr:application-data:subs-to-notify:modify: Access to update Subscriptions resources + nudr-dr:application-data:eas-deploy-data:read: Access to read EAS Deployment Information Data + nudr-dr:application-data:eas-deploy-data:create: Access to create EAS Deployment Information Data + nudr-dr:application-data:eas-deploy-data:modify: Access to update EAS Deployment Information Data + + schemas: + DataRestorationNotification: + description: Contains identities representing those UEs potentially affected by a data-loss event at the UDR + type: object + properties: + supiRanges: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IdentityRange' + minItems: 1 + resetIds: + type: array + items: + type: string + minItems: 1 + sNssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + udrGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29504_Nudr_GroupIDmap.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29504_Nudr_GroupIDmap.yaml new file mode 100644 index 000000000..b104ea7e5 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29504_Nudr_GroupIDmap.yaml @@ -0,0 +1,96 @@ +openapi: 3.0.0 + +info: + version: 1.1.0 + title: 'Nudr_GroupIDmap' + description: | + Unified Data Repository Service for NF-Group ID retrieval. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.504 V17.7.0; 5G System; Unified Data Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.504/' + +servers: + - description: API root + url: '{apiRoot}/nudr-group-id-map/v1' + variables: + apiRoot: + default: https://example.com + +security: + - {} + - oAuth2ClientCredentials: + - nudr-group-id-map + +paths: + /nf-group-ids: + get: + summary: Retrieves NF-Group IDs for provided Subscriber and NF types + operationId: GetNfGroupIDs + tags: + - NF Group IDs (Document) + parameters: + - name: nf-type + in: query + description: Type of NF + required: true + style: form + explode: false + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + minItems: 1 + - name: subscriberId +# The name of this query parameter is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + in: query + description: Identifier of the subscriber + required: true + schema: + $ref: '#/components/schemas/SubscriberId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NfGroupIdMapResult' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudr-group-id-map: Access to the Nudr_GroupIDmap API + + + + schemas: + +# COMPLEX TYPES: + + NfGroupIdMapResult: + description: Contains the NFGroupIds for the requested NF types. The NFType is the key of the map. + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + minProperties: 1 + +# SIMPLE TYPES: + + SubscriberId: + description: Represents the Subscription Identifier SUPI or GPSI or IMPI or IMPU. + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|impi-.+|impu-.+|.+)$' + +# ENUMS: diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29505_Subscription_Data.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29505_Subscription_Data.yaml new file mode 100644 index 000000000..683e64e68 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29505_Subscription_Data.yaml @@ -0,0 +1,7353 @@ +openapi: 3.0.0 +info: + version: '-' + title: 'Unified Data Repository Service API file for subscription data' + description: | + Unified Data Repository Service (subscription data). + The API version is defined in 3GPP TS 29.504. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.505 V17.9.0; 5G System; Usage of the Unified Data Repository Service for subscription data; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.505/' + +paths: + + /subscription-data/{ueId}/authentication-data/authentication-subscription: + get: + summary: Retrieves the authentication subscription data of a UE + operationId: QueryAuthSubsData + tags: + - Authentication Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:authentication-subscription:read + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the authentication subscription data of a UE + operationId: ModifyAuthenticationSubscription + tags: + - Authentication Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:authentication-subscription:modify + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/authentication-data/authentication-status: + put: + summary: To store the Authentication Status data of a UE + operationId: CreateAuthenticationStatus + tags: + - Authentication Status (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the Authentication Status of a UE + operationId: QueryAuthenticationStatus + tags: + - AuthEvent (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + description: Supported Features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the Authentication Status of a UE + operationId: DeleteAuthenticationStatus + tags: + - AuthEvent (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/authentication-data/authentication-status/{servingNetworkName}: + put: + summary: To store the individual Authentication Status data of a UE + operationId: CreateIndividualAuthenticationStatus + tags: + - Individual Authentication Status (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: servingNetworkName + in: path + description: Serving Network Name + required: true + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the Individual Authentication Status of a UE + operationId: QueryIndividualAuthenticationStatus + tags: + - Individual AuthEvent (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: servingNetworkName + in: path + description: Serving Network Name + required: true + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + description: Supported Features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the Individual Authentication Status of a UE + operationId: DeleteIndividualAuthenticationStatus + tags: + - Individual AuthEvent (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: servingNetworkName + in: path + description: Serving Network Name + required: true + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ue-update-confirmation-data/sor-data: + put: + summary: To store the SoR acknowledgement information of a UE and ME support of SOR CMCI + operationId: CreateAuthenticationSoR + tags: + - Authentication SoR (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorData' + required: true + responses: + '204': + description: Expected response to a valid request + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the SoR acknowledgement information of a UE and ME support of SOR CMCI + operationId: QueryAuthSoR + tags: + - Authentication SoR (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SorData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates the ME support of SOR CMCI information of a UE + operationId: UpdateAuthenticationSoR + tags: + - Authentication SoR (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ue-update-confirmation-data/upu-data: + put: + summary: To store the UPU acknowledgement information of a UE + operationId: CreateAuthenticationUPU + tags: + - Authentication UPU (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpuData' + required: true + responses: + '204': + description: Expected response to a valid request + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the UPU acknowledgement information of a UE + operationId: QueryAuthUPU + tags: + - Authentication UPU (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UpuData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-snssais: + put: + summary: To store the NSSAI update acknowledgement information of a UE + operationId: CreateOrUpdateNssaiAck + tags: + - NSSAI update ack (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAckData' + required: true + responses: + '204': + description: Expected response to a valid request + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the UPU acknowledgement information of a UE + operationId: QueryNssaiAck + tags: + - NSSAI ACK (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAckData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-cag: + put: + summary: To store the CAG update acknowledgement information of a UE + operationId: CreateCagUpdateAck + tags: + - CAG update ack (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CagAckData' + required: true + responses: + '204': + description: Expected response to a valid request + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the CAG acknowledgement information of a UE + operationId: QueryCagAck + tags: + - CAG ACK (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CagAckData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data: + get: + summary: Retrieve multiple provisioned data sets of a UE + operationId: QueryProvisionedData + tags: + - Provisioned Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: dataset-names + in: query + description: List of dataset names + style: form + explode: false + schema: + $ref: '#/components/schemas/DatasetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvisionedDataSets' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/am-data: + get: + summary: Retrieves the access and mobility subscription data of a UE + operationId: QueryAmData + tags: + - Access And Mobility Subscription Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/smf-selection-subscription-data: + get: + summary: Retrieves the SMF selection subscription data of a UE + operationId: QuerySmfSelectData + tags: + - SMF Selection Subscription Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sm-data: + get: + summary: Retrieves the Session Management subscription data of a UE + operationId: QuerySmData + tags: + - Session Management Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: false + - name: dnn + in: query + description: DNN + required: false + schema: + $ref: '#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmSubsData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/amf-3gpp-access: + get: + summary: Retrieves the AMF context data of a UE using 3gpp access + operationId: QueryAmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + put: + summary: To store the AMF context data of a UE using 3gpp access in the UDR + operationId: CreateAmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/amf-3gpp-access' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: To modify the AMF context data of a UE using 3gpp access in the UDR + operationId: AmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/amf-non-3gpp-access: + get: + summary: Retrieves the AMF context data of a UE using non-3gpp access + operationId: QueryAmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + put: + summary: To store the AMF context data of a UE using non-3gpp access in the UDR + operationId: CreateAmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/amf-non-3gpp-access' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: To modify the AMF context data of a UE using non 3gpp access in the UDR + operationId: AmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/smf-registrations: + get: + summary: Retrieves the SMF registration list of a UE + operationId: QuerySmfRegList + tags: + - SMF Registrations (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegList' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}: + get: + summary: Retrieves the individual SMF registration of a UE + operationId: QuerySmfRegistration + tags: + - SMF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + put: + summary: To create an individual SMF context data of a UE in the UDR + operationId: CreateOrUpdateSmfRegistration + tags: + - SMF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + required: true + responses: + '201': + description: Upon success, a response body containing a representation of the created Individual SmfRegistration resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}' + required: true + schema: + type: string + '204': + description: No content + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove an individual SMF context data of a UE the UDR + operationId: DeleteSmfRegistration + tags: + - SMF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: To modify the SMF context data of a UE in the UDR + operationId: UpdateSmfContext + tags: + - SMF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/operator-specific-data: + get: + summary: Retrieves the operator specific data of a UE + operationId: QueryOperSpecData + tags: + - Operator-Specific Data Container (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + description: A map(list of key-value pairs) where operator specific data element name serves as key + additionalProperties: + $ref: '#/components/schemas/OperatorSpecificDataContainer' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: To modify operator specific data of a UE + operationId: ModifyOperSpecData + tags: + - Operator-Specific Data Container (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + put: + summary: To create an operator-specific data resource of a UE + operationId: CreateOperSpecData + tags: + - Operator-Specific Data Container (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + type: object + description: A map (list of key-value pairs) where operator specific data element name serves as key + additionalProperties: + $ref: '#/components/schemas/OperatorSpecificDataContainer' + required: true + responses: + '201': + description: Upon success, a response body containing a representation of the created Operator Specific Data resource shall be returned + content: + application/json: + schema: + type: object + description: A map (list of key-value pairs) where operator specific data element name serves as key + additionalProperties: + $ref: '#/components/schemas/OperatorSpecificDataContainer' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/operator-specific-data' + required: true + schema: + type: string + '204': + description: No content + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove an operator-specific data resource of a UE + operationId: DeleteOperSpecData + tags: + - Operator-Specific Data Container (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned. + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/smsf-3gpp-access: + put: + summary: Create the SMSF context data of a UE via 3GPP access + operationId: CreateSmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/smsf-3gpp-access' + required: true + schema: + type: string + '200': + description: Updated + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the SMSF context data of a UE via 3GPP access + operationId: DeleteSmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the SMSF context data of a UE using 3gpp access + operationId: QuerySmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/smsf-non-3gpp-access: + put: + summary: Create the SMSF context data of a UE via non-3GPP access + operationId: CreateSmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/smsf-non-3gpp-access' + required: true + schema: + type: string + '200': + description: Updated + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the SMSF context data of a UE via non-3GPP access + operationId: DeleteSmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the SMSF context data of a UE using non-3gpp access + operationId: QuerySmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ip-sm-gw: + put: + summary: Create the IP-SM-GW context data of a UE + operationId: CreateIpSmGwContext + tags: + - IP-SM-GW Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the IP-SM-GW context data of a UE + operationId: DeleteIpSmGwContext + tags: + - IP-SM-GW Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the IP-SM-GW context data of a UE + operationId: ModifyIpSmGwContext + tags: + - IP-SM-GW Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the IP-SM-GW context data of a UE + operationId: QueryIpSmGwContext + tags: + - IP-SM-GW Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/mwd: + put: + summary: Create the Message Waiting Data of the UE + operationId: CreateMessageWaitingData + tags: + - Message Waiting Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MessageWaitingData' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/MessageWaitingData' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/mwd' + required: true + schema: + type: string + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + delete: + summary: To remove the Message Waiting Data of the UE + operationId: DeleteMessageWaitingData + tags: + - Message Waiting Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the Message Waiting Data of the UE + operationId: ModifyMessageWaitingData + tags: + - Message Waiting Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the Message Waiting Data of the UE + operationId: QueryMessageWaitingData + tags: + - Message Waiting Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/MessageWaitingData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-mng-data: + get: + summary: Retrieves the SMS management subscription data of a UE + operationId: QuerySmsMngData + tags: + - SMS Management Subscription Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-data: + get: + summary: Retrieves the SMS subscription data of a UE + operationId: QuerySmsData + tags: + - SMS Subscription Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/pp-data: + get: + summary: Read the profile of a given UE + operationId: GetppData + tags: + - Parameter Provision (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: pp data for a UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the provisioned parameter data + operationId: ModifyPpData + tags: + - ProvisionedParameterData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: pp data for a UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/pp-profile-data: + get: + summary: Retrieves the parameter provision profile data of a UE + operationId: QueryPPData + tags: + - Parameter Provision profile Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpProfileData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/pp-data-store/{afInstanceId}: + put: + summary: create a Provisioning Parameter Data Entry + operationId: Create PP Data Entry + tags: + - ProvisionedParameterDataEntry (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpDataEntry' + required: true + responses: + '201': + description: Indicating a successful creation of the resource. + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpDataEntry' + '204': + description: Indicating a successful creation of the resource. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + delete: + summary: Delete a Provisioning Parameter Data Entry + operationId: Delete PP Data Entry + tags: + - ProvisionedParameterDataEntry (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + get: + summary: get a Parameter Provisioning Data Entry + operationId: Get PP Data Entry + tags: + - ProvisionedParameterDataEntry (Document) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpDataEntry' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /subscription-data/{ueId}/pp-data-store: + get: + summary: get a list of Parameter Provisioning Data Entries + operationId: Get Multiple PP Data Entries + tags: + - ProvisionedParameterDataEntries (Collection) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpDataEntryList' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /subscription-data/{ueId}/context-data/ee-subscriptions: + get: + summary: Retrieves the ee subscriptions of a UE + operationId: Queryeesubscriptions + tags: + - Event Exposure Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: event-types + in: query + required: false + description: Event Types + schema: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EventType' + minItems: 1 + style: form + explode: false + - name: nf-identifiers + in: query + description: NF Identifiers + schema: + type: array + items: + $ref: '#/components/schemas/NfIdentifier' + minItems: 1 + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EeSubscriptionExt' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + post: + summary: Create individual EE subscription + operationId: CreateEeSubscriptions + tags: + - Event Exposure Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}: + put: + summary: Update an individual ee subscriptions of a UE + operationId: UpdateEesubscriptions + tags: + - Event Exposure Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a eeSubscription + operationId: RemoveeeSubscriptions + tags: + - Event Exposure Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify an individual ee subscription of a UE + operationId: ModifyEesubscription + tags: + - Event Exposure Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve a eeSubscription + operationId: QueryeeSubscription + tags: + - Event Exposure Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EeSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/amf-subscriptions: + put: + summary: Create AmfSubscriptions for an individual ee subscriptions of a UE + operationId: Create AMF Subscriptions + tags: + - AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes AMF Subscription Info for an eeSubscription + operationId: RemoveAmfSubscriptionsInfo + tags: + - Event AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the AMF Subscription Info + operationId: ModifyAmfSubscriptionInfo + tags: + - AmfSubscriptionInfo (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve AMF subscription Info + operationId: GetAmfSubscriptionInfo + tags: + - Query AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/smf-subscriptions: + put: + summary: Create SMF Subscription Info + operationId: Create SMF Subscriptions + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete SMF Subscription Info + operationId: RemoveSmfSubscriptionsInfo + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify SMF Subscription Info + operationId: ModifySmfSubscriptionInfo + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve SMF Subscription Info + operationId: GetSmfSubscriptionInfo + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/hss-subscriptions: + put: + summary: Create HSS Subscription Info + operationId: Create HSS Subscriptions + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete HSS Subscription Info + operationId: RemoveHssSubscriptionsInfo + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify HSS Subscription Info + operationId: ModifyHssSubscriptionInfo + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve HSS Subscription Info + operationId: GetHssSubscriptionInfo + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions: + get: + summary: Retrieves the ee subscriptions of a group of UEs or any UE + operationId: QueryEeGroupSubscriptions + tags: + - Event Exposure Group Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + post: + summary: Create individual EE subscription for a group of UEs or any UE + operationId: CreateEeGroupSubscriptions + tags: + - Event Exposure Group Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/group-data/{ueGroupId}/ee-subscriptions' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}: + put: + summary: Update an individual ee subscription of a group of UEs or any UE + operationId: UpdateEeGroupSubscriptions + tags: + - Event Exposure Group Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a eeSubscription for a group of UEs or any UE + operationId: RemoveEeGroupSubscriptions + tags: + - Event Exposure Group Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify an individual ee subscription for a group of a UEs + operationId: ModifyEeGroupSubscription + tags: + - Event Exposure Group Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve a individual eeSubscription for a group of UEs or any UE + operationId: QueryEeGroupSubscription + tags: + - Event Exposure Group Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EeSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-profile-data: + get: + summary: Retrieves the ee profile data profile data of a group or anyUE + operationId: QueryGroupEEData + tags: + - Event Exposure Data for a group (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeGroupProfileData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ee-profile-data: + get: + summary: Retrieves the ee profile data of a UE + operationId: QueryEEData + tags: + - Event Exposure Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeProfileData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/sdm-subscriptions: + get: + summary: Retrieves the sdm subscriptions of a UE + operationId: Querysdmsubscriptions + tags: + - SDM Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SdmSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + post: + summary: Create individual sdm subscription + operationId: CreateSdmSubscriptions + tags: + - SDM Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}: + put: + summary: Update an individual sdm subscriptions of a UE + operationId: Updatesdmsubscriptions + tags: + - SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a sdmsubscriptions + operationId: RemovesdmSubscriptions + tags: + - SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify an individual sdm subscription + operationId: ModifysdmSubscription + tags: + - SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves a individual sdmSubscription identified by subsId + operationId: QuerysdmSubscription + tags: + - SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SdmSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}/hss-sdm-subscriptions: + put: + summary: Create HSS SDM Subscription Info + operationId: Create HSS SDM Subscriptions + tags: + - HSS SDM Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete HSS SDM Subscription Info + operationId: RemoveHssSDMSubscriptionsInfo + tags: + - HSS SDM Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify HSS SDM Subscription Info + operationId: ModifyHssSDMSubscriptionInfo + tags: + - HSS SDM Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieve HSS SDM Subscription Info + operationId: GetHssSDMSubscriptionInfo + tags: + - HSS SDM Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedDataIds' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/shared-data/{sharedDataId}: + get: + summary: retrieve individual shared data + operationId: GetIndividualSharedData + tags: + - Retrieval of individual shared data + parameters: + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + - name: sharedDataId + in: path + description: Id of the Shared Data + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedDataId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/subs-to-notify: + post: + summary: Subscription data subscriptions + operationId: SubscriptionDataSubscriptions + tags: + - Subs To Notify (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/subs-to-notify/{subsId}' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + onDataChange: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataChangeNotify' + responses: + '204': + description: Expected response to a valid request + + get: + summary: Retrieves the list of subscriptions + operationId: QuerySubsToNotify + tags: + - Subs To Notify (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ue-id + in: query + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes subscriptions identified by a given ue-id parameter + operationId: RemoveMultipleSubscriptionDataSubscriptions + tags: + - Subs To Notify (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ue-id + in: query + required: true + description: UE ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nf-instance-id + in: query + required: false + description: NF Instance ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: delete-all-nfs + in: query + required: false + description: Flag to delete subscriptions from all NFs + schema: + type: boolean + - name: implicit-unsubscribe-indication + in: query + required: false + description: Implicit Unsubscribe Indication + schema: + type: boolean + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/subs-to-notify/{subsId}: + delete: + summary: Deletes a subscriptionDataSubscriptions + operationId: RemovesubscriptionDataSubscriptions + tags: + - Subs To Notify (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify an individual subscriptionDataSubscription + operationId: ModifysubscriptionDataSubscription + tags: + - Subs To Notify (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + - $ref: '#/components/schemas/SubscriptionDataSubscriptions' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves a individual subscriptionDataSubscription identified by subsId + operationId: QuerySubscriptionDataSubscriptions + tags: + - Subs To Notify (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: subsId + in: path + required: true + description: Unique ID of the subscription to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/trace-data: + get: + summary: Retrieves the trace configuration data of a UE + operationId: QueryTraceData + tags: + - Trace Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/identity-data: + get: + summary: Retrieve identity data by SUPI or GPSI + operationId: GetIdentityData + tags: + - Query Identity Data by SUPI or GPSI (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: app-port-id + in: query + description: Application port identifier + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AppPortId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/operator-determined-barring-data: + get: + summary: Retrieve ODB Data data by SUPI or GPSI + operationId: GetOdbData + tags: + - Query ODB Data by SUPI or GPSI (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data: + get: + summary: Retrieve multiple context data sets of a UE + operationId: QueryContextData + tags: + - Context Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: context-dataset-names + in: query + description: List of context dataset names + style: form + explode: false + required: true + schema: + $ref: '#/components/schemas/ContextDatasetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ContextDataSets' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/group-identifiers: + get: + summary: Mapping of Group Identifiers + operationId: GetGroupIdentifiers + tags: + - Group Identifiers + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ext-group-id + in: query + description: External Group Identifier + required: false + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: int-group-id + in: query + description: Internal Group Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: ue-id-ind + in: query + description: Indication whether UE identifiers are required or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GroupIdentifiers' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/5g-vn-groups: + get: + summary: Retrieves the data of a 5G VN Group + operationId: Query5GVnGroup + tags: + - 5G-VN-Groups (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: gpsis + in: query + description: List of GPSIs + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + description: A map(list of key-value pairs) where ExtGroupId serves as key + additionalProperties: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/5g-vn-groups/{externalGroupId}: + put: + summary: Create an individual 5G VN Grouop + operationId: Create5GVnGroup + tags: + - 5GVnGroupConfiguration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes the 5GVnGroup + operationId: Delete5GVnGroup + tags: + - Delete 5GVnGroup + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '204': + description: Expected response to a successful group removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the 5GVnGroup + operationId: Modify5GVnGroup + tags: + - Modify 5GVnGroup + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve a 5GVnGroup configuration + operationId: Get5GVnGroupConfiguration + tags: + - Query 5GVnGroupConfiguration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/lcs-privacy-data: + get: + summary: Retrieves the LCS Privacy subscription data of a UE + operationId: QueryLcsPrivacyData + tags: + - LCS Privacy Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsPrivacyData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/lcs-mo-data: + get: + summary: Retrieves the LCS Mobile Originated subscription data of a UE + operationId: QueryLcsMoData + tags: + - LCS Mobile Originated Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsMoData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/nidd-authorization-data: + get: + summary: Retrieve NIDD Authorization Data GPSI or External Group identifier + operationId: GetNiddAuData + tags: + - Query NIDD Authorization Data GPSI or External Group identifier (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: true + - name: dnn + in: query + description: DNN + required: true + schema: + $ref: '#/components/schemas/Dnn' + - name: mtc-provider-information + in: query + description: MTC Provider Information + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: af-id + in: query + description: Application Function Identifier + schema: + type: string + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/coverage-restriction-data: + get: + summary: Retrieves the subscribed enhanced Coverage Restriction Data of a UE + operationId: QueryCoverageRestrictionData + tags: + - Enhanced Coverage Restriction Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnhancedCoverageRestrictionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/location: + get: + summary: Retrieves the UE's Location Information + operationId: QueryUeLocation + tags: + - UE's Location Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/v2x-data: + get: + summary: Retrieves the subscribed V2X Data of a UE + operationId: QueryV2xData + tags: + - V2X Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/V2xSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/prose-data: + get: + summary: Retrieves the subscribed ProSe service Data of a UE + operationId: QueryPorseData + tags: + - ProSe Service Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ProseSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-bca-data: + get: + summary: Retrieves the LCS Broadcast Assistance subscription data of a UE + operationId: QueryLcsBcaData + tags: + - LCS Broadcast Assistance Subscription Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/5g-vn-groups/internal: + get: + summary: Retrieves the data of 5G VN Group + operationId: Query5GVnGroupInternal + tags: + - 5G-VN-Groups-Internal (Document) + parameters: + - name: internal-group-ids + in: query + description: List of Internal Group IDs + required: true + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + description: A map (list of key-value pairs) where ExtGroupId serves as key + additionalProperties: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/5g-vn-groups/pp-profile-data: + get: + summary: Retrieves the parameter provision profile data for 5G VN Group + operationId: Query5GVNGroupPPData + tags: + - Parameter Provision profile Data for 5G VN Group(Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ext-group-ids + in: query + description: List of external VN group identifiers + schema: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Pp5gVnGroupProfileData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/nidd-authorizations: + put: + summary: Create NIDD Authorization Info + operationId: CreateNIDDAuthorizationInfo + tags: + - NIDD Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthorizationInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthorizationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete NIDD Authorization Info + operationId: RemoveNiddAuthorizationInfo + tags: + - NIDD Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify NIDD Authorization Info + operationId: ModifyNiddAuthorizationInfo + tags: + - NIDD Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve NIDD Authorization Info + operationId: GetNiddAuthorizationInfo + tags: + - NIDD Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthorizationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/5mbs-data: + get: + summary: Retrieves the 5mbs subscription data of a UE + operationId: Query5mbsData + tags: + - 5MBSSubscriptionData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/MbsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}: + get: + summary: Retrieve multiple subscribed data sets of a UE + operationId: QueryUeSubscribedData + tags: + - UE Subscribed Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: dataset-names + in: query + description: List of dataset names + style: form + explode: false + schema: + $ref: '#/components/schemas/DatasetNames' + - name: serving-plmn + in: query + description: Serving PLMN Id + schema: + $ref: '#/components/schemas/VarPlmnId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeSubscribedDataSets' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/service-specific-authorization-data/{serviceType}: + get: + summary: Retrieve ServiceSpecific Authorization Data + operationId: GetSSAuData + tags: + - Query Service Specific Authorization Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: true + - name: dnn + in: query + description: DNN + required: true + schema: + $ref: '#/components/schemas/Dnn' + - name: mtc-provider-information + in: query + description: MTC Provider Information + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: af-id + in: query + description: Application Function Identifier + schema: + type: string + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/service-specific-authorizations/{serviceType}: + put: + summary: Create Service Specific Authorization Info + operationId: CreateServiceSpecificAuthorizationInfo + tags: + - Service Specific Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete Service Specific Authorization Info + operationId: RemoveServiceSpecificAuthorizationInfo + tags: + - Service Specific Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify Service Specific Authorization Info + operationId: ModifyServiceSpecificAuthorizationInfo + tags: + - Service Specific Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieve Service Specific Authorization Info + operationId: GetServiceSpecificAuthorizationInfo + tags: + - Service Specific Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/roaming-information: + put: + summary: Update the Roaming Information of the EPC domain + operationId: UpdateRoamingInformation + tags: + - Update the Roaming Information of the EPC domain (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/RoamingInfoUpdate' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/RoamingInfoUpdate' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/roaming-information' + required: true + schema: + type: string + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + + get: + summary: Retrieves the Roaming Information of the EPC domain + operationId: QueryRoamingInformation + tags: + - Retrieve the Roaming Information of the EPC domain (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/RoamingInfoUpdate' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/pei-info: + put: + summary: Update the PEI Information of the 5GC/EPC domains + operationId: CreateOrUpdatePeiInformation + tags: + - Update the PEI Information of the 5GC/EPC domains (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/PeiUpdateInfo' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/PeiUpdateInfo' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/pei-info' + required: true + schema: + type: string + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + + get: + summary: Retrieves the PEI Information of the 5GC/EPC domains + operationId: QueryPeiInformation + tags: + - Retrieve the Roaming Information of the 5GC/EPC domains (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/PeiUpdateInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/amf-subscriptions: + put: + summary: Create AmfSubscriptions for a group of UEs or any UE + operationId: CreateAmfGroupSubscriptions + tags: + - AMF Group Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes AMF Subscription Info for an eeSubscription for a group of UEs or any UE + operationId: RemoveAmfGroupSubscriptions + tags: + - Event AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the AMF Subscription Info + operationId: ModifyAmfGroupSubscriptions + tags: + - AmfSubscriptionInfo (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve AMF subscription Info for a group of UEs or any UE + operationId: GetAmfGroupSubscriptions + tags: + - Query AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/smf-subscriptions: + put: + summary: Create SMF Subscription Info for a group of UEs or any YE + operationId: CreateSmfGroupSubscriptions + tags: + - SMF Event Group Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete SMF Subscription Info for a group of UEs or any UE + operationId: RemoveSmfGroupSubscriptions + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify SMF Subscription Info for a group of UEs or any UE + operationId: ModifySmfGroupSubscriptions + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve SMF Subscription Info for a group of UEs or any UE + operationId: GetSmfGroupSubscriptions + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/hss-subscriptions: + put: + summary: Create HSS Subscription Info for a group of UEs + operationId: CreateHssGroupSubscriptions + tags: + - HSS Event Group Subscription Info (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete HSS Subscription Info + operationId: RemoveHssGroupSubscriptions + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify HSS Subscription Info + operationId: ModifyHssGroupSubscriptions + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve HSS Subscription Info + operationId: GetHssGroupSubscriptions + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/uc-data: + get: + summary: Retrieves the subscribed User Consent Data of a UE + operationId: QueryUserConsentData + tags: + - User Consent Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: ucPurpose + in: query + description: User consent purpose + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/UcPurpose' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UcSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + AuthenticationSubscription: + description: A UE's authentication data. + type: object + required: + - authenticationMethod + properties: + authenticationMethod: + $ref: '#/components/schemas/AuthMethod' + encPermanentKey: + type: string + protectionParameterId: + type: string + sequenceNumber: + $ref: '#/components/schemas/SequenceNumber' + authenticationManagementField: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + algorithmId: + type: string + encOpcKey: + type: string + encTopcKey: + type: string + vectorGenerationInHss: + type: boolean + default: false + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + n5gcAuthMethod: + $ref: '#/components/schemas/AuthMethod' + rgAuthenticationInd: + type: boolean + default: false + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + akmaAllowed: + type: boolean + default: false + routingId: + type: string + pattern: '^[0-9]{1,4}$' + + SequenceNumber: + description: Contains the SQN. + type: object + properties: + sqnScheme: + $ref: '#/components/schemas/SqnScheme' + sqn: + type: string + pattern: '^[A-Fa-f0-9]{12}$' + lastIndexes: + type: object + additionalProperties: + type: integer + minimum: 0 + description: A map(list of key-value pairs) where type of node serves as key + indLength: + type: integer + minimum: 0 + difSign: + $ref: '#/components/schemas/Sign' + + SqnScheme: +# description: Scheme for generation of Sequence Numbers. +# anyOf: +# - type: string + enum: + - GENERAL + - NON_TIME_BASED + - TIME_BASED +# - type: string + Sign: + description: Sign of the DIF value. + type: string + enum: + - POSITIVE + - NEGATIVE + VarPlmnId: + description: PLMN Id (MCC, MNC) or SNPN Id (MCC, MNC, NID). + type: string + pattern: '^[0-9]{5,6}(-[A-Fa-f0-9]{11})?$' + DatasetNames: + description: The list of names of data sets. + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 1 + uniqueItems: true + DataSetName: +# description: The name of data set. +# anyOf: +# - type: string + enum: + - AM + - SMF_SEL + - SMS_SUB + - SM + - TRACE + - SMS_MNG + - LCS_PRIVACY + - LCS_MO + - LCS_BCA + - V2X + - PROSE + - ODB + - EE_PROF + - PP_PROF + - NIDD_AUTH + - USER_CONSENT + - MBS +# - type: string + ProvisionedDataSets: + description: Contains the provisioned data sets. + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + $ref: '#/components/schemas/SmSubsData' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + lcsBcaData: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + v2xData: + $ref: '#/components/schemas/V2xSubscriptionData' + proseData: + $ref: '#/components/schemas/ProseSubscriptionData' + odbData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbData' + eeProfileData: + $ref: '#/components/schemas/EeProfileData' + ppProfileData: + $ref: '#/components/schemas/PpProfileData' + niddAuthData: + $ref: '#/components/schemas/AuthorizationData' + mbsSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/MbsSubscriptionData' + + AccessAndMobilitySubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AccessAndMobilitySubscriptionData' + SmfSelectionSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmfSelectionSubscriptionData' + VarSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + Dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + SmSubsData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmSubsData' + Amf3GppAccessRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/Amf3GppAccessRegistration' + AmfNon3GppAccessRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/AmfNon3GppAccessRegistration' + SmfRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/SmfRegistration' + SmsfRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/SmsfRegistration' + LocationInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/LocationInfo' + SmsManagementSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmsManagementSubscriptionData' + SmsSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmsSubscriptionData' + LcsPrivacyData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsPrivacyData' + LcsMoData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsMoData' + AuthorizationData: + description: NIDD Authorization Information + required: + - authorizationData + properties: + authorizationData: + type: array + items: + $ref: 'TS29503_Nudm_NIDDAU.yaml#/components/schemas/UserIdentifier' + minItems: 1 + uniqueItems: true + allowedDnnList: + type: array + items: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + allowedSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + allowedMtcProviders: + type: array + items: + $ref: '#/components/schemas/MtcProvider' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + EnhancedCoverageRestrictionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/EnhancedCoverageRestrictionData' + V2xSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/V2xSubscriptionData' + ProseSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ProseSubscriptionData' + UcSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/UcSubscriptionData' + LcsBroadcastAssistanceTypesData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsBroadcastAssistanceTypesData' + OperatorSpecificDataContainer: + description: Container for operator specific data. + type: object + required: + - dataType + - value + properties: + dataType: + type: string + enum: + - string + - integer + - number + - boolean + - object + - array + dataTypeDefinition: + type: string + value: + oneOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: object + - type: array + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + + AuthMethod: +# description: Contains the Authentication Method. +# anyOf: +# - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - EAP_TTLS + - NONE +# - type: string + PpData: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpData' + EeSubscription: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EeSubscription' + VarUeGroupId: + description: UE group Id or any UE. + type: string + pattern: '^(extgroupid-[^@]+@[^@]+|anyUE)$' + SdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + SmfRegList: + description: The list of all the SMF registrations of a UE. + type: array + items: + $ref: '#/components/schemas/SmfRegistration' + SubscriptionDataSubscriptions: + description: A subscription to notifications. + type: object + required: + - monitoredResourceUris + - callbackReference + properties: + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + originalCallbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + hssSubscriptionInfo: + $ref: '#/components/schemas/HssSubscriptionInfo' + subscriptionId: + type: string + uniqueSubscription: + type: boolean + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + DataChangeNotify: + description: Container for data which have changed and notification was requested when changed. + type: object + properties: + originalCallbackReference: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + notifyItems: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotifyItem' + minItems: 1 + sdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + additionalSdmSubscriptions: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + minItems: 1 + subscriptionDataSubscriptions: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + + IdentityData: + description: Identity data corresponds to the provided ueId. + type: object + properties: + supiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + allowedAfIds: + type: array + items: + type: string + minItems: 1 + applicationPortIds: + description: A map (list of key-value pairs where AppPortId serves as key) of GPSIs. + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minProperties: 1 + + SorData: + description: Used to store the status of the latest SOR data update. + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + sorXmacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + sorMacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + meSupportOfSorCmci: + type: boolean + required: + - provisioningTime + - ueUpdateStatus + + UpuData: + description: Used to store the status of the latest UPU data update. + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + upuXmacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + upuMacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + required: + - provisioningTime + - ueUpdateStatus + + NssaiAckData: + description: Used to store the status of the latest NSSAI data update. + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + required: + - provisioningTime + - ueUpdateStatus + + CagAckData: + description: Used to store the status of the latest CAG data update. + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + required: + - provisioningTime + - ueUpdateStatus + + UeUpdateStatus: + description: Status of the procedure. + type: string + enum: + - NOT_SENT + - SENT_NO_ACK_REQUIRED + - WAITING_FOR_ACK + - ACK_RECEIVED + - NEGATIVE_ACK_RECEIVED + + EeProfileData: + description: Event Exposure Profile Data. + type: object + properties: + restrictedEventTypes: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EventType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + allowedMtcProvider: + description: A map (list of key-value pairs where EventType serves as key) of MTC provider lists. In addition to defined EventTypes, the key value "ALL" may be used to identify a map entry which contains a list of MtcProviders that are allowed monitoring all Event Types. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/MtcProvider' + minItems: 1 + minProperties: 1 + iwkEpcRestricted: + type: boolean + default: false + imsi: + type: string + pattern: '^[0-9]{5,15}$' + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + AmfSubscriptionInfo: + description: Information the UDR stores and retrieves related to active subscriptions at the AMF(s). + type: object + required: + - amfInstanceId + - subscriptionId + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subsChangeNotifyCorrelationId: + type: string + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + + ContextDatasetNames: + description: The name of context data set. + type: array + items: + $ref: '#/components/schemas/ContextDataSetName' + minItems: 2 + uniqueItems: true + ContextDataSetName: +# anyOf: +# - type: string + enum: + - AMF_3GPP + - AMF_NON_3GPP + - SDM_SUBSCRIPTIONS + - EE_SUBSCRIPTIONS + - SMSF_3GPP + - SMSF_NON_3GPP + - SUBS_TO_NOTIFY + - SMF_REG + - IP_SM_GW + - ROAMING_INFO + - PEI_INFO +# - type: string + ContextDataSets: + description: Contains the context data sets. + type: object + properties: + amf3Gpp: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + amfNon3Gpp: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + sdmSubscriptions: + type: array + items: + $ref: '#/components/schemas/SdmSubscription' + minItems: 1 + eeSubscriptions: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + minItems: 1 + smsf3GppAccess: + $ref: '#/components/schemas/SmsfRegistration' + smsfNon3GppAccess: + $ref: '#/components/schemas/SmsfRegistration' + subscriptionDataSubscriptions: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + minItems: 1 + smfRegistrations: + $ref: '#/components/schemas/SmfRegList' + ipSmGw: + $ref: '#/components/schemas/IpSmGwRegistration' + roamingInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/RoamingInfoUpdate' + peiInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/PeiUpdateInfo' + + IpSmGwRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/IpSmGwRegistration' + + MessageWaitingData: + description: Message Waiting Data list. + type: object + properties: + mwdList: + type: array + items: + $ref: '#/components/schemas/SmscData' + minItems: 1 + + SmscData: + description: Addresses of SM-Service Center entities with SMS wating to be delivered to the UE. + type: object + anyOf: + - required: [ smscMapAddress ] + - required: [ smscDiameterAddress ] + properties: + smscMapAddress: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/E164Number' + smscDiameterAddress: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/NetworkNodeDiameterAddress' + + SmfSubscriptionInfo: + description: Information related to active subscriptions at the SMF(s) + type: object + required: + - smfSubscriptionList + properties: + smfSubscriptionList: + type: array + items: + $ref: '#/components/schemas/SmfSubscriptionItem' + minItems: 1 + + SmfSubscriptionItem: + description: Contains info about a single SMF event subscription + type: object + required: + - smfInstanceId + - subscriptionId + properties: + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + + MtcProvider: + description: MTC provider information. + type: object + properties: + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + afId: + type: string + + HssSubscriptionInfo: + description: Information related to active subscriptions at the HSS(s) + type: object + required: + - hssSubscriptionList + properties: + hssSubscriptionList: + type: array + items: + $ref: '#/components/schemas/HssSubscriptionItem' + minItems: 1 + + HssSubscriptionItem: + description: Contains info about a single HSS event subscription + type: object + required: + - hssInstanceId + - subscriptionId + properties: + hssInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + + EeGroupProfileData: + type: object + properties: + restrictedEventTypes: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EventType' + allowedMtcProvider: + description: A map (list of key-value pairs where EventType serves as key) of MTC provider lists. In addition to defined EventTypes, the key value "ALL" may be used to identify a map entry which contains a list of MtcProviders that are allowed monitoring all Event Types. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/MtcProvider' + minItems: 1 + minProperties: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + iwkEpcRestricted: + type: boolean + default: false + extGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + Pp5gVnGroupProfileData: + type: object + properties: + allowedMtcProviders: + description: A map (list of key-value pairs where external VN group identifier serves as key) of AllowedMtcProviderInfo lists. In addition to defined external VN group identifier, the key value "ALL" may be used to identify a map entry which contains a list of AllowedMtcProviderInfo that are allowed operating all the external group identifiers. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/AllowedMtcProviderInfo' + minItems: 1 + minProperties: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + PpProfileData: + type: object + properties: + allowedMtcProviders: + description: A map (list of key-value pairs where PpDataType serves as key) of AllowedMtcProviderInfo lists. In addition to defined PpDataType, the key value "ALL" may be used to identify a map entry which contains a list of AllowedMtcProviderInfo that are allowed to provision all types of the PP data for the user using UDM ParameterProvision service. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/AllowedMtcProviderInfo' + minItems: 1 + minProperties: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + AllowedMtcProviderInfo: + type: object + properties: + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + afId: + type: string + + PpDataType: +# anyOf: +# - type: string + enum: + - COMMUNICATION_CHARACTERISTICS + - EXPECTED_UE_BEHAVIOUR + - EC_RESTRICTION + - ACS_INFO + - TRACE + - STN_SR + - LCS_PRIVACY + - SOR_INFO +# - type: string + + GroupIdentifiers: + description: External or Internal Group Identifier with a list of group members + type: object + properties: + extGroupId: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + intGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + ueIdList: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/UeId' + minItems: 1 + allowedAfIds: + type: array + items: + type: string + minItems: 1 + + NiddAuthorizationInfo: + description: Information related to active NIDD Authorizations + type: object + required: + - niddAuthorizationList + properties: + niddAuthorizationList: + type: array + items: + $ref: 'TS29503_Nudm_NIDDAU.yaml#/components/schemas/AuthorizationInfo' + minItems: 1 + + PpDataEntryList: + description: Contains a list of the Provisioned Parameters entries + type: object + properties: + ppDataEntryList: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpDataEntry' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + UeSubscribedDataSets: + description: Contains the subscribed data sets of a UE. + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + $ref: '#/components/schemas/SmSubsData' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + lcsBcaData: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + v2xData: + $ref: '#/components/schemas/V2xSubscriptionData' + proseData: + $ref: '#/components/schemas/ProseSubscriptionData' + odbData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbData' + eeProfileData: + $ref: '#/components/schemas/EeProfileData' + ppProfileData: + $ref: '#/components/schemas/PpProfileData' + niddAuthData: + $ref: '#/components/schemas/AuthorizationData' + ucData: + $ref: '#/components/schemas/UcSubscriptionData' + mbsSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/MbsSubscriptionData' + + ServiceSpecificAuthorizationInfo: + description: Information related to active Service Specific Authorizations + type: object + required: + - serviceSpecificAuthorizationList + properties: + serviceSpecificAuthorizationList: + type: array + items: + $ref: 'TS29503_Nudm_NIDDAU.yaml#/components/schemas/AuthorizationInfo' + minItems: 1 + + NfIdentifier: + type: object + required: + - nfType + properties: + nfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + EeSubscriptionExt: + allOf: + - $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EeSubscription' + - $ref: '#/components/schemas/AdditionalEeSubsInfo' + + AdditionalEeSubsInfo: + type: object + properties: + amfSubscriptionInfoList: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + maxItems: 2 + smfSubscriptionInfo: + $ref: '#/components/schemas/SmfSubscriptionInfo' + hssSubscriptionInfo: + $ref: '#/components/schemas/HssSubscriptionInfo' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29507_Npcf_AMPolicyControl.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29507_Npcf_AMPolicyControl.yaml new file mode 100644 index 000000000..b8a84f596 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29507_Npcf_AMPolicyControl.yaml @@ -0,0 +1,809 @@ +openapi: 3.0.0 +info: + version: 1.2.0 + title: Npcf_AMPolicyControl + description: | + Access and Mobility Policy Control Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.507 V17.7.0; 5G System; Access and Mobility Policy Control Service. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.507/' +servers: + - url: '{apiRoot}/npcf-am-policy-control/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - npcf-am-policy-control +paths: + /policies: + post: + operationId: CreateIndividualAMPolicyAssociation + summary: Create individual AM policy association. + tags: + - AM Policy Associations (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyAssociationRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyAssociation' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/npcf-am-policy-control/v1/policies/{polAssoId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + policyUpdateNotification: + '{$request.body#/notificationUri}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyUpdate' + responses: + '200': + description: > + OK. The current applicable values corresponding to the policy control request + trigger is reported + content: + application/json: + schema: + $ref: '#/components/schemas/AmRequestedValueRep' + '204': + description: No Content, Notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + policyAssocitionTerminationRequestNotification: + '{$request.body#/notificationUri}/terminate': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TerminationNotification' + responses: + '204': + description: No Content, Notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /policies/{polAssoId}: + get: + operationId: ReadIndividualAMPolicyAssociation + summary: Read individual AM policy association. + tags: + - Individual AM Policy Association (Document) + parameters: + - name: polAssoId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyAssociation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + operationId: DeleteIndividualAMPolicyAssociation + summary: Delete individual AM policy association. + tags: + - Individual AM Policy Association (Document) + parameters: + - name: polAssoId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was successfully deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /policies/{polAssoId}/update: + post: + operationId: ReportObservedEventTriggersForIndividualAMPolicyAssociation + summary: > + Report observed event triggers and obtain updated policies for an individual AM + policy association. + tags: + - Individual AM Policy Association (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyAssociationUpdateRequest' + parameters: + - name: polAssoId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Updated policies are returned + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyUpdate' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-am-policy-control: Access to the Npcf_AMPolicyControl API + schemas: + PolicyAssociation: + description: Represents an individual AM Policy Association resource. + type: object + properties: + request: + $ref: '#/components/schemas/PolicyAssociationRequest' + triggers: + type: array + items: + $ref: '#/components/schemas/RequestTrigger' + minItems: 1 + description: Request Triggers that the PCF subscribes. + servAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + wlServAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + rfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + targetRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + smfSelInfo: + $ref: '#/components/schemas/SmfSelectionData' + ueAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + ueSliceMbrs: + type: array + items: + $ref: '#/components/schemas/UeSliceMbr' + minProperties: 1 + description: > + One or more UE-Slice-MBR(s) for S-NSSAI(s) of serving PLMN as part of the AMF Access and + Mobility Policy as determined by the PCF. + pras: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains the presence reporting area(s) for which reporting was requested. + The praId attribute within the PresenceInfo data type is the key of the map. + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pcfUeInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + matchPdus: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionInfo' + nullable: true + asTimeDisParam: + $ref: '#/components/schemas/AsTimeDistributionParam' + required: + - suppFeat + PolicyAssociationRequest: + description: > + Information which the NF service consumer provides when requesting the creation of a policy + association. The serviveName property corresponds to the serviceName in the main body + of the specification. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altNotifIpv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + description: Alternate or backup IPv4 Address(es) where to send Notifications. + altNotifIpv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + description: Alternate or backup IPv6 Address(es) where to send Notifications. + altNotifFqdns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + description: Alternate or backup FQDN(s) where to send Notifications. + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + accessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + userLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + servingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ratTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + groupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + servAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + wlServAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + rfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + ueAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + ueSliceMbrs: + type: array + items: + $ref: '#/components/schemas/UeSliceMbr' + minProperties: 1 + description: > + The subscribed UE Slice-MBR for each subscribed S-NSSAI of the home PLMN mapping to + a S-NSSAI of the serving PLMN Shall be provided when available. + allowedSnssais: + description: array of allowed S-NSSAIs for the 3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + targetSnssais: + description: array of target S-NSSAIs. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + mappingSnssais: + description: > + mapping of each S-NSSAI of the Allowed NSSAI to the corresponding S-NSSAI of the HPLMN. + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/MappingOfSnssai' + minItems: 1 + n3gAllowedSnssais: + description: array of allowed S-NSSAIs for the Non-3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' +# serviveName: + serviceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + nwdafDatas: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/NwdafData' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - notificationUri + - suppFeat + - supi + PolicyAssociationUpdateRequest: + description: > + Represents information that the NF service consumer provides when requesting the update of + a policy association. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altNotifIpv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + description: Alternate or backup IPv4 Address(es) where to send Notifications. + altNotifIpv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + description: Alternate or backup IPv6 Address(es) where to send Notifications. + altNotifFqdns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + description: Alternate or backup FQDN(s) where to send Notifications. + triggers: + type: array + items: + $ref: '#/components/schemas/RequestTrigger' + minItems: 1 + description: Request Triggers that the NF service consumer observes. + servAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + wlServAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + rfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + smfSelInfo: + $ref: '#/components/schemas/SmfSelectionData' + ueAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + ueSliceMbrs: + type: array + items: + $ref: '#/components/schemas/UeSliceMbr' + minProperties: 1 + description: > + The subscribed UE-Slice-MBR for each subscribed S-NSSAI of the home PLMN mapping + to a S-NSSAI of the serving PLMN Shall be provided for the "UE_SLICE_MBR_CH" + policy control request trigger. + praStatuses: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains the UE presence status for tracking area for which changes of the UE presence + occurred. The praId attribute within the PresenceInfo data type is the key of the map. + userLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + allowedSnssais: + description: array of allowed S-NSSAIs for the 3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + targetSnssais: + description: array of target S-NSSAIs. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + mappingSnssais: + description: > + mapping of each S-NSSAI of the Allowed NSSAI to the corresponding S-NSSAI of the HPLMN. + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/MappingOfSnssai' + minItems: 1 + accessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + ratTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + n3gAllowedSnssais: + description: array of allowed S-NSSAIs for the Non-3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + nwdafDatas: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/NwdafData' + minItems: 1 + nullable: true + PolicyUpdate: + description: > + Represents updated policies that the PCF provides in a notification or in a reply to an + Update Request. + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + triggers: + type: array + items: + $ref: '#/components/schemas/RequestTrigger' + minItems: 1 + nullable: true + description: Request Triggers that the PCF subscribes. + servAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + wlServAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + rfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + targetRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + smfSelInfo: + $ref: '#/components/schemas/SmfSelectionData' + ueAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + ueSliceMbrs: + type: array + items: + $ref: '#/components/schemas/UeSliceMbr' + minProperties: 1 + description: > + One or more UE-Slice-MBR(s) for S-NSSAI(s) of serving PLMN the allowed NSSAI as + part of the AMF Access and Mobility Policy as determined by the PCF. + pras: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfoRm' + description: > + Contains the presence reporting area(s) for which reporting was requested. The praId + attribute within the PresenceInfo data type is the key of the map. + minProperties: 1 + nullable: true + pcfUeInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + matchPdus: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionInfo' + nullable: true + asTimeDisParam: + $ref: '#/components/schemas/AsTimeDistributionParam' + required: + - resourceUri + TerminationNotification: + description: > + Represents a request to terminate a policy Association that the PCF provides in a + notification. + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + cause: + $ref: '#/components/schemas/PolicyAssociationReleaseCause' + required: + - resourceUri + - cause + SmfSelectionData: + description: Represents the SMF Selection information that may be replaced by the PCF. + type: object + properties: + unsuppDnn: + type: boolean + candidates: + type: object + additionalProperties: + $ref: '#/components/schemas/CandidateForReplacement' + minProperties: 1 + description: > + Contains the list of DNNs per S-NSSAI that are candidates for replacement. The snssai + attribute within the CandidateForReplacement data type is the key of the map. + nullable: true + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + mappingSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + nullable: true + CandidateForReplacement: + description: Represents a list of candidate DNNs for replacement for an S-NSSAI. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + nullable: true + required: + - snssai + nullable: true + AmRequestedValueRep: + description: > + Represents the current applicable values corresponding to the policy control request + triggers. + type: object + properties: + userLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + praStatuses: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains the UE presence statuses for tracking areas. The praId attribute within the + PresenceInfo data type is the key of the map. + accessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + ratTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + allowedSnssais: + description: array of allowed S-NSSAIs for the 3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + n3gAllowedSnssais: + description: array of allowed S-NSSAIs for the Non-3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + AsTimeDistributionParam: + description: Contains the 5G acess stratum time distribution parameters. + type: object + properties: + asTimeDistInd: + type: boolean + uuErrorBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + nullable: true + UeSliceMbr: + description: Contains a UE-Slice-MBR and the related information. + type: object + properties: + sliceMbr: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbr' + minProperties: 1 + description: Contains the MBR for uplink and the MBR for downlink. + servingSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + mappedHomeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - sliceMbr + - servingSnssai + nullable: true + + RequestTrigger: +# anyOf: +# - type: string + enum: + - LOC_CH + - PRA_CH + - SERV_AREA_CH + - RFSP_CH + - ALLOWED_NSSAI_CH + - UE_AMBR_CH + - UE_SLICE_MBR_CH + - SMF_SELECT_CH + - ACCESS_TYPE_CH + - NWDAF_DATA_CH + - TARGET_NSSAI +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are: +# - LOC_CH: Location change (tracking area). The tracking area of the UE has changed. +# - PRA_CH: Change of UE presence in PRA. The AMF reports the current presence status +# of the UE in a Presence Reporting Area, and notifies that the UE enters/leaves the +# Presence Reporting Area. +# - SERV_AREA_CH: Service Area Restriction change. The UDM notifies the AMF that the +# subscribed service area restriction information has changed. +# - RFSP_CH: RFSP index change. The UDM notifies the AMF that the subscribed RFSP index has +# changed. +# - ALLOWED_NSSAI_CH: Allowed NSSAI change. The AMF notifies that the set of UE allowed +# S-NSSAIs has changed. +# - UE_AMBR_CH: UE-AMBR change. The UDM notifies the AMF that the subscribed UE-AMBR has +# changed. +# - SMF_SELECT_CH: SMF selection information change. The UE requested for an unsupported +# DNN or UE requested for a DNN within the list of DNN candidates for replacement per +# S-NSSAI. +# - ACCESS_TYPE_CH: Access Type change. The AMF notifies that the access type and the RAT +# type combinations available in the AMF for a UE with simultaneous 3GPP and non-3GPP +# connectivity has changed. +# - UE_SLICE_MBR_CH: UE-Slice-MBR change. The NF service consumer notifies any changes +# in the subscribed UE-Slice-MBR for each subscribed S-NSSAI of the home PLMN mapping +# to a S-NSSAI of the serving PLMN. +# - NWDAF_DATA_CH: NDWAF DATA CHANGE. The AMF notifies that the NWDAF instance IDs used +# for the UE and/or associated Analytics IDs used for the UE and available in the AMF +# have changed. +# - TARGET_NSSAI: Generation of Target NSSAI. The NF service consumer notifies that the +# Target NSSAI was generated. + PolicyAssociationReleaseCause: +# anyOf: +# - type: string + enum: + - UNSPECIFIED + - UE_SUBSCRIPTION + - INSUFFICIENT_RES +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are: +# - UNSPECIFIED: This value is used for unspecified reasons. +# - UE_SUBSCRIPTION: This value is used to indicate that the session needs to be +# terminated because the subscription of UE has changed (e.g. was removed). +# - INSUFFICIENT_RES: This value is used to indicate that the server is overloaded and +# needs to abort the session. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29508_Nsmf_EventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29508_Nsmf_EventExposure.yaml new file mode 100644 index 000000000..51a057cce --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29508_Nsmf_EventExposure.yaml @@ -0,0 +1,580 @@ +openapi: 3.0.0 +info: + version: 1.1.3 + title: Nsmf_EventExposure + description: | + Session Management Event Exposure Service. + © 2021, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.508 V16.10.0; 5G System; Session Management Event Exposure Service. + url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.508/ +servers: + - url: '{apiRoot}/nsmf-event-exposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nsmf-event-exposure +paths: + /subscriptions: + post: + operationId: CreateIndividualSubcription + summary: Create an individual subscription for event notifications from the SMF + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + responses: + '201': + description: Created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmf-event-exposure/v1/subscriptions/{subId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposureNotification' + responses: + '204': + description: No Content, Notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + afAcknowledgement: + '{request.body#/ackUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AckOfNotify' + responses: + '204': + description: No Content (successful acknowledgement) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subId}: + get: + operationId: GetIndividualSubcription + summary: Read an individual subscription for event notifications from the SMF + tags: + - IndividualSubscription (Document) + parameters: + - name: subId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + operationId: ReplaceIndividualSubcription + summary: Replace an individual subscription for event notifications from the SMF + tags: + - IndividualSubscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + parameters: + - name: subId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was successfully modified and representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + '204': + description: No Content. Resource was successfully modified + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + operationId: DeleteIndividualSubcription + summary: Delete an individual subscription for event notifications from the SMF + tags: + - IndividualSubscription (Document) + parameters: + - name: subId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was successfully deleted + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nsmf-event-exposure: Access to the Nsmf_EventExposure API + schemas: + UpfInformation: + type: object + properties: + upfId: + type: string + upfAddr: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + NsmfEventExposure: + description: Represents an Individual SMF Notification Subscription resource. The serviveName property corresponds to the serviceName in the main body of the specification. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + anyUeInd: + type: boolean + description: Any UE indication. This IE shall be present if the event subscription is applicable to any UE. Default value "false" is used, if not present. + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + pduSeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + subId: + $ref: '#/components/schemas/SubId' + notifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altNotifIpv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + description: Alternate or backup IPv4 address(es) where to send Notifications. + minItems: 1 + altNotifIpv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + description: Alternate or backup IPv6 address(es) where to send Notifications. + minItems: 1 + altNotifFqdns: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + minItems: 1 + description: Alternate or backup FQDN(s) where to send Notifications. + eventSubs: + type: array + items: + $ref: '#/components/schemas/EventSubscription' + minItems: 1 + description: Subscribed events + ImmeRep: + type: boolean + notifMethod: + $ref: '#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + serviveName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + sampRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + grpRepTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - notifId + - notifUri + - eventSubs + NsmfEventExposureNotification: + type: object + properties: + notifId: + type: string + description: Notification correlation ID + eventNotifs: + type: array + items: + $ref: '#/components/schemas/EventNotification' + minItems: 1 + description: Notifications about Individual Events + ackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - notifId + - eventNotifs + EventSubscription: + type: object + properties: + event: + $ref: '#/components/schemas/SmfEvent' + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + dddTraDescriptors: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + dddStati: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + required: + - event + EventNotification: + type: object + properties: + event: + $ref: '#/components/schemas/SmfEvent' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + sourceDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + sourceUeIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + sourceUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + targetUeIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + targetUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + sourceTraRouting: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + targetTraRouting: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + adIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + adIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + reIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + reIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + accType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + pduSeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dddStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + dddTraDescriptor: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + maxWaitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + commFailure: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CommunicationFailure' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + pduSessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ethfDescs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + fDescs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ulDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + dlDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + rtDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + required: + - event + - timeStamp + SubId: + type: string + format: SubId + description: Identifies an Individual SMF Notification Subscription. To enable that the value is used as part of a URI, the string shall only contain characters allowed according to the "lower-with-hyphen" naming convention defined in 3GPP TS 29.501. In an OpenAPI schema, the format shall be designated as "SubId". + AckOfNotify: + type: object + properties: + notifId: + type: string + ackResult: + $ref: 'TS29522_TrafficInfluence.yaml#/components/schemas/AfResultInfo' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + required: + - notifId + - ackResult + SmfEvent: + anyOf: + - type: string + enum: + - AC_TY_CH + - UP_PATH_CH + - PDU_SES_REL + - PLMN_CH + - UE_IP_CH + - DDDS + - COMM_FAIL + - PDU_SES_EST + - QFI_ALLOC + - QOS_MON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - AC_TY_CH: Access Type Change + - UP_PATH_CH: UP Path Change + - PDU_SES_REL: PDU Session Release + - PLMN_CH: PLMN Change + - UE_IP_CH: UE IP address change + - DDDS: Downlink data delivery status + - COMM_FAIL: Communication Failure + - PDU_SES_EST: PDU Session Establishment + - QFI_ALLOC: QFI allocation + - QOS_MON: QoS Monitoring + NotificationMethod: + anyOf: + - type: string + enum: + - PERIODIC + - ONE_TIME + - ON_EVENT_DETECTION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - PERIODIC + - ONE_TIME + - ON_EVENT_DETECTION diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_SoRProtection.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_SoRProtection.yaml new file mode 100644 index 000000000..ebcb6c81a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_SoRProtection.yaml @@ -0,0 +1,179 @@ +openapi: 3.0.0 + +info: + version: 1.2.0 + title: Nausf_SoRProtection Service + description: | + AUSF SoR Protection Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V17.6.0; 5G System; Authentication Server Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-sorprotection/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nausf-sorprotection + +paths: + /{supi}/ue-sor: + post: + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorInfo' + required: true + responses: + '200': + description: SorSecurityInfo + content: + application/json: + schema: + $ref: '#/components/schemas/SorSecurityInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-sorprotection: Access to the Nausf_SoRProtection API + schemas: + +# +# COMPLEX TYPES: +# + + SorInfo: + description: Contains the Steering Information. + type: object + properties: + steeringContainer: + $ref: '#/components/schemas/SteeringContainer' + ackInd: + $ref: '#/components/schemas/AckInd' + sorHeader: + $ref: '#/components/schemas/SorHeader' + sorTransparentInfo: + $ref: '#/components/schemas/SorTransparentInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ackInd + + SorSecurityInfo: + description: Contains the material generated for securing of SoR. It contains at least the SoR-MAC-IAUSF and CounterSoR. + type: object + properties: + sorMacIausf: + $ref: '#/components/schemas/SorMac' + counterSor: + $ref: '#/components/schemas/CounterSor' + sorXmacIue: + $ref: '#/components/schemas/SorMac' + required: + - sorMacIausf + - counterSor + + SteeringContainer: + description: Contains the information sent to UE. + oneOf: + - type: array + items: + $ref: '#/components/schemas/SteeringInfo' + minItems: 1 + - $ref: '#/components/schemas/SecuredPacket' + + SteeringInfo: + description: Contains a combination of one PLMN identity and zero or more access technologies. + type: object + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + accessTechList: + type: array + items: + $ref: '#/components/schemas/AccessTech' + minItems: 1 + required: + - plmnId + +# +# SIMPLE TYPES: +# + + SorMac: + description: MAC value for protecting SOR procedure (SoR-MAC-IAUSF and SoR-XMAC-IUE). + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + CounterSor: + description: CounterSoR. + type: string + pattern: '^[A-Fa-f0-9]{4}$' + + AckInd: + description: Contains indication whether the acknowledgement from UE is needed. + type: boolean + + SecuredPacket: + description: Contains a secure packet. + type: string + format: byte + + SorHeader: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + SorTransparentInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + +# +# ENUMS: + + AccessTech: + description: Represents the access technology + anyOf: + - type: string + enum: + - NR + - EUTRAN_IN_WBS1_MODE_AND_NBS1_MODE + - EUTRAN_IN_NBS1_MODE_ONLY + - EUTRAN_IN_WBS1_MODE_ONLY + - UTRAN + - GSM_AND_ECGSM_IoT + - GSM_WITHOUT_ECGSM_IoT + - ECGSM_IoT_ONLY + - CDMA_1xRTT + - CDMA_HRPD + - GSM_COMPACT + - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_UEAuthentication.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_UEAuthentication.yaml new file mode 100644 index 000000000..22270cc5e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_UEAuthentication.yaml @@ -0,0 +1,740 @@ +openapi: 3.0.0 +info: + version: 1.2.2 + title: AUSF API + description: | + AUSF UE Authentication Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V17.8.0; 5G System; 3GPP TS Authentication Server services. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-auth/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nausf-auth + +paths: + /ue-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfo' + required: true + responses: + '201': + description: UEAuthenticationCtx + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/UEAuthenticationCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/ue-authentications/{authCtxId}' + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request from the AMF + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden due to serving network not authorized + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: User does not exist in the HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '501': + description: Received protection scheme is not supported by HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /ue-authentications/deregister: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationInfo' + required: true + responses: + '204': + description: Expected response to a successful removal of security context + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + /ue-authentications/{authCtxId}/5g-aka-confirmation: + put: + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConfirmationData' + responses: + '200': + description: Request processed (EAP success or Failure) + content: + application/json: + schema: + $ref: '#/components/schemas/ConfirmationDataResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes the authentication result in the UDM + operationId: Delete5gAkaAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /ue-authentications/{authCtxId}/eap-session: + post: + operationId: EapAuthMethod + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EapSession' + responses: + '200': + description: Use to handle or close the EAP session + content: + application/json: + schema: + $ref: '#/components/schemas/EapSession' + + application/3gppHal+json: + schema: + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + _links: + type: object + description: 'URI : /{eapSessionUri}, a map(list of key-value pairs) where member serves as key' + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + required: + - eapPayload + - _links + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + delete: + summary: Deletes the authentication result in the UDM + operationId: DeleteEapAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /rg-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthenticationInfo' + required: true + responses: + '201': + description: RgAuthCtx + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/rg-authentications/{authCtxId}' + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + description: The UE is not allowed to be authenticated + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '400': + description: Bad Request from the AMF + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: User does not exist in the HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /prose-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationInfo' + required: true + responses: + '200': + description: Successful authentication with CP-PRUK ID + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationResult' + '201': + description: ProSeAuthenticationCtx + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/prose-authentications/{authCtxId}' + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + + /prose-authentications/{authCtxId}/prose-auth: + post: + operationId: proseAuth + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeEapSession' + responses: + '200': + description: Use to handle or close the EAP session for 5G ProSe Remote UE + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeEapSession' + application/3gppHal+json: + schema: + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + _links: + type: object + description: 'URI : /{eapSessionUri}, a map(list of key-value pairs) where member serves as key' + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + required: + - eapPayload + - _links + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + + delete: + summary: Deletes the authentication result in the UDM + operationId: DeleteProSeAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-auth: Access to Nausf_UEAuthentication API + + schemas: + AuthenticationInfo: + description: Contains the UE id (i.e. SUCI or SUPI) and the Serving Network Name. + type: object + properties: + supiOrSuci: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + servingNetworkName: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + resynchronizationInfo: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ResynchronizationInfo' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + pattern: '^[0-9]{1,4}$' + cellCagInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + minItems: 1 + n5gcInd: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nswoInd: + type: boolean + default: false + disasterRoamingInd: + type: boolean + default: false + onboardingInd: + type: boolean + default: false + required: + - supiOrSuci + - servingNetworkName + + UEAuthenticationCtx: + description: Contains the information related to the resource generated to handle the UE authentication. It contains at least the UE id, Serving Network, the Authentication Method and related EAP information or related 5G-AKA information. + type: object + properties: + authType: + $ref: '#/components/schemas/AuthType' + 5gAuthData: + oneOf: + - $ref: '#/components/schemas/Av5gAka' + - $ref: '#/components/schemas/EapPayload' + _links: + type: object + description: A map(list of key-value pairs) where member serves as key + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + servingNetworkName: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + required: + - authType + - 5gAuthData + - _links + + Av5gAka: + description: Contains Authentication Vector for method 5G AKA. + type: object + required: + - rand + - hxresStar + - autn + properties: + rand: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' + hxresStar: + $ref: '#/components/schemas/HxresStar' + autn: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Autn' + + ConfirmationData: + description: Contains the result of the authentication. + type: object + required: + - resStar + properties: + resStar: + $ref: '#/components/schemas/ResStar' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ConfirmationDataResponse: + description: Contains the result of the authentication + type: object + properties: + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + kseaf: + $ref: '#/components/schemas/Kseaf' + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + required: + - authResult + + EapSession: + description: Contains information related to the EAP session. + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + kSeaf: + $ref: '#/components/schemas/Kseaf' + _links: + type: object + description: A map(list of key-value pairs) where member serves as key + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + msk: + $ref: '#/components/schemas/Msk' + required: + - eapPayload + + DeregistrationInfo: + description: Contains the UE id (i.e. SUPI). + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supi + + RgAuthenticationInfo: + description: Contains the UE id (i.e. SUCI) and the authenticated indication. + type: object + properties: + suci: + $ref: '#/components/schemas/Suci' + authenticatedInd: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - suci + - authenticatedInd + + RgAuthCtx: + description: Contains the UE id (i.e. SUPI) and the authentication indication. + type: object + properties: + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + authInd: + type: boolean + default: false + required: + - authResult + + AuthResult: + description: Indicates the result of the authentication. + type: string + enum: + - AUTHENTICATION_SUCCESS + - AUTHENTICATION_FAILURE + - AUTHENTICATION_ONGOING + + EapPayload: + type: string + format: byte + description: contains an EAP packet + nullable: true + + Kseaf: + description: Contains the Kseaf. + type: string + pattern: '[A-Fa-f0-9]{64}' + + Msk: + description: Contains the Master Session Key. + type: string + pattern: '[A-Fa-f0-9]{128}' + + ResStar: + description: Contains the RES*. + type: string + pattern: '[A-Fa-f0-9]{32}' + nullable: true + + HxresStar: + description: Contains the HXRES*. + type: string + pattern: "[A-Fa-f0-9]{32}" + + Suci: + description: Contains the SUCI. + type: string + pattern: '^(suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.+|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$' + + AuthType: +# description: Indicates the authentication method used. +# anyOf: +# - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - EAP_TTLS +# - type: string + + ProSeAuthenticationInfo: + description: > + Contains the UE id (i.e. SUCI) or CP-PRUK ID (in 5gPrukId IE), Relay Service Code and Nonce_1. + type: object + properties: + supiOrSuci: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + 5gPrukId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GPrukId' + relayServiceCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RelayServiceCode' + nonce1: + $ref: '#/components/schemas/Nonce1' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - relayServiceCode + - nonce1 + + ProSeAuthenticationCtx: + description: Contains the information related to the resource generated to handle the ProSe authentication. + type: object + properties: + authType: + $ref: '#/components/schemas/AuthType' + _links: + type: object + description: A map(list of key-value pairs) where member serves as key + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + proSeAuthData: + $ref: '#/components/schemas/ProSeAuthData' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - authType + - _links + - proSeAuthData + + ProSeEapSession: + description: Contains information related to the EAP session. If present the 5gPrukId IE shall carry the CP-PRUK ID. + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + knrProSe: + $ref: '#/components/schemas/KnrProSe' + _links: + type: object + description: A map(list of key-value pairs) where member serves as key + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + authResult: + $ref: '#/components/schemas/AuthResult' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nonce2: + $ref: '#/components/schemas/Nonce2' + 5gPrukId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GPrukId' + required: + - eapPayload + + ProSeAuthData: + oneOf: + - $ref: '#/components/schemas/EapPayload' + + ProSeAuthenticationResult: + description: Successful authentication for CP-PRUK ID. + type: object + properties: + knrProSe: + $ref: '#/components/schemas/KnrProSe' + nonce2: + $ref: '#/components/schemas/Nonce2' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + KnrProSe: + description: Contains the KNR_ProSe. + type: string + pattern: '[A-Fa-f0-9]{64}' + Nonce1: + type: string + format: byte + description: contains an Nonce1 + nullable: true + + Nonce2: + type: string + format: byte + description: contains an Nonce2 + nullable: true + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_UPUProtection.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_UPUProtection.yaml new file mode 100644 index 000000000..cf21522fc --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29509_Nausf_UPUProtection.yaml @@ -0,0 +1,150 @@ +openapi: 3.0.0 +info: + version: 1.2.0 + title: Nausf_UPUProtection Service + description: | + AUSF UPU Protection Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V17.6.0; 5G System; Authentication Server Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-upuprotection/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nausf-upuprotection + +paths: + /{supi}/ue-upu: + post: + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpuInfo' + required: true + responses: + '200': + description: UpuSecurityInfo + content: + application/json: + schema: + $ref: '#/components/schemas/UpuSecurityInfo' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-upuprotection: Access to the Nausf_UPUProtection API + + schemas: + +# +# COMPLEX TYPES: +# + + UpuInfo: + description: Contains the UE parameters update Information. + type: object + properties: + upuDataList: + type: array + items: + $ref: '#/components/schemas/UpuData' + minItems: 1 + upuHeader: + $ref: '#/components/schemas/UpuHeader' + upuAckInd: + $ref: '#/components/schemas/UpuAckInd' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + upuTransparentInfo: + $ref: '#/components/schemas/UpuTransparentInfo' + required: + - upuDataList + - upuAckInd + + UpuSecurityInfo: + description: Contains the material generated for securing of UPU. It contains at least the UPU-MAC-IAUSF and CounterUPU. + type: object + properties: + upuMacIausf: + $ref: '#/components/schemas/UpuMac' + counterUpu: + $ref: '#/components/schemas/CounterUpu' + upuXmacIue: + $ref: '#/components/schemas/UpuMac' + required: + - upuMacIausf + - counterUpu + + UpuData: + description: Contains UE parameters update data set (e.g., the updated Routing ID Data or the Default configured NSSAI). + type: object + properties: + secPacket: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SecuredPacket' + defaultConfNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + routingId: + $ref: 'TS29544_Nspaf_SecuredPacket.yaml#/components/schemas/RoutingId' + +# +# SIMPLE TYPES: +# + + UpuMac: + description: MAC value for protecting UPU procedure (UPU-MAC-IAUSF and UPU-MAC-IUE). + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + CounterUpu: + description: CounterUPU. + type: string + pattern: '^[A-Fa-f0-9]{4}$' + + UpuAckInd: + description: Contains the indication of whether the acknowledgement from UE is needed. + type: boolean + + UpuHeader: + description: Contains the "UPU Header" IE as specified in clause 9.11.3.53A of 3GPP TS 24.501 (octet 4), encoded as 2 hexadecimal characters. + type: string + pattern: '^[A-Fa-f0-9]{2}$' + + UpuTransparentInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_AccessToken.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_AccessToken.yaml new file mode 100644 index 000000000..331118b9e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_AccessToken.yaml @@ -0,0 +1,309 @@ +openapi: 3.0.0 + +info: + version: '1.2.1' + title: 'NRF OAuth2' + description: | + NRF OAuth2 Authorization. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V17.7.0; 5G System; Network Function Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +paths: + /oauth2/token: + post: + summary: Access Token Request + operationId: AccessTokenRequest + tags: + - Access Token Request + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/AccessTokenReq' + encoding: + requesterPlmn: + contentType: application/json + requesterPlmnList: + contentType: application/json + requesterSnssaiList: + contentType: application/json + requesterSnpnList: + contentType: application/json + targetPlmn: + contentType: application/json + targetSnpn: + contentType: application/json + targetSnssaiList: + contentType: application/json + targetNsiList: + style: form + explode: true + required: true + responses: + '200': + description: Successful Access Token Request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenRsp' + headers: + Cache-Control: + $ref: '#/components/headers/cache-control' + Pragma: + $ref: '#/components/headers/pragma' + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + description: Error in the Access Token Request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenErr' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Cache-Control: + $ref: '#/components/headers/cache-control' + Pragma: + $ref: '#/components/headers/pragma' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + headers: + cache-control: + required: true + schema: + type: string + enum: + - no-store + pragma: + required: true + schema: + type: string + enum: + - no-cache + + schemas: + AccessTokenReq: + description: Contains information related to the access token request + type: object + required: + - grant_type + - nfInstanceId + - scope + properties: + grant_type: + type: string + enum: + - client_credentials + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + targetNfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + scope: + type: string + pattern: '^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$' + targetNfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + requesterPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + requesterPlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 2 + requesterSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + requesterFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + requesterSnpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + targetPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + targetSnpn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + targetSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + targetNsiList: + type: array + items: + type: string + minItems: 1 + targetNfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + targetNfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + hnrfAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + sourceNfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + AccessTokenRsp: + description: Contains information related to the access token response + type: object + required: + - access_token + - token_type + properties: + access_token: + type: string + description: > + JWS Compact Serialized representation of JWS signed JSON object (AccessTokenClaims) + token_type: + type: string + enum: + - Bearer + expires_in: + type: integer + scope: + type: string + pattern: '^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$' + + AccessTokenClaims: + description: The claims data structure for the access token + type: object + required: + - iss + - sub + - aud + - scope + - exp + properties: + iss: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + sub: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + aud: + anyOf: + - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + scope: + type: string + pattern: '^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$' + exp: + type: integer + consumerPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + consumerSnpnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + producerPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + producerSnpnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + producerSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + producerNsiList: + type: array + items: + type: string + minItems: 1 + producerNfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + producerNfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + sourceNfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + AccessTokenErr: + description: Error returned in the access token response message + type: object + required: + - error + properties: + error: + type: string + enum: + - invalid_request + - invalid_client + - invalid_grant + - unauthorized_client + - unsupported_grant_type + - invalid_scope + error_description: + type: string + error_uri: + type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_Bootstrapping.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_Bootstrapping.yaml new file mode 100644 index 000000000..5499511e9 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_Bootstrapping.yaml @@ -0,0 +1,122 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'NRF Bootstrapping' + description: | + NRF Bootstrapping. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V17.6.0; 5G System; Network Function Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +paths: + /bootstrapping: + get: + summary: Bootstrapping Info Request + operationId: BootstrappingInfoRequest + tags: + - Bootstrapping Request + parameters: + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 + schema: + type: string + responses: + '200': + description: Successful Bootstrapping Request + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/BootstrappingInfo' + headers: + Cache-Control: + description: Cache-Control containing max-age, described in IETF RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + BootstrappingInfo: + description: Information returned by NRF in the bootstrapping response message + type: object + required: + - _links + properties: + status: + $ref: '#/components/schemas/Status' + _links: + type: object + description: > + Map of link objects where the keys are the link relations defined in + 3GPP TS 29.510 clause 6.4.6.3.3 + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + nrfFeatures: + type: object + description: > + Map of features supported by the NRF, where the keys are the NRF services + as defined in 3GPP TS 29.510 clause 6.1.6.3.11 + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + minProperties: 1 + oauth2Required: + type: object + description: > + Map indicating whether the NRF requires Oauth2-based authorization for accessing + its services. The key of the map shall be the name of an NRF service, + e.g. "nnrf-nfm" or "nnrf-disc" + additionalProperties: + type: boolean + minProperties: 1 + nrfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nrfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + Status: + description: Overal status of the NRF + anyOf: + - type: string + enum: + - OPERATIVE + - NON_OPERATIVE + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_NFDiscovery.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_NFDiscovery.yaml new file mode 100644 index 000000000..f890e6403 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_NFDiscovery.yaml @@ -0,0 +1,2055 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'NRF NFDiscovery Service' + description: | + NRF NFDiscovery Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V17.8.0; 5G System; Network Function Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +servers: + - url: '{apiRoot}/nnrf-disc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - nnrf-disc + +paths: + /nf-instances: + get: + summary: Search a collection of NF Instances + operationId: SearchNFInstances + tags: + - NF Instances (Store) + parameters: + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: target-nf-type + in: query + description: Type of the target NF + required: true + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - name: requester-nf-type + in: query + description: Type of the requester NF + required: true + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - name: preferred-collocated-nf-types + in: query + description: collocated NF types that candidate NFs should preferentially support + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/CollocatedNfType' + minItems: 1 + style: form + explode: false + - name: requester-nf-instance-id + in: query + description: NfInstanceId of the requester NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: service-names + in: query + description: Names of the services offered by the NF + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + minItems: 1 + uniqueItems: true + style: form + explode: false + - name: requester-nf-instance-fqdn + in: query + description: FQDN of the requester NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: target-plmn-list + in: query + description: > + Id of the PLMN of either the target NF, or in SNPN scenario the Credentials Holder + in the PLMN + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + - name: requester-plmn-list + in: query + description: Id of the PLMN where the NF issuing the Discovery request is located + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + - name: target-nf-instance-id + in: query + description: Identity of the NF instance being discovered + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: target-nf-fqdn + in: query + description: FQDN of the NF instance being discovered + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: hnrf-uri + in: query + description: Uri of the home NRF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + - name: snssais + in: query + description: Slice info of the target NF + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: requester-snssais + in: query + description: Slice info of the requester NF + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + - name: plmn-specific-snssai-list + in: query + description: PLMN specific Slice info of the target NF + content: + application/json: + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + - name: requester-plmn-specific-snssai-list + in: query + description: PLMN-specific slice info of the NF issuing the Discovery request + content: + application/json: + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + - name: dnn + in: query + description: Dnn supported by the BSF, SMF or UPF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: ipv4-index + in: query + description: The IPv4 Index supported by the candidate UPF. + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpIndex' + - name: ipv6-index + in: query + description: The IPv6 Index supported by the candidate UPF. + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpIndex' + - name: nsi-list + in: query + description: NSI IDs that are served by the services being discovered + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: smf-serving-area + in: query + schema: + type: string + - name: mbsmf-serving-area + in: query + schema: + type: string + - name: tai + in: query + description: Tracking Area Identity + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + - name: amf-region-id + in: query + description: AMF Region Identity + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' + - name: amf-set-id + in: query + description: AMF Set Identity + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfSetId' + - name: guami + in: query + description: Guami used to search for an appropriate AMF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + - name: supi + in: query + description: SUPI of the user + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: ue-ipv4-address + in: query + description: IPv4 address of the UE + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ip-domain + in: query + description: IP domain of the UE, which supported by BSF + schema: + type: string + - name: ue-ipv6-prefix + in: query + description: IPv6 prefix of the UE + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: pgw-ind + in: query + description: Combined PGW-C and SMF or a standalone SMF + schema: + type: boolean + - name: preferred-pgw-ind + in: query + description: Indicates combined PGW-C+SMF or standalone SMF are preferred + schema: + type: boolean + - name: pgw + in: query + description: PGW FQDN of a combined PGW-C and SMF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: pgw-ip + in: query + description: PGW IP Address of a combined PGW-C and SMF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + - name: gpsi + in: query + description: GPSI of the user + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: external-group-identity + in: query + description: external group identifier of the user + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: internal-group-identity + in: query + description: internal group identifier of the user + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: pfd-data + in: query + description: PFD data + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PfdData' + - name: data-set + in: query + description: data set supported by the NF + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DataSetId' + - name: routing-indicator + in: query + description: routing indicator in SUCI + schema: + type: string + pattern: '^[0-9]{1,4}$' + - name: group-id-list + in: query + description: Group IDs of the NFs being discovered + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + minItems: 1 + style: form + explode: false + - name: dnai-list + in: query + description: Data network access identifiers of the NFs being discovered + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + style: form + explode: false + - name: pdu-session-types + in: query + description: list of PDU Session Type required to be supported by the target NF + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + style: form + explode: false + - name: event-id-list + in: query + description: > + Analytics event(s) requested to be supported by the Nnwdaf_AnalyticsInfo service + schema: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + minItems: 1 + style: form + explode: false + - name: nwdaf-event-list + in: query + description: > + Analytics event(s) requested to be supported by the Nnwdaf_EventsSubscription service. + schema: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: upf-iwk-eps-ind + in: query + description: UPF supporting interworking with EPS or not + schema: + type: boolean + - name: chf-supported-plmn + in: query + description: PLMN ID supported by a CHF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: preferred-locality + in: query + description: preferred target NF location + schema: + type: string + - name: access-type + in: query + description: AccessType supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + - name: limit + in: query + description: Maximum number of NFProfiles to return in the response + required: false + schema: + type: integer + minimum: 1 + - name: required-features + in: query + description: Features required to be supported by the target NF + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + minItems: 1 + style: form + explode: false + - name: complex-query + in: query + description: the complex query condition expression + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ComplexQuery' + - name: max-payload-size + in: query + description: Maximum payload size of the response expressed in kilo octets + required: false + schema: + type: integer + maximum: 2000 + default: 124 + - name: max-payload-size-ext + in: query + description: > + Extended query for maximum payload size of the response expressed in kilo octets + required: false + schema: + type: integer + default: 124 + - name: atsss-capability + in: query + description: ATSSS Capability + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AtsssCapability' + - name: upf-ue-ip-addr-ind + in: query + description: UPF supporting allocating UE IP addresses/prefixes + schema: + type: boolean + - name: client-type + in: query + description: Requested client type served by the NF + content: + application/json: + schema: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + - name: lmf-id + in: query + description: LMF identification to be discovered + content: + application/json: + schema: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + - name: an-node-type + in: query + description: Requested AN node type served by the NF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AnNodeType' + - name: rat-type + in: query + description: Requested RAT type served by the NF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + - name: preferred-tai + in: query + description: preferred Tracking Area Identity + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + - name: preferred-nf-instances + in: query + description: preferred NF Instances + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + style: form + explode: false + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 + schema: + type: string + - name: target-snpn + in: query + description: Target SNPN Identity, or the Credentials Holder in the SNPN + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: requester-snpn-list + in: query + description: SNPN ID(s) of the NF instance issuing the Discovery request + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + - name: af-ee-data + in: query + description: NEF exposured by the AF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AfEventExposureData' + - name: w-agf-info + in: query + description: UPF collocated with W-AGF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/WAgfInfo' + - name: tngf-info + in: query + description: UPF collocated with TNGF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TngfInfo' + - name: twif-info + in: query + description: UPF collocated with TWIF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TwifInfo' + - name: target-nf-set-id + in: query + description: Target NF Set ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: target-nf-service-set-id + in: query + description: Target NF Service Set ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + - name: nef-id + in: query + description: NEF ID + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + - name: notification-type + in: query + description: Notification Type + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NotificationType' + - name: n1-msg-class + in: query + description: N1 Message Class + schema: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N1MessageClass' + - name: n2-info-class + in: query + description: N2 Information Class + schema: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InformationClass' + - name: serving-scope + in: query + description: areas that can be served by the target NF + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: imsi + in: query + description: IMSI of the requester UE to search for an appropriate NF (e.g. HSS) + schema: + type: string + pattern: '^[0-9]{5,15}$' + - name: ims-private-identity + in: query + description: IMPI of the requester UE to search for a target HSS + schema: + type: string + - name: ims-public-identity + in: query + description: IMS Public Identity of the requester UE to search for a target HSS + schema: + type: string + - name: msisdn + in: query + description: MSISDN of the requester UE to search for a target HSS + schema: + type: string + - name: preferred-api-versions + in: query + description: Preferred API version of the services to be discovered + content: + application/json: + schema: + description: A map (list of key-value pairs) where ServiceName serves as key + type: object + additionalProperties: + type: string + minProperties: 1 + - name: v2x-support-ind + in: query + description: PCF supports V2X + schema: + type: boolean + - name: redundant-gtpu + in: query + description: UPF supports redundant gtp-u to be discovered + schema: + type: boolean + - name: redundant-transport + in: query + description: UPF supports redundant transport path to be discovered + schema: + type: boolean + - name: ipups + in: query + description: UPF which is configured for IPUPS functionality to be discovered + schema: + type: boolean + - name: scp-domain-list + in: query + description: SCP domains the target SCP or SEPP belongs to + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: address-domain + in: query + description: Address domain reachable through the SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: ipv4-addr + in: query + description: IPv4 address reachable through the SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ipv6-prefix + in: query + description: IPv6 prefix reachable through the SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: served-nf-set-id + in: query + description: NF Set ID served by the SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: remote-plmn-id + in: query + description: Id of the PLMN reachable through the SCP or SEPP + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: remote-snpn-id + in: query + description: Id of the SNPN reachable through the SCP or SEPP + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: data-forwarding + in: query + description: UPF Instance(s) configured for data forwarding are requested + schema: + type: boolean + - name: preferred-full-plmn + in: query + description: NF Instance(s) serving the full PLMN are preferred + schema: + type: boolean + - name: requester-features + in: query + description: > + Features supported by the NF Service Consumer that is invoking + the Nnrf_NFDiscovery service + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: realm-id + in: query + description: realm-id to search for an appropriate UDSF + schema: + type: string + - name: storage-id + in: query + description: storage-id to search for an appropriate UDSF + schema: + type: string + - name: vsmf-support-ind + in: query + description: V-SMF capability supported by the target NF instance(s) + schema: + type: boolean + - name: ismf-support-ind + in: query + description: I-SMF capability supported by the target NF instance(s) + schema: + type: boolean + - name: nrf-disc-uri + in: query + description: Uri of the NRF holding the NF profile of a target NF Instance + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + - name: preferred-vendor-specific-features + in: query + description: Preferred vendor specific features of the services to be discovered + content: + application/json: + schema: + description: A map (list of key-value pairs) where ServiceName serves as key + type: object + additionalProperties: + description: > + A map (list of key-value pairs) where IANA-assigned SMI Network Management + Private Enterprise Codes serves as key + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + minProperties: 1 + - name: preferred-vendor-specific-nf-features + in: query + description: Preferred vendor specific features of the network function to be discovered + content: + application/json: + schema: + description: > + A map (list of key-value pairs) where IANA-assigned SMI Network Management Private + Enterprise Codes serves as key + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + - name: required-pfcp-features + in: query + description: PFCP features required to be supported by the target UPF + schema: + type: string + - name: home-pub-key-id + in: query + description: > + Indicates the Home Network Public Key ID which shall be able to be served + by the NF instance + schema: + type: integer + - name: prose-support-ind + in: query + description: PCF supports ProSe Capability + schema: + type: boolean + - name: analytics-aggregation-ind + in: query + description: analytics aggregation is supported by NWDAF or not + schema: + type: boolean + - name: serving-nf-set-id + in: query + description: NF Set Id served by target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: serving-nf-type + in: query + description: NF type served by the target NF + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - name: ml-analytics-info-list + in: query + description: Lisf of ML Analytics Filter information of Nnwdaf_MLModelProvision service + content: + application/json: + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MlAnalyticsInfo' + minItems: 1 + - name: analytics-metadata-prov-ind + in: query + description: analytics matadata provisioning is supported by NWDAF or not + schema: + type: boolean + - name: nsacf-capability + in: query + description: the service capability supported by the target NSACF + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NsacfCapability' + - name: mbs-session-id-list + in: query + description: List of MBS Session ID(s) + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + minItems: 1 + - name: area-session-id + in: query + description: Area Session ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AreaSessionId' + - name: gmlc-number + in: query + description: The GMLC Number supported by the GMLC + schema: + type: string + pattern: '^[0-9]{5,15}$' + - name: upf-n6-ip + in: query + description: N6 IP address of PSA UPF supported by the EASDF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + - name: tai-list + in: query + description: Tracking Area Identifiers of the NFs being discovered + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + - name: preferences-precedence + in: query + description: > + Indicates the precedence of the preference query parameters (from higher to lower) + schema: + type: array + items: + type: string + minItems: 2 + style: form + explode: false + - name: support-onboarding-capability + in: query + description: Indicating the support for onboarding. + schema: + type: boolean + default: false + - name: uas-nf-functionality-ind + in: query + description: UAS NF functionality is supported by NEF or not + schema: + type: boolean + - name: v2x-capability + in: query + description: indicates the V2X capability that the target PCF needs to support. + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/V2xCapability' + - name: prose-capability + in: query + description: indicates the ProSe capability that the target PCF needs to support. + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ProSeCapability' + - name: shared-data-id + in: query + description: Identifier of shared data stored in the NF being discovered + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedDataId' + - name: target-hni + in: query + description: Home Network Identifier query. + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: target-nw-resolution + in: query + description: Resolution of the identity of the target PLMN based on the GPSI of the UE + schema: + type: boolean + - name: exclude-nfinst-list + in: query + description: NF Instance IDs to be excluded from the NF Discovery procedure + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + style: form + explode: false + - name: exclude-nfservinst-list + in: query + description: NF service instance IDs to be excluded from the NF Discovery procedure + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NfServiceInstance' + minItems: 1 + - name: exclude-nfserviceset-list + in: query + description: NF Service Set IDs to be excluded from the NF Discovery procedure + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + style: form + explode: false + - name: exclude-nfset-list + in: query + description: NF Set IDs to be excluded from the NF Discovery procedure + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + style: form + explode: false + - name: preferred-analytics-delays + in: query + description: Preferred analytics delays supported by the NWDAF to be discovered + content: + application/json: + schema: + description: > + A map (list of key-value pairs) where EventId or NwdafEvent serves as key + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + minProperties: 1 + + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResult' + links: + search: + operationId: RetrieveStoredSearch + parameters: + searchId: $response.body#/searchId + description: > + The 'searchId' parameter returned in the response can be used as the + 'searchId' parameter in the GET request to '/searches/{searchId}' + completeSearch: + operationId: RetrieveCompleteSearch + parameters: + searchId: $response.body#/searchId + description: > + The 'searchId' parameter returned in the response can be used as the + 'searchId' parameter in the GET request to '/searches/{searchId}/complete' + headers: + Cache-Control: + description: Cache-Control containing max-age, described in IETF RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /searches/{searchId}: + get: + operationId: RetrieveStoredSearch + tags: + - Stored Search (Document) + parameters: + - $ref: '#/components/parameters/searchId' + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200' + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + + /searches/{searchId}/complete: + get: + operationId: RetrieveCompleteSearch + tags: + - Complete Stored Search (Document) + parameters: + - $ref: '#/components/parameters/searchId' + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200' + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + + /scp-domain-routing-info: + get: + operationId: SCPDomainRoutingInfoGet + tags: + - SCP Domain Routing Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-disc + - oAuth2ClientCredentials: + - nnrf-disc + - nnrf-disc:scp-domain:read + parameters: + - name: local + in: query + description: Indication of local SCP Domain Routing Information + required: false + schema: + type: boolean + default: false + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScpDomainRoutingInformation' + headers: + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + description: Temporary Redirect + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /scp-domain-routing-info-subs: + post: + summary: Create a new subscription + operationId: ScpDomainRoutingInfoSubscribe + tags: + - SCP Domain Routing Information Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-disc + - oAuth2ClientCredentials: + - nnrf-disc + - nnrf-disc:scp-domain-subs:write + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScpDomainRoutingInfoSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScpDomainRoutingInfoSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nnrf-disc/v1/scp-domain-routing-info-subs/{subscriptionID} + required: true + schema: + type: string + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + onScpDomainRoutingInformationChange: + '{$request.body#/callbackUri}': + post: + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: Notification Payload + content: + application/json: + schema: + $ref: '#/components/schemas/ScpDomainRoutingInfoNotification' + responses: + '204': + description: Expected response to a successful callback processing + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /scp-domain-routing-info-subs/{subscriptionID}: + delete: + summary: Deletes a subscription + operationId: ScpDomainRoutingInfoUnsubscribe + tags: + - Individual SCP Domain Routing Information Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-disc + - oAuth2ClientCredentials: + - nnrf-disc + - nnrf-disc:scp-domain-subs:write + parameters: + - name: subscriptionID + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '/oauth2/token' + scopes: + nnrf-disc: Access to the Nnrf_NFDiscovery API + nnrf-disc:scp-domain:read: Access to read the scp-domain-routing-info resource + nnrf-disc:scp-domain-subs:write: Access to create/delete a scp-domain subscription resource + + parameters: + searchId: + name: searchId + in: path + description: Id of a stored search + required: true + schema: + type: string + + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/StoredSearchResult' + headers: + Cache-Control: + description: Cache-Control containing max-age, described in IETF RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + + schemas: + + SearchResult: + description: Contains the list of NF Profiles returned in a Discovery response + type: object + required: + - nfInstances + properties: + validityPeriod: + type: integer + nfInstances: + type: array + items: + $ref: '#/components/schemas/NFProfile' + searchId: + type: string + numNfInstComplete: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + preferredSearch: + $ref: '#/components/schemas/PreferredSearch' + nrfSupportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nfInstanceList: + description: List of matching NF instances. The key of the map is the NF instance ID. + type: object + additionalProperties: + $ref: '#/components/schemas/NfInstanceInfo' + minProperties: 1 + alteredPriorityInd: + type: boolean + noProfileMatchInfo: + $ref: '#/components/schemas/NoProfileMatchInfo' + + StoredSearchResult: + description: > + Contains a complete search result (i.e. a number of discovered NF Instances), + stored by NRF as a consequence of a prior search result + type: object + required: + - nfInstances + properties: + nfInstances: + type: array + items: + $ref: '#/components/schemas/NFProfile' + + NFProfile: + description: Information of an NF Instance discovered by the NRF + type: object + required: + - nfInstanceId + - nfType + - nfStatus + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfInstanceName: + type: string + nfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + nfStatus: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFStatus' + collocatedNfInstances: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/CollocatedNfInstance' + minimum: 1 + plmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + nsiList: + type: array + items: + type: string + minItems: 1 + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + interPlmnFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + ipv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + capacity: + type: integer + minimum: 0 + maximum: 65535 + load: + type: integer + minimum: 0 + maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locality: + type: string + priority: + type: integer + minimum: 0 + maximum: 65535 + udrInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdrInfo' + udrInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdrInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdrInfo' + minProperties: 1 + udmInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdmInfo' + udmInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdmInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdmInfo' + minProperties: 1 + ausfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AusfInfo' + ausfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AusfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AusfInfo' + minProperties: 1 + amfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AmfInfo' + amfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AmfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AmfInfo' + minProperties: 1 + smfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SmfInfo' + smfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of SmfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SmfInfo' + minProperties: 1 + upfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UpfInfo' + upfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UpfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UpfInfo' + minProperties: 1 + pcfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PcfInfo' + pcfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of PcfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PcfInfo' + minProperties: 1 + bsfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/BsfInfo' + bsfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of BsfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/BsfInfo' + minProperties: 1 + chfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ChfInfo' + chfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of ChfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ChfInfo' + minProperties: 1 + udsfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdsfInfo' + udsfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdsfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdsfInfo' + minProperties: 1 + nwdafInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NwdafInfo' + nwdafInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of NwdafInfo + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NwdafInfo' + minProperties: 1 + nefInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefInfo' + pcscfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of PcscfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PcscfInfo' + minProperties: 1 + hssInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of HssInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/HssInfo' + minProperties: 1 + customInfo: + type: object + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nfServicePersistence: + type: boolean + default: false + nfServices: + deprecated: true + type: array + items: + $ref: '#/components/schemas/NFService' + minItems: 1 + nfServiceList: + description: > + A map (list of key-value pairs) where serviceInstanceId serves as key of NFService + type: object + additionalProperties: + $ref: '#/components/schemas/NFService' + minProperties: 1 + defaultNotificationSubscriptions: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DefaultNotificationSubscription' + lmfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/LmfInfo' + gmlcInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/GmlcInfo' + snpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + nfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + lcHSupportInd: + type: boolean + default: false + olcHSupportInd: + type: boolean + default: false + nfSetRecoveryTimeList: + description: A map (list of key-value pairs) where NfSetId serves as key of DateTime + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minProperties: 1 + serviceSetRecoveryTimeList: + description: > + A map (list of key-value pairs) where NfServiceSetId serves as key of DateTime + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minProperties: 1 + scpDomains: + type: array + items: + type: string + minItems: 1 + scpInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ScpInfo' + seppInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SeppInfo' + vendorId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + description: > + The key of the map is the IANA-assigned SMI Network Management Private Enterprise Codes + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + aanfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AanfInfo + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AanfInfo' + minProperties: 1 + mfafInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MfafInfo' + easdfInfoList: + type: object + description: > + A map(list of key-value pairs) where a (unique) valid JSON string + serves as key of EasdfInfo + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/EasdfInfo' + minProperties: 1 + dccfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DccfInfo' + nsacfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of NsacfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NsacfInfo' + minProperties: 1 + mbSmfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of MbSmfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MbSmfInfo' + minProperties: 1 + tsctsfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of TsctsfInfo + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TsctsfInfo' + minProperties: 1 + mbUpfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of MbUpfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MbUpfInfo' + minProperties: 1 + trustAfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TrustAfInfo' + nssaafInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NssaafInfo' + hniList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + iwmscInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IwmscInfo' + mnpfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MnpfInfo' + + NFService: + description: > + Information of a given NF Service Instance; it is part of the NFProfile + of an NF Instance discovered by the NRF + type: object + required: + - serviceInstanceId + - serviceName + - versions + - scheme + - nfServiceStatus + properties: + serviceInstanceId: + type: string + serviceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + versions: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFServiceVersion' + minItems: 1 + scheme: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriScheme' + nfServiceStatus: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFServiceStatus' + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + interPlmnFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + ipEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + apiPrefix: + type: string + defaultNotificationSubscriptions: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DefaultNotificationSubscription' + minItems: 1 + capacity: + type: integer + minimum: 0 + maximum: 65535 + load: + type: integer + minimum: 0 + maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + priority: + type: integer + minimum: 0 + maximum: 65535 + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nfServiceSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + vendorId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + description: > + The key of the map is the IANA-assigned SMI Network Management Private Enterprise Codes + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + oauth2Required: + type: boolean + allowedOperationsPerNfType: + description: A map (list of key-value pairs) where NF Type serves as key + type: object + additionalProperties: + type: array + items: + type: string + minItems: 1 + minProperties: 1 + allowedOperationsPerNfInstance: + description: A map (list of key-value pairs) where NF Instance Id serves as key + type: object + additionalProperties: + type: array + items: + type: string + minItems: 1 + minProperties: 1 + + PreferredSearch: + description: > + Contains information on whether the returned NFProfiles match the preferred query parameters + type: object + properties: + preferredTaiMatchInd: + type: boolean + default: false + preferredFullPlmnMatchInd: + type: boolean + default: false + preferredApiVersionsMatchInd: + type: boolean + otherApiVersionsInd: + type: boolean + preferredLocalityMatchInd: + type: boolean + default: false + otherLocalityInd: + type: boolean + default: false + preferredVendorSpecificFeaturesInd: + type: boolean + default: false + preferredCollocatedNfTypeInd: + type: boolean + default: false + preferredPgwMatchInd: + type: boolean + preferredAnalyticsDelaysInd: + type: boolean + + NfInstanceInfo: + description: Contains information on an NF profile matching a discovery request + type: object + properties: + nrfDiscApiUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + preferredSearch: + $ref: '#/components/schemas/PreferredSearch' + nrfAlteredPriorities: + description: > + The key of the map is the JSON Pointer of the priority IE in the NFProfile data type + that is altered by the NRF + type: object + additionalProperties: + type: integer + minimum: 0 + maximum: 65535 + minProperties: 1 + + ScpDomainRoutingInformation: + description: SCP Domain Routing Information + type: object + required: + - scpDomainList + properties: + scpDomainList: + description: | + This IE shall contain a map of SCP domain interconnection information, where + the key of the map is a SCP domain. The value of each entry shall be the + interconnectivity information of the the SCP domain indicated by the key. + An empty map indicates that there is no SCP domain currently registered in + the NRF. + type: object + additionalProperties: + $ref: '#/components/schemas/ScpDomainConnectivity' + + ScpDomainConnectivity: + description: SCP Domain Connectivity Information + type: object + required: + - connectedScpDomainList + properties: + connectedScpDomainList: + type: array + items: + type: string + + ScpDomainRoutingInfoSubscription: + description: SCP Domain Routing Information Subscription + type: object + required: + - callbackUri + properties: + callbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reqInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + localInd: + type: boolean + default: false + + ScpDomainRoutingInfoNotification: + description: SCP Domain Routing Information Notification + type: object + required: + - routingInfo + properties: + routingInfo: + $ref: '#/components/schemas/ScpDomainRoutingInformation' + localInd: + type: boolean + default: false + + NfServiceInstance: + description: NF service instance + type: object + oneOf: + - required: [ nfInstanceId ] + - required: [ nfServiceSetId ] + properties: + serviceInstanceId: + type: string + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + + NoProfileMatchInfo: + description: Provides the reason for not finding NF matching the search criteria + type: object + required: + - reason + properties: + reason: + $ref: '#/components/schemas/NoProfileMatchReason' + queryParamCombinationList: + type: array + items: + $ref: '#/components/schemas/QueryParamCombination' + minItems: 1 + + QueryParamCombination: + description: Contains a list of Query Parameters + type: object + required: + - queryParams + properties: + queryParams: + type: array + items: + $ref: '#/components/schemas/QueryParameter' + minItems: 1 + + QueryParameter: + description: Contains the name and value of a query parameter + type: object + required: + - name + - value + properties: + name: + type: string + value: + type: string + + NoProfileMatchReason: + description: No Profile Match Reason + anyOf: + - type: string + enum: + - REQUESTER_PLMN_NOT_ALLOWED + - TARGET_NF_SUSPENDED + - TARGET_NF_UNDISCOVERABLE + - QUERY_PARAMS_COMBINATION_NO_MATCH + - UNSPECIFIED + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_NFManagement.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_NFManagement.yaml new file mode 100644 index 000000000..ce1a85818 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29510_Nnrf_NFManagement.yaml @@ -0,0 +1,4577 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'NRF NFManagement Service' + description: | + NRF NFManagement Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V17.8.0; 5G System; Network Function Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +servers: + - url: '{apiRoot}/nnrf-nfm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - nnrf-nfm + +paths: + /nf-instances: + get: + summary: Retrieves a collection of NF Instances + operationId: GetNFInstances + tags: + - NF Instances (Store) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-nfm + - oAuth2ClientCredentials: + - nnrf-nfm + - nnrf-nfm:nf-instances:read + parameters: + - name: nf-type + in: query + description: Type of NF + required: false + schema: + $ref: '#/components/schemas/NFType' + - name: limit + in: query + description: How many items to return at one time + required: false + schema: + type: integer + minimum: 1 + - name: page-number + in: query + description: Page number where the response shall start + required: false + schema: + type: integer + minimum: 1 + - name: page-size + in: query + description: Maximum number of items in each returned page + schema: + type: integer + minimum: 1 + responses: + '200': + description: Expected response to a valid request + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/UriList' + headers: + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + options: + summary: Discover communication options supported by NRF for NF Instances + operationId: OptionsNFInstances + tags: + - NF Instances (Store) + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/OptionsResponse' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '204': + description: No Content + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /nf-instances/{nfInstanceID}: + get: + summary: Read the profile of a given NF Instance + operationId: GetNFInstance + tags: + - NF Instance ID (Document) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-nfm + - oAuth2ClientCredentials: + - nnrf-nfm + - nnrf-nfm:nf-instances:read + parameters: + - name: nfInstanceID + in: path + description: Unique ID of the NF Instance + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: requester-features + in: query + description: Features supported by the NF Service Consumer + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + headers: + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Register a new NF Instance + operationId: RegisterNFInstance + tags: + - NF Instance ID (Document) + parameters: + - name: nfInstanceID + in: path + required: true + description: Unique ID of the NF Instance to register + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + required: true + responses: + '200': + description: OK (Profile Replacement) + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nnrf-nfm/v1/nf-instances/{nfInstanceId} + required: true + schema: + type: string + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Update NF Instance profile + operationId: UpdateNFInstance + tags: + - NF Instance ID (Document) + parameters: + - name: nfInstanceID + in: path + required: true + description: Unique ID of the NF Instance to update + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: If-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '204': + description: Expected response with empty body + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '412': + $ref: 'TS29571_CommonData.yaml#/components/responses/412' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deregisters a given NF Instance + operationId: DeregisterNFInstance + tags: + - NF Instance ID (Document) + parameters: + - name: nfInstanceID + in: path + required: true + description: Unique ID of the NF Instance to deregister + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + responses: + '204': + description: Expected response to a successful deregistration + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions: + post: + summary: Create a new subscription + operationId: CreateSubscription + tags: + - Subscriptions (Collection) + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nnrf-nfm/v1/subscriptions/{subscriptionId} + required: true + schema: + type: string + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + onNFStatusEvent: + '{$request.body#/nfStatusNotificationUri}': + post: + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: Notification Payload + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationData' + responses: + '204': + description: Expected response to a successful callback processing + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: > + The URI pointing to the resource located on another NF service + consumer instance + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: > + The URI pointing to the resource located on another NF service + consumer instance + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions/{subscriptionID}: + patch: + summary: Updates a subscription + operationId: UpdateSubscription + tags: + - Subscription ID (Document) + parameters: + - name: subscriptionID + in: path + required: true + description: Unique ID of the subscription to update + schema: + type: string + pattern: '^([0-9]{5,6}-)?[^-]+$' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '204': + description: No Content + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes a subscription + operationId: RemoveSubscription + tags: + - Subscription ID (Document) + parameters: + - name: subscriptionID + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + pattern: '^([0-9]{5,6}-)?[^-]+$' + responses: + '204': + description: Expected response to a successful subscription removal + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '/oauth2/token' + scopes: + nnrf-nfm: Access to the Nnrf_NFManagement API + nnrf-nfm:nf-instances:read: > + Access to read the nf-instances resource, or an individual NF Instance ID resource + + schemas: + + NFProfile: + description: Information of an NF Instance registered in the NRF + type: object + required: + - nfInstanceId + - nfType + - nfStatus + anyOf: + - required: [ fqdn ] + - required: [ ipv4Addresses ] + - required: [ ipv6Addresses ] + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfInstanceName: + type: string + nfType: + $ref: '#/components/schemas/NFType' + nfStatus: + $ref: '#/components/schemas/NFStatus' + collocatedNfInstances: + type: array + items: + $ref: '#/components/schemas/CollocatedNfInstance' + minimum: 1 + heartBeatTimer: + type: integer + minimum: 1 + plmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + snpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: '#/components/schemas/PlmnSnssai' + minItems: 1 + nsiList: + type: array + items: + type: string + minItems: 1 + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + interPlmnFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + ipv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + allowedPlmns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + allowedSnpns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + allowedNfTypes: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + allowedNfDomains: + type: array + items: + type: string + minItems: 1 + allowedNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 + capacity: + type: integer + minimum: 0 + maximum: 65535 + load: + type: integer + minimum: 0 + maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locality: + type: string + udrInfo: + $ref: '#/components/schemas/UdrInfo' + udrInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdrInfo + type: object + additionalProperties: + $ref: '#/components/schemas/UdrInfo' + minProperties: 1 + udmInfo: + $ref: '#/components/schemas/UdmInfo' + udmInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdmInfo + type: object + additionalProperties: + $ref: '#/components/schemas/UdmInfo' + minProperties: 1 + ausfInfo: + $ref: '#/components/schemas/AusfInfo' + ausfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AusfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/AusfInfo' + minProperties: 1 + amfInfo: + $ref: '#/components/schemas/AmfInfo' + amfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AmfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/AmfInfo' + minProperties: 1 + smfInfo: + $ref: '#/components/schemas/SmfInfo' + smfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of SmfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/SmfInfo' + minProperties: 1 + upfInfo: + $ref: '#/components/schemas/UpfInfo' + upfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UpfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/UpfInfo' + minProperties: 1 + pcfInfo: + $ref: '#/components/schemas/PcfInfo' + pcfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of PcfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/PcfInfo' + minProperties: 1 + bsfInfo: + $ref: '#/components/schemas/BsfInfo' + bsfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of BsfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/BsfInfo' + minProperties: 1 + chfInfo: + $ref: '#/components/schemas/ChfInfo' + chfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of ChfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/ChfInfo' + minProperties: 1 + nefInfo: + $ref: '#/components/schemas/NefInfo' + nrfInfo: + $ref: '#/components/schemas/NrfInfo' + udsfInfo: + $ref: '#/components/schemas/UdsfInfo' + udsfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdsfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/UdsfInfo' + minProperties: 1 + nwdafInfo: + $ref: '#/components/schemas/NwdafInfo' + nwdafInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of NwdafInfo + additionalProperties: + $ref: '#/components/schemas/NwdafInfo' + minProperties: 1 + pcscfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of PcscfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/PcscfInfo' + minProperties: 1 + hssInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of HssInfo + type: object + additionalProperties: + $ref: '#/components/schemas/HssInfo' + minProperties: 1 + customInfo: + type: object + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nfServicePersistence: + type: boolean + default: false + nfServices: + deprecated: true + type: array + items: + $ref: '#/components/schemas/NFService' + minItems: 1 + nfServiceList: + description: > + A map (list of key-value pairs) where serviceInstanceId serves as key of NFService + type: object + additionalProperties: + $ref: '#/components/schemas/NFService' + minProperties: 1 + nfProfileChangesSupportInd: + type: boolean + default: false + writeOnly: true + nfProfileChangesInd: + type: boolean + default: false + readOnly: true + defaultNotificationSubscriptions: + type: array + items: + $ref: '#/components/schemas/DefaultNotificationSubscription' + lmfInfo: + $ref: '#/components/schemas/LmfInfo' + gmlcInfo: + $ref: '#/components/schemas/GmlcInfo' + nfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + lcHSupportInd: + type: boolean + default: false + olcHSupportInd: + type: boolean + default: false + nfSetRecoveryTimeList: + description: A map (list of key-value pairs) where NfSetId serves as key of DateTime + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minProperties: 1 + serviceSetRecoveryTimeList: + description: > + A map (list of key-value pairs) where NfServiceSetId serves as key of DateTime + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minProperties: 1 + scpDomains: + type: array + items: + type: string + minItems: 1 + scpInfo: + $ref: '#/components/schemas/ScpInfo' + seppInfo: + $ref: '#/components/schemas/SeppInfo' + vendorId: + $ref: '#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + description: > + The key of the map is the IANA-assigned SMI Network Management Private Enterprise Codes + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + aanfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AanfInfo + additionalProperties: + $ref: '#/components/schemas/AanfInfo' + minProperties: 1 + 5gDdnmfInfo: + $ref: '#/components/schemas/5GDdnmfInfo' + mfafInfo: + $ref: '#/components/schemas/MfafInfo' + easdfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of EasdfInfo + additionalProperties: + $ref: '#/components/schemas/EasdfInfo' + minProperties: 1 + dccfInfo: + $ref: '#/components/schemas/DccfInfo' + nsacfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of NsacfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/NsacfInfo' + minProperties: 1 + mbSmfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of MbSmfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/MbSmfInfo' + minProperties: 1 + tsctsfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of TsctsfInfo + additionalProperties: + $ref: '#/components/schemas/TsctsfInfo' + minProperties: 1 + mbUpfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of MbUpfInfo + additionalProperties: + $ref: '#/components/schemas/MbUpfInfo' + minProperties: 1 + trustAfInfo: + $ref: '#/components/schemas/TrustAfInfo' + nssaafInfo: + $ref: '#/components/schemas/NssaafInfo' + hniList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + iwmscInfo: + $ref: '#/components/schemas/IwmscInfo' + mnpfInfo: + $ref: '#/components/schemas/MnpfInfo' + + NFService: + description: > + Information of a given NF Service Instance; it is part of the NFProfile of an NF Instance + type: object + required: + - serviceInstanceId + - serviceName + - versions + - scheme + - nfServiceStatus + properties: + serviceInstanceId: + type: string + serviceName: + $ref: '#/components/schemas/ServiceName' + versions: + type: array + items: + $ref: '#/components/schemas/NFServiceVersion' + minItems: 1 + scheme: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriScheme' + nfServiceStatus: + $ref: '#/components/schemas/NFServiceStatus' + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + interPlmnFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + ipEndPoints: + type: array + items: + $ref: '#/components/schemas/IpEndPoint' + minItems: 1 + apiPrefix: + type: string + defaultNotificationSubscriptions: + type: array + items: + $ref: '#/components/schemas/DefaultNotificationSubscription' + minItems: 1 + allowedPlmns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + allowedSnpns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + allowedNfTypes: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + allowedNfDomains: + type: array + items: + type: string + minItems: 1 + allowedNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + allowedOperationsPerNfType: + description: A map (list of key-value pairs) where NF Type serves as key + type: object + additionalProperties: + type: array + items: + type: string + minItems: 1 + minProperties: 1 + allowedOperationsPerNfInstance: + description: A map (list of key-value pairs) where NF Instance Id serves as key + type: object + additionalProperties: + type: array + items: + type: string + minItems: 1 + minProperties: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 + capacity: + type: integer + minimum: 0 + maximum: 65535 + load: + type: integer + minimum: 0 + maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nfServiceSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: '#/components/schemas/PlmnSnssai' + minItems: 1 + vendorId: + $ref: '#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + description: > + A map (list of key-value pairs) where IANA-assigned SMI Network Management + Private Enterprise Codes serves as key + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + oauth2Required: + type: boolean + perPlmnOauth2ReqList: + $ref: '#/components/schemas/PlmnOauth2' + + NFType: +# description: NF types known to NRF +# anyOf: +# - type: string + enum: + - NRF + - UDM + - AMF + - SMF + - AUSF + - NEF + - PCF + - SMSF + - NSSF + - UDR + - LMF + - GMLC + - 5G_EIR + - SEPP + - UPF + - N3IWF + - AF + - UDSF + - BSF + - CHF + - NWDAF + - PCSCF + - CBCF + - HSS + - UCMF + - SOR_AF + - SPAF + - MME + - SCSAS + - SCEF + - SCP + - NSSAAF + - ICSCF + - SCSCF + - DRA + - IMS_AS + - AANF + - 5G_DDNMF + - NSACF + - MFAF + - EASDF + - DCCF + - MB_SMF + - TSCTSF + - ADRF + - GBA_BSF + - CEF + - MB_UPF + - NSWOF + - PKMF + - MNPF + - SMS_GMSC + - SMS_IWMSC + - MBSF + - MBSTF + - PANF +# - type: string + + NefId: + description: Identity of the NEF + type: string + + IpEndPoint: + description: > + IP addressing information of a given NFService; + it consists on, e.g. IP address, TCP port, transport protocol... + type: object + properties: + ipv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + transport: + $ref: '#/components/schemas/TransportProtocol' + port: + type: integer + minimum: 0 + maximum: 65535 + + SubscriptionData: + description: > + Information of a subscription to notifications to NRF events, + included in subscription requests and responses + type: object + required: + - nfStatusNotificationUri +# - subscriptionId + properties: + nfStatusNotificationUri: + type: string + reqNfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscrCond: + $ref: '#/components/schemas/SubscrCond' + subscriptionId: + type: string + pattern: '^([0-9]{5,6}-)?[^-]+$' + readOnly: true + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reqNotifEvents: + type: array + items: + $ref: '#/components/schemas/NotificationEventType' + minItems: 1 + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + notifCondition: + $ref: '#/components/schemas/NotifCondition' + reqNfType: + $ref: '#/components/schemas/NFType' + reqNfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + reqSnssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + reqPerPlmnSnssais: + type: array + items: + $ref: '#/components/schemas/PlmnSnssai' + minItems: 1 + reqPlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + reqSnpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + requesterFeatures: +# writeOnly: true +# allOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nrfSupportedFeatures: +# readOnly: true +# allOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hnrfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + onboardingCapability: + type: boolean + default: false + targetHni: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + preferredLocality: + type: string + + SubscrCond: + description: > + Condition to determine the set of NFs to monitor under a certain subscription in NRF +# oneOf: +# - $ref: '#/components/schemas/NfInstanceIdCond' +# - $ref: '#/components/schemas/NfInstanceIdListCond' +# - $ref: '#/components/schemas/NfTypeCond' +# - $ref: '#/components/schemas/ServiceNameCond' +# - $ref: '#/components/schemas/ServiceNameListCond' +# - $ref: '#/components/schemas/AmfCond' +# - $ref: '#/components/schemas/GuamiListCond' +# - $ref: '#/components/schemas/NetworkSliceCond' +# - $ref: '#/components/schemas/NfGroupCond' +# - $ref: '#/components/schemas/NfGroupListCond' +# - $ref: '#/components/schemas/NfSetCond' +# - $ref: '#/components/schemas/NfServiceSetCond' +# - $ref: '#/components/schemas/UpfCond' +# - $ref: '#/components/schemas/ScpDomainCond' +# - $ref: '#/components/schemas/NwdafCond' +# - $ref: '#/components/schemas/NefCond' +# - $ref: '#/components/schemas/DccfCond' + type: object + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfInstanceList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfType: + $ref: '#/components/schemas/NFType' + serviceName: + $ref: '#/components/schemas/ServiceName' + serviceNameList: + type: array + items: + $ref: '#/components/schemas/ServiceName' + amfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfSetId' + amfRegionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiList: + type: array + items: + type: string + nfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smfServingArea: + type: array + items: + type: string + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + NfInstanceIdCond: + description: Subscription to a given NF Instance Id + type: object + required: + - nfInstanceId + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + NfInstanceIdListCond: + description: Subscription to a list of NF Instances + type: object + required: + - nfInstanceIdList + properties: + nfInstanceIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + + NfTypeCond: + description: Subscription to a set of NFs based on their NF Type + type: object + required: + - nfType + not: + required: [ nfGroupId ] + properties: + nfType: + $ref: '#/components/schemas/NFType' + + ServiceNameCond: + description: Subscription to a set of NFs based on their support for a given Service Name + type: object + required: + - serviceName + properties: + serviceName: + $ref: '#/components/schemas/ServiceName' + + ServiceNameListCond: + description: > + Subscription to a set of NFs based on their support for a Service Name + in the Servic Name list + type: object + required: + - conditionType + - serviceNameList + properties: + conditionType: + type: string + enum: [ SERVICE_NAME_LIST_COND ] + serviceNameList: + type: array + items: + $ref: '#/components/schemas/ServiceName' + minItems: 1 + + AmfCond: + description: Subscription to a set of AMFs, based on AMF Set Id and/or AMF Region Id + type: object + anyOf: + - required: [ amfSetId ] + - required: [ amfRegionId ] + properties: + amfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfSetId' + amfRegionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' + + GuamiListCond: + description: Subscription to a set of AMFs, based on their GUAMIs + type: object + required: + - guamiList + properties: + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + + NetworkSliceCond: + description: Subscription to a set of NFs, based on the slices (S-NSSAI and NSI) they support + type: object + required: + - snssaiList + properties: + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiList: + type: array + items: + type: string + + NfGroupCond: + description: Subscription to a set of NFs based on their Group Id + type: object + required: + - nfType + - nfGroupId + properties: + nfType: + type: string + enum: + - UDM + - AUSF + - UDR + - PCF + - CHF + - HSS + nfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + NfGroupListCond: + description: Subscription to a set of NFs based on their Group Ids + type: object + required: + - conditionType + - nfType + - nfGroupIdList + properties: + conditionType: + type: string + enum: [ NF_GROUP_LIST_COND ] + nfType: + type: string + enum: + - UDM + - AUSF + - UDR + - PCF + - CHF + - HSS + nfGroupIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + minItems: 1 + + NotifCondition: + description: > + Condition (list of attributes in the NF Profile) to determine whether a notification + must be sent by NRF + type: object + not: + required: [ monitoredAttributes, unmonitoredAttributes ] + properties: + monitoredAttributes: + type: array + items: + type: string + minItems: 1 + unmonitoredAttributes: + type: array + items: + type: string + minItems: 1 + + UdrInfo: + description: Information of an UDR NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + supportedDataSets: + type: array + items: + $ref: '#/components/schemas/DataSetId' + minItems: 1 + sharedDataIdRanges: + type: array + items: + $ref: '#/components/schemas/SharedDataIdRange' + minItems: 1 + + SharedDataIdRange: + description: A range of SharedDataIds based on regular-expression matching + type: object + properties: + pattern: + type: string + + SupiRange: + description: > + A range of SUPIs (subscriber identities), either based on a numeric range, + or based on regular-expression matching + type: object + properties: + start: + type: string + pattern: '^[0-9]+$' + end: + type: string + pattern: '^[0-9]+$' + pattern: + type: string + + IdentityRange: + description: > + A range of GPSIs (subscriber identities), either based on a numeric range, + or based on regular-expression matching + type: object + properties: + start: + type: string + pattern: '^[0-9]+$' + end: + type: string + pattern: '^[0-9]+$' + pattern: + type: string + + InternalGroupIdRange: + description: > + A range of Group IDs (internal group identities), either based on a numeric range, + or based on regular-expression matching + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + end: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + pattern: + type: string + + DataSetId: +# description: Types of data sets and subsets stored in UDR +# anyOf: +# - type: string + enum: + - SUBSCRIPTION + - POLICY + - EXPOSURE + - APPLICATION + - A_PFD + - A_AFTI + - A_IPTV + - A_BDT + - A_SPD + - A_EASD + - A_AMI + - P_UE + - P_SCD + - P_BDT + - P_PLMNUE + - P_NSSCD +# - type: string + + UdmInfo: + description: Information of an UDM NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + routingIndicators: + type: array + items: + type: string + pattern: '^[0-9]{1,4}$' + minItems: 1 + internalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/InternalGroupIdRange' + minItems: 1 + suciInfos: + type: array + items: + $ref: '#/components/schemas/SuciInfo' + minItems: 1 + + AusfInfo: + description: Information of an AUSF NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + routingIndicators: + type: array + items: + type: string + pattern: '^[0-9]{1,4}$' + minItems: 1 + suciInfos: + type: array + items: + $ref: '#/components/schemas/SuciInfo' + minItems: 1 + + AmfInfo: + description: Information of an AMF NF Instance + type: object + required: + - amfSetId + - amfRegionId + - guamiList + properties: + amfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfSetId' + amfRegionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + backupInfoAmfFailure: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + backupInfoAmfRemoval: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + n2InterfaceAmfInfo: + $ref: '#/components/schemas/N2InterfaceAmfInfo' + amfOnboardingCapability: + type: boolean + default: false + + SmfInfo: + description: Information of an SMF NF Instance + type: object + required: + - sNssaiSmfInfoList + properties: + sNssaiSmfInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiSmfInfoItem' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddrList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + accessType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 + vsmfSupportInd: + type: boolean + pgwFqdnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + smfOnboardingCapability: + type: boolean + default: false + deprecated: true + ismfSupportInd: + type: boolean + smfUPRPCapability: + type: boolean + default: false + + SnssaiSmfInfoItem: + description: Set of parameters supported by SMF for a given S-NSSAI + type: object + required: + - sNssai + - dnnSmfInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnSmfInfoList: + type: array + items: + $ref: '#/components/schemas/DnnSmfInfoItem' + minItems: 1 + + DnnSmfInfoItem: + description: Set of parameters supported by SMF for a given DNN + type: object + required: + - dnn + properties: + dnn: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnaiList: + type: array + items: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + - $ref: '#/components/schemas/WildcardDnai' + minItems: 1 + + UpfInfo: + description: Information of an UPF NF Instance + type: object + required: + - sNssaiUpfInfoList + properties: + sNssaiUpfInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiUpfInfoItem' + minItems: 1 + smfServingArea: + type: array + items: + type: string + minItems: 1 + interfaceUpfInfoList: + type: array + items: + $ref: '#/components/schemas/InterfaceUpfInfoItem' + minItems: 1 + iwkEpsInd: + type: boolean + default: false + pduSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + atsssCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AtsssCapability' + ueIpAddrInd: + type: boolean + default: false + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + wAgfInfo: + $ref: '#/components/schemas/WAgfInfo' + tngfInfo: + $ref: '#/components/schemas/TngfInfo' + twifInfo: + $ref: '#/components/schemas/TwifInfo' + priority: + type: integer + minimum: 0 + maximum: 65535 + redundantGtpu: + type: boolean + default: false + ipups: + type: boolean + default: false + dataForwarding: + type: boolean + default: false + supportedPfcpFeatures: + type: string + + SnssaiUpfInfoItem: + description: Set of parameters supported by UPF for a given S-NSSAI + type: object + required: + - sNssai + - dnnUpfInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnUpfInfoList: + type: array + items: + $ref: '#/components/schemas/DnnUpfInfoItem' + minItems: 1 + redundantTransport: + type: boolean + default: false + + DnnUpfInfoItem: + description: Set of parameters supported by UPF for a given DNN + type: object + required: + - dnn + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + pduSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + ipv4AddressRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + ipv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 + ipv4IndexList: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpIndex' + minItems: 1 + ipv6IndexList: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpIndex' + minItems: 1 + dnaiNwInstanceList: + description: > + Map of network instance per DNAI for the DNN, where the key of the map is the DNAI. + When present, the value of each entry of the map shall contain a N6 network instance + that is configured for the DNAI indicated by the key. + type: object + additionalProperties: + type: string + minProperties: 1 + + InterfaceUpfInfoItem: + description: Information of a given IP interface of an UPF + type: object + required: + - interfaceType + properties: + interfaceType: + $ref: '#/components/schemas/UPInterfaceType' + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + networkInstance: + type: string + + UPInterfaceType: +# description: Types of User-Plane interfaces of the UPF +# anyOf: +# - type: string + enum: + - N3 + - N6 + - N9 + - DATA_FORWARDING + - N3MB + - N6MB + - N19MB + - NMB9 +# - type: string + + WAgfInfo: + description: Information of the W-AGF end-points + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + TngfInfo: + description: Infomation of the TNGF endpoints + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + PcfInfo: + description: Information of a PCF NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + rxDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + rxDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + v2xSupportInd: + type: boolean + default: false + proseSupportInd: + type: boolean + default: false + proseCapability: + $ref: '#/components/schemas/ProSeCapability' + v2xCapability: + $ref: '#/components/schemas/V2xCapability' + + BsfInfo: + description: Information of a BSF NF Instance + type: object + properties: + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + ipDomainList: + type: array + items: + type: string + minItems: 1 + ipv4AddressRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + ipv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 + rxDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + rxDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + + ChfInfo: + description: Information of a CHF NF Instance + type: object + not: + required: [ primaryChfInstance, secondaryChfInstance ] + properties: + supiRangeList: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRangeList: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + plmnRangeList: + type: array + items: + $ref: '#/components/schemas/PlmnRange' + minItems: 1 + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + primaryChfInstance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + secondaryChfInstance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + Ipv4AddressRange: + description: Range of IPv4 addresses + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + end: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + + Ipv6PrefixRange: + description: Range of IPv6 prefixes + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + end: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + DefaultNotificationSubscription: + description: > + Data structure for specifying the notifications the NF service subscribes by default, + along with callback URI + type: object + required: + - notificationType + - callbackUri + properties: + notificationType: + $ref: '#/components/schemas/NotificationType' + callbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + n1MessageClass: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N1MessageClass' + n2InformationClass: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InformationClass' + versions: + type: array + items: + type: string + minItems: 1 + binding: + type: string + acceptedEncoding: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + serviceInfoList: + description: > + A map of service specific information. The name of the corresponding service (as + specified in ServiceName data type) is the key. + type: object + additionalProperties: + $ref: '#/components/schemas/DefSubServiceInfo' + minProperties: 1 + + NfSetCond: + description: Subscription to a set of NFs based on their Set Id + type: object + required: + - nfSetId + properties: + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + + NfServiceSetCond: + description: Subscription to a set of NFs based on their Service Set Id + type: object + required: + - nfServiceSetId + properties: + nfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + + UpfCond: + description: > + Subscription to a set of NF Instances (UPFs), able to serve a certain service area + (i.e. SMF serving area or TAI list) + type: object + required: + - conditionType + properties: + conditionType: + type: string + enum: [ UPF_COND ] + smfServingArea: + type: array + items: + type: string + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + NwdafCond: + description: > + Subscription to a set of NF Instances (NWDAFs), identified by Analytics ID(s), + S-NSSAI(s) or NWDAF Serving Area information, i.e. list of TAIs for which the NWDAF + can provide analytics. + type: object + required: + - conditionType + properties: + conditionType: + type: string + enum: [ NWDAF_COND ] + analyticsIds: + type: array + items: + type: string + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + mlAnalyticsList: + type: array + items: + $ref: '#/components/schemas/MlAnalyticsInfo' + minItems: 1 + + NefCond: + description: > + Subscription to a set of NF Instances (NEFs), identified by Event ID(s) provided by AF, + S-NSSAI(s), AF Instance ID, Application Identifier, External Identifier, + External Group Identifier, or domain name. + type: object + required: + - conditionType + properties: + conditionType: + type: string + enum: [ NEF_COND ] + afEvents: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEvent' + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + pfdData: + $ref: '#/components/schemas/PfdData' + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + servedFqdnList: + type: array + items: + type: string + minItems: 1 + + NotificationType: +# description: > +# Types of notifications used in Default Notification URIs in the NF Profile of an NF Instance +# anyOf: +# - type: string + enum: + - N1_MESSAGES + - N2_INFORMATION + - LOCATION_NOTIFICATION + - DATA_REMOVAL_NOTIFICATION + - DATA_CHANGE_NOTIFICATION + - LOCATION_UPDATE_NOTIFICATION + - NSSAA_REAUTH_NOTIFICATION + - NSSAA_REVOC_NOTIFICATION + - MATCH_INFO_NOTIFICATION + - DATA_RESTORATION_NOTIFICATION + - TSCTS_NOTIFICATION + - LCS_KEY_DELIVERY_NOTIFICATION +# - type: string + + TransportProtocol: +# description: Types of transport protocol used in a given IP endpoint of an NF Service Instance +# anyOf: +# - type: string + enum: + - TCP +# - type: string + + NotificationEventType: +# description: Types of events sent in notifications from NRF to subscribed NF Instances +# anyOf: +# - type: string + enum: + - NF_REGISTERED + - NF_DEREGISTERED + - NF_PROFILE_CHANGED +# - type: string + + NotificationData: + description: Data sent in notifications from NRF to subscribed NF Instances + type: object + required: + - event + - nfInstanceUri + allOf: + # + # Condition: If 'event' takes value 'NF_PROFILE_CHANGED', + # then either 'nfProfile' or 'profileChanges' (but not both) must be present + # + - anyOf: + - not: + properties: + event: + type: string + enum: + - NF_PROFILE_CHANGED + - oneOf: + - required: [ nfProfile ] + - required: [ profileChanges ] + # + # Condition: If 'event' takes value 'NF_REGISTERED', + # then 'nfProfile' must be present + # + - anyOf: + - not: + properties: + event: + type: string + enum: + - NF_REGISTERED + - required: [ nfProfile ] + properties: + event: + $ref: '#/components/schemas/NotificationEventType' + nfInstanceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfProfile: + allOf: + - $ref: '#/components/schemas/NFProfile' + - not: + required: [ interPlmnFqdn ] + - not: + required: [ allowedPlmns ] + - not: + required: [ allowedSnpns ] + - not: + required: [ allowedNfTypes ] + - not: + required: [ allowedNfDomains ] + - not: + required: [ allowedNssais ] + - properties: + nfServices: + type: array + items: + allOf: + - $ref: '#/components/schemas/NFService' + - not: + required: [ interPlmnFqdn ] + - not: + required: [ allowedPlmns ] + - not: + required: [ allowedSnpns ] + - not: + required: [ allowedNfTypes ] + - not: + required: [ allowedNfDomains ] + - not: + required: [ allowedNssais ] + profileChanges: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChangeItem' + minItems: 1 + conditionEvent: + $ref: '#/components/schemas/ConditionEventType' + subscriptionContext: + $ref: '#/components/schemas/SubscriptionContext' + + NFStatus: +# description: Status of a given NF Instance stored in NRF +# anyOf: +# - type: string + enum: + - REGISTERED + - SUSPENDED + - UNDISCOVERABLE +# - type: string + + NFServiceVersion: + description: Contains the version details of an NF service + type: object + required: + - apiVersionInUri + - apiFullVersion + properties: + apiVersionInUri: + type: string + apiFullVersion: + type: string + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + ServiceName: +# description: Service names known to NRF +# anyOf: +# - type: string +# enum: +# - nnrf-nfm +# - nnrf-disc +# - nnrf-oauth2 +# - nudm-sdm +# - nudm-uecm +# - nudm-ueau +# - nudm-ee +# - nudm-pp +# - nudm-niddau +# - nudm-mt +# - nudm-ssau +# - nudm-rsds +# - namf-comm +# - namf-evts +# - namf-mt +# - namf-loc +# - namf-mbs-comm +# - namf-mbs-bc +# - nsmf-pdusession +# - nsmf-event-exposure +# - nsmf-nidd +# - nausf-auth +# - nausf-sorprotection +# - nausf-upuprotection +# - nnef-pfdmanagement +# - nnef-smcontext +# - nnef-eventexposure +# - nnef-eas-deployment-info +# - 3gpp-cp-parameter-provisioning +# - 3gpp-device-triggering +# - 3gpp-bdt +# - 3gpp-traffic-influence +# - 3gpp-chargeable-party +# - 3gpp-as-session-with-qos +# - 3gpp-msisdn-less-mo-sms +# - 3gpp-service-parameter +# - 3gpp-monitoring-event +# - 3gpp-nidd-configuration-trigger +# - 3gpp-nidd +# - 3gpp-analyticsexposure +# - 3gpp-racs-parameter-provisioning +# - 3gpp-ecr-control +# - 3gpp-applying-bdt-policy +# - 3gpp-mo-lcs-notify +# - 3gpp-time-sync +# - 3gpp-am-influence +# - 3gpp-am-policyauthorization +# - 3gpp-akma +# - 3gpp-eas-deployment +# - 3gpp-iptvconfiguration +# - 3gpp-mbs-tmgi +# - 3gpp-mbs-session +# - 3gpp-authentication +# - 3gpp-asti +# - npcf-am-policy-control +# - npcf-smpolicycontrol +# - npcf-policyauthorization +# - npcf-bdtpolicycontrol +# - npcf-eventexposure +# - npcf-ue-policy-control +# - npcf-am-policyauthorization +# - nsmsf-sms +# - nnssf-nsselection +# - nnssf-nssaiavailability +# - nudr-dr +# - nudr-group-id-map +# - nlmf-loc +# - n5g-eir-eic +# - nbsf-management +# - nchf-spendinglimitcontrol +# - nchf-convergedcharging +# - nchf-offlineonlycharging +# - nnwdaf-eventssubscription +# - nnwdaf-analyticsinfo +# - nnwdaf-datamanagement +# - nnwdaf-mlmodelprovision +# - ngmlc-loc +# - nucmf-provisioning +# - nucmf-uecapabilitymanagement +# - nhss-sdm +# - nhss-uecm +# - nhss-ueau +# - nhss-ee +# - nhss-ims-sdm +# - nhss-ims-uecm +# - nhss-ims-ueau +# - nhss-gba-sdm +# - nhss-gba-ueau +# - nsepp-telescopic +# - nsoraf-sor +# - nspaf-secured-packet +# - nudsf-dr +# - nudsf-timer +# - nnssaaf-nssaa +# - nnssaaf-aiw +# - naanf-akma +# - n5gddnmf-discovery +# - nmfaf-3dadm +# - nmfaf-3cadm +# - neasdf-dnscontext +# - neasdf-baselinednspattern +# - ndccf-dm +# - ndccf-cm +# - nnsacf-nsac +# - nnsacf-slice-ee +# - nmbsmf-tmgi +# - nmbsmf-mbssession +# - nadrf-dm +# - nbsp-gba +# - ntsctsf-time-sync +# - ntsctsf-qos-tscai +# - ntsctsf-asti +# - npkmf-keyreq +# - nmnpf-npstatus +# - niwmsc-smservice +# - nmbsf-mbsuserserv +# - nmbsf-mbsuserdataing +# - nmbstf-distsession +# - npanf-prosekey +# - type: string + type: string + + N2InterfaceAmfInfo: + description: AMF N2 interface information + type: object + properties: + ipv4EndpointAddress: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddress: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + amfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + + NFServiceStatus: +# description: Status of a given NF Service Instance of an NF Instance stored in NRF +# anyOf: +# - type: string + enum: + - REGISTERED + - SUSPENDED + - UNDISCOVERABLE +# - type: string + + TaiRange: + description: Range of TAIs (Tracking Area Identities) + type: object + required: + - plmnId + - tacRangeList + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + tacRangeList: + type: array + items: + $ref: '#/components/schemas/TacRange' + minItems: 1 + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + + TacRange: + description: Range of TACs (Tracking Area Codes) + type: object + properties: + start: + type: string + pattern: '^([A-Fa-f0-9]{4}|[A-Fa-f0-9]{6})$' + end: + type: string + pattern: '^([A-Fa-f0-9]{4}|[A-Fa-f0-9]{6})$' + pattern: + type: string + + PlmnRange: + description: Range of PLMN IDs + type: object + properties: + start: + type: string + pattern: '^[0-9]{3}[0-9]{2,3}$' + end: + type: string + pattern: '^[0-9]{3}[0-9]{2,3}$' + pattern: + type: string + + NrfInfo: + description: Information of an NRF NF Instance, used in hierarchical NRF deployments + type: object + properties: + servedUdrInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdrInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedUdrInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdrInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedUdmInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdmInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedUdmInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdmInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedAusfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AusfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedAusfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AusfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedAmfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedAmfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedSmfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/SmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedSmfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/SmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedUpfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UpfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedUpfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UpfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedPcfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/PcfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedPcfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/PcfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedBsfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/BsfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedBsfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/BsfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedChfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ChfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedChfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ChfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedNefInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/NefInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedNwdafInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/NwdafInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedNwdafInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + type: object + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/NwdafInfo' + minProperties: 1 + minProperties: 1 + servedPcscfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/PcscfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedGmlcInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/GmlcInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedLmfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/LmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedNfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + $ref: '#/components/schemas/NfInfo' + minProperties: 1 + servedHssInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/HssInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedUdsfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdsfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedUdsfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdsfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedScpInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ScpInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedSeppInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/SeppInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedAanfInfoList: + description: A map (list of key-value pairs) where NF Instance Id serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AanfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + served5gDdnmfInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/5GDdnmfInfo' + minProperties: 1 + servedMfafInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + $ref: '#/components/schemas/MfafInfo' + minProperties: 1 + servedEasdfInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + type: object + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/EasdfInfo' + minProperties: 1 + servedDccfInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + $ref: '#/components/schemas/DccfInfo' + minProperties: 1 + servedMbSmfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/MbSmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedTsctsfInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + type: object + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/TsctsfInfo' + minProperties: 1 + minProperties: 1 + servedMbUpfInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + type: object + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/MbUpfInfo' + minProperties: 1 + minProperties: 1 + servedTrustAfInfo: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + $ref: '#/components/schemas/TrustAfInfo' + minProperties: 1 + servedNssaafInfo: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + $ref: '#/components/schemas/NssaafInfo' + minProperties: 1 + + PlmnSnssai: + description: List of network slices (S-NSSAIs) for a given PLMN ID + type: object + required: + - plmnId + - sNssaiList + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + sNssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + + NefInfo: + description: Information of an NEF NF Instance + type: object + properties: + nefId: + $ref: '#/components/schemas/NefId' + pfdData: + $ref: '#/components/schemas/PfdData' + afEeData: + $ref: '#/components/schemas/AfEventExposureData' + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + servedFqdnList: + type: array + items: + type: string + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + unTrustAfInfoList: + type: array + items: + $ref: '#/components/schemas/UnTrustAfInfo' + minItems: 1 + uasNfFunctionalityInd: + type: boolean + default: false + + PfdData: + description: List of Application IDs and/or AF IDs managed by a given NEF Instance + type: object + properties: + appIds: + type: array + items: + type: string + minItems: 1 + afIds: + type: array + items: + type: string + minItems: 1 + + NwdafInfo: + description: Information of a NWDAF NF Instance + type: object + properties: + eventIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + minItems: 1 + nwdafEvents: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + nwdafCapability: + $ref: '#/components/schemas/NwdafCapability' + analyticsDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + mlAnalyticsList: + type: array + items: + $ref: '#/components/schemas/MlAnalyticsInfo' + minItems: 1 + + LmfInfo: + description: Information of an LMF NF Instance + type: object + properties: + servingClientTypes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + minItems: 1 + lmfId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + servingAccessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + servingAnNodeTypes: + type: array + items: + $ref: '#/components/schemas/AnNodeType' + minItems: 1 + servingRatTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + supportedGADShapes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + minItems: 1 + + GmlcInfo: + description: Information of a GMLC NF Instance + type: object + properties: + servingClientTypes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + minItems: 1 + gmlcNumbers: + type: array + items: + type: string + pattern: '^[0-9]{5,15}$' + minItems: 1 + + AfEventExposureData: + description: AF Event Exposure data managed by a given NEF Instance + type: object + required: + - afEvents + properties: + afEvents: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEvent' + minItems: 1 + afIds: + type: array + items: + type: string + minItems: 1 + appIds: + type: array + items: + type: string + minItems: 1 + + PcscfInfo: + description: Information of a P-CSCF NF Instance + type: object + properties: + accessType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + gmFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + gmIpv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + gmIpv6Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + mwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + mwIpv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + mwIpv6Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + servedIpv4AddressRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + servedIpv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 + + NfInfo: + description: Information of a generic NF Instance + type: object + properties: + nfType: + $ref: '#/components/schemas/NFType' + + HssInfo: + description: Information of an HSS NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + imsiRanges: + type: array + items: + $ref: '#/components/schemas/ImsiRange' + minItems: 1 + imsPrivateIdentityRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + imsPublicIdentityRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + msisdnRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + hssDiameterAddress: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/NetworkNodeDiameterAddress' + + ImsiRange: + description: > + A range of IMSIs (subscriber identities), either based on a numeric range, + or based on regular-expression matching + type: object + properties: + start: + type: string + pattern: '^[0-9]+$' + end: + type: string + pattern: '^[0-9]+$' + pattern: + type: string + + TwifInfo: + description: Addressing information (IP addresses, FQDN) of the TWIF + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + VendorId: + description: Vendor ID of the NF Service instance (Private Enterprise Number assigned by IANA) + type: string + pattern: '^[0-9]{6}$' + + VendorSpecificFeature: + description: Information about a vendor-specific feature + type: object + required: + - featureName + - featureVersion + properties: + featureName: + type: string + featureVersion: + type: string + + AnNodeType: +# description: Access Network Node Type (gNB, ng-eNB...) +# anyOf: +# - type: string + enum: + - GNB + - NG_ENB +# - type: string + + UdsfInfo: + description: Information related to UDSF + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + storageIdRanges: + description: > + A map (list of key-value pairs) where realmId serves as key and each value in the map + is an array of IdentityRanges. Each IdentityRange is a range of storageIds. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + minProperties: 1 + + ScpInfo: + description: Information of an SCP Instance + type: object + properties: + scpDomainInfoList: + description: > + A map (list of key-value pairs) where the key of the map shall be the string + identifying an SCP domain + type: object + additionalProperties: + $ref: '#/components/schemas/ScpDomainInfo' + minProperties: 1 + scpPrefix: + type: string + scpPorts: + description: > + Port numbers for HTTP and HTTPS. The key of the map shall be "http" or "https". + type: object + additionalProperties: + type: integer + minimum: 0 + maximum: 65535 + minProperties: 1 + addressDomains: + type: array + items: + type: string + minItems: 1 + ipv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + ipv4AddrRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + ipv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 + servedNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + remotePlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + remoteSnpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + ipReachability: + $ref: '#/components/schemas/IpReachability' + scpCapabilities: + type: array + items: + $ref: '#/components/schemas/ScpCapability' + + ScpDomainInfo: + description: SCP Domain specific information + type: object + properties: + scpFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + scpIpEndPoints: + type: array + items: + $ref: '#/components/schemas/IpEndPoint' + minItems: 1 + scpPrefix: + type: string + scpPorts: + description: > + Port numbers for HTTP and HTTPS. The key of the map shall be "http" or "https". + type: object + additionalProperties: + type: integer + minimum: 0 + maximum: 65535 + minProperties: 1 + + ScpDomainCond: + description: > + Subscription to a set of NF or SCP or SEPP instances belonging to certain SCP domains + type: object + required: + - scpDomains + properties: + scpDomains: + type: array + items: + type: string + minItems: 1 + nfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + + OptionsResponse: + description: Communication options of the NRF sent in response payload of OPTIONS method + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ConditionEventType: +# description: > +# Indicates whether a notification is due to the NF Instance to start or stop +# being part of a condition for a subscription to a set of NFs +# anyOf: +# - type: string + enum: + - NF_ADDED + - NF_REMOVED +# - type: string + + SuciInfo: + description: SUCI information containing Routing Indicator and Home Network Public Key ID + type: object + properties: + routingInds: + type: array + items: + type: string + pattern: '^[0-9]{1,4}$' + minItems: 1 + hNwPubKeyIds: + type: array + items: + type: integer + minItems: 1 + + SeppInfo: + description: Information of a SEPP Instance + type: object + properties: + seppPrefix: + type: string + seppPorts: + description: > + Port numbers for HTTP and HTTPS. The key of the map shall be "http" or "https". + type: object + additionalProperties: + type: integer + minimum: 0 + maximum: 65535 + minProperties: 1 + remotePlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + remoteSnpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + + IpReachability: +# description: Indicates the type(s) of IP addresses reachable via an SCP +# anyOf: +# - type: string + enum: + - IPV4 + - IPV6 + - IPV4V6 +# - type: string + + UriList: + description: > + Represents a set of URIs following the 3GPP hypermedia format + (containing a "_links" attribute). + type: object + properties: + _links: + type: object + description: > + List of the URI of NF instances. It has two members whose names are item and self. + The item attribute contains an array of URIs. + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + totalItemCount: + type: integer + + AanfInfo: + description: Represents the information relative to an AAnF NF Instance. + type: object + properties: + routingIndicators: + type: array + items: + type: string + pattern: '^[0-9]{1,4}$' + minItems: 1 + + 5GDdnmfInfo: + description: Information of an 5G DDNMF NF Instance + type: object + required: + - plmnId + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + WildcardDnai: + description: Wildcard DNAI + type: string + pattern: '^[*]$' + + MfafInfo: + description: Information of a MFAF NF Instance + type: object + properties: + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + + NwdafCapability: + description: Indicates the capability supported by the NWDAF + type: object + properties: + analyticsAggregation: + type: boolean + default: false + analyticsMetadataProvisioning: + type: boolean + default: false + + EasdfInfo: + description: Information of an EASDF NF Instance + type: object + properties: + sNssaiEasdfInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiEasdfInfoItem' + minItems: 1 + easdfN6IpAddressList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + upfN6IpAddressList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + + SnssaiEasdfInfoItem: + description: Set of parameters supported by EASDF for a given S-NSSAI + type: object + required: + - sNssai + - dnnEasdfInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnEasdfInfoList: + type: array + items: + $ref: '#/components/schemas/DnnEasdfInfoItem' + minItems: 1 + + DnnEasdfInfoItem: + description: Set of parameters supported by EASDF for a given DNN + type: object + required: + - dnn + properties: + dnn: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + + DccfInfo: + description: Information of a DCCF NF Instance + type: object + properties: + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + + ScpCapability: +# description: Indicates the capabilities supported by an SCP +# anyOf: +# - type: string + enum: + - INDIRECT_COM_WITH_DELEG_DISC +# - type: string + + NsacfInfo: + description: Information of a NSACF NF Instance + type: object + required: + - nsacfCapability + properties: + nsacfCapability: + $ref: '#/components/schemas/NsacfCapability' + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + + NsacfCapability: + description: > + NSACF service capabilities (e.g. to monitor and control the number of registered UEs + or established PDU sessions per network slice) + type: object + properties: + supportUeSAC: + description: | + Indicates the service capability of the NSACF to monitor and control the number of + registered UEs per network slice for the network slice that is subject to NSAC + true: Supported + false (default): Not Supported + type: boolean + default: false + supportPduSAC: + description: | + Indicates the service capability of the NSACF to monitor and control the number of + established PDU sessions per network slice for the network slice that is subject to NSAC + true: Supported + false (default): Not Supported + type: boolean + default: false + + DccfCond: + description: > + Subscription to a set of NF Instances (DCCFs), identified by NF types, NF Set Id(s) + or DCCF Serving Area information, i.e. list of TAIs served by the DCCF + type: object + required: + - conditionType + properties: + conditionType: + type: string + enum: [ DCCF_COND ] + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + + MlAnalyticsInfo: + description: ML Analytics Filter information supported by the Nnwdaf_MLModelProvision service + type: object + properties: + mlAnalyticsIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + trackingAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + MbSmfInfo: + description: Information of an MB-SMF NF Instance + type: object + properties: + sNssaiInfoList: + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/SnssaiMbSmfInfoItem' + minProperties: 1 + tmgiRangeList: + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/TmgiRange' + minProperties: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + mbsSessionList: + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/MbsSession' + minProperties: 1 + + TmgiRange: + description: Range of TMGIs + type: object + required: + - mbsServiceIdStart + - mbsServiceIdEnd + - plmnId + properties: + mbsServiceIdStart: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + mbsServiceIdEnd: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + + MbsSession: + description: MBS Session currently served by an MB-SMF + type: object + required: + - mbsSessionId + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + mbsAreaSessions: + description: A map (list of key-value pairs) where the key identifies an areaSessionId + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceAreaInfo' + minProperties: 1 + + SnssaiMbSmfInfoItem: + description: Parameters supported by an MB-SMF for a given S-NSSAI + type: object + required: + - sNssai + - dnnInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnInfoList: + type: array + items: + $ref: '#/components/schemas/DnnMbSmfInfoItem' + minItems: 1 + + DnnMbSmfInfoItem: + description: Parameters supported by an MB-SMF for a given DNN + type: object + required: + - dnn + properties: + dnn: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + + TsctsfInfo: + description: Information of a TSCTSF NF Instance + type: object + properties: + sNssaiInfoList: + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/SnssaiTsctsfInfoItem' + minProperties: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + internalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/InternalGroupIdRange' + minItems: 1 + + SnssaiTsctsfInfoItem: + description: Set of parameters supported by TSCTSF for a given S-NSSAI + type: object + required: + - sNssai + - dnnInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnInfoList: + type: array + items: + $ref: '#/components/schemas/DnnTsctsfInfoItem' + minItems: 1 + + DnnTsctsfInfoItem: + description: Parameters supported by an TSCTSF for a given DNN + type: object + required: + - dnn + properties: + dnn: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + + MbUpfInfo: + description: Information of an MB-UPF NF Instance + type: object + required: + - sNssaiMbUpfInfoList + properties: + sNssaiMbUpfInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiUpfInfoItem' + minItems: 1 + mbSmfServingArea: + type: array + items: + type: string + minItems: 1 + interfaceMbUpfInfoList: + type: array + items: + $ref: '#/components/schemas/InterfaceUpfInfoItem' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 + supportedPfcpFeatures: + type: string + + UnTrustAfInfo: + description: Information of a untrusted AF Instance + type: object + required: + - afId + properties: + afId: + type: string + sNssaiInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiInfoItem' + minItems: 1 + mappingInd: + type: boolean + default: false + + TrustAfInfo: + description: Information of a trusted AF Instance + type: object + properties: + sNssaiInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiInfoItem' + minItems: 1 + afEvents: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEvent' + minItems: 1 + appIds: + type: array + items: + type: string + minItems: 1 + internalGroupId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + mappingInd: + type: boolean + default: false + + SnssaiInfoItem: + description: > + Parameters supported by an NF for a given S-NSSAI Set of parameters supported by NF + for a given S-NSSAI + type: object + required: + - sNssai + - dnnInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnInfoList: + type: array + items: + $ref: '#/components/schemas/DnnInfoItem' + minItems: 1 + + DnnInfoItem: + description: Set of parameters supported by NF for a given DNN + type: object + required: + - dnn + properties: + dnn: +# anyOf: +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + + CollocatedNfInstance: + description: Information of an collocated NF Instance registered in the NRF + type: object + required: + - nfInstanceId + - nfType + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfType: + $ref: '#/components/schemas/CollocatedNfType' + + CollocatedNfType: +# description: NF types for a collocated NF +# anyOf: +# - type: string + enum: + - UPF + - SMF + - MB_UPF + - MB_SMF +# - type: string + + PlmnOauth2: + description: Oauth2.0 required indication for a given PLMN ID + type: object + properties: + oauth2RequiredPlmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + oauth2NotRequiredPlmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + + V2xCapability: + description: Indicate the supported V2X Capability by the PCF. + type: object + properties: + lteV2x: + type: boolean + default: false + nrV2x: + type: boolean + default: false + + NssaafInfo: + description: Information of a NSSAAF Instance + type: object + properties: + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + internalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/InternalGroupIdRange' + minItems: 1 + + ProSeCapability: + description: Indicate the supported ProSe Capability by the PCF. + type: object + properties: + proseDirectDiscovey: + type: boolean + default: false + proseDirectCommunication: + type: boolean + default: false + proseL2UetoNetworkRelay: + type: boolean + default: false + proseL3UetoNetworkRelay: + type: boolean + default: false + proseL2RemoteUe: + type: boolean + default: false + proseL3RemoteUe: + type: boolean + default: false + + SubscriptionContext: + description: > + Context data related to a created subscription, to be included in notifications sent by NRF + type: object + required: + - subscriptionId + properties: + subscriptionId: + type: string + subscrCond: + $ref: '#/components/schemas/SubscrCond' + + IwmscInfo: + description: Information of an SMS-IWMSC NF Instance + type: object + properties: + msisdnRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + scNumber: + type: string + pattern: '^[0-9]{5,15}$' + + MnpfInfo: + description: Information of an MNPF Instance + type: object + properties: + msisdnRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + required: + - msisdnRanges + + DefSubServiceInfo: + description: Service Specific information for Default Notification Subscription. + type: object + properties: + versions: + type: array + items: + type: string + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29512_Npcf_SMPolicyControl.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29512_Npcf_SMPolicyControl.yaml new file mode 100644 index 000000000..b7771f3a8 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29512_Npcf_SMPolicyControl.yaml @@ -0,0 +1,2490 @@ +openapi: 3.0.0 +info: + title: Npcf_SMPolicyControl API + version: 1.2.2 + description: | + Session Management Policy Control Service + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.512 V17.9.0; 5G System; Session Management Policy Control Service. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.512/' +security: + - {} + - oAuth2ClientCredentials: + - npcf-smpolicycontrol +servers: + - url: '{apiRoot}/npcf-smpolicycontrol/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +paths: + /sm-policies: + post: + summary: Create a new Individual SM Policy + operationId: CreateSMPolicy + tags: + - SM Policies (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyContextData' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDecision' + headers: + Location: + description: Contains the URI of the newly created resource + required: true + schema: + type: string + '308': + description: Permanent Redirect + headers: + Location: + description: > + Contains the URI of the PCF within the existing PCF binding information stored in + the BSF for the same UE ID, S-NSSAI and DNN combination + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + SmPolicyUpdateNotification: + '{$request.body#/notificationUri}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyNotification' + responses: + '200': + description: OK. The current applicable values corresponding to the policy control request trigger is reported + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/UeCampingRep' + - type: array + items: + $ref: '#/components/schemas/PartialSuccessReport' + minItems: 1 + - type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + '204': + description: No Content, Notification was succesfull + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorReport' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + SmPolicyControlTerminationRequestNotification: + '{$request.body#/notificationUri}/terminate': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TerminationNotification' + responses: + '204': + description: No Content, Notification was successful + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}: + get: + summary: Read an Individual SM Policy + operationId: GetSMPolicy + tags: + - Individual SM Policy (Document) + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyControl' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}/update: + post: + summary: Update an existing Individual SM Policy + operationId: UpdateSMPolicy + tags: + - Individual SM Policy (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyUpdateContextData' + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Updated policies are returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDecision' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}/delete: + post: + summary: Delete an existing Individual SM Policy + operationId: DeleteSMPolicy + tags: + - Individual SM Policy (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDeleteData' + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-smpolicycontrol: Access to the Npcf_SMPolicyControl API + schemas: + SmPolicyControl: + description: Contains the parameters used to request the SM policies and the SM policies authorized by the PCF. + type: object + properties: + context: + $ref: '#/components/schemas/SmPolicyContextData' + policy: + $ref: '#/components/schemas/SmPolicyDecision' + required: + - context + - policy + SmPolicyContextData: + description: Contains the parameters used to create an Individual SM policy resource. + type: object + properties: + accNetChId: + $ref: '#/components/schemas/AccNetChId' + chargEntityAddr: + $ref: '#/components/schemas/AccNetChargingAddress' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + invalidSupi: + type: boolean + description: > + When this attribute is included and set to true, it indicates that the supi attribute + contains an invalid value.This attribute shall be present if the SUPI is not available + in the SMF or the SUPI is unauthenticated. When present it shall be set to true for an + invalid SUPI and false (default) for a valid SUPI. + interGrpIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + chargingcharacteristics: + type: string + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnnSelMode: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/DnnSelectionMode' + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + addAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + ipv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ipDomain: + type: string + description: Indicates the IPv4 address domain + subsSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authProfIndex: + type: string + description: Indicates the DN-AAA authorization profile index + subsDefQos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + vplmnQos: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/VplmnQos' + numOfPackFilter: + type: integer + description: Contains the number of supported packet filter for signalled QoS rules. + online: + type: boolean + description: If it is included and set to true, the online charging is applied to the PDU session. + offline: + type: boolean + description: If it is included and set to true, the offline charging is applied to the PDU session. + 3gppPsDataOffStatus: + type: boolean + description: If it is included and set to true, the 3GPP PS Data Off is activated by the UE. + refQosIndication: + type: boolean + description: If it is included and set to true, the reflective QoS is supported by the UE. + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + smfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + maPduInd: + $ref: '#/components/schemas/MaPduIndication' + atsssCapab: +# $ref: '#/components/schemas/AtsssCapability' + $ref: '#/components/schemas/NpcfAtsssCapability' + ipv4FrameRouteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrMask' + minItems: 1 + ipv6FrameRouteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + pcfUeInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + onboardInd: + type: boolean + description: If it is included and set to true, it indicates that the PDU session is used for UE Onboarding. + nwdafDatas: + type: array + items: + $ref: '#/components/schemas/NwdafData' + minItems: 1 + required: + - supi + - pduSessionId + - pduSessionType + - dnn + - notificationUri + - sliceInfo + SmPolicyDecision: + description: Contains the SM policies authorized by the PCF. + type: object + properties: + sessRules: + type: object + additionalProperties: + $ref: '#/components/schemas/SessionRule' + minProperties: 1 + description: > + A map of Sessionrules with the content being the SessionRule as described in + clause 5.6.2.7. The key used in this map for each entry is the sessRuleId + attribute of the corresponding SessionRule. + pccRules: + type: object + additionalProperties: + $ref: '#/components/schemas/PccRule' + minProperties: 1 + description: > + A map of PCC rules with the content being the PCCRule as described in + clause 5.6.2.6. The key used in this map for each entry is the pccRuleId + attribute of the corresponding PccRule. + nullable: true + pcscfRestIndication: + type: boolean + description: If it is included and set to true, it indicates the P-CSCF Restoration is requested. + qosDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/QosData' + minProperties: 1 + description: > + Map of QoS data policy decisions. The key used in this map for each entry is the qosId + attribute of the corresponding QosData. + chgDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/ChargingData' + minProperties: 1 + description: > + Map of Charging data policy decisions. The key used in this map for each entry + is the chgId attribute of the corresponding ChargingData. + nullable: true + chargingInfo: + $ref: '#/components/schemas/ChargingInformation' + traffContDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/TrafficControlData' + minProperties: 1 + description: > + Map of Traffic Control data policy decisions. The key used in this map for each entry + is the tcId attribute of the corresponding TrafficControlData. + umDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonitoringData' + minProperties: 1 + description: > + Map of Usage Monitoring data policy decisions. The key used in this map for each entry + is the umId attribute of the corresponding UsageMonitoringData. + nullable: true + qosChars: + type: object + additionalProperties: + $ref: '#/components/schemas/QosCharacteristics' + minProperties: 1 + description: Map of QoS characteristics for non standard 5QIs. This map uses the 5QI values as keys. + qosMonDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/QosMonitoringData' + minProperties: 1 + description: > + Map of QoS Monitoring data policy decisions. The key used in this map for each entry + is the qmId attribute of the corresponding QosMonitoringData. + nullable: true + reflectiveQoSTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + conds: + type: object + additionalProperties: + $ref: '#/components/schemas/ConditionData' + minProperties: 1 + description: > + A map of condition data with the content being as described in clause 5.6.2.9. The key + used in this map for each entry is the condId attribute of the corresponding ConditionData. + nullable: true + revalidationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + offline: + type: boolean + description: Indicates the offline charging is applicable to the PDU session when it is included and set to true. + online: + type: boolean + description: Indicates the online charging is applicable to the PDU session when it is included and set to true. + offlineChOnly: + type: boolean + default: false + description: > + Indicates that the online charging method shall never be used for any PCC rule activated + during the lifetime of the PDU session. + policyCtrlReqTriggers: + type: array + items: + $ref: '#/components/schemas/PolicyControlRequestTrigger' + minItems: 1 + description: Defines the policy control request triggers subscribed by the PCF. + nullable: true + lastReqRuleData: + type: array + items: + $ref: '#/components/schemas/RequestedRuleData' + minItems: 1 + description: Defines the last list of rule control data requested by the PCF. + lastReqUsageData: + $ref: '#/components/schemas/RequestedUsageData' + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfoRm' + minProperties: 1 + description: Map of PRA information. The praId attribute within the PresenceInfo data type is the key of the map. + nullable: true + ipv4Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + ipv6Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + relCause: + $ref: '#/components/schemas/SmPolicyAssociationReleaseCause' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + tsnBridgeManCont: + $ref: '#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: '#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: '#/components/schemas/PortManagementContainer' + minItems: 1 + redSessIndication: + type: boolean + description: > + Indicates whether the PDU session is a redundant PDU session. If absent it means the PDU + session is not a redundant PDU session. + SmPolicyNotification: + description: Represents a notification on the update of the SM policies. + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smPolicyDecision: + $ref: '#/components/schemas/SmPolicyDecision' + PccRule: + description: Contains a PCC rule information. + type: object + properties: + flowInfos: + type: array + items: + $ref: '#/components/schemas/FlowInformation' + minItems: 1 + description: An array of IP flow packet filter information. + appId: + type: string + description: A reference to the application detection filter configured at the UPF. + appDescriptor: + $ref: '#/components/schemas/ApplicationDescriptor' + contVer: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + pccRuleId: + type: string + description: Univocally identifies the PCC rule within a PDU session. + precedence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + afSigProtocol: + $ref: '#/components/schemas/AfSigProtocol' + appReloc: + type: boolean + description: Indication of application relocation possibility. + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required. + refQosData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the QosData policy decision type. It is the qosId described in clause 5.6.2.8. + refAltQosParams: + type: array + items: + type: string + minItems: 1 + description: A Reference to the QosData policy decision type for the Alternative QoS parameter sets of the service data flow. + refTcData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the TrafficControlData policy decision type. It is the tcId described in clause 5.6.2.10. + refChgData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the ChargingData policy decision type. It is the chgId described in clause 5.6.2.11. + nullable: true + refChgN3gData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: > + A reference to the ChargingData policy decision type only applicable to Non-3GPP access + if "ATSSS" feature is supported. It is the chgId described in clause 5.6.2.11. + nullable: true + refUmData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to UsageMonitoringData policy decision type. It is the umId described in clause 5.6.2.12. + nullable: true + refUmN3gData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: > + A reference to UsageMonitoringData policy decision type only applicable to Non-3GPP + access if "ATSSS" feature is supported. It is the umId described in clause 5.6.2.12. + nullable: true + refCondData: + type: string + description: A reference to the condition data. It is the condId described in clause 5.6.2.9. + nullable: true + refQosMon: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the QosMonitoringData policy decision type. It is the qmId described in clause 5.6.2.40. + nullable: true + addrPreserInd: + type: boolean + nullable: true + tscaiInputDl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + ddNotifCtrl: + $ref: '#/components/schemas/DownlinkDataNotificationControl' + ddNotifCtrl2: + $ref: '#/components/schemas/DownlinkDataNotificationControlRm' + disUeNotif: + type: boolean + nullable: true + packFiltAllPrec: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - pccRuleId + nullable: true + SessionRule: + description: Contains session level policy information. + type: object + properties: + authSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authDefQos: + $ref: '#/components/schemas/AuthorizedDefaultQos' + sessRuleId: + type: string + description: Univocally identifies the session rule within a PDU session. + refUmData: + type: string + description: A reference to UsageMonitoringData policy decision type. It is the umId described in clause 5.6.2.12. + nullable: true + refUmN3gData: + type: string + description: A reference to UsageMonitoringData policy decision type to apply for Non-3GPP access. It is the umId described in clause 5.6.2.12. + nullable: true + refCondData: + type: string + description: A reference to the condition data. It is the condId described in clause 5.6.2.9. + nullable: true + required: + - sessRuleId + nullable: true + QosData: + description: Contains the QoS parameters. + type: object + properties: + qosId: + type: string + description: Univocally identifies the QoS control policy data within a PDU session. + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + maxbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + qnc: + type: boolean + description: > + Indicates whether notifications are requested from 3GPP NG-RAN when the GFBR can no longer + (or again) be guaranteed for a QoS Flow during the lifetime of the QoS Flow. + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevelRm' + averWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindowRm' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVolRm' + reflectiveQos: + type: boolean + description: Indicates whether the QoS information is reflective for the corresponding service data flow. + sharingKeyDl: + type: string + description: Indicates, by containing the same value, what PCC rules may share resource in downlink direction. + sharingKeyUl: + type: string + description: Indicates, by containing the same value, what PCC rules may share resource in uplink direction. + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + defQosFlowIndication: + type: boolean + description: Indicates that the dynamic PCC rule shall always have its binding with the QoS Flow associated with the default QoS rule + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + packetDelayBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + packetErrorRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + required: + - qosId + nullable: true + ConditionData: + description: Contains conditions of applicability for a rule. + type: object + properties: + condId: + type: string + description: Uniquely identifies the condition data within a PDU session. + activationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + deactivationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + required: + - condId + nullable: true + TrafficControlData: + description: Contains parameters determining how flows associated with a PCC Rule are treated (e.g. blocked, redirected, etc). + type: object + properties: + tcId: + type: string + description: Univocally identifies the traffic control policy data within a PDU session. + flowStatus: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowStatus' + redirectInfo: + $ref: '#/components/schemas/RedirectInformation' + addRedirectInfo: + type: array + items: + $ref: '#/components/schemas/RedirectInformation' + minItems: 1 + muteNotif: + type: boolean + description: Indicates whether applicat'on's start or stop notification is to be muted. + trafficSteeringPolIdDl: + type: string + description: Reference to a pre-configured traffic steering policy for downlink traffic at the SMF. + nullable: true + trafficSteeringPolIdUl: + type: string + description: Reference to a pre-configured traffic steering policy for uplink traffic at the SMF. + nullable: true + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: A list of location which the traffic shall be routed to for the AF request + nullable: true + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + nullable: true + traffCorreInd: + type: boolean + simConnInd: + type: boolean + description: Indicates whether simultaneous connectivity should be temporarily maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + upPathChgEvent: + $ref: '#/components/schemas/UpPathChgEvent' + steerFun: + $ref: '#/components/schemas/SteeringFunctionality' + steerModeDl: + $ref: '#/components/schemas/SteeringMode' + steerModeUl: + $ref: '#/components/schemas/SteeringMode' + mulAccCtrl: +# $ref: '#/components/schemas/MulticastAccessControl' + $ref: '#/components/schemas/NpcfMulticastAccessControl' + required: + - tcId + nullable: true + ChargingData: + description: Contains charging related parameters. + type: object + properties: + chgId: + type: string + description: Univocally identifies the charging control policy data within a PDU session. + meteringMethod: + $ref: '#/components/schemas/MeteringMethod' + offline: + type: boolean + description: Indicates the offline charging is applicable to the PCC rule when it is included and set to true. + online: + type: boolean + description: Indicates the online charging is applicable to the PCC rule when it is included and set to true. + sdfHandl: + type: boolean + description: Indicates whether the service data flow is allowed to start while the SMF is waiting for the response to the credit request. + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + reportingLevel: + $ref: '#/components/schemas/ReportingLevel' + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + sponsorId: + type: string + description: Indicates the sponsor identity. + appSvcProvId: + type: string + description: Indicates the application service provider identity. + afChargingIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + afChargId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationChargingId' + required: + - chgId + nullable: true + UsageMonitoringData: + description: Contains usage monitoring related control information. + type: object + properties: + umId: + type: string + description: Univocally identifies the usage monitoring policy data within a PDU session. + volumeThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + volumeThresholdUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + volumeThresholdDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + timeThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + monitoringTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + nextVolThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextVolThresholdUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextVolThresholdDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextTimeThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + inactivityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + exUsagePccRuleIds: + type: array + items: + type: string + minItems: 1 + description: > + Contains the PCC rule identifier(s) which corresponding service data flow(s) shall be + excluded from PDU Session usage monitoring. It is only included in the + UsageMonitoringData instance for session level usage monitoring. + nullable: true + required: + - umId + nullable: true + RedirectInformation: + description: Contains the redirect information. + type: object + properties: + redirectEnabled: + type: boolean + description: Indicates the redirect is enable. + redirectAddressType: + $ref: '#/components/schemas/RedirectAddressType' + redirectServerAddress: + type: string + description: > + Indicates the address of the redirect server. If "redirectAddressType" attribute + indicates the IPV4_ADDR, the encoding is the same as the Ipv4Addr data type defined in + 3GPP TS 29.571.If "redirectAddressType" attribute indicates the IPV6_ADDR, the encoding + is the same as the Ipv6Addr data type defined in 3GPP TS 29.571.If "redirectAddressType" + attribute indicates the URL or SIP_URI, the encoding is the same as the Uri data type + defined in 3GPP TS 29.571. + FlowInformation: + description: Contains the flow information. + type: object + properties: + flowDescription: + $ref: '#/components/schemas/FlowDescription' + ethFlowDescription: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + packFiltId: + type: string + description: An identifier of packet filter. + packetFilterUsage: + type: boolean + description: The packet shall be sent to the UE. + tosTrafficClass: + type: string + description: Contains the Ipv4 Type-of-Service and mask field or the Ipv6 Traffic-Class field and mask field. + nullable: true + spi: + type: string + description: the security parameter index of the IPSec packet. + nullable: true + flowLabel: + type: string + description: the Ipv6 flow label header field. + nullable: true + flowDirection: +# $ref: '#/components/schemas/FlowDirectionRm' + $ref: '#/components/schemas/FlowDirection' + SmPolicyDeleteData: + description: Contains the parameters to be sent to the PCF when an individual SM policy is deleted. + type: object + properties: + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfoTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ranNasRelCauses: + type: array + items: + $ref: '#/components/schemas/RanNasRelCause' + minItems: 1 + description: Contains the RAN and/or NAS release cause. + accuUsageReports: + type: array + items: + $ref: '#/components/schemas/AccuUsageReport' + minItems: 1 + description: Contains the usage report + pduSessRelCause: + $ref: '#/components/schemas/PduSessionRelCause' + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + QosCharacteristics: + description: Contains QoS characteristics for a non-standardized or a non-configured 5QI. + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + resourceType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/QosResourceType' + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevel' + packetDelayBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + packetErrorRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + averagingWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVol' + required: + - 5qi + - resourceType + - priorityLevel + - packetDelayBudget + - packetErrorRate + ChargingInformation: + description: Contains the addresses of the charging functions. + type: object + properties: + primaryChfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + secondaryChfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + primaryChfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + primaryChfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + secondaryChfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + secondaryChfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + required: + - primaryChfAddress + AccuUsageReport: + description: Contains the accumulated usage report information. + type: object + properties: + refUmIds: + type: string + description: An id referencing UsageMonitoringData objects associated with this usage report. + volUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + volUsageUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + volUsageDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + timeUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + nextVolUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextVolUsageUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextVolUsageDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextTimeUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - refUmIds + SmPolicyUpdateContextData: + description: Contains the policy control request trigger(s) that were met and the corresponding new value(s) or the error report of the policy enforcement. + type: object + properties: + repPolicyCtrlReqTriggers: + type: array + items: + $ref: '#/components/schemas/PolicyControlRequestTrigger' + minItems: 1 + description: The policy control reqeust trigges which are met. + accNetChIds: + type: array + items: + $ref: '#/components/schemas/AccNetChId' + minItems: 1 + description: Indicates the access network charging identifier for the PCC rule(s) or whole PDU session. + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + addAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + relAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + relIpv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + description: Indicates the IPv4 address domain + ipv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + relIpv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addIpv6AddrPrefixes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addRelIpv6AddrPrefixes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + relUeMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + subsSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authProfIndex: + type: string + description: Indicates the DN-AAA authorization profile index + subsDefQos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + vplmnQos: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/VplmnQos' + vplmnQosNotApp: + type: boolean + description: If it is included and set to true, indicates that the QoS constraints in the VPLMN are not applicable. + numOfPackFilter: + type: integer + description: Contains the number of supported packet filter for signalled QoS rules. + accuUsageReports: + type: array + items: + $ref: '#/components/schemas/AccuUsageReport' + minItems: 1 + description: Contains the usage report + 3gppPsDataOffStatus: + type: boolean + description: If it is included and set to true, the 3GPP PS Data Off is activated by the UE. + appDetectionInfos: + type: array + items: + $ref: '#/components/schemas/AppDetectionInfo' + minItems: 1 + description: Report the start/stop of the application traffic and detected SDF descriptions if applicable. + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Used to report the PCC rule failure. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Used to report the session rule failure. + qncReports: + type: array + items: + $ref: '#/components/schemas/QosNotificationControlInfo' + minItems: 1 + description: QoS Notification Control information. + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + userLocationInfoTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPraInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Reports the changes of presence reporting area. The praId attribute within the + PresenceInfo data type is the key of the map. + ueInitResReq: + $ref: '#/components/schemas/UeInitiatedResourceRequest' + refQosIndication: + type: boolean + description: > + If it is included and set to true, the reflective QoS is supported by the UE. If it is + included and set to false, the reflective QoS is revoked by the UE. + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + creditManageStatus: + $ref: '#/components/schemas/CreditManagementStatus' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + maPduInd: + $ref: '#/components/schemas/MaPduIndication' + atsssCapab: +# $ref: '#/components/schemas/AtsssCapability' + $ref: '#/components/schemas/NpcfAtsssCapability' + tsnBridgeInfo: + $ref: '#/components/schemas/TsnBridgeInfo' + tsnBridgeManCont: + $ref: '#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: '#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: '#/components/schemas/PortManagementContainer' + minItems: 1 + mulAddrInfos: + type: array + items: + $ref: '#/components/schemas/IpMulticastAddressInfo' + minItems: 1 + policyDecFailureReports: + type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + description: Contains the type(s) of failed policy decision and/or condition data. + invalidPolicyDecs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/InvalidParam' + minItems: 1 + description: Indicates the invalid parameters for the reported type(s) of the failed policy decision and/or condition data. + trafficDescriptors: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + pccRuleId: + type: string + description: Contains the identifier of the PCC rule which is used for traffic detection of event. + typesOfNotif: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + interGrpIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + pcfUeInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + nwdafDatas: + type: array + items: + $ref: '#/components/schemas/NwdafData' + minItems: 1 + nullable: true + anGwStatus: + type: boolean + description: > + When it is included and set to true, it indicates that the AN-Gateway has failed and + that the PCF should refrain from sending policy decisions to the SMF until it is + informed that the AN-Gateway has been recovered. + UpPathChgEvent: + description: Contains the UP path change event subscription from the AF. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorreId: + type: string + description: It is used to set the value of Notification Correlation ID in the notification sent by the SMF. + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + afAckInd: + type: boolean + required: + - notificationUri + - notifCorreId + - dnaiChgType + nullable: true + TerminationNotification: + description: Represents a Termination Notification. + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + cause: + $ref: '#/components/schemas/SmPolicyAssociationReleaseCause' + required: + - resourceUri + - cause + AppDetectionInfo: + description: Contains the detected application's traffic information. + type: object + properties: + appId: + type: string + description: A reference to the application detection filter configured at the UPF + instanceId: + type: string + description: > + Identifier sent by the SMF in order to allow correlation of application Start and Stop + events to the specific service data flow description, if service data flow descriptions + are deducible. + sdfDescriptions: + type: array + items: + $ref: '#/components/schemas/FlowInformation' + minItems: 1 + description: Contains the detected service data flow descriptions if they are deducible. + required: + - appId + AccNetChId: + description: Contains the access network charging identifier for the PCC rule(s) or for the whole PDU session. + type: object + properties: + accNetChaIdValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + accNetChargId: + type: string + description: A character string containing the access network charging id. + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the PCC rule(s) associated to the provided Access Network Charging Identifier. + sessionChScope: + type: boolean + description: When it is included and set to true, indicates the Access Network Charging Identifier applies to the whole PDU Session + oneOf: + - required: [accNetChaIdValue] + - required: [accNetChargId] + AccNetChargingAddress: + description: Describes the network entity within the access network performing charging + type: object + anyOf: + - required: [anChargIpv4Addr] + - required: [anChargIpv6Addr] + properties: + anChargIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anChargIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + RequestedRuleData: + description: Contains rule data requested by the PCF to receive information associated with PCC rule(s). + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the control data. + reqData: + type: array + items: + $ref: '#/components/schemas/RequestedRuleDataType' + minItems: 1 + description: Array of requested rule data type elements indicating what type of rule data is requested for the corresponding referenced PCC rules. + required: + - refPccRuleIds + - reqData + RequestedUsageData: + description: Contains usage data requested by the PCF requesting usage reports for the corresponding usage monitoring data instances. + type: object + properties: + refUmIds: + type: array + items: + type: string + minItems: 1 + description: > + An array of usage monitoring data id references to the usage monitoring data instances + for which the PCF is requesting a usage report. This attribute shall only be provided + when allUmIds is not set to true. + allUmIds: + type: boolean + description: > + This boolean indicates whether requested usage data applies to all usage monitoring data + instances. When it's not included, it means requested usage data shall only apply to the + usage monitoring data instances referenced by the refUmIds attribute. + UeCampingRep: + description: Contains the current applicable values corresponding to the policy control request triggers. + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + netLocAccSupp: + $ref: '#/components/schemas/NetLocAccessSupport' + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + RuleReport: + description: Reports the status of PCC. + type: object + properties: + pccRuleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the affected PCC rule(s). + ruleStatus: + $ref: '#/components/schemas/RuleStatus' + contVers: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + minItems: 1 + description: Indicates the version of a PCC rule. + failureCode: + $ref: '#/components/schemas/FailureCode' + finUnitAct: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/FinalUnitAction' + ranNasRelCauses: + type: array + items: + $ref: '#/components/schemas/RanNasRelCause' + minItems: 1 + description: indicates the RAN or NAS release cause code information. + altQosParamId: + type: string + required: + - pccRuleIds + - ruleStatus + RanNasRelCause: + description: Contains the RAN/NAS release cause. + type: object + properties: + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + 5gSmCause: + $ref: '#/components/schemas/5GSmCause' + epsCause: + $ref: '#/components/schemas/EpsRanNasRelCause' + UeInitiatedResourceRequest: + description: Indicates that a UE requests specific QoS handling for the selected SDF. + type: object + properties: + pccRuleId: + type: string + ruleOp: + $ref: '#/components/schemas/RuleOperation' + precedence: + type: integer + packFiltInfo: + type: array + items: + $ref: '#/components/schemas/PacketFilterInfo' + minItems: 1 + reqQos: + $ref: '#/components/schemas/RequestedQos' + required: + - ruleOp + - packFiltInfo + PacketFilterInfo: + description: Contains the information from a single packet filter sent from the SMF to the PCF. + type: object + properties: + packFiltId: + type: string + description: An identifier of packet filter. + packFiltCont: + $ref: '#/components/schemas/PacketFilterContent' + tosTrafficClass: + type: string + description: Contains the Ipv4 Type-of-Service and mask field or the Ipv6 Traffic-Class field and mask field. + spi: + type: string + description: The security parameter index of the IPSec packet. + flowLabel: + type: string + description: The Ipv6 flow label header field. + flowDirection: + $ref: '#/components/schemas/FlowDirection' + RequestedQos: + description: Contains the QoS information requested by the UE. + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + required: + - 5qi + QosNotificationControlInfo: + description: Contains the QoS Notification Control Information. + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the QoS notification control info. + notifType: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/QosNotifType' + contVer: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + altQosParamId: + type: string + required: + - refPccRuleIds + - notifType + PartialSuccessReport: + description: Includes the information reported by the SMF when some of the PCC rules and/or session rules are not successfully installed/activated. + type: object + properties: + failureCause: + $ref: '#/components/schemas/FailureCause' + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Information about the PCC rules provisioned by the PCF not successfully installed/activated. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Information about the session rules provisioned by the PCF not successfully installed. + ueCampingRep: + $ref: '#/components/schemas/UeCampingRep' + policyDecFailureReports: + type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + description: Contains the type(s) of failed policy decision and/or condition data. + invalidPolicyDecs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/InvalidParam' + minItems: 1 + description: Indicates the invalid parameters for the reported type(s) of the failed policy decision and/or condition data. + required: + - failureCause + AuthorizedDefaultQos: + description: Represents the Authorized Default QoS. + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevelRm' + averWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindowRm' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVolRm' + maxbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + ErrorReport: + description: Contains the rule error reports. + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Used to report the PCC rule failure. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Used to report the session rule failure. + polDecFailureReports: + type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + description: Used to report failure of the policy decision and/or condition data. + invalidPolicyDecs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/InvalidParam' + minItems: 1 + description: Indicates the invalid parameters for the reported type(s) of the failed policy decision and/or condition data. + SessionRuleReport: + description: Represents reporting of the status of a session rule. + type: object + properties: + ruleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the affected session rule(s). + ruleStatus: + $ref: '#/components/schemas/RuleStatus' + sessRuleFailureCode: + $ref: '#/components/schemas/SessionRuleFailureCode' + policyDecFailureReports: + type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + description: Contains the type(s) of failed policy decision and/or condition data. + required: + - ruleIds + - ruleStatus + ServingNfIdentity: + description: Contains the serving Network Function identity. + type: object + properties: + servNfInstId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + anGwAddr: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AnGwAddress' + sgsnAddr: + $ref: '#/components/schemas/SgsnAddress' + SteeringMode: + description: Contains the steering mode value and parameters determined by the PCF. + type: object + properties: + steerModeValue: + $ref: '#/components/schemas/SteerModeValue' + active: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + standby: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessTypeRm' + 3gLoad: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + prioAcc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + thresValue: + $ref: '#/components/schemas/ThresholdValue' + steerModeInd: + $ref: '#/components/schemas/SteerModeIndicator' + required: + - steerModeValue + AdditionalAccessInfo: + description: Indicates the combination of additional Access Type and RAT Type for a MA PDU session. + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + required: + - accessType + QosMonitoringData: + description: Contains QoS monitoring related control information. + type: object + properties: + qmId: + type: string + description: Univocally identifies the QoS monitoring policy data within a PDU session. + reqQosMonParams: + type: array + items: + $ref: '#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + description: > + indicates the UL packet delay, DL packet delay and/or round trip packet delay between + the UE and the UPF is to be monitored when the QoS Monitoring for URLLC is enabled for + the service data flow. + repFreqs: + type: array + items: + $ref: '#/components/schemas/ReportingFrequency' + minItems: 1 + repThreshDl: + type: integer + description: Indicates the period of time in units of miliiseconds for DL packet delay. + nullable: true + repThreshUl: + type: integer + description: Indicates the period of time in units of miliiseconds for UL packet delay. + nullable: true + repThreshRp: + type: integer + description: Indicates the period of time in units of miliiseconds for round trip packet delay. + nullable: true + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriRm' + notifyCorreId: + type: string + nullable: true + directNotifInd: + type: boolean + description: Indicates that the direct event notification sent by UPF to the Local NEF or AF is requested if it is included and set to true. + required: + - qmId + - reqQosMonParams + - repFreqs + nullable: true + QosMonitoringReport: + description: Contains reporting information on QoS monitoring. + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the QoS monitoring report. + ulDelays: + type: array + items: + type: integer + minItems: 1 + dlDelays: + type: array + items: + type: integer + minItems: 1 + rtDelays: + type: array + items: + type: integer + minItems: 1 + required: + - refPccRuleIds +# + TsnBridgeInfo: + description: Contains parameters that describe and identify the TSC user plane node. + type: object + properties: + bridgeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + dsttAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + dsttPortNum: + $ref: '#/components/schemas/TsnPortNumber' + dsttResidTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' +# + PortManagementContainer: + description: Contains the port management information container for a port. + type: object + properties: + portManCont: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + portNum: + $ref: '#/components/schemas/TsnPortNumber' + required: + - portManCont + - portNum + BridgeManagementContainer: + description: Contains the UMIC. + type: object + properties: + bridgeManCont: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + required: + - bridgeManCont + IpMulticastAddressInfo: + description: Contains the IP multicast addressing information. + type: object + properties: + srcIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv4MulAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + srcIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6MulAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + DownlinkDataNotificationControl: + description: Contains the downlink data notification control information. + type: object + properties: + notifCtrlInds: + type: array + items: + $ref: '#/components/schemas/NotificationControlIndication' + minItems: 1 + typesOfNotif: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + DownlinkDataNotificationControlRm: + description: This data type is defined in the same way as the DownlinkDataNotificationControl data type, but with the nullable:true property. + type: object + properties: + notifCtrlInds: + type: array + items: + $ref: '#/components/schemas/NotificationControlIndication' + minItems: 1 + nullable: true + typesOfNotif: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + nullable: true + nullable: true + ThresholdValue: + description: Indicates the threshold value(s) for RTT and/or Packet Loss Rate. + type: object + properties: + rttThres: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + plrThres: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + nullable: true + NwdafData: + description: Indicates the list of Analytic ID(s) per NWDAF instance ID used for the PDU Session consumed by the SMF. + type: object + properties: + nwdafInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nwdafEvents: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + minItems: 1 + required: + - nwdafInstanceId + 5GSmCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + EpsRanNasRelCause: + type: string + description: Defines the EPS RAN/NAS release cause. + PacketFilterContent: + type: string + description: Defines a packet filter for an IP flow. + FlowDescription: + type: string + description: Defines a packet filter for an IP flow. + TsnPortNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + ApplicationDescriptor: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + FlowDirection: +# anyOf: +# - type: string + enum: + - DOWNLINK + - UPLINK + - BIDIRECTIONAL + - UNSPECIFIED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - DOWNLINK: The corresponding filter applies for traffic to the UE. +# - UPLINK: The corresponding filter applies for traffic from the UE. +# - BIDIRECTIONAL: The corresponding filter applies for traffic both to and from the UE. +# - UNSPECIFIED: The corresponding filter applies for traffic to the UE (downlink), but has no specific direction declared. The service data flow detection shall apply the filter for uplink traffic as if the filter was bidirectional. The PCF shall not use the value UNSPECIFIED in filters created by the network in NW-initiated procedures. The PCF shall only include the value UNSPECIFIED in filters in UE-initiated procedures if the same value is received from the SMF. + FlowDirectionRm: + description: This data type is defined in the same way as the "FlowDirection" data type, with the only difference that it allows null value. + anyOf: + - $ref: '#/components/schemas/FlowDirection' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + ReportingLevel: +# anyOf: +# - type: string + enum: + - SER_ID_LEVEL + - RAT_GR_LEVEL + - SPON_CON_LEVEL +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - SER_ID_LEVEL: Indicates that the usage shall be reported on service id and rating group combination level. +# - RAT_GR_LEVEL: Indicates that the usage shall be reported on rating group level. +# - SPON_CON_LEVEL: Indicates that the usage shall be reported on sponsor identity and rating group combination level. + MeteringMethod: +# anyOf: +# - type: string + enum: + - DURATION + - VOLUME + - DURATION_VOLUME + - EVENT +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - DURATION: Indicates that the duration of the service data flow traffic shall be metered. +# - VOLUME: Indicates that volume of the service data flow traffic shall be metered. +# - DURATION_VOLUME: Indicates that the duration and the volume of the service data flow traffic shall be metered. +# - EVENT: Indicates that events of the service data flow traffic shall be metered. + PolicyControlRequestTrigger: +# anyOf: +# - type: string + enum: + - PLMN_CH + - RES_MO_RE + - AC_TY_CH + - UE_IP_CH + - UE_MAC_CH + - AN_CH_COR + - US_RE + - APP_STA + - APP_STO + - AN_INFO + - CM_SES_FAIL + - PS_DA_OFF + - DEF_QOS_CH + - SE_AMBR_CH + - QOS_NOTIF + - NO_CREDIT + - REALLO_OF_CREDIT + - PRA_CH + - SAREA_CH + - SCNN_CH + - RE_TIMEOUT + - RES_RELEASE + - SUCC_RES_ALLO + - RAI_CH + - RAT_TY_CH + - REF_QOS_IND_CH + - NUM_OF_PACKET_FILTER + - UE_STATUS_RESUME + - UE_TZ_CH + - AUTH_PROF_CH + - QOS_MONITORING + - SCELL_CH + - USER_LOCATION_CH + - EPS_FALLBACK + - MA_PDU + - TSN_BRIDGE_INFO + - 5G_RG_JOIN + - 5G_RG_LEAVE + - DDN_FAILURE + - DDN_DELIVERY_STATUS + - GROUP_ID_LIST_CHG + - DDN_FAILURE_CANCELLATION + - DDN_DELIVERY_STATUS_CANCELLATION + - VPLMN_QOS_CH + - SUCC_QOS_UPDATE + - SAT_CATEGORY_CHG + - PCF_UE_NOTIF_IND + - NWDAF_DATA_CHG +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - PLMN_CH: PLMN Change +# - RES_MO_RE: A request for resource modification has been received by the SMF. The SMF always reports to the PCF. +# - AC_TY_CH: Access Type Change +# - UE_IP_CH: UE IP address change. The SMF always reports to the PCF. +# - UE_MAC_CH: A new UE MAC address is detected or a used UE MAC address is inactive for a specific period +# - AN_CH_COR: Access Network Charging Correlation Information +# - US_RE: The PDU Session or the Monitoring key specific resources consumed by a UE either reached the threshold or needs to be reported for other reasons. +# - APP_STA: The start of application traffic has been detected. +# - APP_STO: The stop of application traffic has been detected. +# - AN_INFO: Access Network Information report +# - CM_SES_FAIL: Credit management session failure +# - PS_DA_OFF: The SMF reports when the 3GPP PS Data Off status changes. The SMF always reports to the PCF. +# - DEF_QOS_CH: Default QoS Change. The SMF always reports to the PCF. +# - SE_AMBR_CH: Session-AMBR Change. The SMF always reports to the PCF. +# - QOS_NOTIF: The SMF notify the PCF when receiving notification from RAN that QoS targets of the QoS Flow cannot be guranteed or gurateed again. +# - NO_CREDIT: Out of credit +# - REALLO_OF_CREDIT: Reallocation of credit +# - PRA_CH: Change of UE presence in Presence Reporting Area +# - SAREA_CH: Location Change with respect to the Serving Area +# - SCNN_CH: Location Change with respect to the Serving CN node +# - RE_TIMEOUT: Indicates the SMF generated the request because there has been a PCC revalidation timeout +# - RES_RELEASE: Indicate that the SMF can inform the PCF of the outcome of the release of resources for those rules that require so. +# - SUCC_RES_ALLO: Indicates that the requested rule data is the successful resource allocation. +# - RAI_CH: Location Change with respect to the RAI of GERAN and UTRAN. +# - RAT_TY_CH: RAT Type Change. +# - REF_QOS_IND_CH: Reflective QoS indication Change +# - NUM_OF_PACKET_FILTER: Indicates that the SMF shall report the number of supported packet filter for signalled QoS rules +# - UE_STATUS_RESUME: Indicates that the UE's status is resumed. +# - UE_TZ_CH: UE Time Zone Change +# - AUTH_PROF_CH: The DN-AAA authorization profile index has changed +# - QOS_MONITORING: Indicate that the SMF notifies the PCF of the QoS Monitoring information. +# - SCELL_CH: Location Change with respect to the Serving Cell. +# - USER_LOCATION_CH: Indicate that user location has been changed, applicable to serving area change and serving cell change. +# - EPS_FALLBACK: EPS Fallback report is enabled in the SMF. +# - MA_PDU: UE Indicates that the SMF notifies the PCF of the MA PDU session request +# - TSN_BRIDGE_INFO: TSC user plane node information available +# - 5G_RG_JOIN: The 5G-RG has joined to an IP Multicast Group. +# - 5G_RG_LEAVE: The 5G-RG has left an IP Multicast Group. +# - DDN_FAILURE: Event subscription for DDN Failure event received. +# - DDN_DELIVERY_STATUS: Event subscription for DDN Delivery Status received. +# - GROUP_ID_LIST_CHG: UE Internal Group Identifier(s) has changed: the SMF reports that UDM provided list of group Ids has changed. +# - DDN_FAILURE_CANCELLATION: The event subscription for DDN Failure event is cancelled. +# - DDN_DELIVERY_STATUS_CANCELLATION: The event subscription for DDD STATUS is cancelled. +# - VPLMN_QOS_CH: Change of the QoS supported in the VPLMN. +# - SUCC_QOS_UPDATE: Indicates that the requested MPS Action is successful. +# - SAT_CATEGORY_CHG: Indicates that the SMF has detected a change between different satellite backhaul categories, or between a satellite backhaul and a non-satellite backhaul. +# - PCF_UE_NOTIF_IND: Indicates the SMF has detected the AMF forwarded the PCF for the UE indication to receive/stop receiving notifications of SM Policy association established/terminated events. +# - NWDAF_DATA_CHG: Indicates that the NWDAF instance IDs used for the PDU session and/or associated Analytics IDs used for the PDU session and available in the SMF have changed. + RequestedRuleDataType: +# anyOf: +# - type: string + enum: + - CH_ID + - MS_TIME_ZONE + - USER_LOC_INFO + - RES_RELEASE + - SUCC_RES_ALLO + - EPS_FALLBACK +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - CH_ID: Indicates that the requested rule data is the charging identifier. +# - MS_TIME_ZONE: Indicates that the requested access network info type is the UE's timezone. +# - USER_LOC_INFO: Indicates that the requested access network info type is the UE's location. +# - RES_RELEASE: Indicates that the requested rule data is the result of the release of resource. +# - SUCC_RES_ALLO: Indicates that the requested rule data is the successful resource allocation. +# - EPS_FALLBACK: Indicates that the requested rule data is the report of QoS flow rejection due to EPS fallback. + RuleStatus: +# anyOf: +# - type: string + enum: + - ACTIVE + - INACTIVE +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - ACTIVE: Indicates that the PCC rule(s) are successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF), or the session rule(s) are successfully installed +# - INACTIVE: Indicates that the PCC rule(s) are removed (for those provisioned from PCF) or inactive (for those pre-defined in SMF) or the session rule(s) are removed. + FailureCode: +# anyOf: +# - type: string + enum: + - UNK_RULE_ID + - RA_GR_ERR + - SER_ID_ERR + - NF_MAL + - RES_LIM + - MAX_NR_QoS_FLOW + - MISS_FLOW_INFO + - RES_ALLO_FAIL + - UNSUCC_QOS_VAL + - INCOR_FLOW_INFO + - PS_TO_CS_HAN + - APP_ID_ERR + - NO_QOS_FLOW_BOUND + - FILTER_RES + - MISS_REDI_SER_ADDR + - CM_END_USER_SER_DENIED + - CM_CREDIT_CON_NOT_APP + - CM_AUTH_REJ + - CM_USER_UNK + - CM_RAT_FAILED + - UE_STA_SUSP + - UNKNOWN_REF_ID + - INCORRECT_COND_DATA + - REF_ID_COLLISION + - TRAFFIC_STEERING_ERROR + - DNAI_STEERING_ERROR + - AN_GW_FAILE + - MAX_NR_PACKET_FILTERS_EXCEEDED + - PACKET_FILTER_TFT_ALLOCATION_EXCEEDED + - MUTE_CHG_NOT_ALLOWED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - UNK_RULE_ID: Indicates that the pre-provisioned PCC rule could not be successfully activated because the PCC rule identifier is unknown to the SMF. +# - RA_GR_ERR: Indicate that the PCC rule could not be successfully installed or enforced because the Rating Group specified within the Charging Data policy decision which the PCC rule refers to is unknown or, invalid. +# - SER_ID_ERR: Indicate that the PCC rule could not be successfully installed or enforced because the Service Identifier specified within the Charging Data policy decision which the PCC rule refers to is invalid, unknown, or not applicable to the service being charged. +# - NF_MAL: Indicate that the PCC rule could not be successfully installed (for those provisioned from the PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to SMF/UPF malfunction. +# - RES_LIM: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to a limitation of resources at the SMF/UPF. +# - MAX_NR_QoS_FLOW: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to the fact that the maximum number of QoS flows has been reached for the PDU session. +# - MISS_FLOW_INFO: Indicate that the PCC rule could not be successfully installed or enforced because neither the "flowInfos" attribute nor the "appId" attribute is specified within the PccRule data structure by the PCF during the first install request of the PCC rule. +# - RES_ALLO_FAIL: Indicate that the PCC rule could not be successfully installed or maintained since the QoS flow establishment/modification failed, or the QoS flow was released. +# - UNSUCC_QOS_VAL: indicate that the QoS validation has failed or when Guaranteed Bandwidth > Max-Requested-Bandwidth. +# - INCOR_FLOW_INFO: Indicate that the PCC rule could not be successfully installed or modified at the SMF because the provided flow information is not supported by the network (e.g. the provided IP address(es) or Ipv6 prefix(es) do not correspond to an IP version applicable for the PDU session). +# - PS_TO_CS_HAN: Indicate that the PCC rule could not be maintained because of PS to CS handover. +# - APP_ID_ERR: Indicate that the rule could not be successfully installed or enforced because the Application Identifier is invalid, unknown, or not applicable to the application required for detection. +# - NO_QOS_FLOW_BOUND: Indicate that there is no QoS flow which the SMF can bind the PCC rule(s) to. +# - FILTER_RES: Indicate that the Flow Information within the "flowInfos" attribute cannot be handled by the SMF because any of the restrictions defined in clause 5.4.2 of 3GPP TS 29.212 was not met. +# - MISS_REDI_SER_ADDR: Indicate that the PCC rule could not be successfully installed or enforced at the SMF because there is no valid Redirect Server Address within the Traffic Control Data policy decision which the PCC rule refers to provided by the PCF and no preconfigured redirection address for this PCC rule at the SMF. +# - CM_END_USER_SER_DENIED: Indicate that the charging system denied the service request due to service restrictions (e.g. terminate rating group) or limitations related to the end-user, for example the end-user's account could not cover the requested service. +# - CM_CREDIT_CON_NOT_APP: Indicate that the charging system determined that the service can be granted to the end user but no further credit control is needed for the service (e.g. service is free of charge or is treated for offline charging). +# - CM_AUTH_REJ: Indicate that the charging system denied the service request in order to terminate the service for which credit is requested. +# - CM_USER_UNK: Indicate that the specified end user could not be found in the charging system. +# - CM_RAT_FAILED: Indicate that the charging system cannot rate the service request due to insufficient rating input, incorrect AVP combination or due to an attribute or an attribute value that is not recognized or supported in the rating. +# - UE_STA_SUSP: Indicates that the UE is in suspend state. +# - UNKNOWN_REF_ID: Indicates that the PCC rule could not be successfully installed/modified because the referenced identifier to a Policy Decision Data or to a Condition Data is unknown to the SMF. +# - INCORRECT_COND_DATA: Indicates that the PCC rule could not be successfully installed/modified because the referenced Condition data are incorrect. +# - REF_ID_COLLISION: Indicates that PCC rule could not be successfully installed/modified because the same Policy Decision is referenced by a session rule (e.g. the session rule and the PCC rule refer to the same Usage Monitoring decision data). +# - TRAFFIC_STEERING_ERROR: Indicates that enforcement of the steering of traffic to the N6-LAN or 5G-LAN failed; or the dynamic PCC rule could not be successfully installed or modified at the NF service consumer because there are invalid traffic steering policy identifier(s) within the provided Traffic Control Data policy decision to which the PCC rule refers. +# - DNAI_STEERING_ERROR: Indicates that the enforcement of the steering of traffic to the indicated DNAI failed; or the dynamic PCC rule could not be successfully installed or modified at the NF service consumer because there is invalid route information for a DNAI(s) (e.g. routing profile id is not configured) within the provided Traffic Control Data policy decision to which the PCC rule refers. +# - AN_GW_FAILED: This value is used to indicate that the AN-Gateway has failed and that the PCF should refrain from sending policy decisions to the SMF until it is informed that the S-GW has been recovered. This value shall not be used if the SM Policy association modification procedure is initiated for PCC rule removal only. +# - MAX_NR_PACKET_FILTERS_EXCEEDED: This value is used to indicate that the PCC rule could not be successfully installed, modified or enforced at the NF service consumer because the number of supported packet filters for signalled QoS rules for the PDU session has been reached. +# - PACKET_FILTER_TFT_ALLOCATION_EXCEEDED: This value is used to indicate that the PCC rule is removed at 5GS to EPS mobility because TFT allocation was not possible since the number of active packet filters in the EPC bearer is exceeded. +# - MUTE_CHG_NOT_ALLOWED: Indicates that the PCC rule could not be successfully modified because the mute condition for application detection report cannot be changed. Applicable when the functionality introduced with the ADC feature applies. + AfSigProtocol: +# anyOf: +# - type: string + enum: + - NO_INFORMATION + - SIP +# - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - NO_INFORMATION: Indicate that no information about the AF signalling protocol is being provided. +# - SIP: Indicate that the signalling protocol is Session Initiation Protocol. + RuleOperation: + enum: + - CREATE_PCC_RULE + - DELETE_PCC_RULE + - MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS + - MODIFY_PCC_RULE_AND_REPLACE_PACKET_FILTERS + - MODIFY_PCC_RULE_AND_DELETE_PACKET_FILTERS + - MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS +# anyOf: +# - type: string +# enum: +# - CREATE_PCC_RULE +# - DELETE_PCC_RULE +# - MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS +# - MODIFY_ PCC_RULE_AND_REPLACE_PACKET_FILTERS +# - MODIFY_ PCC_RULE_AND_DELETE_PACKET_FILTERS +# - MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - CREATE_PCC_RULE: Indicates to create a new PCC rule to reserve the resource requested by the UE. +# - DELETE_PCC_RULE: Indicates to delete a PCC rule corresponding to reserve the resource requested by the UE. +# - MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS: Indicates to modify the PCC rule by adding new packet filter(s). +# - MODIFY_ PCC_RULE_AND_REPLACE_PACKET_FILTERS: Indicates to modify the PCC rule by replacing the existing packet filter(s). +# - MODIFY_ PCC_RULE_AND_DELETE_PACKET_FILTERS: Indicates to modify the PCC rule by deleting the existing packet filter(s). +# - MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS: Indicates to modify the PCC rule by modifying the QoS of the PCC rule. + RedirectAddressType: +# anyOf: +# - type: string + enum: + - IPV4_ADDR + - IPV6_ADDR + - URL + - SIP_URI +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - IPV4_ADDR: Indicates that the address type is in the form of "dotted-decimal" IPv4 address. +# - IPV6_ADDR: Indicates that the address type is in the form of IPv6 address. +# - URL: Indicates that the address type is in the form of Uniform Resource Locator. +# - SIP_URI: Indicates that the address type is in the form of SIP Uniform Resource Identifier. + QosFlowUsage: +# anyOf: +# - type: string + enum: + - GENERAL + - IMS_SIG +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - GENERAL: Indicate no specific QoS flow usage information is available. +# - IMS_SIG: Indicate that the QoS flow is used for IMS signalling only. + FailureCause: +# description: Indicates the cause of the failure in a Partial Success Report. +# anyOf: +# - type: string + enum: + - PCC_RULE_EVENT + - PCC_QOS_FLOW_EVENT + - RULE_PERMANENT_ERROR + - RULE_TEMPORARY_ERROR + - POL_DEC_ERROR +# - type: string + CreditManagementStatus: +# description: Indicates the reason of the credit management session failure. +# anyOf: +# - type: string + enum: + - END_USER_SER_DENIED + - CREDIT_CTRL_NOT_APP + - AUTH_REJECTED + - USER_UNKNOWN + - RATING_FAILED +# - type: string + SessionRuleFailureCode: +# anyOf: +# - type: string + enum: + - NF_MAL + - RES_LIM + - SESSION_RESOURCE_ALLOCATION_FAILURE + - UNSUCC_QOS_VAL + - INCORRECT_UM + - UE_STA_SUSP + - UNKNOWN_REF_ID + - INCORRECT_COND_DATA + - REF_ID_COLLISION + - AN_GW_FAILED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - NF_MAL: Indicates that the PCC rule could not be successfully installed (for those provisioned from the PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to SMF/UPF malfunction. +# - RES_LIM: Indicates that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to a limitation of resources at the SMF/UPF. +# - SESSION_RESOURCE_ALLOCATION_FAILURE: Indicates the session rule could not be successfully enforced due to failure during the allocation of resources for the PDU session in the UE, RAN or AMF. +# - UNSUCC_QOS_VAL: indicates that the QoS validation has failed. +# - INCORRECT_UM: The usage monitoring data of the enforced session rule is not the same for all the provisioned session rule(s). +# - UE_STA_SUSP: Indicates that the UE is in suspend state. +# - UNKNOWN_REF_ID: Indicates that the session rule could not be successfully installed/modified because the referenced identifier to a Policy Decision Data or to a Condition Data is unknown to the SMF. +# - INCORRECT_COND_DATA: Indicates that the session rule could not be successfully installed/modified because the referenced Condition data are incorrect. +# - REF_ID_COLLISION: Indicates that the session rule could not be successfully installed/modified because the same Policy Decision is referenced by a PCC rule (e.g. the session rule and the PCC rule refer to the same Usage Monitoring decision data). +# - AN_GW_FAILED: Indicates that the AN-Gateway has failed and that the PCF should refrain from sending policy decisions to the SMF until it is informed that the S-GW has been recovered. This value shall not be used if the SM Policy association modification procedure is initiated for session rule removal only. + SteeringFunctionality: +# anyOf: +# - type: string + enum: + - MPTCP + - ATSSS_LL +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - MPTCP: Indicates that PCF authorizes the MPTCP functionality to support traffic steering, switching and splitting. +# - ATSSS_LL: Indicates that PCF authorizes the ATSSS-LL functionality to support traffic steering, switching and splitting. + SteerModeValue: +# description: Indicates the steering mode value determined by the PCF. +# anyOf: +# - type: string + enum: + - ACTIVE_STANDBY + - LOAD_BALANCING + - SMALLEST_DELAY + - PRIORITY_BASED +# - type: string +# MulticastAccessControl: + NpcfMulticastAccessControl: +# description: Indicates whether the service data flow, corresponding to the service data flow template, is allowed or not allowed. +# anyOf: +# - type: string + enum: + - ALLOWED + - NOT_ALLOWED +# - type: string + RequestedQosMonitoringParameter: +# description: Indicates the requested QoS monitoring parameters to be measured. +# anyOf: +# - type: string + enum: + - DOWNLINK + - UPLINK + - ROUND_TRIP +# - type: string + ReportingFrequency: +# description: Indicates the frequency for the reporting. +# anyOf: +# - type: string + enum: + - EVENT_TRIGGERED + - PERIODIC + - SESSION_RELEASE +# - type: string + SgsnAddress: + description: describes the address of the SGSN + type: object + anyOf: + - required: [sgsnIpv4Addr] + - required: [sgsnIpv6Addr] + properties: + sgsnIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + sgsnIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + SmPolicyAssociationReleaseCause: +# description: Represents the cause due to which the PCF requests the termination of the SM policy association. +# anyOf: +# - type: string + enum: + - UNSPECIFIED + - UE_SUBSCRIPTION + - INSUFFICIENT_RES + - VALIDATION_CONDITION_NOT_MET + - REACTIVATION_REQUESTED +# - type: string + PduSessionRelCause: +# description: Contains the SMF PDU Session release cause. +# anyOf: +# - type: string + enum: + - PS_TO_CS_HO + - RULE_ERROR +# - type: string + MaPduIndication: +# description: Contains the MA PDU session indication, i.e., MA PDU Request or MA PDU Network-Upgrade Allowed. +# anyOf: +# - type: string + enum: + - MA_PDU_REQUEST + - MA_PDU_NETWORK_UPGRADE_ALLOWED +# - type: string +# AtsssCapability: + NpcfAtsssCapability: +# description: Contains the ATSSS capability supported for the MA PDU Session. +# anyOf: +# - type: string + enum: + - MPTCP_ATSSS_LL_WITH_ASMODE_UL + - MPTCP_ATSSS_LL_WITH_EXSDMODE_DL_ASMODE_UL + - MPTCP_ATSSS_LL_WITH_ASMODE_DLUL + - ATSSS_LL + - MPTCP_ATSSS_LL +# - type: string +# + NetLocAccessSupport: +# anyOf: +# - type: string + enum: + - ANR_NOT_SUPPORTED + - TZR_NOT_SUPPORTED + - LOC_NOT_SUPPORTED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are +# - ANR_NOT_SUPPORTED: Indicates that the access network does not support the report of access network information. +# - TZR_NOT_SUPPORTED: Indicates that the access network does not support the report of UE time zone. +# - LOC_NOT_SUPPORTED: Indicates that the access network does not support the report of UE Location (or PLMN Id). + PolicyDecisionFailureCode: +# description: Indicates the type of the failed policy decision and/or condition data. +# anyOf: +# - type: string + enum: + - TRA_CTRL_DECS_ERR + - QOS_DECS_ERR + - CHG_DECS_ERR + - USA_MON_DECS_ERR + - QOS_MON_DECS_ERR + - CON_DATA_ERR + - POLICY_PARAM_ERR +# - type: string +# + NotificationControlIndication: +# description: Indicates that the notification of DDD Status is requested and/or that the notification of DDN Failure is requested. +# anyOf: +# - type: string + enum: + - DDN_FAILURE + - DDD_STATUS +# - type: string +# + SteerModeIndicator: +# description: Contains Autonomous load-balance indicator or UE-assistance indicator. +# anyOf: +# - type: string + enum: + - AUTO_LOAD_BALANCE + - UE_ASSISTANCE +# - type: string +# diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29514_Npcf_PolicyAuthorization.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29514_Npcf_PolicyAuthorization.yaml new file mode 100644 index 000000000..3c36e3ce4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29514_Npcf_PolicyAuthorization.yaml @@ -0,0 +1,2088 @@ +openapi: 3.0.0 +info: + title: Npcf_PolicyAuthorization Service API + version: 1.2.1 + description: | + PCF Policy Authorization Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.514 V17.6.0; 5G System; Policy Authorization Service; Stage 3. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.514/' +# +servers: + - url: '{apiRoot}/npcf-policyauthorization/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - npcf-policyauthorization +paths: + /app-sessions: + post: + summary: Creates a new Individual Application Session Context resource + operationId: PostAppSessions + tags: + - Application Sessions (Collection) + requestBody: + description: Contains the information for the creation the resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + responses: + '201': + description: Successful creation of the resource + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + headers: + Location: + description: > + Contains the URI of the created individual application session context resource, + according to the structure + {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId} + or the URI of the created events subscription sub-resource, + according to the structure + {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId}/events-subscription} + required: true + schema: + type: string + '303': + description: See Other. The result of the HTTP POST request would be equivalent to the existing Application Session Context. + headers: + Location: + description: Contains the URI of the existing individual Application Session Context resource. + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtendedProblemDetails' + headers: + Retry-After: + description: > + Indicates the time the AF has to wait before making a new request. It can be a + non-negative integer (decimal number) indicating the number of seconds the AF + has to wait before making a new request or an HTTP-date after which the AF can + retry a new request. + schema: + anyOf: + - type: integer + - type: string + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + terminationRequest: + '{$request.body#/ascReqData/notifUri}/terminate': + post: + requestBody: + description: Request of the termination of the Individual Application Session Context. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TerminationInfo' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + eventNotification: + '{$request.body#/ascReqData/evSubsc/notifUri}/notify': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + detected5GsBridgeForPduSession: + '{$request.body#/ascReqData/evSubsc/notifUri}/new-bridge': + post: + requestBody: + description: Notification of a new TSC user plane node detected in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionTsnBridge' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + eventNotificationPduSession: + '{$request.body#/ascReqData/evSubsc/notifUri}/pdu-session': + post: + requestBody: + description: Notification of PDU session established or terminated. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionEventNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /app-sessions/pcscf-restoration: + post: + summary: "Indicates P-CSCF restoration and does not create an Individual Application Session Context" + operationId: PcscfRestoration + tags: + - PCSCF Restoration Indication + requestBody: + description: PCSCF Restoration Indication. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationRequestData' + responses: + '204': + description: The deletion is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-sessions/{appSessionId}: + get: + summary: "Reads an existing Individual Application Session Context" + operationId: GetAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: String identifying the resource. + in: path + required: true + schema: + type: string + responses: + '200': + description: A representation of the resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: "Modifies an existing Individual Application Session Context" + operationId: ModAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: String identifying the resource. + in: path + required: true + schema: + type: string + requestBody: + description: Modification of the resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppSessionContextUpdateDataPatch' + responses: + '200': + description: Successful modification of the resource and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '204': + description: The successful modification. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtendedProblemDetails' + headers: + Retry-After: + description: > + Indicates the time the AF has to wait before making a new request. It can be a + non-negative integer (decimal number) indicating the number of seconds the AF has + to wait before making a new request or an HTTP-date after which the AF can retry + a new request. + schema: + anyOf: + - type: integer + - type: string + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + eventNotification: + '{$request.body#/ascReqData/evSubsc/notifUri}/notify': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# +# + /app-sessions/{appSessionId}/delete: + post: + summary: "Deletes an existing Individual Application Session Context" + operationId: DeleteAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: String identifying the Individual Application Session Context resource. + in: path + required: true + schema: + type: string + requestBody: + description: Deletion of the Individual Application Session Context resource, req notification. + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscReqData' + responses: + '200': + description: The deletion of the resource is confirmed and a resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '204': + description: The deletion is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-sessions/{appSessionId}/events-subscription: + put: + summary: "creates or modifies an Events Subscription subresource" + operationId: updateEventsSubsc + tags: + - Events Subscription (Document) + parameters: + - name: appSessionId + description: String identifying the Events Subscription resource. + in: path + required: true + schema: + type: string + requestBody: + description: Creation or modification of an Events Subscription resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscReqData' + responses: + '201': + description: The creation of the Events Subscription resource is confirmed and its representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscPutData' + headers: + Location: + description: > + Contains the URI of the created Events Subscription resource, + according to the structure + {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId}/events-subscription} + required: true + schema: + type: string + '200': + description: The modification of the Events Subscription resource is confirmed its representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscPutData' + '204': + description: The modification of the Events Subscription subresource is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + eventNotification: + '{$request.body#/notifUri}/notify': + post: + requestBody: + description: Contains the information for the notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: deletes the Events Subscription subresource + operationId: DeleteEventsSubsc + tags: + - Events Subscription (Document) + parameters: + - name: appSessionId + description: String identifying the Individual Application Session Context resource. + in: path + required: true + schema: + type: string + responses: + '204': + description: The deletion of the of the Events Subscription sub-resource is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-policyauthorization: Access to the Npcf_PolicyAuthorization API + schemas: + AppSessionContext: + description: Represents an Individual Application Session Context resource. + type: object + properties: + ascReqData: + $ref: '#/components/schemas/AppSessionContextReqData' + ascRespData: + $ref: '#/components/schemas/AppSessionContextRespData' + evsNotif: + $ref: '#/components/schemas/EventsNotification' + AppSessionContextReqData: + description: Identifies the service requirements of an Individual Application Session Context. + type: object + required: + - notifUri + - suppFeat + oneOf: + - required: [ueIpv4] + - required: [ueIpv6] + - required: [ueMac] + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afChargId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationChargingId' + afReqData: + $ref: '#/components/schemas/AfRequestedData' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirement' + aspId: + $ref: '#/components/schemas/AspId' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + evSubsc: + $ref: '#/components/schemas/EventsSubscReqData' + mcpttId: + description: Indication of MCPTT service request. + type: string + mcVideoId: + description: Indication of MCVideo service request. + type: string + medComponents: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponent' + minProperties: 1 + description: Contains media component information. The key of the map is the medCompN attribute. + ipDomain: + type: string + mpsAction: + $ref: '#/components/schemas/MpsAction' + mpsId: + description: Indication of MPS service request. + type: string + mcsId: + description: Indication of MCS service request. + type: string + preemptControlInfo: + $ref: '#/components/schemas/PreemptionControlInformation' + resPrio: + $ref: '#/components/schemas/ReservPriority' + servInfStatus: + $ref: '#/components/schemas/ServiceInfoStatus' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + servUrn: + $ref: '#/components/schemas/ServiceUrn' + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + sponId: + $ref: '#/components/schemas/SponId' + sponStatus: + $ref: '#/components/schemas/SponsoringStatus' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + tsnBridgeManCont: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + AppSessionContextRespData: + description: Describes the authorization data of an Individual Application Session Context created by the PCF. + type: object + properties: + servAuthInfo: + $ref: '#/components/schemas/ServAuthInfo' + ueIds: + type: array + items: + $ref: '#/components/schemas/UeIdentityInfo' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + AppSessionContextUpdateDataPatch: + description: Identifies the modifications to an Individual Application Session Context and/or the modifications to the sub-resource Events Subscription. + type: object + properties: + ascReqData: + $ref: '#/components/schemas/AppSessionContextUpdateData' + AppSessionContextUpdateData: + description: > + Identifies the modifications to the "ascReqData" property of an Individual Application + Session Context which may include the modifications to the sub-resource Events Subscription. + type: object + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirementRm' + aspId: + $ref: '#/components/schemas/AspId' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + evSubsc: + $ref: '#/components/schemas/EventsSubscReqDataRm' + mcpttId: + description: Indication of MCPTT service request. + type: string + mcVideoId: + description: Indication of modification of MCVideo service. + type: string + medComponents: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponentRm' + minProperties: 1 + description: Contains media component information. The key of the map is the medCompN attribute. + mpsAction: + $ref: '#/components/schemas/MpsAction' + mpsId: + description: Indication of MPS service request. + type: string + mcsId: + description: Indication of MCS service request. + type: string + preemptControlInfo: + $ref: '#/components/schemas/PreemptionControlInformationRm' + resPrio: + $ref: '#/components/schemas/ReservPriority' + servInfStatus: + $ref: '#/components/schemas/ServiceInfoStatus' + sipForkInd: + $ref: '#/components/schemas/SipForkingIndication' + sponId: + $ref: '#/components/schemas/SponId' + sponStatus: + $ref: '#/components/schemas/SponsoringStatus' + tsnBridgeManCont: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + EventsSubscReqData: + description: Identifies the events the application subscribes to. + type: object + required: + - events + properties: + events: + type: array + items: + $ref: '#/components/schemas/AfEventSubscription' + minItems: 1 + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + qosMon: + $ref: '#/components/schemas/QosMonitoringInformation' + reqAnis: + type: array + items: + $ref: '#/components/schemas/RequiredAccessInfo' + minItems: 1 + usgThres: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + notifCorreId: + type: string + afAppIds: + type: array + items: + $ref: '#/components/schemas/AfAppId' + minItems: 1 + directNotifInd: + type: boolean + EventsSubscReqDataRm: + description: This data type is defined in the same way as the EventsSubscReqData data type, but with the OpenAPI nullable property set to true. + type: object + required: + - events + properties: + events: + type: array + items: + $ref: '#/components/schemas/AfEventSubscription' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + qosMon: + $ref: '#/components/schemas/QosMonitoringInformationRm' + reqAnis: + type: array + items: + $ref: '#/components/schemas/RequiredAccessInfo' + minItems: 1 + usgThres: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThresholdRm' + notifCorreId: + type: string + directNotifInd: + type: boolean + nullable: true + nullable: true + MediaComponent: + description: Identifies a media component. + type: object + required: + - medCompN + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirement' + qosReference: + type: string + disUeNotif: + type: boolean + altSerReqs: + type: array + items: + type: string + minItems: 1 + altSerReqsData: + type: array + items: + $ref: '#/components/schemas/AlternativeServiceRequirementsData' + minItems: 1 + description: Contains alternative service requirements that include individual QoS parameter sets. + contVer: + $ref: '#/components/schemas/ContentVersion' + codecs: + type: array + items: + $ref: '#/components/schemas/CodecData' + minItems: 1 + maxItems: 2 + desMaxLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + desMaxLoss: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + flusId: + type: string + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxSuppBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxSuppBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + medCompN: + type: integer + medSubComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaSubComponent' + minProperties: 1 + description: Contains the requested bitrate and filters for the set of service data flows identified by their common flow identifier. The key of the map is the fNum attribute. + medType: + $ref: '#/components/schemas/MediaType' + minDesBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + minDesBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + preemptCap: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionVulnerability' + prioSharingInd: + $ref: '#/components/schemas/PrioritySharingIndicator' + resPrio: + $ref: '#/components/schemas/ReservPriority' + rrBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + rsBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + sharingKeyDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + sharingKeyUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + tsnQos: + $ref: '#/components/schemas/TsnQosContainer' + tscaiInputDl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + MediaComponentRm: + description: This data type is defined in the same way as the MediaComponent data type, but with the OpenAPI nullable property set to true. + type: object + required: + - medCompN + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirementRm' + qosReference: + type: string + nullable: true + altSerReqs: + type: array + items: + type: string + minItems: 1 + nullable: true + altSerReqsData: + type: array + items: + $ref: '#/components/schemas/AlternativeServiceRequirementsData' + minItems: 1 + description: Contains removable alternative service requirements that include individual QoS parameter sets. + nullable: true + disUeNotif: + type: boolean + contVer: + $ref: '#/components/schemas/ContentVersion' + codecs: + type: array + items: + $ref: '#/components/schemas/CodecData' + minItems: 1 + maxItems: 2 + desMaxLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FloatRm' + desMaxLoss: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FloatRm' + flusId: + type: string + nullable: true + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxSuppBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxSuppBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + medCompN: + type: integer + medSubComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaSubComponentRm' + minProperties: 1 + description: Contains the requested bitrate and filters for the set of service data flows identified by their common flow identifier. The key of the map is the fNum attribute. + medType: + $ref: '#/components/schemas/MediaType' + minDesBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + minDesBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + mirBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + mirBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + preemptCap: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionCapabilityRm' + preemptVuln: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionVulnerabilityRm' + prioSharingInd: + $ref: '#/components/schemas/PrioritySharingIndicator' + resPrio: + $ref: '#/components/schemas/ReservPriority' + rrBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + rsBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + sharingKeyDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32Rm' + sharingKeyUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32Rm' + tsnQos: + $ref: '#/components/schemas/TsnQosContainerRm' + tscaiInputDl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + nullable: true + MediaSubComponent: + description: Identifies a media subcomponent. + type: object + required: + - fNum + properties: + afSigProtocol: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AfSigProtocol' + ethfDescs: + type: array + items: + $ref: '#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + fNum: + type: integer + fDescs: + type: array + items: + $ref: '#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + tosTrCl: + $ref: '#/components/schemas/TosTrafficClass' + flowUsage: + $ref: '#/components/schemas/FlowUsage' + MediaSubComponentRm: + description: > + This data type is defined in the same way as the MediaSubComponent data type, but with the + OpenAPI nullable property set to true. Removable attributes marBwDl and marBwUl are defined + with the corresponding removable data type. + type: object + required: + - fNum + properties: + afSigProtocol: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AfSigProtocol' + ethfDescs: + type: array + items: + $ref: '#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + nullable: true + fNum: + type: integer + fDescs: + type: array + items: + $ref: '#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + nullable: true + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + tosTrCl: + $ref: '#/components/schemas/TosTrafficClassRm' + flowUsage: + $ref: '#/components/schemas/FlowUsage' + nullable: true + EventsNotification: + description: Describes the notification of a matched event. + type: object + required: + - evSubsUri + - evNotifs + properties: + adReports: + type: array + items: + $ref: '#/components/schemas/AppDetectionReport' + minItems: 1 + description: Includes the detected application report. + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + addAccessInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AdditionalAccessInfo' + relAccessInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AdditionalAccessInfo' + anChargAddr: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AccNetChargingAddress' + anChargIds: + type: array + items: + $ref: '#/components/schemas/AccessNetChargingIdentifier' + minItems: 1 + anGwAddr: + $ref: '#/components/schemas/AnGwAddress' + evSubsUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + evNotifs: + type: array + items: + $ref: '#/components/schemas/AfEventNotification' + minItems: 1 + failedResourcAllocReports: + type: array + items: + $ref: '#/components/schemas/ResourcesAllocationInfo' + minItems: 1 + succResourcAllocReports: + type: array + items: + $ref: '#/components/schemas/ResourcesAllocationInfo' + minItems: 1 + noNetLocSupp: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/NetLocAccessSupport' + outOfCredReports: + type: array + items: + $ref: '#/components/schemas/OutOfCreditInformation' + minItems: 1 + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + qncReports: + type: array + items: + $ref: '#/components/schemas/QosNotificationControlInfo' + minItems: 1 + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + ranNasRelCauses: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RanNasRelCause' + minItems: 1 + description: Contains the RAN and/or NAS release cause. + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + ueLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueLocTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + usgRep: + $ref: 'TS29122_CommonData.yaml#/components/schemas/AccumulatedUsage' + tsnBridgeManCont: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + AfEventSubscription: + description: Describes the event information delivered in the subscription. + type: object + required: + - event + properties: + event: +# $ref: '#/components/schemas/AfEvent' + $ref: '#/components/schemas/NpcfAfEvent' + notifMethod: + $ref: '#/components/schemas/AfNotifMethod' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + AfEventNotification: + description: Describes the event information delivered in the notification. + type: object + required: + - event + properties: + event: +# $ref: '#/components/schemas/AfEvent' + $ref: '#/components/schemas/NpcfAfEvent' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + TerminationInfo: + description: Indicates the cause for requesting the deletion of the Individual Application Session Context resource. + type: object + required: + - termCause + - resUri + properties: + termCause: + $ref: '#/components/schemas/TerminationCause' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + AfRoutingRequirement: + description: Describes the event information delivered in the subscription. + type: object + properties: + appReloc: + type: boolean + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + spVal: + $ref: '#/components/schemas/SpatialValidity' + tempVals: + type: array + items: + $ref: '#/components/schemas/TemporalValidity' + minItems: 1 + upPathChgSub: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/UpPathChgEvent' + addrPreserInd: + type: boolean + simConnInd: + type: boolean + description: Indicates whether simultaneous connectivity should be temporarily maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required. + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + SpatialValidity: + description: Describes explicitly the route to an Application location. + type: object + required: + - presenceInfoList + properties: + presenceInfoList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: Defines the presence information provisioned by the AF. The praId attribute within the PresenceInfo data type is the key of the map. + SpatialValidityRm: + description: This data type is defined in the same way as the SpatialValidity data type, but with the OpenAPI nullable property set to true. + type: object + required: + - presenceInfoList + properties: + presenceInfoList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: Defines the presence information provisioned by the AF. The praId attribute within the PresenceInfo data type is the key of the map. + nullable: true + AfRoutingRequirementRm: + description: > + This data type is defined in the same way as the AfRoutingRequirement data type, but with + the OpenAPI nullable property set to true and the spVal and tempVals attributes defined as + removable. + type: object + properties: + appReloc: + type: boolean + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + nullable: true + spVal: + $ref: '#/components/schemas/SpatialValidityRm' + tempVals: + type: array + items: + $ref: '#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + upPathChgSub: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/UpPathChgEvent' + addrPreserInd: + type: boolean + nullable: true + simConnInd: + type: boolean + nullable: true + description: Indicates whether simultaneous connectivity should be temporarily maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + nullable: true + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required. + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + nullable: true + AnGwAddress: + description: Describes the address of the access network gateway control node. + type: object + anyOf: + - required: [anGwIpv4Addr] + - required: [anGwIpv6Addr] + properties: + anGwIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anGwIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + Flows: + description: Identifies the flows. + type: object + required: + - medCompN + properties: + contVers: + type: array + items: + $ref: '#/components/schemas/ContentVersion' + minItems: 1 + fNums: + type: array + items: + type: integer + minItems: 1 + medCompN: + type: integer + EthFlowDescription: + description: Identifies an Ethernet flow. + type: object + required: + - ethType + properties: + destMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + ethType: + type: string + fDesc: + $ref: '#/components/schemas/FlowDescription' + fDir: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/FlowDirection' + sourceMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + vlanTags: + type: array + items: + type: string + minItems: 1 + maxItems: 2 + srcMacAddrEnd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + destMacAddrEnd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + + + ResourcesAllocationInfo: + description: Describes the status of the PCC rule(s) related to certain media components. + type: object + properties: + mcResourcStatus: + $ref: '#/components/schemas/MediaComponentResourcesStatus' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + altSerReq: + type: string + TemporalValidity: + description: Indicates the time interval(s) during which the AF request is to be applied. + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stopTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' +# + QosNotificationControlInfo: + description: Indicates whether the QoS targets for a GRB flow are not guaranteed or guaranteed again. + type: object + required: + - notifType + properties: + notifType: + $ref: '#/components/schemas/QosNotifType' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + altSerReq: + type: string +# + AcceptableServiceInfo: + description: Indicates the maximum bandwidth that shall be authorized by the PCF. + type: object + properties: + accBwMedComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponent' + description: Indicates the maximum bandwidth that shall be authorized by the PCF for each media component of the map. The key of the map is the media component number. + minProperties: 1 + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + UeIdentityInfo: + description: Represents 5GS-Level UE identities. + type: object + anyOf: + - required: [gpsi] + - required: [pei] + - required: [supi] + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' +# + AccessNetChargingIdentifier: + description: Describes the access network charging identifier. + type: object + oneOf: + - required: [accNetChaIdValue] + - required: [accNetChargIdString] + properties: + accNetChaIdValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + accNetChargIdString: + type: string + description: A character string containing the access network charging identifier. + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 +# + OutOfCreditInformation: + description: Indicates the SDFs without available credit and the corresponding termination action. + type: object + required: + - finUnitAct + properties: + finUnitAct: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/FinalUnitAction' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 +# + QosMonitoringInformation: + description: Indicates the QoS Monitoring information to report, i.e. UL and/or DL and or round trip delay. + type: object + properties: + repThreshDl: + type: integer + repThreshUl: + type: integer + repThreshRp: + type: integer +# +# + PduSessionTsnBridge: + description: Contains the new TSC user plane node information and may contain the DS-TT port and/or NW-TT port management information. + type: object + required: + - tsnBridgeInfo + properties: + tsnBridgeInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/TsnBridgeInfo' + tsnBridgeManCont: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + ueIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ipDomain: + type: string + description: IPv4 address domain identifier. + ueIpv6AddrPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + +# + QosMonitoringInformationRm: + description: This data type is defined in the same way as the QosMonitoringInformation data type, but with the OpenAPI nullable property set to true. + type: object + properties: + repThreshDl: + type: integer + repThreshUl: + type: integer + repThreshRp: + type: integer + nullable: true +# + PcscfRestorationRequestData: + description: Indicates P-CSCF restoration. + type: object + oneOf: + - required: [ueIpv4] + - required: [ueIpv6] + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ipDomain: + type: string + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + +# +# + QosMonitoringReport: + description: QoS Monitoring reporting information. + type: object + properties: + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + ulDelays: + type: array + items: + type: integer + minItems: 1 + dlDelays: + type: array + items: + type: integer + minItems: 1 + rtDelays: + type: array + items: + type: integer + minItems: 1 +# + TsnQosContainer: + description: Indicates TSC Traffic QoS. + type: object + properties: + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVol' + tscPackDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + tscPrioLevel: + $ref: '#/components/schemas/TscPriorityLevel' +# +# + TsnQosContainerRm: + description: Indicates removable TSC Traffic QoS. + type: object + properties: + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + tscPackDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudgetRm' + tscPrioLevel: + $ref: '#/components/schemas/TscPriorityLevelRm' + nullable: true +# + TscaiInputContainer: + description: Indicates TSC Traffic pattern. + type: object + properties: + periodicity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + burstArrivalTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + surTimeInNumMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + surTimeInTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + nullable: true +# +# + AppDetectionReport: + description: Indicates the start or stop of the detected application traffic and the application identifier of the detected application traffic. + type: object + required: + - adNotifType + - afAppId + properties: + adNotifType: + $ref: '#/components/schemas/AppDetectionNotifType' + afAppId: + $ref: '#/components/schemas/AfAppId' +# +# + PduSessionEventNotification: + description: Indicates PDU session information for the concerned established/terminated PDU session. + type: object + required: + - evNotif + properties: + evNotif: + $ref: '#/components/schemas/AfEventNotification' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + status: + $ref: '#/components/schemas/NpcfPduSessionStatus' + pcfInfo: + $ref: '#/components/schemas/PcfAddressingInfo' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' +# +# + PcfAddressingInfo: + description: Contains PCF address information. + type: object + properties: + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_PolicyAuthorization service. + bindingInfo: + type: string + description: contains the binding indications of the PCF. +# + AlternativeServiceRequirementsData: + description: Contains an alternative QoS related parameter set. + type: object + required: + - altQosParamSetRef + properties: + altQosParamSetRef: + type: string + description: Reference to this alternative QoS related parameter set. + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + pdb: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' +# + EventsSubscPutData: + description: > + Identifies the events the application subscribes to within an Events Subscription + sub-resource data. It may contain the notification of the already met events. + anyOf: + - $ref: '#/components/schemas/EventsSubscReqData' + - $ref: '#/components/schemas/EventsNotification' +# +# EXTENDED PROBLEMDETAILS +# + ExtendedProblemDetails: + description: Extends ProblemDetails to also include the acceptable service info. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - type: object + properties: + acceptableServInfo: + $ref: '#/components/schemas/AcceptableServiceInfo' + +# +# SIMPLE DATA TYPES +# + AfAppId: + description: Contains an AF application identifier. + type: string + AspId: + description: Contains an identity of an application service provider. + type: string + CodecData: + description: Contains codec related information. + type: string + ContentVersion: + description: Represents the content version of some content. + type: integer + FlowDescription: + description: Defines a packet filter of an IP flow. + type: string + SponId: + description: Contains an identity of a sponsor. + type: string + ServiceUrn: + description: Contains values of the service URN and may include subservices. + type: string + TosTrafficClass: + description: > + 2-octet string, where each octet is encoded in hexadecimal representation. The first octet + contains the IPv4 Type-of-Service or the IPv6 Traffic-Class field and the second octet + contains the ToS/Traffic Class mask field. + type: string + TosTrafficClassRm: + description: This data type is defined in the same way as the TosTrafficClass data type, but with the OpenAPI nullable property set to true. + type: string + nullable: true + TscPriorityLevel: + description: Represents the priority level of TSC Flows. + type: integer + minimum: 1 + maximum: 8 + TscPriorityLevelRm: + description: This data type is defined in the same way as the TscPriorityLevel data type, but with the OpenAPI nullable property set to true. + type: integer + minimum: 1 + maximum: 8 + nullable: true +# +# ENUMERATIONS DATA TYPES +# + MediaType: +# description: Indicates the media type of a media component. +# anyOf: +# - type: string + enum: + - AUDIO + - VIDEO + - DATA + - APPLICATION + - CONTROL + - TEXT + - MESSAGE + - OTHER +# - type: string +# + MpsAction: +# description: Indicates whether it is an invocation, a revocation or an invocation with authorization of the MPS for DTS service. +# anyOf: +# - type: string + enum: + - DISABLE_MPS_FOR_DTS + - ENABLE_MPS_FOR_DTS + - AUTHORIZE_AND_ENABLE_MPS_FOR_DTS +# - type: string +# + ReservPriority: +# description: Indicates the reservation priority. +# anyOf: +# - type: string + enum: + - PRIO_1 + - PRIO_2 + - PRIO_3 + - PRIO_4 + - PRIO_5 + - PRIO_6 + - PRIO_7 + - PRIO_8 + - PRIO_9 + - PRIO_10 + - PRIO_11 + - PRIO_12 + - PRIO_13 + - PRIO_14 + - PRIO_15 + - PRIO_16 +# - type: string +# + ServAuthInfo: +# description: Indicates the result of the Policy Authorization service request from the AF. +# anyOf: +# - type: string + enum: + - TP_NOT_KNOWN + - TP_EXPIRED + - TP_NOT_YET_OCURRED + - ROUT_REQ_NOT_AUTHORIZED +# - type: string +# + SponsoringStatus: +# description: Indicates whether sponsored data connectivity is enabled or disabled/not enabled. +# anyOf: +# - type: string + enum: + - SPONSOR_DISABLED + - SPONSOR_ENABLED +# - type: string +# +# AfEvent: + NpcfAfEvent: +# description: Represents an event to notify to the AF. +# anyOf: +# - type: string + enum: + - ACCESS_TYPE_CHANGE + - ANI_REPORT + - APP_DETECTION + - CHARGING_CORRELATION + - EPS_FALLBACK + - FAILED_QOS_UPDATE + - FAILED_RESOURCES_ALLOCATION + - OUT_OF_CREDIT + - PDU_SESSION_STATUS + - PLMN_CHG + - QOS_MONITORING + - QOS_NOTIF + - RAN_NAS_CAUSE + - REALLOCATION_OF_CREDIT + - SAT_CATEGORY_CHG + - SUCCESSFUL_QOS_UPDATE + - SUCCESSFUL_RESOURCES_ALLOCATION + - TSN_BRIDGE_INFO + - UP_PATH_CHG_FAILURE + - USAGE_REPORT +# - type: string +# + AfNotifMethod: +# description: Represents the notification methods that can be subscribed for an event. +# anyOf: +# - type: string + enum: + - EVENT_DETECTION + - ONE_TIME + - PERIODIC + - PDU_SESSION_RELEASE +# - type: string +# + QosNotifType: +# description: Indicates the notification type for QoS Notification Control. +# anyOf: +# - type: string + enum: + - GUARANTEED + - NOT_GUARANTEED +# - type: string +# + TerminationCause: +# description: Indicates the cause behind requesting the deletion of the Individual Application Session Context resource. +# anyOf: +# - type: string + enum: + - ALL_SDF_DEACTIVATION + - PDU_SESSION_TERMINATION + - PS_TO_CS_HO + - INSUFFICIENT_SERVER_RESOURCES + - INSUFFICIENT_QOS_FLOW_RESOURCES + - SPONSORED_DATA_CONNECTIVITY_DISALLOWED +# - type: string +# + MediaComponentResourcesStatus: +# description: Indicates whether the media component is active or inactive. +# anyOf: +# - type: string + enum: + - ACTIVE + - INACTIVE +# - type: string +# +# + FlowUsage: +# description: Describes the flow usage of the flows described by a media subcomponent. +# anyOf: +# - type: string + enum: + - NO_INFO + - RTCP + - AF_SIGNALLING +# - type: string + + + FlowStatus: +# description: Describes whether the IP flow(s) are enabled or disabled. +# anyOf: +# - type: string + enum: + - ENABLED-UPLINK + - ENABLED-DOWNLINK + - ENABLED + - DISABLED + - REMOVED +# - type: string +# + RequiredAccessInfo: +# description: Indicates the access network information required for an AF session. +# anyOf: +# - type: string + enum: + - USER_LOCATION + - UE_TIME_ZONE +# - type: string +# + SipForkingIndication: +# description: Indicates whether several SIP dialogues are related to an "Individual Application Session Context" resource. +# anyOf: +# - type: string + enum: + - SINGLE_DIALOGUE + - SEVERAL_DIALOGUES +# - type: string +# + AfRequestedData: +# description: Represents the information that the AF requested to be exposed. +# anyOf: +# - type: string + enum: + - UE_IDENTITY +# - type: string +# + ServiceInfoStatus: +# description: Represents the preliminary or final service information status. +# anyOf: +# - type: string + enum: + - FINAL + - PRELIMINARY +# - type: string +# + PreemptionControlInformation: +# description: Represents Pre-emption control information. +# anyOf: +# - type: string + enum: + - MOST_RECENT + - LEAST_RECENT + - HIGHEST_BW +# - type: string +# + PrioritySharingIndicator: +# description: Represents the Priority sharing indicator. +# anyOf: +# - type: string + enum: + - ENABLED + - DISABLED +# - type: string +# + PreemptionControlInformationRm: + description: This data type is defined in the same way as the PreemptionControlInformation data type, but with the OpenAPI nullable property set to true. + anyOf: + - $ref: '#/components/schemas/PreemptionControlInformation' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' +# + AppDetectionNotifType: +# description: Indicates the notification type for Application Detection Control. +# anyOf: +# - type: string + enum: + - APP_START + - APP_STOP +# - type: string +# + NpcfPduSessionStatus: +# description: Indicates whether the PDU session is established or terminated. +# anyOf: +# - type: string + enum: + - ESTABLISHED + - TERMINATED +# - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29517_Naf_EventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29517_Naf_EventExposure.yaml new file mode 100644 index 000000000..3ae6a5470 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29517_Naf_EventExposure.yaml @@ -0,0 +1,828 @@ +openapi: 3.0.0 +info: + version: 1.2.0 + title: Naf_EventExposure + description: | + AF Event Exposure Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.517 V17.7.0; 5G System; Application Function Event Exposure Service; Stage 3. + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.517/ + +servers: + - url: '{apiRoot}/naf-eventexposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: [] + + +paths: + /subscriptions: + post: + summary: Creates a new Individual Application Event Exposure Subscription resource + operationId: PostAfEventExposureSubsc + tags: + - Application Event Subscription (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + responses: + '201': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + headers: + Location: + description: > + Contains the URI of the created individual application event subscription resource + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + AfEventExposureNotif: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureNotif' + responses: + '204': + description: No Content, Notification was successful + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subscriptionId}: + get: + summary: "Reads an existing Individual Application Event Subscription" + operationId: GetAfEventExposureSubsc + tags: + - Individual Application Event Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Application Event Subscription ID + required: true + schema: + type: string + - name: supp-feat + in: query + description: Features supported by the NF service consumer + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: "Modifies an existing Individual Application Event Subscription " + operationId: PutAfEventExposureSubsc + tags: + - Individual Application Event Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + parameters: + - name: subscriptionId + in: path + description: Application Event Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was successfully modified and representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + '204': + description: No Content. Resource was successfully modified + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: "Cancels an existing Individual Application Event Subscription " + operationId: DeleteAfEventExposureSubsc + tags: + - Individual Application Event Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Application Event Subscription ID + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was successfully deleted + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUri}' + scopes: {} + description: > + For trusted AF, the 'naf-eventexposure' shall be used as 'scopes' and + '{nrfApiRoot}/oauth2/token' shall be used as 'tokenUri'. + + schemas: + AfEventExposureNotif: + description: > + Represents notifications on application event(s) that occurred for an Individual Application + Event Subscription resource. + type: object + properties: + notifId: + type: string + eventNotifs: + type: array + items: + $ref: '#/components/schemas/AfEventNotification' + minItems: 1 + required: + - notifId + - eventNotifs + AfEventExposureSubsc: + description: Represents an Individual Application Event Subscription resource. + type: object + properties: + dataAccProfId: + type: string + eventsSubs: + type: array + items: + $ref: '#/components/schemas/EventsSubs' + minItems: 1 + eventsRepInfo: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + eventNotifs: + type: array + items: + $ref: '#/components/schemas/AfEventNotification' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - eventsSubs + - eventsRepInfo + - notifId + - notifUri + AfEventNotification: + description: Represents information related to an event to be reported. + type: object + properties: + event: + $ref: '#/components/schemas/AfEvent' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + svcExprcInfos: + type: array + items: + $ref: '#/components/schemas/ServiceExperienceInfoPerApp' + minItems: 1 + ueMobilityInfos: + type: array + items: + $ref: '#/components/schemas/UeMobilityCollection' + minItems: 1 + ueCommInfos: + type: array + items: + $ref: '#/components/schemas/UeCommunicationCollection' + minItems: 1 + excepInfos: + type: array + items: + $ref: '#/components/schemas/ExceptionInfo' + minItems: 1 + congestionInfos: + type: array + items: + $ref: '#/components/schemas/UserDataCongestionCollection' + minItems: 1 + perfDataInfos: + type: array + items: + $ref: '#/components/schemas/PerformanceDataCollection' + minItems: 1 + dispersionInfos: + type: array + items: + $ref: '#/components/schemas/DispersionCollection' + minItems: 1 + collBhvrInfs: + type: array + items: + $ref: '#/components/schemas/CollectiveBehaviourInfo' + minItems: 1 + msQoeMetrInfos: + type: array + items: + $ref: '#/components/schemas/MsQoeMetricsCollection' + minItems: 1 + msConsumpInfos: + type: array + items: + $ref: '#/components/schemas/MsConsumptionCollection' + minItems: 1 + msNetAssInvInfos: + type: array + items: + $ref: '#/components/schemas/MsNetAssInvocationCollection' + minItems: 1 + msDynPlyInvInfos: + type: array + items: + $ref: '#/components/schemas/MsDynPolicyInvocationCollection' + minItems: 1 + msAccActInfos: + type: array + items: + $ref: '#/components/schemas/MSAccessActivityCollection' + minItems: 1 + required: + - event + - timeStamp + EventsSubs: + description: Represents an event to be subscribed and the related event filter information. + type: object + properties: + event: + $ref: '#/components/schemas/AfEvent' + eventFilter: + $ref: '#/components/schemas/EventFilter' + required: + - event + - eventFilter + EventFilter: + description: Represents event filter information for an event. + type: object + properties: + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + exterGroupIds: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + minItems: 1 + interGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + anyUeInd: + type: boolean + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + collAttrs: + type: array + items: + $ref: '#/components/schemas/CollectiveBehaviourFilter' + minItems: 1 + ServiceExperienceInfoPerApp: + description: Contains service experience information associated with an application. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + appServerIns: + $ref: '#/components/schemas/AddrFqdn' + svcExpPerFlows: + type: array + items: + $ref: '#/components/schemas/ServiceExperienceInfoPerFlow' + minItems: 1 + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + required: + - svcExpPerFlows + ServiceExperienceInfoPerFlow: + description: Contains service experience information associated with a service flow. + type: object + properties: + svcExprc: + $ref: '#/components/schemas/SvcExperience' + timeIntev: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ethTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + SvcExperience: + description: Contains a mean opinion score with the customized range. + type: object + properties: + mos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + upperRange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + lowerRange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + UeMobilityCollection: + description: Contains UE mobility information associated with an application. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ueTrajs: + type: array + items: + $ref: '#/components/schemas/UeTrajectoryCollection' + minItems: 1 + required: + - appId + - ueTrajs + UeCommunicationCollection: + description: Contains UE communication information associated with an application. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + exterGroupId: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + comms: + type: array + items: + $ref: '#/components/schemas/CommunicationCollection' + minItems: 1 + required: + - appId + - comms + UeTrajectoryCollection: + description: Contains UE trajectory information associated with an application. + type: object + properties: + ts: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + required: + - ts + - locArea + CommunicationCollection: + description: Contains communication information. + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ulVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + dlVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + required: + - startTime + - endTime + - ulVol + - dlVol + ExceptionInfo: + description: Represents the exceptions information provided by the AF. + type: object + properties: + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ethTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + exceps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/Exception' + minItems: 1 + required: + - exceps + oneOf: + - required: [ipTrafficFilter] + - required: [ethTrafficFilter] + UserDataCongestionCollection: + description: Contains User Data Congestion Analytics related information collection. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + timeInterv: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + thrputUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + thrputDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + thrputPkUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + thrputPkDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + oneOf: + - required: [appId] + - required: [ipTrafficFilter] + PerformanceDataCollection: + description: Contains Performance Data Analytics related information collection. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ueLoc: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + appLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + asAddr: + $ref: '#/components/schemas/AddrFqdn' + perfData: + $ref: '#/components/schemas/PerformanceData' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - perfData + - timeStamp + PerformanceData: + description: Contains Performance Data. + type: object + properties: + pdb: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + plr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + thrputUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + thrputDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + AddrFqdn: + description: IP address and/or FQDN. + type: object + properties: + ipAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + fqdn: + type: string + description: Indicates an FQDN. + DispersionCollection: + description: Contains the dispersion information collected for an AF. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + dataUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + flowDesp: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + appDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - dataUsage + oneOf: + - required: [gpsi] + - required: [supi] + - required: [ueAddr] + CollectiveBehaviourFilter: + description: Contains the collective behaviour filter information to be collected from UE. + type: object + properties: + type: + $ref: '#/components/schemas/CollectiveBehaviourFilterType' + value: + type: string + description: Value of the parameter type as in the type attribute. + listOfUeInd: + type: boolean + description: > + Indicates whether request list of UE IDs that fulfill a collective behaviour within the + area of interest. This attribute shall set to "true" if request the list of UE IDs, + otherwise, set to "false". May only be present and sets to "true" if "AfEvent" sets to + "COLLECTIVE_BEHAVIOUR". + required: + - type + - value + CollectiveBehaviourInfo: + description: Contains the collective behaviour information to be reported to the subscriber. + type: object + properties: + colAttrib: + type: array + items: + $ref: '#/components/schemas/PerUeAttribute' + minItems: 1 + noOfUes: + type: integer + description: Total number of UEs that fulfil a collective within the area of interest. + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + extUeIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + ueIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + required: + - colAttrib + oneOf: + - required: [extUeIds] + - required: [ueIds] + PerUeAttribute: + description: UE application data collected per UE. + type: object + properties: + ueDest: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + route: + type: string + avgSpeed: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + timeOfArrival: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + MsQoeMetricsCollection: + description: > + Contains the Media Streaming QoE metrics information collected for an UE Application via AF. + type: object + properties: + msQoeMetrics: + type: array + items: + type: string + minItems: 1 + required: + - msQoeMetrics + MsConsumptionCollection: + description: > + Contains the Media Streaming Consumption information collected for an UE Application via AF. + type: object + properties: + msConsumps: + type: array + items: + type: string + description: > + Represents the Media Streaming Consumption reports with formatting as specified in + clause 11.3.3 of 3GPP TS 26.512 [30], if required for Media Streaming UE Application. + minItems: 1 + required: + - msConsumps + MsNetAssInvocationCollection: + description: > + Contains the Media Streaming Network Assistance invocation collected for an UE Application + via AF. + type: object + properties: + msNetAssInvocs: + type: array + items: + $ref: 'TS26512_M5_NetworkAssistance.yaml#/components/schemas/NetworkAssistanceSession' + minItems: 1 + required: + - msNetAssInvocs + MsDynPolicyInvocationCollection: + description: > + Contains the Media Streaming Dynamic Policy invocation collected for an UE + Application via AF. + type: object + properties: + msDynPlyInvocs: + type: array + items: + $ref: 'TS26512_M5_DynamicPolicies.yaml#/components/schemas/DynamicPolicy' + minItems: 1 + required: + - msDynPlyInvocs + MSAccessActivityCollection: + description: Contains Media Streaming access activity collected for an UE Application via AF. + type: object + properties: + msAccActs: + type: array + items: + $ref: 'TS26512_R4_DataReporting.yaml#/components/schemas/MediaStreamingAccessRecord' + minItems: 1 + required: + - msAccActs + +# Simple data types and Enumerations + + AfEvent: +# description: Represents Application Events. +# anyOf: +# - type: string + enum: + - SVC_EXPERIENCE + - UE_MOBILITY + - UE_COMM + - EXCEPTIONS + - USER_DATA_CONGESTION + - PERF_DATA + - DISPERSION + - COLLECTIVE_BEHAVIOUR + - MS_QOE_METRICS + - MS_CONSUMPTION + - MS_NET_ASSIST_INVOCATION + - MS_DYN_POLICY_INVOCATION + - MS_ACCESS_ACTIVITY +# - type: string +# description: > +# This string provides forward-compatibility with future extensions to the enumeration but +# is not used to encode content defined in the present version of this API. + CollectiveBehaviourFilterType: +# description: Represents collective behaviour parameter type. +# anyOf: +# - type: string + enum: + - COLLECTIVE_ATTRIBUTE + - DATA_PROCESSING +# - type: string +# description: > +# This string provides forward-compatibility with future extensions to the enumeration but +# is not used to encode content defined in the present version of this API. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_Communication.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_Communication.yaml new file mode 100644 index 000000000..73dcfca61 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_Communication.yaml @@ -0,0 +1,3904 @@ +openapi: 3.0.0 + +info: + version: 1.2.2 + title: Namf_Communication + description: | + AMF Communication Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +security: + - {} + - oAuth2ClientCredentials: + - namf-comm + +externalDocs: + description: 3GPP TS 29.518 V17.8.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-comm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /ue-contexts/{ueContextId}: + put: + summary: Namf_Communication CreateUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: CreateUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCreateData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + binaryDataN2InformationExt16: + type: string + format: binary + binaryDataN2InformationExt17: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt16: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt17: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + callbacks: + onN2MessageNotify: + '{$request.body#/n2NotifyUri}': + post: + summary: Namf_Communication N2 Info Notify (UE Specific) service Operation + tags: + - N2 Info Notify + operationId: N2InfoNotifyHandoverComplete + requestBody: + description: UE Specific N2 Information Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationNotification' + responses: + '200': + description: N2 Information Notification Response. + content: + application/json: + schema: + $ref: '#/components/schemas/N2InfoNotificationRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/N2InfoNotificationRspData' + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + binaryDataN2InformationExt16: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt16: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + responses: + '201': + description: UE context successfully created. + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/namf-comm//ue-contexts/{ueContextId} + required: true + schema: + type: string + 3gpp-Sbi-Producer-Id: + description: > + Indicating the AMF serving the UE Context. This header shall be included when the + UE Context is created in a target AMF other than the initial AMF sending the + response. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCreatedData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Response parts + jsonData: + $ref: '#/components/schemas/UeContextCreateError' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/release: + post: + summary: Namf_Communication ReleaseUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: ReleaseUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UEContextRelease' + required: true + responses: + '204': + description: UE Context successfully released + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/assign-ebi: + post: + summary: Namf_Communication EBI Assignment service Operation + tags: + - Individual ueContext (Document) + operationId: EBIAssignment + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiData' + required: true + responses: + '200': + description: EBI Assignment successfully performed. + content: + application/json: + schema: + $ref: '#/components/schemas/AssignedEbiData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + application/problem+json: # error originated by an SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + application/problem+json: # error originated by an SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + application/problem+json: # error originated by an SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/transfer: + post: + summary: Namf_Communication UEContextTransfer service Operation + tags: + - Individual ueContext (Document) + operationId: UEContextTransfer + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextTransferReqData' + binaryDataN1Message: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: UE context transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextTransferRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextTransferRspData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/transfer-update: + post: + summary: Namf_Communication RegistrationStatusUpdate service Operation + tags: + - Individual ueContext (Document) + operationId: RegistrationStatusUpdate + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeRegStatusUpdateReqData' + required: true + responses: + '200': + description: UE context transfer status successfully updated. + content: + application/json: + schema: + $ref: '#/components/schemas/UeRegStatusUpdateRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /ue-contexts/{ueContextId}/relocate: + post: + summary: Namf_Communication RelocateUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: RelocateUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextRelocateData' + binaryDataForwardRelocationRequest: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + binaryDataN2InformationExt16: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataForwardRelocationRequest: + contentType: application/vnd.3gpp.gtpc + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt16: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '201': + description: UE context successfully relocated. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//ue-contexts/{ueContextId}/relocate' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextRelocatedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/cancel-relocate: + post: + summary: Namf_Communication CancelRelocateUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: CancelRelocateUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCancelRelocateData' + binaryDataGtpcMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataGtpcMessage: + contentType: application/vnd.3gpp.gtpc + headers: + Content-Id: + schema: + type: string + required: true + responses: + '204': + description: UE Context successfully released + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/n1-n2-messages: + post: + summary: Namf_Communication N1N2 Message Transfer (UE Specific) service Operation + tags: + - n1N2Message collection (Collection) + operationId: N1N2MessageTransfer + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|cid-.{1,255}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N1N2MessageTransferReqData' + binaryDataN1Message: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + binaryMtData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryMtData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + required: true + responses: + '202': + description: N1N2 Message Transfer accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferRspData' + headers: + Location: + description: 'The URI of the resource located on the AMF to which the status of the N1N2 message transfer is held' + required: true + schema: + type: string + '200': + description: N1N2 Message Transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + description: Conflicts + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: Gateway Timeout + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + callbacks: + onN1N2TransferFailure: + '{$request.body#/n1n2FailureTxfNotifURI}': + post: + summary: Namf_Communication N1N2Transfer Failure Notification service Operation + tags: + - N1N2 Transfer Failure Notification + operationId: N1N2TransferFailureNotification + requestBody: + description: N1N2Transfer Failure Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MsgTxfrFailureNotification' + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions: + post: + summary: Namf_Communication N1N2 Message Subscribe (UE Specific) service Operation + tags: + - N1N2 Subscriptions Collection for Individual UE Contexts (Collection) + operationId: N1N2MessageSubscribe + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreateData' + required: true + responses: + '201': + description: N1N2 Message Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//{ueContextId}/ue-contexts/n1-n2-messages/subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreatedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onN1N2MessageNotify: + '{$request.body#/n1NotifyCallbackUri}': + post: + summary: Namf_Communication N1 Message Notify service Operation + tags: + - N1 Message Notify + operationId: N1MessageNotify + requestBody: + description: N1 Message Notification + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N1MessageNotification' + binaryDataN1Message: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '{$request.body#/n2NotifyCallbackUri}': + post: + summary: Namf_Communication N2 Info Notify (UE Specific) service Operation + tags: + - N2 Info Notify + operationId: N2InfoNotify + requestBody: + description: UE Specific N2 Information Notification + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationNotification' + binaryDataN1Message: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions/{subscriptionId}: + delete: + summary: Namf_Communication N1N2 Message UnSubscribe (UE Specific) service Operation + tags: + - N1N2 Individual Subscription (Document) + operationId: N1N2MessageUnSubscribe + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + - name: subscriptionId + in: path + description: Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: N1N2 Message Subscription successfully removed. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /non-ue-n2-messages/transfer: + post: + summary: Namf_Communication Non UE N2 Message Transfer service Operation + tags: + - Non UE N2Messages collection (Collection) + operationId: NonUeN2MessageTransfer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationTransferReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: Non UE N2 Message Transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + /non-ue-n2-messages/subscriptions: + post: + summary: Namf_Communication Non UE N2 Info Subscribe service Operation + tags: + - Non UE N2Messages Subscriptions collection (Collection) + operationId: NonUeN2InfoSubscribe + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreateData' + required: true + responses: + '201': + description: Non UE N2 Info Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreatedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onN2InfoNotify: + '{$request.body#/n2NotifyCallbackUri}': + post: + summary: Namf_Communication Non UE N2 Info Notify service Operation + tags: + - Non UE N2 Info Notify + operationId: NonUeN2InfoNotify + requestBody: + description: Non UE N2 Information Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationNotification' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationNotification' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}: + delete: + summary: Namf_Communication Non UE N2 Info UnSubscribe service Operation + tags: + - Non UE N2 Message Notification Individual Subscription (Document) + operationId: NonUeN2InfoUnSubscribe + parameters: + - name: n2NotifySubscriptionId + in: path + description: N2 info Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: Non UE N2 INfo Subscription successfully removed. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /subscriptions: + post: + summary: Namf_Communication AMF Status Change Subscribe service Operation + tags: + - subscriptions collection (Collection) + operationId: AMFStatusChangeSubscribe + requestBody: + content: + application/json: + schema: +# $ref: '#/components/schemas/SubscriptionData' + $ref: '#/components/schemas/NamfSubscriptionData' + required: true + responses: + '201': + description: N1N2 Message Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: +# $ref: '#/components/schemas/SubscriptionData' + $ref: '#/components/schemas/NamfSubscriptionData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onAmfStatusChange: + '{$request.body#/amfStatusUri}': + post: + summary: Amf Status Change Notify service Operation + tags: + - Amf Status Change Notify + operationId: AmfStatusChangeNotify + requestBody: + description: Amf Status Change Notification + content: + application/json: + schema: + $ref: '#/components/schemas/AmfStatusChangeNotification' + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /subscriptions/{subscriptionId}: + delete: + summary: Namf_Communication AMF Status Change UnSubscribe service Operation + tags: + - individual subscription (Document) + operationId: AMFStatusChangeUnSubscribe + parameters: + - name: subscriptionId + in: path + description: AMF Status Change Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: N1N2 Message Subscription successfully removed. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + put: + summary: Namf_Communication AMF Status Change Subscribe Modify service Operation + tags: + - individual subscription (Document) + operationId: AMFStatusChangeSubscribeModfy + parameters: + - name: subscriptionId + in: path + description: AMF Status Change Subscription Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: +# $ref: '#/components/schemas/SubscriptionData' + $ref: '#/components/schemas/NamfSubscriptionData' + required: true + responses: + '200': + description: Subscription modified successfully + content: + application/json: + schema: +# $ref: '#/components/schemas/SubscriptionData' + $ref: '#/components/schemas/NamfSubscriptionData' + '204': + description: Events subscription modification is accepted entirely + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + OnAmfStatusChange: + '{$request.body#/amfStatusUri}': + post: + summary: Amf Status Change Notify service Operation + tags: + - Amf Status Change Notify + operationId: AmfStatusChangeNOtify + requestBody: + description: Amf Status Change Notification + content: + application/json: + schema: + $ref: '#/components/schemas/AmfStatusChangeNotification' + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-comm: Access to the Namf_Communication API + schemas: +# +# STRUCTURED DATA TYPES +# + NamfSubscriptionData: + description: Data within an AMF Status Change Subscription request and response + type: object + properties: + amfStatusUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + required: + - amfStatusUri + AmfStatusChangeNotification: + description: Data within an AMF Status Change Notification request + type: object + properties: + amfStatusInfoList: + type: array + items: + $ref: '#/components/schemas/AmfStatusInfo' + minItems: 1 + required: + - amfStatusInfoList + AmfStatusInfo: + description: AMF Status Information + type: object + properties: + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + statusChange: + $ref: '#/components/schemas/StatusChange' + targetAmfRemoval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + targetAmfFailure: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + required: + - guamiList + - statusChange + AssignEbiData: + description: Data within an EBI assignment request + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + arpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + modifiedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 1 + required: + - pduSessionId + AssignedEbiData: + description: Data within a successful response to an EBI assignment request + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + assignedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 0 + failedArpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + modifiedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + required: + - pduSessionId + - assignedEbiList + AssignEbiFailed: + description: Represents failed assignment of EBI(s) + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + failedArpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + required: + - pduSessionId + UEContextRelease: + description: Data within a Release UE Context request + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + unauthenticatedSupi: + type: boolean + default: false + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + required: + - ngapCause + N2InformationTransferReqData: + description: Data within a N2 Information Transfer request containing the N2 information requested to be transferred to 5G AN + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + ratSelector: + $ref: '#/components/schemas/RatSelector' + globalRanNodeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + n2Information: + $ref: '#/components/schemas/N2InfoContainer' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n2Information + NonUeN2InfoSubscriptionCreateData: + description: Data within a create subscription request for non-UE specific N2 information notification + type: object + properties: + globalRanNodeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + anTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + n2NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n2InformationClass + - n2NotifyCallbackUri + NonUeN2InfoSubscriptionCreatedData: + description: Data for the created subscription for non-UE specific N2 information notification + type: object + properties: + n2NotifySubscriptionId: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + required: + - n2NotifySubscriptionId + UeN1N2InfoSubscriptionCreateData: + description: Data within a create subscription request for UE specific N1 and/or N2 information notification + type: object + properties: + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + n2NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + n1MessageClass: + $ref: '#/components/schemas/N1MessageClass' + n1NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + UeN1N2InfoSubscriptionCreatedData: + description: Data for the created subscription for UE specific N1 and/or N2 information notification + type: object + properties: + n1n2NotifySubscriptionId: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n1n2NotifySubscriptionId + N2InformationNotification: + description: Data within a N2 information notification request + type: object + properties: + n2NotifySubscriptionId: + type: string + n2InfoContainer: + $ref: '#/components/schemas/N2InfoContainer' + toReleaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + notifyReason: + $ref: '#/components/schemas/N2InfoNotifyReason' + smfChangeInfoList: + type: array + items: + $ref: '#/components/schemas/SmfChangeInfo' + minItems: 1 + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + initialAmfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + anN2IPv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anN2IPv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + notifySourceNgRan: + type: boolean + default: false + required: + - n2NotifySubscriptionId + N2InfoContainer: + description: N2 information container + type: object + properties: + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + smInfo: + $ref: '#/components/schemas/N2SmInformation' + ranInfo: + $ref: '#/components/schemas/N2RanInformation' + nrppaInfo: + $ref: '#/components/schemas/NrppaInformation' + pwsInfo: + $ref: '#/components/schemas/PwsInformation' + v2xInfo: + $ref: '#/components/schemas/V2xInformation' + proseInfo: + $ref: '#/components/schemas/ProSeInformation' + required: + - n2InformationClass + N1MessageNotification: + description: Data within a N1 message notification request + type: object + properties: + n1NotifySubscriptionId: + type: string + n1MessageContainer: + $ref: '#/components/schemas/N1MessageContainer' + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + registrationCtxtContainer: + $ref: '#/components/schemas/RegistrationContextContainer' + newLmfIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + cIoT5GSOptimisation: + type: boolean + default: false + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + required: + - n1MessageContainer + N1MessageContainer: + description: N1 Message container + type: object + properties: + n1MessageClass: + $ref: '#/components/schemas/N1MessageClass' + n1MessageContent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + serviceInstanceId: + type: string + required: + - n1MessageClass + - n1MessageContent + N1N2MessageTransferReqData: + description: Data within a N1/N2 message transfer request + type: object + properties: + n1MessageContainer: + $ref: '#/components/schemas/N1MessageContainer' + n2InfoContainer: + $ref: '#/components/schemas/N2InfoContainer' + mtData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + skipInd: + type: boolean + default: false + lastMsgIndication: + type: boolean + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + ppi: + $ref: '#/components/schemas/Ppi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + n1n2FailureTxfNotifURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfReallocationInd: + type: boolean + default: false + areaOfValidity: + $ref: '#/components/schemas/AreaOfValidity' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + maAcceptedInd: + type: boolean + default: false + extBufSupport: + type: boolean + default: false + targetAccess: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + + N1N2MessageTransferRspData: + description: Data within a N1/N2 message transfer response + type: object + properties: + cause: + $ref: '#/components/schemas/N1N2MessageTransferCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - cause + RegistrationContextContainer: + description: Registration Context Container used to send the UE context information, N1 message from UE, AN address etc during Registration with AMF re-allocation procedure + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + localTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + anN2ApId: + type: integer + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + initialAmfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + userLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + rrcEstCause: + type: string + pattern: '^[0-9a-fA-F]+$' + ueContextRequest: + type: boolean + default: false + initialAmfN2ApId: + type: integer + anN2IPv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anN2IPv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + allowedNssai: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/AllowedNssai' + configuredNssai: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/ConfiguredSnssai' + minItems: 1 + rejectedNssaiInPlmn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + rejectedNssaiInTa: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + selectedPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + iabNodeInd: + type: boolean + default: false + ceModeBInd: + $ref: '#/components/schemas/CeModeBInd' + lteMInd: + $ref: '#/components/schemas/LteMInd' + authenticatedInd: + type: boolean + default: false + npnAccessInfo: + $ref: '#/components/schemas/NpnAccessInfo' + required: + - ueContext + - anType + - anN2ApId + - ranNodeId + - initialAmfName + - userLocation + AreaOfValidity: + description: Area of validity information for N2 information transfer + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 0 + required: + - taiList + UeContextTransferReqData: + description: Data within a UE Context Transfer Request to start transferring of an individual ueContext resource from old AMF to new AMF + type: object + properties: + reason: + $ref: '#/components/schemas/TransferReason' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + regRequest: + $ref: '#/components/schemas/N1MessageContainer' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - reason + - accessType + UeContextTransferRspData: + description: Data within a successful response to the UE Context Transfer request + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ueRadioCapabilityForPaging: + $ref: '#/components/schemas/N2InfoContent' + ueNbiotRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueContext + UeContext: + description: Represents an individual ueContext resource + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supiUnauthInd: + type: boolean + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + ausfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + pcfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + hNwPubKeyId: + type: integer + groupList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + drxParameter: + $ref: '#/components/schemas/DrxParameter' + subRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + usedRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + subUeAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + subUeSliceMbrList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbr' + minProperties: 1 + description: A map(list of key-value pairs) where Snssai serves as key. + smsfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + seafData: + $ref: '#/components/schemas/SeafData' + 5gMmCapability: + $ref: '#/components/schemas/5GMmCapability' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + pcfAmpServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pcfUepServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pcfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + pcfAmPolicyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amPolicyReqTriggerList: + type: array + items: + $ref: '#/components/schemas/PolicyReqTrigger' + minItems: 1 + pcfUePolicyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + uePolicyReqTriggerList: + type: array + items: + $ref: '#/components/schemas/PolicyReqTrigger' + minItems: 1 + hpcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + hpcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + restrictedRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + forbiddenAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + minItems: 1 + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + restrictedCoreNwTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + minItems: 1 + eventSubscriptionList: + type: array + items: + $ref: '#/components/schemas/ExtAmfEventSubscription' + minItems: 1 + mmContextList: + type: array + items: + $ref: '#/components/schemas/MmContext' + minItems: 1 + maxItems: 2 + sessionContextList: + type: array + items: + $ref: '#/components/schemas/PduSessionContext' + minItems: 1 + epsInterworkingInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/EpsInterworkingInfo' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + serviceGapExpiryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + msClassmark2: + $ref: '#/components/schemas/MSClassmark2' + supportedCodecList: + type: array + items: + $ref: '#/components/schemas/SupportedCodec' + minItems: 1 + smallDataRateStatusInfos: + type: array + items: + $ref: '#/components/schemas/SmallDataRateStatusInfo' + minItems: 1 + restrictedPrimaryRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + restrictedSecondaryRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + v2xContext: + $ref: '#/components/schemas/V2xContext' + lteCatMInd: + type: boolean + default: false + redCapInd: + type: boolean + default: false + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + cagData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/CagData' + managementMdtInd: + type: boolean + default: false + immediateMdtConf: + $ref: '#/components/schemas/ImmediateMdtConf' + ecRestrictionDataWb: + $ref: '#/components/schemas/EcRestrictionDataWb' + ecRestrictionDataNb: + type: boolean + default: false + iabOperationAllowed: + type: boolean + proseContext: + $ref: '#/components/schemas/ProseContext' + analyticsSubscriptionList: + type: array + items: + $ref: '#/components/schemas/AnalyticsSubscription' + minItems: 1 + pcfAmpBindingInfo: + type: string + pcfUepBindingInfo: + type: string + usedServiceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + praInAmPolicy: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: A map(list of key-value pairs) where praId serves as key. + praInUePolicy: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: A map(list of key-value pairs) where praId serves as key. + updpSubscriptionData: + $ref: '#/components/schemas/UpdpSubscriptionData' + smPolicyNotifyPduList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionInfo' + minItems: 1 + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + uePositioningCap: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/UePositioningCapabilities' + astiDistributionIndication: + type: boolean + default: false + tsErrorBudget: + type: integer + snpnOnboardInd: + type: boolean + default: false + smfSelInfo: + $ref: 'TS29507_Npcf_AMPolicyControl.yaml#/components/schemas/SmfSelectionData' + pcfUeSliceMbrList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbr' + minProperties: 1 + description: A map(list of key-value pairs) where Snssai serves as key. + smsfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + smsfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smsfBindingInfo: + type: string + disasterRoamingInd: + type: boolean + default: false + disasterPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + + N2SmInformation: + description: Represents the session management SMF related N2 information data part + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + homePlmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + iwkSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + subjectToHo: + type: boolean + required: + - pduSessionId + N2InfoContent: + description: Represents a transparent N2 information content to be relayed by AMF + type: object + properties: + ngapMessageType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + ngapIeType: + $ref: '#/components/schemas/NgapIeType' + ngapData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - ngapData + NrppaInformation: + description: Represents a NRPPa related N2 information data part + type: object + properties: + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nrppaPdu: + $ref: '#/components/schemas/N2InfoContent' + serviceInstanceId: + type: string + required: + - nfId + - nrppaPdu + PwsInformation: + description: Represents a PWS related information data part + type: object + properties: + messageIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + serialNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + pwsContainer: + $ref: '#/components/schemas/N2InfoContent' + bcEmptyAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + sendRanResponse: + type: boolean + default: false + omcId: + $ref: '#/components/schemas/OmcIdentifier' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + required: + - messageIdentifier + - serialNumber + - pwsContainer + N1N2MsgTxfrFailureNotification: + description: Data within a N1/N2 Message Transfer Failure Notification request + type: object + properties: + cause: + $ref: '#/components/schemas/N1N2MessageTransferCause' + n1n2MsgDataUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - cause + - n1n2MsgDataUri + N1N2MessageTransferError: + description: Data within a N1/N2 Message Transfer Error response + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + errInfo: + $ref: '#/components/schemas/N1N2MsgTxfrErrDetail' + required: + - error + N1N2MsgTxfrErrDetail: + description: N1/N2 Message Transfer Error Details + type: object + properties: + retryAfter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + highestPrioArp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + N2InformationTransferRspData: + description: Data within a successful response to the N2 Information Transfer request to transfer N2 Information to the AN + type: object + properties: + result: + $ref: '#/components/schemas/N2InformationTransferResult' + pwsRspData: + $ref: '#/components/schemas/PWSResponseData' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - result + MmContext: + description: Represents a Mobility Management Context in UE Context + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + nasSecurityMode: + $ref: '#/components/schemas/NasSecurityMode' + epsNasSecurityMode: + $ref: '#/components/schemas/EpsNasSecurityMode' + nasDownlinkCount: + $ref: '#/components/schemas/NasCount' + nasUplinkCount: + $ref: '#/components/schemas/NasCount' + ueSecurityCapability: + $ref: '#/components/schemas/UeSecurityCapability' + s1UeNetworkCapability: + $ref: '#/components/schemas/S1UeNetworkCapability' + allowedNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nssaiMappingList: + type: array + items: + $ref: '#/components/schemas/NssaiMapping' + minItems: 1 + allowedHomeNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nsInstanceList: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + minItems: 1 + expectedUEbehavior: + $ref: '#/components/schemas/ExpectedUeBehavior' + ueDifferentiationInfo: + $ref: '#/components/schemas/UeDifferentiationInfo' + plmnAssiUeRadioCapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnAssiUeRadioCapId' + manAssiUeRadioCapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ManAssiUeRadioCapId' + ucmfDicEntryId: + type: string + n3IwfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + wagfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + tngfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + anN2ApId: + type: integer + nssaaStatusList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NssaaStatus' + minItems: 1 + pendingNssaiMappingList: + type: array + items: + $ref: '#/components/schemas/NssaiMapping' + minItems: 1 + uuaaMmStatus: + $ref: '#/components/schemas/UuaaMmStatus' + required: + - accessType + SeafData: + description: Represents SEAF data derived from data received from AUSF + type: object + properties: + ngKsi: + $ref: '#/components/schemas/NgKsi' + keyAmf: + $ref: '#/components/schemas/KeyAmf' + nh: + type: string + pattern: '^[A-Fa-f0-9]+$' + ncc: + type: integer + minimum: 0 + maximum: 7 + keyAmfChangeInd: + type: boolean + keyAmfHDerivationInd: + type: boolean + required: + - ngKsi + - keyAmf + NasSecurityMode: + description: Indicates the NAS Security Mode + type: object + properties: + integrityAlgorithm: + $ref: '#/components/schemas/IntegrityAlgorithm' + cipheringAlgorithm: + $ref: '#/components/schemas/CipheringAlgorithm' + required: + - integrityAlgorithm + - cipheringAlgorithm + PduSessionContext: + description: Represents a PDU Session Context in UE Context + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + smContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + selectedDnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAccessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + allocatedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 1 + hsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + hsmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + hsmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + vsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + vsmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + vsmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + vsmfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + ismfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ismfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + ismfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + ismfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + nsInstance: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + smfServiceInstanceId: + type: string + maPduSession: + type: boolean + default: false + cnAssistedRanPara: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/CnAssistedRanPara' + nrfManagementUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfDiscoveryUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfBindingInfo: + type: string + vsmfBindingInfo: + type: string + ismfBindingInfo: + type: string + additionalSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddr: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpAddress' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + anchorSmfSupportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + anchorSmfOauth2Required: + type: boolean + required: + - pduSessionId + - smContextRef + - sNssai + - dnn + - accessType + NssaiMapping: + description: Represents the mapping between a S-NSSAI in serving PLMN to a S-NSSAI in home PLMN + type: object + properties: + mappedSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - mappedSnssai + - hSnssai + UeRegStatusUpdateReqData: + description: Data within a UE registration status update request to indicate a completion of transferring at a target AMF + type: object + properties: + transferStatus: + $ref: '#/components/schemas/UeContextTransferStatus' + toReleaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + pcfReselectedInd: + type: boolean + smfChangeInfoList: + type: array + items: + $ref: '#/components/schemas/SmfChangeInfo' + minItems: 1 + analyticsNotUsedList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + toReleaseSessionInfo: + type: array + items: + $ref: '#/components/schemas/ReleaseSessionInfo' + minItems: 1 + required: + - transferStatus + UeRegStatusUpdateRspData: + description: Data within a UE registration status update response to provide the status of UE context transfer status update at a source AMF + type: object + properties: + regStatusTransferComplete: + type: boolean + required: + - regStatusTransferComplete + AssignEbiError: + description: Data within a failure response to the EBI assignment request + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + failureDetails: + $ref: '#/components/schemas/AssignEbiFailed' + required: + - error + - failureDetails + UeContextCreateData: + description: Data within a request to create an individual ueContext resource + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetId: + $ref: '#/components/schemas/NgRanTargetId' + sourceToTargetData: + $ref: '#/components/schemas/N2InfoContent' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + n2NotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ueRadioCapabilityForPaging: + $ref: '#/components/schemas/N2InfoContent' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + required: + - ueContext + - targetId + - sourceToTargetData + - pduSessionList + UeContextCreatedData: + description: Data within a successful response for creating an individual ueContext resource + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetToSourceData: + $ref: '#/components/schemas/N2InfoContent' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + failedSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pcfReselectedInd: + type: boolean + analyticsNotUsedList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + required: + - ueContext + - targetToSourceData + - pduSessionList + UeContextCreateError: + description: Data within a failure response for creating a UE context + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + targetToSourceFailureData: + $ref: '#/components/schemas/N2InfoContent' + required: + - error + UeContextRelocateData: + description: Data within a Relocate UE Context request + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetId: + $ref: '#/components/schemas/NgRanTargetId' + sourceToTargetData: + $ref: '#/components/schemas/N2InfoContent' + forwardRelocationRequest: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueContext + - targetId + - sourceToTargetData + - forwardRelocationRequest + UeContextRelocatedData: + description: Data within a Relocate UE Context response + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + required: + - ueContext + + UeContextCancelRelocateData: + description: Data structure used for cancellation of UE Context Relocation + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + relocationCancelRequest: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - relocationCancelRequest + NgRanTargetId: + description: Indicates a NG RAN as target of the handover + type: object + properties: + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + required: + - ranNodeId + - tai + PWSResponseData: + description: Data related PWS included in a N2 Information Transfer response + type: object + properties: + ngapMessageType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + serialNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + messageIdentifier: + type: integer + unknownTaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + required: + - ngapMessageType + - serialNumber + - messageIdentifier + PWSErrorData: + description: Data related to PWS error included in a N2 Information Transfer failure response + type: object + properties: + namfCause: + type: integer + required: + - namfCause + N2InformationTransferError: + description: Data within a failure response for a non-UE related N2 Information Transfer + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + pwsErrorInfo: + $ref: '#/components/schemas/PWSErrorData' + required: + - error + NgKsi: + description: Represents the ngKSI + type: object + properties: + tsc: + $ref: '#/components/schemas/ScType' + ksi: + type: integer + minimum: 0 + maximum: 6 + required: + - tsc + - ksi + KeyAmf: + description: Represents the Kamf or K'amf + type: object + properties: + keyType: + $ref: '#/components/schemas/KeyAmfType' + keyVal: + type: string + required: + - keyType + - keyVal + ExpectedUeBehavior: + description: Represents the expected UE behavior (e.g. UE moving trajectory) and its validity period + type: object + properties: + expMoveTrajectory: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + minItems: 1 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - expMoveTrajectory + - validityTime + N2RanInformation: + description: Represents the RAN related N2 information data part + type: object + properties: + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + required: + - n2InfoContent + N2InfoNotificationRspData: + description: Data within a N2 information notification response + type: object + properties: + secRatDataUsageList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + SmallDataRateStatusInfo: + description: Represents the small data rate status + type: object + properties: + Snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + Dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + SmallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + required: + - Snssai + - Dnn + - SmallDataRateStatus + SmfChangeInfo: + description: SMF change information for PDU session(s) + type: object + properties: + pduSessionIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + smfChangeInd: + $ref: '#/components/schemas/SmfChangeIndication' + required: + - pduSessionIdList + - smfChangeInd + + V2xContext: + description: Represents the V2X services related parameters + type: object + properties: + nrV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrV2xAuth' + lteV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LteV2xAuth' + nrUeSidelinkAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + lteUeSidelinkAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + pc5QoSPara: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pc5QoSPara' + + V2xInformation: + description: V2X related N2 information + type: object + properties: + n2Pc5Pol: + $ref: '#/components/schemas/N2InfoContent' + + ProSeInformation: + description: Represents 5G ProSe related N2 information. + type: object + properties: + n2Pc5ProSePol: + $ref: '#/components/schemas/N2InfoContent' + + ImmediateMdtConf: + description: Immediate MDT Configuration + type: object + properties: + jobType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/JobType' + measurementLteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MeasurementLteForMdt' + minItems: 1 + measurementNrList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MeasurementNrForMdt' + minItems: 1 + reportingTriggerList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReportingTrigger' + minItems: 1 + reportInterval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReportIntervalMdt' + reportIntervalNr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReportIntervalNrMdt' + reportAmount: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReportAmountMdt' + eventThresholdRsrp: + type: integer + minimum: 0 + maximum: 97 + eventThresholdRsrq: + type: integer + minimum: 0 + maximum: 34 + eventThresholdRsrpNr: + type: integer + minimum: 0 + maximum: 127 + eventThresholdRsrqNr: + type: integer + minimum: 0 + maximum: 127 + collectionPeriodRmmLte: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CollectionPeriodRmmLteMdt' + collectionPeriodRmmNr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CollectionPeriodRmmNrMdt' + measurementPeriodLte: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MeasurementPeriodLteMdt' + areaScope: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AreaScope' + positioningMethod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PositioningMethodMdt' + addPositioningMethodList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PositioningMethodMdt' + minItems: 1 + mdtAllowedPlmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + maxItems: 16 + sensorMeasurementList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SensorMeasurement' + minItems: 1 + required: + - jobType + + EpsNasSecurityMode: + description: Indicates the EPS NAS Security Mode + type: object + properties: + integrityAlgorithm: + $ref: '#/components/schemas/EpsNasIntegrityAlgorithm' + cipheringAlgorithm: + $ref: '#/components/schemas/EpsNasCipheringAlgorithm' + required: + - integrityAlgorithm + - cipheringAlgorithm + + EcRestrictionDataWb: + description: Enhanced Coverage Restriction Data for WB-N1 mode + type: object + properties: + ecModeARestricted: + type: boolean + default: false + ecModeBRestricted: + type: boolean + required: + - ecModeBRestricted + + ExtAmfEventSubscription: + description: AMF event subscription extended with additional information received for the subscription + allOf: + - $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/AmfEventSubscription' + - $ref: '#/components/schemas/AmfEventSubscriptionAddInfo' + + AmfEventSubscriptionAddInfo: + description: Additional information received for an AMF event subscription, e.g. binding indications + type: object + properties: + bindingInfo: + type: array + items: + type: string + minItems: 1 + maxItems: 2 + subscribingNfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + eventSyncInd: + type: boolean + nfConsumerInfo: + type: array + items: + type: string + minItems: 1 + aoiStateList: + description: > + Map of subscribed Area of Interest (AoI) Event State in the old AMF. The JSON pointer to + an AmfEventArea element in the areaList IE (or a PresenceInfo element in + presenceInfoList IE) of the AmfEvent data type shall be the key of the map. + additionalProperties: + $ref: '#/components/schemas/AreaOfInterestEventState' + + UeDifferentiationInfo: + description: Represents the UE Differentiation Information and its validity time + type: object + properties: + periodicComInd: + $ref: '#/components/schemas/PeriodicCommunicationIndicator' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + scheduledComTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTime' + stationaryInd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndication' + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfile' + batteryInd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndication' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + CeModeBInd: + description: CE-mode-B Support Indicator. + type: object + properties: + ceModeBSupportInd: + type: boolean + required: + - ceModeBSupportInd + + LteMInd: + description: LTE-M Indication. + type: object + properties: + lteCatMInd: + type: boolean + required: + - lteCatMInd + + NpnAccessInfo: + description: NPN Access Information. + type: object + properties: + cellCagInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + minItems: 1 + + ProseContext: + description: Represents the ProSe services related parameters. + type: object + properties: + directDiscovery: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + directComm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + l2Relay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + l3Relay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + l2Remote: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + nrUePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + pc5QoSPara: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pc5QoSPara' + + AnalyticsSubscription: + description: Analytics subscriptions created in the NWDAF. + type: object + properties: + nwdafId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nwdafSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nwdafSubscriptionList: + type: array + items: + $ref: '#/components/schemas/NwdafSubscription' + minItems: 1 + required: + - nwdafSubscriptionList + + NwdafSubscription: + description: Individual NWDAF subscription identified by the subscription Id. + type: object + properties: + nwdafEvtSubsServiceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nwdafEventsSubscription: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NnwdafEventsSubscription' + required: + - nwdafEvtSubsServiceUri + - nwdafEventsSubscription + + UpdpSubscriptionData: + description: UE policy delivery related N1 message notification subscription data. + type: object + properties: + updpNotifySubscriptionId: + type: string + updpNotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + updpCallbackBinding: + type: string + required: + - updpNotifySubscriptionId + - updpNotifyCallbackUri + + ReleaseSessionInfo: + description: PDU session Id(s) and the cause for triggering the release. + type: object + properties: + releaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + releaseCause: + $ref: '#/components/schemas/ReleaseCause' + required: + - releaseSessionList + - releaseCause + + AreaOfInterestEventState: + description: Event State of AoI event in old AMF + type: object + required: + - presence + properties: + presence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + individualPraIdList: + type: array + items: + type: string + minItems: 1 + +# +# SIMPLE DATA TYPES +# + EpsBearerId: + description: EPS Bearer Identifier + type: integer + minimum: 0 + maximum: 15 + Ppi: + description: Paging Policy Indicator + type: integer + minimum: 0 + maximum: 7 + NasCount: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + 5GMmCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + UeSecurityCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + S1UeNetworkCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + DrxParameter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + OmcIdentifier: + description: Represents the OMC Identifier + type: string + MSClassmark2: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + SupportedCodec: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + +# +# ENUMERATIONS +# + StatusChange: +# description: Enumeration for AMF status +# anyOf: +# - type: string + enum: + - AMF_UNAVAILABLE + - AMF_AVAILABLE +# - type: string + N2InformationClass: +# description: Enumeration for N2 Information Class +# anyOf: +# - type: string + enum: + - SM + - NRPPa + - PWS + - PWS-BCAL + - PWS-RF + - RAN + - V2X + - PROSE +# - type: string + N1MessageClass: +# description: Enumeration for N1 Message Class +# anyOf: +# - type: string + enum: + - 5GMM + - SM + - LPP + - SMS + - UPDP + - LCS +# - type: string + N1N2MessageTransferCause: +# description: Enumeration for N1N2Message Transfer Cause +# anyOf: +# - type: string + enum: + - ATTEMPTING_TO_REACH_UE + - N1_N2_TRANSFER_INITIATED + - WAITING_FOR_ASYNCHRONOUS_TRANSFER + - UE_NOT_RESPONDING + - N1_MSG_NOT_TRANSFERRED + - N2_MSG_NOT_TRANSFERRED + - UE_NOT_REACHABLE_FOR_SESSION + - TEMPORARY_REJECT_REGISTRATION_ONGOING + - TEMPORARY_REJECT_HANDOVER_ONGOING + - REJECTION_DUE_TO_PAGING_RESTRICTION + - AN_NOT_RESPONDING + - FAILURE_CAUSE_UNSPECIFIED +# - type: string + UeContextTransferStatus: +# description: Describes the status of an individual ueContext resource in UE Context Transfer procedures +# anyOf: +# - type: string + enum: + - TRANSFERRED + - NOT_TRANSFERRED +# - type: string + N2InformationTransferResult: +# description: Describes the result of N2 information transfer by AMF to the AN +# anyOf: +# - type: string + enum: + - N2_INFO_TRANSFER_INITIATED +# - type: string + CipheringAlgorithm: +# description: Indicates the supported Ciphering Algorithm +# anyOf: +# - type: string + enum: + - NEA0 + - NEA1 + - NEA2 + - NEA3 +# - type: string + IntegrityAlgorithm: +# description: Indicates the supported Integrity Algorithm +# anyOf: +# - type: string + enum: + - NIA0 + - NIA1 + - NIA2 + - NIA3 +# - type: string + SmsSupport: +# description: Indicates the supported SMS delivery of a UE +# anyOf: +# - type: string + enum: + - 3GPP + - NON_3GPP + - BOTH + - NONE +# - type: string + ScType: +# description: Indicates the security context type +# anyOf: +# - type: string + enum: + - NATIVE + - MAPPED +# - type: string + KeyAmfType: +# description: Indicates the Kamf type +# anyOf: +# - type: string + enum: + - KAMF + - KPRIMEAMF +# - type: string + TransferReason: +# description: Indicates UE Context Transfer Reason +# anyOf: +# - type: string + enum: + - INIT_REG + - MOBI_REG + - MOBI_REG_UE_VALIDATED +# - type: string + PolicyReqTrigger: +# description: Policy Request Triggers +# anyOf: +# - type: string + enum: + - LOCATION_CHANGE + - PRA_CHANGE + - ALLOWED_NSSAI_CHANGE + - NWDAF_DATA_CHANGE + - PLMN_CHANGE + - CON_STATE_CHANGE + - SMF_SELECT_CHANGE + - ACCESS_TYPE_CHANGE +# - type: string + RatSelector: +# description: Indicates the RAT type for the transfer of N2 information +# anyOf: +# - type: string + enum: + - E-UTRA + - NR +# - type: string + NgapIeType: +# description: Indicates the supported NGAP IE types +# anyOf: +# - type: string + enum: + - PDU_RES_SETUP_REQ + - PDU_RES_REL_CMD + - PDU_RES_MOD_REQ + - HANDOVER_CMD + - HANDOVER_REQUIRED + - HANDOVER_PREP_FAIL + - SRC_TO_TAR_CONTAINER + - TAR_TO_SRC_CONTAINER + - TAR_TO_SRC_FAIL_CONTAINER + - RAN_STATUS_TRANS_CONTAINER + - SON_CONFIG_TRANSFER + - NRPPA_PDU + - UE_RADIO_CAPABILITY + - RIM_INFO_TRANSFER + - SECONDARY_RAT_USAGE + - PC5_QOS_PARA + - EARLY_STATUS_TRANS_CONTAINER + - UE_RADIO_CAPABILITY_FOR_PAGING +# - type: string + N2InfoNotifyReason: +# description: N2 Information Notify Reason +# anyOf: +# - type: string + enum: + - HANDOVER_COMPLETED +# - type: string + SmfChangeIndication: +# description: Indicates the I-SMF or V-SMF change or removal +# anyOf: +# - type: string + enum: + - CHANGED + - REMOVED +# - type: string + SbiBindingLevel: +# description: SBI Binding Level +# anyOf: +# - type: string + enum: + - NF_INSTANCE_BINDING + - NF_SET_BINDING + - NF_SERVICE_SET_BINDING + - NF_SERVICE_INSTANCE_BINDING +# - type: string + + EpsNasCipheringAlgorithm: +# description: Indicates the supported EPS NAS Ciphering Algorithm +# anyOf: +# - type: string + enum: + - EEA0 + - EEA1 + - EEA2 + - EEA3 +# - type: string + + EpsNasIntegrityAlgorithm: +# description: Indicates the supported EPS NAS Integrity Algorithm +# anyOf: +# - type: string + enum: + - EIA0 + - EIA1 + - EIA2 + - EIA3 +# - type: string + + PeriodicCommunicationIndicator: +# description: Indicates the Periodic Communication Indicator +# anyOf: +# - type: string + enum: + - PIORIODICALLY + - ON_DEMAND +# - type: string + + UuaaMmStatus: +# description: Indicates the UUAA-MM status +# anyOf: +# - type: string + enum: + - SUCCESS + - PENDING + - FAILED +# - type: string + + ReleaseCause: +# description: The cause for triggering the release. +# anyOf: +# - type: string + enum: + - SNPN_SNPN_MOBILITY + - NO_HR_AGREEMENT + - UNSPECIFIED +# - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_EventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_EventExposure.yaml new file mode 100644 index 000000000..c814a065b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_EventExposure.yaml @@ -0,0 +1,1042 @@ +openapi: 3.0.0 + +info: + version: 1.2.1 + title: Namf_EventExposure + description: | + AMF Event Exposure Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +security: + - {} + - oAuth2ClientCredentials: + - namf-evts + +externalDocs: + description: 3GPP TS 29.518 V17.7.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-evts/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /subscriptions: + post: + summary: Namf_EventExposure Subscribe service Operation + tags: + - Subscriptions collection (Collection) + operationId: CreateSubscription + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfCreateEventSubscription' + required: true + responses: + '201': + description: Subsription Created + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-evts//subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AmfCreatedEventSubscription' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onEventReport: + '{$request.body#/subscription/eventNotifyUri}': + post: + summary: Event Notificaiton Delivery + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfEventNotification' + required: true + responses: + '204': + description: Successful acknowledgement + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + onSubscriptionIdChangeEvtReport: + '{$request.body#/subscription/subsChangeNotifyUri}': + post: + summary: Event Notificaiton Delivery For Subscription Id Change + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfEventNotification' + required: true + responses: + '204': + description: Successful acknowledgement + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /subscriptions/{subscriptionId}: + patch: + summary: Namf_EventExposure Subscribe Modify service Operation + tags: + - Individual subscription (Document) + operationId: ModifySubscription + parameters: + - name: subscriptionId + in: path + required: true + description: Unique ID of the subscription to be modified + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AmfUpdateEventSubscriptionItem' + minItems: 1 + - type: array + items: + $ref: '#/components/schemas/AmfUpdateEventOptionItem' + minItems: 1 + maxItems: 1 + required: true + responses: + '200': + description: Subsription modified successfully + content: + application/json: + schema: + $ref: '#/components/schemas/AmfUpdatedEventSubscription' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: Namf_EventExposure Unsubscribe service Operation + tags: + - Individual subscription (Document) + operationId: DeleteSubscription + parameters: + - name: subscriptionId + in: path + required: true + description: Unique ID of the subscription to be deleted + schema: + type: string + responses: + '204': + description: Subsription deleted successfully + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-evts: Access to the Namf_EventExposure API + schemas: + AmfEventSubscription: + description: Represents an individual event subscription resource on AMF + type: object + properties: + eventList: + type: array + items: + $ref: '#/components/schemas/AmfEvent' + minItems: 1 + eventNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifyCorrelationId: + type: string + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subsChangeNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subsChangeNotifyCorrelationId: + type: string + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + excludeSupiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + excludeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + includeSupiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + includeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + anyUE: + type: boolean + options: + $ref: '#/components/schemas/AmfEventMode' + sourceNfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + required: + - eventList + - eventNotifyUri + - notifyCorrelationId + - nfId + AmfEvent: + description: Describes an event to be subscribed + type: object + properties: + type: + $ref: '#/components/schemas/AmfEventType' + immediateFlag: + type: boolean + default: false + areaList: + type: array + items: + $ref: '#/components/schemas/AmfEventArea' + minItems: 1 + locationFilterList: + type: array + items: + $ref: '#/components/schemas/LocationFilter' + minItems: 1 + refId: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + trafficDescriptorList: + type: array + items: + $ref: '#/components/schemas/TrafficDescriptor' + minItems: 1 + reportUeReachable: + type: boolean + default: false + reachabilityFilter: + $ref: '#/components/schemas/ReachabilityFilter' + udmDetectInd: + type: boolean + default: false + maxReports: + type: integer + presenceInfoList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: A map(list of key-value pairs) where praId serves as key. + maxResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + targetArea: + $ref: '#/components/schemas/TargetArea' + snssaiFilter: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + ueInAreaFilter: + $ref: '#/components/schemas/UeInAreaFilter' + minInterval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + nextReport: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + idleStatusInd: + type: boolean + default: false + dispersionArea: + $ref: '#/components/schemas/DispersionArea' + required: + - type + AmfEventNotification: + description: Data within a AMF Event Notification request + type: object + properties: + notifyCorrelationId: + type: string + subsChangeNotifyCorrelationId: + type: string + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + eventSubsSyncInfo: + $ref: '#/components/schemas/AmfEventSubsSyncInfo' + AmfEventReport: + description: Represents a report triggered by a subscribed event type + type: object + properties: + type: + $ref: '#/components/schemas/AmfEventType' + state: + $ref: '#/components/schemas/AmfEventState' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + anyUe: + type: boolean + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + areaList: + type: array + items: + $ref: '#/components/schemas/AmfEventArea' + minItems: 1 + refId: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + additionalLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + rmInfoList: + type: array + items: + $ref: '#/components/schemas/RmInfo' + minItems: 1 + cmInfoList: + type: array + items: + $ref: '#/components/schemas/CmInfo' + minItems: 1 + reachability: + $ref: '#/components/schemas/UeReachability' + commFailure: + $ref: '#/components/schemas/CommunicationFailure' + lossOfConnectReason: + $ref: '#/components/schemas/LossOfConnectivityReason' + numberOfUes: + type: integer + 5gsUserStateList: + type: array + items: + $ref: '#/components/schemas/5GsUserStateInfo' + minItems: 1 + typeCode: + type: string + pattern: '^imeitac-[0-9]{8}$' + registrationNumber: + type: integer + maxAvailabilityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueIdExt: + type: array + items: + $ref: '#/components/schemas/UEIdExt' + minItems: 1 + snssaiTaiList: + type: array + items: + $ref: '#/components/schemas/SnssaiTaiMapping' + minItems: 1 + idleStatusIndication: + $ref: '#/components/schemas/IdleStatusIndication' + ueAccessBehaviorTrends: + type: array + items: + $ref: '#/components/schemas/UeAccessBehaviorReportItem' + minItems: 1 + ueLocationTrends: + type: array + items: + $ref: '#/components/schemas/UeLocationTrendsReportItem' + minItems: 1 + mmTransLocationReportList: + type: array + items: + $ref: '#/components/schemas/MmTransactionLocationReportItem' + minItems: 1 + mmTransSliceReportList: + type: array + items: + $ref: '#/components/schemas/MmTransactionSliceReportItem' + minItems: 1 + required: + - type + - state + - timeStamp + AmfEventMode: + description: Describes how the reports shall be generated by a subscribed event + type: object + properties: + trigger: + $ref: '#/components/schemas/AmfEventTrigger' + maxReports: + type: integer + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + sampRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + partitioningCriteria: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PartitioningCriteria' + minItems: 1 + notifFlag: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationFlag' + required: + - trigger + AmfEventState: + description: Represents the state of a subscribed event + type: object + properties: + active: + type: boolean + remainReports: + type: integer + remainDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - active + RmInfo: + description: Represents the registration state of a UE for an access type + type: object + properties: + rmState: + $ref: '#/components/schemas/RmState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - rmState + - accessType + CmInfo: + description: Represents the connection management state of a UE for an access type + type: object + properties: + cmState: + $ref: '#/components/schemas/CmState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - cmState + - accessType + CommunicationFailure: + description: Describes a communication failure detected by AMF + type: object + properties: + nasReleaseCode: + type: string + ranReleaseCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + AmfCreateEventSubscription: + description: Data within a create AMF event subscription request + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + required: + - subscription + AmfCreatedEventSubscription: + description: Data within a create AMF event subscription response + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - subscription + - subscriptionId + AmfUpdateEventSubscriptionItem: + description: Document describing the modification(s) to an AMF Event Subscription + type: object + properties: + op: + type: string + enum: + - add + - remove + - replace + path: + type: string + pattern: '^\/eventList\/-|(\/eventList\/0|\/eventList\/[1-9][0-9]*){1}(\/presenceInfoList\/0|\/presenceInfoList\/[1-9][0-9]*)?|\/excludeSupiList|\/excludeGpsiList$' + value: + $ref: '#/components/schemas/AmfEvent' + presenceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + excludeSupiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + excludeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + includeSupiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + includeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + required: + - op + - path + AmfUpdateEventOptionItem: + description: Document describing the modifications to AMF event subscription options + type: object + properties: + op: + type: string + enum: + - replace + path: + type: string + pattern: '\/options\/expiry$' + value: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + notifFlag: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationFlag' + required: + - op + - path + - value + AmfUpdatedEventSubscription: + description: Represents a successful update on an AMF Event Subscription + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + required: + - subscription + AmfEventArea: + description: Represents an area to be monitored by an AMF event + type: object + properties: + presenceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + ladnInfo: + $ref: '#/components/schemas/LadnInfo' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiId: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + LadnInfo: + description: LADN Information + type: object + properties: + ladn: + type: string + presence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + required: + - ladn + 5GsUserStateInfo: + description: Represents the 5GS User state of the UE for an access type + type: object + properties: + 5gsUserState: + $ref: '#/components/schemas/5GsUserState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - 5gsUserState + - accessType + TrafficDescriptor: + description: Represents the Traffic Descriptor + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dddTrafficDescriptorList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + UEIdExt: + description: UE Identity + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + + AmfEventSubsSyncInfo: + description: AMF Event Subscriptions Information for synchronization + type: object + properties: + subscriptionList: + type: array + items: + $ref: '#/components/schemas/AmfEventSubscriptionInfo' + minItems: 1 + required: + - subscriptionList + + AmfEventSubscriptionInfo: + description: Individual AMF Event Subscription Information + type: object + properties: + subId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifyCorrelationId: + type: string + refIdList: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + minItems: 1 + oldSubId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - subId + - refIdList + + TargetArea: + description: TA list or TAI range list or any TA + type: object + properties: + taList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + anyTa: + type: boolean + default: false + + SnssaiTaiMapping: + description: List of restricted or unrestricted S-NSSAIs per TAI(s) + type: object + properties: + reportingArea: + $ref: '#/components/schemas/TargetArea' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + supportedSnssaiList: + type: array + items: + $ref: '#/components/schemas/SupportedSnssai' + minItems: 1 + required: + - reportingArea + + UeAccessBehaviorReportItem: + description: Report Item for UE Access Behavior Trends event. + type: object + properties: + stateTransitionType: + $ref: '#/components/schemas/AccessStateTransitionType' + spacing: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + duration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - stateTransitionType + - spacing + - duration + + IdleStatusIndication: + description: Represents the idle status indication. + type: object + properties: + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + edrxCycleLength: + type: integer + suggestedNumOfDlPackets: + type: integer + + UeInAreaFilter: + description: Additional filters for UE in Area Report event + type: object + properties: + ueType: + $ref: '#/components/schemas/UeType' + aerialSrvDnnInd: + type: boolean + default: false + + SupportedSnssai: + description: Supported S-NSSAIs + type: object + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + restrictionInd: + type: boolean + default: false + required: + - sNssai + + UeLocationTrendsReportItem: + description: Report Item for UE Location Trends event. + type: object + properties: + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + n3gaLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/N3gaLocation' + spacing: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + duration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + timestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - spacing + - duration + - timestamp + + DispersionArea: + description: Dispersion Area + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + ncgiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + ecgiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + n3gaInd: + type: boolean + default: false + + MmTransactionLocationReportItem: + description: UE MM Transaction Report Item per Location + type: object + properties: + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + n3gaLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/N3gaLocation' + timestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + transactions: + type: integer + required: + - timestamp + - transactions + + MmTransactionSliceReportItem: + description: UE MM Transaction Report Item per Slice + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + timestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + transactions: + type: integer + required: + - timestamp + - transactions + + AmfEventType: + description: Describes the supported event types of Namf_EventExposure Service + anyOf: + - type: string + enum: + - LOCATION_REPORT + - PRESENCE_IN_AOI_REPORT + - TIMEZONE_REPORT + - ACCESS_TYPE_REPORT + - REGISTRATION_STATE_REPORT + - CONNECTIVITY_STATE_REPORT + - REACHABILITY_REPORT + - COMMUNICATION_FAILURE_REPORT + - UES_IN_AREA_REPORT + - SUBSCRIPTION_ID_CHANGE + - SUBSCRIPTION_ID_ADDITION + - LOSS_OF_CONNECTIVITY + - 5GS_USER_STATE_REPORT + - AVAILABILITY_AFTER_DDN_FAILURE + - TYPE_ALLOCATION_CODE_REPORT + - FREQUENT_MOBILITY_REGISTRATION_REPORT + - SNSSAI_TA_MAPPING_REPORT + - UE_LOCATION_TRENDS + - UE_ACCESS_BEHAVIOR_TRENDS + - UE_MM_TRANSACTION_REPORT + - type: string + AmfEventTrigger: + description: Describes how AMF should generate the report for the event + anyOf: + - type: string + enum: + - ONE_TIME + - CONTINUOUS + - PERIODIC + - type: string + LocationFilter : + description: Describes the supported filters of LOCATION_REPORT event type + anyOf: + - type: string + enum: + - TAI + - CELL_ID + - RAN_NODE + - N3IWF + - UE_IP + - UDP_PORT + - TNAP_ID + - GLI + - TWAP_ID + - type: string + UeReachability: + description: Describes the reachability of the UE + anyOf: + - type: string + enum: + - UNREACHABLE + - REACHABLE + - REGULATORY_ONLY + - type: string + RmState: + description: Describes the registration management state of a UE + anyOf: + - type: string + enum: + - REGISTERED + - DEREGISTERED + - type: string + CmState: + description: Describes the connection management state of a UE + anyOf: + - type: string + enum: + - IDLE + - CONNECTED + - type: string + 5GsUserState: + description: Describes the 5GS User State of a UE + anyOf: + - type: string + enum: + - DEREGISTERED + - CONNECTED_NOT_REACHABLE_FOR_PAGING + - CONNECTED_REACHABLE_FOR_PAGING + - NOT_PROVIDED_FROM_AMF + - type: string + LossOfConnectivityReason: + description: Describes the reason for loss of connectivity + anyOf: + - type: string + enum: + - DEREGISTERED + - MAX_DETECTION_TIME_EXPIRED + - PURGED + - type: string + + ReachabilityFilter: + description: Event filter for REACHABILITY_REPORT event type + anyOf: + - type: string + enum: + - UE_REACHABILITY_STATUS_CHANGE + - UE_REACHABLE_DL_TRAFFIC + - type: string + + UeType: + description: Describes the type of UEs + anyOf: + - type: string + enum: + - AERIAL_UE + - type: string + + AccessStateTransitionType: + description: Access State Transition Type. + anyOf: + - type: string + enum: + - ACCESS_TYPE_CHANGE_3GPP + - ACCESS_TYPE_CHANGE_N3GPP + - RM_STATE_CHANGE_DEREGISTERED + - RM_STATE_CHANGE_REGISTERED + - CM_STATE_CHANGE_IDLE + - CM_STATE_CHANGE_CONNECTED + - HANDOVER + - MOBILITY_REGISTRATION_UPDATE + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_Location.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_Location.yaml new file mode 100644 index 000000000..102714ba4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_Location.yaml @@ -0,0 +1,502 @@ +openapi: 3.0.0 + +info: + version: 1.2.1 + title: Namf_Location + description: | + AMF Location Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +security: + - {} + - oAuth2ClientCredentials: + - namf-loc + +externalDocs: + description: 3GPP TS 29.518 V17.7.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-loc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /{ueContextId}/provide-pos-info: + post: + summary: Namf_Location ProvidePositioningInfo service Operation + tags: + - Individual UE context (Document) + operationId: ProvidePositioningInfo + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestPosInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvidePosInfo' + '204': + description: Successful accept of location request with no information returned. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + description: Unexpected error + callbacks: + onUELocationNotification: + '{$request.body#/locationNotificationUri}': + post: + requestBody: + description: UE Location Event Notification + content: + application/json: + schema: + $ref: '#/components/schemas/NotifiedPosInfo' + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /{ueContextId}/provide-loc-info: + post: + summary: Namf_Location ProvideLocationInfo service Operation + tags: + - Individual UE context (Document) + operationId: ProvideLocationInfo + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestLocInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvideLocInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueContextId}/cancel-pos-info: + post: + summary: Namf_Location CancelLocation service operation + tags: + - Individual UE context (Document) + operationId: CancelLocation + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CancelPosInfo' + required: true + responses: + '204': + description: Expected response to a successful cancellation + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-loc: Access to the Namf_Location API + schemas: + RequestPosInfo: + description: Data within Provide Positioning Information Request + type: object + properties: + lcsClientType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + lcsLocation: + $ref: '#/components/schemas/LocationType' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + priority: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsPriority' + lcsQoS: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocationQoS' + velocityRequested: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityRequested' + lcsSupportedGADShapes: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + additionalLcsSuppGADShapes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + minItems: 1 + locationNotificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + lcsServiceType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsServiceType' + ldrType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + periodicEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MotionEventInfo' + externalClientIdentification: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/ExternalClientIdentification' + afID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + codeWord: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/CodeWord' + uePrivacyRequirements: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/UePrivacyRequirements' + scheduledLocTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reliableLocReq: + type: boolean + default: false + required: + - lcsClientType + - lcsLocation + ProvidePosInfo: + description: Data within Provide Positioning Information Response + type: object + properties: + locationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + localLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocalArea' + accuracyFulfilmentIndicator: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AccuracyFulfilmentIndicator' + ageOfLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + velocityEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' + positioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + gnssPositioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + targetServingNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + targetMmeName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + targetMmeRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + utranSrvccInd: + type: boolean + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + barometricPressure: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/BarometricPressure' + altitude: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/Altitude' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + locationPrivacyVerResult: + $ref: '#/components/schemas/LocationPrivacyVerResult' + achievedQos: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MinorLocationQoS' + + NotifiedPosInfo: + description: Data within EventNotify notification + type: object + properties: + locationEvent: + $ref: '#/components/schemas/LocationEvent' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + locationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + localLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocalArea' + ageOfLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + velocityEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' + positioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + gnssPositioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + servingNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + targetMmeName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + targetMmeRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + utranSrvccInd: + type: boolean + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + barometricPressure: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/BarometricPressure' + altitude: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/Altitude' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + terminationCause: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/TerminationCause' + achievedQos: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MinorLocationQoS' + mscServerId: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/E164Number' + required: + - locationEvent + RequestLocInfo: + description: Data within Provide Location Information Request + type: object + properties: + req5gsLoc: + type: boolean + default: false + reqCurrentLoc: + type: boolean + default: false + reqRatType: + type: boolean + default: false + reqTimeZone: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ProvideLocInfo: + description: Data within Provide Location Information Response + type: object + properties: + currentLoc: + type: boolean + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + additionalLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + geoInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + locationAge: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + CancelPosInfo: + description: Data within a Cancel Location Request + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supi + - hgmlcCallBackURI + - ldrReference + LocationType: + description: Type of location measurement requested + anyOf: + - type: string + enum: + - CURRENT_LOCATION + - CURRENT_OR_LAST_KNOWN_LOCATION + - NOTIFICATION_VERIFICATION_ONLY + - DEFERRED_LOCATION + - type: string + LocationEvent: + description: Type of events initiating location procedures + anyOf: + - type: string + enum: + - EMERGENCY_CALL_ORIGINATION + - EMERGENCY_CALL_RELEASE + - EMERGENCY_CALL_HANDOVER + - ACTIVATION_OF_DEFERRED_LOCATION + - UE_MOBILITY_FOR_DEFERRED_LOCATION + - CANCELLATION_OF_DEFERRED_LOCATION + - type: string + + LocationPrivacyVerResult: + description: The result of location privacy verification by UE + anyOf: + - type: string + enum: + - LOCATION_ALLOWED + - LOCATION_NOT_ALLOWED + - RESPONSE_TIME_OUT + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MBSBroadcast.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MBSBroadcast.yaml new file mode 100644 index 000000000..bf7981a3d --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MBSBroadcast.yaml @@ -0,0 +1,768 @@ +openapi: 3.0.0 + +info: + version: 1.0.2 + title: Namf_MBSBroadcast + description: | + AMF MBSBroadcast Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.518 V17.8.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-mbs-bc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - namf-mbs-bc + +paths: + /mbs-contexts: + post: + summary: Namf_MBSBroadcast ContextCreate service Operation + tags: + - Broadcast MBS session contexts collection (Collection) + operationId: ContextCreate + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/ContextCreateReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + callbacks: + contextStatusNotification: + '{$request.body#/notifyUri}': + post: + requestBody: # notification request without binary body part + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ContextStatusNotification' + multipart/related: # notification request with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/ContextStatusNotification' + binaryDataN2Information1: + type: string + format: binary + binaryDataN2Information2: + type: string + format: binary + binaryDataN2Information3: + type: string + format: binary + binaryDataN2Information4: + type: string + format: binary + binaryDataN2Information5: + type: string + format: binary + binaryDataN2Information6: + type: string + format: binary + binaryDataN2Information7: + type: string + format: binary + binaryDataN2Information8: + type: string + format: binary + binaryDataN2Information9: + type: string + format: binary + binaryDataN2Information10: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful notification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + responses: + '201': + description: MBS Broadcast context created successfully + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-mbs-bc//mbs-contexts/{mbsContextRef}' + required: true + schema: + type: string + content: + application/json: # message without binary body part(s) + schema: + $ref: '#/components/schemas/ContextCreateRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Response parts + jsonData: + $ref: '#/components/schemas/ContextCreateRspData' + binaryDataN2Information1: + type: string + format: binary + binaryDataN2Information2: + type: string + format: binary + binaryDataN2Information3: + type: string + format: binary + binaryDataN2Information4: + type: string + format: binary + binaryDataN2Information5: + type: string + format: binary + binaryDataN2Information6: + type: string + format: binary + binaryDataN2Information7: + type: string + format: binary + binaryDataN2Information8: + type: string + format: binary + binaryDataN2Information9: + type: string + format: binary + binaryDataN2Information10: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /mbs-contexts/{mbsContextRef}: + delete: + summary: Namf_MBSBroadcast ContextDelete service Operation + tags: + - Individual broadcast MBS session context (Document) + operationId: ContextDelete + parameters: + - name: mbsContextRef + in: path + required: true + description: Unique ID of the broadcast MSB session context to be deleted + schema: + type: string + responses: + '204': + description: successful deletion + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /mbs-contexts/{mbsContextRef}/update: + post: + summary: Namf_MBSBroadcast ContextUpdate service Operation + tags: + - Individual broadcast MBS session context (Document) + operationId: ContextUpdate + parameters: + - name: mbsContextRef + in: path + description: Unique ID of the broadcast MSB session context to be updated + required: true + schema: + type: string + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/ContextUpdateReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: MBS Broadcast context updated successfully + content: + application/json: # message without binary body part(s) + schema: + $ref: '#/components/schemas/ContextUpdateRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Response parts + jsonData: + $ref: '#/components/schemas/ContextUpdateRspData' + binaryDataN2Information1: + type: string + format: binary + binaryDataN2Information2: + type: string + format: binary + binaryDataN2Information3: + type: string + format: binary + binaryDataN2Information4: + type: string + format: binary + binaryDataN2Information5: + type: string + format: binary + binaryDataN2Information6: + type: string + format: binary + binaryDataN2Information7: + type: string + format: binary + binaryDataN2Information8: + type: string + format: binary + binaryDataN2Information9: + type: string + format: binary + binaryDataN2Information10: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '204': + description: MBS Broadcast context updated successfully. No Content. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-mbs-bc: Access to the Namf_MBSBroadcast API + + schemas: + +# +# STRUCTURED DATA TYPES +# + ContextCreateReqData: + description: Data within ContextCreate Request + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + mbsServiceAreaInfoList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceAreaInfo' + minItems: 1 + mbsServiceArea: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceArea' + n2MbsSmInfo: + $ref: '#/components/schemas/N2MbsSmInfo' + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + maxResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + mbsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + mbsmfServiceInstId: + type: string + required: + - mbsSessionId + - n2MbsSmInfo + - notifyUri + - snssai + oneOf: + - required: [ mbsServiceArea ] + - required: [ mbsServiceAreaInfoList ] + + ContextCreateRspData: + description: Data within ContextCreate Response + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + n2MbsSmInfoList: + type: array + items: + $ref: '#/components/schemas/N2MbsSmInfo' + minItems: 1 + maxItems: 10 + operationStatus: + $ref: '#/components/schemas/OperationStatus' + required: + - mbsSessionId + + + ContextUpdateReqData: + description: Data within ContextUpdate Request + type: object + properties: + mbsServiceArea: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceArea' + mbsServiceAreaInfoList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceAreaInfo' + minItems: 1 + n2MbsSmInfo: + $ref: '#/components/schemas/N2MbsSmInfo' + ranIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + noNgapSignallingInd: + type: boolean + enum: + - true + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + maxResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + n2MbsInfoChangeInd: + type: boolean + not: + required: [ mbsServiceArea, mbsServiceAreaInfoList ] + + ContextStatusNotification: + description: Data within ContextStatusNotify Request + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + areaSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AreaSessionId' + n2MbsSmInfoList: + type: array + items: + $ref: '#/components/schemas/N2MbsSmInfo' + minItems: 1 + maxItems: 10 + operationEvents: + type: array + items: + $ref: '#/components/schemas/OperationEvent' + minItems: 1 + operationStatus: + $ref: '#/components/schemas/OperationStatus' + required: + - mbsSessionId + + ContextUpdateRspData: + description: Data within ContextUpdate Response + type: object + properties: + n2MbsSmInfoList: + type: array + items: + $ref: '#/components/schemas/N2MbsSmInfo' + minItems: 1 + maxItems: 10 + operationStatus: + $ref: '#/components/schemas/OperationStatus' + + N2MbsSmInfo: + description: N2 MBS Session Management information + type: object + properties: + ngapIeType: + $ref: '#/components/schemas/NgapIeType' + ngapData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + randId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + required: + - ngapIeType + - ngapData + - randId + + OperationEvent: + description: Operation Event for a Broadcast MBS Session. + type: object + properties: + opEventType: + $ref: '#/components/schemas/OpEventType' + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ngranFailureEventList: + type: array + items: + $ref: '#/components/schemas/NgranFailureEvent' + minItems: 1 + required: + - opEventType + + + NgranFailureEvent: + description: NG-RAN failure event for a NG-RAN + type: object + properties: + ngranId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + ngranFailureIndication: + $ref: '#/components/schemas/NgranFailureIndication' + required: + - ngranId + - ngranFailureIndication + + +# +# SIMPLE DATA TYPES +# + + +# +# ENUMERATIONS +# + + OperationStatus: + description: Status of a Broadcast MBS session start or update operation. + anyOf: + - type: string + enum: + - MBS_SESSION_START_COMPLETE + - MBS_SESSION_START_INCOMPLETE + - MBS_SESSION_UPDATE_COMPLETE + - MBS_SESSION_UPDATE_INCOMPLETE + - type: string + + NgapIeType: + description: NGAP Information Element Type + anyOf: + - type: string + enum: + - MBS_SES_REQ + - MBS_SES_RSP + - MBS_SES_FAIL + - MBS_SES_REL_RSP + - type: string + + OpEventType: + description: Operation Event Type. + anyOf: + - type: string + enum: + - AMF_CHANGE + - NG_RAN_EVENT + - type: string + + NgranFailureIndication: + description: Indicates a NG-RAN failure event. + anyOf: + - type: string + enum: + - NG_RAN_RESTART_OR_START + - NG_RAN_FAILURE_WITHOUT_RESTART + - NG_RAN_NOT_REACHABLE + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MBSCommunication.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MBSCommunication.yaml new file mode 100644 index 000000000..8fb9ce341 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MBSCommunication.yaml @@ -0,0 +1,168 @@ +openapi: 3.0.0 + +info: + version: 1.0.1 + title: Namf_MBSCommunication + description: | + AMF Communication Service for MBS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.518 V17.8.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-mbs-comm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - namf-mbs-comm + +paths: + /n2-messages/transfer: + post: + summary: Namf_MBSCommunication N2 Message Transfer service Operation + tags: + - N2Messages Handler (custom operation) + operationId: N2MessageTransfer + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/MbsN2MessageTransferReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: MBS N2 Message Transfer successfully initiated + content: + application/json: + schema: + $ref: '#/components/schemas/MbsN2MessageTransferRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-mbs-comm: Access to the Namf_MBSCommunication API + + schemas: + +# +# STRUCTURED DATA TYPES +# + + MbsN2MessageTransferReqData: + description: Data within MBS N2 Message Transfer Request + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + areaSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AreaSessionId' + n2MbsSmInfo: + $ref: '#/components/schemas/N2MbsSmInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - mbsSessionId + - n2MbsSmInfo + + + + MbsN2MessageTransferRspData: + description: Data within MBS N2 Message Transfer Response + type: object + properties: + result: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InformationTransferResult' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - result + + + + + N2MbsSmInfo: + description: N2 MBS Session Management information + type: object + properties: + ngapIeType: + $ref: '#/components/schemas/MbsNgapIeType' + ngapData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - ngapIeType + - ngapData + +# +# SIMPLE DATA TYPES +# + + +# +# ENUMERATIONS +# + + MbsNgapIeType: + description: NGAP Information Element Type + anyOf: + - type: string + enum: + - MBS_SES_ACT_REQ + - MBS_SES_DEACT_REQ + - MBS_SES_UPD_REQ + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MT.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MT.yaml new file mode 100644 index 000000000..209e03798 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29518_Namf_MT.yaml @@ -0,0 +1,384 @@ +openapi: 3.0.0 + +info: + version: 1.2.1 + title: Namf_MT + description: | + AMF Mobile Terminated Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +security: + - {} + - oAuth2ClientCredentials: + - namf-mt + +externalDocs: + description: 3GPP TS 29.518 V17.8.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-mt/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + '/ue-contexts/{ueContextId}': + get: + summary: Namf_MT Provide Domain Selection Info service Operation + tags: + - ueContext (Document) + operationId: Provide Domain Selection Info + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|.+)$' + - name: info-class + in: query + description: UE Context Information Class + schema: + $ref: '#/components/schemas/UeContextInfoClass' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: old-guami + in: query + description: Old GUAMI + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + responses: + '200': + description: Requested UE Context Information returned + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/ue-reachind: + put: + summary: Namf_MT EnableUEReachability service Operation + tags: + - ueReachInd (Document) + operationId: EnableUeReachability + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnableUeReachabilityReqData' + required: true + responses: + '200': + description: UE has become reachable as desired + content: + application/json: + schema: + $ref: '#/components/schemas/EnableUeReachabilityRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetailsEnableUeReachability' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: Gateway Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetailsEnableUeReachability' + default: + description: Unexpected error + + /ue-contexts: + post: + summary: Namf_MT EnableGroupReachability service Operation + tags: + - ueContexts (collection) + operationId: EnableGroupReachability + requestBody: + description: list of UEs requested to be made reachable for the related TMGI + content: + application/json: + schema: + $ref: '#/components/schemas/EnableGroupReachabilityReqData' + required: true + responses: + '200': + description: Successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/EnableGroupReachabilityRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + description: Unexpected error + callbacks: + reachabilityNotification: + '{request.body#/reachabilityNotifyUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReachabilityNotificationData' + responses: + '204': + description: UE reachability notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-mt: Access to the Namf_MT API + schemas: + EnableUeReachabilityReqData: + description: Data within the Enable UE Reachability Request + type: object + properties: + reachability: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + extBufSupport: + type: boolean + default: false + required: + - reachability + EnableUeReachabilityRspData: + description: Data within the Enable UE Reachability Response + type: object + properties: + reachability: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - reachability + UeContextInfo: + description: UE Context Information + type: object + properties: + supportVoPS: + type: boolean + supportVoPSn3gpp: + type: boolean + lastActTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ProblemDetailsEnableUeReachability: + description: Enable UE Reachability Error Detail + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/AdditionInfoEnableUeReachability' + AdditionInfoEnableUeReachability: + description: Additional information to be returned in EnableUeReachability error response + type: object + properties: + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + EnableGroupReachabilityReqData: + description: Data within the Enable Group Reachability Request + type: object + properties: + ueInfoList: + type: array + items: + $ref: '#/components/schemas/UeInfo' + minItems: 1 + tmgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tmgi' + reachabilityNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + mbsServiceAreaInfoList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceAreaInfo' + minItems: 1 + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueInfoList + - tmgi + EnableGroupReachabilityRspData: + description: Data within the Enable Group Reachability Response + type: object + properties: + ueConnectedList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + UeInfo: + description: list of UEs requested to be made reachable for the MBS Session + type: object + properties: + ueList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + required: + - ueList + + ReachabilityNotificationData: + description: Data within the UE Reachability Info Notify + type: object + properties: + reachableUeList: + type: array + items: + $ref: '#/components/schemas/ReachableUeInfo' + minItems: 1 + unreachableUeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + ReachableUeInfo: + description: Contains the reachable UE Information + type: object + properties: + ueList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + userLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + required: + - ueList + + UeContextInfoClass: + description: Indicates the UE Context information class + anyOf: + - type: string + enum: + - TADS + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Application_Data.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Application_Data.yaml new file mode 100644 index 000000000..641e86945 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Application_Data.yaml @@ -0,0 +1,3311 @@ +openapi: 3.0.0 + +info: + version: '-' + title: Unified Data Repository Service API file for Application Data + description: | + The API version is defined in 3GPP TS 29.504 + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.519 V17.8.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, + Application Data and Structured Data for Exposure. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /application-data/pfds: + get: + summary: Retrieve PFDs for application identifier(s) + operationId: ReadPFDData + tags: + - PFD Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:pfds:read + parameters: + - name: appId + in: query + description: > + Contains the information of the application identifier(s) for the querying PFD + Data resource. If none appId is included in the URI, it applies to all application + identifier(s) for the querying PFD Data resource. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: A representation of PFDs for request applications is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdDataForAppExt' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/pfds/{appId}: + get: + summary: Retrieve the corresponding PFDs of the specified application identifier + operationId: ReadIndividualPFDData + tags: + - Individual PFD Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:pfds:read + parameters: + - name: appId + in: path + description: > + Indicate the application identifier for the request pfd(s). It shall apply the + format of Data type ApplicationId. + required: true + schema: + type: string + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + A representation of PFDs for the request application identified by the application + identifier is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the corresponding PFDs of the specified application identifier + operationId: DeleteIndividualPFDData + tags: + - Individual PFD Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:pfds:modify + parameters: + - name: appId + in: path + description: > + Indicate the application identifier for the request pfd(s). It shall apply the + format of Data type ApplicationId. + required: true + schema: + type: string + responses: + '204': + description: > + Successful case. The Individual PFD Data resource related to the application + identifier was deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or update the corresponding PFDs for the specified application identifier + operationId: CreateOrReplaceIndividualPFDData + tags: + - Individual PFD Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:pfds:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + parameters: + - name: appId + in: path + description: > + Indicate the application identifier for the request pfd(s). It shall apply the format + of Data type ApplicationId. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual PFD Data resource related to the application-identifier + is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + headers: + Location: + description: > + 'Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/pfds/{appId}' + required: true + schema: + type: string + '200': + description: > + Successful case. The upgrade of an Individual PFD Data resource related to the + application identifier is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/influenceData: + get: + summary: Retrieve Traffic Influence Data + operationId: ReadInfluenceData + tags: + - Influence Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:read + parameters: + - name: influence-Ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: internal-Group-Ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: supp-feat + in: query + required: false + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The Traffic Influence Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/influenceData/{influenceId}: + put: + summary: Create or update an individual Influence Data resource + operationId: CreateOrReplaceIndividualInfluenceData + tags: + - Individual Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + parameters: + - name: influenceId + in: path + description: > + The Identifier of an Individual Influence Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual Traffic Influence Data resource is confirmed + and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + headers: + Location: + description: > + 'Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/influenceData/{influenceId}' + required: true + schema: + type: string + '200': + description: > + The update of an Individual Traffic Influence Data resource is confirmed and a + response body containing Traffic Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Influence Data resource + operationId: UpdateIndividualInfluenceData + tags: + - Individual Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/TrafficInfluDataPatch' + parameters: + - name: influenceId + in: path + description: > + The Identifier of an Individual Influence Data to be updated. It shall apply + the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: > + The update of an Individual Traffic Influence Data resource is confirmed and + a response body containing Traffic Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Influence Data resource + operationId: DeleteIndividualInfluenceData + tags: + - Individual Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:modify + parameters: + - name: influenceId + in: path + description: > + The Identifier of an Individual Influence Data to be deleted. It shall apply + the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Influence Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/influenceData/subs-to-notify: + post: + summary: Create a new Individual Influence Data Subscription resource + operationId: CreateIndividualInfluenceDataSubscription + tags: + - Influence Data Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + responses: + '201': + description: The subscription was created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + trafficInfluenceDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + oneOf: + - $ref: '#/components/schemas/TrafficInfluData' + - $ref: '#/components/schemas/TrafficInfluDataNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read Influence Data Subscriptions + operationId: ReadInfluenceDataSubscriptions + tags: + - Influence Data Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:read + parameters: + - name: dnn + in: query + description: Identifies a DNN. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: snssai + in: query + description: Identifies a slice. + required: false + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: internal-Group-Id + in: query + description: Identifies a group of users. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: supi + in: query + description: Identifies a user. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '200': + description: > + The subscription information as request in the request URI query parameter(s) + are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluSub' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/influenceData/subs-to-notify/{subscriptionId}: + get: + summary: Get an existing individual Influence Data Subscription resource + operationId: ReadIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:read + parameters: + - name: subscriptionId + in: path + description: > + String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription information is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Modify an existing individual Influence Data Subscription resource + operationId: ReplaceIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:modify + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + parameters: + - name: subscriptionId + in: path + description: > + String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Influence Data Subscription resource + operationId: DeleteIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:modify + parameters: + - name: subscriptionId + in: path + description: > + String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '204': + description: The subscription was terminated successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/bdtPolicyData: + get: + summary: Retrieve applied BDT Policy Data + operationId: ReadBdtPolicyData + tags: + - BdtPolicy Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:bdt-policy-data:read + parameters: + - name: bdt-policy-ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: internal-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + responses: + '200': + description: The applied BDT policy Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BdtPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/bdtPolicyData/{bdtPolicyId}: + put: + summary: Create an individual applied BDT Policy Data resource + operationId: CreateIndividualAppliedBdtPolicyData + tags: + - Individual Applied BDT Policy Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:bdt-policy-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + parameters: + - name: bdtPolicyId + in: path + description: > + The Identifier of an Individual Applied BDT Policy Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual Applied BDT Policy Data resource is confirmed and a + representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/bdtPolicyData/{bdtPolicyId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Applied BDT Policy Data resource + operationId: UpdateIndividualAppliedBdtPolicyData + tags: + - Individual Applied BDT Policy Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:bdt-policy-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/BdtPolicyDataPatch' + parameters: + - name: bdtPolicyId + in: path + description: > + The Identifier of an Individual Applied BDT Policy Data to be updated. It shall + apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: > + The update of an Individual Applied BDT Policy Data resource is confirmed and + a response body containing Applied BDT Policy Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Applied BDT Policy Data resource + operationId: DeleteIndividualAppliedBdtPolicyData + tags: + - Individual Applied BDT Policy Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:bdt-policy-data:modify + parameters: + - name: bdtPolicyId + in: path + description: > + The Identifier of an Individual Applied BDT Policy Data to be deleted. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Applied BDT Policy Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/iptvConfigData: + get: + summary: Retrieve IPTV configuration Data + operationId: ReadIPTVCongifurationData + tags: + - IPTV Configuration Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:iptv-config-data:read + parameters: + - name: config-ids + in: query + description: Each element identifies a configuration. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: inter-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + responses: + '200': + description: The IPTV configuration data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IptvConfigData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/iptvConfigData/{configurationId}: + put: + summary: Create or update an individual IPTV configuration resource + operationId: CreateOrReplaceIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:iptv-config-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + parameters: + - name: configurationId + in: path + description: > + The Identifier of an Individual IPTV Configuration Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual IPTV Configuration Data resource is confirmed and a + representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: The update of an Individual IPTV configuration resource. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Partial update an individual IPTV configuration resource + operationId: PartialReplaceIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:iptv-config-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29522_IPTVConfiguration.yaml#/components/schemas/IptvConfigDataPatch' + parameters: + - name: configurationId + in: path + description: > + The Identifier of an Individual IPTV Configuration Data to be updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: The update of an Individual IPTV configuration resource. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual IPTV configuration resource + operationId: DeleteIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:iptv-config-data:modify + parameters: + - name: configurationId + in: path + description: > + The Identifier of an Individual IPTV Configuration to be deleted. It shall + apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The resource was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/serviceParamData: + get: + summary: Retrieve Service Parameter Data + operationId: ReadServiceParameterData + tags: + - Service Parameter Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:service-param-data:read + parameters: + - name: service-param-ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: internal-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: ue-ipv4s + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + - name: ue-ipv6s + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + - name: ue-macs + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + - name: any-ue + in: query + description: Indicates whether the request is for any UE. + required: false + schema: + type: boolean + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The Service Parameter Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceParameterData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/serviceParamData/{serviceParamId}: + put: + summary: Create or update an individual Service Parameter Data resource + operationId: CreateOrReplaceServiceParameterData + tags: + - Individual Service Parameter Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:service-param-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + parameters: + - name: serviceParamId + in: path + description: > + The Identifier of an Individual Service Parameter Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual Service Parameter Data resource is confirmed + and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + headers: + Location: + description: > + 'Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/serviceParamData/{serviceParamId}' + required: true + schema: + type: string + '200': + description: > + The update of an Individual Service Parameter Data resource is confirmed and + a response body containing Service Parameter Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Service Parameter Data resource + operationId: UpdateIndividualServiceParameterData + tags: + - Individual Service Parameter Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:service-parameter-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/ServiceParameterDataPatch' + parameters: + - name: serviceParamId + in: path + description: > + The Identifier of an Individual Service Parameter Data to be updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: > + The update of an Individual Service Parameter Data resource is confirmed + and a response body containing Service Parameter Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Service Parameter Data resource + operationId: DeleteIndividualServiceParameterData + tags: + - Individual Service Parameter Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:service-parameter-data:modify + parameters: + - name: serviceParamId + in: path + description: > + The Identifier of an Individual Service Parameter Data to be deleted. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Service Parameter Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/am-influence-data: + get: + summary: Retrieve AM Influence Data + operationId: ReadAmInfluenceData + tags: + - AM Influence Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:am-influence-data:read + parameters: + - name: am-influence-ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: dnn-snssai-infos + in: query + description: Each element identifies a combination of (DNN, S-NSSAI). + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + minItems: 1 + - name: internal-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: any-ue + in: query + description: Indicates whether the request is for any UE. + required: false + schema: + type: boolean + - name: supp-feat + in: query + required: false + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The AM Influence Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmInfluData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/am-influence-data/{amInfluenceId}: + put: + summary: Create or update an individual AM Influence Data resource + operationId: CreateOrReplaceIndividualAmInfluenceData + tags: + - Individual AM Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:am-influence-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluData' + parameters: + - name: amInfluenceId + in: path + description: > + The Identifier of an Individual AM Influence Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual AM Influence Data resource is confirmed and + a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluData' + headers: + Location: + description: > + 'Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/am-influence-data/{amInfluenceId}' + required: true + schema: + type: string + '200': + description: > + The update of an Individual AM Influence Data resource is confirmed and a response + body containing AM Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual AM Influence Data resource + operationId: UpdateIndividualAmInfluenceData + tags: + - Individual AM Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:am-influence-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AmInfluDataPatch' + parameters: + - name: amInfluenceId + in: path + description: > + The Identifier of an Individual AM Influence Data to be updated. It shall + apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: > + The update of an Individual AM Influence Data resource is confirmed and a + response body containing AM Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual AM Influence Data resource + operationId: DeleteIndividualAmInfluenceData + tags: + - Individual AM Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:am-influence-data:modify + parameters: + - name: amInfluenceId + in: path + description: > + The Identifier of an Individual AM Influence Data to be deleted. It shall + apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual AM Influence Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of application data changes + operationId: CreateIndividualApplicationDataSubscription + tags: + - ApplicationDataSubscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + responses: + '201': + description: > + Upon success, a response body containing a representation of each + Individual subscription resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + applicationDataChangeNotif: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApplicationDataChangeNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read Application Data change Subscriptions + operationId: ReadApplicationDataChangeSubscriptions + tags: + - ApplicationDataSubscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:read + parameters: + - name: data-filter + in: query + description: The data filter for the query. + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/DataFilter' + responses: + '200': + description: > + The subscription information as request in the request URI query parameter(s) + are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApplicationDataSubs' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/subs-to-notify/{subsId}: + parameters: + - name: subsId + in: path + required: true + schema: + type: string + put: + summary: Modify a subscription to receive notification of application data changes + operationId: ReplaceIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:modify + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + responses: + '200': + description: The individual subscription resource was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + '204': + description: > + The individual subscription resource was updated successfully and no + additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the individual Application Data subscription + operationId: DeleteIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:modify + responses: + '204': + description: Upon success, an empty response body shall be returned. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Get an existing individual Application Data Subscription resource + operationId: ReadIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:read + parameters: + - name: subsId + in: path + description: > + String identifying a subscription to the Individual Application Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription information is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/eas-deploy-data: + get: + summary: Retrieve EAS Deployment Information Data + operationId: ReadEasDeployData + tags: + - EAS Deployment Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:eas-deploy-data:read + parameters: + - name: dnn + in: query + description: Identifies a DNN. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: snssai + in: query + description: Identifies an S-NSSAI. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: internal-group-id + in: query + description: Identifies a group of users. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: appId + in: query + description: Identifies an application. + required: false + schema: + type: string + responses: + '200': + description: The EAS Deployment Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + minItems: 1 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/eas-deploy-data/{easDeployInfoId}: + get: + summary: Retrieve an individual EAS Deployment Data resource + operationId: ReadIndividualEasDeployData + tags: + - Individual EAS Deployment Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:eas-deploy-data:read + parameters: + - name: easDeployInfoId + description: > + String identifying an Individual EAS Deployment Information Data resource. + in: path + required: true + schema: + type: string + responses: + '200': + description: > + The EAS Deployment Data stored in the UDR for an Individual EAS Deployment + Information Data resource is returned. + content: + application/json: + schema: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or update an individual EAS Deployment Data resource + operationId: CreateOrReplaceIndividualEasDeployData + tags: + - Individual EAS Deployment Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:eas-deploy-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + parameters: + - name: easDeployInfoId + in: path + description: > + The Identifier of an Individual EAS Deployment Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual EAS Deployment Data resource is confirmed and a + representation of that resource is returned. + content: + application/json: + schema: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/eas-deploy-data/{easDeployInfoId} + required: true + schema: + type: string + '200': + description: > + The update of an Individual EAS Deployment Data resource is confirmed and a response + body containing EAS Deployment Data shall be returned. + content: + application/json: + schema: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual EAS Deployment Data resource + operationId: DeleteIndividualEasDeployData + tags: + - Individual EasDeployment Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:eas-deploy-data:modify + parameters: + - name: easDeployInfoId + in: path + description: > + The Identifier of an Individual EAS Deployment Data to be updated. It shall apply the + format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Influence Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + schemas: + + TrafficInfluData: + description: Represents the Traffic Influence Data. + type: object + properties: + upPathChgNotifCorreId: + type: string + description: > + Contains the Notification Correlation Id allocated by the NEF for the UP + path change notification. + appReloInd: + type: boolean + description: > + Identifies whether an application can be relocated once a location of the + application has been selected. + afAppId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: > + Identifies Ethernet packet filters. Either "trafficFilters" or + "ethTrafficFilters" shall be included if applicable. + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: > + Identifies IP packet filters. Either "trafficFilters" or "ethTrafficFilters" + shall be included if applicable. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + traffCorreInd: + type: boolean + validStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + description: Identifies the temporal validities for the N6 traffic routing requirement. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + upPathChgNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + headers: + type: array + items: + type: string + minItems: 1 + subscribedEvents: + type: array + items: + $ref: 'TS29522_TrafficInfluence.yaml#/components/schemas/SubscribedEvent' + minItems: 1 + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + afAckInd: + type: boolean + addrPreserInd: + type: boolean + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + simConnInd: + type: boolean + description: > + Indicates whether simultaneous connectivity should be temporarily + maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + allOf: + - oneOf: + - required: [afAppId] + - required: [trafficFilters] + - required: [ethTrafficFilters] + - oneOf: + - required: [supi] + - required: [interGroupId] + + TrafficInfluDataPatch: + description: Represents the Traffic Influence Data to be updated in the UDR. + type: object + properties: + upPathChgNotifCorreId: + type: string + description: > + Contains the Notification Correlation Id allocated by the NEF for the + UP path change notification. + appReloInd: + type: boolean + description: > + Identifies whether an application can be relocated once a location of the application + has been selected. + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: > + Identifies Ethernet packet filters. Either "trafficFilters" or "ethTrafficFilters" + shall be included if applicable. + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: > + Identifies IP packet filters. Either "trafficFilters" or "ethTrafficFilters" + shall be included if applicable. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + traffCorreInd: + type: boolean + validStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + description: Identifies the temporal validities for the N6 traffic routing requirement. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + upPathChgNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + headers: + type: array + items: + type: string + minItems: 1 + afAckInd: + type: boolean + addrPreserInd: + type: boolean + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + simConnInd: + type: boolean + description: > + Indicates whether simultaneous connectivity should be temporarily maintained + for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + + TrafficInfluSub: + description: Represents traffic influence subscription data. + type: object + properties: + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Each element identifies a DNN. + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: Each element identifies a slice. + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + description: Each element identifies a group of users. + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + description: Each element identifies the user. + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - notificationUri + oneOf: + - required: [dnns] + - required: [snssais] + - required: [internalGroupIds] + - required: [supis] + + TrafficInfluDataNotif: + description: Represents traffic influence data for notification. + type: object + properties: + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + trafficInfluData: + $ref: '#/components/schemas/TrafficInfluData' + required: + - resUri + + PfdDataForAppExt: + description: Represents the PFDs and related data for the application. + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + pfds: + type: array + items: + $ref: 'TS29551_Nnef_PFDmanagement.yaml#/components/schemas/PfdContent' + minItems: 1 + cachingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + allowedDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - applicationId + - pfds + + BdtPolicyData: + description: Represents applied BDT policy data. + type: object + properties: + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - bdtRefId + + BdtPolicyDataPatch: + description: > + Represents modification instructions to be performed on the applied BDT policy data. + type: object + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + required: + - bdtRefId + + IptvConfigData: + description: Represents IPTV configuration data information. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + interGroupId: + description: Identifies a group of users. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + afAppId: + type: string + multiAccCtrls: + type: object + additionalProperties: + $ref: 'TS29522_IPTVConfiguration.yaml#/components/schemas/MulticastAccessControl' + minProperties: 1 + description: > + Identifies a list of multicast address access control information. Any string + value can be used as a key of the map. + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - afAppId + - multiAccCtrls + oneOf: + - required: [interGroupId] + - required: [supi] + + ServiceParameterData: + description: Represents the service parameter data. + type: object + properties: + appId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueIpv4: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + anyUeInd: + type: boolean + paramOverPc5: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverPc5' + paramOverUu: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverUu' + paramForProSeDd: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeDd' + paramForProSeDc: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeDc' + paramForProSeU2NRelUe: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeU2NRelUe' + paramForProSeRemUe: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeRemUe' + urspGuidance: + type: array + items: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/UrspRuleRequest' + minItems: 1 + description: Contains the service parameter used to guide the URSP. + deliveryEvents: + type: array + items: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/Event' + minItems: 1 + description: Contains the outcome of the UE Policy Delivery. + policDelivNotifCorreId: + type: string + description: > + Contains the Notification Correlation Id allocated by the NEF for the notification + of UE Policy delivery outcome. + policDelivNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + headers: + type: array + items: + type: string + minItems: 1 + resetIds: + type: array + items: + type: string + minItems: 1 + + ServiceParameterDataPatch: + description: Represents the service parameter data that can be updated. + type: object + properties: + paramOverPc5: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverPc5' + paramOverUu: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverUu' + paramForProSeDd: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeDd' + paramForProSeDc: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeDc' + paramForProSeU2NRelUe: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeU2NRelUe' + paramForProSeRemUe: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeRemUe' + urspInfluence: + type: array + items: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/UrspRuleRequest' + minItems: 1 + description: Contains the service parameter used to influence the URSP. + deliveryEvents: + type: array + items: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/Event' + minItems: 1 + description: Contains the outcome of the UE Policy Delivery. + policDelivNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + AmInfluData: + description: Represents the AM Influence Data. + type: object + properties: + appIds: + type: array + items: + type: string + minItems: 1 + description: Identifies one or more applications. + dnnSnssaiInfos: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + minItems: 1 + description: Identifies one or more DNN, S-NSSAI combinations. + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + anyUeInd: + type: boolean + description: Indicates whether the data is applicable for any UE. + policyDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + evSubs: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/AmInfluEvent' + minItems: 1 + description: List of AM related events for which a subscription is required. + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorrId: + type: string + description: Notification correlation identifier. + headers: + type: array + description: Contains the headers provisioned by the NEF. + items: + type: string + minItems: 1 + thruReq: + type: boolean + description: Indicates whether high throughput is desired for the indicated UE traffic. + covReq: + type: array + items: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/ServiceAreaCoverageInfo' + minItems: 1 + description: Indicates the service area coverage requirement. + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + allOf: + - anyOf: + - required: [thruReq] + - required: [covReq] + - oneOf: + - required: [supi] + - required: [interGroupId] + - required: [anyUeInd] + + AmInfluDataPatch: + description: Represents the AM Influence Data that can be updated. + type: object + properties: + appIds: + type: array + items: + type: string + minItems: 1 + description: Identifies one or more applications. + nullable: true + dnnSnssaiInfos: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + minItems: 1 + description: Identifies one or more DNN, S-NSSAI combinations. + nullable: true + evSubs: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/AmInfluEvent' + minItems: 1 + description: List of AM related events for which a subscription is required. + nullable: true + headers: + type: array + description: Contains the headers provisioned by the NEF. + items: + type: string + minItems: 1 + thruReq: + type: boolean + description: Indicates whether high throughput is desired for the indicated UE traffic. + nullable: true + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriRm' + notifCorrId: + type: string + description: Notification correlation identifier. + nullable: true + covReq: + type: array + items: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/ServiceAreaCoverageInfo' + minItems: 1 + description: Indicates the service area coverage requirement. + nullable: true + + ApplicationDataSubs: + description: Identifies a subscription to application data change notification. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + dataFilters: + type: array + items: + $ref: '#/components/schemas/DataFilter' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + immRep: + type: boolean + description: Immediate reporting indication. + amInfluEntries: + type: array + items: + $ref: '#/components/schemas/AmInfluData' + minItems: 1 + description: The AM Influence Data entries stored in the UDR that match a subscription. + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - notificationUri + + ApplicationDataChangeNotif: + description: Contains changed application data for which notification was requested. + type: object + properties: + iptvConfigData: + $ref: '#/components/schemas/IptvConfigData' + pfdData: + $ref: 'TS29551_Nnef_PFDmanagement.yaml#/components/schemas/PfdChangeNotification' + bdtPolicyData: + $ref: '#/components/schemas/BdtPolicyData' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + serParamData: + $ref: '#/components/schemas/ServiceParameterData' + amInfluData: + $ref: '#/components/schemas/AmInfluData' + required: + - resUri + + DataFilter: + description: Identifies a data filter. + type: object + properties: + dataInd: + $ref: '#/components/schemas/DataInd' + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + ueIpv4s: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ueIpv6s: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + ueMacs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + anyUeInd: + type: boolean + description: Indicates the request is for any UE. + dnnSnssaiInfos: + description: Indicates the request is for any DNN and S-NSSAI combination present in the array. + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + minItems: 1 + required: + - dataInd + + DataInd: + anyOf: + - type: string + enum: + - PFD + - IPTV + - BDT + - SVC_PARAM + - AM + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - PFD + - IPTV + - BDT + - SVC_PARAM + - AM diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Exposure_Data.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Exposure_Data.yaml new file mode 100644 index 000000000..93e9fcd99 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Exposure_Data.yaml @@ -0,0 +1,831 @@ +openapi: 3.0.0 +info: + version: '-' + title: Unified Data Repository Service API file for structured data for exposure + description: | + The API version is defined in 3GPP TS 29.504 + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.519 V17.7.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, + Application Data and Structured Data for Exposure. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /exposure-data/{ueId}/access-and-mobility-data: + put: + summary: Creates and updates the access and mobility exposure data for a UE + operationId: CreateOrReplaceAccessAndMobilityData + tags: + - AccessAndMobilityData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:access-and-mobility-data:create + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + responses: + '201': + description: > + Successful case. The resource has been successfully created and a response + body containing a representation of the access and mobility data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: > + Successful case. The resource has been successfully updated and a response + body containing a representation of the access and mobility data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + '204': + description: Successful case. The resource has been successfully updated and no additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieves the access and mobility exposure data for a UE + operationId: QueryAccessAndMobilityData + tags: + - AccessAndMobilityData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:access-and-mobility-data:read + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The response body contains the access and mobility data + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the access and mobility exposure data for a UE + operationId: DeleteAccessAndMobilityData + tags: + - AccessAndMobilityData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:access-and-mobility-data:modify + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Updates the access and mobility exposure data for a UE + operationId: UpdateAccessAndMobilityData + tags: + - AccessAndMobilityData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:access-and-mobility-data:modify + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + responses: + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/{ueId}/session-management-data/{pduSessionId}: + put: + summary: Creates and updates the session management data for a UE and for an individual PDU session + operationId: CreateOrReplaceSessionManagementData + tags: + - PduSessionManagementData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:session-management-data:create + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + responses: + '201': + description: > + Successful case. The resource has been successfully created and a response + body containing a representation of the session management data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: > + Successful case. The resource has been successfully updated and a response body + containing a representation of the session management data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieves the session management data for a UE and for an individual PDU session + operationId: QuerySessionManagementData + tags: + - PduSessionManagementData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:session-management-data:read + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: ipv4-addr + in: query + description: IPv4 Address of the UE + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ipv6-prefix + in: query + description: IPv6 Address Prefix of the UE + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: dnn + in: query + description: DNN of the UE + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The response body contains the session management data + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the session management data for a UE and for an individual PDU session + operationId: DeleteSessionManagementData + tags: + - PduSessionManagementData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:session-management-data:modify + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '204': + description: Upon success, an empty response body shall be returned + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of exposure data changes + operationId: CreateIndividualExposureDataSubscription + tags: + - ExposureDataSubscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:subs-to-notify:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + exposureDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ExposureDataChangeNotification' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/subs-to-notify/{subId}: + put: + summary: updates a subscription to receive notifications of exposure data changes + operationId: ReplaceIndividualExposureDataSubscription + tags: + - IndividualExposureDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:subs-to-notify:modify + parameters: + - name: subId + in: path + description: Subscription id + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + responses: + '200': + description: > + Resource was successfully modified and a body with the modified subscription + to notifications about exposure data is returned.. + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + '204': + description: The individual subscription resource was successfully modified. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the individual Exposure Data subscription + operationId: DeleteIndividualExposureDataSubscription + tags: + - IndividualExposureDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:subs-to-notify:modify + parameters: + - name: subId + in: path + description: Subscription id + required: true + schema: + type: string + responses: + '204': + description: Resource was successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + schemas: + AccessAndMobilityData: + description: Represents Access and Mobility data for a UE. + type: object + properties: + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + locationTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + timeZoneTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + regStates: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/RmInfo' + regStatesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + connStates: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + connStatesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reachabilityStatus: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + reachabilityStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + smsOverNasStatus: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/SmsSupport' + smsOverNasStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + roamingStatus: + type: boolean + description: > + True The serving PLMN of the UE is different from the HPLMN of the UE; False + The serving PLMN of the UE is the HPLMN of the UE. + roamingStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + currentPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + currentPlmnTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ratType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ratTypesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + PduSessionManagementData: + description: Represents Session management data for a UE and a PDU session. + type: object + properties: + pduSessionStatus: + $ref: '#/components/schemas/PduSessionStatus' + pduSessionStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + dnaiTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + n6TrafficRoutingInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + n6TrafficRoutingInfoTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefix: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: UE IPv6 prefix. + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + pduSessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + ipAddrTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + ExposureDataSubscription: + description: Represents a Subscription to Notifications about Exposure Data. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - notificationUri + - monitoredResourceUris + ExposureDataChangeNotification: + description: Represents changed exposure data for one UE for which Notification was requested. + type: object + properties: + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + accessAndMobilityData: + $ref: '#/components/schemas/AccessAndMobilityData' + pduSessionManagementData: + type: array + items: + $ref: '#/components/schemas/PduSessionManagementData' + minItems: 1 + delResources: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + PduSessionStatus: +# anyOf: +# - type: string + enum: + - "ACTIVE" + - "RELEASED" +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: > +# Possible values are +# - "ACTIVE" +# - "RELEASED" diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Policy_Data.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Policy_Data.yaml new file mode 100644 index 000000000..606db739e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29519_Policy_Data.yaml @@ -0,0 +1,2414 @@ +openapi: 3.0.0 + +info: + version: '-' + title: Unified Data Repository Service API file for policy data + description: | + The API version is defined in 3GPP TS 29.504 + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.519 V17.8.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, + Application Data and Structured Data for Exposure. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /policy-data/ues/{ueId}: + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + get: + summary: Retrieve the policy data for a subscriber + operationId: ReadPolicyData + tags: + - PolicyDataForIndividualUe (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:read + parameters: + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: data-subset-names + in: query + style: form + explode: false + description: List of policy data subset names + required: false + schema: + type: array + items: + $ref: '#/components/schemas/PolicyDataSubset' + minItems: 2 + responses: + '200': + description: Upon success, a response body containing policy data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataForIndividualUe' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/am-data: + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + get: + summary: Retrieves the access and mobility policy data for a subscriber + operationId: ReadAccessAndMobilityPolicyData + tags: + - AccessAndMobilityPolicyData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:am-data:read + responses: + '200': + description: > + Upon success, a response body containing access and mobility policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/ue-policy-set: + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + get: + summary: Retrieves the UE policy set data for a subscriber + operationId: ReadUEPolicySet + tags: + - UEPolicySet (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:ue-policy-set:read + parameters: + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or modify the UE policy set data for a subscriber + operationId: CreateOrReplaceUEPolicySet + tags: + - UEPolicySet (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:ue-policy-set:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + responses: + '201': + description: > + Successful case. The resource has been successfully created and a response body + containing a representation of the created UEPolicySet resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: > + Successful case. The resource has been successfully created and a response body + containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '204': + description: > + Successful case. The resource has been successfully updated and no additional content + is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify the UE policy set data for a subscriber + operationId: UpdateUEPolicySet + tags: + - UEPolicySet (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:ue-policy-set:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/UePolicySetPatch' + responses: + '204': + description: > + Successful case. The resource has been successfully updated and no additional content is + to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/sm-data: + get: + summary: Retrieves the session management policy data for a subscriber + operationId: ReadSessionManagementPolicyData + tags: + - SessionManagementPolicyData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:read + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: snssai + in: query + required: false + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing SmPolicyData shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify the session management policy data for a subscriber + operationId: UpdateSessionManagementPolicyData + tags: + - SessionManagementPolicyData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:modify + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SmPolicyDataPatch' + responses: + '204': + description: > + Successful case. The resource has been successfully updated and no + additional content is to be sent in the response message. + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/sm-data/{usageMonId}: + get: + summary: Retrieve a usage monitoring resource + operationId: ReadUsageMonitoringInformation + tags: + - UsageMonitoringInformation (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:read + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Successful case. The usage monitoring data is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + '204': + description: The resource was found but no usage monitoring data is available. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create a usage monitoring resource + operationId: CreateUsageMonitoringResource + tags: + - UsageMonitoringInformation (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:create + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + responses: + '201': + description: > + Successful case. The resource has been successfully created and a response body is + returned containing a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete a usage monitoring resource + operationId: DeleteUsageMonitoringInformation + tags: + - UsageMonitoringInformation (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:modify + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + responses: + '204': + description: Successful case. The resource has been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/sponsor-connectivity-data/{sponsorId}: + parameters: + - name: sponsorId + in: path + required: true + schema: + type: string + get: + summary: Retrieves the sponsored connectivity information for a given sponsorId + operationId: ReadSponsorConnectivityData + tags: + - SponsorConnectivityData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:sponsor-connectivity-data:read + responses: + '200': + description: > + Upon success, a response body containing Sponsor Connectivity Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SponsorConnectivityData' + '204': + description: The resource was found but no Sponsor Connectivity Data is available. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/bdt-data: + get: + summary: Retrieves the BDT data collection + operationId: ReadBdtData + tags: + - BdtData (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:read + parameters: + - name: bdt-ref-ids + in: query + description: List of the BDT reference identifiers. + required: false + schema: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + minItems: 1 + style: form + explode: false + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing the BDT data shall be returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BdtData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/bdt-data/{bdtReferenceId}: + parameters: + - name: bdtReferenceId + in: path + required: true + schema: + type: string + get: + summary: Retrieves the BDT data information associated with a BDT reference Id + operationId: ReadIndividualBdtData + tags: + - IndividualBdtData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:read + parameters: + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing the BDT data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Creates an BDT data resource associated with an BDT reference Id + operationId: CreateIndividualBdtData + tags: + - IndividualBdtData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + responses: + '201': + description: Successful case. The resource has been successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modifies an BDT data resource associated with an BDT reference Id + operationId: UpdateIndividualBdtData + tags: + - IndividualBdtData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/BdtDataPatch' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional content + is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes an BDT data resource associated with an BDT reference Id + operationId: DeleteIndividualBdtData + tags: + - IndividualBdtData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:modify + responses: + '204': + description: Successful case. The resource has been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of policy data changes + operationId: CreateIndividualPolicyDataSubscription + tags: + - PolicyDataSubscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data:subs-to-notify + - nudr-dr:policy-data:subs-to-notify:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + responses: + '201': + description: > + Upon success, a response body containing a representation of each Individual + subscription resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + policyDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyDataChangeNotification' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/subs-to-notify/{subsId}: + parameters: + - name: subsId + in: path + required: true + schema: + type: string + put: + summary: Modify a subscription to receive notification of policy data changes + operationId: ReplaceIndividualPolicyDataSubscription + tags: + - IndividualPolicyDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:subs-to-notify:modify + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + responses: + '200': + description: The individual subscription resource was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + '204': + description: > + The individual subscription resource was updated successfully and no + additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the individual Policy Data subscription + operationId: DeleteIndividualPolicyDataSubscription + tags: + - IndividualPolicyDataSubscription (Document) + responses: + '204': + description: Upon success, an empty response body shall be returned. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/operator-specific-data: + get: + summary: Retrieve the operator specific policy data of an UE + operationId: ReadOperatorSpecificData + tags: + - OperatorSpecificData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:operator-specific-data:read + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the operator specific policy data of a UE + operationId: UpdateOperatorSpecificData + tags: + - OperatorSpecificData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:operator-specific-data:modify + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: No content. Response to successful modification. + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or modify the operator specific policy data of a UE + operationId: ReplaceOperatorSpecificData + tags: + - OperatorSpecificData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:operator-specific-data:create + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + '201': + description: > + Successful case. When the feature OSDResource_Create_Delete is supported + and the resource has been successfully created, a response body containing a + representation of the created OperatorSpecificData resource shall be returned. + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '204': + description: The resource has been successfully updated. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: When the feature OSDResource_Create_Delete is supported, delete OperatorSpecificData resource + operationId: DeleteOperatorSpecificData + tags: + - OperatorSpecificData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:operator-specific-data:modify + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Successful case. The resource has been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/plmns/{plmnId}/ue-policy-set: + parameters: + - name: plmnId + in: path + required: true + schema: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/VarPlmnId' + get: + summary: Retrieve the UE policy set data for an H-PLMN + operationId: ReadPlmnUePolicySet + tags: + - PlmnUePolicySet (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:plmns:ue-policy-set:read + responses: + '200': + description: Upon success, a response body containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '412': + $ref: 'TS29571_CommonData.yaml#/components/responses/412' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/slice-control-data/{snssai}: + parameters: + - name: snssai + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + get: + summary: Retrieves a network Slice specific policy control data resource + operationId: ReadSlicePolicyControlData + tags: + - SlicePolicyControlData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:slice-control-data:read + parameters: + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + Successful case. The network slice specific policy control data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SlicePolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify a network Slice specific policy control data resource + operationId: UpdateSlicePolicyControlData + tags: + - SlicePolicyControlData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:slice-control-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SlicePolicyDataPatch' + responses: + '200': + description: > + The resource has been successfully updated and a response body containing network + slice specific policy control data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SlicePolicyData' + '204': + description: > + The resource has been successfully updated and no additional content is + to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/mbs-session-pol-data/{polSessionId}: + parameters: + - name: polSessionId + description: > + Represents the identifier of the MBS Session Policy Control Data. + in: path + required: true + schema: + $ref: '#/components/schemas/MbsSessPolDataId' + + get: + summary: Retrieve MBS Session Policy Control Data for an MBS Session. + operationId: GetMBSSessPolCtrlData + tags: + - MBSSessionPolicyControlData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:mbs-session-pol-data:read + responses: + '200': + description: > + OK. The requested MBS Session Policy Control Data is successfully returned. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessPolCtrlData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + schemas: + + PolicyDataForIndividualUe: + description: Contains policy data for a given subscriber. + type: object + properties: + uePolicyDataSet: + $ref: '#/components/schemas/UePolicySet' + smPolicyDataSet: + $ref: '#/components/schemas/SmPolicyData' + amPolicyDataSet: + $ref: '#/components/schemas/AmPolicyData' + umData: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonData' + minProperties: 1 + description: > + Contains UM policies. The value of the limit identifier is used as the key of the map. + operatorSpecificDataSet: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + minProperties: 1 + description: > + Contains Operator Specific Data resource data. The key of the map is operator + specific data element name and the value is the operator specific data of the UE. + + AmPolicyData: + description: Contains the AM policy data for a given subscriber. + type: object + properties: + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains Presence reporting area information. The praId attribute within the + PresenceInfo data type is the key of the map. + subscCats: + type: array + items: + type: string + minItems: 1 + + UePolicySet: + description: Contains the UE policy data for a given subscriber. + type: object + properties: + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains Presence reporting area information. The praId attribute within the + PresenceInfo data type is the key of the map. + subscCats: + type: array + items: + type: string + minItems: 1 + uePolicySections: + type: object + additionalProperties: + $ref: '#/components/schemas/UePolicySection' + minProperties: 1 + description: > + Contains the UE Policy Sections. The UE Policy Section Identifier is used as + the key of the map. + upsis: + type: array + items: + type: string + minItems: 1 + allowedRouteSelDescs: + type: object + additionalProperties: + $ref: '#/components/schemas/PlmnRouteSelectionDescriptor' + minProperties: 1 + description: > + Contains allowed route selection descriptors per serving PLMN for a UE. + The serving PLMN identifier is the key of the map. + andspInd: + type: boolean + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + osIds: + type: array + items: + $ref: '#/components/schemas/OsId' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + + UePolicySetPatch: + description: Contains the UE policy set for a given subscriber. + type: object + properties: + uePolicySections: + type: object + additionalProperties: + $ref: '#/components/schemas/UePolicySection' + minProperties: 1 + description: > + Contains the UE Policy Sections. The UE Policy Section Identifier is used + as the key of the map. + upsis: + type: array + items: + type: string + minItems: 1 + andspInd: + type: boolean + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + osIds: + type: array + items: + $ref: '#/components/schemas/OsId' + minItems: 1 + + UePolicySection: + description: Contains the UE policy section. + type: object + properties: + uePolicySectionInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + upsi: + type: string + required: + - uePolicySectionInfo + - upsi + + SmPolicyData: + description: Contains the SM policy data for a given subscriber. + type: object + properties: + smPolicySnssaiData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicySnssaiData' + minProperties: 1 + description: > + Contains Session Management Policy data per S-NSSAI for all the SNSSAIs + of the subscriber. The key of the map is the S-NSSAI. + umDataLimits: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataLimit' + minProperties: 1 + description: > + Contains a list of usage monitoring profiles associated with the subscriber. + The limit identifier is used as the key of the map. + umData: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonData' + minProperties: 1 + description: > + Contains the remaining allowed usage data associated with the subscriber. + The limit identifier is used as the key of the map. + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - smPolicySnssaiData + + SmPolicySnssaiData: + description: Contains the SM policy data for a given subscriber and S-NSSAI. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + smPolicyDnnData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicyDnnData' + minProperties: 1 + description: > + Session Management Policy data per DNN for all the DNNs of the indicated S-NSSAI. + The key of the map is the DNN. + ueSliceMbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbr' + required: + - snssai + + SmPolicyDnnData: + description: Contains the SM policy data for a given DNN (and S-NSSAI). + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + allowedServices: + type: array + items: + type: string + minItems: 1 + subscCats: + type: array + items: + type: string + minItems: 1 + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + adcSupport: + type: boolean + subscSpendingLimits: + type: boolean + ipv4Index: + $ref: '#/components/schemas/IpIndex' + ipv6Index: + $ref: '#/components/schemas/IpIndex' + offline: + type: boolean + online: + type: boolean + chfInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ChargingInformation' + refUmDataLimitIds: + type: object + additionalProperties: + $ref: '#/components/schemas/LimitIdToMonitoringKey' + minProperties: 1 + description: > + A reference to the UsageMonitoringDataLimit or UsageMonitoringData instances + for this DNN and SNSSAI that may also include the related monitoring key(s). + The key of the map is the limit identifier. + mpsPriority: + type: boolean + mcsPriority: + type: boolean + imsSignallingPrio: + type: boolean + mpsPriorityLevel: + type: integer + mcsPriorityLevel: + type: integer + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains Presence reporting area information. The praId attribute within the + PresenceInfo data type is the key of the map. + bdtRefIds: + type: object + additionalProperties: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceIdRm' + minProperties: 1 + description: > + Identifies transfer policies of background data transfer. Any string value can + be used as a key of the map. + nullable: true + locRoutNotAllowed: + type: boolean + required: + - dnn + + UsageMonDataLimit: + description: Contains usage monitoring control data for a subscriber. + type: object + properties: + limitId: + type: string + scopes: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataScope' + minProperties: 1 + description: > + Identifies the SNSSAI and DNN combinations to which the usage monitoring data + limit applies. The S-NSSAI is the key of the map. + umLevel: + $ref: '#/components/schemas/UsageMonLevel' + startDate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endDate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + usageLimit: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + resetPeriod: + $ref: '#/components/schemas/TimePeriod' + required: + - limitId + + UsageMonData: + description: Contains remain allowed usage data for a subscriber. + type: object + properties: + limitId: + type: string + scopes: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataScope' + minProperties: 1 + description: > + Identifies the SNSSAI and DNN combinations for remain allowed usage data + for a subscriber. The S-NSSAI is the key of the map. + umLevel: + $ref: '#/components/schemas/UsageMonLevel' + allowedUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + resetTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - limitId + + LimitIdToMonitoringKey: + description: > + Contains the limit identifier and the corresponding monitoring key for a given + S-NSSAI and DNN. + type: object + properties: + limitId: + type: string + monkey: + type: array + items: + type: string + minItems: 1 + required: + - limitId + nullable: true + + UsageMonDataScope: + description: > + Contains a SNSSAI and DNN combinations to which the UsageMonData instance belongs to. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + required: + - snssai + + TimePeriod: + description: Contains the periodicity for the defined usage monitoring data limits. + type: object + properties: + period: + $ref: '#/components/schemas/Periodicity' + maxNumPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - period + + SponsorConnectivityData: + description: > + Contains the sponsored data connectivity related information for a sponsor identifier. + type: object + properties: + aspIds: + type: array + items: + type: string + required: + - aspIds + + BdtData: + description: Contains the background data transfer data. + type: object + properties: + aspId: + type: string + transPolicy: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/TransferPolicy' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + numOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + volPerUe: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + trafficDes: + $ref: 'TS29122_ResourceManagementOfBdt.yaml#/components/schemas/TrafficDescriptor' + bdtpStatus: + $ref: '#/components/schemas/BdtPolicyStatus' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - aspId + - transPolicy + + PolicyDataSubscription: + description: Identifies a subscription to policy data change notification. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monResItems: + type: array + items: + $ref: '#/components/schemas/ResourceItem' + minItems: 1 + excludedResItems: + type: array + items: + $ref: '#/components/schemas/ResourceItem' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - notificationUri + - monitoredResourceUris + + PolicyDataChangeNotification: + description: Contains changed policy data for which notification was requested. + type: object + properties: + amPolicyData: + $ref: '#/components/schemas/AmPolicyData' + uePolicySet: + $ref: '#/components/schemas/UePolicySet' + plmnUePolicySet: + $ref: '#/components/schemas/UePolicySet' + smPolicyData: + $ref: '#/components/schemas/SmPolicyData' + usageMonData: + $ref: '#/components/schemas/UsageMonData' + SponsorConnectivityData: + $ref: '#/components/schemas/SponsorConnectivityData' + bdtData: + $ref: '#/components/schemas/BdtData' + opSpecData: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + opSpecDataMap: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + minProperties: 1 + description: > + Operator Specific Data resource data, if changed and notification was requested. + The key of the map is operator specific data element name and the value is the + operator specific data of the UE. + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + sponsorId: + type: string + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + usageMonId: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + delResources: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + notifId: + type: string + reportedFragments: + type: array + items: + $ref: '#/components/schemas/NotificationItem' + minItems: 1 + slicePolicyData: + $ref: '#/components/schemas/SlicePolicyData' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + PlmnRouteSelectionDescriptor: + description: > + Contains the route selection descriptors (combinations of SNSSAI, DNNs, PDU session types, + SSC modes and ATSSS information) allowed by subscription to the UE for a serving PLMN + type: object + properties: + servingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + snssaiRouteSelDescs: + type: array + items: + $ref: '#/components/schemas/SnssaiRouteSelectionDescriptor' + minItems: 1 + required: + - servingPlmn + + SnssaiRouteSelectionDescriptor: + description: > + Contains the route selector parameters (DNNs, PDU session types, SSC modes and ATSSS + information) per SNSSAI + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnnRouteSelDescs: + type: array + items: + $ref: '#/components/schemas/DnnRouteSelectionDescriptor' + minItems: 1 + required: + - snssai + + DnnRouteSelectionDescriptor: + description: > + Contains the route selector parameters (PDU session types, SSC modes and ATSSS + information) per DNN + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sscModes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + minItems: 1 + pduSessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + atsssInfo: + description: > + Indicates whether MA PDU session establishment is allowed for this DNN. + When set to value true MA PDU session establishment is allowed for this DNN. + type: boolean + default: false + required: + - dnn + + SmPolicyDataPatch: + description: Contains the SM policy data for a given subscriber. + type: object + properties: + umData: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonData' + minProperties: 1 + description: > + Contains the remaining allowed usage data associated with the subscriber. + The value of the limit identifier is used as the key of the map. + nullable: true + smPolicySnssaiData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicySnssaiDataPatch' + minProperties: 1 + description: > + Modifiable Session Management Policy data per S-NSSAI for all the SNSSAIs + of the subscriber. The key of the map is the S-NSSAI. + + SmPolicySnssaiDataPatch: + description: Contains the SM policy data for a given subscriber and S-NSSAI. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + smPolicyDnnData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicyDnnDataPatch' + minProperties: 1 + description: > + Modifiable Session Management Policy data per DNN for all the DNNs of the + indicated S-NSSAI. The key of the map is the DNN. + required: + - snssai + SmPolicyDnnDataPatch: + description: Contains the SM policy data for a given DNN (and S-NSSAI). + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + bdtRefIds: + type: object + additionalProperties: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceIdRm' + minProperties: 1 + description: > + Contains updated transfer policies of background data transfer. + Any string value can be used as a key of the map. + nullable: true + required: + - dnn + + ResourceItem: + description: > + Identifies a subscription to policy data change notification when the change occurs + in a fragment (subset of resource data) of a given resource. + type: object + properties: + monResourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + items: + type: array + items: + $ref: '#/components/schemas/ItemPath' + minItems: 1 + required: + - monResourceUri + - items + + NotificationItem: + description: > + Identifies a data change notification when the change occurs in a fragment + (subset of resource data) of a given resource. + type: object + properties: + resourceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifItems: + type: array + items: + $ref: '#/components/schemas/UpdatedItem' + minItems: 1 + required: + - resourceId + - notifItems + + UpdatedItem: + description: Identifies a fragment of a resource. + type: object + properties: + item: + $ref: '#/components/schemas/ItemPath' + value: {} + required: + - item + - value + + BdtDataPatch: + description: Contains the modified background data transfer data. + type: object + properties: + transPolicy: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/TransferPolicy' + bdtpStatus: + $ref: '#/components/schemas/BdtPolicyStatus' + + SlicePolicyData: + description: Contains the network slice specific policy control information. + type: object + properties: + mbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + remainMbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + remainMbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + + SlicePolicyDataPatch: + description: Contains the modified network slice specific policy control information. + type: object + properties: + remainMbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + remainMbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + oneOf: + - required: [remainMbrUl] + - required: [remainMbrDl] + + MbsSessPolCtrlData: + description: Represents MBS Session Policy Control Data. + type: object + properties: + 5qis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + minItems: 1 + maxMbsArpLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ArpPriorityLevel' + maxMbsSessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxGbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + MbsSessPolDataId: + description: Represents the identifier used to access the MBS Session Policy Control Data. + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + afAppId: + type: string + oneOf: + - required: [mbsSessionId] + - required: [afAppId] + +# SIMPLE TYPES: + + IpIndex: + description: > + Represents information that identifies which IP pool or external server + is used to allocate the IP address. + type: integer + + OsId: + description: Represents the Operating System of the served UE. + type: string + format: uuid + + ItemPath: + description: Identifies a fragment (subset of resource data) of a given resource. + type: string + +# ENUMS: + + UsageMonLevel: + description: Represents the usage monitoring level. + anyOf: + - type: string + enum: + - SESSION_LEVEL + - SERVICE_LEVEL + - type: string + + Periodicity: + description: Represents the time period. + anyOf: + - type: string + enum: + - YEARLY + - MONTHLY + - WEEKLY + - DAILY + - HOURLY + - type: string + + BdtPolicyStatus: + description: Indicates the validation status of a negotiated BDT policy. + anyOf: + - type: string + enum: + - INVALID + - VALID + - type: string + + PolicyDataSubset: + description: Indicates a policy data subset. + anyOf: + - type: string + enum: + - AM_POLICY_DATA + - SM_POLICY_DATA + - UE_POLICY_DATA + - UM_DATA + - OPERATOR_SPECIFIC_DATA + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_AnalyticsInfo.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_AnalyticsInfo.yaml new file mode 100644 index 000000000..58204779b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_AnalyticsInfo.yaml @@ -0,0 +1,704 @@ +openapi: 3.0.0 + +info: + version: 1.2.2 + title: Nnwdaf_AnalyticsInfo + description: | + Nnwdaf_AnalyticsInfo Service API. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.520 V17.9.0; 5G System; Network Data Analytics Services. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.520/' + +security: + - {} + - oAuth2ClientCredentials: + - nnwdaf-analyticsinfo + +servers: + - url: '{apiRoot}/nnwdaf-analyticsinfo/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +paths: + /analytics: + get: + summary: Read a NWDAF Analytics + operationId: GetNWDAFAnalytics + tags: + - NWDAF Analytics (Document) + parameters: + - name: event-id + in: query + description: Identify the analytics. + required: true + schema: + $ref: '#/components/schemas/EventId' + - name: ana-req + in: query + description: Identifies the analytics reporting requirement information. + required: false + content: + application/json: + schema: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventReportingRequirement' + - name: event-filter + in: query + description: Identify the analytics. + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/EventFilter' + - name: supported-features + in: query + description: To filter irrelevant responses related to unsupported features. + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: tgt-ue + in: query + description: Identify the target UE information. + required: false + content: + application/json: + schema: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/TargetUeInformation' + responses: + '200': + description: > + Containing the analytics with parameters as relevant for the requesting NF service + consumer. + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsData' + '204': + description: No Content. The requested NWDAF Analytics data does not exist. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + description: Indicates that the NWDAF Analytics resource does not exist. + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: > + The request is rejected by the NWDAF and more details (not only the ProblemDetails) are + returned. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetailsAnalyticsInfoRequest' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /context: + get: + summary: Get context information related to analytics subscriptions. + operationId: GetNwdafContext + tags: + - NWDAF Context (Document) + parameters: + - name: context-ids + in: query + description: Identifies specific context information related to analytics subscriptions. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ContextIdList' + - name: req-context + in: query + description: > + Identfies the type(s) of the analytics context information the consumer wishes to receive. + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/RequestedContext' + responses: + '200': + description: > + Contains context information related to analytics subscriptions corresponding with one or + more context identifiers. + content: + application/json: + schema: + $ref: '#/components/schemas/ContextData' + '204': + description: > + No Content. (\No context information could be retrieved for the requested context + Identifiers. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnwdaf-analyticsinfo: Access to the Nnwdaf_AnalyticsInfo API + + schemas: + + AnalyticsData: + description: > + Represents the description of analytics with parameters as relevant for the requesting NF + service consumer. + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStampGen: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + anaMetaInfo: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsMetadataInfo' + sliceLoadLevelInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/SliceLoadLevelInformation' + minItems: 1 + description: The slices and their load level information. + nsiLoadLevelInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiLoadLevelInfo' + minItems: 1 + nfLoadLevelInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NfLoadLevelInformation' + minItems: 1 + nwPerfs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfInfo' + minItems: 1 + svcExps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ServiceExperienceInfo' + minItems: 1 + qosSustainInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/QosSustainabilityInfo' + minItems: 1 + ueMobs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UeMobility' + minItems: 1 + ueComms: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UeCommunication' + minItems: 1 + userDataCongInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UserDataCongestionInfo' + minItems: 1 + abnorBehavrs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AbnormalBehaviour' + minItems: 1 + smccExps: + type: array + items: + $ref: '#/components/schemas/SmcceInfo' + minItems: 1 + disperInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionInfo' + minItems: 1 + redTransInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RedundantTransmissionExpInfo' + minItems: 1 + wlanInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/WlanPerformanceInfo' + minItems: 1 + dnPerfInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerfInfo' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + EventFilter: + description: Represents the event filters used to identify the requested analytics. + type: object + properties: + anySlice: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnySlice' + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: Identification(s) of network slice. + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + ladnDnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Identification(s) of LADN DNN to indicate the LADN service area as the AOI. + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + visitedAreas: + type: array + items: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + minItems: 1 + maxTopAppUlNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxTopAppDlNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + nfInstanceIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + nfSetIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + nfTypes: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + minItems: 1 + nsiIdInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiIdInfo' + minItems: 1 + qosRequ: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/QosRequirement' + nwPerfTypes: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfType' + minItems: 1 + bwRequs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/BwRequirement' + minItems: 1 + excepIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExceptionId' + minItems: 1 + exptAnaType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExpectedAnalyticsType' + exptUeBehav: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExpectedUeBehaviourData' + ratFreqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RatFreqInformation' + minItems: 1 + disperReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionRequirement' + minItems: 1 + redTransReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RedundantTransmissionExpReq' + minItems: 1 + wlanReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/WlanPerformanceReq' + minItems: 1 + listOfAnaSubsets: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsSubset' + minItems: 1 + upfInfo: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/UpfInformation' + + appServerAddrs: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + minItems: 1 + dnPerfReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerformanceReq' + minItems: 1 + not: + required: [anySlice, snssais] + + ProblemDetailsAnalyticsInfoRequest: + description: > + Extends ProblemDetails to indicate more details why the analytics request is rejected. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/AdditionInfoAnalyticsInfoRequest' + + AdditionInfoAnalyticsInfoRequest: + description: Indicates additional information why the analytics request is rejected. + type: object + properties: + rvWaitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + ContextData: + description: > + Contains context information related to analytics subscriptions corresponding with one or + more context identifiers. + type: object + properties: + contextElems: + type: array + items: + $ref: '#/components/schemas/ContextElement' + minItems: 1 + description: > + List of items that contain context information corresponding with a context identifier. + required: + - contextElems + + ContextElement: + description: Contains context information corresponding with a specific context identifier. + type: object + properties: + contextId: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsContextIdentifier' + pendAnalytics: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventNotification' + minItems: 1 + description: > + Output analytics for the analytics subscription which have not yet been sent to the + analytics consumer. + histAnalytics: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventNotification' + minItems: 1 + description: Historical output analytics. + lastOutputTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + aggrSubs: + type: array + items: + $ref: '#/components/schemas/SpecificAnalyticsSubscription' + minItems: 1 + description: > + Information about analytics subscriptions that the NWDAF has with other NWDAFs to perform + aggregation. + histData: + type: array + items: + $ref: '#/components/schemas/HistoricalData' + minItems: 1 + description: Historical data related to the analytics subscription. + adrfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + adrfDataTypes: + type: array + items: + $ref: '#/components/schemas/AdrfDataType' + minItems: 1 + description: Type(s) of data stored in the ADRF by the NWDAF. + aggrNwdafIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + description: > + NWDAF identifiers of NWDAF instances used by the NWDAF service consumer when aggregating + multiple analytics subscriptions. + modelInfo: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ModelInfo' + minItems: 1 + description: > + Contains information identifying the ML model(s) that the consumer NWDAF is currently + subscribing for the analytics. + required: + - contextId + + ContextIdList: + description: > + Contains a list of context identifiers of context information of analytics subscriptions. + type: object + properties: + contextIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsContextIdentifier' + minItems: 1 + required: + - contextIds + + HistoricalData: + description: Contains historical data related to an analytics subscription. + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + subsWithSources: + type: array + items: + $ref: '#/components/schemas/SpecificDataSubscription' + minItems: 1 + description: Information about subscriptions with the data sources. + data: + type: array + items: + $ref: 'TS29575_Nadrf_DataManagement.yaml#/components/schemas/DataNotification' + minItems: 1 + description: Historical data related to the analytics. + required: + - data + + SpecificAnalyticsSubscription: + description: > + Represents an existing subscription for a specific type of analytics to a specific NWDAF. + type: object + properties: + subscriptionId: + type: string + producerId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + producerSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nwdafEvSub: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NnwdafEventsSubscription' + allOf: + - oneOf: + - required: [producerId] + - required: [producerSetId] + - required: [subscriptionId] + - required: [nwdafEvSub] + + RequestedContext: + description: Contains types of analytics context information. + type: object + properties: + contexts: + type: array + items: + $ref: '#/components/schemas/ContextType' + minItems: 1 + description: List of analytics context types. + required: + - contexts + + SmcceInfo: + description: Represents the Session Management congestion control experience information. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + smcceUeList: + $ref: '#/components/schemas/SmcceUeList' + required: + - smcceUeList + + SmcceUeList: + description: > + Represents the List of UEs classified based on experience level of Session Management + congestion control. + type: object + properties: + highLevel: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + mediumLevel: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + lowLevel: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + anyOf: + - required: [highLevel] + - required: [mediumLevel] + - required: [lowLevel] + + SpecificDataSubscription: + description: > + Represents an existing subscription for data collection to a specific data source NF. + type: object + properties: + subscriptionId: + type: string + producerId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + producerSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + dataSub: + $ref: 'TS29575_Nadrf_DataManagement.yaml#/components/schemas/DataSubscription' + allOf: + - oneOf: + - required: [producerId] + - required: [producerSetId] + - required: [subscriptionId] + - required: [dataSub] + + EventId: + anyOf: + - type: string + enum: + - LOAD_LEVEL_INFORMATION + - NETWORK_PERFORMANCE + - NF_LOAD + - SERVICE_EXPERIENCE + - UE_MOBILITY + - UE_COMMUNICATION + - QOS_SUSTAINABILITY + - ABNORMAL_BEHAVIOUR + - USER_DATA_CONGESTION + - NSI_LOAD_LEVEL + - SM_CONGESTION + - DISPERSION + - RED_TRANS_EXP + - WLAN_PERFORMANCE + - DN_PERFORMANCE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - LOAD_LEVEL_INFORMATION: Represent the analytics of load level information of corresponding network slice. + - NETWORK_PERFORMANCE: Represent the analytics of network performance information. + - NF_LOAD: Indicates that the event subscribed is NF Load. + - SERVICE_EXPERIENCE: Represent the analytics of service experience information of the specific applications. + - UE_MOBILITY: Represent the analytics of UE mobility. + - UE_COMMUNICATION: Represent the analytics of UE communication. + - QOS_SUSTAINABILITY: Represent the analytics of QoS sustainability information in the certain area. + - ABNORMAL_BEHAVIOUR: Indicates that the event subscribed is abnormal behaviour information. + - USER_DATA_CONGESTION: Represent the analytics of the user data congestion in the certain area. + - NSI_LOAD_LEVEL: Represent the analytics of Network Slice and the optionally associated Network Slice Instance. + - SM_CONGESTION: Represent the analytics of Session Management congestion control experience information for specific DNN and/or S-NSSAI. + - DISPERSION: Represents the analytics of dispersion. + - RED_TRANS_EXP: Represents the analytics of Redundant Transmission Experience. + - WLAN_PERFORMANCE: Represents the analytics of WLAN performance. + - DN_PERFORMANCE: Represents the analytics of DN performance. + + ContextType: + anyOf: + - type: string + enum: + - PENDING_ANALYTICS + - HISTORICAL_ANALYTICS + - AGGR_SUBS + - DATA + - AGGR_INFO + - ML_MODELS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - PENDING_ANALYTICS: Represents context information that relates to pending output analytics. + - HISTORICAL_ANALYTICS: Represents context information that relates to historical output analytics. + - AGGR_SUBS: Represents context information about the analytics subscriptions that an NWDAF has with other NWDAFs that collectively serve an analytics subscription. + - DATA: Represents context information about historical data that is available. + - AGGR_INFO: Represents context information that is related to aggregation of analytics from multiple NWDAF subscriptions. + - ML_MODELS: Represents context information about used ML models. + + AdrfDataType: + anyOf: + - type: string + enum: + - HISTORICAL_ANALYTICS + - HISTORICAL_DATA + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - HISTORICAL_ANALYTICS: Indicates that historical analytics are stored in the ADRF. + - HISTORICAL_DATA: Indicates that historical data are stored in the ADRF. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_DataManagement.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_DataManagement.yaml new file mode 100644 index 000000000..c30561782 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_DataManagement.yaml @@ -0,0 +1,333 @@ +openapi: 3.0.0 +info: + title: Nnwdaf_DataManagement + version: 1.0.2 + description: | + Nnwdaf_DataManagement API Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.520 V17.9.0; 5G System; Network Data Analytics Services. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.520/' +servers: + - url: '{apiRoot}/nnwdaf-datamanagement/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nnwdaf-datamanagement +paths: + /subscriptions: + post: + summary: subscribe to notifications + operationId: CreateIndividualSubcription + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementSubsc' + responses: + '201': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementSubsc' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnwdaf-datamanagement//subscriptions/{subId}. + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notificURI}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementNotif' + responses: + '204': + description: No Content, Notification was succesfull + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + Fetch: + '{request.body#/fetchInstruct/fetchUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: string + minItems: 1 + description: Indicate the fetch correlation identifier. + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementNotif' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subscriptionId}: + put: + summary: Update an existing Individual NWDAF Data Subscription. + operationId: UpdateNWDAFDataSubscription + tags: + - Individual NWDAF Data Management Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementSubsc' + parameters: + - name: subscriptionId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was succesfully modified and representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementSubsc' + '204': + description: No Content. Resource was succesfully modified + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: unsubscribe from notifications + operationId: DeleteNWDAFDataSubscription + tags: + - Individual NWDAF Data Management Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was succesfully deleted + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnwdaf-datamanagement: Access to the Nnwdaf_DataManagement API + schemas: + NnwdafDataManagementSubsc: + description: Represents an Individual NWDAF Data Management Subscription resource. + type: object + properties: + adrfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + adrfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + anaSub: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NnwdafEventsSubscription' + dataCollectPurposes: + type: array + items: + $ref: 'TS29574_Ndccf_DataManagement.yaml#/components/schemas/DataCollectionPurpose' + minItems: 1 + description: > + The purposes of data collection. This attribute may only be provided if user consent + is reqiured depending on local policy and regulations and the consumer has + not checked user consent. + dataSub: + $ref: 'TS29575_Nadrf_DataManagement.yaml#/components/schemas/DataSubscription' + formatInstruct: + $ref: 'TS29574_Ndccf_DataManagement.yaml#/components/schemas/FormattingInstruction' + notifCorrId: + type: string + notificURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + procInstruct: + $ref: 'TS29574_Ndccf_DataManagement.yaml#/components/schemas/ProcessingInstruction' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + targetNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + targetNfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + timePeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + required: + - notifCorrId + - notificURI + oneOf: + - required: [anaSub] + - required: [dataSub] + NnwdafDataManagementNotif: + description: Represents an Individual Notification. + type: object + properties: + dataNotification: + $ref: 'TS29575_Nadrf_DataManagement.yaml#/components/schemas/DataNotification' + dataReports: + type: array + items: + $ref: 'TS29574_Ndccf_DataManagement.yaml#/components/schemas/NotifSummaryReport' + minItems: 1 + description: List of summary reports of processed notifications. + notifCorrId: + type: string + description: Notification correlation identifier. + terminationReq: + type: string + description: > + It indicates that the termination of the data management subscription + is requested by the NWDAF. + fetchInstruct: + $ref: 'TS29576_Nmfaf_3caDataManagement.yaml#/components/schemas/FetchInstruction' + notifTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - notifCorrId + - notifTimestamp + oneOf: + - required: [dataNotification] + - required: [dataReports] + - required: [fetchInstruct] + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_EventsSubscription.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_EventsSubscription.yaml new file mode 100644 index 000000000..69ec37b8a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_EventsSubscription.yaml @@ -0,0 +1,2560 @@ +openapi: 3.0.0 + +info: + version: 1.2.2 + title: Nnwdaf_EventsSubscription + description: | + Nnwdaf_EventsSubscription Service API. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.520 V17.9.0; 5G System; Network Data Analytics Services. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.520/' + +security: + - {} + - oAuth2ClientCredentials: + - nnwdaf-eventssubscription + +servers: + - url: '{apiRoot}/nnwdaf-eventssubscription/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +paths: + /subscriptions: + post: + summary: Create a new Individual NWDAF Events Subscription + operationId: CreateNWDAFEventsSubscription + tags: + - NWDAF Events Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafEventsSubscription' + responses: + '201': + description: Create a new Individual NWDAF Event Subscription resource. + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnwdaf-eventssubscription//subscriptions/{subscriptionId} + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafEventsSubscription' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notificationURI}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NnwdafEventsSubscriptionNotification' + minItems: 1 + responses: + '204': + description: The receipt of the Notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions/{subscriptionId}: + delete: + summary: Delete an existing Individual NWDAF Events Subscription + operationId: DeleteNWDAFEventsSubscription + tags: + - Individual NWDAF Events Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Nnwdaf_EventsSubscription Service + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual NWDAF Event Subscription resource matching the subscriptionId + was deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Update an existing Individual NWDAF Events Subscription + operationId: UpdateNWDAFEventsSubscription + tags: + - Individual NWDAF Events Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafEventsSubscription' + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Nnwdaf_EventsSubscription Service + required: true + schema: + type: string + responses: + '200': + description: > + The Individual NWDAF Event Subscription resource was modified successfully and a + representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafEventsSubscription' + '204': + description: The Individual NWDAF Event Subscription resource was modified successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /transfers: + post: + summary: Provide information about requested analytics subscriptions transfer and potentially create a new Individual NWDAF Event Subscription Transfer resource. + operationId: CreateNWDAFEventSubscriptionTransfer + tags: + - NWDAF Event Subscription Transfers (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsSubscriptionsTransfer' + responses: + '201': + description: Create a new Individual NWDAF Event Subscription Transfer resource. + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnwdaf-eventssubscription//transfers/{transferId} + required: true + schema: + type: string + '204': + description: > + No Content. The receipt of the information about analytics subscription(s) that are + requested to be transferred and the ability to handle this information (e.g. execute the + steps required to transfer an analytics subscription directly) is confirmed. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /transfers/{transferId}: + delete: + summary: Delete an existing Individual NWDAF Event Subscription Transfer + operationId: DeleteNWDAFEventSubscriptionTransfer + tags: + - Individual NWDAF Event Subscription Transfer (Document) + parameters: + - name: transferId + in: path + description: > + String identifying a request for an analytics subscription transfer to the + Nnwdaf_EventsSubscription Service + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual NWDAF Event Subscription Transfer resource matching the + transferId was deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Update an existing Individual NWDAF Event Subscription Transfer + operationId: UpdateNWDAFEventSubscriptionTransfer + tags: + - Individual NWDAF Event Subscription Transfer (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsSubscriptionsTransfer' + parameters: + - name: transferId + in: path + description: > + String identifying a request for an analytics subscription transfer to the + Nnwdaf_EventsSubscription Service + required: true + schema: + type: string + responses: + '204': + description: > + The Individual NWDAF Event Subscription Transfer resource was modified successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnwdaf-eventssubscription: Access to the Nnwdaf_EventsSubscription API + + schemas: + + NnwdafEventsSubscription: + description: Represents an Individual NWDAF Event Subscription resource. + type: object + properties: + eventSubscriptions: + type: array + items: + $ref: '#/components/schemas/EventSubscription' + minItems: 1 + description: Subscribed events + evtReq: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + notificationURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorrId: + type: string + description: Notification correlation identifier. + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + eventNotifications: + type: array + items: + $ref: '#/components/schemas/EventNotification' + minItems: 1 + failEventReports: + type: array + items: + $ref: '#/components/schemas/FailureEventInfo' + minItems: 1 + prevSub: + $ref: '#/components/schemas/PrevSubInfo' + consNfInfo: + $ref: '#/components/schemas/ConsumerNfInformation' + required: + - eventSubscriptions + + EventSubscription: + description: Represents a subscription to a single event. + type: object + properties: + anySlice: + $ref: '#/components/schemas/AnySlice' + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + description: Identification(s) of application to which the subscription applies. + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Identification(s) of DNN to which the subscription applies. + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + event: + $ref: '#/components/schemas/NwdafEvent' + extraReportReq: + $ref: '#/components/schemas/EventReportingRequirement' + ladnDnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Identification(s) of LADN DNN to indicate the LADN service area as the AOI. + loadLevelThreshold: + type: integer + description: > + Indicates that the NWDAF shall report the corresponding network slice load level to the NF + service consumer where the load level of the network slice identified by snssais is + reached. + notificationMethod: + $ref: '#/components/schemas/NotificationMethod' + matchingDir: + $ref: '#/components/schemas/MatchingDirection' + nfLoadLvlThds: + type: array + items: + $ref: '#/components/schemas/ThresholdLevel' + minItems: 1 + description: > + Shall be supplied in order to start reporting when an average load level is reached. + nfInstanceIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + nfSetIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + nfTypes: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + minItems: 1 + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + visitedAreas: + type: array + items: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + minItems: 1 + maxTopAppUlNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxTopAppDlNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + nsiIdInfos: + type: array + items: + $ref: '#/components/schemas/NsiIdInfo' + minItems: 1 + nsiLevelThrds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + qosRequ: + $ref: '#/components/schemas/QosRequirement' + qosFlowRetThds: + type: array + items: + $ref: '#/components/schemas/RetainabilityThreshold' + minItems: 1 + ranUeThrouThds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + minItems: 1 + repetitionPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + snssaia: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: > + Identification(s) of network slice to which the subscription applies. It corresponds to + snssais in the data model definition of 3GPP TS 29.520. + tgtUe: + $ref: '#/components/schemas/TargetUeInformation' + congThresholds: + type: array + items: + $ref: '#/components/schemas/ThresholdLevel' + minItems: 1 + nwPerfRequs: + type: array + items: + $ref: '#/components/schemas/NetworkPerfRequirement' + minItems: 1 + bwRequs: + type: array + items: + $ref: '#/components/schemas/BwRequirement' + minItems: 1 + excepRequs: + type: array + items: + $ref: '#/components/schemas/Exception' + minItems: 1 + exptAnaType: + $ref: '#/components/schemas/ExpectedAnalyticsType' + exptUeBehav: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExpectedUeBehaviourData' + ratFreqs: + type: array + items: + $ref: '#/components/schemas/RatFreqInformation' + minItems: 1 + listOfAnaSubsets: + type: array + items: + $ref: '#/components/schemas/AnalyticsSubset' + minItems: 1 + disperReqs: + type: array + items: + $ref: '#/components/schemas/DispersionRequirement' + minItems: 1 + redTransReqs: + type: array + items: + $ref: '#/components/schemas/RedundantTransmissionExpReq' + minItems: 1 + wlanReqs: + type: array + items: + $ref: '#/components/schemas/WlanPerformanceReq' + minItems: 1 + upfInfo: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/UpfInformation' + appServerAddrs: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + minItems: 1 + dnPerfReqs: + type: array + items: + $ref: '#/components/schemas/DnPerformanceReq' + minItems: 1 + required: + - event + + NnwdafEventsSubscriptionNotification: + description: Represents an Individual NWDAF Event Subscription Notification resource. + type: object + properties: + eventNotifications: + type: array + items: + $ref: '#/components/schemas/EventNotification' + minItems: 1 + description: Notifications about Individual Events + subscriptionId: + type: string + description: String identifying a subscription to the Nnwdaf_EventsSubscription Service + notifCorrId: + type: string + description: Notification correlation identifier. + oldSubscriptionId: + type: string + description: > + Subscription ID which was allocated by the source NWDAF. This parameter shall be present + if the notification is for informing the assignment of a new Subscription Id by the + target NWDAF. + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - subscriptionId + oneOf: + - required: [eventNotifications] + - allOf: + - required: [resourceUri] + - required: [oldSubscriptionId] + + EventNotification: + description: Represents a notification on events that occurred. + type: object + properties: + event: + $ref: '#/components/schemas/NwdafEvent' + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStampGen: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + failNotifyCode: + $ref: '#/components/schemas/NwdafFailureCode' + rvWaitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + anaMetaInfo: + $ref: '#/components/schemas/AnalyticsMetadataInfo' + nfLoadLevelInfos: + type: array + items: + $ref: '#/components/schemas/NfLoadLevelInformation' + minItems: 1 + nsiLoadLevelInfos: + type: array + items: + $ref: '#/components/schemas/NsiLoadLevelInfo' + minItems: 1 + sliceLoadLevelInfo: + $ref: '#/components/schemas/SliceLoadLevelInformation' + svcExps: + type: array + items: + $ref: '#/components/schemas/ServiceExperienceInfo' + minItems: 1 + qosSustainInfos: + type: array + items: + $ref: '#/components/schemas/QosSustainabilityInfo' + minItems: 1 + ueComms: + type: array + items: + $ref: '#/components/schemas/UeCommunication' + minItems: 1 + ueMobs: + type: array + items: + $ref: '#/components/schemas/UeMobility' + minItems: 1 + userDataCongInfos: + type: array + items: + $ref: '#/components/schemas/UserDataCongestionInfo' + minItems: 1 + abnorBehavrs: + type: array + items: + $ref: '#/components/schemas/AbnormalBehaviour' + minItems: 1 + nwPerfs: + type: array + items: + $ref: '#/components/schemas/NetworkPerfInfo' + minItems: 1 + dnPerfInfos: + type: array + items: + $ref: '#/components/schemas/DnPerfInfo' + minItems: 1 + disperInfos: + type: array + items: + $ref: '#/components/schemas/DispersionInfo' + minItems: 1 + redTransInfos: + type: array + items: + $ref: '#/components/schemas/RedundantTransmissionExpInfo' + minItems: 1 + wlanInfos: + type: array + items: + $ref: '#/components/schemas/WlanPerformanceInfo' + minItems: 1 + smccExps: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/SmcceInfo' + minItems: 1 + required: + - event + + ServiceExperienceInfo: + description: Represents service experience information. + type: object + properties: + svcExprc: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/SvcExperience' + svcExprcVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + srvExpcType: + $ref: '#/components/schemas/ServiceExperienceType' + ueLocs: + type: array + items: + $ref: '#/components/schemas/LocationInfo' + minItems: 1 + upfInfo: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/UpfInformation' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + appServerInst: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + nsiId: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + ratFreq: + $ref: '#/components/schemas/RatFreqInformation' + required: + - svcExprc + + BwRequirement: + description: Represents bandwidth requirements. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + required: + - appId + + SliceLoadLevelInformation: + description: Contains load level information applicable for one or several slices. + type: object + properties: + loadLevelInformation: + $ref: '#/components/schemas/LoadLevelInformation' + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: Identification(s) of network slice to which the subscription applies. + required: + - loadLevelInformation + - snssais + + NsiLoadLevelInfo: + description: > + Represents the network slice and optionally the associated network slice instance and the + load level information. + type: object + properties: + loadLevelInformation: + $ref: '#/components/schemas/LoadLevelInformation' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiId: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + resUsage: + $ref: '#/components/schemas/ResourceUsage' + numOfExceedLoadLevelThr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + exceedLoadLevelThrInd: + type: boolean + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + timePeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + resUsgThrCrossTimePeriod: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + minItems: 1 + description: > + Each element indicates the time elapsed between times each threshold is met or exceeded + or crossed. The start time and end time are the exact time stamps of the resource usage + threshold is reached or exceeded. May be present if the "listOfAnaSubsets" attribute is + provided and the maximum number of instances shall not exceed the value provided in the + "numOfExceedLoadLevelThr" attribute. + numOfUes: + $ref: '#/components/schemas/NumberAverage' + numOfPduSess: + $ref: '#/components/schemas/NumberAverage' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - loadLevelInformation + - snssai + + NsiIdInfo: + description: Represents the S-NSSAI and the optionally associated Network Slice Instance(s). + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiIds: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + minItems: 1 + required: + - snssai + + EventReportingRequirement: + description: Represents the type of reporting that the subscription requires. + type: object + properties: + accuracy: + $ref: '#/components/schemas/Accuracy' + accPerSubset: + type: array + items: + $ref: '#/components/schemas/Accuracy' + minItems: 1 + description: > + Each element indicates the preferred accuracy level per analytics subset. It may be + present if the "listOfAnaSubsets" attribute is present in the subscription request when + the subscription event is NF_LOAD, UE_COMM, DISPERSION, NETWORK_PERFORMANCE, + WLAN_PERFORMANCE, DN_PERFORMANCE or SERVICE_EXPERIENCE. + startTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + offsetPeriod: + type: integer + description: > + Offset period in units of seconds to the reporting time, if the value is negative means + statistics in the past offset period, otherwise a positive value means prediction in the + future offset period. May be present if the "repPeriod" attribute is included within the + "evtReq" attribute. + sampRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + maxObjectNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxSupiNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + timeAnaNeeded: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + anaMeta: + type: array + items: + $ref: '#/components/schemas/AnalyticsMetadata' + minItems: 1 + anaMetaInd: + $ref: '#/components/schemas/AnalyticsMetadataIndication' + + TargetUeInformation: + description: Identifies the target UE information. + type: object + properties: + anyUe: + type: boolean + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + intGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + + UeMobility: + description: Represents UE mobility information. + type: object + properties: + ts: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + recurringTime: + $ref: 'TS29122_CpProvisioning.yaml#/components/schemas/ScheduledCommunicationTime' + duration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + durationVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + locInfos: + type: array + items: + $ref: '#/components/schemas/LocationInfo' + minItems: 1 + allOf: + - required: [duration] + - required: [locInfos] + - oneOf: + - required: [ts] + - required: [recurringTime] + LocationInfo: + description: Represents UE location information. + type: object + properties: + loc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - loc + + UeCommunication: + description: Represents UE communication information. + type: object + properties: + commDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + commDurVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + perioTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + perioTimeVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + ts: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tsVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + recurringTime: + $ref: 'TS29122_CpProvisioning.yaml#/components/schemas/ScheduledCommunicationTime' + trafChar: + $ref: '#/components/schemas/TrafficCharacterization' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + perioCommInd: + type: boolean + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + anaOfAppList: + $ref: '#/components/schemas/AppListForUeComm' + sessInactTimer: + $ref: '#/components/schemas/SessInactTimerForUeComm' + allOf: + - required: [commDur] + - required: [trafChar] + - oneOf: + - required: [ts] + - required: [recurringTime] + TrafficCharacterization: + description: Identifies the detailed traffic characterization. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + fDescs: + type: array + items: + $ref: '#/components/schemas/IpEthFlowDescription' + minItems: 1 + maxItems: 2 + ulVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + ulVolVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + dlVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + dlVolVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + anyOf: + - required: [ulVol] + - required: [dlVol] + + UserDataCongestionInfo: + description: Represents the user data congestion information. + type: object + properties: + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + congestionInfo: + $ref: '#/components/schemas/CongestionInfo' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - networkArea + - congestionInfo + + CongestionInfo: + description: Represents the congestion information. + type: object + properties: + congType: + $ref: '#/components/schemas/CongestionType' + timeIntev: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + nsi: + $ref: '#/components/schemas/ThresholdLevel' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + topAppListUl: + type: array + items: + $ref: '#/components/schemas/TopApplication' + minItems: 1 + topAppListDl: + type: array + items: + $ref: '#/components/schemas/TopApplication' + minItems: 1 + required: + - congType + - timeIntev + - nsi + + TopApplication: + description: Top application that contributes the most to the traffic. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + oneOf: + - required: [appId] + - required: [ipTrafficFilter] + + QosSustainabilityInfo: + description: Represents the QoS Sustainability information. + type: object + properties: + areaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + startTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qosFlowRetThd: + $ref: '#/components/schemas/RetainabilityThreshold' + ranUeThrouThd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + oneOf: + - required: [qosFlowRetThd] + - required: [ranUeThrouThd] + + QosRequirement: + description: Represents the QoS requirements. + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + gfbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gfbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + resType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/QosResourceType' + pdb: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + per: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + oneOf: + - required: [5qi] + - required: [resType] + ThresholdLevel: + description: Represents a threshold level. + type: object + properties: + congLevel: + type: integer + nfLoadLevel: + type: integer + nfCpuUsage: + type: integer + nfMemoryUsage: + type: integer + nfStorageUsage: + type: integer + avgTrafficRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxTrafficRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + avgPacketDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + maxPacketDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + avgPacketLossRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + svcExpLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + + NfLoadLevelInformation: + description: Represents load level information of a given NF instance. + type: object + properties: + nfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nfStatus: +# $ref: '#/components/schemas/NfStatus' + $ref: '#/components/schemas/NnwdafNfStatus' + nfCpuUsage: + type: integer + nfMemoryUsage: + type: integer + nfStorageUsage: + type: integer + nfLoadLevelAverage: + type: integer + nfLoadLevelpeak: + type: integer + nfLoadAvgInAoi: + type: integer + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + allOf: + - required: [nfType] + - required: [nfInstanceId] + - anyOf: + - required: [nfStatus] + - required: [nfCpuUsage] + - required: [nfMemoryUsage] + - required: [nfStorageUsage] + - required: [nfLoadLevelAverage] + - required: [nfLoadLevelPeak] + +# NfStatus: + NnwdafNfStatus: + description: Contains the percentage of time spent on various NF states. + type: object + properties: + statusRegistered: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + statusUnregistered: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + statusUndiscoverable: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + anyOf: + - required: [statusRegistered] + - required: [statusUnregistered] + - required: [statusUndiscoverable] + + AnySlice: + type: boolean + description: > + FALSE represents not applicable for all slices. TRUE represents applicable for all slices. + + LoadLevelInformation: + type: integer + description: > + Load level information of the network slice and the optionally associated network slice + instance. + + AbnormalBehaviour: + description: Represents the abnormal behaviour information. + type: object + properties: + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + excep: + $ref: '#/components/schemas/Exception' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + addtMeasInfo: + $ref: '#/components/schemas/AdditionalMeasurement' + required: + - excep + + Exception: + description: Represents the Exception information. + type: object + properties: + excepId: + $ref: '#/components/schemas/ExceptionId' + excepLevel: + type: integer + excepTrend: + $ref: '#/components/schemas/ExceptionTrend' + required: + - excepId + + AdditionalMeasurement: + description: Represents additional measurement information. + type: object + properties: + unexpLoc: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + unexpFlowTeps: + type: array + items: + $ref: '#/components/schemas/IpEthFlowDescription' + minItems: 1 + unexpWakes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minItems: 1 + ddosAttack: + $ref: '#/components/schemas/AddressList' + wrgDest: + $ref: '#/components/schemas/AddressList' + circums: + type: array + items: + $ref: '#/components/schemas/CircumstanceDescription' + minItems: 1 + + IpEthFlowDescription: + description: Contains the description of an Uplink and/or Downlink Ethernet flow. + type: object + properties: + ipTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + ethTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + oneOf: + - required: [ipTrafficFilter] + - required: [ethTrafficFilter] + + AddressList: + description: Represents a list of IPv4 and/or IPv6 addresses. + type: object + properties: + ipv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + + CircumstanceDescription: + description: Contains the description of a circumstance. + type: object + properties: + freq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + tm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + vol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + + RetainabilityThreshold: + description: Represents a QoS flow retainability threshold. + type: object + properties: + relFlowNum: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + relTimeUnit: + $ref: '#/components/schemas/TimeUnit' + relFlowRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + oneOf: + - allOf: + - required: [relFlowNum] + - required: [relTimeUnit] + - required: [relFlowRatio] + + NetworkPerfRequirement: + description: Represents a network performance requirement. + type: object + properties: + nwPerfType: + $ref: '#/components/schemas/NetworkPerfType' + relativeRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + absoluteNum: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - nwPerfType + + NetworkPerfInfo: + description: Represents the network performance information. + type: object + properties: + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + nwPerfType: + $ref: '#/components/schemas/NetworkPerfType' + relativeRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + absoluteNum: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + allOf: + - required: [networkArea] + - required: [nwPerfType] + - oneOf: + - required: [relativeRatio] + - required: [absoluteNum] + + FailureEventInfo: + description: Contains information on the event for which the subscription is not successful. + type: object + properties: + event: + $ref: '#/components/schemas/NwdafEvent' + failureCode: + $ref: '#/components/schemas/NwdafFailureCode' + required: + - event + - failureCode + + AnalyticsMetadataIndication: + description: > + Contains analytics metadata information requested to be used during analytics generation. + type: object + properties: + dataWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dataStatProps: + type: array + items: + $ref: '#/components/schemas/DatasetStatisticalProperty' + minItems: 1 + strategy: + $ref: '#/components/schemas/OutputStrategy' + aggrNwdafIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + + AnalyticsMetadataInfo: + description: Contains analytics metadata information required for analytics aggregation. + type: object + properties: + numSamples: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + dataWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dataStatProps: + type: array + items: + $ref: '#/components/schemas/DatasetStatisticalProperty' + minItems: 1 + strategy: + $ref: '#/components/schemas/OutputStrategy' + accuracy: + $ref: '#/components/schemas/Accuracy' + NumberAverage: + description: Represents average and variance information. + type: object + properties: + number: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + variance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + skewness: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + required: + - number + - variance + + AnalyticsSubscriptionsTransfer: + description: Contains information about a request to transfer analytics subscriptions. + type: object + properties: + subsTransInfos: + type: array + items: + $ref: '#/components/schemas/SubscriptionTransferInfo' + minItems: 1 + required: + - subsTransInfos + + SubscriptionTransferInfo: + description: Contains information about subscriptions that are requested to be transferred. + type: object + properties: + transReqType: + $ref: '#/components/schemas/TransferRequestType' + nwdafEvSub: + $ref: '#/components/schemas/NnwdafEventsSubscription' + consumerId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + contextId: + $ref: '#/components/schemas/AnalyticsContextIdentifier' + sourceNfIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + sourceSetIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + modelInfo: + type: array + items: + $ref: '#/components/schemas/ModelInfo' + minItems: 1 + required: + - transReqType + - nwdafEvSub + - consumerId + + ModelInfo: + description: Contains information about an ML model. + type: object + properties: + analyticsId: + $ref: '#/components/schemas/NwdafEvent' + mlModelInfos: + type: array + items: + $ref: '#/components/schemas/MLModelInfo' + minItems: 1 + required: + - analyticsId + - mlModelInfos + MLModelInfo: + description: Contains information about an ML models. + type: object + properties: + mlFileAddrs: + type: array + items: + $ref: 'TS29520_Nnwdaf_MLModelProvision.yaml#/components/schemas/MLModelAddr' + minItems: 1 + modelProvId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + modelProvSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + oneOf: + - required: [modelProvId] + - required: [modelProvSetId] + + AnalyticsContextIdentifier: + description: Contains information about available analytics contexts. + type: object + properties: + subscriptionId: + type: string + description: The identifier of a subscription. + nfAnaCtxts: + type: array + items: + $ref: '#/components/schemas/NwdafEvent' + minItems: 1 + description: > + List of analytics types for which NF related analytics contexts can be retrieved. + ueAnaCtxts: + type: array + items: + $ref: '#/components/schemas/UeAnalyticsContextDescriptor' + minItems: 1 + description: > + List of objects that indicate for which SUPI and analytics types combinations analytics + context can be retrieved. + allOf: + - anyOf: + - required: [nfAnaCtxts] + - required: [ueAnaCtxts] + - required: [subscriptionId] + + UeAnalyticsContextDescriptor: + description: Contains information about available UE related analytics contexts. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + anaTypes: + type: array + items: + $ref: '#/components/schemas/NwdafEvent' + minItems: 1 + description: > + List of analytics types for which UE related analytics contexts can be retrieved. + required: + - supi + - anaTypes + + DnPerfInfo: + description: Represents DN performance information. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnPerf: + type: array + items: + $ref: '#/components/schemas/DnPerf' + minItems: 1 + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - dnPerf + + DnPerf: + description: Represents DN performance for the application. + type: object + properties: + appServerInsAddr: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + upfInfo: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/UpfInformation' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + perfData: + $ref: '#/components/schemas/PerfData' + spatialValidCon: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + temporalValidCon: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + required: + - perfData + + PerfData: + description: Represents DN performance data. + type: object + properties: + avgTrafficRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxTrafficRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + avePacketDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + maxPacketDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + avgPacketLossRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + + DispersionRequirement: + description: Represents the dispersion analytics requirements. + type: object + properties: + disperType: + $ref: '#/components/schemas/DispersionType' + classCriters: + type: array + items: + $ref: '#/components/schemas/ClassCriterion' + minItems: 1 + rankCriters: + type: array + items: + $ref: '#/components/schemas/RankingCriterion' + minItems: 1 + dispOrderCriter: + $ref: '#/components/schemas/DispersionOrderingCriterion' + order: + $ref: '#/components/schemas/MatchingDirection' + required: + - disperType + + ClassCriterion: + description: > + Indicates the dispersion class criterion for fixed, camper and/or traveller UE, and/or the + top-heavy UE dispersion class criterion. + type: object + properties: + disperClass: + $ref: '#/components/schemas/DispersionClass' + classThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + thresMatch: + $ref: '#/components/schemas/MatchingDirection' + required: + - disperClass + - classThreshold + - thresMatch + + RankingCriterion: + description: Indicates the usage ranking criterion between the high, medium and low usage UE. + type: object + properties: + highBase: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + lowBase: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + required: + - highBase + - lowBase + DispersionInfo: + description: > + Represents the Dispersion information. When subscribed event is "DISPERSION", the + "disperInfos" attribute shall be included. + type: object + properties: + tsStart: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tsDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + disperCollects: + type: array + items: + $ref: '#/components/schemas/DispersionCollection' + minItems: 1 + disperType: + $ref: '#/components/schemas/DispersionType' + required: + - tsStart + - tsDuration + - disperCollects + - disperType + + DispersionCollection: + description: Dispersion collection per UE location or per slice. + type: object + properties: + ueLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + appVolumes: + type: array + items: + $ref: '#/components/schemas/ApplicationVolume' + minItems: 1 + disperAmount: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + disperClass: + $ref: '#/components/schemas/DispersionClass' + usageRank: + type: integer + description: Integer where the allowed values correspond to 1, 2, 3 only. + minimum: 1 + maximum: 3 + percentileRank: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + ueRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + allOf: + - oneOf: + - required: [ueLoc] + - required: [snssai] + - anyOf: + - required: [disperAmount] + - required: [disperClass] + - required: [usageRank] + - required: [percentileRank] + + ApplicationVolume: + description: Application data volume per Application Id. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + appVolume: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + required: + - appId + - appVolume + + RedundantTransmissionExpReq: + description: Represents other redundant transmission experience analytics requirements. + type: object + properties: + redTOrderCriter: + $ref: '#/components/schemas/RedTransExpOrderingCriterion' + order: + $ref: '#/components/schemas/MatchingDirection' + + RedundantTransmissionExpInfo: + description: > + The redundant transmission experience related information. When subscribed event is + "RED_TRANS_EXP", the "redTransInfos" attribute shall be included. + type: object + properties: + spatialValidCon: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + redTransExps: + type: array + items: + $ref: '#/components/schemas/RedundantTransmissionExpPerTS' + minItems: 1 + required: + - redTransExps + + RedundantTransmissionExpPerTS: + description: The redundant transmission experience per Time Slot. + type: object + properties: + tsStart: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tsDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + obsvRedTransExp: + $ref: '#/components/schemas/ObservedRedundantTransExp' + redTransStatus: + type: boolean + description: > + Redundant Transmission Status. Set to "true" if redundant transmission was activated, + otherwise set to "false". Default value is "false" if omitted. + ueRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - tsStart + - tsDuration + - obsvRedTransExp + ObservedRedundantTransExp: + description: Represents the observed redundant transmission experience related information. + type: object + properties: + avgPktDropRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + varPktDropRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + avgPktDropRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + varPktDropRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + avgPktDelayUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + varPktDelayUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + avgPktDelayDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + varPktDelayDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + + WlanPerformanceReq: + description: Represents other WLAN performance analytics requirements. + type: object + properties: + ssIds: + type: array + items: + type: string + minItems: 1 + bssIds: + type: array + items: + type: string + minItems: 1 + wlanOrderCriter: + $ref: '#/components/schemas/WlanOrderingCriterion' + order: + $ref: '#/components/schemas/MatchingDirection' + + WlanPerformanceInfo: + description: The WLAN performance related information. + type: object + properties: + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + wlanPerSsidInfos: + type: array + items: + $ref: '#/components/schemas/WlanPerSsIdPerformanceInfo' + minItems: 1 + required: + - wlanPerSsidInfos + + WlanPerSsIdPerformanceInfo: + description: The WLAN performance per SSID. + type: object + properties: + ssId: + type: string + wlanPerTsInfos: + type: array + items: + $ref: '#/components/schemas/WlanPerTsPerformanceInfo' + minItems: 1 + required: + - ssId + - wlanPerTsInfos + + WlanPerTsPerformanceInfo: + description: WLAN performance information per Time Slot during the analytics target period. + type: object + properties: + tsStart: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tsDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + rssi: + type: integer + rtt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + trafficInfo: + $ref: '#/components/schemas/TrafficInformation' + numberOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - tsStart + - tsDuration + anyOf: + - required: [rssi] + - required: [rtt] + - required: [trafficInfo] + - required: [numberOfUes] + + TrafficInformation: + description: Traffic information including UL/DL data rate and/or Traffic volume. + type: object + properties: + uplinkRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + downlinkRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + uplinkVolume: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + downlinkVolume: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + totalVolume: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + anyOf: + - required: [uplinkRate] + - required: [downlinkRate] + - required: [uplinkVolume] + - required: [downlinkVolume] + - required: [totalVolume] + + AppListForUeComm: + description: Represents the analytics of the application list used by UE. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + appDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + occurRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + spatialValidity: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + required: + - appId + + SessInactTimerForUeComm: + description: Represents the N4 Session inactivity timer. + type: object + properties: + n4SessId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + sessInactiveTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - n4SessId + - sessInactiveTimer + + DnPerformanceReq: + description: Represents other DN performance analytics requirements. + type: object + properties: + dnPerfOrderCriter: + $ref: '#/components/schemas/DnPerfOrderingCriterion' + order: + $ref: '#/components/schemas/MatchingDirection' + reportThresholds: + type: array + items: + $ref: '#/components/schemas/ThresholdLevel' + minItems: 1 + + RatFreqInformation: + description: Represents the RAT type and/or Frequency information. + type: object + properties: + allFreq: + type: boolean + description: > + Set to "true" to indicate to handle all the frequencies the NWDAF received, otherwise + set to "false" or omit. The "allFreq" attribute and the "freq" attribute are mutually + exclusive. + allRat: + type: boolean + description: > + Set to "true" to indicate to handle all the RAT Types the NWDAF received, otherwise + set to "false" or omit. The "allRat" attribute and the "ratType" attribute are mutually + exclusive. + freq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ArfcnValueNR' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + svcExpThreshold: + $ref: '#/components/schemas/ThresholdLevel' + matchingDir: + $ref: '#/components/schemas/MatchingDirection' + + PrevSubInfo: + description: Information of the previous subscription. + type: object + properties: + producerId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + producerSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + subscriptionId: + type: string + description: The identifier of a subscription. + nfAnaEvents: + type: array + items: + $ref: '#/components/schemas/NwdafEvent' + minItems: 1 + ueAnaEvents: + type: array + items: + $ref: '#/components/schemas/UeAnalyticsContextDescriptor' + minItems: 1 + required: + - subscriptionId + oneOf: + - required: [producerId] + - required: [producerSetId] + + ResourceUsage: + description: > + The current usage of the virtual resources assigned to the NF instances belonging to a + particular network slice instance. + type: object + properties: + cpuUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + memoryUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + storageUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + + ConsumerNfInformation: + description: Represents the analytics consumer NF Information. + type: object + properties: + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + oneOf: + - oneOf: + - required: [nfId] + - required: [nfSetId] + - required: [taiList] + +# +# ENUMERATIONS DATA TYPES +# + NotificationMethod: + anyOf: + - type: string + enum: + - PERIODIC + - THRESHOLD + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - PERIODIC: The subscribe of NWDAF Event is periodically. The periodic of the notification is identified by repetitionPeriod defined in clause 5.1.6.2.3. + - THRESHOLD: The subscribe of NWDAF Event is upon threshold exceeded. + + NwdafEvent: + anyOf: + - type: string + enum: + - SLICE_LOAD_LEVEL + - NETWORK_PERFORMANCE + - NF_LOAD + - SERVICE_EXPERIENCE + - UE_MOBILITY + - UE_COMMUNICATION + - QOS_SUSTAINABILITY + - ABNORMAL_BEHAVIOUR + - USER_DATA_CONGESTION + - NSI_LOAD_LEVEL + - DN_PERFORMANCE + - DISPERSION + - RED_TRANS_EXP + - WLAN_PERFORMANCE + - SM_CONGESTION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - SLICE_LOAD_LEVEL: Indicates that the event subscribed is load level information of Network Slice + - NETWORK_PERFORMANCE: Indicates that the event subscribed is network performance information. + - NF_LOAD: Indicates that the event subscribed is load level and status of one or several Network Functions. + - SERVICE_EXPERIENCE: Indicates that the event subscribed is service experience. + - UE_MOBILITY: Indicates that the event subscribed is UE mobility information. + - UE_COMMUNICATION: Indicates that the event subscribed is UE communication information. + - QOS_SUSTAINABILITY: Indicates that the event subscribed is QoS sustainability. + - ABNORMAL_BEHAVIOUR: Indicates that the event subscribed is abnormal behaviour. + - USER_DATA_CONGESTION: Indicates that the event subscribed is user data congestion information. + - NSI_LOAD_LEVEL: Indicates that the event subscribed is load level information of Network Slice and the optionally associated Network Slice Instance + - DN_PERFORMANCE: Indicates that the event subscribed is DN performance information. + - DISPERSION: Indicates that the event subscribed is dispersion information. + - RED_TRANS_EXP: Indicates that the event subscribed is redundant transmission experience. + - WLAN_PERFORMANCE: Indicates that the event subscribed is WLAN performance. + - SM_CONGESTION: Indicates the Session Management Congestion Control Experience information for specific DNN and/or S-NSSAI. + + Accuracy: + anyOf: + - type: string + enum: + - LOW + - HIGH + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - LOW: Low accuracy. + - HIGH: High accuracy. + + CongestionType: + anyOf: + - type: string + enum: + - USER_PLANE + - CONTROL_PLANE + - USER_AND_CONTROL_PLANE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - USER_PLANE: The congestion analytics type is User Plane. + - CONTROL_PLANE: The congestion analytics type is Control Plane. + - USER_AND_CONTROL_PLANE: The congestion analytics type is User Plane and Control Plane. + + ExceptionId: + anyOf: + - type: string + enum: + - UNEXPECTED_UE_LOCATION + - UNEXPECTED_LONG_LIVE_FLOW + - UNEXPECTED_LARGE_RATE_FLOW + - UNEXPECTED_WAKEUP + - SUSPICION_OF_DDOS_ATTACK + - WRONG_DESTINATION_ADDRESS + - TOO_FREQUENT_SERVICE_ACCESS + - UNEXPECTED_RADIO_LINK_FAILURES + - PING_PONG_ACROSS_CELLS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNEXPECTED_UE_LOCATION: Unexpected UE location + - UNEXPECTED_LONG_LIVE_FLOW: Unexpected long-live rate flows + - UNEXPECTED_LARGE_RATE_FLOW: Unexpected large rate flows + - UNEXPECTED_WAKEUP: Unexpected wakeup + - SUSPICION_OF_DDOS_ATTACK: Suspicion of DDoS attack + - WRONG_DESTINATION_ADDRESS: Wrong destination address + - TOO_FREQUENT_SERVICE_ACCESS: Too frequent Service Access + - UNEXPECTED_RADIO_LINK_FAILURES: Unexpected radio link failures + - PING_PONG_ACROSS_CELLS: Ping-ponging across neighbouring cells + + ExceptionTrend: + anyOf: + - type: string + enum: + - UP + - DOWN + - UNKNOW + - STABLE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UP: Up trend of the exception level. + - DOWN: Down trend of the exception level. + - UNKNOW: Unknown trend of the exception level. + - STABLE: Stable trend of the exception level. + + TimeUnit: + anyOf: + - type: string + enum: + - MINUTE + - HOUR + - DAY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - MINUTE: Time unit is per minute. + - HOUR: Time unit is per hour. + - DAY: Time unit is per day. + + NetworkPerfType: + anyOf: + - type: string + enum: + - GNB_ACTIVE_RATIO + - GNB_COMPUTING_USAGE + - GNB_MEMORY_USAGE + - GNB_DISK_USAGE + - NUM_OF_UE + - SESS_SUCC_RATIO + - HO_SUCC_RATIO + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - GNB_ACTIVE_RATIO: Indicates that the network performance requirement is gNodeB active (i.e. up and running) rate. Indicates the ratio of gNB active (i.e. up and running) number to the total number of gNB + - GNB_COMPUTING_USAGE: Indicates gNodeB computing resource usage. + - GNB_MEMORY_USAGE: Indicates gNodeB memory usage. + - GNB_DISK_USAGE: Indicates gNodeB disk usage. + - NUM_OF_UE: Indicates number of UEs. + - SESS_SUCC_RATIO: Indicates ratio of successful setup of PDU sessions to total PDU session setup attempts. + - HO_SUCC_RATIO: Indicates Ratio of successful handovers to the total handover attempts. + + ExpectedAnalyticsType: + anyOf: + - type: string + enum: + - MOBILITY + - COMMUN + - MOBILITY_AND_COMMUN + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - MOBILITY: Mobility related abnormal behaviour analytics is expected by the consumer. + - COMMUN: Communication related abnormal behaviour analytics is expected by the consumer. + - MOBILITY_AND_COMMUN: Both mobility and communication related abnormal behaviour analytics is expected by the consumer. + + MatchingDirection: + anyOf: + - type: string + enum: + - ASCENDING + - DESCENDING + - CROSSED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - ASCENDING: Threshold is crossed in ascending direction. + - DESCENDING: Threshold is crossed in descending direction. + - CROSSED: Threshold is crossed either in ascending or descending direction. + + NwdafFailureCode: + anyOf: + - type: string + enum: + - UNAVAILABLE_DATA + - BOTH_STAT_PRED_NOT_ALLOWED + - UNSATISFIED_REQUESTED_ANALYTICS_TIME + - OTHER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNAVAILABLE_DATA: Indicates the requested statistics information for the event is rejected since necessary data to perform the service is unavailable. + - BOTH_STAT_PRED_NOT_ALLOWED: Indicates the requested analysis information for the event is rejected since the start time is in the past and the end time is in the future, which means the NF service consumer requested both statistics and prediction for the analytics. + - UNSATISFIED_REQUESTED_ANALYTICS_TIME: Indicates that the requested event is rejected since the analytics information is not ready when the time indicated by the "timeAnaNeeded" attribute (as provided during the creation or modification of subscription) is reached. + - OTHER: Indicates the requested analysis information for the event is rejected due to other reasons. + + AnalyticsMetadata: + anyOf: + - type: string + enum: + - NUM_OF_SAMPLES + - DATA_WINDOW + - DATA_STAT_PROPS + - STRATEGY + - ACCURACY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - NUM_OF_SAMPLES: Number of data samples used for the generation of the output analytics. + - DATA_WINDOW: Data time window of the data samples. + - DATA_STAT_PROPS: Dataset statistical properties of the data used to generate the analytics. + - STRATEGY: Output strategy used for the reporting of the analytics. + - ACCURACY: Level of accuracy reached for the analytics. + + DatasetStatisticalProperty: + anyOf: + - type: string + enum: + - UNIFORM_DIST_DATA + - NO_OUTLIERS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNIFORM_DIST_DATA: Indicates the use of data samples that are uniformly distributed according to the different aspects of the requested analytics. + - NO_OUTLIERS: Indicates that the data samples shall disregard data samples that are at the extreme boundaries of the value range. + + OutputStrategy: + anyOf: + - type: string + enum: + - BINARY + - GRADIENT + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - BINARY: Indicates that the analytics shall only be reported when the requested level of accuracy is reached within a cycle of periodic notification. + - GRADIENT: Indicates that the analytics shall be reported according with the periodicity irrespective of whether the requested level of accuracy has been reached or not. + + TransferRequestType: + anyOf: + - type: string + enum: + - PREPARE + - TRANSFER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - PREPARE: Indicates that the request is for analytics subscription transfer preparation. + - TRANSFER: Indicates that the request is for analytics subscription transfer execution. + + AnalyticsSubset: + anyOf: + - type: string + enum: + - NUM_OF_UE_REG + - NUM_OF_PDU_SESS_ESTBL + - RES_USAGE + - NUM_OF_EXCEED_RES_USAGE_LOAD_LEVEL_THR + - PERIOD_OF_EXCEED_RES_USAGE_LOAD_LEVEL_THR + - EXCEED_LOAD_LEVEL_THR_IND + - LIST_OF_TOP_APP_UL + - LIST_OF_TOP_APP_DL + - NF_STATUS + - NF_RESOURCE_USAGE + - NF_LOAD + - NF_PEAK_LOAD + - NF_LOAD_AVG_IN_AOI + - DISPER_AMOUNT + - DISPER_CLASS + - RANKING + - PERCENTILE_RANKING + - RSSI + - RTT + - TRAFFIC_INFO + - NUMBER_OF_UES + - APP_LIST_FOR_UE_COMM + - N4_SESS_INACT_TIMER_FOR_UE_COMM + - AVG_TRAFFIC_RATE + - MAX_TRAFFIC_RATE + - AVG_PACKET_DELAY + - MAX_PACKET_DELAY + - AVG_PACKET_LOSS_RATE + - UE_LOCATION + - LIST_OF_HIGH_EXP_UE + - LIST_OF_MEDIUM_EXP_UE + - LIST_OF_LOW_EXP_UE + - AVG_UL_PKT_DROP_RATE + - VAR_UL_PKT_DROP_RATE + - AVG_DL_PKT_DROP_RATE + - VAR_DL_PKT_DROP_RATE + - AVG_UL_PKT_DELAY + - VAR_UL_PKT_DELAY + - AVG_DL_PKT_DELAY + - VAR_DL_PKT_DELAY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - NUM_OF_UE_REG: The number of UE registered. This value is only applicable to NSI_LOAD_LEVEL event. + - NUM_OF_PDU_SESS_ESTBL: The number of PDU sessions established. This value is only applicable to NSI_LOAD_LEVEL event. + - RES_USAGE: The current usage of the virtual resources assigned to the NF instances belonging to a particular network slice instance. This value is only applicable to NSI_LOAD_LEVEL event. + - NUM_OF_EXCEED_RES_USAGE_LOAD_LEVEL_THR: The number of times the resource usage threshold of the network slice instance is reached or exceeded if a threshold value is provided by the consumer. This value is only applicable to NSI_LOAD_LEVEL event. + - PERIOD_OF_EXCEED_RES_USAGE_LOAD_LEVEL_THR: The time interval between each time the threshold being met or exceeded on the network slice (instance). This value is only applicable to NSI_LOAD_LEVEL event. + - EXCEED_LOAD_LEVEL_THR_IND: Whether the Load Level Threshold is met or exceeded by the statistics value. This value is only applicable to NSI_LOAD_LEVEL event. + - LIST_OF_TOP_APP_UL: The list of applications that contribute the most to the traffic in the UL direction. This value is only applicable to USER_DATA_CONGESTION event. + - LIST_OF_TOP_APP_DL: The list of applications that contribute the most to the traffic in the DL direction. This value is only applicable to USER_DATA_CONGESTION event. + - NF_STATUS: The availability status of the NF on the Analytics target period, expressed as a percentage of time per status value (registered, suspended, undiscoverable). This value is only applicable to NF_LOAD event. + - NF_RESOURCE_USAGE: The average usage of assigned resources (CPU, memory, storage). This value is only applicable to NF_LOAD event. + - NF_LOAD: The average load of the NF instance over the Analytics target period. This value is only applicable to NF_LOAD event. + - NF_PEAK_LOAD: The maximum load of the NF instance over the Analytics target period. This value is only applicable to NF_LOAD event. + - NF_LOAD_AVG_IN_AOI: The average load of the NF instances over the area of interest. This value is only applicable to NF_LOAD event. + - DISPER_AMOUNT: Indicates the dispersion amount of the reported data volume or transaction dispersion type. This value is only applicable to DISPERSION event. + - DISPER_CLASS: Indicates the dispersion mobility class: fixed, camper, traveller upon set its usage threshold, and/or the top-heavy class upon set its percentile rating threshold. This value is only applicable to DISPERSION event. + - RANKING: Data/transaction usage ranking high (i.e.value 1), medium (2) or low (3). This value is only applicable to DISPERSION event. + - PERCENTILE_RANKING: Percentile ranking of the target UE in the Cumulative Distribution Function of data usage for the population of all UEs. This value is only applicable to DISPERSION event. + - RSSI: Indicated the RSSI in the unit of dBm. This value is only applicable to WLAN_PERFORMANCE event. + - RTT: Indicates the RTT in the unit of millisecond. This value is only applicable to WLAN_PERFORMANCE event. + - TRAFFIC_INFO: Traffic information including UL/DL data rate and/or Traffic volume. This value is only applicable to WLAN_PERFORMANCE event. + - NUMBER_OF_UES: Number of UEs observed for the SSID. This value is only applicable to WLAN_PERFORMANCE event. + - APP_LIST_FOR_UE_COMM: The analytics of the application list used by UE. This value is only applicable to UE_COMM event. + - N4_SESS_INACT_TIMER_FOR_UE_COMM: The N4 Session inactivity timer. This value is only applicable to UE_COMM event. + - AVG_TRAFFIC_RATE: Indicates average traffic rate. This value is only applicable to DN_PERFORMANCE event. + - MAX_TRAFFIC_RATE: Indicates maximum traffic rate. This value is only applicable to DN_PERFORMANCE event. + - AVG_PACKET_DELAY: Indicates average Packet Delay. This value is only applicable to DN_PERFORMANCE event. + - MAX_PACKET_DELAY: Indicates maximum Packet Delay. This value is only applicable to DN_PERFORMANCE event. + - AVG_PACKET_LOSS_RATE: Indicates average Loss Rate. This value is only applicable to DN_PERFORMANCE event. + - UE_LOCATION: Indicates UE location information. This value is only applicable to SERVICE_EXPERIENCE event. + - LIST_OF_HIGH_EXP_UE: Indicates list of high experienced UE. This value is only applicable to SM_CONGESTION event. + - LIST_OF_MEDIUM_EXP_UE: Indicates list of medium experienced UE. This value is only applicable to SM_CONGESTION event. + - LIST_OF_LOW_EXP_UE: Indicates list of low experienced UE. This value is only applicable to SM_CONGESTION event. + - AVG_UL_PKT_DROP_RATE: Indicates average uplink packet drop rate on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - VAR_UL_PKT_DROP_RATE: Indicates variance of uplink packet drop rate on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - AVG_DL_PKT_DROP_RATE: Indicates average downlink packet drop rate on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - VAR_DL_PKT_DROP_RATE: Indicates variance of downlink packet drop rate on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - AVG_UL_PKT_DELAY: Indicates average uplink packet delay round trip on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - VAR_UL_PKT_DELAY: Indicates variance uplink packet delay round trip on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - AVG_DL_PKT_DELAY: Indicates average downlink packet delay round trip on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - VAR_DL_PKT_DELAY: Indicates variance downlink packet delay round trip on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + + DispersionType: + oneOf: + - type: string + enum: + - DVDA + - TDA + - DVDA_AND_TDA + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - DVDA: Data Volume Dispersion Analytics. + - TDA: Transactions Dispersion Analytics. + - DVDA_AND_TDA: Data Volume Dispersion Analytics and Transactions Dispersion Analytics. + + DispersionClass: + oneOf: + - type: string + enum: + - FIXED + - CAMPER + - TRAVELLER + - TOP_HEAVY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - FIXED: Dispersion class as fixed UE its data or transaction usage at a location or a slice, is higher than its class threshold set for its all data or transaction usage. + - CAMPER: Dispersion class as camper UE, its data or transaction usage at a location or a slice, is higher than its class threshold and lower than the fixed class threshold set for its all data or transaction usage.. + - TRAVELLER: Dispersion class as traveller UE, its data or transaction usage at a location or a slice, is lower than the camper class threshold set for its all data or transaction usage. + - TOP_HEAVY: Dispersion class as Top_Heavy UE, who's dispersion percentile rating at a location or a slice, is higher than its class threshold. + + DispersionOrderingCriterion: + anyOf: + - type: string + enum: + - TIME_SLOT_START + - DISPERSION + - CLASSIFICATION + - RANKING + - PERCENTILE_RANKING + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - TIME_SLOT_START: Indicates the order of time slot start. + - DISPERSION: Indicates the order of data/transaction dispersion. + - CLASSIFICATION: Indicates the order of data/transaction classification. + - RANKING: Indicates the order of data/transaction ranking. + - PERCENTILE_RANKING: Indicates the order of data/transaction percentile ranking. + + RedTransExpOrderingCriterion: + anyOf: + - type: string + enum: + - TIME_SLOT_START + - RED_TRANS_EXP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - TIME_SLOT_START: Indicates the order of time slot start. + - RED_TRANS_EXP: Indicates the order of Redundant Transmission Experience. + + WlanOrderingCriterion: + anyOf: + - type: string + enum: + - TIME_SLOT_START + - NUMBER_OF_UES + - RSSI + - RTT + - TRAFFIC_INFO + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - TIME_SLOT_START: Indicates the order of time slot start. + - NUMBER_OF_UES: Indicates the order of number of UEs. + - RSSI: Indicates the order of RSSI. + - RTT: Indicates the order of RTT. + - TRAFFIC_INFO: Indicates the order of Traffic information. + + ServiceExperienceType: + anyOf: + - type: string + enum: + - VOICE + - VIDEO + - OTHER + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - VOICE: Indicates that the service experience analytics is for voice service. + - VIDEO: Indicates that the service experience analytics is for video service. + - OTHER: Indicates that the service experience analytics is for other service. + + DnPerfOrderingCriterion: + anyOf: + - type: string + enum: + - AVERAGE_TRAFFIC_RATE + - MAXIMUM_TRAFFIC_RATE + - AVERAGE_PACKET_DELAY + - MAXIMUM_PACKET_DELAY + - AVERAGE_PACKET_LOSS_RATE + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - AVERAGE_TRAFFIC_RATE: Indicates the average traffic rate. + - MAXIMUM_TRAFFIC_RATE: Indicates the maximum traffic rate. + - AVERAGE_PACKET_DELAY: Indicates the average packet delay. + - MAXIMUM_PACKET_DELAY: Indicates the maximum packet delay. + - AVERAGE_PACKET_LOSS_RATE: Indicates the average packet loss rate. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_MLModelProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_MLModelProvision.yaml new file mode 100644 index 000000000..f9199a886 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29520_Nnwdaf_MLModelProvision.yaml @@ -0,0 +1,340 @@ +openapi: 3.0.0 +info: + title: Nnwdaf_MLModelProvision + version: 1.0.0 + description: | + Nnwdaf_MLModelProvision API Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.520 V17.7.0; 5G System; Network Data Analytics Services. + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.520/ +servers: + - url: '{apiRoot}/nnwdaf-mlmodelprovision/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nnwdaf-mlmodelprovision +paths: + /subscriptions: + post: + summary: Create a new Individual NWDAF ML Model Provision Subscription resource. + operationId: CreateNWDAFMLModelProvisionSubcription + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafMLModelProvSubsc' + responses: + '201': + description: Create a new Individual NWDAF ML Model Provision Subscription resource. + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafMLModelProvSubsc' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnwdaf-mlmodelprovision/v1/subscriptions/{subscriptionId}. + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NwdafMLModelProvNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was succesfull + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subscriptionId}: + put: + summary: update an existing Individual NWDAF ML Model Provision Subscription + operationId: UpdateNWDAFMLModelProvisionSubcription + tags: + - Individual NWDAF ML Model Provision Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafMLModelProvSubsc' + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Nnwdaf_MLModelProvision Service. + required: true + schema: + type: string + responses: + '200': + description: > + The Individual NWDAF ML Model Provision Subscription resource was modified successfully + and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafMLModelProvSubsc' + '204': + description: > + The Individual NWDAF ML Model Provision Subscription resource was modified successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an existing Individual NWDAF ML Model Provision Subscription. + operationId: DeleteNWDAFMLModelProvisionSubcription + tags: + - Individual NWDAF ML Model Provision Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Nnwdaf_MLModelProvision Service. + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual NWDAF ML Model Provision Subscription matching the + subscriptionId was deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnwdaf-mlmodelprovision: Access to the Nnwdaf_MLModelProvision API + schemas: + NwdafMLModelProvSubsc: + description: Represents NWDAF Event Subscription resources. + type: object + properties: + mLEventSubscs: + type: array + items: + $ref: '#/components/schemas/MLEventSubscription' + minItems: 1 + description: Subscribed events + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + mLEventNotifs: + type: array + items: + $ref: '#/components/schemas/MLEventNotif' + minItems: 1 + suppFeats: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + notifCorreId: + type: string + eventReq: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + failEventReports: + type: array + items: + $ref: '#/components/schemas/FailureEventInfoForMLModel' + minItems: 1 + required: + - mLEventSubscs + - notifUri + MLEventSubscription: + description: Represents a subscription to a single event. + type: object + properties: + mLEvent: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + mLEventFilter: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventFilter' + tgtUe: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/TargetUeInformation' + mLTargetPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + expiryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - mLEvent + - mLEventFilter + NwdafMLModelProvNotif: + description: Represents notifications on events that occurred. + type: object + properties: + eventNotifs: + type: array + items: + $ref: '#/components/schemas/MLEventNotif' + minItems: 1 + description: Notifications about Individual Events. + subscriptionId: + type: string + description: String identifying a subscription to the Nnwdaf_MLModelProvision Service. + required: + - eventNotifs + - subscriptionId + MLEventNotif: + description: Represents a notification related to a single event that occurred. + type: object + properties: + event: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + notifCorreId: + type: string + mLFileAddr: + $ref: '#/components/schemas/MLModelAddr' + validityPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + spatialValidity: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + required: + - event + - mLFileAddr + FailureEventInfoForMLModel: + description: > + Represents the event(s) that the subscription is not successful including the failure + reason(s). + type: object + properties: + event: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + failureCode: + $ref: '#/components/schemas/FailureCode' + required: + - event + - failureCode + + MLModelAddr: + description: Addresses of ML model files. + type: object + properties: + mLModelUrl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + mlFileFqdn: + type: string + description: The FQDN of the ML Model file. + oneOf: + - required: [mLModelUrl] + - required: [mlFileFqdn] + +# +# ENUMERATIONS DATA TYPES +# + FailureCode: + anyOf: + - type: string + enum: + - UNAVAILABLE_ML_MODEL + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: > + Possible values are + - UNAVAILABLE_ML_MODEL: Indicates the requested ML model for the event is unavailable. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29521_Nbsf_Management.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29521_Nbsf_Management.yaml new file mode 100644 index 000000000..f1894c358 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29521_Nbsf_Management.yaml @@ -0,0 +1,1320 @@ +openapi: 3.0.0 + +info: + version: 1.3.1 + title: Nbsf_Management + description: | + Binding Support Management Service API. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.521 V17.7.0; 5G System; Binding Support Management Service. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.521/' + +servers: + - url: '{apiRoot}/nbsf-management/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nbsf-management + +paths: + /pcfBindings: + post: + summary: Create a new Individual PCF for a PDU Session binding information + operationId: CreatePCFBinding + tags: + - PCF Bindings (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcfBinding' + responses: + '201': + description: The creation of an individual PCF for a PDU Session binding. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfBinding' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nbsf-management//pcfBindings/{bindingId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: > + The existing PCF binding information stored in the BSF for the indicated combination is + returned. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read PCF for a PDU Session Bindings information + operationId: GetPCFBindings + tags: + - PCF Bindings (Collection) + parameters: + - name: ipv4Addr + in: query + description: The IPv4 Address of the served UE. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ipv6Prefix + in: query + description: > + The IPv6 Address of the served UE. The NF service consumer shall append '/128' to the + IPv6 address in the attribute value. E.g. '2001:db8:85a3::8a2e:370:7334/128'. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: macAddr48 + in: query + description: The MAC Address of the served UE. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + - name: dnn + in: query + description: DNN. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: supi + in: query + description: Subscription Permanent Identifier. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: gpsi + in: query + description: Generic Public Subscription Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: snssai + in: query + description: The identification of slice. + required: false + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: ipDomain + in: query + description: The IPv4 address domain identifier. + required: false + schema: + type: string + - name: supp-feat + in: query + description: To filter irrelevant responses related to unsupported features. + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + The individual PCF for a PDU Session binding session binding information resource + matching the query parameter(s) is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfBinding' + '204': + description: > + There is no PCF for a PDU Session binding information matching the query parameter(s). + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcfBindings/{bindingId}: + delete: + summary: Delete an existing Individual PCF for a PDU Session Binding information + operationId: DeleteIndPCFBinding + tags: + - Individual PCF Binding (Document) + parameters: + - name: bindingId + in: path + description: Represents the individual PCF for a PDU Session Binding. + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual PCF for a PDU Session Binding information resource is + deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Update an existing Individual PCF for a PDU Session Binding information + operationId: UpdateIndPCFBinding + tags: + - Individual PCF for a PDU Session Binding (Document) + parameters: + - name: bindingId + in: path + description: Represents the individual PCF for a PDU Session Binding. + required: true + schema: + type: string + requestBody: + description: Parameters to update the existing PCF for a PDU Session binding. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PcfBindingPatch' + responses: + '200': + description: OK (Successful update of the PCF for a PDU Session binding). + content: + application/json: + schema: + $ref: '#/components/schemas/PcfBinding' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions: + post: + operationId: CreateIndividualSubcription + summary: Create an individual subscription for event notifications from the BSF + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BsfSubscription' + responses: + '201': + description: Created. + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nsmf-management//subscriptions/{subId} + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/BsfSubscriptionResp' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BsfNotification' + responses: + '204': + description: No Content. Notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions/{subId}: + put: + operationId: ReplaceIndividualSubcription + summary: Replace an individual subscription for event notifications from the BSF + tags: + - IndividualSubscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BsfSubscription' + parameters: + - name: subId + in: path + description: Subscription correlation ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was successfully modified and representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BsfSubscriptionResp' + '204': + description: No Content. Resource was successfully modified. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + operationId: DeleteIndividualSubcription + summary: Delete an individual subscription for event notifications from the BSF + tags: + - IndividualSubscription (Document) + parameters: + - name: subId + in: path + description: Subscription correlation ID + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was successfully deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcf-ue-bindings: + post: + summary: Create a new Individual PCF for a UE binding information + operationId: CreatePCFforUEBinding + tags: + - PCF for a UE Bindings (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcfForUeBinding' + responses: + '201': + description: The creation of an individual PCF for a UE binding. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfForUeBinding' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nbsf-management//pcf-ue-bindings/{bindingId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read PCF for a UE Bindings information + operationId: GetPCFForUeBindings + tags: + - PCF for a UE Bindings (Collection) + parameters: + - name: supi + in: query + description: Subscription Permanent Identifier. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: gpsi + in: query + description: Generic Public Subscription Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supp-feat + in: query + description: To filter irrelevant responses related to unsupported features. + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + The individual PCF for a UE binding session binding information resource matching the + query parameter(s) is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PcfForUeBinding' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcf-ue-bindings/{bindingId}: + delete: + summary: Delete an existing Individual PCF for a UE Binding information + operationId: DeleteIndPCFforUEBinding + tags: + - Individual PCF for a UE Binding (Document) + parameters: + - name: bindingId + in: path + description: Represents the individual PCF for a UE Binding. + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual PCF for a UE binding information resource is deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Update an existing Individual PCF for a UE Binding information + operationId: UpdateIndPCFforUEBinding + tags: + - Individual PCF for a UE Binding (Document) + parameters: + - name: bindingId + in: path + description: Represents the individual PCF for a UE Binding. + required: true + schema: + type: string + requestBody: + description: Parameters to update the existing PCF for a UE binding. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PcfForUeBindingPatch' + responses: + '200': + description: OK. Successful update of the PCF for a PDU Session binding. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfForUeBinding' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcf-mbs-bindings: + post: + summary: Create a new Individual PCF for an MBS Session binding. + operationId: CreatePCFMbsBinding + tags: + - PCF for an MBS Session Bindings (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcfMbsBinding' + responses: + '201': + description: > + Created. A new Individual PCF for an MBS Session Binding resource is created + and the corresponding URI is returned in an HTTP Location header. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfMbsBinding' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nbsf-management/v1/pcf-mbs-bindings/{bindingId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + + description: > + The existing PCF binding information stored in the BSF for the MBS session is + returned. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/MbsExtProblemDetails' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve an existing PCF for an MBS Session binding. + operationId: GetPCFMbsBinding + tags: + - PCF for an MBS Session Bindings (Collection) + parameters: + - name: mbs-session-id + in: query + description: > + Contains the identifier of the MBS Session to which the requested MBS Session + binding is related. + required: true + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + - name: supp-feat + in: query + description: > + Contains the list of features supported by the NF service consumer and used to + filter irrelevant responses related to unsupported features. + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + OK. The Individual PCF for an MBS Session Binding resource(s) matching the provided + query parameter(s) are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PcfMbsBinding' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcf-mbs-bindings/{bindingId}: + parameters: + - name: bindingId + in: path + description: > + Represents the identifier of the Individual PCF for an MBS Session Binding resource. + required: true + schema: + type: string + + patch: + summary: Request the modification of an existing Individual PCF for an MBS Session Binding resource. + operationId: ModifyIndPCFMbsBinding + tags: + - Individual PCF for an MBS Session Binding (Document) + requestBody: + description: Parameters to request the modification of the PCF for an MBS Session Binding. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PcfMbsBindingPatch' + responses: + '200': + description: > + OK. The Individual PCF for an MBS Session Binding resource is successfully modified and + a representation of the updated resource is returned in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfMbsBinding' + '204': + description: > + No Content. The Individual PCF for an MBS Session Binding resource is successfully + modified and no content is returned in the response body. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the deletion of an existing Individual PCF for an MBS Session Binding. + operationId: DeleteIndPCFMbsBinding + tags: + - Individual PCF for an MBS Session Binding (Document) + responses: + '204': + description: > + No Content. The Individual PCF for an MBS Session Binding resource is successfully + Deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nbsf-management: Access to the Nbsf_Management API + + schemas: + + PcfBinding: + description: Identifies an Individual PCF for a PDU Session binding. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addIpv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: The additional IPv6 Address Prefixes of the served UE. + ipDomain: + type: string + macAddr48: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + addMacAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + description: The additional MAC Addresses of the served UE. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_PolicyAuthorization service + pcfDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + pcfDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + pcfSmFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfSmIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_SMPolicyControl service. + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + paraCom: + $ref: '#/components/schemas/ParameterCombination' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + ipv4FrameRouteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrMask' + minItems: 1 + ipv6FrameRouteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + required: + - dnn + - snssai + + PcfBindingPatch: + description: Identifies an Individual PCF binding used in an HTTP Patch method. + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrRm' + ipDomain: + type: string + nullable: true + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6PrefixRm' + addIpv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: The additional IPv6 Address Prefixes of the served UE. + nullable: true + macAddr48: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48Rm' + addMacAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + description: The additional MAC Addresses of the served UE. + nullable: true + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_PolicyAuthorization service. + pcfDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + pcfDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + + ParameterCombination: + description: > + Represents the combination used by the BSF to check whether there is an existing PCF binding + information. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + ExtProblemDetails: + description: > + Contains the FQDN or IP endpoints of the existing PCF and the cause value if there is an + existing PCF binding information for the indicated combination. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/BindingResp' + + MbsExtProblemDetails: + description: > + Contains the FQDN or IP endpoints of the existing PCF and the cause value if there is an + existing PCF binding information for the MBS session. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/MbsBindingResp' + + BindingResp: + description: Contains the binding information for a PCF for a PDU Session. + type: object + properties: + pcfSmFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfSmIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_SMPolicyControl service. + + MbsBindingResp: + description: Contains the binding information for a PCF for an MBS Session. + type: object + properties: + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF handling the MBS Session. + + BsfSubscription: + description: Contains the event subscription data. + type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/BsfEvent' + minItems: 1 + description: Contain te subscribed events. + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorreId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + snssaiDnnPairs: + $ref: '#/components/schemas/SnssaiDnnPair' + addSnssaiDnnPairs: + type: array + items: + $ref: '#/components/schemas/SnssaiDnnPair' + minItems: 1 + description: > + Represents the additional S-NSSAI and DNN pair(s) for which the binding event report(s) + shall apply. + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - events + - notifUri + - notifCorreId + - supi + + BsfNotification: + description: Contains the event notifications. + type: object + properties: + notifCorreId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + eventNotifs: + type: array + items: + $ref: '#/components/schemas/BsfEventNotification' + minItems: 1 + description: Notifications about Individual Events. + required: + - notifCorreId + - eventNotifs + + BsfEventNotification: + description: Contains an event notification. + type: object + properties: + event: + $ref: '#/components/schemas/BsfEvent' + pcfForUeInfo: + $ref: '#/components/schemas/PcfForUeInfo' + pcfForPduSessInfos: + type: array + items: + $ref: '#/components/schemas/PcfForPduSessionInfo' + minItems: 1 + description: The information of the PCF for a PDU session. + matchSnssaiDnns: + type: array + items: + $ref: '#/components/schemas/SnssaiDnnPair' + minItems: 1 + description: Matching S-NSSAI and DNN pairs. + required: + - event + + PcfForUeInfo: + description: Contains the information of the PCF for a UE. + type: object + properties: + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_AmPolicyAuthorization service. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + + PcfForPduSessionInfo: + description: Contains the informaiton of the PCF for a PDU session. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_AmPolicyAuthorization service. + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrRm' + ipDomain: + type: string + ipv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: The IPv6 Address Prefixes of the served UE. + macAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + description: The MAC Addresses of the served UE. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + required: + - snssai + - dnn + + PcfForUeBinding: + description: Identifies an Individual PCF for a UE binding. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pcfForUeFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfForUeIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_AmPolicyAuthorization service. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supi + anyOf: + - required: [pcfForUeFqdn] + - required: [pcfForUeIpEndPoints] + + + PcfForUeBindingPatch: + description: Identifies the updates of an Individual PCF for a UE binding. + type: object + properties: + pcfForUeFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfForUeIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_AmPolicyAuthorization service. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + SnssaiDnnPair: + description: Contains a S-NSSAI and DNN combination. + type: object + required: + - snssai + - dnn + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + PcfMbsBinding: + description: Represents an Individual PCF for an MBS Session binding. + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - mbsSessionId + + PcfMbsBindingPatch: + description: > + Represents the requested modification to an Individual PCF for an MBS Session binding. + type: object + properties: + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + BindingLevel: +# anyOf: +# - type: string + enum: + - NF_SET + - NF_INSTANCE +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are: +# - "NF_SET" +# - "NF_INSTANCE" + + BsfEvent: +# description: Represents an event to be notified by the BSF. +# anyOf: +# - type: string + enum: + - PCF_PDU_SESSION_BINDING_REGISTRATION + - PCF_PDU_SESSION_BINDING_DEREGISTRATION + - PCF_UE_BINDING_REGISTRATION + - PCF_UE_BINDING_DEREGISTRATION + - SNSSAI_DNN_BINDING_REGISTRATION + - SNSSAI_DNN_BINDING_DEREGISTRATION +# - type: string + + BsfSubscriptionResp: + description: > + It represents a response to a modification or creation request of an Individual Binding + Subscription resource. It may contain the notification of the already met events. + anyOf: + - $ref: '#/components/schemas/BsfSubscription' + - $ref: '#/components/schemas/BsfNotification' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_5GLANParameterProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_5GLANParameterProvision.yaml new file mode 100644 index 000000000..465b1262c --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_5GLANParameterProvision.yaml @@ -0,0 +1,483 @@ +openapi: 3.0.0 +info: + title: 3gpp-5glan-pp + version: 1.1.1 + description: | + API for 5G LAN Parameter Provision. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-5glan-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/subscriptions: + get: + summary: read all of the active subscriptions for the AF + operationId: RealAllSubscriptions + tags: + - 5GLAN Parameters Provision Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/5GLanParametersProvision' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateAnSubscription + tags: + - 5GLAN Parameters Provision Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new subscription creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual 5GLAN Parameters Provision Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual 5GLAN Parameters Provision Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + responses: + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates an existing subscription resource + operationId: PartialUpdateAnSubscription + tags: + - Individual 5GLAN Parameters Provision Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/5GLanParametersProvisionPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual 5GLAN Parameters Provision Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + 5GLanParametersProvision: + description: Represents an individual 5G LAN parameters provision subscription resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + 5gLanParams: + $ref: '#/components/schemas/5GLanParameters' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - 5gLanParams + - suppFeat + 5GLanParametersProvisionPatch: + description: > + Represents the 5G LAN parameters to request the modification of a subscription + to provision parameters. + type: object + properties: + 5gLanParamsPatch: + $ref: '#/components/schemas/5GLanParametersPatch' + 5GLanParameters: + description: Represents 5G LAN service related parameters that need to be provisioned. + type: object + properties: + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsis: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minProperties: 1 + description: > + Contains the list of 5G VN Group members, each member is identified by GPSI. + Any string value can be used as a key of the map. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + aaaIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + aaaIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + aaaUsgs: + type: array + items: + $ref: '#/components/schemas/AaaUsage' + minItems: 1 + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + sessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + description: Further allowed PDU Session types. + appDesps: + type: object + additionalProperties: + $ref: '#/components/schemas/AppDescriptor' + minProperties: 1 + description: Describes the operation systems and the corresponding applications for each operation systems. The key of map is osId. + required: + - exterGroupId + - gpsis + - dnn + - snssai + - sessionType + - appDesps + 5GLanParametersPatch: + description: Represents 5G LAN service related parameters that need to be modified. + type: object + properties: + gpsis: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GpsiRm' + minProperties: 1 + description: > + Contains the list of 5G VN Group members, each member is identified by GPSI. + Any string value can be used as a key of the map. + appDesps: + type: object + additionalProperties: + $ref: '#/components/schemas/AppDescriptorRm' + minProperties: 1 + description: > + Describes the operation systems and the corresponding applications for + each operation systems. The key of map is osId. + AppDescriptor: + description: Represents an operation system and the corresponding applications. + type: object + properties: + osId: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/OsId' + appIds: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minProperties: 1 + description: > + Identifies applications that are running on the UE's operating system. + Any string value can be used as a key of the map. + required: + - osId + - appIds + AppDescriptorRm: + description: > + Represents the same as the AppDescriptor data type but with the nullable:true + property. + type: object + properties: + appIds: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationIdRm' + minProperties: 1 + description: > + Identifies applications that are running on the UE's operating system. + Any string value can be used as a key of the map. + AaaUsage: + anyOf: + - type: string + enum: + - AUTH + - IP_ALLOC + - type: string + description: > + This string identifies the usage of secondary authentication/authorization, + and/or UE IP address allocation from the DN-AAA server. + description: | + Possible values are: + - AUTH: secondary authentication/authorization needed from DN-AAA server + - IP_ALLOC: UE IP address allocation needed from DN-AAA server diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ACSParameterProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ACSParameterProvision.yaml new file mode 100644 index 000000000..ee0be4800 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ACSParameterProvision.yaml @@ -0,0 +1,379 @@ +openapi: 3.0.0 +info: + title: 3gpp-acs-pp + version: 1.1.2 + description: | + API for 5G ACS Parameter Provision. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-acs-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/subscriptions: + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - ACS Configuration Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AcsConfigurationData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateAnSubscription + tags: + - ACS Configuration Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new subscription creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual ACS Configuration Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual ACS Configuration Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + responses: + '200': + description: OK (Successful update of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial modifies an existing subscription resource. + operationId: PartialUpdateAnSubscription + tags: + - Individual ACS Configuration Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to modify the existing subscription. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AcsConfigurationDataPatch' + responses: + '200': + description: > + OK. The subscription resource was successfully modified and a representation of the + updated resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + '204': + description: > + No Content. The resource has been successfully modified and no additional content is to + be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual ACS Configuration Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AcsConfigurationData: + description: Represents an individual ACS Configuration subscription resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfo' + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - acsInfo + - suppFeat + AcsConfigurationDataPatch: + description: > + Represents the parameters to request to modify an existing Individual ACS Configuration + subscription resource. + type: object + properties: + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfo' + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AKMA.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AKMA.yaml new file mode 100644 index 000000000..28b51665e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AKMA.yaml @@ -0,0 +1,120 @@ +openapi: 3.0.0 +info: + title: 3gpp-akma + version: 1.0.1 + description: | + API for AKMA. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-akma/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /retrieve: + post: + summary: Retrieve AKMA Application Key Information. + operationId: RetrieveAKMAAppKey + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AkmaAfKeyRequest' + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AkmaAfKeyData' + '204': + description: No Content. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AkmaAfKeyRequest: + description: > + Represents the parameters to request the retrieval of AKMA Application Key information. + type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + afId: + $ref: '#/components/schemas/AfId' + aKId: + $ref: '#/components/schemas/AKId' + anonInd: + type: boolean + description: > + Indicates whether an anonymous user access. Set to "true" if an anonymous user access is + requested; otherwise set to "false". Default value is "false" if omitted. + default: false + required: + - afId + - aKId + AkmaAfKeyData: + description: Represents AKMA Application Key information data. + type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + expiry: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + kaf: + type: string + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + required: + - kaf + - expiry + AfId: + description: Represents an AF identifier. + type: string + AKId: + description: Represents an AKMA Key Identifier. + type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AMInfluence.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AMInfluence.yaml new file mode 100644 index 000000000..7499dfbf4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AMInfluence.yaml @@ -0,0 +1,473 @@ +openapi: 3.0.0 +info: + title: AMInfluence + version: 1.0.1 + description: | + AMInfluence API Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/ +servers: + - url: '{apiRoot}/3gpp-am-influence/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: [] +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: Read all of the active subscriptions for the AF. + tags: + - AM Influence Subscription + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF). + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmInfluSub' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create a new subscription to AM influence. + operationId: CreateAMInfluenceSubcription + tags: + - AM Influence Subscription + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + responses: + '201': + description: Create a new Individual AM Influence Subscription resource. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-am-influence/v1/{afId}/subscriptions/{subscriptionId}. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + notificationDestination: + '{$request.body#/notificationDestination}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmInfluEventNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was succesfull + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource. + required: true + schema: + type: string + get: + summary: Read an active subscription identified by the subscriptionId. + tags: + - Individual AM Influence Subscription + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update/Replace an existing subscription resource. + tags: + - Individual AM Influence Subscription + requestBody: + description: Parameters to update/replace the existing subscription. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Update/Replace an existing subscription resource. + tags: + - Individual AM Influence Subscription + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AmInfluSubPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an existing subscription. + tags: + - Individual AM Influence Subscription + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: {} + schemas: + AmInfluSub: + description: Represents an AM influence subscription. + type: object + properties: + afTransId: + type: string + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + anyUeInd: + type: boolean + description: > + Identifies whether the AF request applies to any UE. This attribute shall + set to "true" if applicable for any UE, otherwise, set to "false". + dnnSnssaiInfos: + type: array + items: + $ref: '#/components/schemas/DnnSnssaiInformation' + minItems: 1 + description: Each of the element identifies a (DNN, S-NSSAI) combination. + afAppIds: + type: array + items: + type: string + minItems: 1 + description: Each of the element identifies an application. + highThruInd: + type: boolean + geoAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: Identifies geographic areas of the user where the request is applicable. + policyDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/AmInfluEvent' + minItems: 1 + description: Indicates one or more AM influence related events. + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: > + Set to true by the AF to request the NEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afTransId + anyOf: + - required: [highThruInd] + - required: [geoAreas] + oneOf: + - required: [gpsi] + - required: [externalGroupId] + - required: [anyUeInd] + AmInfluSubPatch: + description: > + Represents parameters to request the modification of an AM influence subscription resource. + type: object + properties: + highThruInd: + type: boolean + nullable: true + geoAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies geographic areas of the user where the request is applicable. + nullable: true + policyDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + dnnSnssaiInfos: + type: array + items: + $ref: '#/components/schemas/DnnSnssaiInformation' + minItems: 1 + nullable: true + description: Each of the element identifies a (DNN, S-NSSAI) combination. + afAppIds: + type: array + items: + type: string + minItems: 1 + nullable: true + description: Each of the element identifies an application. + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/AmInfluEvent' + minItems: 1 + nullable: true + description: Indicates one or more AM influence related events. + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LinkRm' + AmInfluEventNotif: + description: Represents an AM influence event notification. + type: object + properties: + afTransId: + type: string + event: + $ref: '#/components/schemas/AmInfluEvent' + geoAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: Identifies geographic areas of the user where the request is applicable. + required: + - event + - afTransId + DnnSnssaiInformation: + description: Represents a (DNN, SNSSAI) combination. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + +# ENUMERATIONS DATA TYPES +# + AmInfluEvent: + description: Represents the service area coverage outcome event. + anyOf: + - type: string + enum: + - SERVICE_AREA_COVRG_OUTCOME + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AMPolicyAuthorization.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AMPolicyAuthorization.yaml new file mode 100644 index 000000000..6739a93d4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AMPolicyAuthorization.yaml @@ -0,0 +1,526 @@ +openapi: 3.0.0 +info: + title: 3gpp-am-policyauthorization + version: 1.0.2 + description: | + API for AM policy authorization. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-am-policyauthorization/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/app-am-contexts: + post: + summary: Creates a new Individual application AM Context resource + operationId: PostAppAmContexts + tags: + - Application AM Contexts + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new resource creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextExpData' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextExpRespData' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + amEventNotification: + '{$request.body#/evSubscs/eventNotifUri}': + post: + requestBody: + description: Notification of an event occurrence. + required: true + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/app-am-contexts/{appAmContextId}: + get: + summary: read an existing Individual application AM context + operationId: GetAppAmContext + tags: + - Individual Application AM Context + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: Identifier of the Individual application AM context + required: true + schema: + type: string + responses: + '200': + description: OK (A representation of the resource is successfully returned) + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextExpData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: partial modifies an existing Individual application AM context + operationId: ModAppAmContext + tags: + - Individual Application AM Context + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: Identifier of the application AM context resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppAmContextExpUpdateData' + responses: + '200': + description: > + successful modification of the resource and a representation of that + resource is returned. If a subscribed event is matched, the event + notification is also included in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextExpRespData' + '204': + description: The successful modification + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing Individual Application AM Context + operationId: DeleteAppAmContext + tags: + - Individual Application AM Context + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: string identifying the Individual aaplication AM context resource + required: true + schema: + type: string + responses: + '204': + description: The deletion is confirmed without returning additional data. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/app-am-contexts/{appAmContextId}/events-subscription: + put: + summary: creates or modifies an AM Policy Events Subscription sub-resource. + operationId: UpdateAmEventsSubsc + tags: + - AM Policy Events Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: string identifying the AM Policy Events Subscription subresource + required: true + schema: + type: string + requestBody: + description: > + Creation or modification of an application AM Policy Events Subscription sub-resource. + required: true + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscData' + responses: + '201': + description: > + The creation of the application AM Policy Events Subscription sub-resource + is confirmed and its representation is returned. If an AM Event is matched, + the response also includes the notification. + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscRespData' + headers: + Location: + description: > + Contains the URI of the created AM Policy Events Subscription + subresource, according to the structure + {apiRoot}/3gpp-am-policyauthorization/v1/{afId}/app-am- + contexts/{appAmContextId}/events-subscription} + required: true + schema: + type: string + '200': + description: > + The modification of the AM Policy Events Subscription subresource is confirmed + and its representation is returned. If an AM Event is matched, the response also + includes the notification. + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscRespData' + '204': + description: > + The modification of the AM Policy Events Subscription subresource is confirmed + without returning additional data. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + amEventNotification: + '{$request.body#/evSubscs/eventNotifUri}': + post: + requestBody: + description: Contains the information for the notification of an event occurrence. + required: true + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: deletes the AM Policy Events Subscription sub-resource + operationId: DeleteAmEventsSubsc + tags: + - AM Policy Events Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: string identifying the Individual Application AM Context resource. + required: true + schema: + type: string + responses: + '204': + description: > + The deletion of the of the AM Policy Events Subscription subresource + is confirmed without returning additional data. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AppAmContextExpData: + description: Represents an Individual application AM context exposure resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + evSubscs: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscData' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + highThruInd: + type: boolean + covReqs: + type: array + items: + $ref: '#/components/schemas/GeographicalArea' + minItems: 1 + nullable: true + policyDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestTestNotification: + type: boolean + description: > + Set to true by the AF to request the NEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + required: + - gpsi + anyOf: + - required: [highThruInd] + - required: [covReqs] + + AppAmContextExpUpdateData: + description: > + Contains the modification(s) to be applied to the Individual application + AM context exposure resource. + type: object + properties: + evSubscs: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscDataRm' + highThruInd: + type: boolean + covReqs: + type: array + items: + $ref: '#/components/schemas/GeographicalArea' + minItems: 1 + policyDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + + GeographicalArea: + description: Contains geographical area information (e.g.a civic address or shapes). + type: object + properties: + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + shapes: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + + AppAmContextExpRespData: + description: > + It represents a response to a modification or creation request of an Individual + Application AM resource. It may contain the notification of the already met events + anyOf: + - $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AppAmContextData' + - $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsNotification' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ASTI.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ASTI.yaml new file mode 100644 index 000000000..1460eebee --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ASTI.yaml @@ -0,0 +1,406 @@ +openapi: 3.0.0 + +info: + title: 3gpp-asti + version: 1.0.1 + description: | + API for ASTI. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-asti/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/configurations: + get: + summary: read all of the active configurations of 5G access stratum time distribution for the AF + operationId: ReadAllConfigurations + tags: + - ASTI Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active configurations for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AccessTimeDistributionData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + operationId: CreateNewConfiguration + tags: + - ASTI Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/retrieve: + post: + summary: Request the status of the 5G access stratum time distribution configuration for a list of UEs. + operationId: RetrieveStatusofConfiguration + tags: + - ASTI Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: Contains the list of GPSIs. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StatusRequestData' + responses: + '200': + description: Successful retrieval of the status of the 5G access stratum time distribution + content: + application/json: + schema: + $ref: '#/components/schemas/StatusResponseData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/{configId}: + get: + summary: Reads an active configuration for the AF and the configuration Id + operationId: ReadAnConfiguration + tags: + - Individual ASTI Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Modifies an active configuration for the AF and the configuration Id + operationId: FullyModifyAnConfiguration + tags: + - Individual ASTI Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + responses: + '200': + description: OK (Successful update of the configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration + operationId: DeleteAnConfiguration + tags: + - Individual ASTI Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + + schemas: + + AccessTimeDistributionData: + description: > + Contains the parameters for the creation of 5G access stratum time distribution configuration. + type: object + properties: + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + asTimeDisParam: + $ref: 'TS29565_Ntsctsf_ASTI.yaml#/components/schemas/AsTimeDistributionParam' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - asTimeDisParam + oneOf: + - required: [gpsis] + - required: [interGrpId] + + StatusRequestData: + description: > + Contains the parameters for retrieval of the status of the access stratum time distribution + for a list of UEs. + type: object + properties: + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + required: + - gpsis + + StatusResponseData: + description: > + Contains the parameters for the status of the access stratum time distribution for a list of + UEs. + type: object + properties: + inactiveUes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + activeUes: + type: array + items: + $ref: '#/components/schemas/ActiveUe' + minItems: 1 + + ActiveUe: + description: > + Contains the UE identifier whose status of the access stratum time distribution is active and + the optional requested time synchronization error budget. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + timeSyncErrBdgt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AnalyticsExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AnalyticsExposure.yaml new file mode 100644 index 000000000..b440a442e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_AnalyticsExposure.yaml @@ -0,0 +1,998 @@ +openapi: 3.0.0 +info: + title: 3gpp-analyticsexposure + version: 1.1.2 + description: | + API for Analytics Exposure. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-analyticsexposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/subscriptions: + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Analytics Exposure Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: supp-feat + in: query + description: Features supported by the NF service consumer + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateNewSubscription + tags: + - Analytics Exposure Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new subscription creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + callbacks: + notification: + '{request.body#/notifUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsEventNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '204': + description: > + Successful case. The resource has been successfully created and no additional + content is to be sent in the response message. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Analytics Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + - name: supp-feat + in: query + description: Features supported by the NF service consumer + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual Analytics Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + responses: + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Analytics Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/fetch: + post: + summary: Fetch analytics information + operationId: FetchAnalyticsInfo + tags: + - AnalyticsExposure API Fetch analytics information + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsRequest' + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsData' + '204': + description: No Content (The requested Analytics data does not exist) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: > + The request is rejected by the NEF and more details (not only the ProblemDetails) + are returned. + content: + application/problem+json: + schema: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/ProblemDetailsAnalyticsInfoRequest' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AnalyticsExposureSubsc: + description: Represents an analytics exposure subscription. + type: object + properties: + analyEventsSubs: + type: array + items: + $ref: '#/components/schemas/AnalyticsEventSubsc' + minItems: 1 + analyRepInfo: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + eventNotifis: + type: array + items: + $ref: '#/components/schemas/AnalyticsEventNotif' + minItems: 1 + failEventReports: + type: array + items: + $ref: '#/components/schemas/AnalyticsFailureEventInfo' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: > + Set to true by the AF to request the NEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + required: + - analyEventsSubs + - notifUri + - notifId + AnalyticsEventNotification: + description: Represents an analytics event(s) notification. + type: object + properties: + notifId: + type: string + analyEventNotifs: + type: array + items: + $ref: '#/components/schemas/AnalyticsEventNotif' + minItems: 1 + required: + - notifId + - analyEventNotifs + AnalyticsEventNotif: + description: Represents an analytics event to be reported. + type: object + properties: + analyEvent: + $ref: '#/components/schemas/AnalyticsEvent' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStamp: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + failNotifyCode: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafFailureCode' + rvWaitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + ueMobilityInfos: + type: array + items: + $ref: '#/components/schemas/UeMobilityExposure' + minItems: 1 + ueCommInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UeCommunication' + minItems: 1 + abnormalInfos: + type: array + items: + $ref: '#/components/schemas/AbnormalExposure' + minItems: 1 + congestInfos: + type: array + items: + $ref: '#/components/schemas/CongestInfo' + minItems: 1 + nwPerfInfos: + type: array + items: + $ref: '#/components/schemas/NetworkPerfExposure' + minItems: 1 + qosSustainInfos: + type: array + items: + $ref: '#/components/schemas/QosSustainabilityExposure' + minItems: 1 + disperInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionInfo' + minItems: 1 + dnPerfInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerfInfo' + minItems: 1 + svcExps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ServiceExperienceInfo' + minItems: 1 + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStampGen: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - analyEvent + - timeStamp + AnalyticsEventSubsc: + description: Represents a subscribed analytics event. + type: object + properties: + analyEvent: + $ref: '#/components/schemas/AnalyticsEvent' + analyEventFilter: + $ref: '#/components/schemas/AnalyticsEventFilterSubsc' + tgtUe: + $ref: '#/components/schemas/TargetUeId' + required: + - analyEvent + AnalyticsEventFilterSubsc: + description: Represents an analytics event filter. + type: object + properties: + nwPerfReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfRequirement' + minItems: 1 + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + excepRequs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/Exception' + minItems: 1 + exptAnaType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExpectedAnalyticsType' + exptUeBehav: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExpectedUeBehaviourData' + matchingDir: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/MatchingDirection' + reptThlds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ThresholdLevel' + minItems: 1 + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiIdInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiIdInfo' + minItems: 1 + qosReq: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/QosRequirement' + qosFlowRetThds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RetainabilityThreshold' + minItems: 1 + ranUeThrouThds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + minItems: 1 + disperReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionRequirement' + minItems: 1 + listOfAnaSubsets: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsSubset' + minItems: 1 + dnPerfReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerformanceReq' + minItems: 1 + bwRequs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/BwRequirement' + minItems: 1 + ratFreqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RatFreqInformation' + minItems: 1 + appServerAddrs: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + minItems: 1 + extraReportReq: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventReportingRequirement' + maxNumOfTopAppUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxNumOfTopAppDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + visitedLocAreas: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + minItems: 1 + TargetUeId: + description: Represents the target UE(s) information. + type: object + properties: + anyUeInd: + type: boolean + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + UeMobilityExposure: + description: Represents a UE mobility information. + type: object + properties: + ts: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + recurringTime: + $ref: 'TS29122_CpProvisioning.yaml#/components/schemas/ScheduledCommunicationTime' + duration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + durationVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + locInfo: + type: array + items: + $ref: '#/components/schemas/UeLocationInfo' + minItems: 1 + required: + - duration + - locInfo + UeLocationInfo: + description: Represents a UE location information. + type: object + properties: + loc: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - loc + AnalyticsRequest: + description: Represents the parameters to request to retrieve analytics information. + type: object + properties: + analyEvent: + $ref: '#/components/schemas/AnalyticsEvent' + analyEventFilter: + $ref: '#/components/schemas/AnalyticsEventFilter' + analyRep: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventReportingRequirement' + tgtUe: + $ref: '#/components/schemas/TargetUeId' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - analyEvent + - suppFeat + AnalyticsEventFilter: + description: Represents analytics event filter information. + type: object + properties: + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + nwPerfTypes: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfType' + minItems: 1 + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + excepIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExceptionId' + minItems: 1 + exptAnaType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExpectedAnalyticsType' + exptUeBehav: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExpectedUeBehaviourData' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiIdInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiIdInfo' + minItems: 1 + qosReq: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/QosRequirement' + listOfAnaSubsets: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsSubset' + minItems: 1 + dnPerfReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerformanceReq' + minItems: 1 + bwRequs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/BwRequirement' + minItems: 1 + ratFreqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RatFreqInformation' + minItems: 1 + appServerAddrs: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + minItems: 1 + maxNumOfTopAppUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxNumOfTopAppDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + visitedLocAreas: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + minItems: 1 + AnalyticsData: + description: Represents analytics data. + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStampGen: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueMobilityInfos: + type: array + items: + $ref: '#/components/schemas/UeMobilityExposure' + minItems: 1 + ueCommInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UeCommunication' + minItems: 1 + nwPerfInfos: + type: array + items: + $ref: '#/components/schemas/NetworkPerfExposure' + minItems: 1 + abnormalInfos: + type: array + items: + $ref: '#/components/schemas/AbnormalExposure' + minItems: 1 + congestInfos: + type: array + items: + $ref: '#/components/schemas/CongestInfo' + minItems: 1 + qosSustainInfos: + type: array + items: + $ref: '#/components/schemas/QosSustainabilityExposure' + minItems: 1 + disperInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionInfo' + minItems: 1 + dnPerfInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerfInfo' + minItems: 1 + svcExps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ServiceExperienceInfo' + minItems: 1 + disperReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionRequirement' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - suppFeat + NetworkPerfExposure: + description: Represents network performance information. + type: object + properties: + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + nwPerfType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfType' + relativeRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + absoluteNum: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - locArea + - nwPerfType + AbnormalExposure: + description: Represents a user's abnormal behavior information. + type: object + properties: + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + excep: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/Exception' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + addtMeasInfo: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AdditionalMeasurement' + required: + - excep + CongestInfo: + description: Represents a UE's user data congestion information. + type: object + properties: + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + cngAnas: + type: array + items: + $ref: '#/components/schemas/CongestionAnalytics' + minItems: 1 + required: + - locArea + - cngAnas + CongestionAnalytics: + description: > + Represents data congestion analytics for transfer over the user plane, + control plane or both. + type: object + properties: + cngType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/CongestionType' + tmWdw: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + nsi: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ThresholdLevel' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + topAppListUl: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/TopApplication' + minItems: 1 + topAppListDl: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/TopApplication' + minItems: 1 + required: + - cngType + - tmWdw + - nsi + QosSustainabilityExposure: + description: Represents a QoS sustainability information. + type: object + properties: + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + startTs: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + endTs: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + qosFlowRetThd: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RetainabilityThreshold' + ranUeThrouThd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - locArea + - startTs + - endTs + AnalyticsFailureEventInfo: + description: > + Represents an event for which the subscription request was not successful + and including the associated failure reason. + type: object + properties: + event: + $ref: '#/components/schemas/AnalyticsEvent' + failureCode: + $ref: '#/components/schemas/AnalyticsFailureCode' + required: + - event + - failureCode + AnalyticsEvent: + anyOf: + - type: string + enum: + - UE_MOBILITY + - UE_COMM + - ABNORMAL_BEHAVIOR + - CONGESTION + - NETWORK_PERFORMANCE + - QOS_SUSTAINABILITY + - DISPERSION + - DN_PERFORMANCE + - SERVICE_EXPERIENCE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UE_MOBILITY: The AF requests to be notified about analytics information of UE mobility. + - UE_COMM: The AF requests to be notified about analytics information of UE communication. + - ABNORMAL_BEHAVIOR: The AF requests to be notified about analytics information of UE's abnormal behavior. + - CONGESTION: The AF requests to be notified about analytics information of user data congestion information. + - NETWORK_PERFORMANCE: The AF requests to be notified about analytics information of network performance. + - QOS_SUSTAINABILITY: The AF requests to be notified about analytics information of QoS sustainability. + - DISPERSION: The AF requests to be notified about analytics information of Dispersion analytics. + - DN_PERFORMANCE: The AF requests to be notified about analytics information of DN performance. + - SERVICE_EXPERIENCE: The AF requests to be notified about analytics information of service experience. + AnalyticsFailureCode: + anyOf: + - type: string + enum: + - UNAVAILABLE_DATA + - BOTH_STAT_PRED_NOT_ALLOWED + - UNSATISFIED_REQUESTED_ANALYTICS_TIME + - OTHER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNAVAILABLE_DATA: The event is rejected since necessary data to perform the service is unavailable. + - BOTH_STAT_PRED_NOT_ALLOWED: The event is rejected since the start time is in the past and the end time is in the future, which means the NF service consumer requested both statistics and prediction for the analytics. + - UNSATISFIED_REQUESTED_ANALYTICS_TIME: Indicates that the requested event is rejected since the analytics information is not ready when the time indicated by the timeAnaNeeded attribute (as provided during the creation or modification of subscription) is reached. + - OTHER: The event is rejected due to other reasons. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ApplyingBdtPolicy.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ApplyingBdtPolicy.yaml new file mode 100644 index 000000000..da1577185 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ApplyingBdtPolicy.yaml @@ -0,0 +1,281 @@ +openapi: 3.0.0 +info: + title: 3gpp-applying-bdt-policy + version: 1.1.1 + description: | + API for applying BDT policy + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-applying-bdt-policy/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Applied BDT Policy Subscription + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AppliedBdtPolicy' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateNewSubscription + tags: + - Applied BDT Policy Subscription + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicy' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicy' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + get: + summary: read an active subscriptions for the SCS/AS and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Applied BDT Policy Subscription + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicy' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates/replaces an existing subscription resource + operationId: PartialUpdateAnSubscription + tags: + - Individual Applied BDT Policy Subscription + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicyPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicy' + '204': + description: No content. The subscription was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Applied BDT Policy Subscription + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AppliedBdtPolicy: + description: Represents an applied BDT policy. + type: object + properties: + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + required: + - bdtRefId + - suppFeat + oneOf: + - required: [gpsi] + - required: [externalGroupId] + AppliedBdtPolicyPatch: + description: > + Represents the parameters to request the modification of a subscription to + applied BDT policy. + type: object + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + required: + - bdtRefId + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_DataReporting.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_DataReporting.yaml new file mode 100644 index 000000000..55f33610e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_DataReporting.yaml @@ -0,0 +1,270 @@ +openapi: 3.0.0 +info: + title: 3gpp-data-reporting + version: 1.0.0 + description: | + API for 3GPP Data Reporting. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.6.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-data-reporting/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /sessions: + post: + summary: Create a new Data Reporting Session. + operationId: CreateDataRepSession + tags: + - Data Reporting Sessions + requestBody: + description: > + Representation of the Data Reporting Session to be created in the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + responses: + '201': + description: Created. Successful creation of a new Data Reporting Session. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + headers: + Location: + required: true + schema: + type: string + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-data-reporting/v1/sessions/{sessionId} + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Session. + required: true + schema: + type: string + get: + summary: Request the retrieval of an existing Individual Data Reporting Session resource. + operationId: GetIndDataRepSession + tags: + - Individual Data Reporting Session + responses: + '200': + description: > + OK. The requested Individual Data Reporting Session resource is + Successfully returned. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual Data Reporting Session resource. + operationId: UpdateIndDataRepSession + tags: + - Individual Data Reporting Session + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + responses: + '200': + description: > + OK. The Individual Data Reporting Session resource was successfully + updated. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + '204': + description: > + No Content. The Individual Data Reporting Session resource was successfully + updated and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing Data Reporting Session resource. + operationId: DeleteIndDataRepSession + tags: + - Individual Data Reporting Session + responses: + '204': + description: > + No Content. The concerned Individual Data Reporting Session resource was + successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}/report: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Session. + required: true + schema: + type: string + post: + summary: Report collected UE data. + operationId: ReportUEData + tags: + - Individual Data Reporting Session + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReport' + responses: + '200': + description: OK. The UE data report was successfully received. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_DataReportingProvisioning.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_DataReportingProvisioning.yaml new file mode 100644 index 000000000..71ec587a5 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_DataReportingProvisioning.yaml @@ -0,0 +1,411 @@ +openapi: 3.0.0 +info: + title: 3gpp-data-reporting-provisioning + version: 1.0.1 + description: | + API for 3GPP Data Reporting and Provisioning. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-data-reporting-provisioning/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /sessions: + post: + summary: Create a new Data Reporting Provisioning Session. + operationId: CreateDataRepProvSession + tags: + - Data Reporting Provisioning Sessions + requestBody: + description: > + Representation of the Data Reporting Provisioning Session to be created in the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingProvisioningSession' + responses: + '201': + description: Created. Successful creation of a new Data Reporting Provisioning Session. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingProvisioningSession' + headers: + Location: + required: true + schema: + type: string + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-data-reporting-provisioning/v1/sessions/{sessionId} + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Provisioning Session. + required: true + schema: + type: string + get: + summary: Request the retrieval of an existing Individual Data Reporting Provisioning Session resource. + operationId: GetIndDataRepProvSession + tags: + - Individual Data Reporting Provisioning Session + responses: + '200': + description: > + OK. The requested Individual Data Reporting Provisioning Session resource is + Successfully returned. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingProvisioningSession' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing Individual Data Reporting Provisioning Session resource. + operationId: DeleteIndDataRepProvSession + tags: + - Individual Data Reporting Provisioning Session + responses: + '204': + description: > + No Content. The concerned Individual Data Reporting Provisioning Session resource was + successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}/configurations: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Provisioning Session. + required: true + schema: + type: string + post: + summary: Create a new Data Reporting Configuration resource. + operationId: CreateDataRepConfig + tags: + - Data Reporting Configurations + requestBody: + description: > + Representation of the Data Reporting Configuration to be created in the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + responses: + '201': + description: Created. Successful creation of a new Data Reporting Configuration. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + headers: + Location: + required: true + schema: + type: string + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-data-reporting-provisioning/v1/sessions/{sessionId}/configurations/{configurationId} + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}/configurations/{configurationId}: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Provisioning Session. + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the Data Reporting Configuration. + required: true + schema: + type: string + get: + summary: Request the retrieval of an existing Individual Data Reporting Configuration resource. + operationId: GetIndDataRepConfig + tags: + - Individual Data Reporting Configuration + responses: + '200': + description: > + OK. The requested Individual Data Reporting Configuration resource is successfully + returned. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request to update an existing Individual Data Reporting Configuration resource. + operationId: UpdateIndDataRepConfig + tags: + - Individual Data Reporting Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + responses: + '200': + description: > + OK. The Individual Data Reporting Configuration resource was successfully updated. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + '204': + description: > + No Content. The Individual Data Reporting Configuration resource was successfully + updated and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request to modify an existing Individual Data Reporting Configuration resource. + operationId: ModifyIndDataRepConfig + tags: + - Individual Data Reporting Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfigurationPatch' + responses: + '200': + description: > + OK. The Individual Data Reporting Configuration resource was successfully modified. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + '204': + description: > + No Content. The Individual Data Reporting Configuration resource was successfully + modified and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing Data Reporting Configuration resource. + operationId: DeleteIndDataRepConfig + tags: + - Individual Data Reporting Configuration + responses: + '204': + description: > + No Content. The concerned Individual Data Reporting Configuration resource was + successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_EASDeployment.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_EASDeployment.yaml new file mode 100644 index 000000000..e586a0390 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_EASDeployment.yaml @@ -0,0 +1,402 @@ +openapi: 3.0.0 +info: + title: 3gpp-eas-deployment + version: 1.0.2 + description: | + API for AF provisioned EAS Deployment. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-eas-deployment/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/eas-deployment-info: + get: + summary: Read all EAS Deployment information for a given AF + operationId: ReadAllDeployment + tags: + - EAS Deployment Information (Collection) + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the EAS Deployment information for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EasDeployInfo' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Create a new Individual EAS Deployment information resource. + operationId: CreateAnDeployment + tags: + - EAS Deployment Information (Collection) + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new resource creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/eas-deployment-info/{easDeployInfoId}: + get: + summary: Read an active Individual EAS Deployment Information resource for the AF + operationId: ReadAnDeployment + tags: + - Individual EAS Deployment Information + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: easDeployInfoId + in: path + description: Identifier of an EAS Deployment Information. + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active resource) + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing resource + operationId: FullyUpdateAnDeployment + tags: + - Individual EAS Deployment Information + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: easDeployInfoId + in: path + description: Identifier of the EAS Deployment information resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + responses: + '200': + description: OK (Successful update of the existing resource) + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + '204': + description: > + Successful case. The resource has been successfully updated and no additional content is + sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing EAS Deployment information resource + operationId: DeleteAnDeployment + tags: + - Individual EAS Deployment Information + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: easDeployInfoId + in: path + description: Identifier of the EAS Deployment information resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing resource) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /remove-edis: + post: + summary: Remove EAS Deployment Information based on given criteria. + operationId: DeleteEDIs + tags: + - EAS Deployment Information removal + requestBody: + description: Criteria to be used for deleting EAS Deployment Information that match them. + content: + application/json: + schema: + $ref: '#/components/schemas/EdiDeleteCriteria' + required: true + responses: + '204': + description: > + No Content. The EDIs matching the provided criteria have been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + EasDeployInfo: + description: Represents EAS Deployment Information. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + afServiceId: + type: string + fqdnPatternList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FqdnPatternMatchingRule' + minItems: 1 + appId: + type: string + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + dnaiInfos: + type: object + additionalProperties: + $ref: '#/components/schemas/DnaiInformation' + minProperties: 1 + description: > + list of DNS server identifier (consisting of IP address and port) and/or IP address(s) + of the EAS in the local DN for each DNAI. The key of map is the DNAI. + required: + - fqdnPatternList + DnaiInformation: + description: Represents DNAI information. + type: object + properties: + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + dnsServIds: + type: array + items: + $ref: '#/components/schemas/DnsServerIdentifier' + minItems: 1 + easIpAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + required: + - dnai + anyOf: + - required: [dnsServIds] + - required: [easIpAddrs] + DnsServerIdentifier: + description: Represents DNS server identifier (consisting of IP address and port). + type: object + properties: + dnsServIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + portNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - dnsServIpAddr + - portNumber + + EdiDeleteCriteria: + description: > + Contains criteria to be used for deleting EAS Deployment Information entries that match + them. + type: object + properties: + afId: + $ref: 'TS29522_AKMA.yaml#/components/schemas/AfId' + dnnSnssai: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + anyOf: + - required: [afId] + - required: [dnnSnssai] diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_EcsAddressProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_EcsAddressProvision.yaml new file mode 100644 index 000000000..dd3ba106b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_EcsAddressProvision.yaml @@ -0,0 +1,303 @@ +openapi: 3.0.0 +info: + title: 3gpp-ecs-address-provision + version: 1.0.1 + description: | + API for ECS Address Provisioning. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-ecs-address-provision/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/configurations: + get: + summary: Read all active configurations for a given AF + operationId: ReadAllConfigurations + tags: + - ECS Address Provision Configurations (Collection) + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active resources for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EcsAddressProvision' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + operationId: CreateNewConfiguration + tags: + - ECS Address Provision Configurations (Collection) + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new resource creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/{configurationId}: + get: + summary: Read an active resource for the AF and the configuration Id + operationId: ReadAnConfiguration + tags: + - Individual ECS Address Provision Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active resource) + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing resource + operationId: FullyUpdateAnConfiguration + tags: + - Individual ECS Address Provision Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + responses: + '200': + description: OK (Successful update of the existing resource) + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration resource + operationId: DeleteAnConfiguration + tags: + - Individual ECS Address Provision Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing resource) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + EcsAddressProvision: + description: Represents ECS address provision configuration. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + ecsServerAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EcsServerAddr' + spatialValidityCond: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SpatialValidityCond' + tgtUe: + $ref: 'TS29522_AnalyticsExposure.yaml#/components/schemas/TargetUeId' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ecsServerAddr + - suppFeat + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_IPTVConfiguration.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_IPTVConfiguration.yaml new file mode 100644 index 000000000..4f0f979b5 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_IPTVConfiguration.yaml @@ -0,0 +1,425 @@ +openapi: 3.0.0 +info: + title: 3gpp-iptvconfiguration + version: 1.1.1 + description: | + API for IPTV configuration. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-iptvconfiguration/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/configurations: + get: + summary: read all of the active configurations for the AF + operationId: ReadAllSubscriptions + tags: + - IPTV Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active configurations for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IptvConfigData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + operationId: CreateNewSubscription + tags: + - IPTV Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + responses: + '201': + description: Created (Successful creation of configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/{configurationId}: + get: + summary: read an active configuration for the AF and the configuration Id + operationId: ReadAnSubscription + tags: + - Individual IPTV Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing configuration resource + operationId: FullyUpdateAnSubscription + tags: + - Individual IPTV Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + responses: + '200': + description: OK (Successful deletion of the existing configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates an existing configuration resource + operationId: PartialUpdateAnSubscription + tags: + - Individual IPTV Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/IptvConfigDataPatch' + responses: + '200': + description: OK. The configuration was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration + operationId: DeleteAnSubscription + tags: + - Individual IPTV Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + IptvConfigData: + description: Represents an individual IPTV Configuration resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + afAppId: + type: string + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + multiAccCtrls: + type: object + additionalProperties: + $ref: '#/components/schemas/MulticastAccessControl' + minProperties: 1 + description: > + Identifies a list of multicast address access control information. + Any string value can be used as a key of the map. + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afAppId + - multiAccCtrls + - suppFeat + IptvConfigDataPatch: + description: > + Represents the parameters to request the modification of an IPTV Configuration resource. + type: object + properties: + multiAccCtrls: + type: object + additionalProperties: + $ref: '#/components/schemas/MulticastAccessControl' + minProperties: 1 + description: > + Identifies a list of multicast address access control information. + Any string value can be used as a key of the map. + MulticastAccessControl: + description: Represents multicast address access control information. + type: object + properties: + srcIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + srcIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + multicastV4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + multicastV6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + accStatus: + $ref: '#/components/schemas/AccessRightStatus' + required: + - accStatus + AccessRightStatus: + anyOf: + - type: string + enum: + - FULLY_ALLOWED + - PREVIEW_ALLOWED + - NO_ALLOWED + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - FULLY_ALLOWED: The User is fully allowed to access to the channel. + - PREVIEW_ALLOWED: The User is preview allowed to access to the channel. + - NO_ALLOWED: The User is not allowed to access to the channel. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_LpiParameterProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_LpiParameterProvision.yaml new file mode 100644 index 000000000..973a6898d --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_LpiParameterProvision.yaml @@ -0,0 +1,378 @@ +openapi: 3.0.0 +info: + title: 3gpp-lpi-pp + version: 1.1.2 + description: | + API for Location Privacy Indication Parameters Provisioning. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-lpi-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/provisionedLpis: + get: + summary: read all of the active LPI Parameters Provisioning resources for the AF + operationId: ReadAllResources + tags: + - LPI Parameters Provisionings + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active resources for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LpiParametersProvision' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new LPI Parameters Provisioning resource + operationId: CreateNewResource + tags: + - LPI Parameters Provisionings + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new resource creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/provisionedLpis/{provisionedLpiId}: + get: + summary: read an active LPI Parameters Provisioning resource for the AF and the provisioned LPI Id + operationId: ReadAnResource + tags: + - Individual LPI Parameters Provisioning + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: provisionedLpiId + in: path + description: Identifier of the provisioned LPI parameter resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active resource) + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing LPI Parameters Provisioning resource + operationId: FullyUpdateAnResource + tags: + - Individual LPI Parameters Provisioning + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: provisionedLpiId + in: path + description: Identifier of the provisioned LPI parameter resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + responses: + '200': + description: > + OK. The resource has been successfully updated and a representation of the updated + resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partially modifies an existing LPI Parameters Provisioning resource. + operationId: PartialUpdateAnResource + tags: + - Individual LPI Parameters Provisioning + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: provisionedLpiId + in: path + description: Identifier of the provisioned LPI parameter resource + required: true + schema: + type: string + requestBody: + description: Parameters to modify the existing resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvisionPatch' + responses: + '200': + description: > + OK. The resource has been successfully modified and a representation of the + updated resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + '204': + description: > + Successful case. The resource has been successfully modified and no additional content + is sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing LPI Parameters Provisioning resource + operationId: DeleteAnResource + tags: + - Individual LPI Parameters Provisioning + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: provisionedLpiId + in: path + description: Identifier of the provisioned LPI parameter resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing resource) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + LpiParametersProvision: + description: Represents an individual LPI Parameters Provisionings resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + lpi: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi' + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - lpi + - suppFeat + LpiParametersProvisionPatch: + description: Represents the parameters to modify an existing Individual LPI Parameters Provisionings resource. + type: object + properties: + lpi: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi' + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSSession.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSSession.yaml new file mode 100644 index 000000000..d18e13dcf --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSSession.yaml @@ -0,0 +1,759 @@ +openapi: 3.0.0 + +info: + title: 3gpp-mbs-session + version: 1.1.1 + description: | + API for MBS Session Management. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +servers: + - url: '{apiRoot}/3gpp-mbs-session/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: [] + +paths: + /mbs-sessions: + post: + summary: Request the creation of a new MBS Session. + tags: + - MBS Sessions collection + operationId: CreateMBSSession + requestBody: + description: Representation of the new MBS session to be created at the NEF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionCreateReq' + responses: + '201': + description: > + Created. Successful creation of a new Individual MBS session resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionCreateRsp' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-mbs-session/v1/mbs-sessions/{mbsSessionRef} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /mbs-sessions/{mbsSessionRef}: + parameters: + - name: mbsSessionRef + in: path + description: Identifier of the Individual MBS Session resource. + required: true + schema: + type: string + + patch: + summary: Request the modification of an existing Individual MBS Session resource. + operationId: ModifyIndMBSSession + tags: + - Individual MBS Session + requestBody: + required: true + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + responses: + '204': + description: > + No Content. The concerned Individual MBS Session resource was successfully modified. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the Deletion of an existing Individual MBS Session resource. + operationId: DeleteIndMBSSession + tags: + - Individual MBS Session + responses: + '204': + description: > + No Content. Successful deletion of the concerned Individual MBS Session resource. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /mbs-sessions/subscriptions: + get: + summary: Retrieve all the active MBS Sessions subscriptions. + operationId: ReadMBSSessionsSubscs + tags: + - MBS Session Subscriptions + responses: + '200': + description: > + OK. All the active MBS Session Subscriptions resources managed by the NEF are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MbsSessionSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new Individual MBS Session subscription resource. + operationId: CreateMBSSessionsSubsc + tags: + - MBS Session Subscriptions + requestBody: + description: Request the creation of a new MBS Session subscription resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionSubsc' + responses: + '201': + description: > + Created. Successful creation of a new Individual MBS Session subscription. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionSubsc' + headers: + Location: + description: Contains the URI of the newly created resource, according to the + structure + {apiRoot}/3gpp-mbs-session/v1/mbs-sessions/subscriptions/{subscriptionId} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + MBSSessionStatusNotification: + '{request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionStatusNotif' + responses: + '204': + description: No Content. Successful reception of the notification. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /mbs-sessions/subscriptions/{subscriptionId}: + parameters: + - name: subscriptionId + in: path + description: Identifier of the Individual MBS Session Subscription resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual MBS Session Subscription resource. + operationId: ReadIndMBSSessionsSubsc + tags: + - Individual MBS Session subscription + responses: + '200': + description: > + OK. Successful retrieval of the targeted Individual MBS Session subscription resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the deletion of an existing Individual MBS Session subscription resource. + operationId: DeleteIndMBSSessionsSubsc + tags: + - Individual MBS Session Subscription + responses: + '204': + description: > + No Content. Successful deletion of the existing Individual MBS Session subscription + resource. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /mbs-pp: + get: + summary: Request to retrieve all the active MBS Parameters Provisioning resources at the NEF. + operationId: GetMBSParamsProvisionings + tags: + - MBS Parameters Provisionings + responses: + '200': + description: > + OK. All the active MBS Parameters Provisioning resources managed by the NEF are + returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MbsPpData' + minItems: 1 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new MBS Parameters Provisioning. + tags: + - MBS Parameters Provisioning + operationId: CreateMBSParamsProvisioning + requestBody: + description: Representation of the new MBS Parameters Provisioning to be created at the NEF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + responses: + '201': + description: > + Created. Successful creation of a new Individual MBS Parameters Provisioning resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-mbs-session/v1/mbs-pp/{mbsPpId} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /mbs-pp/{mbsPpId}: + parameters: + - name: mbsPpId + in: path + description: > + Represents the identifier of the Individual MBS Parameters Provisioning resource. + required: true + schema: + type: string + + get: + summary: Request to retrieve an existing Individual MBS Parameters Provisioning resource. + operationId: GetIndMBSParamsProvisioning + tags: + - Individual MBS Parameters Provisioning + responses: + '200': + description: > + OK. Successful retrieval of the requested Individual MBS Parameters Provisioning. + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual MBS Parameters Provisioning resource. + tags: + - Individual MBS Parameters Provisioning + operationId: UpdateIndMBSParamsProvisioning + requestBody: + description: > + Represents the updated Individual MBS Parameters Provisioning resource representation. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + responses: + '200': + description: > + OK. The Individual MBS Parameters Provisioning resource is successfully updated and a + representation of the updated resource is returned in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + '204': + description: > + No Content. The Individual MBS Parameters Provisioning resource is successfully updated. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request the modification of an existing Individual MBS Parameters Provisioning resource. + tags: + - Individual MBS Parameters Provisioning + operationId: ModifyIndMBSParamsProvisioning + requestBody: + description: > + Contains the parameters to request the modification of the Individual Parameters + Provisioning resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/MbsPpDataPatch' + responses: + '200': + description: > + OK. The Individual MBS Parameters Provisioning resource is successfully modified and a + representation of the updated resource is returned in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + '204': + description: > + No Content. The Individual MBS Parameters Provisioning resource is successfully + modified. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the deletion of an existing Individual MBS Parameters Provisioning resource. + tags: + - Individual MBS Parameters Provisioning + operationId: DeleteIndMBSParamsProvisioning + responses: + '204': + description: > + No Content. The Individual MBS Parameters Provisioning resource is successfully + deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + + schemas: +# +# STRUCTURED DATA TYPES +# + MbsSessionCreateReq: + description: Represents the parameters to request MBS Session creation. + type: object + properties: + afId: + type: string + mbsSession: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSession' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afId + - mbsSession + + MbsSessionCreateRsp: + description: Represents the parameters to be returned in an MBS Session creation response.. + type: object + properties: + mbsSession: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSession' + eventList: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionEventReportList' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - mbsSession + + MbsSessionSubsc: + description: Represents an MBS Session Subscription. + type: object + properties: + afId: + type: string + subscription: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionSubscription' + subscriptionId: + type: string + required: + - afId + - subscription + + MbsSessionStatusNotif: + description: Represents an MBS Session Status notification. + type: object + properties: + eventList: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionEventReportList' + required: + - eventList + + MbsPpData: + description: Represents MBS Parameters Provisioning data. + type: object + properties: + afId: + type: string + mbsSessAuthData: + $ref: '#/components/schemas/MbsSessAuthData' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afId + + MbsSessAuthData: + description: Represents the MBS Session Authorization data. + type: object + properties: + extGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsisList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minProperties: 1 + description: > + Represents the list of the GPSI(s) of the member UE(s) constituting the multicast MBS + group. Any + value of type can be used as a key of the map. + mbsSessionIdList: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5MbsAuthorizationInfo' + required: + - extGroupId + - mbsSessionIdList + + MbsPpDataPatch: + description: > + Represents the requested modification to existing MBS Parameters Provisioning data. + type: object + properties: + mbsSessAuthData: + $ref: '#/components/schemas/MbsSessAuthData' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + +# +# SIMPLE DATA TYPES +# + +# +# ENUMERATIONS +# diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSTMGI.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSTMGI.yaml new file mode 100644 index 000000000..fc36a816a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSTMGI.yaml @@ -0,0 +1,229 @@ +openapi: 3.0.0 +info: + title: 3gpp-mbs-tmgi + version: 1.0.1 + description: | + API for the allocation, deallocation and management of TMGI(s) for MBS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-mbs-tmgi/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. + +paths: + /allocate: + post: + summary: Request the allocation of TMGI(s) for new MBS session(s) or the refresh of the expiry time of already allocated TMGI(s). + operationId: AllocateTmgi + tags: + - TMGI Allocation or Timer Expiry Refresh + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TmgiAllocRequest' + responses: + '200': + description: > + OK. Successful case. The allocated TMGI(s) or a refreshed expiry time for the concerned + already allocated TMGI(s) is/are returned to the requesting AF. + content: + application/json: + schema: + $ref: '#/components/schemas/TmgiAllocResponse' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + TmgiTimerExpiryNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + description: > + Represents the MBS TMGI(s) timer expiry notification information (e.g. list of + TMGI(s) for which the timer has expired). + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExpiryNotif' + responses: + '204': + description: No content. The notification is successfully received. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /deallocate: + post: + summary: Request the deallocation of MBS TMGI(s). + operationId: DeallocateTmgi + tags: + - MBS TMGI Deallocation + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TmgiDeallocRequest' + responses: + '204': + description: No Content. Successful case, the TMGI(s) are deallocated. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + + schemas: + TmgiAllocRequest: + description: > + Represents the full set of parameters to initiate an MBS TMGI(s) allocation request + or the refresh of the expiry time of already allocated TMGI(s). + type: object + properties: + afId: + type: string + tmgiParams: + $ref: 'TS29532_Nmbsmf_TMGI.yaml#/components/schemas/TmgiAllocate' + notificationUri: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' + requestTestNotification: + type: boolean + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afId + - tmgiParams + + TmgiAllocResponse: + description: > + Represents MBS TMGI(s) allocation information or the refreshed expiry time for + already allocated TMGI(s) + type: object + properties: + tmgiInfo: + $ref: 'TS29532_Nmbsmf_TMGI.yaml#/components/schemas/TmgiAllocated' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - tmgiInfo + + TmgiDeallocRequest: + description: Represents information to request the deallocation of MBS TMGI(s). + type: object + properties: + afId: + type: string + tmgis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tmgi' + minItems: 1 + required: + - afId + - tmgis + + ExpiryNotif: + description: Represents MBS TMGI(s) timer expiry notification information. + type: object + properties: + tmgis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tmgi' + minItems: 1 + required: + - tmgis diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSUserDataIngestSession.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSUserDataIngestSession.yaml new file mode 100644 index 000000000..81730cfa2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSUserDataIngestSession.yaml @@ -0,0 +1,649 @@ +openapi: 3.0.0 + +info: + title: 3gpp-mbs-ud-ingest + version: 1.0.1 + description: | + API for MBS User Data Ingest Session. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +servers: + - url: '{apiRoot}/3gpp-mbs-ud-ingest/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122 + +security: + - {} + - oAuth2ClientCredentials: [] + +paths: + /sessions: + get: + summary: Retrieve all the active MBS User Data Ingest Sessions managed by the NEF. + tags: + - MBS User Data Ingest Sessions (Collection) + operationId: RetrieveMBSUserDataIngestSessions + responses: + '200': + description: > + OK. All the active MBS User Data Ingest Sessions managed by the NEF are returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new Individual MBS User Data Ingest Session resource. + tags: + - MBS User Data Ingest Sessions (Collection) + operationId: CreateMBSUserDataIngestSession + requestBody: + description: > + Contains the parameters to request the creation of a new MBS User Data Ingest Session + at the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + responses: + '201': + description: > + Created. A new MBS User Data Ingest Session is successfully created and a representation + of the created Individual MBS User Data Ingest Session resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-mbs-ud-ingest/v1/sessions/{sessionId} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /sessions/{sessionId}: + parameters: + - name: sessionId + in: path + description: Identifier of the Individual MBS User Data Ingest Session resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual MBS User Data Ingest Session resource. + tags: + - Individual MBS User Data Ingest Session (Document) + operationId: RetrieveIndivMBSUserDataIngestSession + responses: + '200': + description: > + OK. The requested Individual MBS User Data Ingest Session resource is successfully + returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual MBS User Data Ingest Session resource. + tags: + - Individual MBS User Data Ingest Session (Document) + operationId: UpdateIndivMBSUserDataIngestSession + requestBody: + description: > + Contains the updated representation of the Individual MBS User Data Ingest Session + resource. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + responses: + '200': + description: > + OK. The concerned Individual MBS User Data Ingest Session resource is successfully + updated and a representation of the updated resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + '204': + description: > + No Content. The concerned Individual MBS User Data Ingest Session resource is + successfully updated. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request the modification of an existing Individual MBS User Data Ingest Session resource. + tags: + - Individual MBS User Data Ingest Session (Document) + operationId: ModifyIndivMBSUserDataIngestSession + requestBody: + description: > + Contains the parameters to request the modification of the Individual MBS User Data Ingest + Session resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSessionPatch' + responses: + '200': + description: > + OK. The concerned Individual MBS User Data Ingest Session resource is successfully + modified and a representation of the updated resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + '204': + description: > + No Content. The concerned Individual MBS User Data Ingest Session resource is + successfully modified. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing Individual MBS User Data Ingest Session resource. + tags: + - Individual MBS User Data Ingest Session (Document) + operationId: DeleteIndivMBSUserDataIngestSession + responses: + '204': + description: > + No Content. The Individual MBS User Data Ingest Session resource is successfully + deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /status-subscriptions: + get: + summary: Retrieve all the active MBS User Data Ingest Session Status Subscriptions resources managed by the NEF. + tags: + - MBS User Data Ingest Session Status Subscriptions (Collection) + operationId: RetrieveMBSUserDataIngStatSubscs + responses: + '200': + description: > + OK. All the active MBS User Data Ingest Session Status Subscriptions managed by the NEF + are returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - MBS User Data Ingest Session Status Subscriptions (Collection) + operationId: CreateMBSUserDataIngStatSubsc + requestBody: + description: > + Contains the parameters to request the creation of a new MBS User Data Ingest Session + Status Subscription resource. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + responses: + '201': + description: > + Created. Successful creation of a new Individual MBS User Data Ingest Session + Status Subscription resource. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + mbsUserDataIngestSessionStatusNotif: + '{request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatNotif' + responses: + '204': + description: No Content. Successful reception of the notification. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /status-subscriptions/{subscriptionId}: + parameters: + - name: subscriptionId + in: path + description: > + Identifier of the Individual MBS User Data Ingest Session Status Subscription resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - Individual MBS User Data Ingest Session Status Subscription (Document) + operationId: RetrieveIndMBSUserDataIngStatSubsc + responses: + '200': + description: > + OK. Successful retrieval of the requested Individual MBS User Data Ingest Session + Status Subscription resource. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - Individual MBS User Data Ingest Session Status Subscription (Document) + operationId: UpdateIndMBSUserDataIngStatSubsc + requestBody: + description: > + Contains the updated representation of the Individual MBS User Data Ingest Session Status + Subscription resource. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + responses: + '200': + description: > + OK. The concerned Individual MBS User Data Ingest Session Status Subscription resource + is successfully updated and a representation of the updated resource is returned in the + response body. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + '204': + description: > + No Content. The concerned Individual MBS User Data Ingest Session Status Subscription + resource is successfully updated and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request the modification of an existing Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - Individual MBS User Data Ingest Session Status Subscription (Document) + operationId: ModifyIndMBSUserDataIngStatSubsc + requestBody: + description: > + Contains the parameters to request the modification of the Individual MBS User Data Ingest + Session Status Subscription resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubscPatch' + responses: + '200': + description: > + OK. The concerned Individual MBS User Data Ingest Session Status Subscription resource + is successfully modified and a representation of the updated resource is returned in the + response body. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + '204': + description: > + No Content. The concerned Individual MBS User Data Ingest Session Status Subscription + resource is successfully modified and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - Individual MBS User Data Ingest Session Status Subscription (Document) + operationId: DeleteIndMBSUserDataIngStatSubsc + responses: + '204': + description: > + No Content. Successful deletion of the existing Individual MBS User Data Ingest Session + Status Subscription resource. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + +# +# STRUCTURED DATA TYPES +# + +# SIMPLE DATA TYPES +# + +# +# ENUMERATIONS +# diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSUserService.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSUserService.yaml new file mode 100644 index 000000000..f3e5df74a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MBSUserService.yaml @@ -0,0 +1,321 @@ +openapi: 3.0.0 + +info: + title: 3gpp-mbs-us + version: 1.0.1 + description: | + API for MBS User Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +servers: + - url: '{apiRoot}/3gpp-mbs-us/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122 + +security: + - {} + - oAuth2ClientCredentials: [] + +paths: + /mbs-user-services: + get: + summary: Retrieve all the active MBS User Service resources managed by the NEF. + tags: + - MBS User Services + operationId: RetrieveMBSUserServices + responses: + '200': + description: > + OK. All the active MBS User Services managed by the NEF are returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new Individual MBS User Service resource. + tags: + - MBS User Services + operationId: CreateMBSUserService + requestBody: + description: > + Contains the parameters to request the creation of a new MBS User Service at the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + responses: + '201': + description: > + Created. A new MBS User Service is successfully created and a representation of the + created Individual MBS User Service resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-mbs-us/v1/mbs-user-services/{mbsUserServId} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /mbs-user-services/{mbsUserServId}: + parameters: + - name: mbsUserServId + in: path + description: Identifier of the Individual MBS User Service resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual MBS User Service resource. + tags: + - Individual MBS User Service + operationId: RetrieveIndivMBSUserService + responses: + '200': + description: > + OK. The requested Individual MBS User Service resource is successfully returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual MBS User Service resource. + tags: + - Individual MBS User Service + operationId: UpdateIndivMBSUserService + requestBody: + description: > + Contains the updated representation of the Individual MBS User Service resource. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + responses: + '200': + description: > + OK. The concerned Individual MBS User Service resource is successfully updated and a + representation of the updated resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + '204': + description: > + No Content. The concerned Individual MBS User Service resource is successfully updated. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request the modification of an existing Individual MBS User Service resource. + tags: + - Individual MBS User Service + operationId: ModifyIndivMBSUserService + requestBody: + description: > + Contains the parameters to request the modification of the Individual MBS User + Service resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserServicePatch' + responses: + '200': + description: > + OK. The concerned Individual MBS User Service resource is successfully modified and a + representation of the updated resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + '204': + description: > + No Content. The concerned Individual MBS User Service resource is successfully modified. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing Individual MBS User Service resource. + tags: + - Individual MBS User Service + operationId: DeleteIndivMBSUserService + responses: + '204': + description: > + No Content. The Individual MBS User Service resource is successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + +# +# STRUCTURED DATA TYPES +# + +# SIMPLE DATA TYPES +# + +# +# ENUMERATIONS +# diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MSEventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MSEventExposure.yaml new file mode 100644 index 000000000..8a7eab0ae --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MSEventExposure.yaml @@ -0,0 +1,314 @@ +openapi: 3.0.0 + +info: + title: 3gpp-ms-event-exposure + version: 1.0.1 + description: | + API for Media Streaming Event Exposure. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +servers: + - url: '{apiRoot}/3gpp-ms-event-exposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122 + +security: + - {} + - oAuth2ClientCredentials: [] + +paths: + /subscriptions: + get: + summary: Retrieve all the active Media Streaming Event Exposure Subscription resources managed by the NEF. + tags: + - Media Streaming Event Exposure Subscriptions (Collection) + operationId: RetrieveMSEventExposureSubscs + responses: + '200': + description: > + OK. All the active Media Streaming Event Exposure Subscriptions managed by the NEF are + returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new Individual Media Streaming Event Exposure Subscription resource. + tags: + - Media Streaming Event Exposure Subscriptions (Collection) + operationId: CreateMSEventExposureSubsc + requestBody: + description: > + Contains the parameters to request the creation of a new Media Streaming Event Exposure + Subscriptionat the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + responses: + '201': + description: > + Created. Successful creation of a new Individual Media Streaming Event Exposure + Subscription resource. + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + msEventExposureNotif: + '{request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureNotif' + responses: + '204': + description: No Content. Successful reception of the notification. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /subscriptions/{subscriptionId}: + parameters: + - name: subscriptionId + in: path + description: Identifier of the Individual Media Streaming Event Exposure Subscription resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual Media Streaming Event Exposure Subscription resource. + tags: + - Individual Media Streaming Event Exposure Subscription (Document) + operationId: RetrieveIndivMSEventExposureSubsc + responses: + '200': + description: > + OK. The requested Individual Media Streaming Event Exposure Subscription resource is + successfully returned. + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual Media Streaming Event Exposure Subscription resource. + tags: + - Individual Media Streaming Event Exposure Subscription (Document) + operationId: UpdateIndivMSEventExposureSubsc + requestBody: + description: > + Contains the updated representation of the Individual Media Streaming Event Exposure + Subscription resource. + resource. + required: true + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + responses: + '200': + description: > + OK. The concerned Individual Media Streaming Event Exposure Subscription resource is + successfully updated and a representation of the updated resource is returned in the + response body. + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + '204': + description: > + No Content. The concerned Individual Media Streaming Event Exposure Subscription + resource was successfully updated and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the deletion of an existing Individual Media Streaming Event Exposure Subscription resource. + tags: + - Individual Media Streaming Event Exposure Subscription (Document) + operationId: DeleteIndivMSEventExposureSubsc + responses: + '204': + description: > + No Content. The Individual Media Streaming Event Exposure Subscription resource is + successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + +# +# STRUCTURED DATA TYPES +# + +# SIMPLE DATA TYPES +# + +# +# ENUMERATIONS +# + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MoLcsNotify.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MoLcsNotify.yaml new file mode 100644 index 000000000..8d5acd6e1 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_MoLcsNotify.yaml @@ -0,0 +1,103 @@ +openapi: 3.0.0 +info: + title: 3gpp-mo-lcs-notify + version: 1.1.1 + description: | + API for UE updated location information notification. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-mo-lcs-notify/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /: + post: + summary: UE location information update notification + operationId: UELocationNotify + tags: + - AF level UE location update notification operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocUpdateData' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/LocUpdateDataReply' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + LocUpdateData: + description: Represents a UE updated location information. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + locInfo: + $ref: 'TS29122_MonitoringEvent.yaml#/components/schemas/LocationInfo' + lcsQosClass: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsQosClass' + svcId: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/ServiceIdentity' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - gpsi + - lcsQosClass + - locInfo + - suppFeat + LocUpdateDataReply: + description: Represents a reply to a MO LCS notification. + type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - suppFeat diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_NIDDConfigurationTrigger.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_NIDDConfigurationTrigger.yaml new file mode 100644 index 000000000..0d9bf661b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_NIDDConfigurationTrigger.yaml @@ -0,0 +1,102 @@ +openapi: 3.0.0 +info: + title: 3gpp-nidd-configuration-trigger + version: 1.1.1 + description: | + API for NIDD Configuration Trigger. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /: + post: + operationId: NiddConfigurationTrigger + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfigurationTrigger' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfigurationTriggerReply' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + NiddConfigurationTrigger: + description: Represents a NIDD configuration trigger. + type: object + properties: + afId: + type: string + description: Identifies the trigger receiving entity. + nefId: + type: string + description: Identifies the trigger sending entity. + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afId + - nefId + - gpsi + - suppFeat + NiddConfigurationTriggerReply: + description: Represents a reply to a NIDD configuration trigger. + type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - suppFeat + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ServiceParameter.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ServiceParameter.yaml new file mode 100644 index 000000000..68b570886 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_ServiceParameter.yaml @@ -0,0 +1,739 @@ +openapi: 3.0.0 +info: + title: 3gpp-service-parameter + version: 1.1.2 + description: | + API for AF service paramter + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-service-parameter/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Service Parameter Subscriptions + parameters: + - name: gpsis + in: query + description: The GPSI of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + - name: ip-addrs + in: query + description: The IP address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + - name: ip-domain + in: query + description: > + The IPv4 address domain identifier. The attribute may only be provided + if IPv4 address is included in the ip-addrs query parameter. + required: false + schema: + type: string + - name: mac-addrs + in: query + description: The MAC address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceParameterData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateAnSubscription + tags: + - Service Parameter Subscriptions + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + notificationDestination: + '{$request.body#/notificationDestination}': + post: + requestBody: + description: > + Notifications upon AF Service Parameter Authorization Update, + and/or AF subscribed event notification of the outcome related + to the invocation of service parameters provisioning. + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AfNotification' + minItems: 1 + responses: + '204': + description: Expected response to a successful callback processing without a body + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + get: + summary: read an active subscriptions for the SCS/AS and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Service Parameter Subscription + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual Service Parameter Subscription + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: OK (Successful update of the subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates/replaces an existing subscription resource + operationId: PartialUpdateAnSubscription + tags: + - Individual Service Parameter Subscription + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/ServiceParameterDataPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: OK. The subscription was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Service Parameter Subscription + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ServiceParameterData: + description: Represents an individual Service Parameter subscription resource. + type: object + properties: + afServiceId: + type: string + description: Identifies a service on behalf of which the AF is issuing the request. + appId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + anyUeInd: + type: boolean + description: > + Identifies whether the AF request applies to any UE. This attribute + shall set to "true" if applicable for any UE, otherwise, set to "false". + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + subNotifEvents: + type: array + items: + $ref: '#/components/schemas/Event' + minItems: 1 + notificationDestination: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + requestTestNotification: + type: boolean + description: > + Set to true by the AF to request the NEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + paramOverPc5: + $ref: '#/components/schemas/ParameterOverPc5' + paramOverUu: + $ref: '#/components/schemas/ParameterOverUu' + paramForProSeDd: + $ref: '#/components/schemas/ParamForProSeDd' + paramForProSeDc: + $ref: '#/components/schemas/ParamForProSeDc' + paramForProSeU2NRelUe: + $ref: '#/components/schemas/ParamForProSeU2NRelUe' + paramForProSeRemUe: + $ref: '#/components/schemas/ParamForProSeRemUe' + urspGuidance: + type: array + items: + $ref: '#/components/schemas/UrspRuleRequest' + minItems: 1 + description: Contains the service parameter used to guide the URSP. + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ServiceParameterDataPatch: + description: > + Represents the parameters to request the modification of a service parameter + subscription resource. + type: object + properties: + paramOverPc5: + $ref: '#/components/schemas/ParameterOverPc5Rm' + paramOverUu: + $ref: '#/components/schemas/ParameterOverUuRm' + paramForProSeDd: + $ref: '#/components/schemas/ParamForProSeDdRm' + paramForProSeDc: + $ref: '#/components/schemas/ParamForProSeDcRm' + paramForProSeU2NRelUe: + $ref: '#/components/schemas/ParamForProSeU2NRelUeRm' + paramForProSeRemUe: + $ref: '#/components/schemas/ParamForProSeRemUeRm' + urspGuidance: + type: array + items: + $ref: '#/components/schemas/UrspRuleRequest' + minItems: 1 + description: Contains the service parameter used to guide the URSP. + subNotifEvents: + type: array + items: + $ref: '#/components/schemas/Event' + minItems: 1 + nullable: true + notificationDestination: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ParameterOverPc5: + description: > + Represents configuration parameters for V2X communications over PC5 reference point. + type: string + ParameterOverPc5Rm: + description: > + Represents the same as the ParameterOverPc5 data type but with the nullable:true property. + type: string + nullable: true + ParameterOverUu: + description: > + Represents configuration parameters for V2X communications over Uu reference point. + type: string + ParameterOverUuRm: + description: > + Represents the same as the ParameterOverUu data type but with the nullable:true property. + type: string + nullable: true + ParamForProSeDd: + description: Represents the service parameters for 5G ProSe direct discovery. + type: string + ParamForProSeDdRm: + description: > + This data type is defined in the same way as the ParamForProSeDd data type, + but with the OpenAPI nullable property set to true. + type: string + nullable: true + ParamForProSeDc: + description: Represents the service parameters for 5G ProSe direct communications. + type: string + ParamForProSeDcRm: + description: > + This data type is defined in the same way as the ParamForProSeDc data type, + but with the OpenAPI nullable property set to true. + type: string + nullable: true + ParamForProSeU2NRelUe: + description: Represents the service parameters for 5G ProSe UE-to-network relay UE. + type: string + ParamForProSeU2NRelUeRm: + description: > + This data type is defined in the same way as the ParamForProSeU2NRelay data type, + but with the OpenAPI nullable property set to true. + type: string + nullable: true + ParamForProSeRemUe: + description: Represents the service parameters for 5G ProSe Remate UE. + type: string + ParamForProSeRemUeRm: + description: > + This data type is defined in the same way as the ParamForProSeRemUe data type, + but with the OpenAPI nullable property set to true. + type: string + nullable: true + UrspRuleRequest: + description: Contains parameters that can be used to guide the URSP. + type: object + properties: + trafficDesc: + $ref: '#/components/schemas/TrafficDescriptorComponents' + relatPrecedence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + routeSelParamSets: + type: array + items: + $ref: '#/components/schemas/RouteSelectionParameterSet' + minItems: 1 + description: > + Sets of parameters that may be used to guide the Route Selection Descriptors of the + URSP. + RouteSelectionParameterSet: + description: > + Contains parameters that can be used to guide the Route Selection + Descriptors of the URSP. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + precedence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + spatialValidityAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: > + Indicates where the route selection parameters apply. It may correspond + to a geographical area, for example using a geographic shape that + is known to the AF and is configured by the operator to correspond to a list + of or TAIs. + spatialValidityTais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + description: > + Indicates the TAIs in which the route selection parameters apply. This attribute is + applicable only within the 5GC and it shall not be included in the request messages of + untrusted AFs for URSP guidance. + Event: + anyOf: + - type: string + enum: + - SUCCESS_UE_POL_DEL_SP + - UNSUCCESS_UE_POL_DEL_SP + - type: string + description: > + This string identifies AF subscribe to event(s) notifications related to + AF provisioned service parameters. + description: | + Possible values are: + - SUCCESS_UE_POL_DEL_SP: Successful UE Policy Delivery related to + the invocation of AF provisioned Service Parameters. + - UNSUCCESS_UE_POL_DEL_SP: Unsuccessful UE Policy Delivery related to the invocation of AF + provisioned Service Parameters. + AfNotification: + description: > + Notifications upon AF Service Parameter Authorization Update e.g. to + revoke the authorization, and/or AF subscribed event notification of the + outcome related to the invocation of service parameter provisioning. + type: object + properties: + subscription: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + reportEvent: + $ref: '#/components/schemas/Event' + authResult: + $ref: '#/components/schemas/AuthorizationResult' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + eventInfo: + $ref: '#/components/schemas/EventInfo' + required: + - subscription + anyOf: + - required: [reportEvent] + - required: [authResult] + TrafficDescriptorComponents: + description: Traffic descriptor components for the requested URSP. + type: object + properties: + appDescs: + type: object + additionalProperties: + $ref: 'TS29522_5GLANParameterProvision.yaml#/components/schemas/AppDescriptor' + minProperties: 1 + description: Describes the operation systems and the corresponding applications for each + operation systems. The key of map is osId. + flowDescs: + type: array + items: + type: string + minItems: 1 + description: Represents a 3-tuple with protocol, server ip and server port for UL/DL + application traffic. The content of the string has the same encoding as the IPFilterRule + AVP value as defined in IETF RFC 6733. + domainDescs: + type: array + items: + type: string + minItems: 1 + description: FQDN(s) or a regular expression which are used as a domain name matching + criteria. + ethFlowDescs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Descriptor(s) for destination information of non-IP traffic in which only + ethernet flow description is defined. + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: This is matched against the DNN information provided by the application. + connCaps: + type: array + items: + $ref: '#/components/schemas/ConnectionCapabilities' + minItems: 1 + description: This is matched against the information provided by a UE application when it + requests a network connection with certain capabilities. + anyOf: + - required: [appDescs] + - required: [flowDescs] + - required: [domainDescs] + - required: [ethFlowDescs] + - required: [dnns] + - required: [connCaps] + AuthorizationResult: + anyOf: + - type: string + enum: + - AUTH_REVOKED + - type: string + description: > + This string indicates NEF notify the AF about the service parameters authorization + updates result. + description: | + Possible values are: + - AUTH_REVOKED: Indicated the service parameters authorization is revoked. + EventInfo: + description: Indicates the event information. + type: object + properties: + failureCause: + $ref: '#/components/schemas/Failure' + Failure: + oneOf: + - type: string + enum: + - UNSPECIFIED + - UE_NOT_REACHABLE + - UNKNOWN + - UE_TEMP_UNREACHABLE + - type: string + description: > + This string represents the failure reason for the unsuccessful result. May be + present if the reported afSubEvent attribute is "UNSUCCESS_UE_POL_DEL_SP". + description: | + Possible values are: + - UNSPECIFIED: Indicates the PCF received the UE sent UE policy delivery service cause #111 + (Protocol error, unspecified). + - UE_NOT_REACHABLE: Indicates the PCF received the notification from the AMF that the UE is + not reachable. + - UNKNOWN: Indicates unknown reasons upon no response from the UE, e.g. UPDS message type is + not defined or not implemented by the UE, or not compatible with the UPDS state, in which + the UE shall ignore the UPDS message. + - UE_TEMP_UNREACHABLE: Indicates the PCF received the notification from the AMF that the UE + is not reachable but the PCF will retry again. + ConnectionCapabilities: + anyOf: + - type: string + enum: + - IMS + - MMS + - SUPL + - INTERNET + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - IMS: Indicates the connection capability to support IMS service. + - MMS: Indicates the connection capability to support MMS service. + - SUPL: Indicates the connection capability to support SUPL service. + - INTERNET: Indicates the connection capability to support Internet service. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_TimeSyncExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_TimeSyncExposure.yaml new file mode 100644 index 000000000..5ea93fe7a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_TimeSyncExposure.yaml @@ -0,0 +1,1016 @@ +openapi: 3.0.0 +info: + title: 3gpp-time-sync-exposure + version: 1.0.1 + description: | + API for time synchronization exposure. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-time-sync/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/subscriptions: + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Time Synchronization Exposure Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateNewSubscription + tags: + - Time Synchronization Exposure Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new subscription creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + timeSyncSubsNotification: + '{$request.body#/subsNotifUri}': + post: + requestBody: + description: Notification for Time Synchronization Capability for a list of UEs. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsNotif' + responses: + '204': + description: Expected response to a successful callback processing without a body + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Time Synchronization Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual Time Synchronization Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + responses: + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Time Synchronization Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}/configurations: + get: + summary: read all of the active configurations for the AF + operationId: ReadAllConfirguations + tags: + - Time Synchronization Exposure Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + description: String identifying the individual synchronization Exposure Subscription resource in the NEF + in: path + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active configurations for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TimeSyncExposureConfig' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + operationId: CreateNewConfirguation + tags: + - Time Synchronization Exposure Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + description: > + String identifying the individual synchronization Exposure Subscription + resource in the NEF. + in: path + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + timeSyncConfigNotification: + '{$request.body#/configNotifUri}': + post: + requestBody: + description: Notification for Time Synchronization Service status. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfigNotif' + responses: + '204': + description: Expected response to a successful callback processing without a body + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}/configurations/{instanceReference}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadTimeSynSubscription + tags: + - Individual Time Synchronization Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + - name: instanceReference + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing configuration resource + operationId: FullyUpdateAnConfiguration + tags: + - Individual Time Synchronization Exposure Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + - name: instanceReference + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + responses: + '200': + description: OK (Successful deletion of the existing configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration + operationId: DeleteAnConfiguration + tags: + - Individual Time Synchronization Exposure Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + - name: instanceReference + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + TimeSyncExposureSubsc: + description: > + Contains requested parameters for the subscription to the notification + of time synchronization capability. + type: object + properties: + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + description: > + Contains a list of UE for which the time synchronization capabilities is requested. + anyUeInd: + type: boolean + description: > + Any UE indication. This IE shall be present if the event subscription + is applicable to any UE. Default value "false" is used, if not present. + afServiceId: + type: string + description: Identifies a service on behalf of which the AF is issuing the request. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + subsNotifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + subsNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/SubscribedEvent' + minItems: 1 + description: Subscribed events + eventFilters: + type: array + items: + $ref: '#/components/schemas/EventFilter' + minItems: 1 + description: > + Contains the filter conditions to match for notifying the event(s) + of time synchronization capabilities for a list of UE(s). + notifMethod: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + requestTestNotification: + type: boolean + description: > + Set to true by the SCS/AS to request the SCEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - subsNotifUri + - subsNotifId + TimeSyncCapability: + description: Contains time synchronization capability. + type: object + properties: + upNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + gmCapables: + type: array + items: + $ref: '#/components/schemas/GmCapable' + asTimeRes: + $ref: '#/components/schemas/AsTimeResource' + ptpCapForUes: + type: object + additionalProperties: + $ref: '#/components/schemas/PtpCapabilitiesPerUe' + minProperties: 1 + description: > + Contains the PTP capabilities supported by each of the UE(s). + The key of the map is the gpsi. + required: + - upNodeId + anyOf: + - required: [gmCapables] + - required: [asTimeRes] + + TimeSyncExposureConfig: + description: Contains the Time Synchronization Configuration parameters. + type: object + properties: + upNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + reqPtpIns: + $ref: '#/components/schemas/PtpInstance' + gmEnable: + type: boolean + description: > + Indicates that the AF requests 5GS to act as a grandmaster for PTP + or gPTP if it is included and set to true. + gmPrio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + timeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + timeSyncErrBdgt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + configNotifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + configNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + tempValidity: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + required: + - upNodeId + - reqPtpIns + - timeDom + - configNotifId + - configNotifUri + + TimeSyncExposureSubsNotif: + description: Contains the notification of time synchronization capability. + type: object + properties: + subsNotifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + eventNotifs: + type: array + items: + $ref: '#/components/schemas/SubsEventNotification' + minItems: 1 + required: + - subsNotifId + - eventNotifs + + SubsEventNotification: + description: Notifications about subscribed Individual Events. + type: object + properties: + event: + $ref: '#/components/schemas/SubscribedEvent' + timeSyncCapas: + type: array + items: + $ref: '#/components/schemas/TimeSyncCapability' + minItems: 1 + required: + - event + + TimeSyncExposureConfigNotif: + description: Contains the notification of time synchronization service state. + type: object + properties: + configNotifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + stateOfConfig: + $ref: '#/components/schemas/StateOfConfiguration' + required: + - configNotifId + - stateOfConfig + PtpCapabilitiesPerUe: + description: Contains the supported PTP capabilities per UE. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ptpCaps: + type: array + items: + $ref: '#/components/schemas/EventFilter' + minItems: 1 + required: + - gpsi + - ptpCaps + EventFilter: + description: > + Contains the filter conditions to match for notifying the event(s) of time + synchronization capabilities. + type: object + properties: + instanceTypes: + type: array + items: + $ref: '#/components/schemas/InstanceType' + minItems: 1 + transProtocols: + type: array + items: + $ref: '#/components/schemas/Protocol' + minItems: 1 + ptpProfiles: + type: array + items: + type: string + minItems: 1 + PtpInstance: + description: Contains PTP instance configuration and activation requested by the AF. + type: object + properties: + instanceType: + $ref: '#/components/schemas/InstanceType' + protocol: + $ref: '#/components/schemas/Protocol' + ptpProfile: + type: string + portConfigs: + type: array + items: + $ref: '#/components/schemas/ConfigForPort' + minItems: 1 + required: + - instanceType + - protocol + - ptpProfile + + ConfigForPort: + description: Contains configuration for each port. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + n6Ind: + type: boolean + ptpEnable: + type: boolean + logSyncInter: + type: integer + logSyncInterInd: + type: boolean + logAnnouInter: + type: integer + logAnnouInterInd: + type: boolean + + StateOfConfiguration: + description: Contains the state of the time synchronization configuration. + type: object + properties: + stateOfNwtt: + type: boolean + description: > + When the PTP port state is Leader, Follower or Passive, it is included and set to true + to indicate the state of configuration for NW-TT port is active; when PTP port state is + in any other case, it is included and set to false to indicate the state of + configuration for NW-TT port is inactive. Default value is false. + stateOfDstts: + description: > + Contains the PTP port states of the DS-TT(s). + type: array + items: + $ref: '#/components/schemas/StateOfDstt' + minItems: 1 + StateOfDstt: + description: Contains the PTP port state of a DS-TT. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + state: + type: boolean + description: > + When the PTP port state is Leader, Follower or Passive, it is included and set to true + to indicate the state of configuration for DS-TT port is active; when PTP port state is + in any other case, it is included and set to false to indicate the state of + configuration for DS port is inactive. Default value is false. + required: + - gpsi + - state + + Protocol: + anyOf: + - type: string + enum: + - ETH + - IPV4 + - IPV6 + - type: string + description: > + This string identifies supported protocol. + description: | + Possible values are: + - ETH: Indicates Ethernet as defined in IEEE Std 1588 [45] Annex E is supported. + - IPV4: Indicates IPv4 as defined in IEEE Std 1588 [45] Annex C is supported. + - IPV6: Indicates IPv6 as defined in IEEE Std 1588 [45] Annex D is supported. + + GmCapable: + anyOf: + - type: string + enum: + - GPTP + - PTP + - type: string + description: > + This string identifies supported grandmaster. + description: | + Possible values are: + - GPTP: gPTP grandmaster is supported. + - PTP: PTP grandmaste is supported. + InstanceType: + anyOf: + - type: string + enum: + - BOUNDARY_CLOCK + - E2E_TRANS_CLOCK + - P2P_TRANS_CLOCK + - P2P_RELAY_INSTANCE + - type: string + description: > + This string identifies supported PTP instance type. + description: | + Possible values are: + - BOUNDARY_CLOCK: Indicates Boundary Clock as defined in IEEE Std 1588. + - E2E_TRANS_CLOCK: Indicates End-to-End Transparent Clock as defined in IEEE Std 1588. + - P2P_TRANS_CLOCK: Indicates Peer-to-Peer Transparent Clock as defined in IEEE Std 1588. + - P2P_RELAY_INSTANCE: Indicates PTP Relay instance as defined in IEEE Std 802.1AS. + + SubscribedEvent: + anyOf: + - type: string + enum: + - AVAILABILITY_FOR_TIME_SYNC_SERVICE + - type: string + description: > + This string identifies supported event. + description: | + Possible values are: + - AVAILABILITY_FOR_TIME_SYNC_SERVICE: The UE is availability for time synchronization service. + + AsTimeResource: + anyOf: + - type: string + enum: + - ATOMIC_CLOCK + - GNSS + - TERRESTRIAL_RADIO + - SERIAL_TIME_CODE + - PTP + - NTP + - HAND_SET + - INTERNAL_OSCILLATOR + - OTHER + - type: string + description: > + This string identifies the supported 5G clock quality. + description: | + Possible values are: + - ATOMIC_CLOCK: Indicates atomic clock is supported. + - GNSS: Indicates Global Navigation Satellite System is supported. + - TERRESTRIAL_RADIO: Indicates terrestrial radio is supported. + - SERIAL_TIME_CODE: Indicates serial time code is supported. + - PTP: Indicates PTP is supported. + - NTP: Indicates NTP is supported. + - HAND_SET: Indicates hand set is supported. + - INTERNAL_OSCILLATOR: Indicates internal oscillator is supported. + - OTHER: Indicates other source of time is supported. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_TrafficInfluence.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_TrafficInfluence.yaml new file mode 100644 index 000000000..b89f506df --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_TrafficInfluence.yaml @@ -0,0 +1,706 @@ +openapi: 3.0.0 +info: + title: 3gpp-traffic-influence + version: 1.2.1 + description: | + API for AF traffic influence + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-traffic-influence/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Traffic Influence Subscription + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluSub' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateNewSubscription + tags: + - Traffic Influence Subscription + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventNotification' + callbacks: + afAcknowledgement: + '{request.body#/afAckUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfAckInfo' + responses: + '204': + description: No Content (successful acknowledgement) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + get: + summary: read an active subscriptions for the SCS/AS and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Traffic Influence Subscription + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual Traffic Influence Subscription + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partially updates/replaces an existing subscription resource + operationId: PartialUpdateAnSubscription + tags: + - Individual Traffic Influence Subscription + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/TrafficInfluSubPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Traffic Influence Subscription + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + TrafficInfluSub: + description: Represents a traffic influence subscription. + type: object + properties: + afServiceId: + type: string + description: Identifies a service on behalf of which the AF is issuing the request. + afAppId: + type: string + description: Identifies an application. + afTransId: + type: string + description: Identifies an NEF Northbound interface transaction, generated by the AF. + appReloInd: + type: boolean + description: > + Identifies whether an application can be relocated once a location of + the application has been selected. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + anyUeInd: + type: boolean + description: > + Identifies whether the AF request applies to any UE. This attribute shall + set to "true" if applicable for any UE, otherwise, set to "false". + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/SubscribedEvent' + minItems: 1 + description: Identifies the requirement to be notified of the event(s). + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + ipv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: > + Set to true by the SCS/AS to request the NEF to send a test notification + as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Identifies IP packet filters. + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet filters. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + tfcCorrInd: + type: boolean + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + validGeoZoneIds: + type: array + items: + type: string + minItems: 1 + description: > + Identifies a geographic zone that the AF request applies only to the traffic + of UE(s) located in this specific zone. + deprecated: true + geoAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: Identifies geographical areas within which the AF request applies. + afAckInd: + type: boolean + addrPreserInd: + type: boolean + simConnInd: + type: boolean + description: > + Indicates whether simultaneous connectivity should be temporarily + maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required for the application if it is included and set to "true". + eventReq: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + eventReports: + type: array + items: + $ref: '#/components/schemas/EventNotification' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + allOf: + - oneOf: + - required: [afAppId] + - required: [trafficFilters] + - required: [ethTrafficFilters] + - oneOf: + - required: [ipv4Addr] + - required: [ipv6Addr] + - required: [macAddr] + - required: [gpsi] + - required: [externalGroupId] + - required: [anyUeInd] + anyOf: + - not: + required: [subscribedEvents] + - required: [notificationDestination] + TrafficInfluSubPatch: + description: > + Represents parameters to request the modification of a traffic influence + subscription resource. + type: object + properties: + appReloInd: + type: boolean + description: > + Identifies whether an application can be relocated once a location of + the application has been selected. + nullable: true + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Identifies IP packet filters. + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet filters. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + tfcCorrInd: + type: boolean + nullable: true + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + validGeoZoneIds: + type: array + items: + type: string + minItems: 1 + description: > + Identifies a geographic zone that the AF request applies only to the traffic + of UE(s) located in this specific zone. + nullable: true + deprecated: true + geoAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: Identifies geographical areas within which the AF request applies. + nullable: true + afAckInd: + type: boolean + nullable: true + addrPreserInd: + type: boolean + nullable: true + simConnInd: + type: boolean + description: > + Indicates whether simultaneous connectivity should be temporarily maintained + for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + nullable: true + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required for the application if it is included and set to "true". + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + eventReq: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + EventNotification: + description: Represents a traffic influence event notification. + type: object + properties: + afTransId: + type: string + description: Identifies an NEF Northbound interface transaction, generated by the AF. + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + sourceTrafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + subscribedEvent: + $ref: '#/components/schemas/SubscribedEvent' + targetTrafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + sourceDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + srcUeIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + srcUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + tgtUeIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + tgtUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + afAckUri: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + required: + - dnaiChgType + - subscribedEvent + AfResultInfo: + description: Identifies the result of application layer handling. + type: object + properties: + afStatus: + $ref: '#/components/schemas/AfResultStatus' + trafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + upBuffInd: + type: boolean + description: > + If present and set to "true" it indicates that buffering of uplink traffic + to the target DNAI is needed. + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + required: + - afStatus + AfAckInfo: + description: Represents acknowledgement information of a traffic influence event notification. + type: object + properties: + afTransId: + type: string + ackResult: + $ref: '#/components/schemas/AfResultInfo' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + required: + - ackResult + SubscribedEvent: + anyOf: + - type: string + enum: + - UP_PATH_CHANGE + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - UP_PATH_CHANGE: The AF requests to be notified when the UP path changes for the PDU session. + AfResultStatus: + anyOf: + - type: string + enum: + - SUCCESS + - TEMPORARY_CONGESTION + - RELOC_NO_ALLOWED + - OTHER + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - SUCCESS: The application layer is ready or the relocation is completed. + - TEMPORARY_CONGESTION: The application relocation fails due to temporary congestion. + - RELOC_NO_ALLOWED: The application relocation fails because application relocation is not allowed. + - OTHER: The application relocation fails due to other reason. + + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_UEId.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_UEId.yaml new file mode 100644 index 000000000..3228da69e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29522_UEId.yaml @@ -0,0 +1,111 @@ +openapi: 3.0.0 + +info: + title: 3gpp-ueid + version: 1.0.1 + description: | + API for UE ID service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-ueid/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /retrieve: + post: + summary: Retrieve AF specific UE ID. + operationId: RetrieveUEId + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UeIdReq' + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/UeIdInfo' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + UeIdReq: + description: Represents the parameters to request the retrieval of AF specific UE ID. + type: object + properties: + afId: + type: string + appPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ipDomain: + type: string + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ueMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + required: + - afId + oneOf: + - required: [ueIpAddr] + - required: [ueMacAddr] + UeIdInfo: + description: Represents UE ID information. + type: object + properties: + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + required: + - externalId diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29523_Npcf_EventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29523_Npcf_EventExposure.yaml new file mode 100644 index 000000000..98917151b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29523_Npcf_EventExposure.yaml @@ -0,0 +1,498 @@ +openapi: 3.0.0 +info: + version: 1.2.0 + title: Npcf_EventExposure + description: | + PCF Event Exposure Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.523 V17.7.0; 5G System; Policy Control Event Exposure Service; Stage 3. + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.523/ + +servers: + - url: '{apiRoot}/npcf-eventexposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - npcf-eventexposure + +paths: + /subscriptions: + post: + summary: Creates a new Individual Policy Control Events Subscription resource + operationId: PostPcEventExposureSubsc + tags: + - Policy Control Events Subscription (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + responses: + '201': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + headers: + Location: + description: > + Contains the URI of the created individual policy control events subscription + resource, according to the structure + {apiRoot}/npcf-eventexposure/v1/subscriptions/{subscriptionId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + PcEventNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureNotif' + responses: + '204': + description: No Content, Notification was succesfull. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subscriptionId}: + get: + summary: "Reads an existing Individual Policy Control Events Subscription" + operationId: GetPcEventExposureSubsc + tags: + - Individual Policy Control Events Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Policy Control Event Subscription ID. + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: "Modifies an existing Individual Policy Control Events Subscription " + operationId: PutPcEventExposureSubsc + tags: + - Individual Policy Control Events Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + parameters: + - name: subscriptionId + in: path + description: Policy Control Event Subscription ID. + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was succesfully modified and representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + '204': + description: No Content. Resource was succesfully modified. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: "Cancels an existing Individual Policy Control Events Subscription " + operationId: DeletePcEventExposureSubsc + tags: + - Individual Policy Control Events Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Policy Control Event Subscription ID. + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was succesfully deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-eventexposure: Access to the Npcf_EventExposure API. + + schemas: + + PcEventExposureNotif: + description: > + Represents notifications about Policy Control events related to an Individual + Policy Events Subscription resource. + type: object + properties: + notifId: + type: string + eventNotifs: + type: array + items: + $ref: '#/components/schemas/PcEventNotification' + minItems: 1 + required: + - notifId + - eventNotifs + + + PcEventExposureSubsc: + description: Represents an Individual Policy Events Subscription resource. + type: object + properties: + eventSubs: + type: array + items: + $ref: '#/components/schemas/PcEvent' + minItems: 1 + eventsRepInfo: + $ref: '#/components/schemas/ReportingInformation' + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + filterDnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + filterSnssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + snssaiDnns: + type: array + items: + $ref: '#/components/schemas/SnssaiDnnCombination' + minItems: 1 + filterServices: + type: array + items: + $ref: '#/components/schemas/ServiceIdentification' + minItems: 1 + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + eventNotifs: + type: array + items: + $ref: '#/components/schemas/PcEventNotification' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - eventSubs + - notifId + - notifUri + + ReportingInformation: + description: Represents the type of reporting that the subscription requires. + type: object + properties: + immRep: + type: boolean + notifMethod: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + monDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + sampRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + partitionCriteria: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PartitioningCriteria' + minItems: 1 + description: Criteria for partitioning the UEs before applying the sampling ratio. + grpRepTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + notifFlag: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationFlag' + + ServiceIdentification: + description: Identifies the service to which the subscription applies. + type: object + properties: + servEthFlows: + type: array + items: + $ref: '#/components/schemas/EthernetFlowInfo' + minItems: 1 + servIpFlows: + type: array + items: + $ref: '#/components/schemas/IpFlowInfo' + minItems: 1 + afAppId: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AfAppId' + # All conditions in allOf must be met + allOf: + # First condition is that servEthFlows and servIpFlows are mutually exclusive + - not: + required: [servEthFlows, servIpFlows] + # Second condition is that at least one the servEthFlows, servIpFlows and afAppId shall be present + - anyOf: + - required: [servEthFlows] + - required: [servIpFlows] + - required: [afAppId] + + EthernetFlowInfo: + description: Identifies an UL/DL ethernet flow. + type: object + properties: + ethFlows: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + flowNumber: + type: integer + required: + - flowNumber + + IpFlowInfo: + description: Identifies an UL/DL IP flow. + type: object + properties: + ipFlows: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + flowNumber: + type: integer + required: + - flowNumber + + PcEventNotification: + description: Represents the information reported for a Policy Control event. + type: object + properties: + event: + $ref: '#/components/schemas/PcEvent' + accType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + addAccessInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AdditionalAccessInfo' + relAccessInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AdditionalAccessInfo' + anGwAddr: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AnGwAddress' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + appliedCov: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/ServiceAreaCoverageInfo' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + pduSessionInfo: + $ref: '#/components/schemas/PduSessionInformation' + repServices: + $ref: '#/components/schemas/ServiceIdentification' + delivFailure: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/Failure' + required: + - event + - timeStamp + + PduSessionInformation: + description: Represents PDU session identification information. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ipDomain: + type: string + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + required: + - snssai + - dnn + oneOf: + - required: [ueMac] + - anyOf: + - required: [ueIpv4] + - required: [ueIpv6] + SnssaiDnnCombination: + description: Represents a combination of S-NSSAI and DNN(s). + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + +# Simple data types and Enumerations + + PcEvent: + description: Represents the policy control events that can be subscribed. + anyOf: + - type: string + enum: + - AC_TY_CH + - PLMN_CH + - SAC_CH + - SAT_CATEGORY_CH + - SUCCESS_UE_POL_DEL_SP + - UNSUCCESS_UE_POL_DEL_SP + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29531_Nnssf_NSSAIAvailability.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29531_Nnssf_NSSAIAvailability.yaml new file mode 100644 index 000000000..5bef7fbd0 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29531_Nnssf_NSSAIAvailability.yaml @@ -0,0 +1,676 @@ +openapi: 3.0.0 + +info: + version: '1.2.0' + title: 'NSSF NSSAI Availability' + description: | + NSSF NSSAI Availability Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - nnssf-nssaiavailability +servers: + - url: '{apiRoot}/nnssf-nssaiavailability/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +externalDocs: + description: 3GPP TS 29.531 V17.5.0; 5G System; Network Slice Selection Services; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.531/ +paths: + /nssai-availability/{nfId}: + put: + summary: Updates/replaces the NSSF with the S-NSSAIs the NF service consumer (e.g AMF)supports per TA + tags: + - NF Instance ID (Document) + operationId: NSSAIAvailabilityPut + parameters: + - name: nfId + in: path + description: Identifier of the NF service consumer instance + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: Parameters to update/replace at the NSSF, the S-NSSAIs supported per TA + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAvailabilityInfo' + responses: + '200': + description: OK (Successful update of SNSSAI information per TA) + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityInfo' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '204': + description: No Content (No supported slices after Successful update) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + patch: + summary: Updates an already existing S-NSSAIs per TA provided by the NF service consumer (e.g AMF) + tags: + - NF Instance ID (Document) + operationId: NSSAIAvailabilityPatch + parameters: + - name: nfId + in: path + description: Identifier of the NF service consumer instance + required: true + schema: + type: string + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: JSON Patch instructions to update at the NSSF, the S-NSSAIs supported per TA + required: true + content: + application/json-patch+json:: + schema: + $ref: '#/components/schemas/PatchDocument' + + responses: + '200': + description: OK (Successful update of SNSSAI information per TA) + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityInfo' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '204': + description: No Content (No supported slices after Successful update) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + + delete: + summary: Deletes an already existing S-NSSAIs per TA provided by the NF service consumer (e.g AMF) + tags: + - NF Instance ID (Document) + operationId: NSSAIAvailabilityDelete + parameters: + - name: nfId + in: path + description: Identifier of the NF service consumer instance + required: true + schema: + type: string + + responses: + '204': + description: No Content (Successful deletion of SNSSAI information per TA) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + + default: + description: Unexpected error + + + /nssai-availability/subscriptions: + post: + summary: Creates subscriptions for notification about updates to NSSAI availability information + tags: + - Subscriptions (Collection) + operationId: NSSAIAvailabilityPost + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: Subscription for notification about updates to NSSAI availability information + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NssfEventSubscriptionCreateData' + callbacks: + nssaiAvailabilityNotification: + '{request.body#/nfNssaiAvailabilityUri}': + post: + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NssfEventNotification' + responses: + '204': + description: No Content (successful notification) + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + + responses: + '201': + description: Created (Successful creation of subscription for notification) + content: + application/json: + schema: + $ref: '#/components/schemas/NssfEventSubscriptionCreatedData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nnssf-nssaiavailability/v1/nssai-availability/subscriptions/{subscriptionId} + required: true + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /nssai-availability/subscriptions/{subscriptionId}: + delete: + summary: Deletes an already existing NSSAI availability notification subscription + tags: + - Subscription ID (Document) + operationId: NSSAIAvailabilityUnsubscribe + parameters: + - name: subscriptionId + in: path + description: Identifier of the subscription for notification + required: true + schema: + type: string + + responses: + '204': + description: No Content (Successful deletion of subscription for NSSAI Availability notification) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + + default: + description: Unexpected error + + patch: + summary: updates an already existing NSSAI availability notification subscription + tags: + - Subscription ID (Document) + operationId: NSSAIAvailabilitySubModifyPatch + parameters: + - name: subscriptionId + in: path + description: Identifier of the subscription for notification + required: true + schema: + type: string + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: JSON Patch instructions to update at the NSSF, the NSSAI availability notification subscription + required: true + content: + application/json-patch+json:: + schema: + $ref: '#/components/schemas/PatchDocument' + + responses: + '200': + description: OK (Successful update of NSSAI availability notification subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/NssfEventSubscriptionCreatedData' + headers: + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /nssai-availability: + options: + summary: Discover communication options supported by NSSF for NSSAI Availability + operationId: NSSAIAvailabilityOptions + tags: + - NSSAI Availability Store + responses: + '200': + description: OK + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnssf-nssaiavailability: Access to the Nnssf_NSSAIAvailability API + + schemas: + NssaiAvailabilityInfo: + description: This contains the Nssai availability information requested by the AMF + type: object + required: + - supportedNssaiAvailabilityData + properties: + supportedNssaiAvailabilityData: + type: array + items: + $ref: '#/components/schemas/SupportedNssaiAvailabilityData' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + amfSetId: + type: string + pattern: '^[0-9]{3}-[0-9]{2-3}-[A-Fa-f0-9]{2}-[0-3][A-Fa-f0-9]{2}$' + + SupportedNssaiAvailabilityData: + description: This contains the Nssai availability data information per TA supported by the AMF + type: object + required: + - tai + - supportedSnssaiList + properties: + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + supportedSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + nsagInfos: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsagInfo' + minItems: 1 + + AuthorizedNssaiAvailabilityData: + description: This contains the Nssai availability data information per TA authorized by the NSSF + type: object + required: + - tai + - supportedSnssaiList + properties: + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + supportedSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + restrictedSnssaiList: + type: array + items: + $ref: '#/components/schemas/RestrictedSnssai' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + nsagInfos: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsagInfo' + minItems: 1 + + RestrictedSnssai: + description: This contains the restricted SNssai information per PLMN + type: object + required: + - homePlmnId + - sNssaiList + properties: + homePlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + sNssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + homePlmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + roamingRestriction: + type: boolean + default: false + + AuthorizedNssaiAvailabilityInfo: + description: This contains the Nssai availability data information authorized by the NSSF + type: object + required: + - authorizedNssaiAvailabilityData + properties: + authorizedNssaiAvailabilityData: + type: array + items: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityData' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + NssfEventSubscriptionCreateData: + description: This contains the information for event subscription + type: object + required: + - nfNssaiAvailabilityUri + - taiList + - event + properties: + nfNssaiAvailabilityUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + event: + $ref: '#/components/schemas/NssfEventType' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + amfSetId: + type: string + pattern: '^[0-9]{3}-[0-9]{2-3}-[A-Fa-f0-9]{2}-[0-3][A-Fa-f0-9]{2}$' + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + NssfEventSubscriptionCreatedData: + description: This contains the information for created event subscription + type: object + required: + - subscriptionId + properties: + subscriptionId: + type: string + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + authorizedNssaiAvailabilityData: + type: array + items: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityData' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + NssfEventNotification: + description: This contains the notification for created event subscription + type: object + required: + - subscriptionId + - authorizedNssaiAvailabilityData + properties: + subscriptionId: + type: string + authorizedNssaiAvailabilityData: + type: array + items: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityData' + NssfEventType: + description: This contains the event for the subscription + anyOf: + - type: string + enum: + - SNSSAI_STATUS_CHANGE_REPORT + - type: string + PatchDocument: + description: This contains the JSON Patch instructions for updating the Nssai availability data information at the NSSF + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29531_Nnssf_NSSelection.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29531_Nnssf_NSSelection.yaml new file mode 100644 index 000000000..695e895d1 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29531_Nnssf_NSSelection.yaml @@ -0,0 +1,426 @@ +openapi: 3.0.0 + +info: + version: '2.2.0' + title: 'NSSF NS Selection' + description: | + NSSF Network Slice Selection Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - nnssf-nsselection +servers: + - url: '{apiRoot}/nnssf-nsselection/v2' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +externalDocs: + description: 3GPP TS 29.531 V17.5.0; 5G System; Network Slice Selection Services; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.531/ +paths: + /network-slice-information: + get: + summary: Retrieve the Network Slice Selection Information + tags: + - Network Slice Information (Document) + operationId: NSSelectionGet + parameters: + - name: nf-type + in: query + description: NF type of the NF service consumer + required: true + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - name: nf-id + in: query + description: NF Instance ID of the NF service consumer + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: slice-info-request-for-registration + in: query + description: Requested network slice information during Registration procedure + content: + application/json: + schema: + $ref: '#/components/schemas/SliceInfoForRegistration' + - name: slice-info-request-for-pdu-session + in: query + description: Requested network slice information during PDU session establishment procedure + content: + application/json: + schema: + $ref: '#/components/schemas/SliceInfoForPDUSession' + - name: slice-info-request-for-ue-cu + in: query + description: Requested network slice information during UE confuguration update procedure + content: + application/json: + schema: + $ref: '#/components/schemas/SliceInfoForUEConfigurationUpdate' + - name: home-plmn-id + in: query + description: PLMN ID of the HPLMN + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: tai + in: query + description: TAI of the UE + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + - name: supported-features + in: query + description: Features required to be supported by the NFs in the target slice instance + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + responses: + '200': + description: OK (Successful Network Slice Selection) + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizedNetworkSliceInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnssf-nsselection: Access to the Nnssf_NSSelection API + schemas: + AuthorizedNetworkSliceInfo: + description: Contains the authorized network slice information + type: object + properties: + allowedNssaiList: + type: array + items: + $ref: '#/components/schemas/AllowedNssai' + minItems: 1 + configuredNssai: + type: array + items: + $ref: '#/components/schemas/ConfiguredSnssai' + minItems: 1 + targetAmfSet: + type: string + pattern: '^[0-9]{3}-[0-9]{2-3}-[A-Fa-f0-9]{2}-[0-3][A-Fa-f0-9]{2}$' + candidateAmfList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + rejectedNssaiInPlmn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + rejectedNssaiInTa: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nsiInformation: + $ref: '#/components/schemas/NsiInformation' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nrfAmfSet: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAmfSetNfMgtUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAmfSetAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfOauth2Required: + type: object + description: > + Map indicating whether the NRF requires Oauth2-based authorization for accessing + its services. The key of the map shall be the name of an NRF service, + e.g. "nnrf-nfm" or "nnrf-disc" + additionalProperties: + type: boolean + minProperties: 1 + targetAmfServiceSet: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + targetNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nsagInfos: + type: array + items: + $ref: '#/components/schemas/NsagInfo' + minItems: 1 + + SubscribedSnssai: + description: Contains the subscribed S-NSSAI + type: object + required: + - subscribedSnssai + properties: + subscribedSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + defaultIndication: + type: boolean + subscribedNsSrgList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NsSrg' + minItems: 1 + + + AllowedSnssai: + description: > + Contains the authorized S-NSSAI and optional mapped home S-NSSAI and + network slice instance information + type: object + required: + - allowedSnssai + properties: + allowedSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiInformationList: + type: array + items: + $ref: '#/components/schemas/NsiInformation' + minItems: 1 + mappedHomeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + AllowedNssai: + description: > + Contains an array of allowed S-NSSAI that constitute the allowed NSSAI information + for the authorized network slice information + type: object + required: + - allowedSnssaiList + - accessType + properties: + allowedSnssaiList: + type: array + items: + $ref: '#/components/schemas/AllowedSnssai' + minItems: 1 + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + NsiInformation: + description: > + Contains the API URIs of NRF services to be used to discover NFs/services, + subscribe to NF status changes and/or request access tokens within the selected + Network Slice instance and optional the Identifier of the selected Network Slice instance + type: object + required: + - nrfId + properties: + nrfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nsiId: + $ref: '#/components/schemas/NsiId' + nrfNfMgtUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfOauth2Required: + type: object + description: > + Map indicating whether the NRF requires Oauth2-based authorization for accessing + its services. The key of the map shall be the name of an NRF service, + e.g. "nnrf-nfm" or "nnrf-disc" + additionalProperties: + type: boolean + minProperties: 1 + + MappingOfSnssai: + description: Contains the mapping of S-NSSAI in the serving network and the value of the home network + type: object + required: + - servingSnssai + - homeSnssai + properties: + servingSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + homeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + + SliceInfoForRegistration: + description: Contains the slice information requested during a Registration procedure + type: object + properties: + subscribedNssai: + type: array + items: + $ref: '#/components/schemas/SubscribedSnssai' + minItems: 1 + allowedNssaiCurrentAccess: + $ref: '#/components/schemas/AllowedNssai' + allowedNssaiOtherAccess: + $ref: '#/components/schemas/AllowedNssai' + sNssaiForMapping: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + requestedNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + defaultConfiguredSnssaiInd: + type: boolean + default: false + mappingOfNssai: + type: array + items: + $ref: '#/components/schemas/MappingOfSnssai' + minItems: 1 + requestMapping: + type: boolean + ueSupNssrgInd: + type: boolean + suppressNssrgInd: + type: boolean + nsagSupported: + type: boolean + default: false + + SliceInfoForPDUSession: + description: Contains the slice information requested during PDU Session establishment procedure + type: object + required: + - sNssai + - roamingIndication + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + roamingIndication: + $ref: '#/components/schemas/RoamingIndication' + homeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + SliceInfoForUEConfigurationUpdate: + description: Contains the slice information requested during UE configuration update procedure + type: object + properties: + subscribedNssai: + type: array + items: + $ref: '#/components/schemas/SubscribedSnssai' + minItems: 1 + allowedNssaiCurrentAccess: + $ref: '#/components/schemas/AllowedNssai' + allowedNssaiOtherAccess: + $ref: '#/components/schemas/AllowedNssai' + defaultConfiguredSnssaiInd: + type: boolean + requestedNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + mappingOfNssai: + type: array + items: + $ref: '#/components/schemas/MappingOfSnssai' + minItems: 1 + ueSupNssrgInd: + type: boolean + suppressNssrgInd: + type: boolean + rejectedNssaiRa: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nsagSupported: + type: boolean + default: false + + ConfiguredSnssai: + description: Contains the configured S-NSSAI(s) authorized by the NSSF in the serving PLMN and optional mapped home S-NSSAI + type: object + required: + - configuredSnssai + properties: + configuredSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + mappedHomeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + NsagInfo: + description: Contains the association of NSAGs and S-NSSAI(s) along with the TA(s) within which the association is valid. + type: object + required: + - nsagIds + - snssaiList + properties: + nsagIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NsagId' + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + + RoamingIndication: +# description: Contains the indication on roaming +# anyOf: +# - type: string + enum: + - NON_ROAMING + - LOCAL_BREAKOUT + - HOME_ROUTED_ROAMING +# - type: string + NsiId: + description: Contains the Identifier of the selected Network Slice instance + type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29534_Npcf_AMPolicyAuthorization.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29534_Npcf_AMPolicyAuthorization.yaml new file mode 100644 index 000000000..b643f8ead --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29534_Npcf_AMPolicyAuthorization.yaml @@ -0,0 +1,719 @@ +openapi: 3.0.0 +info: + title: Npcf_AMPolicyAuthorization Service API + version: 1.0.2 + description: | + PCF Access and Mobility Policy Authorization Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.534 V17.3.0; + 5G System; Access and Mobility Policy Authorization Service; Stage 3. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.534/' +# +servers: + - url: '{apiRoot}/npcf-am-policyauthorization/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +# +security: + - {} + - oAuth2ClientCredentials: + - npcf-am-policyauthorization +paths: + /app-am-contexts: + post: + summary: Creates a new Individual Application AM Context resource + operationId: PostAppAmContexts + tags: + - Application AM contexts (Collection) + requestBody: + description: Contains the information for the creation the resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextData' + responses: + '201': + description: Successful creation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextRespData' + headers: + Location: + description: > + Contains the URI of the created individual application AM context resource, + according to the structure + {apiRoot}/npcf-am-policyauthorization//app-am-contexts/{appAmContextId} + or the URI of the created AM Policy events subscription subresource, + according to the structure + {apiRoot}/npcf-am-policyauthorization//app-am-contexts/{appAmContextId}/events-subscription} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + terminationRequest: + '{$request.body#/termNotifUri}': + post: + requestBody: + description: Request of the termination of the Individual Application AM Context. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmTerminationInfo' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + amEventNotification: + '{$request.body#/evSubsc/eventNotifUri}': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-am-contexts/{appAmContextId}: + get: + summary: "Reads an existing Individual Application AM Context" + operationId: GetAppAmContext + tags: + - Individual Application AM Context (Document) + parameters: + - name: appAmContextId + description: String identifying the resource. + in: path + required: true + schema: + type: string + responses: + '200': + description: A representation of the resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + patch: + summary: "Modifies an existing Individual Application AM Context" + operationId: ModAppAmContext + tags: + - Individual Application AM Context (Document) + parameters: + - name: appAmContextId + description: String identifying the resource. + in: path + required: true + schema: + type: string + requestBody: + description: Modification of the resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppAmContextUpdateData' + responses: + '200': + description: > + Successful modification of the resource and a representation of that resource is + returned. If a subscribed event is matched, the event notification is also included + in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextRespData' + '204': + description: The successful modification. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + amEventNotification: + '{$request.body#/evSubsc/eventNotifUri}': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + delete: + summary: Deletes an existing Individual Application AM Context + operationId: DeleteAppAmContext + tags: + - Individual Application AM Context (Document) + parameters: + - name: appAmContextId + description: String identifying the Individual Application AM Context resource. + in: path + required: true + schema: + type: string + responses: + '204': + description: The deletion is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-am-contexts/{appAmContextId}/events-subscription: + put: + summary: creates or modifies an AM Policy Events Subscription subresource. + operationId: updateAmEventsSubsc + tags: + - AM Policy Events Subscription (Document) + parameters: + - name: appAmContextId + description: String identifying the AM Policy Events Subscription subresource. + in: path + required: true + schema: + type: string + requestBody: + description: Creation or modification of an AM Policy Events Subscription subresource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsSubscData' + responses: + '201': + description: > + The creation of the AM Policy Events Subscription subresource is confirmed and its + representation is returned. If an AM Event is matched, the response also includes the + notification. + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsSubscRespData' + headers: + Location: + description: > + Contains the URI of the created AM Policy Events Subscription subresource, + according to the structure + {apiRoot}/npcf-am-policyauthorization//app-am-contexts/{appAmContextId}/events-subscription} + required: true + schema: + type: string + '200': + description: The modification of the AM Policy Events Subscription subresource is confirmed and its representation is returned. If an AM Event is matched, the response also includes the notification. + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsSubscRespData' + '204': + description: The modification of the AM Policy Events Subscription subresource is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + amEventNotification: + '{$request.body#/evSubsc/eventNotifUri}': + post: + requestBody: + description: Contains the information for the notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: deletes the AM Policy Events Subscription subresource + operationId: DeleteAmEventsSubsc + tags: + - AM Policy Events Subscription (Document) + parameters: + - name: appAmContextId + description: String identifying the Individual Application AM Context resource. + in: path + required: true + schema: + type: string + responses: + '204': + description: The deletion of the of the AM Policy Events Subscription subresource is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# +# +components: +# + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-am-policyauthorization: Access to the Npcf_AMPolicyAuthorization API +# + schemas: +# + AppAmContextData: + description: Represents an Individual Application AM Context resource. + type: object + required: + - supi + - termNotifUri + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + termNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + evSubsc: + $ref: '#/components/schemas/AmEventsSubscData' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + highThruInd: + type: boolean + description: Indicates whether high throughput is desired for the indicated UE traffic. + covReq: + type: array + description: Identifies a list of Tracking Areas per serving network where service is allowed. + items: + $ref: '#/components/schemas/ServiceAreaCoverageInfo' + minItems: 1 + asTimeDisParam: + $ref: 'TS29507_Npcf_AMPolicyControl.yaml#/components/schemas/AsTimeDistributionParam' + anyOf: + - anyOf: + - required: [highThruInd] + - required: [covReq] + - required: [asTimeDisParam] + - required: [evSubsc] +# +# + AppAmContextUpdateData: + description: Describes the modifications to an Individual Application AM resource. + type: object + properties: + termNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + evSubsc: + $ref: '#/components/schemas/AmEventsSubscDataRm' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + highThruInd: + description: Indicates whether high throughput is desired for the indicated UE traffic. + type: boolean + nullable: true + covReq: + type: array + description: Identifies a list of Tracking Areas per serving network where service is allowed. + items: + $ref: '#/components/schemas/ServiceAreaCoverageInfo' + minItems: 1 + nullable: true + asTimeDisParam: + $ref: 'TS29507_Npcf_AMPolicyControl.yaml#/components/schemas/AsTimeDistributionParam' +# + AmEventsSubscData: + description: It represents the AM Policy Events Subscription subresource and identifies the events the application subscribes to. + type: object + required: + - eventNotifUri + properties: + eventNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + events: + type: array + items: + $ref: '#/components/schemas/AmEventData' + minItems: 1 +# + AmEventsNotification: + description: Describes the notification about the events occurred within an Individual Application AM Context resource. + type: object + required: + - repEvents + properties: + appAmContextId: + type: string + description: Contains the AM Policy Events Subscription resource identifier related to the event notification. + repEvents: + type: array + items: + $ref: '#/components/schemas/AmEventNotification' + minItems: 1 +# + AmTerminationInfo: + description: Includes information related to the termination of the Individual Application AM Context resource. + type: object + required: + - appAmContextId + - termCause + properties: + appAmContextId: + type: string + description: Contains the Individual application AM context resource identifier related to the termination notification. + termCause: + $ref: '#/components/schemas/AmTerminationCause' +# + AmEventsSubscDataRm: + description: This data type is defined in the same way as the AmEventsSubscData but with the OpenAPI nullable property set to true. + type: object + properties: + eventNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + events: + type: array + items: + $ref: '#/components/schemas/AmEventData' + minItems: 1 + nullable: true +# + AmEventData: + description: This data type contains the event identifier and the related event reporting information. + type: object + required: + - event + properties: + event: + $ref: '#/components/schemas/AmEvent' + immRep: + type: boolean + notifMethod: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + monDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' +# + AmEventNotification: + description: Describes the notification of a subscription. + type: object + required: + - event + properties: + event: + $ref: '#/components/schemas/AmEvent' + appliedCov: + $ref: '#/components/schemas/ServiceAreaCoverageInfo' + pduidInfo: + $ref: '#/components/schemas/PduidInformation' +# + PduidInformation: + description: Contains the ProSe Discovery UE ID and its validity timer. + type: object + required: + - expiry + - pduid + properties: + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + pduid: + $ref: 'TS29555_N5g-ddnmf_Discovery.yaml#/components/schemas/Pduid' +# + ServiceAreaCoverageInfo: + description: It represents a list of Tracking Areas within a serving network. + type: object + required: + - tacList + properties: + tacList: + type: array + description: Indicates a list of Tracking Areas where the service is allowed. + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tac' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' +# +# ENUMERATIONS DATA TYPES +# + AmTerminationCause: + description: It represents the cause values that the PCF should report when requesting to an NF service consumer the deletion of an "AF application AM context" resource. + anyOf: + - type: string + enum: + - UE_DEREGISTERED + - UNSPECIFIED + - INSUFFICIENT_RESOURCES + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. +# + AmEvent: + anyOf: + - type: string + enum: + - SAC_CH + - PDUID_CH + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - SAC_CH: Service Area Coverage Change + - PDUID_CH: The PDUID assigned to a UE for the UE ProSe Policies changed +# +# + AppAmContextRespData: + description: It represents a response to a modification or creation request of an Individual Application AM resource. It may contain the notification of the already met events. + anyOf: + - $ref: '#/components/schemas/AppAmContextData' + - $ref: '#/components/schemas/AmEventsNotification' +# + AmEventsSubscRespData: + description: Identifies the events the application subscribes to within an AM Policy Events Subscription subresource data. It may contain the notification of the already met events. + anyOf: + - $ref: '#/components/schemas/AmEventsSubscData' + - $ref: '#/components/schemas/AmEventsNotification' +# \ No newline at end of file diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29544_Nspaf_SecuredPacket.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29544_Nspaf_SecuredPacket.yaml new file mode 100644 index 000000000..4c39f1f62 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29544_Nspaf_SecuredPacket.yaml @@ -0,0 +1,113 @@ +openapi: 3.0.0 +info: + title: 'Nspaf_SecuredPacket' + version: '1.1.0' + description: | + Nspaf Secured Packet Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.544, SP-AF Services, version V17.3.0 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.544/ +servers: + - url: '{apiRoot}/nspaf-secured-packet/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nspaf-secured-packet +paths: + /{supi}/provide-secured-packet: + post: + summary: request generation of a secured packet + operationId: ProvideSecuredPacket + tags: + - SecuredPacket Generation (Custom Operation) + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UiccConfigurationParameter' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SecuredPacket' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nspaf-secured-packet: Access to the nspaf-secured-packet API + schemas: + +# COMPLEX TYPES: + + UiccConfigurationParameter: + description: Represents UICC Configuration Parameters. + type: object + oneOf: + - required: [routingId ] + - required: [steeringContainer ] + - required: [extendedSteeringContainer ] + properties: + routingId: + $ref: '#/components/schemas/RoutingId' + steeringContainer: + type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + extendedSteeringContainer: + $ref: '#/components/schemas/ExtendedSteeringContainer' + + ExtendedSteeringContainer: + description: Represents Extended Steering Containers. + type: object + properties: + steeringContainer: + type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + sorCmci: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SorCmci' + storeSorCmciInMe: + type: boolean + +# SIMPLE TYPES: + + RoutingId: + description: Represents a routing indicator. + type: string + pattern: '^[0-9]{1,4}$' + +# ENUMS: + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29551_Nnef_PFDmanagement.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29551_Nnef_PFDmanagement.yaml new file mode 100644 index 000000000..8d15b71ff --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29551_Nnef_PFDmanagement.yaml @@ -0,0 +1,585 @@ +openapi: 3.0.0 +info: + title: Nnef_PFDmanagement Service API + version: 1.2.1 + description: | + Packet Flow Description Management Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +# +externalDocs: + description: 3GPP TS 29.551 v17.8.0, 5G System; Packet Flow Description Management Service + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.551/' +# +servers: + - url: '{apiRoot}/nnef-pfdmanagement/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nnef-pfdmanagement +paths: + /applications: + get: + summary: Retrieve PFDs for all applications or for one or multiple applications with query parameter. + tags: + - PFD of applications + operationId: Nnef_PFDmanagement_AllFetch + parameters: + - name: application-ids + description: The required application identifier(s) for the returned PFDs. + in: query + required: true + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + - name: supported-features + in: query + description: To filter irrelevant responses related to unsupported features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + The PFDs for one or more application identifier(s) in the request URI are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdDataForApp' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /applications/partialpull: + post: + summary: retrieve the PFD(s) by partial update + operationId: Nnef_PFDmanagement_AppFetchPartialUpdate + tags: + - PFD of applications by partial update + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApplicationForPfdRequest' + minItems: 1 + responses: + '200': + description: OK. Changed PFD(s) is returned + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdDataForApp' + minItems: 1 + '204': + description: The PFD(s) is not changed + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /applications/{appId}: + get: + summary: Retrieve the PFD for an application. + tags: + - Individual application PFD + operationId: Nnef_PFDmanagement_IndAppFetch + parameters: + - name: appId + description: The required application identifier(s) for the returned PFDs. + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: To filter irrelevant responses related to unsupported features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: A representation of PFDs for an application in the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForApp' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions: + post: + summary: Subscribe the notification of PFD changes. + tags: + - PFD subscriptions + operationId: Nnef_PFDmanagement_CreateSubscr + requestBody: + description: a PfdSubscription resource to be created. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' + callbacks: + PfdChangeNotification: + '{request.body#/notifyUri}': + post: + summary: Notification of PFD change. + tags: + - PfdChangeNotification data + operationId: Nnef_PFDmanagement_Notify + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdChangeNotification' + minItems: 1 + responses: + '200': + description: > + The PFD operation in the notification is performed and the + PfdChangeReport indicates failure reason. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdChangeReport' + minItems: 1 + '204': + description: The PFD operation in the notification is performed successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + NotificationPush: + '{request.body#/notifyUri}/notifypush': + post: + summary: Notification Push. + tags: + - NotificationPush data + operationId: Nnef_PFDmanagement_PushNotify + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationPush' + minItems: 1 + responses: + '204': + description: Notificaiton PUSH is accepted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + responses: + '201': + description: > + The creation of a PfdSubscription resource is confirmed and a representation of + that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnef-pfdmanagement/v1/subscriptions/{subscriptionId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions/{subscriptionId}: + put: + summary: Updates/replaces an existing subscription resource + tags: + - Individual PFD subscription + operationId: Nnef_PFDmanagement_ModifySubscr + parameters: + - name: subscriptionId + description: Identify the subscription. + in: path + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete a subscription of PFD change notification. + tags: + - Individual PFD subscription + operationId: Nnef_PFDmanagement_Unsubscribe + parameters: + - name: subscriptionId + description: Identify the subscription. + in: path + required: true + schema: + type: string + responses: + '204': + description: > + The PfdSubscription resource matching the subscriptionId was deleted successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnef-pfdmanagement: Access to the Nnef_PFDmanagement API + schemas: +# +# STRUCTURED DATA TYPES +# + PfdContent: + description: Represents the content of a PFD for an application identifier. + type: object + properties: + pfdId: + type: string + description: Identifies a PDF of an application identifier. + flowDescriptions: + type: array + items: + type: string + minItems: 1 + description: > + Represents a 3-tuple with protocol, server ip and server port for UL/DL + application traffic. + urls: + type: array + items: + type: string + minItems: 1 + description: > + Indicates a URL or a regular expression which is used to match the significant parts + of the URL. + domainNames: + type: array + items: + type: string + minItems: 1 + description: Indicates an FQDN or a regular expression as a domain name matching criteria. + dnProtocol: + $ref: 'TS29122_PfdManagement.yaml#/components/schemas/DomainNameProtocol' + + PfdDataForApp: + description: Represents the PFDs for an application identifier. + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + pfds: + type: array + items: + $ref: '#/components/schemas/PfdContent' + minItems: 1 + cachingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + cachingTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + pfdTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + partialFlag: + type: boolean + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - applicationId + + PfdSubscription: + description: Represents a PFD subscription. + type: object + properties: + applicationIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - notifyUri + - supportedFeatures + + PfdChangeNotification: + description: Represents information related to a notification of PFD change. + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + removalFlag: + type: boolean + default: false + partialFlag: + type: boolean + default: false + pfds: + type: array + items: + $ref: '#/components/schemas/PfdContent' + minItems: 1 + required: + - applicationId + + NotificationPush: + description: > + Represents the information to be used by the NF service consumer to retrieve the + PFDs and/or remove the PFDs of the applicable application identifier(s). + type: object + properties: + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + allowedDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + pfdOp: + $ref: '#/components/schemas/PfdOperation' + required: + - appIds + + PfdChangeReport: + description: Represents an error report on PFD change. + type: object + properties: + pfdError: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + applicationId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + required: + - pfdError + - applicationId + + PfdOperation: + description: Indicates the operation to be applied on PFD(s). + anyOf: + - type: string + enum: + - RETRIEVE + - FULLPULL + - PARTIALPULL + - REMOVE + - type: string + + ApplicationForPfdRequest: + description: Contains the application identifier(s) for the PFD(s) request. + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + pfdTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - applicationId diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29554_Npcf_BDTPolicyControl.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29554_Npcf_BDTPolicyControl.yaml new file mode 100644 index 000000000..8f46a658d --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29554_Npcf_BDTPolicyControl.yaml @@ -0,0 +1,434 @@ +openapi: 3.0.0 + +info: + title: Npcf_BDTPolicyControl Service API + version: 1.2.0 + description: | + PCF BDT Policy Control Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.554 V17.4.0; 5G System; Background Data Transfer Policy Control Service. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.554/' + +servers: + - url: '{apiRoot}/npcf-bdtpolicycontrol/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - npcf-bdtpolicycontrol + +paths: + /bdtpolicies: + post: + summary: Create a new Individual BDT policy + operationId: CreateBDTPolicy + tags: + - BDT policies (Collection) + requestBody: + description: > + Contains information for the creation of a new Individual BDT policy resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BdtReqData' + responses: + '201': + description: Background data transfer policies offered to an ASP. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' + headers: + Location: + description: > + Contains the URI of the created individual BDT policy resource, + according to the structure + {apiRoot}/npcf-bdtpolicycontrol/v1/bdtpolicies/{bdtPolicyId} + required: true + schema: + type: string + '303': + description: > + See Other. The result of the POST request would be equivalent to the + existing Individual BDT policy resource. + headers: + Location: + description: Contains the URI of the existing individual BDT policy resource. + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + BdtNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Notification' + responses: + '204': + description: No Content, a reception of the BDT notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /bdtpolicies/{bdtPolicyId}: + get: + summary: Read an Individual BDT policy + operationId: GetBDTPolicy + tags: + - Individual BDT policy (Document) + parameters: + - name: bdtPolicyId + description: String identifying the individual BDT policy resource in the PCF. + in: path + required: true + schema: + type: string + responses: + '200': + description: Background data transfer policies offered to and selected by an ASP. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Update an Individual BDT policy + operationId: UpdateBDTPolicy + tags: + - Individual BDT policy (Document) + parameters: + - name: bdtPolicyId + description: String identifying the individual BDT policy resource in the PCF. + in: path + required: true + schema: + type: string + requestBody: + description: > + Contains modification instruction to be performed on the BdtPolicy data + structure to select a transfer policy and in addition, may indicate whether + the BDT warning notification is enabled or disabled. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PatchBdtPolicy' + responses: + '200': + description: > + The Individual BDT Policy resource is modified and a representation of that + resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' + '204': + description: The Individual BDT Policy resource is modified. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-bdtpolicycontrol: Access to the Npcf_BDTPolicyControl API + + schemas: + +# Structured data types + + BdtPolicy: + description: Represents an Individual BDT policy resource. + type: object + properties: + bdtPolData: + $ref: '#/components/schemas/BdtPolicyData' + bdtReqData: + $ref: '#/components/schemas/BdtReqData' + + BdtReqData: + description: > + Contains service requirements for creation a new Individual BDT policy resource. + type: object + required: + - aspId + - desTimeInt + - numOfUes + - volPerUe + properties: + aspId: + $ref: '#/components/schemas/AspId' + desTimeInt: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + numOfUes: + description: Indicates a number of UEs. + type: integer + volPerUe: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + trafficDes: + $ref: 'TS29122_ResourceManagementOfBdt.yaml#/components/schemas/TrafficDescriptor' + warnNotifReq: + description: Indicates whether the BDT warning notification is enabled or disabled. + type: boolean + default: false + + BdtPolicyData: + description: Describes the authorization data of an Individual BDT policy resource. + type: object + required: + - bdtRefId + - transfPolicies + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + transfPolicies: + description: Contains transfer policies. + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + selTransPolicyId: + description: Contains an identity of the selected transfer policy. + type: integer + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + PatchBdtPolicy: + description: > + Describes the updates in authorization data of an Individual BDT Policy created + by the PCF. + type: object + properties: + bdtPolData: + $ref: '#/components/schemas/BdtPolicyDataPatch' + bdtReqData: + $ref: '#/components/schemas/BdtReqDataPatch' + + BdtPolicyDataPatch: + description: > + A JSON Merge Patch body schema containing modification instruction to be performed + on the bdtPolData attribute of the BdtPolicy data structure to select a transfer + policy. Adds selTransPolicyId to BdtPolicyData data structure. + type: object + required: + - selTransPolicyId + properties: + selTransPolicyId: + description: > + Contains an identity (i.e. transPolicyId value) of the selected transfer + policy. If the BdtNotification_5G feature is supported value 0 indicates that + no transfer policy is selected. + type: integer + + BdtReqDataPatch: + description: > + A JSON Merge Patch body schema containing modification instruction to be performed + on the bdtReqData attribute of the BdtPolicy data structure to indicate whether + the BDT warning notification is enabled or disabled. Modifies warnNotifReq from + BdtReqData data structure. + type: object + properties: + warnNotifReq: + description: Indicates whether the BDT warning notification is enabled or disabled. + type: boolean + + TransferPolicy: + description: Describes a transfer policy. + type: object + required: + - ratingGroup + - recTimeInt + - transPolicyId + properties: + maxBitRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxBitRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + ratingGroup: + description: Indicates a rating group for the recommended time window. + type: integer + recTimeInt: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + transPolicyId: + description: Contains an identity of a transfer policy. + type: integer + + NetworkAreaInfo: + description: > + Describes a network area information in which the NF service consumer requests + the number of UEs. + type: object + properties: + ecgis: + description: Contains a list of E-UTRA cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + ncgis: + description: Contains a list of NR cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + gRanNodeIds: + description: Contains a list of NG RAN nodes. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + tais: + description: Contains a list of tracking area identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + Notification: + description: Describes a BDT notification. + type: object + required: + - bdtRefId + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + candPolicies: + description: > + Contains a list of the candidate transfer policies from which the AF may + select a new transfer policy due to a network performance is below the criteria + set by the operator. + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + timeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + +# Simple data types + + AspId: + description: Contains an identity of an application service provider. + type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_gbaSDM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_gbaSDM.yaml new file mode 100644 index 000000000..47989f6a7 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_gbaSDM.yaml @@ -0,0 +1,383 @@ +openapi: 3.0.0 + +info: + version: '1.0.0' + title: 'Nhss_gbaSDM' + description: | + Nhss Subscriber Data Management Service for GBA. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 Home Subscriber Server (HSS) Services, version 17.5.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-gba-sdm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + +paths: + /{ueId}/subscriber-data: + get: + summary: Retrieve the subscriber data of a user + operationId: GetSubscriberData + tags: + - Subscriber Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + - oAuth2ClientCredentials: + - nhss-gba-sdm + - nhss-gba-sdm:subscriber-data:read + parameters: + - name: ueId + in: path + description: UE Identity + required: true + schema: + $ref: '#/components/schemas/UeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GbaSubscriberData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{ueId}/subscriptions: + post: + summary: Subscribe to notifications + operationId: GbaSdmSubscribe + tags: + - GBA SDM Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + - oAuth2ClientCredentials: + - nhss-gba-sdm + - nhss-gba-sdm:subscriptions:create + parameters: + - name: ueId + in: path + description: UE Identity + required: true + schema: + $ref: '#/components/schemas/UeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GbaSdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GbaSdmSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-gba-sdm//{ueId}/subscriptions/{subscriptionId} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{ueId}/subscriptions/{subscriptionId}: + delete: + summary: Unsubscribe from notifications + operationId: GbaSdmUnsubscribe + tags: + - GBA SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + - oAuth2ClientCredentials: + - nhss-gba-sdm + - nhss-gba-sdm:subscription:modify + parameters: + - name: ueId + in: path + description: UE Identity + required: true + schema: + $ref: '#/components/schemas/UeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the subscription + operationId: GbaSdmSubsModify + tags: + - GBA SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + - oAuth2ClientCredentials: + - nhss-gba-sdm + - nhss-gba-sdm:subscription:modify + parameters: + - name: ueId + in: path + description: UE Identity + required: true + schema: + $ref: '#/components/schemas/UeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful modification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-gba-sdm: Access to the Nhss GBA Subscription Data Management API + nhss-gba-sdm:subscriber-data:read: Access to read the GBA Subscriber Data resource + nhss-gba-sdm:subscriptions:create: Access to create Subscriptions resources + nhss-gba-sdm:subscription:modify: Access to update/delete a Subscription resource + + schemas: + +# +# COMPLEX TYPES: +# + + GbaSubscriberData: + description: > + GBA subscriber data of the UE; it includes the GBA User Security Settings (GUSS) data + type: object + properties: + guss: + $ref: '#/components/schemas/Guss' + + Guss: + description: > + GBA User Security Settings of the UE; it includes information about the BSF, + and a list of User Security Settings + type: object + properties: + bsfInfo: + $ref: '#/components/schemas/BsfInfo' + ussList: + type: array + items: + $ref: 'TS29309_Nbsp_GBA.yaml#/components/schemas/UssListItem' + minItems: 1 + + BsfInfo: + description: > + Information about the BSF; it includes an indication of whether GBA or GBA_U is to be used, + the key lifetime and a user-specific list of security features + type: object + properties: + uiccType: + $ref: '#/components/schemas/UiccType' + lifeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + securityFeatures: + type: array + items: + $ref: 'TS29309_Nbsp_GBA.yaml#/components/schemas/SecFeature' + minItems: 1 + + GbaSdmSubscription: + description: > + Information about a subscription created in the HSS, so the consumer (e.g. BSF) can be + notified when there are changes on the monitored data + type: object + required: + - nfInstanceId + - callbackReference + - monitoredResourceUris + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + +# +# SIMPLE TYPES: +# + + UeId: + description: UE ID can be MSISDN, IMSI, IMPI or IMPU + anyOf: + - $ref: '#/components/schemas/Msisdn' + - $ref: '#/components/schemas/Imsi' + - $ref: 'TS29562_Nhss_imsSDM.yaml#/components/schemas/ImsUeId' + + Msisdn: + description: MS-ISDN of the UE + type: string + pattern: '^msisdn-[0-9]{5,15}$' + + Imsi: + description: IMSI of the UE + type: string + pattern: '^imsi-[0-9]{5,15}$' + +# +# ENUMS: +# + + UiccType: + description: Indicates whether GBA or GBA_U is to be used + anyOf: + - type: string + enum: + - GBA + - GBA_U + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_gbaUEAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_gbaUEAU.yaml new file mode 100644 index 000000000..fb67f78d2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_gbaUEAU.yaml @@ -0,0 +1,184 @@ +openapi: 3.0.0 + +info: + version: '1.0.0' + title: 'Nhss_gbaUEAU' + description: | + Nhss UE Authentication Service for GBA. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 Home Subscriber Server (HSS) Services, version 17.5.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-gba-ueau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nhss-gba-ueau + - {} + +paths: + /{ueId}/security-information/generate-auth-data: + post: + summary: Generate GBA authentication data for the UE + operationId: GenerateAuthData + tags: + - Generate Auth Data (Custom Operation) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-ueau + - oAuth2ClientCredentials: + - nhss-gba-ueau + - nhss-gba-ueau:generate-auth-data:invoke + parameters: + - name: ueId + in: path + description: UE identity of the user + required: true + schema: + $ref: '#/components/schemas/UeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoResult' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-gba-ueau: Access to the nhss-gba-ueau API + nhss-gba-ueau:generate-auth-data:invoke: > + Access to invoke the Generate Auth Data custom operation + + schemas: + +# +# COMPLEX TYPES: +# + + AuthenticationInfoRequest: + description: > + Contains input data to the authentication request message (e.g. authentication + scheme, resynchronization information) + type: object + properties: + authenticationScheme: + $ref: '#/components/schemas/AuthenticationScheme' + resynchronizationInfo: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/ResynchronizationInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + AuthenticationInfoResult: + description: > + Contains authentication information returned in the authentication response message + (e.g. authentication vector, digest authentication parameters) + type: object + properties: + impi: + $ref: '#/components/schemas/Impi' + 3gAkaAv: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/3GAkaAv' + digestAuth: + $ref: '#/components/schemas/DigestAuthentication' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + DigestAuthentication: + description: Parameters used for the Digest authentication scheme + type: object + required: + - digestRealm + - digestAlgorithm + - digestQop + - ha1 + properties: + digestRealm: + type: string + digestAlgorithm: + $ref: '#/components/schemas/DigestAlgorithm' + digestQop: + $ref: '#/components/schemas/DigestQop' + ha1: + type: string + +# +# SIMPLE TYPES: +# + + UeId: + $ref: 'TS29562_Nhss_gbaSDM.yaml#/components/schemas/UeId' + + Impi: + description: IMS Private Identity of the UE + type: string + +# +# ENUMS: +# + + AuthenticationScheme: + description: Authentication scheme to be used in the authentication request message + anyOf: + - type: string + enum: + - DIGEST_AKAV1_MD5 + - DIGEST_HTTP + - type: string + + DigestAlgorithm: + description: Algorithm used for the Digest authentication scheme + anyOf: + - type: string + enum: + - MD5 + - MD5_SESS + - type: string + + DigestQop: + description: Quality of Protection for the Digest authentication scheme + anyOf: + - type: string + enum: + - AUTH + - AUTH_INT + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsSDM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsSDM.yaml new file mode 100644 index 000000000..14abb6b8b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsSDM.yaml @@ -0,0 +1,3612 @@ +openapi: 3.0.0 + +info: + version: '1.1.1' + title: 'Nhss_imsSDM' + description: | + Nhss Subscriber Data Management Service for IMS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 HSS Services for interworking with IMS, version 17.6.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-ims-sdm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + +paths: + /{imsUeId}/ims-data/registration-status: + get: + summary: Retrieve the registration status of a user + operationId: GetRegistrationStatus + tags: + - Registration Status retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:registration-status:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsRegistrationStatus' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data: + get: + summary: > + Retrieve the complete IMS profile for a given IMS public identity + (and public identities in the same IRS) + operationId: GetProfileData + tags: + - IMS Profile Data Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:profile-data:read + parameters: + - name: imsUeId + in: path + description: IMS Identity. In this case it shall be an IMS public identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: dataset-names + in: query + description: Datasets to be retrieved + schema: + $ref: '#/components/schemas/DataSetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsProfileData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data/priority-levels: + get: + summary: Retrieve the service priority levels associated to the user + operationId: GetPriorityInfo + tags: + - Priority Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:priority-levels:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PriorityLevels' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data/ifcs: + get: + summary: Retrieve the Initial Filter Criteria for the associated IMS subscription + operationId: GetIfcs + tags: + - IFCs Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ifcs:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: application-server-name + in: query + description: SIP URI of the Application Server Name + schema: + $ref: '#/components/schemas/SipServerName' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Ifcs' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data/service-level-trace-information: + get: + summary: Retrieve the IMS service level trace information for the associated user + operationId: GetServiceTraceInfo + tags: + - Service Trace Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:service-level-trace-information:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceLevelTraceInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data/charging-info: + get: + summary: Retrieve the charging information for to the user + operationId: GetChargingInfo + tags: + - Charging Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:charging-info:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingInfo' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/location-data/server-name: + get: + summary: Retrieve the server name for the associated user + operationId: GetServerName + tags: + - Server Name retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:server-name:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsLocationData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/location-data/scscf-capabilities: + get: + summary: Retrieve the S-CSCF capabilities for the associated IMS subscription + operationId: GetScscfCapabilities + tags: + - Retrieval of the S-CSCF capabilities for the IMS subscription + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:scscf-capabilities:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfCapabilityList' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/location-data/scscf-selection-assistance-info: + get: + summary: Retrieve the S-CSCF selection assistance info + operationId: GetScscfSelectionAssistanceInfo + tags: + - Retrieval of the S-CSCF selection assistance information for the IMS subscription + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:scscf-selection-assistance-info:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfSelectionAssistanceInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/ps-domain/location-data: + get: + summary: Retrieve the location data in PS domain + operationId: GetLocPsDomain + tags: + - PS location retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:location-data:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: requested-nodes + in: query + description: Indicates the serving node(s) for which the request is applicable. + style: form + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/RequestedNode' + - name: serving-node + in: query + description: > + Indicates that only the stored NF id/address of the serving node(s) is required + schema: + type: boolean + - name: local-time + in: query + description: > + Indicates that only the Local Time Zone information of the location in the visited + network where the UE is attached is requested + schema: + type: boolean + - name: current-location + in: query + description: > + Indicates whether an active location retrieval has to be initiated by the requested node + schema: + type: boolean + - name: rat-type + in: query + description: Indicates whether RAT Type retrieval is requested + schema: + type: boolean + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PsLocation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/cs-domain/location-data: + get: + summary: Retrieve the location data in CS domain + operationId: GetLocCsDomain + tags: + - CS location retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:cs-domain:location-data:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: serving-node + in: query + description: > + Indicates that only the stored NF id/address of the serving node(s) is required + schema: + type: boolean + - name: local-time + in: query + description: > + Indicates that only the Local Time Zone information of the location in the visited + network where the UE is attached is requested + schema: + type: boolean + - name: current-location + in: query + description: > + Indicates whether an active location retrieval has to be initiated by the requested node + schema: + type: boolean + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CsLocation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/repository-data/{serviceIndication}: + put: + summary: Update the repository data associated to an IMPU and service indication + operationId: UpdateRepositoryDataServInd + tags: + - Update repository data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:repository-data:modify + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: serviceIndication + in: path + description: Identifier of a service related data + required: true + schema: + $ref: '#/components/schemas/ServiceIndication' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryData' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/{imsUeId}/repository-data/{serviceIndication} + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryData' + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete the Repository Data for a Service Indication + operationId: DeleteRepositoryDataServInd + tags: + - Delete repository data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:repository-data:modify + parameters: + - name: imsUeId + in: path + description: Identifier of the UE + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: serviceIndication + in: path + description: Identifier of a service related data + required: true + schema: + $ref: '#/components/schemas/ServiceIndication' + responses: + '204': + description: Expected response to a valid request + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: Retrieve the repository data associated to an IMPU and service indication + operationId: GetRepositoryDataServInd + tags: + - Repository data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:repository-data:read + parameters: + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: serviceIndication + in: path + description: Identifier of a service related data + required: true + schema: + $ref: '#/components/schemas/ServiceIndication' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/identities/msisdns: + get: + summary: retrieve the Msisdns associated to requested identity + operationId: GetMsisdns + tags: + - Retrieval of the associated Msisdns + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:identities:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-id + in: query + description: Private identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/MsisdnList' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/identities/ims-associated-identities: + get: + summary: > + Retrieve the associated identities to the IMS public identity included + in the service request + operationId: GetImsAssocIds + tags: + - Retrieval of associated IMS public identities + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:identities:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsAssociatedIdentities' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/identities/private-identities: + get: + summary: > + Retrieve the associated private identities to the IMS public identity included + in the service request + operationId: GetImsPrivateIds + tags: + - Retrieval of associated IMS private identities + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:identities:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: impi + in: query + description: Private Identity of type IMPI + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PrivateIdentities' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/srvcc-data: + get: + summary: Retrieve the srvcc data + operationId: GetSrvccData + tags: + - Retrieval of UE SRVCC capability and STN-SR + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:srvcc:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity or IMS Private Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SrvccData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Patch + operationId: UpdateSrvccData + tags: + - Update SRVCC data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:srvcc:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Identity or IMS Private Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + /{imsUeId}/service-data/psi-status: + get: + summary: Retrieve the PSI activation state data + operationId: GetPsiState + tags: + - Retrieval of PSI activation state + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:psi-status:read + parameters: + - name: imsUeId + in: path + description: IMS Private Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PsiActivationState' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Patch + operationId: UpdatePsiState + tags: + - Update PSI state data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:psi-status:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Service Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + /{imsUeId}/service-data/dsai: + get: + summary: Retrieve the DSAI information associated to an Application Server + operationId: GetDsaiInfo + tags: + - DSAI registration information + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:dsai:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: application-server-name + in: query + description: SIP URI of the Application Server Name + required: true + schema: + $ref: '#/components/schemas/SipServerName' + - name: dsai-tag + in: query + description: The requested instance of Dynamic Service Activation Info + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/DsaiTagInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Patch + operationId: UpdateDsaiState + tags: + - Update Dsai State + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:dsai:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Service Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + /{imsUeId}/service-data/sms-registration-info: + put: + summary: Update the SMS registration information associated to a user + operationId: UpdateSmsRegistrationInfo + tags: + - Update SMS registration info + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:sms-registration-info:modify + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwAddress' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsRegistrationInfo' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/{imsUeId}/service-data/sms-registration-info + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmsRegistrationInfo' + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete the SMS registration information + operationId: DeleteSmsRegistrationInfo + tags: + - Delete SMS registration information + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:sms-registration-info:modify + parameters: + - name: imsUeId + in: path + description: Identifier of the UE + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '204': + description: Expected response to a valid request + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: Retrieve the SMS registration information associated to a user + operationId: GetSmsRegistrationInfo + tags: + - SMS registration information + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:sms-registration-info:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsRegistrationInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/identities/imeisv: + get: + summary: Retrieve the IMEISV information + operationId: GetIMEISVInfo + tags: + - IMEISV Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:identities:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImeiSvInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/ps-domain/ip-address: + get: + summary: Retrieve the IP address information + operationId: GetIpAddressInfo + tags: + - IP address Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:ip-address:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/ps-domain/tads-info: + get: + summary: Retrieve the T-ADS information + operationId: GetTadsInfo + tags: + - TADS Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:tads-info:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/TadsInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/ps-domain/ue-reach-subscriptions: + post: + summary: subscribe to notifications of UE reachability + operationId: UeReachIpSubscribe + tags: + - UE IP reachability Subscription Creation + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:ue-reach-subscriptions:create + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeReachabilitySubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CreatedUeReachabilitySubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/{imsUeId}/access-data/ps-domain/ue-reach-subscriptions/{subscriptionId} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + ueReachabilityNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UeReachabilityNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{imsUeId}/access-data/ps-domain/ue-reach-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications to UE reachability + operationId: UeReachUnsubscribe + tags: + - Reachability Subscription Deletion + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:ue-reach-subscriptions:modify + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: UeReachSubsModify + tags: + - Reachability Subscription Modification + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:ue-reach-subscriptions:modify + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful modification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{imsUeId}/access-data/ps-domain/user-state: + get: + summary: Retrieve the user state information in PS domain + operationId: GetPsUserStateInfo + tags: + - PS User State Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:user-state:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: requested-nodes + in: query + description: Indicates the serving node(s) for which the request is applicable. + style: form + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/RequestedNode' + minItems: 1 + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PsUserState' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/cs-domain/user-state: + get: + summary: Retrieve the user state information in CS domain + operationId: GetCsUserStateInfo + tags: + - CS User State Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:cs-domain:user-state:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CsUserState' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/cs-domain/csrn: + get: + summary: Retrieve the routeing number in CS domain + operationId: GetCsrn + tags: + - CSRN retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:cs-domain:csrn:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: pre-paging + in: query + description: Indicates pre-paging support + schema: + $ref: '#/components/schemas/PrePaging' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + - name: call-reference-info + in: query + description: Indicates Call-Reference Number and AS-Number + content: + application/json: + schema: + $ref: '#/components/schemas/CallReferenceInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Csrn' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/wireline-domain/reference-location: + get: + summary: Retrieve the reference location information + operationId: GetReferenceLocationInfo + tags: + - Reference Location Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:wireline-domain:reference-location:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ReferenceLocationInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/subscriptions: + post: + summary: subscribe to notifications + operationId: ImsSdmSubscribe + tags: + - SDM Subscription Creation + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:subscriptions:create + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImsSdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsSdmSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/{imsUeId}/subscriptions/{subscriptionId} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications + operationId: ImsSdmUnsubscribe + tags: + - SDM Subscription Deletion + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:subscription:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: modify the subscription + operationId: ImsSdmSubsModify + tags: + - SDM Subscription Modification + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:subscription:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful modification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /shared-data-subscriptions: + post: + summary: subscribe to notifications for shared data + operationId: SubscribeToSharedData + tags: + - Subscription Creation for shared data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:shared-subscriptions:create + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImsSdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsSdmSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/shared-data-subscriptions/{subscriptionId} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /shared-data-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications for shared data + operationId: UnsubscribeForSharedData + tags: + - Subscription Deletion for shared data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:shared-subscription:modify + parameters: + - name: subscriptionId + in: path + description: Id of the Shared data Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: modify the subscription + operationId: ModifySharedDataSubs + tags: + - Subscription Modification + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:shared-subscription:modify + parameters: + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful modification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:shared-data:read + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SharedData' + minItems: 1 + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/repository-data: + get: + summary: Retrieve the repository data associated to an IMPU and service indication list + operationId: GetRepositoryDataServIndList + tags: + - Repository data list + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:repository-data:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: service-indications + in: query + description: Identifiers of a services related data + required: true + style: form + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/ServiceIndication' + minItems: 1 + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryDataList' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-ims-sdm: Access to the Nhss IMS Subscription Data Management API + nhss-ims-sdm:registration-status:read: Access to read the Registration Status resource + nhss-ims-sdm:profile-data:read: Access to read the Profile Data resource + nhss-ims-sdm:priority-levels:read: Access to read the Priority Levels resource + nhss-ims-sdm:ifcs:read: Access to read the Initial Filter Criteria resource + nhss-ims-sdm:service-level-trace-information:read: >- + Access to read the Service Level Trace Information resource + nhss-ims-sdm:server-name:read: Access to read the Server Name resource + nhss-ims-sdm:scscf-capabilities:read: Access to read the S-CSCF Capabilities resource + nhss-ims-sdm:ps-domain:location-data:read: >- + Access to read the PS-Domain Location Data resource + nhss-ims-sdm:ps-domain:ip-address:read: Access to read the PS-Domain IP Address resource + nhss-ims-sdm:ps-domain:tads-info:read: Access to read the PS-Domain TADS Info resource + nhss-ims-sdm:ps-domain:ue-reach-subscriptions:create: >- + Access to create PS-Domain UE Reachability Subscriptions resources + nhss-ims-sdm:ps-domain:ue-reach-subscriptions:modify: >- + Access to update/delete a PS-Domain UE Reachability Subscription resource + nhss-ims-sdm:ps-domain:user-state:read: Access to read the PS-Domain User State resource + nhss-ims-sdm:cs-domain:location-data:read: >- + Access to read the CS-Domain Location Data resource + nhss-ims-sdm:cs-domain:user-state:read: Access to read the CS-Domain User State resource + nhss-ims-sdm:cs-domain:csrn:read: Access to read the CS-Domain CSRN resource + nhss-ims-sdm:wireline-domain:reference-location:read: >- + Access to read the Wireline-Domain Reference Location resource + nhss-ims-sdm:repository-data:modify: >- + Access to create/update/delete the Repository Data resource + nhss-ims-sdm:repository-data:read: Access to read the Repository Data resource + nhss-ims-sdm:identities:read: Access to read the Identities resource + nhss-ims-sdm:srvcc:read: Access to read the SRVCC resource + nhss-ims-sdm:srvcc:modify: Acess to update the SRVCC resource + nhss-ims-sdm:psi-status:read: Access to read the PSI Status resource + nhss-ims-sdm:psi-status:modify: Acess to update the PSI Status resource + nhss-ims-sdm:dsai:read: Acess to read the DSAI resource + nhss-ims-sdm:dsai:modify: Acess to update the DSAI resource + nhss-ims-sdm:sms-registration-info:read: >- + Acess to read the SMS Registration Info resource + nhss-ims-sdm:sms-registration-info:modify: >- + Acess to create/update/delete the SMS Registration Info resource + nhss-ims-sdm:subscriptions:create: Access to create Subscriptions resources + nhss-ims-sdm:subscription:modify: Access to update/delete a Subscription resource + nhss-ims-sdm:shared-subscriptions:create: >- + Access to create a Shared-Data Subscriptions resource + nhss-ims-sdm:shared-subscription:modify: >- + Access to update/delete a Shared-Data Subscription resource + nhss-ims-sdm:shared-data:read: Access to read the Shared-Data resource + nhss-ims-sdm:charging-info:read: Access to read the ChargingInfo resource + + schemas: + +# +# COMPLEX TYPES: +# + + ScscfCapabilityList: + description: Information about mandatory and optional S-CSCF capabilities + type: object + properties: + mandatoryCapabilityList: + $ref: '#/components/schemas/Capabilities' + optionalCapabilityList: + $ref: '#/components/schemas/Capabilities' + anyOf: + - required: [mandatoryCapabilityList] + - required: [optionalCapabilityList] + + Capabilities: + description: A list of capabilities of the S-CSCF + type: array + items: + $ref: '#/components/schemas/Capability' + minItems: 1 + uniqueItems: true + + RepositoryData: + description: Repository Data for the requested Service Indication + type: object + required: + - serviceData + - sequenceNumber + properties: + sequenceNumber: + $ref: '#/components/schemas/SequenceNumber' + serviceData: + type: string + format: byte + + MsisdnList: + description: List of MSISDNs associated to the IMS public Identity + type: object + required: + - basicMsisdn + properties: + basicMsisdn: + $ref: '#/components/schemas/Msisdn' + additionalMsisdns: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/Msisdn' + + PublicIdentities: + description: > + IMS Public Identities which belong to the same Implicit Registration Set (if any) + as the requested IMS Public Identity + type: object + required: + - publicIdentities + properties: + publicIdentities: + type: array + items: + $ref: '#/components/schemas/PublicIdentity' + minItems: 1 + uniqueItems: true + + PrivateIdentities: + description: A list of IMS Private Identities + type: object + required: + - privateIdentities + properties: + privateIdentities: + type: array + items: + $ref: '#/components/schemas/PrivateIdentity' + minItems: 1 + uniqueItems: true + + PublicIdentity: + description: > + IMS Public Identity and related data (Alias Group Id, IRS default indication, + Identity Type) + type: object + required: + - imsPublicId + - identityType + properties: + imsPublicId: + $ref: '#/components/schemas/ImsPublicId' + identityType: + $ref: '#/components/schemas/IdentityType' + irsIsDefault: + type: boolean + aliasGroupId: + type: string + + PrivateIdentity: + description: IMS Private Identity and its identity type (IMPI or IMSI) + type: object + required: + - privateIdentity + - privateIdentityType + properties: + privateIdentity: + $ref: '#/components/schemas/PrivateId' + privateIdentityType: + $ref: '#/components/schemas/PrivateIdentityType' + + ImsAssociatedIdentities: + description: > + A list of identities belonging to the same Implicit Registration Set (IRS), + along with the registration state of the IRS + type: object + required: + - irsState + - publicIdentities + properties: + irsState: + $ref: '#/components/schemas/ImsRegistrationState' + publicIdentities: + $ref: '#/components/schemas/PublicIdentities' + + ImsSdmSubscription: + description: A subscription to notifications of data change + type: object + required: + - nfInstanceId + - callbackReference + - monitoredResourceUris + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + ImsRegistrationStatus: + description: Registration status of the user + type: object + required: + - imsUserStatus + properties: + imsUserStatus: + $ref: '#/components/schemas/ImsRegistrationState' + + PriorityLevels: + description: Namespaces and priority levels allowed for the IMS public Identity + type: object + required: + - servicePriorityLevelList + properties: + servicePriorityLevelList: + type: array + items: + $ref: '#/components/schemas/NameSpacePriority' + minItems: 1 + uniqueItems: true + servicePriorityLevel: + type: integer + minimum: 0 + maximum: 4 + + Ifcs: + description: List of IFCs associated to the IMS public Identity + type: object + properties: + ifcList: + type: array + items: + $ref: '#/components/schemas/Ifc' + minItems: 1 + cscfFilterSetIdList: + type: array + items: + $ref: '#/components/schemas/CscfFilterSetId' + minItems: 1 + anyOf: + - required: [ ifcList ] + - required: [ cscfFilterSetIdList ] + + Ifc: + description: Data associated to an individual IFC (Initial Filter Criteria) + type: object + required: + - priority + - appServer + properties: + priority: + type: integer + minimum: 1 + trigger: + $ref: '#/components/schemas/TriggerPoint' + appServer: + $ref: '#/components/schemas/ApplicationServer' + + TriggerPoint: + description: > + Contains the conditions that should be checked in order to find out if an + Application Server should be contacted or not + type: object + required: + - conditionType + - sptList + properties: + conditionType: + $ref: '#/components/schemas/TypeOfCondition' + sptList: + type: array + items: + $ref: '#/components/schemas/Spt' + minItems: 1 + + Spt: + description: Contains the data of a Service Point Trigger + type: object + required: + - conditionNegated + - sptGroup + properties: + conditionNegated: + type: boolean + sptGroup: + type: array + items: + $ref: '#/components/schemas/SptGroupId' + minItems: 1 + regType: + items: + $ref: '#/components/schemas/RegistrationType' + minItems: 1 + maxItems: 2 + requestUri: + type: string + sipMethod: + type: string + sipHeader: + $ref: '#/components/schemas/HeaderSipRequest' + sessionCase: + $ref: '#/components/schemas/RequestDirection' + sessionDescription: + $ref: '#/components/schemas/SdpDescription' + + HeaderSipRequest: + description: Contains a header (and optionally value of the header) in the SIP request + type: object + required: + - header + properties: + header: + type: string + content: + type: string + + SdpDescription: + description: > + Contains a SDP line (and optionally the value in the line) within the body (if any) + of a SIP request + type: object + required: + - line + properties: + line: + type: string + content: + type: string + + ApplicationServer: + description: > + Application Server which shall be triggered if the conditions of a certain IFC are met, + and its associated data + type: object + required: + - asUri + properties: + asUri: + type: string + sessionContinue: + type: boolean + serviceInfoList: + type: array + items: + $ref: '#/components/schemas/ServiceInformation' + minItems: 1 + + ImsLocationData: + description: IMS Location Data (S-CSCF name) + type: object + required: + - scscfName + properties: + scscfName: + type: string + + PsLocation: + description: Location data in PS domain + type: object + oneOf: + - required: + - sgsnLocationData + - required: + - mmeLocationData + - required: + - amfLocationData + - required: + - twanLocationData + properties: + sgsnLocationData: + $ref: '#/components/schemas/SgsnLocationData' + mmeLocationData: + $ref: '#/components/schemas/MmeLocationData' + amfLocationData: + $ref: '#/components/schemas/AmfLocationData' + twanLocationData: + $ref: '#/components/schemas/TwanLocationData' + + SgsnLocationData: + description: Location information as retrieved from the SGSN serving node + type: object + required: + - sgsnNumber + - plmnId + properties: + sgsnNumber: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + sgsnLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UtraLocation' + csgInformation: + $ref: '#/components/schemas/CsgInformation' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + + MmeLocationData: + description: Location information as retrieved from the MME serving node + type: object + required: + - mmeAddress + - plmnId + properties: + mmeAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + mmeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EutraLocation' + csgInformation: + $ref: '#/components/schemas/CsgInformation' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + + AmfLocationData: + description: Location information as retrieved from the AMF serving node + type: object + required: + - amfAddress + - plmnId + properties: + amfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + amfLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrLocation' + smsfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + + TwanLocationData: + description: Location information of the 3GPP AAA Server for Trusted W-LAN Access + type: object + required: + - twanSsid + - plmnId + properties: + twanSsid: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + twanBssid: + type: string + civicAddress: + type: string + format: byte + twanOperatorName: + type: string + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + logicalAccessId: + type: string + + CsLocation: + description: Location data in CS domain + type: object + required: + - mscNumber + - vlrNumber + - plmnId + properties: + mscNumber: + type: string + vlrNumber: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + vlrLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GeraLocation' + csgInformation: + $ref: '#/components/schemas/CsgInformation' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + eUtranCgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + + CsgInformation: + description: Information about a Closed Subscriber Group (CSG) + type: object + required: + - csgId + properties: + csgId: + type: string + format: byte + accessMode: + type: string + format: byte + cMi: + type: boolean + + SrvccData: + description: UE SRVCC capability (if available) and STN-SR (if subscribed) + type: object + required: + - stnSr + properties: + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + ueSrvccCapabilities: + type: array + items: + $ref: '#/components/schemas/SrvccCapability' + minItems: 1 + uniqueItems: true + + PsiActivationState: + description: Public Service Identity activation state + type: object + required: + - activationState + properties: + activationState: + $ref: '#/components/schemas/ActivationState' + + SharedData: + description: Represents a part of the IMS Profile data shared by several UEs + type: object + required: + - sharedDataId + properties: + sharedDataId: + $ref: '#/components/schemas/SharedDataId' + sharedImsIfcData: + $ref: '#/components/schemas/Ifcs' + minProperties: 1 + + ImsProfileData: + description: User's IMS profile data + type: object + required: + - imsServiceProfiles + properties: + imsServiceProfiles: + type: array + items: + $ref: '#/components/schemas/ImsServiceProfile' + chargingInfo: + $ref: '#/components/schemas/ChargingInfo' + serviceLevelTraceInfo: + $ref: '#/components/schemas/ServiceLevelTraceInformation' + servicePriorityLevelList: + type: array + items: + $ref: '#/components/schemas/NameSpacePriority' + minItems: 1 + uniqueItems: true + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + maxAllowedSimulReg: + type: integer + servicePriorityLevel: + type: integer + minimum: 0 + maximum: 4 + + ImsServiceProfile: + description: > + IMS Service Profile of the UE, containing the list of Public Identifiers and + optionally a list of IFCs + type: object + required: + - publicIdentifierList + properties: + publicIdentifierList: + type: array + items: + $ref: '#/components/schemas/PublicIdentifier' + ifcs: + $ref: '#/components/schemas/Ifcs' + cnServiceAuthorization: + $ref: '#/components/schemas/CoreNetworkServiceAuthorization' + + CoreNetworkServiceAuthorization: + description: > + Core Network Service Authorization + type: object + properties: + subscribedMediaProfileId: + type: integer + + PublicIdentifier: + description: > + Distinct or wildcarded public identity and its associated priority, trace and + barring information + type: object + required: + - publicIdentity + properties: + publicIdentity: + $ref: '#/components/schemas/PublicIdentity' + displayName: + type: string + imsServicePriority: + $ref: '#/components/schemas/PriorityLevels' + serviceLevelTraceInfo: + $ref: '#/components/schemas/ServiceLevelTraceInformation' + barringIndicator: + type: boolean + wildcardedImpu: + type: string + + ServiceLevelTraceInformation: + description: IMS Service Level Trace Information + type: object + properties: + serviceLevelTraceInfo: + type: string + + ImeiSvInformation: + description: IMEI(SV) information + type: object + oneOf: + - required: + - imei + - required: + - imeiSv + properties: + imei: + $ref: '#/components/schemas/Imei' + imeiSv: + $ref: '#/components/schemas/ImeiSv' + + TadsInformation: + description: T-ADS Information + type: object + required: + - voiceOverPsSessionSupport + properties: + voiceOverPsSessionSupport: + $ref: '#/components/schemas/ImsVoiceOverPsSessionSupport' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + lastUeActivityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + UeReachabilitySubscription: + description: > + Contains the request parameters received by the HSS for a subscription to + notifications of UE reachability for IP + type: object + required: + - expiry + - callbackReference + properties: + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + CreatedUeReachabilitySubscription: + description: > + Contains the response data returned by HSS after the subscription to + notifications of UE reachability for IP was created + type: object + required: + - expiry + properties: + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + UeReachabilityNotification: + description: > + Represents the contents of a notification of UE reachability for IP sent by the HSS + type: object + required: + - reachabilityIndicator + - detectingNode + - accessType + properties: + reachabilityIndicator: + type: boolean + detectingNode: + $ref: '#/components/schemas/DetectingNode' + accessType: + $ref: '#/components/schemas/AccessType' + + PsUserState: + description: User state in PS domain + type: object + oneOf: + - required: + - sgsnUserState + - required: + - mmeUserState + - required: + - amfUserState + properties: + sgsnUserState: + $ref: '#/components/schemas/UserStatePs' + mmeUserState: + $ref: '#/components/schemas/UserStatePs' + amfUserState: + $ref: '#/components/schemas/UserStatePs' + + CsUserState: + description: User state in CS domain + type: object + required: + - mscVlrUserState + properties: + mscVlrUserState: + $ref: '#/components/schemas/UserStateCs' + + Csrn: + description: CS domain routeing number + type: object + required: + - csrn + properties: + csrn: + $ref: '#/components/schemas/Msisdn' + + ReferenceLocationInformation: + description: Reference Location Information for the user in fixed access networks + type: object + properties: + accessType: + type: string + accessInfo: + type: string + accessValue: + type: string + anyOf: + - required: [accessType] + - required: [accessInfo] + - required: [accessValue] + + SmsRegistrationInfo: + description: SMS Registration Information (IP-SM-GW number and SC address) + type: object + required: + - ipSmGwNumber + properties: + ipSmGwNumber: + $ref: '#/components/schemas/Msisdn' + scAddress: + $ref: '#/components/schemas/Msisdn' + + IpSmGwAddress: + description: IP-SM-GW number and diameter URI/realm + type: object + required: + - ipSmGwNumber + properties: + ipSmGwNumber: + $ref: '#/components/schemas/Msisdn' + ipSmGwDiaUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + ipSmGwDiaRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + ipSmGwSbiSupInd: + type: boolean + default: false + + DsaiTagInformation: + description: > + DSAI tag information (list of DSAI tags activation state for an Application Server) + type: object + required: + - dsaiTagStatusList + properties: + dsaiTagStatusList: + type: array + items: + $ref: '#/components/schemas/DsaiTagStatus' + minItems: 1 + uniqueItems: true + + DsaiTagStatus: + description: DSAI tag status (DSAI tag and activation state) + type: object + required: + - dsaiTag + - dsaiState + properties: + dsaiTag: + type: string + dsaiState: + $ref: '#/components/schemas/ActivationState' + + ScscfSelectionAssistanceInformation: + description: Information used by the I-CSCF to select an S-CSCF for the UE + type: object + properties: + scscfCapabilityList: + $ref: '#/components/schemas/ScscfCapabilityList' + scscfNames: + type: array + items: + type: string + minItems: 1 + anyOf: + - required: [scscfCapabilityList] + - required: [scscfNames] + + ChargingInfo: + description: Diameter addresses of the charging function + type: object + anyOf: + - required: + - primaryEventChargingFunctionName + - required: + - primaryChargingCollectionFunctionName + properties: + primaryEventChargingFunctionName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + secondaryEventChargingFunctionName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + primaryChargingCollectionFunctionName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + secondaryChargingCollectionFunctionName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + + CallReferenceInfo: + description: > + Contains a Call Reference Number and the AS-Number; it allows a later retry of the call + setup in the context of MTRR + type: object + required: + - callRefNumber + - asNumber + properties: + callRefNumber: + type: string + format: byte + description: > + The content is according to CallReferenceNumber type described in 3GPP TS 29.002 [30]. + Base64 encoded according to IETF RFC 2045 [28] + asNumber: + type: string + format: byte + description: > + The content is according to ISDN-AddressString type described in 3GPP TS 29.002 [30]. + Base64 encoded according to IETF RFC 2045 [28] + + DataSetNames: + description: Contains the data sets to be retrieved from the IMS User Profile + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 1 + uniqueItems: true + + RepositoryDataList: + description: List of Repository Data for the requested Service Indications + type: object + required: + - repositoryDataMap + properties: + repositoryDataMap: + description: > + A map (list of key-value pairs where ServiceIndication serves as key) of RepositoryData + type: object + additionalProperties: + $ref: '#/components/schemas/RepositoryData' + +# +# SIMPLE TYPES: +# + + Capability: + description: S-CSCF capability + type: integer + + ImsUeId: + description: > + Represents the IMS Public Identity (i.e. IMS Public User identity or + Public Service Identity) + type: string + pattern: '^(impu-sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}|impu-tel\:\+[0-9]{5,15}|impi-.+|.+)$' + + SequenceNumber: + description: > + Unsigned integer containing the sequence number associated to the current version + of Repository Data + type: integer + minimum: 0 + + ServiceIndication: + description: String containing the Service Indication or Service Identifier + type: string + + Msisdn: + description: String containing an additional or basic MSISDN + type: string + pattern: '[0-9]{5,15}$' + + PrivateId: + description: String containing a Private User Identity or a Private Service Identity + type: string + + ImsPublicId: + description: String containing an IMS Public Identity in SIP URI format or TEL URI format + type: string + pattern: '^(sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}|tel\:\+[0-9]{5,15})$' + + NameSpacePriority: + description: > + String containing the namespace and priority formatted as "r-value" parameter + described in IETF RFC 4412 + type: string + pattern: '^[0-9a-zA-Z-\!%\*_\+`''~]+.[0-9a-zA-Z-\!%\*_\+`''~]+$' + + CscfFilterSetId: + description: Contains the identifier of a specific filter set in the S-CSCF + type: integer + minimum: 0 + + SptGroupId: + description: Contains the identifier of the Group of SPTs + type: integer + minimum: 0 + + SharedDataId: + description: > + Identifies globally and uniquely a piece of subscription data shared by multiple UEs; + the value shall start with the HPLMN id (MCC/MNC) followed by a hyphen followed by a + local Id as allocated by the home network operator + type: string + pattern: '^[0-9]{5,6}-.+$' + + Imei: + description: IMEI of the UE + type: string + pattern: '^[0-9]{15}$' + + ImeiSv: + description: IMEISV of the UE + type: string + pattern: '^[0-9]{16}$' + + PrePaging: + description: Inidicates the support of pre-paging + type: boolean + + SipServerName: + description: Server Name (e.g. AS name, CSCF name) in SIP URI format + type: string + pattern: '^(sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,})$' + +# +# ENUMS: +# + + IdentityType: + description: Represents the type of IMS Public Identity + anyOf: + - type: string + enum: + - DISTINCT_IMPU + - DISTINCT_PSI + - WILDCARDED_IMPU + - WILDCARDED_PSI + - type: string + + PrivateIdentityType: + description: Represents the type of IMS Private Identity (IMPI or IMSI) + anyOf: + - type: string + enum: + - IMPI + - IMSI + - type: string + + ImsRegistrationState: + description: Represents the IMS status of the user or Public Identity or the IRS + anyOf: + - type: string + enum: + - REGISTERED + - NOT_REGISTERED + - AUTHENTICATION_PENDING + - REGISTERED_UNREG_SERVICES + - type: string + + TypeOfCondition: + description: > + Represents the type of condition to be applied to the logical expression of SPT groups + and SPTs (Conjunctive Normal Form, or Disjunctive Normal Form) + anyOf: + - type: string + enum: + - CNF + - DNF + - type: string + + RegistrationType: + description: Represents the type of registration associated to the REGISTER request + anyOf: + - type: string + enum: + - INITIAL_REGISTRATION + - RE_REGISTRATION + - DE_REGISTRATION + - type: string + + RequestDirection: + description: > + Represents the direction of the request in combination with the registration status + of the user as evaluated in the S-CSCF + anyOf: + - type: string + enum: + - ORIGINATING_REGISTERED + - ORIGINATING_UNREGISTERED + - ORIGINATING_CDIV + - TERMINATING_REGISTERED + - TERMINATING_UNREGISTERED + - type: string + + ServiceInformation: + description: > + Indicates the type of additional information to be included in the body of the SIP request + towards the Application Server + anyOf: + - type: string + enum: + - INCLUDE_REGISTER_REQUEST + - INCLUDE_REGISTER_RESPONSE + - type: string + + RequestedNode: + description: Represents the type of serving node for which certain data is requested + anyOf: + - type: string + enum: + - SGSN + - MME + - AMF + - 3GPP_AAA_SERVER_TWAN + - type: string + + SrvccCapability: + description: Represents the type of SRVCC support of the UE + anyOf: + - type: string + enum: + - UE_4G_SRVCC_CAPABLE + - UE_5G_SRVCC_CAPABLE + - type: string + + ActivationState: + description: Represents the activation state of a PSI or DSAI tag + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + + ImsVoiceOverPsSessionSupport: + description: Represents the support for Voice-over-PS of the UE + anyOf: + - type: string + enum: + - IMS_VOICE_OVER_PS_NOT_SUPPORTED + - IMS_VOICE_OVER_PS_SUPPORTED + - IMS_VOICE_OVER_PS_SUPPORT_UNKNOWN + - type: string + + DetectingNode: + description: Represents the type of serving node that detected the reachability of the UE + anyOf: + - type: string + enum: + - SGSN + - MME + - AMF + - type: string + + AccessType: + description: Represents the type of access (3GPP or non-3GPP) + anyOf: + - type: string + enum: + - 3GPP_ACCESS + - NON_3GPP_ACCESS + - type: string + + UserStatePs: + description: Represents the user state in PS domain + anyOf: + - type: string + enum: + - DETACHED + - ATTACHED_NOT_REACHABLE_FOR_PAGING + - ATTACHED_REACHABLE_FOR_PAGING + - CONNECTED_NOT_REACHABLE_FOR_PAGING + - CONNECTED_REACHABLE_FOR_PAGING + - NOT_PROVIDED_FROM_SGSN_OR_MME_OR_AMF + - NETWORK_DETERMINED_NOT_REACHABLE + - type: string + + UserStateCs: + description: Represents the user state in CS domain + anyOf: + - type: string + enum: + - CAMEL_BUSY + - NETWORK_DETERMINED_NOT_REACHABLE + - ASSUMED_IDLE + - NOT_PROVIDED_FROM_VLR + - type: string + + DataSetName: + description: A set of data within the IMS User Profile + anyOf: + - type: string + enum: + - CHARGING_DATA + - IFC_DATA + - TRACE_DATA + - PRIORITY_DATA + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsUEAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsUEAU.yaml new file mode 100644 index 000000000..d6b4574d2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsUEAU.yaml @@ -0,0 +1,247 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'Nhss_imsUEAU' + description: | + Nhss UE Authentication Service for IMS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 Home Subscriber Server (HSS) Services, version 17.5.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-ims-ueau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-ueau + +paths: + + /{impi}/security-information/generate-sip-auth-data: + post: + summary: Generate authentication data for the UE based on the Auth-Scheme provided + operationId: GenerateSipAuthData + tags: + - Generate SIP Auth Data (Custom Operation) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-ueau + - oAuth2ClientCredentials: + - nhss-ims-ueau + - nhss-ims-ueau:generate-sip-auth-data:invoke + parameters: + - name: impi + in: path + description: IMS Private Identity for the UE (IMPI) + required: true + schema: + $ref: '#/components/schemas/Impi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SipAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SipAuthenticationInfoResult' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-ims-ueau: Access to the Nhss IMS UE Authentication API + nhss-ims-ueau:generate-sip-auth-data:invoke: > + Access to invoke the Generate SIP Auth Data custom operation + + schemas: + +# +# COMPLEX TYPES: +# + + SipAuthenticationInfoRequest: + description: > + Contains input data to the SIP authentication request message (e.g. SIP authentication + scheme, requested number of authentication items, resynchronization information) + type: object + required: + - cscfServerName + - sipAuthenticationScheme + properties: + cscfServerName: + type: string + sipAuthenticationScheme: + $ref: '#/components/schemas/SipAuthenticationScheme' + sipNumberAuthItems: + $ref: '#/components/schemas/SipNumberAuthItems' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + + ResynchronizationInfo: + description: Contains RAND and AUTS + type: object + required: + - rand + - auts + properties: + rand: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' + auts: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Auts' + + SipAuthenticationInfoResult: + description: > + Contains authentication information returned in the SIP authentication response message + (e.g. authentication vectors, digest authentication parameters, line identifiers) + type: object + required: + - impi + properties: + impi: + $ref: '#/components/schemas/Impi' + 3gAkaAvs: + type: array + items: + $ref: '#/components/schemas/3GAkaAv' + minItems: 1 + digestAuth: + $ref: '#/components/schemas/DigestAuthentication' + lineIdentifierList: + type: array + items: + $ref: '#/components/schemas/LineIdentifier' + minItems: 1 + ipAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + + 3GAkaAv: + description: Contains RAND, XRES, AUTN, CK, and IK + type: object + required: + - rand + - xres + - autn + - ck + - ik + properties: + rand: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' + xres: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Xres' + autn: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Autn' + ck: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ConfidentialityKey' + ik: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/IntegrityKey' + + DigestAuthentication: + description: Parameters used for the Digest authentication scheme + type: object + required: + - digestRealm + - digestAlgorithm + - digestQop + - ha1 + properties: + digestRealm: + type: string + digestAlgorithm: + $ref: '#/components/schemas/SipDigestAlgorithm' + digestQop: + $ref: '#/components/schemas/SipDigestQop' + ha1: + type: string + +# +# SIMPLE TYPES: +# + + SipNumberAuthItems: + description: Indicates the number of requested SIP authentication items + type: integer + minimum: 1 + + Impi: + description: IMS Private Identity of the UE + type: string + + LineIdentifier: + description: Line Identifier for the wireline access + type: string + +# +# ENUMS: +# + + SipAuthenticationScheme: + description: Authentication scheme to be used in the SIP authentication request message + anyOf: + - type: string + enum: + - DIGEST-AKAV1-MD5 + - DIGEST-HTTP + - NBA + - GIBA + - UNKNOWN + - type: string + + SipDigestAlgorithm: + description: Algorithm used for the SIP Digest authentication scheme + anyOf: + - type: string + enum: + - MD5 + - MD5_SESS + - type: string + + SipDigestQop: + description: Quality of Protection for the SIP Digest authentication scheme + anyOf: + - type: string + enum: + - AUTH + - AUTH_INT + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsUECM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsUECM.yaml new file mode 100644 index 000000000..09551ff07 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29562_Nhss_imsUECM.yaml @@ -0,0 +1,638 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'Nhss_imsUECM' + description: | + Nhss UE Context Management Service for IMS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 Home Subscriber Server (HSS) Services, version 17.5.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-ims-uecm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + +paths: + + /{impu}/authorize: + post: + summary: > + Authorize IMS Identities to register in the network or establish multimedia sessions + and return CSCF location if it is stored + operationId: Authorize + tags: + - Authorize (Custom Operation) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:authorize:invoke + parameters: + - name: impu + in: path + description: Public identity of the user. + required: true + schema: + $ref: '#/components/schemas/Impu' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + deregistrationeNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/scscf-registration: + put: + summary: SCSCF registration information + operationId: SCSCF registration + tags: + - S-CSCF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:registration:create + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRegistration' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-uecm/v1/{impu}/scscf-registration + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRegistration' + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtendedProblemDetails' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{impu}/scscf-registration/scscf-restoration-info: + put: + summary: Update the S-CSCF restoration information of the UE + operationId: UpdateScscfRestorationInfo + tags: + - S-CSCF Restoration Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:restoration:modify + parameters: + - name: impu + in: path + description: Public identity of the user. + required: true + schema: + $ref: '#/components/schemas/Impu' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRestorationInfoRequest' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRestorationInfoResponse' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-uecm/v1/{impu}/scscf-registration/scscf-restoration-info + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRestorationInfoResponse' + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve the S-CSCF restoration information of the UE + operationId: GetScscfRestorationInfo + tags: + - S-CSCF Restoration Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:restoration:read + parameters: + - name: impu + in: path + description: Public identity of the user. + required: true + schema: + $ref: '#/components/schemas/Impu' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRestorationInfoResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete the S-CSCF restoration information of the UE + operationId: DeleteScscfRestorationInfo + tags: + - S-CSCF Restoration Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:restoration:modify + parameters: + - name: impu + in: path + description: Public identity of the user. + required: true + schema: + $ref: '#/components/schemas/Impu' + responses: + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-ims-uecm: Access to the Nhss IMS UE Context Management API + nhss-ims-uecm:authorize:invoke: Access to invoke the Authorize custom operation + nhss-ims-uecm:registration:create: Access to create the S-CSCF Registration resource + nhss-ims-uecm:restoration:read: Access to read the S-CSCF Restoration resource + nhss-ims-uecm:restoration:modify: >- + Access to create/update/delete the S-CSCF Restoration resource + + schemas: + +# +# COMPLEX TYPES: +# + + AuthorizationRequest: + description: Ims authorization request data + type: object + required: + - authorizationType + properties: + impi: + $ref: '#/components/schemas/Impi' + authorizationType: + $ref: '#/components/schemas/AuthorizationType' + visitedNetworkIdentifier: + type: string + emergencyIndicator: + type: boolean + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + AuthorizationResponse: + description: Ims Registration authorization information result + type: object + properties: + authorizationResult: + $ref: '#/components/schemas/AuthorizationResult' + cscfServerName: + type: string + scscfSelectionAssistanceInfo: + $ref: 'TS29562_Nhss_imsSDM.yaml#/components/schemas/ScscfSelectionAssistanceInformation' + required: + - authorizationResult + oneOf: + - required: + - cscfServerName + - required: + - scscfSelectionAssistanceInfo + + ScscfRegistration: + description: Scscf Registration + type: object + required: + - imsRegistrationType + - cscfServerName + properties: + impi: + $ref: '#/components/schemas/Impi' + imsRegistrationType: + $ref: '#/components/schemas/ImsRegistrationType' + cscfServerName: + type: string + scscfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + associatedImpis: + type: array + items: + $ref: '#/components/schemas/Impi' + associatedRegisteredImpis: + type: array + items: + $ref: '#/components/schemas/Impi' + irsImpus: + type: array + items: + $ref: '#/components/schemas/Impu' + minItems: 1 + uniqueItems: true + wildcardedPui: + $ref: '#/components/schemas/Impu' + looseRouteIndicator: + $ref: '#/components/schemas/LooseRouteIndication' + wildcardedPsi: + $ref: '#/components/schemas/Impu' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + multipleRegistrationIndicator: + type: boolean + pcscfRestorationIndicator: + type: boolean + default: false + scscfReselectionIndicator: + type: boolean + default: false + + ExtendedProblemDetails: + description: > + Extension of the ProblemDetails data type, to include additional information + in an error response message + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/AdditionalInfo' + + AdditionalInfo: + description: > + Additional information to be sent on error response messages, along with the + common content in ProblemDetails + type: object + properties: + scscfServerName: + type: string + + ScscfRestorationInfo: + description: S-CSCF restoration information + type: object + properties: + userName: + $ref: '#/components/schemas/Impi' + restorationInfo: + type: array + items: + $ref: '#/components/schemas/RestorationInfo' + registrationTimeOut: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sipAuthenticationScheme: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/SipAuthenticationScheme' + + ScscfRestorationInfoRequest: + description: S-CSCF restoration information request + type: object + properties: + scscfRestorationInfoRequest: + $ref: '#/components/schemas/ScscfRestorationInfo' + + ScscfRestorationInfoResponse: + description: S-CSCF restoration information response + type: object + properties: + scscfRestorationInfoResponse: + type: array + items: + $ref: '#/components/schemas/ScscfRestorationInfo' + + RestorationInfo: + description: > + The information relevant to a specific registration required for an S-CSCF + to handle the requests for a user + type: object + required: + - path + - contact + properties: + path: + type: string + contact: + type: string + initialCSeqSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + callIdSipHeader: + type: string + uesubscriptionInfo: + $ref: '#/components/schemas/UeSubscriptionInfo' + pcscfSubscriptionInfo: + $ref: '#/components/schemas/PcscfSubscriptionInfo' + imsSdmSubscriptions: + description: > + A map (list of key-value pairs where subscriptionId serves as key) of ImsSdmSubscription + type: object + additionalProperties: + $ref: 'TS29562_Nhss_imsSDM.yaml#/components/schemas/ImsSdmSubscription' + + UeSubscriptionInfo: + description: Subscription information of the UE for the SIP Registration State event + type: object + required: + - callIdSipHeader + - fromSipHeader + - toSipHeader + - recordRoute + - contact + properties: + callIdSipHeader: + type: string + fromSipHeader: + type: string + toSipHeader: + type: string + recordRoute: + type: string + contact: + type: string + + PcscfSubscriptionInfo: + description: Subscription information of the P-CSCF for the SIP Registration State event + type: object + required: + - callIdSipHeader + - fromSipHeader + - toSipHeader + - contact + properties: + callIdSipHeader: + type: string + fromSipHeader: + type: string + toSipHeader: + type: string + contact: + type: string + + DeregistrationData: + description: Data related to the de-registration information of a S-CSCF in HSS + type: object + required: + - deregReason + - impi + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + impi: + $ref: '#/components/schemas/Impi' + associatedImpis: + type: array + items: + $ref: '#/components/schemas/Impi' + emergencyRegisteredIdentities: + type: array + items: + $ref: '#/components/schemas/EmergencyRegisteredIdentity' + minItems: 1 + + EmergencyRegisteredIdentity: + description: > + A pair of private and public user identities which have not been de-registered + due to emergency registration + type: object + required: + - impi + - impu + properties: + impi: + $ref: '#/components/schemas/Impi' + impu: + $ref: '#/components/schemas/Impu' + + DeregistrationReason: + description: > + Contains the reason for the network initiated de-registration (including a reason code, + and a human-readable reason text) + type: object + required: + - reasonCode + - reasonText + properties: + reasonCode: + $ref: '#/components/schemas/DeregistrationReasonCode' + reasonText: + type: string + +# +# SIMPLE TYPES +# + + ImsUeId: + description: IMS UE Identity (IMPU or IMPI) + type: string + pattern: '^(impu-sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}|impu-tel\:\+[0-9]{5,15}|impi-.+|.+)$' + + Impu: + description: IMS Public Identity of the UE (sip URI or tel URI) + type: string + pattern: '^(sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}|tel\:\+[0-9]{5,15})$' + + Impi: + description: IMS Private Identity of the UE + type: string + +# +# ENUMS: +# + + AuthorizationType: + description: Represents the type of authorization requested by the UE + anyOf: + - type: string + enum: + - REGISTRATION + - DEREGISTRATION + - type: string + + AuthorizationResult: + description: Represents the details of the granted authorization to the UE + anyOf: + - type: string + enum: + - FIRST_REGISTRATION + - SUBSEQUENT_REGISTRATION + - type: string + + ImsRegistrationType: + description: Represents the type of registration associated to the REGISTER request + anyOf: + - type: string + enum: + - INITIAL_REGISTRATION + - RE_REGISTRATION + - TIMEOUT_DEREGISTRATION + - USER_DEREGISTRATION + - ADMINISTRATIVE_DEREGISTRATION + - AUTHENTICATION_FAILURE + - AUTHENTICATION_TIMEOUT + - UNREGISTERED_USER + - type: string + + LooseRouteIndication: + description: Indicates whether the loose routing mechanism is required to serve the user + anyOf: + - type: string + enum: + - LOOSE_ROUTE_NOT_REQUIRED + - LOOSE_ROUTE_REQUIRED + - type: string + + DeregistrationReasonCode: + description: Indicates the reason for the network-initiated deregistration + anyOf: + - type: string + enum: + - PERMANENT_TERMINATION + - NEW_SERVER_ASSIGNED + - REMOVE_S-CSCF + - SERVER_CHANGE + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29571_CommonData.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29571_CommonData.yaml new file mode 100644 index 000000000..d3fe664e2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29571_CommonData.yaml @@ -0,0 +1,5318 @@ +openapi: 3.0.0 + +info: + version: '1.4.1' + title: 'Common Data Types' + description: | + Common Data Types for Service Based Interfaces. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.571 Common Data Types for Service Based Interfaces, version 17.8.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.571/' + +paths: {} +components: + schemas: + +# +# Common Data Types for Generic usage definitiones as defined in clause 5.2 +# + +# +# COMMON SIMPLE DATA TYPES +# + Binary: + format: binary + type: string + description: string with format 'binary' as defined in OpenAPI. + + BinaryRm: + format: binary + type: string + nullable: true + description: "string with format 'binary' as defined in OpenAPI OpenAPI with 'nullable: true' property." + + Bytes: + format: byte + type: string + description: string with format 'bytes' as defined in OpenAPI + + BytesRm: + format: byte + type: string + nullable: true + description: > + string with format 'bytes' as defined in OpenAPI OpenAPI with 'nullable: true' property. + + Date: + format: date + type: string + description: string with format 'date' as defined in OpenAPI. + + DateRm: + format: date + type: string + nullable: true + description: > + string with format 'date' as defined in OpenAPI OpenAPI with 'nullable: true' property. + + DateTime: + format: date-time + type: string + description: string with format 'date-time' as defined in OpenAPI. + + DateTimeRm: + format: date-time + type: string + nullable: true + description: > + string with format 'date-time' as defined in OpenAPI with 'nullable:true' property. + + DiameterIdentity: + $ref: '#/components/schemas/Fqdn' + + DiameterIdentityRm: + $ref: '#/components/schemas/FqdnRm' + + Double: + format: double + type: number + description: string with format 'double' as defined in OpenAPI + + DoubleRm: + format: double + type: number + nullable: true + description: > + string with format 'double' as defined in OpenAPI with 'nullable: true' property. + + DurationSec: + type: integer + description: indicating a time in seconds. + + DurationSecRm: + type: integer + nullable: true + description: "indicating a time in seconds with OpenAPI defined 'nullable: true' property." + + Float: + format: float + type: number + description: string with format 'float' as defined in OpenAPI. + + FloatRm: + format: float + type: number + nullable: true + description: > + string with format 'float' as defined in OpenAPI with the OpenAPI defined + 'nullable: true' property. + + Int32: + format: int32 + type: integer + description: string with format 'int32' as defined in OpenAPI. + + Int32Rm: + format: int32 + type: integer + nullable: true + description: > + string with format 'int32' as defined in OpenAPI with the OpenAPI defined + 'nullable: true' property. + + Int64: + type: integer + format: int64 + description: string with format 'int64' as defined in OpenAPI. + + Int64Rm: + format: int64 + type: integer + nullable: true + description: > + string with format 'int64' as defined in OpenAPI with the OpenAPI defined + 'nullable: true' property. + + Ipv4Addr: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + description: > + String identifying a IPv4 address formatted in the 'dotted decimal' notation + as defined in RFC 1166. + + Ipv4AddrRm: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + nullable: true + description: > + String identifying a IPv4 address formatted in the 'dotted decimal' notation + as defined in RFC 1166 with the OpenAPI defined 'nullable: true' property. + + Ipv4AddrMask: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + example: '198.51.0.0/16' + description: > + "String identifying a IPv4 address mask formatted in the 'dotted decimal' notation + as defined in RFC 1166." + + Ipv4AddrMaskRm: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + example: '198.51.0.0/16' + nullable: true + description: > + String identifying a IPv4 address mask formatted in the 'dotted decimal' notation + as defined in RFC 1166 with the OpenAPI defined 'nullable: true' property. + + Ipv6Addr: + type: string +# allOf: +# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' +# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + description: > + String identifying an IPv6 address formatted according to clause 4 of RFC5952. + The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. + + Ipv6AddrRm: + type: string +# allOf: +# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' +# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + nullable: true + description: > + String identifying an IPv6 address formatted according to clause 4 of RFC5952 with the + OpenAPI 'nullable: true' property. + The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. + + Ipv6Prefix: + type: string +# allOf: +# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' +# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + example: '2001:db8:abcd:12::0/64' + description: > + String identifying an IPv6 address prefix formatted according to clause 4 of RFC 5952. + IPv6Prefix data type may contain an individual /128 IPv6 address. + + Ipv6PrefixRm: + type: string +# allOf: +# - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' +# - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + nullable: true + description: > + String identifying an IPv6 address prefix formatted according to clause 4 of RFC 5952 with + the OpenAPI 'nullable: true' property. IPv6Prefix data type may contain an individual + /128 IPv6 address. + + MacAddr48: + type: string + pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' + description: > + String identifying a MAC address formatted in the hexadecimal notation + according to clause 1.1 and clause 2.1 of RFC 7042. + + MacAddr48Rm: + type: string + pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' + nullable: true + description: > + "String identifying a MAC address formatted in the hexadecimal notation according to + clause 1.1 and clause 2.1 of RFC 7042 with the OpenAPI 'nullable: true' property." + + SupportedFeatures: + type: string + pattern: '^[A-Fa-f0-9]*$' + description: > + A string used to indicate the features supported by an API that is used as defined in clause + 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in + hexadecimal representation Each character in the string shall take a value of "0" to "9", + "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in + table 5.2.2-3. The most significant character representing the highest-numbered features + shall appear first in the string, and the character representing features 1 to 4 + shall appear last in the string. The list of features and their numbering (starting with 1) + are defined separately for each API. If the string contains a lower number of characters + than there are defined features for an API, all features that would be represented by + characters that are not present in the string are not supported. + + Uinteger: + type: integer + minimum: 0 + description: Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. + + UintegerRm: + type: integer + minimum: 0 + description: > + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible with + the OpenAPI 'nullable: true' property. + nullable: true + + Uint16: + type: integer + minimum: 0 + maximum: 65535 + description: Integer where the allowed values correspond to the value range of an unsigned 16-bit integer. + + Uint16Rm: + type: integer + minimum: 0 + maximum: 65535 + nullable: true + description: > + Integer where the allowed values correspond to the value range of an unsigned + 16-bit integer with the OpenAPI 'nullable: true' property. + + Uint32: + type: integer + minimum: 0 + maximum: 4294967295 #(2^32)-1 + description: > + Integer where the allowed values correspond to the value range of an unsigned + 32-bit integer. + + Uint32Rm: + format: int32 + type: integer + minimum: 0 + maximum: 4294967295 #(2^32)-1 + nullable: true + description: > + Integer where the allowed values correspond to the value range of an unsigned + 32-bit integer with the OpenAPI 'nullable: true' property. + + Uint64: + type: integer + minimum: 0 + maximum: 18446744073709551615 #(2^64)-1 + description: > + Integer where the allowed values correspond to the value range of an + unsigned 64-bit integer. + + Uint64Rm: + type: integer + minimum: 0 + maximum: 18446744073709551615 #(2^64)-1 + nullable: true + description: > + Integer where the allowed values correspond to the value range of an unsigned + 16-bit integer with the OpenAPI 'nullable: true' property. + + Uri: + type: string + description: String providing an URI formatted according to RFC 3986. + + UriRm: + type: string + nullable: true + description: > + String providing an URI formatted according to RFC 3986 with the OpenAPI + 'nullable: true' property. + + VarUeId: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|gci-.+|gli-.+|.+)$' + description: String represents the SUPI or GPSI + + VarUeIdRm: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|gci-.+|gli-.+|.+)$' + nullable: true + description: "String represents the SUPI or GPSI with the OpenAPI 'nullable: true' property." + + TimeZone: + type: string + example: '-08:00+1' + description: | + String with format "time-numoffset" optionally appended by "daylightSavingTime", where + - "time-numoffset" shall represent the time zone adjusted for daylight saving time and be + encoded as time-numoffset as defined in clause 5.6 of IETF RFC 3339; + - "daylightSavingTime" shall represent the adjustment that has been made and shall be + encoded as "+1" or "+2" for a +1 or +2 hours adjustment. + + The example is for 8 hours behind UTC, +1 hour adjustment for Daylight Saving Time. + + TimeZoneRm: + type: string + nullable: true + description: | + "String with format 'time-numoffset' optionally appended by '', where + - 'time-numoffset' shall represent the time zone adjusted for daylight saving time and be + encoded as time-numoffset as defined in clause 5.6 of IETF RFC 3339; + - 'daylightSavingTime' shall represent the adjustment that has been made and shall be + encoded as '+1' or '+2' for a +1 or +2 hours adjustment. + + But with the OpenAPI 'nullable: true' property." + + StnSr: + type: string + description: String representing the STN-SR as defined in clause 18.6 of 3GPP TS 23.003. + + StnSrRm: + type: string + nullable: true + description: > + String representing the STN-SR as defined in clause 18.6 of 3GPP TS 23.003 + with the OpenAPI 'nullable: true' property. + + CMsisdn: + type: string + pattern: '^[0-9]{5,15}$' + description: String representing the C-MSISDN as defined in clause 18.7 of 3GPP TS 23.003. + + CMsisdnRm: + type: string + pattern: '^[0-9]{5,15}$' + nullable: true + description: > + String representing the C-MSISDN as defined in clause 18.7 of 3GPP TS 23.003 with + the OpenAPI 'nullable: true' property. + + DayOfWeek: + type: integer + minimum: 1 + maximum: 7 + description: > + integer between and including 1 and 7 denoting a weekday. 1 shall indicate Monday, + and the subsequent weekdays shall be indicated with the next higher numbers. + 7 shall indicate Sunday. + + TimeOfDay: + type: string + description: > + String with format partial-time or full-time as defined in clause 5.6 of IETF RFC 3339. + Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). + + EmptyObject: + description: Empty JSON object { }, it is defined with the keyword additionalProperties false + type: object + additionalProperties: false + + Fqdn: + description: Fully Qualified Domain Name + type: string + pattern: '^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$' + minLength: 4 + maxLength: 253 + + FqdnRm: + description: Fully Qualified Domain Name, but it also allows the null value + anyOf: + - $ref: '#/components/schemas/Fqdn' + - $ref: '#/components/schemas/NullValue' + +# +# COMMON ENUMERATED DATA TYPES +# + + PatchOperation: +# anyOf: +# - type: string + enum: + - add + - copy + - move + - remove + - replace + - test +# - type: string +# description: Operations as defined in IETF RFC 6902. + + UriScheme: +# anyOf: +# - type: string + enum: + - http + - https +# - type: string +# description: HTTP and HTTPS URI scheme. + + ChangeType: +# anyOf: +# - type: string + enum: + - ADD + - MOVE + - REMOVE + - REPLACE +# - type: string +# description: Indicates the type of change to be performed. + + HttpMethod: +# anyOf: +# - type: string + enum: + - GET + - POST + - PUT + - DELETE + - PATCH + - OPTIONS + - HEAD + - CONNECT + - TRACE +# - type: string +# description: HTTP methodes. + + NullValue: + enum: + - null + description: JSON's null value. + + + MatchingOperator: +# anyOf: +# - type: string + enum: + - FULL_MATCH + - MATCH_ALL + - STARTS_WITH + - NOT_START_WITH + - ENDS_WITH + - NOT_END_WITH + - CONTAINS + - NOT_CONTAIN +# - type: string +# description: the matching operation. + +# +# COMMON STRUCTURED DATA TYPES +# + + ProblemDetails: + description: Provides additional information in an error response. + type: object + properties: + type: + $ref: '#/components/schemas/Uri' + title: + type: string + status: + type: integer + detail: + type: string + description: A human-readable explanation specific to this occurrence of the problem. + instance: + $ref: '#/components/schemas/Uri' + + cause: + type: string + description: > + A machine-readable application error cause specific to this occurrence of the problem. + This IE should be present and provide application-related error information, if + available. + + invalidParams: + type: array + items: + $ref: '#/components/schemas/InvalidParam' + minItems: 1 + supportedFeatures: + $ref: '#/components/schemas/SupportedFeatures' + accessTokenError: + $ref: 'TS29510_Nnrf_AccessToken.yaml#/components/schemas/AccessTokenErr' + accessTokenRequest: + $ref: 'TS29510_Nnrf_AccessToken.yaml#/components/schemas/AccessTokenReq' + nrfId: + $ref: '#/components/schemas/Fqdn' + + Link: + type: object + properties: + href: + $ref: '#/components/schemas/Uri' + description: It contains the URI of the linked resource. + + LinkRm: + type: object + properties: + href: + $ref: '#/components/schemas/Uri' + nullable: true + description: > + It contains the URI of the linked resource with the OpenAPI 'nullable: true' property. + + PatchItem: + type: object + properties: + op: + $ref: '#/components/schemas/PatchOperation' + path: + type: string + description: > + contains a JSON pointer value (as defined in IETF RFC 6901) that references + a location of a resource on which the patch operation shall be performed. + from: + type: string + description: > + indicates the path of the source JSON element (according to JSON Pointer syntax) + being moved or copied to the location indicated by the "path" attribute. + value: {} + required: + - op + - path + description: it contains information on data to be changed. + + LinksValueSchema: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Link' + minItems: 1 + - $ref: '#/components/schemas/Link' + description: A list of mutually exclusive alternatives of 1 or more links. + + SelfLink: + type: object + properties: + self: + $ref: '#/components/schemas/Link' + required: + - self + description: It contains the URI of the linked resource. + + InvalidParam: + type: object + properties: + param: + type: string + description: > + If the invalid parameter is an attribute in a JSON body, this IE shall contain the + attribute's name and shall be encoded as a JSON Pointer. If the invalid parameter is + an HTTP header, this IE shall be formatted as the concatenation of the string "header " + plus the name of such header. If the invalid parameter is a query parameter, this IE + shall be formatted as the concatenation of the string "query " plus the name of such + query parameter. If the invalid parameter is a variable part in the path of a resource + URI, this IE shall contain the name of the variable, including the symbols "{" and "}" + used in OpenAPI specification as the notation to represent variable path segments. + reason: + type: string + description: > + A human-readable reason, e.g. "must be a positive integer". In cases involving failed + operations in a PATCH request, the reason string should identify the operation that + failed using the operation's array index to assist in correlation of the invalid + parameter with the failed operation, e.g." Replacement value invalid for attribute + (failed operation index= 4)" + required: + - param + description: It contains an invalid parameter and a related description. + + ChangeItem: + type: object + properties: + op: + $ref: '#/components/schemas/ChangeType' + path: + type: string + description: > + contains a JSON pointer value (as defined in IETF RFC 6901) that references a target + location within the resource on which the change has been applied. + from: + type: string + description: > + indicates the path of the source JSON element (according to JSON Pointer syntax) + being moved or copied to the location indicated by the "path" attribute. It shall + be present if the "op" attribute is of value "MOVE". + origValue: {} + newValue: {} + required: + - op + - path + description: It contains data which need to be changed. + + NotifyItem: + type: object + required: + - resourceId + - changes + properties: + resourceId: + $ref: '#/components/schemas/Uri' + changes: + type: array + items: + $ref: '#/components/schemas/ChangeItem' + minItems: 1 + description: Indicates changes on a resource. + + ComplexQuery: + oneOf: + - $ref: '#/components/schemas/Cnf' + - $ref: '#/components/schemas/Dnf' + description: > + The ComplexQuery data type is either a conjunctive normal form or a disjunctive normal form. + The attribute names "cnfUnits" and "dnfUnits" (see clause 5.2.4.11 and clause 5.2.4.12) + serve as discriminator. + + Cnf: + type: object + required: + - cnfUnits + properties: + cnfUnits: + type: array + items: + $ref: '#/components/schemas/CnfUnit' + minItems: 1 + description: A conjunctive normal form + + Dnf: + type: object + required: + - dnfUnits + properties: + dnfUnits: + type: array + items: + $ref: '#/components/schemas/DnfUnit' + minItems: 1 + description: A disjunctive normal form. + + CnfUnit: + type: object + required: + - cnfUnit + properties: + cnfUnit: + type: array + items: + $ref: '#/components/schemas/Atom' + minItems: 1 + description: > + During the processing of cnfUnits attribute, all the members in the array shall be + interpreted as logically concatenated with logical "AND". + + DnfUnit: + type: object + required: + - dnfUnit + properties: + dnfUnit: + type: array + items: + $ref: '#/components/schemas/Atom' + minItems: 1 + description: > + During the processing of dnfUnits attribute, all the members in the array shall be + interpreted as logically concatenated with logical "OR". + + Atom: + description: contains a search parameter and its positive or negative content. + type: object + required: + - attr + - value + properties: + attr: + type: string + description: contains the name of a defined query parameter. + value: {} + negative: + type: boolean + description: indicates whether the negative condition applies for the query condition. + + PatchResult: + description: The execution report result on failed modification. + type: object + required: + - report + properties: + report: + type: array + items: + $ref: '#/components/schemas/ReportItem' + minItems: 1 + description: > + The execution report contains an array of report items. Each report item indicates one + failed modification. + + ReportItem: + type: object + required: + - path + properties: + path: + type: string + description: > + Contains a JSON pointer value (as defined in IETF RFC 6901) that references a + location of a resource to which the modification is subject. + reason: + type: string + description: > + A human-readable reason providing details on the reported modification failure. + The reason string should identify the operation that failed using the operation's + array index to assist in correlation of the invalid parameter with the failed + operation, e.g. "Replacement value invalid for attribute (failed operation index= 4)". + description: indicates performed modivications. + + HalTemplate: + description: > + Hypertext Application Language (HAL) template contains the extended 3GPP hypermedia format. + type: object + required: + - method + properties: + title: + type: string + description: A human-readable string that can be used to identify this template + method: + $ref: '#/components/schemas/HttpMethod' + contentType: + type: string + description: > + The media type that should be used for the corresponding request. If the attribute + is missing, or contains an unrecognized value, the client should act as if the + contentType is set to "application/json". + properties: + type: array + items: + $ref: '#/components/schemas/Property' + minItems: 1 + description: > + The properties that should be included in the body of the corresponding request. + If the contentType attribute is set to "application/json", then this attribute + describes the attributes of the JSON object of the body. + + Property: + description: > + If the contentType attribute is set to "application/json", then this attribute describes + the attributes of the JSON object of the body. + type: object + required: + - name + properties: + name: + type: string + description: The name of the property + required: + type: boolean + description: > + Indicates whether the property is required – true= required – + false(default)= not required. + regex: + type: string + description: A regular expression string to be applied to the value of the property. + value: + type: string + description: The property value. When present, it shall be a valid JSON string. + + RedirectResponse: + description: > + The response shall include a Location header field containing a different URI + (pointing to a different URI of an other service instance), or the same URI if a request + is redirected to the same target resource via a different SCP. + type: object + properties: + cause: + type: string + targetScp: + $ref: '#/components/schemas/Uri' + targetSepp: + $ref: '#/components/schemas/Uri' + + TunnelAddress: + description: Tunnel address + type: object + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + required: + - portNumber + anyOf: + - required: [ ipv4Addr ] + - required: [ ipv6Addr ] + + + FqdnPatternMatchingRule: + description: a matching rule for a FQDN pattern + type: object + oneOf: + - required: [ regex ] + - required: [ stringMatchingRule ] + properties: + regex: + type: string + stringMatchingRule: + $ref: '#/components/schemas/StringMatchingRule' + + + StringMatchingRule: + description: A list of conditions for string matching + type: object + properties: + stringMatchingConditions: + type: array + items: + $ref: '#/components/schemas/StringMatchingCondition' + minItems: 1 + + StringMatchingCondition: + description: A String with Matching Operator + type: object + properties: + matchingString: + type: string + matchingOperator: + $ref: '#/components/schemas/MatchingOperator' + required: + - matchingOperator + + + +# +# Data Types related to Subscription, Identification and Numbering as defined in clause 5.3 +# + +# +# SIMPLE DATA TYPES +# + Dnn: + type: string + description: > + String representing a Data Network as defined in clause 9A of 3GPP TS 23.003; + it shall contain either a DNN Network Identifier, or a full DNN with both the Network + Identifier and Operator Identifier, as specified in 3GPP TS 23.003 clause 9.1.1 and 9.1.2. + It shall be coded as string in which the labels are separated by dots + (e.g. "Label1.Label2.Label3"). + DnnRm: + type: string + nullable: true + description: > + String representing a Data Network as defined in clause 9A of 3GPP TS 23.003; + it shall contain either a DNN Network Identifier, or a full DNN with both the + Network Identifier and Operator Identifier, as specified in 3GPP TS 23.003 clause 9.1.1 + and 9.1.2. It shall be coded as string in which the labels are separated by dots + (e.g. 'Label1.Label2.Label3') with the OpenAPI 'nullable: true' property. + + WildcardDnn: + type: string + pattern: '^[*]$' + description: String representing the Wildcard DNN. It shall contain the string "*". + + WildcardDnnRm: + type: string + pattern: '^[*]$' + nullable: true + description: > + String representing the Wildcard DNN. It shall contain the string '*' but with the + OpenAPI 'nullable: true' property. + + Gpsi: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + description: > + String identifying a Gpsi shall contain either an External Id or an MSISDN. + It shall be formatted as follows -External Identifier= "extid-'extid', where 'extid' + shall be formatted according to clause 19.7.2 of 3GPP TS 23.003 that describes an + External Identifier. + + GpsiRm: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + nullable: true + description: > + String identifying a Gpsi shall contain either an External Id or an MSISDN. It shall be + formatted as follows -External Identifier= 'extid-'extid', where 'extid' shall be formatted + according to clause 19.7.2 of 3GPP TS 23.003 that describes an External Identifier with the + OpenAPI 'nullable: true' property. + + GroupId: + type: string + pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' + description: > + String identifying a group of devices network internal globally unique ID which identifies + a set of IMSIs, as specified in clause 19.9 of 3GPP TS 23.003. + + GroupIdRm: + type: string + pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' + nullable: true + description: > + String identifying a group of devices network internal globally unique ID which + identifies a set of IMSIs, as specified in clause 19.9 of 3GPP TS 23.003 with the + OpenAPI 'nullable: true' property. + + ExternalGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + description: > + String identifying External Group Identifier that identifies a group made up of one or + more subscriptions associated to a group of IMSIs, as specified in clause 19.7.3 of 3GPP + TS 23.003. + + ExternalGroupIdRm: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + nullable: true + description: > + String identifying External Group Identifier that identifies a group made up of one or + more subscriptions associated to a group of IMSIs, as specified in clause 19.7.3 of + 3GPP TS 23.003 with the OpenAPI 'nullable: true' property. + + Pei: + type: string + pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|mac((-[0-9a-fA-F]{2}){6})(-untrusted)?|eui((-[0-9a-fA-F]{2}){8})|.+)$' + description: > + String representing a Permanent Equipment Identifier that may contain - an IMEI or IMEISV, + as specified in clause 6.2 of 3GPP TS 23.003; a MAC address for a 5G-RG or FN-RG via + wireline access, with an indication that this address cannot be trusted for regulatory + purpose if this address cannot be used as an Equipment Identifier of the FN-RG, as + specified in clause 4.7.7 of 3GPP TS23.316. Examples are imei-012345678901234 or + imeisv-0123456789012345. + + PeiRm: + type: string + pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|mac((-[0-9a-fA-F]{2}){6})(-untrusted)?|eui((-[0-9a-fA-F]{2}){8})|.+)$' + nullable: true + description: > + This data type is defined in the same way as the 'Pei' data type but with the OpenAPI 'nullable: true' property. + + Supi: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gci-.+|gli-.+|.+)$' + description: | + String identifying a Supi that shall contain either an IMSI, a network specific identifier, + a Global Cable Identifier (GCI) or a Global Line Identifier (GLI) as specified in clause + 2.2A of 3GPP TS 23.003. It shall be formatted as follows + - for an IMSI "imsi-", where shall be formatted according to clause 2.2 + of 3GPP TS 23.003 that describes an IMSI. + - for a network specific identifier "nai-, where shall be formatted + according to clause 28.7.2 of 3GPP TS 23.003 that describes an NAI. + - for a GCI "gci-", where shall be formatted according to clause 28.15.2 + of 3GPP TS 23.003. + - for a GLI "gli-", where shall be formatted according to clause 28.16.2 of + 3GPP TS 23.003.To enable that the value is used as part of an URI, the string shall + only contain characters allowed according to the "lower-with-hyphen" naming convention + defined in 3GPP TS 29.501. + + SupiRm: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gci-.+|gli-.+|.+)$' + nullable: true + description: > + This data type is defined in the same way as the 'Supi' data type, but with the + OpenAPI 'nullable: true' property. + + NfInstanceId: + type: string + format: uuid + description: > + String uniquely identifying a NF instance. The format of the NF Instance ID shall be a + Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122. + + AmfId: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: > + String identifying the AMF ID composed of AMF Region ID (8 bits), AMF Set ID (10 bits) + and AMF Pointer (6 bits) as specified in clause 2.10.1 of 3GPP TS 23.003. It is encoded + as a string of 6 hexadecimal characters (i.e., 24 bits). + + AmfRegionId: + type: string + pattern: '^[A-Fa-f0-9]{2}$' + description: > + String identifying the AMF Set ID (10 bits) as specified in clause 2.10.1 of 3GPP TS 23.003. + It is encoded as a string of 3 hexadecimal characters where the first character is limited + to values 0 to 3 (i.e. 10 bits) + + AmfSetId: + type: string + pattern: '^[0-3][A-Fa-f0-9]{2}$' + description: > + String identifying the AMF Set ID (10 bits) as specified in clause 2.10.1 of 3GPP TS 23.003. + It is encoded as a string of 3 hexadecimal characters where the first character is limited + to values 0 to 3 (i.e. 10 bits). + + RfspIndex: + type: integer + minimum: 1 + maximum: 256 + description: > + Unsigned integer representing the "Subscriber Profile ID for RAT/Frequency Priority" + as specified in 3GPP TS 36.413. + + RfspIndexRm: + type: integer + minimum: 1 + maximum: 256 + nullable: true + description: > + Unsigned integer representing the 'Subscriber Profile ID for RAT/Frequency Priority' + as specified in 3GPP TS 36.413 with the OpenAPI 'nullable: true' property. + + NfGroupId: + type: string + description: Identifier of a group of NFs. + + MtcProviderInformation: + type: string + description: String uniquely identifying MTC provider information. + + CagId: + type: string + pattern: '^[A-Fa-f0-9]{8}$' + description: String containing a Closed Access Group Identifier. + + SupiOrSuci: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.*|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$' + description: String identifying a SUPI or a SUCI. + +# +# STRUCTURED DATA TYPES +# + Guami: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnIdNid' + amfId: + $ref: '#/components/schemas/AmfId' + required: + - plmnId + - amfId + description: Globally Unique AMF Identifier constructed out of PLMN, Network and AMF identity. + + GuamiRm: + anyOf: + - $ref: '#/components/schemas/Guami' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Guami' data type, but with the OpenAPI + 'nullable: true' property. + + NetworkId: + type: object + properties: + mnc: + $ref: '#/components/schemas/Mnc' + mcc: + $ref: '#/components/schemas/Mcc' + description: contains PLMN and Network identity. + + +# +# Data Types related to 5G Network as defined in clause 5.4 +# + +# +# SIMPLE DATA TYPES +# + ApplicationId: + type: string + description: String providing an application identifier. + ApplicationIdRm: + type: string + nullable: true + description: > + String providing an application identifier with the OpenAPI 'nullable: true' property. + + PduSessionId: + type: integer + minimum: 0 + maximum: 255 + description: > + Unsigned integer identifying a PDU session, within the range 0 to 255, as specified in + clause 11.2.3.1b, bits 1 to 8, of 3GPP TS 24.007. If the PDU Session ID is allocated by the + Core Network for UEs not supporting N1 mode, reserved range 64 to 95 is used. PDU Session ID + within the reserved range is only visible in the Core Network. + + Mcc: + type: string + pattern: '^\d{3}$' + description: > + Mobile Country Code part of the PLMN, comprising 3 digits, as defined in clause 9.3.3.5 + of 3GPP TS 38.413. + + MccRm: + type: string + pattern: '^\d{3}$' + nullable: true + description: > + Mobile Country Code part of the PLMN, comprising 3 digits, as defined in clause 9.3.3.5 of + 3GPP TS 38.413 with the OpenAPI 'nullable: true' property. + + Mnc: + type: string + pattern: '^\d{2,3}$' + description: Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in clause 9.3.3.5 of 3GPP TS 38.413. + + MncRm: + type: string + pattern: '^\d{2,3}$' + nullable: true + description: > + Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in clause + 9.3.3.5 of 3GPP TS 38.413 with the OpenAPI 'nullable: true' property. + + Tac: + type: string + pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' + description: > + 2 or 3-octet string identifying a tracking area code as specified in clause 9.3.3.10 + of 3GPP TS 38.413, in hexadecimal representation. Each character in the string shall + take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The + most significant character representing the 4 most significant bits of the TAC shall + appear first in the string, and the character representing the 4 least significant bit + of the TAC shall appear last in the string. + + TacRm: + type: string + pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' + nullable: true + description: > + This data type is defined in the same way as the 'Tac' data type, but with the + OpenAPI 'nullable: true' property. + + EutraCellId: + type: string + pattern: '^[A-Fa-f0-9]{7}$' + description: > + 28-bit string identifying an E-UTRA Cell Id as specified in clause 9.3.1.9 of + 3GPP TS 38.413, in hexadecimal representation. Each character in the string shall take a + value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most + significant character representing the 4 most significant bits of the Cell Id shall appear + first in the string, and the character representing the 4 least significant bit of the + Cell Id shall appear last in the string. + + EutraCellIdRm: + type: string + pattern: '^[A-Fa-f0-9]{7}$' + nullable: true + description: > + This data type is defined in the same way as the 'EutraCellId' data type, but with + the OpenAPI 'nullable: true' property. + + NrCellId: + type: string + pattern: '^[A-Fa-f0-9]{9}$' + description: > + 36-bit string identifying an NR Cell Id as specified in clause 9.3.1.7 of 3GPP TS 38.413, + in hexadecimal representation. Each character in the string shall take a value of "0" to + "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character + representing the 4 most significant bits of the Cell Id shall appear first in the string, + and the character representing the 4 least significant bit of the Cell Id shall appear last + in the string. + + NrCellIdRm: + type: string + pattern: '^[A-Fa-f0-9]{9}$' + nullable: true + description: > + This data type is defined in the same way as the 'NrCellId' data type, but with the + OpenAPI 'nullable: true' property. + Dnai: + type: string + description: DNAI (Data network access identifier), see clause 5.6.7 of 3GPP TS 23.501. + + DnaiRm: + type: string + nullable: true + description: > + This data type is defined in the same way as the 'Dnai' data type, but with the + OpenAPI 'nullable: true' property. + + 5GMmCause: + $ref: '#/components/schemas/Uinteger' + + AmfName: + $ref: '#/components/schemas/Fqdn' + + AreaCode: + type: string + description: Values are operator specific. + + AreaCodeRm: + type: string + nullable: true + description: > + This data type is defined in the same way as the 'AreaCode' data type, but with the + OpenAPI 'nullable: true' property. + + N3IwfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + This represents the identifier of the N3IWF ID as specified in clause 9.3.1.57 of + 3GPP TS 38.413 in hexadecimal representation. Each character in the string shall take a value + of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant + character representing the 4 most significant bits of the N3IWF ID shall appear first in the + string, and the character representing the 4 least significant bit of the N3IWF ID shall + appear last in the string. + + WAgfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + This represents the identifier of the W-AGF ID as specified in clause 9.3.1.162 of + 3GPP TS 38.413 in hexadecimal representation. Each character in the string shall take a + value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most + significant character representing the 4 most significant bits of the W-AGF ID shall + appear first in the string, and the character representing the 4 least significant bit + of the W-AGF ID shall appear last in the string. + + TngfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + This represents the identifier of the TNGF ID as specified in clause 9.3.1.161 of + 3GPP TS 38.413 in hexadecimal representation. Each character in the string shall take a value + of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant + character representing the 4 most significant bits of the TNGF ID shall appear first in + the string, and the character representing the 4 least significant bit of the TNGF ID + shall appear last in the string. + + NgeNbId: + type: string + pattern: '^(MacroNGeNB-[A-Fa-f0-9]{5}|LMacroNGeNB-[A-Fa-f0-9]{6}|SMacroNGeNB-[A-Fa-f0-9]{5})$' + description: > + This represents the identifier of the ng-eNB ID as specified in clause 9.3.1.8 of + 3GPP TS 38.413. The value of the ng-eNB ID shall be encoded in hexadecimal representation. + Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and + shall represent 4 bits. The padding 0 shall be added to make multiple nibbles, so the most + significant character representing the padding 0 if required together with the 4 most + significant bits of the ng-eNB ID shall appear first in the string, and the character + representing the 4 least significant bit of the ng-eNB ID (to form a nibble) shall appear + last in the string. + + example: SMacroNGeNB-34B89 + Nid: + type: string + pattern: '^[A-Fa-f0-9]{11}$' + description: > + This represents the Network Identifier, which together with a PLMN ID is used to identify + an SNPN (see 3GPP TS 23.003 and 3GPP TS 23.501 clause 5.30.2.1). + + NidRm: + type: string + pattern: '^[A-Fa-f0-9]{11}$' + nullable: true + description: > + This data type is defined in the same way as the 'Nid' data type, but with the OpenAPI + 'nullable: true' property." + + NfSetId: + type: string + description: > + NF Set Identifier (see clause 28.12 of 3GPP TS 23.003), formatted as the following string + "set.set.5gc.mnc.mcc", or + "set.set.5gc.nid.mnc.mcc" with + encoded as defined in clause 5.4.2 ("Mcc" data type definition) + encoding the Mobile Network Code part of the PLMN, comprising 3 digits. + If there are only 2 significant digits in the MNC, one "0" digit shall be inserted + at the left side to fill the 3 digits coding of MNC. Pattern: '^[0-9]{3}$' + encoded as a value defined in Table 6.1.6.3.3-1 of 3GPP TS 29.510 but + with lower case characters encoded as a string of characters consisting of + alphabetic characters (A-Z and a-z), digits (0-9) and/or the hyphen (-) and that + shall end with either an alphabetic character or a digit. + + NfServiceSetId: + type: string + description: > + NF Service Set Identifier (see clause 28.12 of 3GPP TS 23.003) formatted as the following + string "set.sn.nfi.5gc.mnc.mcc", or + "set.sn.nfi.5gc.nid.mnc.mcc" with + encoded as defined in clause 5.4.2 ("Mcc" data type definition) + encoding the Mobile Network Code part of the PLMN, comprising 3 digits. + If there are only 2 significant digits in the MNC, one "0" digit shall be inserted + at the left side to fill the 3 digits coding of MNC. Pattern: '^[0-9]{3}$' + encoded as defined in clause 5.4.2 ("Nid" data type definition) + encoded as defined in clause 5.3.2 + encoded as defined in 3GPP TS 29.510 + encoded as a string of characters consisting of alphabetic + characters (A-Z and a-z), digits (0-9) and/or the hyphen (-) and that shall end + with either an alphabetic character or a digit. + + PlmnAssiUeRadioCapId: + $ref: '#/components/schemas/Bytes' + + ManAssiUeRadioCapId: + $ref: '#/components/schemas/Bytes' + + TypeAllocationCode: + type: string + pattern: '^[0-9]{8}$' + description: > + Type Allocation Code (TAC) of the UE, comprising the initial eight-digit portion of the + 15-digit IMEI and 16-digit IMEISV codes. See clause 6.2 of 3GPP TS 23.003. + + HfcNId: + type: string + maxLength: 6 + description: > + This IE represents the identifier of the HFC node Id as specified in CableLabs + WR-TR-5WWC-ARCH. It is provisioned by the wireline operator as part of wireline + operations and may contain up to six characters. + + HfcNIdRm: + type: string + maxLength: 6 + nullable: true + description: > + This data type is defined in the same way as the 'HfcNId' data type, but with the + OpenAPI 'nullable: true' property. + + ENbId: + type: string + pattern: '^(MacroeNB-[A-Fa-f0-9]{5}|LMacroeNB-[A-Fa-f0-9]{6}|SMacroeNB-[A-Fa-f0-9]{5}|HomeeNB-[A-Fa-f0-9]{7})$' + description: > + This represents the identifier of the eNB ID as specified in clause 9.2.1.37 of + 3GPP TS 36.413. The string shall be formatted with the following pattern + '^('MacroeNB-[A-Fa-f0-9]{5}|LMacroeNB-[A-Fa-f0-9]{6}|SMacroeNB-[A-Fa-f0-9]{5} + |HomeeNB-[A-Fa-f0-9]{7})$'. The value of the eNB ID shall be encoded in hexadecimal + representation. Each character in the string shall take a value of "0" to "9", "a" to "f" + or "A" to "F" and shall represent 4 bits. The padding 0 shall be added to make multiple + nibbles, so the most significant character representing the padding 0 if required together + with the 4 most significant bits of the eNB ID shall appear first in the string, and the + character representing the 4 least significant bit of the eNB ID (to form a nibble) shall + appear last in the string. + + Gli: + $ref: '#/components/schemas/Bytes' + Gci: + type: string + description: > + Global Cable Identifier uniquely identifying the connection between the 5G-CRG or FN-CRG + to the 5GS. See clause 28.15.4 of 3GPP TS 23.003. This shall be encoded as a string per + clause 28.15.4 of 3GPP TS 23.003, and compliant with the syntax specified in clause 2.2 + of IETF RFC 7542 for the username part of a NAI. The GCI value is specified in + CableLabs WR-TR-5WWC-ARCH. + + NsSrg: + type: string + description: > + String providing a Network Slice Simultaneous Registration Group. See clause 5.15.12 of + 3GPP TS 23.501 + + NsSrgRm: + type: string + nullable: true + description: > + String providing a Network Slice Simultaneous Registration Group with the OpenAPI + "nullable: true" property. See clause 5.15.12 of 3GPP TS 23.501 + + + RelayServiceCode: + type: integer + minimum: 0 + maximum: 16777215 + description: > + Relay Service Code to identify a connectivity service provided by the UE-to-Network relay. + + 5GPrukId: + type: string + description: > + A string carrying the CP-PRUK ID of the remote UE. The CP-PRUK ID is a string in NAI + format as specified in clause 28.7.11 of 3GPP TS 23.003. + pattern: '^rid[0-9]{1,4}\.pid[0-9a-fA-F]+\@prose-cp\.5gc\.mnc[0-9]{2,3}\.mcc[0-9]{3}\.3gppnetwork\.org$' + + NsagId: + type: integer + description: > + The Network Slice AS Group ID, see 3GPP TS 38.413 + + NsagIdRm: + type: integer + nullable: true + description: > + This data type is defined in the same way as the "NsagId" data type, but with the OpenAPI "nullable: true" property + + +# +# ENUMERATED DATA TYPES +# + + AccessType: + type: string + enum: + - 3GPP_ACCESS + - NON_3GPP_ACCESS + description: Indicates whether the access is via 3GPP or via non-3GPP. + + AccessTypeRm: + anyOf: + - $ref: '#/components/schemas/AccessType' + - $ref: '#/components/schemas/NullValue' + description: > + Indicates wether the access is via 3GPP or via non-3GPP but with the OpenAPI + 'nullable: true' property." + + RatType: +# anyOf: +# - type: string + enum: + - NR + - EUTRA + - WLAN + - VIRTUAL + - NBIOT + - WIRELINE + - WIRELINE_CABLE + - WIRELINE_BBF + - LTE-M + - NR_U + - EUTRA_U + - TRUSTED_N3GA + - TRUSTED_WLAN + - UTRA + - GERA + - NR_LEO + - NR_MEO + - NR_GEO + - NR_OTHER_SAT + - NR_REDCAP +# - type: string +# description: Indicates the radio access used. + + RatTypeRm: + anyOf: + - $ref: '#/components/schemas/RatType' + - $ref: '#/components/schemas/NullValue' + description: > + Provides information about the radio access but with the OpenAPI 'nullable: true' property. + + PduSessionType: +# anyOf: +# - type: string + enum: + - IPV4 + - IPV6 + - IPV4V6 + - UNSTRUCTURED + - ETHERNET +# - type: string +# description: > +# PduSessionType indicates the type of a PDU session. It shall comply with the provisions +# defined in table 5.4.3.3-1. + + PduSessionTypeRm: + anyOf: + - $ref: '#/components/schemas/PduSessionType' + - $ref: '#/components/schemas/NullValue' + description: > + PduSessionType indicates the type of a PDU session. It shall comply with the provisions + defined in table 5.4.3.3-1 but with the OpenAPI "nullable: true" property. + + UpIntegrity: +# anyOf: +# - type: string + enum: + - REQUIRED + - PREFERRED + - NOT_NEEDED +# - type: string +# description: > +# indicates whether UP integrity protection is required, preferred or not needed for all +# the traffic on the PDU Session. It shall comply with the provisions defined in +# table 5.4.3.4-1. + + UpIntegrityRm: + anyOf: + - $ref: '#/components/schemas/UpIntegrity' + - $ref: '#/components/schemas/NullValue' + description: > + indicates whether UP integrity protection is required, preferred or not needed for all + the traffic on the PDU Session. It shall comply with the provisions defined in + table 5.4.3.4-1. + + UpConfidentiality: +# anyOf: +# - type: string + enum: + - REQUIRED + - PREFERRED + - NOT_NEEDED +# - type: string +# description: > +# indicates whether UP confidentiality protection is required, preferred or not needed for +# all the traffic on the PDU Session. It shall comply with the provisions defined in +# table 5.4.3.5-1. + + UpConfidentialityRm: + anyOf: + - $ref: '#/components/schemas/UpConfidentiality' + - $ref: '#/components/schemas/NullValue' + description: > + indicates whether UP integrity protection is required, preferred or not needed for all the + traffic on the PDU Session. It shall comply with the provisions defined in table 5.4.3.4-1, + but with the OpenAPI 'nullable: true' property. + + SscMode: +# anyOf: +# - type: string + enum: + - SSC_MODE_1 + - SSC_MODE_2 + - SSC_MODE_3 +# - type: string +# description: > +# represents the service and session continuity mode It shall comply with the provisions defined in table 5.4.3.6-1. + + SscModeRm: + anyOf: + - $ref: '#/components/schemas/SscMode' + - $ref: '#/components/schemas/NullValue' + description: > + represents the service and session continuity mode It shall comply with the provisions + defined in table 5.4.3.6-1 but with the OpenAPI 'nullable: true' property. + + DnaiChangeType: +# anyOf: +# - type: string + enum: + - EARLY + - EARLY_LATE + - LATE +# - type: string +# description: > +# This string provides forward-compatibility with future extensions to the enumeration +# but is not used to encode content defined in the present version of this API. +# +# description: | +# Possible values are: +# - EARLY: Early notification of UP path reconfiguration. +# - EARLY_LATE: Early and late notification of UP path reconfiguration. This value shall +# only be present in the subscription to the DNAI change event. +# - LATE: Late notification of UP path reconfiguration. + + DnaiChangeTypeRm: + anyOf: + - $ref: '#/components/schemas/DnaiChangeType' + - $ref: '#/components/schemas/NullValue' + description: > + It can take the values as specified for DnaiChangeType but with the OpenAPI + 'nullable: true' property. + + RestrictionType: +# anyOf: +# - type: string + enum: + - ALLOWED_AREAS + - NOT_ALLOWED_AREAS +# - type: string +# description: It contains the restriction type ALLOWED_AREAS or NOT_ALLOWED_AREAS. + + RestrictionTypeRm: + anyOf: + - $ref: '#/components/schemas/RestrictionType' + - $ref: '#/components/schemas/NullValue' + description: > + It contains the restriction type ALLOWED_AREAS or NOT_ALLOWED_AREAS but with the + OpenAPI 'nullable: true' property. + + CoreNetworkType: +# anyOf: +# - type: string + enum: + - 5GC + - EPC +# - type: string +# description: It contains the Core Network type 5GC or EPC. + + CoreNetworkTypeRm: + anyOf: + - $ref: '#/components/schemas/CoreNetworkType' + - $ref: '#/components/schemas/NullValue' + description: > + It contains the Core Network type 5GC or EPC but with the OpenAPI + 'nullable: true' property. + + PresenceState: +# anyOf: +# - type: string + enum: + - IN_AREA + - OUT_OF_AREA + - UNKNOWN + - INACTIVE +# - type: string +# description: | +# Possible values are: +# -IN_AREA: Indicates that the UE is inside or enters the presence reporting area. +# -OUT_OF_AREA: Indicates that the UE is outside or leaves the presence reporting area +# -UNKNOW: Indicates it is unknown whether the UE is in the presence reporting area or not +# -INACTIVE: Indicates that the presence reporting area is inactive in the serving node. + + StationaryIndication: +# anyOf: +# - type: string + enum: + - STATIONARY + - MOBILE +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are: +# - STATIONARY: Identifies the UE is stationary +# - MOBILE: Identifies the UE is mobile + + StationaryIndicationRm: + anyOf: + - $ref: '#/components/schemas/StationaryIndication' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'StationaryIndication' enumeration, + but with the OpenAPI 'nullable: true' property." + + ScheduledCommunicationType: +# anyOf: +# - type: string + enum: + - DOWNLINK_ONLY + - UPLINK_ONLY + - BIDIRECTIONAL +# - type: string +# description: | +# Possible values are: +# -DOWNLINK_ONLY: Downlink only +# -UPLINK_ONLY: Uplink only +# -BIDIRECTIONA: Bi-directional + + ScheduledCommunicationTypeRm: + anyOf: + - $ref: '#/components/schemas/ScheduledCommunicationType' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'ScheduledCommunicationTypen' + enumeration, but with the OpenAPI 'nullable: true' property." + + TrafficProfile: +# anyOf: +# - type: string + enum: + - SINGLE_TRANS_UL + - SINGLE_TRANS_DL + - DUAL_TRANS_UL_FIRST + - DUAL_TRANS_DL_FIRST + - MULTI_TRANS +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# +# description: | +# Possible values are: +# - SINGLE_TRANS_UL: Uplink single packet transmission. +# - SINGLE_TRANS_DL: Downlink single packet transmission. +# - DUAL_TRANS_UL_FIRST: Dual packet transmission, firstly uplink packet transmission +# with subsequent downlink packet transmission. +# - DUAL_TRANS_DL_FIRST: Dual packet transmission, firstly downlink packet transmission +# with subsequent uplink packet transmission. + + TrafficProfileRm: + anyOf: + - $ref: '#/components/schemas/TrafficProfile' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'TrafficProfile' enumeration, but + with the OpenAPI 'nullable: true' property. + + LcsServiceAuth: + anyOf: + - type: string + enum: + - "LOCATION_ALLOWED_WITH_NOTIFICATION" + - "LOCATION_ALLOWED_WITHOUT_NOTIFICATION" + - "LOCATION_ALLOWED_WITHOUT_RESPONSE" + - "LOCATION_RESTRICTED_WITHOUT_RESPONSE" + - "NOTIFICATION_ONLY" + - "NOTIFICATION_AND_VERIFICATION_ONLY" + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - "LOCATION_ALLOWED_WITH_NOTIFICATION": Location allowed with notification + - "LOCATION_ALLOWED_WITHOUT_NOTIFICATION": Location allowed without notification + - "LOCATION_ALLOWED_WITHOUT_RESPONSE": Location with notification and privacy + verification; location allowed if no response + - "LOCATION_RESTRICTED_WITHOUT_RESPONSE": Location with notification and privacy + verification; location restricted if no response + - "NOTIFICATION_ONLY": Notification only + - "NOTIFICATION_AND_VERIFICATION_ONLY": Notification and privacy verification only + UeAuth: +# anyOf: +# - type: string + enum: + - AUTHORIZED + - NOT_AUTHORIZED +# - type: string +# description: | +# Possible values are: +# - AUTHORIZED: Indicates that the UE is authorized. +# - NOT_AUTHORIZED: Indicates that the UE is not authorized. + + DlDataDeliveryStatus: +# anyOf: +# - type: string + enum: + - BUFFERED + - TRANSMITTED + - DISCARDED +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are: +# - BUFFERED: The first downlink data is buffered with extended buffering matching the +# source of the downlink traffic. +# - TRANSMITTED: The first downlink data matching the source of the downlink traffic is +# transmitted after previous buffering or discarding of corresponding packet(s) because +# the UE of the PDU Session becomes ACTIVE, and buffered data can be delivered to UE. +# - DISCARDED: The first downlink data matching the source of the downlink traffic is +# discarded because the Extended Buffering time, as determined by the SMF, expires or +# the amount of downlink data to be buffered is exceeded. + + DlDataDeliveryStatusRm: + anyOf: + - $ref: '#/components/schemas/DlDataDeliveryStatus' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the ' DlDataDeliveryStatus ' data type, + but with the OpenAPI 'nullable: true' property. + + AuthStatus: +# anyOf: +# - type: string + enum: + - EAP_SUCCESS + - EAP_FAILURE + - PENDING +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# +# description: | +# Possible values are: +# - "EAP_SUCCESS": The NSSAA status is EAP-Success. +# - "EAP_FAILURE": The NSSAA status is EAP-Failure. +# - "PENDING": The NSSAA status is Pending. + + LineType: +# anyOf: +# - type: string + enum: + - DSL + - PON +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# +# description: | +# Possible values are: +# - DSL: Identifies a DSL line +# - PON: Identifies a PON line + + LineTypeRm: + anyOf: + - $ref: '#/components/schemas/LineType' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'LineType' data type, but with the + OpenAPI 'nullable: true' property. + + + NotificationFlag: +# anyOf: +# - type: string + enum: + - ACTIVATE + - DEACTIVATE + - RETRIEVAL +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# +# description: | +# Possible values are: +# - ACTIVATE: The event notification is activated. +# - DEACTIVATE: The event notification is deactivated and shall be muted. The available +# event(s) shall be stored. +# - RETRIEVAL: The event notification shall be sent to the NF service consumer(s), +# after that, is muted again. + + + TransportProtocol: +# anyOf: +# - type: string + enum: + - UDP + - TCP +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# +# description: | +# Possible values are: +# - UDP: User Datagram Protocol. +# - TCP: Transmission Control Protocol. + + + SatelliteBackhaulCategory: +# anyOf: +# - type: string + enum: + - GEO + - MEO + - LEO + - OTHER_SAT + - NON_SATELLITE +# - type: string +# description: Indicates the satellite backhaul used. + + SatelliteBackhaulCategoryRm: + anyOf: + - $ref: '#/components/schemas/SatelliteBackhaulCategory' + - $ref: '#/components/schemas/NullValue' + description: > + Provides information about the satellite backhaul but with the OpenAPI + 'nullable: true' property. + + + +# +# STRUCTURED DATA TYPES +# + SubscribedDefaultQos: + type: object + required: + - 5qi + - arp + properties: + 5qi: + $ref: '#/components/schemas/5Qi' + arp: + $ref: '#/components/schemas/Arp' + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + description: Provides the subsribed 5QI and the ARP, it may contain the priority level. + + Snssai: + type: object + properties: + sst: + type: integer + minimum: 0 + maximum: 255 + description: > + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. + It indicates the expected Network Slice behaviour in terms of features and services. + Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond + to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. + Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. + + sd: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: > + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. + Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" + and shall represent 4 bits. The most significant character representing the 4 most + significant bits of the SD shall appear first in the string, and the character + representing the 4 least significant bit of the SD shall appear last in the string. + This is an optional parameter that complements the Slice/Service type(s) to allow to + differentiate amongst multiple Network Slices of the same Slice/Service type. This IE + shall be absent if no SD value is associated with the SST. + description: > + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall + be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits + "sd". + + required: + - sst + + PlmnId: + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + description: > + When PlmnId needs to be converted to string (e.g. when used in maps as key), the string + shall be composed of three digits "mcc" followed by "-" and two or three digits "mnc". + + required: + - mcc + - mnc + PlmnIdRm: + anyOf: + - $ref: '#/components/schemas/PlmnId' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'PlmnId' data type, but with the + OpenAPI 'nullable: true' property. + + Tai: + description: Contains the tracking area identity as described in 3GPP 23.003 + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + tac: + $ref: '#/components/schemas/Tac' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - tac + + TaiRm: + anyOf: + - $ref: '#/components/schemas/Tai' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Tai' data type, but with the OpenAPI + 'nullable: true' property. + + Ecgi: + description: Contains the ECGI (E-UTRAN Cell Global Identity), as described in 3GPP 23.003 + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + eutraCellId: + $ref: '#/components/schemas/EutraCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - eutraCellId + + EcgiRm: + anyOf: + - $ref: '#/components/schemas/Ecgi' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Ecgi' data type, but with the + OpenAPI 'nullable: true' property. + + Ncgi: + description: Contains the NCGI (NR Cell Global Identity), as described in 3GPP 23.003 + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + nrCellId: + $ref: '#/components/schemas/NrCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - nrCellId + + NcgiRm: + anyOf: + - $ref: '#/components/schemas/Ncgi' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Ncgi' data type, but with the + OpenAPI 'nullable: true' property. + + UserLocation: + type: object + properties: + eutraLocation: + $ref: '#/components/schemas/EutraLocation' + nrLocation: + $ref: '#/components/schemas/NrLocation' + n3gaLocation: + $ref: '#/components/schemas/N3gaLocation' + utraLocation: + $ref: '#/components/schemas/UtraLocation' + geraLocation: + $ref: '#/components/schemas/GeraLocation' + description: > + At least one of eutraLocation, nrLocation and n3gaLocation shall be present. Several + of them may be present. + + EutraLocation: + description: Contains the E-UTRA user location. + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ignoreTai: + type: boolean + default: false + ecgi: + $ref: '#/components/schemas/Ecgi' + ignoreEcgi: + type: boolean + default: false + description: > + This flag when present shall indicate that the Ecgi shall be ignored + When present, it shall be set as follows: + - true: ecgi shall be ignored. + - false (default): ecgi shall not be ignored. + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + description: > + The value represents the elapsed time in minutes since the last network contact of the + mobile station. Value "0" indicates that the location information was obtained after a + successful paging procedure for Active Location Retrieval when the UE is in idle mode + or after a successful NG-RAN location reporting procedure with the eNB when the UE is + in connected mode. Any other value than "0" indicates that the location information is + the last known one. See 3GPP TS 29.002 clause 17.7.8. + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + description: > + Refer to geographical Information. See 3GPP TS 23.032 clause 7.3.2. Only the + description of an ellipsoid point with uncertainty circle is allowed to be used. + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + description: > + Refers to Calling Geodetic Location. See ITU-T Recommendation Q.763 (1999) [24] + clause 3.88.2. Only the description of an ellipsoid point with uncertainty circle + is allowed to be used. + globalNgenbId: + $ref: '#/components/schemas/GlobalRanNodeId' + + globalENbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ecgi + + EutraLocationRm: + anyOf: + - $ref: '#/components/schemas/EutraLocation' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'EutraLocation' data type, but with + the OpenAPI 'nullable: true' property. + + NrLocation: + description: Contains the NR user location. + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ncgi: + $ref: '#/components/schemas/Ncgi' + ignoreNcgi: + type: boolean + default: false + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + description: > + The value represents the elapsed time in minutes since the last network contact of the mobile + station. Value "0" indicates that the location information was obtained after a + successful paging procedure for Active Location Retrieval when the UE is in idle mode + or after a successful NG-RAN location reporting procedure with the eNB when the UE is + in connected mode. Any other value than "0" indicates that the location information is + the last known one. See 3GPP TS 29.002 clause 17.7.8. + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + description: > + Refer to geographical Information. See 3GPP TS 23.032 clause 7.3.2. Only the description + of an ellipsoid point with uncertainty circle is allowed to be used. + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + description: > + Refers to Calling Geodetic Location. See ITU-T Recommendation Q.763 (1999) [24] clause + 3.88.2. Only the description of an ellipsoid point with uncertainty circle is allowed + to be used. + globalGnbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ncgi + + NrLocationRm: + anyOf: + - $ref: '#/components/schemas/NrLocation' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'NrLocation' data type, but with the + OpenAPI 'nullable: true' property." + + N3gaLocation: + description: Contains the Non-3GPP access user location. + type: object + properties: + n3gppTai: + $ref: '#/components/schemas/Tai' + n3IwfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + This IE shall contain the N3IWF identifier received over NGAP and shall be encoded as a + string of hexadecimal characters. Each character in the string shall take a value of "0" + to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant + character representing the 4 most significant bits of the N3IWF ID shall appear first in + the string, and the character representing the 4 least significant bit of the N3IWF ID + shall appear last in the string. + + ueIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ueIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + protocol: + $ref: '#/components/schemas/TransportProtocol' + tnapId: + $ref: '#/components/schemas/TnapId' + twapId: + $ref: '#/components/schemas/TwapId' + hfcNodeId: + $ref: '#/components/schemas/HfcNodeId' + gli: + $ref: '#/components/schemas/Gli' + w5gbanLineType: + $ref: '#/components/schemas/LineType' + gci: + $ref: '#/components/schemas/Gci' + + UpSecurity: + description: Contains Userplain security information. + type: object + properties: + upIntegr: + $ref: '#/components/schemas/UpIntegrity' + upConfid: + $ref: '#/components/schemas/UpConfidentiality' + required: + - upIntegr + - upConfid + + UpSecurityRm: + anyOf: + - $ref: '#/components/schemas/UpSecurity' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'UpSecurity' data type, but with the + OpenAPI 'nullable: true' property. + + NgApCause: + description: Represents the NGAP cause. + type: object + properties: + group: + $ref: '#/components/schemas/Uinteger' + value: + $ref: '#/components/schemas/Uinteger' + required: + - group + - value + + BackupAmfInfo: + description: Provides details of the Backup AMF. + type: object + properties: + backupAmf: + $ref: '#/components/schemas/AmfName' + guamiList: + type: array + items: + $ref: '#/components/schemas/Guami' + minItems: 1 + description: > + If present, this IE shall contain the list of GUAMI(s) (supported by the AMF) for + which the backupAmf IE applies. + required: + - backupAmf + + RefToBinaryData: + description: This parameter provides information about the referenced binary body data. + type: object + properties: + contentId: + type: string + description: > + This IE shall contain the value of the Content-ID header of the referenced binary + body part. + required: + - contentId + + RefToBinaryDataRm: + anyOf: + - $ref: '#/components/schemas/RefToBinaryData' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the ' RefToBinaryData ' data type, + but with the OpenAPI 'nullable: true' property. + + RouteToLocation: + type: object + properties: + dnai: + $ref: '#/components/schemas/Dnai' + routeInfo: + $ref: '#/components/schemas/RouteInformation' + routeProfId: + type: string + nullable: true + description: Identifies the routing profile Id. + required: + - dnai + anyOf: + - required: [ routeInfo ] + - required: [ routeProfId ] + nullable: true + description: > + At least one of the "routeInfo" attribute and the "routeProfId" attribute shall be included + in the "RouteToLocation" data type. + + RouteInformation: + type: object + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + required: + - portNumber + nullable: true + description: > + At least one of the "ipv4Addr" attribute and the "ipv6Addr" attribute shall be included in + the "RouteInformation" data type. + + Area: + description: Provides area information. + type: object + oneOf: + - required: + - tacs + - required: + - areaCode + properties: + tacs: + type: array + items: + $ref: '#/components/schemas/Tac' + minItems: 1 + areaCode: + $ref: '#/components/schemas/AreaCode' + + ServiceAreaRestriction: + description: Provides information about allowed or not allowed areas. + type: object + properties: + restrictionType: + $ref: '#/components/schemas/RestrictionType' + areas: + type: array + items: + $ref: '#/components/schemas/Area' + maxNumOfTAs: + $ref: '#/components/schemas/Uinteger' + maxNumOfTAsForNotAllowedAreas: + $ref: '#/components/schemas/Uinteger' + allOf: + # + # 1st condition: restrictionType and areas attributes shall be either both absent + # or both present + # + - oneOf: + - not: + required: [ restrictionType ] + - required: [ areas ] + # + # 2nd condition: if restrictionType takes value NOT_ALLOWED_AREAS, + # then maxNumOfTAs shall be absent + # + - anyOf: + - not: + required: [ restrictionType ] + properties: + restrictionType: + type: string + enum: [ NOT_ALLOWED_AREAS ] + - not: + required: [ maxNumOfTAs ] + # + # 3rd condition: if restrictionType takes value ALLOWED_AREAS, + # then maxNumOfTAsForNotAllowedAreas shall be absent + # + - anyOf: + - not: + required: [ restrictionType ] + properties: + restrictionType: + type: string + enum: [ ALLOWED_AREAS ] + - not: + required: [ maxNumOfTAsForNotAllowedAreas ] + + PresenceInfo: + type: object + properties: + praId: + type: string + description: > + Represents an identifier of the Presence Reporting Area (see clause 28.10 of 3GPP + TS 23.003. This IE shall be present if the Area of Interest subscribed or reported is + a Presence Reporting Area or a Set of Core Network predefined Presence Reporting Areas. + When present, it shall be encoded as a string representing an integer in the following + ranges: + 0 to 8 388 607 for UE-dedicated PRA + 8 388 608 to 16 777 215 for Core Network predefined PRA + Examples: + PRA ID 123 is encoded as "123" + PRA ID 11 238 660 is encoded as "11238660" + + additionalPraId: + type: string + description: > + This IE may be present if the praId IE is present and if it contains a PRA identifier + referring to a set of Core Network predefined Presence Reporting Areas. When present, + this IE shall contain a PRA Identifier of an individual PRA within the Set of Core + Network predefined Presence Reporting Areas indicated by the praId IE. + + presenceState: + $ref: '#/components/schemas/PresenceState' + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 1 + description: > + Represents the list of tracking areas that constitutes the area. This IE shall be + present if the subscription or the event report is for tracking UE presence in the + tracking areas. For non 3GPP access the TAI shall be the N3GPP TAI. + + ecgiList: + type: array + items: + $ref: '#/components/schemas/Ecgi' + minItems: 1 + description: > + Represents the list of EUTRAN cell Ids that constitutes the area. This IE shall + be present if the Area of Interest subscribed is a list of EUTRAN cell Ids. + + ncgiList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 1 + description: > + Represents the list of NR cell Ids that constitutes the area. This IE shall be + present if the Area of Interest subscribed is a list of NR cell Ids. + + globalRanNodeIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + description: > + Represents the list of NG RAN node identifiers that constitutes the area. This IE shall + be present if the Area of Interest subscribed is a list of NG RAN node identifiers. + + globaleNbIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + description: > + Represents the list of eNodeB identifiers that constitutes the area. This IE shall be + present if the Area of Interest subscribed is a list of eNodeB identifiers. + description: > + If the additionalPraId IE is present, this IE shall state the presence information of the + UE for the individual PRA identified by the additionalPraId IE; If the additionalPraId IE + is not present, this IE shall state the presence information of the UE for the PRA + identified by the praId IE. + PresenceInfoRm: + type: object + properties: + praId: + type: string + description: | + Represents an identifier of the Presence Reporting Area (see clause 28.10 of + 3GPP TS 23.003. This IE shall be present if the Area of Interest subscribed or + reported is a Presence Reporting Area or a Set of Core Network predefined Presence + Reporting Areas. When present, it shall be encoded as a string representing an integer + in the following ranges: + - 0 to 8 388 607 for UE-dedicated PRA + - 8 388 608 to 16 777 215 for Core Network predefined PRA + Examples: + PRA ID 123 is encoded as "123" + PRA ID 11 238 660 is encoded as "11238660" + additionalPraId: + type: string + description: > + This IE may be present if the praId IE is present and if it contains a PRA identifier + referring to a set of Core Network predefined Presence Reporting Areas. + When present, this IE shall contain a PRA Identifier of an individual PRA within the Set + of Core Network predefined Presence Reporting Areas indicated by the praId IE. + + presenceState: + $ref: '#/components/schemas/PresenceState' + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 0 + description: > + Represents the list of tracking areas that constitutes the area. This IE shall be + present if the subscription or the event report is for tracking UE presence in the + tracking areas. For non 3GPP access the TAI shall be the N3GPP TAI. + + ecgiList: + type: array + items: + $ref: '#/components/schemas/Ecgi' + minItems: 0 + description: > + Represents the list of EUTRAN cell Ids that constitutes the area. This IE shall be + present if the Area of Interest subscribed is a list of EUTRAN cell Ids. + ncgiList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 0 + description: > + Represents the list of NR cell Ids that constitutes the area. This IE shall be present + if the Area of Interest subscribed is a list of NR cell Ids. + globalRanNodeIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + description: > + Represents the list of NG RAN node identifiers that constitutes the area. This IE shall be + present if the Area of Interest subscribed is a list of NG RAN node identifiers. + globaleNbIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + description: > + Represents the list of eNodeB identifiers that constitutes the area. This IE shall be present + if the Area of Interest subscribed is a list of eNodeB identifiers. + nullable: true + description: > + This data type is defined in the same way as the 'PresenceInfo' data type, but with the + OpenAPI 'nullable: true' property. If the additionalPraId IE is present, this IE shall state + the presence information of the UE for the individual PRA identified by the additionalPraId + IE; If the additionalPraId IE is not present, this IE shall state the presence information + of the UE for the PRA identified by the praId IE. + + GlobalRanNodeId: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + n3IwfId: + $ref: '#/components/schemas/N3IwfId' + gNbId: + $ref: '#/components/schemas/GNbId' + ngeNbId: + $ref: '#/components/schemas/NgeNbId' + wagfId: + $ref: '#/components/schemas/WAgfId' + tngfId: + $ref: '#/components/schemas/TngfId' + nid: + $ref: '#/components/schemas/Nid' + eNbId: + $ref: '#/components/schemas/ENbId' + oneOf: + - required: [ n3IwfId ] + - required: [ gNbId ] + - required: [ ngeNbId ] + - required: [ wagfId ] + - required: [ tngfId ] + - required: [ eNbId ] + description: > + One of the six attributes n3IwfId, gNbIdm, ngeNbId, wagfId, tngfId, eNbId shall be present. + required: + - plmnId + GNbId: + description: Provides the G-NB identifier. + type: object + properties: + bitLength: + type: integer + minimum: 22 + maximum: 32 + description: > + Unsigned integer representing the bit length of the gNB ID as defined in clause + 9.3.1.6 of 3GPP TS 38.413 [11], within the range 22 to 32. + gNBValue: + type: string + pattern: '^[A-Fa-f0-9]{6,8}$' + description: > + This represents the identifier of the gNB. The value of the gNB ID shall be encoded + in hexadecimal representation. Each character in the string shall take a value of + "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The padding 0 shall + be added to make multiple nibbles, the most significant character representing the + padding 0 if required together with the 4 most significant bits of the gNB ID shall + appear first in the string, and the character representing the 4 least significant bit + of the gNB ID shall appear last in the string. + required: + - bitLength + - gNBValue + + AtsssCapability: + description: > + Containes Capability to support procedures related to Access Traffic Steering, Switching, + Splitting. + type: object + properties: + atsssLL: + type: boolean + default: false + description: > + Indicates the ATSSS-LL capability to support procedures related to Access Traffic + Steering, Switching, Splitting (see clauses 4.2.10, 5.32 of 3GPP TS 23.501). + true: Supported + false (default): Not Supported + mptcp: + type: boolean + default: false + description: > + Indicates the MPTCP capability to support procedures related to Access Traffic Steering, + Switching, Splitting (see clauses 4.2.10, 5.32 of 3GPP TS 23.501 + true: Supported + false (default): Not Supported + rttWithoutPmf: + type: boolean + default: false + description: > + This IE is only used by the UPF to indicate whether the UPF supports RTT measurement + without PMF (see clauses 5.32.2, 6.3.3.3 of 3GPP TS 23.501 + true: Supported + false (default): Not Supported + PlmnIdNid: + description: > + Contains the serving core network operator PLMN ID and, for an SNPN, the NID that together + with the PLMN ID identifies the SNPN. + type: object + required: + - mcc + - mnc + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + nid: + $ref: '#/components/schemas/Nid' + + PlmnIdNidRm: + anyOf: + - $ref: '#/components/schemas/PlmnIdNid' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'PlmnIdNid' data type, but with the + OpenAPI 'nullable: true' property. + + SmallDataRateStatus: + description: It indicates theSmall Data Rate Control Status + type: object + properties: + remainPacketsUl: + type: integer + minimum: 0 + description: > + When present, it shall contain the number of packets the UE is allowed to send uplink + in the given time unit for the given PDU session (see clause 5.31.14.3 of 3GPP TS 23.501. + remainPacketsDl: + type: integer + minimum: 0 + description: > + When present it shall contain the number of packets the AF is allowed to send downlink + in the given time unit for the given PDU session (see clause 5.31.14.3 of 3GPP TS 23.501. + validityTime: + $ref: '#/components/schemas/DateTime' + remainExReportsUl: + type: integer + minimum: 0 + description: > + When present, it shall indicate number of additional exception reports the UE is allowed + to send uplink in the given time unit for the given PDU session (see clause 5.31.14.3 + of 3GPP TS 23.501. + remainExReportsDl: + type: integer + minimum: 0 + description: > + When present, it shall indicate number of additional exception reports the AF is allowed + to send downlink in the given time unit for the given PDU session (see clause 5.31.14.3 + in 3GPP TS 23.501 + + HfcNodeId: + description: REpresents the HFC Node Identifer received over NGAP. + type: object + required: + - hfcNId + properties: + hfcNId: + $ref: '#/components/schemas/HfcNId' + + HfcNodeIdRm: + anyOf: + - $ref: '#/components/schemas/HfcNodeId' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'HfcNodeId' data type, but with the + OpenAPI 'nullable: true' property. + + WirelineArea: + type: object + properties: + globalLineIds: + type: array + items: + $ref: '#/components/schemas/Gli' + minItems: 1 + hfcNIds: + type: array + items: + $ref: '#/components/schemas/HfcNId' + minItems: 1 + areaCodeB: + $ref: '#/components/schemas/AreaCode' + areaCodeC: + $ref: '#/components/schemas/AreaCode' + description: > + One and only one of the "globLineIds", "hfcNIds", "areaCodeB" and "areaCodeC" attributes + shall be included in a WirelineArea data structure + + WirelineServiceAreaRestriction: + type: object + properties: + restrictionType: + $ref: '#/components/schemas/RestrictionType' + areas: + type: array + items: + $ref: '#/components/schemas/WirelineArea' + description: > + The "restrictionType" attribute and the "areas" attribute shall be either both present + or absent. The empty array of areas is used when service is allowed/restricted nowhere. + + ApnRateStatus: + description: Contains the APN rate control status e.g. of the AMF. + type: object + properties: + remainPacketsUl: + type: integer + minimum: 0 + description: > + When present, it shall contain the number of packets the UE is allowed to send uplink + in the given time unit for the given APN (all PDN connections of the UE to this APN + see clause 4.7.7.3 in 3GPP TS 23.401. + remainPacketsDl: + type: integer + minimum: 0 + description: > + When present, it shall contain the number of packets the UE is allowed to send uplink + in the given time unit for the given APN (all PDN connections of the UE to this APN + see clause 4.7.7.3 in 3GPP TS 23.401. + validityTime: + $ref: '#/components/schemas/DateTime' + remainExReportsUl: + type: integer + minimum: 0 + description: > + When present, it shall indicate the number of additional exception reports the UE is + allowed to send uplink in the given time unit for the given APN (all PDN connections of the UE to this APN, + see clause 4.7.7.3 in 3GPP TS 23.401. + remainExReportsDl: + type: integer + minimum: 0 + description: > + When present, it shall indicate the number of additional exception reports the AF is + allowed to send downlink in the given time unit for the given APN (all PDN connections + of the UE to this APN, see clause 4.7.7.3 in 3GPP TS 23.401. + + ScheduledCommunicationTime: + description: Identifies time and day of the week when the UE is available for communication. + type: object + properties: + daysOfWeek: + type: array + items: + $ref: '#/components/schemas/DayOfWeek' + minItems: 1 + maxItems: 6 + description: > + Identifies the day(s) of the week. If absent, it indicates every day of the week. + timeOfDayStart: + $ref: '#/components/schemas/TimeOfDay' + timeOfDayEnd: + $ref: '#/components/schemas/TimeOfDay' + + ScheduledCommunicationTimeRm: + anyOf: + - $ref: '#/components/schemas/ScheduledCommunicationTime' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'ScheduledCommunicationTime' data type, + but with the OpenAPI 'nullable: true' property. + + BatteryIndication: + type: object + properties: + batteryInd: + type: boolean + description: > + This IE shall indicate whether the UE is battery powered or not. + true: the UE is battery powered; + false or absent: the UE is not battery powered + replaceableInd: + type: boolean + description: > + This IE shall indicate whether the battery of the UE is replaceable or not. + true: the battery of the UE is replaceable; + false or absent: the battery of the UE is not replaceable. + rechargeableInd: + type: boolean + description: > + This IE shall indicate whether the battery of the UE is rechargeable or not. + true: the battery of UE is rechargeable; + false or absent: the battery of the UE is not rechargeable. + description: > + Parameters "replaceableInd" and "rechargeableInd" are only included if the value of + Parameter "batteryInd" is true. + + BatteryIndicationRm: + anyOf: + - $ref: '#/components/schemas/BatteryIndication' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'BatteryIndication' data type, but + with the OpenAPI 'nullable: true' property. + + AcsInfo: + description: The ACS information for the 5G-RG is defined in BBF TR-069 [42] or in BBF TR-369 + type: object + properties: + acsUrl: + $ref: '#/components/schemas/Uri' + acsIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + acsIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + + AcsInfoRm: + anyOf: + - $ref: '#/components/schemas/AcsInfo' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'AcsInfo' data type, but with the + OpenAPI 'nullable: true' property. + + NrV2xAuth: + description: Contains NR V2X services authorized information. + type: object + properties: + vehicleUeAuth: + $ref: '#/components/schemas/UeAuth' + pedestrianUeAuth: + $ref: '#/components/schemas/UeAuth' + + LteV2xAuth: + description: Contains LTE V2X services authorized information. + type: object + properties: + vehicleUeAuth: + $ref: '#/components/schemas/UeAuth' + pedestrianUeAuth: + $ref: '#/components/schemas/UeAuth' + + Pc5QoSPara: + description: Contains policy data on the PC5 QoS parameters. + type: object + required: + - pc5QosFlowList + properties: + pc5QosFlowList: + type: array + items: + $ref: '#/components/schemas/Pc5QosFlowItem' + pc5LinkAmbr: + $ref: '#/components/schemas/BitRate' + + Pc5QosFlowItem: + description: Contains a PC5 QOS flow. + type: object + required: + - pqi + properties: + pqi: + $ref: '#/components/schemas/5Qi' + + pc5FlowBitRates: + $ref: '#/components/schemas/Pc5FlowBitRates' + range: + $ref: '#/components/schemas/Uinteger' + + Pc5FlowBitRates: + description: it shall represent the PC5 Flow Bit Rates + type: object + properties: + guaFbr: + $ref: '#/components/schemas/BitRate' + maxFbr: + $ref: '#/components/schemas/BitRate' + + UtraLocation: + type: object + oneOf: + - required: + - cgi + - required: + - sai + - required: + - rai + description: Exactly one of cgi, sai or lai shall be present. + properties: + cgi: + $ref: '#/components/schemas/CellGlobalId' + sai: + $ref: '#/components/schemas/ServiceAreaId' + lai: + $ref: '#/components/schemas/LocationAreaId' + rai: + $ref: '#/components/schemas/RoutingAreaId' + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + description: > + The value represents the elapsed time in minutes since the last network contact of the + mobile station. Value "0" indicates that the location information was obtained after a + successful paging procedure for Active Location Retrieval when the UE is in idle mode + or after a successful location reporting procedure the UE is in connected mode. Any + other value than "0" indicates that the location information is the last known one. + See 3GPP TS 29.002 clause 17.7.8. + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + description: > + Refer to geographical Information.See 3GPP TS 23.032 clause 7.3.2. Only the + description of an ellipsoid point with uncertainty circle is allowed to be used. + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + description: > + Refers to Calling Geodetic Location. See ITU-T Recommendation Q.763 (1999) clause + 3.88.2. Only the description of an ellipsoid point with uncertainty circle is allowed + to be used. + + GeraLocation: + type: object + oneOf: + - required: + - cgi + - required: + - sai + - required: + - lai + - required: + - rai + description: Exactly one of cgi, sai or lai shall be present. + properties: + locationNumber: + type: string + description: Location number within the PLMN. See 3GPP TS 23.003, clause 4.5. + cgi: + $ref: '#/components/schemas/CellGlobalId' + rai: + $ref: '#/components/schemas/RoutingAreaId' + sai: + $ref: '#/components/schemas/ServiceAreaId' + lai: + $ref: '#/components/schemas/LocationAreaId' + vlrNumber: + type: string + description: VLR number. See 3GPP TS 23.003 clause 5.1. + mscNumber: + type: string + description: MSC number. See 3GPP TS 23.003 clause 5.1. + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + description: > + The value represents the elapsed time in minutes since the last network contact of the + mobile station. Value "0" indicates that the location information was obtained after a + successful paging procedure for Active Location Retrieval when the UE is in idle mode + or after a successful location reporting procedure the UE is in connected mode. Any + other value than "0" indicates that the location information is the last known one. + See 3GPP TS 29.002 clause 17.7.8. + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + description: > + Refer to geographical Information.See 3GPP TS 23.032 clause 7.3.2. Only the + description of an ellipsoid point with uncertainty circle is allowed to be used. + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + description: > + Refers to Calling Geodetic Location.See ITU-T Recommendation Q.763 (1999) clause 3.88.2. + Only the description of an ellipsoid point with uncertainty circle is allowed to be + used. + + CellGlobalId: + description: Contains a Cell Global Identification as defined in 3GPP TS 23.003, clause 4.3.1. + type: object + required: + - plmnId + - lac + - cellId + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + cellId: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + + ServiceAreaId: + description: Contains a Service Area Identifier as defined in 3GPP TS 23.003, clause 12.5. + type: object + required: + - plmnId + - lac + - sac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + description: Location Area Code. + sac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + description: Service Area Code. + + LocationAreaId: + description: Contains a Location area identification as defined in 3GPP TS 23.003, clause 4.1. + type: object + required: + - plmnId + - lac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + + lac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + description: Location Area Code. + + RoutingAreaId: + description: Contains a Routing Area Identification as defined in 3GPP TS 23.003, clause 4.2. + type: object + required: + - plmnId + - lac + - rac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + description: Location Area Code + rac: + type: string + pattern: '^[A-Fa-f0-9]{2}$' + description: Routing Area Code + + DddTrafficDescriptor: + description: Contains a Traffic Descriptor. + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + portNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + + MoExpDataCounter: + description: Contain the MO Exception Data Counter. + type: object + required: + - counter + properties: + counter: + type: integer + description: > + Unsigned integer identifying the MO Exception Data Counter, as specified in clause + 5.31.14.3 of 3GPP TS 23.501. + timeStamp: + $ref: '#/components/schemas/DateTime' + + NssaaStatus: + description: contains the Subscribed S-NSSAI subject to NSSAA procedure and the status. + type: object + required: + - snssai + - status + properties: + snssai: + $ref: '#/components/schemas/Snssai' + status: + $ref: '#/components/schemas/AuthStatus' + + NssaaStatusRm: + anyOf: + - $ref: '#/components/schemas/NssaaStatus' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'NssaaStatus' data type, but with + the OpenAPI 'nullable: true' property. + + TnapId: + description: Contain the TNAP Identifier see clause5.6.2 of 3GPP TS 23.501. + type: object + properties: + ssId: + type: string + description: > + This IE shall be present if the UE is accessing the 5GC via a trusted WLAN access + network.When present, it shall contain the SSID of the access point to which the UE + is attached, that is received over NGAP, see IEEE Std 802.11-2012. + + bssId: + type: string + description: > + When present, it shall contain the BSSID of the access point to which the UE is + attached, that is received over NGAP, see IEEE Std 802.11-2012. + + civicAddress: + $ref: '#/components/schemas/Bytes' + + TnapIdRm: + anyOf: + - $ref: '#/components/schemas/TnapId' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'TnapId' data type, but with the + OpenAPI 'nullable: true' property. + + TwapId: + description: > + Contain the TWAP Identifier as defined in clause 4.2.8.5.3 of 3GPP TS 23.501 + or the WLAN location information as defined in clause 4.5.7.2.8 of 3GPP TS 23.402. + type: object + required: + - ssId + properties: + ssId: + type: string + description: > + This IE shall contain the SSID of the access point to which the UE is attached, that is + received over NGAP, see IEEE Std 802.11-2012. + + bssId: + type: string + description: > + When present, it shall contain the BSSID of the access point to which the UE is + attached, for trusted WLAN access, see IEEE Std 802.11-2012. + + civicAddress: + $ref: '#/components/schemas/Bytes' + + TwapIdRm: + anyOf: + - $ref: '#/components/schemas/TwapId' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'TwapId' data type, but with the + OpenAPI 'nullable: true' property. + + SnssaiExtension: + description: > + Extensions to the Snssai data type, sdRanges and wildcardSd shall not be present + simultaneously + type: object + not: + required: + - sdRanges + - wildcardSd + properties: + sdRanges: + description: > + When present, it shall contain the range(s) of Slice Differentiator values supported for + the Slice/Service Type value indicated in the sst attribute of the Snssai data type + type: array + items: + $ref: '#/components/schemas/SdRange' + minItems: 1 + wildcardSd: + description: > + When present, it shall be set to true, to indicate that all SD values are supported for + the Slice/Service Type value indicated in the sst attribute of the Snssai data type. + type: boolean + enum: + - true + + SdRange: + description: A range of SDs (Slice Differentiators) + type: object + properties: + start: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: > + First value identifying the start of an SD range. This string shall be formatted as + specified for the sd attribute of the Snssai data type in clause 5.4.4.2. + end: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: > + Last value identifying the end of an SD range. This string shall be formatted as + specified for the sd attribute of the Snssai data type in clause 5.4.4.2. + + ProseServiceAuth: + description: > + Indicates whether the UE is authorized to use ProSe Direct Discovery, ProSe Direct + Communication, or both. + type: object + properties: + proseDirectDiscoveryAuth: + $ref: '#/components/schemas/UeAuth' + proseDirectCommunicationAuth: + $ref: '#/components/schemas/UeAuth' + + EcsServerAddr: + description: > + Contains the Edge Configuration Server Address Configuration Information as defined in + clause 5.2.3.6.1 of 3GPP TS 23.502. + type: object + properties: + ecsFqdnList: + type: array + items: + $ref: '#/components/schemas/Fqdn' + minItems: 1 + ecsIpAddressList: + type: array + items: + $ref: '#/components/schemas/IpAddr' + minItems: 1 + ecsUriList: + type: array + items: + $ref: '#/components/schemas/Uri' + minItems: 1 + ecsProviderId: + type: string + + EcsServerAddrRm: + anyOf: + - $ref: '#/components/schemas/EcsServerAddr' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the ' EcsServerAddr ' data type, but with + the OpenAPI 'nullable: true' property. + + IpAddr: + description: Contains an IP adresse. + type: object + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + - required: + - ipv6Prefix + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + ipv6Prefix: + $ref: '#/components/schemas/Ipv6Prefix' + + SACInfo: + description: > + Represents threshold(s) to control the triggering of network slice reporting notifications + or the information contained in the network slice reporting notification. + type: object + properties: + numericValNumUes: + type: integer + numericValNumPduSess: + type: integer + percValueNumUes: + type: integer + minimum: 0 + maximum: 100 + percValueNumPduSess: + type: integer + minimum: 0 + maximum: 100 + + SACEventStatus: + description: > + Contains the network slice status information in terms of the current number of UEs + registered with a network slice, the current number of PDU Sessions established on a + network slice or both. + type: object + properties: + reachedNumUes: + $ref: '#/components/schemas/SACInfo' + reachedNumPduSess: + $ref: '#/components/schemas/SACInfo' + + SpatialValidityCond: + description: Contains the Spatial Validity Condition. + type: object + properties: + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 1 + countries: + type: array + items: + $ref: '#/components/schemas/Mcc' + minItems: 1 + geographicalServiceArea: + $ref: '#/components/schemas/GeoServiceArea' + + SpatialValidityCondRm: + description: Contains the Spatial Validity Condition or the null value. + anyOf: + - $ref: '#/components/schemas/SpatialValidityCond' + - $ref: '#/components/schemas/NullValue' + + ServerAddressingInfo: + description: Contains addressing information (IP addresses and/or FQDNs) of a server. + type: object + anyOf: + - required: + - ipv4Addresses + - required: + - ipv6Addresses + - required: + - fqdnList + properties: + ipv4Addresses: + type: array + items: + $ref: '#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addresses: + type: array + items: + $ref: '#/components/schemas/Ipv6Addr' + minItems: 1 + fqdnList: + type: array + items: + $ref: '#/components/schemas/Fqdn' + minItems: 1 + + PcfUeCallbackInfo: + description: > + Contains the PCF for the UE information necessary for the PCF for the PDU session to send + SM Policy Association Establishment and Termination events. + type: object + properties: + callbackUri: + $ref: '#/components/schemas/Uri' + bindingInfo: + type: string + nullable: true + required: + - callbackUri + + PduSessionInfo: + description: indicates the DNN and S-NSSAI combination of a PDU session. + properties: + snssai: + $ref: '#/components/schemas/Snssai' + dnn: + $ref: '#/components/schemas/Dnn' + required: + - dnn + - snssai + + EasIpReplacementInfo: + description: Contains EAS IP replacement information for a Source and a Target EAS. + type: object + properties: + source: + $ref: '#/components/schemas/EasServerAddress' + target: + $ref: '#/components/schemas/EasServerAddress' + required: + - source + - target + + EasServerAddress: + description: Represents the IP address and port of an EAS server. + type: object + properties: + ip: + $ref: '#/components/schemas/IpAddr' + port: + $ref: '#/components/schemas/Uinteger' + required: + - ip + - port + + RoamingRestrictions: + description: > + Indicates if access is allowed to a given serving network, e.g. a PLMN (MCC, MNC) or an + SNPN (MCC, MNC, NID). + type: object + properties: + accessAllowed: + type: boolean + + GeoServiceArea: + description: List of geographic area or list of civic address info + type: object + properties: + geographicAreaList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + civicAddressList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + +# +# Data types describing alternative data types or combinations of data types +# + ExtSnssai: + allOf: + - $ref: '#/components/schemas/Snssai' + - $ref: '#/components/schemas/SnssaiExtension' + description: > + The sdRanges and wildcardSd attributes shall be exclusive from each other. If one of these + attributes is present, the sd attribute shall also be present and it shall contain one Slice + Differentiator value within the range of SD (if the sdRanges attribute is present) or with + any value (if the wildcardSd attribute is present). + +# +# Data Types related to 5G QoS as defined in clause 5.5 +# + +# +# SIMPLE DATA TYPES +# +# + Qfi: + type: integer + minimum: 0 + maximum: 63 + description: Unsigned integer identifying a QoS flow, within the range 0 to 63. + + QfiRm: + type: integer + minimum: 0 + maximum: 63 + nullable: true + description: > + This data type is defined in the same way as the 'Qfi' data type, but with the + OpenAPI 'nullable: true' property. + + 5Qi: + type: integer + minimum: 0 + maximum: 255 + description: > + Unsigned integer representing a 5G QoS Identifier (see clause 5.7.2.1 of 3GPP TS 23.501, + within the range 0 to 255. + + 5QiRm: + type: integer + minimum: 0 + maximum: 255 + nullable: true + description: > + This data type is defined in the same way as the '5QiPriorityLevel' data type, but with + the OpenAPI 'nullable: true' property. " + + BitRate: + type: string + pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' + description: > + String representing a bit rate; the prefixes follow the standard symbols from The International + System of Units, and represent x1000 multipliers, with the exception that prefix "K" is + used to represent the standard symbol "k". + + BitRateRm: + type: string + pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' + nullable: true + description: > + This data type is defined in the same way as the 'BitRate' data type, but with the OpenAPI 'nullable: true' property. + + ArpPriorityLevelRm: + type: integer + minimum: 1 + maximum: 15 + nullable: true + description: > + This data type is defined in the same way as the 'ArpPriorityLevel' data type, but with + the OpenAPI 'nullable: true' property. + + ArpPriorityLevel: + type: integer + minimum: 1 + maximum: 15 + nullable: true + description: > + nullable true shall not be used for this attribute. Unsigned integer indicating the ARP + Priority Level (see clause 5.7.2.2 of 3GPP TS 23.501, within the range 1 to 15.Values are + ordered in decreasing order of priority, i.e. with 1 as the highest priority and 15 as + the lowest priority. + + 5QiPriorityLevel: + type: integer + minimum: 1 + maximum: 127 + description: > + Unsigned integer indicating the 5QI Priority Level (see clauses 5.7.3.3 and 5.7.4 of 3GPP + TS 23.501, within the range 1 to 127.Values are ordered in decreasing order of priority, + i.e. with 1 as the highest priority and 127 as the lowest priority. + + 5QiPriorityLevelRm: + type: integer + minimum: 1 + maximum: 127 + nullable: true + description: > + This data type is defined in the same way as the '5QiPriorityLevel' data type, but with + the OpenAPI 'nullable: true' property. + + PacketDelBudget: + type: integer + minimum: 1 + description: > + Unsigned integer indicating Packet Delay Budget (see clauses 5.7.3.4 and 5.7.4 of 3GPP + TS 23.501), expressed in milliseconds. + + PacketDelBudgetRm: + type: integer + minimum: 1 + nullable: true + description: > + This data type is defined in the same way as the 'PacketDelBudget' data type, but with + the OpenAPI 'nullable: true' property. + + PacketErrRate: + type: string + pattern: '^([0-9]E-[0-9])$' + description: > + String representing Packet Error Rate (see clause 5.7.3.5 and 5.7.4 of 3GPP TS 23.501, + expressed as a "scalar x 10-k" where the scalar and the exponent k are each encoded as + one decimal digit. + + PacketErrRateRm: + type: string + pattern: '^([0-9]E-[0-9])$' + nullable: true + description: > + This data type is defined in the same way as the 'PacketErrRate' data type, but with + the OpenAPI 'nullable: true' property. + + PacketLossRate: + type: integer + minimum: 0 + maximum: 1000 + description: > + Unsigned integer indicating Packet Loss Rate (see clauses 5.7.2.8 and 5.7.4 of 3GPP + TS 23.501), expressed in tenth of percent. + + PacketLossRateRm: + type: integer + minimum: 0 + maximum: 1000 + nullable: true + description: > + This data type is defined in the same way as the 'PacketLossRate' data type, but with + the OpenAPI 'nullable: true' property. + + AverWindow: + type: integer + minimum: 1 + maximum: 4095 + default: 2000 + description: Unsigned integer indicating Averaging Window (see clause 5.7.3.6 and 5.7.4 of 3GPP TS 23.501), expressed in milliseconds. + + AverWindowRm: + type: integer + maximum: 4095 + default: 2000 + minimum: 1 + nullable: true + description: > + This data type is defined in the same way as the 'AverWindow' data type, but with + the OpenAPI 'nullable: true' property. + + MaxDataBurstVol: + type: integer + minimum: 1 + maximum: 4095 + description: > + Unsigned integer indicating Maximum Data Burst Volume (see clauses 5.7.3.7 and 5.7.4 of + 3GPP TS 23.501), expressed in Bytes. + + MaxDataBurstVolRm: + type: integer + minimum: 1 + maximum: 4095 + nullable: true + description: > + This data type is defined in the same way as the 'MaxDataBurstVol' data type, but with + the OpenAPI 'nullable: true' property. + + SamplingRatio: + type: integer + minimum: 1 + maximum: 100 + description: > + Unsigned integer indicating Sampling Ratio (see clauses 4.15.1 of 3GPP TS 23.502), + expressed in percent. + + SamplingRatioRm: + type: integer + minimum: 1 + maximum: 100 + nullable: true + description: > + This data type is defined in the same way as the 'SamplingRatio' data type, but with the + OpenAPI 'nullable: true' property. +# + RgWirelineCharacteristics: + $ref: '#/components/schemas/Bytes' + + RgWirelineCharacteristicsRm: + anyOf: + - $ref: '#/components/schemas/RgWirelineCharacteristics' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'RgWirelineCharacteristics' data type, + but with the OpenAPI 'nullable: true' property. + + ExtMaxDataBurstVol: + type: integer + minimum: 4096 + maximum: 2000000 + description: > + Unsigned integer indicating Maximum Data Burst Volume (see clauses 5.7.3.7 and 5.7.4 of + 3GPP TS 23.501), expressed in Bytes. + + ExtMaxDataBurstVolRm: + type: integer + minimum: 4096 + maximum: 2000000 + nullable: true + description: > + This data type is defined in the same way as the 'ExtMaxDataBurstVol' data type, but + with the OpenAPI 'nullable: true' property. + + ExtPacketDelBudget: + type: integer + minimum: 1 + description: > + Unsigned integer indicating Packet Delay Budget (see clauses 5.7.3.4 and 5.7.4 of 3GPP + TS 23.501 [8])), expressed in 0.01 milliseconds. + + ExtPacketDelBudgetRm: + type: integer + minimum: 1 + nullable: true + description: > + This data type is defined in the same way as the 'ExtPacketDelBudget' data type, but + with the OpenAPI 'nullable: true' property. " + +# +# ENUMERATED DATA TYPES +# + + PreemptionCapability: +# anyOf: +# - type: string + enum: + - NOT_PREEMPT + - MAY_PREEMPT +# - type: string +# description: > +# The enumeration PreemptionCapability indicates the pre-emption capability of a request on +# other QoS flows. See clause 5.7.2.2 of 3GPP TS 23.501. It shall comply with the provisions +# defined in table 5.5.3.1-1. + PreemptionCapabilityRm: + anyOf: + - $ref: '#/components/schemas/PreemptionCapability' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'PreemptionCapability' enumeration, + but with the OpenAPI 'nullable: true' property. + + PreemptionVulnerability: +# anyOf: +# - type: string + enum: + - NOT_PREEMPTABLE + - PREEMPTABLE +# - type: string +# description: > +# The enumeration PreemptionVulnerability indicates the pre-emption vulnerability of the QoS +# flow to pre-emption from other QoS flows. See clause 5.7.2.2 of 3GPP TS 23.501. It shall +# comply with the provisions defined in table 5.5.3.2-1 + + PreemptionVulnerabilityRm: + anyOf: + - $ref: '#/components/schemas/PreemptionVulnerability' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'PreemptionVulnerability' enumeration, + but with the OpenAPI 'nullable: true' property." + + ReflectiveQoSAttribute: +# anyOf: +# - type: string + enum: + - RQOS + - NO_RQOS +# - type: string +# description: > +# The enumeration ReflectiveQosAttribute indicates whether certain traffic of the QoS flow may +# be subject to Reflective QoS (see clause 5.7.2.3 of 3GPP TS 23.501). It shall comply with +# the provisions defined in table 5.5.3.3-1. + + ReflectiveQoSAttributeRm: + anyOf: + - $ref: '#/components/schemas/ReflectiveQoSAttribute' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'ReflectiveQosAttribute' enumeration, + but with the OpenAPI 'nullable: true' property. " + + NotificationControl: +# anyOf: +# - type: string + enum: + - REQUESTED + - NOT_REQUESTED +# - type: string +# description: > +# The enumeration NotificationControl indicates whether notifications are requested from the +# RAN when the GFBR can no longer (or again) be fulfilled for a QoS Flow during the lifetime +# of the QoS Flow (see clause 5.7.2.4 of 3GPP TS 23.501). +# It shall comply with the provisions defined in table 5.5.3.5-1. + + NotificationControlRm: + anyOf: + - $ref: '#/components/schemas/NotificationControl' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'NotificationControl' enumeration, but + with the OpenAPI 'nullable: true' property. + + QosResourceType: +# anyOf: +# - type: string + enum: + - NON_GBR + - NON_CRITICAL_GBR + - CRITICAL_GBR +# - type: string +# description: > +# The enumeration QosResourceType indicates whether a QoS Flow is non-GBR, delay critical GBR, +# or non-delay critical GBR (see clauses 5.7.3.4 and 5.7.3.5 of 3GPP TS 23.501). It shall +# comply with the provisions defined in table 5.5.3.6-1. + + QosResourceTypeRm: + anyOf: + - $ref: '#/components/schemas/QosResourceType' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'QosResourceType' enumeration, but + with the OpenAPI 'nullable: true' property. " + + AdditionalQosFlowInfo: +# anyOf: +# - anyOf: +# - type: string + enum: + - MORE_LIKELY +# - type: string +# - $ref: '#/components/schemas/NullValue' +# description: > +# The enumeration AdditionalQosFlowInfo provides additional QoS flow information (see clause +# 9.3.1.12 3GPP TS 38.413 [11]). It shall comply with the provisions defined in table +# 5.5.3.12-1. + + PartitioningCriteria: +# anyOf: +# - type: string + enum: + - TAC + - SUBPLMN + - GEOAREA + - SNSSAI + - DNN +# - type: string +# description: > +# This string provides forward-compatibility with future +# extensions to the enumeration but is not used to encode +# content defined in the present version of this API. +# description: | +# Possible values are: +# - "TAC": Type Allocation Code +# - "SUBPLMN": Subscriber PLMN ID +# - "GEOAREA": Geographical area, i.e. list(s) of TAI(s) +# - "SNSSAI": S-NSSAI +# - "DNN": DNN + + PartitioningCriteriaRm: + anyOf: + - $ref: '#/components/schemas/PartitioningCriteria' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the ' PartitioningCriteria ' data type, but + with the OpenAPI 'nullable: true' property. +# +# +# STRUCTURED DATA TYPES +# + + Arp: + description: Contains Allocation and Retention Priority information. + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/ArpPriorityLevel' + preemptCap: + $ref: '#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: '#/components/schemas/PreemptionVulnerability' + required: + - priorityLevel + - preemptCap + - preemptVuln + + Ambr: + description: Contains the maximum aggregated uplink and downlink bit rates. + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + + Dynamic5Qi: + description: > + It indicates the QoS Characteristics for a Non-standardised or not pre-configured 5QI + for downlink and uplink. + type: object + properties: + resourceType: + $ref: '#/components/schemas/QosResourceType' + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + packetDelayBudget: + $ref: '#/components/schemas/PacketDelBudget' + packetErrRate: + $ref: '#/components/schemas/PacketErrRate' + averWindow: + $ref: '#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: '#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: '#/components/schemas/ExtMaxDataBurstVol' + extPacketDelBudget: + $ref: '#/components/schemas/ExtPacketDelBudget' + cnPacketDelayBudgetDl: + $ref: '#/components/schemas/ExtPacketDelBudget' + cnPacketDelayBudgetUl: + $ref: '#/components/schemas/ExtPacketDelBudget' + required: + - resourceType + - priorityLevel + - packetDelayBudget + - packetErrRate + + NonDynamic5Qi: + description: > + It indicates the QoS Characteristics for a standardized or pre-configured 5QI for downlink + and uplink. + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + averWindow: + $ref: '#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: '#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: '#/components/schemas/ExtMaxDataBurstVol' + cnPacketDelayBudgetDl: + $ref: '#/components/schemas/ExtPacketDelBudget' + cnPacketDelayBudgetUl: + $ref: '#/components/schemas/ExtPacketDelBudget' + minProperties: 0 + + ArpRm: + anyOf: + - $ref: '#/components/schemas/Arp' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Arp' data type, but with the + OpenAPI 'nullable: true' property. + + AmbrRm: + anyOf: + - $ref: '#/components/schemas/Ambr' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Ambr' data type, but with the + OpenAPI 'nullable: true' property." + + SliceMbr: + description: MBR related to slice + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + + SliceMbrRm: + description: "SliceMbr with nullable: true" + + anyOf: + - $ref: '#/components/schemas/SliceMbr' + - $ref: '#/components/schemas/NullValue' + +# +# Data Types related to 5G Trace as defined in clause 5.6 +# + +# +# SIMPLE DATA TYPES +# + PhysCellId: + type: integer + minimum: 0 + maximum: 1007 + description: > + Integer value identifying the physical cell identity (PCI), as definition of "PhysCellId" IE + in clause 6.3.2 of 3GPP TS 38.331. + ArfcnValueNR: + type: integer + minimum: 0 + maximum: 3279165 + description: > + Integer value indicating the ARFCN applicable for a downlink, uplink or bi-directional (TDD) + NR global frequency raster, + as definition of "ARFCN-ValueNR" IE in clause 6.3.2 of 3GPP TS 38.331. +# +# +# Enumerations +# + TraceDepth: +# anyOf: +# - type: string + enum: + - MINIMUM + - MEDIUM + - MAXIMUM + - MINIMUM_WO_VENDOR_EXTENSION + - MEDIUM_WO_VENDOR_EXTENSION + - MAXIMUM_WO_VENDOR_EXTENSION +# - type: string +# description: > +# The enumeration TraceDepth defines how detailed information should be recorded in the trace. +# See 3GPP TS 32.422 for further description of the values. It shall comply with the +# provisions defined in table 5.6.3.1-1 + TraceDepthRm: + anyOf: + - $ref: '#/components/schemas/TraceDepth' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'TraceDepth' enumeration, but with + the OpenAPI 'nullable: true' property. + + JobType: +# anyOf: +# - type: string + enum: + - IMMEDIATE_MDT_ONLY + - LOGGED_MDT_ONLY + - TRACE_ONLY + - IMMEDIATE_MDT_AND_TRACE + - RLF_REPORTS_ONLY + - RCEF_REPORTS_ONLY + - LOGGED_MBSFN_MDT +# - type: string +# description: > +# The enumeration JobType defines Job Type in the trace. See 3GPP TS 32.422 for further +# description of the values. It shall comply with the provisions defined in table 5.6.3.3-1. + + ReportTypeMdt: +# anyOf: +# - type: string + enum: + - PERIODICAL + - EVENT_TRIGGED +# - type: string +# description: > +# The enumeration ReportTypeMdt defines Report Type for logged MDT in the trace. See 3GPP TS +# 32.422 for further description of the values. It shall comply with the provisions defined +# in table 5.6.3.4-1. + + MeasurementLteForMdt: +# anyOf: +# - type: string + enum: + - M1 + - M2 + - M3 + - M4_DL + - M4_UL + - M5_DL + - M5_UL + - M6_DL + - M6_UL + - M7_DL + - M7_UL + - M8 + - M9 +# - type: string +# description: > +# The enumeration MeasurementLteForMdt defines Measurements used for MDT in LTE in the trace. +# See 3GPP TS 32.422 for further description of the values. It shall comply with the +# provisions defined in table 5.6.3.5-1. + + MeasurementNrForMdt: +# anyOf: +# - type: string + enum: + - M1 + - M2 + - M3 + - M4_DL + - M4_UL + - M5_DL + - M5_UL + - M6_DL + - M6_UL + - M7_DL + - M7_UL + - M8 + - M9 +# - type: string +# description: > +# The enumeration MeasurementNrForMdt defines Measurements used for MDT in NR in the trace. +# See 3GPP TS 32.422 for further description of the values. It shall comply with the provisions +# defined in table 5.6.3.6-1. + + SensorMeasurement: +# anyOf: +# - type: string + enum: + - BAROMETRIC_PRESSURE + - UE_SPEED + - UE_ORIENTATION +# - type: string +# description: > +# The enumeration SensorMeasurement defines sensor measurement type for MDT in the trace. See 3GPP +# TS 32.422 for further description of the values. It shall comply with the provisions defined +# in table 5.6.3.7-1. + + ReportingTrigger: +# anyOf: +# - type: string + enum: + - PERIODICAL + - EVENT_A2 + - EVENT_A2_PERIODIC + - ALL_RRM_EVENT_TRIGGERS +# - type: string +# description: > +# The enumeration ReportingTrigger defines Reporting Triggers for MDT in the trace. See 3GPP +# TS 32.42] for further description of the values. It shall comply with the provisions +# defined in table 5.6.3.8-1. + + ReportIntervalMdt: +# anyOf: +# - type: string + enum: + - 120 + - 240 + - 480 + - 640 + - 1024 + - 2048 + - 5120 + - 10240 + - 60000 + - 360000 + - 720000 + - 1800000 + - 3600000 +# - type: string +# description: > +# The enumeration ReportIntervalMdt defines Report Interval for MDT in the trace. See 3GPP +# TS 32.422 for further description of the values. It shall comply with +# the provisions defined in table 5.6.3.9-1. + + ReportAmountMdt: +# anyOf: +# - type: string + enum: + - 1 + - 2 + - 4 + - 8 + - 16 + - 32 + - 64 + - infinity +# - type: string +# description: > +# The enumeration ReportAmountMdt defines Report Amount for MDT in the trace. See 3GPP +# TS 32.422 for further description of the values. It shall comply with the provisions +# defined in table 5.6.3.10-1. + + EventForMdt: +# anyOf: +# - type: string + enum: + - OUT_OF_COVERAG + - A2_EVENT +# - type: string +# description: > +# The enumeration EventForMdt defines events triggered measurement for logged MDT in the +# trace. See 3GPP TS 32.422 for further description of the values. It shall comply with +# the provisions defined in table 5.6.3.11-1 + + LoggingIntervalMdt: +# anyOf: +# - type: string + enum: + - 128 + - 256 + - 512 + - 1024 + - 2048 + - 3072 + - 4096 + - 6144 +# - type: string +# description: > +# The enumeration LoggingIntervalMdt defines Logging Interval for MDT in the trace. See 3GPP +# TS 32.422 for further description of the values. It shall comply with the provisions +# defined in table 5.6.3.12-1. + + LoggingDurationMdt: +# anyOf: +# - type: string + enum: + - 600 + - 1200 + - 2400 + - 3600 + - 5400 + - 7200 +# - type: string +# description: > +# The enumeration LoggingIntervalMdt defines Logging Interval for MDT in the trace. See 3GPP +# TS 32.422 for further description of the values. It shall comply with the provisions +# defined in table 5.6.3.12-1. + + PositioningMethodMdt: +# anyOf: +# - type: string + enum: + - GNSS + - E_CELL_ID +# - type: string +# description: > +# The enumeration LoggingDurationMdt defines Logging Duration for MDT in the trace. See 3GPP +# TS 32.422 for further description of the values. It shall comply with the provisions +# defined in table 5.6.3.13-1. + + CollectionPeriodRmmLteMdt: +# anyOf: +# - type: string + enum: + - 1024 + - 1280 + - 2048 + - 2560 + - 5120 + - 10240 + - 60000 +# - type: string +# description: > +# The enumeration CollectionPeriodRmmLteMdt defines Collection period for RRM measurements +# LTE for MDT in the trace. See 3GPP TS 32.422 for further description of the values. It shall +# comply with the provisions defined in table 5.6.3.15-1. + + MeasurementPeriodLteMdt: +# anyOf: +# - type: string + enum: + - 1024 + - 1280 + - 2048 + - 2560 + - 5120 + - 10240 + - 60000 +# - type: string +# description: > +# The enumeration MeasurementPeriodLteMdt defines Measurement period LTE for MDT in the trace. +# See 3GPP TS 32.422 for further description of the values. It shall comply with the +# provisions defined in table 5.6.3.16-1. + + ReportIntervalNrMdt: +# anyOf: +# - type: string + enum: + - 120 + - 240 + - 480 + - 640 + - 1024 + - 2048 + - 5120 + - 10240 + - 20480 + - 40960 + - 60000 + - 360000 + - 720000 + - 1800000 + - 3600000 +# - type: string +# description: > +# The enumeration ReportIntervalNrMdt defines Report Interval in NR for MDT in the trace. See +# 3GPP TS 32.422 for further description of the values. It shall comply with the provisions +# defined in table 5.6.3.17-1. + + LoggingIntervalNrMdt: +# anyOf: +# - type: string + enum: + - 128 + - 256 + - 512 + - 1024 + - 2048 + - 3072 + - 4096 + - 6144 + - 320 + - 640 + - infinity +# - type: string +# description: > +# The enumeration LoggingIntervalNrMdt defines Logging Interval in NR for MDT in the trace. +# See 3GPP TS 32.422 for further description of the values. It shall comply with the +# provisions defined in table 5.6.3.18-1. + + CollectionPeriodRmmNrMdt: +# anyOf: +# - type: string + enum: + - 1024 + - 2048 + - 5120 + - 10240 + - 60000 +# - type: string +# description: > +# The enumeration CollectionPeriodRmmNrMdt defines Collection period for RRM measurements NR for MDT in the trace. +# See 3GPP TS 32.422 for further description of the values. It shall comply with the provisions defined in table 5.6.3.19-1 + + LoggingDurationNrMdt: +# anyOf: +# - type: string + enum: + - 600 + - 1200 + - 2400 + - 3600 + - 5400 + - 7200 +# - type: string +# description: > +# The enumeration LoggingDurationMdt defines Logging Duration in NR for MDT in the trace. See +# 3GPP TS 32.422 for further description of the values. It shall comply with the provisions +# defined in table 5.6.3.20-1. +# +# STRUCTURED DATA TYPES +# + TraceData: + description: contains Trace control and configuration parameters. + type: object + nullable: true + properties: + traceRef: + type: string + pattern: '^[0-9]{3}[0-9]{2,3}-[A-Fa-f0-9]{6}$' + description: > + Trace Reference (see 3GPP TS 32.422).It shall be encoded as the concatenation of MCC, + MNC and Trace ID as follows: 'MCC' + List of NE Types (see 3GPP TS 32.422).It shall be encoded as an octet string in + hexadecimal representation. + Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" + and shall represent 4 bits. + The most significant character representing the 4 most significant bits shall appear + first in the string, and the character representing the + 4 least significant bit shall appear last in the string.Octets shall be coded + according to 3GPP TS 32.422. + eventList: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + Triggering events (see 3GPP TS 32.422).It shall be encoded as an octet string in + hexadecimal representation. Each character in the string shall take a value of "0" + to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. + The most significant character representing the 4 most significant bits shall appear + first in the string, and the character representing the 4 least significant bit shall + appear last in the string. Octets shall be coded according to 3GPP TS 32.422. + collectionEntityIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + collectionEntityIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + interfaceList: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + List of Interfaces (see 3GPP TS 32.422).It shall be encoded as an octet string in + hexadecimal representation. + Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" + and shall represent 4 bits. The most significant character representing the 4 most + significant bits shall appear first in the string, and the character representing the + 4 least significant bit shall appear last in the string. Octets shall be coded + according to 3GPP TS 32.422. If this attribute is not present, all the interfaces + applicable to the list of NE types indicated in the neTypeList attribute should + be traced. + required: + - traceRef + - traceDepth + - neTypeList + - eventList + + MdtConfiguration: + description: contains contain MDT configuration data. + type: object + required: + - jobType + properties: + jobType: + $ref: '#/components/schemas/JobType' + reportType: + $ref: '#/components/schemas/ReportTypeMdt' + areaScope: + $ref: '#/components/schemas/AreaScope' + measurementLteList: + type: array + items: + $ref: '#/components/schemas/MeasurementLteForMdt' + measurementNrList: + type: array + items: + $ref: '#/components/schemas/MeasurementNrForMdt' + minItems: 1 + sensorMeasurementList: + type: array + items: + $ref: '#/components/schemas/SensorMeasurement' + minItems: 1 + reportingTriggerList: + type: array + items: + $ref: '#/components/schemas/ReportingTrigger' + minItems: 1 + reportInterval: + $ref: '#/components/schemas/ReportIntervalMdt' + reportIntervalNr: + $ref: '#/components/schemas/ReportIntervalNrMdt' + reportAmount: + $ref: '#/components/schemas/ReportAmountMdt' + eventThresholdRsrp: + type: integer + minimum: 0 + maximum: 97 + description: > + This IE shall be present if the report trigger parameter is configured for A2 event + reporting or A2 event triggered periodic reporting and the job type parameter is + configured for Immediate MDT or combined Immediate MDT and Trace in LTE. + When present, this IE shall indicate the Event Threshold for RSRP, and the value shall + be between 0-97. + + eventThresholdRsrpNr: + type: integer + minimum: 0 + maximum: 127 + description: > + This IE shall be present if the report trigger parameter is configured for A2 event + reporting or A2 event triggered periodic reporting and the job type parameter is + configured for Immediate MDT or combined Immediate MDT + and Trace in NR. When present, + this IE shall indicate the Event Threshold for RSRP, and the value shall be + between 0-127. + eventThresholdRsrq: + type: integer + minimum: 0 + maximum: 34 + description: > + This IE shall be present if the report trigger parameter is configured for A2 event + reporting or A2 event triggered periodic reporting and the job type parameter is + configured for Immediate MDT or combined Immediate MDT and Trace in LTE.When present, + this IE shall indicate the Event Threshold for RSRQ, and the value shall be + between 0-34. + eventThresholdRsrqNr: + type: integer + minimum: 0 + maximum: 127 + description: > + This IE shall be present if the report trigger parameter is configured for A2 event + reporting or A2 event triggered periodic reporting and the job type parameter is + configured for Immediate MDT or combined Immediate MDT and Trace in NR.When present, + this IE shall indicate the Event Threshold for RSRQ, and the value shall be + between 0-127. + eventList: + type: array + items: + $ref: '#/components/schemas/EventForMdt' + minItems: 1 + loggingInterval: + $ref: '#/components/schemas/LoggingIntervalMdt' + loggingIntervalNr: + $ref: '#/components/schemas/LoggingIntervalNrMdt' + loggingDuration: + $ref: '#/components/schemas/LoggingDurationMdt' + loggingDurationNr: + $ref: '#/components/schemas/LoggingDurationNrMdt' + positioningMethod: + $ref: '#/components/schemas/PositioningMethodMdt' + addPositioningMethodList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodMdt' + minItems: 1 + collectionPeriodRmmLte: + $ref: '#/components/schemas/CollectionPeriodRmmLteMdt' + collectionPeriodRmmNr: + $ref: '#/components/schemas/CollectionPeriodRmmNrMdt' + measurementPeriodLte: + $ref: '#/components/schemas/MeasurementPeriodLteMdt' + mdtAllowedPlmnIdList: + type: array + items: + $ref: '#/components/schemas/PlmnId' + minItems: 1 + maxItems: 16 + mbsfnAreaList: + type: array + items: + $ref: '#/components/schemas/MbsfnArea' + minItems: 1 + maxItems: 8 + interFreqTargetList: + type: array + items: + $ref: '#/components/schemas/InterFreqTargetInfo' + minItems: 1 + maxItems: 8 + + AreaScope: + description: Contain the area based on Cells or Tracking Areas. + type: object + properties: + eutraCellIdList: + type: array + items: + $ref: '#/components/schemas/EutraCellId' + minItems: 1 + nrCellIdList: + type: array + items: + $ref: '#/components/schemas/NrCellId' + minItems: 1 + tacList: + type: array + items: + $ref: '#/components/schemas/Tac' + minItems: 1 + tacInfoPerPlmn: + type: object + additionalProperties: + $ref: '#/components/schemas/TacInfo' + minProperties: 1 + description: > + A map (list of key-value pairs) where PlmnId converted to a string serves as key + + TacInfo: + description: contains tracking area information (tracking area codes). + type: object + required: + - tacList + properties: + tacList: + type: array + items: + $ref: '#/components/schemas/Tac' + minItems: 1 + + MbsfnArea: + description: Contains an MBSFN area information. + type: object + properties: + mbsfnAreaId: + type: integer + minimum: 0 + maximum: 255 + description: This IE shall contain the MBSFN Area ID. + carrierFrequency: + type: integer + minimum: 0 + maximum: 262143 + description: When present, this IE shall contain the Carrier Frequency (EARFCN). + + InterFreqTargetInfo: + description: Indicates the Inter Frequency Target information. + required: + - dlCarrierFreq + type: object + properties: + dlCarrierFreq: + $ref: '#/components/schemas/ArfcnValueNR' + cellIdList: + type: array + items: + $ref: '#/components/schemas/PhysCellId' + minItems: 1 + maxItems: 32 + description: > + When present, this IE shall contain a list of the physical cell identities where the + UE is requested to perform measurement logging for the indicated frequency. + + +# Data Types related to 5G ODB as defined in clause 5.7 + +# +# SIMPLE DATA TYPES +# +# +# +# Enumerations +# + RoamingOdb: +# anyOf: +# - type: string + enum: + - OUTSIDE_HOME_PLMN + - OUTSIDE_HOME_PLMN_COUNTRY +# - type: string +# description: > +# The enumeration RoamingOdb defines the Barring of Roaming as. See 3GPP TS 23.015 for further +# description. It shall comply with the provisions defined in table 5.7.3.1-1. + + OdbPacketServices: +# anyOf: +# - anyOf: +# - type: string + enum: + - ALL_PACKET_SERVICES + - ROAMER_ACCESS_HPLMN_AP + - ROAMER_ACCESS_VPLMN_AP +# - type: string +# - $ref: '#/components/schemas/NullValue' +# description: > +# The enumeration OdbPacketServices defines the Barring of Packet Oriented Services. +# See 3GPP TS 23.015 for further description. It shall comply with the provisions defined +# in table 5.7.3.2-1 + +# +# STRUCTURED DATA TYPES +# + + OdbData: + description: Contains information regarding operater determined barring. + type: object + properties: + roamingOdb: + $ref: '#/components/schemas/RoamingOdb' + +# +# Data Types related to Charging as defined in clause 5.8 +# + +# +# SIMPLE DATA TYPES +# +# + ChargingId: + deprecated: true + type: integer + minimum: 0 + maximum: 4294967295 #(2^32)-1 + description: > + Integer where the allowed values correspond to the value range of an unsigned 32-bit + integer. + + + ApplicationChargingId: + type: string + description: Application provided charging identifier allowing correlation of charging information. + + RatingGroup: + $ref: '#/components/schemas/Uint32' + + ServiceId: + $ref: '#/components/schemas/Uint32' + + +# +# Enumerations +# + +# +# STRUCTURED DATA TYPES +# + SecondaryRatUsageReport: + description: Secondary RAT Usage Report to report usage data for a secondary RAT for QoS flows. + type: object + properties: + secondaryRatType: + $ref: '#/components/schemas/RatType' + qosFlowsUsageData: + type: array + items: + $ref: '#/components/schemas/QosFlowUsageReport' + minItems: 1 + required: + - secondaryRatType + - qosFlowsUsageData + + QosFlowUsageReport: + description: Contains QoS flows usage data information. + type: object + properties: + qfi: + $ref: '#/components/schemas/Qfi' + startTimeStamp: + $ref: '#/components/schemas/DateTime' + endTimeStamp: + $ref: '#/components/schemas/DateTime' + downlinkVolume: + $ref: '#/components/schemas/Int64' + uplinkVolume: + $ref: '#/components/schemas/Int64' + required: + - qfi + - startTimeStamp + - endTimeStamp + - downlinkVolume + - uplinkVolume + + SecondaryRatUsageInfo: + description: > + Secondary RAT Usage Information to report usage data for a secondary RAT for QoS flows + and/or the whole PDU session. + type: object + properties: + secondaryRatType: + $ref: '#/components/schemas/RatType' + qosFlowsUsageData: + type: array + items: + $ref: '#/components/schemas/QosFlowUsageReport' + minItems: 1 + pduSessionUsageData: + type: array + items: + $ref: '#/components/schemas/VolumeTimedReport' + minItems: 1 + required: + - secondaryRatType + + VolumeTimedReport: + description: Contains Usage data information. + type: object + properties: + startTimeStamp: + $ref: '#/components/schemas/DateTime' + endTimeStamp: + $ref: '#/components/schemas/DateTime' + downlinkVolume: + $ref: '#/components/schemas/Int64' + uplinkVolume: + $ref: '#/components/schemas/Int64' + required: + - startTimeStamp + - endTimeStamp + - downlinkVolume + - uplinkVolume + + +# Data Types related to MBS as defined in clause 5.9 +# + +# +# SIMPLE DATA TYPES +# +# + + AreaSessionId: + $ref: '#/components/schemas/Uint16' + + MbsFsaId: + description: MBS Frequency Selection Area Identifier + type: string + pattern: '^[A-Fa-f0-9]{6}$' + + + +# +# Enumerations +# +# + MbsServiceType: +# description: Indicates the MBS service type of an MBS session +# anyOf: +# - type: string + enum: + - MULTICAST + - BROADCAST +# - type: string + + MbsSessionActivityStatus: +# description: Indicates the MBS session's activity status +# anyOf: +# - type: string + enum: + - ACTIVE + - INACTIVE +# - type: string + + MbsSessionEventType: +# description: MBS Session Event Type +# anyOf: +# - type: string + enum: + - MBS_REL_TMGI_EXPIRY + - BROADCAST_DELIVERY_STATUS + - INGRESS_TUNNEL_ADD_CHANGE +# - type: string + + BroadcastDeliveryStatus: +# description: Broadcast MBS Session's Delivery Status +# anyOf: +# - type: string + enum: + - STARTED + - TERMINATED +# - type: string + +# +# STRUCTURED DATA TYPES +# + MbsSessionId: + description: MBS Session Identifier + type: object + properties: + tmgi: + $ref: '#/components/schemas/Tmgi' + ssm: + $ref: '#/components/schemas/Ssm' + nid: + $ref: '#/components/schemas/Nid' + anyOf: + - required: [ tmgi ] + - required: [ ssm ] + + Tmgi: + description: Temporary Mobile Group Identity + type: object + properties: + mbsServiceId: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: MBS Service ID + plmnId: + $ref: '#/components/schemas/PlmnId' + required: + - mbsServiceId + - plmnId + + Ssm: + description: Source specific IP multicast address + type: object + properties: + sourceIpAddr: + $ref: '#/components/schemas/IpAddr' + destIpAddr: + $ref: '#/components/schemas/IpAddr' + required: + - sourceIpAddr + - destIpAddr + + MbsServiceArea: + description: MBS Service Area + type: object + properties: + ncgiList: + type: array + items: + $ref: '#/components/schemas/NcgiTai' + minItems: 1 + description: List of NR cell Ids + taiList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 1 + description: List of tracking area Ids + anyOf: + - required: [ ncgiList ] + - required: [ taiList ] + + NcgiTai: + description: List of NR cell ids, with their pertaining TAIs + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + cellList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 1 + description: List of List of NR cell ids + required: + - tai + - cellList + + MbsSession: + description: Individual MBS session + type: object + properties: + mbsSessionId: + $ref: '#/components/schemas/MbsSessionId' + tmgiAllocReq: + type: boolean + default: false + writeOnly: true + tmgi: + $ref: '#/components/schemas/Tmgi' + readOnly: true + expirationTime: + $ref: '#/components/schemas/DateTime' + readOnly: true + serviceType: + $ref: '#/components/schemas/MbsServiceType' + writeOnly: true + locationDependent: + type: boolean + default: false + areaSessionId: + $ref: '#/components/schemas/AreaSessionId' + readOnly: true + ingressTunAddrReq: + type: boolean + default: false + writeOnly: true + ingressTunAddr: + type: array + items: + $ref: '#/components/schemas/TunnelAddress' + minItems: 1 + readOnly: true + ssm: + $ref: '#/components/schemas/Ssm' + writeOnly: true + mbsServiceArea: + $ref: '#/components/schemas/MbsServiceArea' + writeOnly: true + extMbsServiceArea: + $ref: '#/components/schemas/ExternalMbsServiceArea' + writeOnly: true + dnn: + $ref: '#/components/schemas/Dnn' + writeOnly: true + snssai: + $ref: '#/components/schemas/Snssai' + writeOnly: true + activationTime: + deprecated: true + format: date-time + type: string + startTime: + $ref: '#/components/schemas/DateTime' + terminationTime: + $ref: '#/components/schemas/DateTime' + mbsServInfo: + $ref: '#/components/schemas/MbsServiceInfo' + mbsSessionSubsc: + $ref: '#/components/schemas/MbsSessionSubscription' + activityStatus: + $ref: '#/components/schemas/MbsSessionActivityStatus' + anyUeInd: + type: boolean + default: false + writeOnly: true + mbsFsaIdList: + type: array + items: + $ref: '#/components/schemas/MbsFsaId' + minItems: 1 + required: + - serviceType + anyOf: + - required: [ mbsSessionId ] + - required: [ tmgiAllocReq ] + + + MbsSessionSubscription: + description: MBS session subscription + type: object + properties: + mbsSessionId: + $ref: '#/components/schemas/MbsSessionId' + areaSessionId: + $ref: '#/components/schemas/AreaSessionId' + eventList: + type: array + items: + $ref: '#/components/schemas/MbsSessionEvent' + minItems: 1 + notifyUri: + $ref: '#/components/schemas/Uri' + notifyCorrelationId: + type: string + expiryTime: + $ref: '#/components/schemas/DateTime' + nfcInstanceId: + $ref: '#/components/schemas/NfInstanceId' + mbsSessionSubscUri: + $ref: '#/components/schemas/Uri' + readOnly: true + required: + - eventList + - notifyUri + + MbsSessionEventReportList: + description: MBS session event report list + type: object + properties: + eventReportList: + type: array + items: + $ref: '#/components/schemas/MbsSessionEventReport' + minItems: 1 + notifyCorrelationId: + type: string + required: + - eventReportList + + MbsSessionEvent: + description: MBS session event + type: object + properties: + eventType: + $ref: '#/components/schemas/MbsSessionEventType' + required: + - eventType + + MbsSessionEventReport: + description: MBS session event report + type: object + properties: + eventType: + $ref: '#/components/schemas/MbsSessionEventType' + timeStamp: + $ref: '#/components/schemas/DateTime' + ingressTunAddrInfo: + $ref: '#/components/schemas/IngressTunAddrInfo' + broadcastDelStatus: + $ref: '#/components/schemas/BroadcastDeliveryStatus' + required: + - eventType + + ExternalMbsServiceArea: + description: List of geographic area or list of civic address info for MBS Service Area + type: object + properties: + geographicAreaList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + civicAddressList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + oneOf: + - required: [ geographicAreaList ] + - required: [ civicAddressList ] + + + MbsSecurityContext: + type: object + properties: + keyList: + description: A map (list of key-value pairs) where a (unique) valid JSON string serves as key of MbsSecurityContext + type: object + additionalProperties: + $ref: '#/components/schemas/MbsKeyInfo' + minProperties: 1 + required: + - keyList + + MbsKeyInfo: + description: MBS Security Key Data Structure + type: object + properties: + keyDomainId: + $ref: '#/components/schemas/Bytes' + mskId: + $ref: '#/components/schemas/Bytes' + msk: + $ref: '#/components/schemas/Bytes' + mskLifetime: + $ref: '#/components/schemas/DateTime' + mtkId: + $ref: '#/components/schemas/Bytes' + mtk: + $ref: '#/components/schemas/Bytes' + required: + - keyDomainId + - mskId + + IngressTunAddrInfo: + description: Ingress Tunnel Address Information + type: object + properties: + ingressTunAddr: + type: array + items: + $ref: '#/components/schemas/TunnelAddress' + minItems: 1 + required: + - ingressTunAddr + + + MbsServiceAreaInfo: + description: MBS Service Area Information for location dependent MBS session + type: object + properties: + areaSessionId: + $ref: '#/components/schemas/AreaSessionId' + mbsServiceArea: + $ref: '#/components/schemas/MbsServiceArea' + required: + - areaSessionId + - mbsServiceArea + + MbsServiceInfo: + description: Represent MBS Service Information. + type: object + properties: + mbsMediaComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MbsMediaCompRm' + minProperties: 1 + mbsSdfResPrio: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ReservPriority' + afAppId: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AfAppId' + mbsSessionAmbr: + $ref: '#/components/schemas/BitRate' + required: + - mbsMediaComps + + MbsMediaComp: + description: Represents an MBS Media Component. + type: object + properties: + mbsMedCompNum: + type: integer + mbsFlowDescs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + minItems: 1 + mbsSdfResPrio: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ReservPriority' + mbsMediaInfo: + $ref: '#/components/schemas/MbsMediaInfo' + qosRef: + type: string + mbsQoSReq: + $ref: '#/components/schemas/MbsQoSReq' + required: + - mbsMedCompNum + + MbsMediaCompRm: + description: > + This data type is defined in the same way as the MbsMediaComp data type, but with the + OpenAPI nullable property set to true. + anyOf: + - $ref: '#/components/schemas/MbsMediaComp' + - $ref: '#/components/schemas/NullValue' + + MbsQoSReq: + description: Represent MBS QoS requirements. + type: object + properties: + 5qi: + $ref: '#/components/schemas/5Qi' + guarBitRate: + $ref: '#/components/schemas/BitRate' + maxBitRate: + $ref: '#/components/schemas/BitRate' + averWindow: + $ref: '#/components/schemas/AverWindow' + reqMbsArp: + $ref: '#/components/schemas/Arp' + required: + - 5qi + + MbsMediaInfo: + description: Represent MBS Media Information. + type: object + properties: + mbsMedType: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/MediaType' + maxReqMbsBwDl: + $ref: '#/components/schemas/BitRate' + minReqMbsBwDl: + $ref: '#/components/schemas/BitRate' + codecs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/CodecData' + minItems: 1 + maxItems: 2 + +# +# HTTP responses +# + + responses: + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: '#/components/schemas/RedirectResponse' + headers: + Location: + description: 'The URI pointing to the resource located on the redirect target' + required: true + schema: + type: string + 3gpp-Sbi-Target-Nf-Id: + description: 'Identifier of target NF (service) instance towards which the request is redirected' + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: '#/components/schemas/RedirectResponse' + headers: + Location: + description: 'The URI pointing to the resource located on the redirect target' + required: true + schema: + type: string + 3gpp-Sbi-Target-Nf-Id: + description: > + 'Identifier of target NF (service) instance towards which the request is redirected' + schema: + type: string + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '405': + description: Method Not Allowed + '408': + description: Request Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '406': + description: 406 Not Acceptable + '409': + description: Conflict + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '410': + description: Gone + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '411': + description: Length Required + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '412': + description: Precondition Failed + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '414': + description: URI Too Long + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '501': + description: Not Implemented + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '502': + description: Bad Gateway + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '504': + description: Gateway Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + default: + description: Generic Error diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29572_Nlmf_Broadcast.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29572_Nlmf_Broadcast.yaml new file mode 100644 index 000000000..e8162f026 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29572_Nlmf_Broadcast.yaml @@ -0,0 +1,245 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'LMF Broadcast' + description: | + LMF Broadcast Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.572 V17.5.0; 5G System; Location Management Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.572/' + +servers: + - url: '{apiRoot}/nlmf-broadcast/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /cipher-key-data: + post: + summary: Request ciphering key data + operationId: CipheringKeyData + tags: + - Request Ciphering Key Data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CipherRequestData' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CipherResponseData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + CipheringKeyData: + '{$request.body#/amfCallBackURI}': + post: + requestBody: + description: Ciphering Key Data Notification + content: + application/json: + schema: + $ref: '#/components/schemas/CipheringKeyInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CipheringKeyResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: +# +# COMPLEX TYPES +# + CipheringKeyInfo: + description: Information within Ciphering Key Data Notification request. + type: object + required: + - cipheringData + properties: + cipheringData: + type: array + items: + $ref: '#/components/schemas/CipheringDataSet' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + CipheringKeyResponse: + description: Information within Ciphering Key Data Notification Response. + type: object + properties: + cipheringDataReport: + type: array + items: + $ref: '#/components/schemas/CipheringSetReport' + minItems: 1 + + CipheringDataSet: + description: Represents a Ciphering Data Set. + type: object + required: + - cipheringSetID + - cipheringKey + - c0 + - validityStartTime + - validityDuration + properties: + cipheringSetID: + $ref: '#/components/schemas/CipheringSetID' + cipheringKey: + $ref: '#/components/schemas/CipheringKey' + c0: + $ref: '#/components/schemas/C0' + ltePosSibTypes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + nrPosSibTypes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + validityStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validityDuration: + $ref: '#/components/schemas/ValidityDuration' + taiList: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + CipheringSetReport: + description: Represents a report of Ciphering Data Set storage. + type: object + required: + - cipheringSetID + - storageOutcome + properties: + cipheringSetID: + $ref: '#/components/schemas/CipheringSetID' + storageOutcome: + $ref: '#/components/schemas/StorageOutcome' + + CipherRequestData: + description: Information within Ciphering Key Data request. + type: object + required: + - amfCallBackURI + properties: + amfCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + CipherResponseData: + description: Information within Ciphering Key Data Response. + type: object + required: + - dataAvailability + properties: + dataAvailability: + $ref: '#/components/schemas/DataAvailability' +# +# +# SIMPLE TYPES +# + CipheringSetID: + description: Ciphering Data Set Identifier. + type: integer + minimum: 0 + maximum: 65535 + + CipheringKey: + description: Ciphering Key. + format: byte + type: string + + C0: + description: First component of the initial ciphering counter. + format: byte + type: string + + ValidityDuration: + description: Validity Duration of the Ciphering Data Set. + type: integer + minimum: 1 + maximum: 65535 +# +# ENUMS +# + StorageOutcome: + description: Indicates the result of Ciphering Data Set storage. + anyOf: + - type: string + enum: + - STORAGE_SUCCESSFUL + - STORAGE_FAILED + + DataAvailability: + description: Indicates availability of ciphering key data at an LMF. + anyOf: + - type: string + enum: + - CIPHERING_KEY_DATA_AVAILABLE + - CIPHERING_KEY_DATA_NOT_AVAILABLE diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29572_Nlmf_Location.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29572_Nlmf_Location.yaml new file mode 100644 index 000000000..cbc24e8c3 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29572_Nlmf_Location.yaml @@ -0,0 +1,1546 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'LMF Location' + description: | + LMF Location Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.572 V17.7.0; 5G System; Location Management Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.572/' + +servers: + - url: '{apiRoot}/nlmf-loc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - nlmf-loc + +paths: + /determine-location: + post: + summary: Determine Location of an UE + operationId: DetermineLocation + tags: + - Determine Location + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/InputData' + binaryDataLppMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataLppMessage: + contentType: application/vnd.3gpp.lpp + headers: + Content-Id: + schema: + type: string + binaryDataLppMessageExt1: + contentType: application/vnd.3gpp.lpp + headers: + Content-Id: + schema: + type: string + binaryDataLppMessageExt2: + contentType: application/vnd.3gpp.lpp + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationData' + '204': + description: Expected response for MO-LR requesting location assistance data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + EventNotify: + '{$request.body#/hgmlcCallBackURI}': + post: + requestBody: + description: UE Event Notification + content: + application/json: + schema: + $ref: '#/components/schemas/EventNotifyData' + responses: + '204': + description: Expected response to a valid notification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /cancel-location: + post: + summary: request cancellation of periodic or triggered location + operationId: CancelLocation + tags: + - Cancel Location + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CancelLocData' + required: true + responses: + '204': + description: Expected response to a successful cancellation + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /location-context-transfer: + post: + summary: transfer context information for periodic or triggered location + operationId: LocationContextTransfer + tags: + - Location Context Transfer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocContextData' + required: true + responses: + '204': + description: Expected response to successful location context transfer + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nlmf-loc: Access to the Nlmf_Location API + schemas: +# +# COMPLEX TYPES +# + InputData: + description: Information within Determine Location Request. + type: object + not: + required: [ ecgi, ncgi ] + properties: + externalClientType: + $ref: '#/components/schemas/ExternalClientType' + correlationID: + $ref: '#/components/schemas/CorrelationID' + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + locationQoS: + $ref: '#/components/schemas/LocationQoS' + supportedGADShapes: + type: array + items: + $ref: '#/components/schemas/SupportedGADShapes' + minItems: 1 + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ecgiOnSecondNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ncgiOnSecondNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + priority: + $ref: '#/components/schemas/LcsPriority' + velocityRequested: + $ref: '#/components/schemas/VelocityRequested' + ueLcsCap: + $ref: '#/components/schemas/UeLcsCapability' + lcsServiceType: + $ref: '#/components/schemas/LcsServiceType' + ldrType: + $ref: '#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + vgmlcAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + periodicEventInfo: + $ref: '#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: '#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: '#/components/schemas/MotionEventInfo' + reportingAccessTypes: + type: array + items: + $ref: '#/components/schemas/ReportingAccessType' + minItems: 1 + ueConnectivityStates: + $ref: '#/components/schemas/UeConnectivityState' + ueLocationServiceInd: + $ref: '#/components/schemas/UeLocationServiceInd' + moAssistanceDataTypes: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsBroadcastAssistanceTypesData' + lppMessage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + lppMessageExt: + description: Indicates the lpp message extension. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + uePositioningCap: + $ref: '#/components/schemas/UePositioningCapabilities' + tnapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TnapId' + twapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TwapId' + ueCountryDetInd: + type: boolean + scheduledLocTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reliableLocReq: + type: boolean + default: false + + LocationData: + description: Information within Determine Location Response. + type: object + required: + - locationEstimate + properties: + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + accuracyFulfilmentIndicator: + $ref: '#/components/schemas/AccuracyFulfilmentIndicator' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + civicAddress: + $ref: '#/components/schemas/CivicAddress' + localLocationEstimate: + $ref: '#/components/schemas/LocalArea' + positioningDataList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodAndUsage' + minItems: 1 + gnssPositioningDataList: + type: array + items: + $ref: '#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 1 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + altitude: + $ref: '#/components/schemas/Altitude' + barometricPressure: + $ref: '#/components/schemas/BarometricPressure' + servingLMFIdentification: + $ref: '#/components/schemas/LMFIdentification' + uePositioningCap: + $ref: '#/components/schemas/UePositioningCapabilities' + ueAreaInd: + $ref: '#/components/schemas/UeAreaIndication' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + achievedQos: + $ref: '#/components/schemas/MinorLocationQoS' + + GeographicArea: + description: Geographic area specified by different shape. + anyOf: + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/PointUncertaintyCircle' + - $ref: '#/components/schemas/PointUncertaintyEllipse' + - $ref: '#/components/schemas/Polygon' + - $ref: '#/components/schemas/PointAltitude' + - $ref: '#/components/schemas/PointAltitudeUncertainty' + - $ref: '#/components/schemas/EllipsoidArc' + + GADShape: + description: Common base type for GAD shapes. + type: object + required: + - shape + properties: + shape: + $ref: '#/components/schemas/SupportedGADShapes' + discriminator: + propertyName: shape + mapping: + POINT: '#/components/schemas/Point' + POINT_UNCERTAINTY_CIRCLE: '#/components/schemas/PointUncertaintyCircle' + POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/PointUncertaintyEllipse' + POLYGON: '#/components/schemas/Polygon' + POINT_ALTITUDE: '#/components/schemas/PointAltitude' + POINT_ALTITUDE_UNCERTAINTY: '#/components/schemas/PointAltitudeUncertainty' + ELLIPSOID_ARC: '#/components/schemas/EllipsoidArc' + LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/Local2dPointUncertaintyEllipse' + LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID: '#/components/schemas/Local3dPointUncertaintyEllipsoid' + + Point: + description: Ellipsoid Point. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + + PointUncertaintyCircle: + description: Ellipsoid point with uncertainty circle. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - uncertainty + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertainty: + $ref: '#/components/schemas/Uncertainty' + + PointUncertaintyEllipse: + description: Ellipsoid point with uncertainty ellipse. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - uncertaintyEllipse + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + + Polygon: + description: Polygon. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - pointList + properties: + pointList: + $ref: '#/components/schemas/PointList' + + PointAltitude: + description: Ellipsoid point with altitude. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - altitude + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + + PointAltitudeUncertainty: + description: Ellipsoid point with altitude and uncertainty ellipsoid. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - altitude + - uncertaintyEllipse + - uncertaintyAltitude + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + uncertaintyAltitude: + $ref: '#/components/schemas/Uncertainty' + confidence: + $ref: '#/components/schemas/Confidence' + + EllipsoidArc: + description: Ellipsoid Arc. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - innerRadius + - uncertaintyRadius + - offsetAngle + - includedAngle + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + innerRadius: + $ref: '#/components/schemas/InnerRadius' + uncertaintyRadius: + $ref: '#/components/schemas/Uncertainty' + offsetAngle: + $ref: '#/components/schemas/Angle' + includedAngle: + $ref: '#/components/schemas/Angle' + confidence: + $ref: '#/components/schemas/Confidence' + + LocalOrigin: + description: Indicates a Local origin in a reference system + type: object + properties: + coordinateId: + type: string + point: + $ref: '#/components/schemas/GeographicalCoordinates' + + RelativeCartesianLocation: + description: Relative Cartesian Location + type: object + required: + - x + - y + properties: + x: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + y: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + z: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + + + LocalArea: + description: Local area specified by different shape + oneOf: + - $ref: '#/components/schemas/Local2dPointUncertaintyEllipse' + - $ref: '#/components/schemas/Local3dPointUncertaintyEllipsoid' + + UeAreaIndication: + description: Indicates area (country, area in a country or international area) where UE is located + type: object + oneOf: + - required: + - country + - required: + - internationalAreaInd + properties: + country: + description: Indicates country or area in a country where UE is located + type: string + internationalAreaInd: + description: Indicates international area indication if UE is located in international area + type: boolean + default: false + + Local2dPointUncertaintyEllipse: + description: Local 2D point with uncertainty ellipse + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - localOrigin + - point + - uncertaintyEllipse + - confidence + properties: + localOrigin: + $ref: '#/components/schemas/LocalOrigin' + point: + $ref: '#/components/schemas/RelativeCartesianLocation' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + + Local3dPointUncertaintyEllipsoid: + description: Local 3D point with uncertainty ellipsoid + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - localOrigin + - point + - uncertaintyEllipsoid + - confidence + properties: + localOrigin: + $ref: '#/components/schemas/LocalOrigin' + point: + $ref: '#/components/schemas/RelativeCartesianLocation' + uncertaintyEllipsoid: + $ref: '#/components/schemas/UncertaintyEllipsoid' + confidence: + $ref: '#/components/schemas/Confidence' + + GeographicalCoordinates: + description: Geographical coordinates. + type: object + required: + - lon + - lat + properties: + lon: + type: number + format: double + minimum: -180 + maximum: 180 + lat: + type: number + format: double + minimum: -90 + maximum: 90 + + UncertaintyEllipse: + description: Ellipse with uncertainty. + type: object + required: + - semiMajor + - semiMinor + - orientationMajor + properties: + semiMajor: + $ref: '#/components/schemas/Uncertainty' + semiMinor: + $ref: '#/components/schemas/Uncertainty' + orientationMajor: + $ref: '#/components/schemas/Orientation' + + UncertaintyEllipsoid: + description: Ellipsoid with uncertainty + type: object + required: + - semiMajor + - semiMinor + - vertical + - orientationMajor + properties: + semiMajor: + $ref: '#/components/schemas/Uncertainty' + semiMinor: + $ref: '#/components/schemas/Uncertainty' + vertical: + $ref: '#/components/schemas/Uncertainty' + orientationMajor: + $ref: '#/components/schemas/Orientation' + + PointList: + description: List of points. + type: array + items: + $ref: '#/components/schemas/GeographicalCoordinates' + minItems: 3 + maxItems: 15 + + LocationQoS: + description: QoS of Location request. + type: object + properties: + hAccuracy: + $ref: '#/components/schemas/Accuracy' + vAccuracy: + $ref: '#/components/schemas/Accuracy' + verticalRequested: + type: boolean + responseTime: + $ref: '#/components/schemas/ResponseTime' + minorLocQoses: + type: array + items: + $ref: '#/components/schemas/MinorLocationQoS' + minItems: 1 + maxItems: 2 + lcsQosClass: + $ref: '#/components/schemas/LcsQosClass' + + PositioningMethodAndUsage: + description: Indicates the usage of a positioning method. + type: object + required: + - method + - mode + - usage + properties: + method: + $ref: '#/components/schemas/PositioningMethod' + mode: + $ref: '#/components/schemas/PositioningMode' + usage: + $ref: '#/components/schemas/Usage' + methodCode: + type: integer + minimum: 16 + maximum: 31 + + GnssPositioningMethodAndUsage: + description: Indicates the usage of a Global Navigation Satellite System (GNSS) positioning method. + type: object + required: + - mode + - gnss + - usage + properties: + mode: + $ref: '#/components/schemas/PositioningMode' + gnss: + $ref: '#/components/schemas/GnssId' + usage: + $ref: '#/components/schemas/Usage' + + CivicAddress: + description: Indicates a Civic address. + type: object + properties: + country: + type: string + A1: + type: string + A2: + type: string + A3: + type: string + A4: + type: string + A5: + type: string + A6: + type: string + PRD: + type: string + POD: + type: string + STS: + type: string + HNO: + type: string + HNS: + type: string + LMK: + type: string + LOC: + type: string + NAM: + type: string + PC: + type: string + BLD: + type: string + UNIT: + type: string + FLR: + type: string + ROOM: + type: string + PLC: + type: string + PCN: + type: string + POBOX: + type: string + ADDCODE: + type: string + SEAT: + type: string + RD: + type: string + RDSEC: + type: string + RDBR: + type: string + RDSUBBR: + type: string + PRM: + type: string + POM: + type: string + usageRules: + type: string + method: + type: string + providedBy: + type: string + + VelocityEstimate: + description: Velocity estimate. + oneOf: + - $ref: '#/components/schemas/HorizontalVelocity' + - $ref: '#/components/schemas/HorizontalWithVerticalVelocity' + - $ref: '#/components/schemas/HorizontalVelocityWithUncertainty' + - $ref: '#/components/schemas/HorizontalWithVerticalVelocityAndUncertainty' + + HorizontalVelocity: + description: Horizontal velocity. + type: object + required: + - hSpeed + - bearing + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + + HorizontalWithVerticalVelocity: + description: Horizontal and vertical velocity. + type: object + required: + - hSpeed + - bearing + - vSpeed + - vDirection + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + vSpeed: + $ref: '#/components/schemas/VerticalSpeed' + vDirection: + $ref: '#/components/schemas/VerticalDirection' + + HorizontalVelocityWithUncertainty: + description: Horizontal velocity with speed uncertainty. + type: object + required: + - hSpeed + - bearing + - hUncertainty + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + hUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + + HorizontalWithVerticalVelocityAndUncertainty: + description: Horizontal and vertical velocity with speed uncertainty. + type: object + required: + - hSpeed + - bearing + - vSpeed + - vDirection + - hUncertainty + - vUncertainty + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + vSpeed: + $ref: '#/components/schemas/VerticalSpeed' + vDirection: + $ref: '#/components/schemas/VerticalDirection' + hUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + vUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + + UeLcsCapability: + description: Indicates the LCS capability supported by the UE.. + type: object + properties: + lppSupport: + type: boolean + default: true + ciotOptimisation: + type: boolean + default: false + + PeriodicEventInfo: + description: Indicates the information of periodic event reporting. + type: object + required: + - reportingAmount + - reportingInterval + properties: + reportingAmount: + $ref: '#/components/schemas/ReportingAmount' + reportingInterval: + $ref: '#/components/schemas/ReportingInterval' + + AreaEventInfo: + description: Indicates the information of area based event reporting. + type: object + required: + - areaDefinition + properties: + areaDefinition: + type: array + items: + $ref: '#/components/schemas/ReportingArea' + minItems: 1 + maxItems: 250 + occurrenceInfo: + $ref: '#/components/schemas/OccurrenceInfo' + minimumInterval: + $ref: '#/components/schemas/MinimumInterval' + maximumInterval: + $ref: '#/components/schemas/MaximumInterval' + samplingInterval: + $ref: '#/components/schemas/SamplingInterval' + reportingDuration: + $ref: '#/components/schemas/ReportingDuration' + reportingLocationReq: + type: boolean + default: true + + ReportingArea: + description: Indicates an area for event reporting. + type: object + required: + - areaType + properties: + areaType: + $ref: '#/components/schemas/ReportingAreaType' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + + MotionEventInfo: + description: Indicates the information of motion based event reporting. + type: object + required: + - linearDistance + properties: + linearDistance: + $ref: '#/components/schemas/LinearDistance' + occurrenceInfo: + $ref: '#/components/schemas/OccurrenceInfo' + minimumInterval: + $ref: '#/components/schemas/MinimumInterval' + maximumInterval: + $ref: '#/components/schemas/MaximumInterval' + samplingInterval: + $ref: '#/components/schemas/SamplingInterval' + reportingDuration: + $ref: '#/components/schemas/ReportingDuration' + reportingLocationReq: + type: boolean + default: true + + CancelLocData: + description: Information within Cancel Location Request. + type: object + required: + - hgmlcCallBackURI + - ldrReference + properties: + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + LocContextData: + description: Information within Transfer Location Context Request. + type: object + required: + - amfId + - ldrType + - hgmlcCallBackURI + - ldrReference + - eventReportMessage + properties: + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + locationQoS: + $ref: '#/components/schemas/LocationQoS' + supportedGADShapes: + type: array + items: + $ref: '#/components/schemas/SupportedGADShapes' + minItems: 1 + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ldrType: + $ref: '#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + periodicEventInfo: + $ref: '#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: '#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: '#/components/schemas/MotionEventInfo' + eventReportMessage: + $ref: '#/components/schemas/EventReportMessage' + eventReportingStatus: + $ref: '#/components/schemas/EventReportingStatus' + ueLocationInfo: + $ref: '#/components/schemas/UELocationInfo' + cIoT5GSOptimisation: + type: boolean + default: false + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + uePositioningCap: + $ref: '#/components/schemas/UePositioningCapabilities' + scheduledLocTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + EventReportMessage: + description: Indicates an event report message. + type: object + required: + - eventClass + - eventContent + properties: + eventClass: + $ref: '#/components/schemas/EventClass' + eventContent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + + EventReportingStatus: + description: Indicates the status of event reporting. + type: object + properties: + eventReportCounter: + $ref: '#/components/schemas/EventReportCounter' + eventReportDuration: + $ref: '#/components/schemas/EventReportDuration' + + UELocationInfo: + description: Indicates location information of a UE. + type: object + properties: + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + ageOfVelocityEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + timestampOfVelocityEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + EventNotifyData: + description: Information within Event Notify Request. + type: object + required: + - reportedEventType + - ldrReference + properties: + reportedEventType: + $ref: '#/components/schemas/ReportedEventType' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + civicAddress: + $ref: '#/components/schemas/CivicAddress' + localLocationEstimate: + $ref: '#/components/schemas/LocalArea' + positioningDataList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodAndUsage' + minItems: 1 + gnssPositioningDataList: + type: array + items: + $ref: '#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 1 + servingLMFidentification: + $ref: '#/components/schemas/LMFIdentification' + terminationCause: + $ref: '#/components/schemas/TerminationCause' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + altitude: + $ref: '#/components/schemas/Altitude' + achievedQos: + $ref: '#/components/schemas/MinorLocationQoS' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + UeConnectivityState: + description: Indicates the connectivity state of a UE. + type: object + required: + - accessType + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + connectivitystate: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmState' + + MinorLocationQoS: + description: Contain Minor Location QoS. + type: object + properties: + hAccuracy: + $ref: '#/components/schemas/Accuracy' + vAccuracy: + $ref: '#/components/schemas/Accuracy' + +# +# +# SIMPLE TYPES +# + Altitude: + description: Indicates value of altitude. + type: number + format: double + minimum: -32767 + maximum: 32767 + + Angle: + description: Indicates value of angle. + type: integer + minimum: 0 + maximum: 360 + + Uncertainty: + description: Indicates value of uncertainty. + type: number + format: float + minimum: 0 + + Orientation: + description: Indicates value of orientation angle. + type: integer + minimum: 0 + maximum: 180 + + Confidence: + description: Indicates value of confidence. + type: integer + minimum: 0 + maximum: 100 + + Accuracy: + description: Indicates value of accuracy. + type: number + format: float + minimum: 0 + + InnerRadius: + description: Indicates value of the inner radius. + type: integer + format: int32 + minimum: 0 + maximum: 327675 + + CorrelationID: + description: LCS Correlation ID. + type: string + minLength: 1 + maxLength: 255 + + AgeOfLocationEstimate: + description: Indicates value of the age of the location estimate. + type: integer + minimum: 0 + maximum: 32767 + + HorizontalSpeed: + description: Indicates value of horizontal speed. + type: number + format: float + minimum: 0 + maximum: 2047 + + VerticalSpeed: + description: Indicates value of vertical speed. + type: number + format: float + minimum: 0 + maximum: 255 + + SpeedUncertainty: + description: Indicates value of speed uncertainty. + type: number + format: float + minimum: 0 + maximum: 255 + + BarometricPressure: + description: Specifies the measured uncompensated atmospheric pressure. + type: integer + minimum: 30000 + maximum: 115000 + + LcsServiceType: + description: LCS service type. + type: integer + minimum: 0 + maximum: 127 + + LdrReference: + description: LDR Reference. + type: string + minLength: 2 + maxLength: 510 + + ReportingAmount: + description: Number of required periodic event reports. + type: integer + minimum: 1 + maximum: 8639999 + + ReportingInterval: + description: Event reporting periodic interval. + type: integer + minimum: 1 + maximum: 8639999 + + MinimumInterval: + description: Minimum interval between event reports. + type: integer + minimum: 1 + maximum: 32767 + + MaximumInterval: + description: Maximum interval between event reports. + type: integer + minimum: 1 + maximum: 86400 + + SamplingInterval: + description: Maximum time interval between consecutive evaluations by a UE of a trigger event. + type: integer + minimum: 1 + maximum: 3600 + + ReportingDuration: + description: Maximum duration of event reporting. + type: integer + minimum: 1 + maximum: 8640000 + + LinearDistance: + description: Minimum straight line distance moved by a UE to trigger a motion event report. + type: integer + minimum: 1 + maximum: 10000 + + LMFIdentification: + description: LMF identification. + type: string + + EventReportCounter: + description: Number of event reports received from the target UE. + type: integer + minimum: 1 + maximum: 8640000 + + EventReportDuration: + description: Duration of event reporting. + type: integer + minimum: 1 + maximum: 8640000 + + UePositioningCapabilities: + description: Positioning capabilities supported by the UE. A string encoding the "ProvideCapabilities-r9-IEs" IE as specified in clause 6.3 of 3GPP TS 37.355 (start from octet 1). + type: string + format: byte + +# +# ENUMS +# + ExternalClientType: + description: Indicates types of External Clients. + anyOf: + - type: string + enum: + - EMERGENCY_SERVICES + - VALUE_ADDED_SERVICES + - PLMN_OPERATOR_SERVICES + - LAWFUL_INTERCEPT_SERVICES + - PLMN_OPERATOR_BROADCAST_SERVICES + - PLMN_OPERATOR_OM + - PLMN_OPERATOR_ANONYMOUS_STATISTICS + - PLMN_OPERATOR_TARGET_MS_SERVICE_SUPPORT + - type: string + + SupportedGADShapes: + description: Indicates supported GAD shapes. + anyOf: + - type: string + enum: + - POINT + - POINT_UNCERTAINTY_CIRCLE + - POINT_UNCERTAINTY_ELLIPSE + - POLYGON + - POINT_ALTITUDE + - POINT_ALTITUDE_UNCERTAINTY + - ELLIPSOID_ARC + - LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE + - LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID + - type: string + + ResponseTime: + description: Indicates acceptable delay of location request. + anyOf: + - type: string + enum: + - LOW_DELAY + - DELAY_TOLERANT + - NO_DELAY + - type: string + + PositioningMethod: + description: Indicates supported positioning methods. + anyOf: + - type: string + enum: + - CELLID + - ECID + - OTDOA + - BAROMETRIC_PRESSURE + - WLAN + - BLUETOOTH + - MBS + - MOTION_SENSOR + - DL_TDOA + - DL_AOD + - MULTI-RTT + - NR_ECID + - UL_TDOA + - UL_AOA + - NETWORK_SPECIFIC + - type: string + + PositioningMode: + description: Indicates supported modes used for positioning method. + anyOf: + - type: string + enum: + - UE_BASED + - UE_ASSISTED + - CONVENTIONAL + - type: string + + GnssId: + description: Global Navigation Satellite System (GNSS) ID. + anyOf: + - type: string + enum: + - GPS + - GALILEO + - SBAS + - MODERNIZED_GPS + - QZSS + - GLONASS + - BDS + - NAVIC + - type: string + + Usage: + description: Indicates usage made of the location measurement. + anyOf: + - type: string + enum: + - UNSUCCESS + - SUCCESS_RESULTS_NOT_USED + - SUCCESS_RESULTS_USED_TO_VERIFY_LOCATION + - SUCCESS_RESULTS_USED_TO_GENERATE_LOCATION + - SUCCESS_METHOD_NOT_DETERMINED + - type: string + + LcsPriority: + description: Indicates priority of the LCS client. + anyOf: + - type: string + enum: + - HIGHEST_PRIORITY + - NORMAL_PRIORITY + - type: string + + VelocityRequested: + description: Indicates velocity requirement. + anyOf: + - type: string + enum: + - VELOCITY_IS_NOT_REQUESTED + - VELOCITY_IS_REQUESTED + - type: string + + AccuracyFulfilmentIndicator: + description: Indicates fulfilment of requested accuracy. + anyOf: + - type: string + enum: + - REQUESTED_ACCURACY_FULFILLED + - REQUESTED_ACCURACY_NOT_FULFILLED + - type: string + + VerticalDirection: + description: Indicates direction of vertical speed. + type: string + enum: + - UPWARD + - DOWNWARD + + LdrType: + description: Indicates LDR types. + anyOf: + - type: string + enum: + - UE_AVAILABLE + - PERIODIC + - ENTERING_INTO_AREA + - LEAVING_FROM_AREA + - BEING_INSIDE_AREA + - MOTION + - type: string + + ReportingAreaType: + description: Indicates type of event reporting area. + anyOf: + - type: string + enum: + - EPS_TRACKING_AREA_IDENTITY + - E-UTRAN_CELL_GLOBAL_IDENTIFICATION + - 5GS_TRACKING_AREA_IDENTITY + - NR_CELL_GLOBAL_IDENTITY + - type: string + + OccurrenceInfo: + description: Specifies occurrence of event reporting. + anyOf: + - type: string + enum: + - ONE_TIME_EVENT + - MULTIPLE_TIME_EVENT + - type: string + + ReportingAccessType: + description: Specifies access types of event reporting. + anyOf: + - type: string + enum: + - NR + - EUTRA_CONNECTED_TO_5GC + - NON_3GPP_CONNECTED_TO_5GC + - NR_LEO + - NR_MEO + - NR_GEO + - NR_OTHER_SAT + - type: string + + EventClass: + description: Specifies event classes. + anyOf: + - type: string + enum: + - SUPPLEMENTARY_SERVICES + - type: string + + ReportedEventType: + description: Specifies type of event reporting. + anyOf: + - type: string + enum: + - PERIODIC_EVENT + - ENTERING_AREA_EVENT + - LEAVING_AREA_EVENT + - BEING_INSIDE_AREA_EVENT + - MOTION_EVENT + - MAXIMUM_INTERVAL_EXPIRATION_EVENT + - LOCATION_CANCELLATION_EVENT + - type: string + + TerminationCause: + description: Specifies causes of event reporting termination. + anyOf: + - type: string + enum: + - TERMINATION_BY_UE + - TERMINATION_BY_NETWORK + - NORMAL_TERMINATION + - type: string + + LcsQosClass: + description: Specifies LCS QoS class. + anyOf: + - type: string + enum: + - BEST_EFFORT + - ASSURED + - MULTIPLE_QOS + - type: string + + UeLocationServiceInd: + description: Specifies location service types requested by UE. + anyOf: + - type: string + enum: + - LOCATION_ESTIMATE + - LOCATION_ASSISTANCE_DATA + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_JOSEProtectedMessageForwarding.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_JOSEProtectedMessageForwarding.yaml new file mode 100644 index 000000000..56a59b3ae --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_JOSEProtectedMessageForwarding.yaml @@ -0,0 +1,312 @@ +openapi: 3.0.0 + +info: + version: '1.2.1' + title: 'JOSE Protected Message Forwarding API' + description: | + N32-f Message Forwarding Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +servers: + - url: '{apiRoot}/n32f-forward/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. +externalDocs: + description: 3GPP TS 29.573 V17.6.0; 5G System; Public Land Mobile Network (PLMN) Interconnection; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.573/ + +paths: + /n32f-process: + post: + summary: N32-f Message Forwarding + tags: + - N32-f Forward + operationId: PostN32fProcess + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: 3gpp-Sbi-Message-Priority + in: header + description: 3gpp-Sbi-Message-Priority, defined in 3GPP TS 29.500 + schema: + type: string + requestBody: + description: Custom operation N32-f Message Forwarding + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/N32fReformattedReqMsg' + responses: + '200': + description: OK (Successful forwarding of reformatted message over N32-f) + content: + application/json: + schema: + $ref: '#/components/schemas/N32fReformattedRspMsg' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + 3gpp-Sbi-Message-Priority: + description: 3gpp-Sbi-Message-Priority, defined in 3GPP TS 29.500 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + options: + summary: Discover communication options supported by next hop (IPX or SEPP) + operationId: N32fProcessOptions + tags: + - N32-f Forward + responses: + '204': + description: No Content + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + FlatJweJson: + description: Contains the integrity protected reformatted block + type: object + required: + - ciphertext + properties: + protected: + type: string + unprotected: + type: object + header: + type: object + encrypted_key: + type: string +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + aad: + type: string + iv: + type: string + ciphertext: + type: string + tag: + type: string + + FlatJwsJson: + description: Contains the modification from IPXes on path + type: object + required: + - payload + - signature + properties: + payload: + type: string + protected: + type: string + header: + type: object + signature: + type: string + + N32fReformattedReqMsg: + description: Contains the reformatted HTTP/2 request message + type: object + required: + - reformattedData + properties: + reformattedData: + $ref: '#/components/schemas/FlatJweJson' + modificationsBlock: + type: array + items: + $ref: '#/components/schemas/FlatJwsJson' + minItems: 1 + + N32fReformattedRspMsg: + description: Contains the reformatted HTTP/2 response message + type: object + required: + - reformattedData + properties: + reformattedData: + $ref: '#/components/schemas/FlatJweJson' + modificationsBlock: + type: array + items: + $ref: '#/components/schemas/FlatJwsJson' + minItems: 1 + + DataToIntegrityProtectAndCipherBlock: + description: HTTP header to be encrypted or the value of a JSON attribute to be encrypted + type: object + required: + - dataToEncrypt + properties: + dataToEncrypt: + type: array + items: {} + minItems: 1 + DataToIntegrityProtectBlock: + description: Data to be integrity protected + type: object + properties: + metaData: + $ref: '#/components/schemas/MetaData' + requestLine: + $ref: '#/components/schemas/RequestLine' + statusLine: + type: string + headers: + type: array + items: + $ref: '#/components/schemas/HttpHeader' + minItems: 1 + payload: + type: array + items: + $ref: '#/components/schemas/HttpPayload' + minItems: 1 + RequestLine: + description: Contains the request line of the HTTP API request being reformatted and forwarded over N32-f + type: object + required: + - method + - scheme + - authority + - path + - protocolVersion + properties: + method: + $ref: 'TS29573_N32_Handshake.yaml#/components/schemas/HttpMethod' + scheme: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriScheme' + authority: + type: string + path: + type: string + protocolVersion: + type: string + queryFragment: + type: string + HttpHeader: + description: Contains the encoding of HTTP headers in the API request / response + type: object + required: + - header + - value + properties: + header: + type: string + value: + $ref: '#/components/schemas/EncodedHttpHeaderValue' + HttpPayload: + description: Contains the encoding of JSON payload in the API request / response + type: object + required: + - iePath + - ieValueLocation + - value + properties: + iePath: + type: string + ieValueLocation: + $ref: 'TS29573_N32_Handshake.yaml#/components/schemas/IeLocation' + value: + type: object + MetaData: + description: Contains the meta data information needed for replay protection + type: object + required: + - n32fContextId + - messageId + - authorizedIpxId + properties: + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + messageId: + type: string + authorizedIpxId: + type: string + Modifications: + description: Information on inserting of the modifications entry + type: object + required: + - identity + properties: + identity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + operations: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + tag: + type: string + IndexToEncryptedValue: + description: Index to the encrypted value + type: object + required: + - encBlockIndex + properties: + encBlockIndex: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + EncodedHttpHeaderValue: + description: HTTP header value or index to the HTTP header value + oneOf: + - type: string + - $ref: '#/components/schemas/IndexToEncryptedValue' \ No newline at end of file diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_N32_Handshake.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_N32_Handshake.yaml new file mode 100644 index 000000000..73bb7f469 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_N32_Handshake.yaml @@ -0,0 +1,546 @@ +openapi: 3.0.0 + +info: + version: '1.2.1' + title: 'N32 Handshake API' + description: | + N32-c Handshake Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +servers: + - url: '{apiRoot}/n32c-handshake/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. +externalDocs: + description: 3GPP TS 29.573 V17.6.0; 5G System; Public Land Mobile Network (PLMN) Interconnection; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.573/ + +paths: + /exchange-capability: + post: + summary: Security Capability Negotiation + tags: + - Security Capability Negotiation + operationId: PostExchangeCapability + requestBody: + description: Custom operation for security capability negotiation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SecNegotiateReqData' + responses: + '200': + description: OK (Successful negitiation of security capabilities) + content: + application/json: + schema: + $ref: '#/components/schemas/SecNegotiateRspData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /exchange-params: + post: + summary: Parameter Exchange + tags: + - Parameter Exchange + operationId: PostExchangeParams + requestBody: + description: Custom operation for parameter exchange + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SecParamExchReqData' + responses: + '200': + description: OK (Successful exchange of parameters) + content: + application/json: + schema: + $ref: '#/components/schemas/SecParamExchRspData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /n32f-terminate: + post: + summary: N32-f Context Terminate + tags: + - N32-f Context Terminate + operationId: PostN32fTerminate + requestBody: + description: Custom operation for n32-f context termination + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/N32fContextInfo' + responses: + '200': + description: OK (Successful exchange of parameters) + content: + application/json: + schema: + $ref: '#/components/schemas/N32fContextInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /n32f-error: + post: + summary: N32-f Error Reporting Procedure + tags: + - N32-f Error Report + operationId: PostN32fError + requestBody: + description: Custom operation for n32-f error reporting procedure + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/N32fErrorInfo' + responses: + '204': + description: successful error reporting + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error +components: + schemas: + SecurityCapability: + description: Enumeration of security capabilities + anyOf: + - type: string + enum: + - TLS + - PRINS + - NONE + - type: string + ApiSignature: + description: API URI of the service operation + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + - $ref: '#/components/schemas/CallbackName' + HttpMethod: + description: Enumeration of HTTP methods + anyOf: + - type: string + enum: + - GET + - PUT + - POST + - DELETE + - PATCH + - HEAD + - OPTIONS + - CONNECT + - TRACE + - type: string + + IeType: + description: Enumeration of types of IEs (i.e kind of IE) to specify the protection policy + anyOf: + - type: string + enum: + - UEID + - LOCATION + - KEY_MATERIAL + - AUTHENTICATION_MATERIAL + - AUTHORIZATION_TOKEN + - OTHER + - NONSENSITIVE + - type: string + + IeLocation: + description: Location of the IE in a HTTP message + anyOf: + - type: string + enum: + - URI_PARAM + - HEADER + - BODY + - MULTIPART_BINARY + - type: string + + IeInfo: + description: Protection and modification policy for the IE + type: object + required: + - ieLoc + - ieType + properties: + ieLoc: + $ref: '#/components/schemas/IeLocation' + ieType: + $ref: '#/components/schemas/IeType' + reqIe: + type: string + rspIe: + type: string + isModifiable: + type: boolean + isModifiableByIpx: + type: object + additionalProperties: + type: boolean + minProperties: 1 + + ApiIeMapping: + description: API URI to IE mapping on which the protection policy needs to be applied + type: object + required: + - apiSignature + - apiMethod + - IeList + properties: + apiSignature: + $ref: '#/components/schemas/ApiSignature' + apiMethod: + $ref: '#/components/schemas/HttpMethod' + IeList: + type: array + items: + $ref: '#/components/schemas/IeInfo' + minItems: 1 +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + + ProtectionPolicy: + description: The protection policy to be negotiated between the SEPPs + type: object + required: + - apiIeMappingList + properties: + apiIeMappingList: + type: array + items: + $ref: '#/components/schemas/ApiIeMapping' + minItems: 1 + dataTypeEncPolicy: + type: array + items: + $ref: '#/components/schemas/IeType' + minItems: 1 + + SecNegotiateReqData: + description: Defines the security capabilities of a SEPP sent to a receiving SEPP + type: object + required: + - sender + - supportedSecCapabilityList + properties: + sender: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + supportedSecCapabilityList: + type: array + items: + $ref: '#/components/schemas/SecurityCapability' + minItems: 1 + 3GppSbiTargetApiRootSupported: + type: boolean + default: false +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + plmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + snpnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + targetPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + targetSnpnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + intendedUsagePurpose: + type: array + items: + $ref: '#/components/schemas/IntendedN32Purpose' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + SecNegotiateRspData: + description: Defines the selected security capabilities by a SEPP + type: object + required: + - sender + - selectedSecCapability + properties: + sender: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + selectedSecCapability: + $ref: '#/components/schemas/SecurityCapability' + 3GppSbiTargetApiRootSupported: + type: boolean + default: false +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + plmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + snpnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + allowedUsagePurpose: + type: array + items: + $ref: '#/components/schemas/IntendedN32Purpose' + minItems: 1 + rejectedUsagePurpose: + type: array + items: + $ref: '#/components/schemas/IntendedN32Purpose' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + SecParamExchReqData: + description: Request data structure for parameter exchange + type: object + required: + - n32fContextId + properties: + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + jweCipherSuiteList: + type: array + items: + type: string + minItems: 1 + jwsCipherSuiteList: + type: array + items: + type: string + minItems: 1 + protectionPolicyInfo: + $ref: '#/components/schemas/ProtectionPolicy' + ipxProviderSecInfoList: + type: array + items: + $ref: '#/components/schemas/IpxProviderSecInfo' + minItems: 1 + sender: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + SecParamExchRspData: + description: Response data structure for parameter exchange + type: object + required: + - n32fContextId + properties: + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + selectedJweCipherSuite: + type: string + selectedJwsCipherSuite: + type: string + selProtectionPolicyInfo: + $ref: '#/components/schemas/ProtectionPolicy' + ipxProviderSecInfoList: + type: array + items: + $ref: '#/components/schemas/IpxProviderSecInfo' + minItems: 1 + sender: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + N32fContextInfo: + description: N32-f context information + type: object + required: + - n32fContextId + properties: + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + CallbackName: + description: Callback Name + type: object + required: + - callbackType + properties: + callbackType: + type: string + N32fErrorInfo: + description: N32-f error information + type: object + required: + - n32fMessageId + - n32fErrorType + properties: + n32fMessageId: + type: string + n32fErrorType: + $ref: '#/components/schemas/N32fErrorType' + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + failedModificationList: + type: array + items: + $ref: '#/components/schemas/FailedModificationInfo' + minItems: 1 + errorDetailsList: + type: array + items: + $ref: '#/components/schemas/N32fErrorDetail' + minItems: 1 + FailedModificationInfo: + description: Information on N32-f modifications block that failed to process + type: object + required: + - ipxId + - n32fErrorType + properties: + ipxId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + n32fErrorType: + $ref: '#/components/schemas/N32fErrorType' + N32fErrorDetail: + description: Details about the N32f error + type: object + required: + - attribute + - msgReconstructFailReason + properties: + attribute: + type: string + msgReconstructFailReason: + $ref: '#/components/schemas/FailureReason' + IpxProviderSecInfo: + description: Defines the security information list of an IPX + type: object + required: + - ipxProviderId + properties: + ipxProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + rawPublicKeyList: + type: array + items: + type: string + minItems: 1 + certificateList: + type: array + items: + type: string + minItems: 1 + + IntendedN32Purpose: + description: Indicates the intended N32 establishment purpose + type: object + required: + - usagePurpose + properties: + usagePurpose: + $ref: '#/components/schemas/N32Purpose' + additionalInfo: + type: string + cause: + type: string + + N32fErrorType: + description: Type of error while processing N32-f message + anyOf: + - type: string + enum: + - INTEGRITY_CHECK_FAILED + - INTEGRITY_CHECK_ON_MODIFICATIONS_FAILED + - MODIFICATIONS_INSTRUCTIONS_FAILED + - DECIPHERING_FAILED + - MESSAGE_RECONSTRUCTION_FAILED + - CONTEXT_NOT_FOUND + - INTEGRITY_KEY_EXPIRED + - ENCRYPTION_KEY_EXPIRED + - POLICY_MISMATCH + - type: string + FailureReason: + description: Reason for failure to reconstruct a HTTP/2 message from N32-f message + anyOf: + - type: string + enum: + - INVALID_JSON_POINTER + - INVALID_INDEX_TO_ENCRYPTED_BLOCK + - INVALID_HTTP_HEADER + - type: string + + N32Purpose: + description: Usage purpose of establishing N32 connectivity + anyOf: + - type: string + enum: + - ROAMING + - INTER_PLMN_MOBILITY + - SMS_INTERCONNECT + - ROAMING_TEST + - INTER_PLMN_MOBILITY_TEST + - SMS_INTERCONNECT_TEST + - SNPN_INTERCONNECT + - SNPN_INTERCONNECT_TEST + - DISASTER_ROAMING + - DISASTER_ROAMING_TEST + - type: string \ No newline at end of file diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_SeppTelescopicFqdnMapping.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_SeppTelescopicFqdnMapping.yaml new file mode 100644 index 000000000..eb32e2d51 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS29573_SeppTelescopicFqdnMapping.yaml @@ -0,0 +1,65 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'SEPP Telescopic FQDN Mapping API' + description: | + SEPP Telescopic FQDN Mapping Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +servers: + - url: '{apiRoot}/nsepp-telescopic/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +externalDocs: + description: 3GPP TS 29.573 V17.5.0; 5G System; Public Land Mobile Network (PLMN) Interconnection; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.573/ + +paths: + /mapping: + get: + summary: Maps an FQDN to/from a telescopic FQDN + operationId: GetTelescopicMapping + tags: + - Telescopic Mapping (Document) + parameters: + - name: foreign-fqdn + in: query + description: FQDN of the NF in the foreign PLMN + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: telescopic-label + in: query + description: Telescopic Label + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/TelescopicMapping' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + TelescopicMapping: + description: Contains the Telescopic mapping data + type: object + properties: + telescopicLabel: + type: string + seppDomain: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + foreignFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS32291_Nchf_ConvergedCharging.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS32291_Nchf_ConvergedCharging.yaml new file mode 100644 index 000000000..2ceb5e846 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS32291_Nchf_ConvergedCharging.yaml @@ -0,0 +1,2567 @@ +openapi: 3.0.0 +info: + title: Nchf_ConvergedCharging + version: 3.1.12 + description: | + ConvergedCharging Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 32.291 V17.45.0: Telecommunication management; Charging management; + 5G system, charging service; Stage 3. + url: 'http://www.3gpp.org/ftp/Specs/archive/32_series/32.291/' +servers: + - url: '{apiRoot}/nchf-convergedcharging/v3' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501. +security: + - {} + - oAuth2ClientCredentials: + - nchf-convergedcharging +paths: + /chargingdata: + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataResponse' + '400': + description: Bad request + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '404': + description: Not Found + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '408': + $ref: 'TS29571_CommonData.yaml#/components/responses/408' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + chargingNotification: + '{$request.body#/notifyUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingNotifyRequest' + responses: + '200': + description: OK. + content: + application/ json: + schema: + $ref: '#/components/schemas/ChargingNotifyResponse' + '204': + description: 'No Content, Notification was succesfull' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad request + content: + application/problem+json: + schema: + oneOf: + - $ref: TS29571_CommonData.yaml#/components/schemas/ProblemDetails + - $ref: '#/components/schemas/ChargingNotifyResponse' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + '/chargingdata/{ChargingDataRef}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + parameters: + - name: ChargingDataRef + in: path + description: a unique identifier for a charging data resource in a PLMN + required: true + schema: + type: string + responses: + '200': + description: OK. Updated Charging Data resource is returned + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad request + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '404': + description: Not Found + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '408': + $ref: 'TS29571_CommonData.yaml#/components/responses/408' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + '/chargingdata/{ChargingDataRef}/release': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + parameters: + - name: ChargingDataRef + in: path + description: a unique identifier for a charging data resource in a PLMN + required: true + schema: + type: string + responses: + '204': + description: No Content. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '404': + description: Not Found + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nchf-convergedcharging: Access to the Nchf_ConvergedCharging API + schemas: + ChargingDataRequest: + type: object + properties: + subscriberIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + tenantIdentifier: + type: string + chargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + mnSConsumerIdentifier: + type: string + nfConsumerIdentification: + $ref: '#/components/schemas/NFIdentification' + invocationTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + invocationSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + retransmissionIndicator: + type: boolean + oneTimeEvent: + type: boolean + oneTimeEventType: + $ref: '#/components/schemas/oneTimeEventType' + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + serviceSpecificationInfo: + type: string + multipleUnitUsage: + type: array + items: + $ref: '#/components/schemas/MultipleUnitUsage' + minItems: 0 + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + easid: + type: string + ednid: + type: string + eASProviderIdentifier: + type: string + pDUSessionChargingInformation: + $ref: '#/components/schemas/PDUSessionChargingInformation' + roamingQBCInformation: + $ref: '#/components/schemas/RoamingQBCInformation' + sMSChargingInformation: + $ref: '#/components/schemas/SMSChargingInformation' + nEFChargingInformation: + $ref: '#/components/schemas/NEFChargingInformation' + registrationChargingInformation: + $ref: '#/components/schemas/RegistrationChargingInformation' + n2ConnectionChargingInformation: + $ref: '#/components/schemas/N2ConnectionChargingInformation' + locationReportingChargingInformation: + $ref: '#/components/schemas/LocationReportingChargingInformation' + nSPAChargingInformation: + $ref: '#/components/schemas/NSPAChargingInformation' + nSMChargingInformation: + $ref: '#/components/schemas/NSMChargingInformation' + mMTelChargingInformation: + $ref: '#/components/schemas/MMTelChargingInformation' + iMSChargingInformation: + $ref: '#/components/schemas/IMSChargingInformation' + edgeInfrastructureUsageChargingInformation': + $ref: '#/components/schemas/EdgeInfrastructureUsageChargingInformation' + eASDeploymentChargingInformation: + $ref: '#/components/schemas/EASDeploymentChargingInformation' + directEdgeEnablingServiceChargingInformation: + $ref: '#/components/schemas/NEFChargingInformation' + exposedEdgeEnablingServiceChargingInformation: + $ref: '#/components/schemas/NEFChargingInformation' + proSeChargingInformation: + $ref: '#/components/schemas/ProseChargingInformation' + required: + - nfConsumerIdentification + - invocationTimeStamp + - invocationSequenceNumber + ChargingDataResponse: + type: object + properties: + invocationTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + invocationSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + invocationResult: + $ref: '#/components/schemas/InvocationResult' + sessionFailover: + $ref: '#/components/schemas/SessionFailover' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + multipleUnitInformation: + type: array + items: + $ref: '#/components/schemas/MultipleUnitInformation' + minItems: 0 + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + pDUSessionChargingInformation: + $ref: '#/components/schemas/PDUSessionChargingInformation' + roamingQBCInformation: + $ref: '#/components/schemas/RoamingQBCInformation' + locationReportingChargingInformation: + $ref: '#/components/schemas/LocationReportingChargingInformation' + required: + - invocationTimeStamp + - invocationSequenceNumber + ChargingNotifyRequest: + type: object + properties: + notificationType: + $ref: '#/components/schemas/NotificationType' + reauthorizationDetails: + type: array + items: + $ref: '#/components/schemas/ReauthorizationDetails' + minItems: 0 + required: + - notificationType + ChargingNotifyResponse: + type: object + properties: + invocationResult: + $ref: '#/components/schemas/InvocationResult' + NFIdentification: + type: object + properties: + nFName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nFIPv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + nFIPv6Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + nFPLMNID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nodeFunctionality: + $ref: '#/components/schemas/NodeFunctionality' + nFFqdn: + type: string + required: + - nodeFunctionality + MultipleUnitUsage: + type: object + properties: + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + requestedUnit: + $ref: '#/components/schemas/RequestedUnit' + usedUnitContainer: + type: array + items: + $ref: '#/components/schemas/UsedUnitContainer' + minItems: 0 + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + multihomedPDUAddress: + $ref: '#/components/schemas/PDUAddress' + required: + - ratingGroup + InvocationResult: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + failureHandling: + $ref: '#/components/schemas/FailureHandling' + Trigger: + type: object + properties: + triggerType: + $ref: '#/components/schemas/TriggerType' + triggerCategory: + $ref: '#/components/schemas/TriggerCategory' + timeLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + volumeLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + volumeLimit64: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + eventLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + maxNumberOfccc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + tariffTimeChange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - triggerType + - triggerCategory + MultipleUnitInformation: + type: object + properties: + resultCode: + $ref: '#/components/schemas/ResultCode' + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + grantedUnit: + $ref: '#/components/schemas/GrantedUnit' + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + quotaHoldingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + finalUnitIndication: + $ref: '#/components/schemas/FinalUnitIndication' + timeQuotaThreshold: + type: integer + volumeQuotaThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + unitQuotaThreshold: + type: integer + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + announcementInformation: + $ref: '#/components/schemas/AnnouncementInformation' + required: + - ratingGroup + RequestedUnit: + type: object + properties: + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + serviceSpecificUnits: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + UsedUnitContainer: + type: object + properties: + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + quotaManagementIndicator: + $ref: '#/components/schemas/QuotaManagementIndicator' + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + triggerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + serviceSpecificUnits: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + eventTimeStamps: + + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minItems: 0 + localSequenceNumber: + type: integer + pDUContainerInformation: + $ref: '#/components/schemas/PDUContainerInformation' + nSPAContainerInformation: + $ref: '#/components/schemas/NSPAContainerInformation' + pC5ContainerInformation: + $ref: '#/components/schemas/PC5ContainerInformation' + required: + - localSequenceNumber + GrantedUnit: + type: object + properties: + tariffTimeChange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + serviceSpecificUnits: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + FinalUnitIndication: + type: object + properties: + finalUnitAction: + $ref: '#/components/schemas/FinalUnitAction' + restrictionFilterRule: + $ref: '#/components/schemas/IPFilterRule' + restrictionFilterRuleList: + type: array + items: + $ref: '#/components/schemas/IPFilterRule' + minItems: 1 + filterId: + type: string + filterIdList: + type: array + items: + type: string + minItems: 1 + redirectServer: + $ref: '#/components/schemas/RedirectServer' + required: + - finalUnitAction + RedirectServer: + type: object + properties: + redirectAddressType: + $ref: '#/components/schemas/RedirectAddressType' + redirectServerAddress: + type: string + required: + - redirectAddressType + - redirectServerAddress + ReauthorizationDetails: + type: object + properties: + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + quotaManagementIndicator: + $ref: '#/components/schemas/QuotaManagementIndicator' + PDUSessionChargingInformation: + type: object + properties: + chargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + sMFchargingId: + type: string + homeProvidedChargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + sMFHomeProvidedChargingId: + type: string + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + mAPDUNon3GPPUserLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + non3GPPUserLocationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mAPDUNon3GPPUserLocationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + pduSessionInformation: + $ref: '#/components/schemas/PDUSessionInformation' + unitCountInactivityTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + rANSecondaryRATUsageReport: + $ref: '#/components/schemas/RANSecondaryRATUsageReport' + UserInformation: + type: object + properties: + servedGPSI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + servedPEI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + unauthenticatedFlag: + type: boolean + roamerInOut: + $ref: '#/components/schemas/RoamerInOut' + PDUSessionInformation: + type: object + properties: + networkSlicingInfo: + $ref: '#/components/schemas/NetworkSlicingInfo' + pduSessionID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + hPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + servingNetworkFunctionID: + $ref: '#/components/schemas/ServingNetworkFunctionID' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + mAPDUNon3GPPRATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + dnnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnnSelectionMode: + $ref: '#/components/schemas/dnnSelectionMode' + chargingCharacteristics: + type: string + pattern: '^[0-9a-fA-F]{1,4}$' + chargingCharacteristicsSelectionMode: + $ref: '#/components/schemas/ChargingCharacteristicsSelectionMode' + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stopTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + sessionStopIndicator: + type: boolean + pduAddress: + $ref: '#/components/schemas/PDUAddress' + diagnostics: + $ref: '#/components/schemas/Diagnostics' + authorizedQoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AuthorizedDefaultQos' + subscribedQoSInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + authorizedSessionAMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + subscribedSessionAMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + servingCNPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + mAPDUSessionInformation: + $ref: '#/components/schemas/MAPDUSessionInformation' + enhancedDiagnostics: + $ref: '#/components/schemas/EnhancedDiagnostics5G' + redundantTransmissionType: + $ref: '#/components/schemas/RedundantTransmissionType' + pDUSessionPairID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + cpCIoTOptimisationIndicator: + type: boolean + 5GSControlPlaneOnlyIndicator: + type: boolean + smallDataRateControlIndicator: + type: boolean + 5GLANTypeService: + $ref: '#/components/schemas/5GLANTypeService' + required: + - pduSessionID + - dnnId + PDUContainerInformation: + type: object + properties: + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + afChargingIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + afChargingIdString: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationChargingId' + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servingNodeID: + type: array + items: + $ref: '#/components/schemas/ServingNetworkFunctionID' + minItems: 0 + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + sponsorIdentity: + type: string + applicationserviceProviderIdentity: + type: string + chargingRuleBaseName: + type: string + mAPDUSteeringFunctionality: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/SteeringFunctionality' + mAPDUSteeringMode: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/SteeringMode' + trafficForwardingWay: + $ref: '#/components/schemas/TrafficForwardingWay' + qosMonitoringReport: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 0 + NSPAContainerInformation: + type: object + properties: + latency: + type: integer + throughput: + $ref: '#/components/schemas/Throughput' + maximumPacketLossRate: + type: string + serviceExperienceStatisticsData: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ServiceExperienceInfo' + theNumberOfPDUSessions: + type: integer + theNumberOfRegisteredSubscribers: + type: integer + loadLevel: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiLoadLevelInfo' + NSPAChargingInformation: + type: object + properties: + singleNSSAI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - singleNSSAI + NetworkSlicingInfo: + type: object + properties: + sNSSAI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - sNSSAI + PDUAddress: + type: object + properties: + pduIPv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + pduIPv6AddresswithPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + pduAddressprefixlength: + type: integer + iPv4dynamicAddressFlag: + type: boolean + iPv6dynamicPrefixFlag: + type: boolean + addIpv6AddrPrefixes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addIpv6AddrPrefixList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ServingNetworkFunctionID: + type: object + properties: + servingNetworkFunctionInformation: + $ref: '#/components/schemas/NFIdentification' + aMFId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfId' + required: + - servingNetworkFunctionInformation + RoamingQBCInformation: + type: object + properties: + multipleQFIcontainer: + type: array + items: + $ref: '#/components/schemas/MultipleQFIcontainer' + minItems: 0 + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + roamingChargingProfile: + $ref: '#/components/schemas/RoamingChargingProfile' + MultipleQFIcontainer: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + triggerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + localSequenceNumber: + type: integer + qFIContainerInformation: + $ref: '#/components/schemas/QFIContainerInformation' + required: + - localSequenceNumber + QFIContainerInformation: + type: object + properties: + qFI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + reportTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servingNetworkFunctionID: + type: array + items: + $ref: '#/components/schemas/ServingNetworkFunctionID' + minItems: 0 + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + 3gppChargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + diagnostics: + $ref: '#/components/schemas/Diagnostics' + enhancedDiagnostics: + type: array + items: + type: string + required: + - reportTime + RoamingChargingProfile: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + partialRecordMethod: + $ref: '#/components/schemas/PartialRecordMethod' + SMSChargingInformation: + type: object + properties: + originatorInfo: + $ref: '#/components/schemas/OriginatorInfo' + recipientInfo: + type: array + items: + $ref: '#/components/schemas/RecipientInfo' + minItems: 0 + userEquipmentInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + roamerInOut: + $ref: '#/components/schemas/RoamerInOut' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + sMSCAddress: + type: string + sMDataCodingScheme: + type: integer + sMMessageType: + $ref: '#/components/schemas/SMMessageType' + sMReplyPathRequested: + $ref: '#/components/schemas/ReplyPathRequested' + sMUserDataHeader: + type: string + sMStatus: + type: string + pattern: '^[0-7]?[0-9a-fA-F]$' + sMDischargeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + numberofMessagesSent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + sMServiceType: + $ref: '#/components/schemas/SMServiceType' + sMSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + sMSresult: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + submissionTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sMPriority: + $ref: '#/components/schemas/SMPriority' + messageReference: + type: string + messageSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + messageClass: + $ref: '#/components/schemas/MessageClass' + deliveryReportRequested: + $ref: '#/components/schemas/DeliveryReportRequested' + OriginatorInfo: + type: object + properties: + originatorSUPI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + originatorGPSI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + originatorOtherAddress: + $ref: '#/components/schemas/SMAddressInfo' + originatorReceivedAddress: + $ref: '#/components/schemas/SMAddressInfo' + originatorSCCPAddress: + type: string + sMOriginatorInterface: + $ref: '#/components/schemas/SMInterface' + sMOriginatorProtocolId: + type: string + RecipientInfo: + type: object + properties: + recipientSUPI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + recipientGPSI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + recipientOtherAddress: + $ref: '#/components/schemas/SMAddressInfo' + recipientReceivedAddress: + $ref: '#/components/schemas/SMAddressInfo' + recipientSCCPAddress: + type: string + sMDestinationInterface: + $ref: '#/components/schemas/SMInterface' + sMrecipientProtocolId: + type: string + SMAddressInfo: + type: object + properties: + sMaddressType: + $ref: '#/components/schemas/SMAddressType' + sMaddressData: + type: string + sMaddressDomain: + $ref: '#/components/schemas/SMAddressDomain' + RecipientAddress: + type: object + properties: + recipientAddressInfo: + $ref: '#/components/schemas/SMAddressInfo' + sMaddresseeType: + $ref: '#/components/schemas/SMAddresseeType' + MessageClass: + type: object + properties: + classIdentifier: + $ref: '#/components/schemas/ClassIdentifier' + tokenText: + type: string + SMAddressDomain: + type: object + properties: + domainName: + type: string + 3GPPIMSIMCCMNC: + type: string + SMInterface: + type: object + properties: + interfaceId: + type: string + interfaceText: + type: string + interfacePort: + type: string + interfaceType: + $ref: '#/components/schemas/InterfaceType' + RANSecondaryRATUsageReport: + type: object + properties: + rANSecondaryRATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + qosFlowsUsageReports: + type: array + items: + $ref: '#/components/schemas/QosFlowsUsageReport' + Diagnostics: + type: integer + IPFilterRule: + type: string + QosFlowsUsageReport: + type: object + properties: + qFI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + startTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + 5GLANTypeService: + type: object + properties: + internalGroupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + NEFChargingInformation: + type: object + properties: + externalIndividualIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + externalGroupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExternalGroupId' + groupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + aPIDirection: + $ref: '#/components/schemas/APIDirection' + aPITargetNetworkFunction: + $ref: '#/components/schemas/NFIdentification' + aPIResultCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + aPIName: + type: string + aPIReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + aPIContent: + type: string + required: + - aPIName + RegistrationChargingInformation: + type: object + properties: + registrationMessagetype: + $ref: '#/components/schemas/RegistrationMessageType' + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + pSCellInformation: + $ref: '#/components/schemas/PSCellInformation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + 5GMMCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + mICOModeIndication: + $ref: '#/components/schemas/MICOModeIndication' + smsIndication: + $ref: '#/components/schemas/SmsIndication' + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 0 + serviceAreaRestriction: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + minItems: 0 + requestedNSSAI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 + allowedNSSAI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 + rejectedNSSAI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 + nSSAIMapList: + type: array + items: + $ref: '#/components/schemas/NSSAIMap' + minItems: 0 + amfUeNgapId: + type: integer + ranUeNgapId: + type: integer + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + required: + - registrationMessagetype + PSCellInformation: + type: object + properties: + nrcgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + NSSAIMap: + type: object + properties: + servingSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + homeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - servingSnssai + - homeSnssai + N2ConnectionChargingInformation: + type: object + properties: + n2ConnectionMessageType: + $ref: '#/components/schemas/N2ConnectionMessageType' + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + pSCellInformation: + $ref: '#/components/schemas/PSCellInformation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + amfUeNgapId: + type: integer + ranUeNgapId: + type: integer + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + restrictedRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 0 + forbiddenAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + minItems: 0 + serviceAreaRestriction: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + minItems: 0 + restrictedCnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + minItems: 0 + allowedNSSAI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 + rrcEstCause: + type: string + pattern: '^[0-9a-fA-F]+$' + required: + - n2ConnectionMessageType + LocationReportingChargingInformation: + type: object + properties: + locationReportingMessageType: + $ref: '#/components/schemas/LocationReportingMessageType' + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + pSCellInformation: + $ref: '#/components/schemas/PSCellInformation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + required: + - locationReportingMessageType + N2ConnectionMessageType: + type: integer + LocationReportingMessageType: + type: integer + NSMChargingInformation: + type: object + properties: + managementOperation: + $ref: '#/components/schemas/ManagementOperation' + idNetworkSliceInstance: + type: string + listOfserviceProfileChargingInformation: + type: array + items: + $ref: '#/components/schemas/ServiceProfileChargingInformation' + minItems: 0 + managementOperationStatus: + $ref: '#/components/schemas/ManagementOperationStatus' +# To be introduced once the reference to 'generic.yaml is resolved +# managementOperationalState: +# $ref: 'genericNrm.yaml#/components/schemas/OperationalState' +# managementAdministrativeState: +# $ref: 'genericNrm.yaml#/components/schemas/AdministrativeState' + required: + - managementOperation + ServiceProfileChargingInformation: + type: object + properties: + serviceProfileIdentifier: + type: string + sNSSAIList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 +# To be introduced once the reference to 'nrNrm.yaml is resolved +# sST: +# $ref: 'nrNrm.yaml#/components/schemas/Sst' + latency: + type: integer + availability: + type: number +# To be introduced once the reference to sliceNrm.yaml is resolved +# resourceSharingLevel: +# $ref: 'sliceNrm.yaml#/components/schemas/SharingLevel' + jitter: + type: integer + reliability: + type: string + maxNumberofUEs: + type: integer + coverageArea: + type: string +# To be introduced once the reference to sliceNrm.yaml is resolved +# uEMobilityLevel: +# $ref: 'sliceNrm.yaml#/components/schemas/MobilityLevel' +# delayToleranceIndicator: +# $ref: 'sliceNrm.yaml#/components/schemas/Support' + dLThptPerSlice: + $ref: '#/components/schemas/Throughput' + dLThptPerUE: + $ref: '#/components/schemas/Throughput' + uLThptPerSlice: + $ref: '#/components/schemas/Throughput' + uLThptPerUE: + $ref: '#/components/schemas/Throughput' + maxNumberofPDUsessions: + type: integer + kPIMonitoringList: + type: string + supportedAccessTechnology: + type: integer +# To be introduced once the reference to sliceNrm.yaml is resolved +# v2XCommunicationModeIndicator: +# $ref: 'sliceNrm.yaml#/components/schemas/Support' + addServiceProfileInfo: + type: string + Throughput: + type: object + properties: + guaranteedThpt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + maximumThpt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + MAPDUSessionInformation: + type: object + properties: + mAPDUSessionIndicator: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/MaPduIndication' + aTSSSCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AtsssCapability' + EnhancedDiagnostics5G: + $ref: '#/components/schemas/RanNasCauseList' + RanNasCauseList: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RanNasRelCause' + QosMonitoringReport: + description: Contains reporting information on QoS monitoring. + type: object + properties: + ulDelays: + type: array + items: + type: integer + minItems: 0 + dlDelays: + type: array + items: + type: integer + minItems: 0 + rtDelays: + type: array + items: + type: integer + minItems: 0 + AnnouncementInformation: + type: object + properties: + announcementIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + announcementReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + variableParts: + type: array + items: + $ref: '#/components/schemas/VariablePart' + minItems: 0 + timeToPlay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + quotaConsumptionIndicator: + $ref: '#/components/schemas/QuotaConsumptionIndicator' + announcementPriority: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + playToParty: + $ref: '#/components/schemas/PlayToParty' + announcementPrivacyIndicator: + $ref: '#/components/schemas/AnnouncementPrivacyIndicator' + Language: + $ref: '#/components/schemas/Language' + VariablePart: + type: object + properties: + variablePartType: + $ref: '#/components/schemas/VariablePartType' + variablePartValue: + type: array + items: + type: string + minItems: 1 + variablePartOrder: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + required: + - variablePartType + - variablePartValue + Language: + type: string + MMTelChargingInformation: + type: object + properties: + supplementaryServices: + type: array + items: + $ref: '#/components/schemas/SupplementaryService' + minItems: 1 + SupplementaryService: + type: object + properties: + supplementaryServiceType: + $ref: '#/components/schemas/SupplementaryServiceType' + supplementaryServiceMode: + $ref: '#/components/schemas/SupplementaryServiceMode' + numberOfDiversions: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + associatedPartyAddress: + type: string + conferenceId: + type: string + participantActionType: + $ref: '#/components/schemas/ParticipantActionType' + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + numberOfParticipants: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + cUGInformation: + $ref: '#/components/schemas/OctetString' + IMSChargingInformation: + type: object + properties: + eventType: + $ref: '#/components/schemas/SIPEventType' + iMSNodeFunctionality: + $ref: '#/components/schemas/IMSNodeFunctionality' + roleOfNode: + $ref: '#/components/schemas/RoleOfIMSNode' + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + isupCause: + $ref: '#/components/schemas/ISUPCause' + controlPlaneAddress: + $ref: '#/components/schemas/IMSAddress' + vlrNumber: + $ref: '#/components/schemas/E164' + mscAddress: + $ref: '#/components/schemas/E164' + userSessionID: + type: string + outgoingSessionID: + type: string + sessionPriority: + $ref: '#/components/schemas/IMSSessionPriority' + callingPartyAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + calledPartyAddress: + type: string + numberPortabilityRoutinginformation: + type: string + carrierSelectRoutingInformation: + type: string + alternateChargedPartyAddress: + type: string + requestedPartyAddress: + type: array + items: + type: string + minItems: 1 + calledAssertedIdentities: + type: array + items: + type: string + minItems: 1 + calledIdentityChanges: + type: array + items: + $ref: '#/components/schemas/CalledIdentityChange' + minItems: 1 + associatedURI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + timeStamps: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + applicationServerInformation: + type: array + items: + type: string + minItems: 1 + interOperatorIdentifier: + type: array + items: + $ref: '#/components/schemas/InterOperatorIdentifier' + minItems: 1 + imsChargingIdentifier: + type: string + relatedICID: + type: string + relatedICIDGenerationNode: + type: string + transitIOIList: + type: array + items: + type: string + minItems: 1 + earlyMediaDescription: + type: array + items: + $ref: '#/components/schemas/EarlyMediaDescription' + minItems: 1 + sdpSessionDescription: + type: array + items: + type: string + minItems: 1 + sdpMediaComponent: + type: array + items: + $ref: '#/components/schemas/SDPMediaComponent' + minItems: 1 + servedPartyIPAddress: + $ref: '#/components/schemas/IMSAddress' + serverCapabilities: + $ref: '#/components/schemas/ServerCapabilities' + trunkGroupID: + $ref: '#/components/schemas/TrunkGroupID' + bearerService: + type: string + imsServiceId: + type: string + messageBodies: + type: array + items: + $ref: '#/components/schemas/MessageBody' + minItems: 1 + accessNetworkInformation: + type: array + items: + type: string + minItems: 1 + additionalAccessNetworkInformation: + type: string + cellularNetworkInformation: + type: string + accessTransferInformation: + type: array + items: + $ref: '#/components/schemas/AccessTransferInformation' + minItems: 1 + accessNetworkInfoChange: + type: array + items: + $ref: '#/components/schemas/AccessNetworkInfoChange' + minItems: 1 + imsCommunicationServiceID: + type: string + imsApplicationReferenceID: + type: string + causeCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + reasonHeader: + type: array + items: + type: string + minItems: 1 + initialIMSChargingIdentifier: + type: string + nniInformation: + type: array + items: + $ref: '#/components/schemas/NNIInformation' + minItems: 1 + fromAddress: + type: string + imsEmergencyIndication: + type: boolean + imsVisitedNetworkIdentifier: + type: string + sipRouteHeaderReceived: + type: string + sipRouteHeaderTransmitted: + type: string + tadIdentifier: + $ref: '#/components/schemas/TADIdentifier' + feIdentifierList: + type: string + EdgeInfrastructureUsageChargingInformation: + type: object + properties: + meanVirtualCPUUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + meanVirtualMemoryUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + meanVirtualDiskUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + durationStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + durationEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + EASDeploymentChargingInformation: + type: object + properties: +# To be introduced once the reference to EdgeNrm.yaml is resolved +# eEASDeploymentRequirements: +# $ref: '#/components/schemas/EASRequirements' + lCMStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + lCMEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + PC5ContainerInformation: + type: object + properties: + coverageInfoList: + type: array + items: + $ref: '#/components/schemas/CoverageInfo' + radioParameterSetInfoList: + type: array + items: + $ref: '#/components/schemas/RadioParameterSetInfo' + transmitterInfoList: + type: array + items: + $ref: '#/components/schemas/TransmitterInfo' + minItems: 0 + timeOfFirst Transmission: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeOfFirst Reception: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + CoverageInfo: + type: object + properties: + coverageStatus: + type: boolean + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locationInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + minItems: 0 + + RadioParameterSetInfo: + type: object + properties: + radioParameterSetValues: + type: array + items: + $ref: '#/components/schemas/OctetString' + minItems: 0 + changeTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + TransmitterInfo: + type: object + properties: + proseSourceIPAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + proseSourceL2Id: + type: string + ProseChargingInformation: + type: object + properties: + announcingPlmnID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + announcingUeHplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + announcingUeVplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + monitoringUeHplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + monitoringUeVplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + discovererUeHplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + discovererUeVplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + discovereeUeHplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + discovereeUeVplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + monitoredPlmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + proseApplicationID: + type: string + ApplicationId: + type: string + applicationSpecificDataList: + type: array + items: + type: string + minItems: 0 + proseFunctionality: + $ref: '#/components/schemas/ProseFunctionality' + proseEventType: + $ref: '#/components/schemas/ProseEventType' + directDiscoveryModel: + $ref: '#/components/schemas/DirectDiscoveryModel' + validityPeriod: + type: integer + roleOfUE: + $ref: '#/components/schemas/RoleOfUE' + proseRequestTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + pC3ProtocolCause: + type: integer + monitoringUEIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestedPLMNIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + timeWindow: + type: integer + rangeClass: + $ref: '#/components/schemas/RangeClass' + proximityAlertIndication: + type: boolean + proximityAlertTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + proximityCancellationTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + relayIPAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + proseUEToNetworkRelayUEID : + type: string + proseDestinationLayer2ID: + type: string + pFIContainerInformation: + type: array + items: + $ref: '#/components/schemas/PFIContainerInformation' + minItems: 0 + transmissionDataContainer: + type: array + items: + $ref: '#/components/schemas/PC5DataContainer' + minItems: 0 + receptionDataContainer: + type: array + items: + $ref: '#/components/schemas/PC5DataContainer' + minItems: 0 + required: + - aPIName + + PFIContainerInformation: + type: object + properties: + pFI: + type: string + reportTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + + PC5DataContainer: + type: object + properties: + localSequenceNumber: + type: string + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + coverageStatus: + type: boolean + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + dataVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + changeCondition: + type: string + radioResourcesId: + $ref: '#/components/schemas/RadioResourcesId' + radioFrequency: + type: string + pC5RadioTechnology: + type: string + + OctetString: + type: string + pattern: '^[0-9a-fA-F]+$' + E164: + type: string + pattern: '^[0-9a-fA-F]+$' + IMSAddress: + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + e164: + $ref: '#/components/schemas/E164' + anyOf: + - required: [ ipv4Addr ] + - required: [ ipv6Addr ] + - required: [ e164 ] + ServingNodeAddress: + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + anyOf: + - required: [ ipv4Addr ] + - required: [ ipv6Addr ] + SIPEventType: + type: object + properties: + sIPMethod: + type: string + eventHeader: + type: string + expiresHeader: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + ISUPCause: + type: object + properties: + iSUPCauseLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + iSUPCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + iSUPCauseDiagnostics: + $ref: '#/components/schemas/OctetString' + CalledIdentityChange: + type: object + properties: + calledIdentity: + type: string + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + InterOperatorIdentifier: + type: object + properties: + originatingIOI: + type: string + terminatingIOI: + type: string + EarlyMediaDescription: + type: object + properties: + sDPTimeStamps: + $ref: '#/components/schemas/SDPTimeStamps' + sDPMediaComponent: + type: array + items: + $ref: '#/components/schemas/SDPMediaComponent' + minItems: 0 + sDPSessionDescription: + type: array + items: + type: string + minItems: 0 + SDPTimeStamps: + type: object + properties: + sDPOfferTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sDPAnswerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + SDPMediaComponent: + type: object + properties: + sDPMediaName: + type: string + SDPMediaDescription: + type: array + items: + type: string + minItems: 0 + localGWInsertedIndication: + type: boolean + ipRealmDefaultIndication: + type: boolean + transcoderInsertedIndication: + type: boolean + mediaInitiatorFlag: + $ref: '#/components/schemas/MediaInitiatorFlag' + mediaInitiatorParty: + type: string + threeGPPChargingId: + $ref: '#/components/schemas/OctetString' + accessNetworkChargingIdentifierValue: + $ref: '#/components/schemas/OctetString' + sDPType: + $ref: '#/components/schemas/SDPType' + ServerCapabilities: + type: object + properties: + mandatoryCapability: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + minItems: 0 + optionalCapability : + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + minItems: 0 + serverName: + type: array + items: + type: string + minItems: 0 + TrunkGroupID: + type: object + properties: + incomingTrunkGroupID: + type: string + outgoingTrunkGroupID: + type: string + MessageBody: + type: object + properties: + contentType: + type: string + contentLength: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + contentDisposition: + type: string + originator: + $ref: '#/components/schemas/OriginatorPartyType' + required: + - contentType + - contentLength + AccessTransferInformation: + type: object + properties: + accessTransferType: + $ref: '#/components/schemas/AccessTransferType' + accessNetworkInformation: + type: array + items: + $ref: '#/components/schemas/OctetString' + minItems: 0 + cellularNetworkInformation: + $ref: '#/components/schemas/OctetString' + interUETransfer: + $ref: '#/components/schemas/UETransferType' + userEquipmentInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + instanceId: + type: string + relatedIMSChargingIdentifier: + type: string + relatedIMSChargingIdentifierNode: + $ref: '#/components/schemas/IMSAddress' + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + AccessNetworkInfoChange: + type: object + properties: + accessNetworkInformation: + type: array + items: + $ref: '#/components/schemas/OctetString' + minItems: 0 + cellularNetworkInformation: + $ref: '#/components/schemas/OctetString' + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + NNIInformation: + type: object + properties: + sessionDirection: + $ref: '#/components/schemas/NNISessionDirection' + nNIType: + $ref: '#/components/schemas/NNIType' + relationshipMode: + $ref: '#/components/schemas/NNIRelationshipMode' + neighbourNodeAddress: + $ref: '#/components/schemas/IMSAddress' + EASRequirements: + type: object + properties: + requiredEASservingLocation: + $ref: 'TS28538_EdgeNrm.yaml/components/schemas/ServingLocation' + softwareImageInfo: + $ref: 'TS28538_EdgeNrm.yaml/components/schemas/SoftwareImageInfo' + affinityAntiAffinity: + $ref: 'TS28538_EdgeNrm.yaml/components/schemas/AffinityAntiAffinity' + serviceContinuity: + type: boolean + virtualResource: + $ref: 'TS28538_EdgeNrm.yaml/components/schemas/VirtualResource' + NotificationType: + anyOf: + - type: string + enum: + - REAUTHORIZATION + - ABORT_CHARGING + - type: string + NodeFunctionality: + anyOf: + - type: string + enum: + - AMF + - SMF + - SMS # Included for backwards compatibility, shall not be used + - SMSF + - PGW_C_SMF + - NEFF # Included for backwards compatibility, shall not be used + - SGW + - I_SMF + - ePDG + - CEF + - NEF + - MnS_Producer + - SGSN + - V_SMF + - 5G_DDNMF + - IMS_Node + - EES + - type: string + ChargingCharacteristicsSelectionMode: + anyOf: + - type: string + enum: + - HOME_DEFAULT + - ROAMING_DEFAULT + - VISITING_DEFAULT + - type: string + TriggerType: + anyOf: + - type: string + enum: + - QUOTA_THRESHOLD + - QHT + - FINAL + - QUOTA_EXHAUSTED + - VALIDITY_TIME + - OTHER_QUOTA_TYPE + - FORCED_REAUTHORISATION + - UNUSED_QUOTA_TIMER # Included for backwards compatibility, shall not be used + - UNIT_COUNT_INACTIVITY_TIMER + - ABNORMAL_RELEASE + - QOS_CHANGE + - VOLUME_LIMIT + - TIME_LIMIT + - EVENT_LIMIT + - PLMN_CHANGE + - USER_LOCATION_CHANGE + - RAT_CHANGE + - SESSION_AMBR_CHANGE + - UE_TIMEZONE_CHANGE + - TARIFF_TIME_CHANGE + - MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS + - MANAGEMENT_INTERVENTION + - CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA + - CHANGE_OF_3GPP_PS_DATA_OFF_STATUS + - SERVING_NODE_CHANGE + - REMOVAL_OF_UPF + - ADDITION_OF_UPF + - INSERTION_OF_ISMF + - REMOVAL_OF_ISMF + - CHANGE_OF_ISMF + - START_OF_SERVICE_DATA_FLOW + - ECGI_CHANGE + - TAI_CHANGE + - HANDOVER_CANCEL + - HANDOVER_START + - HANDOVER_COMPLETE + - GFBR_GUARANTEED_STATUS_CHANGE + - ADDITION_OF_ACCESS + - REMOVAL_OF_ACCESS + - START_OF_SDF_ADDITIONAL_ACCESS + - REDUNDANT_TRANSMISSION_CHANGE + - CGI_SAI_CHANGE + - RAI_CHANGE + - type: string + FinalUnitAction: + anyOf: + - type: string + enum: + - TERMINATE + - REDIRECT + - RESTRICT_ACCESS + - type: string + RedirectAddressType: + anyOf: + - type: string + enum: + - IPV4 + - IPV6 + - URL + - URI + - type: string + TriggerCategory: + anyOf: + - type: string + enum: + - IMMEDIATE_REPORT + - DEFERRED_REPORT + - type: string + QuotaManagementIndicator: + anyOf: + - type: string + enum: + - ONLINE_CHARGING + - OFFLINE_CHARGING + - QUOTA_MANAGEMENT_SUSPENDED + - type: string + FailureHandling: + anyOf: + - type: string + enum: + - TERMINATE + - CONTINUE + - RETRY_AND_TERMINATE + - type: string + SessionFailover: + anyOf: + - type: string + enum: + - FAILOVER_NOT_SUPPORTED + - FAILOVER_SUPPORTED + - type: string + 3GPPPSDataOffStatus: + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + ResultCode: + anyOf: + - type: string + enum: + - SUCCESS + - END_USER_SERVICE_DENIED + - QUOTA_MANAGEMENT_NOT_APPLICABLE + - QUOTA_LIMIT_REACHED + - END_USER_SERVICE_REJECTED + - USER_UNKNOWN #Included for backwards compatibility, shall not be used + - RATING_FAILED + - QUOTA_MANAGEMENT + - type: string + PartialRecordMethod: + anyOf: + - type: string + enum: + - DEFAULT + - INDIVIDUAL + - type: string + RoamerInOut: + anyOf: + - type: string + enum: + - IN_BOUND + - OUT_BOUND + - type: string + SMMessageType: + anyOf: + - type: string + enum: + - SUBMISSION + - DELIVERY_REPORT + - SM_SERVICE_REQUEST + - DELIVERY + - type: string + SMPriority: + anyOf: + - type: string + enum: + - LOW + - NORMAL + - HIGH + - type: string + DeliveryReportRequested: + anyOf: + - type: string + enum: + - YES + - NO + - type: string + InterfaceType: + anyOf: + - type: string + enum: + - UNKNOWN + - MOBILE_ORIGINATING + - MOBILE_TERMINATING + - APPLICATION_ORIGINATING + - APPLICATION_TERMINATING + - type: string + ClassIdentifier: + anyOf: + - type: string + enum: + - PERSONAL + - ADVERTISEMENT + - INFORMATIONAL + - AUTO + - type: string + SMAddressType: + anyOf: + - type: string + enum: + - EMAIL_ADDRESS + - MSISDN + - IPV4_ADDRESS + - IPV6_ADDRESS + - NUMERIC_SHORTCODE + - ALPHANUMERIC_SHORTCODE + - OTHER + - IMSI + - type: string + SMAddresseeType: + anyOf: + - type: string + enum: + - TO + - CC + - BCC + - type: string + SMServiceType: + anyOf: + - type: string + enum: + - VAS4SMS_SHORT_MESSAGE_CONTENT_PROCESSING + - VAS4SMS_SHORT_MESSAGE_FORWARDING + - VAS4SMS_SHORT_MESSAGE_FORWARDING_MULTIPLE_SUBSCRIPTIONS + - VAS4SMS_SHORT_MESSAGE_FILTERING + - VAS4SMS_SHORT_MESSAGE_RECEIPT + - VAS4SMS_SHORT_MESSAGE_NETWORK_STORAGE + - VAS4SMS_SHORT_MESSAGE_TO_MULTIPLE_DESTINATIONS + - VAS4SMS_SHORT_MESSAGE_VIRTUAL_PRIVATE_NETWORK(VPN) + - VAS4SMS_SHORT_MESSAGE_AUTO_REPLY + - VAS4SMS_SHORT_MESSAGE_PERSONAL_SIGNATURE + - VAS4SMS_SHORT_MESSAGE_DEFERRED_DELIVERY + - type: string + ReplyPathRequested: + anyOf: + - type: string + enum: + - NO_REPLY_PATH_SET + - REPLY_PATH_SET + - type: string + oneTimeEventType: + anyOf: + - type: string + enum: + - IEC + - PEC + - type: string + dnnSelectionMode: + anyOf: + - type: string + enum: + - VERIFIED + - UE_DNN_NOT_VERIFIED + - NW_DNN_NOT_VERIFIED + - type: string + APIDirection: + anyOf: + - type: string + enum: + - INVOCATION + - NOTIFICATION + - type: string + RegistrationMessageType: + anyOf: + - type: string + enum: + - INITIAL + - MOBILITY + - PERIODIC + - EMERGENCY + - DEREGISTRATION + - type: string + MICOModeIndication: + anyOf: + - type: string + enum: + - MICO_MODE + - NO_MICO_MODE + - type: string + SmsIndication: + anyOf: + - type: string + enum: + - SMS_SUPPORTED + - SMS_NOT_SUPPORTED + - type: string + ManagementOperation: + anyOf: + - type: string + enum: + - CreateMOI #Included for backwards compatibility, shall not be used + - ModifyMOIAttributes #Included for backwards compatibility, shall not be used + - DeleteMOI #Included for backwards compatibility, shall not be used + - CREATE_MOI + - MODIFY_MOI_ATTR + - DELETE_MOI + - type: string + ManagementOperationStatus: + anyOf: + - type: string + enum: + - OPERATION_SUCCEEDED + - OPERATION_FAILED + - type: string + RedundantTransmissionType: + anyOf: + - type: string + enum: + - NON_TRANSMISSION + - END_TO_END_USER_PLANE_PATHS + - N3/N9 + - TRANSPORT_LAYER + - type: string + VariablePartType: + anyOf: + - type: string + enum: + - INTEGER + - NUMBER + - TIME + - DATE + - CURRENCY + - type: string + QuotaConsumptionIndicator: + anyOf: + - type: string + enum: + - QUOTA_NOT_USED + - QUOTA_IS_USED + - type: string + PlayToParty: + anyOf: + - type: string + enum: + - SERVED + - REMOTE + - type: string + AnnouncementPrivacyIndicator: + anyOf: + - type: string + enum: + - NOT_PRIVATE + - PRIVATE + - type: string + SupplementaryServiceType: + anyOf: + - type: string + enum: + - OIP + - OIR + - TIP + - TIR + - HOLD + - CB + - CDIV + - CW + - MWI + - CONF + - FA + - CCBS + - CCNR + - MCID + - CAT + - CUG + - PNM + - CRS + - ECT + - type: string + SupplementaryServiceMode: + anyOf: + - type: string + enum: + - CFU + - CFB + - CFNR + - CFNL + - CD + - CFNRC + - ICB + - OCB + - ACR + - BLIND_TRANFER + - CONSULTATIVE_TRANFER + - type: string + ParticipantActionType: + anyOf: + - type: string + enum: + - CREATE + - JOIN + - INVITE_INTO + - QUIT + - type: string + TrafficForwardingWay: + anyOf: + - type: string + enum: + - N6 + - N19 + - LOCAL_SWITCH + - type: string + IMSNodeFunctionality: +# anyOf: +# - type: string +# enum: +# The applicable IMS Nodes are MRFC, IMS-GWF (connected to S-CSCF using ISC) and SIP AS. + type: string + enum: + - S_CSCF + - P_CSCF + - I_CSCF + - MRFC + - MGCF + - BGCF + - AS + - IBCF + - S-GW + - P-GW + - HSGW + - E-CSCF + - MME + - TRF + - TF + - ATCF + - PROXY + - EPDG + - TDF + - TWAG + - SCEF + - IWK_SCEF + - IMS_GWF +# - type: string + RoleOfIMSNode: + anyOf: + - type: string + enum: + - ORIGINATING + - TERMINATING + - FORWARDING + - type: string + IMSSessionPriority: + anyOf: + - type: string + enum: + - PRIORITY_0 + - PRIORITY_1 + - PRIORITY_2 + - PRIORITY_3 + - PRIORITY_4 + - type: string + MediaInitiatorFlag: + anyOf: + - type: string + enum: + - CALLED_PARTY + - CALLING_PARTY + - UNKNOWN + - type: string + SDPType: + anyOf: + - type: string + enum: + - OFFER + - ANSWER + - type: string + OriginatorPartyType: + anyOf: + - type: string + enum: + - CALLING + - CALLED + - type: string + AccessTransferType: + anyOf: + - type: string + enum: + - PS_TO_CS + - CS_TO_PS + - PS_TO_PS + - CS_TO_CS + - type: string + UETransferType: + anyOf: + - type: string + enum: + - INTRA_UE + - INTER_UE + - type: string + NNISessionDirection: + anyOf: + - type: string + enum: + - INBOUND + - OUTBOUND + - type: string + NNIType: + anyOf: + - type: string + enum: + - NON_ROAMING + - ROAMING_NO_LOOPBACK + - ROAMING_LOOPBACK + - type: string + NNIRelationshipMode: + anyOf: + - type: string + enum: + - TRUSTED + - NON_TRUSTED + - type: string + TADIdentifier: + anyOf: + - type: string + enum: + - CS + - PS + - type: string + ProseFunctionality: + anyOf: + - type: string + enum: + - DIRECT_DISCOVERY + - DIRECT_COMMUNICATION + - type: string + ProseEventType: + anyOf: + - type: string + enum: + - ANNOUNCING + - MONITORING + - MATCH_REPORT + - type: string + DirectDiscoveryModel: + anyOf: + - type: string + enum: + - MODEL_A + - MODEL_B + - type: string + RoleOfUE: + anyOf: + - type: string + enum: + - ANNOUNCING_UE + - MONITORING_UE + - REQUESTOR_UE + - REQUESTED_UE + - type: string + RangeClass: + anyOf: + - type: string + enum: + - RESERVED + - 50_METER + - 100_METER + - 200_METER + - 500_METER + - 1000_METER + - UNUSED + - type: string + RadioResourcesId: + anyOf: + - type: string + enum: + - OPERATOR_PROVIDED + - CONFIGURED + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS32291_Nchf_OfflineOnlyCharging.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS32291_Nchf_OfflineOnlyCharging.yaml new file mode 100644 index 000000000..630e1cb7e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/modified/TS32291_Nchf_OfflineOnlyCharging.yaml @@ -0,0 +1,703 @@ +openapi: 3.0.0 +info: + title: Nchf_OfflineOnlyCharging + version: 1.0.12 + description: | + OfflineOnlyCharging Service + © 20212022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 32.291 V16 V17.60.0: Telecommunication management; Charging management; + 5G system, charging service; Stage 3. + url: 'http://www.3gpp.org/ftp/Specs/archive/32_series/32.291/' +servers: + - url: '{apiRoot}/nchf-offlineonlycharging/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501. +security: + - {} + - oAuth2ClientCredentials: + - nchf-offlineonlycharging +paths: + /offlinechargingdata: + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + '/offlinechargingdata/{OfflineChargingDataRef}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + parameters: + - name: OfflineChargingDataRef + in: path + description: a unique identifier for a charging data resource in a PLMN + required: true + schema: + type: string + responses: + '200': + description: OK. Updated Charging Data resource is returned + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + '/offlinechargingdata/{OfflineChargingDataRef}/release': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + parameters: + - name: OfflineChargingDataRef + in: path + description: a unique identifier for a charging data resource in a PLMN + required: true + schema: + type: string + responses: + '204': + description: No Content. + '404': + description: Not Found + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nchf-offlineonlycharging: Access to the Nchf_OfflineOnlyCharging API + schemas: + ChargingDataRequest: + type: object + properties: + subscriberIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + nfConsumerIdentification: + $ref: '#/components/schemas/NFIdentification' + invocationTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + invocationSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + retransmissionIndicator: + type: boolean + serviceSpecificationInfo: + type: string + multipleUnitUsage: + type: array + items: + $ref: '#/components/schemas/MultipleUnitUsage' + minItems: 0 + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + pDUSessionChargingInformation: + $ref: '#/components/schemas/PDUSessionChargingInformation' + roamingQBCInformation: + $ref: '#/components/schemas/RoamingQBCInformation' + required: + - nfConsumerIdentification + - invocationTimeStamp + - invocationSequenceNumber + ChargingDataResponse: + type: object + properties: + invocationTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + invocationSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + invocationResult: + $ref: '#/components/schemas/InvocationResult' + sessionFailover: + $ref: '#/components/schemas/SessionFailover' + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + pDUSessionChargingInformation: + $ref: '#/components/schemas/PDUSessionChargingInformation' + roamingQBCInformation: + $ref: '#/components/schemas/RoamingQBCInformation' + required: + - invocationTimeStamp + - invocationSequenceNumber + NFIdentification: + type: object + properties: + nFName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nFIPv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + nFIPv6Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + nFPLMNID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nodeFunctionality: + $ref: '#/components/schemas/NodeFunctionality' + nFFqdn: + type: string + required: + - nodeFunctionality + MultipleUnitUsage: + type: object + properties: + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + usedUnitContainer: + type: array + items: + $ref: '#/components/schemas/UsedUnitContainer' + minItems: 0 + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + multihomedPDUAddress: + $ref: '#/components/schemas/PDUAddress' + required: + - ratingGroup + InvocationResult: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + failureHandling: + $ref: '#/components/schemas/FailureHandling' + Trigger: + type: object + properties: + triggerType: + $ref: '#/components/schemas/TriggerType' + triggerCategory: + $ref: '#/components/schemas/TriggerCategory' + timeLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + volumeLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + volumeLimit64: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + eventLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + maxNumberOfccc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + required: + - triggerType + - triggerCategory + UsedUnitContainer: + type: object + properties: + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + triggerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + serviceSpecificUnits: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + eventTimeStamps: + type: array + + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minItems: 0 + localSequenceNumber: + type: integer + pDUContainerInformation: + $ref: '#/components/schemas/PDUContainerInformation' + required: + - localSequenceNumber + PDUSessionChargingInformation: + type: object + properties: + chargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + sMFChargingId: + type: string + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + mAPDUNon3GPPUserLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + userLocationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + pduSessionInformation: + $ref: '#/components/schemas/PDUSessionInformation' + unitCountInactivityTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + rANSecondaryRATUsageReport: + $ref: '#/components/schemas/RANSecondaryRATUsageReport' + required: + - pduSessionInformation + UserInformation: + type: object + properties: + servedGPSI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + servedPEI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + unauthenticatedFlag: + type: boolean + roamerInOut: + $ref: '#/components/schemas/RoamerInOut' + PDUSessionInformation: + type: object + properties: + networkSlicingInfo: + $ref: '#/components/schemas/NetworkSlicingInfo' + pduSessionID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + hPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + servingNetworkFunctionID: + $ref: '#/components/schemas/ServingNetworkFunctionID' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + mAPDUNon3GPPRATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + dnnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + chargingCharacteristics: + type: string + chargingCharacteristicsSelectionMode: + $ref: '#/components/schemas/ChargingCharacteristicsSelectionMode' + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stopTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + sessionStopIndicator: + type: boolean + pduAddress: + $ref: '#/components/schemas/PDUAddress' + diagnostics: + $ref: '#/components/schemas/Diagnostics' + authorizedQoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AuthorizedDefaultQos' + subscribedQoSInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + authorizedSessionAMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + subscribedSessionAMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + servingCNPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + mAPDUSessionInformation: + $ref: '#/components/schemas/MAPDUSessionInformation' + enhancedDiagnostics: + $ref: '#/components/schemas/EnhancedDiagnostics5G' + required: + - pduSessionID + - dnnId + PDUContainerInformation: + type: object + properties: + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + aFCorrelationInformation: + type: string + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servingNodeID: + type: array + items: + $ref: '#/components/schemas/ServingNetworkFunctionID' + minItems: 0 + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + sponsorIdentity: + type: string + applicationserviceProviderIdentity: + type: string + chargingRuleBaseName: + type: string + mAPDUSteeringFunctionality: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/SteeringFunctionality' + mAPDUSteeringMode: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/SteeringMode' + NetworkSlicingInfo: + type: object + properties: + sNSSAI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - sNSSAI + PDUAddress: + type: object + properties: + pduIPv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + pduIPv6AddresswithPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + pduAddressprefixlength: + type: integer + iPv4dynamicAddressFlag: + type: boolean + iPv6dynamicPrefixFlag: + type: boolean + ServingNetworkFunctionID: + type: object + properties: + servingNetworkFunctionInformation: + $ref: '#/components/schemas/NFIdentification' + aMFId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfId' + required: + - servingNetworkFunctionInformation + RoamingQBCInformation: + type: object + properties: + multipleQFIcontainer: + type: array + items: + $ref: '#/components/schemas/MultipleQFIcontainer' + minItems: 0 + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + roamingChargingProfile: + $ref: '#/components/schemas/RoamingChargingProfile' + MultipleQFIcontainer: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + triggerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + localSequenceNumber: + type: integer + qFIContainerInformation: + $ref: '#/components/schemas/QFIContainerInformation' + required: + - localSequenceNumber + QFIContainerInformation: + type: object + properties: + qFI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servingNetworkFunctionID: + type: array + items: + $ref: '#/components/schemas/ServingNetworkFunctionID' + minItems: 0 + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + RoamingChargingProfile: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + partialRecordMethod: + $ref: '#/components/schemas/PartialRecordMethod' + RANSecondaryRATUsageReport: + type: object + properties: + rANSecondaryRATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + qosFlowsUsageReports: + type: array + items: + $ref: '#/components/schemas/QosFlowsUsageReport' + Diagnostics: + type: integer + IPFilterRule: + type: string + QosFlowsUsageReport: + type: object + properties: + qFI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + startTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + MAPDUSessionInformation: + type: object + properties: + mAPDUSessionIndicator: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/MaPduIndication' + aTSSSCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AtsssCapability' + EnhancedDiagnostics5G: + $ref: '#/components/schemas/RanNasCauseList' + RanNasCauseList: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RanNasRelCause' + NodeFunctionality: + anyOf: + - type: string + enum: + - SMF + - SMSF # Included for backwards compatibility, shall not be used + - I-SMF + - type: string + ChargingCharacteristicsSelectionMode: + anyOf: + - type: string + enum: + - HOME_DEFAULT + - ROAMING_DEFAULT + - VISITING_DEFAULT + - type: string + TriggerType: + anyOf: + - type: string + enum: + - FINAL + - ABNORMAL_RELEASE + - QOS_CHANGE + - VOLUME_LIMIT + - TIME_LIMIT + - EVENT_LIMIT + - PLMN_CHANGE + - USER_LOCATION_CHANGE + - RAT_CHANGE + - SESSION_AMBR_CHANGE + - UE_TIMEZONE_CHANGE + - TARIFF_TIME_CHANGE + - MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS + - MANAGEMENT_INTERVENTION + - CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA + - CHANGE_OF_3GPP_PS_DATA_OFF_STATUS + - SERVING_NODE_CHANGE + - REMOVAL_OF_UPF + - ADDITION_OF_UPF + - INSERTION_OF_ISMF + - REMOVAL_OF_ISMF + - CHANGE_OF_ISMF + - START_OF_SERVICE_DATA_FLOW + - GFBR_GUARANTEED_STATUS_CHANGE + - HANDOVER_CANCEL + - HANDOVER_START + - HANDOVER_COMPLETE + - ADDITION_OF_ACCESS + - REMOVAL_OF_ACCESS + - START_OF_SDF_ADDITIONAL_ACCESS + - type: string + TriggerCategory: + anyOf: + - type: string + enum: + - IMMEDIATE_REPORT + - DEFERRED_REPORT + - type: string + FailureHandling: + anyOf: + - type: string + enum: + - TERMINATE + - CONTINUE + - RETRY_AND_TERMINATE + - type: string + SessionFailover: + anyOf: + - type: string + enum: + - FAILOVER_NOT_SUPPORTED + - FAILOVER_SUPPORTED + - type: string + 3GPPPSDataOffStatus: + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + ResultCode: + anyOf: + - type: string + enum: + - SUCCESS + - END_USER_SERVICE_DENIED + - type: string + PartialRecordMethod: + anyOf: + - type: string + enum: + - DEFAULT + - INDIVIDUAL + - type: string + RoamerInOut: + anyOf: + - type: string + enum: + - IN_BOUND + - OUT_BOUND + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/VERSION b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/VERSION new file mode 100644 index 000000000..ac14c3dfa --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.1 diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/config.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/config.yaml new file mode 100644 index 000000000..74a3305b0 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/config.yaml @@ -0,0 +1,13 @@ +enablePostProcessFile: true +templateDir: "./openapi-generator/templates" +reservedWordsMappings: + 3GPP_ACCESS: "3GPP_ACCESS" + 5G_EIR: "5G_EIR" + 5G_AKA: "5G_AKA" + 5G_HE_AKA: "5G_HE_AKA" + 5GMM: "5GMM" +files: + any_type.h: + folder: model + any_type.c: + folder: model diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/any_type.c b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/any_type.c new file mode 100644 index 000000000..015c07aaf --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/any_type.c @@ -0,0 +1,121 @@ +#include "any_type.h" + +bool OpenAPI_IsInvalid(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsInvalid(item->json); +} +bool OpenAPI_IsFalse(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsFalse(item->json); +} +bool OpenAPI_IsTrue(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsTrue(item->json); +} +bool OpenAPI_IsBool(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsBool(item->json); +} +bool OpenAPI_IsNull(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsNull(item->json); +} +bool OpenAPI_IsNumber(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsNumber(item->json); +} +bool OpenAPI_IsString(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsString(item->json); +} +bool OpenAPI_IsArray(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsArray(item->json); +} +bool OpenAPI_IsObject(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsObject(item->json); +} +bool OpenAPI_IsRaw(const OpenAPI_any_type_t * const item) +{ + return item && cJSON_IsRaw(item->json); +} + +static OpenAPI_any_type_t *any_create(cJSON *json) { + OpenAPI_any_type_t *any_type = NULL; + + if (!json) { + return NULL; + } + + any_type = ogs_calloc(1, sizeof(*any_type)); + if (!any_type) { + cJSON_Delete(json); + } + any_type->json = json; + + return any_type; +} + +OpenAPI_any_type_t *OpenAPI_any_type_create(cJSON *json) { + OpenAPI_any_type_t *any_type_local_var = + any_create(cJSON_Duplicate(json, true)); + ogs_assert(any_type_local_var); + + return any_type_local_var; +} + +OpenAPI_any_type_t *OpenAPI_any_type_parseFromJSON(cJSON *json) { + return OpenAPI_any_type_create(json); +} + +cJSON *OpenAPI_any_type_convertToJSON(OpenAPI_any_type_t *any_type) { + cJSON *item = NULL; + + if (any_type == NULL) { + ogs_error("OpenAPI_any_type_convertToJSON() failed [AnyType]"); + return NULL; + } + + item = cJSON_Duplicate(any_type->json, true); + if (item == NULL) { + ogs_error("OpenAPI_any_type_convertToJSON() failed [AnyType]"); + return NULL; + } + + return item; +} + +OpenAPI_any_type_t *OpenAPI_any_type_create_true(void) +{ + return OpenAPI_any_type_create_bool(true); +} + +OpenAPI_any_type_t *OpenAPI_any_type_create_false(void) +{ + return OpenAPI_any_type_create_bool(false); +} + +OpenAPI_any_type_t *OpenAPI_any_type_create_bool(bool boolean) +{ + return any_create(boolean ? cJSON_CreateTrue() : cJSON_CreateFalse()); +} + +OpenAPI_any_type_t *OpenAPI_any_type_create_number(double num) +{ + return any_create(cJSON_CreateNumber(num)); +} + + +OpenAPI_any_type_t *OpenAPI_any_type_create_string(const char *string) +{ + return any_create(cJSON_CreateString(string)); +} + +void OpenAPI_any_type_free(OpenAPI_any_type_t *any_type) +{ + if (any_type) { + cJSON_Delete(any_type->json); + ogs_free(any_type); + } +} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/any_type.h b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/any_type.h new file mode 100644 index 000000000..971ef78cd --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/any_type.h @@ -0,0 +1,55 @@ +#ifndef OGS_SBI_ANY_TYPE_H +#define OGS_SBI_ANY_TYPE_H + +#include "../external/cJSON.h" +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define OpenAPI_Invalid (0) +#define OpenAPI_False (1 << 0) +#define OpenAPI_True (1 << 1) +#define OpenAPI_NULL (1 << 2) +#define OpenAPI_Number (1 << 3) +#define OpenAPI_String (1 << 4) +#define OpenAPI_Array (1 << 5) +#define OpenAPI_Object (1 << 6) +#define OpenAPI_Raw (1 << 7) /* raw json */ + +#define OpenAPI_IsReference 256 +#define OpenAPI_StringIsConst 512 + +typedef struct OpenAPI_any_type_s OpenAPI_any_type_t; +typedef struct OpenAPI_any_type_s { + cJSON *json; +} OpenAPI_any_type_t; + +bool OpenAPI_IsInvalid(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsFalse(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsTrue(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsBool(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsNull(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsNumber(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsString(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsArray(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsObject(const OpenAPI_any_type_t * const item); +bool OpenAPI_IsRaw(const OpenAPI_any_type_t * const item); + +OpenAPI_any_type_t *OpenAPI_any_type_create(cJSON *json); +OpenAPI_any_type_t *OpenAPI_any_type_parseFromJSON(cJSON *json); +cJSON *OpenAPI_any_type_convertToJSON(OpenAPI_any_type_t *any_type); + +OpenAPI_any_type_t *OpenAPI_any_type_create_true(void); +OpenAPI_any_type_t *OpenAPI_any_type_create_false(void); +OpenAPI_any_type_t *OpenAPI_any_type_create_bool(bool boolean); +OpenAPI_any_type_t *OpenAPI_any_type_create_number(double num); +OpenAPI_any_type_t *OpenAPI_any_type_create_string(const char *string); +void OpenAPI_any_type_free(OpenAPI_any_type_t *any_type); + +#ifdef __cplusplus +} +#endif + +#endif /* OGS_SBI_ANY_TYPE_H */ diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/apiKey.c.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/apiKey.c.mustache new file mode 100644 index 000000000..e20978310 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/apiKey.c.mustache @@ -0,0 +1,30 @@ +#include +#include +#include "../include/keyValuePair.h" + +OpenAPI_map_t *OpenAPI_map_create(char *key, void *value) +{ + OpenAPI_map_t *OpenAPI_map = NULL; + + ogs_assert(key); + + OpenAPI_map = ogs_malloc(sizeof(OpenAPI_map_t)); + ogs_assert(OpenAPI_map); + OpenAPI_map->key = key; + OpenAPI_map->value = value; + + return OpenAPI_map; +} + +OpenAPI_map_t *OpenAPI_map_create_allocate(char *key, double value) +{ + double* boolpointer = ogs_malloc(sizeof(value)); + ogs_assert(boolpointer); + memcpy(boolpointer, &value, sizeof(value)); + return OpenAPI_map_create(key, boolpointer); +} + +void OpenAPI_map_free(OpenAPI_map_t *OpenAPI_map) +{ + ogs_free(OpenAPI_map); +} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/binary.c.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/binary.c.mustache new file mode 100644 index 000000000..8cf5849dc --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/binary.c.mustache @@ -0,0 +1,65 @@ +#include +#include +#include "../include/binary.h" +#ifdef OPENSSL +#include "openssl/pem.h" +#endif + +OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len) +{ + OpenAPI_binary_t* ret = malloc(sizeof(OpenAPI_binary_t)); + + ret->len=len; + ret->data = malloc(len); + memcpy(ret->data, data, len); + + return ret; +} + +char *OpenAPI_base64encode(const void *b64_encode_this, + int encode_this_many_bytes) +{ +#ifdef OPENSSL + BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. + BUF_MEM *mem_bio_mem_ptr; //Pointer to a "memory BIO" structure holding our base64 data. + b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. + mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory sink BIO. + BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-sink BIO chain. + BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //No newlines every 64 characters or less. + BIO_write(b64_bio, b64_encode_this, encode_this_many_bytes); //Records base64 encoded data. + BIO_flush(b64_bio); //Flush data. Necessary for b64 encoding, because of pad characters. + BIO_get_mem_ptr(mem_bio, &mem_bio_mem_ptr); //Store address of mem_bio's memory structure. + BIO_set_close(mem_bio, BIO_NOCLOSE); //Permit access to mem_ptr after BIOs are destroyed. + BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + BUF_MEM_grow(mem_bio_mem_ptr, (*mem_bio_mem_ptr).length + 1); //Makes space for end null. + (*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail. + return (*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct). +#else // OPENSSL +//#warning Data will not be encoded. If you want to use function "base64encode", please define "-DOPENSSL" when building the library. + return NULL; +#endif // OPENSSL +} + +char *OpenAPI_base64decode(const void *b64_decode_this, + int decode_this_many_bytes, int *decoded_bytes) +{ +#ifdef OPENSSL + BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. + char *base64_decoded = calloc( (decode_this_many_bytes*3)/4+1, sizeof(char) ); //+1 = null. + b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. + mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory source BIO. + BIO_write(mem_bio, b64_decode_this, decode_this_many_bytes); //Base64 data saved in source. + BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-source BIO chain. + BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //Don't require trailing newlines. + int decoded_byte_index = 0; //Index where the next base64_decoded byte should be written. + while ( 0 < BIO_read(b64_bio, base64_decoded+decoded_byte_index, 1) ){ //Read byte-by-byte. + decoded_byte_index++; //Increment the index until read of BIO decoded data is complete. + } //Once we're done reading decoded data, BIO_read returns -1 even though there's no error. + BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + *decoded_bytes = decoded_byte_index; + return base64_decoded; //Returns base-64 decoded data with trailing null terminator. +#else // OPENSSL +//#warning Data will not be decoded. If you want to use function "base64decode", please define "-DOPENSSL" when building the library. + return NULL; +#endif // OPENSSL +} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/binary.h.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/binary.h.mustache new file mode 100644 index 000000000..5f8a2f4d5 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/binary.h.mustache @@ -0,0 +1,27 @@ +#ifndef OGS_SBI_BINARY_H +#define OGS_SBI_BINARY_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_binary_s { + char* data; + int len; +} OpenAPI_binary_t; + +OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len); + +char *OpenAPI_base64encode(const void *b64_encode_this, + int encode_this_many_bytes); + +char *OpenAPI_base64decode(const void *b64_decode_this, + int decode_this_many_bytes, int *decoded_bytes); + +#ifdef __cplusplus +} +#endif + +#endif // OGS_SBI_BINARY_H diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/cJSON.c.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/cJSON.c.mustache new file mode 100644 index 000000000..2ebd75bf9 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/cJSON.c.mustache @@ -0,0 +1,3139 @@ +/* + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +/* cJSON */ +/* JSON parser in C. */ + +/* disable warnings about old C89 functions in MSVC */ +#if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) +#define _CRT_SECURE_NO_DEPRECATE +#endif + +#ifdef __GNUC__ +#pragma GCC visibility push(default) +#endif +#if defined(_MSC_VER) +#pragma warning (push) +/* disable warning about single line comments in system headers */ +#pragma warning (disable : 4001) +#endif + +#include +#include +#include +#include +#include +#include +#include + +#ifdef ENABLE_LOCALES +#include +#endif + +#if defined(_MSC_VER) +#pragma warning (pop) +#endif +#ifdef __GNUC__ +#pragma GCC visibility pop +#endif + +#include "cJSON.h" + +/* define our own boolean type */ +#ifdef true +#undef true +#endif +#define true ((cJSON_bool)1) + +#ifdef false +#undef false +#endif +#define false ((cJSON_bool)0) + +/* define isnan and isinf for ANSI C, if in C99 or above, isnan and isinf has been defined in math.h */ +#ifndef isinf +#define isinf(d) (isnan((d - d)) && !isnan(d)) +#endif +#ifndef isnan +#define isnan(d) (d != d) +#endif + +#ifndef NAN +#ifdef _WIN32 +#define NAN sqrt(-1.0) +#else +#define NAN 0.0/0.0 +#endif +#endif + +typedef struct { + const unsigned char *json; + size_t position; +} error; +static error global_error = { NULL, 0 }; + +CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void) +{ + return (const char*) (global_error.json + global_error.position); +} + +CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item) +{ + if (!cJSON_IsString(item)) + { + return NULL; + } + + return item->valuestring; +} + +CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item) +{ + if (!cJSON_IsNumber(item)) + { + return (double) NAN; + } + + return item->valuedouble; +} + +/* This is a safeguard to prevent copy-pasters from using incompatible C and header files */ +#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 15) + #error cJSON.h and cJSON.c have different versions. Make sure that both have the same. +#endif + +CJSON_PUBLIC(const char*) cJSON_Version(void) +{ + static char version[15]; + sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); + + return version; +} + +/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ +static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) +{ + if ((string1 == NULL) || (string2 == NULL)) + { + return 1; + } + + if (string1 == string2) + { + return 0; + } + + for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++) + { + if (*string1 == '\0') + { + return 0; + } + } + + return tolower(*string1) - tolower(*string2); +} + +typedef struct internal_hooks +{ + void *(CJSON_CDECL *allocate)(size_t size); + void (CJSON_CDECL *deallocate)(void *pointer); + void *(CJSON_CDECL *reallocate)(void *pointer, size_t size); +} internal_hooks; + +#if defined(_MSC_VER) +/* work around MSVC error C2322: '...' address of dllimport '...' is not static */ +static void * CJSON_CDECL internal_malloc(size_t size) +{ + return malloc(size); +} +static void CJSON_CDECL internal_free(void *pointer) +{ + free(pointer); +} +static void * CJSON_CDECL internal_realloc(void *pointer, size_t size) +{ + return realloc(pointer, size); +} +#else +#if 0 /* modified by acetcom */ +#define internal_malloc malloc +#define internal_free free +#define internal_realloc realloc +#else +#include "ogs-core.h" +static void *internal_malloc(size_t size) +{ + void *ptr = ogs_malloc(size); + ogs_assert(ptr); + return ptr; +} +static void internal_free(void *pointer) +{ + ogs_free(pointer); +} +static void *internal_realloc(void *pointer, size_t size) +{ + void *ptr = ogs_realloc(pointer, size); + ogs_assert(ptr); + return ptr; +} +#endif +#endif + +/* strlen of character literals resolved at compile time */ +#define static_strlen(string_literal) (sizeof(string_literal) - sizeof("")) + +static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; + +static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) +{ + size_t length = 0; + unsigned char *copy = NULL; + + if (string == NULL) + { + return NULL; + } + + length = strlen((const char*)string) + sizeof(""); + copy = (unsigned char*)hooks->allocate(length); + if (copy == NULL) + { + return NULL; + } + memcpy(copy, string, length); + + return copy; +} + +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) +{ + if (hooks == NULL) + { + /* Reset hooks */ + global_hooks.allocate = malloc; + global_hooks.deallocate = free; + global_hooks.reallocate = realloc; + return; + } + + global_hooks.allocate = malloc; + if (hooks->malloc_fn != NULL) + { + global_hooks.allocate = hooks->malloc_fn; + } + + global_hooks.deallocate = free; + if (hooks->free_fn != NULL) + { + global_hooks.deallocate = hooks->free_fn; + } + + /* use realloc only if both free and malloc are used */ + global_hooks.reallocate = NULL; + if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) + { + global_hooks.reallocate = realloc; + } +} + +/* Internal constructor. */ +static cJSON *cJSON_New_Item(const internal_hooks * const hooks) +{ + cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); + if (node) + { + memset(node, '\0', sizeof(cJSON)); + } + + return node; +} + +/* Delete a cJSON structure. */ +CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) +{ + cJSON *next = NULL; + while (item != NULL) + { + next = item->next; + if (!(item->type & cJSON_IsReference) && (item->child != NULL)) + { + cJSON_Delete(item->child); + } + if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) + { + global_hooks.deallocate(item->valuestring); + } + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + global_hooks.deallocate(item->string); + } + global_hooks.deallocate(item); + item = next; + } +} + +/* get the decimal point character of the current locale */ +static unsigned char get_decimal_point(void) +{ +#ifdef ENABLE_LOCALES + struct lconv *lconv = localeconv(); + return (unsigned char) lconv->decimal_point[0]; +#else + return '.'; +#endif +} + +typedef struct +{ + const unsigned char *content; + size_t length; + size_t offset; + size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ + internal_hooks hooks; +} parse_buffer; + +/* check if the given size is left to read in a given parse buffer (starting with 1) */ +#define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) +/* check if the buffer can be accessed at the given index (starting with 0) */ +#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) +#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) +/* get a pointer to the buffer at the position */ +#define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) + +/* Parse the input text to generate a number, and populate the result into item. */ +static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer) +{ + double number = 0; + unsigned char *after_end = NULL; + unsigned char number_c_string[64]; + unsigned char decimal_point = get_decimal_point(); + size_t i = 0; + + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; + } + + /* copy the number into a temporary buffer and replace '.' with the decimal point + * of the current locale (for strtod) + * This also takes care of '\0' not necessarily being available for marking the end of the input */ + for (i = 0; (i < (sizeof(number_c_string) - 1)) && can_access_at_index(input_buffer, i); i++) + { + switch (buffer_at_offset(input_buffer)[i]) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '+': + case '-': + case 'e': + case 'E': + number_c_string[i] = buffer_at_offset(input_buffer)[i]; + break; + + case '.': + number_c_string[i] = decimal_point; + break; + + default: + goto loop_end; + } + } +loop_end: + number_c_string[i] = '\0'; + + number = strtod((const char*)number_c_string, (char**)&after_end); + if (number_c_string == after_end) + { + return false; /* parse_error */ + } + + item->valuedouble = number; + + /* use saturation in case of overflow */ + if (number >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (number <= (double)INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)number; + } + + item->type = cJSON_Number; + + input_buffer->offset += (size_t)(after_end - number_c_string); + return true; +} + +/* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */ +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) +{ + if (number >= INT_MAX) + { + object->valueint = INT_MAX; + } + else if (number <= (double)INT_MIN) + { + object->valueint = INT_MIN; + } + else + { + object->valueint = (int)number; + } + + return object->valuedouble = number; +} + +CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring) +{ + char *copy = NULL; + /* if object's type is not cJSON_String or is cJSON_IsReference, it should not set valuestring */ + if (!(object->type & cJSON_String) || (object->type & cJSON_IsReference)) + { + return NULL; + } + if (strlen(valuestring) <= strlen(object->valuestring)) + { + strcpy(object->valuestring, valuestring); + return object->valuestring; + } + copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks); + if (copy == NULL) + { + return NULL; + } + if (object->valuestring != NULL) + { + cJSON_free(object->valuestring); + } + object->valuestring = copy; + + return copy; +} + +typedef struct +{ + unsigned char *buffer; + size_t length; + size_t offset; + size_t depth; /* current nesting depth (for formatted printing) */ + cJSON_bool noalloc; + cJSON_bool format; /* is this print a formatted print */ + internal_hooks hooks; +} printbuffer; + +/* realloc printbuffer if necessary to have at least "needed" bytes more */ +static unsigned char* ensure(printbuffer * const p, size_t needed) +{ + unsigned char *newbuffer = NULL; + size_t newsize = 0; + + if ((p == NULL) || (p->buffer == NULL)) + { + return NULL; + } + + if ((p->length > 0) && (p->offset >= p->length)) + { + /* make sure that offset is valid */ + return NULL; + } + + if (needed > INT_MAX) + { + /* sizes bigger than INT_MAX are currently not supported */ + return NULL; + } + + needed += p->offset + 1; + if (needed <= p->length) + { + return p->buffer + p->offset; + } + + if (p->noalloc) { + return NULL; + } + + /* calculate new buffer size */ + if (needed > (INT_MAX / 2)) + { + /* overflow of int, use INT_MAX if possible */ + if (needed <= INT_MAX) + { + newsize = INT_MAX; + } + else + { + return NULL; + } + } + else + { + newsize = needed * 2; + } + + if (p->hooks.reallocate != NULL) + { + /* reallocate with realloc if available */ + newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); + if (newbuffer == NULL) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + } + else + { + /* otherwise reallocate manually */ + newbuffer = (unsigned char*)p->hooks.allocate(newsize); + if (!newbuffer) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + + memcpy(newbuffer, p->buffer, p->offset + 1); + p->hooks.deallocate(p->buffer); + } + p->length = newsize; + p->buffer = newbuffer; + + return newbuffer + p->offset; +} + +/* calculate the new length of the string in a printbuffer and update the offset */ +static void update_offset(printbuffer * const buffer) +{ + const unsigned char *buffer_pointer = NULL; + if ((buffer == NULL) || (buffer->buffer == NULL)) + { + return; + } + buffer_pointer = buffer->buffer + buffer->offset; + + buffer->offset += strlen((const char*)buffer_pointer); +} + +/* securely comparison of floating-point variables */ +static cJSON_bool compare_double(double a, double b) +{ + double maxVal = fabs(a) > fabs(b) ? fabs(a) : fabs(b); + return (fabs(a - b) <= maxVal * DBL_EPSILON); +} + +/* Render the number nicely from the given item into a string. */ +static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + double d = item->valuedouble; + int length = 0; + size_t i = 0; + unsigned char number_buffer[26] = {0}; /* temporary buffer to print the number into */ + unsigned char decimal_point = get_decimal_point(); + double test = 0.0; + + if (output_buffer == NULL) + { + return false; + } + + /* This checks for NaN and Infinity */ + if (isnan(d) || isinf(d)) + { + length = sprintf((char*)number_buffer, "null"); + } + else if(d == (double)item->valueint) + { + length = sprintf((char*)number_buffer, "%d", item->valueint); + } + else + { + /* Try 15 decimal places of precision to avoid insignificant nonzero digits */ + length = sprintf((char*)number_buffer, "%1.15g", d); + + /* Check whether the original double can be recovered */ + if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || !compare_double((double)test, d)) + { + /* If not, print with 17 decimal places of precision */ + length = sprintf((char*)number_buffer, "%1.17g", d); + } + } + + /* sprintf failed or buffer overrun occurred */ + if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1))) + { + return false; + } + + /* reserve appropriate space in the output */ + output_pointer = ensure(output_buffer, (size_t)length + sizeof("")); + if (output_pointer == NULL) + { + return false; + } + + /* copy the printed number to the output and replace locale + * dependent decimal point with '.' */ + for (i = 0; i < ((size_t)length); i++) + { + if (number_buffer[i] == decimal_point) + { + output_pointer[i] = '.'; + continue; + } + + output_pointer[i] = number_buffer[i]; + } + output_pointer[i] = '\0'; + + output_buffer->offset += (size_t)length; + + return true; +} + +/* parse 4 digit hexadecimal number */ +static unsigned parse_hex4(const unsigned char * const input) +{ + unsigned int h = 0; + size_t i = 0; + + for (i = 0; i < 4; i++) + { + /* parse digit */ + if ((input[i] >= '0') && (input[i] <= '9')) + { + h += (unsigned int) input[i] - '0'; + } + else if ((input[i] >= 'A') && (input[i] <= 'F')) + { + h += (unsigned int) 10 + input[i] - 'A'; + } + else if ((input[i] >= 'a') && (input[i] <= 'f')) + { + h += (unsigned int) 10 + input[i] - 'a'; + } + else /* invalid */ + { + return 0; + } + + if (i < 3) + { + /* shift left to make place for the next nibble */ + h = h << 4; + } + } + + return h; +} + +/* converts a UTF-16 literal to UTF-8 + * A literal can be one or two sequences of the form \uXXXX */ +static unsigned char utf16_literal_to_utf8(const unsigned char * const input_pointer, const unsigned char * const input_end, unsigned char **output_pointer) +{ + long unsigned int codepoint = 0; + unsigned int first_code = 0; + const unsigned char *first_sequence = input_pointer; + unsigned char utf8_length = 0; + unsigned char utf8_position = 0; + unsigned char sequence_length = 0; + unsigned char first_byte_mark = 0; + + if ((input_end - first_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + /* get the first utf16 sequence */ + first_code = parse_hex4(first_sequence + 2); + + /* check that the code is valid */ + if (((first_code >= 0xDC00) && (first_code <= 0xDFFF))) + { + goto fail; + } + + /* UTF16 surrogate pair */ + if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) + { + const unsigned char *second_sequence = first_sequence + 6; + unsigned int second_code = 0; + sequence_length = 12; /* \uXXXX\uXXXX */ + + if ((input_end - second_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) + { + /* missing second half of the surrogate pair */ + goto fail; + } + + /* get the second utf16 sequence */ + second_code = parse_hex4(second_sequence + 2); + /* check that the code is valid */ + if ((second_code < 0xDC00) || (second_code > 0xDFFF)) + { + /* invalid second half of the surrogate pair */ + goto fail; + } + + + /* calculate the unicode codepoint from the surrogate pair */ + codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF)); + } + else + { + sequence_length = 6; /* \uXXXX */ + codepoint = first_code; + } + + /* encode as UTF-8 + * takes at maximum 4 bytes to encode: + * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + if (codepoint < 0x80) + { + /* normal ascii, encoding 0xxxxxxx */ + utf8_length = 1; + } + else if (codepoint < 0x800) + { + /* two bytes, encoding 110xxxxx 10xxxxxx */ + utf8_length = 2; + first_byte_mark = 0xC0; /* 11000000 */ + } + else if (codepoint < 0x10000) + { + /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ + utf8_length = 3; + first_byte_mark = 0xE0; /* 11100000 */ + } + else if (codepoint <= 0x10FFFF) + { + /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ + utf8_length = 4; + first_byte_mark = 0xF0; /* 11110000 */ + } + else + { + /* invalid unicode codepoint */ + goto fail; + } + + /* encode as utf8 */ + for (utf8_position = (unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--) + { + /* 10xxxxxx */ + (*output_pointer)[utf8_position] = (unsigned char)((codepoint | 0x80) & 0xBF); + codepoint >>= 6; + } + /* encode first byte */ + if (utf8_length > 1) + { + (*output_pointer)[0] = (unsigned char)((codepoint | first_byte_mark) & 0xFF); + } + else + { + (*output_pointer)[0] = (unsigned char)(codepoint & 0x7F); + } + + *output_pointer += utf8_length; + + return sequence_length; + +fail: + return 0; +} + +/* Parse the input text into an unescaped cinput, and populate item. */ +static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer) +{ + const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; + const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; + unsigned char *output_pointer = NULL; + unsigned char *output = NULL; + + /* not a string */ + if (buffer_at_offset(input_buffer)[0] != '\"') + { + goto fail; + } + + { + /* calculate approximate size of the output (overestimate) */ + size_t allocation_length = 0; + size_t skipped_bytes = 0; + while (((size_t)(input_end - input_buffer->content) < input_buffer->length) && (*input_end != '\"')) + { + /* is escape sequence */ + if (input_end[0] == '\\') + { + if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length) + { + /* prevent buffer overflow when last input character is a backslash */ + goto fail; + } + skipped_bytes++; + input_end++; + } + input_end++; + } + if (((size_t)(input_end - input_buffer->content) >= input_buffer->length) || (*input_end != '\"')) + { + goto fail; /* string ended unexpectedly */ + } + + /* This is at most how much we need for the output */ + allocation_length = (size_t) (input_end - buffer_at_offset(input_buffer)) - skipped_bytes; + output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); + if (output == NULL) + { + goto fail; /* allocation failure */ + } + } + + output_pointer = output; + /* loop through the string literal */ + while (input_pointer < input_end) + { + if (*input_pointer != '\\') + { + *output_pointer++ = *input_pointer++; + } + /* escape sequence */ + else + { + unsigned char sequence_length = 2; + if ((input_end - input_pointer) < 1) + { + goto fail; + } + + switch (input_pointer[1]) + { + case 'b': + *output_pointer++ = '\b'; + break; + case 'f': + *output_pointer++ = '\f'; + break; + case 'n': + *output_pointer++ = '\n'; + break; + case 'r': + *output_pointer++ = '\r'; + break; + case 't': + *output_pointer++ = '\t'; + break; + case '\"': + case '\\': + case '/': + *output_pointer++ = input_pointer[1]; + break; + + /* UTF-16 literal */ + case 'u': + sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer); + if (sequence_length == 0) + { + /* failed to convert UTF16-literal to UTF-8 */ + goto fail; + } + break; + + default: + goto fail; + } + input_pointer += sequence_length; + } + } + + /* zero terminate the output */ + *output_pointer = '\0'; + + item->type = cJSON_String; + item->valuestring = (char*)output; + + input_buffer->offset = (size_t) (input_end - input_buffer->content); + input_buffer->offset++; + + return true; + +fail: + if (output != NULL) + { + input_buffer->hooks.deallocate(output); + } + + if (input_pointer != NULL) + { + input_buffer->offset = (size_t)(input_pointer - input_buffer->content); + } + + return false; +} + +/* Render the cstring provided to an escaped version that can be printed. */ +static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffer * const output_buffer) +{ + const unsigned char *input_pointer = NULL; + unsigned char *output = NULL; + unsigned char *output_pointer = NULL; + size_t output_length = 0; + /* numbers of additional characters needed for escaping */ + size_t escape_characters = 0; + + if (output_buffer == NULL) + { + return false; + } + + /* empty string */ + if (input == NULL) + { + output = ensure(output_buffer, sizeof("\"\"")); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "\"\""); + + return true; + } + + /* set "flag" to 1 if something needs to be escaped */ + for (input_pointer = input; *input_pointer; input_pointer++) + { + switch (*input_pointer) + { + case '\"': + case '\\': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + /* one character escape sequence */ + escape_characters++; + break; + default: + if (*input_pointer < 32) + { + /* UTF-16 escape sequence uXXXX */ + escape_characters += 5; + } + break; + } + } + output_length = (size_t)(input_pointer - input) + escape_characters; + + output = ensure(output_buffer, output_length + sizeof("\"\"")); + if (output == NULL) + { + return false; + } + + /* no characters have to be escaped */ + if (escape_characters == 0) + { + output[0] = '\"'; + memcpy(output + 1, input, output_length); + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; + } + + output[0] = '\"'; + output_pointer = output + 1; + /* copy the string */ + for (input_pointer = input; *input_pointer != '\0'; (void)input_pointer++, output_pointer++) + { + if ((*input_pointer > 31) && (*input_pointer != '\"') && (*input_pointer != '\\')) + { + /* normal character, copy */ + *output_pointer = *input_pointer; + } + else + { + /* character needs to be escaped */ + *output_pointer++ = '\\'; + switch (*input_pointer) + { + case '\\': + *output_pointer = '\\'; + break; + case '\"': + *output_pointer = '\"'; + break; + case '\b': + *output_pointer = 'b'; + break; + case '\f': + *output_pointer = 'f'; + break; + case '\n': + *output_pointer = 'n'; + break; + case '\r': + *output_pointer = 'r'; + break; + case '\t': + *output_pointer = 't'; + break; + default: + /* escape and print as unicode codepoint */ + sprintf((char*)output_pointer, "u%04x", *input_pointer); + output_pointer += 4; + break; + } + } + } + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; +} + +/* Invoke print_string_ptr (which is useful) on an item. */ +static cJSON_bool print_string(const cJSON * const item, printbuffer * const p) +{ + return print_string_ptr((unsigned char*)item->valuestring, p); +} + +/* Predeclare these prototypes. */ +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer); + +/* Utility to jump whitespace and cr/lf */ +static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL)) + { + return NULL; + } + + if (cannot_access_at_index(buffer, 0)) + { + return buffer; + } + + while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) + { + buffer->offset++; + } + + if (buffer->offset == buffer->length) + { + buffer->offset--; + } + + return buffer; +} + +/* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ +static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0)) + { + return NULL; + } + + if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0)) + { + buffer->offset += 3; + } + + return buffer; +} + +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated) +{ + size_t buffer_length; + + if (NULL == value) + { + return NULL; + } + + /* Adding null character size due to require_null_terminated. */ + buffer_length = strlen(value) + sizeof(""); + + return cJSON_ParseWithLengthOpts(value, buffer_length, return_parse_end, require_null_terminated); +} + +/* Parse an object - create a new root, and populate. */ +CJSON_PUBLIC(cJSON *) cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated) +{ + parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; + cJSON *item = NULL; + + /* reset error position */ + global_error.json = NULL; + global_error.position = 0; + + if (value == NULL || 0 == buffer_length) + { + goto fail; + } + + buffer.content = (const unsigned char*)value; + buffer.length = buffer_length; + buffer.offset = 0; + buffer.hooks = global_hooks; + + item = cJSON_New_Item(&global_hooks); + if (item == NULL) /* memory fail */ + { + goto fail; + } + + if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) + { + /* parse failure. ep is set. */ + goto fail; + } + + /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ + if (require_null_terminated) + { + buffer_skip_whitespace(&buffer); + if ((buffer.offset >= buffer.length) || buffer_at_offset(&buffer)[0] != '\0') + { + goto fail; + } + } + if (return_parse_end) + { + *return_parse_end = (const char*)buffer_at_offset(&buffer); + } + + return item; + +fail: + if (item != NULL) + { + cJSON_Delete(item); + } + + if (value != NULL) + { + error local_error; + local_error.json = (const unsigned char*)value; + local_error.position = 0; + + if (buffer.offset < buffer.length) + { + local_error.position = buffer.offset; + } + else if (buffer.length > 0) + { + local_error.position = buffer.length - 1; + } + + if (return_parse_end != NULL) + { + *return_parse_end = (const char*)local_error.json + local_error.position; + } + + global_error = local_error; + } + + return NULL; +} + +/* Default options for cJSON_Parse */ +CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) +{ + return cJSON_ParseWithOpts(value, 0, 0); +} + +CJSON_PUBLIC(cJSON *) cJSON_ParseWithLength(const char *value, size_t buffer_length) +{ + return cJSON_ParseWithLengthOpts(value, buffer_length, 0, 0); +} + +#define cjson_min(a, b) (((a) < (b)) ? (a) : (b)) + +static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) +{ + static const size_t default_buffer_size = 256; + printbuffer buffer[1]; + unsigned char *printed = NULL; + + memset(buffer, 0, sizeof(buffer)); + + /* create buffer */ + buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); + buffer->length = default_buffer_size; + buffer->format = format; + buffer->hooks = *hooks; + if (buffer->buffer == NULL) + { + goto fail; + } + + /* print the value */ + if (!print_value(item, buffer)) + { + goto fail; + } + update_offset(buffer); + + /* check if reallocate is available */ + if (hooks->reallocate != NULL) + { + printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); + if (printed == NULL) { + goto fail; + } + buffer->buffer = NULL; + } + else /* otherwise copy the JSON over to a new buffer */ + { + printed = (unsigned char*) hooks->allocate(buffer->offset + 1); + if (printed == NULL) + { + goto fail; + } + memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); + printed[buffer->offset] = '\0'; /* just to be sure */ + + /* free the buffer */ + hooks->deallocate(buffer->buffer); + } + + return printed; + +fail: + if (buffer->buffer != NULL) + { + hooks->deallocate(buffer->buffer); + } + + if (printed != NULL) + { + hooks->deallocate(printed); + } + + return NULL; +} + +/* Render a cJSON item/entity/structure to text. */ +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item) +{ + return (char*)print(item, true, &global_hooks); +} + +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item) +{ + return (char*)print(item, false, &global_hooks); +} + +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt) +{ + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + + if (prebuffer < 0) + { + return NULL; + } + + p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); + if (!p.buffer) + { + return NULL; + } + + p.length = (size_t)prebuffer; + p.offset = 0; + p.noalloc = false; + p.format = fmt; + p.hooks = global_hooks; + + if (!print_value(item, &p)) + { + global_hooks.deallocate(p.buffer); + return NULL; + } + + return (char*)p.buffer; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format) +{ + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + + if ((length < 0) || (buffer == NULL)) + { + return false; + } + + p.buffer = (unsigned char*)buffer; + p.length = (size_t)length; + p.offset = 0; + p.noalloc = true; + p.format = format; + p.hooks = global_hooks; + + return print_value(item, &p); +} + +/* Parser core - when encountering text, process appropriately. */ +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) +{ + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; /* no input */ + } + + /* parse the different types of values */ + /* null */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "null", 4) == 0)) + { + item->type = cJSON_NULL; + input_buffer->offset += 4; + return true; + } + /* false */ + if (can_read(input_buffer, 5) && (strncmp((const char*)buffer_at_offset(input_buffer), "false", 5) == 0)) + { + item->type = cJSON_False; + input_buffer->offset += 5; + return true; + } + /* true */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "true", 4) == 0)) + { + item->type = cJSON_True; + item->valueint = 1; + input_buffer->offset += 4; + return true; + } + /* string */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '\"')) + { + return parse_string(item, input_buffer); + } + /* number */ + if (can_access_at_index(input_buffer, 0) && ((buffer_at_offset(input_buffer)[0] == '-') || ((buffer_at_offset(input_buffer)[0] >= '0') && (buffer_at_offset(input_buffer)[0] <= '9')))) + { + return parse_number(item, input_buffer); + } + /* array */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '[')) + { + return parse_array(item, input_buffer); + } + /* object */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '{')) + { + return parse_object(item, input_buffer); + } + + return false; +} + +/* Render a value to text. */ +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output = NULL; + + if ((item == NULL) || (output_buffer == NULL)) + { + return false; + } + + switch ((item->type) & 0xFF) + { + case cJSON_NULL: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "null"); + return true; + + case cJSON_False: + output = ensure(output_buffer, 6); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "false"); + return true; + + case cJSON_True: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "true"); + return true; + + case cJSON_Number: + return print_number(item, output_buffer); + + case cJSON_Raw: + { + size_t raw_length = 0; + if (item->valuestring == NULL) + { + return false; + } + + raw_length = strlen(item->valuestring) + sizeof(""); + output = ensure(output_buffer, raw_length); + if (output == NULL) + { + return false; + } + memcpy(output, item->valuestring, raw_length); + return true; + } + + case cJSON_String: + return print_string(item, output_buffer); + + case cJSON_Array: + return print_array(item, output_buffer); + + case cJSON_Object: + return print_object(item, output_buffer); + + default: + return false; + } +} + +/* Build an array from input text. */ +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* head of the linked list */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (buffer_at_offset(input_buffer)[0] != '[') + { + /* not an array */ + goto fail; + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ']')) + { + /* empty array */ + goto success; + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse next value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != ']') + { + goto fail; /* expected end of array */ + } + +success: + input_buffer->depth--; + + if (head != NULL) { + head->prev = current_item; + } + + item->type = cJSON_Array; + item->child = head; + + input_buffer->offset++; + + return true; + +fail: + if (head != NULL) + { + cJSON_Delete(head); + } + + return false; +} + +/* Render an array to text */ +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_element = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output array. */ + /* opening square bracket */ + output_pointer = ensure(output_buffer, 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer = '['; + output_buffer->offset++; + output_buffer->depth++; + + while (current_element != NULL) + { + if (!print_value(current_element, output_buffer)) + { + return false; + } + update_offset(output_buffer); + if (current_element->next) + { + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ','; + if(output_buffer->format) + { + *output_pointer++ = ' '; + } + *output_pointer = '\0'; + output_buffer->offset += length; + } + current_element = current_element->next; + } + + output_pointer = ensure(output_buffer, 2); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ']'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; +} + +/* Build an object from the text. */ +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* linked list head */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '{')) + { + goto fail; /* not an object */ + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '}')) + { + goto success; /* empty object */ + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse the name of the child */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_string(current_item, input_buffer)) + { + goto fail; /* fail to parse name */ + } + buffer_skip_whitespace(input_buffer); + + /* swap valuestring and string, because we parsed the name */ + current_item->string = current_item->valuestring; + current_item->valuestring = NULL; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != ':')) + { + goto fail; /* invalid object */ + } + + /* parse the value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}')) + { + goto fail; /* expected end of object */ + } + +success: + input_buffer->depth--; + + if (head != NULL) { + head->prev = current_item; + } + + item->type = cJSON_Object; + item->child = head; + + input_buffer->offset++; + return true; + +fail: + if (head != NULL) + { + cJSON_Delete(head); + } + + return false; +} + +/* Render an object to text. */ +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_item = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output: */ + length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer++ = '{'; + output_buffer->depth++; + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + output_buffer->offset += length; + + while (current_item) + { + if (output_buffer->format) + { + size_t i; + output_pointer = ensure(output_buffer, output_buffer->depth); + if (output_pointer == NULL) + { + return false; + } + for (i = 0; i < output_buffer->depth; i++) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += output_buffer->depth; + } + + /* print key */ + if (!print_string_ptr((unsigned char*)current_item->string, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ':'; + if (output_buffer->format) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += length; + + /* print value */ + if (!print_value(current_item, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + /* print comma if not last */ + length = ((size_t)(output_buffer->format ? 1 : 0) + (size_t)(current_item->next ? 1 : 0)); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + if (current_item->next) + { + *output_pointer++ = ','; + } + + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + *output_pointer = '\0'; + output_buffer->offset += length; + + current_item = current_item->next; + } + + output_pointer = ensure(output_buffer, output_buffer->format ? (output_buffer->depth + 1) : 2); + if (output_pointer == NULL) + { + return false; + } + if (output_buffer->format) + { + size_t i; + for (i = 0; i < (output_buffer->depth - 1); i++) + { + *output_pointer++ = '\t'; + } + } + *output_pointer++ = '}'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; +} + +/* Get Array size/item / object item. */ +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array) +{ + cJSON *child = NULL; + size_t size = 0; + + if (array == NULL) + { + return 0; + } + + child = array->child; + + while(child != NULL) + { + size++; + child = child->next; + } + + /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ + + return (int)size; +} + +static cJSON* get_array_item(const cJSON *array, size_t index) +{ + cJSON *current_child = NULL; + + if (array == NULL) + { + return NULL; + } + + current_child = array->child; + while ((current_child != NULL) && (index > 0)) + { + index--; + current_child = current_child->next; + } + + return current_child; +} + +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index) +{ + if (index < 0) + { + return NULL; + } + + return get_array_item(array, (size_t)index); +} + +static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive) +{ + cJSON *current_element = NULL; + + if ((object == NULL) || (name == NULL)) + { + return NULL; + } + + current_element = object->child; + if (case_sensitive) + { + while ((current_element != NULL) && (current_element->string != NULL) && (strcmp(name, current_element->string) != 0)) + { + current_element = current_element->next; + } + } + else + { + while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0)) + { + current_element = current_element->next; + } + } + + if ((current_element == NULL) || (current_element->string == NULL)) { + return NULL; + } + + return current_element; +} + +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string) +{ + return get_object_item(object, string, false); +} + +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string) +{ + return get_object_item(object, string, true); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) +{ + return cJSON_GetObjectItem(object, string) ? 1 : 0; +} + +/* Utility for array list handling. */ +static void suffix_object(cJSON *prev, cJSON *item) +{ + prev->next = item; + item->prev = prev; +} + +/* Utility for handling references. */ +static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) +{ + cJSON *reference = NULL; + if (item == NULL) + { + return NULL; + } + + reference = cJSON_New_Item(hooks); + if (reference == NULL) + { + return NULL; + } + + memcpy(reference, item, sizeof(cJSON)); + reference->string = NULL; + reference->type |= cJSON_IsReference; + reference->next = reference->prev = NULL; + return reference; +} + +static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) +{ + cJSON *child = NULL; + + if ((item == NULL) || (array == NULL) || (array == item)) + { + return false; + } + + child = array->child; + /* + * To find the last item in array quickly, we use prev in array + */ + if (child == NULL) + { + /* list is empty, start new one */ + array->child = item; + item->prev = item; + item->next = NULL; + } + else + { + /* append to the end */ + if (child->prev) + { + suffix_object(child->prev, item); + array->child->prev = item; + } + } + + return true; +} + +/* Add item to array/object. */ +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item) +{ + return add_item_to_array(array, item); +} + +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic push +#endif +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wcast-qual" +#endif +/* helper function to cast away const */ +static void* cast_away_const(const void* string) +{ + return (void*)string; +} +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic pop +#endif + + +static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool constant_key) +{ + char *new_key = NULL; + int new_type = cJSON_Invalid; + + if ((object == NULL) || (string == NULL) || (item == NULL) || (object == item)) + { + return false; + } + + if (constant_key) + { + new_key = (char*)cast_away_const(string); + new_type = item->type | cJSON_StringIsConst; + } + else + { + new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); + if (new_key == NULL) + { + return false; + } + + new_type = item->type & ~cJSON_StringIsConst; + } + + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + hooks->deallocate(item->string); + } + + item->string = new_key; + item->type = new_type; + + return add_item_to_array(object, item); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) +{ + return add_item_to_object(object, string, item, &global_hooks, false); +} + +/* Add an item to an object with constant string as key */ +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) +{ + return add_item_to_object(object, string, item, &global_hooks, true); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) +{ + if (array == NULL) + { + return false; + } + + return add_item_to_array(array, create_reference(item, &global_hooks)); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) +{ + if ((object == NULL) || (string == NULL)) + { + return false; + } + + return add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false); +} + +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name) +{ + cJSON *null = cJSON_CreateNull(); + if (add_item_to_object(object, name, null, &global_hooks, false)) + { + return null; + } + + cJSON_Delete(null); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name) +{ + cJSON *true_item = cJSON_CreateTrue(); + if (add_item_to_object(object, name, true_item, &global_hooks, false)) + { + return true_item; + } + + cJSON_Delete(true_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name) +{ + cJSON *false_item = cJSON_CreateFalse(); + if (add_item_to_object(object, name, false_item, &global_hooks, false)) + { + return false_item; + } + + cJSON_Delete(false_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean) +{ + cJSON *bool_item = cJSON_CreateBool(boolean); + if (add_item_to_object(object, name, bool_item, &global_hooks, false)) + { + return bool_item; + } + + cJSON_Delete(bool_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number) +{ + cJSON *number_item = cJSON_CreateNumber(number); + if (add_item_to_object(object, name, number_item, &global_hooks, false)) + { + return number_item; + } + + cJSON_Delete(number_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string) +{ + cJSON *string_item = cJSON_CreateString(string); + if (add_item_to_object(object, name, string_item, &global_hooks, false)) + { + return string_item; + } + + cJSON_Delete(string_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw) +{ + cJSON *raw_item = cJSON_CreateRaw(raw); + if (add_item_to_object(object, name, raw_item, &global_hooks, false)) + { + return raw_item; + } + + cJSON_Delete(raw_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name) +{ + cJSON *object_item = cJSON_CreateObject(); + if (add_item_to_object(object, name, object_item, &global_hooks, false)) + { + return object_item; + } + + cJSON_Delete(object_item); + return NULL; +} + +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name) +{ + cJSON *array = cJSON_CreateArray(); + if (add_item_to_object(object, name, array, &global_hooks, false)) + { + return array; + } + + cJSON_Delete(array); + return NULL; +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item) +{ + if ((parent == NULL) || (item == NULL)) + { + return NULL; + } + + if (item != parent->child) + { + /* not the first element */ + item->prev->next = item->next; + } + if (item->next != NULL) + { + /* not the last element */ + item->next->prev = item->prev; + } + + if (item == parent->child) + { + /* first element */ + parent->child = item->next; + } + else if (item->next == NULL) + { + /* last element */ + parent->child->prev = item->prev; + } + + /* make sure the detached item doesn't point anywhere anymore */ + item->prev = NULL; + item->next = NULL; + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which) +{ + if (which < 0) + { + return NULL; + } + + return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which)); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which) +{ + cJSON_Delete(cJSON_DetachItemFromArray(array, which)); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) +{ + cJSON *to_detach = cJSON_GetObjectItem(object, string); + + return cJSON_DetachItemViaPointer(object, to_detach); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) +{ + cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); + + return cJSON_DetachItemViaPointer(object, to_detach); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) +{ + cJSON_Delete(cJSON_DetachItemFromObject(object, string)); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) +{ + cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); +} + +/* Replace array/object items with new ones. */ +CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) +{ + cJSON *after_inserted = NULL; + + if (which < 0) + { + return false; + } + + after_inserted = get_array_item(array, (size_t)which); + if (after_inserted == NULL) + { + return add_item_to_array(array, newitem); + } + + newitem->next = after_inserted; + newitem->prev = after_inserted->prev; + after_inserted->prev = newitem; + if (after_inserted == array->child) + { + array->child = newitem; + } + else + { + newitem->prev->next = newitem; + } + return true; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement) +{ + if ((parent == NULL) || (replacement == NULL) || (item == NULL)) + { + return false; + } + + if (replacement == item) + { + return true; + } + + replacement->next = item->next; + replacement->prev = item->prev; + + if (replacement->next != NULL) + { + replacement->next->prev = replacement; + } + if (parent->child == item) + { + if (parent->child->prev == parent->child) + { + replacement->prev = replacement; + } + parent->child = replacement; + } + else + { /* + * To find the last item in array quickly, we use prev in array. + * We can't modify the last item's next pointer where this item was the parent's child + */ + if (replacement->prev != NULL) + { + replacement->prev->next = replacement; + } + if (replacement->next == NULL) + { + parent->child->prev = replacement; + } + } + + item->next = NULL; + item->prev = NULL; + cJSON_Delete(item); + + return true; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) +{ + if (which < 0) + { + return false; + } + + return cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); +} + +static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) +{ + if ((replacement == NULL) || (string == NULL)) + { + return false; + } + + /* replace the name in the replacement */ + if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL)) + { + cJSON_free(replacement->string); + } + replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + if (replacement->string == NULL) + { + return false; + } + + replacement->type &= ~cJSON_StringIsConst; + + return cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) +{ + return replace_item_in_object(object, string, newitem, false); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) +{ + return replace_item_in_object(object, string, newitem, true); +} + +/* Create basic types: */ +CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_NULL; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_True; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_False; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = boolean ? cJSON_True : cJSON_False; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Number; + item->valuedouble = num; + + /* use saturation in case of overflow */ + if (num >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (num <= (double)INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)num; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_String; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) + { + item->type = cJSON_String | cJSON_IsReference; + item->valuestring = (char*)cast_away_const(string); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Object | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child) { + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Array | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Raw; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type=cJSON_Array; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item) + { + item->type = cJSON_Object; + } + + return item; +} + +/* Create Arrays: */ +CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if (!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + if (a && a->child) { + a->child->prev = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber((double)numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + if (a && a->child) { + a->child->prev = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + if (a && a->child) { + a->child->prev = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (strings == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for (i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateString(strings[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p,n); + } + p = n; + } + + if (a && a->child) { + a->child->prev = n; + } + + return a; +} + +/* Duplication */ +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse) +{ + cJSON *newitem = NULL; + cJSON *child = NULL; + cJSON *next = NULL; + cJSON *newchild = NULL; + + /* Bail on bad ptr */ + if (!item) + { + goto fail; + } + /* Create new item */ + newitem = cJSON_New_Item(&global_hooks); + if (!newitem) + { + goto fail; + } + /* Copy over all vars */ + newitem->type = item->type & (~cJSON_IsReference); + newitem->valueint = item->valueint; + newitem->valuedouble = item->valuedouble; + if (item->valuestring) + { + newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); + if (!newitem->valuestring) + { + goto fail; + } + } + if (item->string) + { + newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); + if (!newitem->string) + { + goto fail; + } + } + /* If non-recursive, then we're done! */ + if (!recurse) + { + return newitem; + } + /* Walk the ->next chain for the child. */ + child = item->child; + while (child != NULL) + { + newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ + if (!newchild) + { + goto fail; + } + if (next != NULL) + { + /* If newitem->child already set, then crosswire ->prev and ->next and move on */ + next->next = newchild; + newchild->prev = next; + next = newchild; + } + else + { + /* Set newitem->child and move to it */ + newitem->child = newchild; + next = newchild; + } + child = child->next; + } + if (newitem && newitem->child) + { + newitem->child->prev = newchild; + } + + return newitem; + +fail: + if (newitem != NULL) + { + cJSON_Delete(newitem); + } + + return NULL; +} + +static void skip_oneline_comment(char **input) +{ + *input += static_strlen("//"); + + for (; (*input)[0] != '\0'; ++(*input)) + { + if ((*input)[0] == '\n') { + *input += static_strlen("\n"); + return; + } + } +} + +static void skip_multiline_comment(char **input) +{ + *input += static_strlen("/*"); + + for (; (*input)[0] != '\0'; ++(*input)) + { + if (((*input)[0] == '*') && ((*input)[1] == '/')) + { + *input += static_strlen("*/"); + return; + } + } +} + +static void minify_string(char **input, char **output) { + (*output)[0] = (*input)[0]; + *input += static_strlen("\""); + *output += static_strlen("\""); + + + for (; (*input)[0] != '\0'; (void)++(*input), ++(*output)) { + (*output)[0] = (*input)[0]; + + if ((*input)[0] == '\"') { + (*output)[0] = '\"'; + *input += static_strlen("\""); + *output += static_strlen("\""); + return; + } else if (((*input)[0] == '\\') && ((*input)[1] == '\"')) { + (*output)[1] = (*input)[1]; + *input += static_strlen("\""); + *output += static_strlen("\""); + } + } +} + +CJSON_PUBLIC(void) cJSON_Minify(char *json) +{ + char *into = json; + + if (json == NULL) + { + return; + } + + while (json[0] != '\0') + { + switch (json[0]) + { + case ' ': + case '\t': + case '\r': + case '\n': + json++; + break; + + case '/': + if (json[1] == '/') + { + skip_oneline_comment(&json); + } + else if (json[1] == '*') + { + skip_multiline_comment(&json); + } else { + json++; + } + break; + + case '\"': + minify_string(&json, (char**)&into); + break; + + default: + into[0] = json[0]; + json++; + into++; + } + } + + /* and null-terminate. */ + *into = '\0'; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Invalid; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_False; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xff) == cJSON_True; +} + + +CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & (cJSON_True | cJSON_False)) != 0; +} +CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_NULL; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Number; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_String; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Array; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Object; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Raw; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive) +{ + if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF))) + { + return false; + } + + /* check if type is valid */ + switch (a->type & 0xFF) + { + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + case cJSON_Number: + case cJSON_String: + case cJSON_Raw: + case cJSON_Array: + case cJSON_Object: + break; + + default: + return false; + } + + /* identical objects are equal */ + if (a == b) + { + return true; + } + + switch (a->type & 0xFF) + { + /* in these cases and equal type is enough */ + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + return true; + + case cJSON_Number: + if (compare_double(a->valuedouble, b->valuedouble)) + { + return true; + } + return false; + + case cJSON_String: + case cJSON_Raw: + if ((a->valuestring == NULL) || (b->valuestring == NULL)) + { + return false; + } + if (strcmp(a->valuestring, b->valuestring) == 0) + { + return true; + } + + return false; + + case cJSON_Array: + { + cJSON *a_element = a->child; + cJSON *b_element = b->child; + + for (; (a_element != NULL) && (b_element != NULL);) + { + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + + a_element = a_element->next; + b_element = b_element->next; + } + + /* one of the arrays is longer than the other */ + if (a_element != b_element) { + return false; + } + + return true; + } + + case cJSON_Object: + { + cJSON *a_element = NULL; + cJSON *b_element = NULL; + cJSON_ArrayForEach(a_element, a) + { + /* TODO This has O(n^2) runtime, which is horrible! */ + b_element = get_object_item(b, a_element->string, case_sensitive); + if (b_element == NULL) + { + return false; + } + + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + } + + /* doing this twice, once on a and b to prevent true comparison if a subset of b + * TODO: Do this the proper way, this is just a fix for now */ + cJSON_ArrayForEach(b_element, b) + { + a_element = get_object_item(a, b_element->string, case_sensitive); + if (a_element == NULL) + { + return false; + } + + if (!cJSON_Compare(b_element, a_element, case_sensitive)) + { + return false; + } + } + + return true; + } + + default: + return false; + } +} + +CJSON_PUBLIC(void *) cJSON_malloc(size_t size) +{ + return global_hooks.allocate(size); +} + +CJSON_PUBLIC(void) cJSON_free(void *object) +{ + global_hooks.deallocate(object); +} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/cJSON.h.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/cJSON.h.mustache new file mode 100644 index 000000000..95a9cf69d --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/cJSON.h.mustache @@ -0,0 +1,300 @@ +/* + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#ifndef cJSON__h +#define cJSON__h + +#ifdef __cplusplus +extern "C" +{ +#endif + +#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) +#define __WINDOWS__ +#endif + +#ifdef __WINDOWS__ + +/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 3 define options: + +CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols +CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) +CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol + +For *nix builds that support visibility attribute, you can define similar behavior by + +setting default visibility to hidden by adding +-fvisibility=hidden (for gcc) +or +-xldscope=hidden (for sun cc) +to CFLAGS + +then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does + +*/ + +#define CJSON_CDECL __cdecl +#define CJSON_STDCALL __stdcall + +/* export symbols by default, this is necessary for copy pasting the C and header file */ +#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS) +#define CJSON_EXPORT_SYMBOLS +#endif + +#if defined(CJSON_HIDE_SYMBOLS) +#define CJSON_PUBLIC(type) type CJSON_STDCALL +#elif defined(CJSON_EXPORT_SYMBOLS) +#define CJSON_PUBLIC(type) __declspec(dllexport) type CJSON_STDCALL +#elif defined(CJSON_IMPORT_SYMBOLS) +#define CJSON_PUBLIC(type) __declspec(dllimport) type CJSON_STDCALL +#endif +#else /* !__WINDOWS__ */ +#define CJSON_CDECL +#define CJSON_STDCALL + +#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY) +#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type +#else +#define CJSON_PUBLIC(type) type +#endif +#endif + +/* project version */ +#define CJSON_VERSION_MAJOR 1 +#define CJSON_VERSION_MINOR 7 +#define CJSON_VERSION_PATCH 15 + +#include + +/* cJSON Types: */ +#define cJSON_Invalid (0) +#define cJSON_False (1 << 0) +#define cJSON_True (1 << 1) +#define cJSON_NULL (1 << 2) +#define cJSON_Number (1 << 3) +#define cJSON_String (1 << 4) +#define cJSON_Array (1 << 5) +#define cJSON_Object (1 << 6) +#define cJSON_Raw (1 << 7) /* raw json */ + +#define cJSON_IsReference 256 +#define cJSON_StringIsConst 512 + +/* The cJSON structure: */ +typedef struct cJSON +{ + /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ + struct cJSON *next; + struct cJSON *prev; + /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ + struct cJSON *child; + + /* The type of the item, as above. */ + int type; + + /* The item's string, if type==cJSON_String and type == cJSON_Raw */ + char *valuestring; + /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ + int valueint; + /* The item's number, if type==cJSON_Number */ + double valuedouble; + + /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ + char *string; +} cJSON; + +typedef struct cJSON_Hooks +{ + /* malloc/free are CDECL on Windows regardless of the default calling convention of the compiler, so ensure the hooks allow passing those functions directly. */ + void *(CJSON_CDECL *malloc_fn)(size_t sz); + void (CJSON_CDECL *free_fn)(void *ptr); +} cJSON_Hooks; + +typedef int cJSON_bool; + +/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them. + * This is to prevent stack overflows. */ +#ifndef CJSON_NESTING_LIMIT +#define CJSON_NESTING_LIMIT 1000 +#endif + +/* returns the version of cJSON as a string */ +CJSON_PUBLIC(const char*) cJSON_Version(void); + +/* Supply malloc, realloc and free functions to cJSON */ +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks); + +/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */ +/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */ +CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value); +CJSON_PUBLIC(cJSON *) cJSON_ParseWithLength(const char *value, size_t buffer_length); +/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ +/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */ +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated); +CJSON_PUBLIC(cJSON *) cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated); + +/* Render a cJSON entity to text for transfer/storage. */ +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item); +/* Render a cJSON entity to text for transfer/storage without any formatting. */ +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); +/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); +/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ +/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); +/* Delete a cJSON entity and all subentities. */ +CJSON_PUBLIC(void) cJSON_Delete(cJSON *item); + +/* Returns the number of items in an array (or object). */ +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); +/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */ +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index); +/* Get item "string" from object. Case insensitive. */ +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string); +/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ +CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); + +/* Check item type and return its value */ +CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item); +CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item); + +/* These functions check the type of an item */ +CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item); + +/* These calls create a cJSON item of the appropriate type. */ +CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean); +CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num); +CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string); +/* raw json */ +CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw); +CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void); + +/* Create a string where valuestring references a string so + * it will not be freed by cJSON_Delete */ +CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string); +/* Create an object/array that only references it's elements so + * they will not be freed by cJSON_Delete */ +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child); +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child); + +/* These utilities create an Array of count items. + * The parameter count cannot be greater than the number of elements in the number array, otherwise array access will be out of bounds.*/ +CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count); + +/* Append item to the specified array/object. */ +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); +/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. + * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before + * writing to `item->string` */ +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); +/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); + +/* Remove/Detach items from Arrays/Objects. */ +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string); + +/* Update array items. */ +CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); + +/* Duplicate a cJSON item */ +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse); +/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will + * need to be released. With recurse!=0, it will duplicate any children connected to the item. + * The item->next and ->prev pointers are always zero on return from Duplicate. */ +/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal. + * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */ +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive); + +/* Minify a strings, remove blank characters(such as ' ', '\t', '\r', '\n') from strings. + * The input pointer json cannot point to a read-only address area, such as a string constant, + * but should point to a readable and writable address area. */ +CJSON_PUBLIC(void) cJSON_Minify(char *json); + +/* Helper functions for creating and adding items to an object at the same time. + * They return the added item or NULL on failure. */ +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean); +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number); +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string); +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw); +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name); + +/* When assigning an integer value, it needs to be propagated to valuedouble too. */ +#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) +/* helper for the cJSON_SetNumberValue macro */ +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); +#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) +/* Change the valuestring of a cJSON_String object, only takes effect when type of object is cJSON_String */ +CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring); + +/* If the object is not a boolean type this does nothing and returns cJSON_Invalid else it returns the new type*/ +#define cJSON_SetBoolValue(object, boolValue) ( \ + (object != NULL && ((object)->type & (cJSON_False|cJSON_True))) ? \ + (object)->type=((object)->type &(~(cJSON_False|cJSON_True)))|((boolValue)?cJSON_True:cJSON_False) : \ + cJSON_Invalid\ +) + +/* Macro for iterating over an array or object */ +#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) + +/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */ +CJSON_PUBLIC(void *) cJSON_malloc(size_t size); +CJSON_PUBLIC(void) cJSON_free(void *object); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/keyValuePair.h.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/keyValuePair.h.mustache new file mode 100644 index 000000000..6dc64371a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/keyValuePair.h.mustache @@ -0,0 +1,25 @@ +#ifndef OGS_SBI_MAP_H +#define OGS_SBI_MAP_H + +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_map_s { + char *key; + void *value; +} OpenAPI_map_t; + +OpenAPI_map_t *OpenAPI_map_create(char *key, void *value); + +OpenAPI_map_t *OpenAPI_map_create_allocate(char *key, double value); + +void OpenAPI_map_free(OpenAPI_map_t *OpenAPI_map); + +#ifdef __cplusplus +} +#endif + +#endif /* OGS_SBI_MAP_H */ diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/list.c.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/list.c.mustache new file mode 100644 index 000000000..c009e8a1a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/list.c.mustache @@ -0,0 +1,241 @@ +#include +#include +#include + +#include "../include/list.h" +static OpenAPI_lnode_t *listEntry_create(void *data) +{ + OpenAPI_lnode_t *created = NULL; + + ogs_assert(data); + + created = ogs_malloc(sizeof(OpenAPI_lnode_t)); + ogs_assert(created); + + if (created == NULL) { + ogs_assert_if_reached(); + return NULL; + } + created->data = data; + + return created; +} + +void OpenAPI_lnode_free(OpenAPI_lnode_t *listEntry, void *additionalData) +{ + ogs_free(listEntry); +} + +void OpenAPI_lnode_print(OpenAPI_lnode_t *listEntry, void *additionalData) +{ + printf("%i\n", *((int *) (listEntry->data))); +} + +OpenAPI_list_t *OpenAPI_list_create(void) +{ + OpenAPI_list_t *createdList = ogs_malloc(sizeof(OpenAPI_list_t)); + ogs_assert(createdList); + + if (createdList == NULL) { + ogs_assert_if_reached(); + return NULL; + } + createdList->first = NULL; + createdList->last = NULL; + createdList->count = 0; + + return createdList; +} + +void OpenAPI_list_iterate_forward(OpenAPI_list_t *list, + void (*operationToPerform)( + OpenAPI_lnode_t *, void *callbackFunctionUsedData), + void *additionalDataNeededForCallbackFunction) +{ + OpenAPI_lnode_t *current = list->first; + OpenAPI_lnode_t *next; + + if (current == NULL) { + return; + } + + next = current->next; + + operationToPerform(current, additionalDataNeededForCallbackFunction); + current = next; + + while (current != NULL) { + next = current->next; + operationToPerform(current, additionalDataNeededForCallbackFunction); + current = next; + } +} + +void OpenAPI_list_iterate_backward(OpenAPI_list_t *list, + void (*operationToPerform)( + OpenAPI_lnode_t *, void *callbackFunctionUsedData), + void *additionalDataNeededForCallbackFunction) +{ + OpenAPI_lnode_t *current = list->last; + OpenAPI_lnode_t *next = current->prev; + + if (current == NULL) { + return; + } + + operationToPerform(current, additionalDataNeededForCallbackFunction); + current = next; + + while (current != NULL) { + next = current->prev; + operationToPerform(current, additionalDataNeededForCallbackFunction); + current = next; + } +} + +void OpenAPI_list_free(OpenAPI_list_t *list) +{ + if (list){ + OpenAPI_list_iterate_forward(list, OpenAPI_lnode_free, NULL); + ogs_free(list); + } +} + +void OpenAPI_list_clear(OpenAPI_list_t *list) +{ + if (list) { + OpenAPI_list_iterate_forward(list, OpenAPI_lnode_free, NULL); + list->first = NULL; + list->last = NULL; + list->count = 0; + } +} + +void OpenAPI_list_add(OpenAPI_list_t *list, void *dataToAddInList) +{ + OpenAPI_lnode_t *newListEntry = listEntry_create(dataToAddInList); + if (newListEntry == NULL) { + ogs_assert_if_reached(); + return; + } + if (list->first == NULL) { + list->first = newListEntry; + list->last = newListEntry; + + newListEntry->prev = NULL; + newListEntry->next = NULL; + + list->count++; + + return; + } + + list->last->next = newListEntry; + newListEntry->prev = list->last; + newListEntry->next = NULL; + list->last = newListEntry; + + list->count++; +} + +void OpenAPI_list_insert_prev(OpenAPI_list_t *list, OpenAPI_lnode_t *lnode, + void *dataToAddInList) +{ + OpenAPI_lnode_t *newListEntry = listEntry_create(dataToAddInList); + if (newListEntry == NULL) { + ogs_assert_if_reached(); + return; + } else if (lnode->prev == NULL) { + list->first = newListEntry; + lnode->prev = newListEntry; + newListEntry->prev = NULL; + newListEntry->next = lnode; + } else { + lnode->prev->next = newListEntry; + newListEntry->prev = lnode->prev; + newListEntry->next = lnode; + lnode->prev = newListEntry; + } + list->count++; +} + +void OpenAPI_list_remove(OpenAPI_list_t *list, OpenAPI_lnode_t *elementToRemove) +{ + OpenAPI_lnode_t *elementBeforeElementToRemove = elementToRemove->prev; + OpenAPI_lnode_t *elementAfterElementToRemove = elementToRemove->next; + + if (elementBeforeElementToRemove != NULL) { + elementBeforeElementToRemove->next = elementAfterElementToRemove; + } else { + list->first = elementAfterElementToRemove; + } + + if (elementAfterElementToRemove != NULL) { + elementAfterElementToRemove->prev = elementBeforeElementToRemove; + } else { + list->last = elementBeforeElementToRemove; + } + + OpenAPI_lnode_free(elementToRemove, NULL); + + list->count--; +} + +OpenAPI_lnode_t *OpenAPI_list_find(OpenAPI_list_t *list, long indexOfElement) +{ + OpenAPI_lnode_t *current; + int i; + + if ((list->count / 2) > indexOfElement) { + current = list->first; + + for(i = 0; i < indexOfElement; i++) { + current = current->next; + } + + return current; + } else { + current = list->last; + + for(i = 1; i < (list->count - indexOfElement); i++) { + current = current->prev; + } + + return current; + } +} + +char *OpenAPI_findStrInStrList(OpenAPI_list_t *strList, const char *str) +{ + OpenAPI_lnode_t *listEntry = NULL; + + if (!strList || !str) { + return NULL; + } + + OpenAPI_list_for_each(strList, listEntry) { + ogs_assert(listEntry); + if (strstr((char*)listEntry->data, str) != NULL) { + return (char*)listEntry->data; + } + } + + return NULL; +} + +void OpenAPI_clear_and_free_string_list(OpenAPI_list_t *list) +{ + OpenAPI_lnode_t *listEntry = NULL; + + if (!list) { + return; + } + + OpenAPI_list_for_each(list, listEntry) { + ogs_assert(listEntry); + char *list_item = listEntry->data; + ogs_free(list_item); + list_item = NULL; + } + OpenAPI_list_free(list); +} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/list.h.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/list.h.mustache new file mode 100644 index 000000000..b8690be77 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/list.h.mustache @@ -0,0 +1,58 @@ +#ifndef OGS_SBI_LIST_H +#define OGS_SBI_LIST_H + +#include "../external/cJSON.h" +#include "ogs-core.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_list_s OpenAPI_list_t; + +typedef struct OpenAPI_lnode_s OpenAPI_lnode_t; + +struct OpenAPI_lnode_s { + OpenAPI_lnode_t *next; + OpenAPI_lnode_t *prev; + void *data; +}; + +typedef struct OpenAPI_list_s { + OpenAPI_lnode_t *first; + OpenAPI_lnode_t *last; + + long count; +} OpenAPI_list_t; + +#define OpenAPI_list_for_each(list, element) for(element = (list != NULL) ? (list)->first : NULL; element != NULL; element = element->next) + +OpenAPI_list_t *OpenAPI_list_create(void); +void OpenAPI_list_free(OpenAPI_list_t *listToFree); +void OpenAPI_list_clear(OpenAPI_list_t *list); + +void OpenAPI_list_add(OpenAPI_list_t *list, void *dataToAddInList); +void OpenAPI_list_insert_prev( + OpenAPI_list_t *list, OpenAPI_lnode_t *lnode, void *dataToAddInList); +OpenAPI_lnode_t *OpenAPI_list_find(OpenAPI_list_t *list, long indexOfElement); +void OpenAPI_list_remove( + OpenAPI_list_t *list, OpenAPI_lnode_t *elementToRemove); + +void OpenAPI_list_iterate_forward(OpenAPI_list_t *list, + void (*operationToPerform)(OpenAPI_lnode_t*, void*), + void *additionalDataNeededForCallbackFunction); +void OpenAPI_list_iterate_backward(OpenAPI_list_t *list, + void (*operationToPerform)(OpenAPI_lnode_t*, void*), + void *additionalDataNeededForCallbackFunction); + +void OpenAPI_lnode_print(OpenAPI_lnode_t *listEntry, void *additionalData); +void OpenAPI_lnode_free(OpenAPI_lnode_t *listEntry, void *additionalData); + +char *OpenAPI_findStrInStrList(OpenAPI_list_t *strList, const char *str); +void OpenAPI_clear_and_free_string_list(OpenAPI_list_t *list); + +#ifdef __cplusplus +} +#endif + +#endif // OGS_SBI_LIST_H diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/model-body.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/model-body.mustache new file mode 100644 index 000000000..4621a94ec --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/model-body.mustache @@ -0,0 +1,1082 @@ +{{#models}}{{#model}} +#include +#include +#include +#include "{{classname}}.h" + +{{#isEnum}} +char* OpenAPI_{{classname}}_ToString(OpenAPI_{{classVarName}}_e {{classname}}) +{ + const char *{{classname}}Array[] = { "NULL"{{#allowableValues}}{{#values}}, "{{.}}"{{/values}}{{/allowableValues}} }; + size_t sizeofArray = sizeof({{classname}}Array) / sizeof({{classname}}Array[0]); + if ({{classname}} < sizeofArray) + return (char *){{classname}}Array[{{classname}}]; + else + return (char *)"Unknown"; +} + +OpenAPI_{{classVarName}}_e OpenAPI_{{classname}}_FromString(char* {{classname}}) +{ + int stringToReturn = 0; + const char *{{classname}}Array[] = { "NULL"{{#allowableValues}}{{#values}}, "{{.}}"{{/values}}{{/allowableValues}} }; + size_t sizeofArray = sizeof({{classname}}Array) / sizeof({{classname}}Array[0]); + while (stringToReturn < sizeofArray) { + if (strcmp({{classname}}, {{classname}}Array[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} +{{/isEnum}} +{{^isEnum}} +{{#vars}} + {{^isContainer}} + {{#isPrimitiveType}} + {{#isEnum}} +char *OpenAPI_{{name}}{{classname}}_ToString(OpenAPI_{{classVarName}}_{{name}}_e {{name}}) +{ + const char *{{name}}Array[] = { "NULL"{{#allowableValues}}{{#values}}, "{{.}}"{{/values}}{{/allowableValues}} }; + size_t sizeofArray = sizeof({{name}}Array) / sizeof({{name}}Array[0]); + if ({{name}} < sizeofArray) + return (char *){{name}}Array[{{name}}]; + else + return (char *)"Unknown"; +} + +OpenAPI_{{classVarName}}_{{name}}_e OpenAPI_{{name}}{{classname}}_FromString(char* {{name}}) +{ + int stringToReturn = 0; + const char *{{name}}Array[] = { "NULL"{{#allowableValues}}{{#values}}, "{{.}}"{{/values}}{{/allowableValues}} }; + size_t sizeofArray = sizeof({{name}}Array) / sizeof({{name}}Array[0]); + while (stringToReturn < sizeofArray) { + if (strcmp({{name}}, {{name}}Array[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; +} + {{/isEnum}} + {{/isPrimitiveType}} + {{/isContainer}} +{{/vars}} +OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create( +{{#vars}} + {{^isContainer}} + {{^isPrimitiveType}} + {{#isEnum}} + OpenAPI_{{datatype}}_e {{name}}{{^-last}},{{/-last}} + {{/isEnum}} + {{^isEnum}} + {{#isModel}} + OpenAPI_{{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isModel}} + {{^isModel}} + {{#isUuid}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isUuid}} + {{#isEmail}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isEmail}} + {{#isFreeFormObject}} + OpenAPI_{{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{#isAnyType}} + OpenAPI_{{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{#isEnum}} + OpenAPI_{{classVarName}}_{{name}}_e {{name}}{{^-last}},{{/-last}} + {{/isEnum}} + {{^isEnum}} + {{#isString}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isString}} + {{#isByteArray}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isByteArray}} + {{#isNumeric}} + {{^required}} + bool is_{{name}}, + {{/required}} + {{datatype}} {{name}}{{^-last}},{{/-last}} + {{/isNumeric}} + {{#isBoolean}} + {{^required}} + bool is_{{name}}, + {{/required}} + {{datatype}} {{name}}{{^-last}},{{/-last}} + {{/isBoolean}} + {{/isEnum}} + {{#isBinary}} + OpenAPI_{{datatype}} {{name}}{{^-last}},{{/-last}} + {{/isBinary}} + {{#isDate}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isDate}} + {{#isDateTime}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isDateTime}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + OpenAPI_{{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isArray}} + {{#isMap}} + OpenAPI_{{datatype}} {{name}}{{^-last}},{{/-last}} + {{/isMap}} + {{/isContainer}} +{{/vars}}) +{ + OpenAPI_{{classname}}_t *{{classname}}_local_var = ogs_malloc(sizeof(OpenAPI_{{classname}}_t)); + ogs_assert({{classname}}_local_var); + +{{#vars}} + {{^isContainer}} + {{#isPrimitiveType}} + {{^isEnum}} + {{#isNumeric}} + {{^required}} + {{classname}}_local_var->is_{{{name}}} = is_{{{name}}}; + {{/required}} + {{/isNumeric}} + {{#isBoolean}} + {{^required}} + {{classname}}_local_var->is_{{{name}}} = is_{{{name}}}; + {{/required}} + {{/isBoolean}} + {{/isEnum}} + {{/isPrimitiveType}} + {{/isContainer}} + {{classname}}_local_var->{{{name}}} = {{{name}}}; +{{/vars}} + + return {{classname}}_local_var; +} + +void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}}) +{ + OpenAPI_lnode_t *node = NULL; + + if (NULL == {{classname}}) { + return; + } +{{#vars}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnum}} + {{#isModel}} + if ({{{classname}}}->{{{name}}}) { + OpenAPI_{{{complexType}}}_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isModel}} + {{^isModel}} + {{#isUuid}} + if ({{{classname}}}->{{{name}}}) { + ogs_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isUuid}} + {{#isEmail}} + if ({{{classname}}}->{{{name}}}) { + ogs_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isEmail}} + {{#isFreeFormObject}} + if ({{{classname}}}->{{{name}}}) { + OpenAPI_{{{datatype}}}_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isFreeFormObject}} + {{#isAnyType}} + if ({{{classname}}}->{{{name}}}) { + OpenAPI_{{{datatype}}}_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{^isEnum}} + {{#isString}} + if ({{{classname}}}->{{{name}}}) { + ogs_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isString}} + {{#isByteArray}} + if ({{{classname}}}->{{{name}}}) { + ogs_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isByteArray}} + {{/isEnum}} + {{#isBinary}} + if ({{{classname}}}->{{{name}}}) { + ogs_free({{{classname}}}->{{{name}}}->data); + {{classname}}->{{name}} = NULL; + } + {{/isBinary}} + {{#isDate}} + if ({{{classname}}}->{{{name}}}) { + ogs_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isDate}} + {{#isDateTime}} + if ({{{classname}}}->{{{name}}}) { + ogs_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isDateTime}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + if ({{{classname}}}->{{{name}}}) { + {{^isEnum}} + OpenAPI_list_for_each({{classname}}->{{name}}, node) { + {{#isPrimitiveType}} + ogs_free(node->data); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + OpenAPI_{{complexType}}_free(node->data); + {{/isPrimitiveType}} + } + {{/isEnum}} + OpenAPI_list_free({{classname}}->{{name}}); + {{classname}}->{{name}} = NULL; + } + {{/isArray}} + {{#isMap}} + if ({{{classname}}}->{{{name}}}) { + OpenAPI_list_for_each({{classname}}->{{name}}, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + ogs_free(localKeyValue->key); + {{^isEnum}} + {{#isPrimitiveType}} + ogs_free(localKeyValue->value); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + OpenAPI_{{complexType}}_free(localKeyValue->value); + {{/isPrimitiveType}} + {{/isEnum}} + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free({{classname}}->{{name}}); + {{classname}}->{{name}} = NULL; + } + {{/isMap}} + {{/isContainer}} +{{/vars}} + ogs_free({{classname}}); +} + +cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}}) +{ + cJSON *item = NULL; + OpenAPI_lnode_t *node = NULL; + + if ({{classname}} == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + return NULL; + } + + item = cJSON_CreateObject(); +{{#vars}} + {{#required}} + {{^isEnum}} + {{^isNumeric}} + {{^isBoolean}} + if (!{{{classname}}}->{{{name}}}) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + return NULL; + } + {{/isBoolean}} + {{/isNumeric}} + {{/isEnum}} + {{#isEnum}} + {{#isPrimitiveType}} + if ({{{classname}}}->{{{name}}} == OpenAPI_{{classVarName}}_{{enumName}}_NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + return NULL; + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if ({{{classname}}}->{{{name}}} == OpenAPI_{{{complexType}}}_NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + return NULL; + } + {{/isPrimitiveType}} + {{/isEnum}} + {{/required}} + {{^required}} + {{^isEnum}} + {{#isNumeric}} + if ({{{classname}}}->is_{{{name}}}) { + {{/isNumeric}} + {{#isBoolean}} + if ({{{classname}}}->is_{{{name}}}) { + {{/isBoolean}} + {{^isNumeric}} + {{^isBoolean}} + if ({{{classname}}}->{{{name}}}) { + {{/isBoolean}} + {{/isNumeric}} + {{/isEnum}} + {{#isEnum}} + {{#isPrimitiveType}} + if ({{{classname}}}->{{{name}}} != OpenAPI_{{classVarName}}_{{enumName}}_NULL) { + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if ({{{classname}}}->{{{name}}} != OpenAPI_{{{complexType}}}_NULL) { + {{/isPrimitiveType}} + {{/isEnum}} + {{/required}} + {{^isContainer}} + {{#isPrimitiveType}} + {{#isEnum}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", OpenAPI_{{{name}}}{{classname}}_ToString({{{classname}}}->{{{name}}})) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isEnum}} + {{^isEnum}} + {{#isString}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isString}} + {{#isByteArray}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isByteArray}} + {{#isNumeric}} + if (cJSON_AddNumberToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isNumeric}} + {{#isBoolean}} + if (cJSON_AddBoolToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isBoolean}} + {{/isEnum}} + {{#isBinary}} + char* encoded_str_{{{name}}} = OpenAPI_base64encode({{{classname}}}->{{{name}}}->data,{{{classname}}}->{{{name}}}->len); + if (cJSON_AddStringToObject(item, "{{{baseName}}}", encoded_str_{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + ogs_free(encoded_str_{{{name}}}); + {{/isBinary}} + {{#isDate}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isDate}} + {{#isDateTime}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isDateTime}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isEnum}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", OpenAPI_{{{complexType}}}_ToString({{{classname}}}->{{{name}}})) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isEnum}} + {{^isEnum}} + {{#isModel}} + cJSON *{{{name}}}_local_JSON = OpenAPI_{{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_convertToJSON({{{classname}}}->{{{name}}}); + if ({{{name}}}_local_JSON == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + cJSON_AddItemToObject(item, "{{{baseName}}}", {{{name}}}_local_JSON); + if (item->child == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isModel}} + {{^isModel}} + {{#isUuid}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isUuid}} + {{#isEmail}} + if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isEmail}} + {{#isFreeFormObject}} + cJSON *{{{name}}}_object = OpenAPI_object_convertToJSON({{{classname}}}->{{{name}}}); + if ({{{name}}}_object == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + cJSON_AddItemToObject(item, "{{{baseName}}}", {{{name}}}_object); + if (item->child == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isFreeFormObject}} + {{#isAnyType}} + cJSON *{{{name}}}_object = OpenAPI_any_type_convertToJSON({{{classname}}}->{{{name}}}); + if ({{{name}}}_object == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + cJSON_AddItemToObject(item, "{{{baseName}}}", {{{name}}}_object); + if (item->child == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + cJSON *{{{name}}}List = cJSON_AddArrayToObject(item, "{{{baseName}}}"); + if ({{{name}}}List == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + OpenAPI_list_for_each({{classname}}->{{{name}}}, node) { + {{#isEnum}} + if (cJSON_AddStringToObject({{{name}}}List, "", OpenAPI_{{{complexType}}}_ToString((intptr_t)node->data)) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isEnum}} + {{^isEnum}} + {{#items}} + {{#isPrimitiveType}} + {{#isString}} + if (cJSON_AddStringToObject({{{name}}}List, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isString}} + {{#isByteArray}} + if (cJSON_AddStringToObject({{{name}}}List, "", (char*)node->data) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isByteArray}} + {{#isNumeric}} + if (cJSON_AddNumberToObject({{{name}}}List, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isNumeric}} + {{#isBoolean}} + if (cJSON_AddBoolToObject({{{name}}}List, "", (uintptr_t)node->data) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isBoolean}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + cJSON *itemLocal = OpenAPI_{{complexType}}_convertToJSON(node->data); + if (itemLocal == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + cJSON_AddItemToArray({{{name}}}List, itemLocal); + {{/isPrimitiveType}} + {{/items}} + {{/isEnum}} + } + {{/isArray}} + {{#isMap}} + cJSON *{{{name}}} = cJSON_AddObjectToObject(item, "{{{baseName}}}"); + if ({{{name}}} == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + cJSON *localMapObject = {{{name}}}; + if ({{{classname}}}->{{{name}}}) { + OpenAPI_list_for_each({{{classname}}}->{{{name}}}, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data; + {{#isEnum}} + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, OpenAPI_{{{complexType}}}_ToString((intptr_t)localKeyValue->value)) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isEnum}} + {{^isEnum}} + {{#items}} + {{#isPrimitiveType}} + {{#isString}} + if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isString}} + {{#isByteArray}} + if(cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isByteArray}} + {{#isNumeric}} + if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, (uintptr_t)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isNumeric}} + {{#isBoolean}} + if (cJSON_AddBoolToObject(localMapObject, localKeyValue->key, (uintptr_t)localKeyValue->value) == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + {{/isBoolean}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + cJSON *itemLocal = localKeyValue->value ? + OpenAPI_{{complexType}}_convertToJSON(localKeyValue->value) : + cJSON_CreateNull(); + if (itemLocal == NULL) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]"); + goto end; + } + cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal); + {{/isPrimitiveType}} + {{/items}} + {{/isEnum}} + } + } + {{/isMap}} + {{/isContainer}} + {{^required}} + } + {{/required}} + +{{/vars}} +end: + return item; +} + +OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON) +{ + OpenAPI_{{classname}}_t *{{classname}}_local_var = NULL; + OpenAPI_lnode_t *node = NULL; +{{#vars}} + cJSON *{{{name}}} = NULL; + {{^isContainer}} + {{#isPrimitiveType}} + {{#isEnum}} + OpenAPI_{{classVarName}}_{{name}}_e {{name}}Variable = 0; + {{/isEnum}} + {{#isBinary}} + OpenAPI_binary_t *decoded_str_{{{name}}} = NULL; + {{/isBinary}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isEnum}} + OpenAPI_{{complexType}}_e {{name}}Variable = 0; + {{/isEnum}} + {{^isEnum}} + {{#isModel}} + {{^isFreeFormObject}}OpenAPI_{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}OpenAPI_object{{/isFreeFormObject}}_t *{{name}}_local_nonprim = NULL; + {{/isModel}} + {{^isModel}} + {{#isFreeFormObject}} + OpenAPI_object_t *{{name}}_local_object = NULL; + {{/isFreeFormObject}} + {{#isAnyType}} + OpenAPI_any_type_t *{{name}}_local_object = NULL; + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + OpenAPI_list_t *{{{name}}}List = NULL; + {{/isArray}} + {{#isMap}} + OpenAPI_list_t *{{{name}}}List = NULL; + {{/isMap}} + {{/isContainer}} +{{/vars}} +{{#vars}} + {{{name}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{baseName}}}"); + {{#required}} + if (!{{{name}}}) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/required}} + {{^required}} + if ({{{name}}}) { + {{/required}} + {{^isContainer}} + {{#isPrimitiveType}} + {{#isEnum}} + if (!cJSON_IsString({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{name}}Variable = OpenAPI_{{name}}{{classname}}_FromString({{{name}}}->valuestring); + {{/isEnum}} + {{^isEnum}} + {{#isString}} + if (!cJSON_IsString({{{name}}}){{^required}} && !cJSON_IsNull({{{name}}}){{/required}}) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isString}} + {{#isByteArray}} + if (!cJSON_IsString({{{name}}}){{^required}} && !cJSON_IsNull({{{name}}}){{/required}}) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isByteArray}} + {{#isNumeric}} + if (!cJSON_IsNumber({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isNumeric}} + {{#isBoolean}} + if (!cJSON_IsBool({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isBoolean}} + {{/isEnum}} + {{#isBinary}} + decoded_str_{{{name}}} = ogs_malloc(sizeof(OpenAPI_binary_t)); + ogs_assert(decoded_str_{{{name}}}); + if (!cJSON_IsString({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + decoded_str_{{{name}}}->data = OpenAPI_base64decode({{{name}}}->valuestring, strlen({{{name}}}->valuestring), &decoded_str_{{{name}}}->len); + if (!decoded_str_{{{name}}}->data) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isBinary}} + {{#isDate}} + if (!cJSON_IsString({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isDate}} + {{#isDateTime}} + if (!cJSON_IsString({{{name}}}) && !cJSON_IsNull({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isDateTime}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isEnum}} + if (!cJSON_IsString({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{name}}Variable = OpenAPI_{{complexType}}_FromString({{{name}}}->valuestring); + {{/isEnum}} + {{^isEnum}} + {{#isModel}} + {{{name}}}_local_nonprim = OpenAPI_{{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{name}}}); + {{/isModel}} + {{^isModel}} + {{#isUuid}} + if (!cJSON_IsString({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isUuid}} + {{#isEmail}} + if (!cJSON_IsString({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isEmail}} + {{#isFreeFormObject}} + if (!cJSON_IsObject({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{{name}}}_local_object = OpenAPI_object_parseFromJSON({{{name}}}); + {{/isFreeFormObject}} + {{#isAnyType}} + {{{name}}}_local_object = OpenAPI_any_type_parseFromJSON({{{name}}}); + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + cJSON *{{{name}}}_local = NULL; + if (!cJSON_IsArray({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + + {{{name}}}List = OpenAPI_list_create(); + + cJSON_ArrayForEach({{{name}}}_local, {{{name}}}) { + {{#isEnum}} + if (!cJSON_IsString({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + OpenAPI_list_add({{{name}}}List, (void *)OpenAPI_{{{complexType}}}_FromString({{{name}}}_local->valuestring)); + {{/isEnum}} + {{^isEnum}} + {{#isPrimitiveType}} + double *localDouble = NULL; + int *localInt = NULL; + {{/isPrimitiveType}} + {{#items}} + {{#isPrimitiveType}} + {{#isString}} + if (!cJSON_IsString({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + OpenAPI_list_add({{{name}}}List, ogs_strdup({{{name}}}_local->valuestring)); + {{/isString}} + {{#isByteArray}} + if (!cJSON_IsString({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + OpenAPI_list_add({{{name}}}List, ogs_strdup({{{name}}}_local->valuestring)); + {{/isByteArray}} + {{#isNumeric}} + if (!cJSON_IsNumber({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + *localDouble = {{{name}}}_local->valuedouble; + OpenAPI_list_add({{{name}}}List, localDouble); + {{/isNumeric}} + {{#isBoolean}} + if (!cJSON_IsBool({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localInt = (int *)ogs_calloc(1, sizeof(int)); + if (!localInt) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + *localInt = {{{name}}}_local->valueint; + OpenAPI_list_add({{{name}}}List, localInt); + {{/isBoolean}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if (!cJSON_IsObject({{{name}}}_local)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + OpenAPI_{{complexType}}_t *{{{name}}}Item = OpenAPI_{{complexType}}_parseFromJSON({{{name}}}_local); + if (!{{{name}}}Item) { + ogs_error("No {{{name}}}Item"); + OpenAPI_list_free({{{name}}}List); + goto end; + } + OpenAPI_list_add({{{name}}}List, {{{name}}}Item); + {{/isPrimitiveType}} + {{/items}} + {{/isEnum}} + } + {{/isArray}} + {{#isMap}} + cJSON *{{{name}}}_local_map = NULL; + if (!cJSON_IsObject({{{name}}}) && !cJSON_IsNull({{{name}}})) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + if (cJSON_IsObject({{{name}}})) { + {{{name}}}List = OpenAPI_list_create(); + OpenAPI_map_t *localMapKeyPair = NULL; + cJSON_ArrayForEach({{{name}}}_local_map, {{{name}}}) { + cJSON *localMapObject = {{{name}}}_local_map; + {{#isEnum}} + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), (void *)OpenAPI_{{{complexType}}}_FromString(localMapObject->string)); + {{/isEnum}} + {{^isEnum}} + {{#isPrimitiveType}} + double *localDouble = NULL; + int *localInt = NULL; + {{/isPrimitiveType}} + {{#items}} + {{#isPrimitiveType}} + {{#isString}} + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + {{/isString}} + {{#isByteArray}} + if (!cJSON_IsString(localMapObject)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), ogs_strdup(localMapObject->valuestring)); + {{/isByteArray}} + {{#isNumeric}} + if (!cJSON_IsNumber(localMapObject)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localDouble = (double *)ogs_calloc(1, sizeof(double)); + if (!localDouble) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + *localDouble = localMapObject->valuedouble; + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), localDouble); + {{/isNumeric}} + {{#isBoolean}} + if (!cJSON_IsBool(localMapObject)) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + localInt = (int *)ogs_calloc(1, sizeof(int)); + if (!localInt) { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + *localInt = localMapObject->valueint; + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), localInt); + {{/isBoolean}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if (cJSON_IsObject(localMapObject)) { + localMapKeyPair = OpenAPI_map_create( + ogs_strdup(localMapObject->string), OpenAPI_{{complexType}}_parseFromJSON(localMapObject)); + } else if (cJSON_IsNull(localMapObject)) { + localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL); + } else { + ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]"); + goto end; + } + {{/isPrimitiveType}} + {{/items}} + {{/isEnum}} + OpenAPI_list_add({{{name}}}List, localMapKeyPair); + } + } + {{/isMap}} + {{/isContainer}} + {{^required}} + } + {{/required}} + +{{/vars}} + {{classname}}_local_var = OpenAPI_{{classname}}_create ( +{{#vars}} + {{^isContainer}} + {{^isPrimitiveType}} + {{#isEnum}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}Variable{{^required}} : 0{{/required}}{{^-last}},{{/-last}} + {{/isEnum}} + {{^isEnum}} + {{#isModel}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isModel}} + {{^isModel}} + {{#isUuid}} + {{^required}}{{{name}}} ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isUuid}} + {{#isEmail}} + {{^required}}{{{name}}} ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isEmail}} + {{#isFreeFormObject}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_object{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{#isAnyType}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_object{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{#isEnum}} + {{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : 0{{/required}}{{^-last}},{{/-last}} + {{/isEnum}} + {{^isEnum}} + {{#isNumeric}} + {{^required}}{{{name}}} ? true : false,{{/required}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}->valuedouble{{^required}} : 0{{/required}}{{^-last}},{{/-last}} + {{/isNumeric}} + {{#isBoolean}} + {{^required}}{{{name}}} ? true : false,{{/required}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{^-last}},{{/-last}} + {{/isBoolean}} + {{#isString}} + {{^required}}{{{name}}} && !cJSON_IsNull({{{name}}}) ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isString}} + {{#isByteArray}} + {{^required}}{{{name}}} && !cJSON_IsNull({{{name}}}) ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isByteArray}} + {{/isEnum}} + {{#isBinary}} + {{^required}}{{{name}}} ? {{/required}}decoded_str_{{{name}}}{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isBinary}} + {{#isDate}} + {{^required}}{{{name}}} ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isDate}} + {{#isDateTime}} + {{^required}}{{{name}}} && !cJSON_IsNull({{{name}}}) ? {{/required}}ogs_strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isDateTime}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isArray}} + {{#isMap}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isMap}} + {{/isContainer}} +{{/vars}} + ); + + return {{classname}}_local_var; +end: +{{#vars}} + {{^isContainer}} + {{^isPrimitiveType}} + {{^isEnum}} + {{#isModel}} + if ({{{name}}}_local_nonprim) { + OpenAPI_{{{complexType}}}_free({{{name}}}_local_nonprim); + {{{name}}}_local_nonprim = NULL; + } + {{/isModel}} + {{^isModel}} + {{#isFreeFormObject}} + if ({{{name}}}_local_object) { + OpenAPI_{{{datatype}}}_free({{{name}}}_local_object); + {{{name}}}_local_object = NULL; + } + {{/isFreeFormObject}} + {{#isAnyType}} + if ({{name}}_local_object) { + OpenAPI_{{{datatype}}}_free({{name}}_local_object); + {{name}}_local_object = NULL; + } + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + if ({{{name}}}List) { + {{^isEnum}} + OpenAPI_list_for_each({{{name}}}List, node) { + {{#isPrimitiveType}} + ogs_free(node->data); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + OpenAPI_{{complexType}}_free(node->data); + {{/isPrimitiveType}} + } + {{/isEnum}} + OpenAPI_list_free({{{name}}}List); + {{{name}}}List = NULL; + } + {{/isArray}} + {{#isMap}} + if ({{{name}}}List) { + OpenAPI_list_for_each({{{name}}}List, node) { + OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data; + ogs_free(localKeyValue->key); + {{^isEnum}} + {{#isPrimitiveType}} + ogs_free(localKeyValue->value); + {{/isPrimitiveType}} + {{^isPrimitiveType}} + OpenAPI_{{complexType}}_free(localKeyValue->value); + {{/isPrimitiveType}} + {{/isEnum}} + OpenAPI_map_free(localKeyValue); + } + OpenAPI_list_free({{{name}}}List); + {{{name}}}List = NULL; + } + {{/isMap}} + {{/isContainer}} +{{/vars}} + return NULL; +} + +OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src) +{ + cJSON *item = NULL; + char *content = NULL; + + ogs_assert(src); + item = OpenAPI_{{classname}}_convertToJSON(src); + if (!item) { + ogs_error("OpenAPI_{{classname}}_convertToJSON() failed"); + return NULL; + } + + content = cJSON_Print(item); + cJSON_Delete(item); + + if (!content) { + ogs_error("cJSON_Print() failed"); + return NULL; + } + + item = cJSON_Parse(content); + ogs_free(content); + if (!item) { + ogs_error("cJSON_Parse() failed"); + return NULL; + } + + OpenAPI_{{classname}}_free(dst); + dst = OpenAPI_{{classname}}_parseFromJSON(item); + cJSON_Delete(item); + + return dst; +} +{{/isEnum}} +{{/model}}{{/models}} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/model-header.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/model-header.mustache new file mode 100644 index 000000000..d702deb6d --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/model-header.mustache @@ -0,0 +1,204 @@ +{{#models}}{{#model}}/* + * {{classname}}.h + * + * {{description}} + */ + +#ifndef _OpenAPI_{{classname}}_H_ +#define _OpenAPI_{{classname}}_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" +{{#imports}} +#include "{{{.}}}.h" +{{/imports}} + +#ifdef __cplusplus +extern "C" { +#endif + +{{#isEnum}} + {{#allowableValues}} +typedef enum { OpenAPI_{{classVarName}}_NULL = 0{{#enumVars}}, OpenAPI_{{classVarName}}_{{{value}}}{{/enumVars}} } OpenAPI_{{classVarName}}_e; + {{/allowableValues}} + +char* OpenAPI_{{classname}}_ToString(OpenAPI_{{classVarName}}_e {{classname}}); + +OpenAPI_{{classVarName}}_e OpenAPI_{{classname}}_FromString(char* {{classname}}); +{{/isEnum}} +{{^isEnum}} +typedef struct OpenAPI_{{classname}}_s OpenAPI_{{classname}}_t; +{{#vars}} + {{^isContainer}} + {{#isPrimitiveType}} + {{#isEnum}} + {{#allowableValues}} +typedef enum { OpenAPI_{{classVarName}}_{{enumName}}_NULL = 0{{#enumVars}}, OpenAPI_{{classVarName}}_{{enumName}}_{{{value}}}{{/enumVars}} } OpenAPI_{{classVarName}}_{{name}}_e; + {{/allowableValues}} + +char* OpenAPI_{{classVarName}}_{{name}}_ToString(OpenAPI_{{classVarName}}_{{name}}_e {{name}}); + +OpenAPI_{{classVarName}}_{{name}}_e OpenAPI_{{classVarName}}_{{name}}_FromString(char* {{name}}); + {{/isEnum}} + {{/isPrimitiveType}} + {{/isContainer}} +{{/vars}} +typedef struct OpenAPI_{{classname}}_s { +{{#vars}} + {{^isContainer}} + {{^isPrimitiveType}} + {{#isEnum}} + OpenAPI_{{datatype}}_e {{name}}; + {{/isEnum}} + {{^isEnum}} + {{#isModel}} + struct OpenAPI_{{datatype}}_s *{{name}}; + {{/isModel}} + {{^isModel}} + {{#isUuid}} + {{datatype}} *{{name}}; + {{/isUuid}} + {{#isEmail}} + {{datatype}} *{{name}}; + {{/isEmail}} + {{#isFreeFormObject}} + OpenAPI_{{datatype}}_t *{{name}}; + {{/isFreeFormObject}} + {{#isAnyType}} + OpenAPI_{{datatype}}_t *{{name}}; + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{#isEnum}} + OpenAPI_{{classVarName}}_{{name}}_e {{name}}; + {{/isEnum}} + {{^isEnum}} + {{#isNumeric}} + {{^required}} + bool is_{{name}}; + {{/required}} + {{datatype}} {{name}}; + {{/isNumeric}} + {{#isBoolean}} + {{^required}} + bool is_{{name}}; + {{/required}} + {{datatype}} {{name}}; + {{/isBoolean}} + {{#isString}} + {{datatype}} *{{name}}; + {{/isString}} + {{/isEnum}} + {{#isByteArray}} + {{datatype}} *{{name}}; + {{/isByteArray}} + {{#isBinary}} + OpenAPI_{{datatype}} {{name}}; + {{/isBinary}} + {{#isDate}} + {{datatype}} *{{name}}; + {{/isDate}} + {{#isDateTime}} + {{datatype}} *{{name}}; + {{/isDateTime}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + OpenAPI_{{datatype}}_t *{{name}}; + {{/isArray}} + {{#isMap}} + OpenAPI_{{datatype}} {{name}}; + {{/isMap}} + {{/isContainer}} +{{/vars}} +} OpenAPI_{{classname}}_t; + +OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create( +{{#vars}} + {{^isContainer}} + {{^isPrimitiveType}} + {{#isEnum}} + OpenAPI_{{datatype}}_e {{name}}{{^-last}},{{/-last}} + {{/isEnum}} + {{^isEnum}} + {{#isModel}} + OpenAPI_{{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isModel}} + {{^isModel}} + {{#isUuid}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isUuid}} + {{#isEmail}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isEmail}} + {{#isFreeFormObject}} + OpenAPI_{{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{#isAnyType}} + OpenAPI_{{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isAnyType}} + {{/isModel}} + {{/isEnum}} + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{#isEnum}} + OpenAPI_{{classVarName}}_{{name}}_e {{name}}{{^-last}},{{/-last}} + {{/isEnum}} + {{^isEnum}} + {{#isNumeric}} + {{^required}} + bool is_{{name}}, + {{/required}} + {{datatype}} {{name}}{{^-last}},{{/-last}} + {{/isNumeric}} + {{#isBoolean}} + {{^required}} + bool is_{{name}}, + {{/required}} + {{datatype}} {{name}}{{^-last}},{{/-last}} + {{/isBoolean}} + {{#isString}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isString}} + {{/isEnum}} + {{#isByteArray}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isByteArray}} + {{#isBinary}} + OpenAPI_{{datatype}} {{name}}{{^-last}},{{/-last}} + {{/isBinary}} + {{#isDate}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isDate}} + {{#isDateTime}} + {{datatype}} *{{name}}{{^-last}},{{/-last}} + {{/isDateTime}} + {{/isPrimitiveType}} + {{/isContainer}} + {{#isContainer}} + {{#isArray}} + OpenAPI_{{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isArray}} + {{#isMap}} + OpenAPI_{{datatype}} {{name}}{{^-last}},{{/-last}} + {{/isMap}} + {{/isContainer}} +{{/vars}}); +void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}}); +OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON); +cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}}); +OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src); +{{/isEnum}} + +#ifdef __cplusplus +} +#endif + +#endif /* _OpenAPI_{{classname}}_H_ */ +{{/model}}{{/models}} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/object-body.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/object-body.mustache new file mode 100644 index 000000000..5192c6593 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/object-body.mustache @@ -0,0 +1,55 @@ +#include +#include +#include +#include "object.h" + +OpenAPI_object_t *OpenAPI_object_create(void) +{ + OpenAPI_object_t *object = ogs_calloc(1, sizeof(OpenAPI_object_t)); + + return object; +} + +void OpenAPI_object_free(OpenAPI_object_t *object) +{ + if (!object) { + return; + } + + if (object->temporary) { + ogs_free(object->temporary); + object->temporary = NULL; + } + + ogs_free (object); +} + +cJSON *OpenAPI_object_convertToJSON(OpenAPI_object_t *object) +{ + if (!object) { + return NULL; + } + + if (!object->temporary) { + return cJSON_Parse("{}"); + } + + return cJSON_Parse(object->temporary); +} + +OpenAPI_object_t *OpenAPI_object_parseFromJSON(cJSON *json) +{ + if (!json) { + goto end; + } + + OpenAPI_object_t *object = OpenAPI_object_create(); + if (!object) { + goto end; + } + object->temporary = cJSON_Print(json); + return object; + +end: + return NULL; +} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/object-header.mustache b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/object-header.mustache new file mode 100644 index 000000000..8b5e45ad3 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/templates/object-header.mustache @@ -0,0 +1,30 @@ +#ifndef OGS_SBI_OBJECT_H +#define OGS_SBI_OBJECT_H + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct OpenAPI_object_s { + void *temporary; +} OpenAPI_object_t; + +OpenAPI_object_t *OpenAPI_object_create(void); + +void OpenAPI_object_free(OpenAPI_object_t *object); + +OpenAPI_object_t *OpenAPI_object_parseFromJSON(cJSON *json); + +cJSON *OpenAPI_object_convertToJSON(OpenAPI_object_t *object); + +#ifdef __cplusplus +} +#endif + +#endif /* OGS_SBI_OBJECT_H */ diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/uncrustify-rules.cfg b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/uncrustify-rules.cfg new file mode 100644 index 000000000..fa6d5bfb3 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapi-generator/uncrustify-rules.cfg @@ -0,0 +1,210 @@ +tok_split_gte=false +utf8_byte=false +utf8_force=true +indent_cmt_with_tabs=false +indent_align_string=false +indent_braces=false +indent_braces_no_func=false +indent_braces_no_class=false +indent_braces_no_struct=false +indent_brace_parent=false +indent_namespace=false +indent_extern=true +indent_class=false +indent_class_colon=false +indent_else_if=false +indent_var_def_cont=false +indent_func_call_param=false +indent_func_def_param=false +indent_func_proto_param=false +indent_func_class_param=false +indent_func_ctor_var_param=false +indent_template_param=false +indent_func_param_double=false +indent_relative_single_line_comments=false +indent_col1_comment=false +indent_access_spec_body=false +indent_paren_nl=false +indent_comma_paren=false +indent_bool_paren=false +indent_first_bool_expr=false +indent_square_nl=false +indent_preserve_sql=false +indent_align_assign=true +sp_balance_nested_parens=false +align_keep_tabs=false +align_with_tabs=true +align_on_tabstop=true +align_func_params=true +align_same_func_call_params=false +align_var_def_colon=false +align_var_def_attribute=false +align_var_def_inline=false +align_right_cmt_mix=false +align_on_operator=false +align_mix_var_proto=false +align_single_line_func=false +align_single_line_brace=false +align_nl_cont=false +align_left_shift=true +align_oc_decl_colon=false +nl_collapse_empty_body=true +nl_assign_leave_one_liners=false +nl_class_leave_one_liners=false +nl_enum_leave_one_liners=false +nl_getset_leave_one_liners=false +nl_func_leave_one_liners=false +nl_if_leave_one_liners=false +nl_multi_line_cond=true +nl_multi_line_define=false +nl_before_case=true +nl_after_case=true +nl_after_return=false +nl_after_semicolon=true +nl_after_brace_open=false +nl_after_brace_open_cmt=false +nl_after_vbrace_open=false +nl_after_vbrace_open_empty=false +nl_after_brace_close=false +nl_after_vbrace_close=false +nl_define_macro=false +nl_squeeze_ifdef=false +nl_ds_struct_enum_cmt=false +nl_ds_struct_enum_close_brace=false +nl_create_if_one_liner=false +nl_create_for_one_liner=false +nl_create_while_one_liner=false +ls_for_split_full=false +ls_func_split_full=false +nl_after_multiline_comment=false +eat_blanks_after_open_brace=true +eat_blanks_before_close_brace=true +mod_full_brace_if_chain=false +mod_pawn_semicolon=false +mod_full_paren_if_bool=true +mod_remove_extra_semicolon=true +mod_sort_import=true +mod_sort_using=false +mod_sort_include=false +mod_move_case_break=false +mod_remove_empty_return=true +cmt_indent_multi=true +cmt_c_group=false +cmt_c_nl_start=true +cmt_c_nl_end=true +cmt_cpp_group=false +cmt_cpp_nl_start=true +cmt_cpp_nl_end=true +cmt_cpp_to_c=false +cmt_star_cont=false +cmt_multi_check_last=true +cmt_insert_before_preproc=false +pp_indent_at_level=false +pp_region_indent_code=false +pp_if_indent_code=false +pp_define_at_level=false +align_var_def_star_style=1 +align_var_def_amp_style=0 +code_width=80 +indent_with_tabs=1 +sp_arith=force +sp_assign=force +sp_assign_default=force +sp_enum_assign=force +sp_bool=force +sp_compare=force +sp_inside_paren=remove +sp_before_ptr_star=force +sp_before_unnamed_ptr_star=force +sp_between_ptr_star=remove +sp_after_ptr_star=remove +sp_before_sparen=remove +sp_inside_sparen=remove +sp_sparen_brace=force +sp_before_semi=remove +sp_before_semi_for_empty=force +sp_after_semi=force +sp_after_semi_for=force +sp_after_semi_for_empty=force +sp_before_square=remove +sp_before_squares=remove +sp_inside_square=remove +sp_after_comma=force +sp_before_comma=remove +sp_paren_comma=force +sp_before_case_colon=remove +sp_after_cast=force +sp_inside_paren_cast=remove +sp_sizeof_paren=remove +sp_inside_braces_struct=force +sp_type_func=remove +sp_func_proto_paren=remove +sp_func_def_paren=remove +sp_inside_fparens=remove +sp_inside_fparen=remove +sp_square_fparen=remove +sp_fparen_brace=force +sp_func_call_paren=remove +sp_attribute_paren=remove +sp_defined_paren=remove +sp_macro=force +sp_macro_func=force +sp_else_brace=force +sp_brace_else=force +sp_brace_typedef=force +sp_not=remove +sp_inv=remove +sp_addr=remove +sp_member=remove +sp_deref=remove +sp_sign=remove +sp_incdec=remove +sp_before_nl_cont=force +sp_cond_colon=force +sp_cond_question=force +sp_case_label=force +sp_cmt_cpp_start=force +sp_endif_cmt=force +sp_before_tr_emb_cmt=force +nl_start_of_file=remove +nl_end_of_file=add +nl_assign_brace=remove +nl_enum_brace=remove +nl_struct_brace=remove +nl_union_brace=remove +nl_if_brace=remove +nl_brace_else=remove +nl_elseif_brace=remove +nl_else_brace=remove +nl_else_if=remove +nl_brace_finally=remove +nl_finally_brace=remove +nl_try_brace=remove +nl_for_brace=remove +nl_catch_brace=remove +nl_brace_catch=remove +nl_while_brace=remove +nl_do_brace=remove +nl_brace_while=remove +nl_switch_brace=remove +nl_class_brace=remove +nl_func_type_name=remove +nl_func_proto_type_name=remove +nl_func_paren=remove +nl_func_def_paren=remove +nl_func_decl_start=remove +nl_func_def_start=remove +nl_func_decl_args=remove +nl_func_def_args=remove +nl_func_decl_end=remove +nl_func_def_end=remove +nl_func_decl_empty=remove +nl_func_def_empty=remove +nl_fdef_brace=remove +nl_return_expr=remove +pos_bool=trail_break +mod_full_brace_do=force +mod_full_brace_for=force +mod_full_brace_if=force +mod_full_brace_while=force +mod_paren_on_return=remove \ No newline at end of file diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapitools.json b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapitools.json new file mode 100644 index 000000000..1338bb732 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "6.4.0" + } +} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_AsSessionWithQoS.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_AsSessionWithQoS.yaml new file mode 100644 index 000000000..5c252d0c2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_AsSessionWithQoS.yaml @@ -0,0 +1,771 @@ +openapi: 3.0.0 +info: + title: 3gpp-as-session-with-qos + version: 1.2.2 + description: | + API for setting us an AS session with required QoS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.8.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-as-session-with-qos/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + get: + summary: Read all or queried active subscriptions for the SCS/AS. + operationId: FetchAllASSessionWithQoSSubscriptions + tags: + - AS Session with Required QoS Subscriptions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: ip-addrs + in: query + description: The IP address(es) of the requested UE(s). + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + - name: ip-domain + in: query + description: The IPv4 address domain identifier. The attribute may only be provided if IPv4 address is included in the ip-addrs query parameter. + required: false + schema: + type: string + - name: mac-addrs + in: query + description: The MAC address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource. + operationId: CreateASSessionWithQoSSubscription + tags: + - AS Session with Required QoS Subscriptions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserPlaneNotificationData' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/subscriptions/{subscriptionId}: + get: + summary: Read an active subscriptions for the SCS/AS and the subscription Id. + operationId: FetchIndASSessionWithQoSSubscription + tags: + - Individual AS Session with Required QoS Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing subscription resource. + operationId: UpdateIndASSessionWithQoSSubscription + tags: + - Individual AS Session with Required QoS Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + '204': + description: No Content (Successful update of the subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates/replaces an existing subscription resource. + operationId: ModifyIndASSessionWithQoSSubscription + tags: + - Individual AS Session with Required QoS Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscriptionPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AsSessionWithQoSSubscription' + '204': + description: No Content. The subscription was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription. + operationId: DeleteIndASSessionWithQoSSubscription + tags: + - Individual AS Session with Required QoS Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/UserPlaneNotificationData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AsSessionWithQoSSubscription: + description: Represents an individual AS session with required QoS subscription resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + exterAppId: + type: string + description: Identifies the external Application Identifier. + flowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Describe the data flow which requires QoS. + ethFlowInfo: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet flows. + enEthFlowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/EthFlowInfo' + minItems: 1 + description: > + Identifies the Ethernet flows which require QoS. Each Ethernet flow consists of a flow + idenifer and the corresponding UL and/or DL flows. + qosReference: + type: string + description: Identifies a pre-defined QoS information + altQoSReferences: + type: array + items: + type: string + minItems: 1 + description: Identifies an ordered list of pre-defined QoS information. The lower the index of the array for a given entry, the higher the priority. + altQosReqs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AlternativeServiceRequirementsData' + minItems: 1 + description: Identifies an ordered list of alternative service requirements that include individual QoS parameter sets. The lower the index of the array for a given entry, the higher the priority. + disUeNotif: + description: > + Indicates whether the QoS flow parameters signalling to the UE when the SMF is notified + by the NG-RAN of changes in the fulfilled QoS situation is disabled (true) or + not (false). Default value is false. The fulfilled situation is either the QoS profile + or an Alternative QoS Profile. + type: boolean + ueIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + ueIpv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + usageThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + sponsorInfo: + $ref: 'TS29122_CommonData.yaml#/components/schemas/SponsorInformation' + qosMonInfo: + $ref: '#/components/schemas/QosMonitoringInformation' + directNotifInd: + type: boolean + description: > + Indicates whether the direct event notification is requested (true) or not (false). + Default value is false. + tscQosReq: + $ref: '#/components/schemas/TscQosRequirement' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + events: + description: Represents the list of user plane event(s) to which the SCS/AS requests to subscribe to. + type: array + items: + $ref: '#/components/schemas/UserPlaneEvent' + minItems: 1 + required: + - notificationDestination + AsSessionWithQoSSubscriptionPatch: + description: Represents parameters to modify an AS session with specific QoS subscription. + type: object + properties: + exterAppId: + type: string + description: Identifies the external Application Identifier. + flowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Describe the IP data flow which requires QoS. + ethFlowInfo: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet flows. + enEthFlowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/EthFlowInfo' + minItems: 1 + description: > + Identifies the Ethernet flows which require QoS. Each Ethernet flow consists of a flow + idenifer and the corresponding UL and/or DL flows. + qosReference: + type: string + description: Pre-defined QoS reference + altQoSReferences: + type: array + items: + type: string + minItems: 1 + description: Identifies an ordered list of pre-defined QoS information. The lower the index of the array for a given entry, the higher the priority. + altQosReqs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AlternativeServiceRequirementsData' + minItems: 1 + description: Identifies an ordered list of alternative service requirements that include individual QoS parameter sets. The lower the index of the array for a given entry, the higher the priority. + disUeNotif: + type: boolean + description: > + Indicates whether the QoS flow parameters signalling to the UE when the SMF is notified + by the NG-RAN of changes in the fulfilled QoS situation is disabled (true) or + not (false). The fulfilled situation is either the QoS profile or an Alternative QoS + Profile. + usageThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThresholdRm' + qosMonInfo: + $ref: '#/components/schemas/QosMonitoringInformationRm' + directNotifInd: + type: boolean + description: > + Indicates whether the direct event notification is requested (true) or not (false). + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + tscQosReq: + $ref: '#/components/schemas/TscQosRequirementRm' + events: + description: Represents the updated list of user plane event(s) to which the SCS/AS requests to subscribe to. + type: array + items: + $ref: '#/components/schemas/UserPlaneEvent' + minItems: 1 + QosMonitoringInformation: + description: Represents QoS monitoring information. + type: object + properties: + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + repFreqs: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ReportingFrequency' + minItems: 1 + repThreshDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + repThreshUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + repThreshRp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - reqQosMonParams + - repFreqs + QosMonitoringInformationRm: + description: Represents the same as the QosMonitoringInformation data type but with the nullable:true property. + type: object + properties: + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + repFreqs: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ReportingFrequency' + minItems: 1 + repThreshDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + repThreshUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + repThreshRp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + QosMonitoringReport: + description: Represents a QoS monitoring report. + type: object + properties: + ulDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + dlDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + rtDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + UserPlaneNotificationData: + description: Represents the parameters to be conveyed in a user plane event(s) notification. + type: object + properties: + transaction: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + eventReports: + type: array + items: + $ref: '#/components/schemas/UserPlaneEventReport' + minItems: 1 + description: Contains the reported event and applicable information + required: + - transaction + - eventReports + UserPlaneEventReport: + description: Represents an event report for user plane. + type: object + properties: + event: + $ref: '#/components/schemas/UserPlaneEvent' + accumulatedUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/AccumulatedUsage' + flowIds: + type: array + items: + type: integer + minItems: 1 + description: > + Identifies the affected flows that were sent during event subscription. It might be + omitted when the reported event applies to all the flows sent during the subscription. + appliedQosRef: + type: string + description: The currently applied QoS reference. Applicable for event QOS_NOT_GUARANTEED or SUCCESSFUL_RESOURCES_ALLOCATION. + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + description: Contains the QoS Monitoring Reporting information + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + required: + - event + TscQosRequirement: + description: Represents QoS requirements for time sensitive communication. + type: object + properties: + reqGbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + reqGbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + reqMbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + reqMbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVol' + req5Gsdelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + priority: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscPriorityLevel' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + tscaiInputDl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + TscQosRequirementRm: + description: Represents the same as the TscQosRequirement data type but with the nullable:true property. + type: object + properties: + reqGbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + reqGbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + reqMbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + reqMbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + req5Gsdelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudgetRm' + priority: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscPriorityLevelRm' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + tscaiInputDl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + UserPlaneEvent: + anyOf: + - type: string + enum: + - SESSION_TERMINATION + - LOSS_OF_BEARER + - RECOVERY_OF_BEARER + - RELEASE_OF_BEARER + - USAGE_REPORT + - FAILED_RESOURCES_ALLOCATION + - QOS_GUARANTEED + - QOS_NOT_GUARANTEED + - QOS_MONITORING + - SUCCESSFUL_RESOURCES_ALLOCATION + - ACCESS_TYPE_CHANGE + - PLMN_CHG + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SESSION_TERMINATION: Indicates that Rx session is terminated. + - LOSS_OF_BEARER : Indicates a loss of a bearer. + - RECOVERY_OF_BEARER: Indicates a recovery of a bearer. + - RELEASE_OF_BEARER: Indicates a release of a bearer. + - USAGE_REPORT: Indicates the usage report event. + - FAILED_RESOURCES_ALLOCATION: Indicates the resource allocation is failed. + - QOS_GUARANTEED: The QoS targets of one or more SDFs are guaranteed again. + - QOS_NOT_GUARANTEED: The QoS targets of one or more SDFs are not being guaranteed. + - QOS_MONITORING: Indicates a QoS monitoring event. + - SUCCESSFUL_RESOURCES_ALLOCATION: Indicates the resource allocation is successful. + - ACCESS_TYPE_CHANGE: Indicates an Access type change. + - PLMN_CHG: Indicates a PLMN change. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ChargeableParty.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ChargeableParty.yaml new file mode 100644 index 000000000..29ec612de --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ChargeableParty.yaml @@ -0,0 +1,454 @@ +openapi: 3.0.0 +info: + title: 3gpp-chargeable-party + version: 1.2.1 + description: | + API for Chargeable Party management. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-chargeable-party/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/transactions: + get: + summary: Read all or queried chargeable party transaction resources for a given SCS/AS. + operationId: FetchAllChargeablePartyTransactions + tags: + - Chargeable Party Transaction Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: ip-addrs + in: query + description: The IP address(es) of the requested UE(s). + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + - name: ip-domain + in: query + description: The IPv4 address domain identifier. The attribute may only be provided if IPv4 address is included in the ip-addrs query parameter. + required: false + schema: + type: string + - name: mac-addrs + in: query + description: The MAC address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + responses: + '200': + description: OK (successful query of Chargeable Party resource) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChargeableParty' + minItems: 0 + description: individual BDT policy subscription. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Create a new chargeable party transaction resource. + operationId: CreateChargeablePartyTransaction + tags: + - Chargeable Party Transaction Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + requestBody: + description: representation of the Chargeable Party resource to be Created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargeableParty' + callbacks: + eventNotification: + '{$request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/NotificationData' + responses: + '204': + description: No Content (The successful acknowledgement of the notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: successful creation of a chargeable party resource + content: + application/json: + schema: + $ref: '#/components/schemas/ChargeableParty' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/transactions/{transactionId}: + get: + summary: Read a chargeable party resource for a given SCS/AS and a transaction Id. + operationId: FetchIndChargeablePartyTransaction + tags: + - Individual chargeable party resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of a chargeable party resource) + content: + application/json: + schema: + $ref: '#/components/schemas/ChargeableParty' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates a existing chargeable party resource for a given SCS/AS and transaction Id. + operationId: UpdateChargeablePartyTransaction + tags: + - Individual chargeable party resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the chargeable party resource to be udpated in the SCEF + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/ChargeablePartyPatch' + responses: + '200': + description: successful update of a chargeable party resource + content: + application/json: + schema: + $ref: '#/components/schemas/ChargeableParty' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a chargeable party resource for a given SCS/AS and a transcation Id. + operationId: DeleteChargeablePartyTransaction + tags: + - Individual chargeable party resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '204': + description: successful deletion of an resouce of chargeable party + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/NotificationData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ChargeableParty: + description: Represents the configuration of a chargeable party. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + exterAppId: + type: string + description: Identifies the external Application Identifier. + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + ipv6Addr : + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + flowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Describes the application flows. + ethFlowInfo: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet flows. + sponsorInformation: + $ref: 'TS29122_CommonData.yaml#/components/schemas/SponsorInformation' + sponsoringEnabled: + type: boolean + description: > + Indicates whether the sponsoring data connectivity is enabled (true) or not (false). + referenceId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + servAuthInfo: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ServAuthInfo' + usageThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + events: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Event' + minItems: 1 + description: Represents the list of event(s) to which the SCS/AS requests to subscribe to. + required: + - notificationDestination + - sponsorInformation + - sponsoringEnabled + ChargeablePartyPatch: + description: Represents a modification request of a chargeable party resource. + type: object + properties: + flowInfo: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Describes the IP flows. + exterAppId: + type: string + description: Identifies the external Application Identifier. + ethFlowInfo: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet flows. + sponsoringEnabled: + type: boolean + description: > + Indicates whether the sponsoring data connectivity is enabled (true) or not (false). + referenceId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + usageThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThresholdRm' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + events: + description: Represents the list of event(s) to which the SCS/AS requests to subscribe to. + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Event' + minItems: 1 + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_CommonData.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_CommonData.yaml new file mode 100644 index 000000000..d5e172dc4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_CommonData.yaml @@ -0,0 +1,571 @@ +openapi: 3.0.0 +info: + title: TS 29.122 Common Data Types + version: 1.2.1 + description: | + Data types applicable to several APIs. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +paths: {} +components: + schemas: + SponsorInformation: + description: Represents a sponsor information. + type: object + properties: + sponsorId: + type: string + description: It indicates Sponsor ID. + aspId: + type: string + description: It indicates Application Service Provider ID. + required: + - sponsorId + - aspId + UsageThreshold: + description: Represents a usage threshold. + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSec' + totalVolume: + $ref: '#/components/schemas/Volume' + downlinkVolume: + $ref: '#/components/schemas/Volume' + uplinkVolume: + $ref: '#/components/schemas/Volume' + UsageThresholdRm: + description: Represents the same as the UsageThreshold data type but with the nullable:true property. + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSecRm' + totalVolume: + $ref: '#/components/schemas/VolumeRm' + downlinkVolume: + $ref: '#/components/schemas/VolumeRm' + uplinkVolume: + $ref: '#/components/schemas/VolumeRm' + nullable: true + TimeWindow: + description: Represents a time window identified by a start time and a stop time. + type: object + properties: + startTime: + $ref: '#/components/schemas/DateTime' + stopTime: + $ref: '#/components/schemas/DateTime' + required: + - startTime + - stopTime + Acknowledgement: + description: Represents a successful acknowledgement of a notification. + type: object + properties: + details: + type: string + description: A human-readable explanation specific to this successful acknowledgement + required: + - details + NotificationData: + description: Represents the information to be conveyed in a bearer level event(s) notification. + type: object + properties: + transaction: + $ref: '#/components/schemas/Link' + eventReports: + type: array + items: + $ref: '#/components/schemas/EventReport' + minItems: 1 + description: Contains the reported event and applicable information + required: + - transaction + - eventReports + EventReport: + description: Represents an event report. + type: object + properties: + event: + $ref: '#/components/schemas/Event' + accumulatedUsage: + $ref: '#/components/schemas/AccumulatedUsage' + flowIds: + type: array + items: + type: integer + minItems: 1 + description: Identifies the IP flows that were sent during event subscription + required: + - event + AccumulatedUsage: + description: Represents an accumulated usage. + type: object + properties: + duration: + $ref: '#/components/schemas/DurationSec' + totalVolume: + $ref: '#/components/schemas/Volume' + downlinkVolume: + $ref: '#/components/schemas/Volume' + uplinkVolume: + $ref: '#/components/schemas/Volume' + FlowInfo: + description: Represents IP flow information. + type: object + properties: + flowId: + type: integer + description: Indicates the IP flow identifier. + flowDescriptions: + type: array + items: + type: string + description: > + Indicates the packet filters of the IP flow. Refer to clause 5.3.8 of 3GPP TS 29.214 for + encoding. It shall contain UL and/or DL IP flow description. + minItems: 1 + maxItems: 2 + required: + - flowId + TestNotification: + description: Represents a notification that can be sent to test whether a chosen notification mechanism works. + type: object + properties: + subscription: + $ref: '#/components/schemas/Link' + required: + - subscription + WebsockNotifConfig: + description: Represents the configuration information for the delivery of notifications over Websockets. + type: object + properties: + websocketUri: + $ref: '#/components/schemas/Link' + requestWebsocketUri: + type: boolean + description: Set by the SCS/AS to indicate that the Websocket delivery is requested. + LocationArea: + description: Represents a user location area. + type: object + properties: + cellIds: + type: array + items: + type: string + minItems: 1 + description: Indicates a list of Cell Global Identities of the user which identifies the cell the UE is registered. + enodeBIds: + type: array + items: + type: string + minItems: 1 + description: Indicates a list of eNodeB identities in which the UE is currently located. + routingAreaIds: + type: array + items: + type: string + minItems: 1 + description: Identifies a list of Routing Area Identities of the user where the UE is located. + trackingAreaIds: + type: array + items: + type: string + minItems: 1 + description: Identifies a list of Tracking Area Identities of the user where the UE is located. + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + description: Identifies a list of civic addresses of the user where the UE is located. + LocationArea5G: + description: Represents a user location area when the UE is attached to 5G. + type: object + properties: + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 0 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 0 + description: Identifies a list of civic addresses of the user where the UE is located. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + ProblemDetails: + description: Represents additional information and details on an error response. + type: object + properties: + type: + $ref: '#/components/schemas/Uri' + title: + type: string + description: A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. + status: + type: integer + description: The HTTP status code for this occurrence of the problem. + detail: + type: string + description: A human-readable explanation specific to this occurrence of the problem. + instance: + $ref: '#/components/schemas/Uri' + cause: + type: string + description: A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. + invalidParams: + type: array + items: + $ref: '#/components/schemas/InvalidParam' + minItems: 1 + description: Description of invalid parameters, for a request rejected due to invalid parameters. + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + InvalidParam: + description: Represents the description of invalid parameters, for a request rejected due to invalid parameters. + type: object + properties: + param: + type: string + description: Attribute's name encoded as a JSON Pointer, or header's name. + reason: + type: string + description: A human-readable reason, e.g. "must be a positive integer". + required: + - param + PlmnId: + description: Represents the identifier of a PLMN. + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + required: + - mcc + - mnc + ConfigResult: + description: Represents one configuration processing result for a group's members. + type: object + properties: + externalIds: + type: array + items: + $ref: '#/components/schemas/ExternalId' + minItems: 1 + description: Each element indicates an external identifier of the UE. + msisdns: + type: array + items: + $ref: '#/components/schemas/Msisdn' + minItems: 1 + description: Each element identifies the MS internal PSTN/ISDN number allocated for the UE. + resultReason: + $ref: '#/components/schemas/ResultReason' + required: + - resultReason + oneOf: + - required: [externalIds] + - required: [msisdns] + Bandwidth: + type: integer + minimum: 0 + description: integer indicating a bandwidth in bits per second. + BdtReferenceId: + type: string + description: string identifying a BDT Reference ID as defined in clause 5.3.3 of 3GPP TS 29.154. + BdtReferenceIdRm: + type: string + description: This data type is defined in the same way as the BdtReferenceId data type, but with the nullable property set to true. + nullable: true + Binary: + type: string + description: string with format "binary" as defined in OpenAPI Specification. + Bytes: + type: string + description: String with format "byte" as defined in OpenAPI Specification, i.e, base64-encoded characters. + DayOfWeek: + type: integer + minimum: 1 + maximum: 7 + description: integer between and including 1 and 7 denoting a weekday. 1 shall indicate Monday, and the subsequent weekdays shall be indicated with the next higher numbers. 7 shall indicate Sunday. + DateTime: + format: date-time + type: string + description: string with format "date-time" as defined in OpenAPI. + DateTimeRm: + format: date-time + type: string + description: string with format "date-time" as defined in OpenAPI with "nullable=true" property. + nullable: true + DateTimeRo: + format: date-time + type: string + description: string with format "date-time" as defined in OpenAPI with "readOnly=true" property. + readOnly: true + DurationSec: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds. + DurationSecRm: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds with "nullable=true" property. + nullable: true + DurationSecRo: + type: integer + minimum: 0 + description: Unsigned integer identifying a period of time in units of seconds with "readOnly=true" property. + readOnly: true + DurationMin: + type: integer + format: int32 + minimum: 0 + description: Unsigned integer identifying a period of time in units of minutes. + ExternalId: + type: string + description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clause 4.6.2 of 3GPP TS 23.682 for more information. + ExternalGroupId: + type: string + description: string containing a local identifier followed by "@" and a domain identifier. Both the local identifier and the domain identifier shall be encoded as strings that do not contain any "@" characters. See Clauses 4.6.2 and 4.6.3 of 3GPP TS 23.682 for more information. + Ipv4Addr: + type: string + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166. + Ipv6Addr: + type: string + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + Ipv4AddrRo: + type: string + description: string identifying a Ipv4 address formatted in the "dotted decimal" notation as defined in IETF RFC 1166, with "readOnly=true" property. + readOnly: true + Ipv6AddrRo: + type: string + description: string identifying a Ipv6 address formatted according to clause 4 in IETF RFC 5952, with "readOnly=true" property. The mixed Ipv4 Ipv6 notation according to clause 5 of IETF RFC 5952 shall not be used. + readOnly: true + Link: + type: string + description: string formatted according to IETF RFC 3986 identifying a referenced resource. + LinkRm: + type: string + description: > + String formatted according to IETF RFC 3986 identifying a referenced resource, + but with the nullable property set to true. + nullable: true + Mcc: + type: string + description: String encoding a Mobile Country Code part of the PLMN, comprising 3 digits, as defined in 3GPP TS 38.413. + Mnc: + type: string + description: String encoding a Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in 3GPP TS 38.413. + Msisdn: + type: string + description: string formatted according to clause 3.3 of 3GPP TS 23.003 that describes an MSISDN. + Port: + type: integer + description: Unsigned integer with valid values between 0 and 65535. + minimum: 0 + maximum: 65535 + PortRo: + type: integer + description: Unsigned integer with valid values between 0 and 65535, with "readOnly=true" property. + minimum: 0 + maximum: 65535 + readOnly: true + ResourceId: + type: string + description: string chosen by the SCEF to serve as identifier in a resource URI. + ScsAsId: + type: string + description: string that identifies an SCS/AS. + TimeOfDay: + type: string + description: String with format partial-time or full-time as defined in clause 5.6 of IETF RFC 3339. Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). + Uri: + type: string + description: string providing an URI formatted according to IETF RFC 3986. + Volume: + type: integer + format: int64 + minimum: 0 + description: Unsigned integer identifying a volume in units of bytes. + VolumeRm: + type: integer + format: int64 + minimum: 0 + description: Unsigned integer identifying a volume in units of bytes with "nullable=true" property. + nullable: true + EthFlowInfo: + description: Represents Ethernet flow information. + type: object + properties: + flowId: + type: integer + description: Indicates the Ethernet flow identifier. + ethFlowDescriptions: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + description: > + Indicates the packet filters of the Ethernet flow. It shall contain UL and/or DL + Ethernet flow description. + minItems: 1 + maxItems: 2 + required: + - flowId + Event: + anyOf: + - type: string + enum: + - SESSION_TERMINATION + - LOSS_OF_BEARER + - RECOVERY_OF_BEARER + - RELEASE_OF_BEARER + - USAGE_REPORT + - FAILED_RESOURCES_ALLOCATION + - SUCCESSFUL_RESOURCES_ALLOCATION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SESSION_TERMINATION: Indicates that Rx session is terminated. + - LOSS_OF_BEARER : Indicates a loss of a bearer. + - RECOVERY_OF_BEARER: Indicates a recovery of a bearer. + - RELEASE_OF_BEARER: Indicates a release of a bearer. + - USAGE_REPORT: Indicates the usage report event. + - FAILED_RESOURCES_ALLOCATION: Indicates the resource allocation is failed. + - SUCCESSFUL_RESOURCES_ALLOCATION: Indicates the resource allocation is successful. + ResultReason: + anyOf: + - type: string + enum: + - ROAMING_NOT_ALLOWED + - OTHER_REASON + - type: string + description: > + This string provides a failure reason. + description: > + Possible values are + - ROAMING_NOT_ALLOWED: Identifies the configuration parameters are not allowed by roaming agreement. + - OTHER_REASON: Identifies the configuration parameters are not configured due to other reason. +# +# HTTP responses +# + responses: + '307': + description: Temporary Redirect + headers: + Location: + description: 'An alternative URI of the resource.' + required: true + schema: + type: string + '308': + description: Permanent Redirect + headers: + Location: + description: 'An alternative URI of the resource.' + required: true + schema: + type: string + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '406': + description: Not Acceptable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '409': + description: Conflict + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '411': + description: Length Required + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '412': + description: Precondition Failed + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '414': + description: URI Too Long + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + default: + description: Generic Error diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_CpProvisioning.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_CpProvisioning.yaml new file mode 100644 index 000000000..709059039 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_CpProvisioning.yaml @@ -0,0 +1,710 @@ +openapi: 3.0.0 +info: + title: 3gpp-cp-parameter-provisioning + version: 1.2.0 + description: | + API for provisioning communication pattern parameters. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-cp-parameter-provisioning/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + get: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + summary: Read all active CP parameter provisioning subscription resources for a given SCS/AS. + operationId: FetchAllCPProvisioningSubscriptions + tags: + - CP provisioning Subscriptions + responses: + '200': + description: OK. The subscription information related to the request URI is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CpInfo' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + summary: Create a new subscription resource of provisioning CP parameter set(s). + operationId: CreateCPProvisioningSubscription + tags: + - CP provisioning Subscriptions + requestBody: + description: create new subscriptions for a given SCS/AS and the provisioning CP parameter sets. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + responses: + '201': + description: Created. The subscription was created successfully. The SCEF shall return the created subscription in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The CP parameters for all sets were not created successfully. CpReport may be included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CpReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/subscriptions/{subscriptionId}: + get: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + summary: Read a CP parameter provisioning subscription resource. + operationId: FetchIndCPProvisioningSubscription + tags: + - Individual CP Provisioning Subscription + responses: + '200': + description: OK. The subscription information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Modify a CP parameter provisioning subscription resource. + operationId: UpdateIndCPProvisioningSubscription + tags: + - Individual CP Provisioning Subscription + requestBody: + description: Modify a CP parameter provisioning subscription resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. The subscription was modified successfully. The SCEF shall return an updated subscription in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/CpInfo' + '204': + description: No Content. The subscription was modified successfully and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The CP parameters for all sets were not updated successfully. CpReport may be included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CpReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + summary: Delete a CP parameter provisioning subscription resource. + operationId: DeleteIndCPProvisioningSubscription + tags: + - Individual CP Provisioning Subscription + responses: + '204': + description: No Content. The subscription was deleted successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/subscriptions/{subscriptionId}/cpSets/{setId}: + get: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + - name: setId + in: path + description: Identifier of the CP parameter set + required: true + schema: + type: string + summary: Read CP at individual CP set(s) level associated with a CP parameter set Id. + operationId: FetchIndCPSetProvisioning + tags: + - Individual CP set Provisioning + responses: + '200': + description: OK. The subscription information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/CpParameterSet' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update CP at individual CP set(s) level associated with a CP parameter set Id. + operationId: UpdateIndCPSetProvisioning + tags: + - Individual CP set Provisioning + requestBody: + description: Change information for a CP parameter set. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CpParameterSet' + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + - name: setId + in: path + description: Identifier of the CP parameter set + required: true + schema: + type: string + responses: + '200': + description: OK. The CP parameter set resource was modified successfully. The SCEF shall return an updated CP parameter set resource in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/CpParameterSet' + '204': + description: No Content. The CP parameter set resource was modified successfully and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + description: The CP parameters for the CP set were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/CpReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The CP parameters for the CP set were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/CpReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Subscription ID + required: true + schema: + type: string + - name: setId + in: path + description: Identifier of the CP parameter set + required: true + schema: + type: string + summary: Delete CP at individual CP set(s) level associated with a CP parameter set Id. + operationId: DeleteIndCPSetProvisioning + tags: + - Individual CP set Provisioning + responses: + '204': + description: No Content. The subscription was deleted successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + CpInfo: + description: Represents the resources for communication pattern parameter provisioning. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + cpParameterSets: + type: object + additionalProperties: + $ref: '#/components/schemas/CpParameterSet' + minProperties: 1 + description: Identifies a set of CP parameter information that may be part of this CpInfo structure. Any string value can be used as a key of the map. + cpReports: + type: object + additionalProperties: + $ref: '#/components/schemas/CpReport' + minProperties: 1 + description: Supplied by the SCEF and contains the CP set identifiers for which CP parameter(s) are not added or modified successfully. The failure reason is also included. Each element provides the related information for one or more CP set identifier(s) and is identified in the map via the failure identifier as key. + readOnly: true + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ueMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + required: + - cpParameterSets + oneOf: + - required: [externalId] + - required: [msisdn] + - required: [externalGroupId] + CpParameterSet: + description: Represents an offered communication pattern parameter set. + type: object + properties: + setId: + type: string + description: SCS/AS-chosen correlator provided by the SCS/AS in the request to create a resource fo CP parameter set(s). + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + validityTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + periodicCommunicationIndicator: + $ref: '#/components/schemas/CommunicationIndicator' + communicationDurationTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + periodicTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + scheduledCommunicationTime: + $ref: '#/components/schemas/ScheduledCommunicationTime' + scheduledCommunicationType: + $ref: '#/components/schemas/ScheduledCommunicationType' + stationaryIndication: + $ref: '#/components/schemas/StationaryIndication' + batteryInds: + type: array + items: + $ref: '#/components/schemas/BatteryIndication' + minItems: 1 + trafficProfile: + $ref: '#/components/schemas/TrafficProfile' + expectedUmts: + type: array + items: + $ref: '#/components/schemas/UmtLocationArea5G' + minItems: 1 + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + expectedUmtDays: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DayOfWeek' + required: + - setId + ScheduledCommunicationTime: + description: Represents an offered scheduled communication time. + type: object + properties: + daysOfWeek: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DayOfWeek' + minItems: 1 + maxItems: 6 + description: Identifies the day(s) of the week. If absent, it indicates every day of the week. + timeOfDayStart: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeOfDay' + timeOfDayEnd: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeOfDay' + CpReport: + description: Represents a CP report indicating the CP set identifier(s) which CP parameter(s) are not added or modified successfully and the corresponding failure cause(s). + type: object + properties: + setIds: + type: array + items: + type: string + minItems: 1 + description: Identifies the CP set identifier(s) which CP parameter(s) are not added or modified successfully + failureCode: + $ref: '#/components/schemas/CpFailureCode' + required: + - failureCode + UmtLocationArea5G: + description: Represents the user location area describing the UE moving trajectory. + allOf: + - $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + - type: object + properties: + umtTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeOfDay' + umtDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + CommunicationIndicator: + anyOf: + - type: string + enum: + - PERIODICALLY + - ON_DEMAND + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - PERIODICALLY: Identifies the UE communicates periodically + - ON_DEMAND: Identifies the UE communicates on demand + StationaryIndication: + anyOf: + - type: string + enum: + - STATIONARY + - MOBILE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - STATIONARY: Identifies the UE is stationary + - MOBILE: Identifies the UE is mobile + CpFailureCode: + anyOf: + - type: string + enum: + - MALFUNCTION + - SET_ID_DUPLICATED + - OTHER_REASON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - MALFUNCTION: This value indicates that something functions wrongly in CP parameter provisioning or the CP parameter provisioning does not function at all. + - SET_ID_DUPLICATED: The received CP set identifier(s) are already provisioned. + - OTHER_REASON: Other reason unspecified. + BatteryIndication: + anyOf: + - type: string + enum: + - BATTERY_RECHARGE + - BATTERY_REPLACE + - BATTERY_NO_RECHARGE + - BATTERY_NO_REPLACE + - NO_BATTERY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - BATTERY_RECHARGE: UE powered with rechargeable battery. + - BATTERY_REPLACE: UE powered with replaceable battery. + - BATTERY_NO_RECHARGE: UE powered with no rechargeable battery. + - BATTERY_NO_REPLACE: UE powered with no replaceable battery. + - NO_BATTERY: UE not battery powered. + TrafficProfile: + anyOf: + - type: string + enum: + - SINGLE_TRANS_UL + - SINGLE_TRANS_DL + - DUAL_TRANS_UL_FIRST + - DUAL_TRANS_DL_FIRST + - MULTI_TRANS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SINGLE_TRANS_UL: Uplink single packet transmission. + - SINGLE_TRANS_DL: Downlink single packet transmission. + - DUAL_TRANS_UL_FIRST: Dual packet transmission, firstly uplink packet transmission with subsequent downlink packet transmission. + - DUAL_TRANS_DL_FIRST: Dual packet transmission, firstly downlink packet transmission with subsequent uplink packet transmission. + - MULTI_TRANS: Multiple packet transmission. + ScheduledCommunicationType: + anyOf: + - type: string + enum: + - DOWNLINK + - UPLINK + - BIDIRECTIONAL + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - DOWNLINK: Downlink only. + - UPLINK: Uplink only. + - BIDIRECTIONAL: Bi-directional. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_DeviceTriggering.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_DeviceTriggering.yaml new file mode 100644 index 000000000..f3c041e50 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_DeviceTriggering.yaml @@ -0,0 +1,503 @@ +openapi: 3.0.0 +info: + title: 3gpp-device-triggering + version: 1.2.0 + description: | + API for device trigger. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-device-triggering/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/transactions: + get: + summary: read all active device triggering transactions for a given SCS/AS. + operationId: FetchAllDeviceTriggeringTransactions + tags: + - Device Triggering Transactions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + responses: + '200': + description: OK (Successful get all of the active device triggering transactions for the SCS/AS) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DeviceTriggering' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create a long-term transaction for a device triggering. + operationId: CreateDeviceTriggeringTransaction + tags: + - Device Triggering API Transactions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + requestBody: + description: Parameters to request a device triggering delivery. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggeringDeliveryReportNotification' + responses: + '200': + description: OK (successful notification) + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Acknowledgement' + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/transactions/{transactionId}: + get: + summary: Read a device triggering transaction resource. + operationId: FetchIndDeviceTriggeringTransaction + tags: + - Individual Device Triggering Transaction + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: transactionId + in: path + description: Identifier of the transaction resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Replace an existing device triggering transaction resource and the corresponding device trigger request. + operationId: UpdateIndDeviceTriggeringTransaction + tags: + - Individual Device Triggering Transaction + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: transactionId + in: path + description: Identifier of the transaction resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing device triggering + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + responses: + '200': + description: OK (Successful update of the device triggering) + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + '204': + description: No Content (Successful update of the device triggering) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing Individual Device Triggering Transaction resource and the corresponding device triggering request. + operationId: ModifyIndDeviceTriggeringTransaction + tags: + - Individual Device Triggering Transaction + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: transactionId + in: path + description: Identifier of the transaction resource + required: true + schema: + type: string + requestBody: + description: Parameters to request the modification of the existing Individual Device Triggering Transaction resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggeringPatch' + responses: + '200': + description: OK. The Individual Device Triggering Transaction resource was successfully modified and a representation of the modified Individual Device Triggering Transaction resource within the DeviceTriggering data structure including the "deliveryResult" attribute is returned by the SCEF. + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + '204': + description: No Content. The Individual Device Triggering Transaction resource was successfully modified no content is returned in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes an already existing device triggering transaction. + operationId: DeleteIndDeviceTriggeringTransaction + tags: + - Individual Device Triggering Transaction + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: transactionId + in: path + description: Identifier of the transaction resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceTriggering' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + DeviceTriggering: + description: Represents device triggering related information. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + validityPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + priority: + $ref: '#/components/schemas/Priority' + applicationPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + appSrcPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + triggerPayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + deliveryResult: + $ref: '#/components/schemas/DeliveryResult' + required: + - validityPeriod + - priority + - applicationPortId + - triggerPayload + - notificationDestination + oneOf: + - required: [externalId] + - required: [msisdn] + DeviceTriggeringDeliveryReportNotification: + description: Represents a device triggering delivery report notification. + type: object + properties: + transaction: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + result: + $ref: '#/components/schemas/DeliveryResult' + required: + - transaction + - result + DeviceTriggeringPatch: + description: Represents device triggering related information. + type: object + properties: + validityPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + priority: + $ref: '#/components/schemas/Priority' + applicationPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + appSrcPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + triggerPayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + DeliveryResult: + anyOf: + - type: string + enum: + - SUCCESS + - UNKNOWN + - FAILURE + - TRIGGERED + - EXPIRED + - UNCONFIRMED + - REPLACED + - TERMINATE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SUCCESS: This value indicates that the device action request was successfully completed. + - UNKNOWN: This value indicates any unspecified errors. + - FAILURE: This value indicates that this trigger encountered a delivery error and is deemed permanently undeliverable. + - TRIGGERED: This value indicates that device triggering request is accepted by the SCEF. + - EXPIRED: This value indicates that the validity period expired before the trigger could be delivered. + - UNCONFIRMED: This value indicates that the delivery of the device action request is not confirmed. + - REPLACED: This value indicates that the device triggering replacement request is accepted by the SCEF. + - TERMINATE: This value indicates that the delivery of the device action request is terminated by the SCS/AS. + readOnly: true + Priority: + anyOf: + - type: string + enum: + - NO_PRIORITY + - PRIORITY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - NO_PRIORITY: This value indicates that the device trigger has no priority. + - PRIORITY: This value indicates that the device trigger has priority. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ECRControl.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ECRControl.yaml new file mode 100644 index 000000000..8bb8645e7 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ECRControl.yaml @@ -0,0 +1,194 @@ +openapi: 3.0.0 +info: + title: 3gpp-ecr-control + version: 1.2.0 + description: | + API for enhanced converage restriction control. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-ecr-control/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /query: + post: + summary: Query the status of enhanced converage restriction for a UE. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ECRControl' + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ECRData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /configure: + post: + summary: Configure the enhanced converage restriction for a UE. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ECRControl' + responses: + '200': + description: The Enhanced Coverage Restriction setting was configured successfully.. + content: + application/json: + schema: + $ref: '#/components/schemas/ECRData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ECRControl: + description: Represents the parameters to request Enhanced Coverage Restriction control. + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + scsAsId: + type: string + description: Identifier of the SCS/AS. + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + ecrDataWbs: + type: array + items: + $ref: '#/components/schemas/PlmnEcRestrictionDataWb' + minItems: 0 + restrictedPlmnIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + minItems: 0 + description: Indicates a complete list (and possibly empty) of serving PLMNs where Enhanced Coverage shall be restricted. This attribute shall not be present for the query custom operation. + allowedPlmnIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + minItems: 0 + description: Indicates a complete list (and possibly empty) of serving PLMNs where Enhanced Coverage shall be allowed. This attribute shall not be present for the query custom operation. + required: + - supportedFeatures + oneOf: + - required: [externalId] + - required: [msisdn] + not: + required: [restrictedPlmnIds, allowedPlmnIds] + ECRData: + description: Represents the current visited PLMN (if any) and the current settings of enhanced coverage restriction. + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + visitedPlmnId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + ecrDataWbs: + type: array + items: + $ref: '#/components/schemas/PlmnEcRestrictionDataWb' + minItems: 0 + restrictedPlmnIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + minItems: 0 + description: Indicates a complete list (and possibly empty) of serving PLMNs where Enhanced Coverage shall be restricted. + allowedPlmnIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + minItems: 0 + description: Indicates a complete list (and possibly empty) of serving PLMNs where Enhanced Coverage shall be allowed. + required: + - supportedFeatures + not: + required: [restrictedPlmnIds, allowedPlmnIds] + PlmnEcRestrictionDataWb: + description: Indicates whether enhanced coverage mode is restricted or not for a PLMN ID. + type: object + properties: + plmnId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + plmnEcrDataWb: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/EcRestrictionDataWb' + required: + - plmnId diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_GMDviaMBMSbyMB2.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_GMDviaMBMSbyMB2.yaml new file mode 100644 index 000000000..0ee308534 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_GMDviaMBMSbyMB2.yaml @@ -0,0 +1,843 @@ +openapi: 3.0.0 +info: + title: GMDviaMBMSbyMB2 + description: | + API for Group Message Delivery via MBMS by MB2 + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + version: 1.2.0 +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-group-message-delivery-mb2/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/tmgi-allocation: + get: + summary: read all TMGI Allocation resource for a given SCS/AS + operationId: FetchAllTMGIAllocations + tags: + - TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of TMGI Allocation resource) + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new TMGI Allocation resource for a given SCS/AS. + operationId: CreateTMGIAllocation + tags: + - TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + requestBody: + description: representation of the TMGI Allocation to be created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + responses: + '201': + description: successful creation of an TMGI Allocation + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/tmgi-allocation/{tmgi}: + get: + summary: Read a TMGI Allocation resource for a given SCS/AS and a TMGI. + operationId: FetchIndTMGIAllocation + tags: + - Individual TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of TMGI Allocation resource) + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates an existing TMGI Allocation resource for a given SCS/AS and a TMGI. + operationId: UpdateIndTMGIAllocation + tags: + - Individual TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + requestBody: + description: representation of the TMGI Allocation to be updated in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + responses: + '200': + description: successful creation of an TMGI Allocation + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + '204': + description: The TMGI expiration time renewal is successful, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates an existing TMGI Allocation resource for a given SCS/AS and a TMGI. + operationId: ModifyIndTMGIAllocation + tags: + - Individual TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + requestBody: + description: representation of the TMGI Allocation to be updated in the SCEF + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/TMGIAllocationPatch' + responses: + '200': + description: successful creation of an TMGI Allocation + content: + application/json: + schema: + $ref: '#/components/schemas/TMGIAllocation' + '204': + description: The TMGI expiration time renewal is successful, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing TMGI Allocation resource for a given SCS/AS and a TMGI. + operationId: DeleteTMGIAllocation + tags: + - Individual TMGI Allocation Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + responses: + '204': + description: No Content, successful deletion of an TMGI Allocation + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/tmgi-allocation/{tmgi}/delivery-via-mbms: + get: + summary: Read all group message delivery via MBMS resource for a given SCS/AS and a TMGI. + operationId: FecthAllGMDViaMBMSByMB2 + tags: + - Delivery via MBMS Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of Delivery via MBMS resource) + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new delivery via MBMS for a given SCS/AS and a TMGI. + operationId: CreateGMDViaMBMSByMB2 + tags: + - Delivery via MBMS Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by MB2 resource to be Created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + callbacks: + gMDByMb2Notification: + '{$request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDByMb2Notification' + responses: + '200': + description: OK (The successful acknowledgement of the notification with a body) + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Acknowledgement' + '204': + description: successful notification + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: successful creation of an GMD via MBMS by MB2 resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/tmgi-allocation/{tmgi}/delivery-via-mbms/{transactionId}: + get: + summary: Read all group message delivery via MBMS resource for a given SCS/AS and a TMGI. + operationId: FetchIndDeliveryViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of an Delivery via MBMS resource) + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates a existing delivery via MBMS for a given SCS/AS, a TMGI and transaction Id. + operationId: UpdateIndDeliveryViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by MB2 resource to be udpated in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + responses: + '200': + description: successful update of an individual GMD via MBMS by MB2 resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + '204': + description: The group message delivery is replaced successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates a existing delivery via MBMS for a given SCS/AS, a TMGI and transaction Id. + operationId: ModifyIndDeliveryViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by MB2 resource to be udpated in the SCEF + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2Patch' + responses: + '200': + description: successful update of an individual GMD via MBMS by MB2 resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByMb2' + '204': + description: The group message delivery is modified successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a delivery via MBMS resource for a given SCS/AS, a TMGI and a transcation Id. + operationId: DeleteIndDeliveryViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: tmgi + in: path + description: TMGI + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '204': + description: No Content, successful deletion of an resouce of deliery via MBMS + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + TMGIAllocation: + description: Represents an individual TMGI Allocation resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + tmgiExpiration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRo' + GMDViaMBMSByMb2: + description: Represents a group message delivery via MBMS by MB2. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + messageDeliveryStartTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + groupMessagePayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + scefMessageDeliveryIPv4: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4AddrRo' + scefMessageDeliveryIPv6: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6AddrRo' + scefMessageDeliveryPort: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PortRo' + required: + - notificationDestination + GMDByMb2Notification: + description: Represents a group message delivery notification. + type: object + properties: + transaction: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + deliveryTriggerStatus: + type: boolean + description: Indicates whether delivery of group message payload corresponding to the TMGI was successful (TRUE) or not (FALSE) + required: + - transaction + - deliveryTriggerStatus + TMGIAllocationPatch: + description: Represents the parameters to request the modification of a TMGI Allocation resource. + type: object + properties: + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + GMDViaMBMSByMb2Patch: + description: Represents a modification request of a group message delivery via MBMS by MB2. + type: object + properties: + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + messageDeliveryStartTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + groupMessagePayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + MbmsLocArea: + description: Represents a user location area whithin which is sent a group message delivery via MBMS request. + type: object + properties: + cellId: + type: array + items: + type: string + minItems: 1 + description: Indicates a Cell Global Identification of the user which identifies the cell the UE is registered. + enodeBId: + type: array + items: + type: string + minItems: 1 + description: Indicates an eNodeB in which the UE is currently located. + geographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies a geographic area of the user where the UE is located. + mbmsServiceAreaId: + type: array + items: + type: string + minItems: 1 + description: Identifies an MBMS Service Area Identity of the user where the UE is located. + civicAddress: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + description: Identifies a civic address of the user where the UE is located. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_GMDviaMBMSbyxMB.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_GMDviaMBMSbyxMB.yaml new file mode 100644 index 000000000..619109e27 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_GMDviaMBMSbyxMB.yaml @@ -0,0 +1,761 @@ +openapi: 3.0.0 +info: + title: GMDviaMBMSbyxMB + description: | + API for Group Message Delivery via MBMS by xMB + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + version: 1.2.0 +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-group-message-delivery-xmb/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/services: + get: + summary: Read all service resources for a given SCS/AS. + operationId: FetchAllxMBServices + tags: + - Service Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of service creation resource) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceCreation' + minItems: 0 + description: The service resource for the SCS/AS in the request URI is returned. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new service creation resource for a given SCS/AS. + operationId: CreatexMBService + tags: + - Service Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + requestBody: + description: representation of the service to be created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceCreation' + responses: + '201': + description: successful creation of a service + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceCreation' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/services/{serviceId}: + get: + summary: Read a service resource for a given SCS/AS and a Service Id. + operationId: FetchIndxMBService + tags: + - Individual Service Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of service resource) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceCreation' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing service resource for a given SCS/AS and a service id. + operationId: DeletexMBService + tags: + - Individual Service Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + responses: + '204': + description: No Content, successful deletion of a service resource + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/services/{serviceId}/delivery-via-mbms: + get: + summary: Read all group message delivery via MBMS resource for a given SCS/AS and a service id. + operationId: FetchAllGMDViaMBMS + tags: + - Delivery via MBMS Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of Delivery via MBMS resource) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new delivery via MBMS for a given SCS/AS and a service Id. + operationId: CreateGMDViaMBMS + tags: + - Delivery via MBMS Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by xMB resource to be Created in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + callbacks: + gMDByxMBNotification: + '{$request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDByxMBNotification' + responses: + '200': + description: OK (The successful acknowledgement of the notification with a body) + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Acknowledgement' + '204': + description: successful notification + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: successful creation of an GMD via MBMS by xMB resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/services/{serviceId}/delivery-via-mbms/{transactionId}: + get: + summary: Read all group message delivery via MBMS resource for a given SCS/AS and a service Id. + operationId: FetchIndGMDViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '200': + description: OK (successful query of an Delivery via MBMS resource) + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates an existing delivery via MBMS for a given SCS/AS, a service Id and transaction Id. + operationId: UpdateIndGMDViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by xMB resource to be udpated in the SCEF + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + responses: + '200': + description: successful update of an individual GMD via MBMS by xMB resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + '204': + description: The group message delivery was modified successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates an existing delivery via MBMS for a given SCS/AS, a service Id and transaction Id. + operationId: ModifyIndGMDViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + requestBody: + description: representation of the GMD via MBMS by xMB resource to be udpated in the SCEF + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMBPatch' + responses: + '200': + description: successful update of an individual GMD via MBMS by xMB resource + content: + application/json: + schema: + $ref: '#/components/schemas/GMDViaMBMSByxMB' + '204': + description: The group message delivery was modified successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a delivery via MBMS resource for a given SCS/AS, a service Id and a transcation Id. + operationId: DeleteIndGMDViaMBMS + tags: + - Individual Delivery via MBMS resource Operation + parameters: + - name: scsAsId + in: path + description: Identifier of SCS/AS + required: true + schema: + type: string + - name: serviceId + in: path + description: Service Id + required: true + schema: + type: string + - name: transactionId + in: path + description: Identifier of transaction + required: true + schema: + type: string + responses: + '204': + description: No Content, successful deletion of an resouce of deliery via MBMS + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ServiceCreation: + description: Represents an individual xMB Service resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + userServiceId: + type: string + description: Identifies the MBMS User Service supplied by the SCEF. + readOnly: true + serviceClass: + type: string + description: The service class that service belongs to supplied by the SCEF. + readOnly: true + serviceLanguages: + type: array + items: + type: string + minItems: 1 + description: List of language of the service content supplied by the SCEF. + readOnly: true + serviceNames: + type: array + items: + type: string + minItems: 1 + description: List of Service Names supplied by the SCEF. + readOnly: true + receiveOnlyMode: + type: boolean + description: When set to 'true', the Content Provider indicates that the service is a Receive Only Mode service. This parameter is supplied by the SCEF. + readOnly: true + serviceAnnouncementMode: + $ref: '#/components/schemas/ServiceAnnouncementMode' + GMDViaMBMSByxMB: + description: Represents a group message delivery via MBMS by xMB. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + messageDeliveryStartTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + messageDeliveryStopTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + groupMessagePayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + scefMessageDeliveryIPv4: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4AddrRo' + scefMessageDeliveryIPv6: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6AddrRo' + scefMessageDeliveryPort: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PortRo' + required: + - notificationDestination + GMDByxMBNotification: + description: Represents a group message delivery notification. + type: object + properties: + transaction: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + deliveryTriggerStatus: + type: boolean + description: Indicates whether delivery of group message payload was successful(TRUE) or not (FALSE) + required: + - transaction + - deliveryTriggerStatus + GMDViaMBMSByxMBPatch: + description: Represents a modification request of a group message delivery via MBMS by xMB. + type: object + properties: + mbmsLocArea: + $ref: '#/components/schemas/MbmsLocArea' + messageDeliveryStartTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + messageDeliveryStopTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + groupMessagePayload: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + MbmsLocArea: + description: Represents a user location area whithin which is sent a group message delivery via MBMS request. + type: object + properties: + cellId: + type: array + items: + type: string + minItems: 1 + description: Indicates a Cell Global Identification of the user which identifies the cell the UE is registered. + enodeBId: + type: array + items: + type: string + minItems: 1 + description: Indicates an eNodeB in which the UE is currently located. + geographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies a geographic area of the user where the UE is located. + mbmsServiceAreaId: + type: array + items: + type: string + minItems: 1 + description: Identifies an MBMS Service Area Identity of the user where the UE is located. + civicAddress: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + description: Identifies a civic address of the user where the UE is located. + ServiceAnnouncementMode: + anyOf: + - type: string + enum: + - SACH + - CONTENT_PROVIDER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SACH: BM-SC performs the service announcement for the current service using the SACH channel. + - CONTENT_PROVIDER: BM-SC provides the necessary service access information used by the Content Provider to create the service announcement information. + readOnly: true diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_MonitoringEvent.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_MonitoringEvent.yaml new file mode 100644 index 000000000..094fe0fee --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_MonitoringEvent.yaml @@ -0,0 +1,1196 @@ +openapi: 3.0.0 +info: + title: 3gpp-monitoring-event + version: 1.2.1 + description: | + API for Monitoring Event. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-monitoring-event/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + get: + summary: Read all or queried active subscriptions for the SCS/AS. + operationId: FetchAllMonitoringEventSubscriptions + tags: + - Monitoring Event Subscriptions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: ip-addrs + in: query + description: The IP address(es) of the requested UE(s). + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + - name: ip-domain + in: query + description: The IPv4 address domain identifier. The attribute may only be provided if IPv4 address is included in the ip-addrs query parameter. + required: false + schema: + type: string + - name: mac-addrs + in: query + description: The MAC address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + responses: + '200': + description: OK (Successful get all or queried active subscriptions for the SCS/AS) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MonitoringEventSubscription' + minItems: 0 + description: Monitoring event subscriptions + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource for monitoring event notification. + operationId: CreateMonitoringEventSubscription + tags: + - Monitoring Event Subscriptions + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + requestBody: + description: Subscription for notification about monitoring event + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + UserConsentRevocationNotif: + '{request.body#/revocationNotifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentRevocNotif' + responses: + '204': + description: No Content (successful notification). + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: The operation is successful and immediate report is included. + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/MonitoringEventReport' + - $ref: '#/components/schemas/MonitoringEventReports' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/subscriptions/{subscriptionId}: + get: + summary: Read an active subscriptions for the SCS/AS and the subscription Id. + operationId: FetchIndMonitoringEventSubscription + tags: + - Individual Monitoring Event Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing subscription resource. + operationId: UpdateIndMonitoringEventSubscription + tags: + - Individual Monitoring Event Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/MonitoringEventSubscription' + '204': + description: No Content (Successful update of the subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Modifies an existing subscription of monitoring event. + operationId: ModifyIndMonitoringEventSubscription + tags: + - Individual Monitoring Event Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource. + required: true + schema: + type: string + requestBody: + description: This is used for PATCH request for partial cancellation and/or partial addition of certain UE(s) within an active group. + required: true + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + responses: + '204': + description: The resource was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing monitoring event subscription. + operationId: DeleteIndMonitoringEventSubscription + tags: + - Individual Monitoring Event Subscription + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MonitoringEventReport' + minItems: 1 + description: The subscription was terminated successfully, the monitoring event report(s) shall be included if received. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + MonitoringEventSubscription: + description: Represents a subscription to event(s) monitoring. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + addedExternalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Indicates the added external Identifier(s) within the active group. + addedMsisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Indicates the added MSISDN(s) within the active group. + excludedExternalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Indicates cancellation of the external Identifier(s) within the active group. + excludedMsisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Indicates cancellation of the MSISDN(s) within the active group. + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + addExtGroupId: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + minItems: 2 + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + monitoringType: + $ref: '#/components/schemas/MonitoringType' + maximumNumberOfReports: + type: integer + minimum: 1 + description: Identifies the maximum number of event reports to be generated by the HSS, MME/SGSN as specified in clause 5.6.0 of 3GPP TS 23.682. + monitorExpireTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + groupReportGuardTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumDetectionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + reachabilityType: + $ref: '#/components/schemas/ReachabilityType' + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumResponseTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + suggestedNumberOfDlPackets: + type: integer + minimum: 0 + description: If "monitoringType" is "UE_REACHABILITY", this parameter may be included to identify the number of packets that the serving gateway shall buffer in case that the UE is not reachable. + idleStatusIndication: + type: boolean + description: If "monitoringType" is set to "UE_REACHABILITY" or "AVAILABILITY_AFTER_DDN_FAILURE", this parameter may be included to indicate the notification of when a UE, for which PSM is enabled, transitions into idle mode. "true" indicates enabling of notification; "false" indicate no need to notify. Default value is "false". + locationType: + $ref: '#/components/schemas/LocationType' + accuracy: + $ref: '#/components/schemas/Accuracy' + minimumReportInterval: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maxRptExpireIntvl: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + samplingInterval: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + reportingLocEstInd: + type: boolean + description: Indicates whether to request the location estimate for event reporting. + linearDistance: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LinearDistance' + locQoS: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocationQoS' + svcId: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/ServiceIdentity' + ldrType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrType' + velocityRequested: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityRequested' + maxAgeOfLocEst: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + locTimeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + supportedGADShapes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + codeWord: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/CodeWord' + associationType: + $ref: '#/components/schemas/AssociationType' + plmnIndication: + type: boolean + description: If "monitoringType" is "ROAMING_STATUS", this parameter may be included to indicate the notification of UE's Serving PLMN ID. Value "true" indicates enabling of notification; "false" indicates disabling of notification. Default value is "false". + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + dddTraDescriptors: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + dddStati: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + apiNames: + type: array + items: + type: string + minItems: 1 + monitoringEventReport: + $ref: '#/components/schemas/MonitoringEventReport' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + tgtNsThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SACInfo' + nsRepFormat: + $ref: '#/components/schemas/SACRepFormat' + afServiceId: + type: string + immediateRep: + type: boolean + uavPolicy: + $ref: '#/components/schemas/UavPolicy' + sesEstInd: + type: boolean + description: Set to true by the SCS/AS so that only UAV's with "PDU session established for DNN(s) subject to aerial service" are to be listed in the Event report. Set to false or omitted otherwise. + subType: + $ref: '#/components/schemas/SubType' + addnMonTypes: + type: array + items: + $ref: '#/components/schemas/MonitoringType' + addnMonEventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringEventReport' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ueMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + revocationNotifUri: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' + required: + - notificationDestination + - monitoringType + anyOf: + - required: [maximumNumberOfReports] + - required: [monitorExpireTime] + MonitoringNotification: + description: Represents an event monitoring notification. + type: object + properties: + subscription: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + configResults: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ConfigResult' + minItems: 1 + description: Each element identifies a notification of grouping configuration result. + monitoringEventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringEventReport' + minItems: 1 + description: Monitoring event reports. + addedExternalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Identifies the added external Identifier(s) within the active group via the "externalGroupId" attribute within the MonitoringEventSubscription data type. + addedMsisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Identifies the added MSISDN(s) within the active group via the "externalGroupId" attribute within the MonitoringEventSubscription data type. + cancelExternalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Identifies the cancelled external Identifier(s) within the active group via the "externalGroupId" attribute within the MonitoringEventSubscription data type. + cancelMsisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Identifies the cancelled MSISDN(s) within the active group via the "externalGroupId" attribute within the MonitoringEventSubscription data type. + cancelInd: + type: boolean + description: > + Indicates whether to request to cancel the corresponding monitoring subscription. + Set to false or omitted otherwise. + appliedParam: + $ref: '#/components/schemas/AppliedParameterConfiguration' + required: + - subscription + MonitoringEventReport: + description: Represents an event monitoring report. + type: object + properties: + imeiChange: + $ref: '#/components/schemas/AssociationType' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + idleStatusInfo: + $ref: '#/components/schemas/IdleStatusInfo' + locationInfo: + $ref: '#/components/schemas/LocationInfo' + locFailureCause: + $ref: '#/components/schemas/LocationFailureCause' + lossOfConnectReason: + type: integer + description: If "monitoringType" is "LOSS_OF_CONNECTIVITY", this parameter shall be included if available to identify the reason why loss of connectivity is reported. Refer to 3GPP TS 29.336 clause 8.4.58. + maxUEAvailabilityTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + monitoringType: + $ref: '#/components/schemas/MonitoringType' + uePerLocationReport: + $ref: '#/components/schemas/UePerLocationReport' + plmnId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/PlmnId' + reachabilityType: + $ref: '#/components/schemas/ReachabilityType' + roamingStatus: + type: boolean + description: If "monitoringType" is "ROAMING_STATUS", this parameter shall be set to "true" if the UE is on roaming status. Set to false or omitted otherwise. + failureCause: + $ref: '#/components/schemas/FailureCause' + eventTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + pdnConnInfoList: + type: array + items: + $ref: '#/components/schemas/PdnConnectionInformation' + minItems: 1 + dddStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + dddTrafDescriptor: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + maxWaitTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + apiCaps: + type: array + items: + $ref: '#/components/schemas/ApiCapabilityInfo' + minItems: 0 + nSStatusInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SACEventStatus' + afServiceId: + type: string + servLevelDevId: + type: string + description: If "monitoringType" is "AREA_OF_INTEREST", this parameter may be included to identify the UAV. + uavPresInd: + type: boolean + description: If "monitoringType" is "AREA_OF_INTEREST", this parameter shall be set to true if the specified UAV is in the monitoring area. Set to false or omitted otherwise. + required: + - monitoringType + MonitoringEventReports: + description: Represents a set of event monitoring reports. + type: object + properties: + monitoringEventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringEventReport' + minItems: 1 + required: + - monitoringEventReports + IdleStatusInfo: + description: Represents the information relevant to when the UE transitions into idle mode. + type: object + properties: + activeTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + edrxCycleLength: + format: float + type: number + minimum: 0 + suggestedNumberOfDlPackets: + type: integer + minimum: 0 + description: Identifies the number of packets shall be buffered in the serving gateway. It shall be present if the idle status indication is requested by the SCS/AS with "idleStatusIndication" in the "monitoringEventSubscription" sets to "true". + idleStatusTimestamp: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + periodicAUTimer: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + UePerLocationReport: + description: Represents the number of UEs found at the indicated location. + type: object + properties: + ueCount: + type: integer + minimum: 0 + description: Identifies the number of UEs. + externalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Each element uniquely identifies a user. + msisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Each element identifies the MS internal PSTN/ISDN number allocated for a UE. + servLevelDevIds: + type: array + items: + type: string + minItems: 1 + description: Each element uniquely identifies a UAV. + required: + - ueCount + LocationInfo: + description: Represents the user location information. + type: object + properties: + ageOfLocationInfo: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationMin' + cellId: + type: string + description: Indicates the Cell Global Identification of the user which identifies the cell the UE is registered. + enodeBId: + type: string + description: Indicates the eNodeB in which the UE is currently located. + routingAreaId: + type: string + description: Identifies the Routing Area Identity of the user where the UE is located. + trackingAreaId: + type: string + description: Identifies the Tracking Area Identity of the user where the UE is located. + plmnId: + type: string + description: Identifies the PLMN Identity of the user where the UE is located. + twanId: + type: string + description: Identifies the TWAN Identity of the user where the UE is located. + geographicArea: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + positionMethod: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethod' + qosFulfilInd: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AccuracyFulfilmentIndicator' + ueVelocity: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' + ldrType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrType' + achievedQos: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MinorLocationQoS' + FailureCause: + description: Represents the reason of communication failure. + type: object + properties: + bssgpCause: + type: integer + description: Identifies a non-transparent copy of the BSSGP cause code. Refer to 3GPP TS 29.128. + causeType: + type: integer + description: Identify the type of the S1AP-Cause. Refer to 3GPP TS 29.128. + gmmCause: + type: integer + description: Identifies a non-transparent copy of the GMM cause code. Refer to 3GPP TS 29.128. + ranapCause: + type: integer + description: Identifies a non-transparent copy of the RANAP cause code. Refer to 3GPP TS 29.128. + ranNasCause: + type: string + description: Indicates RAN and/or NAS release cause code information, TWAN release cause code information or untrusted WLAN release cause code information. Refer to 3GPP TS 29.214. + s1ApCause: + type: integer + description: Identifies a non-transparent copy of the S1AP cause code. Refer to 3GPP TS 29.128. + smCause: + type: integer + description: Identifies a non-transparent copy of the SM cause code. Refer to 3GPP TS 29.128. + PdnConnectionInformation: + description: Represents the PDN connection information of the UE. + type: object + properties: + status: + $ref: '#/components/schemas/PdnConnectionStatus' + apn: + type: string + description: Identify the APN, it is depending on the SCEF local configuration whether or not this attribute is sent to the SCS/AS. + pdnType: + $ref: '#/components/schemas/PdnType' + interfaceInd: + $ref: '#/components/schemas/InterfaceIndication' + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addrs: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + macAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + required: + - status + - pdnType + AppliedParameterConfiguration: + description: Represents the parameter configuration applied in the network. + type: object + properties: + externalIds: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + minItems: 1 + description: Each element uniquely identifies a user. + msisdns: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + minItems: 1 + description: Each element identifies the MS internal PSTN/ISDN number allocated for a UE. + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumResponseTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumDetectionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + ApiCapabilityInfo: + description: Represents the availability information of supported API. + type: object + properties: + apiName: + type: string + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - apiName + - suppFeat + UavPolicy: + description: Represents the policy information included in the UAV presence monitoring request. + type: object + properties: + uavMoveInd: + type: boolean + revokeInd: + type: boolean + required: + - uavMoveInd + - revokeInd + + ConsentRevocNotif: + description: > + Represents the user consent revocation information conveyed in a user consent + revocation notification. + type: object + properties: + subscriptionId: + type: string + consentsRevoked: + type: array + items: + $ref: '#/components/schemas/ConsentRevoked' + minItems: 1 + required: + - subscriptionId + - consentsRevoked + + ConsentRevoked: + description: Represents the information related to a revoked user consent. + type: object + properties: + ucPurpose: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/UcPurpose' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + required: + - ucPurpose + oneOf: + - required: [externalId] + - required: [msisdn] + +# +# ENUMS +# + MonitoringType: + anyOf: + - type: string + enum: + - LOSS_OF_CONNECTIVITY + - UE_REACHABILITY + - LOCATION_REPORTING + - CHANGE_OF_IMSI_IMEI_ASSOCIATION + - ROAMING_STATUS + - COMMUNICATION_FAILURE + - AVAILABILITY_AFTER_DDN_FAILURE + - NUMBER_OF_UES_IN_AN_AREA + - PDN_CONNECTIVITY_STATUS + - DOWNLINK_DATA_DELIVERY_STATUS + - API_SUPPORT_CAPABILITY + - NUM_OF_REGD_UES + - NUM_OF_ESTD_PDU_SESSIONS + - AREA_OF_INTEREST + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - LOSS_OF_CONNECTIVITY: The SCS/AS requests to be notified when the 3GPP network detects that the UE is no longer reachable for signalling or user plane communication + - UE_REACHABILITY: The SCS/AS requests to be notified when the UE becomes reachable for sending either SMS or downlink data to the UE + - LOCATION_REPORTING: The SCS/AS requests to be notified of the current location or the last known location of the UE + - CHANGE_OF_IMSI_IMEI_ASSOCIATION: The SCS/AS requests to be notified when the association of an ME (IMEI(SV)) that uses a specific subscription (IMSI) is changed + - ROAMING_STATUS: The SCS/AS queries the UE's current roaming status and requests to get notified when the status changes + - COMMUNICATION_FAILURE: The SCS/AS requests to be notified of communication failure events + - AVAILABILITY_AFTER_DDN_FAILURE: The SCS/AS requests to be notified when the UE has become available after a DDN failure + - NUMBER_OF_UES_IN_AN_AREA: The SCS/AS requests to be notified the number of UEs in a given geographic area + - PDN_CONNECTIVITY_STATUS: The SCS/AS requests to be notified when the 3GPP network detects that the UE’s PDN connection is set up or torn down + - DOWNLINK_DATA_DELIVERY_STATUS: The AF requests to be notified when the 3GPP network detects that the downlink data delivery status is changed. + - API_SUPPORT_CAPABILITY: The SCS/AS requests to be notified of the availability of support of service APIs. + - NUM_OF_REGD_UES: The AF requests to be notified of the current number of registered UEs for a network slice. + - NUM_OF_ESTD_PDU_SESSIONS: The AF requests to be notified of the current number of established PDU Sessions for a network slice. + - AREA_OF_INTEREST: The SCS/AS requests to be notified when the UAV moves in or out of the geographic area. + ReachabilityType: + anyOf: + - type: string + enum: + - SMS + - DATA + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SMS : The SCS/AS requests to be notified when the UE becomes reachable for sending SMS to the UE + - DATA: The SCS/AS requests to be notified when the UE becomes reachable for sending downlink data to the UE + LocationType: + anyOf: + - type: string + enum: + - CURRENT_LOCATION + - LAST_KNOWN_LOCATION + - CURRENT_OR_LAST_KNOWN_LOCATION + - INITIAL_LOCATION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CURRENT_LOCATION: The SCS/AS requests to be notified for current location + - LAST_KNOWN_LOCATION: The SCS/AS requests to be notified for last known location + - CURRENT_OR_LAST_KNOWN_LOCATION: The AF requests the current or last known location + - INITIAL_LOCATION: The AF requests the initial location + AssociationType: + anyOf: + - type: string + enum: + - IMEI + - IMEISV + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - IMEI: The value shall be used when the change of IMSI-IMEI association shall be detected + - IMEISV: The value shall be used when the change of IMSI-IMEISV association shall be detected + Accuracy: + anyOf: + - type: string + enum: + - CGI_ECGI + - ENODEB + - TA_RA + - PLMN + - TWAN_ID + - GEO_AREA + - CIVIC_ADDR + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CGI_ECGI: The SCS/AS requests to be notified using cell level location accuracy. + - ENODEB: The SCS/AS requests to be notified using eNodeB level location accuracy. + - TA_RA: The SCS/AS requests to be notified using TA/RA level location accuracy. + - PLMN: The SCS/AS requests to be notified using PLMN level location accuracy. + - TWAN_ID: The SCS/AS requests to be notified using TWAN identifier level location accuracy. + - GEO_AREA: The SCS/AS requests to be notified using the geographical area accuracy. + - CIVIC_ADDR: The SCS/AS requests to be notified using the civic address accuracy. + PdnConnectionStatus: + anyOf: + - type: string + enum: + - CREATED + - RELEASED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CREATED: The PDN connection is created. + - RELEASED: The PDN connection is released. + PdnType: + anyOf: + - type: string + enum: + - IPV4 + - IPV6 + - IPV4V6 + - NON_IP + - ETHERNET + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - IPV4: PDN connection of IPv4 type. + - IPV6: PDN connection of IPv6 type. + - IPV4V6: PDN connection of IPv4v6 type. + - NON_IP: PDN connection of non-IP type. + - ETHERNET: PDN connection of Ethernet type. + InterfaceIndication: + anyOf: + - type: string + enum: + - EXPOSURE_FUNCTION + - PDN_GATEWAY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - EXPOSURE_FUNCTION: SCEF is used for the PDN connection towards the SCS/AS. + - PDN_GATEWAY: PDN gateway is used for the PDN connection towards the SCS/AS. + LocationFailureCause: + anyOf: + - type: string + enum: + - POSITIONING_DENIED + - UNSUPPORTED_BY_UE + - NOT_REGISTED_UE + - UNSPECIFIED + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: > + This string Indicates the location positioning failure cause. + Possible values are + - POSITIONING_DENIED: Positioning is denied. + - UNSUPPORTED_BY_UE: Positioning is not supported by UE. + - NOT_REGISTED_UE: UE is not registered. + - UNSPECIFIED: Unspecified. + SubType: + anyOf: + - type: string + enum: + - AERIAL_UE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - AERIAL_UE: The UE has Aerial subscription. + SACRepFormat: + anyOf: + - type: string + enum: + - NUMERICAL + - PERCENTAGE + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: Indicates the NSAC reporting format. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_MsisdnLessMoSms.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_MsisdnLessMoSms.yaml new file mode 100644 index 000000000..bc3d12c77 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_MsisdnLessMoSms.yaml @@ -0,0 +1,102 @@ +openapi: 3.0.0 +info: + title: 3gpp-msisdn-less-mo-sms + version: 1.2.0 + description: | + API for MSISDN-less Mobile Originated SMS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /: + post: + summary: Deliver a received MSIDN-less MO SMS from the SCEF to the SCS/AS. + operationId: DeliverMSISDNlessMOSMSNotification + tags: + - MSISDN-less MO SMS Notification + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MsisdnLessMoSmsNotification' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/MsisdnLessMoSmsNotificationReply' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + MsisdnLessMoSmsNotification: + description: Represents a MSISDN-less MO SMS notification. + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + sms: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + externalId: + type: string + description: External identifier has the form username@realm. + applicationPort: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + required: + - supportedFeatures + - sms + - externalId + - applicationPort + MsisdnLessMoSmsNotificationReply: + description: Represents a reply to a MSISDN-less MO SMS notification. + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supportedFeatures diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_NIDD.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_NIDD.yaml new file mode 100644 index 000000000..5caaa2252 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_NIDD.yaml @@ -0,0 +1,1233 @@ +openapi: 3.0.0 +info: + title: 3gpp-nidd + version: 1.2.1 + description: | + API for non IP data delivery. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-nidd/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/configurations: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + get: + summary: Read all NIDD configuration resources for a given SCS/AS. + operationId: FetchAllNIDDConfigurations + tags: + - NIDD configurations + responses: + '200': + description: all NIDD configurations. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NiddConfiguration' + minItems: 0 + description: individual NIDD configuration. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create a new NIDD configuration resource. + operationId: CreateNIDDConfiguration + tags: + - NIDD configurations + requestBody: + description: Contains the data to create a NIDD configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfiguration' + responses: + '201': + description: NIDD configuration is successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfiguration' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + niddNotifications: + '{$request.body#/notificationDestination}': + post: + requestBody: + description: Notification for NIDD configuration status, MO NIDD, MT NIDD delivery report. + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NiddConfigurationStatusNotification' + - $ref: '#/components/schemas/NiddUplinkDataNotification' + - $ref: '#/components/schemas/NiddDownlinkDataDeliveryStatusNotification' + - $ref: '#/components/schemas/GmdNiddDownlinkDataDeliveryNotification' + - $ref: '#/components/schemas/ManagePortNotification' + responses: + '204': + description: Expected response to a successful callback processing without a body + '200': + description: Expected response to a successful callback processing with a body + content: + application/json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Acknowledgement' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/configurations/{configurationId}: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read an NIDD configuration resource. + operationId: FetchIndNIDDConfiguration + tags: + - Individual NIDD configuration + responses: + '200': + description: The individual NIDD configuration is successfully retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfiguration' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing NIDD configuration resource. + operationId: ModifyNIDDConfiguration + tags: + - Individual NIDD configuration + requestBody: + description: Contains information to be applied to the individual NIDD configuration. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/NiddConfigurationPatch' + responses: + '200': + description: The Individual NIDD configuration is modified successfully and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfiguration' + '204': + description: The Individual NIDD configuration is modified successfully and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an existing NIDD configuration resource. + operationId: DeleteNIDDConfiguration + tags: + - Individual NIDD configuration + responses: + '204': + description: The Individual NIDD configuration is deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/configurations/{configurationId}/downlink-data-deliveries: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read all pending NIDD downlink data delivery resources related to a particular NIDD configuration resource. + operationId: FetchAllDownlinkDataDeliveries + tags: + - NIDD downlink data deliveries + responses: + '200': + description: all NIDD downlink data deliveries. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + minItems: 0 + description: individual NIDD downlink data delivery. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create an NIDD downlink data delivery resource related to a particular NIDD configuration resource. + operationId: CreateDownlinkDataDelivery + tags: + - NIDD downlink data deliveries + requestBody: + description: Contains the data to create a NIDD downlink data delivery. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + responses: + '200': + description: NIDD downlink data delivery is successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + '201': + description: NIDD downlink data delivery is pending. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The NIDD downlink data delivery request was not successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/configurations/{configurationId}/downlink-data-deliveries/{downlinkDataDeliveryId}: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + - name: downlinkDataDeliveryId + description: String identifying the individual NIDD downlink data delivery in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read pending NIDD downlink data delivery resource. + operationId: FetchIndDownlinkDataDelivery + tags: + - Individual NIDD downlink data delivery + responses: + '200': + description: The individual NIDD downlink data delivery is successfully retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Replace an NIDD downlink data delivery resource. + operationId: UpdateIndDownlinkDataDelivery + tags: + - Individual NIDD downlink data delivery + requestBody: + description: Contains information to be applied to the individual NIDD downlink data delivery. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + responses: + '200': + description: The pending NIDD downlink data is replaced sucessfully but delivery is pending. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + '204': + description: The NIDD downlink data delivery has been replaced successfully and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The NIDD downlink data replacement request was not successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing Individual NIDD downlink data delivery resource. + operationId: ModifyIndDownlinkDataDelivery + tags: + - Individual NIDD downlink data delivery + requestBody: + description: Contains the parameters to update an individual NIDD downlink data delivery resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransferPatch' + responses: + '200': + description: OK. The modification of the Individual NIDD downlink data delivery resource was successful and an updated representation of the resource within the NiddDownlinkDataTransfer data structure in the response message body is returned by the SCEF. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + '204': + description: No Content. The modification of the Individual NIDD downlink data delivery resource was successful and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error. The NIDD downlink data modification request was not successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an NIDD downlink data delivery resource. + operationId: DeleteIndDownlinkDataDelivery + tags: + - Individual NIDD downlink data delivery + responses: + '204': + description: The pending NIDD downlink data is deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The NIDD downlink data cancellation request was not successful. + content: + application/json: + schema: + $ref: '#/components/schemas/NiddDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/configurations/{configurationId}/rds-ports: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read all RDS ManagePort Configurations. + operationId: FetchAllManagePortConfigurations + tags: + - ManagePort Configurations + responses: + '200': + description: all ManagePort configurations. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ManagePort' + minItems: 0 + description: individual ManagePort configuration. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/configurations/{configurationId}/rds-ports/{portId}: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: configurationId + description: String identifying the individual NIDD configuration resource in the SCEF. + in: path + required: true + schema: + type: string + - name: portId + description: The UE port number. + in: path + required: true + schema: + type: string + pattern: '^(ue([0-9]|(1[0-5]))-ef([0-9]|(1[0-5])))$' + get: + summary: Read an Individual ManagePort Configuration resource to query port numbers. + operationId: FetchIndManagePortConfiguration + tags: + - Individual ManagePort Configuration + responses: + '200': + description: The individual ManagePort configuration is successfully retrieved. + content: + application/json: + schema: + $ref: '#/components/schemas/ManagePort' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Create a new Individual ManagePort Configuration resource to reserve port numbers. + operationId: UpdateIndManagePortConfiguration + tags: + - Individual ManagePort Configuration + requestBody: + description: Contains information to be applied to the individual ManagePort configuration. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ManagePort' + responses: + '201': + description: The individual ManagePort configuration is created. + content: + application/json: + schema: + $ref: '#/components/schemas/ManagePort' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '202': + description: The request is accepted and under processing. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The request was not successful. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RdsDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an Individual ManagePort Configuration resource to release port numbers. + operationId: DeleteIndManagePortConfiguration + tags: + - Individual ManagePort Configuration + responses: + '202': + description: The request is accepted and under processing. + '204': + description: The individual ManagePort configuration is deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The request was not successful. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/RdsDownlinkDataDeliveryFailure' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + NiddConfiguration: + description: Represents the configuration for NIDD. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + duration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service (as defined in clause 4.5.14.3 of 3GPP TS + 23.682) acknowledgement is requested (true) or not (false). Default value is false. + rdsPorts: + type: array + items: + $ref: '#/components/schemas/RdsPort' + minItems: 1 + description: Indicates the static port configuration that is used for reliable data transfer between specific applications using RDS (as defined in clause 5.2.4 and 5.2.5 of 3GPP TS 24.250). + pdnEstablishmentOption: + $ref: '#/components/schemas/PdnEstablishmentOptions' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + maximumPacketSize: + type: integer + minimum: 1 + description: The Maximum Packet Size is the maximum NIDD packet size that was transferred to the UE by the SCEF in the PCO, see clause 4.5.14.1 of 3GPP TS 23.682. If no maximum packet size was provided to the UE by the SCEF, the SCEF sends a default configured max packet size to SCS/AS. Unit bit. + readOnly: true + niddDownlinkDataTransfers: + type: array + items: + $ref: '#/components/schemas/NiddDownlinkDataTransfer' + minItems: 1 + description: The downlink data deliveries that needed to be executed by the SCEF. The cardinality of the property shall be 0..1 in the request and 0..N in the response (i.e. response may contain multiple buffered MT NIDD). + status: + $ref: '#/components/schemas/NiddStatus' + required: + - notificationDestination + oneOf: + - required: [externalId] + - required: [msisdn] + - required: [externalGroupId] + NiddDownlinkDataTransfer: + description: Represents the received NIDD downlink data from the SCS/AS. + type: object + properties: + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + data: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service (as defined in clause 4.5.14.3 of 3GPP TS + 23.682) acknowledgement is requested (true) or not (false). Default value is false. + rdsPort: + $ref: '#/components/schemas/RdsPort' + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + priority: + type: integer + description: It is used to indicate the priority of the non-IP data packet relative to other non-IP data packets. + pdnEstablishmentOption: + $ref: '#/components/schemas/PdnEstablishmentOptions' + deliveryStatus: + $ref: '#/components/schemas/DeliveryStatus' + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + required: + - data + oneOf: + - required: [externalId] + - required: [msisdn] + - required: [externalGroupId] + NiddUplinkDataNotification: + description: Represents NIDD uplink data to be notified to the SCS/AS. + type: object + properties: + niddConfiguration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + data: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service acknowledgement is requested (true) or + not (false). + rdsPort: + $ref: '#/components/schemas/RdsPort' + required: + - niddConfiguration + - data + oneOf: + - required: [externalId] + - required: [msisdn] + NiddDownlinkDataDeliveryStatusNotification: + description: Represents the delivery status of a specific NIDD downlink data delivery. + type: object + properties: + niddDownlinkDataTransfer: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + deliveryStatus: + $ref: '#/components/schemas/DeliveryStatus' + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + required: + - niddDownlinkDataTransfer + - deliveryStatus + NiddConfigurationStatusNotification: + description: Represents an NIDD configuration status notification. + type: object + properties: + niddConfiguration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + status: + $ref: '#/components/schemas/NiddStatus' + rdsCapIndication: + type: boolean + description: It indicates whether the network capability for the reliable data service is enabled or not. + rdsPort: + $ref: '#/components/schemas/RdsPort' + required: + - niddConfiguration + - status + oneOf: + - required: [externalId] + - required: [msisdn] + GmdNiddDownlinkDataDeliveryNotification: + description: Represents the delivery status of a specific group NIDD downlink data delivery. + type: object + properties: + niddDownlinkDataTransfer: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + gmdResults: + type: array + items: + $ref: '#/components/schemas/GmdResult' + minItems: 1 + description: Indicates the group message delivery result. + required: + - niddDownlinkDataTransfer + - gmdResults + RdsPort: + description: Represents the port configuration for Reliable Data Transfer. + type: object + properties: + portUE: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + portSCEF: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + required: + - portUE + - portSCEF + GmdResult: + description: Represents the group message delivery result. + type: object + properties: + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + deliveryStatus: + $ref: '#/components/schemas/DeliveryStatus' + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + required: + - deliveryStatus + oneOf: + - required: [externalId] + - required: [msisdn] + NiddDownlinkDataDeliveryFailure: + description: Represents information related to a failure delivery result. + type: object + properties: + problemDetail: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + required: + - problemDetail + ManagePort: + description: Represents the configuration of a RDS dynamic port management. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + appId: + type: string + description: Identifies the application. + manageEntity: + $ref: '#/components/schemas/ManageEntity' + skipUeInquiry: + type: boolean + description: Indicate whether to skip UE inquiry. + supportedFormats: + type: array + items: + $ref: '#/components/schemas/SerializationFormat' + minItems: 1 + description: Indicates the serialization format(s) that are supported by the SCS/AS on the associated RDS port. + configuredFormat: + $ref: '#/components/schemas/SerializationFormat' + required: + - appId + ManagePortNotification: + description: Represents a ManagePort notification of port numbers that are reserved. + type: object + properties: + niddConfiguration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + managedPorts: + type: array + items: + $ref: '#/components/schemas/ManagePort' + minItems: 1 + description: Indicates the reserved RDS port configuration information. + required: + - niddConfiguration + oneOf: + - required: [externalId] + - required: [msisdn] + RdsDownlinkDataDeliveryFailure: + description: Represents the failure delivery result for RDS. + allOf: + - $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + - type: object + properties: + requestedRetransmissionTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + supportedUeFormats: + type: array + items: + $ref: '#/components/schemas/SerializationFormat' + minItems: 1 + description: Indicates the serialization format(s) that are supported by the UE on the associated RDS port. + + NiddDownlinkDataTransferPatch: + description: Represents the parameters to request the modification of an Individual NIDD Downlink Data Delivery resource. + type: object + properties: + data: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bytes' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service (as defined in clause 4.5.14.3 of 3GPP TS + 23.682) acknowledgement is requested (true) or not (false). + rdsPort: + $ref: '#/components/schemas/RdsPort' + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + priority: + type: integer + description: It is used to indicate the priority of the non-IP data packet relative to other non-IP data packets. + pdnEstablishmentOption: + $ref: '#/components/schemas/PdnEstablishmentOptions' + + PdnEstablishmentOptions: + anyOf: + - type: string + enum: + - WAIT_FOR_UE + - INDICATE_ERROR + - SEND_TRIGGER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - WAIT_FOR_UE: wait for the UE to establish the PDN connection + - INDICATE_ERROR: respond with an error cause + - SEND_TRIGGER: send a device trigger + PdnEstablishmentOptionsRm: + description: Represents the same information as the PdnEstablishmentOptions data type with the difference that it allows also the null value. + anyOf: + - $ref: '#/components/schemas/PdnEstablishmentOptions' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + DeliveryStatus: + anyOf: + - type: string + enum: + - SUCCESS + - SUCCESS_NEXT_HOP_ACKNOWLEDGED + - SUCCESS_NEXT_HOP_UNACKNOWLEDGED + - SUCCESS_ACKNOWLEDGED + - SUCCESS_UNACKNOWLEDGED + - TRIGGERED + - BUFFERING + - BUFFERING_TEMPORARILY_NOT_REACHABLE + - SENDING + - FAILURE + - FAILURE_RDS_DISABLED + - FAILURE_NEXT_HOP + - FAILURE_TIMEOUT + - FAILURE_TEMPORARILY_NOT_REACHABLE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SUCCESS: Success but details not provided + - SUCCESS_NEXT_HOP_ACKNOWLEDGED: Successful delivery to the next hop with acknowledgment. + - SUCCESS_NEXT_HOP_UNACKNOWLEDGED: Successful delivery to the next hop without acknowledgment + - SUCCESS_ACKNOWLEDGED: Reliable delivery was acknowledged by the UE + - SUCCESS_UNACKNOWLEDGED: Reliable delivery was not acknowledged by the UE + - TRIGGERED: The SCEF triggered the device and is buffering the data. + - BUFFERING: The SCEF is buffering the data due to no PDN connection established. + - BUFFERING_TEMPORARILY_NOT_REACHABLE: The SCEF has been informed that the UE is temporarily not reachable but is buffering the data + - SENDING: The SCEF has forwarded the data, but they may be stored elsewhere + - FAILURE: Delivery failure but details not provided + - FAILURE_RDS_DISABLED: RDS was disabled + - FAILURE_NEXT_HOP: Unsuccessful delivery to the next hop. + - FAILURE_TIMEOUT: Unsuccessful delivery due to timeout. + - FAILURE_TEMPORARILY_NOT_REACHABLE: The SCEF has been informed that the UE is temporarily not reachable without buffering the data. + readOnly: true + NiddStatus: + anyOf: + - type: string + enum: + - ACTIVE + - TERMINATED_UE_NOT_AUTHORIZED + - TERMINATED + - RDS_PORT_UNKNOWN + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - ACTIVE: The NIDD configuration is active. + - TERMINATED_UE_NOT_AUTHORIZED: The NIDD configuration was terminated because the UE´s authorisation was revoked. + - TERMINATED: The NIDD configuration was terminated. + - RDS_PORT_UNKNOWN: The RDS port is unknown. + readOnly: true + ManageEntity: + anyOf: + - type: string + enum: + - UE + - AS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - UE: Representing the UE. + - AS: Representing the Application Server. + readOnly: true + SerializationFormat: + anyOf: + - type: string + enum: + - CBOR + - JSON + - XML + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - CBOR: The CBOR Serialzition format + - JSON: The JSON Serialzition format + - XML: The XML Serialzition format + NiddConfigurationPatch: + description: Represents the parameters to update a NIDD configuration. + type: object + properties: + duration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRm' + reliableDataService: + type: boolean + description: > + Indicates whether the reliable data service (as defined in clause 4.5.14.3 of 3GPP TS + 23.682) acknowledgement is requested (true) or not (false). + nullable: true + rdsPorts: + type: array + items: + $ref: '#/components/schemas/RdsPort' + minItems: 1 + description: Indicates the static port configuration that is used for reliable data transfer between specific applications using RDS (as defined in clause 5.2.4 and 5.2.5 of 3GPP TS 24.250). + pdnEstablishmentOption: + $ref: '#/components/schemas/PdnEstablishmentOptionsRm' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_NpConfiguration.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_NpConfiguration.yaml new file mode 100644 index 000000000..30b30b6a7 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_NpConfiguration.yaml @@ -0,0 +1,475 @@ +openapi: 3.0.0 +info: + title: 3gpp-network-parameter-configuration + version: 1.2.0 + description: | + API for network parameter configuration. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-network-parameter-configuration/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause of 3GPP TS 29.122. +paths: + /{scsAsId}/configurations: + get: + summary: Read all of the active configurations for the SCS/AS. + operationId: FetchAllNPConfigurations + tags: + - Np Configurations + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active NpConfigurations for the SCS/AS) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NpConfiguration' + minItems: 0 + description: Network Parameter configurations + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource for network parameter configuration. + operationId: CreateNPConfiguration + tags: + - Np Configurations + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigurationNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/configurations/{configurationId}: + get: + summary: Read an active configuration for the SCS/AS and the configuration Id. + operationId: FetchIndNPConfiguration + tags: + - Individual Np Configuration + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Updates/replaces an existing configuration resource. + operationId: UpdateIndNPConfiguration + tags: + - Individual Np Configuration + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + responses: + '200': + description: OK (Successful update of the existing configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + '204': + description: No Content (Successful update of the configuration) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates/replaces an existing configuration resource. + operationId: ModifyIndNPConfiguration + tags: + - Individual Np Configuration + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/NpConfigurationPatch' + responses: + '200': + description: OK. The configuration was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/NpConfiguration' + '204': + description: No Content. The configuration was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration. + operationId: DeleteIndNPConfiguration + tags: + - Individual Np Configuration + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '200': + description: OK. (Successful deletion of the existing configuration) + content: + application/json: + schema: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ConfigResult' + minItems: 1 + description: The configuration was terminated successfully, the configuration failure information for group members shall be included if received. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + NpConfiguration: + description: Represents a network parameters configuration. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtcProviderId: + type: string + description: Identifies the MTC Service Provider and/or MTC Application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + msisdn: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Msisdn' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + maximumResponseTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + suggestedNumberOfDlPackets: + type: integer + minimum: 0 + description: This parameter may be included to identify the number of packets that the serving gateway shall buffer in case that the UE is not reachable. + groupReportingGuardTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + validityTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ueMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + oneOf: + - required: [externalId] + - required: [msisdn] + - required: [externalGroupId] + NpConfigurationPatch: + description: Represents parameters used to request the modification of a network parameters configuration resource. + type: object + properties: + maximumLatency: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + maximumResponseTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + suggestedNumberOfDlPackets: + type: integer + minimum: 0 + description: This parameter may be included to identify the number of packets that the serving gateway shall buffer in case that the UE is not reachable. + nullable: true + groupReportGuardTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + validityTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRm' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + ConfigurationNotification: + description: Represents a configuration result notification. + type: object + properties: + configuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + configResults: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ConfigResult' + minItems: 1 + description: The grouping configuration result notification provided by the SCEF. + appliedParam: + $ref: 'TS29122_MonitoringEvent.yaml#/components/schemas/AppliedParameterConfiguration' + required: + - configuration diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_PfdManagement.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_PfdManagement.yaml new file mode 100644 index 000000000..8d4f60a58 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_PfdManagement.yaml @@ -0,0 +1,760 @@ +openapi: 3.0.0 +info: + title: 3gpp-pfd-management + version: 1.2.0 + description: | + API for PFD management. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-pfd-management/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/transactions: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + get: + summary: Read all or queried PFDs for a given SCS/AS. + operationId: FetchAllPFDManagementTransactions + tags: + - PFD Management Transactions + parameters: + - name: external-app-ids + in: query + description: The external application identifier(s) of the requested PFD data. + required: false + schema: + type: array + items: + type: string + minItems: 1 + responses: + '200': + description: OK. All or queried transactions related to the request URI are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdManagement' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create PFDs for a given SCS/AS and one or more external Application Identifier(s). + operationId: CreatePFDManagementTransaction + tags: + - PFD Management Transactions + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + description: Create a new transaction for PFD management. + responses: + '201': + description: Created. The transaction was created successfully. The SCEF shall return the created transaction in the response payload body. PfdReport may be included to provide detailed failure information for some applications. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for all applications were not created successfully. PfdReport is included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/transactions/{transactionId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: transactionId + in: path + description: Transaction ID + required: true + schema: + type: string + get: + summary: Read all PFDs for a given SCS/AS and a transaction for one or more external Application Identifier(s). + operationId: FetchIndPFDManagementTransaction + tags: + - Individual PFD Management Transaction + responses: + '200': + description: OK. The transaction information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update PFDs for a given SCS/AS and a transaction for one or more external Application Identifier(s). + operationId: UpdateIndPFDManagementTransaction + tags: + - Individual PFD Management Transaction + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + description: Change information in PFD management transaction. + responses: + '200': + description: OK. The transaction was modified successfully. The SCEF shall return an updated transaction in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + '204': + description: No Content. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for all applications were not updated successfully. PfdReport is included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing PFD Management Transaction resource. + operationId: ModifyIndPFDManagementTransaction + tags: + - Individual PFD Management Transaction + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PfdManagementPatch' + responses: + '200': + description: OK. The PFD Management Transaction was modified successfully. The SCEF shall return an updated representation of the resource in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdManagement' + '204': + description: No Content. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for all applications were not modified successfully. A set of PFD Report(s) is included with detailed information. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete PFDs for a given SCS/AS and a transaction for one or more external Application Identifier(s). + operationId: DeleteIndPFDManagementTransaction + tags: + - Individual PFD Management Transaction + responses: + '204': + description: No Content. The transaction was deleted successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/transactions/{transactionId}/applications/{appId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: transactionId + in: path + description: Transaction ID + required: true + schema: + type: string + - name: appId + in: path + description: Identifier of the application + required: true + schema: + type: string + get: + summary: Read PFDs at individual application level. + operationId: FetchIndApplicationPFDManagement + tags: + - Individual Application PFD Management + responses: + '200': + description: OK. The application information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update PFDs at individual application level. + operationId: UpdateIndApplicationPFDManagement + tags: + - Individual Application PFD Management + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + description: Change information in application. + responses: + '200': + description: OK. The application resource was modified successfully. The SCEF shall return an updated application resource in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '204': + description: No Content. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Update PFDs at individual application level. + operationId: ModifyIndApplicationPFDManagement + tags: + - Individual Application PFD Management + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PfdData' + description: Change information in PFD management transaction. + responses: + '200': + description: OK. The transaction was modified successfully. The SCEF shall return an updated transaction in the response payload body. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdData' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The PFDs for the application were not updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdReport' + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete PFDs at individual application level. + operationId: DeleteIndApplicationPFDManagement + tags: + - Individual Application PFD Management + responses: + '204': + description: No Content. The application was deleted successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + PfdManagement: + description: Represents a PFD management resource for a PFD management request. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pfdDatas: + type: object + additionalProperties: + $ref: '#/components/schemas/PfdData' + minProperties: 1 + description: Each element uniquely identifies the PFDs for an external application identifier. Each element is identified in the map via an external application identifier as key. The response shall include successfully provisioned PFD data of application(s). + pfdReports: + type: object + additionalProperties: + $ref: '#/components/schemas/PfdReport' + minProperties: 1 + description: Supplied by the SCEF and contains the external application identifiers for which PFD(s) are not added or modified successfully. The failure reason is also included. Each element provides the related information for one or more external application identifier(s) and is identified in the map via the failure identifier as key. + readOnly: true + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + required: + - pfdDatas + PfdData: + description: Represents a PFD request to add, update or remove PFD(s) for one external application identifier. + type: object + properties: + externalAppId: + type: string + description: Each element uniquely external application identifier + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + pfds: + type: object + additionalProperties: + $ref: '#/components/schemas/Pfd' + description: Contains the PFDs of the external application identifier. Each PFD is identified in the map via a key containing the PFD identifier. + allowedDelay: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + cachingTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRo' + required: + - externalAppId + - pfds + Pfd: + description: Represents a PFD for an external Application Identifier. + type: object + properties: + pfdId: + type: string + description: Identifies a PDF of an application identifier. + flowDescriptions: + type: array + items: + type: string + minItems: 1 + description: Represents a 3-tuple with protocol, server ip and server port for UL/DL application traffic. The content of the string has the same encoding as the IPFilterRule AVP value as defined in IETF RFC 6733. + urls: + type: array + items: + type: string + minItems: 1 + description: Indicates a URL or a regular expression which is used to match the significant parts of the URL. + domainNames: + type: array + items: + type: string + minItems: 1 + description: Indicates an FQDN or a regular expression as a domain name matching criteria. + dnProtocol: + $ref: '#/components/schemas/DomainNameProtocol' + required: + - pfdId + PfdReport: + description: Represents a PFD report indicating the external application identifier(s) which PFD(s) are not added or modified successfully and the corresponding failure cause(s). + type: object + properties: + externalAppIds: + type: array + items: + type: string + minItems: 1 + description: Identifies the external application identifier(s) which PFD(s) are not added or modified successfully + failureCode: + $ref: '#/components/schemas/FailureCode' + cachingTime: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + locationArea: + $ref: '#/components/schemas/UserPlaneLocationArea' + required: + - externalAppIds + - failureCode + UserPlaneLocationArea: + description: Represents location area(s) of the user plane functions which are unable to enforce the provisioned PFD(s) successfully. + type: object + properties: + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 0 + description: Identifies a list of DNAI which the user plane functions support. + PfdManagementPatch: + description: Represents the parameters to request the modification of a PFD management transaction resource. + type: object + properties: + pfdDatas: + type: object + additionalProperties: + $ref: '#/components/schemas/PfdData' + minProperties: 1 + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + FailureCode: + anyOf: + - type: string + enum: + - MALFUNCTION + - RESOURCE_LIMITATION + - SHORT_DELAY + - APP_ID_DUPLICATED + - PARTIAL_FAILURE + - OTHER_REASON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - MALFUNCTION: This value indicates that something functions wrongly in PFD provisioning or the PFD provisioning does not function at all. + - RESOURCE_LIMITATION: This value indicates there is resource limitation for PFD storage. + - SHORT_DELAY: This value indicates that the allowed delay is too short and PFD(s) are not stored. + - APP_ID_DUPLICATED: The received external application identifier(s) are already provisioned. + - PARTIAL_FAILURE: The PFD(s) are not provisioned to all PCEFs/TDFs/SMFs. + - OTHER_REASON: Other reason unspecified. + DomainNameProtocol: + anyOf: + - type: string + enum: + - DNS_QNAME + - TLS_SNI + - TLS_SAN + - TSL_SCN + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - DNS_QNAME: Identifies the DNS protocol and the question name in DNS query. + - TLS_SNI: Identifies the Server Name Indication in TLS ClientHello message. + - TLS_SAN: Identifies the Subject Alternative Name in TLS ServerCertificate message. + - TLS_SCN: Identifies the Subject Common Name in TLS ServerCertificate message. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_RacsParameterProvisioning.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_RacsParameterProvisioning.yaml new file mode 100644 index 000000000..95de58d75 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_RacsParameterProvisioning.yaml @@ -0,0 +1,433 @@ +openapi: 3.0.0 +info: + title: 3gpp-racs-parameter-provisioning + version: 1.1.0 + description: | + API for provisioning UE radio capability parameters. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-racs-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/provisionings: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + get: + summary: Read all RACS parameter provisionings for a given AF. + operationId: FetchAllRACSParameterProvisionings + tags: + - RACS Parameter Provisionings + responses: + '200': + description: OK. The provisioning information related to the request URI is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RacsProvisioningData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create a new RACS parameter provisioning. + operationId: CreateRACSParameterProvisioning + tags: + - RACS Parameter Provisionings + requestBody: + description: create new provisionings for a given SCS/AS. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + responses: + '201': + description: Created. The provisioning was created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The RACS data for all RACS IDs were not provisioned successfully. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RacsFailureReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/provisionings/{provisioningId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS as defined in clause 5.2.4 of 3GPP TS 29.122. + required: true + schema: + type: string + - name: provisioningId + in: path + description: Provisioning ID + required: true + schema: + type: string + get: + summary: Read an existing RACS parameter provisioning. + operationId: FetchIndRACSParameterProvisioning + tags: + - Individual RACS Parameter Provisioning + responses: + '200': + description: OK. The provisioning information related to the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify some properties in an existing RACS parameter provisioning. + operationId: ModifyIndRACSParameterProvisioning + tags: + - Individual RACS Parameter Provisioning + requestBody: + description: update an existing parameter provisioning. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/RacsProvisioningDataPatch' + responses: + '200': + description: OK. The provisioning data was updated successfully. The SCEF shall return an updated provisioning information in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + '204': + description: The provisioning data was updated successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The RACS data for all RACS IDs were not provisioned successfully. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RacsFailureReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Modify all properties in an existing RACS parameter provisioning. + operationId: UpdateIndRACSParameterProvisioning + tags: + - Individual RACS Parameter Provisioning + requestBody: + description: update an existing parameter provisioning. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + responses: + '200': + description: OK. The provisioning data was updated successfully. The SCEF shall return an updated provisioning information in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/RacsProvisioningData' + '204': + description: The provisioning data was updated successfully, and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: The RACS data for all RACS IDs were not provisioned successfully. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RacsFailureReport' + minItems: 1 + application/problem+json: + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete a RACS parameter provisioning. + operationId: DeleteIndRACSParameterProvisioning + tags: + - Individual RACS Parameter Provisioning + responses: + '204': + description: No Content. The provisioning was terminated successfully. The payload body shall be empty. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + RacsProvisioningData: + description: Represents a UE's radio capability data. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + racsConfigs: + type: object + additionalProperties: + $ref: '#/components/schemas/RacsConfiguration' + minProperties: 1 + description: Identifies the configuration related to manufacturer specific UE radio capability. Each element uniquely identifies an RACS configuration for an RACS ID and is identified in the map via the RACS ID as key. The response shall include successfully provisioned RACS data. + racsReports: + type: object + additionalProperties: + $ref: '#/components/schemas/RacsFailureReport' + minProperties: 1 + description: Supplied by the SCEF. Contains the RACS IDs for which the RACS data are not provisioned successfully. Any string value can be used as a key of the map. + readOnly: true + required: + - racsConfigs + RacsFailureReport: + description: Represents a radio capability data provisioning failure report. + type: object + properties: + racsIds: + type: array + items: + type: string + minItems: 1 + description: Identifies the RACS ID(s) for which the RACS data are not provisioned successfully. + failureCode: + $ref: '#/components/schemas/RacsFailureCode' + required: + - racsIds + - failureCode + RacsConfiguration: + description: Represents a single UE radio capability configuration data. + type: object + properties: + racsId: + type: string + description: The UE radio capability ID provided by the SCS/AS to identify the UE radio capability data. See 3GPP TS 23.003 for the encoding. + racsParamEps: + type: string + description: The UE radio capability data in EPS. + racsParam5Gs: + type: string + description: The UE radio capability data in 5GS. + imeiTacs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TypeAllocationCode' + minItems: 1 + description: Related UE model's IMEI-TAC values. + anyOf: + - required: [racsParamEps] + - required: [racsParam5Gs] + required: + - racsId + - imeiTacs + RacsProvisioningDataPatch: + description: Represents parameters to request the modification of a UE's radio capability data. + type: object + properties: + racsConfigs: + type: object + additionalProperties: + $ref: '#/components/schemas/RacsConfigurationRm' + minProperties: 1 + description: Identifies the configuration related to manufactuer specific UE radio capability. Each element uniquely identifies an RACS configuration for an RACS ID and is identified in the map via the RACS ID as key. + RacsConfigurationRm: + description: Represents the same as the RacsConfiguration data type but with the nullable:true property. + type: object + properties: + racsParamEps: + type: string + description: The UE radio capability data in EPS. + nullable: true + racsParam5Gs: + type: string + description: The UE radio capability data in 5GS. + nullable: true + imeiTacs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TypeAllocationCode' + minItems: 1 + description: Related UE model's IMEI-TAC values. + nullable: true + RacsFailureCode: + anyOf: + - type: string + enum: + - MALFUNCTION + - RESOURCE_LIMITATION + - RACS_ID_DUPLICATED + - OTHER_REASON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - MALFUNCTION: This value indicates that something functions wrongly in RACS provisioning or the RACS provisioning does not function at all. + - RESOURCE_LIMITATION: This value indicates there is resource limitation for RACS data storage. + - RACS_ID_DUPLICATED: The received RACS identifier(s) are already provisioned. + - OTHER_REASON: Other reason unspecified. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ReportingNetworkStatus.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ReportingNetworkStatus.yaml new file mode 100644 index 000000000..e78e121a6 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ReportingNetworkStatus.yaml @@ -0,0 +1,427 @@ +openapi: 3.0.0 +info: + title: 3gpp-network-status-reporting + version: 1.2.0 + description: | + API for reporting network status. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.6.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-net-stat-report/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + get: + summary: Read all network status reporting subscription resources for a given SCS/AS. + operationId: FetchAllNwStatusReportSubscriptions + tags: + - Network Status Reporting Subscriptions + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Create a new network status reporting subscription resource. + operationId: CreateNwStatusReportSubscription + tags: + - Network Status Reporting Subscriptions + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: The subscription was created successfully. The URI of the created resource shall be returned in the "Location" HTTP header. + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{scsAsId}/subscriptions/{subscriptionId}: + parameters: + - name: scsAsId + in: path + description: Identifier of the SCS/AS + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ScsAsId' + - name: subscriptionId + in: path + description: Identifier of the subscription resource of type string + required: true + schema: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ResourceId' + get: + summary: Read an active network status reporting subscription resource. + operationId: FetchIndNwStatusReportSubscription + tags: + - Individual Network Status Reporting subscription + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Modify an existing subscription resource to update a subscription. + operationId: UpdateIndNwStatusReportSubscription + tags: + - Individual Network Status Reporting subscription + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + responses: + '200': + description: The subscription was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + '204': + description: No Content. The subscription was updated successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify an existing Individual Network Status Reporting Subscription resource. + operationId: ModifyIndNwStatusReportSubscription + tags: + - Individual Network Status Reporting Subscription + requestBody: + description: Contains the parameters to modify an existing Individual Network Status Reporting Subscription resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/NetStatusRepSubsPatch' + responses: + '200': + description: OK. The modification of the Individual Network Status Reporting Subscription resource was successfull. The SCEF shall return an updated representation of the resource within the NetworkStatusReportingSubscription data structure in the response message body. + content: + application/json: + schema: + $ref: '#/components/schemas/NetworkStatusReportingSubscription' + '204': + description: No Content. The modification of the Individual Network Status Reporting Subscription resource was successfull and no content is to be sent in the response message body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an existing continuous network status reporting subscription resource. + operationId: DeleteIndNwStatusReportSubscription + tags: + - Individual Network Status Reporting subscription + responses: + '204': + description: The subscription was updated successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + NetworkStatusReportingSubscription: + description: Represents a subscription to network status information reporting. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: Set to true by the SCS/AS to request the SCEF to send a test notification as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + timeDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + thresholdValues: + type: array + items: + $ref: '#/components/schemas/CongestionValue' + minItems: 1 + description: Identifies a list of congestion level(s) with exact value that the SCS/AS requests to be informed of when reached. + thresholdTypes: + type: array + items: + $ref: '#/components/schemas/CongestionType' + minItems: 1 + description: Identifies a list of congestion level(s) with abstracted value that the SCS/AS requests to be informed of when reached. + required: + - notificationDestination + - locationArea + not: + required: [thresholdValues, thresholdTypes] + + NetStatusRepSubsPatch: + description: Represents the parameters to request the modification of network status reporting subscription. + type: object + properties: + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + timeDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRm' + thresholdValues: + type: array + items: + $ref: '#/components/schemas/CongestionValue' + minItems: 1 + thresholdTypes: + type: array + items: + $ref: '#/components/schemas/CongestionType' + minItems: 1 + not: + required: [thresholdValues, thresholdTypes] + + NetworkStatusReportingNotification: + description: Represents a network status reporting notification. + type: object + properties: + subscription: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + nsiValue: + $ref: '#/components/schemas/CongestionValue' + nsiType: + $ref: '#/components/schemas/CongestionType' + required: + - subscription + not: + required: [nsiValue, nsiType] + CongestionValue: + type: integer + minimum: 0 + maximum: 31 + description: Unsigned integer with valid values between 0 and 31. The value 0 indicates that there is no congestion. The value 1 is the lowest congestion level and value 31 is the highest congestion level. + CongestionType: + anyOf: + - type: string + enum: + - HIGH + - MEDIUM + - LOW + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - HIGH: The congestion status is high. + - MEDIUM: The congestion status is medium. + - LOW: The congestion status is low. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ResourceManagementOfBdt.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ResourceManagementOfBdt.yaml new file mode 100644 index 000000000..cd0eece9a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29122_ResourceManagementOfBdt.yaml @@ -0,0 +1,439 @@ +openapi: 3.0.0 +info: + title: 3gpp-bdt + version: 1.2.1 + description: | + API for BDT resouce management. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.122 V17.7.0 T8 reference point for Northbound APIs + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-bdt/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{scsAsId}/subscriptions: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + get: + summary: Fetch all active background data transfer subscription resources for a given SCS/AS. + operationId: FetchAllActiveBDTSubscriptions + tags: + - BDT Subscription + responses: + '200': + description: all BDT policy subscriptions. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Bdt' + minItems: 0 + description: individual BDT policy subscription. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Creates a new background data transfer subscription resource. + operationId: CreateBDTSubscription + tags: + - BDT Subscription + requestBody: + description: Contains the data to create a BDT subscription. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + callbacks: + bDTWarningNotification: + '{$request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Background data transfer policies offered to the SCS/AS. + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29122_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{scsAsId}/subscriptions/{subscriptionId}: + parameters: + - name: scsAsId + description: String identifying the SCS/AS. + in: path + required: true + schema: + type: string + - name: subscriptionId + description: String identifying the individual BDT policy resource in the SCEF. + in: path + required: true + schema: + type: string + get: + summary: Read a background data transfer subscription resource. + operationId: FetchIndBDTSubscription + tags: + - Individual BDT Subscription + responses: + '200': + description: Background data transfer policies offered to and selected by the SCEF. + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update a background data transfer subscription resource for negotiation of background data transfer policy. + operationId: UpdateBDTSubscription + tags: + - Individual BDT Subscription + requestBody: + description: Parameters to update/replace the existing BDT subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + responses: + '200': + description: OK (Successful update of the BDT subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + '204': + description: No Content. The Individual BDT Subscription resource was updated successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Modify a background data transfer subscription resource to select one of the transfer policies offered by the SCEF. + operationId: ModifyBDTSubscription + tags: + - Individual BDT Subscription + requestBody: + description: Contains information to be performed on the Bdt data structure to select a transfer policy. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/BdtPatch' + responses: + '200': + description: The Individual BDT Policy resource is modified with a selected policy and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/Bdt' + '204': + description: The Individual BDT Policy resource is modified with a selected policy. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete a background data transfer resource. + operationId: DeleteBDTSubscription + tags: + - Individual BDT Subscription + responses: + '204': + description: The Individual BDT Policy resource is deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + Bdt: + description: Represents a Background Data Transfer subscription. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + volumePerUE: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + numberOfUEs: + type: integer + minimum: 1 + description: Identifies the number of UEs. + desiredTimeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + locationArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + referenceId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + transferPolicies: + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + description: Identifies an offered transfer policy. + readOnly: true + selectedPolicy: + type: integer + description: Identity of the selected background data transfer policy. Shall not be present in initial message exchange, can be provided by NF service consumer in a subsequent message exchange. + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + warnNotifEnabled: + type: boolean + description: > + Indicates whether the BDT warning notification is enabled (true) or not (false). Default + value is false. + trafficDes: + $ref: '#/components/schemas/TrafficDescriptor' + required: + - volumePerUE + - numberOfUEs + - desiredTimeWindow + BdtPatch: + description: Represents a Background Data Transfer subscription modification request. + type: object + properties: + selectedPolicy: + type: integer + description: Identity of the selected background data transfer policy. + warnNotifEnabled: + type: boolean + description: > + Indicates whether the BDT warning notification is enabled (true) or not (false). + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + required: + - selectedPolicy + TransferPolicy: + description: Represents an offered transfer policy sent from the SCEF to the SCS/AS, or a selected transfer policy sent from the SCS/AS to the SCEF. + type: object + properties: + bdtPolicyId: + type: integer + description: Identifier for the transfer policy + maxUplinkBandwidth: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bandwidth' + maxDownlinkBandwidth: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Bandwidth' + ratingGroup: + type: integer + minimum: 0 + description: Indicates the rating group during the time window. + timeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + required: + - bdtPolicyId + - ratingGroup + - timeWindow + ExNotification: + description: Represents a Background Data Transfer notification. + type: object + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + locationArea5G: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + timeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + candPolicies: + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + description: This IE indicates a list of the candidate transfer policies from which the AF may select a new transfer policy due to network performance degradation. + required: + - bdtRefId + TrafficDescriptor: + type: string + description: Identify a traffic descriptor as defined in Figure 5.2.2 of 3GPP TS 24.526, octets v+5 to w. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29502_Nsmf_PDUSession.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29502_Nsmf_PDUSession.yaml new file mode 100644 index 000000000..4e2b4f570 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29502_Nsmf_PDUSession.yaml @@ -0,0 +1,4824 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'Nsmf_PDUSession' + description: | + SMF PDU Session Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.502 V17.7.0; 5G System; Session Management Services; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.502/ + +servers: + - url: '{apiRoot}/nsmf-pdusession/v1' + variables: + apiRoot: + default: https://example.com + description: > + apiRoot as defined in clause 4.4 of 3GPP TS 29.501. The sm-contexts and pdu-sessions + resources can be distributed on different processing instances or hosts. Thus the + authority and/or deployment-specific string of the apiRoot of the created individual + sm context and pdu-session resources' URIs may differ from the authority and/or + deployment-specific string of the apiRoot of the sm-contexts and pdu-sessions + collections' URIs. + +security: + - {} + - oAuth2ClientCredentials: + - nsmf-pdusession + +paths: + /sm-contexts: + post: + summary: Create SM Context + tags: + - SM contexts collection + operationId: PostSmContexts + requestBody: + description: representation of the SM context to be created in the SMF + required: true + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateData' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + binaryDataN2SmInformationExt1: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + callbacks: + smContextStatusNotification: + '{$request.body#/smContextStatusUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmContextStatusNotification' + responses: + '204': + description: successful notification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + + responses: + '201': + description: successful creation of an SM context + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreatedData' + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nsmf-pdusession//sm-contexts/{smContextRef} + required: true + schema: + type: string + + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: unsuccessful creation of an SM context - bad request + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '403': + description: unsuccessful creation of an SM context - forbidden + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '404': + description: unsuccessful creation of an SM context - not found + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: '#/components/responses/413' + '415': + $ref: '#/components/responses/415' + '429': + $ref: '#/components/responses/429' + + '500': + description: unsuccessful creation of an SM context - internal server error + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '503': + description: unsuccessful creation of an SM context - service unavailable + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + + '504': + description: unsuccessful creation of an SM context - gateway timeout + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextCreateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmMessage: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + + /sm-contexts/{smContextRef}/retrieve: + post: + summary: Retrieve SM Context + tags: + - Individual SM context + operationId: RetrieveSmContext + parameters: + - name: smContextRef + in: path + description: SM context reference + required: true + schema: + type: string + requestBody: + description: parameters used to retrieve the SM context + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/SmContextRetrieveData' + responses: + '200': + description: successful retrieval of an SM context + content: + application/json: + schema: + $ref: '#/components/schemas/SmContextRetrievedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /sm-contexts/{smContextRef}/modify: + post: + summary: Update SM Context + tags: + - Individual SM context + operationId: UpdateSmContext + parameters: + - name: smContextRef + in: path + description: SM context reference + required: true + schema: + type: string + requestBody: + description: representation of the updates to apply to the SM context + required: true + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateData' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + binaryDataN2SmInformationExt1: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '200': + description: successful update of an SM context with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdatedData' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '204': + description: successful update of an SM context without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: unsuccessful update of an SM context - bad request + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '403': + description: unsuccessful update of an SM context - forbidden + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '404': + description: unsuccessful update of an SM context - not found + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: '#/components/responses/413' + '415': + $ref: '#/components/responses/415' + '429': + $ref: '#/components/responses/429' + '500': + description: unsuccessful update of an SM context - Internal server error + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '503': + description: unsuccessful update of an SM context - Service Unavailable + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextUpdateError' + binaryDataN1SmMessage: + type: string + format: binary + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmMessage: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /sm-contexts/{smContextRef}/release: + post: + summary: Release SM Context + tags: + - Individual SM context + operationId: ReleaseSmContext + parameters: + - name: smContextRef + in: path + description: SM context reference + required: true + schema: + type: string + requestBody: + description: representation of the data to be sent to the SMF when releasing the SM context + required: false + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextReleaseData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/SmContextReleaseData' + binaryDataN2SmInformation: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2SmInformation: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + + responses: + '200': + description: successful release of a PDU session with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/SmContextReleasedData' + '204': + description: successful release of an SM context without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /sm-contexts/{smContextRef}/send-mo-data: + post: + summary: Send MO Data + tags: + - Individual SM context + operationId: SendMoData + parameters: + - name: smContextRef + in: path + description: SM context reference + required: true + schema: + type: string + requestBody: + description: representation of the payload of Send MO Data Request + required: true + content: + multipart/related: # message with a binary body part + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/SendMoDataReqData' + binaryMoData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryMoData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful sending of MO data + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '403': + $ref: '#/components/responses/403' + '404': + $ref: '#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: '#/components/responses/413' + '415': + $ref: '#/components/responses/415' + '429': + $ref: '#/components/responses/429' + '500': + $ref: '#/components/responses/500' + '503': + $ref: '#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions: + post: + summary: Create + tags: + - PDU sessions collection + operationId: PostPduSessions + requestBody: + description: representation of the PDU session to be created in the H-SMF or SMF + required: true + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/PduSessionCreateData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/PduSessionCreateData' + binaryDataN1SmInfoFromUe: + type: string + format: binary + binaryDataUnknownN1SmInfo: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoFromUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataUnknownN1SmInfo: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + callbacks: + statusNotification: + '{$request.body#/vsmfPduSessionUri}': + post: + summary: Notify Status + tags: + - Individual PDU session (V-SMF) + operationId: NotifyStatus + requestBody: + $ref: '#/components/requestBodies/NotifyStatusRequestBody' + responses: + '204': + description: successful notificationof the status change + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + statusNotification-ismf: + '{$request.body#/ismfPduSessionUri}': + post: + summary: Notify Status + tags: + - Individual PDU session (I-SMF) + operationId: NotifyStatus-isfm + requestBody: + $ref: '#/components/requestBodies/NotifyStatusRequestBody' + responses: + '204': + description: successful notificationof the status change + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + + update: + '{$request.body#/vsmfPduSessionUri}/modify': + post: + summary: Update (initiated by H-SMF) + tags: + - Individual PDU session (V-SMF) + operationId: ModifyPduSession + requestBody: + $ref: '#/components/requestBodies/VsmfUpdateRequestBody' + responses: + '200': + $ref: '#/components/responses/VsmfUpdateResponse200' + '204': + description: successful update of a PDU session without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/VsmfUpdateError' + '403': + $ref: '#/components/responses/VsmfUpdateError' + '404': + $ref: '#/components/responses/VsmfUpdateError' + '409': + $ref: '#/components/responses/VsmfUpdateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: '#/components/responses/VsmfUpdateError' + '503': + $ref: '#/components/responses/VsmfUpdateError' + '504': + $ref: '#/components/responses/VsmfUpdateError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + update-ismf: + '{$request.body#/ismfPduSessionUri}/modify': + post: + summary: Update (initiated by SMF) + tags: + - Individual PDU session (I-SMF) + operationId: ModifyPduSession-ismf + requestBody: + $ref: '#/components/requestBodies/VsmfUpdateRequestBody' + responses: + '200': + $ref: '#/components/responses/VsmfUpdateResponse200' + '204': + description: successful update of a PDU session without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/VsmfUpdateError' + '403': + $ref: '#/components/responses/VsmfUpdateError' + '404': + $ref: '#/components/responses/VsmfUpdateError' + '409': + $ref: '#/components/responses/VsmfUpdateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: '#/components/responses/VsmfUpdateError' + '503': + $ref: '#/components/responses/VsmfUpdateError' + '504': + $ref: '#/components/responses/VsmfUpdateError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + transferMtData: + '{$request.body#/vsmfPduSessionUri}/transfer-mt-data': + post: + summary: Transfer MT Data (by H-SMF) + tags: + - Individual PDU session (V-SMF) + operationId: TransferMtData + requestBody: + description: representation of the payload of Transfer MT Data Request + required: true + content: + multipart/related: # message with a binary body part + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/TransferMtDataReqData' + binaryMtData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryMtData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful transfering of MT data + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: unsuccessful delivery of mobile terminated data - gateway timeout + content: + application/json: + schema: + $ref: '#/components/schemas/TransferMtDataError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + transferMtData-ismf: + '{$request.body#/ismfPduSessionUri}/transfer-mt-data': + post: + summary: Transfer MT Data (by SMF) + tags: + - Individual PDU session (I-SMF) + operationId: TransferMtData-ismf + requestBody: + description: representation of the payload of Transfer MT Data Request + required: true + content: + multipart/related: # message with a binary body part + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/TransferMtDataReqData' + binaryMtData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryMtData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful transfering of MT data + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: unsuccessful delivery of mobile terminated data - gateway timeout + content: + application/json: + schema: + $ref: '#/components/schemas/TransferMtDataError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + responses: + '201': + description: successful creation of a PDU session + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/PduSessionCreatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/PduSessionCreatedData' + binaryDataN1SmInfoToUe: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nsmf-pdusession//pdu-sessions/{pduSessionRef} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/PduSessionCreateError' + '403': + $ref: '#/components/responses/PduSessionCreateError' + '404': + $ref: '#/components/responses/PduSessionCreateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: '#/components/responses/PduSessionCreateError' + '503': + $ref: '#/components/responses/PduSessionCreateError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions/{pduSessionRef}/modify: + post: + summary: Update (initiated by V-SMF or I-SMF) + tags: + - Individual PDU session (H-SMF or SMF) + operationId: UpdatePduSession + parameters: + - name: pduSessionRef + in: path + description: PDU session reference + required: true + schema: + type: string + requestBody: + description: representation of the updates to apply to the PDU session + required: true + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/HsmfUpdateData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/HsmfUpdateData' + binaryDataN1SmInfoFromUe: + type: string + format: binary + binaryDataUnknownN1SmInfo: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoFromUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataUnknownN1SmInfo: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + responses: + '200': + description: successful update of a PDU session with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/HsmfUpdatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/HsmfUpdatedData' + binaryDataN1SmInfoToUe: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + '204': + description: successful update of a PDU session without content in the response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: '#/components/responses/HsmfUpdateError' + '403': + $ref: '#/components/responses/HsmfUpdateError' + '404': + $ref: '#/components/responses/HsmfUpdateError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: '#/components/responses/HsmfUpdateError' + '503': + $ref: '#/components/responses/HsmfUpdateError' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions/{pduSessionRef}/release: + post: + summary: Release + tags: + - Individual PDU session (H-SMF or SMF) + operationId: ReleasePduSession + parameters: + - name: pduSessionRef + in: path + description: PDU session reference + required: true + schema: + type: string + requestBody: + description: data sent to H-SMF or SMF when releasing the PDU session + required: false + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/ReleaseData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/ReleaseData' + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + + responses: + '200': + description: successful release of a PDU session with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/ReleasedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/ReleasedData' + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + '204': + description: successful release of a PDU session + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions/{pduSessionRef}/retrieve: + post: + summary: Retrieve + tags: + - Individual PDU session (H-SMF or SMF) + operationId: RetrievePduSession + parameters: + - name: pduSessionRef + in: path + description: PDU session reference + required: true + schema: + type: string + requestBody: + description: representation of the payload of the Retrieve Request + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RetrieveData' + responses: + '200': + description: successful information retrieval + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/RetrievedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pdu-sessions/{pduSessionRef}/transfer-mo-data: + post: + summary: Transfer MO Data + tags: + - Individual PDU session (H-SMF or SMF) + operationId: TransferMoData + parameters: + - name: pduSessionRef + in: path + description: PDU session reference + required: true + schema: + type: string + requestBody: + description: representation of the payload of Transfer MO Data Request + required: true + content: + multipart/related: # message with a binary body part + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/TransferMoDataReqData' + binaryMoData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryMoData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful transfering of MO data + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nsmf-pdusession: Access to the nsmf-pdusession API + + schemas: +# +# STRUCTURED DATA TYPES +# + SmContextCreateData: + description: Data within Create SM Context Request + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + unauthenticatedSupi: + type: boolean + default: false + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + selectedDnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hplmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + servingNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + serviceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + requestType: + $ref: '#/components/schemas/RequestType' + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAnType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + presenceInLadn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + smContextStatusUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + hSmfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + hSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + additionalHsmfUri: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + additionalHsmfId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + additionalSmfUri: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + additionalSmfId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + oldPduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduSessionsActivateList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + ueEpsPdnConnection: + $ref: '#/components/schemas/EpsPdnCnxContainer' + hoState: + $ref: '#/components/schemas/HoState' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nrfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + selMode: + $ref: '#/components/schemas/DnnSelectionMode' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + hNwPubKeyId: + type: integer + epsInterworkingInd: + $ref: '#/components/schemas/EpsInterworkingIndication' + indirectForwardingFlag: + type: boolean + directForwardingFlag: + type: boolean + targetId: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/NgRanTargetId' + epsBearerCtxStatus: + $ref: '#/components/schemas/EpsBearerContextStatus' + cpCiotEnabled: + type: boolean + default: false + cpOnlyInd: + type: boolean + default: false + invokeNef: + type: boolean + default: false + maRequestInd: + type: boolean + default: false + maNwUpgradeInd: + type: boolean + default: false + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + n2SmInfoExt1: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoTypeExt1: + $ref: '#/components/schemas/N2SmInfoType' + smContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smContextSmfPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + smContextSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smContextSmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + smContextSmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smContextSmfBinding: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/SbiBindingLevel' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + extendedNasSmTimerInd: + type: boolean + default: false + dlDataWaitingInd: + type: boolean + default: false + ddnFailureSubs: + $ref: '#/components/schemas/DdnFailureSubs' + smfTransferInd: + type: boolean + default: false + oldSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + oldSmContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + wAgfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/WAgfInfo' + tngfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TngfInfo' + twifInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TwifInfo' + ranUnchangedInd: + type: boolean + samePcfSelectionInd: + type: boolean + default: false + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + nrfManagementUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfDiscoveryUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfOauth2Required: + type: object + description: 'Map indicating whether the NRF requires Oauth2-based authorization for accessing its services. The key of the map shall be the name of an NRF service, e.g. "nnrf-nfm" or "nnrf-disc"' + additionalProperties: + type: boolean + minProperties: 1 + smfBindingInfo: + type: string + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + onboardingInd: + type: boolean + default: false + oldPduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smPolicyNotifyInd: + type: boolean + default: false + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + upipSupported: + type: boolean + default: false + uavAuthenticated: + type: boolean + disasterRoamingInd: + type: boolean + default: false + anchorSmfOauth2Required: + type: boolean + smContextSmfOauth2Required: + type: boolean + required: + - servingNfId + - servingNetwork + - anType + - smContextStatusUri + + SmContextCreatedData: + description: Data within Create SM Context Response + type: object + properties: + hSmfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + allocatedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + hoState: + $ref: '#/components/schemas/HoState' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + smfServiceInstanceId: + type: string + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + selectedSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + selectedOldSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + SmContextUpdateData: + description: Data within Update SM Context Request + type: object + properties: + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + servingNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + nullable: true + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAnType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + anTypeToReactivate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + presenceInLadn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + hoState: + $ref: '#/components/schemas/HoState' + toBeSwitched: + type: boolean + default: false + failedToBeSwitched: + type: boolean + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + targetId: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/NgRanTargetId' + targetServingNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smContextStatusUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + dataForwarding: + type: boolean + default: false + n9ForwardingTunnel: + $ref: '#/components/schemas/TunnelInfo' + n9DlForwardingTnlList: + type: array + items: + $ref: '#/components/schemas/IndirectDataForwardingTunnelInfo' + minItems: 1 + n9UlForwardingTnlList: + type: array + items: + $ref: '#/components/schemas/IndirectDataForwardingTunnelInfo' + minItems: 1 + n9DlForwardingTunnel: + $ref: '#/components/schemas/TunnelInfo' + n9InactivityTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + epsBearerSetup: + type: array + items: + $ref: '#/components/schemas/EpsBearerContainer' + minItems: 0 + revokeEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + release: + type: boolean + default: false + cause: + $ref: '#/components/schemas/Cause' + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + epsInterworkingInd: + $ref: '#/components/schemas/EpsInterworkingIndication' + anTypeCanBeChanged: + type: boolean + default: false + n2SmInfoExt1: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoTypeExt1: + $ref: '#/components/schemas/N2SmInfoType' + maReleaseInd: + $ref: '#/components/schemas/MaReleaseIndication' + maNwUpgradeInd: + type: boolean + default: false + maRequestInd: + type: boolean + default: false + exemptionInd: + $ref: '#/components/schemas/ExemptionInd' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + extendedNasSmTimerInd: + type: boolean + forwardingFTeid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + forwardingBearerContexts: + type: array + items: + $ref: '#/components/schemas/ForwardingBearerContainer' + minItems: 1 + ddnFailureSubs: + $ref: '#/components/schemas/DdnFailureSubs' + skipN2PduSessionResRelInd: + type: boolean + default: false + secondaryRatUsageDataReportContainer: + type: array + items: + $ref: '#/components/schemas/SecondaryRatUsageDataReportContainer' + minItems: 1 + smPolicyNotifyInd: + type: boolean + enum: + - true + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + + SmContextUpdatedData: + description: Data within Update SM Context Response + type: object + properties: + upCnxState: + $ref: '#/components/schemas/UpCnxState' + hoState: + $ref: '#/components/schemas/HoState' + releaseEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + allocatedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + modifiedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + epsBearerSetup: + type: array + items: + $ref: '#/components/schemas/EpsBearerContainer' + minItems: 1 + dataForwarding: + type: boolean + n3DlForwardingTnlList: + type: array + items: + $ref: '#/components/schemas/IndirectDataForwardingTunnelInfo' + minItems: 1 + n3UlForwardingTnlList: + type: array + items: + $ref: '#/components/schemas/IndirectDataForwardingTunnelInfo' + minItems: 1 + n9UlForwardingTunnel: + $ref: '#/components/schemas/TunnelInfo' + cause: + $ref: '#/components/schemas/Cause' + maAcceptedInd: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + forwardingFTeid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + forwardingBearerContexts: + type: array + items: + $ref: '#/components/schemas/ForwardingBearerContainer' + minItems: 1 + selectedSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + selectedOldSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + anchorSmfFeatures: + $ref: '#/components/schemas/AnchorSmfFeatures' + + SmContextReleaseData: + description: Data within Release SM Context Request + type: object + properties: + cause: + $ref: '#/components/schemas/Cause' + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + vsmfReleaseOnly: + type: boolean + default: false + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + ismfReleaseOnly: + type: boolean + default: false + + SmContextReleasedData: + description: Data within Release SM Context Response + type: object + properties: + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + + SmContextStatusNotification: + description: Data within Notify SM Context Status Request + type: object + properties: + statusInfo : + $ref: '#/components/schemas/StatusInfo' + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + ddnFailureStatus: + type: boolean + default: false + notifyCorrelationIdsForddnFailure: + type: array + items: + type: string + minItems: 1 + newIntermediateSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + newSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + newSmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + oldSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + oldSmContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altAnchorSmfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altAnchorSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + targetDnaiInfo: + $ref: '#/components/schemas/TargetDnaiInfo' + oldPduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - statusInfo + + PduSessionCreateData: + description: Data within Create Request + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + unauthenticatedSupi: + type: boolean + default: false + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + selectedDnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hplmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + vsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ismfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + requestType: + $ref: '#/components/schemas/RequestType' + epsBearerId: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + pgwS8cFteid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + vsmfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ismfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + vcnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + icnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + n9ForwardingTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + additionalCnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAnType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + n1SmInfoFromUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + unknownN1SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hPcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + hoPreparationIndication: + type: boolean + selMode: + $ref: '#/components/schemas/DnnSelectionMode' + alwaysOnRequested: + type: boolean + default: false + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + hNwPubKeyId: + type: integer + epsInterworkingInd: + $ref: '#/components/schemas/EpsInterworkingIndication' + vSmfServiceInstanceId: + type: string + iSmfServiceInstanceId: + type: string + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + chargingId: + type: string + pattern: '^(0|([1-9]{1}[0-9]{0,9}))$' + oldPduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + epsBearerCtxStatus: + $ref: '#/components/schemas/EpsBearerContextStatus' + amfNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + maxIntegrityProtectedDataRateUl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + cpCiotEnabled: + type: boolean + default: false + cpOnlyInd: + type: boolean + default: false + invokeNef: + type: boolean + default: false + maRequestInd: + type: boolean + default: false + maNwUpgradeInd: + type: boolean + default: false + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + presenceInLadn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + secondaryRatUsageInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' + minItems: 1 + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + dlServingPlmnRateCtl: + type: integer + minimum: 10 + upSecurityInfo: + $ref: '#/components/schemas/UpSecurityInfo' + vplmnQos: + $ref: '#/components/schemas/VplmnQos' + oldSmContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + redundantPduSessionInfo: + $ref: '#/components/schemas/RedundantPduSessionInformation' + oldPduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smPolicyNotifyInd: + type: boolean + default: false + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + upipSupported: + type: boolean + default: false + upCnxState: + $ref: '#/components/schemas/UpCnxState' + disasterRoamingInd: + type: boolean + default: false + required: + - dnn + - servingNetwork + - anType + oneOf: + - required: [ vsmfId, vsmfPduSessionUri ] + - required: [ ismfId, ismfPduSessionUri ] + + PduSessionCreatedData: + description: Data within Create Response + type: object + properties: + pduSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sscMode: + type: string + pattern: '^[0-7]$' + hcnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + cnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + additionalCnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + qosFlowsSetupList: + type: array + items: + $ref: '#/components/schemas/QosFlowSetupItem' + minItems: 1 + hSmfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + enablePauseCharging: + type: boolean + default: false + ueIpv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + epsBearerInfo: + type: array + items: + $ref: '#/components/schemas/EpsBearerInfo' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + maxIntegrityProtectedDataRate: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + alwaysOnGranted: + type: boolean + default: false + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + hSmfServiceInstanceId: + type: string + smfServiceInstanceId: + type: string + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + ipv6MultiHomingInd: + type: boolean + default: false + maAcceptedInd: + type: boolean + default: false + homeProvidedChargingId: + type: string + pattern: '^(0|([1-9]{1}[0-9]{0,9}))$' + nefExtBufSupportInd: + type: boolean + default: false + smallDataRateControlEnabled: + type: boolean + default: false + ueIpv6InterfaceId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + ipv6Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + dnAaaAddress: + $ref: '#/components/schemas/IpAddress' + redundantPduSessionInfo: + $ref: '#/components/schemas/RedundantPduSessionInformation' + nspuSupportInd: + type: boolean + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + intraPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - pduSessionType + - sscMode + oneOf: + - required: [ hSmfInstanceId ] + - required: [ smfInstanceId ] + + HsmfUpdateData: + description: Data within Update Request towards H-SMF, or from I-SMF to SMF + type: object + properties: + requestIndication: + $ref: '#/components/schemas/RequestIndication' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + vcnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + icnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + additionalCnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAnType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + pauseCharging: + type: boolean + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + n1SmInfoFromUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + unknownN1SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + qosFlowsRelNotifyList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + qosFlowsNotifyList: + type: array + items: + $ref: '#/components/schemas/QosFlowNotifyItem' + minItems: 1 + NotifyList: + type: array + items: + $ref: '#/components/schemas/PduSessionNotifyItem' + minItems: 1 +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + epsBearerId: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 0 + hoPreparationIndication: + type: boolean + revokeEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + cause: + $ref: '#/components/schemas/Cause' + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + alwaysOnRequested: + type: boolean + default: false + epsInterworkingInd: + $ref: '#/components/schemas/EpsInterworkingIndication' + secondaryRatUsageReport: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' + minItems: 1 + secondaryRatUsageInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' + minItems: 1 + anTypeCanBeChanged: + type: boolean + default: false + maReleaseInd: + $ref: '#/components/schemas/MaReleaseIndication' + maNwUpgradeInd: + type: boolean + default: false + maRequestInd: + type: boolean + default: false + unavailableAccessInd: + $ref: '#/components/schemas/UnavailableAccessIndication' + psaInfo: + type: array + items: + $ref: '#/components/schemas/PsaInformation' + minItems: 1 + ulclBpInfo: + $ref: '#/components/schemas/UlclBpInformation' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + presenceInLadn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + vsmfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + vsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + vSmfServiceInstanceId: + type: string + ismfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ismfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + iSmfServiceInstanceId: + type: string + dlServingPlmnRateCtl: + type: integer + minimum: 10 + nullable: true + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + vplmnQos: + $ref: '#/components/schemas/VplmnQos' + securityResult: + $ref: '#/components/schemas/SecurityResult' + upSecurityInfo: + $ref: '#/components/schemas/UpSecurityInfo' + amfNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + secondaryRatUsageDataReportContainer: + type: array + items: + $ref: '#/components/schemas/SecondaryRatUsageDataReportContainer' + minItems: 1 + smPolicyNotifyInd: + type: boolean + enum: + - true + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + maxIntegrityProtectedDataRateUl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + required: + - requestIndication + + HsmfUpdatedData: + description: Data within Update Response from H-SMF, or from SMF to I-SMF + type: object + properties: + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + homeProvidedChargingId: + type: string + pattern: '^(0|([1-9]{1}[0-9]{0,9}))$' + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + maxIntegrityProtectedDataRateUl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + ipv6MultiHomingInd: + type: boolean + default: false + qosFlowsSetupList: + type: array + items: + $ref: '#/components/schemas/QosFlowSetupItem' + minItems: 1 + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + epsBearerInfo: + type: array + items: + $ref: '#/components/schemas/EpsBearerInfo' + minItems: 1 + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + intraPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + ReleaseData: + description: Data within Release Request + type: object + properties: + cause: + $ref: '#/components/schemas/Cause' + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + secondaryRatUsageReport: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' + minItems: 1 + secondaryRatUsageInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' + minItems: 1 + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + + ReleasedData: + description: Data within Release Response + type: object + properties: + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + + VsmfUpdateData: + description: Data within Update Request towards V-SMF, or from SMF to I-SMF + type: object + properties: + requestIndication: + $ref: '#/components/schemas/RequestIndication' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + qosFlowsAddModRequestList: + type: array + items: + $ref: '#/components/schemas/QosFlowAddModifyRequestItem' + minItems: 1 + qosFlowsRelRequestList: + type: array + items: + $ref: '#/components/schemas/QosFlowReleaseRequestItem' + minItems: 1 + epsBearerInfo: + type: array + items: + $ref: '#/components/schemas/EpsBearerInfo' + minItems: 1 + assignEbiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + revokeEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + modifiedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + alwaysOnGranted: + type: boolean + default: false + hsmfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + newSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + newSmfPduSessionUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + cause: + $ref: '#/components/schemas/Cause' + n1smCause: + type: string + backOffTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maReleaseInd: + $ref: '#/components/schemas/MaReleaseIndication' + maAcceptedInd: + type: boolean + default: false + additionalCnTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + n4InfoExt3: + $ref: '#/components/schemas/N4Information' + smallDataRateControlEnabled: + type: boolean + qosMonitoringInfo: + $ref: '#/components/schemas/QosMonitoringInfo' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + n9DataForwardingInd: + type: boolean + default: false + n9InactivityTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - requestIndication + + VsmfUpdatedData: + description: Data within Update Response from V-SMF, or from I-SMF to SMF + type: object + properties: + qosFlowsAddModList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + qosFlowsRelList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + qosFlowsFailedtoAddModList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + qosFlowsFailedtoRelList: + type: array + items: + $ref: '#/components/schemas/QosFlowItem' + minItems: 1 + n1SmInfoFromUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + unknownN1SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + addUeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + assignedEbiList: + type: array + items: + $ref: '#/components/schemas/EbiArpMapping' + minItems: 1 + failedToAssignEbiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + secondaryRatUsageReport: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageReport' + minItems: 1 + secondaryRatUsageInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SecondaryRatUsageInfo' + minItems: 1 + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + n4InfoExt3: + $ref: '#/components/schemas/N4Information' + + StatusNotification: + description: Data within Notify Status Request + type: object + properties: + statusInfo : + $ref: '#/components/schemas/StatusInfo' + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + targetDnaiInfo: + $ref: '#/components/schemas/TargetDnaiInfo' + oldPduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + newSmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + intraPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - statusInfo + + QosFlowItem: + description: Individual QoS flow + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + cause: + $ref: '#/components/schemas/Cause' + currentQosProfileIndex: + type: integer + minimum: 1 + maximum: 8 + nullQoSProfileIndex: + type: boolean + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + required: + - qfi + + QosFlowSetupItem: + description: Individual QoS flow to setup + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + qosRules: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + ebi: + $ref: '#/components/schemas/EpsBearerId' + qosFlowDescription: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + qosFlowProfile: + $ref: '#/components/schemas/QosFlowProfile' + associatedAnType: + $ref: '#/components/schemas/QosFlowAccessType' + defaultQosRuleInd: + type: boolean + required: + - qfi + - qosRules + + QosFlowAddModifyRequestItem: + description: Individual QoS flow requested to be created or modified + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + ebi: + $ref: '#/components/schemas/EpsBearerId' + qosRules: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + qosFlowDescription: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + qosFlowProfile: + $ref: '#/components/schemas/QosFlowProfile' + associatedAnType: + $ref: '#/components/schemas/QosFlowAccessType' + required: + - qfi + + QosFlowReleaseRequestItem: + description: Individual QoS flow requested to be released + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + qosRules: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + qosFlowDescription: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + required: + - qfi + + QosFlowProfile: + description: QoS flow profile + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + nonDynamic5Qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NonDynamic5Qi' + dynamic5Qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dynamic5Qi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + gbrQosFlowInfo: + $ref: '#/components/schemas/GbrQosFlowInformation' + rqa: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReflectiveQoSAttribute' + additionalQosFlowInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AdditionalQosFlowInfo' + qosMonitoringReq: + $ref: '#/components/schemas/QosMonitoringReq' + qosRepPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - 5qi + + GbrQosFlowInformation: + description: GBR QoS flow information + type: object + properties: + maxFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + notifControl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationControl' + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + alternativeQosProfileList: + type: array + items: + $ref: '#/components/schemas/AlternativeQosProfile' + required: + - maxFbrDl + - maxFbrUl + - guaFbrDl + - guaFbrUl + + QosFlowNotifyItem: + description: Notification related to a QoS flow + type: object + properties: + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + notificationCause: + $ref: '#/components/schemas/NotificationCause' + currentQosProfileIndex: + type: integer + minimum: 1 + maximum: 8 + nullQoSProfileIndex: + type: boolean + required: + - qfi + - notificationCause + + + SmContextRetrieveData: + description: Data within Retrieve SM Context Request + type: object + properties: + targetMmeCap: + $ref: '#/components/schemas/MmeCapabilities' + smContextType: + $ref: '#/components/schemas/SmContextType' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + notToTransferEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + ranUnchangedInd: + type: boolean + default: false + + SmContextRetrievedData: + description: Data within Retrieve SM Context Response + type: object + properties: + ueEpsPdnConnection: + $ref: '#/components/schemas/EpsPdnCnxContainer' + smContext: + $ref: '#/components/schemas/SmContext' + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + apnRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApnRateStatus' + dlDataWaitingInd: + type: boolean + default: false + afCoordinationInfo: + $ref: '#/components/schemas/AfCoordinationInfo' + required: + - ueEpsPdnConnection + + MmeCapabilities: + description: MME capabilities + type: object + properties: + nonIpSupported: + type: boolean + default: false + ethernetSupported: + type: boolean + default: false + upipSupported: + type: boolean + default: false + + TunnelInfo: + description: Tunnel Information + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + gtpTeid: + $ref: '#/components/schemas/Teid' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - gtpTeid + + StatusInfo: + description: Status of SM context or of PDU session + type: object + properties: + resourceStatus: + $ref: '#/components/schemas/ResourceStatus' + cause: + $ref: '#/components/schemas/Cause' + cnAssistedRanPara: + $ref: '#/components/schemas/CnAssistedRanPara' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - resourceStatus + + + EpsPdnCnxInfo: + description: EPS PDN Connection Information from H-SMF to V-SMF, or from SMF to I-SMF + type: object + properties: + pgwS8cFteid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + pgwNodeName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + linkedBearerId: + $ref: '#/components/schemas/EpsBearerId' + required: + - pgwS8cFteid + + EpsBearerInfo: + description: EPS Bearer Information from H-SMF to V-SMF, or from SMF to I-SMF + type: object + properties: + ebi: + $ref: '#/components/schemas/EpsBearerId' + pgwS8uFteid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + bearerLevelQoS: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + required: + - ebi + - pgwS8uFteid + - bearerLevelQoS + + PduSessionNotifyItem: + description: Notification related to a PDU session + type: object + properties: + notificationCause: + $ref: '#/components/schemas/NotificationCause' + required: + - notificationCause + + EbiArpMapping: + description: EBI to ARP mapping + type: object + properties: + epsBearerId: + $ref: '#/components/schemas/EpsBearerId' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + required: + - epsBearerId + - arp + + SmContextCreateError: + description: Error within Create SM Context Response + type: object + properties: + error: + $ref: '#/components/schemas/ExtProblemDetails' + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - error + + SmContextUpdateError: + description: Error within Update SM Context Response + type: object + properties: + error: + $ref: '#/components/schemas/ExtProblemDetails' + n1SmMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n2SmInfoType: + $ref: '#/components/schemas/N2SmInfoType' + upCnxState: + $ref: '#/components/schemas/UpCnxState' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - error + + PduSessionCreateError: + description: Error within Create Response + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + n1smCause: + type: string + pattern: '^[A-F0-9]{2}$' + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + backOffTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - error + + HsmfUpdateError: + description: Error within Update Response from H-SMF, or from SMF to I-SMF + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + n1smCause: + type: string + pattern: '^[A-F0-9]{2}$' + n1SmInfoToUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + backOffTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - error + + VsmfUpdateError: + description: Error within Update Response from V-SMF, or from I-SMF to SMF + type: object + properties: + error: + $ref: '#/components/schemas/ExtProblemDetails' + pti: + $ref: '#/components/schemas/ProcedureTransactionId' + n1smCause: + type: string + pattern: '^[A-F0-9]{2}$' + n1SmInfoFromUe: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + unknownN1SmInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + failedToAssignEbiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + n4Info: + $ref: '#/components/schemas/N4Information' + n4InfoExt1: + $ref: '#/components/schemas/N4Information' + n4InfoExt2: + $ref: '#/components/schemas/N4Information' + n4InfoExt3: + $ref: '#/components/schemas/N4Information' + required: + - error + + SmContext: + description: Complete SM Context + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + selectedDnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hplmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pduSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + hSmfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + pduSessionRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + intraPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + selMode: + $ref: '#/components/schemas/DnnSelectionMode' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + hNwPubKeyId: + type: integer + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + qosFlowsList: + type: array + items: + $ref: '#/components/schemas/QosFlowSetupItem' + minItems: 1 + hSmfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pduSessionSmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + pduSessionSmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pduSessionSmfBinding: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/SbiBindingLevel' + enablePauseCharging: + type: boolean + default: false + ueIpv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + epsPdnCnxInfo: + $ref: '#/components/schemas/EpsPdnCnxInfo' + epsBearerInfo: + type: array + items: + $ref: '#/components/schemas/EpsBearerInfo' + minItems: 1 + maxIntegrityProtectedDataRate: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + alwaysOnGranted: + type: boolean + default: false + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + hSmfServiceInstanceId: + type: string + smfServiceInstanceId: + type: string + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + forwardingInd: + type: boolean + default: false + psaTunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + chargingId: + type: string + pattern: '^(0|([1-9]{1}[0-9]{0,9}))$' + chargingInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ChargingInformation' + roamingChargingProfile: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/RoamingChargingProfile' + nefExtBufSupportInd: + type: boolean + default: false + ipv6Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + dnAaaAddress: + $ref: '#/components/schemas/IpAddress' + redundantPduSessionInfo: + $ref: '#/components/schemas/RedundantPduSessionInformation' + ranTunnelInfo: + $ref: '#/components/schemas/QosFlowTunnel' + addRanTunnelInfo: + type: array + items: + $ref: '#/components/schemas/QosFlowTunnel' + minItems: 1 + redRanTunnelInfo: + $ref: '#/components/schemas/QosFlowTunnel' + addRedRanTunnelInfo: + type: array + items: + $ref: '#/components/schemas/QosFlowTunnel' + minItems: 1 + nspuSupportInd: + type: boolean + smfBindingInfo: + type: string + satelliteBackhaulCat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + sscMode: + type: string + pattern: '^[0-7]$' + dlsetSupportInd: + type: boolean + n9fscSupportInd: + type: boolean + disasterRoamingInd: + type: boolean + default: false + anchorSmfOauth2Required: + type: boolean + required: + - pduSessionId + - dnn + - sNssai + - pduSessionType + - sessionAmbr + - qosFlowsList + + ExemptionInd: + description: Exemption Indication + type: object + properties: + dnnCongestion: + type: boolean + default: false + snssaiOnlyCongestion: + type: boolean + default: false + snssaiDnnCongestion: + type: boolean + default: false + + PsaInformation: + description: PSA Information + type: object + properties: + psaInd: + $ref: '#/components/schemas/PsaIndication' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + ueIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + psaUpfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + DnaiInformation: + description: DNAI Information + type: object + properties: + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + noDnaiChangeInd: + type: boolean + noLocalPsaChangeInd: + type: boolean + required: + - dnai + + N4Information: + description: N4 Information + type: object + properties: + n4MessageType: + $ref: '#/components/schemas/N4MessageType' + n4MessagePayload: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + n4DnaiInfo: + $ref: '#/components/schemas/DnaiInformation' + psaUpfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ulClBpId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + n9UlPdrIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + minItems: 1 + required: + - n4MessageType + - n4MessagePayload + + IndirectDataForwardingTunnelInfo: + description: Indirect Data Forwarding Tunnel Information + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + gtpTeid: + $ref: '#/components/schemas/Teid' + drbId: + $ref: '#/components/schemas/DrbId' + additionalTnlNb: + $ref: '#/components/schemas/AdditionalTnlNb' + required: + - gtpTeid + not: + required: [ drbId, additionalTnlNb ] + + SendMoDataReqData: + description: Data within Send MO Data Request + type: object + properties: + moData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + required: + - moData + + CnAssistedRanPara: + description: SMF derived CN assisted RAN parameters tuning + type: object + properties: + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndication' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTime' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationType' + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfile' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndication' + + UlclBpInformation: + description: UL CL or BP Information + type: object + properties: + ulclBpUpfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + TransferMoDataReqData: + description: Data within Transfer MO Data Request + type: object + properties: + moData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + ueLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + required: + - moData + + TransferMtDataReqData: + description: Data within Transfer MT Data Request + type: object + properties: + mtData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - mtData + + TransferMtDataError: + description: Transfer MT Data Error Response + allOf: + - $ref: '#/components/schemas/ExtProblemDetails' + - $ref: '#/components/schemas/TransferMtDataAddInfo' + + TransferMtDataAddInfo: + description: Transfer MT Data Error Response Additional Information + type: object + properties: + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + VplmnQos: + description: VPLMN QoS + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + maxFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + DdnFailureSubs: + description: DDN Failure Subscription + type: object + properties: + ddnFailureSubsInd: + type: boolean + default: false + ddnFailureSubsInfoList: + type: array + items: + $ref: '#/components/schemas/DdnFailureSubInfo' + minItems: 1 + + DdnFailureSubInfo: + description: DDN Failure Subscription Information + type: object + required: + - notifyCorrelationId + properties: + notifyCorrelationId: + type: string + dddTrafficDescriptorList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + + RetrieveData: + description: Data within Retrieve Request + type: object + properties: + smallDataRateStatusReq: + type: boolean + default: false + pduSessionContextType: + $ref: '#/components/schemas/PduSessionContextType' + + RetrievedData: + description: Data within Retrieve Response + type: object + properties: + smallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + afCoordinationInfo: + $ref: '#/components/schemas/AfCoordinationInfo' + + SecurityResult: + description: Security Result + type: object + properties: + integrityProtectionResult: + $ref: '#/components/schemas/ProtectionResult' + confidentialityProtectionResult: + $ref: '#/components/schemas/ProtectionResult' + + UpSecurityInfo: + description: User Plane Security Information + type: object + properties: + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + maxIntegrityProtectedDataRateUl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + maxIntegrityProtectedDataRateDl: + $ref: '#/components/schemas/MaxIntegrityProtectedDataRate' + securityResult: + $ref: '#/components/schemas/SecurityResult' + required: + - upSecurity + + AlternativeQosProfile: + description: Alternative QoS Profile + type: object + properties: + index: + type: integer + minimum: 1 + maximum: 8 + guaFbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + guaFbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + packetDelayBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + packetErrRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + required: + - index + + ExtProblemDetails: + description: Extended Problem Details + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ProblemDetailsAddInfo' + + ProblemDetailsAddInfo: + description: Problem Details Additional Information + type: object + properties: + remoteError: + type: boolean + + QosMonitoringInfo: + description: QoS Monitoring Information + type: object + properties: + qosMonitoringInd: + type: boolean + default: false + + IpAddress: + description: IP Address + type: object + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + - required: + - ipv6Prefix + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + RedundantPduSessionInformation: + description: Redundant PDU Session Information + type: object + properties: + rsn: + $ref: '#/components/schemas/Rsn' + pduSessionPairId: + type: integer + minimum: 0 + maximum: 255 + required: + - rsn + + QosFlowTunnel: + description: Tunnel Information per QoS Flow + type: object + properties: + qfiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + minItems: 1 + tunnelInfo: + $ref: '#/components/schemas/TunnelInfo' + required: + - qfiList + - tunnelInfo + + TargetDnaiInfo: + description: Target DNAI Information + type: object + properties: + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + smfSelectionType: + $ref: '#/components/schemas/SmfSelectionType' + required: + - smfSelectionType + + AfCoordinationInfo: + description: AF Coordination Information + type: object + properties: + sourceDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + sourceUeIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + sourceUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + notificationInfoList: + type: array + items: + $ref: '#/components/schemas/NotificationInfo' + minItems: 1 + + NotificationInfo: + description: > + Notification Correlation ID and Notification URI provided by the NF service consumer + type: object + properties: + notifId: + type: string + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + upBufferInd: + type: boolean + default: false + required: + - notifId + - notifUri + + AnchorSmfFeatures: + description: Anchor SMF supported features + type: object + properties: + psetrSupportInd: + type: boolean + +# +# SIMPLE DATA TYPES +# + ProcedureTransactionId: + description: Procedure Transaction Identifier + type: integer + minimum: 0 + maximum: 255 + + EpsBearerId: + description: EPS Bearer Identifier + type: integer + minimum: 0 + maximum: 15 + + EpsPdnCnxContainer: + description: UE EPS PDN Connection container from SMF to AMF + type: string + + EpsBearerContainer: + description: EPS Bearer container from SMF to AMF + type: string + + Teid: + type: string + description: GTP Tunnel Endpoint Identifier + pattern: '^[A-Fa-f0-9]{8}$' + + EpsBearerContextStatus: + description: EPS bearer context status + type: string + pattern: '^[A-Fa-f0-9]{4}$' + + DrbId: + description: Data Radio Bearer Identity + type: integer + minimum: 1 + maximum: 32 + + AdditionalTnlNb: + description: indicates first, second or third additional indirect data forwarding tunnel + type: integer + minimum: 1 + maximum: 3 + + ForwardingBearerContainer: + description: Forwarding Bearer Container + type: string + + SecondaryRatUsageDataReportContainer: + description: Secondary Rat Usage Data Report Container + type: string + format: byte + +# +# ENUMERATIONS +# + UpCnxState: + anyOf: + - type: string + enum: + - ACTIVATED + - DEACTIVATED + - ACTIVATING + - SUSPENDED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + User Plane Connection State. Possible values are + - ACTIVATED + - DEACTIVATED + - ACTIVATING + - SUSPENDED + + HoState: + anyOf: + - type: string + enum: + - NONE + - PREPARING + - PREPARED + - COMPLETED + - CANCELLED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Handover state. Possible values are + - NONE + - PREPARING + - PREPARED + - COMPLETED + - CANCELLED + + RequestType: + anyOf: + - type: string + enum: + - INITIAL_REQUEST + - EXISTING_PDU_SESSION + - INITIAL_EMERGENCY_REQUEST + - EXISTING_EMERGENCY_PDU_SESSION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Request Type in Create (SM context) service operation. Possible values are + - INITIAL_REQUEST + - EXISTING_PDU_SESSION + - INITIAL_EMERGENCY_REQUEST + - EXISTING_EMERGENCY_PDU_SESSION + + RequestIndication: + anyOf: + - type: string + enum: + - UE_REQ_PDU_SES_MOD + - UE_REQ_PDU_SES_REL + - PDU_SES_MOB + - NW_REQ_PDU_SES_AUTH + - NW_REQ_PDU_SES_MOD + - NW_REQ_PDU_SES_REL + - EBI_ASSIGNMENT_REQ + - REL_DUE_TO_5G_AN_REQUEST + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Request Indication in Update (SM context) service operation. Possible values are + - UE_REQ_PDU_SES_MOD + - UE_REQ_PDU_SES_REL + - PDU_SES_MOB + - NW_REQ_PDU_SES_AUTH + - NW_REQ_PDU_SES_MOD + - NW_REQ_PDU_SES_REL + - EBI_ASSIGNMENT_REQ + - REL_DUE_TO_5G_AN_REQUEST + + NotificationCause: + anyOf: + - type: string + enum: + - QOS_FULFILLED + - QOS_NOT_FULFILLED + - UP_SEC_FULFILLED + - UP_SEC_NOT_FULFILLED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Cause for generating a notification. Possible values are + - QOS_FULFILLED + - QOS_NOT_FULFILLED + - UP_SEC_FULFILLED + - UP_SEC_NOT_FULFILLED + + Cause: + anyOf: + - type: string + enum: + - REL_DUE_TO_HO + - EPS_FALLBACK + - REL_DUE_TO_UP_SEC + - DNN_CONGESTION + - S_NSSAI_CONGESTION + - REL_DUE_TO_REACTIVATION + - 5G_AN_NOT_RESPONDING + - REL_DUE_TO_SLICE_NOT_AVAILABLE + - REL_DUE_TO_DUPLICATE_SESSION_ID + - PDU_SESSION_STATUS_MISMATCH + - HO_FAILURE + - INSUFFICIENT_UP_RESOURCES + - PDU_SESSION_HANDED_OVER + - PDU_SESSION_RESUMED + - CN_ASSISTED_RAN_PARAMETER_TUNING + - ISMF_CONTEXT_TRANSFER + - SMF_CONTEXT_TRANSFER + - REL_DUE_TO_PS_TO_CS_HO + - REL_DUE_TO_SUBSCRIPTION_CHANGE + - HO_CANCEL + - REL_DUE_TO_SLICE_NOT_AUTHORIZED + - PDU_SESSION_HAND_OVER_FAILURE + - DDN_FAILURE_STATUS + - REL_DUE_TO_CP_ONLY_NOT_APPLICABLE + - NOT_SUPPORTED_WITH_ISMF + - CHANGED_ANCHOR_SMF + - CHANGED_INTERMEDIATE_SMF + - TARGET_DNAI_NOTIFICATION + - REL_DUE_TO_VPLMN_QOS_FAILURE + - REL_DUE_TO_SMF_NOT_SUPPORT_PSETR + - REL_DUE_TO_SNPN_SNPN_MOBILITY + - REL_DUE_TO_NO_HR_AGREEMENT + - REL_DUE_TO_UNSPECIFIED_REASON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Cause information. Possible values are + - REL_DUE_TO_HO + - EPS_FALLBACK + - REL_DUE_TO_UP_SEC + - DNN_CONGESTION + - S_NSSAI_CONGESTION + - REL_DUE_TO_REACTIVATION + - 5G_AN_NOT_RESPONDING + - REL_DUE_TO_SLICE_NOT_AVAILABLE + - REL_DUE_TO_DUPLICATE_SESSION_ID + - PDU_SESSION_STATUS_MISMATCH + - HO_FAILURE + - INSUFFICIENT_UP_RESOURCES + - PDU_SESSION_HANDED_OVER + - PDU_SESSION_RESUMED + - CN_ASSISTED_RAN_PARAMETER_TUNING + - ISMF_CONTEXT_TRANSFER + - SMF_CONTEXT_TRANSFER + - REL_DUE_TO_PS_TO_CS_HO + - REL_DUE_TO_SUBSCRIPTION_CHANGE + - HO_CANCEL + - REL_DUE_TO_SLICE_NOT_AUTHORIZED + - PDU_SESSION_HAND_OVER_FAILURE + - DDN_FAILURE_STATUS + - REL_DUE_TO_CP_ONLY_NOT_APPLICABLE + - NOT_SUPPORTED_WITH_ISMF + - CHANGED_ANCHOR_SMF + - CHANGED_INTERMEDIATE_SMF + - TARGET_DNAI_NOTIFICATION + - REL_DUE_TO_VPLMN_QOS_FAILURE + - REL_DUE_TO_SMF_NOT_SUPPORT_PSETR + - REL_DUE_TO_SNPN_SNPN_MOBILITY + - REL_DUE_TO_NO_HR_AGREEMENT + - REL_DUE_TO_UNSPECIFIED_REASON + + ResourceStatus: + anyOf: + - type: string + enum: + - RELEASED + - UNCHANGED + - TRANSFERRED + - UPDATED + - ALT_ANCHOR_SMF + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Status of SM context or PDU session resource. Possible values are + - RELEASED + - UNCHANGED + - TRANSFERRED + - UPDATED + - ALT_ANCHOR_SMF + + DnnSelectionMode: + anyOf: + - type: string + enum: + - VERIFIED + - UE_DNN_NOT_VERIFIED + - NW_DNN_NOT_VERIFIED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + DNN Selection Mode. Possible values are + - VERIFIED + - UE_DNN_NOT_VERIFIED + - NW_DNN_NOT_VERIFIED + + EpsInterworkingIndication: + anyOf: + - type: string + enum: + - NONE + - WITH_N26 + - WITHOUT_N26 + - IWK_NON_3GPP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + EPS Interworking Indication. Possible values are + - NONE + - WITH_N26 + - WITHOUT_N26 + - IWK_NON_3GPP + + N2SmInfoType: + anyOf: + - type: string + enum: + - PDU_RES_SETUP_REQ + - PDU_RES_SETUP_RSP + - PDU_RES_SETUP_FAIL + - PDU_RES_REL_CMD + - PDU_RES_REL_RSP + - PDU_RES_MOD_REQ + - PDU_RES_MOD_RSP + - PDU_RES_MOD_FAIL + - PDU_RES_NTY + - PDU_RES_NTY_REL + - PDU_RES_MOD_IND + - PDU_RES_MOD_CFM + - PATH_SWITCH_REQ + - PATH_SWITCH_SETUP_FAIL + - PATH_SWITCH_REQ_ACK + - PATH_SWITCH_REQ_FAIL + - HANDOVER_REQUIRED + - HANDOVER_CMD + - HANDOVER_PREP_FAIL + - HANDOVER_REQ_ACK + - HANDOVER_RES_ALLOC_FAIL + - SECONDARY_RAT_USAGE + - PDU_RES_MOD_IND_FAIL + - UE_CONTEXT_RESUME_REQ + - UE_CONTEXT_RESUME_RSP + - UE_CONTEXT_SUSPEND_REQ + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + N2 SM Information Type. Possible values are + - PDU_RES_SETUP_REQ + - PDU_RES_SETUP_RSP + - PDU_RES_SETUP_FAIL + - PDU_RES_REL_CMD + - PDU_RES_REL_RSP + - PDU_RES_MOD_REQ + - PDU_RES_MOD_RSP + - PDU_RES_MOD_FAIL + - PDU_RES_NTY + - PDU_RES_NTY_REL + - PDU_RES_MOD_IND + - PDU_RES_MOD_CFM + - PATH_SWITCH_REQ + - PATH_SWITCH_SETUP_FAIL + - PATH_SWITCH_REQ_ACK + - PATH_SWITCH_REQ_FAIL + - HANDOVER_REQUIRED + - HANDOVER_CMD + - HANDOVER_PREP_FAIL + - HANDOVER_REQ_ACK + - HANDOVER_RES_ALLOC_FAIL + - SECONDARY_RAT_USAGE + - PDU_RES_MOD_IND_FAIL + - UE_CONTEXT_RESUME_REQ + - UE_CONTEXT_RESUME_RSP + - UE_CONTEXT_SUSPEND_REQ + + MaxIntegrityProtectedDataRate: + anyOf: + - type: string + enum: + - 64_KBPS + - MAX_UE_RATE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Maximum Integrity Protected Data Rate. Possible values are + - 64_KBPS + - MAX_UE_RATE + + MaReleaseIndication: + anyOf: + - type: string + enum: + - REL_MAPDU_OVER_3GPP + - REL_MAPDU_OVER_N3GPP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Multi-Access PDU session release Indication. Possible values are + - REL_MAPDU_OVER_3GPP + - REL_MAPDU_OVER_N3GPP + + SmContextType: + anyOf: + - type: string + enum: + - EPS_PDN_CONNECTION + - SM_CONTEXT + - AF_COORDINATION_INFO + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Type of SM Context information. Possible values are + - EPS_PDN_CONNECTION + - SM_CONTEXT + - AF_COORDINATION_INFO + + PsaIndication: + anyOf: + - type: string + enum: + - PSA_INSERTED + - PSA_REMOVED + - PSA_INSERTED_ONLY + - PSA_REMOVED_ONLY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Indication of whether a PSA is inserted or removed. Possible values are + - PSA_INSERTED + - PSA_REMOVED + - PSA_INSERTED_ONLY + - PSA_REMOVED_ONLY + + N4MessageType: + anyOf: + - type: string + enum: + - PFCP_SES_EST_REQ + - PFCP_SES_EST_RSP + - PFCP_SES_MOD_REQ + - PFCP_SES_MOD_RSP + - PFCP_SES_DEL_REQ + - PFCP_SES_DEL_RSP + - PFCP_SES_REP_REQ + - PFCP_SES_REP_RSP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + N4 Message Type. Possible values are + - PFCP_SES_EST_REQ + - PFCP_SES_EST_RSP + - PFCP_SES_MOD_REQ + - PFCP_SES_MOD_RSP + - PFCP_SES_DEL_REQ + - PFCP_SES_DEL_RSP + - PFCP_SES_REP_REQ + - PFCP_SES_REP_RSP + + QosFlowAccessType: + anyOf: + - type: string + enum: + - 3GPP + - NON_3GPP + - 3GPP_AND_NON_3GPP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Access type associated with a QoS Flow. Possible values are + - 3GPP + - NON_3GPP + - 3GPP_AND_NON_3GPP + + UnavailableAccessIndication: + anyOf: + - type: string + enum: + - 3GA_UNAVAILABLE + - N3GA_UNAVAILABLE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Indicates the access type of a MA PDU session that is unavailable. Possible values are + - 3GA_UNAVAILABLE + - N3GA_UNAVAILABLE + + ProtectionResult: + anyOf: + - type: string + enum: + - PERFORMED + - NOT_PERFORMED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Protection Result of the security policy indicated as "preferred". Possible values are + - PERFORMED + - NOT_PERFORMED + + QosMonitoringReq: + anyOf: + - type: string + enum: + - UL + - DL + - BOTH + - NONE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + QoS monitoring request. Possible values are + - UL + - DL + - BOTH + - NONE + + Rsn: + anyOf: + - type: string + enum: + - V1 + - V2 + - NONE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Redundancy Sequence Number. Possible values are + - V1 + - V2 + - NONE + + SmfSelectionType: + anyOf: + - type: string + enum: + - CURRENT_PDU_SESSION + - NEXT_PDU_SESSION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Smf Selection Type. Possible values are + - CURRENT_PDU_SESSION + - NEXT_PDU_SESSION + + PduSessionContextType: + anyOf: + - type: string + enum: + - AF_COORDINATION_INFO + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Type of PDU Session information. Possible values are + - AF_COORDINATION_INFO +# +# HTTP request bodies +# + requestBodies: + 'VsmfUpdateRequestBody': + description: representation of updates to apply to the PDU session + required: true + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/VsmfUpdateData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/VsmfUpdateData' + binaryDataN1SmInfoToUe: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + binaryDataN4InformationExt3: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt3: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + + 'NotifyStatusRequestBody': + description: representation of the status notification + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StatusNotification' + +# +# HTTP responses +# + responses: + 'VsmfUpdateResponse200': + description: successful update of a PDU session with content in the response + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/VsmfUpdatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/VsmfUpdatedData' + binaryDataN1SmInfoFromUe: + type: string + format: binary + binaryDataUnknownN1SmInfo: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + binaryDataN4InformationExt3: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoFromUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataUnknownN1SmInfo: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt3: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + + 'PduSessionCreateError': + description: unsuccessful creation of a PDU session + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/PduSessionCreateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/PduSessionCreateError' + binaryDataN1SmInfoToUe: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + + 'HsmfUpdateError': + description: unsuccessful update of a PDU session + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/HsmfUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/HsmfUpdateError' + binaryDataN1SmInfoToUe: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoToUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + + 'VsmfUpdateError': + description: unsuccessful update of a PDU session + content: + application/json: # message without binary body part + schema: + $ref: '#/components/schemas/VsmfUpdateError' + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/VsmfUpdateError' + binaryDataN1SmInfoFromUe: + type: string + format: binary + binaryDataUnknownN1SmInfo: + type: string + format: binary + binaryDataN4Information: + type: string + format: binary + binaryDataN4InformationExt1: + type: string + format: binary + binaryDataN4InformationExt2: + type: string + format: binary + binaryDataN4InformationExt3: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1SmInfoFromUe: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataUnknownN1SmInfo: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN4Information: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt1: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt2: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + binaryDataN4InformationExt3: + contentType: application/vnd.3gpp.pfcp + headers: + Content-Id: + schema: + type: string + + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_EE.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_EE.yaml new file mode 100644 index 000000000..8f257c17e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_EE.yaml @@ -0,0 +1,775 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'Nudm_EE' + description: | + Nudm Event Exposure Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ee/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ee + - {} + +paths: + /{ueIdentity}/ee-subscriptions: + post: + summary: Subscribe + operationId: CreateEeSubscription + tags: + - Create EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CreatedEeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-ee/v1/{ueIdentity}/ee-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + eventOccurrenceNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MonitoringReport' + minItems: 1 + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + monitoringRevocationNotification: + '{request.body#/secondCallbackRef}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EeMonitoringRevoked' + responses: + '204': + description: Successful Notification response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + + + /{ueIdentity}/ee-subscriptions/{subscriptionId}: + delete: + summary: Unsubscribe + operationId: DeleteEeSubscription + tags: + - Delete EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + - name: subscriptionId + in: path + description: Id of the EE Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: Patch + operationId: UpdateEeSubscription + tags: + - Update EE Subscription + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the subscription is applied. Contains the GPSI of the user or the external group ID or any UE. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+|anyUE)$' + - name: subscriptionId + in: path + description: Id of the EE Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ee: Access to the nudm-ee API + + + schemas: + +# COMPLEX TYPES: + + CreatedEeSubscription: + type: object + required: + - eeSubscription + properties: + eeSubscription: + $ref: '#/components/schemas/EeSubscription' + numberOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + eventReports: + type: array + items: + $ref: '#/components/schemas/MonitoringReport' + minItems: 1 + epcStatusInd: + type: boolean + failedMonitoringConfigs: + description: A map (list of key-value pairs where referenceId converted from integer to string serves as key; see clause 6.4.6.3.2) of FailedMonitoringConfiguration + type: object + additionalProperties: + $ref: '#/components/schemas/FailedMonitoringConfiguration' + minProperties: 1 + failedMoniConfigsEPC: + description: A map (list of key-value pairs where referenceId converted from integer to string serves as key; see clause 6.4.6.3.2) of FailedMonitoringConfiguration, the key value "ALL" may be used to identify a map entry which contains the failed cause of the EE subscription was not successful in EPC domain. + type: object + additionalProperties: + $ref: '#/components/schemas/FailedMonitoringConfiguration' + minProperties: 1 + resetIds: + type: array + items: + type: string + minItems: 1 + + + FailedMonitoringConfiguration: + description: Contains the event type and failed cause of the failed Monitoring Configuration in the EE subscription + type: object + required: + - eventType + - failedCause + properties: + eventType: + $ref: '#/components/schemas/EventType' + failedCause: + $ref: '#/components/schemas/FailedCause' + + + EeSubscription: + type: object + required: + - callbackReference + - monitoringConfigurations + properties: + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoringConfigurations: + description: A map (list of key-value pairs where ReferenceId serves as key) of MonitoringConfigurations + type: object + additionalProperties: + $ref: '#/components/schemas/MonitoringConfiguration' + minProperties: 1 + reportingOptions: + $ref: '#/components/schemas/ReportingOptions' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + subscriptionId: + type: string + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + epcAppliedInd: + type: boolean + default: false + scefDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + scefDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + notifyCorrelationId: + type: string + secondCallbackRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + excludeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + includeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + + MonitoringConfiguration: + type: object + required: + - eventType + properties: + eventType: + $ref: '#/components/schemas/EventType' + immediateFlag: + type: boolean + locationReportingConfiguration: + $ref: '#/components/schemas/LocationReportingConfiguration' + associationType: + $ref: '#/components/schemas/AssociationType' + datalinkReportCfg: + $ref: '#/components/schemas/DatalinkReportingConfiguration' + lossConnectivityCfg: + $ref: '#/components/schemas/LossConnectivityCfg' + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + suggestedPacketNumDl: + type: integer + minimum: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pduSessionStatusCfg: + $ref: '#/components/schemas/PduSessionStatusCfg' + reachabilityForSmsCfg: + $ref: '#/components/schemas/ReachabilityForSmsConfiguration' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + afId: + type: string + reachabilityForDataCfg: + $ref: '#/components/schemas/ReachabilityForDataConfiguration' + idleStatusInd: + type: boolean + default: false + + LossConnectivityCfg: + type: object + properties: + maxDetectionTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + LocationReportingConfiguration: + type: object + required: + - currentLocation + properties: + currentLocation: + type: boolean + oneTime: + type: boolean + accuracy: + $ref: '#/components/schemas/LocationAccuracy' + n3gppAccuracy: + $ref: '#/components/schemas/LocationAccuracy' + + ReportingOptions: + type: object + properties: + reportMode: + $ref: '#/components/schemas/EventReportMode' + maxNumOfReports: + $ref: '#/components/schemas/MaxNumOfReports' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + samplingRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + guardTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + reportPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + notifFlag: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationFlag' + + MonitoringReport: + type: object + required: + - referenceId + - eventType + - timeStamp + properties: + referenceId: + $ref: '#/components/schemas/ReferenceId' + eventType: + $ref: '#/components/schemas/EventType' + report: + $ref: '#/components/schemas/Report' + reachabilityForSmsReport: + $ref: '#/components/schemas/ReachabilityForSmsReport' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reachabilityReport: + $ref: '#/components/schemas/ReachabilityReport' + + Report: + oneOf: + - $ref: '#/components/schemas/ChangeOfSupiPeiAssociationReport' + - $ref: '#/components/schemas/RoamingStatusReport' + - $ref: '#/components/schemas/CnTypeChangeReport' + - $ref: '#/components/schemas/CmInfoReport' + - $ref: '#/components/schemas/LossConnectivityReport' + - $ref: '#/components/schemas/LocationReport' + - $ref: '#/components/schemas/PdnConnectivityStatReport' + + ReachabilityForSmsReport: + type: object + required: + - smsfAccessType + properties: + smsfAccessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + maxAvailabilityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ChangeOfSupiPeiAssociationReport: + type: object + required: + - newPei + properties: + newPei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + + RoamingStatusReport: + type: object + required: + - roaming + - newServingPlmn + properties: + roaming: + type: + boolean + newServingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + CnTypeChangeReport: + type: object + required: + - newCnType + properties: + newCnType: + $ref: '#/components/schemas/CnType' + oldCnType: + $ref: '#/components/schemas/CnType' + + DatalinkReportingConfiguration: + type: object + properties: + dddTrafficDes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + slice: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dddStatusList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + + CmInfoReport: + type: object + properties: + oldCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + newCmInfoList: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + minItems: 1 + maxItems: 2 + required: + - newCmInfoList + + PduSessionStatusCfg: + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + + ReachabilityReport: + type: object + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + reachability: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + maxAvailabilityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + idleStatusIndication: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/IdleStatusIndication' + + ReachabilityForDataConfiguration: + type: object + required: + - reportCfg + properties: + reportCfg: + $ref: '#/components/schemas/ReachabilityForDataReportConfig' + minInterval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + EeMonitoringRevoked: + type: object + required: + - revokedMonitoringEventList + properties: + revokedMonitoringEventList: + description: A map (list of key-value pairs where ReferenceId serves as key) of MonitoringEvents + type: object + additionalProperties: + $ref: '#/components/schemas/MonitoringEvent' + minProperties: 1 + removedGpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + excludeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + + MonitoringEvent: + type: object + required: + - eventType + properties: + eventType: + $ref: '#/components/schemas/EventType' + revokedCause: + $ref: '#/components/schemas/RevokedCause' + + LossConnectivityReport: + type: object + required: + - lossOfConnectReason + properties: + lossOfConnectReason: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/LossOfConnectivityReason' + + LocationReport: + type: object + required: + - location + properties: + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + + PdnConnectivityStatReport: + type: object + required: + - pdnConnStat + properties: + pdnConnStat: + $ref: '#/components/schemas/PdnConnectivityStatus' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pduSeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + pduSessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + + +# SIMPLE TYPES: + + ReferenceId: + type: integer + + MaxNumOfReports: + type: integer + + +# ENUMS: + + ReachabilityForSmsConfiguration: + anyOf: + - type: string + enum: + - REACHABILITY_FOR_SMS_OVER_NAS + - REACHABILITY_FOR_SMS_OVER_IP + - type: string + + EventType: + anyOf: + - type: string + enum: + - LOSS_OF_CONNECTIVITY + - UE_REACHABILITY_FOR_DATA + - UE_REACHABILITY_FOR_SMS + - LOCATION_REPORTING + - CHANGE_OF_SUPI_PEI_ASSOCIATION + - ROAMING_STATUS + - COMMUNICATION_FAILURE + - AVAILABILITY_AFTER_DDN_FAILURE + - CN_TYPE_CHANGE + - DL_DATA_DELIVERY_STATUS + - PDN_CONNECTIVITY_STATUS + - UE_CONNECTION_MANAGEMENT_STATE + - ACCESS_TYPE_REPORT + - REGISTRATION_STATE_REPORT + - CONNECTIVITY_STATE_REPORT + - TYPE_ALLOCATION_CODE_REPORT + - FREQUENT_MOBILITY_REGISTRATION_REPORT + - PDU_SES_REL + - PDU_SES_EST + - UE_MEMORY_AVAILABLE_FOR_SMS + - type: string + + LocationAccuracy: + anyOf: + - type: string + enum: + - CELL_LEVEL + - RAN_NODE_LEVEL + - TA_LEVEL + - N3IWF_LEVEL + - UE_IP + - UE_PORT + - type: string + + CnType: + anyOf: + - type: string + enum: + - SINGLE_4G + - SINGLE_5G + - DUAL_4G5G + - type: string + + AssociationType: + anyOf: + - type: string + enum: + - IMEI_CHANGE + - IMEISV_CHANGE + - type: string + + EventReportMode: + anyOf: + - type: string + enum: + - PERIODIC + - ON_EVENT_DETECTION + - type: string + + ReachabilityForDataReportConfig: + anyOf: + - type: string + enum: + - DIRECT_REPORT + - INDIRECT_REPORT + - type: string + + RevokedCause: + anyOf: + - type: string + enum: + - NOT_ALLOWED + - EXCLUDED_FROM_GROUP + - GPSI_REMOVED + - type: string + + FailedCause: + anyOf: + - type: string + enum: + - AF_NOT_ALLOWED + - MTC_PROVIDER_NOT_ALLOWED + - MONITORING_NOT_ALLOWED + - UNSUPPORTED_MONITORING_EVENT_TYPE + - UNSUPPORTED_MONITORING_REPORT_OPTIONS + - UNSPECIFIED + - type: string + description: Indicates the Failed cause of the failed Monitoring Configuration in the EE subscription + + PdnConnectivityStatus: + anyOf: + - type: string + enum: + - ESTABLISHED + - RELEASED + - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_MT.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_MT.yaml new file mode 100644 index 000000000..69bf49368 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_MT.yaml @@ -0,0 +1,209 @@ +openapi: 3.0.0 +info: + version: '1.1.0' + title: 'Nudm_MT' + description: | + UDM MT Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.7.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-mt/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-mt + - {} + +paths: + /{supi}: + get: + summary: Query Information for the UE + operationId: QueryUeInfo + tags: + - Query UE Info + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: fields + in: query + description: attributes to be retrieved + required: true + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/loc-info/provide-loc-info: + post: + summary: Provides the UE's 5GS location information + operationId: ProvideLocationInfo + tags: + - Provide UE Location + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-mt: Access to the nudm-mt API + + + schemas: + +# COMPLEX TYPES: + + UeInfo: + description: Represents UE information. + type: object + properties: + tadsInfo: + $ref: 'TS29518_Namf_MT.yaml#/components/schemas/UeContextInfo' + userState: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/5GsUserState' + 5gSrvccInfo: + $ref: '#/components/schemas/5GSrvccInfo' + + 5GSrvccInfo: + description: Represents 5G SRVCC information for a UE. + type: object + required: + - ue5GSrvccCapability + properties: + ue5GSrvccCapability: + type: boolean + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + + LocationInfoRequest: + description: Represents information to be sent in a location information request. It contains the requested information, i.e. current location, local time zone, RAT type, or serving node identity only. + type: object + properties: + req5gsLoc: + type: boolean + default: false + reqCurrentLoc: + type: boolean + default: false + reqRatType: + type: boolean + default: false + reqTimeZone: + type: boolean + default: false + reqServingNode: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + LocationInfoResult: + description: Represents the requested location information. + type: object + properties: + vPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + currentLoc: + type: boolean + geoInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + locationAge: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + +# SIMPLE TYPES: + + +# ENUMS: + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_NIDDAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_NIDDAU.yaml new file mode 100644 index 000000000..2d1c2a1ff --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_NIDDAU.yaml @@ -0,0 +1,195 @@ +openapi: 3.0.0 + +info: + version: '1.1.1' + title: 'Nudm_NIDDAU' + description: | + Nudm NIDD Authorization Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.8.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-niddau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-niddau + - {} + +paths: + /{ueIdentity}/authorize: + post: + summary: Authorize the NIDD configuration request. + operationId: AuthorizeNiddData + tags: + - Authorize the NIDD configuration request + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the NIDD configuration are authorized. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + niddAuthUpdateNotification: + '{request.body#/authUpdateCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthUpdateNotification' + responses: + '204': + description: Expected response to a valid request + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-niddau: Access to the nudm-niddau API + + schemas: + +# COMPLEX TYPES: +# + AuthorizationData: + description: Represents NIDD authorization data. + type: object + required: + - authorizationData + properties: + authorizationData: + type: array + items: + $ref: '#/components/schemas/UserIdentifier' + minItems: 1 + uniqueItems: true + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + UserIdentifier: + description: Represents the user identifier. + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + NiddAuthUpdateInfo: + description: Represents NIDD authorization update information. + type: object + required: + - authorizationData + properties: + authorizationData: + $ref: '#/components/schemas/AuthorizationData' + invalidityInd: + type: boolean + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + niddCause: + $ref: '#/components/schemas/NiddCause' + + NiddAuthUpdateNotification: + description: Represents a NIDD authorization update notification. + type: object + required: + - niddAuthUpdateInfoList + properties: + niddAuthUpdateInfoList: + type: array + items: + $ref: '#/components/schemas/NiddAuthUpdateInfo' + minItems: 1 + + AuthorizationInfo: + description: Represents NIDD authorization information. + type: object + required: + - snssai + - dnn + - mtcProviderInformation + - authUpdateCallbackUri + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + authUpdateCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + afId: + type: string + nefId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + + +# SIMPLE TYPES: + + + +# ENUMS: + + NiddCause: + anyOf: + - type: string + enum: + - SUBSCRIPTION_WITHDRAWAL + - DNN_REMOVED + - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_PP.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_PP.yaml new file mode 100644 index 000000000..b62dc8059 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_PP.yaml @@ -0,0 +1,770 @@ +openapi: 3.0.0 + +info: + version: '1.2.1' + title: 'Nudm_PP' + description: | + Nudm Parameter Provision Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.8.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-pp + - {} + +paths: + /{ueId}/pp-data: + patch: + summary: provision parameters + operationId: Update + tags: + - Subscription Data Update + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PpData' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /5g-vn-groups/{extGroupId}: + put: + summary: create a 5G VN Group + operationId: Create 5G VN Group + tags: + - 5G VN Group Creation + parameters: + - name: extGroupId + in: path + description: External Identifier of the Group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '201': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete a 5G VN Group + operationId: Delete 5G VN Group + tags: + - 5G VN Group Deletion + parameters: + - name: extGroupId + in: path + description: External Identifier of the Group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: mtc-provider-info + in: query + description: MTC Provider Information that originated the service operation + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: af-id + in: query + description: AF ID that originated the service operation + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify a 5G VN Group + operationId: Modify 5G VN Group + tags: + - 5G VN Group Modification + parameters: + - name: extGroupId + in: path + description: External Identifier of the group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: get 5G VN Group + operationId: Get 5G VN Group + tags: + - 5G VN Group Modification + parameters: + - name: extGroupId + in: path + description: External Identifier of the group + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/5GVnGroupConfiguration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/pp-data-store/{afInstanceId}: + put: + summary: Create a Provisioning Parameter Data Entry + operationId: Create PP Data Entry + tags: + - ParameterProvisioningDataEntry (Document) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PpDataEntry' + required: true + responses: + '201': + description: Indicating a successful creation of the resource + content: + application/json: + schema: + $ref: '#/components/schemas/PpDataEntry' + '204': + description: Indicating a successful update of the resource + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: Delete a Provisioning Parameter Data Entry + operationId: Delete PP Data Entry + tags: + - ParameterProvisioningDataEntry (Document) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: get Parameter Provisioning Data Entry + operationId: Get PP Data Entry + tags: + - ParameterProvisioningDataEntry (Document) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpDataEntry' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-pp: Access to the nudm-pp API + + + schemas: + +# COMPLEX TYPES: + + PpData: + type: object + properties: + communicationCharacteristics: + $ref: '#/components/schemas/CommunicationCharacteristics' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + expectedUeBehaviourParameters: + $ref: '#/components/schemas/ExpectedUeBehaviour' + ecRestriction: + $ref: '#/components/schemas/EcRestriction' + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfoRm' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSrRm' + lcsPrivacy: + $ref: '#/components/schemas/LcsPrivacy' + sorInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SorInfo' + 5mbsAuthorizationInfo: + $ref: '#/components/schemas/5MbsAuthorizationInfo' + nullable: true + + CommunicationCharacteristics: + type: object + properties: + ppSubsRegTimer: + $ref: '#/components/schemas/PpSubsRegTimer' + ppActiveTime: + $ref: '#/components/schemas/PpActiveTime' + ppDlPacketCount: + $ref: '#/components/schemas/PpDlPacketCount' + ppDlPacketCountExt: + $ref: '#/components/schemas/PpDlPacketCountExt' + ppMaximumResponseTime: + $ref: '#/components/schemas/PpMaximumResponseTime' + ppMaximumLatency: + $ref: '#/components/schemas/PpMaximumLatency' + nullable: true + + PpSubsRegTimer: + type: object + required: + - subsRegTimer + - afInstanceId + - referenceId + properties: + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PpActiveTime: + type: object + required: + - activeTime + - afInstanceId + - referenceId + properties: + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + 5GVnGroupConfiguration: + type: object + properties: + 5gVnGroupData: + $ref: '#/components/schemas/5GVnGroupData' + members: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + referenceId: + $ref: '#/components/schemas/ReferenceId' + afInstanceId: + type: string + internalGroupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + + 5GVnGroupData: + type: object + required: + - dnn + - sNssai + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pduSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + appDescriptors: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AppDescriptor' + minItems: 1 + secondaryAuth: + type: boolean + dnAaaIpAddressAllocation: + type: boolean + dnAaaAddress: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpAddress' + additionalDnAaaAddresses: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpAddress' + minItems: 1 + dnAaaFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + ExpectedUeBehaviour: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndicationRm' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTypeRm' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTimeRm' + expectedUmts: + type: array + items: + $ref: '#/components/schemas/LocationArea' + minItems: 1 + nullable: true + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfileRm' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndicationRm' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + LocationArea: + type: object + properties: + geographicAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 0 + description: Identifies a list of geographic area of the user where the UE is located. + civicAddresses: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 0 + description: Identifies a list of civic addresses of the user where the UE is located. + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + umtTime: + $ref: '#/components/schemas/UmtTime' + + UmtTime: + type: object + required: + - timeOfDay + - dayOfWeek + properties: + timeOfDay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeOfDay' + dayOfWeek: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DayOfWeek' + + NetworkAreaInfo: + description: Describes a network area information in which the NF service consumer requests the number of UEs. + type: object + properties: + ecgis: + description: Contains a list of E-UTRA cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + ncgis: + description: Contains a list of NR cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + gRanNodeIds: + description: Contains a list of NG RAN nodes. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + tais: + description: Contains a list of tracking area identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + EcRestriction: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + plmnEcInfos: + type: array + items: + $ref: '#/components/schemas/PlmnEcInfo' + minItems: 1 + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PlmnEcInfo: + type: object + required: + - plmnId + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + ecRestrictionDataWb: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/EcRestrictionDataWb' + ecRestrictionDataNb: + type: boolean + default: false + + + PpDlPacketCountExt: + type: object + required: + - afInstanceId + - referenceId + properties: + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PpMaximumResponseTime: + type: object + required: + - maximumResponseTime + - afInstanceId + - referenceId + properties: + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PpMaximumLatency: + type: object + required: + - maximumLatency + - afInstanceId + - referenceId + properties: + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + LcsPrivacy: + type: object + properties: + afInstanceId: + type: string + referenceId: + $ref: '#/components/schemas/ReferenceId' + lpi: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + nullable: true + + PpDataEntry: + type: object + properties: + communicationCharacteristics: + $ref: '#/components/schemas/CommunicationCharacteristicsAF' + referenceId: + $ref: '#/components/schemas/ReferenceId' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ecsAddrConfigInfo: + $ref: '#/components/schemas/EcsAddrConfigInfo' + additionalEcsAddrConfigInfos: + type: array + items: + $ref: '#/components/schemas/EcsAddrConfigInfo' + minItems: 1 + ecRestriction: + $ref: '#/components/schemas/EcRestriction' + nullable: true + + CommunicationCharacteristicsAF: + type: object + properties: + ppDlPacketCount: + $ref: '#/components/schemas/PpDlPacketCount' + maximumResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maximumLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + nullable: true + + EcsAddrConfigInfo: + type: object + properties: + ecsServerAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EcsServerAddr' + spatialValidityCond: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SpatialValidityCond' + nullable: true + + 5MbsAuthorizationInfo: + type: object + properties: + 5mbsSessionIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + minItems: 1 + nullable: true + +# SIMPLE TYPES: + + ReferenceId: + type: integer + + PpDlPacketCount: + type: integer + nullable: true + + + +# ENUMS: + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_RSDS.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_RSDS.yaml new file mode 100644 index 000000000..75d6f1a04 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_RSDS.yaml @@ -0,0 +1,94 @@ +openapi: 3.0.0 +info: + version: '1.1.0' + title: 'Nudm_ReportSMDeliveryStatus' + description: | + UDM Report SM Delivery Status Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.8.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-rsds/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-rsds + - {} + +paths: + /{ueIdentity}/sm-delivery-status: + post: + summary: Report the SM Delivery Status + operationId: ReportSMDeliveryStatus + tags: + - Report SM Delivery Status + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the Service Specific Parameters are authorized. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmDeliveryStatus' + required: true + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-rsds: Access to the nudm-rsds API + + + schemas: + +# COMPLEX TYPES: + + SmDeliveryStatus: + description: Represents SM Delivery Status. + type: object + required: + - gpsi + - smStatusReport + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + smStatusReport: + type: string + + +# SIMPLE TYPES: + + +# ENUMS: + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_SDM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_SDM.yaml new file mode 100644 index 000000000..ec4ad55ca --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_SDM.yaml @@ -0,0 +1,3693 @@ +openapi: 3.0.0 + +info: + version: '2.2.2' + title: 'Nudm_SDM' + description: | + Nudm Subscriber Data Management Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-sdm/v2' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-sdm + - {} + +paths: + /{supi}: + get: + summary: retrieve multiple data sets + operationId: GetDataSets + tags: + - Retrieval of multiple data sets + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: dataset-names + in: query + style: form + explode: false + description: List of dataset names + required: true + schema: + $ref: '#/components/schemas/DatasetNames' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: disaster-roaming-ind + in: query + description: Indication whether Disaster Roaming service is applied or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSets' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/nssai: + get: + summary: retrieve a UE's subscribed NSSAI + operationId: GetNSSAI + tags: + - Slice Selection Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: disaster-roaming-ind + in: query + description: Indication whether Disaster Roaming service is applied or not + required: false + schema: + type: boolean + default: false + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Nssai' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-amf-data: + get: + summary: retrieve a UE's UE Context In AMF Data + operationId: GetUeCtxInAmfData + tags: + - UE Context In AMF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInAmfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data: + get: + summary: retrieve a UE's Access and Mobility Subscription Data + operationId: GetAmData + tags: + - Access and Mobility Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: Serving PLMN ID or SNPN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: adjacent-plmns + in: query + description: List of PLMNs adjacent to the UE's serving PLMN + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + style: form + explode: false + - name: disaster-roaming-ind + in: query + description: Indication whether Disaster Roaming service is applied or not + required: false + schema: + type: boolean + default: false + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/ecr-data: + get: + summary: retrieve a UE's subscribed Enhanced Coverage Restriction Data + operationId: GetEcrData + tags: + - Enhanced Coverage Restriction Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EnhancedCoverageRestrictionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/smf-select-data: + get: + summary: retrieve a UE's SMF Selection Subscription Data + operationId: GetSmfSelData + tags: + - SMF Selection Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: disaster-roaming-ind + in: query + description: Indication whether Disaster Roaming service is applied or not + required: false + schema: + type: boolean + default: false + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-smf-data: + get: + summary: retrieve a UE's UE Context In SMF Data + operationId: GetUeCtxInSmfData + tags: + - UE Context In SMF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInSmfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/ue-context-in-smsf-data: + get: + summary: retrieve a UE's UE Context In SMSF Data + operationId: GetUeCtxInSmsfData + tags: + - UE Context In SMSF Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInSmsfData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/trace-data: + get: + summary: retrieve a UE's Trace Configuration Data + operationId: GetTraceConfigData + tags: + - Trace Configuration Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/TraceDataResponse' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sm-data: + get: + summary: retrieve a UE's Session Management Subscription Data + operationId: GetSmData + tags: + - Session Management Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmSubsData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sms-data: + get: + summary: retrieve a UE's SMS Subscription Data + operationId: GetSmsData + tags: + - SMS Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/sms-mng-data: + get: + summary: retrieve a UE's SMS Management Subscription Data + operationId: GetSmsMngtData + tags: + - SMS Management Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/lcs-privacy-data: + get: + summary: retrieve a UE's LCS Privacy Subscription Data + operationId: GetLcsPrivacyData + tags: + - LCS Privacy Data Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsPrivacyData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/lcs-mo-data: + get: + summary: retrieve a UE's LCS Mobile Originated Subscription Data + operationId: GetLcsMoData + tags: + - LCS Mobile Originated Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsMoData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/lcs-bca-data: + get: + summary: retrieve a UE's LCS Broadcast Assistance Data Types Subscription Data + operationId: GetLcsBcaData + tags: + - LCS Broadcast Assistance Data Types Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/v2x-data: + get: + summary: retrieve a UE's V2X Subscription Data + operationId: GetV2xData + tags: + - V2X Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/V2xSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/prose-data: + get: + summary: retrieve a UE's ProSe Subscription Data + operationId: GetProseData + tags: + - Prose Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProseSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/5mbs-data: + get: + summary: retrieve a UE's 5MBS Subscription Data + operationId: GetMbsData + tags: + - 5MBS Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/uc-data: + get: + summary: retrieve a UE's User Consent Subscription Data + operationId: GetUcData + tags: + - User Consent Subscription Data Retrieval + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: uc-purpose + in: query + description: User consent purpose + schema: + $ref: '#/components/schemas/UcPurpose' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UcSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/sdm-subscriptions: + post: + summary: subscribe to notifications + operationId: Subscribe + tags: + - Subscription Creation + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-sdm//{ueId}/sdm-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/sdm-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications + operationId: Unsubscribe + tags: + - Subscription Deletion + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: Modify + tags: + - Subscription Modification + parameters: + - name: ueId + in: path + description: Identity of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SdmSubsModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SdmSubscription' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{ueId}/id-translation-result: + get: + summary: retrieve a UE's SUPI or GPSI + operationId: GetSupiOrGpsi + tags: + - GPSI to SUPI Translation or SUPI to GPSI translation + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: af-id + in: query + description: AF identifier + schema: + type: string + - name: app-port-id + in: query + description: Application port identifier + content: + application/json: + schema: + $ref: '#/components/schemas/AppPortId' + - name: af-service-id + in: query + description: AF Service Identifier + schema: + type: string + - name: mtc-provider-info + in: query + description: MTC Provider Information + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: requested-gpsi-type + in: query + description: Requested GPSI Type + schema: + $ref: '#/components/schemas/GpsiType' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IdTranslationResult' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/sor-ack: + put: + summary: Nudm_Sdm Info service operation + operationId: SorAckInfo + tags: + - Providing acknowledgement of Steering of Roaming + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/upu-ack: + put: + summary: Nudm_Sdm Info for UPU service operation + operationId: UpuAck + tags: + - Providing acknowledgement of UE Parameters Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/subscribed-snssais-ack: + put: + summary: Nudm_Sdm Info operation for S-NSSAIs acknowledgement + operationId: S-NSSAIs Ack + tags: + - Providing acknowledgement of S-NSSAIs Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/cag-ack: + put: + summary: Nudm_Sdm Info operation for CAG acknowledgement + operationId: CAG Ack + tags: + - Providing acknowledgement of CAG Update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcknowledgeInfo' + responses: + '204': + description: Successful acknowledgement + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /{supi}/am-data/update-sor: + post: + summary: Nudm_Sdm custom operation to trigger SOR info update + operationId: Update SOR Info + tags: + - Trigger SOR info update + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorUpdateInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SorInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + $ref: '#/components/schemas/SharedDataIds' + - name: supportedFeatures + in: query + deprecated: true + description: Supported Features; this query parameter should not be used + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SharedData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data-subscriptions: + post: + summary: subscribe to notifications for shared data + operationId: SubscribeToSharedData + tags: + - Subscription Creation for shared data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-sdm//shared-data-subscriptions/{subscriptionId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /shared-data-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications for shared data + operationId: UnsubscribeForSharedData + tags: + - Subscription Deletion for shared data + parameters: + - name: subscriptionId + in: path + description: Id of the Shared data Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: ModifySharedDataSubs + tags: + - Subscription Modification + parameters: + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SdmSubsModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SdmSubscription' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /group-data/group-identifiers: + get: + summary: Mapping of Group Identifiers + operationId: GetGroupIdentifiers + tags: + - Group Identifiers + parameters: + - name: ext-group-id + in: query + description: External Group Identifier + required: false + schema: + $ref: '#/components/schemas/ExtGroupId' + - name: int-group-id + in: query + description: Internal Group Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: ue-id-ind + in: query + description: Indication whether UE identifiers are required or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: af-id + in: query + description: AF identifier + schema: + type: string + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GroupIdentifiers' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /shared-data/{sharedDataId}: + get: + summary: retrieve the individual shared data + operationId: GetIndividualSharedData + tags: + - Retrieval of the individual shared data + parameters: + - name: sharedDataId + in: path + description: Id of the Shared data + required: true + schema: + $ref: '#/components/schemas/SharedDataIds' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SharedData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /multiple-identifiers: + get: + summary: Mapping of UE Identifiers + operationId: GetMultipleIdentifiers + tags: + - Multiple Identifiers + parameters: + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: gpsi-list + in: query + description: list of the GPSIs + required: true + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeIdentifiers' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-sdm: Access to the nudm-sdm API + + schemas: + +# COMPLEX TYPES: + + DatasetNames: + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 2 + uniqueItems: true + + SubscriptionDataSets: + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + uecAmfData: + $ref: '#/components/schemas/UeContextInAmfData' + uecSmfData: + $ref: '#/components/schemas/UeContextInSmfData' + uecSmsfData: + $ref: '#/components/schemas/UeContextInSmsfData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + $ref: '#/components/schemas/SmSubsData' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + v2xData: + $ref: '#/components/schemas/V2xSubscriptionData' + lcsBroadcastAssistanceTypesData: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + proseData: + $ref: '#/components/schemas/ProseSubscriptionData' + mbsData: + $ref: '#/components/schemas/MbsSubscriptionData' + ucData: + $ref: '#/components/schemas/UcSubscriptionData' + + UeContextInSmsfData: + type: object + properties: + smsfInfo3GppAccess: + $ref: '#/components/schemas/SmsfInfo' + smsfInfoNon3GppAccess: + $ref: '#/components/schemas/SmsfInfo' + + SmsfInfo: + type: object + required: + - smsfInstanceId + - plmnId + properties: + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + smsfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + + + AccessAndMobilitySubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + sharedVnGroupDataIds: + description: A map(list of key-value pairs) where GroupId serves as key of SharedDataId + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataId' + minProperties: 1 + subscribedUeAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmbrRm' + nssai: + $ref: '#/components/schemas/Nssai' + ratRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + forbiddenAreas: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + coreNetworkTypeRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + rfspIndex: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndexRm' + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + ueUsageType: + $ref: '#/components/schemas/UeUsageType' + mpsPriority: + $ref: '#/components/schemas/MpsPriorityIndicator' + mcsPriority: + $ref: '#/components/schemas/McsPriorityIndicator' + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + sorInfo: + $ref: '#/components/schemas/SorInfo' + sorInfoExpectInd: + type: boolean + sorafRetrieval: + type: boolean + default: false + sorUpdateIndicatorList: + type: array + items: + $ref: '#/components/schemas/SorUpdateIndicator' + minItems: 1 + upuInfo: + $ref: '#/components/schemas/UpuInfo' + routingIndicator: + type: string + pattern: '^[0-9]{1,4}$' + micoAllowed: + $ref: '#/components/schemas/MicoAllowed' + sharedAmDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + odbPacketServices: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbPacketServices' + subscribedDnnList: + type: array + items: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + serviceGapTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + mdtUserConsent: + $ref: '#/components/schemas/MdtUserConsent' + mdtConfiguration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MdtConfiguration' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + cagData: + $ref: '#/components/schemas/CagData' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + nbIoTUePriority: + $ref: '#/components/schemas/NbIoTUePriority' + nssaiInclusionAllowed: + type: boolean + default: false + rgWirelineCharacteristics: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RgWirelineCharacteristics' + ecRestrictionDataWb: + $ref: '#/components/schemas/EcRestrictionDataWb' + ecRestrictionDataNb: + type: boolean + default: false + expectedUeBehaviourList: + $ref: '#/components/schemas/ExpectedUeBehaviourData' + primaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + secondaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + edrxParametersList: + type: array + items: + $ref: '#/components/schemas/EdrxParameters' + minItems: 1 + ptwParametersList: + type: array + items: + $ref: '#/components/schemas/PtwParameters' + minItems: 1 + iabOperationAllowed: + type: boolean + default: false + adjacentPlmnRestrictions: + description: A map (list of key-value pairs where PlmnId serves as key) of PlmnRestriction + type: object + additionalProperties: + $ref: '#/components/schemas/PlmnRestriction' + minProperties: 1 + wirelineForbiddenAreas: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineArea' + wirelineServiceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + pcfSelectionAssistanceInfos: + type: array + items: + $ref: '#/components/schemas/PcfSelectionAssistanceInfo' + minItems: 1 + aerialUeSubInfo: + $ref: '#/components/schemas/AerialUeSubscriptionInfo' + roamingRestrictions: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RoamingRestrictions' + remoteProvInd: + type: boolean + default: false + + PcfSelectionAssistanceInfo: + type: object + required: + - dnn + - singleNssai + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + PlmnRestriction: + type: object + properties: + ratRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + forbiddenAreas: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + coreNetworkTypeRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + primaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + secondaryRatRestrictions: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + uniqueItems: true + + ProseSubscriptionData: + description: Contains the ProSe Subscription Data. + type: object + properties: + proseServiceAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProseServiceAuth' + nrUePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + proseAllowedPlmn: + type: array + items: + $ref: '#/components/schemas/ProSeAllowedPlmn' + minItems: 1 + + ProSeAllowedPlmn: + description: Contains the PLMN identities where the Prose services are authorised to use and the authorised Prose services on this given PLMNs. + type: object + required: + - visitedPlmn + properties: + visitedPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + proseDirectAllowed: + type: array + items: + $ref: '#/components/schemas/ProseDirectAllowed' + minItems: 1 + + CagData: + type: object + required: + - cagInfos + properties: + cagInfos: + description: A map (list of key-value pairs where PlmnId serves as key) of CagInfo + type: object + additionalProperties: + $ref: '#/components/schemas/CagInfo' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + CagInfo: + type: object + required: + - allowedCagList + properties: + allowedCagList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + cagOnlyIndicator: + type: boolean + + SmfSelectionSubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + subscribedSnssaiInfos: + description: A map(list of key-value pairs) where singleNssai serves as key of SnssaiInfo + type: object + additionalProperties: + $ref: '#/components/schemas/SnssaiInfo' + sharedSnssaiInfosId: + $ref: '#/components/schemas/SharedDataId' + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + SnssaiInfo: + type: object + required: + - dnnInfos + properties: + dnnInfos: + type: array + items: + $ref: '#/components/schemas/DnnInfo' + minItems: 1 + + DnnInfo: + type: object + required: + - dnn + properties: + dnn: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + defaultDnnIndicator: + $ref: '#/components/schemas/DnnIndicator' + lboRoamingAllowed: + $ref: '#/components/schemas/LboRoamingAllowed' + iwkEpsInd: + $ref: '#/components/schemas/IwkEpsInd' + dnnBarred: + type: boolean + invokeNefInd: + type: boolean + smfList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + sameSmfInd: + type: boolean + + Nssai: + type: object + required: + - defaultSingleNssais + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + defaultSingleNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + singleNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + additionalSnssaiData: + description: A map(list of key-value pairs) where singleNssai serves as key of AdditionalSnssaiData + type: object + additionalProperties: + $ref: '#/components/schemas/AdditionalSnssaiData' + minProperties: 1 + suppressNssrgInd: + type: boolean + nullable: true + + UeContextInAmfData: + type: object + properties: + epsInterworkingInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/EpsInterworkingInfo' + amfInfo: + description: AMF information + type: array + items: + $ref: '#/components/schemas/AmfInfo' + minItems: 1 + maxItems: 2 + + UeContextInSmfData: + type: object + properties: + pduSessions: + description: A map (list of key-value pairs where PduSessionId serves as key) of PduSessions + type: object + additionalProperties: + $ref: '#/components/schemas/PduSession' + pgwInfo: + type: array + items: + $ref: '#/components/schemas/PgwInfo' + minItems: 1 + emergencyInfo: + $ref: '#/components/schemas/EmergencyInfo' + + EmergencyInfo: + type: object + oneOf: + - required: + - pgwFqdn + - required: + - pgwIpAddress + properties: + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddress: + $ref: '#/components/schemas/IpAddress' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + epdgInd: + type: boolean + default: false + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + + PduSession: + type: object + required: + - dnn + - smfInstanceId + - plmnId + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + AmfInfo: + type: object + required: + - amfInstanceId + - guami + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + PgwInfo: + type: object + required: + - dnn + - pgwFqdn + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddr: + $ref: '#/components/schemas/IpAddress' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + epdgInd: + type: boolean + default: false + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SessionManagementSubscriptionData: + type: object + required: + - singleNssai + properties: + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnnConfigurations: + description: A map (list of key-value pairs where Dnn, or optionally the Wildcard DNN, serves as key) of DnnConfigurations + type: object + additionalProperties: + $ref: '#/components/schemas/DnnConfiguration' + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + sharedVnGroupDataIds: + description: A map(list of key-value pairs) where GroupId serves as key of SharedDataId + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataId' + minProperties: 1 + sharedDnnConfigurationsId: + $ref: '#/components/schemas/SharedDataId' + odbPacketServices: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbPacketServices' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedTraceDataId: + $ref: '#/components/schemas/SharedDataId' + expectedUeBehavioursList: + description: A map(list of key-value pairs) where Dnn serves as key of ExpectedUeBehaviourData + type: object + additionalProperties: + $ref: '#/components/schemas/ExpectedUeBehaviourData' + minProperties: 1 + suggestedPacketNumDlList: + description: A map(list of key-value pairs) where Dnn serves as key of SuggestedPacketNumDl + type: object + additionalProperties: + $ref: '#/components/schemas/SuggestedPacketNumDl' + minProperties: 1 + 3gppChargingCharacteristics: + $ref: '#/components/schemas/3GppChargingCharacteristics' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + DnnConfiguration: + type: object + required: + - pduSessionTypes + - sscModes + properties: + pduSessionTypes: + $ref: '#/components/schemas/PduSessionTypes' + sscModes: + $ref: '#/components/schemas/SscModes' + iwkEpsInd: + $ref: '#/components/schemas/IwkEpsInd' + 5gQosProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + sessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + 3gppChargingCharacteristics: + $ref: '#/components/schemas/3GppChargingCharacteristics' + staticIpAddress: + type: array + items: + $ref: '#/components/schemas/IpAddress' + minItems: 1 + maxItems: 2 + upSecurity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UpSecurity' + pduSessionContinuityInd: + $ref: '#/components/schemas/PduSessionContinuityInd' + niddNefId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + niddInfo: + $ref: '#/components/schemas/NiddInformation' + redundantSessionAllowed: + type: boolean + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfo' + ipv4FrameRouteList: + type: array + items: + $ref: '#/components/schemas/FrameRouteInfo' + minItems: 1 + ipv6FrameRouteList: + type: array + items: + $ref: '#/components/schemas/FrameRouteInfo' + minItems: 1 + atsssAllowed: + type: boolean + default: false + secondaryAuth: + type: boolean + uavSecondaryAuth: + type: boolean + default: false + dnAaaIpAddressAllocation: + type: boolean + dnAaaAddress: + $ref: '#/components/schemas/IpAddress' + additionalDnAaaAddresses: + type: array + items: + $ref: '#/components/schemas/IpAddress' + minItems: 1 + dnAaaFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + iptvAccCtrlInfo: + type: string + ipv4Index: + $ref: '#/components/schemas/IpIndex' + ipv6Index: + $ref: '#/components/schemas/IpIndex' + ecsAddrConfigInfo: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/EcsAddrConfigInfo' + additionalEcsAddrConfigInfos: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/EcsAddrConfigInfo' + minItems: 1 + sharedEcsAddrConfigInfo: + $ref: '#/components/schemas/SharedDataId' + additionalSharedEcsAddrConfigInfoIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + easDiscoveryAuthorized: + type: boolean + default: false + onboardingInd: + type: boolean + default: false + aerialUeInd: + $ref: '#/components/schemas/AerialUeIndication' + subscribedMaxIpv6PrefixSize: + type: integer + + NiddInformation: + type: object + required: + - afId + properties: + afId: + type: string + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + extGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExternalGroupId' + + IpAddress: + type: object + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + - required: + - ipv6Prefix + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + PduSessionTypes: + type: object + properties: + defaultSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + allowedSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + + SscModes: + type: object + required: + - defaultSscMode + properties: + defaultSscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + allowedSscModes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + minItems: 1 + maxItems: 2 + + SmsSubscriptionData: + type: object + properties: + smsSubscribed: + $ref: '#/components/schemas/SmsSubscribed' + sharedSmsSubsDataId: + $ref: '#/components/schemas/SharedDataId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + SmsManagementSubscriptionData: + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + mtSmsSubscribed: + type: boolean + mtSmsBarringAll: + type: boolean + mtSmsBarringRoaming: + type: boolean + moSmsSubscribed: + type: boolean + moSmsBarringAll: + type: boolean + moSmsBarringRoaming: + type: boolean + sharedSmsMngDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + + SdmSubscription: + type: object + required: + - nfInstanceId + - callbackReference + - monitoredResourceUris + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + implicitUnsubscribe: + type: boolean + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + subscriptionId: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + immediateReport: + type: boolean + default: false + report: + $ref: '#/components/schemas/ImmediateReport' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + contextInfo: + $ref: '#/components/schemas/ContextInfo' + nfChangeFilter: + type: boolean + default: false + uniqueSubscription: + type: boolean + resetIds: + type: array + items: + type: string + minItems: 1 + ueConSmfDataSubFilter: + $ref: '#/components/schemas/UeContextInSmfDataSubFilter' + + SdmSubsModification: + type: object + properties: + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + + ModificationNotification: + type: object + required: + - notifyItems + properties: + notifyItems: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotifyItem' + minItems: 1 + + IdTranslationResult: + type: object + required: + - supi + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + additionalSupis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + additionalGpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + + AcknowledgeInfo: + type: object + required: + - provisioningTime + properties: + sorMacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + upuMacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sorTransparentContainer: + $ref: '#/components/schemas/SorTransparentContainer' + ueNotReachable: + type: boolean + default: false + upuTransparentContainer: + $ref: '#/components/schemas/UpuTransparentContainer' + + SorInfo: + type: object + properties: + steeringContainer: + $ref: '#/components/schemas/SteeringContainer' + ackInd: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/AckInd' + sorMacIausf: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + countersor: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/CounterSor' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sorTransparentContainer: + $ref: '#/components/schemas/SorTransparentContainer' + sorCmci: + $ref: '#/components/schemas/SorCmci' + storeSorCmciInMe: + type: boolean + usimSupportOfSorCmci: + type: boolean + required: + - ackInd + - provisioningTime + + SharedDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + uniqueItems: true + + UpuInfo: + type: object + properties: + upuDataList: + type: array + items: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuData' + minItems: 1 + upuRegInd: + $ref: '#/components/schemas/UpuRegInd' + upuAckInd: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuAckInd' + upuMacIausf: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + counterUpu: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/CounterUpu' + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + upuTransparentContainer: + $ref: '#/components/schemas/UpuTransparentContainer' + required: + - provisioningTime + + + SharedData: + type: object + required: + - sharedDataId + properties: + sharedDataId: + $ref: '#/components/schemas/SharedDataId' + sharedAmData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + sharedSmsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + sharedSmsMngSubsData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + sharedDnnConfigurations: + description: A map(list of key-value pairs) where Dnn, or optionally the Wildcard DNN, serves as key of DnnConfiguration + type: object + additionalProperties: + $ref: '#/components/schemas/DnnConfiguration' + minProperties: 1 + sharedTraceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedSnssaiInfos: + description: A map(list of key-value pairs) where singleNssai serves as key of SnssaiInfo + type: object + additionalProperties: + $ref: '#/components/schemas/SnssaiInfo' + minProperties: 1 + sharedVnGroupDatas: + description: A map(list of key-value pairs) where GroupId serves as key of VnGroupData + type: object + additionalProperties: + $ref: '#/components/schemas/VnGroupData' + minProperties: 1 + treatmentInstructions: + description: A map(list of key-value pairs) where JSON pointer pointing to an attribute within the SharedData serves as key of SharedDataTreatmentInstruction + type: object + additionalProperties: + $ref: '#/components/schemas/SharedDataTreatmentInstruction' + minProperties: 1 + sharedSmSubsData: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + sharedEcsAddrConfigInfo: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/EcsAddrConfigInfo' + + TraceDataResponse: + type: object + properties: + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sharedTraceDataId: + $ref: '#/components/schemas/SharedDataId' + + SteeringContainer: + oneOf: + - type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + - $ref: '#/components/schemas/SecuredPacket' + + GroupIdentifiers: + type: object + properties: + extGroupId: + $ref: '#/components/schemas/ExtGroupId' + intGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + ueIdList: + type: array + items: + $ref: '#/components/schemas/UeId' + minItems: 1 + + VnGroupData: + type: object + properties: + pduSessionTypes: + $ref: '#/components/schemas/PduSessionTypes' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + appDescriptors: + type: array + items: + $ref: '#/components/schemas/AppDescriptor' + minItems: 1 + + AppDescriptor: + type: object + properties: + osId: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/OsId' + appId: + type: string + + AdditionalSnssaiData: + type: object + properties: + requiredAuthnAuthz: + type: boolean + subscribedUeSliceMbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbrRm' + subscribedNsSrgList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NsSrg' + minItems: 1 + + AppPortId: + type: object + properties: + destinationPort: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + originatorPort: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + + LcsPrivacyData: + type: object + properties: + lpi: + $ref: '#/components/schemas/Lpi' + unrelatedClass: + $ref: '#/components/schemas/UnrelatedClass' + plmnOperatorClasses: + type: array + items: + $ref: '#/components/schemas/PlmnOperatorClass' + minItems: 1 + + Lpi: + type: object + required: + - locationPrivacyInd + properties: + locationPrivacyInd: + $ref: '#/components/schemas/LocationPrivacyInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + UnrelatedClass: + type: object + required: + - defaultUnrelatedClass + properties: + defaultUnrelatedClass: + $ref: '#/components/schemas/DefaultUnrelatedClass' + externalUnrelatedClass: + $ref: '#/components/schemas/ExternalUnrelatedClass' + serviceTypeUnrelatedClasses: + type: array + items: + $ref: '#/components/schemas/ServiceTypeUnrelatedClass' + minItems: 1 + + PlmnOperatorClass: + type: object + required: + - lcsClientClass + - lcsClientIds + properties: + lcsClientClass: + $ref: '#/components/schemas/LcsClientClass' + lcsClientIds: + type: array + items: + $ref: '#/components/schemas/LcsClientId' + minItems: 1 + + ValidTimePeriod: + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + ExternalUnrelatedClass: + properties: + lcsClientExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientExternal' + minItems: 1 + afExternals: + type: array + items: + $ref: '#/components/schemas/AfExternal' + minItems: 1 + lcsClientGroupExternals: + type: array + items: + $ref: '#/components/schemas/LcsClientGroupExternal' + minItems: 1 + + AfExternal: + type: object + properties: + afId: + $ref: '#/components/schemas/AfId' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsClientExternal: + type: object + properties: + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + LcsClientGroupExternal: + type: object + properties: + lcsClientGroupId: + $ref: '#/components/schemas/ExtGroupId' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + + ServiceTypeUnrelatedClass: + type: object + required: + - serviceType + properties: + serviceType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsServiceType' + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + codeWordList: + type: array + items: + $ref: '#/components/schemas/CodeWord' + minItems: 1 + + LcsMoData: + type: object + required: + - allowedServiceClasses + properties: + allowedServiceClasses: + type: array + items: + $ref: '#/components/schemas/LcsMoServiceClass' + minItems: 1 + moAssistanceDataTypes: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + + + LcsBroadcastAssistanceTypesData: + type: object + required: + - locationAssistanceType + properties: + locationAssistanceType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Binary' + + EcRestrictionDataWb: + type: object + anyOf: + - required: [ ecModeARestricted ] + - required: [ ecModeBRestricted ] + properties: + ecModeARestricted: + type: boolean + ecModeBRestricted: + type: boolean + + ExpectedUeBehaviourData: + type: object + properties: + stationaryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndication' + communicationDurationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + scheduledCommunicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTime' + scheduledCommunicationType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationType' + expectedUmts: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/LocationArea' + minItems: 1 + description: Identifies the UE's expected geographical movement. The attribute is only applicable in 5G. + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfile' + batteryIndication: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndication' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + + SuggestedPacketNumDl: + type: object + required: + - suggestedPacketNumDl + properties: + suggestedPacketNumDl: + type: integer + minimum: 1 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + FrameRouteInfo: + type: object + properties: + ipv4Mask: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrMask' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + SorUpdateInfo: + type: object + required: + - vplmnId + properties: + vplmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + EnhancedCoverageRestrictionData: + type: object + properties: + plmnEcInfoList: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PlmnEcInfo' + minItems: 1 + + EdrxParameters: + type: object + required: + - ratType + - edrxValue + properties: + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + edrxValue: + type: string + pattern: '^([0-1]{4})$' + + PtwParameters: + type: object + required: + - operationMode + - ptwValue + properties: + operationMode: + $ref: '#/components/schemas/OperationMode' + ptwValue: + type: string + pattern: '^([0-1]{4})$' + + UeId: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + + V2xSubscriptionData: + type: object + properties: + nrV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrV2xAuth' + lteV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LteV2xAuth' + nrUePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + ltePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + DefaultUnrelatedClass: + type: object + properties: + allowedGeographicArea: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + privacyCheckRelatedAction: + $ref: '#/components/schemas/PrivacyCheckRelatedAction' + codeWordInd: + $ref: '#/components/schemas/CodeWordInd' + validTimePeriod: + $ref: '#/components/schemas/ValidTimePeriod' + codeWordList: + type: array + items: + $ref: '#/components/schemas/CodeWord' + minItems: 1 + + ContextInfo: + type: object + properties: + origHeaders: + type: array + items: + type: string + minItems: 1 + requestHeaders: + type: array + items: + type: string + minItems: 1 + + AerialUeSubscriptionInfo: + description: Contains the Aerial UE Subscription Information, it at least contains the Aerial UE Indication. + type: object + required: + - aerialUeInd + properties: + aerialUeInd: + $ref: '#/components/schemas/AerialUeIndication' + 3gppUavId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + + SmSubsData: + oneOf: + - type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + minItems: 1 + - $ref: '#/components/schemas/ExtendedSmSubsData' + + ExtendedSmSubsData: + description: Contains identifiers of shared Session Management Subscription Data and optionally individual Session Management Subscription Data. + type: object + required: + - sharedSmSubsDataIds + properties: + sharedSmSubsDataIds: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + minItems: 1 + individualSmSubsData: + type: array + items: + $ref: '#/components/schemas/SessionManagementSubscriptionData' + + ImmediateReport: + oneOf: + - $ref: '#/components/schemas/SubscriptionDataSets' + - type: array + items: + $ref: '#/components/schemas/SharedData' + minItems: 0 + + MbsSubscriptionData: + description: Contains the 5MBS Subscription Data. + type: object + properties: + mbsAllowed: + type: boolean + default: false + mbsSessionIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + minItems: 1 + + UcSubscriptionData: + description: Contains the User Consent Subscription Data. + type: object + properties: + userConsentPerPurposeList: + description: A map(list of key-value pairs) where user consent purpose serves as key of user consent + type: object + additionalProperties: + $ref: '#/components/schemas/UserConsent' + minProperties: 1 + + UeContextInSmfDataSubFilter: + description: UE Context In Smf Data Subscription Filter. + type: object + properties: + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + emergencyInd: + type: boolean + default: false + + UeIdentifiers: + description: A map(list of key-value pairs) where Gpsi serves as key of arrays of Supi + type: object + additionalProperties: + $ref: '#/components/schemas/SupiInfo' + minProperties: 1 + + SupiInfo: + description: List of Supis. + type: object + required: + - supiList + properties: + supiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + + + +# SIMPLE TYPES: + + UeUsageType: + type: integer + + MpsPriorityIndicator: + type: boolean + + McsPriorityIndicator: + type: boolean + + DnnIndicator: + type: boolean + + LboRoamingAllowed: + type: boolean + + SmsSubscribed: + type: boolean + + 3GppChargingCharacteristics: + type: string + + MicoAllowed: + type: boolean + + SharedDataId: + type: string + pattern: '^[0-9]{5,6}-.+$' + + IwkEpsInd: + type: boolean + + SecuredPacket: + type: string + format: byte + + UpuRegInd: + type: boolean + + ExtGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + + NbIoTUePriority: + type: integer + minimum: 0 + maximum: 255 + + CodeWord: + type: string + + AfId: + type: string + + LcsClientId: + type: string + + SorTransparentContainer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + UpuTransparentContainer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + IpIndex: + description: Represents the IP Index to be sent from UDM to the SMF (its value can be either an integer or a string) + anyOf: + - type: integer + - type: string + + SorCmci: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + +# ENUMS: + + DataSetName: + anyOf: + - type: string + enum: + - AM + - SMF_SEL + - UEC_SMF + - UEC_SMSF + - SMS_SUB + - SM + - TRACE + - SMS_MNG + - LCS_PRIVACY + - LCS_MO + - UEC_AMF + - V2X + - LCS_BCA + - PROSE + - UC + - MBS + - type: string + + UcPurpose: + anyOf: + - type: string + enum: + - ANALYTICS + - MODEL_TRAINING + - NW_CAP_EXPOSURE + - EDGEAPP_UE_LOCATION + - type: string + description: Indicates the purpose of the user consent. + + UserConsent: + anyOf: + - type: string + enum: + - CONSENT_NOT_GIVEN + - CONSENT_GIVEN + - type: string + + PduSessionContinuityInd: + anyOf: + - type: string + enum: + - MAINTAIN_PDUSESSION + - RECONNECT_PDUSESSION + - RELEASE_PDUSESSION + - type: string + + LocationPrivacyInd: + anyOf: + - type: string + enum: + - LOCATION_DISALLOWED + - LOCATION_ALLOWED + - type: string + + PrivacyCheckRelatedAction: + anyOf: + - type: string + enum: + - LOCATION_NOT_ALLOWED + - LOCATION_ALLOWED_WITH_NOTIFICATION + - LOCATION_ALLOWED_WITHOUT_NOTIFICATION + - LOCATION_ALLOWED_WITHOUT_RESPONSE + - LOCATION_RESTRICTED_WITHOUT_RESPONSE + - type: string + + LcsClientClass: + anyOf: + - type: string + enum: + - BROADCAST_SERVICE + - OM_IN_HPLMN + - OM_IN_VPLMN + - ANONYMOUS_LOCATION_SERVICE + - SPECIFIC_SERVICE + - type: string + + LcsMoServiceClass: + anyOf: + - type: string + enum: + - BASIC_SELF_LOCATION + - AUTONOMOUS_SELF_LOCATION + - TRANSFER_TO_THIRD_PARTY + - type: string + + OperationMode: + anyOf: + - type: string + enum: + - WB_S1 + - NB_S1 + - WB_N1 + - NB_N1 + - type: string + + SorUpdateIndicator: + anyOf: + - type: string + enum: + - INITIAL_REGISTRATION + - EMERGENCY_REGISTRATION + - type: string + + CodeWordInd: + anyOf: + - type: string + enum: + - CODEWORD_CHECK_IN_UE + - CODEWORD_CHECK_IN_GMLC + - type: string + + MdtUserConsent: + anyOf: + - type: string + enum: + - CONSENT_NOT_GIVEN + - CONSENT_GIVEN + - type: string + + SharedDataTreatmentInstruction: + anyOf: + - type: string + enum: + - USE_IF_NO_CLASH + - OVERWRITE + - MAX + - MIN + - type: string + + GpsiType: + description: Type of GPSI (MSISDN or External-ID) + anyOf: + - type: string + enum: + - MSISDN + - EXT_ID + - EXT_GROUP_ID + - type: string + + AerialUeIndication: + anyOf: + - type: string + enum: + - AERIAL_UE_ALLOWED + - AERIAL_UE_NOT_ALLOWED + - type: string + description: > + Indicates the Aerial service for the UE is allowed or not allowed, possible values are + - AERIAL_UE_ALLOWED: Aerial service for the UE is allowed. + - AERIAL_UE_NOT_ALLOWED: Aerial service for the UE is not allowed. + + ProseDirectAllowed: + anyOf: + - type: string + enum: + - ANNOUNCE + - MONITOR + - RESTRICTD_ANNOUNCE + - RESTRICTD_MONITOR + - DISCOVERER + - DISCOVEREE + - BROADCAST + - GROUPCAST + - UNICAST + - LAYER2_RELAY + - LAYER3_RELAY + - type: string + description: Indicates the 5G ProSe Direct services that can be authorised to use in the given PLMN for the UE. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_SSAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_SSAU.yaml new file mode 100644 index 000000000..9b7db0a38 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_SSAU.yaml @@ -0,0 +1,288 @@ +openapi: 3.0.0 + +info: + version: '1.0.2' + title: 'Nudm_SSAU' + description: | + Nudm Service Specific Authorization Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ssau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ssau + - {} + +paths: + /{ueIdentity}/{serviceType}/authorize: + post: + summary: Authorization for the Service specific parameters in the request. + operationId: ServiceSpecificAuthorization + tags: + - Service specific authorization request + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the Service Specific Parameters are authorized. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: serviceType + in: path + description: Represents the specific service for which the Service Specific Parameters are authorized. + required: true + schema: + $ref: '#/components/schemas/ServiceType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + authUpdateNotification: + '{request.body#/authUpdateCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AuthUpdateNotification' + responses: + '204': + description: Expected response to a valid request + + /{ueIdentity}/{serviceType}/remove: + post: + summary: Remove the authorization of specific service's configuration. + operationId: ServiceSpecificAuthorizationRemoval + tags: + - Service specific authorization remove + parameters: + - name: ueIdentity + in: path + description: Represents the scope of the UE for which the Service Specific configuration authorization to be removed. Contains the GPSI of the user or the external group ID. + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: serviceType + in: path + description: Represents the specific service for which the Service Specific configuration authorization to be removed. + required: true + schema: + $ref: '#/components/schemas/ServiceType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationRemoveData' + required: true + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ssau: Access to the nudm-ssau API + + schemas: + +# COMPLEX TYPES: +# + AuthUpdateNotification: + description: Represents an authorization update notification. + type: object + required: + - serviceType + - authUpdateInfoList + properties: + serviceType: + $ref: '#/components/schemas/ServiceType' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + authUpdateInfoList: + type: array + items: + $ref: '#/components/schemas/AuthUpdateInfo' + minItems: 1 + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + afId: + type: string + + AuthUpdateInfo: + description: Represents authorization update information. + type: object + required: + - authorizationData + properties: + authorizationData: + $ref: '#/components/schemas/ServiceSpecificAuthorizationData' + invalidityInd: + type: boolean + invalidCause: + $ref: '#/components/schemas/InvalidCause' + + + ServiceSpecificAuthorizationInfo: + description: Authorization information for a specific service + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + authUpdateCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + afId: + type: string + nefId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + + ServiceSpecificAuthorizationData: + description: Authorization Response for a specific service. + type: object + properties: + authorizationUeId: + $ref: '#/components/schemas/AuthorizationUeId' + extGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExternalGroupId' + intGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + authId: + type: string + + AuthorizationUeId: + description: UE Id of the Authorization Data. + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + + ServiceSpecificAuthorizationRemoveData: + description: Information for Authorization removal of a specific service. + type: object + required: + - authId + properties: + authId: + type: string + + + +# SIMPLE TYPES: + + + +# ENUMS: + + ServiceType: + anyOf: + - type: string + enum: + - AF_GUIDANCE_FOR_URSP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - AF_GUIDANCE_FOR_URSP + + InvalidCause: + anyOf: + - type: string + enum: + - SUBSRIPTION_WITHDRAWAL + - DNN_REMOVED + - SLICE_REMOVED + - AUTHORIZATION_REVOKED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - SUBSRIPTION_WITHDRAWAL + - DNN_REMOVED + - SLICE_REMOVED + - AUTHORIZATION_REVOKED + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_UEAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_UEAU.yaml new file mode 100644 index 000000000..d78b32c0e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_UEAU.yaml @@ -0,0 +1,866 @@ +openapi: 3.0.0 +info: + version: '1.2.1' + title: 'Nudm_UEAU' + description: | + UDM UE Authentication Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-ueau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-ueau + - {} + +paths: + /{supiOrSuci}/security-information/generate-auth-data: + post: + summary: Generate authentication data for the UE + operationId: GenerateAuthData + tags: + - Generate Auth Data + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:security-information:generate-auth-data:invoke + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supiOrSuci}/security-information-rg: + get: + summary: Get authentication data for the FN-RG + operationId: GetRgAuthData + tags: + - Get Auth Data for FN-RG + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:security-information-rg:read + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + - name: authenticated-ind + in: query + description: Authenticated indication + required: true + schema: + $ref: '#/components/schemas/AuthenticatedInd' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: plmn-id + in: query + description: serving PLMN ID + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthCtx' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/auth-events: + post: + summary: Create a new confirmation event + operationId: ConfirmAuth + tags: + - Confirm Auth + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:auth-events:create + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-ueau/v1/{supi}/auth-events/{authEventId}' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/hss-security-information/{hssAuthType}/generate-av: + post: + summary: Generate authentication data for the UE in EPS or IMS domain + operationId: GenerateAv + tags: + - Generate HSS Authentication Vectors + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:hss-security-information:generate-av:invoke + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: hssAuthType + in: path + description: Type of AV requested by HSS + required: true + schema: + $ref: '#/components/schemas/HssAuthTypeInUri' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/HssAuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supi}/auth-events/{authEventId}: + put: + summary: Deletes the authentication result in the UDM + operationId: DeleteAuth + tags: + - Delete Auth + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:auth-event-id:modify + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: authEventId + in: path + description: authEvent Id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthEvent' + required: true + responses: + '204': + description: Expected response to a successful authentication result removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{supi}/gba-security-information/generate-av: + post: + summary: Generate authentication data for the UE in GBA domain + operationId: GenerateGbaAv + tags: + - Generate GBA Authentication Vectors + security: + - {} + - oAuth2ClientCredentials: + - nudm-ueau + - oAuth2ClientCredentials: + - nudm-ueau + - nudm-ueau:gba-security-information:generate-av:invoke + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GbaAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GbaAuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{supiOrSuci}/prose-security-information/generate-av: + post: + summary: Generate authentication data for ProSe + operationId: GenerateProseAV + tags: + - Generate ProSe Authentication Vectors + parameters: + - name: supiOrSuci + in: path + description: SUPI or SUCI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationInfoResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-ueau: Access to the nudm-ueau API + nudm-ueau:security-information:generate-auth-data:invoke: Acess to invoke the "generate-auth-data" custom operation on the "security-information" resource + nudm-ueau:security-information-rg:read: Access to read the "security-information-rg" resource + nudm-ueau:auth-events:create: Access to create a new child resource on the "auth-events" collection resource + nudm-ueau:auth-event-id:modify: Access to modify (delete) an "auth-event-id" individual resource + nudm-ueau:hss-security-information:generate-av:invoke: Acess to invoke the "generate-av" custom operation on the "hss-security-information" resource + nudm-ueau:gba-security-information:generate-av:invoke: Acess to invoke the "generate-av" custom operation on the "gba-security-information" resource + + + schemas: + +# COMPLEX TYPES: + + AuthenticationInfoRequest: + type: object + required: + - servingNetworkName + - ausfInstanceId + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + ausfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + cellCagInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + minItems: 1 + n5gcInd: + type: boolean + default: false + nswoInd: + type: boolean + default: false + disasterRoamingInd: + type: boolean + default: false + + AuthenticationInfoResult: + type: object + required: + - authType + properties: + authType: + $ref: '#/components/schemas/AuthType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + authenticationVector: + $ref: '#/components/schemas/AuthenticationVector' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + akmaInd: + type: boolean + default: false + authAaa: + type: boolean + default: false + routingId: + type: string + pattern: '^[0-9]{1,4}$' + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + + AuthenticationVector: + oneOf: + - $ref: '#/components/schemas/AvEapAkaPrime' + - $ref: '#/components/schemas/Av5GHeAka' + discriminator: + propertyName: avType + mapping: + 5G_HE_AKA: '#/components/schemas/Av5GHeAka' + EAP_AKA_PRIME: '#/components/schemas/AvEapAkaPrime' + + AvEapAkaPrime: + type: object + required: + - avType + - rand + - xres + - autn + - ckPrime + - ikPrime + properties: + avType: + $ref: '#/components/schemas/AvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + ckPrime: + $ref: '#/components/schemas/CkPrime' + ikPrime: + $ref: '#/components/schemas/IkPrime' + + Av5GHeAka: + type: object + required: + - avType + - rand + - xresStar + - autn + - kausf + properties: + avType: + $ref: '#/components/schemas/AvType' + rand: + $ref: '#/components/schemas/Rand' + xresStar: + $ref: '#/components/schemas/XresStar' + autn: + $ref: '#/components/schemas/Autn' + kausf: + $ref: '#/components/schemas/Kausf' + + ResynchronizationInfo: + type: object + required: + - rand + - auts + properties: + rand: + $ref: '#/components/schemas/Rand' + auts: + $ref: '#/components/schemas/Auts' + + AuthEvent: + type: object + required: + - nfInstanceId + - success + - timeStamp + - authType + - servingNetworkName + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + success: + $ref: '#/components/schemas/Success' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + authType: + $ref: '#/components/schemas/AuthType' + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + authRemovalInd: + type: boolean + default: false + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + resetIds: + type: array + items: + type: string + minItems: 1 + + + RgAuthCtx: + type: object + required: + - authInd + properties: + authInd: + type: boolean + default: false + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + HssAuthenticationInfoRequest: + type: object + required: + - hssAuthType + - numOfRequestedVectors + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hssAuthType: + $ref: '#/components/schemas/HssAuthType' + numOfRequestedVectors: + $ref: '#/components/schemas/NumOfRequestedVectors' + requestingNodeType: + $ref: '#/components/schemas/NodeType' + servingNetworkId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + anId: + $ref: '#/components/schemas/AccessNetworkId' + + HssAuthenticationInfoResult: + type: object + required: + - hssAuthenticationVectors + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hssAuthenticationVectors: + $ref: '#/components/schemas/HssAuthenticationVectors' + + HssAuthenticationVectors: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AvEpsAka' + minItems: 1 + maxItems: 5 + - type: array + items: + $ref: '#/components/schemas/AvImsGbaEapAka' + minItems: 1 + maxItems: 5 + - type: array + items: + $ref: '#/components/schemas/AvEapAkaPrime' + minItems: 1 + maxItems: 5 + + AvEpsAka: + type: object + required: + - avType + - rand + - xres + - autn + - kasme + properties: + avType: + $ref: '#/components/schemas/HssAvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + kasme: + $ref: '#/components/schemas/Kasme' + + AvImsGbaEapAka: + type: object + required: + - avType + - rand + - xres + - autn + - ck + - ik + properties: + avType: + $ref: '#/components/schemas/HssAvType' + rand: + $ref: '#/components/schemas/Rand' + xres: + $ref: '#/components/schemas/Xres' + autn: + $ref: '#/components/schemas/Autn' + ck: + $ref: '#/components/schemas/ConfidentialityKey' + ik: + $ref: '#/components/schemas/IntegrityKey' + + GbaAuthenticationInfoRequest: + type: object + required: + - authType + properties: + authType: + $ref: '#/components/schemas/GbaAuthType' + resynchronizationInfo: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/ResynchronizationInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + GbaAuthenticationInfoResult: + type: object + properties: + 3gAkaAv: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/3GAkaAv' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ProSeAuthenticationInfoRequest: + type: object + required: + - servingNetworkName + - relayServiceCode + properties: + servingNetworkName: + $ref: '#/components/schemas/ServingNetworkName' + relayServiceCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RelayServiceCode' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ProSeAuthenticationInfoResult: + type: object + required: + - authType + properties: + authType: + $ref: '#/components/schemas/AuthType' + proseAuthenticationVectors: + $ref: '#/components/schemas/ProSeAuthenticationVectors' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ProSeAuthenticationVectors: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AvEapAkaPrime' + minItems: 1 + maxItems: 5 + + + +# SIMPLE TYPES: + + Autn: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Auts: + type: string + pattern: '^[A-Fa-f0-9]{28}$' + + CkPrime: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + IkPrime: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Kausf: + type: string + pattern: '^[A-Fa-f0-9]{64}$' + + Rand: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Xres: + type: string + pattern: '^[A-Fa-f0-9]{8,32}$' + + XresStar: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + ServingNetworkName: + type: string + pattern: '^(5G:mnc[0-9]{3}[.]mcc[0-9]{3}[.]3gppnetwork[.]org(:[A-F0-9]{11})?)|5G:NSWO$' + + Success: + type: boolean + + AuthenticatedInd: + type: boolean + + ConfidentialityKey: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + IntegrityKey: + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + Kasme: + type: string + pattern: '^[A-Fa-f0-9]{64}$' + + NumOfRequestedVectors: + type: integer + minimum: 1 + maximum: 5 + + +# ENUMS: + + AuthType: + anyOf: + - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - NONE + - EAP_TTLS + - type: string + + AvType: + anyOf: + - type: string + enum: + - 5G_HE_AKA + - EAP_AKA_PRIME + - type: string + + HssAuthType: + anyOf: + - type: string + enum: + - EPS_AKA + - EAP_AKA + - EAP_AKA_PRIME + - IMS_AKA + - GBA_AKA + - UMTS_AKA + - type: string + + HssAvType: + anyOf: + - type: string + enum: + - EPS_AKA + - EAP_AKA + - IMS_AKA + - GBA_AKA + - UMTS_AKA + - type: string + + HssAuthTypeInUri: + anyOf: + - type: string + enum: + - eps-aka + - eap-aka + - eap-aka-prime + - ims-aka + - gba-aka + - type: string + + AccessNetworkId: + anyOf: + - type: string + enum: + - HRPD + - WIMAX + - WLAN + - ETHERNET + - type: string + + NodeType: + anyOf: + - type: string + enum: + - AUSF + - VLR + - SGSN + - S_CSCF + - BSF + - GAN_AAA_SERVER + - WLAN_AAA_SERVER + - MME + - type: string + + GbaAuthType: + anyOf: + - type: string + enum: + - DIGEST_AKAV1_MD5 + - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_UECM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_UECM.yaml new file mode 100644 index 000000000..49ff207c8 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29503_Nudm_UECM.yaml @@ -0,0 +1,2640 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'Nudm_UECM' + description: | + Nudm Context Management Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.503 Unified Data Management Services, version 17.9.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.503/' + +servers: + - url: '{apiRoot}/nudm-uecm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nudm-uecm + - {} + +paths: + /{ueId}/registrations: + get: + summary: retrieve UE registration data sets + operationId: GetRegistrations + tags: + - UECM Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: registration-dataset-names + in: query + style: form + explode: false + description: List of UECM registration dataset names + required: true + schema: + $ref: '#/components/schemas/RegistrationDatasetNames' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RegistrationDataSets' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/send-routing-info-sm: + post: + summary: Retreive addressing information for SMS delivery + operationId: SendRoutingInfoSm + tags: + - SendRoutingInfoSM (Custom Operation) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RoutingInfoSmRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RoutingInfoSmResponse' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access: + put: + summary: register as AMF for 3GPP access + operationId: 3GppRegistration + tags: + - AMF registration for 3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-3gpp-access' + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + patch: + summary: Update a parameter in the AMF registration for 3GPP access + operationId: Update3GppRegistration + tags: + - Parameter update in the AMF registration for 3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the AMF registration for 3GPP access information + operationId: Get3GppRegistration + tags: + - AMF 3Gpp-access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/dereg-amf: + post: + summary: trigger AMF for 3GPP access deregistration + operationId: deregAMF + tags: + - Trigger AMF for 3GPP access deregistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfDeregInfo' + required: true + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/pei-update: + post: + summary: Updates the PEI in the 3GPP access registration context + operationId: PeiUpdate + tags: + - PEI Update + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PeiUpdateInfo' + required: true + responses: + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-3gpp-access/roaming-info-update: + post: + summary: Update the Roaming Information + operationId: UpdateRoamingInformation + tags: + - Roaming Information Update + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:roaming-info-update:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RoamingInfoUpdate' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/RoamingInfoUpdate' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm//{ueId}/registrations/amf-3gpp-access/roaming-info-update' + required: true + schema: + type: string + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/amf-non-3gpp-access: + put: + summary: register as AMF for non-3GPP access + operationId: Non3GppRegistration + tags: + - AMF registration for non-3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-non-3gpp-access' + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + '204': + description: No Content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: update a parameter in the AMF registration for non-3GPP access + operationId: UpdateNon3GppRegistration + tags: + - Parameter update in the AMF registration for non-3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:amf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the AMF registration for non-3GPP access information + operationId: GetNon3GppRegistration + tags: + - AMF non-3GPP-access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smf-registrations: + get: + summary: retrieve the SMF registration information + operationId: GetSmfRegistration + tags: + - SMF SmfRegistration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistrationInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smf-registrations/{pduSessionId}: + put: + summary: register as SMF + operationId: Registration + tags: + - SMF SmfRegistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smf-registrations/{pduSessionId}' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + deregistrationNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + pcscfRestorationNotification: + '{request.body#/pcscfRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete an SMF registration + operationId: SmfDeregistration + tags: + - SMF Deregistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: smf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: smf-instance-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: get an SMF registration + operationId: RetrieveSmfRegistration + tags: + - Retrieve SMF Registration + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: update a parameter in the SMF registration + operationId: UpdateSmfRegistration + tags: + - Parameter update in the SMF registration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: pduSessionId + in: path + description: Identifier of the PDU session + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SmfRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smsf-3gpp-access: + put: + summary: register as SMSF for 3GPP access + operationId: 3GppSmsfRegistration + tags: + - SMSF registration for 3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smsf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smsf-3gpp-access' + required: true + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '204': + description: No content + headers: + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete the SMSF registration for 3GPP access + operationId: 3GppSmsfDeregistration + tags: + - SMSF Deregistration for 3GPP Access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smsf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: smsf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: If-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.1 + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the SMSF registration for 3GPP access information + operationId: Get3GppSmsfRegistration + tags: + - SMSF 3GPP access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/smsf-non-3gpp-access: + put: + summary: register as SMSF for non-3GPP access + operationId: Non3GppSmsfRegistration + tags: + - SMSF registration for non-3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smsf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/smsf-non-3gpp-access' + required: true + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '204': + description: No content + headers: + ETag: + description: Entity Tag, containing a strong validator, as described in IETF RFC 7232, 2.3 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + dataRestorationNotification: + '{request.body#/dataRestorationCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete SMSF registration for non 3GPP access + operationId: Non3GppSmsfDeregistration + tags: + - SMSF Deregistration for non-3GPP access + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:smsf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: smsf-set-id + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: If-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.1 + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: retrieve the SMSF registration for non-3GPP access information + operationId: GetNon3GppSmsfRegistration + tags: + - SMSF non-3GPP access Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/ip-sm-gw: + put: + summary: Register an IP-SM-GW + operationId: IpSmGwRegistration + tags: + - IP-SM-GW registration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:ip-sm-gw-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudm-uecm/v1/{ueId}/registrations/ip-sm-gw' + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: Delete the IP-SM-GW registration + operationId: IpSmGwDeregistration + tags: + - IP-SM-GW Deregistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:ip-sm-gw-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: Retrieve the IP-SM-GW registration information + operationId: GetIpSmGwRegistration + tags: + - IP-SM-GW Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /restore-pcscf: + post: + summary: Trigger the Restoration of the P-CSCF + operationId: Trigger P-CSCF Restoration + tags: + - Trigger P-CSCF Restoration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TriggerRequest' + required: true + responses: + '204': + description: Successful response + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/location: + get: + summary: retrieve the target UE's location information + operationId: GetLocationInfo + tags: + - UE Location Information retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/nwdaf-registrations: + get: + summary: retrieve the NWDAF registration + operationId: GetNwdafRegistration + tags: + - NWDAF Registration Info Retrieval + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: analytics-ids + in: query + description: List of analytics Id(s) provided by the consumers of NWDAF. + schema: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NwdafRegistration' + minItems: 1 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueId}/registrations/nwdaf-registrations/{nwdafRegistrationId}: + put: + summary: register as NWDAF + operationId: NwdafRegistration + tags: + - NWDAF registration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:nwdaf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nwdafRegistrationId + in: path + description: NWDAF registration identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafRegistration' + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafRegistration' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + delete: + summary: delete an NWDAF registration + operationId: NwdafDeregistration + tags: + - NWDAF Deregistration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:nwdaf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nwdafRegistrationId + in: path + description: NWDAF registration identifier + required: true + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + patch: + summary: Update a parameter in the NWDAF registration + operationId: UpdateNwdafRegistration + tags: + - Parameter update in the NWDAF registration + security: + - {} + - oAuth2ClientCredentials: + - nudm-uecm + - oAuth2ClientCredentials: + - nudm-uecm + - nudm-uecm:nwdaf-registration:write + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nwdafRegistrationId + in: path + description: NWDAF registration identifier + required: true + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/NwdafRegistrationModification' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NwdafRegistration' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '422': + description: Unprocessable Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudm-uecm: Access to the nudm-uecm API + nudm_uecm:amf-registration:write: Write access (update/modify) to representations of the Amf3GppAccessRegistration and AmfNon3GppAccessRegistration resources + nudm_uecm:smf-registration:write: Write access (create/delete/modify) to the representations of individualSmfRegistration resources + nudm_uecm:smsf-registration:write: Write access (create/delete/modify) to representations of the Smsf3GppAccessRegistration and SmsfNon3GppAccessRegistration resources + nudm_uecm:ip-sm-gw-registration:write: Write access (create/delete/modify) to the representation of the IpSmGwRegistration resource + nudm_uecm:nwdaf-registration:write: Write access (create/delete/modify) to the representation of the NwdafRegistration resource + + + schemas: + +# COMPLEX TYPES: + + Amf3GppAccessRegistration: + type: object + required: + - amfInstanceId + - deregCallbackUri + - guami + - ratType + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNameDereg: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNamePcscfRest: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + initialRegistrationInd: + type: boolean + emergencyRegistrationInd: + type: boolean + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + drFlag: + $ref: '#/components/schemas/DualRegistrationFlag' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + urrpIndicator: + type: boolean + amfEeSubscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + epsInterworkingInfo: + $ref: '#/components/schemas/EpsInterworkingInfo' + ueSrvccCapability: + type: boolean + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + vgmlcAddress: + $ref: '#/components/schemas/VgmlcAddress' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + noEeSubscriptionInd: + type: boolean + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueReachableInd: + $ref: '#/components/schemas/UeReachableInd' + reRegistrationRequired: + type: boolean + adminDeregSubWithdrawn: + type: boolean + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + disasterRoamingInd: + type: boolean + default: false + ueMINTCapability: + type: boolean + sorSnpnSiSupported: + type: boolean + default: false + udrRestartInd: + type: boolean + default: false + lastSynchronizationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + + Amf3GppAccessRegistrationModification: + type: object + required: + - guami + properties: + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + epsInterworkingInfo: + $ref: '#/components/schemas/EpsInterworkingInfo' + ueSrvccCapability: + type: boolean + nullable: true + ueMINTCapability: + type: boolean + + EpsInterworkingInfo: + type: object + properties: + epsIwkPgws: + description: A map (list of key-value pairs where Dnn serves as key) of EpsIwkPgws + type: object + additionalProperties: + $ref: '#/components/schemas/EpsIwkPgw' + + EpsIwkPgw: + type: object + required: + - pgwFqdn + - smfInstanceId + properties: + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + AmfNon3GppAccessRegistration: + type: object + required: + - amfInstanceId + - imsVoPs + - deregCallbackUri + - guami + - ratType + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNameDereg: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amfServiceNamePcscfRest: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + minItems: 1 + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + urrpIndicator: + type: boolean + amfEeSubscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + vgmlcAddress: + $ref: '#/components/schemas/VgmlcAddress' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + noEeSubscriptionInd: + type: boolean + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + reRegistrationRequired: + type: boolean + adminDeregSubWithdrawn: + type: boolean + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + disasterRoamingInd: + type: boolean + default: false + sorSnpnSiSupported: + type: boolean + default: false + udrRestartInd: + type: boolean + default: false + lastSynchronizationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + AmfNon3GppAccessRegistrationModification: + type: object + required: + - guami + properties: + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + purgeFlag: + $ref: '#/components/schemas/PurgeFlag' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + imsVoPs: + $ref: '#/components/schemas/ImsVoPs' + backupAmfInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BackupAmfInfo' + + SmfRegistration: + type: object + required: + - smfInstanceId + - pduSessionId + - singleNssai + - plmnId + properties: + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + singleNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + emergencyServices: + type: boolean + pcscfRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddr: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpAddress' + epdgInd: + type: boolean + default: false + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + registrationReason: + $ref: '#/components/schemas/RegistrationReason' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + udrRestartInd: + type: boolean + default: false + lastSynchronizationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + SmsfRegistration: + type: object + required: + - smsfInstanceId + - plmnId + properties: + smsfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smsfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + smsfMAPAddress: + $ref: '#/components/schemas/E164Number' + smsfDiameterAddress: + $ref: '#/components/schemas/NetworkNodeDiameterAddress' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + dataRestorationCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + smsfSbiSupInd: + type: boolean + default: false + udrRestartInd: + type: boolean + default: false + lastSynchronizationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + DeregistrationData: + type: object + required: + - deregReason + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + newSmfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + PcscfRestorationNotification: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + failedPcscf: + $ref: '#/components/schemas/PcscfAddress' + + NetworkNodeDiameterAddress: + type: object + required: + - name + - realm + properties: + name: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + realm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + + TriggerRequest: + type: object + required: + - supi + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + failedPcscf: + $ref: '#/components/schemas/PcscfAddress' + + SmfRegistrationInfo: + type: object + required: + - smfRegistrationList + properties: + smfRegistrationList: + type: array + items: + $ref: '#/components/schemas/SmfRegistration' + minItems: 1 + + IpSmGwRegistration: + type: object + anyOf: + - required: [ ipSmGwMapAddress ] + - required: [ ipSmGwDiameterAddress ] + - required: [ ipsmgwIpv4 ] + - required: [ ipsmgwIpv6 ] + - required: [ ipsmgwFqdn ] + properties: + ipSmGwMapAddress: + $ref: '#/components/schemas/E164Number' + ipSmGwDiameterAddress: + $ref: '#/components/schemas/NetworkNodeDiameterAddress' + ipsmgwIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipsmgwIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipsmgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + unriIndicator: + type: boolean + default: false + resetIds: + type: array + items: + type: string + minItems: 1 + ipSmGwSbiSupInd: + type: boolean + default: false + + + AmfDeregInfo: + type: object + required: + - deregReason + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + + LocationInfo: + type: object + required: + - registrationLocationInfoList + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + registrationLocationInfoList: + type: array + items: + $ref: '#/components/schemas/RegistrationLocationInfo' + minItems: 1 + maxItems: 2 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + RegistrationLocationInfo: + type: object + required: + - amfInstanceId + - accessTypeList + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + vgmlcAddress: + $ref: '#/components/schemas/VgmlcAddress' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + maxItems: 2 + + VgmlcAddress: + type: object + properties: + vgmlcAddressIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + vgmlcAddressIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + vgmlcFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + PeiUpdateInfo: + type: object + required: + - pei + properties: + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + + RegistrationDatasetNames: + type: array + items: + $ref: '#/components/schemas/RegistrationDataSetName' + minItems: 2 + uniqueItems: true + + RegistrationDataSets: + type: object + properties: + amf3Gpp: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + amfNon3Gpp: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + smfRegistration: + $ref: '#/components/schemas/SmfRegistrationInfo' + smsf3Gpp: + $ref: '#/components/schemas/SmsfRegistration' + smsfNon3Gpp: + $ref: '#/components/schemas/SmsfRegistration' + ipSmGw: + $ref: '#/components/schemas/IpSmGwRegistration' + nwdafRegistration: + $ref: '#/components/schemas/NwdafRegistrationInfo' + + NwdafRegistration: + description: The complete set of information relevant to an NWDAF serving the UE + type: object + required: + - nwdafInstanceId + - analyticsIds + properties: + nwdafInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + analyticsIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + minItems: 1 + nwdafSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + registrationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + + NwdafRegistrationModification: + description: Contains attributes of NwdafRegistration that can be modified using PATCH + required: + - nwdafInstanceId + properties: + nwdafInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nwdafSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + analyticsIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + SmfRegistrationModification: + description: Contains attributes of SmfRegistration that can be modified using PATCH + type: object + required: + - smfInstanceId + properties: + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + smfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FqdnRm' + + DataRestorationNotification: + description: Contains identities representing those UEs potentially affected by a data-loss event at the UDR + type: object + properties: + lastReplicationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + supiRanges: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IdentityRange' + minItems: 1 + resetIds: + type: array + items: + type: string + minItems: 1 + sNssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + RoamingInfoUpdate: + description: Contains the Roaming Information Update + type: object + required: + - servingPlmn + properties: + roaming: + type: + boolean + servingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + PcscfAddress: + description: Contains the addressing information (IP addresses and/or FQDN) of the P-CSCF + type: object + anyOf: + - required: [ipv4Addrs] + - required: [ipv6Addrs] + - required: [fqdn] + properties: + ipv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + NwdafRegistrationInfo: + description: List of NwdafRegistration + type: object + required: + - nwdafRegistrationList + properties: + nwdafRegistrationList: + type: array + items: + $ref: '#/components/schemas/NwdafRegistration' + minItems: 1 + + RoutingInfoSmRequest: + description: Request body of the send-routing-info-sm custom operation + type: object + properties: + ipSmGwInd: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + RoutingInfoSmResponse: + description: Addressing information of available nodes for SMS delivery + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + smsf3Gpp: + $ref: '#/components/schemas/SmsfRegistration' + smsfNon3Gpp: + $ref: '#/components/schemas/SmsfRegistration' + ipSmGw: + $ref: '#/components/schemas/IpSmGwInfo' + smsRouter: + $ref: '#/components/schemas/SmsRouterInfo' + + IpSmGwInfo: + description: Contains the IP-SM-GW Information + type: object + properties: + ipSmGwRegistration: + $ref: '#/components/schemas/IpSmGwRegistration' + ipSmGwGuidance: + $ref: '#/components/schemas/IpSmGwGuidance' + + IpSmGwGuidance: + description: > + Contains guidance information (e.g. minimum and recommended delivery times) of the IP-SM-GW + type: object + required: + - minDeliveryTime + - recommDeliveryTime + properties: + minDeliveryTime: + type: integer + minimum: 30 + maximum: 600 + recommDeliveryTime: + type: integer + minimum: 30 + maximum: 600 + + SmsRouterInfo: + description: Addressing information of the SMS Router configured at the UDM + type: object + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + diameterAddress: + $ref: '#/components/schemas/NetworkNodeDiameterAddress' + mapAddress: + $ref: '#/components/schemas/E164Number' + routerIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + routerIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + routerFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + +# SIMPLE TYPES: + + PurgeFlag: + type: boolean + + E164Number: + type: string + pattern: '^[0-9]{1,15}$' + + DualRegistrationFlag: + type: boolean + +# ENUMS: + + ImsVoPs: + anyOf: + - type: string + enum: + - HOMOGENEOUS_SUPPORT + - HOMOGENEOUS_NON_SUPPORT + - NON_HOMOGENEOUS_OR_UNKNOWN + - type: string + + DeregistrationReason: + anyOf: + - type: string + enum: + - UE_INITIAL_REGISTRATION + - UE_REGISTRATION_AREA_CHANGE + - SUBSCRIPTION_WITHDRAWN + - 5GS_TO_EPS_MOBILITY + - 5GS_TO_EPS_MOBILITY_UE_INITIAL_REGISTRATION + - REREGISTRATION_REQUIRED + - SMF_CONTEXT_TRANSFERRED + - DUPLICATE_PDU_SESSION + - 5G_SRVCC_TO_UTRAN_MOBILITY + - type: string + + RegistrationReason: + anyOf: + - type: string + enum: + - SMF_CONTEXT_TRANSFERRED + - type: string + + RegistrationDataSetName: + anyOf: + - type: string + enum: + - AMF_3GPP + - AMF_NON_3GPP + - SMF_PDU_SESSIONS + - SMSF_3GPP + - SMSF_NON_3GPP + - IP_SM_GW + - NWDAF + - type: string + + UeReachableInd: + description: UE Reachable Indication + anyOf: + - type: string + enum: + - REACHABLE + - NOT_REACHABLE + - UNKNOWN + - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29504_Nudr_DR.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29504_Nudr_DR.yaml new file mode 100644 index 000000000..cbf27caa1 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29504_Nudr_DR.yaml @@ -0,0 +1,394 @@ +openapi: 3.0.0 + +info: + version: 2.2.2 + title: 'Nudr_DataRepository API OpenAPI file' + description: | + Unified Data Repository Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.504 V17.9.0; 5G System; Unified Data Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.504/' + +servers: + - description: API root + url: '{apiRoot}/nudr-dr/v2' + variables: + apiRoot: + default: https://example.com + +security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + +paths: + /subscription-data/{ueId}/authentication-data/authentication-subscription: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-subscription' + /subscription-data/{ueId}/authentication-data/authentication-status: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-status' + /subscription-data/{ueId}/authentication-data/authentication-status/{servingNetworkName}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1authentication-data~1authentication-status~1%7BservingNetworkName%7D' + /subscription-data/{ueId}/ue-update-confirmation-data/sor-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1sor-data' + /subscription-data/{ueId}/ue-update-confirmation-data/upu-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1upu-data' + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-cag: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1subscribed-cag' + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-snssais: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ue-update-confirmation-data~1subscribed-snssais' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/am-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1am-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/smf-selection-subscription-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1smf-selection-subscription-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sm-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sm-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-bca-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1lcs-bca-data' + /subscription-data/{ueId}/context-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data' + /subscription-data/{ueId}/context-data/amf-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1amf-3gpp-access' + /subscription-data/{ueId}/context-data/amf-non-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1amf-non-3gpp-access' + /subscription-data/{ueId}/context-data/smf-registrations: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smf-registrations' + /subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smf-registrations~1%7BpduSessionId%7D' + /subscription-data/{ueId}/operator-specific-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1operator-specific-data' + /subscription-data/{ueId}/context-data/smsf-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smsf-3gpp-access' + /subscription-data/{ueId}/context-data/smsf-non-3gpp-access: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1smsf-non-3gpp-access' + /subscription-data/{ueId}/context-data/location: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1location' + /subscription-data/{ueId}/context-data/ip-sm-gw: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ip-sm-gw' + /subscription-data/{ueId}/context-data/mwd: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1mwd' + /subscription-data/{ueId}/context-data/roaming-information: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1roaming-information' + /subscription-data/{ueId}/context-data/pei-info: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1pei-info' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-mng-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sms-mng-data' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1sms-data' + /subscription-data/{ueId}/lcs-privacy-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1lcs-privacy-data' + /subscription-data/{ueId}/lcs-mo-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1lcs-mo-data' + /subscription-data/{ueId}/pp-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1pp-data' + /subscription-data/{ueId}/context-data/ee-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/amf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D~1amf-subscriptions' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/smf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D~1smf-subscriptions' + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/hss-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1ee-subscriptions~1%7BsubsId%7D~1hss-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/amf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D~1amf-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/smf-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D~1smf-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/hss-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-subscriptions~1%7BsubsId%7D~1hss-subscriptions' + /subscription-data/group-data/{ueGroupId}/ee-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1%7BueGroupId%7D~1ee-profile-data' + /subscription-data/group-data/5g-vn-groups: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups' + /subscription-data/group-data/5g-vn-groups/{externalGroupId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups~1%7BexternalGroupId%7D' + /subscription-data/group-data/5g-vn-groups/internal: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups~1internal' + /subscription-data/group-data/5g-vn-groups/pp-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~15g-vn-groups~1pp-profile-data' + /subscription-data/{ueId}/ee-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1ee-profile-data' + /subscription-data/{ueId}/context-data/sdm-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions' + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions~1%7BsubsId%7D' + /subscription-data/{ueId}/context-data/nidd-authorizations: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1nidd-authorizations' + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}/hss-sdm-subscriptions: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1sdm-subscriptions~1%7BsubsId%7D~1hss-sdm-subscriptions' + /subscription-data/shared-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1shared-data' + /subscription-data/shared-data/{sharedDataId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1shared-data~1%7BsharedDataId%7D' + /subscription-data/subs-to-notify: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1subs-to-notify' + /subscription-data/subs-to-notify/{subsId}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1subs-to-notify~1%7BsubsId%7D' + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/trace-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1%7BservingPlmnId%7D~1provisioned-data~1trace-data' + /subscription-data/{ueId}/identity-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1identity-data' + /subscription-data/{ueId}/operator-determined-barring-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1operator-determined-barring-data' + /subscription-data/{ueId}/nidd-authorization-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1nidd-authorization-data' + /subscription-data/{ueId}/service-specific-authorization-data/{serviceType}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1service-specific-authorization-data~1%7BserviceType%7D' + /subscription-data/{ueId}/v2x-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1v2x-data' + /subscription-data/{ueId}/pp-profile-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1pp-profile-data' + /subscription-data/{ueId}/coverage-restriction-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1coverage-restriction-data' + /subscription-data/group-data/group-identifiers: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1group-data~1group-identifiers' + /subscription-data/{ueId}/prose-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1prose-data' + /subscription-data/{ueId}/pp-data-store: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1pp-data-store' + /subscription-data/{ueId}/context-data/service-specific-authorizations/{serviceType}: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1context-data~1service-specific-authorizations~1%7BserviceType%7D' + /subscription-data/{ueId}/5mbs-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~15mbs-data' + /subscription-data/{ueId}/uc-data: + $ref: 'TS29505_Subscription_Data.yaml#/paths/~1subscription-data~1%7BueId%7D~1uc-data' + /policy-data/ues/{ueId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D' + /policy-data/ues/{ueId}/am-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1am-data' + /policy-data/ues/{ueId}/ue-policy-set: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1ue-policy-set' + /policy-data/ues/{ueId}/sm-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1sm-data' + /policy-data/ues/{ueId}/sm-data/{usageMonId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1sm-data~1%7BusageMonId%7D' + /policy-data/sponsor-connectivity-data/{sponsorId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1sponsor-connectivity-data~1%7BsponsorId%7D' + /policy-data/bdt-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1bdt-data' + /policy-data/bdt-data/{bdtReferenceId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1bdt-data~1%7BbdtReferenceId%7D' + /policy-data/subs-to-notify: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1subs-to-notify' + /policy-data/subs-to-notify/{subsId}: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1subs-to-notify~1%7BsubsId%7D' + /policy-data/ues/{ueId}/operator-specific-data: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1ues~1%7BueId%7D~1operator-specific-data' + /application-data/pfds: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1pfds' + /application-data/pfds/{appId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1pfds~1%7BappId%7D' + /application-data/influenceData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/influenceData/{influenceId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1%7BinfluenceId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /policy-data/plmns/{plmnId}/ue-policy-set: + $ref: 'TS29519_Policy_Data.yaml#/paths/~1policy-data~1plmns~1%7BplmnId%7D~1ue-policy-set' + /application-data/bdtPolicyData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1bdtPolicyData' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/bdtPolicyData/{bdtPolicyId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1bdtPolicyData~1%7BbdtPolicyId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/iptvConfigData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1iptvConfigData' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/iptvConfigData/{configurationId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1iptvConfigData~1%7BconfigurationId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/serviceParamData: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1serviceParamData' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/serviceParamData/{serviceParamId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1serviceParamData~1%7BserviceParamId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/influenceData/subs-to-notify: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1subs-to-notify' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/influenceData/subs-to-notify/{subscriptionId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1influenceData~1subs-to-notify~1%7BsubscriptionId%7D' +# The path segment is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + /application-data/subs-to-notify: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1subs-to-notify' + /application-data/subs-to-notify/{subsId}: + $ref: 'TS29519_Application_Data.yaml#/paths/~1application-data~1subs-to-notify~1%7BsubsId%7D' + /exposure-data/{ueId}/access-and-mobility-data: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1%7BueId%7D~1access-and-mobility-data' + /exposure-data/{ueId}/session-management-data/{pduSessionId}: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1%7BueId%7D~1session-management-data~1%7BpduSessionId%7D' + /exposure-data/subs-to-notify: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1subs-to-notify' + /exposure-data/subs-to-notify/{subId}: + $ref: 'TS29519_Exposure_Data.yaml#/paths/~1exposure-data~1subs-to-notify~1%7BsubId%7D' + /data-restoration-events: + post: + # This is a pseudo operation, clients shall NOT invoke this method! + summary: subscribe to data restoration notifications + operationId: CreateIndividualSubcription + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: {} + responses: + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + restorationNotification: + '{dataRestorationCallbackUri}': + # The URI in {dataRestorationCallbackUri} is the default endpoint discovered from NRF. + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataRestorationNotification' + responses: + '204': + description: No Content, Notification was succesfull + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: 'The URI pointing to the resource located on the redirect target NF service consumer' + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: 'The URI pointing to the resource located on the redirect target NF service consumer' + required: true + schema: + type: string + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudr-dr: Access to the Nudr_DataRepository API + nudr-dr:subscription-data: Access to the SubscriptionData data set + nudr-dr:subscription-data:authentication-subscription:read: Access to read the AuthenticationSubscription resource of the SubscriptionData data set + nudr-dr:subscription-data:authentication-subscription:modify: Access to update the AuthenticationSubscription resource of the SubscriptionData data set + nudr-dr:subscription-data:registrations:write: Write access to NF registration resources of the SubscriptionData data set + nudr-dr:policy-data: Access to the PolicyData data set + nudr-dr:policy-data:ues:read: Access to read the UEs resource + nudr-dr:policy-data:ues:am-data:read: Access to read the UEs Access and Mobility policy data + nudr-dr:policy-data:ues:ue-policy-set:read: Access to read the UEs Policy Set data + nudr-dr:policy-data:ues:ue-policy-set:create: Access to create the UEs Policy Set data + nudr-dr:policy-data:ues:ue-policy-set:modify: Access to update the UEs Policy Set data + nudr-dr:policy-data:ues:sm-data:read: Access to read the UEs Session Management Policy data + nudr-dr:policy-data:ues:sm-data:modify: Access to update the UEs Session Management Policy data + nudr-dr:policy-data:ues:sm-data:create: Access to create the UEs Session Management Policy data + nudr-dr:policy-data:sponsor-connectivity-data:read: Access to read the sponsored Connectivity Data + nudr-dr:policy-data:bdt-data:read: Access to read the BDT data resource + nudr-dr:policy-data:bdt-data:create: Access to create the BDT data resource + nudr-dr:policy-data:bdt-data:modify: Access to update the BDT data resource + nudr-dr:policy-data:subs-to-notify:create: Access to create Subscriptions resources + nudr-dr:policy-data:subs-to-notify:modify: Access to update Subscriptions resources + nudr-dr:policy-data:ues:operator-specific-data:read: Access to read the UEs operator specific policy data + nudr-dr:policy-data:ues:operator-specific-data:modify: Access to update the UEs operator specific policy data + nudr-dr:policy-data:ues:operator-specific-data:create: Access to create the UEs operator specific policy data + nudr-dr:policy-data:slice-control-data:read: Access to read Slice specific Policy Control Data + nudr-dr:policy-data:slice-control-data:modify: Access to update Slice specific Policy Control Data + nudr-dr:exposure-data: Access to the ExposureData data set + nudr-dr:exposure-data:access-and-mobility-data:create: Access to create ExposureData + nudr-dr:exposure-data:access-and-mobility-data:read: Access to read ExposureData + nudr-dr:exposure-data:access-and-mobility-data:modify: Access to update ExposureData + nudr-dr:exposure-data:session-management-data:create: Access to create ExposureData + nudr-dr:exposure-data:session-management-data:read: Access to read ExposureData + nudr-dr:exposure-data:session-management-data:modify: Access to update ExposureData + nudr-dr:exposure-data:subs-to-notify:create: Access to create Subscriptions resources + nudr-dr:exposure-data:subs-to-notify:modify: Access to update Subscriptions resources + nudr-dr:application-data: Access to the ApplicationData data set + nudr-dr:application-data:pfds:read: Access to read PFDData + nudr-dr:application-data:pfds:modify: Access to update PFDData + nudr-dr:application-data:pfds:create: Access to create PFDData + nudr-dr:application-data:influence-data:read: Access to read Traffic Influence Data + nudr-dr:application-data:influence-data:create: Access to create Traffic Influence Data. + nudr-dr:application-data:influence-data:modify: Access to update Traffic Influence Data + nudr-dr:application-data:influence-data:subscriptions:read: Access to read Traffic Influence Data Subscriptions + nudr-dr:application-data:influence-data:subscriptions:create: Access to create Traffic Influence Data Subscriptions + nudr-dr:application-data:influence-data:subscriptions:modify: Access to update Traffic Influence Data Subscriptions + nudr-dr:application-data:bdt-policy-data:read: Access to read BDT Policy Data + nudr-dr:application-data:bdt-policy-data:create: Access to create BDT Policy Data + nudr-dr:application-data:bdt-policy-data:modify: Access to update BDT Policy Data + nudr-dr:application-data:iptv-config-data:read: Access to read IPTV Configuration Data + nudr-dr:application-data:iptv-config-data:create: Access to create IPTV Configuration Data + nudr-dr:application-data:iptv-config-data:modify: Access to update IPTV Configuration Data + nudr-dr:application-data:service-param-data:read: Access to read Service Parameter Data + nudr-dr:application-data:service-param-data:create: Access to create Service Parameter Data + nudr-dr:application-data:service-param-data:modify: Access to update Service Parameter Data + nudr-dr:application-data:am-influence-data:read: Access to read AM Influence Data + nudr-dr:application-data:am-influence-data:create: Access to create AM Influence Data + nudr-dr:application-data:am-influence-data:modify: Access to update AM Influence Data + nudr-dr:application-data:subs-to-notify:create: Access to create Subscriptions resources + nudr-dr:application-data:subs-to-notify:read: Access to read Subscriptions resources + nudr-dr:application-data:subs-to-notify:modify: Access to update Subscriptions resources + nudr-dr:application-data:eas-deploy-data:read: Access to read EAS Deployment Information Data + nudr-dr:application-data:eas-deploy-data:create: Access to create EAS Deployment Information Data + nudr-dr:application-data:eas-deploy-data:modify: Access to update EAS Deployment Information Data + + schemas: + DataRestorationNotification: + description: Contains identities representing those UEs potentially affected by a data-loss event at the UDR + type: object + properties: + supiRanges: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IdentityRange' + minItems: 1 + resetIds: + type: array + items: + type: string + minItems: 1 + sNssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + udrGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29504_Nudr_GroupIDmap.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29504_Nudr_GroupIDmap.yaml new file mode 100644 index 000000000..b104ea7e5 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29504_Nudr_GroupIDmap.yaml @@ -0,0 +1,96 @@ +openapi: 3.0.0 + +info: + version: 1.1.0 + title: 'Nudr_GroupIDmap' + description: | + Unified Data Repository Service for NF-Group ID retrieval. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.504 V17.7.0; 5G System; Unified Data Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.504/' + +servers: + - description: API root + url: '{apiRoot}/nudr-group-id-map/v1' + variables: + apiRoot: + default: https://example.com + +security: + - {} + - oAuth2ClientCredentials: + - nudr-group-id-map + +paths: + /nf-group-ids: + get: + summary: Retrieves NF-Group IDs for provided Subscriber and NF types + operationId: GetNfGroupIDs + tags: + - NF Group IDs (Document) + parameters: + - name: nf-type + in: query + description: Type of NF + required: true + style: form + explode: false + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + minItems: 1 + - name: subscriberId +# The name of this query parameter is left not following the naming convention as defined in 3GPP TS 29.501 due to backward compatibility consideration. + in: query + description: Identifier of the subscriber + required: true + schema: + $ref: '#/components/schemas/SubscriberId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NfGroupIdMapResult' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nudr-group-id-map: Access to the Nudr_GroupIDmap API + + + + schemas: + +# COMPLEX TYPES: + + NfGroupIdMapResult: + description: Contains the NFGroupIds for the requested NF types. The NFType is the key of the map. + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + minProperties: 1 + +# SIMPLE TYPES: + + SubscriberId: + description: Represents the Subscription Identifier SUPI or GPSI or IMPI or IMPU. + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|impi-.+|impu-.+|.+)$' + +# ENUMS: diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29505_Subscription_Data.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29505_Subscription_Data.yaml new file mode 100644 index 000000000..af3cef6c1 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29505_Subscription_Data.yaml @@ -0,0 +1,7352 @@ +openapi: 3.0.0 +info: + version: '-' + title: 'Unified Data Repository Service API file for subscription data' + description: | + Unified Data Repository Service (subscription data). + The API version is defined in 3GPP TS 29.504. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.505 V17.9.0; 5G System; Usage of the Unified Data Repository Service for subscription data; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.505/' + +paths: + + /subscription-data/{ueId}/authentication-data/authentication-subscription: + get: + summary: Retrieves the authentication subscription data of a UE + operationId: QueryAuthSubsData + tags: + - Authentication Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:authentication-subscription:read + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the authentication subscription data of a UE + operationId: ModifyAuthenticationSubscription + tags: + - Authentication Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:authentication-subscription:modify + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/authentication-data/authentication-status: + put: + summary: To store the Authentication Status data of a UE + operationId: CreateAuthenticationStatus + tags: + - Authentication Status (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the Authentication Status of a UE + operationId: QueryAuthenticationStatus + tags: + - AuthEvent (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + description: Supported Features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the Authentication Status of a UE + operationId: DeleteAuthenticationStatus + tags: + - AuthEvent (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/authentication-data/authentication-status/{servingNetworkName}: + put: + summary: To store the individual Authentication Status data of a UE + operationId: CreateIndividualAuthenticationStatus + tags: + - Individual Authentication Status (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: servingNetworkName + in: path + description: Serving Network Name + required: true + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the Individual Authentication Status of a UE + operationId: QueryIndividualAuthenticationStatus + tags: + - Individual AuthEvent (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: servingNetworkName + in: path + description: Serving Network Name + required: true + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + description: Supported Features + in: query + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/AuthEvent' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the Individual Authentication Status of a UE + operationId: DeleteIndividualAuthenticationStatus + tags: + - Individual AuthEvent (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: servingNetworkName + in: path + description: Serving Network Name + required: true + schema: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ue-update-confirmation-data/sor-data: + put: + summary: To store the SoR acknowledgement information of a UE and ME support of SOR CMCI + operationId: CreateAuthenticationSoR + tags: + - Authentication SoR (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorData' + required: true + responses: + '204': + description: Expected response to a valid request + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the SoR acknowledgement information of a UE and ME support of SOR CMCI + operationId: QueryAuthSoR + tags: + - Authentication SoR (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SorData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Updates the ME support of SOR CMCI information of a UE + operationId: UpdateAuthenticationSoR + tags: + - Authentication SoR (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ue-update-confirmation-data/upu-data: + put: + summary: To store the UPU acknowledgement information of a UE + operationId: CreateAuthenticationUPU + tags: + - Authentication UPU (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpuData' + required: true + responses: + '204': + description: Expected response to a valid request + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the UPU acknowledgement information of a UE + operationId: QueryAuthUPU + tags: + - Authentication UPU (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UpuData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-snssais: + put: + summary: To store the NSSAI update acknowledgement information of a UE + operationId: CreateOrUpdateNssaiAck + tags: + - NSSAI update ack (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAckData' + required: true + responses: + '204': + description: Expected response to a valid request + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the UPU acknowledgement information of a UE + operationId: QueryNssaiAck + tags: + - NSSAI ACK (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAckData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ue-update-confirmation-data/subscribed-cag: + put: + summary: To store the CAG update acknowledgement information of a UE + operationId: CreateCagUpdateAck + tags: + - CAG update ack (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CagAckData' + required: true + responses: + '204': + description: Expected response to a valid request + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the CAG acknowledgement information of a UE + operationId: QueryCagAck + tags: + - CAG ACK (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CagAckData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data: + get: + summary: Retrieve multiple provisioned data sets of a UE + operationId: QueryProvisionedData + tags: + - Provisioned Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: dataset-names + in: query + description: List of dataset names + style: form + explode: false + schema: + $ref: '#/components/schemas/DatasetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvisionedDataSets' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/am-data: + get: + summary: Retrieves the access and mobility subscription data of a UE + operationId: QueryAmData + tags: + - Access And Mobility Subscription Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/smf-selection-subscription-data: + get: + summary: Retrieves the SMF selection subscription data of a UE + operationId: QuerySmfSelectData + tags: + - SMF Selection Subscription Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sm-data: + get: + summary: Retrieves the Session Management subscription data of a UE + operationId: QuerySmData + tags: + - Session Management Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: false + - name: dnn + in: query + description: DNN + required: false + schema: + $ref: '#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmSubsData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/amf-3gpp-access: + get: + summary: Retrieves the AMF context data of a UE using 3gpp access + operationId: QueryAmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + put: + summary: To store the AMF context data of a UE using 3gpp access in the UDR + operationId: CreateAmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/amf-3gpp-access' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: To modify the AMF context data of a UE using 3gpp access in the UDR + operationId: AmfContext3gpp + tags: + - AMF 3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/amf-non-3gpp-access: + get: + summary: Retrieves the AMF context data of a UE using non-3gpp access + operationId: QueryAmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + put: + summary: To store the AMF context data of a UE using non-3gpp access in the UDR + operationId: CreateAmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/amf-non-3gpp-access' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: To modify the AMF context data of a UE using non 3gpp access in the UDR + operationId: AmfContextNon3gpp + tags: + - AMF Non-3GPP Access Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/smf-registrations: + get: + summary: Retrieves the SMF registration list of a UE + operationId: QuerySmfRegList + tags: + - SMF Registrations (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegList' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}: + get: + summary: Retrieves the individual SMF registration of a UE + operationId: QuerySmfRegistration + tags: + - SMF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + put: + summary: To create an individual SMF context data of a UE in the UDR + operationId: CreateOrUpdateSmfRegistration + tags: + - SMF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + required: true + responses: + '201': + description: Upon success, a response body containing a representation of the created Individual SmfRegistration resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/smf-registrations/{pduSessionId}' + required: true + schema: + type: string + '204': + description: No content + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove an individual SMF context data of a UE the UDR + operationId: DeleteSmfRegistration + tags: + - SMF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '204': + description: Upon success, an empty response body shall be returned. + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: To modify the SMF context data of a UE in the UDR + operationId: UpdateSmfContext + tags: + - SMF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/operator-specific-data: + get: + summary: Retrieves the operator specific data of a UE + operationId: QueryOperSpecData + tags: + - Operator-Specific Data Container (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + description: A map(list of key-value pairs) where operator specific data element name serves as key + additionalProperties: + $ref: '#/components/schemas/OperatorSpecificDataContainer' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: To modify operator specific data of a UE + operationId: ModifyOperSpecData + tags: + - Operator-Specific Data Container (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + put: + summary: To create an operator-specific data resource of a UE + operationId: CreateOperSpecData + tags: + - Operator-Specific Data Container (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json: + schema: + type: object + description: A map (list of key-value pairs) where operator specific data element name serves as key + additionalProperties: + $ref: '#/components/schemas/OperatorSpecificDataContainer' + required: true + responses: + '201': + description: Upon success, a response body containing a representation of the created Operator Specific Data resource shall be returned + content: + application/json: + schema: + type: object + description: A map (list of key-value pairs) where operator specific data element name serves as key + additionalProperties: + $ref: '#/components/schemas/OperatorSpecificDataContainer' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/operator-specific-data' + required: true + schema: + type: string + '204': + description: No content + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove an operator-specific data resource of a UE + operationId: DeleteOperSpecData + tags: + - Operator-Specific Data Container (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned. + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/smsf-3gpp-access: + put: + summary: Create the SMSF context data of a UE via 3GPP access + operationId: CreateSmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/smsf-3gpp-access' + required: true + schema: + type: string + '200': + description: Updated + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the SMSF context data of a UE via 3GPP access + operationId: DeleteSmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the SMSF context data of a UE using 3gpp access + operationId: QuerySmsfContext3gpp + tags: + - SMSF 3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/smsf-non-3gpp-access: + put: + summary: Create the SMSF context data of a UE via non-3GPP access + operationId: CreateSmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/smsf-non-3gpp-access' + required: true + schema: + type: string + '200': + description: Updated + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the SMSF context data of a UE via non-3GPP access + operationId: DeleteSmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the SMSF context data of a UE using non-3gpp access + operationId: QuerySmsfContextNon3gpp + tags: + - SMSF Non-3GPP Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsfRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ip-sm-gw: + put: + summary: Create the IP-SM-GW context data of a UE + operationId: CreateIpSmGwContext + tags: + - IP-SM-GW Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: To remove the IP-SM-GW context data of a UE + operationId: DeleteIpSmGwContext + tags: + - IP-SM-GW Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the IP-SM-GW context data of a UE + operationId: ModifyIpSmGwContext + tags: + - IP-SM-GW Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data:registrations:write + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the IP-SM-GW context data of a UE + operationId: QueryIpSmGwContext + tags: + - IP-SM-GW Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwRegistration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/mwd: + put: + summary: Create the Message Waiting Data of the UE + operationId: CreateMessageWaitingData + tags: + - Message Waiting Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MessageWaitingData' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/MessageWaitingData' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/mwd' + required: true + schema: + type: string + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + delete: + summary: To remove the Message Waiting Data of the UE + operationId: DeleteMessageWaitingData + tags: + - Message Waiting Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the Message Waiting Data of the UE + operationId: ModifyMessageWaitingData + tags: + - Message Waiting Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves the Message Waiting Data of the UE + operationId: QueryMessageWaitingData + tags: + - Message Waiting Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/MessageWaitingData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-mng-data: + get: + summary: Retrieves the SMS management subscription data of a UE + operationId: QuerySmsMngData + tags: + - SMS Management Subscription Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/sms-data: + get: + summary: Retrieves the SMS subscription data of a UE + operationId: QuerySmsData + tags: + - SMS Subscription Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/pp-data: + get: + summary: Read the profile of a given UE + operationId: GetppData + tags: + - Parameter Provision (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: pp data for a UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the provisioned parameter data + operationId: ModifyPpData + tags: + - ProvisionedParameterData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: pp data for a UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/pp-profile-data: + get: + summary: Retrieves the parameter provision profile data of a UE + operationId: QueryPPData + tags: + - Parameter Provision profile Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpProfileData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/pp-data-store/{afInstanceId}: + put: + summary: create a Provisioning Parameter Data Entry + operationId: Create PP Data Entry + tags: + - ProvisionedParameterDataEntry (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpDataEntry' + required: true + responses: + '201': + description: Indicating a successful creation of the resource. + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpDataEntry' + '204': + description: Indicating a successful creation of the resource. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + delete: + summary: Delete a Provisioning Parameter Data Entry + operationId: Delete PP Data Entry + tags: + - ProvisionedParameterDataEntry (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + responses: + '204': + description: Expected response to a valid request + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + get: + summary: get a Parameter Provisioning Data Entry + operationId: Get PP Data Entry + tags: + - ProvisionedParameterDataEntry (Document) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: afInstanceId + in: path + description: Application Function Instance Identifier + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpDataEntry' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /subscription-data/{ueId}/pp-data-store: + get: + summary: get a list of Parameter Provisioning Data Entries + operationId: Get Multiple PP Data Entries + tags: + - ProvisionedParameterDataEntries (Collection) + parameters: + - name: ueId + in: path + description: Identifier of the UE + required: true + schema: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - type: string + pattern: '^anyUE$' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PpDataEntryList' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /subscription-data/{ueId}/context-data/ee-subscriptions: + get: + summary: Retrieves the ee subscriptions of a UE + operationId: Queryeesubscriptions + tags: + - Event Exposure Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: event-types + in: query + required: false + description: Event Types + schema: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EventType' + minItems: 1 + style: form + explode: false + - name: nf-identifiers + in: query + description: NF Identifiers + schema: + type: array + items: + $ref: '#/components/schemas/NfIdentifier' + minItems: 1 + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EeSubscriptionExt' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + post: + summary: Create individual EE subscription + operationId: CreateEeSubscriptions + tags: + - Event Exposure Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}: + put: + summary: Update an individual ee subscriptions of a UE + operationId: UpdateEesubscriptions + tags: + - Event Exposure Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a eeSubscription + operationId: RemoveeeSubscriptions + tags: + - Event Exposure Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify an individual ee subscription of a UE + operationId: ModifyEesubscription + tags: + - Event Exposure Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve a eeSubscription + operationId: QueryeeSubscription + tags: + - Event Exposure Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EeSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/amf-subscriptions: + put: + summary: Create AmfSubscriptions for an individual ee subscriptions of a UE + operationId: Create AMF Subscriptions + tags: + - AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes AMF Subscription Info for an eeSubscription + operationId: RemoveAmfSubscriptionsInfo + tags: + - Event AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the AMF Subscription Info + operationId: ModifyAmfSubscriptionInfo + tags: + - AmfSubscriptionInfo (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve AMF subscription Info + operationId: GetAmfSubscriptionInfo + tags: + - Query AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/smf-subscriptions: + put: + summary: Create SMF Subscription Info + operationId: Create SMF Subscriptions + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete SMF Subscription Info + operationId: RemoveSmfSubscriptionsInfo + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify SMF Subscription Info + operationId: ModifySmfSubscriptionInfo + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve SMF Subscription Info + operationId: GetSmfSubscriptionInfo + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/ee-subscriptions/{subsId}/hss-subscriptions: + put: + summary: Create HSS Subscription Info + operationId: Create HSS Subscriptions + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete HSS Subscription Info + operationId: RemoveHssSubscriptionsInfo + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify HSS Subscription Info + operationId: ModifyHssSubscriptionInfo + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve HSS Subscription Info + operationId: GetHssSubscriptionInfo + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions: + get: + summary: Retrieves the ee subscriptions of a group of UEs or any UE + operationId: QueryEeGroupSubscriptions + tags: + - Event Exposure Group Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + post: + summary: Create individual EE subscription for a group of UEs or any UE + operationId: CreateEeGroupSubscriptions + tags: + - Event Exposure Group Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/group-data/{ueGroupId}/ee-subscriptions' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}: + put: + summary: Update an individual ee subscription of a group of UEs or any UE + operationId: UpdateEeGroupSubscriptions + tags: + - Event Exposure Group Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EeSubscription' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a eeSubscription for a group of UEs or any UE + operationId: RemoveEeGroupSubscriptions + tags: + - Event Exposure Group Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify an individual ee subscription for a group of a UEs + operationId: ModifyEeGroupSubscription + tags: + - Event Exposure Group Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve a individual eeSubscription for a group of UEs or any UE + operationId: QueryEeGroupSubscription + tags: + - Event Exposure Group Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EeSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-profile-data: + get: + summary: Retrieves the ee profile data profile data of a group or anyUE + operationId: QueryGroupEEData + tags: + - Event Exposure Data for a group (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + description: Group of UEs or any UE + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeGroupProfileData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/ee-profile-data: + get: + summary: Retrieves the ee profile data of a UE + operationId: QueryEEData + tags: + - Event Exposure Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/EeProfileData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/sdm-subscriptions: + get: + summary: Retrieves the sdm subscriptions of a UE + operationId: Querysdmsubscriptions + tags: + - SDM Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SdmSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + post: + summary: Create individual sdm subscription + operationId: CreateSdmSubscriptions + tags: + - SDM Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}: + put: + summary: Update an individual sdm subscriptions of a UE + operationId: Updatesdmsubscriptions + tags: + - SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SdmSubscription' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '404': + description: update of non-existing resource is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes a sdmsubscriptions + operationId: RemovesdmSubscriptions + tags: + - SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify an individual sdm subscription + operationId: ModifysdmSubscription + tags: + - SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves a individual sdmSubscription identified by subsId + operationId: QuerysdmSubscription + tags: + - SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + description: Unique ID of the subscription to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SdmSubscription' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/sdm-subscriptions/{subsId}/hss-sdm-subscriptions: + put: + summary: Create HSS SDM Subscription Info + operationId: Create HSS SDM Subscriptions + tags: + - HSS SDM Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete HSS SDM Subscription Info + operationId: RemoveHssSDMSubscriptionsInfo + tags: + - HSS SDM Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify HSS SDM Subscription Info + operationId: ModifyHssSDMSubscriptionInfo + tags: + - HSS SDM Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieve HSS SDM Subscription Info + operationId: GetHssSDMSubscriptionInfo + tags: + - HSS SDM Subscription Info (Document) + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedDataIds' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/shared-data/{sharedDataId}: + get: + summary: retrieve individual shared data + operationId: GetIndividualSharedData + tags: + - Retrieval of individual shared data + parameters: + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + - name: sharedDataId + in: path + description: Id of the Shared Data + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedDataId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/subs-to-notify: + post: + summary: Subscription data subscriptions + operationId: SubscriptionDataSubscriptions + tags: + - Subs To Notify (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/subs-to-notify/{subsId}' + required: true + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + onDataChange: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DataChangeNotify' + responses: + '204': + description: Expected response to a valid request + + get: + summary: Retrieves the list of subscriptions + operationId: QuerySubsToNotify + tags: + - Subs To Notify (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ue-id + in: query + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes subscriptions identified by a given ue-id parameter + operationId: RemoveMultipleSubscriptionDataSubscriptions + tags: + - Subs To Notify (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ue-id + in: query + required: true + description: UE ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: nf-instance-id + in: query + required: false + description: NF Instance ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: delete-all-nfs + in: query + required: false + description: Flag to delete subscriptions from all NFs + schema: + type: boolean + - name: implicit-unsubscribe-indication + in: query + required: false + description: Implicit Unsubscribe Indication + schema: + type: boolean + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/subs-to-notify/{subsId}: + delete: + summary: Deletes a subscriptionDataSubscriptions + operationId: RemovesubscriptionDataSubscriptions + tags: + - Subs To Notify (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: subsId + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify an individual subscriptionDataSubscription + operationId: ModifysubscriptionDataSubscription + tags: + - Subs To Notify (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '204': + description: Successful response + '200': + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + - $ref: '#/components/schemas/SubscriptionDataSubscriptions' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieves a individual subscriptionDataSubscription identified by subsId + operationId: QuerySubscriptionDataSubscriptions + tags: + - Subs To Notify (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: subsId + in: path + required: true + description: Unique ID of the subscription to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/trace-data: + get: + summary: Retrieves the trace configuration data of a UE + operationId: QueryTraceData + tags: + - Trace Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/identity-data: + get: + summary: Retrieve identity data by SUPI or GPSI + operationId: GetIdentityData + tags: + - Query Identity Data by SUPI or GPSI (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: app-port-id + in: query + description: Application port identifier + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AppPortId' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/operator-determined-barring-data: + get: + summary: Retrieve ODB Data data by SUPI or GPSI + operationId: GetOdbData + tags: + - Query ODB Data by SUPI or GPSI (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data: + get: + summary: Retrieve multiple context data sets of a UE + operationId: QueryContextData + tags: + - Context Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: context-dataset-names + in: query + description: List of context dataset names + style: form + explode: false + required: true + schema: + $ref: '#/components/schemas/ContextDatasetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ContextDataSets' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/group-identifiers: + get: + summary: Mapping of Group Identifiers + operationId: GetGroupIdentifiers + tags: + - Group Identifiers + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ext-group-id + in: query + description: External Group Identifier + required: false + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: int-group-id + in: query + description: Internal Group Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: ue-id-ind + in: query + description: Indication whether UE identifiers are required or not + required: false + schema: + type: boolean + default: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GroupIdentifiers' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/5g-vn-groups: + get: + summary: Retrieves the data of a 5G VN Group + operationId: Query5GVnGroup + tags: + - 5G-VN-Groups (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: gpsis + in: query + description: List of GPSIs + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + description: A map(list of key-value pairs) where ExtGroupId serves as key + additionalProperties: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/5g-vn-groups/{externalGroupId}: + put: + summary: Create an individual 5G VN Grouop + operationId: Create5GVnGroup + tags: + - 5GVnGroupConfiguration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes the 5GVnGroup + operationId: Delete5GVnGroup + tags: + - Delete 5GVnGroup + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '204': + description: Expected response to a successful group removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the 5GVnGroup + operationId: Modify5GVnGroup + tags: + - Modify 5GVnGroup + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve a 5GVnGroup configuration + operationId: Get5GVnGroupConfiguration + tags: + - Query 5GVnGroupConfiguration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/lcs-privacy-data: + get: + summary: Retrieves the LCS Privacy subscription data of a UE + operationId: QueryLcsPrivacyData + tags: + - LCS Privacy Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsPrivacyData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/lcs-mo-data: + get: + summary: Retrieves the LCS Mobile Originated subscription data of a UE + operationId: QueryLcsMoData + tags: + - LCS Mobile Originated Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsMoData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/nidd-authorization-data: + get: + summary: Retrieve NIDD Authorization Data GPSI or External Group identifier + operationId: GetNiddAuData + tags: + - Query NIDD Authorization Data GPSI or External Group identifier (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: true + - name: dnn + in: query + description: DNN + required: true + schema: + $ref: '#/components/schemas/Dnn' + - name: mtc-provider-information + in: query + description: MTC Provider Information + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: af-id + in: query + description: Application Function Identifier + schema: + type: string + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/coverage-restriction-data: + get: + summary: Retrieves the subscribed enhanced Coverage Restriction Data of a UE + operationId: QueryCoverageRestrictionData + tags: + - Enhanced Coverage Restriction Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/EnhancedCoverageRestrictionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/location: + get: + summary: Retrieves the UE's Location Information + operationId: QueryUeLocation + tags: + - UE's Location Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/v2x-data: + get: + summary: Retrieves the subscribed V2X Data of a UE + operationId: QueryV2xData + tags: + - V2X Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/V2xSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/prose-data: + get: + summary: Retrieves the subscribed ProSe service Data of a UE + operationId: QueryPorseData + tags: + - ProSe Service Subscription Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ProseSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/{servingPlmnId}/provisioned-data/lcs-bca-data: + get: + summary: Retrieves the LCS Broadcast Assistance subscription data of a UE + operationId: QueryLcsBcaData + tags: + - LCS Broadcast Assistance Subscription Data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: servingPlmnId + in: path + description: PLMN ID + required: true + schema: + $ref: '#/components/schemas/VarPlmnId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + description: Unexpected error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /subscription-data/group-data/5g-vn-groups/internal: + get: + summary: Retrieves the data of 5G VN Group + operationId: Query5GVnGroupInternal + tags: + - 5G-VN-Groups-Internal (Document) + parameters: + - name: internal-group-ids + in: query + description: List of Internal Group IDs + required: true + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + style: form + explode: false + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + description: A map (list of key-value pairs) where ExtGroupId serves as key + additionalProperties: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5GVnGroupConfiguration' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/5g-vn-groups/pp-profile-data: + get: + summary: Retrieves the parameter provision profile data for 5G VN Group + operationId: Query5GVNGroupPPData + tags: + - Parameter Provision profile Data for 5G VN Group(Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ext-group-ids + in: query + description: List of external VN group identifiers + schema: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Pp5gVnGroupProfileData' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/nidd-authorizations: + put: + summary: Create NIDD Authorization Info + operationId: CreateNIDDAuthorizationInfo + tags: + - NIDD Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthorizationInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthorizationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete NIDD Authorization Info + operationId: RemoveNiddAuthorizationInfo + tags: + - NIDD Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify NIDD Authorization Info + operationId: ModifyNiddAuthorizationInfo + tags: + - NIDD Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve NIDD Authorization Info + operationId: GetNiddAuthorizationInfo + tags: + - NIDD Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NiddAuthorizationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/5mbs-data: + get: + summary: Retrieves the 5mbs subscription data of a UE + operationId: Query5mbsData + tags: + - 5MBSSubscriptionData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/MbsSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}: + get: + summary: Retrieve multiple subscribed data sets of a UE + operationId: QueryUeSubscribedData + tags: + - UE Subscribed Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: dataset-names + in: query + description: List of dataset names + style: form + explode: false + schema: + $ref: '#/components/schemas/DatasetNames' + - name: serving-plmn + in: query + description: Serving PLMN Id + schema: + $ref: '#/components/schemas/VarPlmnId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/UeSubscribedDataSets' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/service-specific-authorization-data/{serviceType}: + get: + summary: Retrieve ServiceSpecific Authorization Data + operationId: GetSSAuData + tags: + - Query Service Specific Authorization Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE ID + required: true + schema: + type: string + pattern: '^(msisdn-[0-9]{5,15}|.+|extid-[^@]+@[^@]+|extgroupid-[^@]+@[^@]+)$' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + - name: single-nssai + in: query + content: + application/json: + schema: + $ref: '#/components/schemas/VarSnssai' + description: single NSSAI + required: true + - name: dnn + in: query + description: DNN + required: true + schema: + $ref: '#/components/schemas/Dnn' + - name: mtc-provider-information + in: query + description: MTC Provider Information + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + - name: af-id + in: query + description: Application Function Identifier + schema: + type: string + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/service-specific-authorizations/{serviceType}: + put: + summary: Create Service Specific Authorization Info + operationId: CreateServiceSpecificAuthorizationInfo + tags: + - Service Specific Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete Service Specific Authorization Info + operationId: RemoveServiceSpecificAuthorizationInfo + tags: + - Service Specific Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify Service Specific Authorization Info + operationId: ModifyServiceSpecificAuthorizationInfo + tags: + - Service Specific Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieve Service Specific Authorization Info + operationId: GetServiceSpecificAuthorizationInfo + tags: + - Service Specific Authorization Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: serviceType + in: path + description: Service Type + required: true + schema: + $ref: 'TS29503_Nudm_SSAU.yaml#/components/schemas/ServiceType' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceSpecificAuthorizationInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/roaming-information: + put: + summary: Update the Roaming Information of the EPC domain + operationId: UpdateRoamingInformation + tags: + - Update the Roaming Information of the EPC domain (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/RoamingInfoUpdate' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/RoamingInfoUpdate' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/roaming-information' + required: true + schema: + type: string + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + + get: + summary: Retrieves the Roaming Information of the EPC domain + operationId: QueryRoamingInformation + tags: + - Retrieve the Roaming Information of the EPC domain (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/RoamingInfoUpdate' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/context-data/pei-info: + put: + summary: Update the PEI Information of the 5GC/EPC domains + operationId: CreateOrUpdatePeiInformation + tags: + - Update the PEI Information of the 5GC/EPC domains (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/PeiUpdateInfo' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/PeiUpdateInfo' + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nudr-dr//subscription-data/{ueId}/context-data/pei-info' + required: true + schema: + type: string + '204': + description: Upon success, an empty response body shall be returned + default: + description: Unexpected error + + get: + summary: Retrieves the PEI Information of the 5GC/EPC domains + operationId: QueryPeiInformation + tags: + - Retrieve the Roaming Information of the 5GC/EPC domains (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/PeiUpdateInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/amf-subscriptions: + put: + summary: Create AmfSubscriptions for a group of UEs or any UE + operationId: CreateAmfGroupSubscriptions + tags: + - AMF Group Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes AMF Subscription Info for an eeSubscription for a group of UEs or any UE + operationId: RemoveAmfGroupSubscriptions + tags: + - Event AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: modify the AMF Subscription Info + operationId: ModifyAmfGroupSubscriptions + tags: + - AmfSubscriptionInfo (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve AMF subscription Info for a group of UEs or any UE + operationId: GetAmfGroupSubscriptions + tags: + - Query AMF Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/smf-subscriptions: + put: + summary: Create SMF Subscription Info for a group of UEs or any YE + operationId: CreateSmfGroupSubscriptions + tags: + - SMF Event Group Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete SMF Subscription Info for a group of UEs or any UE + operationId: RemoveSmfGroupSubscriptions + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify SMF Subscription Info for a group of UEs or any UE + operationId: ModifySmfGroupSubscriptions + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve SMF Subscription Info for a group of UEs or any UE + operationId: GetSmfGroupSubscriptions + tags: + - SMF Event Subscription Info (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueGroupId + in: path + required: true + schema: + $ref: '#/components/schemas/VarUeGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmfSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/group-data/{ueGroupId}/ee-subscriptions/{subsId}/hss-subscriptions: + put: + summary: Create HSS Subscription Info for a group of UEs + operationId: CreateHssGroupSubscriptions + tags: + - HSS Event Group Subscription Info (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: subsId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + required: true + responses: + '204': + description: Upon success, an empty response body shall be returned + '201': + description: Upon successful creation, the created resource shall be returned + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete HSS Subscription Info + operationId: RemoveHssGroupSubscriptions + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify HSS Subscription Info + operationId: ModifyHssGroupSubscriptions + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: subsId + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: Expected response to a valid request + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '403': + description: modification is rejected + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve HSS Subscription Info + operationId: GetHssGroupSubscriptions + tags: + - HSS Event Subscription Info (Document) + parameters: + - name: externalGroupId + in: path + required: true + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: subsId + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/HssSubscriptionInfo' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscription-data/{ueId}/uc-data: + get: + summary: Retrieves the subscribed User Consent Data of a UE + operationId: QueryUserConsentData + tags: + - User Consent Data + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:subscription-data + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: ucPurpose + in: query + description: User consent purpose + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/UcPurpose' + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.2 + schema: + type: string + - name: If-Modified-Since + in: header + description: Validator for conditional requests, as described in RFC 7232, 3.3 + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UcSubscriptionData' + headers: + Cache-Control: + description: Cache-Control containing max-age, as described in RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag, containing a strong validator, as described in RFC 7232, 2.3 + schema: + type: string + Last-Modified: + description: Timestamp for last modification of the resource, as described in RFC 7232, 2.2 + schema: + type: string + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + AuthenticationSubscription: + description: A UE's authentication data. + type: object + required: + - authenticationMethod + properties: + authenticationMethod: + $ref: '#/components/schemas/AuthMethod' + encPermanentKey: + type: string + protectionParameterId: + type: string + sequenceNumber: + $ref: '#/components/schemas/SequenceNumber' + authenticationManagementField: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + algorithmId: + type: string + encOpcKey: + type: string + encTopcKey: + type: string + vectorGenerationInHss: + type: boolean + default: false + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + n5gcAuthMethod: + $ref: '#/components/schemas/AuthMethod' + rgAuthenticationInd: + type: boolean + default: false + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + akmaAllowed: + type: boolean + default: false + routingId: + type: string + pattern: '^[0-9]{1,4}$' + + SequenceNumber: + description: Contains the SQN. + type: object + properties: + sqnScheme: + $ref: '#/components/schemas/SqnScheme' + sqn: + type: string + pattern: '^[A-Fa-f0-9]{12}$' + lastIndexes: + type: object + additionalProperties: + type: integer + minimum: 0 + description: A map(list of key-value pairs) where type of node serves as key + indLength: + type: integer + minimum: 0 + difSign: + $ref: '#/components/schemas/Sign' + + SqnScheme: + description: Scheme for generation of Sequence Numbers. + anyOf: + - type: string + enum: + - GENERAL + - NON_TIME_BASED + - TIME_BASED + - type: string + Sign: + description: Sign of the DIF value. + type: string + enum: + - POSITIVE + - NEGATIVE + VarPlmnId: + description: PLMN Id (MCC, MNC) or SNPN Id (MCC, MNC, NID). + type: string + pattern: '^[0-9]{5,6}(-[A-Fa-f0-9]{11})?$' + DatasetNames: + description: The list of names of data sets. + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 1 + uniqueItems: true + DataSetName: + description: The name of data set. + anyOf: + - type: string + enum: + - AM + - SMF_SEL + - SMS_SUB + - SM + - TRACE + - SMS_MNG + - LCS_PRIVACY + - LCS_MO + - LCS_BCA + - V2X + - PROSE + - ODB + - EE_PROF + - PP_PROF + - NIDD_AUTH + - USER_CONSENT + - MBS + - type: string + ProvisionedDataSets: + description: Contains the provisioned data sets. + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + $ref: '#/components/schemas/SmSubsData' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + lcsBcaData: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + v2xData: + $ref: '#/components/schemas/V2xSubscriptionData' + proseData: + $ref: '#/components/schemas/ProseSubscriptionData' + odbData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbData' + eeProfileData: + $ref: '#/components/schemas/EeProfileData' + ppProfileData: + $ref: '#/components/schemas/PpProfileData' + niddAuthData: + $ref: '#/components/schemas/AuthorizationData' + mbsSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/MbsSubscriptionData' + + AccessAndMobilitySubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/AccessAndMobilitySubscriptionData' + SmfSelectionSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmfSelectionSubscriptionData' + VarSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + Dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + SmSubsData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmSubsData' + Amf3GppAccessRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/Amf3GppAccessRegistration' + AmfNon3GppAccessRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/AmfNon3GppAccessRegistration' + SmfRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/SmfRegistration' + SmsfRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/SmsfRegistration' + LocationInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/LocationInfo' + SmsManagementSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmsManagementSubscriptionData' + SmsSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SmsSubscriptionData' + LcsPrivacyData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsPrivacyData' + LcsMoData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsMoData' + AuthorizationData: + description: NIDD Authorization Information + required: + - authorizationData + properties: + authorizationData: + type: array + items: + $ref: 'TS29503_Nudm_NIDDAU.yaml#/components/schemas/UserIdentifier' + minItems: 1 + uniqueItems: true + allowedDnnList: + type: array + items: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + allowedSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + allowedMtcProviders: + type: array + items: + $ref: '#/components/schemas/MtcProvider' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + EnhancedCoverageRestrictionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/EnhancedCoverageRestrictionData' + V2xSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/V2xSubscriptionData' + ProseSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ProseSubscriptionData' + UcSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/UcSubscriptionData' + LcsBroadcastAssistanceTypesData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsBroadcastAssistanceTypesData' + OperatorSpecificDataContainer: + description: Container for operator specific data. + type: object + required: + - dataType + - value + properties: + dataType: + type: string + enum: + - string + - integer + - number + - boolean + - object + - array + dataTypeDefinition: + type: string + value: + oneOf: + - type: string + - type: integer + - type: number + - type: boolean + - type: object + - type: array + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + + AuthMethod: + description: Contains the Authentication Method. + anyOf: + - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - EAP_TTLS + - NONE + - type: string + PpData: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpData' + EeSubscription: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EeSubscription' + VarUeGroupId: + description: UE group Id or any UE. + type: string + pattern: '^(extgroupid-[^@]+@[^@]+|anyUE)$' + SdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + SmfRegList: + description: The list of all the SMF registrations of a UE. + type: array + items: + $ref: '#/components/schemas/SmfRegistration' + SubscriptionDataSubscriptions: + description: A subscription to notifications. + type: object + required: + - monitoredResourceUris + - callbackReference + properties: + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + originalCallbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + hssSubscriptionInfo: + $ref: '#/components/schemas/HssSubscriptionInfo' + subscriptionId: + type: string + uniqueSubscription: + type: boolean + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + DataChangeNotify: + description: Container for data which have changed and notification was requested when changed. + type: object + properties: + originalCallbackReference: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + notifyItems: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotifyItem' + minItems: 1 + sdmSubscription: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + additionalSdmSubscriptions: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SdmSubscription' + minItems: 1 + subscriptionDataSubscriptions: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + + IdentityData: + description: Identity data corresponds to the provided ueId. + type: object + properties: + supiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + allowedAfIds: + type: array + items: + type: string + minItems: 1 + applicationPortIds: + description: A map (list of key-value pairs where AppPortId serves as key) of GPSIs. + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minProperties: 1 + + SorData: + description: Used to store the status of the latest SOR data update. + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + sorXmacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + sorMacIue: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SorMac' + meSupportOfSorCmci: + type: boolean + required: + - provisioningTime + - ueUpdateStatus + + UpuData: + description: Used to store the status of the latest UPU data update. + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + upuXmacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + upuMacIue: + $ref: 'TS29509_Nausf_UPUProtection.yaml#/components/schemas/UpuMac' + required: + - provisioningTime + - ueUpdateStatus + + NssaiAckData: + description: Used to store the status of the latest NSSAI data update. + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + required: + - provisioningTime + - ueUpdateStatus + + CagAckData: + description: Used to store the status of the latest CAG data update. + type: object + properties: + provisioningTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueUpdateStatus: + $ref: '#/components/schemas/UeUpdateStatus' + required: + - provisioningTime + - ueUpdateStatus + + UeUpdateStatus: + description: Status of the procedure. + type: string + enum: + - NOT_SENT + - SENT_NO_ACK_REQUIRED + - WAITING_FOR_ACK + - ACK_RECEIVED + - NEGATIVE_ACK_RECEIVED + + EeProfileData: + description: Event Exposure Profile Data. + type: object + properties: + restrictedEventTypes: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EventType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + allowedMtcProvider: + description: A map (list of key-value pairs where EventType serves as key) of MTC provider lists. In addition to defined EventTypes, the key value "ALL" may be used to identify a map entry which contains a list of MtcProviders that are allowed monitoring all Event Types. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/MtcProvider' + minItems: 1 + minProperties: 1 + iwkEpcRestricted: + type: boolean + default: false + imsi: + type: string + pattern: '^[0-9]{5,15}$' + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + AmfSubscriptionInfo: + description: Information the UDR stores and retrieves related to active subscriptions at the AMF(s). + type: object + required: + - amfInstanceId + - subscriptionId + properties: + amfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subsChangeNotifyCorrelationId: + type: string + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + + ContextDatasetNames: + description: The name of context data set. + type: array + items: + $ref: '#/components/schemas/ContextDataSetName' + minItems: 2 + uniqueItems: true + ContextDataSetName: + anyOf: + - type: string + enum: + - AMF_3GPP + - AMF_NON_3GPP + - SDM_SUBSCRIPTIONS + - EE_SUBSCRIPTIONS + - SMSF_3GPP + - SMSF_NON_3GPP + - SUBS_TO_NOTIFY + - SMF_REG + - IP_SM_GW + - ROAMING_INFO + - PEI_INFO + - type: string + ContextDataSets: + description: Contains the context data sets. + type: object + properties: + amf3Gpp: + $ref: '#/components/schemas/Amf3GppAccessRegistration' + amfNon3Gpp: + $ref: '#/components/schemas/AmfNon3GppAccessRegistration' + sdmSubscriptions: + type: array + items: + $ref: '#/components/schemas/SdmSubscription' + minItems: 1 + eeSubscriptions: + type: array + items: + $ref: '#/components/schemas/EeSubscription' + minItems: 1 + smsf3GppAccess: + $ref: '#/components/schemas/SmsfRegistration' + smsfNon3GppAccess: + $ref: '#/components/schemas/SmsfRegistration' + subscriptionDataSubscriptions: + type: array + items: + $ref: '#/components/schemas/SubscriptionDataSubscriptions' + minItems: 1 + smfRegistrations: + $ref: '#/components/schemas/SmfRegList' + ipSmGw: + $ref: '#/components/schemas/IpSmGwRegistration' + roamingInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/RoamingInfoUpdate' + peiInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/PeiUpdateInfo' + + IpSmGwRegistration: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/IpSmGwRegistration' + + MessageWaitingData: + description: Message Waiting Data list. + type: object + properties: + mwdList: + type: array + items: + $ref: '#/components/schemas/SmscData' + minItems: 1 + + SmscData: + description: Addresses of SM-Service Center entities with SMS wating to be delivered to the UE. + type: object + anyOf: + - required: [ smscMapAddress ] + - required: [ smscDiameterAddress ] + properties: + smscMapAddress: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/E164Number' + smscDiameterAddress: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/NetworkNodeDiameterAddress' + + SmfSubscriptionInfo: + description: Information related to active subscriptions at the SMF(s) + type: object + required: + - smfSubscriptionList + properties: + smfSubscriptionList: + type: array + items: + $ref: '#/components/schemas/SmfSubscriptionItem' + minItems: 1 + + SmfSubscriptionItem: + description: Contains info about a single SMF event subscription + type: object + required: + - smfInstanceId + - subscriptionId + properties: + smfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + + MtcProvider: + description: MTC provider information. + type: object + properties: + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + afId: + type: string + + HssSubscriptionInfo: + description: Information related to active subscriptions at the HSS(s) + type: object + required: + - hssSubscriptionList + properties: + hssSubscriptionList: + type: array + items: + $ref: '#/components/schemas/HssSubscriptionItem' + minItems: 1 + + HssSubscriptionItem: + description: Contains info about a single HSS event subscription + type: object + required: + - hssInstanceId + - subscriptionId + properties: + hssInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + contextInfo: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ContextInfo' + + EeGroupProfileData: + type: object + properties: + restrictedEventTypes: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EventType' + allowedMtcProvider: + description: A map (list of key-value pairs where EventType serves as key) of MTC provider lists. In addition to defined EventTypes, the key value "ALL" may be used to identify a map entry which contains a list of MtcProviders that are allowed monitoring all Event Types. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/MtcProvider' + minItems: 1 + minProperties: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + iwkEpcRestricted: + type: boolean + default: false + extGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + hssGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + Pp5gVnGroupProfileData: + type: object + properties: + allowedMtcProviders: + description: A map (list of key-value pairs where external VN group identifier serves as key) of AllowedMtcProviderInfo lists. In addition to defined external VN group identifier, the key value "ALL" may be used to identify a map entry which contains a list of AllowedMtcProviderInfo that are allowed operating all the external group identifiers. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/AllowedMtcProviderInfo' + minItems: 1 + minProperties: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + PpProfileData: + type: object + properties: + allowedMtcProviders: + description: A map (list of key-value pairs where PpDataType serves as key) of AllowedMtcProviderInfo lists. In addition to defined PpDataType, the key value "ALL" may be used to identify a map entry which contains a list of AllowedMtcProviderInfo that are allowed to provision all types of the PP data for the user using UDM ParameterProvision service. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/AllowedMtcProviderInfo' + minItems: 1 + minProperties: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + AllowedMtcProviderInfo: + type: object + properties: + mtcProviderInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + afId: + type: string + + PpDataType: + anyOf: + - type: string + enum: + - COMMUNICATION_CHARACTERISTICS + - EXPECTED_UE_BEHAVIOUR + - EC_RESTRICTION + - ACS_INFO + - TRACE + - STN_SR + - LCS_PRIVACY + - SOR_INFO + - type: string + + GroupIdentifiers: + description: External or Internal Group Identifier with a list of group members + type: object + properties: + extGroupId: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + intGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + ueIdList: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/UeId' + minItems: 1 + allowedAfIds: + type: array + items: + type: string + minItems: 1 + + NiddAuthorizationInfo: + description: Information related to active NIDD Authorizations + type: object + required: + - niddAuthorizationList + properties: + niddAuthorizationList: + type: array + items: + $ref: 'TS29503_Nudm_NIDDAU.yaml#/components/schemas/AuthorizationInfo' + minItems: 1 + + PpDataEntryList: + description: Contains a list of the Provisioned Parameters entries + type: object + properties: + ppDataEntryList: + type: array + items: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/PpDataEntry' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + UeSubscribedDataSets: + description: Contains the subscribed data sets of a UE. + type: object + properties: + amData: + $ref: '#/components/schemas/AccessAndMobilitySubscriptionData' + smfSelData: + $ref: '#/components/schemas/SmfSelectionSubscriptionData' + smsSubsData: + $ref: '#/components/schemas/SmsSubscriptionData' + smData: + $ref: '#/components/schemas/SmSubsData' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + smsMngData: + $ref: '#/components/schemas/SmsManagementSubscriptionData' + lcsPrivacyData: + $ref: '#/components/schemas/LcsPrivacyData' + lcsMoData: + $ref: '#/components/schemas/LcsMoData' + lcsBcaData: + $ref: '#/components/schemas/LcsBroadcastAssistanceTypesData' + v2xData: + $ref: '#/components/schemas/V2xSubscriptionData' + proseData: + $ref: '#/components/schemas/ProseSubscriptionData' + odbData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/OdbData' + eeProfileData: + $ref: '#/components/schemas/EeProfileData' + ppProfileData: + $ref: '#/components/schemas/PpProfileData' + niddAuthData: + $ref: '#/components/schemas/AuthorizationData' + ucData: + $ref: '#/components/schemas/UcSubscriptionData' + mbsSubscriptionData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/MbsSubscriptionData' + + ServiceSpecificAuthorizationInfo: + description: Information related to active Service Specific Authorizations + type: object + required: + - serviceSpecificAuthorizationList + properties: + serviceSpecificAuthorizationList: + type: array + items: + $ref: 'TS29503_Nudm_NIDDAU.yaml#/components/schemas/AuthorizationInfo' + minItems: 1 + + NfIdentifier: + type: object + required: + - nfType + properties: + nfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + EeSubscriptionExt: + allOf: + - $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/EeSubscription' + - $ref: '#/components/schemas/AdditionalEeSubsInfo' + + AdditionalEeSubsInfo: + type: object + properties: + amfSubscriptionInfoList: + type: array + items: + $ref: '#/components/schemas/AmfSubscriptionInfo' + minItems: 1 + maxItems: 2 + smfSubscriptionInfo: + $ref: '#/components/schemas/SmfSubscriptionInfo' + hssSubscriptionInfo: + $ref: '#/components/schemas/HssSubscriptionInfo' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29507_Npcf_AMPolicyControl.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29507_Npcf_AMPolicyControl.yaml new file mode 100644 index 000000000..edb3416af --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29507_Npcf_AMPolicyControl.yaml @@ -0,0 +1,808 @@ +openapi: 3.0.0 +info: + version: 1.2.0 + title: Npcf_AMPolicyControl + description: | + Access and Mobility Policy Control Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.507 V17.7.0; 5G System; Access and Mobility Policy Control Service. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.507/' +servers: + - url: '{apiRoot}/npcf-am-policy-control/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - npcf-am-policy-control +paths: + /policies: + post: + operationId: CreateIndividualAMPolicyAssociation + summary: Create individual AM policy association. + tags: + - AM Policy Associations (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyAssociationRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyAssociation' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/npcf-am-policy-control/v1/policies/{polAssoId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + policyUpdateNotification: + '{$request.body#/notificationUri}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyUpdate' + responses: + '200': + description: > + OK. The current applicable values corresponding to the policy control request + trigger is reported + content: + application/json: + schema: + $ref: '#/components/schemas/AmRequestedValueRep' + '204': + description: No Content, Notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + policyAssocitionTerminationRequestNotification: + '{$request.body#/notificationUri}/terminate': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TerminationNotification' + responses: + '204': + description: No Content, Notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /policies/{polAssoId}: + get: + operationId: ReadIndividualAMPolicyAssociation + summary: Read individual AM policy association. + tags: + - Individual AM Policy Association (Document) + parameters: + - name: polAssoId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyAssociation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + operationId: DeleteIndividualAMPolicyAssociation + summary: Delete individual AM policy association. + tags: + - Individual AM Policy Association (Document) + parameters: + - name: polAssoId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was successfully deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /policies/{polAssoId}/update: + post: + operationId: ReportObservedEventTriggersForIndividualAMPolicyAssociation + summary: > + Report observed event triggers and obtain updated policies for an individual AM + policy association. + tags: + - Individual AM Policy Association (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyAssociationUpdateRequest' + parameters: + - name: polAssoId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Updated policies are returned + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyUpdate' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-am-policy-control: Access to the Npcf_AMPolicyControl API + schemas: + PolicyAssociation: + description: Represents an individual AM Policy Association resource. + type: object + properties: + request: + $ref: '#/components/schemas/PolicyAssociationRequest' + triggers: + type: array + items: + $ref: '#/components/schemas/RequestTrigger' + minItems: 1 + description: Request Triggers that the PCF subscribes. + servAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + wlServAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + rfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + targetRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + smfSelInfo: + $ref: '#/components/schemas/SmfSelectionData' + ueAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + ueSliceMbrs: + type: array + items: + $ref: '#/components/schemas/UeSliceMbr' + minProperties: 1 + description: > + One or more UE-Slice-MBR(s) for S-NSSAI(s) of serving PLMN as part of the AMF Access and + Mobility Policy as determined by the PCF. + pras: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains the presence reporting area(s) for which reporting was requested. + The praId attribute within the PresenceInfo data type is the key of the map. + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pcfUeInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + matchPdus: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionInfo' + nullable: true + asTimeDisParam: + $ref: '#/components/schemas/AsTimeDistributionParam' + required: + - suppFeat + PolicyAssociationRequest: + description: > + Information which the NF service consumer provides when requesting the creation of a policy + association. The serviveName property corresponds to the serviceName in the main body + of the specification. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altNotifIpv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + description: Alternate or backup IPv4 Address(es) where to send Notifications. + altNotifIpv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + description: Alternate or backup IPv6 Address(es) where to send Notifications. + altNotifFqdns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + description: Alternate or backup FQDN(s) where to send Notifications. + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + accessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + userLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + servingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ratTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + groupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + servAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + wlServAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + rfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + ueAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + ueSliceMbrs: + type: array + items: + $ref: '#/components/schemas/UeSliceMbr' + minProperties: 1 + description: > + The subscribed UE Slice-MBR for each subscribed S-NSSAI of the home PLMN mapping to + a S-NSSAI of the serving PLMN Shall be provided when available. + allowedSnssais: + description: array of allowed S-NSSAIs for the 3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + targetSnssais: + description: array of target S-NSSAIs. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + mappingSnssais: + description: > + mapping of each S-NSSAI of the Allowed NSSAI to the corresponding S-NSSAI of the HPLMN. + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/MappingOfSnssai' + minItems: 1 + n3gAllowedSnssais: + description: array of allowed S-NSSAIs for the Non-3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + serviveName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + nwdafDatas: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/NwdafData' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - notificationUri + - suppFeat + - supi + PolicyAssociationUpdateRequest: + description: > + Represents information that the NF service consumer provides when requesting the update of + a policy association. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altNotifIpv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + description: Alternate or backup IPv4 Address(es) where to send Notifications. + altNotifIpv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + description: Alternate or backup IPv6 Address(es) where to send Notifications. + altNotifFqdns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + description: Alternate or backup FQDN(s) where to send Notifications. + triggers: + type: array + items: + $ref: '#/components/schemas/RequestTrigger' + minItems: 1 + description: Request Triggers that the NF service consumer observes. + servAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + wlServAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + rfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + smfSelInfo: + $ref: '#/components/schemas/SmfSelectionData' + ueAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + ueSliceMbrs: + type: array + items: + $ref: '#/components/schemas/UeSliceMbr' + minProperties: 1 + description: > + The subscribed UE-Slice-MBR for each subscribed S-NSSAI of the home PLMN mapping + to a S-NSSAI of the serving PLMN Shall be provided for the "UE_SLICE_MBR_CH" + policy control request trigger. + praStatuses: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains the UE presence status for tracking area for which changes of the UE presence + occurred. The praId attribute within the PresenceInfo data type is the key of the map. + userLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + allowedSnssais: + description: array of allowed S-NSSAIs for the 3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + targetSnssais: + description: array of target S-NSSAIs. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + mappingSnssais: + description: > + mapping of each S-NSSAI of the Allowed NSSAI to the corresponding S-NSSAI of the HPLMN. + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/MappingOfSnssai' + minItems: 1 + accessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + ratTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + n3gAllowedSnssais: + description: array of allowed S-NSSAIs for the Non-3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + nwdafDatas: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/NwdafData' + minItems: 1 + nullable: true + PolicyUpdate: + description: > + Represents updated policies that the PCF provides in a notification or in a reply to an + Update Request. + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + triggers: + type: array + items: + $ref: '#/components/schemas/RequestTrigger' + minItems: 1 + nullable: true + description: Request Triggers that the PCF subscribes. + servAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + wlServAreaRes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/WirelineServiceAreaRestriction' + rfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + targetRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + smfSelInfo: + $ref: '#/components/schemas/SmfSelectionData' + ueAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + ueSliceMbrs: + type: array + items: + $ref: '#/components/schemas/UeSliceMbr' + minProperties: 1 + description: > + One or more UE-Slice-MBR(s) for S-NSSAI(s) of serving PLMN the allowed NSSAI as + part of the AMF Access and Mobility Policy as determined by the PCF. + pras: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfoRm' + description: > + Contains the presence reporting area(s) for which reporting was requested. The praId + attribute within the PresenceInfo data type is the key of the map. + minProperties: 1 + nullable: true + pcfUeInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + matchPdus: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionInfo' + nullable: true + asTimeDisParam: + $ref: '#/components/schemas/AsTimeDistributionParam' + required: + - resourceUri + TerminationNotification: + description: > + Represents a request to terminate a policy Association that the PCF provides in a + notification. + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + cause: + $ref: '#/components/schemas/PolicyAssociationReleaseCause' + required: + - resourceUri + - cause + SmfSelectionData: + description: Represents the SMF Selection information that may be replaced by the PCF. + type: object + properties: + unsuppDnn: + type: boolean + candidates: + type: object + additionalProperties: + $ref: '#/components/schemas/CandidateForReplacement' + minProperties: 1 + description: > + Contains the list of DNNs per S-NSSAI that are candidates for replacement. The snssai + attribute within the CandidateForReplacement data type is the key of the map. + nullable: true + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + mappingSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + nullable: true + CandidateForReplacement: + description: Represents a list of candidate DNNs for replacement for an S-NSSAI. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + nullable: true + required: + - snssai + nullable: true + AmRequestedValueRep: + description: > + Represents the current applicable values corresponding to the policy control request + triggers. + type: object + properties: + userLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + praStatuses: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains the UE presence statuses for tracking areas. The praId attribute within the + PresenceInfo data type is the key of the map. + accessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + ratTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + allowedSnssais: + description: array of allowed S-NSSAIs for the 3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + n3gAllowedSnssais: + description: array of allowed S-NSSAIs for the Non-3GPP access. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + AsTimeDistributionParam: + description: Contains the 5G acess stratum time distribution parameters. + type: object + properties: + asTimeDistInd: + type: boolean + uuErrorBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + nullable: true + UeSliceMbr: + description: Contains a UE-Slice-MBR and the related information. + type: object + properties: + sliceMbr: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbr' + minProperties: 1 + description: Contains the MBR for uplink and the MBR for downlink. + servingSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + mappedHomeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - sliceMbr + - servingSnssai + nullable: true + + RequestTrigger: + anyOf: + - type: string + enum: + - LOC_CH + - PRA_CH + - SERV_AREA_CH + - RFSP_CH + - ALLOWED_NSSAI_CH + - UE_AMBR_CH + - UE_SLICE_MBR_CH + - SMF_SELECT_CH + - ACCESS_TYPE_CH + - NWDAF_DATA_CH + - TARGET_NSSAI + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - LOC_CH: Location change (tracking area). The tracking area of the UE has changed. + - PRA_CH: Change of UE presence in PRA. The AMF reports the current presence status + of the UE in a Presence Reporting Area, and notifies that the UE enters/leaves the + Presence Reporting Area. + - SERV_AREA_CH: Service Area Restriction change. The UDM notifies the AMF that the + subscribed service area restriction information has changed. + - RFSP_CH: RFSP index change. The UDM notifies the AMF that the subscribed RFSP index has + changed. + - ALLOWED_NSSAI_CH: Allowed NSSAI change. The AMF notifies that the set of UE allowed + S-NSSAIs has changed. + - UE_AMBR_CH: UE-AMBR change. The UDM notifies the AMF that the subscribed UE-AMBR has + changed. + - SMF_SELECT_CH: SMF selection information change. The UE requested for an unsupported + DNN or UE requested for a DNN within the list of DNN candidates for replacement per + S-NSSAI. + - ACCESS_TYPE_CH: Access Type change. The AMF notifies that the access type and the RAT + type combinations available in the AMF for a UE with simultaneous 3GPP and non-3GPP + connectivity has changed. + - UE_SLICE_MBR_CH: UE-Slice-MBR change. The NF service consumer notifies any changes + in the subscribed UE-Slice-MBR for each subscribed S-NSSAI of the home PLMN mapping + to a S-NSSAI of the serving PLMN. + - NWDAF_DATA_CH: NDWAF DATA CHANGE. The AMF notifies that the NWDAF instance IDs used + for the UE and/or associated Analytics IDs used for the UE and available in the AMF + have changed. + - TARGET_NSSAI: Generation of Target NSSAI. The NF service consumer notifies that the + Target NSSAI was generated. + PolicyAssociationReleaseCause: + anyOf: + - type: string + enum: + - UNSPECIFIED + - UE_SUBSCRIPTION + - INSUFFICIENT_RES + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNSPECIFIED: This value is used for unspecified reasons. + - UE_SUBSCRIPTION: This value is used to indicate that the session needs to be + terminated because the subscription of UE has changed (e.g. was removed). + - INSUFFICIENT_RES: This value is used to indicate that the server is overloaded and + needs to abort the session. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29508_Nsmf_EventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29508_Nsmf_EventExposure.yaml new file mode 100644 index 000000000..8d7d811dc --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29508_Nsmf_EventExposure.yaml @@ -0,0 +1,573 @@ +openapi: 3.0.0 +info: + version: 1.1.3 + title: Nsmf_EventExposure + description: | + Session Management Event Exposure Service. + © 2021, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.508 V16.10.0; 5G System; Session Management Event Exposure Service. + url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.508/ +servers: + - url: '{apiRoot}/nsmf-event-exposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nsmf-event-exposure +paths: + /subscriptions: + post: + operationId: CreateIndividualSubcription + summary: Create an individual subscription for event notifications from the SMF + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + responses: + '201': + description: Created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmf-event-exposure/v1/subscriptions/{subId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposureNotification' + responses: + '204': + description: No Content, Notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + afAcknowledgement: + '{request.body#/ackUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AckOfNotify' + responses: + '204': + description: No Content (successful acknowledgement) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subId}: + get: + operationId: GetIndividualSubcription + summary: Read an individual subscription for event notifications from the SMF + tags: + - IndividualSubscription (Document) + parameters: + - name: subId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + operationId: ReplaceIndividualSubcription + summary: Replace an individual subscription for event notifications from the SMF + tags: + - IndividualSubscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + parameters: + - name: subId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was successfully modified and representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/NsmfEventExposure' + '204': + description: No Content. Resource was successfully modified + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + operationId: DeleteIndividualSubcription + summary: Delete an individual subscription for event notifications from the SMF + tags: + - IndividualSubscription (Document) + parameters: + - name: subId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was successfully deleted + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nsmf-event-exposure: Access to the Nsmf_EventExposure API + schemas: + NsmfEventExposure: + description: Represents an Individual SMF Notification Subscription resource. The serviveName property corresponds to the serviceName in the main body of the specification. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + anyUeInd: + type: boolean + description: Any UE indication. This IE shall be present if the event subscription is applicable to any UE. Default value "false" is used, if not present. + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + pduSeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + subId: + $ref: '#/components/schemas/SubId' + notifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + altNotifIpv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + description: Alternate or backup IPv4 address(es) where to send Notifications. + minItems: 1 + altNotifIpv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + description: Alternate or backup IPv6 address(es) where to send Notifications. + minItems: 1 + altNotifFqdns: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn' + minItems: 1 + description: Alternate or backup FQDN(s) where to send Notifications. + eventSubs: + type: array + items: + $ref: '#/components/schemas/EventSubscription' + minItems: 1 + description: Subscribed events + ImmeRep: + type: boolean + notifMethod: + $ref: '#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + serviveName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + sampRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + grpRepTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - notifId + - notifUri + - eventSubs + NsmfEventExposureNotification: + type: object + properties: + notifId: + type: string + description: Notification correlation ID + eventNotifs: + type: array + items: + $ref: '#/components/schemas/EventNotification' + minItems: 1 + description: Notifications about Individual Events + ackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - notifId + - eventNotifs + EventSubscription: + type: object + properties: + event: + $ref: '#/components/schemas/SmfEvent' + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + dddTraDescriptors: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + dddStati: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + required: + - event + EventNotification: + type: object + properties: + event: + $ref: '#/components/schemas/SmfEvent' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + sourceDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + sourceUeIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + sourceUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + targetUeIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + targetUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + sourceTraRouting: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + targetTraRouting: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + adIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + adIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + reIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + reIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + accType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + pduSeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + dddStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + dddTraDescriptor: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + maxWaitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + commFailure: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CommunicationFailure' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + pduSessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + qfi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ethfDescs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + fDescs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ulDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + dlDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + rtDelays: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + required: + - event + - timeStamp + SubId: + type: string + format: SubId + description: Identifies an Individual SMF Notification Subscription. To enable that the value is used as part of a URI, the string shall only contain characters allowed according to the "lower-with-hyphen" naming convention defined in 3GPP TS 29.501. In an OpenAPI schema, the format shall be designated as "SubId". + AckOfNotify: + type: object + properties: + notifId: + type: string + ackResult: + $ref: 'TS29522_TrafficInfluence.yaml#/components/schemas/AfResultInfo' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + required: + - notifId + - ackResult + SmfEvent: + anyOf: + - type: string + enum: + - AC_TY_CH + - UP_PATH_CH + - PDU_SES_REL + - PLMN_CH + - UE_IP_CH + - DDDS + - COMM_FAIL + - PDU_SES_EST + - QFI_ALLOC + - QOS_MON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - AC_TY_CH: Access Type Change + - UP_PATH_CH: UP Path Change + - PDU_SES_REL: PDU Session Release + - PLMN_CH: PLMN Change + - UE_IP_CH: UE IP address change + - DDDS: Downlink data delivery status + - COMM_FAIL: Communication Failure + - PDU_SES_EST: PDU Session Establishment + - QFI_ALLOC: QFI allocation + - QOS_MON: QoS Monitoring + NotificationMethod: + anyOf: + - type: string + enum: + - PERIODIC + - ONE_TIME + - ON_EVENT_DETECTION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - PERIODIC + - ONE_TIME + - ON_EVENT_DETECTION diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_SoRProtection.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_SoRProtection.yaml new file mode 100644 index 000000000..ebcb6c81a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_SoRProtection.yaml @@ -0,0 +1,179 @@ +openapi: 3.0.0 + +info: + version: 1.2.0 + title: Nausf_SoRProtection Service + description: | + AUSF SoR Protection Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V17.6.0; 5G System; Authentication Server Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-sorprotection/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nausf-sorprotection + +paths: + /{supi}/ue-sor: + post: + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SorInfo' + required: true + responses: + '200': + description: SorSecurityInfo + content: + application/json: + schema: + $ref: '#/components/schemas/SorSecurityInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-sorprotection: Access to the Nausf_SoRProtection API + schemas: + +# +# COMPLEX TYPES: +# + + SorInfo: + description: Contains the Steering Information. + type: object + properties: + steeringContainer: + $ref: '#/components/schemas/SteeringContainer' + ackInd: + $ref: '#/components/schemas/AckInd' + sorHeader: + $ref: '#/components/schemas/SorHeader' + sorTransparentInfo: + $ref: '#/components/schemas/SorTransparentInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ackInd + + SorSecurityInfo: + description: Contains the material generated for securing of SoR. It contains at least the SoR-MAC-IAUSF and CounterSoR. + type: object + properties: + sorMacIausf: + $ref: '#/components/schemas/SorMac' + counterSor: + $ref: '#/components/schemas/CounterSor' + sorXmacIue: + $ref: '#/components/schemas/SorMac' + required: + - sorMacIausf + - counterSor + + SteeringContainer: + description: Contains the information sent to UE. + oneOf: + - type: array + items: + $ref: '#/components/schemas/SteeringInfo' + minItems: 1 + - $ref: '#/components/schemas/SecuredPacket' + + SteeringInfo: + description: Contains a combination of one PLMN identity and zero or more access technologies. + type: object + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + accessTechList: + type: array + items: + $ref: '#/components/schemas/AccessTech' + minItems: 1 + required: + - plmnId + +# +# SIMPLE TYPES: +# + + SorMac: + description: MAC value for protecting SOR procedure (SoR-MAC-IAUSF and SoR-XMAC-IUE). + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + CounterSor: + description: CounterSoR. + type: string + pattern: '^[A-Fa-f0-9]{4}$' + + AckInd: + description: Contains indication whether the acknowledgement from UE is needed. + type: boolean + + SecuredPacket: + description: Contains a secure packet. + type: string + format: byte + + SorHeader: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + SorTransparentInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + +# +# ENUMS: + + AccessTech: + description: Represents the access technology + anyOf: + - type: string + enum: + - NR + - EUTRAN_IN_WBS1_MODE_AND_NBS1_MODE + - EUTRAN_IN_NBS1_MODE_ONLY + - EUTRAN_IN_WBS1_MODE_ONLY + - UTRAN + - GSM_AND_ECGSM_IoT + - GSM_WITHOUT_ECGSM_IoT + - ECGSM_IoT_ONLY + - CDMA_1xRTT + - CDMA_HRPD + - GSM_COMPACT + - type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_UEAuthentication.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_UEAuthentication.yaml new file mode 100644 index 000000000..588445a30 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_UEAuthentication.yaml @@ -0,0 +1,740 @@ +openapi: 3.0.0 +info: + version: 1.2.2 + title: AUSF API + description: | + AUSF UE Authentication Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V17.8.0; 5G System; 3GPP TS Authentication Server services. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-auth/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nausf-auth + +paths: + /ue-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfo' + required: true + responses: + '201': + description: UEAuthenticationCtx + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/UEAuthenticationCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/ue-authentications/{authCtxId}' + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request from the AMF + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden due to serving network not authorized + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: User does not exist in the HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '501': + description: Received protection scheme is not supported by HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /ue-authentications/deregister: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationInfo' + required: true + responses: + '204': + description: Expected response to a successful removal of security context + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + /ue-authentications/{authCtxId}/5g-aka-confirmation: + put: + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConfirmationData' + responses: + '200': + description: Request processed (EAP success or Failure) + content: + application/json: + schema: + $ref: '#/components/schemas/ConfirmationDataResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + delete: + summary: Deletes the authentication result in the UDM + operationId: Delete5gAkaAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /ue-authentications/{authCtxId}/eap-session: + post: + operationId: EapAuthMethod + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EapSession' + responses: + '200': + description: Use to handle or close the EAP session + content: + application/json: + schema: + $ref: '#/components/schemas/EapSession' + + application/3gppHal+json: + schema: + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + _links: + type: object + description: 'URI : /{eapSessionUri}, a map(list of key-value pairs) where member serves as key' + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + required: + - eapPayload + - _links + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + delete: + summary: Deletes the authentication result in the UDM + operationId: DeleteEapAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /rg-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthenticationInfo' + required: true + responses: + '201': + description: RgAuthCtx + content: + application/json: + schema: + $ref: '#/components/schemas/RgAuthCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/rg-authentications/{authCtxId}' + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + description: The UE is not allowed to be authenticated + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '400': + description: Bad Request from the AMF + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: User does not exist in the HPLMN + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + + /prose-authentications: + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationInfo' + required: true + responses: + '200': + description: Successful authentication with CP-PRUK ID + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationResult' + '201': + description: ProSeAuthenticationCtx + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/ProSeAuthenticationCtx' + headers: + Location: + description: 'Contains the URI of the newly created resource according to the structure: {apiRoot}/nausf-auth/v1/prose-authentications/{authCtxId}' + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + + /prose-authentications/{authCtxId}/prose-auth: + post: + operationId: proseAuth + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeEapSession' + responses: + '200': + description: Use to handle or close the EAP session for 5G ProSe Remote UE + content: + application/json: + schema: + $ref: '#/components/schemas/ProSeEapSession' + application/3gppHal+json: + schema: + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + _links: + type: object + description: 'URI : /{eapSessionUri}, a map(list of key-value pairs) where member serves as key' + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + required: + - eapPayload + - _links + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + + delete: + summary: Deletes the authentication result in the UDM + operationId: DeleteProSeAuthenticationResult + tags: + - Authentication Result Deletion + parameters: + - name: authCtxId + in: path + required: true + schema: + type: string + responses: + '204': + description: Expected response to a successful authentication result removal + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-auth: Access to Nausf_UEAuthentication API + + schemas: + AuthenticationInfo: + description: Contains the UE id (i.e. SUCI or SUPI) and the Serving Network Name. + type: object + properties: + supiOrSuci: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + servingNetworkName: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + resynchronizationInfo: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ResynchronizationInfo' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + pattern: '^[0-9]{1,4}$' + cellCagInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + minItems: 1 + n5gcInd: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nswoInd: + type: boolean + default: false + disasterRoamingInd: + type: boolean + default: false + onboardingInd: + type: boolean + default: false + required: + - supiOrSuci + - servingNetworkName + + UEAuthenticationCtx: + description: Contains the information related to the resource generated to handle the UE authentication. It contains at least the UE id, Serving Network, the Authentication Method and related EAP information or related 5G-AKA information. + type: object + properties: + authType: + $ref: '#/components/schemas/AuthType' + 5gAuthData: + oneOf: + - $ref: '#/components/schemas/Av5gAka' + - $ref: '#/components/schemas/EapPayload' + _links: + type: object + description: A map(list of key-value pairs) where member serves as key + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + servingNetworkName: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ServingNetworkName' + required: + - authType + - 5gAuthData + - _links + + Av5gAka: + description: Contains Authentication Vector for method 5G AKA. + type: object + required: + - rand + - hxresStar + - autn + properties: + rand: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' + hxresStar: + $ref: '#/components/schemas/HxresStar' + autn: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Autn' + + ConfirmationData: + description: Contains the result of the authentication. + type: object + required: + - resStar + properties: + resStar: + $ref: '#/components/schemas/ResStar' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ConfirmationDataResponse: + description: Contains the result of the authentication + type: object + properties: + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + kseaf: + $ref: '#/components/schemas/Kseaf' + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + required: + - authResult + + EapSession: + description: Contains information related to the EAP session. + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + kSeaf: + $ref: '#/components/schemas/Kseaf' + _links: + type: object + description: A map(list of key-value pairs) where member serves as key + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + msk: + $ref: '#/components/schemas/Msk' + required: + - eapPayload + + DeregistrationInfo: + description: Contains the UE id (i.e. SUPI). + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supi + + RgAuthenticationInfo: + description: Contains the UE id (i.e. SUCI) and the authenticated indication. + type: object + properties: + suci: + $ref: '#/components/schemas/Suci' + authenticatedInd: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - suci + - authenticatedInd + + RgAuthCtx: + description: Contains the UE id (i.e. SUPI) and the authentication indication. + type: object + properties: + authResult: + $ref: '#/components/schemas/AuthResult' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + authInd: + type: boolean + default: false + required: + - authResult + + AuthResult: + description: Indicates the result of the authentication. + type: string + enum: + - AUTHENTICATION_SUCCESS + - AUTHENTICATION_FAILURE + - AUTHENTICATION_ONGOING + + EapPayload: + type: string + format: byte + description: contains an EAP packet + nullable: true + + Kseaf: + description: Contains the Kseaf. + type: string + pattern: '[A-Fa-f0-9]{64}' + + Msk: + description: Contains the Master Session Key. + type: string + pattern: '[A-Fa-f0-9]{128}' + + ResStar: + description: Contains the RES*. + type: string + pattern: '[A-Fa-f0-9]{32}' + nullable: true + + HxresStar: + description: Contains the HXRES*. + type: string + pattern: "[A-Fa-f0-9]{32}" + + Suci: + description: Contains the SUCI. + type: string + pattern: '^(suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.+|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$' + + AuthType: + description: Indicates the authentication method used. + anyOf: + - type: string + enum: + - 5G_AKA + - EAP_AKA_PRIME + - EAP_TLS + - EAP_TTLS + - type: string + + ProSeAuthenticationInfo: + description: > + Contains the UE id (i.e. SUCI) or CP-PRUK ID (in 5gPrukId IE), Relay Service Code and Nonce_1. + type: object + properties: + supiOrSuci: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupiOrSuci' + 5gPrukId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GPrukId' + relayServiceCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RelayServiceCode' + nonce1: + $ref: '#/components/schemas/Nonce1' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - relayServiceCode + - nonce1 + + ProSeAuthenticationCtx: + description: Contains the information related to the resource generated to handle the ProSe authentication. + type: object + properties: + authType: + $ref: '#/components/schemas/AuthType' + _links: + type: object + description: A map(list of key-value pairs) where member serves as key + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + proSeAuthData: + $ref: '#/components/schemas/ProSeAuthData' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - authType + - _links + - proSeAuthData + + ProSeEapSession: + description: Contains information related to the EAP session. If present the 5gPrukId IE shall carry the CP-PRUK ID. + type: object + properties: + eapPayload: + $ref: '#/components/schemas/EapPayload' + knrProSe: + $ref: '#/components/schemas/KnrProSe' + _links: + type: object + description: A map(list of key-value pairs) where member serves as key + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + authResult: + $ref: '#/components/schemas/AuthResult' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nonce2: + $ref: '#/components/schemas/Nonce2' + 5gPrukId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GPrukId' + required: + - eapPayload + + ProSeAuthData: + oneOf: + - $ref: '#/components/schemas/EapPayload' + + ProSeAuthenticationResult: + description: Successful authentication for CP-PRUK ID. + type: object + properties: + knrProSe: + $ref: '#/components/schemas/KnrProSe' + nonce2: + $ref: '#/components/schemas/Nonce2' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + KnrProSe: + description: Contains the KNR_ProSe. + type: string + pattern: '[A-Fa-f0-9]{64}' + Nonce1: + type: string + format: byte + description: contains an Nonce1 + nullable: true + + Nonce2: + type: string + format: byte + description: contains an Nonce2 + nullable: true + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_UPUProtection.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_UPUProtection.yaml new file mode 100644 index 000000000..cf21522fc --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29509_Nausf_UPUProtection.yaml @@ -0,0 +1,150 @@ +openapi: 3.0.0 +info: + version: 1.2.0 + title: Nausf_UPUProtection Service + description: | + AUSF UPU Protection Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.509 V17.6.0; 5G System; Authentication Server Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.509' + +servers: + - url: '{apiRoot}/nausf-upuprotection/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nausf-upuprotection + +paths: + /{supi}/ue-upu: + post: + parameters: + - name: supi + in: path + description: Identifier of the UE + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpuInfo' + required: true + responses: + '200': + description: UpuSecurityInfo + content: + application/json: + schema: + $ref: '#/components/schemas/UpuSecurityInfo' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nausf-upuprotection: Access to the Nausf_UPUProtection API + + schemas: + +# +# COMPLEX TYPES: +# + + UpuInfo: + description: Contains the UE parameters update Information. + type: object + properties: + upuDataList: + type: array + items: + $ref: '#/components/schemas/UpuData' + minItems: 1 + upuHeader: + $ref: '#/components/schemas/UpuHeader' + upuAckInd: + $ref: '#/components/schemas/UpuAckInd' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + upuTransparentInfo: + $ref: '#/components/schemas/UpuTransparentInfo' + required: + - upuDataList + - upuAckInd + + UpuSecurityInfo: + description: Contains the material generated for securing of UPU. It contains at least the UPU-MAC-IAUSF and CounterUPU. + type: object + properties: + upuMacIausf: + $ref: '#/components/schemas/UpuMac' + counterUpu: + $ref: '#/components/schemas/CounterUpu' + upuXmacIue: + $ref: '#/components/schemas/UpuMac' + required: + - upuMacIausf + - counterUpu + + UpuData: + description: Contains UE parameters update data set (e.g., the updated Routing ID Data or the Default configured NSSAI). + type: object + properties: + secPacket: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SecuredPacket' + defaultConfNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + routingId: + $ref: 'TS29544_Nspaf_SecuredPacket.yaml#/components/schemas/RoutingId' + +# +# SIMPLE TYPES: +# + + UpuMac: + description: MAC value for protecting UPU procedure (UPU-MAC-IAUSF and UPU-MAC-IUE). + type: string + pattern: '^[A-Fa-f0-9]{32}$' + + CounterUpu: + description: CounterUPU. + type: string + pattern: '^[A-Fa-f0-9]{4}$' + + UpuAckInd: + description: Contains the indication of whether the acknowledgement from UE is needed. + type: boolean + + UpuHeader: + description: Contains the "UPU Header" IE as specified in clause 9.11.3.53A of 3GPP TS 24.501 (octet 4), encoded as 2 hexadecimal characters. + type: string + pattern: '^[A-Fa-f0-9]{2}$' + + UpuTransparentInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_AccessToken.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_AccessToken.yaml new file mode 100644 index 000000000..331118b9e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_AccessToken.yaml @@ -0,0 +1,309 @@ +openapi: 3.0.0 + +info: + version: '1.2.1' + title: 'NRF OAuth2' + description: | + NRF OAuth2 Authorization. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V17.7.0; 5G System; Network Function Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +paths: + /oauth2/token: + post: + summary: Access Token Request + operationId: AccessTokenRequest + tags: + - Access Token Request + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/AccessTokenReq' + encoding: + requesterPlmn: + contentType: application/json + requesterPlmnList: + contentType: application/json + requesterSnssaiList: + contentType: application/json + requesterSnpnList: + contentType: application/json + targetPlmn: + contentType: application/json + targetSnpn: + contentType: application/json + targetSnssaiList: + contentType: application/json + targetNsiList: + style: form + explode: true + required: true + responses: + '200': + description: Successful Access Token Request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenRsp' + headers: + Cache-Control: + $ref: '#/components/headers/cache-control' + Pragma: + $ref: '#/components/headers/pragma' + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + description: Error in the Access Token Request + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenErr' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + headers: + Cache-Control: + $ref: '#/components/headers/cache-control' + Pragma: + $ref: '#/components/headers/pragma' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + headers: + cache-control: + required: true + schema: + type: string + enum: + - no-store + pragma: + required: true + schema: + type: string + enum: + - no-cache + + schemas: + AccessTokenReq: + description: Contains information related to the access token request + type: object + required: + - grant_type + - nfInstanceId + - scope + properties: + grant_type: + type: string + enum: + - client_credentials + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + targetNfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + scope: + type: string + pattern: '^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$' + targetNfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + requesterPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + requesterPlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 2 + requesterSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + requesterFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + requesterSnpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + targetPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + targetSnpn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + targetSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + targetNsiList: + type: array + items: + type: string + minItems: 1 + targetNfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + targetNfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + hnrfAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + sourceNfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + AccessTokenRsp: + description: Contains information related to the access token response + type: object + required: + - access_token + - token_type + properties: + access_token: + type: string + description: > + JWS Compact Serialized representation of JWS signed JSON object (AccessTokenClaims) + token_type: + type: string + enum: + - Bearer + expires_in: + type: integer + scope: + type: string + pattern: '^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$' + + AccessTokenClaims: + description: The claims data structure for the access token + type: object + required: + - iss + - sub + - aud + - scope + - exp + properties: + iss: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + sub: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + aud: + anyOf: + - $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + scope: + type: string + pattern: '^([a-zA-Z0-9_:-]+)( [a-zA-Z0-9_:-]+)*$' + exp: + type: integer + consumerPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + consumerSnpnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + producerPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + producerSnpnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + producerSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + producerNsiList: + type: array + items: + type: string + minItems: 1 + producerNfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + producerNfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + sourceNfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + AccessTokenErr: + description: Error returned in the access token response message + type: object + required: + - error + properties: + error: + type: string + enum: + - invalid_request + - invalid_client + - invalid_grant + - unauthorized_client + - unsupported_grant_type + - invalid_scope + error_description: + type: string + error_uri: + type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_Bootstrapping.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_Bootstrapping.yaml new file mode 100644 index 000000000..5499511e9 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_Bootstrapping.yaml @@ -0,0 +1,122 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'NRF Bootstrapping' + description: | + NRF Bootstrapping. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V17.6.0; 5G System; Network Function Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +paths: + /bootstrapping: + get: + summary: Bootstrapping Info Request + operationId: BootstrappingInfoRequest + tags: + - Bootstrapping Request + parameters: + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 + schema: + type: string + responses: + '200': + description: Successful Bootstrapping Request + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/BootstrappingInfo' + headers: + Cache-Control: + description: Cache-Control containing max-age, described in IETF RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + BootstrappingInfo: + description: Information returned by NRF in the bootstrapping response message + type: object + required: + - _links + properties: + status: + $ref: '#/components/schemas/Status' + _links: + type: object + description: > + Map of link objects where the keys are the link relations defined in + 3GPP TS 29.510 clause 6.4.6.3.3 + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + nrfFeatures: + type: object + description: > + Map of features supported by the NRF, where the keys are the NRF services + as defined in 3GPP TS 29.510 clause 6.1.6.3.11 + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + minProperties: 1 + oauth2Required: + type: object + description: > + Map indicating whether the NRF requires Oauth2-based authorization for accessing + its services. The key of the map shall be the name of an NRF service, + e.g. "nnrf-nfm" or "nnrf-disc" + additionalProperties: + type: boolean + minProperties: 1 + nrfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nrfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + Status: + description: Overal status of the NRF + anyOf: + - type: string + enum: + - OPERATIVE + - NON_OPERATIVE + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_NFDiscovery.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_NFDiscovery.yaml new file mode 100644 index 000000000..f890e6403 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_NFDiscovery.yaml @@ -0,0 +1,2055 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'NRF NFDiscovery Service' + description: | + NRF NFDiscovery Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V17.8.0; 5G System; Network Function Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +servers: + - url: '{apiRoot}/nnrf-disc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - nnrf-disc + +paths: + /nf-instances: + get: + summary: Search a collection of NF Instances + operationId: SearchNFInstances + tags: + - NF Instances (Store) + parameters: + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: target-nf-type + in: query + description: Type of the target NF + required: true + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - name: requester-nf-type + in: query + description: Type of the requester NF + required: true + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - name: preferred-collocated-nf-types + in: query + description: collocated NF types that candidate NFs should preferentially support + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/CollocatedNfType' + minItems: 1 + style: form + explode: false + - name: requester-nf-instance-id + in: query + description: NfInstanceId of the requester NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: service-names + in: query + description: Names of the services offered by the NF + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + minItems: 1 + uniqueItems: true + style: form + explode: false + - name: requester-nf-instance-fqdn + in: query + description: FQDN of the requester NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: target-plmn-list + in: query + description: > + Id of the PLMN of either the target NF, or in SNPN scenario the Credentials Holder + in the PLMN + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + - name: requester-plmn-list + in: query + description: Id of the PLMN where the NF issuing the Discovery request is located + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + - name: target-nf-instance-id + in: query + description: Identity of the NF instance being discovered + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: target-nf-fqdn + in: query + description: FQDN of the NF instance being discovered + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: hnrf-uri + in: query + description: Uri of the home NRF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + - name: snssais + in: query + description: Slice info of the target NF + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: requester-snssais + in: query + description: Slice info of the requester NF + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + - name: plmn-specific-snssai-list + in: query + description: PLMN specific Slice info of the target NF + content: + application/json: + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + - name: requester-plmn-specific-snssai-list + in: query + description: PLMN-specific slice info of the NF issuing the Discovery request + content: + application/json: + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + - name: dnn + in: query + description: Dnn supported by the BSF, SMF or UPF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: ipv4-index + in: query + description: The IPv4 Index supported by the candidate UPF. + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpIndex' + - name: ipv6-index + in: query + description: The IPv6 Index supported by the candidate UPF. + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpIndex' + - name: nsi-list + in: query + description: NSI IDs that are served by the services being discovered + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: smf-serving-area + in: query + schema: + type: string + - name: mbsmf-serving-area + in: query + schema: + type: string + - name: tai + in: query + description: Tracking Area Identity + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + - name: amf-region-id + in: query + description: AMF Region Identity + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' + - name: amf-set-id + in: query + description: AMF Set Identity + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfSetId' + - name: guami + in: query + description: Guami used to search for an appropriate AMF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + - name: supi + in: query + description: SUPI of the user + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: ue-ipv4-address + in: query + description: IPv4 address of the UE + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ip-domain + in: query + description: IP domain of the UE, which supported by BSF + schema: + type: string + - name: ue-ipv6-prefix + in: query + description: IPv6 prefix of the UE + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: pgw-ind + in: query + description: Combined PGW-C and SMF or a standalone SMF + schema: + type: boolean + - name: preferred-pgw-ind + in: query + description: Indicates combined PGW-C+SMF or standalone SMF are preferred + schema: + type: boolean + - name: pgw + in: query + description: PGW FQDN of a combined PGW-C and SMF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: pgw-ip + in: query + description: PGW IP Address of a combined PGW-C and SMF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + - name: gpsi + in: query + description: GPSI of the user + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: external-group-identity + in: query + description: external group identifier of the user + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + - name: internal-group-identity + in: query + description: internal group identifier of the user + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: pfd-data + in: query + description: PFD data + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PfdData' + - name: data-set + in: query + description: data set supported by the NF + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DataSetId' + - name: routing-indicator + in: query + description: routing indicator in SUCI + schema: + type: string + pattern: '^[0-9]{1,4}$' + - name: group-id-list + in: query + description: Group IDs of the NFs being discovered + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + minItems: 1 + style: form + explode: false + - name: dnai-list + in: query + description: Data network access identifiers of the NFs being discovered + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + style: form + explode: false + - name: pdu-session-types + in: query + description: list of PDU Session Type required to be supported by the target NF + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + style: form + explode: false + - name: event-id-list + in: query + description: > + Analytics event(s) requested to be supported by the Nnwdaf_AnalyticsInfo service + schema: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + minItems: 1 + style: form + explode: false + - name: nwdaf-event-list + in: query + description: > + Analytics event(s) requested to be supported by the Nnwdaf_EventsSubscription service. + schema: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + minItems: 1 + style: form + explode: false + - name: supported-features + in: query + description: Features required to be supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: upf-iwk-eps-ind + in: query + description: UPF supporting interworking with EPS or not + schema: + type: boolean + - name: chf-supported-plmn + in: query + description: PLMN ID supported by a CHF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: preferred-locality + in: query + description: preferred target NF location + schema: + type: string + - name: access-type + in: query + description: AccessType supported by the target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + - name: limit + in: query + description: Maximum number of NFProfiles to return in the response + required: false + schema: + type: integer + minimum: 1 + - name: required-features + in: query + description: Features required to be supported by the target NF + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + minItems: 1 + style: form + explode: false + - name: complex-query + in: query + description: the complex query condition expression + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ComplexQuery' + - name: max-payload-size + in: query + description: Maximum payload size of the response expressed in kilo octets + required: false + schema: + type: integer + maximum: 2000 + default: 124 + - name: max-payload-size-ext + in: query + description: > + Extended query for maximum payload size of the response expressed in kilo octets + required: false + schema: + type: integer + default: 124 + - name: atsss-capability + in: query + description: ATSSS Capability + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AtsssCapability' + - name: upf-ue-ip-addr-ind + in: query + description: UPF supporting allocating UE IP addresses/prefixes + schema: + type: boolean + - name: client-type + in: query + description: Requested client type served by the NF + content: + application/json: + schema: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + - name: lmf-id + in: query + description: LMF identification to be discovered + content: + application/json: + schema: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + - name: an-node-type + in: query + description: Requested AN node type served by the NF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AnNodeType' + - name: rat-type + in: query + description: Requested RAT type served by the NF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + - name: preferred-tai + in: query + description: preferred Tracking Area Identity + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + - name: preferred-nf-instances + in: query + description: preferred NF Instances + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + style: form + explode: false + - name: If-None-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 + schema: + type: string + - name: target-snpn + in: query + description: Target SNPN Identity, or the Credentials Holder in the SNPN + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: requester-snpn-list + in: query + description: SNPN ID(s) of the NF instance issuing the Discovery request + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + - name: af-ee-data + in: query + description: NEF exposured by the AF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AfEventExposureData' + - name: w-agf-info + in: query + description: UPF collocated with W-AGF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/WAgfInfo' + - name: tngf-info + in: query + description: UPF collocated with TNGF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TngfInfo' + - name: twif-info + in: query + description: UPF collocated with TWIF + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TwifInfo' + - name: target-nf-set-id + in: query + description: Target NF Set ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: target-nf-service-set-id + in: query + description: Target NF Service Set ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + - name: nef-id + in: query + description: NEF ID + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefId' + - name: notification-type + in: query + description: Notification Type + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NotificationType' + - name: n1-msg-class + in: query + description: N1 Message Class + schema: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N1MessageClass' + - name: n2-info-class + in: query + description: N2 Information Class + schema: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InformationClass' + - name: serving-scope + in: query + description: areas that can be served by the target NF + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: imsi + in: query + description: IMSI of the requester UE to search for an appropriate NF (e.g. HSS) + schema: + type: string + pattern: '^[0-9]{5,15}$' + - name: ims-private-identity + in: query + description: IMPI of the requester UE to search for a target HSS + schema: + type: string + - name: ims-public-identity + in: query + description: IMS Public Identity of the requester UE to search for a target HSS + schema: + type: string + - name: msisdn + in: query + description: MSISDN of the requester UE to search for a target HSS + schema: + type: string + - name: preferred-api-versions + in: query + description: Preferred API version of the services to be discovered + content: + application/json: + schema: + description: A map (list of key-value pairs) where ServiceName serves as key + type: object + additionalProperties: + type: string + minProperties: 1 + - name: v2x-support-ind + in: query + description: PCF supports V2X + schema: + type: boolean + - name: redundant-gtpu + in: query + description: UPF supports redundant gtp-u to be discovered + schema: + type: boolean + - name: redundant-transport + in: query + description: UPF supports redundant transport path to be discovered + schema: + type: boolean + - name: ipups + in: query + description: UPF which is configured for IPUPS functionality to be discovered + schema: + type: boolean + - name: scp-domain-list + in: query + description: SCP domains the target SCP or SEPP belongs to + schema: + type: array + items: + type: string + minItems: 1 + style: form + explode: false + - name: address-domain + in: query + description: Address domain reachable through the SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: ipv4-addr + in: query + description: IPv4 address reachable through the SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ipv6-prefix + in: query + description: IPv6 prefix reachable through the SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: served-nf-set-id + in: query + description: NF Set ID served by the SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: remote-plmn-id + in: query + description: Id of the PLMN reachable through the SCP or SEPP + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: remote-snpn-id + in: query + description: Id of the SNPN reachable through the SCP or SEPP + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + - name: data-forwarding + in: query + description: UPF Instance(s) configured for data forwarding are requested + schema: + type: boolean + - name: preferred-full-plmn + in: query + description: NF Instance(s) serving the full PLMN are preferred + schema: + type: boolean + - name: requester-features + in: query + description: > + Features supported by the NF Service Consumer that is invoking + the Nnrf_NFDiscovery service + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: realm-id + in: query + description: realm-id to search for an appropriate UDSF + schema: + type: string + - name: storage-id + in: query + description: storage-id to search for an appropriate UDSF + schema: + type: string + - name: vsmf-support-ind + in: query + description: V-SMF capability supported by the target NF instance(s) + schema: + type: boolean + - name: ismf-support-ind + in: query + description: I-SMF capability supported by the target NF instance(s) + schema: + type: boolean + - name: nrf-disc-uri + in: query + description: Uri of the NRF holding the NF profile of a target NF Instance + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + - name: preferred-vendor-specific-features + in: query + description: Preferred vendor specific features of the services to be discovered + content: + application/json: + schema: + description: A map (list of key-value pairs) where ServiceName serves as key + type: object + additionalProperties: + description: > + A map (list of key-value pairs) where IANA-assigned SMI Network Management + Private Enterprise Codes serves as key + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + minProperties: 1 + - name: preferred-vendor-specific-nf-features + in: query + description: Preferred vendor specific features of the network function to be discovered + content: + application/json: + schema: + description: > + A map (list of key-value pairs) where IANA-assigned SMI Network Management Private + Enterprise Codes serves as key + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + - name: required-pfcp-features + in: query + description: PFCP features required to be supported by the target UPF + schema: + type: string + - name: home-pub-key-id + in: query + description: > + Indicates the Home Network Public Key ID which shall be able to be served + by the NF instance + schema: + type: integer + - name: prose-support-ind + in: query + description: PCF supports ProSe Capability + schema: + type: boolean + - name: analytics-aggregation-ind + in: query + description: analytics aggregation is supported by NWDAF or not + schema: + type: boolean + - name: serving-nf-set-id + in: query + description: NF Set Id served by target NF + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + - name: serving-nf-type + in: query + description: NF type served by the target NF + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - name: ml-analytics-info-list + in: query + description: Lisf of ML Analytics Filter information of Nnwdaf_MLModelProvision service + content: + application/json: + schema: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MlAnalyticsInfo' + minItems: 1 + - name: analytics-metadata-prov-ind + in: query + description: analytics matadata provisioning is supported by NWDAF or not + schema: + type: boolean + - name: nsacf-capability + in: query + description: the service capability supported by the target NSACF + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NsacfCapability' + - name: mbs-session-id-list + in: query + description: List of MBS Session ID(s) + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + minItems: 1 + - name: area-session-id + in: query + description: Area Session ID + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AreaSessionId' + - name: gmlc-number + in: query + description: The GMLC Number supported by the GMLC + schema: + type: string + pattern: '^[0-9]{5,15}$' + - name: upf-n6-ip + in: query + description: N6 IP address of PSA UPF supported by the EASDF + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + - name: tai-list + in: query + description: Tracking Area Identifiers of the NFs being discovered + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + - name: preferences-precedence + in: query + description: > + Indicates the precedence of the preference query parameters (from higher to lower) + schema: + type: array + items: + type: string + minItems: 2 + style: form + explode: false + - name: support-onboarding-capability + in: query + description: Indicating the support for onboarding. + schema: + type: boolean + default: false + - name: uas-nf-functionality-ind + in: query + description: UAS NF functionality is supported by NEF or not + schema: + type: boolean + - name: v2x-capability + in: query + description: indicates the V2X capability that the target PCF needs to support. + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/V2xCapability' + - name: prose-capability + in: query + description: indicates the ProSe capability that the target PCF needs to support. + content: + application/json: + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ProSeCapability' + - name: shared-data-id + in: query + description: Identifier of shared data stored in the NF being discovered + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SharedDataId' + - name: target-hni + in: query + description: Home Network Identifier query. + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: target-nw-resolution + in: query + description: Resolution of the identity of the target PLMN based on the GPSI of the UE + schema: + type: boolean + - name: exclude-nfinst-list + in: query + description: NF Instance IDs to be excluded from the NF Discovery procedure + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + style: form + explode: false + - name: exclude-nfservinst-list + in: query + description: NF service instance IDs to be excluded from the NF Discovery procedure + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NfServiceInstance' + minItems: 1 + - name: exclude-nfserviceset-list + in: query + description: NF Service Set IDs to be excluded from the NF Discovery procedure + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + style: form + explode: false + - name: exclude-nfset-list + in: query + description: NF Set IDs to be excluded from the NF Discovery procedure + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + style: form + explode: false + - name: preferred-analytics-delays + in: query + description: Preferred analytics delays supported by the NWDAF to be discovered + content: + application/json: + schema: + description: > + A map (list of key-value pairs) where EventId or NwdafEvent serves as key + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + minProperties: 1 + + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResult' + links: + search: + operationId: RetrieveStoredSearch + parameters: + searchId: $response.body#/searchId + description: > + The 'searchId' parameter returned in the response can be used as the + 'searchId' parameter in the GET request to '/searches/{searchId}' + completeSearch: + operationId: RetrieveCompleteSearch + parameters: + searchId: $response.body#/searchId + description: > + The 'searchId' parameter returned in the response can be used as the + 'searchId' parameter in the GET request to '/searches/{searchId}/complete' + headers: + Cache-Control: + description: Cache-Control containing max-age, described in IETF RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /searches/{searchId}: + get: + operationId: RetrieveStoredSearch + tags: + - Stored Search (Document) + parameters: + - $ref: '#/components/parameters/searchId' + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200' + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + + /searches/{searchId}/complete: + get: + operationId: RetrieveCompleteSearch + tags: + - Complete Stored Search (Document) + parameters: + - $ref: '#/components/parameters/searchId' + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + responses: + '200': + $ref: '#/components/responses/200' + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + + /scp-domain-routing-info: + get: + operationId: SCPDomainRoutingInfoGet + tags: + - SCP Domain Routing Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-disc + - oAuth2ClientCredentials: + - nnrf-disc + - nnrf-disc:scp-domain:read + parameters: + - name: local + in: query + description: Indication of local SCP Domain Routing Information + required: false + schema: + type: boolean + default: false + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScpDomainRoutingInformation' + headers: + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + description: Temporary Redirect + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /scp-domain-routing-info-subs: + post: + summary: Create a new subscription + operationId: ScpDomainRoutingInfoSubscribe + tags: + - SCP Domain Routing Information Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-disc + - oAuth2ClientCredentials: + - nnrf-disc + - nnrf-disc:scp-domain-subs:write + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScpDomainRoutingInfoSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScpDomainRoutingInfoSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nnrf-disc/v1/scp-domain-routing-info-subs/{subscriptionID} + required: true + schema: + type: string + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + onScpDomainRoutingInformationChange: + '{$request.body#/callbackUri}': + post: + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: Notification Payload + content: + application/json: + schema: + $ref: '#/components/schemas/ScpDomainRoutingInfoNotification' + responses: + '204': + description: Expected response to a successful callback processing + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /scp-domain-routing-info-subs/{subscriptionID}: + delete: + summary: Deletes a subscription + operationId: ScpDomainRoutingInfoUnsubscribe + tags: + - Individual SCP Domain Routing Information Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-disc + - oAuth2ClientCredentials: + - nnrf-disc + - nnrf-disc:scp-domain-subs:write + parameters: + - name: subscriptionID + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + responses: + '204': + description: Expected response to a successful subscription removal + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '/oauth2/token' + scopes: + nnrf-disc: Access to the Nnrf_NFDiscovery API + nnrf-disc:scp-domain:read: Access to read the scp-domain-routing-info resource + nnrf-disc:scp-domain-subs:write: Access to create/delete a scp-domain subscription resource + + parameters: + searchId: + name: searchId + in: path + description: Id of a stored search + required: true + schema: + type: string + + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/StoredSearchResult' + headers: + Cache-Control: + description: Cache-Control containing max-age, described in IETF RFC 7234, 5.2 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + + schemas: + + SearchResult: + description: Contains the list of NF Profiles returned in a Discovery response + type: object + required: + - nfInstances + properties: + validityPeriod: + type: integer + nfInstances: + type: array + items: + $ref: '#/components/schemas/NFProfile' + searchId: + type: string + numNfInstComplete: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + preferredSearch: + $ref: '#/components/schemas/PreferredSearch' + nrfSupportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nfInstanceList: + description: List of matching NF instances. The key of the map is the NF instance ID. + type: object + additionalProperties: + $ref: '#/components/schemas/NfInstanceInfo' + minProperties: 1 + alteredPriorityInd: + type: boolean + noProfileMatchInfo: + $ref: '#/components/schemas/NoProfileMatchInfo' + + StoredSearchResult: + description: > + Contains a complete search result (i.e. a number of discovered NF Instances), + stored by NRF as a consequence of a prior search result + type: object + required: + - nfInstances + properties: + nfInstances: + type: array + items: + $ref: '#/components/schemas/NFProfile' + + NFProfile: + description: Information of an NF Instance discovered by the NRF + type: object + required: + - nfInstanceId + - nfType + - nfStatus + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfInstanceName: + type: string + nfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + nfStatus: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFStatus' + collocatedNfInstances: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/CollocatedNfInstance' + minimum: 1 + plmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + nsiList: + type: array + items: + type: string + minItems: 1 + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + interPlmnFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + ipv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + capacity: + type: integer + minimum: 0 + maximum: 65535 + load: + type: integer + minimum: 0 + maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locality: + type: string + priority: + type: integer + minimum: 0 + maximum: 65535 + udrInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdrInfo' + udrInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdrInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdrInfo' + minProperties: 1 + udmInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdmInfo' + udmInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdmInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdmInfo' + minProperties: 1 + ausfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AusfInfo' + ausfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AusfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AusfInfo' + minProperties: 1 + amfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AmfInfo' + amfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AmfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AmfInfo' + minProperties: 1 + smfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SmfInfo' + smfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of SmfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SmfInfo' + minProperties: 1 + upfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UpfInfo' + upfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UpfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UpfInfo' + minProperties: 1 + pcfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PcfInfo' + pcfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of PcfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PcfInfo' + minProperties: 1 + bsfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/BsfInfo' + bsfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of BsfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/BsfInfo' + minProperties: 1 + chfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ChfInfo' + chfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of ChfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ChfInfo' + minProperties: 1 + udsfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdsfInfo' + udsfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdsfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/UdsfInfo' + minProperties: 1 + nwdafInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NwdafInfo' + nwdafInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of NwdafInfo + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NwdafInfo' + minProperties: 1 + nefInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NefInfo' + pcscfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of PcscfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PcscfInfo' + minProperties: 1 + hssInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of HssInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/HssInfo' + minProperties: 1 + customInfo: + type: object + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nfServicePersistence: + type: boolean + default: false + nfServices: + deprecated: true + type: array + items: + $ref: '#/components/schemas/NFService' + minItems: 1 + nfServiceList: + description: > + A map (list of key-value pairs) where serviceInstanceId serves as key of NFService + type: object + additionalProperties: + $ref: '#/components/schemas/NFService' + minProperties: 1 + defaultNotificationSubscriptions: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DefaultNotificationSubscription' + lmfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/LmfInfo' + gmlcInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/GmlcInfo' + snpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + nfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + lcHSupportInd: + type: boolean + default: false + olcHSupportInd: + type: boolean + default: false + nfSetRecoveryTimeList: + description: A map (list of key-value pairs) where NfSetId serves as key of DateTime + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minProperties: 1 + serviceSetRecoveryTimeList: + description: > + A map (list of key-value pairs) where NfServiceSetId serves as key of DateTime + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minProperties: 1 + scpDomains: + type: array + items: + type: string + minItems: 1 + scpInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ScpInfo' + seppInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/SeppInfo' + vendorId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + description: > + The key of the map is the IANA-assigned SMI Network Management Private Enterprise Codes + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + aanfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AanfInfo + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/AanfInfo' + minProperties: 1 + mfafInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MfafInfo' + easdfInfoList: + type: object + description: > + A map(list of key-value pairs) where a (unique) valid JSON string + serves as key of EasdfInfo + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/EasdfInfo' + minProperties: 1 + dccfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DccfInfo' + nsacfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of NsacfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NsacfInfo' + minProperties: 1 + mbSmfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of MbSmfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MbSmfInfo' + minProperties: 1 + tsctsfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of TsctsfInfo + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TsctsfInfo' + minProperties: 1 + mbUpfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of MbUpfInfo + type: object + additionalProperties: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MbUpfInfo' + minProperties: 1 + trustAfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TrustAfInfo' + nssaafInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NssaafInfo' + hniList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + iwmscInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IwmscInfo' + mnpfInfo: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/MnpfInfo' + + NFService: + description: > + Information of a given NF Service Instance; it is part of the NFProfile + of an NF Instance discovered by the NRF + type: object + required: + - serviceInstanceId + - serviceName + - versions + - scheme + - nfServiceStatus + properties: + serviceInstanceId: + type: string + serviceName: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/ServiceName' + versions: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFServiceVersion' + minItems: 1 + scheme: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriScheme' + nfServiceStatus: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFServiceStatus' + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + interPlmnFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + ipEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + apiPrefix: + type: string + defaultNotificationSubscriptions: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/DefaultNotificationSubscription' + minItems: 1 + capacity: + type: integer + minimum: 0 + maximum: 65535 + load: + type: integer + minimum: 0 + maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + priority: + type: integer + minimum: 0 + maximum: 65535 + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nfServiceSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/PlmnSnssai' + minItems: 1 + vendorId: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + description: > + The key of the map is the IANA-assigned SMI Network Management Private Enterprise Codes + type: object + additionalProperties: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + oauth2Required: + type: boolean + allowedOperationsPerNfType: + description: A map (list of key-value pairs) where NF Type serves as key + type: object + additionalProperties: + type: array + items: + type: string + minItems: 1 + minProperties: 1 + allowedOperationsPerNfInstance: + description: A map (list of key-value pairs) where NF Instance Id serves as key + type: object + additionalProperties: + type: array + items: + type: string + minItems: 1 + minProperties: 1 + + PreferredSearch: + description: > + Contains information on whether the returned NFProfiles match the preferred query parameters + type: object + properties: + preferredTaiMatchInd: + type: boolean + default: false + preferredFullPlmnMatchInd: + type: boolean + default: false + preferredApiVersionsMatchInd: + type: boolean + otherApiVersionsInd: + type: boolean + preferredLocalityMatchInd: + type: boolean + default: false + otherLocalityInd: + type: boolean + default: false + preferredVendorSpecificFeaturesInd: + type: boolean + default: false + preferredCollocatedNfTypeInd: + type: boolean + default: false + preferredPgwMatchInd: + type: boolean + preferredAnalyticsDelaysInd: + type: boolean + + NfInstanceInfo: + description: Contains information on an NF profile matching a discovery request + type: object + properties: + nrfDiscApiUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + preferredSearch: + $ref: '#/components/schemas/PreferredSearch' + nrfAlteredPriorities: + description: > + The key of the map is the JSON Pointer of the priority IE in the NFProfile data type + that is altered by the NRF + type: object + additionalProperties: + type: integer + minimum: 0 + maximum: 65535 + minProperties: 1 + + ScpDomainRoutingInformation: + description: SCP Domain Routing Information + type: object + required: + - scpDomainList + properties: + scpDomainList: + description: | + This IE shall contain a map of SCP domain interconnection information, where + the key of the map is a SCP domain. The value of each entry shall be the + interconnectivity information of the the SCP domain indicated by the key. + An empty map indicates that there is no SCP domain currently registered in + the NRF. + type: object + additionalProperties: + $ref: '#/components/schemas/ScpDomainConnectivity' + + ScpDomainConnectivity: + description: SCP Domain Connectivity Information + type: object + required: + - connectedScpDomainList + properties: + connectedScpDomainList: + type: array + items: + type: string + + ScpDomainRoutingInfoSubscription: + description: SCP Domain Routing Information Subscription + type: object + required: + - callbackUri + properties: + callbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reqInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + localInd: + type: boolean + default: false + + ScpDomainRoutingInfoNotification: + description: SCP Domain Routing Information Notification + type: object + required: + - routingInfo + properties: + routingInfo: + $ref: '#/components/schemas/ScpDomainRoutingInformation' + localInd: + type: boolean + default: false + + NfServiceInstance: + description: NF service instance + type: object + oneOf: + - required: [ nfInstanceId ] + - required: [ nfServiceSetId ] + properties: + serviceInstanceId: + type: string + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + + NoProfileMatchInfo: + description: Provides the reason for not finding NF matching the search criteria + type: object + required: + - reason + properties: + reason: + $ref: '#/components/schemas/NoProfileMatchReason' + queryParamCombinationList: + type: array + items: + $ref: '#/components/schemas/QueryParamCombination' + minItems: 1 + + QueryParamCombination: + description: Contains a list of Query Parameters + type: object + required: + - queryParams + properties: + queryParams: + type: array + items: + $ref: '#/components/schemas/QueryParameter' + minItems: 1 + + QueryParameter: + description: Contains the name and value of a query parameter + type: object + required: + - name + - value + properties: + name: + type: string + value: + type: string + + NoProfileMatchReason: + description: No Profile Match Reason + anyOf: + - type: string + enum: + - REQUESTER_PLMN_NOT_ALLOWED + - TARGET_NF_SUSPENDED + - TARGET_NF_UNDISCOVERABLE + - QUERY_PARAMS_COMBINATION_NO_MATCH + - UNSPECIFIED + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_NFManagement.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_NFManagement.yaml new file mode 100644 index 000000000..6bf6b44f5 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29510_Nnrf_NFManagement.yaml @@ -0,0 +1,4521 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'NRF NFManagement Service' + description: | + NRF NFManagement Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.510 V17.8.0; 5G System; Network Function Repository Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.510/' + +servers: + - url: '{apiRoot}/nnrf-nfm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - nnrf-nfm + +paths: + /nf-instances: + get: + summary: Retrieves a collection of NF Instances + operationId: GetNFInstances + tags: + - NF Instances (Store) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-nfm + - oAuth2ClientCredentials: + - nnrf-nfm + - nnrf-nfm:nf-instances:read + parameters: + - name: nf-type + in: query + description: Type of NF + required: false + schema: + $ref: '#/components/schemas/NFType' + - name: limit + in: query + description: How many items to return at one time + required: false + schema: + type: integer + minimum: 1 + - name: page-number + in: query + description: Page number where the response shall start + required: false + schema: + type: integer + minimum: 1 + - name: page-size + in: query + description: Maximum number of items in each returned page + schema: + type: integer + minimum: 1 + responses: + '200': + description: Expected response to a valid request + content: + application/3gppHal+json: + schema: + $ref: '#/components/schemas/UriList' + headers: + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + options: + summary: Discover communication options supported by NRF for NF Instances + operationId: OptionsNFInstances + tags: + - NF Instances (Store) + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/OptionsResponse' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '204': + description: No Content + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /nf-instances/{nfInstanceID}: + get: + summary: Read the profile of a given NF Instance + operationId: GetNFInstance + tags: + - NF Instance ID (Document) + security: + - {} + - oAuth2ClientCredentials: + - nnrf-nfm + - oAuth2ClientCredentials: + - nnrf-nfm + - nnrf-nfm:nf-instances:read + parameters: + - name: nfInstanceID + in: path + description: Unique ID of the NF Instance + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: requester-features + in: query + description: Features supported by the NF Service Consumer + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + headers: + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Register a new NF Instance + operationId: RegisterNFInstance + tags: + - NF Instance ID (Document) + parameters: + - name: nfInstanceID + in: path + required: true + description: Unique ID of the NF Instance to register + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + required: true + responses: + '200': + description: OK (Profile Replacement) + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nnrf-nfm/v1/nf-instances/{nfInstanceId} + required: true + schema: + type: string + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Update NF Instance profile + operationId: UpdateNFInstance + tags: + - NF Instance ID (Document) + parameters: + - name: nfInstanceID + in: path + required: true + description: Unique ID of the NF Instance to update + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: If-Match + in: header + description: Validator for conditional requests, as described in IETF RFC 7232, 3.2 + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NFProfile' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + ETag: + description: Entity Tag containing a strong validator, described in IETF RFC 7232, 2.3 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '204': + description: Expected response with empty body + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '412': + $ref: 'TS29571_CommonData.yaml#/components/responses/412' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deregisters a given NF Instance + operationId: DeregisterNFInstance + tags: + - NF Instance ID (Document) + parameters: + - name: nfInstanceID + in: path + required: true + description: Unique ID of the NF Instance to deregister + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + responses: + '204': + description: Expected response to a successful deregistration + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions: + post: + summary: Create a new subscription + operationId: CreateSubscription + tags: + - Subscriptions (Collection) + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nnrf-nfm/v1/subscriptions/{subscriptionId} + required: true + schema: + type: string + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + onNFStatusEvent: + '{$request.body#/nfStatusNotificationUri}': + post: + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: Notification Payload + content: + application/json: + schema: + $ref: '#/components/schemas/NotificationData' + responses: + '204': + description: Expected response to a successful callback processing + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: > + The URI pointing to the resource located on another NF service + consumer instance + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: > + The URI pointing to the resource located on another NF service + consumer instance + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions/{subscriptionID}: + patch: + summary: Updates a subscription + operationId: UpdateSubscription + tags: + - Subscription ID (Document) + parameters: + - name: subscriptionID + in: path + required: true + description: Unique ID of the subscription to update + schema: + type: string + pattern: '^([0-9]{5,6}-)?[^-]+$' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '204': + description: No Content + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes a subscription + operationId: RemoveSubscription + tags: + - Subscription ID (Document) + parameters: + - name: subscriptionID + in: path + required: true + description: Unique ID of the subscription to remove + schema: + type: string + pattern: '^([0-9]{5,6}-)?[^-]+$' + responses: + '204': + description: Expected response to a successful subscription removal + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RedirectResponse' + headers: + Location: + description: The URI pointing to the resource located on the redirect target NRF + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '/oauth2/token' + scopes: + nnrf-nfm: Access to the Nnrf_NFManagement API + nnrf-nfm:nf-instances:read: > + Access to read the nf-instances resource, or an individual NF Instance ID resource + + schemas: + + NFProfile: + description: Information of an NF Instance registered in the NRF + type: object + required: + - nfInstanceId + - nfType + - nfStatus + anyOf: + - required: [ fqdn ] + - required: [ ipv4Addresses ] + - required: [ ipv6Addresses ] + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfInstanceName: + type: string + nfType: + $ref: '#/components/schemas/NFType' + nfStatus: + $ref: '#/components/schemas/NFStatus' + collocatedNfInstances: + type: array + items: + $ref: '#/components/schemas/CollocatedNfInstance' + minimum: 1 + heartBeatTimer: + type: integer + minimum: 1 + plmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + snpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: '#/components/schemas/PlmnSnssai' + minItems: 1 + nsiList: + type: array + items: + type: string + minItems: 1 + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + interPlmnFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + ipv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + allowedPlmns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + allowedSnpns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + allowedNfTypes: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + allowedNfDomains: + type: array + items: + type: string + minItems: 1 + allowedNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 + capacity: + type: integer + minimum: 0 + maximum: 65535 + load: + type: integer + minimum: 0 + maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locality: + type: string + udrInfo: + $ref: '#/components/schemas/UdrInfo' + udrInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdrInfo + type: object + additionalProperties: + $ref: '#/components/schemas/UdrInfo' + minProperties: 1 + udmInfo: + $ref: '#/components/schemas/UdmInfo' + udmInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdmInfo + type: object + additionalProperties: + $ref: '#/components/schemas/UdmInfo' + minProperties: 1 + ausfInfo: + $ref: '#/components/schemas/AusfInfo' + ausfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AusfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/AusfInfo' + minProperties: 1 + amfInfo: + $ref: '#/components/schemas/AmfInfo' + amfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AmfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/AmfInfo' + minProperties: 1 + smfInfo: + $ref: '#/components/schemas/SmfInfo' + smfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of SmfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/SmfInfo' + minProperties: 1 + upfInfo: + $ref: '#/components/schemas/UpfInfo' + upfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UpfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/UpfInfo' + minProperties: 1 + pcfInfo: + $ref: '#/components/schemas/PcfInfo' + pcfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of PcfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/PcfInfo' + minProperties: 1 + bsfInfo: + $ref: '#/components/schemas/BsfInfo' + bsfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of BsfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/BsfInfo' + minProperties: 1 + chfInfo: + $ref: '#/components/schemas/ChfInfo' + chfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of ChfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/ChfInfo' + minProperties: 1 + nefInfo: + $ref: '#/components/schemas/NefInfo' + nrfInfo: + $ref: '#/components/schemas/NrfInfo' + udsfInfo: + $ref: '#/components/schemas/UdsfInfo' + udsfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of UdsfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/UdsfInfo' + minProperties: 1 + nwdafInfo: + $ref: '#/components/schemas/NwdafInfo' + nwdafInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of NwdafInfo + additionalProperties: + $ref: '#/components/schemas/NwdafInfo' + minProperties: 1 + pcscfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of PcscfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/PcscfInfo' + minProperties: 1 + hssInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of HssInfo + type: object + additionalProperties: + $ref: '#/components/schemas/HssInfo' + minProperties: 1 + customInfo: + type: object + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + nfServicePersistence: + type: boolean + default: false + nfServices: + deprecated: true + type: array + items: + $ref: '#/components/schemas/NFService' + minItems: 1 + nfServiceList: + description: > + A map (list of key-value pairs) where serviceInstanceId serves as key of NFService + type: object + additionalProperties: + $ref: '#/components/schemas/NFService' + minProperties: 1 + nfProfileChangesSupportInd: + type: boolean + default: false + writeOnly: true + nfProfileChangesInd: + type: boolean + default: false + readOnly: true + defaultNotificationSubscriptions: + type: array + items: + $ref: '#/components/schemas/DefaultNotificationSubscription' + lmfInfo: + $ref: '#/components/schemas/LmfInfo' + gmlcInfo: + $ref: '#/components/schemas/GmlcInfo' + nfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + lcHSupportInd: + type: boolean + default: false + olcHSupportInd: + type: boolean + default: false + nfSetRecoveryTimeList: + description: A map (list of key-value pairs) where NfSetId serves as key of DateTime + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minProperties: 1 + serviceSetRecoveryTimeList: + description: > + A map (list of key-value pairs) where NfServiceSetId serves as key of DateTime + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minProperties: 1 + scpDomains: + type: array + items: + type: string + minItems: 1 + scpInfo: + $ref: '#/components/schemas/ScpInfo' + seppInfo: + $ref: '#/components/schemas/SeppInfo' + vendorId: + $ref: '#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + description: > + The key of the map is the IANA-assigned SMI Network Management Private Enterprise Codes + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + aanfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of AanfInfo + additionalProperties: + $ref: '#/components/schemas/AanfInfo' + minProperties: 1 + 5gDdnmfInfo: + $ref: '#/components/schemas/5GDdnmfInfo' + mfafInfo: + $ref: '#/components/schemas/MfafInfo' + easdfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of EasdfInfo + additionalProperties: + $ref: '#/components/schemas/EasdfInfo' + minProperties: 1 + dccfInfo: + $ref: '#/components/schemas/DccfInfo' + nsacfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of NsacfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/NsacfInfo' + minProperties: 1 + mbSmfInfoList: + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of MbSmfInfo + type: object + additionalProperties: + $ref: '#/components/schemas/MbSmfInfo' + minProperties: 1 + tsctsfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of TsctsfInfo + additionalProperties: + $ref: '#/components/schemas/TsctsfInfo' + minProperties: 1 + mbUpfInfoList: + type: object + description: > + A map (list of key-value pairs) where a (unique) valid JSON string + serves as key of MbUpfInfo + additionalProperties: + $ref: '#/components/schemas/MbUpfInfo' + minProperties: 1 + trustAfInfo: + $ref: '#/components/schemas/TrustAfInfo' + nssaafInfo: + $ref: '#/components/schemas/NssaafInfo' + hniList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + iwmscInfo: + $ref: '#/components/schemas/IwmscInfo' + mnpfInfo: + $ref: '#/components/schemas/MnpfInfo' + + NFService: + description: > + Information of a given NF Service Instance; it is part of the NFProfile of an NF Instance + type: object + required: + - serviceInstanceId + - serviceName + - versions + - scheme + - nfServiceStatus + properties: + serviceInstanceId: + type: string + serviceName: + $ref: '#/components/schemas/ServiceName' + versions: + type: array + items: + $ref: '#/components/schemas/NFServiceVersion' + minItems: 1 + scheme: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriScheme' + nfServiceStatus: + $ref: '#/components/schemas/NFServiceStatus' + fqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + interPlmnFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + ipEndPoints: + type: array + items: + $ref: '#/components/schemas/IpEndPoint' + minItems: 1 + apiPrefix: + type: string + defaultNotificationSubscriptions: + type: array + items: + $ref: '#/components/schemas/DefaultNotificationSubscription' + minItems: 1 + allowedPlmns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + allowedSnpns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + allowedNfTypes: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + allowedNfDomains: + type: array + items: + type: string + minItems: 1 + allowedNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + allowedOperationsPerNfType: + description: A map (list of key-value pairs) where NF Type serves as key + type: object + additionalProperties: + type: array + items: + type: string + minItems: 1 + minProperties: 1 + allowedOperationsPerNfInstance: + description: A map (list of key-value pairs) where NF Instance Id serves as key + type: object + additionalProperties: + type: array + items: + type: string + minItems: 1 + minProperties: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 + capacity: + type: integer + minimum: 0 + maximum: 65535 + load: + type: integer + minimum: 0 + maximum: 100 + loadTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nfServiceSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + minItems: 1 + sNssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + perPlmnSnssaiList: + type: array + items: + $ref: '#/components/schemas/PlmnSnssai' + minItems: 1 + vendorId: + $ref: '#/components/schemas/VendorId' + supportedVendorSpecificFeatures: + description: > + A map (list of key-value pairs) where IANA-assigned SMI Network Management + Private Enterprise Codes serves as key + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/VendorSpecificFeature' + minItems: 1 + minProperties: 1 + oauth2Required: + type: boolean + perPlmnOauth2ReqList: + $ref: '#/components/schemas/PlmnOauth2' + + NFType: + description: NF types known to NRF + anyOf: + - type: string + enum: + - NRF + - UDM + - AMF + - SMF + - AUSF + - NEF + - PCF + - SMSF + - NSSF + - UDR + - LMF + - GMLC + - 5G_EIR + - SEPP + - UPF + - N3IWF + - AF + - UDSF + - BSF + - CHF + - NWDAF + - PCSCF + - CBCF + - HSS + - UCMF + - SOR_AF + - SPAF + - MME + - SCSAS + - SCEF + - SCP + - NSSAAF + - ICSCF + - SCSCF + - DRA + - IMS_AS + - AANF + - 5G_DDNMF + - NSACF + - MFAF + - EASDF + - DCCF + - MB_SMF + - TSCTSF + - ADRF + - GBA_BSF + - CEF + - MB_UPF + - NSWOF + - PKMF + - MNPF + - SMS_GMSC + - SMS_IWMSC + - MBSF + - MBSTF + - PANF + - type: string + + NefId: + description: Identity of the NEF + type: string + + IpEndPoint: + description: > + IP addressing information of a given NFService; + it consists on, e.g. IP address, TCP port, transport protocol... + type: object + properties: + ipv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + transport: + $ref: '#/components/schemas/TransportProtocol' + port: + type: integer + minimum: 0 + maximum: 65535 + + SubscriptionData: + description: > + Information of a subscription to notifications to NRF events, + included in subscription requests and responses + type: object + required: + - nfStatusNotificationUri + - subscriptionId + properties: + nfStatusNotificationUri: + type: string + reqNfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subscrCond: + $ref: '#/components/schemas/SubscrCond' + subscriptionId: + type: string + pattern: '^([0-9]{5,6}-)?[^-]+$' + readOnly: true + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reqNotifEvents: + type: array + items: + $ref: '#/components/schemas/NotificationEventType' + minItems: 1 + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + notifCondition: + $ref: '#/components/schemas/NotifCondition' + reqNfType: + $ref: '#/components/schemas/NFType' + reqNfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + reqSnssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + reqPerPlmnSnssais: + type: array + items: + $ref: '#/components/schemas/PlmnSnssai' + minItems: 1 + reqPlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + reqSnpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + servingScope: + type: array + items: + type: string + minItems: 1 + requesterFeatures: + writeOnly: true + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nrfSupportedFeatures: + readOnly: true + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + hnrfUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + onboardingCapability: + type: boolean + default: false + targetHni: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + preferredLocality: + type: string + + SubscrCond: + description: > + Condition to determine the set of NFs to monitor under a certain subscription in NRF + oneOf: + - $ref: '#/components/schemas/NfInstanceIdCond' + - $ref: '#/components/schemas/NfInstanceIdListCond' + - $ref: '#/components/schemas/NfTypeCond' + - $ref: '#/components/schemas/ServiceNameCond' + - $ref: '#/components/schemas/ServiceNameListCond' + - $ref: '#/components/schemas/AmfCond' + - $ref: '#/components/schemas/GuamiListCond' + - $ref: '#/components/schemas/NetworkSliceCond' + - $ref: '#/components/schemas/NfGroupCond' + - $ref: '#/components/schemas/NfGroupListCond' + - $ref: '#/components/schemas/NfSetCond' + - $ref: '#/components/schemas/NfServiceSetCond' + - $ref: '#/components/schemas/UpfCond' + - $ref: '#/components/schemas/ScpDomainCond' + - $ref: '#/components/schemas/NwdafCond' + - $ref: '#/components/schemas/NefCond' + - $ref: '#/components/schemas/DccfCond' + + NfInstanceIdCond: + description: Subscription to a given NF Instance Id + type: object + required: + - nfInstanceId + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + NfInstanceIdListCond: + description: Subscription to a list of NF Instances + type: object + required: + - nfInstanceIdList + properties: + nfInstanceIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + + NfTypeCond: + description: Subscription to a set of NFs based on their NF Type + type: object + required: + - nfType + not: + required: [ nfGroupId ] + properties: + nfType: + $ref: '#/components/schemas/NFType' + + ServiceNameCond: + description: Subscription to a set of NFs based on their support for a given Service Name + type: object + required: + - serviceName + properties: + serviceName: + $ref: '#/components/schemas/ServiceName' + + ServiceNameListCond: + description: > + Subscription to a set of NFs based on their support for a Service Name + in the Servic Name list + type: object + required: + - conditionType + - serviceNameList + properties: + conditionType: + type: string + enum: [ SERVICE_NAME_LIST_COND ] + serviceNameList: + type: array + items: + $ref: '#/components/schemas/ServiceName' + minItems: 1 + + AmfCond: + description: Subscription to a set of AMFs, based on AMF Set Id and/or AMF Region Id + type: object + anyOf: + - required: [ amfSetId ] + - required: [ amfRegionId ] + properties: + amfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfSetId' + amfRegionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' + + GuamiListCond: + description: Subscription to a set of AMFs, based on their GUAMIs + type: object + required: + - guamiList + properties: + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + + NetworkSliceCond: + description: Subscription to a set of NFs, based on the slices (S-NSSAI and NSI) they support + type: object + required: + - snssaiList + properties: + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiList: + type: array + items: + type: string + + NfGroupCond: + description: Subscription to a set of NFs based on their Group Id + type: object + required: + - nfType + - nfGroupId + properties: + nfType: + type: string + enum: + - UDM + - AUSF + - UDR + - PCF + - CHF + - HSS + nfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + + NfGroupListCond: + description: Subscription to a set of NFs based on their Group Ids + type: object + required: + - conditionType + - nfType + - nfGroupIdList + properties: + conditionType: + type: string + enum: [ NF_GROUP_LIST_COND ] + nfType: + type: string + enum: + - UDM + - AUSF + - UDR + - PCF + - CHF + - HSS + nfGroupIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + minItems: 1 + + NotifCondition: + description: > + Condition (list of attributes in the NF Profile) to determine whether a notification + must be sent by NRF + type: object + not: + required: [ monitoredAttributes, unmonitoredAttributes ] + properties: + monitoredAttributes: + type: array + items: + type: string + minItems: 1 + unmonitoredAttributes: + type: array + items: + type: string + minItems: 1 + + UdrInfo: + description: Information of an UDR NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + supportedDataSets: + type: array + items: + $ref: '#/components/schemas/DataSetId' + minItems: 1 + sharedDataIdRanges: + type: array + items: + $ref: '#/components/schemas/SharedDataIdRange' + minItems: 1 + + SharedDataIdRange: + description: A range of SharedDataIds based on regular-expression matching + type: object + properties: + pattern: + type: string + + SupiRange: + description: > + A range of SUPIs (subscriber identities), either based on a numeric range, + or based on regular-expression matching + type: object + properties: + start: + type: string + pattern: '^[0-9]+$' + end: + type: string + pattern: '^[0-9]+$' + pattern: + type: string + + IdentityRange: + description: > + A range of GPSIs (subscriber identities), either based on a numeric range, + or based on regular-expression matching + type: object + properties: + start: + type: string + pattern: '^[0-9]+$' + end: + type: string + pattern: '^[0-9]+$' + pattern: + type: string + + InternalGroupIdRange: + description: > + A range of Group IDs (internal group identities), either based on a numeric range, + or based on regular-expression matching + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + end: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + pattern: + type: string + + DataSetId: + description: Types of data sets and subsets stored in UDR + anyOf: + - type: string + enum: + - SUBSCRIPTION + - POLICY + - EXPOSURE + - APPLICATION + - A_PFD + - A_AFTI + - A_IPTV + - A_BDT + - A_SPD + - A_EASD + - A_AMI + - P_UE + - P_SCD + - P_BDT + - P_PLMNUE + - P_NSSCD + - type: string + + UdmInfo: + description: Information of an UDM NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + routingIndicators: + type: array + items: + type: string + pattern: '^[0-9]{1,4}$' + minItems: 1 + internalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/InternalGroupIdRange' + minItems: 1 + suciInfos: + type: array + items: + $ref: '#/components/schemas/SuciInfo' + minItems: 1 + + AusfInfo: + description: Information of an AUSF NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + routingIndicators: + type: array + items: + type: string + pattern: '^[0-9]{1,4}$' + minItems: 1 + suciInfos: + type: array + items: + $ref: '#/components/schemas/SuciInfo' + minItems: 1 + + AmfInfo: + description: Information of an AMF NF Instance + type: object + required: + - amfSetId + - amfRegionId + - guamiList + properties: + amfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfSetId' + amfRegionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfRegionId' + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + backupInfoAmfFailure: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + backupInfoAmfRemoval: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + n2InterfaceAmfInfo: + $ref: '#/components/schemas/N2InterfaceAmfInfo' + amfOnboardingCapability: + type: boolean + default: false + + SmfInfo: + description: Information of an SMF NF Instance + type: object + required: + - sNssaiSmfInfoList + properties: + sNssaiSmfInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiSmfInfoItem' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddrList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + accessType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 + vsmfSupportInd: + type: boolean + pgwFqdnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + minItems: 1 + smfOnboardingCapability: + type: boolean + default: false + deprecated: true + ismfSupportInd: + type: boolean + smfUPRPCapability: + type: boolean + default: false + + SnssaiSmfInfoItem: + description: Set of parameters supported by SMF for a given S-NSSAI + type: object + required: + - sNssai + - dnnSmfInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnSmfInfoList: + type: array + items: + $ref: '#/components/schemas/DnnSmfInfoItem' + minItems: 1 + + DnnSmfInfoItem: + description: Set of parameters supported by SMF for a given DNN + type: object + required: + - dnn + properties: + dnn: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + dnaiList: + type: array + items: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + - $ref: '#/components/schemas/WildcardDnai' + minItems: 1 + + UpfInfo: + description: Information of an UPF NF Instance + type: object + required: + - sNssaiUpfInfoList + properties: + sNssaiUpfInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiUpfInfoItem' + minItems: 1 + smfServingArea: + type: array + items: + type: string + minItems: 1 + interfaceUpfInfoList: + type: array + items: + $ref: '#/components/schemas/InterfaceUpfInfoItem' + minItems: 1 + iwkEpsInd: + type: boolean + default: false + pduSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + atsssCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AtsssCapability' + ueIpAddrInd: + type: boolean + default: false + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + wAgfInfo: + $ref: '#/components/schemas/WAgfInfo' + tngfInfo: + $ref: '#/components/schemas/TngfInfo' + twifInfo: + $ref: '#/components/schemas/TwifInfo' + priority: + type: integer + minimum: 0 + maximum: 65535 + redundantGtpu: + type: boolean + default: false + ipups: + type: boolean + default: false + dataForwarding: + type: boolean + default: false + supportedPfcpFeatures: + type: string + + SnssaiUpfInfoItem: + description: Set of parameters supported by UPF for a given S-NSSAI + type: object + required: + - sNssai + - dnnUpfInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnUpfInfoList: + type: array + items: + $ref: '#/components/schemas/DnnUpfInfoItem' + minItems: 1 + redundantTransport: + type: boolean + default: false + + DnnUpfInfoItem: + description: Set of parameters supported by UPF for a given DNN + type: object + required: + - dnn + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + pduSessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + ipv4AddressRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + ipv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 + ipv4IndexList: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpIndex' + minItems: 1 + ipv6IndexList: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpIndex' + minItems: 1 + dnaiNwInstanceList: + description: > + Map of network instance per DNAI for the DNN, where the key of the map is the DNAI. + When present, the value of each entry of the map shall contain a N6 network instance + that is configured for the DNAI indicated by the key. + type: object + additionalProperties: + type: string + minProperties: 1 + + InterfaceUpfInfoItem: + description: Information of a given IP interface of an UPF + type: object + required: + - interfaceType + properties: + interfaceType: + $ref: '#/components/schemas/UPInterfaceType' + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + networkInstance: + type: string + + UPInterfaceType: + description: Types of User-Plane interfaces of the UPF + anyOf: + - type: string + enum: + - N3 + - N6 + - N9 + - DATA_FORWARDING + - N3MB + - N6MB + - N19MB + - NMB9 + - type: string + + WAgfInfo: + description: Information of the W-AGF end-points + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + TngfInfo: + description: Infomation of the TNGF endpoints + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + PcfInfo: + description: Information of a PCF NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + rxDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + rxDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + v2xSupportInd: + type: boolean + default: false + proseSupportInd: + type: boolean + default: false + proseCapability: + $ref: '#/components/schemas/ProSeCapability' + v2xCapability: + $ref: '#/components/schemas/V2xCapability' + + BsfInfo: + description: Information of a BSF NF Instance + type: object + properties: + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + ipDomainList: + type: array + items: + type: string + minItems: 1 + ipv4AddressRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + ipv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 + rxDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + rxDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + + ChfInfo: + description: Information of a CHF NF Instance + type: object + not: + required: [ primaryChfInstance, secondaryChfInstance ] + properties: + supiRangeList: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRangeList: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + plmnRangeList: + type: array + items: + $ref: '#/components/schemas/PlmnRange' + minItems: 1 + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + primaryChfInstance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + secondaryChfInstance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + Ipv4AddressRange: + description: Range of IPv4 addresses + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + end: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + + Ipv6PrefixRange: + description: Range of IPv6 prefixes + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + end: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + + DefaultNotificationSubscription: + description: > + Data structure for specifying the notifications the NF service subscribes by default, + along with callback URI + type: object + required: + - notificationType + - callbackUri + properties: + notificationType: + $ref: '#/components/schemas/NotificationType' + callbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + n1MessageClass: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N1MessageClass' + n2InformationClass: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InformationClass' + versions: + type: array + items: + type: string + minItems: 1 + binding: + type: string + acceptedEncoding: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + serviceInfoList: + description: > + A map of service specific information. The name of the corresponding service (as + specified in ServiceName data type) is the key. + type: object + additionalProperties: + $ref: '#/components/schemas/DefSubServiceInfo' + minProperties: 1 + + NfSetCond: + description: Subscription to a set of NFs based on their Set Id + type: object + required: + - nfSetId + properties: + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + + NfServiceSetCond: + description: Subscription to a set of NFs based on their Service Set Id + type: object + required: + - nfServiceSetId + properties: + nfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + + UpfCond: + description: > + Subscription to a set of NF Instances (UPFs), able to serve a certain service area + (i.e. SMF serving area or TAI list) + type: object + required: + - conditionType + properties: + conditionType: + type: string + enum: [ UPF_COND ] + smfServingArea: + type: array + items: + type: string + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + NwdafCond: + description: > + Subscription to a set of NF Instances (NWDAFs), identified by Analytics ID(s), + S-NSSAI(s) or NWDAF Serving Area information, i.e. list of TAIs for which the NWDAF + can provide analytics. + type: object + required: + - conditionType + properties: + conditionType: + type: string + enum: [ NWDAF_COND ] + analyticsIds: + type: array + items: + type: string + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + mlAnalyticsList: + type: array + items: + $ref: '#/components/schemas/MlAnalyticsInfo' + minItems: 1 + + NefCond: + description: > + Subscription to a set of NF Instances (NEFs), identified by Event ID(s) provided by AF, + S-NSSAI(s), AF Instance ID, Application Identifier, External Identifier, + External Group Identifier, or domain name. + type: object + required: + - conditionType + properties: + conditionType: + type: string + enum: [ NEF_COND ] + afEvents: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEvent' + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + pfdData: + $ref: '#/components/schemas/PfdData' + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + servedFqdnList: + type: array + items: + type: string + minItems: 1 + + NotificationType: + description: > + Types of notifications used in Default Notification URIs in the NF Profile of an NF Instance + anyOf: + - type: string + enum: + - N1_MESSAGES + - N2_INFORMATION + - LOCATION_NOTIFICATION + - DATA_REMOVAL_NOTIFICATION + - DATA_CHANGE_NOTIFICATION + - LOCATION_UPDATE_NOTIFICATION + - NSSAA_REAUTH_NOTIFICATION + - NSSAA_REVOC_NOTIFICATION + - MATCH_INFO_NOTIFICATION + - DATA_RESTORATION_NOTIFICATION + - TSCTS_NOTIFICATION + - LCS_KEY_DELIVERY_NOTIFICATION + - type: string + + TransportProtocol: + description: Types of transport protocol used in a given IP endpoint of an NF Service Instance + anyOf: + - type: string + enum: + - TCP + - type: string + + NotificationEventType: + description: Types of events sent in notifications from NRF to subscribed NF Instances + anyOf: + - type: string + enum: + - NF_REGISTERED + - NF_DEREGISTERED + - NF_PROFILE_CHANGED + - type: string + + NotificationData: + description: Data sent in notifications from NRF to subscribed NF Instances + type: object + required: + - event + - nfInstanceUri + allOf: + # + # Condition: If 'event' takes value 'NF_PROFILE_CHANGED', + # then either 'nfProfile' or 'profileChanges' (but not both) must be present + # + - anyOf: + - not: + properties: + event: + type: string + enum: + - NF_PROFILE_CHANGED + - oneOf: + - required: [ nfProfile ] + - required: [ profileChanges ] + # + # Condition: If 'event' takes value 'NF_REGISTERED', + # then 'nfProfile' must be present + # + - anyOf: + - not: + properties: + event: + type: string + enum: + - NF_REGISTERED + - required: [ nfProfile ] + properties: + event: + $ref: '#/components/schemas/NotificationEventType' + nfInstanceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfProfile: + allOf: + - $ref: '#/components/schemas/NFProfile' + - not: + required: [ interPlmnFqdn ] + - not: + required: [ allowedPlmns ] + - not: + required: [ allowedSnpns ] + - not: + required: [ allowedNfTypes ] + - not: + required: [ allowedNfDomains ] + - not: + required: [ allowedNssais ] + - properties: + nfServices: + type: array + items: + allOf: + - $ref: '#/components/schemas/NFService' + - not: + required: [ interPlmnFqdn ] + - not: + required: [ allowedPlmns ] + - not: + required: [ allowedSnpns ] + - not: + required: [ allowedNfTypes ] + - not: + required: [ allowedNfDomains ] + - not: + required: [ allowedNssais ] + profileChanges: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChangeItem' + minItems: 1 + conditionEvent: + $ref: '#/components/schemas/ConditionEventType' + subscriptionContext: + $ref: '#/components/schemas/SubscriptionContext' + + NFStatus: + description: Status of a given NF Instance stored in NRF + anyOf: + - type: string + enum: + - REGISTERED + - SUSPENDED + - UNDISCOVERABLE + - type: string + + NFServiceVersion: + description: Contains the version details of an NF service + type: object + required: + - apiVersionInUri + - apiFullVersion + properties: + apiVersionInUri: + type: string + apiFullVersion: + type: string + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + ServiceName: + description: Service names known to NRF + anyOf: + - type: string + enum: + - nnrf-nfm + - nnrf-disc + - nnrf-oauth2 + - nudm-sdm + - nudm-uecm + - nudm-ueau + - nudm-ee + - nudm-pp + - nudm-niddau + - nudm-mt + - nudm-ssau + - nudm-rsds + - namf-comm + - namf-evts + - namf-mt + - namf-loc + - namf-mbs-comm + - namf-mbs-bc + - nsmf-pdusession + - nsmf-event-exposure + - nsmf-nidd + - nausf-auth + - nausf-sorprotection + - nausf-upuprotection + - nnef-pfdmanagement + - nnef-smcontext + - nnef-eventexposure + - nnef-eas-deployment-info + - 3gpp-cp-parameter-provisioning + - 3gpp-device-triggering + - 3gpp-bdt + - 3gpp-traffic-influence + - 3gpp-chargeable-party + - 3gpp-as-session-with-qos + - 3gpp-msisdn-less-mo-sms + - 3gpp-service-parameter + - 3gpp-monitoring-event + - 3gpp-nidd-configuration-trigger + - 3gpp-nidd + - 3gpp-analyticsexposure + - 3gpp-racs-parameter-provisioning + - 3gpp-ecr-control + - 3gpp-applying-bdt-policy + - 3gpp-mo-lcs-notify + - 3gpp-time-sync + - 3gpp-am-influence + - 3gpp-am-policyauthorization + - 3gpp-akma + - 3gpp-eas-deployment + - 3gpp-iptvconfiguration + - 3gpp-mbs-tmgi + - 3gpp-mbs-session + - 3gpp-authentication + - 3gpp-asti + - npcf-am-policy-control + - npcf-smpolicycontrol + - npcf-policyauthorization + - npcf-bdtpolicycontrol + - npcf-eventexposure + - npcf-ue-policy-control + - npcf-am-policyauthorization + - nsmsf-sms + - nnssf-nsselection + - nnssf-nssaiavailability + - nudr-dr + - nudr-group-id-map + - nlmf-loc + - n5g-eir-eic + - nbsf-management + - nchf-spendinglimitcontrol + - nchf-convergedcharging + - nchf-offlineonlycharging + - nnwdaf-eventssubscription + - nnwdaf-analyticsinfo + - nnwdaf-datamanagement + - nnwdaf-mlmodelprovision + - ngmlc-loc + - nucmf-provisioning + - nucmf-uecapabilitymanagement + - nhss-sdm + - nhss-uecm + - nhss-ueau + - nhss-ee + - nhss-ims-sdm + - nhss-ims-uecm + - nhss-ims-ueau + - nhss-gba-sdm + - nhss-gba-ueau + - nsepp-telescopic + - nsoraf-sor + - nspaf-secured-packet + - nudsf-dr + - nudsf-timer + - nnssaaf-nssaa + - nnssaaf-aiw + - naanf-akma + - n5gddnmf-discovery + - nmfaf-3dadm + - nmfaf-3cadm + - neasdf-dnscontext + - neasdf-baselinednspattern + - ndccf-dm + - ndccf-cm + - nnsacf-nsac + - nnsacf-slice-ee + - nmbsmf-tmgi + - nmbsmf-mbssession + - nadrf-dm + - nbsp-gba + - ntsctsf-time-sync + - ntsctsf-qos-tscai + - ntsctsf-asti + - npkmf-keyreq + - nmnpf-npstatus + - niwmsc-smservice + - nmbsf-mbsuserserv + - nmbsf-mbsuserdataing + - nmbstf-distsession + - npanf-prosekey + - type: string + + N2InterfaceAmfInfo: + description: AMF N2 interface information + type: object + properties: + ipv4EndpointAddress: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddress: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + amfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + + NFServiceStatus: + description: Status of a given NF Service Instance of an NF Instance stored in NRF + anyOf: + - type: string + enum: + - REGISTERED + - SUSPENDED + - UNDISCOVERABLE + - type: string + + TaiRange: + description: Range of TAIs (Tracking Area Identities) + type: object + required: + - plmnId + - tacRangeList + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + tacRangeList: + type: array + items: + $ref: '#/components/schemas/TacRange' + minItems: 1 + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + + TacRange: + description: Range of TACs (Tracking Area Codes) + type: object + properties: + start: + type: string + pattern: '^([A-Fa-f0-9]{4}|[A-Fa-f0-9]{6})$' + end: + type: string + pattern: '^([A-Fa-f0-9]{4}|[A-Fa-f0-9]{6})$' + pattern: + type: string + + PlmnRange: + description: Range of PLMN IDs + type: object + properties: + start: + type: string + pattern: '^[0-9]{3}[0-9]{2,3}$' + end: + type: string + pattern: '^[0-9]{3}[0-9]{2,3}$' + pattern: + type: string + + NrfInfo: + description: Information of an NRF NF Instance, used in hierarchical NRF deployments + type: object + properties: + servedUdrInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdrInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedUdrInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdrInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedUdmInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdmInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedUdmInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdmInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedAusfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AusfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedAusfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AusfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedAmfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedAmfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedSmfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/SmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedSmfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/SmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedUpfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UpfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedUpfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UpfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedPcfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/PcfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedPcfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/PcfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedBsfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/BsfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedBsfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/BsfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedChfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ChfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedChfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ChfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedNefInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/NefInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedNwdafInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/NwdafInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedNwdafInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + type: object + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/NwdafInfo' + minProperties: 1 + minProperties: 1 + servedPcscfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/PcscfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedGmlcInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/GmlcInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedLmfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/LmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedNfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + $ref: '#/components/schemas/NfInfo' + minProperties: 1 + servedHssInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/HssInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedUdsfInfo: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdsfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedUdsfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/UdsfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedScpInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/ScpInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedSeppInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/SeppInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + servedAanfInfoList: + description: A map (list of key-value pairs) where NF Instance Id serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/AanfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + served5gDdnmfInfo: + type: object + additionalProperties: + $ref: '#/components/schemas/5GDdnmfInfo' + minProperties: 1 + servedMfafInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + $ref: '#/components/schemas/MfafInfo' + minProperties: 1 + servedEasdfInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + type: object + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/EasdfInfo' + minProperties: 1 + servedDccfInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + $ref: '#/components/schemas/DccfInfo' + minProperties: 1 + servedMbSmfInfoList: + description: A map (list of key-value pairs) where nfInstanceId serves as key + type: object + additionalProperties: + description: A map (list of key-value pairs) where a valid JSON string serves as key + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/MbSmfInfo' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/EmptyObject' + minProperties: 1 + minProperties: 1 + servedTsctsfInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + type: object + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/TsctsfInfo' + minProperties: 1 + minProperties: 1 + servedMbUpfInfoList: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + type: object + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/MbUpfInfo' + minProperties: 1 + minProperties: 1 + servedTrustAfInfo: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + $ref: '#/components/schemas/TrustAfInfo' + minProperties: 1 + servedNssaafInfo: + type: object + description: A map (list of key-value pairs) where NF Instance Id serves as key + additionalProperties: + $ref: '#/components/schemas/NssaafInfo' + minProperties: 1 + + PlmnSnssai: + description: List of network slices (S-NSSAIs) for a given PLMN ID + type: object + required: + - plmnId + - sNssaiList + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + sNssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + + NefInfo: + description: Information of an NEF NF Instance + type: object + properties: + nefId: + $ref: '#/components/schemas/NefId' + pfdData: + $ref: '#/components/schemas/PfdData' + afEeData: + $ref: '#/components/schemas/AfEventExposureData' + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + servedFqdnList: + type: array + items: + type: string + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + unTrustAfInfoList: + type: array + items: + $ref: '#/components/schemas/UnTrustAfInfo' + minItems: 1 + uasNfFunctionalityInd: + type: boolean + default: false + + PfdData: + description: List of Application IDs and/or AF IDs managed by a given NEF Instance + type: object + properties: + appIds: + type: array + items: + type: string + minItems: 1 + afIds: + type: array + items: + type: string + minItems: 1 + + NwdafInfo: + description: Information of a NWDAF NF Instance + type: object + properties: + eventIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventId' + minItems: 1 + nwdafEvents: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + nwdafCapability: + $ref: '#/components/schemas/NwdafCapability' + analyticsDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + mlAnalyticsList: + type: array + items: + $ref: '#/components/schemas/MlAnalyticsInfo' + minItems: 1 + + LmfInfo: + description: Information of an LMF NF Instance + type: object + properties: + servingClientTypes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + minItems: 1 + lmfId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + servingAccessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + servingAnNodeTypes: + type: array + items: + $ref: '#/components/schemas/AnNodeType' + minItems: 1 + servingRatTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + supportedGADShapes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + minItems: 1 + + GmlcInfo: + description: Information of a GMLC NF Instance + type: object + properties: + servingClientTypes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + minItems: 1 + gmlcNumbers: + type: array + items: + type: string + pattern: '^[0-9]{5,15}$' + minItems: 1 + + AfEventExposureData: + description: AF Event Exposure data managed by a given NEF Instance + type: object + required: + - afEvents + properties: + afEvents: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEvent' + minItems: 1 + afIds: + type: array + items: + type: string + minItems: 1 + appIds: + type: array + items: + type: string + minItems: 1 + + PcscfInfo: + description: Information of a P-CSCF NF Instance + type: object + properties: + accessType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + dnnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + gmFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + gmIpv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + gmIpv6Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + mwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + mwIpv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + mwIpv6Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + servedIpv4AddressRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + servedIpv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 + + NfInfo: + description: Information of a generic NF Instance + type: object + properties: + nfType: + $ref: '#/components/schemas/NFType' + + HssInfo: + description: Information of an HSS NF Instance + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + imsiRanges: + type: array + items: + $ref: '#/components/schemas/ImsiRange' + minItems: 1 + imsPrivateIdentityRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + imsPublicIdentityRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + msisdnRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + hssDiameterAddress: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/NetworkNodeDiameterAddress' + + ImsiRange: + description: > + A range of IMSIs (subscriber identities), either based on a numeric range, + or based on regular-expression matching + type: object + properties: + start: + type: string + pattern: '^[0-9]+$' + end: + type: string + pattern: '^[0-9]+$' + pattern: + type: string + + TwifInfo: + description: Addressing information (IP addresses, FQDN) of the TWIF + type: object + properties: + ipv4EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6EndpointAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + endpointFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + VendorId: + description: Vendor ID of the NF Service instance (Private Enterprise Number assigned by IANA) + type: string + pattern: '^[0-9]{6}$' + + VendorSpecificFeature: + description: Information about a vendor-specific feature + type: object + required: + - featureName + - featureVersion + properties: + featureName: + type: string + featureVersion: + type: string + + AnNodeType: + description: Access Network Node Type (gNB, ng-eNB...) + anyOf: + - type: string + enum: + - GNB + - NG_ENB + - type: string + + UdsfInfo: + description: Information related to UDSF + type: object + properties: + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + storageIdRanges: + description: > + A map (list of key-value pairs) where realmId serves as key and each value in the map + is an array of IdentityRanges. Each IdentityRange is a range of storageIds. + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + minProperties: 1 + + ScpInfo: + description: Information of an SCP Instance + type: object + properties: + scpDomainInfoList: + description: > + A map (list of key-value pairs) where the key of the map shall be the string + identifying an SCP domain + type: object + additionalProperties: + $ref: '#/components/schemas/ScpDomainInfo' + minProperties: 1 + scpPrefix: + type: string + scpPorts: + description: > + Port numbers for HTTP and HTTPS. The key of the map shall be "http" or "https". + type: object + additionalProperties: + type: integer + minimum: 0 + maximum: 65535 + minProperties: 1 + addressDomains: + type: array + items: + type: string + minItems: 1 + ipv4Addresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + ipv4AddrRanges: + type: array + items: + $ref: '#/components/schemas/Ipv4AddressRange' + minItems: 1 + ipv6PrefixRanges: + type: array + items: + $ref: '#/components/schemas/Ipv6PrefixRange' + minItems: 1 + servedNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + remotePlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + remoteSnpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + ipReachability: + $ref: '#/components/schemas/IpReachability' + scpCapabilities: + type: array + items: + $ref: '#/components/schemas/ScpCapability' + + ScpDomainInfo: + description: SCP Domain specific information + type: object + properties: + scpFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + scpIpEndPoints: + type: array + items: + $ref: '#/components/schemas/IpEndPoint' + minItems: 1 + scpPrefix: + type: string + scpPorts: + description: > + Port numbers for HTTP and HTTPS. The key of the map shall be "http" or "https". + type: object + additionalProperties: + type: integer + minimum: 0 + maximum: 65535 + minProperties: 1 + + ScpDomainCond: + description: > + Subscription to a set of NF or SCP or SEPP instances belonging to certain SCP domains + type: object + required: + - scpDomains + properties: + scpDomains: + type: array + items: + type: string + minItems: 1 + nfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + + OptionsResponse: + description: Communication options of the NRF sent in response payload of OPTIONS method + type: object + properties: + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + ConditionEventType: + description: > + Indicates whether a notification is due to the NF Instance to start or stop + being part of a condition for a subscription to a set of NFs + anyOf: + - type: string + enum: + - NF_ADDED + - NF_REMOVED + - type: string + + SuciInfo: + description: SUCI information containing Routing Indicator and Home Network Public Key ID + type: object + properties: + routingInds: + type: array + items: + type: string + pattern: '^[0-9]{1,4}$' + minItems: 1 + hNwPubKeyIds: + type: array + items: + type: integer + minItems: 1 + + SeppInfo: + description: Information of a SEPP Instance + type: object + properties: + seppPrefix: + type: string + seppPorts: + description: > + Port numbers for HTTP and HTTPS. The key of the map shall be "http" or "https". + type: object + additionalProperties: + type: integer + minimum: 0 + maximum: 65535 + minProperties: 1 + remotePlmnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + remoteSnpnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + + IpReachability: + description: Indicates the type(s) of IP addresses reachable via an SCP + anyOf: + - type: string + enum: + - IPV4 + - IPV6 + - IPV4V6 + - type: string + + UriList: + description: > + Represents a set of URIs following the 3GPP hypermedia format + (containing a "_links" attribute). + type: object + properties: + _links: + type: object + description: > + List of the URI of NF instances. It has two members whose names are item and self. + The item attribute contains an array of URIs. + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LinksValueSchema' + minProperties: 1 + totalItemCount: + type: integer + + AanfInfo: + description: Represents the information relative to an AAnF NF Instance. + type: object + properties: + routingIndicators: + type: array + items: + type: string + pattern: '^[0-9]{1,4}$' + minItems: 1 + + 5GDdnmfInfo: + description: Information of an 5G DDNMF NF Instance + type: object + required: + - plmnId + properties: + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + WildcardDnai: + description: Wildcard DNAI + type: string + pattern: '^[*]$' + + MfafInfo: + description: Information of a MFAF NF Instance + type: object + properties: + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + + NwdafCapability: + description: Indicates the capability supported by the NWDAF + type: object + properties: + analyticsAggregation: + type: boolean + default: false + analyticsMetadataProvisioning: + type: boolean + default: false + + EasdfInfo: + description: Information of an EASDF NF Instance + type: object + properties: + sNssaiEasdfInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiEasdfInfoItem' + minItems: 1 + easdfN6IpAddressList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + upfN6IpAddressList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + + SnssaiEasdfInfoItem: + description: Set of parameters supported by EASDF for a given S-NSSAI + type: object + required: + - sNssai + - dnnEasdfInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnEasdfInfoList: + type: array + items: + $ref: '#/components/schemas/DnnEasdfInfoItem' + minItems: 1 + + DnnEasdfInfoItem: + description: Set of parameters supported by EASDF for a given DNN + type: object + required: + - dnn + properties: + dnn: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + dnaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + + DccfInfo: + description: Information of a DCCF NF Instance + type: object + properties: + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + + ScpCapability: + description: Indicates the capabilities supported by an SCP + anyOf: + - type: string + enum: + - INDIRECT_COM_WITH_DELEG_DISC + - type: string + + NsacfInfo: + description: Information of a NSACF NF Instance + type: object + required: + - nsacfCapability + properties: + nsacfCapability: + $ref: '#/components/schemas/NsacfCapability' + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + + NsacfCapability: + description: > + NSACF service capabilities (e.g. to monitor and control the number of registered UEs + or established PDU sessions per network slice) + type: object + properties: + supportUeSAC: + description: | + Indicates the service capability of the NSACF to monitor and control the number of + registered UEs per network slice for the network slice that is subject to NSAC + true: Supported + false (default): Not Supported + type: boolean + default: false + supportPduSAC: + description: | + Indicates the service capability of the NSACF to monitor and control the number of + established PDU sessions per network slice for the network slice that is subject to NSAC + true: Supported + false (default): Not Supported + type: boolean + default: false + + DccfCond: + description: > + Subscription to a set of NF Instances (DCCFs), identified by NF types, NF Set Id(s) + or DCCF Serving Area information, i.e. list of TAIs served by the DCCF + type: object + required: + - conditionType + properties: + conditionType: + type: string + enum: [ DCCF_COND ] + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + servingNfTypeList: + type: array + items: + $ref: '#/components/schemas/NFType' + minItems: 1 + servingNfSetIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + + MlAnalyticsInfo: + description: ML Analytics Filter information supported by the Nnwdaf_MLModelProvision service + type: object + properties: + mlAnalyticsIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + trackingAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + MbSmfInfo: + description: Information of an MB-SMF NF Instance + type: object + properties: + sNssaiInfoList: + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/SnssaiMbSmfInfoItem' + minProperties: 1 + tmgiRangeList: + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/TmgiRange' + minProperties: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + mbsSessionList: + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/MbsSession' + minProperties: 1 + + TmgiRange: + description: Range of TMGIs + type: object + required: + - mbsServiceIdStart + - mbsServiceIdEnd + - plmnId + properties: + mbsServiceIdStart: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + mbsServiceIdEnd: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nid: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Nid' + + MbsSession: + description: MBS Session currently served by an MB-SMF + type: object + required: + - mbsSessionId + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + mbsAreaSessions: + description: A map (list of key-value pairs) where the key identifies an areaSessionId + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceAreaInfo' + minProperties: 1 + + SnssaiMbSmfInfoItem: + description: Parameters supported by an MB-SMF for a given S-NSSAI + type: object + required: + - sNssai + - dnnInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnInfoList: + type: array + items: + $ref: '#/components/schemas/DnnMbSmfInfoItem' + minItems: 1 + + DnnMbSmfInfoItem: + description: Parameters supported by an MB-SMF for a given DNN + type: object + required: + - dnn + properties: + dnn: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + + TsctsfInfo: + description: Information of a TSCTSF NF Instance + type: object + properties: + sNssaiInfoList: + description: A map (list of key-value pairs) where a valid JSON string serves as key + additionalProperties: + $ref: '#/components/schemas/SnssaiTsctsfInfoItem' + minProperties: 1 + externalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + gpsiRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + internalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/InternalGroupIdRange' + minItems: 1 + + SnssaiTsctsfInfoItem: + description: Set of parameters supported by TSCTSF for a given S-NSSAI + type: object + required: + - sNssai + - dnnInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnInfoList: + type: array + items: + $ref: '#/components/schemas/DnnTsctsfInfoItem' + minItems: 1 + + DnnTsctsfInfoItem: + description: Parameters supported by an TSCTSF for a given DNN + type: object + required: + - dnn + properties: + dnn: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + + MbUpfInfo: + description: Information of an MB-UPF NF Instance + type: object + required: + - sNssaiMbUpfInfoList + properties: + sNssaiMbUpfInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiUpfInfoItem' + minItems: 1 + mbSmfServingArea: + type: array + items: + type: string + minItems: 1 + interfaceMbUpfInfoList: + type: array + items: + $ref: '#/components/schemas/InterfaceUpfInfoItem' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + priority: + type: integer + minimum: 0 + maximum: 65535 + supportedPfcpFeatures: + type: string + + UnTrustAfInfo: + description: Information of a untrusted AF Instance + type: object + required: + - afId + properties: + afId: + type: string + sNssaiInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiInfoItem' + minItems: 1 + mappingInd: + type: boolean + default: false + + TrustAfInfo: + description: Information of a trusted AF Instance + type: object + properties: + sNssaiInfoList: + type: array + items: + $ref: '#/components/schemas/SnssaiInfoItem' + minItems: 1 + afEvents: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEvent' + minItems: 1 + appIds: + type: array + items: + type: string + minItems: 1 + internalGroupId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + mappingInd: + type: boolean + default: false + + SnssaiInfoItem: + description: > + Parameters supported by an NF for a given S-NSSAI Set of parameters supported by NF + for a given S-NSSAI + type: object + required: + - sNssai + - dnnInfoList + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + dnnInfoList: + type: array + items: + $ref: '#/components/schemas/DnnInfoItem' + minItems: 1 + + DnnInfoItem: + description: Set of parameters supported by NF for a given DNN + type: object + required: + - dnn + properties: + dnn: + anyOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/WildcardDnn' + + CollocatedNfInstance: + description: Information of an collocated NF Instance registered in the NRF + type: object + required: + - nfInstanceId + - nfType + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfType: + $ref: '#/components/schemas/CollocatedNfType' + + CollocatedNfType: + description: NF types for a collocated NF + anyOf: + - type: string + enum: + - UPF + - SMF + - MB_UPF + - MB_SMF + - type: string + + PlmnOauth2: + description: Oauth2.0 required indication for a given PLMN ID + type: object + properties: + oauth2RequiredPlmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + oauth2NotRequiredPlmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + + V2xCapability: + description: Indicate the supported V2X Capability by the PCF. + type: object + properties: + lteV2x: + type: boolean + default: false + nrV2x: + type: boolean + default: false + + NssaafInfo: + description: Information of a NSSAAF Instance + type: object + properties: + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + internalGroupIdentifiersRanges: + type: array + items: + $ref: '#/components/schemas/InternalGroupIdRange' + minItems: 1 + + ProSeCapability: + description: Indicate the supported ProSe Capability by the PCF. + type: object + properties: + proseDirectDiscovey: + type: boolean + default: false + proseDirectCommunication: + type: boolean + default: false + proseL2UetoNetworkRelay: + type: boolean + default: false + proseL3UetoNetworkRelay: + type: boolean + default: false + proseL2RemoteUe: + type: boolean + default: false + proseL3RemoteUe: + type: boolean + default: false + + SubscriptionContext: + description: > + Context data related to a created subscription, to be included in notifications sent by NRF + type: object + required: + - subscriptionId + properties: + subscriptionId: + type: string + subscrCond: + $ref: '#/components/schemas/SubscrCond' + + IwmscInfo: + description: Information of an SMS-IWMSC NF Instance + type: object + properties: + msisdnRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + supiRanges: + type: array + items: + $ref: '#/components/schemas/SupiRange' + minItems: 1 + taiRangeList: + type: array + items: + $ref: '#/components/schemas/TaiRange' + minItems: 1 + scNumber: + type: string + pattern: '^[0-9]{5,15}$' + + MnpfInfo: + description: Information of an MNPF Instance + type: object + properties: + msisdnRanges: + type: array + items: + $ref: '#/components/schemas/IdentityRange' + minItems: 1 + required: + - msisdnRanges + + DefSubServiceInfo: + description: Service Specific information for Default Notification Subscription. + type: object + properties: + versions: + type: array + items: + type: string + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29512_Npcf_SMPolicyControl.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29512_Npcf_SMPolicyControl.yaml new file mode 100644 index 000000000..8bfc1b681 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29512_Npcf_SMPolicyControl.yaml @@ -0,0 +1,2477 @@ +openapi: 3.0.0 +info: + title: Npcf_SMPolicyControl API + version: 1.2.2 + description: | + Session Management Policy Control Service + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.512 V17.9.0; 5G System; Session Management Policy Control Service. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.512/' +security: + - {} + - oAuth2ClientCredentials: + - npcf-smpolicycontrol +servers: + - url: '{apiRoot}/npcf-smpolicycontrol/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +paths: + /sm-policies: + post: + summary: Create a new Individual SM Policy + operationId: CreateSMPolicy + tags: + - SM Policies (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyContextData' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDecision' + headers: + Location: + description: Contains the URI of the newly created resource + required: true + schema: + type: string + '308': + description: Permanent Redirect + headers: + Location: + description: > + Contains the URI of the PCF within the existing PCF binding information stored in + the BSF for the same UE ID, S-NSSAI and DNN combination + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + SmPolicyUpdateNotification: + '{$request.body#/notificationUri}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyNotification' + responses: + '200': + description: OK. The current applicable values corresponding to the policy control request trigger is reported + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/UeCampingRep' + - type: array + items: + $ref: '#/components/schemas/PartialSuccessReport' + minItems: 1 + - type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + '204': + description: No Content, Notification was succesfull + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorReport' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + SmPolicyControlTerminationRequestNotification: + '{$request.body#/notificationUri}/terminate': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TerminationNotification' + responses: + '204': + description: No Content, Notification was successful + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}: + get: + summary: Read an Individual SM Policy + operationId: GetSMPolicy + tags: + - Individual SM Policy (Document) + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyControl' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}/update: + post: + summary: Update an existing Individual SM Policy + operationId: UpdateSMPolicy + tags: + - Individual SM Policy (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyUpdateContextData' + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '200': + description: OK. Updated policies are returned + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDecision' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /sm-policies/{smPolicyId}/delete: + post: + summary: Delete an existing Individual SM Policy + operationId: DeleteSMPolicy + tags: + - Individual SM Policy (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyDeleteData' + parameters: + - name: smPolicyId + in: path + description: Identifier of a policy association + required: true + schema: + type: string + responses: + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-smpolicycontrol: Access to the Npcf_SMPolicyControl API + schemas: + SmPolicyControl: + description: Contains the parameters used to request the SM policies and the SM policies authorized by the PCF. + type: object + properties: + context: + $ref: '#/components/schemas/SmPolicyContextData' + policy: + $ref: '#/components/schemas/SmPolicyDecision' + required: + - context + - policy + SmPolicyContextData: + description: Contains the parameters used to create an Individual SM policy resource. + type: object + properties: + accNetChId: + $ref: '#/components/schemas/AccNetChId' + chargEntityAddr: + $ref: '#/components/schemas/AccNetChargingAddress' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + invalidSupi: + type: boolean + description: > + When this attribute is included and set to true, it indicates that the supi attribute + contains an invalid value.This attribute shall be present if the SUPI is not available + in the SMF or the SUPI is unauthenticated. When present it shall be set to true for an + invalid SUPI and false (default) for a valid SUPI. + interGrpIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduSessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + chargingcharacteristics: + type: string + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnnSelMode: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/DnnSelectionMode' + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + addAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + ipv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ipDomain: + type: string + description: Indicates the IPv4 address domain + subsSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authProfIndex: + type: string + description: Indicates the DN-AAA authorization profile index + subsDefQos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + vplmnQos: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/VplmnQos' + numOfPackFilter: + type: integer + description: Contains the number of supported packet filter for signalled QoS rules. + online: + type: boolean + description: If it is included and set to true, the online charging is applied to the PDU session. + offline: + type: boolean + description: If it is included and set to true, the offline charging is applied to the PDU session. + 3gppPsDataOffStatus: + type: boolean + description: If it is included and set to true, the 3GPP PS Data Off is activated by the UE. + refQosIndication: + type: boolean + description: If it is included and set to true, the reflective QoS is supported by the UE. + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + smfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + maPduInd: + $ref: '#/components/schemas/MaPduIndication' + atsssCapab: + $ref: '#/components/schemas/AtsssCapability' + ipv4FrameRouteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrMask' + minItems: 1 + ipv6FrameRouteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + pcfUeInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + pvsInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServerAddressingInfo' + minItems: 1 + onboardInd: + type: boolean + description: If it is included and set to true, it indicates that the PDU session is used for UE Onboarding. + nwdafDatas: + type: array + items: + $ref: '#/components/schemas/NwdafData' + minItems: 1 + required: + - supi + - pduSessionId + - pduSessionType + - dnn + - notificationUri + - sliceInfo + SmPolicyDecision: + description: Contains the SM policies authorized by the PCF. + type: object + properties: + sessRules: + type: object + additionalProperties: + $ref: '#/components/schemas/SessionRule' + minProperties: 1 + description: > + A map of Sessionrules with the content being the SessionRule as described in + clause 5.6.2.7. The key used in this map for each entry is the sessRuleId + attribute of the corresponding SessionRule. + pccRules: + type: object + additionalProperties: + $ref: '#/components/schemas/PccRule' + minProperties: 1 + description: > + A map of PCC rules with the content being the PCCRule as described in + clause 5.6.2.6. The key used in this map for each entry is the pccRuleId + attribute of the corresponding PccRule. + nullable: true + pcscfRestIndication: + type: boolean + description: If it is included and set to true, it indicates the P-CSCF Restoration is requested. + qosDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/QosData' + minProperties: 1 + description: > + Map of QoS data policy decisions. The key used in this map for each entry is the qosId + attribute of the corresponding QosData. + chgDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/ChargingData' + minProperties: 1 + description: > + Map of Charging data policy decisions. The key used in this map for each entry + is the chgId attribute of the corresponding ChargingData. + nullable: true + chargingInfo: + $ref: '#/components/schemas/ChargingInformation' + traffContDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/TrafficControlData' + minProperties: 1 + description: > + Map of Traffic Control data policy decisions. The key used in this map for each entry + is the tcId attribute of the corresponding TrafficControlData. + umDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonitoringData' + minProperties: 1 + description: > + Map of Usage Monitoring data policy decisions. The key used in this map for each entry + is the umId attribute of the corresponding UsageMonitoringData. + nullable: true + qosChars: + type: object + additionalProperties: + $ref: '#/components/schemas/QosCharacteristics' + minProperties: 1 + description: Map of QoS characteristics for non standard 5QIs. This map uses the 5QI values as keys. + qosMonDecs: + type: object + additionalProperties: + $ref: '#/components/schemas/QosMonitoringData' + minProperties: 1 + description: > + Map of QoS Monitoring data policy decisions. The key used in this map for each entry + is the qmId attribute of the corresponding QosMonitoringData. + nullable: true + reflectiveQoSTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + conds: + type: object + additionalProperties: + $ref: '#/components/schemas/ConditionData' + minProperties: 1 + description: > + A map of condition data with the content being as described in clause 5.6.2.9. The key + used in this map for each entry is the condId attribute of the corresponding ConditionData. + nullable: true + revalidationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + offline: + type: boolean + description: Indicates the offline charging is applicable to the PDU session when it is included and set to true. + online: + type: boolean + description: Indicates the online charging is applicable to the PDU session when it is included and set to true. + offlineChOnly: + type: boolean + default: false + description: > + Indicates that the online charging method shall never be used for any PCC rule activated + during the lifetime of the PDU session. + policyCtrlReqTriggers: + type: array + items: + $ref: '#/components/schemas/PolicyControlRequestTrigger' + minItems: 1 + description: Defines the policy control request triggers subscribed by the PCF. + nullable: true + lastReqRuleData: + type: array + items: + $ref: '#/components/schemas/RequestedRuleData' + minItems: 1 + description: Defines the last list of rule control data requested by the PCF. + lastReqUsageData: + $ref: '#/components/schemas/RequestedUsageData' + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfoRm' + minProperties: 1 + description: Map of PRA information. The praId attribute within the PresenceInfo data type is the key of the map. + nullable: true + ipv4Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + ipv6Index: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/IpIndex' + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + relCause: + $ref: '#/components/schemas/SmPolicyAssociationReleaseCause' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + tsnBridgeManCont: + $ref: '#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: '#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: '#/components/schemas/PortManagementContainer' + minItems: 1 + redSessIndication: + type: boolean + description: > + Indicates whether the PDU session is a redundant PDU session. If absent it means the PDU + session is not a redundant PDU session. + SmPolicyNotification: + description: Represents a notification on the update of the SM policies. + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smPolicyDecision: + $ref: '#/components/schemas/SmPolicyDecision' + PccRule: + description: Contains a PCC rule information. + type: object + properties: + flowInfos: + type: array + items: + $ref: '#/components/schemas/FlowInformation' + minItems: 1 + description: An array of IP flow packet filter information. + appId: + type: string + description: A reference to the application detection filter configured at the UPF. + appDescriptor: + $ref: '#/components/schemas/ApplicationDescriptor' + contVer: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + pccRuleId: + type: string + description: Univocally identifies the PCC rule within a PDU session. + precedence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + afSigProtocol: + $ref: '#/components/schemas/AfSigProtocol' + appReloc: + type: boolean + description: Indication of application relocation possibility. + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required. + refQosData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the QosData policy decision type. It is the qosId described in clause 5.6.2.8. + refAltQosParams: + type: array + items: + type: string + minItems: 1 + description: A Reference to the QosData policy decision type for the Alternative QoS parameter sets of the service data flow. + refTcData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the TrafficControlData policy decision type. It is the tcId described in clause 5.6.2.10. + refChgData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the ChargingData policy decision type. It is the chgId described in clause 5.6.2.11. + nullable: true + refChgN3gData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: > + A reference to the ChargingData policy decision type only applicable to Non-3GPP access + if "ATSSS" feature is supported. It is the chgId described in clause 5.6.2.11. + nullable: true + refUmData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to UsageMonitoringData policy decision type. It is the umId described in clause 5.6.2.12. + nullable: true + refUmN3gData: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: > + A reference to UsageMonitoringData policy decision type only applicable to Non-3GPP + access if "ATSSS" feature is supported. It is the umId described in clause 5.6.2.12. + nullable: true + refCondData: + type: string + description: A reference to the condition data. It is the condId described in clause 5.6.2.9. + nullable: true + refQosMon: + type: array + items: + type: string + minItems: 1 + maxItems: 1 + description: A reference to the QosMonitoringData policy decision type. It is the qmId described in clause 5.6.2.40. + nullable: true + addrPreserInd: + type: boolean + nullable: true + tscaiInputDl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TscaiInputContainer' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + ddNotifCtrl: + $ref: '#/components/schemas/DownlinkDataNotificationControl' + ddNotifCtrl2: + $ref: '#/components/schemas/DownlinkDataNotificationControlRm' + disUeNotif: + type: boolean + nullable: true + packFiltAllPrec: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - pccRuleId + nullable: true + SessionRule: + description: Contains session level policy information. + type: object + properties: + authSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authDefQos: + $ref: '#/components/schemas/AuthorizedDefaultQos' + sessRuleId: + type: string + description: Univocally identifies the session rule within a PDU session. + refUmData: + type: string + description: A reference to UsageMonitoringData policy decision type. It is the umId described in clause 5.6.2.12. + nullable: true + refUmN3gData: + type: string + description: A reference to UsageMonitoringData policy decision type to apply for Non-3GPP access. It is the umId described in clause 5.6.2.12. + nullable: true + refCondData: + type: string + description: A reference to the condition data. It is the condId described in clause 5.6.2.9. + nullable: true + required: + - sessRuleId + nullable: true + QosData: + description: Contains the QoS parameters. + type: object + properties: + qosId: + type: string + description: Univocally identifies the QoS control policy data within a PDU session. + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + maxbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + qnc: + type: boolean + description: > + Indicates whether notifications are requested from 3GPP NG-RAN when the GFBR can no longer + (or again) be guaranteed for a QoS Flow during the lifetime of the QoS Flow. + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevelRm' + averWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindowRm' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVolRm' + reflectiveQos: + type: boolean + description: Indicates whether the QoS information is reflective for the corresponding service data flow. + sharingKeyDl: + type: string + description: Indicates, by containing the same value, what PCC rules may share resource in downlink direction. + sharingKeyUl: + type: string + description: Indicates, by containing the same value, what PCC rules may share resource in uplink direction. + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + defQosFlowIndication: + type: boolean + description: Indicates that the dynamic PCC rule shall always have its binding with the QoS Flow associated with the default QoS rule + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + packetDelayBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + packetErrorRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + required: + - qosId + nullable: true + ConditionData: + description: Contains conditions of applicability for a rule. + type: object + properties: + condId: + type: string + description: Uniquely identifies the condition data within a PDU session. + activationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + deactivationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + required: + - condId + nullable: true + TrafficControlData: + description: Contains parameters determining how flows associated with a PCC Rule are treated (e.g. blocked, redirected, etc). + type: object + properties: + tcId: + type: string + description: Univocally identifies the traffic control policy data within a PDU session. + flowStatus: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowStatus' + redirectInfo: + $ref: '#/components/schemas/RedirectInformation' + addRedirectInfo: + type: array + items: + $ref: '#/components/schemas/RedirectInformation' + minItems: 1 + muteNotif: + type: boolean + description: Indicates whether applicat'on's start or stop notification is to be muted. + trafficSteeringPolIdDl: + type: string + description: Reference to a pre-configured traffic steering policy for downlink traffic at the SMF. + nullable: true + trafficSteeringPolIdUl: + type: string + description: Reference to a pre-configured traffic steering policy for uplink traffic at the SMF. + nullable: true + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: A list of location which the traffic shall be routed to for the AF request + nullable: true + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + nullable: true + traffCorreInd: + type: boolean + simConnInd: + type: boolean + description: Indicates whether simultaneous connectivity should be temporarily maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + upPathChgEvent: + $ref: '#/components/schemas/UpPathChgEvent' + steerFun: + $ref: '#/components/schemas/SteeringFunctionality' + steerModeDl: + $ref: '#/components/schemas/SteeringMode' + steerModeUl: + $ref: '#/components/schemas/SteeringMode' + mulAccCtrl: + $ref: '#/components/schemas/MulticastAccessControl' + required: + - tcId + nullable: true + ChargingData: + description: Contains charging related parameters. + type: object + properties: + chgId: + type: string + description: Univocally identifies the charging control policy data within a PDU session. + meteringMethod: + $ref: '#/components/schemas/MeteringMethod' + offline: + type: boolean + description: Indicates the offline charging is applicable to the PCC rule when it is included and set to true. + online: + type: boolean + description: Indicates the online charging is applicable to the PCC rule when it is included and set to true. + sdfHandl: + type: boolean + description: Indicates whether the service data flow is allowed to start while the SMF is waiting for the response to the credit request. + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + reportingLevel: + $ref: '#/components/schemas/ReportingLevel' + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + sponsorId: + type: string + description: Indicates the sponsor identity. + appSvcProvId: + type: string + description: Indicates the application service provider identity. + afChargingIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + afChargId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationChargingId' + required: + - chgId + nullable: true + UsageMonitoringData: + description: Contains usage monitoring related control information. + type: object + properties: + umId: + type: string + description: Univocally identifies the usage monitoring policy data within a PDU session. + volumeThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + volumeThresholdUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + volumeThresholdDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + timeThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + monitoringTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTimeRm' + nextVolThreshold: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextVolThresholdUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextVolThresholdDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/VolumeRm' + nextTimeThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + inactivityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + exUsagePccRuleIds: + type: array + items: + type: string + minItems: 1 + description: > + Contains the PCC rule identifier(s) which corresponding service data flow(s) shall be + excluded from PDU Session usage monitoring. It is only included in the + UsageMonitoringData instance for session level usage monitoring. + nullable: true + required: + - umId + nullable: true + RedirectInformation: + description: Contains the redirect information. + type: object + properties: + redirectEnabled: + type: boolean + description: Indicates the redirect is enable. + redirectAddressType: + $ref: '#/components/schemas/RedirectAddressType' + redirectServerAddress: + type: string + description: > + Indicates the address of the redirect server. If "redirectAddressType" attribute + indicates the IPV4_ADDR, the encoding is the same as the Ipv4Addr data type defined in + 3GPP TS 29.571.If "redirectAddressType" attribute indicates the IPV6_ADDR, the encoding + is the same as the Ipv6Addr data type defined in 3GPP TS 29.571.If "redirectAddressType" + attribute indicates the URL or SIP_URI, the encoding is the same as the Uri data type + defined in 3GPP TS 29.571. + FlowInformation: + description: Contains the flow information. + type: object + properties: + flowDescription: + $ref: '#/components/schemas/FlowDescription' + ethFlowDescription: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + packFiltId: + type: string + description: An identifier of packet filter. + packetFilterUsage: + type: boolean + description: The packet shall be sent to the UE. + tosTrafficClass: + type: string + description: Contains the Ipv4 Type-of-Service and mask field or the Ipv6 Traffic-Class field and mask field. + nullable: true + spi: + type: string + description: the security parameter index of the IPSec packet. + nullable: true + flowLabel: + type: string + description: the Ipv6 flow label header field. + nullable: true + flowDirection: + $ref: '#/components/schemas/FlowDirectionRm' + SmPolicyDeleteData: + description: Contains the parameters to be sent to the PCF when an individual SM policy is deleted. + type: object + properties: + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfoTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ranNasRelCauses: + type: array + items: + $ref: '#/components/schemas/RanNasRelCause' + minItems: 1 + description: Contains the RAN and/or NAS release cause. + accuUsageReports: + type: array + items: + $ref: '#/components/schemas/AccuUsageReport' + minItems: 1 + description: Contains the usage report + pduSessRelCause: + $ref: '#/components/schemas/PduSessionRelCause' + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + QosCharacteristics: + description: Contains QoS characteristics for a non-standardized or a non-configured 5QI. + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + resourceType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/QosResourceType' + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevel' + packetDelayBudget: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + packetErrorRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + averagingWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVol' + required: + - 5qi + - resourceType + - priorityLevel + - packetDelayBudget + - packetErrorRate + ChargingInformation: + description: Contains the addresses of the charging functions. + type: object + properties: + primaryChfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + secondaryChfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + primaryChfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + primaryChfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + secondaryChfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + secondaryChfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + required: + - primaryChfAddress + AccuUsageReport: + description: Contains the accumulated usage report information. + type: object + properties: + refUmIds: + type: string + description: An id referencing UsageMonitoringData objects associated with this usage report. + volUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + volUsageUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + volUsageDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + timeUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + nextVolUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextVolUsageUplink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextVolUsageDownlink: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + nextTimeUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - refUmIds + SmPolicyUpdateContextData: + description: Contains the policy control request trigger(s) that were met and the corresponding new value(s) or the error report of the policy enforcement. + type: object + properties: + repPolicyCtrlReqTriggers: + type: array + items: + $ref: '#/components/schemas/PolicyControlRequestTrigger' + minItems: 1 + description: The policy control reqeust trigges which are met. + accNetChIds: + type: array + items: + $ref: '#/components/schemas/AccNetChId' + minItems: 1 + description: Indicates the access network charging identifier for the PCC rule(s) or whole PDU session. + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + addAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + relAccessInfo: + $ref: '#/components/schemas/AdditionalAccessInfo' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + relIpv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + description: Indicates the IPv4 address domain + ipv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + relIpv6AddressPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addIpv6AddrPrefixes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addRelIpv6AddrPrefixes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + relUeMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + subsSessAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + authProfIndex: + type: string + description: Indicates the DN-AAA authorization profile index + subsDefQos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + vplmnQos: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/VplmnQos' + vplmnQosNotApp: + type: boolean + description: If it is included and set to true, indicates that the QoS constraints in the VPLMN are not applicable. + numOfPackFilter: + type: integer + description: Contains the number of supported packet filter for signalled QoS rules. + accuUsageReports: + type: array + items: + $ref: '#/components/schemas/AccuUsageReport' + minItems: 1 + description: Contains the usage report + 3gppPsDataOffStatus: + type: boolean + description: If it is included and set to true, the 3GPP PS Data Off is activated by the UE. + appDetectionInfos: + type: array + items: + $ref: '#/components/schemas/AppDetectionInfo' + minItems: 1 + description: Report the start/stop of the application traffic and detected SDF descriptions if applicable. + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Used to report the PCC rule failure. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Used to report the session rule failure. + qncReports: + type: array + items: + $ref: '#/components/schemas/QosNotificationControlInfo' + minItems: 1 + description: QoS Notification Control information. + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + userLocationInfoTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPraInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Reports the changes of presence reporting area. The praId attribute within the + PresenceInfo data type is the key of the map. + ueInitResReq: + $ref: '#/components/schemas/UeInitiatedResourceRequest' + refQosIndication: + type: boolean + description: > + If it is included and set to true, the reflective QoS is supported by the UE. If it is + included and set to false, the reflective QoS is revoked by the UE. + qosFlowUsage: + $ref: '#/components/schemas/QosFlowUsage' + creditManageStatus: + $ref: '#/components/schemas/CreditManagementStatus' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + traceReq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + maPduInd: + $ref: '#/components/schemas/MaPduIndication' + atsssCapab: + $ref: '#/components/schemas/AtsssCapability' + tsnBridgeInfo: + $ref: '#/components/schemas/TsnBridgeInfo' + tsnBridgeManCont: + $ref: '#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: '#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: '#/components/schemas/PortManagementContainer' + minItems: 1 + mulAddrInfos: + type: array + items: + $ref: '#/components/schemas/IpMulticastAddressInfo' + minItems: 1 + policyDecFailureReports: + type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + description: Contains the type(s) of failed policy decision and/or condition data. + invalidPolicyDecs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/InvalidParam' + minItems: 1 + description: Indicates the invalid parameters for the reported type(s) of the failed policy decision and/or condition data. + trafficDescriptors: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + pccRuleId: + type: string + description: Contains the identifier of the PCC rule which is used for traffic detection of event. + typesOfNotif: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + interGrpIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + pcfUeInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + nwdafDatas: + type: array + items: + $ref: '#/components/schemas/NwdafData' + minItems: 1 + nullable: true + anGwStatus: + type: boolean + description: > + When it is included and set to true, it indicates that the AN-Gateway has failed and + that the PCF should refrain from sending policy decisions to the SMF until it is + informed that the AN-Gateway has been recovered. + UpPathChgEvent: + description: Contains the UP path change event subscription from the AF. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorreId: + type: string + description: It is used to set the value of Notification Correlation ID in the notification sent by the SMF. + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + afAckInd: + type: boolean + required: + - notificationUri + - notifCorreId + - dnaiChgType + nullable: true + TerminationNotification: + description: Represents a Termination Notification. + type: object + properties: + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + cause: + $ref: '#/components/schemas/SmPolicyAssociationReleaseCause' + required: + - resourceUri + - cause + AppDetectionInfo: + description: Contains the detected application's traffic information. + type: object + properties: + appId: + type: string + description: A reference to the application detection filter configured at the UPF + instanceId: + type: string + description: > + Identifier sent by the SMF in order to allow correlation of application Start and Stop + events to the specific service data flow description, if service data flow descriptions + are deducible. + sdfDescriptions: + type: array + items: + $ref: '#/components/schemas/FlowInformation' + minItems: 1 + description: Contains the detected service data flow descriptions if they are deducible. + required: + - appId + AccNetChId: + description: Contains the access network charging identifier for the PCC rule(s) or for the whole PDU session. + type: object + properties: + accNetChaIdValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + accNetChargId: + type: string + description: A character string containing the access network charging id. + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the PCC rule(s) associated to the provided Access Network Charging Identifier. + sessionChScope: + type: boolean + description: When it is included and set to true, indicates the Access Network Charging Identifier applies to the whole PDU Session + oneOf: + - required: [accNetChaIdValue] + - required: [accNetChargId] + AccNetChargingAddress: + description: Describes the network entity within the access network performing charging + type: object + anyOf: + - required: [anChargIpv4Addr] + - required: [anChargIpv6Addr] + properties: + anChargIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anChargIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + RequestedRuleData: + description: Contains rule data requested by the PCF to receive information associated with PCC rule(s). + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the control data. + reqData: + type: array + items: + $ref: '#/components/schemas/RequestedRuleDataType' + minItems: 1 + description: Array of requested rule data type elements indicating what type of rule data is requested for the corresponding referenced PCC rules. + required: + - refPccRuleIds + - reqData + RequestedUsageData: + description: Contains usage data requested by the PCF requesting usage reports for the corresponding usage monitoring data instances. + type: object + properties: + refUmIds: + type: array + items: + type: string + minItems: 1 + description: > + An array of usage monitoring data id references to the usage monitoring data instances + for which the PCF is requesting a usage report. This attribute shall only be provided + when allUmIds is not set to true. + allUmIds: + type: boolean + description: > + This boolean indicates whether requested usage data applies to all usage monitoring data + instances. When it's not included, it means requested usage data shall only apply to the + usage monitoring data instances referenced by the refUmIds attribute. + UeCampingRep: + description: Contains the current applicable values corresponding to the policy control request triggers. + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servNfId: + $ref: '#/components/schemas/ServingNfIdentity' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + netLocAccSupp: + $ref: '#/components/schemas/NetLocAccessSupport' + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + RuleReport: + description: Reports the status of PCC. + type: object + properties: + pccRuleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the affected PCC rule(s). + ruleStatus: + $ref: '#/components/schemas/RuleStatus' + contVers: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + minItems: 1 + description: Indicates the version of a PCC rule. + failureCode: + $ref: '#/components/schemas/FailureCode' + finUnitAct: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/FinalUnitAction' + ranNasRelCauses: + type: array + items: + $ref: '#/components/schemas/RanNasRelCause' + minItems: 1 + description: indicates the RAN or NAS release cause code information. + altQosParamId: + type: string + required: + - pccRuleIds + - ruleStatus + RanNasRelCause: + description: Contains the RAN/NAS release cause. + type: object + properties: + ngApCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + 5gMmCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5GMmCause' + 5gSmCause: + $ref: '#/components/schemas/5GSmCause' + epsCause: + $ref: '#/components/schemas/EpsRanNasRelCause' + UeInitiatedResourceRequest: + description: Indicates that a UE requests specific QoS handling for the selected SDF. + type: object + properties: + pccRuleId: + type: string + ruleOp: + $ref: '#/components/schemas/RuleOperation' + precedence: + type: integer + packFiltInfo: + type: array + items: + $ref: '#/components/schemas/PacketFilterInfo' + minItems: 1 + reqQos: + $ref: '#/components/schemas/RequestedQos' + required: + - ruleOp + - packFiltInfo + PacketFilterInfo: + description: Contains the information from a single packet filter sent from the SMF to the PCF. + type: object + properties: + packFiltId: + type: string + description: An identifier of packet filter. + packFiltCont: + $ref: '#/components/schemas/PacketFilterContent' + tosTrafficClass: + type: string + description: Contains the Ipv4 Type-of-Service and mask field or the Ipv6 Traffic-Class field and mask field. + spi: + type: string + description: The security parameter index of the IPSec packet. + flowLabel: + type: string + description: The Ipv6 flow label header field. + flowDirection: + $ref: '#/components/schemas/FlowDirection' + RequestedQos: + description: Contains the QoS information requested by the UE. + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + required: + - 5qi + QosNotificationControlInfo: + description: Contains the QoS Notification Control Information. + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the QoS notification control info. + notifType: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/QosNotifType' + contVer: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ContentVersion' + altQosParamId: + type: string + required: + - refPccRuleIds + - notifType + PartialSuccessReport: + description: Includes the information reported by the SMF when some of the PCC rules and/or session rules are not successfully installed/activated. + type: object + properties: + failureCause: + $ref: '#/components/schemas/FailureCause' + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Information about the PCC rules provisioned by the PCF not successfully installed/activated. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Information about the session rules provisioned by the PCF not successfully installed. + ueCampingRep: + $ref: '#/components/schemas/UeCampingRep' + policyDecFailureReports: + type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + description: Contains the type(s) of failed policy decision and/or condition data. + invalidPolicyDecs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/InvalidParam' + minItems: 1 + description: Indicates the invalid parameters for the reported type(s) of the failed policy decision and/or condition data. + required: + - failureCause + AuthorizedDefaultQos: + description: Represents the Authorized Default QoS. + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + priorityLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5QiPriorityLevelRm' + averWindow: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AverWindowRm' + maxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MaxDataBurstVolRm' + maxbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + extMaxDataBurstVol: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + ErrorReport: + description: Contains the rule error reports. + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + ruleReports: + type: array + items: + $ref: '#/components/schemas/RuleReport' + minItems: 1 + description: Used to report the PCC rule failure. + sessRuleReports: + type: array + items: + $ref: '#/components/schemas/SessionRuleReport' + minItems: 1 + description: Used to report the session rule failure. + polDecFailureReports: + type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + description: Used to report failure of the policy decision and/or condition data. + invalidPolicyDecs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/InvalidParam' + minItems: 1 + description: Indicates the invalid parameters for the reported type(s) of the failed policy decision and/or condition data. + SessionRuleReport: + description: Represents reporting of the status of a session rule. + type: object + properties: + ruleIds: + type: array + items: + type: string + minItems: 1 + description: Contains the identifier of the affected session rule(s). + ruleStatus: + $ref: '#/components/schemas/RuleStatus' + sessRuleFailureCode: + $ref: '#/components/schemas/SessionRuleFailureCode' + policyDecFailureReports: + type: array + items: + $ref: '#/components/schemas/PolicyDecisionFailureCode' + minItems: 1 + description: Contains the type(s) of failed policy decision and/or condition data. + required: + - ruleIds + - ruleStatus + ServingNfIdentity: + description: Contains the serving Network Function identity. + type: object + properties: + servNfInstId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + anGwAddr: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AnGwAddress' + sgsnAddr: + $ref: '#/components/schemas/SgsnAddress' + SteeringMode: + description: Contains the steering mode value and parameters determined by the PCF. + type: object + properties: + steerModeValue: + $ref: '#/components/schemas/SteerModeValue' + active: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + standby: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessTypeRm' + 3gLoad: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + prioAcc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + thresValue: + $ref: '#/components/schemas/ThresholdValue' + steerModeInd: + $ref: '#/components/schemas/SteerModeIndicator' + required: + - steerModeValue + AdditionalAccessInfo: + description: Indicates the combination of additional Access Type and RAT Type for a MA PDU session. + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + required: + - accessType + QosMonitoringData: + description: Contains QoS monitoring related control information. + type: object + properties: + qmId: + type: string + description: Univocally identifies the QoS monitoring policy data within a PDU session. + reqQosMonParams: + type: array + items: + $ref: '#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + description: > + indicates the UL packet delay, DL packet delay and/or round trip packet delay between + the UE and the UPF is to be monitored when the QoS Monitoring for URLLC is enabled for + the service data flow. + repFreqs: + type: array + items: + $ref: '#/components/schemas/ReportingFrequency' + minItems: 1 + repThreshDl: + type: integer + description: Indicates the period of time in units of miliiseconds for DL packet delay. + nullable: true + repThreshUl: + type: integer + description: Indicates the period of time in units of miliiseconds for UL packet delay. + nullable: true + repThreshRp: + type: integer + description: Indicates the period of time in units of miliiseconds for round trip packet delay. + nullable: true + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriRm' + notifyCorreId: + type: string + nullable: true + directNotifInd: + type: boolean + description: Indicates that the direct event notification sent by UPF to the Local NEF or AF is requested if it is included and set to true. + required: + - qmId + - reqQosMonParams + - repFreqs + nullable: true + QosMonitoringReport: + description: Contains reporting information on QoS monitoring. + type: object + properties: + refPccRuleIds: + type: array + items: + type: string + minItems: 1 + description: An array of PCC rule id references to the PCC rules associated with the QoS monitoring report. + ulDelays: + type: array + items: + type: integer + minItems: 1 + dlDelays: + type: array + items: + type: integer + minItems: 1 + rtDelays: + type: array + items: + type: integer + minItems: 1 + required: + - refPccRuleIds +# + TsnBridgeInfo: + description: Contains parameters that describe and identify the TSC user plane node. + type: object + properties: + bridgeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + dsttAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + dsttPortNum: + $ref: '#/components/schemas/TsnPortNumber' + dsttResidTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' +# + PortManagementContainer: + description: Contains the port management information container for a port. + type: object + properties: + portManCont: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + portNum: + $ref: '#/components/schemas/TsnPortNumber' + required: + - portManCont + - portNum + BridgeManagementContainer: + description: Contains the UMIC. + type: object + properties: + bridgeManCont: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + required: + - bridgeManCont + IpMulticastAddressInfo: + description: Contains the IP multicast addressing information. + type: object + properties: + srcIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv4MulAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + srcIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ipv6MulAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + DownlinkDataNotificationControl: + description: Contains the downlink data notification control information. + type: object + properties: + notifCtrlInds: + type: array + items: + $ref: '#/components/schemas/NotificationControlIndication' + minItems: 1 + typesOfNotif: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + DownlinkDataNotificationControlRm: + description: This data type is defined in the same way as the DownlinkDataNotificationControl data type, but with the nullable:true property. + type: object + properties: + notifCtrlInds: + type: array + items: + $ref: '#/components/schemas/NotificationControlIndication' + minItems: 1 + nullable: true + typesOfNotif: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DlDataDeliveryStatus' + minItems: 1 + nullable: true + nullable: true + ThresholdValue: + description: Indicates the threshold value(s) for RTT and/or Packet Loss Rate. + type: object + properties: + rttThres: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + plrThres: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + nullable: true + NwdafData: + description: Indicates the list of Analytic ID(s) per NWDAF instance ID used for the PDU Session consumed by the SMF. + type: object + properties: + nwdafInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nwdafEvents: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + minItems: 1 + required: + - nwdafInstanceId + 5GSmCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + EpsRanNasRelCause: + type: string + description: Defines the EPS RAN/NAS release cause. + PacketFilterContent: + type: string + description: Defines a packet filter for an IP flow. + FlowDescription: + type: string + description: Defines a packet filter for an IP flow. + TsnPortNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + ApplicationDescriptor: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + FlowDirection: + anyOf: + - type: string + enum: + - DOWNLINK + - UPLINK + - BIDIRECTIONAL + - UNSPECIFIED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - DOWNLINK: The corresponding filter applies for traffic to the UE. + - UPLINK: The corresponding filter applies for traffic from the UE. + - BIDIRECTIONAL: The corresponding filter applies for traffic both to and from the UE. + - UNSPECIFIED: The corresponding filter applies for traffic to the UE (downlink), but has no specific direction declared. The service data flow detection shall apply the filter for uplink traffic as if the filter was bidirectional. The PCF shall not use the value UNSPECIFIED in filters created by the network in NW-initiated procedures. The PCF shall only include the value UNSPECIFIED in filters in UE-initiated procedures if the same value is received from the SMF. + FlowDirectionRm: + description: This data type is defined in the same way as the "FlowDirection" data type, with the only difference that it allows null value. + anyOf: + - $ref: '#/components/schemas/FlowDirection' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + ReportingLevel: + anyOf: + - type: string + enum: + - SER_ID_LEVEL + - RAT_GR_LEVEL + - SPON_CON_LEVEL + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - SER_ID_LEVEL: Indicates that the usage shall be reported on service id and rating group combination level. + - RAT_GR_LEVEL: Indicates that the usage shall be reported on rating group level. + - SPON_CON_LEVEL: Indicates that the usage shall be reported on sponsor identity and rating group combination level. + MeteringMethod: + anyOf: + - type: string + enum: + - DURATION + - VOLUME + - DURATION_VOLUME + - EVENT + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - DURATION: Indicates that the duration of the service data flow traffic shall be metered. + - VOLUME: Indicates that volume of the service data flow traffic shall be metered. + - DURATION_VOLUME: Indicates that the duration and the volume of the service data flow traffic shall be metered. + - EVENT: Indicates that events of the service data flow traffic shall be metered. + PolicyControlRequestTrigger: + anyOf: + - type: string + enum: + - PLMN_CH + - RES_MO_RE + - AC_TY_CH + - UE_IP_CH + - UE_MAC_CH + - AN_CH_COR + - US_RE + - APP_STA + - APP_STO + - AN_INFO + - CM_SES_FAIL + - PS_DA_OFF + - DEF_QOS_CH + - SE_AMBR_CH + - QOS_NOTIF + - NO_CREDIT + - REALLO_OF_CREDIT + - PRA_CH + - SAREA_CH + - SCNN_CH + - RE_TIMEOUT + - RES_RELEASE + - SUCC_RES_ALLO + - RAI_CH + - RAT_TY_CH + - REF_QOS_IND_CH + - NUM_OF_PACKET_FILTER + - UE_STATUS_RESUME + - UE_TZ_CH + - AUTH_PROF_CH + - QOS_MONITORING + - SCELL_CH + - USER_LOCATION_CH + - EPS_FALLBACK + - MA_PDU + - TSN_BRIDGE_INFO + - 5G_RG_JOIN + - 5G_RG_LEAVE + - DDN_FAILURE + - DDN_DELIVERY_STATUS + - GROUP_ID_LIST_CHG + - DDN_FAILURE_CANCELLATION + - DDN_DELIVERY_STATUS_CANCELLATION + - VPLMN_QOS_CH + - SUCC_QOS_UPDATE + - SAT_CATEGORY_CHG + - PCF_UE_NOTIF_IND + - NWDAF_DATA_CHG + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - PLMN_CH: PLMN Change + - RES_MO_RE: A request for resource modification has been received by the SMF. The SMF always reports to the PCF. + - AC_TY_CH: Access Type Change + - UE_IP_CH: UE IP address change. The SMF always reports to the PCF. + - UE_MAC_CH: A new UE MAC address is detected or a used UE MAC address is inactive for a specific period + - AN_CH_COR: Access Network Charging Correlation Information + - US_RE: The PDU Session or the Monitoring key specific resources consumed by a UE either reached the threshold or needs to be reported for other reasons. + - APP_STA: The start of application traffic has been detected. + - APP_STO: The stop of application traffic has been detected. + - AN_INFO: Access Network Information report + - CM_SES_FAIL: Credit management session failure + - PS_DA_OFF: The SMF reports when the 3GPP PS Data Off status changes. The SMF always reports to the PCF. + - DEF_QOS_CH: Default QoS Change. The SMF always reports to the PCF. + - SE_AMBR_CH: Session-AMBR Change. The SMF always reports to the PCF. + - QOS_NOTIF: The SMF notify the PCF when receiving notification from RAN that QoS targets of the QoS Flow cannot be guranteed or gurateed again. + - NO_CREDIT: Out of credit + - REALLO_OF_CREDIT: Reallocation of credit + - PRA_CH: Change of UE presence in Presence Reporting Area + - SAREA_CH: Location Change with respect to the Serving Area + - SCNN_CH: Location Change with respect to the Serving CN node + - RE_TIMEOUT: Indicates the SMF generated the request because there has been a PCC revalidation timeout + - RES_RELEASE: Indicate that the SMF can inform the PCF of the outcome of the release of resources for those rules that require so. + - SUCC_RES_ALLO: Indicates that the requested rule data is the successful resource allocation. + - RAI_CH: Location Change with respect to the RAI of GERAN and UTRAN. + - RAT_TY_CH: RAT Type Change. + - REF_QOS_IND_CH: Reflective QoS indication Change + - NUM_OF_PACKET_FILTER: Indicates that the SMF shall report the number of supported packet filter for signalled QoS rules + - UE_STATUS_RESUME: Indicates that the UE's status is resumed. + - UE_TZ_CH: UE Time Zone Change + - AUTH_PROF_CH: The DN-AAA authorization profile index has changed + - QOS_MONITORING: Indicate that the SMF notifies the PCF of the QoS Monitoring information. + - SCELL_CH: Location Change with respect to the Serving Cell. + - USER_LOCATION_CH: Indicate that user location has been changed, applicable to serving area change and serving cell change. + - EPS_FALLBACK: EPS Fallback report is enabled in the SMF. + - MA_PDU: UE Indicates that the SMF notifies the PCF of the MA PDU session request + - TSN_BRIDGE_INFO: TSC user plane node information available + - 5G_RG_JOIN: The 5G-RG has joined to an IP Multicast Group. + - 5G_RG_LEAVE: The 5G-RG has left an IP Multicast Group. + - DDN_FAILURE: Event subscription for DDN Failure event received. + - DDN_DELIVERY_STATUS: Event subscription for DDN Delivery Status received. + - GROUP_ID_LIST_CHG: UE Internal Group Identifier(s) has changed: the SMF reports that UDM provided list of group Ids has changed. + - DDN_FAILURE_CANCELLATION: The event subscription for DDN Failure event is cancelled. + - DDN_DELIVERY_STATUS_CANCELLATION: The event subscription for DDD STATUS is cancelled. + - VPLMN_QOS_CH: Change of the QoS supported in the VPLMN. + - SUCC_QOS_UPDATE: Indicates that the requested MPS Action is successful. + - SAT_CATEGORY_CHG: Indicates that the SMF has detected a change between different satellite backhaul categories, or between a satellite backhaul and a non-satellite backhaul. + - PCF_UE_NOTIF_IND: Indicates the SMF has detected the AMF forwarded the PCF for the UE indication to receive/stop receiving notifications of SM Policy association established/terminated events. + - NWDAF_DATA_CHG: Indicates that the NWDAF instance IDs used for the PDU session and/or associated Analytics IDs used for the PDU session and available in the SMF have changed. + RequestedRuleDataType: + anyOf: + - type: string + enum: + - CH_ID + - MS_TIME_ZONE + - USER_LOC_INFO + - RES_RELEASE + - SUCC_RES_ALLO + - EPS_FALLBACK + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - CH_ID: Indicates that the requested rule data is the charging identifier. + - MS_TIME_ZONE: Indicates that the requested access network info type is the UE's timezone. + - USER_LOC_INFO: Indicates that the requested access network info type is the UE's location. + - RES_RELEASE: Indicates that the requested rule data is the result of the release of resource. + - SUCC_RES_ALLO: Indicates that the requested rule data is the successful resource allocation. + - EPS_FALLBACK: Indicates that the requested rule data is the report of QoS flow rejection due to EPS fallback. + RuleStatus: + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - ACTIVE: Indicates that the PCC rule(s) are successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF), or the session rule(s) are successfully installed + - INACTIVE: Indicates that the PCC rule(s) are removed (for those provisioned from PCF) or inactive (for those pre-defined in SMF) or the session rule(s) are removed. + FailureCode: + anyOf: + - type: string + enum: + - UNK_RULE_ID + - RA_GR_ERR + - SER_ID_ERR + - NF_MAL + - RES_LIM + - MAX_NR_QoS_FLOW + - MISS_FLOW_INFO + - RES_ALLO_FAIL + - UNSUCC_QOS_VAL + - INCOR_FLOW_INFO + - PS_TO_CS_HAN + - APP_ID_ERR + - NO_QOS_FLOW_BOUND + - FILTER_RES + - MISS_REDI_SER_ADDR + - CM_END_USER_SER_DENIED + - CM_CREDIT_CON_NOT_APP + - CM_AUTH_REJ + - CM_USER_UNK + - CM_RAT_FAILED + - UE_STA_SUSP + - UNKNOWN_REF_ID + - INCORRECT_COND_DATA + - REF_ID_COLLISION + - TRAFFIC_STEERING_ERROR + - DNAI_STEERING_ERROR + - AN_GW_FAILE + - MAX_NR_PACKET_FILTERS_EXCEEDED + - PACKET_FILTER_TFT_ALLOCATION_EXCEEDED + - MUTE_CHG_NOT_ALLOWED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - UNK_RULE_ID: Indicates that the pre-provisioned PCC rule could not be successfully activated because the PCC rule identifier is unknown to the SMF. + - RA_GR_ERR: Indicate that the PCC rule could not be successfully installed or enforced because the Rating Group specified within the Charging Data policy decision which the PCC rule refers to is unknown or, invalid. + - SER_ID_ERR: Indicate that the PCC rule could not be successfully installed or enforced because the Service Identifier specified within the Charging Data policy decision which the PCC rule refers to is invalid, unknown, or not applicable to the service being charged. + - NF_MAL: Indicate that the PCC rule could not be successfully installed (for those provisioned from the PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to SMF/UPF malfunction. + - RES_LIM: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to a limitation of resources at the SMF/UPF. + - MAX_NR_QoS_FLOW: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to the fact that the maximum number of QoS flows has been reached for the PDU session. + - MISS_FLOW_INFO: Indicate that the PCC rule could not be successfully installed or enforced because neither the "flowInfos" attribute nor the "appId" attribute is specified within the PccRule data structure by the PCF during the first install request of the PCC rule. + - RES_ALLO_FAIL: Indicate that the PCC rule could not be successfully installed or maintained since the QoS flow establishment/modification failed, or the QoS flow was released. + - UNSUCC_QOS_VAL: indicate that the QoS validation has failed or when Guaranteed Bandwidth > Max-Requested-Bandwidth. + - INCOR_FLOW_INFO: Indicate that the PCC rule could not be successfully installed or modified at the SMF because the provided flow information is not supported by the network (e.g. the provided IP address(es) or Ipv6 prefix(es) do not correspond to an IP version applicable for the PDU session). + - PS_TO_CS_HAN: Indicate that the PCC rule could not be maintained because of PS to CS handover. + - APP_ID_ERR: Indicate that the rule could not be successfully installed or enforced because the Application Identifier is invalid, unknown, or not applicable to the application required for detection. + - NO_QOS_FLOW_BOUND: Indicate that there is no QoS flow which the SMF can bind the PCC rule(s) to. + - FILTER_RES: Indicate that the Flow Information within the "flowInfos" attribute cannot be handled by the SMF because any of the restrictions defined in clause 5.4.2 of 3GPP TS 29.212 was not met. + - MISS_REDI_SER_ADDR: Indicate that the PCC rule could not be successfully installed or enforced at the SMF because there is no valid Redirect Server Address within the Traffic Control Data policy decision which the PCC rule refers to provided by the PCF and no preconfigured redirection address for this PCC rule at the SMF. + - CM_END_USER_SER_DENIED: Indicate that the charging system denied the service request due to service restrictions (e.g. terminate rating group) or limitations related to the end-user, for example the end-user's account could not cover the requested service. + - CM_CREDIT_CON_NOT_APP: Indicate that the charging system determined that the service can be granted to the end user but no further credit control is needed for the service (e.g. service is free of charge or is treated for offline charging). + - CM_AUTH_REJ: Indicate that the charging system denied the service request in order to terminate the service for which credit is requested. + - CM_USER_UNK: Indicate that the specified end user could not be found in the charging system. + - CM_RAT_FAILED: Indicate that the charging system cannot rate the service request due to insufficient rating input, incorrect AVP combination or due to an attribute or an attribute value that is not recognized or supported in the rating. + - UE_STA_SUSP: Indicates that the UE is in suspend state. + - UNKNOWN_REF_ID: Indicates that the PCC rule could not be successfully installed/modified because the referenced identifier to a Policy Decision Data or to a Condition Data is unknown to the SMF. + - INCORRECT_COND_DATA: Indicates that the PCC rule could not be successfully installed/modified because the referenced Condition data are incorrect. + - REF_ID_COLLISION: Indicates that PCC rule could not be successfully installed/modified because the same Policy Decision is referenced by a session rule (e.g. the session rule and the PCC rule refer to the same Usage Monitoring decision data). + - TRAFFIC_STEERING_ERROR: Indicates that enforcement of the steering of traffic to the N6-LAN or 5G-LAN failed; or the dynamic PCC rule could not be successfully installed or modified at the NF service consumer because there are invalid traffic steering policy identifier(s) within the provided Traffic Control Data policy decision to which the PCC rule refers. + - DNAI_STEERING_ERROR: Indicates that the enforcement of the steering of traffic to the indicated DNAI failed; or the dynamic PCC rule could not be successfully installed or modified at the NF service consumer because there is invalid route information for a DNAI(s) (e.g. routing profile id is not configured) within the provided Traffic Control Data policy decision to which the PCC rule refers. + - AN_GW_FAILED: This value is used to indicate that the AN-Gateway has failed and that the PCF should refrain from sending policy decisions to the SMF until it is informed that the S-GW has been recovered. This value shall not be used if the SM Policy association modification procedure is initiated for PCC rule removal only. + - MAX_NR_PACKET_FILTERS_EXCEEDED: This value is used to indicate that the PCC rule could not be successfully installed, modified or enforced at the NF service consumer because the number of supported packet filters for signalled QoS rules for the PDU session has been reached. + - PACKET_FILTER_TFT_ALLOCATION_EXCEEDED: This value is used to indicate that the PCC rule is removed at 5GS to EPS mobility because TFT allocation was not possible since the number of active packet filters in the EPC bearer is exceeded. + - MUTE_CHG_NOT_ALLOWED: Indicates that the PCC rule could not be successfully modified because the mute condition for application detection report cannot be changed. Applicable when the functionality introduced with the ADC feature applies. + AfSigProtocol: + anyOf: + - type: string + enum: + - NO_INFORMATION + - SIP + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - NO_INFORMATION: Indicate that no information about the AF signalling protocol is being provided. + - SIP: Indicate that the signalling protocol is Session Initiation Protocol. + RuleOperation: + anyOf: + - type: string + enum: + - CREATE_PCC_RULE + - DELETE_PCC_RULE + - MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS + - MODIFY_ PCC_RULE_AND_REPLACE_PACKET_FILTERS + - MODIFY_ PCC_RULE_AND_DELETE_PACKET_FILTERS + - MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - CREATE_PCC_RULE: Indicates to create a new PCC rule to reserve the resource requested by the UE. + - DELETE_PCC_RULE: Indicates to delete a PCC rule corresponding to reserve the resource requested by the UE. + - MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS: Indicates to modify the PCC rule by adding new packet filter(s). + - MODIFY_ PCC_RULE_AND_REPLACE_PACKET_FILTERS: Indicates to modify the PCC rule by replacing the existing packet filter(s). + - MODIFY_ PCC_RULE_AND_DELETE_PACKET_FILTERS: Indicates to modify the PCC rule by deleting the existing packet filter(s). + - MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS: Indicates to modify the PCC rule by modifying the QoS of the PCC rule. + RedirectAddressType: + anyOf: + - type: string + enum: + - IPV4_ADDR + - IPV6_ADDR + - URL + - SIP_URI + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - IPV4_ADDR: Indicates that the address type is in the form of "dotted-decimal" IPv4 address. + - IPV6_ADDR: Indicates that the address type is in the form of IPv6 address. + - URL: Indicates that the address type is in the form of Uniform Resource Locator. + - SIP_URI: Indicates that the address type is in the form of SIP Uniform Resource Identifier. + QosFlowUsage: + anyOf: + - type: string + enum: + - GENERAL + - IMS_SIG + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - GENERAL: Indicate no specific QoS flow usage information is available. + - IMS_SIG: Indicate that the QoS flow is used for IMS signalling only. + FailureCause: + description: Indicates the cause of the failure in a Partial Success Report. + anyOf: + - type: string + enum: + - PCC_RULE_EVENT + - PCC_QOS_FLOW_EVENT + - RULE_PERMANENT_ERROR + - RULE_TEMPORARY_ERROR + - POL_DEC_ERROR + - type: string + CreditManagementStatus: + description: Indicates the reason of the credit management session failure. + anyOf: + - type: string + enum: + - END_USER_SER_DENIED + - CREDIT_CTRL_NOT_APP + - AUTH_REJECTED + - USER_UNKNOWN + - RATING_FAILED + - type: string + SessionRuleFailureCode: + anyOf: + - type: string + enum: + - NF_MAL + - RES_LIM + - SESSION_RESOURCE_ALLOCATION_FAILURE + - UNSUCC_QOS_VAL + - INCORRECT_UM + - UE_STA_SUSP + - UNKNOWN_REF_ID + - INCORRECT_COND_DATA + - REF_ID_COLLISION + - AN_GW_FAILED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - NF_MAL: Indicates that the PCC rule could not be successfully installed (for those provisioned from the PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to SMF/UPF malfunction. + - RES_LIM: Indicates that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to a limitation of resources at the SMF/UPF. + - SESSION_RESOURCE_ALLOCATION_FAILURE: Indicates the session rule could not be successfully enforced due to failure during the allocation of resources for the PDU session in the UE, RAN or AMF. + - UNSUCC_QOS_VAL: indicates that the QoS validation has failed. + - INCORRECT_UM: The usage monitoring data of the enforced session rule is not the same for all the provisioned session rule(s). + - UE_STA_SUSP: Indicates that the UE is in suspend state. + - UNKNOWN_REF_ID: Indicates that the session rule could not be successfully installed/modified because the referenced identifier to a Policy Decision Data or to a Condition Data is unknown to the SMF. + - INCORRECT_COND_DATA: Indicates that the session rule could not be successfully installed/modified because the referenced Condition data are incorrect. + - REF_ID_COLLISION: Indicates that the session rule could not be successfully installed/modified because the same Policy Decision is referenced by a PCC rule (e.g. the session rule and the PCC rule refer to the same Usage Monitoring decision data). + - AN_GW_FAILED: Indicates that the AN-Gateway has failed and that the PCF should refrain from sending policy decisions to the SMF until it is informed that the S-GW has been recovered. This value shall not be used if the SM Policy association modification procedure is initiated for session rule removal only. + SteeringFunctionality: + anyOf: + - type: string + enum: + - MPTCP + - ATSSS_LL + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - MPTCP: Indicates that PCF authorizes the MPTCP functionality to support traffic steering, switching and splitting. + - ATSSS_LL: Indicates that PCF authorizes the ATSSS-LL functionality to support traffic steering, switching and splitting. + SteerModeValue: + description: Indicates the steering mode value determined by the PCF. + anyOf: + - type: string + enum: + - ACTIVE_STANDBY + - LOAD_BALANCING + - SMALLEST_DELAY + - PRIORITY_BASED + - type: string + MulticastAccessControl: + description: Indicates whether the service data flow, corresponding to the service data flow template, is allowed or not allowed. + anyOf: + - type: string + enum: + - ALLOWED + - NOT_ALLOWED + - type: string + RequestedQosMonitoringParameter: + description: Indicates the requested QoS monitoring parameters to be measured. + anyOf: + - type: string + enum: + - DOWNLINK + - UPLINK + - ROUND_TRIP + - type: string + ReportingFrequency: + description: Indicates the frequency for the reporting. + anyOf: + - type: string + enum: + - EVENT_TRIGGERED + - PERIODIC + - SESSION_RELEASE + - type: string + SgsnAddress: + description: describes the address of the SGSN + type: object + anyOf: + - required: [sgsnIpv4Addr] + - required: [sgsnIpv6Addr] + properties: + sgsnIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + sgsnIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + SmPolicyAssociationReleaseCause: + description: Represents the cause due to which the PCF requests the termination of the SM policy association. + anyOf: + - type: string + enum: + - UNSPECIFIED + - UE_SUBSCRIPTION + - INSUFFICIENT_RES + - VALIDATION_CONDITION_NOT_MET + - REACTIVATION_REQUESTED + - type: string + PduSessionRelCause: + description: Contains the SMF PDU Session release cause. + anyOf: + - type: string + enum: + - PS_TO_CS_HO + - RULE_ERROR + - type: string + MaPduIndication: + description: Contains the MA PDU session indication, i.e., MA PDU Request or MA PDU Network-Upgrade Allowed. + anyOf: + - type: string + enum: + - MA_PDU_REQUEST + - MA_PDU_NETWORK_UPGRADE_ALLOWED + - type: string + AtsssCapability: + description: Contains the ATSSS capability supported for the MA PDU Session. + anyOf: + - type: string + enum: + - MPTCP_ATSSS_LL_WITH_ASMODE_UL + - MPTCP_ATSSS_LL_WITH_EXSDMODE_DL_ASMODE_UL + - MPTCP_ATSSS_LL_WITH_ASMODE_DLUL + - ATSSS_LL + - MPTCP_ATSSS_LL + - type: string +# + NetLocAccessSupport: + anyOf: + - type: string + enum: + - ANR_NOT_SUPPORTED + - TZR_NOT_SUPPORTED + - LOC_NOT_SUPPORTED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - ANR_NOT_SUPPORTED: Indicates that the access network does not support the report of access network information. + - TZR_NOT_SUPPORTED: Indicates that the access network does not support the report of UE time zone. + - LOC_NOT_SUPPORTED: Indicates that the access network does not support the report of UE Location (or PLMN Id). + PolicyDecisionFailureCode: + description: Indicates the type of the failed policy decision and/or condition data. + anyOf: + - type: string + enum: + - TRA_CTRL_DECS_ERR + - QOS_DECS_ERR + - CHG_DECS_ERR + - USA_MON_DECS_ERR + - QOS_MON_DECS_ERR + - CON_DATA_ERR + - POLICY_PARAM_ERR + - type: string +# + NotificationControlIndication: + description: Indicates that the notification of DDD Status is requested and/or that the notification of DDN Failure is requested. + anyOf: + - type: string + enum: + - DDN_FAILURE + - DDD_STATUS + - type: string +# + SteerModeIndicator: + description: Contains Autonomous load-balance indicator or UE-assistance indicator. + anyOf: + - type: string + enum: + - AUTO_LOAD_BALANCE + - UE_ASSISTANCE + - type: string +# diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29514_Npcf_PolicyAuthorization.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29514_Npcf_PolicyAuthorization.yaml new file mode 100644 index 000000000..3cbc400bc --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29514_Npcf_PolicyAuthorization.yaml @@ -0,0 +1,2085 @@ +openapi: 3.0.0 +info: + title: Npcf_PolicyAuthorization Service API + version: 1.2.1 + description: | + PCF Policy Authorization Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.514 V17.6.0; 5G System; Policy Authorization Service; Stage 3. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.514/' +# +servers: + - url: '{apiRoot}/npcf-policyauthorization/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - npcf-policyauthorization +paths: + /app-sessions: + post: + summary: Creates a new Individual Application Session Context resource + operationId: PostAppSessions + tags: + - Application Sessions (Collection) + requestBody: + description: Contains the information for the creation the resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + responses: + '201': + description: Successful creation of the resource + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + headers: + Location: + description: > + Contains the URI of the created individual application session context resource, + according to the structure + {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId} + or the URI of the created events subscription sub-resource, + according to the structure + {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId}/events-subscription} + required: true + schema: + type: string + '303': + description: See Other. The result of the HTTP POST request would be equivalent to the existing Application Session Context. + headers: + Location: + description: Contains the URI of the existing individual Application Session Context resource. + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtendedProblemDetails' + headers: + Retry-After: + description: > + Indicates the time the AF has to wait before making a new request. It can be a + non-negative integer (decimal number) indicating the number of seconds the AF + has to wait before making a new request or an HTTP-date after which the AF can + retry a new request. + schema: + anyOf: + - type: integer + - type: string + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + terminationRequest: + '{$request.body#/ascReqData/notifUri}/terminate': + post: + requestBody: + description: Request of the termination of the Individual Application Session Context. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TerminationInfo' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + eventNotification: + '{$request.body#/ascReqData/evSubsc/notifUri}/notify': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + detected5GsBridgeForPduSession: + '{$request.body#/ascReqData/evSubsc/notifUri}/new-bridge': + post: + requestBody: + description: Notification of a new TSC user plane node detected in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionTsnBridge' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + eventNotificationPduSession: + '{$request.body#/ascReqData/evSubsc/notifUri}/pdu-session': + post: + requestBody: + description: Notification of PDU session established or terminated. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionEventNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /app-sessions/pcscf-restoration: + post: + summary: "Indicates P-CSCF restoration and does not create an Individual Application Session Context" + operationId: PcscfRestoration + tags: + - PCSCF Restoration Indication + requestBody: + description: PCSCF Restoration Indication. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcscfRestorationRequestData' + responses: + '204': + description: The deletion is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-sessions/{appSessionId}: + get: + summary: "Reads an existing Individual Application Session Context" + operationId: GetAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: String identifying the resource. + in: path + required: true + schema: + type: string + responses: + '200': + description: A representation of the resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: "Modifies an existing Individual Application Session Context" + operationId: ModAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: String identifying the resource. + in: path + required: true + schema: + type: string + requestBody: + description: Modification of the resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppSessionContextUpdateDataPatch' + responses: + '200': + description: Successful modification of the resource and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '204': + description: The successful modification. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtendedProblemDetails' + headers: + Retry-After: + description: > + Indicates the time the AF has to wait before making a new request. It can be a + non-negative integer (decimal number) indicating the number of seconds the AF has + to wait before making a new request or an HTTP-date after which the AF can retry + a new request. + schema: + anyOf: + - type: integer + - type: string + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + eventNotification: + '{$request.body#/ascReqData/evSubsc/notifUri}/notify': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# +# + /app-sessions/{appSessionId}/delete: + post: + summary: "Deletes an existing Individual Application Session Context" + operationId: DeleteAppSession + tags: + - Individual Application Session Context (Document) + parameters: + - name: appSessionId + description: String identifying the Individual Application Session Context resource. + in: path + required: true + schema: + type: string + requestBody: + description: Deletion of the Individual Application Session Context resource, req notification. + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscReqData' + responses: + '200': + description: The deletion of the resource is confirmed and a resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppSessionContext' + '204': + description: The deletion is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-sessions/{appSessionId}/events-subscription: + put: + summary: "creates or modifies an Events Subscription subresource" + operationId: updateEventsSubsc + tags: + - Events Subscription (Document) + parameters: + - name: appSessionId + description: String identifying the Events Subscription resource. + in: path + required: true + schema: + type: string + requestBody: + description: Creation or modification of an Events Subscription resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscReqData' + responses: + '201': + description: The creation of the Events Subscription resource is confirmed and its representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscPutData' + headers: + Location: + description: > + Contains the URI of the created Events Subscription resource, + according to the structure + {apiRoot}/npcf-policyauthorization/v1/app-sessions/{appSessionId}/events-subscription} + required: true + schema: + type: string + '200': + description: The modification of the Events Subscription resource is confirmed its representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/EventsSubscPutData' + '204': + description: The modification of the Events Subscription subresource is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + eventNotification: + '{$request.body#/notifUri}/notify': + post: + requestBody: + description: Contains the information for the notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: deletes the Events Subscription subresource + operationId: DeleteEventsSubsc + tags: + - Events Subscription (Document) + parameters: + - name: appSessionId + description: String identifying the Individual Application Session Context resource. + in: path + required: true + schema: + type: string + responses: + '204': + description: The deletion of the of the Events Subscription sub-resource is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-policyauthorization: Access to the Npcf_PolicyAuthorization API + schemas: + AppSessionContext: + description: Represents an Individual Application Session Context resource. + type: object + properties: + ascReqData: + $ref: '#/components/schemas/AppSessionContextReqData' + ascRespData: + $ref: '#/components/schemas/AppSessionContextRespData' + evsNotif: + $ref: '#/components/schemas/EventsNotification' + AppSessionContextReqData: + description: Identifies the service requirements of an Individual Application Session Context. + type: object + required: + - notifUri + - suppFeat + oneOf: + - required: [ueIpv4] + - required: [ueIpv6] + - required: [ueMac] + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afChargId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationChargingId' + afReqData: + $ref: '#/components/schemas/AfRequestedData' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirement' + aspId: + $ref: '#/components/schemas/AspId' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + evSubsc: + $ref: '#/components/schemas/EventsSubscReqData' + mcpttId: + description: Indication of MCPTT service request. + type: string + mcVideoId: + description: Indication of MCVideo service request. + type: string + medComponents: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponent' + minProperties: 1 + description: Contains media component information. The key of the map is the medCompN attribute. + ipDomain: + type: string + mpsAction: + $ref: '#/components/schemas/MpsAction' + mpsId: + description: Indication of MPS service request. + type: string + mcsId: + description: Indication of MCS service request. + type: string + preemptControlInfo: + $ref: '#/components/schemas/PreemptionControlInformation' + resPrio: + $ref: '#/components/schemas/ReservPriority' + servInfStatus: + $ref: '#/components/schemas/ServiceInfoStatus' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + servUrn: + $ref: '#/components/schemas/ServiceUrn' + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + sponId: + $ref: '#/components/schemas/SponId' + sponStatus: + $ref: '#/components/schemas/SponsoringStatus' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + tsnBridgeManCont: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + AppSessionContextRespData: + description: Describes the authorization data of an Individual Application Session Context created by the PCF. + type: object + properties: + servAuthInfo: + $ref: '#/components/schemas/ServAuthInfo' + ueIds: + type: array + items: + $ref: '#/components/schemas/UeIdentityInfo' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + AppSessionContextUpdateDataPatch: + description: Identifies the modifications to an Individual Application Session Context and/or the modifications to the sub-resource Events Subscription. + type: object + properties: + ascReqData: + $ref: '#/components/schemas/AppSessionContextUpdateData' + AppSessionContextUpdateData: + description: > + Identifies the modifications to the "ascReqData" property of an Individual Application + Session Context which may include the modifications to the sub-resource Events Subscription. + type: object + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirementRm' + aspId: + $ref: '#/components/schemas/AspId' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + evSubsc: + $ref: '#/components/schemas/EventsSubscReqDataRm' + mcpttId: + description: Indication of MCPTT service request. + type: string + mcVideoId: + description: Indication of modification of MCVideo service. + type: string + medComponents: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponentRm' + minProperties: 1 + description: Contains media component information. The key of the map is the medCompN attribute. + mpsAction: + $ref: '#/components/schemas/MpsAction' + mpsId: + description: Indication of MPS service request. + type: string + mcsId: + description: Indication of MCS service request. + type: string + preemptControlInfo: + $ref: '#/components/schemas/PreemptionControlInformationRm' + resPrio: + $ref: '#/components/schemas/ReservPriority' + servInfStatus: + $ref: '#/components/schemas/ServiceInfoStatus' + sipForkInd: + $ref: '#/components/schemas/SipForkingIndication' + sponId: + $ref: '#/components/schemas/SponId' + sponStatus: + $ref: '#/components/schemas/SponsoringStatus' + tsnBridgeManCont: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + EventsSubscReqData: + description: Identifies the events the application subscribes to. + type: object + required: + - events + properties: + events: + type: array + items: + $ref: '#/components/schemas/AfEventSubscription' + minItems: 1 + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + qosMon: + $ref: '#/components/schemas/QosMonitoringInformation' + reqAnis: + type: array + items: + $ref: '#/components/schemas/RequiredAccessInfo' + minItems: 1 + usgThres: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + notifCorreId: + type: string + afAppIds: + type: array + items: + $ref: '#/components/schemas/AfAppId' + minItems: 1 + directNotifInd: + type: boolean + EventsSubscReqDataRm: + description: This data type is defined in the same way as the EventsSubscReqData data type, but with the OpenAPI nullable property set to true. + type: object + required: + - events + properties: + events: + type: array + items: + $ref: '#/components/schemas/AfEventSubscription' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reqQosMonParams: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RequestedQosMonitoringParameter' + minItems: 1 + qosMon: + $ref: '#/components/schemas/QosMonitoringInformationRm' + reqAnis: + type: array + items: + $ref: '#/components/schemas/RequiredAccessInfo' + minItems: 1 + usgThres: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThresholdRm' + notifCorreId: + type: string + directNotifInd: + type: boolean + nullable: true + nullable: true + MediaComponent: + description: Identifies a media component. + type: object + required: + - medCompN + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirement' + qosReference: + type: string + disUeNotif: + type: boolean + altSerReqs: + type: array + items: + type: string + minItems: 1 + altSerReqsData: + type: array + items: + $ref: '#/components/schemas/AlternativeServiceRequirementsData' + minItems: 1 + description: Contains alternative service requirements that include individual QoS parameter sets. + contVer: + $ref: '#/components/schemas/ContentVersion' + codecs: + type: array + items: + $ref: '#/components/schemas/CodecData' + minItems: 1 + maxItems: 2 + desMaxLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + desMaxLoss: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + flusId: + type: string + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxSuppBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxSuppBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + medCompN: + type: integer + medSubComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaSubComponent' + minProperties: 1 + description: Contains the requested bitrate and filters for the set of service data flows identified by their common flow identifier. The key of the map is the fNum attribute. + medType: + $ref: '#/components/schemas/MediaType' + minDesBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + minDesBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + preemptCap: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionVulnerability' + prioSharingInd: + $ref: '#/components/schemas/PrioritySharingIndicator' + resPrio: + $ref: '#/components/schemas/ReservPriority' + rrBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + rsBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + sharingKeyDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + sharingKeyUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + tsnQos: + $ref: '#/components/schemas/TsnQosContainer' + tscaiInputDl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + MediaComponentRm: + description: This data type is defined in the same way as the MediaComponent data type, but with the OpenAPI nullable property set to true. + type: object + required: + - medCompN + properties: + afAppId: + $ref: '#/components/schemas/AfAppId' + afRoutReq: + $ref: '#/components/schemas/AfRoutingRequirementRm' + qosReference: + type: string + nullable: true + altSerReqs: + type: array + items: + type: string + minItems: 1 + nullable: true + altSerReqsData: + type: array + items: + $ref: '#/components/schemas/AlternativeServiceRequirementsData' + minItems: 1 + description: Contains removable alternative service requirements that include individual QoS parameter sets. + nullable: true + disUeNotif: + type: boolean + contVer: + $ref: '#/components/schemas/ContentVersion' + codecs: + type: array + items: + $ref: '#/components/schemas/CodecData' + minItems: 1 + maxItems: 2 + desMaxLatency: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FloatRm' + desMaxLoss: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FloatRm' + flusId: + type: string + nullable: true + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxPacketLossRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxPacketLossRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRateRm' + maxSuppBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + maxSuppBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + medCompN: + type: integer + medSubComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaSubComponentRm' + minProperties: 1 + description: Contains the requested bitrate and filters for the set of service data flows identified by their common flow identifier. The key of the map is the fNum attribute. + medType: + $ref: '#/components/schemas/MediaType' + minDesBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + minDesBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + mirBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + mirBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + preemptCap: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionCapabilityRm' + preemptVuln: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PreemptionVulnerabilityRm' + prioSharingInd: + $ref: '#/components/schemas/PrioritySharingIndicator' + resPrio: + $ref: '#/components/schemas/ReservPriority' + rrBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + rsBw: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + sharingKeyDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32Rm' + sharingKeyUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32Rm' + tsnQos: + $ref: '#/components/schemas/TsnQosContainerRm' + tscaiInputDl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiInputUl: + $ref: '#/components/schemas/TscaiInputContainer' + tscaiTimeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + nullable: true + MediaSubComponent: + description: Identifies a media subcomponent. + type: object + required: + - fNum + properties: + afSigProtocol: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AfSigProtocol' + ethfDescs: + type: array + items: + $ref: '#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + fNum: + type: integer + fDescs: + type: array + items: + $ref: '#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + tosTrCl: + $ref: '#/components/schemas/TosTrafficClass' + flowUsage: + $ref: '#/components/schemas/FlowUsage' + MediaSubComponentRm: + description: > + This data type is defined in the same way as the MediaSubComponent data type, but with the + OpenAPI nullable property set to true. Removable attributes marBwDl and marBwUl are defined + with the corresponding removable data type. + type: object + required: + - fNum + properties: + afSigProtocol: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AfSigProtocol' + ethfDescs: + type: array + items: + $ref: '#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + nullable: true + fNum: + type: integer + fDescs: + type: array + items: + $ref: '#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + nullable: true + fStatus: + $ref: '#/components/schemas/FlowStatus' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRateRm' + tosTrCl: + $ref: '#/components/schemas/TosTrafficClassRm' + flowUsage: + $ref: '#/components/schemas/FlowUsage' + nullable: true + EventsNotification: + description: Describes the notification of a matched event. + type: object + required: + - evSubsUri + - evNotifs + properties: + adReports: + type: array + items: + $ref: '#/components/schemas/AppDetectionReport' + minItems: 1 + description: Includes the detected application report. + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + addAccessInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AdditionalAccessInfo' + relAccessInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AdditionalAccessInfo' + anChargAddr: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AccNetChargingAddress' + anChargIds: + type: array + items: + $ref: '#/components/schemas/AccessNetChargingIdentifier' + minItems: 1 + anGwAddr: + $ref: '#/components/schemas/AnGwAddress' + evSubsUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + evNotifs: + type: array + items: + $ref: '#/components/schemas/AfEventNotification' + minItems: 1 + failedResourcAllocReports: + type: array + items: + $ref: '#/components/schemas/ResourcesAllocationInfo' + minItems: 1 + succResourcAllocReports: + type: array + items: + $ref: '#/components/schemas/ResourcesAllocationInfo' + minItems: 1 + noNetLocSupp: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/NetLocAccessSupport' + outOfCredReports: + type: array + items: + $ref: '#/components/schemas/OutOfCreditInformation' + minItems: 1 + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + qncReports: + type: array + items: + $ref: '#/components/schemas/QosNotificationControlInfo' + minItems: 1 + qosMonReports: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 1 + ranNasRelCauses: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RanNasRelCause' + minItems: 1 + description: Contains the RAN and/or NAS release cause. + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + ueLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueLocTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + usgRep: + $ref: 'TS29122_CommonData.yaml#/components/schemas/AccumulatedUsage' + tsnBridgeManCont: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + AfEventSubscription: + description: Describes the event information delivered in the subscription. + type: object + required: + - event + properties: + event: + $ref: '#/components/schemas/AfEvent' + notifMethod: + $ref: '#/components/schemas/AfNotifMethod' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + waitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + AfEventNotification: + description: Describes the event information delivered in the notification. + type: object + required: + - event + properties: + event: + $ref: '#/components/schemas/AfEvent' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + TerminationInfo: + description: Indicates the cause for requesting the deletion of the Individual Application Session Context resource. + type: object + required: + - termCause + - resUri + properties: + termCause: + $ref: '#/components/schemas/TerminationCause' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + AfRoutingRequirement: + description: Describes the event information delivered in the subscription. + type: object + properties: + appReloc: + type: boolean + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + spVal: + $ref: '#/components/schemas/SpatialValidity' + tempVals: + type: array + items: + $ref: '#/components/schemas/TemporalValidity' + minItems: 1 + upPathChgSub: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/UpPathChgEvent' + addrPreserInd: + type: boolean + simConnInd: + type: boolean + description: Indicates whether simultaneous connectivity should be temporarily maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required. + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + SpatialValidity: + description: Describes explicitly the route to an Application location. + type: object + required: + - presenceInfoList + properties: + presenceInfoList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: Defines the presence information provisioned by the AF. The praId attribute within the PresenceInfo data type is the key of the map. + SpatialValidityRm: + description: This data type is defined in the same way as the SpatialValidity data type, but with the OpenAPI nullable property set to true. + type: object + required: + - presenceInfoList + properties: + presenceInfoList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: Defines the presence information provisioned by the AF. The praId attribute within the PresenceInfo data type is the key of the map. + nullable: true + AfRoutingRequirementRm: + description: > + This data type is defined in the same way as the AfRoutingRequirement data type, but with + the OpenAPI nullable property set to true and the spVal and tempVals attributes defined as + removable. + type: object + properties: + appReloc: + type: boolean + routeToLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + nullable: true + spVal: + $ref: '#/components/schemas/SpatialValidityRm' + tempVals: + type: array + items: + $ref: '#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + upPathChgSub: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/UpPathChgEvent' + addrPreserInd: + type: boolean + nullable: true + simConnInd: + type: boolean + nullable: true + description: Indicates whether simultaneous connectivity should be temporarily maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + nullable: true + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required. + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + nullable: true + AnGwAddress: + description: Describes the address of the access network gateway control node. + type: object + anyOf: + - required: [anGwIpv4Addr] + - required: [anGwIpv6Addr] + properties: + anGwIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anGwIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + Flows: + description: Identifies the flows. + type: object + required: + - medCompN + properties: + contVers: + type: array + items: + $ref: '#/components/schemas/ContentVersion' + minItems: 1 + fNums: + type: array + items: + type: integer + minItems: 1 + medCompN: + type: integer + EthFlowDescription: + description: Identifies an Ethernet flow. + type: object + required: + - ethType + properties: + destMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + ethType: + type: string + fDesc: + $ref: '#/components/schemas/FlowDescription' + fDir: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/FlowDirection' + sourceMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + vlanTags: + type: array + items: + type: string + minItems: 1 + maxItems: 2 + srcMacAddrEnd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + destMacAddrEnd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + + + ResourcesAllocationInfo: + description: Describes the status of the PCC rule(s) related to certain media components. + type: object + properties: + mcResourcStatus: + $ref: '#/components/schemas/MediaComponentResourcesStatus' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + altSerReq: + type: string + TemporalValidity: + description: Indicates the time interval(s) during which the AF request is to be applied. + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stopTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' +# + QosNotificationControlInfo: + description: Indicates whether the QoS targets for a GRB flow are not guaranteed or guaranteed again. + type: object + required: + - notifType + properties: + notifType: + $ref: '#/components/schemas/QosNotifType' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + altSerReq: + type: string +# + AcceptableServiceInfo: + description: Indicates the maximum bandwidth that shall be authorized by the PCF. + type: object + properties: + accBwMedComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MediaComponent' + description: Indicates the maximum bandwidth that shall be authorized by the PCF for each media component of the map. The key of the map is the media component number. + minProperties: 1 + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + + UeIdentityInfo: + description: Represents 5GS-Level UE identities. + type: object + anyOf: + - required: [gpsi] + - required: [pei] + - required: [supi] + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' +# + AccessNetChargingIdentifier: + description: Describes the access network charging identifier. + type: object + oneOf: + - required: [accNetChaIdValue] + - required: [accNetChargIdString] + properties: + accNetChaIdValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + accNetChargIdString: + type: string + description: A character string containing the access network charging identifier. + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 +# + OutOfCreditInformation: + description: Indicates the SDFs without available credit and the corresponding termination action. + type: object + required: + - finUnitAct + properties: + finUnitAct: + $ref: 'TS32291_Nchf_ConvergedCharging.yaml#/components/schemas/FinalUnitAction' + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 +# + QosMonitoringInformation: + description: Indicates the QoS Monitoring information to report, i.e. UL and/or DL and or round trip delay. + type: object + properties: + repThreshDl: + type: integer + repThreshUl: + type: integer + repThreshRp: + type: integer +# +# + PduSessionTsnBridge: + description: Contains the new TSC user plane node information and may contain the DS-TT port and/or NW-TT port management information. + type: object + required: + - tsnBridgeInfo + properties: + tsnBridgeInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/TsnBridgeInfo' + tsnBridgeManCont: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/BridgeManagementContainer' + tsnPortManContDstt: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + tsnPortManContNwtts: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/PortManagementContainer' + minItems: 1 + ueIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ipDomain: + type: string + description: IPv4 address domain identifier. + ueIpv6AddrPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + +# + QosMonitoringInformationRm: + description: This data type is defined in the same way as the QosMonitoringInformation data type, but with the OpenAPI nullable property set to true. + type: object + properties: + repThreshDl: + type: integer + repThreshUl: + type: integer + repThreshRp: + type: integer + nullable: true +# + PcscfRestorationRequestData: + description: Indicates P-CSCF restoration. + type: object + oneOf: + - required: [ueIpv4] + - required: [ueIpv6] + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ipDomain: + type: string + sliceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + +# +# + QosMonitoringReport: + description: QoS Monitoring reporting information. + type: object + properties: + flows: + type: array + items: + $ref: '#/components/schemas/Flows' + minItems: 1 + ulDelays: + type: array + items: + type: integer + minItems: 1 + dlDelays: + type: array + items: + type: integer + minItems: 1 + rtDelays: + type: array + items: + type: integer + minItems: 1 +# + TsnQosContainer: + description: Indicates TSC Traffic QoS. + type: object + properties: + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVol' + tscPackDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + tscPrioLevel: + $ref: '#/components/schemas/TscPriorityLevel' +# +# + TsnQosContainerRm: + description: Indicates removable TSC Traffic QoS. + type: object + properties: + maxTscBurstSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtMaxDataBurstVolRm' + tscPackDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudgetRm' + tscPrioLevel: + $ref: '#/components/schemas/TscPriorityLevelRm' + nullable: true +# + TscaiInputContainer: + description: Indicates TSC Traffic pattern. + type: object + properties: + periodicity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + burstArrivalTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + surTimeInNumMsg: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + surTimeInTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + nullable: true +# +# + AppDetectionReport: + description: Indicates the start or stop of the detected application traffic and the application identifier of the detected application traffic. + type: object + required: + - adNotifType + - afAppId + properties: + adNotifType: + $ref: '#/components/schemas/AppDetectionNotifType' + afAppId: + $ref: '#/components/schemas/AfAppId' +# +# + PduSessionEventNotification: + description: Indicates PDU session information for the concerned established/terminated PDU session. + type: object + required: + - evNotif + properties: + evNotif: + $ref: '#/components/schemas/AfEventNotification' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + status: + $ref: '#/components/schemas/PduSessionStatus' + pcfInfo: + $ref: '#/components/schemas/PcfAddressingInfo' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' +# +# + PcfAddressingInfo: + description: Contains PCF address information. + type: object + properties: + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_PolicyAuthorization service. + bindingInfo: + type: string + description: contains the binding indications of the PCF. +# + AlternativeServiceRequirementsData: + description: Contains an alternative QoS related parameter set. + type: object + required: + - altQosParamSetRef + properties: + altQosParamSetRef: + type: string + description: Reference to this alternative QoS related parameter set. + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + pdb: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' +# + EventsSubscPutData: + description: > + Identifies the events the application subscribes to within an Events Subscription + sub-resource data. It may contain the notification of the already met events. + anyOf: + - $ref: '#/components/schemas/EventsSubscReqData' + - $ref: '#/components/schemas/EventsNotification' +# +# EXTENDED PROBLEMDETAILS +# + ExtendedProblemDetails: + description: Extends ProblemDetails to also include the acceptable service info. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - type: object + properties: + acceptableServInfo: + $ref: '#/components/schemas/AcceptableServiceInfo' + +# +# SIMPLE DATA TYPES +# + AfAppId: + description: Contains an AF application identifier. + type: string + AspId: + description: Contains an identity of an application service provider. + type: string + CodecData: + description: Contains codec related information. + type: string + ContentVersion: + description: Represents the content version of some content. + type: integer + FlowDescription: + description: Defines a packet filter of an IP flow. + type: string + SponId: + description: Contains an identity of a sponsor. + type: string + ServiceUrn: + description: Contains values of the service URN and may include subservices. + type: string + TosTrafficClass: + description: > + 2-octet string, where each octet is encoded in hexadecimal representation. The first octet + contains the IPv4 Type-of-Service or the IPv6 Traffic-Class field and the second octet + contains the ToS/Traffic Class mask field. + type: string + TosTrafficClassRm: + description: This data type is defined in the same way as the TosTrafficClass data type, but with the OpenAPI nullable property set to true. + type: string + nullable: true + TscPriorityLevel: + description: Represents the priority level of TSC Flows. + type: integer + minimum: 1 + maximum: 8 + TscPriorityLevelRm: + description: This data type is defined in the same way as the TscPriorityLevel data type, but with the OpenAPI nullable property set to true. + type: integer + minimum: 1 + maximum: 8 + nullable: true +# +# ENUMERATIONS DATA TYPES +# + MediaType: + description: Indicates the media type of a media component. + anyOf: + - type: string + enum: + - AUDIO + - VIDEO + - DATA + - APPLICATION + - CONTROL + - TEXT + - MESSAGE + - OTHER + - type: string +# + MpsAction: + description: Indicates whether it is an invocation, a revocation or an invocation with authorization of the MPS for DTS service. + anyOf: + - type: string + enum: + - DISABLE_MPS_FOR_DTS + - ENABLE_MPS_FOR_DTS + - AUTHORIZE_AND_ENABLE_MPS_FOR_DTS + - type: string +# + ReservPriority: + description: Indicates the reservation priority. + anyOf: + - type: string + enum: + - PRIO_1 + - PRIO_2 + - PRIO_3 + - PRIO_4 + - PRIO_5 + - PRIO_6 + - PRIO_7 + - PRIO_8 + - PRIO_9 + - PRIO_10 + - PRIO_11 + - PRIO_12 + - PRIO_13 + - PRIO_14 + - PRIO_15 + - PRIO_16 + - type: string +# + ServAuthInfo: + description: Indicates the result of the Policy Authorization service request from the AF. + anyOf: + - type: string + enum: + - TP_NOT_KNOWN + - TP_EXPIRED + - TP_NOT_YET_OCURRED + - ROUT_REQ_NOT_AUTHORIZED + - type: string +# + SponsoringStatus: + description: Indicates whether sponsored data connectivity is enabled or disabled/not enabled. + anyOf: + - type: string + enum: + - SPONSOR_DISABLED + - SPONSOR_ENABLED + - type: string +# + AfEvent: + description: Represents an event to notify to the AF. + anyOf: + - type: string + enum: + - ACCESS_TYPE_CHANGE + - ANI_REPORT + - APP_DETECTION + - CHARGING_CORRELATION + - EPS_FALLBACK + - FAILED_QOS_UPDATE + - FAILED_RESOURCES_ALLOCATION + - OUT_OF_CREDIT + - PDU_SESSION_STATUS + - PLMN_CHG + - QOS_MONITORING + - QOS_NOTIF + - RAN_NAS_CAUSE + - REALLOCATION_OF_CREDIT + - SAT_CATEGORY_CHG + - SUCCESSFUL_QOS_UPDATE + - SUCCESSFUL_RESOURCES_ALLOCATION + - TSN_BRIDGE_INFO + - UP_PATH_CHG_FAILURE + - USAGE_REPORT + - type: string +# + AfNotifMethod: + description: Represents the notification methods that can be subscribed for an event. + anyOf: + - type: string + enum: + - EVENT_DETECTION + - ONE_TIME + - PERIODIC + - PDU_SESSION_RELEASE + - type: string +# + QosNotifType: + description: Indicates the notification type for QoS Notification Control. + anyOf: + - type: string + enum: + - GUARANTEED + - NOT_GUARANTEED + - type: string +# + TerminationCause: + description: Indicates the cause behind requesting the deletion of the Individual Application Session Context resource. + anyOf: + - type: string + enum: + - ALL_SDF_DEACTIVATION + - PDU_SESSION_TERMINATION + - PS_TO_CS_HO + - INSUFFICIENT_SERVER_RESOURCES + - INSUFFICIENT_QOS_FLOW_RESOURCES + - SPONSORED_DATA_CONNECTIVITY_DISALLOWED + - type: string +# + MediaComponentResourcesStatus: + description: Indicates whether the media component is active or inactive. + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string +# +# + FlowUsage: + description: Describes the flow usage of the flows described by a media subcomponent. + anyOf: + - type: string + enum: + - NO_INFO + - RTCP + - AF_SIGNALLING + - type: string + + + FlowStatus: + description: Describes whether the IP flow(s) are enabled or disabled. + anyOf: + - type: string + enum: + - ENABLED-UPLINK + - ENABLED-DOWNLINK + - ENABLED + - DISABLED + - REMOVED + - type: string +# + RequiredAccessInfo: + description: Indicates the access network information required for an AF session. + anyOf: + - type: string + enum: + - USER_LOCATION + - UE_TIME_ZONE + - type: string +# + SipForkingIndication: + description: Indicates whether several SIP dialogues are related to an "Individual Application Session Context" resource. + anyOf: + - type: string + enum: + - SINGLE_DIALOGUE + - SEVERAL_DIALOGUES + - type: string +# + AfRequestedData: + description: Represents the information that the AF requested to be exposed. + anyOf: + - type: string + enum: + - UE_IDENTITY + - type: string +# + ServiceInfoStatus: + description: Represents the preliminary or final service information status. + anyOf: + - type: string + enum: + - FINAL + - PRELIMINARY + - type: string +# + PreemptionControlInformation: + description: Represents Pre-emption control information. + anyOf: + - type: string + enum: + - MOST_RECENT + - LEAST_RECENT + - HIGHEST_BW + - type: string +# + PrioritySharingIndicator: + description: Represents the Priority sharing indicator. + anyOf: + - type: string + enum: + - ENABLED + - DISABLED + - type: string +# + PreemptionControlInformationRm: + description: This data type is defined in the same way as the PreemptionControlInformation data type, but with the OpenAPI nullable property set to true. + anyOf: + - $ref: '#/components/schemas/PreemptionControlInformation' + - $ref: 'TS29571_CommonData.yaml#/components/schemas/NullValue' +# + AppDetectionNotifType: + description: Indicates the notification type for Application Detection Control. + anyOf: + - type: string + enum: + - APP_START + - APP_STOP + - type: string +# + PduSessionStatus: + description: Indicates whether the PDU session is established or terminated. + anyOf: + - type: string + enum: + - ESTABLISHED + - TERMINATED + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29517_Naf_EventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29517_Naf_EventExposure.yaml new file mode 100644 index 000000000..a1ef04eeb --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29517_Naf_EventExposure.yaml @@ -0,0 +1,828 @@ +openapi: 3.0.0 +info: + version: 1.2.0 + title: Naf_EventExposure + description: | + AF Event Exposure Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.517 V17.7.0; 5G System; Application Function Event Exposure Service; Stage 3. + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.517/ + +servers: + - url: '{apiRoot}/naf-eventexposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: [] + + +paths: + /subscriptions: + post: + summary: Creates a new Individual Application Event Exposure Subscription resource + operationId: PostAfEventExposureSubsc + tags: + - Application Event Subscription (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + responses: + '201': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + headers: + Location: + description: > + Contains the URI of the created individual application event subscription resource + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + AfEventExposureNotif: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureNotif' + responses: + '204': + description: No Content, Notification was successful + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subscriptionId}: + get: + summary: "Reads an existing Individual Application Event Subscription" + operationId: GetAfEventExposureSubsc + tags: + - Individual Application Event Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Application Event Subscription ID + required: true + schema: + type: string + - name: supp-feat + in: query + description: Features supported by the NF service consumer + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: OK. Resource representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: "Modifies an existing Individual Application Event Subscription " + operationId: PutAfEventExposureSubsc + tags: + - Individual Application Event Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + parameters: + - name: subscriptionId + in: path + description: Application Event Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was successfully modified and representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/AfEventExposureSubsc' + '204': + description: No Content. Resource was successfully modified + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: "Cancels an existing Individual Application Event Subscription " + operationId: DeleteAfEventExposureSubsc + tags: + - Individual Application Event Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Application Event Subscription ID + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was successfully deleted + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUri}' + scopes: {} + description: > + For trusted AF, the 'naf-eventexposure' shall be used as 'scopes' and + '{nrfApiRoot}/oauth2/token' shall be used as 'tokenUri'. + + schemas: + AfEventExposureNotif: + description: > + Represents notifications on application event(s) that occurred for an Individual Application + Event Subscription resource. + type: object + properties: + notifId: + type: string + eventNotifs: + type: array + items: + $ref: '#/components/schemas/AfEventNotification' + minItems: 1 + required: + - notifId + - eventNotifs + AfEventExposureSubsc: + description: Represents an Individual Application Event Subscription resource. + type: object + properties: + dataAccProfId: + type: string + eventsSubs: + type: array + items: + $ref: '#/components/schemas/EventsSubs' + minItems: 1 + eventsRepInfo: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + eventNotifs: + type: array + items: + $ref: '#/components/schemas/AfEventNotification' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - eventsSubs + - eventsRepInfo + - notifId + - notifUri + AfEventNotification: + description: Represents information related to an event to be reported. + type: object + properties: + event: + $ref: '#/components/schemas/AfEvent' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + svcExprcInfos: + type: array + items: + $ref: '#/components/schemas/ServiceExperienceInfoPerApp' + minItems: 1 + ueMobilityInfos: + type: array + items: + $ref: '#/components/schemas/UeMobilityCollection' + minItems: 1 + ueCommInfos: + type: array + items: + $ref: '#/components/schemas/UeCommunicationCollection' + minItems: 1 + excepInfos: + type: array + items: + $ref: '#/components/schemas/ExceptionInfo' + minItems: 1 + congestionInfos: + type: array + items: + $ref: '#/components/schemas/UserDataCongestionCollection' + minItems: 1 + perfDataInfos: + type: array + items: + $ref: '#/components/schemas/PerformanceDataCollection' + minItems: 1 + dispersionInfos: + type: array + items: + $ref: '#/components/schemas/DispersionCollection' + minItems: 1 + collBhvrInfs: + type: array + items: + $ref: '#/components/schemas/CollectiveBehaviourInfo' + minItems: 1 + msQoeMetrInfos: + type: array + items: + $ref: '#/components/schemas/MsQoeMetricsCollection' + minItems: 1 + msConsumpInfos: + type: array + items: + $ref: '#/components/schemas/MsConsumptionCollection' + minItems: 1 + msNetAssInvInfos: + type: array + items: + $ref: '#/components/schemas/MsNetAssInvocationCollection' + minItems: 1 + msDynPlyInvInfos: + type: array + items: + $ref: '#/components/schemas/MsDynPolicyInvocationCollection' + minItems: 1 + msAccActInfos: + type: array + items: + $ref: '#/components/schemas/MSAccessActivityCollection' + minItems: 1 + required: + - event + - timeStamp + EventsSubs: + description: Represents an event to be subscribed and the related event filter information. + type: object + properties: + event: + $ref: '#/components/schemas/AfEvent' + eventFilter: + $ref: '#/components/schemas/EventFilter' + required: + - event + - eventFilter + EventFilter: + description: Represents event filter information for an event. + type: object + properties: + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + exterGroupIds: + type: array + items: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + minItems: 1 + interGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + anyUeInd: + type: boolean + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + collAttrs: + type: array + items: + $ref: '#/components/schemas/CollectiveBehaviourFilter' + minItems: 1 + ServiceExperienceInfoPerApp: + description: Contains service experience information associated with an application. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + appServerIns: + $ref: '#/components/schemas/AddrFqdn' + svcExpPerFlows: + type: array + items: + $ref: '#/components/schemas/ServiceExperienceInfoPerFlow' + minItems: 1 + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + required: + - svcExpPerFlows + ServiceExperienceInfoPerFlow: + description: Contains service experience information associated with a service flow. + type: object + properties: + svcExprc: + $ref: '#/components/schemas/SvcExperience' + timeIntev: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ethTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + SvcExperience: + description: Contains a mean opinion score with the customized range. + type: object + properties: + mos: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + upperRange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + lowerRange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + UeMobilityCollection: + description: Contains UE mobility information associated with an application. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ueTrajs: + type: array + items: + $ref: '#/components/schemas/UeTrajectoryCollection' + minItems: 1 + required: + - appId + - ueTrajs + UeCommunicationCollection: + description: Contains UE communication information associated with an application. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + exterGroupId: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExtGroupId' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + comms: + type: array + items: + $ref: '#/components/schemas/CommunicationCollection' + minItems: 1 + required: + - appId + - comms + UeTrajectoryCollection: + description: Contains UE trajectory information associated with an application. + type: object + properties: + ts: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + required: + - ts + - locArea + CommunicationCollection: + description: Contains communication information. + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ulVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + dlVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + required: + - startTime + - endTime + - ulVol + - dlVol + ExceptionInfo: + description: Represents the exceptions information provided by the AF. + type: object + properties: + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ethTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + exceps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/Exception' + minItems: 1 + required: + - exceps + oneOf: + - required: [ipTrafficFilter] + - required: [ethTrafficFilter] + UserDataCongestionCollection: + description: Contains User Data Congestion Analytics related information collection. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + timeInterv: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + thrputUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + thrputDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + thrputPkUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + thrputPkDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + oneOf: + - required: [appId] + - required: [ipTrafficFilter] + PerformanceDataCollection: + description: Contains Performance Data Analytics related information collection. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ueLoc: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + appLocs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + asAddr: + $ref: '#/components/schemas/AddrFqdn' + perfData: + $ref: '#/components/schemas/PerformanceData' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - perfData + - timeStamp + PerformanceData: + description: Contains Performance Data. + type: object + properties: + pdb: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + plr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + thrputUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + thrputDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + AddrFqdn: + description: IP address and/or FQDN. + type: object + properties: + ipAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + fqdn: + type: string + description: Indicates an FQDN. + DispersionCollection: + description: Contains the dispersion information collected for an AF. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + dataUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + flowDesp: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + appDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - dataUsage + oneOf: + - required: [gpsi] + - required: [supi] + - required: [ueAddr] + CollectiveBehaviourFilter: + description: Contains the collective behaviour filter information to be collected from UE. + type: object + properties: + type: + $ref: '#/components/schemas/CollectiveBehaviourFilterType' + value: + type: string + description: Value of the parameter type as in the type attribute. + listOfUeInd: + type: boolean + description: > + Indicates whether request list of UE IDs that fulfill a collective behaviour within the + area of interest. This attribute shall set to "true" if request the list of UE IDs, + otherwise, set to "false". May only be present and sets to "true" if "AfEvent" sets to + "COLLECTIVE_BEHAVIOUR". + required: + - type + - value + CollectiveBehaviourInfo: + description: Contains the collective behaviour information to be reported to the subscriber. + type: object + properties: + colAttrib: + type: array + items: + $ref: '#/components/schemas/PerUeAttribute' + minItems: 1 + noOfUes: + type: integer + description: Total number of UEs that fulfil a collective within the area of interest. + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + extUeIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + ueIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + required: + - colAttrib + oneOf: + - required: [extUeIds] + - required: [ueIds] + PerUeAttribute: + description: UE application data collected per UE. + type: object + properties: + ueDest: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + route: + type: string + avgSpeed: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + timeOfArrival: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + MsQoeMetricsCollection: + description: > + Contains the Media Streaming QoE metrics information collected for an UE Application via AF. + type: object + properties: + msQoeMetrics: + type: array + items: + type: string + minItems: 1 + required: + - msQoeMetrics + MsConsumptionCollection: + description: > + Contains the Media Streaming Consumption information collected for an UE Application via AF. + type: object + properties: + msConsumps: + type: array + items: + type: string + description: > + Represents the Media Streaming Consumption reports with formatting as specified in + clause 11.3.3 of 3GPP TS 26.512 [30], if required for Media Streaming UE Application. + minItems: 1 + required: + - msConsumps + MsNetAssInvocationCollection: + description: > + Contains the Media Streaming Network Assistance invocation collected for an UE Application + via AF. + type: object + properties: + msNetAssInvocs: + type: array + items: + $ref: 'TS26512_M5_NetworkAssistance.yaml#/components/schemas/NetworkAssistanceSession' + minItems: 1 + required: + - msNetAssInvocs + MsDynPolicyInvocationCollection: + description: > + Contains the Media Streaming Dynamic Policy invocation collected for an UE + Application via AF. + type: object + properties: + msDynPlyInvocs: + type: array + items: + $ref: 'TS26512_M5_DynamicPolicies.yaml#/components/schemas/DynamicPolicy' + minItems: 1 + required: + - msDynPlyInvocs + MSAccessActivityCollection: + description: Contains Media Streaming access activity collected for an UE Application via AF. + type: object + properties: + msAccActs: + type: array + items: + $ref: 'TS26512_R4_DataReporting.yaml#/components/schemas/MediaStreamingAccessRecord' + minItems: 1 + required: + - msAccActs + +# Simple data types and Enumerations + + AfEvent: + description: Represents Application Events. + anyOf: + - type: string + enum: + - SVC_EXPERIENCE + - UE_MOBILITY + - UE_COMM + - EXCEPTIONS + - USER_DATA_CONGESTION + - PERF_DATA + - DISPERSION + - COLLECTIVE_BEHAVIOUR + - MS_QOE_METRICS + - MS_CONSUMPTION + - MS_NET_ASSIST_INVOCATION + - MS_DYN_POLICY_INVOCATION + - MS_ACCESS_ACTIVITY + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + CollectiveBehaviourFilterType: + description: Represents collective behaviour parameter type. + anyOf: + - type: string + enum: + - COLLECTIVE_ATTRIBUTE + - DATA_PROCESSING + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_Communication.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_Communication.yaml new file mode 100644 index 000000000..497a74a23 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_Communication.yaml @@ -0,0 +1,3900 @@ +openapi: 3.0.0 + +info: + version: 1.2.2 + title: Namf_Communication + description: | + AMF Communication Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +security: + - {} + - oAuth2ClientCredentials: + - namf-comm + +externalDocs: + description: 3GPP TS 29.518 V17.8.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-comm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /ue-contexts/{ueContextId}: + put: + summary: Namf_Communication CreateUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: CreateUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCreateData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + binaryDataN2InformationExt16: + type: string + format: binary + binaryDataN2InformationExt17: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt16: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt17: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + callbacks: + onN2MessageNotify: + '{$request.body#/n2NotifyUri}': + post: + summary: Namf_Communication N2 Info Notify (UE Specific) service Operation + tags: + - N2 Info Notify + operationId: N2InfoNotifyHandoverComplete + requestBody: + description: UE Specific N2 Information Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationNotification' + responses: + '200': + description: N2 Information Notification Response. + content: + application/json: + schema: + $ref: '#/components/schemas/N2InfoNotificationRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: + jsonData: + $ref: '#/components/schemas/N2InfoNotificationRspData' + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + binaryDataN2InformationExt16: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt16: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + responses: + '201': + description: UE context successfully created. + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/namf-comm//ue-contexts/{ueContextId} + required: true + schema: + type: string + 3gpp-Sbi-Producer-Id: + description: > + Indicating the AMF serving the UE Context. This header shall be included when the + UE Context is created in a target AMF other than the initial AMF sending the + response. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreatedData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCreatedData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Response parts + jsonData: + $ref: '#/components/schemas/UeContextCreateError' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextCreateError' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/release: + post: + summary: Namf_Communication ReleaseUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: ReleaseUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UEContextRelease' + required: true + responses: + '204': + description: UE Context successfully released + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/assign-ebi: + post: + summary: Namf_Communication EBI Assignment service Operation + tags: + - Individual ueContext (Document) + operationId: EBIAssignment + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiData' + required: true + responses: + '200': + description: EBI Assignment successfully performed. + content: + application/json: + schema: + $ref: '#/components/schemas/AssignedEbiData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + application/problem+json: # error originated by an SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + application/problem+json: # error originated by an SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/AssignEbiError' + application/problem+json: # error originated by an SCP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/transfer: + post: + summary: Namf_Communication UEContextTransfer service Operation + tags: + - Individual ueContext (Document) + operationId: UEContextTransfer + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextTransferReqData' + binaryDataN1Message: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: UE context transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextTransferRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextTransferRspData' + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/transfer-update: + post: + summary: Namf_Communication RegistrationStatusUpdate service Operation + tags: + - Individual ueContext (Document) + operationId: RegistrationStatusUpdate + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeRegStatusUpdateReqData' + required: true + responses: + '200': + description: UE context transfer status successfully updated. + content: + application/json: + schema: + $ref: '#/components/schemas/UeRegStatusUpdateRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /ue-contexts/{ueContextId}/relocate: + post: + summary: Namf_Communication RelocateUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: RelocateUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextRelocateData' + binaryDataForwardRelocationRequest: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + binaryDataN2InformationExt1: + type: string + format: binary + binaryDataN2InformationExt2: + type: string + format: binary + binaryDataN2InformationExt3: + type: string + format: binary + binaryDataN2InformationExt4: + type: string + format: binary + binaryDataN2InformationExt5: + type: string + format: binary + binaryDataN2InformationExt6: + type: string + format: binary + binaryDataN2InformationExt7: + type: string + format: binary + binaryDataN2InformationExt8: + type: string + format: binary + binaryDataN2InformationExt9: + type: string + format: binary + binaryDataN2InformationExt10: + type: string + format: binary + binaryDataN2InformationExt11: + type: string + format: binary + binaryDataN2InformationExt12: + type: string + format: binary + binaryDataN2InformationExt13: + type: string + format: binary + binaryDataN2InformationExt14: + type: string + format: binary + binaryDataN2InformationExt15: + type: string + format: binary + binaryDataN2InformationExt16: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataForwardRelocationRequest: + contentType: application/vnd.3gpp.gtpc + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt11: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt12: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt13: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt14: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt15: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2InformationExt16: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '201': + description: UE context successfully relocated. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//ue-contexts/{ueContextId}/relocate' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextRelocatedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/cancel-relocate: + post: + summary: Namf_Communication CancelRelocateUEContext service Operation + tags: + - Individual ueContext (Document) + operationId: CancelRelocateUEContext + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(5g-guti-[0-9]{5,6}[0-9a-fA-F]{14}|imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/UeContextCancelRelocateData' + binaryDataGtpcMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataGtpcMessage: + contentType: application/vnd.3gpp.gtpc + headers: + Content-Id: + schema: + type: string + required: true + responses: + '204': + description: UE Context successfully released + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/n1-n2-messages: + post: + summary: Namf_Communication N1N2 Message Transfer (UE Specific) service Operation + tags: + - n1N2Message collection (Collection) + operationId: N1N2MessageTransfer + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|cid-.{1,255}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N1N2MessageTransferReqData' + binaryDataN1Message: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + binaryMtData: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryMtData: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + required: true + responses: + '202': + description: N1N2 Message Transfer accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferRspData' + headers: + Location: + description: 'The URI of the resource located on the AMF to which the status of the N1N2 message transfer is held' + required: true + schema: + type: string + '200': + description: N1N2 Message Transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + description: Conflicts + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: Gateway Timeout + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MessageTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + callbacks: + onN1N2TransferFailure: + '{$request.body#/n1n2FailureTxfNotifURI}': + post: + summary: Namf_Communication N1N2Transfer Failure Notification service Operation + tags: + - N1N2 Transfer Failure Notification + operationId: N1N2TransferFailureNotification + requestBody: + description: N1N2Transfer Failure Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N1N2MsgTxfrFailureNotification' + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions: + post: + summary: Namf_Communication N1N2 Message Subscribe (UE Specific) service Operation + tags: + - N1N2 Subscriptions Collection for Individual UE Contexts (Collection) + operationId: N1N2MessageSubscribe + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreateData' + required: true + responses: + '201': + description: N1N2 Message Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//{ueContextId}/ue-contexts/n1-n2-messages/subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/UeN1N2InfoSubscriptionCreatedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onN1N2MessageNotify: + '{$request.body#/n1NotifyCallbackUri}': + post: + summary: Namf_Communication N1 Message Notify service Operation + tags: + - N1 Message Notify + operationId: N1MessageNotify + requestBody: + description: N1 Message Notification + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N1MessageNotification' + binaryDataN1Message: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '{$request.body#/n2NotifyCallbackUri}': + post: + summary: Namf_Communication N2 Info Notify (UE Specific) service Operation + tags: + - N2 Info Notify + operationId: N2InfoNotify + requestBody: + description: UE Specific N2 Information Notification + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationNotification' + binaryDataN1Message: + type: string + format: binary + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN1Message: + contentType: application/vnd.3gpp.5gnas + headers: + Content-Id: + schema: + type: string + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /ue-contexts/{ueContextId}/n1-n2-messages/subscriptions/{subscriptionId}: + delete: + summary: Namf_Communication N1N2 Message UnSubscribe (UE Specific) service Operation + tags: + - N1N2 Individual Subscription (Document) + operationId: N1N2MessageUnSubscribe + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + - name: subscriptionId + in: path + description: Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: N1N2 Message Subscription successfully removed. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /non-ue-n2-messages/transfer: + post: + summary: Namf_Communication Non UE N2 Message Transfer service Operation + tags: + - Non UE N2Messages collection (Collection) + operationId: NonUeN2MessageTransfer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferReqData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationTransferReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: Non UE N2 Message Transfer successfully initiated. + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationTransferError' + application/problem+json: # error originated by an SCP or SEPP + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + default: + description: Unexpected error + /non-ue-n2-messages/subscriptions: + post: + summary: Namf_Communication Non UE N2 Info Subscribe service Operation + tags: + - Non UE N2Messages Subscriptions collection (Collection) + operationId: NonUeN2InfoSubscribe + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreateData' + required: true + responses: + '201': + description: Non UE N2 Info Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NonUeN2InfoSubscriptionCreatedData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onN2InfoNotify: + '{$request.body#/n2NotifyCallbackUri}': + post: + summary: Namf_Communication Non UE N2 Info Notify service Operation + tags: + - Non UE N2 Info Notify + operationId: NonUeN2InfoNotify + requestBody: + description: Non UE N2 Information Notification + content: + application/json: + schema: + $ref: '#/components/schemas/N2InformationNotification' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/N2InformationNotification' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /non-ue-n2-messages/subscriptions/{n2NotifySubscriptionId}: + delete: + summary: Namf_Communication Non UE N2 Info UnSubscribe service Operation + tags: + - Non UE N2 Message Notification Individual Subscription (Document) + operationId: NonUeN2InfoUnSubscribe + parameters: + - name: n2NotifySubscriptionId + in: path + description: N2 info Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: Non UE N2 INfo Subscription successfully removed. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /subscriptions: + post: + summary: Namf_Communication AMF Status Change Subscribe service Operation + tags: + - subscriptions collection (Collection) + operationId: AMFStatusChangeSubscribe + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + required: true + responses: + '201': + description: N1N2 Message Subscription successfully created. + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-comm//subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onAmfStatusChange: + '{$request.body#/amfStatusUri}': + post: + summary: Amf Status Change Notify service Operation + tags: + - Amf Status Change Notify + operationId: AmfStatusChangeNotify + requestBody: + description: Amf Status Change Notification + content: + application/json: + schema: + $ref: '#/components/schemas/AmfStatusChangeNotification' + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /subscriptions/{subscriptionId}: + delete: + summary: Namf_Communication AMF Status Change UnSubscribe service Operation + tags: + - individual subscription (Document) + operationId: AMFStatusChangeUnSubscribe + parameters: + - name: subscriptionId + in: path + description: AMF Status Change Subscription Identifier + required: true + schema: + type: string + responses: + '204': + description: N1N2 Message Subscription successfully removed. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + put: + summary: Namf_Communication AMF Status Change Subscribe Modify service Operation + tags: + - individual subscription (Document) + operationId: AMFStatusChangeSubscribeModfy + parameters: + - name: subscriptionId + in: path + description: AMF Status Change Subscription Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + required: true + responses: + '200': + description: Subscription modified successfully + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionData' + '204': + description: Events subscription modification is accepted entirely + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + OnAmfStatusChange: + '{$request.body#/amfStatusUri}': + post: + summary: Amf Status Change Notify service Operation + tags: + - Amf Status Change Notify + operationId: AmfStatusChangeNOtify + requestBody: + description: Amf Status Change Notification + content: + application/json: + schema: + $ref: '#/components/schemas/AmfStatusChangeNotification' + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-comm: Access to the Namf_Communication API + schemas: +# +# STRUCTURED DATA TYPES +# + SubscriptionData: + description: Data within an AMF Status Change Subscription request and response + type: object + properties: + amfStatusUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + required: + - amfStatusUri + AmfStatusChangeNotification: + description: Data within an AMF Status Change Notification request + type: object + properties: + amfStatusInfoList: + type: array + items: + $ref: '#/components/schemas/AmfStatusInfo' + minItems: 1 + required: + - amfStatusInfoList + AmfStatusInfo: + description: AMF Status Information + type: object + properties: + guamiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + minItems: 1 + statusChange: + $ref: '#/components/schemas/StatusChange' + targetAmfRemoval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + targetAmfFailure: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + required: + - guamiList + - statusChange + AssignEbiData: + description: Data within an EBI assignment request + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + arpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + modifiedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 1 + required: + - pduSessionId + AssignedEbiData: + description: Data within a successful response to an EBI assignment request + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + assignedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 0 + failedArpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + releasedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + modifiedEbiList: + type: array + items: + $ref: '#/components/schemas/EpsBearerId' + minItems: 1 + required: + - pduSessionId + - assignedEbiList + AssignEbiFailed: + description: Represents failed assignment of EBI(s) + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + failedArpList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + minItems: 1 + required: + - pduSessionId + UEContextRelease: + description: Data within a Release UE Context request + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + unauthenticatedSupi: + type: boolean + default: false + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + required: + - ngapCause + N2InformationTransferReqData: + description: Data within a N2 Information Transfer request containing the N2 information requested to be transferred to 5G AN + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + ratSelector: + $ref: '#/components/schemas/RatSelector' + globalRanNodeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + n2Information: + $ref: '#/components/schemas/N2InfoContainer' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n2Information + NonUeN2InfoSubscriptionCreateData: + description: Data within a create subscription request for non-UE specific N2 information notification + type: object + properties: + globalRanNodeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + anTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + n2NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n2InformationClass + - n2NotifyCallbackUri + NonUeN2InfoSubscriptionCreatedData: + description: Data for the created subscription for non-UE specific N2 information notification + type: object + properties: + n2NotifySubscriptionId: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + required: + - n2NotifySubscriptionId + UeN1N2InfoSubscriptionCreateData: + description: Data within a create subscription request for UE specific N1 and/or N2 information notification + type: object + properties: + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + n2NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + n1MessageClass: + $ref: '#/components/schemas/N1MessageClass' + n1NotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + UeN1N2InfoSubscriptionCreatedData: + description: Data for the created subscription for UE specific N1 and/or N2 information notification + type: object + properties: + n1n2NotifySubscriptionId: + type: string + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - n1n2NotifySubscriptionId + N2InformationNotification: + description: Data within a N2 information notification request + type: object + properties: + n2NotifySubscriptionId: + type: string + n2InfoContainer: + $ref: '#/components/schemas/N2InfoContainer' + toReleaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + notifyReason: + $ref: '#/components/schemas/N2InfoNotifyReason' + smfChangeInfoList: + type: array + items: + $ref: '#/components/schemas/SmfChangeInfo' + minItems: 1 + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + initialAmfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + anN2IPv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anN2IPv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + notifySourceNgRan: + type: boolean + default: false + required: + - n2NotifySubscriptionId + N2InfoContainer: + description: N2 information container + type: object + properties: + n2InformationClass: + $ref: '#/components/schemas/N2InformationClass' + smInfo: + $ref: '#/components/schemas/N2SmInformation' + ranInfo: + $ref: '#/components/schemas/N2RanInformation' + nrppaInfo: + $ref: '#/components/schemas/NrppaInformation' + pwsInfo: + $ref: '#/components/schemas/PwsInformation' + v2xInfo: + $ref: '#/components/schemas/V2xInformation' + proseInfo: + $ref: '#/components/schemas/ProSeInformation' + required: + - n2InformationClass + N1MessageNotification: + description: Data within a N1 message notification request + type: object + properties: + n1NotifySubscriptionId: + type: string + n1MessageContainer: + $ref: '#/components/schemas/N1MessageContainer' + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + registrationCtxtContainer: + $ref: '#/components/schemas/RegistrationContextContainer' + newLmfIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + cIoT5GSOptimisation: + type: boolean + default: false + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + required: + - n1MessageContainer + N1MessageContainer: + description: N1 Message container + type: object + properties: + n1MessageClass: + $ref: '#/components/schemas/N1MessageClass' + n1MessageContent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + serviceInstanceId: + type: string + required: + - n1MessageClass + - n1MessageContent + N1N2MessageTransferReqData: + description: Data within a N1/N2 message transfer request + type: object + properties: + n1MessageContainer: + $ref: '#/components/schemas/N1MessageContainer' + n2InfoContainer: + $ref: '#/components/schemas/N2InfoContainer' + mtData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + skipInd: + type: boolean + default: false + lastMsgIndication: + type: boolean + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + lcsCorrelationId: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CorrelationID' + ppi: + $ref: '#/components/schemas/Ppi' + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + n1n2FailureTxfNotifURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfReallocationInd: + type: boolean + default: false + areaOfValidity: + $ref: '#/components/schemas/AreaOfValidity' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + maAcceptedInd: + type: boolean + default: false + extBufSupport: + type: boolean + default: false + targetAccess: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + + N1N2MessageTransferRspData: + description: Data within a N1/N2 message transfer response + type: object + properties: + cause: + $ref: '#/components/schemas/N1N2MessageTransferCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - cause + RegistrationContextContainer: + description: Registration Context Container used to send the UE context information, N1 message from UE, AN address etc during Registration with AMF re-allocation procedure + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + localTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + anType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + anN2ApId: + type: integer + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + initialAmfName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfName' + userLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + rrcEstCause: + type: string + pattern: '^[0-9a-fA-F]+$' + ueContextRequest: + type: boolean + default: false + initialAmfN2ApId: + type: integer + anN2IPv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + anN2IPv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + allowedNssai: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/AllowedNssai' + configuredNssai: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/ConfiguredSnssai' + minItems: 1 + rejectedNssaiInPlmn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + rejectedNssaiInTa: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + selectedPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + iabNodeInd: + type: boolean + default: false + ceModeBInd: + $ref: '#/components/schemas/CeModeBInd' + lteMInd: + $ref: '#/components/schemas/LteMInd' + authenticatedInd: + type: boolean + default: false + npnAccessInfo: + $ref: '#/components/schemas/NpnAccessInfo' + required: + - ueContext + - anType + - anN2ApId + - ranNodeId + - initialAmfName + - userLocation + AreaOfValidity: + description: Area of validity information for N2 information transfer + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 0 + required: + - taiList + UeContextTransferReqData: + description: Data within a UE Context Transfer Request to start transferring of an individual ueContext resource from old AMF to new AMF + type: object + properties: + reason: + $ref: '#/components/schemas/TransferReason' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + regRequest: + $ref: '#/components/schemas/N1MessageContainer' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - reason + - accessType + UeContextTransferRspData: + description: Data within a successful response to the UE Context Transfer request + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ueRadioCapabilityForPaging: + $ref: '#/components/schemas/N2InfoContent' + ueNbiotRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueContext + UeContext: + description: Represents an individual ueContext resource + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + supiUnauthInd: + type: boolean + gpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + udmGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + ausfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + pcfGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfGroupId' + routingIndicator: + type: string + hNwPubKeyId: + type: integer + groupList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + drxParameter: + $ref: '#/components/schemas/DrxParameter' + subRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + usedRfsp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RfspIndex' + subUeAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + subUeSliceMbrList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbr' + minProperties: 1 + description: A map(list of key-value pairs) where Snssai serves as key. + smsfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + seafData: + $ref: '#/components/schemas/SeafData' + 5gMmCapability: + $ref: '#/components/schemas/5GMmCapability' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + pcfAmpServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pcfUepServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + pcfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + pcfAmPolicyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + amPolicyReqTriggerList: + type: array + items: + $ref: '#/components/schemas/PolicyReqTrigger' + minItems: 1 + pcfUePolicyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + uePolicyReqTriggerList: + type: array + items: + $ref: '#/components/schemas/PolicyReqTrigger' + minItems: 1 + hpcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + hpcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + restrictedRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + forbiddenAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + minItems: 1 + serviceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + restrictedCoreNwTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + minItems: 1 + eventSubscriptionList: + type: array + items: + $ref: '#/components/schemas/ExtAmfEventSubscription' + minItems: 1 + mmContextList: + type: array + items: + $ref: '#/components/schemas/MmContext' + minItems: 1 + maxItems: 2 + sessionContextList: + type: array + items: + $ref: '#/components/schemas/PduSessionContext' + minItems: 1 + epsInterworkingInfo: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/EpsInterworkingInfo' + traceData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TraceData' + serviceGapExpiryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + cMsisdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CMsisdn' + msClassmark2: + $ref: '#/components/schemas/MSClassmark2' + supportedCodecList: + type: array + items: + $ref: '#/components/schemas/SupportedCodec' + minItems: 1 + smallDataRateStatusInfos: + type: array + items: + $ref: '#/components/schemas/SmallDataRateStatusInfo' + minItems: 1 + restrictedPrimaryRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + restrictedSecondaryRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 1 + v2xContext: + $ref: '#/components/schemas/V2xContext' + lteCatMInd: + type: boolean + default: false + redCapInd: + type: boolean + default: false + moExpDataCounter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MoExpDataCounter' + cagData: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/CagData' + managementMdtInd: + type: boolean + default: false + immediateMdtConf: + $ref: '#/components/schemas/ImmediateMdtConf' + ecRestrictionDataWb: + $ref: '#/components/schemas/EcRestrictionDataWb' + ecRestrictionDataNb: + type: boolean + default: false + iabOperationAllowed: + type: boolean + proseContext: + $ref: '#/components/schemas/ProseContext' + analyticsSubscriptionList: + type: array + items: + $ref: '#/components/schemas/AnalyticsSubscription' + minItems: 1 + pcfAmpBindingInfo: + type: string + pcfUepBindingInfo: + type: string + usedServiceAreaRestriction: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + praInAmPolicy: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: A map(list of key-value pairs) where praId serves as key. + praInUePolicy: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: A map(list of key-value pairs) where praId serves as key. + updpSubscriptionData: + $ref: '#/components/schemas/UpdpSubscriptionData' + smPolicyNotifyPduList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionInfo' + minItems: 1 + pcfUeCallbackInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PcfUeCallbackInfo' + uePositioningCap: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/UePositioningCapabilities' + astiDistributionIndication: + type: boolean + default: false + tsErrorBudget: + type: integer + snpnOnboardInd: + type: boolean + default: false + smfSelInfo: + $ref: 'TS29507_Npcf_AMPolicyControl.yaml#/components/schemas/SmfSelectionData' + pcfUeSliceMbrList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbr' + minProperties: 1 + description: A map(list of key-value pairs) where Snssai serves as key. + smsfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + smsfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smsfBindingInfo: + type: string + disasterRoamingInd: + type: boolean + default: false + disasterPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + + + N2SmInformation: + description: Represents the session management SMF related N2 information data part + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + homePlmnSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + iwkSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + subjectToHo: + type: boolean + required: + - pduSessionId + N2InfoContent: + description: Represents a transparent N2 information content to be relayed by AMF + type: object + properties: + ngapMessageType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + ngapIeType: + $ref: '#/components/schemas/NgapIeType' + ngapData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - ngapData + NrppaInformation: + description: Represents a NRPPa related N2 information data part + type: object + properties: + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nrppaPdu: + $ref: '#/components/schemas/N2InfoContent' + serviceInstanceId: + type: string + required: + - nfId + - nrppaPdu + PwsInformation: + description: Represents a PWS related information data part + type: object + properties: + messageIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + serialNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + pwsContainer: + $ref: '#/components/schemas/N2InfoContent' + bcEmptyAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + sendRanResponse: + type: boolean + default: false + omcId: + $ref: '#/components/schemas/OmcIdentifier' + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + required: + - messageIdentifier + - serialNumber + - pwsContainer + N1N2MsgTxfrFailureNotification: + description: Data within a N1/N2 Message Transfer Failure Notification request + type: object + properties: + cause: + $ref: '#/components/schemas/N1N2MessageTransferCause' + n1n2MsgDataUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - cause + - n1n2MsgDataUri + N1N2MessageTransferError: + description: Data within a N1/N2 Message Transfer Error response + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + errInfo: + $ref: '#/components/schemas/N1N2MsgTxfrErrDetail' + required: + - error + N1N2MsgTxfrErrDetail: + description: N1/N2 Message Transfer Error Details + type: object + properties: + retryAfter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + highestPrioArp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + N2InformationTransferRspData: + description: Data within a successful response to the N2 Information Transfer request to transfer N2 Information to the AN + type: object + properties: + result: + $ref: '#/components/schemas/N2InformationTransferResult' + pwsRspData: + $ref: '#/components/schemas/PWSResponseData' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - result + MmContext: + description: Represents a Mobility Management Context in UE Context + type: object + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + nasSecurityMode: + $ref: '#/components/schemas/NasSecurityMode' + epsNasSecurityMode: + $ref: '#/components/schemas/EpsNasSecurityMode' + nasDownlinkCount: + $ref: '#/components/schemas/NasCount' + nasUplinkCount: + $ref: '#/components/schemas/NasCount' + ueSecurityCapability: + $ref: '#/components/schemas/UeSecurityCapability' + s1UeNetworkCapability: + $ref: '#/components/schemas/S1UeNetworkCapability' + allowedNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nssaiMappingList: + type: array + items: + $ref: '#/components/schemas/NssaiMapping' + minItems: 1 + allowedHomeNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nsInstanceList: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + minItems: 1 + expectedUEbehavior: + $ref: '#/components/schemas/ExpectedUeBehavior' + ueDifferentiationInfo: + $ref: '#/components/schemas/UeDifferentiationInfo' + plmnAssiUeRadioCapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnAssiUeRadioCapId' + manAssiUeRadioCapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ManAssiUeRadioCapId' + ucmfDicEntryId: + type: string + n3IwfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + wagfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + tngfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + anN2ApId: + type: integer + nssaaStatusList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NssaaStatus' + minItems: 1 + pendingNssaiMappingList: + type: array + items: + $ref: '#/components/schemas/NssaiMapping' + minItems: 1 + uuaaMmStatus: + $ref: '#/components/schemas/UuaaMmStatus' + required: + - accessType + SeafData: + description: Represents SEAF data derived from data received from AUSF + type: object + properties: + ngKsi: + $ref: '#/components/schemas/NgKsi' + keyAmf: + $ref: '#/components/schemas/KeyAmf' + nh: + type: string + pattern: '^[A-Fa-f0-9]+$' + ncc: + type: integer + minimum: 0 + maximum: 7 + keyAmfChangeInd: + type: boolean + keyAmfHDerivationInd: + type: boolean + required: + - ngKsi + - keyAmf + NasSecurityMode: + description: Indicates the NAS Security Mode + type: object + properties: + integrityAlgorithm: + $ref: '#/components/schemas/IntegrityAlgorithm' + cipheringAlgorithm: + $ref: '#/components/schemas/CipheringAlgorithm' + required: + - integrityAlgorithm + - cipheringAlgorithm + PduSessionContext: + description: Represents a PDU Session Context in UE Context + type: object + properties: + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + smContextRef: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + selectedDnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + additionalAccessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + allocatedEbiList: + type: array + items: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/EbiArpMapping' + minItems: 1 + hsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + hsmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + hsmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + smfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + vsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + vsmfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + vsmfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + vsmfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + ismfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ismfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + ismfServiceSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + ismfBinding: + $ref: '#/components/schemas/SbiBindingLevel' + nsInstance: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + smfServiceInstanceId: + type: string + maPduSession: + type: boolean + default: false + cnAssistedRanPara: + $ref: 'TS29502_Nsmf_PDUSession.yaml#/components/schemas/CnAssistedRanPara' + nrfManagementUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfDiscoveryUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + smfBindingInfo: + type: string + vsmfBindingInfo: + type: string + ismfBindingInfo: + type: string + additionalSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + interPlmnApiRoot: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + pgwFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pgwIpAddr: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/IpAddress' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + anchorSmfSupportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + anchorSmfOauth2Required: + type: boolean + required: + - pduSessionId + - smContextRef + - sNssai + - dnn + - accessType + NssaiMapping: + description: Represents the mapping between a S-NSSAI in serving PLMN to a S-NSSAI in home PLMN + type: object + properties: + mappedSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + hSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - mappedSnssai + - hSnssai + UeRegStatusUpdateReqData: + description: Data within a UE registration status update request to indicate a completion of transferring at a target AMF + type: object + properties: + transferStatus: + $ref: '#/components/schemas/UeContextTransferStatus' + toReleaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + pcfReselectedInd: + type: boolean + smfChangeInfoList: + type: array + items: + $ref: '#/components/schemas/SmfChangeInfo' + minItems: 1 + analyticsNotUsedList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + toReleaseSessionInfo: + type: array + items: + $ref: '#/components/schemas/ReleaseSessionInfo' + minItems: 1 + required: + - transferStatus + UeRegStatusUpdateRspData: + description: Data within a UE registration status update response to provide the status of UE context transfer status update at a source AMF + type: object + properties: + regStatusTransferComplete: + type: boolean + required: + - regStatusTransferComplete + AssignEbiError: + description: Data within a failure response to the EBI assignment request + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + failureDetails: + $ref: '#/components/schemas/AssignEbiFailed' + required: + - error + - failureDetails + UeContextCreateData: + description: Data within a request to create an individual ueContext resource + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetId: + $ref: '#/components/schemas/NgRanTargetId' + sourceToTargetData: + $ref: '#/components/schemas/N2InfoContent' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + n2NotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ueRadioCapabilityForPaging: + $ref: '#/components/schemas/N2InfoContent' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + required: + - ueContext + - targetId + - sourceToTargetData + - pduSessionList + UeContextCreatedData: + description: Data within a successful response for creating an individual ueContext resource + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetToSourceData: + $ref: '#/components/schemas/N2InfoContent' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + failedSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pcfReselectedInd: + type: boolean + analyticsNotUsedList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + required: + - ueContext + - targetToSourceData + - pduSessionList + UeContextCreateError: + description: Data within a failure response for creating a UE context + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + targetToSourceFailureData: + $ref: '#/components/schemas/N2InfoContent' + required: + - error + UeContextRelocateData: + description: Data within a Relocate UE Context request + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + targetId: + $ref: '#/components/schemas/NgRanTargetId' + sourceToTargetData: + $ref: '#/components/schemas/N2InfoContent' + forwardRelocationRequest: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + pduSessionList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + ueRadioCapability: + $ref: '#/components/schemas/N2InfoContent' + ngapCause: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueContext + - targetId + - sourceToTargetData + - forwardRelocationRequest + UeContextRelocatedData: + description: Data within a Relocate UE Context response + type: object + properties: + ueContext: + $ref: '#/components/schemas/UeContext' + required: + - ueContext + + UeContextCancelRelocateData: + description: Data structure used for cancellation of UE Context Relocation + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + relocationCancelRequest: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - relocationCancelRequest + NgRanTargetId: + description: Indicates a NG RAN as target of the handover + type: object + properties: + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + required: + - ranNodeId + - tai + PWSResponseData: + description: Data related PWS included in a N2 Information Transfer response + type: object + properties: + ngapMessageType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + serialNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint16' + messageIdentifier: + type: integer + unknownTaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + required: + - ngapMessageType + - serialNumber + - messageIdentifier + PWSErrorData: + description: Data related to PWS error included in a N2 Information Transfer failure response + type: object + properties: + namfCause: + type: integer + required: + - namfCause + N2InformationTransferError: + description: Data within a failure response for a non-UE related N2 Information Transfer + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + pwsErrorInfo: + $ref: '#/components/schemas/PWSErrorData' + required: + - error + NgKsi: + description: Represents the ngKSI + type: object + properties: + tsc: + $ref: '#/components/schemas/ScType' + ksi: + type: integer + minimum: 0 + maximum: 6 + required: + - tsc + - ksi + KeyAmf: + description: Represents the Kamf or K'amf + type: object + properties: + keyType: + $ref: '#/components/schemas/KeyAmfType' + keyVal: + type: string + required: + - keyType + - keyVal + ExpectedUeBehavior: + description: Represents the expected UE behavior (e.g. UE moving trajectory) and its validity period + type: object + properties: + expMoveTrajectory: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + minItems: 1 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - expMoveTrajectory + - validityTime + N2RanInformation: + description: Represents the RAN related N2 information data part + type: object + properties: + n2InfoContent: + $ref: '#/components/schemas/N2InfoContent' + required: + - n2InfoContent + N2InfoNotificationRspData: + description: Data within a N2 information notification response + type: object + properties: + secRatDataUsageList: + type: array + items: + $ref: '#/components/schemas/N2SmInformation' + minItems: 1 + SmallDataRateStatusInfo: + description: Represents the small data rate status + type: object + properties: + Snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + Dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + SmallDataRateStatus: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SmallDataRateStatus' + required: + - Snssai + - Dnn + - SmallDataRateStatus + SmfChangeInfo: + description: SMF change information for PDU session(s) + type: object + properties: + pduSessionIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + smfChangeInd: + $ref: '#/components/schemas/SmfChangeIndication' + required: + - pduSessionIdList + - smfChangeInd + + V2xContext: + description: Represents the V2X services related parameters + type: object + properties: + nrV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrV2xAuth' + lteV2xServicesAuth: + $ref: 'TS29571_CommonData.yaml#/components/schemas/LteV2xAuth' + nrUeSidelinkAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + lteUeSidelinkAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + pc5QoSPara: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pc5QoSPara' + + V2xInformation: + description: V2X related N2 information + type: object + properties: + n2Pc5Pol: + $ref: '#/components/schemas/N2InfoContent' + + ProSeInformation: + description: Represents 5G ProSe related N2 information. + type: object + properties: + n2Pc5ProSePol: + $ref: '#/components/schemas/N2InfoContent' + + ImmediateMdtConf: + description: Immediate MDT Configuration + type: object + properties: + jobType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/JobType' + measurementLteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MeasurementLteForMdt' + minItems: 1 + measurementNrList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MeasurementNrForMdt' + minItems: 1 + reportingTriggerList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReportingTrigger' + minItems: 1 + reportInterval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReportIntervalMdt' + reportIntervalNr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReportIntervalNrMdt' + reportAmount: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ReportAmountMdt' + eventThresholdRsrp: + type: integer + minimum: 0 + maximum: 97 + eventThresholdRsrq: + type: integer + minimum: 0 + maximum: 34 + eventThresholdRsrpNr: + type: integer + minimum: 0 + maximum: 127 + eventThresholdRsrqNr: + type: integer + minimum: 0 + maximum: 127 + collectionPeriodRmmLte: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CollectionPeriodRmmLteMdt' + collectionPeriodRmmNr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CollectionPeriodRmmNrMdt' + measurementPeriodLte: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MeasurementPeriodLteMdt' + areaScope: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AreaScope' + positioningMethod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PositioningMethodMdt' + addPositioningMethodList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PositioningMethodMdt' + minItems: 1 + mdtAllowedPlmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + maxItems: 16 + sensorMeasurementList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SensorMeasurement' + minItems: 1 + required: + - jobType + + EpsNasSecurityMode: + description: Indicates the EPS NAS Security Mode + type: object + properties: + integrityAlgorithm: + $ref: '#/components/schemas/EpsNasIntegrityAlgorithm' + cipheringAlgorithm: + $ref: '#/components/schemas/EpsNasCipheringAlgorithm' + required: + - integrityAlgorithm + - cipheringAlgorithm + + EcRestrictionDataWb: + description: Enhanced Coverage Restriction Data for WB-N1 mode + type: object + properties: + ecModeARestricted: + type: boolean + default: false + ecModeBRestricted: + type: boolean + required: + - ecModeBRestricted + + ExtAmfEventSubscription: + description: AMF event subscription extended with additional information received for the subscription + allOf: + - $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/AmfEventSubscription' + - $ref: '#/components/schemas/AmfEventSubscriptionAddInfo' + + AmfEventSubscriptionAddInfo: + description: Additional information received for an AMF event subscription, e.g. binding indications + type: object + properties: + bindingInfo: + type: array + items: + type: string + minItems: 1 + maxItems: 2 + subscribingNfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + eventSyncInd: + type: boolean + nfConsumerInfo: + type: array + items: + type: string + minItems: 1 + aoiStateList: + description: > + Map of subscribed Area of Interest (AoI) Event State in the old AMF. The JSON pointer to + an AmfEventArea element in the areaList IE (or a PresenceInfo element in + presenceInfoList IE) of the AmfEvent data type shall be the key of the map. + additionalProperties: + $ref: '#/components/schemas/AreaOfInterestEventState' + + UeDifferentiationInfo: + description: Represents the UE Differentiation Information and its validity time + type: object + properties: + periodicComInd: + $ref: '#/components/schemas/PeriodicCommunicationIndicator' + periodicTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + scheduledComTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ScheduledCommunicationTime' + stationaryInd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StationaryIndication' + trafficProfile: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TrafficProfile' + batteryInd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BatteryIndication' + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + CeModeBInd: + description: CE-mode-B Support Indicator. + type: object + properties: + ceModeBSupportInd: + type: boolean + required: + - ceModeBSupportInd + + LteMInd: + description: LTE-M Indication. + type: object + properties: + lteCatMInd: + type: boolean + required: + - lteCatMInd + + NpnAccessInfo: + description: NPN Access Information. + type: object + properties: + cellCagInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CagId' + minItems: 1 + + ProseContext: + description: Represents the ProSe services related parameters. + type: object + properties: + directDiscovery: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + directComm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + l2Relay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + l3Relay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + l2Remote: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UeAuth' + nrUePc5Ambr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + pc5QoSPara: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pc5QoSPara' + + AnalyticsSubscription: + description: Analytics subscriptions created in the NWDAF. + type: object + properties: + nwdafId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nwdafSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nwdafSubscriptionList: + type: array + items: + $ref: '#/components/schemas/NwdafSubscription' + minItems: 1 + required: + - nwdafSubscriptionList + + NwdafSubscription: + description: Individual NWDAF subscription identified by the subscription Id. + type: object + properties: + nwdafEvtSubsServiceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nwdafEventsSubscription: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NnwdafEventsSubscription' + required: + - nwdafEvtSubsServiceUri + - nwdafEventsSubscription + + UpdpSubscriptionData: + description: UE policy delivery related N1 message notification subscription data. + type: object + properties: + updpNotifySubscriptionId: + type: string + updpNotifyCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + updpCallbackBinding: + type: string + required: + - updpNotifySubscriptionId + - updpNotifyCallbackUri + + ReleaseSessionInfo: + description: PDU session Id(s) and the cause for triggering the release. + type: object + properties: + releaseSessionList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + minItems: 1 + releaseCause: + $ref: '#/components/schemas/ReleaseCause' + required: + - releaseSessionList + - releaseCause + + AreaOfInterestEventState: + description: Event State of AoI event in old AMF + type: object + required: + - presence + properties: + presence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + individualPraIdList: + type: array + items: + type: string + minItems: 1 + +# +# SIMPLE DATA TYPES +# + EpsBearerId: + description: EPS Bearer Identifier + type: integer + minimum: 0 + maximum: 15 + Ppi: + description: Paging Policy Indicator + type: integer + minimum: 0 + maximum: 7 + NasCount: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + 5GMmCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + UeSecurityCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + S1UeNetworkCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + DrxParameter: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + OmcIdentifier: + description: Represents the OMC Identifier + type: string + MSClassmark2: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + SupportedCodec: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + +# +# ENUMERATIONS +# + StatusChange: + description: Enumeration for AMF status + anyOf: + - type: string + enum: + - AMF_UNAVAILABLE + - AMF_AVAILABLE + - type: string + N2InformationClass: + description: Enumeration for N2 Information Class + anyOf: + - type: string + enum: + - SM + - NRPPa + - PWS + - PWS-BCAL + - PWS-RF + - RAN + - V2X + - PROSE + - type: string + N1MessageClass: + description: Enumeration for N1 Message Class + anyOf: + - type: string + enum: + - 5GMM + - SM + - LPP + - SMS + - UPDP + - LCS + - type: string + N1N2MessageTransferCause: + description: Enumeration for N1N2Message Transfer Cause + anyOf: + - type: string + enum: + - ATTEMPTING_TO_REACH_UE + - N1_N2_TRANSFER_INITIATED + - WAITING_FOR_ASYNCHRONOUS_TRANSFER + - UE_NOT_RESPONDING + - N1_MSG_NOT_TRANSFERRED + - N2_MSG_NOT_TRANSFERRED + - UE_NOT_REACHABLE_FOR_SESSION + - TEMPORARY_REJECT_REGISTRATION_ONGOING + - TEMPORARY_REJECT_HANDOVER_ONGOING + - REJECTION_DUE_TO_PAGING_RESTRICTION + - AN_NOT_RESPONDING + - FAILURE_CAUSE_UNSPECIFIED + - type: string + UeContextTransferStatus: + description: Describes the status of an individual ueContext resource in UE Context Transfer procedures + anyOf: + - type: string + enum: + - TRANSFERRED + - NOT_TRANSFERRED + - type: string + N2InformationTransferResult: + description: Describes the result of N2 information transfer by AMF to the AN + anyOf: + - type: string + enum: + - N2_INFO_TRANSFER_INITIATED + - type: string + CipheringAlgorithm: + description: Indicates the supported Ciphering Algorithm + anyOf: + - type: string + enum: + - NEA0 + - NEA1 + - NEA2 + - NEA3 + - type: string + IntegrityAlgorithm: + description: Indicates the supported Integrity Algorithm + anyOf: + - type: string + enum: + - NIA0 + - NIA1 + - NIA2 + - NIA3 + - type: string + SmsSupport: + description: Indicates the supported SMS delivery of a UE + anyOf: + - type: string + enum: + - 3GPP + - NON_3GPP + - BOTH + - NONE + - type: string + ScType: + description: Indicates the security context type + anyOf: + - type: string + enum: + - NATIVE + - MAPPED + - type: string + KeyAmfType: + description: Indicates the Kamf type + anyOf: + - type: string + enum: + - KAMF + - KPRIMEAMF + - type: string + TransferReason: + description: Indicates UE Context Transfer Reason + anyOf: + - type: string + enum: + - INIT_REG + - MOBI_REG + - MOBI_REG_UE_VALIDATED + - type: string + PolicyReqTrigger: + description: Policy Request Triggers + anyOf: + - type: string + enum: + - LOCATION_CHANGE + - PRA_CHANGE + - ALLOWED_NSSAI_CHANGE + - NWDAF_DATA_CHANGE + - PLMN_CHANGE + - CON_STATE_CHANGE + - SMF_SELECT_CHANGE + - ACCESS_TYPE_CHANGE + - type: string + RatSelector: + description: Indicates the RAT type for the transfer of N2 information + anyOf: + - type: string + enum: + - E-UTRA + - NR + - type: string + NgapIeType: + description: Indicates the supported NGAP IE types + anyOf: + - type: string + enum: + - PDU_RES_SETUP_REQ + - PDU_RES_REL_CMD + - PDU_RES_MOD_REQ + - HANDOVER_CMD + - HANDOVER_REQUIRED + - HANDOVER_PREP_FAIL + - SRC_TO_TAR_CONTAINER + - TAR_TO_SRC_CONTAINER + - TAR_TO_SRC_FAIL_CONTAINER + - RAN_STATUS_TRANS_CONTAINER + - SON_CONFIG_TRANSFER + - NRPPA_PDU + - UE_RADIO_CAPABILITY + - RIM_INFO_TRANSFER + - SECONDARY_RAT_USAGE + - PC5_QOS_PARA + - EARLY_STATUS_TRANS_CONTAINER + - UE_RADIO_CAPABILITY_FOR_PAGING + - type: string + N2InfoNotifyReason: + description: N2 Information Notify Reason + anyOf: + - type: string + enum: + - HANDOVER_COMPLETED + - type: string + SmfChangeIndication: + description: Indicates the I-SMF or V-SMF change or removal + anyOf: + - type: string + enum: + - CHANGED + - REMOVED + - type: string + SbiBindingLevel: + description: SBI Binding Level + anyOf: + - type: string + enum: + - NF_INSTANCE_BINDING + - NF_SET_BINDING + - NF_SERVICE_SET_BINDING + - NF_SERVICE_INSTANCE_BINDING + - type: string + + EpsNasCipheringAlgorithm: + description: Indicates the supported EPS NAS Ciphering Algorithm + anyOf: + - type: string + enum: + - EEA0 + - EEA1 + - EEA2 + - EEA3 + - type: string + + EpsNasIntegrityAlgorithm: + description: Indicates the supported EPS NAS Integrity Algorithm + anyOf: + - type: string + enum: + - EIA0 + - EIA1 + - EIA2 + - EIA3 + - type: string + + PeriodicCommunicationIndicator: + description: Indicates the Periodic Communication Indicator + anyOf: + - type: string + enum: + - PIORIODICALLY + - ON_DEMAND + - type: string + + UuaaMmStatus: + description: Indicates the UUAA-MM status + anyOf: + - type: string + enum: + - SUCCESS + - PENDING + - FAILED + - type: string + + ReleaseCause: + description: The cause for triggering the release. + anyOf: + - type: string + enum: + - SNPN_SNPN_MOBILITY + - NO_HR_AGREEMENT + - UNSPECIFIED + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_EventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_EventExposure.yaml new file mode 100644 index 000000000..c814a065b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_EventExposure.yaml @@ -0,0 +1,1042 @@ +openapi: 3.0.0 + +info: + version: 1.2.1 + title: Namf_EventExposure + description: | + AMF Event Exposure Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +security: + - {} + - oAuth2ClientCredentials: + - namf-evts + +externalDocs: + description: 3GPP TS 29.518 V17.7.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-evts/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /subscriptions: + post: + summary: Namf_EventExposure Subscribe service Operation + tags: + - Subscriptions collection (Collection) + operationId: CreateSubscription + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfCreateEventSubscription' + required: true + responses: + '201': + description: Subsription Created + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-evts//subscriptions/{subscriptionId}' + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AmfCreatedEventSubscription' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + onEventReport: + '{$request.body#/subscription/eventNotifyUri}': + post: + summary: Event Notificaiton Delivery + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfEventNotification' + required: true + responses: + '204': + description: Successful acknowledgement + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + onSubscriptionIdChangeEvtReport: + '{$request.body#/subscription/subsChangeNotifyUri}': + post: + summary: Event Notificaiton Delivery For Subscription Id Change + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AmfEventNotification' + required: true + responses: + '204': + description: Successful acknowledgement + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /subscriptions/{subscriptionId}: + patch: + summary: Namf_EventExposure Subscribe Modify service Operation + tags: + - Individual subscription (Document) + operationId: ModifySubscription + parameters: + - name: subscriptionId + in: path + required: true + description: Unique ID of the subscription to be modified + schema: + type: string + requestBody: + content: + application/json-patch+json: + schema: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AmfUpdateEventSubscriptionItem' + minItems: 1 + - type: array + items: + $ref: '#/components/schemas/AmfUpdateEventOptionItem' + minItems: 1 + maxItems: 1 + required: true + responses: + '200': + description: Subsription modified successfully + content: + application/json: + schema: + $ref: '#/components/schemas/AmfUpdatedEventSubscription' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: Namf_EventExposure Unsubscribe service Operation + tags: + - Individual subscription (Document) + operationId: DeleteSubscription + parameters: + - name: subscriptionId + in: path + required: true + description: Unique ID of the subscription to be deleted + schema: + type: string + responses: + '204': + description: Subsription deleted successfully + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-evts: Access to the Namf_EventExposure API + schemas: + AmfEventSubscription: + description: Represents an individual event subscription resource on AMF + type: object + properties: + eventList: + type: array + items: + $ref: '#/components/schemas/AmfEvent' + minItems: 1 + eventNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifyCorrelationId: + type: string + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + subsChangeNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subsChangeNotifyCorrelationId: + type: string + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + excludeSupiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + excludeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + includeSupiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + includeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + anyUE: + type: boolean + options: + $ref: '#/components/schemas/AmfEventMode' + sourceNfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + required: + - eventList + - eventNotifyUri + - notifyCorrelationId + - nfId + AmfEvent: + description: Describes an event to be subscribed + type: object + properties: + type: + $ref: '#/components/schemas/AmfEventType' + immediateFlag: + type: boolean + default: false + areaList: + type: array + items: + $ref: '#/components/schemas/AmfEventArea' + minItems: 1 + locationFilterList: + type: array + items: + $ref: '#/components/schemas/LocationFilter' + minItems: 1 + refId: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + trafficDescriptorList: + type: array + items: + $ref: '#/components/schemas/TrafficDescriptor' + minItems: 1 + reportUeReachable: + type: boolean + default: false + reachabilityFilter: + $ref: '#/components/schemas/ReachabilityFilter' + udmDetectInd: + type: boolean + default: false + maxReports: + type: integer + presenceInfoList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: A map(list of key-value pairs) where praId serves as key. + maxResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + targetArea: + $ref: '#/components/schemas/TargetArea' + snssaiFilter: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + ueInAreaFilter: + $ref: '#/components/schemas/UeInAreaFilter' + minInterval: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + nextReport: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + idleStatusInd: + type: boolean + default: false + dispersionArea: + $ref: '#/components/schemas/DispersionArea' + required: + - type + AmfEventNotification: + description: Data within a AMF Event Notification request + type: object + properties: + notifyCorrelationId: + type: string + subsChangeNotifyCorrelationId: + type: string + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + eventSubsSyncInfo: + $ref: '#/components/schemas/AmfEventSubsSyncInfo' + AmfEventReport: + description: Represents a report triggered by a subscribed event type + type: object + properties: + type: + $ref: '#/components/schemas/AmfEventType' + state: + $ref: '#/components/schemas/AmfEventState' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + anyUe: + type: boolean + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + areaList: + type: array + items: + $ref: '#/components/schemas/AmfEventArea' + minItems: 1 + refId: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + additionalLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + rmInfoList: + type: array + items: + $ref: '#/components/schemas/RmInfo' + minItems: 1 + cmInfoList: + type: array + items: + $ref: '#/components/schemas/CmInfo' + minItems: 1 + reachability: + $ref: '#/components/schemas/UeReachability' + commFailure: + $ref: '#/components/schemas/CommunicationFailure' + lossOfConnectReason: + $ref: '#/components/schemas/LossOfConnectivityReason' + numberOfUes: + type: integer + 5gsUserStateList: + type: array + items: + $ref: '#/components/schemas/5GsUserStateInfo' + minItems: 1 + typeCode: + type: string + pattern: '^imeitac-[0-9]{8}$' + registrationNumber: + type: integer + maxAvailabilityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueIdExt: + type: array + items: + $ref: '#/components/schemas/UEIdExt' + minItems: 1 + snssaiTaiList: + type: array + items: + $ref: '#/components/schemas/SnssaiTaiMapping' + minItems: 1 + idleStatusIndication: + $ref: '#/components/schemas/IdleStatusIndication' + ueAccessBehaviorTrends: + type: array + items: + $ref: '#/components/schemas/UeAccessBehaviorReportItem' + minItems: 1 + ueLocationTrends: + type: array + items: + $ref: '#/components/schemas/UeLocationTrendsReportItem' + minItems: 1 + mmTransLocationReportList: + type: array + items: + $ref: '#/components/schemas/MmTransactionLocationReportItem' + minItems: 1 + mmTransSliceReportList: + type: array + items: + $ref: '#/components/schemas/MmTransactionSliceReportItem' + minItems: 1 + required: + - type + - state + - timeStamp + AmfEventMode: + description: Describes how the reports shall be generated by a subscribed event + type: object + properties: + trigger: + $ref: '#/components/schemas/AmfEventTrigger' + maxReports: + type: integer + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + sampRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + partitioningCriteria: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PartitioningCriteria' + minItems: 1 + notifFlag: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationFlag' + required: + - trigger + AmfEventState: + description: Represents the state of a subscribed event + type: object + properties: + active: + type: boolean + remainReports: + type: integer + remainDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - active + RmInfo: + description: Represents the registration state of a UE for an access type + type: object + properties: + rmState: + $ref: '#/components/schemas/RmState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - rmState + - accessType + CmInfo: + description: Represents the connection management state of a UE for an access type + type: object + properties: + cmState: + $ref: '#/components/schemas/CmState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - cmState + - accessType + CommunicationFailure: + description: Describes a communication failure detected by AMF + type: object + properties: + nasReleaseCode: + type: string + ranReleaseCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NgApCause' + AmfCreateEventSubscription: + description: Data within a create AMF event subscription request + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + required: + - subscription + AmfCreatedEventSubscription: + description: Data within a create AMF event subscription response + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + subscriptionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - subscription + - subscriptionId + AmfUpdateEventSubscriptionItem: + description: Document describing the modification(s) to an AMF Event Subscription + type: object + properties: + op: + type: string + enum: + - add + - remove + - replace + path: + type: string + pattern: '^\/eventList\/-|(\/eventList\/0|\/eventList\/[1-9][0-9]*){1}(\/presenceInfoList\/0|\/presenceInfoList\/[1-9][0-9]*)?|\/excludeSupiList|\/excludeGpsiList$' + value: + $ref: '#/components/schemas/AmfEvent' + presenceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + excludeSupiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + excludeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + includeSupiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + includeGpsiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + required: + - op + - path + AmfUpdateEventOptionItem: + description: Document describing the modifications to AMF event subscription options + type: object + properties: + op: + type: string + enum: + - replace + path: + type: string + pattern: '\/options\/expiry$' + value: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + notifFlag: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationFlag' + required: + - op + - path + - value + AmfUpdatedEventSubscription: + description: Represents a successful update on an AMF Event Subscription + type: object + properties: + subscription: + $ref: '#/components/schemas/AmfEventSubscription' + reportList: + type: array + items: + $ref: '#/components/schemas/AmfEventReport' + minItems: 1 + required: + - subscription + AmfEventArea: + description: Represents an area to be monitored by an AMF event + type: object + properties: + presenceInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + ladnInfo: + $ref: '#/components/schemas/LadnInfo' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiId: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + LadnInfo: + description: LADN Information + type: object + properties: + ladn: + type: string + presence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceState' + required: + - ladn + 5GsUserStateInfo: + description: Represents the 5GS User state of the UE for an access type + type: object + properties: + 5gsUserState: + $ref: '#/components/schemas/5GsUserState' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + required: + - 5gsUserState + - accessType + TrafficDescriptor: + description: Represents the Traffic Descriptor + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dddTrafficDescriptorList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DddTrafficDescriptor' + minItems: 1 + UEIdExt: + description: UE Identity + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + + AmfEventSubsSyncInfo: + description: AMF Event Subscriptions Information for synchronization + type: object + properties: + subscriptionList: + type: array + items: + $ref: '#/components/schemas/AmfEventSubscriptionInfo' + minItems: 1 + required: + - subscriptionList + + AmfEventSubscriptionInfo: + description: Individual AMF Event Subscription Information + type: object + properties: + subId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifyCorrelationId: + type: string + refIdList: + type: array + items: + $ref: 'TS29503_Nudm_EE.yaml#/components/schemas/ReferenceId' + minItems: 1 + oldSubId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - subId + - refIdList + + TargetArea: + description: TA list or TAI range list or any TA + type: object + properties: + taList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + anyTa: + type: boolean + default: false + + SnssaiTaiMapping: + description: List of restricted or unrestricted S-NSSAIs per TAI(s) + type: object + properties: + reportingArea: + $ref: '#/components/schemas/TargetArea' + accessTypeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + minItems: 1 + supportedSnssaiList: + type: array + items: + $ref: '#/components/schemas/SupportedSnssai' + minItems: 1 + required: + - reportingArea + + UeAccessBehaviorReportItem: + description: Report Item for UE Access Behavior Trends event. + type: object + properties: + stateTransitionType: + $ref: '#/components/schemas/AccessStateTransitionType' + spacing: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + duration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - stateTransitionType + - spacing + - duration + + IdleStatusIndication: + description: Represents the idle status indication. + type: object + properties: + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + activeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + subsRegTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + edrxCycleLength: + type: integer + suggestedNumOfDlPackets: + type: integer + + UeInAreaFilter: + description: Additional filters for UE in Area Report event + type: object + properties: + ueType: + $ref: '#/components/schemas/UeType' + aerialSrvDnnInd: + type: boolean + default: false + + SupportedSnssai: + description: Supported S-NSSAIs + type: object + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + restrictionInd: + type: boolean + default: false + required: + - sNssai + + UeLocationTrendsReportItem: + description: Report Item for UE Location Trends event. + type: object + properties: + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + n3gaLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/N3gaLocation' + spacing: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + duration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + timestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - spacing + - duration + - timestamp + + DispersionArea: + description: Dispersion Area + type: object + properties: + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + ncgiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + ecgiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + n3gaInd: + type: boolean + default: false + + MmTransactionLocationReportItem: + description: UE MM Transaction Report Item per Location + type: object + properties: + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + n3gaLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/N3gaLocation' + timestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + transactions: + type: integer + required: + - timestamp + - transactions + + MmTransactionSliceReportItem: + description: UE MM Transaction Report Item per Slice + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + timestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + transactions: + type: integer + required: + - timestamp + - transactions + + AmfEventType: + description: Describes the supported event types of Namf_EventExposure Service + anyOf: + - type: string + enum: + - LOCATION_REPORT + - PRESENCE_IN_AOI_REPORT + - TIMEZONE_REPORT + - ACCESS_TYPE_REPORT + - REGISTRATION_STATE_REPORT + - CONNECTIVITY_STATE_REPORT + - REACHABILITY_REPORT + - COMMUNICATION_FAILURE_REPORT + - UES_IN_AREA_REPORT + - SUBSCRIPTION_ID_CHANGE + - SUBSCRIPTION_ID_ADDITION + - LOSS_OF_CONNECTIVITY + - 5GS_USER_STATE_REPORT + - AVAILABILITY_AFTER_DDN_FAILURE + - TYPE_ALLOCATION_CODE_REPORT + - FREQUENT_MOBILITY_REGISTRATION_REPORT + - SNSSAI_TA_MAPPING_REPORT + - UE_LOCATION_TRENDS + - UE_ACCESS_BEHAVIOR_TRENDS + - UE_MM_TRANSACTION_REPORT + - type: string + AmfEventTrigger: + description: Describes how AMF should generate the report for the event + anyOf: + - type: string + enum: + - ONE_TIME + - CONTINUOUS + - PERIODIC + - type: string + LocationFilter : + description: Describes the supported filters of LOCATION_REPORT event type + anyOf: + - type: string + enum: + - TAI + - CELL_ID + - RAN_NODE + - N3IWF + - UE_IP + - UDP_PORT + - TNAP_ID + - GLI + - TWAP_ID + - type: string + UeReachability: + description: Describes the reachability of the UE + anyOf: + - type: string + enum: + - UNREACHABLE + - REACHABLE + - REGULATORY_ONLY + - type: string + RmState: + description: Describes the registration management state of a UE + anyOf: + - type: string + enum: + - REGISTERED + - DEREGISTERED + - type: string + CmState: + description: Describes the connection management state of a UE + anyOf: + - type: string + enum: + - IDLE + - CONNECTED + - type: string + 5GsUserState: + description: Describes the 5GS User State of a UE + anyOf: + - type: string + enum: + - DEREGISTERED + - CONNECTED_NOT_REACHABLE_FOR_PAGING + - CONNECTED_REACHABLE_FOR_PAGING + - NOT_PROVIDED_FROM_AMF + - type: string + LossOfConnectivityReason: + description: Describes the reason for loss of connectivity + anyOf: + - type: string + enum: + - DEREGISTERED + - MAX_DETECTION_TIME_EXPIRED + - PURGED + - type: string + + ReachabilityFilter: + description: Event filter for REACHABILITY_REPORT event type + anyOf: + - type: string + enum: + - UE_REACHABILITY_STATUS_CHANGE + - UE_REACHABLE_DL_TRAFFIC + - type: string + + UeType: + description: Describes the type of UEs + anyOf: + - type: string + enum: + - AERIAL_UE + - type: string + + AccessStateTransitionType: + description: Access State Transition Type. + anyOf: + - type: string + enum: + - ACCESS_TYPE_CHANGE_3GPP + - ACCESS_TYPE_CHANGE_N3GPP + - RM_STATE_CHANGE_DEREGISTERED + - RM_STATE_CHANGE_REGISTERED + - CM_STATE_CHANGE_IDLE + - CM_STATE_CHANGE_CONNECTED + - HANDOVER + - MOBILITY_REGISTRATION_UPDATE + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_Location.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_Location.yaml new file mode 100644 index 000000000..102714ba4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_Location.yaml @@ -0,0 +1,502 @@ +openapi: 3.0.0 + +info: + version: 1.2.1 + title: Namf_Location + description: | + AMF Location Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +security: + - {} + - oAuth2ClientCredentials: + - namf-loc + +externalDocs: + description: 3GPP TS 29.518 V17.7.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-loc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /{ueContextId}/provide-pos-info: + post: + summary: Namf_Location ProvidePositioningInfo service Operation + tags: + - Individual UE context (Document) + operationId: ProvidePositioningInfo + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestPosInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvidePosInfo' + '204': + description: Successful accept of location request with no information returned. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + description: Unexpected error + callbacks: + onUELocationNotification: + '{$request.body#/locationNotificationUri}': + post: + requestBody: + description: UE Location Event Notification + content: + application/json: + schema: + $ref: '#/components/schemas/NotifiedPosInfo' + responses: + '204': + description: Expected response to a successful callback processing + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + /{ueContextId}/provide-loc-info: + post: + summary: Namf_Location ProvideLocationInfo service Operation + tags: + - Individual UE context (Document) + operationId: ProvideLocationInfo + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestLocInfo' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ProvideLocInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{ueContextId}/cancel-pos-info: + post: + summary: Namf_Location CancelLocation service operation + tags: + - Individual UE context (Document) + operationId: CancelLocation + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|imei-[0-9]{15}|imeisv-[0-9]{16}|.+)$' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CancelPosInfo' + required: true + responses: + '204': + description: Expected response to a successful cancellation + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-loc: Access to the Namf_Location API + schemas: + RequestPosInfo: + description: Data within Provide Positioning Information Request + type: object + properties: + lcsClientType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/ExternalClientType' + lcsLocation: + $ref: '#/components/schemas/LocationType' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + priority: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsPriority' + lcsQoS: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocationQoS' + velocityRequested: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityRequested' + lcsSupportedGADShapes: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + additionalLcsSuppGADShapes: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/SupportedGADShapes' + minItems: 1 + locationNotificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + lcsServiceType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsServiceType' + ldrType: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + periodicEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MotionEventInfo' + externalClientIdentification: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/ExternalClientIdentification' + afID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + codeWord: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/CodeWord' + uePrivacyRequirements: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/UePrivacyRequirements' + scheduledLocTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reliableLocReq: + type: boolean + default: false + required: + - lcsClientType + - lcsLocation + ProvidePosInfo: + description: Data within Provide Positioning Information Response + type: object + properties: + locationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + localLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocalArea' + accuracyFulfilmentIndicator: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AccuracyFulfilmentIndicator' + ageOfLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + velocityEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' + positioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + gnssPositioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + targetServingNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + targetMmeName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + targetMmeRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + utranSrvccInd: + type: boolean + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + barometricPressure: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/BarometricPressure' + altitude: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/Altitude' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + locationPrivacyVerResult: + $ref: '#/components/schemas/LocationPrivacyVerResult' + achievedQos: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MinorLocationQoS' + + NotifiedPosInfo: + description: Data within EventNotify notification + type: object + properties: + locationEvent: + $ref: '#/components/schemas/LocationEvent' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + locationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + localLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LocalArea' + ageOfLocationEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + velocityEstimate: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/VelocityEstimate' + positioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/PositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + gnssPositioningDataList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 0 + maxItems: 9 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + servingNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + targetMmeName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + targetMmeRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + utranSrvccInd: + type: boolean + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + barometricPressure: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/BarometricPressure' + altitude: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/Altitude' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + terminationCause: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/TerminationCause' + achievedQos: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/MinorLocationQoS' + mscServerId: + $ref: 'TS29503_Nudm_UECM.yaml#/components/schemas/E164Number' + required: + - locationEvent + RequestLocInfo: + description: Data within Provide Location Information Request + type: object + properties: + req5gsLoc: + type: boolean + default: false + reqCurrentLoc: + type: boolean + default: false + reqRatType: + type: boolean + default: false + reqTimeZone: + type: boolean + default: false + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ProvideLocInfo: + description: Data within Provide Location Information Response + type: object + properties: + currentLoc: + type: boolean + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + additionalLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + geoInfo: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + locationAge: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/AgeOfLocationEstimate' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + timezone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + CancelPosInfo: + description: Data within a Cancel Location Request + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LdrReference' + servingLMFIdentification: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LMFIdentification' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supi + - hgmlcCallBackURI + - ldrReference + LocationType: + description: Type of location measurement requested + anyOf: + - type: string + enum: + - CURRENT_LOCATION + - CURRENT_OR_LAST_KNOWN_LOCATION + - NOTIFICATION_VERIFICATION_ONLY + - DEFERRED_LOCATION + - type: string + LocationEvent: + description: Type of events initiating location procedures + anyOf: + - type: string + enum: + - EMERGENCY_CALL_ORIGINATION + - EMERGENCY_CALL_RELEASE + - EMERGENCY_CALL_HANDOVER + - ACTIVATION_OF_DEFERRED_LOCATION + - UE_MOBILITY_FOR_DEFERRED_LOCATION + - CANCELLATION_OF_DEFERRED_LOCATION + - type: string + + LocationPrivacyVerResult: + description: The result of location privacy verification by UE + anyOf: + - type: string + enum: + - LOCATION_ALLOWED + - LOCATION_NOT_ALLOWED + - RESPONSE_TIME_OUT + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MBSBroadcast.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MBSBroadcast.yaml new file mode 100644 index 000000000..bf7981a3d --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MBSBroadcast.yaml @@ -0,0 +1,768 @@ +openapi: 3.0.0 + +info: + version: 1.0.2 + title: Namf_MBSBroadcast + description: | + AMF MBSBroadcast Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.518 V17.8.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-mbs-bc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - namf-mbs-bc + +paths: + /mbs-contexts: + post: + summary: Namf_MBSBroadcast ContextCreate service Operation + tags: + - Broadcast MBS session contexts collection (Collection) + operationId: ContextCreate + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/ContextCreateReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + callbacks: + contextStatusNotification: + '{$request.body#/notifyUri}': + post: + requestBody: # notification request without binary body part + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ContextStatusNotification' + multipart/related: # notification request with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/ContextStatusNotification' + binaryDataN2Information1: + type: string + format: binary + binaryDataN2Information2: + type: string + format: binary + binaryDataN2Information3: + type: string + format: binary + binaryDataN2Information4: + type: string + format: binary + binaryDataN2Information5: + type: string + format: binary + binaryDataN2Information6: + type: string + format: binary + binaryDataN2Information7: + type: string + format: binary + binaryDataN2Information8: + type: string + format: binary + binaryDataN2Information9: + type: string + format: binary + binaryDataN2Information10: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + responses: + '204': + description: successful notification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + responses: + '201': + description: MBS Broadcast context created successfully + headers: + Location: + description: 'Contains the URI of the newly created resource, according to the structure: {apiRoot}/namf-mbs-bc//mbs-contexts/{mbsContextRef}' + required: true + schema: + type: string + content: + application/json: # message without binary body part(s) + schema: + $ref: '#/components/schemas/ContextCreateRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Response parts + jsonData: + $ref: '#/components/schemas/ContextCreateRspData' + binaryDataN2Information1: + type: string + format: binary + binaryDataN2Information2: + type: string + format: binary + binaryDataN2Information3: + type: string + format: binary + binaryDataN2Information4: + type: string + format: binary + binaryDataN2Information5: + type: string + format: binary + binaryDataN2Information6: + type: string + format: binary + binaryDataN2Information7: + type: string + format: binary + binaryDataN2Information8: + type: string + format: binary + binaryDataN2Information9: + type: string + format: binary + binaryDataN2Information10: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /mbs-contexts/{mbsContextRef}: + delete: + summary: Namf_MBSBroadcast ContextDelete service Operation + tags: + - Individual broadcast MBS session context (Document) + operationId: ContextDelete + parameters: + - name: mbsContextRef + in: path + required: true + description: Unique ID of the broadcast MSB session context to be deleted + schema: + type: string + responses: + '204': + description: successful deletion + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /mbs-contexts/{mbsContextRef}/update: + post: + summary: Namf_MBSBroadcast ContextUpdate service Operation + tags: + - Individual broadcast MBS session context (Document) + operationId: ContextUpdate + parameters: + - name: mbsContextRef + in: path + description: Unique ID of the broadcast MSB session context to be updated + required: true + schema: + type: string + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/ContextUpdateReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: MBS Broadcast context updated successfully + content: + application/json: # message without binary body part(s) + schema: + $ref: '#/components/schemas/ContextUpdateRspData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Response parts + jsonData: + $ref: '#/components/schemas/ContextUpdateRspData' + binaryDataN2Information1: + type: string + format: binary + binaryDataN2Information2: + type: string + format: binary + binaryDataN2Information3: + type: string + format: binary + binaryDataN2Information4: + type: string + format: binary + binaryDataN2Information5: + type: string + format: binary + binaryDataN2Information6: + type: string + format: binary + binaryDataN2Information7: + type: string + format: binary + binaryDataN2Information8: + type: string + format: binary + binaryDataN2Information9: + type: string + format: binary + binaryDataN2Information10: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information1: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information2: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information3: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information4: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information5: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information6: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information7: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information8: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information9: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + binaryDataN2Information10: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + '204': + description: MBS Broadcast context updated successfully. No Content. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '502': + $ref: 'TS29571_CommonData.yaml#/components/responses/502' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-mbs-bc: Access to the Namf_MBSBroadcast API + + schemas: + +# +# STRUCTURED DATA TYPES +# + ContextCreateReqData: + description: Data within ContextCreate Request + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + mbsServiceAreaInfoList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceAreaInfo' + minItems: 1 + mbsServiceArea: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceArea' + n2MbsSmInfo: + $ref: '#/components/schemas/N2MbsSmInfo' + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + maxResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + mbsmfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + mbsmfServiceInstId: + type: string + required: + - mbsSessionId + - n2MbsSmInfo + - notifyUri + - snssai + oneOf: + - required: [ mbsServiceArea ] + - required: [ mbsServiceAreaInfoList ] + + ContextCreateRspData: + description: Data within ContextCreate Response + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + n2MbsSmInfoList: + type: array + items: + $ref: '#/components/schemas/N2MbsSmInfo' + minItems: 1 + maxItems: 10 + operationStatus: + $ref: '#/components/schemas/OperationStatus' + required: + - mbsSessionId + + + ContextUpdateReqData: + description: Data within ContextUpdate Request + type: object + properties: + mbsServiceArea: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceArea' + mbsServiceAreaInfoList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceAreaInfo' + minItems: 1 + n2MbsSmInfo: + $ref: '#/components/schemas/N2MbsSmInfo' + ranIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + noNgapSignallingInd: + type: boolean + enum: + - true + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + maxResponseTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + n2MbsInfoChangeInd: + type: boolean + not: + required: [ mbsServiceArea, mbsServiceAreaInfoList ] + + ContextStatusNotification: + description: Data within ContextStatusNotify Request + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + areaSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AreaSessionId' + n2MbsSmInfoList: + type: array + items: + $ref: '#/components/schemas/N2MbsSmInfo' + minItems: 1 + maxItems: 10 + operationEvents: + type: array + items: + $ref: '#/components/schemas/OperationEvent' + minItems: 1 + operationStatus: + $ref: '#/components/schemas/OperationStatus' + required: + - mbsSessionId + + ContextUpdateRspData: + description: Data within ContextUpdate Response + type: object + properties: + n2MbsSmInfoList: + type: array + items: + $ref: '#/components/schemas/N2MbsSmInfo' + minItems: 1 + maxItems: 10 + operationStatus: + $ref: '#/components/schemas/OperationStatus' + + N2MbsSmInfo: + description: N2 MBS Session Management information + type: object + properties: + ngapIeType: + $ref: '#/components/schemas/NgapIeType' + ngapData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + randId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + required: + - ngapIeType + - ngapData + - randId + + OperationEvent: + description: Operation Event for a Broadcast MBS Session. + type: object + properties: + opEventType: + $ref: '#/components/schemas/OpEventType' + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + ngranFailureEventList: + type: array + items: + $ref: '#/components/schemas/NgranFailureEvent' + minItems: 1 + required: + - opEventType + + + NgranFailureEvent: + description: NG-RAN failure event for a NG-RAN + type: object + properties: + ngranId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + ngranFailureIndication: + $ref: '#/components/schemas/NgranFailureIndication' + required: + - ngranId + - ngranFailureIndication + + +# +# SIMPLE DATA TYPES +# + + +# +# ENUMERATIONS +# + + OperationStatus: + description: Status of a Broadcast MBS session start or update operation. + anyOf: + - type: string + enum: + - MBS_SESSION_START_COMPLETE + - MBS_SESSION_START_INCOMPLETE + - MBS_SESSION_UPDATE_COMPLETE + - MBS_SESSION_UPDATE_INCOMPLETE + - type: string + + NgapIeType: + description: NGAP Information Element Type + anyOf: + - type: string + enum: + - MBS_SES_REQ + - MBS_SES_RSP + - MBS_SES_FAIL + - MBS_SES_REL_RSP + - type: string + + OpEventType: + description: Operation Event Type. + anyOf: + - type: string + enum: + - AMF_CHANGE + - NG_RAN_EVENT + - type: string + + NgranFailureIndication: + description: Indicates a NG-RAN failure event. + anyOf: + - type: string + enum: + - NG_RAN_RESTART_OR_START + - NG_RAN_FAILURE_WITHOUT_RESTART + - NG_RAN_NOT_REACHABLE + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MBSCommunication.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MBSCommunication.yaml new file mode 100644 index 000000000..8fb9ce341 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MBSCommunication.yaml @@ -0,0 +1,168 @@ +openapi: 3.0.0 + +info: + version: 1.0.1 + title: Namf_MBSCommunication + description: | + AMF Communication Service for MBS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.518 V17.8.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-mbs-comm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - namf-mbs-comm + +paths: + /n2-messages/transfer: + post: + summary: Namf_MBSCommunication N2 Message Transfer service Operation + tags: + - N2Messages Handler (custom operation) + operationId: N2MessageTransfer + requestBody: + content: + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/MbsN2MessageTransferReqData' + binaryDataN2Information: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataN2Information: + contentType: application/vnd.3gpp.ngap + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: MBS N2 Message Transfer successfully initiated + content: + application/json: + schema: + $ref: '#/components/schemas/MbsN2MessageTransferRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-mbs-comm: Access to the Namf_MBSCommunication API + + schemas: + +# +# STRUCTURED DATA TYPES +# + + MbsN2MessageTransferReqData: + description: Data within MBS N2 Message Transfer Request + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + areaSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AreaSessionId' + n2MbsSmInfo: + $ref: '#/components/schemas/N2MbsSmInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - mbsSessionId + - n2MbsSmInfo + + + + MbsN2MessageTransferRspData: + description: Data within MBS N2 Message Transfer Response + type: object + properties: + result: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/N2InformationTransferResult' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - result + + + + + N2MbsSmInfo: + description: N2 MBS Session Management information + type: object + properties: + ngapIeType: + $ref: '#/components/schemas/MbsNgapIeType' + ngapData: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + required: + - ngapIeType + - ngapData + +# +# SIMPLE DATA TYPES +# + + +# +# ENUMERATIONS +# + + MbsNgapIeType: + description: NGAP Information Element Type + anyOf: + - type: string + enum: + - MBS_SES_ACT_REQ + - MBS_SES_DEACT_REQ + - MBS_SES_UPD_REQ + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MT.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MT.yaml new file mode 100644 index 000000000..209e03798 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29518_Namf_MT.yaml @@ -0,0 +1,384 @@ +openapi: 3.0.0 + +info: + version: 1.2.1 + title: Namf_MT + description: | + AMF Mobile Terminated Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +security: + - {} + - oAuth2ClientCredentials: + - namf-mt + +externalDocs: + description: 3GPP TS 29.518 V17.8.0; 5G System; Access and Mobility Management Services + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.518/' + +servers: + - url: '{apiRoot}/namf-mt/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + '/ue-contexts/{ueContextId}': + get: + summary: Namf_MT Provide Domain Selection Info service Operation + tags: + - ueContext (Document) + operationId: Provide Domain Selection Info + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|.+)$' + - name: info-class + in: query + description: UE Context Information Class + schema: + $ref: '#/components/schemas/UeContextInfoClass' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: old-guami + in: query + description: Old GUAMI + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + responses: + '200': + description: Requested UE Context Information returned + content: + application/json: + schema: + $ref: '#/components/schemas/UeContextInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /ue-contexts/{ueContextId}/ue-reachind: + put: + summary: Namf_MT EnableUEReachability service Operation + tags: + - ueReachInd (Document) + operationId: EnableUeReachability + parameters: + - name: ueContextId + in: path + description: UE Context Identifier + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EnableUeReachabilityReqData' + required: true + responses: + '200': + description: UE has become reachable as desired + content: + application/json: + schema: + $ref: '#/components/schemas/EnableUeReachabilityRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetailsEnableUeReachability' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + description: Gateway Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetailsEnableUeReachability' + default: + description: Unexpected error + + /ue-contexts: + post: + summary: Namf_MT EnableGroupReachability service Operation + tags: + - ueContexts (collection) + operationId: EnableGroupReachability + requestBody: + description: list of UEs requested to be made reachable for the related TMGI + content: + application/json: + schema: + $ref: '#/components/schemas/EnableGroupReachabilityReqData' + required: true + responses: + '200': + description: Successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/EnableGroupReachabilityRspData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + description: Unexpected error + callbacks: + reachabilityNotification: + '{request.body#/reachabilityNotifyUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReachabilityNotificationData' + responses: + '204': + description: UE reachability notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + namf-mt: Access to the Namf_MT API + schemas: + EnableUeReachabilityReqData: + description: Data within the Enable UE Reachability Request + type: object + properties: + reachability: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + oldGuami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + extBufSupport: + type: boolean + default: false + required: + - reachability + EnableUeReachabilityRspData: + description: Data within the Enable UE Reachability Response + type: object + properties: + reachability: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - reachability + UeContextInfo: + description: UE Context Information + type: object + properties: + supportVoPS: + type: boolean + supportVoPSn3gpp: + type: boolean + lastActTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ProblemDetailsEnableUeReachability: + description: Enable UE Reachability Error Detail + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/AdditionInfoEnableUeReachability' + AdditionInfoEnableUeReachability: + description: Additional information to be returned in EnableUeReachability error response + type: object + properties: + maxWaitingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + EnableGroupReachabilityReqData: + description: Data within the Enable Group Reachability Request + type: object + properties: + ueInfoList: + type: array + items: + $ref: '#/components/schemas/UeInfo' + minItems: 1 + tmgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tmgi' + reachabilityNotifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + mbsServiceAreaInfoList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsServiceAreaInfo' + minItems: 1 + arp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Arp' + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ueInfoList + - tmgi + EnableGroupReachabilityRspData: + description: Data within the Enable Group Reachability Response + type: object + properties: + ueConnectedList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + UeInfo: + description: list of UEs requested to be made reachable for the MBS Session + type: object + properties: + ueList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + required: + - ueList + + ReachabilityNotificationData: + description: Data within the UE Reachability Info Notify + type: object + properties: + reachableUeList: + type: array + items: + $ref: '#/components/schemas/ReachableUeInfo' + minItems: 1 + unreachableUeList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + ReachableUeInfo: + description: Contains the reachable UE Information + type: object + properties: + ueList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + userLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + required: + - ueList + + UeContextInfoClass: + description: Indicates the UE Context information class + anyOf: + - type: string + enum: + - TADS + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Application_Data.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Application_Data.yaml new file mode 100644 index 000000000..641e86945 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Application_Data.yaml @@ -0,0 +1,3311 @@ +openapi: 3.0.0 + +info: + version: '-' + title: Unified Data Repository Service API file for Application Data + description: | + The API version is defined in 3GPP TS 29.504 + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.519 V17.8.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, + Application Data and Structured Data for Exposure. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /application-data/pfds: + get: + summary: Retrieve PFDs for application identifier(s) + operationId: ReadPFDData + tags: + - PFD Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:pfds:read + parameters: + - name: appId + in: query + description: > + Contains the information of the application identifier(s) for the querying PFD + Data resource. If none appId is included in the URI, it applies to all application + identifier(s) for the querying PFD Data resource. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: A representation of PFDs for request applications is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdDataForAppExt' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/pfds/{appId}: + get: + summary: Retrieve the corresponding PFDs of the specified application identifier + operationId: ReadIndividualPFDData + tags: + - Individual PFD Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:pfds:read + parameters: + - name: appId + in: path + description: > + Indicate the application identifier for the request pfd(s). It shall apply the + format of Data type ApplicationId. + required: true + schema: + type: string + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + A representation of PFDs for the request application identified by the application + identifier is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the corresponding PFDs of the specified application identifier + operationId: DeleteIndividualPFDData + tags: + - Individual PFD Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:pfds:modify + parameters: + - name: appId + in: path + description: > + Indicate the application identifier for the request pfd(s). It shall apply the + format of Data type ApplicationId. + required: true + schema: + type: string + responses: + '204': + description: > + Successful case. The Individual PFD Data resource related to the application + identifier was deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or update the corresponding PFDs for the specified application identifier + operationId: CreateOrReplaceIndividualPFDData + tags: + - Individual PFD Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:pfds:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + parameters: + - name: appId + in: path + description: > + Indicate the application identifier for the request pfd(s). It shall apply the format + of Data type ApplicationId. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual PFD Data resource related to the application-identifier + is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + headers: + Location: + description: > + 'Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/pfds/{appId}' + required: true + schema: + type: string + '200': + description: > + Successful case. The upgrade of an Individual PFD Data resource related to the + application identifier is confirmed and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForAppExt' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/influenceData: + get: + summary: Retrieve Traffic Influence Data + operationId: ReadInfluenceData + tags: + - Influence Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:read + parameters: + - name: influence-Ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: internal-Group-Ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: supp-feat + in: query + required: false + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The Traffic Influence Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/influenceData/{influenceId}: + put: + summary: Create or update an individual Influence Data resource + operationId: CreateOrReplaceIndividualInfluenceData + tags: + - Individual Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + parameters: + - name: influenceId + in: path + description: > + The Identifier of an Individual Influence Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual Traffic Influence Data resource is confirmed + and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + headers: + Location: + description: > + 'Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/influenceData/{influenceId}' + required: true + schema: + type: string + '200': + description: > + The update of an Individual Traffic Influence Data resource is confirmed and a + response body containing Traffic Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Influence Data resource + operationId: UpdateIndividualInfluenceData + tags: + - Individual Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/TrafficInfluDataPatch' + parameters: + - name: influenceId + in: path + description: > + The Identifier of an Individual Influence Data to be updated. It shall apply + the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: > + The update of an Individual Traffic Influence Data resource is confirmed and + a response body containing Traffic Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Influence Data resource + operationId: DeleteIndividualInfluenceData + tags: + - Individual Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:modify + parameters: + - name: influenceId + in: path + description: > + The Identifier of an Individual Influence Data to be deleted. It shall apply + the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Influence Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/influenceData/subs-to-notify: + post: + summary: Create a new Individual Influence Data Subscription resource + operationId: CreateIndividualInfluenceDataSubscription + tags: + - Influence Data Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + responses: + '201': + description: The subscription was created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + trafficInfluenceDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + oneOf: + - $ref: '#/components/schemas/TrafficInfluData' + - $ref: '#/components/schemas/TrafficInfluDataNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read Influence Data Subscriptions + operationId: ReadInfluenceDataSubscriptions + tags: + - Influence Data Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:read + parameters: + - name: dnn + in: query + description: Identifies a DNN. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: snssai + in: query + description: Identifies a slice. + required: false + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: internal-Group-Id + in: query + description: Identifies a group of users. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: supi + in: query + description: Identifies a user. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + responses: + '200': + description: > + The subscription information as request in the request URI query parameter(s) + are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluSub' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/influenceData/subs-to-notify/{subscriptionId}: + get: + summary: Get an existing individual Influence Data Subscription resource + operationId: ReadIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:read + parameters: + - name: subscriptionId + in: path + description: > + String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription information is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Modify an existing individual Influence Data Subscription resource + operationId: ReplaceIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:modify + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + parameters: + - name: subscriptionId + in: path + description: > + String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Influence Data Subscription resource + operationId: DeleteIndividualInfluenceDataSubscription + tags: + - Individual Influence Data Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:influence-data:subscriptions:modify + parameters: + - name: subscriptionId + in: path + description: > + String identifying a subscription to the Individual Influence Data Subscription + required: true + schema: + type: string + responses: + '204': + description: The subscription was terminated successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/bdtPolicyData: + get: + summary: Retrieve applied BDT Policy Data + operationId: ReadBdtPolicyData + tags: + - BdtPolicy Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:bdt-policy-data:read + parameters: + - name: bdt-policy-ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: internal-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + responses: + '200': + description: The applied BDT policy Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BdtPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/bdtPolicyData/{bdtPolicyId}: + put: + summary: Create an individual applied BDT Policy Data resource + operationId: CreateIndividualAppliedBdtPolicyData + tags: + - Individual Applied BDT Policy Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:bdt-policy-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + parameters: + - name: bdtPolicyId + in: path + description: > + The Identifier of an Individual Applied BDT Policy Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual Applied BDT Policy Data resource is confirmed and a + representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/bdtPolicyData/{bdtPolicyId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Applied BDT Policy Data resource + operationId: UpdateIndividualAppliedBdtPolicyData + tags: + - Individual Applied BDT Policy Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:bdt-policy-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/BdtPolicyDataPatch' + parameters: + - name: bdtPolicyId + in: path + description: > + The Identifier of an Individual Applied BDT Policy Data to be updated. It shall + apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: > + The update of an Individual Applied BDT Policy Data resource is confirmed and + a response body containing Applied BDT Policy Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicyData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Applied BDT Policy Data resource + operationId: DeleteIndividualAppliedBdtPolicyData + tags: + - Individual Applied BDT Policy Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:bdt-policy-data:modify + parameters: + - name: bdtPolicyId + in: path + description: > + The Identifier of an Individual Applied BDT Policy Data to be deleted. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Applied BDT Policy Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/iptvConfigData: + get: + summary: Retrieve IPTV configuration Data + operationId: ReadIPTVCongifurationData + tags: + - IPTV Configuration Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:iptv-config-data:read + parameters: + - name: config-ids + in: query + description: Each element identifies a configuration. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: inter-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + responses: + '200': + description: The IPTV configuration data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IptvConfigData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/iptvConfigData/{configurationId}: + put: + summary: Create or update an individual IPTV configuration resource + operationId: CreateOrReplaceIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:iptv-config-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + parameters: + - name: configurationId + in: path + description: > + The Identifier of an Individual IPTV Configuration Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual IPTV Configuration Data resource is confirmed and a + representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: The update of an Individual IPTV configuration resource. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Partial update an individual IPTV configuration resource + operationId: PartialReplaceIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:iptv-config-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29522_IPTVConfiguration.yaml#/components/schemas/IptvConfigDataPatch' + parameters: + - name: configurationId + in: path + description: > + The Identifier of an Individual IPTV Configuration Data to be updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: The update of an Individual IPTV configuration resource. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual IPTV configuration resource + operationId: DeleteIndividualIPTVConfigurationData + tags: + - Individual IPTV Configuration Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:iptv-config-data:modify + parameters: + - name: configurationId + in: path + description: > + The Identifier of an Individual IPTV Configuration to be deleted. It shall + apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The resource was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/serviceParamData: + get: + summary: Retrieve Service Parameter Data + operationId: ReadServiceParameterData + tags: + - Service Parameter Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:service-param-data:read + parameters: + - name: service-param-ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: internal-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: ue-ipv4s + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + - name: ue-ipv6s + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + - name: ue-macs + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + - name: any-ue + in: query + description: Indicates whether the request is for any UE. + required: false + schema: + type: boolean + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The Service Parameter Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceParameterData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/serviceParamData/{serviceParamId}: + put: + summary: Create or update an individual Service Parameter Data resource + operationId: CreateOrReplaceServiceParameterData + tags: + - Individual Service Parameter Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:service-param-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + parameters: + - name: serviceParamId + in: path + description: > + The Identifier of an Individual Service Parameter Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual Service Parameter Data resource is confirmed + and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + headers: + Location: + description: > + 'Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/serviceParamData/{serviceParamId}' + required: true + schema: + type: string + '200': + description: > + The update of an Individual Service Parameter Data resource is confirmed and + a response body containing Service Parameter Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual Service Parameter Data resource + operationId: UpdateIndividualServiceParameterData + tags: + - Individual Service Parameter Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:service-parameter-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/ServiceParameterDataPatch' + parameters: + - name: serviceParamId + in: path + description: > + The Identifier of an Individual Service Parameter Data to be updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: > + The update of an Individual Service Parameter Data resource is confirmed + and a response body containing Service Parameter Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual Service Parameter Data resource + operationId: DeleteIndividualServiceParameterData + tags: + - Individual Service Parameter Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:service-parameter-data:modify + parameters: + - name: serviceParamId + in: path + description: > + The Identifier of an Individual Service Parameter Data to be deleted. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Service Parameter Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/am-influence-data: + get: + summary: Retrieve AM Influence Data + operationId: ReadAmInfluenceData + tags: + - AM Influence Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:am-influence-data:read + parameters: + - name: am-influence-ids + in: query + description: Each element identifies a service. + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: dnns + in: query + description: Each element identifies a DNN. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + - name: snssais + in: query + description: Each element identifies a slice. + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + - name: dnn-snssai-infos + in: query + description: Each element identifies a combination of (DNN, S-NSSAI). + required: false + content: + application/json: + schema: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + minItems: 1 + - name: internal-group-ids + in: query + description: Each element identifies a group of users. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + - name: supis + in: query + description: Each element identifies the user. + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + - name: any-ue + in: query + description: Indicates whether the request is for any UE. + required: false + schema: + type: boolean + - name: supp-feat + in: query + required: false + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The AM Influence Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmInfluData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/am-influence-data/{amInfluenceId}: + put: + summary: Create or update an individual AM Influence Data resource + operationId: CreateOrReplaceIndividualAmInfluenceData + tags: + - Individual AM Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:am-influence-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluData' + parameters: + - name: amInfluenceId + in: path + description: > + The Identifier of an Individual AM Influence Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual AM Influence Data resource is confirmed and + a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluData' + headers: + Location: + description: > + 'Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/am-influence-data/{amInfluenceId}' + required: true + schema: + type: string + '200': + description: > + The update of an Individual AM Influence Data resource is confirmed and a response + body containing AM Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify part of the properties of an individual AM Influence Data resource + operationId: UpdateIndividualAmInfluenceData + tags: + - Individual AM Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:am-influence-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AmInfluDataPatch' + parameters: + - name: amInfluenceId + in: path + description: > + The Identifier of an Individual AM Influence Data to be updated. It shall + apply the format of Data type string. + required: true + schema: + type: string + responses: + '200': + description: > + The update of an Individual AM Influence Data resource is confirmed and a + response body containing AM Influence Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual AM Influence Data resource + operationId: DeleteIndividualAmInfluenceData + tags: + - Individual AM Influence Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:am-influence-data:modify + parameters: + - name: amInfluenceId + in: path + description: > + The Identifier of an Individual AM Influence Data to be deleted. It shall + apply the format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual AM Influence Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of application data changes + operationId: CreateIndividualApplicationDataSubscription + tags: + - ApplicationDataSubscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + responses: + '201': + description: > + Upon success, a response body containing a representation of each + Individual subscription resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + applicationDataChangeNotif: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApplicationDataChangeNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read Application Data change Subscriptions + operationId: ReadApplicationDataChangeSubscriptions + tags: + - ApplicationDataSubscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:read + parameters: + - name: data-filter + in: query + description: The data filter for the query. + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/DataFilter' + responses: + '200': + description: > + The subscription information as request in the request URI query parameter(s) + are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApplicationDataSubs' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/subs-to-notify/{subsId}: + parameters: + - name: subsId + in: path + required: true + schema: + type: string + put: + summary: Modify a subscription to receive notification of application data changes + operationId: ReplaceIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:modify + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + responses: + '200': + description: The individual subscription resource was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + '204': + description: > + The individual subscription resource was updated successfully and no + additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the individual Application Data subscription + operationId: DeleteIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:modify + responses: + '204': + description: Upon success, an empty response body shall be returned. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Get an existing individual Application Data Subscription resource + operationId: ReadIndividualApplicationDataSubscription + tags: + - IndividualApplicationDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:subs-to-notify:read + parameters: + - name: subsId + in: path + description: > + String identifying a subscription to the Individual Application Data Subscription + required: true + schema: + type: string + responses: + '200': + description: The subscription information is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationDataSubs' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /application-data/eas-deploy-data: + get: + summary: Retrieve EAS Deployment Information Data + operationId: ReadEasDeployData + tags: + - EAS Deployment Data (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:eas-deploy-data:read + parameters: + - name: dnn + in: query + description: Identifies a DNN. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: snssai + in: query + description: Identifies an S-NSSAI. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: internal-group-id + in: query + description: Identifies a group of users. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + - name: appId + in: query + description: Identifies an application. + required: false + schema: + type: string + responses: + '200': + description: The EAS Deployment Data stored in the UDR are returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + minItems: 1 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /application-data/eas-deploy-data/{easDeployInfoId}: + get: + summary: Retrieve an individual EAS Deployment Data resource + operationId: ReadIndividualEasDeployData + tags: + - Individual EAS Deployment Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:eas-deploy-data:read + parameters: + - name: easDeployInfoId + description: > + String identifying an Individual EAS Deployment Information Data resource. + in: path + required: true + schema: + type: string + responses: + '200': + description: > + The EAS Deployment Data stored in the UDR for an Individual EAS Deployment + Information Data resource is returned. + content: + application/json: + schema: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or update an individual EAS Deployment Data resource + operationId: CreateOrReplaceIndividualEasDeployData + tags: + - Individual EAS Deployment Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:eas-deploy-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + parameters: + - name: easDeployInfoId + in: path + description: > + The Identifier of an Individual EAS Deployment Data to be created or updated. + It shall apply the format of Data type string. + required: true + schema: + type: string + responses: + '201': + description: > + The creation of an Individual EAS Deployment Data resource is confirmed and a + representation of that resource is returned. + content: + application/json: + schema: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nudr-dr//application-data/eas-deploy-data/{easDeployInfoId} + required: true + schema: + type: string + '200': + description: > + The update of an Individual EAS Deployment Data resource is confirmed and a response + body containing EAS Deployment Data shall be returned. + content: + application/json: + schema: + $ref: 'TS29591_Nnef_EASDeployment.yaml#/components/schemas/EasDeployInfoData' + '204': + description: No content + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an individual EAS Deployment Data resource + operationId: DeleteIndividualEasDeployData + tags: + - Individual EasDeployment Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:application-data + - nudr-dr:application-data:eas-deploy-data:modify + parameters: + - name: easDeployInfoId + in: path + description: > + The Identifier of an Individual EAS Deployment Data to be updated. It shall apply the + format of Data type string. + required: true + schema: + type: string + responses: + '204': + description: The Individual Influence Data was deleted successfully. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + schemas: + + TrafficInfluData: + description: Represents the Traffic Influence Data. + type: object + properties: + upPathChgNotifCorreId: + type: string + description: > + Contains the Notification Correlation Id allocated by the NEF for the UP + path change notification. + appReloInd: + type: boolean + description: > + Identifies whether an application can be relocated once a location of the + application has been selected. + afAppId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: > + Identifies Ethernet packet filters. Either "trafficFilters" or + "ethTrafficFilters" shall be included if applicable. + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: > + Identifies IP packet filters. Either "trafficFilters" or "ethTrafficFilters" + shall be included if applicable. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + traffCorreInd: + type: boolean + validStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + description: Identifies the temporal validities for the N6 traffic routing requirement. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + upPathChgNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + headers: + type: array + items: + type: string + minItems: 1 + subscribedEvents: + type: array + items: + $ref: 'TS29522_TrafficInfluence.yaml#/components/schemas/SubscribedEvent' + minItems: 1 + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + afAckInd: + type: boolean + addrPreserInd: + type: boolean + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + simConnInd: + type: boolean + description: > + Indicates whether simultaneous connectivity should be temporarily + maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + allOf: + - oneOf: + - required: [afAppId] + - required: [trafficFilters] + - required: [ethTrafficFilters] + - oneOf: + - required: [supi] + - required: [interGroupId] + + TrafficInfluDataPatch: + description: Represents the Traffic Influence Data to be updated in the UDR. + type: object + properties: + upPathChgNotifCorreId: + type: string + description: > + Contains the Notification Correlation Id allocated by the NEF for the + UP path change notification. + appReloInd: + type: boolean + description: > + Identifies whether an application can be relocated once a location of the application + has been selected. + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: > + Identifies Ethernet packet filters. Either "trafficFilters" or "ethTrafficFilters" + shall be included if applicable. + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: > + Identifies IP packet filters. Either "trafficFilters" or "ethTrafficFilters" + shall be included if applicable. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + traffCorreInd: + type: boolean + validStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + description: Identifies the temporal validities for the N6 traffic routing requirement. + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + upPathChgNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + headers: + type: array + items: + type: string + minItems: 1 + afAckInd: + type: boolean + addrPreserInd: + type: boolean + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + simConnInd: + type: boolean + description: > + Indicates whether simultaneous connectivity should be temporarily maintained + for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + + TrafficInfluSub: + description: Represents traffic influence subscription data. + type: object + properties: + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Each element identifies a DNN. + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: Each element identifies a slice. + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + description: Each element identifies a group of users. + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + description: Each element identifies the user. + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - notificationUri + oneOf: + - required: [dnns] + - required: [snssais] + - required: [internalGroupIds] + - required: [supis] + + TrafficInfluDataNotif: + description: Represents traffic influence data for notification. + type: object + properties: + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + trafficInfluData: + $ref: '#/components/schemas/TrafficInfluData' + required: + - resUri + + PfdDataForAppExt: + description: Represents the PFDs and related data for the application. + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + pfds: + type: array + items: + $ref: 'TS29551_Nnef_PFDmanagement.yaml#/components/schemas/PfdContent' + minItems: 1 + cachingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + allowedDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - applicationId + - pfds + + BdtPolicyData: + description: Represents applied BDT policy data. + type: object + properties: + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - bdtRefId + + BdtPolicyDataPatch: + description: > + Represents modification instructions to be performed on the applied BDT policy data. + type: object + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + required: + - bdtRefId + + IptvConfigData: + description: Represents IPTV configuration data information. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + interGroupId: + description: Identifies a group of users. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + afAppId: + type: string + multiAccCtrls: + type: object + additionalProperties: + $ref: 'TS29522_IPTVConfiguration.yaml#/components/schemas/MulticastAccessControl' + minProperties: 1 + description: > + Identifies a list of multicast address access control information. Any string + value can be used as a key of the map. + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - afAppId + - multiAccCtrls + oneOf: + - required: [interGroupId] + - required: [supi] + + ServiceParameterData: + description: Represents the service parameter data. + type: object + properties: + appId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + ueIpv4: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + anyUeInd: + type: boolean + paramOverPc5: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverPc5' + paramOverUu: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverUu' + paramForProSeDd: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeDd' + paramForProSeDc: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeDc' + paramForProSeU2NRelUe: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeU2NRelUe' + paramForProSeRemUe: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeRemUe' + urspGuidance: + type: array + items: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/UrspRuleRequest' + minItems: 1 + description: Contains the service parameter used to guide the URSP. + deliveryEvents: + type: array + items: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/Event' + minItems: 1 + description: Contains the outcome of the UE Policy Delivery. + policDelivNotifCorreId: + type: string + description: > + Contains the Notification Correlation Id allocated by the NEF for the notification + of UE Policy delivery outcome. + policDelivNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + headers: + type: array + items: + type: string + minItems: 1 + resetIds: + type: array + items: + type: string + minItems: 1 + + ServiceParameterDataPatch: + description: Represents the service parameter data that can be updated. + type: object + properties: + paramOverPc5: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverPc5' + paramOverUu: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParameterOverUu' + paramForProSeDd: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeDd' + paramForProSeDc: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeDc' + paramForProSeU2NRelUe: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeU2NRelUe' + paramForProSeRemUe: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/ParamForProSeRemUe' + urspInfluence: + type: array + items: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/UrspRuleRequest' + minItems: 1 + description: Contains the service parameter used to influence the URSP. + deliveryEvents: + type: array + items: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/Event' + minItems: 1 + description: Contains the outcome of the UE Policy Delivery. + policDelivNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + AmInfluData: + description: Represents the AM Influence Data. + type: object + properties: + appIds: + type: array + items: + type: string + minItems: 1 + description: Identifies one or more applications. + dnnSnssaiInfos: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + minItems: 1 + description: Identifies one or more DNN, S-NSSAI combinations. + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + anyUeInd: + type: boolean + description: Indicates whether the data is applicable for any UE. + policyDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + evSubs: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/AmInfluEvent' + minItems: 1 + description: List of AM related events for which a subscription is required. + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorrId: + type: string + description: Notification correlation identifier. + headers: + type: array + description: Contains the headers provisioned by the NEF. + items: + type: string + minItems: 1 + thruReq: + type: boolean + description: Indicates whether high throughput is desired for the indicated UE traffic. + covReq: + type: array + items: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/ServiceAreaCoverageInfo' + minItems: 1 + description: Indicates the service area coverage requirement. + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + resetIds: + type: array + items: + type: string + minItems: 1 + allOf: + - anyOf: + - required: [thruReq] + - required: [covReq] + - oneOf: + - required: [supi] + - required: [interGroupId] + - required: [anyUeInd] + + AmInfluDataPatch: + description: Represents the AM Influence Data that can be updated. + type: object + properties: + appIds: + type: array + items: + type: string + minItems: 1 + description: Identifies one or more applications. + nullable: true + dnnSnssaiInfos: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + minItems: 1 + description: Identifies one or more DNN, S-NSSAI combinations. + nullable: true + evSubs: + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/AmInfluEvent' + minItems: 1 + description: List of AM related events for which a subscription is required. + nullable: true + headers: + type: array + description: Contains the headers provisioned by the NEF. + items: + type: string + minItems: 1 + thruReq: + type: boolean + description: Indicates whether high throughput is desired for the indicated UE traffic. + nullable: true + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriRm' + notifCorrId: + type: string + description: Notification correlation identifier. + nullable: true + covReq: + type: array + items: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/ServiceAreaCoverageInfo' + minItems: 1 + description: Indicates the service area coverage requirement. + nullable: true + + ApplicationDataSubs: + description: Identifies a subscription to application data change notification. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + dataFilters: + type: array + items: + $ref: '#/components/schemas/DataFilter' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + immRep: + type: boolean + description: Immediate reporting indication. + amInfluEntries: + type: array + items: + $ref: '#/components/schemas/AmInfluData' + minItems: 1 + description: The AM Influence Data entries stored in the UDR that match a subscription. + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - notificationUri + + ApplicationDataChangeNotif: + description: Contains changed application data for which notification was requested. + type: object + properties: + iptvConfigData: + $ref: '#/components/schemas/IptvConfigData' + pfdData: + $ref: 'TS29551_Nnef_PFDmanagement.yaml#/components/schemas/PfdChangeNotification' + bdtPolicyData: + $ref: '#/components/schemas/BdtPolicyData' + resUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + serParamData: + $ref: '#/components/schemas/ServiceParameterData' + amInfluData: + $ref: '#/components/schemas/AmInfluData' + required: + - resUri + + DataFilter: + description: Identifies a data filter. + type: object + properties: + dataInd: + $ref: '#/components/schemas/DataInd' + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + internalGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + ueIpv4s: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ueIpv6s: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + ueMacs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + anyUeInd: + type: boolean + description: Indicates the request is for any UE. + dnnSnssaiInfos: + description: Indicates the request is for any DNN and S-NSSAI combination present in the array. + type: array + items: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + minItems: 1 + required: + - dataInd + + DataInd: + anyOf: + - type: string + enum: + - PFD + - IPTV + - BDT + - SVC_PARAM + - AM + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are + - PFD + - IPTV + - BDT + - SVC_PARAM + - AM diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Exposure_Data.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Exposure_Data.yaml new file mode 100644 index 000000000..9f15e4050 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Exposure_Data.yaml @@ -0,0 +1,831 @@ +openapi: 3.0.0 +info: + version: '-' + title: Unified Data Repository Service API file for structured data for exposure + description: | + The API version is defined in 3GPP TS 29.504 + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.519 V17.7.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, + Application Data and Structured Data for Exposure. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /exposure-data/{ueId}/access-and-mobility-data: + put: + summary: Creates and updates the access and mobility exposure data for a UE + operationId: CreateOrReplaceAccessAndMobilityData + tags: + - AccessAndMobilityData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:access-and-mobility-data:create + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + responses: + '201': + description: > + Successful case. The resource has been successfully created and a response + body containing a representation of the access and mobility data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: > + Successful case. The resource has been successfully updated and a response + body containing a representation of the access and mobility data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + '204': + description: Successful case. The resource has been successfully updated and no additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieves the access and mobility exposure data for a UE + operationId: QueryAccessAndMobilityData + tags: + - AccessAndMobilityData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:access-and-mobility-data:read + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The response body contains the access and mobility data + content: + application/json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the access and mobility exposure data for a UE + operationId: DeleteAccessAndMobilityData + tags: + - AccessAndMobilityData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:access-and-mobility-data:modify + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Upon success, an empty response body shall be returned + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Updates the access and mobility exposure data for a UE + operationId: UpdateAccessAndMobilityData + tags: + - AccessAndMobilityData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:access-and-mobility-data:modify + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AccessAndMobilityData' + responses: + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/{ueId}/session-management-data/{pduSessionId}: + put: + summary: Creates and updates the session management data for a UE and for an individual PDU session + operationId: CreateOrReplaceSessionManagementData + tags: + - PduSessionManagementData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:session-management-data:create + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + responses: + '201': + description: > + Successful case. The resource has been successfully created and a response + body containing a representation of the session management data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: > + Successful case. The resource has been successfully updated and a response body + containing a representation of the session management data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Retrieves the session management data for a UE and for an individual PDU session + operationId: QuerySessionManagementData + tags: + - PduSessionManagementData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:session-management-data:read + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + - name: ipv4-addr + in: query + description: IPv4 Address of the UE + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ipv6-prefix + in: query + description: IPv6 Address Prefix of the UE + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: dnn + in: query + description: DNN of the UE + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: The response body contains the session management data + content: + application/json: + schema: + $ref: '#/components/schemas/PduSessionManagementData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the session management data for a UE and for an individual PDU session + operationId: DeleteSessionManagementData + tags: + - PduSessionManagementData + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:session-management-data:modify + parameters: + - name: ueId + in: path + description: UE id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: pduSessionId + in: path + description: PDU session id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + responses: + '204': + description: Upon success, an empty response body shall be returned + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of exposure data changes + operationId: CreateIndividualExposureDataSubscription + tags: + - ExposureDataSubscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:subs-to-notify:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + exposureDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ExposureDataChangeNotification' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /exposure-data/subs-to-notify/{subId}: + put: + summary: updates a subscription to receive notifications of exposure data changes + operationId: ReplaceIndividualExposureDataSubscription + tags: + - IndividualExposureDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:subs-to-notify:modify + parameters: + - name: subId + in: path + description: Subscription id + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + responses: + '200': + description: > + Resource was successfully modified and a body with the modified subscription + to notifications about exposure data is returned.. + content: + application/json: + schema: + $ref: '#/components/schemas/ExposureDataSubscription' + '204': + description: The individual subscription resource was successfully modified. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes the individual Exposure Data subscription + operationId: DeleteIndividualExposureDataSubscription + tags: + - IndividualExposureDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:exposure-data + - nudr-dr:exposure-data:subs-to-notify:modify + parameters: + - name: subId + in: path + description: Subscription id + required: true + schema: + type: string + responses: + '204': + description: Resource was successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + schemas: + AccessAndMobilityData: + description: Represents Access and Mobility data for a UE. + type: object + properties: + location: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + locationTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + timeZoneTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + regStates: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/RmInfo' + regStatesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + connStates: + type: array + items: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo' + connStatesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reachabilityStatus: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability' + reachabilityStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + smsOverNasStatus: + $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/SmsSupport' + smsOverNasStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + roamingStatus: + type: boolean + description: > + True The serving PLMN of the UE is different from the HPLMN of the UE; False + The serving PLMN of the UE is the HPLMN of the UE. + roamingStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + currentPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + currentPlmnTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ratType: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + ratTypesTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + PduSessionManagementData: + description: Represents Session management data for a UE and a PDU session. + type: object + properties: + pduSessionStatus: + $ref: '#/components/schemas/PduSessionStatus' + pduSessionStatusTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + dnaiTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + n6TrafficRoutingInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + n6TrafficRoutingInfoTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefix: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: UE IPv6 prefix. + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + pduSessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + ipAddrTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pduSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + ExposureDataSubscription: + description: Represents a Subscription to Notifications about Exposure Data. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - notificationUri + - monitoredResourceUris + ExposureDataChangeNotification: + description: Represents changed exposure data for one UE for which Notification was requested. + type: object + properties: + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + accessAndMobilityData: + $ref: '#/components/schemas/AccessAndMobilityData' + pduSessionManagementData: + type: array + items: + $ref: '#/components/schemas/PduSessionManagementData' + minItems: 1 + delResources: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + PduSessionStatus: + anyOf: + - type: string + enum: + - "ACTIVE" + - "RELEASED" + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - "ACTIVE" + - "RELEASED" diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Policy_Data.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Policy_Data.yaml new file mode 100644 index 000000000..606db739e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29519_Policy_Data.yaml @@ -0,0 +1,2414 @@ +openapi: 3.0.0 + +info: + version: '-' + title: Unified Data Repository Service API file for policy data + description: | + The API version is defined in 3GPP TS 29.504 + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.519 V17.8.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, + Application Data and Structured Data for Exposure. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.519/' + +paths: + /policy-data/ues/{ueId}: + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + get: + summary: Retrieve the policy data for a subscriber + operationId: ReadPolicyData + tags: + - PolicyDataForIndividualUe (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:read + parameters: + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: data-subset-names + in: query + style: form + explode: false + description: List of policy data subset names + required: false + schema: + type: array + items: + $ref: '#/components/schemas/PolicyDataSubset' + minItems: 2 + responses: + '200': + description: Upon success, a response body containing policy data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataForIndividualUe' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/am-data: + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + get: + summary: Retrieves the access and mobility policy data for a subscriber + operationId: ReadAccessAndMobilityPolicyData + tags: + - AccessAndMobilityPolicyData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:am-data:read + responses: + '200': + description: > + Upon success, a response body containing access and mobility policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/ue-policy-set: + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + get: + summary: Retrieves the UE policy set data for a subscriber + operationId: ReadUEPolicySet + tags: + - UEPolicySet (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:ue-policy-set:read + parameters: + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or modify the UE policy set data for a subscriber + operationId: CreateOrReplaceUEPolicySet + tags: + - UEPolicySet (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:ue-policy-set:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + responses: + '201': + description: > + Successful case. The resource has been successfully created and a response body + containing a representation of the created UEPolicySet resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '200': + description: > + Successful case. The resource has been successfully created and a response body + containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '204': + description: > + Successful case. The resource has been successfully updated and no additional content + is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify the UE policy set data for a subscriber + operationId: UpdateUEPolicySet + tags: + - UEPolicySet (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:ue-policy-set:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/UePolicySetPatch' + responses: + '204': + description: > + Successful case. The resource has been successfully updated and no additional content is + to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/sm-data: + get: + summary: Retrieves the session management policy data for a subscriber + operationId: ReadSessionManagementPolicyData + tags: + - SessionManagementPolicyData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:read + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: snssai + in: query + required: false + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: dnn + in: query + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing SmPolicyData shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify the session management policy data for a subscriber + operationId: UpdateSessionManagementPolicyData + tags: + - SessionManagementPolicyData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:modify + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SmPolicyDataPatch' + responses: + '204': + description: > + Successful case. The resource has been successfully updated and no + additional content is to be sent in the response message. + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmPolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/sm-data/{usageMonId}: + get: + summary: Retrieve a usage monitoring resource + operationId: ReadUsageMonitoringInformation + tags: + - UsageMonitoringInformation (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:read + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Successful case. The usage monitoring data is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + '204': + description: The resource was found but no usage monitoring data is available. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create a usage monitoring resource + operationId: CreateUsageMonitoringResource + tags: + - UsageMonitoringInformation (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:create + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + responses: + '201': + description: > + Successful case. The resource has been successfully created and a response body is + returned containing a representation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/UsageMonData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete a usage monitoring resource + operationId: DeleteUsageMonitoringInformation + tags: + - UsageMonitoringInformation (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:sm-data:modify + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: usageMonId + in: path + required: true + schema: + type: string + responses: + '204': + description: Successful case. The resource has been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/sponsor-connectivity-data/{sponsorId}: + parameters: + - name: sponsorId + in: path + required: true + schema: + type: string + get: + summary: Retrieves the sponsored connectivity information for a given sponsorId + operationId: ReadSponsorConnectivityData + tags: + - SponsorConnectivityData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:sponsor-connectivity-data:read + responses: + '200': + description: > + Upon success, a response body containing Sponsor Connectivity Data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SponsorConnectivityData' + '204': + description: The resource was found but no Sponsor Connectivity Data is available. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/bdt-data: + get: + summary: Retrieves the BDT data collection + operationId: ReadBdtData + tags: + - BdtData (Store) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:read + parameters: + - name: bdt-ref-ids + in: query + description: List of the BDT reference identifiers. + required: false + schema: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + minItems: 1 + style: form + explode: false + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing the BDT data shall be returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/BdtData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/bdt-data/{bdtReferenceId}: + parameters: + - name: bdtReferenceId + in: path + required: true + schema: + type: string + get: + summary: Retrieves the BDT data information associated with a BDT reference Id + operationId: ReadIndividualBdtData + tags: + - IndividualBdtData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:read + parameters: + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Upon success, a response body containing the BDT data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Creates an BDT data resource associated with an BDT reference Id + operationId: CreateIndividualBdtData + tags: + - IndividualBdtData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + responses: + '201': + description: Successful case. The resource has been successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modifies an BDT data resource associated with an BDT reference Id + operationId: UpdateIndividualBdtData + tags: + - IndividualBdtData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/BdtDataPatch' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/BdtData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional content + is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes an BDT data resource associated with an BDT reference Id + operationId: DeleteIndividualBdtData + tags: + - IndividualBdtData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:bdt-data:modify + responses: + '204': + description: Successful case. The resource has been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/subs-to-notify: + post: + summary: Create a subscription to receive notification of policy data changes + operationId: CreateIndividualPolicyDataSubscription + tags: + - PolicyDataSubscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data:subs-to-notify + - nudr-dr:policy-data:subs-to-notify:create + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + responses: + '201': + description: > + Upon success, a response body containing a representation of each Individual + subscription resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + policyDataChangeNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyDataChangeNotification' + minItems: 1 + responses: + '204': + description: No Content, Notification was successful + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/subs-to-notify/{subsId}: + parameters: + - name: subsId + in: path + required: true + schema: + type: string + put: + summary: Modify a subscription to receive notification of policy data changes + operationId: ReplaceIndividualPolicyDataSubscription + tags: + - IndividualPolicyDataSubscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:subs-to-notify:modify + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + responses: + '200': + description: The individual subscription resource was updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyDataSubscription' + '204': + description: > + The individual subscription resource was updated successfully and no + additional content is to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete the individual Policy Data subscription + operationId: DeleteIndividualPolicyDataSubscription + tags: + - IndividualPolicyDataSubscription (Document) + responses: + '204': + description: Upon success, an empty response body shall be returned. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/ues/{ueId}/operator-specific-data: + get: + summary: Retrieve the operator specific policy data of an UE + operationId: ReadOperatorSpecificData + tags: + - OperatorSpecificData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:operator-specific-data:read + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + - name: fields + in: query + description: attributes to be retrieved + required: false + schema: + type: array + items: + type: string + minItems: 1 + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the operator specific policy data of a UE + operationId: UpdateOperatorSpecificData + tags: + - OperatorSpecificData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:operator-specific-data:modify + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + required: true + responses: + '204': + description: No content. Response to successful modification. + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Create or modify the operator specific policy data of a UE + operationId: ReplaceOperatorSpecificData + tags: + - OperatorSpecificData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:operator-specific-data:create + parameters: + - name: ueId + in: path + description: UE Id + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + '201': + description: > + Successful case. When the feature OSDResource_Create_Delete is supported + and the resource has been successfully created, a response body containing a + representation of the created OperatorSpecificData resource shall be returned. + content: + application/json: + schema: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '204': + description: The resource has been successfully updated. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: When the feature OSDResource_Create_Delete is supported, delete OperatorSpecificData resource + operationId: DeleteOperatorSpecificData + tags: + - OperatorSpecificData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:ues:operator-specific-data:modify + parameters: + - name: ueId + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + responses: + '204': + description: Successful case. The resource has been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/plmns/{plmnId}/ue-policy-set: + parameters: + - name: plmnId + in: path + required: true + schema: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/VarPlmnId' + get: + summary: Retrieve the UE policy set data for an H-PLMN + operationId: ReadPlmnUePolicySet + tags: + - PlmnUePolicySet (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:plmns:ue-policy-set:read + responses: + '200': + description: Upon success, a response body containing UE policies shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/UePolicySet' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '412': + $ref: 'TS29571_CommonData.yaml#/components/responses/412' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/slice-control-data/{snssai}: + parameters: + - name: snssai + in: path + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + get: + summary: Retrieves a network Slice specific policy control data resource + operationId: ReadSlicePolicyControlData + tags: + - SlicePolicyControlData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:slice-control-data:read + parameters: + - name: supp-feat + in: query + description: Supported Features + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + Successful case. The network slice specific policy control data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SlicePolicyData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Modify a network Slice specific policy control data resource + operationId: UpdateSlicePolicyControlData + tags: + - SlicePolicyControlData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:slice-control-data:modify + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/SlicePolicyDataPatch' + responses: + '200': + description: > + The resource has been successfully updated and a response body containing network + slice specific policy control data shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SlicePolicyData' + '204': + description: > + The resource has been successfully updated and no additional content is + to be sent in the response message. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /policy-data/mbs-session-pol-data/{polSessionId}: + parameters: + - name: polSessionId + description: > + Represents the identifier of the MBS Session Policy Control Data. + in: path + required: true + schema: + $ref: '#/components/schemas/MbsSessPolDataId' + + get: + summary: Retrieve MBS Session Policy Control Data for an MBS Session. + operationId: GetMBSSessPolCtrlData + tags: + - MBSSessionPolicyControlData (Document) + security: + - {} + - oAuth2ClientCredentials: + - nudr-dr + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - oAuth2ClientCredentials: + - nudr-dr + - nudr-dr:policy-data + - nudr-dr:policy-data:mbs-session-pol-data:read + responses: + '200': + description: > + OK. The requested MBS Session Policy Control Data is successfully returned. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessPolCtrlData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + schemas: + + PolicyDataForIndividualUe: + description: Contains policy data for a given subscriber. + type: object + properties: + uePolicyDataSet: + $ref: '#/components/schemas/UePolicySet' + smPolicyDataSet: + $ref: '#/components/schemas/SmPolicyData' + amPolicyDataSet: + $ref: '#/components/schemas/AmPolicyData' + umData: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonData' + minProperties: 1 + description: > + Contains UM policies. The value of the limit identifier is used as the key of the map. + operatorSpecificDataSet: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + minProperties: 1 + description: > + Contains Operator Specific Data resource data. The key of the map is operator + specific data element name and the value is the operator specific data of the UE. + + AmPolicyData: + description: Contains the AM policy data for a given subscriber. + type: object + properties: + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains Presence reporting area information. The praId attribute within the + PresenceInfo data type is the key of the map. + subscCats: + type: array + items: + type: string + minItems: 1 + + UePolicySet: + description: Contains the UE policy data for a given subscriber. + type: object + properties: + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains Presence reporting area information. The praId attribute within the + PresenceInfo data type is the key of the map. + subscCats: + type: array + items: + type: string + minItems: 1 + uePolicySections: + type: object + additionalProperties: + $ref: '#/components/schemas/UePolicySection' + minProperties: 1 + description: > + Contains the UE Policy Sections. The UE Policy Section Identifier is used as + the key of the map. + upsis: + type: array + items: + type: string + minItems: 1 + allowedRouteSelDescs: + type: object + additionalProperties: + $ref: '#/components/schemas/PlmnRouteSelectionDescriptor' + minProperties: 1 + description: > + Contains allowed route selection descriptors per serving PLMN for a UE. + The serving PLMN identifier is the key of the map. + andspInd: + type: boolean + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + osIds: + type: array + items: + $ref: '#/components/schemas/OsId' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + + UePolicySetPatch: + description: Contains the UE policy set for a given subscriber. + type: object + properties: + uePolicySections: + type: object + additionalProperties: + $ref: '#/components/schemas/UePolicySection' + minProperties: 1 + description: > + Contains the UE Policy Sections. The UE Policy Section Identifier is used + as the key of the map. + upsis: + type: array + items: + type: string + minItems: 1 + andspInd: + type: boolean + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + osIds: + type: array + items: + $ref: '#/components/schemas/OsId' + minItems: 1 + + UePolicySection: + description: Contains the UE policy section. + type: object + properties: + uePolicySectionInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + upsi: + type: string + required: + - uePolicySectionInfo + - upsi + + SmPolicyData: + description: Contains the SM policy data for a given subscriber. + type: object + properties: + smPolicySnssaiData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicySnssaiData' + minProperties: 1 + description: > + Contains Session Management Policy data per S-NSSAI for all the SNSSAIs + of the subscriber. The key of the map is the S-NSSAI. + umDataLimits: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataLimit' + minProperties: 1 + description: > + Contains a list of usage monitoring profiles associated with the subscriber. + The limit identifier is used as the key of the map. + umData: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonData' + minProperties: 1 + description: > + Contains the remaining allowed usage data associated with the subscriber. + The limit identifier is used as the key of the map. + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - smPolicySnssaiData + + SmPolicySnssaiData: + description: Contains the SM policy data for a given subscriber and S-NSSAI. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + smPolicyDnnData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicyDnnData' + minProperties: 1 + description: > + Session Management Policy data per DNN for all the DNNs of the indicated S-NSSAI. + The key of the map is the DNN. + ueSliceMbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SliceMbr' + required: + - snssai + + SmPolicyDnnData: + description: Contains the SM policy data for a given DNN (and S-NSSAI). + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + allowedServices: + type: array + items: + type: string + minItems: 1 + subscCats: + type: array + items: + type: string + minItems: 1 + gbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + adcSupport: + type: boolean + subscSpendingLimits: + type: boolean + ipv4Index: + $ref: '#/components/schemas/IpIndex' + ipv6Index: + $ref: '#/components/schemas/IpIndex' + offline: + type: boolean + online: + type: boolean + chfInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/ChargingInformation' + refUmDataLimitIds: + type: object + additionalProperties: + $ref: '#/components/schemas/LimitIdToMonitoringKey' + minProperties: 1 + description: > + A reference to the UsageMonitoringDataLimit or UsageMonitoringData instances + for this DNN and SNSSAI that may also include the related monitoring key(s). + The key of the map is the limit identifier. + mpsPriority: + type: boolean + mcsPriority: + type: boolean + imsSignallingPrio: + type: boolean + mpsPriorityLevel: + type: integer + mcsPriorityLevel: + type: integer + praInfos: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 1 + description: > + Contains Presence reporting area information. The praId attribute within the + PresenceInfo data type is the key of the map. + bdtRefIds: + type: object + additionalProperties: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceIdRm' + minProperties: 1 + description: > + Identifies transfer policies of background data transfer. Any string value can + be used as a key of the map. + nullable: true + locRoutNotAllowed: + type: boolean + required: + - dnn + + UsageMonDataLimit: + description: Contains usage monitoring control data for a subscriber. + type: object + properties: + limitId: + type: string + scopes: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataScope' + minProperties: 1 + description: > + Identifies the SNSSAI and DNN combinations to which the usage monitoring data + limit applies. The S-NSSAI is the key of the map. + umLevel: + $ref: '#/components/schemas/UsageMonLevel' + startDate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endDate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + usageLimit: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + resetPeriod: + $ref: '#/components/schemas/TimePeriod' + required: + - limitId + + UsageMonData: + description: Contains remain allowed usage data for a subscriber. + type: object + properties: + limitId: + type: string + scopes: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonDataScope' + minProperties: 1 + description: > + Identifies the SNSSAI and DNN combinations for remain allowed usage data + for a subscriber. The S-NSSAI is the key of the map. + umLevel: + $ref: '#/components/schemas/UsageMonLevel' + allowedUsage: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + resetTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - limitId + + LimitIdToMonitoringKey: + description: > + Contains the limit identifier and the corresponding monitoring key for a given + S-NSSAI and DNN. + type: object + properties: + limitId: + type: string + monkey: + type: array + items: + type: string + minItems: 1 + required: + - limitId + nullable: true + + UsageMonDataScope: + description: > + Contains a SNSSAI and DNN combinations to which the UsageMonData instance belongs to. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + required: + - snssai + + TimePeriod: + description: Contains the periodicity for the defined usage monitoring data limits. + type: object + properties: + period: + $ref: '#/components/schemas/Periodicity' + maxNumPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - period + + SponsorConnectivityData: + description: > + Contains the sponsored data connectivity related information for a sponsor identifier. + type: object + properties: + aspIds: + type: array + items: + type: string + required: + - aspIds + + BdtData: + description: Contains the background data transfer data. + type: object + properties: + aspId: + type: string + transPolicy: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/TransferPolicy' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + nwAreaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + numOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + volPerUe: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + trafficDes: + $ref: 'TS29122_ResourceManagementOfBdt.yaml#/components/schemas/TrafficDescriptor' + bdtpStatus: + $ref: '#/components/schemas/BdtPolicyStatus' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - aspId + - transPolicy + + PolicyDataSubscription: + description: Identifies a subscription to policy data change notification. + type: object + properties: + notificationUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monResItems: + type: array + items: + $ref: '#/components/schemas/ResourceItem' + minItems: 1 + excludedResItems: + type: array + items: + $ref: '#/components/schemas/ResourceItem' + minItems: 1 + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + required: + - notificationUri + - monitoredResourceUris + + PolicyDataChangeNotification: + description: Contains changed policy data for which notification was requested. + type: object + properties: + amPolicyData: + $ref: '#/components/schemas/AmPolicyData' + uePolicySet: + $ref: '#/components/schemas/UePolicySet' + plmnUePolicySet: + $ref: '#/components/schemas/UePolicySet' + smPolicyData: + $ref: '#/components/schemas/SmPolicyData' + usageMonData: + $ref: '#/components/schemas/UsageMonData' + SponsorConnectivityData: + $ref: '#/components/schemas/SponsorConnectivityData' + bdtData: + $ref: '#/components/schemas/BdtData' + opSpecData: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + opSpecDataMap: + type: object + additionalProperties: + $ref: 'TS29505_Subscription_Data.yaml#/components/schemas/OperatorSpecificDataContainer' + minProperties: 1 + description: > + Operator Specific Data resource data, if changed and notification was requested. + The key of the map is operator specific data element name and the value is the + operator specific data of the UE. + ueId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId' + sponsorId: + type: string + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + usageMonId: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + delResources: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + notifId: + type: string + reportedFragments: + type: array + items: + $ref: '#/components/schemas/NotificationItem' + minItems: 1 + slicePolicyData: + $ref: '#/components/schemas/SlicePolicyData' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + PlmnRouteSelectionDescriptor: + description: > + Contains the route selection descriptors (combinations of SNSSAI, DNNs, PDU session types, + SSC modes and ATSSS information) allowed by subscription to the UE for a serving PLMN + type: object + properties: + servingPlmn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + snssaiRouteSelDescs: + type: array + items: + $ref: '#/components/schemas/SnssaiRouteSelectionDescriptor' + minItems: 1 + required: + - servingPlmn + + SnssaiRouteSelectionDescriptor: + description: > + Contains the route selector parameters (DNNs, PDU session types, SSC modes and ATSSS + information) per SNSSAI + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnnRouteSelDescs: + type: array + items: + $ref: '#/components/schemas/DnnRouteSelectionDescriptor' + minItems: 1 + required: + - snssai + + DnnRouteSelectionDescriptor: + description: > + Contains the route selector parameters (PDU session types, SSC modes and ATSSS + information) per DNN + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + sscModes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + minItems: 1 + pduSessTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + atsssInfo: + description: > + Indicates whether MA PDU session establishment is allowed for this DNN. + When set to value true MA PDU session establishment is allowed for this DNN. + type: boolean + default: false + required: + - dnn + + SmPolicyDataPatch: + description: Contains the SM policy data for a given subscriber. + type: object + properties: + umData: + type: object + additionalProperties: + $ref: '#/components/schemas/UsageMonData' + minProperties: 1 + description: > + Contains the remaining allowed usage data associated with the subscriber. + The value of the limit identifier is used as the key of the map. + nullable: true + smPolicySnssaiData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicySnssaiDataPatch' + minProperties: 1 + description: > + Modifiable Session Management Policy data per S-NSSAI for all the SNSSAIs + of the subscriber. The key of the map is the S-NSSAI. + + SmPolicySnssaiDataPatch: + description: Contains the SM policy data for a given subscriber and S-NSSAI. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + smPolicyDnnData: + type: object + additionalProperties: + $ref: '#/components/schemas/SmPolicyDnnDataPatch' + minProperties: 1 + description: > + Modifiable Session Management Policy data per DNN for all the DNNs of the + indicated S-NSSAI. The key of the map is the DNN. + required: + - snssai + SmPolicyDnnDataPatch: + description: Contains the SM policy data for a given DNN (and S-NSSAI). + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + bdtRefIds: + type: object + additionalProperties: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceIdRm' + minProperties: 1 + description: > + Contains updated transfer policies of background data transfer. + Any string value can be used as a key of the map. + nullable: true + required: + - dnn + + ResourceItem: + description: > + Identifies a subscription to policy data change notification when the change occurs + in a fragment (subset of resource data) of a given resource. + type: object + properties: + monResourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + items: + type: array + items: + $ref: '#/components/schemas/ItemPath' + minItems: 1 + required: + - monResourceUri + - items + + NotificationItem: + description: > + Identifies a data change notification when the change occurs in a fragment + (subset of resource data) of a given resource. + type: object + properties: + resourceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifItems: + type: array + items: + $ref: '#/components/schemas/UpdatedItem' + minItems: 1 + required: + - resourceId + - notifItems + + UpdatedItem: + description: Identifies a fragment of a resource. + type: object + properties: + item: + $ref: '#/components/schemas/ItemPath' + value: {} + required: + - item + - value + + BdtDataPatch: + description: Contains the modified background data transfer data. + type: object + properties: + transPolicy: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/TransferPolicy' + bdtpStatus: + $ref: '#/components/schemas/BdtPolicyStatus' + + SlicePolicyData: + description: Contains the network slice specific policy control information. + type: object + properties: + mbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + remainMbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + remainMbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + resetIds: + type: array + items: + type: string + minItems: 1 + + SlicePolicyDataPatch: + description: Contains the modified network slice specific policy control information. + type: object + properties: + remainMbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + remainMbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + oneOf: + - required: [remainMbrUl] + - required: [remainMbrDl] + + MbsSessPolCtrlData: + description: Represents MBS Session Policy Control Data. + type: object + properties: + 5qis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + minItems: 1 + maxMbsArpLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ArpPriorityLevel' + maxMbsSessionAmbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxGbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + MbsSessPolDataId: + description: Represents the identifier used to access the MBS Session Policy Control Data. + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + afAppId: + type: string + oneOf: + - required: [mbsSessionId] + - required: [afAppId] + +# SIMPLE TYPES: + + IpIndex: + description: > + Represents information that identifies which IP pool or external server + is used to allocate the IP address. + type: integer + + OsId: + description: Represents the Operating System of the served UE. + type: string + format: uuid + + ItemPath: + description: Identifies a fragment (subset of resource data) of a given resource. + type: string + +# ENUMS: + + UsageMonLevel: + description: Represents the usage monitoring level. + anyOf: + - type: string + enum: + - SESSION_LEVEL + - SERVICE_LEVEL + - type: string + + Periodicity: + description: Represents the time period. + anyOf: + - type: string + enum: + - YEARLY + - MONTHLY + - WEEKLY + - DAILY + - HOURLY + - type: string + + BdtPolicyStatus: + description: Indicates the validation status of a negotiated BDT policy. + anyOf: + - type: string + enum: + - INVALID + - VALID + - type: string + + PolicyDataSubset: + description: Indicates a policy data subset. + anyOf: + - type: string + enum: + - AM_POLICY_DATA + - SM_POLICY_DATA + - UE_POLICY_DATA + - UM_DATA + - OPERATOR_SPECIFIC_DATA + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_AnalyticsInfo.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_AnalyticsInfo.yaml new file mode 100644 index 000000000..58204779b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_AnalyticsInfo.yaml @@ -0,0 +1,704 @@ +openapi: 3.0.0 + +info: + version: 1.2.2 + title: Nnwdaf_AnalyticsInfo + description: | + Nnwdaf_AnalyticsInfo Service API. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.520 V17.9.0; 5G System; Network Data Analytics Services. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.520/' + +security: + - {} + - oAuth2ClientCredentials: + - nnwdaf-analyticsinfo + +servers: + - url: '{apiRoot}/nnwdaf-analyticsinfo/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +paths: + /analytics: + get: + summary: Read a NWDAF Analytics + operationId: GetNWDAFAnalytics + tags: + - NWDAF Analytics (Document) + parameters: + - name: event-id + in: query + description: Identify the analytics. + required: true + schema: + $ref: '#/components/schemas/EventId' + - name: ana-req + in: query + description: Identifies the analytics reporting requirement information. + required: false + content: + application/json: + schema: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventReportingRequirement' + - name: event-filter + in: query + description: Identify the analytics. + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/EventFilter' + - name: supported-features + in: query + description: To filter irrelevant responses related to unsupported features. + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: tgt-ue + in: query + description: Identify the target UE information. + required: false + content: + application/json: + schema: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/TargetUeInformation' + responses: + '200': + description: > + Containing the analytics with parameters as relevant for the requesting NF service + consumer. + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsData' + '204': + description: No Content. The requested NWDAF Analytics data does not exist. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + description: Indicates that the NWDAF Analytics resource does not exist. + content: + application/problem+json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + description: > + The request is rejected by the NWDAF and more details (not only the ProblemDetails) are + returned. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetailsAnalyticsInfoRequest' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /context: + get: + summary: Get context information related to analytics subscriptions. + operationId: GetNwdafContext + tags: + - NWDAF Context (Document) + parameters: + - name: context-ids + in: query + description: Identifies specific context information related to analytics subscriptions. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ContextIdList' + - name: req-context + in: query + description: > + Identfies the type(s) of the analytics context information the consumer wishes to receive. + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/RequestedContext' + responses: + '200': + description: > + Contains context information related to analytics subscriptions corresponding with one or + more context identifiers. + content: + application/json: + schema: + $ref: '#/components/schemas/ContextData' + '204': + description: > + No Content. (\No context information could be retrieved for the requested context + Identifiers. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnwdaf-analyticsinfo: Access to the Nnwdaf_AnalyticsInfo API + + schemas: + + AnalyticsData: + description: > + Represents the description of analytics with parameters as relevant for the requesting NF + service consumer. + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStampGen: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + anaMetaInfo: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsMetadataInfo' + sliceLoadLevelInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/SliceLoadLevelInformation' + minItems: 1 + description: The slices and their load level information. + nsiLoadLevelInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiLoadLevelInfo' + minItems: 1 + nfLoadLevelInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NfLoadLevelInformation' + minItems: 1 + nwPerfs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfInfo' + minItems: 1 + svcExps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ServiceExperienceInfo' + minItems: 1 + qosSustainInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/QosSustainabilityInfo' + minItems: 1 + ueMobs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UeMobility' + minItems: 1 + ueComms: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UeCommunication' + minItems: 1 + userDataCongInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UserDataCongestionInfo' + minItems: 1 + abnorBehavrs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AbnormalBehaviour' + minItems: 1 + smccExps: + type: array + items: + $ref: '#/components/schemas/SmcceInfo' + minItems: 1 + disperInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionInfo' + minItems: 1 + redTransInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RedundantTransmissionExpInfo' + minItems: 1 + wlanInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/WlanPerformanceInfo' + minItems: 1 + dnPerfInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerfInfo' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + EventFilter: + description: Represents the event filters used to identify the requested analytics. + type: object + properties: + anySlice: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnySlice' + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: Identification(s) of network slice. + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + ladnDnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Identification(s) of LADN DNN to indicate the LADN service area as the AOI. + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + visitedAreas: + type: array + items: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + minItems: 1 + maxTopAppUlNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxTopAppDlNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + nfInstanceIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + nfSetIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + nfTypes: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + minItems: 1 + nsiIdInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiIdInfo' + minItems: 1 + qosRequ: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/QosRequirement' + nwPerfTypes: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfType' + minItems: 1 + bwRequs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/BwRequirement' + minItems: 1 + excepIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExceptionId' + minItems: 1 + exptAnaType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExpectedAnalyticsType' + exptUeBehav: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExpectedUeBehaviourData' + ratFreqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RatFreqInformation' + minItems: 1 + disperReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionRequirement' + minItems: 1 + redTransReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RedundantTransmissionExpReq' + minItems: 1 + wlanReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/WlanPerformanceReq' + minItems: 1 + listOfAnaSubsets: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsSubset' + minItems: 1 + upfInfo: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/UpfInformation' + + appServerAddrs: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + minItems: 1 + dnPerfReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerformanceReq' + minItems: 1 + not: + required: [anySlice, snssais] + + ProblemDetailsAnalyticsInfoRequest: + description: > + Extends ProblemDetails to indicate more details why the analytics request is rejected. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/AdditionInfoAnalyticsInfoRequest' + + AdditionInfoAnalyticsInfoRequest: + description: Indicates additional information why the analytics request is rejected. + type: object + properties: + rvWaitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + + ContextData: + description: > + Contains context information related to analytics subscriptions corresponding with one or + more context identifiers. + type: object + properties: + contextElems: + type: array + items: + $ref: '#/components/schemas/ContextElement' + minItems: 1 + description: > + List of items that contain context information corresponding with a context identifier. + required: + - contextElems + + ContextElement: + description: Contains context information corresponding with a specific context identifier. + type: object + properties: + contextId: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsContextIdentifier' + pendAnalytics: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventNotification' + minItems: 1 + description: > + Output analytics for the analytics subscription which have not yet been sent to the + analytics consumer. + histAnalytics: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventNotification' + minItems: 1 + description: Historical output analytics. + lastOutputTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + aggrSubs: + type: array + items: + $ref: '#/components/schemas/SpecificAnalyticsSubscription' + minItems: 1 + description: > + Information about analytics subscriptions that the NWDAF has with other NWDAFs to perform + aggregation. + histData: + type: array + items: + $ref: '#/components/schemas/HistoricalData' + minItems: 1 + description: Historical data related to the analytics subscription. + adrfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + adrfDataTypes: + type: array + items: + $ref: '#/components/schemas/AdrfDataType' + minItems: 1 + description: Type(s) of data stored in the ADRF by the NWDAF. + aggrNwdafIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + description: > + NWDAF identifiers of NWDAF instances used by the NWDAF service consumer when aggregating + multiple analytics subscriptions. + modelInfo: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ModelInfo' + minItems: 1 + description: > + Contains information identifying the ML model(s) that the consumer NWDAF is currently + subscribing for the analytics. + required: + - contextId + + ContextIdList: + description: > + Contains a list of context identifiers of context information of analytics subscriptions. + type: object + properties: + contextIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsContextIdentifier' + minItems: 1 + required: + - contextIds + + HistoricalData: + description: Contains historical data related to an analytics subscription. + type: object + properties: + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + subsWithSources: + type: array + items: + $ref: '#/components/schemas/SpecificDataSubscription' + minItems: 1 + description: Information about subscriptions with the data sources. + data: + type: array + items: + $ref: 'TS29575_Nadrf_DataManagement.yaml#/components/schemas/DataNotification' + minItems: 1 + description: Historical data related to the analytics. + required: + - data + + SpecificAnalyticsSubscription: + description: > + Represents an existing subscription for a specific type of analytics to a specific NWDAF. + type: object + properties: + subscriptionId: + type: string + producerId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + producerSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nwdafEvSub: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NnwdafEventsSubscription' + allOf: + - oneOf: + - required: [producerId] + - required: [producerSetId] + - required: [subscriptionId] + - required: [nwdafEvSub] + + RequestedContext: + description: Contains types of analytics context information. + type: object + properties: + contexts: + type: array + items: + $ref: '#/components/schemas/ContextType' + minItems: 1 + description: List of analytics context types. + required: + - contexts + + SmcceInfo: + description: Represents the Session Management congestion control experience information. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + smcceUeList: + $ref: '#/components/schemas/SmcceUeList' + required: + - smcceUeList + + SmcceUeList: + description: > + Represents the List of UEs classified based on experience level of Session Management + congestion control. + type: object + properties: + highLevel: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + mediumLevel: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + lowLevel: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + anyOf: + - required: [highLevel] + - required: [mediumLevel] + - required: [lowLevel] + + SpecificDataSubscription: + description: > + Represents an existing subscription for data collection to a specific data source NF. + type: object + properties: + subscriptionId: + type: string + producerId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + producerSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + dataSub: + $ref: 'TS29575_Nadrf_DataManagement.yaml#/components/schemas/DataSubscription' + allOf: + - oneOf: + - required: [producerId] + - required: [producerSetId] + - required: [subscriptionId] + - required: [dataSub] + + EventId: + anyOf: + - type: string + enum: + - LOAD_LEVEL_INFORMATION + - NETWORK_PERFORMANCE + - NF_LOAD + - SERVICE_EXPERIENCE + - UE_MOBILITY + - UE_COMMUNICATION + - QOS_SUSTAINABILITY + - ABNORMAL_BEHAVIOUR + - USER_DATA_CONGESTION + - NSI_LOAD_LEVEL + - SM_CONGESTION + - DISPERSION + - RED_TRANS_EXP + - WLAN_PERFORMANCE + - DN_PERFORMANCE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - LOAD_LEVEL_INFORMATION: Represent the analytics of load level information of corresponding network slice. + - NETWORK_PERFORMANCE: Represent the analytics of network performance information. + - NF_LOAD: Indicates that the event subscribed is NF Load. + - SERVICE_EXPERIENCE: Represent the analytics of service experience information of the specific applications. + - UE_MOBILITY: Represent the analytics of UE mobility. + - UE_COMMUNICATION: Represent the analytics of UE communication. + - QOS_SUSTAINABILITY: Represent the analytics of QoS sustainability information in the certain area. + - ABNORMAL_BEHAVIOUR: Indicates that the event subscribed is abnormal behaviour information. + - USER_DATA_CONGESTION: Represent the analytics of the user data congestion in the certain area. + - NSI_LOAD_LEVEL: Represent the analytics of Network Slice and the optionally associated Network Slice Instance. + - SM_CONGESTION: Represent the analytics of Session Management congestion control experience information for specific DNN and/or S-NSSAI. + - DISPERSION: Represents the analytics of dispersion. + - RED_TRANS_EXP: Represents the analytics of Redundant Transmission Experience. + - WLAN_PERFORMANCE: Represents the analytics of WLAN performance. + - DN_PERFORMANCE: Represents the analytics of DN performance. + + ContextType: + anyOf: + - type: string + enum: + - PENDING_ANALYTICS + - HISTORICAL_ANALYTICS + - AGGR_SUBS + - DATA + - AGGR_INFO + - ML_MODELS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - PENDING_ANALYTICS: Represents context information that relates to pending output analytics. + - HISTORICAL_ANALYTICS: Represents context information that relates to historical output analytics. + - AGGR_SUBS: Represents context information about the analytics subscriptions that an NWDAF has with other NWDAFs that collectively serve an analytics subscription. + - DATA: Represents context information about historical data that is available. + - AGGR_INFO: Represents context information that is related to aggregation of analytics from multiple NWDAF subscriptions. + - ML_MODELS: Represents context information about used ML models. + + AdrfDataType: + anyOf: + - type: string + enum: + - HISTORICAL_ANALYTICS + - HISTORICAL_DATA + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - HISTORICAL_ANALYTICS: Indicates that historical analytics are stored in the ADRF. + - HISTORICAL_DATA: Indicates that historical data are stored in the ADRF. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_DataManagement.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_DataManagement.yaml new file mode 100644 index 000000000..c30561782 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_DataManagement.yaml @@ -0,0 +1,333 @@ +openapi: 3.0.0 +info: + title: Nnwdaf_DataManagement + version: 1.0.2 + description: | + Nnwdaf_DataManagement API Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.520 V17.9.0; 5G System; Network Data Analytics Services. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.520/' +servers: + - url: '{apiRoot}/nnwdaf-datamanagement/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nnwdaf-datamanagement +paths: + /subscriptions: + post: + summary: subscribe to notifications + operationId: CreateIndividualSubcription + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementSubsc' + responses: + '201': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementSubsc' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnwdaf-datamanagement//subscriptions/{subId}. + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notificURI}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementNotif' + responses: + '204': + description: No Content, Notification was succesfull + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + Fetch: + '{request.body#/fetchInstruct/fetchUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: string + minItems: 1 + description: Indicate the fetch correlation identifier. + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementNotif' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subscriptionId}: + put: + summary: Update an existing Individual NWDAF Data Subscription. + operationId: UpdateNWDAFDataSubscription + tags: + - Individual NWDAF Data Management Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementSubsc' + parameters: + - name: subscriptionId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was succesfully modified and representation is returned + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafDataManagementSubsc' + '204': + description: No Content. Resource was succesfully modified + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: unsubscribe from notifications + operationId: DeleteNWDAFDataSubscription + tags: + - Individual NWDAF Data Management Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Event Subscription ID + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was succesfully deleted + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnwdaf-datamanagement: Access to the Nnwdaf_DataManagement API + schemas: + NnwdafDataManagementSubsc: + description: Represents an Individual NWDAF Data Management Subscription resource. + type: object + properties: + adrfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + adrfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + anaSub: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NnwdafEventsSubscription' + dataCollectPurposes: + type: array + items: + $ref: 'TS29574_Ndccf_DataManagement.yaml#/components/schemas/DataCollectionPurpose' + minItems: 1 + description: > + The purposes of data collection. This attribute may only be provided if user consent + is reqiured depending on local policy and regulations and the consumer has + not checked user consent. + dataSub: + $ref: 'TS29575_Nadrf_DataManagement.yaml#/components/schemas/DataSubscription' + formatInstruct: + $ref: 'TS29574_Ndccf_DataManagement.yaml#/components/schemas/FormattingInstruction' + notifCorrId: + type: string + notificURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + procInstruct: + $ref: 'TS29574_Ndccf_DataManagement.yaml#/components/schemas/ProcessingInstruction' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + targetNfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + targetNfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + timePeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + required: + - notifCorrId + - notificURI + oneOf: + - required: [anaSub] + - required: [dataSub] + NnwdafDataManagementNotif: + description: Represents an Individual Notification. + type: object + properties: + dataNotification: + $ref: 'TS29575_Nadrf_DataManagement.yaml#/components/schemas/DataNotification' + dataReports: + type: array + items: + $ref: 'TS29574_Ndccf_DataManagement.yaml#/components/schemas/NotifSummaryReport' + minItems: 1 + description: List of summary reports of processed notifications. + notifCorrId: + type: string + description: Notification correlation identifier. + terminationReq: + type: string + description: > + It indicates that the termination of the data management subscription + is requested by the NWDAF. + fetchInstruct: + $ref: 'TS29576_Nmfaf_3caDataManagement.yaml#/components/schemas/FetchInstruction' + notifTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - notifCorrId + - notifTimestamp + oneOf: + - required: [dataNotification] + - required: [dataReports] + - required: [fetchInstruct] + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_EventsSubscription.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_EventsSubscription.yaml new file mode 100644 index 000000000..8f8b88032 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_EventsSubscription.yaml @@ -0,0 +1,2558 @@ +openapi: 3.0.0 + +info: + version: 1.2.2 + title: Nnwdaf_EventsSubscription + description: | + Nnwdaf_EventsSubscription Service API. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.520 V17.9.0; 5G System; Network Data Analytics Services. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.520/' + +security: + - {} + - oAuth2ClientCredentials: + - nnwdaf-eventssubscription + +servers: + - url: '{apiRoot}/nnwdaf-eventssubscription/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +paths: + /subscriptions: + post: + summary: Create a new Individual NWDAF Events Subscription + operationId: CreateNWDAFEventsSubscription + tags: + - NWDAF Events Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafEventsSubscription' + responses: + '201': + description: Create a new Individual NWDAF Event Subscription resource. + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnwdaf-eventssubscription//subscriptions/{subscriptionId} + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafEventsSubscription' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notificationURI}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NnwdafEventsSubscriptionNotification' + minItems: 1 + responses: + '204': + description: The receipt of the Notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions/{subscriptionId}: + delete: + summary: Delete an existing Individual NWDAF Events Subscription + operationId: DeleteNWDAFEventsSubscription + tags: + - Individual NWDAF Events Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Nnwdaf_EventsSubscription Service + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual NWDAF Event Subscription resource matching the subscriptionId + was deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Update an existing Individual NWDAF Events Subscription + operationId: UpdateNWDAFEventsSubscription + tags: + - Individual NWDAF Events Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafEventsSubscription' + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Nnwdaf_EventsSubscription Service + required: true + schema: + type: string + responses: + '200': + description: > + The Individual NWDAF Event Subscription resource was modified successfully and a + representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/NnwdafEventsSubscription' + '204': + description: The Individual NWDAF Event Subscription resource was modified successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /transfers: + post: + summary: Provide information about requested analytics subscriptions transfer and potentially create a new Individual NWDAF Event Subscription Transfer resource. + operationId: CreateNWDAFEventSubscriptionTransfer + tags: + - NWDAF Event Subscription Transfers (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsSubscriptionsTransfer' + responses: + '201': + description: Create a new Individual NWDAF Event Subscription Transfer resource. + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnwdaf-eventssubscription//transfers/{transferId} + required: true + schema: + type: string + '204': + description: > + No Content. The receipt of the information about analytics subscription(s) that are + requested to be transferred and the ability to handle this information (e.g. execute the + steps required to transfer an analytics subscription directly) is confirmed. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /transfers/{transferId}: + delete: + summary: Delete an existing Individual NWDAF Event Subscription Transfer + operationId: DeleteNWDAFEventSubscriptionTransfer + tags: + - Individual NWDAF Event Subscription Transfer (Document) + parameters: + - name: transferId + in: path + description: > + String identifying a request for an analytics subscription transfer to the + Nnwdaf_EventsSubscription Service + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual NWDAF Event Subscription Transfer resource matching the + transferId was deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: Update an existing Individual NWDAF Event Subscription Transfer + operationId: UpdateNWDAFEventSubscriptionTransfer + tags: + - Individual NWDAF Event Subscription Transfer (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsSubscriptionsTransfer' + parameters: + - name: transferId + in: path + description: > + String identifying a request for an analytics subscription transfer to the + Nnwdaf_EventsSubscription Service + required: true + schema: + type: string + responses: + '204': + description: > + The Individual NWDAF Event Subscription Transfer resource was modified successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnwdaf-eventssubscription: Access to the Nnwdaf_EventsSubscription API + + schemas: + + NnwdafEventsSubscription: + description: Represents an Individual NWDAF Event Subscription resource. + type: object + properties: + eventSubscriptions: + type: array + items: + $ref: '#/components/schemas/EventSubscription' + minItems: 1 + description: Subscribed events + evtReq: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + notificationURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorrId: + type: string + description: Notification correlation identifier. + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + eventNotifications: + type: array + items: + $ref: '#/components/schemas/EventNotification' + minItems: 1 + failEventReports: + type: array + items: + $ref: '#/components/schemas/FailureEventInfo' + minItems: 1 + prevSub: + $ref: '#/components/schemas/PrevSubInfo' + consNfInfo: + $ref: '#/components/schemas/ConsumerNfInformation' + required: + - eventSubscriptions + + EventSubscription: + description: Represents a subscription to a single event. + type: object + properties: + anySlice: + $ref: '#/components/schemas/AnySlice' + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + description: Identification(s) of application to which the subscription applies. + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Identification(s) of DNN to which the subscription applies. + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + event: + $ref: '#/components/schemas/NwdafEvent' + extraReportReq: + $ref: '#/components/schemas/EventReportingRequirement' + ladnDnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: Identification(s) of LADN DNN to indicate the LADN service area as the AOI. + loadLevelThreshold: + type: integer + description: > + Indicates that the NWDAF shall report the corresponding network slice load level to the NF + service consumer where the load level of the network slice identified by snssais is + reached. + notificationMethod: + $ref: '#/components/schemas/NotificationMethod' + matchingDir: + $ref: '#/components/schemas/MatchingDirection' + nfLoadLvlThds: + type: array + items: + $ref: '#/components/schemas/ThresholdLevel' + minItems: 1 + description: > + Shall be supplied in order to start reporting when an average load level is reached. + nfInstanceIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + nfSetIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + nfTypes: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + minItems: 1 + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + visitedAreas: + type: array + items: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + minItems: 1 + maxTopAppUlNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxTopAppDlNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + nsiIdInfos: + type: array + items: + $ref: '#/components/schemas/NsiIdInfo' + minItems: 1 + nsiLevelThrds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + minItems: 1 + qosRequ: + $ref: '#/components/schemas/QosRequirement' + qosFlowRetThds: + type: array + items: + $ref: '#/components/schemas/RetainabilityThreshold' + minItems: 1 + ranUeThrouThds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + minItems: 1 + repetitionPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + snssaia: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: > + Identification(s) of network slice to which the subscription applies. It corresponds to + snssais in the data model definition of 3GPP TS 29.520. + tgtUe: + $ref: '#/components/schemas/TargetUeInformation' + congThresholds: + type: array + items: + $ref: '#/components/schemas/ThresholdLevel' + minItems: 1 + nwPerfRequs: + type: array + items: + $ref: '#/components/schemas/NetworkPerfRequirement' + minItems: 1 + bwRequs: + type: array + items: + $ref: '#/components/schemas/BwRequirement' + minItems: 1 + excepRequs: + type: array + items: + $ref: '#/components/schemas/Exception' + minItems: 1 + exptAnaType: + $ref: '#/components/schemas/ExpectedAnalyticsType' + exptUeBehav: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExpectedUeBehaviourData' + ratFreqs: + type: array + items: + $ref: '#/components/schemas/RatFreqInformation' + minItems: 1 + listOfAnaSubsets: + type: array + items: + $ref: '#/components/schemas/AnalyticsSubset' + minItems: 1 + disperReqs: + type: array + items: + $ref: '#/components/schemas/DispersionRequirement' + minItems: 1 + redTransReqs: + type: array + items: + $ref: '#/components/schemas/RedundantTransmissionExpReq' + minItems: 1 + wlanReqs: + type: array + items: + $ref: '#/components/schemas/WlanPerformanceReq' + minItems: 1 + upfInfo: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/UpfInformation' + appServerAddrs: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + minItems: 1 + dnPerfReqs: + type: array + items: + $ref: '#/components/schemas/DnPerformanceReq' + minItems: 1 + required: + - event + + NnwdafEventsSubscriptionNotification: + description: Represents an Individual NWDAF Event Subscription Notification resource. + type: object + properties: + eventNotifications: + type: array + items: + $ref: '#/components/schemas/EventNotification' + minItems: 1 + description: Notifications about Individual Events + subscriptionId: + type: string + description: String identifying a subscription to the Nnwdaf_EventsSubscription Service + notifCorrId: + type: string + description: Notification correlation identifier. + oldSubscriptionId: + type: string + description: > + Subscription ID which was allocated by the source NWDAF. This parameter shall be present + if the notification is for informing the assignment of a new Subscription Id by the + target NWDAF. + resourceUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + required: + - subscriptionId + oneOf: + - required: [eventNotifications] + - allOf: + - required: [resourceUri] + - required: [oldSubscriptionId] + + EventNotification: + description: Represents a notification on events that occurred. + type: object + properties: + event: + $ref: '#/components/schemas/NwdafEvent' + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStampGen: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + failNotifyCode: + $ref: '#/components/schemas/NwdafFailureCode' + rvWaitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + anaMetaInfo: + $ref: '#/components/schemas/AnalyticsMetadataInfo' + nfLoadLevelInfos: + type: array + items: + $ref: '#/components/schemas/NfLoadLevelInformation' + minItems: 1 + nsiLoadLevelInfos: + type: array + items: + $ref: '#/components/schemas/NsiLoadLevelInfo' + minItems: 1 + sliceLoadLevelInfo: + $ref: '#/components/schemas/SliceLoadLevelInformation' + svcExps: + type: array + items: + $ref: '#/components/schemas/ServiceExperienceInfo' + minItems: 1 + qosSustainInfos: + type: array + items: + $ref: '#/components/schemas/QosSustainabilityInfo' + minItems: 1 + ueComms: + type: array + items: + $ref: '#/components/schemas/UeCommunication' + minItems: 1 + ueMobs: + type: array + items: + $ref: '#/components/schemas/UeMobility' + minItems: 1 + userDataCongInfos: + type: array + items: + $ref: '#/components/schemas/UserDataCongestionInfo' + minItems: 1 + abnorBehavrs: + type: array + items: + $ref: '#/components/schemas/AbnormalBehaviour' + minItems: 1 + nwPerfs: + type: array + items: + $ref: '#/components/schemas/NetworkPerfInfo' + minItems: 1 + dnPerfInfos: + type: array + items: + $ref: '#/components/schemas/DnPerfInfo' + minItems: 1 + disperInfos: + type: array + items: + $ref: '#/components/schemas/DispersionInfo' + minItems: 1 + redTransInfos: + type: array + items: + $ref: '#/components/schemas/RedundantTransmissionExpInfo' + minItems: 1 + wlanInfos: + type: array + items: + $ref: '#/components/schemas/WlanPerformanceInfo' + minItems: 1 + smccExps: + type: array + items: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/SmcceInfo' + minItems: 1 + required: + - event + + ServiceExperienceInfo: + description: Represents service experience information. + type: object + properties: + svcExprc: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/SvcExperience' + svcExprcVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + srvExpcType: + $ref: '#/components/schemas/ServiceExperienceType' + ueLocs: + type: array + items: + $ref: '#/components/schemas/LocationInfo' + minItems: 1 + upfInfo: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/UpfInformation' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + appServerInst: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + nsiId: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + ratFreq: + $ref: '#/components/schemas/RatFreqInformation' + required: + - svcExprc + + BwRequirement: + description: Represents bandwidth requirements. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + marBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + marBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + mirBwUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + required: + - appId + + SliceLoadLevelInformation: + description: Contains load level information applicable for one or several slices. + type: object + properties: + loadLevelInformation: + $ref: '#/components/schemas/LoadLevelInformation' + snssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + description: Identification(s) of network slice to which the subscription applies. + required: + - loadLevelInformation + - snssais + + NsiLoadLevelInfo: + description: > + Represents the network slice and optionally the associated network slice instance and the + load level information. + type: object + properties: + loadLevelInformation: + $ref: '#/components/schemas/LoadLevelInformation' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiId: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + resUsage: + $ref: '#/components/schemas/ResourceUsage' + numOfExceedLoadLevelThr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + exceedLoadLevelThrInd: + type: boolean + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + timePeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + resUsgThrCrossTimePeriod: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + minItems: 1 + description: > + Each element indicates the time elapsed between times each threshold is met or exceeded + or crossed. The start time and end time are the exact time stamps of the resource usage + threshold is reached or exceeded. May be present if the "listOfAnaSubsets" attribute is + provided and the maximum number of instances shall not exceed the value provided in the + "numOfExceedLoadLevelThr" attribute. + numOfUes: + $ref: '#/components/schemas/NumberAverage' + numOfPduSess: + $ref: '#/components/schemas/NumberAverage' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - loadLevelInformation + - snssai + + NsiIdInfo: + description: Represents the S-NSSAI and the optionally associated Network Slice Instance(s). + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiIds: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsiId' + minItems: 1 + required: + - snssai + + EventReportingRequirement: + description: Represents the type of reporting that the subscription requires. + type: object + properties: + accuracy: + $ref: '#/components/schemas/Accuracy' + accPerSubset: + type: array + items: + $ref: '#/components/schemas/Accuracy' + minItems: 1 + description: > + Each element indicates the preferred accuracy level per analytics subset. It may be + present if the "listOfAnaSubsets" attribute is present in the subscription request when + the subscription event is NF_LOAD, UE_COMM, DISPERSION, NETWORK_PERFORMANCE, + WLAN_PERFORMANCE, DN_PERFORMANCE or SERVICE_EXPERIENCE. + startTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + offsetPeriod: + type: integer + description: > + Offset period in units of seconds to the reporting time, if the value is negative means + statistics in the past offset period, otherwise a positive value means prediction in the + future offset period. May be present if the "repPeriod" attribute is included within the + "evtReq" attribute. + sampRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + maxObjectNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxSupiNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + timeAnaNeeded: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + anaMeta: + type: array + items: + $ref: '#/components/schemas/AnalyticsMetadata' + minItems: 1 + anaMetaInd: + $ref: '#/components/schemas/AnalyticsMetadataIndication' + + TargetUeInformation: + description: Identifies the target UE information. + type: object + properties: + anyUe: + type: boolean + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + intGroupIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + minItems: 1 + + UeMobility: + description: Represents UE mobility information. + type: object + properties: + ts: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + recurringTime: + $ref: 'TS29122_CpProvisioning.yaml#/components/schemas/ScheduledCommunicationTime' + duration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + durationVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + locInfos: + type: array + items: + $ref: '#/components/schemas/LocationInfo' + minItems: 1 + allOf: + - required: [duration] + - required: [locInfos] + - oneOf: + - required: [ts] + - required: [recurringTime] + LocationInfo: + description: Represents UE location information. + type: object + properties: + loc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - loc + + UeCommunication: + description: Represents UE communication information. + type: object + properties: + commDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + commDurVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + perioTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + perioTimeVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + ts: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tsVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + recurringTime: + $ref: 'TS29122_CpProvisioning.yaml#/components/schemas/ScheduledCommunicationTime' + trafChar: + $ref: '#/components/schemas/TrafficCharacterization' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + perioCommInd: + type: boolean + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + anaOfAppList: + $ref: '#/components/schemas/AppListForUeComm' + sessInactTimer: + $ref: '#/components/schemas/SessInactTimerForUeComm' + allOf: + - required: [commDur] + - required: [trafChar] + - oneOf: + - required: [ts] + - required: [recurringTime] + TrafficCharacterization: + description: Identifies the detailed traffic characterization. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + fDescs: + type: array + items: + $ref: '#/components/schemas/IpEthFlowDescription' + minItems: 1 + maxItems: 2 + ulVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + ulVolVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + dlVol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + dlVolVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + anyOf: + - required: [ulVol] + - required: [dlVol] + + UserDataCongestionInfo: + description: Represents the user data congestion information. + type: object + properties: + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + congestionInfo: + $ref: '#/components/schemas/CongestionInfo' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - networkArea + - congestionInfo + + CongestionInfo: + description: Represents the congestion information. + type: object + properties: + congType: + $ref: '#/components/schemas/CongestionType' + timeIntev: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + nsi: + $ref: '#/components/schemas/ThresholdLevel' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + topAppListUl: + type: array + items: + $ref: '#/components/schemas/TopApplication' + minItems: 1 + topAppListDl: + type: array + items: + $ref: '#/components/schemas/TopApplication' + minItems: 1 + required: + - congType + - timeIntev + - nsi + + TopApplication: + description: Top application that contributes the most to the traffic. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + ipTrafficFilter: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + oneOf: + - required: [appId] + - required: [ipTrafficFilter] + + QosSustainabilityInfo: + description: Represents the QoS Sustainability information. + type: object + properties: + areaInfo: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + startTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTs: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qosFlowRetThd: + $ref: '#/components/schemas/RetainabilityThreshold' + ranUeThrouThd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + oneOf: + - required: [qosFlowRetThd] + - required: [ranUeThrouThd] + + QosRequirement: + description: Represents the QoS requirements. + type: object + properties: + 5qi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/5Qi' + gfbrUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + gfbrDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + resType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/QosResourceType' + pdb: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + per: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate' + oneOf: + - required: [5qi] + - required: [resType] + ThresholdLevel: + description: Represents a threshold level. + type: object + properties: + congLevel: + type: integer + nfLoadLevel: + type: integer + nfCpuUsage: + type: integer + nfMemoryUsage: + type: integer + nfStorageUsage: + type: integer + avgTrafficRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxTrafficRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + avgPacketDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + maxPacketDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + avgPacketLossRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + svcExpLevel: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + + NfLoadLevelInformation: + description: Represents load level information of a given NF instance. + type: object + properties: + nfType: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + nfStatus: + $ref: '#/components/schemas/NfStatus' + nfCpuUsage: + type: integer + nfMemoryUsage: + type: integer + nfStorageUsage: + type: integer + nfLoadLevelAverage: + type: integer + nfLoadLevelpeak: + type: integer + nfLoadAvgInAoi: + type: integer + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + allOf: + - required: [nfType] + - required: [nfInstanceId] + - anyOf: + - required: [nfStatus] + - required: [nfCpuUsage] + - required: [nfMemoryUsage] + - required: [nfStorageUsage] + - required: [nfLoadLevelAverage] + - required: [nfLoadLevelPeak] + + NfStatus: + description: Contains the percentage of time spent on various NF states. + type: object + properties: + statusRegistered: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + statusUnregistered: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + statusUndiscoverable: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + anyOf: + - required: [statusRegistered] + - required: [statusUnregistered] + - required: [statusUndiscoverable] + + AnySlice: + type: boolean + description: > + FALSE represents not applicable for all slices. TRUE represents applicable for all slices. + + LoadLevelInformation: + type: integer + description: > + Load level information of the network slice and the optionally associated network slice + instance. + + AbnormalBehaviour: + description: Represents the abnormal behaviour information. + type: object + properties: + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + excep: + $ref: '#/components/schemas/Exception' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + addtMeasInfo: + $ref: '#/components/schemas/AdditionalMeasurement' + required: + - excep + + Exception: + description: Represents the Exception information. + type: object + properties: + excepId: + $ref: '#/components/schemas/ExceptionId' + excepLevel: + type: integer + excepTrend: + $ref: '#/components/schemas/ExceptionTrend' + required: + - excepId + + AdditionalMeasurement: + description: Represents additional measurement information. + type: object + properties: + unexpLoc: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + unexpFlowTeps: + type: array + items: + $ref: '#/components/schemas/IpEthFlowDescription' + minItems: 1 + unexpWakes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minItems: 1 + ddosAttack: + $ref: '#/components/schemas/AddressList' + wrgDest: + $ref: '#/components/schemas/AddressList' + circums: + type: array + items: + $ref: '#/components/schemas/CircumstanceDescription' + minItems: 1 + + IpEthFlowDescription: + description: Contains the description of an Uplink and/or Downlink Ethernet flow. + type: object + properties: + ipTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + ethTrafficFilter: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + oneOf: + - required: [ipTrafficFilter] + - required: [ethTrafficFilter] + + AddressList: + description: Represents a list of IPv4 and/or IPv6 addresses. + type: object + properties: + ipv4Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + minItems: 1 + + CircumstanceDescription: + description: Contains the description of a circumstance. + type: object + properties: + freq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + tm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + vol: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + + RetainabilityThreshold: + description: Represents a QoS flow retainability threshold. + type: object + properties: + relFlowNum: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + relTimeUnit: + $ref: '#/components/schemas/TimeUnit' + relFlowRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + oneOf: + - allOf: + - required: [relFlowNum] + - required: [relTimeUnit] + - required: [relFlowRatio] + + NetworkPerfRequirement: + description: Represents a network performance requirement. + type: object + properties: + nwPerfType: + $ref: '#/components/schemas/NetworkPerfType' + relativeRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + absoluteNum: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - nwPerfType + + NetworkPerfInfo: + description: Represents the network performance information. + type: object + properties: + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + nwPerfType: + $ref: '#/components/schemas/NetworkPerfType' + relativeRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + absoluteNum: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + allOf: + - required: [networkArea] + - required: [nwPerfType] + - oneOf: + - required: [relativeRatio] + - required: [absoluteNum] + + FailureEventInfo: + description: Contains information on the event for which the subscription is not successful. + type: object + properties: + event: + $ref: '#/components/schemas/NwdafEvent' + failureCode: + $ref: '#/components/schemas/NwdafFailureCode' + required: + - event + - failureCode + + AnalyticsMetadataIndication: + description: > + Contains analytics metadata information requested to be used during analytics generation. + type: object + properties: + dataWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dataStatProps: + type: array + items: + $ref: '#/components/schemas/DatasetStatisticalProperty' + minItems: 1 + strategy: + $ref: '#/components/schemas/OutputStrategy' + aggrNwdafIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + + AnalyticsMetadataInfo: + description: Contains analytics metadata information required for analytics aggregation. + type: object + properties: + numSamples: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + dataWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dataStatProps: + type: array + items: + $ref: '#/components/schemas/DatasetStatisticalProperty' + minItems: 1 + strategy: + $ref: '#/components/schemas/OutputStrategy' + accuracy: + $ref: '#/components/schemas/Accuracy' + NumberAverage: + description: Represents average and variance information. + type: object + properties: + number: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + variance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + skewness: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + required: + - number + - variance + + AnalyticsSubscriptionsTransfer: + description: Contains information about a request to transfer analytics subscriptions. + type: object + properties: + subsTransInfos: + type: array + items: + $ref: '#/components/schemas/SubscriptionTransferInfo' + minItems: 1 + required: + - subsTransInfos + + SubscriptionTransferInfo: + description: Contains information about subscriptions that are requested to be transferred. + type: object + properties: + transReqType: + $ref: '#/components/schemas/TransferRequestType' + nwdafEvSub: + $ref: '#/components/schemas/NnwdafEventsSubscription' + consumerId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + contextId: + $ref: '#/components/schemas/AnalyticsContextIdentifier' + sourceNfIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + sourceSetIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + minItems: 1 + modelInfo: + type: array + items: + $ref: '#/components/schemas/ModelInfo' + minItems: 1 + required: + - transReqType + - nwdafEvSub + - consumerId + + ModelInfo: + description: Contains information about an ML model. + type: object + properties: + analyticsId: + $ref: '#/components/schemas/NwdafEvent' + mlModelInfos: + type: array + items: + $ref: '#/components/schemas/MLModelInfo' + minItems: 1 + required: + - analyticsId + - mlModelInfos + MLModelInfo: + description: Contains information about an ML models. + type: object + properties: + mlFileAddrs: + type: array + items: + $ref: 'TS29520_Nnwdaf_MLModelProvision.yaml#/components/schemas/MLModelAddr' + minItems: 1 + modelProvId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + modelProvSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + oneOf: + - required: [modelProvId] + - required: [modelProvSetId] + + AnalyticsContextIdentifier: + description: Contains information about available analytics contexts. + type: object + properties: + subscriptionId: + type: string + description: The identifier of a subscription. + nfAnaCtxts: + type: array + items: + $ref: '#/components/schemas/NwdafEvent' + minItems: 1 + description: > + List of analytics types for which NF related analytics contexts can be retrieved. + ueAnaCtxts: + type: array + items: + $ref: '#/components/schemas/UeAnalyticsContextDescriptor' + minItems: 1 + description: > + List of objects that indicate for which SUPI and analytics types combinations analytics + context can be retrieved. + allOf: + - anyOf: + - required: [nfAnaCtxts] + - required: [ueAnaCtxts] + - required: [subscriptionId] + + UeAnalyticsContextDescriptor: + description: Contains information about available UE related analytics contexts. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + anaTypes: + type: array + items: + $ref: '#/components/schemas/NwdafEvent' + minItems: 1 + description: > + List of analytics types for which UE related analytics contexts can be retrieved. + required: + - supi + - anaTypes + + DnPerfInfo: + description: Represents DN performance information. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnPerf: + type: array + items: + $ref: '#/components/schemas/DnPerf' + minItems: 1 + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - dnPerf + + DnPerf: + description: Represents DN performance for the application. + type: object + properties: + appServerInsAddr: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + upfInfo: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/UpfInformation' + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + perfData: + $ref: '#/components/schemas/PerfData' + spatialValidCon: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + temporalValidCon: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + required: + - perfData + + PerfData: + description: Represents DN performance data. + type: object + properties: + avgTrafficRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxTrafficRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + avePacketDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + maxPacketDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + avgPacketLossRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + + DispersionRequirement: + description: Represents the dispersion analytics requirements. + type: object + properties: + disperType: + $ref: '#/components/schemas/DispersionType' + classCriters: + type: array + items: + $ref: '#/components/schemas/ClassCriterion' + minItems: 1 + rankCriters: + type: array + items: + $ref: '#/components/schemas/RankingCriterion' + minItems: 1 + dispOrderCriter: + $ref: '#/components/schemas/DispersionOrderingCriterion' + order: + $ref: '#/components/schemas/MatchingDirection' + required: + - disperType + + ClassCriterion: + description: > + Indicates the dispersion class criterion for fixed, camper and/or traveller UE, and/or the + top-heavy UE dispersion class criterion. + type: object + properties: + disperClass: + $ref: '#/components/schemas/DispersionClass' + classThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + thresMatch: + $ref: '#/components/schemas/MatchingDirection' + required: + - disperClass + - classThreshold + - thresMatch + + RankingCriterion: + description: Indicates the usage ranking criterion between the high, medium and low usage UE. + type: object + properties: + highBase: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + lowBase: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + required: + - highBase + - lowBase + DispersionInfo: + description: > + Represents the Dispersion information. When subscribed event is "DISPERSION", the + "disperInfos" attribute shall be included. + type: object + properties: + tsStart: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tsDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + disperCollects: + type: array + items: + $ref: '#/components/schemas/DispersionCollection' + minItems: 1 + disperType: + $ref: '#/components/schemas/DispersionType' + required: + - tsStart + - tsDuration + - disperCollects + - disperType + + DispersionCollection: + description: Dispersion collection per UE location or per slice. + type: object + properties: + ueLoc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + supis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + minItems: 1 + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + appVolumes: + type: array + items: + $ref: '#/components/schemas/ApplicationVolume' + minItems: 1 + disperAmount: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + disperClass: + $ref: '#/components/schemas/DispersionClass' + usageRank: + type: integer + description: Integer where the allowed values correspond to 1, 2, 3 only. + minimum: 1 + maximum: 3 + percentileRank: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + ueRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + allOf: + - oneOf: + - required: [ueLoc] + - required: [snssai] + - anyOf: + - required: [disperAmount] + - required: [disperClass] + - required: [usageRank] + - required: [percentileRank] + + ApplicationVolume: + description: Application data volume per Application Id. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + appVolume: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + required: + - appId + - appVolume + + RedundantTransmissionExpReq: + description: Represents other redundant transmission experience analytics requirements. + type: object + properties: + redTOrderCriter: + $ref: '#/components/schemas/RedTransExpOrderingCriterion' + order: + $ref: '#/components/schemas/MatchingDirection' + + RedundantTransmissionExpInfo: + description: > + The redundant transmission experience related information. When subscribed event is + "RED_TRANS_EXP", the "redTransInfos" attribute shall be included. + type: object + properties: + spatialValidCon: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + redTransExps: + type: array + items: + $ref: '#/components/schemas/RedundantTransmissionExpPerTS' + minItems: 1 + required: + - redTransExps + + RedundantTransmissionExpPerTS: + description: The redundant transmission experience per Time Slot. + type: object + properties: + tsStart: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tsDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + obsvRedTransExp: + $ref: '#/components/schemas/ObservedRedundantTransExp' + redTransStatus: + type: boolean + description: > + Redundant Transmission Status. Set to "true" if redundant transmission was activated, + otherwise set to "false". Default value is "false" if omitted. + ueRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - tsStart + - tsDuration + - obsvRedTransExp + ObservedRedundantTransExp: + description: Represents the observed redundant transmission experience related information. + type: object + properties: + avgPktDropRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + varPktDropRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + avgPktDropRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketLossRate' + varPktDropRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + avgPktDelayUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + varPktDelayUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + avgPktDelayDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketDelBudget' + varPktDelayDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + + WlanPerformanceReq: + description: Represents other WLAN performance analytics requirements. + type: object + properties: + ssIds: + type: array + items: + type: string + minItems: 1 + bssIds: + type: array + items: + type: string + minItems: 1 + wlanOrderCriter: + $ref: '#/components/schemas/WlanOrderingCriterion' + order: + $ref: '#/components/schemas/MatchingDirection' + + WlanPerformanceInfo: + description: The WLAN performance related information. + type: object + properties: + networkArea: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + wlanPerSsidInfos: + type: array + items: + $ref: '#/components/schemas/WlanPerSsIdPerformanceInfo' + minItems: 1 + required: + - wlanPerSsidInfos + + WlanPerSsIdPerformanceInfo: + description: The WLAN performance per SSID. + type: object + properties: + ssId: + type: string + wlanPerTsInfos: + type: array + items: + $ref: '#/components/schemas/WlanPerTsPerformanceInfo' + minItems: 1 + required: + - ssId + - wlanPerTsInfos + + WlanPerTsPerformanceInfo: + description: WLAN performance information per Time Slot during the analytics target period. + type: object + properties: + tsStart: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + tsDuration: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + rssi: + type: integer + rtt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + trafficInfo: + $ref: '#/components/schemas/TrafficInformation' + numberOfUes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - tsStart + - tsDuration + anyOf: + - required: [rssi] + - required: [rtt] + - required: [trafficInfo] + - required: [numberOfUes] + + TrafficInformation: + description: Traffic information including UL/DL data rate and/or Traffic volume. + type: object + properties: + uplinkRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + downlinkRate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + uplinkVolume: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + downlinkVolume: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + totalVolume: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Volume' + anyOf: + - required: [uplinkRate] + - required: [downlinkRate] + - required: [uplinkVolume] + - required: [downlinkVolume] + - required: [totalVolume] + + AppListForUeComm: + description: Represents the analytics of the application list used by UE. + type: object + properties: + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + appDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + occurRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + spatialValidity: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + required: + - appId + + SessInactTimerForUeComm: + description: Represents the N4 Session inactivity timer. + type: object + properties: + n4SessId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + sessInactiveTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + required: + - n4SessId + - sessInactiveTimer + + DnPerformanceReq: + description: Represents other DN performance analytics requirements. + type: object + properties: + dnPerfOrderCriter: + $ref: '#/components/schemas/DnPerfOrderingCriterion' + order: + $ref: '#/components/schemas/MatchingDirection' + reportThresholds: + type: array + items: + $ref: '#/components/schemas/ThresholdLevel' + minItems: 1 + + RatFreqInformation: + description: Represents the RAT type and/or Frequency information. + type: object + properties: + allFreq: + type: boolean + description: > + Set to "true" to indicate to handle all the frequencies the NWDAF received, otherwise + set to "false" or omit. The "allFreq" attribute and the "freq" attribute are mutually + exclusive. + allRat: + type: boolean + description: > + Set to "true" to indicate to handle all the RAT Types the NWDAF received, otherwise + set to "false" or omit. The "allRat" attribute and the "ratType" attribute are mutually + exclusive. + freq: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ArfcnValueNR' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + svcExpThreshold: + $ref: '#/components/schemas/ThresholdLevel' + matchingDir: + $ref: '#/components/schemas/MatchingDirection' + + PrevSubInfo: + description: Information of the previous subscription. + type: object + properties: + producerId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + producerSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + subscriptionId: + type: string + description: The identifier of a subscription. + nfAnaEvents: + type: array + items: + $ref: '#/components/schemas/NwdafEvent' + minItems: 1 + ueAnaEvents: + type: array + items: + $ref: '#/components/schemas/UeAnalyticsContextDescriptor' + minItems: 1 + required: + - subscriptionId + oneOf: + - required: [producerId] + - required: [producerSetId] + + ResourceUsage: + description: > + The current usage of the virtual resources assigned to the NF instances belonging to a + particular network slice instance. + type: object + properties: + cpuUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + memoryUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + storageUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + + ConsumerNfInformation: + description: Represents the analytics consumer NF Information. + type: object + properties: + nfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + oneOf: + - oneOf: + - required: [nfId] + - required: [nfSetId] + - required: [taiList] + +# +# ENUMERATIONS DATA TYPES +# + NotificationMethod: + anyOf: + - type: string + enum: + - PERIODIC + - THRESHOLD + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - PERIODIC: The subscribe of NWDAF Event is periodically. The periodic of the notification is identified by repetitionPeriod defined in clause 5.1.6.2.3. + - THRESHOLD: The subscribe of NWDAF Event is upon threshold exceeded. + + NwdafEvent: + anyOf: + - type: string + enum: + - SLICE_LOAD_LEVEL + - NETWORK_PERFORMANCE + - NF_LOAD + - SERVICE_EXPERIENCE + - UE_MOBILITY + - UE_COMMUNICATION + - QOS_SUSTAINABILITY + - ABNORMAL_BEHAVIOUR + - USER_DATA_CONGESTION + - NSI_LOAD_LEVEL + - DN_PERFORMANCE + - DISPERSION + - RED_TRANS_EXP + - WLAN_PERFORMANCE + - SM_CONGESTION + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - SLICE_LOAD_LEVEL: Indicates that the event subscribed is load level information of Network Slice + - NETWORK_PERFORMANCE: Indicates that the event subscribed is network performance information. + - NF_LOAD: Indicates that the event subscribed is load level and status of one or several Network Functions. + - SERVICE_EXPERIENCE: Indicates that the event subscribed is service experience. + - UE_MOBILITY: Indicates that the event subscribed is UE mobility information. + - UE_COMMUNICATION: Indicates that the event subscribed is UE communication information. + - QOS_SUSTAINABILITY: Indicates that the event subscribed is QoS sustainability. + - ABNORMAL_BEHAVIOUR: Indicates that the event subscribed is abnormal behaviour. + - USER_DATA_CONGESTION: Indicates that the event subscribed is user data congestion information. + - NSI_LOAD_LEVEL: Indicates that the event subscribed is load level information of Network Slice and the optionally associated Network Slice Instance + - DN_PERFORMANCE: Indicates that the event subscribed is DN performance information. + - DISPERSION: Indicates that the event subscribed is dispersion information. + - RED_TRANS_EXP: Indicates that the event subscribed is redundant transmission experience. + - WLAN_PERFORMANCE: Indicates that the event subscribed is WLAN performance. + - SM_CONGESTION: Indicates the Session Management Congestion Control Experience information for specific DNN and/or S-NSSAI. + + Accuracy: + anyOf: + - type: string + enum: + - LOW + - HIGH + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - LOW: Low accuracy. + - HIGH: High accuracy. + + CongestionType: + anyOf: + - type: string + enum: + - USER_PLANE + - CONTROL_PLANE + - USER_AND_CONTROL_PLANE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - USER_PLANE: The congestion analytics type is User Plane. + - CONTROL_PLANE: The congestion analytics type is Control Plane. + - USER_AND_CONTROL_PLANE: The congestion analytics type is User Plane and Control Plane. + + ExceptionId: + anyOf: + - type: string + enum: + - UNEXPECTED_UE_LOCATION + - UNEXPECTED_LONG_LIVE_FLOW + - UNEXPECTED_LARGE_RATE_FLOW + - UNEXPECTED_WAKEUP + - SUSPICION_OF_DDOS_ATTACK + - WRONG_DESTINATION_ADDRESS + - TOO_FREQUENT_SERVICE_ACCESS + - UNEXPECTED_RADIO_LINK_FAILURES + - PING_PONG_ACROSS_CELLS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNEXPECTED_UE_LOCATION: Unexpected UE location + - UNEXPECTED_LONG_LIVE_FLOW: Unexpected long-live rate flows + - UNEXPECTED_LARGE_RATE_FLOW: Unexpected large rate flows + - UNEXPECTED_WAKEUP: Unexpected wakeup + - SUSPICION_OF_DDOS_ATTACK: Suspicion of DDoS attack + - WRONG_DESTINATION_ADDRESS: Wrong destination address + - TOO_FREQUENT_SERVICE_ACCESS: Too frequent Service Access + - UNEXPECTED_RADIO_LINK_FAILURES: Unexpected radio link failures + - PING_PONG_ACROSS_CELLS: Ping-ponging across neighbouring cells + + ExceptionTrend: + anyOf: + - type: string + enum: + - UP + - DOWN + - UNKNOW + - STABLE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UP: Up trend of the exception level. + - DOWN: Down trend of the exception level. + - UNKNOW: Unknown trend of the exception level. + - STABLE: Stable trend of the exception level. + + TimeUnit: + anyOf: + - type: string + enum: + - MINUTE + - HOUR + - DAY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - MINUTE: Time unit is per minute. + - HOUR: Time unit is per hour. + - DAY: Time unit is per day. + + NetworkPerfType: + anyOf: + - type: string + enum: + - GNB_ACTIVE_RATIO + - GNB_COMPUTING_USAGE + - GNB_MEMORY_USAGE + - GNB_DISK_USAGE + - NUM_OF_UE + - SESS_SUCC_RATIO + - HO_SUCC_RATIO + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - GNB_ACTIVE_RATIO: Indicates that the network performance requirement is gNodeB active (i.e. up and running) rate. Indicates the ratio of gNB active (i.e. up and running) number to the total number of gNB + - GNB_COMPUTING_USAGE: Indicates gNodeB computing resource usage. + - GNB_MEMORY_USAGE: Indicates gNodeB memory usage. + - GNB_DISK_USAGE: Indicates gNodeB disk usage. + - NUM_OF_UE: Indicates number of UEs. + - SESS_SUCC_RATIO: Indicates ratio of successful setup of PDU sessions to total PDU session setup attempts. + - HO_SUCC_RATIO: Indicates Ratio of successful handovers to the total handover attempts. + + ExpectedAnalyticsType: + anyOf: + - type: string + enum: + - MOBILITY + - COMMUN + - MOBILITY_AND_COMMUN + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - MOBILITY: Mobility related abnormal behaviour analytics is expected by the consumer. + - COMMUN: Communication related abnormal behaviour analytics is expected by the consumer. + - MOBILITY_AND_COMMUN: Both mobility and communication related abnormal behaviour analytics is expected by the consumer. + + MatchingDirection: + anyOf: + - type: string + enum: + - ASCENDING + - DESCENDING + - CROSSED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - ASCENDING: Threshold is crossed in ascending direction. + - DESCENDING: Threshold is crossed in descending direction. + - CROSSED: Threshold is crossed either in ascending or descending direction. + + NwdafFailureCode: + anyOf: + - type: string + enum: + - UNAVAILABLE_DATA + - BOTH_STAT_PRED_NOT_ALLOWED + - UNSATISFIED_REQUESTED_ANALYTICS_TIME + - OTHER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNAVAILABLE_DATA: Indicates the requested statistics information for the event is rejected since necessary data to perform the service is unavailable. + - BOTH_STAT_PRED_NOT_ALLOWED: Indicates the requested analysis information for the event is rejected since the start time is in the past and the end time is in the future, which means the NF service consumer requested both statistics and prediction for the analytics. + - UNSATISFIED_REQUESTED_ANALYTICS_TIME: Indicates that the requested event is rejected since the analytics information is not ready when the time indicated by the "timeAnaNeeded" attribute (as provided during the creation or modification of subscription) is reached. + - OTHER: Indicates the requested analysis information for the event is rejected due to other reasons. + + AnalyticsMetadata: + anyOf: + - type: string + enum: + - NUM_OF_SAMPLES + - DATA_WINDOW + - DATA_STAT_PROPS + - STRATEGY + - ACCURACY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - NUM_OF_SAMPLES: Number of data samples used for the generation of the output analytics. + - DATA_WINDOW: Data time window of the data samples. + - DATA_STAT_PROPS: Dataset statistical properties of the data used to generate the analytics. + - STRATEGY: Output strategy used for the reporting of the analytics. + - ACCURACY: Level of accuracy reached for the analytics. + + DatasetStatisticalProperty: + anyOf: + - type: string + enum: + - UNIFORM_DIST_DATA + - NO_OUTLIERS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNIFORM_DIST_DATA: Indicates the use of data samples that are uniformly distributed according to the different aspects of the requested analytics. + - NO_OUTLIERS: Indicates that the data samples shall disregard data samples that are at the extreme boundaries of the value range. + + OutputStrategy: + anyOf: + - type: string + enum: + - BINARY + - GRADIENT + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - BINARY: Indicates that the analytics shall only be reported when the requested level of accuracy is reached within a cycle of periodic notification. + - GRADIENT: Indicates that the analytics shall be reported according with the periodicity irrespective of whether the requested level of accuracy has been reached or not. + + TransferRequestType: + anyOf: + - type: string + enum: + - PREPARE + - TRANSFER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - PREPARE: Indicates that the request is for analytics subscription transfer preparation. + - TRANSFER: Indicates that the request is for analytics subscription transfer execution. + + AnalyticsSubset: + anyOf: + - type: string + enum: + - NUM_OF_UE_REG + - NUM_OF_PDU_SESS_ESTBL + - RES_USAGE + - NUM_OF_EXCEED_RES_USAGE_LOAD_LEVEL_THR + - PERIOD_OF_EXCEED_RES_USAGE_LOAD_LEVEL_THR + - EXCEED_LOAD_LEVEL_THR_IND + - LIST_OF_TOP_APP_UL + - LIST_OF_TOP_APP_DL + - NF_STATUS + - NF_RESOURCE_USAGE + - NF_LOAD + - NF_PEAK_LOAD + - NF_LOAD_AVG_IN_AOI + - DISPER_AMOUNT + - DISPER_CLASS + - RANKING + - PERCENTILE_RANKING + - RSSI + - RTT + - TRAFFIC_INFO + - NUMBER_OF_UES + - APP_LIST_FOR_UE_COMM + - N4_SESS_INACT_TIMER_FOR_UE_COMM + - AVG_TRAFFIC_RATE + - MAX_TRAFFIC_RATE + - AVG_PACKET_DELAY + - MAX_PACKET_DELAY + - AVG_PACKET_LOSS_RATE + - UE_LOCATION + - LIST_OF_HIGH_EXP_UE + - LIST_OF_MEDIUM_EXP_UE + - LIST_OF_LOW_EXP_UE + - AVG_UL_PKT_DROP_RATE + - VAR_UL_PKT_DROP_RATE + - AVG_DL_PKT_DROP_RATE + - VAR_DL_PKT_DROP_RATE + - AVG_UL_PKT_DELAY + - VAR_UL_PKT_DELAY + - AVG_DL_PKT_DELAY + - VAR_DL_PKT_DELAY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - NUM_OF_UE_REG: The number of UE registered. This value is only applicable to NSI_LOAD_LEVEL event. + - NUM_OF_PDU_SESS_ESTBL: The number of PDU sessions established. This value is only applicable to NSI_LOAD_LEVEL event. + - RES_USAGE: The current usage of the virtual resources assigned to the NF instances belonging to a particular network slice instance. This value is only applicable to NSI_LOAD_LEVEL event. + - NUM_OF_EXCEED_RES_USAGE_LOAD_LEVEL_THR: The number of times the resource usage threshold of the network slice instance is reached or exceeded if a threshold value is provided by the consumer. This value is only applicable to NSI_LOAD_LEVEL event. + - PERIOD_OF_EXCEED_RES_USAGE_LOAD_LEVEL_THR: The time interval between each time the threshold being met or exceeded on the network slice (instance). This value is only applicable to NSI_LOAD_LEVEL event. + - EXCEED_LOAD_LEVEL_THR_IND: Whether the Load Level Threshold is met or exceeded by the statistics value. This value is only applicable to NSI_LOAD_LEVEL event. + - LIST_OF_TOP_APP_UL: The list of applications that contribute the most to the traffic in the UL direction. This value is only applicable to USER_DATA_CONGESTION event. + - LIST_OF_TOP_APP_DL: The list of applications that contribute the most to the traffic in the DL direction. This value is only applicable to USER_DATA_CONGESTION event. + - NF_STATUS: The availability status of the NF on the Analytics target period, expressed as a percentage of time per status value (registered, suspended, undiscoverable). This value is only applicable to NF_LOAD event. + - NF_RESOURCE_USAGE: The average usage of assigned resources (CPU, memory, storage). This value is only applicable to NF_LOAD event. + - NF_LOAD: The average load of the NF instance over the Analytics target period. This value is only applicable to NF_LOAD event. + - NF_PEAK_LOAD: The maximum load of the NF instance over the Analytics target period. This value is only applicable to NF_LOAD event. + - NF_LOAD_AVG_IN_AOI: The average load of the NF instances over the area of interest. This value is only applicable to NF_LOAD event. + - DISPER_AMOUNT: Indicates the dispersion amount of the reported data volume or transaction dispersion type. This value is only applicable to DISPERSION event. + - DISPER_CLASS: Indicates the dispersion mobility class: fixed, camper, traveller upon set its usage threshold, and/or the top-heavy class upon set its percentile rating threshold. This value is only applicable to DISPERSION event. + - RANKING: Data/transaction usage ranking high (i.e.value 1), medium (2) or low (3). This value is only applicable to DISPERSION event. + - PERCENTILE_RANKING: Percentile ranking of the target UE in the Cumulative Distribution Function of data usage for the population of all UEs. This value is only applicable to DISPERSION event. + - RSSI: Indicated the RSSI in the unit of dBm. This value is only applicable to WLAN_PERFORMANCE event. + - RTT: Indicates the RTT in the unit of millisecond. This value is only applicable to WLAN_PERFORMANCE event. + - TRAFFIC_INFO: Traffic information including UL/DL data rate and/or Traffic volume. This value is only applicable to WLAN_PERFORMANCE event. + - NUMBER_OF_UES: Number of UEs observed for the SSID. This value is only applicable to WLAN_PERFORMANCE event. + - APP_LIST_FOR_UE_COMM: The analytics of the application list used by UE. This value is only applicable to UE_COMM event. + - N4_SESS_INACT_TIMER_FOR_UE_COMM: The N4 Session inactivity timer. This value is only applicable to UE_COMM event. + - AVG_TRAFFIC_RATE: Indicates average traffic rate. This value is only applicable to DN_PERFORMANCE event. + - MAX_TRAFFIC_RATE: Indicates maximum traffic rate. This value is only applicable to DN_PERFORMANCE event. + - AVG_PACKET_DELAY: Indicates average Packet Delay. This value is only applicable to DN_PERFORMANCE event. + - MAX_PACKET_DELAY: Indicates maximum Packet Delay. This value is only applicable to DN_PERFORMANCE event. + - AVG_PACKET_LOSS_RATE: Indicates average Loss Rate. This value is only applicable to DN_PERFORMANCE event. + - UE_LOCATION: Indicates UE location information. This value is only applicable to SERVICE_EXPERIENCE event. + - LIST_OF_HIGH_EXP_UE: Indicates list of high experienced UE. This value is only applicable to SM_CONGESTION event. + - LIST_OF_MEDIUM_EXP_UE: Indicates list of medium experienced UE. This value is only applicable to SM_CONGESTION event. + - LIST_OF_LOW_EXP_UE: Indicates list of low experienced UE. This value is only applicable to SM_CONGESTION event. + - AVG_UL_PKT_DROP_RATE: Indicates average uplink packet drop rate on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - VAR_UL_PKT_DROP_RATE: Indicates variance of uplink packet drop rate on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - AVG_DL_PKT_DROP_RATE: Indicates average downlink packet drop rate on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - VAR_DL_PKT_DROP_RATE: Indicates variance of downlink packet drop rate on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - AVG_UL_PKT_DELAY: Indicates average uplink packet delay round trip on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - VAR_UL_PKT_DELAY: Indicates variance uplink packet delay round trip on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - AVG_DL_PKT_DELAY: Indicates average downlink packet delay round trip on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + - VAR_DL_PKT_DELAY: Indicates variance downlink packet delay round trip on GTP-U path on N3. This value is only applicable to RED_TRANS_EXP event. + + DispersionType: + oneOf: + - type: string + enum: + - DVDA + - TDA + - DVDA_AND_TDA + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - DVDA: Data Volume Dispersion Analytics. + - TDA: Transactions Dispersion Analytics. + - DVDA_AND_TDA: Data Volume Dispersion Analytics and Transactions Dispersion Analytics. + + DispersionClass: + oneOf: + - type: string + enum: + - FIXED + - CAMPER + - TRAVELLER + - TOP_HEAVY + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - FIXED: Dispersion class as fixed UE its data or transaction usage at a location or a slice, is higher than its class threshold set for its all data or transaction usage. + - CAMPER: Dispersion class as camper UE, its data or transaction usage at a location or a slice, is higher than its class threshold and lower than the fixed class threshold set for its all data or transaction usage.. + - TRAVELLER: Dispersion class as traveller UE, its data or transaction usage at a location or a slice, is lower than the camper class threshold set for its all data or transaction usage. + - TOP_HEAVY: Dispersion class as Top_Heavy UE, who's dispersion percentile rating at a location or a slice, is higher than its class threshold. + + DispersionOrderingCriterion: + anyOf: + - type: string + enum: + - TIME_SLOT_START + - DISPERSION + - CLASSIFICATION + - RANKING + - PERCENTILE_RANKING + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - TIME_SLOT_START: Indicates the order of time slot start. + - DISPERSION: Indicates the order of data/transaction dispersion. + - CLASSIFICATION: Indicates the order of data/transaction classification. + - RANKING: Indicates the order of data/transaction ranking. + - PERCENTILE_RANKING: Indicates the order of data/transaction percentile ranking. + + RedTransExpOrderingCriterion: + anyOf: + - type: string + enum: + - TIME_SLOT_START + - RED_TRANS_EXP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - TIME_SLOT_START: Indicates the order of time slot start. + - RED_TRANS_EXP: Indicates the order of Redundant Transmission Experience. + + WlanOrderingCriterion: + anyOf: + - type: string + enum: + - TIME_SLOT_START + - NUMBER_OF_UES + - RSSI + - RTT + - TRAFFIC_INFO + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - TIME_SLOT_START: Indicates the order of time slot start. + - NUMBER_OF_UES: Indicates the order of number of UEs. + - RSSI: Indicates the order of RSSI. + - RTT: Indicates the order of RTT. + - TRAFFIC_INFO: Indicates the order of Traffic information. + + ServiceExperienceType: + anyOf: + - type: string + enum: + - VOICE + - VIDEO + - OTHER + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - VOICE: Indicates that the service experience analytics is for voice service. + - VIDEO: Indicates that the service experience analytics is for video service. + - OTHER: Indicates that the service experience analytics is for other service. + + DnPerfOrderingCriterion: + anyOf: + - type: string + enum: + - AVERAGE_TRAFFIC_RATE + - MAXIMUM_TRAFFIC_RATE + - AVERAGE_PACKET_DELAY + - MAXIMUM_PACKET_DELAY + - AVERAGE_PACKET_LOSS_RATE + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - AVERAGE_TRAFFIC_RATE: Indicates the average traffic rate. + - MAXIMUM_TRAFFIC_RATE: Indicates the maximum traffic rate. + - AVERAGE_PACKET_DELAY: Indicates the average packet delay. + - MAXIMUM_PACKET_DELAY: Indicates the maximum packet delay. + - AVERAGE_PACKET_LOSS_RATE: Indicates the average packet loss rate. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_MLModelProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_MLModelProvision.yaml new file mode 100644 index 000000000..f9199a886 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29520_Nnwdaf_MLModelProvision.yaml @@ -0,0 +1,340 @@ +openapi: 3.0.0 +info: + title: Nnwdaf_MLModelProvision + version: 1.0.0 + description: | + Nnwdaf_MLModelProvision API Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.520 V17.7.0; 5G System; Network Data Analytics Services. + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.520/ +servers: + - url: '{apiRoot}/nnwdaf-mlmodelprovision/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nnwdaf-mlmodelprovision +paths: + /subscriptions: + post: + summary: Create a new Individual NWDAF ML Model Provision Subscription resource. + operationId: CreateNWDAFMLModelProvisionSubcription + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafMLModelProvSubsc' + responses: + '201': + description: Create a new Individual NWDAF ML Model Provision Subscription resource. + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafMLModelProvSubsc' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnwdaf-mlmodelprovision/v1/subscriptions/{subscriptionId}. + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NwdafMLModelProvNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was succesfull + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subscriptionId}: + put: + summary: update an existing Individual NWDAF ML Model Provision Subscription + operationId: UpdateNWDAFMLModelProvisionSubcription + tags: + - Individual NWDAF ML Model Provision Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafMLModelProvSubsc' + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Nnwdaf_MLModelProvision Service. + required: true + schema: + type: string + responses: + '200': + description: > + The Individual NWDAF ML Model Provision Subscription resource was modified successfully + and a representation of that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/NwdafMLModelProvSubsc' + '204': + description: > + The Individual NWDAF ML Model Provision Subscription resource was modified successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an existing Individual NWDAF ML Model Provision Subscription. + operationId: DeleteNWDAFMLModelProvisionSubcription + tags: + - Individual NWDAF ML Model Provision Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: String identifying a subscription to the Nnwdaf_MLModelProvision Service. + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual NWDAF ML Model Provision Subscription matching the + subscriptionId was deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnwdaf-mlmodelprovision: Access to the Nnwdaf_MLModelProvision API + schemas: + NwdafMLModelProvSubsc: + description: Represents NWDAF Event Subscription resources. + type: object + properties: + mLEventSubscs: + type: array + items: + $ref: '#/components/schemas/MLEventSubscription' + minItems: 1 + description: Subscribed events + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + mLEventNotifs: + type: array + items: + $ref: '#/components/schemas/MLEventNotif' + minItems: 1 + suppFeats: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + notifCorreId: + type: string + eventReq: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + failEventReports: + type: array + items: + $ref: '#/components/schemas/FailureEventInfoForMLModel' + minItems: 1 + required: + - mLEventSubscs + - notifUri + MLEventSubscription: + description: Represents a subscription to a single event. + type: object + properties: + mLEvent: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + mLEventFilter: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/EventFilter' + tgtUe: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/TargetUeInformation' + mLTargetPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + expiryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - mLEvent + - mLEventFilter + NwdafMLModelProvNotif: + description: Represents notifications on events that occurred. + type: object + properties: + eventNotifs: + type: array + items: + $ref: '#/components/schemas/MLEventNotif' + minItems: 1 + description: Notifications about Individual Events. + subscriptionId: + type: string + description: String identifying a subscription to the Nnwdaf_MLModelProvision Service. + required: + - eventNotifs + - subscriptionId + MLEventNotif: + description: Represents a notification related to a single event that occurred. + type: object + properties: + event: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + notifCorreId: + type: string + mLFileAddr: + $ref: '#/components/schemas/MLModelAddr' + validityPeriod: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + spatialValidity: + $ref: 'TS29554_Npcf_BDTPolicyControl.yaml#/components/schemas/NetworkAreaInfo' + required: + - event + - mLFileAddr + FailureEventInfoForMLModel: + description: > + Represents the event(s) that the subscription is not successful including the failure + reason(s). + type: object + properties: + event: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafEvent' + failureCode: + $ref: '#/components/schemas/FailureCode' + required: + - event + - failureCode + + MLModelAddr: + description: Addresses of ML model files. + type: object + properties: + mLModelUrl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + mlFileFqdn: + type: string + description: The FQDN of the ML Model file. + oneOf: + - required: [mLModelUrl] + - required: [mlFileFqdn] + +# +# ENUMERATIONS DATA TYPES +# + FailureCode: + anyOf: + - type: string + enum: + - UNAVAILABLE_ML_MODEL + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: > + Possible values are + - UNAVAILABLE_ML_MODEL: Indicates the requested ML model for the event is unavailable. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29521_Nbsf_Management.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29521_Nbsf_Management.yaml new file mode 100644 index 000000000..35cb874bf --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29521_Nbsf_Management.yaml @@ -0,0 +1,1320 @@ +openapi: 3.0.0 + +info: + version: 1.3.1 + title: Nbsf_Management + description: | + Binding Support Management Service API. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.521 V17.7.0; 5G System; Binding Support Management Service. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.521/' + +servers: + - url: '{apiRoot}/nbsf-management/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nbsf-management + +paths: + /pcfBindings: + post: + summary: Create a new Individual PCF for a PDU Session binding information + operationId: CreatePCFBinding + tags: + - PCF Bindings (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcfBinding' + responses: + '201': + description: The creation of an individual PCF for a PDU Session binding. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfBinding' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nbsf-management//pcfBindings/{bindingId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: > + The existing PCF binding information stored in the BSF for the indicated combination is + returned. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtProblemDetails' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read PCF for a PDU Session Bindings information + operationId: GetPCFBindings + tags: + - PCF Bindings (Collection) + parameters: + - name: ipv4Addr + in: query + description: The IPv4 Address of the served UE. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + - name: ipv6Prefix + in: query + description: > + The IPv6 Address of the served UE. The NF service consumer shall append '/128' to the + IPv6 address in the attribute value. E.g. '2001:db8:85a3::8a2e:370:7334/128'. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + - name: macAddr48 + in: query + description: The MAC Address of the served UE. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + - name: dnn + in: query + description: DNN. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + - name: supi + in: query + description: Subscription Permanent Identifier. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: gpsi + in: query + description: Generic Public Subscription Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: snssai + in: query + description: The identification of slice. + required: false + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + - name: ipDomain + in: query + description: The IPv4 address domain identifier. + required: false + schema: + type: string + - name: supp-feat + in: query + description: To filter irrelevant responses related to unsupported features. + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + The individual PCF for a PDU Session binding session binding information resource + matching the query parameter(s) is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfBinding' + '204': + description: > + There is no PCF for a PDU Session binding information matching the query parameter(s). + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcfBindings/{bindingId}: + delete: + summary: Delete an existing Individual PCF for a PDU Session Binding information + operationId: DeleteIndPCFBinding + tags: + - Individual PCF Binding (Document) + parameters: + - name: bindingId + in: path + description: Represents the individual PCF for a PDU Session Binding. + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual PCF for a PDU Session Binding information resource is + deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Update an existing Individual PCF for a PDU Session Binding information + operationId: UpdateIndPCFBinding + tags: + - Individual PCF for a PDU Session Binding (Document) + parameters: + - name: bindingId + in: path + description: Represents the individual PCF for a PDU Session Binding. + required: true + schema: + type: string + requestBody: + description: Parameters to update the existing PCF for a PDU Session binding. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PcfBindingPatch' + responses: + '200': + description: OK (Successful update of the PCF for a PDU Session binding). + content: + application/json: + schema: + $ref: '#/components/schemas/PcfBinding' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions: + post: + operationId: CreateIndividualSubcription + summary: Create an individual subscription for event notifications from the BSF + tags: + - Subscriptions (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BsfSubscription' + responses: + '201': + description: Created. + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nsmf-management//subscriptions/{subId} + required: true + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/BsfSubscriptionResp' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + myNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BsfNotification' + responses: + '204': + description: No Content. Notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions/{subId}: + put: + operationId: ReplaceIndividualSubcription + summary: Replace an individual subscription for event notifications from the BSF + tags: + - IndividualSubscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BsfSubscription' + parameters: + - name: subId + in: path + description: Subscription correlation ID + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was successfully modified and representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BsfSubscriptionResp' + '204': + description: No Content. Resource was successfully modified. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + operationId: DeleteIndividualSubcription + summary: Delete an individual subscription for event notifications from the BSF + tags: + - IndividualSubscription (Document) + parameters: + - name: subId + in: path + description: Subscription correlation ID + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was successfully deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcf-ue-bindings: + post: + summary: Create a new Individual PCF for a UE binding information + operationId: CreatePCFforUEBinding + tags: + - PCF for a UE Bindings (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcfForUeBinding' + responses: + '201': + description: The creation of an individual PCF for a UE binding. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfForUeBinding' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nbsf-management//pcf-ue-bindings/{bindingId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + get: + summary: Read PCF for a UE Bindings information + operationId: GetPCFForUeBindings + tags: + - PCF for a UE Bindings (Collection) + parameters: + - name: supi + in: query + description: Subscription Permanent Identifier. + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + - name: gpsi + in: query + description: Generic Public Subscription Identifier + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + - name: supp-feat + in: query + description: To filter irrelevant responses related to unsupported features. + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + The individual PCF for a UE binding session binding information resource matching the + query parameter(s) is returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PcfForUeBinding' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcf-ue-bindings/{bindingId}: + delete: + summary: Delete an existing Individual PCF for a UE Binding information + operationId: DeleteIndPCFforUEBinding + tags: + - Individual PCF for a UE Binding (Document) + parameters: + - name: bindingId + in: path + description: Represents the individual PCF for a UE Binding. + required: true + schema: + type: string + responses: + '204': + description: > + No Content. The Individual PCF for a UE binding information resource is deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Update an existing Individual PCF for a UE Binding information + operationId: UpdateIndPCFforUEBinding + tags: + - Individual PCF for a UE Binding (Document) + parameters: + - name: bindingId + in: path + description: Represents the individual PCF for a UE Binding. + required: true + schema: + type: string + requestBody: + description: Parameters to update the existing PCF for a UE binding. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PcfForUeBindingPatch' + responses: + '200': + description: OK. Successful update of the PCF for a PDU Session binding. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfForUeBinding' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcf-mbs-bindings: + post: + summary: Create a new Individual PCF for an MBS Session binding. + operationId: CreatePCFMbsBinding + tags: + - PCF for an MBS Session Bindings (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcfMbsBinding' + responses: + '201': + description: > + Created. A new Individual PCF for an MBS Session Binding resource is created + and the corresponding URI is returned in an HTTP Location header. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfMbsBinding' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nbsf-management/v1/pcf-mbs-bindings/{bindingId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + + description: > + The existing PCF binding information stored in the BSF for the MBS session is + returned. + content: + application/problem+json: + schema: + $ref: '#/components/schemas/MbsExtProblemDetails' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve an existing PCF for an MBS Session binding. + operationId: GetPCFMbsBinding + tags: + - PCF for an MBS Session Bindings (Collection) + parameters: + - name: mbs-session-id + in: query + description: > + Contains the identifier of the MBS Session to which the requested MBS Session + binding is related. + required: true + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + - name: supp-feat + in: query + description: > + Contains the list of features supported by the NF service consumer and used to + filter irrelevant responses related to unsupported features. + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + OK. The Individual PCF for an MBS Session Binding resource(s) matching the provided + query parameter(s) are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PcfMbsBinding' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /pcf-mbs-bindings/{bindingId}: + parameters: + - name: bindingId + in: path + description: > + Represents the identifier of the Individual PCF for an MBS Session Binding resource. + required: true + schema: + type: string + + patch: + summary: Request the modification of an existing Individual PCF for an MBS Session Binding resource. + operationId: ModifyIndPCFMbsBinding + tags: + - Individual PCF for an MBS Session Binding (Document) + requestBody: + description: Parameters to request the modification of the PCF for an MBS Session Binding. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PcfMbsBindingPatch' + responses: + '200': + description: > + OK. The Individual PCF for an MBS Session Binding resource is successfully modified and + a representation of the updated resource is returned in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/PcfMbsBinding' + '204': + description: > + No Content. The Individual PCF for an MBS Session Binding resource is successfully + modified and no content is returned in the response body. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the deletion of an existing Individual PCF for an MBS Session Binding. + operationId: DeleteIndPCFMbsBinding + tags: + - Individual PCF for an MBS Session Binding (Document) + responses: + '204': + description: > + No Content. The Individual PCF for an MBS Session Binding resource is successfully + Deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nbsf-management: Access to the Nbsf_Management API + + schemas: + + PcfBinding: + description: Identifies an Individual PCF for a PDU Session binding. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addIpv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: The additional IPv6 Address Prefixes of the served UE. + ipDomain: + type: string + macAddr48: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + addMacAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + description: The additional MAC Addresses of the served UE. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_PolicyAuthorization service + pcfDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + pcfDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + pcfSmFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfSmIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_SMPolicyControl service. + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + paraCom: + $ref: '#/components/schemas/ParameterCombination' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + ipv4FrameRouteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrMask' + minItems: 1 + ipv6FrameRouteList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + required: + - dnn + - snssai + + PcfBindingPatch: + description: Identifies an Individual PCF binding used in an HTTP Patch method. + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrRm' + ipDomain: + type: string + nullable: true + ipv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6PrefixRm' + addIpv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: The additional IPv6 Address Prefixes of the served UE. + nullable: true + macAddr48: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48Rm' + addMacAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + description: The additional MAC Addresses of the served UE. + nullable: true + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_PolicyAuthorization service. + pcfDiamHost: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + pcfDiamRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + + ParameterCombination: + description: > + Represents the combination used by the BSF to check whether there is an existing PCF binding + information. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + ExtProblemDetails: + description: > + Contains the FQDN or IP endpoints of the existing PCF and the cause value if there is an + existing PCF binding information for the indicated combination. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/BindingResp' + + MbsExtProblemDetails: + description: > + Contains the FQDN or IP endpoints of the existing PCF and the cause value if there is an + existing PCF binding information for the MBS session. + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/MbsBindingResp' + + BindingResp: + description: Contains the binding information for a PCF for a PDU Session. + type: object + properties: + pcfSmFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfSmIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_SMPolicyControl service. + + MbsBindingResp: + description: Contains the binding information for a PCF for an MBS Session. + type: object + properties: + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF handling the MBS Session. + + BsfSubscription: + description: Contains the event subscription data. + type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/BsfEvent' + minItems: 1 + description: Contain te subscribed events. + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifCorreId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + snssaiDnnPairs: + $ref: '#/components/schemas/SnssaiDnnPair' + addSnssaiDnnPairs: + type: array + items: + $ref: '#/components/schemas/SnssaiDnnPair' + minItems: 1 + description: > + Represents the additional S-NSSAI and DNN pair(s) for which the binding event report(s) + shall apply. + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - events + - notifUri + - notifCorreId + - supi + + BsfNotification: + description: Contains the event notifications. + type: object + properties: + notifCorreId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + eventNotifs: + type: array + items: + $ref: '#/components/schemas/BsfEventNotification' + minItems: 1 + description: Notifications about Individual Events. + required: + - notifCorreId + - eventNotifs + + BsfEventNotification: + description: Contains an event notification. + type: object + properties: + event: + $ref: '#/components/schemas/BsfEvent' + pcfForUeInfo: + $ref: '#/components/schemas/PcfForUeInfo' + pcfForPduSessInfos: + type: array + items: + $ref: '#/components/schemas/PcfForPduSessionInfo' + minItems: 1 + description: The information of the PCF for a PDU session. + matchSnssaiDnns: + type: array + items: + $ref: '#/components/schemas/SnssaiDnnPair' + minItems: 1 + description: Matching S-NSSAI and DNN pairs. + required: + - event + + PcfForUeInfo: + description: Contains the information of the PCF for a UE. + type: object + properties: + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_AmPolicyAuthorization service. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + + PcfForPduSessionInfo: + description: Contains the informaiton of the PCF for a PDU session. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_AmPolicyAuthorization service. + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4AddrRm' + ipDomain: + type: string + ipv6Prefixes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + minItems: 1 + description: The IPv6 Address Prefixes of the served UE. + macAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + description: The MAC Addresses of the served UE. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + required: + - snssai + - dnn + + PcfForUeBinding: + description: Identifies an Individual PCF for a UE binding. + type: object + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + pcfForUeFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfForUeIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_AmPolicyAuthorization service. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - supi + anyOf: + - required: [pcfForUeFqdn] + - required: [pcfForUeIpEndPoints] + + + PcfForUeBindingPatch: + description: Identifies the updates of an Individual PCF for a UE binding. + type: object + properties: + pcfForUeFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfForUeIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + description: IP end points of the PCF hosting the Npcf_AmPolicyAuthorization service. + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + SnssaiDnnPair: + description: Contains a S-NSSAI and DNN combination. + type: object + required: + - snssai + - dnn + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + PcfMbsBinding: + description: Represents an Individual PCF for an MBS Session binding. + type: object + properties: + mbsSessionId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionId' + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + pcfSetId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfSetId' + bindLevel: + $ref: '#/components/schemas/BindingLevel' + recoveryTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - mbsSessionId + + PcfMbsBindingPatch: + description: > + Represents the requested modification to an Individual PCF for an MBS Session binding. + type: object + properties: + pcfFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + pcfIpEndPoints: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/IpEndPoint' + minItems: 1 + pcfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + + BindingLevel: + anyOf: + - type: string + enum: + - NF_SET + - NF_INSTANCE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - "NF_SET" + - "NF_INSTANCE" + + BsfEvent: + description: Represents an event to be notified by the BSF. + anyOf: + - type: string + enum: + - PCF_PDU_SESSION_BINDING_REGISTRATION + - PCF_PDU_SESSION_BINDING_DEREGISTRATION + - PCF_UE_BINDING_REGISTRATION + - PCF_UE_BINDING_DEREGISTRATION + - SNSSAI_DNN_BINDING_REGISTRATION + - SNSSAI_DNN_BINDING_DEREGISTRATION + - type: string + + BsfSubscriptionResp: + description: > + It represents a response to a modification or creation request of an Individual Binding + Subscription resource. It may contain the notification of the already met events. + anyOf: + - $ref: '#/components/schemas/BsfSubscription' + - $ref: '#/components/schemas/BsfNotification' \ No newline at end of file diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_5GLANParameterProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_5GLANParameterProvision.yaml new file mode 100644 index 000000000..465b1262c --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_5GLANParameterProvision.yaml @@ -0,0 +1,483 @@ +openapi: 3.0.0 +info: + title: 3gpp-5glan-pp + version: 1.1.1 + description: | + API for 5G LAN Parameter Provision. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-5glan-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/subscriptions: + get: + summary: read all of the active subscriptions for the AF + operationId: RealAllSubscriptions + tags: + - 5GLAN Parameters Provision Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/5GLanParametersProvision' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateAnSubscription + tags: + - 5GLAN Parameters Provision Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new subscription creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual 5GLAN Parameters Provision Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual 5GLAN Parameters Provision Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + responses: + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates an existing subscription resource + operationId: PartialUpdateAnSubscription + tags: + - Individual 5GLAN Parameters Provision Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/5GLanParametersProvisionPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/5GLanParametersProvision' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual 5GLAN Parameters Provision Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + 5GLanParametersProvision: + description: Represents an individual 5G LAN parameters provision subscription resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + 5gLanParams: + $ref: '#/components/schemas/5GLanParameters' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - 5gLanParams + - suppFeat + 5GLanParametersProvisionPatch: + description: > + Represents the 5G LAN parameters to request the modification of a subscription + to provision parameters. + type: object + properties: + 5gLanParamsPatch: + $ref: '#/components/schemas/5GLanParametersPatch' + 5GLanParameters: + description: Represents 5G LAN service related parameters that need to be provisioned. + type: object + properties: + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsis: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minProperties: 1 + description: > + Contains the list of 5G VN Group members, each member is identified by GPSI. + Any string value can be used as a key of the map. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + aaaIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + aaaIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + aaaUsgs: + type: array + items: + $ref: '#/components/schemas/AaaUsage' + minItems: 1 + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + sessionType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sessionTypes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + minItems: 1 + description: Further allowed PDU Session types. + appDesps: + type: object + additionalProperties: + $ref: '#/components/schemas/AppDescriptor' + minProperties: 1 + description: Describes the operation systems and the corresponding applications for each operation systems. The key of map is osId. + required: + - exterGroupId + - gpsis + - dnn + - snssai + - sessionType + - appDesps + 5GLanParametersPatch: + description: Represents 5G LAN service related parameters that need to be modified. + type: object + properties: + gpsis: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GpsiRm' + minProperties: 1 + description: > + Contains the list of 5G VN Group members, each member is identified by GPSI. + Any string value can be used as a key of the map. + appDesps: + type: object + additionalProperties: + $ref: '#/components/schemas/AppDescriptorRm' + minProperties: 1 + description: > + Describes the operation systems and the corresponding applications for + each operation systems. The key of map is osId. + AppDescriptor: + description: Represents an operation system and the corresponding applications. + type: object + properties: + osId: + $ref: 'TS29519_Policy_Data.yaml#/components/schemas/OsId' + appIds: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minProperties: 1 + description: > + Identifies applications that are running on the UE's operating system. + Any string value can be used as a key of the map. + required: + - osId + - appIds + AppDescriptorRm: + description: > + Represents the same as the AppDescriptor data type but with the nullable:true + property. + type: object + properties: + appIds: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationIdRm' + minProperties: 1 + description: > + Identifies applications that are running on the UE's operating system. + Any string value can be used as a key of the map. + AaaUsage: + anyOf: + - type: string + enum: + - AUTH + - IP_ALLOC + - type: string + description: > + This string identifies the usage of secondary authentication/authorization, + and/or UE IP address allocation from the DN-AAA server. + description: | + Possible values are: + - AUTH: secondary authentication/authorization needed from DN-AAA server + - IP_ALLOC: UE IP address allocation needed from DN-AAA server diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ACSParameterProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ACSParameterProvision.yaml new file mode 100644 index 000000000..ee0be4800 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ACSParameterProvision.yaml @@ -0,0 +1,379 @@ +openapi: 3.0.0 +info: + title: 3gpp-acs-pp + version: 1.1.2 + description: | + API for 5G ACS Parameter Provision. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-acs-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/subscriptions: + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - ACS Configuration Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AcsConfigurationData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateAnSubscription + tags: + - ACS Configuration Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new subscription creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual ACS Configuration Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual ACS Configuration Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + responses: + '200': + description: OK (Successful update of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial modifies an existing subscription resource. + operationId: PartialUpdateAnSubscription + tags: + - Individual ACS Configuration Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to modify the existing subscription. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AcsConfigurationDataPatch' + responses: + '200': + description: > + OK. The subscription resource was successfully modified and a representation of the + updated resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AcsConfigurationData' + '204': + description: > + No Content. The resource has been successfully modified and no additional content is to + be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual ACS Configuration Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AcsConfigurationData: + description: Represents an individual ACS Configuration subscription resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfo' + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - acsInfo + - suppFeat + AcsConfigurationDataPatch: + description: > + Represents the parameters to request to modify an existing Individual ACS Configuration + subscription resource. + type: object + properties: + acsInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AcsInfo' + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AKMA.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AKMA.yaml new file mode 100644 index 000000000..28b51665e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AKMA.yaml @@ -0,0 +1,120 @@ +openapi: 3.0.0 +info: + title: 3gpp-akma + version: 1.0.1 + description: | + API for AKMA. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-akma/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /retrieve: + post: + summary: Retrieve AKMA Application Key Information. + operationId: RetrieveAKMAAppKey + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AkmaAfKeyRequest' + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AkmaAfKeyData' + '204': + description: No Content. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AkmaAfKeyRequest: + description: > + Represents the parameters to request the retrieval of AKMA Application Key information. + type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + afId: + $ref: '#/components/schemas/AfId' + aKId: + $ref: '#/components/schemas/AKId' + anonInd: + type: boolean + description: > + Indicates whether an anonymous user access. Set to "true" if an anonymous user access is + requested; otherwise set to "false". Default value is "false" if omitted. + default: false + required: + - afId + - aKId + AkmaAfKeyData: + description: Represents AKMA Application Key information data. + type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + expiry: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + kaf: + type: string + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + required: + - kaf + - expiry + AfId: + description: Represents an AF identifier. + type: string + AKId: + description: Represents an AKMA Key Identifier. + type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AMInfluence.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AMInfluence.yaml new file mode 100644 index 000000000..7499dfbf4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AMInfluence.yaml @@ -0,0 +1,473 @@ +openapi: 3.0.0 +info: + title: AMInfluence + version: 1.0.1 + description: | + AMInfluence API Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/ +servers: + - url: '{apiRoot}/3gpp-am-influence/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: [] +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: Read all of the active subscriptions for the AF. + tags: + - AM Influence Subscription + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF). + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmInfluSub' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + post: + summary: Create a new subscription to AM influence. + operationId: CreateAMInfluenceSubcription + tags: + - AM Influence Subscription + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + responses: + '201': + description: Create a new Individual AM Influence Subscription resource. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-am-influence/v1/{afId}/subscriptions/{subscriptionId}. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + notificationDestination: + '{$request.body#/notificationDestination}': + post: + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AmInfluEventNotif' + minItems: 1 + responses: + '204': + description: No Content, Notification was succesfull + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF. + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource. + required: true + schema: + type: string + get: + summary: Read an active subscription identified by the subscriptionId. + tags: + - Individual AM Influence Subscription + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + put: + summary: Update/Replace an existing subscription resource. + tags: + - Individual AM Influence Subscription + requestBody: + description: Parameters to update/replace the existing subscription. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + patch: + summary: Update/Replace an existing subscription resource. + tags: + - Individual AM Influence Subscription + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AmInfluSubPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AmInfluSub' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Delete an existing subscription. + tags: + - Individual AM Influence Subscription + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: {} + schemas: + AmInfluSub: + description: Represents an AM influence subscription. + type: object + properties: + afTransId: + type: string + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + anyUeInd: + type: boolean + description: > + Identifies whether the AF request applies to any UE. This attribute shall + set to "true" if applicable for any UE, otherwise, set to "false". + dnnSnssaiInfos: + type: array + items: + $ref: '#/components/schemas/DnnSnssaiInformation' + minItems: 1 + description: Each of the element identifies a (DNN, S-NSSAI) combination. + afAppIds: + type: array + items: + type: string + minItems: 1 + description: Each of the element identifies an application. + highThruInd: + type: boolean + geoAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: Identifies geographic areas of the user where the request is applicable. + policyDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/AmInfluEvent' + minItems: 1 + description: Indicates one or more AM influence related events. + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: > + Set to true by the AF to request the NEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afTransId + anyOf: + - required: [highThruInd] + - required: [geoAreas] + oneOf: + - required: [gpsi] + - required: [externalGroupId] + - required: [anyUeInd] + AmInfluSubPatch: + description: > + Represents parameters to request the modification of an AM influence subscription resource. + type: object + properties: + highThruInd: + type: boolean + nullable: true + geoAreas: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + description: Identifies geographic areas of the user where the request is applicable. + nullable: true + policyDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + dnnSnssaiInfos: + type: array + items: + $ref: '#/components/schemas/DnnSnssaiInformation' + minItems: 1 + nullable: true + description: Each of the element identifies a (DNN, S-NSSAI) combination. + afAppIds: + type: array + items: + type: string + minItems: 1 + nullable: true + description: Each of the element identifies an application. + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/AmInfluEvent' + minItems: 1 + nullable: true + description: Indicates one or more AM influence related events. + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LinkRm' + AmInfluEventNotif: + description: Represents an AM influence event notification. + type: object + properties: + afTransId: + type: string + event: + $ref: '#/components/schemas/AmInfluEvent' + geoAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: Identifies geographic areas of the user where the request is applicable. + required: + - event + - afTransId + DnnSnssaiInformation: + description: Represents a (DNN, SNSSAI) combination. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + +# ENUMERATIONS DATA TYPES +# + AmInfluEvent: + description: Represents the service area coverage outcome event. + anyOf: + - type: string + enum: + - SERVICE_AREA_COVRG_OUTCOME + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AMPolicyAuthorization.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AMPolicyAuthorization.yaml new file mode 100644 index 000000000..6739a93d4 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AMPolicyAuthorization.yaml @@ -0,0 +1,526 @@ +openapi: 3.0.0 +info: + title: 3gpp-am-policyauthorization + version: 1.0.2 + description: | + API for AM policy authorization. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-am-policyauthorization/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/app-am-contexts: + post: + summary: Creates a new Individual application AM Context resource + operationId: PostAppAmContexts + tags: + - Application AM Contexts + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new resource creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextExpData' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextExpRespData' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + amEventNotification: + '{$request.body#/evSubscs/eventNotifUri}': + post: + requestBody: + description: Notification of an event occurrence. + required: true + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/app-am-contexts/{appAmContextId}: + get: + summary: read an existing Individual application AM context + operationId: GetAppAmContext + tags: + - Individual Application AM Context + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: Identifier of the Individual application AM context + required: true + schema: + type: string + responses: + '200': + description: OK (A representation of the resource is successfully returned) + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextExpData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: partial modifies an existing Individual application AM context + operationId: ModAppAmContext + tags: + - Individual Application AM Context + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: Identifier of the application AM context resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppAmContextExpUpdateData' + responses: + '200': + description: > + successful modification of the resource and a representation of that + resource is returned. If a subscribed event is matched, the event + notification is also included in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextExpRespData' + '204': + description: The successful modification + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing Individual Application AM Context + operationId: DeleteAppAmContext + tags: + - Individual Application AM Context + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: string identifying the Individual aaplication AM context resource + required: true + schema: + type: string + responses: + '204': + description: The deletion is confirmed without returning additional data. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/app-am-contexts/{appAmContextId}/events-subscription: + put: + summary: creates or modifies an AM Policy Events Subscription sub-resource. + operationId: UpdateAmEventsSubsc + tags: + - AM Policy Events Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: string identifying the AM Policy Events Subscription subresource + required: true + schema: + type: string + requestBody: + description: > + Creation or modification of an application AM Policy Events Subscription sub-resource. + required: true + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscData' + responses: + '201': + description: > + The creation of the application AM Policy Events Subscription sub-resource + is confirmed and its representation is returned. If an AM Event is matched, + the response also includes the notification. + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscRespData' + headers: + Location: + description: > + Contains the URI of the created AM Policy Events Subscription + subresource, according to the structure + {apiRoot}/3gpp-am-policyauthorization/v1/{afId}/app-am- + contexts/{appAmContextId}/events-subscription} + required: true + schema: + type: string + '200': + description: > + The modification of the AM Policy Events Subscription subresource is confirmed + and its representation is returned. If an AM Event is matched, the response also + includes the notification. + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscRespData' + '204': + description: > + The modification of the AM Policy Events Subscription subresource is confirmed + without returning additional data. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + amEventNotification: + '{$request.body#/evSubscs/eventNotifUri}': + post: + requestBody: + description: Contains the information for the notification of an event occurrence. + required: true + content: + application/json: + schema: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: deletes the AM Policy Events Subscription sub-resource + operationId: DeleteAmEventsSubsc + tags: + - AM Policy Events Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: appAmContextId + in: path + description: string identifying the Individual Application AM Context resource. + required: true + schema: + type: string + responses: + '204': + description: > + The deletion of the of the AM Policy Events Subscription subresource + is confirmed without returning additional data. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AppAmContextExpData: + description: Represents an Individual application AM context exposure resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + evSubscs: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscData' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + highThruInd: + type: boolean + covReqs: + type: array + items: + $ref: '#/components/schemas/GeographicalArea' + minItems: 1 + nullable: true + policyDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSecRm' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestTestNotification: + type: boolean + description: > + Set to true by the AF to request the NEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + required: + - gpsi + anyOf: + - required: [highThruInd] + - required: [covReqs] + + AppAmContextExpUpdateData: + description: > + Contains the modification(s) to be applied to the Individual application + AM context exposure resource. + type: object + properties: + evSubscs: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsSubscDataRm' + highThruInd: + type: boolean + covReqs: + type: array + items: + $ref: '#/components/schemas/GeographicalArea' + minItems: 1 + policyDuration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + + GeographicalArea: + description: Contains geographical area information (e.g.a civic address or shapes). + type: object + properties: + civicAddress: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + shapes: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + + AppAmContextExpRespData: + description: > + It represents a response to a modification or creation request of an Individual + Application AM resource. It may contain the notification of the already met events + anyOf: + - $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AppAmContextData' + - $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/AmEventsNotification' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ASTI.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ASTI.yaml new file mode 100644 index 000000000..1460eebee --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ASTI.yaml @@ -0,0 +1,406 @@ +openapi: 3.0.0 + +info: + title: 3gpp-asti + version: 1.0.1 + description: | + API for ASTI. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-asti/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/configurations: + get: + summary: read all of the active configurations of 5G access stratum time distribution for the AF + operationId: ReadAllConfigurations + tags: + - ASTI Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active configurations for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AccessTimeDistributionData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + operationId: CreateNewConfiguration + tags: + - ASTI Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/retrieve: + post: + summary: Request the status of the 5G access stratum time distribution configuration for a list of UEs. + operationId: RetrieveStatusofConfiguration + tags: + - ASTI Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: Contains the list of GPSIs. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StatusRequestData' + responses: + '200': + description: Successful retrieval of the status of the 5G access stratum time distribution + content: + application/json: + schema: + $ref: '#/components/schemas/StatusResponseData' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/{configId}: + get: + summary: Reads an active configuration for the AF and the configuration Id + operationId: ReadAnConfiguration + tags: + - Individual ASTI Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Modifies an active configuration for the AF and the configuration Id + operationId: FullyModifyAnConfiguration + tags: + - Individual ASTI Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + responses: + '200': + description: OK (Successful update of the configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTimeDistributionData' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration + operationId: DeleteAnConfiguration + tags: + - Individual ASTI Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + + schemas: + + AccessTimeDistributionData: + description: > + Contains the parameters for the creation of 5G access stratum time distribution configuration. + type: object + properties: + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + asTimeDisParam: + $ref: 'TS29565_Ntsctsf_ASTI.yaml#/components/schemas/AsTimeDistributionParam' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - asTimeDisParam + oneOf: + - required: [gpsis] + - required: [interGrpId] + + StatusRequestData: + description: > + Contains the parameters for retrieval of the status of the access stratum time distribution + for a list of UEs. + type: object + properties: + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + required: + - gpsis + + StatusResponseData: + description: > + Contains the parameters for the status of the access stratum time distribution for a list of + UEs. + type: object + properties: + inactiveUes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + activeUes: + type: array + items: + $ref: '#/components/schemas/ActiveUe' + minItems: 1 + + ActiveUe: + description: > + Contains the UE identifier whose status of the access stratum time distribution is active and + the optional requested time synchronization error budget. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + timeSyncErrBdgt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AnalyticsExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AnalyticsExposure.yaml new file mode 100644 index 000000000..b440a442e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_AnalyticsExposure.yaml @@ -0,0 +1,998 @@ +openapi: 3.0.0 +info: + title: 3gpp-analyticsexposure + version: 1.1.2 + description: | + API for Analytics Exposure. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-analyticsexposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/subscriptions: + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Analytics Exposure Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: supp-feat + in: query + description: Features supported by the NF service consumer + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateNewSubscription + tags: + - Analytics Exposure Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new subscription creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + callbacks: + notification: + '{request.body#/notifUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsEventNotification' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '204': + description: > + Successful case. The resource has been successfully created and no additional + content is to be sent in the response message. + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Analytics Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + - name: supp-feat + in: query + description: Features supported by the NF service consumer + required: false + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual Analytics Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + responses: + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsExposureSubsc' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Analytics Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/fetch: + post: + summary: Fetch analytics information + operationId: FetchAnalyticsInfo + tags: + - AnalyticsExposure API Fetch analytics information + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsRequest' + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AnalyticsData' + '204': + description: No Content (The requested Analytics data does not exist) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + description: > + The request is rejected by the NEF and more details (not only the ProblemDetails) + are returned. + content: + application/problem+json: + schema: + $ref: 'TS29520_Nnwdaf_AnalyticsInfo.yaml#/components/schemas/ProblemDetailsAnalyticsInfoRequest' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AnalyticsExposureSubsc: + description: Represents an analytics exposure subscription. + type: object + properties: + analyEventsSubs: + type: array + items: + $ref: '#/components/schemas/AnalyticsEventSubsc' + minItems: 1 + analyRepInfo: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + eventNotifis: + type: array + items: + $ref: '#/components/schemas/AnalyticsEventNotif' + minItems: 1 + failEventReports: + type: array + items: + $ref: '#/components/schemas/AnalyticsFailureEventInfo' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: > + Set to true by the AF to request the NEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + required: + - analyEventsSubs + - notifUri + - notifId + AnalyticsEventNotification: + description: Represents an analytics event(s) notification. + type: object + properties: + notifId: + type: string + analyEventNotifs: + type: array + items: + $ref: '#/components/schemas/AnalyticsEventNotif' + minItems: 1 + required: + - notifId + - analyEventNotifs + AnalyticsEventNotif: + description: Represents an analytics event to be reported. + type: object + properties: + analyEvent: + $ref: '#/components/schemas/AnalyticsEvent' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStamp: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + failNotifyCode: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NwdafFailureCode' + rvWaitTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + ueMobilityInfos: + type: array + items: + $ref: '#/components/schemas/UeMobilityExposure' + minItems: 1 + ueCommInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UeCommunication' + minItems: 1 + abnormalInfos: + type: array + items: + $ref: '#/components/schemas/AbnormalExposure' + minItems: 1 + congestInfos: + type: array + items: + $ref: '#/components/schemas/CongestInfo' + minItems: 1 + nwPerfInfos: + type: array + items: + $ref: '#/components/schemas/NetworkPerfExposure' + minItems: 1 + qosSustainInfos: + type: array + items: + $ref: '#/components/schemas/QosSustainabilityExposure' + minItems: 1 + disperInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionInfo' + minItems: 1 + dnPerfInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerfInfo' + minItems: 1 + svcExps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ServiceExperienceInfo' + minItems: 1 + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStampGen: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - analyEvent + - timeStamp + AnalyticsEventSubsc: + description: Represents a subscribed analytics event. + type: object + properties: + analyEvent: + $ref: '#/components/schemas/AnalyticsEvent' + analyEventFilter: + $ref: '#/components/schemas/AnalyticsEventFilterSubsc' + tgtUe: + $ref: '#/components/schemas/TargetUeId' + required: + - analyEvent + AnalyticsEventFilterSubsc: + description: Represents an analytics event filter. + type: object + properties: + nwPerfReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfRequirement' + minItems: 1 + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + excepRequs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/Exception' + minItems: 1 + exptAnaType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExpectedAnalyticsType' + exptUeBehav: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExpectedUeBehaviourData' + matchingDir: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/MatchingDirection' + reptThlds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ThresholdLevel' + minItems: 1 + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiIdInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiIdInfo' + minItems: 1 + qosReq: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/QosRequirement' + qosFlowRetThds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RetainabilityThreshold' + minItems: 1 + ranUeThrouThds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + minItems: 1 + disperReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionRequirement' + minItems: 1 + listOfAnaSubsets: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsSubset' + minItems: 1 + dnPerfReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerformanceReq' + minItems: 1 + bwRequs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/BwRequirement' + minItems: 1 + ratFreqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RatFreqInformation' + minItems: 1 + appServerAddrs: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + minItems: 1 + extraReportReq: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventReportingRequirement' + maxNumOfTopAppUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxNumOfTopAppDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + visitedLocAreas: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + minItems: 1 + TargetUeId: + description: Represents the target UE(s) information. + type: object + properties: + anyUeInd: + type: boolean + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + UeMobilityExposure: + description: Represents a UE mobility information. + type: object + properties: + ts: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + recurringTime: + $ref: 'TS29122_CpProvisioning.yaml#/components/schemas/ScheduledCommunicationTime' + duration: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DurationSec' + durationVariance: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + locInfo: + type: array + items: + $ref: '#/components/schemas/UeLocationInfo' + minItems: 1 + required: + - duration + - locInfo + UeLocationInfo: + description: Represents a UE location information. + type: object + properties: + loc: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - loc + AnalyticsRequest: + description: Represents the parameters to request to retrieve analytics information. + type: object + properties: + analyEvent: + $ref: '#/components/schemas/AnalyticsEvent' + analyEventFilter: + $ref: '#/components/schemas/AnalyticsEventFilter' + analyRep: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/EventReportingRequirement' + tgtUe: + $ref: '#/components/schemas/TargetUeId' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - analyEvent + - suppFeat + AnalyticsEventFilter: + description: Represents analytics event filter information. + type: object + properties: + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + minItems: 1 + nwPerfTypes: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfType' + minItems: 1 + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + excepIds: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExceptionId' + minItems: 1 + exptAnaType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ExpectedAnalyticsType' + exptUeBehav: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ExpectedUeBehaviourData' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiIdInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiIdInfo' + minItems: 1 + qosReq: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/QosRequirement' + listOfAnaSubsets: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AnalyticsSubset' + minItems: 1 + dnPerfReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerformanceReq' + minItems: 1 + bwRequs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/BwRequirement' + minItems: 1 + ratFreqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RatFreqInformation' + minItems: 1 + appServerAddrs: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AddrFqdn' + minItems: 1 + maxNumOfTopAppUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + maxNumOfTopAppDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + visitedLocAreas: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + minItems: 1 + AnalyticsData: + description: Represents analytics data. + type: object + properties: + start: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeStampGen: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + ueMobilityInfos: + type: array + items: + $ref: '#/components/schemas/UeMobilityExposure' + minItems: 1 + ueCommInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/UeCommunication' + minItems: 1 + nwPerfInfos: + type: array + items: + $ref: '#/components/schemas/NetworkPerfExposure' + minItems: 1 + abnormalInfos: + type: array + items: + $ref: '#/components/schemas/AbnormalExposure' + minItems: 1 + congestInfos: + type: array + items: + $ref: '#/components/schemas/CongestInfo' + minItems: 1 + qosSustainInfos: + type: array + items: + $ref: '#/components/schemas/QosSustainabilityExposure' + minItems: 1 + disperInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionInfo' + minItems: 1 + dnPerfInfos: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DnPerfInfo' + minItems: 1 + svcExps: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ServiceExperienceInfo' + minItems: 1 + disperReqs: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/DispersionRequirement' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - suppFeat + NetworkPerfExposure: + description: Represents network performance information. + type: object + properties: + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + nwPerfType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NetworkPerfType' + relativeRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + absoluteNum: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - locArea + - nwPerfType + AbnormalExposure: + description: Represents a user's abnormal behavior information. + type: object + properties: + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + appId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + excep: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/Exception' + ratio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + addtMeasInfo: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/AdditionalMeasurement' + required: + - excep + CongestInfo: + description: Represents a UE's user data congestion information. + type: object + properties: + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + cngAnas: + type: array + items: + $ref: '#/components/schemas/CongestionAnalytics' + minItems: 1 + required: + - locArea + - cngAnas + CongestionAnalytics: + description: > + Represents data congestion analytics for transfer over the user plane, + control plane or both. + type: object + properties: + cngType: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/CongestionType' + tmWdw: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + nsi: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ThresholdLevel' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + topAppListUl: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/TopApplication' + minItems: 1 + topAppListDl: + type: array + items: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/TopApplication' + minItems: 1 + required: + - cngType + - tmWdw + - nsi + QosSustainabilityExposure: + description: Represents a QoS sustainability information. + type: object + properties: + locArea: + $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G' + startTs: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + endTs: + $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTime' + qosFlowRetThd: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/RetainabilityThreshold' + ranUeThrouThd: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + confidence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - locArea + - startTs + - endTs + AnalyticsFailureEventInfo: + description: > + Represents an event for which the subscription request was not successful + and including the associated failure reason. + type: object + properties: + event: + $ref: '#/components/schemas/AnalyticsEvent' + failureCode: + $ref: '#/components/schemas/AnalyticsFailureCode' + required: + - event + - failureCode + AnalyticsEvent: + anyOf: + - type: string + enum: + - UE_MOBILITY + - UE_COMM + - ABNORMAL_BEHAVIOR + - CONGESTION + - NETWORK_PERFORMANCE + - QOS_SUSTAINABILITY + - DISPERSION + - DN_PERFORMANCE + - SERVICE_EXPERIENCE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UE_MOBILITY: The AF requests to be notified about analytics information of UE mobility. + - UE_COMM: The AF requests to be notified about analytics information of UE communication. + - ABNORMAL_BEHAVIOR: The AF requests to be notified about analytics information of UE's abnormal behavior. + - CONGESTION: The AF requests to be notified about analytics information of user data congestion information. + - NETWORK_PERFORMANCE: The AF requests to be notified about analytics information of network performance. + - QOS_SUSTAINABILITY: The AF requests to be notified about analytics information of QoS sustainability. + - DISPERSION: The AF requests to be notified about analytics information of Dispersion analytics. + - DN_PERFORMANCE: The AF requests to be notified about analytics information of DN performance. + - SERVICE_EXPERIENCE: The AF requests to be notified about analytics information of service experience. + AnalyticsFailureCode: + anyOf: + - type: string + enum: + - UNAVAILABLE_DATA + - BOTH_STAT_PRED_NOT_ALLOWED + - UNSATISFIED_REQUESTED_ANALYTICS_TIME + - OTHER + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - UNAVAILABLE_DATA: The event is rejected since necessary data to perform the service is unavailable. + - BOTH_STAT_PRED_NOT_ALLOWED: The event is rejected since the start time is in the past and the end time is in the future, which means the NF service consumer requested both statistics and prediction for the analytics. + - UNSATISFIED_REQUESTED_ANALYTICS_TIME: Indicates that the requested event is rejected since the analytics information is not ready when the time indicated by the timeAnaNeeded attribute (as provided during the creation or modification of subscription) is reached. + - OTHER: The event is rejected due to other reasons. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ApplyingBdtPolicy.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ApplyingBdtPolicy.yaml new file mode 100644 index 000000000..da1577185 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ApplyingBdtPolicy.yaml @@ -0,0 +1,281 @@ +openapi: 3.0.0 +info: + title: 3gpp-applying-bdt-policy + version: 1.1.1 + description: | + API for applying BDT policy + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-applying-bdt-policy/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Applied BDT Policy Subscription + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AppliedBdtPolicy' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateNewSubscription + tags: + - Applied BDT Policy Subscription + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicy' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicy' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + get: + summary: read an active subscriptions for the SCS/AS and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Applied BDT Policy Subscription + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicy' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates/replaces an existing subscription resource + operationId: PartialUpdateAnSubscription + tags: + - Individual Applied BDT Policy Subscription + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicyPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AppliedBdtPolicy' + '204': + description: No content. The subscription was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Applied BDT Policy Subscription + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + AppliedBdtPolicy: + description: Represents an applied BDT policy. + type: object + properties: + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + required: + - bdtRefId + - suppFeat + oneOf: + - required: [gpsi] + - required: [externalGroupId] + AppliedBdtPolicyPatch: + description: > + Represents the parameters to request the modification of a subscription to + applied BDT policy. + type: object + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + required: + - bdtRefId + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_DataReporting.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_DataReporting.yaml new file mode 100644 index 000000000..55f33610e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_DataReporting.yaml @@ -0,0 +1,270 @@ +openapi: 3.0.0 +info: + title: 3gpp-data-reporting + version: 1.0.0 + description: | + API for 3GPP Data Reporting. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.6.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-data-reporting/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /sessions: + post: + summary: Create a new Data Reporting Session. + operationId: CreateDataRepSession + tags: + - Data Reporting Sessions + requestBody: + description: > + Representation of the Data Reporting Session to be created in the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + responses: + '201': + description: Created. Successful creation of a new Data Reporting Session. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + headers: + Location: + required: true + schema: + type: string + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-data-reporting/v1/sessions/{sessionId} + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Session. + required: true + schema: + type: string + get: + summary: Request the retrieval of an existing Individual Data Reporting Session resource. + operationId: GetIndDataRepSession + tags: + - Individual Data Reporting Session + responses: + '200': + description: > + OK. The requested Individual Data Reporting Session resource is + Successfully returned. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual Data Reporting Session resource. + operationId: UpdateIndDataRepSession + tags: + - Individual Data Reporting Session + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + responses: + '200': + description: > + OK. The Individual Data Reporting Session resource was successfully + updated. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + '204': + description: > + No Content. The Individual Data Reporting Session resource was successfully + updated and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing Data Reporting Session resource. + operationId: DeleteIndDataRepSession + tags: + - Individual Data Reporting Session + responses: + '204': + description: > + No Content. The concerned Individual Data Reporting Session resource was + successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}/report: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Session. + required: true + schema: + type: string + post: + summary: Report collected UE data. + operationId: ReportUEData + tags: + - Individual Data Reporting Session + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReport' + responses: + '200': + description: OK. The UE data report was successfully received. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReporting.yaml#/components/schemas/DataReportingSession' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_DataReportingProvisioning.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_DataReportingProvisioning.yaml new file mode 100644 index 000000000..71ec587a5 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_DataReportingProvisioning.yaml @@ -0,0 +1,411 @@ +openapi: 3.0.0 +info: + title: 3gpp-data-reporting-provisioning + version: 1.0.1 + description: | + API for 3GPP Data Reporting and Provisioning. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-data-reporting-provisioning/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /sessions: + post: + summary: Create a new Data Reporting Provisioning Session. + operationId: CreateDataRepProvSession + tags: + - Data Reporting Provisioning Sessions + requestBody: + description: > + Representation of the Data Reporting Provisioning Session to be created in the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingProvisioningSession' + responses: + '201': + description: Created. Successful creation of a new Data Reporting Provisioning Session. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingProvisioningSession' + headers: + Location: + required: true + schema: + type: string + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-data-reporting-provisioning/v1/sessions/{sessionId} + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Provisioning Session. + required: true + schema: + type: string + get: + summary: Request the retrieval of an existing Individual Data Reporting Provisioning Session resource. + operationId: GetIndDataRepProvSession + tags: + - Individual Data Reporting Provisioning Session + responses: + '200': + description: > + OK. The requested Individual Data Reporting Provisioning Session resource is + Successfully returned. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingProvisioningSession' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing Individual Data Reporting Provisioning Session resource. + operationId: DeleteIndDataRepProvSession + tags: + - Individual Data Reporting Provisioning Session + responses: + '204': + description: > + No Content. The concerned Individual Data Reporting Provisioning Session resource was + successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}/configurations: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Provisioning Session. + required: true + schema: + type: string + post: + summary: Create a new Data Reporting Configuration resource. + operationId: CreateDataRepConfig + tags: + - Data Reporting Configurations + requestBody: + description: > + Representation of the Data Reporting Configuration to be created in the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + responses: + '201': + description: Created. Successful creation of a new Data Reporting Configuration. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + headers: + Location: + required: true + schema: + type: string + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-data-reporting-provisioning/v1/sessions/{sessionId}/configurations/{configurationId} + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /sessions/{sessionId}/configurations/{configurationId}: + parameters: + - name: sessionId + in: path + description: Identifier of the Data Reporting Provisioning Session. + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the Data Reporting Configuration. + required: true + schema: + type: string + get: + summary: Request the retrieval of an existing Individual Data Reporting Configuration resource. + operationId: GetIndDataRepConfig + tags: + - Individual Data Reporting Configuration + responses: + '200': + description: > + OK. The requested Individual Data Reporting Configuration resource is successfully + returned. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request to update an existing Individual Data Reporting Configuration resource. + operationId: UpdateIndDataRepConfig + tags: + - Individual Data Reporting Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + responses: + '200': + description: > + OK. The Individual Data Reporting Configuration resource was successfully updated. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + '204': + description: > + No Content. The Individual Data Reporting Configuration resource was successfully + updated and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request to modify an existing Individual Data Reporting Configuration resource. + operationId: ModifyIndDataRepConfig + tags: + - Individual Data Reporting Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfigurationPatch' + responses: + '200': + description: > + OK. The Individual Data Reporting Configuration resource was successfully modified. + content: + application/json: + schema: + $ref: 'TS26532_Ndcaf_DataReportingProvisioning.yaml#/components/schemas/DataReportingConfiguration' + '204': + description: > + No Content. The Individual Data Reporting Configuration resource was successfully + modified and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing Data Reporting Configuration resource. + operationId: DeleteIndDataRepConfig + tags: + - Individual Data Reporting Configuration + responses: + '204': + description: > + No Content. The concerned Individual Data Reporting Configuration resource was + successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_EASDeployment.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_EASDeployment.yaml new file mode 100644 index 000000000..e586a0390 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_EASDeployment.yaml @@ -0,0 +1,402 @@ +openapi: 3.0.0 +info: + title: 3gpp-eas-deployment + version: 1.0.2 + description: | + API for AF provisioned EAS Deployment. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-eas-deployment/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/eas-deployment-info: + get: + summary: Read all EAS Deployment information for a given AF + operationId: ReadAllDeployment + tags: + - EAS Deployment Information (Collection) + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the EAS Deployment information for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EasDeployInfo' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Create a new Individual EAS Deployment information resource. + operationId: CreateAnDeployment + tags: + - EAS Deployment Information (Collection) + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new resource creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/eas-deployment-info/{easDeployInfoId}: + get: + summary: Read an active Individual EAS Deployment Information resource for the AF + operationId: ReadAnDeployment + tags: + - Individual EAS Deployment Information + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: easDeployInfoId + in: path + description: Identifier of an EAS Deployment Information. + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active resource) + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing resource + operationId: FullyUpdateAnDeployment + tags: + - Individual EAS Deployment Information + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: easDeployInfoId + in: path + description: Identifier of the EAS Deployment information resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + responses: + '200': + description: OK (Successful update of the existing resource) + content: + application/json: + schema: + $ref: '#/components/schemas/EasDeployInfo' + '204': + description: > + Successful case. The resource has been successfully updated and no additional content is + sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing EAS Deployment information resource + operationId: DeleteAnDeployment + tags: + - Individual EAS Deployment Information + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: easDeployInfoId + in: path + description: Identifier of the EAS Deployment information resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing resource) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + /remove-edis: + post: + summary: Remove EAS Deployment Information based on given criteria. + operationId: DeleteEDIs + tags: + - EAS Deployment Information removal + requestBody: + description: Criteria to be used for deleting EAS Deployment Information that match them. + content: + application/json: + schema: + $ref: '#/components/schemas/EdiDeleteCriteria' + required: true + responses: + '204': + description: > + No Content. The EDIs matching the provided criteria have been successfully deleted. + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + EasDeployInfo: + description: Represents EAS Deployment Information. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + afServiceId: + type: string + fqdnPatternList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/FqdnPatternMatchingRule' + minItems: 1 + appId: + type: string + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + dnaiInfos: + type: object + additionalProperties: + $ref: '#/components/schemas/DnaiInformation' + minProperties: 1 + description: > + list of DNS server identifier (consisting of IP address and port) and/or IP address(s) + of the EAS in the local DN for each DNAI. The key of map is the DNAI. + required: + - fqdnPatternList + DnaiInformation: + description: Represents DNAI information. + type: object + properties: + dnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + dnsServIds: + type: array + items: + $ref: '#/components/schemas/DnsServerIdentifier' + minItems: 1 + easIpAddrs: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + required: + - dnai + anyOf: + - required: [dnsServIds] + - required: [easIpAddrs] + DnsServerIdentifier: + description: Represents DNS server identifier (consisting of IP address and port). + type: object + properties: + dnsServIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + portNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + required: + - dnsServIpAddr + - portNumber + + EdiDeleteCriteria: + description: > + Contains criteria to be used for deleting EAS Deployment Information entries that match + them. + type: object + properties: + afId: + $ref: 'TS29522_AKMA.yaml#/components/schemas/AfId' + dnnSnssai: + $ref: 'TS29522_AMInfluence.yaml#/components/schemas/DnnSnssaiInformation' + anyOf: + - required: [afId] + - required: [dnnSnssai] diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_EcsAddressProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_EcsAddressProvision.yaml new file mode 100644 index 000000000..dd3ba106b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_EcsAddressProvision.yaml @@ -0,0 +1,303 @@ +openapi: 3.0.0 +info: + title: 3gpp-ecs-address-provision + version: 1.0.1 + description: | + API for ECS Address Provisioning. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-ecs-address-provision/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/configurations: + get: + summary: Read all active configurations for a given AF + operationId: ReadAllConfigurations + tags: + - ECS Address Provision Configurations (Collection) + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active resources for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/EcsAddressProvision' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + operationId: CreateNewConfiguration + tags: + - ECS Address Provision Configurations (Collection) + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new resource creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/{configurationId}: + get: + summary: Read an active resource for the AF and the configuration Id + operationId: ReadAnConfiguration + tags: + - Individual ECS Address Provision Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active resource) + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing resource + operationId: FullyUpdateAnConfiguration + tags: + - Individual ECS Address Provision Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + responses: + '200': + description: OK (Successful update of the existing resource) + content: + application/json: + schema: + $ref: '#/components/schemas/EcsAddressProvision' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration resource + operationId: DeleteAnConfiguration + tags: + - Individual ECS Address Provision Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing resource) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + EcsAddressProvision: + description: Represents ECS address provision configuration. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + ecsServerAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EcsServerAddr' + spatialValidityCond: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SpatialValidityCond' + tgtUe: + $ref: 'TS29522_AnalyticsExposure.yaml#/components/schemas/TargetUeId' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - ecsServerAddr + - suppFeat + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_IPTVConfiguration.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_IPTVConfiguration.yaml new file mode 100644 index 000000000..4f0f979b5 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_IPTVConfiguration.yaml @@ -0,0 +1,425 @@ +openapi: 3.0.0 +info: + title: 3gpp-iptvconfiguration + version: 1.1.1 + description: | + API for IPTV configuration. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-iptvconfiguration/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/configurations: + get: + summary: read all of the active configurations for the AF + operationId: ReadAllSubscriptions + tags: + - IPTV Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active configurations for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IptvConfigData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + operationId: CreateNewSubscription + tags: + - IPTV Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + responses: + '201': + description: Created (Successful creation of configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/configurations/{configurationId}: + get: + summary: read an active configuration for the AF and the configuration Id + operationId: ReadAnSubscription + tags: + - Individual IPTV Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing configuration resource + operationId: FullyUpdateAnSubscription + tags: + - Individual IPTV Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + responses: + '200': + description: OK (Successful deletion of the existing configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates an existing configuration resource + operationId: PartialUpdateAnSubscription + tags: + - Individual IPTV Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/IptvConfigDataPatch' + responses: + '200': + description: OK. The configuration was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IptvConfigData' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration + operationId: DeleteAnSubscription + tags: + - Individual IPTV Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: configurationId + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + IptvConfigData: + description: Represents an individual IPTV Configuration resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + afAppId: + type: string + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + multiAccCtrls: + type: object + additionalProperties: + $ref: '#/components/schemas/MulticastAccessControl' + minProperties: 1 + description: > + Identifies a list of multicast address access control information. + Any string value can be used as a key of the map. + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afAppId + - multiAccCtrls + - suppFeat + IptvConfigDataPatch: + description: > + Represents the parameters to request the modification of an IPTV Configuration resource. + type: object + properties: + multiAccCtrls: + type: object + additionalProperties: + $ref: '#/components/schemas/MulticastAccessControl' + minProperties: 1 + description: > + Identifies a list of multicast address access control information. + Any string value can be used as a key of the map. + MulticastAccessControl: + description: Represents multicast address access control information. + type: object + properties: + srcIpv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + srcIpv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + multicastV4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + multicastV6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + accStatus: + $ref: '#/components/schemas/AccessRightStatus' + required: + - accStatus + AccessRightStatus: + anyOf: + - type: string + enum: + - FULLY_ALLOWED + - PREVIEW_ALLOWED + - NO_ALLOWED + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - FULLY_ALLOWED: The User is fully allowed to access to the channel. + - PREVIEW_ALLOWED: The User is preview allowed to access to the channel. + - NO_ALLOWED: The User is not allowed to access to the channel. + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_LpiParameterProvision.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_LpiParameterProvision.yaml new file mode 100644 index 000000000..973a6898d --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_LpiParameterProvision.yaml @@ -0,0 +1,378 @@ +openapi: 3.0.0 +info: + title: 3gpp-lpi-pp + version: 1.1.2 + description: | + API for Location Privacy Indication Parameters Provisioning. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-lpi-pp/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/provisionedLpis: + get: + summary: read all of the active LPI Parameters Provisioning resources for the AF + operationId: ReadAllResources + tags: + - LPI Parameters Provisionings + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active resources for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/LpiParametersProvision' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new LPI Parameters Provisioning resource + operationId: CreateNewResource + tags: + - LPI Parameters Provisionings + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new resource creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/provisionedLpis/{provisionedLpiId}: + get: + summary: read an active LPI Parameters Provisioning resource for the AF and the provisioned LPI Id + operationId: ReadAnResource + tags: + - Individual LPI Parameters Provisioning + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: provisionedLpiId + in: path + description: Identifier of the provisioned LPI parameter resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active resource) + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing LPI Parameters Provisioning resource + operationId: FullyUpdateAnResource + tags: + - Individual LPI Parameters Provisioning + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: provisionedLpiId + in: path + description: Identifier of the provisioned LPI parameter resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + responses: + '200': + description: > + OK. The resource has been successfully updated and a representation of the updated + resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partially modifies an existing LPI Parameters Provisioning resource. + operationId: PartialUpdateAnResource + tags: + - Individual LPI Parameters Provisioning + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: provisionedLpiId + in: path + description: Identifier of the provisioned LPI parameter resource + required: true + schema: + type: string + requestBody: + description: Parameters to modify the existing resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvisionPatch' + responses: + '200': + description: > + OK. The resource has been successfully modified and a representation of the + updated resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/LpiParametersProvision' + '204': + description: > + Successful case. The resource has been successfully modified and no additional content + is sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing LPI Parameters Provisioning resource + operationId: DeleteAnResource + tags: + - Individual LPI Parameters Provisioning + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: provisionedLpiId + in: path + description: Identifier of the provisioned LPI parameter resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing resource) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + LpiParametersProvision: + description: Represents an individual LPI Parameters Provisionings resource. + type: object + properties: + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + lpi: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi' + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - lpi + - suppFeat + LpiParametersProvisionPatch: + description: Represents the parameters to modify an existing Individual LPI Parameters Provisionings resource. + type: object + properties: + lpi: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/Lpi' + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSSession.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSSession.yaml new file mode 100644 index 000000000..d18e13dcf --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSSession.yaml @@ -0,0 +1,759 @@ +openapi: 3.0.0 + +info: + title: 3gpp-mbs-session + version: 1.1.1 + description: | + API for MBS Session Management. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +servers: + - url: '{apiRoot}/3gpp-mbs-session/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: [] + +paths: + /mbs-sessions: + post: + summary: Request the creation of a new MBS Session. + tags: + - MBS Sessions collection + operationId: CreateMBSSession + requestBody: + description: Representation of the new MBS session to be created at the NEF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionCreateReq' + responses: + '201': + description: > + Created. Successful creation of a new Individual MBS session resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionCreateRsp' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-mbs-session/v1/mbs-sessions/{mbsSessionRef} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /mbs-sessions/{mbsSessionRef}: + parameters: + - name: mbsSessionRef + in: path + description: Identifier of the Individual MBS Session resource. + required: true + schema: + type: string + + patch: + summary: Request the modification of an existing Individual MBS Session resource. + operationId: ModifyIndMBSSession + tags: + - Individual MBS Session + requestBody: + required: true + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + responses: + '204': + description: > + No Content. The concerned Individual MBS Session resource was successfully modified. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the Deletion of an existing Individual MBS Session resource. + operationId: DeleteIndMBSSession + tags: + - Individual MBS Session + responses: + '204': + description: > + No Content. Successful deletion of the concerned Individual MBS Session resource. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /mbs-sessions/subscriptions: + get: + summary: Retrieve all the active MBS Sessions subscriptions. + operationId: ReadMBSSessionsSubscs + tags: + - MBS Session Subscriptions + responses: + '200': + description: > + OK. All the active MBS Session Subscriptions resources managed by the NEF are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MbsSessionSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new Individual MBS Session subscription resource. + operationId: CreateMBSSessionsSubsc + tags: + - MBS Session Subscriptions + requestBody: + description: Request the creation of a new MBS Session subscription resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionSubsc' + responses: + '201': + description: > + Created. Successful creation of a new Individual MBS Session subscription. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionSubsc' + headers: + Location: + description: Contains the URI of the newly created resource, according to the + structure + {apiRoot}/3gpp-mbs-session/v1/mbs-sessions/subscriptions/{subscriptionId} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + MBSSessionStatusNotification: + '{request.body#/notificationUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionStatusNotif' + responses: + '204': + description: No Content. Successful reception of the notification. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /mbs-sessions/subscriptions/{subscriptionId}: + parameters: + - name: subscriptionId + in: path + description: Identifier of the Individual MBS Session Subscription resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual MBS Session Subscription resource. + operationId: ReadIndMBSSessionsSubsc + tags: + - Individual MBS Session subscription + responses: + '200': + description: > + OK. Successful retrieval of the targeted Individual MBS Session subscription resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsSessionSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the deletion of an existing Individual MBS Session subscription resource. + operationId: DeleteIndMBSSessionsSubsc + tags: + - Individual MBS Session Subscription + responses: + '204': + description: > + No Content. Successful deletion of the existing Individual MBS Session subscription + resource. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /mbs-pp: + get: + summary: Request to retrieve all the active MBS Parameters Provisioning resources at the NEF. + operationId: GetMBSParamsProvisionings + tags: + - MBS Parameters Provisionings + responses: + '200': + description: > + OK. All the active MBS Parameters Provisioning resources managed by the NEF are + returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MbsPpData' + minItems: 1 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new MBS Parameters Provisioning. + tags: + - MBS Parameters Provisioning + operationId: CreateMBSParamsProvisioning + requestBody: + description: Representation of the new MBS Parameters Provisioning to be created at the NEF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + responses: + '201': + description: > + Created. Successful creation of a new Individual MBS Parameters Provisioning resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-mbs-session/v1/mbs-pp/{mbsPpId} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /mbs-pp/{mbsPpId}: + parameters: + - name: mbsPpId + in: path + description: > + Represents the identifier of the Individual MBS Parameters Provisioning resource. + required: true + schema: + type: string + + get: + summary: Request to retrieve an existing Individual MBS Parameters Provisioning resource. + operationId: GetIndMBSParamsProvisioning + tags: + - Individual MBS Parameters Provisioning + responses: + '200': + description: > + OK. Successful retrieval of the requested Individual MBS Parameters Provisioning. + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual MBS Parameters Provisioning resource. + tags: + - Individual MBS Parameters Provisioning + operationId: UpdateIndMBSParamsProvisioning + requestBody: + description: > + Represents the updated Individual MBS Parameters Provisioning resource representation. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + responses: + '200': + description: > + OK. The Individual MBS Parameters Provisioning resource is successfully updated and a + representation of the updated resource is returned in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + '204': + description: > + No Content. The Individual MBS Parameters Provisioning resource is successfully updated. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request the modification of an existing Individual MBS Parameters Provisioning resource. + tags: + - Individual MBS Parameters Provisioning + operationId: ModifyIndMBSParamsProvisioning + requestBody: + description: > + Contains the parameters to request the modification of the Individual Parameters + Provisioning resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/MbsPpDataPatch' + responses: + '200': + description: > + OK. The Individual MBS Parameters Provisioning resource is successfully modified and a + representation of the updated resource is returned in the response body. + content: + application/json: + schema: + $ref: '#/components/schemas/MbsPpData' + '204': + description: > + No Content. The Individual MBS Parameters Provisioning resource is successfully + modified. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the deletion of an existing Individual MBS Parameters Provisioning resource. + tags: + - Individual MBS Parameters Provisioning + operationId: DeleteIndMBSParamsProvisioning + responses: + '204': + description: > + No Content. The Individual MBS Parameters Provisioning resource is successfully + deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + + schemas: +# +# STRUCTURED DATA TYPES +# + MbsSessionCreateReq: + description: Represents the parameters to request MBS Session creation. + type: object + properties: + afId: + type: string + mbsSession: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSession' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afId + - mbsSession + + MbsSessionCreateRsp: + description: Represents the parameters to be returned in an MBS Session creation response.. + type: object + properties: + mbsSession: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSession' + eventList: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionEventReportList' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - mbsSession + + MbsSessionSubsc: + description: Represents an MBS Session Subscription. + type: object + properties: + afId: + type: string + subscription: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionSubscription' + subscriptionId: + type: string + required: + - afId + - subscription + + MbsSessionStatusNotif: + description: Represents an MBS Session Status notification. + type: object + properties: + eventList: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MbsSessionEventReportList' + required: + - eventList + + MbsPpData: + description: Represents MBS Parameters Provisioning data. + type: object + properties: + afId: + type: string + mbsSessAuthData: + $ref: '#/components/schemas/MbsSessAuthData' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afId + + MbsSessAuthData: + description: Represents the MBS Session Authorization data. + type: object + properties: + extGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsisList: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minProperties: 1 + description: > + Represents the list of the GPSI(s) of the member UE(s) constituting the multicast MBS + group. Any + value of type can be used as a key of the map. + mbsSessionIdList: + $ref: 'TS29503_Nudm_PP.yaml#/components/schemas/5MbsAuthorizationInfo' + required: + - extGroupId + - mbsSessionIdList + + MbsPpDataPatch: + description: > + Represents the requested modification to existing MBS Parameters Provisioning data. + type: object + properties: + mbsSessAuthData: + $ref: '#/components/schemas/MbsSessAuthData' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + +# +# SIMPLE DATA TYPES +# + +# +# ENUMERATIONS +# diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSTMGI.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSTMGI.yaml new file mode 100644 index 000000000..fc36a816a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSTMGI.yaml @@ -0,0 +1,229 @@ +openapi: 3.0.0 +info: + title: 3gpp-mbs-tmgi + version: 1.0.1 + description: | + API for the allocation, deallocation and management of TMGI(s) for MBS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-mbs-tmgi/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. + +paths: + /allocate: + post: + summary: Request the allocation of TMGI(s) for new MBS session(s) or the refresh of the expiry time of already allocated TMGI(s). + operationId: AllocateTmgi + tags: + - TMGI Allocation or Timer Expiry Refresh + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TmgiAllocRequest' + responses: + '200': + description: > + OK. Successful case. The allocated TMGI(s) or a refreshed expiry time for the concerned + already allocated TMGI(s) is/are returned to the requesting AF. + content: + application/json: + schema: + $ref: '#/components/schemas/TmgiAllocResponse' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + TmgiTimerExpiryNotification: + '{$request.body#/notificationUri}': + post: + requestBody: + description: > + Represents the MBS TMGI(s) timer expiry notification information (e.g. list of + TMGI(s) for which the timer has expired). + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ExpiryNotif' + responses: + '204': + description: No content. The notification is successfully received. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /deallocate: + post: + summary: Request the deallocation of MBS TMGI(s). + operationId: DeallocateTmgi + tags: + - MBS TMGI Deallocation + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TmgiDeallocRequest' + responses: + '204': + description: No Content. Successful case, the TMGI(s) are deallocated. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + + schemas: + TmgiAllocRequest: + description: > + Represents the full set of parameters to initiate an MBS TMGI(s) allocation request + or the refresh of the expiry time of already allocated TMGI(s). + type: object + properties: + afId: + type: string + tmgiParams: + $ref: 'TS29532_Nmbsmf_TMGI.yaml#/components/schemas/TmgiAllocate' + notificationUri: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri' + requestTestNotification: + type: boolean + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afId + - tmgiParams + + TmgiAllocResponse: + description: > + Represents MBS TMGI(s) allocation information or the refreshed expiry time for + already allocated TMGI(s) + type: object + properties: + tmgiInfo: + $ref: 'TS29532_Nmbsmf_TMGI.yaml#/components/schemas/TmgiAllocated' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - tmgiInfo + + TmgiDeallocRequest: + description: Represents information to request the deallocation of MBS TMGI(s). + type: object + properties: + afId: + type: string + tmgis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tmgi' + minItems: 1 + required: + - afId + - tmgis + + ExpiryNotif: + description: Represents MBS TMGI(s) timer expiry notification information. + type: object + properties: + tmgis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tmgi' + minItems: 1 + required: + - tmgis diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSUserDataIngestSession.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSUserDataIngestSession.yaml new file mode 100644 index 000000000..81730cfa2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSUserDataIngestSession.yaml @@ -0,0 +1,649 @@ +openapi: 3.0.0 + +info: + title: 3gpp-mbs-ud-ingest + version: 1.0.1 + description: | + API for MBS User Data Ingest Session. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +servers: + - url: '{apiRoot}/3gpp-mbs-ud-ingest/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122 + +security: + - {} + - oAuth2ClientCredentials: [] + +paths: + /sessions: + get: + summary: Retrieve all the active MBS User Data Ingest Sessions managed by the NEF. + tags: + - MBS User Data Ingest Sessions (Collection) + operationId: RetrieveMBSUserDataIngestSessions + responses: + '200': + description: > + OK. All the active MBS User Data Ingest Sessions managed by the NEF are returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new Individual MBS User Data Ingest Session resource. + tags: + - MBS User Data Ingest Sessions (Collection) + operationId: CreateMBSUserDataIngestSession + requestBody: + description: > + Contains the parameters to request the creation of a new MBS User Data Ingest Session + at the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + responses: + '201': + description: > + Created. A new MBS User Data Ingest Session is successfully created and a representation + of the created Individual MBS User Data Ingest Session resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-mbs-ud-ingest/v1/sessions/{sessionId} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /sessions/{sessionId}: + parameters: + - name: sessionId + in: path + description: Identifier of the Individual MBS User Data Ingest Session resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual MBS User Data Ingest Session resource. + tags: + - Individual MBS User Data Ingest Session (Document) + operationId: RetrieveIndivMBSUserDataIngestSession + responses: + '200': + description: > + OK. The requested Individual MBS User Data Ingest Session resource is successfully + returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual MBS User Data Ingest Session resource. + tags: + - Individual MBS User Data Ingest Session (Document) + operationId: UpdateIndivMBSUserDataIngestSession + requestBody: + description: > + Contains the updated representation of the Individual MBS User Data Ingest Session + resource. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + responses: + '200': + description: > + OK. The concerned Individual MBS User Data Ingest Session resource is successfully + updated and a representation of the updated resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + '204': + description: > + No Content. The concerned Individual MBS User Data Ingest Session resource is + successfully updated. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request the modification of an existing Individual MBS User Data Ingest Session resource. + tags: + - Individual MBS User Data Ingest Session (Document) + operationId: ModifyIndivMBSUserDataIngestSession + requestBody: + description: > + Contains the parameters to request the modification of the Individual MBS User Data Ingest + Session resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSessionPatch' + responses: + '200': + description: > + OK. The concerned Individual MBS User Data Ingest Session resource is successfully + modified and a representation of the updated resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngSession' + '204': + description: > + No Content. The concerned Individual MBS User Data Ingest Session resource is + successfully modified. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing Individual MBS User Data Ingest Session resource. + tags: + - Individual MBS User Data Ingest Session (Document) + operationId: DeleteIndivMBSUserDataIngestSession + responses: + '204': + description: > + No Content. The Individual MBS User Data Ingest Session resource is successfully + deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /status-subscriptions: + get: + summary: Retrieve all the active MBS User Data Ingest Session Status Subscriptions resources managed by the NEF. + tags: + - MBS User Data Ingest Session Status Subscriptions (Collection) + operationId: RetrieveMBSUserDataIngStatSubscs + responses: + '200': + description: > + OK. All the active MBS User Data Ingest Session Status Subscriptions managed by the NEF + are returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - MBS User Data Ingest Session Status Subscriptions (Collection) + operationId: CreateMBSUserDataIngStatSubsc + requestBody: + description: > + Contains the parameters to request the creation of a new MBS User Data Ingest Session + Status Subscription resource. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + responses: + '201': + description: > + Created. Successful creation of a new Individual MBS User Data Ingest Session + Status Subscription resource. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + mbsUserDataIngestSessionStatusNotif: + '{request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatNotif' + responses: + '204': + description: No Content. Successful reception of the notification. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /status-subscriptions/{subscriptionId}: + parameters: + - name: subscriptionId + in: path + description: > + Identifier of the Individual MBS User Data Ingest Session Status Subscription resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - Individual MBS User Data Ingest Session Status Subscription (Document) + operationId: RetrieveIndMBSUserDataIngStatSubsc + responses: + '200': + description: > + OK. Successful retrieval of the requested Individual MBS User Data Ingest Session + Status Subscription resource. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - Individual MBS User Data Ingest Session Status Subscription (Document) + operationId: UpdateIndMBSUserDataIngStatSubsc + requestBody: + description: > + Contains the updated representation of the Individual MBS User Data Ingest Session Status + Subscription resource. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + responses: + '200': + description: > + OK. The concerned Individual MBS User Data Ingest Session Status Subscription resource + is successfully updated and a representation of the updated resource is returned in the + response body. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + '204': + description: > + No Content. The concerned Individual MBS User Data Ingest Session Status Subscription + resource is successfully updated and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request the modification of an existing Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - Individual MBS User Data Ingest Session Status Subscription (Document) + operationId: ModifyIndMBSUserDataIngStatSubsc + requestBody: + description: > + Contains the parameters to request the modification of the Individual MBS User Data Ingest + Session Status Subscription resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubscPatch' + responses: + '200': + description: > + OK. The concerned Individual MBS User Data Ingest Session Status Subscription resource + is successfully modified and a representation of the updated resource is returned in the + response body. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserDataIngestSession.yaml#/components/schemas/MBSUserDataIngStatSubsc' + '204': + description: > + No Content. The concerned Individual MBS User Data Ingest Session Status Subscription + resource is successfully modified and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing Individual MBS User Data Ingest Session Status Subscription resource. + tags: + - Individual MBS User Data Ingest Session Status Subscription (Document) + operationId: DeleteIndMBSUserDataIngStatSubsc + responses: + '204': + description: > + No Content. Successful deletion of the existing Individual MBS User Data Ingest Session + Status Subscription resource. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + +# +# STRUCTURED DATA TYPES +# + +# SIMPLE DATA TYPES +# + +# +# ENUMERATIONS +# diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSUserService.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSUserService.yaml new file mode 100644 index 000000000..f3e5df74a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MBSUserService.yaml @@ -0,0 +1,321 @@ +openapi: 3.0.0 + +info: + title: 3gpp-mbs-us + version: 1.0.1 + description: | + API for MBS User Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +servers: + - url: '{apiRoot}/3gpp-mbs-us/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122 + +security: + - {} + - oAuth2ClientCredentials: [] + +paths: + /mbs-user-services: + get: + summary: Retrieve all the active MBS User Service resources managed by the NEF. + tags: + - MBS User Services + operationId: RetrieveMBSUserServices + responses: + '200': + description: > + OK. All the active MBS User Services managed by the NEF are returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new Individual MBS User Service resource. + tags: + - MBS User Services + operationId: CreateMBSUserService + requestBody: + description: > + Contains the parameters to request the creation of a new MBS User Service at the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + responses: + '201': + description: > + Created. A new MBS User Service is successfully created and a representation of the + created Individual MBS User Service resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/3gpp-mbs-us/v1/mbs-user-services/{mbsUserServId} + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /mbs-user-services/{mbsUserServId}: + parameters: + - name: mbsUserServId + in: path + description: Identifier of the Individual MBS User Service resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual MBS User Service resource. + tags: + - Individual MBS User Service + operationId: RetrieveIndivMBSUserService + responses: + '200': + description: > + OK. The requested Individual MBS User Service resource is successfully returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual MBS User Service resource. + tags: + - Individual MBS User Service + operationId: UpdateIndivMBSUserService + requestBody: + description: > + Contains the updated representation of the Individual MBS User Service resource. + required: true + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + responses: + '200': + description: > + OK. The concerned Individual MBS User Service resource is successfully updated and a + representation of the updated resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + '204': + description: > + No Content. The concerned Individual MBS User Service resource is successfully updated. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Request the modification of an existing Individual MBS User Service resource. + tags: + - Individual MBS User Service + operationId: ModifyIndivMBSUserService + requestBody: + description: > + Contains the parameters to request the modification of the Individual MBS User + Service resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserServicePatch' + responses: + '200': + description: > + OK. The concerned Individual MBS User Service resource is successfully modified and a + representation of the updated resource is returned. + content: + application/json: + schema: + $ref: 'TS29580_Nmbsf_MBSUserService.yaml#/components/schemas/MBSUserService' + '204': + description: > + No Content. The concerned Individual MBS User Service resource is successfully modified. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an existing Individual MBS User Service resource. + tags: + - Individual MBS User Service + operationId: DeleteIndivMBSUserService + responses: + '204': + description: > + No Content. The Individual MBS User Service resource is successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + +# +# STRUCTURED DATA TYPES +# + +# SIMPLE DATA TYPES +# + +# +# ENUMERATIONS +# diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MSEventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MSEventExposure.yaml new file mode 100644 index 000000000..8a7eab0ae --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MSEventExposure.yaml @@ -0,0 +1,314 @@ +openapi: 3.0.0 + +info: + title: 3gpp-ms-event-exposure + version: 1.0.1 + description: | + API for Media Streaming Event Exposure. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' + +servers: + - url: '{apiRoot}/3gpp-ms-event-exposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122 + +security: + - {} + - oAuth2ClientCredentials: [] + +paths: + /subscriptions: + get: + summary: Retrieve all the active Media Streaming Event Exposure Subscription resources managed by the NEF. + tags: + - Media Streaming Event Exposure Subscriptions (Collection) + operationId: RetrieveMSEventExposureSubscs + responses: + '200': + description: > + OK. All the active Media Streaming Event Exposure Subscriptions managed by the NEF are + returned. + content: + application/json: + schema: + type: array + items: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Request the creation of a new Individual Media Streaming Event Exposure Subscription resource. + tags: + - Media Streaming Event Exposure Subscriptions (Collection) + operationId: CreateMSEventExposureSubsc + requestBody: + description: > + Contains the parameters to request the creation of a new Media Streaming Event Exposure + Subscriptionat the NEF. + required: true + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + responses: + '201': + description: > + Created. Successful creation of a new Individual Media Streaming Event Exposure + Subscription resource. + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + msEventExposureNotif: + '{request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureNotif' + responses: + '204': + description: No Content. Successful reception of the notification. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + + /subscriptions/{subscriptionId}: + parameters: + - name: subscriptionId + in: path + description: Identifier of the Individual Media Streaming Event Exposure Subscription resource. + required: true + schema: + type: string + + get: + summary: Retrieve an existing Individual Media Streaming Event Exposure Subscription resource. + tags: + - Individual Media Streaming Event Exposure Subscription (Document) + operationId: RetrieveIndivMSEventExposureSubsc + responses: + '200': + description: > + OK. The requested Individual Media Streaming Event Exposure Subscription resource is + successfully returned. + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Request the update of an existing Individual Media Streaming Event Exposure Subscription resource. + tags: + - Individual Media Streaming Event Exposure Subscription (Document) + operationId: UpdateIndivMSEventExposureSubsc + requestBody: + description: > + Contains the updated representation of the Individual Media Streaming Event Exposure + Subscription resource. + resource. + required: true + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + responses: + '200': + description: > + OK. The concerned Individual Media Streaming Event Exposure Subscription resource is + successfully updated and a representation of the updated resource is returned in the + response body. + content: + application/json: + schema: + $ref: 'TS29517_Naf_EventExposure.yaml#/components/schemas/AfEventExposureSubsc' + '204': + description: > + No Content. The concerned Individual Media Streaming Event Exposure Subscription + resource was successfully updated and no content is returned in the response body. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Request the deletion of an existing Individual Media Streaming Event Exposure Subscription resource. + tags: + - Individual Media Streaming Event Exposure Subscription (Document) + operationId: DeleteIndivMSEventExposureSubsc + responses: + '204': + description: > + No Content. The Individual Media Streaming Event Exposure Subscription resource is + successfully deleted. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + +# +# STRUCTURED DATA TYPES +# + +# SIMPLE DATA TYPES +# + +# +# ENUMERATIONS +# + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MoLcsNotify.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MoLcsNotify.yaml new file mode 100644 index 000000000..8d5acd6e1 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_MoLcsNotify.yaml @@ -0,0 +1,103 @@ +openapi: 3.0.0 +info: + title: 3gpp-mo-lcs-notify + version: 1.1.1 + description: | + API for UE updated location information notification. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-mo-lcs-notify/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /: + post: + summary: UE location information update notification + operationId: UELocationNotify + tags: + - AF level UE location update notification operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocUpdateData' + required: true + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/LocUpdateDataReply' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + LocUpdateData: + description: Represents a UE updated location information. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + locInfo: + $ref: 'TS29122_MonitoringEvent.yaml#/components/schemas/LocationInfo' + lcsQosClass: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/LcsQosClass' + svcId: + $ref: 'TS29515_Ngmlc_Location.yaml#/components/schemas/ServiceIdentity' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - gpsi + - lcsQosClass + - locInfo + - suppFeat + LocUpdateDataReply: + description: Represents a reply to a MO LCS notification. + type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - suppFeat diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_NIDDConfigurationTrigger.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_NIDDConfigurationTrigger.yaml new file mode 100644 index 000000000..0d9bf661b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_NIDDConfigurationTrigger.yaml @@ -0,0 +1,102 @@ +openapi: 3.0.0 +info: + title: 3gpp-nidd-configuration-trigger + version: 1.1.1 + description: | + API for NIDD Configuration Trigger. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /: + post: + operationId: NiddConfigurationTrigger + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfigurationTrigger' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/NiddConfigurationTriggerReply' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + NiddConfigurationTrigger: + description: Represents a NIDD configuration trigger. + type: object + properties: + afId: + type: string + description: Identifies the trigger receiving entity. + nefId: + type: string + description: Identifies the trigger sending entity. + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - afId + - nefId + - gpsi + - suppFeat + NiddConfigurationTriggerReply: + description: Represents a reply to a NIDD configuration trigger. + type: object + properties: + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - suppFeat + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ServiceParameter.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ServiceParameter.yaml new file mode 100644 index 000000000..68b570886 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_ServiceParameter.yaml @@ -0,0 +1,739 @@ +openapi: 3.0.0 +info: + title: 3gpp-service-parameter + version: 1.1.2 + description: | + API for AF service paramter + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.8.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-service-parameter/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Service Parameter Subscriptions + parameters: + - name: gpsis + in: query + description: The GPSI of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + - name: ip-addrs + in: query + description: The IP address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + minItems: 1 + - name: ip-domain + in: query + description: > + The IPv4 address domain identifier. The attribute may only be provided + if IPv4 address is included in the ip-addrs query parameter. + required: false + schema: + type: string + - name: mac-addrs + in: query + description: The MAC address(es) of the requested UE(s). + required: false + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + minItems: 1 + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceParameterData' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateAnSubscription + tags: + - Service Parameter Subscriptions + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + notificationDestination: + '{$request.body#/notificationDestination}': + post: + requestBody: + description: > + Notifications upon AF Service Parameter Authorization Update, + and/or AF subscribed event notification of the outcome related + to the invocation of service parameters provisioning. + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AfNotification' + minItems: 1 + responses: + '204': + description: Expected response to a successful callback processing without a body + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + get: + summary: read an active subscriptions for the SCS/AS and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Service Parameter Subscription + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual Service Parameter Subscription + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: OK (Successful update of the subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partial updates/replaces an existing subscription resource + operationId: PartialUpdateAnSubscription + tags: + - Individual Service Parameter Subscription + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/ServiceParameterDataPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceParameterData' + '204': + description: OK. The subscription was modified successfully. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Service Parameter Subscription + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + ServiceParameterData: + description: Represents an individual Service Parameter subscription resource. + type: object + properties: + afServiceId: + type: string + description: Identifies a service on behalf of which the AF is issuing the request. + appId: + type: string + description: Identifies an application. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + anyUeInd: + type: boolean + description: > + Identifies whether the AF request applies to any UE. This attribute + shall set to "true" if applicable for any UE, otherwise, set to "false". + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + subNotifEvents: + type: array + items: + $ref: '#/components/schemas/Event' + minItems: 1 + notificationDestination: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + requestTestNotification: + type: boolean + description: > + Set to true by the AF to request the NEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + paramOverPc5: + $ref: '#/components/schemas/ParameterOverPc5' + paramOverUu: + $ref: '#/components/schemas/ParameterOverUu' + paramForProSeDd: + $ref: '#/components/schemas/ParamForProSeDd' + paramForProSeDc: + $ref: '#/components/schemas/ParamForProSeDc' + paramForProSeU2NRelUe: + $ref: '#/components/schemas/ParamForProSeU2NRelUe' + paramForProSeRemUe: + $ref: '#/components/schemas/ParamForProSeRemUe' + urspGuidance: + type: array + items: + $ref: '#/components/schemas/UrspRuleRequest' + minItems: 1 + description: Contains the service parameter used to guide the URSP. + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + ServiceParameterDataPatch: + description: > + Represents the parameters to request the modification of a service parameter + subscription resource. + type: object + properties: + paramOverPc5: + $ref: '#/components/schemas/ParameterOverPc5Rm' + paramOverUu: + $ref: '#/components/schemas/ParameterOverUuRm' + paramForProSeDd: + $ref: '#/components/schemas/ParamForProSeDdRm' + paramForProSeDc: + $ref: '#/components/schemas/ParamForProSeDcRm' + paramForProSeU2NRelUe: + $ref: '#/components/schemas/ParamForProSeU2NRelUeRm' + paramForProSeRemUe: + $ref: '#/components/schemas/ParamForProSeRemUeRm' + urspGuidance: + type: array + items: + $ref: '#/components/schemas/UrspRuleRequest' + minItems: 1 + description: Contains the service parameter used to guide the URSP. + subNotifEvents: + type: array + items: + $ref: '#/components/schemas/Event' + minItems: 1 + nullable: true + notificationDestination: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ParameterOverPc5: + description: > + Represents configuration parameters for V2X communications over PC5 reference point. + type: string + ParameterOverPc5Rm: + description: > + Represents the same as the ParameterOverPc5 data type but with the nullable:true property. + type: string + nullable: true + ParameterOverUu: + description: > + Represents configuration parameters for V2X communications over Uu reference point. + type: string + ParameterOverUuRm: + description: > + Represents the same as the ParameterOverUu data type but with the nullable:true property. + type: string + nullable: true + ParamForProSeDd: + description: Represents the service parameters for 5G ProSe direct discovery. + type: string + ParamForProSeDdRm: + description: > + This data type is defined in the same way as the ParamForProSeDd data type, + but with the OpenAPI nullable property set to true. + type: string + nullable: true + ParamForProSeDc: + description: Represents the service parameters for 5G ProSe direct communications. + type: string + ParamForProSeDcRm: + description: > + This data type is defined in the same way as the ParamForProSeDc data type, + but with the OpenAPI nullable property set to true. + type: string + nullable: true + ParamForProSeU2NRelUe: + description: Represents the service parameters for 5G ProSe UE-to-network relay UE. + type: string + ParamForProSeU2NRelUeRm: + description: > + This data type is defined in the same way as the ParamForProSeU2NRelay data type, + but with the OpenAPI nullable property set to true. + type: string + nullable: true + ParamForProSeRemUe: + description: Represents the service parameters for 5G ProSe Remate UE. + type: string + ParamForProSeRemUeRm: + description: > + This data type is defined in the same way as the ParamForProSeRemUe data type, + but with the OpenAPI nullable property set to true. + type: string + nullable: true + UrspRuleRequest: + description: Contains parameters that can be used to guide the URSP. + type: object + properties: + trafficDesc: + $ref: '#/components/schemas/TrafficDescriptorComponents' + relatPrecedence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + routeSelParamSets: + type: array + items: + $ref: '#/components/schemas/RouteSelectionParameterSet' + minItems: 1 + description: > + Sets of parameters that may be used to guide the Route Selection Descriptors of the + URSP. + RouteSelectionParameterSet: + description: > + Contains parameters that can be used to guide the Route Selection + Descriptors of the URSP. + type: object + properties: + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + precedence: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + spatialValidityAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: > + Indicates where the route selection parameters apply. It may correspond + to a geographical area, for example using a geographic shape that + is known to the AF and is configured by the operator to correspond to a list + of or TAIs. + spatialValidityTais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + description: > + Indicates the TAIs in which the route selection parameters apply. This attribute is + applicable only within the 5GC and it shall not be included in the request messages of + untrusted AFs for URSP guidance. + Event: + anyOf: + - type: string + enum: + - SUCCESS_UE_POL_DEL_SP + - UNSUCCESS_UE_POL_DEL_SP + - type: string + description: > + This string identifies AF subscribe to event(s) notifications related to + AF provisioned service parameters. + description: | + Possible values are: + - SUCCESS_UE_POL_DEL_SP: Successful UE Policy Delivery related to + the invocation of AF provisioned Service Parameters. + - UNSUCCESS_UE_POL_DEL_SP: Unsuccessful UE Policy Delivery related to the invocation of AF + provisioned Service Parameters. + AfNotification: + description: > + Notifications upon AF Service Parameter Authorization Update e.g. to + revoke the authorization, and/or AF subscribed event notification of the + outcome related to the invocation of service parameter provisioning. + type: object + properties: + subscription: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + reportEvent: + $ref: '#/components/schemas/Event' + authResult: + $ref: '#/components/schemas/AuthorizationResult' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + eventInfo: + $ref: '#/components/schemas/EventInfo' + required: + - subscription + anyOf: + - required: [reportEvent] + - required: [authResult] + TrafficDescriptorComponents: + description: Traffic descriptor components for the requested URSP. + type: object + properties: + appDescs: + type: object + additionalProperties: + $ref: 'TS29522_5GLANParameterProvision.yaml#/components/schemas/AppDescriptor' + minProperties: 1 + description: Describes the operation systems and the corresponding applications for each + operation systems. The key of map is osId. + flowDescs: + type: array + items: + type: string + minItems: 1 + description: Represents a 3-tuple with protocol, server ip and server port for UL/DL + application traffic. The content of the string has the same encoding as the IPFilterRule + AVP value as defined in IETF RFC 6733. + domainDescs: + type: array + items: + type: string + minItems: 1 + description: FQDN(s) or a regular expression which are used as a domain name matching + criteria. + ethFlowDescs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Descriptor(s) for destination information of non-IP traffic in which only + ethernet flow description is defined. + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + description: This is matched against the DNN information provided by the application. + connCaps: + type: array + items: + $ref: '#/components/schemas/ConnectionCapabilities' + minItems: 1 + description: This is matched against the information provided by a UE application when it + requests a network connection with certain capabilities. + anyOf: + - required: [appDescs] + - required: [flowDescs] + - required: [domainDescs] + - required: [ethFlowDescs] + - required: [dnns] + - required: [connCaps] + AuthorizationResult: + anyOf: + - type: string + enum: + - AUTH_REVOKED + - type: string + description: > + This string indicates NEF notify the AF about the service parameters authorization + updates result. + description: | + Possible values are: + - AUTH_REVOKED: Indicated the service parameters authorization is revoked. + EventInfo: + description: Indicates the event information. + type: object + properties: + failureCause: + $ref: '#/components/schemas/Failure' + Failure: + oneOf: + - type: string + enum: + - UNSPECIFIED + - UE_NOT_REACHABLE + - UNKNOWN + - UE_TEMP_UNREACHABLE + - type: string + description: > + This string represents the failure reason for the unsuccessful result. May be + present if the reported afSubEvent attribute is "UNSUCCESS_UE_POL_DEL_SP". + description: | + Possible values are: + - UNSPECIFIED: Indicates the PCF received the UE sent UE policy delivery service cause #111 + (Protocol error, unspecified). + - UE_NOT_REACHABLE: Indicates the PCF received the notification from the AMF that the UE is + not reachable. + - UNKNOWN: Indicates unknown reasons upon no response from the UE, e.g. UPDS message type is + not defined or not implemented by the UE, or not compatible with the UPDS state, in which + the UE shall ignore the UPDS message. + - UE_TEMP_UNREACHABLE: Indicates the PCF received the notification from the AMF that the UE + is not reachable but the PCF will retry again. + ConnectionCapabilities: + anyOf: + - type: string + enum: + - IMS + - MMS + - SUPL + - INTERNET + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: > + Possible values are + - IMS: Indicates the connection capability to support IMS service. + - MMS: Indicates the connection capability to support MMS service. + - SUPL: Indicates the connection capability to support SUPL service. + - INTERNET: Indicates the connection capability to support Internet service. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_TimeSyncExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_TimeSyncExposure.yaml new file mode 100644 index 000000000..5ea93fe7a --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_TimeSyncExposure.yaml @@ -0,0 +1,1016 @@ +openapi: 3.0.0 +info: + title: 3gpp-time-sync-exposure + version: 1.0.1 + description: | + API for time synchronization exposure. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-time-sync/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. +paths: + /{afId}/subscriptions: + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Time Synchronization Exposure Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active subscriptions for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateNewSubscription + tags: + - Time Synchronization Exposure Subscriptions + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + requestBody: + description: new subscription creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + timeSyncSubsNotification: + '{$request.body#/subsNotifUri}': + post: + requestBody: + description: Notification for Time Synchronization Capability for a list of UEs. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsNotif' + responses: + '204': + description: Expected response to a successful callback processing without a body + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Time Synchronization Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual Time Synchronization Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + responses: + '200': + description: OK (Successful deletion of the existing subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureSubsc' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Time Synchronization Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}/configurations: + get: + summary: read all of the active configurations for the AF + operationId: ReadAllConfirguations + tags: + - Time Synchronization Exposure Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + description: String identifying the individual synchronization Exposure Subscription resource in the NEF + in: path + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get all of the active configurations for the AF) + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TimeSyncExposureConfig' + minItems: 0 + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new configuration resource + operationId: CreateNewConfirguation + tags: + - Time Synchronization Exposure Configurations + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + description: > + String identifying the individual synchronization Exposure Subscription + resource in the NEF. + in: path + required: true + schema: + type: string + requestBody: + description: new configuration creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + responses: + '201': + description: Created (Successful creation) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + headers: + Location: + description: 'Contains the URI of the newly created resource' + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + callbacks: + timeSyncConfigNotification: + '{$request.body#/configNotifUri}': + post: + requestBody: + description: Notification for Time Synchronization Service status. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfigNotif' + responses: + '204': + description: Expected response to a successful callback processing without a body + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}/configurations/{instanceReference}: + get: + summary: read an active subscription for the AF and the subscription Id + operationId: ReadTimeSynSubscription + tags: + - Individual Time Synchronization Exposure Subscription + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + - name: instanceReference + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing configuration resource + operationId: FullyUpdateAnConfiguration + tags: + - Individual Time Synchronization Exposure Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + - name: instanceReference + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing configuration + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + responses: + '200': + description: OK (Successful deletion of the existing configuration) + content: + application/json: + schema: + $ref: '#/components/schemas/TimeSyncExposureConfig' + '204': + description: > + Successful case. The resource has been successfully updated and no additional + content is to be sent in the response message. + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing configuration + operationId: DeleteAnConfiguration + tags: + - Individual Time Synchronization Exposure Configuration + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + - name: instanceReference + in: path + description: Identifier of the configuration resource + required: true + schema: + type: string + responses: + '204': + description: No Content (Successful deletion of the existing configuration) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + TimeSyncExposureSubsc: + description: > + Contains requested parameters for the subscription to the notification + of time synchronization capability. + type: object + properties: + exterGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + gpsis: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + minItems: 1 + description: > + Contains a list of UE for which the time synchronization capabilities is requested. + anyUeInd: + type: boolean + description: > + Any UE indication. This IE shall be present if the event subscription + is applicable to any UE. Default value "false" is used, if not present. + afServiceId: + type: string + description: Identifies a service on behalf of which the AF is issuing the request. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + subsNotifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + subsNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/SubscribedEvent' + minItems: 1 + description: Subscribed events + eventFilters: + type: array + items: + $ref: '#/components/schemas/EventFilter' + minItems: 1 + description: > + Contains the filter conditions to match for notifying the event(s) + of time synchronization capabilities for a list of UE(s). + notifMethod: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + requestTestNotification: + type: boolean + description: > + Set to true by the SCS/AS to request the SCEF to send a test notification + as defined in clause 5.2.5.3 of 3GPP TS 29.122. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - subsNotifUri + - subsNotifId + TimeSyncCapability: + description: Contains time synchronization capability. + type: object + properties: + upNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + gmCapables: + type: array + items: + $ref: '#/components/schemas/GmCapable' + asTimeRes: + $ref: '#/components/schemas/AsTimeResource' + ptpCapForUes: + type: object + additionalProperties: + $ref: '#/components/schemas/PtpCapabilitiesPerUe' + minProperties: 1 + description: > + Contains the PTP capabilities supported by each of the UE(s). + The key of the map is the gpsi. + required: + - upNodeId + anyOf: + - required: [gmCapables] + - required: [asTimeRes] + + TimeSyncExposureConfig: + description: Contains the Time Synchronization Configuration parameters. + type: object + properties: + upNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + reqPtpIns: + $ref: '#/components/schemas/PtpInstance' + gmEnable: + type: boolean + description: > + Indicates that the AF requests 5GS to act as a grandmaster for PTP + or gPTP if it is included and set to true. + gmPrio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + timeDom: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + timeSyncErrBdgt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + configNotifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + configNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + tempValidity: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + required: + - upNodeId + - reqPtpIns + - timeDom + - configNotifId + - configNotifUri + + TimeSyncExposureSubsNotif: + description: Contains the notification of time synchronization capability. + type: object + properties: + subsNotifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + eventNotifs: + type: array + items: + $ref: '#/components/schemas/SubsEventNotification' + minItems: 1 + required: + - subsNotifId + - eventNotifs + + SubsEventNotification: + description: Notifications about subscribed Individual Events. + type: object + properties: + event: + $ref: '#/components/schemas/SubscribedEvent' + timeSyncCapas: + type: array + items: + $ref: '#/components/schemas/TimeSyncCapability' + minItems: 1 + required: + - event + + TimeSyncExposureConfigNotif: + description: Contains the notification of time synchronization service state. + type: object + properties: + configNotifId: + type: string + description: Notification Correlation ID assigned by the NF service consumer. + stateOfConfig: + $ref: '#/components/schemas/StateOfConfiguration' + required: + - configNotifId + - stateOfConfig + PtpCapabilitiesPerUe: + description: Contains the supported PTP capabilities per UE. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ptpCaps: + type: array + items: + $ref: '#/components/schemas/EventFilter' + minItems: 1 + required: + - gpsi + - ptpCaps + EventFilter: + description: > + Contains the filter conditions to match for notifying the event(s) of time + synchronization capabilities. + type: object + properties: + instanceTypes: + type: array + items: + $ref: '#/components/schemas/InstanceType' + minItems: 1 + transProtocols: + type: array + items: + $ref: '#/components/schemas/Protocol' + minItems: 1 + ptpProfiles: + type: array + items: + type: string + minItems: 1 + PtpInstance: + description: Contains PTP instance configuration and activation requested by the AF. + type: object + properties: + instanceType: + $ref: '#/components/schemas/InstanceType' + protocol: + $ref: '#/components/schemas/Protocol' + ptpProfile: + type: string + portConfigs: + type: array + items: + $ref: '#/components/schemas/ConfigForPort' + minItems: 1 + required: + - instanceType + - protocol + - ptpProfile + + ConfigForPort: + description: Contains configuration for each port. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + n6Ind: + type: boolean + ptpEnable: + type: boolean + logSyncInter: + type: integer + logSyncInterInd: + type: boolean + logAnnouInter: + type: integer + logAnnouInterInd: + type: boolean + + StateOfConfiguration: + description: Contains the state of the time synchronization configuration. + type: object + properties: + stateOfNwtt: + type: boolean + description: > + When the PTP port state is Leader, Follower or Passive, it is included and set to true + to indicate the state of configuration for NW-TT port is active; when PTP port state is + in any other case, it is included and set to false to indicate the state of + configuration for NW-TT port is inactive. Default value is false. + stateOfDstts: + description: > + Contains the PTP port states of the DS-TT(s). + type: array + items: + $ref: '#/components/schemas/StateOfDstt' + minItems: 1 + StateOfDstt: + description: Contains the PTP port state of a DS-TT. + type: object + properties: + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + state: + type: boolean + description: > + When the PTP port state is Leader, Follower or Passive, it is included and set to true + to indicate the state of configuration for DS-TT port is active; when PTP port state is + in any other case, it is included and set to false to indicate the state of + configuration for DS port is inactive. Default value is false. + required: + - gpsi + - state + + Protocol: + anyOf: + - type: string + enum: + - ETH + - IPV4 + - IPV6 + - type: string + description: > + This string identifies supported protocol. + description: | + Possible values are: + - ETH: Indicates Ethernet as defined in IEEE Std 1588 [45] Annex E is supported. + - IPV4: Indicates IPv4 as defined in IEEE Std 1588 [45] Annex C is supported. + - IPV6: Indicates IPv6 as defined in IEEE Std 1588 [45] Annex D is supported. + + GmCapable: + anyOf: + - type: string + enum: + - GPTP + - PTP + - type: string + description: > + This string identifies supported grandmaster. + description: | + Possible values are: + - GPTP: gPTP grandmaster is supported. + - PTP: PTP grandmaste is supported. + InstanceType: + anyOf: + - type: string + enum: + - BOUNDARY_CLOCK + - E2E_TRANS_CLOCK + - P2P_TRANS_CLOCK + - P2P_RELAY_INSTANCE + - type: string + description: > + This string identifies supported PTP instance type. + description: | + Possible values are: + - BOUNDARY_CLOCK: Indicates Boundary Clock as defined in IEEE Std 1588. + - E2E_TRANS_CLOCK: Indicates End-to-End Transparent Clock as defined in IEEE Std 1588. + - P2P_TRANS_CLOCK: Indicates Peer-to-Peer Transparent Clock as defined in IEEE Std 1588. + - P2P_RELAY_INSTANCE: Indicates PTP Relay instance as defined in IEEE Std 802.1AS. + + SubscribedEvent: + anyOf: + - type: string + enum: + - AVAILABILITY_FOR_TIME_SYNC_SERVICE + - type: string + description: > + This string identifies supported event. + description: | + Possible values are: + - AVAILABILITY_FOR_TIME_SYNC_SERVICE: The UE is availability for time synchronization service. + + AsTimeResource: + anyOf: + - type: string + enum: + - ATOMIC_CLOCK + - GNSS + - TERRESTRIAL_RADIO + - SERIAL_TIME_CODE + - PTP + - NTP + - HAND_SET + - INTERNAL_OSCILLATOR + - OTHER + - type: string + description: > + This string identifies the supported 5G clock quality. + description: | + Possible values are: + - ATOMIC_CLOCK: Indicates atomic clock is supported. + - GNSS: Indicates Global Navigation Satellite System is supported. + - TERRESTRIAL_RADIO: Indicates terrestrial radio is supported. + - SERIAL_TIME_CODE: Indicates serial time code is supported. + - PTP: Indicates PTP is supported. + - NTP: Indicates NTP is supported. + - HAND_SET: Indicates hand set is supported. + - INTERNAL_OSCILLATOR: Indicates internal oscillator is supported. + - OTHER: Indicates other source of time is supported. diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_TrafficInfluence.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_TrafficInfluence.yaml new file mode 100644 index 000000000..b89f506df --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_TrafficInfluence.yaml @@ -0,0 +1,706 @@ +openapi: 3.0.0 +info: + title: 3gpp-traffic-influence + version: 1.2.1 + description: | + API for AF traffic influence + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] +servers: + - url: '{apiRoot}/3gpp-traffic-influence/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122. + +paths: + /{afId}/subscriptions: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + get: + summary: read all of the active subscriptions for the AF + operationId: ReadAllSubscriptions + tags: + - Traffic Influence Subscription + responses: + '200': + description: OK. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TrafficInfluSub' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + post: + summary: Creates a new subscription resource + operationId: CreateNewSubscription + tags: + - Traffic Influence Subscription + requestBody: + description: Request to create a new subscription resource + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + callbacks: + notificationDestination: + '{request.body#/notificationDestination}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventNotification' + callbacks: + afAcknowledgement: + '{request.body#/afAckUri}': + post: + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AfAckInfo' + responses: + '204': + description: No Content (successful acknowledgement) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '204': + description: No Content (successful notification) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + responses: + '201': + description: Created (Successful creation of subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + headers: + Location: + description: Contains the URI of the newly created resource. + required: true + schema: + type: string + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + /{afId}/subscriptions/{subscriptionId}: + parameters: + - name: afId + in: path + description: Identifier of the AF + required: true + schema: + type: string + - name: subscriptionId + in: path + description: Identifier of the subscription resource + required: true + schema: + type: string + get: + summary: read an active subscriptions for the SCS/AS and the subscription Id + operationId: ReadAnSubscription + tags: + - Individual Traffic Influence Subscription + responses: + '200': + description: OK (Successful get the active subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29122_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + put: + summary: Fully updates/replaces an existing subscription resource + operationId: FullyUpdateAnSubscription + tags: + - Individual Traffic Influence Subscription + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + patch: + summary: Partially updates/replaces an existing subscription resource + operationId: PartialUpdateAnSubscription + tags: + - Individual Traffic Influence Subscription + requestBody: + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/TrafficInfluSubPatch' + responses: + '200': + description: OK. The subscription was modified successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/TrafficInfluSub' + '204': + description: No Content + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + + delete: + summary: Deletes an already existing subscription + operationId: DeleteAnSubscription + tags: + - Individual Traffic Influence Subscription + responses: + '204': + description: No Content (Successful deletion of the existing subscription) + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + TrafficInfluSub: + description: Represents a traffic influence subscription. + type: object + properties: + afServiceId: + type: string + description: Identifies a service on behalf of which the AF is issuing the request. + afAppId: + type: string + description: Identifies an application. + afTransId: + type: string + description: Identifies an NEF Northbound interface transaction, generated by the AF. + appReloInd: + type: boolean + description: > + Identifies whether an application can be relocated once a location of + the application has been selected. + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + externalGroupId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalGroupId' + anyUeInd: + type: boolean + description: > + Identifies whether the AF request applies to any UE. This attribute shall + set to "true" if applicable for any UE, otherwise, set to "false". + subscribedEvents: + type: array + items: + $ref: '#/components/schemas/SubscribedEvent' + minItems: 1 + description: Identifies the requirement to be notified of the event(s). + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ipv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + ipDomain: + type: string + ipv6Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv6Addr' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + requestTestNotification: + type: boolean + description: > + Set to true by the SCS/AS to request the NEF to send a test notification + as defined in clause 5.2.5.3. Set to false or omitted otherwise. + websockNotifConfig: + $ref: 'TS29122_CommonData.yaml#/components/schemas/WebsockNotifConfig' + self: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Identifies IP packet filters. + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet filters. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + tfcCorrInd: + type: boolean + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + validGeoZoneIds: + type: array + items: + type: string + minItems: 1 + description: > + Identifies a geographic zone that the AF request applies only to the traffic + of UE(s) located in this specific zone. + deprecated: true + geoAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: Identifies geographical areas within which the AF request applies. + afAckInd: + type: boolean + addrPreserInd: + type: boolean + simConnInd: + type: boolean + description: > + Indicates whether simultaneous connectivity should be temporarily + maintained for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required for the application if it is included and set to "true". + eventReq: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + eventReports: + type: array + items: + $ref: '#/components/schemas/EventNotification' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + allOf: + - oneOf: + - required: [afAppId] + - required: [trafficFilters] + - required: [ethTrafficFilters] + - oneOf: + - required: [ipv4Addr] + - required: [ipv6Addr] + - required: [macAddr] + - required: [gpsi] + - required: [externalGroupId] + - required: [anyUeInd] + anyOf: + - not: + required: [subscribedEvents] + - required: [notificationDestination] + TrafficInfluSubPatch: + description: > + Represents parameters to request the modification of a traffic influence + subscription resource. + type: object + properties: + appReloInd: + type: boolean + description: > + Identifies whether an application can be relocated once a location of + the application has been selected. + nullable: true + trafficFilters: + type: array + items: + $ref: 'TS29122_CommonData.yaml#/components/schemas/FlowInfo' + minItems: 1 + description: Identifies IP packet filters. + ethTrafficFilters: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + description: Identifies Ethernet packet filters. + trafficRoutes: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + minItems: 1 + description: Identifies the N6 traffic routing requirement. + tfcCorrInd: + type: boolean + nullable: true + tempValidities: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/TemporalValidity' + minItems: 1 + nullable: true + validGeoZoneIds: + type: array + items: + type: string + minItems: 1 + description: > + Identifies a geographic zone that the AF request applies only to the traffic + of UE(s) located in this specific zone. + nullable: true + deprecated: true + geoAreas: + type: array + items: + $ref: 'TS29522_AMPolicyAuthorization.yaml#/components/schemas/GeographicalArea' + minItems: 1 + description: Identifies geographical areas within which the AF request applies. + nullable: true + afAckInd: + type: boolean + nullable: true + addrPreserInd: + type: boolean + nullable: true + simConnInd: + type: boolean + description: > + Indicates whether simultaneous connectivity should be temporarily maintained + for the source and target PSA. + simConnTerm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + maxAllowedUpLat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm' + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + nullable: true + easRedisInd: + type: boolean + description: Indicates the EAS rediscovery is required for the application if it is included and set to "true". + notificationDestination: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + eventReq: + $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation' + EventNotification: + description: Represents a traffic influence event notification. + type: object + properties: + afTransId: + type: string + description: Identifies an NEF Northbound interface transaction, generated by the AF. + dnaiChgType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DnaiChangeType' + sourceTrafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + subscribedEvent: + $ref: '#/components/schemas/SubscribedEvent' + targetTrafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + sourceDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + targetDnai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + srcUeIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + srcUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + tgtUeIpv4Addr: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Ipv4Addr' + tgtUeIpv6Prefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + afAckUri: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Link' + required: + - dnaiChgType + - subscribedEvent + AfResultInfo: + description: Identifies the result of application layer handling. + type: object + properties: + afStatus: + $ref: '#/components/schemas/AfResultStatus' + trafficRoute: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation' + upBuffInd: + type: boolean + description: > + If present and set to "true" it indicates that buffering of uplink traffic + to the target DNAI is needed. + easIpReplaceInfos: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EasIpReplacementInfo' + minItems: 1 + description: Contains EAS IP replacement information. + required: + - afStatus + AfAckInfo: + description: Represents acknowledgement information of a traffic influence event notification. + type: object + properties: + afTransId: + type: string + ackResult: + $ref: '#/components/schemas/AfResultInfo' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + required: + - ackResult + SubscribedEvent: + anyOf: + - type: string + enum: + - UP_PATH_CHANGE + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - UP_PATH_CHANGE: The AF requests to be notified when the UP path changes for the PDU session. + AfResultStatus: + anyOf: + - type: string + enum: + - SUCCESS + - TEMPORARY_CONGESTION + - RELOC_NO_ALLOWED + - OTHER + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - SUCCESS: The application layer is ready or the relocation is completed. + - TEMPORARY_CONGESTION: The application relocation fails due to temporary congestion. + - RELOC_NO_ALLOWED: The application relocation fails because application relocation is not allowed. + - OTHER: The application relocation fails due to other reason. + + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_UEId.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_UEId.yaml new file mode 100644 index 000000000..3228da69e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29522_UEId.yaml @@ -0,0 +1,111 @@ +openapi: 3.0.0 + +info: + title: 3gpp-ueid + version: 1.0.1 + description: | + API for UE ID service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.522 V17.7.0; 5G System; Network Exposure Function Northbound APIs. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/' +security: + - {} + - oAuth2ClientCredentials: [] + +servers: + - url: '{apiRoot}/3gpp-ueid/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122. + +paths: + /retrieve: + post: + summary: Retrieve AF specific UE ID. + operationId: RetrieveUEId + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UeIdReq' + responses: + '200': + description: The requested information was returned successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/UeIdInfo' + '307': + $ref: 'TS29122_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29122_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29122_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29122_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29122_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29122_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29122_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29122_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29122_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29122_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29122_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29122_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29122_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{tokenUrl}' + scopes: {} + schemas: + UeIdReq: + description: Represents the parameters to request the retrieval of AF specific UE ID. + type: object + properties: + afId: + type: string + appPortId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/Port' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ipDomain: + type: string + mtcProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MtcProviderInformation' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + ueIpAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + ueMacAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + required: + - afId + oneOf: + - required: [ueIpAddr] + - required: [ueMacAddr] + UeIdInfo: + description: Represents UE ID information. + type: object + properties: + externalId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/ExternalId' + required: + - externalId diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29523_Npcf_EventExposure.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29523_Npcf_EventExposure.yaml new file mode 100644 index 000000000..98917151b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29523_Npcf_EventExposure.yaml @@ -0,0 +1,498 @@ +openapi: 3.0.0 +info: + version: 1.2.0 + title: Npcf_EventExposure + description: | + PCF Event Exposure Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.523 V17.7.0; 5G System; Policy Control Event Exposure Service; Stage 3. + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.523/ + +servers: + - url: '{apiRoot}/npcf-eventexposure/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - npcf-eventexposure + +paths: + /subscriptions: + post: + summary: Creates a new Individual Policy Control Events Subscription resource + operationId: PostPcEventExposureSubsc + tags: + - Policy Control Events Subscription (Collection) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + responses: + '201': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + headers: + Location: + description: > + Contains the URI of the created individual policy control events subscription + resource, according to the structure + {apiRoot}/npcf-eventexposure/v1/subscriptions/{subscriptionId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + PcEventNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureNotif' + responses: + '204': + description: No Content, Notification was succesfull. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /subscriptions/{subscriptionId}: + get: + summary: "Reads an existing Individual Policy Control Events Subscription" + operationId: GetPcEventExposureSubsc + tags: + - Individual Policy Control Events Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Policy Control Event Subscription ID. + required: true + schema: + type: string + responses: + '200': + description: OK. Resource representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + put: + summary: "Modifies an existing Individual Policy Control Events Subscription " + operationId: PutPcEventExposureSubsc + tags: + - Individual Policy Control Events Subscription (Document) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + parameters: + - name: subscriptionId + in: path + description: Policy Control Event Subscription ID. + required: true + schema: + type: string + responses: + '200': + description: OK. Resource was succesfully modified and representation is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PcEventExposureSubsc' + '204': + description: No Content. Resource was succesfully modified. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: "Cancels an existing Individual Policy Control Events Subscription " + operationId: DeletePcEventExposureSubsc + tags: + - Individual Policy Control Events Subscription (Document) + parameters: + - name: subscriptionId + in: path + description: Policy Control Event Subscription ID. + required: true + schema: + type: string + responses: + '204': + description: No Content. Resource was succesfully deleted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-eventexposure: Access to the Npcf_EventExposure API. + + schemas: + + PcEventExposureNotif: + description: > + Represents notifications about Policy Control events related to an Individual + Policy Events Subscription resource. + type: object + properties: + notifId: + type: string + eventNotifs: + type: array + items: + $ref: '#/components/schemas/PcEventNotification' + minItems: 1 + required: + - notifId + - eventNotifs + + + PcEventExposureSubsc: + description: Represents an Individual Policy Events Subscription resource. + type: object + properties: + eventSubs: + type: array + items: + $ref: '#/components/schemas/PcEvent' + minItems: 1 + eventsRepInfo: + $ref: '#/components/schemas/ReportingInformation' + groupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + filterDnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + filterSnssais: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + snssaiDnns: + type: array + items: + $ref: '#/components/schemas/SnssaiDnnCombination' + minItems: 1 + filterServices: + type: array + items: + $ref: '#/components/schemas/ServiceIdentification' + minItems: 1 + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + notifId: + type: string + eventNotifs: + type: array + items: + $ref: '#/components/schemas/PcEventNotification' + minItems: 1 + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - eventSubs + - notifId + - notifUri + + ReportingInformation: + description: Represents the type of reporting that the subscription requires. + type: object + properties: + immRep: + type: boolean + notifMethod: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + monDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + sampRatio: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SamplingRatio' + partitionCriteria: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PartitioningCriteria' + minItems: 1 + description: Criteria for partitioning the UEs before applying the sampling ratio. + grpRepTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + notifFlag: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NotificationFlag' + + ServiceIdentification: + description: Identifies the service to which the subscription applies. + type: object + properties: + servEthFlows: + type: array + items: + $ref: '#/components/schemas/EthernetFlowInfo' + minItems: 1 + servIpFlows: + type: array + items: + $ref: '#/components/schemas/IpFlowInfo' + minItems: 1 + afAppId: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AfAppId' + # All conditions in allOf must be met + allOf: + # First condition is that servEthFlows and servIpFlows are mutually exclusive + - not: + required: [servEthFlows, servIpFlows] + # Second condition is that at least one the servEthFlows, servIpFlows and afAppId shall be present + - anyOf: + - required: [servEthFlows] + - required: [servIpFlows] + - required: [afAppId] + + EthernetFlowInfo: + description: Identifies an UL/DL ethernet flow. + type: object + properties: + ethFlows: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/EthFlowDescription' + minItems: 1 + maxItems: 2 + flowNumber: + type: integer + required: + - flowNumber + + IpFlowInfo: + description: Identifies an UL/DL IP flow. + type: object + properties: + ipFlows: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + minItems: 1 + maxItems: 2 + flowNumber: + type: integer + required: + - flowNumber + + PcEventNotification: + description: Represents the information reported for a Policy Control event. + type: object + properties: + event: + $ref: '#/components/schemas/PcEvent' + accType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + addAccessInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AdditionalAccessInfo' + relAccessInfo: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AdditionalAccessInfo' + anGwAddr: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AnGwAddress' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + satBackhaulCategory: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SatelliteBackhaulCategory' + appliedCov: + $ref: 'TS29534_Npcf_AMPolicyAuthorization.yaml#/components/schemas/ServiceAreaCoverageInfo' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + timeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + pduSessionInfo: + $ref: '#/components/schemas/PduSessionInformation' + repServices: + $ref: '#/components/schemas/ServiceIdentification' + delivFailure: + $ref: 'TS29522_ServiceParameter.yaml#/components/schemas/Failure' + required: + - event + - timeStamp + + PduSessionInformation: + description: Represents PDU session identification information. + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + ueIpv4: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ueIpv6: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ipDomain: + type: string + ueMac: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + required: + - snssai + - dnn + oneOf: + - required: [ueMac] + - anyOf: + - required: [ueIpv4] + - required: [ueIpv6] + SnssaiDnnCombination: + description: Represents a combination of S-NSSAI and DNN(s). + type: object + properties: + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + dnns: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + minItems: 1 + +# Simple data types and Enumerations + + PcEvent: + description: Represents the policy control events that can be subscribed. + anyOf: + - type: string + enum: + - AC_TY_CH + - PLMN_CH + - SAC_CH + - SAT_CATEGORY_CH + - SUCCESS_UE_POL_DEL_SP + - UNSUCCESS_UE_POL_DEL_SP + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29531_Nnssf_NSSAIAvailability.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29531_Nnssf_NSSAIAvailability.yaml new file mode 100644 index 000000000..5bef7fbd0 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29531_Nnssf_NSSAIAvailability.yaml @@ -0,0 +1,676 @@ +openapi: 3.0.0 + +info: + version: '1.2.0' + title: 'NSSF NSSAI Availability' + description: | + NSSF NSSAI Availability Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - nnssf-nssaiavailability +servers: + - url: '{apiRoot}/nnssf-nssaiavailability/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +externalDocs: + description: 3GPP TS 29.531 V17.5.0; 5G System; Network Slice Selection Services; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.531/ +paths: + /nssai-availability/{nfId}: + put: + summary: Updates/replaces the NSSF with the S-NSSAIs the NF service consumer (e.g AMF)supports per TA + tags: + - NF Instance ID (Document) + operationId: NSSAIAvailabilityPut + parameters: + - name: nfId + in: path + description: Identifier of the NF service consumer instance + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: Parameters to update/replace at the NSSF, the S-NSSAIs supported per TA + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NssaiAvailabilityInfo' + responses: + '200': + description: OK (Successful update of SNSSAI information per TA) + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityInfo' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '204': + description: No Content (No supported slices after Successful update) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + patch: + summary: Updates an already existing S-NSSAIs per TA provided by the NF service consumer (e.g AMF) + tags: + - NF Instance ID (Document) + operationId: NSSAIAvailabilityPatch + parameters: + - name: nfId + in: path + description: Identifier of the NF service consumer instance + required: true + schema: + type: string + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: JSON Patch instructions to update at the NSSF, the S-NSSAIs supported per TA + required: true + content: + application/json-patch+json:: + schema: + $ref: '#/components/schemas/PatchDocument' + + responses: + '200': + description: OK (Successful update of SNSSAI information per TA) + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityInfo' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '204': + description: No Content (No supported slices after Successful update) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + + delete: + summary: Deletes an already existing S-NSSAIs per TA provided by the NF service consumer (e.g AMF) + tags: + - NF Instance ID (Document) + operationId: NSSAIAvailabilityDelete + parameters: + - name: nfId + in: path + description: Identifier of the NF service consumer instance + required: true + schema: + type: string + + responses: + '204': + description: No Content (Successful deletion of SNSSAI information per TA) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + + default: + description: Unexpected error + + + /nssai-availability/subscriptions: + post: + summary: Creates subscriptions for notification about updates to NSSAI availability information + tags: + - Subscriptions (Collection) + operationId: NSSAIAvailabilityPost + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: Subscription for notification about updates to NSSAI availability information + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NssfEventSubscriptionCreateData' + callbacks: + nssaiAvailabilityNotification: + '{request.body#/nfNssaiAvailabilityUri}': + post: + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: # contents of the callback message + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NssfEventNotification' + responses: + '204': + description: No Content (successful notification) + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + + responses: + '201': + description: Created (Successful creation of subscription for notification) + content: + application/json: + schema: + $ref: '#/components/schemas/NssfEventSubscriptionCreatedData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nnssf-nssaiavailability/v1/nssai-availability/subscriptions/{subscriptionId} + required: true + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /nssai-availability/subscriptions/{subscriptionId}: + delete: + summary: Deletes an already existing NSSAI availability notification subscription + tags: + - Subscription ID (Document) + operationId: NSSAIAvailabilityUnsubscribe + parameters: + - name: subscriptionId + in: path + description: Identifier of the subscription for notification + required: true + schema: + type: string + + responses: + '204': + description: No Content (Successful deletion of subscription for NSSAI Availability notification) + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + + default: + description: Unexpected error + + patch: + summary: updates an already existing NSSAI availability notification subscription + tags: + - Subscription ID (Document) + operationId: NSSAIAvailabilitySubModifyPatch + parameters: + - name: subscriptionId + in: path + description: Identifier of the subscription for notification + required: true + schema: + type: string + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + requestBody: + description: JSON Patch instructions to update at the NSSF, the NSSAI availability notification subscription + required: true + content: + application/json-patch+json:: + schema: + $ref: '#/components/schemas/PatchDocument' + + responses: + '200': + description: OK (Successful update of NSSAI availability notification subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/NssfEventSubscriptionCreatedData' + headers: + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /nssai-availability: + options: + summary: Discover communication options supported by NSSF for NSSAI Availability + operationId: NSSAIAvailabilityOptions + tags: + - NSSAI Availability Store + responses: + '200': + description: OK + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnssf-nssaiavailability: Access to the Nnssf_NSSAIAvailability API + + schemas: + NssaiAvailabilityInfo: + description: This contains the Nssai availability information requested by the AMF + type: object + required: + - supportedNssaiAvailabilityData + properties: + supportedNssaiAvailabilityData: + type: array + items: + $ref: '#/components/schemas/SupportedNssaiAvailabilityData' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + amfSetId: + type: string + pattern: '^[0-9]{3}-[0-9]{2-3}-[A-Fa-f0-9]{2}-[0-3][A-Fa-f0-9]{2}$' + + SupportedNssaiAvailabilityData: + description: This contains the Nssai availability data information per TA supported by the AMF + type: object + required: + - tai + - supportedSnssaiList + properties: + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + supportedSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + nsagInfos: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsagInfo' + minItems: 1 + + AuthorizedNssaiAvailabilityData: + description: This contains the Nssai availability data information per TA authorized by the NSSF + type: object + required: + - tai + - supportedSnssaiList + properties: + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + supportedSnssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + restrictedSnssaiList: + type: array + items: + $ref: '#/components/schemas/RestrictedSnssai' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + nsagInfos: + type: array + items: + $ref: 'TS29531_Nnssf_NSSelection.yaml#/components/schemas/NsagInfo' + minItems: 1 + + RestrictedSnssai: + description: This contains the restricted SNssai information per PLMN + type: object + required: + - homePlmnId + - sNssaiList + properties: + homePlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + sNssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExtSnssai' + minItems: 1 + homePlmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + roamingRestriction: + type: boolean + default: false + + AuthorizedNssaiAvailabilityInfo: + description: This contains the Nssai availability data information authorized by the NSSF + type: object + required: + - authorizedNssaiAvailabilityData + properties: + authorizedNssaiAvailabilityData: + type: array + items: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityData' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + NssfEventSubscriptionCreateData: + description: This contains the information for event subscription + type: object + required: + - nfNssaiAvailabilityUri + - taiList + - event + properties: + nfNssaiAvailabilityUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + event: + $ref: '#/components/schemas/NssfEventType' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + amfSetId: + type: string + pattern: '^[0-9]{3}-[0-9]{2-3}-[A-Fa-f0-9]{2}-[0-3][A-Fa-f0-9]{2}$' + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + NssfEventSubscriptionCreatedData: + description: This contains the information for created event subscription + type: object + required: + - subscriptionId + properties: + subscriptionId: + type: string + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + authorizedNssaiAvailabilityData: + type: array + items: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityData' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + NssfEventNotification: + description: This contains the notification for created event subscription + type: object + required: + - subscriptionId + - authorizedNssaiAvailabilityData + properties: + subscriptionId: + type: string + authorizedNssaiAvailabilityData: + type: array + items: + $ref: '#/components/schemas/AuthorizedNssaiAvailabilityData' + NssfEventType: + description: This contains the event for the subscription + anyOf: + - type: string + enum: + - SNSSAI_STATUS_CHANGE_REPORT + - type: string + PatchDocument: + description: This contains the JSON Patch instructions for updating the Nssai availability data information at the NSSF + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29531_Nnssf_NSSelection.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29531_Nnssf_NSSelection.yaml new file mode 100644 index 000000000..b95ab5f40 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29531_Nnssf_NSSelection.yaml @@ -0,0 +1,426 @@ +openapi: 3.0.0 + +info: + version: '2.2.0' + title: 'NSSF NS Selection' + description: | + NSSF Network Slice Selection Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +security: + - {} + - oAuth2ClientCredentials: + - nnssf-nsselection +servers: + - url: '{apiRoot}/nnssf-nsselection/v2' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +externalDocs: + description: 3GPP TS 29.531 V17.5.0; 5G System; Network Slice Selection Services; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.531/ +paths: + /network-slice-information: + get: + summary: Retrieve the Network Slice Selection Information + tags: + - Network Slice Information (Document) + operationId: NSSelectionGet + parameters: + - name: nf-type + in: query + description: NF type of the NF service consumer + required: true + schema: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/NFType' + - name: nf-id + in: query + description: NF Instance ID of the NF service consumer + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + - name: slice-info-request-for-registration + in: query + description: Requested network slice information during Registration procedure + content: + application/json: + schema: + $ref: '#/components/schemas/SliceInfoForRegistration' + - name: slice-info-request-for-pdu-session + in: query + description: Requested network slice information during PDU session establishment procedure + content: + application/json: + schema: + $ref: '#/components/schemas/SliceInfoForPDUSession' + - name: slice-info-request-for-ue-cu + in: query + description: Requested network slice information during UE confuguration update procedure + content: + application/json: + schema: + $ref: '#/components/schemas/SliceInfoForUEConfigurationUpdate' + - name: home-plmn-id + in: query + description: PLMN ID of the HPLMN + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + - name: tai + in: query + description: TAI of the UE + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + - name: supported-features + in: query + description: Features required to be supported by the NFs in the target slice instance + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + responses: + '200': + description: OK (Successful Network Slice Selection) + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizedNetworkSliceInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnssf-nsselection: Access to the Nnssf_NSSelection API + schemas: + AuthorizedNetworkSliceInfo: + description: Contains the authorized network slice information + type: object + properties: + allowedNssaiList: + type: array + items: + $ref: '#/components/schemas/AllowedNssai' + minItems: 1 + configuredNssai: + type: array + items: + $ref: '#/components/schemas/ConfiguredSnssai' + minItems: 1 + targetAmfSet: + type: string + pattern: '^[0-9]{3}-[0-9]{2-3}-[A-Fa-f0-9]{2}-[0-3][A-Fa-f0-9]{2}$' + candidateAmfList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + minItems: 1 + rejectedNssaiInPlmn: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + rejectedNssaiInTa: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nsiInformation: + $ref: '#/components/schemas/NsiInformation' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + nrfAmfSet: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAmfSetNfMgtUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAmfSetAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfOauth2Required: + type: object + description: > + Map indicating whether the NRF requires Oauth2-based authorization for accessing + its services. The key of the map shall be the name of an NRF service, + e.g. "nnrf-nfm" or "nnrf-disc" + additionalProperties: + type: boolean + minProperties: 1 + targetAmfServiceSet: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfServiceSetId' + targetNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nsagInfos: + type: array + items: + $ref: '#/components/schemas/NsagInfo' + minItems: 1 + + SubscribedSnssai: + description: Contains the subscribed S-NSSAI + type: object + required: + - subscribedSnssai + properties: + subscribedSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + defaultIndication: + type: boolean + subscribedNsSrgList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NsSrg' + minItems: 1 + + + AllowedSnssai: + description: > + Contains the authorized S-NSSAI and optional mapped home S-NSSAI and + network slice instance information + type: object + required: + - allowedSnssai + properties: + allowedSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + nsiInformationList: + type: array + items: + $ref: '#/components/schemas/NsiInformation' + minItems: 1 + mappedHomeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + AllowedNssai: + description: > + Contains an array of allowed S-NSSAI that constitute the allowed NSSAI information + for the authorized network slice information + type: object + required: + - allowedSnssaiList + - accessType + properties: + allowedSnssaiList: + type: array + items: + $ref: '#/components/schemas/AllowedSnssai' + minItems: 1 + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + + NsiInformation: + description: > + Contains the API URIs of NRF services to be used to discover NFs/services, + subscribe to NF status changes and/or request access tokens within the selected + Network Slice instance and optional the Identifier of the selected Network Slice instance + type: object + required: + - nrfId + properties: + nrfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nsiId: + $ref: '#/components/schemas/NsiId' + nrfNfMgtUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfAccessTokenUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nrfOauth2Required: + type: object + description: > + Map indicating whether the NRF requires Oauth2-based authorization for accessing + its services. The key of the map shall be the name of an NRF service, + e.g. "nnrf-nfm" or "nnrf-disc" + additionalProperties: + type: boolean + minProperties: 1 + + MappingOfSnssai: + description: Contains the mapping of S-NSSAI in the serving network and the value of the home network + type: object + required: + - servingSnssai + - homeSnssai + properties: + servingSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + homeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + + SliceInfoForRegistration: + description: Contains the slice information requested during a Registration procedure + type: object + properties: + subscribedNssai: + type: array + items: + $ref: '#/components/schemas/SubscribedSnssai' + minItems: 1 + allowedNssaiCurrentAccess: + $ref: '#/components/schemas/AllowedNssai' + allowedNssaiOtherAccess: + $ref: '#/components/schemas/AllowedNssai' + sNssaiForMapping: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + requestedNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + defaultConfiguredSnssaiInd: + type: boolean + default: false + mappingOfNssai: + type: array + items: + $ref: '#/components/schemas/MappingOfSnssai' + minItems: 1 + requestMapping: + type: boolean + ueSupNssrgInd: + type: boolean + suppressNssrgInd: + type: boolean + nsagSupported: + type: boolean + default: false + + SliceInfoForPDUSession: + description: Contains the slice information requested during PDU Session establishment procedure + type: object + required: + - sNssai + - roamingIndication + properties: + sNssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + roamingIndication: + $ref: '#/components/schemas/RoamingIndication' + homeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + SliceInfoForUEConfigurationUpdate: + description: Contains the slice information requested during UE configuration update procedure + type: object + properties: + subscribedNssai: + type: array + items: + $ref: '#/components/schemas/SubscribedSnssai' + minItems: 1 + allowedNssaiCurrentAccess: + $ref: '#/components/schemas/AllowedNssai' + allowedNssaiOtherAccess: + $ref: '#/components/schemas/AllowedNssai' + defaultConfiguredSnssaiInd: + type: boolean + requestedNssai: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + mappingOfNssai: + type: array + items: + $ref: '#/components/schemas/MappingOfSnssai' + minItems: 1 + ueSupNssrgInd: + type: boolean + suppressNssrgInd: + type: boolean + rejectedNssaiRa: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + nsagSupported: + type: boolean + default: false + + ConfiguredSnssai: + description: Contains the configured S-NSSAI(s) authorized by the NSSF in the serving PLMN and optional mapped home S-NSSAI + type: object + required: + - configuredSnssai + properties: + configuredSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + mappedHomeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + + NsagInfo: + description: Contains the association of NSAGs and S-NSSAI(s) along with the TA(s) within which the association is valid. + type: object + required: + - nsagIds + - snssaiList + properties: + nsagIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NsagId' + minItems: 1 + snssaiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 1 + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + taiRangeList: + type: array + items: + $ref: 'TS29510_Nnrf_NFManagement.yaml#/components/schemas/TaiRange' + minItems: 1 + + RoamingIndication: + description: Contains the indication on roaming + anyOf: + - type: string + enum: + - NON_ROAMING + - LOCAL_BREAKOUT + - HOME_ROUTED_ROAMING + - type: string + NsiId: + description: Contains the Identifier of the selected Network Slice instance + type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29534_Npcf_AMPolicyAuthorization.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29534_Npcf_AMPolicyAuthorization.yaml new file mode 100644 index 000000000..b643f8ead --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29534_Npcf_AMPolicyAuthorization.yaml @@ -0,0 +1,719 @@ +openapi: 3.0.0 +info: + title: Npcf_AMPolicyAuthorization Service API + version: 1.0.2 + description: | + PCF Access and Mobility Policy Authorization Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.534 V17.3.0; + 5G System; Access and Mobility Policy Authorization Service; Stage 3. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.534/' +# +servers: + - url: '{apiRoot}/npcf-am-policyauthorization/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +# +security: + - {} + - oAuth2ClientCredentials: + - npcf-am-policyauthorization +paths: + /app-am-contexts: + post: + summary: Creates a new Individual Application AM Context resource + operationId: PostAppAmContexts + tags: + - Application AM contexts (Collection) + requestBody: + description: Contains the information for the creation the resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextData' + responses: + '201': + description: Successful creation of the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextRespData' + headers: + Location: + description: > + Contains the URI of the created individual application AM context resource, + according to the structure + {apiRoot}/npcf-am-policyauthorization//app-am-contexts/{appAmContextId} + or the URI of the created AM Policy events subscription subresource, + according to the structure + {apiRoot}/npcf-am-policyauthorization//app-am-contexts/{appAmContextId}/events-subscription} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + terminationRequest: + '{$request.body#/termNotifUri}': + post: + requestBody: + description: Request of the termination of the Individual Application AM Context. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmTerminationInfo' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + amEventNotification: + '{$request.body#/evSubsc/eventNotifUri}': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-am-contexts/{appAmContextId}: + get: + summary: "Reads an existing Individual Application AM Context" + operationId: GetAppAmContext + tags: + - Individual Application AM Context (Document) + parameters: + - name: appAmContextId + description: String identifying the resource. + in: path + required: true + schema: + type: string + responses: + '200': + description: A representation of the resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + patch: + summary: "Modifies an existing Individual Application AM Context" + operationId: ModAppAmContext + tags: + - Individual Application AM Context (Document) + parameters: + - name: appAmContextId + description: String identifying the resource. + in: path + required: true + schema: + type: string + requestBody: + description: Modification of the resource. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/AppAmContextUpdateData' + responses: + '200': + description: > + Successful modification of the resource and a representation of that resource is + returned. If a subscribed event is matched, the event notification is also included + in the response. + content: + application/json: + schema: + $ref: '#/components/schemas/AppAmContextRespData' + '204': + description: The successful modification. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + amEventNotification: + '{$request.body#/evSubsc/eventNotifUri}': + post: + requestBody: + description: Notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + delete: + summary: Deletes an existing Individual Application AM Context + operationId: DeleteAppAmContext + tags: + - Individual Application AM Context (Document) + parameters: + - name: appAmContextId + description: String identifying the Individual Application AM Context resource. + in: path + required: true + schema: + type: string + responses: + '204': + description: The deletion is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# + /app-am-contexts/{appAmContextId}/events-subscription: + put: + summary: creates or modifies an AM Policy Events Subscription subresource. + operationId: updateAmEventsSubsc + tags: + - AM Policy Events Subscription (Document) + parameters: + - name: appAmContextId + description: String identifying the AM Policy Events Subscription subresource. + in: path + required: true + schema: + type: string + requestBody: + description: Creation or modification of an AM Policy Events Subscription subresource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsSubscData' + responses: + '201': + description: > + The creation of the AM Policy Events Subscription subresource is confirmed and its + representation is returned. If an AM Event is matched, the response also includes the + notification. + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsSubscRespData' + headers: + Location: + description: > + Contains the URI of the created AM Policy Events Subscription subresource, + according to the structure + {apiRoot}/npcf-am-policyauthorization//app-am-contexts/{appAmContextId}/events-subscription} + required: true + schema: + type: string + '200': + description: The modification of the AM Policy Events Subscription subresource is confirmed and its representation is returned. If an AM Event is matched, the response also includes the notification. + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsSubscRespData' + '204': + description: The modification of the AM Policy Events Subscription subresource is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + amEventNotification: + '{$request.body#/evSubsc/eventNotifUri}': + post: + requestBody: + description: Contains the information for the notification of an event occurrence in the PCF. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AmEventsNotification' + responses: + '204': + description: The receipt of the notification is acknowledged. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + delete: + summary: deletes the AM Policy Events Subscription subresource + operationId: DeleteAmEventsSubsc + tags: + - AM Policy Events Subscription (Document) + parameters: + - name: appAmContextId + description: String identifying the Individual Application AM Context resource. + in: path + required: true + schema: + type: string + responses: + '204': + description: The deletion of the of the AM Policy Events Subscription subresource is confirmed without returning additional data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +# +# +components: +# + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-am-policyauthorization: Access to the Npcf_AMPolicyAuthorization API +# + schemas: +# + AppAmContextData: + description: Represents an Individual Application AM Context resource. + type: object + required: + - supi + - termNotifUri + properties: + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + termNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + evSubsc: + $ref: '#/components/schemas/AmEventsSubscData' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + highThruInd: + type: boolean + description: Indicates whether high throughput is desired for the indicated UE traffic. + covReq: + type: array + description: Identifies a list of Tracking Areas per serving network where service is allowed. + items: + $ref: '#/components/schemas/ServiceAreaCoverageInfo' + minItems: 1 + asTimeDisParam: + $ref: 'TS29507_Npcf_AMPolicyControl.yaml#/components/schemas/AsTimeDistributionParam' + anyOf: + - anyOf: + - required: [highThruInd] + - required: [covReq] + - required: [asTimeDisParam] + - required: [evSubsc] +# +# + AppAmContextUpdateData: + description: Describes the modifications to an Individual Application AM resource. + type: object + properties: + termNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + evSubsc: + $ref: '#/components/schemas/AmEventsSubscDataRm' + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSecRm' + highThruInd: + description: Indicates whether high throughput is desired for the indicated UE traffic. + type: boolean + nullable: true + covReq: + type: array + description: Identifies a list of Tracking Areas per serving network where service is allowed. + items: + $ref: '#/components/schemas/ServiceAreaCoverageInfo' + minItems: 1 + nullable: true + asTimeDisParam: + $ref: 'TS29507_Npcf_AMPolicyControl.yaml#/components/schemas/AsTimeDistributionParam' +# + AmEventsSubscData: + description: It represents the AM Policy Events Subscription subresource and identifies the events the application subscribes to. + type: object + required: + - eventNotifUri + properties: + eventNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + events: + type: array + items: + $ref: '#/components/schemas/AmEventData' + minItems: 1 +# + AmEventsNotification: + description: Describes the notification about the events occurred within an Individual Application AM Context resource. + type: object + required: + - repEvents + properties: + appAmContextId: + type: string + description: Contains the AM Policy Events Subscription resource identifier related to the event notification. + repEvents: + type: array + items: + $ref: '#/components/schemas/AmEventNotification' + minItems: 1 +# + AmTerminationInfo: + description: Includes information related to the termination of the Individual Application AM Context resource. + type: object + required: + - appAmContextId + - termCause + properties: + appAmContextId: + type: string + description: Contains the Individual application AM context resource identifier related to the termination notification. + termCause: + $ref: '#/components/schemas/AmTerminationCause' +# + AmEventsSubscDataRm: + description: This data type is defined in the same way as the AmEventsSubscData but with the OpenAPI nullable property set to true. + type: object + properties: + eventNotifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + events: + type: array + items: + $ref: '#/components/schemas/AmEventData' + minItems: 1 + nullable: true +# + AmEventData: + description: This data type contains the event identifier and the related event reporting information. + type: object + required: + - event + properties: + event: + $ref: '#/components/schemas/AmEvent' + immRep: + type: boolean + notifMethod: + $ref: 'TS29508_Nsmf_EventExposure.yaml#/components/schemas/NotificationMethod' + maxReportNbr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + monDur: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + repPeriod: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' +# + AmEventNotification: + description: Describes the notification of a subscription. + type: object + required: + - event + properties: + event: + $ref: '#/components/schemas/AmEvent' + appliedCov: + $ref: '#/components/schemas/ServiceAreaCoverageInfo' + pduidInfo: + $ref: '#/components/schemas/PduidInformation' +# + PduidInformation: + description: Contains the ProSe Discovery UE ID and its validity timer. + type: object + required: + - expiry + - pduid + properties: + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + pduid: + $ref: 'TS29555_N5g-ddnmf_Discovery.yaml#/components/schemas/Pduid' +# + ServiceAreaCoverageInfo: + description: It represents a list of Tracking Areas within a serving network. + type: object + required: + - tacList + properties: + tacList: + type: array + description: Indicates a list of Tracking Areas where the service is allowed. + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tac' + servingNetwork: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' +# +# ENUMERATIONS DATA TYPES +# + AmTerminationCause: + description: It represents the cause values that the PCF should report when requesting to an NF service consumer the deletion of an "AF application AM context" resource. + anyOf: + - type: string + enum: + - UE_DEREGISTERED + - UNSPECIFIED + - INSUFFICIENT_RESOURCES + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. +# + AmEvent: + anyOf: + - type: string + enum: + - SAC_CH + - PDUID_CH + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration but + is not used to encode content defined in the present version of this API. + description: | + Possible values are: + - SAC_CH: Service Area Coverage Change + - PDUID_CH: The PDUID assigned to a UE for the UE ProSe Policies changed +# +# + AppAmContextRespData: + description: It represents a response to a modification or creation request of an Individual Application AM resource. It may contain the notification of the already met events. + anyOf: + - $ref: '#/components/schemas/AppAmContextData' + - $ref: '#/components/schemas/AmEventsNotification' +# + AmEventsSubscRespData: + description: Identifies the events the application subscribes to within an AM Policy Events Subscription subresource data. It may contain the notification of the already met events. + anyOf: + - $ref: '#/components/schemas/AmEventsSubscData' + - $ref: '#/components/schemas/AmEventsNotification' +# \ No newline at end of file diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29544_Nspaf_SecuredPacket.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29544_Nspaf_SecuredPacket.yaml new file mode 100644 index 000000000..4c39f1f62 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29544_Nspaf_SecuredPacket.yaml @@ -0,0 +1,113 @@ +openapi: 3.0.0 +info: + title: 'Nspaf_SecuredPacket' + version: '1.1.0' + description: | + Nspaf Secured Packet Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 29.544, SP-AF Services, version V17.3.0 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.544/ +servers: + - url: '{apiRoot}/nspaf-secured-packet/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nspaf-secured-packet +paths: + /{supi}/provide-secured-packet: + post: + summary: request generation of a secured packet + operationId: ProvideSecuredPacket + tags: + - SecuredPacket Generation (Custom Operation) + parameters: + - name: supi + in: path + description: SUPI of the user + required: true + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UiccConfigurationParameter' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SecuredPacket' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nspaf-secured-packet: Access to the nspaf-secured-packet API + schemas: + +# COMPLEX TYPES: + + UiccConfigurationParameter: + description: Represents UICC Configuration Parameters. + type: object + oneOf: + - required: [routingId ] + - required: [steeringContainer ] + - required: [extendedSteeringContainer ] + properties: + routingId: + $ref: '#/components/schemas/RoutingId' + steeringContainer: + type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + extendedSteeringContainer: + $ref: '#/components/schemas/ExtendedSteeringContainer' + + ExtendedSteeringContainer: + description: Represents Extended Steering Containers. + type: object + properties: + steeringContainer: + type: array + items: + $ref: 'TS29509_Nausf_SoRProtection.yaml#/components/schemas/SteeringInfo' + minItems: 1 + sorCmci: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/SorCmci' + storeSorCmciInMe: + type: boolean + +# SIMPLE TYPES: + + RoutingId: + description: Represents a routing indicator. + type: string + pattern: '^[0-9]{1,4}$' + +# ENUMS: + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29551_Nnef_PFDmanagement.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29551_Nnef_PFDmanagement.yaml new file mode 100644 index 000000000..8d15b71ff --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29551_Nnef_PFDmanagement.yaml @@ -0,0 +1,585 @@ +openapi: 3.0.0 +info: + title: Nnef_PFDmanagement Service API + version: 1.2.1 + description: | + Packet Flow Description Management Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +# +externalDocs: + description: 3GPP TS 29.551 v17.8.0, 5G System; Packet Flow Description Management Service + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.551/' +# +servers: + - url: '{apiRoot}/nnef-pfdmanagement/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 +security: + - {} + - oAuth2ClientCredentials: + - nnef-pfdmanagement +paths: + /applications: + get: + summary: Retrieve PFDs for all applications or for one or multiple applications with query parameter. + tags: + - PFD of applications + operationId: Nnef_PFDmanagement_AllFetch + parameters: + - name: application-ids + description: The required application identifier(s) for the returned PFDs. + in: query + required: true + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + - name: supported-features + in: query + description: To filter irrelevant responses related to unsupported features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: > + The PFDs for one or more application identifier(s) in the request URI are returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdDataForApp' + minItems: 0 + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /applications/partialpull: + post: + summary: retrieve the PFD(s) by partial update + operationId: Nnef_PFDmanagement_AppFetchPartialUpdate + tags: + - PFD of applications by partial update + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApplicationForPfdRequest' + minItems: 1 + responses: + '200': + description: OK. Changed PFD(s) is returned + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdDataForApp' + minItems: 1 + '204': + description: The PFD(s) is not changed + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /applications/{appId}: + get: + summary: Retrieve the PFD for an application. + tags: + - Individual application PFD + operationId: Nnef_PFDmanagement_IndAppFetch + parameters: + - name: appId + description: The required application identifier(s) for the returned PFDs. + in: path + required: true + schema: + type: string + - name: supported-features + in: query + description: To filter irrelevant responses related to unsupported features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: A representation of PFDs for an application in the request URI is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdDataForApp' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '414': + $ref: 'TS29571_CommonData.yaml#/components/responses/414' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions: + post: + summary: Subscribe the notification of PFD changes. + tags: + - PFD subscriptions + operationId: Nnef_PFDmanagement_CreateSubscr + requestBody: + description: a PfdSubscription resource to be created. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' + callbacks: + PfdChangeNotification: + '{request.body#/notifyUri}': + post: + summary: Notification of PFD change. + tags: + - PfdChangeNotification data + operationId: Nnef_PFDmanagement_Notify + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdChangeNotification' + minItems: 1 + responses: + '200': + description: > + The PFD operation in the notification is performed and the + PfdChangeReport indicates failure reason. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PfdChangeReport' + minItems: 1 + '204': + description: The PFD operation in the notification is performed successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + NotificationPush: + '{request.body#/notifyUri}/notifypush': + post: + summary: Notification Push. + tags: + - NotificationPush data + operationId: Nnef_PFDmanagement_PushNotify + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/NotificationPush' + minItems: 1 + responses: + '204': + description: Notificaiton PUSH is accepted. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + responses: + '201': + description: > + The creation of a PfdSubscription resource is confirmed and a representation of + that resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure + {apiRoot}/nnef-pfdmanagement/v1/subscriptions/{subscriptionId} + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /subscriptions/{subscriptionId}: + put: + summary: Updates/replaces an existing subscription resource + tags: + - Individual PFD subscription + operationId: Nnef_PFDmanagement_ModifySubscr + parameters: + - name: subscriptionId + description: Identify the subscription. + in: path + required: true + schema: + type: string + requestBody: + description: Parameters to update/replace the existing subscription + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' + responses: + '200': + description: OK (Successful update of the subscription) + content: + application/json: + schema: + $ref: '#/components/schemas/PfdSubscription' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete a subscription of PFD change notification. + tags: + - Individual PFD subscription + operationId: Nnef_PFDmanagement_Unsubscribe + parameters: + - name: subscriptionId + description: Identify the subscription. + in: path + required: true + schema: + type: string + responses: + '204': + description: > + The PfdSubscription resource matching the subscriptionId was deleted successfully. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nnef-pfdmanagement: Access to the Nnef_PFDmanagement API + schemas: +# +# STRUCTURED DATA TYPES +# + PfdContent: + description: Represents the content of a PFD for an application identifier. + type: object + properties: + pfdId: + type: string + description: Identifies a PDF of an application identifier. + flowDescriptions: + type: array + items: + type: string + minItems: 1 + description: > + Represents a 3-tuple with protocol, server ip and server port for UL/DL + application traffic. + urls: + type: array + items: + type: string + minItems: 1 + description: > + Indicates a URL or a regular expression which is used to match the significant parts + of the URL. + domainNames: + type: array + items: + type: string + minItems: 1 + description: Indicates an FQDN or a regular expression as a domain name matching criteria. + dnProtocol: + $ref: 'TS29122_PfdManagement.yaml#/components/schemas/DomainNameProtocol' + + PfdDataForApp: + description: Represents the PFDs for an application identifier. + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + pfds: + type: array + items: + $ref: '#/components/schemas/PfdContent' + minItems: 1 + cachingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + cachingTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + pfdTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + partialFlag: + type: boolean + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - applicationId + + PfdSubscription: + description: Represents a PFD subscription. + type: object + properties: + applicationIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + required: + - notifyUri + - supportedFeatures + + PfdChangeNotification: + description: Represents information related to a notification of PFD change. + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + removalFlag: + type: boolean + default: false + partialFlag: + type: boolean + default: false + pfds: + type: array + items: + $ref: '#/components/schemas/PfdContent' + minItems: 1 + required: + - applicationId + + NotificationPush: + description: > + Represents the information to be used by the NF service consumer to retrieve the + PFDs and/or remove the PFDs of the applicable application identifier(s). + type: object + properties: + appIds: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + allowedDelay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + pfdOp: + $ref: '#/components/schemas/PfdOperation' + required: + - appIds + + PfdChangeReport: + description: Represents an error report on PFD change. + type: object + properties: + pfdError: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + applicationId: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + minItems: 1 + required: + - pfdError + - applicationId + + PfdOperation: + description: Indicates the operation to be applied on PFD(s). + anyOf: + - type: string + enum: + - RETRIEVE + - FULLPULL + - PARTIALPULL + - REMOVE + - type: string + + ApplicationForPfdRequest: + description: Contains the application identifier(s) for the PFD(s) request. + type: object + properties: + applicationId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationId' + pfdTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - applicationId diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29554_Npcf_BDTPolicyControl.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29554_Npcf_BDTPolicyControl.yaml new file mode 100644 index 000000000..8f46a658d --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29554_Npcf_BDTPolicyControl.yaml @@ -0,0 +1,434 @@ +openapi: 3.0.0 + +info: + title: Npcf_BDTPolicyControl Service API + version: 1.2.0 + description: | + PCF BDT Policy Control Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: > + 3GPP TS 29.554 V17.4.0; 5G System; Background Data Transfer Policy Control Service. + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.554/' + +servers: + - url: '{apiRoot}/npcf-bdtpolicycontrol/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - npcf-bdtpolicycontrol + +paths: + /bdtpolicies: + post: + summary: Create a new Individual BDT policy + operationId: CreateBDTPolicy + tags: + - BDT policies (Collection) + requestBody: + description: > + Contains information for the creation of a new Individual BDT policy resource. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BdtReqData' + responses: + '201': + description: Background data transfer policies offered to an ASP. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' + headers: + Location: + description: > + Contains the URI of the created individual BDT policy resource, + according to the structure + {apiRoot}/npcf-bdtpolicycontrol/v1/bdtpolicies/{bdtPolicyId} + required: true + schema: + type: string + '303': + description: > + See Other. The result of the POST request would be equivalent to the + existing Individual BDT policy resource. + headers: + Location: + description: Contains the URI of the existing individual BDT policy resource. + required: true + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + BdtNotification: + '{$request.body#/notifUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Notification' + responses: + '204': + description: No Content, a reception of the BDT notification was successful. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /bdtpolicies/{bdtPolicyId}: + get: + summary: Read an Individual BDT policy + operationId: GetBDTPolicy + tags: + - Individual BDT policy (Document) + parameters: + - name: bdtPolicyId + description: String identifying the individual BDT policy resource in the PCF. + in: path + required: true + schema: + type: string + responses: + '200': + description: Background data transfer policies offered to and selected by an ASP. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '406': + $ref: 'TS29571_CommonData.yaml#/components/responses/406' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: Update an Individual BDT policy + operationId: UpdateBDTPolicy + tags: + - Individual BDT policy (Document) + parameters: + - name: bdtPolicyId + description: String identifying the individual BDT policy resource in the PCF. + in: path + required: true + schema: + type: string + requestBody: + description: > + Contains modification instruction to be performed on the BdtPolicy data + structure to select a transfer policy and in addition, may indicate whether + the BDT warning notification is enabled or disabled. + required: true + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/PatchBdtPolicy' + responses: + '200': + description: > + The Individual BDT Policy resource is modified and a representation of that + resource is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/BdtPolicy' + '204': + description: The Individual BDT Policy resource is modified. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + npcf-bdtpolicycontrol: Access to the Npcf_BDTPolicyControl API + + schemas: + +# Structured data types + + BdtPolicy: + description: Represents an Individual BDT policy resource. + type: object + properties: + bdtPolData: + $ref: '#/components/schemas/BdtPolicyData' + bdtReqData: + $ref: '#/components/schemas/BdtReqData' + + BdtReqData: + description: > + Contains service requirements for creation a new Individual BDT policy resource. + type: object + required: + - aspId + - desTimeInt + - numOfUes + - volPerUe + properties: + aspId: + $ref: '#/components/schemas/AspId' + desTimeInt: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + dnn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + interGroupId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + notifUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + numOfUes: + description: Indicates a number of UEs. + type: integer + volPerUe: + $ref: 'TS29122_CommonData.yaml#/components/schemas/UsageThreshold' + snssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + trafficDes: + $ref: 'TS29122_ResourceManagementOfBdt.yaml#/components/schemas/TrafficDescriptor' + warnNotifReq: + description: Indicates whether the BDT warning notification is enabled or disabled. + type: boolean + default: false + + BdtPolicyData: + description: Describes the authorization data of an Individual BDT policy resource. + type: object + required: + - bdtRefId + - transfPolicies + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + transfPolicies: + description: Contains transfer policies. + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + selTransPolicyId: + description: Contains an identity of the selected transfer policy. + type: integer + suppFeat: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + PatchBdtPolicy: + description: > + Describes the updates in authorization data of an Individual BDT Policy created + by the PCF. + type: object + properties: + bdtPolData: + $ref: '#/components/schemas/BdtPolicyDataPatch' + bdtReqData: + $ref: '#/components/schemas/BdtReqDataPatch' + + BdtPolicyDataPatch: + description: > + A JSON Merge Patch body schema containing modification instruction to be performed + on the bdtPolData attribute of the BdtPolicy data structure to select a transfer + policy. Adds selTransPolicyId to BdtPolicyData data structure. + type: object + required: + - selTransPolicyId + properties: + selTransPolicyId: + description: > + Contains an identity (i.e. transPolicyId value) of the selected transfer + policy. If the BdtNotification_5G feature is supported value 0 indicates that + no transfer policy is selected. + type: integer + + BdtReqDataPatch: + description: > + A JSON Merge Patch body schema containing modification instruction to be performed + on the bdtReqData attribute of the BdtPolicy data structure to indicate whether + the BDT warning notification is enabled or disabled. Modifies warnNotifReq from + BdtReqData data structure. + type: object + properties: + warnNotifReq: + description: Indicates whether the BDT warning notification is enabled or disabled. + type: boolean + + TransferPolicy: + description: Describes a transfer policy. + type: object + required: + - ratingGroup + - recTimeInt + - transPolicyId + properties: + maxBitRateDl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + maxBitRateUl: + $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate' + ratingGroup: + description: Indicates a rating group for the recommended time window. + type: integer + recTimeInt: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + transPolicyId: + description: Contains an identity of a transfer policy. + type: integer + + NetworkAreaInfo: + description: > + Describes a network area information in which the NF service consumer requests + the number of UEs. + type: object + properties: + ecgis: + description: Contains a list of E-UTRA cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + minItems: 1 + ncgis: + description: Contains a list of NR cell identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + minItems: 1 + gRanNodeIds: + description: Contains a list of NG RAN nodes. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + minItems: 1 + tais: + description: Contains a list of tracking area identities. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 1 + + Notification: + description: Describes a BDT notification. + type: object + required: + - bdtRefId + properties: + bdtRefId: + $ref: 'TS29122_CommonData.yaml#/components/schemas/BdtReferenceId' + candPolicies: + description: > + Contains a list of the candidate transfer policies from which the AF may + select a new transfer policy due to a network performance is below the criteria + set by the operator. + type: array + items: + $ref: '#/components/schemas/TransferPolicy' + minItems: 1 + nwAreaInfo: + $ref: '#/components/schemas/NetworkAreaInfo' + timeWindow: + $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow' + +# Simple data types + + AspId: + description: Contains an identity of an application service provider. + type: string + diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_gbaSDM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_gbaSDM.yaml new file mode 100644 index 000000000..47989f6a7 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_gbaSDM.yaml @@ -0,0 +1,383 @@ +openapi: 3.0.0 + +info: + version: '1.0.0' + title: 'Nhss_gbaSDM' + description: | + Nhss Subscriber Data Management Service for GBA. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 Home Subscriber Server (HSS) Services, version 17.5.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-gba-sdm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + +paths: + /{ueId}/subscriber-data: + get: + summary: Retrieve the subscriber data of a user + operationId: GetSubscriberData + tags: + - Subscriber Data (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + - oAuth2ClientCredentials: + - nhss-gba-sdm + - nhss-gba-sdm:subscriber-data:read + parameters: + - name: ueId + in: path + description: UE Identity + required: true + schema: + $ref: '#/components/schemas/UeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GbaSubscriberData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{ueId}/subscriptions: + post: + summary: Subscribe to notifications + operationId: GbaSdmSubscribe + tags: + - GBA SDM Subscriptions (Collection) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + - oAuth2ClientCredentials: + - nhss-gba-sdm + - nhss-gba-sdm:subscriptions:create + parameters: + - name: ueId + in: path + description: UE Identity + required: true + schema: + $ref: '#/components/schemas/UeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GbaSdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/GbaSdmSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-gba-sdm//{ueId}/subscriptions/{subscriptionId} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{ueId}/subscriptions/{subscriptionId}: + delete: + summary: Unsubscribe from notifications + operationId: GbaSdmUnsubscribe + tags: + - GBA SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + - oAuth2ClientCredentials: + - nhss-gba-sdm + - nhss-gba-sdm:subscription:modify + parameters: + - name: ueId + in: path + description: UE Identity + required: true + schema: + $ref: '#/components/schemas/UeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Modify the subscription + operationId: GbaSdmSubsModify + tags: + - GBA SDM Subscription (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-sdm + - oAuth2ClientCredentials: + - nhss-gba-sdm + - nhss-gba-sdm:subscription:modify + parameters: + - name: ueId + in: path + description: UE Identity + required: true + schema: + $ref: '#/components/schemas/UeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful modification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-gba-sdm: Access to the Nhss GBA Subscription Data Management API + nhss-gba-sdm:subscriber-data:read: Access to read the GBA Subscriber Data resource + nhss-gba-sdm:subscriptions:create: Access to create Subscriptions resources + nhss-gba-sdm:subscription:modify: Access to update/delete a Subscription resource + + schemas: + +# +# COMPLEX TYPES: +# + + GbaSubscriberData: + description: > + GBA subscriber data of the UE; it includes the GBA User Security Settings (GUSS) data + type: object + properties: + guss: + $ref: '#/components/schemas/Guss' + + Guss: + description: > + GBA User Security Settings of the UE; it includes information about the BSF, + and a list of User Security Settings + type: object + properties: + bsfInfo: + $ref: '#/components/schemas/BsfInfo' + ussList: + type: array + items: + $ref: 'TS29309_Nbsp_GBA.yaml#/components/schemas/UssListItem' + minItems: 1 + + BsfInfo: + description: > + Information about the BSF; it includes an indication of whether GBA or GBA_U is to be used, + the key lifetime and a user-specific list of security features + type: object + properties: + uiccType: + $ref: '#/components/schemas/UiccType' + lifeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + securityFeatures: + type: array + items: + $ref: 'TS29309_Nbsp_GBA.yaml#/components/schemas/SecFeature' + minItems: 1 + + GbaSdmSubscription: + description: > + Information about a subscription created in the HSS, so the consumer (e.g. BSF) can be + notified when there are changes on the monitored data + type: object + required: + - nfInstanceId + - callbackReference + - monitoredResourceUris + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + +# +# SIMPLE TYPES: +# + + UeId: + description: UE ID can be MSISDN, IMSI, IMPI or IMPU + anyOf: + - $ref: '#/components/schemas/Msisdn' + - $ref: '#/components/schemas/Imsi' + - $ref: 'TS29562_Nhss_imsSDM.yaml#/components/schemas/ImsUeId' + + Msisdn: + description: MS-ISDN of the UE + type: string + pattern: '^msisdn-[0-9]{5,15}$' + + Imsi: + description: IMSI of the UE + type: string + pattern: '^imsi-[0-9]{5,15}$' + +# +# ENUMS: +# + + UiccType: + description: Indicates whether GBA or GBA_U is to be used + anyOf: + - type: string + enum: + - GBA + - GBA_U + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_gbaUEAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_gbaUEAU.yaml new file mode 100644 index 000000000..fb67f78d2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_gbaUEAU.yaml @@ -0,0 +1,184 @@ +openapi: 3.0.0 + +info: + version: '1.0.0' + title: 'Nhss_gbaUEAU' + description: | + Nhss UE Authentication Service for GBA. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 Home Subscriber Server (HSS) Services, version 17.5.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-gba-ueau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - oAuth2ClientCredentials: + - nhss-gba-ueau + - {} + +paths: + /{ueId}/security-information/generate-auth-data: + post: + summary: Generate GBA authentication data for the UE + operationId: GenerateAuthData + tags: + - Generate Auth Data (Custom Operation) + security: + - {} + - oAuth2ClientCredentials: + - nhss-gba-ueau + - oAuth2ClientCredentials: + - nhss-gba-ueau + - nhss-gba-ueau:generate-auth-data:invoke + parameters: + - name: ueId + in: path + description: UE identity of the user + required: true + schema: + $ref: '#/components/schemas/UeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticationInfoResult' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-gba-ueau: Access to the nhss-gba-ueau API + nhss-gba-ueau:generate-auth-data:invoke: > + Access to invoke the Generate Auth Data custom operation + + schemas: + +# +# COMPLEX TYPES: +# + + AuthenticationInfoRequest: + description: > + Contains input data to the authentication request message (e.g. authentication + scheme, resynchronization information) + type: object + properties: + authenticationScheme: + $ref: '#/components/schemas/AuthenticationScheme' + resynchronizationInfo: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/ResynchronizationInfo' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + AuthenticationInfoResult: + description: > + Contains authentication information returned in the authentication response message + (e.g. authentication vector, digest authentication parameters) + type: object + properties: + impi: + $ref: '#/components/schemas/Impi' + 3gAkaAv: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/3GAkaAv' + digestAuth: + $ref: '#/components/schemas/DigestAuthentication' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + DigestAuthentication: + description: Parameters used for the Digest authentication scheme + type: object + required: + - digestRealm + - digestAlgorithm + - digestQop + - ha1 + properties: + digestRealm: + type: string + digestAlgorithm: + $ref: '#/components/schemas/DigestAlgorithm' + digestQop: + $ref: '#/components/schemas/DigestQop' + ha1: + type: string + +# +# SIMPLE TYPES: +# + + UeId: + $ref: 'TS29562_Nhss_gbaSDM.yaml#/components/schemas/UeId' + + Impi: + description: IMS Private Identity of the UE + type: string + +# +# ENUMS: +# + + AuthenticationScheme: + description: Authentication scheme to be used in the authentication request message + anyOf: + - type: string + enum: + - DIGEST_AKAV1_MD5 + - DIGEST_HTTP + - type: string + + DigestAlgorithm: + description: Algorithm used for the Digest authentication scheme + anyOf: + - type: string + enum: + - MD5 + - MD5_SESS + - type: string + + DigestQop: + description: Quality of Protection for the Digest authentication scheme + anyOf: + - type: string + enum: + - AUTH + - AUTH_INT + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsSDM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsSDM.yaml new file mode 100644 index 000000000..14abb6b8b --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsSDM.yaml @@ -0,0 +1,3612 @@ +openapi: 3.0.0 + +info: + version: '1.1.1' + title: 'Nhss_imsSDM' + description: | + Nhss Subscriber Data Management Service for IMS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 HSS Services for interworking with IMS, version 17.6.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-ims-sdm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + +paths: + /{imsUeId}/ims-data/registration-status: + get: + summary: Retrieve the registration status of a user + operationId: GetRegistrationStatus + tags: + - Registration Status retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:registration-status:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsRegistrationStatus' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data: + get: + summary: > + Retrieve the complete IMS profile for a given IMS public identity + (and public identities in the same IRS) + operationId: GetProfileData + tags: + - IMS Profile Data Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:profile-data:read + parameters: + - name: imsUeId + in: path + description: IMS Identity. In this case it shall be an IMS public identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: dataset-names + in: query + description: Datasets to be retrieved + schema: + $ref: '#/components/schemas/DataSetNames' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsProfileData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data/priority-levels: + get: + summary: Retrieve the service priority levels associated to the user + operationId: GetPriorityInfo + tags: + - Priority Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:priority-levels:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PriorityLevels' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data/ifcs: + get: + summary: Retrieve the Initial Filter Criteria for the associated IMS subscription + operationId: GetIfcs + tags: + - IFCs Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ifcs:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: application-server-name + in: query + description: SIP URI of the Application Server Name + schema: + $ref: '#/components/schemas/SipServerName' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Ifcs' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data/service-level-trace-information: + get: + summary: Retrieve the IMS service level trace information for the associated user + operationId: GetServiceTraceInfo + tags: + - Service Trace Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:service-level-trace-information:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceLevelTraceInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/profile-data/charging-info: + get: + summary: Retrieve the charging information for to the user + operationId: GetChargingInfo + tags: + - Charging Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:charging-info:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingInfo' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/location-data/server-name: + get: + summary: Retrieve the server name for the associated user + operationId: GetServerName + tags: + - Server Name retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:server-name:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsLocationData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/location-data/scscf-capabilities: + get: + summary: Retrieve the S-CSCF capabilities for the associated IMS subscription + operationId: GetScscfCapabilities + tags: + - Retrieval of the S-CSCF capabilities for the IMS subscription + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:scscf-capabilities:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfCapabilityList' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/ims-data/location-data/scscf-selection-assistance-info: + get: + summary: Retrieve the S-CSCF selection assistance info + operationId: GetScscfSelectionAssistanceInfo + tags: + - Retrieval of the S-CSCF selection assistance information for the IMS subscription + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:scscf-selection-assistance-info:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfSelectionAssistanceInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/ps-domain/location-data: + get: + summary: Retrieve the location data in PS domain + operationId: GetLocPsDomain + tags: + - PS location retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:location-data:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: requested-nodes + in: query + description: Indicates the serving node(s) for which the request is applicable. + style: form + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/RequestedNode' + - name: serving-node + in: query + description: > + Indicates that only the stored NF id/address of the serving node(s) is required + schema: + type: boolean + - name: local-time + in: query + description: > + Indicates that only the Local Time Zone information of the location in the visited + network where the UE is attached is requested + schema: + type: boolean + - name: current-location + in: query + description: > + Indicates whether an active location retrieval has to be initiated by the requested node + schema: + type: boolean + - name: rat-type + in: query + description: Indicates whether RAT Type retrieval is requested + schema: + type: boolean + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PsLocation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/cs-domain/location-data: + get: + summary: Retrieve the location data in CS domain + operationId: GetLocCsDomain + tags: + - CS location retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:cs-domain:location-data:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: serving-node + in: query + description: > + Indicates that only the stored NF id/address of the serving node(s) is required + schema: + type: boolean + - name: local-time + in: query + description: > + Indicates that only the Local Time Zone information of the location in the visited + network where the UE is attached is requested + schema: + type: boolean + - name: current-location + in: query + description: > + Indicates whether an active location retrieval has to be initiated by the requested node + schema: + type: boolean + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CsLocation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/repository-data/{serviceIndication}: + put: + summary: Update the repository data associated to an IMPU and service indication + operationId: UpdateRepositoryDataServInd + tags: + - Update repository data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:repository-data:modify + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: serviceIndication + in: path + description: Identifier of a service related data + required: true + schema: + $ref: '#/components/schemas/ServiceIndication' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryData' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryData' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/{imsUeId}/repository-data/{serviceIndication} + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryData' + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete the Repository Data for a Service Indication + operationId: DeleteRepositoryDataServInd + tags: + - Delete repository data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:repository-data:modify + parameters: + - name: imsUeId + in: path + description: Identifier of the UE + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: serviceIndication + in: path + description: Identifier of a service related data + required: true + schema: + $ref: '#/components/schemas/ServiceIndication' + responses: + '204': + description: Expected response to a valid request + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: Retrieve the repository data associated to an IMPU and service indication + operationId: GetRepositoryDataServInd + tags: + - Repository data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:repository-data:read + parameters: + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: serviceIndication + in: path + description: Identifier of a service related data + required: true + schema: + $ref: '#/components/schemas/ServiceIndication' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/identities/msisdns: + get: + summary: retrieve the Msisdns associated to requested identity + operationId: GetMsisdns + tags: + - Retrieval of the associated Msisdns + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:identities:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-id + in: query + description: Private identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/MsisdnList' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/identities/ims-associated-identities: + get: + summary: > + Retrieve the associated identities to the IMS public identity included + in the service request + operationId: GetImsAssocIds + tags: + - Retrieval of associated IMS public identities + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:identities:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsAssociatedIdentities' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/identities/private-identities: + get: + summary: > + Retrieve the associated private identities to the IMS public identity included + in the service request + operationId: GetImsPrivateIds + tags: + - Retrieval of associated IMS private identities + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:identities:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: impi + in: query + description: Private Identity of type IMPI + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PrivateIdentities' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/srvcc-data: + get: + summary: Retrieve the srvcc data + operationId: GetSrvccData + tags: + - Retrieval of UE SRVCC capability and STN-SR + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:srvcc:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity or IMS Private Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SrvccData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Patch + operationId: UpdateSrvccData + tags: + - Update SRVCC data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:srvcc:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Identity or IMS Private Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + /{imsUeId}/service-data/psi-status: + get: + summary: Retrieve the PSI activation state data + operationId: GetPsiState + tags: + - Retrieval of PSI activation state + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:psi-status:read + parameters: + - name: imsUeId + in: path + description: IMS Private Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PsiActivationState' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Patch + operationId: UpdatePsiState + tags: + - Update PSI state data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:psi-status:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Service Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + /{imsUeId}/service-data/dsai: + get: + summary: Retrieve the DSAI information associated to an Application Server + operationId: GetDsaiInfo + tags: + - DSAI registration information + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:dsai:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: application-server-name + in: query + description: SIP URI of the Application Server Name + required: true + schema: + $ref: '#/components/schemas/SipServerName' + - name: dsai-tag + in: query + description: The requested instance of Dynamic Service Activation Info + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/DsaiTagInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + patch: + summary: Patch + operationId: UpdateDsaiState + tags: + - Update Dsai State + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:dsai:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Service Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + description: Unexpected error + + /{imsUeId}/service-data/sms-registration-info: + put: + summary: Update the SMS registration information associated to a user + operationId: UpdateSmsRegistrationInfo + tags: + - Update SMS registration info + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:sms-registration-info:modify + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IpSmGwAddress' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SmsRegistrationInfo' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/{imsUeId}/service-data/sms-registration-info + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SmsRegistrationInfo' + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + delete: + summary: delete the SMS registration information + operationId: DeleteSmsRegistrationInfo + tags: + - Delete SMS registration information + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:sms-registration-info:modify + parameters: + - name: imsUeId + in: path + description: Identifier of the UE + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '204': + description: Expected response to a valid request + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + get: + summary: Retrieve the SMS registration information associated to a user + operationId: GetSmsRegistrationInfo + tags: + - SMS registration information + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:sms-registration-info:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SmsRegistrationInfo' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/identities/imeisv: + get: + summary: Retrieve the IMEISV information + operationId: GetIMEISVInfo + tags: + - IMEISV Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:identities:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImeiSvInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/ps-domain/ip-address: + get: + summary: Retrieve the IP address information + operationId: GetIpAddressInfo + tags: + - IP address Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:ip-address:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/ps-domain/tads-info: + get: + summary: Retrieve the T-ADS information + operationId: GetTadsInfo + tags: + - TADS Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:tads-info:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/TadsInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/ps-domain/ue-reach-subscriptions: + post: + summary: subscribe to notifications of UE reachability + operationId: UeReachIpSubscribe + tags: + - UE IP reachability Subscription Creation + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:ue-reach-subscriptions:create + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UeReachabilitySubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CreatedUeReachabilitySubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/{imsUeId}/access-data/ps-domain/ue-reach-subscriptions/{subscriptionId} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + callbacks: + ueReachabilityNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UeReachabilityNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{imsUeId}/access-data/ps-domain/ue-reach-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications to UE reachability + operationId: UeReachUnsubscribe + tags: + - Reachability Subscription Deletion + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:ue-reach-subscriptions:modify + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + patch: + summary: modify the subscription + operationId: UeReachSubsModify + tags: + - Reachability Subscription Modification + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:ue-reach-subscriptions:modify + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful modification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + /{imsUeId}/access-data/ps-domain/user-state: + get: + summary: Retrieve the user state information in PS domain + operationId: GetPsUserStateInfo + tags: + - PS User State Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:ps-domain:user-state:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: requested-nodes + in: query + description: Indicates the serving node(s) for which the request is applicable. + style: form + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/RequestedNode' + minItems: 1 + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/PsUserState' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/cs-domain/user-state: + get: + summary: Retrieve the user state information in CS domain + operationId: GetCsUserStateInfo + tags: + - CS User State Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:cs-domain:user-state:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CsUserState' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/cs-domain/csrn: + get: + summary: Retrieve the routeing number in CS domain + operationId: GetCsrn + tags: + - CSRN retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:cs-domain:csrn:read + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: pre-paging + in: query + description: Indicates pre-paging support + schema: + $ref: '#/components/schemas/PrePaging' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + - name: call-reference-info + in: query + description: Indicates Call-Reference Number and AS-Number + content: + application/json: + schema: + $ref: '#/components/schemas/CallReferenceInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/Csrn' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/access-data/wireline-domain/reference-location: + get: + summary: Retrieve the reference location information + operationId: GetReferenceLocationInfo + tags: + - Reference Location Info Retrieval + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:wireline-domain:reference-location:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: private-identity + in: query + description: IMS Private Identity + schema: + $ref: '#/components/schemas/PrivateId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ReferenceLocationInformation' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/subscriptions: + post: + summary: subscribe to notifications + operationId: ImsSdmSubscribe + tags: + - SDM Subscription Creation + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:subscriptions:create + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImsSdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsSdmSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/{imsUeId}/subscriptions/{subscriptionId} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications + operationId: ImsSdmUnsubscribe + tags: + - SDM Subscription Deletion + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:subscription:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: modify the subscription + operationId: ImsSdmSubsModify + tags: + - SDM Subscription Modification + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:subscription:modify + parameters: + - name: imsUeId + in: path + description: IMS Public Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: subscriptionId + in: path + description: Id of the Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful modification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /shared-data-subscriptions: + post: + summary: subscribe to notifications for shared data + operationId: SubscribeToSharedData + tags: + - Subscription Creation for shared data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:shared-subscriptions:create + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImsSdmSubscription' + required: true + responses: + '201': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ImsSdmSubscription' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-sdm/v1/shared-data-subscriptions/{subscriptionId} + required: true + schema: + type: string + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + datachangeNotification: + '{request.body#/callbackReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/ModificationNotification' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /shared-data-subscriptions/{subscriptionId}: + delete: + summary: unsubscribe from notifications for shared data + operationId: UnsubscribeForSharedData + tags: + - Subscription Deletion for shared data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:shared-subscription:modify + parameters: + - name: subscriptionId + in: path + description: Id of the Shared data Subscription + required: true + schema: + type: string + responses: + '204': + description: Successful response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + patch: + summary: modify the subscription + operationId: ModifySharedDataSubs + tags: + - Subscription Modification + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:shared-subscription:modify + parameters: + - name: subscriptionId + in: path + description: Id of the SDM Subscription + required: true + schema: + type: string + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + requestBody: + content: + application/json-patch+json: + schema: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchResult' + '204': + description: Successful modification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /shared-data: + get: + summary: retrieve shared data + operationId: GetSharedData + tags: + - Retrieval of shared data + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:shared-data:read + parameters: + - name: shared-data-ids + in: query + description: List of shared data ids + required: true + style: form + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/SharedDataId' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SharedData' + minItems: 1 + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/repository-data: + get: + summary: Retrieve the repository data associated to an IMPU and service indication list + operationId: GetRepositoryDataServIndList + tags: + - Repository data list + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-sdm + - oAuth2ClientCredentials: + - nhss-ims-sdm + - nhss-ims-sdm:repository-data:read + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + - name: supported-features + in: query + description: Supported Features + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + - name: service-indications + in: query + description: Identifiers of a services related data + required: true + style: form + explode: false + schema: + type: array + items: + $ref: '#/components/schemas/ServiceIndication' + minItems: 1 + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/RepositoryDataList' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-ims-sdm: Access to the Nhss IMS Subscription Data Management API + nhss-ims-sdm:registration-status:read: Access to read the Registration Status resource + nhss-ims-sdm:profile-data:read: Access to read the Profile Data resource + nhss-ims-sdm:priority-levels:read: Access to read the Priority Levels resource + nhss-ims-sdm:ifcs:read: Access to read the Initial Filter Criteria resource + nhss-ims-sdm:service-level-trace-information:read: >- + Access to read the Service Level Trace Information resource + nhss-ims-sdm:server-name:read: Access to read the Server Name resource + nhss-ims-sdm:scscf-capabilities:read: Access to read the S-CSCF Capabilities resource + nhss-ims-sdm:ps-domain:location-data:read: >- + Access to read the PS-Domain Location Data resource + nhss-ims-sdm:ps-domain:ip-address:read: Access to read the PS-Domain IP Address resource + nhss-ims-sdm:ps-domain:tads-info:read: Access to read the PS-Domain TADS Info resource + nhss-ims-sdm:ps-domain:ue-reach-subscriptions:create: >- + Access to create PS-Domain UE Reachability Subscriptions resources + nhss-ims-sdm:ps-domain:ue-reach-subscriptions:modify: >- + Access to update/delete a PS-Domain UE Reachability Subscription resource + nhss-ims-sdm:ps-domain:user-state:read: Access to read the PS-Domain User State resource + nhss-ims-sdm:cs-domain:location-data:read: >- + Access to read the CS-Domain Location Data resource + nhss-ims-sdm:cs-domain:user-state:read: Access to read the CS-Domain User State resource + nhss-ims-sdm:cs-domain:csrn:read: Access to read the CS-Domain CSRN resource + nhss-ims-sdm:wireline-domain:reference-location:read: >- + Access to read the Wireline-Domain Reference Location resource + nhss-ims-sdm:repository-data:modify: >- + Access to create/update/delete the Repository Data resource + nhss-ims-sdm:repository-data:read: Access to read the Repository Data resource + nhss-ims-sdm:identities:read: Access to read the Identities resource + nhss-ims-sdm:srvcc:read: Access to read the SRVCC resource + nhss-ims-sdm:srvcc:modify: Acess to update the SRVCC resource + nhss-ims-sdm:psi-status:read: Access to read the PSI Status resource + nhss-ims-sdm:psi-status:modify: Acess to update the PSI Status resource + nhss-ims-sdm:dsai:read: Acess to read the DSAI resource + nhss-ims-sdm:dsai:modify: Acess to update the DSAI resource + nhss-ims-sdm:sms-registration-info:read: >- + Acess to read the SMS Registration Info resource + nhss-ims-sdm:sms-registration-info:modify: >- + Acess to create/update/delete the SMS Registration Info resource + nhss-ims-sdm:subscriptions:create: Access to create Subscriptions resources + nhss-ims-sdm:subscription:modify: Access to update/delete a Subscription resource + nhss-ims-sdm:shared-subscriptions:create: >- + Access to create a Shared-Data Subscriptions resource + nhss-ims-sdm:shared-subscription:modify: >- + Access to update/delete a Shared-Data Subscription resource + nhss-ims-sdm:shared-data:read: Access to read the Shared-Data resource + nhss-ims-sdm:charging-info:read: Access to read the ChargingInfo resource + + schemas: + +# +# COMPLEX TYPES: +# + + ScscfCapabilityList: + description: Information about mandatory and optional S-CSCF capabilities + type: object + properties: + mandatoryCapabilityList: + $ref: '#/components/schemas/Capabilities' + optionalCapabilityList: + $ref: '#/components/schemas/Capabilities' + anyOf: + - required: [mandatoryCapabilityList] + - required: [optionalCapabilityList] + + Capabilities: + description: A list of capabilities of the S-CSCF + type: array + items: + $ref: '#/components/schemas/Capability' + minItems: 1 + uniqueItems: true + + RepositoryData: + description: Repository Data for the requested Service Indication + type: object + required: + - serviceData + - sequenceNumber + properties: + sequenceNumber: + $ref: '#/components/schemas/SequenceNumber' + serviceData: + type: string + format: byte + + MsisdnList: + description: List of MSISDNs associated to the IMS public Identity + type: object + required: + - basicMsisdn + properties: + basicMsisdn: + $ref: '#/components/schemas/Msisdn' + additionalMsisdns: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/Msisdn' + + PublicIdentities: + description: > + IMS Public Identities which belong to the same Implicit Registration Set (if any) + as the requested IMS Public Identity + type: object + required: + - publicIdentities + properties: + publicIdentities: + type: array + items: + $ref: '#/components/schemas/PublicIdentity' + minItems: 1 + uniqueItems: true + + PrivateIdentities: + description: A list of IMS Private Identities + type: object + required: + - privateIdentities + properties: + privateIdentities: + type: array + items: + $ref: '#/components/schemas/PrivateIdentity' + minItems: 1 + uniqueItems: true + + PublicIdentity: + description: > + IMS Public Identity and related data (Alias Group Id, IRS default indication, + Identity Type) + type: object + required: + - imsPublicId + - identityType + properties: + imsPublicId: + $ref: '#/components/schemas/ImsPublicId' + identityType: + $ref: '#/components/schemas/IdentityType' + irsIsDefault: + type: boolean + aliasGroupId: + type: string + + PrivateIdentity: + description: IMS Private Identity and its identity type (IMPI or IMSI) + type: object + required: + - privateIdentity + - privateIdentityType + properties: + privateIdentity: + $ref: '#/components/schemas/PrivateId' + privateIdentityType: + $ref: '#/components/schemas/PrivateIdentityType' + + ImsAssociatedIdentities: + description: > + A list of identities belonging to the same Implicit Registration Set (IRS), + along with the registration state of the IRS + type: object + required: + - irsState + - publicIdentities + properties: + irsState: + $ref: '#/components/schemas/ImsRegistrationState' + publicIdentities: + $ref: '#/components/schemas/PublicIdentities' + + ImsSdmSubscription: + description: A subscription to notifications of data change + type: object + required: + - nfInstanceId + - callbackReference + - monitoredResourceUris + properties: + nfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + monitoredResourceUris: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + expires: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + ImsRegistrationStatus: + description: Registration status of the user + type: object + required: + - imsUserStatus + properties: + imsUserStatus: + $ref: '#/components/schemas/ImsRegistrationState' + + PriorityLevels: + description: Namespaces and priority levels allowed for the IMS public Identity + type: object + required: + - servicePriorityLevelList + properties: + servicePriorityLevelList: + type: array + items: + $ref: '#/components/schemas/NameSpacePriority' + minItems: 1 + uniqueItems: true + servicePriorityLevel: + type: integer + minimum: 0 + maximum: 4 + + Ifcs: + description: List of IFCs associated to the IMS public Identity + type: object + properties: + ifcList: + type: array + items: + $ref: '#/components/schemas/Ifc' + minItems: 1 + cscfFilterSetIdList: + type: array + items: + $ref: '#/components/schemas/CscfFilterSetId' + minItems: 1 + anyOf: + - required: [ ifcList ] + - required: [ cscfFilterSetIdList ] + + Ifc: + description: Data associated to an individual IFC (Initial Filter Criteria) + type: object + required: + - priority + - appServer + properties: + priority: + type: integer + minimum: 1 + trigger: + $ref: '#/components/schemas/TriggerPoint' + appServer: + $ref: '#/components/schemas/ApplicationServer' + + TriggerPoint: + description: > + Contains the conditions that should be checked in order to find out if an + Application Server should be contacted or not + type: object + required: + - conditionType + - sptList + properties: + conditionType: + $ref: '#/components/schemas/TypeOfCondition' + sptList: + type: array + items: + $ref: '#/components/schemas/Spt' + minItems: 1 + + Spt: + description: Contains the data of a Service Point Trigger + type: object + required: + - conditionNegated + - sptGroup + properties: + conditionNegated: + type: boolean + sptGroup: + type: array + items: + $ref: '#/components/schemas/SptGroupId' + minItems: 1 + regType: + items: + $ref: '#/components/schemas/RegistrationType' + minItems: 1 + maxItems: 2 + requestUri: + type: string + sipMethod: + type: string + sipHeader: + $ref: '#/components/schemas/HeaderSipRequest' + sessionCase: + $ref: '#/components/schemas/RequestDirection' + sessionDescription: + $ref: '#/components/schemas/SdpDescription' + + HeaderSipRequest: + description: Contains a header (and optionally value of the header) in the SIP request + type: object + required: + - header + properties: + header: + type: string + content: + type: string + + SdpDescription: + description: > + Contains a SDP line (and optionally the value in the line) within the body (if any) + of a SIP request + type: object + required: + - line + properties: + line: + type: string + content: + type: string + + ApplicationServer: + description: > + Application Server which shall be triggered if the conditions of a certain IFC are met, + and its associated data + type: object + required: + - asUri + properties: + asUri: + type: string + sessionContinue: + type: boolean + serviceInfoList: + type: array + items: + $ref: '#/components/schemas/ServiceInformation' + minItems: 1 + + ImsLocationData: + description: IMS Location Data (S-CSCF name) + type: object + required: + - scscfName + properties: + scscfName: + type: string + + PsLocation: + description: Location data in PS domain + type: object + oneOf: + - required: + - sgsnLocationData + - required: + - mmeLocationData + - required: + - amfLocationData + - required: + - twanLocationData + properties: + sgsnLocationData: + $ref: '#/components/schemas/SgsnLocationData' + mmeLocationData: + $ref: '#/components/schemas/MmeLocationData' + amfLocationData: + $ref: '#/components/schemas/AmfLocationData' + twanLocationData: + $ref: '#/components/schemas/TwanLocationData' + + SgsnLocationData: + description: Location information as retrieved from the SGSN serving node + type: object + required: + - sgsnNumber + - plmnId + properties: + sgsnNumber: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + sgsnLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UtraLocation' + csgInformation: + $ref: '#/components/schemas/CsgInformation' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + + MmeLocationData: + description: Location information as retrieved from the MME serving node + type: object + required: + - mmeAddress + - plmnId + properties: + mmeAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + mmeLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/EutraLocation' + csgInformation: + $ref: '#/components/schemas/CsgInformation' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + + AmfLocationData: + description: Location information as retrieved from the AMF serving node + type: object + required: + - amfAddress + - plmnId + properties: + amfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + amfLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NrLocation' + smsfAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + + TwanLocationData: + description: Location information of the 3GPP AAA Server for Trusted W-LAN Access + type: object + required: + - twanSsid + - plmnId + properties: + twanSsid: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + twanBssid: + type: string + civicAddress: + type: string + format: byte + twanOperatorName: + type: string + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + logicalAccessId: + type: string + + CsLocation: + description: Location data in CS domain + type: object + required: + - mscNumber + - vlrNumber + - plmnId + properties: + mscNumber: + type: string + vlrNumber: + type: string + plmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + vlrLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GeraLocation' + csgInformation: + $ref: '#/components/schemas/CsgInformation' + timeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + eUtranCgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + + CsgInformation: + description: Information about a Closed Subscriber Group (CSG) + type: object + required: + - csgId + properties: + csgId: + type: string + format: byte + accessMode: + type: string + format: byte + cMi: + type: boolean + + SrvccData: + description: UE SRVCC capability (if available) and STN-SR (if subscribed) + type: object + required: + - stnSr + properties: + stnSr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/StnSr' + ueSrvccCapabilities: + type: array + items: + $ref: '#/components/schemas/SrvccCapability' + minItems: 1 + uniqueItems: true + + PsiActivationState: + description: Public Service Identity activation state + type: object + required: + - activationState + properties: + activationState: + $ref: '#/components/schemas/ActivationState' + + SharedData: + description: Represents a part of the IMS Profile data shared by several UEs + type: object + required: + - sharedDataId + properties: + sharedDataId: + $ref: '#/components/schemas/SharedDataId' + sharedImsIfcData: + $ref: '#/components/schemas/Ifcs' + minProperties: 1 + + ImsProfileData: + description: User's IMS profile data + type: object + required: + - imsServiceProfiles + properties: + imsServiceProfiles: + type: array + items: + $ref: '#/components/schemas/ImsServiceProfile' + chargingInfo: + $ref: '#/components/schemas/ChargingInfo' + serviceLevelTraceInfo: + $ref: '#/components/schemas/ServiceLevelTraceInformation' + servicePriorityLevelList: + type: array + items: + $ref: '#/components/schemas/NameSpacePriority' + minItems: 1 + uniqueItems: true + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + maxAllowedSimulReg: + type: integer + servicePriorityLevel: + type: integer + minimum: 0 + maximum: 4 + + ImsServiceProfile: + description: > + IMS Service Profile of the UE, containing the list of Public Identifiers and + optionally a list of IFCs + type: object + required: + - publicIdentifierList + properties: + publicIdentifierList: + type: array + items: + $ref: '#/components/schemas/PublicIdentifier' + ifcs: + $ref: '#/components/schemas/Ifcs' + cnServiceAuthorization: + $ref: '#/components/schemas/CoreNetworkServiceAuthorization' + + CoreNetworkServiceAuthorization: + description: > + Core Network Service Authorization + type: object + properties: + subscribedMediaProfileId: + type: integer + + PublicIdentifier: + description: > + Distinct or wildcarded public identity and its associated priority, trace and + barring information + type: object + required: + - publicIdentity + properties: + publicIdentity: + $ref: '#/components/schemas/PublicIdentity' + displayName: + type: string + imsServicePriority: + $ref: '#/components/schemas/PriorityLevels' + serviceLevelTraceInfo: + $ref: '#/components/schemas/ServiceLevelTraceInformation' + barringIndicator: + type: boolean + wildcardedImpu: + type: string + + ServiceLevelTraceInformation: + description: IMS Service Level Trace Information + type: object + properties: + serviceLevelTraceInfo: + type: string + + ImeiSvInformation: + description: IMEI(SV) information + type: object + oneOf: + - required: + - imei + - required: + - imeiSv + properties: + imei: + $ref: '#/components/schemas/Imei' + imeiSv: + $ref: '#/components/schemas/ImeiSv' + + TadsInformation: + description: T-ADS Information + type: object + required: + - voiceOverPsSessionSupport + properties: + voiceOverPsSessionSupport: + $ref: '#/components/schemas/ImsVoiceOverPsSessionSupport' + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + lastUeActivityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + UeReachabilitySubscription: + description: > + Contains the request parameters received by the HSS for a subscription to + notifications of UE reachability for IP + type: object + required: + - expiry + - callbackReference + properties: + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + callbackReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + + CreatedUeReachabilitySubscription: + description: > + Contains the response data returned by HSS after the subscription to + notifications of UE reachability for IP was created + type: object + required: + - expiry + properties: + expiry: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + UeReachabilityNotification: + description: > + Represents the contents of a notification of UE reachability for IP sent by the HSS + type: object + required: + - reachabilityIndicator + - detectingNode + - accessType + properties: + reachabilityIndicator: + type: boolean + detectingNode: + $ref: '#/components/schemas/DetectingNode' + accessType: + $ref: '#/components/schemas/AccessType' + + PsUserState: + description: User state in PS domain + type: object + oneOf: + - required: + - sgsnUserState + - required: + - mmeUserState + - required: + - amfUserState + properties: + sgsnUserState: + $ref: '#/components/schemas/UserStatePs' + mmeUserState: + $ref: '#/components/schemas/UserStatePs' + amfUserState: + $ref: '#/components/schemas/UserStatePs' + + CsUserState: + description: User state in CS domain + type: object + required: + - mscVlrUserState + properties: + mscVlrUserState: + $ref: '#/components/schemas/UserStateCs' + + Csrn: + description: CS domain routeing number + type: object + required: + - csrn + properties: + csrn: + $ref: '#/components/schemas/Msisdn' + + ReferenceLocationInformation: + description: Reference Location Information for the user in fixed access networks + type: object + properties: + accessType: + type: string + accessInfo: + type: string + accessValue: + type: string + anyOf: + - required: [accessType] + - required: [accessInfo] + - required: [accessValue] + + SmsRegistrationInfo: + description: SMS Registration Information (IP-SM-GW number and SC address) + type: object + required: + - ipSmGwNumber + properties: + ipSmGwNumber: + $ref: '#/components/schemas/Msisdn' + scAddress: + $ref: '#/components/schemas/Msisdn' + + IpSmGwAddress: + description: IP-SM-GW number and diameter URI/realm + type: object + required: + - ipSmGwNumber + properties: + ipSmGwNumber: + $ref: '#/components/schemas/Msisdn' + ipSmGwDiaUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + ipSmGwDiaRealm: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + ipSmGwSbiSupInd: + type: boolean + default: false + + DsaiTagInformation: + description: > + DSAI tag information (list of DSAI tags activation state for an Application Server) + type: object + required: + - dsaiTagStatusList + properties: + dsaiTagStatusList: + type: array + items: + $ref: '#/components/schemas/DsaiTagStatus' + minItems: 1 + uniqueItems: true + + DsaiTagStatus: + description: DSAI tag status (DSAI tag and activation state) + type: object + required: + - dsaiTag + - dsaiState + properties: + dsaiTag: + type: string + dsaiState: + $ref: '#/components/schemas/ActivationState' + + ScscfSelectionAssistanceInformation: + description: Information used by the I-CSCF to select an S-CSCF for the UE + type: object + properties: + scscfCapabilityList: + $ref: '#/components/schemas/ScscfCapabilityList' + scscfNames: + type: array + items: + type: string + minItems: 1 + anyOf: + - required: [scscfCapabilityList] + - required: [scscfNames] + + ChargingInfo: + description: Diameter addresses of the charging function + type: object + anyOf: + - required: + - primaryEventChargingFunctionName + - required: + - primaryChargingCollectionFunctionName + properties: + primaryEventChargingFunctionName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + secondaryEventChargingFunctionName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + primaryChargingCollectionFunctionName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + secondaryChargingCollectionFunctionName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DiameterIdentity' + + CallReferenceInfo: + description: > + Contains a Call Reference Number and the AS-Number; it allows a later retry of the call + setup in the context of MTRR + type: object + required: + - callRefNumber + - asNumber + properties: + callRefNumber: + type: string + format: byte + description: > + The content is according to CallReferenceNumber type described in 3GPP TS 29.002 [30]. + Base64 encoded according to IETF RFC 2045 [28] + asNumber: + type: string + format: byte + description: > + The content is according to ISDN-AddressString type described in 3GPP TS 29.002 [30]. + Base64 encoded according to IETF RFC 2045 [28] + + DataSetNames: + description: Contains the data sets to be retrieved from the IMS User Profile + type: array + items: + $ref: '#/components/schemas/DataSetName' + minItems: 1 + uniqueItems: true + + RepositoryDataList: + description: List of Repository Data for the requested Service Indications + type: object + required: + - repositoryDataMap + properties: + repositoryDataMap: + description: > + A map (list of key-value pairs where ServiceIndication serves as key) of RepositoryData + type: object + additionalProperties: + $ref: '#/components/schemas/RepositoryData' + +# +# SIMPLE TYPES: +# + + Capability: + description: S-CSCF capability + type: integer + + ImsUeId: + description: > + Represents the IMS Public Identity (i.e. IMS Public User identity or + Public Service Identity) + type: string + pattern: '^(impu-sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}|impu-tel\:\+[0-9]{5,15}|impi-.+|.+)$' + + SequenceNumber: + description: > + Unsigned integer containing the sequence number associated to the current version + of Repository Data + type: integer + minimum: 0 + + ServiceIndication: + description: String containing the Service Indication or Service Identifier + type: string + + Msisdn: + description: String containing an additional or basic MSISDN + type: string + pattern: '[0-9]{5,15}$' + + PrivateId: + description: String containing a Private User Identity or a Private Service Identity + type: string + + ImsPublicId: + description: String containing an IMS Public Identity in SIP URI format or TEL URI format + type: string + pattern: '^(sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}|tel\:\+[0-9]{5,15})$' + + NameSpacePriority: + description: > + String containing the namespace and priority formatted as "r-value" parameter + described in IETF RFC 4412 + type: string + pattern: '^[0-9a-zA-Z-\!%\*_\+`''~]+.[0-9a-zA-Z-\!%\*_\+`''~]+$' + + CscfFilterSetId: + description: Contains the identifier of a specific filter set in the S-CSCF + type: integer + minimum: 0 + + SptGroupId: + description: Contains the identifier of the Group of SPTs + type: integer + minimum: 0 + + SharedDataId: + description: > + Identifies globally and uniquely a piece of subscription data shared by multiple UEs; + the value shall start with the HPLMN id (MCC/MNC) followed by a hyphen followed by a + local Id as allocated by the home network operator + type: string + pattern: '^[0-9]{5,6}-.+$' + + Imei: + description: IMEI of the UE + type: string + pattern: '^[0-9]{15}$' + + ImeiSv: + description: IMEISV of the UE + type: string + pattern: '^[0-9]{16}$' + + PrePaging: + description: Inidicates the support of pre-paging + type: boolean + + SipServerName: + description: Server Name (e.g. AS name, CSCF name) in SIP URI format + type: string + pattern: '^(sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,})$' + +# +# ENUMS: +# + + IdentityType: + description: Represents the type of IMS Public Identity + anyOf: + - type: string + enum: + - DISTINCT_IMPU + - DISTINCT_PSI + - WILDCARDED_IMPU + - WILDCARDED_PSI + - type: string + + PrivateIdentityType: + description: Represents the type of IMS Private Identity (IMPI or IMSI) + anyOf: + - type: string + enum: + - IMPI + - IMSI + - type: string + + ImsRegistrationState: + description: Represents the IMS status of the user or Public Identity or the IRS + anyOf: + - type: string + enum: + - REGISTERED + - NOT_REGISTERED + - AUTHENTICATION_PENDING + - REGISTERED_UNREG_SERVICES + - type: string + + TypeOfCondition: + description: > + Represents the type of condition to be applied to the logical expression of SPT groups + and SPTs (Conjunctive Normal Form, or Disjunctive Normal Form) + anyOf: + - type: string + enum: + - CNF + - DNF + - type: string + + RegistrationType: + description: Represents the type of registration associated to the REGISTER request + anyOf: + - type: string + enum: + - INITIAL_REGISTRATION + - RE_REGISTRATION + - DE_REGISTRATION + - type: string + + RequestDirection: + description: > + Represents the direction of the request in combination with the registration status + of the user as evaluated in the S-CSCF + anyOf: + - type: string + enum: + - ORIGINATING_REGISTERED + - ORIGINATING_UNREGISTERED + - ORIGINATING_CDIV + - TERMINATING_REGISTERED + - TERMINATING_UNREGISTERED + - type: string + + ServiceInformation: + description: > + Indicates the type of additional information to be included in the body of the SIP request + towards the Application Server + anyOf: + - type: string + enum: + - INCLUDE_REGISTER_REQUEST + - INCLUDE_REGISTER_RESPONSE + - type: string + + RequestedNode: + description: Represents the type of serving node for which certain data is requested + anyOf: + - type: string + enum: + - SGSN + - MME + - AMF + - 3GPP_AAA_SERVER_TWAN + - type: string + + SrvccCapability: + description: Represents the type of SRVCC support of the UE + anyOf: + - type: string + enum: + - UE_4G_SRVCC_CAPABLE + - UE_5G_SRVCC_CAPABLE + - type: string + + ActivationState: + description: Represents the activation state of a PSI or DSAI tag + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + + ImsVoiceOverPsSessionSupport: + description: Represents the support for Voice-over-PS of the UE + anyOf: + - type: string + enum: + - IMS_VOICE_OVER_PS_NOT_SUPPORTED + - IMS_VOICE_OVER_PS_SUPPORTED + - IMS_VOICE_OVER_PS_SUPPORT_UNKNOWN + - type: string + + DetectingNode: + description: Represents the type of serving node that detected the reachability of the UE + anyOf: + - type: string + enum: + - SGSN + - MME + - AMF + - type: string + + AccessType: + description: Represents the type of access (3GPP or non-3GPP) + anyOf: + - type: string + enum: + - 3GPP_ACCESS + - NON_3GPP_ACCESS + - type: string + + UserStatePs: + description: Represents the user state in PS domain + anyOf: + - type: string + enum: + - DETACHED + - ATTACHED_NOT_REACHABLE_FOR_PAGING + - ATTACHED_REACHABLE_FOR_PAGING + - CONNECTED_NOT_REACHABLE_FOR_PAGING + - CONNECTED_REACHABLE_FOR_PAGING + - NOT_PROVIDED_FROM_SGSN_OR_MME_OR_AMF + - NETWORK_DETERMINED_NOT_REACHABLE + - type: string + + UserStateCs: + description: Represents the user state in CS domain + anyOf: + - type: string + enum: + - CAMEL_BUSY + - NETWORK_DETERMINED_NOT_REACHABLE + - ASSUMED_IDLE + - NOT_PROVIDED_FROM_VLR + - type: string + + DataSetName: + description: A set of data within the IMS User Profile + anyOf: + - type: string + enum: + - CHARGING_DATA + - IFC_DATA + - TRACE_DATA + - PRIORITY_DATA + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsUEAU.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsUEAU.yaml new file mode 100644 index 000000000..d6b4574d2 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsUEAU.yaml @@ -0,0 +1,247 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'Nhss_imsUEAU' + description: | + Nhss UE Authentication Service for IMS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 Home Subscriber Server (HSS) Services, version 17.5.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-ims-ueau/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-ueau + +paths: + + /{impi}/security-information/generate-sip-auth-data: + post: + summary: Generate authentication data for the UE based on the Auth-Scheme provided + operationId: GenerateSipAuthData + tags: + - Generate SIP Auth Data (Custom Operation) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-ueau + - oAuth2ClientCredentials: + - nhss-ims-ueau + - nhss-ims-ueau:generate-sip-auth-data:invoke + parameters: + - name: impi + in: path + description: IMS Private Identity for the UE (IMPI) + required: true + schema: + $ref: '#/components/schemas/Impi' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SipAuthenticationInfoRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/SipAuthenticationInfoResult' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-ims-ueau: Access to the Nhss IMS UE Authentication API + nhss-ims-ueau:generate-sip-auth-data:invoke: > + Access to invoke the Generate SIP Auth Data custom operation + + schemas: + +# +# COMPLEX TYPES: +# + + SipAuthenticationInfoRequest: + description: > + Contains input data to the SIP authentication request message (e.g. SIP authentication + scheme, requested number of authentication items, resynchronization information) + type: object + required: + - cscfServerName + - sipAuthenticationScheme + properties: + cscfServerName: + type: string + sipAuthenticationScheme: + $ref: '#/components/schemas/SipAuthenticationScheme' + sipNumberAuthItems: + $ref: '#/components/schemas/SipNumberAuthItems' + resynchronizationInfo: + $ref: '#/components/schemas/ResynchronizationInfo' + + ResynchronizationInfo: + description: Contains RAND and AUTS + type: object + required: + - rand + - auts + properties: + rand: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' + auts: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Auts' + + SipAuthenticationInfoResult: + description: > + Contains authentication information returned in the SIP authentication response message + (e.g. authentication vectors, digest authentication parameters, line identifiers) + type: object + required: + - impi + properties: + impi: + $ref: '#/components/schemas/Impi' + 3gAkaAvs: + type: array + items: + $ref: '#/components/schemas/3GAkaAv' + minItems: 1 + digestAuth: + $ref: '#/components/schemas/DigestAuthentication' + lineIdentifierList: + type: array + items: + $ref: '#/components/schemas/LineIdentifier' + minItems: 1 + ipAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + + 3GAkaAv: + description: Contains RAND, XRES, AUTN, CK, and IK + type: object + required: + - rand + - xres + - autn + - ck + - ik + properties: + rand: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Rand' + xres: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Xres' + autn: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/Autn' + ck: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/ConfidentialityKey' + ik: + $ref: 'TS29503_Nudm_UEAU.yaml#/components/schemas/IntegrityKey' + + DigestAuthentication: + description: Parameters used for the Digest authentication scheme + type: object + required: + - digestRealm + - digestAlgorithm + - digestQop + - ha1 + properties: + digestRealm: + type: string + digestAlgorithm: + $ref: '#/components/schemas/SipDigestAlgorithm' + digestQop: + $ref: '#/components/schemas/SipDigestQop' + ha1: + type: string + +# +# SIMPLE TYPES: +# + + SipNumberAuthItems: + description: Indicates the number of requested SIP authentication items + type: integer + minimum: 1 + + Impi: + description: IMS Private Identity of the UE + type: string + + LineIdentifier: + description: Line Identifier for the wireline access + type: string + +# +# ENUMS: +# + + SipAuthenticationScheme: + description: Authentication scheme to be used in the SIP authentication request message + anyOf: + - type: string + enum: + - DIGEST-AKAV1-MD5 + - DIGEST-HTTP + - NBA + - GIBA + - UNKNOWN + - type: string + + SipDigestAlgorithm: + description: Algorithm used for the SIP Digest authentication scheme + anyOf: + - type: string + enum: + - MD5 + - MD5_SESS + - type: string + + SipDigestQop: + description: Quality of Protection for the SIP Digest authentication scheme + anyOf: + - type: string + enum: + - AUTH + - AUTH_INT + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsUECM.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsUECM.yaml new file mode 100644 index 000000000..09551ff07 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29562_Nhss_imsUECM.yaml @@ -0,0 +1,638 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'Nhss_imsUECM' + description: | + Nhss UE Context Management Service for IMS. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.562 Home Subscriber Server (HSS) Services, version 17.5.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.562/' + +servers: + - url: '{apiRoot}/nhss-ims-uecm/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + +paths: + + /{impu}/authorize: + post: + summary: > + Authorize IMS Identities to register in the network or establish multimedia sessions + and return CSCF location if it is stored + operationId: Authorize + tags: + - Authorize (Custom Operation) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:authorize:invoke + parameters: + - name: impu + in: path + description: Public identity of the user. + required: true + schema: + $ref: '#/components/schemas/Impu' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationRequest' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizationResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + deregistrationeNotification: + '{request.body#/deregCallbackUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeregistrationData' + responses: + '204': + description: Successful Notification response + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{imsUeId}/scscf-registration: + put: + summary: SCSCF registration information + operationId: SCSCF registration + tags: + - S-CSCF Registration (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:registration:create + parameters: + - name: imsUeId + in: path + description: IMS Identity + required: true + schema: + $ref: '#/components/schemas/ImsUeId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRegistration' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRegistration' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-uecm/v1/{impu}/scscf-registration + required: true + schema: + type: string + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRegistration' + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ExtendedProblemDetails' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + /{impu}/scscf-registration/scscf-restoration-info: + put: + summary: Update the S-CSCF restoration information of the UE + operationId: UpdateScscfRestorationInfo + tags: + - S-CSCF Restoration Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:restoration:modify + parameters: + - name: impu + in: path + description: Public identity of the user. + required: true + schema: + $ref: '#/components/schemas/Impu' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRestorationInfoRequest' + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRestorationInfoResponse' + headers: + Location: + description: > + Contains the URI of the newly created resource, according to the structure: + {apiRoot}/nhss-ims-uecm/v1/{impu}/scscf-registration/scscf-restoration-info + required: true + schema: + type: string + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRestorationInfoResponse' + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + get: + summary: Retrieve the S-CSCF restoration information of the UE + operationId: GetScscfRestorationInfo + tags: + - S-CSCF Restoration Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:restoration:read + parameters: + - name: impu + in: path + description: Public identity of the user. + required: true + schema: + $ref: '#/components/schemas/Impu' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/ScscfRestorationInfoResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + + delete: + summary: Delete the S-CSCF restoration information of the UE + operationId: DeleteScscfRestorationInfo + tags: + - S-CSCF Restoration Information (Document) + security: + - {} + - oAuth2ClientCredentials: + - nhss-ims-uecm + - oAuth2ClientCredentials: + - nhss-ims-uecm + - nhss-ims-uecm:restoration:modify + parameters: + - name: impu + in: path + description: Public identity of the user. + required: true + schema: + $ref: '#/components/schemas/Impu' + responses: + '204': + description: No content + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nhss-ims-uecm: Access to the Nhss IMS UE Context Management API + nhss-ims-uecm:authorize:invoke: Access to invoke the Authorize custom operation + nhss-ims-uecm:registration:create: Access to create the S-CSCF Registration resource + nhss-ims-uecm:restoration:read: Access to read the S-CSCF Restoration resource + nhss-ims-uecm:restoration:modify: >- + Access to create/update/delete the S-CSCF Restoration resource + + schemas: + +# +# COMPLEX TYPES: +# + + AuthorizationRequest: + description: Ims authorization request data + type: object + required: + - authorizationType + properties: + impi: + $ref: '#/components/schemas/Impi' + authorizationType: + $ref: '#/components/schemas/AuthorizationType' + visitedNetworkIdentifier: + type: string + emergencyIndicator: + type: boolean + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + AuthorizationResponse: + description: Ims Registration authorization information result + type: object + properties: + authorizationResult: + $ref: '#/components/schemas/AuthorizationResult' + cscfServerName: + type: string + scscfSelectionAssistanceInfo: + $ref: 'TS29562_Nhss_imsSDM.yaml#/components/schemas/ScscfSelectionAssistanceInformation' + required: + - authorizationResult + oneOf: + - required: + - cscfServerName + - required: + - scscfSelectionAssistanceInfo + + ScscfRegistration: + description: Scscf Registration + type: object + required: + - imsRegistrationType + - cscfServerName + properties: + impi: + $ref: '#/components/schemas/Impi' + imsRegistrationType: + $ref: '#/components/schemas/ImsRegistrationType' + cscfServerName: + type: string + scscfInstanceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + deregCallbackUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + associatedImpis: + type: array + items: + $ref: '#/components/schemas/Impi' + associatedRegisteredImpis: + type: array + items: + $ref: '#/components/schemas/Impi' + irsImpus: + type: array + items: + $ref: '#/components/schemas/Impu' + minItems: 1 + uniqueItems: true + wildcardedPui: + $ref: '#/components/schemas/Impu' + looseRouteIndicator: + $ref: '#/components/schemas/LooseRouteIndication' + wildcardedPsi: + $ref: '#/components/schemas/Impu' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + multipleRegistrationIndicator: + type: boolean + pcscfRestorationIndicator: + type: boolean + default: false + scscfReselectionIndicator: + type: boolean + default: false + + ExtendedProblemDetails: + description: > + Extension of the ProblemDetails data type, to include additional information + in an error response message + allOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/AdditionalInfo' + + AdditionalInfo: + description: > + Additional information to be sent on error response messages, along with the + common content in ProblemDetails + type: object + properties: + scscfServerName: + type: string + + ScscfRestorationInfo: + description: S-CSCF restoration information + type: object + properties: + userName: + $ref: '#/components/schemas/Impi' + restorationInfo: + type: array + items: + $ref: '#/components/schemas/RestorationInfo' + registrationTimeOut: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sipAuthenticationScheme: + $ref: 'TS29562_Nhss_imsUEAU.yaml#/components/schemas/SipAuthenticationScheme' + + ScscfRestorationInfoRequest: + description: S-CSCF restoration information request + type: object + properties: + scscfRestorationInfoRequest: + $ref: '#/components/schemas/ScscfRestorationInfo' + + ScscfRestorationInfoResponse: + description: S-CSCF restoration information response + type: object + properties: + scscfRestorationInfoResponse: + type: array + items: + $ref: '#/components/schemas/ScscfRestorationInfo' + + RestorationInfo: + description: > + The information relevant to a specific registration required for an S-CSCF + to handle the requests for a user + type: object + required: + - path + - contact + properties: + path: + type: string + contact: + type: string + initialCSeqSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + callIdSipHeader: + type: string + uesubscriptionInfo: + $ref: '#/components/schemas/UeSubscriptionInfo' + pcscfSubscriptionInfo: + $ref: '#/components/schemas/PcscfSubscriptionInfo' + imsSdmSubscriptions: + description: > + A map (list of key-value pairs where subscriptionId serves as key) of ImsSdmSubscription + type: object + additionalProperties: + $ref: 'TS29562_Nhss_imsSDM.yaml#/components/schemas/ImsSdmSubscription' + + UeSubscriptionInfo: + description: Subscription information of the UE for the SIP Registration State event + type: object + required: + - callIdSipHeader + - fromSipHeader + - toSipHeader + - recordRoute + - contact + properties: + callIdSipHeader: + type: string + fromSipHeader: + type: string + toSipHeader: + type: string + recordRoute: + type: string + contact: + type: string + + PcscfSubscriptionInfo: + description: Subscription information of the P-CSCF for the SIP Registration State event + type: object + required: + - callIdSipHeader + - fromSipHeader + - toSipHeader + - contact + properties: + callIdSipHeader: + type: string + fromSipHeader: + type: string + toSipHeader: + type: string + contact: + type: string + + DeregistrationData: + description: Data related to the de-registration information of a S-CSCF in HSS + type: object + required: + - deregReason + - impi + properties: + deregReason: + $ref: '#/components/schemas/DeregistrationReason' + impi: + $ref: '#/components/schemas/Impi' + associatedImpis: + type: array + items: + $ref: '#/components/schemas/Impi' + emergencyRegisteredIdentities: + type: array + items: + $ref: '#/components/schemas/EmergencyRegisteredIdentity' + minItems: 1 + + EmergencyRegisteredIdentity: + description: > + A pair of private and public user identities which have not been de-registered + due to emergency registration + type: object + required: + - impi + - impu + properties: + impi: + $ref: '#/components/schemas/Impi' + impu: + $ref: '#/components/schemas/Impu' + + DeregistrationReason: + description: > + Contains the reason for the network initiated de-registration (including a reason code, + and a human-readable reason text) + type: object + required: + - reasonCode + - reasonText + properties: + reasonCode: + $ref: '#/components/schemas/DeregistrationReasonCode' + reasonText: + type: string + +# +# SIMPLE TYPES +# + + ImsUeId: + description: IMS UE Identity (IMPU or IMPI) + type: string + pattern: '^(impu-sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}|impu-tel\:\+[0-9]{5,15}|impi-.+|.+)$' + + Impu: + description: IMS Public Identity of the UE (sip URI or tel URI) + type: string + pattern: '^(sip\:([a-zA-Z0-9_\-.!~*()&=+$,;?\/]+)\@([A-Za-z0-9]+([-A-Za-z0-9]+)\.)+[a-z]{2,}|tel\:\+[0-9]{5,15})$' + + Impi: + description: IMS Private Identity of the UE + type: string + +# +# ENUMS: +# + + AuthorizationType: + description: Represents the type of authorization requested by the UE + anyOf: + - type: string + enum: + - REGISTRATION + - DEREGISTRATION + - type: string + + AuthorizationResult: + description: Represents the details of the granted authorization to the UE + anyOf: + - type: string + enum: + - FIRST_REGISTRATION + - SUBSEQUENT_REGISTRATION + - type: string + + ImsRegistrationType: + description: Represents the type of registration associated to the REGISTER request + anyOf: + - type: string + enum: + - INITIAL_REGISTRATION + - RE_REGISTRATION + - TIMEOUT_DEREGISTRATION + - USER_DEREGISTRATION + - ADMINISTRATIVE_DEREGISTRATION + - AUTHENTICATION_FAILURE + - AUTHENTICATION_TIMEOUT + - UNREGISTERED_USER + - type: string + + LooseRouteIndication: + description: Indicates whether the loose routing mechanism is required to serve the user + anyOf: + - type: string + enum: + - LOOSE_ROUTE_NOT_REQUIRED + - LOOSE_ROUTE_REQUIRED + - type: string + + DeregistrationReasonCode: + description: Indicates the reason for the network-initiated deregistration + anyOf: + - type: string + enum: + - PERMANENT_TERMINATION + - NEW_SERVER_ASSIGNED + - REMOVE_S-CSCF + - SERVER_CHANGE + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29571_CommonData.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29571_CommonData.yaml new file mode 100644 index 000000000..5ef989492 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29571_CommonData.yaml @@ -0,0 +1,5318 @@ +openapi: 3.0.0 + +info: + version: '1.4.1' + title: 'Common Data Types' + description: | + Common Data Types for Service Based Interfaces. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.571 Common Data Types for Service Based Interfaces, version 17.8.0 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.571/' + +paths: {} +components: + schemas: + +# +# Common Data Types for Generic usage definitiones as defined in clause 5.2 +# + +# +# COMMON SIMPLE DATA TYPES +# + Binary: + format: binary + type: string + description: string with format 'binary' as defined in OpenAPI. + + BinaryRm: + format: binary + type: string + nullable: true + description: "string with format 'binary' as defined in OpenAPI OpenAPI with 'nullable: true' property." + + Bytes: + format: byte + type: string + description: string with format 'bytes' as defined in OpenAPI + + BytesRm: + format: byte + type: string + nullable: true + description: > + string with format 'bytes' as defined in OpenAPI OpenAPI with 'nullable: true' property. + + Date: + format: date + type: string + description: string with format 'date' as defined in OpenAPI. + + DateRm: + format: date + type: string + nullable: true + description: > + string with format 'date' as defined in OpenAPI OpenAPI with 'nullable: true' property. + + DateTime: + format: date-time + type: string + description: string with format 'date-time' as defined in OpenAPI. + + DateTimeRm: + format: date-time + type: string + nullable: true + description: > + string with format 'date-time' as defined in OpenAPI with 'nullable:true' property. + + DiameterIdentity: + $ref: '#/components/schemas/Fqdn' + + DiameterIdentityRm: + $ref: '#/components/schemas/FqdnRm' + + Double: + format: double + type: number + description: string with format 'double' as defined in OpenAPI + + DoubleRm: + format: double + type: number + nullable: true + description: > + string with format 'double' as defined in OpenAPI with 'nullable: true' property. + + DurationSec: + type: integer + description: indicating a time in seconds. + + DurationSecRm: + type: integer + nullable: true + description: "indicating a time in seconds with OpenAPI defined 'nullable: true' property." + + Float: + format: float + type: number + description: string with format 'float' as defined in OpenAPI. + + FloatRm: + format: float + type: number + nullable: true + description: > + string with format 'float' as defined in OpenAPI with the OpenAPI defined + 'nullable: true' property. + + Int32: + format: int32 + type: integer + description: string with format 'int32' as defined in OpenAPI. + + Int32Rm: + format: int32 + type: integer + nullable: true + description: > + string with format 'int32' as defined in OpenAPI with the OpenAPI defined + 'nullable: true' property. + + Int64: + type: integer + format: int64 + description: string with format 'int64' as defined in OpenAPI. + + Int64Rm: + format: int64 + type: integer + nullable: true + description: > + string with format 'int64' as defined in OpenAPI with the OpenAPI defined + 'nullable: true' property. + + Ipv4Addr: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + description: > + String identifying a IPv4 address formatted in the 'dotted decimal' notation + as defined in RFC 1166. + + Ipv4AddrRm: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + nullable: true + description: > + String identifying a IPv4 address formatted in the 'dotted decimal' notation + as defined in RFC 1166 with the OpenAPI defined 'nullable: true' property. + + Ipv4AddrMask: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + example: '198.51.0.0/16' + description: > + "String identifying a IPv4 address mask formatted in the 'dotted decimal' notation + as defined in RFC 1166." + + Ipv4AddrMaskRm: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + example: '198.51.0.0/16' + nullable: true + description: > + String identifying a IPv4 address mask formatted in the 'dotted decimal' notation + as defined in RFC 1166 with the OpenAPI defined 'nullable: true' property. + + Ipv6Addr: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + description: > + String identifying an IPv6 address formatted according to clause 4 of RFC5952. + The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. + + Ipv6AddrRm: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + nullable: true + description: > + String identifying an IPv6 address formatted according to clause 4 of RFC5952 with the + OpenAPI 'nullable: true' property. + The mixed IPv4 IPv6 notation according to clause 5 of RFC5952 shall not be used. + + Ipv6Prefix: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + example: '2001:db8:abcd:12::0/64' + description: > + String identifying an IPv6 address prefix formatted according to clause 4 of RFC 5952. + IPv6Prefix data type may contain an individual /128 IPv6 address. + + Ipv6PrefixRm: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + nullable: true + description: > + String identifying an IPv6 address prefix formatted according to clause 4 of RFC 5952 with + the OpenAPI 'nullable: true' property. IPv6Prefix data type may contain an individual + /128 IPv6 address. + + MacAddr48: + type: string + pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' + description: > + String identifying a MAC address formatted in the hexadecimal notation + according to clause 1.1 and clause 2.1 of RFC 7042. + + MacAddr48Rm: + type: string + pattern: '^([0-9a-fA-F]{2})((-[0-9a-fA-F]{2}){5})$' + nullable: true + description: > + "String identifying a MAC address formatted in the hexadecimal notation according to + clause 1.1 and clause 2.1 of RFC 7042 with the OpenAPI 'nullable: true' property." + + SupportedFeatures: + type: string + pattern: '^[A-Fa-f0-9]*$' + description: > + A string used to indicate the features supported by an API that is used as defined in clause + 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in + hexadecimal representation Each character in the string shall take a value of "0" to "9", + "a" to "f" or "A" to "F" and shall represent the support of 4 features as described in + table 5.2.2-3. The most significant character representing the highest-numbered features + shall appear first in the string, and the character representing features 1 to 4 + shall appear last in the string. The list of features and their numbering (starting with 1) + are defined separately for each API. If the string contains a lower number of characters + than there are defined features for an API, all features that would be represented by + characters that are not present in the string are not supported. + + Uinteger: + type: integer + minimum: 0 + description: Unsigned Integer, i.e. only value 0 and integers above 0 are permissible. + + UintegerRm: + type: integer + minimum: 0 + description: > + Unsigned Integer, i.e. only value 0 and integers above 0 are permissible with + the OpenAPI 'nullable: true' property. + nullable: true + + Uint16: + type: integer + minimum: 0 + maximum: 65535 + description: Integer where the allowed values correspond to the value range of an unsigned 16-bit integer. + + Uint16Rm: + type: integer + minimum: 0 + maximum: 65535 + nullable: true + description: > + Integer where the allowed values correspond to the value range of an unsigned + 16-bit integer with the OpenAPI 'nullable: true' property. + + Uint32: + type: integer + minimum: 0 + maximum: 4294967295 #(2^32)-1 + description: > + Integer where the allowed values correspond to the value range of an unsigned + 32-bit integer. + + Uint32Rm: + format: int32 + type: integer + minimum: 0 + maximum: 4294967295 #(2^32)-1 + nullable: true + description: > + Integer where the allowed values correspond to the value range of an unsigned + 32-bit integer with the OpenAPI 'nullable: true' property. + + Uint64: + type: integer + minimum: 0 + maximum: 18446744073709551615 #(2^64)-1 + description: > + Integer where the allowed values correspond to the value range of an + unsigned 64-bit integer. + + Uint64Rm: + type: integer + minimum: 0 + maximum: 18446744073709551615 #(2^64)-1 + nullable: true + description: > + Integer where the allowed values correspond to the value range of an unsigned + 16-bit integer with the OpenAPI 'nullable: true' property. + + Uri: + type: string + description: String providing an URI formatted according to RFC 3986. + + UriRm: + type: string + nullable: true + description: > + String providing an URI formatted according to RFC 3986 with the OpenAPI + 'nullable: true' property. + + VarUeId: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|gci-.+|gli-.+|.+)$' + description: String represents the SUPI or GPSI + + VarUeIdRm: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|gci-.+|gli-.+|.+)$' + nullable: true + description: "String represents the SUPI or GPSI with the OpenAPI 'nullable: true' property." + + TimeZone: + type: string + example: '-08:00+1' + description: | + String with format "time-numoffset" optionally appended by "daylightSavingTime", where + - "time-numoffset" shall represent the time zone adjusted for daylight saving time and be + encoded as time-numoffset as defined in clause 5.6 of IETF RFC 3339; + - "daylightSavingTime" shall represent the adjustment that has been made and shall be + encoded as "+1" or "+2" for a +1 or +2 hours adjustment. + + The example is for 8 hours behind UTC, +1 hour adjustment for Daylight Saving Time. + + TimeZoneRm: + type: string + nullable: true + description: | + "String with format 'time-numoffset' optionally appended by '', where + - 'time-numoffset' shall represent the time zone adjusted for daylight saving time and be + encoded as time-numoffset as defined in clause 5.6 of IETF RFC 3339; + - 'daylightSavingTime' shall represent the adjustment that has been made and shall be + encoded as '+1' or '+2' for a +1 or +2 hours adjustment. + + But with the OpenAPI 'nullable: true' property." + + StnSr: + type: string + description: String representing the STN-SR as defined in clause 18.6 of 3GPP TS 23.003. + + StnSrRm: + type: string + nullable: true + description: > + String representing the STN-SR as defined in clause 18.6 of 3GPP TS 23.003 + with the OpenAPI 'nullable: true' property. + + CMsisdn: + type: string + pattern: '^[0-9]{5,15}$' + description: String representing the C-MSISDN as defined in clause 18.7 of 3GPP TS 23.003. + + CMsisdnRm: + type: string + pattern: '^[0-9]{5,15}$' + nullable: true + description: > + String representing the C-MSISDN as defined in clause 18.7 of 3GPP TS 23.003 with + the OpenAPI 'nullable: true' property. + + DayOfWeek: + type: integer + minimum: 1 + maximum: 7 + description: > + integer between and including 1 and 7 denoting a weekday. 1 shall indicate Monday, + and the subsequent weekdays shall be indicated with the next higher numbers. + 7 shall indicate Sunday. + + TimeOfDay: + type: string + description: > + String with format partial-time or full-time as defined in clause 5.6 of IETF RFC 3339. + Examples, 20:15:00, 20:15:00-08:00 (for 8 hours behind UTC). + + EmptyObject: + description: Empty JSON object { }, it is defined with the keyword additionalProperties false + type: object + additionalProperties: false + + Fqdn: + description: Fully Qualified Domain Name + type: string + pattern: '^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$' + minLength: 4 + maxLength: 253 + + FqdnRm: + description: Fully Qualified Domain Name, but it also allows the null value + anyOf: + - $ref: '#/components/schemas/Fqdn' + - $ref: '#/components/schemas/NullValue' + +# +# COMMON ENUMERATED DATA TYPES +# + + PatchOperation: + anyOf: + - type: string + enum: + - add + - copy + - move + - remove + - replace + - test + - type: string + description: Operations as defined in IETF RFC 6902. + + UriScheme: + anyOf: + - type: string + enum: + - http + - https + - type: string + description: HTTP and HTTPS URI scheme. + + ChangeType: + anyOf: + - type: string + enum: + - ADD + - MOVE + - REMOVE + - REPLACE + - type: string + description: Indicates the type of change to be performed. + + HttpMethod: + anyOf: + - type: string + enum: + - GET + - POST + - PUT + - DELETE + - PATCH + - OPTIONS + - HEAD + - CONNECT + - TRACE + - type: string + description: HTTP methodes. + + NullValue: + enum: + - null + description: JSON's null value. + + + MatchingOperator: + anyOf: + - type: string + enum: + - FULL_MATCH + - MATCH_ALL + - STARTS_WITH + - NOT_START_WITH + - ENDS_WITH + - NOT_END_WITH + - CONTAINS + - NOT_CONTAIN + - type: string + description: the matching operation. + +# +# COMMON STRUCTURED DATA TYPES +# + + ProblemDetails: + description: Provides additional information in an error response. + type: object + properties: + type: + $ref: '#/components/schemas/Uri' + title: + type: string + status: + type: integer + detail: + type: string + description: A human-readable explanation specific to this occurrence of the problem. + instance: + $ref: '#/components/schemas/Uri' + + cause: + type: string + description: > + A machine-readable application error cause specific to this occurrence of the problem. + This IE should be present and provide application-related error information, if + available. + + invalidParams: + type: array + items: + $ref: '#/components/schemas/InvalidParam' + minItems: 1 + supportedFeatures: + $ref: '#/components/schemas/SupportedFeatures' + accessTokenError: + $ref: 'TS29510_Nnrf_AccessToken.yaml#/components/schemas/AccessTokenErr' + accessTokenRequest: + $ref: 'TS29510_Nnrf_AccessToken.yaml#/components/schemas/AccessTokenReq' + nrfId: + $ref: '#/components/schemas/Fqdn' + + Link: + type: object + properties: + href: + $ref: '#/components/schemas/Uri' + description: It contains the URI of the linked resource. + + LinkRm: + type: object + properties: + href: + $ref: '#/components/schemas/Uri' + nullable: true + description: > + It contains the URI of the linked resource with the OpenAPI 'nullable: true' property. + + PatchItem: + type: object + properties: + op: + $ref: '#/components/schemas/PatchOperation' + path: + type: string + description: > + contains a JSON pointer value (as defined in IETF RFC 6901) that references + a location of a resource on which the patch operation shall be performed. + from: + type: string + description: > + indicates the path of the source JSON element (according to JSON Pointer syntax) + being moved or copied to the location indicated by the "path" attribute. + value: {} + required: + - op + - path + description: it contains information on data to be changed. + + LinksValueSchema: + oneOf: + - type: array + items: + $ref: '#/components/schemas/Link' + minItems: 1 + - $ref: '#/components/schemas/Link' + description: A list of mutually exclusive alternatives of 1 or more links. + + SelfLink: + type: object + properties: + self: + $ref: '#/components/schemas/Link' + required: + - self + description: It contains the URI of the linked resource. + + InvalidParam: + type: object + properties: + param: + type: string + description: > + If the invalid parameter is an attribute in a JSON body, this IE shall contain the + attribute's name and shall be encoded as a JSON Pointer. If the invalid parameter is + an HTTP header, this IE shall be formatted as the concatenation of the string "header " + plus the name of such header. If the invalid parameter is a query parameter, this IE + shall be formatted as the concatenation of the string "query " plus the name of such + query parameter. If the invalid parameter is a variable part in the path of a resource + URI, this IE shall contain the name of the variable, including the symbols "{" and "}" + used in OpenAPI specification as the notation to represent variable path segments. + reason: + type: string + description: > + A human-readable reason, e.g. "must be a positive integer". In cases involving failed + operations in a PATCH request, the reason string should identify the operation that + failed using the operation's array index to assist in correlation of the invalid + parameter with the failed operation, e.g." Replacement value invalid for attribute + (failed operation index= 4)" + required: + - param + description: It contains an invalid parameter and a related description. + + ChangeItem: + type: object + properties: + op: + $ref: '#/components/schemas/ChangeType' + path: + type: string + description: > + contains a JSON pointer value (as defined in IETF RFC 6901) that references a target + location within the resource on which the change has been applied. + from: + type: string + description: > + indicates the path of the source JSON element (according to JSON Pointer syntax) + being moved or copied to the location indicated by the "path" attribute. It shall + be present if the "op" attribute is of value "MOVE". + origValue: {} + newValue: {} + required: + - op + - path + description: It contains data which need to be changed. + + NotifyItem: + type: object + required: + - resourceId + - changes + properties: + resourceId: + $ref: '#/components/schemas/Uri' + changes: + type: array + items: + $ref: '#/components/schemas/ChangeItem' + minItems: 1 + description: Indicates changes on a resource. + + ComplexQuery: + oneOf: + - $ref: '#/components/schemas/Cnf' + - $ref: '#/components/schemas/Dnf' + description: > + The ComplexQuery data type is either a conjunctive normal form or a disjunctive normal form. + The attribute names "cnfUnits" and "dnfUnits" (see clause 5.2.4.11 and clause 5.2.4.12) + serve as discriminator. + + Cnf: + type: object + required: + - cnfUnits + properties: + cnfUnits: + type: array + items: + $ref: '#/components/schemas/CnfUnit' + minItems: 1 + description: A conjunctive normal form + + Dnf: + type: object + required: + - dnfUnits + properties: + dnfUnits: + type: array + items: + $ref: '#/components/schemas/DnfUnit' + minItems: 1 + description: A disjunctive normal form. + + CnfUnit: + type: object + required: + - cnfUnit + properties: + cnfUnit: + type: array + items: + $ref: '#/components/schemas/Atom' + minItems: 1 + description: > + During the processing of cnfUnits attribute, all the members in the array shall be + interpreted as logically concatenated with logical "AND". + + DnfUnit: + type: object + required: + - dnfUnit + properties: + dnfUnit: + type: array + items: + $ref: '#/components/schemas/Atom' + minItems: 1 + description: > + During the processing of dnfUnits attribute, all the members in the array shall be + interpreted as logically concatenated with logical "OR". + + Atom: + description: contains a search parameter and its positive or negative content. + type: object + required: + - attr + - value + properties: + attr: + type: string + description: contains the name of a defined query parameter. + value: {} + negative: + type: boolean + description: indicates whether the negative condition applies for the query condition. + + PatchResult: + description: The execution report result on failed modification. + type: object + required: + - report + properties: + report: + type: array + items: + $ref: '#/components/schemas/ReportItem' + minItems: 1 + description: > + The execution report contains an array of report items. Each report item indicates one + failed modification. + + ReportItem: + type: object + required: + - path + properties: + path: + type: string + description: > + Contains a JSON pointer value (as defined in IETF RFC 6901) that references a + location of a resource to which the modification is subject. + reason: + type: string + description: > + A human-readable reason providing details on the reported modification failure. + The reason string should identify the operation that failed using the operation's + array index to assist in correlation of the invalid parameter with the failed + operation, e.g. "Replacement value invalid for attribute (failed operation index= 4)". + description: indicates performed modivications. + + HalTemplate: + description: > + Hypertext Application Language (HAL) template contains the extended 3GPP hypermedia format. + type: object + required: + - method + properties: + title: + type: string + description: A human-readable string that can be used to identify this template + method: + $ref: '#/components/schemas/HttpMethod' + contentType: + type: string + description: > + The media type that should be used for the corresponding request. If the attribute + is missing, or contains an unrecognized value, the client should act as if the + contentType is set to "application/json". + properties: + type: array + items: + $ref: '#/components/schemas/Property' + minItems: 1 + description: > + The properties that should be included in the body of the corresponding request. + If the contentType attribute is set to "application/json", then this attribute + describes the attributes of the JSON object of the body. + + Property: + description: > + If the contentType attribute is set to "application/json", then this attribute describes + the attributes of the JSON object of the body. + type: object + required: + - name + properties: + name: + type: string + description: The name of the property + required: + type: boolean + description: > + Indicates whether the property is required – true= required – + false(default)= not required. + regex: + type: string + description: A regular expression string to be applied to the value of the property. + value: + type: string + description: The property value. When present, it shall be a valid JSON string. + + RedirectResponse: + description: > + The response shall include a Location header field containing a different URI + (pointing to a different URI of an other service instance), or the same URI if a request + is redirected to the same target resource via a different SCP. + type: object + properties: + cause: + type: string + targetScp: + $ref: '#/components/schemas/Uri' + targetSepp: + $ref: '#/components/schemas/Uri' + + TunnelAddress: + description: Tunnel address + type: object + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + required: + - portNumber + anyOf: + - required: [ ipv4Addr ] + - required: [ ipv6Addr ] + + + FqdnPatternMatchingRule: + description: a matching rule for a FQDN pattern + type: object + oneOf: + - required: [ regex ] + - required: [ stringMatchingRule ] + properties: + regex: + type: string + stringMatchingRule: + $ref: '#/components/schemas/StringMatchingRule' + + + StringMatchingRule: + description: A list of conditions for string matching + type: object + properties: + stringMatchingConditions: + type: array + items: + $ref: '#/components/schemas/StringMatchingCondition' + minItems: 1 + + StringMatchingCondition: + description: A String with Matching Operator + type: object + properties: + matchingString: + type: string + matchingOperator: + $ref: '#/components/schemas/MatchingOperator' + required: + - matchingOperator + + + +# +# Data Types related to Subscription, Identification and Numbering as defined in clause 5.3 +# + +# +# SIMPLE DATA TYPES +# + Dnn: + type: string + description: > + String representing a Data Network as defined in clause 9A of 3GPP TS 23.003; + it shall contain either a DNN Network Identifier, or a full DNN with both the Network + Identifier and Operator Identifier, as specified in 3GPP TS 23.003 clause 9.1.1 and 9.1.2. + It shall be coded as string in which the labels are separated by dots + (e.g. "Label1.Label2.Label3"). + DnnRm: + type: string + nullable: true + description: > + String representing a Data Network as defined in clause 9A of 3GPP TS 23.003; + it shall contain either a DNN Network Identifier, or a full DNN with both the + Network Identifier and Operator Identifier, as specified in 3GPP TS 23.003 clause 9.1.1 + and 9.1.2. It shall be coded as string in which the labels are separated by dots + (e.g. 'Label1.Label2.Label3') with the OpenAPI 'nullable: true' property. + + WildcardDnn: + type: string + pattern: '^[*]$' + description: String representing the Wildcard DNN. It shall contain the string "*". + + WildcardDnnRm: + type: string + pattern: '^[*]$' + nullable: true + description: > + String representing the Wildcard DNN. It shall contain the string '*' but with the + OpenAPI 'nullable: true' property. + + Gpsi: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + description: > + String identifying a Gpsi shall contain either an External Id or an MSISDN. + It shall be formatted as follows -External Identifier= "extid-'extid', where 'extid' + shall be formatted according to clause 19.7.2 of 3GPP TS 23.003 that describes an + External Identifier. + + GpsiRm: + type: string + pattern: '^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$' + nullable: true + description: > + String identifying a Gpsi shall contain either an External Id or an MSISDN. It shall be + formatted as follows -External Identifier= 'extid-'extid', where 'extid' shall be formatted + according to clause 19.7.2 of 3GPP TS 23.003 that describes an External Identifier with the + OpenAPI 'nullable: true' property. + + GroupId: + type: string + pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' + description: > + String identifying a group of devices network internal globally unique ID which identifies + a set of IMSIs, as specified in clause 19.9 of 3GPP TS 23.003. + + GroupIdRm: + type: string + pattern: '^[A-Fa-f0-9]{8}-[0-9]{3}-[0-9]{2,3}-([A-Fa-f0-9][A-Fa-f0-9]){1,10}$' + nullable: true + description: > + String identifying a group of devices network internal globally unique ID which + identifies a set of IMSIs, as specified in clause 19.9 of 3GPP TS 23.003 with the + OpenAPI 'nullable: true' property. + + ExternalGroupId: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + description: > + String identifying External Group Identifier that identifies a group made up of one or + more subscriptions associated to a group of IMSIs, as specified in clause 19.7.3 of 3GPP + TS 23.003. + + ExternalGroupIdRm: + type: string + pattern: '^extgroupid-[^@]+@[^@]+$' + nullable: true + description: > + String identifying External Group Identifier that identifies a group made up of one or + more subscriptions associated to a group of IMSIs, as specified in clause 19.7.3 of + 3GPP TS 23.003 with the OpenAPI 'nullable: true' property. + + Pei: + type: string + pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|mac((-[0-9a-fA-F]{2}){6})(-untrusted)?|eui((-[0-9a-fA-F]{2}){8})|.+)$' + description: > + String representing a Permanent Equipment Identifier that may contain - an IMEI or IMEISV, + as specified in clause 6.2 of 3GPP TS 23.003; a MAC address for a 5G-RG or FN-RG via + wireline access, with an indication that this address cannot be trusted for regulatory + purpose if this address cannot be used as an Equipment Identifier of the FN-RG, as + specified in clause 4.7.7 of 3GPP TS23.316. Examples are imei-012345678901234 or + imeisv-0123456789012345. + + PeiRm: + type: string + pattern: '^(imei-[0-9]{15}|imeisv-[0-9]{16}|mac((-[0-9a-fA-F]{2}){6})(-untrusted)?|eui((-[0-9a-fA-F]{2}){8})|.+)$' + nullable: true + description: > + This data type is defined in the same way as the 'Pei' data type but with the OpenAPI 'nullable: true' property. + + Supi: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gci-.+|gli-.+|.+)$' + description: | + String identifying a Supi that shall contain either an IMSI, a network specific identifier, + a Global Cable Identifier (GCI) or a Global Line Identifier (GLI) as specified in clause + 2.2A of 3GPP TS 23.003. It shall be formatted as follows + - for an IMSI "imsi-", where shall be formatted according to clause 2.2 + of 3GPP TS 23.003 that describes an IMSI. + - for a network specific identifier "nai-, where shall be formatted + according to clause 28.7.2 of 3GPP TS 23.003 that describes an NAI. + - for a GCI "gci-", where shall be formatted according to clause 28.15.2 + of 3GPP TS 23.003. + - for a GLI "gli-", where shall be formatted according to clause 28.16.2 of + 3GPP TS 23.003.To enable that the value is used as part of an URI, the string shall + only contain characters allowed according to the "lower-with-hyphen" naming convention + defined in 3GPP TS 29.501. + + SupiRm: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gci-.+|gli-.+|.+)$' + nullable: true + description: > + This data type is defined in the same way as the 'Supi' data type, but with the + OpenAPI 'nullable: true' property. + + NfInstanceId: + type: string + format: uuid + description: > + String uniquely identifying a NF instance. The format of the NF Instance ID shall be a + Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122. + + AmfId: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: > + String identifying the AMF ID composed of AMF Region ID (8 bits), AMF Set ID (10 bits) + and AMF Pointer (6 bits) as specified in clause 2.10.1 of 3GPP TS 23.003. It is encoded + as a string of 6 hexadecimal characters (i.e., 24 bits). + + AmfRegionId: + type: string + pattern: '^[A-Fa-f0-9]{2}$' + description: > + String identifying the AMF Set ID (10 bits) as specified in clause 2.10.1 of 3GPP TS 23.003. + It is encoded as a string of 3 hexadecimal characters where the first character is limited + to values 0 to 3 (i.e. 10 bits) + + AmfSetId: + type: string + pattern: '^[0-3][A-Fa-f0-9]{2}$' + description: > + String identifying the AMF Set ID (10 bits) as specified in clause 2.10.1 of 3GPP TS 23.003. + It is encoded as a string of 3 hexadecimal characters where the first character is limited + to values 0 to 3 (i.e. 10 bits). + + RfspIndex: + type: integer + minimum: 1 + maximum: 256 + description: > + Unsigned integer representing the "Subscriber Profile ID for RAT/Frequency Priority" + as specified in 3GPP TS 36.413. + + RfspIndexRm: + type: integer + minimum: 1 + maximum: 256 + nullable: true + description: > + Unsigned integer representing the 'Subscriber Profile ID for RAT/Frequency Priority' + as specified in 3GPP TS 36.413 with the OpenAPI 'nullable: true' property. + + NfGroupId: + type: string + description: Identifier of a group of NFs. + + MtcProviderInformation: + type: string + description: String uniquely identifying MTC provider information. + + CagId: + type: string + pattern: '^[A-Fa-f0-9]{8}$' + description: String containing a Closed Access Group Identifier. + + SupiOrSuci: + type: string + pattern: '^(imsi-[0-9]{5,15}|nai-.+|gli-.+|gci-.+|suci-(0-[0-9]{3}-[0-9]{2,3}|[1-7]-.+)-[0-9]{1,4}-(0-0-.*|[a-fA-F1-9]-([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])-[a-fA-F0-9]+)|.+)$' + description: String identifying a SUPI or a SUCI. + +# +# STRUCTURED DATA TYPES +# + Guami: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnIdNid' + amfId: + $ref: '#/components/schemas/AmfId' + required: + - plmnId + - amfId + description: Globally Unique AMF Identifier constructed out of PLMN, Network and AMF identity. + + GuamiRm: + anyOf: + - $ref: '#/components/schemas/Guami' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Guami' data type, but with the OpenAPI + 'nullable: true' property. + + NetworkId: + type: object + properties: + mnc: + $ref: '#/components/schemas/Mnc' + mcc: + $ref: '#/components/schemas/Mcc' + description: contains PLMN and Network identity. + + +# +# Data Types related to 5G Network as defined in clause 5.4 +# + +# +# SIMPLE DATA TYPES +# + ApplicationId: + type: string + description: String providing an application identifier. + ApplicationIdRm: + type: string + nullable: true + description: > + String providing an application identifier with the OpenAPI 'nullable: true' property. + + PduSessionId: + type: integer + minimum: 0 + maximum: 255 + description: > + Unsigned integer identifying a PDU session, within the range 0 to 255, as specified in + clause 11.2.3.1b, bits 1 to 8, of 3GPP TS 24.007. If the PDU Session ID is allocated by the + Core Network for UEs not supporting N1 mode, reserved range 64 to 95 is used. PDU Session ID + within the reserved range is only visible in the Core Network. + + Mcc: + type: string + pattern: '^\d{3}$' + description: > + Mobile Country Code part of the PLMN, comprising 3 digits, as defined in clause 9.3.3.5 + of 3GPP TS 38.413. + + MccRm: + type: string + pattern: '^\d{3}$' + nullable: true + description: > + Mobile Country Code part of the PLMN, comprising 3 digits, as defined in clause 9.3.3.5 of + 3GPP TS 38.413 with the OpenAPI 'nullable: true' property. + + Mnc: + type: string + pattern: '^\d{2,3}$' + description: Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in clause 9.3.3.5 of 3GPP TS 38.413. + + MncRm: + type: string + pattern: '^\d{2,3}$' + nullable: true + description: > + Mobile Network Code part of the PLMN, comprising 2 or 3 digits, as defined in clause + 9.3.3.5 of 3GPP TS 38.413 with the OpenAPI 'nullable: true' property. + + Tac: + type: string + pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' + description: > + 2 or 3-octet string identifying a tracking area code as specified in clause 9.3.3.10 + of 3GPP TS 38.413, in hexadecimal representation. Each character in the string shall + take a value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The + most significant character representing the 4 most significant bits of the TAC shall + appear first in the string, and the character representing the 4 least significant bit + of the TAC shall appear last in the string. + + TacRm: + type: string + pattern: '(^[A-Fa-f0-9]{4}$)|(^[A-Fa-f0-9]{6}$)' + nullable: true + description: > + This data type is defined in the same way as the 'Tac' data type, but with the + OpenAPI 'nullable: true' property. + + EutraCellId: + type: string + pattern: '^[A-Fa-f0-9]{7}$' + description: > + 28-bit string identifying an E-UTRA Cell Id as specified in clause 9.3.1.9 of + 3GPP TS 38.413, in hexadecimal representation. Each character in the string shall take a + value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most + significant character representing the 4 most significant bits of the Cell Id shall appear + first in the string, and the character representing the 4 least significant bit of the + Cell Id shall appear last in the string. + + EutraCellIdRm: + type: string + pattern: '^[A-Fa-f0-9]{7}$' + nullable: true + description: > + This data type is defined in the same way as the 'EutraCellId' data type, but with + the OpenAPI 'nullable: true' property. + + NrCellId: + type: string + pattern: '^[A-Fa-f0-9]{9}$' + description: > + 36-bit string identifying an NR Cell Id as specified in clause 9.3.1.7 of 3GPP TS 38.413, + in hexadecimal representation. Each character in the string shall take a value of "0" to + "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant character + representing the 4 most significant bits of the Cell Id shall appear first in the string, + and the character representing the 4 least significant bit of the Cell Id shall appear last + in the string. + + NrCellIdRm: + type: string + pattern: '^[A-Fa-f0-9]{9}$' + nullable: true + description: > + This data type is defined in the same way as the 'NrCellId' data type, but with the + OpenAPI 'nullable: true' property. + Dnai: + type: string + description: DNAI (Data network access identifier), see clause 5.6.7 of 3GPP TS 23.501. + + DnaiRm: + type: string + nullable: true + description: > + This data type is defined in the same way as the 'Dnai' data type, but with the + OpenAPI 'nullable: true' property. + + 5GMmCause: + $ref: '#/components/schemas/Uinteger' + + AmfName: + $ref: '#/components/schemas/Fqdn' + + AreaCode: + type: string + description: Values are operator specific. + + AreaCodeRm: + type: string + nullable: true + description: > + This data type is defined in the same way as the 'AreaCode' data type, but with the + OpenAPI 'nullable: true' property. + + N3IwfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + This represents the identifier of the N3IWF ID as specified in clause 9.3.1.57 of + 3GPP TS 38.413 in hexadecimal representation. Each character in the string shall take a value + of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant + character representing the 4 most significant bits of the N3IWF ID shall appear first in the + string, and the character representing the 4 least significant bit of the N3IWF ID shall + appear last in the string. + + WAgfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + This represents the identifier of the W-AGF ID as specified in clause 9.3.1.162 of + 3GPP TS 38.413 in hexadecimal representation. Each character in the string shall take a + value of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most + significant character representing the 4 most significant bits of the W-AGF ID shall + appear first in the string, and the character representing the 4 least significant bit + of the W-AGF ID shall appear last in the string. + + TngfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + This represents the identifier of the TNGF ID as specified in clause 9.3.1.161 of + 3GPP TS 38.413 in hexadecimal representation. Each character in the string shall take a value + of "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant + character representing the 4 most significant bits of the TNGF ID shall appear first in + the string, and the character representing the 4 least significant bit of the TNGF ID + shall appear last in the string. + + NgeNbId: + type: string + pattern: '^(MacroNGeNB-[A-Fa-f0-9]{5}|LMacroNGeNB-[A-Fa-f0-9]{6}|SMacroNGeNB-[A-Fa-f0-9]{5})$' + description: > + This represents the identifier of the ng-eNB ID as specified in clause 9.3.1.8 of + 3GPP TS 38.413. The value of the ng-eNB ID shall be encoded in hexadecimal representation. + Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" and + shall represent 4 bits. The padding 0 shall be added to make multiple nibbles, so the most + significant character representing the padding 0 if required together with the 4 most + significant bits of the ng-eNB ID shall appear first in the string, and the character + representing the 4 least significant bit of the ng-eNB ID (to form a nibble) shall appear + last in the string. + + example: SMacroNGeNB-34B89 + Nid: + type: string + pattern: '^[A-Fa-f0-9]{11}$' + description: > + This represents the Network Identifier, which together with a PLMN ID is used to identify + an SNPN (see 3GPP TS 23.003 and 3GPP TS 23.501 clause 5.30.2.1). + + NidRm: + type: string + pattern: '^[A-Fa-f0-9]{11}$' + nullable: true + description: > + This data type is defined in the same way as the 'Nid' data type, but with the OpenAPI + 'nullable: true' property." + + NfSetId: + type: string + description: > + NF Set Identifier (see clause 28.12 of 3GPP TS 23.003), formatted as the following string + "set.set.5gc.mnc.mcc", or + "set.set.5gc.nid.mnc.mcc" with + encoded as defined in clause 5.4.2 ("Mcc" data type definition) + encoding the Mobile Network Code part of the PLMN, comprising 3 digits. + If there are only 2 significant digits in the MNC, one "0" digit shall be inserted + at the left side to fill the 3 digits coding of MNC. Pattern: '^[0-9]{3}$' + encoded as a value defined in Table 6.1.6.3.3-1 of 3GPP TS 29.510 but + with lower case characters encoded as a string of characters consisting of + alphabetic characters (A-Z and a-z), digits (0-9) and/or the hyphen (-) and that + shall end with either an alphabetic character or a digit. + + NfServiceSetId: + type: string + description: > + NF Service Set Identifier (see clause 28.12 of 3GPP TS 23.003) formatted as the following + string "set.sn.nfi.5gc.mnc.mcc", or + "set.sn.nfi.5gc.nid.mnc.mcc" with + encoded as defined in clause 5.4.2 ("Mcc" data type definition) + encoding the Mobile Network Code part of the PLMN, comprising 3 digits. + If there are only 2 significant digits in the MNC, one "0" digit shall be inserted + at the left side to fill the 3 digits coding of MNC. Pattern: '^[0-9]{3}$' + encoded as defined in clause 5.4.2 ("Nid" data type definition) + encoded as defined in clause 5.3.2 + encoded as defined in 3GPP TS 29.510 + encoded as a string of characters consisting of alphabetic + characters (A-Z and a-z), digits (0-9) and/or the hyphen (-) and that shall end + with either an alphabetic character or a digit. + + PlmnAssiUeRadioCapId: + $ref: '#/components/schemas/Bytes' + + ManAssiUeRadioCapId: + $ref: '#/components/schemas/Bytes' + + TypeAllocationCode: + type: string + pattern: '^[0-9]{8}$' + description: > + Type Allocation Code (TAC) of the UE, comprising the initial eight-digit portion of the + 15-digit IMEI and 16-digit IMEISV codes. See clause 6.2 of 3GPP TS 23.003. + + HfcNId: + type: string + maxLength: 6 + description: > + This IE represents the identifier of the HFC node Id as specified in CableLabs + WR-TR-5WWC-ARCH. It is provisioned by the wireline operator as part of wireline + operations and may contain up to six characters. + + HfcNIdRm: + type: string + maxLength: 6 + nullable: true + description: > + This data type is defined in the same way as the 'HfcNId' data type, but with the + OpenAPI 'nullable: true' property. + + ENbId: + type: string + pattern: '^(MacroeNB-[A-Fa-f0-9]{5}|LMacroeNB-[A-Fa-f0-9]{6}|SMacroeNB-[A-Fa-f0-9]{5}|HomeeNB-[A-Fa-f0-9]{7})$' + description: > + This represents the identifier of the eNB ID as specified in clause 9.2.1.37 of + 3GPP TS 36.413. The string shall be formatted with the following pattern + '^('MacroeNB-[A-Fa-f0-9]{5}|LMacroeNB-[A-Fa-f0-9]{6}|SMacroeNB-[A-Fa-f0-9]{5} + |HomeeNB-[A-Fa-f0-9]{7})$'. The value of the eNB ID shall be encoded in hexadecimal + representation. Each character in the string shall take a value of "0" to "9", "a" to "f" + or "A" to "F" and shall represent 4 bits. The padding 0 shall be added to make multiple + nibbles, so the most significant character representing the padding 0 if required together + with the 4 most significant bits of the eNB ID shall appear first in the string, and the + character representing the 4 least significant bit of the eNB ID (to form a nibble) shall + appear last in the string. + + Gli: + $ref: '#/components/schemas/Bytes' + Gci: + type: string + description: > + Global Cable Identifier uniquely identifying the connection between the 5G-CRG or FN-CRG + to the 5GS. See clause 28.15.4 of 3GPP TS 23.003. This shall be encoded as a string per + clause 28.15.4 of 3GPP TS 23.003, and compliant with the syntax specified in clause 2.2 + of IETF RFC 7542 for the username part of a NAI. The GCI value is specified in + CableLabs WR-TR-5WWC-ARCH. + + NsSrg: + type: string + description: > + String providing a Network Slice Simultaneous Registration Group. See clause 5.15.12 of + 3GPP TS 23.501 + + NsSrgRm: + type: string + nullable: true + description: > + String providing a Network Slice Simultaneous Registration Group with the OpenAPI + "nullable: true" property. See clause 5.15.12 of 3GPP TS 23.501 + + + RelayServiceCode: + type: integer + minimum: 0 + maximum: 16777215 + description: > + Relay Service Code to identify a connectivity service provided by the UE-to-Network relay. + + 5GPrukId: + type: string + description: > + A string carrying the CP-PRUK ID of the remote UE. The CP-PRUK ID is a string in NAI + format as specified in clause 28.7.11 of 3GPP TS 23.003. + pattern: '^rid[0-9]{1,4}\.pid[0-9a-fA-F]+\@prose-cp\.5gc\.mnc[0-9]{2,3}\.mcc[0-9]{3}\.3gppnetwork\.org$' + + NsagId: + type: integer + description: > + The Network Slice AS Group ID, see 3GPP TS 38.413 + + NsagIdRm: + type: integer + nullable: true + description: > + This data type is defined in the same way as the "NsagId" data type, but with the OpenAPI "nullable: true" property + + +# +# ENUMERATED DATA TYPES +# + + AccessType: + type: string + enum: + - 3GPP_ACCESS + - NON_3GPP_ACCESS + description: Indicates whether the access is via 3GPP or via non-3GPP. + + AccessTypeRm: + anyOf: + - $ref: '#/components/schemas/AccessType' + - $ref: '#/components/schemas/NullValue' + description: > + Indicates wether the access is via 3GPP or via non-3GPP but with the OpenAPI + 'nullable: true' property." + + RatType: + anyOf: + - type: string + enum: + - NR + - EUTRA + - WLAN + - VIRTUAL + - NBIOT + - WIRELINE + - WIRELINE_CABLE + - WIRELINE_BBF + - LTE-M + - NR_U + - EUTRA_U + - TRUSTED_N3GA + - TRUSTED_WLAN + - UTRA + - GERA + - NR_LEO + - NR_MEO + - NR_GEO + - NR_OTHER_SAT + - NR_REDCAP + - type: string + description: Indicates the radio access used. + + RatTypeRm: + anyOf: + - $ref: '#/components/schemas/RatType' + - $ref: '#/components/schemas/NullValue' + description: > + Provides information about the radio access but with the OpenAPI 'nullable: true' property. + + PduSessionType: + anyOf: + - type: string + enum: + - IPV4 + - IPV6 + - IPV4V6 + - UNSTRUCTURED + - ETHERNET + - type: string + description: > + PduSessionType indicates the type of a PDU session. It shall comply with the provisions + defined in table 5.4.3.3-1. + + PduSessionTypeRm: + anyOf: + - $ref: '#/components/schemas/PduSessionType' + - $ref: '#/components/schemas/NullValue' + description: > + PduSessionType indicates the type of a PDU session. It shall comply with the provisions + defined in table 5.4.3.3-1 but with the OpenAPI "nullable: true" property. + + UpIntegrity: + anyOf: + - type: string + enum: + - REQUIRED + - PREFERRED + - NOT_NEEDED + - type: string + description: > + indicates whether UP integrity protection is required, preferred or not needed for all + the traffic on the PDU Session. It shall comply with the provisions defined in + table 5.4.3.4-1. + + UpIntegrityRm: + anyOf: + - $ref: '#/components/schemas/UpIntegrity' + - $ref: '#/components/schemas/NullValue' + description: > + indicates whether UP integrity protection is required, preferred or not needed for all + the traffic on the PDU Session. It shall comply with the provisions defined in + table 5.4.3.4-1. + + UpConfidentiality: + anyOf: + - type: string + enum: + - REQUIRED + - PREFERRED + - NOT_NEEDED + - type: string + description: > + indicates whether UP confidentiality protection is required, preferred or not needed for + all the traffic on the PDU Session. It shall comply with the provisions defined in + table 5.4.3.5-1. + + UpConfidentialityRm: + anyOf: + - $ref: '#/components/schemas/UpConfidentiality' + - $ref: '#/components/schemas/NullValue' + description: > + indicates whether UP integrity protection is required, preferred or not needed for all the + traffic on the PDU Session. It shall comply with the provisions defined in table 5.4.3.4-1, + but with the OpenAPI 'nullable: true' property. + + SscMode: + anyOf: + - type: string + enum: + - SSC_MODE_1 + - SSC_MODE_2 + - SSC_MODE_3 + - type: string + description: > + represents the service and session continuity mode It shall comply with the provisions defined in table 5.4.3.6-1. + + SscModeRm: + anyOf: + - $ref: '#/components/schemas/SscMode' + - $ref: '#/components/schemas/NullValue' + description: > + represents the service and session continuity mode It shall comply with the provisions + defined in table 5.4.3.6-1 but with the OpenAPI 'nullable: true' property. + + DnaiChangeType: + anyOf: + - type: string + enum: + - EARLY + - EARLY_LATE + - LATE + - type: string + description: > + This string provides forward-compatibility with future extensions to the enumeration + but is not used to encode content defined in the present version of this API. + + description: | + Possible values are: + - EARLY: Early notification of UP path reconfiguration. + - EARLY_LATE: Early and late notification of UP path reconfiguration. This value shall + only be present in the subscription to the DNAI change event. + - LATE: Late notification of UP path reconfiguration. + + DnaiChangeTypeRm: + anyOf: + - $ref: '#/components/schemas/DnaiChangeType' + - $ref: '#/components/schemas/NullValue' + description: > + It can take the values as specified for DnaiChangeType but with the OpenAPI + 'nullable: true' property. + + RestrictionType: + anyOf: + - type: string + enum: + - ALLOWED_AREAS + - NOT_ALLOWED_AREAS + - type: string + description: It contains the restriction type ALLOWED_AREAS or NOT_ALLOWED_AREAS. + + RestrictionTypeRm: + anyOf: + - $ref: '#/components/schemas/RestrictionType' + - $ref: '#/components/schemas/NullValue' + description: > + It contains the restriction type ALLOWED_AREAS or NOT_ALLOWED_AREAS but with the + OpenAPI 'nullable: true' property. + + CoreNetworkType: + anyOf: + - type: string + enum: + - 5GC + - EPC + - type: string + description: It contains the Core Network type 5GC or EPC. + + CoreNetworkTypeRm: + anyOf: + - $ref: '#/components/schemas/CoreNetworkType' + - $ref: '#/components/schemas/NullValue' + description: > + It contains the Core Network type 5GC or EPC but with the OpenAPI + 'nullable: true' property. + + PresenceState: + anyOf: + - type: string + enum: + - IN_AREA + - OUT_OF_AREA + - UNKNOWN + - INACTIVE + - type: string + description: | + Possible values are: + -IN_AREA: Indicates that the UE is inside or enters the presence reporting area. + -OUT_OF_AREA: Indicates that the UE is outside or leaves the presence reporting area + -UNKNOW: Indicates it is unknown whether the UE is in the presence reporting area or not + -INACTIVE: Indicates that the presence reporting area is inactive in the serving node. + + StationaryIndication: + anyOf: + - type: string + enum: + - STATIONARY + - MOBILE + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - STATIONARY: Identifies the UE is stationary + - MOBILE: Identifies the UE is mobile + + StationaryIndicationRm: + anyOf: + - $ref: '#/components/schemas/StationaryIndication' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'StationaryIndication' enumeration, + but with the OpenAPI 'nullable: true' property." + + ScheduledCommunicationType: + anyOf: + - type: string + enum: + - DOWNLINK_ONLY + - UPLINK_ONLY + - BIDIRECTIONAL + - type: string + description: | + Possible values are: + -DOWNLINK_ONLY: Downlink only + -UPLINK_ONLY: Uplink only + -BIDIRECTIONA: Bi-directional + + ScheduledCommunicationTypeRm: + anyOf: + - $ref: '#/components/schemas/ScheduledCommunicationType' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'ScheduledCommunicationTypen' + enumeration, but with the OpenAPI 'nullable: true' property." + + TrafficProfile: + anyOf: + - type: string + enum: + - SINGLE_TRANS_UL + - SINGLE_TRANS_DL + - DUAL_TRANS_UL_FIRST + - DUAL_TRANS_DL_FIRST + - MULTI_TRANS + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + + description: | + Possible values are: + - SINGLE_TRANS_UL: Uplink single packet transmission. + - SINGLE_TRANS_DL: Downlink single packet transmission. + - DUAL_TRANS_UL_FIRST: Dual packet transmission, firstly uplink packet transmission + with subsequent downlink packet transmission. + - DUAL_TRANS_DL_FIRST: Dual packet transmission, firstly downlink packet transmission + with subsequent uplink packet transmission. + + TrafficProfileRm: + anyOf: + - $ref: '#/components/schemas/TrafficProfile' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'TrafficProfile' enumeration, but + with the OpenAPI 'nullable: true' property. + + LcsServiceAuth: + anyOf: + - type: string + enum: + - "LOCATION_ALLOWED_WITH_NOTIFICATION" + - "LOCATION_ALLOWED_WITHOUT_NOTIFICATION" + - "LOCATION_ALLOWED_WITHOUT_RESPONSE" + - "LOCATION_RESTRICTED_WITHOUT_RESPONSE" + - "NOTIFICATION_ONLY" + - "NOTIFICATION_AND_VERIFICATION_ONLY" + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - "LOCATION_ALLOWED_WITH_NOTIFICATION": Location allowed with notification + - "LOCATION_ALLOWED_WITHOUT_NOTIFICATION": Location allowed without notification + - "LOCATION_ALLOWED_WITHOUT_RESPONSE": Location with notification and privacy + verification; location allowed if no response + - "LOCATION_RESTRICTED_WITHOUT_RESPONSE": Location with notification and privacy + verification; location restricted if no response + - "NOTIFICATION_ONLY": Notification only + - "NOTIFICATION_AND_VERIFICATION_ONLY": Notification and privacy verification only + UeAuth: + anyOf: + - type: string + enum: + - AUTHORIZED + - NOT_AUTHORIZED + - type: string + description: | + Possible values are: + - AUTHORIZED: Indicates that the UE is authorized. + - NOT_AUTHORIZED: Indicates that the UE is not authorized. + + DlDataDeliveryStatus: + anyOf: + - type: string + enum: + - BUFFERED + - TRANSMITTED + - DISCARDED + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - BUFFERED: The first downlink data is buffered with extended buffering matching the + source of the downlink traffic. + - TRANSMITTED: The first downlink data matching the source of the downlink traffic is + transmitted after previous buffering or discarding of corresponding packet(s) because + the UE of the PDU Session becomes ACTIVE, and buffered data can be delivered to UE. + - DISCARDED: The first downlink data matching the source of the downlink traffic is + discarded because the Extended Buffering time, as determined by the SMF, expires or + the amount of downlink data to be buffered is exceeded. + + DlDataDeliveryStatusRm: + anyOf: + - $ref: '#/components/schemas/DlDataDeliveryStatus' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the ' DlDataDeliveryStatus ' data type, + but with the OpenAPI 'nullable: true' property. + + AuthStatus: + anyOf: + - type: string + enum: + - EAP_SUCCESS + - EAP_FAILURE + - PENDING + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + + description: | + Possible values are: + - "EAP_SUCCESS": The NSSAA status is EAP-Success. + - "EAP_FAILURE": The NSSAA status is EAP-Failure. + - "PENDING": The NSSAA status is Pending. + + LineType: + anyOf: + - type: string + enum: + - DSL + - PON + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + + description: | + Possible values are: + - DSL: Identifies a DSL line + - PON: Identifies a PON line + + LineTypeRm: + anyOf: + - $ref: '#/components/schemas/LineType' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'LineType' data type, but with the + OpenAPI 'nullable: true' property. + + + NotificationFlag: + anyOf: + - type: string + enum: + - ACTIVATE + - DEACTIVATE + - RETRIEVAL + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + + description: | + Possible values are: + - ACTIVATE: The event notification is activated. + - DEACTIVATE: The event notification is deactivated and shall be muted. The available + event(s) shall be stored. + - RETRIEVAL: The event notification shall be sent to the NF service consumer(s), + after that, is muted again. + + + TransportProtocol: + anyOf: + - type: string + enum: + - UDP + - TCP + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + + description: | + Possible values are: + - UDP: User Datagram Protocol. + - TCP: Transmission Control Protocol. + + + SatelliteBackhaulCategory: + anyOf: + - type: string + enum: + - GEO + - MEO + - LEO + - OTHER_SAT + - NON_SATELLITE + - type: string + description: Indicates the satellite backhaul used. + + SatelliteBackhaulCategoryRm: + anyOf: + - $ref: '#/components/schemas/SatelliteBackhaulCategory' + - $ref: '#/components/schemas/NullValue' + description: > + Provides information about the satellite backhaul but with the OpenAPI + 'nullable: true' property. + + + +# +# STRUCTURED DATA TYPES +# + SubscribedDefaultQos: + type: object + required: + - 5qi + - arp + properties: + 5qi: + $ref: '#/components/schemas/5Qi' + arp: + $ref: '#/components/schemas/Arp' + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + description: Provides the subsribed 5QI and the ARP, it may contain the priority level. + + Snssai: + type: object + properties: + sst: + type: integer + minimum: 0 + maximum: 255 + description: > + Unsigned integer, within the range 0 to 255, representing the Slice/Service Type. + It indicates the expected Network Slice behaviour in terms of features and services. + Values 0 to 127 correspond to the standardized SST range. Values 128 to 255 correspond + to the Operator-specific range. See clause 28.4.2 of 3GPP TS 23.003. + Standardized values are defined in clause 5.15.2.2 of 3GPP TS 23.501. + + sd: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: > + 3-octet string, representing the Slice Differentiator, in hexadecimal representation. + Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" + and shall represent 4 bits. The most significant character representing the 4 most + significant bits of the SD shall appear first in the string, and the character + representing the 4 least significant bit of the SD shall appear last in the string. + This is an optional parameter that complements the Slice/Service type(s) to allow to + differentiate amongst multiple Network Slices of the same Slice/Service type. This IE + shall be absent if no SD value is associated with the SST. + description: > + When Snssai needs to be converted to string (e.g. when used in maps as key), the string shall + be composed of one to three digits "sst" optionally followed by "-" and 6 hexadecimal digits + "sd". + + required: + - sst + + PlmnId: + type: object + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + description: > + When PlmnId needs to be converted to string (e.g. when used in maps as key), the string + shall be composed of three digits "mcc" followed by "-" and two or three digits "mnc". + + required: + - mcc + - mnc + PlmnIdRm: + anyOf: + - $ref: '#/components/schemas/PlmnId' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'PlmnId' data type, but with the + OpenAPI 'nullable: true' property. + + Tai: + description: Contains the tracking area identity as described in 3GPP 23.003 + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + tac: + $ref: '#/components/schemas/Tac' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - tac + + TaiRm: + anyOf: + - $ref: '#/components/schemas/Tai' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Tai' data type, but with the OpenAPI + 'nullable: true' property. + + Ecgi: + description: Contains the ECGI (E-UTRAN Cell Global Identity), as described in 3GPP 23.003 + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + eutraCellId: + $ref: '#/components/schemas/EutraCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - eutraCellId + + EcgiRm: + anyOf: + - $ref: '#/components/schemas/Ecgi' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Ecgi' data type, but with the + OpenAPI 'nullable: true' property. + + Ncgi: + description: Contains the NCGI (NR Cell Global Identity), as described in 3GPP 23.003 + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + nrCellId: + $ref: '#/components/schemas/NrCellId' + nid: + $ref: '#/components/schemas/Nid' + required: + - plmnId + - nrCellId + + NcgiRm: + anyOf: + - $ref: '#/components/schemas/Ncgi' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Ncgi' data type, but with the + OpenAPI 'nullable: true' property. + + UserLocation: + type: object + properties: + eutraLocation: + $ref: '#/components/schemas/EutraLocation' + nrLocation: + $ref: '#/components/schemas/NrLocation' + n3gaLocation: + $ref: '#/components/schemas/N3gaLocation' + utraLocation: + $ref: '#/components/schemas/UtraLocation' + geraLocation: + $ref: '#/components/schemas/GeraLocation' + description: > + At least one of eutraLocation, nrLocation and n3gaLocation shall be present. Several + of them may be present. + + EutraLocation: + description: Contains the E-UTRA user location. + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ignoreTai: + type: boolean + default: false + ecgi: + $ref: '#/components/schemas/Ecgi' + ignoreEcgi: + type: boolean + default: false + description: > + This flag when present shall indicate that the Ecgi shall be ignored + When present, it shall be set as follows: + - true: ecgi shall be ignored. + - false (default): ecgi shall not be ignored. + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + description: > + The value represents the elapsed time in minutes since the last network contact of the + mobile station. Value "0" indicates that the location information was obtained after a + successful paging procedure for Active Location Retrieval when the UE is in idle mode + or after a successful NG-RAN location reporting procedure with the eNB when the UE is + in connected mode. Any other value than "0" indicates that the location information is + the last known one. See 3GPP TS 29.002 clause 17.7.8. + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + description: > + Refer to geographical Information. See 3GPP TS 23.032 clause 7.3.2. Only the + description of an ellipsoid point with uncertainty circle is allowed to be used. + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + description: > + Refers to Calling Geodetic Location. See ITU-T Recommendation Q.763 (1999) [24] + clause 3.88.2. Only the description of an ellipsoid point with uncertainty circle + is allowed to be used. + globalNgenbId: + $ref: '#/components/schemas/GlobalRanNodeId' + + globalENbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ecgi + + EutraLocationRm: + anyOf: + - $ref: '#/components/schemas/EutraLocation' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'EutraLocation' data type, but with + the OpenAPI 'nullable: true' property. + + NrLocation: + description: Contains the NR user location. + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + ncgi: + $ref: '#/components/schemas/Ncgi' + ignoreNcgi: + type: boolean + default: false + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + description: > + The value represents the elapsed time in minutes since the last network contact of the mobile + station. Value "0" indicates that the location information was obtained after a + successful paging procedure for Active Location Retrieval when the UE is in idle mode + or after a successful NG-RAN location reporting procedure with the eNB when the UE is + in connected mode. Any other value than "0" indicates that the location information is + the last known one. See 3GPP TS 29.002 clause 17.7.8. + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + description: > + Refer to geographical Information. See 3GPP TS 23.032 clause 7.3.2. Only the description + of an ellipsoid point with uncertainty circle is allowed to be used. + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + description: > + Refers to Calling Geodetic Location. See ITU-T Recommendation Q.763 (1999) [24] clause + 3.88.2. Only the description of an ellipsoid point with uncertainty circle is allowed + to be used. + globalGnbId: + $ref: '#/components/schemas/GlobalRanNodeId' + required: + - tai + - ncgi + + NrLocationRm: + anyOf: + - $ref: '#/components/schemas/NrLocation' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'NrLocation' data type, but with the + OpenAPI 'nullable: true' property." + + N3gaLocation: + description: Contains the Non-3GPP access user location. + type: object + properties: + n3gppTai: + $ref: '#/components/schemas/Tai' + n3IwfId: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + This IE shall contain the N3IWF identifier received over NGAP and shall be encoded as a + string of hexadecimal characters. Each character in the string shall take a value of "0" + to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The most significant + character representing the 4 most significant bits of the N3IWF ID shall appear first in + the string, and the character representing the 4 least significant bit of the N3IWF ID + shall appear last in the string. + + ueIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ueIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + protocol: + $ref: '#/components/schemas/TransportProtocol' + tnapId: + $ref: '#/components/schemas/TnapId' + twapId: + $ref: '#/components/schemas/TwapId' + hfcNodeId: + $ref: '#/components/schemas/HfcNodeId' + gli: + $ref: '#/components/schemas/Gli' + w5gbanLineType: + $ref: '#/components/schemas/LineType' + gci: + $ref: '#/components/schemas/Gci' + + UpSecurity: + description: Contains Userplain security information. + type: object + properties: + upIntegr: + $ref: '#/components/schemas/UpIntegrity' + upConfid: + $ref: '#/components/schemas/UpConfidentiality' + required: + - upIntegr + - upConfid + + UpSecurityRm: + anyOf: + - $ref: '#/components/schemas/UpSecurity' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'UpSecurity' data type, but with the + OpenAPI 'nullable: true' property. + + NgApCause: + description: Represents the NGAP cause. + type: object + properties: + group: + $ref: '#/components/schemas/Uinteger' + value: + $ref: '#/components/schemas/Uinteger' + required: + - group + - value + + BackupAmfInfo: + description: Provides details of the Backup AMF. + type: object + properties: + backupAmf: + $ref: '#/components/schemas/AmfName' + guamiList: + type: array + items: + $ref: '#/components/schemas/Guami' + minItems: 1 + description: > + If present, this IE shall contain the list of GUAMI(s) (supported by the AMF) for + which the backupAmf IE applies. + required: + - backupAmf + + RefToBinaryData: + description: This parameter provides information about the referenced binary body data. + type: object + properties: + contentId: + type: string + description: > + This IE shall contain the value of the Content-ID header of the referenced binary + body part. + required: + - contentId + + RefToBinaryDataRm: + anyOf: + - $ref: '#/components/schemas/RefToBinaryData' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the ' RefToBinaryData ' data type, + but with the OpenAPI 'nullable: true' property. + + RouteToLocation: + type: object + properties: + dnai: + $ref: '#/components/schemas/Dnai' + routeInfo: + $ref: '#/components/schemas/RouteInformation' + routeProfId: + type: string + nullable: true + description: Identifies the routing profile Id. + required: + - dnai + anyOf: + - required: [ routeInfo ] + - required: [ routeProfId ] + nullable: true + description: > + At least one of the "routeInfo" attribute and the "routeProfId" attribute shall be included + in the "RouteToLocation" data type. + + RouteInformation: + type: object + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + portNumber: + $ref: '#/components/schemas/Uinteger' + required: + - portNumber + nullable: true + description: > + At least one of the "ipv4Addr" attribute and the "ipv6Addr" attribute shall be included in + the "RouteInformation" data type. + + Area: + description: Provides area information. + type: object + oneOf: + - required: + - tacs + - required: + - areaCode + properties: + tacs: + type: array + items: + $ref: '#/components/schemas/Tac' + minItems: 1 + areaCode: + $ref: '#/components/schemas/AreaCode' + + ServiceAreaRestriction: + description: Provides information about allowed or not allowed areas. + type: object + properties: + restrictionType: + $ref: '#/components/schemas/RestrictionType' + areas: + type: array + items: + $ref: '#/components/schemas/Area' + maxNumOfTAs: + $ref: '#/components/schemas/Uinteger' + maxNumOfTAsForNotAllowedAreas: + $ref: '#/components/schemas/Uinteger' + allOf: + # + # 1st condition: restrictionType and areas attributes shall be either both absent + # or both present + # + - oneOf: + - not: + required: [ restrictionType ] + - required: [ areas ] + # + # 2nd condition: if restrictionType takes value NOT_ALLOWED_AREAS, + # then maxNumOfTAs shall be absent + # + - anyOf: + - not: + required: [ restrictionType ] + properties: + restrictionType: + type: string + enum: [ NOT_ALLOWED_AREAS ] + - not: + required: [ maxNumOfTAs ] + # + # 3rd condition: if restrictionType takes value ALLOWED_AREAS, + # then maxNumOfTAsForNotAllowedAreas shall be absent + # + - anyOf: + - not: + required: [ restrictionType ] + properties: + restrictionType: + type: string + enum: [ ALLOWED_AREAS ] + - not: + required: [ maxNumOfTAsForNotAllowedAreas ] + + PresenceInfo: + type: object + properties: + praId: + type: string + description: > + Represents an identifier of the Presence Reporting Area (see clause 28.10 of 3GPP + TS 23.003. This IE shall be present if the Area of Interest subscribed or reported is + a Presence Reporting Area or a Set of Core Network predefined Presence Reporting Areas. + When present, it shall be encoded as a string representing an integer in the following + ranges: + 0 to 8 388 607 for UE-dedicated PRA + 8 388 608 to 16 777 215 for Core Network predefined PRA + Examples: + PRA ID 123 is encoded as "123" + PRA ID 11 238 660 is encoded as "11238660" + + additionalPraId: + type: string + description: > + This IE may be present if the praId IE is present and if it contains a PRA identifier + referring to a set of Core Network predefined Presence Reporting Areas. When present, + this IE shall contain a PRA Identifier of an individual PRA within the Set of Core + Network predefined Presence Reporting Areas indicated by the praId IE. + + presenceState: + $ref: '#/components/schemas/PresenceState' + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 1 + description: > + Represents the list of tracking areas that constitutes the area. This IE shall be + present if the subscription or the event report is for tracking UE presence in the + tracking areas. For non 3GPP access the TAI shall be the N3GPP TAI. + + ecgiList: + type: array + items: + $ref: '#/components/schemas/Ecgi' + minItems: 1 + description: > + Represents the list of EUTRAN cell Ids that constitutes the area. This IE shall + be present if the Area of Interest subscribed is a list of EUTRAN cell Ids. + + ncgiList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 1 + description: > + Represents the list of NR cell Ids that constitutes the area. This IE shall be + present if the Area of Interest subscribed is a list of NR cell Ids. + + globalRanNodeIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + description: > + Represents the list of NG RAN node identifiers that constitutes the area. This IE shall + be present if the Area of Interest subscribed is a list of NG RAN node identifiers. + + globaleNbIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + description: > + Represents the list of eNodeB identifiers that constitutes the area. This IE shall be + present if the Area of Interest subscribed is a list of eNodeB identifiers. + description: > + If the additionalPraId IE is present, this IE shall state the presence information of the + UE for the individual PRA identified by the additionalPraId IE; If the additionalPraId IE + is not present, this IE shall state the presence information of the UE for the PRA + identified by the praId IE. + PresenceInfoRm: + type: object + properties: + praId: + type: string + description: | + Represents an identifier of the Presence Reporting Area (see clause 28.10 of + 3GPP TS 23.003. This IE shall be present if the Area of Interest subscribed or + reported is a Presence Reporting Area or a Set of Core Network predefined Presence + Reporting Areas. When present, it shall be encoded as a string representing an integer + in the following ranges: + - 0 to 8 388 607 for UE-dedicated PRA + - 8 388 608 to 16 777 215 for Core Network predefined PRA + Examples: + PRA ID 123 is encoded as "123" + PRA ID 11 238 660 is encoded as "11238660" + additionalPraId: + type: string + description: > + This IE may be present if the praId IE is present and if it contains a PRA identifier + referring to a set of Core Network predefined Presence Reporting Areas. + When present, this IE shall contain a PRA Identifier of an individual PRA within the Set + of Core Network predefined Presence Reporting Areas indicated by the praId IE. + + presenceState: + $ref: '#/components/schemas/PresenceState' + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 0 + description: > + Represents the list of tracking areas that constitutes the area. This IE shall be + present if the subscription or the event report is for tracking UE presence in the + tracking areas. For non 3GPP access the TAI shall be the N3GPP TAI. + + ecgiList: + type: array + items: + $ref: '#/components/schemas/Ecgi' + minItems: 0 + description: > + Represents the list of EUTRAN cell Ids that constitutes the area. This IE shall be + present if the Area of Interest subscribed is a list of EUTRAN cell Ids. + ncgiList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 0 + description: > + Represents the list of NR cell Ids that constitutes the area. This IE shall be present + if the Area of Interest subscribed is a list of NR cell Ids. + globalRanNodeIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + description: > + Represents the list of NG RAN node identifiers that constitutes the area. This IE shall be + present if the Area of Interest subscribed is a list of NG RAN node identifiers. + globaleNbIdList: + type: array + items: + $ref: '#/components/schemas/GlobalRanNodeId' + minItems: 1 + description: > + Represents the list of eNodeB identifiers that constitutes the area. This IE shall be present + if the Area of Interest subscribed is a list of eNodeB identifiers. + nullable: true + description: > + This data type is defined in the same way as the 'PresenceInfo' data type, but with the + OpenAPI 'nullable: true' property. If the additionalPraId IE is present, this IE shall state + the presence information of the UE for the individual PRA identified by the additionalPraId + IE; If the additionalPraId IE is not present, this IE shall state the presence information + of the UE for the PRA identified by the praId IE. + + GlobalRanNodeId: + type: object + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + n3IwfId: + $ref: '#/components/schemas/N3IwfId' + gNbId: + $ref: '#/components/schemas/GNbId' + ngeNbId: + $ref: '#/components/schemas/NgeNbId' + wagfId: + $ref: '#/components/schemas/WAgfId' + tngfId: + $ref: '#/components/schemas/TngfId' + nid: + $ref: '#/components/schemas/Nid' + eNbId: + $ref: '#/components/schemas/ENbId' + oneOf: + - required: [ n3IwfId ] + - required: [ gNbId ] + - required: [ ngeNbId ] + - required: [ wagfId ] + - required: [ tngfId ] + - required: [ eNbId ] + description: > + One of the six attributes n3IwfId, gNbIdm, ngeNbId, wagfId, tngfId, eNbId shall be present. + required: + - plmnId + GNbId: + description: Provides the G-NB identifier. + type: object + properties: + bitLength: + type: integer + minimum: 22 + maximum: 32 + description: > + Unsigned integer representing the bit length of the gNB ID as defined in clause + 9.3.1.6 of 3GPP TS 38.413 [11], within the range 22 to 32. + gNBValue: + type: string + pattern: '^[A-Fa-f0-9]{6,8}$' + description: > + This represents the identifier of the gNB. The value of the gNB ID shall be encoded + in hexadecimal representation. Each character in the string shall take a value of + "0" to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. The padding 0 shall + be added to make multiple nibbles, the most significant character representing the + padding 0 if required together with the 4 most significant bits of the gNB ID shall + appear first in the string, and the character representing the 4 least significant bit + of the gNB ID shall appear last in the string. + required: + - bitLength + - gNBValue + + AtsssCapability: + description: > + Containes Capability to support procedures related to Access Traffic Steering, Switching, + Splitting. + type: object + properties: + atsssLL: + type: boolean + default: false + description: > + Indicates the ATSSS-LL capability to support procedures related to Access Traffic + Steering, Switching, Splitting (see clauses 4.2.10, 5.32 of 3GPP TS 23.501). + true: Supported + false (default): Not Supported + mptcp: + type: boolean + default: false + description: > + Indicates the MPTCP capability to support procedures related to Access Traffic Steering, + Switching, Splitting (see clauses 4.2.10, 5.32 of 3GPP TS 23.501 + true: Supported + false (default): Not Supported + rttWithoutPmf: + type: boolean + default: false + description: > + This IE is only used by the UPF to indicate whether the UPF supports RTT measurement + without PMF (see clauses 5.32.2, 6.3.3.3 of 3GPP TS 23.501 + true: Supported + false (default): Not Supported + PlmnIdNid: + description: > + Contains the serving core network operator PLMN ID and, for an SNPN, the NID that together + with the PLMN ID identifies the SNPN. + type: object + required: + - mcc + - mnc + properties: + mcc: + $ref: '#/components/schemas/Mcc' + mnc: + $ref: '#/components/schemas/Mnc' + nid: + $ref: '#/components/schemas/Nid' + + PlmnIdNidRm: + anyOf: + - $ref: '#/components/schemas/PlmnIdNid' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'PlmnIdNid' data type, but with the + OpenAPI 'nullable: true' property. + + SmallDataRateStatus: + description: It indicates theSmall Data Rate Control Status + type: object + properties: + remainPacketsUl: + type: integer + minimum: 0 + description: > + When present, it shall contain the number of packets the UE is allowed to send uplink + in the given time unit for the given PDU session (see clause 5.31.14.3 of 3GPP TS 23.501. + remainPacketsDl: + type: integer + minimum: 0 + description: > + When present it shall contain the number of packets the AF is allowed to send downlink + in the given time unit for the given PDU session (see clause 5.31.14.3 of 3GPP TS 23.501. + validityTime: + $ref: '#/components/schemas/DateTime' + remainExReportsUl: + type: integer + minimum: 0 + description: > + When present, it shall indicate number of additional exception reports the UE is allowed + to send uplink in the given time unit for the given PDU session (see clause 5.31.14.3 + of 3GPP TS 23.501. + remainExReportsDl: + type: integer + minimum: 0 + description: > + When present, it shall indicate number of additional exception reports the AF is allowed + to send downlink in the given time unit for the given PDU session (see clause 5.31.14.3 + in 3GPP TS 23.501 + + HfcNodeId: + description: REpresents the HFC Node Identifer received over NGAP. + type: object + required: + - hfcNId + properties: + hfcNId: + $ref: '#/components/schemas/HfcNId' + + HfcNodeIdRm: + anyOf: + - $ref: '#/components/schemas/HfcNodeId' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'HfcNodeId' data type, but with the + OpenAPI 'nullable: true' property. + + WirelineArea: + type: object + properties: + globalLineIds: + type: array + items: + $ref: '#/components/schemas/Gli' + minItems: 1 + hfcNIds: + type: array + items: + $ref: '#/components/schemas/HfcNId' + minItems: 1 + areaCodeB: + $ref: '#/components/schemas/AreaCode' + areaCodeC: + $ref: '#/components/schemas/AreaCode' + description: > + One and only one of the "globLineIds", "hfcNIds", "areaCodeB" and "areaCodeC" attributes + shall be included in a WirelineArea data structure + + WirelineServiceAreaRestriction: + type: object + properties: + restrictionType: + $ref: '#/components/schemas/RestrictionType' + areas: + type: array + items: + $ref: '#/components/schemas/WirelineArea' + description: > + The "restrictionType" attribute and the "areas" attribute shall be either both present + or absent. The empty array of areas is used when service is allowed/restricted nowhere. + + ApnRateStatus: + description: Contains the APN rate control status e.g. of the AMF. + type: object + properties: + remainPacketsUl: + type: integer + minimum: 0 + description: > + When present, it shall contain the number of packets the UE is allowed to send uplink + in the given time unit for the given APN (all PDN connections of the UE to this APN + see clause 4.7.7.3 in 3GPP TS 23.401. + remainPacketsDl: + type: integer + minimum: 0 + description: > + When present, it shall contain the number of packets the UE is allowed to send uplink + in the given time unit for the given APN (all PDN connections of the UE to this APN + see clause 4.7.7.3 in 3GPP TS 23.401. + validityTime: + $ref: '#/components/schemas/DateTime' + remainExReportsUl: + type: integer + minimum: 0 + description: > + When present, it shall indicate the number of additional exception reports the UE is + allowed to send uplink in the given time unit for the given APN (all PDN connections of the UE to this APN, + see clause 4.7.7.3 in 3GPP TS 23.401. + remainExReportsDl: + type: integer + minimum: 0 + description: > + When present, it shall indicate the number of additional exception reports the AF is + allowed to send downlink in the given time unit for the given APN (all PDN connections + of the UE to this APN, see clause 4.7.7.3 in 3GPP TS 23.401. + + ScheduledCommunicationTime: + description: Identifies time and day of the week when the UE is available for communication. + type: object + properties: + daysOfWeek: + type: array + items: + $ref: '#/components/schemas/DayOfWeek' + minItems: 1 + maxItems: 6 + description: > + Identifies the day(s) of the week. If absent, it indicates every day of the week. + timeOfDayStart: + $ref: '#/components/schemas/TimeOfDay' + timeOfDayEnd: + $ref: '#/components/schemas/TimeOfDay' + + ScheduledCommunicationTimeRm: + anyOf: + - $ref: '#/components/schemas/ScheduledCommunicationTime' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'ScheduledCommunicationTime' data type, + but with the OpenAPI 'nullable: true' property. + + BatteryIndication: + type: object + properties: + batteryInd: + type: boolean + description: > + This IE shall indicate whether the UE is battery powered or not. + true: the UE is battery powered; + false or absent: the UE is not battery powered + replaceableInd: + type: boolean + description: > + This IE shall indicate whether the battery of the UE is replaceable or not. + true: the battery of the UE is replaceable; + false or absent: the battery of the UE is not replaceable. + rechargeableInd: + type: boolean + description: > + This IE shall indicate whether the battery of the UE is rechargeable or not. + true: the battery of UE is rechargeable; + false or absent: the battery of the UE is not rechargeable. + description: > + Parameters "replaceableInd" and "rechargeableInd" are only included if the value of + Parameter "batteryInd" is true. + + BatteryIndicationRm: + anyOf: + - $ref: '#/components/schemas/BatteryIndication' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'BatteryIndication' data type, but + with the OpenAPI 'nullable: true' property. + + AcsInfo: + description: The ACS information for the 5G-RG is defined in BBF TR-069 [42] or in BBF TR-369 + type: object + properties: + acsUrl: + $ref: '#/components/schemas/Uri' + acsIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + acsIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + + AcsInfoRm: + anyOf: + - $ref: '#/components/schemas/AcsInfo' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'AcsInfo' data type, but with the + OpenAPI 'nullable: true' property. + + NrV2xAuth: + description: Contains NR V2X services authorized information. + type: object + properties: + vehicleUeAuth: + $ref: '#/components/schemas/UeAuth' + pedestrianUeAuth: + $ref: '#/components/schemas/UeAuth' + + LteV2xAuth: + description: Contains LTE V2X services authorized information. + type: object + properties: + vehicleUeAuth: + $ref: '#/components/schemas/UeAuth' + pedestrianUeAuth: + $ref: '#/components/schemas/UeAuth' + + Pc5QoSPara: + description: Contains policy data on the PC5 QoS parameters. + type: object + required: + - pc5QosFlowList + properties: + pc5QosFlowList: + type: array + items: + $ref: '#/components/schemas/Pc5QosFlowItem' + pc5LinkAmbr: + $ref: '#/components/schemas/BitRate' + + Pc5QosFlowItem: + description: Contains a PC5 QOS flow. + type: object + required: + - pqi + properties: + pqi: + $ref: '#/components/schemas/5Qi' + + pc5FlowBitRates: + $ref: '#/components/schemas/Pc5FlowBitRates' + range: + $ref: '#/components/schemas/Uinteger' + + Pc5FlowBitRates: + description: it shall represent the PC5 Flow Bit Rates + type: object + properties: + guaFbr: + $ref: '#/components/schemas/BitRate' + maxFbr: + $ref: '#/components/schemas/BitRate' + + UtraLocation: + type: object + oneOf: + - required: + - cgi + - required: + - sai + - required: + - rai + description: Exactly one of cgi, sai or lai shall be present. + properties: + cgi: + $ref: '#/components/schemas/CellGlobalId' + sai: + $ref: '#/components/schemas/ServiceAreaId' + lai: + $ref: '#/components/schemas/LocationAreaId' + rai: + $ref: '#/components/schemas/RoutingAreaId' + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + description: > + The value represents the elapsed time in minutes since the last network contact of the + mobile station. Value "0" indicates that the location information was obtained after a + successful paging procedure for Active Location Retrieval when the UE is in idle mode + or after a successful location reporting procedure the UE is in connected mode. Any + other value than "0" indicates that the location information is the last known one. + See 3GPP TS 29.002 clause 17.7.8. + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + description: > + Refer to geographical Information.See 3GPP TS 23.032 clause 7.3.2. Only the + description of an ellipsoid point with uncertainty circle is allowed to be used. + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + description: > + Refers to Calling Geodetic Location. See ITU-T Recommendation Q.763 (1999) clause + 3.88.2. Only the description of an ellipsoid point with uncertainty circle is allowed + to be used. + + GeraLocation: + type: object + oneOf: + - required: + - cgi + - required: + - sai + - required: + - lai + - required: + - rai + description: Exactly one of cgi, sai or lai shall be present. + properties: + locationNumber: + type: string + description: Location number within the PLMN. See 3GPP TS 23.003, clause 4.5. + cgi: + $ref: '#/components/schemas/CellGlobalId' + rai: + $ref: '#/components/schemas/RoutingAreaId' + sai: + $ref: '#/components/schemas/ServiceAreaId' + lai: + $ref: '#/components/schemas/LocationAreaId' + vlrNumber: + type: string + description: VLR number. See 3GPP TS 23.003 clause 5.1. + mscNumber: + type: string + description: MSC number. See 3GPP TS 23.003 clause 5.1. + ageOfLocationInformation: + type: integer + minimum: 0 + maximum: 32767 + description: > + The value represents the elapsed time in minutes since the last network contact of the + mobile station. Value "0" indicates that the location information was obtained after a + successful paging procedure for Active Location Retrieval when the UE is in idle mode + or after a successful location reporting procedure the UE is in connected mode. Any + other value than "0" indicates that the location information is the last known one. + See 3GPP TS 29.002 clause 17.7.8. + ueLocationTimestamp: + $ref: '#/components/schemas/DateTime' + geographicalInformation: + type: string + pattern: '^[0-9A-F]{16}$' + description: > + Refer to geographical Information.See 3GPP TS 23.032 clause 7.3.2. Only the + description of an ellipsoid point with uncertainty circle is allowed to be used. + geodeticInformation: + type: string + pattern: '^[0-9A-F]{20}$' + description: > + Refers to Calling Geodetic Location.See ITU-T Recommendation Q.763 (1999) clause 3.88.2. + Only the description of an ellipsoid point with uncertainty circle is allowed to be + used. + + CellGlobalId: + description: Contains a Cell Global Identification as defined in 3GPP TS 23.003, clause 4.3.1. + type: object + required: + - plmnId + - lac + - cellId + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + cellId: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + + ServiceAreaId: + description: Contains a Service Area Identifier as defined in 3GPP TS 23.003, clause 12.5. + type: object + required: + - plmnId + - lac + - sac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + description: Location Area Code. + sac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + description: Service Area Code. + + LocationAreaId: + description: Contains a Location area identification as defined in 3GPP TS 23.003, clause 4.1. + type: object + required: + - plmnId + - lac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + + lac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + description: Location Area Code. + + RoutingAreaId: + description: Contains a Routing Area Identification as defined in 3GPP TS 23.003, clause 4.2. + type: object + required: + - plmnId + - lac + - rac + properties: + plmnId: + $ref: '#/components/schemas/PlmnId' + lac: + type: string + pattern: '^[A-Fa-f0-9]{4}$' + description: Location Area Code + rac: + type: string + pattern: '^[A-Fa-f0-9]{2}$' + description: Routing Area Code + + DddTrafficDescriptor: + description: Contains a Traffic Descriptor. + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + portNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + macAddr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/MacAddr48' + + MoExpDataCounter: + description: Contain the MO Exception Data Counter. + type: object + required: + - counter + properties: + counter: + type: integer + description: > + Unsigned integer identifying the MO Exception Data Counter, as specified in clause + 5.31.14.3 of 3GPP TS 23.501. + timeStamp: + $ref: '#/components/schemas/DateTime' + + NssaaStatus: + description: contains the Subscribed S-NSSAI subject to NSSAA procedure and the status. + type: object + required: + - snssai + - status + properties: + snssai: + $ref: '#/components/schemas/Snssai' + status: + $ref: '#/components/schemas/AuthStatus' + + NssaaStatusRm: + anyOf: + - $ref: '#/components/schemas/NssaaStatus' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'NssaaStatus' data type, but with + the OpenAPI 'nullable: true' property. + + TnapId: + description: Contain the TNAP Identifier see clause5.6.2 of 3GPP TS 23.501. + type: object + properties: + ssId: + type: string + description: > + This IE shall be present if the UE is accessing the 5GC via a trusted WLAN access + network.When present, it shall contain the SSID of the access point to which the UE + is attached, that is received over NGAP, see IEEE Std 802.11-2012. + + bssId: + type: string + description: > + When present, it shall contain the BSSID of the access point to which the UE is + attached, that is received over NGAP, see IEEE Std 802.11-2012. + + civicAddress: + $ref: '#/components/schemas/Bytes' + + TnapIdRm: + anyOf: + - $ref: '#/components/schemas/TnapId' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'TnapId' data type, but with the + OpenAPI 'nullable: true' property. + + TwapId: + description: > + Contain the TWAP Identifier as defined in clause 4.2.8.5.3 of 3GPP TS 23.501 + or the WLAN location information as defined in clause 4.5.7.2.8 of 3GPP TS 23.402. + type: object + required: + - ssId + properties: + ssId: + type: string + description: > + This IE shall contain the SSID of the access point to which the UE is attached, that is + received over NGAP, see IEEE Std 802.11-2012. + + bssId: + type: string + description: > + When present, it shall contain the BSSID of the access point to which the UE is + attached, for trusted WLAN access, see IEEE Std 802.11-2012. + + civicAddress: + $ref: '#/components/schemas/Bytes' + + TwapIdRm: + anyOf: + - $ref: '#/components/schemas/TwapId' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'TwapId' data type, but with the + OpenAPI 'nullable: true' property. + + SnssaiExtension: + description: > + Extensions to the Snssai data type, sdRanges and wildcardSd shall not be present + simultaneously + type: object + not: + required: + - sdRanges + - wildcardSd + properties: + sdRanges: + description: > + When present, it shall contain the range(s) of Slice Differentiator values supported for + the Slice/Service Type value indicated in the sst attribute of the Snssai data type + type: array + items: + $ref: '#/components/schemas/SdRange' + minItems: 1 + wildcardSd: + description: > + When present, it shall be set to true, to indicate that all SD values are supported for + the Slice/Service Type value indicated in the sst attribute of the Snssai data type. + type: boolean + enum: + - true + + SdRange: + description: A range of SDs (Slice Differentiators) + type: object + properties: + start: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: > + First value identifying the start of an SD range. This string shall be formatted as + specified for the sd attribute of the Snssai data type in clause 5.4.4.2. + end: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: > + Last value identifying the end of an SD range. This string shall be formatted as + specified for the sd attribute of the Snssai data type in clause 5.4.4.2. + + ProseServiceAuth: + description: > + Indicates whether the UE is authorized to use ProSe Direct Discovery, ProSe Direct + Communication, or both. + type: object + properties: + proseDirectDiscoveryAuth: + $ref: '#/components/schemas/UeAuth' + proseDirectCommunicationAuth: + $ref: '#/components/schemas/UeAuth' + + EcsServerAddr: + description: > + Contains the Edge Configuration Server Address Configuration Information as defined in + clause 5.2.3.6.1 of 3GPP TS 23.502. + type: object + properties: + ecsFqdnList: + type: array + items: + $ref: '#/components/schemas/Fqdn' + minItems: 1 + ecsIpAddressList: + type: array + items: + $ref: '#/components/schemas/IpAddr' + minItems: 1 + ecsUriList: + type: array + items: + $ref: '#/components/schemas/Uri' + minItems: 1 + ecsProviderId: + type: string + + EcsServerAddrRm: + anyOf: + - $ref: '#/components/schemas/EcsServerAddr' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the ' EcsServerAddr ' data type, but with + the OpenAPI 'nullable: true' property. + + IpAddr: + description: Contains an IP adresse. + type: object + oneOf: + - required: + - ipv4Addr + - required: + - ipv6Addr + - required: + - ipv6Prefix + properties: + ipv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + ipv6Prefix: + $ref: '#/components/schemas/Ipv6Prefix' + + SACInfo: + description: > + Represents threshold(s) to control the triggering of network slice reporting notifications + or the information contained in the network slice reporting notification. + type: object + properties: + numericValNumUes: + type: integer + numericValNumPduSess: + type: integer + percValueNumUes: + type: integer + minimum: 0 + maximum: 100 + percValueNumPduSess: + type: integer + minimum: 0 + maximum: 100 + + SACEventStatus: + description: > + Contains the network slice status information in terms of the current number of UEs + registered with a network slice, the current number of PDU Sessions established on a + network slice or both. + type: object + properties: + reachedNumUes: + $ref: '#/components/schemas/SACInfo' + reachedNumPduSess: + $ref: '#/components/schemas/SACInfo' + + SpatialValidityCond: + description: Contains the Spatial Validity Condition. + type: object + properties: + trackingAreaList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 1 + countries: + type: array + items: + $ref: '#/components/schemas/Mcc' + minItems: 1 + geographicalServiceArea: + $ref: '#/components/schemas/GeoServiceArea' + + SpatialValidityCondRm: + description: Contains the Spatial Validity Condition or the null value. + anyOf: + - $ref: '#/components/schemas/SpatialValidityCond' + - $ref: '#/components/schemas/NullValue' + + ServerAddressingInfo: + description: Contains addressing information (IP addresses and/or FQDNs) of a server. + type: object + anyOf: + - required: + - ipv4Addresses + - required: + - ipv6Addresses + - required: + - fqdnList + properties: + ipv4Addresses: + type: array + items: + $ref: '#/components/schemas/Ipv4Addr' + minItems: 1 + ipv6Addresses: + type: array + items: + $ref: '#/components/schemas/Ipv6Addr' + minItems: 1 + fqdnList: + type: array + items: + $ref: '#/components/schemas/Fqdn' + minItems: 1 + + PcfUeCallbackInfo: + description: > + Contains the PCF for the UE information necessary for the PCF for the PDU session to send + SM Policy Association Establishment and Termination events. + type: object + properties: + callbackUri: + $ref: '#/components/schemas/Uri' + bindingInfo: + type: string + nullable: true + required: + - callbackUri + + PduSessionInfo: + description: indicates the DNN and S-NSSAI combination of a PDU session. + properties: + snssai: + $ref: '#/components/schemas/Snssai' + dnn: + $ref: '#/components/schemas/Dnn' + required: + - dnn + - snssai + + EasIpReplacementInfo: + description: Contains EAS IP replacement information for a Source and a Target EAS. + type: object + properties: + source: + $ref: '#/components/schemas/EasServerAddress' + target: + $ref: '#/components/schemas/EasServerAddress' + required: + - source + - target + + EasServerAddress: + description: Represents the IP address and port of an EAS server. + type: object + properties: + ip: + $ref: '#/components/schemas/IpAddr' + port: + $ref: '#/components/schemas/Uinteger' + required: + - ip + - port + + RoamingRestrictions: + description: > + Indicates if access is allowed to a given serving network, e.g. a PLMN (MCC, MNC) or an + SNPN (MCC, MNC, NID). + type: object + properties: + accessAllowed: + type: boolean + + GeoServiceArea: + description: List of geographic area or list of civic address info + type: object + properties: + geographicAreaList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + civicAddressList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + +# +# Data types describing alternative data types or combinations of data types +# + ExtSnssai: + allOf: + - $ref: '#/components/schemas/Snssai' + - $ref: '#/components/schemas/SnssaiExtension' + description: > + The sdRanges and wildcardSd attributes shall be exclusive from each other. If one of these + attributes is present, the sd attribute shall also be present and it shall contain one Slice + Differentiator value within the range of SD (if the sdRanges attribute is present) or with + any value (if the wildcardSd attribute is present). + +# +# Data Types related to 5G QoS as defined in clause 5.5 +# + +# +# SIMPLE DATA TYPES +# +# + Qfi: + type: integer + minimum: 0 + maximum: 63 + description: Unsigned integer identifying a QoS flow, within the range 0 to 63. + + QfiRm: + type: integer + minimum: 0 + maximum: 63 + nullable: true + description: > + This data type is defined in the same way as the 'Qfi' data type, but with the + OpenAPI 'nullable: true' property. + + 5Qi: + type: integer + minimum: 0 + maximum: 255 + description: > + Unsigned integer representing a 5G QoS Identifier (see clause 5.7.2.1 of 3GPP TS 23.501, + within the range 0 to 255. + + 5QiRm: + type: integer + minimum: 0 + maximum: 255 + nullable: true + description: > + This data type is defined in the same way as the '5QiPriorityLevel' data type, but with + the OpenAPI 'nullable: true' property. " + + BitRate: + type: string + pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' + description: > + String representing a bit rate; the prefixes follow the standard symbols from The International + System of Units, and represent x1000 multipliers, with the exception that prefix "K" is + used to represent the standard symbol "k". + + BitRateRm: + type: string + pattern: '^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$' + nullable: true + description: > + This data type is defined in the same way as the 'BitRate' data type, but with the OpenAPI 'nullable: true' property. + + ArpPriorityLevelRm: + type: integer + minimum: 1 + maximum: 15 + nullable: true + description: > + This data type is defined in the same way as the 'ArpPriorityLevel' data type, but with + the OpenAPI 'nullable: true' property. + + ArpPriorityLevel: + type: integer + minimum: 1 + maximum: 15 + nullable: true + description: > + nullable true shall not be used for this attribute. Unsigned integer indicating the ARP + Priority Level (see clause 5.7.2.2 of 3GPP TS 23.501, within the range 1 to 15.Values are + ordered in decreasing order of priority, i.e. with 1 as the highest priority and 15 as + the lowest priority. + + 5QiPriorityLevel: + type: integer + minimum: 1 + maximum: 127 + description: > + Unsigned integer indicating the 5QI Priority Level (see clauses 5.7.3.3 and 5.7.4 of 3GPP + TS 23.501, within the range 1 to 127.Values are ordered in decreasing order of priority, + i.e. with 1 as the highest priority and 127 as the lowest priority. + + 5QiPriorityLevelRm: + type: integer + minimum: 1 + maximum: 127 + nullable: true + description: > + This data type is defined in the same way as the '5QiPriorityLevel' data type, but with + the OpenAPI 'nullable: true' property. + + PacketDelBudget: + type: integer + minimum: 1 + description: > + Unsigned integer indicating Packet Delay Budget (see clauses 5.7.3.4 and 5.7.4 of 3GPP + TS 23.501), expressed in milliseconds. + + PacketDelBudgetRm: + type: integer + minimum: 1 + nullable: true + description: > + This data type is defined in the same way as the 'PacketDelBudget' data type, but with + the OpenAPI 'nullable: true' property. + + PacketErrRate: + type: string + pattern: '^([0-9]E-[0-9])$' + description: > + String representing Packet Error Rate (see clause 5.7.3.5 and 5.7.4 of 3GPP TS 23.501, + expressed as a "scalar x 10-k" where the scalar and the exponent k are each encoded as + one decimal digit. + + PacketErrRateRm: + type: string + pattern: '^([0-9]E-[0-9])$' + nullable: true + description: > + This data type is defined in the same way as the 'PacketErrRate' data type, but with + the OpenAPI 'nullable: true' property. + + PacketLossRate: + type: integer + minimum: 0 + maximum: 1000 + description: > + Unsigned integer indicating Packet Loss Rate (see clauses 5.7.2.8 and 5.7.4 of 3GPP + TS 23.501), expressed in tenth of percent. + + PacketLossRateRm: + type: integer + minimum: 0 + maximum: 1000 + nullable: true + description: > + This data type is defined in the same way as the 'PacketLossRate' data type, but with + the OpenAPI 'nullable: true' property. + + AverWindow: + type: integer + minimum: 1 + maximum: 4095 + default: 2000 + description: Unsigned integer indicating Averaging Window (see clause 5.7.3.6 and 5.7.4 of 3GPP TS 23.501), expressed in milliseconds. + + AverWindowRm: + type: integer + maximum: 4095 + default: 2000 + minimum: 1 + nullable: true + description: > + This data type is defined in the same way as the 'AverWindow' data type, but with + the OpenAPI 'nullable: true' property. + + MaxDataBurstVol: + type: integer + minimum: 1 + maximum: 4095 + description: > + Unsigned integer indicating Maximum Data Burst Volume (see clauses 5.7.3.7 and 5.7.4 of + 3GPP TS 23.501), expressed in Bytes. + + MaxDataBurstVolRm: + type: integer + minimum: 1 + maximum: 4095 + nullable: true + description: > + This data type is defined in the same way as the 'MaxDataBurstVol' data type, but with + the OpenAPI 'nullable: true' property. + + SamplingRatio: + type: integer + minimum: 1 + maximum: 100 + description: > + Unsigned integer indicating Sampling Ratio (see clauses 4.15.1 of 3GPP TS 23.502), + expressed in percent. + + SamplingRatioRm: + type: integer + minimum: 1 + maximum: 100 + nullable: true + description: > + This data type is defined in the same way as the 'SamplingRatio' data type, but with the + OpenAPI 'nullable: true' property. +# + RgWirelineCharacteristics: + $ref: '#/components/schemas/Bytes' + + RgWirelineCharacteristicsRm: + anyOf: + - $ref: '#/components/schemas/RgWirelineCharacteristics' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'RgWirelineCharacteristics' data type, + but with the OpenAPI 'nullable: true' property. + + ExtMaxDataBurstVol: + type: integer + minimum: 4096 + maximum: 2000000 + description: > + Unsigned integer indicating Maximum Data Burst Volume (see clauses 5.7.3.7 and 5.7.4 of + 3GPP TS 23.501), expressed in Bytes. + + ExtMaxDataBurstVolRm: + type: integer + minimum: 4096 + maximum: 2000000 + nullable: true + description: > + This data type is defined in the same way as the 'ExtMaxDataBurstVol' data type, but + with the OpenAPI 'nullable: true' property. + + ExtPacketDelBudget: + type: integer + minimum: 1 + description: > + Unsigned integer indicating Packet Delay Budget (see clauses 5.7.3.4 and 5.7.4 of 3GPP + TS 23.501 [8])), expressed in 0.01 milliseconds. + + ExtPacketDelBudgetRm: + type: integer + minimum: 1 + nullable: true + description: > + This data type is defined in the same way as the 'ExtPacketDelBudget' data type, but + with the OpenAPI 'nullable: true' property. " + +# +# ENUMERATED DATA TYPES +# + + PreemptionCapability: + anyOf: + - type: string + enum: + - NOT_PREEMPT + - MAY_PREEMPT + - type: string + description: > + The enumeration PreemptionCapability indicates the pre-emption capability of a request on + other QoS flows. See clause 5.7.2.2 of 3GPP TS 23.501. It shall comply with the provisions + defined in table 5.5.3.1-1. + PreemptionCapabilityRm: + anyOf: + - $ref: '#/components/schemas/PreemptionCapability' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'PreemptionCapability' enumeration, + but with the OpenAPI 'nullable: true' property. + + PreemptionVulnerability: + anyOf: + - type: string + enum: + - NOT_PREEMPTABLE + - PREEMPTABLE + - type: string + description: > + The enumeration PreemptionVulnerability indicates the pre-emption vulnerability of the QoS + flow to pre-emption from other QoS flows. See clause 5.7.2.2 of 3GPP TS 23.501. It shall + comply with the provisions defined in table 5.5.3.2-1 + + PreemptionVulnerabilityRm: + anyOf: + - $ref: '#/components/schemas/PreemptionVulnerability' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'PreemptionVulnerability' enumeration, + but with the OpenAPI 'nullable: true' property." + + ReflectiveQoSAttribute: + anyOf: + - type: string + enum: + - RQOS + - NO_RQOS + - type: string + description: > + The enumeration ReflectiveQosAttribute indicates whether certain traffic of the QoS flow may + be subject to Reflective QoS (see clause 5.7.2.3 of 3GPP TS 23.501). It shall comply with + the provisions defined in table 5.5.3.3-1. + + ReflectiveQoSAttributeRm: + anyOf: + - $ref: '#/components/schemas/ReflectiveQoSAttribute' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'ReflectiveQosAttribute' enumeration, + but with the OpenAPI 'nullable: true' property. " + + NotificationControl: + anyOf: + - type: string + enum: + - REQUESTED + - NOT_REQUESTED + - type: string + description: > + The enumeration NotificationControl indicates whether notifications are requested from the + RAN when the GFBR can no longer (or again) be fulfilled for a QoS Flow during the lifetime + of the QoS Flow (see clause 5.7.2.4 of 3GPP TS 23.501). + It shall comply with the provisions defined in table 5.5.3.5-1. + + NotificationControlRm: + anyOf: + - $ref: '#/components/schemas/NotificationControl' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'NotificationControl' enumeration, but + with the OpenAPI 'nullable: true' property. + + QosResourceType: + anyOf: + - type: string + enum: + - NON_GBR + - NON_CRITICAL_GBR + - CRITICAL_GBR + - type: string + description: > + The enumeration QosResourceType indicates whether a QoS Flow is non-GBR, delay critical GBR, + or non-delay critical GBR (see clauses 5.7.3.4 and 5.7.3.5 of 3GPP TS 23.501). It shall + comply with the provisions defined in table 5.5.3.6-1. + + QosResourceTypeRm: + anyOf: + - $ref: '#/components/schemas/QosResourceType' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'QosResourceType' enumeration, but + with the OpenAPI 'nullable: true' property. " + + AdditionalQosFlowInfo: + anyOf: + - anyOf: + - type: string + enum: + - MORE_LIKELY + - type: string + - $ref: '#/components/schemas/NullValue' + description: > + The enumeration AdditionalQosFlowInfo provides additional QoS flow information (see clause + 9.3.1.12 3GPP TS 38.413 [11]). It shall comply with the provisions defined in table + 5.5.3.12-1. + + PartitioningCriteria: + anyOf: + - type: string + enum: + - TAC + - SUBPLMN + - GEOAREA + - SNSSAI + - DNN + - type: string + description: > + This string provides forward-compatibility with future + extensions to the enumeration but is not used to encode + content defined in the present version of this API. + description: | + Possible values are: + - "TAC": Type Allocation Code + - "SUBPLMN": Subscriber PLMN ID + - "GEOAREA": Geographical area, i.e. list(s) of TAI(s) + - "SNSSAI": S-NSSAI + - "DNN": DNN + + PartitioningCriteriaRm: + anyOf: + - $ref: '#/components/schemas/PartitioningCriteria' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the ' PartitioningCriteria ' data type, but + with the OpenAPI 'nullable: true' property. +# +# +# STRUCTURED DATA TYPES +# + + Arp: + description: Contains Allocation and Retention Priority information. + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/ArpPriorityLevel' + preemptCap: + $ref: '#/components/schemas/PreemptionCapability' + preemptVuln: + $ref: '#/components/schemas/PreemptionVulnerability' + required: + - priorityLevel + - preemptCap + - preemptVuln + + Ambr: + description: Contains the maximum aggregated uplink and downlink bit rates. + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + + Dynamic5Qi: + description: > + It indicates the QoS Characteristics for a Non-standardised or not pre-configured 5QI + for downlink and uplink. + type: object + properties: + resourceType: + $ref: '#/components/schemas/QosResourceType' + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + packetDelayBudget: + $ref: '#/components/schemas/PacketDelBudget' + packetErrRate: + $ref: '#/components/schemas/PacketErrRate' + averWindow: + $ref: '#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: '#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: '#/components/schemas/ExtMaxDataBurstVol' + extPacketDelBudget: + $ref: '#/components/schemas/ExtPacketDelBudget' + cnPacketDelayBudgetDl: + $ref: '#/components/schemas/ExtPacketDelBudget' + cnPacketDelayBudgetUl: + $ref: '#/components/schemas/ExtPacketDelBudget' + required: + - resourceType + - priorityLevel + - packetDelayBudget + - packetErrRate + + NonDynamic5Qi: + description: > + It indicates the QoS Characteristics for a standardized or pre-configured 5QI for downlink + and uplink. + type: object + properties: + priorityLevel: + $ref: '#/components/schemas/5QiPriorityLevel' + averWindow: + $ref: '#/components/schemas/AverWindow' + maxDataBurstVol: + $ref: '#/components/schemas/MaxDataBurstVol' + extMaxDataBurstVol: + $ref: '#/components/schemas/ExtMaxDataBurstVol' + cnPacketDelayBudgetDl: + $ref: '#/components/schemas/ExtPacketDelBudget' + cnPacketDelayBudgetUl: + $ref: '#/components/schemas/ExtPacketDelBudget' + minProperties: 0 + + ArpRm: + anyOf: + - $ref: '#/components/schemas/Arp' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Arp' data type, but with the + OpenAPI 'nullable: true' property. + + AmbrRm: + anyOf: + - $ref: '#/components/schemas/Ambr' + - $ref: '#/components/schemas/NullValue' + description: > + This data type is defined in the same way as the 'Ambr' data type, but with the + OpenAPI 'nullable: true' property." + + SliceMbr: + description: MBR related to slice + type: object + properties: + uplink: + $ref: '#/components/schemas/BitRate' + downlink: + $ref: '#/components/schemas/BitRate' + required: + - uplink + - downlink + + SliceMbrRm: + description: "SliceMbr with nullable: true" + + anyOf: + - $ref: '#/components/schemas/SliceMbr' + - $ref: '#/components/schemas/NullValue' + +# +# Data Types related to 5G Trace as defined in clause 5.6 +# + +# +# SIMPLE DATA TYPES +# + PhysCellId: + type: integer + minimum: 0 + maximum: 1007 + description: > + Integer value identifying the physical cell identity (PCI), as definition of "PhysCellId" IE + in clause 6.3.2 of 3GPP TS 38.331. + ArfcnValueNR: + type: integer + minimum: 0 + maximum: 3279165 + description: > + Integer value indicating the ARFCN applicable for a downlink, uplink or bi-directional (TDD) + NR global frequency raster, + as definition of "ARFCN-ValueNR" IE in clause 6.3.2 of 3GPP TS 38.331. +# +# +# Enumerations +# + TraceDepth: + anyOf: + - type: string + enum: + - MINIMUM + - MEDIUM + - MAXIMUM + - MINIMUM_WO_VENDOR_EXTENSION + - MEDIUM_WO_VENDOR_EXTENSION + - MAXIMUM_WO_VENDOR_EXTENSION + - type: string + description: > + The enumeration TraceDepth defines how detailed information should be recorded in the trace. + See 3GPP TS 32.422 for further description of the values. It shall comply with the + provisions defined in table 5.6.3.1-1 + TraceDepthRm: + anyOf: + - $ref: '#/components/schemas/TraceDepth' + - $ref: '#/components/schemas/NullValue' + description: > + This enumeration is defined in the same way as the 'TraceDepth' enumeration, but with + the OpenAPI 'nullable: true' property. + + JobType: + anyOf: + - type: string + enum: + - IMMEDIATE_MDT_ONLY + - LOGGED_MDT_ONLY + - TRACE_ONLY + - IMMEDIATE_MDT_AND_TRACE + - RLF_REPORTS_ONLY + - RCEF_REPORTS_ONLY + - LOGGED_MBSFN_MDT + - type: string + description: > + The enumeration JobType defines Job Type in the trace. See 3GPP TS 32.422 for further + description of the values. It shall comply with the provisions defined in table 5.6.3.3-1. + + ReportTypeMdt: + anyOf: + - type: string + enum: + - PERIODICAL + - EVENT_TRIGGED + - type: string + description: > + The enumeration ReportTypeMdt defines Report Type for logged MDT in the trace. See 3GPP TS + 32.422 for further description of the values. It shall comply with the provisions defined + in table 5.6.3.4-1. + + MeasurementLteForMdt: + anyOf: + - type: string + enum: + - M1 + - M2 + - M3 + - M4_DL + - M4_UL + - M5_DL + - M5_UL + - M6_DL + - M6_UL + - M7_DL + - M7_UL + - M8 + - M9 + - type: string + description: > + The enumeration MeasurementLteForMdt defines Measurements used for MDT in LTE in the trace. + See 3GPP TS 32.422 for further description of the values. It shall comply with the + provisions defined in table 5.6.3.5-1. + + MeasurementNrForMdt: + anyOf: + - type: string + enum: + - M1 + - M2 + - M3 + - M4_DL + - M4_UL + - M5_DL + - M5_UL + - M6_DL + - M6_UL + - M7_DL + - M7_UL + - M8 + - M9 + - type: string + description: > + The enumeration MeasurementNrForMdt defines Measurements used for MDT in NR in the trace. + See 3GPP TS 32.422 for further description of the values. It shall comply with the provisions + defined in table 5.6.3.6-1. + + SensorMeasurement: + anyOf: + - type: string + enum: + - BAROMETRIC_PRESSURE + - UE_SPEED + - UE_ORIENTATION + - type: string + description: > + The enumeration SensorMeasurement defines sensor measurement type for MDT in the trace. See 3GPP + TS 32.422 for further description of the values. It shall comply with the provisions defined + in table 5.6.3.7-1. + + ReportingTrigger: + anyOf: + - type: string + enum: + - PERIODICAL + - EVENT_A2 + - EVENT_A2_PERIODIC + - ALL_RRM_EVENT_TRIGGERS + - type: string + description: > + The enumeration ReportingTrigger defines Reporting Triggers for MDT in the trace. See 3GPP + TS 32.42] for further description of the values. It shall comply with the provisions + defined in table 5.6.3.8-1. + + ReportIntervalMdt: + anyOf: + - type: string + enum: + - 120 + - 240 + - 480 + - 640 + - 1024 + - 2048 + - 5120 + - 10240 + - 60000 + - 360000 + - 720000 + - 1800000 + - 3600000 + - type: string + description: > + The enumeration ReportIntervalMdt defines Report Interval for MDT in the trace. See 3GPP + TS 32.422 for further description of the values. It shall comply with + the provisions defined in table 5.6.3.9-1. + + ReportAmountMdt: + anyOf: + - type: string + enum: + - 1 + - 2 + - 4 + - 8 + - 16 + - 32 + - 64 + - infinity + - type: string + description: > + The enumeration ReportAmountMdt defines Report Amount for MDT in the trace. See 3GPP + TS 32.422 for further description of the values. It shall comply with the provisions + defined in table 5.6.3.10-1. + + EventForMdt: + anyOf: + - type: string + enum: + - OUT_OF_COVERAG + - A2_EVENT + - type: string + description: > + The enumeration EventForMdt defines events triggered measurement for logged MDT in the + trace. See 3GPP TS 32.422 for further description of the values. It shall comply with + the provisions defined in table 5.6.3.11-1 + + LoggingIntervalMdt: + anyOf: + - type: string + enum: + - 128 + - 256 + - 512 + - 1024 + - 2048 + - 3072 + - 4096 + - 6144 + - type: string + description: > + The enumeration LoggingIntervalMdt defines Logging Interval for MDT in the trace. See 3GPP + TS 32.422 for further description of the values. It shall comply with the provisions + defined in table 5.6.3.12-1. + + LoggingDurationMdt: + anyOf: + - type: string + enum: + - 600 + - 1200 + - 2400 + - 3600 + - 5400 + - 7200 + - type: string + description: > + The enumeration LoggingIntervalMdt defines Logging Interval for MDT in the trace. See 3GPP + TS 32.422 for further description of the values. It shall comply with the provisions + defined in table 5.6.3.12-1. + + PositioningMethodMdt: + anyOf: + - type: string + enum: + - GNSS + - E_CELL_ID + - type: string + description: > + The enumeration LoggingDurationMdt defines Logging Duration for MDT in the trace. See 3GPP + TS 32.422 for further description of the values. It shall comply with the provisions + defined in table 5.6.3.13-1. + + CollectionPeriodRmmLteMdt: + anyOf: + - type: string + enum: + - 1024 + - 1280 + - 2048 + - 2560 + - 5120 + - 10240 + - 60000 + - type: string + description: > + The enumeration CollectionPeriodRmmLteMdt defines Collection period for RRM measurements + LTE for MDT in the trace. See 3GPP TS 32.422 for further description of the values. It shall + comply with the provisions defined in table 5.6.3.15-1. + + MeasurementPeriodLteMdt: + anyOf: + - type: string + enum: + - 1024 + - 1280 + - 2048 + - 2560 + - 5120 + - 10240 + - 60000 + - type: string + description: > + The enumeration MeasurementPeriodLteMdt defines Measurement period LTE for MDT in the trace. + See 3GPP TS 32.422 for further description of the values. It shall comply with the + provisions defined in table 5.6.3.16-1. + + ReportIntervalNrMdt: + anyOf: + - type: string + enum: + - 120 + - 240 + - 480 + - 640 + - 1024 + - 2048 + - 5120 + - 10240 + - 20480 + - 40960 + - 60000 + - 360000 + - 720000 + - 1800000 + - 3600000 + - type: string + description: > + The enumeration ReportIntervalNrMdt defines Report Interval in NR for MDT in the trace. See + 3GPP TS 32.422 for further description of the values. It shall comply with the provisions + defined in table 5.6.3.17-1. + + LoggingIntervalNrMdt: + anyOf: + - type: string + enum: + - 128 + - 256 + - 512 + - 1024 + - 2048 + - 3072 + - 4096 + - 6144 + - 320 + - 640 + - infinity + - type: string + description: > + The enumeration LoggingIntervalNrMdt defines Logging Interval in NR for MDT in the trace. + See 3GPP TS 32.422 for further description of the values. It shall comply with the + provisions defined in table 5.6.3.18-1. + + CollectionPeriodRmmNrMdt: + anyOf: + - type: string + enum: + - 1024 + - 2048 + - 5120 + - 10240 + - 60000 + - type: string + description: > + The enumeration CollectionPeriodRmmNrMdt defines Collection period for RRM measurements NR for MDT in the trace. + See 3GPP TS 32.422 for further description of the values. It shall comply with the provisions defined in table 5.6.3.19-1 + + LoggingDurationNrMdt: + anyOf: + - type: string + enum: + - 600 + - 1200 + - 2400 + - 3600 + - 5400 + - 7200 + - type: string + description: > + The enumeration LoggingDurationMdt defines Logging Duration in NR for MDT in the trace. See + 3GPP TS 32.422 for further description of the values. It shall comply with the provisions + defined in table 5.6.3.20-1. +# +# STRUCTURED DATA TYPES +# + TraceData: + description: contains Trace control and configuration parameters. + type: object + nullable: true + properties: + traceRef: + type: string + pattern: '^[0-9]{3}[0-9]{2,3}-[A-Fa-f0-9]{6}$' + description: > + Trace Reference (see 3GPP TS 32.422).It shall be encoded as the concatenation of MCC, + MNC and Trace ID as follows: 'MCC' + List of NE Types (see 3GPP TS 32.422).It shall be encoded as an octet string in + hexadecimal representation. + Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" + and shall represent 4 bits. + The most significant character representing the 4 most significant bits shall appear + first in the string, and the character representing the + 4 least significant bit shall appear last in the string.Octets shall be coded + according to 3GPP TS 32.422. + eventList: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + Triggering events (see 3GPP TS 32.422).It shall be encoded as an octet string in + hexadecimal representation. Each character in the string shall take a value of "0" + to "9", "a" to "f" or "A" to "F" and shall represent 4 bits. + The most significant character representing the 4 most significant bits shall appear + first in the string, and the character representing the 4 least significant bit shall + appear last in the string. Octets shall be coded according to 3GPP TS 32.422. + collectionEntityIpv4Addr: + $ref: '#/components/schemas/Ipv4Addr' + collectionEntityIpv6Addr: + $ref: '#/components/schemas/Ipv6Addr' + interfaceList: + type: string + pattern: '^[A-Fa-f0-9]+$' + description: > + List of Interfaces (see 3GPP TS 32.422).It shall be encoded as an octet string in + hexadecimal representation. + Each character in the string shall take a value of "0" to "9", "a" to "f" or "A" to "F" + and shall represent 4 bits. The most significant character representing the 4 most + significant bits shall appear first in the string, and the character representing the + 4 least significant bit shall appear last in the string. Octets shall be coded + according to 3GPP TS 32.422. If this attribute is not present, all the interfaces + applicable to the list of NE types indicated in the neTypeList attribute should + be traced. + required: + - traceRef + - traceDepth + - neTypeList + - eventList + + MdtConfiguration: + description: contains contain MDT configuration data. + type: object + required: + - jobType + properties: + jobType: + $ref: '#/components/schemas/JobType' + reportType: + $ref: '#/components/schemas/ReportTypeMdt' + areaScope: + $ref: '#/components/schemas/AreaScope' + measurementLteList: + type: array + items: + $ref: '#/components/schemas/MeasurementLteForMdt' + measurementNrList: + type: array + items: + $ref: '#/components/schemas/MeasurementNrForMdt' + minItems: 1 + sensorMeasurementList: + type: array + items: + $ref: '#/components/schemas/SensorMeasurement' + minItems: 1 + reportingTriggerList: + type: array + items: + $ref: '#/components/schemas/ReportingTrigger' + minItems: 1 + reportInterval: + $ref: '#/components/schemas/ReportIntervalMdt' + reportIntervalNr: + $ref: '#/components/schemas/ReportIntervalNrMdt' + reportAmount: + $ref: '#/components/schemas/ReportAmountMdt' + eventThresholdRsrp: + type: integer + minimum: 0 + maximum: 97 + description: > + This IE shall be present if the report trigger parameter is configured for A2 event + reporting or A2 event triggered periodic reporting and the job type parameter is + configured for Immediate MDT or combined Immediate MDT and Trace in LTE. + When present, this IE shall indicate the Event Threshold for RSRP, and the value shall + be between 0-97. + + eventThresholdRsrpNr: + type: integer + minimum: 0 + maximum: 127 + description: > + This IE shall be present if the report trigger parameter is configured for A2 event + reporting or A2 event triggered periodic reporting and the job type parameter is + configured for Immediate MDT or combined Immediate MDT + and Trace in NR. When present, + this IE shall indicate the Event Threshold for RSRP, and the value shall be + between 0-127. + eventThresholdRsrq: + type: integer + minimum: 0 + maximum: 34 + description: > + This IE shall be present if the report trigger parameter is configured for A2 event + reporting or A2 event triggered periodic reporting and the job type parameter is + configured for Immediate MDT or combined Immediate MDT and Trace in LTE.When present, + this IE shall indicate the Event Threshold for RSRQ, and the value shall be + between 0-34. + eventThresholdRsrqNr: + type: integer + minimum: 0 + maximum: 127 + description: > + This IE shall be present if the report trigger parameter is configured for A2 event + reporting or A2 event triggered periodic reporting and the job type parameter is + configured for Immediate MDT or combined Immediate MDT and Trace in NR.When present, + this IE shall indicate the Event Threshold for RSRQ, and the value shall be + between 0-127. + eventList: + type: array + items: + $ref: '#/components/schemas/EventForMdt' + minItems: 1 + loggingInterval: + $ref: '#/components/schemas/LoggingIntervalMdt' + loggingIntervalNr: + $ref: '#/components/schemas/LoggingIntervalNrMdt' + loggingDuration: + $ref: '#/components/schemas/LoggingDurationMdt' + loggingDurationNr: + $ref: '#/components/schemas/LoggingDurationNrMdt' + positioningMethod: + $ref: '#/components/schemas/PositioningMethodMdt' + addPositioningMethodList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodMdt' + minItems: 1 + collectionPeriodRmmLte: + $ref: '#/components/schemas/CollectionPeriodRmmLteMdt' + collectionPeriodRmmNr: + $ref: '#/components/schemas/CollectionPeriodRmmNrMdt' + measurementPeriodLte: + $ref: '#/components/schemas/MeasurementPeriodLteMdt' + mdtAllowedPlmnIdList: + type: array + items: + $ref: '#/components/schemas/PlmnId' + minItems: 1 + maxItems: 16 + mbsfnAreaList: + type: array + items: + $ref: '#/components/schemas/MbsfnArea' + minItems: 1 + maxItems: 8 + interFreqTargetList: + type: array + items: + $ref: '#/components/schemas/InterFreqTargetInfo' + minItems: 1 + maxItems: 8 + + AreaScope: + description: Contain the area based on Cells or Tracking Areas. + type: object + properties: + eutraCellIdList: + type: array + items: + $ref: '#/components/schemas/EutraCellId' + minItems: 1 + nrCellIdList: + type: array + items: + $ref: '#/components/schemas/NrCellId' + minItems: 1 + tacList: + type: array + items: + $ref: '#/components/schemas/Tac' + minItems: 1 + tacInfoPerPlmn: + type: object + additionalProperties: + $ref: '#/components/schemas/TacInfo' + minProperties: 1 + description: > + A map (list of key-value pairs) where PlmnId converted to a string serves as key + + TacInfo: + description: contains tracking area information (tracking area codes). + type: object + required: + - tacList + properties: + tacList: + type: array + items: + $ref: '#/components/schemas/Tac' + minItems: 1 + + MbsfnArea: + description: Contains an MBSFN area information. + type: object + properties: + mbsfnAreaId: + type: integer + minimum: 0 + maximum: 255 + description: This IE shall contain the MBSFN Area ID. + carrierFrequency: + type: integer + minimum: 0 + maximum: 262143 + description: When present, this IE shall contain the Carrier Frequency (EARFCN). + + InterFreqTargetInfo: + description: Indicates the Inter Frequency Target information. + required: + - dlCarrierFreq + type: object + properties: + dlCarrierFreq: + $ref: '#/components/schemas/ArfcnValueNR' + cellIdList: + type: array + items: + $ref: '#/components/schemas/PhysCellId' + minItems: 1 + maxItems: 32 + description: > + When present, this IE shall contain a list of the physical cell identities where the + UE is requested to perform measurement logging for the indicated frequency. + + +# Data Types related to 5G ODB as defined in clause 5.7 + +# +# SIMPLE DATA TYPES +# +# +# +# Enumerations +# + RoamingOdb: + anyOf: + - type: string + enum: + - OUTSIDE_HOME_PLMN + - OUTSIDE_HOME_PLMN_COUNTRY + - type: string + description: > + The enumeration RoamingOdb defines the Barring of Roaming as. See 3GPP TS 23.015 for further + description. It shall comply with the provisions defined in table 5.7.3.1-1. + + OdbPacketServices: + anyOf: + - anyOf: + - type: string + enum: + - ALL_PACKET_SERVICES + - ROAMER_ACCESS_HPLMN_AP + - ROAMER_ACCESS_VPLMN_AP + - type: string + - $ref: '#/components/schemas/NullValue' + description: > + The enumeration OdbPacketServices defines the Barring of Packet Oriented Services. + See 3GPP TS 23.015 for further description. It shall comply with the provisions defined + in table 5.7.3.2-1 + +# +# STRUCTURED DATA TYPES +# + + OdbData: + description: Contains information regarding operater determined barring. + type: object + properties: + roamingOdb: + $ref: '#/components/schemas/RoamingOdb' + +# +# Data Types related to Charging as defined in clause 5.8 +# + +# +# SIMPLE DATA TYPES +# +# + ChargingId: + deprecated: true + type: integer + minimum: 0 + maximum: 4294967295 #(2^32)-1 + description: > + Integer where the allowed values correspond to the value range of an unsigned 32-bit + integer. + + + ApplicationChargingId: + type: string + description: Application provided charging identifier allowing correlation of charging information. + + RatingGroup: + $ref: '#/components/schemas/Uint32' + + ServiceId: + $ref: '#/components/schemas/Uint32' + + +# +# Enumerations +# + +# +# STRUCTURED DATA TYPES +# + SecondaryRatUsageReport: + description: Secondary RAT Usage Report to report usage data for a secondary RAT for QoS flows. + type: object + properties: + secondaryRatType: + $ref: '#/components/schemas/RatType' + qosFlowsUsageData: + type: array + items: + $ref: '#/components/schemas/QosFlowUsageReport' + minItems: 1 + required: + - secondaryRatType + - qosFlowsUsageData + + QosFlowUsageReport: + description: Contains QoS flows usage data information. + type: object + properties: + qfi: + $ref: '#/components/schemas/Qfi' + startTimeStamp: + $ref: '#/components/schemas/DateTime' + endTimeStamp: + $ref: '#/components/schemas/DateTime' + downlinkVolume: + $ref: '#/components/schemas/Int64' + uplinkVolume: + $ref: '#/components/schemas/Int64' + required: + - qfi + - startTimeStamp + - endTimeStamp + - downlinkVolume + - uplinkVolume + + SecondaryRatUsageInfo: + description: > + Secondary RAT Usage Information to report usage data for a secondary RAT for QoS flows + and/or the whole PDU session. + type: object + properties: + secondaryRatType: + $ref: '#/components/schemas/RatType' + qosFlowsUsageData: + type: array + items: + $ref: '#/components/schemas/QosFlowUsageReport' + minItems: 1 + pduSessionUsageData: + type: array + items: + $ref: '#/components/schemas/VolumeTimedReport' + minItems: 1 + required: + - secondaryRatType + + VolumeTimedReport: + description: Contains Usage data information. + type: object + properties: + startTimeStamp: + $ref: '#/components/schemas/DateTime' + endTimeStamp: + $ref: '#/components/schemas/DateTime' + downlinkVolume: + $ref: '#/components/schemas/Int64' + uplinkVolume: + $ref: '#/components/schemas/Int64' + required: + - startTimeStamp + - endTimeStamp + - downlinkVolume + - uplinkVolume + + +# Data Types related to MBS as defined in clause 5.9 +# + +# +# SIMPLE DATA TYPES +# +# + + AreaSessionId: + $ref: '#/components/schemas/Uint16' + + MbsFsaId: + description: MBS Frequency Selection Area Identifier + type: string + pattern: '^[A-Fa-f0-9]{6}$' + + + +# +# Enumerations +# +# + MbsServiceType: + description: Indicates the MBS service type of an MBS session + anyOf: + - type: string + enum: + - MULTICAST + - BROADCAST + - type: string + + MbsSessionActivityStatus: + description: Indicates the MBS session's activity status + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + + MbsSessionEventType: + description: MBS Session Event Type + anyOf: + - type: string + enum: + - MBS_REL_TMGI_EXPIRY + - BROADCAST_DELIVERY_STATUS + - INGRESS_TUNNEL_ADD_CHANGE + - type: string + + BroadcastDeliveryStatus: + description: Broadcast MBS Session's Delivery Status + anyOf: + - type: string + enum: + - STARTED + - TERMINATED + - type: string + +# +# STRUCTURED DATA TYPES +# + MbsSessionId: + description: MBS Session Identifier + type: object + properties: + tmgi: + $ref: '#/components/schemas/Tmgi' + ssm: + $ref: '#/components/schemas/Ssm' + nid: + $ref: '#/components/schemas/Nid' + anyOf: + - required: [ tmgi ] + - required: [ ssm ] + + Tmgi: + description: Temporary Mobile Group Identity + type: object + properties: + mbsServiceId: + type: string + pattern: '^[A-Fa-f0-9]{6}$' + description: MBS Service ID + plmnId: + $ref: '#/components/schemas/PlmnId' + required: + - mbsServiceId + - plmnId + + Ssm: + description: Source specific IP multicast address + type: object + properties: + sourceIpAddr: + $ref: '#/components/schemas/IpAddr' + destIpAddr: + $ref: '#/components/schemas/IpAddr' + required: + - sourceIpAddr + - destIpAddr + + MbsServiceArea: + description: MBS Service Area + type: object + properties: + ncgiList: + type: array + items: + $ref: '#/components/schemas/NcgiTai' + minItems: 1 + description: List of NR cell Ids + taiList: + type: array + items: + $ref: '#/components/schemas/Tai' + minItems: 1 + description: List of tracking area Ids + anyOf: + - required: [ ncgiList ] + - required: [ taiList ] + + NcgiTai: + description: List of NR cell ids, with their pertaining TAIs + type: object + properties: + tai: + $ref: '#/components/schemas/Tai' + cellList: + type: array + items: + $ref: '#/components/schemas/Ncgi' + minItems: 1 + description: List of List of NR cell ids + required: + - tai + - cellList + + MbsSession: + description: Individual MBS session + type: object + properties: + mbsSessionId: + $ref: '#/components/schemas/MbsSessionId' + tmgiAllocReq: + type: boolean + default: false + writeOnly: true + tmgi: + $ref: '#/components/schemas/Tmgi' + readOnly: true + expirationTime: + $ref: '#/components/schemas/DateTime' + readOnly: true + serviceType: + $ref: '#/components/schemas/MbsServiceType' + writeOnly: true + locationDependent: + type: boolean + default: false + areaSessionId: + $ref: '#/components/schemas/AreaSessionId' + readOnly: true + ingressTunAddrReq: + type: boolean + default: false + writeOnly: true + ingressTunAddr: + type: array + items: + $ref: '#/components/schemas/TunnelAddress' + minItems: 1 + readOnly: true + ssm: + $ref: '#/components/schemas/Ssm' + writeOnly: true + mbsServiceArea: + $ref: '#/components/schemas/MbsServiceArea' + writeOnly: true + extMbsServiceArea: + $ref: '#/components/schemas/ExternalMbsServiceArea' + writeOnly: true + dnn: + $ref: '#/components/schemas/Dnn' + writeOnly: true + snssai: + $ref: '#/components/schemas/Snssai' + writeOnly: true + activationTime: + deprecated: true + format: date-time + type: string + startTime: + $ref: '#/components/schemas/DateTime' + terminationTime: + $ref: '#/components/schemas/DateTime' + mbsServInfo: + $ref: '#/components/schemas/MbsServiceInfo' + mbsSessionSubsc: + $ref: '#/components/schemas/MbsSessionSubscription' + activityStatus: + $ref: '#/components/schemas/MbsSessionActivityStatus' + anyUeInd: + type: boolean + default: false + writeOnly: true + mbsFsaIdList: + type: array + items: + $ref: '#/components/schemas/MbsFsaId' + minItems: 1 + required: + - serviceType + anyOf: + - required: [ mbsSessionId ] + - required: [ tmgiAllocReq ] + + + MbsSessionSubscription: + description: MBS session subscription + type: object + properties: + mbsSessionId: + $ref: '#/components/schemas/MbsSessionId' + areaSessionId: + $ref: '#/components/schemas/AreaSessionId' + eventList: + type: array + items: + $ref: '#/components/schemas/MbsSessionEvent' + minItems: 1 + notifyUri: + $ref: '#/components/schemas/Uri' + notifyCorrelationId: + type: string + expiryTime: + $ref: '#/components/schemas/DateTime' + nfcInstanceId: + $ref: '#/components/schemas/NfInstanceId' + mbsSessionSubscUri: + $ref: '#/components/schemas/Uri' + readOnly: true + required: + - eventList + - notifyUri + + MbsSessionEventReportList: + description: MBS session event report list + type: object + properties: + eventReportList: + type: array + items: + $ref: '#/components/schemas/MbsSessionEventReport' + minItems: 1 + notifyCorrelationId: + type: string + required: + - eventReportList + + MbsSessionEvent: + description: MBS session event + type: object + properties: + eventType: + $ref: '#/components/schemas/MbsSessionEventType' + required: + - eventType + + MbsSessionEventReport: + description: MBS session event report + type: object + properties: + eventType: + $ref: '#/components/schemas/MbsSessionEventType' + timeStamp: + $ref: '#/components/schemas/DateTime' + ingressTunAddrInfo: + $ref: '#/components/schemas/IngressTunAddrInfo' + broadcastDelStatus: + $ref: '#/components/schemas/BroadcastDeliveryStatus' + required: + - eventType + + ExternalMbsServiceArea: + description: List of geographic area or list of civic address info for MBS Service Area + type: object + properties: + geographicAreaList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/GeographicArea' + minItems: 1 + civicAddressList: + type: array + items: + $ref: 'TS29572_Nlmf_Location.yaml#/components/schemas/CivicAddress' + minItems: 1 + oneOf: + - required: [ geographicAreaList ] + - required: [ civicAddressList ] + + + MbsSecurityContext: + type: object + properties: + keyList: + description: A map (list of key-value pairs) where a (unique) valid JSON string serves as key of MbsSecurityContext + type: object + additionalProperties: + $ref: '#/components/schemas/MbsKeyInfo' + minProperties: 1 + required: + - keyList + + MbsKeyInfo: + description: MBS Security Key Data Structure + type: object + properties: + keyDomainId: + $ref: '#/components/schemas/Bytes' + mskId: + $ref: '#/components/schemas/Bytes' + msk: + $ref: '#/components/schemas/Bytes' + mskLifetime: + $ref: '#/components/schemas/DateTime' + mtkId: + $ref: '#/components/schemas/Bytes' + mtk: + $ref: '#/components/schemas/Bytes' + required: + - keyDomainId + - mskId + + IngressTunAddrInfo: + description: Ingress Tunnel Address Information + type: object + properties: + ingressTunAddr: + type: array + items: + $ref: '#/components/schemas/TunnelAddress' + minItems: 1 + required: + - ingressTunAddr + + + MbsServiceAreaInfo: + description: MBS Service Area Information for location dependent MBS session + type: object + properties: + areaSessionId: + $ref: '#/components/schemas/AreaSessionId' + mbsServiceArea: + $ref: '#/components/schemas/MbsServiceArea' + required: + - areaSessionId + - mbsServiceArea + + MbsServiceInfo: + description: Represent MBS Service Information. + type: object + properties: + mbsMediaComps: + type: object + additionalProperties: + $ref: '#/components/schemas/MbsMediaCompRm' + minProperties: 1 + mbsSdfResPrio: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ReservPriority' + afAppId: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/AfAppId' + mbsSessionAmbr: + $ref: '#/components/schemas/BitRate' + required: + - mbsMediaComps + + MbsMediaComp: + description: Represents an MBS Media Component. + type: object + properties: + mbsMedCompNum: + type: integer + mbsFlowDescs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/FlowDescription' + minItems: 1 + mbsSdfResPrio: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/ReservPriority' + mbsMediaInfo: + $ref: '#/components/schemas/MbsMediaInfo' + qosRef: + type: string + mbsQoSReq: + $ref: '#/components/schemas/MbsQoSReq' + required: + - mbsMedCompNum + + MbsMediaCompRm: + description: > + This data type is defined in the same way as the MbsMediaComp data type, but with the + OpenAPI nullable property set to true. + anyOf: + - $ref: '#/components/schemas/MbsMediaComp' + - $ref: '#/components/schemas/NullValue' + + MbsQoSReq: + description: Represent MBS QoS requirements. + type: object + properties: + 5qi: + $ref: '#/components/schemas/5Qi' + guarBitRate: + $ref: '#/components/schemas/BitRate' + maxBitRate: + $ref: '#/components/schemas/BitRate' + averWindow: + $ref: '#/components/schemas/AverWindow' + reqMbsArp: + $ref: '#/components/schemas/Arp' + required: + - 5qi + + MbsMediaInfo: + description: Represent MBS Media Information. + type: object + properties: + mbsMedType: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/MediaType' + maxReqMbsBwDl: + $ref: '#/components/schemas/BitRate' + minReqMbsBwDl: + $ref: '#/components/schemas/BitRate' + codecs: + type: array + items: + $ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/CodecData' + minItems: 1 + maxItems: 2 + +# +# HTTP responses +# + + responses: + '307': + description: Temporary Redirect + content: + application/json: + schema: + $ref: '#/components/schemas/RedirectResponse' + headers: + Location: + description: 'The URI pointing to the resource located on the redirect target' + required: true + schema: + type: string + 3gpp-Sbi-Target-Nf-Id: + description: 'Identifier of target NF (service) instance towards which the request is redirected' + schema: + type: string + '308': + description: Permanent Redirect + content: + application/json: + schema: + $ref: '#/components/schemas/RedirectResponse' + headers: + Location: + description: 'The URI pointing to the resource located on the redirect target' + required: true + schema: + type: string + 3gpp-Sbi-Target-Nf-Id: + description: > + 'Identifier of target NF (service) instance towards which the request is redirected' + schema: + type: string + '400': + description: Bad request + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '401': + description: Unauthorized + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '405': + description: Method Not Allowed + '408': + description: Request Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '406': + description: 406 Not Acceptable + '409': + description: Conflict + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '410': + description: Gone + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '411': + description: Length Required + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '412': + description: Precondition Failed + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '413': + description: Payload Too Large + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '414': + description: URI Too Long + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '415': + description: Unsupported Media Type + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '429': + description: Too Many Requests + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '500': + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '501': + description: Not Implemented + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '502': + description: Bad Gateway + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '503': + description: Service Unavailable + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '504': + description: Gateway Timeout + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + default: + description: Generic Error diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29572_Nlmf_Broadcast.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29572_Nlmf_Broadcast.yaml new file mode 100644 index 000000000..e8162f026 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29572_Nlmf_Broadcast.yaml @@ -0,0 +1,245 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'LMF Broadcast' + description: | + LMF Broadcast Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.572 V17.5.0; 5G System; Location Management Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.572/' + +servers: + - url: '{apiRoot}/nlmf-broadcast/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +paths: + /cipher-key-data: + post: + summary: Request ciphering key data + operationId: CipheringKeyData + tags: + - Request Ciphering Key Data + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CipherRequestData' + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CipherResponseData' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + CipheringKeyData: + '{$request.body#/amfCallBackURI}': + post: + requestBody: + description: Ciphering Key Data Notification + content: + application/json: + schema: + $ref: '#/components/schemas/CipheringKeyInfo' + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/CipheringKeyResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: +# +# COMPLEX TYPES +# + CipheringKeyInfo: + description: Information within Ciphering Key Data Notification request. + type: object + required: + - cipheringData + properties: + cipheringData: + type: array + items: + $ref: '#/components/schemas/CipheringDataSet' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + CipheringKeyResponse: + description: Information within Ciphering Key Data Notification Response. + type: object + properties: + cipheringDataReport: + type: array + items: + $ref: '#/components/schemas/CipheringSetReport' + minItems: 1 + + CipheringDataSet: + description: Represents a Ciphering Data Set. + type: object + required: + - cipheringSetID + - cipheringKey + - c0 + - validityStartTime + - validityDuration + properties: + cipheringSetID: + $ref: '#/components/schemas/CipheringSetID' + cipheringKey: + $ref: '#/components/schemas/CipheringKey' + c0: + $ref: '#/components/schemas/C0' + ltePosSibTypes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + nrPosSibTypes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + validityStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + validityDuration: + $ref: '#/components/schemas/ValidityDuration' + taiList: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + + CipheringSetReport: + description: Represents a report of Ciphering Data Set storage. + type: object + required: + - cipheringSetID + - storageOutcome + properties: + cipheringSetID: + $ref: '#/components/schemas/CipheringSetID' + storageOutcome: + $ref: '#/components/schemas/StorageOutcome' + + CipherRequestData: + description: Information within Ciphering Key Data request. + type: object + required: + - amfCallBackURI + properties: + amfCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + CipherResponseData: + description: Information within Ciphering Key Data Response. + type: object + required: + - dataAvailability + properties: + dataAvailability: + $ref: '#/components/schemas/DataAvailability' +# +# +# SIMPLE TYPES +# + CipheringSetID: + description: Ciphering Data Set Identifier. + type: integer + minimum: 0 + maximum: 65535 + + CipheringKey: + description: Ciphering Key. + format: byte + type: string + + C0: + description: First component of the initial ciphering counter. + format: byte + type: string + + ValidityDuration: + description: Validity Duration of the Ciphering Data Set. + type: integer + minimum: 1 + maximum: 65535 +# +# ENUMS +# + StorageOutcome: + description: Indicates the result of Ciphering Data Set storage. + anyOf: + - type: string + enum: + - STORAGE_SUCCESSFUL + - STORAGE_FAILED + + DataAvailability: + description: Indicates availability of ciphering key data at an LMF. + anyOf: + - type: string + enum: + - CIPHERING_KEY_DATA_AVAILABLE + - CIPHERING_KEY_DATA_NOT_AVAILABLE diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29572_Nlmf_Location.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29572_Nlmf_Location.yaml new file mode 100644 index 000000000..cbc24e8c3 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29572_Nlmf_Location.yaml @@ -0,0 +1,1546 @@ +openapi: 3.0.0 + +info: + version: '1.2.2' + title: 'LMF Location' + description: | + LMF Location Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +externalDocs: + description: 3GPP TS 29.572 V17.7.0; 5G System; Location Management Services; Stage 3 + url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.572/' + +servers: + - url: '{apiRoot}/nlmf-loc/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501 + +security: + - {} + - oAuth2ClientCredentials: + - nlmf-loc + +paths: + /determine-location: + post: + summary: Determine Location of an UE + operationId: DetermineLocation + tags: + - Determine Location + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InputData' + multipart/related: # message with binary body part(s) + schema: + type: object + properties: # Request parts + jsonData: + $ref: '#/components/schemas/InputData' + binaryDataLppMessage: + type: string + format: binary + encoding: + jsonData: + contentType: application/json + binaryDataLppMessage: + contentType: application/vnd.3gpp.lpp + headers: + Content-Id: + schema: + type: string + binaryDataLppMessageExt1: + contentType: application/vnd.3gpp.lpp + headers: + Content-Id: + schema: + type: string + binaryDataLppMessageExt2: + contentType: application/vnd.3gpp.lpp + headers: + Content-Id: + schema: + type: string + required: true + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/LocationData' + '204': + description: Expected response for MO-LR requesting location assistance data. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + EventNotify: + '{$request.body#/hgmlcCallBackURI}': + post: + requestBody: + description: UE Event Notification + content: + application/json: + schema: + $ref: '#/components/schemas/EventNotifyData' + responses: + '204': + description: Expected response to a valid notification + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /cancel-location: + post: + summary: request cancellation of periodic or triggered location + operationId: CancelLocation + tags: + - Cancel Location + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CancelLocData' + required: true + responses: + '204': + description: Expected response to a successful cancellation + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + /location-context-transfer: + post: + summary: transfer context information for periodic or triggered location + operationId: LocationContextTransfer + tags: + - Location Context Transfer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LocContextData' + required: true + responses: + '204': + description: Expected response to successful location context transfer + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + '504': + $ref: 'TS29571_CommonData.yaml#/components/responses/504' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nlmf-loc: Access to the Nlmf_Location API + schemas: +# +# COMPLEX TYPES +# + InputData: + description: Information within Determine Location Request. + type: object + not: + required: [ ecgi, ncgi ] + properties: + externalClientType: + $ref: '#/components/schemas/ExternalClientType' + correlationID: + $ref: '#/components/schemas/CorrelationID' + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + locationQoS: + $ref: '#/components/schemas/LocationQoS' + supportedGADShapes: + type: array + items: + $ref: '#/components/schemas/SupportedGADShapes' + minItems: 1 + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + pei: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ecgiOnSecondNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ncgiOnSecondNode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + priority: + $ref: '#/components/schemas/LcsPriority' + velocityRequested: + $ref: '#/components/schemas/VelocityRequested' + ueLcsCap: + $ref: '#/components/schemas/UeLcsCapability' + lcsServiceType: + $ref: '#/components/schemas/LcsServiceType' + ldrType: + $ref: '#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + vgmlcAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + periodicEventInfo: + $ref: '#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: '#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: '#/components/schemas/MotionEventInfo' + reportingAccessTypes: + type: array + items: + $ref: '#/components/schemas/ReportingAccessType' + minItems: 1 + ueConnectivityStates: + $ref: '#/components/schemas/UeConnectivityState' + ueLocationServiceInd: + $ref: '#/components/schemas/UeLocationServiceInd' + moAssistanceDataTypes: + $ref: 'TS29503_Nudm_SDM.yaml#/components/schemas/LcsBroadcastAssistanceTypesData' + lppMessage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + lppMessageExt: + description: Indicates the lpp message extension. + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + uePositioningCap: + $ref: '#/components/schemas/UePositioningCapabilities' + tnapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TnapId' + twapId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TwapId' + ueCountryDetInd: + type: boolean + scheduledLocTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + reliableLocReq: + type: boolean + default: false + + LocationData: + description: Information within Determine Location Response. + type: object + required: + - locationEstimate + properties: + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + accuracyFulfilmentIndicator: + $ref: '#/components/schemas/AccuracyFulfilmentIndicator' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + civicAddress: + $ref: '#/components/schemas/CivicAddress' + localLocationEstimate: + $ref: '#/components/schemas/LocalArea' + positioningDataList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodAndUsage' + minItems: 1 + gnssPositioningDataList: + type: array + items: + $ref: '#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 1 + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + altitude: + $ref: '#/components/schemas/Altitude' + barometricPressure: + $ref: '#/components/schemas/BarometricPressure' + servingLMFIdentification: + $ref: '#/components/schemas/LMFIdentification' + uePositioningCap: + $ref: '#/components/schemas/UePositioningCapabilities' + ueAreaInd: + $ref: '#/components/schemas/UeAreaIndication' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + achievedQos: + $ref: '#/components/schemas/MinorLocationQoS' + + GeographicArea: + description: Geographic area specified by different shape. + anyOf: + - $ref: '#/components/schemas/Point' + - $ref: '#/components/schemas/PointUncertaintyCircle' + - $ref: '#/components/schemas/PointUncertaintyEllipse' + - $ref: '#/components/schemas/Polygon' + - $ref: '#/components/schemas/PointAltitude' + - $ref: '#/components/schemas/PointAltitudeUncertainty' + - $ref: '#/components/schemas/EllipsoidArc' + + GADShape: + description: Common base type for GAD shapes. + type: object + required: + - shape + properties: + shape: + $ref: '#/components/schemas/SupportedGADShapes' + discriminator: + propertyName: shape + mapping: + POINT: '#/components/schemas/Point' + POINT_UNCERTAINTY_CIRCLE: '#/components/schemas/PointUncertaintyCircle' + POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/PointUncertaintyEllipse' + POLYGON: '#/components/schemas/Polygon' + POINT_ALTITUDE: '#/components/schemas/PointAltitude' + POINT_ALTITUDE_UNCERTAINTY: '#/components/schemas/PointAltitudeUncertainty' + ELLIPSOID_ARC: '#/components/schemas/EllipsoidArc' + LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE: '#/components/schemas/Local2dPointUncertaintyEllipse' + LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID: '#/components/schemas/Local3dPointUncertaintyEllipsoid' + + Point: + description: Ellipsoid Point. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + + PointUncertaintyCircle: + description: Ellipsoid point with uncertainty circle. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - uncertainty + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertainty: + $ref: '#/components/schemas/Uncertainty' + + PointUncertaintyEllipse: + description: Ellipsoid point with uncertainty ellipse. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - uncertaintyEllipse + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + + Polygon: + description: Polygon. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - pointList + properties: + pointList: + $ref: '#/components/schemas/PointList' + + PointAltitude: + description: Ellipsoid point with altitude. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - altitude + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + + PointAltitudeUncertainty: + description: Ellipsoid point with altitude and uncertainty ellipsoid. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - altitude + - uncertaintyEllipse + - uncertaintyAltitude + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + altitude: + $ref: '#/components/schemas/Altitude' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + uncertaintyAltitude: + $ref: '#/components/schemas/Uncertainty' + confidence: + $ref: '#/components/schemas/Confidence' + + EllipsoidArc: + description: Ellipsoid Arc. + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - point + - innerRadius + - uncertaintyRadius + - offsetAngle + - includedAngle + - confidence + properties: + point: + $ref: '#/components/schemas/GeographicalCoordinates' + innerRadius: + $ref: '#/components/schemas/InnerRadius' + uncertaintyRadius: + $ref: '#/components/schemas/Uncertainty' + offsetAngle: + $ref: '#/components/schemas/Angle' + includedAngle: + $ref: '#/components/schemas/Angle' + confidence: + $ref: '#/components/schemas/Confidence' + + LocalOrigin: + description: Indicates a Local origin in a reference system + type: object + properties: + coordinateId: + type: string + point: + $ref: '#/components/schemas/GeographicalCoordinates' + + RelativeCartesianLocation: + description: Relative Cartesian Location + type: object + required: + - x + - y + properties: + x: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + y: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + z: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + + + LocalArea: + description: Local area specified by different shape + oneOf: + - $ref: '#/components/schemas/Local2dPointUncertaintyEllipse' + - $ref: '#/components/schemas/Local3dPointUncertaintyEllipsoid' + + UeAreaIndication: + description: Indicates area (country, area in a country or international area) where UE is located + type: object + oneOf: + - required: + - country + - required: + - internationalAreaInd + properties: + country: + description: Indicates country or area in a country where UE is located + type: string + internationalAreaInd: + description: Indicates international area indication if UE is located in international area + type: boolean + default: false + + Local2dPointUncertaintyEllipse: + description: Local 2D point with uncertainty ellipse + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - localOrigin + - point + - uncertaintyEllipse + - confidence + properties: + localOrigin: + $ref: '#/components/schemas/LocalOrigin' + point: + $ref: '#/components/schemas/RelativeCartesianLocation' + uncertaintyEllipse: + $ref: '#/components/schemas/UncertaintyEllipse' + confidence: + $ref: '#/components/schemas/Confidence' + + Local3dPointUncertaintyEllipsoid: + description: Local 3D point with uncertainty ellipsoid + allOf: + - $ref: '#/components/schemas/GADShape' + - type: object + required: + - localOrigin + - point + - uncertaintyEllipsoid + - confidence + properties: + localOrigin: + $ref: '#/components/schemas/LocalOrigin' + point: + $ref: '#/components/schemas/RelativeCartesianLocation' + uncertaintyEllipsoid: + $ref: '#/components/schemas/UncertaintyEllipsoid' + confidence: + $ref: '#/components/schemas/Confidence' + + GeographicalCoordinates: + description: Geographical coordinates. + type: object + required: + - lon + - lat + properties: + lon: + type: number + format: double + minimum: -180 + maximum: 180 + lat: + type: number + format: double + minimum: -90 + maximum: 90 + + UncertaintyEllipse: + description: Ellipse with uncertainty. + type: object + required: + - semiMajor + - semiMinor + - orientationMajor + properties: + semiMajor: + $ref: '#/components/schemas/Uncertainty' + semiMinor: + $ref: '#/components/schemas/Uncertainty' + orientationMajor: + $ref: '#/components/schemas/Orientation' + + UncertaintyEllipsoid: + description: Ellipsoid with uncertainty + type: object + required: + - semiMajor + - semiMinor + - vertical + - orientationMajor + properties: + semiMajor: + $ref: '#/components/schemas/Uncertainty' + semiMinor: + $ref: '#/components/schemas/Uncertainty' + vertical: + $ref: '#/components/schemas/Uncertainty' + orientationMajor: + $ref: '#/components/schemas/Orientation' + + PointList: + description: List of points. + type: array + items: + $ref: '#/components/schemas/GeographicalCoordinates' + minItems: 3 + maxItems: 15 + + LocationQoS: + description: QoS of Location request. + type: object + properties: + hAccuracy: + $ref: '#/components/schemas/Accuracy' + vAccuracy: + $ref: '#/components/schemas/Accuracy' + verticalRequested: + type: boolean + responseTime: + $ref: '#/components/schemas/ResponseTime' + minorLocQoses: + type: array + items: + $ref: '#/components/schemas/MinorLocationQoS' + minItems: 1 + maxItems: 2 + lcsQosClass: + $ref: '#/components/schemas/LcsQosClass' + + PositioningMethodAndUsage: + description: Indicates the usage of a positioning method. + type: object + required: + - method + - mode + - usage + properties: + method: + $ref: '#/components/schemas/PositioningMethod' + mode: + $ref: '#/components/schemas/PositioningMode' + usage: + $ref: '#/components/schemas/Usage' + methodCode: + type: integer + minimum: 16 + maximum: 31 + + GnssPositioningMethodAndUsage: + description: Indicates the usage of a Global Navigation Satellite System (GNSS) positioning method. + type: object + required: + - mode + - gnss + - usage + properties: + mode: + $ref: '#/components/schemas/PositioningMode' + gnss: + $ref: '#/components/schemas/GnssId' + usage: + $ref: '#/components/schemas/Usage' + + CivicAddress: + description: Indicates a Civic address. + type: object + properties: + country: + type: string + A1: + type: string + A2: + type: string + A3: + type: string + A4: + type: string + A5: + type: string + A6: + type: string + PRD: + type: string + POD: + type: string + STS: + type: string + HNO: + type: string + HNS: + type: string + LMK: + type: string + LOC: + type: string + NAM: + type: string + PC: + type: string + BLD: + type: string + UNIT: + type: string + FLR: + type: string + ROOM: + type: string + PLC: + type: string + PCN: + type: string + POBOX: + type: string + ADDCODE: + type: string + SEAT: + type: string + RD: + type: string + RDSEC: + type: string + RDBR: + type: string + RDSUBBR: + type: string + PRM: + type: string + POM: + type: string + usageRules: + type: string + method: + type: string + providedBy: + type: string + + VelocityEstimate: + description: Velocity estimate. + oneOf: + - $ref: '#/components/schemas/HorizontalVelocity' + - $ref: '#/components/schemas/HorizontalWithVerticalVelocity' + - $ref: '#/components/schemas/HorizontalVelocityWithUncertainty' + - $ref: '#/components/schemas/HorizontalWithVerticalVelocityAndUncertainty' + + HorizontalVelocity: + description: Horizontal velocity. + type: object + required: + - hSpeed + - bearing + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + + HorizontalWithVerticalVelocity: + description: Horizontal and vertical velocity. + type: object + required: + - hSpeed + - bearing + - vSpeed + - vDirection + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + vSpeed: + $ref: '#/components/schemas/VerticalSpeed' + vDirection: + $ref: '#/components/schemas/VerticalDirection' + + HorizontalVelocityWithUncertainty: + description: Horizontal velocity with speed uncertainty. + type: object + required: + - hSpeed + - bearing + - hUncertainty + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + hUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + + HorizontalWithVerticalVelocityAndUncertainty: + description: Horizontal and vertical velocity with speed uncertainty. + type: object + required: + - hSpeed + - bearing + - vSpeed + - vDirection + - hUncertainty + - vUncertainty + properties: + hSpeed: + $ref: '#/components/schemas/HorizontalSpeed' + bearing: + $ref: '#/components/schemas/Angle' + vSpeed: + $ref: '#/components/schemas/VerticalSpeed' + vDirection: + $ref: '#/components/schemas/VerticalDirection' + hUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + vUncertainty: + $ref: '#/components/schemas/SpeedUncertainty' + + UeLcsCapability: + description: Indicates the LCS capability supported by the UE.. + type: object + properties: + lppSupport: + type: boolean + default: true + ciotOptimisation: + type: boolean + default: false + + PeriodicEventInfo: + description: Indicates the information of periodic event reporting. + type: object + required: + - reportingAmount + - reportingInterval + properties: + reportingAmount: + $ref: '#/components/schemas/ReportingAmount' + reportingInterval: + $ref: '#/components/schemas/ReportingInterval' + + AreaEventInfo: + description: Indicates the information of area based event reporting. + type: object + required: + - areaDefinition + properties: + areaDefinition: + type: array + items: + $ref: '#/components/schemas/ReportingArea' + minItems: 1 + maxItems: 250 + occurrenceInfo: + $ref: '#/components/schemas/OccurrenceInfo' + minimumInterval: + $ref: '#/components/schemas/MinimumInterval' + maximumInterval: + $ref: '#/components/schemas/MaximumInterval' + samplingInterval: + $ref: '#/components/schemas/SamplingInterval' + reportingDuration: + $ref: '#/components/schemas/ReportingDuration' + reportingLocationReq: + type: boolean + default: true + + ReportingArea: + description: Indicates an area for event reporting. + type: object + required: + - areaType + properties: + areaType: + $ref: '#/components/schemas/ReportingAreaType' + tai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + + MotionEventInfo: + description: Indicates the information of motion based event reporting. + type: object + required: + - linearDistance + properties: + linearDistance: + $ref: '#/components/schemas/LinearDistance' + occurrenceInfo: + $ref: '#/components/schemas/OccurrenceInfo' + minimumInterval: + $ref: '#/components/schemas/MinimumInterval' + maximumInterval: + $ref: '#/components/schemas/MaximumInterval' + samplingInterval: + $ref: '#/components/schemas/SamplingInterval' + reportingDuration: + $ref: '#/components/schemas/ReportingDuration' + reportingLocationReq: + type: boolean + default: true + + CancelLocData: + description: Information within Cancel Location Request. + type: object + required: + - hgmlcCallBackURI + - ldrReference + properties: + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + LocContextData: + description: Information within Transfer Location Context Request. + type: object + required: + - amfId + - ldrType + - hgmlcCallBackURI + - ldrReference + - eventReportMessage + properties: + amfId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + locationQoS: + $ref: '#/components/schemas/LocationQoS' + supportedGADShapes: + type: array + items: + $ref: '#/components/schemas/SupportedGADShapes' + minItems: 1 + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + ldrType: + $ref: '#/components/schemas/LdrType' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + periodicEventInfo: + $ref: '#/components/schemas/PeriodicEventInfo' + areaEventInfo: + $ref: '#/components/schemas/AreaEventInfo' + motionEventInfo: + $ref: '#/components/schemas/MotionEventInfo' + eventReportMessage: + $ref: '#/components/schemas/EventReportMessage' + eventReportingStatus: + $ref: '#/components/schemas/EventReportingStatus' + ueLocationInfo: + $ref: '#/components/schemas/UELocationInfo' + cIoT5GSOptimisation: + type: boolean + default: false + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + ncgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + guami: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Guami' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + uePositioningCap: + $ref: '#/components/schemas/UePositioningCapabilities' + scheduledLocTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + EventReportMessage: + description: Indicates an event report message. + type: object + required: + - eventClass + - eventContent + properties: + eventClass: + $ref: '#/components/schemas/EventClass' + eventContent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RefToBinaryData' + + EventReportingStatus: + description: Indicates the status of event reporting. + type: object + properties: + eventReportCounter: + $ref: '#/components/schemas/EventReportCounter' + eventReportDuration: + $ref: '#/components/schemas/EventReportDuration' + + UELocationInfo: + description: Indicates location information of a UE. + type: object + properties: + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + ageOfVelocityEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + timestampOfVelocityEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + EventNotifyData: + description: Information within Event Notify Request. + type: object + required: + - reportedEventType + - ldrReference + properties: + reportedEventType: + $ref: '#/components/schemas/ReportedEventType' + supi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + gpsi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + hgmlcCallBackURI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + ldrReference: + $ref: '#/components/schemas/LdrReference' + locationEstimate: + $ref: '#/components/schemas/GeographicArea' + ageOfLocationEstimate: + $ref: '#/components/schemas/AgeOfLocationEstimate' + timestampOfLocationEstimate: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + civicAddress: + $ref: '#/components/schemas/CivicAddress' + localLocationEstimate: + $ref: '#/components/schemas/LocalArea' + positioningDataList: + type: array + items: + $ref: '#/components/schemas/PositioningMethodAndUsage' + minItems: 1 + gnssPositioningDataList: + type: array + items: + $ref: '#/components/schemas/GnssPositioningMethodAndUsage' + minItems: 1 + servingLMFidentification: + $ref: '#/components/schemas/LMFIdentification' + terminationCause: + $ref: '#/components/schemas/TerminationCause' + velocityEstimate: + $ref: '#/components/schemas/VelocityEstimate' + altitude: + $ref: '#/components/schemas/Altitude' + achievedQos: + $ref: '#/components/schemas/MinorLocationQoS' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + UeConnectivityState: + description: Indicates the connectivity state of a UE. + type: object + required: + - accessType + properties: + accessType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType' + connectivitystate: + $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmState' + + MinorLocationQoS: + description: Contain Minor Location QoS. + type: object + properties: + hAccuracy: + $ref: '#/components/schemas/Accuracy' + vAccuracy: + $ref: '#/components/schemas/Accuracy' + +# +# +# SIMPLE TYPES +# + Altitude: + description: Indicates value of altitude. + type: number + format: double + minimum: -32767 + maximum: 32767 + + Angle: + description: Indicates value of angle. + type: integer + minimum: 0 + maximum: 360 + + Uncertainty: + description: Indicates value of uncertainty. + type: number + format: float + minimum: 0 + + Orientation: + description: Indicates value of orientation angle. + type: integer + minimum: 0 + maximum: 180 + + Confidence: + description: Indicates value of confidence. + type: integer + minimum: 0 + maximum: 100 + + Accuracy: + description: Indicates value of accuracy. + type: number + format: float + minimum: 0 + + InnerRadius: + description: Indicates value of the inner radius. + type: integer + format: int32 + minimum: 0 + maximum: 327675 + + CorrelationID: + description: LCS Correlation ID. + type: string + minLength: 1 + maxLength: 255 + + AgeOfLocationEstimate: + description: Indicates value of the age of the location estimate. + type: integer + minimum: 0 + maximum: 32767 + + HorizontalSpeed: + description: Indicates value of horizontal speed. + type: number + format: float + minimum: 0 + maximum: 2047 + + VerticalSpeed: + description: Indicates value of vertical speed. + type: number + format: float + minimum: 0 + maximum: 255 + + SpeedUncertainty: + description: Indicates value of speed uncertainty. + type: number + format: float + minimum: 0 + maximum: 255 + + BarometricPressure: + description: Specifies the measured uncompensated atmospheric pressure. + type: integer + minimum: 30000 + maximum: 115000 + + LcsServiceType: + description: LCS service type. + type: integer + minimum: 0 + maximum: 127 + + LdrReference: + description: LDR Reference. + type: string + minLength: 2 + maxLength: 510 + + ReportingAmount: + description: Number of required periodic event reports. + type: integer + minimum: 1 + maximum: 8639999 + + ReportingInterval: + description: Event reporting periodic interval. + type: integer + minimum: 1 + maximum: 8639999 + + MinimumInterval: + description: Minimum interval between event reports. + type: integer + minimum: 1 + maximum: 32767 + + MaximumInterval: + description: Maximum interval between event reports. + type: integer + minimum: 1 + maximum: 86400 + + SamplingInterval: + description: Maximum time interval between consecutive evaluations by a UE of a trigger event. + type: integer + minimum: 1 + maximum: 3600 + + ReportingDuration: + description: Maximum duration of event reporting. + type: integer + minimum: 1 + maximum: 8640000 + + LinearDistance: + description: Minimum straight line distance moved by a UE to trigger a motion event report. + type: integer + minimum: 1 + maximum: 10000 + + LMFIdentification: + description: LMF identification. + type: string + + EventReportCounter: + description: Number of event reports received from the target UE. + type: integer + minimum: 1 + maximum: 8640000 + + EventReportDuration: + description: Duration of event reporting. + type: integer + minimum: 1 + maximum: 8640000 + + UePositioningCapabilities: + description: Positioning capabilities supported by the UE. A string encoding the "ProvideCapabilities-r9-IEs" IE as specified in clause 6.3 of 3GPP TS 37.355 (start from octet 1). + type: string + format: byte + +# +# ENUMS +# + ExternalClientType: + description: Indicates types of External Clients. + anyOf: + - type: string + enum: + - EMERGENCY_SERVICES + - VALUE_ADDED_SERVICES + - PLMN_OPERATOR_SERVICES + - LAWFUL_INTERCEPT_SERVICES + - PLMN_OPERATOR_BROADCAST_SERVICES + - PLMN_OPERATOR_OM + - PLMN_OPERATOR_ANONYMOUS_STATISTICS + - PLMN_OPERATOR_TARGET_MS_SERVICE_SUPPORT + - type: string + + SupportedGADShapes: + description: Indicates supported GAD shapes. + anyOf: + - type: string + enum: + - POINT + - POINT_UNCERTAINTY_CIRCLE + - POINT_UNCERTAINTY_ELLIPSE + - POLYGON + - POINT_ALTITUDE + - POINT_ALTITUDE_UNCERTAINTY + - ELLIPSOID_ARC + - LOCAL_2D_POINT_UNCERTAINTY_ELLIPSE + - LOCAL_3D_POINT_UNCERTAINTY_ELLIPSOID + - type: string + + ResponseTime: + description: Indicates acceptable delay of location request. + anyOf: + - type: string + enum: + - LOW_DELAY + - DELAY_TOLERANT + - NO_DELAY + - type: string + + PositioningMethod: + description: Indicates supported positioning methods. + anyOf: + - type: string + enum: + - CELLID + - ECID + - OTDOA + - BAROMETRIC_PRESSURE + - WLAN + - BLUETOOTH + - MBS + - MOTION_SENSOR + - DL_TDOA + - DL_AOD + - MULTI-RTT + - NR_ECID + - UL_TDOA + - UL_AOA + - NETWORK_SPECIFIC + - type: string + + PositioningMode: + description: Indicates supported modes used for positioning method. + anyOf: + - type: string + enum: + - UE_BASED + - UE_ASSISTED + - CONVENTIONAL + - type: string + + GnssId: + description: Global Navigation Satellite System (GNSS) ID. + anyOf: + - type: string + enum: + - GPS + - GALILEO + - SBAS + - MODERNIZED_GPS + - QZSS + - GLONASS + - BDS + - NAVIC + - type: string + + Usage: + description: Indicates usage made of the location measurement. + anyOf: + - type: string + enum: + - UNSUCCESS + - SUCCESS_RESULTS_NOT_USED + - SUCCESS_RESULTS_USED_TO_VERIFY_LOCATION + - SUCCESS_RESULTS_USED_TO_GENERATE_LOCATION + - SUCCESS_METHOD_NOT_DETERMINED + - type: string + + LcsPriority: + description: Indicates priority of the LCS client. + anyOf: + - type: string + enum: + - HIGHEST_PRIORITY + - NORMAL_PRIORITY + - type: string + + VelocityRequested: + description: Indicates velocity requirement. + anyOf: + - type: string + enum: + - VELOCITY_IS_NOT_REQUESTED + - VELOCITY_IS_REQUESTED + - type: string + + AccuracyFulfilmentIndicator: + description: Indicates fulfilment of requested accuracy. + anyOf: + - type: string + enum: + - REQUESTED_ACCURACY_FULFILLED + - REQUESTED_ACCURACY_NOT_FULFILLED + - type: string + + VerticalDirection: + description: Indicates direction of vertical speed. + type: string + enum: + - UPWARD + - DOWNWARD + + LdrType: + description: Indicates LDR types. + anyOf: + - type: string + enum: + - UE_AVAILABLE + - PERIODIC + - ENTERING_INTO_AREA + - LEAVING_FROM_AREA + - BEING_INSIDE_AREA + - MOTION + - type: string + + ReportingAreaType: + description: Indicates type of event reporting area. + anyOf: + - type: string + enum: + - EPS_TRACKING_AREA_IDENTITY + - E-UTRAN_CELL_GLOBAL_IDENTIFICATION + - 5GS_TRACKING_AREA_IDENTITY + - NR_CELL_GLOBAL_IDENTITY + - type: string + + OccurrenceInfo: + description: Specifies occurrence of event reporting. + anyOf: + - type: string + enum: + - ONE_TIME_EVENT + - MULTIPLE_TIME_EVENT + - type: string + + ReportingAccessType: + description: Specifies access types of event reporting. + anyOf: + - type: string + enum: + - NR + - EUTRA_CONNECTED_TO_5GC + - NON_3GPP_CONNECTED_TO_5GC + - NR_LEO + - NR_MEO + - NR_GEO + - NR_OTHER_SAT + - type: string + + EventClass: + description: Specifies event classes. + anyOf: + - type: string + enum: + - SUPPLEMENTARY_SERVICES + - type: string + + ReportedEventType: + description: Specifies type of event reporting. + anyOf: + - type: string + enum: + - PERIODIC_EVENT + - ENTERING_AREA_EVENT + - LEAVING_AREA_EVENT + - BEING_INSIDE_AREA_EVENT + - MOTION_EVENT + - MAXIMUM_INTERVAL_EXPIRATION_EVENT + - LOCATION_CANCELLATION_EVENT + - type: string + + TerminationCause: + description: Specifies causes of event reporting termination. + anyOf: + - type: string + enum: + - TERMINATION_BY_UE + - TERMINATION_BY_NETWORK + - NORMAL_TERMINATION + - type: string + + LcsQosClass: + description: Specifies LCS QoS class. + anyOf: + - type: string + enum: + - BEST_EFFORT + - ASSURED + - MULTIPLE_QOS + - type: string + + UeLocationServiceInd: + description: Specifies location service types requested by UE. + anyOf: + - type: string + enum: + - LOCATION_ESTIMATE + - LOCATION_ASSISTANCE_DATA + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_JOSEProtectedMessageForwarding.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_JOSEProtectedMessageForwarding.yaml new file mode 100644 index 000000000..56a59b3ae --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_JOSEProtectedMessageForwarding.yaml @@ -0,0 +1,312 @@ +openapi: 3.0.0 + +info: + version: '1.2.1' + title: 'JOSE Protected Message Forwarding API' + description: | + N32-f Message Forwarding Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +servers: + - url: '{apiRoot}/n32f-forward/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. +externalDocs: + description: 3GPP TS 29.573 V17.6.0; 5G System; Public Land Mobile Network (PLMN) Interconnection; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.573/ + +paths: + /n32f-process: + post: + summary: N32-f Message Forwarding + tags: + - N32-f Forward + operationId: PostN32fProcess + parameters: + - name: Content-Encoding + in: header + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: Accept-Encoding + in: header + description: Accept-Encoding, described in IETF RFC 7231 + schema: + type: string + - name: 3gpp-Sbi-Message-Priority + in: header + description: 3gpp-Sbi-Message-Priority, defined in 3GPP TS 29.500 + schema: + type: string + requestBody: + description: Custom operation N32-f Message Forwarding + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/N32fReformattedReqMsg' + responses: + '200': + description: OK (Successful forwarding of reformatted message over N32-f) + content: + application/json: + schema: + $ref: '#/components/schemas/N32fReformattedRspMsg' + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + Content-Encoding: + description: Content-Encoding, described in IETF RFC 7231 + schema: + type: string + 3gpp-Sbi-Message-Priority: + description: 3gpp-Sbi-Message-Priority, defined in 3GPP TS 29.500 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + + options: + summary: Discover communication options supported by next hop (IPX or SEPP) + operationId: N32fProcessOptions + tags: + - N32-f Forward + responses: + '204': + description: No Content + headers: + Accept-Encoding: + description: Accept-Encoding, described in IETF RFC 7694 + schema: + type: string + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '501': + $ref: 'TS29571_CommonData.yaml#/components/responses/501' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + FlatJweJson: + description: Contains the integrity protected reformatted block + type: object + required: + - ciphertext + properties: + protected: + type: string + unprotected: + type: object + header: + type: object + encrypted_key: + type: string +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + aad: + type: string + iv: + type: string + ciphertext: + type: string + tag: + type: string + + FlatJwsJson: + description: Contains the modification from IPXes on path + type: object + required: + - payload + - signature + properties: + payload: + type: string + protected: + type: string + header: + type: object + signature: + type: string + + N32fReformattedReqMsg: + description: Contains the reformatted HTTP/2 request message + type: object + required: + - reformattedData + properties: + reformattedData: + $ref: '#/components/schemas/FlatJweJson' + modificationsBlock: + type: array + items: + $ref: '#/components/schemas/FlatJwsJson' + minItems: 1 + + N32fReformattedRspMsg: + description: Contains the reformatted HTTP/2 response message + type: object + required: + - reformattedData + properties: + reformattedData: + $ref: '#/components/schemas/FlatJweJson' + modificationsBlock: + type: array + items: + $ref: '#/components/schemas/FlatJwsJson' + minItems: 1 + + DataToIntegrityProtectAndCipherBlock: + description: HTTP header to be encrypted or the value of a JSON attribute to be encrypted + type: object + required: + - dataToEncrypt + properties: + dataToEncrypt: + type: array + items: {} + minItems: 1 + DataToIntegrityProtectBlock: + description: Data to be integrity protected + type: object + properties: + metaData: + $ref: '#/components/schemas/MetaData' + requestLine: + $ref: '#/components/schemas/RequestLine' + statusLine: + type: string + headers: + type: array + items: + $ref: '#/components/schemas/HttpHeader' + minItems: 1 + payload: + type: array + items: + $ref: '#/components/schemas/HttpPayload' + minItems: 1 + RequestLine: + description: Contains the request line of the HTTP API request being reformatted and forwarded over N32-f + type: object + required: + - method + - scheme + - authority + - path + - protocolVersion + properties: + method: + $ref: 'TS29573_N32_Handshake.yaml#/components/schemas/HttpMethod' + scheme: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UriScheme' + authority: + type: string + path: + type: string + protocolVersion: + type: string + queryFragment: + type: string + HttpHeader: + description: Contains the encoding of HTTP headers in the API request / response + type: object + required: + - header + - value + properties: + header: + type: string + value: + $ref: '#/components/schemas/EncodedHttpHeaderValue' + HttpPayload: + description: Contains the encoding of JSON payload in the API request / response + type: object + required: + - iePath + - ieValueLocation + - value + properties: + iePath: + type: string + ieValueLocation: + $ref: 'TS29573_N32_Handshake.yaml#/components/schemas/IeLocation' + value: + type: object + MetaData: + description: Contains the meta data information needed for replay protection + type: object + required: + - n32fContextId + - messageId + - authorizedIpxId + properties: + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + messageId: + type: string + authorizedIpxId: + type: string + Modifications: + description: Information on inserting of the modifications entry + type: object + required: + - identity + properties: + identity: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + operations: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PatchItem' + minItems: 1 + tag: + type: string + IndexToEncryptedValue: + description: Index to the encrypted value + type: object + required: + - encBlockIndex + properties: + encBlockIndex: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger' + EncodedHttpHeaderValue: + description: HTTP header value or index to the HTTP header value + oneOf: + - type: string + - $ref: '#/components/schemas/IndexToEncryptedValue' \ No newline at end of file diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_N32_Handshake.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_N32_Handshake.yaml new file mode 100644 index 000000000..73bb7f469 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_N32_Handshake.yaml @@ -0,0 +1,546 @@ +openapi: 3.0.0 + +info: + version: '1.2.1' + title: 'N32 Handshake API' + description: | + N32-c Handshake Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +servers: + - url: '{apiRoot}/n32c-handshake/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. +externalDocs: + description: 3GPP TS 29.573 V17.6.0; 5G System; Public Land Mobile Network (PLMN) Interconnection; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.573/ + +paths: + /exchange-capability: + post: + summary: Security Capability Negotiation + tags: + - Security Capability Negotiation + operationId: PostExchangeCapability + requestBody: + description: Custom operation for security capability negotiation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SecNegotiateReqData' + responses: + '200': + description: OK (Successful negitiation of security capabilities) + content: + application/json: + schema: + $ref: '#/components/schemas/SecNegotiateRspData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '403': + $ref: 'TS29571_CommonData.yaml#/components/responses/403' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /exchange-params: + post: + summary: Parameter Exchange + tags: + - Parameter Exchange + operationId: PostExchangeParams + requestBody: + description: Custom operation for parameter exchange + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SecParamExchReqData' + responses: + '200': + description: OK (Successful exchange of parameters) + content: + application/json: + schema: + $ref: '#/components/schemas/SecParamExchRspData' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '409': + $ref: 'TS29571_CommonData.yaml#/components/responses/409' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /n32f-terminate: + post: + summary: N32-f Context Terminate + tags: + - N32-f Context Terminate + operationId: PostN32fTerminate + requestBody: + description: Custom operation for n32-f context termination + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/N32fContextInfo' + responses: + '200': + description: OK (Successful exchange of parameters) + content: + application/json: + schema: + $ref: '#/components/schemas/N32fContextInfo' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error + /n32f-error: + post: + summary: N32-f Error Reporting Procedure + tags: + - N32-f Error Report + operationId: PostN32fError + requestBody: + description: Custom operation for n32-f error reporting procedure + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/N32fErrorInfo' + responses: + '204': + description: successful error reporting + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '415': + $ref: 'TS29571_CommonData.yaml#/components/responses/415' + '429': + $ref: 'TS29571_CommonData.yaml#/components/responses/429' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + description: Unexpected error +components: + schemas: + SecurityCapability: + description: Enumeration of security capabilities + anyOf: + - type: string + enum: + - TLS + - PRINS + - NONE + - type: string + ApiSignature: + description: API URI of the service operation + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + - $ref: '#/components/schemas/CallbackName' + HttpMethod: + description: Enumeration of HTTP methods + anyOf: + - type: string + enum: + - GET + - PUT + - POST + - DELETE + - PATCH + - HEAD + - OPTIONS + - CONNECT + - TRACE + - type: string + + IeType: + description: Enumeration of types of IEs (i.e kind of IE) to specify the protection policy + anyOf: + - type: string + enum: + - UEID + - LOCATION + - KEY_MATERIAL + - AUTHENTICATION_MATERIAL + - AUTHORIZATION_TOKEN + - OTHER + - NONSENSITIVE + - type: string + + IeLocation: + description: Location of the IE in a HTTP message + anyOf: + - type: string + enum: + - URI_PARAM + - HEADER + - BODY + - MULTIPART_BINARY + - type: string + + IeInfo: + description: Protection and modification policy for the IE + type: object + required: + - ieLoc + - ieType + properties: + ieLoc: + $ref: '#/components/schemas/IeLocation' + ieType: + $ref: '#/components/schemas/IeType' + reqIe: + type: string + rspIe: + type: string + isModifiable: + type: boolean + isModifiableByIpx: + type: object + additionalProperties: + type: boolean + minProperties: 1 + + ApiIeMapping: + description: API URI to IE mapping on which the protection policy needs to be applied + type: object + required: + - apiSignature + - apiMethod + - IeList + properties: + apiSignature: + $ref: '#/components/schemas/ApiSignature' + apiMethod: + $ref: '#/components/schemas/HttpMethod' + IeList: + type: array + items: + $ref: '#/components/schemas/IeInfo' + minItems: 1 +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + + ProtectionPolicy: + description: The protection policy to be negotiated between the SEPPs + type: object + required: + - apiIeMappingList + properties: + apiIeMappingList: + type: array + items: + $ref: '#/components/schemas/ApiIeMapping' + minItems: 1 + dataTypeEncPolicy: + type: array + items: + $ref: '#/components/schemas/IeType' + minItems: 1 + + SecNegotiateReqData: + description: Defines the security capabilities of a SEPP sent to a receiving SEPP + type: object + required: + - sender + - supportedSecCapabilityList + properties: + sender: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + supportedSecCapabilityList: + type: array + items: + $ref: '#/components/schemas/SecurityCapability' + minItems: 1 + 3GppSbiTargetApiRootSupported: + type: boolean + default: false +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + plmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + snpnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + targetPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + targetSnpnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + intendedUsagePurpose: + type: array + items: + $ref: '#/components/schemas/IntendedN32Purpose' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + SecNegotiateRspData: + description: Defines the selected security capabilities by a SEPP + type: object + required: + - sender + - selectedSecCapability + properties: + sender: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + selectedSecCapability: + $ref: '#/components/schemas/SecurityCapability' + 3GppSbiTargetApiRootSupported: + type: boolean + default: false +# The attribute name does not follow the naming conventions specified in 3GPP TS 29.501. The attribute name is kept though as defined in the current specification for backward compatibility reason. + plmnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + minItems: 1 + snpnIdList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnIdNid' + minItems: 1 + allowedUsagePurpose: + type: array + items: + $ref: '#/components/schemas/IntendedN32Purpose' + minItems: 1 + rejectedUsagePurpose: + type: array + items: + $ref: '#/components/schemas/IntendedN32Purpose' + minItems: 1 + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + + SecParamExchReqData: + description: Request data structure for parameter exchange + type: object + required: + - n32fContextId + properties: + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + jweCipherSuiteList: + type: array + items: + type: string + minItems: 1 + jwsCipherSuiteList: + type: array + items: + type: string + minItems: 1 + protectionPolicyInfo: + $ref: '#/components/schemas/ProtectionPolicy' + ipxProviderSecInfoList: + type: array + items: + $ref: '#/components/schemas/IpxProviderSecInfo' + minItems: 1 + sender: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + SecParamExchRspData: + description: Response data structure for parameter exchange + type: object + required: + - n32fContextId + properties: + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + selectedJweCipherSuite: + type: string + selectedJwsCipherSuite: + type: string + selProtectionPolicyInfo: + $ref: '#/components/schemas/ProtectionPolicy' + ipxProviderSecInfoList: + type: array + items: + $ref: '#/components/schemas/IpxProviderSecInfo' + minItems: 1 + sender: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + + N32fContextInfo: + description: N32-f context information + type: object + required: + - n32fContextId + properties: + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + CallbackName: + description: Callback Name + type: object + required: + - callbackType + properties: + callbackType: + type: string + N32fErrorInfo: + description: N32-f error information + type: object + required: + - n32fMessageId + - n32fErrorType + properties: + n32fMessageId: + type: string + n32fErrorType: + $ref: '#/components/schemas/N32fErrorType' + n32fContextId: + type: string + pattern: '^[A-Fa-f0-9]{16}$' + failedModificationList: + type: array + items: + $ref: '#/components/schemas/FailedModificationInfo' + minItems: 1 + errorDetailsList: + type: array + items: + $ref: '#/components/schemas/N32fErrorDetail' + minItems: 1 + FailedModificationInfo: + description: Information on N32-f modifications block that failed to process + type: object + required: + - ipxId + - n32fErrorType + properties: + ipxId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + n32fErrorType: + $ref: '#/components/schemas/N32fErrorType' + N32fErrorDetail: + description: Details about the N32f error + type: object + required: + - attribute + - msgReconstructFailReason + properties: + attribute: + type: string + msgReconstructFailReason: + $ref: '#/components/schemas/FailureReason' + IpxProviderSecInfo: + description: Defines the security information list of an IPX + type: object + required: + - ipxProviderId + properties: + ipxProviderId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + rawPublicKeyList: + type: array + items: + type: string + minItems: 1 + certificateList: + type: array + items: + type: string + minItems: 1 + + IntendedN32Purpose: + description: Indicates the intended N32 establishment purpose + type: object + required: + - usagePurpose + properties: + usagePurpose: + $ref: '#/components/schemas/N32Purpose' + additionalInfo: + type: string + cause: + type: string + + N32fErrorType: + description: Type of error while processing N32-f message + anyOf: + - type: string + enum: + - INTEGRITY_CHECK_FAILED + - INTEGRITY_CHECK_ON_MODIFICATIONS_FAILED + - MODIFICATIONS_INSTRUCTIONS_FAILED + - DECIPHERING_FAILED + - MESSAGE_RECONSTRUCTION_FAILED + - CONTEXT_NOT_FOUND + - INTEGRITY_KEY_EXPIRED + - ENCRYPTION_KEY_EXPIRED + - POLICY_MISMATCH + - type: string + FailureReason: + description: Reason for failure to reconstruct a HTTP/2 message from N32-f message + anyOf: + - type: string + enum: + - INVALID_JSON_POINTER + - INVALID_INDEX_TO_ENCRYPTED_BLOCK + - INVALID_HTTP_HEADER + - type: string + + N32Purpose: + description: Usage purpose of establishing N32 connectivity + anyOf: + - type: string + enum: + - ROAMING + - INTER_PLMN_MOBILITY + - SMS_INTERCONNECT + - ROAMING_TEST + - INTER_PLMN_MOBILITY_TEST + - SMS_INTERCONNECT_TEST + - SNPN_INTERCONNECT + - SNPN_INTERCONNECT_TEST + - DISASTER_ROAMING + - DISASTER_ROAMING_TEST + - type: string \ No newline at end of file diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_SeppTelescopicFqdnMapping.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_SeppTelescopicFqdnMapping.yaml new file mode 100644 index 000000000..eb32e2d51 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS29573_SeppTelescopicFqdnMapping.yaml @@ -0,0 +1,65 @@ +openapi: 3.0.0 + +info: + version: '1.1.0' + title: 'SEPP Telescopic FQDN Mapping API' + description: | + SEPP Telescopic FQDN Mapping Service. + © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. + +servers: + - url: '{apiRoot}/nsepp-telescopic/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in clause 4.4 of 3GPP TS 29.501. + +externalDocs: + description: 3GPP TS 29.573 V17.5.0; 5G System; Public Land Mobile Network (PLMN) Interconnection; Stage 3 + url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.573/ + +paths: + /mapping: + get: + summary: Maps an FQDN to/from a telescopic FQDN + operationId: GetTelescopicMapping + tags: + - Telescopic Mapping (Document) + parameters: + - name: foreign-fqdn + in: query + description: FQDN of the NF in the foreign PLMN + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + - name: telescopic-label + in: query + description: Telescopic Label + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: '#/components/schemas/TelescopicMapping' + '400': + $ref: 'TS29571_CommonData.yaml#/components/responses/400' + '404': + $ref: 'TS29571_CommonData.yaml#/components/responses/404' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + +components: + schemas: + TelescopicMapping: + description: Contains the Telescopic mapping data + type: object + properties: + telescopicLabel: + type: string + seppDomain: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' + foreignFqdn: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn' diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS32291_Nchf_ConvergedCharging.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS32291_Nchf_ConvergedCharging.yaml new file mode 100644 index 000000000..b88f25360 --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS32291_Nchf_ConvergedCharging.yaml @@ -0,0 +1,2565 @@ +openapi: 3.0.0 +info: + title: Nchf_ConvergedCharging + version: 3.1.12 + description: | + ConvergedCharging Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 32.291 V17.45.0: Telecommunication management; Charging management; + 5G system, charging service; Stage 3. + url: 'http://www.3gpp.org/ftp/Specs/archive/32_series/32.291/' +servers: + - url: '{apiRoot}/nchf-convergedcharging/v3' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501. +security: + - {} + - oAuth2ClientCredentials: + - nchf-convergedcharging +paths: + /chargingdata: + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataResponse' + '400': + description: Bad request + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '404': + description: Not Found + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '408': + $ref: 'TS29571_CommonData.yaml#/components/responses/408' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + callbacks: + chargingNotification: + '{$request.body#/notifyUri}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingNotifyRequest' + responses: + '200': + description: OK. + content: + application/ json: + schema: + $ref: '#/components/schemas/ChargingNotifyResponse' + '204': + description: 'No Content, Notification was succesfull' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad request + content: + application/problem+json: + schema: + oneOf: + - $ref: TS29571_CommonData.yaml#/components/schemas/ProblemDetails + - $ref: '#/components/schemas/ChargingNotifyResponse' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + '/chargingdata/{ChargingDataRef}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + parameters: + - name: ChargingDataRef + in: path + description: a unique identifier for a charging data resource in a PLMN + required: true + schema: + type: string + responses: + '200': + description: OK. Updated Charging Data resource is returned + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataResponse' + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '400': + description: Bad request + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '403': + description: Forbidden + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '404': + description: Not Found + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '405': + $ref: 'TS29571_CommonData.yaml#/components/responses/405' + '408': + $ref: 'TS29571_CommonData.yaml#/components/responses/408' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + '/chargingdata/{ChargingDataRef}/release': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + parameters: + - name: ChargingDataRef + in: path + description: a unique identifier for a charging data resource in a PLMN + required: true + schema: + type: string + responses: + '204': + description: No Content. + '307': + $ref: 'TS29571_CommonData.yaml#/components/responses/307' + '308': + $ref: 'TS29571_CommonData.yaml#/components/responses/308' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '404': + description: Not Found + content: + application/problem+json: + schema: + oneOf: + - $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + - $ref: '#/components/schemas/ChargingDataResponse' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nchf-convergedcharging: Access to the Nchf_ConvergedCharging API + schemas: + ChargingDataRequest: + type: object + properties: + subscriberIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + tenantIdentifier: + type: string + chargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + mnSConsumerIdentifier: + type: string + nfConsumerIdentification: + $ref: '#/components/schemas/NFIdentification' + invocationTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + invocationSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + retransmissionIndicator: + type: boolean + oneTimeEvent: + type: boolean + oneTimeEventType: + $ref: '#/components/schemas/oneTimeEventType' + notifyUri: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + serviceSpecificationInfo: + type: string + multipleUnitUsage: + type: array + items: + $ref: '#/components/schemas/MultipleUnitUsage' + minItems: 0 + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + easid: + type: string + ednid: + type: string + eASProviderIdentifier: + type: string + pDUSessionChargingInformation: + $ref: '#/components/schemas/PDUSessionChargingInformation' + roamingQBCInformation: + $ref: '#/components/schemas/RoamingQBCInformation' + sMSChargingInformation: + $ref: '#/components/schemas/SMSChargingInformation' + nEFChargingInformation: + $ref: '#/components/schemas/NEFChargingInformation' + registrationChargingInformation: + $ref: '#/components/schemas/RegistrationChargingInformation' + n2ConnectionChargingInformation: + $ref: '#/components/schemas/N2ConnectionChargingInformation' + locationReportingChargingInformation: + $ref: '#/components/schemas/LocationReportingChargingInformation' + nSPAChargingInformation: + $ref: '#/components/schemas/NSPAChargingInformation' + nSMChargingInformation: + $ref: '#/components/schemas/NSMChargingInformation' + mMTelChargingInformation: + $ref: '#/components/schemas/MMTelChargingInformation' + iMSChargingInformation: + $ref: '#/components/schemas/IMSChargingInformation' + edgeInfrastructureUsageChargingInformation': + $ref: '#/components/schemas/EdgeInfrastructureUsageChargingInformation' + eASDeploymentChargingInformation: + $ref: '#/components/schemas/EASDeploymentChargingInformation' + directEdgeEnablingServiceChargingInformation: + $ref: '#/components/schemas/NEFChargingInformation' + exposedEdgeEnablingServiceChargingInformation: + $ref: '#/components/schemas/NEFChargingInformation' + proSeChargingInformation: + $ref: '#/components/schemas/ProseChargingInformation' + required: + - nfConsumerIdentification + - invocationTimeStamp + - invocationSequenceNumber + ChargingDataResponse: + type: object + properties: + invocationTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + invocationSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + invocationResult: + $ref: '#/components/schemas/InvocationResult' + sessionFailover: + $ref: '#/components/schemas/SessionFailover' + supportedFeatures: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures' + multipleUnitInformation: + type: array + items: + $ref: '#/components/schemas/MultipleUnitInformation' + minItems: 0 + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + pDUSessionChargingInformation: + $ref: '#/components/schemas/PDUSessionChargingInformation' + roamingQBCInformation: + $ref: '#/components/schemas/RoamingQBCInformation' + locationReportingChargingInformation: + $ref: '#/components/schemas/LocationReportingChargingInformation' + required: + - invocationTimeStamp + - invocationSequenceNumber + ChargingNotifyRequest: + type: object + properties: + notificationType: + $ref: '#/components/schemas/NotificationType' + reauthorizationDetails: + type: array + items: + $ref: '#/components/schemas/ReauthorizationDetails' + minItems: 0 + required: + - notificationType + ChargingNotifyResponse: + type: object + properties: + invocationResult: + $ref: '#/components/schemas/InvocationResult' + NFIdentification: + type: object + properties: + nFName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nFIPv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + nFIPv6Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + nFPLMNID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nodeFunctionality: + $ref: '#/components/schemas/NodeFunctionality' + nFFqdn: + type: string + required: + - nodeFunctionality + MultipleUnitUsage: + type: object + properties: + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + requestedUnit: + $ref: '#/components/schemas/RequestedUnit' + usedUnitContainer: + type: array + items: + $ref: '#/components/schemas/UsedUnitContainer' + minItems: 0 + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + multihomedPDUAddress: + $ref: '#/components/schemas/PDUAddress' + required: + - ratingGroup + InvocationResult: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + failureHandling: + $ref: '#/components/schemas/FailureHandling' + Trigger: + type: object + properties: + triggerType: + $ref: '#/components/schemas/TriggerType' + triggerCategory: + $ref: '#/components/schemas/TriggerCategory' + timeLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + volumeLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + volumeLimit64: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + eventLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + maxNumberOfccc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + tariffTimeChange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + required: + - triggerType + - triggerCategory + MultipleUnitInformation: + type: object + properties: + resultCode: + $ref: '#/components/schemas/ResultCode' + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + grantedUnit: + $ref: '#/components/schemas/GrantedUnit' + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + validityTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + quotaHoldingTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + finalUnitIndication: + $ref: '#/components/schemas/FinalUnitIndication' + timeQuotaThreshold: + type: integer + volumeQuotaThreshold: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + unitQuotaThreshold: + type: integer + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + announcementInformation: + $ref: '#/components/schemas/AnnouncementInformation' + required: + - ratingGroup + RequestedUnit: + type: object + properties: + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + serviceSpecificUnits: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + UsedUnitContainer: + type: object + properties: + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + quotaManagementIndicator: + $ref: '#/components/schemas/QuotaManagementIndicator' + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + triggerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + serviceSpecificUnits: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + eventTimeStamps: + + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minItems: 0 + localSequenceNumber: + type: integer + pDUContainerInformation: + $ref: '#/components/schemas/PDUContainerInformation' + nSPAContainerInformation: + $ref: '#/components/schemas/NSPAContainerInformation' + pC5ContainerInformation: + $ref: '#/components/schemas/PC5ContainerInformation' + required: + - localSequenceNumber + GrantedUnit: + type: object + properties: + tariffTimeChange: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + serviceSpecificUnits: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + FinalUnitIndication: + type: object + properties: + finalUnitAction: + $ref: '#/components/schemas/FinalUnitAction' + restrictionFilterRule: + $ref: '#/components/schemas/IPFilterRule' + restrictionFilterRuleList: + type: array + items: + $ref: '#/components/schemas/IPFilterRule' + minItems: 1 + filterId: + type: string + filterIdList: + type: array + items: + type: string + minItems: 1 + redirectServer: + $ref: '#/components/schemas/RedirectServer' + required: + - finalUnitAction + RedirectServer: + type: object + properties: + redirectAddressType: + $ref: '#/components/schemas/RedirectAddressType' + redirectServerAddress: + type: string + required: + - redirectAddressType + - redirectServerAddress + ReauthorizationDetails: + type: object + properties: + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + quotaManagementIndicator: + $ref: '#/components/schemas/QuotaManagementIndicator' + PDUSessionChargingInformation: + type: object + properties: + chargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + sMFchargingId: + type: string + homeProvidedChargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + sMFHomeProvidedChargingId: + type: string + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + mAPDUNon3GPPUserLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + non3GPPUserLocationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + mAPDUNon3GPPUserLocationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + pduSessionInformation: + $ref: '#/components/schemas/PDUSessionInformation' + unitCountInactivityTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + rANSecondaryRATUsageReport: + $ref: '#/components/schemas/RANSecondaryRATUsageReport' + UserInformation: + type: object + properties: + servedGPSI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + servedPEI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + unauthenticatedFlag: + type: boolean + roamerInOut: + $ref: '#/components/schemas/RoamerInOut' + PDUSessionInformation: + type: object + properties: + networkSlicingInfo: + $ref: '#/components/schemas/NetworkSlicingInfo' + pduSessionID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + hPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + servingNetworkFunctionID: + $ref: '#/components/schemas/ServingNetworkFunctionID' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + mAPDUNon3GPPRATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + dnnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + dnnSelectionMode: + $ref: '#/components/schemas/dnnSelectionMode' + chargingCharacteristics: + type: string + pattern: '^[0-9a-fA-F]{1,4}$' + chargingCharacteristicsSelectionMode: + $ref: '#/components/schemas/ChargingCharacteristicsSelectionMode' + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stopTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + sessionStopIndicator: + type: boolean + pduAddress: + $ref: '#/components/schemas/PDUAddress' + diagnostics: + $ref: '#/components/schemas/Diagnostics' + authorizedQoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AuthorizedDefaultQos' + subscribedQoSInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + authorizedSessionAMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + subscribedSessionAMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + servingCNPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + mAPDUSessionInformation: + $ref: '#/components/schemas/MAPDUSessionInformation' + enhancedDiagnostics: + $ref: '#/components/schemas/EnhancedDiagnostics5G' + redundantTransmissionType: + $ref: '#/components/schemas/RedundantTransmissionType' + pDUSessionPairID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + cpCIoTOptimisationIndicator: + type: boolean + 5GSControlPlaneOnlyIndicator: + type: boolean + smallDataRateControlIndicator: + type: boolean + 5GLANTypeService: + $ref: '#/components/schemas/5GLANTypeService' + required: + - pduSessionID + - dnnId + PDUContainerInformation: + type: object + properties: + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + afChargingIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + afChargingIdString: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ApplicationChargingId' + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servingNodeID: + type: array + items: + $ref: '#/components/schemas/ServingNetworkFunctionID' + minItems: 0 + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + sponsorIdentity: + type: string + applicationserviceProviderIdentity: + type: string + chargingRuleBaseName: + type: string + mAPDUSteeringFunctionality: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/SteeringFunctionality' + mAPDUSteeringMode: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/SteeringMode' + trafficForwardingWay: + $ref: '#/components/schemas/TrafficForwardingWay' + qosMonitoringReport: + type: array + items: + $ref: '#/components/schemas/QosMonitoringReport' + minItems: 0 + NSPAContainerInformation: + type: object + properties: + latency: + type: integer + throughput: + $ref: '#/components/schemas/Throughput' + maximumPacketLossRate: + type: string + serviceExperienceStatisticsData: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/ServiceExperienceInfo' + theNumberOfPDUSessions: + type: integer + theNumberOfRegisteredSubscribers: + type: integer + loadLevel: + $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/NsiLoadLevelInfo' + NSPAChargingInformation: + type: object + properties: + singleNSSAI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - singleNSSAI + NetworkSlicingInfo: + type: object + properties: + sNSSAI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - sNSSAI + PDUAddress: + type: object + properties: + pduIPv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + pduIPv6AddresswithPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + pduAddressprefixlength: + type: integer + iPv4dynamicAddressFlag: + type: boolean + iPv6dynamicPrefixFlag: + type: boolean + addIpv6AddrPrefixes: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + addIpv6AddrPrefixList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix' + ServingNetworkFunctionID: + type: object + properties: + servingNetworkFunctionInformation: + $ref: '#/components/schemas/NFIdentification' + aMFId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfId' + required: + - servingNetworkFunctionInformation + RoamingQBCInformation: + type: object + properties: + multipleQFIcontainer: + type: array + items: + $ref: '#/components/schemas/MultipleQFIcontainer' + minItems: 0 + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + roamingChargingProfile: + $ref: '#/components/schemas/RoamingChargingProfile' + MultipleQFIcontainer: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + triggerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + localSequenceNumber: + type: integer + qFIContainerInformation: + $ref: '#/components/schemas/QFIContainerInformation' + required: + - localSequenceNumber + QFIContainerInformation: + type: object + properties: + qFI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + reportTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servingNetworkFunctionID: + type: array + items: + $ref: '#/components/schemas/ServingNetworkFunctionID' + minItems: 0 + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + 3gppChargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + diagnostics: + $ref: '#/components/schemas/Diagnostics' + enhancedDiagnostics: + type: array + items: + type: string + required: + - reportTime + RoamingChargingProfile: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + partialRecordMethod: + $ref: '#/components/schemas/PartialRecordMethod' + SMSChargingInformation: + type: object + properties: + originatorInfo: + $ref: '#/components/schemas/OriginatorInfo' + recipientInfo: + type: array + items: + $ref: '#/components/schemas/RecipientInfo' + minItems: 0 + userEquipmentInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + roamerInOut: + $ref: '#/components/schemas/RoamerInOut' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + sMSCAddress: + type: string + sMDataCodingScheme: + type: integer + sMMessageType: + $ref: '#/components/schemas/SMMessageType' + sMReplyPathRequested: + $ref: '#/components/schemas/ReplyPathRequested' + sMUserDataHeader: + type: string + sMStatus: + type: string + pattern: '^[0-7]?[0-9a-fA-F]$' + sMDischargeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + numberofMessagesSent: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + sMServiceType: + $ref: '#/components/schemas/SMServiceType' + sMSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + sMSresult: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + submissionTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sMPriority: + $ref: '#/components/schemas/SMPriority' + messageReference: + type: string + messageSize: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + messageClass: + $ref: '#/components/schemas/MessageClass' + deliveryReportRequested: + $ref: '#/components/schemas/DeliveryReportRequested' + OriginatorInfo: + type: object + properties: + originatorSUPI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + originatorGPSI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + originatorOtherAddress: + $ref: '#/components/schemas/SMAddressInfo' + originatorReceivedAddress: + $ref: '#/components/schemas/SMAddressInfo' + originatorSCCPAddress: + type: string + sMOriginatorInterface: + $ref: '#/components/schemas/SMInterface' + sMOriginatorProtocolId: + type: string + RecipientInfo: + type: object + properties: + recipientSUPI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + recipientGPSI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + recipientOtherAddress: + $ref: '#/components/schemas/SMAddressInfo' + recipientReceivedAddress: + $ref: '#/components/schemas/SMAddressInfo' + recipientSCCPAddress: + type: string + sMDestinationInterface: + $ref: '#/components/schemas/SMInterface' + sMrecipientProtocolId: + type: string + SMAddressInfo: + type: object + properties: + sMaddressType: + $ref: '#/components/schemas/SMAddressType' + sMaddressData: + type: string + sMaddressDomain: + $ref: '#/components/schemas/SMAddressDomain' + RecipientAddress: + type: object + properties: + recipientAddressInfo: + $ref: '#/components/schemas/SMAddressInfo' + sMaddresseeType: + $ref: '#/components/schemas/SMAddresseeType' + MessageClass: + type: object + properties: + classIdentifier: + $ref: '#/components/schemas/ClassIdentifier' + tokenText: + type: string + SMAddressDomain: + type: object + properties: + domainName: + type: string + 3GPPIMSIMCCMNC: + type: string + SMInterface: + type: object + properties: + interfaceId: + type: string + interfaceText: + type: string + interfacePort: + type: string + interfaceType: + $ref: '#/components/schemas/InterfaceType' + RANSecondaryRATUsageReport: + type: object + properties: + rANSecondaryRATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + qosFlowsUsageReports: + type: array + items: + $ref: '#/components/schemas/QosFlowsUsageReport' + Diagnostics: + type: integer + IPFilterRule: + type: string + QosFlowsUsageReport: + type: object + properties: + qFI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + startTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + 5GLANTypeService: + type: object + properties: + internalGroupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + NEFChargingInformation: + type: object + properties: + externalIndividualIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + externalGroupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ExternalGroupId' + groupIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GroupId' + aPIDirection: + $ref: '#/components/schemas/APIDirection' + aPITargetNetworkFunction: + $ref: '#/components/schemas/NFIdentification' + aPIResultCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + aPIName: + type: string + aPIReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + aPIContent: + type: string + required: + - aPIName + RegistrationChargingInformation: + type: object + properties: + registrationMessagetype: + $ref: '#/components/schemas/RegistrationMessageType' + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + pSCellInformation: + $ref: '#/components/schemas/PSCellInformation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + 5GMMCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Bytes' + mICOModeIndication: + $ref: '#/components/schemas/MICOModeIndication' + smsIndication: + $ref: '#/components/schemas/SmsIndication' + taiList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Tai' + minItems: 0 + serviceAreaRestriction: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + minItems: 0 + requestedNSSAI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 + allowedNSSAI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 + rejectedNSSAI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 + nSSAIMapList: + type: array + items: + $ref: '#/components/schemas/NSSAIMap' + minItems: 0 + amfUeNgapId: + type: integer + ranUeNgapId: + type: integer + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + required: + - registrationMessagetype + PSCellInformation: + type: object + properties: + nrcgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ncgi' + ecgi: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ecgi' + NSSAIMap: + type: object + properties: + servingSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + homeSnssai: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - servingSnssai + - homeSnssai + N2ConnectionChargingInformation: + type: object + properties: + n2ConnectionMessageType: + $ref: '#/components/schemas/N2ConnectionMessageType' + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + pSCellInformation: + $ref: '#/components/schemas/PSCellInformation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + amfUeNgapId: + type: integer + ranUeNgapId: + type: integer + ranNodeId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/GlobalRanNodeId' + restrictedRatList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + minItems: 0 + forbiddenAreaList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Area' + minItems: 0 + serviceAreaRestriction: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceAreaRestriction' + minItems: 0 + restrictedCnList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/CoreNetworkType' + minItems: 0 + allowedNSSAI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 + rrcEstCause: + type: string + pattern: '^[0-9a-fA-F]+$' + required: + - n2ConnectionMessageType + LocationReportingChargingInformation: + type: object + properties: + locationReportingMessageType: + $ref: '#/components/schemas/LocationReportingMessageType' + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + pSCellInformation: + $ref: '#/components/schemas/PSCellInformation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + required: + - locationReportingMessageType + N2ConnectionMessageType: + type: integer + LocationReportingMessageType: + type: integer + NSMChargingInformation: + type: object + properties: + managementOperation: + $ref: '#/components/schemas/ManagementOperation' + idNetworkSliceInstance: + type: string + listOfserviceProfileChargingInformation: + type: array + items: + $ref: '#/components/schemas/ServiceProfileChargingInformation' + minItems: 0 + managementOperationStatus: + $ref: '#/components/schemas/ManagementOperationStatus' +# To be introduced once the reference to 'generic.yaml is resolved +# managementOperationalState: +# $ref: 'genericNrm.yaml#/components/schemas/OperationalState' +# managementAdministrativeState: +# $ref: 'genericNrm.yaml#/components/schemas/AdministrativeState' + required: + - managementOperation + ServiceProfileChargingInformation: + type: object + properties: + serviceProfileIdentifier: + type: string + sNSSAIList: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + minItems: 0 +# To be introduced once the reference to 'nrNrm.yaml is resolved +# sST: +# $ref: 'nrNrm.yaml#/components/schemas/Sst' + latency: + type: integer + availability: + type: number +# To be introduced once the reference to sliceNrm.yaml is resolved +# resourceSharingLevel: +# $ref: 'sliceNrm.yaml#/components/schemas/SharingLevel' + jitter: + type: integer + reliability: + type: string + maxNumberofUEs: + type: integer + coverageArea: + type: string +# To be introduced once the reference to sliceNrm.yaml is resolved +# uEMobilityLevel: +# $ref: 'sliceNrm.yaml#/components/schemas/MobilityLevel' +# delayToleranceIndicator: +# $ref: 'sliceNrm.yaml#/components/schemas/Support' + dLThptPerSlice: + $ref: '#/components/schemas/Throughput' + dLThptPerUE: + $ref: '#/components/schemas/Throughput' + uLThptPerSlice: + $ref: '#/components/schemas/Throughput' + uLThptPerUE: + $ref: '#/components/schemas/Throughput' + maxNumberofPDUsessions: + type: integer + kPIMonitoringList: + type: string + supportedAccessTechnology: + type: integer +# To be introduced once the reference to sliceNrm.yaml is resolved +# v2XCommunicationModeIndicator: +# $ref: 'sliceNrm.yaml#/components/schemas/Support' + addServiceProfileInfo: + type: string + Throughput: + type: object + properties: + guaranteedThpt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + maximumThpt: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + MAPDUSessionInformation: + type: object + properties: + mAPDUSessionIndicator: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/MaPduIndication' + aTSSSCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AtsssCapability' + EnhancedDiagnostics5G: + $ref: '#/components/schemas/RanNasCauseList' + RanNasCauseList: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RanNasRelCause' + QosMonitoringReport: + description: Contains reporting information on QoS monitoring. + type: object + properties: + ulDelays: + type: array + items: + type: integer + minItems: 0 + dlDelays: + type: array + items: + type: integer + minItems: 0 + rtDelays: + type: array + items: + type: integer + minItems: 0 + AnnouncementInformation: + type: object + properties: + announcementIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + announcementReference: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + variableParts: + type: array + items: + $ref: '#/components/schemas/VariablePart' + minItems: 0 + timeToPlay: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + quotaConsumptionIndicator: + $ref: '#/components/schemas/QuotaConsumptionIndicator' + announcementPriority: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + playToParty: + $ref: '#/components/schemas/PlayToParty' + announcementPrivacyIndicator: + $ref: '#/components/schemas/AnnouncementPrivacyIndicator' + Language: + $ref: '#/components/schemas/Language' + VariablePart: + type: object + properties: + variablePartType: + $ref: '#/components/schemas/VariablePartType' + variablePartValue: + type: array + items: + type: string + minItems: 1 + variablePartOrder: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + required: + - variablePartType + - variablePartValue + Language: + type: string + MMTelChargingInformation: + type: object + properties: + supplementaryServices: + type: array + items: + $ref: '#/components/schemas/SupplementaryService' + minItems: 1 + SupplementaryService: + type: object + properties: + supplementaryServiceType: + $ref: '#/components/schemas/SupplementaryServiceType' + supplementaryServiceMode: + $ref: '#/components/schemas/SupplementaryServiceMode' + numberOfDiversions: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + associatedPartyAddress: + type: string + conferenceId: + type: string + participantActionType: + $ref: '#/components/schemas/ParticipantActionType' + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + numberOfParticipants: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + cUGInformation: + $ref: '#/components/schemas/OctetString' + IMSChargingInformation: + type: object + properties: + eventType: + $ref: '#/components/schemas/SIPEventType' + iMSNodeFunctionality: + $ref: '#/components/schemas/IMSNodeFunctionality' + roleOfNode: + $ref: '#/components/schemas/RoleOfIMSNode' + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + ueTimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + isupCause: + $ref: '#/components/schemas/ISUPCause' + controlPlaneAddress: + $ref: '#/components/schemas/IMSAddress' + vlrNumber: + $ref: '#/components/schemas/E164' + mscAddress: + $ref: '#/components/schemas/E164' + userSessionID: + type: string + outgoingSessionID: + type: string + sessionPriority: + $ref: '#/components/schemas/IMSSessionPriority' + callingPartyAddresses: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + calledPartyAddress: + type: string + numberPortabilityRoutinginformation: + type: string + carrierSelectRoutingInformation: + type: string + alternateChargedPartyAddress: + type: string + requestedPartyAddress: + type: array + items: + type: string + minItems: 1 + calledAssertedIdentities: + type: array + items: + type: string + minItems: 1 + calledIdentityChanges: + type: array + items: + $ref: '#/components/schemas/CalledIdentityChange' + minItems: 1 + associatedURI: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri' + minItems: 1 + timeStamps: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + applicationServerInformation: + type: array + items: + type: string + minItems: 1 + interOperatorIdentifier: + type: array + items: + $ref: '#/components/schemas/InterOperatorIdentifier' + minItems: 1 + imsChargingIdentifier: + type: string + relatedICID: + type: string + relatedICIDGenerationNode: + type: string + transitIOIList: + type: array + items: + type: string + minItems: 1 + earlyMediaDescription: + type: array + items: + $ref: '#/components/schemas/EarlyMediaDescription' + minItems: 1 + sdpSessionDescription: + type: array + items: + type: string + minItems: 1 + sdpMediaComponent: + type: array + items: + $ref: '#/components/schemas/SDPMediaComponent' + minItems: 1 + servedPartyIPAddress: + $ref: '#/components/schemas/IMSAddress' + serverCapabilities: + $ref: '#/components/schemas/ServerCapabilities' + trunkGroupID: + $ref: '#/components/schemas/TrunkGroupID' + bearerService: + type: string + imsServiceId: + type: string + messageBodies: + type: array + items: + $ref: '#/components/schemas/MessageBody' + minItems: 1 + accessNetworkInformation: + type: array + items: + type: string + minItems: 1 + additionalAccessNetworkInformation: + type: string + cellularNetworkInformation: + type: string + accessTransferInformation: + type: array + items: + $ref: '#/components/schemas/AccessTransferInformation' + minItems: 1 + accessNetworkInfoChange: + type: array + items: + $ref: '#/components/schemas/AccessNetworkInfoChange' + minItems: 1 + imsCommunicationServiceID: + type: string + imsApplicationReferenceID: + type: string + causeCode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + reasonHeader: + type: array + items: + type: string + minItems: 1 + initialIMSChargingIdentifier: + type: string + nniInformation: + type: array + items: + $ref: '#/components/schemas/NNIInformation' + minItems: 1 + fromAddress: + type: string + imsEmergencyIndication: + type: boolean + imsVisitedNetworkIdentifier: + type: string + sipRouteHeaderReceived: + type: string + sipRouteHeaderTransmitted: + type: string + tadIdentifier: + $ref: '#/components/schemas/TADIdentifier' + feIdentifierList: + type: string + EdgeInfrastructureUsageChargingInformation: + type: object + properties: + meanVirtualCPUUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + meanVirtualMemoryUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + meanVirtualDiskUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Float' + durationStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + durationEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + EASDeploymentChargingInformation: + type: object + properties: +# To be introduced once the reference to EdgeNrm.yaml is resolved +# eEASDeploymentRequirements: +# $ref: '#/components/schemas/EASRequirements' + lCMStartTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + lCMEndTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + + PC5ContainerInformation: + type: object + properties: + coverageInfoList: + type: array + items: + $ref: '#/components/schemas/CoverageInfo' + radioParameterSetInfoList: + type: array + items: + $ref: '#/components/schemas/RadioParameterSetInfo' + transmitterInfoList: + type: array + items: + $ref: '#/components/schemas/TransmitterInfo' + minItems: 0 + timeOfFirst Transmission: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeOfFirst Reception: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + CoverageInfo: + type: object + properties: + coverageStatus: + type: boolean + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + locationInfo: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + minItems: 0 + + RadioParameterSetInfo: + type: object + properties: + radioParameterSetValues: + type: array + items: + $ref: '#/components/schemas/OctetString' + minItems: 0 + changeTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + TransmitterInfo: + type: object + properties: + proseSourceIPAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + proseSourceL2Id: + type: string + ProseChargingInformation: + type: object + properties: + announcingPlmnID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + announcingUeHplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + announcingUeVplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + monitoringUeHplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + monitoringUeVplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + discovererUeHplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + discovererUeVplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + discovereeUeHplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + discovereeUeVplmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + monitoredPlmnIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + proseApplicationID: + type: string + ApplicationId: + type: string + applicationSpecificDataList: + type: array + items: + type: string + minItems: 0 + proseFunctionality: + $ref: '#/components/schemas/ProseFunctionality' + proseEventType: + $ref: '#/components/schemas/ProseEventType' + directDiscoveryModel: + $ref: '#/components/schemas/DirectDiscoveryModel' + validityPeriod: + type: integer + roleOfUE: + $ref: '#/components/schemas/RoleOfUE' + proseRequestTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + pC3ProtocolCause: + type: integer + monitoringUEIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + requestedPLMNIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + timeWindow: + type: integer + rangeClass: + $ref: '#/components/schemas/RangeClass' + proximityAlertIndication: + type: boolean + proximityAlertTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + proximityCancellationTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + relayIPAddress: + $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr' + proseUEToNetworkRelayUEID : + type: string + proseDestinationLayer2ID: + type: string + pFIContainerInformation: + type: array + items: + $ref: '#/components/schemas/PFIContainerInformation' + minItems: 0 + transmissionDataContainer: + type: array + items: + $ref: '#/components/schemas/PC5DataContainer' + minItems: 0 + receptionDataContainer: + type: array + items: + $ref: '#/components/schemas/PC5DataContainer' + minItems: 0 + required: + - aPIName + + PFIContainerInformation: + type: object + properties: + pFI: + type: string + reportTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + + PC5DataContainer: + type: object + properties: + localSequenceNumber: + type: string + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + coverageStatus: + type: boolean + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + dataVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + changeCondition: + type: string + radioResourcesId: + $ref: '#/components/schemas/RadioResourcesId' + radioFrequency: + type: string + pC5RadioTechnology: + type: string + + OctetString: + type: string + pattern: '^[0-9a-fA-F]+$' + E164: + type: string + pattern: '^[0-9a-fA-F]+$' + IMSAddress: + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + e164: + $ref: '#/components/schemas/E164' + anyOf: + - required: [ ipv4Addr ] + - required: [ ipv6Addr ] + - required: [ e164 ] + ServingNodeAddress: + type: object + properties: + ipv4Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + ipv6Addr: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + anyOf: + - required: [ ipv4Addr ] + - required: [ ipv6Addr ] + SIPEventType: + type: object + properties: + sIPMethod: + type: string + eventHeader: + type: string + expiresHeader: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + ISUPCause: + type: object + properties: + iSUPCauseLocation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + iSUPCauseValue: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + iSUPCauseDiagnostics: + $ref: '#/components/schemas/OctetString' + CalledIdentityChange: + type: object + properties: + calledIdentity: + type: string + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + InterOperatorIdentifier: + type: object + properties: + originatingIOI: + type: string + terminatingIOI: + type: string + EarlyMediaDescription: + type: object + properties: + sDPTimeStamps: + $ref: '#/components/schemas/SDPTimeStamps' + sDPMediaComponent: + type: array + items: + $ref: '#/components/schemas/SDPMediaComponent' + minItems: 0 + sDPSessionDescription: + type: array + items: + type: string + minItems: 0 + SDPTimeStamps: + type: object + properties: + sDPOfferTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + sDPAnswerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + SDPMediaComponent: + type: object + properties: + sDPMediaName: + type: string + SDPMediaDescription: + type: array + items: + type: string + minItems: 0 + localGWInsertedIndication: + type: boolean + ipRealmDefaultIndication: + type: boolean + transcoderInsertedIndication: + type: boolean + mediaInitiatorFlag: + $ref: '#/components/schemas/MediaInitiatorFlag' + mediaInitiatorParty: + type: string + threeGPPChargingId: + $ref: '#/components/schemas/OctetString' + accessNetworkChargingIdentifierValue: + $ref: '#/components/schemas/OctetString' + sDPType: + $ref: '#/components/schemas/SDPType' + ServerCapabilities: + type: object + properties: + mandatoryCapability: + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + minItems: 0 + optionalCapability : + type: array + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + minItems: 0 + serverName: + type: array + items: + type: string + minItems: 0 + TrunkGroupID: + type: object + properties: + incomingTrunkGroupID: + type: string + outgoingTrunkGroupID: + type: string + MessageBody: + type: object + properties: + contentType: + type: string + contentLength: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + contentDisposition: + type: string + originator: + $ref: '#/components/schemas/OriginatorPartyType' + required: + - contentType + - contentLength + AccessTransferInformation: + type: object + properties: + accessTransferType: + $ref: '#/components/schemas/AccessTransferType' + accessNetworkInformation: + type: array + items: + $ref: '#/components/schemas/OctetString' + minItems: 0 + cellularNetworkInformation: + $ref: '#/components/schemas/OctetString' + interUETransfer: + $ref: '#/components/schemas/UETransferType' + userEquipmentInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + instanceId: + type: string + relatedIMSChargingIdentifier: + type: string + relatedIMSChargingIdentifierNode: + $ref: '#/components/schemas/IMSAddress' + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + AccessNetworkInfoChange: + type: object + properties: + accessNetworkInformation: + type: array + items: + $ref: '#/components/schemas/OctetString' + minItems: 0 + cellularNetworkInformation: + $ref: '#/components/schemas/OctetString' + changeTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + NNIInformation: + type: object + properties: + sessionDirection: + $ref: '#/components/schemas/NNISessionDirection' + nNIType: + $ref: '#/components/schemas/NNIType' + relationshipMode: + $ref: '#/components/schemas/NNIRelationshipMode' + neighbourNodeAddress: + $ref: '#/components/schemas/IMSAddress' + EASRequirements: + type: object + properties: + requiredEASservingLocation: + $ref: 'TS28538_EdgeNrm.yaml/components/schemas/ServingLocation' + softwareImageInfo: + $ref: 'TS28538_EdgeNrm.yaml/components/schemas/SoftwareImageInfo' + affinityAntiAffinity: + $ref: 'TS28538_EdgeNrm.yaml/components/schemas/AffinityAntiAffinity' + serviceContinuity: + type: boolean + virtualResource: + $ref: 'TS28538_EdgeNrm.yaml/components/schemas/VirtualResource' + NotificationType: + anyOf: + - type: string + enum: + - REAUTHORIZATION + - ABORT_CHARGING + - type: string + NodeFunctionality: + anyOf: + - type: string + enum: + - AMF + - SMF + - SMS # Included for backwards compatibility, shall not be used + - SMSF + - PGW_C_SMF + - NEFF # Included for backwards compatibility, shall not be used + - SGW + - I_SMF + - ePDG + - CEF + - NEF + - MnS_Producer + - SGSN + - V_SMF + - 5G_DDNMF + - IMS_Node + - EES + - type: string + ChargingCharacteristicsSelectionMode: + anyOf: + - type: string + enum: + - HOME_DEFAULT + - ROAMING_DEFAULT + - VISITING_DEFAULT + - type: string + TriggerType: + anyOf: + - type: string + enum: + - QUOTA_THRESHOLD + - QHT + - FINAL + - QUOTA_EXHAUSTED + - VALIDITY_TIME + - OTHER_QUOTA_TYPE + - FORCED_REAUTHORISATION + - UNUSED_QUOTA_TIMER # Included for backwards compatibility, shall not be used + - UNIT_COUNT_INACTIVITY_TIMER + - ABNORMAL_RELEASE + - QOS_CHANGE + - VOLUME_LIMIT + - TIME_LIMIT + - EVENT_LIMIT + - PLMN_CHANGE + - USER_LOCATION_CHANGE + - RAT_CHANGE + - SESSION_AMBR_CHANGE + - UE_TIMEZONE_CHANGE + - TARIFF_TIME_CHANGE + - MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS + - MANAGEMENT_INTERVENTION + - CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA + - CHANGE_OF_3GPP_PS_DATA_OFF_STATUS + - SERVING_NODE_CHANGE + - REMOVAL_OF_UPF + - ADDITION_OF_UPF + - INSERTION_OF_ISMF + - REMOVAL_OF_ISMF + - CHANGE_OF_ISMF + - START_OF_SERVICE_DATA_FLOW + - ECGI_CHANGE + - TAI_CHANGE + - HANDOVER_CANCEL + - HANDOVER_START + - HANDOVER_COMPLETE + - GFBR_GUARANTEED_STATUS_CHANGE + - ADDITION_OF_ACCESS + - REMOVAL_OF_ACCESS + - START_OF_SDF_ADDITIONAL_ACCESS + - REDUNDANT_TRANSMISSION_CHANGE + - CGI_SAI_CHANGE + - RAI_CHANGE + - type: string + FinalUnitAction: + anyOf: + - type: string + enum: + - TERMINATE + - REDIRECT + - RESTRICT_ACCESS + - type: string + RedirectAddressType: + anyOf: + - type: string + enum: + - IPV4 + - IPV6 + - URL + - URI + - type: string + TriggerCategory: + anyOf: + - type: string + enum: + - IMMEDIATE_REPORT + - DEFERRED_REPORT + - type: string + QuotaManagementIndicator: + anyOf: + - type: string + enum: + - ONLINE_CHARGING + - OFFLINE_CHARGING + - QUOTA_MANAGEMENT_SUSPENDED + - type: string + FailureHandling: + anyOf: + - type: string + enum: + - TERMINATE + - CONTINUE + - RETRY_AND_TERMINATE + - type: string + SessionFailover: + anyOf: + - type: string + enum: + - FAILOVER_NOT_SUPPORTED + - FAILOVER_SUPPORTED + - type: string + 3GPPPSDataOffStatus: + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + ResultCode: + anyOf: + - type: string + enum: + - SUCCESS + - END_USER_SERVICE_DENIED + - QUOTA_MANAGEMENT_NOT_APPLICABLE + - QUOTA_LIMIT_REACHED + - END_USER_SERVICE_REJECTED + - USER_UNKNOWN #Included for backwards compatibility, shall not be used + - RATING_FAILED + - QUOTA_MANAGEMENT + - type: string + PartialRecordMethod: + anyOf: + - type: string + enum: + - DEFAULT + - INDIVIDUAL + - type: string + RoamerInOut: + anyOf: + - type: string + enum: + - IN_BOUND + - OUT_BOUND + - type: string + SMMessageType: + anyOf: + - type: string + enum: + - SUBMISSION + - DELIVERY_REPORT + - SM_SERVICE_REQUEST + - DELIVERY + - type: string + SMPriority: + anyOf: + - type: string + enum: + - LOW + - NORMAL + - HIGH + - type: string + DeliveryReportRequested: + anyOf: + - type: string + enum: + - YES + - NO + - type: string + InterfaceType: + anyOf: + - type: string + enum: + - UNKNOWN + - MOBILE_ORIGINATING + - MOBILE_TERMINATING + - APPLICATION_ORIGINATING + - APPLICATION_TERMINATING + - type: string + ClassIdentifier: + anyOf: + - type: string + enum: + - PERSONAL + - ADVERTISEMENT + - INFORMATIONAL + - AUTO + - type: string + SMAddressType: + anyOf: + - type: string + enum: + - EMAIL_ADDRESS + - MSISDN + - IPV4_ADDRESS + - IPV6_ADDRESS + - NUMERIC_SHORTCODE + - ALPHANUMERIC_SHORTCODE + - OTHER + - IMSI + - type: string + SMAddresseeType: + anyOf: + - type: string + enum: + - TO + - CC + - BCC + - type: string + SMServiceType: + anyOf: + - type: string + enum: + - VAS4SMS_SHORT_MESSAGE_CONTENT_PROCESSING + - VAS4SMS_SHORT_MESSAGE_FORWARDING + - VAS4SMS_SHORT_MESSAGE_FORWARDING_MULTIPLE_SUBSCRIPTIONS + - VAS4SMS_SHORT_MESSAGE_FILTERING + - VAS4SMS_SHORT_MESSAGE_RECEIPT + - VAS4SMS_SHORT_MESSAGE_NETWORK_STORAGE + - VAS4SMS_SHORT_MESSAGE_TO_MULTIPLE_DESTINATIONS + - VAS4SMS_SHORT_MESSAGE_VIRTUAL_PRIVATE_NETWORK(VPN) + - VAS4SMS_SHORT_MESSAGE_AUTO_REPLY + - VAS4SMS_SHORT_MESSAGE_PERSONAL_SIGNATURE + - VAS4SMS_SHORT_MESSAGE_DEFERRED_DELIVERY + - type: string + ReplyPathRequested: + anyOf: + - type: string + enum: + - NO_REPLY_PATH_SET + - REPLY_PATH_SET + - type: string + oneTimeEventType: + anyOf: + - type: string + enum: + - IEC + - PEC + - type: string + dnnSelectionMode: + anyOf: + - type: string + enum: + - VERIFIED + - UE_DNN_NOT_VERIFIED + - NW_DNN_NOT_VERIFIED + - type: string + APIDirection: + anyOf: + - type: string + enum: + - INVOCATION + - NOTIFICATION + - type: string + RegistrationMessageType: + anyOf: + - type: string + enum: + - INITIAL + - MOBILITY + - PERIODIC + - EMERGENCY + - DEREGISTRATION + - type: string + MICOModeIndication: + anyOf: + - type: string + enum: + - MICO_MODE + - NO_MICO_MODE + - type: string + SmsIndication: + anyOf: + - type: string + enum: + - SMS_SUPPORTED + - SMS_NOT_SUPPORTED + - type: string + ManagementOperation: + anyOf: + - type: string + enum: + - CreateMOI #Included for backwards compatibility, shall not be used + - ModifyMOIAttributes #Included for backwards compatibility, shall not be used + - DeleteMOI #Included for backwards compatibility, shall not be used + - CREATE_MOI + - MODIFY_MOI_ATTR + - DELETE_MOI + - type: string + ManagementOperationStatus: + anyOf: + - type: string + enum: + - OPERATION_SUCCEEDED + - OPERATION_FAILED + - type: string + RedundantTransmissionType: + anyOf: + - type: string + enum: + - NON_TRANSMISSION + - END_TO_END_USER_PLANE_PATHS + - N3/N9 + - TRANSPORT_LAYER + - type: string + VariablePartType: + anyOf: + - type: string + enum: + - INTEGER + - NUMBER + - TIME + - DATE + - CURRENCY + - type: string + QuotaConsumptionIndicator: + anyOf: + - type: string + enum: + - QUOTA_NOT_USED + - QUOTA_IS_USED + - type: string + PlayToParty: + anyOf: + - type: string + enum: + - SERVED + - REMOTE + - type: string + AnnouncementPrivacyIndicator: + anyOf: + - type: string + enum: + - NOT_PRIVATE + - PRIVATE + - type: string + SupplementaryServiceType: + anyOf: + - type: string + enum: + - OIP + - OIR + - TIP + - TIR + - HOLD + - CB + - CDIV + - CW + - MWI + - CONF + - FA + - CCBS + - CCNR + - MCID + - CAT + - CUG + - PNM + - CRS + - ECT + - type: string + SupplementaryServiceMode: + anyOf: + - type: string + enum: + - CFU + - CFB + - CFNR + - CFNL + - CD + - CFNRC + - ICB + - OCB + - ACR + - BLIND_TRANFER + - CONSULTATIVE_TRANFER + - type: string + ParticipantActionType: + anyOf: + - type: string + enum: + - CREATE + - JOIN + - INVITE_INTO + - QUIT + - type: string + TrafficForwardingWay: + anyOf: + - type: string + enum: + - N6 + - N19 + - LOCAL_SWITCH + - type: string + IMSNodeFunctionality: + anyOf: + - type: string + enum: +# The applicable IMS Nodes are MRFC, IMS-GWF (connected to S-CSCF using ISC) and SIP AS. + - S_CSCF + - P_CSCF + - I_CSCF + - MRFC + - MGCF + - BGCF + - AS + - IBCF + - S-GW + - P-GW + - HSGW + - E-CSCF + - MME + - TRF + - TF + - ATCF + - PROXY + - EPDG + - TDF + - TWAG + - SCEF + - IWK_SCEF + - IMS_GWF + - type: string + RoleOfIMSNode: + anyOf: + - type: string + enum: + - ORIGINATING + - TERMINATING + - FORWARDING + - type: string + IMSSessionPriority: + anyOf: + - type: string + enum: + - PRIORITY_0 + - PRIORITY_1 + - PRIORITY_2 + - PRIORITY_3 + - PRIORITY_4 + - type: string + MediaInitiatorFlag: + anyOf: + - type: string + enum: + - CALLED_PARTY + - CALLING_PARTY + - UNKNOWN + - type: string + SDPType: + anyOf: + - type: string + enum: + - OFFER + - ANSWER + - type: string + OriginatorPartyType: + anyOf: + - type: string + enum: + - CALLING + - CALLED + - type: string + AccessTransferType: + anyOf: + - type: string + enum: + - PS_TO_CS + - CS_TO_PS + - PS_TO_PS + - CS_TO_CS + - type: string + UETransferType: + anyOf: + - type: string + enum: + - INTRA_UE + - INTER_UE + - type: string + NNISessionDirection: + anyOf: + - type: string + enum: + - INBOUND + - OUTBOUND + - type: string + NNIType: + anyOf: + - type: string + enum: + - NON_ROAMING + - ROAMING_NO_LOOPBACK + - ROAMING_LOOPBACK + - type: string + NNIRelationshipMode: + anyOf: + - type: string + enum: + - TRUSTED + - NON_TRUSTED + - type: string + TADIdentifier: + anyOf: + - type: string + enum: + - CS + - PS + - type: string + ProseFunctionality: + anyOf: + - type: string + enum: + - DIRECT_DISCOVERY + - DIRECT_COMMUNICATION + - type: string + ProseEventType: + anyOf: + - type: string + enum: + - ANNOUNCING + - MONITORING + - MATCH_REPORT + - type: string + DirectDiscoveryModel: + anyOf: + - type: string + enum: + - MODEL_A + - MODEL_B + - type: string + RoleOfUE: + anyOf: + - type: string + enum: + - ANNOUNCING_UE + - MONITORING_UE + - REQUESTOR_UE + - REQUESTED_UE + - type: string + RangeClass: + anyOf: + - type: string + enum: + - RESERVED + - 50_METER + - 100_METER + - 200_METER + - 500_METER + - 1000_METER + - UNUSED + - type: string + RadioResourcesId: + anyOf: + - type: string + enum: + - OPERATOR_PROVIDED + - CONFIGURED + - type: string diff --git a/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS32291_Nchf_OfflineOnlyCharging.yaml b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS32291_Nchf_OfflineOnlyCharging.yaml new file mode 100644 index 000000000..630e1cb7e --- /dev/null +++ b/lib/sbi/support/r17-20230301-openapitools-6.4.0/standard/TS32291_Nchf_OfflineOnlyCharging.yaml @@ -0,0 +1,703 @@ +openapi: 3.0.0 +info: + title: Nchf_OfflineOnlyCharging + version: 1.0.12 + description: | + OfflineOnlyCharging Service + © 20212022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: > + 3GPP TS 32.291 V16 V17.60.0: Telecommunication management; Charging management; + 5G system, charging service; Stage 3. + url: 'http://www.3gpp.org/ftp/Specs/archive/32_series/32.291/' +servers: + - url: '{apiRoot}/nchf-offlineonlycharging/v1' + variables: + apiRoot: + default: https://example.com + description: apiRoot as defined in subclause 4.4 of 3GPP TS 29.501. +security: + - {} + - oAuth2ClientCredentials: + - nchf-offlineonlycharging +paths: + /offlinechargingdata: + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + '/offlinechargingdata/{OfflineChargingDataRef}/update': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + parameters: + - name: OfflineChargingDataRef + in: path + description: a unique identifier for a charging data resource in a PLMN + required: true + schema: + type: string + responses: + '200': + description: OK. Updated Charging Data resource is returned + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataResponse' + '400': + description: Bad request + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '404': + description: Not Found + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' + '/offlinechargingdata/{OfflineChargingDataRef}/release': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChargingDataRequest' + parameters: + - name: OfflineChargingDataRef + in: path + description: a unique identifier for a charging data resource in a PLMN + required: true + schema: + type: string + responses: + '204': + description: No Content. + '404': + description: Not Found + content: + application/json: + schema: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + '401': + $ref: 'TS29571_CommonData.yaml#/components/responses/401' + '410': + $ref: 'TS29571_CommonData.yaml#/components/responses/410' + '411': + $ref: 'TS29571_CommonData.yaml#/components/responses/411' + '413': + $ref: 'TS29571_CommonData.yaml#/components/responses/413' + '500': + $ref: 'TS29571_CommonData.yaml#/components/responses/500' + '503': + $ref: 'TS29571_CommonData.yaml#/components/responses/503' + default: + $ref: 'TS29571_CommonData.yaml#/components/responses/default' +components: + securitySchemes: + oAuth2ClientCredentials: + type: oauth2 + flows: + clientCredentials: + tokenUrl: '{nrfApiRoot}/oauth2/token' + scopes: + nchf-offlineonlycharging: Access to the Nchf_OfflineOnlyCharging API + schemas: + ChargingDataRequest: + type: object + properties: + subscriberIdentifier: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Supi' + nfConsumerIdentification: + $ref: '#/components/schemas/NFIdentification' + invocationTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + invocationSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + retransmissionIndicator: + type: boolean + serviceSpecificationInfo: + type: string + multipleUnitUsage: + type: array + items: + $ref: '#/components/schemas/MultipleUnitUsage' + minItems: 0 + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + pDUSessionChargingInformation: + $ref: '#/components/schemas/PDUSessionChargingInformation' + roamingQBCInformation: + $ref: '#/components/schemas/RoamingQBCInformation' + required: + - nfConsumerIdentification + - invocationTimeStamp + - invocationSequenceNumber + ChargingDataResponse: + type: object + properties: + invocationTimeStamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + invocationSequenceNumber: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + invocationResult: + $ref: '#/components/schemas/InvocationResult' + sessionFailover: + $ref: '#/components/schemas/SessionFailover' + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + pDUSessionChargingInformation: + $ref: '#/components/schemas/PDUSessionChargingInformation' + roamingQBCInformation: + $ref: '#/components/schemas/RoamingQBCInformation' + required: + - invocationTimeStamp + - invocationSequenceNumber + NFIdentification: + type: object + properties: + nFName: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + nFIPv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + nFIPv6Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + nFPLMNID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + nodeFunctionality: + $ref: '#/components/schemas/NodeFunctionality' + nFFqdn: + type: string + required: + - nodeFunctionality + MultipleUnitUsage: + type: object + properties: + ratingGroup: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatingGroup' + usedUnitContainer: + type: array + items: + $ref: '#/components/schemas/UsedUnitContainer' + minItems: 0 + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + multihomedPDUAddress: + $ref: '#/components/schemas/PDUAddress' + required: + - ratingGroup + InvocationResult: + type: object + properties: + error: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ProblemDetails' + failureHandling: + $ref: '#/components/schemas/FailureHandling' + Trigger: + type: object + properties: + triggerType: + $ref: '#/components/schemas/TriggerType' + triggerCategory: + $ref: '#/components/schemas/TriggerCategory' + timeLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + volumeLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + volumeLimit64: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + eventLimit: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + maxNumberOfccc: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + required: + - triggerType + - triggerCategory + UsedUnitContainer: + type: object + properties: + serviceId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ServiceId' + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + triggerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + serviceSpecificUnits: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + eventTimeStamps: + type: array + + items: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + minItems: 0 + localSequenceNumber: + type: integer + pDUContainerInformation: + $ref: '#/components/schemas/PDUContainerInformation' + required: + - localSequenceNumber + PDUSessionChargingInformation: + type: object + properties: + chargingId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/ChargingId' + sMFChargingId: + type: string + userInformation: + $ref: '#/components/schemas/UserInformation' + userLocationinfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + mAPDUNon3GPPUserLocationInfo: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + userLocationTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + pduSessionInformation: + $ref: '#/components/schemas/PDUSessionInformation' + unitCountInactivityTimer: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DurationSec' + rANSecondaryRATUsageReport: + $ref: '#/components/schemas/RANSecondaryRATUsageReport' + required: + - pduSessionInformation + UserInformation: + type: object + properties: + servedGPSI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi' + servedPEI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Pei' + unauthenticatedFlag: + type: boolean + roamerInOut: + $ref: '#/components/schemas/RoamerInOut' + PDUSessionInformation: + type: object + properties: + networkSlicingInfo: + $ref: '#/components/schemas/NetworkSlicingInfo' + pduSessionID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionId' + pduType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PduSessionType' + sscMode: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SscMode' + hPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + servingNetworkFunctionID: + $ref: '#/components/schemas/ServingNetworkFunctionID' + ratType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + mAPDUNon3GPPRATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + dnnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn' + chargingCharacteristics: + type: string + chargingCharacteristicsSelectionMode: + $ref: '#/components/schemas/ChargingCharacteristicsSelectionMode' + startTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + stopTime: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + sessionStopIndicator: + type: boolean + pduAddress: + $ref: '#/components/schemas/PDUAddress' + diagnostics: + $ref: '#/components/schemas/Diagnostics' + authorizedQoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/AuthorizedDefaultQos' + subscribedQoSInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/SubscribedDefaultQos' + authorizedSessionAMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + subscribedSessionAMBR: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ambr' + servingCNPlmnId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId' + mAPDUSessionInformation: + $ref: '#/components/schemas/MAPDUSessionInformation' + enhancedDiagnostics: + $ref: '#/components/schemas/EnhancedDiagnostics5G' + required: + - pduSessionID + - dnnId + PDUContainerInformation: + type: object + properties: + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + aFCorrelationInformation: + type: string + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servingNodeID: + type: array + items: + $ref: '#/components/schemas/ServingNetworkFunctionID' + minItems: 0 + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + sponsorIdentity: + type: string + applicationserviceProviderIdentity: + type: string + chargingRuleBaseName: + type: string + mAPDUSteeringFunctionality: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/SteeringFunctionality' + mAPDUSteeringMode: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/SteeringMode' + NetworkSlicingInfo: + type: object + properties: + sNSSAI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai' + required: + - sNSSAI + PDUAddress: + type: object + properties: + pduIPv4Address: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr' + pduIPv6AddresswithPrefix: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Addr' + pduAddressprefixlength: + type: integer + iPv4dynamicAddressFlag: + type: boolean + iPv6dynamicPrefixFlag: + type: boolean + ServingNetworkFunctionID: + type: object + properties: + servingNetworkFunctionInformation: + $ref: '#/components/schemas/NFIdentification' + aMFId: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AmfId' + required: + - servingNetworkFunctionInformation + RoamingQBCInformation: + type: object + properties: + multipleQFIcontainer: + type: array + items: + $ref: '#/components/schemas/MultipleQFIcontainer' + minItems: 0 + uPFID: + $ref: 'TS29571_CommonData.yaml#/components/schemas/NfInstanceId' + roamingChargingProfile: + $ref: '#/components/schemas/RoamingChargingProfile' + MultipleQFIcontainer: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + triggerTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + time: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint32' + totalVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + localSequenceNumber: + type: integer + qFIContainerInformation: + $ref: '#/components/schemas/QFIContainerInformation' + required: + - localSequenceNumber + QFIContainerInformation: + type: object + properties: + qFI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + timeofFirstUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + timeofLastUsage: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + qoSInformation: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosData' + qoSCharacteristics: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/QosCharacteristics' + userLocationInformation: + $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation' + uetimeZone: + $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone' + presenceReportingAreaInformation: + type: object + additionalProperties: + $ref: 'TS29571_CommonData.yaml#/components/schemas/PresenceInfo' + minProperties: 0 + rATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + servingNetworkFunctionID: + type: array + items: + $ref: '#/components/schemas/ServingNetworkFunctionID' + minItems: 0 + 3gppPSDataOffStatus: + $ref: '#/components/schemas/3GPPPSDataOffStatus' + RoamingChargingProfile: + type: object + properties: + triggers: + type: array + items: + $ref: '#/components/schemas/Trigger' + minItems: 0 + partialRecordMethod: + $ref: '#/components/schemas/PartialRecordMethod' + RANSecondaryRATUsageReport: + type: object + properties: + rANSecondaryRATType: + $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType' + qosFlowsUsageReports: + type: array + items: + $ref: '#/components/schemas/QosFlowsUsageReport' + Diagnostics: + type: integer + IPFilterRule: + type: string + QosFlowsUsageReport: + type: object + properties: + qFI: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Qfi' + startTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + endTimestamp: + $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime' + uplinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + downlinkVolume: + $ref: 'TS29571_CommonData.yaml#/components/schemas/Uint64' + MAPDUSessionInformation: + type: object + properties: + mAPDUSessionIndicator: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/MaPduIndication' + aTSSSCapability: + $ref: 'TS29571_CommonData.yaml#/components/schemas/AtsssCapability' + EnhancedDiagnostics5G: + $ref: '#/components/schemas/RanNasCauseList' + RanNasCauseList: + type: array + items: + $ref: 'TS29512_Npcf_SMPolicyControl.yaml#/components/schemas/RanNasRelCause' + NodeFunctionality: + anyOf: + - type: string + enum: + - SMF + - SMSF # Included for backwards compatibility, shall not be used + - I-SMF + - type: string + ChargingCharacteristicsSelectionMode: + anyOf: + - type: string + enum: + - HOME_DEFAULT + - ROAMING_DEFAULT + - VISITING_DEFAULT + - type: string + TriggerType: + anyOf: + - type: string + enum: + - FINAL + - ABNORMAL_RELEASE + - QOS_CHANGE + - VOLUME_LIMIT + - TIME_LIMIT + - EVENT_LIMIT + - PLMN_CHANGE + - USER_LOCATION_CHANGE + - RAT_CHANGE + - SESSION_AMBR_CHANGE + - UE_TIMEZONE_CHANGE + - TARIFF_TIME_CHANGE + - MAX_NUMBER_OF_CHANGES_IN_CHARGING_CONDITIONS + - MANAGEMENT_INTERVENTION + - CHANGE_OF_UE_PRESENCE_IN_PRESENCE_REPORTING_AREA + - CHANGE_OF_3GPP_PS_DATA_OFF_STATUS + - SERVING_NODE_CHANGE + - REMOVAL_OF_UPF + - ADDITION_OF_UPF + - INSERTION_OF_ISMF + - REMOVAL_OF_ISMF + - CHANGE_OF_ISMF + - START_OF_SERVICE_DATA_FLOW + - GFBR_GUARANTEED_STATUS_CHANGE + - HANDOVER_CANCEL + - HANDOVER_START + - HANDOVER_COMPLETE + - ADDITION_OF_ACCESS + - REMOVAL_OF_ACCESS + - START_OF_SDF_ADDITIONAL_ACCESS + - type: string + TriggerCategory: + anyOf: + - type: string + enum: + - IMMEDIATE_REPORT + - DEFERRED_REPORT + - type: string + FailureHandling: + anyOf: + - type: string + enum: + - TERMINATE + - CONTINUE + - RETRY_AND_TERMINATE + - type: string + SessionFailover: + anyOf: + - type: string + enum: + - FAILOVER_NOT_SUPPORTED + - FAILOVER_SUPPORTED + - type: string + 3GPPPSDataOffStatus: + anyOf: + - type: string + enum: + - ACTIVE + - INACTIVE + - type: string + ResultCode: + anyOf: + - type: string + enum: + - SUCCESS + - END_USER_SERVICE_DENIED + - type: string + PartialRecordMethod: + anyOf: + - type: string + enum: + - DEFAULT + - INDIVIDUAL + - type: string + RoamerInOut: + anyOf: + - type: string + enum: + - IN_BOUND + - OUT_BOUND + - type: string diff --git a/tests/af/npcf-build.c b/tests/af/npcf-build.c index a5b9d43fc..1732070f9 100644 --- a/tests/af/npcf-build.c +++ b/tests/af/npcf-build.c @@ -102,12 +102,12 @@ ogs_sbi_request_t *af_npcf_policyauthorization_build_create( Event = ogs_calloc(1, sizeof(*Event)); ogs_assert(Event); - Event->event = OpenAPI_af_event_CHARGING_CORRELATION; + Event->event = OpenAPI_npcf_af_event_CHARGING_CORRELATION; OpenAPI_list_add(EventList, Event); Event = ogs_calloc(1, sizeof(*Event)); ogs_assert(Event); - Event->event = OpenAPI_af_event_ANI_REPORT; + Event->event = OpenAPI_npcf_af_event_ANI_REPORT; Event->notif_method = OpenAPI_af_notif_method_ONE_TIME; OpenAPI_list_add(EventList, Event); @@ -705,12 +705,12 @@ ogs_sbi_request_t *af_npcf_policyauthorization_build_create_video( Event = ogs_calloc(1, sizeof(*Event)); ogs_assert(Event); - Event->event = OpenAPI_af_event_CHARGING_CORRELATION; + Event->event = OpenAPI_npcf_af_event_CHARGING_CORRELATION; OpenAPI_list_add(EventList, Event); Event = ogs_calloc(1, sizeof(*Event)); ogs_assert(Event); - Event->event = OpenAPI_af_event_ANI_REPORT; + Event->event = OpenAPI_npcf_af_event_ANI_REPORT; Event->notif_method = OpenAPI_af_notif_method_ONE_TIME; OpenAPI_list_add(EventList, Event);